@spaceandtimelabs/dapp-mi-space-time 0.1.7-262 → 0.1.7-263
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{ErdWrapper-fc66ec4a.js → ErdWrapper-793629db.js} +1 -1
- package/build/assets/{Queries-50658c59.js → Queries-49b839b5.js} +1 -1
- package/build/assets/QueryEditorWrapper-e0796d12.js +1 -0
- package/build/assets/{index-509fb113.js → index-5bfe88a9.js} +1 -1
- package/build/assets/{index-442c55d4.js → index-5c707073.js} +1 -1
- package/build/assets/{index-a3d24cf1.js → index-a58871fd.js} +3 -3
- package/build/assets/{index-a58ebffd.js → index-ed989424.js} +1 -1
- package/build/assets/{vendor-charts-8b359e1f.js → vendor-charts-a0e04cd5.js} +2 -2
- package/build/assets/{vendor-editor-bf04225e.js → vendor-editor-7b15e8f0.js} +1 -1
- package/build/assets/{vendor-three-4428cd46.js → vendor-three-925330d2.js} +1 -1
- package/build/index.html +4 -4
- package/package.json +1 -1
- package/build/assets/QueryEditorWrapper-0d996bc1.js +0 -1
|
@@ -5688,7 +5688,7 @@ __p += '`),xr&&(Me+=`' +
|
|
|
5688
5688
|
function print() { __p += __j.call(arguments, '') }
|
|
5689
5689
|
`:`;
|
|
5690
5690
|
`)+Me+`return __p
|
|
5691
|
-
}`;var ur=YO(function(){return jr(ee,pt+"return "+Me).apply(r,oe)});if(ur.source=Me,BS(ur))throw ur;return ur}function Ire(v){return Kr(v).toLowerCase()}function Ore(v){return Kr(v).toUpperCase()}function Nre(v,_,P){if(v=Kr(v),v&&(P||_===r))return r6(v);if(!v||!(_=go(_)))return v;var V=ls(v),j=ls(_),ee=n6(V,j),oe=i6(V,j)+1;return ku(V,ee,oe).join("")}function Lre(v,_,P){if(v=Kr(v),v&&(P||_===r))return v.slice(0,o6(v)+1);if(!v||!(_=go(_)))return v;var V=ls(v),j=i6(V,ls(_))+1;return ku(V,0,j).join("")}function Pre(v,_,P){if(v=Kr(v),v&&(P||_===r))return v.replace(Vt,"");if(!v||!(_=go(_)))return v;var V=ls(v),j=n6(V,ls(_));return ku(V,j).join("")}function Mre(v,_){var P=I,V=$;if(Dn(_)){var j="separator"in _?_.separator:j;P="length"in _?sr(_.length):P,V="omission"in _?go(_.omission):V}v=Kr(v);var ee=v.length;if(Ud(v)){var oe=ls(v);ee=oe.length}if(P>=ee)return v;var ue=P-Fd(V);if(ue<1)return V;var he=oe?ku(oe,0,ue).join(""):v.slice(0,ue);if(j===r)return he+V;if(oe&&(ue+=he.length-ue),US(j)){if(v.slice(ue).search(j)){var Ce,xe=he;for(j.global||(j=tS(j.source,Kr(Pe.exec(j))+"g")),j.lastIndex=0;Ce=j.exec(xe);)var Me=Ce.index;he=he.slice(0,Me===r?ue:Me)}}else if(v.indexOf(go(j),ue)!=ue){var Qe=he.lastIndexOf(j);Qe>-1&&(he=he.slice(0,Qe))}return he+V}function Dre(v){return v=Kr(v),v&&kn.test(v)?v.replace(xt,cZ):v}var $re=Yd(function(v,_,P){return v+(P?" ":"")+_.toUpperCase()}),GS=q6("toUpperCase");function zO(v,_,P){return v=Kr(v),_=P?r:_,_===r?aZ(v)?hZ(v):KK(v):v.match(_)||[]}var YO=fr(function(v,_){try{return Ea(v,r,_)}catch(P){return BS(P)?P:new er(P)}}),kre=kl(function(v,_){return Uo(_,function(P){P=el(P),Dl(v,P,$S(v[P],v))}),v});function Bre(v){var _=v==null?0:v.length,P=St();return v=_?xn(v,function(V){if(typeof V[1]!="function")throw new Fo(o);return[P(V[0]),V[1]]}):[],fr(function(V){for(var j=-1;++j<_;){var ee=v[j];if(Ea(ee[0],this,V))return Ea(ee[1],this,V)}})}function Ure(v){return cQ(Go(v,f))}function VS(v){return function(){return v}}function Fre(v,_){return v==null||v!==v?_:v}var Hre=K6(),Gre=K6(!0);function qa(v){return v}function WS(v){return C6(typeof v=="function"?v:Go(v,f))}function Vre(v){return R6(Go(v,f))}function Wre(v,_){return I6(v,Go(_,f))}var jre=fr(function(v,_){return function(P){return fp(P,v,_)}}),zre=fr(function(v,_){return function(P){return fp(v,P,_)}});function jS(v,_,P){var V=Ui(_),j=fm(_,V);P==null&&!(Dn(_)&&(j.length||!V.length))&&(P=_,_=v,v=this,j=fm(_,Ui(_)));var ee=!(Dn(P)&&"chain"in P)||!!P.chain,oe=Ul(v);return Uo(j,function(ue){var he=_[ue];v[ue]=he,oe&&(v.prototype[ue]=function(){var Ce=this.__chain__;if(ee||Ce){var xe=v(this.__wrapped__),Me=xe.__actions__=ja(this.__actions__);return Me.push({func:he,args:arguments,thisArg:v}),xe.__chain__=Ce,xe}return he.apply(v,Nu([this.value()],arguments))})}),v}function Yre(){return bn._===this&&(bn._=EZ),this}function zS(){}function qre(v){return v=sr(v),fr(function(_){return O6(_,v)})}var Xre=wS(xn),Kre=wS(ZI),Zre=wS(q_);function qO(v){return OS(v)?X_(el(v)):xQ(v)}function Qre(v){return function(_){return v==null?r:of(v,_)}}var Jre=Q6(),ene=Q6(!0);function YS(){return[]}function qS(){return!1}function tne(){return{}}function rne(){return""}function nne(){return!0}function ine(v,_){if(v=sr(v),v<1||v>k)return[];var P=B,V=ua(v,B);_=St(_),v-=B;for(var j=Q_(V,_);++P<v;)_(P);return j}function ane(v){return rr(v)?xn(v,el):mo(v)?[v]:ja(pO(Kr(v)))}function one(v){var _=++mZ;return Kr(v)+_}var sne=mm(function(v,_){return v+_},0),lne=TS("ceil"),une=mm(function(v,_){return v/_},1),cne=TS("floor");function fne(v){return v&&v.length?cm(v,qa,uS):r}function dne(v,_){return v&&v.length?cm(v,St(_,2),uS):r}function hne(v){return e6(v,qa)}function pne(v,_){return e6(v,St(_,2))}function vne(v){return v&&v.length?cm(v,qa,hS):r}function gne(v,_){return v&&v.length?cm(v,St(_,2),hS):r}var mne=mm(function(v,_){return v*_},1),yne=TS("round"),Ene=mm(function(v,_){return v-_},0);function bne(v){return v&&v.length?Z_(v,qa):0}function _ne(v,_){return v&&v.length?Z_(v,St(_,2)):0}return Z.after=Vee,Z.ary=AO,Z.assign=Ote,Z.assignIn=UO,Z.assignInWith=Om,Z.assignWith=Nte,Z.at=Lte,Z.before=CO,Z.bind=$S,Z.bindAll=kre,Z.bindKey=xO,Z.castArray=tte,Z.chain=SO,Z.chunk=cJ,Z.compact=fJ,Z.concat=dJ,Z.cond=Bre,Z.conforms=Ure,Z.constant=VS,Z.countBy=bee,Z.create=Pte,Z.curry=RO,Z.curryRight=IO,Z.debounce=OO,Z.defaults=Mte,Z.defaultsDeep=Dte,Z.defer=Wee,Z.delay=jee,Z.difference=hJ,Z.differenceBy=pJ,Z.differenceWith=vJ,Z.drop=gJ,Z.dropRight=mJ,Z.dropRightWhile=yJ,Z.dropWhile=EJ,Z.fill=bJ,Z.filter=See,Z.flatMap=Aee,Z.flatMapDeep=Cee,Z.flatMapDepth=xee,Z.flatten=yO,Z.flattenDeep=_J,Z.flattenDepth=SJ,Z.flip=zee,Z.flow=Hre,Z.flowRight=Gre,Z.fromPairs=wJ,Z.functions=Gte,Z.functionsIn=Vte,Z.groupBy=Ree,Z.initial=AJ,Z.intersection=CJ,Z.intersectionBy=xJ,Z.intersectionWith=RJ,Z.invert=jte,Z.invertBy=zte,Z.invokeMap=Oee,Z.iteratee=WS,Z.keyBy=Nee,Z.keys=Ui,Z.keysIn=Ya,Z.map=Tm,Z.mapKeys=qte,Z.mapValues=Xte,Z.matches=Vre,Z.matchesProperty=Wre,Z.memoize=Cm,Z.merge=Kte,Z.mergeWith=FO,Z.method=jre,Z.methodOf=zre,Z.mixin=jS,Z.negate=xm,Z.nthArg=qre,Z.omit=Zte,Z.omitBy=Qte,Z.once=Yee,Z.orderBy=Lee,Z.over=Xre,Z.overArgs=qee,Z.overEvery=Kre,Z.overSome=Zre,Z.partial=kS,Z.partialRight=NO,Z.partition=Pee,Z.pick=Jte,Z.pickBy=HO,Z.property=qO,Z.propertyOf=Qre,Z.pull=LJ,Z.pullAll=bO,Z.pullAllBy=PJ,Z.pullAllWith=MJ,Z.pullAt=DJ,Z.range=Jre,Z.rangeRight=ene,Z.rearg=Xee,Z.reject=$ee,Z.remove=$J,Z.rest=Kee,Z.reverse=MS,Z.sampleSize=Bee,Z.set=tre,Z.setWith=rre,Z.shuffle=Uee,Z.slice=kJ,Z.sortBy=Gee,Z.sortedUniq=WJ,Z.sortedUniqBy=jJ,Z.split=Are,Z.spread=Zee,Z.tail=zJ,Z.take=YJ,Z.takeRight=qJ,Z.takeRightWhile=XJ,Z.takeWhile=KJ,Z.tap=fee,Z.throttle=Qee,Z.thru=wm,Z.toArray=$O,Z.toPairs=GO,Z.toPairsIn=VO,Z.toPath=ane,Z.toPlainObject=BO,Z.transform=nre,Z.unary=Jee,Z.union=ZJ,Z.unionBy=QJ,Z.unionWith=JJ,Z.uniq=eee,Z.uniqBy=tee,Z.uniqWith=ree,Z.unset=ire,Z.unzip=DS,Z.unzipWith=_O,Z.update=are,Z.updateWith=ore,Z.values=Kd,Z.valuesIn=sre,Z.without=nee,Z.words=zO,Z.wrap=ete,Z.xor=iee,Z.xorBy=aee,Z.xorWith=oee,Z.zip=see,Z.zipObject=lee,Z.zipObjectDeep=uee,Z.zipWith=cee,Z.entries=GO,Z.entriesIn=VO,Z.extend=UO,Z.extendWith=Om,jS(Z,Z),Z.add=sne,Z.attempt=YO,Z.camelCase=fre,Z.capitalize=WO,Z.ceil=lne,Z.clamp=lre,Z.clone=rte,Z.cloneDeep=ite,Z.cloneDeepWith=ate,Z.cloneWith=nte,Z.conformsTo=ote,Z.deburr=jO,Z.defaultTo=Fre,Z.divide=une,Z.endsWith=dre,Z.eq=cs,Z.escape=hre,Z.escapeRegExp=pre,Z.every=_ee,Z.find=wee,Z.findIndex=gO,Z.findKey=$te,Z.findLast=Tee,Z.findLastIndex=mO,Z.findLastKey=kte,Z.floor=cne,Z.forEach=wO,Z.forEachRight=TO,Z.forIn=Bte,Z.forInRight=Ute,Z.forOwn=Fte,Z.forOwnRight=Hte,Z.get=FS,Z.gt=ste,Z.gte=lte,Z.has=Wte,Z.hasIn=HS,Z.head=EO,Z.identity=qa,Z.includes=Iee,Z.indexOf=TJ,Z.inRange=ure,Z.invoke=Yte,Z.isArguments=uf,Z.isArray=rr,Z.isArrayBuffer=ute,Z.isArrayLike=za,Z.isArrayLikeObject=Zn,Z.isBoolean=cte,Z.isBuffer=Bu,Z.isDate=fte,Z.isElement=dte,Z.isEmpty=hte,Z.isEqual=pte,Z.isEqualWith=vte,Z.isError=BS,Z.isFinite=gte,Z.isFunction=Ul,Z.isInteger=LO,Z.isLength=Rm,Z.isMap=PO,Z.isMatch=mte,Z.isMatchWith=yte,Z.isNaN=Ete,Z.isNative=bte,Z.isNil=Ste,Z.isNull=_te,Z.isNumber=MO,Z.isObject=Dn,Z.isObjectLike=Vn,Z.isPlainObject=mp,Z.isRegExp=US,Z.isSafeInteger=wte,Z.isSet=DO,Z.isString=Im,Z.isSymbol=mo,Z.isTypedArray=Xd,Z.isUndefined=Tte,Z.isWeakMap=Ate,Z.isWeakSet=Cte,Z.join=IJ,Z.kebabCase=vre,Z.last=Wo,Z.lastIndexOf=OJ,Z.lowerCase=gre,Z.lowerFirst=mre,Z.lt=xte,Z.lte=Rte,Z.max=fne,Z.maxBy=dne,Z.mean=hne,Z.meanBy=pne,Z.min=vne,Z.minBy=gne,Z.stubArray=YS,Z.stubFalse=qS,Z.stubObject=tne,Z.stubString=rne,Z.stubTrue=nne,Z.multiply=mne,Z.nth=NJ,Z.noConflict=Yre,Z.noop=zS,Z.now=Am,Z.pad=yre,Z.padEnd=Ere,Z.padStart=bre,Z.parseInt=_re,Z.random=cre,Z.reduce=Mee,Z.reduceRight=Dee,Z.repeat=Sre,Z.replace=wre,Z.result=ere,Z.round=yne,Z.runInContext=de,Z.sample=kee,Z.size=Fee,Z.snakeCase=Tre,Z.some=Hee,Z.sortedIndex=BJ,Z.sortedIndexBy=UJ,Z.sortedIndexOf=FJ,Z.sortedLastIndex=HJ,Z.sortedLastIndexBy=GJ,Z.sortedLastIndexOf=VJ,Z.startCase=Cre,Z.startsWith=xre,Z.subtract=Ene,Z.sum=bne,Z.sumBy=_ne,Z.template=Rre,Z.times=ine,Z.toFinite=Fl,Z.toInteger=sr,Z.toLength=kO,Z.toLower=Ire,Z.toNumber=jo,Z.toSafeInteger=Ite,Z.toString=Kr,Z.toUpper=Ore,Z.trim=Nre,Z.trimEnd=Lre,Z.trimStart=Pre,Z.truncate=Mre,Z.unescape=Dre,Z.uniqueId=one,Z.upperCase=$re,Z.upperFirst=GS,Z.each=wO,Z.eachRight=TO,Z.first=EO,jS(Z,function(){var v={};return Qs(Z,function(_,P){tn.call(Z.prototype,P)||(v[P]=_)}),v}(),{chain:!1}),Z.VERSION=n,Uo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(v){Z[v].placeholder=Z}),Uo(["drop","take"],function(v,_){wr.prototype[v]=function(P){P=P===r?1:Ci(sr(P),0);var V=this.__filtered__&&!_?new wr(this):this.clone();return V.__filtered__?V.__takeCount__=ua(P,V.__takeCount__):V.__views__.push({size:ua(P,B),type:v+(V.__dir__<0?"Right":"")}),V},wr.prototype[v+"Right"]=function(P){return this.reverse()[v](P).reverse()}}),Uo(["filter","map","takeWhile"],function(v,_){var P=_+1,V=P==y||P==C;wr.prototype[v]=function(j){var ee=this.clone();return ee.__iteratees__.push({iteratee:St(j,3),type:P}),ee.__filtered__=ee.__filtered__||V,ee}}),Uo(["head","last"],function(v,_){var P="take"+(_?"Right":"");wr.prototype[v]=function(){return this[P](1).value()[0]}}),Uo(["initial","tail"],function(v,_){var P="drop"+(_?"":"Right");wr.prototype[v]=function(){return this.__filtered__?new wr(this):this[P](1)}}),wr.prototype.compact=function(){return this.filter(qa)},wr.prototype.find=function(v){return this.filter(v).head()},wr.prototype.findLast=function(v){return this.reverse().find(v)},wr.prototype.invokeMap=fr(function(v,_){return typeof v=="function"?new wr(this):this.map(function(P){return fp(P,v,_)})}),wr.prototype.reject=function(v){return this.filter(xm(St(v)))},wr.prototype.slice=function(v,_){v=sr(v);var P=this;return P.__filtered__&&(v>0||_<0)?new wr(P):(v<0?P=P.takeRight(-v):v&&(P=P.drop(v)),_!==r&&(_=sr(_),P=_<0?P.dropRight(-_):P.take(_-v)),P)},wr.prototype.takeRightWhile=function(v){return this.reverse().takeWhile(v).reverse()},wr.prototype.toArray=function(){return this.take(B)},Qs(wr.prototype,function(v,_){var P=/^(?:filter|find|map|reject)|While$/.test(_),V=/^(?:head|last)$/.test(_),j=Z[V?"take"+(_=="last"?"Right":""):_],ee=V||/^find/.test(_);j&&(Z.prototype[_]=function(){var oe=this.__wrapped__,ue=V?[1]:arguments,he=oe instanceof wr,Ce=ue[0],xe=he||rr(oe),Me=function(mr){var xr=j.apply(Z,Nu([mr],ue));return V&&Qe?xr[0]:xr};xe&&P&&typeof Ce=="function"&&Ce.length!=1&&(he=xe=!1);var Qe=this.__chain__,pt=!!this.__actions__.length,Rt=ee&&!Qe,ur=he&&!pt;if(!ee&&xe){oe=ur?oe:new wr(this);var It=v.apply(oe,ue);return It.__actions__.push({func:wm,args:[Me],thisArg:r}),new Ho(It,Qe)}return Rt&&ur?v.apply(this,ue):(It=this.thru(Me),Rt?V?It.value()[0]:It.value():It)})}),Uo(["pop","push","shift","sort","splice","unshift"],function(v){var _=Xg[v],P=/^(?:push|sort|unshift)$/.test(v)?"tap":"thru",V=/^(?:pop|shift)$/.test(v);Z.prototype[v]=function(){var j=arguments;if(V&&!this.__chain__){var ee=this.value();return _.apply(rr(ee)?ee:[],j)}return this[P](function(oe){return _.apply(rr(oe)?oe:[],j)})}}),Qs(wr.prototype,function(v,_){var P=Z[_];if(P){var V=P.name+"";tn.call(Wd,V)||(Wd[V]=[]),Wd[V].push({name:_,func:P})}}),Wd[gm(r,E).name]=[{name:"wrapper",func:r}],wr.prototype.clone=DZ,wr.prototype.reverse=$Z,wr.prototype.value=kZ,Z.prototype.at=dee,Z.prototype.chain=hee,Z.prototype.commit=pee,Z.prototype.next=vee,Z.prototype.plant=mee,Z.prototype.reverse=yee,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=Eee,Z.prototype.first=Z.prototype.head,ip&&(Z.prototype[ip]=gee),Z},Hd=pZ();Wa?((Wa.exports=Hd)._=Hd,xa._=Hd):bn._=Hd}).call(f8)})(phe,phe.exports);var h7t=Object.defineProperty,p7t=Object.defineProperties,v7t=Object.getOwnPropertyDescriptors,G4e=Object.getOwnPropertySymbols,g7t=Object.prototype.hasOwnProperty,m7t=Object.prototype.propertyIsEnumerable,V4e=(e,t,r)=>t in e?h7t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L$=(e,t)=>{for(var r in t||(t={}))g7t.call(t,r)&&V4e(e,r,t[r]);if(G4e)for(var r of G4e(t))m7t.call(t,r)&&V4e(e,r,t[r]);return e},y7t=(e,t)=>p7t(e,v7t(t));function Ib(e,t,r){var n;const i=g4t(e);return((n=t.rpcMap)==null?void 0:n[i.reference])||`${d7t}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function dA(e){return e.includes(":")?e.split(":")[1]:e}function rXe(e){return e.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function E7t(e,t){const r=Object.keys(t.namespaces).filter(i=>i.includes(e));if(!r.length)return[];const n=[];return r.forEach(i=>{const a=t.namespaces[i].accounts;n.push(...a)}),n}function b7t(e={},t={}){const r=W4e(e),n=W4e(t);return phe.exports.merge(r,n)}function W4e(e){var t,r,n,i;const a={};if(!JC(e))return a;for(const[o,s]of Object.entries(e)){const l=Bye(o)?[o]:s.chains,u=s.methods||[],c=s.events||[],f=s.rpcMap||{},d=JN(o);a[d]=y7t(L$(L$({},a[d]),s),{chains:Kne(l,(t=a[d])==null?void 0:t.chains),methods:Kne(u,(r=a[d])==null?void 0:r.methods),events:Kne(c,(n=a[d])==null?void 0:n.events),rpcMap:L$(L$({},f),(i=a[d])==null?void 0:i.rpcMap)})}return a}function _7t(e){return e.includes(":")?e.split(":")[2]:e}function S7t(e){const t={};for(const[r,n]of Object.entries(e)){const i=n.methods||[],a=n.events||[],o=n.accounts||[],s=Bye(r)?[r]:n.chains?n.chains:rXe(n.accounts);t[r]={chains:s,methods:i,events:a,accounts:o}}return t}function mie(e){return typeof e=="number"?e:e.includes("0x")?parseInt(e,16):e.includes(":")?Number(e.split(":")[1]):Number(e)}const nXe={},is=e=>nXe[e],yie=(e,t)=>{nXe[e]=t};let w7t=class{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}},T7t=class{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r),this.chainId=parseInt(t),this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){const n=r||Ib(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(dA(r));t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}async handleSwitchChain(t){var r,n;let i=t.request.params?(r=t.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}};class A7t{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class C7t{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class x7t{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=dA(r);t[i]=this.createHttpProvider(i,n)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}getCardanoRPCUrl(t){const r=this.namespace.rpcMap;if(r)return r[t]}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||this.getCardanoRPCUrl(t);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class R7t{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class I7t{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class O7t{constructor(t){this.name="near",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const n=r||Ib(`${this.name}:${t}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,n)}this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;t[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace);return typeof n>"u"?void 0:new o2(new v_(n,is("disableProviderPing")))}}var N7t=Object.defineProperty,L7t=Object.defineProperties,P7t=Object.getOwnPropertyDescriptors,j4e=Object.getOwnPropertySymbols,M7t=Object.prototype.hasOwnProperty,D7t=Object.prototype.propertyIsEnumerable,z4e=(e,t,r)=>t in e?N7t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P$=(e,t)=>{for(var r in t||(t={}))M7t.call(t,r)&&z4e(e,r,t[r]);if(j4e)for(var r of j4e(t))D7t.call(t,r)&&z4e(e,r,t[r]);return e},Eie=(e,t)=>L7t(e,P7t(t));class e2e{constructor(t){this.events=new xye,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:$j(kj({level:(t==null?void 0:t.logger)||F4e})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const r=new e2e(t);return await r.initialize(),r}async request(t,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:P$({},t),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(t,r,n){const i=new Date().getTime();this.request(t,n).then(a=>r(null,Uj(i,a))).catch(a=>r(a,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Us("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(a=>{this.session=a,this.namespaces||(this.namespaces=S7t(a.namespaces),this.persist("namespaces",this.namespaces))}).catch(a=>{if(a.message!==eXe)throw a;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;const[n,i]=this.validateChain(t);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(yg(r)){for(const n of r)t.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await e7t.init({logger:this.providerOpts.logger||F4e,relayUrl:this.providerOpts.relayUrl||u7t,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(r=>JN(r)))];yie("client",this.client),yie("events",this.events),yie("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;const n=E7t(r,this.session),i=rXe(n),a=b7t(this.namespaces,this.optionalNamespaces),o=Eie(P$({},a[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new T7t({namespace:o});break;case"solana":this.rpcProviders[r]=new A7t({namespace:o});break;case"cosmos":this.rpcProviders[r]=new C7t({namespace:o});break;case"polkadot":this.rpcProviders[r]=new w7t({namespace:o});break;case"cip34":this.rpcProviders[r]=new x7t({namespace:o});break;case"elrond":this.rpcProviders[r]=new R7t({namespace:o});break;case"multiversx":this.rpcProviders[r]=new I7t({namespace:o});break;case"near":this.rpcProviders[r]=new O7t({namespace:o});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:r}=t,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&yg(i)&&this.events.emit("accountsChanged",i.map(_7t))}else if(n.name==="chainChanged"){const i=r.chainId,a=r.event.data,o=JN(i),s=mie(i)!==mie(a)?`${o}:${mie(a)}`:i;this.onChainChanged(s)}else this.events.emit(n.name,n.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{var n;const{namespaces:i}=r,a=(n=this.client)==null?void 0:n.session.get(t);this.session=Eie(P$({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",Eie(P$({},Us("USER_DISCONNECTED")),{data:t.topic}))}),this.on(s2.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace((r=this.session)==null?void 0:r.namespaces[t])})}setNamespaces(t){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=t;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(t){const[r,n]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>JN(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=JN(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,r=!1){var n;if(!this.namespaces)return;const[i,a]=this.validateChain(t);r||this.getProvider(i).setDefaultChain(a),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${a}`]).defaultChain=a,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",a)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,r){this.client.core.storage.setItem(`${H4e}/${t}`,r)}async getFromStore(t){return await this.client.core.storage.getItem(`${H4e}/${t}`)}}const $7t=e2e,k7t="wc",B7t="ethereum_provider",U7t=`${k7t}@2:${B7t}:`,F7t="https://rpc.walletconnect.com/v1/",vhe=["eth_sendTransaction","personal_sign"],H7t=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],ghe=["chainChanged","accountsChanged"],G7t=["chainChanged","accountsChanged","message","disconnect","connect"];var V7t=Object.defineProperty,W7t=Object.defineProperties,j7t=Object.getOwnPropertyDescriptors,Y4e=Object.getOwnPropertySymbols,z7t=Object.prototype.hasOwnProperty,Y7t=Object.prototype.propertyIsEnumerable,q4e=(e,t,r)=>t in e?V7t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tL=(e,t)=>{for(var r in t||(t={}))z7t.call(t,r)&&q4e(e,r,t[r]);if(Y4e)for(var r of Y4e(t))Y7t.call(t,r)&&q4e(e,r,t[r]);return e},X4e=(e,t)=>W7t(e,j7t(t));function cG(e){return Number(e[0].split(":")[1])}function bie(e){return`0x${e.toString(16)}`}function q7t(e){const{chains:t,optionalChains:r,methods:n,optionalMethods:i,events:a,optionalEvents:o,rpcMap:s}=e;if(!yg(t))throw new Error("Invalid chains");const l={chains:t,methods:n||vhe,events:a||ghe,rpcMap:tL({},t.length?{[cG(t)]:s[cG(t)]}:{})},u=a==null?void 0:a.filter(h=>!ghe.includes(h)),c=n==null?void 0:n.filter(h=>!vhe.includes(h));if(!r&&!o&&!i&&!(u!=null&&u.length)&&!(c!=null&&c.length))return{required:t.length?l:void 0};const f=(u==null?void 0:u.length)&&(c==null?void 0:c.length)||!r,d={chains:[...new Set(f?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(i!=null&&i.length?i:H7t))],events:[...new Set(l.events.concat(o!=null&&o.length?o:G7t))],rpcMap:s};return{required:t.length?l:void 0,optional:r.length?d:void 0}}let X7t=class iXe{constructor(){this.events=new qc.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=U7t,this.on=(t,r)=>(this.events.on(t,r),this),this.once=(t,r)=>(this.events.once(t,r),this),this.removeListener=(t,r)=>(this.events.removeListener(t,r),this),this.off=(t,r)=>(this.events.off(t,r),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const r=new iXe;return await r.initialize(t),r}async request(t){return await this.signer.request(t,this.formatChainId(this.chainId))}sendAsync(t,r){this.signer.sendAsync(t,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:r,optional:n}=q7t(this.rpc);try{const i=await new Promise(async(o,s)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),s(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(X4e(tL({namespaces:tL({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(u=>{o(u)}).catch(u=>{s(new Error(u.message))})});if(!i)return;const a=m4t(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:bie(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:r}=t,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const r=parseInt(t);this.chainId=r,this.events.emit("chainChanged",bie(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",X4e(tL({},Us("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const r=t.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",bie(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const r=this.parseChainId(t);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(t){const[r,n,i]=t.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(t){this.accounts=t.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var r,n;const i=(r=t==null?void 0:t.chains)!=null?r:[],a=(n=t==null?void 0:t.optionalChains)!=null?n:[],o=i.concat(a);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const s=i.length?(t==null?void 0:t.methods)||vhe:[],l=i.length?(t==null?void 0:t.events)||ghe:[],u=(t==null?void 0:t.optionalMethods)||[],c=(t==null?void 0:t.optionalEvents)||[],f=(t==null?void 0:t.rpcMap)||this.buildRpcMap(o,t.projectId),d=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(h=>this.formatChainId(h)),optionalChains:a.map(h=>this.formatChainId(h)),methods:s,events:l,optionalMethods:u,optionalEvents:c,rpcMap:f,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:d,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,r){const n={};return t.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?cG(this.rpc.chains):cG(this.rpc.optionalChains),this.signer=await $7t.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await kde(()=>import("./index-442c55d4.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(tL({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:r,optionalChains:n,rpcMap:i}=t;r&&yg(r)&&(this.rpc.chains=r.map(a=>this.formatChainId(a)),r.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)})),n&&yg(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)}))}getRpcUrl(t,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[t])||`${F7t}?chainId=eip155:${t}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(r=>this.parseAccount(r))}};var t2e={exports:{}};t2e.exports;(function(e){(function(t,r){function n(D,y){if(!D)throw new Error(y||"Assertion failed")}function i(D,y){D.super_=y;var S=function(){};S.prototype=y.prototype,D.prototype=new S,D.prototype.constructor=D}function a(D,y,S){if(a.isBN(D))return D;this.negative=0,this.words=null,this.length=0,this.red=null,D!==null&&((y==="le"||y==="be")&&(S=y,y=10),this._init(D||0,y||10,S||"be"))}typeof t=="object"?t.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=sA.Buffer}catch{}a.isBN=function(y){return y instanceof a?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===a.wordSize&&Array.isArray(y.words)},a.max=function(y,S){return y.cmp(S)>0?y:S},a.min=function(y,S){return y.cmp(S)<0?y:S},a.prototype._init=function(y,S,C){if(typeof y=="number")return this._initNumber(y,S,C);if(typeof y=="object")return this._initArray(y,S,C);S==="hex"&&(S=16),n(S===(S|0)&&S>=2&&S<=36),y=y.toString().replace(/\s+/g,"");var M=0;y[0]==="-"&&(M++,this.negative=1),M<y.length&&(S===16?this._parseHex(y,M,C):(this._parseBase(y,S,M),C==="le"&&this._initArray(this.toArray(),S,C)))},a.prototype._initNumber=function(y,S,C){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(n(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),C==="le"&&this._initArray(this.toArray(),S,C)},a.prototype._initArray=function(y,S,C){if(n(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var k,U,G=0;if(C==="be")for(M=y.length-1,k=0;M>=0;M-=3)U=y[M]|y[M-1]<<8|y[M-2]<<16,this.words[k]|=U<<G&67108863,this.words[k+1]=U>>>26-G&67108863,G+=24,G>=26&&(G-=26,k++);else if(C==="le")for(M=0,k=0;M<y.length;M+=3)U=y[M]|y[M+1]<<8|y[M+2]<<16,this.words[k]|=U<<G&67108863,this.words[k+1]=U>>>26-G&67108863,G+=24,G>=26&&(G-=26,k++);return this._strip()};function s(D,y){var S=D.charCodeAt(y);if(S>=48&&S<=57)return S-48;if(S>=65&&S<=70)return S-55;if(S>=97&&S<=102)return S-87;n(!1,"Invalid character in "+D)}function l(D,y,S){var C=s(D,S);return S-1>=y&&(C|=s(D,S-1)<<4),C}a.prototype._parseHex=function(y,S,C){this.length=Math.ceil((y.length-S)/6),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var k=0,U=0,G;if(C==="be")for(M=y.length-1;M>=S;M-=2)G=l(y,S,M)<<k,this.words[U]|=G&67108863,k>=18?(k-=18,U+=1,this.words[U]|=G>>>26):k+=8;else{var B=y.length-S;for(M=B%2===0?S+1:S;M<y.length;M+=2)G=l(y,S,M)<<k,this.words[U]|=G&67108863,k>=18?(k-=18,U+=1,this.words[U]|=G>>>26):k+=8}this._strip()};function u(D,y,S,C){for(var M=0,k=0,U=Math.min(D.length,S),G=y;G<U;G++){var B=D.charCodeAt(G)-48;M*=C,B>=49?k=B-49+10:B>=17?k=B-17+10:k=B,n(B>=0&&k<C,"Invalid character"),M+=k}return M}a.prototype._parseBase=function(y,S,C){this.words=[0],this.length=1;for(var M=0,k=1;k<=67108863;k*=S)M++;M--,k=k/S|0;for(var U=y.length-C,G=U%M,B=Math.min(U,U-G)+C,R=0,H=C;H<B;H+=M)R=u(y,H,H+M,S),this.imuln(k),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(G!==0){var q=1;for(R=u(y,H,y.length,S),H=0;H<G;H++)q*=S;this.imuln(q),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},a.prototype.copy=function(y){y.words=new Array(this.length);for(var S=0;S<this.length;S++)y.words[S]=this.words[S];y.length=this.length,y.negative=this.negative,y.red=this.red};function c(D,y){D.words=y.words,D.length=y.length,D.negative=y.negative,D.red=y.red}if(a.prototype._move=function(y){c(y,this)},a.prototype.clone=function(){var y=new a(null);return this.copy(y),y},a.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(y,S){y=y||10,S=S|0||1;var C;if(y===16||y==="hex"){C="";for(var M=0,k=0,U=0;U<this.length;U++){var G=this.words[U],B=((G<<M|k)&16777215).toString(16);k=G>>>24-M&16777215,M+=2,M>=26&&(M-=26,U--),k!==0||U!==this.length-1?C=d[6-B.length]+B+C:C=B+C}for(k!==0&&(C=k.toString(16)+C);C.length%S!==0;)C="0"+C;return this.negative!==0&&(C="-"+C),C}if(y===(y|0)&&y>=2&&y<=36){var R=h[y],H=p[y];C="";var q=this.clone();for(q.negative=0;!q.isZero();){var W=q.modrn(H).toString(y);q=q.idivn(H),q.isZero()?C=W+C:C=d[R-W.length]+W+C}for(this.isZero()&&(C="0"+C);C.length%S!==0;)C="0"+C;return this.negative!==0&&(C="-"+C),C}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(y,S){return this.toArrayLike(o,y,S)}),a.prototype.toArray=function(y,S){return this.toArrayLike(Array,y,S)};var g=function(y,S){return y.allocUnsafe?y.allocUnsafe(S):new y(S)};a.prototype.toArrayLike=function(y,S,C){this._strip();var M=this.byteLength(),k=C||Math.max(1,M);n(M<=k,"byte array longer than desired length"),n(k>0,"Requested array length <= 0");var U=g(y,k),G=S==="le"?"LE":"BE";return this["_toArrayLike"+G](U,M),U},a.prototype._toArrayLikeLE=function(y,S){for(var C=0,M=0,k=0,U=0;k<this.length;k++){var G=this.words[k]<<U|M;y[C++]=G&255,C<y.length&&(y[C++]=G>>8&255),C<y.length&&(y[C++]=G>>16&255),U===6?(C<y.length&&(y[C++]=G>>24&255),M=0,U=0):(M=G>>>24,U+=2)}if(C<y.length)for(y[C++]=M;C<y.length;)y[C++]=0},a.prototype._toArrayLikeBE=function(y,S){for(var C=y.length-1,M=0,k=0,U=0;k<this.length;k++){var G=this.words[k]<<U|M;y[C--]=G&255,C>=0&&(y[C--]=G>>8&255),C>=0&&(y[C--]=G>>16&255),U===6?(C>=0&&(y[C--]=G>>24&255),M=0,U=0):(M=G>>>24,U+=2)}if(C>=0)for(y[C--]=M;C>=0;)y[C--]=0},Math.clz32?a.prototype._countBits=function(y){return 32-Math.clz32(y)}:a.prototype._countBits=function(y){var S=y,C=0;return S>=4096&&(C+=13,S>>>=13),S>=64&&(C+=7,S>>>=7),S>=8&&(C+=4,S>>>=4),S>=2&&(C+=2,S>>>=2),C+S},a.prototype._zeroBits=function(y){if(y===0)return 26;var S=y,C=0;return S&8191||(C+=13,S>>>=13),S&127||(C+=7,S>>>=7),S&15||(C+=4,S>>>=4),S&3||(C+=2,S>>>=2),S&1||C++,C},a.prototype.bitLength=function(){var y=this.words[this.length-1],S=this._countBits(y);return(this.length-1)*26+S};function m(D){for(var y=new Array(D.bitLength()),S=0;S<y.length;S++){var C=S/26|0,M=S%26;y[S]=D.words[C]>>>M&1}return y}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,S=0;S<this.length;S++){var C=this._zeroBits(this.words[S]);if(y+=C,C!==26)break}return y},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},a.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var S=0;S<y.length;S++)this.words[S]=this.words[S]|y.words[S];return this._strip()},a.prototype.ior=function(y){return n((this.negative|y.negative)===0),this.iuor(y)},a.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},a.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},a.prototype.iuand=function(y){var S;this.length>y.length?S=y:S=this;for(var C=0;C<S.length;C++)this.words[C]=this.words[C]&y.words[C];return this.length=S.length,this._strip()},a.prototype.iand=function(y){return n((this.negative|y.negative)===0),this.iuand(y)},a.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},a.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},a.prototype.iuxor=function(y){var S,C;this.length>y.length?(S=this,C=y):(S=y,C=this);for(var M=0;M<C.length;M++)this.words[M]=S.words[M]^C.words[M];if(this!==S)for(;M<S.length;M++)this.words[M]=S.words[M];return this.length=S.length,this._strip()},a.prototype.ixor=function(y){return n((this.negative|y.negative)===0),this.iuxor(y)},a.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},a.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},a.prototype.inotn=function(y){n(typeof y=="number"&&y>=0);var S=Math.ceil(y/26)|0,C=y%26;this._expand(S),C>0&&S--;for(var M=0;M<S;M++)this.words[M]=~this.words[M]&67108863;return C>0&&(this.words[M]=~this.words[M]&67108863>>26-C),this._strip()},a.prototype.notn=function(y){return this.clone().inotn(y)},a.prototype.setn=function(y,S){n(typeof y=="number"&&y>=0);var C=y/26|0,M=y%26;return this._expand(C+1),S?this.words[C]=this.words[C]|1<<M:this.words[C]=this.words[C]&~(1<<M),this._strip()},a.prototype.iadd=function(y){var S;if(this.negative!==0&&y.negative===0)return this.negative=0,S=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,S=this.isub(y),y.negative=1,S._normSign();var C,M;this.length>y.length?(C=this,M=y):(C=y,M=this);for(var k=0,U=0;U<M.length;U++)S=(C.words[U]|0)+(M.words[U]|0)+k,this.words[U]=S&67108863,k=S>>>26;for(;k!==0&&U<C.length;U++)S=(C.words[U]|0)+k,this.words[U]=S&67108863,k=S>>>26;if(this.length=C.length,k!==0)this.words[this.length]=k,this.length++;else if(C!==this)for(;U<C.length;U++)this.words[U]=C.words[U];return this},a.prototype.add=function(y){var S;return y.negative!==0&&this.negative===0?(y.negative=0,S=this.sub(y),y.negative^=1,S):y.negative===0&&this.negative!==0?(this.negative=0,S=y.sub(this),this.negative=1,S):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},a.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var S=this.iadd(y);return y.negative=1,S._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var C=this.cmp(y);if(C===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,k;C>0?(M=this,k=y):(M=y,k=this);for(var U=0,G=0;G<k.length;G++)S=(M.words[G]|0)-(k.words[G]|0)+U,U=S>>26,this.words[G]=S&67108863;for(;U!==0&&G<M.length;G++)S=(M.words[G]|0)+U,U=S>>26,this.words[G]=S&67108863;if(U===0&&G<M.length&&M!==this)for(;G<M.length;G++)this.words[G]=M.words[G];return this.length=Math.max(this.length,G),M!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(y){return this.clone().isub(y)};function E(D,y,S){S.negative=y.negative^D.negative;var C=D.length+y.length|0;S.length=C,C=C-1|0;var M=D.words[0]|0,k=y.words[0]|0,U=M*k,G=U&67108863,B=U/67108864|0;S.words[0]=G;for(var R=1;R<C;R++){for(var H=B>>>26,q=B&67108863,W=Math.min(R,y.length-1),Y=Math.max(0,R-D.length+1);Y<=W;Y++){var re=R-Y|0;M=D.words[re]|0,k=y.words[Y]|0,U=M*k+q,H+=U/67108864|0,q=U&67108863}S.words[R]=q|0,B=H|0}return B!==0?S.words[R]=B|0:S.length--,S._strip()}var b=function(y,S,C){var M=y.words,k=S.words,U=C.words,G=0,B,R,H,q=M[0]|0,W=q&8191,Y=q>>>13,re=M[1]|0,Q=re&8191,ie=re>>>13,ce=M[2]|0,te=ce&8191,J=ce>>>13,ge=M[3]|0,fe=ge&8191,ye=ge>>>13,Ue=M[4]|0,me=Ue&8191,Be=Ue>>>13,et=M[5]|0,Ge=et&8191,Ae=et>>>13,We=M[6]|0,Le=We&8191,Ie=We>>>13,tt=M[7]|0,Ve=tt&8191,ne=tt>>>13,X=M[8]|0,K=X&8191,le=X>>>13,ve=M[9]|0,Ee=ve&8191,we=ve>>>13,ft=k[0]|0,Fe=ft&8191,Xe=ft>>>13,Qt=k[1]|0,it=Qt&8191,Tt=Qt>>>13,Hr=k[2]|0,xt=Hr&8191,Mt=Hr>>>13,kn=k[3]|0,Ot=kn&8191,qt=kn>>>13,Vi=k[4]|0,ct=Vi&8191,_t=Vi>>>13,Ki=k[5]|0,Jt=Ki&8191,zt=Ki>>>13,aa=k[6]|0,Vt=aa&8191,Ft=aa>>>13,Wi=k[7]|0,vt=Wi&8191,Nt=Wi>>>13,qr=k[8]|0,yt=qr&8191,Lt=qr>>>13,oa=k[9]|0,Pe=oa&8191,De=oa>>>13;C.negative=y.negative^S.negative,C.length=19,B=Math.imul(W,Fe),R=Math.imul(W,Xe),R=R+Math.imul(Y,Fe)|0,H=Math.imul(Y,Xe);var Pt=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,B=Math.imul(Q,Fe),R=Math.imul(Q,Xe),R=R+Math.imul(ie,Fe)|0,H=Math.imul(ie,Xe),B=B+Math.imul(W,it)|0,R=R+Math.imul(W,Tt)|0,R=R+Math.imul(Y,it)|0,H=H+Math.imul(Y,Tt)|0;var Sr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,B=Math.imul(te,Fe),R=Math.imul(te,Xe),R=R+Math.imul(J,Fe)|0,H=Math.imul(J,Xe),B=B+Math.imul(Q,it)|0,R=R+Math.imul(Q,Tt)|0,R=R+Math.imul(ie,it)|0,H=H+Math.imul(ie,Tt)|0,B=B+Math.imul(W,xt)|0,R=R+Math.imul(W,Mt)|0,R=R+Math.imul(Y,xt)|0,H=H+Math.imul(Y,Mt)|0;var Mr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,B=Math.imul(fe,Fe),R=Math.imul(fe,Xe),R=R+Math.imul(ye,Fe)|0,H=Math.imul(ye,Xe),B=B+Math.imul(te,it)|0,R=R+Math.imul(te,Tt)|0,R=R+Math.imul(J,it)|0,H=H+Math.imul(J,Tt)|0,B=B+Math.imul(Q,xt)|0,R=R+Math.imul(Q,Mt)|0,R=R+Math.imul(ie,xt)|0,H=H+Math.imul(ie,Mt)|0,B=B+Math.imul(W,Ot)|0,R=R+Math.imul(W,qt)|0,R=R+Math.imul(Y,Ot)|0,H=H+Math.imul(Y,qt)|0;var un=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(un>>>26)|0,un&=67108863,B=Math.imul(me,Fe),R=Math.imul(me,Xe),R=R+Math.imul(Be,Fe)|0,H=Math.imul(Be,Xe),B=B+Math.imul(fe,it)|0,R=R+Math.imul(fe,Tt)|0,R=R+Math.imul(ye,it)|0,H=H+Math.imul(ye,Tt)|0,B=B+Math.imul(te,xt)|0,R=R+Math.imul(te,Mt)|0,R=R+Math.imul(J,xt)|0,H=H+Math.imul(J,Mt)|0,B=B+Math.imul(Q,Ot)|0,R=R+Math.imul(Q,qt)|0,R=R+Math.imul(ie,Ot)|0,H=H+Math.imul(ie,qt)|0,B=B+Math.imul(W,ct)|0,R=R+Math.imul(W,_t)|0,R=R+Math.imul(Y,ct)|0,H=H+Math.imul(Y,_t)|0;var fn=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(fn>>>26)|0,fn&=67108863,B=Math.imul(Ge,Fe),R=Math.imul(Ge,Xe),R=R+Math.imul(Ae,Fe)|0,H=Math.imul(Ae,Xe),B=B+Math.imul(me,it)|0,R=R+Math.imul(me,Tt)|0,R=R+Math.imul(Be,it)|0,H=H+Math.imul(Be,Tt)|0,B=B+Math.imul(fe,xt)|0,R=R+Math.imul(fe,Mt)|0,R=R+Math.imul(ye,xt)|0,H=H+Math.imul(ye,Mt)|0,B=B+Math.imul(te,Ot)|0,R=R+Math.imul(te,qt)|0,R=R+Math.imul(J,Ot)|0,H=H+Math.imul(J,qt)|0,B=B+Math.imul(Q,ct)|0,R=R+Math.imul(Q,_t)|0,R=R+Math.imul(ie,ct)|0,H=H+Math.imul(ie,_t)|0,B=B+Math.imul(W,Jt)|0,R=R+Math.imul(W,zt)|0,R=R+Math.imul(Y,Jt)|0,H=H+Math.imul(Y,zt)|0;var ri=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(ri>>>26)|0,ri&=67108863,B=Math.imul(Le,Fe),R=Math.imul(Le,Xe),R=R+Math.imul(Ie,Fe)|0,H=Math.imul(Ie,Xe),B=B+Math.imul(Ge,it)|0,R=R+Math.imul(Ge,Tt)|0,R=R+Math.imul(Ae,it)|0,H=H+Math.imul(Ae,Tt)|0,B=B+Math.imul(me,xt)|0,R=R+Math.imul(me,Mt)|0,R=R+Math.imul(Be,xt)|0,H=H+Math.imul(Be,Mt)|0,B=B+Math.imul(fe,Ot)|0,R=R+Math.imul(fe,qt)|0,R=R+Math.imul(ye,Ot)|0,H=H+Math.imul(ye,qt)|0,B=B+Math.imul(te,ct)|0,R=R+Math.imul(te,_t)|0,R=R+Math.imul(J,ct)|0,H=H+Math.imul(J,_t)|0,B=B+Math.imul(Q,Jt)|0,R=R+Math.imul(Q,zt)|0,R=R+Math.imul(ie,Jt)|0,H=H+Math.imul(ie,zt)|0,B=B+Math.imul(W,Vt)|0,R=R+Math.imul(W,Ft)|0,R=R+Math.imul(Y,Vt)|0,H=H+Math.imul(Y,Ft)|0;var no=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(no>>>26)|0,no&=67108863,B=Math.imul(Ve,Fe),R=Math.imul(Ve,Xe),R=R+Math.imul(ne,Fe)|0,H=Math.imul(ne,Xe),B=B+Math.imul(Le,it)|0,R=R+Math.imul(Le,Tt)|0,R=R+Math.imul(Ie,it)|0,H=H+Math.imul(Ie,Tt)|0,B=B+Math.imul(Ge,xt)|0,R=R+Math.imul(Ge,Mt)|0,R=R+Math.imul(Ae,xt)|0,H=H+Math.imul(Ae,Mt)|0,B=B+Math.imul(me,Ot)|0,R=R+Math.imul(me,qt)|0,R=R+Math.imul(Be,Ot)|0,H=H+Math.imul(Be,qt)|0,B=B+Math.imul(fe,ct)|0,R=R+Math.imul(fe,_t)|0,R=R+Math.imul(ye,ct)|0,H=H+Math.imul(ye,_t)|0,B=B+Math.imul(te,Jt)|0,R=R+Math.imul(te,zt)|0,R=R+Math.imul(J,Jt)|0,H=H+Math.imul(J,zt)|0,B=B+Math.imul(Q,Vt)|0,R=R+Math.imul(Q,Ft)|0,R=R+Math.imul(ie,Vt)|0,H=H+Math.imul(ie,Ft)|0,B=B+Math.imul(W,vt)|0,R=R+Math.imul(W,Nt)|0,R=R+Math.imul(Y,vt)|0,H=H+Math.imul(Y,Nt)|0;var Zi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,B=Math.imul(K,Fe),R=Math.imul(K,Xe),R=R+Math.imul(le,Fe)|0,H=Math.imul(le,Xe),B=B+Math.imul(Ve,it)|0,R=R+Math.imul(Ve,Tt)|0,R=R+Math.imul(ne,it)|0,H=H+Math.imul(ne,Tt)|0,B=B+Math.imul(Le,xt)|0,R=R+Math.imul(Le,Mt)|0,R=R+Math.imul(Ie,xt)|0,H=H+Math.imul(Ie,Mt)|0,B=B+Math.imul(Ge,Ot)|0,R=R+Math.imul(Ge,qt)|0,R=R+Math.imul(Ae,Ot)|0,H=H+Math.imul(Ae,qt)|0,B=B+Math.imul(me,ct)|0,R=R+Math.imul(me,_t)|0,R=R+Math.imul(Be,ct)|0,H=H+Math.imul(Be,_t)|0,B=B+Math.imul(fe,Jt)|0,R=R+Math.imul(fe,zt)|0,R=R+Math.imul(ye,Jt)|0,H=H+Math.imul(ye,zt)|0,B=B+Math.imul(te,Vt)|0,R=R+Math.imul(te,Ft)|0,R=R+Math.imul(J,Vt)|0,H=H+Math.imul(J,Ft)|0,B=B+Math.imul(Q,vt)|0,R=R+Math.imul(Q,Nt)|0,R=R+Math.imul(ie,vt)|0,H=H+Math.imul(ie,Nt)|0,B=B+Math.imul(W,yt)|0,R=R+Math.imul(W,Lt)|0,R=R+Math.imul(Y,yt)|0,H=H+Math.imul(Y,Lt)|0;var po=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(po>>>26)|0,po&=67108863,B=Math.imul(Ee,Fe),R=Math.imul(Ee,Xe),R=R+Math.imul(we,Fe)|0,H=Math.imul(we,Xe),B=B+Math.imul(K,it)|0,R=R+Math.imul(K,Tt)|0,R=R+Math.imul(le,it)|0,H=H+Math.imul(le,Tt)|0,B=B+Math.imul(Ve,xt)|0,R=R+Math.imul(Ve,Mt)|0,R=R+Math.imul(ne,xt)|0,H=H+Math.imul(ne,Mt)|0,B=B+Math.imul(Le,Ot)|0,R=R+Math.imul(Le,qt)|0,R=R+Math.imul(Ie,Ot)|0,H=H+Math.imul(Ie,qt)|0,B=B+Math.imul(Ge,ct)|0,R=R+Math.imul(Ge,_t)|0,R=R+Math.imul(Ae,ct)|0,H=H+Math.imul(Ae,_t)|0,B=B+Math.imul(me,Jt)|0,R=R+Math.imul(me,zt)|0,R=R+Math.imul(Be,Jt)|0,H=H+Math.imul(Be,zt)|0,B=B+Math.imul(fe,Vt)|0,R=R+Math.imul(fe,Ft)|0,R=R+Math.imul(ye,Vt)|0,H=H+Math.imul(ye,Ft)|0,B=B+Math.imul(te,vt)|0,R=R+Math.imul(te,Nt)|0,R=R+Math.imul(J,vt)|0,H=H+Math.imul(J,Nt)|0,B=B+Math.imul(Q,yt)|0,R=R+Math.imul(Q,Lt)|0,R=R+Math.imul(ie,yt)|0,H=H+Math.imul(ie,Lt)|0,B=B+Math.imul(W,Pe)|0,R=R+Math.imul(W,De)|0,R=R+Math.imul(Y,Pe)|0,H=H+Math.imul(Y,De)|0;var sa=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(sa>>>26)|0,sa&=67108863,B=Math.imul(Ee,it),R=Math.imul(Ee,Tt),R=R+Math.imul(we,it)|0,H=Math.imul(we,Tt),B=B+Math.imul(K,xt)|0,R=R+Math.imul(K,Mt)|0,R=R+Math.imul(le,xt)|0,H=H+Math.imul(le,Mt)|0,B=B+Math.imul(Ve,Ot)|0,R=R+Math.imul(Ve,qt)|0,R=R+Math.imul(ne,Ot)|0,H=H+Math.imul(ne,qt)|0,B=B+Math.imul(Le,ct)|0,R=R+Math.imul(Le,_t)|0,R=R+Math.imul(Ie,ct)|0,H=H+Math.imul(Ie,_t)|0,B=B+Math.imul(Ge,Jt)|0,R=R+Math.imul(Ge,zt)|0,R=R+Math.imul(Ae,Jt)|0,H=H+Math.imul(Ae,zt)|0,B=B+Math.imul(me,Vt)|0,R=R+Math.imul(me,Ft)|0,R=R+Math.imul(Be,Vt)|0,H=H+Math.imul(Be,Ft)|0,B=B+Math.imul(fe,vt)|0,R=R+Math.imul(fe,Nt)|0,R=R+Math.imul(ye,vt)|0,H=H+Math.imul(ye,Nt)|0,B=B+Math.imul(te,yt)|0,R=R+Math.imul(te,Lt)|0,R=R+Math.imul(J,yt)|0,H=H+Math.imul(J,Lt)|0,B=B+Math.imul(Q,Pe)|0,R=R+Math.imul(Q,De)|0,R=R+Math.imul(ie,Pe)|0,H=H+Math.imul(ie,De)|0;var Ca=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,B=Math.imul(Ee,xt),R=Math.imul(Ee,Mt),R=R+Math.imul(we,xt)|0,H=Math.imul(we,Mt),B=B+Math.imul(K,Ot)|0,R=R+Math.imul(K,qt)|0,R=R+Math.imul(le,Ot)|0,H=H+Math.imul(le,qt)|0,B=B+Math.imul(Ve,ct)|0,R=R+Math.imul(Ve,_t)|0,R=R+Math.imul(ne,ct)|0,H=H+Math.imul(ne,_t)|0,B=B+Math.imul(Le,Jt)|0,R=R+Math.imul(Le,zt)|0,R=R+Math.imul(Ie,Jt)|0,H=H+Math.imul(Ie,zt)|0,B=B+Math.imul(Ge,Vt)|0,R=R+Math.imul(Ge,Ft)|0,R=R+Math.imul(Ae,Vt)|0,H=H+Math.imul(Ae,Ft)|0,B=B+Math.imul(me,vt)|0,R=R+Math.imul(me,Nt)|0,R=R+Math.imul(Be,vt)|0,H=H+Math.imul(Be,Nt)|0,B=B+Math.imul(fe,yt)|0,R=R+Math.imul(fe,Lt)|0,R=R+Math.imul(ye,yt)|0,H=H+Math.imul(ye,Lt)|0,B=B+Math.imul(te,Pe)|0,R=R+Math.imul(te,De)|0,R=R+Math.imul(J,Pe)|0,H=H+Math.imul(J,De)|0;var Jr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,B=Math.imul(Ee,Ot),R=Math.imul(Ee,qt),R=R+Math.imul(we,Ot)|0,H=Math.imul(we,qt),B=B+Math.imul(K,ct)|0,R=R+Math.imul(K,_t)|0,R=R+Math.imul(le,ct)|0,H=H+Math.imul(le,_t)|0,B=B+Math.imul(Ve,Jt)|0,R=R+Math.imul(Ve,zt)|0,R=R+Math.imul(ne,Jt)|0,H=H+Math.imul(ne,zt)|0,B=B+Math.imul(Le,Vt)|0,R=R+Math.imul(Le,Ft)|0,R=R+Math.imul(Ie,Vt)|0,H=H+Math.imul(Ie,Ft)|0,B=B+Math.imul(Ge,vt)|0,R=R+Math.imul(Ge,Nt)|0,R=R+Math.imul(Ae,vt)|0,H=H+Math.imul(Ae,Nt)|0,B=B+Math.imul(me,yt)|0,R=R+Math.imul(me,Lt)|0,R=R+Math.imul(Be,yt)|0,H=H+Math.imul(Be,Lt)|0,B=B+Math.imul(fe,Pe)|0,R=R+Math.imul(fe,De)|0,R=R+Math.imul(ye,Pe)|0,H=H+Math.imul(ye,De)|0;var Oi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,B=Math.imul(Ee,ct),R=Math.imul(Ee,_t),R=R+Math.imul(we,ct)|0,H=Math.imul(we,_t),B=B+Math.imul(K,Jt)|0,R=R+Math.imul(K,zt)|0,R=R+Math.imul(le,Jt)|0,H=H+Math.imul(le,zt)|0,B=B+Math.imul(Ve,Vt)|0,R=R+Math.imul(Ve,Ft)|0,R=R+Math.imul(ne,Vt)|0,H=H+Math.imul(ne,Ft)|0,B=B+Math.imul(Le,vt)|0,R=R+Math.imul(Le,Nt)|0,R=R+Math.imul(Ie,vt)|0,H=H+Math.imul(Ie,Nt)|0,B=B+Math.imul(Ge,yt)|0,R=R+Math.imul(Ge,Lt)|0,R=R+Math.imul(Ae,yt)|0,H=H+Math.imul(Ae,Lt)|0,B=B+Math.imul(me,Pe)|0,R=R+Math.imul(me,De)|0,R=R+Math.imul(Be,Pe)|0,H=H+Math.imul(Be,De)|0;var hi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(hi>>>26)|0,hi&=67108863,B=Math.imul(Ee,Jt),R=Math.imul(Ee,zt),R=R+Math.imul(we,Jt)|0,H=Math.imul(we,zt),B=B+Math.imul(K,Vt)|0,R=R+Math.imul(K,Ft)|0,R=R+Math.imul(le,Vt)|0,H=H+Math.imul(le,Ft)|0,B=B+Math.imul(Ve,vt)|0,R=R+Math.imul(Ve,Nt)|0,R=R+Math.imul(ne,vt)|0,H=H+Math.imul(ne,Nt)|0,B=B+Math.imul(Le,yt)|0,R=R+Math.imul(Le,Lt)|0,R=R+Math.imul(Ie,yt)|0,H=H+Math.imul(Ie,Lt)|0,B=B+Math.imul(Ge,Pe)|0,R=R+Math.imul(Ge,De)|0,R=R+Math.imul(Ae,Pe)|0,H=H+Math.imul(Ae,De)|0;var Bo=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,B=Math.imul(Ee,Vt),R=Math.imul(Ee,Ft),R=R+Math.imul(we,Vt)|0,H=Math.imul(we,Ft),B=B+Math.imul(K,vt)|0,R=R+Math.imul(K,Nt)|0,R=R+Math.imul(le,vt)|0,H=H+Math.imul(le,Nt)|0,B=B+Math.imul(Ve,yt)|0,R=R+Math.imul(Ve,Lt)|0,R=R+Math.imul(ne,yt)|0,H=H+Math.imul(ne,Lt)|0,B=B+Math.imul(Le,Pe)|0,R=R+Math.imul(Le,De)|0,R=R+Math.imul(Ie,Pe)|0,H=H+Math.imul(Ie,De)|0;var ss=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(ss>>>26)|0,ss&=67108863,B=Math.imul(Ee,vt),R=Math.imul(Ee,Nt),R=R+Math.imul(we,vt)|0,H=Math.imul(we,Nt),B=B+Math.imul(K,yt)|0,R=R+Math.imul(K,Lt)|0,R=R+Math.imul(le,yt)|0,H=H+Math.imul(le,Lt)|0,B=B+Math.imul(Ve,Pe)|0,R=R+Math.imul(Ve,De)|0,R=R+Math.imul(ne,Pe)|0,H=H+Math.imul(ne,De)|0;var Nl=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Nl>>>26)|0,Nl&=67108863,B=Math.imul(Ee,yt),R=Math.imul(Ee,Lt),R=R+Math.imul(we,yt)|0,H=Math.imul(we,Lt),B=B+Math.imul(K,Pe)|0,R=R+Math.imul(K,De)|0,R=R+Math.imul(le,Pe)|0,H=H+Math.imul(le,De)|0;var Ll=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,B=Math.imul(Ee,Pe),R=Math.imul(Ee,De),R=R+Math.imul(we,Pe)|0,H=Math.imul(we,De);var pe=(G+B|0)+((R&8191)<<13)|0;return G=(H+(R>>>13)|0)+(pe>>>26)|0,pe&=67108863,U[0]=Pt,U[1]=Sr,U[2]=Mr,U[3]=un,U[4]=fn,U[5]=ri,U[6]=no,U[7]=Zi,U[8]=po,U[9]=sa,U[10]=Ca,U[11]=Jr,U[12]=Oi,U[13]=hi,U[14]=Bo,U[15]=ss,U[16]=Nl,U[17]=Ll,U[18]=pe,G!==0&&(U[19]=G,C.length++),C};Math.imul||(b=E);function w(D,y,S){S.negative=y.negative^D.negative,S.length=D.length+y.length;for(var C=0,M=0,k=0;k<S.length-1;k++){var U=M;M=0;for(var G=C&67108863,B=Math.min(k,y.length-1),R=Math.max(0,k-D.length+1);R<=B;R++){var H=k-R,q=D.words[H]|0,W=y.words[R]|0,Y=q*W,re=Y&67108863;U=U+(Y/67108864|0)|0,re=re+G|0,G=re&67108863,U=U+(re>>>26)|0,M+=U>>>26,U&=67108863}S.words[k]=G,C=U,U=M}return C!==0?S.words[k]=C:S.length--,S._strip()}function T(D,y,S){return w(D,y,S)}a.prototype.mulTo=function(y,S){var C,M=this.length+y.length;return this.length===10&&y.length===10?C=b(this,y,S):M<63?C=E(this,y,S):M<1024?C=w(this,y,S):C=T(this,y,S),C},a.prototype.mul=function(y){var S=new a(null);return S.words=new Array(this.length+y.length),this.mulTo(y,S)},a.prototype.mulf=function(y){var S=new a(null);return S.words=new Array(this.length+y.length),T(this,y,S)},a.prototype.imul=function(y){return this.clone().mulTo(y,this)},a.prototype.imuln=function(y){var S=y<0;S&&(y=-y),n(typeof y=="number"),n(y<67108864);for(var C=0,M=0;M<this.length;M++){var k=(this.words[M]|0)*y,U=(k&67108863)+(C&67108863);C>>=26,C+=k/67108864|0,C+=U>>>26,this.words[M]=U&67108863}return C!==0&&(this.words[M]=C,this.length++),S?this.ineg():this},a.prototype.muln=function(y){return this.clone().imuln(y)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(y){var S=m(y);if(S.length===0)return new a(1);for(var C=this,M=0;M<S.length&&S[M]===0;M++,C=C.sqr());if(++M<S.length)for(var k=C.sqr();M<S.length;M++,k=k.sqr())S[M]!==0&&(C=C.mul(k));return C},a.prototype.iushln=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26,M=67108863>>>26-S<<26-S,k;if(S!==0){var U=0;for(k=0;k<this.length;k++){var G=this.words[k]&M,B=(this.words[k]|0)-G<<S;this.words[k]=B|U,U=G>>>26-S}U&&(this.words[k]=U,this.length++)}if(C!==0){for(k=this.length-1;k>=0;k--)this.words[k+C]=this.words[k];for(k=0;k<C;k++)this.words[k]=0;this.length+=C}return this._strip()},a.prototype.ishln=function(y){return n(this.negative===0),this.iushln(y)},a.prototype.iushrn=function(y,S,C){n(typeof y=="number"&&y>=0);var M;S?M=(S-S%26)/26:M=0;var k=y%26,U=Math.min((y-k)/26,this.length),G=67108863^67108863>>>k<<k,B=C;if(M-=U,M=Math.max(0,M),B){for(var R=0;R<U;R++)B.words[R]=this.words[R];B.length=U}if(U!==0)if(this.length>U)for(this.length-=U,R=0;R<this.length;R++)this.words[R]=this.words[R+U];else this.words[0]=0,this.length=1;var H=0;for(R=this.length-1;R>=0&&(H!==0||R>=M);R--){var q=this.words[R]|0;this.words[R]=H<<26-k|q>>>k,H=q&G}return B&&H!==0&&(B.words[B.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(y,S,C){return n(this.negative===0),this.iushrn(y,S,C)},a.prototype.shln=function(y){return this.clone().ishln(y)},a.prototype.ushln=function(y){return this.clone().iushln(y)},a.prototype.shrn=function(y){return this.clone().ishrn(y)},a.prototype.ushrn=function(y){return this.clone().iushrn(y)},a.prototype.testn=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26,M=1<<S;if(this.length<=C)return!1;var k=this.words[C];return!!(k&M)},a.prototype.imaskn=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=C)return this;if(S!==0&&C++,this.length=Math.min(C,this.length),S!==0){var M=67108863^67108863>>>S<<S;this.words[this.length-1]&=M}return this._strip()},a.prototype.maskn=function(y){return this.clone().imaskn(y)},a.prototype.iaddn=function(y){return n(typeof y=="number"),n(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},a.prototype._iaddn=function(y){this.words[0]+=y;for(var S=0;S<this.length&&this.words[S]>=67108864;S++)this.words[S]-=67108864,S===this.length-1?this.words[S+1]=1:this.words[S+1]++;return this.length=Math.max(this.length,S+1),this},a.prototype.isubn=function(y){if(n(typeof y=="number"),n(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var S=0;S<this.length&&this.words[S]<0;S++)this.words[S]+=67108864,this.words[S+1]-=1;return this._strip()},a.prototype.addn=function(y){return this.clone().iaddn(y)},a.prototype.subn=function(y){return this.clone().isubn(y)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(y,S,C){var M=y.length+C,k;this._expand(M);var U,G=0;for(k=0;k<y.length;k++){U=(this.words[k+C]|0)+G;var B=(y.words[k]|0)*S;U-=B&67108863,G=(U>>26)-(B/67108864|0),this.words[k+C]=U&67108863}for(;k<this.length-C;k++)U=(this.words[k+C]|0)+G,G=U>>26,this.words[k+C]=U&67108863;if(G===0)return this._strip();for(n(G===-1),G=0,k=0;k<this.length;k++)U=-(this.words[k]|0)+G,G=U>>26,this.words[k]=U&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(y,S){var C=this.length-y.length,M=this.clone(),k=y,U=k.words[k.length-1]|0,G=this._countBits(U);C=26-G,C!==0&&(k=k.ushln(C),M.iushln(C),U=k.words[k.length-1]|0);var B=M.length-k.length,R;if(S!=="mod"){R=new a(null),R.length=B+1,R.words=new Array(R.length);for(var H=0;H<R.length;H++)R.words[H]=0}var q=M.clone()._ishlnsubmul(k,1,B);q.negative===0&&(M=q,R&&(R.words[B]=1));for(var W=B-1;W>=0;W--){var Y=(M.words[k.length+W]|0)*67108864+(M.words[k.length+W-1]|0);for(Y=Math.min(Y/U|0,67108863),M._ishlnsubmul(k,Y,W);M.negative!==0;)Y--,M.negative=0,M._ishlnsubmul(k,1,W),M.isZero()||(M.negative^=1);R&&(R.words[W]=Y)}return R&&R._strip(),M._strip(),S!=="div"&&C!==0&&M.iushrn(C),{div:R||null,mod:M}},a.prototype.divmod=function(y,S,C){if(n(!y.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var M,k,U;return this.negative!==0&&y.negative===0?(U=this.neg().divmod(y,S),S!=="mod"&&(M=U.div.neg()),S!=="div"&&(k=U.mod.neg(),C&&k.negative!==0&&k.iadd(y)),{div:M,mod:k}):this.negative===0&&y.negative!==0?(U=this.divmod(y.neg(),S),S!=="mod"&&(M=U.div.neg()),{div:M,mod:U.mod}):this.negative&y.negative?(U=this.neg().divmod(y.neg(),S),S!=="div"&&(k=U.mod.neg(),C&&k.negative!==0&&k.isub(y)),{div:U.div,mod:k}):y.length>this.length||this.cmp(y)<0?{div:new a(0),mod:this}:y.length===1?S==="div"?{div:this.divn(y.words[0]),mod:null}:S==="mod"?{div:null,mod:new a(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new a(this.modrn(y.words[0]))}:this._wordDiv(y,S)},a.prototype.div=function(y){return this.divmod(y,"div",!1).div},a.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},a.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},a.prototype.divRound=function(y){var S=this.divmod(y);if(S.mod.isZero())return S.div;var C=S.div.negative!==0?S.mod.isub(y):S.mod,M=y.ushrn(1),k=y.andln(1),U=C.cmp(M);return U<0||k===1&&U===0?S.div:S.div.negative!==0?S.div.isubn(1):S.div.iaddn(1)},a.prototype.modrn=function(y){var S=y<0;S&&(y=-y),n(y<=67108863);for(var C=(1<<26)%y,M=0,k=this.length-1;k>=0;k--)M=(C*M+(this.words[k]|0))%y;return S?-M:M},a.prototype.modn=function(y){return this.modrn(y)},a.prototype.idivn=function(y){var S=y<0;S&&(y=-y),n(y<=67108863);for(var C=0,M=this.length-1;M>=0;M--){var k=(this.words[M]|0)+C*67108864;this.words[M]=k/y|0,C=k%y}return this._strip(),S?this.ineg():this},a.prototype.divn=function(y){return this.clone().idivn(y)},a.prototype.egcd=function(y){n(y.negative===0),n(!y.isZero());var S=this,C=y.clone();S.negative!==0?S=S.umod(y):S=S.clone();for(var M=new a(1),k=new a(0),U=new a(0),G=new a(1),B=0;S.isEven()&&C.isEven();)S.iushrn(1),C.iushrn(1),++B;for(var R=C.clone(),H=S.clone();!S.isZero();){for(var q=0,W=1;!(S.words[0]&W)&&q<26;++q,W<<=1);if(q>0)for(S.iushrn(q);q-- >0;)(M.isOdd()||k.isOdd())&&(M.iadd(R),k.isub(H)),M.iushrn(1),k.iushrn(1);for(var Y=0,re=1;!(C.words[0]&re)&&Y<26;++Y,re<<=1);if(Y>0)for(C.iushrn(Y);Y-- >0;)(U.isOdd()||G.isOdd())&&(U.iadd(R),G.isub(H)),U.iushrn(1),G.iushrn(1);S.cmp(C)>=0?(S.isub(C),M.isub(U),k.isub(G)):(C.isub(S),U.isub(M),G.isub(k))}return{a:U,b:G,gcd:C.iushln(B)}},a.prototype._invmp=function(y){n(y.negative===0),n(!y.isZero());var S=this,C=y.clone();S.negative!==0?S=S.umod(y):S=S.clone();for(var M=new a(1),k=new a(0),U=C.clone();S.cmpn(1)>0&&C.cmpn(1)>0;){for(var G=0,B=1;!(S.words[0]&B)&&G<26;++G,B<<=1);if(G>0)for(S.iushrn(G);G-- >0;)M.isOdd()&&M.iadd(U),M.iushrn(1);for(var R=0,H=1;!(C.words[0]&H)&&R<26;++R,H<<=1);if(R>0)for(C.iushrn(R);R-- >0;)k.isOdd()&&k.iadd(U),k.iushrn(1);S.cmp(C)>=0?(S.isub(C),M.isub(k)):(C.isub(S),k.isub(M))}var q;return S.cmpn(1)===0?q=M:q=k,q.cmpn(0)<0&&q.iadd(y),q},a.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var S=this.clone(),C=y.clone();S.negative=0,C.negative=0;for(var M=0;S.isEven()&&C.isEven();M++)S.iushrn(1),C.iushrn(1);do{for(;S.isEven();)S.iushrn(1);for(;C.isEven();)C.iushrn(1);var k=S.cmp(C);if(k<0){var U=S;S=C,C=U}else if(k===0||C.cmpn(1)===0)break;S.isub(C)}while(!0);return C.iushln(M)},a.prototype.invm=function(y){return this.egcd(y).a.umod(y)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(y){return this.words[0]&y},a.prototype.bincn=function(y){n(typeof y=="number");var S=y%26,C=(y-S)/26,M=1<<S;if(this.length<=C)return this._expand(C+1),this.words[C]|=M,this;for(var k=M,U=C;k!==0&&U<this.length;U++){var G=this.words[U]|0;G+=k,k=G>>>26,G&=67108863,this.words[U]=G}return k!==0&&(this.words[U]=k,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(y){var S=y<0;if(this.negative!==0&&!S)return-1;if(this.negative===0&&S)return 1;this._strip();var C;if(this.length>1)C=1;else{S&&(y=-y),n(y<=67108863,"Number is too big");var M=this.words[0]|0;C=M===y?0:M<y?-1:1}return this.negative!==0?-C|0:C},a.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var S=this.ucmp(y);return this.negative!==0?-S|0:S},a.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var S=0,C=this.length-1;C>=0;C--){var M=this.words[C]|0,k=y.words[C]|0;if(M!==k){M<k?S=-1:M>k&&(S=1);break}}return S},a.prototype.gtn=function(y){return this.cmpn(y)===1},a.prototype.gt=function(y){return this.cmp(y)===1},a.prototype.gten=function(y){return this.cmpn(y)>=0},a.prototype.gte=function(y){return this.cmp(y)>=0},a.prototype.ltn=function(y){return this.cmpn(y)===-1},a.prototype.lt=function(y){return this.cmp(y)===-1},a.prototype.lten=function(y){return this.cmpn(y)<=0},a.prototype.lte=function(y){return this.cmp(y)<=0},a.prototype.eqn=function(y){return this.cmpn(y)===0},a.prototype.eq=function(y){return this.cmp(y)===0},a.red=function(y){return new $(y)},a.prototype.toRed=function(y){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(y){return this.red=y,this},a.prototype.forceRed=function(y){return n(!this.red,"Already a number in reduction context"),this._forceRed(y)},a.prototype.redAdd=function(y){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},a.prototype.redIAdd=function(y){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},a.prototype.redSub=function(y){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},a.prototype.redISub=function(y){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},a.prototype.redShl=function(y){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},a.prototype.redMul=function(y){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},a.prototype.redIMul=function(y){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(y){return n(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var x={k256:null,p224:null,p192:null,p25519:null};function N(D,y){this.name=D,this.p=new a(y,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var y=new a(null);return y.words=new Array(Math.ceil(this.n/13)),y},N.prototype.ireduce=function(y){var S=y,C;do this.split(S,this.tmp),S=this.imulK(S),S=S.iadd(this.tmp),C=S.bitLength();while(C>this.n);var M=C<this.n?-1:S.ucmp(this.p);return M===0?(S.words[0]=0,S.length=1):M>0?S.isub(this.p):S.strip!==void 0?S.strip():S._strip(),S},N.prototype.split=function(y,S){y.iushrn(this.n,0,S)},N.prototype.imulK=function(y){return y.imul(this.k)};function A(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(A,N),A.prototype.split=function(y,S){for(var C=4194303,M=Math.min(y.length,9),k=0;k<M;k++)S.words[k]=y.words[k];if(S.length=M,y.length<=9){y.words[0]=0,y.length=1;return}var U=y.words[9];for(S.words[S.length++]=U&C,k=10;k<y.length;k++){var G=y.words[k]|0;y.words[k-10]=(G&C)<<4|U>>>22,U=G}U>>>=22,y.words[k-10]=U,U===0&&y.length>10?y.length-=10:y.length-=9},A.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var S=0,C=0;C<y.length;C++){var M=y.words[C]|0;S+=M*977,y.words[C]=S&67108863,S=M*64+(S/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function L(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(L,N);function O(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(O,N);function I(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(I,N),I.prototype.imulK=function(y){for(var S=0,C=0;C<y.length;C++){var M=(y.words[C]|0)*19+S,k=M&67108863;M>>>=26,y.words[C]=k,S=M}return S!==0&&(y.words[y.length++]=S),y},a._prime=function(y){if(x[y])return x[y];var S;if(y==="k256")S=new A;else if(y==="p224")S=new L;else if(y==="p192")S=new O;else if(y==="p25519")S=new I;else throw new Error("Unknown prime "+y);return x[y]=S,S};function $(D){if(typeof D=="string"){var y=a._prime(D);this.m=y.p,this.prime=y}else n(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}$.prototype._verify1=function(y){n(y.negative===0,"red works only with positives"),n(y.red,"red works only with red numbers")},$.prototype._verify2=function(y,S){n((y.negative|S.negative)===0,"red works only with positives"),n(y.red&&y.red===S.red,"red works only with red numbers")},$.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(c(y,y.umod(this.m)._forceRed(this)),y)},$.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},$.prototype.add=function(y,S){this._verify2(y,S);var C=y.add(S);return C.cmp(this.m)>=0&&C.isub(this.m),C._forceRed(this)},$.prototype.iadd=function(y,S){this._verify2(y,S);var C=y.iadd(S);return C.cmp(this.m)>=0&&C.isub(this.m),C},$.prototype.sub=function(y,S){this._verify2(y,S);var C=y.sub(S);return C.cmpn(0)<0&&C.iadd(this.m),C._forceRed(this)},$.prototype.isub=function(y,S){this._verify2(y,S);var C=y.isub(S);return C.cmpn(0)<0&&C.iadd(this.m),C},$.prototype.shl=function(y,S){return this._verify1(y),this.imod(y.ushln(S))},$.prototype.imul=function(y,S){return this._verify2(y,S),this.imod(y.imul(S))},$.prototype.mul=function(y,S){return this._verify2(y,S),this.imod(y.mul(S))},$.prototype.isqr=function(y){return this.imul(y,y.clone())},$.prototype.sqr=function(y){return this.mul(y,y)},$.prototype.sqrt=function(y){if(y.isZero())return y.clone();var S=this.m.andln(3);if(n(S%2===1),S===3){var C=this.m.add(new a(1)).iushrn(2);return this.pow(y,C)}for(var M=this.m.subn(1),k=0;!M.isZero()&&M.andln(1)===0;)k++,M.iushrn(1);n(!M.isZero());var U=new a(1).toRed(this),G=U.redNeg(),B=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new a(2*R*R).toRed(this);this.pow(R,B).cmp(G)!==0;)R.redIAdd(G);for(var H=this.pow(R,M),q=this.pow(y,M.addn(1).iushrn(1)),W=this.pow(y,M),Y=k;W.cmp(U)!==0;){for(var re=W,Q=0;re.cmp(U)!==0;Q++)re=re.redSqr();n(Q<Y);var ie=this.pow(H,new a(1).iushln(Y-Q-1));q=q.redMul(ie),H=ie.redSqr(),W=W.redMul(H),Y=Q}return q},$.prototype.invm=function(y){var S=y._invmp(this.m);return S.negative!==0?(S.negative=0,this.imod(S).redNeg()):this.imod(S)},$.prototype.pow=function(y,S){if(S.isZero())return new a(1).toRed(this);if(S.cmpn(1)===0)return y.clone();var C=4,M=new Array(1<<C);M[0]=new a(1).toRed(this),M[1]=y;for(var k=2;k<M.length;k++)M[k]=this.mul(M[k-1],y);var U=M[0],G=0,B=0,R=S.bitLength()%26;for(R===0&&(R=26),k=S.length-1;k>=0;k--){for(var H=S.words[k],q=R-1;q>=0;q--){var W=H>>q&1;if(U!==M[0]&&(U=this.sqr(U)),W===0&&G===0){B=0;continue}G<<=1,G|=W,B++,!(B!==C&&(k!==0||q!==0))&&(U=this.mul(U,M[G]),B=0,G=0)}R=26}return U},$.prototype.convertTo=function(y){var S=y.umod(this.m);return S===y?S.clone():S},$.prototype.convertFrom=function(y){var S=y.clone();return S.red=null,S},a.mont=function(y){return new F(y)};function F(D){$.call(this,D),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(F,$),F.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},F.prototype.convertFrom=function(y){var S=this.imod(y.mul(this.rinv));return S.red=null,S},F.prototype.imul=function(y,S){if(y.isZero()||S.isZero())return y.words[0]=0,y.length=1,y;var C=y.imul(S),M=C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=C.isub(M).iushrn(this.shift),U=k;return k.cmp(this.m)>=0?U=k.isub(this.m):k.cmpn(0)<0&&(U=k.iadd(this.m)),U._forceRed(this)},F.prototype.mul=function(y,S){if(y.isZero()||S.isZero())return new a(0)._forceRed(this);var C=y.mul(S),M=C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=C.isub(M).iushrn(this.shift),U=k;return k.cmp(this.m)>=0?U=k.isub(this.m):k.cmpn(0)<0&&(U=k.iadd(this.m)),U._forceRed(this)},F.prototype.invm=function(y){var S=this.imod(y._invmp(this.m).mul(this.r2));return S._forceRed(this)}})(e,gt)})(t2e);var K7t=t2e.exports;const Z7t=Nn(K7t),Q7t="logger/5.7.0";let K4e=!1,Z4e=!1;const sF={debug:1,default:2,info:2,warning:3,error:4,off:5};let Q4e=sF.default,_ie=null;function J7t(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}const J4e=J7t();var mhe;(function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"})(mhe||(mhe={}));var Qh;(function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"})(Qh||(Qh={}));const exe="0123456789abcdef";class Ne{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,r){const n=t.toLowerCase();sF[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Q4e>sF[n])&&console.log.apply(console,r)}debug(...t){this._log(Ne.levels.DEBUG,t)}info(...t){this._log(Ne.levels.INFO,t)}warn(...t){this._log(Ne.levels.WARNING,t)}makeError(t,r,n){if(Z4e)return this.makeError("censored error",r,{});r||(r=Ne.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let c="";for(let f=0;f<u.length;f++)c+=exe[u[f]>>4],c+=exe[u[f]&15];i.push(l+"=Uint8Array(0x"+c+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const a=t;let o="";switch(r){case Qh.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=t;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Qh.CALL_EXCEPTION:case Qh.INSUFFICIENT_FUNDS:case Qh.MISSING_NEW:case Qh.NONCE_EXPIRED:case Qh.REPLACEMENT_UNDERPRICED:case Qh.TRANSACTION_REPLACED:case Qh.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=r,Object.keys(n).forEach(function(l){s[l]=n[l]}),s}throwError(t,r,n){throw this.makeError(t,r,n)}throwArgumentError(t,r,n){return this.throwError(t,Ne.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(t,r,n,i){t||this.throwError(r,n,i)}assertArgument(t,r,n,i){t||this.throwArgumentError(r,n,i)}checkNormalize(t){J4e&&this.throwError("platform missing String.prototype.normalize",Ne.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:J4e})}checkSafeUint53(t,r){typeof t=="number"&&(r==null&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,Ne.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,Ne.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,r,n){n?n=": "+n:n="",t<r&&this.throwError("missing argument"+n,Ne.errors.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&this.throwError("too many arguments"+n,Ne.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}checkNew(t,r){(t===Object||t==null)&&this.throwError("missing new",Ne.errors.MISSING_NEW,{name:r.name})}checkAbstract(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Ne.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Ne.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return _ie||(_ie=new Ne(Q7t)),_ie}static setCensorship(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Ne.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),K4e){if(!t)return;this.globalLogger().throwError("error censorship permanent",Ne.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Z4e=!!t,K4e=!!r}static setLogLevel(t){const r=sF[t.toLowerCase()];if(r==null){Ne.globalLogger().warn("invalid log level - "+t);return}Q4e=r}static from(t){return new Ne(t)}}Ne.errors=Qh;Ne.levels=mhe;const ePt="bytes/5.7.0",Ps=new Ne(ePt);function aXe(e){return!!e.toHexString}function t4(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return t4(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function AM(e){return si(e)&&!(e.length%2)||g_(e)}function txe(e){return typeof e=="number"&&e==e&&e%1===0}function g_(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e=="string"||!txe(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!txe(r)||r<0||r>=256)return!1}return!0}function $t(e,t){if(t||(t={}),typeof e=="number"){Ps.checkSafeUint53(e,"invalid arrayify value");const r=[];for(;e;)r.unshift(e&255),e=parseInt(String(e/256));return r.length===0&&r.push(0),t4(new Uint8Array(r))}if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),aXe(e)&&(e=e.toHexString()),si(e)){let r=e.substring(2);r.length%2&&(t.hexPad==="left"?r="0"+r:t.hexPad==="right"?r+="0":Ps.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return t4(new Uint8Array(n))}return g_(e)?t4(new Uint8Array(e)):Ps.throwArgumentError("invalid arrayify value","value",e)}function Co(e){const t=e.map(i=>$t(i)),r=t.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return t.reduce((i,a)=>(n.set(a,i),i+a.length),0),t4(n)}function Y1(e){let t=$t(e);if(t.length===0)return t;let r=0;for(;r<t.length&&t[r]===0;)r++;return r&&(t=t.slice(r)),t}function UL(e,t){e=$t(e),e.length>t&&Ps.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),t4(r)}function si(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const Sie="0123456789abcdef";function Xt(e,t){if(t||(t={}),typeof e=="number"){Ps.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=Sie[e&15]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof e=="bigint")return e=e.toString(16),e.length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),aXe(e))return e.toHexString();if(si(e))return e.length%2&&(t.hexPad==="left"?e="0x0"+e.substring(2):t.hexPad==="right"?e+="0":Ps.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(g_(e)){let r="0x";for(let n=0;n<e.length;n++){let i=e[n];r+=Sie[(i&240)>>4]+Sie[i&15]}return r}return Ps.throwArgumentError("invalid hexlify value","value",e)}function Eg(e){if(typeof e!="string")e=Xt(e);else if(!si(e)||e.length%2)return null;return(e.length-2)/2}function nl(e,t,r){return typeof e!="string"?e=Xt(e):(!si(e)||e.length%2)&&Ps.throwArgumentError("invalid hexData","value",e),t=2+2*t,r!=null?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function Tf(e){let t="0x";return e.forEach(r=>{t+=Xt(r).substring(2)}),t}function CM(e){const t=oXe(Xt(e,{hexPad:"left"}));return t==="0x"?"0x0":t}function oXe(e){typeof e!="string"&&(e=Xt(e)),si(e)||Ps.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&e[t]==="0";)t++;return"0x"+e.substring(t)}function xo(e,t){for(typeof e!="string"?e=Xt(e):si(e)||Ps.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&Ps.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function hA(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(AM(e)){let r=$t(e);r.length===64?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Xt(r.slice(0,32)),t.s=Xt(r.slice(32,64))):r.length===65?(t.r=Xt(r.slice(0,32)),t.s=Xt(r.slice(32,64)),t.v=r[64]):Ps.throwArgumentError("invalid signature string","signature",e),t.v<27&&(t.v===0||t.v===1?t.v+=27:Ps.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Xt(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,t._vs!=null){const i=UL($t(t._vs),32);t._vs=Xt(i);const a=i[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=a:t.recoveryParam!==a&&Ps.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;const o=Xt(i);t.s==null?t.s=o:t.s!==o&&Ps.throwArgumentError("signature v mismatch _vs","signature",e)}if(t.recoveryParam==null)t.v==null?Ps.throwArgumentError("signature missing v and recoveryParam","signature",e):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const i=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==i&&Ps.throwArgumentError("signature recoveryParam mismatch v","signature",e)}t.r==null||!si(t.r)?Ps.throwArgumentError("signature missing or invalid r","signature",e):t.r=xo(t.r,32),t.s==null||!si(t.s)?Ps.throwArgumentError("signature missing or invalid s","signature",e):t.s=xo(t.s,32);const r=$t(t.s);r[0]>=128&&Ps.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=Xt(r);t._vs&&(si(t._vs)||Ps.throwArgumentError("signature invalid _vs","signature",e),t._vs=xo(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&Ps.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function yhe(e){return e=hA(e),Xt(Co([e.r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}const sXe="bignumber/5.7.0";var w7=Z7t.BN;const ey=new Ne(sXe),wie={},rxe=9007199254740991;function tPt(e){return e!=null&&(Bt.isBigNumber(e)||typeof e=="number"&&e%1===0||typeof e=="string"&&!!e.match(/^-?[0-9]+$/)||si(e)||typeof e=="bigint"||g_(e))}let nxe=!1;class Bt{constructor(t,r){t!==wie&&ey.throwError("cannot call constructor directly; use BigNumber.from",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Qf(ji(this).fromTwos(t))}toTwos(t){return Qf(ji(this).toTwos(t))}abs(){return this._hex[0]==="-"?Bt.from(this._hex.substring(1)):this}add(t){return Qf(ji(this).add(ji(t)))}sub(t){return Qf(ji(this).sub(ji(t)))}div(t){return Bt.from(t).isZero()&&Ih("division-by-zero","div"),Qf(ji(this).div(ji(t)))}mul(t){return Qf(ji(this).mul(ji(t)))}mod(t){const r=ji(t);return r.isNeg()&&Ih("division-by-zero","mod"),Qf(ji(this).umod(r))}pow(t){const r=ji(t);return r.isNeg()&&Ih("negative-power","pow"),Qf(ji(this).pow(r))}and(t){const r=ji(t);return(this.isNegative()||r.isNeg())&&Ih("unbound-bitwise-result","and"),Qf(ji(this).and(r))}or(t){const r=ji(t);return(this.isNegative()||r.isNeg())&&Ih("unbound-bitwise-result","or"),Qf(ji(this).or(r))}xor(t){const r=ji(t);return(this.isNegative()||r.isNeg())&&Ih("unbound-bitwise-result","xor"),Qf(ji(this).xor(r))}mask(t){return(this.isNegative()||t<0)&&Ih("negative-width","mask"),Qf(ji(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Ih("negative-width","shl"),Qf(ji(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Ih("negative-width","shr"),Qf(ji(this).shrn(t))}eq(t){return ji(this).eq(ji(t))}lt(t){return ji(this).lt(ji(t))}lte(t){return ji(this).lte(ji(t))}gt(t){return ji(this).gt(ji(t))}gte(t){return ji(this).gte(ji(t))}isNegative(){return this._hex[0]==="-"}isZero(){return ji(this).isZero()}toNumber(){try{return ji(this).toNumber()}catch{Ih("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return ey.throwError("this platform does not support BigInt",Ne.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?nxe||(nxe=!0,ey.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?ey.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ne.errors.UNEXPECTED_ARGUMENT,{}):ey.throwError("BigNumber.toString does not accept parameters",Ne.errors.UNEXPECTED_ARGUMENT,{})),ji(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof Bt)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new Bt(wie,T7(t)):t.match(/^-?[0-9]+$/)?new Bt(wie,T7(new w7(t))):ey.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&Ih("underflow","BigNumber.from",t),(t>=rxe||t<=-rxe)&&Ih("overflow","BigNumber.from",t),Bt.from(String(t));const r=t;if(typeof r=="bigint")return Bt.from(r.toString());if(g_(r))return Bt.from(Xt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Bt.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(si(n)||n[0]==="-"&&si(n.substring(1))))return Bt.from(n)}return ey.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function T7(e){if(typeof e!="string")return T7(e.toString(16));if(e[0]==="-")return e=e.substring(1),e[0]==="-"&&ey.throwArgumentError("invalid hex","value",e),e=T7(e),e==="0x00"?e:"-"+e;if(e.substring(0,2)!=="0x"&&(e="0x"+e),e==="0x")return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&e.substring(0,4)==="0x00";)e="0x"+e.substring(4);return e}function Qf(e){return Bt.from(T7(e))}function ji(e){const t=Bt.from(e).toHexString();return t[0]==="-"?new w7("-"+t.substring(3),16):new w7(t.substring(2),16)}function Ih(e,t,r){const n={fault:e,operation:t};return r!=null&&(n.value=r),ey.throwError(e,Ne.errors.NUMERIC_FAULT,n)}function rPt(e){return new w7(e,36).toString(16)}function nPt(e){return new w7(e,16).toString(36)}const Af=new Ne(sXe),FL={},lXe=Bt.from(0),uXe=Bt.from(-1);function cXe(e,t,r,n){const i={fault:t,operation:r};return n!==void 0&&(i.value=n),Af.throwError(e,Ne.errors.NUMERIC_FAULT,i)}let HL="0";for(;HL.length<256;)HL+=HL;function r2e(e){if(typeof e!="number")try{e=Bt.from(e).toNumber()}catch{}return typeof e=="number"&&e>=0&&e<=256&&!(e%1)?"1"+HL.substring(0,e):Af.throwArgumentError("invalid decimal size","decimals",e)}function lF(e,t){t==null&&(t=0);const r=r2e(t);e=Bt.from(e);const n=e.lt(lXe);n&&(e=e.mul(uXe));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(r).toString();return r.length===1?e=a:e=a+"."+i,n&&(e="-"+e),e}function a1(e,t){t==null&&(t=0);const r=r2e(t);(typeof e!="string"||!e.match(/^-?[0-9.]+$/))&&Af.throwArgumentError("invalid decimal value","value",e);const n=e.substring(0,1)==="-";n&&(e=e.substring(1)),e==="."&&Af.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Af.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&cXe("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.length<r.length-1;)o+="0";const s=Bt.from(a),l=Bt.from(o);let u=s.mul(r).add(l);return n&&(u=u.mul(uXe)),u}class r4{constructor(t,r,n,i){t!==FL&&Af.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=r2e(i),Object.freeze(this)}static from(t){if(t instanceof r4)return t;typeof t=="number"&&(t=`fixed128x${t}`);let r=!0,n=128,i=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")r=!1;else{const a=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);a||Af.throwArgumentError("invalid fixed format","format",t),r=a[1]!=="u",n=parseInt(a[2]),i=parseInt(a[3])}}else if(t){const a=(o,s,l)=>t[o]==null?l:(typeof t[o]!==s&&Af.throwArgumentError("invalid fixed format ("+o+" not "+s+")","format."+o,t[o]),t[o]);r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&Af.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Af.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new r4(FL,r,n,i)}}class du{constructor(t,r,n,i){t!==FL&&Af.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&Af.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const r=a1(this._value,this.format.decimals),n=a1(t._value,t.format.decimals);return du.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const r=a1(this._value,this.format.decimals),n=a1(t._value,t.format.decimals);return du.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const r=a1(this._value,this.format.decimals),n=a1(t._value,t.format.decimals);return du.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const r=a1(this._value,this.format.decimals),n=a1(t._value,t.format.decimals);return du.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");t.length===1&&t.push("0");let r=du.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(ixe.toFormat(r.format))),r}ceiling(){const t=this.toString().split(".");t.length===1&&t.push("0");let r=du.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(ixe.toFormat(r.format))),r}round(t){t==null&&(t=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(t<0||t>80||t%1)&&Af.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;const n=du.from("1"+HL.substring(0,t),this.format),i=iPt.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(t){if(t==null)return this._hex;t%8&&Af.throwArgumentError("invalid byte width","width",t);const r=Bt.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return xo(r,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return du.fromString(this._value,t)}static fromValue(t,r,n){return n==null&&r!=null&&!tPt(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),du.fromString(lF(t,r),r4.from(n))}static fromString(t,r){r==null&&(r="fixed");const n=r4.from(r),i=a1(t,n.decimals);!n.signed&&i.lt(lXe)&&cXe("unsigned value cannot be negative","overflow","value",t);let a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=xo(a,n.width/8));const o=lF(i,n.decimals);return new du(FL,a,o,n)}static fromBytes(t,r){r==null&&(r="fixed");const n=r4.from(r);if($t(t).length>n.width/8)throw new Error("overflow");let i=Bt.from(t);n.signed&&(i=i.fromTwos(n.width));const a=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=lF(i,n.decimals);return new du(FL,a,o,n)}static from(t,r){if(typeof t=="string")return du.fromString(t,r);if(g_(t))return du.fromBytes(t,r);try{return du.fromValue(t,0,r)}catch(n){if(n.code!==Ne.errors.INVALID_ARGUMENT)throw n}return Af.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}const ixe=du.from(1),iPt=du.from("0.5"),aPt="properties/5.7.0";var oPt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const fG=new Ne(aPt);function at(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function Zu(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||typeof e.prototype!="object")break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Ms(e){return oPt(this,void 0,void 0,function*(){const t=Object.keys(e).map(n=>{const i=e[n];return Promise.resolve(i).then(a=>({key:n,value:a}))});return(yield Promise.all(t)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function n2e(e,t){(!e||typeof e!="object")&&fG.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||fG.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}function Do(e){const t={};for(const r in e)t[r]=e[r];return t}const sPt={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function fXe(e){if(e==null||sPt[typeof e])return!0;if(Array.isArray(e)||typeof e=="object"){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch{continue}if(!fXe(n))return!1}return!0}return fG.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}function lPt(e){if(fXe(e))return e;if(Array.isArray(e))return Object.freeze(e.map(t=>Of(t)));if(typeof e=="object"){const t={};for(const r in e){const n=e[r];n!==void 0&&at(t,r,Of(n))}return t}return fG.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}function Of(e){return lPt(e)}class pA{constructor(t){for(const r in t)this[r]=Of(t[r])}}const xM="abi/5.7.0",ta=new Ne(xM),_T={};let axe={calldata:!0,memory:!0,storage:!0},uPt={calldata:!0,memory:!0};function M$(e,t){if(e==="bytes"||e==="string"){if(axe[t])return!0}else if(e==="address"){if(t==="payable")return!0}else if((e.indexOf("[")>=0||e==="tuple")&&uPt[t])return!0;return(axe[t]||t==="payable")&&ta.throwArgumentError("invalid modifier","name",t),!1}function cPt(e,t){let r=e;function n(s){ta.throwArgumentError(`unexpected character at position ${s}`,"param",e)}e=e.replace(/\s/g," ");function i(s){let l={type:"",name:"",parent:s,state:{allowType:!0}};return t&&(l.indexed=!1),l}let a={type:"",name:"",state:{allowType:!0}},o=a;for(let s=0;s<e.length;s++){let l=e[s];switch(l){case"(":o.state.allowType&&o.type===""?o.type="tuple":o.state.allowParams||n(s),o.state.allowType=!1,o.type=cC(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,o.name==="indexed"&&(t||n(s),o.indexed=!0,o.name=""),M$(o.type,o.name)&&(o.name=""),o.type=cC(o.type);let u=o;o=o.parent,o||n(s),delete u.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,o.name==="indexed"&&(t||n(s),o.indexed=!0,o.name=""),M$(o.type,o.name)&&(o.name=""),o.type=cC(o.type);let c=i(o.parent);o.parent.components.push(c),delete o.parent,o=c;break;case" ":o.state.allowType&&o.type!==""&&(o.type=cC(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&o.name!==""&&(o.name==="indexed"?(t||n(s),o.indexed&&n(s),o.indexed=!0,o.name=""):M$(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(s),o.type+=l,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(s),o.type+=l,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=l,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=l,delete o.state.allowArray):o.state.readArray?o.type+=l:n(s)}}return o.parent&&ta.throwArgumentError("unexpected eof","param",e),delete a.state,o.name==="indexed"?(t||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):M$(o.type,o.name)&&(o.name=""),a.type=cC(a.type),a}function uF(e,t){for(let r in t)at(e,r,t[r])}const ha=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),fPt=new RegExp(/^(.*)\[([0-9]*)\]$/);class Yl{constructor(t,r){t!==_T&&ta.throwError("use fromString",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),uF(this,r);let n=this.type.match(fPt);n?uF(this,{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Yl.fromObject({type:n[1],components:this.components}),baseType:"array"}):uF(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json){let n={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.components&&(n.components=this.components.map(i=>JSON.parse(i.format(t)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(t),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(t!==ha.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(t)).join(t===ha.full?", ":",")+")"):r+=this.type,t!==ha.sighash&&(this.indexed===!0&&(r+=" indexed"),t===ha.full&&this.name&&(r+=" "+this.name)),r}static from(t,r){return typeof t=="string"?Yl.fromString(t,r):Yl.fromObject(t)}static fromObject(t){return Yl.isParamType(t)?t:new Yl(_T,{name:t.name||null,type:cC(t.type),indexed:t.indexed==null?null:!!t.indexed,components:t.components?t.components.map(Yl.fromObject):null})}static fromString(t,r){function n(i){return Yl.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(cPt(t,!!r))}static isParamType(t){return!!(t!=null&&t._isParamType)}}function A7(e,t){return hPt(e).map(r=>Yl.fromString(r,t))}class O1{constructor(t,r){t!==_T&&ta.throwError("use a static from method",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),uF(this,r),this._isFragment=!0,Object.freeze(this)}static from(t){return O1.isFragment(t)?t:typeof t=="string"?O1.fromString(t):O1.fromObject(t)}static fromObject(t){if(O1.isFragment(t))return t;switch(t.type){case"function":return Gp.fromObject(t);case"event":return E1.fromObject(t);case"constructor":return Hp.fromObject(t);case"error":return dy.fromObject(t);case"fallback":case"receive":return null}return ta.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return t=t.replace(/\s/g," "),t=t.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),t=t.trim(),t.split(" ")[0]==="event"?E1.fromString(t.substring(5).trim()):t.split(" ")[0]==="function"?Gp.fromString(t.substring(8).trim()):t.split("(")[0].trim()==="constructor"?Hp.fromString(t.trim()):t.split(" ")[0]==="error"?dy.fromString(t.substring(5).trim()):ta.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!!(t&&t._isFragment)}}class E1 extends O1{format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});let r="";return t!==ha.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===ha.full?", ":",")+") ",t!==ha.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(t){return typeof t=="string"?E1.fromString(t):E1.fromObject(t)}static fromObject(t){if(E1.isEventFragment(t))return t;t.type!=="event"&&ta.throwArgumentError("invalid event object","value",t);const r={name:C7(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Yl.fromObject):[],type:"event"};return new E1(_T,r)}static fromString(t){let r=t.match(x7);r||ta.throwArgumentError("invalid event string","value",t);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:ta.warn("unknown modifier: "+i)}}),E1.fromObject({name:r[1].trim(),anonymous:n,inputs:A7(r[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&t.type==="event"}}function dXe(e,t){t.gas=null;let r=e.split("@");return r.length!==1?(r.length>2&&ta.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||ta.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Bt.from(r[1]),r[0]):e}function hXe(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(r=>{switch(r.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function pXe(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return e.stateMutability!=null?(t.stateMutability=e.stateMutability,t.constant=t.stateMutability==="view"||t.stateMutability==="pure",e.constant!=null&&!!e.constant!==t.constant&&ta.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable=t.stateMutability==="payable",e.payable!=null&&!!e.payable!==t.payable&&ta.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):e.payable!=null?(t.payable=!!e.payable,e.constant==null&&!t.payable&&e.type!=="constructor"&&ta.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ta.throwArgumentError("cannot have constant payable function","value",e)):e.constant!=null?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):e.type!=="constructor"&&ta.throwArgumentError("unable to determine stateMutability","value",e),t}class Hp extends O1{format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});t===ha.sighash&&ta.throwError("cannot format a constructor for sighash",Ne.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(t)).join(t===ha.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(t){return typeof t=="string"?Hp.fromString(t):Hp.fromObject(t)}static fromObject(t){if(Hp.isConstructorFragment(t))return t;t.type!=="constructor"&&ta.throwArgumentError("invalid constructor object","value",t);let r=pXe(t);r.constant&&ta.throwArgumentError("constructor cannot be constant","value",t);const n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Yl.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?Bt.from(t.gas):null};return new Hp(_T,n)}static fromString(t){let r={type:"constructor"};t=dXe(t,r);let n=t.match(x7);return(!n||n[1].trim()!=="constructor")&&ta.throwArgumentError("invalid constructor string","value",t),r.inputs=A7(n[2].trim(),!1),hXe(n[3].trim(),r),Hp.fromObject(r)}static isConstructorFragment(t){return t&&t._isFragment&&t.type==="constructor"}}class Gp extends Hp{format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(t))),outputs:this.outputs.map(n=>JSON.parse(n.format(t)))});let r="";return t!==ha.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===ha.full?", ":",")+") ",t!==ha.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(t)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(t){return typeof t=="string"?Gp.fromString(t):Gp.fromObject(t)}static fromObject(t){if(Gp.isFunctionFragment(t))return t;t.type!=="function"&&ta.throwArgumentError("invalid function object","value",t);let r=pXe(t);const n={type:t.type,name:C7(t.name),constant:r.constant,inputs:t.inputs?t.inputs.map(Yl.fromObject):[],outputs:t.outputs?t.outputs.map(Yl.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?Bt.from(t.gas):null};return new Gp(_T,n)}static fromString(t){let r={type:"function"};t=dXe(t,r);let n=t.split(" returns ");n.length>2&&ta.throwArgumentError("invalid function string","value",t);let i=n[0].match(x7);if(i||ta.throwArgumentError("invalid function signature","value",t),r.name=i[1].trim(),r.name&&C7(r.name),r.inputs=A7(i[2],!1),hXe(i[3].trim(),r),n.length>1){let a=n[1].match(x7);(a[1].trim()!=""||a[3].trim()!="")&&ta.throwArgumentError("unexpected tokens","value",t),r.outputs=A7(a[2],!1)}else r.outputs=[];return Gp.fromObject(r)}static isFunctionFragment(t){return t&&t._isFragment&&t.type==="function"}}function oxe(e){const t=e.format();return(t==="Error(string)"||t==="Panic(uint256)")&&ta.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class dy extends O1{format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});let r="";return t!==ha.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===ha.full?", ":",")+") ",r.trim()}static from(t){return typeof t=="string"?dy.fromString(t):dy.fromObject(t)}static fromObject(t){if(dy.isErrorFragment(t))return t;t.type!=="error"&&ta.throwArgumentError("invalid error object","value",t);const r={type:t.type,name:C7(t.name),inputs:t.inputs?t.inputs.map(Yl.fromObject):[]};return oxe(new dy(_T,r))}static fromString(t){let r={type:"error"},n=t.match(x7);return n||ta.throwArgumentError("invalid error signature","value",t),r.name=n[1].trim(),r.name&&C7(r.name),r.inputs=A7(n[2],!1),oxe(dy.fromObject(r))}static isErrorFragment(t){return t&&t._isFragment&&t.type==="error"}}function cC(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const dPt=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function C7(e){return(!e||!e.match(dPt))&&ta.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const x7=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function hPt(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];a===","&&n===0?(t.push(r),r=""):(r+=a,a==="("?n++:a===")"&&(n--,n===-1&&ta.throwArgumentError("unbalanced parenthesis","value",e)))}return r&&t.push(r),t}const i2e=new Ne(xM);function vXe(e){const t=[],r=function(n,i){if(Array.isArray(i))for(let a in i){const o=n.slice();o.push(a);try{r(o,i[a])}catch(s){t.push({path:o,error:s})}}};return r([],e),t}class l2{constructor(t,r,n,i){this.name=t,this.type=r,this.localName=n,this.dynamic=i}_throwError(t,r){i2e.throwArgumentError(t,this.localName,r)}}class Ehe{constructor(t){at(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return Tf(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData(Co(t._data))}writeBytes(t){let r=$t(t);const n=r.length%this.wordSize;return n&&(r=Co([r,this._padding.slice(n)])),this._writeData(r)}_getValue(t){let r=$t(Bt.from(t));return r.length>this.wordSize&&i2e.throwError("value out-of-bounds",Ne.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Co([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[t]=this._getValue(r)}}}class dG{constructor(t,r,n,i){at(this,"_data",$t(t)),at(this,"wordSize",r||32),at(this,"_coerceFunc",n),at(this,"allowLoose",i),this._offset=0}get data(){return Xt(this._data)}get consumed(){return this._offset}static coerce(t,r){let n=t.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(t,r){return this._coerceFunc?this._coerceFunc(t,r):dG.coerce(t,r)}_peekBytes(t,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:i2e.throwError("data out-of-bounds",Ne.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(t){return new dG(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,r){let n=this._peekBytes(0,t,!!r);return this._offset+=n.length,n.slice(0,t)}readValue(){return Bt.from(this.readBytes(this.wordSize))}}var gXe={exports:{}};(function(e){(function(){var t="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var a=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof Ln=="object"&&Ln.versions&&Ln.versions.node;o?i=gt:a&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&!0&&e.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),c=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],d=[1,256,65536,16777216],h=[6,1536,393216,100663296],p=[0,8,16,24],g=[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],m=[224,256,384,512],E=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(W){return Object.prototype.toString.call(W)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(W){return typeof W=="object"&&W.buffer&&W.buffer.constructor===ArrayBuffer});for(var T=function(W,Y,re){return function(Q){return new R(W,Y,W).update(Q)[re]()}},x=function(W,Y,re){return function(Q,ie){return new R(W,Y,ie).update(Q)[re]()}},N=function(W,Y,re){return function(Q,ie,ce,te){return y["cshake"+W].update(Q,ie,ce,te)[re]()}},A=function(W,Y,re){return function(Q,ie,ce,te){return y["kmac"+W].update(Q,ie,ce,te)[re]()}},L=function(W,Y,re,Q){for(var ie=0;ie<b.length;++ie){var ce=b[ie];W[ce]=Y(re,Q,ce)}return W},O=function(W,Y){var re=T(W,Y,"hex");return re.create=function(){return new R(W,Y,W)},re.update=function(Q){return re.create().update(Q)},L(re,T,W,Y)},I=function(W,Y){var re=x(W,Y,"hex");return re.create=function(Q){return new R(W,Y,Q)},re.update=function(Q,ie){return re.create(ie).update(Q)},L(re,x,W,Y)},$=function(W,Y){var re=w[W],Q=N(W,Y,"hex");return Q.create=function(ie,ce,te){return!ce&&!te?y["shake"+W].create(ie):new R(W,Y,ie).bytepad([ce,te],re)},Q.update=function(ie,ce,te,J){return Q.create(ce,te,J).update(ie)},L(Q,N,W,Y)},F=function(W,Y){var re=w[W],Q=A(W,Y,"hex");return Q.create=function(ie,ce,te){return new H(W,Y,ce).bytepad(["KMAC",te],re).bytepad([ie],re)},Q.update=function(ie,ce,te,J){return Q.create(ie,te,J).update(ce)},L(Q,A,W,Y)},D=[{name:"keccak",padding:d,bits:m,createMethod:O},{name:"sha3",padding:h,bits:m,createMethod:O},{name:"shake",padding:c,bits:E,createMethod:I},{name:"cshake",padding:f,bits:E,createMethod:$},{name:"kmac",padding:f,bits:E,createMethod:F}],y={},S=[],C=0;C<D.length;++C)for(var M=D[C],k=M.bits,U=0;U<k.length;++U){var G=M.name+"_"+k[U];if(S.push(G),y[G]=M.createMethod(k[U],M.padding),M.name!=="sha3"){var B=M.name+k[U];S.push(B),y[B]=y[G]}}function R(W,Y,re){this.blocks=[],this.s=[],this.padding=Y,this.outputBits=re,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(W<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=re>>5,this.extraBytes=(re&31)>>3;for(var Q=0;Q<50;++Q)this.s[Q]=0}R.prototype.update=function(W){if(this.finalized)throw new Error(r);var Y,re=typeof W;if(re!=="string"){if(re==="object"){if(W===null)throw new Error(t);if(l&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!l||!ArrayBuffer.isView(W)))throw new Error(t)}else throw new Error(t);Y=!0}for(var Q=this.blocks,ie=this.byteCount,ce=W.length,te=this.blockCount,J=0,ge=this.s,fe,ye;J<ce;){if(this.reset)for(this.reset=!1,Q[0]=this.block,fe=1;fe<te+1;++fe)Q[fe]=0;if(Y)for(fe=this.start;J<ce&&fe<ie;++J)Q[fe>>2]|=W[J]<<p[fe++&3];else for(fe=this.start;J<ce&&fe<ie;++J)ye=W.charCodeAt(J),ye<128?Q[fe>>2]|=ye<<p[fe++&3]:ye<2048?(Q[fe>>2]|=(192|ye>>6)<<p[fe++&3],Q[fe>>2]|=(128|ye&63)<<p[fe++&3]):ye<55296||ye>=57344?(Q[fe>>2]|=(224|ye>>12)<<p[fe++&3],Q[fe>>2]|=(128|ye>>6&63)<<p[fe++&3],Q[fe>>2]|=(128|ye&63)<<p[fe++&3]):(ye=65536+((ye&1023)<<10|W.charCodeAt(++J)&1023),Q[fe>>2]|=(240|ye>>18)<<p[fe++&3],Q[fe>>2]|=(128|ye>>12&63)<<p[fe++&3],Q[fe>>2]|=(128|ye>>6&63)<<p[fe++&3],Q[fe>>2]|=(128|ye&63)<<p[fe++&3]);if(this.lastByteIndex=fe,fe>=ie){for(this.start=fe-ie,this.block=Q[te],fe=0;fe<te;++fe)ge[fe]^=Q[fe];q(ge),this.reset=!0}else this.start=fe}return this},R.prototype.encode=function(W,Y){var re=W&255,Q=1,ie=[re];for(W=W>>8,re=W&255;re>0;)ie.unshift(re),W=W>>8,re=W&255,++Q;return Y?ie.push(Q):ie.unshift(Q),this.update(ie),ie.length},R.prototype.encodeString=function(W){var Y,re=typeof W;if(re!=="string"){if(re==="object"){if(W===null)throw new Error(t);if(l&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!l||!ArrayBuffer.isView(W)))throw new Error(t)}else throw new Error(t);Y=!0}var Q=0,ie=W.length;if(Y)Q=ie;else for(var ce=0;ce<W.length;++ce){var te=W.charCodeAt(ce);te<128?Q+=1:te<2048?Q+=2:te<55296||te>=57344?Q+=3:(te=65536+((te&1023)<<10|W.charCodeAt(++ce)&1023),Q+=4)}return Q+=this.encode(Q*8),this.update(W),Q},R.prototype.bytepad=function(W,Y){for(var re=this.encode(Y),Q=0;Q<W.length;++Q)re+=this.encodeString(W[Q]);var ie=Y-re%Y,ce=[];return ce.length=ie,this.update(ce),this},R.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var W=this.blocks,Y=this.lastByteIndex,re=this.blockCount,Q=this.s;if(W[Y>>2]|=this.padding[Y&3],this.lastByteIndex===this.byteCount)for(W[0]=W[re],Y=1;Y<re+1;++Y)W[Y]=0;for(W[re-1]|=2147483648,Y=0;Y<re;++Y)Q[Y]^=W[Y];q(Q)}},R.prototype.toString=R.prototype.hex=function(){this.finalize();for(var W=this.blockCount,Y=this.s,re=this.outputBlocks,Q=this.extraBytes,ie=0,ce=0,te="",J;ce<re;){for(ie=0;ie<W&&ce<re;++ie,++ce)J=Y[ie],te+=u[J>>4&15]+u[J&15]+u[J>>12&15]+u[J>>8&15]+u[J>>20&15]+u[J>>16&15]+u[J>>28&15]+u[J>>24&15];ce%W===0&&(q(Y),ie=0)}return Q&&(J=Y[ie],te+=u[J>>4&15]+u[J&15],Q>1&&(te+=u[J>>12&15]+u[J>>8&15]),Q>2&&(te+=u[J>>20&15]+u[J>>16&15])),te},R.prototype.arrayBuffer=function(){this.finalize();var W=this.blockCount,Y=this.s,re=this.outputBlocks,Q=this.extraBytes,ie=0,ce=0,te=this.outputBits>>3,J;Q?J=new ArrayBuffer(re+1<<2):J=new ArrayBuffer(te);for(var ge=new Uint32Array(J);ce<re;){for(ie=0;ie<W&&ce<re;++ie,++ce)ge[ce]=Y[ie];ce%W===0&&q(Y)}return Q&&(ge[ie]=Y[ie],J=J.slice(0,te)),J},R.prototype.buffer=R.prototype.arrayBuffer,R.prototype.digest=R.prototype.array=function(){this.finalize();for(var W=this.blockCount,Y=this.s,re=this.outputBlocks,Q=this.extraBytes,ie=0,ce=0,te=[],J,ge;ce<re;){for(ie=0;ie<W&&ce<re;++ie,++ce)J=ce<<2,ge=Y[ie],te[J]=ge&255,te[J+1]=ge>>8&255,te[J+2]=ge>>16&255,te[J+3]=ge>>24&255;ce%W===0&&q(Y)}return Q&&(J=ce<<2,ge=Y[ie],te[J]=ge&255,Q>1&&(te[J+1]=ge>>8&255),Q>2&&(te[J+2]=ge>>16&255)),te};function H(W,Y,re){R.call(this,W,Y,re)}H.prototype=new R,H.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var q=function(W){var Y,re,Q,ie,ce,te,J,ge,fe,ye,Ue,me,Be,et,Ge,Ae,We,Le,Ie,tt,Ve,ne,X,K,le,ve,Ee,we,ft,Fe,Xe,Qt,it,Tt,Hr,xt,Mt,kn,Ot,qt,Vi,ct,_t,Ki,Jt,zt,aa,Vt,Ft,Wi,vt,Nt,qr,yt,Lt,oa,Pe,De,Pt,Sr,Mr,un,fn;for(Q=0;Q<48;Q+=2)ie=W[0]^W[10]^W[20]^W[30]^W[40],ce=W[1]^W[11]^W[21]^W[31]^W[41],te=W[2]^W[12]^W[22]^W[32]^W[42],J=W[3]^W[13]^W[23]^W[33]^W[43],ge=W[4]^W[14]^W[24]^W[34]^W[44],fe=W[5]^W[15]^W[25]^W[35]^W[45],ye=W[6]^W[16]^W[26]^W[36]^W[46],Ue=W[7]^W[17]^W[27]^W[37]^W[47],me=W[8]^W[18]^W[28]^W[38]^W[48],Be=W[9]^W[19]^W[29]^W[39]^W[49],Y=me^(te<<1|J>>>31),re=Be^(J<<1|te>>>31),W[0]^=Y,W[1]^=re,W[10]^=Y,W[11]^=re,W[20]^=Y,W[21]^=re,W[30]^=Y,W[31]^=re,W[40]^=Y,W[41]^=re,Y=ie^(ge<<1|fe>>>31),re=ce^(fe<<1|ge>>>31),W[2]^=Y,W[3]^=re,W[12]^=Y,W[13]^=re,W[22]^=Y,W[23]^=re,W[32]^=Y,W[33]^=re,W[42]^=Y,W[43]^=re,Y=te^(ye<<1|Ue>>>31),re=J^(Ue<<1|ye>>>31),W[4]^=Y,W[5]^=re,W[14]^=Y,W[15]^=re,W[24]^=Y,W[25]^=re,W[34]^=Y,W[35]^=re,W[44]^=Y,W[45]^=re,Y=ge^(me<<1|Be>>>31),re=fe^(Be<<1|me>>>31),W[6]^=Y,W[7]^=re,W[16]^=Y,W[17]^=re,W[26]^=Y,W[27]^=re,W[36]^=Y,W[37]^=re,W[46]^=Y,W[47]^=re,Y=ye^(ie<<1|ce>>>31),re=Ue^(ce<<1|ie>>>31),W[8]^=Y,W[9]^=re,W[18]^=Y,W[19]^=re,W[28]^=Y,W[29]^=re,W[38]^=Y,W[39]^=re,W[48]^=Y,W[49]^=re,et=W[0],Ge=W[1],zt=W[11]<<4|W[10]>>>28,aa=W[10]<<4|W[11]>>>28,we=W[20]<<3|W[21]>>>29,ft=W[21]<<3|W[20]>>>29,Sr=W[31]<<9|W[30]>>>23,Mr=W[30]<<9|W[31]>>>23,ct=W[40]<<18|W[41]>>>14,_t=W[41]<<18|W[40]>>>14,Tt=W[2]<<1|W[3]>>>31,Hr=W[3]<<1|W[2]>>>31,Ae=W[13]<<12|W[12]>>>20,We=W[12]<<12|W[13]>>>20,Vt=W[22]<<10|W[23]>>>22,Ft=W[23]<<10|W[22]>>>22,Fe=W[33]<<13|W[32]>>>19,Xe=W[32]<<13|W[33]>>>19,un=W[42]<<2|W[43]>>>30,fn=W[43]<<2|W[42]>>>30,yt=W[5]<<30|W[4]>>>2,Lt=W[4]<<30|W[5]>>>2,xt=W[14]<<6|W[15]>>>26,Mt=W[15]<<6|W[14]>>>26,Le=W[25]<<11|W[24]>>>21,Ie=W[24]<<11|W[25]>>>21,Wi=W[34]<<15|W[35]>>>17,vt=W[35]<<15|W[34]>>>17,Qt=W[45]<<29|W[44]>>>3,it=W[44]<<29|W[45]>>>3,K=W[6]<<28|W[7]>>>4,le=W[7]<<28|W[6]>>>4,oa=W[17]<<23|W[16]>>>9,Pe=W[16]<<23|W[17]>>>9,kn=W[26]<<25|W[27]>>>7,Ot=W[27]<<25|W[26]>>>7,tt=W[36]<<21|W[37]>>>11,Ve=W[37]<<21|W[36]>>>11,Nt=W[47]<<24|W[46]>>>8,qr=W[46]<<24|W[47]>>>8,Ki=W[8]<<27|W[9]>>>5,Jt=W[9]<<27|W[8]>>>5,ve=W[18]<<20|W[19]>>>12,Ee=W[19]<<20|W[18]>>>12,De=W[29]<<7|W[28]>>>25,Pt=W[28]<<7|W[29]>>>25,qt=W[38]<<8|W[39]>>>24,Vi=W[39]<<8|W[38]>>>24,ne=W[48]<<14|W[49]>>>18,X=W[49]<<14|W[48]>>>18,W[0]=et^~Ae&Le,W[1]=Ge^~We&Ie,W[10]=K^~ve&we,W[11]=le^~Ee&ft,W[20]=Tt^~xt&kn,W[21]=Hr^~Mt&Ot,W[30]=Ki^~zt&Vt,W[31]=Jt^~aa&Ft,W[40]=yt^~oa&De,W[41]=Lt^~Pe&Pt,W[2]=Ae^~Le&tt,W[3]=We^~Ie&Ve,W[12]=ve^~we&Fe,W[13]=Ee^~ft&Xe,W[22]=xt^~kn&qt,W[23]=Mt^~Ot&Vi,W[32]=zt^~Vt&Wi,W[33]=aa^~Ft&vt,W[42]=oa^~De&Sr,W[43]=Pe^~Pt&Mr,W[4]=Le^~tt&ne,W[5]=Ie^~Ve&X,W[14]=we^~Fe&Qt,W[15]=ft^~Xe&it,W[24]=kn^~qt&ct,W[25]=Ot^~Vi&_t,W[34]=Vt^~Wi&Nt,W[35]=Ft^~vt&qr,W[44]=De^~Sr&un,W[45]=Pt^~Mr&fn,W[6]=tt^~ne&et,W[7]=Ve^~X&Ge,W[16]=Fe^~Qt&K,W[17]=Xe^~it&le,W[26]=qt^~ct&Tt,W[27]=Vi^~_t&Hr,W[36]=Wi^~Nt&Ki,W[37]=vt^~qr&Jt,W[46]=Sr^~un&yt,W[47]=Mr^~fn&Lt,W[8]=ne^~et&Ae,W[9]=X^~Ge&We,W[18]=Qt^~K&ve,W[19]=it^~le&Ee,W[28]=ct^~Tt&xt,W[29]=_t^~Hr&Mt,W[38]=Nt^~Ki&zt,W[39]=qr^~Jt&aa,W[48]=un^~yt&oa,W[49]=fn^~Lt&Pe,W[0]^=g[Q],W[1]^=g[Q+1]};if(s)e.exports=y;else for(C=0;C<S.length;++C)i[S[C]]=y[S[C]]})()})(gXe);var pPt=gXe.exports;const vPt=Nn(pPt);function lo(e){return"0x"+vPt.keccak_256($t(e))}const gPt="rlp/5.7.0",d1=new Ne(gPt);function sxe(e){const t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function lxe(e,t,r){let n=0;for(let i=0;i<r;i++)n=n*256+e[t+i];return n}function mXe(e){if(Array.isArray(e)){let n=[];if(e.forEach(function(a){n=n.concat(mXe(a))}),n.length<=55)return n.unshift(192+n.length),n;const i=sxe(n.length);return i.unshift(247+i.length),i.concat(n)}AM(e)||d1.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call($t(e));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=sxe(t.length);return r.unshift(183+r.length),r.concat(t)}function ST(e){return Xt(mXe(e))}function uxe(e,t,r,n){const i=[];for(;r<t+1+n;){const a=yXe(e,r);i.push(a.result),r+=a.consumed,r>t+1+n&&d1.throwError("child data too short",Ne.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function yXe(e,t){if(e.length===0&&d1.throwError("data too short",Ne.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&d1.throwError("data short segment too short",Ne.errors.BUFFER_OVERRUN,{});const n=lxe(e,t+1,r);return t+1+r+n>e.length&&d1.throwError("data long segment too short",Ne.errors.BUFFER_OVERRUN,{}),uxe(e,t,t+1+r,r+n)}else if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&d1.throwError("data array too short",Ne.errors.BUFFER_OVERRUN,{}),uxe(e,t,t+1,r)}else if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&d1.throwError("data array too short",Ne.errors.BUFFER_OVERRUN,{});const n=lxe(e,t+1,r);t+1+r+n>e.length&&d1.throwError("data array too short",Ne.errors.BUFFER_OVERRUN,{});const i=Xt(e.slice(t+1+r,t+1+r+n));return{consumed:1+r+n,result:i}}else if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&d1.throwError("data too short",Ne.errors.BUFFER_OVERRUN,{});const n=Xt(e.slice(t+1,t+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:Xt(e[t])}}function Wj(e){const t=$t(e),r=yXe(t,0);return r.consumed!==t.length&&d1.throwArgumentError("invalid rlp data","data",e),r.result}const mPt=Object.freeze(Object.defineProperty({__proto__:null,decode:Wj,encode:ST},Symbol.toStringTag,{value:"Module"})),yPt="address/5.7.0",LE=new Ne(yPt);function cxe(e){si(e,20)||LE.throwArgumentError("invalid address","address",e),e=e.toLowerCase();const t=e.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=t[i].charCodeAt(0);const n=$t(lo(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(n[i>>1]&15)>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const EPt=9007199254740991;function bPt(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const a2e={};for(let e=0;e<10;e++)a2e[String(e)]=String(e);for(let e=0;e<26;e++)a2e[String.fromCharCode(65+e)]=String(10+e);const fxe=Math.floor(bPt(EPt));function EXe(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(n=>a2e[n]).join("");for(;t.length>=fxe;){let n=t.substring(0,fxe);t=parseInt(n,10)%97+t.substring(n.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function va(e){let t=null;if(typeof e!="string"&&LE.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!=="0x"&&(e="0x"+e),t=cxe(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&LE.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==EXe(e)&&LE.throwArgumentError("bad icap checksum","address",e),t=rPt(e.substring(4));t.length<40;)t="0"+t;t=cxe("0x"+t)}else LE.throwArgumentError("invalid address","address",e);return t}function _Pt(e){try{return va(e),!0}catch{}return!1}function SPt(e){let t=nPt(va(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+EXe("XE00"+t)+t}function jj(e){let t=null;try{t=va(e.from)}catch{LE.throwArgumentError("missing from address","transaction",e)}const r=Y1($t(Bt.from(e.nonce).toHexString()));return va(nl(lo(ST([t,r])),12))}function wPt(e,t,r){return Eg(t)!==32&&LE.throwArgumentError("salt must be 32 bytes","salt",t),Eg(r)!==32&&LE.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),va(nl(lo(Co(["0xff",va(e),t,r])),12))}class TPt extends l2{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,r){try{r=va(r)}catch(n){this._throwError(n.message,r)}return t.writeValue(r)}decode(t){return va(xo(t.readValue().toHexString(),20))}}class APt extends l2{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,r){return this.coder.encode(t,r)}decode(t){return this.coder.decode(t)}}const CC=new Ne(xM);function bXe(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=t.map(u=>{const c=u.localName;return c||CC.throwError("cannot encode object for signature with missing names",Ne.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]&&CC.throwError("cannot encode object for signature with duplicate names",Ne.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]=!0,r[c]})}else CC.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&CC.throwArgumentError("types/value length mismatch","tuple",r);let i=new Ehe(e.wordSize),a=new Ehe(e.wordSize),o=[];t.forEach((l,u)=>{let c=n[u];if(l.dynamic){let f=a.length;l.encode(a,c);let d=i.writeUpdatableValue();o.push(h=>{d(h+f)})}else l.encode(i,c)}),o.forEach(l=>{l(i.length)});let s=e.appendWriter(i);return s+=e.appendWriter(a),s}function _Xe(e,t){let r=[],n=e.subReader(0);t.forEach(a=>{let o=null;if(a.dynamic){let s=e.readValue(),l=n.subReader(s.toNumber());try{o=a.decode(l)}catch(u){if(u.code===Ne.errors.BUFFER_OVERRUN)throw u;o=u,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(e)}catch(s){if(s.code===Ne.errors.BUFFER_OVERRUN)throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}o!=null&&r.push(o)});const i=t.reduce((a,o)=>{const s=o.localName;return s&&(a[s]||(a[s]=0),a[s]++),a},{});t.forEach((a,o)=>{let s=a.localName;if(!s||i[s]!==1||(s==="length"&&(s="_length"),r[s]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,s,{enumerable:!0,get:()=>{throw l}}):r[s]=l});for(let a=0;a<r.length;a++){const o=r[a];o instanceof Error&&Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw o}})}return Object.freeze(r)}class CPt extends l2{constructor(t,r,n){const i=t.type+"["+(r>=0?r:"")+"]",a=r===-1||t.dynamic;super("array",i,n,a),this.coder=t,this.length=r}defaultValue(){const t=this.coder.defaultValue(),r=[];for(let n=0;n<this.length;n++)r.push(t);return r}encode(t,r){Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;n===-1&&(n=r.length,t.writeValue(r.length)),CC.checkArgumentCount(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let a=0;a<r.length;a++)i.push(this.coder);return bXe(t,i,r)}decode(t){let r=this.length;r===-1&&(r=t.readValue().toNumber(),r*32>t._data.length&&CC.throwError("insufficient data length",Ne.errors.BUFFER_OVERRUN,{length:t._data.length,count:r}));let n=[];for(let i=0;i<r;i++)n.push(new APt(this.coder));return t.coerce(this.name,_Xe(t,n))}}class xPt extends l2{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,r){return t.writeValue(r?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class SXe extends l2{constructor(t,r){super(t,t,r,!0)}defaultValue(){return"0x"}encode(t,r){r=$t(r);let n=t.writeValue(r.length);return n+=t.writeBytes(r),n}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class RPt extends SXe{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,Xt(super.decode(t)))}}class IPt extends l2{constructor(t,r){let n="bytes"+String(t);super(n,n,r,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,r){let n=$t(r);return n.length!==this.size&&this._throwError("incorrect data length",r),t.writeBytes(n)}decode(t){return t.coerce(this.name,Xt(t.readBytes(this.size)))}}class OPt extends l2{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,r){return r!=null&&this._throwError("not null",r),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}const wXe="0x0000000000000000000000000000000000000000",TXe=Bt.from(-1),o2e=Bt.from(0),AXe=Bt.from(1),NPt=Bt.from(2),LPt=Bt.from("1000000000000000000"),CXe=Bt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),PPt=Bt.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),MPt=Bt.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),s2e="0x0000000000000000000000000000000000000000000000000000000000000000",DPt="Ξ",$Pt=Object.freeze(Object.defineProperty({__proto__:null,AddressZero:wXe,EtherSymbol:DPt,HashZero:s2e,MaxInt256:MPt,MaxUint256:CXe,MinInt256:PPt,NegativeOne:TXe,One:AXe,Two:NPt,WeiPerEther:LPt,Zero:o2e},Symbol.toStringTag,{value:"Module"}));class kPt extends l2{constructor(t,r,n){const i=(r?"int":"uint")+t*8;super(i,i,n,!1),this.size=t,this.signed=r}defaultValue(){return 0}encode(t,r){let n=Bt.from(r),i=CXe.mask(t.wordSize*8);if(this.signed){let a=i.mask(this.size*8-1);(n.gt(a)||n.lt(a.add(AXe).mul(TXe)))&&this._throwError("value out-of-bounds",r)}else(n.lt(o2e)||n.gt(i.mask(this.size*8)))&&this._throwError("value out-of-bounds",r);return n=n.toTwos(this.size*8).mask(this.size*8),this.signed&&(n=n.fromTwos(this.size*8).toTwos(8*t.wordSize)),t.writeValue(n)}decode(t){let r=t.readValue().mask(this.size*8);return this.signed&&(r=r.fromTwos(this.size*8)),t.coerce(this.name,r)}}const BPt="strings/5.7.0",xXe=new Ne(BPt);var bg;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(bg||(bg={}));var dd;(function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"})(dd||(dd={}));function UPt(e,t,r,n,i){return xXe.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)}function RXe(e,t,r,n,i){if(e===dd.BAD_PREFIX||e===dd.UNEXPECTED_CONTINUE){let a=0;for(let o=t+1;o<r.length&&r[o]>>6===2;o++)a++;return a}return e===dd.OVERRUN?r.length-t-1:0}function FPt(e,t,r,n,i){return e===dd.OVERLONG?(n.push(i),0):(n.push(65533),RXe(e,t,r))}const IXe=Object.freeze({error:UPt,ignore:RXe,replace:FPt});function l2e(e,t){t==null&&(t=IXe.error),e=$t(e);const r=[];let n=0;for(;n<e.length;){const i=e[n++];if(!(i>>7)){r.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?n+=t(dd.UNEXPECTED_CONTINUE,n-1,e,r):n+=t(dd.BAD_PREFIX,n-1,e,r);continue}if(n-1+a>=e.length){n+=t(dd.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-a-1)-1;for(let l=0;l<a;l++){let u=e[n];if((u&192)!=128){n+=t(dd.MISSING_CONTINUE,n,e,r),s=null;break}s=s<<6|u&63,n++}if(s!==null){if(s>1114111){n+=t(dd.OUT_OF_RANGE,n-1-a,e,r,s);continue}if(s>=55296&&s<=57343){n+=t(dd.UTF16_SURROGATE,n-1-a,e,r,s);continue}if(s<=o){n+=t(dd.OVERLONG,n-1-a,e,r,s);continue}r.push(s)}}return r}function cl(e,t=bg.current){t!=bg.current&&(xXe.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const a=e.charCodeAt(n);if(n>=e.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(a&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return $t(r)}function Tie(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function HPt(e,t){return'"'+l2e(e,t).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?Tie(r):(r-=65536,Tie((r>>10&1023)+55296)+Tie((r&1023)+56320))}).join("")+'"'}function bhe(e){return e.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function vA(e,t){return bhe(l2e(e,t))}function hG(e,t=bg.current){return l2e(cl(e,t))}function GPt(e){const t=cl(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Xt(Co([t,s2e]).slice(0,32))}function VPt(e){const t=$t(e);if(t.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(t[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;t[r-1]===0;)r--;return vA(t.slice(0,r))}function WPt(e){if(e.length%4!==0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t}function u2e(e,t){t||(t=function(i){return[parseInt(i,16)]});let r=0,n={};return e.split(",").forEach(i=>{let a=i.split(":");r+=parseInt(a[0],16),n[r]=t(a[1])}),n}function OXe(e){let t=0;return e.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:i,h:t}})}function c2e(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];if(r+=i.l,e>=r&&e<=r+i.h&&(e-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(e-r)!==-1)continue;return i}}return null}const jPt=OXe("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"),zPt="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(e=>parseInt(e,16)),YPt=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],qPt=u2e("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"),XPt=u2e("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"),KPt=u2e("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",WPt),ZPt=OXe("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function QPt(e){return e.reduce((t,r)=>(r.forEach(n=>{t.push(n)}),t),[])}function JPt(e){return!!c2e(e,jPt)}function eMt(e){let t=c2e(e,YPt);if(t)return[e+t.s];let r=qPt[e];if(r)return r;let n=XPt[e];if(n)return[e+n[0]];let i=KPt[e];return i||null}function tMt(e){return!!c2e(e,ZPt)}function rMt(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=hG(e);t=QPt(t.map(n=>{if(zPt.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=eMt(n);return i||[n]})),t=hG(bhe(t),bg.NFKC),t.forEach(n=>{if(tMt(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),t.forEach(n=>{if(JPt(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=bhe(t);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}class nMt extends SXe{constructor(t){super("string",t)}defaultValue(){return""}encode(t,r){return super.encode(t,cl(r))}decode(t){return vA(super.decode(t))}}class D$ extends l2{constructor(t,r){let n=!1;const i=[];t.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const a="tuple("+i.join(",")+")";super("tuple",a,r,n),this.coders=t}defaultValue(){const t=[];this.coders.forEach(n=>{t.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const a=i.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});return this.coders.forEach((n,i)=>{let a=n.localName;!a||r[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,r){return bXe(t,this.coders,r)}decode(t){return t.coerce(this.name,_Xe(t,this.coders))}}const $$=new Ne(xM),iMt=new RegExp(/^bytes([0-9]*)$/),aMt=new RegExp(/^(u?int)([0-9]*)$/);class NXe{constructor(t){at(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new TPt(t.name);case"bool":return new xPt(t.name);case"string":return new nMt(t.name);case"bytes":return new RPt(t.name);case"array":return new CPt(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new D$((t.components||[]).map(n=>this._getCoder(n)),t.name);case"":return new OPt(t.name)}let r=t.type.match(aMt);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&$$.throwArgumentError("invalid "+r[1]+" bit length","param",t),new kPt(n/8,r[1]==="int",t.name)}if(r=t.type.match(iMt),r){let n=parseInt(r[1]);return(n===0||n>32)&&$$.throwArgumentError("invalid bytes length","param",t),new IPt(n,t.name)}return $$.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,r){return new dG(t,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Ehe(this._getWordSize())}getDefaultValue(t){const r=t.map(i=>this._getCoder(Yl.from(i)));return new D$(r,"_").defaultValue()}encode(t,r){t.length!==r.length&&$$.throwError("types/values length mismatch",Ne.errors.INVALID_ARGUMENT,{count:{types:t.length,values:r.length},value:{types:t,values:r}});const n=t.map(o=>this._getCoder(Yl.from(o))),i=new D$(n,"_"),a=this._getWriter();return i.encode(a,r),a.data}decode(t,r,n){const i=t.map(o=>this._getCoder(Yl.from(o)));return new D$(i,"_").decode(this._getReader($t(r),n))}}const LXe=new NXe;function PE(e){return lo(cl(e))}const PXe="hash/5.7.0";function f2e(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return $t(t)}function d2e(e){e=$t(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}const oMt=Object.freeze(Object.defineProperty({__proto__:null,decode:f2e,encode:d2e},Symbol.toStringTag,{value:"Module"}));function MXe(e,t){t==null&&(t=1);const r=[],n=r.forEach,i=function(a,o){n.call(a,function(s){o>0&&Array.isArray(s)?i(s,o-1):r.push(s)})};return i(e,t),r}function sMt(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}function lMt(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,a=[0,1];for(let x=1;x<n;x++)a.push(i+=r());let o=r(),s=t;t+=o;let l=0,u=0;function c(){return l==0&&(u=u<<8|e[t++],l=8),u>>--l&1}const f=31,d=Math.pow(2,f),h=d>>>1,p=h>>1,g=d-1;let m=0;for(let x=0;x<f;x++)m=m<<1|c();let E=[],b=0,w=d;for(;;){let x=Math.floor(((m-b+1)*i-1)/w),N=0,A=n;for(;A-N>1;){let I=N+A>>>1;x<a[I]?A=I:N=I}if(N==0)break;E.push(N);let L=b+Math.floor(w*a[N]/i),O=b+Math.floor(w*a[N+1]/i)-1;for(;!((L^O)&h);)m=m<<1&g|c(),L=L<<1&g,O=O<<1&g|1;for(;L&~O&p;)m=m&h|m<<1&g>>>1|c(),L=L<<1^h,O=(O^h)<<1|h|1;b=L,w=1+O-L}let T=n-4;return E.map(x=>{switch(x-T){case 3:return T+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return T+256+(e[s++]<<8|e[s++]);case 1:return T+e[s++];default:return x-1}})}function uMt(e){let t=0;return()=>e[t++]}function cMt(e){return uMt(lMt(e))}function fMt(e){return e&1?~e>>1:e>>1}function dMt(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}function dxe(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function hMt(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=fMt(t());return r}function pG(e,t){let r=dxe(e(),e),n=e(),i=dxe(n,e),a=dMt(n,e);for(let o=0;o<n;o++)for(let s=0;s<a[o];s++)r.push(i[o]+s);return t?r.map(o=>t[o]):r}function pMt(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(gMt(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(mMt(r,e))}return sMt(MXe(t))}function vMt(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(r)}return t}function DXe(e,t,r){let n=Array(e).fill(void 0).map(()=>[]);for(let i=0;i<t;i++)hMt(e,r).forEach((a,o)=>n[o].push(a));return n}function gMt(e,t){let r=1+t(),n=t(),i=vMt(t),a=DXe(i.length,1+e,t);return MXe(a.map((o,s)=>{const l=o[0],u=o.slice(1);return Array(i[s]).fill(void 0).map((c,f)=>{let d=f*n;return[l+f*r,u.map(h=>h+d)]})}))}function mMt(e,t){let r=1+t();return DXe(r,1+e,t).map(i=>[i[0],i.slice(1)])}function yMt(e){let t=pG(e).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=pG(e,t);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,c)=>c.set.size-u.set.size);let i=e(),a=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let s=i==1,l=i==2;return{branches:n,valid:a,fe0f:o,save:s,check:l}}}function EMt(){return cMt(f2e("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"))}const zj=EMt(),bMt=new Set(pG(zj)),_Mt=new Set(pG(zj)),SMt=pMt(zj),wMt=yMt(zj),hxe=45,pxe=95;function $Xe(e){return hG(e)}function TMt(e){return e.filter(t=>t!=65039)}function kXe(e){for(let t of e.split(".")){let r=$Xe(t);try{for(let n=r.lastIndexOf(pxe)-1;n>=0;n--)if(r[n]!==pxe)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===hxe&&r[3]===hxe)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${t}": ${n.message}`)}}return e}function AMt(e){return kXe(CMt(e,TMt))}function CMt(e,t){let r=$Xe(e).reverse(),n=[];for(;r.length;){let i=RMt(r);if(i){n.push(...t(i));continue}let a=r.pop();if(bMt.has(a)){n.push(a);continue}if(_Mt.has(a))continue;let o=SMt[a];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${a.toString(16).toUpperCase()}`)}return kXe(xMt(String.fromCodePoint(...n)))}function xMt(e){return e.normalize("NFC")}function RMt(e,t){var r;let n=wMt,i,a,o=[],s=e.length;for(t&&(t.length=0);s;){let l=e[--s];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)a=l;else if(n.check&&l===a)break;o.push(l),n.fe0f&&(o.push(65039),s>0&&e[s-1]==65039&&s--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return i}const IMt=new Ne(PXe),BXe=new Uint8Array(32);BXe.fill(0);function vxe(e){if(e.length===0)throw new Error("invalid ENS name; empty component");return e}function h2e(e){const t=cl(AMt(e)),r=[];if(e.length===0)return r;let n=0;for(let i=0;i<t.length;i++)t[i]===46&&(r.push(vxe(t.slice(n,i))),n=i+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(vxe(t.slice(n))),r}function OMt(e){try{return h2e(e).length!==0}catch{}return!1}function GL(e){typeof e!="string"&&IMt.throwArgumentError("invalid ENS name; not a string","name",e);let t=BXe;const r=h2e(e);for(;r.length;)t=lo(Co([t,lo(r.pop())]));return Xt(t)}function UXe(e){return Xt(Co(h2e(e).map(t=>{if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(t.length+1);return r.set(t,1),r[0]=r.length-1,r})))+"00"}const NMt=`Ethereum Signed Message:
|
|
5691
|
+
}`;var ur=YO(function(){return jr(ee,pt+"return "+Me).apply(r,oe)});if(ur.source=Me,BS(ur))throw ur;return ur}function Ire(v){return Kr(v).toLowerCase()}function Ore(v){return Kr(v).toUpperCase()}function Nre(v,_,P){if(v=Kr(v),v&&(P||_===r))return r6(v);if(!v||!(_=go(_)))return v;var V=ls(v),j=ls(_),ee=n6(V,j),oe=i6(V,j)+1;return ku(V,ee,oe).join("")}function Lre(v,_,P){if(v=Kr(v),v&&(P||_===r))return v.slice(0,o6(v)+1);if(!v||!(_=go(_)))return v;var V=ls(v),j=i6(V,ls(_))+1;return ku(V,0,j).join("")}function Pre(v,_,P){if(v=Kr(v),v&&(P||_===r))return v.replace(Vt,"");if(!v||!(_=go(_)))return v;var V=ls(v),j=n6(V,ls(_));return ku(V,j).join("")}function Mre(v,_){var P=I,V=$;if(Dn(_)){var j="separator"in _?_.separator:j;P="length"in _?sr(_.length):P,V="omission"in _?go(_.omission):V}v=Kr(v);var ee=v.length;if(Ud(v)){var oe=ls(v);ee=oe.length}if(P>=ee)return v;var ue=P-Fd(V);if(ue<1)return V;var he=oe?ku(oe,0,ue).join(""):v.slice(0,ue);if(j===r)return he+V;if(oe&&(ue+=he.length-ue),US(j)){if(v.slice(ue).search(j)){var Ce,xe=he;for(j.global||(j=tS(j.source,Kr(Pe.exec(j))+"g")),j.lastIndex=0;Ce=j.exec(xe);)var Me=Ce.index;he=he.slice(0,Me===r?ue:Me)}}else if(v.indexOf(go(j),ue)!=ue){var Qe=he.lastIndexOf(j);Qe>-1&&(he=he.slice(0,Qe))}return he+V}function Dre(v){return v=Kr(v),v&&kn.test(v)?v.replace(xt,cZ):v}var $re=Yd(function(v,_,P){return v+(P?" ":"")+_.toUpperCase()}),GS=q6("toUpperCase");function zO(v,_,P){return v=Kr(v),_=P?r:_,_===r?aZ(v)?hZ(v):KK(v):v.match(_)||[]}var YO=fr(function(v,_){try{return Ea(v,r,_)}catch(P){return BS(P)?P:new er(P)}}),kre=kl(function(v,_){return Uo(_,function(P){P=el(P),Dl(v,P,$S(v[P],v))}),v});function Bre(v){var _=v==null?0:v.length,P=St();return v=_?xn(v,function(V){if(typeof V[1]!="function")throw new Fo(o);return[P(V[0]),V[1]]}):[],fr(function(V){for(var j=-1;++j<_;){var ee=v[j];if(Ea(ee[0],this,V))return Ea(ee[1],this,V)}})}function Ure(v){return cQ(Go(v,f))}function VS(v){return function(){return v}}function Fre(v,_){return v==null||v!==v?_:v}var Hre=K6(),Gre=K6(!0);function qa(v){return v}function WS(v){return C6(typeof v=="function"?v:Go(v,f))}function Vre(v){return R6(Go(v,f))}function Wre(v,_){return I6(v,Go(_,f))}var jre=fr(function(v,_){return function(P){return fp(P,v,_)}}),zre=fr(function(v,_){return function(P){return fp(v,P,_)}});function jS(v,_,P){var V=Ui(_),j=fm(_,V);P==null&&!(Dn(_)&&(j.length||!V.length))&&(P=_,_=v,v=this,j=fm(_,Ui(_)));var ee=!(Dn(P)&&"chain"in P)||!!P.chain,oe=Ul(v);return Uo(j,function(ue){var he=_[ue];v[ue]=he,oe&&(v.prototype[ue]=function(){var Ce=this.__chain__;if(ee||Ce){var xe=v(this.__wrapped__),Me=xe.__actions__=ja(this.__actions__);return Me.push({func:he,args:arguments,thisArg:v}),xe.__chain__=Ce,xe}return he.apply(v,Nu([this.value()],arguments))})}),v}function Yre(){return bn._===this&&(bn._=EZ),this}function zS(){}function qre(v){return v=sr(v),fr(function(_){return O6(_,v)})}var Xre=wS(xn),Kre=wS(ZI),Zre=wS(q_);function qO(v){return OS(v)?X_(el(v)):xQ(v)}function Qre(v){return function(_){return v==null?r:of(v,_)}}var Jre=Q6(),ene=Q6(!0);function YS(){return[]}function qS(){return!1}function tne(){return{}}function rne(){return""}function nne(){return!0}function ine(v,_){if(v=sr(v),v<1||v>k)return[];var P=B,V=ua(v,B);_=St(_),v-=B;for(var j=Q_(V,_);++P<v;)_(P);return j}function ane(v){return rr(v)?xn(v,el):mo(v)?[v]:ja(pO(Kr(v)))}function one(v){var _=++mZ;return Kr(v)+_}var sne=mm(function(v,_){return v+_},0),lne=TS("ceil"),une=mm(function(v,_){return v/_},1),cne=TS("floor");function fne(v){return v&&v.length?cm(v,qa,uS):r}function dne(v,_){return v&&v.length?cm(v,St(_,2),uS):r}function hne(v){return e6(v,qa)}function pne(v,_){return e6(v,St(_,2))}function vne(v){return v&&v.length?cm(v,qa,hS):r}function gne(v,_){return v&&v.length?cm(v,St(_,2),hS):r}var mne=mm(function(v,_){return v*_},1),yne=TS("round"),Ene=mm(function(v,_){return v-_},0);function bne(v){return v&&v.length?Z_(v,qa):0}function _ne(v,_){return v&&v.length?Z_(v,St(_,2)):0}return Z.after=Vee,Z.ary=AO,Z.assign=Ote,Z.assignIn=UO,Z.assignInWith=Om,Z.assignWith=Nte,Z.at=Lte,Z.before=CO,Z.bind=$S,Z.bindAll=kre,Z.bindKey=xO,Z.castArray=tte,Z.chain=SO,Z.chunk=cJ,Z.compact=fJ,Z.concat=dJ,Z.cond=Bre,Z.conforms=Ure,Z.constant=VS,Z.countBy=bee,Z.create=Pte,Z.curry=RO,Z.curryRight=IO,Z.debounce=OO,Z.defaults=Mte,Z.defaultsDeep=Dte,Z.defer=Wee,Z.delay=jee,Z.difference=hJ,Z.differenceBy=pJ,Z.differenceWith=vJ,Z.drop=gJ,Z.dropRight=mJ,Z.dropRightWhile=yJ,Z.dropWhile=EJ,Z.fill=bJ,Z.filter=See,Z.flatMap=Aee,Z.flatMapDeep=Cee,Z.flatMapDepth=xee,Z.flatten=yO,Z.flattenDeep=_J,Z.flattenDepth=SJ,Z.flip=zee,Z.flow=Hre,Z.flowRight=Gre,Z.fromPairs=wJ,Z.functions=Gte,Z.functionsIn=Vte,Z.groupBy=Ree,Z.initial=AJ,Z.intersection=CJ,Z.intersectionBy=xJ,Z.intersectionWith=RJ,Z.invert=jte,Z.invertBy=zte,Z.invokeMap=Oee,Z.iteratee=WS,Z.keyBy=Nee,Z.keys=Ui,Z.keysIn=Ya,Z.map=Tm,Z.mapKeys=qte,Z.mapValues=Xte,Z.matches=Vre,Z.matchesProperty=Wre,Z.memoize=Cm,Z.merge=Kte,Z.mergeWith=FO,Z.method=jre,Z.methodOf=zre,Z.mixin=jS,Z.negate=xm,Z.nthArg=qre,Z.omit=Zte,Z.omitBy=Qte,Z.once=Yee,Z.orderBy=Lee,Z.over=Xre,Z.overArgs=qee,Z.overEvery=Kre,Z.overSome=Zre,Z.partial=kS,Z.partialRight=NO,Z.partition=Pee,Z.pick=Jte,Z.pickBy=HO,Z.property=qO,Z.propertyOf=Qre,Z.pull=LJ,Z.pullAll=bO,Z.pullAllBy=PJ,Z.pullAllWith=MJ,Z.pullAt=DJ,Z.range=Jre,Z.rangeRight=ene,Z.rearg=Xee,Z.reject=$ee,Z.remove=$J,Z.rest=Kee,Z.reverse=MS,Z.sampleSize=Bee,Z.set=tre,Z.setWith=rre,Z.shuffle=Uee,Z.slice=kJ,Z.sortBy=Gee,Z.sortedUniq=WJ,Z.sortedUniqBy=jJ,Z.split=Are,Z.spread=Zee,Z.tail=zJ,Z.take=YJ,Z.takeRight=qJ,Z.takeRightWhile=XJ,Z.takeWhile=KJ,Z.tap=fee,Z.throttle=Qee,Z.thru=wm,Z.toArray=$O,Z.toPairs=GO,Z.toPairsIn=VO,Z.toPath=ane,Z.toPlainObject=BO,Z.transform=nre,Z.unary=Jee,Z.union=ZJ,Z.unionBy=QJ,Z.unionWith=JJ,Z.uniq=eee,Z.uniqBy=tee,Z.uniqWith=ree,Z.unset=ire,Z.unzip=DS,Z.unzipWith=_O,Z.update=are,Z.updateWith=ore,Z.values=Kd,Z.valuesIn=sre,Z.without=nee,Z.words=zO,Z.wrap=ete,Z.xor=iee,Z.xorBy=aee,Z.xorWith=oee,Z.zip=see,Z.zipObject=lee,Z.zipObjectDeep=uee,Z.zipWith=cee,Z.entries=GO,Z.entriesIn=VO,Z.extend=UO,Z.extendWith=Om,jS(Z,Z),Z.add=sne,Z.attempt=YO,Z.camelCase=fre,Z.capitalize=WO,Z.ceil=lne,Z.clamp=lre,Z.clone=rte,Z.cloneDeep=ite,Z.cloneDeepWith=ate,Z.cloneWith=nte,Z.conformsTo=ote,Z.deburr=jO,Z.defaultTo=Fre,Z.divide=une,Z.endsWith=dre,Z.eq=cs,Z.escape=hre,Z.escapeRegExp=pre,Z.every=_ee,Z.find=wee,Z.findIndex=gO,Z.findKey=$te,Z.findLast=Tee,Z.findLastIndex=mO,Z.findLastKey=kte,Z.floor=cne,Z.forEach=wO,Z.forEachRight=TO,Z.forIn=Bte,Z.forInRight=Ute,Z.forOwn=Fte,Z.forOwnRight=Hte,Z.get=FS,Z.gt=ste,Z.gte=lte,Z.has=Wte,Z.hasIn=HS,Z.head=EO,Z.identity=qa,Z.includes=Iee,Z.indexOf=TJ,Z.inRange=ure,Z.invoke=Yte,Z.isArguments=uf,Z.isArray=rr,Z.isArrayBuffer=ute,Z.isArrayLike=za,Z.isArrayLikeObject=Zn,Z.isBoolean=cte,Z.isBuffer=Bu,Z.isDate=fte,Z.isElement=dte,Z.isEmpty=hte,Z.isEqual=pte,Z.isEqualWith=vte,Z.isError=BS,Z.isFinite=gte,Z.isFunction=Ul,Z.isInteger=LO,Z.isLength=Rm,Z.isMap=PO,Z.isMatch=mte,Z.isMatchWith=yte,Z.isNaN=Ete,Z.isNative=bte,Z.isNil=Ste,Z.isNull=_te,Z.isNumber=MO,Z.isObject=Dn,Z.isObjectLike=Vn,Z.isPlainObject=mp,Z.isRegExp=US,Z.isSafeInteger=wte,Z.isSet=DO,Z.isString=Im,Z.isSymbol=mo,Z.isTypedArray=Xd,Z.isUndefined=Tte,Z.isWeakMap=Ate,Z.isWeakSet=Cte,Z.join=IJ,Z.kebabCase=vre,Z.last=Wo,Z.lastIndexOf=OJ,Z.lowerCase=gre,Z.lowerFirst=mre,Z.lt=xte,Z.lte=Rte,Z.max=fne,Z.maxBy=dne,Z.mean=hne,Z.meanBy=pne,Z.min=vne,Z.minBy=gne,Z.stubArray=YS,Z.stubFalse=qS,Z.stubObject=tne,Z.stubString=rne,Z.stubTrue=nne,Z.multiply=mne,Z.nth=NJ,Z.noConflict=Yre,Z.noop=zS,Z.now=Am,Z.pad=yre,Z.padEnd=Ere,Z.padStart=bre,Z.parseInt=_re,Z.random=cre,Z.reduce=Mee,Z.reduceRight=Dee,Z.repeat=Sre,Z.replace=wre,Z.result=ere,Z.round=yne,Z.runInContext=de,Z.sample=kee,Z.size=Fee,Z.snakeCase=Tre,Z.some=Hee,Z.sortedIndex=BJ,Z.sortedIndexBy=UJ,Z.sortedIndexOf=FJ,Z.sortedLastIndex=HJ,Z.sortedLastIndexBy=GJ,Z.sortedLastIndexOf=VJ,Z.startCase=Cre,Z.startsWith=xre,Z.subtract=Ene,Z.sum=bne,Z.sumBy=_ne,Z.template=Rre,Z.times=ine,Z.toFinite=Fl,Z.toInteger=sr,Z.toLength=kO,Z.toLower=Ire,Z.toNumber=jo,Z.toSafeInteger=Ite,Z.toString=Kr,Z.toUpper=Ore,Z.trim=Nre,Z.trimEnd=Lre,Z.trimStart=Pre,Z.truncate=Mre,Z.unescape=Dre,Z.uniqueId=one,Z.upperCase=$re,Z.upperFirst=GS,Z.each=wO,Z.eachRight=TO,Z.first=EO,jS(Z,function(){var v={};return Qs(Z,function(_,P){tn.call(Z.prototype,P)||(v[P]=_)}),v}(),{chain:!1}),Z.VERSION=n,Uo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(v){Z[v].placeholder=Z}),Uo(["drop","take"],function(v,_){wr.prototype[v]=function(P){P=P===r?1:Ci(sr(P),0);var V=this.__filtered__&&!_?new wr(this):this.clone();return V.__filtered__?V.__takeCount__=ua(P,V.__takeCount__):V.__views__.push({size:ua(P,B),type:v+(V.__dir__<0?"Right":"")}),V},wr.prototype[v+"Right"]=function(P){return this.reverse()[v](P).reverse()}}),Uo(["filter","map","takeWhile"],function(v,_){var P=_+1,V=P==y||P==C;wr.prototype[v]=function(j){var ee=this.clone();return ee.__iteratees__.push({iteratee:St(j,3),type:P}),ee.__filtered__=ee.__filtered__||V,ee}}),Uo(["head","last"],function(v,_){var P="take"+(_?"Right":"");wr.prototype[v]=function(){return this[P](1).value()[0]}}),Uo(["initial","tail"],function(v,_){var P="drop"+(_?"":"Right");wr.prototype[v]=function(){return this.__filtered__?new wr(this):this[P](1)}}),wr.prototype.compact=function(){return this.filter(qa)},wr.prototype.find=function(v){return this.filter(v).head()},wr.prototype.findLast=function(v){return this.reverse().find(v)},wr.prototype.invokeMap=fr(function(v,_){return typeof v=="function"?new wr(this):this.map(function(P){return fp(P,v,_)})}),wr.prototype.reject=function(v){return this.filter(xm(St(v)))},wr.prototype.slice=function(v,_){v=sr(v);var P=this;return P.__filtered__&&(v>0||_<0)?new wr(P):(v<0?P=P.takeRight(-v):v&&(P=P.drop(v)),_!==r&&(_=sr(_),P=_<0?P.dropRight(-_):P.take(_-v)),P)},wr.prototype.takeRightWhile=function(v){return this.reverse().takeWhile(v).reverse()},wr.prototype.toArray=function(){return this.take(B)},Qs(wr.prototype,function(v,_){var P=/^(?:filter|find|map|reject)|While$/.test(_),V=/^(?:head|last)$/.test(_),j=Z[V?"take"+(_=="last"?"Right":""):_],ee=V||/^find/.test(_);j&&(Z.prototype[_]=function(){var oe=this.__wrapped__,ue=V?[1]:arguments,he=oe instanceof wr,Ce=ue[0],xe=he||rr(oe),Me=function(mr){var xr=j.apply(Z,Nu([mr],ue));return V&&Qe?xr[0]:xr};xe&&P&&typeof Ce=="function"&&Ce.length!=1&&(he=xe=!1);var Qe=this.__chain__,pt=!!this.__actions__.length,Rt=ee&&!Qe,ur=he&&!pt;if(!ee&&xe){oe=ur?oe:new wr(this);var It=v.apply(oe,ue);return It.__actions__.push({func:wm,args:[Me],thisArg:r}),new Ho(It,Qe)}return Rt&&ur?v.apply(this,ue):(It=this.thru(Me),Rt?V?It.value()[0]:It.value():It)})}),Uo(["pop","push","shift","sort","splice","unshift"],function(v){var _=Xg[v],P=/^(?:push|sort|unshift)$/.test(v)?"tap":"thru",V=/^(?:pop|shift)$/.test(v);Z.prototype[v]=function(){var j=arguments;if(V&&!this.__chain__){var ee=this.value();return _.apply(rr(ee)?ee:[],j)}return this[P](function(oe){return _.apply(rr(oe)?oe:[],j)})}}),Qs(wr.prototype,function(v,_){var P=Z[_];if(P){var V=P.name+"";tn.call(Wd,V)||(Wd[V]=[]),Wd[V].push({name:_,func:P})}}),Wd[gm(r,E).name]=[{name:"wrapper",func:r}],wr.prototype.clone=DZ,wr.prototype.reverse=$Z,wr.prototype.value=kZ,Z.prototype.at=dee,Z.prototype.chain=hee,Z.prototype.commit=pee,Z.prototype.next=vee,Z.prototype.plant=mee,Z.prototype.reverse=yee,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=Eee,Z.prototype.first=Z.prototype.head,ip&&(Z.prototype[ip]=gee),Z},Hd=pZ();Wa?((Wa.exports=Hd)._=Hd,xa._=Hd):bn._=Hd}).call(f8)})(phe,phe.exports);var h7t=Object.defineProperty,p7t=Object.defineProperties,v7t=Object.getOwnPropertyDescriptors,G4e=Object.getOwnPropertySymbols,g7t=Object.prototype.hasOwnProperty,m7t=Object.prototype.propertyIsEnumerable,V4e=(e,t,r)=>t in e?h7t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,L$=(e,t)=>{for(var r in t||(t={}))g7t.call(t,r)&&V4e(e,r,t[r]);if(G4e)for(var r of G4e(t))m7t.call(t,r)&&V4e(e,r,t[r]);return e},y7t=(e,t)=>p7t(e,v7t(t));function Ib(e,t,r){var n;const i=g4t(e);return((n=t.rpcMap)==null?void 0:n[i.reference])||`${d7t}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function dA(e){return e.includes(":")?e.split(":")[1]:e}function rXe(e){return e.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function E7t(e,t){const r=Object.keys(t.namespaces).filter(i=>i.includes(e));if(!r.length)return[];const n=[];return r.forEach(i=>{const a=t.namespaces[i].accounts;n.push(...a)}),n}function b7t(e={},t={}){const r=W4e(e),n=W4e(t);return phe.exports.merge(r,n)}function W4e(e){var t,r,n,i;const a={};if(!JC(e))return a;for(const[o,s]of Object.entries(e)){const l=Bye(o)?[o]:s.chains,u=s.methods||[],c=s.events||[],f=s.rpcMap||{},d=JN(o);a[d]=y7t(L$(L$({},a[d]),s),{chains:Kne(l,(t=a[d])==null?void 0:t.chains),methods:Kne(u,(r=a[d])==null?void 0:r.methods),events:Kne(c,(n=a[d])==null?void 0:n.events),rpcMap:L$(L$({},f),(i=a[d])==null?void 0:i.rpcMap)})}return a}function _7t(e){return e.includes(":")?e.split(":")[2]:e}function S7t(e){const t={};for(const[r,n]of Object.entries(e)){const i=n.methods||[],a=n.events||[],o=n.accounts||[],s=Bye(r)?[r]:n.chains?n.chains:rXe(n.accounts);t[r]={chains:s,methods:i,events:a,accounts:o}}return t}function mie(e){return typeof e=="number"?e:e.includes("0x")?parseInt(e,16):e.includes(":")?Number(e.split(":")[1]):Number(e)}const nXe={},is=e=>nXe[e],yie=(e,t)=>{nXe[e]=t};let w7t=class{constructor(t){this.name="polkadot",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}},T7t=class{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r),this.chainId=parseInt(t),this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){const n=r||Ib(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(dA(r));t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const t=this.chainId,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}async handleSwitchChain(t){var r,n;let i=t.request.params?(r=t.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.topic,request:{method:t.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}};class A7t{constructor(t){this.name="solana",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class C7t{constructor(t){this.name="cosmos",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class x7t{constructor(t){this.name="cip34",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=dA(r);t[i]=this.createHttpProvider(i,n)}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}getCardanoRPCUrl(t){const r=this.namespace.rpcMap;if(r)return r[t]}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||this.getCardanoRPCUrl(t);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class R7t{constructor(t){this.name="elrond",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class I7t{constructor(t){this.name="multiversx",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r),this.chainId=t,this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${t}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getAccounts(){const t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;const i=dA(r);t[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new o2(new v_(n,is("disableProviderPing")))}}class O7t{constructor(t){this.name="near",this.namespace=t.namespace,this.events=is("events"),this.client=is("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider().request(t.request)}setDefaultChain(t,r){if(this.chainId=t,!this.httpProviders[t]){const n=r||Ib(`${this.name}:${t}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);this.setHttpProvider(t,n)}this.events.emit(s2.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const t=this.namespace.accounts;return t?t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const t={};return this.namespace.chains.forEach(r=>{var n;t[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getHttpProvider(){const t=`${this.name}:${this.chainId}`,r=this.httpProviders[t];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return r}setHttpProvider(t,r){const n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){const n=r||Ib(t,this.namespace);return typeof n>"u"?void 0:new o2(new v_(n,is("disableProviderPing")))}}var N7t=Object.defineProperty,L7t=Object.defineProperties,P7t=Object.getOwnPropertyDescriptors,j4e=Object.getOwnPropertySymbols,M7t=Object.prototype.hasOwnProperty,D7t=Object.prototype.propertyIsEnumerable,z4e=(e,t,r)=>t in e?N7t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P$=(e,t)=>{for(var r in t||(t={}))M7t.call(t,r)&&z4e(e,r,t[r]);if(j4e)for(var r of j4e(t))D7t.call(t,r)&&z4e(e,r,t[r]);return e},Eie=(e,t)=>L7t(e,P7t(t));class e2e{constructor(t){this.events=new xye,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=t,this.logger=typeof(t==null?void 0:t.logger)<"u"&&typeof(t==null?void 0:t.logger)!="string"?t.logger:$j(kj({level:(t==null?void 0:t.logger)||F4e})),this.disableProviderPing=(t==null?void 0:t.disableProviderPing)||!1}static async init(t){const r=new e2e(t);return await r.initialize(),r}async request(t,r){const[n,i]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:P$({},t),chainId:`${n}:${i}`,topic:this.session.topic})}sendAsync(t,r,n){const i=new Date().getTime();this.request(t,n).then(a=>r(null,Uj(i,a))).catch(a=>r(a,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Us("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(t),await this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(a=>{this.session=a,this.namespaces||(this.namespaces=S7t(a.namespaces),this.persist("namespaces",this.namespaces))}).catch(a=>{if(a.message!==eXe)throw a;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;const[n,i]=this.validateChain(t);this.getProvider(n).setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(t={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(yg(r)){for(const n of r)t.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const t=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[t]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await e7t.init({logger:this.providerOpts.logger||F4e,relayUrl:this.providerOpts.relayUrl||u7t,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const t=[...new Set(Object.keys(this.session.namespaces).map(r=>JN(r)))];yie("client",this.client),yie("events",this.events),yie("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;const n=E7t(r,this.session),i=rXe(n),a=b7t(this.namespaces,this.optionalNamespaces),o=Eie(P$({},a[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new T7t({namespace:o});break;case"solana":this.rpcProviders[r]=new A7t({namespace:o});break;case"cosmos":this.rpcProviders[r]=new C7t({namespace:o});break;case"polkadot":this.rpcProviders[r]=new w7t({namespace:o});break;case"cip34":this.rpcProviders[r]=new x7t({namespace:o});break;case"elrond":this.rpcProviders[r]=new R7t({namespace:o});break;case"multiversx":this.rpcProviders[r]=new I7t({namespace:o});break;case"near":this.rpcProviders[r]=new O7t({namespace:o});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{this.events.emit("session_ping",t)}),this.client.on("session_event",t=>{const{params:r}=t,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&yg(i)&&this.events.emit("accountsChanged",i.map(_7t))}else if(n.name==="chainChanged"){const i=r.chainId,a=r.event.data,o=JN(i),s=mie(i)!==mie(a)?`${o}:${mie(a)}`:i;this.onChainChanged(s)}else this.events.emit(n.name,n.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{var n;const{namespaces:i}=r,a=(n=this.client)==null?void 0:n.session.get(t);this.session=Eie(P$({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",Eie(P$({},Us("USER_DISCONNECTED")),{data:t.topic}))}),this.on(s2.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(t,!0)})}getProvider(t){if(!this.rpcProviders[t])throw new Error(`Provider not found: ${t}`);return this.rpcProviders[t]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace((r=this.session)==null?void 0:r.namespaces[t])})}setNamespaces(t){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=t;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(t){const[r,n]=(t==null?void 0:t.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(o=>JN(o)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=JN(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}onChainChanged(t,r=!1){var n;if(!this.namespaces)return;const[i,a]=this.validateChain(t);r||this.getProvider(i).setDefaultChain(a),((n=this.namespaces[i])!=null?n:this.namespaces[`${i}:${a}`]).defaultChain=a,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",a)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(t,r){this.client.core.storage.setItem(`${H4e}/${t}`,r)}async getFromStore(t){return await this.client.core.storage.getItem(`${H4e}/${t}`)}}const $7t=e2e,k7t="wc",B7t="ethereum_provider",U7t=`${k7t}@2:${B7t}:`,F7t="https://rpc.walletconnect.com/v1/",vhe=["eth_sendTransaction","personal_sign"],H7t=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],ghe=["chainChanged","accountsChanged"],G7t=["chainChanged","accountsChanged","message","disconnect","connect"];var V7t=Object.defineProperty,W7t=Object.defineProperties,j7t=Object.getOwnPropertyDescriptors,Y4e=Object.getOwnPropertySymbols,z7t=Object.prototype.hasOwnProperty,Y7t=Object.prototype.propertyIsEnumerable,q4e=(e,t,r)=>t in e?V7t(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tL=(e,t)=>{for(var r in t||(t={}))z7t.call(t,r)&&q4e(e,r,t[r]);if(Y4e)for(var r of Y4e(t))Y7t.call(t,r)&&q4e(e,r,t[r]);return e},X4e=(e,t)=>W7t(e,j7t(t));function cG(e){return Number(e[0].split(":")[1])}function bie(e){return`0x${e.toString(16)}`}function q7t(e){const{chains:t,optionalChains:r,methods:n,optionalMethods:i,events:a,optionalEvents:o,rpcMap:s}=e;if(!yg(t))throw new Error("Invalid chains");const l={chains:t,methods:n||vhe,events:a||ghe,rpcMap:tL({},t.length?{[cG(t)]:s[cG(t)]}:{})},u=a==null?void 0:a.filter(h=>!ghe.includes(h)),c=n==null?void 0:n.filter(h=>!vhe.includes(h));if(!r&&!o&&!i&&!(u!=null&&u.length)&&!(c!=null&&c.length))return{required:t.length?l:void 0};const f=(u==null?void 0:u.length)&&(c==null?void 0:c.length)||!r,d={chains:[...new Set(f?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(i!=null&&i.length?i:H7t))],events:[...new Set(l.events.concat(o!=null&&o.length?o:G7t))],rpcMap:s};return{required:t.length?l:void 0,optional:r.length?d:void 0}}let X7t=class iXe{constructor(){this.events=new qc.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=U7t,this.on=(t,r)=>(this.events.on(t,r),this),this.once=(t,r)=>(this.events.once(t,r),this),this.removeListener=(t,r)=>(this.events.removeListener(t,r),this),this.off=(t,r)=>(this.events.off(t,r),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){const r=new iXe;return await r.initialize(t),r}async request(t){return await this.signer.request(t,this.formatChainId(this.chainId))}sendAsync(t,r){this.signer.sendAsync(t,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);const{required:r,optional:n}=q7t(this.rpc);try{const i=await new Promise(async(o,s)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),s(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(X4e(tL({namespaces:tL({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:t==null?void 0:t.pairingTopic})).then(u=>{o(u)}).catch(u=>{s(new Error(u.message))})});if(!i)return;const a=m4t(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:bie(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{const{params:r}=t,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",t)}),this.signer.on("chainChanged",t=>{const r=parseInt(t);this.chainId=r,this.events.emit("chainChanged",bie(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",X4e(tL({},Us("USER_DISCONNECTED")),{data:t.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",t=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:t})),this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){const r=t.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",bie(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){const r=this.parseChainId(t);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(t){const[r,n,i]=t.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(t){this.accounts=t.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(t){var r,n;const i=(r=t==null?void 0:t.chains)!=null?r:[],a=(n=t==null?void 0:t.optionalChains)!=null?n:[],o=i.concat(a);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const s=i.length?(t==null?void 0:t.methods)||vhe:[],l=i.length?(t==null?void 0:t.events)||ghe:[],u=(t==null?void 0:t.optionalMethods)||[],c=(t==null?void 0:t.optionalEvents)||[],f=(t==null?void 0:t.rpcMap)||this.buildRpcMap(o,t.projectId),d=(t==null?void 0:t.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(h=>this.formatChainId(h)),optionalChains:a.map(h=>this.formatChainId(h)),methods:s,events:l,optionalMethods:u,optionalEvents:c,rpcMap:f,showQrModal:!!(t!=null&&t.showQrModal),qrModalOptions:d,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,r){const n={};return t.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?cG(this.rpc.chains):cG(this.rpc.optionalChains),this.signer=await $7t.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storageOptions:t.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await kde(()=>import("./index-5c707073.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(tL({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;const{chains:r,optionalChains:n,rpcMap:i}=t;r&&yg(r)&&(this.rpc.chains=r.map(a=>this.formatChainId(a)),r.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)})),n&&yg(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)}))}getRpcUrl(t,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[t])||`${F7t}?chainId=eip155:${t}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(r=>this.parseAccount(r))}};var t2e={exports:{}};t2e.exports;(function(e){(function(t,r){function n(D,y){if(!D)throw new Error(y||"Assertion failed")}function i(D,y){D.super_=y;var S=function(){};S.prototype=y.prototype,D.prototype=new S,D.prototype.constructor=D}function a(D,y,S){if(a.isBN(D))return D;this.negative=0,this.words=null,this.length=0,this.red=null,D!==null&&((y==="le"||y==="be")&&(S=y,y=10),this._init(D||0,y||10,S||"be"))}typeof t=="object"?t.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=sA.Buffer}catch{}a.isBN=function(y){return y instanceof a?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===a.wordSize&&Array.isArray(y.words)},a.max=function(y,S){return y.cmp(S)>0?y:S},a.min=function(y,S){return y.cmp(S)<0?y:S},a.prototype._init=function(y,S,C){if(typeof y=="number")return this._initNumber(y,S,C);if(typeof y=="object")return this._initArray(y,S,C);S==="hex"&&(S=16),n(S===(S|0)&&S>=2&&S<=36),y=y.toString().replace(/\s+/g,"");var M=0;y[0]==="-"&&(M++,this.negative=1),M<y.length&&(S===16?this._parseHex(y,M,C):(this._parseBase(y,S,M),C==="le"&&this._initArray(this.toArray(),S,C)))},a.prototype._initNumber=function(y,S,C){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(n(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),C==="le"&&this._initArray(this.toArray(),S,C)},a.prototype._initArray=function(y,S,C){if(n(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var k,U,G=0;if(C==="be")for(M=y.length-1,k=0;M>=0;M-=3)U=y[M]|y[M-1]<<8|y[M-2]<<16,this.words[k]|=U<<G&67108863,this.words[k+1]=U>>>26-G&67108863,G+=24,G>=26&&(G-=26,k++);else if(C==="le")for(M=0,k=0;M<y.length;M+=3)U=y[M]|y[M+1]<<8|y[M+2]<<16,this.words[k]|=U<<G&67108863,this.words[k+1]=U>>>26-G&67108863,G+=24,G>=26&&(G-=26,k++);return this._strip()};function s(D,y){var S=D.charCodeAt(y);if(S>=48&&S<=57)return S-48;if(S>=65&&S<=70)return S-55;if(S>=97&&S<=102)return S-87;n(!1,"Invalid character in "+D)}function l(D,y,S){var C=s(D,S);return S-1>=y&&(C|=s(D,S-1)<<4),C}a.prototype._parseHex=function(y,S,C){this.length=Math.ceil((y.length-S)/6),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var k=0,U=0,G;if(C==="be")for(M=y.length-1;M>=S;M-=2)G=l(y,S,M)<<k,this.words[U]|=G&67108863,k>=18?(k-=18,U+=1,this.words[U]|=G>>>26):k+=8;else{var B=y.length-S;for(M=B%2===0?S+1:S;M<y.length;M+=2)G=l(y,S,M)<<k,this.words[U]|=G&67108863,k>=18?(k-=18,U+=1,this.words[U]|=G>>>26):k+=8}this._strip()};function u(D,y,S,C){for(var M=0,k=0,U=Math.min(D.length,S),G=y;G<U;G++){var B=D.charCodeAt(G)-48;M*=C,B>=49?k=B-49+10:B>=17?k=B-17+10:k=B,n(B>=0&&k<C,"Invalid character"),M+=k}return M}a.prototype._parseBase=function(y,S,C){this.words=[0],this.length=1;for(var M=0,k=1;k<=67108863;k*=S)M++;M--,k=k/S|0;for(var U=y.length-C,G=U%M,B=Math.min(U,U-G)+C,R=0,H=C;H<B;H+=M)R=u(y,H,H+M,S),this.imuln(k),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(G!==0){var q=1;for(R=u(y,H,y.length,S),H=0;H<G;H++)q*=S;this.imuln(q),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},a.prototype.copy=function(y){y.words=new Array(this.length);for(var S=0;S<this.length;S++)y.words[S]=this.words[S];y.length=this.length,y.negative=this.negative,y.red=this.red};function c(D,y){D.words=y.words,D.length=y.length,D.negative=y.negative,D.red=y.red}if(a.prototype._move=function(y){c(y,this)},a.prototype.clone=function(){var y=new a(null);return this.copy(y),y},a.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(y,S){y=y||10,S=S|0||1;var C;if(y===16||y==="hex"){C="";for(var M=0,k=0,U=0;U<this.length;U++){var G=this.words[U],B=((G<<M|k)&16777215).toString(16);k=G>>>24-M&16777215,M+=2,M>=26&&(M-=26,U--),k!==0||U!==this.length-1?C=d[6-B.length]+B+C:C=B+C}for(k!==0&&(C=k.toString(16)+C);C.length%S!==0;)C="0"+C;return this.negative!==0&&(C="-"+C),C}if(y===(y|0)&&y>=2&&y<=36){var R=h[y],H=p[y];C="";var q=this.clone();for(q.negative=0;!q.isZero();){var W=q.modrn(H).toString(y);q=q.idivn(H),q.isZero()?C=W+C:C=d[R-W.length]+W+C}for(this.isZero()&&(C="0"+C);C.length%S!==0;)C="0"+C;return this.negative!==0&&(C="-"+C),C}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(y,S){return this.toArrayLike(o,y,S)}),a.prototype.toArray=function(y,S){return this.toArrayLike(Array,y,S)};var g=function(y,S){return y.allocUnsafe?y.allocUnsafe(S):new y(S)};a.prototype.toArrayLike=function(y,S,C){this._strip();var M=this.byteLength(),k=C||Math.max(1,M);n(M<=k,"byte array longer than desired length"),n(k>0,"Requested array length <= 0");var U=g(y,k),G=S==="le"?"LE":"BE";return this["_toArrayLike"+G](U,M),U},a.prototype._toArrayLikeLE=function(y,S){for(var C=0,M=0,k=0,U=0;k<this.length;k++){var G=this.words[k]<<U|M;y[C++]=G&255,C<y.length&&(y[C++]=G>>8&255),C<y.length&&(y[C++]=G>>16&255),U===6?(C<y.length&&(y[C++]=G>>24&255),M=0,U=0):(M=G>>>24,U+=2)}if(C<y.length)for(y[C++]=M;C<y.length;)y[C++]=0},a.prototype._toArrayLikeBE=function(y,S){for(var C=y.length-1,M=0,k=0,U=0;k<this.length;k++){var G=this.words[k]<<U|M;y[C--]=G&255,C>=0&&(y[C--]=G>>8&255),C>=0&&(y[C--]=G>>16&255),U===6?(C>=0&&(y[C--]=G>>24&255),M=0,U=0):(M=G>>>24,U+=2)}if(C>=0)for(y[C--]=M;C>=0;)y[C--]=0},Math.clz32?a.prototype._countBits=function(y){return 32-Math.clz32(y)}:a.prototype._countBits=function(y){var S=y,C=0;return S>=4096&&(C+=13,S>>>=13),S>=64&&(C+=7,S>>>=7),S>=8&&(C+=4,S>>>=4),S>=2&&(C+=2,S>>>=2),C+S},a.prototype._zeroBits=function(y){if(y===0)return 26;var S=y,C=0;return S&8191||(C+=13,S>>>=13),S&127||(C+=7,S>>>=7),S&15||(C+=4,S>>>=4),S&3||(C+=2,S>>>=2),S&1||C++,C},a.prototype.bitLength=function(){var y=this.words[this.length-1],S=this._countBits(y);return(this.length-1)*26+S};function m(D){for(var y=new Array(D.bitLength()),S=0;S<y.length;S++){var C=S/26|0,M=S%26;y[S]=D.words[C]>>>M&1}return y}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,S=0;S<this.length;S++){var C=this._zeroBits(this.words[S]);if(y+=C,C!==26)break}return y},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},a.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var S=0;S<y.length;S++)this.words[S]=this.words[S]|y.words[S];return this._strip()},a.prototype.ior=function(y){return n((this.negative|y.negative)===0),this.iuor(y)},a.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},a.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},a.prototype.iuand=function(y){var S;this.length>y.length?S=y:S=this;for(var C=0;C<S.length;C++)this.words[C]=this.words[C]&y.words[C];return this.length=S.length,this._strip()},a.prototype.iand=function(y){return n((this.negative|y.negative)===0),this.iuand(y)},a.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},a.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},a.prototype.iuxor=function(y){var S,C;this.length>y.length?(S=this,C=y):(S=y,C=this);for(var M=0;M<C.length;M++)this.words[M]=S.words[M]^C.words[M];if(this!==S)for(;M<S.length;M++)this.words[M]=S.words[M];return this.length=S.length,this._strip()},a.prototype.ixor=function(y){return n((this.negative|y.negative)===0),this.iuxor(y)},a.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},a.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},a.prototype.inotn=function(y){n(typeof y=="number"&&y>=0);var S=Math.ceil(y/26)|0,C=y%26;this._expand(S),C>0&&S--;for(var M=0;M<S;M++)this.words[M]=~this.words[M]&67108863;return C>0&&(this.words[M]=~this.words[M]&67108863>>26-C),this._strip()},a.prototype.notn=function(y){return this.clone().inotn(y)},a.prototype.setn=function(y,S){n(typeof y=="number"&&y>=0);var C=y/26|0,M=y%26;return this._expand(C+1),S?this.words[C]=this.words[C]|1<<M:this.words[C]=this.words[C]&~(1<<M),this._strip()},a.prototype.iadd=function(y){var S;if(this.negative!==0&&y.negative===0)return this.negative=0,S=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,S=this.isub(y),y.negative=1,S._normSign();var C,M;this.length>y.length?(C=this,M=y):(C=y,M=this);for(var k=0,U=0;U<M.length;U++)S=(C.words[U]|0)+(M.words[U]|0)+k,this.words[U]=S&67108863,k=S>>>26;for(;k!==0&&U<C.length;U++)S=(C.words[U]|0)+k,this.words[U]=S&67108863,k=S>>>26;if(this.length=C.length,k!==0)this.words[this.length]=k,this.length++;else if(C!==this)for(;U<C.length;U++)this.words[U]=C.words[U];return this},a.prototype.add=function(y){var S;return y.negative!==0&&this.negative===0?(y.negative=0,S=this.sub(y),y.negative^=1,S):y.negative===0&&this.negative!==0?(this.negative=0,S=y.sub(this),this.negative=1,S):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},a.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var S=this.iadd(y);return y.negative=1,S._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var C=this.cmp(y);if(C===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,k;C>0?(M=this,k=y):(M=y,k=this);for(var U=0,G=0;G<k.length;G++)S=(M.words[G]|0)-(k.words[G]|0)+U,U=S>>26,this.words[G]=S&67108863;for(;U!==0&&G<M.length;G++)S=(M.words[G]|0)+U,U=S>>26,this.words[G]=S&67108863;if(U===0&&G<M.length&&M!==this)for(;G<M.length;G++)this.words[G]=M.words[G];return this.length=Math.max(this.length,G),M!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(y){return this.clone().isub(y)};function E(D,y,S){S.negative=y.negative^D.negative;var C=D.length+y.length|0;S.length=C,C=C-1|0;var M=D.words[0]|0,k=y.words[0]|0,U=M*k,G=U&67108863,B=U/67108864|0;S.words[0]=G;for(var R=1;R<C;R++){for(var H=B>>>26,q=B&67108863,W=Math.min(R,y.length-1),Y=Math.max(0,R-D.length+1);Y<=W;Y++){var re=R-Y|0;M=D.words[re]|0,k=y.words[Y]|0,U=M*k+q,H+=U/67108864|0,q=U&67108863}S.words[R]=q|0,B=H|0}return B!==0?S.words[R]=B|0:S.length--,S._strip()}var b=function(y,S,C){var M=y.words,k=S.words,U=C.words,G=0,B,R,H,q=M[0]|0,W=q&8191,Y=q>>>13,re=M[1]|0,Q=re&8191,ie=re>>>13,ce=M[2]|0,te=ce&8191,J=ce>>>13,ge=M[3]|0,fe=ge&8191,ye=ge>>>13,Ue=M[4]|0,me=Ue&8191,Be=Ue>>>13,et=M[5]|0,Ge=et&8191,Ae=et>>>13,We=M[6]|0,Le=We&8191,Ie=We>>>13,tt=M[7]|0,Ve=tt&8191,ne=tt>>>13,X=M[8]|0,K=X&8191,le=X>>>13,ve=M[9]|0,Ee=ve&8191,we=ve>>>13,ft=k[0]|0,Fe=ft&8191,Xe=ft>>>13,Qt=k[1]|0,it=Qt&8191,Tt=Qt>>>13,Hr=k[2]|0,xt=Hr&8191,Mt=Hr>>>13,kn=k[3]|0,Ot=kn&8191,qt=kn>>>13,Vi=k[4]|0,ct=Vi&8191,_t=Vi>>>13,Ki=k[5]|0,Jt=Ki&8191,zt=Ki>>>13,aa=k[6]|0,Vt=aa&8191,Ft=aa>>>13,Wi=k[7]|0,vt=Wi&8191,Nt=Wi>>>13,qr=k[8]|0,yt=qr&8191,Lt=qr>>>13,oa=k[9]|0,Pe=oa&8191,De=oa>>>13;C.negative=y.negative^S.negative,C.length=19,B=Math.imul(W,Fe),R=Math.imul(W,Xe),R=R+Math.imul(Y,Fe)|0,H=Math.imul(Y,Xe);var Pt=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,B=Math.imul(Q,Fe),R=Math.imul(Q,Xe),R=R+Math.imul(ie,Fe)|0,H=Math.imul(ie,Xe),B=B+Math.imul(W,it)|0,R=R+Math.imul(W,Tt)|0,R=R+Math.imul(Y,it)|0,H=H+Math.imul(Y,Tt)|0;var Sr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,B=Math.imul(te,Fe),R=Math.imul(te,Xe),R=R+Math.imul(J,Fe)|0,H=Math.imul(J,Xe),B=B+Math.imul(Q,it)|0,R=R+Math.imul(Q,Tt)|0,R=R+Math.imul(ie,it)|0,H=H+Math.imul(ie,Tt)|0,B=B+Math.imul(W,xt)|0,R=R+Math.imul(W,Mt)|0,R=R+Math.imul(Y,xt)|0,H=H+Math.imul(Y,Mt)|0;var Mr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,B=Math.imul(fe,Fe),R=Math.imul(fe,Xe),R=R+Math.imul(ye,Fe)|0,H=Math.imul(ye,Xe),B=B+Math.imul(te,it)|0,R=R+Math.imul(te,Tt)|0,R=R+Math.imul(J,it)|0,H=H+Math.imul(J,Tt)|0,B=B+Math.imul(Q,xt)|0,R=R+Math.imul(Q,Mt)|0,R=R+Math.imul(ie,xt)|0,H=H+Math.imul(ie,Mt)|0,B=B+Math.imul(W,Ot)|0,R=R+Math.imul(W,qt)|0,R=R+Math.imul(Y,Ot)|0,H=H+Math.imul(Y,qt)|0;var un=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(un>>>26)|0,un&=67108863,B=Math.imul(me,Fe),R=Math.imul(me,Xe),R=R+Math.imul(Be,Fe)|0,H=Math.imul(Be,Xe),B=B+Math.imul(fe,it)|0,R=R+Math.imul(fe,Tt)|0,R=R+Math.imul(ye,it)|0,H=H+Math.imul(ye,Tt)|0,B=B+Math.imul(te,xt)|0,R=R+Math.imul(te,Mt)|0,R=R+Math.imul(J,xt)|0,H=H+Math.imul(J,Mt)|0,B=B+Math.imul(Q,Ot)|0,R=R+Math.imul(Q,qt)|0,R=R+Math.imul(ie,Ot)|0,H=H+Math.imul(ie,qt)|0,B=B+Math.imul(W,ct)|0,R=R+Math.imul(W,_t)|0,R=R+Math.imul(Y,ct)|0,H=H+Math.imul(Y,_t)|0;var fn=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(fn>>>26)|0,fn&=67108863,B=Math.imul(Ge,Fe),R=Math.imul(Ge,Xe),R=R+Math.imul(Ae,Fe)|0,H=Math.imul(Ae,Xe),B=B+Math.imul(me,it)|0,R=R+Math.imul(me,Tt)|0,R=R+Math.imul(Be,it)|0,H=H+Math.imul(Be,Tt)|0,B=B+Math.imul(fe,xt)|0,R=R+Math.imul(fe,Mt)|0,R=R+Math.imul(ye,xt)|0,H=H+Math.imul(ye,Mt)|0,B=B+Math.imul(te,Ot)|0,R=R+Math.imul(te,qt)|0,R=R+Math.imul(J,Ot)|0,H=H+Math.imul(J,qt)|0,B=B+Math.imul(Q,ct)|0,R=R+Math.imul(Q,_t)|0,R=R+Math.imul(ie,ct)|0,H=H+Math.imul(ie,_t)|0,B=B+Math.imul(W,Jt)|0,R=R+Math.imul(W,zt)|0,R=R+Math.imul(Y,Jt)|0,H=H+Math.imul(Y,zt)|0;var ri=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(ri>>>26)|0,ri&=67108863,B=Math.imul(Le,Fe),R=Math.imul(Le,Xe),R=R+Math.imul(Ie,Fe)|0,H=Math.imul(Ie,Xe),B=B+Math.imul(Ge,it)|0,R=R+Math.imul(Ge,Tt)|0,R=R+Math.imul(Ae,it)|0,H=H+Math.imul(Ae,Tt)|0,B=B+Math.imul(me,xt)|0,R=R+Math.imul(me,Mt)|0,R=R+Math.imul(Be,xt)|0,H=H+Math.imul(Be,Mt)|0,B=B+Math.imul(fe,Ot)|0,R=R+Math.imul(fe,qt)|0,R=R+Math.imul(ye,Ot)|0,H=H+Math.imul(ye,qt)|0,B=B+Math.imul(te,ct)|0,R=R+Math.imul(te,_t)|0,R=R+Math.imul(J,ct)|0,H=H+Math.imul(J,_t)|0,B=B+Math.imul(Q,Jt)|0,R=R+Math.imul(Q,zt)|0,R=R+Math.imul(ie,Jt)|0,H=H+Math.imul(ie,zt)|0,B=B+Math.imul(W,Vt)|0,R=R+Math.imul(W,Ft)|0,R=R+Math.imul(Y,Vt)|0,H=H+Math.imul(Y,Ft)|0;var no=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(no>>>26)|0,no&=67108863,B=Math.imul(Ve,Fe),R=Math.imul(Ve,Xe),R=R+Math.imul(ne,Fe)|0,H=Math.imul(ne,Xe),B=B+Math.imul(Le,it)|0,R=R+Math.imul(Le,Tt)|0,R=R+Math.imul(Ie,it)|0,H=H+Math.imul(Ie,Tt)|0,B=B+Math.imul(Ge,xt)|0,R=R+Math.imul(Ge,Mt)|0,R=R+Math.imul(Ae,xt)|0,H=H+Math.imul(Ae,Mt)|0,B=B+Math.imul(me,Ot)|0,R=R+Math.imul(me,qt)|0,R=R+Math.imul(Be,Ot)|0,H=H+Math.imul(Be,qt)|0,B=B+Math.imul(fe,ct)|0,R=R+Math.imul(fe,_t)|0,R=R+Math.imul(ye,ct)|0,H=H+Math.imul(ye,_t)|0,B=B+Math.imul(te,Jt)|0,R=R+Math.imul(te,zt)|0,R=R+Math.imul(J,Jt)|0,H=H+Math.imul(J,zt)|0,B=B+Math.imul(Q,Vt)|0,R=R+Math.imul(Q,Ft)|0,R=R+Math.imul(ie,Vt)|0,H=H+Math.imul(ie,Ft)|0,B=B+Math.imul(W,vt)|0,R=R+Math.imul(W,Nt)|0,R=R+Math.imul(Y,vt)|0,H=H+Math.imul(Y,Nt)|0;var Zi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,B=Math.imul(K,Fe),R=Math.imul(K,Xe),R=R+Math.imul(le,Fe)|0,H=Math.imul(le,Xe),B=B+Math.imul(Ve,it)|0,R=R+Math.imul(Ve,Tt)|0,R=R+Math.imul(ne,it)|0,H=H+Math.imul(ne,Tt)|0,B=B+Math.imul(Le,xt)|0,R=R+Math.imul(Le,Mt)|0,R=R+Math.imul(Ie,xt)|0,H=H+Math.imul(Ie,Mt)|0,B=B+Math.imul(Ge,Ot)|0,R=R+Math.imul(Ge,qt)|0,R=R+Math.imul(Ae,Ot)|0,H=H+Math.imul(Ae,qt)|0,B=B+Math.imul(me,ct)|0,R=R+Math.imul(me,_t)|0,R=R+Math.imul(Be,ct)|0,H=H+Math.imul(Be,_t)|0,B=B+Math.imul(fe,Jt)|0,R=R+Math.imul(fe,zt)|0,R=R+Math.imul(ye,Jt)|0,H=H+Math.imul(ye,zt)|0,B=B+Math.imul(te,Vt)|0,R=R+Math.imul(te,Ft)|0,R=R+Math.imul(J,Vt)|0,H=H+Math.imul(J,Ft)|0,B=B+Math.imul(Q,vt)|0,R=R+Math.imul(Q,Nt)|0,R=R+Math.imul(ie,vt)|0,H=H+Math.imul(ie,Nt)|0,B=B+Math.imul(W,yt)|0,R=R+Math.imul(W,Lt)|0,R=R+Math.imul(Y,yt)|0,H=H+Math.imul(Y,Lt)|0;var po=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(po>>>26)|0,po&=67108863,B=Math.imul(Ee,Fe),R=Math.imul(Ee,Xe),R=R+Math.imul(we,Fe)|0,H=Math.imul(we,Xe),B=B+Math.imul(K,it)|0,R=R+Math.imul(K,Tt)|0,R=R+Math.imul(le,it)|0,H=H+Math.imul(le,Tt)|0,B=B+Math.imul(Ve,xt)|0,R=R+Math.imul(Ve,Mt)|0,R=R+Math.imul(ne,xt)|0,H=H+Math.imul(ne,Mt)|0,B=B+Math.imul(Le,Ot)|0,R=R+Math.imul(Le,qt)|0,R=R+Math.imul(Ie,Ot)|0,H=H+Math.imul(Ie,qt)|0,B=B+Math.imul(Ge,ct)|0,R=R+Math.imul(Ge,_t)|0,R=R+Math.imul(Ae,ct)|0,H=H+Math.imul(Ae,_t)|0,B=B+Math.imul(me,Jt)|0,R=R+Math.imul(me,zt)|0,R=R+Math.imul(Be,Jt)|0,H=H+Math.imul(Be,zt)|0,B=B+Math.imul(fe,Vt)|0,R=R+Math.imul(fe,Ft)|0,R=R+Math.imul(ye,Vt)|0,H=H+Math.imul(ye,Ft)|0,B=B+Math.imul(te,vt)|0,R=R+Math.imul(te,Nt)|0,R=R+Math.imul(J,vt)|0,H=H+Math.imul(J,Nt)|0,B=B+Math.imul(Q,yt)|0,R=R+Math.imul(Q,Lt)|0,R=R+Math.imul(ie,yt)|0,H=H+Math.imul(ie,Lt)|0,B=B+Math.imul(W,Pe)|0,R=R+Math.imul(W,De)|0,R=R+Math.imul(Y,Pe)|0,H=H+Math.imul(Y,De)|0;var sa=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(sa>>>26)|0,sa&=67108863,B=Math.imul(Ee,it),R=Math.imul(Ee,Tt),R=R+Math.imul(we,it)|0,H=Math.imul(we,Tt),B=B+Math.imul(K,xt)|0,R=R+Math.imul(K,Mt)|0,R=R+Math.imul(le,xt)|0,H=H+Math.imul(le,Mt)|0,B=B+Math.imul(Ve,Ot)|0,R=R+Math.imul(Ve,qt)|0,R=R+Math.imul(ne,Ot)|0,H=H+Math.imul(ne,qt)|0,B=B+Math.imul(Le,ct)|0,R=R+Math.imul(Le,_t)|0,R=R+Math.imul(Ie,ct)|0,H=H+Math.imul(Ie,_t)|0,B=B+Math.imul(Ge,Jt)|0,R=R+Math.imul(Ge,zt)|0,R=R+Math.imul(Ae,Jt)|0,H=H+Math.imul(Ae,zt)|0,B=B+Math.imul(me,Vt)|0,R=R+Math.imul(me,Ft)|0,R=R+Math.imul(Be,Vt)|0,H=H+Math.imul(Be,Ft)|0,B=B+Math.imul(fe,vt)|0,R=R+Math.imul(fe,Nt)|0,R=R+Math.imul(ye,vt)|0,H=H+Math.imul(ye,Nt)|0,B=B+Math.imul(te,yt)|0,R=R+Math.imul(te,Lt)|0,R=R+Math.imul(J,yt)|0,H=H+Math.imul(J,Lt)|0,B=B+Math.imul(Q,Pe)|0,R=R+Math.imul(Q,De)|0,R=R+Math.imul(ie,Pe)|0,H=H+Math.imul(ie,De)|0;var Ca=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,B=Math.imul(Ee,xt),R=Math.imul(Ee,Mt),R=R+Math.imul(we,xt)|0,H=Math.imul(we,Mt),B=B+Math.imul(K,Ot)|0,R=R+Math.imul(K,qt)|0,R=R+Math.imul(le,Ot)|0,H=H+Math.imul(le,qt)|0,B=B+Math.imul(Ve,ct)|0,R=R+Math.imul(Ve,_t)|0,R=R+Math.imul(ne,ct)|0,H=H+Math.imul(ne,_t)|0,B=B+Math.imul(Le,Jt)|0,R=R+Math.imul(Le,zt)|0,R=R+Math.imul(Ie,Jt)|0,H=H+Math.imul(Ie,zt)|0,B=B+Math.imul(Ge,Vt)|0,R=R+Math.imul(Ge,Ft)|0,R=R+Math.imul(Ae,Vt)|0,H=H+Math.imul(Ae,Ft)|0,B=B+Math.imul(me,vt)|0,R=R+Math.imul(me,Nt)|0,R=R+Math.imul(Be,vt)|0,H=H+Math.imul(Be,Nt)|0,B=B+Math.imul(fe,yt)|0,R=R+Math.imul(fe,Lt)|0,R=R+Math.imul(ye,yt)|0,H=H+Math.imul(ye,Lt)|0,B=B+Math.imul(te,Pe)|0,R=R+Math.imul(te,De)|0,R=R+Math.imul(J,Pe)|0,H=H+Math.imul(J,De)|0;var Jr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,B=Math.imul(Ee,Ot),R=Math.imul(Ee,qt),R=R+Math.imul(we,Ot)|0,H=Math.imul(we,qt),B=B+Math.imul(K,ct)|0,R=R+Math.imul(K,_t)|0,R=R+Math.imul(le,ct)|0,H=H+Math.imul(le,_t)|0,B=B+Math.imul(Ve,Jt)|0,R=R+Math.imul(Ve,zt)|0,R=R+Math.imul(ne,Jt)|0,H=H+Math.imul(ne,zt)|0,B=B+Math.imul(Le,Vt)|0,R=R+Math.imul(Le,Ft)|0,R=R+Math.imul(Ie,Vt)|0,H=H+Math.imul(Ie,Ft)|0,B=B+Math.imul(Ge,vt)|0,R=R+Math.imul(Ge,Nt)|0,R=R+Math.imul(Ae,vt)|0,H=H+Math.imul(Ae,Nt)|0,B=B+Math.imul(me,yt)|0,R=R+Math.imul(me,Lt)|0,R=R+Math.imul(Be,yt)|0,H=H+Math.imul(Be,Lt)|0,B=B+Math.imul(fe,Pe)|0,R=R+Math.imul(fe,De)|0,R=R+Math.imul(ye,Pe)|0,H=H+Math.imul(ye,De)|0;var Oi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,B=Math.imul(Ee,ct),R=Math.imul(Ee,_t),R=R+Math.imul(we,ct)|0,H=Math.imul(we,_t),B=B+Math.imul(K,Jt)|0,R=R+Math.imul(K,zt)|0,R=R+Math.imul(le,Jt)|0,H=H+Math.imul(le,zt)|0,B=B+Math.imul(Ve,Vt)|0,R=R+Math.imul(Ve,Ft)|0,R=R+Math.imul(ne,Vt)|0,H=H+Math.imul(ne,Ft)|0,B=B+Math.imul(Le,vt)|0,R=R+Math.imul(Le,Nt)|0,R=R+Math.imul(Ie,vt)|0,H=H+Math.imul(Ie,Nt)|0,B=B+Math.imul(Ge,yt)|0,R=R+Math.imul(Ge,Lt)|0,R=R+Math.imul(Ae,yt)|0,H=H+Math.imul(Ae,Lt)|0,B=B+Math.imul(me,Pe)|0,R=R+Math.imul(me,De)|0,R=R+Math.imul(Be,Pe)|0,H=H+Math.imul(Be,De)|0;var hi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(hi>>>26)|0,hi&=67108863,B=Math.imul(Ee,Jt),R=Math.imul(Ee,zt),R=R+Math.imul(we,Jt)|0,H=Math.imul(we,zt),B=B+Math.imul(K,Vt)|0,R=R+Math.imul(K,Ft)|0,R=R+Math.imul(le,Vt)|0,H=H+Math.imul(le,Ft)|0,B=B+Math.imul(Ve,vt)|0,R=R+Math.imul(Ve,Nt)|0,R=R+Math.imul(ne,vt)|0,H=H+Math.imul(ne,Nt)|0,B=B+Math.imul(Le,yt)|0,R=R+Math.imul(Le,Lt)|0,R=R+Math.imul(Ie,yt)|0,H=H+Math.imul(Ie,Lt)|0,B=B+Math.imul(Ge,Pe)|0,R=R+Math.imul(Ge,De)|0,R=R+Math.imul(Ae,Pe)|0,H=H+Math.imul(Ae,De)|0;var Bo=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,B=Math.imul(Ee,Vt),R=Math.imul(Ee,Ft),R=R+Math.imul(we,Vt)|0,H=Math.imul(we,Ft),B=B+Math.imul(K,vt)|0,R=R+Math.imul(K,Nt)|0,R=R+Math.imul(le,vt)|0,H=H+Math.imul(le,Nt)|0,B=B+Math.imul(Ve,yt)|0,R=R+Math.imul(Ve,Lt)|0,R=R+Math.imul(ne,yt)|0,H=H+Math.imul(ne,Lt)|0,B=B+Math.imul(Le,Pe)|0,R=R+Math.imul(Le,De)|0,R=R+Math.imul(Ie,Pe)|0,H=H+Math.imul(Ie,De)|0;var ss=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(ss>>>26)|0,ss&=67108863,B=Math.imul(Ee,vt),R=Math.imul(Ee,Nt),R=R+Math.imul(we,vt)|0,H=Math.imul(we,Nt),B=B+Math.imul(K,yt)|0,R=R+Math.imul(K,Lt)|0,R=R+Math.imul(le,yt)|0,H=H+Math.imul(le,Lt)|0,B=B+Math.imul(Ve,Pe)|0,R=R+Math.imul(Ve,De)|0,R=R+Math.imul(ne,Pe)|0,H=H+Math.imul(ne,De)|0;var Nl=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Nl>>>26)|0,Nl&=67108863,B=Math.imul(Ee,yt),R=Math.imul(Ee,Lt),R=R+Math.imul(we,yt)|0,H=Math.imul(we,Lt),B=B+Math.imul(K,Pe)|0,R=R+Math.imul(K,De)|0,R=R+Math.imul(le,Pe)|0,H=H+Math.imul(le,De)|0;var Ll=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,B=Math.imul(Ee,Pe),R=Math.imul(Ee,De),R=R+Math.imul(we,Pe)|0,H=Math.imul(we,De);var pe=(G+B|0)+((R&8191)<<13)|0;return G=(H+(R>>>13)|0)+(pe>>>26)|0,pe&=67108863,U[0]=Pt,U[1]=Sr,U[2]=Mr,U[3]=un,U[4]=fn,U[5]=ri,U[6]=no,U[7]=Zi,U[8]=po,U[9]=sa,U[10]=Ca,U[11]=Jr,U[12]=Oi,U[13]=hi,U[14]=Bo,U[15]=ss,U[16]=Nl,U[17]=Ll,U[18]=pe,G!==0&&(U[19]=G,C.length++),C};Math.imul||(b=E);function w(D,y,S){S.negative=y.negative^D.negative,S.length=D.length+y.length;for(var C=0,M=0,k=0;k<S.length-1;k++){var U=M;M=0;for(var G=C&67108863,B=Math.min(k,y.length-1),R=Math.max(0,k-D.length+1);R<=B;R++){var H=k-R,q=D.words[H]|0,W=y.words[R]|0,Y=q*W,re=Y&67108863;U=U+(Y/67108864|0)|0,re=re+G|0,G=re&67108863,U=U+(re>>>26)|0,M+=U>>>26,U&=67108863}S.words[k]=G,C=U,U=M}return C!==0?S.words[k]=C:S.length--,S._strip()}function T(D,y,S){return w(D,y,S)}a.prototype.mulTo=function(y,S){var C,M=this.length+y.length;return this.length===10&&y.length===10?C=b(this,y,S):M<63?C=E(this,y,S):M<1024?C=w(this,y,S):C=T(this,y,S),C},a.prototype.mul=function(y){var S=new a(null);return S.words=new Array(this.length+y.length),this.mulTo(y,S)},a.prototype.mulf=function(y){var S=new a(null);return S.words=new Array(this.length+y.length),T(this,y,S)},a.prototype.imul=function(y){return this.clone().mulTo(y,this)},a.prototype.imuln=function(y){var S=y<0;S&&(y=-y),n(typeof y=="number"),n(y<67108864);for(var C=0,M=0;M<this.length;M++){var k=(this.words[M]|0)*y,U=(k&67108863)+(C&67108863);C>>=26,C+=k/67108864|0,C+=U>>>26,this.words[M]=U&67108863}return C!==0&&(this.words[M]=C,this.length++),S?this.ineg():this},a.prototype.muln=function(y){return this.clone().imuln(y)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(y){var S=m(y);if(S.length===0)return new a(1);for(var C=this,M=0;M<S.length&&S[M]===0;M++,C=C.sqr());if(++M<S.length)for(var k=C.sqr();M<S.length;M++,k=k.sqr())S[M]!==0&&(C=C.mul(k));return C},a.prototype.iushln=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26,M=67108863>>>26-S<<26-S,k;if(S!==0){var U=0;for(k=0;k<this.length;k++){var G=this.words[k]&M,B=(this.words[k]|0)-G<<S;this.words[k]=B|U,U=G>>>26-S}U&&(this.words[k]=U,this.length++)}if(C!==0){for(k=this.length-1;k>=0;k--)this.words[k+C]=this.words[k];for(k=0;k<C;k++)this.words[k]=0;this.length+=C}return this._strip()},a.prototype.ishln=function(y){return n(this.negative===0),this.iushln(y)},a.prototype.iushrn=function(y,S,C){n(typeof y=="number"&&y>=0);var M;S?M=(S-S%26)/26:M=0;var k=y%26,U=Math.min((y-k)/26,this.length),G=67108863^67108863>>>k<<k,B=C;if(M-=U,M=Math.max(0,M),B){for(var R=0;R<U;R++)B.words[R]=this.words[R];B.length=U}if(U!==0)if(this.length>U)for(this.length-=U,R=0;R<this.length;R++)this.words[R]=this.words[R+U];else this.words[0]=0,this.length=1;var H=0;for(R=this.length-1;R>=0&&(H!==0||R>=M);R--){var q=this.words[R]|0;this.words[R]=H<<26-k|q>>>k,H=q&G}return B&&H!==0&&(B.words[B.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(y,S,C){return n(this.negative===0),this.iushrn(y,S,C)},a.prototype.shln=function(y){return this.clone().ishln(y)},a.prototype.ushln=function(y){return this.clone().iushln(y)},a.prototype.shrn=function(y){return this.clone().ishrn(y)},a.prototype.ushrn=function(y){return this.clone().iushrn(y)},a.prototype.testn=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26,M=1<<S;if(this.length<=C)return!1;var k=this.words[C];return!!(k&M)},a.prototype.imaskn=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=C)return this;if(S!==0&&C++,this.length=Math.min(C,this.length),S!==0){var M=67108863^67108863>>>S<<S;this.words[this.length-1]&=M}return this._strip()},a.prototype.maskn=function(y){return this.clone().imaskn(y)},a.prototype.iaddn=function(y){return n(typeof y=="number"),n(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},a.prototype._iaddn=function(y){this.words[0]+=y;for(var S=0;S<this.length&&this.words[S]>=67108864;S++)this.words[S]-=67108864,S===this.length-1?this.words[S+1]=1:this.words[S+1]++;return this.length=Math.max(this.length,S+1),this},a.prototype.isubn=function(y){if(n(typeof y=="number"),n(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var S=0;S<this.length&&this.words[S]<0;S++)this.words[S]+=67108864,this.words[S+1]-=1;return this._strip()},a.prototype.addn=function(y){return this.clone().iaddn(y)},a.prototype.subn=function(y){return this.clone().isubn(y)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(y,S,C){var M=y.length+C,k;this._expand(M);var U,G=0;for(k=0;k<y.length;k++){U=(this.words[k+C]|0)+G;var B=(y.words[k]|0)*S;U-=B&67108863,G=(U>>26)-(B/67108864|0),this.words[k+C]=U&67108863}for(;k<this.length-C;k++)U=(this.words[k+C]|0)+G,G=U>>26,this.words[k+C]=U&67108863;if(G===0)return this._strip();for(n(G===-1),G=0,k=0;k<this.length;k++)U=-(this.words[k]|0)+G,G=U>>26,this.words[k]=U&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(y,S){var C=this.length-y.length,M=this.clone(),k=y,U=k.words[k.length-1]|0,G=this._countBits(U);C=26-G,C!==0&&(k=k.ushln(C),M.iushln(C),U=k.words[k.length-1]|0);var B=M.length-k.length,R;if(S!=="mod"){R=new a(null),R.length=B+1,R.words=new Array(R.length);for(var H=0;H<R.length;H++)R.words[H]=0}var q=M.clone()._ishlnsubmul(k,1,B);q.negative===0&&(M=q,R&&(R.words[B]=1));for(var W=B-1;W>=0;W--){var Y=(M.words[k.length+W]|0)*67108864+(M.words[k.length+W-1]|0);for(Y=Math.min(Y/U|0,67108863),M._ishlnsubmul(k,Y,W);M.negative!==0;)Y--,M.negative=0,M._ishlnsubmul(k,1,W),M.isZero()||(M.negative^=1);R&&(R.words[W]=Y)}return R&&R._strip(),M._strip(),S!=="div"&&C!==0&&M.iushrn(C),{div:R||null,mod:M}},a.prototype.divmod=function(y,S,C){if(n(!y.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var M,k,U;return this.negative!==0&&y.negative===0?(U=this.neg().divmod(y,S),S!=="mod"&&(M=U.div.neg()),S!=="div"&&(k=U.mod.neg(),C&&k.negative!==0&&k.iadd(y)),{div:M,mod:k}):this.negative===0&&y.negative!==0?(U=this.divmod(y.neg(),S),S!=="mod"&&(M=U.div.neg()),{div:M,mod:U.mod}):this.negative&y.negative?(U=this.neg().divmod(y.neg(),S),S!=="div"&&(k=U.mod.neg(),C&&k.negative!==0&&k.isub(y)),{div:U.div,mod:k}):y.length>this.length||this.cmp(y)<0?{div:new a(0),mod:this}:y.length===1?S==="div"?{div:this.divn(y.words[0]),mod:null}:S==="mod"?{div:null,mod:new a(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new a(this.modrn(y.words[0]))}:this._wordDiv(y,S)},a.prototype.div=function(y){return this.divmod(y,"div",!1).div},a.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},a.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},a.prototype.divRound=function(y){var S=this.divmod(y);if(S.mod.isZero())return S.div;var C=S.div.negative!==0?S.mod.isub(y):S.mod,M=y.ushrn(1),k=y.andln(1),U=C.cmp(M);return U<0||k===1&&U===0?S.div:S.div.negative!==0?S.div.isubn(1):S.div.iaddn(1)},a.prototype.modrn=function(y){var S=y<0;S&&(y=-y),n(y<=67108863);for(var C=(1<<26)%y,M=0,k=this.length-1;k>=0;k--)M=(C*M+(this.words[k]|0))%y;return S?-M:M},a.prototype.modn=function(y){return this.modrn(y)},a.prototype.idivn=function(y){var S=y<0;S&&(y=-y),n(y<=67108863);for(var C=0,M=this.length-1;M>=0;M--){var k=(this.words[M]|0)+C*67108864;this.words[M]=k/y|0,C=k%y}return this._strip(),S?this.ineg():this},a.prototype.divn=function(y){return this.clone().idivn(y)},a.prototype.egcd=function(y){n(y.negative===0),n(!y.isZero());var S=this,C=y.clone();S.negative!==0?S=S.umod(y):S=S.clone();for(var M=new a(1),k=new a(0),U=new a(0),G=new a(1),B=0;S.isEven()&&C.isEven();)S.iushrn(1),C.iushrn(1),++B;for(var R=C.clone(),H=S.clone();!S.isZero();){for(var q=0,W=1;!(S.words[0]&W)&&q<26;++q,W<<=1);if(q>0)for(S.iushrn(q);q-- >0;)(M.isOdd()||k.isOdd())&&(M.iadd(R),k.isub(H)),M.iushrn(1),k.iushrn(1);for(var Y=0,re=1;!(C.words[0]&re)&&Y<26;++Y,re<<=1);if(Y>0)for(C.iushrn(Y);Y-- >0;)(U.isOdd()||G.isOdd())&&(U.iadd(R),G.isub(H)),U.iushrn(1),G.iushrn(1);S.cmp(C)>=0?(S.isub(C),M.isub(U),k.isub(G)):(C.isub(S),U.isub(M),G.isub(k))}return{a:U,b:G,gcd:C.iushln(B)}},a.prototype._invmp=function(y){n(y.negative===0),n(!y.isZero());var S=this,C=y.clone();S.negative!==0?S=S.umod(y):S=S.clone();for(var M=new a(1),k=new a(0),U=C.clone();S.cmpn(1)>0&&C.cmpn(1)>0;){for(var G=0,B=1;!(S.words[0]&B)&&G<26;++G,B<<=1);if(G>0)for(S.iushrn(G);G-- >0;)M.isOdd()&&M.iadd(U),M.iushrn(1);for(var R=0,H=1;!(C.words[0]&H)&&R<26;++R,H<<=1);if(R>0)for(C.iushrn(R);R-- >0;)k.isOdd()&&k.iadd(U),k.iushrn(1);S.cmp(C)>=0?(S.isub(C),M.isub(k)):(C.isub(S),k.isub(M))}var q;return S.cmpn(1)===0?q=M:q=k,q.cmpn(0)<0&&q.iadd(y),q},a.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var S=this.clone(),C=y.clone();S.negative=0,C.negative=0;for(var M=0;S.isEven()&&C.isEven();M++)S.iushrn(1),C.iushrn(1);do{for(;S.isEven();)S.iushrn(1);for(;C.isEven();)C.iushrn(1);var k=S.cmp(C);if(k<0){var U=S;S=C,C=U}else if(k===0||C.cmpn(1)===0)break;S.isub(C)}while(!0);return C.iushln(M)},a.prototype.invm=function(y){return this.egcd(y).a.umod(y)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(y){return this.words[0]&y},a.prototype.bincn=function(y){n(typeof y=="number");var S=y%26,C=(y-S)/26,M=1<<S;if(this.length<=C)return this._expand(C+1),this.words[C]|=M,this;for(var k=M,U=C;k!==0&&U<this.length;U++){var G=this.words[U]|0;G+=k,k=G>>>26,G&=67108863,this.words[U]=G}return k!==0&&(this.words[U]=k,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(y){var S=y<0;if(this.negative!==0&&!S)return-1;if(this.negative===0&&S)return 1;this._strip();var C;if(this.length>1)C=1;else{S&&(y=-y),n(y<=67108863,"Number is too big");var M=this.words[0]|0;C=M===y?0:M<y?-1:1}return this.negative!==0?-C|0:C},a.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var S=this.ucmp(y);return this.negative!==0?-S|0:S},a.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var S=0,C=this.length-1;C>=0;C--){var M=this.words[C]|0,k=y.words[C]|0;if(M!==k){M<k?S=-1:M>k&&(S=1);break}}return S},a.prototype.gtn=function(y){return this.cmpn(y)===1},a.prototype.gt=function(y){return this.cmp(y)===1},a.prototype.gten=function(y){return this.cmpn(y)>=0},a.prototype.gte=function(y){return this.cmp(y)>=0},a.prototype.ltn=function(y){return this.cmpn(y)===-1},a.prototype.lt=function(y){return this.cmp(y)===-1},a.prototype.lten=function(y){return this.cmpn(y)<=0},a.prototype.lte=function(y){return this.cmp(y)<=0},a.prototype.eqn=function(y){return this.cmpn(y)===0},a.prototype.eq=function(y){return this.cmp(y)===0},a.red=function(y){return new $(y)},a.prototype.toRed=function(y){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(y){return this.red=y,this},a.prototype.forceRed=function(y){return n(!this.red,"Already a number in reduction context"),this._forceRed(y)},a.prototype.redAdd=function(y){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},a.prototype.redIAdd=function(y){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},a.prototype.redSub=function(y){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},a.prototype.redISub=function(y){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},a.prototype.redShl=function(y){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},a.prototype.redMul=function(y){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},a.prototype.redIMul=function(y){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(y){return n(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var x={k256:null,p224:null,p192:null,p25519:null};function N(D,y){this.name=D,this.p=new a(y,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var y=new a(null);return y.words=new Array(Math.ceil(this.n/13)),y},N.prototype.ireduce=function(y){var S=y,C;do this.split(S,this.tmp),S=this.imulK(S),S=S.iadd(this.tmp),C=S.bitLength();while(C>this.n);var M=C<this.n?-1:S.ucmp(this.p);return M===0?(S.words[0]=0,S.length=1):M>0?S.isub(this.p):S.strip!==void 0?S.strip():S._strip(),S},N.prototype.split=function(y,S){y.iushrn(this.n,0,S)},N.prototype.imulK=function(y){return y.imul(this.k)};function A(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(A,N),A.prototype.split=function(y,S){for(var C=4194303,M=Math.min(y.length,9),k=0;k<M;k++)S.words[k]=y.words[k];if(S.length=M,y.length<=9){y.words[0]=0,y.length=1;return}var U=y.words[9];for(S.words[S.length++]=U&C,k=10;k<y.length;k++){var G=y.words[k]|0;y.words[k-10]=(G&C)<<4|U>>>22,U=G}U>>>=22,y.words[k-10]=U,U===0&&y.length>10?y.length-=10:y.length-=9},A.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var S=0,C=0;C<y.length;C++){var M=y.words[C]|0;S+=M*977,y.words[C]=S&67108863,S=M*64+(S/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function L(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(L,N);function O(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(O,N);function I(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(I,N),I.prototype.imulK=function(y){for(var S=0,C=0;C<y.length;C++){var M=(y.words[C]|0)*19+S,k=M&67108863;M>>>=26,y.words[C]=k,S=M}return S!==0&&(y.words[y.length++]=S),y},a._prime=function(y){if(x[y])return x[y];var S;if(y==="k256")S=new A;else if(y==="p224")S=new L;else if(y==="p192")S=new O;else if(y==="p25519")S=new I;else throw new Error("Unknown prime "+y);return x[y]=S,S};function $(D){if(typeof D=="string"){var y=a._prime(D);this.m=y.p,this.prime=y}else n(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}$.prototype._verify1=function(y){n(y.negative===0,"red works only with positives"),n(y.red,"red works only with red numbers")},$.prototype._verify2=function(y,S){n((y.negative|S.negative)===0,"red works only with positives"),n(y.red&&y.red===S.red,"red works only with red numbers")},$.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(c(y,y.umod(this.m)._forceRed(this)),y)},$.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},$.prototype.add=function(y,S){this._verify2(y,S);var C=y.add(S);return C.cmp(this.m)>=0&&C.isub(this.m),C._forceRed(this)},$.prototype.iadd=function(y,S){this._verify2(y,S);var C=y.iadd(S);return C.cmp(this.m)>=0&&C.isub(this.m),C},$.prototype.sub=function(y,S){this._verify2(y,S);var C=y.sub(S);return C.cmpn(0)<0&&C.iadd(this.m),C._forceRed(this)},$.prototype.isub=function(y,S){this._verify2(y,S);var C=y.isub(S);return C.cmpn(0)<0&&C.iadd(this.m),C},$.prototype.shl=function(y,S){return this._verify1(y),this.imod(y.ushln(S))},$.prototype.imul=function(y,S){return this._verify2(y,S),this.imod(y.imul(S))},$.prototype.mul=function(y,S){return this._verify2(y,S),this.imod(y.mul(S))},$.prototype.isqr=function(y){return this.imul(y,y.clone())},$.prototype.sqr=function(y){return this.mul(y,y)},$.prototype.sqrt=function(y){if(y.isZero())return y.clone();var S=this.m.andln(3);if(n(S%2===1),S===3){var C=this.m.add(new a(1)).iushrn(2);return this.pow(y,C)}for(var M=this.m.subn(1),k=0;!M.isZero()&&M.andln(1)===0;)k++,M.iushrn(1);n(!M.isZero());var U=new a(1).toRed(this),G=U.redNeg(),B=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new a(2*R*R).toRed(this);this.pow(R,B).cmp(G)!==0;)R.redIAdd(G);for(var H=this.pow(R,M),q=this.pow(y,M.addn(1).iushrn(1)),W=this.pow(y,M),Y=k;W.cmp(U)!==0;){for(var re=W,Q=0;re.cmp(U)!==0;Q++)re=re.redSqr();n(Q<Y);var ie=this.pow(H,new a(1).iushln(Y-Q-1));q=q.redMul(ie),H=ie.redSqr(),W=W.redMul(H),Y=Q}return q},$.prototype.invm=function(y){var S=y._invmp(this.m);return S.negative!==0?(S.negative=0,this.imod(S).redNeg()):this.imod(S)},$.prototype.pow=function(y,S){if(S.isZero())return new a(1).toRed(this);if(S.cmpn(1)===0)return y.clone();var C=4,M=new Array(1<<C);M[0]=new a(1).toRed(this),M[1]=y;for(var k=2;k<M.length;k++)M[k]=this.mul(M[k-1],y);var U=M[0],G=0,B=0,R=S.bitLength()%26;for(R===0&&(R=26),k=S.length-1;k>=0;k--){for(var H=S.words[k],q=R-1;q>=0;q--){var W=H>>q&1;if(U!==M[0]&&(U=this.sqr(U)),W===0&&G===0){B=0;continue}G<<=1,G|=W,B++,!(B!==C&&(k!==0||q!==0))&&(U=this.mul(U,M[G]),B=0,G=0)}R=26}return U},$.prototype.convertTo=function(y){var S=y.umod(this.m);return S===y?S.clone():S},$.prototype.convertFrom=function(y){var S=y.clone();return S.red=null,S},a.mont=function(y){return new F(y)};function F(D){$.call(this,D),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(F,$),F.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},F.prototype.convertFrom=function(y){var S=this.imod(y.mul(this.rinv));return S.red=null,S},F.prototype.imul=function(y,S){if(y.isZero()||S.isZero())return y.words[0]=0,y.length=1,y;var C=y.imul(S),M=C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=C.isub(M).iushrn(this.shift),U=k;return k.cmp(this.m)>=0?U=k.isub(this.m):k.cmpn(0)<0&&(U=k.iadd(this.m)),U._forceRed(this)},F.prototype.mul=function(y,S){if(y.isZero()||S.isZero())return new a(0)._forceRed(this);var C=y.mul(S),M=C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=C.isub(M).iushrn(this.shift),U=k;return k.cmp(this.m)>=0?U=k.isub(this.m):k.cmpn(0)<0&&(U=k.iadd(this.m)),U._forceRed(this)},F.prototype.invm=function(y){var S=this.imod(y._invmp(this.m).mul(this.r2));return S._forceRed(this)}})(e,gt)})(t2e);var K7t=t2e.exports;const Z7t=Nn(K7t),Q7t="logger/5.7.0";let K4e=!1,Z4e=!1;const sF={debug:1,default:2,info:2,warning:3,error:4,off:5};let Q4e=sF.default,_ie=null;function J7t(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}const J4e=J7t();var mhe;(function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"})(mhe||(mhe={}));var Qh;(function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"})(Qh||(Qh={}));const exe="0123456789abcdef";class Ne{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,r){const n=t.toLowerCase();sF[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(Q4e>sF[n])&&console.log.apply(console,r)}debug(...t){this._log(Ne.levels.DEBUG,t)}info(...t){this._log(Ne.levels.INFO,t)}warn(...t){this._log(Ne.levels.WARNING,t)}makeError(t,r,n){if(Z4e)return this.makeError("censored error",r,{});r||(r=Ne.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const u=n[l];try{if(u instanceof Uint8Array){let c="";for(let f=0;f<u.length;f++)c+=exe[u[f]>>4],c+=exe[u[f]&15];i.push(l+"=Uint8Array(0x"+c+")")}else i.push(l+"="+JSON.stringify(u))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const a=t;let o="";switch(r){case Qh.NUMERIC_FAULT:{o="NUMERIC_FAULT";const l=t;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case Qh.CALL_EXCEPTION:case Qh.INSUFFICIENT_FUNDS:case Qh.MISSING_NEW:case Qh.NONCE_EXPIRED:case Qh.REPLACEMENT_UNDERPRICED:case Qh.TRANSACTION_REPLACED:case Qh.UNPREDICTABLE_GAS_LIMIT:o=r;break}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=r,Object.keys(n).forEach(function(l){s[l]=n[l]}),s}throwError(t,r,n){throw this.makeError(t,r,n)}throwArgumentError(t,r,n){return this.throwError(t,Ne.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(t,r,n,i){t||this.throwError(r,n,i)}assertArgument(t,r,n,i){t||this.throwArgumentError(r,n,i)}checkNormalize(t){J4e&&this.throwError("platform missing String.prototype.normalize",Ne.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:J4e})}checkSafeUint53(t,r){typeof t=="number"&&(r==null&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,Ne.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,Ne.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,r,n){n?n=": "+n:n="",t<r&&this.throwError("missing argument"+n,Ne.errors.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&this.throwError("too many arguments"+n,Ne.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}checkNew(t,r){(t===Object||t==null)&&this.throwError("missing new",Ne.errors.MISSING_NEW,{name:r.name})}checkAbstract(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Ne.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",Ne.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return _ie||(_ie=new Ne(Q7t)),_ie}static setCensorship(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Ne.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),K4e){if(!t)return;this.globalLogger().throwError("error censorship permanent",Ne.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Z4e=!!t,K4e=!!r}static setLogLevel(t){const r=sF[t.toLowerCase()];if(r==null){Ne.globalLogger().warn("invalid log level - "+t);return}Q4e=r}static from(t){return new Ne(t)}}Ne.errors=Qh;Ne.levels=mhe;const ePt="bytes/5.7.0",Ps=new Ne(ePt);function aXe(e){return!!e.toHexString}function t4(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return t4(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function AM(e){return si(e)&&!(e.length%2)||g_(e)}function txe(e){return typeof e=="number"&&e==e&&e%1===0}function g_(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e=="string"||!txe(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!txe(r)||r<0||r>=256)return!1}return!0}function $t(e,t){if(t||(t={}),typeof e=="number"){Ps.checkSafeUint53(e,"invalid arrayify value");const r=[];for(;e;)r.unshift(e&255),e=parseInt(String(e/256));return r.length===0&&r.push(0),t4(new Uint8Array(r))}if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),aXe(e)&&(e=e.toHexString()),si(e)){let r=e.substring(2);r.length%2&&(t.hexPad==="left"?r="0"+r:t.hexPad==="right"?r+="0":Ps.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let i=0;i<r.length;i+=2)n.push(parseInt(r.substring(i,i+2),16));return t4(new Uint8Array(n))}return g_(e)?t4(new Uint8Array(e)):Ps.throwArgumentError("invalid arrayify value","value",e)}function Co(e){const t=e.map(i=>$t(i)),r=t.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return t.reduce((i,a)=>(n.set(a,i),i+a.length),0),t4(n)}function Y1(e){let t=$t(e);if(t.length===0)return t;let r=0;for(;r<t.length&&t[r]===0;)r++;return r&&(t=t.slice(r)),t}function UL(e,t){e=$t(e),e.length>t&&Ps.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),t4(r)}function si(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}const Sie="0123456789abcdef";function Xt(e,t){if(t||(t={}),typeof e=="number"){Ps.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=Sie[e&15]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof e=="bigint")return e=e.toString(16),e.length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),aXe(e))return e.toHexString();if(si(e))return e.length%2&&(t.hexPad==="left"?e="0x0"+e.substring(2):t.hexPad==="right"?e+="0":Ps.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(g_(e)){let r="0x";for(let n=0;n<e.length;n++){let i=e[n];r+=Sie[(i&240)>>4]+Sie[i&15]}return r}return Ps.throwArgumentError("invalid hexlify value","value",e)}function Eg(e){if(typeof e!="string")e=Xt(e);else if(!si(e)||e.length%2)return null;return(e.length-2)/2}function nl(e,t,r){return typeof e!="string"?e=Xt(e):(!si(e)||e.length%2)&&Ps.throwArgumentError("invalid hexData","value",e),t=2+2*t,r!=null?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function Tf(e){let t="0x";return e.forEach(r=>{t+=Xt(r).substring(2)}),t}function CM(e){const t=oXe(Xt(e,{hexPad:"left"}));return t==="0x"?"0x0":t}function oXe(e){typeof e!="string"&&(e=Xt(e)),si(e)||Ps.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&e[t]==="0";)t++;return"0x"+e.substring(t)}function xo(e,t){for(typeof e!="string"?e=Xt(e):si(e)||Ps.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&Ps.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function hA(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(AM(e)){let r=$t(e);r.length===64?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Xt(r.slice(0,32)),t.s=Xt(r.slice(32,64))):r.length===65?(t.r=Xt(r.slice(0,32)),t.s=Xt(r.slice(32,64)),t.v=r[64]):Ps.throwArgumentError("invalid signature string","signature",e),t.v<27&&(t.v===0||t.v===1?t.v+=27:Ps.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Xt(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,t._vs!=null){const i=UL($t(t._vs),32);t._vs=Xt(i);const a=i[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=a:t.recoveryParam!==a&&Ps.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),i[0]&=127;const o=Xt(i);t.s==null?t.s=o:t.s!==o&&Ps.throwArgumentError("signature v mismatch _vs","signature",e)}if(t.recoveryParam==null)t.v==null?Ps.throwArgumentError("signature missing v and recoveryParam","signature",e):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const i=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==i&&Ps.throwArgumentError("signature recoveryParam mismatch v","signature",e)}t.r==null||!si(t.r)?Ps.throwArgumentError("signature missing or invalid r","signature",e):t.r=xo(t.r,32),t.s==null||!si(t.s)?Ps.throwArgumentError("signature missing or invalid s","signature",e):t.s=xo(t.s,32);const r=$t(t.s);r[0]>=128&&Ps.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=Xt(r);t._vs&&(si(t._vs)||Ps.throwArgumentError("signature invalid _vs","signature",e),t._vs=xo(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&Ps.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function yhe(e){return e=hA(e),Xt(Co([e.r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}const sXe="bignumber/5.7.0";var w7=Z7t.BN;const ey=new Ne(sXe),wie={},rxe=9007199254740991;function tPt(e){return e!=null&&(Bt.isBigNumber(e)||typeof e=="number"&&e%1===0||typeof e=="string"&&!!e.match(/^-?[0-9]+$/)||si(e)||typeof e=="bigint"||g_(e))}let nxe=!1;class Bt{constructor(t,r){t!==wie&&ey.throwError("cannot call constructor directly; use BigNumber.from",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return Qf(ji(this).fromTwos(t))}toTwos(t){return Qf(ji(this).toTwos(t))}abs(){return this._hex[0]==="-"?Bt.from(this._hex.substring(1)):this}add(t){return Qf(ji(this).add(ji(t)))}sub(t){return Qf(ji(this).sub(ji(t)))}div(t){return Bt.from(t).isZero()&&Ih("division-by-zero","div"),Qf(ji(this).div(ji(t)))}mul(t){return Qf(ji(this).mul(ji(t)))}mod(t){const r=ji(t);return r.isNeg()&&Ih("division-by-zero","mod"),Qf(ji(this).umod(r))}pow(t){const r=ji(t);return r.isNeg()&&Ih("negative-power","pow"),Qf(ji(this).pow(r))}and(t){const r=ji(t);return(this.isNegative()||r.isNeg())&&Ih("unbound-bitwise-result","and"),Qf(ji(this).and(r))}or(t){const r=ji(t);return(this.isNegative()||r.isNeg())&&Ih("unbound-bitwise-result","or"),Qf(ji(this).or(r))}xor(t){const r=ji(t);return(this.isNegative()||r.isNeg())&&Ih("unbound-bitwise-result","xor"),Qf(ji(this).xor(r))}mask(t){return(this.isNegative()||t<0)&&Ih("negative-width","mask"),Qf(ji(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&Ih("negative-width","shl"),Qf(ji(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&Ih("negative-width","shr"),Qf(ji(this).shrn(t))}eq(t){return ji(this).eq(ji(t))}lt(t){return ji(this).lt(ji(t))}lte(t){return ji(this).lte(ji(t))}gt(t){return ji(this).gt(ji(t))}gte(t){return ji(this).gte(ji(t))}isNegative(){return this._hex[0]==="-"}isZero(){return ji(this).isZero()}toNumber(){try{return ji(this).toNumber()}catch{Ih("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return ey.throwError("this platform does not support BigInt",Ne.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?nxe||(nxe=!0,ey.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?ey.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ne.errors.UNEXPECTED_ARGUMENT,{}):ey.throwError("BigNumber.toString does not accept parameters",Ne.errors.UNEXPECTED_ARGUMENT,{})),ji(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof Bt)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new Bt(wie,T7(t)):t.match(/^-?[0-9]+$/)?new Bt(wie,T7(new w7(t))):ey.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&Ih("underflow","BigNumber.from",t),(t>=rxe||t<=-rxe)&&Ih("overflow","BigNumber.from",t),Bt.from(String(t));const r=t;if(typeof r=="bigint")return Bt.from(r.toString());if(g_(r))return Bt.from(Xt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return Bt.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(si(n)||n[0]==="-"&&si(n.substring(1))))return Bt.from(n)}return ey.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function T7(e){if(typeof e!="string")return T7(e.toString(16));if(e[0]==="-")return e=e.substring(1),e[0]==="-"&&ey.throwArgumentError("invalid hex","value",e),e=T7(e),e==="0x00"?e:"-"+e;if(e.substring(0,2)!=="0x"&&(e="0x"+e),e==="0x")return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&e.substring(0,4)==="0x00";)e="0x"+e.substring(4);return e}function Qf(e){return Bt.from(T7(e))}function ji(e){const t=Bt.from(e).toHexString();return t[0]==="-"?new w7("-"+t.substring(3),16):new w7(t.substring(2),16)}function Ih(e,t,r){const n={fault:e,operation:t};return r!=null&&(n.value=r),ey.throwError(e,Ne.errors.NUMERIC_FAULT,n)}function rPt(e){return new w7(e,36).toString(16)}function nPt(e){return new w7(e,16).toString(36)}const Af=new Ne(sXe),FL={},lXe=Bt.from(0),uXe=Bt.from(-1);function cXe(e,t,r,n){const i={fault:t,operation:r};return n!==void 0&&(i.value=n),Af.throwError(e,Ne.errors.NUMERIC_FAULT,i)}let HL="0";for(;HL.length<256;)HL+=HL;function r2e(e){if(typeof e!="number")try{e=Bt.from(e).toNumber()}catch{}return typeof e=="number"&&e>=0&&e<=256&&!(e%1)?"1"+HL.substring(0,e):Af.throwArgumentError("invalid decimal size","decimals",e)}function lF(e,t){t==null&&(t=0);const r=r2e(t);e=Bt.from(e);const n=e.lt(lXe);n&&(e=e.mul(uXe));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(r).toString();return r.length===1?e=a:e=a+"."+i,n&&(e="-"+e),e}function a1(e,t){t==null&&(t=0);const r=r2e(t);(typeof e!="string"||!e.match(/^-?[0-9.]+$/))&&Af.throwArgumentError("invalid decimal value","value",e);const n=e.substring(0,1)==="-";n&&(e=e.substring(1)),e==="."&&Af.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Af.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");o[o.length-1]==="0";)o=o.substring(0,o.length-1);for(o.length>r.length-1&&cXe("fractional component exceeds decimals","underflow","parseFixed"),o===""&&(o="0");o.length<r.length-1;)o+="0";const s=Bt.from(a),l=Bt.from(o);let u=s.mul(r).add(l);return n&&(u=u.mul(uXe)),u}class r4{constructor(t,r,n,i){t!==FL&&Af.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=r2e(i),Object.freeze(this)}static from(t){if(t instanceof r4)return t;typeof t=="number"&&(t=`fixed128x${t}`);let r=!0,n=128,i=18;if(typeof t=="string"){if(t!=="fixed")if(t==="ufixed")r=!1;else{const a=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);a||Af.throwArgumentError("invalid fixed format","format",t),r=a[1]!=="u",n=parseInt(a[2]),i=parseInt(a[3])}}else if(t){const a=(o,s,l)=>t[o]==null?l:(typeof t[o]!==s&&Af.throwArgumentError("invalid fixed format ("+o+" not "+s+")","format."+o,t[o]),t[o]);r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&Af.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Af.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new r4(FL,r,n,i)}}class du{constructor(t,r,n,i){t!==FL&&Af.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&Af.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);const r=a1(this._value,this.format.decimals),n=a1(t._value,t.format.decimals);return du.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const r=a1(this._value,this.format.decimals),n=a1(t._value,t.format.decimals);return du.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const r=a1(this._value,this.format.decimals),n=a1(t._value,t.format.decimals);return du.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const r=a1(this._value,this.format.decimals),n=a1(t._value,t.format.decimals);return du.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");t.length===1&&t.push("0");let r=du.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(ixe.toFormat(r.format))),r}ceiling(){const t=this.toString().split(".");t.length===1&&t.push("0");let r=du.from(t[0],this.format);const n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(ixe.toFormat(r.format))),r}round(t){t==null&&(t=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(t<0||t>80||t%1)&&Af.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;const n=du.from("1"+HL.substring(0,t),this.format),i=iPt.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(t){if(t==null)return this._hex;t%8&&Af.throwArgumentError("invalid byte width","width",t);const r=Bt.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString();return xo(r,t/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return du.fromString(this._value,t)}static fromValue(t,r,n){return n==null&&r!=null&&!tPt(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),du.fromString(lF(t,r),r4.from(n))}static fromString(t,r){r==null&&(r="fixed");const n=r4.from(r),i=a1(t,n.decimals);!n.signed&&i.lt(lXe)&&cXe("unsigned value cannot be negative","overflow","value",t);let a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=xo(a,n.width/8));const o=lF(i,n.decimals);return new du(FL,a,o,n)}static fromBytes(t,r){r==null&&(r="fixed");const n=r4.from(r);if($t(t).length>n.width/8)throw new Error("overflow");let i=Bt.from(t);n.signed&&(i=i.fromTwos(n.width));const a=i.toTwos((n.signed?0:1)+n.width).toHexString(),o=lF(i,n.decimals);return new du(FL,a,o,n)}static from(t,r){if(typeof t=="string")return du.fromString(t,r);if(g_(t))return du.fromBytes(t,r);try{return du.fromValue(t,0,r)}catch(n){if(n.code!==Ne.errors.INVALID_ARGUMENT)throw n}return Af.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}const ixe=du.from(1),iPt=du.from("0.5"),aPt="properties/5.7.0";var oPt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const fG=new Ne(aPt);function at(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function Zu(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||typeof e.prototype!="object")break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Ms(e){return oPt(this,void 0,void 0,function*(){const t=Object.keys(e).map(n=>{const i=e[n];return Promise.resolve(i).then(a=>({key:n,value:a}))});return(yield Promise.all(t)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function n2e(e,t){(!e||typeof e!="object")&&fG.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||fG.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}function Do(e){const t={};for(const r in e)t[r]=e[r];return t}const sPt={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function fXe(e){if(e==null||sPt[typeof e])return!0;if(Array.isArray(e)||typeof e=="object"){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch{continue}if(!fXe(n))return!1}return!0}return fG.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}function lPt(e){if(fXe(e))return e;if(Array.isArray(e))return Object.freeze(e.map(t=>Of(t)));if(typeof e=="object"){const t={};for(const r in e){const n=e[r];n!==void 0&&at(t,r,Of(n))}return t}return fG.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}function Of(e){return lPt(e)}class pA{constructor(t){for(const r in t)this[r]=Of(t[r])}}const xM="abi/5.7.0",ta=new Ne(xM),_T={};let axe={calldata:!0,memory:!0,storage:!0},uPt={calldata:!0,memory:!0};function M$(e,t){if(e==="bytes"||e==="string"){if(axe[t])return!0}else if(e==="address"){if(t==="payable")return!0}else if((e.indexOf("[")>=0||e==="tuple")&&uPt[t])return!0;return(axe[t]||t==="payable")&&ta.throwArgumentError("invalid modifier","name",t),!1}function cPt(e,t){let r=e;function n(s){ta.throwArgumentError(`unexpected character at position ${s}`,"param",e)}e=e.replace(/\s/g," ");function i(s){let l={type:"",name:"",parent:s,state:{allowType:!0}};return t&&(l.indexed=!1),l}let a={type:"",name:"",state:{allowType:!0}},o=a;for(let s=0;s<e.length;s++){let l=e[s];switch(l){case"(":o.state.allowType&&o.type===""?o.type="tuple":o.state.allowParams||n(s),o.state.allowType=!1,o.type=cC(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,o.name==="indexed"&&(t||n(s),o.indexed=!0,o.name=""),M$(o.type,o.name)&&(o.name=""),o.type=cC(o.type);let u=o;o=o.parent,o||n(s),delete u.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,o.name==="indexed"&&(t||n(s),o.indexed=!0,o.name=""),M$(o.type,o.name)&&(o.name=""),o.type=cC(o.type);let c=i(o.parent);o.parent.components.push(c),delete o.parent,o=c;break;case" ":o.state.allowType&&o.type!==""&&(o.type=cC(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&o.name!==""&&(o.name==="indexed"?(t||n(s),o.indexed&&n(s),o.indexed=!0,o.name=""):M$(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(s),o.type+=l,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(s),o.type+=l,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=l,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=l,delete o.state.allowArray):o.state.readArray?o.type+=l:n(s)}}return o.parent&&ta.throwArgumentError("unexpected eof","param",e),delete a.state,o.name==="indexed"?(t||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):M$(o.type,o.name)&&(o.name=""),a.type=cC(a.type),a}function uF(e,t){for(let r in t)at(e,r,t[r])}const ha=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),fPt=new RegExp(/^(.*)\[([0-9]*)\]$/);class Yl{constructor(t,r){t!==_T&&ta.throwError("use fromString",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),uF(this,r);let n=this.type.match(fPt);n?uF(this,{arrayLength:parseInt(n[2]||"-1"),arrayChildren:Yl.fromObject({type:n[1],components:this.components}),baseType:"array"}):uF(this,{arrayLength:null,arrayChildren:null,baseType:this.components!=null?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json){let n={type:this.baseType==="tuple"?"tuple":this.type,name:this.name||void 0};return typeof this.indexed=="boolean"&&(n.indexed=this.indexed),this.components&&(n.components=this.components.map(i=>JSON.parse(i.format(t)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(t),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(t!==ha.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(t)).join(t===ha.full?", ":",")+")"):r+=this.type,t!==ha.sighash&&(this.indexed===!0&&(r+=" indexed"),t===ha.full&&this.name&&(r+=" "+this.name)),r}static from(t,r){return typeof t=="string"?Yl.fromString(t,r):Yl.fromObject(t)}static fromObject(t){return Yl.isParamType(t)?t:new Yl(_T,{name:t.name||null,type:cC(t.type),indexed:t.indexed==null?null:!!t.indexed,components:t.components?t.components.map(Yl.fromObject):null})}static fromString(t,r){function n(i){return Yl.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(cPt(t,!!r))}static isParamType(t){return!!(t!=null&&t._isParamType)}}function A7(e,t){return hPt(e).map(r=>Yl.fromString(r,t))}class O1{constructor(t,r){t!==_T&&ta.throwError("use a static from method",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),uF(this,r),this._isFragment=!0,Object.freeze(this)}static from(t){return O1.isFragment(t)?t:typeof t=="string"?O1.fromString(t):O1.fromObject(t)}static fromObject(t){if(O1.isFragment(t))return t;switch(t.type){case"function":return Gp.fromObject(t);case"event":return E1.fromObject(t);case"constructor":return Hp.fromObject(t);case"error":return dy.fromObject(t);case"fallback":case"receive":return null}return ta.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return t=t.replace(/\s/g," "),t=t.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),t=t.trim(),t.split(" ")[0]==="event"?E1.fromString(t.substring(5).trim()):t.split(" ")[0]==="function"?Gp.fromString(t.substring(8).trim()):t.split("(")[0].trim()==="constructor"?Hp.fromString(t.trim()):t.split(" ")[0]==="error"?dy.fromString(t.substring(5).trim()):ta.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!!(t&&t._isFragment)}}class E1 extends O1{format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});let r="";return t!==ha.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===ha.full?", ":",")+") ",t!==ha.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(t){return typeof t=="string"?E1.fromString(t):E1.fromObject(t)}static fromObject(t){if(E1.isEventFragment(t))return t;t.type!=="event"&&ta.throwArgumentError("invalid event object","value",t);const r={name:C7(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Yl.fromObject):[],type:"event"};return new E1(_T,r)}static fromString(t){let r=t.match(x7);r||ta.throwArgumentError("invalid event string","value",t);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:ta.warn("unknown modifier: "+i)}}),E1.fromObject({name:r[1].trim(),anonymous:n,inputs:A7(r[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&t.type==="event"}}function dXe(e,t){t.gas=null;let r=e.split("@");return r.length!==1?(r.length>2&&ta.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||ta.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Bt.from(r[1]),r[0]):e}function hXe(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(r=>{switch(r.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function pXe(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return e.stateMutability!=null?(t.stateMutability=e.stateMutability,t.constant=t.stateMutability==="view"||t.stateMutability==="pure",e.constant!=null&&!!e.constant!==t.constant&&ta.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable=t.stateMutability==="payable",e.payable!=null&&!!e.payable!==t.payable&&ta.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):e.payable!=null?(t.payable=!!e.payable,e.constant==null&&!t.payable&&e.type!=="constructor"&&ta.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ta.throwArgumentError("cannot have constant payable function","value",e)):e.constant!=null?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):e.type!=="constructor"&&ta.throwArgumentError("unable to determine stateMutability","value",e),t}class Hp extends O1{format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});t===ha.sighash&&ta.throwError("cannot format a constructor for sighash",Ne.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(t)).join(t===ha.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(t){return typeof t=="string"?Hp.fromString(t):Hp.fromObject(t)}static fromObject(t){if(Hp.isConstructorFragment(t))return t;t.type!=="constructor"&&ta.throwArgumentError("invalid constructor object","value",t);let r=pXe(t);r.constant&&ta.throwArgumentError("constructor cannot be constant","value",t);const n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Yl.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?Bt.from(t.gas):null};return new Hp(_T,n)}static fromString(t){let r={type:"constructor"};t=dXe(t,r);let n=t.match(x7);return(!n||n[1].trim()!=="constructor")&&ta.throwArgumentError("invalid constructor string","value",t),r.inputs=A7(n[2].trim(),!1),hXe(n[3].trim(),r),Hp.fromObject(r)}static isConstructorFragment(t){return t&&t._isFragment&&t.type==="constructor"}}class Gp extends Hp{format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(t))),outputs:this.outputs.map(n=>JSON.parse(n.format(t)))});let r="";return t!==ha.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===ha.full?", ":",")+") ",t!==ha.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(t)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(t){return typeof t=="string"?Gp.fromString(t):Gp.fromObject(t)}static fromObject(t){if(Gp.isFunctionFragment(t))return t;t.type!=="function"&&ta.throwArgumentError("invalid function object","value",t);let r=pXe(t);const n={type:t.type,name:C7(t.name),constant:r.constant,inputs:t.inputs?t.inputs.map(Yl.fromObject):[],outputs:t.outputs?t.outputs.map(Yl.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?Bt.from(t.gas):null};return new Gp(_T,n)}static fromString(t){let r={type:"function"};t=dXe(t,r);let n=t.split(" returns ");n.length>2&&ta.throwArgumentError("invalid function string","value",t);let i=n[0].match(x7);if(i||ta.throwArgumentError("invalid function signature","value",t),r.name=i[1].trim(),r.name&&C7(r.name),r.inputs=A7(i[2],!1),hXe(i[3].trim(),r),n.length>1){let a=n[1].match(x7);(a[1].trim()!=""||a[3].trim()!="")&&ta.throwArgumentError("unexpected tokens","value",t),r.outputs=A7(a[2],!1)}else r.outputs=[];return Gp.fromObject(r)}static isFunctionFragment(t){return t&&t._isFragment&&t.type==="function"}}function oxe(e){const t=e.format();return(t==="Error(string)"||t==="Panic(uint256)")&&ta.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class dy extends O1{format(t){if(t||(t=ha.sighash),ha[t]||ta.throwArgumentError("invalid format type","format",t),t===ha.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(t)))});let r="";return t!==ha.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(t)).join(t===ha.full?", ":",")+") ",r.trim()}static from(t){return typeof t=="string"?dy.fromString(t):dy.fromObject(t)}static fromObject(t){if(dy.isErrorFragment(t))return t;t.type!=="error"&&ta.throwArgumentError("invalid error object","value",t);const r={type:t.type,name:C7(t.name),inputs:t.inputs?t.inputs.map(Yl.fromObject):[]};return oxe(new dy(_T,r))}static fromString(t){let r={type:"error"},n=t.match(x7);return n||ta.throwArgumentError("invalid error signature","value",t),r.name=n[1].trim(),r.name&&C7(r.name),r.inputs=A7(n[2],!1),oxe(dy.fromObject(r))}static isErrorFragment(t){return t&&t._isFragment&&t.type==="error"}}function cC(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const dPt=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function C7(e){return(!e||!e.match(dPt))&&ta.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const x7=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function hPt(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];a===","&&n===0?(t.push(r),r=""):(r+=a,a==="("?n++:a===")"&&(n--,n===-1&&ta.throwArgumentError("unbalanced parenthesis","value",e)))}return r&&t.push(r),t}const i2e=new Ne(xM);function vXe(e){const t=[],r=function(n,i){if(Array.isArray(i))for(let a in i){const o=n.slice();o.push(a);try{r(o,i[a])}catch(s){t.push({path:o,error:s})}}};return r([],e),t}class l2{constructor(t,r,n,i){this.name=t,this.type=r,this.localName=n,this.dynamic=i}_throwError(t,r){i2e.throwArgumentError(t,this.localName,r)}}class Ehe{constructor(t){at(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){return Tf(this._data)}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData(Co(t._data))}writeBytes(t){let r=$t(t);const n=r.length%this.wordSize;return n&&(r=Co([r,this._padding.slice(n)])),this._writeData(r)}_getValue(t){let r=$t(Bt.from(t));return r.length>this.wordSize&&i2e.throwError("value out-of-bounds",Ne.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Co([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){const t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[t]=this._getValue(r)}}}class dG{constructor(t,r,n,i){at(this,"_data",$t(t)),at(this,"wordSize",r||32),at(this,"_coerceFunc",n),at(this,"allowLoose",i),this._offset=0}get data(){return Xt(this._data)}get consumed(){return this._offset}static coerce(t,r){let n=t.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(t,r){return this._coerceFunc?this._coerceFunc(t,r):dG.coerce(t,r)}_peekBytes(t,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:i2e.throwError("data out-of-bounds",Ne.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(t){return new dG(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,r){let n=this._peekBytes(0,t,!!r);return this._offset+=n.length,n.slice(0,t)}readValue(){return Bt.from(this.readBytes(this.wordSize))}}var gXe={exports:{}};(function(e){(function(){var t="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var a=!n&&typeof self=="object",o=!i.JS_SHA3_NO_NODE_JS&&typeof Ln=="object"&&Ln.versions&&Ln.versions.node;o?i=gt:a&&(i=self);var s=!i.JS_SHA3_NO_COMMON_JS&&!0&&e.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",u="0123456789abcdef".split(""),c=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],d=[1,256,65536,16777216],h=[6,1536,393216,100663296],p=[0,8,16,24],g=[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],m=[224,256,384,512],E=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(W){return Object.prototype.toString.call(W)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(W){return typeof W=="object"&&W.buffer&&W.buffer.constructor===ArrayBuffer});for(var T=function(W,Y,re){return function(Q){return new R(W,Y,W).update(Q)[re]()}},x=function(W,Y,re){return function(Q,ie){return new R(W,Y,ie).update(Q)[re]()}},N=function(W,Y,re){return function(Q,ie,ce,te){return y["cshake"+W].update(Q,ie,ce,te)[re]()}},A=function(W,Y,re){return function(Q,ie,ce,te){return y["kmac"+W].update(Q,ie,ce,te)[re]()}},L=function(W,Y,re,Q){for(var ie=0;ie<b.length;++ie){var ce=b[ie];W[ce]=Y(re,Q,ce)}return W},O=function(W,Y){var re=T(W,Y,"hex");return re.create=function(){return new R(W,Y,W)},re.update=function(Q){return re.create().update(Q)},L(re,T,W,Y)},I=function(W,Y){var re=x(W,Y,"hex");return re.create=function(Q){return new R(W,Y,Q)},re.update=function(Q,ie){return re.create(ie).update(Q)},L(re,x,W,Y)},$=function(W,Y){var re=w[W],Q=N(W,Y,"hex");return Q.create=function(ie,ce,te){return!ce&&!te?y["shake"+W].create(ie):new R(W,Y,ie).bytepad([ce,te],re)},Q.update=function(ie,ce,te,J){return Q.create(ce,te,J).update(ie)},L(Q,N,W,Y)},F=function(W,Y){var re=w[W],Q=A(W,Y,"hex");return Q.create=function(ie,ce,te){return new H(W,Y,ce).bytepad(["KMAC",te],re).bytepad([ie],re)},Q.update=function(ie,ce,te,J){return Q.create(ie,te,J).update(ce)},L(Q,A,W,Y)},D=[{name:"keccak",padding:d,bits:m,createMethod:O},{name:"sha3",padding:h,bits:m,createMethod:O},{name:"shake",padding:c,bits:E,createMethod:I},{name:"cshake",padding:f,bits:E,createMethod:$},{name:"kmac",padding:f,bits:E,createMethod:F}],y={},S=[],C=0;C<D.length;++C)for(var M=D[C],k=M.bits,U=0;U<k.length;++U){var G=M.name+"_"+k[U];if(S.push(G),y[G]=M.createMethod(k[U],M.padding),M.name!=="sha3"){var B=M.name+k[U];S.push(B),y[B]=y[G]}}function R(W,Y,re){this.blocks=[],this.s=[],this.padding=Y,this.outputBits=re,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(W<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=re>>5,this.extraBytes=(re&31)>>3;for(var Q=0;Q<50;++Q)this.s[Q]=0}R.prototype.update=function(W){if(this.finalized)throw new Error(r);var Y,re=typeof W;if(re!=="string"){if(re==="object"){if(W===null)throw new Error(t);if(l&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!l||!ArrayBuffer.isView(W)))throw new Error(t)}else throw new Error(t);Y=!0}for(var Q=this.blocks,ie=this.byteCount,ce=W.length,te=this.blockCount,J=0,ge=this.s,fe,ye;J<ce;){if(this.reset)for(this.reset=!1,Q[0]=this.block,fe=1;fe<te+1;++fe)Q[fe]=0;if(Y)for(fe=this.start;J<ce&&fe<ie;++J)Q[fe>>2]|=W[J]<<p[fe++&3];else for(fe=this.start;J<ce&&fe<ie;++J)ye=W.charCodeAt(J),ye<128?Q[fe>>2]|=ye<<p[fe++&3]:ye<2048?(Q[fe>>2]|=(192|ye>>6)<<p[fe++&3],Q[fe>>2]|=(128|ye&63)<<p[fe++&3]):ye<55296||ye>=57344?(Q[fe>>2]|=(224|ye>>12)<<p[fe++&3],Q[fe>>2]|=(128|ye>>6&63)<<p[fe++&3],Q[fe>>2]|=(128|ye&63)<<p[fe++&3]):(ye=65536+((ye&1023)<<10|W.charCodeAt(++J)&1023),Q[fe>>2]|=(240|ye>>18)<<p[fe++&3],Q[fe>>2]|=(128|ye>>12&63)<<p[fe++&3],Q[fe>>2]|=(128|ye>>6&63)<<p[fe++&3],Q[fe>>2]|=(128|ye&63)<<p[fe++&3]);if(this.lastByteIndex=fe,fe>=ie){for(this.start=fe-ie,this.block=Q[te],fe=0;fe<te;++fe)ge[fe]^=Q[fe];q(ge),this.reset=!0}else this.start=fe}return this},R.prototype.encode=function(W,Y){var re=W&255,Q=1,ie=[re];for(W=W>>8,re=W&255;re>0;)ie.unshift(re),W=W>>8,re=W&255,++Q;return Y?ie.push(Q):ie.unshift(Q),this.update(ie),ie.length},R.prototype.encodeString=function(W){var Y,re=typeof W;if(re!=="string"){if(re==="object"){if(W===null)throw new Error(t);if(l&&W.constructor===ArrayBuffer)W=new Uint8Array(W);else if(!Array.isArray(W)&&(!l||!ArrayBuffer.isView(W)))throw new Error(t)}else throw new Error(t);Y=!0}var Q=0,ie=W.length;if(Y)Q=ie;else for(var ce=0;ce<W.length;++ce){var te=W.charCodeAt(ce);te<128?Q+=1:te<2048?Q+=2:te<55296||te>=57344?Q+=3:(te=65536+((te&1023)<<10|W.charCodeAt(++ce)&1023),Q+=4)}return Q+=this.encode(Q*8),this.update(W),Q},R.prototype.bytepad=function(W,Y){for(var re=this.encode(Y),Q=0;Q<W.length;++Q)re+=this.encodeString(W[Q]);var ie=Y-re%Y,ce=[];return ce.length=ie,this.update(ce),this},R.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var W=this.blocks,Y=this.lastByteIndex,re=this.blockCount,Q=this.s;if(W[Y>>2]|=this.padding[Y&3],this.lastByteIndex===this.byteCount)for(W[0]=W[re],Y=1;Y<re+1;++Y)W[Y]=0;for(W[re-1]|=2147483648,Y=0;Y<re;++Y)Q[Y]^=W[Y];q(Q)}},R.prototype.toString=R.prototype.hex=function(){this.finalize();for(var W=this.blockCount,Y=this.s,re=this.outputBlocks,Q=this.extraBytes,ie=0,ce=0,te="",J;ce<re;){for(ie=0;ie<W&&ce<re;++ie,++ce)J=Y[ie],te+=u[J>>4&15]+u[J&15]+u[J>>12&15]+u[J>>8&15]+u[J>>20&15]+u[J>>16&15]+u[J>>28&15]+u[J>>24&15];ce%W===0&&(q(Y),ie=0)}return Q&&(J=Y[ie],te+=u[J>>4&15]+u[J&15],Q>1&&(te+=u[J>>12&15]+u[J>>8&15]),Q>2&&(te+=u[J>>20&15]+u[J>>16&15])),te},R.prototype.arrayBuffer=function(){this.finalize();var W=this.blockCount,Y=this.s,re=this.outputBlocks,Q=this.extraBytes,ie=0,ce=0,te=this.outputBits>>3,J;Q?J=new ArrayBuffer(re+1<<2):J=new ArrayBuffer(te);for(var ge=new Uint32Array(J);ce<re;){for(ie=0;ie<W&&ce<re;++ie,++ce)ge[ce]=Y[ie];ce%W===0&&q(Y)}return Q&&(ge[ie]=Y[ie],J=J.slice(0,te)),J},R.prototype.buffer=R.prototype.arrayBuffer,R.prototype.digest=R.prototype.array=function(){this.finalize();for(var W=this.blockCount,Y=this.s,re=this.outputBlocks,Q=this.extraBytes,ie=0,ce=0,te=[],J,ge;ce<re;){for(ie=0;ie<W&&ce<re;++ie,++ce)J=ce<<2,ge=Y[ie],te[J]=ge&255,te[J+1]=ge>>8&255,te[J+2]=ge>>16&255,te[J+3]=ge>>24&255;ce%W===0&&q(Y)}return Q&&(J=ce<<2,ge=Y[ie],te[J]=ge&255,Q>1&&(te[J+1]=ge>>8&255),Q>2&&(te[J+2]=ge>>16&255)),te};function H(W,Y,re){R.call(this,W,Y,re)}H.prototype=new R,H.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var q=function(W){var Y,re,Q,ie,ce,te,J,ge,fe,ye,Ue,me,Be,et,Ge,Ae,We,Le,Ie,tt,Ve,ne,X,K,le,ve,Ee,we,ft,Fe,Xe,Qt,it,Tt,Hr,xt,Mt,kn,Ot,qt,Vi,ct,_t,Ki,Jt,zt,aa,Vt,Ft,Wi,vt,Nt,qr,yt,Lt,oa,Pe,De,Pt,Sr,Mr,un,fn;for(Q=0;Q<48;Q+=2)ie=W[0]^W[10]^W[20]^W[30]^W[40],ce=W[1]^W[11]^W[21]^W[31]^W[41],te=W[2]^W[12]^W[22]^W[32]^W[42],J=W[3]^W[13]^W[23]^W[33]^W[43],ge=W[4]^W[14]^W[24]^W[34]^W[44],fe=W[5]^W[15]^W[25]^W[35]^W[45],ye=W[6]^W[16]^W[26]^W[36]^W[46],Ue=W[7]^W[17]^W[27]^W[37]^W[47],me=W[8]^W[18]^W[28]^W[38]^W[48],Be=W[9]^W[19]^W[29]^W[39]^W[49],Y=me^(te<<1|J>>>31),re=Be^(J<<1|te>>>31),W[0]^=Y,W[1]^=re,W[10]^=Y,W[11]^=re,W[20]^=Y,W[21]^=re,W[30]^=Y,W[31]^=re,W[40]^=Y,W[41]^=re,Y=ie^(ge<<1|fe>>>31),re=ce^(fe<<1|ge>>>31),W[2]^=Y,W[3]^=re,W[12]^=Y,W[13]^=re,W[22]^=Y,W[23]^=re,W[32]^=Y,W[33]^=re,W[42]^=Y,W[43]^=re,Y=te^(ye<<1|Ue>>>31),re=J^(Ue<<1|ye>>>31),W[4]^=Y,W[5]^=re,W[14]^=Y,W[15]^=re,W[24]^=Y,W[25]^=re,W[34]^=Y,W[35]^=re,W[44]^=Y,W[45]^=re,Y=ge^(me<<1|Be>>>31),re=fe^(Be<<1|me>>>31),W[6]^=Y,W[7]^=re,W[16]^=Y,W[17]^=re,W[26]^=Y,W[27]^=re,W[36]^=Y,W[37]^=re,W[46]^=Y,W[47]^=re,Y=ye^(ie<<1|ce>>>31),re=Ue^(ce<<1|ie>>>31),W[8]^=Y,W[9]^=re,W[18]^=Y,W[19]^=re,W[28]^=Y,W[29]^=re,W[38]^=Y,W[39]^=re,W[48]^=Y,W[49]^=re,et=W[0],Ge=W[1],zt=W[11]<<4|W[10]>>>28,aa=W[10]<<4|W[11]>>>28,we=W[20]<<3|W[21]>>>29,ft=W[21]<<3|W[20]>>>29,Sr=W[31]<<9|W[30]>>>23,Mr=W[30]<<9|W[31]>>>23,ct=W[40]<<18|W[41]>>>14,_t=W[41]<<18|W[40]>>>14,Tt=W[2]<<1|W[3]>>>31,Hr=W[3]<<1|W[2]>>>31,Ae=W[13]<<12|W[12]>>>20,We=W[12]<<12|W[13]>>>20,Vt=W[22]<<10|W[23]>>>22,Ft=W[23]<<10|W[22]>>>22,Fe=W[33]<<13|W[32]>>>19,Xe=W[32]<<13|W[33]>>>19,un=W[42]<<2|W[43]>>>30,fn=W[43]<<2|W[42]>>>30,yt=W[5]<<30|W[4]>>>2,Lt=W[4]<<30|W[5]>>>2,xt=W[14]<<6|W[15]>>>26,Mt=W[15]<<6|W[14]>>>26,Le=W[25]<<11|W[24]>>>21,Ie=W[24]<<11|W[25]>>>21,Wi=W[34]<<15|W[35]>>>17,vt=W[35]<<15|W[34]>>>17,Qt=W[45]<<29|W[44]>>>3,it=W[44]<<29|W[45]>>>3,K=W[6]<<28|W[7]>>>4,le=W[7]<<28|W[6]>>>4,oa=W[17]<<23|W[16]>>>9,Pe=W[16]<<23|W[17]>>>9,kn=W[26]<<25|W[27]>>>7,Ot=W[27]<<25|W[26]>>>7,tt=W[36]<<21|W[37]>>>11,Ve=W[37]<<21|W[36]>>>11,Nt=W[47]<<24|W[46]>>>8,qr=W[46]<<24|W[47]>>>8,Ki=W[8]<<27|W[9]>>>5,Jt=W[9]<<27|W[8]>>>5,ve=W[18]<<20|W[19]>>>12,Ee=W[19]<<20|W[18]>>>12,De=W[29]<<7|W[28]>>>25,Pt=W[28]<<7|W[29]>>>25,qt=W[38]<<8|W[39]>>>24,Vi=W[39]<<8|W[38]>>>24,ne=W[48]<<14|W[49]>>>18,X=W[49]<<14|W[48]>>>18,W[0]=et^~Ae&Le,W[1]=Ge^~We&Ie,W[10]=K^~ve&we,W[11]=le^~Ee&ft,W[20]=Tt^~xt&kn,W[21]=Hr^~Mt&Ot,W[30]=Ki^~zt&Vt,W[31]=Jt^~aa&Ft,W[40]=yt^~oa&De,W[41]=Lt^~Pe&Pt,W[2]=Ae^~Le&tt,W[3]=We^~Ie&Ve,W[12]=ve^~we&Fe,W[13]=Ee^~ft&Xe,W[22]=xt^~kn&qt,W[23]=Mt^~Ot&Vi,W[32]=zt^~Vt&Wi,W[33]=aa^~Ft&vt,W[42]=oa^~De&Sr,W[43]=Pe^~Pt&Mr,W[4]=Le^~tt&ne,W[5]=Ie^~Ve&X,W[14]=we^~Fe&Qt,W[15]=ft^~Xe&it,W[24]=kn^~qt&ct,W[25]=Ot^~Vi&_t,W[34]=Vt^~Wi&Nt,W[35]=Ft^~vt&qr,W[44]=De^~Sr&un,W[45]=Pt^~Mr&fn,W[6]=tt^~ne&et,W[7]=Ve^~X&Ge,W[16]=Fe^~Qt&K,W[17]=Xe^~it&le,W[26]=qt^~ct&Tt,W[27]=Vi^~_t&Hr,W[36]=Wi^~Nt&Ki,W[37]=vt^~qr&Jt,W[46]=Sr^~un&yt,W[47]=Mr^~fn&Lt,W[8]=ne^~et&Ae,W[9]=X^~Ge&We,W[18]=Qt^~K&ve,W[19]=it^~le&Ee,W[28]=ct^~Tt&xt,W[29]=_t^~Hr&Mt,W[38]=Nt^~Ki&zt,W[39]=qr^~Jt&aa,W[48]=un^~yt&oa,W[49]=fn^~Lt&Pe,W[0]^=g[Q],W[1]^=g[Q+1]};if(s)e.exports=y;else for(C=0;C<S.length;++C)i[S[C]]=y[S[C]]})()})(gXe);var pPt=gXe.exports;const vPt=Nn(pPt);function lo(e){return"0x"+vPt.keccak_256($t(e))}const gPt="rlp/5.7.0",d1=new Ne(gPt);function sxe(e){const t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function lxe(e,t,r){let n=0;for(let i=0;i<r;i++)n=n*256+e[t+i];return n}function mXe(e){if(Array.isArray(e)){let n=[];if(e.forEach(function(a){n=n.concat(mXe(a))}),n.length<=55)return n.unshift(192+n.length),n;const i=sxe(n.length);return i.unshift(247+i.length),i.concat(n)}AM(e)||d1.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call($t(e));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=sxe(t.length);return r.unshift(183+r.length),r.concat(t)}function ST(e){return Xt(mXe(e))}function uxe(e,t,r,n){const i=[];for(;r<t+1+n;){const a=yXe(e,r);i.push(a.result),r+=a.consumed,r>t+1+n&&d1.throwError("child data too short",Ne.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function yXe(e,t){if(e.length===0&&d1.throwError("data too short",Ne.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&d1.throwError("data short segment too short",Ne.errors.BUFFER_OVERRUN,{});const n=lxe(e,t+1,r);return t+1+r+n>e.length&&d1.throwError("data long segment too short",Ne.errors.BUFFER_OVERRUN,{}),uxe(e,t,t+1+r,r+n)}else if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&d1.throwError("data array too short",Ne.errors.BUFFER_OVERRUN,{}),uxe(e,t,t+1,r)}else if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&d1.throwError("data array too short",Ne.errors.BUFFER_OVERRUN,{});const n=lxe(e,t+1,r);t+1+r+n>e.length&&d1.throwError("data array too short",Ne.errors.BUFFER_OVERRUN,{});const i=Xt(e.slice(t+1+r,t+1+r+n));return{consumed:1+r+n,result:i}}else if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&d1.throwError("data too short",Ne.errors.BUFFER_OVERRUN,{});const n=Xt(e.slice(t+1,t+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:Xt(e[t])}}function Wj(e){const t=$t(e),r=yXe(t,0);return r.consumed!==t.length&&d1.throwArgumentError("invalid rlp data","data",e),r.result}const mPt=Object.freeze(Object.defineProperty({__proto__:null,decode:Wj,encode:ST},Symbol.toStringTag,{value:"Module"})),yPt="address/5.7.0",LE=new Ne(yPt);function cxe(e){si(e,20)||LE.throwArgumentError("invalid address","address",e),e=e.toLowerCase();const t=e.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=t[i].charCodeAt(0);const n=$t(lo(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(n[i>>1]&15)>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const EPt=9007199254740991;function bPt(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}const a2e={};for(let e=0;e<10;e++)a2e[String(e)]=String(e);for(let e=0;e<26;e++)a2e[String.fromCharCode(65+e)]=String(10+e);const fxe=Math.floor(bPt(EPt));function EXe(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(n=>a2e[n]).join("");for(;t.length>=fxe;){let n=t.substring(0,fxe);t=parseInt(n,10)%97+t.substring(n.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function va(e){let t=null;if(typeof e!="string"&&LE.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!=="0x"&&(e="0x"+e),t=cxe(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&LE.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==EXe(e)&&LE.throwArgumentError("bad icap checksum","address",e),t=rPt(e.substring(4));t.length<40;)t="0"+t;t=cxe("0x"+t)}else LE.throwArgumentError("invalid address","address",e);return t}function _Pt(e){try{return va(e),!0}catch{}return!1}function SPt(e){let t=nPt(va(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+EXe("XE00"+t)+t}function jj(e){let t=null;try{t=va(e.from)}catch{LE.throwArgumentError("missing from address","transaction",e)}const r=Y1($t(Bt.from(e.nonce).toHexString()));return va(nl(lo(ST([t,r])),12))}function wPt(e,t,r){return Eg(t)!==32&&LE.throwArgumentError("salt must be 32 bytes","salt",t),Eg(r)!==32&&LE.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),va(nl(lo(Co(["0xff",va(e),t,r])),12))}class TPt extends l2{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,r){try{r=va(r)}catch(n){this._throwError(n.message,r)}return t.writeValue(r)}decode(t){return va(xo(t.readValue().toHexString(),20))}}class APt extends l2{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,r){return this.coder.encode(t,r)}decode(t){return this.coder.decode(t)}}const CC=new Ne(xM);function bXe(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=t.map(u=>{const c=u.localName;return c||CC.throwError("cannot encode object for signature with missing names",Ne.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]&&CC.throwError("cannot encode object for signature with duplicate names",Ne.errors.INVALID_ARGUMENT,{argument:"values",coder:u,value:r}),l[c]=!0,r[c]})}else CC.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&CC.throwArgumentError("types/value length mismatch","tuple",r);let i=new Ehe(e.wordSize),a=new Ehe(e.wordSize),o=[];t.forEach((l,u)=>{let c=n[u];if(l.dynamic){let f=a.length;l.encode(a,c);let d=i.writeUpdatableValue();o.push(h=>{d(h+f)})}else l.encode(i,c)}),o.forEach(l=>{l(i.length)});let s=e.appendWriter(i);return s+=e.appendWriter(a),s}function _Xe(e,t){let r=[],n=e.subReader(0);t.forEach(a=>{let o=null;if(a.dynamic){let s=e.readValue(),l=n.subReader(s.toNumber());try{o=a.decode(l)}catch(u){if(u.code===Ne.errors.BUFFER_OVERRUN)throw u;o=u,o.baseType=a.name,o.name=a.localName,o.type=a.type}}else try{o=a.decode(e)}catch(s){if(s.code===Ne.errors.BUFFER_OVERRUN)throw s;o=s,o.baseType=a.name,o.name=a.localName,o.type=a.type}o!=null&&r.push(o)});const i=t.reduce((a,o)=>{const s=o.localName;return s&&(a[s]||(a[s]=0),a[s]++),a},{});t.forEach((a,o)=>{let s=a.localName;if(!s||i[s]!==1||(s==="length"&&(s="_length"),r[s]!=null))return;const l=r[o];l instanceof Error?Object.defineProperty(r,s,{enumerable:!0,get:()=>{throw l}}):r[s]=l});for(let a=0;a<r.length;a++){const o=r[a];o instanceof Error&&Object.defineProperty(r,a,{enumerable:!0,get:()=>{throw o}})}return Object.freeze(r)}class CPt extends l2{constructor(t,r,n){const i=t.type+"["+(r>=0?r:"")+"]",a=r===-1||t.dynamic;super("array",i,n,a),this.coder=t,this.length=r}defaultValue(){const t=this.coder.defaultValue(),r=[];for(let n=0;n<this.length;n++)r.push(t);return r}encode(t,r){Array.isArray(r)||this._throwError("expected array value",r);let n=this.length;n===-1&&(n=r.length,t.writeValue(r.length)),CC.checkArgumentCount(r.length,n,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let a=0;a<r.length;a++)i.push(this.coder);return bXe(t,i,r)}decode(t){let r=this.length;r===-1&&(r=t.readValue().toNumber(),r*32>t._data.length&&CC.throwError("insufficient data length",Ne.errors.BUFFER_OVERRUN,{length:t._data.length,count:r}));let n=[];for(let i=0;i<r;i++)n.push(new APt(this.coder));return t.coerce(this.name,_Xe(t,n))}}class xPt extends l2{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,r){return t.writeValue(r?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class SXe extends l2{constructor(t,r){super(t,t,r,!0)}defaultValue(){return"0x"}encode(t,r){r=$t(r);let n=t.writeValue(r.length);return n+=t.writeBytes(r),n}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class RPt extends SXe{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,Xt(super.decode(t)))}}class IPt extends l2{constructor(t,r){let n="bytes"+String(t);super(n,n,r,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(t,r){let n=$t(r);return n.length!==this.size&&this._throwError("incorrect data length",r),t.writeBytes(n)}decode(t){return t.coerce(this.name,Xt(t.readBytes(this.size)))}}class OPt extends l2{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,r){return r!=null&&this._throwError("not null",r),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}const wXe="0x0000000000000000000000000000000000000000",TXe=Bt.from(-1),o2e=Bt.from(0),AXe=Bt.from(1),NPt=Bt.from(2),LPt=Bt.from("1000000000000000000"),CXe=Bt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),PPt=Bt.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),MPt=Bt.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),s2e="0x0000000000000000000000000000000000000000000000000000000000000000",DPt="Ξ",$Pt=Object.freeze(Object.defineProperty({__proto__:null,AddressZero:wXe,EtherSymbol:DPt,HashZero:s2e,MaxInt256:MPt,MaxUint256:CXe,MinInt256:PPt,NegativeOne:TXe,One:AXe,Two:NPt,WeiPerEther:LPt,Zero:o2e},Symbol.toStringTag,{value:"Module"}));class kPt extends l2{constructor(t,r,n){const i=(r?"int":"uint")+t*8;super(i,i,n,!1),this.size=t,this.signed=r}defaultValue(){return 0}encode(t,r){let n=Bt.from(r),i=CXe.mask(t.wordSize*8);if(this.signed){let a=i.mask(this.size*8-1);(n.gt(a)||n.lt(a.add(AXe).mul(TXe)))&&this._throwError("value out-of-bounds",r)}else(n.lt(o2e)||n.gt(i.mask(this.size*8)))&&this._throwError("value out-of-bounds",r);return n=n.toTwos(this.size*8).mask(this.size*8),this.signed&&(n=n.fromTwos(this.size*8).toTwos(8*t.wordSize)),t.writeValue(n)}decode(t){let r=t.readValue().mask(this.size*8);return this.signed&&(r=r.fromTwos(this.size*8)),t.coerce(this.name,r)}}const BPt="strings/5.7.0",xXe=new Ne(BPt);var bg;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(bg||(bg={}));var dd;(function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"})(dd||(dd={}));function UPt(e,t,r,n,i){return xXe.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)}function RXe(e,t,r,n,i){if(e===dd.BAD_PREFIX||e===dd.UNEXPECTED_CONTINUE){let a=0;for(let o=t+1;o<r.length&&r[o]>>6===2;o++)a++;return a}return e===dd.OVERRUN?r.length-t-1:0}function FPt(e,t,r,n,i){return e===dd.OVERLONG?(n.push(i),0):(n.push(65533),RXe(e,t,r))}const IXe=Object.freeze({error:UPt,ignore:RXe,replace:FPt});function l2e(e,t){t==null&&(t=IXe.error),e=$t(e);const r=[];let n=0;for(;n<e.length;){const i=e[n++];if(!(i>>7)){r.push(i);continue}let a=null,o=null;if((i&224)===192)a=1,o=127;else if((i&240)===224)a=2,o=2047;else if((i&248)===240)a=3,o=65535;else{(i&192)===128?n+=t(dd.UNEXPECTED_CONTINUE,n-1,e,r):n+=t(dd.BAD_PREFIX,n-1,e,r);continue}if(n-1+a>=e.length){n+=t(dd.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-a-1)-1;for(let l=0;l<a;l++){let u=e[n];if((u&192)!=128){n+=t(dd.MISSING_CONTINUE,n,e,r),s=null;break}s=s<<6|u&63,n++}if(s!==null){if(s>1114111){n+=t(dd.OUT_OF_RANGE,n-1-a,e,r,s);continue}if(s>=55296&&s<=57343){n+=t(dd.UTF16_SURROGATE,n-1-a,e,r,s);continue}if(s<=o){n+=t(dd.OVERLONG,n-1-a,e,r,s);continue}r.push(s)}}return r}function cl(e,t=bg.current){t!=bg.current&&(xXe.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n<e.length;n++){const i=e.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const a=e.charCodeAt(n);if(n>=e.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const o=65536+((i&1023)<<10)+(a&1023);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(o&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return $t(r)}function Tie(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function HPt(e,t){return'"'+l2e(e,t).map(r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?Tie(r):(r-=65536,Tie((r>>10&1023)+55296)+Tie((r&1023)+56320))}).join("")+'"'}function bhe(e){return e.map(t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10&1023)+55296,(t&1023)+56320))).join("")}function vA(e,t){return bhe(l2e(e,t))}function hG(e,t=bg.current){return l2e(cl(e,t))}function GPt(e){const t=cl(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Xt(Co([t,s2e]).slice(0,32))}function VPt(e){const t=$t(e);if(t.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(t[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;t[r-1]===0;)r--;return vA(t.slice(0,r))}function WPt(e){if(e.length%4!==0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t}function u2e(e,t){t||(t=function(i){return[parseInt(i,16)]});let r=0,n={};return e.split(",").forEach(i=>{let a=i.split(":");r+=parseInt(a[0],16),n[r]=t(a[1])}),n}function OXe(e){let t=0;return e.split(",").map(r=>{let n=r.split("-");n.length===1?n[1]="0":n[1]===""&&(n[1]="1");let i=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:i,h:t}})}function c2e(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];if(r+=i.l,e>=r&&e<=r+i.h&&(e-r)%(i.d||1)===0){if(i.e&&i.e.indexOf(e-r)!==-1)continue;return i}}return null}const jPt=OXe("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"),zPt="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(e=>parseInt(e,16)),YPt=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],qPt=u2e("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"),XPt=u2e("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"),KPt=u2e("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",WPt),ZPt=OXe("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function QPt(e){return e.reduce((t,r)=>(r.forEach(n=>{t.push(n)}),t),[])}function JPt(e){return!!c2e(e,jPt)}function eMt(e){let t=c2e(e,YPt);if(t)return[e+t.s];let r=qPt[e];if(r)return r;let n=XPt[e];if(n)return[e+n[0]];let i=KPt[e];return i||null}function tMt(e){return!!c2e(e,ZPt)}function rMt(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=hG(e);t=QPt(t.map(n=>{if(zPt.indexOf(n)>=0)return[];if(n>=65024&&n<=65039)return[];let i=eMt(n);return i||[n]})),t=hG(bhe(t),bg.NFKC),t.forEach(n=>{if(tMt(n))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")}),t.forEach(n=>{if(JPt(n))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")});let r=bhe(t);if(r.substring(0,1)==="-"||r.substring(2,4)==="--"||r.substring(r.length-1)==="-")throw new Error("invalid hyphen");return r}class nMt extends SXe{constructor(t){super("string",t)}defaultValue(){return""}encode(t,r){return super.encode(t,cl(r))}decode(t){return vA(super.decode(t))}}class D$ extends l2{constructor(t,r){let n=!1;const i=[];t.forEach(o=>{o.dynamic&&(n=!0),i.push(o.type)});const a="tuple("+i.join(",")+")";super("tuple",a,r,n),this.coders=t}defaultValue(){const t=[];this.coders.forEach(n=>{t.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const a=i.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});return this.coders.forEach((n,i)=>{let a=n.localName;!a||r[a]!==1||(a==="length"&&(a="_length"),t[a]==null&&(t[a]=t[i]))}),Object.freeze(t)}encode(t,r){return bXe(t,this.coders,r)}decode(t){return t.coerce(this.name,_Xe(t,this.coders))}}const $$=new Ne(xM),iMt=new RegExp(/^bytes([0-9]*)$/),aMt=new RegExp(/^(u?int)([0-9]*)$/);class NXe{constructor(t){at(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new TPt(t.name);case"bool":return new xPt(t.name);case"string":return new nMt(t.name);case"bytes":return new RPt(t.name);case"array":return new CPt(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new D$((t.components||[]).map(n=>this._getCoder(n)),t.name);case"":return new OPt(t.name)}let r=t.type.match(aMt);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&$$.throwArgumentError("invalid "+r[1]+" bit length","param",t),new kPt(n/8,r[1]==="int",t.name)}if(r=t.type.match(iMt),r){let n=parseInt(r[1]);return(n===0||n>32)&&$$.throwArgumentError("invalid bytes length","param",t),new IPt(n,t.name)}return $$.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,r){return new dG(t,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new Ehe(this._getWordSize())}getDefaultValue(t){const r=t.map(i=>this._getCoder(Yl.from(i)));return new D$(r,"_").defaultValue()}encode(t,r){t.length!==r.length&&$$.throwError("types/values length mismatch",Ne.errors.INVALID_ARGUMENT,{count:{types:t.length,values:r.length},value:{types:t,values:r}});const n=t.map(o=>this._getCoder(Yl.from(o))),i=new D$(n,"_"),a=this._getWriter();return i.encode(a,r),a.data}decode(t,r,n){const i=t.map(o=>this._getCoder(Yl.from(o)));return new D$(i,"_").decode(this._getReader($t(r),n))}}const LXe=new NXe;function PE(e){return lo(cl(e))}const PXe="hash/5.7.0";function f2e(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return $t(t)}function d2e(e){e=$t(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}const oMt=Object.freeze(Object.defineProperty({__proto__:null,decode:f2e,encode:d2e},Symbol.toStringTag,{value:"Module"}));function MXe(e,t){t==null&&(t=1);const r=[],n=r.forEach,i=function(a,o){n.call(a,function(s){o>0&&Array.isArray(s)?i(s,o-1):r.push(s)})};return i(e,t),r}function sMt(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}function lMt(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,a=[0,1];for(let x=1;x<n;x++)a.push(i+=r());let o=r(),s=t;t+=o;let l=0,u=0;function c(){return l==0&&(u=u<<8|e[t++],l=8),u>>--l&1}const f=31,d=Math.pow(2,f),h=d>>>1,p=h>>1,g=d-1;let m=0;for(let x=0;x<f;x++)m=m<<1|c();let E=[],b=0,w=d;for(;;){let x=Math.floor(((m-b+1)*i-1)/w),N=0,A=n;for(;A-N>1;){let I=N+A>>>1;x<a[I]?A=I:N=I}if(N==0)break;E.push(N);let L=b+Math.floor(w*a[N]/i),O=b+Math.floor(w*a[N+1]/i)-1;for(;!((L^O)&h);)m=m<<1&g|c(),L=L<<1&g,O=O<<1&g|1;for(;L&~O&p;)m=m&h|m<<1&g>>>1|c(),L=L<<1^h,O=(O^h)<<1|h|1;b=L,w=1+O-L}let T=n-4;return E.map(x=>{switch(x-T){case 3:return T+65792+(e[s++]<<16|e[s++]<<8|e[s++]);case 2:return T+256+(e[s++]<<8|e[s++]);case 1:return T+e[s++];default:return x-1}})}function uMt(e){let t=0;return()=>e[t++]}function cMt(e){return uMt(lMt(e))}function fMt(e){return e&1?~e>>1:e>>1}function dMt(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}function dxe(e,t){let r=Array(e);for(let n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function hMt(e,t){let r=Array(e);for(let n=0,i=0;n<e;n++)r[n]=i+=fMt(t());return r}function pG(e,t){let r=dxe(e(),e),n=e(),i=dxe(n,e),a=dMt(n,e);for(let o=0;o<n;o++)for(let s=0;s<a[o];s++)r.push(i[o]+s);return t?r.map(o=>t[o]):r}function pMt(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(gMt(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(mMt(r,e))}return sMt(MXe(t))}function vMt(e){let t=[];for(;;){let r=e();if(r==0)break;t.push(r)}return t}function DXe(e,t,r){let n=Array(e).fill(void 0).map(()=>[]);for(let i=0;i<t;i++)hMt(e,r).forEach((a,o)=>n[o].push(a));return n}function gMt(e,t){let r=1+t(),n=t(),i=vMt(t),a=DXe(i.length,1+e,t);return MXe(a.map((o,s)=>{const l=o[0],u=o.slice(1);return Array(i[s]).fill(void 0).map((c,f)=>{let d=f*n;return[l+f*r,u.map(h=>h+d)]})}))}function mMt(e,t){let r=1+t();return DXe(r,1+e,t).map(i=>[i[0],i.slice(1)])}function yMt(e){let t=pG(e).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let u=pG(e,t);if(u.length==0)break;n.push({set:new Set(u),node:r()})}n.sort((u,c)=>c.set.size-u.set.size);let i=e(),a=i%3;i=i/3|0;let o=!!(i&1);i>>=1;let s=i==1,l=i==2;return{branches:n,valid:a,fe0f:o,save:s,check:l}}}function EMt(){return cMt(f2e("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"))}const zj=EMt(),bMt=new Set(pG(zj)),_Mt=new Set(pG(zj)),SMt=pMt(zj),wMt=yMt(zj),hxe=45,pxe=95;function $Xe(e){return hG(e)}function TMt(e){return e.filter(t=>t!=65039)}function kXe(e){for(let t of e.split(".")){let r=$Xe(t);try{for(let n=r.lastIndexOf(pxe)-1;n>=0;n--)if(r[n]!==pxe)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===hxe&&r[3]===hxe)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${t}": ${n.message}`)}}return e}function AMt(e){return kXe(CMt(e,TMt))}function CMt(e,t){let r=$Xe(e).reverse(),n=[];for(;r.length;){let i=RMt(r);if(i){n.push(...t(i));continue}let a=r.pop();if(bMt.has(a)){n.push(a);continue}if(_Mt.has(a))continue;let o=SMt[a];if(o){n.push(...o);continue}throw new Error(`Disallowed codepoint: 0x${a.toString(16).toUpperCase()}`)}return kXe(xMt(String.fromCodePoint(...n)))}function xMt(e){return e.normalize("NFC")}function RMt(e,t){var r;let n=wMt,i,a,o=[],s=e.length;for(t&&(t.length=0);s;){let l=e[--s];if(n=(r=n.branches.find(u=>u.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)a=l;else if(n.check&&l===a)break;o.push(l),n.fe0f&&(o.push(65039),s>0&&e[s-1]==65039&&s--),n.valid&&(i=o.slice(),n.valid==2&&i.splice(1,1),t&&t.push(...e.slice(s).reverse()),e.length=s)}return i}const IMt=new Ne(PXe),BXe=new Uint8Array(32);BXe.fill(0);function vxe(e){if(e.length===0)throw new Error("invalid ENS name; empty component");return e}function h2e(e){const t=cl(AMt(e)),r=[];if(e.length===0)return r;let n=0;for(let i=0;i<t.length;i++)t[i]===46&&(r.push(vxe(t.slice(n,i))),n=i+1);if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(vxe(t.slice(n))),r}function OMt(e){try{return h2e(e).length!==0}catch{}return!1}function GL(e){typeof e!="string"&&IMt.throwArgumentError("invalid ENS name; not a string","name",e);let t=BXe;const r=h2e(e);for(;r.length;)t=lo(Co([t,lo(r.pop())]));return Xt(t)}function UXe(e){return Xt(Co(h2e(e).map(t=>{if(t.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(t.length+1);return r.set(t,1),r[0]=r.length-1,r})))+"00"}const NMt=`Ethereum Signed Message:
|
|
5692
5692
|
`;function p2e(e){return typeof e=="string"&&(e=cl(e)),lo(Co([cl(NMt),cl(String(e.length)),e]))}var LMt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const vs=new Ne(PXe),FXe=new Uint8Array(32);FXe.fill(0);const PMt=Bt.from(-1),HXe=Bt.from(0),GXe=Bt.from(1),MMt=Bt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function DMt(e){const t=$t(e),r=t.length%32;return r?Tf([t,FXe.slice(r)]):Xt(t)}const $Mt=xo(GXe.toHexString(),32),kMt=xo(HXe.toHexString(),32),gxe={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Aie=["name","version","chainId","verifyingContract","salt"];function mxe(e){return function(t){return typeof t!="string"&&vs.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const BMt={name:mxe("name"),version:mxe("version"),chainId:function(e){try{return Bt.from(e).toString()}catch{}return vs.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return va(e).toLowerCase()}catch{}return vs.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=$t(e);if(t.length!==32)throw new Error("bad length");return Xt(t)}catch{}return vs.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Cie(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=t[1]==="",n=parseInt(t[2]||"256");(n%8!==0||n>256||t[2]&&t[2]!==String(n))&&vs.throwArgumentError("invalid numeric width","type",e);const i=MMt.mask(r?n-1:n),a=r?i.add(GXe).mul(PMt):HXe;return function(o){const s=Bt.from(o);return(s.lt(a)||s.gt(i))&&vs.throwArgumentError(`value out-of-bounds for ${e}`,"value",o),xo(s.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(r===0||r>32||t[1]!==String(r))&&vs.throwArgumentError("invalid bytes width","type",e),function(n){return $t(n).length!==r&&vs.throwArgumentError(`invalid length for ${e}`,"value",n),DMt(n)}}}switch(e){case"address":return function(t){return xo(va(t),32)};case"bool":return function(t){return t?$Mt:kMt};case"bytes":return function(t){return lo(t)};case"string":return function(t){return PE(t)}}return null}function yxe(e,t){return`${e}(${t.map(({name:r,type:n})=>n+" "+r).join(",")})`}class Wu{constructor(t){at(this,"types",Object.freeze(Of(t))),at(this,"_encoderCache",{}),at(this,"_types",{});const r={},n={},i={};Object.keys(t).forEach(s=>{r[s]={},n[s]=[],i[s]={}});for(const s in t){const l={};t[s].forEach(u=>{l[u.name]&&vs.throwArgumentError(`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(s)}`,"types",t),l[u.name]=!0;const c=u.type.match(/^([^\x5b]*)(\x5b|$)/)[1];c===s&&vs.throwArgumentError(`circular type reference to ${JSON.stringify(c)}`,"types",t),!Cie(c)&&(n[c]||vs.throwArgumentError(`unknown type ${JSON.stringify(c)}`,"types",t),n[c].push(s),r[s][c]=!0)})}const a=Object.keys(n).filter(s=>n[s].length===0);a.length===0?vs.throwArgumentError("missing primary type","types",t):a.length>1&&vs.throwArgumentError(`ambiguous primary types or unused types: ${a.map(s=>JSON.stringify(s)).join(", ")}`,"types",t),at(this,"primaryType",a[0]);function o(s,l){l[s]&&vs.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t),l[s]=!0,Object.keys(r[s]).forEach(u=>{n[u]&&(o(u,l),Object.keys(l).forEach(c=>{i[c][u]=!0}))}),delete l[s]}o(this.primaryType,{});for(const s in i){const l=Object.keys(i[s]);l.sort(),this._types[s]=yxe(s,t[s])+l.map(u=>yxe(u,t[u])).join("")}}getEncoder(t){let r=this._encoderCache[t];return r||(r=this._encoderCache[t]=this._getEncoder(t)),r}_getEncoder(t){{const i=Cie(t);if(i)return i}const r=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],a=this.getEncoder(i),o=parseInt(r[3]);return s=>{o>=0&&s.length!==o&&vs.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",s);let l=s.map(a);return this._types[i]&&(l=l.map(lo)),lo(Tf(l))}}const n=this.types[t];if(n){const i=PE(this._types[t]);return a=>{const o=n.map(({name:s,type:l})=>{const u=this.getEncoder(l)(a[s]);return this._types[l]?lo(u):u});return o.unshift(i),Tf(o)}}return vs.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const r=this._types[t];return r||vs.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),r}encodeData(t,r){return this.getEncoder(t)(r)}hashStruct(t,r){return lo(this.encodeData(t,r))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,r,n){if(Cie(t))return n(t,r);const i=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const o=i[1],s=parseInt(i[3]);return s>=0&&r.length!==s&&vs.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(o,l,n))}const a=this.types[t];return a?a.reduce((o,{name:s,type:l})=>(o[s]=this._visit(l,r[s],n),o),{}):vs.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,r){return this._visit(this.primaryType,t,r)}static from(t){return new Wu(t)}static getPrimaryType(t){return Wu.from(t).primaryType}static hashStruct(t,r,n){return Wu.from(r).hashStruct(t,n)}static hashDomain(t){const r=[];for(const n in t){const i=gxe[n];i||vs.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",t),r.push({name:n,type:i})}return r.sort((n,i)=>Aie.indexOf(n.name)-Aie.indexOf(i.name)),Wu.hashStruct("EIP712Domain",{EIP712Domain:r},t)}static encode(t,r,n){return Tf(["0x1901",Wu.hashDomain(t),Wu.from(r).hash(n)])}static hash(t,r,n){return lo(Wu.encode(t,r,n))}static resolveNames(t,r,n,i){return LMt(this,void 0,void 0,function*(){t=Do(t);const a={};t.verifyingContract&&!si(t.verifyingContract,20)&&(a[t.verifyingContract]="0x");const o=Wu.from(r);o.visit(n,(s,l)=>(s==="address"&&!si(l,20)&&(a[l]="0x"),l));for(const s in a)a[s]=yield i(s);return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),n=o.visit(n,(s,l)=>s==="address"&&a[l]?a[l]:l),{domain:t,value:n}})}static getPayload(t,r,n){Wu.hashDomain(t);const i={},a=[];Aie.forEach(l=>{const u=t[l];u!=null&&(i[l]=BMt[l](u),a.push({name:l,type:gxe[l]}))});const o=Wu.from(r),s=Do(r);return s.EIP712Domain?vs.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=a,o.encode(n),{types:s,domain:i,primaryType:o.primaryType,message:o.visit(n,(l,u)=>{if(l.match(/^bytes(\d*)/))return Xt($t(u));if(l.match(/^u?int/))return Bt.from(u).toString();switch(l){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return typeof u!="string"&&vs.throwArgumentError("invalid string","value",u),u}return vs.throwArgumentError("unsupported type","type",l)})}}}const hs=new Ne(xM);class VXe extends pA{}class WXe extends pA{}class UMt extends pA{}class vG extends pA{static isIndexed(t){return!!(t&&t._isIndexed)}}const FMt={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function Exe(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class _he{constructor(t){let r=[];typeof t=="string"?r=JSON.parse(t):r=t,at(this,"fragments",r.map(n=>O1.from(n)).filter(n=>n!=null)),at(this,"_abiCoder",Zu(new.target,"getAbiCoder")()),at(this,"functions",{}),at(this,"errors",{}),at(this,"events",{}),at(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){hs.warn("duplicate definition - constructor");return}at(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let a=n.format();if(i[a]){hs.warn("duplicate definition - "+a);return}i[a]=n}),this.deploy||at(this,"deploy",Hp.from({payable:!1,type:"constructor"})),at(this,"_isInterface",!0)}format(t){t||(t=ha.full),t===ha.sighash&&hs.throwArgumentError("interface does not support formatting sighash","format",t);const r=this.fragments.map(n=>n.format(t));return t===ha.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return LXe}static getAddress(t){return va(t)}static getSighash(t){return nl(PE(t.format()),0,4)}static getEventTopic(t){return PE(t.format())}getFunction(t){if(si(t)){for(const n in this.functions)if(t===this.getSighash(n))return this.functions[n];hs.throwArgumentError("no matching function","sighash",t)}if(t.indexOf("(")===-1){const n=t.trim(),i=Object.keys(this.functions).filter(a=>a.split("(")[0]===n);return i.length===0?hs.throwArgumentError("no matching function","name",n):i.length>1&&hs.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Gp.fromString(t).format()];return r||hs.throwArgumentError("no matching function","signature",t),r}getEvent(t){if(si(t)){const n=t.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];hs.throwArgumentError("no matching event","topichash",n)}if(t.indexOf("(")===-1){const n=t.trim(),i=Object.keys(this.events).filter(a=>a.split("(")[0]===n);return i.length===0?hs.throwArgumentError("no matching event","name",n):i.length>1&&hs.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[E1.fromString(t).format()];return r||hs.throwArgumentError("no matching event","signature",t),r}getError(t){if(si(t)){const n=Zu(this.constructor,"getSighash");for(const i in this.errors){const a=this.errors[i];if(t===n(a))return this.errors[i]}hs.throwArgumentError("no matching error","sighash",t)}if(t.indexOf("(")===-1){const n=t.trim(),i=Object.keys(this.errors).filter(a=>a.split("(")[0]===n);return i.length===0?hs.throwArgumentError("no matching error","name",n):i.length>1&&hs.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Gp.fromString(t).format()];return r||hs.throwArgumentError("no matching error","signature",t),r}getSighash(t){if(typeof t=="string")try{t=this.getFunction(t)}catch(r){try{t=this.getError(t)}catch{throw r}}return Zu(this.constructor,"getSighash")(t)}getEventTopic(t){return typeof t=="string"&&(t=this.getEvent(t)),Zu(this.constructor,"getEventTopic")(t)}_decodeParams(t,r){return this._abiCoder.decode(t,r)}_encodeParams(t,r){return this._abiCoder.encode(t,r)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,r){typeof t=="string"&&(t=this.getError(t));const n=$t(r);return Xt(n.slice(0,4))!==this.getSighash(t)&&hs.throwArgumentError(`data signature does not match error ${t.name}.`,"data",Xt(n)),this._decodeParams(t.inputs,n.slice(4))}encodeErrorResult(t,r){return typeof t=="string"&&(t=this.getError(t)),Xt(Co([this.getSighash(t),this._encodeParams(t.inputs,r||[])]))}decodeFunctionData(t,r){typeof t=="string"&&(t=this.getFunction(t));const n=$t(r);return Xt(n.slice(0,4))!==this.getSighash(t)&&hs.throwArgumentError(`data signature does not match function ${t.name}.`,"data",Xt(n)),this._decodeParams(t.inputs,n.slice(4))}encodeFunctionData(t,r){return typeof t=="string"&&(t=this.getFunction(t)),Xt(Co([this.getSighash(t),this._encodeParams(t.inputs,r||[])]))}decodeFunctionResult(t,r){typeof t=="string"&&(t=this.getFunction(t));let n=$t(r),i=null,a="",o=null,s=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,n)}catch{}break;case 4:{const u=Xt(n.slice(0,4)),c=FMt[u];if(c)o=this._abiCoder.decode(c.inputs,n.slice(4)),s=c.name,l=c.signature,c.reason&&(i=o[0]),s==="Error"?a=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:s==="Panic"&&(a=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const f=this.getError(u);o=this._abiCoder.decode(f.inputs,n.slice(4)),s=f.name,l=f.format()}catch{}break}}return hs.throwError("call revert exception"+a,Ne.errors.CALL_EXCEPTION,{method:t.format(),data:Xt(r),errorArgs:o,errorName:s,errorSignature:l,reason:i})}encodeFunctionResult(t,r){return typeof t=="string"&&(t=this.getFunction(t)),Xt(this._abiCoder.encode(t.outputs,r||[]))}encodeFilterTopics(t,r){typeof t=="string"&&(t=this.getEvent(t)),r.length>t.inputs.length&&hs.throwError("too many arguments for "+t.format(),Ne.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];t.anonymous||n.push(this.getEventTopic(t));const i=(a,o)=>a.type==="string"?PE(o):a.type==="bytes"?lo(Xt(o)):(a.type==="bool"&&typeof o=="boolean"&&(o=o?"0x01":"0x00"),a.type.match(/^u?int/)&&(o=Bt.from(o).toHexString()),a.type==="address"&&this._abiCoder.encode(["address"],[o]),xo(Xt(o),32));for(r.forEach((a,o)=>{let s=t.inputs[o];if(!s.indexed){a!=null&&hs.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+s.name,a);return}a==null?n.push(null):s.baseType==="array"||s.baseType==="tuple"?hs.throwArgumentError("filtering with tuples or arrays not supported","contract."+s.name,a):Array.isArray(a)?n.push(a.map(l=>i(s,l))):n.push(i(s,a))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(t,r){typeof t=="string"&&(t=this.getEvent(t));const n=[],i=[],a=[];return t.anonymous||n.push(this.getEventTopic(t)),r.length!==t.inputs.length&&hs.throwArgumentError("event arguments/values mismatch","values",r),t.inputs.forEach((o,s)=>{const l=r[s];if(o.indexed)if(o.type==="string")n.push(PE(l));else if(o.type==="bytes")n.push(lo(l));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([o.type],[l]))}else i.push(o),a.push(l)}),{data:this._abiCoder.encode(i,a),topics:n}}decodeEventLog(t,r,n){if(typeof t=="string"&&(t=this.getEvent(t)),n!=null&&!t.anonymous){let d=this.getEventTopic(t);(!si(n[0],32)||n[0].toLowerCase()!==d)&&hs.throwError("fragment/topic mismatch",Ne.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:d,value:n[0]}),n=n.slice(1)}let i=[],a=[],o=[];t.inputs.forEach((d,h)=>{d.indexed?d.type==="string"||d.type==="bytes"||d.baseType==="tuple"||d.baseType==="array"?(i.push(Yl.fromObject({type:"bytes32",name:d.name})),o.push(!0)):(i.push(d),o.push(!1)):(a.push(d),o.push(!1))});let s=n!=null?this._abiCoder.decode(i,Co(n)):null,l=this._abiCoder.decode(a,r,!0),u=[],c=0,f=0;t.inputs.forEach((d,h)=>{if(d.indexed)if(s==null)u[h]=new vG({_isIndexed:!0,hash:null});else if(o[h])u[h]=new vG({_isIndexed:!0,hash:s[f++]});else try{u[h]=s[f++]}catch(p){u[h]=p}else try{u[h]=l[c++]}catch(p){u[h]=p}if(d.name&&u[d.name]==null){const p=u[h];p instanceof Error?Object.defineProperty(u,d.name,{enumerable:!0,get:()=>{throw Exe(`property ${JSON.stringify(d.name)}`,p)}}):u[d.name]=p}});for(let d=0;d<u.length;d++){const h=u[d];h instanceof Error&&Object.defineProperty(u,d,{enumerable:!0,get:()=>{throw Exe(`index ${d}`,h)}})}return Object.freeze(u)}parseTransaction(t){let r=this.getFunction(t.data.substring(0,10).toLowerCase());return r?new WXe({args:this._abiCoder.decode(r.inputs,"0x"+t.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:Bt.from(t.value||"0")}):null}parseLog(t){let r=this.getEvent(t.topics[0]);return!r||r.anonymous?null:new VXe({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,t.data,t.topics)})}parseError(t){const r=Xt(t);let n=this.getError(r.substring(0,10).toLowerCase());return n?new UMt({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(t){return!!(t&&t._isInterface)}}const HMt="abstract-provider/5.7.0";var GMt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const VMt=new Ne(HMt);class WMt extends pA{static isForkEvent(t){return!!(t&&t._isForkEvent)}}class gA{constructor(){VMt.checkAbstract(new.target,gA),at(this,"_isProvider",!0)}getFeeData(){return GMt(this,void 0,void 0,function*(){const{block:t,gasPrice:r}=yield Ms({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(o=>null)});let n=null,i=null,a=null;return t&&t.baseFeePerGas&&(n=t.baseFeePerGas,a=Bt.from("1500000000"),i=t.baseFeePerGas.mul(2).add(a)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:a,gasPrice:r}})}addListener(t,r){return this.on(t,r)}removeListener(t,r){return this.off(t,r)}static isProvider(t){return!!(t&&t._isProvider)}}const jMt="abstract-signer/5.7.0";var bp=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const Gh=new Ne(jMt),zMt=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],YMt=[Ne.errors.INSUFFICIENT_FUNDS,Ne.errors.NONCE_EXPIRED,Ne.errors.REPLACEMENT_UNDERPRICED];class m_{constructor(){Gh.checkAbstract(new.target,m_),at(this,"_isSigner",!0)}getBalance(t){return bp(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),t)})}getTransactionCount(t){return bp(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),t)})}estimateGas(t){return bp(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield Ms(this.checkTransaction(t));return yield this.provider.estimateGas(r)})}call(t,r){return bp(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield Ms(this.checkTransaction(t));return yield this.provider.call(n,r)})}sendTransaction(t){return bp(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(t),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return bp(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return bp(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return bp(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(t){return bp(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(t)})}checkTransaction(t){for(const n in t)zMt.indexOf(n)===-1&&Gh.throwArgumentError("invalid transaction key: "+n,"transaction",t);const r=Do(t);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Gh.throwArgumentError("from address mismatch","transaction",t),n[0])),r}populateTransaction(t){return bp(this,void 0,void 0,function*(){const r=yield Ms(this.checkTransaction(t));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>bp(this,void 0,void 0,function*(){if(i==null)return null;const a=yield this.resolveName(i);return a==null&&Gh.throwArgumentError("provided ENS name resolves to null","tx.to",i),a})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Gh.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",t):(r.type===0||r.type===1)&&n&&Gh.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",t),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Gh.throwError("network does not support EIP-1559",Ne.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Gh.throwError("failed to get consistent fee data",Ne.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(YMt.indexOf(i.code)>=0)throw i;return Gh.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ne.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Gh.throwArgumentError("chainId address mismatch","transaction",t),i[0])),yield Ms(r)})}_checkProvider(t){this.provider||Gh.throwError("missing provider",Ne.errors.UNSUPPORTED_OPERATION,{operation:t||"_checkProvider"})}static isSigner(t){return!!(t&&t._isSigner)}}class Yj extends m_{constructor(t,r){super(),at(this,"address",t),at(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(t,r){return Promise.resolve().then(()=>{Gh.throwError(t,Ne.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(t){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(t){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(t,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(t){return new Yj(this.address,t)}}var v2e={exports:{}};v2e.exports;(function(e){(function(t,r){function n(D,y){if(!D)throw new Error(y||"Assertion failed")}function i(D,y){D.super_=y;var S=function(){};S.prototype=y.prototype,D.prototype=new S,D.prototype.constructor=D}function a(D,y,S){if(a.isBN(D))return D;this.negative=0,this.words=null,this.length=0,this.red=null,D!==null&&((y==="le"||y==="be")&&(S=y,y=10),this._init(D||0,y||10,S||"be"))}typeof t=="object"?t.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=sA.Buffer}catch{}a.isBN=function(y){return y instanceof a?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===a.wordSize&&Array.isArray(y.words)},a.max=function(y,S){return y.cmp(S)>0?y:S},a.min=function(y,S){return y.cmp(S)<0?y:S},a.prototype._init=function(y,S,C){if(typeof y=="number")return this._initNumber(y,S,C);if(typeof y=="object")return this._initArray(y,S,C);S==="hex"&&(S=16),n(S===(S|0)&&S>=2&&S<=36),y=y.toString().replace(/\s+/g,"");var M=0;y[0]==="-"&&(M++,this.negative=1),M<y.length&&(S===16?this._parseHex(y,M,C):(this._parseBase(y,S,M),C==="le"&&this._initArray(this.toArray(),S,C)))},a.prototype._initNumber=function(y,S,C){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(n(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),C==="le"&&this._initArray(this.toArray(),S,C)},a.prototype._initArray=function(y,S,C){if(n(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var k,U,G=0;if(C==="be")for(M=y.length-1,k=0;M>=0;M-=3)U=y[M]|y[M-1]<<8|y[M-2]<<16,this.words[k]|=U<<G&67108863,this.words[k+1]=U>>>26-G&67108863,G+=24,G>=26&&(G-=26,k++);else if(C==="le")for(M=0,k=0;M<y.length;M+=3)U=y[M]|y[M+1]<<8|y[M+2]<<16,this.words[k]|=U<<G&67108863,this.words[k+1]=U>>>26-G&67108863,G+=24,G>=26&&(G-=26,k++);return this._strip()};function s(D,y){var S=D.charCodeAt(y);if(S>=48&&S<=57)return S-48;if(S>=65&&S<=70)return S-55;if(S>=97&&S<=102)return S-87;n(!1,"Invalid character in "+D)}function l(D,y,S){var C=s(D,S);return S-1>=y&&(C|=s(D,S-1)<<4),C}a.prototype._parseHex=function(y,S,C){this.length=Math.ceil((y.length-S)/6),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var k=0,U=0,G;if(C==="be")for(M=y.length-1;M>=S;M-=2)G=l(y,S,M)<<k,this.words[U]|=G&67108863,k>=18?(k-=18,U+=1,this.words[U]|=G>>>26):k+=8;else{var B=y.length-S;for(M=B%2===0?S+1:S;M<y.length;M+=2)G=l(y,S,M)<<k,this.words[U]|=G&67108863,k>=18?(k-=18,U+=1,this.words[U]|=G>>>26):k+=8}this._strip()};function u(D,y,S,C){for(var M=0,k=0,U=Math.min(D.length,S),G=y;G<U;G++){var B=D.charCodeAt(G)-48;M*=C,B>=49?k=B-49+10:B>=17?k=B-17+10:k=B,n(B>=0&&k<C,"Invalid character"),M+=k}return M}a.prototype._parseBase=function(y,S,C){this.words=[0],this.length=1;for(var M=0,k=1;k<=67108863;k*=S)M++;M--,k=k/S|0;for(var U=y.length-C,G=U%M,B=Math.min(U,U-G)+C,R=0,H=C;H<B;H+=M)R=u(y,H,H+M,S),this.imuln(k),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R);if(G!==0){var q=1;for(R=u(y,H,y.length,S),H=0;H<G;H++)q*=S;this.imuln(q),this.words[0]+R<67108864?this.words[0]+=R:this._iaddn(R)}this._strip()},a.prototype.copy=function(y){y.words=new Array(this.length);for(var S=0;S<this.length;S++)y.words[S]=this.words[S];y.length=this.length,y.negative=this.negative,y.red=this.red};function c(D,y){D.words=y.words,D.length=y.length,D.negative=y.negative,D.red=y.red}if(a.prototype._move=function(y){c(y,this)},a.prototype.clone=function(){var y=new a(null);return this.copy(y),y},a.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},a.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(y,S){y=y||10,S=S|0||1;var C;if(y===16||y==="hex"){C="";for(var M=0,k=0,U=0;U<this.length;U++){var G=this.words[U],B=((G<<M|k)&16777215).toString(16);k=G>>>24-M&16777215,M+=2,M>=26&&(M-=26,U--),k!==0||U!==this.length-1?C=d[6-B.length]+B+C:C=B+C}for(k!==0&&(C=k.toString(16)+C);C.length%S!==0;)C="0"+C;return this.negative!==0&&(C="-"+C),C}if(y===(y|0)&&y>=2&&y<=36){var R=h[y],H=p[y];C="";var q=this.clone();for(q.negative=0;!q.isZero();){var W=q.modrn(H).toString(y);q=q.idivn(H),q.isZero()?C=W+C:C=d[R-W.length]+W+C}for(this.isZero()&&(C="0"+C);C.length%S!==0;)C="0"+C;return this.negative!==0&&(C="-"+C),C}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},a.prototype.toJSON=function(){return this.toString(16,2)},o&&(a.prototype.toBuffer=function(y,S){return this.toArrayLike(o,y,S)}),a.prototype.toArray=function(y,S){return this.toArrayLike(Array,y,S)};var g=function(y,S){return y.allocUnsafe?y.allocUnsafe(S):new y(S)};a.prototype.toArrayLike=function(y,S,C){this._strip();var M=this.byteLength(),k=C||Math.max(1,M);n(M<=k,"byte array longer than desired length"),n(k>0,"Requested array length <= 0");var U=g(y,k),G=S==="le"?"LE":"BE";return this["_toArrayLike"+G](U,M),U},a.prototype._toArrayLikeLE=function(y,S){for(var C=0,M=0,k=0,U=0;k<this.length;k++){var G=this.words[k]<<U|M;y[C++]=G&255,C<y.length&&(y[C++]=G>>8&255),C<y.length&&(y[C++]=G>>16&255),U===6?(C<y.length&&(y[C++]=G>>24&255),M=0,U=0):(M=G>>>24,U+=2)}if(C<y.length)for(y[C++]=M;C<y.length;)y[C++]=0},a.prototype._toArrayLikeBE=function(y,S){for(var C=y.length-1,M=0,k=0,U=0;k<this.length;k++){var G=this.words[k]<<U|M;y[C--]=G&255,C>=0&&(y[C--]=G>>8&255),C>=0&&(y[C--]=G>>16&255),U===6?(C>=0&&(y[C--]=G>>24&255),M=0,U=0):(M=G>>>24,U+=2)}if(C>=0)for(y[C--]=M;C>=0;)y[C--]=0},Math.clz32?a.prototype._countBits=function(y){return 32-Math.clz32(y)}:a.prototype._countBits=function(y){var S=y,C=0;return S>=4096&&(C+=13,S>>>=13),S>=64&&(C+=7,S>>>=7),S>=8&&(C+=4,S>>>=4),S>=2&&(C+=2,S>>>=2),C+S},a.prototype._zeroBits=function(y){if(y===0)return 26;var S=y,C=0;return S&8191||(C+=13,S>>>=13),S&127||(C+=7,S>>>=7),S&15||(C+=4,S>>>=4),S&3||(C+=2,S>>>=2),S&1||C++,C},a.prototype.bitLength=function(){var y=this.words[this.length-1],S=this._countBits(y);return(this.length-1)*26+S};function m(D){for(var y=new Array(D.bitLength()),S=0;S<y.length;S++){var C=S/26|0,M=S%26;y[S]=D.words[C]>>>M&1}return y}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,S=0;S<this.length;S++){var C=this._zeroBits(this.words[S]);if(y+=C,C!==26)break}return y},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},a.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return this.negative!==0},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var S=0;S<y.length;S++)this.words[S]=this.words[S]|y.words[S];return this._strip()},a.prototype.ior=function(y){return n((this.negative|y.negative)===0),this.iuor(y)},a.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},a.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},a.prototype.iuand=function(y){var S;this.length>y.length?S=y:S=this;for(var C=0;C<S.length;C++)this.words[C]=this.words[C]&y.words[C];return this.length=S.length,this._strip()},a.prototype.iand=function(y){return n((this.negative|y.negative)===0),this.iuand(y)},a.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},a.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},a.prototype.iuxor=function(y){var S,C;this.length>y.length?(S=this,C=y):(S=y,C=this);for(var M=0;M<C.length;M++)this.words[M]=S.words[M]^C.words[M];if(this!==S)for(;M<S.length;M++)this.words[M]=S.words[M];return this.length=S.length,this._strip()},a.prototype.ixor=function(y){return n((this.negative|y.negative)===0),this.iuxor(y)},a.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},a.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},a.prototype.inotn=function(y){n(typeof y=="number"&&y>=0);var S=Math.ceil(y/26)|0,C=y%26;this._expand(S),C>0&&S--;for(var M=0;M<S;M++)this.words[M]=~this.words[M]&67108863;return C>0&&(this.words[M]=~this.words[M]&67108863>>26-C),this._strip()},a.prototype.notn=function(y){return this.clone().inotn(y)},a.prototype.setn=function(y,S){n(typeof y=="number"&&y>=0);var C=y/26|0,M=y%26;return this._expand(C+1),S?this.words[C]=this.words[C]|1<<M:this.words[C]=this.words[C]&~(1<<M),this._strip()},a.prototype.iadd=function(y){var S;if(this.negative!==0&&y.negative===0)return this.negative=0,S=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,S=this.isub(y),y.negative=1,S._normSign();var C,M;this.length>y.length?(C=this,M=y):(C=y,M=this);for(var k=0,U=0;U<M.length;U++)S=(C.words[U]|0)+(M.words[U]|0)+k,this.words[U]=S&67108863,k=S>>>26;for(;k!==0&&U<C.length;U++)S=(C.words[U]|0)+k,this.words[U]=S&67108863,k=S>>>26;if(this.length=C.length,k!==0)this.words[this.length]=k,this.length++;else if(C!==this)for(;U<C.length;U++)this.words[U]=C.words[U];return this},a.prototype.add=function(y){var S;return y.negative!==0&&this.negative===0?(y.negative=0,S=this.sub(y),y.negative^=1,S):y.negative===0&&this.negative!==0?(this.negative=0,S=y.sub(this),this.negative=1,S):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},a.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var S=this.iadd(y);return y.negative=1,S._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var C=this.cmp(y);if(C===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,k;C>0?(M=this,k=y):(M=y,k=this);for(var U=0,G=0;G<k.length;G++)S=(M.words[G]|0)-(k.words[G]|0)+U,U=S>>26,this.words[G]=S&67108863;for(;U!==0&&G<M.length;G++)S=(M.words[G]|0)+U,U=S>>26,this.words[G]=S&67108863;if(U===0&&G<M.length&&M!==this)for(;G<M.length;G++)this.words[G]=M.words[G];return this.length=Math.max(this.length,G),M!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(y){return this.clone().isub(y)};function E(D,y,S){S.negative=y.negative^D.negative;var C=D.length+y.length|0;S.length=C,C=C-1|0;var M=D.words[0]|0,k=y.words[0]|0,U=M*k,G=U&67108863,B=U/67108864|0;S.words[0]=G;for(var R=1;R<C;R++){for(var H=B>>>26,q=B&67108863,W=Math.min(R,y.length-1),Y=Math.max(0,R-D.length+1);Y<=W;Y++){var re=R-Y|0;M=D.words[re]|0,k=y.words[Y]|0,U=M*k+q,H+=U/67108864|0,q=U&67108863}S.words[R]=q|0,B=H|0}return B!==0?S.words[R]=B|0:S.length--,S._strip()}var b=function(y,S,C){var M=y.words,k=S.words,U=C.words,G=0,B,R,H,q=M[0]|0,W=q&8191,Y=q>>>13,re=M[1]|0,Q=re&8191,ie=re>>>13,ce=M[2]|0,te=ce&8191,J=ce>>>13,ge=M[3]|0,fe=ge&8191,ye=ge>>>13,Ue=M[4]|0,me=Ue&8191,Be=Ue>>>13,et=M[5]|0,Ge=et&8191,Ae=et>>>13,We=M[6]|0,Le=We&8191,Ie=We>>>13,tt=M[7]|0,Ve=tt&8191,ne=tt>>>13,X=M[8]|0,K=X&8191,le=X>>>13,ve=M[9]|0,Ee=ve&8191,we=ve>>>13,ft=k[0]|0,Fe=ft&8191,Xe=ft>>>13,Qt=k[1]|0,it=Qt&8191,Tt=Qt>>>13,Hr=k[2]|0,xt=Hr&8191,Mt=Hr>>>13,kn=k[3]|0,Ot=kn&8191,qt=kn>>>13,Vi=k[4]|0,ct=Vi&8191,_t=Vi>>>13,Ki=k[5]|0,Jt=Ki&8191,zt=Ki>>>13,aa=k[6]|0,Vt=aa&8191,Ft=aa>>>13,Wi=k[7]|0,vt=Wi&8191,Nt=Wi>>>13,qr=k[8]|0,yt=qr&8191,Lt=qr>>>13,oa=k[9]|0,Pe=oa&8191,De=oa>>>13;C.negative=y.negative^S.negative,C.length=19,B=Math.imul(W,Fe),R=Math.imul(W,Xe),R=R+Math.imul(Y,Fe)|0,H=Math.imul(Y,Xe);var Pt=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,B=Math.imul(Q,Fe),R=Math.imul(Q,Xe),R=R+Math.imul(ie,Fe)|0,H=Math.imul(ie,Xe),B=B+Math.imul(W,it)|0,R=R+Math.imul(W,Tt)|0,R=R+Math.imul(Y,it)|0,H=H+Math.imul(Y,Tt)|0;var Sr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,B=Math.imul(te,Fe),R=Math.imul(te,Xe),R=R+Math.imul(J,Fe)|0,H=Math.imul(J,Xe),B=B+Math.imul(Q,it)|0,R=R+Math.imul(Q,Tt)|0,R=R+Math.imul(ie,it)|0,H=H+Math.imul(ie,Tt)|0,B=B+Math.imul(W,xt)|0,R=R+Math.imul(W,Mt)|0,R=R+Math.imul(Y,xt)|0,H=H+Math.imul(Y,Mt)|0;var Mr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,B=Math.imul(fe,Fe),R=Math.imul(fe,Xe),R=R+Math.imul(ye,Fe)|0,H=Math.imul(ye,Xe),B=B+Math.imul(te,it)|0,R=R+Math.imul(te,Tt)|0,R=R+Math.imul(J,it)|0,H=H+Math.imul(J,Tt)|0,B=B+Math.imul(Q,xt)|0,R=R+Math.imul(Q,Mt)|0,R=R+Math.imul(ie,xt)|0,H=H+Math.imul(ie,Mt)|0,B=B+Math.imul(W,Ot)|0,R=R+Math.imul(W,qt)|0,R=R+Math.imul(Y,Ot)|0,H=H+Math.imul(Y,qt)|0;var un=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(un>>>26)|0,un&=67108863,B=Math.imul(me,Fe),R=Math.imul(me,Xe),R=R+Math.imul(Be,Fe)|0,H=Math.imul(Be,Xe),B=B+Math.imul(fe,it)|0,R=R+Math.imul(fe,Tt)|0,R=R+Math.imul(ye,it)|0,H=H+Math.imul(ye,Tt)|0,B=B+Math.imul(te,xt)|0,R=R+Math.imul(te,Mt)|0,R=R+Math.imul(J,xt)|0,H=H+Math.imul(J,Mt)|0,B=B+Math.imul(Q,Ot)|0,R=R+Math.imul(Q,qt)|0,R=R+Math.imul(ie,Ot)|0,H=H+Math.imul(ie,qt)|0,B=B+Math.imul(W,ct)|0,R=R+Math.imul(W,_t)|0,R=R+Math.imul(Y,ct)|0,H=H+Math.imul(Y,_t)|0;var fn=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(fn>>>26)|0,fn&=67108863,B=Math.imul(Ge,Fe),R=Math.imul(Ge,Xe),R=R+Math.imul(Ae,Fe)|0,H=Math.imul(Ae,Xe),B=B+Math.imul(me,it)|0,R=R+Math.imul(me,Tt)|0,R=R+Math.imul(Be,it)|0,H=H+Math.imul(Be,Tt)|0,B=B+Math.imul(fe,xt)|0,R=R+Math.imul(fe,Mt)|0,R=R+Math.imul(ye,xt)|0,H=H+Math.imul(ye,Mt)|0,B=B+Math.imul(te,Ot)|0,R=R+Math.imul(te,qt)|0,R=R+Math.imul(J,Ot)|0,H=H+Math.imul(J,qt)|0,B=B+Math.imul(Q,ct)|0,R=R+Math.imul(Q,_t)|0,R=R+Math.imul(ie,ct)|0,H=H+Math.imul(ie,_t)|0,B=B+Math.imul(W,Jt)|0,R=R+Math.imul(W,zt)|0,R=R+Math.imul(Y,Jt)|0,H=H+Math.imul(Y,zt)|0;var ri=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(ri>>>26)|0,ri&=67108863,B=Math.imul(Le,Fe),R=Math.imul(Le,Xe),R=R+Math.imul(Ie,Fe)|0,H=Math.imul(Ie,Xe),B=B+Math.imul(Ge,it)|0,R=R+Math.imul(Ge,Tt)|0,R=R+Math.imul(Ae,it)|0,H=H+Math.imul(Ae,Tt)|0,B=B+Math.imul(me,xt)|0,R=R+Math.imul(me,Mt)|0,R=R+Math.imul(Be,xt)|0,H=H+Math.imul(Be,Mt)|0,B=B+Math.imul(fe,Ot)|0,R=R+Math.imul(fe,qt)|0,R=R+Math.imul(ye,Ot)|0,H=H+Math.imul(ye,qt)|0,B=B+Math.imul(te,ct)|0,R=R+Math.imul(te,_t)|0,R=R+Math.imul(J,ct)|0,H=H+Math.imul(J,_t)|0,B=B+Math.imul(Q,Jt)|0,R=R+Math.imul(Q,zt)|0,R=R+Math.imul(ie,Jt)|0,H=H+Math.imul(ie,zt)|0,B=B+Math.imul(W,Vt)|0,R=R+Math.imul(W,Ft)|0,R=R+Math.imul(Y,Vt)|0,H=H+Math.imul(Y,Ft)|0;var no=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(no>>>26)|0,no&=67108863,B=Math.imul(Ve,Fe),R=Math.imul(Ve,Xe),R=R+Math.imul(ne,Fe)|0,H=Math.imul(ne,Xe),B=B+Math.imul(Le,it)|0,R=R+Math.imul(Le,Tt)|0,R=R+Math.imul(Ie,it)|0,H=H+Math.imul(Ie,Tt)|0,B=B+Math.imul(Ge,xt)|0,R=R+Math.imul(Ge,Mt)|0,R=R+Math.imul(Ae,xt)|0,H=H+Math.imul(Ae,Mt)|0,B=B+Math.imul(me,Ot)|0,R=R+Math.imul(me,qt)|0,R=R+Math.imul(Be,Ot)|0,H=H+Math.imul(Be,qt)|0,B=B+Math.imul(fe,ct)|0,R=R+Math.imul(fe,_t)|0,R=R+Math.imul(ye,ct)|0,H=H+Math.imul(ye,_t)|0,B=B+Math.imul(te,Jt)|0,R=R+Math.imul(te,zt)|0,R=R+Math.imul(J,Jt)|0,H=H+Math.imul(J,zt)|0,B=B+Math.imul(Q,Vt)|0,R=R+Math.imul(Q,Ft)|0,R=R+Math.imul(ie,Vt)|0,H=H+Math.imul(ie,Ft)|0,B=B+Math.imul(W,vt)|0,R=R+Math.imul(W,Nt)|0,R=R+Math.imul(Y,vt)|0,H=H+Math.imul(Y,Nt)|0;var Zi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,B=Math.imul(K,Fe),R=Math.imul(K,Xe),R=R+Math.imul(le,Fe)|0,H=Math.imul(le,Xe),B=B+Math.imul(Ve,it)|0,R=R+Math.imul(Ve,Tt)|0,R=R+Math.imul(ne,it)|0,H=H+Math.imul(ne,Tt)|0,B=B+Math.imul(Le,xt)|0,R=R+Math.imul(Le,Mt)|0,R=R+Math.imul(Ie,xt)|0,H=H+Math.imul(Ie,Mt)|0,B=B+Math.imul(Ge,Ot)|0,R=R+Math.imul(Ge,qt)|0,R=R+Math.imul(Ae,Ot)|0,H=H+Math.imul(Ae,qt)|0,B=B+Math.imul(me,ct)|0,R=R+Math.imul(me,_t)|0,R=R+Math.imul(Be,ct)|0,H=H+Math.imul(Be,_t)|0,B=B+Math.imul(fe,Jt)|0,R=R+Math.imul(fe,zt)|0,R=R+Math.imul(ye,Jt)|0,H=H+Math.imul(ye,zt)|0,B=B+Math.imul(te,Vt)|0,R=R+Math.imul(te,Ft)|0,R=R+Math.imul(J,Vt)|0,H=H+Math.imul(J,Ft)|0,B=B+Math.imul(Q,vt)|0,R=R+Math.imul(Q,Nt)|0,R=R+Math.imul(ie,vt)|0,H=H+Math.imul(ie,Nt)|0,B=B+Math.imul(W,yt)|0,R=R+Math.imul(W,Lt)|0,R=R+Math.imul(Y,yt)|0,H=H+Math.imul(Y,Lt)|0;var po=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(po>>>26)|0,po&=67108863,B=Math.imul(Ee,Fe),R=Math.imul(Ee,Xe),R=R+Math.imul(we,Fe)|0,H=Math.imul(we,Xe),B=B+Math.imul(K,it)|0,R=R+Math.imul(K,Tt)|0,R=R+Math.imul(le,it)|0,H=H+Math.imul(le,Tt)|0,B=B+Math.imul(Ve,xt)|0,R=R+Math.imul(Ve,Mt)|0,R=R+Math.imul(ne,xt)|0,H=H+Math.imul(ne,Mt)|0,B=B+Math.imul(Le,Ot)|0,R=R+Math.imul(Le,qt)|0,R=R+Math.imul(Ie,Ot)|0,H=H+Math.imul(Ie,qt)|0,B=B+Math.imul(Ge,ct)|0,R=R+Math.imul(Ge,_t)|0,R=R+Math.imul(Ae,ct)|0,H=H+Math.imul(Ae,_t)|0,B=B+Math.imul(me,Jt)|0,R=R+Math.imul(me,zt)|0,R=R+Math.imul(Be,Jt)|0,H=H+Math.imul(Be,zt)|0,B=B+Math.imul(fe,Vt)|0,R=R+Math.imul(fe,Ft)|0,R=R+Math.imul(ye,Vt)|0,H=H+Math.imul(ye,Ft)|0,B=B+Math.imul(te,vt)|0,R=R+Math.imul(te,Nt)|0,R=R+Math.imul(J,vt)|0,H=H+Math.imul(J,Nt)|0,B=B+Math.imul(Q,yt)|0,R=R+Math.imul(Q,Lt)|0,R=R+Math.imul(ie,yt)|0,H=H+Math.imul(ie,Lt)|0,B=B+Math.imul(W,Pe)|0,R=R+Math.imul(W,De)|0,R=R+Math.imul(Y,Pe)|0,H=H+Math.imul(Y,De)|0;var sa=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(sa>>>26)|0,sa&=67108863,B=Math.imul(Ee,it),R=Math.imul(Ee,Tt),R=R+Math.imul(we,it)|0,H=Math.imul(we,Tt),B=B+Math.imul(K,xt)|0,R=R+Math.imul(K,Mt)|0,R=R+Math.imul(le,xt)|0,H=H+Math.imul(le,Mt)|0,B=B+Math.imul(Ve,Ot)|0,R=R+Math.imul(Ve,qt)|0,R=R+Math.imul(ne,Ot)|0,H=H+Math.imul(ne,qt)|0,B=B+Math.imul(Le,ct)|0,R=R+Math.imul(Le,_t)|0,R=R+Math.imul(Ie,ct)|0,H=H+Math.imul(Ie,_t)|0,B=B+Math.imul(Ge,Jt)|0,R=R+Math.imul(Ge,zt)|0,R=R+Math.imul(Ae,Jt)|0,H=H+Math.imul(Ae,zt)|0,B=B+Math.imul(me,Vt)|0,R=R+Math.imul(me,Ft)|0,R=R+Math.imul(Be,Vt)|0,H=H+Math.imul(Be,Ft)|0,B=B+Math.imul(fe,vt)|0,R=R+Math.imul(fe,Nt)|0,R=R+Math.imul(ye,vt)|0,H=H+Math.imul(ye,Nt)|0,B=B+Math.imul(te,yt)|0,R=R+Math.imul(te,Lt)|0,R=R+Math.imul(J,yt)|0,H=H+Math.imul(J,Lt)|0,B=B+Math.imul(Q,Pe)|0,R=R+Math.imul(Q,De)|0,R=R+Math.imul(ie,Pe)|0,H=H+Math.imul(ie,De)|0;var Ca=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,B=Math.imul(Ee,xt),R=Math.imul(Ee,Mt),R=R+Math.imul(we,xt)|0,H=Math.imul(we,Mt),B=B+Math.imul(K,Ot)|0,R=R+Math.imul(K,qt)|0,R=R+Math.imul(le,Ot)|0,H=H+Math.imul(le,qt)|0,B=B+Math.imul(Ve,ct)|0,R=R+Math.imul(Ve,_t)|0,R=R+Math.imul(ne,ct)|0,H=H+Math.imul(ne,_t)|0,B=B+Math.imul(Le,Jt)|0,R=R+Math.imul(Le,zt)|0,R=R+Math.imul(Ie,Jt)|0,H=H+Math.imul(Ie,zt)|0,B=B+Math.imul(Ge,Vt)|0,R=R+Math.imul(Ge,Ft)|0,R=R+Math.imul(Ae,Vt)|0,H=H+Math.imul(Ae,Ft)|0,B=B+Math.imul(me,vt)|0,R=R+Math.imul(me,Nt)|0,R=R+Math.imul(Be,vt)|0,H=H+Math.imul(Be,Nt)|0,B=B+Math.imul(fe,yt)|0,R=R+Math.imul(fe,Lt)|0,R=R+Math.imul(ye,yt)|0,H=H+Math.imul(ye,Lt)|0,B=B+Math.imul(te,Pe)|0,R=R+Math.imul(te,De)|0,R=R+Math.imul(J,Pe)|0,H=H+Math.imul(J,De)|0;var Jr=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,B=Math.imul(Ee,Ot),R=Math.imul(Ee,qt),R=R+Math.imul(we,Ot)|0,H=Math.imul(we,qt),B=B+Math.imul(K,ct)|0,R=R+Math.imul(K,_t)|0,R=R+Math.imul(le,ct)|0,H=H+Math.imul(le,_t)|0,B=B+Math.imul(Ve,Jt)|0,R=R+Math.imul(Ve,zt)|0,R=R+Math.imul(ne,Jt)|0,H=H+Math.imul(ne,zt)|0,B=B+Math.imul(Le,Vt)|0,R=R+Math.imul(Le,Ft)|0,R=R+Math.imul(Ie,Vt)|0,H=H+Math.imul(Ie,Ft)|0,B=B+Math.imul(Ge,vt)|0,R=R+Math.imul(Ge,Nt)|0,R=R+Math.imul(Ae,vt)|0,H=H+Math.imul(Ae,Nt)|0,B=B+Math.imul(me,yt)|0,R=R+Math.imul(me,Lt)|0,R=R+Math.imul(Be,yt)|0,H=H+Math.imul(Be,Lt)|0,B=B+Math.imul(fe,Pe)|0,R=R+Math.imul(fe,De)|0,R=R+Math.imul(ye,Pe)|0,H=H+Math.imul(ye,De)|0;var Oi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Oi>>>26)|0,Oi&=67108863,B=Math.imul(Ee,ct),R=Math.imul(Ee,_t),R=R+Math.imul(we,ct)|0,H=Math.imul(we,_t),B=B+Math.imul(K,Jt)|0,R=R+Math.imul(K,zt)|0,R=R+Math.imul(le,Jt)|0,H=H+Math.imul(le,zt)|0,B=B+Math.imul(Ve,Vt)|0,R=R+Math.imul(Ve,Ft)|0,R=R+Math.imul(ne,Vt)|0,H=H+Math.imul(ne,Ft)|0,B=B+Math.imul(Le,vt)|0,R=R+Math.imul(Le,Nt)|0,R=R+Math.imul(Ie,vt)|0,H=H+Math.imul(Ie,Nt)|0,B=B+Math.imul(Ge,yt)|0,R=R+Math.imul(Ge,Lt)|0,R=R+Math.imul(Ae,yt)|0,H=H+Math.imul(Ae,Lt)|0,B=B+Math.imul(me,Pe)|0,R=R+Math.imul(me,De)|0,R=R+Math.imul(Be,Pe)|0,H=H+Math.imul(Be,De)|0;var hi=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(hi>>>26)|0,hi&=67108863,B=Math.imul(Ee,Jt),R=Math.imul(Ee,zt),R=R+Math.imul(we,Jt)|0,H=Math.imul(we,zt),B=B+Math.imul(K,Vt)|0,R=R+Math.imul(K,Ft)|0,R=R+Math.imul(le,Vt)|0,H=H+Math.imul(le,Ft)|0,B=B+Math.imul(Ve,vt)|0,R=R+Math.imul(Ve,Nt)|0,R=R+Math.imul(ne,vt)|0,H=H+Math.imul(ne,Nt)|0,B=B+Math.imul(Le,yt)|0,R=R+Math.imul(Le,Lt)|0,R=R+Math.imul(Ie,yt)|0,H=H+Math.imul(Ie,Lt)|0,B=B+Math.imul(Ge,Pe)|0,R=R+Math.imul(Ge,De)|0,R=R+Math.imul(Ae,Pe)|0,H=H+Math.imul(Ae,De)|0;var Bo=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Bo>>>26)|0,Bo&=67108863,B=Math.imul(Ee,Vt),R=Math.imul(Ee,Ft),R=R+Math.imul(we,Vt)|0,H=Math.imul(we,Ft),B=B+Math.imul(K,vt)|0,R=R+Math.imul(K,Nt)|0,R=R+Math.imul(le,vt)|0,H=H+Math.imul(le,Nt)|0,B=B+Math.imul(Ve,yt)|0,R=R+Math.imul(Ve,Lt)|0,R=R+Math.imul(ne,yt)|0,H=H+Math.imul(ne,Lt)|0,B=B+Math.imul(Le,Pe)|0,R=R+Math.imul(Le,De)|0,R=R+Math.imul(Ie,Pe)|0,H=H+Math.imul(Ie,De)|0;var ss=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(ss>>>26)|0,ss&=67108863,B=Math.imul(Ee,vt),R=Math.imul(Ee,Nt),R=R+Math.imul(we,vt)|0,H=Math.imul(we,Nt),B=B+Math.imul(K,yt)|0,R=R+Math.imul(K,Lt)|0,R=R+Math.imul(le,yt)|0,H=H+Math.imul(le,Lt)|0,B=B+Math.imul(Ve,Pe)|0,R=R+Math.imul(Ve,De)|0,R=R+Math.imul(ne,Pe)|0,H=H+Math.imul(ne,De)|0;var Nl=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Nl>>>26)|0,Nl&=67108863,B=Math.imul(Ee,yt),R=Math.imul(Ee,Lt),R=R+Math.imul(we,yt)|0,H=Math.imul(we,Lt),B=B+Math.imul(K,Pe)|0,R=R+Math.imul(K,De)|0,R=R+Math.imul(le,Pe)|0,H=H+Math.imul(le,De)|0;var Ll=(G+B|0)+((R&8191)<<13)|0;G=(H+(R>>>13)|0)+(Ll>>>26)|0,Ll&=67108863,B=Math.imul(Ee,Pe),R=Math.imul(Ee,De),R=R+Math.imul(we,Pe)|0,H=Math.imul(we,De);var pe=(G+B|0)+((R&8191)<<13)|0;return G=(H+(R>>>13)|0)+(pe>>>26)|0,pe&=67108863,U[0]=Pt,U[1]=Sr,U[2]=Mr,U[3]=un,U[4]=fn,U[5]=ri,U[6]=no,U[7]=Zi,U[8]=po,U[9]=sa,U[10]=Ca,U[11]=Jr,U[12]=Oi,U[13]=hi,U[14]=Bo,U[15]=ss,U[16]=Nl,U[17]=Ll,U[18]=pe,G!==0&&(U[19]=G,C.length++),C};Math.imul||(b=E);function w(D,y,S){S.negative=y.negative^D.negative,S.length=D.length+y.length;for(var C=0,M=0,k=0;k<S.length-1;k++){var U=M;M=0;for(var G=C&67108863,B=Math.min(k,y.length-1),R=Math.max(0,k-D.length+1);R<=B;R++){var H=k-R,q=D.words[H]|0,W=y.words[R]|0,Y=q*W,re=Y&67108863;U=U+(Y/67108864|0)|0,re=re+G|0,G=re&67108863,U=U+(re>>>26)|0,M+=U>>>26,U&=67108863}S.words[k]=G,C=U,U=M}return C!==0?S.words[k]=C:S.length--,S._strip()}function T(D,y,S){return w(D,y,S)}a.prototype.mulTo=function(y,S){var C,M=this.length+y.length;return this.length===10&&y.length===10?C=b(this,y,S):M<63?C=E(this,y,S):M<1024?C=w(this,y,S):C=T(this,y,S),C},a.prototype.mul=function(y){var S=new a(null);return S.words=new Array(this.length+y.length),this.mulTo(y,S)},a.prototype.mulf=function(y){var S=new a(null);return S.words=new Array(this.length+y.length),T(this,y,S)},a.prototype.imul=function(y){return this.clone().mulTo(y,this)},a.prototype.imuln=function(y){var S=y<0;S&&(y=-y),n(typeof y=="number"),n(y<67108864);for(var C=0,M=0;M<this.length;M++){var k=(this.words[M]|0)*y,U=(k&67108863)+(C&67108863);C>>=26,C+=k/67108864|0,C+=U>>>26,this.words[M]=U&67108863}return C!==0&&(this.words[M]=C,this.length++),S?this.ineg():this},a.prototype.muln=function(y){return this.clone().imuln(y)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(y){var S=m(y);if(S.length===0)return new a(1);for(var C=this,M=0;M<S.length&&S[M]===0;M++,C=C.sqr());if(++M<S.length)for(var k=C.sqr();M<S.length;M++,k=k.sqr())S[M]!==0&&(C=C.mul(k));return C},a.prototype.iushln=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26,M=67108863>>>26-S<<26-S,k;if(S!==0){var U=0;for(k=0;k<this.length;k++){var G=this.words[k]&M,B=(this.words[k]|0)-G<<S;this.words[k]=B|U,U=G>>>26-S}U&&(this.words[k]=U,this.length++)}if(C!==0){for(k=this.length-1;k>=0;k--)this.words[k+C]=this.words[k];for(k=0;k<C;k++)this.words[k]=0;this.length+=C}return this._strip()},a.prototype.ishln=function(y){return n(this.negative===0),this.iushln(y)},a.prototype.iushrn=function(y,S,C){n(typeof y=="number"&&y>=0);var M;S?M=(S-S%26)/26:M=0;var k=y%26,U=Math.min((y-k)/26,this.length),G=67108863^67108863>>>k<<k,B=C;if(M-=U,M=Math.max(0,M),B){for(var R=0;R<U;R++)B.words[R]=this.words[R];B.length=U}if(U!==0)if(this.length>U)for(this.length-=U,R=0;R<this.length;R++)this.words[R]=this.words[R+U];else this.words[0]=0,this.length=1;var H=0;for(R=this.length-1;R>=0&&(H!==0||R>=M);R--){var q=this.words[R]|0;this.words[R]=H<<26-k|q>>>k,H=q&G}return B&&H!==0&&(B.words[B.length++]=H),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(y,S,C){return n(this.negative===0),this.iushrn(y,S,C)},a.prototype.shln=function(y){return this.clone().ishln(y)},a.prototype.ushln=function(y){return this.clone().iushln(y)},a.prototype.shrn=function(y){return this.clone().ishrn(y)},a.prototype.ushrn=function(y){return this.clone().iushrn(y)},a.prototype.testn=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26,M=1<<S;if(this.length<=C)return!1;var k=this.words[C];return!!(k&M)},a.prototype.imaskn=function(y){n(typeof y=="number"&&y>=0);var S=y%26,C=(y-S)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=C)return this;if(S!==0&&C++,this.length=Math.min(C,this.length),S!==0){var M=67108863^67108863>>>S<<S;this.words[this.length-1]&=M}return this._strip()},a.prototype.maskn=function(y){return this.clone().imaskn(y)},a.prototype.iaddn=function(y){return n(typeof y=="number"),n(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<=y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},a.prototype._iaddn=function(y){this.words[0]+=y;for(var S=0;S<this.length&&this.words[S]>=67108864;S++)this.words[S]-=67108864,S===this.length-1?this.words[S+1]=1:this.words[S+1]++;return this.length=Math.max(this.length,S+1),this},a.prototype.isubn=function(y){if(n(typeof y=="number"),n(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var S=0;S<this.length&&this.words[S]<0;S++)this.words[S]+=67108864,this.words[S+1]-=1;return this._strip()},a.prototype.addn=function(y){return this.clone().iaddn(y)},a.prototype.subn=function(y){return this.clone().isubn(y)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(y,S,C){var M=y.length+C,k;this._expand(M);var U,G=0;for(k=0;k<y.length;k++){U=(this.words[k+C]|0)+G;var B=(y.words[k]|0)*S;U-=B&67108863,G=(U>>26)-(B/67108864|0),this.words[k+C]=U&67108863}for(;k<this.length-C;k++)U=(this.words[k+C]|0)+G,G=U>>26,this.words[k+C]=U&67108863;if(G===0)return this._strip();for(n(G===-1),G=0,k=0;k<this.length;k++)U=-(this.words[k]|0)+G,G=U>>26,this.words[k]=U&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(y,S){var C=this.length-y.length,M=this.clone(),k=y,U=k.words[k.length-1]|0,G=this._countBits(U);C=26-G,C!==0&&(k=k.ushln(C),M.iushln(C),U=k.words[k.length-1]|0);var B=M.length-k.length,R;if(S!=="mod"){R=new a(null),R.length=B+1,R.words=new Array(R.length);for(var H=0;H<R.length;H++)R.words[H]=0}var q=M.clone()._ishlnsubmul(k,1,B);q.negative===0&&(M=q,R&&(R.words[B]=1));for(var W=B-1;W>=0;W--){var Y=(M.words[k.length+W]|0)*67108864+(M.words[k.length+W-1]|0);for(Y=Math.min(Y/U|0,67108863),M._ishlnsubmul(k,Y,W);M.negative!==0;)Y--,M.negative=0,M._ishlnsubmul(k,1,W),M.isZero()||(M.negative^=1);R&&(R.words[W]=Y)}return R&&R._strip(),M._strip(),S!=="div"&&C!==0&&M.iushrn(C),{div:R||null,mod:M}},a.prototype.divmod=function(y,S,C){if(n(!y.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var M,k,U;return this.negative!==0&&y.negative===0?(U=this.neg().divmod(y,S),S!=="mod"&&(M=U.div.neg()),S!=="div"&&(k=U.mod.neg(),C&&k.negative!==0&&k.iadd(y)),{div:M,mod:k}):this.negative===0&&y.negative!==0?(U=this.divmod(y.neg(),S),S!=="mod"&&(M=U.div.neg()),{div:M,mod:U.mod}):this.negative&y.negative?(U=this.neg().divmod(y.neg(),S),S!=="div"&&(k=U.mod.neg(),C&&k.negative!==0&&k.isub(y)),{div:U.div,mod:k}):y.length>this.length||this.cmp(y)<0?{div:new a(0),mod:this}:y.length===1?S==="div"?{div:this.divn(y.words[0]),mod:null}:S==="mod"?{div:null,mod:new a(this.modrn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new a(this.modrn(y.words[0]))}:this._wordDiv(y,S)},a.prototype.div=function(y){return this.divmod(y,"div",!1).div},a.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},a.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},a.prototype.divRound=function(y){var S=this.divmod(y);if(S.mod.isZero())return S.div;var C=S.div.negative!==0?S.mod.isub(y):S.mod,M=y.ushrn(1),k=y.andln(1),U=C.cmp(M);return U<0||k===1&&U===0?S.div:S.div.negative!==0?S.div.isubn(1):S.div.iaddn(1)},a.prototype.modrn=function(y){var S=y<0;S&&(y=-y),n(y<=67108863);for(var C=(1<<26)%y,M=0,k=this.length-1;k>=0;k--)M=(C*M+(this.words[k]|0))%y;return S?-M:M},a.prototype.modn=function(y){return this.modrn(y)},a.prototype.idivn=function(y){var S=y<0;S&&(y=-y),n(y<=67108863);for(var C=0,M=this.length-1;M>=0;M--){var k=(this.words[M]|0)+C*67108864;this.words[M]=k/y|0,C=k%y}return this._strip(),S?this.ineg():this},a.prototype.divn=function(y){return this.clone().idivn(y)},a.prototype.egcd=function(y){n(y.negative===0),n(!y.isZero());var S=this,C=y.clone();S.negative!==0?S=S.umod(y):S=S.clone();for(var M=new a(1),k=new a(0),U=new a(0),G=new a(1),B=0;S.isEven()&&C.isEven();)S.iushrn(1),C.iushrn(1),++B;for(var R=C.clone(),H=S.clone();!S.isZero();){for(var q=0,W=1;!(S.words[0]&W)&&q<26;++q,W<<=1);if(q>0)for(S.iushrn(q);q-- >0;)(M.isOdd()||k.isOdd())&&(M.iadd(R),k.isub(H)),M.iushrn(1),k.iushrn(1);for(var Y=0,re=1;!(C.words[0]&re)&&Y<26;++Y,re<<=1);if(Y>0)for(C.iushrn(Y);Y-- >0;)(U.isOdd()||G.isOdd())&&(U.iadd(R),G.isub(H)),U.iushrn(1),G.iushrn(1);S.cmp(C)>=0?(S.isub(C),M.isub(U),k.isub(G)):(C.isub(S),U.isub(M),G.isub(k))}return{a:U,b:G,gcd:C.iushln(B)}},a.prototype._invmp=function(y){n(y.negative===0),n(!y.isZero());var S=this,C=y.clone();S.negative!==0?S=S.umod(y):S=S.clone();for(var M=new a(1),k=new a(0),U=C.clone();S.cmpn(1)>0&&C.cmpn(1)>0;){for(var G=0,B=1;!(S.words[0]&B)&&G<26;++G,B<<=1);if(G>0)for(S.iushrn(G);G-- >0;)M.isOdd()&&M.iadd(U),M.iushrn(1);for(var R=0,H=1;!(C.words[0]&H)&&R<26;++R,H<<=1);if(R>0)for(C.iushrn(R);R-- >0;)k.isOdd()&&k.iadd(U),k.iushrn(1);S.cmp(C)>=0?(S.isub(C),M.isub(k)):(C.isub(S),k.isub(M))}var q;return S.cmpn(1)===0?q=M:q=k,q.cmpn(0)<0&&q.iadd(y),q},a.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var S=this.clone(),C=y.clone();S.negative=0,C.negative=0;for(var M=0;S.isEven()&&C.isEven();M++)S.iushrn(1),C.iushrn(1);do{for(;S.isEven();)S.iushrn(1);for(;C.isEven();)C.iushrn(1);var k=S.cmp(C);if(k<0){var U=S;S=C,C=U}else if(k===0||C.cmpn(1)===0)break;S.isub(C)}while(!0);return C.iushln(M)},a.prototype.invm=function(y){return this.egcd(y).a.umod(y)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(y){return this.words[0]&y},a.prototype.bincn=function(y){n(typeof y=="number");var S=y%26,C=(y-S)/26,M=1<<S;if(this.length<=C)return this._expand(C+1),this.words[C]|=M,this;for(var k=M,U=C;k!==0&&U<this.length;U++){var G=this.words[U]|0;G+=k,k=G>>>26,G&=67108863,this.words[U]=G}return k!==0&&(this.words[U]=k,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(y){var S=y<0;if(this.negative!==0&&!S)return-1;if(this.negative===0&&S)return 1;this._strip();var C;if(this.length>1)C=1;else{S&&(y=-y),n(y<=67108863,"Number is too big");var M=this.words[0]|0;C=M===y?0:M<y?-1:1}return this.negative!==0?-C|0:C},a.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var S=this.ucmp(y);return this.negative!==0?-S|0:S},a.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var S=0,C=this.length-1;C>=0;C--){var M=this.words[C]|0,k=y.words[C]|0;if(M!==k){M<k?S=-1:M>k&&(S=1);break}}return S},a.prototype.gtn=function(y){return this.cmpn(y)===1},a.prototype.gt=function(y){return this.cmp(y)===1},a.prototype.gten=function(y){return this.cmpn(y)>=0},a.prototype.gte=function(y){return this.cmp(y)>=0},a.prototype.ltn=function(y){return this.cmpn(y)===-1},a.prototype.lt=function(y){return this.cmp(y)===-1},a.prototype.lten=function(y){return this.cmpn(y)<=0},a.prototype.lte=function(y){return this.cmp(y)<=0},a.prototype.eqn=function(y){return this.cmpn(y)===0},a.prototype.eq=function(y){return this.cmp(y)===0},a.red=function(y){return new $(y)},a.prototype.toRed=function(y){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(y){return this.red=y,this},a.prototype.forceRed=function(y){return n(!this.red,"Already a number in reduction context"),this._forceRed(y)},a.prototype.redAdd=function(y){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},a.prototype.redIAdd=function(y){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},a.prototype.redSub=function(y){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},a.prototype.redISub=function(y){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},a.prototype.redShl=function(y){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},a.prototype.redMul=function(y){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},a.prototype.redIMul=function(y){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(y){return n(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var x={k256:null,p224:null,p192:null,p25519:null};function N(D,y){this.name=D,this.p=new a(y,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var y=new a(null);return y.words=new Array(Math.ceil(this.n/13)),y},N.prototype.ireduce=function(y){var S=y,C;do this.split(S,this.tmp),S=this.imulK(S),S=S.iadd(this.tmp),C=S.bitLength();while(C>this.n);var M=C<this.n?-1:S.ucmp(this.p);return M===0?(S.words[0]=0,S.length=1):M>0?S.isub(this.p):S.strip!==void 0?S.strip():S._strip(),S},N.prototype.split=function(y,S){y.iushrn(this.n,0,S)},N.prototype.imulK=function(y){return y.imul(this.k)};function A(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(A,N),A.prototype.split=function(y,S){for(var C=4194303,M=Math.min(y.length,9),k=0;k<M;k++)S.words[k]=y.words[k];if(S.length=M,y.length<=9){y.words[0]=0,y.length=1;return}var U=y.words[9];for(S.words[S.length++]=U&C,k=10;k<y.length;k++){var G=y.words[k]|0;y.words[k-10]=(G&C)<<4|U>>>22,U=G}U>>>=22,y.words[k-10]=U,U===0&&y.length>10?y.length-=10:y.length-=9},A.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var S=0,C=0;C<y.length;C++){var M=y.words[C]|0;S+=M*977,y.words[C]=S&67108863,S=M*64+(S/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function L(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(L,N);function O(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(O,N);function I(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(I,N),I.prototype.imulK=function(y){for(var S=0,C=0;C<y.length;C++){var M=(y.words[C]|0)*19+S,k=M&67108863;M>>>=26,y.words[C]=k,S=M}return S!==0&&(y.words[y.length++]=S),y},a._prime=function(y){if(x[y])return x[y];var S;if(y==="k256")S=new A;else if(y==="p224")S=new L;else if(y==="p192")S=new O;else if(y==="p25519")S=new I;else throw new Error("Unknown prime "+y);return x[y]=S,S};function $(D){if(typeof D=="string"){var y=a._prime(D);this.m=y.p,this.prime=y}else n(D.gtn(1),"modulus must be greater than 1"),this.m=D,this.prime=null}$.prototype._verify1=function(y){n(y.negative===0,"red works only with positives"),n(y.red,"red works only with red numbers")},$.prototype._verify2=function(y,S){n((y.negative|S.negative)===0,"red works only with positives"),n(y.red&&y.red===S.red,"red works only with red numbers")},$.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):(c(y,y.umod(this.m)._forceRed(this)),y)},$.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},$.prototype.add=function(y,S){this._verify2(y,S);var C=y.add(S);return C.cmp(this.m)>=0&&C.isub(this.m),C._forceRed(this)},$.prototype.iadd=function(y,S){this._verify2(y,S);var C=y.iadd(S);return C.cmp(this.m)>=0&&C.isub(this.m),C},$.prototype.sub=function(y,S){this._verify2(y,S);var C=y.sub(S);return C.cmpn(0)<0&&C.iadd(this.m),C._forceRed(this)},$.prototype.isub=function(y,S){this._verify2(y,S);var C=y.isub(S);return C.cmpn(0)<0&&C.iadd(this.m),C},$.prototype.shl=function(y,S){return this._verify1(y),this.imod(y.ushln(S))},$.prototype.imul=function(y,S){return this._verify2(y,S),this.imod(y.imul(S))},$.prototype.mul=function(y,S){return this._verify2(y,S),this.imod(y.mul(S))},$.prototype.isqr=function(y){return this.imul(y,y.clone())},$.prototype.sqr=function(y){return this.mul(y,y)},$.prototype.sqrt=function(y){if(y.isZero())return y.clone();var S=this.m.andln(3);if(n(S%2===1),S===3){var C=this.m.add(new a(1)).iushrn(2);return this.pow(y,C)}for(var M=this.m.subn(1),k=0;!M.isZero()&&M.andln(1)===0;)k++,M.iushrn(1);n(!M.isZero());var U=new a(1).toRed(this),G=U.redNeg(),B=this.m.subn(1).iushrn(1),R=this.m.bitLength();for(R=new a(2*R*R).toRed(this);this.pow(R,B).cmp(G)!==0;)R.redIAdd(G);for(var H=this.pow(R,M),q=this.pow(y,M.addn(1).iushrn(1)),W=this.pow(y,M),Y=k;W.cmp(U)!==0;){for(var re=W,Q=0;re.cmp(U)!==0;Q++)re=re.redSqr();n(Q<Y);var ie=this.pow(H,new a(1).iushln(Y-Q-1));q=q.redMul(ie),H=ie.redSqr(),W=W.redMul(H),Y=Q}return q},$.prototype.invm=function(y){var S=y._invmp(this.m);return S.negative!==0?(S.negative=0,this.imod(S).redNeg()):this.imod(S)},$.prototype.pow=function(y,S){if(S.isZero())return new a(1).toRed(this);if(S.cmpn(1)===0)return y.clone();var C=4,M=new Array(1<<C);M[0]=new a(1).toRed(this),M[1]=y;for(var k=2;k<M.length;k++)M[k]=this.mul(M[k-1],y);var U=M[0],G=0,B=0,R=S.bitLength()%26;for(R===0&&(R=26),k=S.length-1;k>=0;k--){for(var H=S.words[k],q=R-1;q>=0;q--){var W=H>>q&1;if(U!==M[0]&&(U=this.sqr(U)),W===0&&G===0){B=0;continue}G<<=1,G|=W,B++,!(B!==C&&(k!==0||q!==0))&&(U=this.mul(U,M[G]),B=0,G=0)}R=26}return U},$.prototype.convertTo=function(y){var S=y.umod(this.m);return S===y?S.clone():S},$.prototype.convertFrom=function(y){var S=y.clone();return S.red=null,S},a.mont=function(y){return new F(y)};function F(D){$.call(this,D),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(F,$),F.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},F.prototype.convertFrom=function(y){var S=this.imod(y.mul(this.rinv));return S.red=null,S},F.prototype.imul=function(y,S){if(y.isZero()||S.isZero())return y.words[0]=0,y.length=1,y;var C=y.imul(S),M=C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=C.isub(M).iushrn(this.shift),U=k;return k.cmp(this.m)>=0?U=k.isub(this.m):k.cmpn(0)<0&&(U=k.iadd(this.m)),U._forceRed(this)},F.prototype.mul=function(y,S){if(y.isZero()||S.isZero())return new a(0)._forceRed(this);var C=y.mul(S),M=C.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),k=C.isub(M).iushrn(this.shift),U=k;return k.cmp(this.m)>=0?U=k.isub(this.m):k.cmpn(0)<0&&(U=k.iadd(this.m)),U._forceRed(this)},F.prototype.invm=function(y){var S=this.imod(y._invmp(this.m).mul(this.r2));return S._forceRed(this)}})(e,gt)})(v2e);var qMt=v2e.exports;const ai=Nn(qMt);var jXe={},Xi={},RM=zXe;function zXe(e,t){if(!e)throw new Error(t||"Assertion failed")}zXe.equal=function(t,r,n){if(t!=r)throw new Error(n||"Assertion failed: "+t+" != "+r)};var She={exports:{}};typeof Object.create=="function"?She.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:She.exports=function(t,r){if(r){t.super_=r;var n=function(){};n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}};var F0=She.exports,XMt=RM,KMt=F0;Xi.inherits=KMt;function ZMt(e,t){return(e.charCodeAt(t)&64512)!==55296||t<0||t+1>=e.length?!1:(e.charCodeAt(t+1)&64512)===56320}function QMt(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e=="string")if(t){if(t==="hex")for(e=e.replace(/[^a-z0-9]+/ig,""),e.length%2!==0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=a&63|128):ZMt(e,i)?(a=65536+((a&1023)<<10)+(e.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i<e.length;i++)r[i]=e[i]|0;return r}Xi.toArray=QMt;function JMt(e){for(var t="",r=0;r<e.length;r++)t+=qXe(e[r].toString(16));return t}Xi.toHex=JMt;function YXe(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}Xi.htonl=YXe;function eDt(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];t==="little"&&(i=YXe(i)),r+=XXe(i.toString(16))}return r}Xi.toHex32=eDt;function qXe(e){return e.length===1?"0"+e:e}Xi.zero2=qXe;function XXe(e){return e.length===7?"0"+e:e.length===6?"00"+e:e.length===5?"000"+e:e.length===4?"0000"+e:e.length===3?"00000"+e:e.length===2?"000000"+e:e.length===1?"0000000"+e:e}Xi.zero8=XXe;function tDt(e,t,r,n){var i=r-t;XMt(i%4===0);for(var a=new Array(i/4),o=0,s=t;o<a.length;o++,s+=4){var l;n==="big"?l=e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3]:l=e[s+3]<<24|e[s+2]<<16|e[s+1]<<8|e[s],a[o]=l>>>0}return a}Xi.join32=tDt;function rDt(e,t){for(var r=new Array(e.length*4),n=0,i=0;n<e.length;n++,i+=4){var a=e[n];t==="big"?(r[i]=a>>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}Xi.split32=rDt;function nDt(e,t){return e>>>t|e<<32-t}Xi.rotr32=nDt;function iDt(e,t){return e<<t|e>>>32-t}Xi.rotl32=iDt;function aDt(e,t){return e+t>>>0}Xi.sum32=aDt;function oDt(e,t,r){return e+t+r>>>0}Xi.sum32_3=oDt;function sDt(e,t,r,n){return e+t+r+n>>>0}Xi.sum32_4=sDt;function lDt(e,t,r,n,i){return e+t+r+n+i>>>0}Xi.sum32_5=lDt;function uDt(e,t,r,n){var i=e[t],a=e[t+1],o=n+a>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o}Xi.sum64=uDt;function cDt(e,t,r,n){var i=t+n>>>0,a=(i<t?1:0)+e+r;return a>>>0}Xi.sum64_hi=cDt;function fDt(e,t,r,n){var i=t+n;return i>>>0}Xi.sum64_lo=fDt;function dDt(e,t,r,n,i,a,o,s){var l=0,u=t;u=u+n>>>0,l+=u<t?1:0,u=u+a>>>0,l+=u<a?1:0,u=u+s>>>0,l+=u<s?1:0;var c=e+r+i+o+l;return c>>>0}Xi.sum64_4_hi=dDt;function hDt(e,t,r,n,i,a,o,s){var l=t+n+a+s;return l>>>0}Xi.sum64_4_lo=hDt;function pDt(e,t,r,n,i,a,o,s,l,u){var c=0,f=t;f=f+n>>>0,c+=f<t?1:0,f=f+a>>>0,c+=f<a?1:0,f=f+s>>>0,c+=f<s?1:0,f=f+u>>>0,c+=f<u?1:0;var d=e+r+i+o+l+c;return d>>>0}Xi.sum64_5_hi=pDt;function vDt(e,t,r,n,i,a,o,s,l,u){var c=t+n+a+s+u;return c>>>0}Xi.sum64_5_lo=vDt;function gDt(e,t,r){var n=t<<32-r|e>>>r;return n>>>0}Xi.rotr64_hi=gDt;function mDt(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}Xi.rotr64_lo=mDt;function yDt(e,t,r){return e>>>r}Xi.shr64_hi=yDt;function EDt(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}Xi.shr64_lo=EDt;var SR={},bxe=Xi,bDt=RM;function qj(){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}SR.BlockHash=qj;qj.prototype.update=function(t,r){if(t=bxe.toArray(t,r),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var n=t.length%this._delta8;this.pending=t.slice(t.length-n,t.length),this.pending.length===0&&(this.pending=null),t=bxe.join32(t,0,t.length-n,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this};qj.prototype.digest=function(t){return this.update(this._pad()),bDt(this.pending===null),this._digest(t)};qj.prototype._pad=function(){var t=this.pendingTotal,r=this._delta8,n=r-(t+this.padLength)%r,i=new Array(n+this.padLength);i[0]=128;for(var a=1;a<n;a++)i[a]=0;if(t<<=3,this.endian==="big"){for(var o=8;o<this.padLength;o++)i[a++]=0;i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=t>>>24&255,i[a++]=t>>>16&255,i[a++]=t>>>8&255,i[a++]=t&255}else for(i[a++]=t&255,i[a++]=t>>>8&255,i[a++]=t>>>16&255,i[a++]=t>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,o=8;o<this.padLength;o++)i[a++]=0;return i};var wR={},Lg={},_Dt=Xi,q1=_Dt.rotr32;function SDt(e,t,r,n){if(e===0)return KXe(t,r,n);if(e===1||e===3)return QXe(t,r,n);if(e===2)return ZXe(t,r,n)}Lg.ft_1=SDt;function KXe(e,t,r){return e&t^~e&r}Lg.ch32=KXe;function ZXe(e,t,r){return e&t^e&r^t&r}Lg.maj32=ZXe;function QXe(e,t,r){return e^t^r}Lg.p32=QXe;function wDt(e){return q1(e,2)^q1(e,13)^q1(e,22)}Lg.s0_256=wDt;function TDt(e){return q1(e,6)^q1(e,11)^q1(e,25)}Lg.s1_256=TDt;function ADt(e){return q1(e,7)^q1(e,18)^e>>>3}Lg.g0_256=ADt;function CDt(e){return q1(e,17)^q1(e,19)^e>>>10}Lg.g1_256=CDt;var lx=Xi,xDt=SR,RDt=Lg,xie=lx.rotl32,d8=lx.sum32,IDt=lx.sum32_5,ODt=RDt.ft_1,JXe=xDt.BlockHash,NDt=[1518500249,1859775393,2400959708,3395469782];function _g(){if(!(this instanceof _g))return new _g;JXe.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}lx.inherits(_g,JXe);var LDt=_g;_g.blockSize=512;_g.outSize=160;_g.hmacStrength=80;_g.padLength=64;_g.prototype._update=function(t,r){for(var n=this.W,i=0;i<16;i++)n[i]=t[r+i];for(;i<n.length;i++)n[i]=xie(n[i-3]^n[i-8]^n[i-14]^n[i-16],1);var a=this.h[0],o=this.h[1],s=this.h[2],l=this.h[3],u=this.h[4];for(i=0;i<n.length;i++){var c=~~(i/20),f=IDt(xie(a,5),ODt(c,o,s,l),u,n[i],NDt[c]);u=l,l=s,s=xie(o,30),o=a,a=f}this.h[0]=d8(this.h[0],a),this.h[1]=d8(this.h[1],o),this.h[2]=d8(this.h[2],s),this.h[3]=d8(this.h[3],l),this.h[4]=d8(this.h[4],u)};_g.prototype._digest=function(t){return t==="hex"?lx.toHex32(this.h,"big"):lx.split32(this.h,"big")};var ux=Xi,PDt=SR,TR=Lg,MDt=RM,_p=ux.sum32,DDt=ux.sum32_4,$Dt=ux.sum32_5,kDt=TR.ch32,BDt=TR.maj32,UDt=TR.s0_256,FDt=TR.s1_256,HDt=TR.g0_256,GDt=TR.g1_256,eKe=PDt.BlockHash,VDt=[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 Sg(){if(!(this instanceof Sg))return new Sg;eKe.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=VDt,this.W=new Array(64)}ux.inherits(Sg,eKe);var tKe=Sg;Sg.blockSize=512;Sg.outSize=256;Sg.hmacStrength=192;Sg.padLength=64;Sg.prototype._update=function(t,r){for(var n=this.W,i=0;i<16;i++)n[i]=t[r+i];for(;i<n.length;i++)n[i]=DDt(GDt(n[i-2]),n[i-7],HDt(n[i-15]),n[i-16]);var a=this.h[0],o=this.h[1],s=this.h[2],l=this.h[3],u=this.h[4],c=this.h[5],f=this.h[6],d=this.h[7];for(MDt(this.k.length===n.length),i=0;i<n.length;i++){var h=$Dt(d,FDt(u),kDt(u,c,f),this.k[i],n[i]),p=_p(UDt(a),BDt(a,o,s));d=f,f=c,c=u,u=_p(l,h),l=s,s=o,o=a,a=_p(h,p)}this.h[0]=_p(this.h[0],a),this.h[1]=_p(this.h[1],o),this.h[2]=_p(this.h[2],s),this.h[3]=_p(this.h[3],l),this.h[4]=_p(this.h[4],u),this.h[5]=_p(this.h[5],c),this.h[6]=_p(this.h[6],f),this.h[7]=_p(this.h[7],d)};Sg.prototype._digest=function(t){return t==="hex"?ux.toHex32(this.h,"big"):ux.split32(this.h,"big")};var whe=Xi,rKe=tKe;function $y(){if(!(this instanceof $y))return new $y;rKe.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}whe.inherits($y,rKe);var WDt=$y;$y.blockSize=512;$y.outSize=224;$y.hmacStrength=192;$y.padLength=64;$y.prototype._digest=function(t){return t==="hex"?whe.toHex32(this.h.slice(0,7),"big"):whe.split32(this.h.slice(0,7),"big")};var Ad=Xi,jDt=SR,zDt=RM,X1=Ad.rotr64_hi,K1=Ad.rotr64_lo,nKe=Ad.shr64_hi,iKe=Ad.shr64_lo,N2=Ad.sum64,Rie=Ad.sum64_hi,Iie=Ad.sum64_lo,YDt=Ad.sum64_4_hi,qDt=Ad.sum64_4_lo,XDt=Ad.sum64_5_hi,KDt=Ad.sum64_5_lo,aKe=jDt.BlockHash,ZDt=[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 mv(){if(!(this instanceof mv))return new mv;aKe.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=ZDt,this.W=new Array(160)}Ad.inherits(mv,aKe);var oKe=mv;mv.blockSize=1024;mv.outSize=512;mv.hmacStrength=192;mv.padLength=128;mv.prototype._prepareBlock=function(t,r){for(var n=this.W,i=0;i<32;i++)n[i]=t[r+i];for(;i<n.length;i+=2){var a=l$t(n[i-4],n[i-3]),o=u$t(n[i-4],n[i-3]),s=n[i-14],l=n[i-13],u=o$t(n[i-30],n[i-29]),c=s$t(n[i-30],n[i-29]),f=n[i-32],d=n[i-31];n[i]=YDt(a,o,s,l,u,c,f,d),n[i+1]=qDt(a,o,s,l,u,c,f,d)}};mv.prototype._update=function(t,r){this._prepareBlock(t,r);var n=this.W,i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],l=this.h[4],u=this.h[5],c=this.h[6],f=this.h[7],d=this.h[8],h=this.h[9],p=this.h[10],g=this.h[11],m=this.h[12],E=this.h[13],b=this.h[14],w=this.h[15];zDt(this.k.length===n.length);for(var T=0;T<n.length;T+=2){var x=b,N=w,A=i$t(d,h),L=a$t(d,h),O=QDt(d,h,p,g,m),I=JDt(d,h,p,g,m,E),$=this.k[T],F=this.k[T+1],D=n[T],y=n[T+1],S=XDt(x,N,A,L,O,I,$,F,D,y),C=KDt(x,N,A,L,O,I,$,F,D,y);x=r$t(i,a),N=n$t(i,a),A=e$t(i,a,o,s,l),L=t$t(i,a,o,s,l,u);var M=Rie(x,N,A,L),k=Iie(x,N,A,L);b=m,w=E,m=p,E=g,p=d,g=h,d=Rie(c,f,S,C),h=Iie(f,f,S,C),c=l,f=u,l=o,u=s,o=i,s=a,i=Rie(S,C,M,k),a=Iie(S,C,M,k)}N2(this.h,0,i,a),N2(this.h,2,o,s),N2(this.h,4,l,u),N2(this.h,6,c,f),N2(this.h,8,d,h),N2(this.h,10,p,g),N2(this.h,12,m,E),N2(this.h,14,b,w)};mv.prototype._digest=function(t){return t==="hex"?Ad.toHex32(this.h,"big"):Ad.split32(this.h,"big")};function QDt(e,t,r,n,i){var a=e&r^~e&i;return a<0&&(a+=4294967296),a}function JDt(e,t,r,n,i,a){var o=t&n^~t&a;return o<0&&(o+=4294967296),o}function e$t(e,t,r,n,i){var a=e&r^e&i^r&i;return a<0&&(a+=4294967296),a}function t$t(e,t,r,n,i,a){var o=t&n^t&a^n&a;return o<0&&(o+=4294967296),o}function r$t(e,t){var r=X1(e,t,28),n=X1(t,e,2),i=X1(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}function n$t(e,t){var r=K1(e,t,28),n=K1(t,e,2),i=K1(t,e,7),a=r^n^i;return a<0&&(a+=4294967296),a}function i$t(e,t){var r=X1(e,t,14),n=X1(e,t,18),i=X1(t,e,9),a=r^n^i;return a<0&&(a+=4294967296),a}function a$t(e,t){var r=K1(e,t,14),n=K1(e,t,18),i=K1(t,e,9),a=r^n^i;return a<0&&(a+=4294967296),a}function o$t(e,t){var r=X1(e,t,1),n=X1(e,t,8),i=nKe(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}function s$t(e,t){var r=K1(e,t,1),n=K1(e,t,8),i=iKe(e,t,7),a=r^n^i;return a<0&&(a+=4294967296),a}function l$t(e,t){var r=X1(e,t,19),n=X1(t,e,29),i=nKe(e,t,6),a=r^n^i;return a<0&&(a+=4294967296),a}function u$t(e,t){var r=K1(e,t,19),n=K1(t,e,29),i=iKe(e,t,6),a=r^n^i;return a<0&&(a+=4294967296),a}var The=Xi,sKe=oKe;function ky(){if(!(this instanceof ky))return new ky;sKe.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}The.inherits(ky,sKe);var c$t=ky;ky.blockSize=1024;ky.outSize=384;ky.hmacStrength=192;ky.padLength=128;ky.prototype._digest=function(t){return t==="hex"?The.toHex32(this.h.slice(0,12),"big"):The.split32(this.h.slice(0,12),"big")};wR.sha1=LDt;wR.sha224=WDt;wR.sha256=tKe;wR.sha384=c$t;wR.sha512=oKe;var lKe={},wT=Xi,f$t=SR,k$=wT.rotl32,_xe=wT.sum32,h8=wT.sum32_3,Sxe=wT.sum32_4,uKe=f$t.BlockHash;function wg(){if(!(this instanceof wg))return new wg;uKe.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}wT.inherits(wg,uKe);lKe.ripemd160=wg;wg.blockSize=512;wg.outSize=160;wg.hmacStrength=192;wg.padLength=64;wg.prototype._update=function(t,r){for(var n=this.h[0],i=this.h[1],a=this.h[2],o=this.h[3],s=this.h[4],l=n,u=i,c=a,f=o,d=s,h=0;h<80;h++){var p=_xe(k$(Sxe(n,wxe(h,i,a,o),t[p$t[h]+r],d$t(h)),g$t[h]),s);n=s,s=o,o=k$(a,10),a=i,i=p,p=_xe(k$(Sxe(l,wxe(79-h,u,c,f),t[v$t[h]+r],h$t(h)),m$t[h]),d),l=d,d=f,f=k$(c,10),c=u,u=p}p=h8(this.h[1],a,f),this.h[1]=h8(this.h[2],o,d),this.h[2]=h8(this.h[3],s,l),this.h[3]=h8(this.h[4],n,u),this.h[4]=h8(this.h[0],i,c),this.h[0]=p};wg.prototype._digest=function(t){return t==="hex"?wT.toHex32(this.h,"little"):wT.split32(this.h,"little")};function wxe(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function d$t(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h$t(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var p$t=[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],v$t=[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],g$t=[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],m$t=[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],y$t=Xi,E$t=RM;function cx(e,t,r){if(!(this instanceof cx))return new cx(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(y$t.toArray(t,r))}var b$t=cx;cx.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),E$t(t.length<=this.blockSize);for(var r=t.length;r<this.blockSize;r++)t.push(0);for(r=0;r<t.length;r++)t[r]^=54;for(this.inner=new this.Hash().update(t),r=0;r<t.length;r++)t[r]^=106;this.outer=new this.Hash().update(t)};cx.prototype.update=function(t,r){return this.inner.update(t,r),this};cx.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)};(function(e){var t=e;t.utils=Xi,t.common=SR,t.sha=wR,t.ripemd=lKe,t.hmac=b$t,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160})(jXe);const fd=Nn(jXe);function AR(e,t,r){return r={path:t,exports:{},require:function(n,i){return _$t(n,i??r.path)}},e(r,r.exports),r.exports}function _$t(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var g2e=cKe;function cKe(e,t){if(!e)throw new Error(t||"Assertion failed")}cKe.equal=function(t,r,n){if(t!=r)throw new Error(n||"Assertion failed: "+t+" != "+r)};var zp=AR(function(e,t){var r=t;function n(o,s){if(Array.isArray(o))return o.slice();if(!o)return[];var l=[];if(typeof o!="string"){for(var u=0;u<o.length;u++)l[u]=o[u]|0;return l}if(s==="hex"){o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0&&(o="0"+o);for(var u=0;u<o.length;u+=2)l.push(parseInt(o[u]+o[u+1],16))}else for(var u=0;u<o.length;u++){var c=o.charCodeAt(u),f=c>>8,d=c&255;f?l.push(f,d):l.push(d)}return l}r.toArray=n;function i(o){return o.length===1?"0"+o:o}r.zero2=i;function a(o){for(var s="",l=0;l<o.length;l++)s+=i(o[l].toString(16));return s}r.toHex=a,r.encode=function(s,l){return l==="hex"?a(s):s}}),Ah=AR(function(e,t){var r=t;r.assert=g2e,r.toArray=zp.toArray,r.zero2=zp.zero2,r.toHex=zp.toHex,r.encode=zp.encode;function n(l,u,c){var f=new Array(Math.max(l.bitLength(),c)+1);f.fill(0);for(var d=1<<u+1,h=l.clone(),p=0;p<f.length;p++){var g,m=h.andln(d-1);h.isOdd()?(m>(d>>1)-1?g=(d>>1)-m:g=m,h.isubn(g)):g=0,f[p]=g,h.iushrn(1)}return f}r.getNAF=n;function i(l,u){var c=[[],[]];l=l.clone(),u=u.clone();for(var f=0,d=0,h;l.cmpn(-f)>0||u.cmpn(-d)>0;){var p=l.andln(3)+f&3,g=u.andln(3)+d&3;p===3&&(p=-1),g===3&&(g=-1);var m;p&1?(h=l.andln(7)+f&7,(h===3||h===5)&&g===2?m=-p:m=p):m=0,c[0].push(m);var E;g&1?(h=u.andln(7)+d&7,(h===3||h===5)&&p===2?E=-g:E=g):E=0,c[1].push(E),2*f===m+1&&(f=1-f),2*d===E+1&&(d=1-d),l.iushrn(1),u.iushrn(1)}return c}r.getJSF=i;function a(l,u,c){var f="_"+u;l.prototype[u]=function(){return this[f]!==void 0?this[f]:this[f]=c.call(this)}}r.cachedProperty=a;function o(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=o;function s(l){return new ai(l,"hex","le")}r.intFromLE=s}),gG=Ah.getNAF,S$t=Ah.getJSF,mG=Ah.assert;function y_(e,t){this.type=e,this.p=new ai(t.p,16),this.red=t.prime?ai.red(t.prime):ai.mont(this.p),this.zero=new ai(0).toRed(this.red),this.one=new ai(1).toRed(this.red),this.two=new ai(2).toRed(this.red),this.n=t.n&&new ai(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var 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 mA=y_;y_.prototype.point=function(){throw new Error("Not implemented")};y_.prototype.validate=function(){throw new Error("Not implemented")};y_.prototype._fixedNafMul=function(t,r){mG(t.precomputed);var n=t._getDoubles(),i=gG(r,1,this._bitLength),a=(1<<n.step+1)-(n.step%2===0?2:1);a/=3;var o=[],s,l;for(s=0;s<i.length;s+=n.step){l=0;for(var u=s+n.step-1;u>=s;u--)l=(l<<1)+i[u];o.push(l)}for(var c=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=a;d>0;d--){for(s=0;s<o.length;s++)l=o[s],l===d?f=f.mixedAdd(n.points[s]):l===-d&&(f=f.mixedAdd(n.points[s].neg()));c=c.add(f)}return c.toP()};y_.prototype._wnafMul=function(t,r){var n=4,i=t._getNAFPoints(n);n=i.wnd;for(var a=i.points,o=gG(r,n,this._bitLength),s=this.jpoint(null,null,null),l=o.length-1;l>=0;l--){for(var u=0;l>=0&&o[l]===0;l--)u++;if(l>=0&&u++,s=s.dblp(u),l<0)break;var c=o[l];mG(c!==0),t.type==="affine"?c>0?s=s.mixedAdd(a[c-1>>1]):s=s.mixedAdd(a[-c-1>>1].neg()):c>0?s=s.add(a[c-1>>1]):s=s.add(a[-c-1>>1].neg())}return t.type==="affine"?s.toP():s};y_.prototype._wnafMulAdd=function(t,r,n,i,a){var o=this._wnafT1,s=this._wnafT2,l=this._wnafT3,u=0,c,f,d;for(c=0;c<i;c++){d=r[c];var h=d._getNAFPoints(t);o[c]=h.wnd,s[c]=h.points}for(c=i-1;c>=1;c-=2){var p=c-1,g=c;if(o[p]!==1||o[g]!==1){l[p]=gG(n[p],o[p],this._bitLength),l[g]=gG(n[g],o[g],this._bitLength),u=Math.max(l[p].length,u),u=Math.max(l[g].length,u);continue}var m=[r[p],null,null,r[g]];r[p].y.cmp(r[g].y)===0?(m[1]=r[p].add(r[g]),m[2]=r[p].toJ().mixedAdd(r[g].neg())):r[p].y.cmp(r[g].y.redNeg())===0?(m[1]=r[p].toJ().mixedAdd(r[g]),m[2]=r[p].add(r[g].neg())):(m[1]=r[p].toJ().mixedAdd(r[g]),m[2]=r[p].toJ().mixedAdd(r[g].neg()));var E=[-3,-1,-5,-7,0,7,5,1,3],b=S$t(n[p],n[g]);for(u=Math.max(b[0].length,u),l[p]=new Array(u),l[g]=new Array(u),f=0;f<u;f++){var w=b[0][f]|0,T=b[1][f]|0;l[p][f]=E[(w+1)*3+(T+1)],l[g][f]=0,s[p]=m}}var x=this.jpoint(null,null,null),N=this._wnafT4;for(c=u;c>=0;c--){for(var A=0;c>=0;){var L=!0;for(f=0;f<i;f++)N[f]=l[f][c]|0,N[f]!==0&&(L=!1);if(!L)break;A++,c--}if(c>=0&&A++,x=x.dblp(A),c<0)break;for(f=0;f<i;f++){var O=N[f];O!==0&&(O>0?d=s[f][O-1>>1]:O<0&&(d=s[f][-O-1>>1].neg()),d.type==="affine"?x=x.mixedAdd(d):x=x.add(d))}}for(c=0;c<i;c++)s[c]=null;return a?x:x.toP()};function H0(e,t){this.curve=e,this.type=t,this.precomputed=null}y_.BasePoint=H0;H0.prototype.eq=function(){throw new Error("Not implemented")};H0.prototype.validate=function(){return this.curve.validate(this)};y_.prototype.decodePoint=function(t,r){t=Ah.toArray(t,r);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?mG(t[t.length-1]%2===0):t[0]===7&&mG(t[t.length-1]%2===1);var i=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return i}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")};H0.prototype.encodeCompressed=function(t){return this.encode(t,!0)};H0.prototype._encode=function(t){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))};H0.prototype.encode=function(t,r){return Ah.encode(this._encode(r),t)};H0.prototype.precompute=function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this};H0.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1};H0.prototype._getDoubles=function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a<r;a+=t){for(var o=0;o<t;o++)i=i.dbl();n.push(i)}return{step:t,points:n}};H0.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<t)-1,i=n===1?null:this.dbl(),a=1;a<n;a++)r[a]=r[a-1].add(i);return{wnd:t,points:r}};H0.prototype._getBeta=function(){return null};H0.prototype.dblp=function(t){for(var r=this,n=0;n<t;n++)r=r.dbl();return r};var m2e=AR(function(e){typeof Object.create=="function"?e.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(r,n){if(n){r.super_=n;var i=function(){};i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}}),w$t=Ah.assert;function G0(e){mA.call(this,"short",e),this.a=new ai(e.a,16).toRed(this.red),this.b=new ai(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}m2e(G0,mA);var T$t=G0;G0.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(t.beta)r=new ai(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(t.lambda)n=new ai(t.lambda,16);else{var a=this._getEndoRoots(this.n);this.g.mul(a[0]).x.cmp(this.g.x.redMul(r))===0?n=a[0]:(n=a[1],w$t(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var o;return t.basis?o=t.basis.map(function(s){return{a:new ai(s.a,16),b:new ai(s.b,16)}}):o=this._getEndoBasis(n),{beta:r,lambda:n,basis:o}}};G0.prototype._getEndoRoots=function(t){var r=t===this.p?this.red:ai.mont(t),n=new ai(2).toRed(r).redInvm(),i=n.redNeg(),a=new ai(3).toRed(r).redNeg().redSqrt().redMul(n),o=i.redAdd(a).fromRed(),s=i.redSub(a).fromRed();return[o,s]};G0.prototype._getEndoBasis=function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,i=this.n.clone(),a=new ai(1),o=new ai(0),s=new ai(0),l=new ai(1),u,c,f,d,h,p,g,m=0,E,b;n.cmpn(0)!==0;){var w=i.div(n);E=i.sub(w.mul(n)),b=s.sub(w.mul(a));var T=l.sub(w.mul(o));if(!f&&E.cmp(r)<0)u=g.neg(),c=a,f=E.neg(),d=b;else if(f&&++m===2)break;g=E,i=n,n=E,s=a,a=b,l=o,o=T}h=E.neg(),p=b;var x=f.sqr().add(d.sqr()),N=h.sqr().add(p.sqr());return N.cmp(x)>=0&&(h=u,p=c),f.negative&&(f=f.neg(),d=d.neg()),h.negative&&(h=h.neg(),p=p.neg()),[{a:f,b:d},{a:h,b:p}]};G0.prototype._endoSplit=function(t){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(t).divRound(this.n),o=n.b.neg().mul(t).divRound(this.n),s=a.mul(n.a),l=o.mul(i.a),u=a.mul(n.b),c=o.mul(i.b),f=t.sub(s).sub(l),d=u.add(c).neg();return{k1:f,k2:d}};G0.prototype.pointFromX=function(t,r){t=new ai(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(t,i)};G0.prototype.validate=function(t){if(t.inf)return!0;var r=t.x,n=t.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0};G0.prototype._endoWnafMulAdd=function(t,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(r[o]),l=t[o],u=l._getBeta();s.k1.negative&&(s.k1.ineg(),l=l.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),i[o*2]=l,i[o*2+1]=u,a[o*2]=s.k1,a[o*2+1]=s.k2}for(var c=this._wnafMulAdd(1,i,a,o*2,n),f=0;f<o*2;f++)i[f]=null,a[f]=null;return c};function wu(e,t,r,n){mA.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new ai(t,16),this.y=new ai(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)}m2e(wu,mA.BasePoint);G0.prototype.point=function(t,r,n){return new wu(this,t,r,n)};G0.prototype.pointFromJSON=function(t,r){return wu.fromJSON(this,t,r)};wu.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,i=function(a){return n.point(a.x.redMul(n.endo.beta),a.y)};t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return r}};wu.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]};wu.fromJSON=function(t,r,n){typeof r=="string"&&(r=JSON.parse(r));var i=t.point(r[0],r[1],n);if(!r[2])return i;function a(s){return t.point(s[0],s[1],n)}var o=r[2];return i.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[i].concat(o.doubles.points.map(a))},naf:o.naf&&{wnd:o.naf.wnd,points:[i].concat(o.naf.points.map(a))}},i};wu.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)+">"};wu.prototype.isInfinity=function(){return this.inf};wu.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(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(t.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};wu.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=t.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),o=a.redSqr().redISub(this.x.redAdd(this.x)),s=a.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)};wu.prototype.getX=function(){return this.x.fromRed()};wu.prototype.getY=function(){return this.y.fromRed()};wu.prototype.mul=function(t){return t=new ai(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)};wu.prototype.mulAdd=function(t,r,n){var i=[this,r],a=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)};wu.prototype.jmulAdd=function(t,r,n){var i=[this,r],a=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)};wu.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)};wu.prototype.neg=function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,i=function(a){return a.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};wu.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function cc(e,t,r,n){mA.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new ai(0)):(this.x=new ai(t,16),this.y=new ai(r,16),this.z=new ai(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}m2e(cc,mA.BasePoint);G0.prototype.jpoint=function(t,r,n){return new cc(this,t,r,n)};cc.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(t);return this.curve.point(n,i)};cc.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};cc.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=t.x.redMul(n),o=this.y.redMul(r.redMul(t.z)),s=t.y.redMul(n.redMul(this.z)),l=i.redSub(a),u=o.redSub(s);if(l.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=l.redSqr(),f=c.redMul(l),d=i.redMul(c),h=u.redSqr().redIAdd(f).redISub(d).redISub(d),p=u.redMul(d.redISub(h)).redISub(o.redMul(f)),g=this.z.redMul(t.z).redMul(l);return this.curve.jpoint(h,p,g)};cc.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=t.x.redMul(r),a=this.y,o=t.y.redMul(r).redMul(this.z),s=n.redSub(i),l=a.redSub(o);if(s.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),f=n.redMul(u),d=l.redSqr().redIAdd(c).redISub(f).redISub(f),h=l.redMul(f.redISub(d)).redISub(a.redMul(c)),p=this.z.redMul(s);return this.curve.jpoint(d,h,p)};cc.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<t;r++)n=n.dbl();return n}var i=this.curve.a,a=this.curve.tinv,o=this.x,s=this.y,l=this.z,u=l.redSqr().redSqr(),c=s.redAdd(s);for(r=0;r<t;r++){var f=o.redSqr(),d=c.redSqr(),h=d.redSqr(),p=f.redAdd(f).redIAdd(f).redIAdd(i.redMul(u)),g=o.redMul(d),m=p.redSqr().redISub(g.redAdd(g)),E=g.redISub(m),b=p.redMul(E);b=b.redIAdd(b).redISub(h);var w=c.redMul(l);r+1<t&&(u=u.redMul(h)),o=m,l=w,c=b}return this.curve.jpoint(o,c.redMul(a),l)};cc.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};cc.prototype._zeroDbl=function(){var t,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),o=a.redSqr(),s=this.x.redAdd(a).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var l=i.redAdd(i).redIAdd(i),u=l.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=c.redIAdd(c),c=c.redIAdd(c),t=u,r=l.redMul(s.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),p=this.x.redAdd(d).redSqr().redISub(f).redISub(h);p=p.redIAdd(p);var g=f.redAdd(f).redIAdd(f),m=g.redSqr(),E=h.redIAdd(h);E=E.redIAdd(E),E=E.redIAdd(E),t=m.redISub(p).redISub(p),r=g.redMul(p.redISub(t)).redISub(E),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,r,n)};cc.prototype._threeDbl=function(){var t,r,n;if(this.zOne){var i=this.x.redSqr(),a=this.y.redSqr(),o=a.redSqr(),s=this.x.redAdd(a).redSqr().redISub(i).redISub(o);s=s.redIAdd(s);var l=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),u=l.redSqr().redISub(s).redISub(s);t=u;var c=o.redIAdd(o);c=c.redIAdd(c),c=c.redIAdd(c),r=l.redMul(s.redISub(u)).redISub(c),n=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),p=this.x.redSub(f).redMul(this.x.redAdd(f));p=p.redAdd(p).redIAdd(p);var g=h.redIAdd(h);g=g.redIAdd(g);var m=g.redAdd(g);t=p.redSqr().redISub(m),n=this.y.redAdd(this.z).redSqr().redISub(d).redISub(f);var E=d.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E),r=p.redMul(g.redISub(t)).redISub(E)}return this.curve.jpoint(t,r,n)};cc.prototype._dbl=function(){var t=this.curve.a,r=this.x,n=this.y,i=this.z,a=i.redSqr().redSqr(),o=r.redSqr(),s=n.redSqr(),l=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(a)),u=r.redAdd(r);u=u.redIAdd(u);var c=u.redMul(s),f=l.redSqr().redISub(c.redAdd(c)),d=c.redISub(f),h=s.redSqr();h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var p=l.redMul(d).redISub(h),g=n.redAdd(n).redMul(i);return this.curve.jpoint(f,p,g)};cc.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),i=r.redSqr(),a=t.redAdd(t).redIAdd(t),o=a.redSqr(),s=this.x.redAdd(r).redSqr().redISub(t).redISub(i);s=s.redIAdd(s),s=s.redAdd(s).redIAdd(s),s=s.redISub(o);var l=s.redSqr(),u=i.redIAdd(i);u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u);var c=a.redIAdd(s).redSqr().redISub(o).redISub(l).redISub(u),f=r.redMul(c);f=f.redIAdd(f),f=f.redIAdd(f);var d=this.x.redMul(l).redISub(f);d=d.redIAdd(d),d=d.redIAdd(d);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(l)));h=h.redIAdd(h),h=h.redIAdd(h),h=h.redIAdd(h);var p=this.z.redAdd(s).redSqr().redISub(n).redISub(l);return this.curve.jpoint(d,h,p)};cc.prototype.mul=function(t,r){return t=new ai(t,r),this.curve._wnafMul(this,t)};cc.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),a=n.redMul(t.z);return this.y.redMul(a).redISub(t.y.redMul(i)).cmpn(0)===0};cc.prototype.eqXToP=function(t){var r=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var i=t.clone(),a=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}};cc.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)+">"};cc.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var cF=AR(function(e,t){var r=t;r.base=mA,r.short=T$t,r.mont=null,r.edwards=null}),fF=AR(function(e,t){var r=t,n=Ah.assert;function i(s){s.type==="short"?this.curve=new cF.short(s):s.type==="edwards"?this.curve=new cF.edwards(s):this.curve=new cF.mont(s),this.g=this.curve.g,this.n=this.curve.n,this.hash=s.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function a(s,l){Object.defineProperty(r,s,{configurable:!0,enumerable:!0,get:function(){var u=new i(l);return Object.defineProperty(r,s,{configurable:!0,enumerable:!0,value:u}),u}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:fd.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:fd.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:fd.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:fd.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:fd.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:fd.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:fd.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var o;try{o=null.crash()}catch{o=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:fd.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",o]})});function Ob(e){if(!(this instanceof Ob))return new Ob(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=zp.toArray(e.entropy,e.entropyEnc||"hex"),r=zp.toArray(e.nonce,e.nonceEnc||"hex"),n=zp.toArray(e.pers,e.persEnc||"hex");g2e(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var fKe=Ob;Ob.prototype._init=function(t,r,n){var i=t.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};Ob.prototype._hmac=function(){return new fd.hmac(this.hash,this.K)};Ob.prototype._update=function(t){var r=this._hmac().update(this.V).update([0]);t&&(r=r.update(t)),this.K=r.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())};Ob.prototype.reseed=function(t,r,n,i){typeof r!="string"&&(i=n,n=r,r=null),t=zp.toArray(t,r),n=zp.toArray(n,i),g2e(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1};Ob.prototype.generate=function(t,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=zp.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length<t;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var o=a.slice(0,t);return this._update(n),this._reseed++,zp.encode(o,r)};var Ahe=Ah.assert;function Bc(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var y2e=Bc;Bc.fromPublic=function(t,r,n){return r instanceof Bc?r:new Bc(t,{pub:r,pubEnc:n})};Bc.fromPrivate=function(t,r,n){return r instanceof Bc?r:new Bc(t,{priv:r,privEnc:n})};Bc.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"}};Bc.prototype.getPublic=function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub};Bc.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv};Bc.prototype._importPrivate=function(t,r){this.priv=new ai(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Bc.prototype._importPublic=function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?Ahe(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Ahe(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)};Bc.prototype.derive=function(t){return t.validate()||Ahe(t.validate(),"public point not validated"),t.mul(this.priv).getX()};Bc.prototype.sign=function(t,r,n){return this.ec.sign(t,this,r,n)};Bc.prototype.verify=function(t,r){return this.ec.verify(t,r,this)};Bc.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var A$t=Ah.assert;function Xj(e,t){if(e instanceof Xj)return e;this._importDER(e,t)||(A$t(e.r&&e.s,"Signature without r or s"),this.r=new ai(e.r,16),this.s=new ai(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Kj=Xj;function C$t(){this.place=0}function Oie(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,o=t.place;a<n;a++,o++)i<<=8,i|=e[o],i>>>=0;return i<=127?!1:(t.place=o,i)}function Txe(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}Xj.prototype._importDER=function(t,r){t=Ah.toArray(t,r);var n=new C$t;if(t[n.place++]!==48)return!1;var i=Oie(t,n);if(i===!1||i+n.place!==t.length||t[n.place++]!==2)return!1;var a=Oie(t,n);if(a===!1)return!1;var o=t.slice(n.place,a+n.place);if(n.place+=a,t[n.place++]!==2)return!1;var s=Oie(t,n);if(s===!1||t.length!==s+n.place)return!1;var l=t.slice(n.place,s+n.place);if(o[0]===0)if(o[1]&128)o=o.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new ai(o),this.s=new ai(l),this.recoveryParam=null,!0};function Nie(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}Xj.prototype.toDER=function(t){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Txe(r),n=Txe(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];Nie(i,r.length),i=i.concat(r),i.push(2),Nie(i,n.length);var a=i.concat(n),o=[48];return Nie(o,a.length),o=o.concat(a),Ah.encode(o,t)};var x$t=function(){throw new Error("unsupported")},dKe=Ah.assert;function A0(e){if(!(this instanceof A0))return new A0(e);typeof e=="string"&&(dKe(Object.prototype.hasOwnProperty.call(fF,e),"Unknown curve "+e),e=fF[e]),e instanceof fF.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var R$t=A0;A0.prototype.keyPair=function(t){return new y2e(this,t)};A0.prototype.keyFromPrivate=function(t,r){return y2e.fromPrivate(this,t,r)};A0.prototype.keyFromPublic=function(t,r){return y2e.fromPublic(this,t,r)};A0.prototype.genKeyPair=function(t){t||(t={});for(var r=new fKe({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||x$t(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new ai(2));;){var a=new ai(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}};A0.prototype._truncateToN=function(t,r){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t};A0.prototype.sign=function(t,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),t=this._truncateToN(new ai(t,16));for(var a=this.n.byteLength(),o=r.getPrivate().toArray("be",a),s=t.toArray("be",a),l=new fKe({hash:this.hash,entropy:o,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new ai(1)),c=0;;c++){var f=i.k?i.k(c):new ai(l.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(u)>=0)){var d=this.g.mul(f);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(p.cmpn(0)!==0){var g=f.invm(this.n).mul(p.mul(r.getPrivate()).iadd(t));if(g=g.umod(this.n),g.cmpn(0)!==0){var m=(d.getY().isOdd()?1:0)|(h.cmp(p)!==0?2:0);return i.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new Kj({r:p,s:g,recoveryParam:m})}}}}}};A0.prototype.verify=function(t,r,n,i){t=this._truncateToN(new ai(t,16)),n=this.keyFromPublic(n,i),r=new Kj(r,"hex");var a=r.r,o=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s=o.invm(this.n),l=s.mul(t).umod(this.n),u=s.mul(a).umod(this.n),c;return this.curve._maxwellTrick?(c=this.g.jmulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.eqXToP(a)):(c=this.g.mulAdd(l,n.getPublic(),u),c.isInfinity()?!1:c.getX().umod(this.n).cmp(a)===0)};A0.prototype.recoverPubKey=function(e,t,r,n){dKe((3&r)===r,"The recovery param is more than two bits"),t=new Kj(t,n);var i=this.n,a=new ai(e),o=t.r,s=t.s,l=r&1,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");u?o=this.curve.pointFromX(o.add(this.curve.n),l):o=this.curve.pointFromX(o,l);var c=t.r.invm(i),f=i.sub(a).mul(c).umod(i),d=s.mul(c).umod(i);return this.g.mulAdd(f,o,d)};A0.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new Kj(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var I$t=AR(function(e,t){var r=t;r.version="6.5.4",r.utils=Ah,r.rand=function(){throw new Error("unsupported")},r.curve=cF,r.curves=fF,r.ec=R$t,r.eddsa=null}),O$t=I$t.ec;const N$t="signing-key/5.7.0",Che=new Ne(N$t);let Lie=null;function v1(){return Lie||(Lie=new O$t("secp256k1")),Lie}class k3{constructor(t){at(this,"curve","secp256k1"),at(this,"privateKey",Xt(t)),Eg(this.privateKey)!==32&&Che.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=v1().keyFromPrivate($t(this.privateKey));at(this,"publicKey","0x"+r.getPublic(!1,"hex")),at(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),at(this,"_isSigningKey",!0)}_addPoint(t){const r=v1().keyFromPublic($t(this.publicKey)),n=v1().keyFromPublic($t(t));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(t){const r=v1().keyFromPrivate($t(this.privateKey)),n=$t(t);n.length!==32&&Che.throwArgumentError("bad digest length","digest",t);const i=r.sign(n,{canonical:!0});return hA({recoveryParam:i.recoveryParam,r:xo("0x"+i.r.toString(16),32),s:xo("0x"+i.s.toString(16),32)})}computeSharedSecret(t){const r=v1().keyFromPrivate($t(this.privateKey)),n=v1().keyFromPublic($t(E2e(t)));return xo("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function hKe(e,t){const r=hA(t),n={r:$t(r.r),s:$t(r.s)};return"0x"+v1().recoverPubKey($t(e),n,r.recoveryParam).encode("hex",!1)}function E2e(e,t){const r=$t(e);if(r.length===32){const n=new k3(r);return t?"0x"+v1().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return t?Xt(r):"0x"+v1().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return t?"0x"+v1().keyFromPublic(r).getPublic(!0,"hex"):Xt(r)}return Che.throwArgumentError("invalid public or private key","key","[REDACTED]")}const L$t="transactions/5.7.0",Oc=new Ne(L$t);var xhe;(function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"})(xhe||(xhe={}));function b2e(e){return e==="0x"?null:va(e)}function Rc(e){return e==="0x"?o2e:Bt.from(e)}const P$t=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],M$t={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function rb(e){const t=E2e(e);return va(nl(lo(nl(t,1)),12))}function IM(e,t){return rb(hKe($t(e),t))}function rh(e,t){const r=Y1(Bt.from(e).toHexString());return r.length>32&&Oc.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Pie(e,t){return{address:va(e),storageKeys:(t||[]).map((r,n)=>(Eg(r)!==32&&Oc.throwArgumentError("invalid access list storageKey",`accessList[${e}:${n}]`,r),r.toLowerCase()))}}function E_(e){if(Array.isArray(e))return e.map((r,n)=>Array.isArray(r)?(r.length>2&&Oc.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),Pie(r[0],r[1])):Pie(r.address,r.storageKeys));const t=Object.keys(e).map(r=>{const n=e[r].reduce((i,a)=>(i[a]=!0,i),{});return Pie(r,Object.keys(n).sort())});return t.sort((r,n)=>r.address.localeCompare(n.address)),t}function pKe(e){return E_(e).map(t=>[t.address,t.storageKeys])}function vKe(e,t){if(e.gasPrice!=null){const n=Bt.from(e.gasPrice),i=Bt.from(e.maxFeePerGas||0);n.eq(i)||Oc.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[rh(e.chainId||0,"chainId"),rh(e.nonce||0,"nonce"),rh(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),rh(e.maxFeePerGas||0,"maxFeePerGas"),rh(e.gasLimit||0,"gasLimit"),e.to!=null?va(e.to):"0x",rh(e.value||0,"value"),e.data||"0x",pKe(e.accessList||[])];if(t){const n=hA(t);r.push(rh(n.recoveryParam,"recoveryParam")),r.push(Y1(n.r)),r.push(Y1(n.s))}return Tf(["0x02",ST(r)])}function gKe(e,t){const r=[rh(e.chainId||0,"chainId"),rh(e.nonce||0,"nonce"),rh(e.gasPrice||0,"gasPrice"),rh(e.gasLimit||0,"gasLimit"),e.to!=null?va(e.to):"0x",rh(e.value||0,"value"),e.data||"0x",pKe(e.accessList||[])];if(t){const n=hA(t);r.push(rh(n.recoveryParam,"recoveryParam")),r.push(Y1(n.r)),r.push(Y1(n.s))}return Tf(["0x01",ST(r)])}function D$t(e,t){n2e(e,M$t);const r=[];P$t.forEach(function(o){let s=e[o.name]||[];const l={};o.numeric&&(l.hexPad="left"),s=$t(Xt(s,l)),o.length&&s.length!==o.length&&s.length>0&&Oc.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,s),o.maxLength&&(s=Y1(s),s.length>o.maxLength&&Oc.throwArgumentError("invalid length for "+o.name,"transaction:"+o.name,s)),r.push(Xt(s))});let n=0;if(e.chainId!=null?(n=e.chainId,typeof n!="number"&&Oc.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!AM(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),n!==0&&(r.push(Xt(n)),r.push("0x"),r.push("0x")),!t)return ST(r);const i=hA(t);let a=27+i.recoveryParam;return n!==0?(r.pop(),r.pop(),r.pop(),a+=n*2+8,i.v>28&&i.v!==a&&Oc.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==a&&Oc.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Xt(a)),r.push(Y1($t(i.r))),r.push(Y1($t(i.s))),ST(r)}function Rhe(e,t){if(e.type==null||e.type===0)return e.accessList!=null&&Oc.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),D$t(e,t);switch(e.type){case 1:return gKe(e,t);case 2:return vKe(e,t)}return Oc.throwError(`unsupported transaction type: ${e.type}`,Ne.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function mKe(e,t,r){try{const n=Rc(t[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");e.v=n}catch{Oc.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=xo(t[1],32),e.s=xo(t[2],32);try{const n=lo(r(e));e.from=IM(n,{r:e.r,s:e.s,recoveryParam:e.v})}catch{}}function $$t(e){const t=Wj(e.slice(1));t.length!==9&&t.length!==12&&Oc.throwArgumentError("invalid component count for transaction type: 2","payload",Xt(e));const r=Rc(t[2]),n=Rc(t[3]),i={type:2,chainId:Rc(t[0]).toNumber(),nonce:Rc(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Rc(t[4]),to:b2e(t[5]),value:Rc(t[6]),data:t[7],accessList:E_(t[8])};return t.length===9||(i.hash=lo(e),mKe(i,t.slice(9),vKe)),i}function k$t(e){const t=Wj(e.slice(1));t.length!==8&&t.length!==11&&Oc.throwArgumentError("invalid component count for transaction type: 1","payload",Xt(e));const r={type:1,chainId:Rc(t[0]).toNumber(),nonce:Rc(t[1]).toNumber(),gasPrice:Rc(t[2]),gasLimit:Rc(t[3]),to:b2e(t[4]),value:Rc(t[5]),data:t[6],accessList:E_(t[7])};return t.length===8||(r.hash=lo(e),mKe(r,t.slice(8),gKe)),r}function B$t(e){const t=Wj(e);t.length!==9&&t.length!==6&&Oc.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Rc(t[0]).toNumber(),gasPrice:Rc(t[1]),gasLimit:Rc(t[2]),to:b2e(t[3]),value:Rc(t[4]),data:t[5],chainId:0};if(t.length===6)return r;try{r.v=Bt.from(t[6]).toNumber()}catch{return r}if(r.r=xo(t[7],32),r.s=xo(t[8],32),Bt.from(r.r).isZero()&&Bt.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);r.chainId!==0&&(i.push(Xt(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const a=lo(ST(i));try{r.from=IM(a,{r:Xt(r.r),s:Xt(r.s),recoveryParam:n})}catch{}r.hash=lo(e)}return r.type=null,r}function yKe(e){const t=$t(e);if(t[0]>127)return B$t(t);switch(t[0]){case 1:return k$t(t);case 2:return $$t(t)}return Oc.throwError(`unsupported transaction type: ${t[0]}`,Ne.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}const U$t="contracts/5.7.0";var Nb=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const oo=new Ne(U$t),F$t={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function yG(e,t){return Nb(this,void 0,void 0,function*(){const r=yield t;typeof r!="string"&&oo.throwArgumentError("invalid address or ENS name","name",r);try{return va(r)}catch{}e||oo.throwError("a provider or signer is needed to resolve ENS names",Ne.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return n==null&&oo.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function VL(e,t,r){return Nb(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>VL(e,Array.isArray(t)?t[i]:t[n.name],n))):r.type==="address"?yield yG(e,t):r.type==="tuple"?yield VL(e,t,r.components):r.baseType==="array"?Array.isArray(t)?yield Promise.all(t.map(n=>VL(e,n,r.arrayChildren))):Promise.reject(oo.makeError("invalid value for array",Ne.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t})}function Zj(e,t,r){return Nb(this,void 0,void 0,function*(){let n={};r.length===t.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Do(r.pop())),oo.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=Ms({override:yG(e.signer,n.from),signer:e.signer.getAddress()}).then(u=>Nb(this,void 0,void 0,function*(){return va(u.signer)!==u.override&&oo.throwError("Contract with a Signer cannot override from",Ne.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),u.override})):n.from=e.signer.getAddress():n.from&&(n.from=yG(e.provider,n.from));const i=yield Ms({args:VL(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:Ms(n)||{}}),a=e.interface.encodeFunctionData(t,i.args),o={data:a,to:i.address},s=i.overrides;if(s.nonce!=null&&(o.nonce=Bt.from(s.nonce).toNumber()),s.gasLimit!=null&&(o.gasLimit=Bt.from(s.gasLimit)),s.gasPrice!=null&&(o.gasPrice=Bt.from(s.gasPrice)),s.maxFeePerGas!=null&&(o.maxFeePerGas=Bt.from(s.maxFeePerGas)),s.maxPriorityFeePerGas!=null&&(o.maxPriorityFeePerGas=Bt.from(s.maxPriorityFeePerGas)),s.from!=null&&(o.from=s.from),s.type!=null&&(o.type=s.type),s.accessList!=null&&(o.accessList=E_(s.accessList)),o.gasLimit==null&&t.gas!=null){let u=21e3;const c=$t(a);for(let f=0;f<c.length;f++)u+=4,c[f]&&(u+=64);o.gasLimit=Bt.from(t.gas).add(u)}if(s.value){const u=Bt.from(s.value);!u.isZero()&&!t.payable&&oo.throwError("non-payable method cannot override value",Ne.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),o.value=u}s.customData&&(o.customData=Do(s.customData)),s.ccipReadEnabled&&(o.ccipReadEnabled=!!s.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const l=Object.keys(n).filter(u=>n[u]!=null);return l.length&&oo.throwError(`cannot override ${l.map(u=>JSON.stringify(u)).join(",")}`,Ne.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),o})}function H$t(e,t){return function(...r){return Zj(e,t,r)}}function G$t(e,t){const r=e.signer||e.provider;return function(...n){return Nb(this,void 0,void 0,function*(){r||oo.throwError("estimate require a provider or signer",Ne.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield Zj(e,t,n);return yield r.estimateGas(i)})}}function EKe(e,t){const r=t.wait.bind(t);t.wait=n=>r(n).then(i=>(i.events=i.logs.map(a=>{let o=Of(a),s=null;try{s=e.interface.parseLog(a)}catch{}return s&&(o.args=s.args,o.decode=(l,u)=>e.interface.decodeEventLog(s.eventFragment,l,u),o.event=s.name,o.eventSignature=s.signature),o.removeListener=()=>e.provider,o.getBlock=()=>e.provider.getBlock(i.blockHash),o.getTransaction=()=>e.provider.getTransaction(i.transactionHash),o.getTransactionReceipt=()=>Promise.resolve(i),o}),i))}function bKe(e,t,r){const n=e.signer||e.provider;return function(...i){return Nb(this,void 0,void 0,function*(){let a;if(i.length===t.inputs.length+1&&typeof i[i.length-1]=="object"){const l=Do(i.pop());l.blockTag!=null&&(a=yield l.blockTag),delete l.blockTag,i.push(l)}e.deployTransaction!=null&&(yield e._deployed(a));const o=yield Zj(e,t,i),s=yield n.call(o,a);try{let l=e.interface.decodeFunctionResult(t,s);return r&&t.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===Ne.errors.CALL_EXCEPTION&&(l.address=e.address,l.args=i,l.transaction=o),l}})}}function V$t(e,t){return function(...r){return Nb(this,void 0,void 0,function*(){e.signer||oo.throwError("sending a transaction requires a signer",Ne.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),e.deployTransaction!=null&&(yield e._deployed());const n=yield Zj(e,t,r),i=yield e.signer.sendTransaction(n);return EKe(e,i),i})}}function Axe(e,t,r){return t.constant?bKe(e,t,r):V$t(e,t)}function _Ke(e){return e.address&&(e.topics==null||e.topics.length===0)?"*":(e.address||"*")+"@"+(e.topics?e.topics.map(t=>Array.isArray(t)?t.join("|"):t).join(":"):"")}class R7{constructor(t,r){at(this,"tag",t),at(this,"filter",r),this._listeners=[]}addListener(t,r){this._listeners.push({listener:t,once:r})}removeListener(t){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==t?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(t=>t.listener)}listenerCount(){return this._listeners.length}run(t){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=t.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(t){}getEmit(t){return[t]}}class W$t extends R7{constructor(){super("error",null)}}class Cxe extends R7{constructor(t,r,n,i){const a={address:t};let o=r.getEventTopic(n);i?(o!==i[0]&&oo.throwArgumentError("topic mismatch","topics",i),a.topics=i.slice()):a.topics=[o],super(_Ke(a),a),at(this,"address",t),at(this,"interface",r),at(this,"fragment",n)}prepareEvent(t){super.prepareEvent(t),t.event=this.fragment.name,t.eventSignature=this.fragment.format(),t.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{t.args=this.interface.decodeEventLog(this.fragment,t.data,t.topics)}catch(r){t.args=null,t.decodeError=r}}getEmit(t){const r=vXe(t.args);if(r.length)throw r[0].error;const n=(t.args||[]).slice();return n.push(t),n}}class xxe extends R7{constructor(t,r){super("*",{address:t}),at(this,"address",t),at(this,"interface",r)}prepareEvent(t){super.prepareEvent(t);try{const r=this.interface.parseLog(t);t.event=r.name,t.eventSignature=r.signature,t.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),t.args=r.args}catch{}}}class SKe{constructor(t,r,n){at(this,"interface",Zu(new.target,"getInterface")(r)),n==null?(at(this,"provider",null),at(this,"signer",null)):m_.isSigner(n)?(at(this,"provider",n.provider||null),at(this,"signer",n)):gA.isProvider(n)?(at(this,"provider",n),at(this,"signer",null)):oo.throwArgumentError("invalid signer or provider","signerOrProvider",n),at(this,"callStatic",{}),at(this,"estimateGas",{}),at(this,"functions",{}),at(this,"populateTransaction",{}),at(this,"filters",{});{const o={};Object.keys(this.interface.events).forEach(s=>{const l=this.interface.events[s];at(this.filters,s,(...u)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,u)})),o[l.name]||(o[l.name]=[]),o[l.name].push(s)}),Object.keys(o).forEach(s=>{const l=o[s];l.length===1?at(this.filters,s,this.filters[l[0]]):oo.warn(`Duplicate definition of ${s} (${l.join(", ")})`)})}if(at(this,"_runningEvents",{}),at(this,"_wrappedEmits",{}),t==null&&oo.throwArgumentError("invalid contract address or ENS name","addressOrName",t),at(this,"address",t),this.provider)at(this,"resolvedAddress",yG(this.provider,t));else try{at(this,"resolvedAddress",Promise.resolve(va(t)))}catch{oo.throwError("provider is required to use ENS name as contract address",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(o=>{});const i={},a={};Object.keys(this.interface.functions).forEach(o=>{const s=this.interface.functions[o];if(a[o]){oo.warn(`Duplicate ABI entry for ${JSON.stringify(o)}`);return}a[o]=!0;{const l=s.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(o)}this[o]==null&&at(this,o,Axe(this,s,!0)),this.functions[o]==null&&at(this.functions,o,Axe(this,s,!1)),this.callStatic[o]==null&&at(this.callStatic,o,bKe(this,s,!0)),this.populateTransaction[o]==null&&at(this.populateTransaction,o,H$t(this,s)),this.estimateGas[o]==null&&at(this.estimateGas,o,G$t(this,s))}),Object.keys(i).forEach(o=>{const s=i[o];if(s.length>1)return;o=o.substring(1);const l=s[0];try{this[o]==null&&at(this,o,this[l])}catch{}this.functions[o]==null&&at(this.functions,o,this.functions[l]),this.callStatic[o]==null&&at(this.callStatic,o,this.callStatic[l]),this.populateTransaction[o]==null&&at(this.populateTransaction,o,this.populateTransaction[l]),this.estimateGas[o]==null&&at(this.estimateGas,o,this.estimateGas[l])})}static getContractAddress(t){return jj(t)}static getInterface(t){return _he.isInterface(t)?t:new _he(t)}deployed(){return this._deployed()}_deployed(t){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,t).then(r=>(r==="0x"&&oo.throwError("contract not deployed",Ne.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(t){this.signer||oo.throwError("sending a transactions require a signer",Ne.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Do(t||{});return["from","to"].forEach(function(n){r[n]!=null&&oo.throwError("cannot override "+n,Ne.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(t){typeof t=="string"&&(t=new Yj(t,this.provider));const r=new this.constructor(this.address,this.interface,t);return this.deployTransaction&&at(r,"deployTransaction",this.deployTransaction),r}attach(t){return new this.constructor(t,this.interface,this.signer||this.provider)}static isIndexed(t){return vG.isIndexed(t)}_normalizeRunningEvent(t){return this._runningEvents[t.tag]?this._runningEvents[t.tag]:t}_getRunningEvent(t){if(typeof t=="string"){if(t==="error")return this._normalizeRunningEvent(new W$t);if(t==="event")return this._normalizeRunningEvent(new R7("event",null));if(t==="*")return this._normalizeRunningEvent(new xxe(this.address,this.interface));const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Cxe(this.address,this.interface,r))}if(t.topics&&t.topics.length>0){try{const n=t.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new Cxe(this.address,this.interface,i,t.topics))}catch{}const r={address:this.address,topics:t.topics};return this._normalizeRunningEvent(new R7(_Ke(r),r))}return this._normalizeRunningEvent(new xxe(this.address,this.interface))}_checkRunningEvents(t){if(t.listenerCount()===0){delete this._runningEvents[t.tag];const r=this._wrappedEmits[t.tag];r&&t.filter&&(this.provider.off(t.filter,r),delete this._wrappedEmits[t.tag])}}_wrapEvent(t,r,n){const i=Of(r);return i.removeListener=()=>{n&&(t.removeListener(n),this._checkRunningEvents(t))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),t.prepareEvent(i),i}_addEventListener(t,r,n){if(this.provider||oo.throwError("events require a provider or a signer with a provider",Ne.errors.UNSUPPORTED_OPERATION,{operation:"once"}),t.addListener(r,n),this._runningEvents[t.tag]=t,!this._wrappedEmits[t.tag]){const i=a=>{let o=this._wrapEvent(t,a,r);if(o.decodeError==null)try{const s=t.getEmit(o);this.emit(t.filter,...s)}catch(s){o.decodeError=s.error}t.filter!=null&&this.emit("event",o),o.decodeError!=null&&this.emit("error",o.decodeError,o)};this._wrappedEmits[t.tag]=i,t.filter!=null&&this.provider.on(t.filter,i)}}queryFilter(t,r,n){const i=this._getRunningEvent(t),a=Do(i.filter);return typeof r=="string"&&si(r,32)?(n!=null&&oo.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),a.blockHash=r):(a.fromBlock=r??0,a.toBlock=n??"latest"),this.provider.getLogs(a).then(o=>o.map(s=>this._wrapEvent(i,s,null)))}on(t,r){return this._addEventListener(this._getRunningEvent(t),r,!1),this}once(t,r){return this._addEventListener(this._getRunningEvent(t),r,!0),this}emit(t,...r){if(!this.provider)return!1;const n=this._getRunningEvent(t),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(t){return this.provider?t==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(t).listenerCount():0}listeners(t){if(!this.provider)return[];if(t==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(t).listeners()}removeAllListeners(t){if(!this.provider)return this;if(t==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(t);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(t,r){if(!this.provider)return this;const n=this._getRunningEvent(t);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(t,r){return this.off(t,r)}}class Ihe extends SKe{}class j$t{constructor(t,r,n){let i=null;typeof r=="string"?i=r:g_(r)?i=Xt(r):r&&typeof r.object=="string"?i=r.object:i="!",i.substring(0,2)!=="0x"&&(i="0x"+i),(!si(i)||i.length%2)&&oo.throwArgumentError("invalid bytecode","bytecode",r),n&&!m_.isSigner(n)&&oo.throwArgumentError("invalid signer","signer",n),at(this,"bytecode",i),at(this,"interface",Zu(new.target,"getInterface")(t)),at(this,"signer",n||null)}getDeployTransaction(...t){let r={};if(t.length===this.interface.deploy.inputs.length+1&&typeof t[t.length-1]=="object"){r=Do(t.pop());for(const n in r)if(!F$t[n])throw new Error("unknown transaction override "+n)}return["data","from","to"].forEach(n=>{r[n]!=null&&oo.throwError("cannot override "+n,Ne.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.value&&!Bt.from(r.value).isZero()&&!this.interface.deploy.payable&&oo.throwError("non-payable constructor cannot override value",Ne.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:r.value}),oo.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),r.data=Xt(Co([this.bytecode,this.interface.encodeDeploy(t)])),r}deploy(...t){return Nb(this,void 0,void 0,function*(){let r={};t.length===this.interface.deploy.inputs.length+1&&(r=t.pop()),oo.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor");const n=yield VL(this.signer,t,this.interface.deploy.inputs);n.push(r);const i=this.getDeployTransaction(...n),a=yield this.signer.sendTransaction(i),o=Zu(this.constructor,"getContractAddress")(a),s=Zu(this.constructor,"getContract")(o,this.interface,this.signer);return EKe(s,a),at(s,"deployTransaction",a),s})}attach(t){return this.constructor.getContract(t,this.interface,this.signer)}connect(t){return new this.constructor(this.interface,this.bytecode,t)}static fromSolidity(t,r){t==null&&oo.throwError("missing compiler output",Ne.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),typeof t=="string"&&(t=JSON.parse(t));const n=t.abi;let i=null;return t.bytecode?i=t.bytecode:t.evm&&t.evm.bytecode&&(i=t.evm.bytecode),new this(n,i,r)}static getInterface(t){return Ihe.getInterface(t)}static getContractAddress(t){return jj(t)}static getContract(t,r,n){return new Ihe(t,r,n)}}class wKe{constructor(t){at(this,"alphabet",t),at(this,"base",t.length),at(this,"_alphabetMap",{}),at(this,"_leader",t.charAt(0));for(let r=0;r<t.length;r++)this._alphabetMap[t.charAt(r)]=r}encode(t){let r=$t(t);if(r.length===0)return"";let n=[0];for(let a=0;a<r.length;++a){let o=r[a];for(let s=0;s<n.length;++s)o+=n[s]<<8,n[s]=o%this.base,o=o/this.base|0;for(;o>0;)n.push(o%this.base),o=o/this.base|0}let i="";for(let a=0;r[a]===0&&a<r.length-1;++a)i+=this._leader;for(let a=n.length-1;a>=0;--a)i+=this.alphabet[n[a]];return i}decode(t){if(typeof t!="string")throw new TypeError("Expected String");let r=[];if(t.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n<t.length;n++){let i=this._alphabetMap[t[n]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let a=i;for(let o=0;o<r.length;++o)a+=r[o]*this.base,r[o]=a&255,a>>=8;for(;a>0;)r.push(a&255),a>>=8}for(let n=0;t[n]===this._leader&&n<t.length-1;++n)r.push(0);return $t(new Uint8Array(r.reverse()))}}new wKe("abcdefghijklmnopqrstuvwxyz234567");const fx=new wKe("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var dx;(function(e){e.sha256="sha256",e.sha512="sha512"})(dx||(dx={}));const z$t="sha2/5.7.0",Y$t=new Ne(z$t);function TKe(e){return"0x"+fd.ripemd160().update($t(e)).digest("hex")}function By(e){return"0x"+fd.sha256().update($t(e)).digest("hex")}function q$t(e){return"0x"+fd.sha512().update($t(e)).digest("hex")}function I7(e,t,r){return dx[e]||Y$t.throwError("unsupported algorithm "+e,Ne.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+fd.hmac(fd[e],$t(t)).update($t(r)).digest("hex")}function _2e(e,t,r,n,i){e=$t(e),t=$t(t);let a,o=1;const s=new Uint8Array(n),l=new Uint8Array(t.length+4);l.set(t);let u,c;for(let f=1;f<=o;f++){l[t.length]=f>>24&255,l[t.length+1]=f>>16&255,l[t.length+2]=f>>8&255,l[t.length+3]=f&255;let d=$t(I7(i,e,l));a||(a=d.length,c=new Uint8Array(a),o=Math.ceil(n/a),u=n-(o-1)*a),c.set(d);for(let g=1;g<r;g++){d=$t(I7(i,e,d));for(let m=0;m<a;m++)c[m]^=d[m]}const h=(f-1)*a,p=f===o?u:a;s.set($t(c).slice(0,p),h)}return Xt(s)}const X$t="wordlists/5.7.0",K$t=new Ne(X$t);class CR{constructor(t){K$t.checkAbstract(new.target,CR),at(this,"locale",t)}split(t){return t.toLowerCase().split(/ +/g)}join(t){return t.join(" ")}static check(t){const r=[];for(let n=0;n<2048;n++){const i=t.getWord(n);if(n!==t.getWordIndex(i))return"0x";r.push(i)}return PE(r.join(`
|
|
5693
5693
|
`)+`
|
|
5694
5694
|
`)}static register(t,r){r||(r=t.locale)}}const Z$t="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo";let WL=null;function Rxe(e){if(WL==null&&(WL=Z$t.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),CR.check(e)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw WL=null,new Error("BIP39 Wordlist for en (English) FAILED")}class Q$t extends CR{constructor(){super("en")}getWord(t){return Rxe(this),WL[t]}getWordIndex(t){return Rxe(this),WL.indexOf(t)}}const AKe=new Q$t;CR.register(AKe);const Ohe={en:AKe},J$t="hdnode/5.7.0",O7=new Ne(J$t),ekt=Bt.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),tkt=cl("Bitcoin seed"),fC=2147483648;function CKe(e){return(1<<e)-1<<8-e}function rkt(e){return(1<<e)-1}function B$(e){return xo(Xt(e),32)}function Ixe(e){return fx.encode(Co([e,nl(By(By(e)),0,4)]))}function S2e(e){if(e==null)return Ohe.en;if(typeof e=="string"){const t=Ohe[e];return t==null&&O7.throwArgumentError("unknown locale","wordlist",e),t}return e}const a5={},hx="m/44'/60'/0'/0/0";class nh{constructor(t,r,n,i,a,o,s,l){if(t!==a5)throw new Error("HDNode constructor cannot be called directly");if(r){const u=new k3(r);at(this,"privateKey",u.privateKey),at(this,"publicKey",u.compressedPublicKey)}else at(this,"privateKey",null),at(this,"publicKey",Xt(n));at(this,"parentFingerprint",i),at(this,"fingerprint",nl(TKe(By(this.publicKey)),0,4)),at(this,"address",rb(this.publicKey)),at(this,"chainCode",a),at(this,"index",o),at(this,"depth",s),l==null?(at(this,"mnemonic",null),at(this,"path",null)):typeof l=="string"?(at(this,"mnemonic",null),at(this,"path",l)):(at(this,"mnemonic",l),at(this,"path",l.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return Ixe(Co([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",Xt(this.depth),this.parentFingerprint,xo(Xt(this.index),4),this.chainCode,this.privateKey!=null?Co(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new nh(a5,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(t){if(t>4294967295)throw new Error("invalid index - "+String(t));let r=this.path;r&&(r+="/"+(t&~fC));const n=new Uint8Array(37);if(t&fC){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set($t(this.privateKey),1),r&&(r+="'")}else n.set($t(this.publicKey));for(let f=24;f>=0;f-=8)n[33+(f>>3)]=t>>24-f&255;const i=$t(I7(dx.sha512,this.chainCode,n)),a=i.slice(0,32),o=i.slice(32);let s=null,l=null;this.privateKey?s=B$(Bt.from(a).add(this.privateKey).mod(ekt)):l=new k3(Xt(a))._addPoint(this.publicKey);let u=r;const c=this.mnemonic;return c&&(u=Object.freeze({phrase:c.phrase,path:r,locale:c.locale||"en"})),new nh(a5,s,l,this.fingerprint,B$(o),t,this.depth+1,u)}derivePath(t){const r=t.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+t);r[0]==="m"&&r.shift();let n=this;for(let i=0;i<r.length;i++){const a=r[i];if(a.match(/^[0-9]+'$/)){const o=parseInt(a.substring(0,a.length-1));if(o>=fC)throw new Error("invalid path index - "+a);n=n._derive(fC+o)}else if(a.match(/^[0-9]+$/)){const o=parseInt(a);if(o>=fC)throw new Error("invalid path index - "+a);n=n._derive(o)}else throw new Error("invalid path component - "+a)}return n}static _fromSeed(t,r){const n=$t(t);if(n.length<16||n.length>64)throw new Error("invalid seed");const i=$t(I7(dx.sha512,tkt,n));return new nh(a5,B$(i.slice(0,32)),null,"0x00000000",B$(i.slice(32)),0,0,r)}static fromMnemonic(t,r,n){return n=S2e(n),t=Jj(Qj(t,n),n),nh._fromSeed(xKe(t,r),{phrase:t,path:"m",locale:n.locale})}static fromSeed(t){return nh._fromSeed(t,null)}static fromExtendedKey(t){const r=fx.decode(t);(r.length!==82||Ixe(r.slice(0,78))!==t)&&O7.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const n=r[4],i=Xt(r.slice(5,9)),a=parseInt(Xt(r.slice(9,13)).substring(2),16),o=Xt(r.slice(13,45)),s=r.slice(45,78);switch(Xt(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new nh(a5,null,Xt(s),i,o,a,n,null);case"0x0488ade4":case"0x04358394 ":if(s[0]!==0)break;return new nh(a5,Xt(s.slice(1)),null,i,o,a,n,null)}return O7.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function xKe(e,t){t||(t="");const r=cl("mnemonic"+t,bg.NFKD);return _2e(cl(e,bg.NFKD),r,2048,64,"sha512")}function Qj(e,t){t=S2e(t),O7.checkNormalize();const r=t.split(e);if(r.length%3!==0)throw new Error("invalid mnemonic");const n=$t(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let u=0;u<r.length;u++){let c=t.getWordIndex(r[u].normalize("NFKD"));if(c===-1)throw new Error("invalid mnemonic");for(let f=0;f<11;f++)c&1<<10-f&&(n[i>>3]|=1<<7-i%8),i++}const a=32*r.length/3,o=r.length/3,s=CKe(o);if(($t(By(n.slice(0,a/8)))[0]&s)!==(n[n.length-1]&s))throw new Error("invalid checksum");return Xt(n.slice(0,a/8))}function Jj(e,t){if(t=S2e(t),e=$t(e),e.length%4!==0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o<e.length;o++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[o]>>8-n,r.push(e[o]&rkt(8-n)),n+=3);const i=e.length/4,a=$t(By(e))[0]&CKe(i);return r[r.length-1]<<=i,r[r.length-1]|=a>>8-i,t.join(r.map(o=>t.getWord(o)))}function nkt(e,t){try{return Qj(e,t),!0}catch{}return!1}function ikt(e){return(typeof e!="number"||e<0||e>=fC||e%1)&&O7.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}const akt="random/5.7.0",Nhe=new Ne(akt);function okt(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof oi<"u")return oi;throw new Error("unable to locate global object")}const Oxe=okt();let dF=Oxe.crypto||Oxe.msCrypto;(!dF||!dF.getRandomValues)&&(Nhe.warn("WARNING: Missing strong random number source"),dF={getRandomValues:function(e){return Nhe.throwError("no secure random source avaialble",Ne.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function xC(e){(e<=0||e>1024||e%1||e!=e)&&Nhe.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return dF.getRandomValues(t),$t(t)}function RKe(e){e=e.slice();for(let t=e.length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}var IKe={exports:{}};(function(e,t){(function(r){function n(B){return parseInt(B)===B}function i(B){if(!n(B.length))return!1;for(var R=0;R<B.length;R++)if(!n(B[R])||B[R]<0||B[R]>255)return!1;return!0}function a(B,R){if(B.buffer&&ArrayBuffer.isView(B)&&B.name==="Uint8Array")return R&&(B.slice?B=B.slice():B=Array.prototype.slice.call(B)),B;if(Array.isArray(B)){if(!i(B))throw new Error("Array contains invalid value: "+B);return new Uint8Array(B)}if(n(B.length)&&i(B))return new Uint8Array(B);throw new Error("unsupported array-like object")}function o(B){return new Uint8Array(B)}function s(B,R,H,q,W){(q!=null||W!=null)&&(B.slice?B=B.slice(q,W):B=Array.prototype.slice.call(B,q,W)),R.set(B,H)}var l=function(){function B(H){var q=[],W=0;for(H=encodeURI(H);W<H.length;){var Y=H.charCodeAt(W++);Y===37?(q.push(parseInt(H.substr(W,2),16)),W+=2):q.push(Y)}return a(q)}function R(H){for(var q=[],W=0;W<H.length;){var Y=H[W];Y<128?(q.push(String.fromCharCode(Y)),W++):Y>191&&Y<224?(q.push(String.fromCharCode((Y&31)<<6|H[W+1]&63)),W+=2):(q.push(String.fromCharCode((Y&15)<<12|(H[W+1]&63)<<6|H[W+2]&63)),W+=3)}return q.join("")}return{toBytes:B,fromBytes:R}}(),u=function(){function B(q){for(var W=[],Y=0;Y<q.length;Y+=2)W.push(parseInt(q.substr(Y,2),16));return W}var R="0123456789abcdef";function H(q){for(var W=[],Y=0;Y<q.length;Y++){var re=q[Y];W.push(R[(re&240)>>4]+R[re&15])}return W.join("")}return{toBytes:B,fromBytes:H}}(),c={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],g=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],E=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],b=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],w=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],T=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],x=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],N=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],A=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],L=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],O=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function I(B){for(var R=[],H=0;H<B.length;H+=4)R.push(B[H]<<24|B[H+1]<<16|B[H+2]<<8|B[H+3]);return R}var $=function(B){if(!(this instanceof $))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:a(B,!0)}),this._prepare()};$.prototype._prepare=function(){var B=c[this.key.length];if(B==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var R=0;R<=B;R++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var H=(B+1)*4,q=this.key.length/4,W=I(this.key),Y,R=0;R<q;R++)Y=R>>2,this._Ke[Y][R%4]=W[R],this._Kd[B-Y][R%4]=W[R];for(var re=0,Q=q,ie;Q<H;){if(ie=W[q-1],W[0]^=d[ie>>16&255]<<24^d[ie>>8&255]<<16^d[ie&255]<<8^d[ie>>24&255]^f[re]<<24,re+=1,q!=8)for(var R=1;R<q;R++)W[R]^=W[R-1];else{for(var R=1;R<q/2;R++)W[R]^=W[R-1];ie=W[q/2-1],W[q/2]^=d[ie&255]^d[ie>>8&255]<<8^d[ie>>16&255]<<16^d[ie>>24&255]<<24;for(var R=q/2+1;R<q;R++)W[R]^=W[R-1]}for(var R=0,ce,te;R<q&&Q<H;)ce=Q>>2,te=Q%4,this._Ke[ce][te]=W[R],this._Kd[B-ce][te]=W[R++],Q++}for(var ce=1;ce<B;ce++)for(var te=0;te<4;te++)ie=this._Kd[ce][te],this._Kd[ce][te]=N[ie>>24&255]^A[ie>>16&255]^L[ie>>8&255]^O[ie&255]},$.prototype.encrypt=function(B){if(B.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var R=this._Ke.length-1,H=[0,0,0,0],q=I(B),W=0;W<4;W++)q[W]^=this._Ke[0][W];for(var Y=1;Y<R;Y++){for(var W=0;W<4;W++)H[W]=p[q[W]>>24&255]^g[q[(W+1)%4]>>16&255]^m[q[(W+2)%4]>>8&255]^E[q[(W+3)%4]&255]^this._Ke[Y][W];q=H.slice()}for(var re=o(16),Q,W=0;W<4;W++)Q=this._Ke[R][W],re[4*W]=(d[q[W]>>24&255]^Q>>24)&255,re[4*W+1]=(d[q[(W+1)%4]>>16&255]^Q>>16)&255,re[4*W+2]=(d[q[(W+2)%4]>>8&255]^Q>>8)&255,re[4*W+3]=(d[q[(W+3)%4]&255]^Q)&255;return re},$.prototype.decrypt=function(B){if(B.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var R=this._Kd.length-1,H=[0,0,0,0],q=I(B),W=0;W<4;W++)q[W]^=this._Kd[0][W];for(var Y=1;Y<R;Y++){for(var W=0;W<4;W++)H[W]=b[q[W]>>24&255]^w[q[(W+3)%4]>>16&255]^T[q[(W+2)%4]>>8&255]^x[q[(W+1)%4]&255]^this._Kd[Y][W];q=H.slice()}for(var re=o(16),Q,W=0;W<4;W++)Q=this._Kd[R][W],re[4*W]=(h[q[W]>>24&255]^Q>>24)&255,re[4*W+1]=(h[q[(W+3)%4]>>16&255]^Q>>16)&255,re[4*W+2]=(h[q[(W+2)%4]>>8&255]^Q>>8)&255,re[4*W+3]=(h[q[(W+1)%4]&255]^Q)&255;return re};var F=function(B){if(!(this instanceof F))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new $(B)};F.prototype.encrypt=function(B){if(B=a(B),B.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var R=o(B.length),H=o(16),q=0;q<B.length;q+=16)s(B,H,0,q,q+16),H=this._aes.encrypt(H),s(H,R,q);return R},F.prototype.decrypt=function(B){if(B=a(B),B.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var R=o(B.length),H=o(16),q=0;q<B.length;q+=16)s(B,H,0,q,q+16),H=this._aes.decrypt(H),s(H,R,q);return R};var D=function(B,R){if(!(this instanceof D))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!R)R=o(16);else if(R.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=a(R,!0),this._aes=new $(B)};D.prototype.encrypt=function(B){if(B=a(B),B.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var R=o(B.length),H=o(16),q=0;q<B.length;q+=16){s(B,H,0,q,q+16);for(var W=0;W<16;W++)H[W]^=this._lastCipherblock[W];this._lastCipherblock=this._aes.encrypt(H),s(this._lastCipherblock,R,q)}return R},D.prototype.decrypt=function(B){if(B=a(B),B.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var R=o(B.length),H=o(16),q=0;q<B.length;q+=16){s(B,H,0,q,q+16),H=this._aes.decrypt(H);for(var W=0;W<16;W++)R[q+W]=H[W]^this._lastCipherblock[W];s(B,this._lastCipherblock,0,q,q+16)}return R};var y=function(B,R,H){if(!(this instanceof y))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!R)R=o(16);else if(R.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");H||(H=1),this.segmentSize=H,this._shiftRegister=a(R,!0),this._aes=new $(B)};y.prototype.encrypt=function(B){if(B.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var R=a(B,!0),H,q=0;q<R.length;q+=this.segmentSize){H=this._aes.encrypt(this._shiftRegister);for(var W=0;W<this.segmentSize;W++)R[q+W]^=H[W];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(R,this._shiftRegister,16-this.segmentSize,q,q+this.segmentSize)}return R},y.prototype.decrypt=function(B){if(B.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var R=a(B,!0),H,q=0;q<R.length;q+=this.segmentSize){H=this._aes.encrypt(this._shiftRegister);for(var W=0;W<this.segmentSize;W++)R[q+W]^=H[W];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(B,this._shiftRegister,16-this.segmentSize,q,q+this.segmentSize)}return R};var S=function(B,R){if(!(this instanceof S))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!R)R=o(16);else if(R.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=a(R,!0),this._lastPrecipherIndex=16,this._aes=new $(B)};S.prototype.encrypt=function(B){for(var R=a(B,!0),H=0;H<R.length;H++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),R[H]^=this._lastPrecipher[this._lastPrecipherIndex++];return R},S.prototype.decrypt=S.prototype.encrypt;var C=function(B){if(!(this instanceof C))throw Error("Counter must be instanitated with `new`");B!==0&&!B&&(B=1),typeof B=="number"?(this._counter=o(16),this.setValue(B)):this.setBytes(B)};C.prototype.setValue=function(B){if(typeof B!="number"||parseInt(B)!=B)throw new Error("invalid counter value (must be an integer)");for(var R=15;R>=0;--R)this._counter[R]=B%256,B=B>>8},C.prototype.setBytes=function(B){if(B=a(B,!0),B.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=B},C.prototype.increment=function(){for(var B=15;B>=0;B--)if(this._counter[B]===255)this._counter[B]=0;else{this._counter[B]++;break}};var M=function(B,R){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",R instanceof C||(R=new C(R)),this._counter=R,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new $(B)};M.prototype.encrypt=function(B){for(var R=a(B,!0),H=0;H<R.length;H++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),R[H]^=this._remainingCounter[this._remainingCounterIndex++];return R},M.prototype.decrypt=M.prototype.encrypt;function k(B){B=a(B,!0);var R=16-B.length%16,H=o(B.length+R);s(B,H);for(var q=B.length;q<H.length;q++)H[q]=R;return H}function U(B){if(B=a(B,!0),B.length<16)throw new Error("PKCS#7 invalid length");var R=B[B.length-1];if(R>16)throw new Error("PKCS#7 padding byte out of range");for(var H=B.length-R,q=0;q<R;q++)if(B[H+q]!==R)throw new Error("PKCS#7 invalid padding byte");var W=o(H);return s(B,W,0,0,H),W}var G={AES:$,Counter:C,ModeOfOperation:{ecb:F,cbc:D,cfb:y,ofb:S,ctr:M},utils:{hex:u,utf8:l},padding:{pkcs7:{pad:k,strip:U}},_arrayTest:{coerceArray:a,createArray:o,copyArray:s}};e.exports=G})()})(IKe);var skt=IKe.exports;const N1=Nn(skt),OKe="json-wallets/5.7.0";function B3(e){return typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),$t(e)}function p8(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function w2e(e){return typeof e=="string"?cl(e,bg.NFKC):$t(e)}function tl(e,t){let r=e;const n=t.toLowerCase().split("/");for(let i=0;i<n.length;i++){let a=null;for(const o in r)if(o.toLowerCase()===n[i]){a=r[o];break}if(a===null)return null;r=a}return r}function lkt(e){const t=$t(e);t[6]=t[6]&15|64,t[8]=t[8]&63|128;const r=Xt(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const ukt=new Ne(OKe);class ckt extends pA{isCrowdsaleAccount(t){return!!(t&&t._isCrowdsaleAccount)}}function NKe(e,t){const r=JSON.parse(e);t=w2e(t);const n=va(tl(r,"ethaddr")),i=B3(tl(r,"encseed"));(!i||i.length%16!==0)&&ukt.throwArgumentError("invalid encseed","json",e);const a=$t(_2e(t,t,2e3,32,"sha256")).slice(0,16),o=i.slice(0,16),s=i.slice(16),l=new N1.ModeOfOperation.cbc(a,o),u=N1.padding.pkcs7.strip($t(l.decrypt(s)));let c="";for(let h=0;h<u.length;h++)c+=String.fromCharCode(u[h]);const f=cl(c),d=lo(f);return new ckt({_isCrowdsaleAccount:!0,address:n,privateKey:d})}function T2e(e){let t=null;try{t=JSON.parse(e)}catch{return!1}return t.encseed&&t.ethaddr}function A2e(e){let t=null;try{t=JSON.parse(e)}catch{return!1}return!(!t.version||parseInt(t.version)!==t.version||parseInt(t.version)!==3)}function fkt(e){if(T2e(e))try{return va(JSON.parse(e).ethaddr)}catch{return null}if(A2e(e))try{return va(JSON.parse(e).address)}catch{return null}return null}var LKe={exports:{}};(function(e,t){(function(r){function i(g){const m=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);let E=1779033703,b=3144134277,w=1013904242,T=2773480762,x=1359893119,N=2600822924,A=528734635,L=1541459225;const O=new Uint32Array(64);function I(M){let k=0,U=M.length;for(;U>=64;){let G=E,B=b,R=w,H=T,q=x,W=N,Y=A,re=L,Q,ie,ce,te,J;for(ie=0;ie<16;ie++)ce=k+ie*4,O[ie]=(M[ce]&255)<<24|(M[ce+1]&255)<<16|(M[ce+2]&255)<<8|M[ce+3]&255;for(ie=16;ie<64;ie++)Q=O[ie-2],te=(Q>>>17|Q<<32-17)^(Q>>>19|Q<<32-19)^Q>>>10,Q=O[ie-15],J=(Q>>>7|Q<<32-7)^(Q>>>18|Q<<32-18)^Q>>>3,O[ie]=(te+O[ie-7]|0)+(J+O[ie-16]|0)|0;for(ie=0;ie<64;ie++)te=(((q>>>6|q<<32-6)^(q>>>11|q<<32-11)^(q>>>25|q<<32-25))+(q&W^~q&Y)|0)+(re+(m[ie]+O[ie]|0)|0)|0,J=((G>>>2|G<<32-2)^(G>>>13|G<<32-13)^(G>>>22|G<<32-22))+(G&B^G&R^B&R)|0,re=Y,Y=W,W=q,q=H+te|0,H=R,R=B,B=G,G=te+J|0;E=E+G|0,b=b+B|0,w=w+R|0,T=T+H|0,x=x+q|0,N=N+W|0,A=A+Y|0,L=L+re|0,k+=64,U-=64}}I(g);let $,F=g.length%64,D=g.length/536870912|0,y=g.length<<3,S=F<56?56:120,C=g.slice(g.length-F,g.length);for(C.push(128),$=F+1;$<S;$++)C.push(0);return C.push(D>>>24&255),C.push(D>>>16&255),C.push(D>>>8&255),C.push(D>>>0&255),C.push(y>>>24&255),C.push(y>>>16&255),C.push(y>>>8&255),C.push(y>>>0&255),I(C),[E>>>24&255,E>>>16&255,E>>>8&255,E>>>0&255,b>>>24&255,b>>>16&255,b>>>8&255,b>>>0&255,w>>>24&255,w>>>16&255,w>>>8&255,w>>>0&255,T>>>24&255,T>>>16&255,T>>>8&255,T>>>0&255,x>>>24&255,x>>>16&255,x>>>8&255,x>>>0&255,N>>>24&255,N>>>16&255,N>>>8&255,N>>>0&255,A>>>24&255,A>>>16&255,A>>>8&255,A>>>0&255,L>>>24&255,L>>>16&255,L>>>8&255,L>>>0&255]}function a(g,m,E){g=g.length<=64?g:i(g);const b=64+m.length+4,w=new Array(b),T=new Array(64);let x,N=[];for(x=0;x<64;x++)w[x]=54;for(x=0;x<g.length;x++)w[x]^=g[x];for(x=0;x<m.length;x++)w[64+x]=m[x];for(x=b-4;x<b;x++)w[x]=0;for(x=0;x<64;x++)T[x]=92;for(x=0;x<g.length;x++)T[x]^=g[x];function A(){for(let L=b-1;L>=b-4;L--){if(w[L]++,w[L]<=255)return;w[L]=0}}for(;E>=32;)A(),N=N.concat(i(T.concat(i(w)))),E-=32;return E>0&&(A(),N=N.concat(i(T.concat(i(w))).slice(0,E))),N}function o(g,m,E,b,w){let T;for(c(g,(2*E-1)*16,w,0,16),T=0;T<2*E;T++)u(g,T*16,w,16),l(w,b),c(w,0,g,m+T*16,16);for(T=0;T<E;T++)c(g,m+T*2*16,g,T*16,16);for(T=0;T<E;T++)c(g,m+(T*2+1)*16,g,(T+E)*16,16)}function s(g,m){return g<<m|g>>>32-m}function l(g,m){c(g,0,m,0,16);for(let E=8;E>0;E-=2)m[4]^=s(m[0]+m[12],7),m[8]^=s(m[4]+m[0],9),m[12]^=s(m[8]+m[4],13),m[0]^=s(m[12]+m[8],18),m[9]^=s(m[5]+m[1],7),m[13]^=s(m[9]+m[5],9),m[1]^=s(m[13]+m[9],13),m[5]^=s(m[1]+m[13],18),m[14]^=s(m[10]+m[6],7),m[2]^=s(m[14]+m[10],9),m[6]^=s(m[2]+m[14],13),m[10]^=s(m[6]+m[2],18),m[3]^=s(m[15]+m[11],7),m[7]^=s(m[3]+m[15],9),m[11]^=s(m[7]+m[3],13),m[15]^=s(m[11]+m[7],18),m[1]^=s(m[0]+m[3],7),m[2]^=s(m[1]+m[0],9),m[3]^=s(m[2]+m[1],13),m[0]^=s(m[3]+m[2],18),m[6]^=s(m[5]+m[4],7),m[7]^=s(m[6]+m[5],9),m[4]^=s(m[7]+m[6],13),m[5]^=s(m[4]+m[7],18),m[11]^=s(m[10]+m[9],7),m[8]^=s(m[11]+m[10],9),m[9]^=s(m[8]+m[11],13),m[10]^=s(m[9]+m[8],18),m[12]^=s(m[15]+m[14],7),m[13]^=s(m[12]+m[15],9),m[14]^=s(m[13]+m[12],13),m[15]^=s(m[14]+m[13],18);for(let E=0;E<16;++E)g[E]+=m[E]}function u(g,m,E,b){for(let w=0;w<b;w++)E[w]^=g[m+w]}function c(g,m,E,b,w){for(;w--;)E[b++]=g[m++]}function f(g){if(!g||typeof g.length!="number")return!1;for(let m=0;m<g.length;m++){const E=g[m];if(typeof E!="number"||E%1||E<0||E>=256)return!1}return!0}function d(g,m){if(typeof g!="number"||g%1)throw new Error("invalid "+m);return g}function h(g,m,E,b,w,T,x){if(E=d(E,"N"),b=d(b,"r"),w=d(w,"p"),T=d(T,"dkLen"),E===0||E&E-1)throw new Error("N must be power of 2");if(E>2147483647/128/b)throw new Error("N too large");if(b>2147483647/128/w)throw new Error("r too large");if(!f(g))throw new Error("password must be an array or buffer");if(g=Array.prototype.slice.call(g),!f(m))throw new Error("salt must be an array or buffer");m=Array.prototype.slice.call(m);let N=a(g,m,w*128*b);const A=new Uint32Array(w*32*b);for(let q=0;q<A.length;q++){const W=q*4;A[q]=(N[W+3]&255)<<24|(N[W+2]&255)<<16|(N[W+1]&255)<<8|(N[W+0]&255)<<0}const L=new Uint32Array(64*b),O=new Uint32Array(32*b*E),I=32*b,$=new Uint32Array(16),F=new Uint32Array(16),D=w*E*2;let y=0,S=null,C=!1,M=0,k=0,U,G;const B=x?parseInt(1e3/b):4294967295,R=typeof setImmediate<"u"?setImmediate:setTimeout,H=function(){if(C)return x(new Error("cancelled"),y/D);let q;switch(M){case 0:G=k*32*b,c(A,G,L,0,I),M=1,U=0;case 1:q=E-U,q>B&&(q=B);for(let Y=0;Y<q;Y++)c(L,0,O,(U+Y)*I,I),o(L,I,b,$,F);if(U+=q,y+=q,x){const Y=parseInt(1e3*y/D);if(Y!==S){if(C=x(null,y/D),C)break;S=Y}}if(U<E)break;U=0,M=2;case 2:q=E-U,q>B&&(q=B);for(let Y=0;Y<q;Y++){const re=(2*b-1)*16,Q=L[re]&E-1;u(O,Q*I,L,I),o(L,I,b,$,F)}if(U+=q,y+=q,x){const Y=parseInt(1e3*y/D);if(Y!==S){if(C=x(null,y/D),C)break;S=Y}}if(U<E)break;if(c(L,0,A,G,I),k++,k<w){M=0;break}N=[];for(let Y=0;Y<A.length;Y++)N.push(A[Y]>>0&255),N.push(A[Y]>>8&255),N.push(A[Y]>>16&255),N.push(A[Y]>>24&255);const W=a(g,N,T);return x&&x(null,1,W),W}x&&R(H)};if(!x)for(;;){const q=H();if(q!=null)return q}H()}const p={scrypt:function(g,m,E,b,w,T,x){return new Promise(function(N,A){let L=0;x&&x(0),h(g,m,E,b,w,T,function(O,I,$){if(O)A(O);else if($)x&&L!==1&&x(1),N(new Uint8Array($));else if(x&&I!==L)return L=I,x(I)})})},syncScrypt:function(g,m,E,b,w,T){return new Uint8Array(h(g,m,E,b,w,T))}};e.exports=p})()})(LKe);var dkt=LKe.exports;const C2e=Nn(dkt);var hkt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const Lhe=new Ne(OKe);function Nxe(e){return e!=null&&e.mnemonic&&e.mnemonic.phrase}class pkt extends pA{isKeystoreAccount(t){return!!(t&&t._isKeystoreAccount)}}function vkt(e,t,r){if(tl(e,"crypto/cipher")==="aes-128-ctr"){const i=B3(tl(e,"crypto/cipherparams/iv")),a=new N1.Counter(i),o=new N1.ModeOfOperation.ctr(t,a);return $t(o.decrypt(r))}return null}function PKe(e,t){const r=B3(tl(e,"crypto/ciphertext"));if(Xt(lo(Co([t.slice(16,32),r]))).substring(2)!==tl(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const i=vkt(e,t.slice(0,16),r);i||Lhe.throwError("unsupported cipher",Ne.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const a=t.slice(32,64),o=rb(i);if(e.address){let l=e.address.toLowerCase();if(l.substring(0,2)!=="0x"&&(l="0x"+l),va(l)!==o)throw new Error("address mismatch")}const s={_isKeystoreAccount:!0,address:o,privateKey:Xt(i)};if(tl(e,"x-ethers/version")==="0.1"){const l=B3(tl(e,"x-ethers/mnemonicCiphertext")),u=B3(tl(e,"x-ethers/mnemonicCounter")),c=new N1.Counter(u),f=new N1.ModeOfOperation.ctr(a,c),d=tl(e,"x-ethers/path")||hx,h=tl(e,"x-ethers/locale")||"en",p=$t(f.decrypt(l));try{const g=Jj(p,h),m=nh.fromMnemonic(g,null,h).derivePath(d);if(m.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=m.mnemonic}catch(g){if(g.code!==Ne.errors.INVALID_ARGUMENT||g.argument!=="wordlist")throw g}}return new pkt(s)}function MKe(e,t,r,n,i){return $t(_2e(e,t,r,n,i))}function gkt(e,t,r,n,i){return Promise.resolve(MKe(e,t,r,n,i))}function DKe(e,t,r,n,i){const a=w2e(t),o=tl(e,"crypto/kdf");if(o&&typeof o=="string"){const s=function(l,u){return Lhe.throwArgumentError("invalid key-derivation function parameters",l,u)};if(o.toLowerCase()==="scrypt"){const l=B3(tl(e,"crypto/kdfparams/salt")),u=parseInt(tl(e,"crypto/kdfparams/n")),c=parseInt(tl(e,"crypto/kdfparams/r")),f=parseInt(tl(e,"crypto/kdfparams/p"));(!u||!c||!f)&&s("kdf",o),u&u-1&&s("N",u);const d=parseInt(tl(e,"crypto/kdfparams/dklen"));return d!==32&&s("dklen",d),n(a,l,u,c,f,64,i)}else if(o.toLowerCase()==="pbkdf2"){const l=B3(tl(e,"crypto/kdfparams/salt"));let u=null;const c=tl(e,"crypto/kdfparams/prf");c==="hmac-sha256"?u="sha256":c==="hmac-sha512"?u="sha512":s("prf",c);const f=parseInt(tl(e,"crypto/kdfparams/c")),d=parseInt(tl(e,"crypto/kdfparams/dklen"));return d!==32&&s("dklen",d),r(a,l,f,d,u)}}return Lhe.throwArgumentError("unsupported key-derivation function","kdf",o)}function mkt(e,t){const r=JSON.parse(e),n=DKe(r,t,MKe,C2e.syncScrypt);return PKe(r,n)}function ykt(e,t,r){return hkt(this,void 0,void 0,function*(){const n=JSON.parse(e),i=yield DKe(n,t,gkt,C2e.scrypt,r);return PKe(n,i)})}function Ekt(e,t,r,n){try{if(va(e.address)!==rb(e.privateKey))throw new Error("address/privateKey mismatch");if(Nxe(e)){const m=e.mnemonic;if(nh.fromMnemonic(m.phrase,null,m.locale).derivePath(m.path||hx).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(m){return Promise.reject(m)}typeof r=="function"&&!n&&(n=r,r={}),r||(r={});const i=$t(e.privateKey),a=w2e(t);let o=null,s=null,l=null;if(Nxe(e)){const m=e.mnemonic;o=$t(Qj(m.phrase,m.locale||"en")),s=m.path||hx,l=m.locale||"en"}let u=r.client;u||(u="ethers.js");let c=null;r.salt?c=$t(r.salt):c=xC(32);let f=null;if(r.iv){if(f=$t(r.iv),f.length!==16)throw new Error("invalid iv")}else f=xC(16);let d=null;if(r.uuid){if(d=$t(r.uuid),d.length!==16)throw new Error("invalid uuid")}else d=xC(16);let h=1<<17,p=8,g=1;return r.scrypt&&(r.scrypt.N&&(h=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(g=r.scrypt.p)),C2e.scrypt(a,c,h,p,g,64,n).then(m=>{m=$t(m);const E=m.slice(0,16),b=m.slice(16,32),w=m.slice(32,64),T=new N1.Counter(f),x=new N1.ModeOfOperation.ctr(E,T),N=$t(x.encrypt(i)),A=lo(Co([b,N])),L={address:e.address.substring(2).toLowerCase(),id:lkt(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Xt(f).substring(2)},ciphertext:Xt(N).substring(2),kdf:"scrypt",kdfparams:{salt:Xt(c).substring(2),n:h,dklen:32,p:g,r:p},mac:A.substring(2)}};if(o){const O=xC(16),I=new N1.Counter(O),$=new N1.ModeOfOperation.ctr(w,I),F=$t($.encrypt(o)),D=new Date,y=D.getUTCFullYear()+"-"+p8(D.getUTCMonth()+1,2)+"-"+p8(D.getUTCDate(),2)+"T"+p8(D.getUTCHours(),2)+"-"+p8(D.getUTCMinutes(),2)+"-"+p8(D.getUTCSeconds(),2)+".0Z";L["x-ethers"]={client:u,gethFilename:"UTC--"+y+"--"+L.address,mnemonicCounter:Xt(O).substring(2),mnemonicCiphertext:Xt(F).substring(2),path:s,locale:l,version:"0.1"}}return JSON.stringify(L)})}function bkt(e,t,r){if(T2e(e)){r&&r(0);const n=NKe(e,t);return r&&r(1),Promise.resolve(n)}return A2e(e)?ykt(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function _kt(e,t){if(T2e(e))return NKe(e,t);if(A2e(e))return mkt(e,t);throw new Error("invalid JSON wallet")}const Skt="wallet/5.7.0";var Lxe=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const o5=new Ne(Skt);function wkt(e){return e!=null&&si(e.privateKey,32)&&e.address!=null}function Tkt(e){const t=e.mnemonic;return t&&t.phrase}class Xw extends m_{constructor(t,r){if(super(),wkt(t)){const n=new k3(t.privateKey);if(at(this,"_signingKey",()=>n),at(this,"address",rb(this.publicKey)),this.address!==va(t.address)&&o5.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),Tkt(t)){const i=t.mnemonic;at(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||hx,locale:i.locale||"en"}));const a=this.mnemonic,o=nh.fromMnemonic(a.phrase,null,a.locale).derivePath(a.path);rb(o.privateKey)!==this.address&&o5.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else at(this,"_mnemonic",()=>null)}else{if(k3.isSigningKey(t))t.curve!=="secp256k1"&&o5.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),at(this,"_signingKey",()=>t);else{typeof t=="string"&&t.match(/^[0-9a-f]*$/i)&&t.length===64&&(t="0x"+t);const n=new k3(t);at(this,"_signingKey",()=>n)}at(this,"_mnemonic",()=>null),at(this,"address",rb(this.publicKey))}r&&!gA.isProvider(r)&&o5.throwArgumentError("invalid provider","provider",r),at(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(t){return new Xw(this,t)}signTransaction(t){return Ms(t).then(r=>{r.from!=null&&(va(r.from)!==this.address&&o5.throwArgumentError("transaction from address mismatch","transaction.from",t.from),delete r.from);const n=this._signingKey().signDigest(lo(Rhe(r)));return Rhe(r,n)})}signMessage(t){return Lxe(this,void 0,void 0,function*(){return yhe(this._signingKey().signDigest(p2e(t)))})}_signTypedData(t,r,n){return Lxe(this,void 0,void 0,function*(){const i=yield Wu.resolveNames(t,r,n,a=>(this.provider==null&&o5.throwError("cannot resolve ENS names without a provider",Ne.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:a}),this.provider.resolveName(a)));return yhe(this._signingKey().signDigest(Wu.hash(i.domain,r,i.value)))})}encrypt(t,r,n){if(typeof r=="function"&&!n&&(n=r,r={}),n&&typeof n!="function")throw new Error("invalid callback");return r||(r={}),Ekt(this,t,r,n)}static createRandom(t){let r=xC(16);t||(t={}),t.extraEntropy&&(r=$t(nl(lo(Co([r,t.extraEntropy])),0,16)));const n=Jj(r,t.locale);return Xw.fromMnemonic(n,t.path,t.locale)}static fromEncryptedJson(t,r,n){return bkt(t,r,n).then(i=>new Xw(i))}static fromEncryptedJsonSync(t,r){return new Xw(_kt(t,r))}static fromMnemonic(t,r,n){return r||(r=hx),new Xw(nh.fromMnemonic(t,null,n).derivePath(r))}}function Akt(e,t){return IM(p2e(e),t)}function Ckt(e,t,r,n){return IM(Wu.hash(e,t,r),n)}const xkt="networks/5.7.1",Pxe=new Ne(xkt);function Rkt(e){return e&&typeof e.renetwork=="function"}function sy(e){const t=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(e,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(e,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(e,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const a=["goerli","ropsten","rinkeby","sepolia"];try{const o=new r.PocketProvider(e,n.pocket);o.network&&a.indexOf(o.network.name)===-1&&i.push(o)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(e))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const a=["ropsten"],o=new r.AnkrProvider(e,n.ankr);o.network&&a.indexOf(o.network.name)===-1&&i.push(o)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let a=1;return n.quorum!=null?a=n.quorum:e==="homestead"&&(a=2),new r.FallbackProvider(i,a)}return i[0]};return t.renetwork=function(r){return sy(r)},t}function EG(e,t){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(e,t):null};return r.renetwork=function(n){return EG(e,n)},r}const Mxe={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:sy("homestead")},Dxe={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:sy("ropsten")},$xe={chainId:63,name:"classicMordor",_defaultProvider:EG("https://www.ethercluster.com/mordor","classicMordor")},U$={unspecified:{chainId:0,name:"unspecified"},homestead:Mxe,mainnet:Mxe,morden:{chainId:2,name:"morden"},ropsten:Dxe,testnet:Dxe,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:sy("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:sy("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:sy("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:sy("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:EG("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:$xe,classicTestnet:$xe,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:EG("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:sy("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:sy("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function x2e(e){if(e==null)return null;if(typeof e=="number"){for(const n in U$){const i=U$[n];if(i.chainId===e)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:e,name:"unknown"}}if(typeof e=="string"){const n=U$[e];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const t=U$[e.name];if(!t)return typeof e.chainId!="number"&&Pxe.throwArgumentError("invalid network chainId","network",e),e;e.chainId!==0&&e.chainId!==t.chainId&&Pxe.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;return r==null&&t._defaultProvider&&(Rkt(t._defaultProvider)?r=t._defaultProvider.renetwork(e):r=t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}const Ikt="web/5.7.1";var Okt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};function Nkt(e,t){return Okt(this,void 0,void 0,function*(){t==null&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(t.skipFetchSetup!==!0&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),t.fetchOptions!=null){const o=t.fetchOptions;o.mode&&(r.mode=o.mode),o.cache&&(r.cache=o.cache),o.credentials&&(r.credentials=o.credentials),o.redirect&&(r.redirect=o.redirect),o.referrer&&(r.referrer=o.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),a={};return n.headers.forEach?n.headers.forEach((o,s)=>{a[s.toLowerCase()]=o}):n.headers.keys().forEach(o=>{a[o.toLowerCase()]=n.headers.get(o)}),{headers:a,statusCode:n.status,statusMessage:n.statusText,body:$t(new Uint8Array(i))}})}var Lkt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const Ip=new Ne(Ikt);function kxe(e){return new Promise(t=>{setTimeout(t,e)})}function L2(e,t){if(e==null)return null;if(typeof e=="string")return e;if(AM(e)){if(t&&(t.split("/")[0]==="text"||t.split(";")[0].trim()==="application/json"))try{return vA(e)}catch{}return Xt(e)}return e}function Pkt(e){return cl(e.replace(/%([0-9a-f][0-9a-f])/gi,(t,r)=>String.fromCharCode(parseInt(r,16))))}function $Ke(e,t,r){const n=typeof e=="object"&&e.throttleLimit!=null?e.throttleLimit:12;Ip.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof e=="object"?e.throttleCallback:null,a=typeof e=="object"&&typeof e.throttleSlotInterval=="number"?e.throttleSlotInterval:100;Ip.assertArgument(a>0&&a%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",a);const o=typeof e=="object"?!!e.errorPassThrough:!1,s={};let l=null;const u={method:"GET"};let c=!1,f=2*60*1e3;if(typeof e=="string")l=e;else if(typeof e=="object"){if((e==null||e.url==null)&&Ip.throwArgumentError("missing URL","connection.url",e),l=e.url,typeof e.timeout=="number"&&e.timeout>0&&(f=e.timeout),e.headers)for(const E in e.headers)s[E.toLowerCase()]={key:E,value:String(e.headers[E])},["if-none-match","if-modified-since"].indexOf(E.toLowerCase())>=0&&(c=!0);if(u.allowGzip=!!e.allowGzip,e.user!=null&&e.password!=null){l.substring(0,6)!=="https:"&&e.allowInsecureAuthentication!==!0&&Ip.throwError("basic authentication requires a secure https url",Ne.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:e.user,password:"[REDACTED]"});const E=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+d2e(cl(E))}}e.skipFetchSetup!=null&&(u.skipFetchSetup=!!e.skipFetchSetup),e.fetchOptions!=null&&(u.fetchOptions=Do(e.fetchOptions))}const d=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),h=l?l.match(d):null;if(h)try{const E={statusCode:200,statusMessage:"OK",headers:{"content-type":h[1]||"text/plain"},body:h[2]?f2e(h[3]):Pkt(h[3])};let b=E.body;return r&&(b=r(E.body,E)),Promise.resolve(b)}catch(E){Ip.throwError("processing response error",Ne.errors.SERVER_ERROR,{body:L2(h[1],h[2]),error:E,requestBody:null,requestMethod:"GET",url:l})}t&&(u.method="POST",u.body=t,s["content-type"]==null&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),s["content-length"]==null&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));const p={};Object.keys(s).forEach(E=>{const b=s[E];p[b.key]=b.value}),u.headers=p;const g=function(){let E=null;return{promise:new Promise(function(T,x){f&&(E=setTimeout(()=>{E!=null&&(E=null,x(Ip.makeError("timeout",Ne.errors.TIMEOUT,{requestBody:L2(u.body,p["content-type"]),requestMethod:u.method,timeout:f,url:l})))},f))}),cancel:function(){E!=null&&(clearTimeout(E),E=null)}}}(),m=function(){return Lkt(this,void 0,void 0,function*(){for(let E=0;E<n;E++){let b=null;try{if(b=yield Nkt(l,u),E<n){if(b.statusCode===301||b.statusCode===302){const T=b.headers.location||"";if(u.method==="GET"&&T.match(/^https:/)){l=b.headers.location;continue}}else if(b.statusCode===429){let T=!0;if(i&&(T=yield i(E,l)),T){let x=0;const N=b.headers["retry-after"];typeof N=="string"&&N.match(/^[1-9][0-9]*$/)?x=parseInt(N)*1e3:x=a*parseInt(String(Math.random()*Math.pow(2,E))),yield kxe(x);continue}}}}catch(T){b=T.response,b==null&&(g.cancel(),Ip.throwError("missing response",Ne.errors.SERVER_ERROR,{requestBody:L2(u.body,p["content-type"]),requestMethod:u.method,serverError:T,url:l}))}let w=b.body;if(c&&b.statusCode===304?w=null:!o&&(b.statusCode<200||b.statusCode>=300)&&(g.cancel(),Ip.throwError("bad response",Ne.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:L2(w,b.headers?b.headers["content-type"]:null),requestBody:L2(u.body,p["content-type"]),requestMethod:u.method,url:l})),r)try{const T=yield r(w,b);return g.cancel(),T}catch(T){if(T.throttleRetry&&E<n){let x=!0;if(i&&(x=yield i(E,l)),x){const N=a*parseInt(String(Math.random()*Math.pow(2,E)));yield kxe(N);continue}}g.cancel(),Ip.throwError("processing response error",Ne.errors.SERVER_ERROR,{body:L2(w,b.headers?b.headers["content-type"]:null),error:T,requestBody:L2(u.body,p["content-type"]),requestMethod:u.method,url:l})}return g.cancel(),w}return Ip.throwError("failed response",Ne.errors.SERVER_ERROR,{requestBody:L2(u.body,p["content-type"]),requestMethod:u.method,url:l})})}();return Promise.race([g.promise,m])}function xR(e,t,r){let n=(a,o)=>{let s=null;if(a!=null)try{s=JSON.parse(vA(a))}catch(l){Ip.throwError("invalid JSON",Ne.errors.SERVER_ERROR,{body:a,error:l})}return r&&(s=r(s,o)),s},i=null;if(t!=null){i=cl(t);const a=typeof e=="string"?{url:e}:Do(e);a.headers?Object.keys(a.headers).filter(s=>s.toLowerCase()==="content-type").length!==0||(a.headers=Do(a.headers),a.headers["content-type"]="application/json"):a.headers={"content-type":"application/json"},e=a}return $Ke(e,i,n)}function f3(e,t){return t||(t={}),t=Do(t),t.floor==null&&(t.floor=0),t.ceiling==null&&(t.ceiling=1e4),t.interval==null&&(t.interval=250),new Promise(function(r,n){let i=null,a=!1;const o=()=>a?!1:(a=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout(()=>{o()&&n(new Error("timeout"))},t.timeout));const s=t.retryLimit;let l=0;function u(){return e().then(function(c){if(c!==void 0)o()&&r(c);else if(t.oncePoll)t.oncePoll.once("poll",u);else if(t.onceBlock)t.onceBlock.once("block",u);else if(!a){if(l++,l>s){o()&&n(new Error("retry limit reached"));return}let f=t.interval*parseInt(String(Math.random()*Math.pow(2,l)));f<t.floor&&(f=t.floor),f>t.ceiling&&(f=t.ceiling),setTimeout(u,f)}return null},function(c){o()&&n(c)})}u()})}var bG="qpzry9x8gf2tvdw0s3jn54khce6mua7l",Phe={};for(var F$=0;F$<bG.length;F$++){var Mie=bG.charAt(F$);if(Phe[Mie]!==void 0)throw new TypeError(Mie+" is ambiguous");Phe[Mie]=F$}function n4(e){var t=e>>25;return(e&33554431)<<5^-(t>>0&1)&996825010^-(t>>1&1)&642813549^-(t>>2&1)&513874426^-(t>>3&1)&1027748829^-(t>>4&1)&705979059}function kKe(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=n4(t)^n>>5}for(t=n4(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=n4(t)^i&31}return t}function Mkt(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");e=e.toLowerCase();var n=kKe(e);if(typeof n=="string")throw new Error(n);for(var i=e+"1",a=0;a<t.length;++a){var o=t[a];if(o>>5)throw new Error("Non 5-bit word");n=n4(n)^o,i+=bG.charAt(o)}for(a=0;a<6;++a)n=n4(n);for(n^=1,a=0;a<6;++a){var s=n>>(5-a)*5&31;i+=bG.charAt(s)}return i}function BKe(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;e=r;var i=e.lastIndexOf("1");if(i===-1)return"No separator character for "+e;if(i===0)return"Missing prefix for "+e;var a=e.slice(0,i),o=e.slice(i+1);if(o.length<6)return"Data too short";var s=kKe(a);if(typeof s=="string")return s;for(var l=[],u=0;u<o.length;++u){var c=o.charAt(u),f=Phe[c];if(f===void 0)return"Unknown character "+c;s=n4(s)^f,!(u+6>=o.length)&&l.push(f)}return s!==1?"Invalid checksum for "+e:{prefix:a,words:l}}function Dkt(){var e=BKe.apply(null,arguments);if(typeof e=="object")return e}function $kt(e){var t=BKe.apply(null,arguments);if(typeof t=="object")return t;throw new Error(t)}function ez(e,t,r,n){for(var i=0,a=0,o=(1<<r)-1,s=[],l=0;l<e.length;++l)for(i=i<<t|e[l],a+=t;a>=r;)a-=r,s.push(i>>a&o);if(n)a>0&&s.push(i<<r-a&o);else{if(a>=t)return"Excess padding";if(i<<r-a&o)return"Non-zero padding"}return s}function kkt(e){var t=ez(e,8,5,!0);if(Array.isArray(t))return t}function Bkt(e){var t=ez(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)}function Ukt(e){var t=ez(e,5,8,!1);if(Array.isArray(t))return t}function Fkt(e){var t=ez(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}var Hkt={decodeUnsafe:Dkt,decode:$kt,encode:Mkt,toWordsUnsafe:kkt,toWords:Bkt,fromWordsUnsafe:Ukt,fromWords:Fkt};const Bxe=Nn(Hkt),Xc="providers/5.7.2",v8=new Ne(Xc);let Mhe=class Zr{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),a=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),l=this.number.bind(this),u=this.type.bind(this),c=f=>this.data(f,!0);return t.transaction={hash:o,type:u,accessList:Zr.allowNull(this.accessList.bind(this),null),blockHash:Zr.allowNull(o,null),blockNumber:Zr.allowNull(l,null),transactionIndex:Zr.allowNull(l,null),confirmations:Zr.allowNull(l,null),from:r,gasPrice:Zr.allowNull(n),maxPriorityFeePerGas:Zr.allowNull(n),maxFeePerGas:Zr.allowNull(n),gasLimit:n,to:Zr.allowNull(r,null),value:n,nonce:l,data:a,r:Zr.allowNull(this.uint256),s:Zr.allowNull(this.uint256),v:Zr.allowNull(l),creates:Zr.allowNull(r,null),raw:Zr.allowNull(a)},t.transactionRequest={from:Zr.allowNull(r),nonce:Zr.allowNull(l),gasLimit:Zr.allowNull(n),gasPrice:Zr.allowNull(n),maxPriorityFeePerGas:Zr.allowNull(n),maxFeePerGas:Zr.allowNull(n),to:Zr.allowNull(r),value:Zr.allowNull(n),data:Zr.allowNull(c),type:Zr.allowNull(l),accessList:Zr.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:o,address:r,topics:Zr.arrayOf(o),data:a,logIndex:l,blockHash:o},t.receipt={to:Zr.allowNull(this.address,null),from:Zr.allowNull(this.address,null),contractAddress:Zr.allowNull(r,null),transactionIndex:l,root:Zr.allowNull(s),gasUsed:n,logsBloom:Zr.allowNull(a),blockHash:o,transactionHash:o,logs:Zr.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:Zr.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:Zr.allowNull(n),status:Zr.allowNull(l),type:u},t.block={hash:Zr.allowNull(o),parentHash:o,number:l,timestamp:l,nonce:Zr.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:Zr.allowNull(r),extraData:a,transactions:Zr.allowNull(Zr.arrayOf(o)),baseFeePerGas:Zr.allowNull(n)},t.blockWithTransactions=Do(t.block),t.blockWithTransactions.transactions=Zr.allowNull(Zr.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:Zr.allowNull(i,void 0),toBlock:Zr.allowNull(i,void 0),blockHash:Zr.allowNull(o,void 0),address:Zr.allowNull(r,void 0),topics:Zr.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:Zr.allowNull(l),blockHash:Zr.allowNull(o),transactionIndex:l,removed:Zr.allowNull(this.boolean.bind(this)),address:r,data:Zr.allowFalsish(a,"0x"),topics:Zr.arrayOf(o),transactionHash:o,logIndex:l},t}accessList(t){return E_(t||[])}number(t){return t==="0x"?0:Bt.from(t).toNumber()}type(t){return t==="0x"||t==null?0:Bt.from(t).toNumber()}bigNumber(t){return Bt.from(t)}boolean(t){if(typeof t=="boolean")return t;if(typeof t=="string"){if(t=t.toLowerCase(),t==="true")return!0;if(t==="false")return!1}throw new Error("invalid boolean - "+t)}hex(t,r){return typeof t=="string"&&(!r&&t.substring(0,2)!=="0x"&&(t="0x"+t),si(t))?t.toLowerCase():v8.throwArgumentError("invalid hash","value",t)}data(t,r){const n=this.hex(t,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+t);return n}address(t){return va(t)}callAddress(t){if(!si(t,32))return null;const r=va(nl(t,12));return r===wXe?null:r}contractAddress(t){return jj(t)}blockTag(t){if(t==null)return"latest";if(t==="earliest")return"0x0";switch(t){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return t}if(typeof t=="number"||si(t))return CM(t);throw new Error("invalid blockTag")}hash(t,r){const n=this.hex(t,r);return Eg(n)!==32?v8.throwArgumentError("invalid hash","value",t):n}difficulty(t){if(t==null)return null;const r=Bt.from(t);try{return r.toNumber()}catch{}return null}uint256(t){if(!si(t))throw new Error("invalid uint256");return xo(t,32)}_block(t,r){t.author!=null&&t.miner==null&&(t.miner=t.author);const n=t._difficulty!=null?t._difficulty:t.difficulty,i=Zr.check(r,t);return i._difficulty=n==null?null:Bt.from(n),i}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return Zr.check(this.formats.transactionRequest,t)}transactionResponse(t){t.gas!=null&&t.gasLimit==null&&(t.gasLimit=t.gas),t.to&&Bt.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),t.input!=null&&t.data==null&&(t.data=t.input),t.to==null&&t.creates==null&&(t.creates=this.contractAddress(t)),(t.type===1||t.type===2)&&t.accessList==null&&(t.accessList=[]);const r=Zr.check(this.formats.transaction,t);if(t.chainId!=null){let n=t.chainId;si(n)&&(n=Bt.from(n).toNumber()),r.chainId=n}else{let n=t.networkId;n==null&&r.v==null&&(n=t.chainId),si(n)&&(n=Bt.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(t){return yKe(t)}receiptLog(t){return Zr.check(this.formats.receiptLog,t)}receipt(t){const r=Zr.check(this.formats.receipt,t);if(r.root!=null)if(r.root.length<=4){const n=Bt.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&v8.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):v8.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&v8.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(t){return Array.isArray(t)?t.map(r=>this.topics(r)):t!=null?this.hash(t,!0):null}filter(t){return Zr.check(this.formats.filter,t)}filterLog(t){return Zr.check(this.formats.filterLog,t)}static check(t,r){const n={};for(const i in t)try{const a=t[i](r[i]);a!==void 0&&(n[i]=a)}catch(a){throw a.checkKey=i,a.checkValue=r[i],a}return n}static allowNull(t,r){return function(n){return n==null?r:t(n)}}static allowFalsish(t,r){return function(n){return n?t(n):r}}static arrayOf(t){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(t(i))}),n}}};function UKe(e){return e&&typeof e.isCommunityResource=="function"}function Dhe(e){return UKe(e)&&e.isCommunityResource()}let Uxe=!1;function OM(){Uxe||(Uxe=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var Yn=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const Pi=new Ne(Xc),Gkt=10;function Fxe(e){return e==null?"null":(Eg(e)!==32&&Pi.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function Hxe(e){for(e=e.slice();e.length>0&&e[e.length-1]==null;)e.pop();return e.map(t=>{if(Array.isArray(t)){const r={};t.forEach(i=>{r[Fxe(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return Fxe(t)}).join("&")}function Vkt(e){return e===""?[]:e.split(/&/g).map(t=>{if(t==="")return[];const r=t.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function s5(e){if(typeof e=="string"){if(e=e.toLowerCase(),Eg(e)===32)return"tx:"+e;if(e.indexOf(":")===-1)return e}else{if(Array.isArray(e))return"filter:*:"+Hxe(e);if(WMt.isForkEvent(e))throw Pi.warn("not implemented"),new Error("not implemented");if(e&&typeof e=="object")return"filter:"+(e.address||"*")+":"+Hxe(e.topics||[])}throw new Error("invalid event - "+e)}function g8(){return new Date().getTime()}function Gxe(e){return new Promise(t=>{setTimeout(t,e)})}const Wkt=["block","network","pending","poll"];let jkt=class{constructor(t,r,n){at(this,"tag",t),at(this,"listener",r),at(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return t[0]!=="tx"?null:t[1]}get filter(){const t=this.tag.split(":");if(t[0]!=="filter")return null;const r=t[1],n=Vkt(t[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||Wkt.indexOf(this.tag)>=0}};const zkt={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function Die(e){return xo(Bt.from(e).toHexString(),32)}function Vxe(e){return fx.encode(Co([e,nl(By(By(e)),0,4)]))}const FKe=new RegExp("^(ipfs)://(.*)$","i"),Wxe=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),FKe,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function hF(e,t){try{return vA(N7(e,t))}catch{}return null}function N7(e,t){if(e==="0x")return null;const r=Bt.from(nl(e,t,t+32)).toNumber(),n=Bt.from(nl(e,r,r+32)).toNumber();return nl(e,r+32,r+32+n)}function $ie(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):Pi.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function jxe(e){const t=$t(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Ykt(e){if(e.length%32===0)return e;const t=new Uint8Array(Math.ceil(e.length/32)*32);return t.set(e),t}function HKe(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const i=$t(e[n]);t[n]=jxe(r),t.push(jxe(i.length)),t.push(Ykt(i)),r+=32+Math.ceil(i.length/32)*32}return Tf(t)}class $he{constructor(t,r,n,i){at(this,"provider",t),at(this,"name",n),at(this,"address",t.formatter.address(r)),at(this,"_resolvedAddress",i)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then(t=>Bt.from(t).eq(1)).catch(t=>{if(t.code===Ne.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t})),this._supportsEip2544}_fetch(t,r){return Yn(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Tf([t,GL(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Tf(["0x9061b923",HKe([UXe(this.name),n.data])]));try{let a=yield this.provider.call(n);return $t(a).length%32===4&&Pi.throwError("resolver threw error",Ne.errors.CALL_EXCEPTION,{transaction:n,data:a}),i&&(a=N7(a,0)),a}catch(a){if(a.code===Ne.errors.CALL_EXCEPTION)return null;throw a}})}_fetchBytes(t,r){return Yn(this,void 0,void 0,function*(){const n=yield this._fetch(t,r);return n!=null?N7(n,0):null})}_getAddress(t,r){const n=zkt[String(t)];if(n==null&&Pi.throwError(`unsupported coin type: ${t}`,Ne.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=$t(r);if(n.p2pkh!=null){const a=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(a){const o=parseInt(a[1],16);if(a[2].length===o*2&&o>=1&&o<=75)return Vxe(Co([[n.p2pkh],"0x"+a[2]]))}}if(n.p2sh!=null){const a=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){const o=parseInt(a[1],16);if(a[2].length===o*2&&o>=1&&o<=75)return Vxe(Co([[n.p2sh],"0x"+a[2]]))}}if(n.prefix!=null){const a=i[1];let o=i[0];if(o===0?a!==20&&a!==32&&(o=-1):o=-1,o>=0&&i.length===2+a&&a>=1&&a<=75){const s=Bxe.toWords(i.slice(2));return s.unshift(o),Bxe.encode(n.prefix,s)}}return null}getAddress(t){return Yn(this,void 0,void 0,function*(){if(t==null&&(t=60),t===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===s2e?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===Ne.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",Die(t));if(r==null||r==="0x")return null;const n=this._getAddress(t,r);return n==null&&Pi.throwError("invalid or unsupported coin data",Ne.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:r}),n})}getAvatar(){return Yn(this,void 0,void 0,function*(){const t=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;n<Wxe.length;n++){const i=r.match(Wxe[n]);if(i==null)continue;const a=i[1].toLowerCase();switch(a){case"https":return t.push({type:"url",content:r}),{linkage:t,url:r};case"data":return t.push({type:"data",content:r}),{linkage:t,url:r};case"ipfs":return t.push({type:"ipfs",content:r}),{linkage:t,url:$ie(r)};case"erc721":case"erc1155":{const o=a==="erc721"?"0xc87b56dd":"0x0e89341c";t.push({type:a,content:r});const s=this._resolvedAddress||(yield this.getAddress()),l=(i[2]||"").split("/");if(l.length!==2)return null;const u=yield this.provider.formatter.address(l[0]),c=xo(Bt.from(l[1]).toHexString(),32);if(a==="erc721"){const g=this.provider.formatter.callAddress(yield this.provider.call({to:u,data:Tf(["0x6352211e",c])}));if(s!==g)return null;t.push({type:"owner",content:g})}else if(a==="erc1155"){const g=Bt.from(yield this.provider.call({to:u,data:Tf(["0x00fdd58e",xo(s,32),c])}));if(g.isZero())return null;t.push({type:"balance",content:g.toString()})}const f={to:this.provider.formatter.address(l[0]),data:Tf([o,c])};let d=hF(yield this.provider.call(f),0);if(d==null)return null;t.push({type:"metadata-url-base",content:d}),a==="erc1155"&&(d=d.replace("{id}",c.substring(2)),t.push({type:"metadata-url-expanded",content:d})),d.match(/^ipfs:/i)&&(d=$ie(d)),t.push({type:"metadata-url",content:d});const h=yield xR(d);if(!h)return null;t.push({type:"metadata",content:JSON.stringify(h)});let p=h.image;if(typeof p!="string")return null;if(!p.match(/^(https:\/\/|data:)/i)){if(p.match(FKe)==null)return null;t.push({type:"url-ipfs",content:p}),p=$ie(p)}return t.push({type:"url",content:p}),{linkage:t,url:p}}}}}catch{}return null})}getContentHash(){return Yn(this,void 0,void 0,function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(t==null||t==="0x")return null;const r=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const o=parseInt(r[3],16);if(r[4].length===o*2)return"ipfs://"+fx.encode("0x"+r[1])}const n=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const o=parseInt(n[3],16);if(n[4].length===o*2)return"ipns://"+fx.encode("0x"+n[1])}const i=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(i&&i[1].length===32*2)return"bzz://"+i[1];const a=t.match(/^0x90b2c605([0-9a-f]*)$/);if(a&&a[1].length===34*2){const o={"=":"","+":"-","/":"_"};return"sia://"+d2e("0x"+a[1]).replace(/[=+\/]/g,l=>o[l])}return Pi.throwError("invalid or unsupported content hash data",Ne.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})})}getText(t){return Yn(this,void 0,void 0,function*(){let r=cl(t);r=Co([Die(64),Die(r.length),r]),r.length%32!==0&&(r=Co([r,xo("0x",32-t.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Xt(r));return n==null||n==="0x"?null:vA(n)})}}let kie=null,qkt=1;class tz extends gA{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),at(this,"anyNetwork",t==="any"),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch(r=>{}),this._ready().catch(r=>{});else{const r=Zu(new.target,"getNetwork")(t);r?(at(this,"_network",r),this.emit("network",r,null)):Pi.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return Yn(this,void 0,void 0,function*(){if(this._network==null){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch{}t==null&&(t=yield this.detectNetwork()),t||Pi.throwError("no network detected",Ne.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=t:at(this,"_network",t),this.emit("network",t,null))}return this._network})}get ready(){return f3(()=>this._ready().then(t=>t,t=>{if(!(t.code===Ne.errors.NETWORK_ERROR&&t.event==="noNetwork"))throw t}))}static getFormatter(){return kie==null&&(kie=new Mhe),kie}static getNetwork(t){return x2e(t??"homestead")}ccipReadFetch(t,r,n){return Yn(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=t.to.toLowerCase(),a=r.toLowerCase(),o=[];for(let s=0;s<n.length;s++){const l=n[s],u=l.replace("{sender}",i).replace("{data}",a),c=l.indexOf("{data}")>=0?null:JSON.stringify({data:a,sender:i}),f=yield xR({url:u,errorPassThrough:!0},c,(h,p)=>(h.status=p.statusCode,h));if(f.data)return f.data;const d=f.message||"unknown error";if(f.status>=400&&f.status<500)return Pi.throwError(`response not found during CCIP fetch: ${d}`,Ne.errors.SERVER_ERROR,{url:l,errorMessage:d});o.push(d)}return Pi.throwError(`error encountered during CCIP fetch: ${o.map(s=>JSON.stringify(s)).join(", ")}`,Ne.errors.SERVER_ERROR,{urls:n,errorMessages:o})})}_getInternalBlockNumber(t){return Yn(this,void 0,void 0,function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const a=yield i;if(g8()-a.respTime<=t)return a.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=g8(),n=Ms({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:a})=>{if(a)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),a;const o=g8();return i=Bt.from(i).toNumber(),i<this._maxInternalBlockNumber&&(i=this._maxInternalBlockNumber),this._maxInternalBlockNumber=i,this._setFastBlockNumber(i),{blockNumber:i,reqTime:r,respTime:o}});return this._internalBlockNumber=n,n.catch(i=>{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return Yn(this,void 0,void 0,function*(){const t=qkt++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",t,n),n===this._lastBlockNumber){this.emit("didPoll",t);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Pi.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Pi.makeError("network block skew detected",Ne.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const a=this._emitted[i];a!=="pending"&&n-a>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const a=i.hash;let o=this.getTransactionReceipt(a).then(s=>(!s||s.blockNumber==null||(this._emitted["t:"+a]=s.blockNumber,this.emit(a,s)),null)).catch(s=>{this.emit("error",s)});r.push(o);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const a=i.filter;a.fromBlock=i._lastBlockNumber+1,a.toBlock=n;const o=a.toBlock-this._maxFilterBlockRange;o>a.fromBlock&&(a.fromBlock=o),a.fromBlock<0&&(a.fromBlock=0);const s=this.getLogs(a).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(u=>{u.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=u.blockNumber),this._emitted["b:"+u.blockHash]=u.blockNumber,this._emitted["t:"+u.transactionHash]=u.blockNumber,this.emit(a,u)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(s)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",t)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return Yn(this,void 0,void 0,function*(){return Pi.throwError("provider does not support network detection",Ne.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return Yn(this,void 0,void 0,function*(){const t=yield this._ready(),r=yield this.detectNetwork();if(t.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,t),yield Gxe(0),this._network;const n=Pi.makeError("underlying network changed",Ne.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r});throw this.emit("error",n),n}return t})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(t=>{this._setFastBlockNumber(t)},t=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(t){t&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if(typeof t!="number"||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const t=g8();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(t){this._fastBlockNumber!=null&&t<this._fastBlockNumber||(this._fastQueryDate=g8(),(this._fastBlockNumber==null||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,r,n){return Yn(this,void 0,void 0,function*(){return this._waitForTransaction(t,r??1,n||0,null)})}_waitForTransaction(t,r,n,i){return Yn(this,void 0,void 0,function*(){const a=yield this.getTransactionReceipt(t);return(a?a.confirmations:0)>=r?a:new Promise((o,s)=>{const l=[];let u=!1;const c=function(){return u?!0:(u=!0,l.forEach(d=>{d()}),!1)},f=d=>{d.confirmations<r||c()||o(d)};if(this.on(t,f),l.push(()=>{this.removeListener(t,f)}),i){let d=i.startBlock,h=null;const p=g=>Yn(this,void 0,void 0,function*(){u||(yield Gxe(1e3),this.getTransactionCount(i.from).then(m=>Yn(this,void 0,void 0,function*(){if(!u){if(m<=i.nonce)d=g;else{{const E=yield this.getTransaction(t);if(E&&E.blockNumber!=null)return}for(h==null&&(h=d-3,h<i.startBlock&&(h=i.startBlock));h<=g;){if(u)return;const E=yield this.getBlockWithTransactions(h);for(let b=0;b<E.transactions.length;b++){const w=E.transactions[b];if(w.hash===t)return;if(w.from===i.from&&w.nonce===i.nonce){if(u)return;const T=yield this.waitForTransaction(w.hash,r);if(c())return;let x="replaced";w.data===i.data&&w.to===i.to&&w.value.eq(i.value)?x="repriced":w.data==="0x"&&w.from===w.to&&w.value.isZero()&&(x="cancelled"),s(Pi.makeError("transaction was replaced",Ne.errors.TRANSACTION_REPLACED,{cancelled:x==="replaced"||x==="cancelled",reason:x,replacement:this._wrapTransaction(w),hash:t,receipt:T}));return}}h++}}u||this.once("block",p)}}),m=>{u||this.once("block",p)}))});if(u)return;this.once("block",p),l.push(()=>{this.removeListener("block",p)})}if(typeof n=="number"&&n>0){const d=setTimeout(()=>{c()||s(Pi.makeError("timeout exceeded",Ne.errors.TIMEOUT,{timeout:n}))},n);d.unref&&d.unref(),l.push(()=>{clearTimeout(d)})}})})}getBlockNumber(){return Yn(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return Bt.from(t)}catch(r){return Pi.throwError("bad result from backend",Ne.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:r})}})}getBalance(t,r){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Ms({address:this._getAddress(t),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return Bt.from(i)}catch(a){return Pi.throwError("bad result from backend",Ne.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:a})}})}getTransactionCount(t,r){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Ms({address:this._getAddress(t),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return Bt.from(i).toNumber()}catch(a){return Pi.throwError("bad result from backend",Ne.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:a})}})}getCode(t,r){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Ms({address:this._getAddress(t),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Xt(i)}catch(a){return Pi.throwError("bad result from backend",Ne.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:a})}})}getStorageAt(t,r,n){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield Ms({address:this._getAddress(t),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(o=>CM(o))}),a=yield this.perform("getStorageAt",i);try{return Xt(a)}catch(o){return Pi.throwError("bad result from backend",Ne.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:a,error:o})}})}_wrapTransaction(t,r,n){if(r!=null&&Eg(r)!==32)throw new Error("invalid response - sendTransaction");const i=t;return r!=null&&t.hash!==r&&Pi.throwError("Transaction hash mismatch from Provider.sendTransaction.",Ne.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:r}),i.wait=(a,o)=>Yn(this,void 0,void 0,function*(){a==null&&(a=1),o==null&&(o=0);let s;a!==0&&n!=null&&(s={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:n});const l=yield this._waitForTransaction(t.hash,a,o,s);return l==null&&a===0?null:(this._emitted["t:"+t.hash]=l.blockNumber,l.status===0&&Pi.throwError("transaction failed",Ne.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:l}),l)}),i}sendTransaction(t){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(t).then(a=>Xt(a)),n=this.formatter.transaction(t);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const a=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,a,i)}catch(a){throw a.transaction=n,a.transactionHash=n.hash,a}})}_getTransactionRequest(t){return Yn(this,void 0,void 0,function*(){const r=yield t,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?this._getAddress(a):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?Bt.from(a):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?Xt(a):null))}),this.formatter.transactionRequest(yield Ms(n))})}_getFilter(t){return Yn(this,void 0,void 0,function*(){t=yield t;const r={};return t.address!=null&&(r.address=this._getAddress(t.address)),["blockHash","topics"].forEach(n=>{t[n]!=null&&(r[n]=t[n])}),["fromBlock","toBlock"].forEach(n=>{t[n]!=null&&(r[n]=this._getBlockTag(t[n]))}),this.formatter.filter(yield Ms(r))})}_call(t,r,n){return Yn(this,void 0,void 0,function*(){n>=Gkt&&Pi.throwError("CCIP read exceeded maximum redirections",Ne.errors.SERVER_ERROR,{redirects:n,transaction:t});const i=t.to,a=yield this.perform("call",{transaction:t,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&a.substring(0,10)==="0x556f1830"&&Eg(a)%32===4)try{const o=nl(a,4),s=nl(o,0,32);Bt.from(s).eq(i)||Pi.throwError("CCIP Read sender did not match",Ne.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:a});const l=[],u=Bt.from(nl(o,32,64)).toNumber(),c=Bt.from(nl(o,u,u+32)).toNumber(),f=nl(o,u+32);for(let E=0;E<c;E++){const b=hF(f,E*32);b==null&&Pi.throwError("CCIP Read contained corrupt URL string",Ne.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:a}),l.push(b)}const d=N7(o,64);Bt.from(nl(o,100,128)).isZero()||Pi.throwError("CCIP Read callback selector included junk",Ne.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:a});const h=nl(o,96,100),p=N7(o,128),g=yield this.ccipReadFetch(t,d,l);g==null&&Pi.throwError("CCIP Read disabled or provided no URLs",Ne.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:a});const m={to:i,data:Tf([h,HKe([g,p])])};return this._call(m,r,n+1)}catch(o){if(o.code===Ne.errors.SERVER_ERROR)throw o}try{return Xt(a)}catch(o){return Pi.throwError("bad result from backend",Ne.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:r},result:a,error:o})}})}call(t,r){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield Ms({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(r),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1)})}estimateGas(t){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Ms({transaction:this._getTransactionRequest(t)}),n=yield this.perform("estimateGas",r);try{return Bt.from(n)}catch(i){return Pi.throwError("bad result from backend",Ne.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:i})}})}_getAddress(t){return Yn(this,void 0,void 0,function*(){t=yield t,typeof t!="string"&&Pi.throwArgumentError("invalid address or ENS name","name",t);const r=yield this.resolveName(t);return r==null&&Pi.throwError("ENS name not configured",Ne.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),r})}_getBlock(t,r){return Yn(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;let n=-128;const i={includeTransactions:!!r};if(si(t,32))i.blockHash=t;else try{i.blockTag=yield this._getBlockTag(t),si(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16))}catch{Pi.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return f3(()=>Yn(this,void 0,void 0,function*(){const a=yield this.perform("getBlock",i);if(a==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let o=null;for(let l=0;l<a.transactions.length;l++){const u=a.transactions[l];if(u.blockNumber==null)u.confirmations=0;else if(u.confirmations==null){o==null&&(o=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let c=o-u.blockNumber+1;c<=0&&(c=1),u.confirmations=c}}const s=this.formatter.blockWithTransactions(a);return s.transactions=s.transactions.map(l=>this._wrapTransaction(l)),s}return this.formatter.block(a)}),{oncePoll:this})})}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return Yn(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;const r={transactionHash:this.formatter.hash(t,!0)};return f3(()=>Yn(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+t]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(t){return Yn(this,void 0,void 0,function*(){yield this.getNetwork(),t=yield t;const r={transactionHash:this.formatter.hash(t,!0)};return f3(()=>Yn(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+t]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let o=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;o<=0&&(o=1),i.confirmations=o}return i}),{oncePoll:this})})}getLogs(t){return Yn(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Ms({filter:this._getFilter(t)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),Mhe.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return Yn(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(t){return Yn(this,void 0,void 0,function*(){if(t=yield t,typeof t=="number"&&t<0){t%1&&Pi.throwArgumentError("invalid BlockTag","blockTag",t);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=t,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(t)})}getResolver(t){return Yn(this,void 0,void 0,function*(){let r=t;for(;;){if(r===""||r==="."||t!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new $he(this,n,t);return r!==t&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(t,r){return Yn(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Pi.throwError("network does not support ENS",Ne.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+GL(t).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(t){return Yn(this,void 0,void 0,function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(n){if(si(t))throw n}typeof t!="string"&&Pi.throwArgumentError("invalid ENS name","name",t);const r=yield this.getResolver(t);return r?yield r.getAddress():null})}lookupAddress(t){return Yn(this,void 0,void 0,function*(){t=yield t,t=this.formatter.address(t);const r=t.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=hF(yield this.call({to:n,data:"0x691f3431"+GL(r).substring(2)}),0);return(yield this.resolveName(i))!=t?null:i})}getAvatar(t){return Yn(this,void 0,void 0,function*(){let r=null;if(si(t)){const a=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",o=yield this._getResolver(a,"getAvatar");if(!o)return null;r=new $he(this,o,a);try{const s=yield r.getAvatar();if(s)return s.url}catch(s){if(s.code!==Ne.errors.CALL_EXCEPTION)throw s}try{const s=hF(yield this.call({to:o,data:"0x691f3431"+GL(a).substring(2)}),0);r=yield this.getResolver(s)}catch(s){if(s.code!==Ne.errors.CALL_EXCEPTION)throw s;return null}}else if(r=yield this.getResolver(t),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(t,r){return Pi.throwError(t+" not implemented",Ne.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(t){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(t,r,n){const i=new jkt(s5(t),r,n);return this._events.push(i),this._startEvent(i),this}on(t,r){return this._addEventListener(t,r,!1)}once(t,r){return this._addEventListener(t,r,!0)}emit(t,...r){let n=!1,i=[],a=s5(t);return this._events=this._events.filter(o=>o.tag!==a?!0:(setTimeout(()=>{o.listener.apply(this,r)},0),n=!0,o.once?(i.push(o),!1):!0)),i.forEach(o=>{this._stopEvent(o)}),n}listenerCount(t){if(!t)return this._events.length;let r=s5(t);return this._events.filter(n=>n.tag===r).length}listeners(t){if(t==null)return this._events.map(n=>n.listener);let r=s5(t);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(t,r){if(r==null)return this.removeAllListeners(t);const n=[];let i=!1,a=s5(t);return this._events=this._events.filter(o=>o.tag!==a||o.listener!=r||i?!0:(i=!0,n.push(o),!1)),n.forEach(o=>{this._stopEvent(o)}),this}removeAllListeners(t){let r=[];if(t==null)r=this._events,this._events=[];else{const n=s5(t);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}var ty=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const Al=new Ne(Xc),Xkt=["call","estimateGas"];function jL(e,t){if(e==null)return null;if(typeof e.message=="string"&&e.message.match("reverted")){const r=si(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if(typeof e=="object"){for(const r in e){const n=jL(e[r],t);if(n)return n}return null}if(typeof e=="string")try{return jL(JSON.parse(e),t)}catch{}return null}function GKe(e,t,r){const n=r.transaction||r.signedTransaction;if(e==="call"){const a=jL(t,!0);if(a)return a.data;Al.throwError("missing revert data in call exception; Transaction reverted without a reason string",Ne.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if(e==="estimateGas"){let a=jL(t.body,!1);a==null&&(a=jL(t,!1)),a&&Al.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ne.errors.UNPREDICTABLE_GAS_LIMIT,{reason:a.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===Ne.errors.SERVER_ERROR&&t.error&&typeof t.error.message=="string"?i=t.error.message:typeof t.body=="string"?i=t.body:typeof t.responseText=="string"&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&Al.throwError("insufficient funds for intrinsic transaction cost",Ne.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&Al.throwError("nonce has already been used",Ne.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Al.throwError("replacement fee too low",Ne.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&Al.throwError("legacy pre-eip-155 transactions not supported",Ne.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Xkt.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&Al.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ne.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function zxe(e){return new Promise(function(t){setTimeout(t,e)})}function Kkt(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function m8(e){return e&&e.toLowerCase()}const khe={};class R2e extends m_{constructor(t,r,n){if(super(),t!==khe)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");at(this,"provider",r),n==null&&(n=0),typeof n=="string"?(at(this,"_address",this.provider.formatter.address(n)),at(this,"_index",null)):typeof n=="number"?(at(this,"_index",n),at(this,"_address",null)):Al.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(t){return Al.throwError("cannot alter JSON-RPC Signer connection",Ne.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Zkt(khe,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(t=>(t.length<=this._index&&Al.throwError("unknown account #"+this._index,Ne.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index])))}sendUncheckedTransaction(t){t=Do(t);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(t.gasLimit==null){const n=Do(t);n.from=r,t.gasLimit=this.provider.estimateGas(n)}return t.to!=null&&(t.to=Promise.resolve(t.to).then(n=>ty(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&Al.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),Ms({tx:Ms(t),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&Al.throwArgumentError("from address mismatch","transaction",t):n.from=i;const a=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[a]).then(o=>o,o=>(typeof o.message=="string"&&o.message.match(/user denied/i)&&Al.throwError("user rejected transaction",Ne.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),GKe("sendTransaction",o,a)))})}signTransaction(t){return Al.throwError("signing transactions is unsupported",Ne.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return ty(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(t);try{return yield f3(()=>ty(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(t){return ty(this,void 0,void 0,function*(){const r=typeof t=="string"?cl(t):t,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Xt(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Al.throwError("user rejected signing",Ne.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:t}),i}})}_legacySignMessage(t){return ty(this,void 0,void 0,function*(){const r=typeof t=="string"?cl(t):t,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Xt(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&Al.throwError("user rejected signing",Ne.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:t}),i}})}_signTypedData(t,r,n){return ty(this,void 0,void 0,function*(){const i=yield Wu.resolveNames(t,r,n,o=>this.provider.resolveName(o)),a=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[a.toLowerCase(),JSON.stringify(Wu.getPayload(i.domain,r,i.value))])}catch(o){throw typeof o.message=="string"&&o.message.match(/user denied/i)&&Al.throwError("user rejected signing",Ne.errors.ACTION_REJECTED,{action:"_signTypedData",from:a,messageData:{domain:i.domain,types:r,value:i.value}}),o}})}unlock(t){return ty(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),t,null])})}}class Zkt extends R2e{sendTransaction(t){return this.sendUncheckedTransaction(t).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const Qkt={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Lb extends tz{constructor(t,r){let n=r;n==null&&(n=new Promise((i,a)=>{setTimeout(()=>{this.detectNetwork().then(o=>{i(o)},o=>{a(o)})},0)})),super(n),t||(t=Zu(this.constructor,"defaultUrl")()),typeof t=="string"?at(this,"connection",Object.freeze({url:t})):at(this,"connection",Object.freeze(Do(t))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return ty(this,void 0,void 0,function*(){yield zxe(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch{try{t=yield this.send("net_version",[])}catch{}}if(t!=null){const r=Zu(this.constructor,"getNetwork");try{return r(Bt.from(t).toNumber())}catch(n){return Al.throwError("could not detect network",Ne.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:n})}}return Al.throwError("could not detect network",Ne.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(t){return new R2e(khe,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(t=>t.map(r=>this.formatter.address(r)))}send(t,r){const n={method:t,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Of(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(i&&this._cache[t])return this._cache[t];const a=xR(this.connection,JSON.stringify(n),Kkt).then(o=>(this.emit("debug",{action:"response",request:n,response:o,provider:this}),o),o=>{throw this.emit("debug",{action:"response",error:o,request:n,provider:this}),o});return i&&(this._cache[t]=a,setTimeout(()=>{this._cache[t]=null},0)),a}prepareRequest(t,r){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[m8(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[m8(r.address),r.blockTag]];case"getCode":return["eth_getCode",[m8(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[m8(r.address),xo(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[Zu(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[Zu(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=m8(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(t,r){return ty(this,void 0,void 0,function*(){if(t==="call"||t==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&Bt.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=yield this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(r=Do(r),r.transaction=Do(i),delete r.transaction.type)}}const n=this.prepareRequest(t,r);n==null&&Al.throwError(t+" not implemented",Ne.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(n[0],n[1])}catch(i){return GKe(t,i,r)}})}_startEvent(t){t.tag==="pending"&&this._startPending(),super._startEvent(t)}_startPending(){if(this._pendingFilter!=null)return;const t=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){t.send("eth_getFilterChanges",[n]).then(function(a){if(t._pendingFilter!=r)return null;let o=Promise.resolve();return a.forEach(function(s){t._emitted["t:"+s.toLowerCase()]="pending",o=o.then(function(){return t.getTransaction(s).then(function(l){return t.emit("pending",l),null})})}),o.then(function(){return zxe(1e3)})}).then(function(){if(t._pendingFilter!=r){t.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(a=>{})}return i(),n}).catch(n=>{})}_stopEvent(t){t.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,r){const n=Do(Qkt);if(r)for(const a in r)r[a]&&(n[a]=!0);n2e(t,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(a){if(t[a]==null)return;const o=CM(Bt.from(t[a]));a==="gasLimit"&&(a="gas"),i[a]=o}),["from","to","data"].forEach(function(a){t[a]!=null&&(i[a]=Xt(t[a]))}),t.accessList&&(i.accessList=E_(t.accessList)),i}}let zL=null;try{if(zL=WebSocket,zL==null)throw new Error("inject please")}catch{const t=new Ne(Xc);zL=function(){t.throwError("WebSockets not supported in this environment",Ne.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Bie=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const H$=new Ne(Xc);let Jkt=1;class rz extends Lb{constructor(t,r){r==="any"&&H$.throwError("WebSocketProvider does not support 'any' network yet",Ne.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),typeof t=="string"?super(t,r):super("_websocket",r),this._pollingInterval=-1,this._wsReady=!1,typeof t=="string"?at(this,"_websocket",new zL(this.connection.url)):at(this,"_websocket",t),at(this,"_requests",{}),at(this,"_subs",{}),at(this,"_subIds",{}),at(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach(i=>{this.websocket.send(this._requests[i].payload)})},this.websocket.onmessage=i=>{const a=i.data,o=JSON.parse(a);if(o.id!=null){const s=String(o.id),l=this._requests[s];if(delete this._requests[s],o.result!==void 0)l.callback(null,o.result),this.emit("debug",{action:"response",request:JSON.parse(l.payload),response:o.result,provider:this});else{let u=null;o.error?(u=new Error(o.error.message||"unknown error"),at(u,"code",o.error.code||null),at(u,"response",a)):u=new Error("unknown error"),l.callback(u,void 0),this.emit("debug",{action:"response",error:u,request:JSON.parse(l.payload),provider:this})}}else if(o.method==="eth_subscription"){const s=this._subs[o.params.subscription];s&&s.processFunc(o.params.result)}else console.warn("this should not happen")};const n=setInterval(()=>{this.emit("poll")},1e3);n.unref&&n.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(t){H$.throwError("cannot reset events block on WebSocketProvider",Ne.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(t){H$.throwError("cannot set polling interval on WebSocketProvider",Ne.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Bie(this,void 0,void 0,function*(){return null})}set polling(t){t&&H$.throwError("cannot set polling on WebSocketProvider",Ne.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(t,r){const n=Jkt++;return new Promise((i,a)=>{function o(l,u){return l?a(l):i(u)}const s=JSON.stringify({method:t,params:r,id:n,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(s),provider:this}),this._requests[String(n)]={callback:o,payload:s},this._wsReady&&this.websocket.send(s)})}static defaultUrl(){return"ws://localhost:8546"}_subscribe(t,r,n){return Bie(this,void 0,void 0,function*(){let i=this._subIds[t];i==null&&(i=Promise.all(r).then(o=>this.send("eth_subscribe",o)),this._subIds[t]=i);const a=yield i;this._subs[a]={tag:t,processFunc:n}})}_startEvent(t){switch(t.type){case"block":this._subscribe("block",["newHeads"],r=>{const n=Bt.from(r.number).toNumber();this._emitted.block=n,this.emit("block",n)});break;case"pending":this._subscribe("pending",["newPendingTransactions"],r=>{this.emit("pending",r)});break;case"filter":this._subscribe(t.tag,["logs",this._getFilter(t.filter)],r=>{r.removed==null&&(r.removed=!1),this.emit(t.filter,this.formatter.filterLog(r))});break;case"tx":{const r=n=>{const i=n.hash;this.getTransactionReceipt(i).then(a=>{a&&this.emit(i,a)})};r(t),this._subscribe("tx",["newHeads"],n=>{this._events.filter(i=>i.type==="tx").forEach(r)});break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",t);break}}_stopEvent(t){let r=t.tag;if(t.type==="tx"){if(this._events.filter(i=>i.type==="tx").length)return;r="tx"}else if(this.listenerCount(t.event))return;const n=this._subIds[r];n&&(delete this._subIds[r],n.then(i=>{this._subs[i]&&(delete this._subs[i],this.send("eth_unsubscribe",[i]))}))}destroy(){return Bie(this,void 0,void 0,function*(){this.websocket.readyState===zL.CONNECTING&&(yield new Promise(t=>{this.websocket.onopen=function(){t(!0)},this.websocket.onerror=function(){t(!1)}})),this.websocket.close(1e3)})}}var eBt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const rL=new Ne(Xc);class VKe extends Lb{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return eBt(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield t.detectNetwork.call(this),r||rL.throwError("no network detected",Ne.errors.UNKNOWN_ERROR,{}),this._network==null&&(at(this,"_network",r),this.emit("network",r,null))),r})}}class u2 extends VKe{constructor(t,r){rL.checkAbstract(new.target,u2),t=Zu(new.target,"getNetwork")(t),r=Zu(new.target,"getApiKey")(r);const n=Zu(new.target,"getUrl")(t,r);super(n,t),typeof r=="string"?at(this,"apiKey",r):r!=null&&Object.keys(r).forEach(i=>{at(this,i,r[i])})}_startPending(){rL.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(t){return rL.throwError("API provider does not support signing",Ne.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(t){return t}static getUrl(t,r){return rL.throwError("not implemented; sub-classes must override getUrl",Ne.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const Yxe=new Ne(Xc),pF="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class WKe extends rz{constructor(t,r){const n=new I2e(t,r),i=n.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");super(i,n.network),at(this,"apiKey",n.apiKey)}isCommunityResource(){return this.apiKey===pF}}class I2e extends u2{static getWebSocketProvider(t,r){return new WKe(t,r)}static getApiKey(t){return t==null?pF:(t&&typeof t!="string"&&Yxe.throwArgumentError("invalid apiKey","apiKey",t),t)}static getUrl(t,r){let n=null;switch(t.name){case"homestead":n="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":n="eth-goerli.g.alchemy.com/v2/";break;case"matic":n="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":n="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":n="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":n="arb-goerli.g.alchemy.com/v2/";break;case"optimism":n="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":n="opt-goerli.g.alchemy.com/v2/";break;default:Yxe.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+n+r,throttleCallback:(i,a)=>(r===pF&&OM(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===pF}}const tBt=new Ne(Xc),G$="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function rBt(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return tBt.throwArgumentError("unsupported network","name",e)}class jKe extends u2{isCommunityResource(){return this.apiKey===G$}static getApiKey(t){return t??G$}static getUrl(t,r){r==null&&(r=G$);const n={allowGzip:!0,url:"https://"+rBt(t.name)+r,throttleCallback:(i,a)=>(r.apiKey===G$&&OM(),Promise.resolve(!0))};return r.projectSecret!=null&&(n.user="",n.password=r.projectSecret),n}}var nBt=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const qxe=new Ne(Xc);class zKe extends u2{static getApiKey(t){return t!=null&&qxe.throwArgumentError("apiKey not supported for cloudflare","apiKey",t),null}static getUrl(t,r){let n=null;switch(t.name){case"homestead":n="https://cloudflare-eth.com/";break;default:qxe.throwArgumentError("unsupported network","network",arguments[0])}return n}perform(t,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return nBt(this,void 0,void 0,function*(){return t==="getBlockNumber"?(yield n.perform.call(this,"getBlock",{blockTag:"latest"})).number:n.perform.call(this,t,r)})}}var V$=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const wE=new Ne(Xc);function Xxe(e){const t={};for(let r in e){if(e[r]==null)continue;let n=e[r];r==="type"&&n===0||({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?n=CM(Xt(n)):r==="accessList"?n="["+E_(n).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]":n=Xt(n),t[r]=n)}return t}function iBt(e){if(e.status==0&&(e.message==="No records found"||e.message==="No transactions found"))return e.result;if(e.status!=1||typeof e.message!="string"||!e.message.match(/^OK/)){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function Kxe(e){if(e&&e.status==0&&e.message=="NOTOK"&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if(e.jsonrpc!="2.0"){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function Zxe(e){if(e==="pending")throw new Error("pending not supported");return e==="latest"?e:parseInt(e.substring(2),16)}function Uie(e,t,r){if(e==="call"&&t.code===Ne.errors.SERVER_ERROR){const i=t.error;if(i&&(i.message.match(/reverted/i)||i.message.match(/VM execution error/i))){let a=i.data;if(a&&(a="0x"+a.replace(/^.*0x/i,"")),si(a))return a;wE.throwError("missing revert data in call exception",Ne.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===Ne.errors.SERVER_ERROR&&(t.error&&typeof t.error.message=="string"?n=t.error.message:typeof t.body=="string"?n=t.body:typeof t.responseText=="string"&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&wE.throwError("insufficient funds for intrinsic transaction cost",Ne.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&wE.throwError("nonce has already been used",Ne.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&wE.throwError("replacement fee too low",Ne.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&wE.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Ne.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class YKe extends tz{constructor(t,r){super(t),at(this,"baseUrl",this.getBaseUrl()),at(this,"apiKey",r||null)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return wE.throwArgumentError("unsupported network","network",this.network.name)}getUrl(t,r){const n=Object.keys(r).reduce((a,o)=>{const s=r[o];return s!=null&&(a+=`&${o}=${s}`),a},""),i=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${t}${n}${i}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(t,r){return r.module=t,r.apikey=this.apiKey,r}fetch(t,r,n){return V$(this,void 0,void 0,function*(){const i=n?this.getPostUrl():this.getUrl(t,r),a=n?this.getPostData(t,r):null,o=t==="proxy"?Kxe:iBt;this.emit("debug",{action:"request",request:i,provider:this});const s={url:i,throttleSlotInterval:1e3,throttleCallback:(c,f)=>(this.isCommunityResource()&&OM(),Promise.resolve(!0))};let l=null;a&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},l=Object.keys(a).map(c=>`${c}=${a[c]}`).join("&"));const u=yield xR(s,l,o||Kxe);return this.emit("debug",{action:"response",request:i,response:Of(u),provider:this}),u})}detectNetwork(){return V$(this,void 0,void 0,function*(){return this.network})}perform(t,r){const n=Object.create(null,{perform:{get:()=>super.perform}});return V$(this,void 0,void 0,function*(){switch(t){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:r.address,tag:r.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:r.address,tag:r.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:r.address,tag:r.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:r.address,position:r.position,tag:r.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:r.signedTransaction},!0).catch(i=>Uie("sendTransaction",i,r.signedTransaction));case"getBlock":if(r.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:r.blockTag,boolean:r.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:r.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:r.transactionHash});case"call":{if(r.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");const i=Xxe(r.transaction);i.module="proxy",i.action="eth_call";try{return yield this.fetch("proxy",i,!0)}catch(a){return Uie("call",a,r.transaction)}}case"estimateGas":{const i=Xxe(r.transaction);i.module="proxy",i.action="eth_estimateGas";try{return yield this.fetch("proxy",i,!0)}catch(a){return Uie("estimateGas",a,r.transaction)}}case"getLogs":{const i={action:"getLogs"};if(r.filter.fromBlock&&(i.fromBlock=Zxe(r.filter.fromBlock)),r.filter.toBlock&&(i.toBlock=Zxe(r.filter.toBlock)),r.filter.address&&(i.address=r.filter.address),r.filter.topics&&r.filter.topics.length>0&&(r.filter.topics.length>1&&wE.throwError("unsupported topic count",Ne.errors.UNSUPPORTED_OPERATION,{topics:r.filter.topics}),r.filter.topics.length===1)){const s=r.filter.topics[0];(typeof s!="string"||s.length!==66)&&wE.throwError("unsupported topic format",Ne.errors.UNSUPPORTED_OPERATION,{topic0:s}),i.topic0=s}const a=yield this.fetch("logs",i);let o={};for(let s=0;s<a.length;s++){const l=a[s];if(l.blockHash==null){if(o[l.blockNumber]==null){const u=yield this.getBlock(l.blockNumber);u&&(o[l.blockNumber]=u.hash)}l.blockHash=o[l.blockNumber]}}return a}case"getEtherPrice":return this.network.name!=="homestead"?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return n.perform.call(this,t,r)})}getHistory(t,r,n){return V$(this,void 0,void 0,function*(){const i={action:"txlist",address:yield this.resolveName(t),startblock:r??0,endblock:n??99999999,sort:"asc"};return(yield this.fetch("account",i)).map(o=>{["contractAddress","to"].forEach(function(l){o[l]==""&&delete o[l]}),o.creates==null&&o.contractAddress!=null&&(o.creates=o.contractAddress);const s=this.formatter.transactionResponse(o);return o.timeStamp&&(s.timestamp=parseInt(o.timeStamp)),s})})}isCommunityResource(){return this.apiKey==null}}var _G=globalThis&&globalThis.__awaiter||function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function s(c){try{u(n.next(c))}catch(f){o(f)}}function l(c){try{u(n.throw(c))}catch(f){o(f)}}function u(c){c.done?a(c.value):i(c.value).then(s,l)}u((n=n.apply(e,t||[])).next())})};const Kw=new Ne(Xc);function W$(){return new Date().getTime()}function Qxe(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r];if(n==null)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||t.ensAddress==null&&n.ensAddress==null)||Kw.throwArgumentError("provider mismatch","networks",e):t=n}return t}function Jxe(e,t){e=e.slice().sort();const r=Math.floor(e.length/2);if(e.length%2)return e[r];const n=e[r-1],i=e[r];return t!=null&&Math.abs(n-i)>t?null:(n+i)/2}function RC(e){if(e===null)return"null";if(typeof e=="number"||typeof e=="boolean")return JSON.stringify(e);if(typeof e=="string")return e;if(Bt.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map(t=>RC(t)));if(typeof e=="object"){const t=Object.keys(e);return t.sort(),"{"+t.map(r=>{let n=e[r];return typeof n=="function"?n="[function]":n=RC(n),JSON.stringify(r)+":"+n}).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let aBt=1;function eRe(e){let t=null,r=null,n=new Promise(o=>{t=function(){r&&(clearTimeout(r),r=null),o()},r=setTimeout(t,e)});const i=o=>(n=n.then(o),n);function a(){return n}return{cancel:t,getPromise:a,wait:i}}const oBt=[Ne.errors.CALL_EXCEPTION,Ne.errors.INSUFFICIENT_FUNDS,Ne.errors.NONCE_EXPIRED,Ne.errors.REPLACEMENT_UNDERPRICED,Ne.errors.UNPREDICTABLE_GAS_LIMIT],sBt=["address","args","errorArgs","errorSignature","method","transaction"];function j$(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function lBt(e,t){return function(r){const n={};r.forEach(a=>{const o=e(a.result);n[o]||(n[o]={count:0,result:a.result}),n[o].count++});const i=Object.keys(n);for(let a=0;a<i.length;a++){const o=n[i[a]];if(o.count>=t)return o.result}}}function uBt(e,t,r){let n=RC;switch(t){case"getBlockNumber":return function(i){const a=i.map(s=>s.result);let o=Jxe(i.map(s=>s.result),2);if(o!=null)return o=Math.ceil(o),a.indexOf(o+1)>=0&&o++,o>=e._highestBlockNumber&&(e._highestBlockNumber=o),e._highestBlockNumber};case"getGasPrice":return function(i){const a=i.map(o=>o.result);return a.sort(),a[Math.floor(a.length/2)]};case"getEtherPrice":return function(i){return Jxe(i.map(a=>a.result))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(i){return i==null?null:(i=Do(i),i.confirmations=-1,RC(i))};break;case"getBlock":r.includeTransactions?n=function(i){return i==null?null:(i=Do(i),i.transactions=i.transactions.map(a=>(a=Do(a),a.confirmations=-1,a)),RC(i))}:n=function(i){return i==null?null:RC(i)};break;default:throw new Error("unknown method: "+t)}return lBt(n,e.quorum)}function y8(e,t){return _G(this,void 0,void 0,function*(){const r=e.provider;return r.blockNumber!=null&&r.blockNumber>=t||t===-1?r:f3(()=>new Promise((n,i)=>{setTimeout(function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)},0)}),{oncePoll:r})})}function cBt(e,t,r,n){return _G(this,void 0,void 0,function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&si(n.blockTag)&&(i=yield y8(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&si(n.blockTag)&&(i=yield y8(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&si(n.blockTag)&&(i=yield y8(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&si(n.blockTag)&&(i=yield y8(e,t)),r==="call"&&n.blockTag?i[r](n.transaction,n.blockTag):i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let a=n.filter;return(a.fromBlock&&si(a.fromBlock)||a.toBlock&&si(a.toBlock))&&(i=yield y8(e,t)),i.getLogs(a)}}return Kw.throwError("unknown method error",Ne.errors.UNKNOWN_ERROR,{method:r,params:n})})}class qKe extends tz{constructor(t,r){t.length===0&&Kw.throwArgumentError("missing providers","providers",t);const n=t.map((o,s)=>{if(gA.isProvider(o)){const c=Dhe(o)?2e3:750;return Object.freeze({provider:o,weight:1,stallTimeout:c,priority:1})}const l=Do(o);l.priority==null&&(l.priority=1),l.stallTimeout==null&&(l.stallTimeout=Dhe(o)?2e3:750),l.weight==null&&(l.weight=1);const u=l.weight;return(u%1||u>512||u<1)&&Kw.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${s}].weight`,u),Object.freeze(l)}),i=n.reduce((o,s)=>o+s.weight,0);r==null?r=i/2:r>i&&Kw.throwArgumentError("quorum will always fail; larger than total weight","quorum",r);let a=Qxe(n.map(o=>o.provider.network));a==null&&(a=new Promise((o,s)=>{setTimeout(()=>{this.detectNetwork().then(o,s)},0)})),super(a),at(this,"providerConfigs",Object.freeze(n)),at(this,"quorum",r),this._highestBlockNumber=-1}detectNetwork(){return _G(this,void 0,void 0,function*(){const t=yield Promise.all(this.providerConfigs.map(r=>r.provider.getNetwork()));return Qxe(t)})}perform(t,r){return _G(this,void 0,void 0,function*(){if(t==="sendTransaction"){const l=yield Promise.all(this.providerConfigs.map(u=>u.provider.sendTransaction(r.signedTransaction).then(c=>c.hash,c=>c)));for(let u=0;u<l.length;u++){const c=l[u];if(typeof c=="string")return c}throw l[0]}this._highestBlockNumber===-1&&t!=="getBlockNumber"&&(yield this.getBlockNumber());const n=uBt(this,t,r),i=RKe(this.providerConfigs.map(Do));i.sort((l,u)=>l.priority-u.priority);const a=this._highestBlockNumber;let o=0,s=!0;for(;;){const l=W$();let u=i.filter(h=>h.runner&&l-h.start<h.stallTimeout).reduce((h,p)=>h+p.weight,0);for(;u<this.quorum&&o<i.length;){const h=i[o++],p=aBt++;h.start=W$(),h.staller=eRe(h.stallTimeout),h.staller.wait(()=>{h.staller=null}),h.runner=cBt(h,a,t,r).then(g=>{h.done=!0,h.result=g,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:j$(h,W$()),request:{method:t,params:Of(r)},provider:this})},g=>{h.done=!0,h.error=g,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:j$(h,W$()),request:{method:t,params:Of(r)},provider:this})}),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:p,backend:j$(h,null),request:{method:t,params:Of(r)},provider:this}),u+=h.weight}const c=[];i.forEach(h=>{h.done||!h.runner||(c.push(h.runner),h.staller&&c.push(h.staller.getPromise()))}),c.length&&(yield Promise.race(c));const f=i.filter(h=>h.done&&h.error==null);if(f.length>=this.quorum){const h=n(f);if(h!==void 0)return i.forEach(p=>{p.staller&&p.staller.cancel(),p.cancelled=!0}),h;s||(yield eRe(100).getPromise()),s=!1}const d=i.reduce((h,p)=>{if(!p.done||p.error==null)return h;const g=p.error.code;return oBt.indexOf(g)>=0&&(h[g]||(h[g]={error:p.error,weight:0}),h[g].weight+=p.weight),h},{});if(Object.keys(d).forEach(h=>{const p=d[h];if(p.weight<this.quorum)return;i.forEach(E=>{E.staller&&E.staller.cancel(),E.cancelled=!0});const g=p.error,m={};sBt.forEach(E=>{g[E]!=null&&(m[E]=g[E])}),Kw.throwError(g.reason||g.message,h,m)}),i.filter(h=>!h.done).length===0)break}return i.forEach(l=>{l.staller&&l.staller.cancel(),l.cancelled=!0}),Kw.throwError("failed to meet quorum",Ne.errors.SERVER_ERROR,{method:t,params:r,results:i.map(l=>j$(l)),provider:this})})}}const XKe=null,vF=new Ne(Xc),nL="84842078b09946638c03157f83405213";class KKe extends rz{constructor(t,r){const n=new nz(t,r),i=n.connection;i.password&&vF.throwError("INFURA WebSocket project secrets unsupported",Ne.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});const a=i.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(a,t),at(this,"apiKey",n.projectId),at(this,"projectId",n.projectId),at(this,"projectSecret",n.projectSecret)}isCommunityResource(){return this.projectId===nL}}class nz extends u2{static getWebSocketProvider(t,r){return new KKe(t,r)}static getApiKey(t){const r={apiKey:nL,projectId:nL,projectSecret:null};return t==null||(typeof t=="string"?r.projectId=t:t.projectSecret!=null?(vF.assertArgument(typeof t.projectId=="string","projectSecret requires a projectId","projectId",t.projectId),vF.assertArgument(typeof t.projectSecret=="string","invalid projectSecret","projectSecret","[REDACTED]"),r.projectId=t.projectId,r.projectSecret=t.projectSecret):t.projectId&&(r.projectId=t.projectId),r.apiKey=r.projectId),r}static getUrl(t,r){let n=null;switch(t?t.name:"unknown"){case"homestead":n="mainnet.infura.io";break;case"goerli":n="goerli.infura.io";break;case"sepolia":n="sepolia.infura.io";break;case"matic":n="polygon-mainnet.infura.io";break;case"maticmum":n="polygon-mumbai.infura.io";break;case"optimism":n="optimism-mainnet.infura.io";break;case"optimism-goerli":n="optimism-goerli.infura.io";break;case"arbitrum":n="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":n="arbitrum-goerli.infura.io";break;default:vF.throwError("unsupported network",Ne.errors.INVALID_ARGUMENT,{argument:"network",value:t})}const i={allowGzip:!0,url:"https://"+n+"/v3/"+r.projectId,throttleCallback:(a,o)=>(r.projectId===nL&&OM(),Promise.resolve(!0))};return r.projectSecret!=null&&(i.user="",i.password=r.projectSecret),i}isCommunityResource(){return this.projectId===nL}}class fBt extends Lb{send(t,r){const n={method:t,params:r,id:this._nextId++,jsonrpc:"2.0"};this._pendingBatch==null&&(this._pendingBatch=[]);const i={request:n,resolve:null,reject:null},a=new Promise((o,s)=>{i.resolve=o,i.reject=s});return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout(()=>{const o=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const s=o.map(l=>l.request);return this.emit("debug",{action:"requestBatch",request:Of(s),provider:this}),xR(this.connection,JSON.stringify(s)).then(l=>{this.emit("debug",{action:"response",request:s,response:l,provider:this}),o.forEach((u,c)=>{const f=l[c];if(f.error){const d=new Error(f.error.message);d.code=f.error.code,d.data=f.error.data,u.reject(d)}else u.resolve(f.result)})},l=>{this.emit("debug",{action:"response",error:l,request:s,provider:this}),o.forEach(u=>{u.reject(l)})})},10)),a}}const Fie=new Ne(Xc),dBt="ETHERS_JS_SHARED";class ZKe extends u2{static getApiKey(t){return t&&typeof t!="string"&&Fie.throwArgumentError("invalid apiKey","apiKey",t),t||dBt}static getUrl(t,r){Fie.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let n=null;switch(t.name){case"homestead":n="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":n="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":n="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":n="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":n="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Fie.throwArgumentError("unsupported network","network",arguments[0])}return n+"?apiKey="+r}}const tRe=new Ne(Xc),rRe="62e1ad51b37b8e00394bda3b";class QKe extends u2{static getApiKey(t){const r={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return t==null?r.applicationId=rRe:typeof t=="string"?r.applicationId=t:t.applicationSecretKey!=null?(r.applicationId=t.applicationId,r.applicationSecretKey=t.applicationSecretKey):t.applicationId?r.applicationId=t.applicationId:tRe.throwArgumentError("unsupported PocketProvider apiKey","apiKey",t),r}static getUrl(t,r){let n=null;switch(t?t.name:"unknown"){case"goerli":n="eth-goerli.gateway.pokt.network";break;case"homestead":n="eth-mainnet.gateway.pokt.network";break;case"kovan":n="poa-kovan.gateway.pokt.network";break;case"matic":n="poly-mainnet.gateway.pokt.network";break;case"maticmum":n="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":n="eth-rinkeby.gateway.pokt.network";break;case"ropsten":n="eth-ropsten.gateway.pokt.network";break;default:tRe.throwError("unsupported network",Ne.errors.INVALID_ARGUMENT,{argument:"network",value:t})}const i=`https://${n}/v1/lb/${r.applicationId}`,a={headers:{},url:i};return r.applicationSecretKey!=null&&(a.user="",a.password=r.applicationSecretKey),a}isCommunityResource(){return this.applicationId===rRe}}const nRe=new Ne(Xc);let hBt=1;function iRe(e,t){const r="Web3LegacyFetcher";return function(n,i){const a={method:n,params:i,id:hBt++,jsonrpc:"2.0"};return new Promise((o,s)=>{this.emit("debug",{action:"request",fetcher:r,request:Of(a),provider:this}),t(a,(l,u)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:a,provider:this}),s(l);if(this.emit("debug",{action:"response",fetcher:r,request:a,response:u,provider:this}),u.error){const c=new Error(u.error.message);return c.code=u.error.code,c.data=u.error.data,s(c)}o(u.result)})})}}function pBt(e){return function(t,r){r==null&&(r=[]);const n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Of(n),provider:this}),e.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class O2e extends Lb{constructor(t,r){t==null&&nRe.throwArgumentError("missing provider","provider",t);let n=null,i=null,a=null;typeof t=="function"?(n="unknown:",i=t):(n=t.host||t.path||"",!n&&t.isMetaMask&&(n="metamask"),a=t,t.request?(n===""&&(n="eip-1193:"),i=pBt(t)):t.sendAsync?i=iRe(t,t.sendAsync.bind(t)):t.send?i=iRe(t,t.send.bind(t)):nRe.throwArgumentError("unsupported provider","provider",t),n||(n="unknown:")),super(n,r),at(this,"jsonRpcFetchFunc",i),at(this,"provider",a)}send(t,r){return this.jsonRpcFetchFunc(t,r)}}const aRe=new Ne(Xc);function JKe(e,t){if(e==null&&(e="homestead"),typeof e=="string"){const n=e.match(/^(ws|http)s?:/i);if(n)switch(n[1].toLowerCase()){case"http":case"https":return new Lb(e);case"ws":case"wss":return new rz(e);default:aRe.throwArgumentError("unsupported URL scheme","network",e)}}const r=x2e(e);return(!r||!r._defaultProvider)&&aRe.throwError("unsupported getDefaultProvider network",Ne.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:qKe,AlchemyProvider:I2e,AnkrProvider:jKe,CloudflareProvider:zKe,EtherscanProvider:YKe,InfuraProvider:nz,JsonRpcProvider:Lb,NodesmithProvider:ZKe,PocketProvider:QKe,Web3Provider:O2e,IpcProvider:XKe},t)}const vBt=Object.freeze(Object.defineProperty({__proto__:null,AlchemyProvider:I2e,AlchemyWebSocketProvider:WKe,AnkrProvider:jKe,BaseProvider:tz,CloudflareProvider:zKe,EtherscanProvider:YKe,FallbackProvider:qKe,Formatter:Mhe,InfuraProvider:nz,InfuraWebSocketProvider:KKe,IpcProvider:XKe,JsonRpcBatchProvider:fBt,JsonRpcProvider:Lb,JsonRpcSigner:R2e,NodesmithProvider:ZKe,PocketProvider:QKe,Provider:gA,Resolver:$he,StaticJsonRpcProvider:VKe,UrlJsonRpcProvider:u2,Web3Provider:O2e,WebSocketProvider:rz,getDefaultProvider:JKe,getNetwork:x2e,isCommunityResourcable:UKe,isCommunityResource:Dhe,showThrottleMessage:OM},Symbol.toStringTag,{value:"Module"})),gBt="solidity/5.7.0",mBt=new RegExp("^bytes([0-9]+)$"),yBt=new RegExp("^(u?int)([0-9]*)$"),EBt=new RegExp("^(.*)\\[([0-9]*)\\]$"),bBt="0000000000000000000000000000000000000000000000000000000000000000",dC=new Ne(gBt);function eZe(e,t,r){switch(e){case"address":return r?UL(t,32):$t(t);case"string":return cl(t);case"bytes":return $t(t);case"bool":return t=t?"0x01":"0x00",r?UL(t,32):$t(t)}let n=e.match(yBt);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!==0||i===0||i>256)&&dC.throwArgumentError("invalid number type","type",e),r&&(i=256),t=Bt.from(t).toTwos(i),UL(t,i/8)}if(n=e.match(mBt),n){const i=parseInt(n[1]);return(String(i)!==n[1]||i===0||i>32)&&dC.throwArgumentError("invalid bytes type","type",e),$t(t).byteLength!==i&&dC.throwArgumentError(`invalid value for ${e}`,"value",t),r?$t((t+bBt).substring(0,66)):t}if(n=e.match(EBt),n&&Array.isArray(t)){const i=n[1];parseInt(n[2]||String(t.length))!=t.length&&dC.throwArgumentError(`invalid array length for ${e}`,"value",t);const o=[];return t.forEach(function(s){o.push(eZe(i,s,!0))}),Co(o)}return dC.throwArgumentError("invalid type","type",e)}function N2e(e,t){e.length!=t.length&&dC.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach(function(n,i){r.push(eZe(n,t[i]))}),Xt(Co(r))}function _Bt(e,t){return lo(N2e(e,t))}function SBt(e,t){return By(N2e(e,t))}const wBt="units/5.7.0",tZe=new Ne(wBt),rZe=["wei","kwei","mwei","gwei","szabo","finney","ether"];function TBt(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||e==="."||e==="-.")&&tZe.throwArgumentError("invalid value","value",e);let r=t[0],n="";for(r.substring(0,1)==="-"&&(n="-",r=r.substring(1));r.substring(0,1)==="0";)r=r.substring(1);r===""&&(r="0");let i="";for(t.length===2&&(i="."+(t[1]||"0"));i.length>2&&i[i.length-1]==="0";)i=i.substring(0,i.length-1);const a=[];for(;r.length;)if(r.length<=3){a.unshift(r);break}else{const o=r.length-3;a.unshift(r.substring(o)),r=r.substring(0,o)}return n+a.join(",")+i}function nZe(e,t){if(typeof t=="string"){const r=rZe.indexOf(t);r!==-1&&(t=3*r)}return lF(e,t??18)}function iZe(e,t){if(typeof e!="string"&&tZe.throwArgumentError("value must be a string","value",e),typeof t=="string"){const r=rZe.indexOf(t);r!==-1&&(t=3*r)}return a1(e,t??18)}function aZe(e){return nZe(e,18)}function ABt(e){return iZe(e,18)}const CBt=Object.freeze(Object.defineProperty({__proto__:null,AbiCoder:NXe,ConstructorFragment:Hp,ErrorFragment:dy,EventFragment:E1,FormatTypes:ha,Fragment:O1,FunctionFragment:Gp,HDNode:nh,Indexed:vG,Interface:_he,LogDescription:VXe,Logger:Ne,ParamType:Yl,RLP:mPt,SigningKey:k3,get SupportedAlgorithm(){return dx},TransactionDescription:WXe,get TransactionTypes(){return xhe},get UnicodeNormalizationForm(){return bg},Utf8ErrorFuncs:IXe,get Utf8ErrorReason(){return dd},_TypedDataEncoder:Wu,_fetchData:$Ke,_toEscapedUtf8String:HPt,accessListify:E_,arrayify:$t,base58:fx,base64:oMt,checkProperties:n2e,checkResultErrors:vXe,commify:TBt,computeAddress:rb,computeHmac:I7,computePublicKey:E2e,concat:Co,deepCopy:Of,defaultAbiCoder:LXe,defaultPath:hx,defineReadOnly:at,dnsEncode:UXe,entropyToMnemonic:Jj,fetchJson:xR,formatBytes32String:GPt,formatEther:aZe,formatUnits:nZe,getAccountPath:ikt,getAddress:va,getContractAddress:jj,getCreate2Address:wPt,getIcapAddress:SPt,getJsonWalletAddress:fkt,getStatic:Zu,hashMessage:p2e,hexConcat:Tf,hexDataLength:Eg,hexDataSlice:nl,hexStripZeros:oXe,hexValue:CM,hexZeroPad:xo,hexlify:Xt,id:PE,isAddress:_Pt,isBytes:g_,isBytesLike:AM,isHexString:si,isValidMnemonic:nkt,isValidName:OMt,joinSignature:yhe,keccak256:lo,mnemonicToEntropy:Qj,mnemonicToSeed:xKe,namehash:GL,nameprep:rMt,parseBytes32String:VPt,parseEther:ABt,parseTransaction:yKe,parseUnits:iZe,poll:f3,randomBytes:xC,recoverAddress:IM,recoverPublicKey:hKe,resolveProperties:Ms,ripemd160:TKe,serializeTransaction:Rhe,sha256:By,sha512:q$t,shallowCopy:Do,shuffled:RKe,solidityKeccak256:_Bt,solidityPack:N2e,soliditySha256:SBt,splitSignature:hA,stripZeros:Y1,toUtf8Bytes:cl,toUtf8CodePoints:hG,toUtf8String:vA,verifyMessage:Akt,verifyTypedData:Ckt,zeroPad:UL},Symbol.toStringTag,{value:"Module"})),oZe="ethers/5.7.2",xBt=new Ne(oZe),RBt=Object.freeze(Object.defineProperty({__proto__:null,BaseContract:SKe,BigNumber:Bt,Contract:Ihe,ContractFactory:j$t,FixedNumber:du,Signer:m_,VoidSigner:Yj,Wallet:Xw,Wordlist:CR,constants:$Pt,get errors(){return Qh},getDefaultProvider:JKe,logger:xBt,providers:vBt,utils:CBt,version:oZe,wordlists:Ohe},Symbol.toStringTag,{value:"Module"}));try{const e=window;e._ethers==null&&(e._ethers=RBt)}catch{}const ba={WALLET_ID:"@w3m/wallet_id",ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3},fu={getCaipDefaultChain(e){if(e)return{id:`${Fr.EIP155}:${e.chainId}`,name:e.name,imageId:Sc.EIP155NetworkImageIds[e.chainId]}},hexStringToNumber(e){const t=e.startsWith("0x")?e.slice(2):e;return parseInt(t,16)},numberToHexString(e){return`0x${e.toString(16)}`},async getUserInfo(e){const[t,r]=await Promise.all([fu.getAddress(e),fu.getChainId(e)]);return{chainId:r,address:t}},async getChainId(e){const t=await e.request({method:"eth_chainId"});return Number(t)},async getAddress(e){const[t]=await e.request({method:"eth_accounts"});return t},async addEthereumChain(e,t){await e.request({method:"wallet_addEthereumChain",params:[{chainId:fu.numberToHexString(t.chainId),rpcUrls:[t.rpcUrl],chainName:t.name,nativeCurrency:{name:t.currency,decimals:18,symbol:t.currency},blockExplorerUrls:[t.explorerUrl],iconUrls:[Sc.EIP155NetworkImageIds[t.chainId]]}]})}},pc=Yc({provider:void 0,providerType:void 0,address:void 0,chainId:void 0,isConnected:!1}),Nr={state:pc,subscribeKey(e,t){return B0(pc,e,t)},subscribe(e){return Av(pc,()=>e(pc))},setProvider(e){e&&(pc.provider=B4(e))},setProviderType(e){pc.providerType=e},setAddress(e){pc.address=e},setChainId(e){pc.chainId=e},setIsConnected(e){pc.isConnected=e},setError(e){pc.error=e},reset(){pc.provider=void 0,pc.address=void 0,pc.chainId=void 0,pc.providerType=void 0,pc.isConnected=!1,pc.error=void 0}};class IBt extends zTt{constructor(t){const{ethersConfig:r,siweConfig:n,chains:i,defaultChain:a,tokens:o,chainImages:s,_sdkVersion:l,...u}=t;if(!r)throw new Error("web3modal:constructor - ethersConfig is undefined");if(!u.projectId)throw new Error("web3modal:constructor - projectId is undefined");const c={switchCaipNetwork:async d=>{const h=w$.caipNetworkIdToNumber(d==null?void 0:d.id);if(h)try{await this.switchNetwork(h)}catch(p){Nr.setError(p)}},getApprovedCaipNetworksData:async()=>new Promise(async d=>{var p,g,m,E;const h=localStorage.getItem(ba.WALLET_ID);if(h!=null&&h.includes(Fr.WALLET_CONNECT_CONNECTOR_ID)){const b=await this.getWalletConnectProvider();if(!b)throw new Error("networkControllerClient:getApprovedCaipNetworks - provider is undefined");const w=(g=(p=b.signer)==null?void 0:p.session)==null?void 0:g.namespaces,T=(m=w==null?void 0:w[Fr.EIP155])==null?void 0:m.methods,x=(E=w==null?void 0:w[Fr.EIP155])==null?void 0:E.chains,N={supportsAllNetworks:(T==null?void 0:T.includes(Fr.ADD_CHAIN_METHOD))??!1,approvedCaipNetworkIds:x};d(N)}else d({approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})})},f={connectWalletConnect:async d=>{const h=await this.getWalletConnectProvider();if(!h)throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");h.on("display_uri",p=>{d(p)}),await h.connect(),await this.setWalletConnectProvider()},connectExternal:async({id:d,info:h,provider:p})=>{if(d===Fr.INJECTED_CONNECTOR_ID){const g=r.injected;if(!g)throw new Error("connectionControllerClient:connectInjected - provider is undefined");try{await g.request({method:"eth_requestAccounts"}),this.setInjectedProvider(r)}catch(m){Nr.setError(m)}}else if(d===Fr.EIP6963_CONNECTOR_ID&&h&&p){try{await p.request({method:"eth_requestAccounts"})}catch(g){Nr.setError(g)}this.setEIP6963Provider(p,h.name)}else if(d===Fr.COINBASE_CONNECTOR_ID){const g=r.coinbase;if(!g)throw new Error("connectionControllerClient:connectCoinbase - connector is undefined");try{this.setCoinbaseProvider(r),await g.request({method:"eth_requestAccounts"})}catch(m){Nr.setError(m)}}},checkInstalled(d){return d?r.injected&&!(window!=null&&window.ethereum)?!1:d.some(h=>{var p;return!!((p=window.ethereum)!=null&&p[String(h)])}):!!window.ethereum},disconnect:async()=>{var p;const d=Nr.state.provider,h=Nr.state.providerType;localStorage.removeItem(ba.WALLET_ID),Nr.reset(),(p=n==null?void 0:n.options)!=null&&p.signOutOnDisconnect&&await n.signOut(),h===Fr.WALLET_CONNECT_CONNECTOR_ID?await d.disconnect():d&&d.emit("disconnect")},signMessage:async d=>{const h=Nr.state.provider;if(!h)throw new Error("connectionControllerClient:signMessage - provider is undefined");return await h.request({method:"personal_sign",params:[d,this.getAddress()]})}};super({networkControllerClient:c,connectionControllerClient:f,siweControllerClient:n,defaultChain:fu.getCaipDefaultChain(a),tokens:w$.getCaipTokens(o),_sdkVersion:l??`html-ethers5-${Fr.VERSION}`,...u}),this.hasSyncedConnectedAccount=!1,this.EIP6963Providers=[],this.options=void 0,this.options=t,this.metadata=r.metadata,this.projectId=u.projectId,this.chains=i,this.createProvider(),Nr.subscribeKey("address",()=>{this.syncAccount()}),Nr.subscribeKey("chainId",()=>{this.syncNetwork(s)}),this.syncRequestedNetworks(i,s),this.syncConnectors(r),r.EIP6963&&typeof window<"u"&&(this.listenConnectors(r.EIP6963),this.checkActive6963Provider()),r.injected&&this.checkActiveInjectedProvider(r),r.coinbase&&this.checkActiveCoinbaseProvider(r)}getState(){const t=super.getState();return{...t,selectedNetworkId:w$.caipNetworkIdToNumber(t.selectedNetworkId)}}subscribeState(t){return super.subscribeState(r=>t({...r,selectedNetworkId:w$.caipNetworkIdToNumber(r.selectedNetworkId)}))}setAddress(t){const r=t?va(t):void 0;Nr.setAddress(r)}getAddress(){const{address:t}=Nr.state;return t&&va(t)}getError(){return Nr.state.error}getChainId(){return Nr.state.chainId}getIsConnected(){return Nr.state.isConnected}getWalletProvider(){return Nr.state.provider}getWalletProviderType(){return Nr.state.providerType}subscribeProvider(t){return Nr.subscribe(t)}async disconnect(){const{provider:t,providerType:r}=Nr.state;localStorage.removeItem(ba.WALLET_ID),Nr.reset(),r==="injected"||r==="eip6963"?t==null||t.emit("disconnect"):await t.disconnect()}createProvider(){return!this.walletConnectProviderInitPromise&&typeof window<"u"&&(this.walletConnectProviderInitPromise=this.initWalletConnectProvider()),this.walletConnectProviderInitPromise}async initWalletConnectProvider(){const t={projectId:this.projectId,showQrModal:!1,rpcMap:this.chains?this.chains.reduce((r,n)=>(r[n.chainId]=n.rpcUrl,r),{}):{},optionalChains:[...this.chains.map(r=>r.chainId)],metadata:{name:this.metadata?this.metadata.name:"",description:this.metadata?this.metadata.description:"",url:this.metadata?this.metadata.url:"",icons:this.metadata?this.metadata.icons:[""]}};this.walletConnectProvider=await X7t.init(t),await this.checkActiveWalletConnectProvider()}async getWalletConnectProvider(){if(!this.walletConnectProvider)try{await this.createProvider()}catch(t){Nr.setError(t)}return this.walletConnectProvider}syncRequestedNetworks(t,r){const n=t==null?void 0:t.map(i=>({id:`${Fr.EIP155}:${i.chainId}`,name:i.name,imageId:Sc.EIP155NetworkImageIds[i.chainId],imageUrl:r==null?void 0:r[i.chainId]}));this.setRequestedCaipNetworks(n??[])}async checkActiveWalletConnectProvider(){const t=await this.getWalletConnectProvider(),r=localStorage.getItem(ba.WALLET_ID);t&&r===Fr.WALLET_CONNECT_CONNECTOR_ID&&await this.setWalletConnectProvider()}checkActiveInjectedProvider(t){const r=t.injected,n=localStorage.getItem(ba.WALLET_ID);r&&n===Fr.INJECTED_CONNECTOR_ID&&(this.setInjectedProvider(t),this.watchInjected(t))}checkActiveCoinbaseProvider(t){var i;const r=t.coinbase,n=localStorage.getItem(ba.WALLET_ID);r&&n===Fr.COINBASE_CONNECTOR_ID&&(r._addresses&&((i=r._addresses)==null?void 0:i.length)>0?(this.setCoinbaseProvider(t),this.watchCoinbase(t)):(localStorage.removeItem(ba.WALLET_ID),Nr.reset()))}checkActive6963Provider(){const t=window==null?void 0:window.localStorage.getItem(ba.WALLET_ID);if(t){const r=this.EIP6963Providers.find(n=>n.name===t);r&&this.setEIP6963Provider(r.provider,r.name)}}async setWalletConnectProvider(){var r;window==null||window.localStorage.setItem(ba.WALLET_ID,Fr.WALLET_CONNECT_CONNECTOR_ID);const t=await this.getWalletConnectProvider();t&&(Nr.setChainId(t.chainId),Nr.setProviderType("walletConnect"),Nr.setProvider(t),Nr.setIsConnected(!0),this.setAddress((r=t.accounts)==null?void 0:r[0]),this.watchWalletConnect())}async setInjectedProvider(t){window==null||window.localStorage.setItem(ba.WALLET_ID,Fr.INJECTED_CONNECTOR_ID);const r=t.injected;if(r){const{address:n,chainId:i}=await fu.getUserInfo(r);n&&i&&(Nr.setChainId(i),Nr.setProviderType("injected"),Nr.setProvider(t.injected),Nr.setIsConnected(!0),this.setAddress(n),this.watchCoinbase(t))}}async setEIP6963Provider(t,r){if(window==null||window.localStorage.setItem(ba.WALLET_ID,r),t){const{address:n,chainId:i}=await fu.getUserInfo(t);n&&i&&(Nr.setChainId(i),Nr.setProviderType("eip6963"),Nr.setProvider(t),Nr.setIsConnected(!0),this.setAddress(n),this.watchEIP6963(t))}}async setCoinbaseProvider(t){window==null||window.localStorage.setItem(ba.WALLET_ID,Fr.COINBASE_CONNECTOR_ID);const r=t.coinbase;if(r){const{address:n,chainId:i}=await fu.getUserInfo(r);n&&i&&(Nr.setChainId(i),Nr.setProviderType("coinbaseWallet"),Nr.setProvider(t.coinbase),Nr.setIsConnected(!0),this.setAddress(n),this.watchCoinbase(t))}}async watchWalletConnect(){const t=await this.getWalletConnectProvider();function r(){localStorage.removeItem(ba.WALLET_ID),Nr.reset(),t==null||t.removeListener("disconnect",r),t==null||t.removeListener("accountsChanged",i),t==null||t.removeListener("chainChanged",n)}function n(a){if(a){const o=fu.hexStringToNumber(a);Nr.setChainId(o)}}const i=async a=>{a.length>0&&await this.setWalletConnectProvider()};t&&(t.on("disconnect",r),t.on("accountsChanged",i),t.on("chainChanged",n))}watchInjected(t){const r=t.injected;function n(){localStorage.removeItem(ba.WALLET_ID),Nr.reset(),r==null||r.removeListener("disconnect",n),r==null||r.removeListener("accountsChanged",i),r==null||r.removeListener("chainChanged",a)}function i(o){const s=o==null?void 0:o[0];s?Nr.setAddress(va(s)):(localStorage.removeItem(ba.WALLET_ID),Nr.reset())}function a(o){if(o){const s=typeof o=="string"?fu.hexStringToNumber(o):Number(o);Nr.setChainId(s)}}r&&(r.on("disconnect",n),r.on("accountsChanged",i),r.on("chainChanged",a))}watchEIP6963(t){function r(){localStorage.removeItem(ba.WALLET_ID),Nr.reset(),t.removeListener("disconnect",r),t.removeListener("accountsChanged",n),t.removeListener("chainChanged",i)}function n(a){const o=a==null?void 0:a[0];o?Nr.setAddress(va(o)):(localStorage.removeItem(ba.WALLET_ID),Nr.reset())}function i(a){if(a){const o=typeof a=="string"?fu.hexStringToNumber(a):Number(a);Nr.setChainId(o)}}t.on("disconnect",r),t.on("accountsChanged",n),t.on("chainChanged",i)}watchCoinbase(t){const r=t.coinbase,n=localStorage.getItem(ba.WALLET_ID);function i(){localStorage.removeItem(ba.WALLET_ID),Nr.reset(),r==null||r.removeListener("disconnect",i),r==null||r.removeListener("accountsChanged",a),r==null||r.removeListener("chainChanged",o)}function a(s){s.length===0?(localStorage.removeItem(ba.WALLET_ID),Nr.reset()):Nr.setAddress(s[0])}function o(s){if(s&&n===Fr.COINBASE_CONNECTOR_ID){const l=Number(s);Nr.setChainId(l)}}r&&(r.on("disconnect",i),r.on("accountsChanged",a),r.on("chainChanged",o))}async syncAccount(){const t=Nr.state.address,r=Nr.state.chainId,n=Nr.state.isConnected;if(this.resetAccount(),n&&t&&r){const i=`${Fr.EIP155}:${r}:${t}`;this.setIsConnected(n),this.setCaipAddress(i),await Promise.all([this.syncProfile(t),this.syncBalance(t),this.getApprovedCaipNetworksData()]),this.hasSyncedConnectedAccount=!0}else!n&&this.hasSyncedConnectedAccount&&(this.resetWcConnection(),this.resetNetwork())}async syncNetwork(t){const r=Nr.state.address,n=Nr.state.chainId,i=Nr.state.isConnected;if(this.chains){const a=this.chains.find(o=>o.chainId===n);if(a){const o=`${Fr.EIP155}:${a.chainId}`;if(this.setCaipNetwork({id:o,name:a.name,imageId:Sc.EIP155NetworkImageIds[a.chainId],imageUrl:t==null?void 0:t[a.chainId]}),i&&r){const s=`${Fr.EIP155}:${n}:${r}`;if(this.setCaipAddress(s),a.explorerUrl){const l=`${a.explorerUrl}/address/${r}`;this.setAddressExplorerUrl(l)}else this.setAddressExplorerUrl(void 0);this.hasSyncedConnectedAccount&&await this.syncBalance(r)}}}}async syncProfile(t){if(Nr.state.chainId===1){const n=new nz("mainnet"),i=await n.lookupAddress(t),a=await n.getAvatar(t);i&&this.setProfileName(i),a&&this.setProfileImage(a)}else this.setProfileName(null),this.setProfileImage(null)}async syncBalance(t){const r=Nr.state.chainId;if(r&&this.chains){const n=this.chains.find(i=>i.chainId===r);if(n){const i=new Lb(n.rpcUrl,{chainId:r,name:n.name});if(i){const a=await i.getBalance(t),o=aZe(a);this.setBalance(o,n.currency)}}}}async switchNetwork(t){var i,a,o,s,l,u,c,f;const r=Nr.state.provider,n=Nr.state.providerType;if(this.chains){const d=this.chains.find(h=>h.chainId===t);if(n===Fr.WALLET_CONNECT_CONNECTOR_ID&&d){const h=r;if(h)try{await h.request({method:"wallet_switchEthereumChain",params:[{chainId:fu.numberToHexString(d.chainId)}]}),Nr.setChainId(t)}catch(p){if(p.code===ba.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||p.code===ba.ERROR_CODE_DEFAULT||((a=(i=p==null?void 0:p.data)==null?void 0:i.originalError)==null?void 0:a.code)===ba.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)await fu.addEthereumChain(h,d);else throw new Error("Chain is not supported")}}else if(n===Fr.INJECTED_CONNECTOR_ID&&d){const h=r;if(h)try{await h.request({method:"wallet_switchEthereumChain",params:[{chainId:fu.numberToHexString(d.chainId)}]}),Nr.setChainId(d.chainId)}catch(p){if(p.code===ba.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||p.code===ba.ERROR_CODE_DEFAULT||((s=(o=p==null?void 0:p.data)==null?void 0:o.originalError)==null?void 0:s.code)===ba.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)await fu.addEthereumChain(h,d);else throw new Error("Chain is not supported")}}else if(n===Fr.EIP6963_CONNECTOR_ID&&d){const h=r;if(h)try{await h.request({method:"wallet_switchEthereumChain",params:[{chainId:fu.numberToHexString(d.chainId)}]}),Nr.setChainId(d.chainId)}catch(p){if(p.code===ba.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||p.code===ba.ERROR_CODE_DEFAULT||((u=(l=p==null?void 0:p.data)==null?void 0:l.originalError)==null?void 0:u.code)===ba.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)await fu.addEthereumChain(h,d);else throw new Error("Chain is not supported")}}else if(n===Fr.COINBASE_CONNECTOR_ID&&d){const h=r;if(h)try{await h.request({method:"wallet_switchEthereumChain",params:[{chainId:fu.numberToHexString(d.chainId)}]}),Nr.setChainId(d.chainId)}catch(p){(p.code===ba.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||p.code===ba.ERROR_CODE_DEFAULT||((f=(c=p==null?void 0:p.data)==null?void 0:c.originalError)==null?void 0:f.code)===ba.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)&&await fu.addEthereumChain(h,d)}}}}syncConnectors(t){var i,a,o,s,l,u;const r=[],n=Sc.ConnectorTypesMap[Fr.WALLET_CONNECT_CONNECTOR_ID];if(r.push({id:Fr.WALLET_CONNECT_CONNECTOR_ID,explorerId:Sc.ConnectorExplorerIds[Fr.WALLET_CONNECT_CONNECTOR_ID],imageId:Sc.ConnectorImageIds[Fr.WALLET_CONNECT_CONNECTOR_ID],imageUrl:(a=(i=this.options)==null?void 0:i.connectorImages)==null?void 0:a[Fr.WALLET_CONNECT_CONNECTOR_ID],name:Sc.ConnectorNamesMap[Fr.WALLET_CONNECT_CONNECTOR_ID],type:n}),t.injected){const c=Sc.ConnectorTypesMap[Fr.INJECTED_CONNECTOR_ID];r.push({id:Fr.INJECTED_CONNECTOR_ID,explorerId:Sc.ConnectorExplorerIds[Fr.INJECTED_CONNECTOR_ID],imageId:Sc.ConnectorImageIds[Fr.INJECTED_CONNECTOR_ID],imageUrl:(s=(o=this.options)==null?void 0:o.connectorImages)==null?void 0:s[Fr.INJECTED_CONNECTOR_ID],name:Sc.ConnectorNamesMap[Fr.INJECTED_CONNECTOR_ID],type:c})}t.coinbase&&r.push({id:Fr.COINBASE_CONNECTOR_ID,explorerId:Sc.ConnectorExplorerIds[Fr.COINBASE_CONNECTOR_ID],imageId:Sc.ConnectorImageIds[Fr.COINBASE_CONNECTOR_ID],imageUrl:(u=(l=this.options)==null?void 0:l.connectorImages)==null?void 0:u[Fr.COINBASE_CONNECTOR_ID],name:Sc.ConnectorNamesMap[Fr.COINBASE_CONNECTOR_ID],type:"EXTERNAL"}),this.setConnectors(r)}eip6963EventHandler(t){var r,n;if(t.detail){const{info:i,provider:a}=t.detail;if(!this.getConnectors().find(l=>l.name===i.name)){const l=Sc.ConnectorTypesMap[Fr.EIP6963_CONNECTOR_ID];{this.addConnector({id:Fr.EIP6963_CONNECTOR_ID,type:l,imageUrl:i.icon??((n=(r=this.options)==null?void 0:r.connectorImages)==null?void 0:n[Fr.EIP6963_CONNECTOR_ID]),name:i.name,provider:a,info:i});const u={name:i.name,provider:a};this.EIP6963Providers.push(u)}}}}listenConnectors(t){if(typeof window<"u"&&t){const r=this.eip6963EventHandler.bind(this);window.addEventListener(Fr.EIP6963_ANNOUNCE_EVENT,r),window.dispatchEvent(new Event(Fr.EIP6963_REQUEST_EVENT))}}}let oE;function OBt(e){e&&(oE=e)}function Iti(){if(!oE)throw new Error('Please call "createWeb3Modal" before using "useWeb3Modal" hook');async function e(r){await(oE==null?void 0:oE.open(r))}async function t(){await(oE==null?void 0:oE.close())}return{open:e,close:t}}var RR={},iz={};iz.byteLength=PBt;iz.toByteArray=DBt;iz.fromByteArray=BBt;var b1=[],Yh=[],NBt=typeof Uint8Array<"u"?Uint8Array:Array,Hie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var l5=0,LBt=Hie.length;l5<LBt;++l5)b1[l5]=Hie[l5],Yh[Hie.charCodeAt(l5)]=l5;Yh["-".charCodeAt(0)]=62;Yh["_".charCodeAt(0)]=63;function sZe(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function PBt(e){var t=sZe(e),r=t[0],n=t[1];return(r+n)*3/4-n}function MBt(e,t,r){return(t+r)*3/4-r}function DBt(e){var t,r=sZe(e),n=r[0],i=r[1],a=new NBt(MBt(e,n,i)),o=0,s=i>0?n-4:n,l;for(l=0;l<s;l+=4)t=Yh[e.charCodeAt(l)]<<18|Yh[e.charCodeAt(l+1)]<<12|Yh[e.charCodeAt(l+2)]<<6|Yh[e.charCodeAt(l+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=t&255;return i===2&&(t=Yh[e.charCodeAt(l)]<<2|Yh[e.charCodeAt(l+1)]>>4,a[o++]=t&255),i===1&&(t=Yh[e.charCodeAt(l)]<<10|Yh[e.charCodeAt(l+1)]<<4|Yh[e.charCodeAt(l+2)]>>2,a[o++]=t>>8&255,a[o++]=t&255),a}function $Bt(e){return b1[e>>18&63]+b1[e>>12&63]+b1[e>>6&63]+b1[e&63]}function kBt(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push($Bt(n));return i.join("")}function BBt(e){for(var t,r=e.length,n=r%3,i=[],a=16383,o=0,s=r-n;o<s;o+=a)i.push(kBt(e,o,o+a>s?s:o+a));return n===1?(t=e[r-1],i.push(b1[t>>2]+b1[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(b1[t>>10]+b1[t>>4&63]+b1[t<<2&63]+"=")),i.join("")}var L2e={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */L2e.read=function(e,t,r,n,i){var a,o,s=i*8-n-1,l=(1<<s)-1,u=l>>1,c=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=a*256+e[t+f],f+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=o*256+e[t+f],f+=d,c-=8);if(a===0)a=1-u;else{if(a===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-u}return(h?-1:1)*o*Math.pow(2,a-n)};L2e.write=function(e,t,r,n,i,a){var o,s,l,u=a*8-i-1,c=(1<<u)-1,f=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+f>=1?t+=d/l:t+=d*Math.pow(2,1-f),t*l>=2&&(o++,l/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*l-1)*Math.pow(2,i),o=o+f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=s&255,h+=p,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;e[r+h]=o&255,h+=p,o/=256,u-=8);e[r+h-p]|=g*128};/*!
|
|
@@ -5804,7 +5804,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
5804
5804
|
excited to see what you build. To get started, fill out the
|
|
5805
5805
|
information on the right.`,PUBLISHED_VISUAL_DELETE_TEXT:e=>`Published ${e} cannot be deleted`,UNTITLED_DASHBOARD:"Untitled Dashboard",UNTITLED_QUERY:"Untitled Query",SQL_STATEMENT_TEMPLATES:"SQL Statement Templates",QUERY_PROMPT_SUGGESTIONS:"Query Prompt Suggestions",POPULAR_BUSINESS_TERMS:"Popular Business Terms (Subqueries)",TITLE_TEXT_COLOR:"Title text color",UNSAVED_CHANGES_TEXT:"You have unsaved changes. Are you sure you want to leave?",UNSAVED_CHANGES_TITLE:"Unsaved Changes?",CURRENT_QUERY_TEXT:"Explore your recent activity! Here's your query history from the last 20 minutes.",HISTORICAL_WITHOUT_FILTER_QUERY_TEXT:"Explore your entire query history here!",HISTORICAL_QUERY_TEXT:(e,t)=>`Explore your query history from ${e} to ${t}.`,REMOVE:"Remove",LEARN_MORE_BUTTON_TEXT:"Learn More",DOWNLOADING_FAILED:"Downloading Failed.",SUBSCRIPTION_ID:"Subscription ID",BILLING_CYCLE_TEXT_INTRO:"You will be charged on the",BILLING_CYCLE_TEXT_END:"of every month",CREDIT_UNIT:"Credits",LEARN_MORE_HERE:"Learn more here",PERMISSIONING_TABLE_ACCESS:"permissioning table access",ACCESS_APIS_THROUGH_GATEWAY:"access APIs through the Gateway",API_AUTHENTICATION_DESCRIPTION:()=>z.jsxs(z.Fragment,{children:["Manage and generate API keys for accessing your Managed DB filled with indexed blockchain data. This allows developers to build apps on top of Space and Time's data. Click"," ",z.jsx("a",{href:"https://docs.makeinfinite.com/reference/secrets-proxy-overview",target:"_blank",rel:"noreferrer",style:{color:"#007bff",textDecoration:"underline"},children:"here"})," ","for a list of all gateway APIs."]}),MY_PUBLIC_DASHBOARD:"My Dashboard (Public)",MATERIALIZED_VIEW:"Materialized",SAVE_MATERIALIZED_VIEW:"Save Materialized View",MATERIALIZED_VIEW_SUCCESS:"Materialized View saved successfully",VIEW_NAME:"View Name",ENTER_VIEW_NAME:"Enter View Name",MV_CREATED_SUCCESS:"Materialized view created successfully",CURRENT_BALANCE:"Current Balance",FREE_QUERY_BALANCE:"Free Query Balance",MANAGE_SUBSCRIPTION:"Manage Subscription",AUTOPAY:"Autopay",SUB_TOTAL:"Sub Total",TOTAL:"Total",DISCOUNT:"Discount",AUTO_PURCHASE:"Auto Purchase",SET_THRESHOLD:"Set Threshold",BALANCE:"Balance",PURCHASE:"Purchase",PURCHASING:"Purchasing",COST:"Cost",ENABLED:"Enabled",DISABLED:"Disabled",PURCHASE_STU:"Purchase Credits",AVAILABLE_OFFERINGS:"Select Any Credit Offerings",SETTING_AUTOPAY:"Configuring Autopay",AUTOPAY_ON_THRESHOLD:"Set auto purchase on threshold",USAGE_CONFIG_ERROR:"Unable to update details please try later",USAGE_CONFIG_SUCCESS:"Details updated",PURCHASE_OFFERING_SUCCESS:"Offering purchased successfully. Balance will be updated shortly",PURCHASE_OFFERING_ERROR:"Unable to proccess the request , please try later",AUTO_PAY_INFO:()=>"Enable or disable automatic payments by toggling the switch. If enabled, the system will process payments when the quota is exceeded. You can also set up the system to automatically purchase credits when reaching a specific threshold using the settings above.",AI_DISABLED:"AI Disabled",AI_ENABLED:"AI Enabled",AUTO_PAY_ENABLE_TOGGLE_SUCCESS:"Auto-pay enabled successfully..!",AUTO_PAY_DISABLE_TOGGLE_SUCCESS:"Auto-pay disabled successfully..!",CONFIG_UPDATE_TYPE_TOGGLE:"toggle",CONFIG_UPDATE_TYPE_BUTTON:"button",AUTO_PURCHASE_THRESHOLD_SUCCESS:"Auto-purchase threshold set successfully!",CONFIGURE_AUTO_PURCHASE:"Configure Auto Purchase",CONFIGURE_AUTOPAY:"Configure Autopay",THRESHOLD_INFO_TEXT:e=>`When your balance falls below ${e} credits, the system will automatically initiate the purchase of the specified offering.`,USERID_PLACEHOLDER:"Update username",ENTER_USER_ID:"Enter username",USERID_LABEL:"Username",UPDATE_USERID_MESSAGE:"Ensure a smoother interaction by choosing a username that isn't the same as your public wallet address.",ENTER_VALID_USER_ID:"Please enter valid Username",USER_ALREADY_EXIST_ERROR:"User already exist",CHAINLINK_SUBSCRIPTION_DISABLED_INFO:"You need to connect your wallet to see chainlink subcriptions",EXPLORE_DOC:"Explore API Docs",ACCESS_CONTROL_LABEL:"Access Control",CONFIGURE_BISCUITS:"Configure Biscuits",CONFIGURE_ACCESS_CONTROL:"Configure Access Control",AUTOMATIC_CHARGE:"Automatic Charge on Negative Balance",AUTOMATIC_CHARGE_TEXT:"Enable or disable automatic payments by toggling the switch. If enabled, payments will be processed whenever the negative balance reaches a certain threshold (around -$100) to return the balance to zero, thus avoiding an interruption in service. This is in addition to the normal monthly billing, which also returns the balance to zero.",AUTO_LOAD_STU:"Auto-Load Credit Feature",AUTO_LOAD_STU_TEXT:"Enable or disable automatic payments by toggling the switch. If enabled, the system will reload your credits with the selected offeringId and automatically purchase additional credits when your balance reaches a specific credit threshold, as configured in the settings below.",AUTOMATIC_CHARGE_TYPE_TOGGLE:"automatic",AUTO_LOAD_TOGGLE:"auto_load",UPDATE_AUTOPAY_ON_THRESHOLD:"Update auto purchase on threshold",QUERY_SLUG_LABEL:"Enter a unique query identifier name (Slug name)",EXPAND:"Expand",COLLAPSE:"Collapse",FREE_BANNER_TEXT:"Free",MONTH_LABEL:"month",SUBSCRIPTION_BANNER_LABEL:"Subscription",SUBSCRIPTION_INFO_DESC:"Unlimited access to blockchain data indexed and decoded from major chains",SUBSCRIPTION_TAB_1:"Standard",SUBSCRIPTION_TAB_2:"Enterprise",SUBSCRIPTION_TAB_3:"Dedicated",CURRENT_PLAN_BUTTON_TEXT:"Current Plan",PAY_PER_COMPUTE_BANNER_LABEL:"Pay per Compute",GET_CREATOR_PLAN:"Subscribe Now",PAY_PER_COMPUTE_BUTTON_LABEL:"Subscribe Now",INCLUDED_IN_CREATOR_SUBSCRIPTION:"Included in Pro Creator plan (Dreamspace AI Studio)",FREE_PLAN_INFO_DESC:"Our Basic package for quickly getting started with Space and Time Studio.",EMAIL_DETAILS:"Email Address",SUBSCRIPTION_EMAIL_INFO:"When registering for the Space and Time subscription, we require your email address to send you notifications or provide information related to your subscription.",CREDIT_UNIT_SMALL:"credits",PAY_AS_YOU_GO_INFO_DESC:"Pay per Compute is our most flexible pricing option.",AUTO_PURCHASE_THRESHOLD_UPDATE_SUCCESS:"Auto-purchase threshold updated successfully!",BALANCE_PAID_SUCCESS:"Balance paid successfully. Balance will be updated shortly",WALLET_CONNECTED:"Wallet connected successfully",WALLET_CONNECT_FAIL:"Unable to connect",WALLET_SIGNATURE_REJECTION:"Wallet connection failed because signature was rejected",CONNECT_A_WALLET:`Hi there from Space and Time Studio dApp! Sign this message to prove you have access to this wallet and we'll connect your wallet with Space and Time Studio dApp. This is free- it won't cost you any Ether.
|
|
5806
5806
|
To stop hackers using your wallet, here's a unique auth code they can't guess: `,CONNECT_A_WALLET_HELP_TEXT:"Choose your preferred wallet to seamlessly log into SxT Studio. We offer support for various wallets, providing you with flexibility and control over your digital assets.",PUBLIC_DASHBOARD:"Public Dashboard",VIEW_HERE_ANCHOR_LINK:"View here",VIEWS:"Views",VIEWS_TEXT:"Explore all views",CREATE_VIEW:"Create new view",NO_VIEW_FOUND:"Couldn't find any views matching your search criteria",FILTER_BY_SCHEMA:"Filter By Dataset",FILTER_BY_SCOPE:"Filter By Scope",SELECT_SCHEMA:"Select Dataset",TABLE_ENCRYPTED_SUCCESS:"Table encrypted successfully",UPGRADE_TEXT:"Change Plan",EMPTY_SCHEMA:"No datasets available. Begin by creating a dataset to organize your data.",EMPTY_TABLES:"No tables found in this dataset. Start by creating a table to store your data.",CREATE_SCHEMA_INFO_TEXT:`It seems you don't have any datasets yet.
|
|
5807
|
-
Begin by creating a dataset to organize your data! Click below to create your first dataset.`,CREATE_TABLE_INFO_TEXT:"Looks like your dataset is empty. Start by creating a table to populate your dataset! Click below to create your first table.",CREATE_SCHEMA:"Create Dataset",CREATE_TABLE:"Create Table",MANAGED_DB:"Managed DB",INDEXED_SXT_CHAIN_MAINNET:"Indexed on SXT Chain (Mainnet)",INDEXED_SXT_CHAIN_TESTNET:"Indexed on SXT Chain (Testnet)",NO_DATASET_FOUND:"No Dataset Found",MY_PRIVATE_AND_MY_ORG:"My Organization",COMMUNITY_DATASETS:"Public User Tables (Managed DB)",NO_RESULT_FOUND_ON_VIEW_FILTER:"We couldn't find anything! Try adjusting the search or filter.",LEAVE_SUBSCRIPTION_SUCCESS:"You have been successfully removed from this subscription",LEAVE_SUBSCRIPTION:"Leave Subscription",LEAVE_SUBSCRIPTION_MESSAGE:"If you proceed, you won't be able to run private queries and access organization data. If you have any concerns or questions, feel free to reach out to",CANCEL_SUBSCRIPTION_TOOLTIP_TEXT:"Are you sure you want to leave this subscription?",LEAVE_SUBSCRIPTION_TOOLTIP_TEXT:"Are you sure you want to leave your current subscription?",SUPPORT_LINK_MESSAGE:"our support team for assistance",IMMUTABLE:"Immutable",SKIP_FOR_NOW:"Or skip paid subscription for now:",REGISTER_AS_TRIAL_USER:"Register as trial user",JOIN_EXISTING_SUBSCRIPTION:"Join your org's existing subscription",CHOOSE_A_SUBSCRIPTION:"Choose a subscription",SKIP_NOW_CHECKBOX_TEXT:"I don't have a joincode - register as trial user",MEMBERS:"Members",BY_TAG:"By Tag",TABLES_TEXT:"Tables and Columns",EXPLORE_PUBLIC_QUERIES:"Explore Public Queries",EXPLORE_PUBLIC_DASHBOARDS:"Explore Public Dashboards",VIEW_IN_EDITOR:"View In Editor",MATERIALIZE_VIEW_CHECKBOX_TEXT:"Cache this query result as a materialized view",MATERIALIZED_VIEW_CONFIGURATION:"Materialized View (Cache) Configuration",MATERIALIZED_VIEW_INFO:"A materialized view is a precomputed result of a SQL query that is stored as a physical table. They are used to improve query performance, and they are refreshed automatically to reflect changes in the underlying data.",INSUFFICIENT_ENCRYPTION_PERMISSIONS:e=>`To configure encryption on this table (${e}), please make sure you have uploaded a biscuit with ddl_alter permissions.`,SELECT_TABLE:"Select Table",USER_USAGE_INFO:"Track your usage of compute units over time with detailed activity logs and a visual representation. Monitor your total usage for the selected duration at a glance.",SUBSCRIPTION_USAGE_INFO:"Access a comprehensive overview of your subscription's overall usage of compute units and charge activity with detailed logs and visual representation.",MEMBER_USAGE_INFO:"Gain a comprehensive overview of usage and charge activity for your subscription members, complete with detailed logs and visual representation. Easily select a member by using the dropdown below to access specific member logs.",UPGRADE_SUBSCRIPTION_TOOLTIP:"Are you sure you want to change your current subscription?",UPGRADE_SUBSCRIPTION_FIXED_MESSAGE:"Are you sure you want to change your plan from Flat Fee to Pay per Compute? Your remaining Flat Fee monthly balance(if any) will be converted to Compute credits.",UPGRADE_SUBSCRIPTION_COMPUTE_ZERO_BALANCE_MESSAGE:"Confirm your plan change from Pay per Compute to Flat Fee. If you proceed, remaining Compute credits(if any) will be converted to a prorated Flat Fee for the current billing cycle.",UPGRADE_SUBSCRIPTION_COMPUTE_WITH_LESS_BALANCE_MESSAGE:e=>`By Changing from Pay per Compute to Flat Fee, (plan amount ${e}- balance) will be incurred as an additional cost as your account’s Compute credits are less than the Flat Fee monthly cost. Do you wish to proceed?`,UPGRADE_SUBSCRIPTION_COMPUTE_WITH_GREATER_BALANCE_MESSAGE:"Changing from Pay per Compute to Flat Fee will result in a lapse of excess (if balance exceeds the plan amount) Compute credits as your account balance exceeds the Flat Fee monthly cost. Are you sure you want to proceed?",UPGRADE_SUBSCRIPTION_FIXED_SUCCESS_MESSAGE:"Congratulations! Your plan has been changed from Flat Fee to Pay per Compute. Your remaining Flat Fee monthly cost has been converted into Compute credits for your usage.",UPGRADE_SUBSCRIPTION_COMPUTE_ZERO_BALANCE_SUCCESS_MESSAGE:"Your plan has been successfully changed from Pay per Compute to Flat Fee. Your remaining Compute credits have been converted into Flat Fee monthly cost",UPGRADE_SUBSCRIPTION_COMPUTE_WITH_LESS_BALANCE_SUCCESS_MESSAGE:"Your plan has been updated from Pay per Compute to Flat Fee. As your Compute credits were insufficient to cover the Flat Fee cost, an additional amount has been deducted from your saved credit card.",UPGRADE_SUBSCRIPTION_COMPUTE_WITH_GREATER_BALANCE_SUCCESS_MESSAGE:"Your plan has been changed from Pay per Compute to Flat Fee. Since your Compute credits exceeded the Flat Fee monthly cost, the remaining balance has lapsed.",JOIN_SUBSCRIPTION_REGISTER:"Purchase subscription",OR:"or",INPUT_TYPE_TEMP_PASSWORD:"tempPassword",CHART_NO_DATA_TEXT:" No data available for the specified query!",CHART_NO_DATA_SUBTEXT:"Please click here to adjust your query or try again later.",SELECT_AGGREGATION:"Select Aggregation",AGGREGATED_BY:"Aggregated By",NO_SCHEMA_FOUND:"No Schema Found",SEARCH_VIEWS:"Search views",SCHEMA:"Schema",PUBLISHED_TITLE:"Dashboard Link",ORGANIZATION_DATASETS:"My Organization (Managed DB)",SPACE_AND_TIME_DATASETS:"Indexed Chains",SPACE_AND_TIME_DATASETS_MANAGED:"Indexed Chains (Managed DB)",REFRESHING:"Refreshing...",REFRESH_RESULTS:"Refresh Results",STAY:"Stay",LEAVE:"Leave",PLANS_INTRO_HEADER:"Choose a plan that’s right for you",DOCS_INTRO_HEADER_DREAMSPACE:"What is Dreamspace?",DOCS_INTRO_HEADER_DESCRIPTION_DREAMSPACE:"Dreamspace is the first vibe-coding studio for creatives in crypto. It allows you to generate a production-ready app and deploy it to the chain of your choice in minutes.",DOCS_INTRO_HEADER:"What is Space and Time?",DOCS_INTRO_HEADER_DESCRIPTION:"Space and Time is a decentralized replacement for your blockchain indexing service, data warehouse, and API servers, all secured by our sub-second ZK coprocessor for SQL.",PERMISSION_API_DOCS_DESC:"Configure fine-tuned access permissions with bearer tokens (biscuits) associated with your private tables, to control security and determine how your colleagues can access your org’s tables.",PERMISSIONS_BISCUITS_DESC:"Biscuits are a special bearer token used to authorize access to resources (e.g. tables) and are associated with a public/private key pair. Public keys are provided when the user creates a resource (such as a table) and are used to validate biscuit signatures during authorization for requests against that resource.",ACCESS_CONTROL_DESC:"Manage who can access your tables and views. There are three levels of access you can have on a resource: read-only, read-write, allow-all.",GO_TO_DOCS_TEXT:"Learn More",TRY_OUR_API_TEXT:"Try Our APIs",PROFILE_TEXT_NAV:"Profile",DOCS_TEXT_NAV:"Docs",MY_ORGANIZATION_TEXT_NAV:"My Organization",API_AUTHENTICATION_TEXT_NAV:"API Authentication",PERMISSIONS_TEXT_NAV:"Permissions & Access",BISCUITS_TEXT_NAV:"Biscuits",ACCESS_CONTROL_TEXT_NAV:"Access Control",PLANS_TEXT_NAV:"Subscription Plans",MY_PLAN_TEXT_NAV:"My Subscription",BILLINGS_TEXT_NAV:"Billing & Usage",BILLING_HEADER:"Billing",CREDIT_CARD_TEXT_NAV:"Credit Card",COMPUTE_USAGE_TEXT_NAV:"Compute Usage (Managed DB Subscription)",SHARE_DASHBOARD_TOOLTIP:"Share this dashboard",DEFAULT_FREE_QUERY_TEXT:"Just like the credit balance, the free query count is updated roughly every 15 minutes, so the balance you see may or may not be up to date.",TRIAL_EXPIRED:"Trial expired",CHOOSE_QUERY_VISIBILITY:"Choose the visibility for your query:",SMART_CONTRACT_SUCCESS:"Contract Submitted Successfully...",ZK_PROVEN_CHAIN_INFO_TOOLTIP_MSG_1:"Contracts living on a chain's mainnet network will be indexed by SXT Chain (mainnet). Contracts living on a chain's testnet network will be indexed by SXT Chain (testnet).",DATASET_INFO_TOOLTIP_MSG_1:"The platform employs near real-time indexing of blockchain data using a cryptographically verifiable method for accuracy.",DATASET_INFO_TOOLTIP_MSG_2:"You need to click on a blockchain cube to view all tables and data sets.",OPEN_DOCS:"Open Docs",ADD_EMAIL_LABEL:"Add Email Address",MANAGE_PROFILE_LABEL:"Manage Profile",CLOSE_ACCOUNT:"Cancel Subscription",TRIAL:"Trial",CONTRACT_TRACKED:"Contract Already Tracked",QUERY_CLONE_SUCCESS:"Query forked successfully",NO_WALLET_ADDRESS_FOUND:e=>`No wallet address found in profile, please update/reinstall ${e}`,FORK_VISUAL:"Fork visual",VISUAL_CLONE_SUCCESS:"Visual forked successfully",SXT_SUBGROUP:"Popular Protocol Contracts",COMMUNITY_SUBGROUP:"Community Requested Contracts",SUBSCRIPTIONS_SUBGROUP:"My Subscriptions Requested Contracts",SXT_COMMUNITY_SUBGROUP:"Community Owned Tables",SXT_CHAIN_CATEGORY:"ZK Proven by SXT Chain",SXT_TEST_CHAIN_CATEGORY:"ZK Proven by SXT Chain (testnet)",ZK_SXT_CHAIN_CATEGORY:"SXT Chain (ZK-SQL or Optimistic)",ZK_SXT_TEST_CHAIN_CATEGORY:"SXT Chain Testnet (ZK-SQL or Optimistic)",CORE_CHAIN_DATA:"Core Chain Data",COUNTER_HELP_TEXT:"In instances of non-computability or static metric choice, the result will showcase the first column value.",VERIFY_EMAIL_PROMPT:"Verify email address",VERIFY_EMAIL_INFO_01:"We have sent a verification link to your email. Please open the message and click the link to confirm your address.",VERIFY_EMAIL_INFO_02:"A verified email is required to use our data services (for instance, running queries).",VERIFY_EMAIL_CONFIRMATION:"Continue",GO_TO_PROFILE:"Go to profile",GOOGLE_LOGIN_FAILED:"Encountered an error while logging in with Google. Please try again.",MANAGED_DB_PLANS_HEADER:"Managed DB Plans",CONFIGURE_YOUR_INFRA_HEADER:"Configure Your Infra",CONFIGURE_YOUR_INFRA_DESC:"Add a database subscription to host your app's data or access indexed blockchain data.",PAY_PER_COMPUTE_DESC:"Perfect for startups and creators who need a flexible, usage-based database for their app. Only pay for the compute you use, with no upfront costs. 50% discount if you're on on the Dreamspace Pro Creator Subscription.",SCALE_ON_DEMAND_TAGLINE:"Scale on demand, pay only for what you use",DEPLOY_HOST_WITH:"Deploy and host your app with...",FIXED_COST_PLAN_DESC:"For teams and businesses that need dedicated infrastructure and enhanced performance. Get multi-tenant database access with premium features.",HIGH_PERFORMANCE_TAGLINE:"High-performance, multi-tenant database for enterprise workloads",EVERYTHING_IN_PPC_PLUS:"Everything you get in Pay per Compute, plus...",DREAMSPACE_CREATOR_PLANS_HEADER:"Dreamspace Creator Plans",CREATE_YOUR_APP_HEADER:"Create Your App",CREATE_YOUR_APP_DESC:"Start building with our Free tier, or upgrade to Creator for unlimited access and premium features.",FREE_PLAN_DESC:"Perfect for exploring Dreamspace or prototyping your first app. Get a feel for our AI app generation studio at no cost.",START_GENERATING_TAGLINE:"Start generating, no strings attached",EXPLORE_DREAMSPACE_WITH:"Explore Dreamspace with...",CREATOR_PLAN_DESC:"Unlock the full power of Dreamspace. Enjoy unlimited access to premium features and take your app from concept to production.",GENERATE_APPS_TAGLINE:"Generate unlimited apps with AI",EVERYTHING_IN_FREE_PLUS:"Everything you get in Free, plus...",PLAN_TYPE_PAY_PER_COMPUTE:"Pay per Compute",PLAN_TYPE_SUBSCRIPTION:"Subscription",PLAN_TYPE_PRO_CREATOR:"Pro Creator",PLAN_TYPE_FREE_TIER:"Free Tier",PLAN_CATEGORY_MANAGED_DB:"Managed DB",PLAN_CATEGORY_DREAMSPACE:"Dreamspace"},Zti={ENCRYPTION_GUIDE:"https://docs.makeinfinite.com/docs/gettingstartedsxt",BLOCKCHAIN_INDEXING:"https://docs.makeinfinite.com/docs/gettingstartedsxt"};var gbe={},drt={exports:{}};(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(drt);var uD=drt.exports,aoe={},hrt={exports:{}},Io={};/**
|
|
5807
|
+
Begin by creating a dataset to organize your data! Click below to create your first dataset.`,CREATE_TABLE_INFO_TEXT:"Looks like your dataset is empty. Start by creating a table to populate your dataset! Click below to create your first table.",CREATE_SCHEMA:"Create Dataset",CREATE_TABLE:"Create Table",MANAGED_DB:"Managed DB",INDEXED_SXT_CHAIN_MAINNET:"Indexed on SXT Chain (Mainnet)",INDEXED_SXT_CHAIN_TESTNET:"Indexed on SXT Chain (Testnet)",NO_DATASET_FOUND:"No Dataset Found",MY_PRIVATE_AND_MY_ORG:"My Organization",COMMUNITY_DATASETS:"Public User Tables (Managed DB)",NO_RESULT_FOUND_ON_VIEW_FILTER:"We couldn't find anything! Try adjusting the search or filter.",LEAVE_SUBSCRIPTION_SUCCESS:"You have been successfully removed from this subscription",LEAVE_SUBSCRIPTION:"Leave Subscription",LEAVE_SUBSCRIPTION_MESSAGE:"If you proceed, you won't be able to run private queries and access organization data. If you have any concerns or questions, feel free to reach out to",CANCEL_SUBSCRIPTION_TOOLTIP_TEXT:"Are you sure you want to leave this subscription?",LEAVE_SUBSCRIPTION_TOOLTIP_TEXT:"Are you sure you want to leave your current subscription?",SUPPORT_LINK_MESSAGE:"our support team for assistance",IMMUTABLE:"Immutable",SKIP_FOR_NOW:"Or skip paid subscription for now:",REGISTER_AS_TRIAL_USER:"Register as trial user",JOIN_EXISTING_SUBSCRIPTION:"Join your org's existing subscription",CHOOSE_A_SUBSCRIPTION:"Choose a subscription",SKIP_NOW_CHECKBOX_TEXT:"I don't have a joincode - register as trial user",MEMBERS:"Members",BY_TAG:"By Tag",TABLES_TEXT:"Tables and Columns",EXPLORE_PUBLIC_QUERIES:"Explore Public Queries",EXPLORE_PUBLIC_DASHBOARDS:"Explore Public Dashboards",VIEW_IN_EDITOR:"View In Editor",MATERIALIZE_VIEW_CHECKBOX_TEXT:"Cache this query result as a materialized view",MATERIALIZED_VIEW_CONFIGURATION:"Materialized View (Cache) Configuration",MATERIALIZED_VIEW_INFO:"A materialized view is a precomputed result of a SQL query that is stored as a physical table. They are used to improve query performance, and they are refreshed automatically to reflect changes in the underlying data.",INSUFFICIENT_ENCRYPTION_PERMISSIONS:e=>`To configure encryption on this table (${e}), please make sure you have uploaded a biscuit with ddl_alter permissions.`,SELECT_TABLE:"Select Table",USER_USAGE_INFO:"Track your usage of compute units over time with detailed activity logs and a visual representation. Monitor your total usage for the selected duration at a glance.",SUBSCRIPTION_USAGE_INFO:"Access a comprehensive overview of your subscription's overall usage of compute units and charge activity with detailed logs and visual representation.",MEMBER_USAGE_INFO:"Gain a comprehensive overview of usage and charge activity for your subscription members, complete with detailed logs and visual representation. Easily select a member by using the dropdown below to access specific member logs.",UPGRADE_SUBSCRIPTION_TOOLTIP:"Are you sure you want to change your current subscription?",UPGRADE_SUBSCRIPTION_FIXED_MESSAGE:"Are you sure you want to change your plan from Flat Fee to Pay per Compute? Your remaining Flat Fee monthly balance(if any) will be converted to Compute credits.",UPGRADE_SUBSCRIPTION_COMPUTE_ZERO_BALANCE_MESSAGE:"Confirm your plan change from Pay per Compute to Flat Fee. If you proceed, remaining Compute credits(if any) will be converted to a prorated Flat Fee for the current billing cycle.",UPGRADE_SUBSCRIPTION_COMPUTE_WITH_LESS_BALANCE_MESSAGE:e=>`By Changing from Pay per Compute to Flat Fee, (plan amount ${e}- balance) will be incurred as an additional cost as your account’s Compute credits are less than the Flat Fee monthly cost. Do you wish to proceed?`,UPGRADE_SUBSCRIPTION_COMPUTE_WITH_GREATER_BALANCE_MESSAGE:"Changing from Pay per Compute to Flat Fee will result in a lapse of excess (if balance exceeds the plan amount) Compute credits as your account balance exceeds the Flat Fee monthly cost. Are you sure you want to proceed?",UPGRADE_SUBSCRIPTION_FIXED_SUCCESS_MESSAGE:"Congratulations! Your plan has been changed from Flat Fee to Pay per Compute. Your remaining Flat Fee monthly cost has been converted into Compute credits for your usage.",UPGRADE_SUBSCRIPTION_COMPUTE_ZERO_BALANCE_SUCCESS_MESSAGE:"Your plan has been successfully changed from Pay per Compute to Flat Fee. Your remaining Compute credits have been converted into Flat Fee monthly cost",UPGRADE_SUBSCRIPTION_COMPUTE_WITH_LESS_BALANCE_SUCCESS_MESSAGE:"Your plan has been updated from Pay per Compute to Flat Fee. As your Compute credits were insufficient to cover the Flat Fee cost, an additional amount has been deducted from your saved credit card.",UPGRADE_SUBSCRIPTION_COMPUTE_WITH_GREATER_BALANCE_SUCCESS_MESSAGE:"Your plan has been changed from Pay per Compute to Flat Fee. Since your Compute credits exceeded the Flat Fee monthly cost, the remaining balance has lapsed.",JOIN_SUBSCRIPTION_REGISTER:"Purchase subscription",OR:"or",INPUT_TYPE_TEMP_PASSWORD:"tempPassword",CHART_NO_DATA_TEXT:" No data available for the specified query!",CHART_NO_DATA_SUBTEXT:"Please click here to adjust your query or try again later.",SELECT_AGGREGATION:"Select Aggregation",AGGREGATED_BY:"Aggregated By",NO_SCHEMA_FOUND:"No Schema Found",SEARCH_VIEWS:"Search views",SCHEMA:"Schema",PUBLISHED_TITLE:"Dashboard Link",ORGANIZATION_DATASETS:"My Organization (Managed DB)",SPACE_AND_TIME_DATASETS:"Indexed Chains",SPACE_AND_TIME_DATASETS_MANAGED:"Indexed Chains (Managed DB)",REFRESHING:"Refreshing...",REFRESH_RESULTS:"Refresh Results",STAY:"Stay",LEAVE:"Leave",PLANS_INTRO_HEADER:"Choose a plan that’s right for you",DOCS_INTRO_HEADER_DREAMSPACE:"What is Dreamspace?",DOCS_INTRO_HEADER_DESCRIPTION_DREAMSPACE:"Dreamspace is the first vibe-coding studio for creatives in crypto. It allows you to generate a production-ready app and deploy it to the chain of your choice in minutes.",DOCS_INTRO_HEADER:"What is Space and Time?",DOCS_INTRO_HEADER_DESCRIPTION:"Space and Time is a decentralized replacement for your blockchain indexing service, data warehouse, and API servers, all secured by our sub-second ZK coprocessor for SQL.",PERMISSION_API_DOCS_DESC:"Configure fine-tuned access permissions with bearer tokens (biscuits) associated with your private tables, to control security and determine how your colleagues can access your org’s tables.",PERMISSIONS_BISCUITS_DESC:"Biscuits are a special bearer token used to authorize access to resources (e.g. tables) and are associated with a public/private key pair. Public keys are provided when the user creates a resource (such as a table) and are used to validate biscuit signatures during authorization for requests against that resource.",ACCESS_CONTROL_DESC:"Manage who can access your tables and views. There are three levels of access you can have on a resource: read-only, read-write, allow-all.",GO_TO_DOCS_TEXT:"Learn More",TRY_OUR_API_TEXT:"Try Our APIs",PROFILE_TEXT_NAV:"Profile",DOCS_TEXT_NAV:"Docs",MY_ORGANIZATION_TEXT_NAV:"My Organization",API_AUTHENTICATION_TEXT_NAV:"API Authentication",PERMISSIONS_TEXT_NAV:"Permissions & Access",BISCUITS_TEXT_NAV:"Biscuits",ACCESS_CONTROL_TEXT_NAV:"Access Control",PLANS_TEXT_NAV:"Subscription Plans",MY_PLAN_TEXT_NAV:"My Subscription",BILLINGS_TEXT_NAV:"Billing & Usage",BILLING_HEADER:"Billing",CREDIT_CARD_TEXT_NAV:"Credit Card",COMPUTE_USAGE_TEXT_NAV:"Compute Usage (Managed DB Subscription)",SHARE_DASHBOARD_TOOLTIP:"Share this dashboard",DEFAULT_FREE_QUERY_TEXT:"Just like the credit balance, the free query count is updated roughly every 15 minutes, so the balance you see may or may not be up to date.",TRIAL_EXPIRED:"Trial expired",CHOOSE_QUERY_VISIBILITY:"Choose the visibility for your query:",SMART_CONTRACT_SUCCESS:"Contract Submitted Successfully...",ZK_PROVEN_CHAIN_INFO_TOOLTIP_MSG_1:"Contracts living on a chain's mainnet network will be indexed by SXT Chain (mainnet). Contracts living on a chain's testnet network will be indexed by SXT Chain (testnet).",DATASET_INFO_TOOLTIP_MSG_1:"The platform employs near real-time indexing of blockchain data using a cryptographically verifiable method for accuracy.",DATASET_INFO_TOOLTIP_MSG_2:"You need to click on a blockchain cube to view all tables and data sets.",OPEN_DOCS:"Open Docs",ADD_EMAIL_LABEL:"Add Email Address",MANAGE_PROFILE_LABEL:"Manage Profile",CLOSE_ACCOUNT:"Cancel Subscription",TRIAL:"Trial",CONTRACT_TRACKED:"Contract Already Tracked",QUERY_CLONE_SUCCESS:"Query forked successfully",NO_WALLET_ADDRESS_FOUND:e=>`No wallet address found in profile, please update/reinstall ${e}`,FORK_VISUAL:"Fork visual",VISUAL_CLONE_SUCCESS:"Visual forked successfully",SXT_SUBGROUP:"Popular Protocol Contracts",COMMUNITY_SUBGROUP:"Community Requested Contracts",SUBSCRIPTIONS_SUBGROUP:"My Subscriptions Requested Contracts",SXT_COMMUNITY_SUBGROUP:"Community Owned Tables",SXT_CHAIN_CATEGORY:"ZK Proven by SXT Chain",SXT_TEST_CHAIN_CATEGORY:"ZK Proven by SXT Chain (testnet)",ZK_SXT_CHAIN_CATEGORY:"SXT Chain (ZK-SQL or Optimistic)",ZK_SXT_TEST_CHAIN_CATEGORY:"SXT Chain Testnet (ZK-SQL or Optimistic)",CORE_CHAIN_DATA:"Core Chain Data",COUNTER_HELP_TEXT:"In instances of non-computability or static metric choice, the result will showcase the first column value.",VERIFY_EMAIL_PROMPT:"Verify email address",VERIFY_EMAIL_INFO_01:"We have sent a verification link to your email. Please open the message and click the link to confirm your address.",VERIFY_EMAIL_INFO_02:"A verified email is required to use our services, such as generating apps or running queries.",VERIFY_EMAIL_CONFIRMATION:"Continue",GO_TO_PROFILE:"Go to profile",GOOGLE_LOGIN_FAILED:"Encountered an error while logging in with Google. Please try again.",MANAGED_DB_PLANS_HEADER:"Managed DB Plans",CONFIGURE_YOUR_INFRA_HEADER:"Configure Your Infra",CONFIGURE_YOUR_INFRA_DESC:"Add a database subscription to host your app's data or access indexed blockchain data.",PAY_PER_COMPUTE_DESC:"Perfect for startups and creators who need a flexible, usage-based database for their app. Only pay for the compute you use, with no upfront costs. 50% discount if you're on on the Dreamspace Pro Creator Subscription.",SCALE_ON_DEMAND_TAGLINE:"Scale on demand, pay only for what you use",DEPLOY_HOST_WITH:"Deploy and host your app with...",FIXED_COST_PLAN_DESC:"For teams and businesses that need dedicated infrastructure and enhanced performance. Get multi-tenant database access with premium features.",HIGH_PERFORMANCE_TAGLINE:"High-performance, multi-tenant database for enterprise workloads",EVERYTHING_IN_PPC_PLUS:"Everything you get in Pay per Compute, plus...",DREAMSPACE_CREATOR_PLANS_HEADER:"Dreamspace Creator Plans",CREATE_YOUR_APP_HEADER:"Create Your App",CREATE_YOUR_APP_DESC:"Start building with our Free tier, or upgrade to Creator for unlimited access and premium features.",FREE_PLAN_DESC:"Perfect for exploring Dreamspace or prototyping your first app. Get a feel for our AI app generation studio at no cost.",START_GENERATING_TAGLINE:"Start generating, no strings attached",EXPLORE_DREAMSPACE_WITH:"Explore Dreamspace with...",CREATOR_PLAN_DESC:"Unlock the full power of Dreamspace. Enjoy unlimited access to premium features and take your app from concept to production.",GENERATE_APPS_TAGLINE:"Generate unlimited apps with AI",EVERYTHING_IN_FREE_PLUS:"Everything you get in Free, plus...",PLAN_TYPE_PAY_PER_COMPUTE:"Pay per Compute",PLAN_TYPE_SUBSCRIPTION:"Subscription",PLAN_TYPE_PRO_CREATOR:"Pro Creator",PLAN_TYPE_FREE_TIER:"Free Tier",PLAN_CATEGORY_MANAGED_DB:"Managed DB",PLAN_CATEGORY_DREAMSPACE:"Dreamspace"},Zti={ENCRYPTION_GUIDE:"https://docs.makeinfinite.com/docs/gettingstartedsxt",BLOCKCHAIN_INDEXING:"https://docs.makeinfinite.com/docs/gettingstartedsxt"};var gbe={},drt={exports:{}};(function(e){function t(r){return r&&r.__esModule?r:{default:r}}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(drt);var uD=drt.exports,aoe={},hrt={exports:{}},Io={};/**
|
|
5808
5808
|
* @license React
|
|
5809
5809
|
* react-is.production.js
|
|
5810
5810
|
*
|