Reading from NEAR testnet…
Reading from NEAR testnet…
CMdeH3HEG1BmJxF9UfZXL2ftGFgMVPZdcj45BFFevHHa
sleetcreate.testnet to sleetcreate.testnet · failed
fs_store()
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dmz8iooL.js","assets/index-C_V5KBbT.js","assets/index-BZrXLpRU.css"])))=>i.map(i=>d[i]);
import{b0 as k,b2 as C,b6 as n,b3 as u,a$ as b,cw as S,b7 as x,b4 as A,bc as p,_ as g,bk as E,bh as _,ba as O,cx as m,b5 as c,b1 as L,cy as N}from"./index-C_V5KBbT.js";const T=k`
:host {
z-index: var(--w3m-z-index);
display: block;
backface-visibility: hidden;
will-change: opacity;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
pointer-events: none;
opacity: 0;
background-color: var(--wui-cover);
transition: opacity 0.2s var(--wui-ease-out-power-2);
will-change: opacity;
}
:host(.open) {
opacity: 1;
}
wui-card {
max-width: var(--w3m-modal-width);
width: 100%;
position: relative;
animation: zoom-in 0.2s var(--wui-ease-out-power-2);
animation-fill-mode: backwards;
outline: none;
}
wui-card[shake='true'] {
animation:
zoom-in 0.2s var(--wui-ease-out-power-2),
w3m-shake 0.5s var(--wui-ease-out-power-2);
}
wui-flex {
overflow-x: hidden;
overflow-y: auto;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
@media (max-height: 700px) and (min-width: 431px) {
wui-flex {
align-items: flex-start;
}
wui-card {
margin: var(--wui-spacing-xxl) 0px;
}
}
@media (max-width: 430px) {
wui-flex {
align-items: flex-end;
}
wui-card {
max-width: 100%;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
border-bottom: none;
animation: slide-in 0.2s var(--wui-ease-out-power-2);
}
wui-card[shake='true'] {
animation:
slide-in 0.2s var(--wui-ease-out-power-2),
w3m-shake 0.5s var(--wui-ease-out-power-2);
}
}
@keyframes zoom-in {
0% {
transform: scale(0.95) translateY(0);
}
100% {
transform: scale(1) translateY(0);
}
}
@keyframes slide-in {
0% {
transform: scale(1) translateY(50px);
}
100% {
transform: scale(1) translateY(0);
}
}
@keyframes w3m-shake {
0% {
transform: scale(1) rotate(0deg);
}
20% {
transform: scale(1) rotate(-1deg);
}
40% {
transform: scale(1) rotate(1.5deg);
}
60% {
transform: scale(1) rotate(-1.5deg);
}
80% {
transform: scale(1) rotate(1deg);
}
100% {
transform: scale(1) rotate(0deg);
}
}
@keyframes w3m-view-height {
from {
height: var(--prev-height);
}
to {
height: var(--new-height);
}
}
`;var l=function(w,e,t,o){var s=arguments.length,i=s<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,t):o,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(w,e,t,o);else for(var d=w.length-1;d>=0;d--)(r=w[d])&&(i=(s<3?r(i):s>3?r(e,t,i):r(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i};const y="scroll-lock";let a=class extends C{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.open=n.state.open,this.caipAddress=u.state.caipAddress,this.isSiweEnabled=b.state.isSiweEnabled,this.connected=u.state.isConnected,this.loading=n.state.loading,this.shake=n.state.shake,this.initializeTheming(),S.prefetch(),this.unsubscribe.push(n.subscribeKey("open",e=>e?this.onOpen():this.onClose()),n.subscribeKey("shake",e=>this.shake=e),n.subscribeKey("loading",e=>{this.loading=e,this.onNewAddress(u.state.caipAddress)}),u.subscribeKey("isConnected",e=>this.connected=e),u.subscribeKey("caipAddress",e=>this.onNewAddress(e)),b.subscribeKey("isSiweEnabled",e=>this.isSiweEnabled=e)),x.sendEvent({type:"track",event:"MODAL_LOADED"})}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.open?A`
<wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
<wui-card
shake="${this.shake}"
role="alertdialog"
aria-modal="true"
tabindex="0"
data-testid="w3m-modal-card"
>
<w3m-header></w3m-header>
<w3m-router></w3m-router>
<w3m-snackbar></w3m-snackbar>
</wui-card>
</wui-flex>
<w3m-tooltip></w3m-tooltip>
`:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){const e=p.state.view==="ConnectingSiwe",t=p.state.view==="ApproveTransaction";if(this.isSiweEnabled){const{SIWEController:o}=await g(async()=>{const{SIWEController:i}=await import("./index-Dmz8iooL.js");return{SIWEController:i}},__vite__mapDeps([0,1,2]));o.state.status!=="success"&&(e||t)?n.shake():n.close()}else n.close()}initializeTheming(){const{themeVariables:e,themeMode:t}=N.state,o=E.getColorTheme(t);_(e,o)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),O.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=y,e.textContent=`
body {
touch-action: none;
overflow: hidden;
overscroll-behavior: contain;
}
w3m-modal {
pointer-events: auto;
}
`,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${y}"]`);e&&e.remove()}onAddKeyboardListener(){var t;this.abortController=new AbortController;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",o=>{if(o.key==="Escape")this.handleClose();else if(o.key==="Tab"){const{tagName:s}=o.target;s&&!s.includes("W3M-")&&!s.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}async onNewAddress(e){var r,d;if(!this.connected||this.loading)return;const t=m.getPlainAddress(this.caipAddress),o=m.getPlainAddress(e),s=m.getNetworkId(this.caipAddress),i=m.getNetworkId(e);if(this.caipAddress=e,this.isSiweEnabled){const{SIWEController:h}=await g(async()=>{const{SIWEController:v}=await import("./index-Dmz8iooL.js");return{SIWEController:v}},__vite__mapDeps([0,1,2])),f=await h.getSession();if(f&&t&&o&&t!==o){(r=h.state._client)!=null&&r.options.signOutOnAccountChange&&(await h.signOut(),this.onSiweNavigation());return}if(f&&s&&i&&s!==i){(d=h.state._client)!=null&&d.options.signOutOnNetworkChange&&(await h.signOut(),this.onSiweNavigation());return}this.onSiweNavigation()}}onSiweNavigation(){this.open?p.push("ConnectingSiwe"):n.open({view:"ConnectingSiwe"})}};a.styles=T;l([c()],a.prototype,"open",void 0);l([c()],a.prototype,"caipAddress",void 0);l([c()],a.prototype,"isSiweEnabled",void 0);l([c()],a.prototype,"connected",void 0);l([c()],a.prototype,"loading",void 0);l([c()],a.prototype,"shake",void 0);a=l([L("w3m-modal")],a);export{a as W3mModal};
fs_store()
BASE+toString(concat([Y,W]),MULTICODEC_ED25519_ENCODING);return[DID_PREFIX,DID_METHOD,J].join(DID_DELIMITER)}function encodeSig(W){return toString(W,JWT_ENCODING)}function decodeSig(W){return fromString(W,JWT_ENCODING)}function encodeData(W){return fromString([encodeJSON(W.header),encodeJSON(W.payload)].join(JWT_DELIMITER),DATA_ENCODING)}function encodeJWT(W){return[encodeJSON(W.header),encodeJSON(W.payload),encodeSig(W.signature)].join(JWT_DELIMITER)}function decodeJWT(W){const Y=W.split(JWT_DELIMITER),J=decodeJSON(Y[0]),X=decodeJSON(Y[1]),Me=decodeSig(Y[2]),Se=fromString(Y.slice(0,2).join(JWT_DELIMITER),DATA_ENCODING);return{header:J,payload:X,signature:Me,data:Se}}function generateKeyPair(W=randomExports.randomBytes(KEY_PAIR_SEED_LENGTH)){return ed25519Exports.generateKeyPairFromSeed(W)}async function signJWT(W,Y,J,X,Me=cjsExports$3.fromMiliseconds(Date.now())){const Se={alg:JWT_IRIDIUM_ALG,typ:JWT_IRIDIUM_TYP},Ne=encodeIss(X.publicKey),je=Me+J,ke={iss:Ne,sub:W,aud:Y,iat:Me,exp:je},De=encodeData({header:Se,payload:ke}),qe=ed25519Exports.sign(X.secretKey,De);return encodeJWT({header:Se,payload:ke,signature:qe})}const C$2={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var define_process_env_default={};const Rr$2=":";function An$1(W){const[Y,J]=W.split(Rr$2);return{namespace:Y,reference:J}}function Wo(W,Y=[]){const J=[];return Object.keys(W).forEach(X=>{if(Y.length&&!Y.includes(X))return;const Me=W[X];J.push(...Me.accounts)}),J}function Or$1(W,Y){return W.includes(":")?[W]:Y.chains||[]}var Zo=Object.defineProperty,En$1=Object.getOwnPropertySymbols,ts=Object.prototype.hasOwnProperty,es=Object.prototype.propertyIsEnumerable,Sn$1=(W,Y,J)=>Y in W?Zo(W,Y,{enumerable:!0,configurable:!0,writable:!0,value:J}):W[Y]=J,In$1=(W,Y)=>{for(var J in Y||(Y={}))ts.call(Y,J)&&Sn$1(W,J,Y[J]);if(En$1)for(var J of En$1(Y))es.call(Y,J)&&Sn$1(W,J,Y[J]);return W};const Nn="ReactNative",qt$1={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},Bn="js";function bi$1(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function rr$1(){return!cjsExports$2.getDocument()&&!!cjsExports$2.getNavigator()&&navigator.product===Nn}function gr$1(){return!bi$1()&&!!cjsExports$2.getNavigator()&&!!cjsExports$2.getDocument()}function We(){return rr$1()?qt$1.reactNative:bi$1()?qt$1.node:gr$1()?qt$1.browser:qt$1.unknown}function ns(){var W;try{return rr$1()&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Application)<"u"?(W=globalThis.Application)==null?void 0:W.applicationId:void 0}catch{return}}function Cn$1(W,Y){let J=queryStringExports.parse(W);return J=In$1(In$1({},J),Y),W=queryStringExports.stringify(J),W}function fs$1(){return cjsExports$1.getWindowMetadata()||{name:"",description:"",url:"",icons:[""]}}function Rn$1(){if(We()===qt$1.reactNative&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Platform)<"u"){const{OS:J,Version:X}=globalThis.Platform;return[J,X].join("-")}const W=detect();if(W===null)return"unknown";const Y=W.os?W.os.replace(" ","").toLowerCase():"unknown";return W.type==="browser"?[Y,W.name,W.version].join("-"):[Y,W.version].join("-")}function On$1(){var W;const Y=We();return Y===qt$1.browser?[Y,((W=cjsExports$2.getLocation())==null?void 0:W.host)||"unknown"].join(":"):Y}function Pn$1(W,Y,J){const X=Rn$1(),Me=On$1();return[[W,Y].join("-"),[Bn,J].join("-"),X,Me].join("/")}function ss({protocol:W,version:Y,relayUrl:J,sdkVersion:X,auth:Me,projectId:Se,useOnCloseEvent:Ne,bundleId:je}){const ke=J.split("?"),De=Pn$1(W,Y,X),qe={auth:Me,ua:De,projectId:Se,useOnCloseEvent:Ne||void 0,origin:je||void 0},Ue=Cn$1(ke[1]||"",qe);return ke[0]+"?"+Ue}function _e$2(W,Y){return W.filter(J=>Y.includes(J)).length===W.length}function cs(W){return Object.fromEntries(W.entries())}function ls(W){return new Map(Object.entries(W))}function gs(W=cjsExports$3.FIVE_MINUTES,Y){const J=cjsExports$3.toMiliseconds(W||cjsExports$3.FIVE_MINUTES);let X,Me,Se;return{resolve:Ne=>{Se&&X&&(clearTimeout(Se),X(Ne))},reject:Ne=>{Se&&Me&&(clearTimeout(Se),Me(Ne))},done:()=>new Promise((Ne,je)=>{Se=setTimeout(()=>{je(new Error(Y))},J),X=Ne,Me=je})}}function ms$1(W,Y,J){return new Promise(async(X,Me)=>{const Se=setTimeout(()=>Me(new Error(J)),Y);try{const Ne=await W;X(Ne)}catch(Ne){Me(Ne)}clearTimeout(Se)})}function yi$1(W,Y){if(typeof Y=="string"&&Y.startsWith(`${W}:`))return Y;if(W.toLowerCase()==="topic"){if(typeof Y!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${Y}`}else if(W.toLowerCase()==="id"){if(typeof Y!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${Y}`}throw new Error(`Unknown expirer target type: ${W}`)}function As$1(W){return yi$1("topic",W)}function bs$1(W){return yi$1("id",W)}function ys$1(W){const[Y,J]=W.split(":"),X={id:void 0,topic:void 0};if(Y==="topic"&&typeof J=="string")X.topic=J;else if(Y==="id"&&Number.isInteger(Number(J)))X.id=Number(J);else throw new Error(`Invalid target, expected id:number or topic:string, got ${Y}:${J}`);return X}function ws$1(W,Y){return cjsExports$3.fromMiliseconds(Date.now()+cjsExports$3.toMiliseconds(W))}function xs$1(W){return Date.now()>=cjsExports$3.toMiliseconds(W)}function Ms$1(W,Y){return`${W}${Y?`:${Y}`:""}`}function me$1(W=[],Y=[]){return[...new Set([...W,...Y])]}async function Es$2({id:W,topic:Y,wcDeepLink:J}){var X;try{if(!J)return;const Me=typeof J=="string"?JSON.parse(J):J,Se=Me==null?void 0:Me.href;if(typeof Se!="string")return;const Ne=Un$1(Se,W,Y),je=We();if(je===qt$1.browser){if(!((X=cjsExports$2.getDocument())!=null&&X.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}Ne.startsWith("https://")||Ne.startsWith("http://")?window.open(Ne,"_blank","noreferrer noopener"):window.open(Ne,kn$1()?"_blank":"_self","noreferrer noopener")}else je===qt$1.reactNative&&typeof(globalThis==null?void 0:globalThis.Linking)<"u"&&await globalThis.Linking.openURL(Ne)}catch(Me){console.error(Me)}}function Un$1(W,Y,J){const X=`requestId=${Y}&sessionTopic=${J}`;W.endsWith("/")&&(W=W.slice(0,-1));let Me=`${W}`;if(W.startsWith("https://t.me")){const Se=W.includes("?")?"&startapp=":"?startapp=";Me=`${Me}${Se}${qn$1(X,!0)}`}else Me=`${Me}/wc?${X}`;return Me}async function Ss$2(W,Y){let J="";try{if(gr$1()&&(J=localStorage.getItem(Y),J))return J;J=await W.getItem(Y)}catch(X){console.error(X)}return J}function Is$3(W,Y){if(!W.includes(Y))return null;const J=W.split(/([&,?,=])/),X=J.indexOf(Y);return J[X+2]}function Ns$2(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,W=>{const Y=Math.random()*16|0;return(W==="x"?Y:Y&3|8).toString(16)})}function _s$2(){return typeof process<"u"&&define_process_env_default.IS_VITEST==="true"}function kn$1(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function qn$1(W,Y=!1){const J=Buffer.from(W).toString("base64");return Y?J.replace(/[=]/g,""):J}function xi$1(W){return Buffer.from(W,"base64").toString("utf-8")}var Kn$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function Bs$1(W){var Y=W.default;if(typeof Y=="function"){var J=function(){return Y.apply(this,arguments)};J.prototype=Y.prototype}else J={};return Object.defineProperty(J,"__esModule",{value:!0}),Object.keys(W).forEach(function(X){var Me=Object.getOwnPropertyDescriptor(W,X);Object.defineProperty(J,X,Me.get?Me:{enumerable:!0,get:function(){return W[X]}})}),J}var Hn$1={exports:{}};/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/(function(W){(function(){var Y="input is invalid type",J="finalize already called",X=typeof window=="object",Me=X?window:{};Me.JS_SHA3_NO_WINDOW&&(X=!1);var Se=!X&&typeof self=="object",Ne=!Me.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;Ne?Me=Kn$1:Se&&(Me=self);var je=!Me.JS_SHA3_NO_COMMON_JS&&!0&&W.exports,ke=!Me.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",De="0123456789abcdef".split(""),qe=[31,7936,2031616,520093696],Ue=[4,1024,262144,67108864],Ge=[1,256,65536,16777216],He=[6,1536,393216,100663296],Ve=[0,8,16,24],Ye=[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],Fn=[224,256,384,512],io=[128,256],$o=["hex","buffer","arrayBuffer","array","digest"],Jo={128:168,256:136};(Me.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(ds){return Object.prototype.toString.call(ds)==="[object Array]"}),ke&&(Me.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(ds){return typeof ds=="object"&&ds.buffer&&ds.buffer.constructor===ArrayBuffer});for(var rs=function(ds,fc,ac){return function(lc){return new Ho(ds,fc,ds).update(lc)[ac]()}},Yo=function(ds,fc,ac){return function(lc,uc){return new Ho(ds,fc,uc).update(lc)[ac]()}},zo=function(ds,fc,ac){return function(lc,uc,tc,hc){return Ke["cshake"+ds].update(lc,uc,tc,hc)[ac]()}},jo=function(ds,fc,ac){return function(lc,uc,tc,hc){return Ke["kmac"+ds].update(lc,uc,tc,hc)[ac]()}},Vo=function(ds,fc,ac,lc){for(var uc=0;uc<$o.length;++uc){var tc=$o[uc];ds[tc]=fc(ac,lc,tc)}return ds},os=function(ds,fc){var ac=rs(ds,fc,"hex");return ac.create=function(){return new Ho(ds,fc,ds)},ac.update=function(lc){return ac.create().update(lc)},Vo(ac,rs,ds,fc)},us=function(ds,fc){var ac=Yo(ds,fc,"hex");return ac.create=function(lc){return new Ho(ds,fc,lc)},ac.update=function(lc,uc){return ac.create(uc).update(lc)},Vo(ac,Yo,ds,fc)},is=function(ds,fc){var ac=Jo[ds],lc=zo(ds,fc,"hex");return lc.create=function(uc,tc,hc){return!tc&&!hc?Ke["shake"+ds].create(uc):new Ho(ds,fc,uc).bytepad([tc,hc],ac)},lc.update=function(uc,tc,hc,gc){return lc.create(tc,hc,gc).update(uc)},Vo(lc,zo,ds,fc)},Lo=function(ds,fc){var ac=Jo[ds],lc=jo(ds,fc,"hex");return lc.create=function(uc,tc,hc){return new rc(ds,fc,tc).bytepad(["KMAC",hc],ac).bytepad([uc],ac)},lc.update=function(uc,tc,hc,gc){return lc.create(uc,hc,gc).update(tc)},Vo(lc,jo,ds,fc)},Fe=[{name:"keccak",padding:Ge,bits:Fn,createMethod:os},{name:"sha3",padding:He,bits:Fn,createMethod:os},{name:"shake",padding:qe,bits:io,createMethod:us},{name:"cshake",padding:Ue,bits:io,createMethod:is},{name:"kmac",padding:Ue,bits:io,createMethod:Lo}],Ke={},Je=[],wi=0;wi<Fe.length;++wi)for(var mo=Fe[wi],Go=mo.bits,Qo=0;Qo<Go.length;++Qo){var Ao=mo.name+"_"+Go[Qo];if(Je.push(Ao),Ke[Ao]=mo.createMethod(Go[Qo],mo.padding),mo.name!=="sha3"){var Mn=mo.name+Go[Qo];Je.push(Mn),Ke[Mn]=Ke[Ao]}}function Ho(ds,fc,ac){this.blocks=[],this.s=[],this.padding=fc,this.outputBits=ac,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(ds<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=ac>>5,this.extraBytes=(ac&31)>>3;for(var lc=0;lc<50;++lc)this.s[lc]=0}Ho.prototype.update=function(ds){if(this.finalized)throw new Error(J);var fc,ac=typeof ds;if(ac!=="string"){if(ac==="object"){if(ds===null)throw new Error(Y);if(ke&&ds.constructor===ArrayBuffer)ds=new Uint8Array(ds);else if(!Array.isArray(ds)&&(!ke||!ArrayBuffer.isView(ds)))throw new Error(Y)}else throw new Error(Y);fc=!0}for(var lc=this.blocks,uc=this.byteCount,tc=ds.length,hc=this.blockCount,gc=0,bc=this.s,wc,Cc;gc<tc;){if(this.reset)for(this.reset=!1,lc[0]=this.block,wc=1;wc<hc+1;++wc)lc[wc]=0;if(fc)for(wc=this.start;gc<tc&&wc<uc;++gc)lc[wc>>2]|=ds[gc]<<Ve[wc++&3];else for(wc=this.start;gc<tc&&wc<uc;++gc)Cc=ds.charCodeAt(gc),Cc<128?lc[wc>>2]|=Cc<<Ve[wc++&3]:Cc<2048?(lc[wc>>2]|=(192|Cc>>6)<<Ve[wc++&3],lc[wc>>2]|=(128|Cc&63)<<Ve[wc++&3]):Cc<55296||Cc>=57344?(lc[wc>>2]|=(224|Cc>>12)<<Ve[wc++&3],lc[wc>>2]|=(128|Cc>>6&63)<<Ve[wc++&3],lc[wc>>2]|=(128|Cc&63)<<Ve[wc++&3]):(Cc=65536+((Cc&1023)<<10|ds.charCodeAt(++gc)&1023),lc[wc>>2]|=(240|Cc>>18)<<Ve[wc++&3],lc[wc>>2]|=(128|Cc>>12&63)<<Ve[wc++&3],lc[wc>>2]|=(128|Cc>>6&63)<<Ve[wc++&3],lc[wc>>2]|=(128|Cc&63)<<Ve[wc++&3]);if(this.lastByteIndex=wc,wc>=uc){for(this.start=wc-uc,this.block=lc[hc],wc=0;wc<hc;++wc)bc[wc]^=lc[wc];dc(bc),this.reset=!0}else this.start=wc}return this},Ho.prototype.encode=function(ds,fc){var ac=ds&255,lc=1,uc=[ac];for(ds=ds>>8,ac=ds&255;ac>0;)uc.unshift(ac),ds=ds>>8,ac=ds&255,++lc;return fc?uc.push(lc):uc.unshift(lc),this.update(uc),uc.length},Ho.prototype.encodeString=function(ds){var fc,ac=typeof ds;if(ac!=="string"){if(ac==="object"){if(ds===null)throw new Error(Y);if(ke&&ds.constructor===ArrayBuffer)ds=new Uint8Array(ds);else if(!Array.isArray(ds)&&(!ke||!ArrayBuffer.isView(ds)))throw new Error(Y)}else throw new Error(Y);fc=!0}var lc=0,uc=ds.length;if(fc)lc=uc;else for(var tc=0;tc<ds.length;++tc){var hc=ds.charCodeAt(tc);hc<128?lc+=1:hc<2048?lc+=2:hc<55296||hc>=57344?lc+=3:(hc=65536+((hc&1023)<<10|ds.charCodeAt(++tc)&1023),lc+=4)}return lc+=this.encode(lc*8),this.update(ds),lc},Ho.prototype.bytepad=function(ds,fc){for(var ac=this.encode(fc),lc=0;lc<ds.length;++lc)ac+=this.encodeString(ds[lc]);var uc=fc-ac%fc,tc=[];return tc.length=uc,this.update(tc),this},Ho.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var ds=this.blocks,fc=this.lastByteIndex,ac=this.blockCount,lc=this.s;if(ds[fc>>2]|=this.padding[fc&3],this.lastByteIndex===this.byteCount)for(ds[0]=ds[ac],fc=1;fc<ac+1;++fc)ds[fc]=0;for(ds[ac-1]|=2147483648,fc=0;fc<ac;++fc)lc[fc]^=ds[fc];dc(lc)}},Ho.prototype.toString=Ho.prototype.hex=function(){this.finalize();for(var ds=this.blockCount,fc=this.s,ac=this.outputBlocks,lc=this.extraBytes,uc=0,tc=0,hc="",gc;tc<ac;){for(uc=0;uc<ds&&tc<ac;++uc,++tc)gc=fc[uc],hc+=De[gc>>4&15]+De[gc&15]+De[gc>>12&15]+De[gc>>8&15]+De[gc>>20&15]+De[gc>>16&15]+De[gc>>28&15]+De[gc>>24&15];tc%ds===0&&(dc(fc),uc=0)}return lc&&(gc=fc[uc],hc+=De[gc>>4&15]+De[gc&15],lc>1&&(hc+=De[gc>>12&15]+De[gc>>8&15]),lc>2&&(hc+=De[gc>>20&15]+De[gc>>16&15])),hc},Ho.prototype.arrayBuffer=function(){this.finalize();var ds=this.blockCount,fc=this.s,ac=this.outputBlocks,lc=this.extraBytes,uc=0,tc=0,hc=this.outputBits>>3,gc;lc?gc=new ArrayBuffer(ac+1<<2):gc=new ArrayBuffer(hc);for(var bc=new Uint32Array(gc);tc<ac;){for(uc=0;uc<ds&&tc<ac;++uc,++tc)bc[tc]=fc[uc];tc%ds===0&&dc(fc)}return lc&&(bc[uc]=fc[uc],gc=gc.slice(0,hc)),gc},Ho.prototype.buffer=Ho.prototype.arrayBuffer,Ho.prototype.digest=Ho.prototype.array=function(){this.finalize();for(var ds=this.blockCount,fc=this.s,ac=this.outputBlocks,lc=this.extraBytes,uc=0,tc=0,hc=[],gc,bc;tc<ac;){for(uc=0;uc<ds&&tc<ac;++uc,++tc)gc=tc<<2,bc=fc[uc],hc[gc]=bc&255,hc[gc+1]=bc>>8&255,hc[gc+2]=bc>>16&255,hc[gc+3]=bc>>24&255;tc%ds===0&&dc(fc)}return lc&&(gc=tc<<2,bc=fc[uc],hc[gc]=bc&255,lc>1&&(hc[gc+1]=bc>>8&255),lc>2&&(hc[gc+2]=bc>>16&255)),hc};function rc(ds,fc,ac){Ho.call(this,ds,fc,ac)}rc.prototype=new Ho,rc.prototype.finalize=function(){return this.encode(this.outputBits,!0),Ho.prototype.finalize.call(this)};var dc=function(ds){var fc,ac,lc,uc,tc,hc,gc,bc,wc,Cc,Oc,Tc,Fc,Sc,jc,kc,Lc,zc,Xc,Hc,Jc,pc,ic,oc,yc,Ec,Ic,Mc,Vc,Qc,nl,bu,yu,Rl,bl,vl,Ol,al,il,Cl,hl,ll,El,gl,dl,Sl,fl,pl,_l,cl,tl,Il,yl,Tl,Bl,Al,wl,Hl,yd,pd,gd,$d,nd;for(lc=0;lc<48;lc+=2)uc=ds[0]^ds[10]^ds[20]^ds[30]^ds[40],tc=ds[1]^ds[11]^ds[21]^ds[31]^ds[41],hc=ds[2]^ds[12]^ds[22]^ds[32]^ds[42],gc=ds[3]^ds[13]^ds[23]^ds[33]^ds[43],bc=ds[4]^ds[14]^ds[24]^ds[34]^ds[44],wc=ds[5]^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40]<<18|ds[41]>>>14,El=ds[41]<<18|ds[40]>>>14,Rl=ds[2]<<1|ds[3]>>>31,bl=ds[3]<<1|ds[2]>>>31,kc=ds[13]<<12|ds[12]>>>20,Lc=ds[12]<<12|ds[13]>>>20,pl=ds[22]<<10|ds[23]>>>22,_l=ds[23]<<10|ds[22]>>>22,Qc=ds[33]<<13|ds[32]>>>19,nl=ds[32]<<13|ds[33]>>>19,$d=ds[42]<<2|ds[43]>>>30,nd=ds[43]<<2|ds[42]>>>30,Tl=ds[5]<<30|ds[4]>>>2,Bl=ds[4]<<30|ds[5]>>>2,vl=ds[14]<<6|ds[15]>>>26,Ol=ds[15]<<6|ds[14]>>>26,zc=ds[25]<<11|ds[24]>>>21,Xc=ds[24]<<11|ds[25]>>>21,cl=ds[34]<<15|ds[35]>>>17,tl=ds[35]<<15|ds[34]>>>17,bu=ds[45]<<29|ds[44]>>>3,yu=ds[44]<<29|ds[45]>>>3,oc=ds[6]<<28|ds[7]>>>4,yc=ds[7]<<28|ds[6]>>>4,Al=ds[17]<<23|ds[16]>>>9,wl=ds[16]<<23|ds[17]>>>9,al=ds[26]<<25|ds[27]>>>7,il=ds[27]<<25|ds[26]>>>7,Hc=ds[36]<<21|ds[37]>>>11,Jc=ds[37]<<21|ds[36]>>>11,Il=ds[47]<<24|ds[46]>>>8,yl=ds[46]<<24|ds[47]>>>8,gl=ds[8]<<27|ds[9]>>>5,dl=ds[9]<<27|ds[8]>>>5,Ec=ds[18]<<20|ds[19]>>>12,Ic=ds[19]<<20|ds[18]>>>12,Hl=ds[29]<<7|ds[28]>>>25,yd=ds[28]<<7|ds[29]>>>25,Cl=ds[38]<<8|ds[39]>>>24,hl=ds[39]<<8|ds[38]>>>24,pc=ds[48]<<14|ds[49]>>>18,ic=ds[49]<<14|ds[48]>>>18,ds[0]=Sc^~kc&zc,ds[1]=jc^~Lc&Xc,ds[10]=oc^~Ec&Mc,ds[11]=yc^~Ic&Vc,ds[20]=Rl^~vl&al,ds[21]=bl^~Ol&il,ds[30]=gl^~Sl&pl,ds[31]=dl^~fl&_l,ds[40]=Tl^~Al&Hl,ds[41]=Bl^~wl&yd,ds[2]=kc^~zc&Hc,ds[3]=Lc^~Xc&Jc,ds[12]=Ec^~Mc&Qc,ds[13]=Ic^~Vc&nl,ds[22]=vl^~al&Cl,ds[23]=Ol^~il&hl,ds[32]=Sl^~pl&cl,ds[33]=fl^~_l&tl,ds[42]=Al^~Hl&pd,ds[43]=wl^~yd&gd,ds[4]=zc^~Hc&pc,ds[5]=Xc^~Jc&ic,ds[14]=Mc^~Qc&bu,ds[15]=Vc^~nl&yu,ds[24]=al^~Cl&ll,ds[25]=il^~hl&El,ds[34]=pl^~cl&Il,ds[35]=_l^~tl&yl,ds[44]=Hl^~pd&$d,ds[45]=yd^~gd&nd,ds[6]=Hc^~pc&Sc,ds[7]=Jc^~ic&jc,ds[16]=Qc^~bu&oc,ds[17]=nl^~yu&yc,ds[26]=Cl^~ll&Rl,ds[27]=hl^~El&bl,ds[36]=cl^~Il&gl,ds[37]=tl^~yl&dl,ds[46]=pd^~$d&Tl,ds[47]=gd^~nd&Bl,ds[8]=pc^~Sc&kc,ds[9]=ic^~jc&Lc,ds[18]=bu^~oc&Ec,ds[19]=yu^~yc&Ic,ds[28]=ll^~Rl&vl,ds[29]=El^~bl&Ol,ds[38]=Il^~gl&Sl,ds[39]=yl^~dl&fl,ds[48]=$d^~Tl&Al,ds[49]=nd^~Bl&wl,ds[0]^=Ye[lc],ds[1]^=Ye[lc+1]};if(je)W.exports=Ke;else for(wi=0;wi<Je.length;++wi)Me[Je[wi]]=Ke[Je[wi]]})()})(Hn$1);var Cs$1=Hn$1.exports;const Rs$2="logger/5.7.0";let Ln$1=!1,zn$1=!1;const Tr$2={debug:1,default:2,info:2,warning:3,error:4,off:5};let jn$1=Tr$2.default,Mi$2=null;function Os$1(){try{const W=[];if(["NFD","NFC","NFKD","NFKC"].forEach(Y=>{try{if("test".normalize(Y)!=="test")throw new Error("bad normalize")}catch{W.push(Y)}}),W.length)throw new Error("missing "+W.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(W){return W.message}return null}const Qn=Os$1();var Ei$1;(function(W){W.DEBUG="DEBUG",W.INFO="INFO",W.WARNING="WARNING",W.ERROR="ERROR",W.OFF="OFF"})(Ei$1||(Ei$1={}));var re$1;(function(W){W.UNKNOWN_ERROR="UNKNOWN_ERROR",W.NOT_IMPLEMENTED="NOT_IMPLEMENTED",W.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",W.NETWORK_ERROR="NETWORK_ERROR",W.SERVER_ERROR="SERVER_ERROR",W.TIMEOUT="TIMEOUT",W.BUFFER_OVERRUN="BUFFER_OVERRUN",W.NUMERIC_FAULT="NUMERIC_FAULT",W.MISSING_NEW="MISSING_NEW",W.INVALID_ARGUMENT="INVALID_ARGUMENT",W.MISSING_ARGUMENT="MISSING_ARGUMENT",W.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",W.CALL_EXCEPTION="CALL_EXCEPTION",W.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",W.NONCE_EXPIRED="NONCE_EXPIRED",W.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",W.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",W.TRANSACTION_REPLACED="TRANSACTION_REPLACED",W.ACTION_REJECTED="ACTION_REJECTED"})(re$1||(re$1={}));const Jn="0123456789abcdef";let z$4=class jh{constructor(Y){Object.defineProperty(this,"version",{enumerable:!0,value:Y,writable:!1})}_log(Y,J){const X=Y.toLowerCase();Tr$2[X]==null&&this.throwArgumentError("invalid log level name","logLevel",Y),!(jn$1>Tr$2[X])&&console.log.apply(console,J)}debug(...Y){this._log(jh.levels.DEBUG,Y)}info(...Y){this._log(jh.levels.INFO,Y)}warn(...Y){this._log(jh.levels.WARNING,Y)}makeError(Y,J,X){if(zn$1)return this.makeError("censored error",J,{});J||(J=jh.errors.UNKNOWN_ERROR),X||(X={});const Me=[];Object.keys(X).forEach(ke=>{const De=X[ke];try{if(De instanceof Uint8Array){let qe="";for(let Ue=0;Ue<De.length;Ue++)qe+=Jn[De[Ue]>>4],qe+=Jn[De[Ue]&15];Me.push(ke+"=Uint8Array(0x"+qe+")")}else Me.push(ke+"="+JSON.stringify(De))}catch{Me.push(ke+"="+JSON.stringify(X[ke].toString()))}}),Me.push(`code=${J}`),Me.push(`version=${this.version}`);const Se=Y;let Ne="";switch(J){case re$1.NUMERIC_FAULT:{Ne="NUMERIC_FAULT";const ke=Y;switch(ke){case"overflow":case"underflow":case"division-by-zero":Ne+="-"+ke;break;case"negative-power":case"negative-width":Ne+="-unsupported";break;case"unbound-bitwise-result":Ne+="-unbound-result";break}break}case re$1.CALL_EXCEPTION:case re$1.INSUFFICIENT_FUNDS:case re$1.MISSING_NEW:case re$1.NONCE_EXPIRED:case re$1.REPLACEMENT_UNDERPRICED:case re$1.TRANSACTION_REPLACED:case re$1.UNPREDICTABLE_GAS_LIMIT:Ne=J;break}Ne&&(Y+=" [ See: https://links.ethers.org/v5-errors-"+Ne+" ]"),Me.length&&(Y+=" ("+Me.join(", ")+")");const je=new Error(Y);return je.reason=Se,je.code=J,Object.keys(X).forEach(function(ke){je[ke]=X[ke]}),je}throwError(Y,J,X){throw this.makeError(Y,J,X)}throwArgumentError(Y,J,X){return this.throwError(Y,jh.errors.INVALID_ARGUMENT,{argument:J,value:X})}assert(Y,J,X,Me){Y||this.throwError(J,X,Me)}assertArgument(Y,J,X,Me){Y||this.throwArgumentError(J,X,Me)}checkNormalize(Y){Qn&&this.throwError("platform missing String.prototype.normalize",jh.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Qn})}checkSafeUint53(Y,J){typeof Y=="number"&&(J==null&&(J="value not safe"),(Y<0||Y>=9007199254740991)&&this.throwError(J,jh.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:Y}),Y%1&&this.throwError(J,jh.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:Y}))}checkArgumentCount(Y,J,X){X?X=": "+X:X="",Y<J&&this.throwError("missing argument"+X,jh.errors.MISSING_ARGUMENT,{count:Y,expectedCount:J}),Y>J&&this.throwError("too many arguments"+X,jh.errors.UNEXPECTED_ARGUMENT,{count:Y,expectedCount:J})}checkNew(Y,J){(Y===Object||Y==null)&&this.throwError("missing new",jh.errors.MISSING_NEW,{name:J.name})}checkAbstract(Y,J){Y===J?this.throwError("cannot instantiate abstract class "+JSON.stringify(J.name)+" directly; use a sub-class",jh.errors.UNSUPPORTED_OPERATION,{name:Y.name,operation:"new"}):(Y===Object||Y==null)&&this.throwError("missing new",jh.errors.MISSING_NEW,{name:J.name})}static globalLogger(){return Mi$2||(Mi$2=new jh(Rs$2)),Mi$2}static setCensorship(Y,J){if(!Y&&J&&this.globalLogger().throwError("cannot permanently disable censorship",jh.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Ln$1){if(!Y)return;this.globalLogger().throwError("error censorship permanent",jh.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}zn$1=!!Y,Ln$1=!!J}static setLogLevel(Y){const J=Tr$2[Y.toLowerCase()];if(J==null){jh.globalLogger().warn("invalid log level - "+Y);return}jn$1=J}static from(Y){return new jh(Y)}};z$4.errors=re$1,z$4.levels=Ei$1;const Ps$2="bytes/5.7.0",Tt$3=new z$4(Ps$2);function Gn$1(W){return!!W.toHexString}function ir$2(W){return W.slice||(W.slice=function(){const Y=Array.prototype.slice.call(arguments);return ir$2(new Uint8Array(Array.prototype.slice.apply(W,Y)))}),W}function Ts$2(W){return Jt$2(W)&&!(W.length%2)||nr$2(W)}function Yn$1(W){return typeof W=="number"&&W==W&&W%1===0}function nr$2(W){if(W==null)return!1;if(W.constructor===Uint8Array)return!0;if(typeof W=="string"||!Yn$1(W.length)||W.length<0)return!1;for(let Y=0;Y<W.length;Y++){const J=W[Y];if(!Yn$1(J)||J<0||J>=256)return!1}return!0}function Ot$2(W,Y){if(Y||(Y={}),typeof W=="number"){Tt$3.checkSafeUint53(W,"invalid arrayify value");const J=[];for(;W;)J.unshift(W&255),W=parseInt(String(W/256));return J.length===0&&J.push(0),ir$2(new Uint8Array(J))}if(Y.allowMissingPrefix&&typeof W=="string"&&W.substring(0,2)!=="0x"&&(W="0x"+W),Gn$1(W)&&(W=W.toHexString()),Jt$2(W)){let J=W.substring(2);J.length%2&&(Y.hexPad==="left"?J="0"+J:Y.hexPad==="right"?J+="0":Tt$3.throwArgumentError("hex data is odd-length","value",W));const X=[];for(let Me=0;Me<J.length;Me+=2)X.push(parseInt(J.substring(Me,Me+2),16));return ir$2(new Uint8Array(X))}return nr$2(W)?ir$2(new Uint8Array(W)):Tt$3.throwArgumentError("invalid arrayify value","value",W)}function Ds$1(W){const Y=W.map(Me=>Ot$2(Me)),J=Y.reduce((Me,Se)=>Me+Se.length,0),X=new Uint8Array(J);return Y.reduce((Me,Se)=>(X.set(Se,Me),Me+Se.length),0),ir$2(X)}function Fs$2(W,Y){W=Ot$2(W),W.length>Y&&Tt$3.throwArgumentError("value out of range","value",arguments[0]);const J=new Uint8Array(Y);return J.set(W,Y-W.length),ir$2(J)}function Jt$2(W,Y){return!(typeof W!="string"||!W.match(/^0x[0-9A-Fa-f]*$/)||Y&&W.length!==2+2*Y)}const Si="0123456789abcdef";function Kt$2(W,Y){if(Y||(Y={}),typeof W=="number"){Tt$3.checkSafeUint53(W,"invalid hexlify value");let J="";for(;W;)J=Si[W&15]+J,W=Math.floor(W/16);return J.length?(J.length%2&&(J="0"+J),"0x"+J):"0x00"}if(typeof W=="bigint")return W=W.toString(16),W.length%2?"0x0"+W:"0x"+W;if(Y.allowMissingPrefix&&typeof W=="string"&&W.substring(0,2)!=="0x"&&(W="0x"+W),Gn$1(W))return W.toHexString();if(Jt$2(W))return W.length%2&&(Y.hexPad==="left"?W="0x0"+W.substring(2):Y.hexPad==="right"?W+="0":Tt$3.throwArgumentError("hex data is odd-length","value",W)),W.toLowerCase();if(nr$2(W)){let J="0x";for(let X=0;X<W.length;X++){let Me=W[X];J+=Si[(Me&240)>>4]+Si[Me&15]}return J}return Tt$3.throwArgumentError("invalid hexlify value","value",W)}function Us$1(W){if(typeof W!="string")W=Kt$2(W);else if(!Jt$2(W)||W.length%2)return null;return(W.length-2)/2}function Vn$1(W,Y,J){return typeof W!="string"?W=Kt$2(W):(!Jt$2(W)||W.length%2)&&Tt$3.throwArgumentError("invalid hexData","value",W),Y=2+2*Y,J!=null?"0x"+W.substring(Y,2+2*J):"0x"+W.substring(Y)}function oe$3(W,Y){for(typeof W!="string"?W=Kt$2(W):Jt$2(W)||Tt$3.throwArgumentError("invalid hex string","value",W),W.length>2*Y+2&&Tt$3.throwArgumentError("value out of range","value",arguments[1]);W.length<2*Y+2;)W="0x0"+W.substring(2);return W}function Wn$1(W){const Y={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Ts$2(W)){let J=Ot$2(W);J.length===64?(Y.v=27+(J[32]>>7),J[32]&=127,Y.r=Kt$2(J.slice(0,32)),Y.s=Kt$2(J.slice(32,64))):J.length===65?(Y.r=Kt$2(J.slice(0,32)),Y.s=Kt$2(J.slice(32,64)),Y.v=J[64]):Tt$3.throwArgumentError("invalid signature string","signature",W),Y.v<27&&(Y.v===0||Y.v===1?Y.v+=27:Tt$3.throwArgumentError("signature invalid v byte","signature",W)),Y.recoveryParam=1-Y.v%2,Y.recoveryParam&&(J[32]|=128),Y._vs=Kt$2(J.slice(32,64))}else{if(Y.r=W.r,Y.s=W.s,Y.v=W.v,Y.recoveryParam=W.recoveryParam,Y._vs=W._vs,Y._vs!=null){const Me=Fs$2(Ot$2(Y._vs),32);Y._vs=Kt$2(Me);const Se=Me[0]>=128?1:0;Y.recoveryParam==null?Y.recoveryParam=Se:Y.recoveryParam!==Se&&Tt$3.throwArgumentError("signature recoveryParam mismatch _vs","signature",W),Me[0]&=127;const Ne=Kt$2(Me);Y.s==null?Y.s=Ne:Y.s!==Ne&&Tt$3.throwArgumentError("signature v mismatch _vs","signature",W)}if(Y.recoveryParam==null)Y.v==null?Tt$3.throwArgumentError("signature missing v and recoveryParam","signature",W):Y.v===0||Y.v===1?Y.recoveryParam=Y.v:Y.recoveryParam=1-Y.v%2;else if(Y.v==null)Y.v=27+Y.recoveryParam;else{const Me=Y.v===0||Y.v===1?Y.v:1-Y.v%2;Y.recoveryParam!==Me&&Tt$3.throwArgumentError("signature recoveryParam mismatch v","signature",W)}Y.r==null||!Jt$2(Y.r)?Tt$3.throwArgumentError("signature missing or invalid r","signature",W):Y.r=oe$3(Y.r,32),Y.s==null||!Jt$2(Y.s)?Tt$3.throwArgumentError("signature missing or invalid s","signature",W):Y.s=oe$3(Y.s,32);const J=Ot$2(Y.s);J[0]>=128&&Tt$3.throwArgumentError("signature s out of range","signature",W),Y.recoveryParam&&(J[0]|=128);const X=Kt$2(J);Y._vs&&(Jt$2(Y._vs)||Tt$3.throwArgumentError("signature invalid _vs","signature",W),Y._vs=oe$3(Y._vs,32)),Y._vs==null?Y._vs=X:Y._vs!==X&&Tt$3.throwArgumentError("signature _vs mismatch v and s","signature",W)}return Y.yParityAndS=Y._vs,Y.compact=Y.r+Y.yParityAndS.substring(2),Y}function Ii$1(W){return"0x"+Cs$1.keccak_256(Ot$2(W))}var Xn$1={exports:{}},ks$2={},qs$2=Object.freeze({__proto__:null,default:ks$2}),Ks$1=Bs$1(qs$2);(function(W){(function(Y,J){function X(Fe,Ke){if(!Fe)throw new Error(Ke||"Assertion failed")}function Me(Fe,Ke){Fe.super_=Ke;var Je=function(){};Je.prototype=Ke.prototype,Fe.prototype=new Je,Fe.prototype.constructor=Fe}function Se(Fe,Ke,Je){if(Se.isBN(Fe))return Fe;this.negative=0,this.words=null,this.length=0,this.red=null,Fe!==null&&((Ke==="le"||Ke==="be")&&(Je=Ke,Ke=10),this._init(Fe||0,Ke||10,Je||"be"))}typeof Y=="object"?Y.exports=Se:J.BN=Se,Se.BN=Se,Se.wordSize=26;var Ne;try{typeof window<"u"&&typeof window.Buffer<"u"?Ne=window.Buffer:Ne=Ks$1.Buffer}catch{}Se.isBN=function(Fe){return Fe instanceof Se?!0:Fe!==null&&typeof Fe=="object"&&Fe.constructor.wordSize===Se.wordSize&&Array.isArray(Fe.words)},Se.max=function(Fe,Ke){return Fe.cmp(Ke)>0?Fe:Ke},Se.min=function(Fe,Ke){return Fe.cmp(Ke)<0?Fe:Ke},Se.prototype._init=function(Fe,Ke,Je){if(typeof Fe=="number")return this._initNumber(Fe,Ke,Je);if(typeof Fe=="object")return this._initArray(Fe,Ke,Je);Ke==="hex"&&(Ke=16),X(Ke===(Ke|0)&&Ke>=2&&Ke<=36),Fe=Fe.toString().replace(/\s+/g,"");var wi=0;Fe[0]==="-"&&(wi++,this.negative=1),wi<Fe.length&&(Ke===16?this._parseHex(Fe,wi,Je):(this._parseBase(Fe,Ke,wi),Je==="le"&&this._initArray(this.toArray(),Ke,Je)))},Se.prototype._initNumber=function(Fe,Ke,Je){Fe<0&&(this.negative=1,Fe=-Fe),Fe<67108864?(this.words=[Fe&67108863],this.length=1):Fe<4503599627370496?(this.words=[Fe&67108863,Fe/67108864&67108863],this.length=2):(X(Fe<9007199254740992),this.words=[Fe&67108863,Fe/67108864&67108863,1],this.length=3),Je==="le"&&this._initArray(this.toArray(),Ke,Je)},Se.prototype._initArray=function(Fe,Ke,Je){if(X(typeof Fe.length=="number"),Fe.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Fe.length/3),this.words=new Array(this.length);for(var wi=0;wi<this.length;wi++)this.words[wi]=0;var mo,Go,Qo=0;if(Je==="be")for(wi=Fe.length-1,mo=0;wi>=0;wi-=3)Go=Fe[wi]|Fe[wi-1]<<8|Fe[wi-2]<<16,this.words[mo]|=Go<<Qo&67108863,this.words[mo+1]=Go>>>26-Qo&67108863,Qo+=24,Qo>=26&&(Qo-=26,mo++);else if(Je==="le")for(wi=0,mo=0;wi<Fe.length;wi+=3)Go=Fe[wi]|Fe[wi+1]<<8|Fe[wi+2]<<16,this.words[mo]|=Go<<Qo&67108863,this.words[mo+1]=Go>>>26-Qo&67108863,Qo+=24,Qo>=26&&(Qo-=26,mo++);return this._strip()};function je(Fe,Ke){var Je=Fe.charCodeAt(Ke);if(Je>=48&&Je<=57)return Je-48;if(Je>=65&&Je<=70)return Je-55;if(Je>=97&&Je<=102)return Je-87;X(!1,"Invalid character in "+Fe)}function ke(Fe,Ke,Je){var wi=je(Fe,Je);return Je-1>=Ke&&(wi|=je(Fe,Je-1)<<4),wi}Se.prototype._parseHex=function(Fe,Ke,Je){this.length=Math.ceil((Fe.length-Ke)/6),this.words=new Array(this.length);for(var wi=0;wi<this.length;wi++)this.words[wi]=0;var mo=0,Go=0,Qo;if(Je==="be")for(wi=Fe.length-1;wi>=Ke;wi-=2)Qo=ke(Fe,Ke,wi)<<mo,this.words[Go]|=Qo&67108863,mo>=18?(mo-=18,Go+=1,this.words[Go]|=Qo>>>26):mo+=8;else{var Ao=Fe.length-Ke;for(wi=Ao%2===0?Ke+1:Ke;wi<Fe.length;wi+=2)Qo=ke(Fe,Ke,wi)<<mo,this.words[Go]|=Qo&67108863,mo>=18?(mo-=18,Go+=1,this.words[Go]|=Qo>>>26):mo+=8}this._strip()};function De(Fe,Ke,Je,wi){for(var mo=0,Go=0,Qo=Math.min(Fe.length,Je),Ao=Ke;Ao<Qo;Ao++){var Mn=Fe.charCodeAt(Ao)-48;mo*=wi,Mn>=49?Go=Mn-49+10:Mn>=17?Go=Mn-17+10:Go=Mn,X(Mn>=0&&Go<wi,"Invalid character"),mo+=Go}return mo}Se.prototype._parseBase=function(Fe,Ke,Je){this.words=[0],this.length=1;for(var wi=0,mo=1;mo<=67108863;mo*=Ke)wi++;wi--,mo=mo/Ke|0;for(var Go=Fe.length-Je,Qo=Go%wi,Ao=Math.min(Go,Go-Qo)+Je,Mn=0,Ho=Je;Ho<Ao;Ho+=wi)Mn=De(Fe,Ho,Ho+wi,Ke),this.imuln(mo),this.words[0]+Mn<67108864?this.words[0]+=Mn:this._iaddn(Mn);if(Qo!==0){var rc=1;for(Mn=De(Fe,Ho,Fe.length,Ke),Ho=0;Ho<Qo;Ho++)rc*=Ke;this.imuln(rc),this.words[0]+Mn<67108864?this.words[0]+=Mn:this._iaddn(Mn)}this._strip()},Se.prototype.copy=function(Fe){Fe.words=new Array(this.length);for(var Ke=0;Ke<this.length;Ke++)Fe.words[Ke]=this.words[Ke];Fe.length=this.length,Fe.negative=this.negative,Fe.red=this.red};function qe(Fe,Ke){Fe.words=Ke.words,Fe.length=Ke.length,Fe.negative=Ke.negative,Fe.red=Ke.red}if(Se.prototype._move=function(Fe){qe(Fe,this)},Se.prototype.clone=function(){var Fe=new Se(null);return this.copy(Fe),Fe},Se.prototype._expand=function(Fe){for(;this.length<Fe;)this.words[this.length++]=0;return this},Se.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},Se.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{Se.prototype[Symbol.for("nodejs.util.inspect.custom")]=Ue}catch{Se.prototype.inspect=Ue}else Se.prototype.inspect=Ue;function Ue(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var Ge=["","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"],He=[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],Ve=[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];Se.prototype.toString=function(Fe,Ke){Fe=Fe||10,Ke=Ke|0||1;var Je;if(Fe===16||Fe==="hex"){Je="";for(var wi=0,mo=0,Go=0;Go<this.length;Go++){var Qo=this.words[Go],Ao=((Qo<<wi|mo)&16777215).toString(16);mo=Qo>>>24-wi&16777215,wi+=2,wi>=26&&(wi-=26,Go--),mo!==0||Go!==this.length-1?Je=Ge[6-Ao.length]+Ao+Je:Je=Ao+Je}for(mo!==0&&(Je=mo.toString(16)+Je);Je.length%Ke!==0;)Je="0"+Je;return this.negative!==0&&(Je="-"+Je),Je}if(Fe===(Fe|0)&&Fe>=2&&Fe<=36){var Mn=He[Fe],Ho=Ve[Fe];Je="";var rc=this.clone();for(rc.negative=0;!rc.isZero();){var dc=rc.modrn(Ho).toString(Fe);rc=rc.idivn(Ho),rc.isZero()?Je=dc+Je:Je=Ge[Mn-dc.length]+dc+Je}for(this.isZero()&&(Je="0"+Je);Je.length%Ke!==0;)Je="0"+Je;return this.negative!==0&&(Je="-"+Je),Je}X(!1,"Base should be between 2 and 36")},Se.prototype.toNumber=function(){var Fe=this.words[0];return this.length===2?Fe+=this.words[1]*67108864:this.length===3&&this.words[2]===1?Fe+=4503599627370496+this.words[1]*67108864:this.length>2&&X(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-Fe:Fe},Se.prototype.toJSON=function(){return this.toString(16,2)},Ne&&(Se.prototype.toBuffer=function(Fe,Ke){return this.toArrayLike(Ne,Fe,Ke)}),Se.prototype.toArray=function(Fe,Ke){return this.toArrayLike(Array,Fe,Ke)};var Ye=function(Fe,Ke){return Fe.allocUnsafe?Fe.allocUnsafe(Ke):new Fe(Ke)};Se.prototype.toArrayLike=function(Fe,Ke,Je){this._strip();var wi=this.byteLength(),mo=Je||Math.max(1,wi);X(wi<=mo,"byte array longer than desired length"),X(mo>0,"Requested array length <= 0");var Go=Ye(Fe,mo),Qo=Ke==="le"?"LE":"BE";return this["_toArrayLike"+Qo](Go,wi),Go},Se.prototype._toArrayLikeLE=function(Fe,Ke){for(var Je=0,wi=0,mo=0,Go=0;mo<this.length;mo++){var Qo=this.words[mo]<<Go|wi;Fe[Je++]=Qo&255,Je<Fe.length&&(Fe[Je++]=Qo>>8&255),Je<Fe.length&&(Fe[Je++]=Qo>>16&255),Go===6?(Je<Fe.length&&(Fe[Je++]=Qo>>24&255),wi=0,Go=0):(wi=Qo>>>24,Go+=2)}if(Je<Fe.length)for(Fe[Je++]=wi;Je<Fe.length;)Fe[Je++]=0},Se.prototype._toArrayLikeBE=function(Fe,Ke){for(var Je=Fe.length-1,wi=0,mo=0,Go=0;mo<this.length;mo++){var Qo=this.words[mo]<<Go|wi;Fe[Je--]=Qo&255,Je>=0&&(Fe[Je--]=Qo>>8&255),Je>=0&&(Fe[Je--]=Qo>>16&255),Go===6?(Je>=0&&(Fe[Je--]=Qo>>24&255),wi=0,Go=0):(wi=Qo>>>24,Go+=2)}if(Je>=0)for(Fe[Je--]=wi;Je>=0;)Fe[Je--]=0},Math.clz32?Se.prototype._countBits=function(Fe){return 32-Math.clz32(Fe)}:Se.prototype._countBits=function(Fe){var Ke=Fe,Je=0;return Ke>=4096&&(Je+=13,Ke>>>=13),Ke>=64&&(Je+=7,Ke>>>=7),Ke>=8&&(Je+=4,Ke>>>=4),Ke>=2&&(Je+=2,Ke>>>=2),Je+Ke},Se.prototype._zeroBits=function(Fe){if(Fe===0)return 26;var Ke=Fe,Je=0;return Ke&8191||(Je+=13,Ke>>>=13),Ke&127||(Je+=7,Ke>>>=7),Ke&15||(Je+=4,Ke>>>=4),Ke&3||(Je+=2,Ke>>>=2),Ke&1||Je++,Je},Se.prototype.bitLength=function(){var Fe=this.words[this.length-1],Ke=this._countBits(Fe);return(this.length-1)*26+Ke};function Fn(Fe){for(var Ke=new Array(Fe.bitLength()),Je=0;Je<Ke.length;Je++){var wi=Je/26|0,mo=Je%26;Ke[Je]=Fe.words[wi]>>>mo&1}return Ke}Se.prototype.zeroBits=function(){if(this.isZero())return 0;for(var Fe=0,Ke=0;Ke<this.length;Ke++){var Je=this._zeroBits(this.words[Ke]);if(Fe+=Je,Je!==26)break}return Fe},Se.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Se.prototype.toTwos=function(Fe){return this.negative!==0?this.abs().inotn(Fe).iaddn(1):this.clone()},Se.prototype.fromTwos=function(Fe){return this.testn(Fe-1)?this.notn(Fe).iaddn(1).ineg():this.clone()},Se.prototype.isNeg=function(){return this.negative!==0},Se.prototype.neg=function(){return this.clone().ineg()},Se.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},Se.prototype.iuor=function(Fe){for(;this.length<Fe.length;)this.words[this.length++]=0;for(var Ke=0;Ke<Fe.length;Ke++)this.words[Ke]=this.words[Ke]|Fe.words[Ke];return this._strip()},Se.prototype.ior=function(Fe){return X((this.negative|Fe.negative)===0),this.iuor(Fe)},Se.prototype.or=function(Fe){return this.length>Fe.length?this.clone().ior(Fe):Fe.clone().ior(this)},Se.prototype.uor=function(Fe){return this.length>Fe.length?this.clone().iuor(Fe):Fe.clone().iuor(this)},Se.prototype.iuand=function(Fe){var Ke;this.length>Fe.length?Ke=Fe:Ke=this;for(var Je=0;Je<Ke.length;Je++)this.words[Je]=this.words[Je]&Fe.words[Je];return this.length=Ke.length,this._strip()},Se.prototype.iand=function(Fe){return X((this.negative|Fe.negative)===0),this.iuand(Fe)},Se.prototype.and=function(Fe){return this.length>Fe.length?this.clone().iand(Fe):Fe.clone().iand(this)},Se.prototype.uand=function(Fe){return this.length>Fe.length?this.clone().iuand(Fe):Fe.clone().iuand(this)},Se.prototype.iuxor=function(Fe){var Ke,Je;this.length>Fe.length?(Ke=this,Je=Fe):(Ke=Fe,Je=this);for(var wi=0;wi<Je.length;wi++)this.words[wi]=Ke.words[wi]^Je.words[wi];if(this!==Ke)for(;wi<Ke.length;wi++)this.words[wi]=Ke.words[wi];return this.length=Ke.length,this._strip()},Se.prototype.ixor=function(Fe){return X((this.negative|Fe.negative)===0),this.iuxor(Fe)},Se.prototype.xor=function(Fe){return this.length>Fe.length?this.clone().ixor(Fe):Fe.clone().ixor(this)},Se.prototype.uxor=function(Fe){return this.length>Fe.length?this.clone().iuxor(Fe):Fe.clone().iuxor(this)},Se.prototype.inotn=function(Fe){X(typeof Fe=="number"&&Fe>=0);var Ke=Math.ceil(Fe/26)|0,Je=Fe%26;this._expand(Ke),Je>0&&Ke--;for(var wi=0;wi<Ke;wi++)this.words[wi]=~this.words[wi]&67108863;return Je>0&&(this.words[wi]=~this.words[wi]&67108863>>26-Je),this._strip()},Se.prototype.notn=function(Fe){return this.clone().inotn(Fe)},Se.prototype.setn=function(Fe,Ke){X(typeof Fe=="number"&&Fe>=0);var Je=Fe/26|0,wi=Fe%26;return this._expand(Je+1),Ke?this.words[Je]=this.words[Je]|1<<wi:this.words[Je]=this.words[Je]&~(1<<wi),this._strip()},Se.prototype.iadd=function(Fe){var Ke;if(this.negative!==0&&Fe.negative===0)return this.negative=0,Ke=this.isub(Fe),this.negative^=1,this._normSign();if(this.negative===0&&Fe.negative!==0)return Fe.negative=0,Ke=this.isub(Fe),Fe.negative=1,Ke._normSign();var Je,wi;this.length>Fe.length?(Je=this,wi=Fe):(Je=Fe,wi=this);for(var mo=0,Go=0;Go<wi.length;Go++)Ke=(Je.words[Go]|0)+(wi.words[Go]|0)+mo,this.words[Go]=Ke&67108863,mo=Ke>>>26;for(;mo!==0&&Go<Je.length;Go++)Ke=(Je.words[Go]|0)+mo,this.words[Go]=Ke&67108863,mo=Ke>>>26;if(this.length=Je.length,mo!==0)this.words[this.length]=mo,this.length++;else if(Je!==this)for(;Go<Je.length;Go++)this.words[Go]=Je.words[Go];return this},Se.prototype.add=function(Fe){var Ke;return Fe.negative!==0&&this.negative===0?(Fe.negative=0,Ke=this.sub(Fe),Fe.negative^=1,Ke):Fe.negative===0&&this.negative!==0?(this.negative=0,Ke=Fe.sub(this),this.negative=1,Ke):this.length>Fe.length?this.clone().iadd(Fe):Fe.clone().iadd(this)},Se.prototype.isub=function(Fe){if(Fe.negative!==0){Fe.negative=0;var Ke=this.iadd(Fe);return Fe.negative=1,Ke._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Fe),this.negative=1,this._normSign();var Je=this.cmp(Fe);if(Je===0)return this.negative=0,this.length=1,this.words[0]=0,this;var wi,mo;Je>0?(wi=this,mo=Fe):(wi=Fe,mo=this);for(var Go=0,Qo=0;Qo<mo.length;Qo++)Ke=(wi.words[Qo]|0)-(mo.words[Qo]|0)+Go,Go=Ke>>26,this.words[Qo]=Ke&67108863;for(;Go!==0&&Qo<wi.length;Qo++)Ke=(wi.words[Qo]|0)+Go,Go=Ke>>26,this.words[Qo]=Ke&67108863;if(Go===0&&Qo<wi.length&&wi!==this)for(;Qo<wi.length;Qo++)this.words[Qo]=wi.words[Qo];return this.length=Math.max(this.length,Qo),wi!==this&&(this.negative=1),this._strip()},Se.prototype.sub=function(Fe){return this.clone().isub(Fe)};function io(Fe,Ke,Je){Je.negative=Ke.negative^Fe.negative;var wi=Fe.length+Ke.length|0;Je.length=wi,wi=wi-1|0;var mo=Fe.words[0]|0,Go=Ke.words[0]|0,Qo=mo*Go,Ao=Qo&67108863,Mn=Qo/67108864|0;Je.words[0]=Ao;for(var Ho=1;Ho<wi;Ho++){for(var rc=Mn>>>26,dc=Mn&67108863,ds=Math.min(Ho,Ke.length-1),fc=Math.max(0,Ho-Fe.length+1);fc<=ds;fc++){var ac=Ho-fc|0;mo=Fe.words[ac]|0,Go=Ke.words[fc]|0,Qo=mo*Go+dc,rc+=Qo/67108864|0,dc=Qo&67108863}Je.words[Ho]=dc|0,Mn=rc|0}return Mn!==0?Je.words[Ho]=Mn|0:Je.length--,Je._strip()}var $o=function(Fe,Ke,Je){var wi=Fe.words,mo=Ke.words,Go=Je.words,Qo=0,Ao,Mn,Ho,rc=wi[0]|0,dc=rc&8191,ds=rc>>>13,fc=wi[1]|0,ac=fc&8191,lc=fc>>>13,uc=wi[2]|0,tc=uc&8191,hc=uc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ho=Math.imul(hc,Qc),Ao=Ao+Math.imul(ac,bu)|0,Mn=Mn+Math.imul(ac,yu)|0,Mn=Mn+Math.imul(lc,bu)|0,Ho=Ho+Math.imul(lc,yu)|0,Ao=Ao+Math.imul(dc,bl)|0,Mn=Mn+Math.imul(dc,vl)|0,Mn=Mn+Math.imul(ds,bl)|0,Ho=Ho+Math.imul(ds,vl)|0;var pd=(Qo+Ao|0)+((Mn&8191)<<13)|0;Qo=(Ho+(Mn>>>13)|0)+(pd>>>26)|0,pd&=67108863,Ao=Math.imul(bc,Vc),Mn=Math.imul(bc,Qc),Mn=Mn+Math.imul(wc,Vc)|0,Ho=Math.imul(wc,Qc),Ao=Ao+Math.imul(tc,bu)|0,Mn=Mn+Math.imul(tc,yu)|0,Mn=Mn+Math.imul(hc,bu)|0,Ho=Ho+Math.imul(hc,yu)|0,Ao=Ao+Math.imul(ac,bl)|0,Mn=Mn+Math.imul(ac,vl)|0,Mn=Mn+Math.imul(lc,bl)|0,Ho=Ho+Math.imul(lc,vl)|0,Ao=Ao+Math.imul(dc,al)|0,Mn=Mn+Math.imul(dc,il)|0,Mn=Mn+Math.imul(ds,al)|0,Ho=Ho+Math.imul(ds,il)|0;var gd=(Qo+Ao|0)+((Mn&8191)<<13)|0;Qo=(Ho+(Mn>>>13)|0)+(gd>>>26)|0,gd&=67108863,Ao=Math.imul(Oc,Vc),Mn=Math.imul(Oc,Qc),Mn=Mn+Math.imul(Tc,Vc)|0,Ho=Math.imul(Tc,Qc),Ao=Ao+Math.imul(bc,bu)|0,Mn=Mn+Math.imul(bc,yu)|0,Mn=Mn+Math.imul(wc,bu)|0,Ho=Ho+Math.imul(wc,yu)|0,Ao=Ao+Math.imul(tc,bl)|0,Mn=Mn+Math.imul(tc,vl)|0,Mn=Mn+Math.imul(hc,bl)|0,Ho=Ho+Math.imul(hc,vl)|0,Ao=Ao+Math.imul(ac,al)|0,Mn=Mn+Math.imul(ac,il)|0,Mn=Mn+Math.imul(lc,al)|0,Ho=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ul(Ec,tl),Mn=Mn+Math.imul(Ic,cl)|0,Ho=Math.imul(Ic,tl),Ao=Ao+Math.imul(ic,yl)|0,Mn=Mn+Math.imul(ic,Tl)|0,Mn=Mn+Math.imul(oc,yl)|0,Ho=Ho+Math.imul(oc,Tl)|0,Ao=Ao+Math.imul(Hc,Al)|0,Mn=Mn+Math.imul(Hc,wl)|0,Mn=Mn+Math.imul(Jc,Al)|0,Ho=Ho+Math.imul(Jc,wl)|0;var wd=(Qo+Ao|0)+((Mn&8191)<<13)|0;Qo=(Ho+(Mn>>>13)|0)+(wd>>>26)|0,wd&=67108863,Ao=Math.imul(Ec,yl),Mn=Math.imul(Ec,Tl),Mn=Mn+Math.imul(Ic,yl)|0,Ho=Math.imul(Ic,Tl),Ao=Ao+Math.imul(ic,Al)|0,Mn=Mn+Math.imul(ic,wl)|0,Mn=Mn+Math.imul(oc,Al)|0,Ho=Ho+Math.imul(oc,wl)|0;var Xf=(Qo+Ao|0)+((Mn&8191)<<13)|0;Qo=(Ho+(Mn>>>13)|0)+(Xf>>>26)|0,Xf&=67108863,Ao=Math.imul(Ec,Al),Mn=Math.imul(Ec,wl),Mn=Mn+Math.imul(Ic,Al)|0,Ho=Math.imul(Ic,wl);var Td=(Qo+Ao|0)+((Mn&8191)<<13)|0;return Qo=(Ho+(Mn>>>13)|0)+(Td>>>26)|0,Td&=67108863,Go[0]=Hl,Go[1]=yd,Go[2]=pd,Go[3]=gd,Go[4]=$d,Go[5]=nd,Go[6]=Ud,Go[7]=$f,Go[8]=Zl,Go[9]=Zf,Go[10]=zd,Go[11]=jd,Go[12]=kd,Go[13]=Yd,Go[14]=bd,Go[15]=Fd,Go[16]=wd,Go[17]=Xf,Go[18]=Td,Qo!==0&&(Go[19]=Qo,Je.length++),Je};Math.imul||($o=io);function Jo(Fe,Ke,Je){Je.negative=Ke.negative^Fe.negative,Je.length=Fe.length+Ke.length;for(var wi=0,mo=0,Go=0;Go<Je.length-1;Go++){var Qo=mo;mo=0;for(var Ao=wi&67108863,Mn=Math.min(Go,Ke.length-1),Ho=Math.max(0,Go-Fe.length+1);Ho<=Mn;Ho++){var rc=Go-Ho,dc=Fe.words[rc]|0,ds=Ke.words[Ho]|0,fc=dc*ds,ac=fc&67108863;Qo=Qo+(fc/67108864|0)|0,ac=ac+Ao|0,Ao=ac&67108863,Qo=Qo+(ac>>>26)|0,mo+=Qo>>>26,Qo&=67108863}Je.words[Go]=Ao,wi=Qo,Qo=mo}return wi!==0?Je.words[Go]=wi:Je.length--,Je._strip()}function rs(Fe,Ke,Je){return Jo(Fe,Ke,Je)}Se.prototype.mulTo=function(Fe,Ke){var Je,wi=this.length+Fe.length;return this.length===10&&Fe.length===10?Je=$o(this,Fe,Ke):wi<63?Je=io(this,Fe,Ke):wi<1024?Je=Jo(this,Fe,Ke):Je=rs(this,Fe,Ke),Je},Se.prototype.mul=function(Fe){var Ke=new Se(null);return Ke.words=new Array(this.length+Fe.length),this.mulTo(Fe,Ke)},Se.prototype.mulf=function(Fe){var Ke=new Se(null);return Ke.words=new Array(this.length+Fe.length),rs(this,Fe,Ke)},Se.prototype.imul=function(Fe){return this.clone().mulTo(Fe,this)},Se.prototype.imuln=function(Fe){var Ke=Fe<0;Ke&&(Fe=-Fe),X(typeof Fe=="number"),X(Fe<67108864);for(var Je=0,wi=0;wi<this.length;wi++){var mo=(this.words[wi]|0)*Fe,Go=(mo&67108863)+(Je&67108863);Je>>=26,Je+=mo/67108864|0,Je+=Go>>>26,this.words[wi]=Go&67108863}return Je!==0&&(this.words[wi]=Je,this.length++),Ke?this.ineg():this},Se.prototype.muln=function(Fe){return this.clone().imuln(Fe)},Se.prototype.sqr=function(){return this.mul(this)},Se.prototype.isqr=function(){return this.imul(this.clone())},Se.prototype.pow=function(Fe){var Ke=Fn(Fe);if(Ke.length===0)return new Se(1);for(var Je=this,wi=0;wi<Ke.length&&Ke[wi]===0;wi++,Je=Je.sqr());if(++wi<Ke.length)for(var mo=Je.sqr();wi<Ke.length;wi++,mo=mo.sqr())Ke[wi]!==0&&(Je=Je.mul(mo));return Je},Se.prototype.iushln=function(Fe){X(typeof Fe=="number"&&Fe>=0);var Ke=Fe%26,Je=(Fe-Ke)/26,wi=67108863>>>26-Ke<<26-Ke,mo;if(Ke!==0){var Go=0;for(mo=0;mo<this.length;mo++){var Qo=this.words[mo]&wi,Ao=(this.words[mo]|0)-Qo<<Ke;this.words[mo]=Ao|Go,Go=Qo>>>26-Ke}Go&&(this.words[mo]=Go,this.length++)}if(Je!==0){for(mo=this.length-1;mo>=0;mo--)this.words[mo+Je]=this.words[mo];for(mo=0;mo<Je;mo++)this.words[mo]=0;this.length+=Je}return this._strip()},Se.prototype.ishln=function(Fe){return X(this.negative===0),this.iushln(Fe)},Se.prototype.iushrn=function(Fe,Ke,Je){X(typeof Fe=="number"&&Fe>=0);var wi;Ke?wi=(Ke-Ke%26)/26:wi=0;var mo=Fe%26,Go=Math.min((Fe-mo)/26,this.length),Qo=67108863^67108863>>>mo<<mo,Ao=Je;if(wi-=Go,wi=Math.max(0,wi),Ao){for(var Mn=0;Mn<Go;Mn++)Ao.words[Mn]=this.words[Mn];Ao.length=Go}if(Go!==0)if(this.length>Go)for(this.length-=Go,Mn=0;Mn<this.length;Mn++)this.words[Mn]=this.words[Mn+Go];else this.words[0]=0,this.length=1;var Ho=0;for(Mn=this.length-1;Mn>=0&&(Ho!==0||Mn>=wi);Mn--){var rc=this.words[Mn]|0;this.words[Mn]=Ho<<26-mo|rc>>>mo,Ho=rc&Qo}return Ao&&Ho!==0&&(Ao.words[Ao.length++]=Ho),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},Se.prototype.ishrn=function(Fe,Ke,Je){return X(this.negative===0),this.iushrn(Fe,Ke,Je)},Se.prototype.shln=function(Fe){return this.clone().ishln(Fe)},Se.prototype.ushln=function(Fe){return this.clone().iushln(Fe)},Se.prototype.shrn=function(Fe){return this.clone().ishrn(Fe)},Se.prototype.ushrn=function(Fe){return this.clone().iushrn(Fe)},Se.prototype.testn=function(Fe){X(typeof Fe=="number"&&Fe>=0);var Ke=Fe%26,Je=(Fe-Ke)/26,wi=1<<Ke;if(this.length<=Je)return!1;var mo=this.words[Je];return!!(mo&wi)},Se.prototype.imaskn=function(Fe){X(typeof Fe=="number"&&Fe>=0);var Ke=Fe%26,Je=(Fe-Ke)/26;if(X(this.negative===0,"imaskn works only with positive numbers"),this.length<=Je)return this;if(Ke!==0&&Je++,this.length=Math.min(Je,this.length),Ke!==0){var wi=67108863^67108863>>>Ke<<Ke;this.words[this.length-1]&=wi}return this._strip()},Se.prototype.maskn=function(Fe){return this.clone().imaskn(Fe)},Se.prototype.iaddn=function(Fe){return X(typeof Fe=="number"),X(Fe<67108864),Fe<0?this.isubn(-Fe):this.negative!==0?this.length===1&&(this.words[0]|0)<=Fe?(this.words[0]=Fe-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(Fe),this.negative=1,this):this._iaddn(Fe)},Se.prototype._iaddn=function(Fe){this.words[0]+=Fe;for(var Ke=0;Ke<this.length&&this.words[Ke]>=67108864;Ke++)this.words[Ke]-=67108864,Ke===this.length-1?this.words[Ke+1]=1:this.words[Ke+1]++;return this.length=Math.max(this.length,Ke+1),this},Se.prototype.isubn=function(Fe){if(X(typeof Fe=="number"),X(Fe<67108864),Fe<0)return this.iaddn(-Fe);if(this.negative!==0)return this.negative=0,this.iaddn(Fe),this.negative=1,this;if(this.words[0]-=Fe,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Ke=0;Ke<this.length&&this.words[Ke]<0;Ke++)this.words[Ke]+=67108864,this.words[Ke+1]-=1;return this._strip()},Se.prototype.addn=function(Fe){return this.clone().iaddn(Fe)},Se.prototype.subn=function(Fe){return this.clone().isubn(Fe)},Se.prototype.iabs=function(){return this.negative=0,this},Se.prototype.abs=function(){return this.clone().iabs()},Se.prototype._ishlnsubmul=function(Fe,Ke,Je){var wi=Fe.length+Je,mo;this._expand(wi);var Go,Qo=0;for(mo=0;mo<Fe.length;mo++){Go=(this.words[mo+Je]|0)+Qo;var Ao=(Fe.words[mo]|0)*Ke;Go-=Ao&67108863,Qo=(Go>>26)-(Ao/67108864|0),this.words[mo+Je]=Go&67108863}for(;mo<this.length-Je;mo++)Go=(this.words[mo+Je]|0)+Qo,Qo=Go>>26,this.words[mo+Je]=Go&67108863;if(Qo===0)return this._strip();for(X(Qo===-1),Qo=0,mo=0;mo<this.length;mo++)Go=-(this.words[mo]|0)+Qo,Qo=Go>>26,this.words[mo]=Go&67108863;return this.negative=1,this._strip()},Se.prototype._wordDiv=function(Fe,Ke){var Je=this.length-Fe.length,wi=this.clone(),mo=Fe,Go=mo.words[mo.length-1]|0,Qo=this._countBits(Go);Je=26-Qo,Je!==0&&(mo=mo.ushln(Je),wi.iushln(Je),Go=mo.words[mo.length-1]|0);var Ao=wi.length-mo.length,Mn;if(Ke!=="mod"){Mn=new Se(null),Mn.length=Ao+1,Mn.words=new Array(Mn.length);for(var Ho=0;Ho<Mn.length;Ho++)Mn.words[Ho]=0}var rc=wi.clone()._ishlnsubmul(mo,1,Ao);rc.negative===0&&(wi=rc,Mn&&(Mn.words[Ao]=1));for(var dc=Ao-1;dc>=0;dc--){var ds=(wi.words[mo.length+dc]|0)*67108864+(wi.words[mo.length+dc-1]|0);for(ds=Math.min(ds/Go|0,67108863),wi._ishlnsubmul(mo,ds,dc);wi.negative!==0;)ds--,wi.negative=0,wi._ishlnsubmul(mo,1,dc),wi.isZero()||(wi.negative^=1);Mn&&(Mn.words[dc]=ds)}return Mn&&Mn._strip(),wi._strip(),Ke!=="div"&&Je!==0&&wi.iushrn(Je),{div:Mn||null,mod:wi}},Se.prototype.divmod=function(Fe,Ke,Je){if(X(!Fe.isZero()),this.isZero())return{div:new Se(0),mod:new Se(0)};var wi,mo,Go;return this.negative!==0&&Fe.negative===0?(Go=this.neg().divmod(Fe,Ke),Ke!=="mod"&&(wi=Go.div.neg()),Ke!=="div"&&(mo=Go.mod.neg(),Je&&mo.negative!==0&&mo.iadd(Fe)),{div:wi,mod:mo}):this.negative===0&&Fe.negative!==0?(Go=this.divmod(Fe.neg(),Ke),Ke!=="mod"&&(wi=Go.div.neg()),{div:wi,mod:Go.mod}):this.negative&Fe.negative?(Go=this.neg().divmod(Fe.neg(),Ke),Ke!=="div"&&(mo=Go.mod.neg(),Je&&mo.negative!==0&&mo.isub(Fe)),{div:Go.div,mod:mo}):Fe.length>this.length||this.cmp(Fe)<0?{div:new Se(0),mod:this}:Fe.length===1?Ke==="div"?{div:this.divn(Fe.words[0]),mod:null}:Ke==="mod"?{div:null,mod:new Se(this.modrn(Fe.words[0]))}:{div:this.divn(Fe.words[0]),mod:new Se(this.modrn(Fe.words[0]))}:this._wordDiv(Fe,Ke)},Se.prototype.div=function(Fe){return this.divmod(Fe,"div",!1).div},Se.prototype.mod=function(Fe){return this.divmod(Fe,"mod",!1).mod},Se.prototype.umod=function(Fe){return this.divmod(Fe,"mod",!0).mod},Se.prototype.divRound=function(Fe){var Ke=this.divmod(Fe);if(Ke.mod.isZero())return Ke.div;var Je=Ke.div.negative!==0?Ke.mod.isub(Fe):Ke.mod,wi=Fe.ushrn(1),mo=Fe.andln(1),Go=Je.cmp(wi);return Go<0||mo===1&&Go===0?Ke.div:Ke.div.negative!==0?Ke.div.isubn(1):Ke.div.iaddn(1)},Se.prototype.modrn=function(Fe){var Ke=Fe<0;Ke&&(Fe=-Fe),X(Fe<=67108863);for(var Je=(1<<26)%Fe,wi=0,mo=this.length-1;mo>=0;mo--)wi=(Je*wi+(this.words[mo]|0))%Fe;return Ke?-wi:wi},Se.prototype.modn=function(Fe){return this.modrn(Fe)},Se.prototype.idivn=function(Fe){var Ke=Fe<0;Ke&&(Fe=-Fe),X(Fe<=67108863);for(var Je=0,wi=this.length-1;wi>=0;wi--){var mo=(this.words[wi]|0)+Je*67108864;this.words[wi]=mo/Fe|0,Je=mo%Fe}return this._strip(),Ke?this.ineg():this},Se.prototype.divn=function(Fe){return this.clone().idivn(Fe)},Se.prototype.egcd=function(Fe){X(Fe.negative===0),X(!Fe.isZero());var Ke=this,Je=Fe.clone();Ke.negative!==0?Ke=Ke.umod(Fe):Ke=Ke.clone();for(var wi=new Se(1),mo=new Se(0),Go=new Se(0),Qo=new Se(1),Ao=0;Ke.isEven()&&Je.isEven();)Ke.iushrn(1),Je.iushrn(1),++Ao;for(var Mn=Je.clone(),Ho=Ke.clone();!Ke.isZero();){for(var rc=0,dc=1;!(Ke.words[0]&dc)&&rc<26;++rc,dc<<=1);if(rc>0)for(Ke.iushrn(rc);rc-- >0;)(wi.isOdd()||mo.isOdd())&&(wi.iadd(Mn),mo.isub(Ho)),wi.iushrn(1),mo.iushrn(1);for(var ds=0,fc=1;!(Je.words[0]&fc)&&ds<26;++ds,fc<<=1);if(ds>0)for(Je.iushrn(ds);ds-- >0;)(Go.isOdd()||Qo.isOdd())&&(Go.iadd(Mn),Qo.isub(Ho)),Go.iushrn(1),Qo.iushrn(1);Ke.cmp(Je)>=0?(Ke.isub(Je),wi.isub(Go),mo.isub(Qo)):(Je.isub(Ke),Go.isub(wi),Qo.isub(mo))}return{a:Go,b:Qo,gcd:Je.iushln(Ao)}},Se.prototype._invmp=function(Fe){X(Fe.negative===0),X(!Fe.isZero());var Ke=this,Je=Fe.clone();Ke.negative!==0?Ke=Ke.umod(Fe):Ke=Ke.clone();for(var wi=new Se(1),mo=new Se(0),Go=Je.clone();Ke.cmpn(1)>0&&Je.cmpn(1)>0;){for(var Qo=0,Ao=1;!(Ke.words[0]&Ao)&&Qo<26;++Qo,Ao<<=1);if(Qo>0)for(Ke.iushrn(Qo);Qo-- >0;)wi.isOdd()&&wi.iadd(Go),wi.iushrn(1);for(var Mn=0,Ho=1;!(Je.words[0]&Ho)&&Mn<26;++Mn,Ho<<=1);if(Mn>0)for(Je.iushrn(Mn);Mn-- >0;)mo.isOdd()&&mo.iadd(Go),mo.iushrn(1);Ke.cmp(Je)>=0?(Ke.isub(Je),wi.isub(mo)):(Je.isub(Ke),mo.isub(wi))}var rc;return Ke.cmpn(1)===0?rc=wi:rc=mo,rc.cmpn(0)<0&&rc.iadd(Fe),rc},Se.prototype.gcd=function(Fe){if(this.isZero())return Fe.abs();if(Fe.isZero())return this.abs();var Ke=this.clone(),Je=Fe.clone();Ke.negative=0,Je.negative=0;for(var wi=0;Ke.isEven()&&Je.isEven();wi++)Ke.iushrn(1),Je.iushrn(1);do{for(;Ke.isEven();)Ke.iushrn(1);for(;Je.isEven();)Je.iushrn(1);var mo=Ke.cmp(Je);if(mo<0){var Go=Ke;Ke=Je,Je=Go}else if(mo===0||Je.cmpn(1)===0)break;Ke.isub(Je)}while(!0);return Je.iushln(wi)},Se.prototype.invm=function(Fe){return this.egcd(Fe).a.umod(Fe)},Se.prototype.isEven=function(){return(this.words[0]&1)===0},Se.prototype.isOdd=function(){return(this.words[0]&1)===1},Se.prototype.andln=function(Fe){return this.words[0]&Fe},Se.prototype.bincn=function(Fe){X(typeof Fe=="number");var Ke=Fe%26,Je=(Fe-Ke)/26,wi=1<<Ke;if(this.length<=Je)return this._expand(Je+1),this.words[Je]|=wi,this;for(var mo=wi,Go=Je;mo!==0&&Go<this.length;Go++){var Qo=this.words[Go]|0;Qo+=mo,mo=Qo>>>26,Qo&=67108863,this.words[Go]=Qo}return mo!==0&&(this.words[Go]=mo,this.length++),this},Se.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Se.prototype.cmpn=function(Fe){var Ke=Fe<0;if(this.negative!==0&&!Ke)return-1;if(this.negative===0&&Ke)return 1;this._strip();var Je;if(this.length>1)Je=1;else{Ke&&(Fe=-Fe),X(Fe<=67108863,"Number is too big");var wi=this.words[0]|0;Je=wi===Fe?0:wi<Fe?-1:1}return this.negative!==0?-Je|0:Je},Se.prototype.cmp=function(Fe){if(this.negative!==0&&Fe.negative===0)return-1;if(this.negative===0&&Fe.negative!==0)return 1;var Ke=this.ucmp(Fe);return this.negative!==0?-Ke|0:Ke},Se.prototype.ucmp=function(Fe){if(this.length>Fe.length)return 1;if(this.length<Fe.length)return-1;for(var Ke=0,Je=this.length-1;Je>=0;Je--){var wi=this.words[Je]|0,mo=Fe.words[Je]|0;if(wi!==mo){wi<mo?Ke=-1:wi>mo&&(Ke=1);break}}return Ke},Se.prototype.gtn=function(Fe){return this.cmpn(Fe)===1},Se.prototype.gt=function(Fe){return this.cmp(Fe)===1},Se.prototype.gten=function(Fe){return this.cmpn(Fe)>=0},Se.prototype.gte=function(Fe){return this.cmp(Fe)>=0},Se.prototype.ltn=function(Fe){return this.cmpn(Fe)===-1},Se.prototype.lt=function(Fe){return this.cmp(Fe)===-1},Se.prototype.lten=function(Fe){return this.cmpn(Fe)<=0},Se.prototype.lte=function(Fe){return this.cmp(Fe)<=0},Se.prototype.eqn=function(Fe){return this.cmpn(Fe)===0},Se.prototype.eq=function(Fe){return this.cmp(Fe)===0},Se.red=function(Fe){return new is(Fe)},Se.prototype.toRed=function(Fe){return X(!this.red,"Already a number in reduction context"),X(this.negative===0,"red works only with positives"),Fe.convertTo(this)._forceRed(Fe)},Se.prototype.fromRed=function(){return X(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Se.prototype._forceRed=function(Fe){return this.red=Fe,this},Se.prototype.forceRed=function(Fe){return X(!this.red,"Already a number in reduction context"),this._forceRed(Fe)},Se.prototype.redAdd=function(Fe){return X(this.red,"redAdd works only with red numbers"),this.red.add(this,Fe)},Se.prototype.redIAdd=function(Fe){return X(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Fe)},Se.prototype.redSub=function(Fe){return X(this.red,"redSub works only with red numbers"),this.red.sub(this,Fe)},Se.prototype.redISub=function(Fe){return X(this.red,"redISub works only with red numbers"),this.red.isub(this,Fe)},Se.prototype.redShl=function(Fe){return X(this.red,"redShl works only with red numbers"),this.red.shl(this,Fe)},Se.prototype.redMul=function(Fe){return X(this.red,"redMul works only with red numbers"),this.red._verify2(this,Fe),this.red.mul(this,Fe)},Se.prototype.redIMul=function(Fe){return X(this.red,"redMul works only with red numbers"),this.red._verify2(this,Fe),this.red.imul(this,Fe)},Se.prototype.redSqr=function(){return X(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Se.prototype.redISqr=function(){return X(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Se.prototype.redSqrt=function(){return X(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Se.prototype.redInvm=function(){return X(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Se.prototype.redNeg=function(){return X(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Se.prototype.redPow=function(Fe){return X(this.red&&!Fe.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Fe)};var Yo={k256:null,p224:null,p192:null,p25519:null};function zo(Fe,Ke){this.name=Fe,this.p=new Se(Ke,16),this.n=this.p.bitLength(),this.k=new Se(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}zo.prototype._tmp=function(){var Fe=new Se(null);return Fe.words=new Array(Math.ceil(this.n/13)),Fe},zo.prototype.ireduce=function(Fe){var Ke=Fe,Je;do this.split(Ke,this.tmp),Ke=this.imulK(Ke),Ke=Ke.iadd(this.tmp),Je=Ke.bitLength();while(Je>this.n);var wi=Je<this.n?-1:Ke.ucmp(this.p);return wi===0?(Ke.words[0]=0,Ke.length=1):wi>0?Ke.isub(this.p):Ke.strip!==void 0?Ke.strip():Ke._strip(),Ke},zo.prototype.split=function(Fe,Ke){Fe.iushrn(this.n,0,Ke)},zo.prototype.imulK=function(Fe){return Fe.imul(this.k)};function jo(){zo.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Me(jo,zo),jo.prototype.split=function(Fe,Ke){for(var Je=4194303,wi=Math.min(Fe.length,9),mo=0;mo<wi;mo++)Ke.words[mo]=Fe.words[mo];if(Ke.length=wi,Fe.length<=9){Fe.words[0]=0,Fe.length=1;return}var Go=Fe.words[9];for(Ke.words[Ke.length++]=Go&Je,mo=10;mo<Fe.length;mo++){var Qo=Fe.words[mo]|0;Fe.words[mo-10]=(Qo&Je)<<4|Go>>>22,Go=Qo}Go>>>=22,Fe.words[mo-10]=Go,Go===0&&Fe.length>10?Fe.length-=10:Fe.length-=9},jo.prototype.imulK=function(Fe){Fe.words[Fe.length]=0,Fe.words[Fe.length+1]=0,Fe.length+=2;for(var Ke=0,Je=0;Je<Fe.length;Je++){var wi=Fe.words[Je]|0;Ke+=wi*977,Fe.words[Je]=Ke&67108863,Ke=wi*64+(Ke/67108864|0)}return Fe.words[Fe.length-1]===0&&(Fe.length--,Fe.words[Fe.length-1]===0&&Fe.length--),Fe};function Vo(){zo.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Me(Vo,zo);function os(){zo.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Me(os,zo);function us(){zo.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Me(us,zo),us.prototype.imulK=function(Fe){for(var Ke=0,Je=0;Je<Fe.length;Je++){var wi=(Fe.words[Je]|0)*19+Ke,mo=wi&67108863;wi>>>=26,Fe.words[Je]=mo,Ke=wi}return Ke!==0&&(Fe.words[Fe.length++]=Ke),Fe},Se._prime=function(Fe){if(Yo[Fe])return Yo[Fe];var Ke;if(Fe==="k256")Ke=new jo;else if(Fe==="p224")Ke=new Vo;else if(Fe==="p192")Ke=new os;else if(Fe==="p25519")Ke=new us;else throw new Error("Unknown prime "+Fe);return Yo[Fe]=Ke,Ke};function is(Fe){if(typeof Fe=="string"){var Ke=Se._prime(Fe);this.m=Ke.p,this.prime=Ke}else X(Fe.gtn(1),"modulus must be greater than 1"),this.m=Fe,this.prime=null}is.prototype._verify1=function(Fe){X(Fe.negative===0,"red works only with positives"),X(Fe.red,"red works only with red numbers")},is.prototype._verify2=function(Fe,Ke){X((Fe.negative|Ke.negative)===0,"red works only with positives"),X(Fe.red&&Fe.red===Ke.red,"red works only with red numbers")},is.prototype.imod=function(Fe){return this.prime?this.prime.ireduce(Fe)._forceRed(this):(qe(Fe,Fe.umod(this.m)._forceRed(this)),Fe)},is.prototype.neg=function(Fe){return Fe.isZero()?Fe.clone():this.m.sub(Fe)._forceRed(this)},is.prototype.add=function(Fe,Ke){this._verify2(Fe,Ke);var Je=Fe.add(Ke);return Je.cmp(this.m)>=0&&Je.isub(this.m),Je._forceRed(this)},is.prototype.iadd=function(Fe,Ke){this._verify2(Fe,Ke);var Je=Fe.iadd(Ke);return Je.cmp(this.m)>=0&&Je.isub(this.m),Je},is.prototype.sub=function(Fe,Ke){this._verify2(Fe,Ke);var Je=Fe.sub(Ke);return Je.cmpn(0)<0&&Je.iadd(this.m),Je._forceRed(this)},is.prototype.isub=function(Fe,Ke){this._verify2(Fe,Ke);var Je=Fe.isub(Ke);return Je.cmpn(0)<0&&Je.iadd(this.m),Je},is.prototype.shl=function(Fe,Ke){return this._verify1(Fe),this.imod(Fe.ushln(Ke))},is.prototype.imul=function(Fe,Ke){return this._verify2(Fe,Ke),this.imod(Fe.imul(Ke))},is.prototype.mul=function(Fe,Ke){return this._verify2(Fe,Ke),this.imod(Fe.mul(Ke))},is.prototype.isqr=function(Fe){return this.imul(Fe,Fe.clone())},is.prototype.sqr=function(Fe){return this.mul(Fe,Fe)},is.prototype.sqrt=function(Fe){if(Fe.isZero())return Fe.clone();var Ke=this.m.andln(3);if(X(Ke%2===1),Ke===3){var Je=this.m.add(new Se(1)).iushrn(2);return this.pow(Fe,Je)}for(var wi=this.m.subn(1),mo=0;!wi.isZero()&&wi.andln(1)===0;)mo++,wi.iushrn(1);X(!wi.isZero());var Go=new Se(1).toRed(this),Qo=Go.redNeg(),Ao=this.m.subn(1).iushrn(1),Mn=this.m.bitLength();for(Mn=new Se(2*Mn*Mn).toRed(this);this.pow(Mn,Ao).cmp(Qo)!==0;)Mn.redIAdd(Qo);for(var Ho=this.pow(Mn,wi),rc=this.pow(Fe,wi.addn(1).iushrn(1)),dc=this.pow(Fe,wi),ds=mo;dc.cmp(Go)!==0;){for(var fc=dc,ac=0;fc.cmp(Go)!==0;ac++)fc=fc.redSqr();X(ac<ds);var lc=this.pow(Ho,new Se(1).iushln(ds-ac-1));rc=rc.redMul(lc),Ho=lc.redSqr(),dc=dc.redMul(Ho),ds=ac}return rc},is.prototype.invm=function(Fe){var Ke=Fe._invmp(this.m);return Ke.negative!==0?(Ke.negative=0,this.imod(Ke).redNeg()):this.imod(Ke)},is.prototype.pow=function(Fe,Ke){if(Ke.isZero())return new Se(1).toRed(this);if(Ke.cmpn(1)===0)return Fe.clone();var Je=4,wi=new Array(1<<Je);wi[0]=new Se(1).toRed(this),wi[1]=Fe;for(var mo=2;mo<wi.length;mo++)wi[mo]=this.mul(wi[mo-1],Fe);var Go=wi[0],Qo=0,Ao=0,Mn=Ke.bitLength()%26;for(Mn===0&&(Mn=26),mo=Ke.length-1;mo>=0;mo--){for(var Ho=Ke.words[mo],rc=Mn-1;rc>=0;rc--){var dc=Ho>>rc&1;if(Go!==wi[0]&&(Go=this.sqr(Go)),dc===0&&Qo===0){Ao=0;continue}Qo<<=1,Qo|=dc,Ao++,!(Ao!==Je&&(mo!==0||rc!==0))&&(Go=this.mul(Go,wi[Qo]),Ao=0,Qo=0)}Mn=26}return Go},is.prototype.convertTo=function(Fe){var Ke=Fe.umod(this.m);return Ke===Fe?Ke.clone():Ke},is.prototype.convertFrom=function(Fe){var Ke=Fe.clone();return Ke.red=null,Ke},Se.mont=function(Fe){return new Lo(Fe)};function Lo(Fe){is.call(this,Fe),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new Se(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)}Me(Lo,is),Lo.prototype.convertTo=function(Fe){return this.imod(Fe.ushln(this.shift))},Lo.prototype.convertFrom=function(Fe){var Ke=this.imod(Fe.mul(this.rinv));return Ke.red=null,Ke},Lo.prototype.imul=function(Fe,Ke){if(Fe.isZero()||Ke.isZero())return Fe.words[0]=0,Fe.length=1,Fe;var Je=Fe.imul(Ke),wi=Je.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mo=Je.isub(wi).iushrn(this.shift),Go=mo;return mo.cmp(this.m)>=0?Go=mo.isub(this.m):mo.cmpn(0)<0&&(Go=mo.iadd(this.m)),Go._forceRed(this)},Lo.prototype.mul=function(Fe,Ke){if(Fe.isZero()||Ke.isZero())return new Se(0)._forceRed(this);var Je=Fe.mul(Ke),wi=Je.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),mo=Je.isub(wi).iushrn(this.shift),Go=mo;return mo.cmp(this.m)>=0?Go=mo.isub(this.m):mo.cmpn(0)<0&&(Go=mo.iadd(this.m)),Go._forceRed(this)},Lo.prototype.invm=function(Fe){var Ke=this.imod(Fe._invmp(this.m).mul(this.r2));return Ke._forceRed(this)}})(W,Kn$1)})(Xn$1);var K$2=Xn$1.exports;const $n$1="bignumber/5.7.0";var Dr$2=K$2.BN;const Ae$2=new z$4($n$1),Ni$1={},Zn$1=9007199254740991;function Hs$1(W){return W!=null&&(V$1.isBigNumber(W)||typeof W=="number"&&W%1===0||typeof W=="string"&&!!W.match(/^-?[0-9]+$/)||Jt$2(W)||typeof W=="bigint"||nr$2(W))}let tf$1=!1,V$1=class U1{constructor(Y,J){Y!==Ni$1&&Ae$2.throwError("cannot call constructor directly; use BigNumber.from",z$4.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=J,this._isBigNumber=!0,Object.freeze(this)}fromTwos(Y){return zt$2(j$5(this).fromTwos(Y))}toTwos(Y){return zt$2(j$5(this).toTwos(Y))}abs(){return this._hex[0]==="-"?U1.from(this._hex.substring(1)):this}add(Y){return zt$2(j$5(this).add(j$5(Y)))}sub(Y){return zt$2(j$5(this).sub(j$5(Y)))}div(Y){return U1.from(Y).isZero()&&$t$2("division-by-zero","div"),zt$2(j$5(this).div(j$5(Y)))}mul(Y){return zt$2(j$5(this).mul(j$5(Y)))}mod(Y){const J=j$5(Y);return J.isNeg()&&$t$2("division-by-zero","mod"),zt$2(j$5(this).umod(J))}pow(Y){const J=j$5(Y);return J.isNeg()&&$t$2("negative-power","pow"),zt$2(j$5(this).pow(J))}and(Y){const J=j$5(Y);return(this.isNegative()||J.isNeg())&&$t$2("unbound-bitwise-result","and"),zt$2(j$5(this).and(J))}or(Y){const J=j$5(Y);return(this.isNegative()||J.isNeg())&&$t$2("unbound-bitwise-result","or"),zt$2(j$5(this).or(J))}xor(Y){const J=j$5(Y);return(this.isNegative()||J.isNeg())&&$t$2("unbound-bitwise-result","xor"),zt$2(j$5(this).xor(J))}mask(Y){return(this.isNegative()||Y<0)&&$t$2("negative-width","mask"),zt$2(j$5(this).maskn(Y))}shl(Y){return(this.isNegative()||Y<0)&&$t$2("negative-width","shl"),zt$2(j$5(this).shln(Y))}shr(Y){return(this.isNegative()||Y<0)&&$t$2("negative-width","shr"),zt$2(j$5(this).shrn(Y))}eq(Y){return j$5(this).eq(j$5(Y))}lt(Y){return j$5(this).lt(j$5(Y))}lte(Y){return j$5(this).lte(j$5(Y))}gt(Y){return j$5(this).gt(j$5(Y))}gte(Y){return j$5(this).gte(j$5(Y))}isNegative(){return this._hex[0]==="-"}isZero(){return j$5(this).isZero()}toNumber(){try{return j$5(this).toNumber()}catch{$t$2("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ae$2.throwError("this platform does not support BigInt",z$4.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?tf$1||(tf$1=!0,Ae$2.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ae$2.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",z$4.errors.UNEXPECTED_ARGUMENT,{}):Ae$2.throwError("BigNumber.toString does not accept parameters",z$4.errors.UNEXPECTED_ARGUMENT,{})),j$5(this).toString(10)}toHexString(){return this._hex}toJSON(Y){return{type:"BigNumber",hex:this.toHexString()}}static from(Y){if(Y instanceof U1)return Y;if(typeof Y=="string")return Y.match(/^-?0x[0-9a-f]+$/i)?new U1(Ni$1,mr$2(Y)):Y.match(/^-?[0-9]+$/)?new U1(Ni$1,mr$2(new Dr$2(Y))):Ae$2.throwArgumentError("invalid BigNumber string","value",Y);if(typeof Y=="number")return Y%1&&$t$2("underflow","BigNumber.from",Y),(Y>=Zn$1||Y<=-9007199254740991)&&$t$2("overflow","BigNumber.from",Y),U1.from(String(Y));const J=Y;if(typeof J=="bigint")return U1.from(J.toString());if(nr$2(J))return U1.from(Kt$2(J));if(J)if(J.toHexString){const X=J.toHexString();if(typeof X=="string")return U1.from(X)}else{let X=J._hex;if(X==null&&J.type==="BigNumber"&&(X=J.hex),typeof X=="string"&&(Jt$2(X)||X[0]==="-"&&Jt$2(X.substring(1))))return U1.from(X)}return Ae$2.throwArgumentError("invalid BigNumber value","value",Y)}static isBigNumber(Y){return!!(Y&&Y._isBigNumber)}};function mr$2(W){if(typeof W!="string")return mr$2(W.toString(16));if(W[0]==="-")return W=W.substring(1),W[0]==="-"&&Ae$2.throwArgumentError("invalid hex","value",W),W=mr$2(W),W==="0x00"?W:"-"+W;if(W.substring(0,2)!=="0x"&&(W="0x"+W),W==="0x")return"0x00";for(W.length%2&&(W="0x0"+W.substring(2));W.length>4&&W.substring(0,4)==="0x00";)W="0x"+W.substring(4);return W}function zt$2(W){return V$1.from(mr$2(W))}function j$5(W){const Y=V$1.from(W).toHexString();return Y[0]==="-"?new Dr$2("-"+Y.substring(3),16):new Dr$2(Y.substring(2),16)}function $t$2(W,Y,J){const X={fault:W,operation:Y};return J!=null&&(X.value=J),Ae$2.throwError(W,z$4.errors.NUMERIC_FAULT,X)}function Ls$2(W){return new Dr$2(W,36).toString(16)}const Ht$2=new z$4($n$1),Ar$2={},ef=V$1.from(0),rf=V$1.from(-1);function nf$1(W,Y,J,X){const Me={fault:Y,operation:J};return X!==void 0&&(Me.value=X),Ht$2.throwError(W,z$4.errors.NUMERIC_FAULT,Me)}let br$2="0";for(;br$2.length<256;)br$2+=br$2;function _i$1(W){if(typeof W!="number")try{W=V$1.from(W).toNumber()}catch{}return typeof W=="number"&&W>=0&&W<=256&&!(W%1)?"1"+br$2.substring(0,W):Ht$2.throwArgumentError("invalid decimal size","decimals",W)}function Bi$1(W,Y){Y==null&&(Y=0);const J=_i$1(Y);W=V$1.from(W);const X=W.lt(ef);X&&(W=W.mul(rf));let Me=W.mod(J).toString();for(;Me.length<J.length-1;)Me="0"+Me;Me=Me.match(/^([0-9]*[1-9]|0)(0*)/)[1];const Se=W.div(J).toString();return J.length===1?W=Se:W=Se+"."+Me,X&&(W="-"+W),W}function be$3(W,Y){Y==null&&(Y=0);const J=_i$1(Y);(typeof W!="string"||!W.match(/^-?[0-9.]+$/))&&Ht$2.throwArgumentError("invalid decimal value","value",W);const X=W.substring(0,1)==="-";X&&(W=W.substring(1)),W==="."&&Ht$2.throwArgumentError("missing value","value",W);const Me=W.split(".");Me.length>2&&Ht$2.throwArgumentError("too many decimal points","value",W);let Se=Me[0],Ne=Me[1];for(Se||(Se="0"),Ne||(Ne="0");Ne[Ne.length-1]==="0";)Ne=Ne.substring(0,Ne.length-1);for(Ne.length>J.length-1&&nf$1("fractional component exceeds decimals","underflow","parseFixed"),Ne===""&&(Ne="0");Ne.length<J.length-1;)Ne+="0";const je=V$1.from(Se),ke=V$1.from(Ne);let De=je.mul(J).add(ke);return X&&(De=De.mul(rf)),De}let vr$2=class T2{constructor(Y,J,X,Me){Y!==Ar$2&&Ht$2.throwError("cannot use FixedFormat constructor; use FixedFormat.from",z$4.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=J,this.width=X,this.decimals=Me,this.name=(J?"":"u")+"fixed"+String(X)+"x"+String(Me),this._multiplier=_i$1(Me),Object.freeze(this)}static from(Y){if(Y instanceof T2)return Y;typeof Y=="number"&&(Y=`fixed128x${Y}`);let J=!0,X=128,Me=18;if(typeof Y=="string"){if(Y!=="fixed")if(Y==="ufixed")J=!1;else{const Se=Y.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);Se||Ht$2.throwArgumentError("invalid fixed format","format",Y),J=Se[1]!=="u",X=parseInt(Se[2]),Me=parseInt(Se[3])}}else if(Y){const Se=(Ne,je,ke)=>Y[Ne]==null?ke:(typeof Y[Ne]!==je&&Ht$2.throwArgumentError("invalid fixed format ("+Ne+" not "+je+")","format."+Ne,Y[Ne]),Y[Ne]);J=Se("signed","boolean",J),X=Se("width","number",X),Me=Se("decimals","number",Me)}return X%8&&Ht$2.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",X),Me>80&&Ht$2.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",Me),new T2(Ar$2,J,X,Me)}},Ut$2=class mp{constructor(Y,J,X,Me){Y!==Ar$2&&Ht$2.throwError("cannot use FixedNumber constructor; use FixedNumber.from",z$4.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=Me,this._hex=J,this._value=X,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(Y){this.format.name!==Y.format.name&&Ht$2.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",Y)}addUnsafe(Y){this._checkFormat(Y);const J=be$3(this._value,this.format.decimals),X=be$3(Y._value,Y.format.decimals);return mp.fromValue(J.add(X),this.format.decimals,this.format)}subUnsafe(Y){this._checkFormat(Y);const J=be$3(this._value,this.format.decimals),X=be$3(Y._value,Y.format.decimals);return mp.fromValue(J.sub(X),this.format.decimals,this.format)}mulUnsafe(Y){this._checkFormat(Y);const J=be$3(this._value,this.format.decimals),X=be$3(Y._value,Y.format.decimals);return mp.fromValue(J.mul(X).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(Y){this._checkFormat(Y);const J=be$3(this._value,this.format.decimals),X=be$3(Y._value,Y.format.decimals);return mp.fromValue(J.mul(this.format._multiplier).div(X),this.format.decimals,this.format)}floor(){const Y=this.toString().split(".");Y.length===1&&Y.push("0");let J=mp.from(Y[0],this.format);const X=!Y[1].match(/^(0*)$/);return this.isNegative()&&X&&(J=J.subUnsafe(ff.toFormat(J.format))),J}ceiling(){const Y=this.toString().split(".");Y.length===1&&Y.push("0");let J=mp.from(Y[0],this.format);const X=!Y[1].match(/^(0*)$/);return!this.isNegative()&&X&&(J=J.addUnsafe(ff.toFormat(J.format))),J}round(Y){Y==null&&(Y=0);const J=this.toString().split(".");if(J.length===1&&J.push("0"),(Y<0||Y>80||Y%1)&&Ht$2.throwArgumentError("invalid decimal count","decimals",Y),J[1].length<=Y)return this;const X=mp.from("1"+br$2.substring(0,Y),this.format),Me=zs$2.toFormat(this.format);return this.mulUnsafe(X).addUnsafe(Me).floor().divUnsafe(X)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(Y){if(Y==null)return this._hex;Y%8&&Ht$2.throwArgumentError("invalid byte width","width",Y);const J=V$1.from(this._hex).fromTwos(this.format.width).toTwos(Y).toHexString();return oe$3(J,Y/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(Y){return mp.fromString(this._value,Y)}static fromValue(Y,J,X){return X==null&&J!=null&&!Hs$1(J)&&(X=J,J=null),J==null&&(J=0),X==null&&(X="fixed"),mp.fromString(Bi$1(Y,J),vr$2.from(X))}static fromString(Y,J){J==null&&(J="fixed");const X=vr$2.from(J),Me=be$3(Y,X.decimals);!X.signed&&Me.lt(ef)&&nf$1("unsigned value cannot be negative","overflow","value",Y);let Se=null;X.signed?Se=Me.toTwos(X.width).toHexString():(Se=Me.toHexString(),Se=oe$3(Se,X.width/8));const Ne=Bi$1(Me,X.decimals);return new mp(Ar$2,Se,Ne,X)}static fromBytes(Y,J){J==null&&(J="fixed");const X=vr$2.from(J);if(Ot$2(Y).length>X.width/8)throw new Error("overflow");let Me=V$1.from(Y);X.signed&&(Me=Me.fromTwos(X.width));const Se=Me.toTwos((X.signed?0:1)+X.width).toHexString(),Ne=Bi$1(Me,X.decimals);return new mp(Ar$2,Se,Ne,X)}static from(Y,J){if(typeof Y=="string")return mp.fromString(Y,J);if(nr$2(Y))return mp.fromBytes(Y,J);try{return mp.fromValue(Y,0,J)}catch(X){if(X.code!==z$4.errors.INVALID_ARGUMENT)throw X}return Ht$2.throwArgumentError("invalid FixedNumber value","value",Y)}static isFixedNumber(Y){return!!(Y&&Y._isFixedNumber)}};const ff=Ut$2.from(1),zs$2=Ut$2.from("0.5"),js$2="strings/5.7.0",of$1=new z$4(js$2);var Fr$2;(function(W){W.current="",W.NFC="NFC",W.NFD="NFD",W.NFKC="NFKC",W.NFKD="NFKD"})(Fr$2||(Fr$2={}));var fr$2;(function(W){W.UNEXPECTED_CONTINUE="unexpected continuation byte",W.BAD_PREFIX="bad codepoint prefix",W.OVERRUN="string overrun",W.MISSING_CONTINUE="missing continuation byte",W.OUT_OF_RANGE="out of UTF-8 range",W.UTF16_SURROGATE="UTF-16 surrogate",W.OVERLONG="overlong representation"})(fr$2||(fr$2={}));function Ci$1(W,Y=Fr$2.current){Y!=Fr$2.current&&(of$1.checkNormalize(),W=W.normalize(Y));let J=[];for(let X=0;X<W.length;X++){const Me=W.charCodeAt(X);if(Me<128)J.push(Me);else if(Me<2048)J.push(Me>>6|192),J.push(Me&63|128);else if((Me&64512)==55296){X++;const Se=W.charCodeAt(X);if(X>=W.length||(Se&64512)!==56320)throw new Error("invalid utf-8 string");const Ne=65536+((Me&1023)<<10)+(Se&1023);J.push(Ne>>18|240),J.push(Ne>>12&63|128),J.push(Ne>>6&63|128),J.push(Ne&63|128)}else J.push(Me>>12|224),J.push(Me>>6&63|128),J.push(Me&63|128)}return Ot$2(J)}function Gs$2(W){if(W.length%4!==0)throw new Error("bad data");let Y=[];for(let J=0;J<W.length;J+=4)Y.push(parseInt(W.substring(J,J+4),16));return Y}function Ri(W,Y){Y||(Y=function(Me){return[parseInt(Me,16)]});let J=0,X={};return W.split(",").forEach(Me=>{let Se=Me.split(":");J+=parseInt(Se[0],16),X[J]=Y(Se[1])}),X}function af$1(W){let Y=0;return W.split(",").map(J=>{let X=J.split("-");X.length===1?X[1]="0":X[1]===""&&(X[1]="1");let Me=Y+parseInt(X[0],16);return Y=parseInt(X[1],16),{l:Me,h:Y}})}af$1("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(W=>parseInt(W,16)),Ri("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Ri("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Ri("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",Gs$2),af$1("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Ys$2(W){W=atob(W);const Y=[];for(let J=0;J<W.length;J++)Y.push(W.charCodeAt(J));return Ot$2(Y)}function hf(W,Y){Y==null&&(Y=1);const J=[],X=J.forEach,Me=function(Se,Ne){X.call(Se,function(je){Ne>0&&Array.isArray(je)?Me(je,Ne-1):J.push(je)})};return Me(W,Y),J}function Vs$2(W){const Y={};for(let J=0;J<W.length;J++){const X=W[J];Y[X[0]]=X[1]}return Y}function Ws$2(W){let Y=0;function J(){return W[Y++]<<8|W[Y++]}let X=J(),Me=1,Se=[0,1];for(let Yo=1;Yo<X;Yo++)Se.push(Me+=J());let Ne=J(),je=Y;Y+=Ne;let ke=0,De=0;function qe(){return ke==0&&(De=De<<8|W[Y++],ke=8),De>>--ke&1}const Ue=31,Ge=Math.pow(2,Ue),He=Ge>>>1,Ve=He>>1,Ye=Ge-1;let Fn=0;for(let Yo=0;Yo<Ue;Yo++)Fn=Fn<<1|qe();let io=[],$o=0,Jo=Ge;for(;;){let Yo=Math.floor(((Fn-$o+1)*Me-1)/Jo),zo=0,jo=X;for(;jo-zo>1;){let us=zo+jo>>>1;Yo<Se[us]?jo=us:zo=us}if(zo==0)break;io.push(zo);let Vo=$o+Math.floor(Jo*Se[zo]/Me),os=$o+Math.floor(Jo*Se[zo+1]/Me)-1;for(;!((Vo^os)&He);)Fn=Fn<<1&Ye|qe(),Vo=Vo<<1&Ye,os=os<<1&Ye|1;for(;Vo&~os&Ve;)Fn=Fn&He|Fn<<1&Ye>>>1|qe(),Vo=Vo<<1^He,os=(os^He)<<1|He|1;$o=Vo,Jo=1+os-Vo}let rs=X-4;return io.map(Yo=>{switch(Yo-rs){case 3:return rs+65792+(W[je++]<<16|W[je++]<<8|W[je++]);case 2:return rs+256+(W[je++]<<8|W[je++]);case 1:return rs+W[je++];default:return Yo-1}})}function Xs$2(W){let Y=0;return()=>W[Y++]}function $s$2(W){return Xs$2(Ws$2(W))}function Zs$2(W){return W&1?~W>>1:W>>1}function t0$1(W,Y){let J=Array(W);for(let X=0;X<W;X++)J[X]=1+Y();return J}function cf(W,Y){let J=Array(W);for(let X=0,Me=-1;X<W;X++)J[X]=Me+=1+Y();return J}function e0$1(W,Y){let J=Array(W);for(let X=0,Me=0;X<W;X++)J[X]=Me+=Zs$2(Y());return J}function Ur$2(W,Y){let J=cf(W(),W),X=W(),Me=cf(X,W),Se=t0$1(X,W);for(let Ne=0;Ne<X;Ne++)for(let je=0;je<Se[Ne];je++)J.push(Me[Ne]+je);return Y?J.map(Ne=>Y[Ne]):J}function r0$1(W){let Y=[];for(;;){let J=W();if(J==0)break;Y.push(n0(J,W))}for(;;){let J=W()-1;if(J<0)break;Y.push(f0(J,W))}return Vs$2(hf(Y))}function i0$1(W){let Y=[];for(;;){let J=W();if(J==0)break;Y.push(J)}return Y}function lf$1(W,Y,J){let X=Array(W).fill(void 0).map(()=>[]);for(let Me=0;Me<Y;Me++)e0$1(W,J).forEach((Se,Ne)=>X[Ne].push(Se));return X}function n0(W,Y){let J=1+Y(),X=Y(),Me=i0$1(Y),Se=lf$1(Me.length,1+W,Y);return hf(Se.map((Ne,je)=>{const ke=Ne[0],De=Ne.slice(1);return Array(Me[je]).fill(void 0).map((qe,Ue)=>{let Ge=Ue*X;return[ke+Ue*J,De.map(He=>He+Ge)]})}))}function f0(W,Y){let J=1+Y();return lf$1(J,1+W,Y).map(X=>[X[0],X.slice(1)])}function o0(W){let Y=Ur$2(W).sort((X,Me)=>X-Me);return J();function J(){let X=[];for(;;){let De=Ur$2(W,Y);if(De.length==0)break;X.push({set:new Set(De),node:J()})}X.sort((De,qe)=>qe.set.size-De.set.size);let Me=W(),Se=Me%3;Me=Me/3|0;let Ne=!!(Me&1);Me>>=1;let je=Me==1,ke=Me==2;return{branches:X,valid:Se,fe0f:Ne,save:je,check:ke}}}function s0(){return $s$2(Ys$2("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa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6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const kr$2=s0();new Set(Ur$2(kr$2)),new Set(Ur$2(kr$2)),r0$1(kr$2),o0(kr$2);const a0=new Uint8Array(32);a0.fill(0);const u0=`Ethereum Signed Message:
`;function df$1(W){return typeof W=="string"&&(W=Ci$1(W)),Ii$1(Ds$1([Ci$1(u0),Ci$1(String(W.length)),W]))}const c0="address/5.7.0",yr$1=new z$4(c0);function pf$1(W){Jt$2(W,20)||yr$1.throwArgumentError("invalid address","address",W),W=W.toLowerCase();const Y=W.substring(2).split(""),J=new Uint8Array(40);for(let Me=0;Me<40;Me++)J[Me]=Y[Me].charCodeAt(0);const X=Ot$2(Ii$1(J));for(let Me=0;Me<40;Me+=2)X[Me>>1]>>4>=8&&(Y[Me]=Y[Me].toUpperCase()),(X[Me>>1]&15)>=8&&(Y[Me+1]=Y[Me+1].toUpperCase());return"0x"+Y.join("")}const l0$1=9007199254740991;function d0$1(W){return Math.log10?Math.log10(W):Math.log(W)/Math.LN10}const Oi$1={};for(let W=0;W<10;W++)Oi$1[String(W)]=String(W);for(let W=0;W<26;W++)Oi$1[String.fromCharCode(65+W)]=String(10+W);const vf$1=Math.floor(d0$1(l0$1));function p0$1(W){W=W.toUpperCase(),W=W.substring(4)+W.substring(0,2)+"00";let Y=W.split("").map(X=>Oi$1[X]).join("");for(;Y.length>=vf$1;){let X=Y.substring(0,vf$1);Y=parseInt(X,10)%97+Y.substring(X.length)}let J=String(98-parseInt(Y,10)%97);for(;J.length<2;)J="0"+J;return J}function v0$1(W){let Y=null;if(typeof W!="string"&&yr$1.throwArgumentError("invalid address","address",W),W.match(/^(0x)?[0-9a-fA-F]{40}$/))W.substring(0,2)!=="0x"&&(W="0x"+W),Y=pf$1(W),W.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&Y!==W&&yr$1.throwArgumentError("bad address checksum","address",W);else if(W.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(W.substring(2,4)!==p0$1(W)&&yr$1.throwArgumentError("bad icap checksum","address",W),Y=Ls$2(W.substring(4));Y.length<40;)Y="0"+Y;Y=pf$1("0x"+Y)}else yr$1.throwArgumentError("invalid address","address",W);return Y}function wr$1(W,Y,J){Object.defineProperty(W,Y,{enumerable:!0,value:J,writable:!1})}const m0$1=new Uint8Array(32);m0$1.fill(0),V$1.from(-1);const A0$1=V$1.from(0),b0$1=V$1.from(1);V$1.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),oe$3(b0$1.toHexString(),32),oe$3(A0$1.toHexString(),32);var se$1={},Q$3={},xr$2=gf$1;function gf$1(W,Y){if(!W)throw new Error(Y||"Assertion failed")}gf$1.equal=function(W,Y,J){if(W!=Y)throw new Error(J||"Assertion failed: "+W+" != "+Y)};var Pi$1={exports:{}};typeof Object.create=="function"?Pi$1.exports=function(W,Y){Y&&(W.super_=Y,W.prototype=Object.create(Y.prototype,{constructor:{value:W,enumerable:!1,writable:!0,configurable:!0}}))}:Pi$1.exports=function(W,Y){if(Y){W.super_=Y;var J=function(){};J.prototype=Y.prototype,W.prototype=new J,W.prototype.constructor=W}};var y0$1=xr$2,w0$1=Pi$1.exports;Q$3.inherits=w0$1;function x0$1(W,Y){return(W.charCodeAt(Y)&64512)!==55296||Y<0||Y+1>=W.length?!1:(W.charCodeAt(Y+1)&64512)===56320}function M0$1(W,Y){if(Array.isArray(W))return W.slice();if(!W)return[];var J=[];if(typeof W=="string")if(Y){if(Y==="hex")for(W=W.replace(/[^a-z0-9]+/ig,""),W.length%2!==0&&(W="0"+W),Me=0;Me<W.length;Me+=2)J.push(parseInt(W[Me]+W[Me+1],16))}else for(var X=0,Me=0;Me<W.length;Me++){var Se=W.charCodeAt(Me);Se<128?J[X++]=Se:Se<2048?(J[X++]=Se>>6|192,J[X++]=Se&63|128):x0$1(W,Me)?(Se=65536+((Se&1023)<<10)+(W.charCodeAt(++Me)&1023),J[X++]=Se>>18|240,J[X++]=Se>>12&63|128,J[X++]=Se>>6&63|128,J[X++]=Se&63|128):(J[X++]=Se>>12|224,J[X++]=Se>>6&63|128,J[X++]=Se&63|128)}else for(Me=0;Me<W.length;Me++)J[Me]=W[Me]|0;return J}Q$3.toArray=M0$1;function E0$1(W){for(var Y="",J=0;J<W.length;J++)Y+=Af$1(W[J].toString(16));return Y}Q$3.toHex=E0$1;function mf$1(W){var Y=W>>>24|W>>>8&65280|W<<8&16711680|(W&255)<<24;return Y>>>0}Q$3.htonl=mf$1;function S0$2(W,Y){for(var J="",X=0;X<W.length;X++){var Me=W[X];Y==="little"&&(Me=mf$1(Me)),J+=bf$1(Me.toString(16))}return J}Q$3.toHex32=S0$2;function Af$1(W){return W.length===1?"0"+W:W}Q$3.zero2=Af$1;function bf$1(W){return W.length===7?"0"+W:W.length===6?"00"+W:W.length===5?"000"+W:W.length===4?"0000"+W:W.length===3?"00000"+W:W.length===2?"000000"+W:W.length===1?"0000000"+W:W}Q$3.zero8=bf$1;function I0$1(W,Y,J,X){var Me=J-Y;y0$1(Me%4===0);for(var Se=new Array(Me/4),Ne=0,je=Y;Ne<Se.length;Ne++,je+=4){var ke;X==="big"?ke=W[je]<<24|W[je+1]<<16|W[je+2]<<8|W[je+3]:ke=W[je+3]<<24|W[je+2]<<16|W[je+1]<<8|W[je],Se[Ne]=ke>>>0}return Se}Q$3.join32=I0$1;function N0$1(W,Y){for(var J=new Array(W.length*4),X=0,Me=0;X<W.length;X++,Me+=4){var Se=W[X];Y==="big"?(J[Me]=Se>>>24,J[Me+1]=Se>>>16&255,J[Me+2]=Se>>>8&255,J[Me+3]=Se&255):(J[Me+3]=Se>>>24,J[Me+2]=Se>>>16&255,J[Me+1]=Se>>>8&255,J[Me]=Se&255)}return J}Q$3.split32=N0$1;function _0$1(W,Y){return W>>>Y|W<<32-Y}Q$3.rotr32=_0$1;function B0$1(W,Y){return W<<Y|W>>>32-Y}Q$3.rotl32=B0$1;function C0$1(W,Y){return W+Y>>>0}Q$3.sum32=C0$1;function R0$1(W,Y,J){return W+Y+J>>>0}Q$3.sum32_3=R0$1;function O0$1(W,Y,J,X){return W+Y+J+X>>>0}Q$3.sum32_4=O0$1;function P0$1(W,Y,J,X,Me){return W+Y+J+X+Me>>>0}Q$3.sum32_5=P0$1;function T0$2(W,Y,J,X){var Me=W[Y],Se=W[Y+1],Ne=X+Se>>>0,je=(Ne<X?1:0)+J+Me;W[Y]=je>>>0,W[Y+1]=Ne}Q$3.sum64=T0$2;function D0$1(W,Y,J,X){var Me=Y+X>>>0,Se=(Me<Y?1:0)+W+J;return Se>>>0}Q$3.sum64_hi=D0$1;function F0$1(W,Y,J,X){var Me=Y+X;return Me>>>0}Q$3.sum64_lo=F0$1;function U0$1(W,Y,J,X,Me,Se,Ne,je){var ke=0,De=Y;De=De+X>>>0,ke+=De<Y?1:0,De=De+Se>>>0,ke+=De<Se?1:0,De=De+je>>>0,ke+=De<je?1:0;var qe=W+J+Me+Ne+ke;return qe>>>0}Q$3.sum64_4_hi=U0$1;function k0$1(W,Y,J,X,Me,Se,Ne,je){var ke=Y+X+Se+je;return ke>>>0}Q$3.sum64_4_lo=k0$1;function q0$1(W,Y,J,X,Me,Se,Ne,je,ke,De){var qe=0,Ue=Y;Ue=Ue+X>>>0,qe+=Ue<Y?1:0,Ue=Ue+Se>>>0,qe+=Ue<Se?1:0,Ue=Ue+je>>>0,qe+=Ue<je?1:0,Ue=Ue+De>>>0,qe+=Ue<De?1:0;var Ge=W+J+Me+Ne+ke+qe;return Ge>>>0}Q$3.sum64_5_hi=q0$1;function K0$1(W,Y,J,X,Me,Se,Ne,je,ke,De){var qe=Y+X+Se+je+De;return qe>>>0}Q$3.sum64_5_lo=K0$1;function H0$1(W,Y,J){var X=Y<<32-J|W>>>J;return X>>>0}Q$3.rotr64_hi=H0$1;function L0$2(W,Y,J){var X=W<<32-J|Y>>>J;return X>>>0}Q$3.rotr64_lo=L0$2;function z0$1(W,Y,J){return W>>>J}Q$3.shr64_hi=z0$1;function j0$1(W,Y,J){var X=W<<32-J|Y>>>J;return X>>>0}Q$3.shr64_lo=j0$1;var or$2={},yf$1=Q$3,Q0$1=xr$2;function qr$2(){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}or$2.BlockHash=qr$2,qr$2.prototype.update=function(W,Y){if(W=yf$1.toArray(W,Y),this.pending?this.pending=this.pending.concat(W):this.pending=W,this.pendingTotal+=W.length,this.pending.length>=this._delta8){W=this.pending;var J=W.length%this._delta8;this.pending=W.slice(W.length-J,W.length),this.pending.length===0&&(this.pending=null),W=yf$1.join32(W,0,W.length-J,this.endian);for(var X=0;X<W.length;X+=this._delta32)this._update(W,X,X+this._delta32)}return this},qr$2.prototype.digest=function(W){return this.update(this._pad()),Q0$1(this.pending===null),this._digest(W)},qr$2.prototype._pad=function(){var W=this.pendingTotal,Y=this._delta8,J=Y-(W+this.padLength)%Y,X=new Array(J+this.padLength);X[0]=128;for(var Me=1;Me<J;Me++)X[Me]=0;if(W<<=3,this.endian==="big"){for(var Se=8;Se<this.padLength;Se++)X[Me++]=0;X[Me++]=0,X[Me++]=0,X[Me++]=0,X[Me++]=0,X[Me++]=W>>>24&255,X[Me++]=W>>>16&255,X[Me++]=W>>>8&255,X[Me++]=W&255}else for(X[Me++]=W&255,X[Me++]=W>>>8&255,X[Me++]=W>>>16&255,X[Me++]=W>>>24&255,X[Me++]=0,X[Me++]=0,X[Me++]=0,X[Me++]=0,Se=8;Se<this.padLength;Se++)X[Me++]=0;return X};var sr$2={},ae$3={},J0$1=Q$3,ue$1=J0$1.rotr32;function G0$1(W,Y,J,X){if(W===0)return wf$1(Y,J,X);if(W===1||W===3)return Mf$1(Y,J,X);if(W===2)return xf$1(Y,J,X)}ae$3.ft_1=G0$1;function wf$1(W,Y,J){return W&Y^~W&J}ae$3.ch32=wf$1;function xf$1(W,Y,J){return W&Y^W&J^Y&J}ae$3.maj32=xf$1;function Mf$1(W,Y,J){return W^Y^J}ae$3.p32=Mf$1;function Y0$1(W){return ue$1(W,2)^ue$1(W,13)^ue$1(W,22)}ae$3.s0_256=Y0$1;function V0$2(W){return ue$1(W,6)^ue$1(W,11)^ue$1(W,25)}ae$3.s1_256=V0$2;function W0$1(W){return ue$1(W,7)^ue$1(W,18)^W>>>3}ae$3.g0_256=W0$1;function X0$1(W){return ue$1(W,17)^ue$1(W,19)^W>>>10}ae$3.g1_256=X0$1;var ar$2=Q$3,$0$1=or$2,Z0$1=ae$3,Ti$1=ar$2.rotl32,Mr$2=ar$2.sum32,ta$1=ar$2.sum32_5,ea$1=Z0$1.ft_1,Ef$1=$0$1.BlockHash,ra$1=[1518500249,1859775393,2400959708,3395469782];function he$1(){if(!(this instanceof he$1))return new he$1;Ef$1.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}ar$2.inherits(he$1,Ef$1);var ia$1=he$1;he$1.blockSize=512,he$1.outSize=160,he$1.hmacStrength=80,he$1.padLength=64,he$1.prototype._update=function(W,Y){for(var J=this.W,X=0;X<16;X++)J[X]=W[Y+X];for(;X<J.length;X++)J[X]=Ti$1(J[X-3]^J[X-8]^J[X-14]^J[X-16],1);var Me=this.h[0],Se=this.h[1],Ne=this.h[2],je=this.h[3],ke=this.h[4];for(X=0;X<J.length;X++){var De=~~(X/20),qe=ta$1(Ti$1(Me,5),ea$1(De,Se,Ne,je),ke,J[X],ra$1[De]);ke=je,je=Ne,Ne=Ti$1(Se,30),Se=Me,Me=qe}this.h[0]=Mr$2(this.h[0],Me),this.h[1]=Mr$2(this.h[1],Se),this.h[2]=Mr$2(this.h[2],Ne),this.h[3]=Mr$2(this.h[3],je),this.h[4]=Mr$2(this.h[4],ke)},he$1.prototype._digest=function(W){return W==="hex"?ar$2.toHex32(this.h,"big"):ar$2.split32(this.h,"big")};var ur$2=Q$3,na$1=or$2,hr$2=ae$3,fa$1=xr$2,ie$1=ur$2.sum32,oa$1=ur$2.sum32_4,sa$1=ur$2.sum32_5,aa$1=hr$2.ch32,ua$1=hr$2.maj32,ha$1=hr$2.s0_256,ca$1=hr$2.s1_256,la$1=hr$2.g0_256,da$1=hr$2.g1_256,Sf$1=na$1.BlockHash,pa$1=[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 ce$2(){if(!(this instanceof ce$2))return new ce$2;Sf$1.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=pa$1,this.W=new Array(64)}ur$2.inherits(ce$2,Sf$1);var If$1=ce$2;ce$2.blockSize=512,ce$2.outSize=256,ce$2.hmacStrength=192,ce$2.padLength=64,ce$2.prototype._update=function(W,Y){for(var J=this.W,X=0;X<16;X++)J[X]=W[Y+X];for(;X<J.length;X++)J[X]=oa$1(da$1(J[X-2]),J[X-7],la$1(J[X-15]),J[X-16]);var Me=this.h[0],Se=this.h[1],Ne=this.h[2],je=this.h[3],ke=this.h[4],De=this.h[5],qe=this.h[6],Ue=this.h[7];for(fa$1(this.k.length===J.length),X=0;X<J.length;X++){var Ge=sa$1(Ue,ca$1(ke),aa$1(ke,De,qe),this.k[X],J[X]),He=ie$1(ha$1(Me),ua$1(Me,Se,Ne));Ue=qe,qe=De,De=ke,ke=ie$1(je,Ge),je=Ne,Ne=Se,Se=Me,Me=ie$1(Ge,He)}this.h[0]=ie$1(this.h[0],Me),this.h[1]=ie$1(this.h[1],Se),this.h[2]=ie$1(this.h[2],Ne),this.h[3]=ie$1(this.h[3],je),this.h[4]=ie$1(this.h[4],ke),this.h[5]=ie$1(this.h[5],De),this.h[6]=ie$1(this.h[6],qe),this.h[7]=ie$1(this.h[7],Ue)},ce$2.prototype._digest=function(W){return W==="hex"?ur$2.toHex32(this.h,"big"):ur$2.split32(this.h,"big")};var Di$2=Q$3,Nf$1=If$1;function ye$2(){if(!(this instanceof ye$2))return new ye$2;Nf$1.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}Di$2.inherits(ye$2,Nf$1);var va$1=ye$2;ye$2.blockSize=512,ye$2.outSize=224,ye$2.hmacStrength=192,ye$2.padLength=64,ye$2.prototype._digest=function(W){return W==="hex"?Di$2.toHex32(this.h.slice(0,7),"big"):Di$2.split32(this.h.slice(0,7),"big")};var jt$2=Q$3,ga$1=or$2,ma$1=xr$2,le$1=jt$2.rotr64_hi,de$1=jt$2.rotr64_lo,_f$1=jt$2.shr64_hi,Bf$1=jt$2.shr64_lo,Be$1=jt$2.sum64,Fi$2=jt$2.sum64_hi,Ui$1=jt$2.sum64_lo,Aa$1=jt$2.sum64_4_hi,ba$2=jt$2.sum64_4_lo,ya$2=jt$2.sum64_5_hi,wa$1=jt$2.sum64_5_lo,Cf$1=ga$1.BlockHash,xa$1=[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 ne$2(){if(!(this instanceof ne$2))return new ne$2;Cf$1.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=xa$1,this.W=new Array(160)}jt$2.inherits(ne$2,Cf$1);var Rf$1=ne$2;ne$2.blockSize=1024,ne$2.outSize=512,ne$2.hmacStrength=192,ne$2.padLength=128,ne$2.prototype._prepareBlock=function(W,Y){for(var J=this.W,X=0;X<32;X++)J[X]=W[Y+X];for(;X<J.length;X+=2){var Me=Pa$1(J[X-4],J[X-3]),Se=Ta$2(J[X-4],J[X-3]),Ne=J[X-14],je=J[X-13],ke=Ra$2(J[X-30],J[X-29]),De=Oa$2(J[X-30],J[X-29]),qe=J[X-32],Ue=J[X-31];J[X]=Aa$1(Me,Se,Ne,je,ke,De,qe,Ue),J[X+1]=ba$2(Me,Se,Ne,je,ke,De,qe,Ue)}},ne$2.prototype._update=function(W,Y){this._prepareBlock(W,Y);var J=this.W,X=this.h[0],Me=this.h[1],Se=this.h[2],Ne=this.h[3],je=this.h[4],ke=this.h[5],De=this.h[6],qe=this.h[7],Ue=this.h[8],Ge=this.h[9],He=this.h[10],Ve=this.h[11],Ye=this.h[12],Fn=this.h[13],io=this.h[14],$o=this.h[15];ma$1(this.k.length===J.length);for(var Jo=0;Jo<J.length;Jo+=2){var rs=io,Yo=$o,zo=Ba$1(Ue,Ge),jo=Ca$1(Ue,Ge),Vo=Ma$1(Ue,Ge,He,Ve,Ye),os=Ea$1(Ue,Ge,He,Ve,Ye,Fn),us=this.k[Jo],is=this.k[Jo+1],Lo=J[Jo],Fe=J[Jo+1],Ke=ya$2(rs,Yo,zo,jo,Vo,os,us,is,Lo,Fe),Je=wa$1(rs,Yo,zo,jo,Vo,os,us,is,Lo,Fe);rs=Na$2(X,Me),Yo=_a$1(X,Me),zo=Sa$2(X,Me,Se,Ne,je),jo=Ia$1(X,Me,Se,Ne,je,ke);var wi=Fi$2(rs,Yo,zo,jo),mo=Ui$1(rs,Yo,zo,jo);io=Ye,$o=Fn,Ye=He,Fn=Ve,He=Ue,Ve=Ge,Ue=Fi$2(De,qe,Ke,Je),Ge=Ui$1(qe,qe,Ke,Je),De=je,qe=ke,je=Se,ke=Ne,Se=X,Ne=Me,X=Fi$2(Ke,Je,wi,mo),Me=Ui$1(Ke,Je,wi,mo)}Be$1(this.h,0,X,Me),Be$1(this.h,2,Se,Ne),Be$1(this.h,4,je,ke),Be$1(this.h,6,De,qe),Be$1(this.h,8,Ue,Ge),Be$1(this.h,10,He,Ve),Be$1(this.h,12,Ye,Fn),Be$1(this.h,14,io,$o)},ne$2.prototype._digest=function(W){return W==="hex"?jt$2.toHex32(this.h,"big"):jt$2.split32(this.h,"big")};function Ma$1(W,Y,J,X,Me){var Se=W&J^~W&Me;return Se<0&&(Se+=4294967296),Se}function Ea$1(W,Y,J,X,Me,Se){var Ne=Y&X^~Y&Se;return Ne<0&&(Ne+=4294967296),Ne}function Sa$2(W,Y,J,X,Me){var Se=W&J^W&Me^J&Me;return Se<0&&(Se+=4294967296),Se}function Ia$1(W,Y,J,X,Me,Se){var Ne=Y&X^Y&Se^X&Se;return Ne<0&&(Ne+=4294967296),Ne}function Na$2(W,Y){var J=le$1(W,Y,28),X=le$1(Y,W,2),Me=le$1(Y,W,7),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function _a$1(W,Y){var J=de$1(W,Y,28),X=de$1(Y,W,2),Me=de$1(Y,W,7),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Ba$1(W,Y){var J=le$1(W,Y,14),X=le$1(W,Y,18),Me=le$1(Y,W,9),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Ca$1(W,Y){var J=de$1(W,Y,14),X=de$1(W,Y,18),Me=de$1(Y,W,9),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Ra$2(W,Y){var J=le$1(W,Y,1),X=le$1(W,Y,8),Me=_f$1(W,Y,7),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Oa$2(W,Y){var J=de$1(W,Y,1),X=de$1(W,Y,8),Me=Bf$1(W,Y,7),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Pa$1(W,Y){var J=le$1(W,Y,19),X=le$1(Y,W,29),Me=_f$1(W,Y,6),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}function Ta$2(W,Y){var J=de$1(W,Y,19),X=de$1(Y,W,29),Me=Bf$1(W,Y,6),Se=J^X^Me;return Se<0&&(Se+=4294967296),Se}var ki$1=Q$3,Of$1=Rf$1;function we$3(){if(!(this instanceof we$3))return new we$3;Of$1.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}ki$1.inherits(we$3,Of$1);var Da$2=we$3;we$3.blockSize=1024,we$3.outSize=384,we$3.hmacStrength=192,we$3.padLength=128,we$3.prototype._digest=function(W){return W==="hex"?ki$1.toHex32(this.h.slice(0,12),"big"):ki$1.split32(this.h.slice(0,12),"big")},sr$2.sha1=ia$1,sr$2.sha224=va$1,sr$2.sha256=If$1,sr$2.sha384=Da$2,sr$2.sha512=Rf$1;var Pf$1={},Xe$2=Q$3,Fa$2=or$2,Kr$2=Xe$2.rotl32,Tf$1=Xe$2.sum32,Er$2=Xe$2.sum32_3,Df$1=Xe$2.sum32_4,Ff$1=Fa$2.BlockHash;function pe$1(){if(!(this instanceof pe$1))return new pe$1;Ff$1.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Xe$2.inherits(pe$1,Ff$1),Pf$1.ripemd160=pe$1,pe$1.blockSize=512,pe$1.outSize=160,pe$1.hmacStrength=192,pe$1.padLength=64,pe$1.prototype._update=function(W,Y){for(var J=this.h[0],X=this.h[1],Me=this.h[2],Se=this.h[3],Ne=this.h[4],je=J,ke=X,De=Me,qe=Se,Ue=Ne,Ge=0;Ge<80;Ge++){var He=Tf$1(Kr$2(Df$1(J,Uf$1(Ge,X,Me,Se),W[qa$2[Ge]+Y],Ua$2(Ge)),Ha$2[Ge]),Ne);J=Ne,Ne=Se,Se=Kr$2(Me,10),Me=X,X=He,He=Tf$1(Kr$2(Df$1(je,Uf$1(79-Ge,ke,De,qe),W[Ka$1[Ge]+Y],ka$1(Ge)),La$2[Ge]),Ue),je=Ue,Ue=qe,qe=Kr$2(De,10),De=ke,ke=He}He=Er$2(this.h[1],Me,qe),this.h[1]=Er$2(this.h[2],Se,Ue),this.h[2]=Er$2(this.h[3],Ne,je),this.h[3]=Er$2(this.h[4],J,ke),this.h[4]=Er$2(this.h[0],X,De),this.h[0]=He},pe$1.prototype._digest=function(W){return W==="hex"?Xe$2.toHex32(this.h,"little"):Xe$2.split32(this.h,"little")};function Uf$1(W,Y,J,X){return W<=15?Y^J^X:W<=31?Y&J|~Y&X:W<=47?(Y|~J)^X:W<=63?Y&X|J&~X:Y^(J|~X)}function Ua$2(W){return W<=15?0:W<=31?1518500249:W<=47?1859775393:W<=63?2400959708:2840853838}function ka$1(W){return W<=15?1352829926:W<=31?1548603684:W<=47?1836072691:W<=63?2053994217:0}var qa$2=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Ka$1=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ha$2=[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],La$2=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],za$1=Q$3,ja$1=xr$2;function cr$2(W,Y,J){if(!(this instanceof cr$2))return new cr$2(W,Y,J);this.Hash=W,this.blockSize=W.blockSize/8,this.outSize=W.outSize/8,this.inner=null,this.outer=null,this._init(za$1.toArray(Y,J))}var Qa$1=cr$2;cr$2.prototype._init=function(W){W.length>this.blockSize&&(W=new this.Hash().update(W).digest()),ja$1(W.length<=this.blockSize);for(var Y=W.length;Y<this.blockSize;Y++)W.push(0);for(Y=0;Y<W.length;Y++)W[Y]^=54;for(this.inner=new this.Hash().update(W),Y=0;Y<W.length;Y++)W[Y]^=106;this.outer=new this.Hash().update(W)},cr$2.prototype.update=function(W,Y){return this.inner.update(W,Y),this},cr$2.prototype.digest=function(W){return this.outer.update(this.inner.digest()),this.outer.digest(W)},function(W){var Y=W;Y.utils=Q$3,Y.common=or$2,Y.sha=sr$2,Y.ripemd=Pf$1,Y.hmac=Qa$1,Y.sha1=Y.sha.sha1,Y.sha256=Y.sha.sha256,Y.sha224=Y.sha.sha224,Y.sha384=Y.sha.sha384,Y.sha512=Y.sha.sha512,Y.ripemd160=Y.ripemd.ripemd160}(se$1);function lr$3(W,Y,J){return J={path:Y,exports:{},require:function(X,Me){return Ja$1(X,Me??J.path)}},W(J,J.exports),J.exports}function Ja$1(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var qi$2=kf;function kf(W,Y){if(!W)throw new Error(Y||"Assertion failed")}kf.equal=function(W,Y,J){if(W!=Y)throw new Error(J||"Assertion failed: "+W+" != "+Y)};var fe$2=lr$3(function(W,Y){var J=Y;function X(Ne,je){if(Array.isArray(Ne))return Ne.slice();if(!Ne)return[];var ke=[];if(typeof Ne!="string"){for(var De=0;De<Ne.length;De++)ke[De]=Ne[De]|0;return ke}if(je==="hex"){Ne=Ne.replace(/[^a-z0-9]+/ig,""),Ne.length%2!==0&&(Ne="0"+Ne);for(var De=0;De<Ne.length;De+=2)ke.push(parseInt(Ne[De]+Ne[De+1],16))}else for(var De=0;De<Ne.length;De++){var qe=Ne.charCodeAt(De),Ue=qe>>8,Ge=qe&255;Ue?ke.push(Ue,Ge):ke.push(Ge)}return ke}J.toArray=X;function Me(Ne){return Ne.length===1?"0"+Ne:Ne}J.zero2=Me;function Se(Ne){for(var je="",ke=0;ke<Ne.length;ke++)je+=Me(Ne[ke].toString(16));return je}J.toHex=Se,J.encode=function(Ne,je){return je==="hex"?Se(Ne):Ne}}),Gt$2=lr$3(function(W,Y){var J=Y;J.assert=qi$2,J.toArray=fe$2.toArray,J.zero2=fe$2.zero2,J.toHex=fe$2.toHex,J.encode=fe$2.encode;function X(ke,De,qe){var Ue=new Array(Math.max(ke.bitLength(),qe)+1);Ue.fill(0);for(var Ge=1<<De+1,He=ke.clone(),Ve=0;Ve<Ue.length;Ve++){var Ye,Fn=He.andln(Ge-1);He.isOdd()?(Fn>(Ge>>1)-1?Ye=(Ge>>1)-Fn:Ye=Fn,He.isubn(Ye)):Ye=0,Ue[Ve]=Ye,He.iushrn(1)}return Ue}J.getNAF=X;function Me(ke,De){var qe=[[],[]];ke=ke.clone(),De=De.clone();for(var Ue=0,Ge=0,He;ke.cmpn(-Ue)>0||De.cmpn(-Ge)>0;){var Ve=ke.andln(3)+Ue&3,Ye=De.andln(3)+Ge&3;Ve===3&&(Ve=-1),Ye===3&&(Ye=-1);var Fn;Ve&1?(He=ke.andln(7)+Ue&7,(He===3||He===5)&&Ye===2?Fn=-Ve:Fn=Ve):Fn=0,qe[0].push(Fn);var io;Ye&1?(He=De.andln(7)+Ge&7,(He===3||He===5)&&Ve===2?io=-Ye:io=Ye):io=0,qe[1].push(io),2*Ue===Fn+1&&(Ue=1-Ue),2*Ge===io+1&&(Ge=1-Ge),ke.iushrn(1),De.iushrn(1)}return qe}J.getJSF=Me;function Se(ke,De,qe){var Ue="_"+De;ke.prototype[De]=function(){return this[Ue]!==void 0?this[Ue]:this[Ue]=qe.call(this)}}J.cachedProperty=Se;function Ne(ke){return typeof ke=="string"?J.toArray(ke,"hex"):ke}J.parseBytes=Ne;function je(ke){return new K$2(ke,"hex","le")}J.intFromLE=je}),Hr$2=Gt$2.getNAF,Ga$1=Gt$2.getJSF,Lr$2=Gt$2.assert;function Ce$3(W,Y){this.type=W,this.p=new K$2(Y.p,16),this.red=Y.prime?K$2.red(Y.prime):K$2.mont(this.p),this.zero=new K$2(0).toRed(this.red),this.one=new K$2(1).toRed(this.red),this.two=new K$2(2).toRed(this.red),this.n=Y.n&&new K$2(Y.n,16),this.g=Y.g&&this.pointFromJSON(Y.g,Y.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 J=this.n&&this.p.div(this.n);!J||J.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var $e=Ce$3;Ce$3.prototype.point=function(){throw new Error("Not implemented")},Ce$3.prototype.validate=function(){throw new Error("Not implemented")},Ce$3.prototype._fixedNafMul=function(W,Y){Lr$2(W.precomputed);var J=W._getDoubles(),X=Hr$2(Y,1,this._bitLength),Me=(1<<J.step+1)-(J.step%2===0?2:1);Me/=3;var Se=[],Ne,je;for(Ne=0;Ne<X.length;Ne+=J.step){je=0;for(var ke=Ne+J.step-1;ke>=Ne;ke--)je=(je<<1)+X[ke];Se.push(je)}for(var De=this.jpoint(null,null,null),qe=this.jpoint(null,null,null),Ue=Me;Ue>0;Ue--){for(Ne=0;Ne<Se.length;Ne++)je=Se[Ne],je===Ue?qe=qe.mixedAdd(J.points[Ne]):je===-Ue&&(qe=qe.mixedAdd(J.points[Ne].neg()));De=De.add(qe)}return De.toP()},Ce$3.prototype._wnafMul=function(W,Y){var J=4,X=W._getNAFPoints(J);J=X.wnd;for(var Me=X.points,Se=Hr$2(Y,J,this._bitLength),Ne=this.jpoint(null,null,null),je=Se.length-1;je>=0;je--){for(var ke=0;je>=0&&Se[je]===0;je--)ke++;if(je>=0&&ke++,Ne=Ne.dblp(ke),je<0)break;var De=Se[je];Lr$2(De!==0),W.type==="affine"?De>0?Ne=Ne.mixedAdd(Me[De-1>>1]):Ne=Ne.mixedAdd(Me[-De-1>>1].neg()):De>0?Ne=Ne.add(Me[De-1>>1]):Ne=Ne.add(Me[-De-1>>1].neg())}return W.type==="affine"?Ne.toP():Ne},Ce$3.prototype._wnafMulAdd=function(W,Y,J,X,Me){var Se=this._wnafT1,Ne=this._wnafT2,je=this._wnafT3,ke=0,De,qe,Ue;for(De=0;De<X;De++){Ue=Y[De];var Ge=Ue._getNAFPoints(W);Se[De]=Ge.wnd,Ne[De]=Ge.points}for(De=X-1;De>=1;De-=2){var He=De-1,Ve=De;if(Se[He]!==1||Se[Ve]!==1){je[He]=Hr$2(J[He],Se[He],this._bitLength),je[Ve]=Hr$2(J[Ve],Se[Ve],this._bitLength),ke=Math.max(je[He].length,ke),ke=Math.max(je[Ve].length,ke);continue}var Ye=[Y[He],null,null,Y[Ve]];Y[He].y.cmp(Y[Ve].y)===0?(Ye[1]=Y[He].add(Y[Ve]),Ye[2]=Y[He].toJ().mixedAdd(Y[Ve].neg())):Y[He].y.cmp(Y[Ve].y.redNeg())===0?(Ye[1]=Y[He].toJ().mixedAdd(Y[Ve]),Ye[2]=Y[He].add(Y[Ve].neg())):(Ye[1]=Y[He].toJ().mixedAdd(Y[Ve]),Ye[2]=Y[He].toJ().mixedAdd(Y[Ve].neg()));var Fn=[-3,-1,-5,-7,0,7,5,1,3],io=Ga$1(J[He],J[Ve]);for(ke=Math.max(io[0].length,ke),je[He]=new Array(ke),je[Ve]=new Array(ke),qe=0;qe<ke;qe++){var $o=io[0][qe]|0,Jo=io[1][qe]|0;je[He][qe]=Fn[($o+1)*3+(Jo+1)],je[Ve][qe]=0,Ne[He]=Ye}}var rs=this.jpoint(null,null,null),Yo=this._wnafT4;for(De=ke;De>=0;De--){for(var zo=0;De>=0;){var jo=!0;for(qe=0;qe<X;qe++)Yo[qe]=je[qe][De]|0,Yo[qe]!==0&&(jo=!1);if(!jo)break;zo++,De--}if(De>=0&&zo++,rs=rs.dblp(zo),De<0)break;for(qe=0;qe<X;qe++){var Vo=Yo[qe];Vo!==0&&(Vo>0?Ue=Ne[qe][Vo-1>>1]:Vo<0&&(Ue=Ne[qe][-Vo-1>>1].neg()),Ue.type==="affine"?rs=rs.mixedAdd(Ue):rs=rs.add(Ue))}}for(De=0;De<X;De++)Ne[De]=null;return Me?rs:rs.toP()};function Zt$2(W,Y){this.curve=W,this.type=Y,this.precomputed=null}Ce$3.BasePoint=Zt$2,Zt$2.prototype.eq=function(){throw new Error("Not implemented")},Zt$2.prototype.validate=function(){return this.curve.validate(this)},Ce$3.prototype.decodePoint=function(W,Y){W=Gt$2.toArray(W,Y);var J=this.p.byteLength();if((W[0]===4||W[0]===6||W[0]===7)&&W.length-1===2*J){W[0]===6?Lr$2(W[W.length-1]%2===0):W[0]===7&&Lr$2(W[W.length-1]%2===1);var X=this.point(W.slice(1,1+J),W.slice(1+J,1+2*J));return X}else if((W[0]===2||W[0]===3)&&W.length-1===J)return this.pointFromX(W.slice(1,1+J),W[0]===3);throw new Error("Unknown point format")},Zt$2.prototype.encodeCompressed=function(W){return this.encode(W,!0)},Zt$2.prototype._encode=function(W){var Y=this.curve.p.byteLength(),J=this.getX().toArray("be",Y);return W?[this.getY().isEven()?2:3].concat(J):[4].concat(J,this.getY().toArray("be",Y))},Zt$2.prototype.encode=function(W,Y){return Gt$2.encode(this._encode(Y),W)},Zt$2.prototype.precompute=function(W){if(this.precomputed)return this;var Y={doubles:null,naf:null,beta:null};return Y.naf=this._getNAFPoints(8),Y.doubles=this._getDoubles(4,W),Y.beta=this._getBeta(),this.precomputed=Y,this},Zt$2.prototype._hasDoubles=function(W){if(!this.precomputed)return!1;var Y=this.precomputed.doubles;return Y?Y.points.length>=Math.ceil((W.bitLength()+1)/Y.step):!1},Zt$2.prototype._getDoubles=function(W,Y){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var J=[this],X=this,Me=0;Me<Y;Me+=W){for(var Se=0;Se<W;Se++)X=X.dbl();J.push(X)}return{step:W,points:J}},Zt$2.prototype._getNAFPoints=function(W){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var Y=[this],J=(1<<W)-1,X=J===1?null:this.dbl(),Me=1;Me<J;Me++)Y[Me]=Y[Me-1].add(X);return{wnd:W,points:Y}},Zt$2.prototype._getBeta=function(){return null},Zt$2.prototype.dblp=function(W){for(var Y=this,J=0;J<W;J++)Y=Y.dbl();return Y};var Ki$1=lr$3(function(W){typeof Object.create=="function"?W.exports=function(Y,J){J&&(Y.super_=J,Y.prototype=Object.create(J.prototype,{constructor:{value:Y,enumerable:!1,writable:!0,configurable:!0}}))}:W.exports=function(Y,J){if(J){Y.super_=J;var X=function(){};X.prototype=J.prototype,Y.prototype=new X,Y.prototype.constructor=Y}}}),Ya$1=Gt$2.assert;function te$2(W){$e.call(this,"short",W),this.a=new K$2(W.a,16).toRed(this.red),this.b=new K$2(W.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(W),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Ki$1(te$2,$e);var Va$1=te$2;te$2.prototype._getEndomorphism=function(W){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var Y,J;if(W.beta)Y=new K$2(W.beta,16).toRed(this.red);else{var X=this._getEndoRoots(this.p);Y=X[0].cmp(X[1])<0?X[0]:X[1],Y=Y.toRed(this.red)}if(W.lambda)J=new K$2(W.lambda,16);else{var Me=this._getEndoRoots(this.n);this.g.mul(Me[0]).x.cmp(this.g.x.redMul(Y))===0?J=Me[0]:(J=Me[1],Ya$1(this.g.mul(J).x.cmp(this.g.x.redMul(Y))===0))}var Se;return W.basis?Se=W.basis.map(function(Ne){return{a:new K$2(Ne.a,16),b:new K$2(Ne.b,16)}}):Se=this._getEndoBasis(J),{beta:Y,lambda:J,basis:Se}}},te$2.prototype._getEndoRoots=function(W){var Y=W===this.p?this.red:K$2.mont(W),J=new K$2(2).toRed(Y).redInvm(),X=J.redNeg(),Me=new K$2(3).toRed(Y).redNeg().redSqrt().redMul(J),Se=X.redAdd(Me).fromRed(),Ne=X.redSub(Me).fromRed();return[Se,Ne]},te$2.prototype._getEndoBasis=function(W){for(var Y=this.n.ushrn(Math.floor(this.n.bitLength()/2)),J=W,X=this.n.clone(),Me=new K$2(1),Se=new K$2(0),Ne=new K$2(0),je=new K$2(1),ke,De,qe,Ue,Ge,He,Ve,Ye=0,Fn,io;J.cmpn(0)!==0;){var $o=X.div(J);Fn=X.sub($o.mul(J)),io=Ne.sub($o.mul(Me));var Jo=je.sub($o.mul(Se));if(!qe&&Fn.cmp(Y)<0)ke=Ve.neg(),De=Me,qe=Fn.neg(),Ue=io;else if(qe&&++Ye===2)break;Ve=Fn,X=J,J=Fn,Ne=Me,Me=io,je=Se,Se=Jo}Ge=Fn.neg(),He=io;var rs=qe.sqr().add(Ue.sqr()),Yo=Ge.sqr().add(He.sqr());return Yo.cmp(rs)>=0&&(Ge=ke,He=De),qe.negative&&(qe=qe.neg(),Ue=Ue.neg()),Ge.negative&&(Ge=Ge.neg(),He=He.neg()),[{a:qe,b:Ue},{a:Ge,b:He}]},te$2.prototype._endoSplit=function(W){var Y=this.endo.basis,J=Y[0],X=Y[1],Me=X.b.mul(W).divRound(this.n),Se=J.b.neg().mul(W).divRound(this.n),Ne=Me.mul(J.a),je=Se.mul(X.a),ke=Me.mul(J.b),De=Se.mul(X.b),qe=W.sub(Ne).sub(je),Ue=ke.add(De).neg();return{k1:qe,k2:Ue}},te$2.prototype.pointFromX=function(W,Y){W=new K$2(W,16),W.red||(W=W.toRed(this.red));var J=W.redSqr().redMul(W).redIAdd(W.redMul(this.a)).redIAdd(this.b),X=J.redSqrt();if(X.redSqr().redSub(J).cmp(this.zero)!==0)throw new Error("invalid point");var Me=X.fromRed().isOdd();return(Y&&!Me||!Y&&Me)&&(X=X.redNeg()),this.point(W,X)},te$2.prototype.validate=function(W){if(W.inf)return!0;var Y=W.x,J=W.y,X=this.a.redMul(Y),Me=Y.redSqr().redMul(Y).redIAdd(X).redIAdd(this.b);return J.redSqr().redISub(Me).cmpn(0)===0},te$2.prototype._endoWnafMulAdd=function(W,Y,J){for(var X=this._endoWnafT1,Me=this._endoWnafT2,Se=0;Se<W.length;Se++){var Ne=this._endoSplit(Y[Se]),je=W[Se],ke=je._getBeta();Ne.k1.negative&&(Ne.k1.ineg(),je=je.neg(!0)),Ne.k2.negative&&(Ne.k2.ineg(),ke=ke.neg(!0)),X[Se*2]=je,X[Se*2+1]=ke,Me[Se*2]=Ne.k1,Me[Se*2+1]=Ne.k2}for(var De=this._wnafMulAdd(1,X,Me,Se*2,J),qe=0;qe<Se*2;qe++)X[qe]=null,Me[qe]=null;return De};function Dt$2(W,Y,J,X){$e.BasePoint.call(this,W,"affine"),Y===null&&J===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new K$2(Y,16),this.y=new K$2(J,16),X&&(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)}Ki$1(Dt$2,$e.BasePoint),te$2.prototype.point=function(W,Y,J){return new Dt$2(this,W,Y,J)},te$2.prototype.pointFromJSON=function(W,Y){return Dt$2.fromJSON(this,W,Y)},Dt$2.prototype._getBeta=function(){if(this.curve.endo){var W=this.precomputed;if(W&&W.beta)return W.beta;var Y=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(W){var J=this.curve,X=function(Me){return J.point(Me.x.redMul(J.endo.beta),Me.y)};W.beta=Y,Y.precomputed={beta:null,naf:W.naf&&{wnd:W.naf.wnd,points:W.naf.points.map(X)},doubles:W.doubles&&{step:W.doubles.step,points:W.doubles.points.map(X)}}}return Y}},Dt$2.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Dt$2.fromJSON=function(W,Y,J){typeof Y=="string"&&(Y=JSON.parse(Y));var X=W.point(Y[0],Y[1],J);if(!Y[2])return X;function Me(Ne){return W.point(Ne[0],Ne[1],J)}var Se=Y[2];return X.precomputed={beta:null,doubles:Se.doubles&&{step:Se.doubles.step,points:[X].concat(Se.doubles.points.map(Me))},naf:Se.naf&&{wnd:Se.naf.wnd,points:[X].concat(Se.naf.points.map(Me))}},X},Dt$2.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)+">"},Dt$2.prototype.isInfinity=function(){return this.inf},Dt$2.prototype.add=function(W){if(this.inf)return W;if(W.inf)return this;if(this.eq(W))return this.dbl();if(this.neg().eq(W))return this.curve.point(null,null);if(this.x.cmp(W.x)===0)return this.curve.point(null,null);var Y=this.y.redSub(W.y);Y.cmpn(0)!==0&&(Y=Y.redMul(this.x.redSub(W.x).redInvm()));var J=Y.redSqr().redISub(this.x).redISub(W.x),X=Y.redMul(this.x.redSub(J)).redISub(this.y);return this.curve.point(J,X)},Dt$2.prototype.dbl=function(){if(this.inf)return this;var W=this.y.redAdd(this.y);if(W.cmpn(0)===0)return this.curve.point(null,null);var Y=this.curve.a,J=this.x.redSqr(),X=W.redInvm(),Me=J.redAdd(J).redIAdd(J).redIAdd(Y).redMul(X),Se=Me.redSqr().redISub(this.x.redAdd(this.x)),Ne=Me.redMul(this.x.redSub(Se)).redISub(this.y);return this.curve.point(Se,Ne)},Dt$2.prototype.getX=function(){return this.x.fromRed()},Dt$2.prototype.getY=function(){return this.y.fromRed()},Dt$2.prototype.mul=function(W){return W=new K$2(W,16),this.isInfinity()?this:this._hasDoubles(W)?this.curve._fixedNafMul(this,W):this.curve.endo?this.curve._endoWnafMulAdd([this],[W]):this.curve._wnafMul(this,W)},Dt$2.prototype.mulAdd=function(W,Y,J){var X=[this,Y],Me=[W,J];return this.curve.endo?this.curve._endoWnafMulAdd(X,Me):this.curve._wnafMulAdd(1,X,Me,2)},Dt$2.prototype.jmulAdd=function(W,Y,J){var X=[this,Y],Me=[W,J];return this.curve.endo?this.curve._endoWnafMulAdd(X,Me,!0):this.curve._wnafMulAdd(1,X,Me,2,!0)},Dt$2.prototype.eq=function(W){return this===W||this.inf===W.inf&&(this.inf||this.x.cmp(W.x)===0&&this.y.cmp(W.y)===0)},Dt$2.prototype.neg=function(W){if(this.inf)return this;var Y=this.curve.point(this.x,this.y.redNeg());if(W&&this.precomputed){var J=this.precomputed,X=function(Me){return Me.neg()};Y.precomputed={naf:J.naf&&{wnd:J.naf.wnd,points:J.naf.points.map(X)},doubles:J.doubles&&{step:J.doubles.step,points:J.doubles.points.map(X)}}}return Y},Dt$2.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var W=this.curve.jpoint(this.x,this.y,this.curve.one);return W};function Ft$2(W,Y,J,X){$e.BasePoint.call(this,W,"jacobian"),Y===null&&J===null&&X===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new K$2(0)):(this.x=new K$2(Y,16),this.y=new K$2(J,16),this.z=new K$2(X,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Ki$1(Ft$2,$e.BasePoint),te$2.prototype.jpoint=function(W,Y,J){return new Ft$2(this,W,Y,J)},Ft$2.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var W=this.z.redInvm(),Y=W.redSqr(),J=this.x.redMul(Y),X=this.y.redMul(Y).redMul(W);return this.curve.point(J,X)},Ft$2.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ft$2.prototype.add=function(W){if(this.isInfinity())return W;if(W.isInfinity())return this;var Y=W.z.redSqr(),J=this.z.redSqr(),X=this.x.redMul(Y),Me=W.x.redMul(J),Se=this.y.redMul(Y.redMul(W.z)),Ne=W.y.redMul(J.redMul(this.z)),je=X.redSub(Me),ke=Se.redSub(Ne);if(je.cmpn(0)===0)return ke.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var De=je.redSqr(),qe=De.redMul(je),Ue=X.redMul(De),Ge=ke.redSqr().redIAdd(qe).redISub(Ue).redISub(Ue),He=ke.redMul(Ue.redISub(Ge)).redISub(Se.redMul(qe)),Ve=this.z.redMul(W.z).redMul(je);return this.curve.jpoint(Ge,He,Ve)},Ft$2.prototype.mixedAdd=function(W){if(this.isInfinity())return W.toJ();if(W.isInfinity())return this;var Y=this.z.redSqr(),J=this.x,X=W.x.redMul(Y),Me=this.y,Se=W.y.redMul(Y).redMul(this.z),Ne=J.redSub(X),je=Me.redSub(Se);if(Ne.cmpn(0)===0)return je.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ke=Ne.redSqr(),De=ke.redMul(Ne),qe=J.redMul(ke),Ue=je.redSqr().redIAdd(De).redISub(qe).redISub(qe),Ge=je.redMul(qe.redISub(Ue)).redISub(Me.redMul(De)),He=this.z.redMul(Ne);return this.curve.jpoint(Ue,Ge,He)},Ft$2.prototype.dblp=function(W){if(W===0)return this;if(this.isInfinity())return this;if(!W)return this.dbl();var Y;if(this.curve.zeroA||this.curve.threeA){var J=this;for(Y=0;Y<W;Y++)J=J.dbl();return J}var X=this.curve.a,Me=this.curve.tinv,Se=this.x,Ne=this.y,je=this.z,ke=je.redSqr().redSqr(),De=Ne.redAdd(Ne);for(Y=0;Y<W;Y++){var qe=Se.redSqr(),Ue=De.redSqr(),Ge=Ue.redSqr(),He=qe.redAdd(qe).redIAdd(qe).redIAdd(X.redMul(ke)),Ve=Se.redMul(Ue),Ye=He.redSqr().redISub(Ve.redAdd(Ve)),Fn=Ve.redISub(Ye),io=He.redMul(Fn);io=io.redIAdd(io).redISub(Ge);var $o=De.redMul(je);Y+1<W&&(ke=ke.redMul(Ge)),Se=Ye,je=$o,De=io}return this.curve.jpoint(Se,De.redMul(Me),je)},Ft$2.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ft$2.prototype._zeroDbl=function(){var W,Y,J;if(this.zOne){var X=this.x.redSqr(),Me=this.y.redSqr(),Se=Me.redSqr(),Ne=this.x.redAdd(Me).redSqr().redISub(X).redISub(Se);Ne=Ne.redIAdd(Ne);var je=X.redAdd(X).redIAdd(X),ke=je.redSqr().redISub(Ne).redISub(Ne),De=Se.redIAdd(Se);De=De.redIAdd(De),De=De.redIAdd(De),W=ke,Y=je.redMul(Ne.redISub(ke)).redISub(De),J=this.y.redAdd(this.y)}else{var qe=this.x.redSqr(),Ue=this.y.redSqr(),Ge=Ue.redSqr(),He=this.x.redAdd(Ue).redSqr().redISub(qe).redISub(Ge);He=He.redIAdd(He);var Ve=qe.redAdd(qe).redIAdd(qe),Ye=Ve.redSqr(),Fn=Ge.redIAdd(Ge);Fn=Fn.redIAdd(Fn),Fn=Fn.redIAdd(Fn),W=Ye.redISub(He).redISub(He),Y=Ve.redMul(He.redISub(W)).redISub(Fn),J=this.y.redMul(this.z),J=J.redIAdd(J)}return this.curve.jpoint(W,Y,J)},Ft$2.prototype._threeDbl=function(){var W,Y,J;if(this.zOne){var X=this.x.redSqr(),Me=this.y.redSqr(),Se=Me.redSqr(),Ne=this.x.redAdd(Me).redSqr().redISub(X).redISub(Se);Ne=Ne.redIAdd(Ne);var je=X.redAdd(X).redIAdd(X).redIAdd(this.curve.a),ke=je.redSqr().redISub(Ne).redISub(Ne);W=ke;var De=Se.redIAdd(Se);De=De.redIAdd(De),De=De.redIAdd(De),Y=je.redMul(Ne.redISub(ke)).redISub(De),J=this.y.redAdd(this.y)}else{var qe=this.z.redSqr(),Ue=this.y.redSqr(),Ge=this.x.redMul(Ue),He=this.x.redSub(qe).redMul(this.x.redAdd(qe));He=He.redAdd(He).redIAdd(He);var Ve=Ge.redIAdd(Ge);Ve=Ve.redIAdd(Ve);var Ye=Ve.redAdd(Ve);W=He.redSqr().redISub(Ye),J=this.y.redAdd(this.z).redSqr().redISub(Ue).redISub(qe);var Fn=Ue.redSqr();Fn=Fn.redIAdd(Fn),Fn=Fn.redIAdd(Fn),Fn=Fn.redIAdd(Fn),Y=He.redMul(Ve.redISub(W)).redISub(Fn)}return this.curve.jpoint(W,Y,J)},Ft$2.prototype._dbl=function(){var W=this.curve.a,Y=this.x,J=this.y,X=this.z,Me=X.redSqr().redSqr(),Se=Y.redSqr(),Ne=J.redSqr(),je=Se.redAdd(Se).redIAdd(Se).redIAdd(W.redMul(Me)),ke=Y.redAdd(Y);ke=ke.redIAdd(ke);var De=ke.redMul(Ne),qe=je.redSqr().redISub(De.redAdd(De)),Ue=De.redISub(qe),Ge=Ne.redSqr();Ge=Ge.redIAdd(Ge),Ge=Ge.redIAdd(Ge),Ge=Ge.redIAdd(Ge);var He=je.redMul(Ue).redISub(Ge),Ve=J.redAdd(J).redMul(X);return this.curve.jpoint(qe,He,Ve)},Ft$2.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var W=this.x.redSqr(),Y=this.y.redSqr(),J=this.z.redSqr(),X=Y.redSqr(),Me=W.redAdd(W).redIAdd(W),Se=Me.redSqr(),Ne=this.x.redAdd(Y).redSqr().redISub(W).redISub(X);Ne=Ne.redIAdd(Ne),Ne=Ne.redAdd(Ne).redIAdd(Ne),Ne=Ne.redISub(Se);var je=Ne.redSqr(),ke=X.redIAdd(X);ke=ke.redIAdd(ke),ke=ke.redIAdd(ke),ke=ke.redIAdd(ke);var De=Me.redIAdd(Ne).redSqr().redISub(Se).redISub(je).redISub(ke),qe=Y.redMul(De);qe=qe.redIAdd(qe),qe=qe.redIAdd(qe);var Ue=this.x.redMul(je).redISub(qe);Ue=Ue.redIAdd(Ue),Ue=Ue.redIAdd(Ue);var Ge=this.y.redMul(De.redMul(ke.redISub(De)).redISub(Ne.redMul(je)));Ge=Ge.redIAdd(Ge),Ge=Ge.redIAdd(Ge),Ge=Ge.redIAdd(Ge);var He=this.z.redAdd(Ne).redSqr().redISub(J).redISub(je);return this.curve.jpoint(Ue,Ge,He)},Ft$2.prototype.mul=function(W,Y){return W=new K$2(W,Y),this.curve._wnafMul(this,W)},Ft$2.prototype.eq=function(W){if(W.type==="affine")return this.eq(W.toJ());if(this===W)return!0;var Y=this.z.redSqr(),J=W.z.redSqr();if(this.x.redMul(J).redISub(W.x.redMul(Y)).cmpn(0)!==0)return!1;var X=Y.redMul(this.z),Me=J.redMul(W.z);return this.y.redMul(Me).redISub(W.y.redMul(X)).cmpn(0)===0},Ft$2.prototype.eqXToP=function(W){var Y=this.z.redSqr(),J=W.toRed(this.curve.red).redMul(Y);if(this.x.cmp(J)===0)return!0;for(var X=W.clone(),Me=this.curve.redN.redMul(Y);;){if(X.iadd(this.curve.n),X.cmp(this.curve.p)>=0)return!1;if(J.redIAdd(Me),this.x.cmp(J)===0)return!0}},Ft$2.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)+">"},Ft$2.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var zr$2=lr$3(function(W,Y){var J=Y;J.base=$e,J.short=Va$1,J.mont=null,J.edwards=null}),jr$2=lr$3(function(W,Y){var J=Y,X=Gt$2.assert;function Me(je){je.type==="short"?this.curve=new zr$2.short(je):je.type==="edwards"?this.curve=new zr$2.edwards(je):this.curve=new zr$2.mont(je),this.g=this.curve.g,this.n=this.curve.n,this.hash=je.hash,X(this.g.validate(),"Invalid curve"),X(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}J.PresetCurve=Me;function Se(je,ke){Object.defineProperty(J,je,{configurable:!0,enumerable:!0,get:function(){var De=new Me(ke);return Object.defineProperty(J,je,{configurable:!0,enumerable:!0,value:De}),De}})}Se("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:se$1.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),Se("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:se$1.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),Se("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:se$1.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),Se("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:se$1.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"]}),Se("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:se$1.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"]}),Se("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:se$1.sha256,gRed:!1,g:["9"]}),Se("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:se$1.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var Ne;try{Ne=null.crash()}catch{Ne=void 0}Se("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:se$1.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",Ne]})});function Re$1(W){if(!(this instanceof Re$1))return new Re$1(W);this.hash=W.hash,this.predResist=!!W.predResist,this.outLen=this.hash.outSize,this.minEntropy=W.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var Y=fe$2.toArray(W.entropy,W.entropyEnc||"hex"),J=fe$2.toArray(W.nonce,W.nonceEnc||"hex"),X=fe$2.toArray(W.pers,W.persEnc||"hex");qi$2(Y.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(Y,J,X)}var qf$1=Re$1;Re$1.prototype._init=function(W,Y,J){var X=W.concat(Y).concat(J);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var Me=0;Me<this.V.length;Me++)this.K[Me]=0,this.V[Me]=1;this._update(X),this._reseed=1,this.reseedInterval=281474976710656},Re$1.prototype._hmac=function(){return new se$1.hmac(this.hash,this.K)},Re$1.prototype._update=function(W){var Y=this._hmac().update(this.V).update([0]);W&&(Y=Y.update(W)),this.K=Y.digest(),this.V=this._hmac().update(this.V).digest(),W&&(this.K=this._hmac().update(this.V).update([1]).update(W).digest(),this.V=this._hmac().update(this.V).digest())},Re$1.prototype.reseed=function(W,Y,J,X){typeof Y!="string"&&(X=J,J=Y,Y=null),W=fe$2.toArray(W,Y),J=fe$2.toArray(J,X),qi$2(W.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(W.concat(J||[])),this._reseed=1},Re$1.prototype.generate=function(W,Y,J,X){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof Y!="string"&&(X=J,J=Y,Y=null),J&&(J=fe$2.toArray(J,X||"hex"),this._update(J));for(var Me=[];Me.length<W;)this.V=this._hmac().update(this.V).digest(),Me=Me.concat(this.V);var Se=Me.slice(0,W);return this._update(J),this._reseed++,fe$2.encode(Se,Y)};var Hi$1=Gt$2.assert;function kt$2(W,Y){this.ec=W,this.priv=null,this.pub=null,Y.priv&&this._importPrivate(Y.priv,Y.privEnc),Y.pub&&this._importPublic(Y.pub,Y.pubEnc)}var Li$1=kt$2;kt$2.fromPublic=function(W,Y,J){return Y instanceof kt$2?Y:new kt$2(W,{pub:Y,pubEnc:J})},kt$2.fromPrivate=function(W,Y,J){return Y instanceof kt$2?Y:new kt$2(W,{priv:Y,privEnc:J})},kt$2.prototype.validate=function(){var W=this.getPublic();return W.isInfinity()?{result:!1,reason:"Invalid public key"}:W.validate()?W.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"}},kt$2.prototype.getPublic=function(W,Y){return typeof W=="string"&&(Y=W,W=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),Y?this.pub.encode(Y,W):this.pub},kt$2.prototype.getPrivate=function(W){return W==="hex"?this.priv.toString(16,2):this.priv},kt$2.prototype._importPrivate=function(W,Y){this.priv=new K$2(W,Y||16),this.priv=this.priv.umod(this.ec.curve.n)},kt$2.prototype._importPublic=function(W,Y){if(W.x||W.y){this.ec.curve.type==="mont"?Hi$1(W.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Hi$1(W.x&&W.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(W.x,W.y);return}this.pub=this.ec.curve.decodePoint(W,Y)},kt$2.prototype.derive=function(W){return W.validate()||Hi$1(W.validate(),"public point not validated"),W.mul(this.priv).getX()},kt$2.prototype.sign=function(W,Y,J){return this.ec.sign(W,this,Y,J)},kt$2.prototype.verify=function(W,Y){return this.ec.verify(W,Y,this)},kt$2.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Wa$1=Gt$2.assert;function Qr$2(W,Y){if(W instanceof Qr$2)return W;this._importDER(W,Y)||(Wa$1(W.r&&W.s,"Signature without r or s"),this.r=new K$2(W.r,16),this.s=new K$2(W.s,16),W.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=W.recoveryParam)}var Jr$2=Qr$2;function Xa(){this.place=0}function zi$1(W,Y){var J=W[Y.place++];if(!(J&128))return J;var X=J&15;if(X===0||X>4)return!1;for(var Me=0,Se=0,Ne=Y.place;Se<X;Se++,Ne++)Me<<=8,Me|=W[Ne],Me>>>=0;return Me<=127?!1:(Y.place=Ne,Me)}function Kf(W){for(var Y=0,J=W.length-1;!W[Y]&&!(W[Y+1]&128)&&Y<J;)Y++;return Y===0?W:W.slice(Y)}Qr$2.prototype._importDER=function(W,Y){W=Gt$2.toArray(W,Y);var J=new Xa;if(W[J.place++]!==48)return!1;var X=zi$1(W,J);if(X===!1||X+J.place!==W.length||W[J.place++]!==2)return!1;var Me=zi$1(W,J);if(Me===!1)return!1;var Se=W.slice(J.place,Me+J.place);if(J.place+=Me,W[J.place++]!==2)return!1;var Ne=zi$1(W,J);if(Ne===!1||W.length!==Ne+J.place)return!1;var je=W.slice(J.place,Ne+J.place);if(Se[0]===0)if(Se[1]&128)Se=Se.slice(1);else return!1;if(je[0]===0)if(je[1]&128)je=je.slice(1);else return!1;return this.r=new K$2(Se),this.s=new K$2(je),this.recoveryParam=null,!0};function ji(W,Y){if(Y<128){W.push(Y);return}var J=1+(Math.log(Y)/Math.LN2>>>3);for(W.push(J|128);--J;)W.push(Y>>>(J<<3)&255);W.push(Y)}Qr$2.prototype.toDER=function(W){var Y=this.r.toArray(),J=this.s.toArray();for(Y[0]&128&&(Y=[0].concat(Y)),J[0]&128&&(J=[0].concat(J)),Y=Kf(Y),J=Kf(J);!J[0]&&!(J[1]&128);)J=J.slice(1);var X=[2];ji(X,Y.length),X=X.concat(Y),X.push(2),ji(X,J.length);var Me=X.concat(J),Se=[48];return ji(Se,Me.length),Se=Se.concat(Me),Gt$2.encode(Se,W)};var $a$1=function(){throw new Error("unsupported")},Hf=Gt$2.assert;function ee$2(W){if(!(this instanceof ee$2))return new ee$2(W);typeof W=="string"&&(Hf(Object.prototype.hasOwnProperty.call(jr$2,W),"Unknown curve "+W),W=jr$2[W]),W instanceof jr$2.PresetCurve&&(W={curve:W}),this.curve=W.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=W.curve.g,this.g.precompute(W.curve.n.bitLength()+1),this.hash=W.hash||W.curve.hash}var Za=ee$2;ee$2.prototype.keyPair=function(W){return new Li$1(this,W)},ee$2.prototype.keyFromPrivate=function(W,Y){return Li$1.fromPrivate(this,W,Y)},ee$2.prototype.keyFromPublic=function(W,Y){return Li$1.fromPublic(this,W,Y)},ee$2.prototype.genKeyPair=function(W){W||(W={});for(var Y=new qf$1({hash:this.hash,pers:W.pers,persEnc:W.persEnc||"utf8",entropy:W.entropy||$a$1(this.hash.hmacStrength),entropyEnc:W.entropy&&W.entropyEnc||"utf8",nonce:this.n.toArray()}),J=this.n.byteLength(),X=this.n.sub(new K$2(2));;){var Me=new K$2(Y.generate(J));if(!(Me.cmp(X)>0))return Me.iaddn(1),this.keyFromPrivate(Me)}},ee$2.prototype._truncateToN=function(W,Y){var J=W.byteLength()*8-this.n.bitLength();return J>0&&(W=W.ushrn(J)),!Y&&W.cmp(this.n)>=0?W.sub(this.n):W},ee$2.prototype.sign=function(W,Y,J,X){typeof J=="object"&&(X=J,J=null),X||(X={}),Y=this.keyFromPrivate(Y,J),W=this._truncateToN(new K$2(W,16));for(var Me=this.n.byteLength(),Se=Y.getPrivate().toArray("be",Me),Ne=W.toArray("be",Me),je=new qf$1({hash:this.hash,entropy:Se,nonce:Ne,pers:X.pers,persEnc:X.persEnc||"utf8"}),ke=this.n.sub(new K$2(1)),De=0;;De++){var qe=X.k?X.k(De):new K$2(je.generate(this.n.byteLength()));if(qe=this._truncateToN(qe,!0),!(qe.cmpn(1)<=0||qe.cmp(ke)>=0)){var Ue=this.g.mul(qe);if(!Ue.isInfinity()){var Ge=Ue.getX(),He=Ge.umod(this.n);if(He.cmpn(0)!==0){var Ve=qe.invm(this.n).mul(He.mul(Y.getPrivate()).iadd(W));if(Ve=Ve.umod(this.n),Ve.cmpn(0)!==0){var Ye=(Ue.getY().isOdd()?1:0)|(Ge.cmp(He)!==0?2:0);return X.canonical&&Ve.cmp(this.nh)>0&&(Ve=this.n.sub(Ve),Ye^=1),new Jr$2({r:He,s:Ve,recoveryParam:Ye})}}}}}},ee$2.prototype.verify=function(W,Y,J,X){W=this._truncateToN(new K$2(W,16)),J=this.keyFromPublic(J,X),Y=new Jr$2(Y,"hex");var Me=Y.r,Se=Y.s;if(Me.cmpn(1)<0||Me.cmp(this.n)>=0||Se.cmpn(1)<0||Se.cmp(this.n)>=0)return!1;var Ne=Se.invm(this.n),je=Ne.mul(W).umod(this.n),ke=Ne.mul(Me).umod(this.n),De;return this.curve._maxwellTrick?(De=this.g.jmulAdd(je,J.getPublic(),ke),De.isInfinity()?!1:De.eqXToP(Me)):(De=this.g.mulAdd(je,J.getPublic(),ke),De.isInfinity()?!1:De.getX().umod(this.n).cmp(Me)===0)},ee$2.prototype.recoverPubKey=function(W,Y,J,X){Hf((3&J)===J,"The recovery param is more than two bits"),Y=new Jr$2(Y,X);var Me=this.n,Se=new K$2(W),Ne=Y.r,je=Y.s,ke=J&1,De=J>>1;if(Ne.cmp(this.curve.p.umod(this.curve.n))>=0&&De)throw new Error("Unable to find sencond key candinate");De?Ne=this.curve.pointFromX(Ne.add(this.curve.n),ke):Ne=this.curve.pointFromX(Ne,ke);var qe=Y.r.invm(Me),Ue=Me.sub(Se).mul(qe).umod(Me),Ge=je.mul(qe).umod(Me);return this.g.mulAdd(Ue,Ne,Ge)},ee$2.prototype.getKeyRecoveryParam=function(W,Y,J,X){if(Y=new Jr$2(Y,X),Y.recoveryParam!==null)return Y.recoveryParam;for(var Me=0;Me<4;Me++){var Se;try{Se=this.recoverPubKey(W,Y,Me)}catch{continue}if(Se.eq(J))return Me}throw new Error("Unable to find valid recovery factor")};var tu=lr$3(function(W,Y){var J=Y;J.version="6.5.4",J.utils=Gt$2,J.rand=function(){throw new Error("unsupported")},J.curve=zr$2,J.curves=jr$2,J.ec=Za,J.eddsa=null}),eu=tu.ec;const ru="signing-key/5.7.0",Qi=new z$4(ru);let Ji=null;function ve$1(){return Ji||(Ji=new eu("secp256k1")),Ji}class iu{constructor(Y){wr$1(this,"curve","secp256k1"),wr$1(this,"privateKey",Kt$2(Y)),Us$1(this.privateKey)!==32&&Qi.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const J=ve$1().keyFromPrivate(Ot$2(this.privateKey));wr$1(this,"publicKey","0x"+J.getPublic(!1,"hex")),wr$1(this,"compressedPublicKey","0x"+J.getPublic(!0,"hex")),wr$1(this,"_isSigningKey",!0)}_addPoint(Y){const J=ve$1().keyFromPublic(Ot$2(this.publicKey)),X=ve$1().keyFromPublic(Ot$2(Y));return"0x"+J.pub.add(X.pub).encodeCompressed("hex")}signDigest(Y){const J=ve$1().keyFromPrivate(Ot$2(this.privateKey)),X=Ot$2(Y);X.length!==32&&Qi.throwArgumentError("bad digest length","digest",Y);const Me=J.sign(X,{canonical:!0});return Wn$1({recoveryParam:Me.recoveryParam,r:oe$3("0x"+Me.r.toString(16),32),s:oe$3("0x"+Me.s.toString(16),32)})}computeSharedSecret(Y){const J=ve$1().keyFromPrivate(Ot$2(this.privateKey)),X=ve$1().keyFromPublic(Ot$2(Lf(Y)));return oe$3("0x"+J.derive(X.getPublic()).toString(16),32)}static isSigningKey(Y){return!!(Y&&Y._isSigningKey)}}function nu(W,Y){const J=Wn$1(Y),X={r:Ot$2(J.r),s:Ot$2(J.s)};return"0x"+ve$1().recoverPubKey(Ot$2(W),X,J.recoveryParam).encode("hex",!1)}function Lf(W,Y){const J=Ot$2(W);return J.length===32?new iu(J).publicKey:J.length===33?"0x"+ve$1().keyFromPublic(J).getPublic(!1,"hex"):J.length===65?Kt$2(J):Qi.throwArgumentError("invalid public or private key","key","[REDACTED]")}var zf;(function(W){W[W.legacy=0]="legacy",W[W.eip2930=1]="eip2930",W[W.eip1559=2]="eip1559"})(zf||(zf={}));function ou(W){const Y=Lf(W);return v0$1(Vn$1(Ii$1(Vn$1(Y,1)),12))}function su(W,Y){return ou(nu(Ot$2(W),Y))}const au="https://rpc.walletconnect.org/v1";async function jf(W,Y,J,X,Me,Se){switch(J.t){case"eip191":return Qf(W,Y,J.s);case"eip1271":return await Jf(W,Y,J.s,X,Me,Se);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${J.t}`)}}function Qf(W,Y,J){return su(df$1(Y),J).toLowerCase()===W.toLowerCase()}async function Jf(W,Y,J,X,Me,Se){try{const Ne="0x1626ba7e",je="0000000000000000000000000000000000000000000000000000000000000040",ke="0000000000000000000000000000000000000000000000000000000000000041",De=J.substring(2),qe=df$1(Y).substring(2),Ue=Ne+qe+je+ke+De,Ge=await fetch(`${Se||au}/?chainId=${X}&projectId=${Me}`,{method:"POST",body:JSON.stringify({id:uu(),jsonrpc:"2.0",method:"eth_call",params:[{to:W,data:Ue},"latest"]})}),{result:He}=await Ge.json();return He?He.slice(0,Ne.length).toLowerCase()===Ne.toLowerCase():!1}catch(Ne){return console.error("isValidEip1271Signature: ",Ne),!1}}function uu(){return Date.now()+Math.floor(Math.random()*1e3)}var hu$1=Object.defineProperty,cu=Object.defineProperties,lu=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertySymbols,du=Object.prototype.hasOwnProperty,pu=Object.prototype.propertyIsEnumerable,Yf=(W,Y,J)=>Y in W?hu$1(W,Y,{enumerable:!0,configurable:!0,writable:!0,value:J}):W[Y]=J,Gi$1=(W,Y)=>{for(var J in Y||(Y={}))du.call(Y,J)&&Yf(W,J,Y[J]);if(Gf)for(var J of Gf(Y))pu.call(Y,J)&&Yf(W,J,Y[J]);return W},Vf=(W,Y)=>cu(W,lu(Y));const vu="did:pkh:",Gr$2=W=>W==null?void 0:W.split(":"),Yi$1=W=>{const Y=W&&Gr$2(W);if(Y)return W.includes(vu)?Y[3]:Y[1]},gu=W=>{const Y=W&&Gr$2(W);if(Y)return Y[2]+":"+Y[3]},Vi=W=>{const Y=W&&Gr$2(W);if(Y)return Y.pop()};async function mu(W){const{cacao:Y,projectId:J}=W,{s:X,p:Me}=Y,Se=Wf(Me,Me.iss),Ne=Vi(Me.iss);return await jf(Ne,Se,X,Yi$1(Me.iss),J)}const Wf=(W,Y)=>{const J=`${W.domain} wants you to sign in with your Ethereum account:`,X=Vi(Y);if(!W.aud&&!W.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let Me=W.statement||void 0;const Se=`URI: ${W.aud||W.uri}`,Ne=`Version: ${W.version}`,je=`Chain ID: ${Yi$1(Y)}`,ke=`Nonce: ${W.nonce}`,De=`Issued At: ${W.iat}`,qe=W.exp?`Expiration Time: ${W.exp}`:void 0,Ue=W.nbf?`Not Before: ${W.nbf}`:void 0,Ge=W.requestId?`Request ID: ${W.requestId}`:void 0,He=W.resources?`Resources:${W.resources.map(Ye=>`
- ${Ye}`).join("")}`:void 0,Ve=Vr$1(W.resources);if(Ve){const Ye=Oe(Ve);Me=$i(Me,Ye)}return[J,X,"",Me,"",Se,Ne,je,ke,De,qe,Ue,Ge,He].filter(Ye=>Ye!=null).join(`
`)};function to(W){return Buffer.from(JSON.stringify(W)).toString("base64")}function eo(W){return JSON.parse(Buffer.from(W,"base64").toString("utf-8"))}function ge(W){if(!W)throw new Error("No recap provided, value is undefined");if(!W.att)throw new Error("No `att` property found");const Y=Object.keys(W.att);if(!(Y!=null&&Y.length))throw new Error("No resources found in `att` property");Y.forEach(J=>{const X=W.att[J];if(Array.isArray(X))throw new Error(`Resource must be an object: ${J}`);if(typeof X!="object")throw new Error(`Resource must be an object: ${J}`);if(!Object.keys(X).length)throw new Error(`Resource object is empty: ${J}`);Object.keys(X).forEach(Me=>{const Se=X[Me];if(!Array.isArray(Se))throw new Error(`Ability limits ${Me} must be an array of objects, found: ${Se}`);if(!Se.length)throw new Error(`Value of ${Me} is empty array, must be an array with objects`);Se.forEach(Ne=>{if(typeof Ne!="object")throw new Error(`Ability limits (${Me}) must be an array of objects, found: ${Ne}`)})})})}function ro(W,Y,J,X={}){return J==null||J.sort((Me,Se)=>Me.localeCompare(Se)),{att:{[W]:Wi$1(Y,J,X)}}}function Wi$1(W,Y,J={}){Y=Y==null?void 0:Y.sort((Me,Se)=>Me.localeCompare(Se));const X=Y.map(Me=>({[`${W}/${Me}`]:[J]}));return Object.assign({},...X)}function Yr$1(W){return ge(W),`urn:recap:${to(W).replace(/=/g,"")}`}function Oe(W){const Y=eo(W.replace("urn:recap:",""));return ge(Y),Y}function xu(W,Y,J){const X=ro(W,Y,J);return Yr$1(X)}function Xi(W){return W&&W.includes("urn:recap:")}function Mu(W,Y){const J=Oe(W),X=Oe(Y),Me=no(J,X);return Yr$1(Me)}function no(W,Y){ge(W),ge(Y);const J=Object.keys(W.att).concat(Object.keys(Y.att)).sort((Me,Se)=>Me.localeCompare(Se)),X={att:{}};return J.forEach(Me=>{var Se,Ne;Object.keys(((Se=W.att)==null?void 0:Se[Me])||{}).concat(Object.keys(((Ne=Y.att)==null?void 0:Ne[Me])||{})).sort((je,ke)=>je.localeCompare(ke)).forEach(je=>{var ke,De;X.att[Me]=Vf(Gi$1({},X.att[Me]),{[je]:((ke=W.att[Me])==null?void 0:ke[je])||((De=Y.att[Me])==null?void 0:De[je])})})}),X}function $i(W="",Y){ge(Y);const J="I further authorize the stated URI to perform the following actions on my behalf: ";if(W.includes(J))return W;const X=[];let Me=0;Object.keys(Y.att).forEach(je=>{const ke=Object.keys(Y.att[je]).map(Ue=>({ability:Ue.split("/")[0],action:Ue.split("/")[1]}));ke.sort((Ue,Ge)=>Ue.action.localeCompare(Ge.action));const De={};ke.forEach(Ue=>{De[Ue.ability]||(De[Ue.ability]=[]),De[Ue.ability].push(Ue.action)});const qe=Object.keys(De).map(Ue=>(Me++,`(${Me}) '${Ue}': '${De[Ue].join("', '")}' for '${je}'.`));X.push(qe.join(", ").replace(".,","."))});const Se=X.join(" "),Ne=`${J}${Se}`;return`${W?W+" ":""}${Ne}`}function Eu(W){var Y;const J=Oe(W);ge(J);const X=(Y=J.att)==null?void 0:Y.eip155;return X?Object.keys(X).map(Me=>Me.split("/")[1]):[]}function Su(W){const Y=Oe(W);ge(Y);const J=[];return Object.values(Y.att).forEach(X=>{Object.values(X).forEach(Me=>{var Se;(Se=Me==null?void 0:Me[0])!=null&&Se.chains&&J.push(Me[0].chains)})}),[...new Set(J.flat())]}function Vr$1(W){if(!W)return;const Y=W==null?void 0:W[W.length-1];return Xi(Y)?Y:void 0}const Zi="base10",Lt$2="base16",tn$1="base64pad",Iu="base64url",dr$2="utf8",en$1=0,pr$2=1,Sr$1=2,Nu=0,oo=1,Ir$1=12,rn$1=32;function _u(){const W=x25519Exports.generateKeyPair();return{privateKey:toString(W.secretKey,Lt$2),publicKey:toString(W.publicKey,Lt$2)}}function Bu(){const W=randomExports.randomBytes(rn$1);return toString(W,Lt$2)}function Cu(W,Y){const J=x25519Exports.sharedKey(fromString(W,Lt$2),fromString(Y,Lt$2),!0),X=new hkdfExports.HKDF(sha256Exports.SHA256,J).expand(rn$1);return toString(X,Lt$2)}function Ru(W){const Y=sha256Exports.hash(fromString(W,Lt$2));return toString(Y,Lt$2)}function Ou(W){const Y=sha256Exports.hash(fromString(W,dr$2));return toString(Y,Lt$2)}function nn$1(W){return fromString(`${W}`,Zi)}function Ze$2(W){return Number(toString(W,Zi))}function Pu(W){const Y=nn$1(typeof W.type<"u"?W.type:en$1);if(Ze$2(Y)===pr$2&&typeof W.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const J=typeof W.senderPublicKey<"u"?fromString(W.senderPublicKey,Lt$2):void 0,X=typeof W.iv<"u"?fromString(W.iv,Lt$2):randomExports.randomBytes(Ir$1),Me=new chacha20poly1305Exports.ChaCha20Poly1305(fromString(W.symKey,Lt$2)).seal(X,fromString(W.message,dr$2));return fn$1({type:Y,sealed:Me,iv:X,senderPublicKey:J,encoding:W.encoding})}function Tu(W,Y){const J=nn$1(Sr$1),X=randomExports.randomBytes(Ir$1),Me=fromString(W,dr$2);return fn$1({type:J,sealed:Me,iv:X,encoding:Y})}function Du(W){const Y=new chacha20poly1305Exports.ChaCha20Poly1305(fromString(W.symKey,Lt$2)),{sealed:J,iv:X}=Wr$1({encoded:W.encoded,encoding:W==null?void 0:W.encoding}),Me=Y.open(X,J);if(Me===null)throw new Error("Failed to decrypt");return toString(Me,dr$2)}function Fu(W,Y){const{sealed:J}=Wr$1({encoded:W,encoding:Y});return toString(J,dr$2)}function fn$1(W){const{encoding:Y=tn$1}=W;if(Ze$2(W.type)===Sr$1)return toString(concat([W.type,W.sealed]),Y);if(Ze$2(W.type)===pr$2){if(typeof W.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return toString(concat([W.type,W.senderPublicKey,W.iv,W.sealed]),Y)}return toString(concat([W.type,W.iv,W.sealed]),Y)}function Wr$1(W){const{encoded:Y,encoding:J=tn$1}=W,X=fromString(Y,J),Me=X.slice(Nu,oo),Se=oo;if(Ze$2(Me)===pr$2){const De=Se+rn$1,qe=De+Ir$1,Ue=X.slice(Se,De),Ge=X.slice(De,qe),He=X.slice(qe);return{type:Me,sealed:He,iv:Ge,senderPublicKey:Ue}}if(Ze$2(Me)===Sr$1){const De=X.slice(Se),qe=randomExports.randomBytes(Ir$1);return{type:Me,sealed:De,iv:qe}}const Ne=Se+Ir$1,je=X.slice(Se,Ne),ke=X.slice(Ne);return{type:Me,sealed:ke,iv:je}}function Uu(W,Y){const J=Wr$1({encoded:W,encoding:Y==null?void 0:Y.encoding});return so({type:Ze$2(J.type),senderPublicKey:typeof J.senderPublicKey<"u"?toString(J.senderPublicKey,Lt$2):void 0,receiverPublicKey:Y==null?void 0:Y.receiverPublicKey})}function so(W){const Y=(W==null?void 0:W.type)||en$1;if(Y===pr$2){if(typeof(W==null?void 0:W.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(W==null?void 0:W.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:Y,senderPublicKey:W==null?void 0:W.senderPublicKey,receiverPublicKey:W==null?void 0:W.receiverPublicKey}}function ku(W){return W.type===pr$2&&typeof W.senderPublicKey=="string"&&typeof W.receiverPublicKey=="string"}function qu(W){return W.type===Sr$1}function ao(W){return new ellipticExports.ec("p256").keyFromPublic({x:Buffer.from(W.x,"base64").toString("hex"),y:Buffer.from(W.y,"base64").toString("hex")},"hex")}function Ku(W){let Y=W.replace(/-/g,"+").replace(/_/g,"/");const J=Y.length%4;return J>0&&(Y+="=".repeat(4-J)),Y}function Hu(W){return Buffer.from(Ku(W),"base64")}function Lu(W,Y){const[J,X,Me]=W.split("."),Se=Hu(Me);if(Se.length!==64)throw new Error("Invalid signature length");const Ne=Se.slice(0,32).toString("hex"),je=Se.slice(32,64).toString("hex"),ke=`${J}.${X}`,De=new sha256Exports.SHA256().update(Buffer.from(ke)).digest(),qe=ao(Y),Ue=Buffer.from(De).toString("hex");if(!qe.verify(Ue,{r:Ne,s:je}))throw new Error("Invalid signature");return decodeJWT(W).payload}const uo="irn";function zu(W){return(W==null?void 0:W.relay)||{protocol:uo}}function ju(W){const Y=C$2[W];if(typeof Y>"u")throw new Error(`Relay Protocol not supported: ${W}`);return Y}var Qu=Object.defineProperty,Ju=Object.defineProperties,Gu=Object.getOwnPropertyDescriptors,ho=Object.getOwnPropertySymbols,Yu=Object.prototype.hasOwnProperty,Vu=Object.prototype.propertyIsEnumerable,co=(W,Y,J)=>Y in W?Qu(W,Y,{enumerable:!0,configurable:!0,writable:!0,value:J}):W[Y]=J,lo=(W,Y)=>{for(var J in Y||(Y={}))Yu.call(Y,J)&&co(W,J,Y[J]);if(ho)for(var J of ho(Y))Vu.call(Y,J)&&co(W,J,Y[J]);return W},Wu=(W,Y)=>Ju(W,Gu(Y));function po(W,Y="-"){const J={},X="relay"+Y;return Object.keys(W).forEach(Me=>{if(Me.startsWith(X)){const Se=Me.replace(X,""),Ne=W[Me];J[Se]=Ne}}),J}function Xu(W){if(!W.includes("wc:")){const ke=xi$1(W);ke!=null&&ke.includes("wc:")&&(W=ke)}W=W.includes("wc://")?W.replace("wc://",""):W,W=W.includes("wc:")?W.replace("wc:",""):W;const Y=W.indexOf(":"),J=W.indexOf("?")!==-1?W.indexOf("?"):void 0,X=W.substring(0,Y),Me=W.substring(Y+1,J).split("@"),Se=typeof J<"u"?W.substring(J):"",Ne=queryStringExports.parse(Se),je=typeof Ne.methods=="string"?Ne.methods.split(","):void 0;return{protocol:X,topic:vo(Me[0]),version:parseInt(Me[1],10),symKey:Ne.symKey,relay:po(Ne),methods:je,expiryTimestamp:Ne.expiryTimestamp?parseInt(Ne.expiryTimestamp,10):void 0}}function vo(W){return W.startsWith("//")?W.substring(2):W}function go(W,Y="-"){const J="relay",X={};return Object.keys(W).forEach(Me=>{const Se=J+Y+Me;W[Me]&&(X[Se]=W[Me])}),X}function $u(W){return`${W.protocol}:${W.topic}@${W.version}?`+queryStringExports.stringify(lo(Wu(lo({symKey:W.symKey},go(W.relay)),{expiryTimestamp:W.expiryTimestamp}),W.methods?{methods:W.methods.join(",")}:{}))}function Zu(W,Y,J){return`${W}?wc_ev=${J}&topic=${Y}`}function tr$1(W){const Y=[];return W.forEach(J=>{const[X,Me]=J.split(":");Y.push(`${X}:${Me}`)}),Y}function bo(W){const Y=[];return Object.values(W).forEach(J=>{Y.push(...tr$1(J.accounts))}),Y}function yo(W,Y){const J=[];return Object.values(W).forEach(X=>{tr$1(X.accounts).includes(Y)&&J.push(...X.methods)}),J}function wo(W,Y){const J=[];return Object.values(W).forEach(X=>{tr$1(X.accounts).includes(Y)&&J.push(...X.events)}),J}function on$1(W){return W.includes(":")}function xo(W){return on$1(W)?W.split(":")[0]:W}function Mo(W){const Y={};return W==null||W.forEach(J=>{const[X,Me]=J.split(":");Y[X]||(Y[X]={accounts:[],chains:[],events:[]}),Y[X].accounts.push(J),Y[X].chains.push(`${X}:${Me}`)}),Y}function uh(W,Y){Y=Y.map(X=>X.replace("did:pkh:",""));const J=Mo(Y);for(const[X,Me]of Object.entries(J))Me.methods?Me.methods=me$1(Me.methods,W):Me.methods=W,Me.events=["chainChanged","accountsChanged"];return J}const Eo={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},So={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function xe$1(W,Y){const{message:J,code:X}=So[W];return{message:Y?`${J} ${Y}`:J,code:X}}function er$1(W,Y){const{message:J,code:X}=Eo[W];return{message:Y?`${J} ${Y}`:J,code:X}}function Nr$1(W,Y){return!!Array.isArray(W)}function Xr$1(W){return Object.getPrototypeOf(W)===Object.prototype&&Object.keys(W).length}function Pe(W){return typeof W>"u"}function Yt$1(W,Y){return Y&&Pe(W)?!0:typeof W=="string"&&!!W.trim().length}function $r$1(W,Y){return Y&&Pe(W)?!0:typeof W=="number"&&!isNaN(W)}function hh(W,Y){const{requiredNamespaces:J}=Y,X=Object.keys(W.namespaces),Me=Object.keys(J);let Se=!0;return _e$2(Me,X)?(X.forEach(Ne=>{const{accounts:je,methods:ke,events:De}=W.namespaces[Ne],qe=tr$1(je),Ue=J[Ne];(!_e$2(Or$1(Ne,Ue),qe)||!_e$2(Ue.methods,ke)||!_e$2(Ue.events,De))&&(Se=!1)}),Se):!1}function _r$1(W){return Yt$1(W,!1)&&W.includes(":")?W.split(":").length===2:!1}function Io(W){if(Yt$1(W,!1)&&W.includes(":")){const Y=W.split(":");if(Y.length===3){const J=Y[0]+":"+Y[1];return!!Y[2]&&_r$1(J)}}return!1}function ch(W){function Y(J){try{return typeof new URL(J)<"u"}catch{return!1}}try{if(Yt$1(W,!1)){if(Y(W))return!0;const J=xi$1(W);return Y(J)}}catch{}return!1}function lh(W){var Y;return(Y=W==null?void 0:W.proposer)==null?void 0:Y.publicKey}function dh(W){return W==null?void 0:W.topic}function ph(W,Y){let J=null;return Yt$1(W==null?void 0:W.publicKey,!1)||(J=xe$1("MISSING_OR_INVALID",`${Y} controller public key should be a string`)),J}function an$1(W){let Y=!0;return Nr$1(W)?W.length&&(Y=W.every(J=>Yt$1(J,!1))):Y=!1,Y}function No(W,Y,J){let X=null;return Nr$1(Y)&&Y.length?Y.forEach(Me=>{X||_r$1(Me)||(X=er$1("UNSUPPORTED_CHAINS",`${J}, chain ${Me} should be a string and conform to "namespace:chainId" format`))}):_r$1(W)||(X=er$1("UNSUPPORTED_CHAINS",`${J}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),X}function _o(W,Y,J){let X=null;return Object.entries(W).forEach(([Me,Se])=>{if(X)return;const Ne=No(Me,Or$1(Me,Se),`${Y} ${J}`);Ne&&(X=Ne)}),X}function Bo(W,Y){let J=null;return Nr$1(W)?W.forEach(X=>{J||Io(X)||(J=er$1("UNSUPPORTED_ACCOUNTS",`${Y}, account ${X} should be a string and conform to "namespace:chainId:address" format`))}):J=er$1("UNSUPPORTED_ACCOUNTS",`${Y}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),J}function Co(W,Y){let J=null;return Object.values(W).forEach(X=>{if(J)return;const Me=Bo(X==null?void 0:X.accounts,`${Y} namespace`);Me&&(J=Me)}),J}function Ro(W,Y){let J=null;return an$1(W==null?void 0:W.methods)?an$1(W==null?void 0:W.events)||(J=er$1("UNSUPPORTED_EVENTS",`${Y}, events should be an array of strings or empty array for no events`)):J=er$1("UNSUPPORTED_METHODS",`${Y}, methods should be an array of strings or empty array for no methods`),J}function un$1(W,Y){let J=null;return Object.values(W).forEach(X=>{if(J)return;const Me=Ro(X,`${Y}, namespace`);Me&&(J=Me)}),J}function vh(W,Y,J){let X=null;if(W&&Xr$1(W)){const Me=un$1(W,Y);Me&&(X=Me);const Se=_o(W,Y,J);Se&&(X=Se)}else X=xe$1("MISSING_OR_INVALID",`${Y}, ${J} should be an object with data`);return X}function Oo(W,Y){let J=null;if(W&&Xr$1(W)){const X=un$1(W,Y);X&&(J=X);const Me=Co(W,Y);Me&&(J=Me)}else J=xe$1("MISSING_OR_INVALID",`${Y}, namespaces should be an object with data`);return J}function Po(W){return Yt$1(W.protocol,!0)}function gh(W,Y){let J=!1;return W?W&&Nr$1(W)&&W.length&&W.forEach(X=>{J=Po(X)}):J=!0,J}function mh(W){return typeof W=="number"}function Ah(W){return typeof W<"u"&&typeof W!==null}function bh(W){return!(!W||typeof W!="object"||!W.code||!$r$1(W.code,!1)||!W.message||!Yt$1(W.message,!1))}function yh(W){return!(Pe(W)||!Yt$1(W.method,!1))}function wh(W){return!(Pe(W)||Pe(W.result)&&Pe(W.error)||!$r$1(W.id,!1)||!Yt$1(W.jsonrpc,!1))}function xh(W){return!(Pe(W)||!Yt$1(W.name,!1))}function Mh(W,Y){return!(!_r$1(Y)||!bo(W).includes(Y))}function Eh(W,Y,J){return Yt$1(J,!1)?yo(W,Y).includes(J):!1}function Sh(W,Y,J){return Yt$1(J,!1)?wo(W,Y).includes(J):!1}function To(W,Y,J){let X=null;const Me=Ih(W),Se=Nh(Y),Ne=Object.keys(Me),je=Object.keys(Se),ke=Do(Object.keys(W)),De=Do(Object.keys(Y)),qe=ke.filter(Ue=>!De.includes(Ue));return qe.length&&(X=xe$1("NON_CONFORMING_NAMESPACES",`${J} namespaces keys don't satisfy requiredNamespaces.
Required: ${qe.toString()}
Received: ${Object.keys(Y).toString()}`)),_e$2(Ne,je)||(X=xe$1("NON_CONFORMING_NAMESPACES",`${J} namespaces chains don't satisfy required namespaces.
Required: ${Ne.toString()}
Approved: ${je.toString()}`)),Object.keys(Y).forEach(Ue=>{if(!Ue.includes(":")||X)return;const Ge=tr$1(Y[Ue].accounts);Ge.includes(Ue)||(X=xe$1("NON_CONFORMING_NAMESPACES",`${J} namespaces accounts don't satisfy namespace accounts for ${Ue}
Required: ${Ue}
Approved: ${Ge.toString()}`))}),Ne.forEach(Ue=>{X||(_e$2(Me[Ue].methods,Se[Ue].methods)?_e$2(Me[Ue].events,Se[Ue].events)||(X=xe$1("NON_CONFORMING_NAMESPACES",`${J} namespaces events don't satisfy namespace events for ${Ue}`)):X=xe$1("NON_CONFORMING_NAMESPACES",`${J} namespaces methods don't satisfy namespace methods for ${Ue}`))}),X}function Ih(W){const Y={};return Object.keys(W).forEach(J=>{var X;J.includes(":")?Y[J]=W[J]:(X=W[J].chains)==null||X.forEach(Me=>{Y[Me]={methods:W[J].methods,events:W[J].events}})}),Y}function Do(W){return[...new Set(W.map(Y=>Y.includes(":")?Y.split(":")[0]:Y))]}function Nh(W){const Y={};return Object.keys(W).forEach(J=>{if(J.includes(":"))Y[J]=W[J];else{const X=tr$1(W[J].accounts);X==null||X.forEach(Me=>{Y[Me]={accounts:W[J].accounts.filter(Se=>Se.includes(`${Me}:`)),methods:W[J].methods,events:W[J].events}})}}),Y}function _h(W,Y){return $r$1(W,!1)&&W<=Y.max&&W>=Y.min}function Bh(){const W=We();return new Promise(Y=>{switch(W){case qt$1.browser:Y(Fo());break;case qt$1.reactNative:Y(Uo());break;case qt$1.node:Y(ko());break;default:Y(!0)}})}function Fo(){return gr$1()&&(navigator==null?void 0:navigator.onLine)}async function Uo(){if(rr$1()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo){const W=await(globalThis==null?void 0:globalThis.NetInfo.fetch());return W==null?void 0:W.isConnected}return!0}function ko(){return!0}function Ch(W){switch(We()){case qt$1.browser:qo(W);break;case qt$1.reactNative:Ko(W);break}}function qo(W){!rr$1()&&gr$1()&&(window.addEventListener("online",()=>W(!0)),window.addEventListener("offline",()=>W(!1)))}function Ko(W){rr$1()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo&&(globalThis==null||globalThis.NetInfo.addEventListener(Y=>W(Y==null?void 0:Y.isConnected)))}const hn$1={};class Rh{static get(Y){return hn$1[Y]}static set(Y,J){hn$1[Y]=J}static delete(Y){delete hn$1[Y]}}class IEvents{}let n$2=class extends IEvents{constructor(Y){super()}};const s=cjsExports$3.FIVE_SECONDS,r$1={pulse:"heartbeat_pulse"};class i extends n$2{constructor(Y){super(Y),this.events=new eventsExports.EventEmitter,this.interval=s,this.interval=(Y==null?void 0:Y.interval)||s}static async init(Y){const J=new i(Y);return await J.init(),J}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(Y,J){this.events.on(Y,J)}once(Y,J){this.events.once(Y,J)}off(Y,J){this.events.off(Y,J)}removeListener(Y,J){this.events.removeListener(Y,J)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),cjsExports$3.toMiliseconds(this.interval))}pulse(){this.events.emit(r$1.pulse)}}const suspectProtoRx=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,suspectConstructorRx=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,JsonSigRx=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function jsonParseTransform(W,Y){if(W==="__proto__"||W==="constructor"&&Y&&typeof Y=="object"&&"prototype"in Y){warnKeyDropped(W);return}return Y}function warnKeyDropped(W){console.warn(`[destr] Dropping "${W}" key to prevent prototype pollution.`)}function destr(W,Y={}){if(typeof W!="string")return W;const J=W.trim();if(W[0]==='"'&&W.endsWith('"')&&!W.includes("\\"))return J.slice(1,-1);if(J.length<=9){const X=J.toLowerCase();if(X==="true")return!0;if(X==="false")return!1;if(X==="undefined")return;if(X==="null")return null;if(X==="nan")return Number.NaN;if(X==="infinity")return Number.POSITIVE_INFINITY;if(X==="-infinity")return Number.NEGATIVE_INFINITY}if(!JsonSigRx.test(W)){if(Y.strict)throw new SyntaxError("[destr] Invalid JSON");return W}try{if(suspectProtoRx.test(W)||suspectConstructorRx.test(W)){if(Y.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(W,jsonParseTransform)}return JSON.parse(W)}catch(X){if(Y.strict)throw X;return W}}function wrapToPromise(W){return!W||typeof W.then!="function"?Promise.resolve(W):W}function asyncCall(W,...Y){try{return wrapToPromise(W(...Y))}catch(J){return Promise.reject(J)}}function isPrimitive(W){const Y=typeof W;return W===null||Y!=="object"&&Y!=="function"}function isPureObject(W){const Y=Object.getPrototypeOf(W);return!Y||Y.isPrototypeOf(Object)}function stringify(W){if(isPrimitive(W))return String(W);if(isPureObject(W)||Array.isArray(W))return JSON.stringify(W);if(typeof W.toJSON=="function")return stringify(W.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const BASE64_PREFIX="base64:";function serializeRaw(W){return typeof W=="string"?W:BASE64_PREFIX+base64Encode(W)}function deserializeRaw(W){return typeof W!="string"||!W.startsWith(BASE64_PREFIX)?W:base64Decode(W.slice(BASE64_PREFIX.length))}function base64Decode(W){return globalThis.Buffer?Buffer.from(W,"base64"):Uint8Array.from(globalThis.atob(W),Y=>Y.codePointAt(0))}function base64Encode(W){return globalThis.Buffer?Buffer.from(W).toString("base64"):globalThis.btoa(String.fromCodePoint(...W))}function normalizeKey(W){var Y;return W&&((Y=W.split("?")[0])==null?void 0:Y.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function joinKeys(...W){return normalizeKey(W.join(":"))}function normalizeBaseKey(W){return W=normalizeKey(W),W?W+":":""}function defineDriver(W){return W}const DRIVER_NAME="memory",memory=()=>{const W=new Map;return{name:DRIVER_NAME,getInstance:()=>W,hasItem(Y){return W.has(Y)},getItem(Y){return W.get(Y)??null},getItemRaw(Y){return W.get(Y)??null},setItem(Y,J){W.set(Y,J)},setItemRaw(Y,J){W.set(Y,J)},removeItem(Y){W.delete(Y)},getKeys(){return[...W.keys()]},clear(){W.clear()},dispose(){W.clear()}}};function createStorage(W={}){const Y={mounts:{"":W.driver||memory()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},J=De=>{for(const qe of Y.mountpoints)if(De.startsWith(qe))return{base:qe,relativeKey:De.slice(qe.length),driver:Y.mounts[qe]};return{base:"",relativeKey:De,driver:Y.mounts[""]}},X=(De,qe)=>Y.mountpoints.filter(Ue=>Ue.startsWith(De)||qe&&De.startsWith(Ue)).map(Ue=>({relativeBase:De.length>Ue.length?De.slice(Ue.length):void 0,mountpoint:Ue,driver:Y.mounts[Ue]})),Me=(De,qe)=>{if(Y.watching){qe=normalizeKey(qe);for(const Ue of Y.watchListeners)Ue(De,qe)}},Se=async()=>{if(!Y.watching){Y.watching=!0;for(const De in Y.mounts)Y.unwatch[De]=await watch(Y.mounts[De],Me,De)}},Ne=async()=>{if(Y.watching){for(const De in Y.unwatch)await Y.unwatch[De]();Y.unwatch={},Y.watching=!1}},je=(De,qe,Ue)=>{const Ge=new Map,He=Ve=>{let Ye=Ge.get(Ve.base);return Ye||(Ye={driver:Ve.driver,base:Ve.base,items:[]},Ge.set(Ve.base,Ye)),Ye};for(const Ve of De){const Ye=typeof Ve=="string",Fn=normalizeKey(Ye?Ve:Ve.key),io=Ye?void 0:Ve.value,$o=Ye||!Ve.options?qe:{...qe,...Ve.options},Jo=J(Fn);He(Jo).items.push({key:Fn,value:io,relativeKey:Jo.relativeKey,options:$o})}return Promise.all([...Ge.values()].map(Ve=>Ue(Ve))).then(Ve=>Ve.flat())},ke={hasItem(De,qe={}){De=normalizeKey(De);const{relativeKey:Ue,driver:Ge}=J(De);return asyncCall(Ge.hasItem,Ue,qe)},getItem(De,qe={}){De=normalizeKey(De);const{relativeKey:Ue,driver:Ge}=J(De);return asyncCall(Ge.getItem,Ue,qe).then(He=>destr(He))},getItems(De,qe={}){return je(De,qe,Ue=>Ue.driver.getItems?asyncCall(Ue.driver.getItems,Ue.items.map(Ge=>({key:Ge.relativeKey,options:Ge.options})),qe).then(Ge=>Ge.map(He=>({key:joinKeys(Ue.base,He.key),value:destr(He.value)}))):Promise.all(Ue.items.map(Ge=>asyncCall(Ue.driver.getItem,Ge.relativeKey,Ge.options).then(He=>({key:Ge.key,value:destr(He)})))))},getItemRaw(De,qe={}){De=normalizeKey(De);const{relativeKey:Ue,driver:Ge}=J(De);return Ge.getItemRaw?asyncCall(Ge.getItemRaw,Ue,qe):asyncCall(Ge.getItem,Ue,qe).then(He=>deserializeRaw(He))},async setItem(De,qe,Ue={}){if(qe===void 0)return ke.removeItem(De);De=normalizeKey(De);const{relativeKey:Ge,driver:He}=J(De);He.setItem&&(await asyncCall(He.setItem,Ge,stringify(qe),Ue),He.watch||Me("update",De))},async setItems(De,qe){await je(De,qe,async Ue=>{if(Ue.driver.setItems)return asyncCall(Ue.driver.setItems,Ue.items.map(Ge=>({key:Ge.relativeKey,value:stringify(Ge.value),options:Ge.options})),qe);Ue.driver.setItem&&await Promise.all(Ue.items.map(Ge=>asyncCall(Ue.driver.setItem,Ge.relativeKey,stringify(Ge.value),Ge.options)))})},async setItemRaw(De,qe,Ue={}){if(qe===void 0)return ke.removeItem(De,Ue);De=normalizeKey(De);const{relativeKey:Ge,driver:He}=J(De);if(He.setItemRaw)await asyncCall(He.setItemRaw,Ge,qe,Ue);else if(He.setItem)await asyncCall(He.setItem,Ge,serializeRaw(qe),Ue);else return;He.watch||Me("update",De)},async removeItem(De,qe={}){typeof qe=="boolean"&&(qe={removeMeta:qe}),De=normalizeKey(De);const{relativeKey:Ue,driver:Ge}=J(De);Ge.removeItem&&(await asyncCall(Ge.removeItem,Ue,qe),(qe.removeMeta||qe.removeMata)&&await asyncCall(Ge.removeItem,Ue+"$",qe),Ge.watch||Me("remove",De))},async getMeta(De,qe={}){typeof qe=="boolean"&&(qe={nativeOnly:qe}),De=normalizeKey(De);const{relativeKey:Ue,driver:Ge}=J(De),He=Object.create(null);if(Ge.getMeta&&Object.assign(He,await asyncCall(Ge.getMeta,Ue,qe)),!qe.nativeOnly){const Ve=await asyncCall(Ge.getItem,Ue+"$",qe).then(Ye=>destr(Ye));Ve&&typeof Ve=="object"&&(typeof Ve.atime=="string"&&(Ve.atime=new Date(Ve.atime)),typeof Ve.mtime=="string"&&(Ve.mtime=new Date(Ve.mtime)),Object.assign(He,Ve))}return He},setMeta(De,qe,Ue={}){return this.setItem(De+"$",qe,Ue)},removeMeta(De,qe={}){return this.removeItem(De+"$",qe)},async getKeys(De,qe={}){De=normalizeBaseKey(De);const Ue=X(De,!0);let Ge=[];const He=[];for(const Ve of Ue){const Ye=await asyncCall(Ve.driver.getKeys,Ve.relativeBase,qe);for(const Fn of Ye){const io=Ve.mountpoint+normalizeKey(Fn);Ge.some($o=>io.startsWith($o))||He.push(io)}Ge=[Ve.mountpoint,...Ge.filter(Fn=>!Fn.startsWith(Ve.mountpoint))]}return De?He.filter(Ve=>Ve.startsWith(De)&&Ve[Ve.length-1]!=="$"):He.filter(Ve=>Ve[Ve.length-1]!=="$")},async clear(De,qe={}){De=normalizeBaseKey(De),await Promise.all(X(De,!1).map(async Ue=>{if(Ue.driver.clear)return asyncCall(Ue.driver.clear,Ue.relativeBase,qe);if(Ue.driver.removeItem){const Ge=await Ue.driver.getKeys(Ue.relativeBase||"",qe);return Promise.all(Ge.map(He=>Ue.driver.removeItem(He,qe)))}}))},async dispose(){await Promise.all(Object.values(Y.mounts).map(De=>dispose(De)))},async watch(De){return await Se(),Y.watchListeners.push(De),async()=>{Y.watchListeners=Y.watchListeners.filter(qe=>qe!==De),Y.watchListeners.length===0&&await Ne()}},async unwatch(){Y.watchListeners=[],await Ne()},mount(De,qe){if(De=normalizeBaseKey(De),De&&Y.mounts[De])throw new Error(`already mounted at ${De}`);return De&&(Y.mountpoints.push(De),Y.mountpoints.sort((Ue,Ge)=>Ge.length-Ue.length)),Y.mounts[De]=qe,Y.watching&&Promise.resolve(watch(qe,Me,De)).then(Ue=>{Y.unwatch[De]=Ue}).catch(console.error),ke},async unmount(De,qe=!0){var Ue,Ge;De=normalizeBaseKey(De),!(!De||!Y.mounts[De])&&(Y.watching&&De in Y.unwatch&&((Ge=(Ue=Y.unwatch)[De])==null||Ge.call(Ue),delete Y.unwatch[De]),qe&&await dispose(Y.mounts[De]),Y.mountpoints=Y.mountpoints.filter(He=>He!==De),delete Y.mounts[De])},getMount(De=""){De=normalizeKey(De)+":";const qe=J(De);return{driver:qe.driver,base:qe.base}},getMounts(De="",qe={}){return De=normalizeKey(De),X(De,qe.parents).map(Ge=>({driver:Ge.driver,base:Ge.mountpoint}))},keys:(De,qe={})=>ke.getKeys(De,qe),get:(De,qe={})=>ke.getItem(De,qe),set:(De,qe,Ue={})=>ke.setItem(De,qe,Ue),has:(De,qe={})=>ke.hasItem(De,qe),del:(De,qe={})=>ke.removeItem(De,qe),remove:(De,qe={})=>ke.removeItem(De,qe)};return ke}function watch(W,Y,J){return W.watch?W.watch((X,Me)=>Y(X,J+Me)):()=>{}}async function dispose(W){typeof W.dispose=="function"&&await asyncCall(W.dispose)}function promisifyRequest(W){return new Promise((Y,J)=>{W.oncomplete=W.onsuccess=()=>Y(W.result),W.onabort=W.onerror=()=>J(W.error)})}function createStore(W,Y){const J=indexedDB.open(W);J.onupgradeneeded=()=>J.result.createObjectStore(Y);const X=promisifyRequest(J);return(Me,Se)=>X.then(Ne=>Se(Ne.transaction(Y,Me).objectStore(Y)))}let defaultGetStoreFunc;function defaultGetStore(){return defaultGetStoreFunc||(defaultGetStoreFunc=createStore("keyval-store","keyval")),defaultGetStoreFunc}function get(W,Y=defaultGetStore()){return Y("readonly",J=>promisifyRequest(J.get(W)))}function set(W,Y,J=defaultGetStore()){return J("readwrite",X=>(X.put(Y,W),promisifyRequest(X.transaction)))}function del(W,Y=defaultGetStore()){return Y("readwrite",J=>(J.delete(W),promisifyRequest(J.transaction)))}function clear(W=defaultGetStore()){return W("readwrite",Y=>(Y.clear(),promisifyRequest(Y.transaction)))}function eachCursor(W,Y){return W.openCursor().onsuccess=function(){this.result&&(Y(this.result),this.result.continue())},promisifyRequest(W.transaction)}function keys(W=defaultGetStore()){return W("readonly",Y=>{if(Y.getAllKeys)return promisifyRequest(Y.getAllKeys());const J=[];return eachCursor(Y,X=>J.push(X.key)).then(()=>J)})}const x$3="idb-keyval";var z$3=(W={})=>{const Y=W.base&&W.base.length>0?`${W.base}:`:"",J=Me=>Y+Me;let X;return W.dbName&&W.storeName&&(X=createStore(W.dbName,W.storeName)),{name:x$3,options:W,async hasItem(Me){return!(typeof await get(J(Me),X)>"u")},async getItem(Me){return await get(J(Me),X)??null},setItem(Me,Se){return set(J(Me),Se,X)},removeItem(Me){return del(J(Me),X)},getKeys(){return keys(X)},clear(){return clear(X)}}};const D$2="WALLET_CONNECT_V2_INDEXED_DB",E$2="keyvaluestorage";let _$1=class{constructor(){this.indexedDb=createStorage({driver:z$3({dbName:D$2,storeName:E$2})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(Y=>[Y.key,Y.value])}async getItem(Y){const J=await this.indexedDb.getItem(Y);if(J!==null)return J}async setItem(Y,J){await this.indexedDb.setItem(Y,safeJsonStringify(J))}async removeItem(Y){await this.indexedDb.removeItem(Y)}};var l$1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c$1={exports:{}};(function(){let W;function Y(){}W=Y,W.prototype.getItem=function(J){return this.hasOwnProperty(J)?String(this[J]):null},W.prototype.setItem=function(J,X){this[J]=String(X)},W.prototype.removeItem=function(J){delete this[J]},W.prototype.clear=function(){const J=this;Object.keys(J).forEach(function(X){J[X]=void 0,delete J[X]})},W.prototype.key=function(J){return J=J||0,Object.keys(this)[J]},W.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof l$1<"u"&&l$1.localStorage?c$1.exports=l$1.localStorage:typeof window<"u"&&window.localStorage?c$1.exports=window.localStorage:c$1.exports=new Y})();function k(W){var Y;return[W[0],safeJsonParse((Y=W[1])!=null?Y:"")]}let K$1=class{constructor(){this.localStorage=c$1.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(k)}async getItem(Y){const J=this.localStorage.getItem(Y);if(J!==null)return safeJsonParse(J)}async setItem(Y,J){this.localStorage.setItem(Y,safeJsonStringify(J))}async removeItem(Y){this.localStorage.removeItem(Y)}};const N$1="wc_storage_version",y$3=1,O$3=async(W,Y,J)=>{const X=N$1,Me=await Y.getItem(X);if(Me&&Me>=y$3){J(Y);return}const Se=await W.getKeys();if(!Se.length){J(Y);return}const Ne=[];for(;Se.length;){const je=Se.shift();if(!je)continue;const ke=je.toLowerCase();if(ke.includes("wc@")||ke.includes("walletconnect")||ke.includes("wc_")||ke.includes("wallet_connect")){const De=await W.getItem(je);await Y.setItem(je,De),Ne.push(je)}}await Y.setItem(X,y$3),J(Y),j$4(W,Ne)},j$4=async(W,Y)=>{Y.length&&Y.forEach(async J=>{await W.removeItem(J)})};let h$2=class{constructor(){this.initialized=!1,this.setInitialized=J=>{this.storage=J,this.initialized=!0};const Y=new K$1;this.storage=Y;try{const J=new _$1;O$3(Y,J,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(Y){return await this.initialize(),this.storage.getItem(Y)}async setItem(Y,J){return await this.initialize(),this.storage.setItem(Y,J)}async removeItem(Y){return await this.initialize(),this.storage.removeItem(Y)}async initialize(){this.initialized||await new Promise(Y=>{const J=setInterval(()=>{this.initialized&&(clearInterval(J),Y())},20)})}},n$1=class extends IEvents{constructor(Y){super(),this.opts=Y,this.protocol="wc",this.version=2}},h$1=class extends IEvents{constructor(Y,J){super(),this.core=Y,this.logger=J,this.records=new Map}},a$1=class{constructor(Y,J){this.logger=Y,this.core=J}},g$2=class extends IEvents{constructor(Y,J){super(),this.relayer=Y,this.logger=J}},u$1=class extends IEvents{constructor(Y){super()}},p$2=class{constructor(Y,J,X,Me){this.core=Y,this.logger=J,this.name=X}},d$1=class extends IEvents{constructor(Y,J){super(),this.relayer=Y,this.logger=J}},x$2=class extends IEvents{constructor(Y,J){super(),this.core=Y,this.logger=J}},y$2=class{constructor(Y,J,X){this.core=Y,this.logger=J,this.store=X}},v$3=class{constructor(Y,J){this.projectId=Y,this.logger=J}},C$1=class{constructor(Y,J,X){this.core=Y,this.logger=J,this.telemetryEnabled=X}},S$1=class{constructor(Y){this.opts=Y,this.protocol="wc",this.version=2}},M$2=class{constructor(Y){this.client=Y}};const PARSE_ERROR="PARSE_ERROR",INVALID_REQUEST="INVALID_REQUEST",METHOD_NOT_FOUND="METHOD_NOT_FOUND",INVALID_PARAMS="INVALID_PARAMS",INTERNAL_ERROR="INTERNAL_ERROR",SERVER_ERROR="SERVER_ERROR",RESERVED_ERROR_CODES=[-32700,-32600,-32601,-32602,-32603],STANDARD_ERROR_MAP={[PARSE_ERROR]:{code:-32700,message:"Parse error"},[INVALID_REQUEST]:{code:-32600,message:"Invalid Request"},[METHOD_NOT_FOUND]:{code:-32601,message:"Method not found"},[INVALID_PARAMS]:{code:-32602,message:"Invalid params"},[INTERNAL_ERROR]:{code:-32603,message:"Internal error"},[SERVER_ERROR]:{code:-32e3,message:"Server error"}},DEFAULT_ERROR=SERVER_ERROR;function isReservedErrorCode(W){return RESERVED_ERROR_CODES.includes(W)}function getError(W){return Object.keys(STANDARD_ERROR_MAP).includes(W)?STANDARD_ERROR_MAP[W]:STANDARD_ERROR_MAP[DEFAULT_ERROR]}function getErrorByCode(W){const Y=Object.values(STANDARD_ERROR_MAP).find(J=>J.code===W);return Y||STANDARD_ERROR_MAP[DEFAULT_ERROR]}function parseConnectionError(W,Y,J){return W.message.includes("getaddrinfo ENOTFOUND")||W.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${J} RPC url at ${Y}`):W}var cjs={},crypto$1={},hasRequiredCrypto;function requireCrypto(){if(hasRequiredCrypto)return crypto$1;hasRequiredCrypto=1,Object.defineProperty(crypto$1,"__esModule",{value:!0}),crypto$1.isBrowserCryptoAvailable=crypto$1.getSubtleCrypto=crypto$1.getBrowerCrypto=void 0;function W(){return(globalThis==null?void 0:globalThis.crypto)||(globalThis==null?void 0:globalThis.msCrypto)||{}}crypto$1.getBrowerCrypto=W;function Y(){const X=W();return X.subtle||X.webkitSubtle}crypto$1.getSubtleCrypto=Y;function J(){return!!W()&&!!Y()}return crypto$1.isBrowserCryptoAvailable=J,crypto$1}var env={},hasRequiredEnv;function requireEnv(){if(hasRequiredEnv)return env;hasRequiredEnv=1,Object.defineProperty(env,"__esModule",{value:!0}),env.isBrowser=env.isNode=env.isReactNative=void 0;function W(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}env.isReactNative=W;function Y(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}env.isNode=Y;function J(){return!W()&&!Y()}return env.isBrowser=J,env}var hasRequiredCjs;function requireCjs(){return hasRequiredCjs||(hasRequiredCjs=1,function(W){Object.defineProperty(W,"__esModule",{value:!0});const Y=require$$0;Y.__exportStar(requireCrypto(),W),Y.__exportStar(requireEnv(),W)}(cjs)),cjs}var cjsExports=requireCjs();function payloadId(W=3){const Y=Date.now()*Math.pow(10,W),J=Math.floor(Math.random()*Math.pow(10,W));return Y+J}function getBigIntRpcId(W=6){return BigInt(payloadId(W))}function formatJsonRpcRequest(W,Y,J){return{id:J||payloadId(),jsonrpc:"2.0",method:W,params:Y}}function formatJsonRpcResult(W,Y){return{id:W,jsonrpc:"2.0",result:Y}}function formatJsonRpcError(W,Y,J){return{id:W,jsonrpc:"2.0",error:formatErrorMessage(Y)}}function formatErrorMessage(W,Y){return typeof W>"u"?getError(INTERNAL_ERROR):(typeof W=="string"&&(W=Object.assign(Object.assign({},getError(SERVER_ERROR)),{message:W})),isReservedErrorCode(W.code)&&(W=getErrorByCode(W.code)),W)}class e{}class n extends e{constructor(){super()}}class r extends n{constructor(Y){super()}}const HTTP_REGEX="^https?:",WS_REGEX="^wss?:";function getUrlProtocol(W){const Y=W.match(new RegExp(/^\w+:/,"gi"));if(!(!Y||!Y.length))return Y[0]}function matchRegexProtocol(W,Y){const J=getUrlProtocol(W);return typeof J>"u"?!1:new RegExp(Y).test(J)}function isHttpUrl(W){return matchRegexProtocol(W,HTTP_REGEX)}function isWsUrl(W){return matchRegexProtocol(W,WS_REGEX)}function isLocalhostUrl(W){return new RegExp("wss?://localhost(:d{2,5})?").test(W)}function isJsonRpcPayload(W){return typeof W=="object"&&"id"in W&&"jsonrpc"in W&&W.jsonrpc==="2.0"}function isJsonRpcRequest(W){return isJsonRpcPayload(W)&&"method"in W}function isJsonRpcResponse(W){return isJsonRpcPayload(W)&&(isJsonRpcResult(W)||isJsonRpcError(W))}function isJsonRpcResult(W){return"result"in W}function isJsonRpcError(W){return"error"in W}let o$1=class extends r{constructor(Y){super(Y),this.events=new eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(Y),this.connection.connected&&this.registerEventListeners()}async connect(Y=this.connection){await this.open(Y)}async disconnect(){await this.close()}on(Y,J){this.events.on(Y,J)}once(Y,J){this.events.once(Y,J)}off(Y,J){this.events.off(Y,J)}removeListener(Y,J){this.events.removeListener(Y,J)}async request(Y,J){return this.requestStrict(formatJsonRpcRequest(Y.method,Y.params||[],Y.id||getBigIntRpcId().toString()),J)}async requestStrict(Y,J){return new Promise(async(X,Me)=>{if(!this.connection.connected)try{await this.open()}catch(Se){Me(Se)}this.events.on(`${Y.id}`,Se=>{isJsonRpcError(Se)?Me(Se.error):X(Se.result)});try{await this.connection.send(Y,J)}catch(Se){Me(Se)}})}setConnection(Y=this.connection){return Y}onPayload(Y){this.events.emit("payload",Y),isJsonRpcResponse(Y)?this.events.emit(`${Y.id}`,Y):this.events.emit("message",{type:Y.method,data:Y.params})}onClose(Y){Y&&Y.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${Y.code} ${Y.reason?`(${Y.reason})`:""}`)),this.events.emit("disconnect")}async open(Y=this.connection){this.connection===Y&&this.connection.connected||(this.connection.connected&&this.close(),typeof Y=="string"&&(await this.connection.open(Y),Y=this.connection),this.connection=this.setConnection(Y),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",Y=>this.onPayload(Y)),this.connection.on("close",Y=>this.onClose(Y)),this.connection.on("error",Y=>this.events.emit("error",Y)),this.connection.on("register_error",Y=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const w$2=()=>typeof WebSocket<"u"?WebSocket:typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"?globalThis.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),b$1=()=>typeof WebSocket<"u"||typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",a=W=>W.split("?")[0],h=10,S=w$2();let f$1=class{constructor(Y){if(this.url=Y,this.events=new eventsExports.EventEmitter,this.registering=!1,!isWsUrl(Y))throw new Error(`Provided URL is not compatible with WebSocket connection: ${Y}`);this.url=Y}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(Y,J){this.events.on(Y,J)}once(Y,J){this.events.once(Y,J)}off(Y,J){this.events.off(Y,J)}removeListener(Y,J){this.events.removeListener(Y,J)}async open(Y=this.url){await this.register(Y)}async close(){return new Promise((Y,J)=>{if(typeof this.socket>"u"){J(new Error("Connection already closed"));return}this.socket.onclose=X=>{this.onClose(X),Y()},this.socket.close()})}async send(Y){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(safeJsonStringify(Y))}catch(J){this.onError(Y.id,J)}}register(Y=this.url){if(!isWsUrl(Y))throw new Error(`Provided URL is not compatible with WebSocket connection: ${Y}`);if(this.registering){const J=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=J||this.events.listenerCount("open")>=J)&&this.events.setMaxListeners(J+1),new Promise((X,Me)=>{this.events.once("register_error",Se=>{this.resetMaxListeners(),Me(Se)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return Me(new Error("WebSocket connection is missing or invalid"));X(this.socket)})})}return this.url=Y,this.registering=!0,new Promise((J,X)=>{const Me=new URLSearchParams(Y).get("origin"),Se=cjsExports.isReactNative()?{headers:{origin:Me}}:{rejectUnauthorized:!isLocalhostUrl(Y)},Ne=new S(Y,[],Se);b$1()?Ne.onerror=je=>{const ke=je;X(this.emitError(ke.error))}:Ne.on("error",je=>{X(this.emitError(je))}),Ne.onopen=()=>{this.onOpen(Ne),J(Ne)}})}onOpen(Y){Y.onmessage=J=>this.onPayload(J),Y.onclose=J=>this.onClose(J),this.socket=Y,this.registering=!1,this.events.emit("open")}onClose(Y){this.socket=void 0,this.registering=!1,this.events.emit("close",Y)}onPayload(Y){if(typeof Y.data>"u")return;const J=typeof Y.data=="string"?safeJsonParse(Y.data):Y.data;this.events.emit("payload",J)}onError(Y,J){const X=this.parseError(J),Me=X.message||X.toString(),Se=formatJsonRpcError(Y,Me);this.events.emit("payload",Se)}parseError(Y,J=this.url){return parseConnectionError(Y,a(J),"WS")}resetMaxListeners(){this.events.getMaxListeners()>h&&this.events.setMaxListeners(h)}emitError(Y){const J=this.parseError(new Error((Y==null?void 0:Y.message)||`WebSocket connection failed for host: ${a(this.url)}`));return this.events.emit("register_error",J),J}};var lodash_isequal={exports:{}};lodash_isequal.exports;var hasRequiredLodash_isequal;function requireLodash_isequal(){return hasRequiredLodash_isequal||(hasRequiredLodash_isequal=1,function(W,Y){var J=200,X="__lodash_hash_undefined__",Me=1,Se=2,Ne=9007199254740991,je="[object Arguments]",ke="[object Array]",De="[object AsyncFunction]",qe="[object Boolean]",Ue="[object Date]",Ge="[object Error]",He="[object Function]",Ve="[object GeneratorFunction]",Ye="[object Map]",Fn="[object Number]",io="[object Null]",$o="[object Object]",Jo="[object Promise]",rs="[object Proxy]",Yo="[object RegExp]",zo="[object Set]",jo="[object String]",Vo="[object Symbol]",os="[object Undefined]",us="[object WeakMap]",is="[object ArrayBuffer]",Lo="[object DataView]",Fe="[object Float32Array]",Ke="[object Float64Array]",Je="[object Int8Array]",wi="[object Int16Array]",mo="[object Int32Array]",Go="[object Uint8Array]",Qo="[object Uint8ClampedArray]",Ao="[object Uint16Array]",Mn="[object Uint32Array]",Ho=/[\\^$.*+?()[\]{}|]/g,rc=/^\[object .+?Constructor\]$/,dc=/^(?:0|[1-9]\d*)$/,ds={};ds[Fe]=ds[Ke]=ds[Je]=ds[wi]=ds[mo]=ds[Go]=ds[Qo]=ds[Ao]=ds[Mn]=!0,ds[je]=ds[ke]=ds[is]=ds[qe]=ds[Lo]=ds[Ue]=ds[Ge]=ds[He]=ds[Ye]=ds[Fn]=ds[$o]=ds[Yo]=ds[zo]=ds[jo]=ds[us]=!1;var fc=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,ac=typeof self=="object"&&self&&self.Object===Object&&self,lc=fc||ac||Function("return this")(),uc=Y&&!Y.nodeType&&Y,tc=uc&&!0&&W&&!W.nodeType&&W,hc=tc&&tc.exports===uc,gc=hc&&fc.process,bc=function(){try{return gc&&gc.binding&&gc.binding("util")}catch{}}(),wc=bc&&bc.isTypedArray;function Cc(_c,Bc){for(var el=-1,Nl=_c==null?0:_c.length,md=0,Vl=[];++el<Nl;){var Sd=_c[el];Bc(Sd,el,_c)&&(Vl[md++]=Sd)}return Vl}function Oc(_c,Bc){for(var el=-1,Nl=Bc.length,md=_c.length;++el<Nl;)_c[md+el]=Bc[el];return _c}function Tc(_c,Bc){for(var el=-1,Nl=_c==null?0:_c.length;++el<Nl;)if(Bc(_c[el],el,_c))return!0;return!1}function Fc(_c,Bc){for(var el=-1,Nl=Array(_c);++el<_c;)Nl[el]=Bc(el);return Nl}function Sc(_c){return function(Bc){return _c(Bc)}}function jc(_c,Bc){return _c.has(Bc)}function kc(_c,Bc){return _c==null?void 0:_c[Bc]}function Lc(_c){var Bc=-1,el=Array(_c.size);return _c.forEach(function(Nl,md){el[++Bc]=[md,Nl]}),el}function zc(_c,Bc){return function(el){return _c(Bc(el))}}function Xc(_c){var Bc=-1,el=Array(_c.size);return _c.forEach(function(Nl){el[++Bc]=Nl}),el}var Hc=Array.prototype,Jc=Function.prototype,pc=Object.prototype,ic=lc["__core-js_shared__"],oc=Jc.toString,yc=pc.hasOwnProperty,Ec=function(){var _c=/[^.]+$/.exec(ic&&ic.keys&&ic.keys.IE_PROTO||"");return _c?"Symbol(src)_1."+_c:""}(),Ic=pc.toString,Mc=RegExp("^"+oc.call(yc).replace(Ho,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vc=hc?lc.Buffer:void 0,Qc=lc.Symbol,nl=lc.Uint8Array,bu=pc.propertyIsEnumerable,yu=Hc.splice,Rl=Qc?Qc.toStringTag:void 0,bl=Object.getOwnPropertySymbols,vl=Vc?Vc.isBuffer:void 0,Ol=zc(Object.keys,Object),al=rp(lc,"DataView"),il=rp(lc,"Map"),Cl=rp(lc,"Promise"),hl=rp(lc,"Set"),ll=rp(lc,"WeakMap"),El=rp(Object,"create"),gl=kh(al),dl=kh(il),Sl=kh(Cl),fl=kh(hl),pl=kh(ll),_l=Qc?Qc.prototype:void 0,cl=_l?_l.valueOf:void 0;function tl(_c){var Bc=-1,el=_c==null?0:_c.length;for(this.clear();++Bc<el;){var Nl=_c[Bc];this.set(Nl[0],Nl[1])}}function Il(){this.__data__=El?El(null):{},this.size=0}function yl(_c){var Bc=this.has(_c)&&delete this.__data__[_c];return this.size-=Bc?1:0,Bc}function Tl(_c){var Bc=this.__data__;if(El){var el=Bc[_c];return el===X?void 0:el}return yc.call(Bc,_c)?Bc[_c]:void 0}function Bl(_c){var Bc=this.__data__;return El?Bc[_c]!==void 0:yc.call(Bc,_c)}function Al(_c,Bc){var el=this.__data__;return this.size+=this.has(_c)?0:1,el[_c]=El&&Bc===void 0?X:Bc,this}tl.prototype.clear=Il,tl.prototype.delete=yl,tl.prototype.get=Tl,tl.prototype.has=Bl,tl.prototype.set=Al;function wl(_c){var Bc=-1,el=_c==null?0:_c.length;for(this.clear();++Bc<el;){var Nl=_c[Bc];this.set(Nl[0],Nl[1])}}function Hl(){this.__data__=[],this.size=0}function yd(_c){var Bc=this.__data__,el=pg(Bc,_c);if(el<0)return!1;var Nl=Bc.length-1;return el==Nl?Bc.pop():yu.call(Bc,el,1),--this.size,!0}function pd(_c){var Bc=this.__data__,el=pg(Bc,_c);return el<0?void 0:Bc[el][1]}function gd(_c){return pg(this.__data__,_c)>-1}function $d(_c,Bc){var el=this.__data__,Nl=pg(el,_c);return Nl<0?(++this.size,el.push([_c,Bc])):el[Nl][1]=Bc,this}wl.prototype.clear=Hl,wl.prototype.delete=yd,wl.prototype.get=pd,wl.prototype.has=gd,wl.prototype.set=$d;function nd(_c){var Bc=-1,el=_c==null?0:_c.length;for(this.clear();++Bc<el;){var Nl=_c[Bc];this.set(Nl[0],Nl[1])}}function Ud(){this.size=0,this.__data__={hash:new tl,map:new(il||wl),string:new tl}}function $f(_c){var Bc=od(this,_c).delete(_c);return this.size-=Bc?1:0,Bc}function Zl(_c){return od(this,_c).get(_c)}function Zf(_c){return od(this,_c).has(_c)}function zd(_c,Bc){var el=od(this,_c),Nl=el.size;return el.set(_c,Bc),this.size+=el.size==Nl?0:1,this}nd.prototype.clear=Ud,nd.prototype.delete=$f,nd.prototype.get=Zl,nd.prototype.has=Zf,nd.prototype.set=zd;function jd(_c){var Bc=-1,el=_c==null?0:_c.length;for(this.__data__=new nd;++Bc<el;)this.add(_c[Bc])}function kd(_c){return this.__data__.set(_c,X),this}function Yd(_c){return this.__data__.has(_c)}jd.prototype.add=jd.prototype.push=kd,jd.prototype.has=Yd;function bd(_c){var Bc=this.__data__=new wl(_c);this.size=Bc.size}function Fd(){this.__data__=new wl,this.size=0}function wd(_c){var Bc=this.__data__,el=Bc.delete(_c);return this.size=Bc.size,el}function Xf(_c){return this.__data__.get(_c)}function Td(_c){return this.__data__.has(_c)}function F1(_c,Bc){var el=this.__data__;if(el instanceof wl){var Nl=el.__data__;if(!il||Nl.length<J-1)return Nl.push([_c,Bc]),this.size=++el.size,this;el=this.__data__=new nd(Nl)}return el.set(_c,Bc),this.size=el.size,this}bd.prototype.clear=Fd,bd.prototype.delete=wd,bd.prototype.get=Xf,bd.prototype.has=Td,bd.prototype.set=F1;function Ey(_c,Bc){var el=Xp(_c),Nl=!el&&G1(_c),md=!el&&!Nl&&j$(_c),Vl=!el&&!Nl&&!md&&D$(_c),Sd=el||Nl||md||Vl,Gd=Sd?Fc(_c.length,String):[],Jl=Gd.length;for(var vd in _c)yc.call(_c,vd)&&!(Sd&&(vd=="length"||md&&(vd=="offset"||vd=="parent")||Vl&&(vd=="buffer"||vd=="byteLength"||vd=="byteOffset")||M$(vd,Jl)))&&Gd.push(vd);return Gd}function pg(_c,Bc){for(var el=_c.length;el--;)if(kp(_c[el][0],Bc))return el;return-1}function W1(_c,Bc,el){var Nl=Bc(_c);return Xp(_c)?Nl:Oc(Nl,el(_c))}function Zp(_c){return _c==null?_c===void 0?os:io:Rl&&Rl in Object(_c)?P$(_c):Qp(_c)}function m1(_c){return r1(_c)&&Zp(_c)==je}function Jp(_c,Bc,el,Nl,md){return _c===Bc?!0:_c==null||Bc==null||!r1(_c)&&!r1(Bc)?_c!==_c&&Bc!==Bc:_y(_c,Bc,el,Nl,Jp,md)}function _y(_c,Bc,el,Nl,md,Vl){var Sd=Xp(_c),Gd=Xp(Bc),Jl=Sd?ke:jp(_c),vd=Gd?ke:jp(Bc);Jl=Jl==je?$o:Jl,vd=vd==je?$o:vd;var Pd=Jl==$o,Yh=vd==$o,Dd=Jl==vd;if(Dd&&j$(_c)){if(!j$(Bc))return!1;Sd=!0,Pd=!1}if(Dd&&!Pd)return Vl||(Vl=new bd),Sd||D$(_c)?K1(_c,Bc,el,Nl,md,Vl):gg(_c,Bc,Jl,el,Nl,md,Vl);if(!(el&Me)){var Ad=Pd&&yc.call(_c,"__wrapped__"),Dh=Yh&&yc.call(Bc,"__wrapped__");if(Ad||Dh){var Ld=Ad?_c.value():_c,sh=Dh?Bc.value():Bc;return Vl||(Vl=new bd),md(Ld,sh,el,Nl,Vl)}}return Dd?(Vl||(Vl=new bd),Sy(_c,Bc,el,Nl,md,Vl)):!1}function Fm(_c){if(!k$(_c)||Hg(_c))return!1;var Bc=t1(_c)?Mc:rc;return Bc.test(kh(_c))}function zg(_c){return r1(_c)&&Iy(_c.length)&&!!ds[Zp(_c)]}function O$(_c){if(!$g(_c))return Ol(_c);var Bc=[];for(var el in Object(_c))yc.call(_c,el)&&el!="constructor"&&Bc.push(el);return Bc}function K1(_c,Bc,el,Nl,md,Vl){var Sd=el&Me,Gd=_c.length,Jl=Bc.length;if(Gd!=Jl&&!(Sd&&Jl>Gd))return!1;var vd=Vl.get(_c);if(vd&&Vl.get(Bc))return vd==Bc;var Pd=-1,Yh=!0,Dd=el&Se?new jd:void 0;for(Vl.set(_c,Bc),Vl.set(Bc,_c);++Pd<Gd;){var Ad=_c[Pd],Dh=Bc[Pd];if(Nl)var Ld=Sd?Nl(Dh,Ad,Pd,Bc,_c,Vl):Nl(Ad,Dh,Pd,_c,Bc,Vl);if(Ld!==void 0){if(Ld)continue;Yh=!1;break}if(Dd){if(!Tc(Bc,function(sh,vp){if(!jc(Dd,vp)&&(Ad===sh||md(Ad,sh,el,Nl,Vl)))return Dd.push(vp)})){Yh=!1;break}}else if(!(Ad===Dh||md(Ad,Dh,el,Nl,Vl))){Yh=!1;break}}return Vl.delete(_c),Vl.delete(Bc),Yh}function gg(_c,Bc,el,Nl,md,Vl,Sd){switch(el){case Lo:if(_c.byteLength!=Bc.byteLength||_c.byteOffset!=Bc.byteOffset)return!1;_c=_c.buffer,Bc=Bc.buffer;case is:return!(_c.byteLength!=Bc.byteLength||!Vl(new nl(_c),new nl(Bc)));case qe:case Ue:case Fn:return kp(+_c,+Bc);case Ge:return _c.name==Bc.name&&_c.message==Bc.message;case Yo:case jo:return _c==Bc+"";case Ye:var Gd=Lc;case zo:var Jl=Nl&Me;if(Gd||(Gd=Xc),_c.size!=Bc.size&&!Jl)return!1;var vd=Sd.get(_c);if(vd)return vd==Bc;Nl|=Se,Sd.set(_c,Bc);var Pd=K1(Gd(_c),Gd(Bc),Nl,md,Vl,Sd);return Sd.delete(_c),Pd;case Vo:if(cl)return cl.call(_c)==cl.call(Bc)}return!1}function Sy(_c,Bc,el,Nl,md,Vl){var Sd=el&Me,Gd=z1(_c),Jl=Gd.length,vd=z1(Bc),Pd=vd.length;if(Jl!=Pd&&!Sd)return!1;for(var Yh=Jl;Yh--;){var Dd=Gd[Yh];if(!(Sd?Dd in Bc:yc.call(Bc,Dd)))return!1}var Ad=Vl.get(_c);if(Ad&&Vl.get(Bc))return Ad==Bc;var Dh=!0;Vl.set(_c,Bc),Vl.set(Bc,_c);for(var Ld=Sd;++Yh<Jl;){Dd=Gd[Yh];var sh=_c[Dd],vp=Bc[Dd];if(Nl)var v1=Sd?Nl(vp,sh,Dd,Bc,_c,Vl):Nl(sh,vp,Dd,_c,Bc,Vl);if(!(v1===void 0?sh===vp||md(sh,vp,el,Nl,Vl):v1)){Dh=!1;break}Ld||(Ld=Dd=="constructor")}if(Dh&&!Ld){var yg=_c.constructor,Zd=Bc.constructor;yg!=Zd&&"constructor"in _c&&"constructor"in Bc&&!(typeof yg=="function"&&yg instanceof yg&&typeof Zd=="function"&&Zd instanceof Zd)&&(Dh=!1)}return Vl.delete(_c),Vl.delete(Bc),Dh}function z1(_c){return W1(_c,Wm,Gg)}function od(_c,Bc){var el=_c.__data__;return N$(Bc)?el[typeof Bc=="string"?"string":"hash"]:el.map}function rp(_c,Bc){var el=kc(_c,Bc);return Fm(el)?el:void 0}function P$(_c){var Bc=yc.call(_c,Rl),el=_c[Rl];try{_c[Rl]=void 0;var Nl=!0}catch{}var md=Ic.call(_c);return Nl&&(Bc?_c[Rl]=el:delete _c[Rl]),md}var Gg=bl?function(_c){return _c==null?[]:(_c=Object(_c),Cc(bl(_c),function(Bc){return bu.call(_c,Bc)}))}:hd,jp=Zp;(al&&jp(new al(new ArrayBuffer(1)))!=Lo||il&&jp(new il)!=Ye||Cl&&jp(Cl.resolve())!=Jo||hl&&jp(new hl)!=zo||ll&&jp(new ll)!=us)&&(jp=function(_c){var Bc=Zp(_c),el=Bc==$o?_c.constructor:void 0,Nl=el?kh(el):"";if(Nl)switch(Nl){case gl:return Lo;case dl:return Ye;case Sl:return Jo;case fl:return zo;case pl:return us}return Bc});function M$(_c,Bc){return Bc=Bc??Ne,!!Bc&&(typeof _c=="number"||dc.test(_c))&&_c>-1&&_c%1==0&&_c<Bc}function N$(_c){var Bc=typeof _c;return Bc=="string"||Bc=="number"||Bc=="symbol"||Bc=="boolean"?_c!=="__proto__":_c===null}function Hg(_c){return!!Ec&&Ec in _c}function $g(_c){var Bc=_c&&_c.constructor,el=typeof Bc=="function"&&Bc.prototype||pc;return _c===el}function Qp(_c){return Ic.call(_c)}function kh(_c){if(_c!=null){try{return oc.call(_c)}catch{}try{return _c+""}catch{}}return""}function kp(_c,Bc){return _c===Bc||_c!==_c&&Bc!==Bc}var G1=m1(function(){return arguments}())?m1:function(_c){return r1(_c)&&yc.call(_c,"callee")&&!bu.call(_c,"callee")},Xp=Array.isArray;function e1(_c){return _c!=null&&Iy(_c.length)&&!t1(_c)}var j$=vl||ud;function Cy(_c,Bc){return Jp(_c,Bc)}function t1(_c){if(!k$(_c))return!1;var Bc=Zp(_c);return Bc==He||Bc==Ve||Bc==De||Bc==rs}function Iy(_c){return typeof _c=="number"&&_c>-1&&_c%1==0&&_c<=Ne}function k$(_c){var Bc=typeof _c;return _c!=null&&(Bc=="object"||Bc=="function")}function r1(_c){return _c!=null&&typeof _c=="object"}var D$=wc?Sc(wc):zg;function Wm(_c){return e1(_c)?Ey(_c):O$(_c)}function hd(){return[]}function ud(){return!1}W.exports=Cy}(lodash_isequal,lodash_isequal.exports)),lodash_isequal.exports}var lodash_isequalExports=requireLodash_isequal();const bs=getDefaultExportFromCjs(lodash_isequalExports),be$2="wc",fe$1=2,ne$1="core",O$2=`${be$2}@2:${ne$1}:`,Xe$1={name:ne$1,logger:"error"},Ze$1={database:":memory:"},Qe="crypto",_e$1="client_ed25519_seed",et=cjsExports$3.ONE_DAY,tt="keychain",it$1="0.3",st$1="messages",rt$1="0.3",nt$1=cjsExports$3.SIX_HOURS,ot$1="publisher",at$1="irn",ct$1="error",Ee="wss://relay.walletconnect.org",ht$1="relayer",w$1={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},lt$1="_subscription",T$2={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},ut$1=.1,oe$2="2.17.0",F$1={link_mode:"link_mode",relay:"relay"},dt$1="0.3",gt$1="WALLETCONNECT_CLIENT_ID",ve="WALLETCONNECT_LINK_MODE_APPS",A={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},pt$1="subscription",yt$1="0.3",Dt$1=cjsExports$3.FIVE_SECONDS*1e3,mt="pairing",bt="0.3",j$3={wc_pairingDelete:{req:{ttl:cjsExports$3.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:cjsExports$3.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:cjsExports$3.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:cjsExports$3.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:cjsExports$3.ONE_DAY,prompt:!1,tag:0},res:{ttl:cjsExports$3.ONE_DAY,prompt:!1,tag:0}}},q$1={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},P$1={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},ft="history",_t="0.3",Et="expirer",R$1={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},vt="0.3",wt="verify-api",Is$2="https://verify.walletconnect.com",It="https://verify.walletconnect.org",Z=It,Tt$2=`${Z}/v3`,Ct=[Is$2,It],St="echo",Pt="https://echo.walletconnect.com",z$2={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},M$1={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Cs={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},Ss$1={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},Ps$1={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Rs$1={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},Rt=.1,xt="event-client",Ot$1=86400,At="https://pulse.walletconnect.org/batch";function xs(W,Y){if(W.length>=255)throw new TypeError("Alphabet too long");for(var J=new Uint8Array(256),X=0;X<J.length;X++)J[X]=255;for(var Me=0;Me<W.length;Me++){var Se=W.charAt(Me),Ne=Se.charCodeAt(0);if(J[Ne]!==255)throw new TypeError(Se+" is ambiguous");J[Ne]=Me}var je=W.length,ke=W.charAt(0),De=Math.log(je)/Math.log(256),qe=Math.log(256)/Math.log(je);function Ue(Ve){if(Ve instanceof Uint8Array||(ArrayBuffer.isView(Ve)?Ve=new Uint8Array(Ve.buffer,Ve.byteOffset,Ve.byteLength):Array.isArray(Ve)&&(Ve=Uint8Array.from(Ve))),!(Ve instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(Ve.length===0)return"";for(var Ye=0,Fn=0,io=0,$o=Ve.length;io!==$o&&Ve[io]===0;)io++,Ye++;for(var Jo=($o-io)*qe+1>>>0,rs=new Uint8Array(Jo);io!==$o;){for(var Yo=Ve[io],zo=0,jo=Jo-1;(Yo!==0||zo<Fn)&&jo!==-1;jo--,zo++)Yo+=256*rs[jo]>>>0,rs[jo]=Yo%je>>>0,Yo=Yo/je>>>0;if(Yo!==0)throw new Error("Non-zero carry");Fn=zo,io++}for(var Vo=Jo-Fn;Vo!==Jo&&rs[Vo]===0;)Vo++;for(var os=ke.repeat(Ye);Vo<Jo;++Vo)os+=W.charAt(rs[Vo]);return os}function Ge(Ve){if(typeof Ve!="string")throw new TypeError("Expected String");if(Ve.length===0)return new Uint8Array;var Ye=0;if(Ve[Ye]!==" "){for(var Fn=0,io=0;Ve[Ye]===ke;)Fn++,Ye++;for(var $o=(Ve.length-Ye)*De+1>>>0,Jo=new Uint8Array($o);Ve[Ye];){var rs=J[Ve.charCodeAt(Ye)];if(rs===255)return;for(var Yo=0,zo=$o-1;(rs!==0||Yo<io)&&zo!==-1;zo--,Yo++)rs+=je*Jo[zo]>>>0,Jo[zo]=rs%256>>>0,rs=rs/256>>>0;if(rs!==0)throw new Error("Non-zero carry");io=Yo,Ye++}if(Ve[Ye]!==" "){for(var jo=$o-io;jo!==$o&&Jo[jo]===0;)jo++;for(var Vo=new Uint8Array(Fn+($o-jo)),os=Fn;jo!==$o;)Vo[os++]=Jo[jo++];return Vo}}}function He(Ve){var Ye=Ge(Ve);if(Ye)return Ye;throw new Error(`Non-${Y} character`)}return{encode:Ue,decodeUnsafe:Ge,decode:He}}var Os=xs,As=Os;const Nt=W=>{if(W instanceof Uint8Array&&W.constructor.name==="Uint8Array")return W;if(W instanceof ArrayBuffer)return new Uint8Array(W);if(ArrayBuffer.isView(W))return new Uint8Array(W.buffer,W.byteOffset,W.byteLength);throw new Error("Unknown type, must be binary type")},Ns$1=W=>new TextEncoder().encode(W),Ls$1=W=>new TextDecoder().decode(W);let zs$1=class{constructor(Y,J,X){this.name=Y,this.prefix=J,this.baseEncode=X}encode(Y){if(Y instanceof Uint8Array)return`${this.prefix}${this.baseEncode(Y)}`;throw Error("Unknown type, must be binary type")}},ks$1=class{constructor(Y,J,X){if(this.name=Y,this.prefix=J,J.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=J.codePointAt(0),this.baseDecode=X}decode(Y){if(typeof Y=="string"){if(Y.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(Y)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(Y.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(Y){return Lt$1(this,Y)}};class Ms{constructor(Y){this.decoders=Y}or(Y){return Lt$1(this,Y)}decode(Y){const J=Y[0],X=this.decoders[J];if(X)return X.decode(Y);throw RangeError(`Unable to decode multibase string ${JSON.stringify(Y)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Lt$1=(W,Y)=>new Ms({...W.decoders||{[W.prefix]:W},...Y.decoders||{[Y.prefix]:Y}});let $s$1=class{constructor(Y,J,X,Me){this.name=Y,this.prefix=J,this.baseEncode=X,this.baseDecode=Me,this.encoder=new zs$1(Y,J,X),this.decoder=new ks$1(Y,J,Me)}encode(Y){return this.encoder.encode(Y)}decode(Y){return this.decoder.decode(Y)}};const ae$2=({name:W,prefix:Y,encode:J,decode:X})=>new $s$1(W,Y,J,X),Q$2=({prefix:W,name:Y,alphabet:J})=>{const{encode:X,decode:Me}=As(J,Y);return ae$2({prefix:W,name:Y,encode:X,decode:Se=>Nt(Me(Se))})},Fs$1=(W,Y,J,X)=>{const Me={};for(let qe=0;qe<Y.length;++qe)Me[Y[qe]]=qe;let Se=W.length;for(;W[Se-1]==="=";)--Se;const Ne=new Uint8Array(Se*J/8|0);let je=0,ke=0,De=0;for(let qe=0;qe<Se;++qe){const Ue=Me[W[qe]];if(Ue===void 0)throw new SyntaxError(`Non-${X} character`);ke=ke<<J|Ue,je+=J,je>=8&&(je-=8,Ne[De++]=255&ke>>je)}if(je>=J||255&ke<<8-je)throw new SyntaxError("Unexpected end of data");return Ne},Us=(W,Y,J)=>{const X=Y[Y.length-1]==="=",Me=(1<<J)-1;let Se="",Ne=0,je=0;for(let ke=0;ke<W.length;++ke)for(je=je<<8|W[ke],Ne+=8;Ne>J;)Ne-=J,Se+=Y[Me&je>>Ne];if(Ne&&(Se+=Y[Me&je<<J-Ne]),X)for(;Se.length*J&7;)Se+="=";return Se},_=({name:W,prefix:Y,bitsPerChar:J,alphabet:X})=>ae$2({prefix:Y,name:W,encode(Me){return Us(Me,X,J)},decode(Me){return Fs$1(Me,X,J,W)}}),Ks=ae$2({prefix:"\0",name:"identity",encode:W=>Ls$1(W),decode:W=>Ns$1(W)});var Bs=Object.freeze({__proto__:null,identity:Ks});const Vs$1=_({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var js$1=Object.freeze({__proto__:null,base2:Vs$1});const qs$1=_({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Gs$1=Object.freeze({__proto__:null,base8:qs$1});const Hs=Q$2({prefix:"9",name:"base10",alphabet:"0123456789"});var Ys$1=Object.freeze({__proto__:null,base10:Hs});const Js$1=_({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ws$1=_({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Xs$1=Object.freeze({__proto__:null,base16:Js$1,base16upper:Ws$1});const Zs$1=_({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qs$1=_({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),er=_({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tr=_({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ir$1=_({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sr$1=_({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),rr=_({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),nr$1=_({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),or$1=_({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ar$1=Object.freeze({__proto__:null,base32:Zs$1,base32upper:Qs$1,base32pad:er,base32padupper:tr,base32hex:ir$1,base32hexupper:sr$1,base32hexpad:rr,base32hexpadupper:nr$1,base32z:or$1});const cr$1=Q$2({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),hr$1=Q$2({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var lr$2=Object.freeze({__proto__:null,base36:cr$1,base36upper:hr$1});const ur$1=Q$2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),dr$1=Q$2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var gr=Object.freeze({__proto__:null,base58btc:ur$1,base58flickr:dr$1});const pr$1=_({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),yr=_({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Dr$1=_({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),mr$1=_({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var br$1=Object.freeze({__proto__:null,base64:pr$1,base64pad:yr,base64url:Dr$1,base64urlpad:mr$1});const zt$1=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),fr$1=zt$1.reduce((W,Y,J)=>(W[J]=Y,W),[]),_r=zt$1.reduce((W,Y,J)=>(W[Y.codePointAt(0)]=J,W),[]);function Er$1(W){return W.reduce((Y,J)=>(Y+=fr$1[J],Y),"")}function vr$1(W){const Y=[];for(const J of W){const X=_r[J.codePointAt(0)];if(X===void 0)throw new Error(`Non-base256emoji character: ${J}`);Y.push(X)}return new Uint8Array(Y)}const wr=ae$2({prefix:"🚀",name:"base256emoji",encode:Er$1,decode:vr$1});var Ir=Object.freeze({__proto__:null,base256emoji:wr}),Tr$1=Mt,kt$1=128,Sr=-128,Pr=Math.pow(2,31);function Mt(W,Y,J){Y=Y||[],J=J||0;for(var X=J;W>=Pr;)Y[J++]=W&255|kt$1,W/=128;for(;W&Sr;)Y[J++]=W&255|kt$1,W>>>=7;return Y[J]=W|0,Mt.bytes=J-X+1,Y}var Rr$1=we$2,xr$1=128,$t$1=127;function we$2(W,X){var J=0,X=X||0,Me=0,Se=X,Ne,je=W.length;do{if(Se>=je)throw we$2.bytes=0,new RangeError("Could not decode varint");Ne=W[Se++],J+=Me<28?(Ne&$t$1)<<Me:(Ne&$t$1)*Math.pow(2,Me),Me+=7}while(Ne>=xr$1);return we$2.bytes=Se-X,J}var Or=Math.pow(2,7),Ar$1=Math.pow(2,14),Nr=Math.pow(2,21),Lr$1=Math.pow(2,28),zr$1=Math.pow(2,35),kr$1=Math.pow(2,42),Mr$1=Math.pow(2,49),$r=Math.pow(2,56),Fr$1=Math.pow(2,63),Ur$1=function(W){return W<Or?1:W<Ar$1?2:W<Nr?3:W<Lr$1?4:W<zr$1?5:W<kr$1?6:W<Mr$1?7:W<$r?8:W<Fr$1?9:10},Kr$1={encode:Tr$1,decode:Rr$1,encodingLength:Ur$1},Ft$1=Kr$1;const Ut$1=(W,Y,J=0)=>(Ft$1.encode(W,Y,J),Y),Kt$1=W=>Ft$1.encodingLength(W),Ie=(W,Y)=>{const J=Y.byteLength,X=Kt$1(W),Me=X+Kt$1(J),Se=new Uint8Array(Me+J);return Ut$1(W,Se,0),Ut$1(J,Se,X),Se.set(Y,Me),new Br(W,J,Y,Se)};class Br{constructor(Y,J,X,Me){this.code=Y,this.size=J,this.digest=X,this.bytes=Me}}const Bt=({name:W,code:Y,encode:J})=>new Vr(W,Y,J);class Vr{constructor(Y,J,X){this.name=Y,this.code=J,this.encode=X}digest(Y){if(Y instanceof Uint8Array){const J=this.encode(Y);return J instanceof Uint8Array?Ie(this.code,J):J.then(X=>Ie(this.code,X))}else throw Error("Unknown type, must be binary type")}}const Vt=W=>async Y=>new Uint8Array(await crypto.subtle.digest(W,Y)),jr$1=Bt({name:"sha2-256",code:18,encode:Vt("SHA-256")}),qr$1=Bt({name:"sha2-512",code:19,encode:Vt("SHA-512")});var Gr$1=Object.freeze({__proto__:null,sha256:jr$1,sha512:qr$1});const jt$1=0,Hr$1="identity",qt=Nt,Yr=W=>Ie(jt$1,qt(W)),Jr$1={code:jt$1,name:Hr$1,encode:qt,digest:Yr};var Wr=Object.freeze({__proto__:null,identity:Jr$1});new TextEncoder,new TextDecoder;const Gt$1={...Bs,...js$1,...Gs$1,...Ys$1,...Xs$1,...ar$1,...lr$2,...gr,...br$1,...Ir};({...Gr$1,...Wr});function Xr(W=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(W):new Uint8Array(W)}function Ht$1(W,Y,J,X){return{name:W,prefix:Y,encoder:{name:W,prefix:Y,encode:J},decoder:{decode:X}}}const Yt=Ht$1("utf8","u",W=>"u"+new TextDecoder("utf8").decode(W),W=>new TextEncoder().encode(W.substring(1))),Te=Ht$1("ascii","a",W=>{let Y="a";for(let J=0;J<W.length;J++)Y+=String.fromCharCode(W[J]);return Y},W=>{W=W.substring(1);const Y=Xr(W.length);for(let J=0;J<W.length;J++)Y[J]=W.charCodeAt(J);return Y}),Zr={utf8:Yt,"utf-8":Yt,hex:Gt$1.base16,latin1:Te,ascii:Te,binary:Te,...Gt$1};function Qr$1(W,Y="utf8"){const J=Zr[Y];if(!J)throw new Error(`Unsupported encoding "${Y}"`);return(Y==="utf8"||Y==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(W,"utf8"):J.decoder.decode(`${J.prefix}${W}`)}let Jt$1=class{constructor(Y,J){this.core=Y,this.logger=J,this.keychain=new Map,this.name=tt,this.version=it$1,this.initialized=!1,this.storagePrefix=O$2,this.init=async()=>{if(!this.initialized){const X=await this.getKeyChain();typeof X<"u"&&(this.keychain=X),this.initialized=!0}},this.has=X=>(this.isInitialized(),this.keychain.has(X)),this.set=async(X,Me)=>{this.isInitialized(),this.keychain.set(X,Me),await this.persist()},this.get=X=>{this.isInitialized();const Me=this.keychain.get(X);if(typeof Me>"u"){const{message:Se}=xe$1("NO_MATCHING_KEY",`${this.name}: ${X}`);throw new Error(Se)}return Me},this.del=async X=>{this.isInitialized(),this.keychain.delete(X),await this.persist()},this.core=Y,this.logger=E$4(J,this.name)}get context(){return y$6(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(Y){await this.core.storage.setItem(this.storageKey,cs(Y))}async getKeyChain(){const Y=await this.core.storage.getItem(this.storageKey);return typeof Y<"u"?ls(Y):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:Y}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Y)}}};class Wt{constructor(Y,J,X){this.core=Y,this.logger=J,this.name=Qe,this.randomSessionIdentifier=Bu(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=Me=>(this.isInitialized(),this.keychain.has(Me)),this.getClientId=async()=>{this.isInitialized();const Me=await this.getClientSeed(),Se=generateKeyPair(Me);return encodeIss(Se.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const Me=_u();return this.setPrivateKey(Me.publicKey,Me.privateKey)},this.signJWT=async Me=>{this.isInitialized();const Se=await this.getClientSeed(),Ne=generateKeyPair(Se),je=this.randomSessionIdentifier;return await signJWT(je,Me,et,Ne)},this.generateSharedKey=(Me,Se,Ne)=>{this.isInitialized();const je=this.getPrivateKey(Me),ke=Cu(je,Se);return this.setSymKey(ke,Ne)},this.setSymKey=async(Me,Se)=>{this.isInitialized();const Ne=Se||Ru(Me);return await this.keychain.set(Ne,Me),Ne},this.deleteKeyPair=async Me=>{this.isInitialized(),await this.keychain.del(Me)},this.deleteSymKey=async Me=>{this.isInitialized(),await this.keychain.del(Me)},this.encode=async(Me,Se,Ne)=>{this.isInitialized();const je=so(Ne),ke=safeJsonStringify(Se);if(qu(je))return Tu(ke,Ne==null?void 0:Ne.encoding);if(ku(je)){const Ge=je.senderPublicKey,He=je.receiverPublicKey;Me=await this.generateSharedKey(Ge,He)}const De=this.getSymKey(Me),{type:qe,senderPublicKey:Ue}=je;return Pu({type:qe,symKey:De,message:ke,senderPublicKey:Ue,encoding:Ne==null?void 0:Ne.encoding})},this.decode=async(Me,Se,Ne)=>{this.isInitialized();const je=Uu(Se,Ne);if(qu(je)){const ke=Fu(Se,Ne==null?void 0:Ne.encoding);return safeJsonParse(ke)}if(ku(je)){const ke=je.receiverPublicKey,De=je.senderPublicKey;Me=await this.generateSharedKey(ke,De)}try{const ke=this.getSymKey(Me),De=Du({symKey:ke,encoded:Se,encoding:Ne==null?void 0:Ne.encoding});return safeJsonParse(De)}catch(ke){this.logger.error(`Failed to decode message from topic: '${Me}', clientId: '${await this.getClientId()}'`),this.logger.error(ke)}},this.getPayloadType=(Me,Se=tn$1)=>{const Ne=Wr$1({encoded:Me,encoding:Se});return Ze$2(Ne.type)},this.getPayloadSenderPublicKey=(Me,Se=tn$1)=>{const Ne=Wr$1({encoded:Me,encoding:Se});return Ne.senderPublicKey?toString(Ne.senderPublicKey,Lt$2):void 0},this.core=Y,this.logger=E$4(J,this.name),this.keychain=X||new Jt$1(this.core,this.logger)}get context(){return y$6(this.logger)}async setPrivateKey(Y,J){return await this.keychain.set(Y,J),Y}getPrivateKey(Y){return this.keychain.get(Y)}async getClientSeed(){let Y="";try{Y=this.keychain.get(_e$1)}catch{Y=Bu(),await this.keychain.set(_e$1,Y)}return Qr$1(Y,"base16")}getSymKey(Y){return this.keychain.get(Y)}isInitialized(){if(!this.initialized){const{message:Y}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Y)}}}class Xt extends a$1{constructor(Y,J){super(Y,J),this.logger=Y,this.core=J,this.messages=new Map,this.name=st$1,this.version=rt$1,this.initialized=!1,this.storagePrefix=O$2,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const X=await this.getRelayerMessages();typeof X<"u"&&(this.messages=X),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(X){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(X)}finally{this.initialized=!0}}},this.set=async(X,Me)=>{this.isInitialized();const Se=Ou(Me);let Ne=this.messages.get(X);return typeof Ne>"u"&&(Ne={}),typeof Ne[Se]<"u"||(Ne[Se]=Me,this.messages.set(X,Ne),await this.persist()),Se},this.get=X=>{this.isInitialized();let Me=this.messages.get(X);return typeof Me>"u"&&(Me={}),Me},this.has=(X,Me)=>{this.isInitialized();const Se=this.get(X),Ne=Ou(Me);return typeof Se[Ne]<"u"},this.del=async X=>{this.isInitialized(),this.messages.delete(X),await this.persist()},this.logger=E$4(Y,this.name),this.core=J}get context(){return y$6(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(Y){await this.core.storage.setItem(this.storageKey,cs(Y))}async getRelayerMessages(){const Y=await this.core.storage.getItem(this.storageKey);return typeof Y<"u"?ls(Y):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:Y}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Y)}}}class en extends g$2{constructor(Y,J){super(Y,J),this.relayer=Y,this.logger=J,this.events=new eventsExports.EventEmitter,this.name=ot$1,this.queue=new Map,this.publishTimeout=cjsExports$3.toMiliseconds(cjsExports$3.ONE_MINUTE),this.failedPublishTimeout=cjsExports$3.toMiliseconds(cjsExports$3.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(X,Me,Se)=>{var Ne;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:X,message:Me,opts:Se}});const je=(Se==null?void 0:Se.ttl)||nt$1,ke=zu(Se),De=(Se==null?void 0:Se.prompt)||!1,qe=(Se==null?void 0:Se.tag)||0,Ue=(Se==null?void 0:Se.id)||getBigIntRpcId().toString(),Ge={topic:X,message:Me,opts:{ttl:je,relay:ke,prompt:De,tag:qe,id:Ue,attestation:Se==null?void 0:Se.attestation}},He=`Failed to publish payload, please try again. id:${Ue} tag:${qe}`,Ve=Date.now();let Ye,Fn=1;try{for(;Ye===void 0;){if(Date.now()-Ve>this.publishTimeout)throw new Error(He);this.logger.trace({id:Ue,attempts:Fn},`publisher.publish - attempt ${Fn}`),Ye=await await ms$1(this.rpcPublish(X,Me,je,ke,De,qe,Ue,Se==null?void 0:Se.attestation).catch(io=>this.logger.warn(io)),this.publishTimeout,He),Fn++,Ye||await new Promise(io=>setTimeout(io,this.failedPublishTimeout))}this.relayer.events.emit(w$1.publish,Ge),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:Ue,topic:X,message:Me,opts:Se}})}catch(io){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(io),(Ne=Se==null?void 0:Se.internal)!=null&&Ne.throwOnFailedPublish)throw io;this.queue.set(Ue,Ge)}},this.on=(X,Me)=>{this.events.on(X,Me)},this.once=(X,Me)=>{this.events.once(X,Me)},this.off=(X,Me)=>{this.events.off(X,Me)},this.removeListener=(X,Me)=>{this.events.removeListener(X,Me)},this.relayer=Y,this.logger=E$4(J,this.name),this.registerEventListeners()}get context(){return y$6(this.logger)}rpcPublish(Y,J,X,Me,Se,Ne,je,ke){var De,qe,Ue,Ge;const He={method:ju(Me.protocol).publish,params:{topic:Y,message:J,ttl:X,prompt:Se,tag:Ne,attestation:ke},id:je};return Pe((De=He.params)==null?void 0:De.prompt)&&((qe=He.params)==null||delete qe.prompt),Pe((Ue=He.params)==null?void 0:Ue.tag)&&((Ge=He.params)==null||delete Ge.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:He}),this.relayer.request(He)}removeRequestFromQueue(Y){this.queue.delete(Y)}checkQueue(){this.queue.forEach(async Y=>{const{topic:J,message:X,opts:Me}=Y;await this.publish(J,X,Me)})}registerEventListeners(){this.relayer.core.heartbeat.on(r$1.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(w$1.connection_stalled);return}this.checkQueue()}),this.relayer.on(w$1.message_ack,Y=>{this.removeRequestFromQueue(Y.id.toString())})}}class tn{constructor(){this.map=new Map,this.set=(Y,J)=>{const X=this.get(Y);this.exists(Y,J)||this.map.set(Y,[...X,J])},this.get=Y=>this.map.get(Y)||[],this.exists=(Y,J)=>this.get(Y).includes(J),this.delete=(Y,J)=>{if(typeof J>"u"){this.map.delete(Y);return}if(!this.map.has(Y))return;const X=this.get(Y);if(!this.exists(Y,J))return;const Me=X.filter(Se=>Se!==J);if(!Me.length){this.map.delete(Y);return}this.map.set(Y,Me)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var sn=Object.defineProperty,rn=Object.defineProperties,nn=Object.getOwnPropertyDescriptors,Zt$1=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable,Qt=(W,Y,J)=>Y in W?sn(W,Y,{enumerable:!0,configurable:!0,writable:!0,value:J}):W[Y]=J,ee$1=(W,Y)=>{for(var J in Y||(Y={}))on.call(Y,J)&&Qt(W,J,Y[J]);if(Zt$1)for(var J of Zt$1(Y))an.call(Y,J)&&Qt(W,J,Y[J]);return W},Ce$2=(W,Y)=>rn(W,nn(Y));class ei extends d$1{constructor(Y,J){super(Y,J),this.relayer=Y,this.logger=J,this.subscriptions=new Map,this.topicMap=new tn,this.events=new eventsExports.EventEmitter,this.name=pt$1,this.version=yt$1,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=O$2,this.subscribeTimeout=cjsExports$3.toMiliseconds(cjsExports$3.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(X,Me)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:X,opts:Me}});try{const Se=zu(Me),Ne={topic:X,relay:Se,transportType:Me==null?void 0:Me.transportType};this.pending.set(X,Ne);const je=await this.rpcSubscribe(X,Se,Me==null?void 0:Me.transportType);return typeof je=="string"&&(this.onSubscribe(je,Ne),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:X,opts:Me}})),je}catch(Se){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(Se),Se}},this.unsubscribe=async(X,Me)=>{await this.restartToComplete(),this.isInitialized(),typeof(Me==null?void 0:Me.id)<"u"?await this.unsubscribeById(X,Me.id,Me):await this.unsubscribeByTopic(X,Me)},this.isSubscribed=async X=>{if(this.topics.includes(X))return!0;const Me=`${this.pendingSubscriptionWatchLabel}_${X}`;return await new Promise((Se,Ne)=>{const je=new cjsExports$3.Watch;je.start(Me);const ke=setInterval(()=>{!this.pending.has(X)&&this.topics.includes(X)&&(clearInterval(ke),je.stop(Me),Se(!0)),je.elapsed(Me)>=Dt$1&&(clearInterval(ke),je.stop(Me),Ne(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(X,Me)=>{this.events.on(X,Me)},this.once=(X,Me)=>{this.events.once(X,Me)},this.off=(X,Me)=>{this.events.off(X,Me)},this.removeListener=(X,Me)=>{this.events.removeListener(X,Me)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=Y,this.logger=E$4(J,this.name),this.clientId=""}get context(){return y$6(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(Y,J){let X=!1;try{X=this.getSubscription(Y).topic===J}catch{}return X}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(Y,J){const X=this.topicMap.get(Y);await Promise.all(X.map(async Me=>await this.unsubscribeById(Y,Me,J)))}async unsubscribeById(Y,J,X){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:Y,id:J,opts:X}});try{const Me=zu(X);await this.rpcUnsubscribe(Y,J,Me);const Se=er$1("USER_DISCONNECTED",`${this.name}, ${Y}`);await this.onUnsubscribe(Y,J,Se),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:Y,id:J,opts:X}})}catch(Me){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(Me),Me}}async rpcSubscribe(Y,J,X=F$1.relay){X===F$1.relay&&await this.restartToComplete();const Me={method:ju(J.protocol).subscribe,params:{topic:Y}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:Me});try{const Se=Ou(Y+this.clientId);return X===F$1.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(Me).catch(Ne=>this.logger.warn(Ne))},cjsExports$3.toMiliseconds(cjsExports$3.ONE_SECOND)),Se):await await ms$1(this.relayer.request(Me).catch(Ne=>this.logger.warn(Ne)),this.subscribeTimeout)?Se:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(w$1.connection_stalled)}return null}async rpcBatchSubscribe(Y){if(!Y.length)return;const J=Y[0].relay,X={method:ju(J.protocol).batchSubscribe,params:{topics:Y.map(Me=>Me.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:X});try{return await await ms$1(this.relayer.request(X).catch(Me=>this.logger.warn(Me)),this.subscribeTimeout)}catch{this.relayer.events.emit(w$1.connection_stalled)}}async rpcBatchFetchMessages(Y){if(!Y.length)return;const J=Y[0].relay,X={method:ju(J.protocol).batchFetchMessages,params:{topics:Y.map(Se=>Se.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:X});let Me;try{Me=await await ms$1(this.relayer.request(X).catch(Se=>this.logger.warn(Se)),this.subscribeTimeout)}catch{this.relayer.events.emit(w$1.connection_stalled)}return Me}rpcUnsubscribe(Y,J,X){const Me={method:ju(X.protocol).unsubscribe,params:{topic:Y,id:J}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:Me}),this.relayer.request(Me)}onSubscribe(Y,J){this.setSubscription(Y,Ce$2(ee$1({},J),{id:Y})),this.pending.delete(J.topic)}onBatchSubscribe(Y){Y.length&&Y.forEach(J=>{this.setSubscription(J.id,ee$1({},J)),this.pending.delete(J.topic)})}async onUnsubscribe(Y,J,X){this.events.removeAllListeners(J),this.hasSubscription(J,Y)&&this.deleteSubscription(J,X),await this.relayer.messages.del(Y)}async setRelayerSubscriptions(Y){await this.relayer.core.storage.setItem(this.storageKey,Y)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(Y,J){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:Y,subscription:J}),this.addSubscription(Y,J)}addSubscription(Y,J){this.subscriptions.set(Y,ee$1({},J)),this.topicMap.set(J.topic,Y),this.events.emit(A.created,J)}getSubscription(Y){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:Y});const J=this.subscriptions.get(Y);if(!J){const{message:X}=xe$1("NO_MATCHING_KEY",`${this.name}: ${Y}`);throw new Error(X)}return J}deleteSubscription(Y,J){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:Y,reason:J});const X=this.getSubscription(Y);this.subscriptions.delete(Y),this.topicMap.delete(X.topic,Y),this.events.emit(A.deleted,Ce$2(ee$1({},X),{reason:J}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(A.sync)}async reset(){if(this.cached.length){const Y=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let J=0;J<Y;J++){const X=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(X),await this.batchSubscribe(X)}}this.events.emit(A.resubscribed)}async restore(){try{const Y=await this.getRelayerSubscriptions();if(typeof Y>"u"||!Y.length)return;if(this.subscriptions.size){const{message:J}=xe$1("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(J),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(J)}this.cached=Y,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(Y){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(Y)}}async batchSubscribe(Y){if(!Y.length)return;const J=await this.rpcBatchSubscribe(Y);Nr$1(J)&&this.onBatchSubscribe(J.map((X,Me)=>Ce$2(ee$1({},Y[Me]),{id:X})))}async batchFetchMessages(Y){if(!Y.length)return;this.logger.trace(`Fetching batch messages for ${Y.length} subscriptions`);const J=await this.rpcBatchFetchMessages(Y);J&&J.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(J.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const Y=[];this.pending.forEach(J=>{Y.push(J)}),await this.batchSubscribe(Y),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(r$1.pulse,async()=>{await this.checkPending()}),this.events.on(A.created,async Y=>{const J=A.created;this.logger.info(`Emitting ${J}`),this.logger.debug({type:"event",event:J,data:Y}),await this.persist()}),this.events.on(A.deleted,async Y=>{const J=A.deleted;this.logger.info(`Emitting ${J}`),this.logger.debug({type:"event",event:J,data:Y}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:Y}=xe$1("NOT_INITIALIZED",this.name);throw new Error(Y)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(Y=>{const J=setInterval(()=>{this.restartInProgress||(clearInterval(J),Y())},this.pollingInterval)})}}var cn=Object.defineProperty,ti=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,ii=(W,Y,J)=>Y in W?cn(W,Y,{enumerable:!0,configurable:!0,writable:!0,value:J}):W[Y]=J,un=(W,Y)=>{for(var J in Y)hn.call(Y,J)&&ii(W,J,Y[J]);if(ti)for(var J of ti(Y))ln.call(Y,J)&&ii(W,J,Y[J]);return W};class si extends u$1{constructor(Y){super(Y),this.protocol="wc",this.version=2,this.events=new eventsExports.EventEmitter,this.name=ht$1,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=cjsExports$3.toMiliseconds(cjsExports$3.THIRTY_SECONDS+cjsExports$3.ONE_SECOND),this.request=async J=>{var X,Me;this.logger.debug("Publishing Request Payload");const Se=J.id||getBigIntRpcId().toString();await this.toEstablishConnection();try{const Ne=this.provider.request(J);this.requestsInFlight.set(Se,{promise:Ne,request:J}),this.logger.trace({id:Se,method:J.method,topic:(X=J.params)==null?void 0:X.topic},"relayer.request - attempt to publish...");const je=await new Promise(async(ke,De)=>{const qe=()=>{De(new Error(`relayer.request - publish interrupted, id: ${Se}`))};this.provider.on(T$2.disconnect,qe);const Ue=await Ne;this.provider.off(T$2.disconnect,qe),ke(Ue)});return this.logger.trace({id:Se,method:J.method,topic:(Me=J.params)==null?void 0:Me.topic},"relayer.request - published"),je}catch(Ne){throw this.logger.debug(`Failed to Publish Request: ${Se}`),Ne}finally{this.requestsInFlight.delete(Se)}},this.resetPingTimeout=()=>{if(bi$1())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var J,X,Me;(Me=(X=(J=this.provider)==null?void 0:J.connection)==null?void 0:X.socket)==null||Me.terminate()},this.heartBeatTimeout)}catch(J){this.logger.warn(J)}},this.onPayloadHandler=J=>{this.onProviderPayload(J),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(w$1.connect)},this.onDisconnectHandler=()=>{th{"ActionError":{"index":0,"kind":{"FunctionCallError":{"MethodResolveError":"MethodNotFound"}}}}
1 automatic refund step from the network not shown.
This page reads FastNEAR's public transaction index and stores nothing. This command asks a NEAR archival node for the same transaction and needs no keys.
curl -s https://archival-rpc.testnet.fastnear.com -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tx","params":{"tx_hash":"CMdeH3HEG1BmJxF9UfZXL2ftGFgMVPZdcj45BFFevHHa","sender_account_id":"sleetcreate.testnet","wait_until":"FINAL"}}'Vouch has its own page because testnet.nearblocks.io stopped indexing on 27 Sep 2026, so it can't show newer transactions.