@dcl/auth-site 1.4.1-8188151648.commit-8d11053 → 1.4.1-8236831119.commit-7ae7b49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{fortmatic-4d534e89.js → fortmatic-fab3cf83.js} +2 -2
- package/assets/{fortmatic-4d534e89.js.map → fortmatic-fab3cf83.js.map} +1 -1
- package/assets/{index-769379c8.js → index-04fbdf39.js} +2 -2
- package/assets/{index-769379c8.js.map → index-04fbdf39.js.map} +1 -1
- package/assets/{index-69f33953.js → index-11c29415.js} +2 -2
- package/assets/{index-69f33953.js.map → index-11c29415.js.map} +1 -1
- package/assets/{index-8bd01907.js → index-2742e622.js} +2 -2
- package/assets/{index-8bd01907.js.map → index-2742e622.js.map} +1 -1
- package/assets/{index-ca850877.js → index-4e5b2678.js} +2 -2
- package/assets/{index-ca850877.js.map → index-4e5b2678.js.map} +1 -1
- package/assets/{index-e56dd797.js → index-9959df27.js} +16 -16
- package/assets/{index-e56dd797.js.map → index-9959df27.js.map} +1 -1
- package/assets/{index-a700eb57.css → index-ecafd01d.css} +3 -3
- package/assets/{index-bacb84f5.js → index-f9c772b7.js} +2 -2
- package/assets/{index-bacb84f5.js.map → index-f9c772b7.js.map} +1 -1
- package/assets/{index.es-9296a1a7.js → index.es-5d9b029f.js} +2 -2
- package/assets/{index.es-9296a1a7.js.map → index.es-5d9b029f.js.map} +1 -1
- package/index.html +2 -2
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as Q_,b as zu,d as X_,r as Z_,p as hi,g as Et,c as Pr,e as zr,a as eb,$ as Bu,f as lf}from"./index-e56dd797.js";import{t as tb}from"./tslib.es6-c2094241.js";const rb=Symbol(),ff=Object.getPrototypeOf,Du=new WeakMap,ib=i=>i&&(Du.has(i)?Du.get(i):ff(i)===Object.prototype||ff(i)===Array.prototype),nb=i=>ib(i)&&i[rb]||null,df=(i,e=!0)=>{Du.set(i,e)},Zc=i=>typeof i=="object"&&i!==null,zi=new WeakMap,Zo=new WeakSet,sb=(i=Object.is,e=(b,E)=>new Proxy(b,E),r=b=>Zc(b)&&!Zo.has(b)&&(Array.isArray(b)||!(Symbol.iterator in b))&&!(b instanceof WeakMap)&&!(b instanceof WeakSet)&&!(b instanceof Error)&&!(b instanceof Number)&&!(b instanceof Date)&&!(b instanceof String)&&!(b instanceof RegExp)&&!(b instanceof ArrayBuffer),s=b=>{switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:throw b}},o=new WeakMap,h=(b,E,C=s)=>{const N=o.get(b);if((N==null?void 0:N[0])===E)return N[1];const P=Array.isArray(b)?[]:Object.create(Object.getPrototypeOf(b));return df(P,!0),o.set(b,[E,P]),Reflect.ownKeys(b).forEach(F=>{if(Object.getOwnPropertyDescriptor(P,F))return;const k=Reflect.get(b,F),K={value:k,enumerable:!0,configurable:!0};if(Zo.has(k))df(k,!1);else if(k instanceof Promise)delete K.value,K.get=()=>C(k);else if(zi.has(k)){const[ee,A]=zi.get(k);K.value=h(ee,A(),C)}Object.defineProperty(P,F,K)}),Object.preventExtensions(P)},p=new WeakMap,f=[1,1],g=b=>{if(!Zc(b))throw new Error("object required");const E=p.get(b);if(E)return E;let C=f[0];const N=new Set,P=(B,z=++f[0])=>{C!==z&&(C=z,N.forEach(W=>W(B,z)))};let F=f[1];const k=(B=++f[1])=>(F!==B&&!N.size&&(F=B,ee.forEach(([z])=>{const W=z[1](B);W>C&&(C=W)})),C),K=B=>(z,W)=>{const oe=[...z];oe[1]=[B,...oe[1]],P(oe,W)},ee=new Map,A=(B,z)=>{if(N.size){const W=z[3](K(B));ee.set(B,[z,W])}else ee.set(B,[z])},$=B=>{var z;const W=ee.get(B);W&&(ee.delete(B),(z=W[1])==null||z.call(W))},S=B=>(N.add(B),N.size===1&&ee.forEach(([W,oe],fe)=>{const T=W[3](K(fe));ee.set(fe,[W,T])}),()=>{N.delete(B),N.size===0&&ee.forEach(([W,oe],fe)=>{oe&&(oe(),ee.set(fe,[W]))})}),I=Array.isArray(b)?[]:Object.create(Object.getPrototypeOf(b)),c=e(I,{deleteProperty(B,z){const W=Reflect.get(B,z);$(z);const oe=Reflect.deleteProperty(B,z);return oe&&P(["delete",[z],W]),oe},set(B,z,W,oe){const fe=Reflect.has(B,z),T=Reflect.get(B,z,oe);if(fe&&(i(T,W)||p.has(W)&&i(T,p.get(W))))return!0;$(z),Zc(W)&&(W=nb(W)||W);let H=W;if(W instanceof Promise)W.then(ce=>{W.status="fulfilled",W.value=ce,P(["resolve",[z],ce])}).catch(ce=>{W.status="rejected",W.reason=ce,P(["reject",[z],ce])});else{!zi.has(W)&&r(W)&&(H=g(W));const ce=!Zo.has(H)&&zi.get(H);ce&&A(z,ce)}return Reflect.set(B,z,H,oe),P(["set",[z],W,T]),!0}});p.set(b,c);const m=[I,k,h,S];return zi.set(c,m),Reflect.ownKeys(b).forEach(B=>{const z=Object.getOwnPropertyDescriptor(b,B);"value"in z&&(c[B]=b[B],delete z.value,delete z.writable),Object.defineProperty(I,B,z)}),c})=>[g,zi,Zo,i,e,r,s,o,h,p,f],[ob]=sb();function Vi(i={}){return ob(i)}function yn(i,e,r){const s=zi.get(i);let o;const h=[],p=s[3];let f=!1;const b=p(E=>{if(h.push(E),r){e(h.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,f&&e(h.splice(0))}))});return f=!0,()=>{f=!1,b()}}function ab(i,e){const r=zi.get(i),[s,o,h]=r;return h(s,o(),e)}const Wt=Vi({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),np={state:Wt,subscribe(i){return yn(Wt,()=>i(Wt))},push(i,e){i!==Wt.view&&(Wt.view=i,e&&(Wt.data=e),Wt.history.push(i))},reset(i){Wt.view=i,Wt.history=[i]},replace(i){Wt.history.length>1&&(Wt.history[Wt.history.length-1]=i,Wt.view=i)},goBack(){if(Wt.history.length>1){Wt.history.pop();const[i]=Wt.history.slice(-1);Wt.view=i}},setData(i){Wt.data=i}},rr={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return rr.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const i=navigator.userAgent.toLowerCase();return rr.isMobile()&&(i.includes("iphone")||i.includes("ipad"))},isHttpUrl(i){return i.startsWith("http://")||i.startsWith("https://")},isArray(i){return Array.isArray(i)&&i.length>0},formatNativeUrl(i,e,r){if(rr.isHttpUrl(i))return this.formatUniversalUrl(i,e,r);let s=i;s.includes("://")||(s=i.replaceAll("/","").replaceAll(":",""),s=`${s}://`),s.endsWith("/")||(s=`${s}/`),this.setWalletConnectDeepLink(s,r);const o=encodeURIComponent(e);return`${s}wc?uri=${o}`},formatUniversalUrl(i,e,r){if(!rr.isHttpUrl(i))return this.formatNativeUrl(i,e,r);let s=i;s.endsWith("/")||(s=`${s}/`),this.setWalletConnectDeepLink(s,r);const o=encodeURIComponent(e);return`${s}wc?uri=${o}`},async wait(i){return new Promise(e=>{setTimeout(e,i)})},openHref(i,e){window.open(i,e,"noreferrer noopener")},setWalletConnectDeepLink(i,e){try{localStorage.setItem(rr.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:i,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(i){try{const[e]=i.split("?");localStorage.setItem(rr.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(rr.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(rr.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var i;const e=(i=np.state.data)==null?void 0:i.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},cb=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),er=Vi({enabled:cb,userSessionId:"",events:[],connectedWalletId:void 0}),ub={state:er,subscribe(i){return yn(er.events,()=>i(ab(er.events[er.events.length-1])))},initialize(){er.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(er.userSessionId=crypto.randomUUID())},setConnectedWalletId(i){er.connectedWalletId=i},click(i){if(er.enabled){const e={type:"CLICK",name:i.name,userSessionId:er.userSessionId,timestamp:Date.now(),data:i};er.events.push(e)}},track(i){if(er.enabled){const e={type:"TRACK",name:i.name,userSessionId:er.userSessionId,timestamp:Date.now(),data:i};er.events.push(e)}},view(i){if(er.enabled){const e={type:"VIEW",name:i.name,userSessionId:er.userSessionId,timestamp:Date.now(),data:i};er.events.push(e)}}},oi=Vi({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Zr={state:oi,subscribe(i){return yn(oi,()=>i(oi))},setChains(i){oi.chains=i},setWalletConnectUri(i){oi.walletConnectUri=i},setIsCustomDesktop(i){oi.isCustomDesktop=i},setIsCustomMobile(i){oi.isCustomMobile=i},setIsDataLoaded(i){oi.isDataLoaded=i},setIsUiLoaded(i){oi.isUiLoaded=i},setIsAuth(i){oi.isAuth=i}},ea=Vi({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Jn={state:ea,subscribe(i){return yn(ea,()=>i(ea))},setConfig(i){var e,r;ub.initialize(),Zr.setChains(i.chains),Zr.setIsAuth(!!i.enableAuthMode),Zr.setIsCustomMobile(!!((e=i.mobileWallets)!=null&&e.length)),Zr.setIsCustomDesktop(!!((r=i.desktopWallets)!=null&&r.length)),rr.setModalVersionInStorage(),Object.assign(ea,i)}};var hb=Object.defineProperty,pf=Object.getOwnPropertySymbols,lb=Object.prototype.hasOwnProperty,fb=Object.prototype.propertyIsEnumerable,gf=(i,e,r)=>e in i?hb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,db=(i,e)=>{for(var r in e||(e={}))lb.call(e,r)&&gf(i,r,e[r]);if(pf)for(var r of pf(e))fb.call(e,r)&&gf(i,r,e[r]);return i};const Su="https://explorer-api.walletconnect.com",Iu="wcm",xu="js-2.6.2";async function ta(i,e){const r=db({sdkType:Iu,sdkVersion:xu},e),s=new URL(i,Su);return s.searchParams.append("projectId",Jn.state.projectId),Object.entries(r).forEach(([o,h])=>{h&&s.searchParams.append(o,String(h))}),(await fetch(s)).json()}const hn={async getDesktopListings(i){return ta("/w3m/v1/getDesktopListings",i)},async getMobileListings(i){return ta("/w3m/v1/getMobileListings",i)},async getInjectedListings(i){return ta("/w3m/v1/getInjectedListings",i)},async getAllListings(i){return ta("/w3m/v1/getAllListings",i)},getWalletImageUrl(i){return`${Su}/w3m/v1/getWalletImage/${i}?projectId=${Jn.state.projectId}&sdkType=${Iu}&sdkVersion=${xu}`},getAssetImageUrl(i){return`${Su}/w3m/v1/getAssetImage/${i}?projectId=${Jn.state.projectId}&sdkType=${Iu}&sdkVersion=${xu}`}};var pb=Object.defineProperty,vf=Object.getOwnPropertySymbols,gb=Object.prototype.hasOwnProperty,vb=Object.prototype.propertyIsEnumerable,yf=(i,e,r)=>e in i?pb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,yb=(i,e)=>{for(var r in e||(e={}))gb.call(e,r)&&yf(i,r,e[r]);if(vf)for(var r of vf(e))vb.call(e,r)&&yf(i,r,e[r]);return i};const mf=rr.isMobile(),ai=Vi({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),eI={state:ai,async getRecomendedWallets(){const{explorerRecommendedWalletIds:i,explorerExcludedWalletIds:e}=Jn.state;if(i==="NONE"||e==="ALL"&&!i)return ai.recomendedWallets;if(rr.isArray(i)){const r={recommendedIds:i.join(",")},{listings:s}=await hn.getAllListings(r),o=Object.values(s);o.sort((h,p)=>{const f=i.indexOf(h.id),g=i.indexOf(p.id);return f-g}),ai.recomendedWallets=o}else{const{chains:r,isAuth:s}=Zr.state,o=r==null?void 0:r.join(","),h=rr.isArray(e),p={page:1,sdks:s?"auth_v1":void 0,entries:rr.RECOMMENDED_WALLET_AMOUNT,chains:o,version:2,excludedIds:h?e.join(","):void 0},{listings:f}=mf?await hn.getMobileListings(p):await hn.getDesktopListings(p);ai.recomendedWallets=Object.values(f)}return ai.recomendedWallets},async getWallets(i){const e=yb({},i),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:s}=Jn.state,{recomendedWallets:o}=ai;if(s==="ALL")return ai.wallets;o.length?e.excludedIds=o.map(C=>C.id).join(","):rr.isArray(r)&&(e.excludedIds=r.join(",")),rr.isArray(s)&&(e.excludedIds=[e.excludedIds,s].filter(Boolean).join(",")),Zr.state.isAuth&&(e.sdks="auth_v1");const{page:h,search:p}=i,{listings:f,total:g}=mf?await hn.getMobileListings(e):await hn.getDesktopListings(e),b=Object.values(f),E=p?"search":"wallets";return ai[E]={listings:[...ai[E].listings,...b],total:g,page:h??1},{listings:b,total:g}},getWalletImageUrl(i){return hn.getWalletImageUrl(i)},getAssetImageUrl(i){return hn.getAssetImageUrl(i)},resetSearch(){ai.search={listings:[],total:0,page:1}}},zn=Vi({open:!1}),eu={state:zn,subscribe(i){return yn(zn,()=>i(zn))},async open(i){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:s}=Zr.state;if(rr.removeWalletConnectDeepLink(),Zr.setWalletConnectUri(i==null?void 0:i.uri),Zr.setChains(i==null?void 0:i.chains),np.reset("ConnectWallet"),r&&s)zn.open=!0,e();else{const o=setInterval(()=>{const h=Zr.state;h.isUiLoaded&&h.isDataLoaded&&(clearInterval(o),zn.open=!0,e())},200)}})},close(){zn.open=!1}};var mb=Object.defineProperty,_f=Object.getOwnPropertySymbols,_b=Object.prototype.hasOwnProperty,bb=Object.prototype.propertyIsEnumerable,bf=(i,e,r)=>e in i?mb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,wb=(i,e)=>{for(var r in e||(e={}))_b.call(e,r)&&bf(i,r,e[r]);if(_f)for(var r of _f(e))bb.call(e,r)&&bf(i,r,e[r]);return i};function Eb(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const bs=Vi({themeMode:Eb()?"dark":"light"}),wf={state:bs,subscribe(i){return yn(bs,()=>i(bs))},setThemeConfig(i){const{themeMode:e,themeVariables:r}=i;e&&(bs.themeMode=e),r&&(bs.themeVariables=wb({},r))}},ln=Vi({open:!1,message:"",variant:"success"}),tI={state:ln,subscribe(i){return yn(ln,()=>i(ln))},openToast(i,e){ln.open=!0,ln.message=i,ln.variant=e},closeToast(){ln.open=!1}};let Db=class{constructor(e){this.openModal=eu.open,this.closeModal=eu.close,this.subscribeModal=eu.subscribe,this.setTheme=wf.setThemeConfig,wf.setThemeConfig(e),Jn.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Q_(()=>import("./index-bacb84f5.js"),["assets/index-bacb84f5.js","assets/index-e56dd797.js","assets/index-a700eb57.css","assets/tslib.es6-c2094241.js"]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Zr.setIsUiLoaded(!0)}}};const Sb=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Db},Symbol.toStringTag,{value:"Module"})),Ib=zu(Sb);var ku={},ya={},Ue={},sp={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(f,g){var b=f>>>16&65535,E=f&65535,C=g>>>16&65535,N=g&65535;return E*N+(b*N+E*C<<16>>>0)|0}i.mul=Math.imul||e;function r(f,g){return f+g|0}i.add=r;function s(f,g){return f-g|0}i.sub=s;function o(f,g){return f<<g|f>>>32-g}i.rotl=o;function h(f,g){return f<<32-g|f>>>g}i.rotr=h;function p(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}i.isInteger=Number.isInteger||p,i.MAX_SAFE_INTEGER=9007199254740991,i.isSafeInteger=function(f){return i.isInteger(f)&&f>=-i.MAX_SAFE_INTEGER&&f<=i.MAX_SAFE_INTEGER}})(sp);Object.defineProperty(Ue,"__esModule",{value:!0});var op=sp;function xb(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])<<16>>16}Ue.readInt16BE=xb;function Ob(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])>>>0}Ue.readUint16BE=Ob;function Cb(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])<<16>>16}Ue.readInt16LE=Cb;function Pb(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])>>>0}Ue.readUint16LE=Pb;function ap(i,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=i>>>8,e[r+1]=i>>>0,e}Ue.writeUint16BE=ap;Ue.writeInt16BE=ap;function cp(i,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=i>>>0,e[r+1]=i>>>8,e}Ue.writeUint16LE=cp;Ue.writeInt16LE=cp;function Ou(i,e){return e===void 0&&(e=0),i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}Ue.readInt32BE=Ou;function Cu(i,e){return e===void 0&&(e=0),(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])>>>0}Ue.readUint32BE=Cu;function Pu(i,e){return e===void 0&&(e=0),i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e]}Ue.readInt32LE=Pu;function Au(i,e){return e===void 0&&(e=0),(i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e])>>>0}Ue.readUint32LE=Au;function ca(i,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=i>>>24,e[r+1]=i>>>16,e[r+2]=i>>>8,e[r+3]=i>>>0,e}Ue.writeUint32BE=ca;Ue.writeInt32BE=ca;function ua(i,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=i>>>0,e[r+1]=i>>>8,e[r+2]=i>>>16,e[r+3]=i>>>24,e}Ue.writeUint32LE=ua;Ue.writeInt32LE=ua;function Ab(i,e){e===void 0&&(e=0);var r=Ou(i,e),s=Ou(i,e+4);return r*4294967296+s-(s>>31)*4294967296}Ue.readInt64BE=Ab;function Tb(i,e){e===void 0&&(e=0);var r=Cu(i,e),s=Cu(i,e+4);return r*4294967296+s}Ue.readUint64BE=Tb;function Rb(i,e){e===void 0&&(e=0);var r=Pu(i,e),s=Pu(i,e+4);return s*4294967296+r-(r>>31)*4294967296}Ue.readInt64LE=Rb;function Nb(i,e){e===void 0&&(e=0);var r=Au(i,e),s=Au(i,e+4);return s*4294967296+r}Ue.readUint64LE=Nb;function up(i,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ca(i/4294967296>>>0,e,r),ca(i>>>0,e,r+4),e}Ue.writeUint64BE=up;Ue.writeInt64BE=up;function hp(i,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ua(i>>>0,e,r),ua(i/4294967296>>>0,e,r+4),e}Ue.writeUint64LE=hp;Ue.writeInt64LE=hp;function $b(i,e,r){if(r===void 0&&(r=0),i%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(i/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var s=0,o=1,h=i/8+r-1;h>=r;h--)s+=e[h]*o,o*=256;return s}Ue.readUintBE=$b;function Lb(i,e,r){if(r===void 0&&(r=0),i%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(i/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var s=0,o=1,h=r;h<r+i/8;h++)s+=e[h]*o,o*=256;return s}Ue.readUintLE=Lb;function Ub(i,e,r,s){if(r===void 0&&(r=new Uint8Array(i/8)),s===void 0&&(s=0),i%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!op.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var o=1,h=i/8+s-1;h>=s;h--)r[h]=e/o&255,o*=256;return r}Ue.writeUintBE=Ub;function Fb(i,e,r,s){if(r===void 0&&(r=new Uint8Array(i/8)),s===void 0&&(s=0),i%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!op.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,h=s;h<s+i/8;h++)r[h]=e/o&255,o*=256;return r}Ue.writeUintLE=Fb;function Mb(i,e){e===void 0&&(e=0);var r=new DataView(i.buffer,i.byteOffset,i.byteLength);return r.getFloat32(e)}Ue.readFloat32BE=Mb;function jb(i,e){e===void 0&&(e=0);var r=new DataView(i.buffer,i.byteOffset,i.byteLength);return r.getFloat32(e,!0)}Ue.readFloat32LE=jb;function qb(i,e){e===void 0&&(e=0);var r=new DataView(i.buffer,i.byteOffset,i.byteLength);return r.getFloat64(e)}Ue.readFloat64BE=qb;function Hb(i,e){e===void 0&&(e=0);var r=new DataView(i.buffer,i.byteOffset,i.byteLength);return r.getFloat64(e,!0)}Ue.readFloat64LE=Hb;function zb(i,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.setFloat32(r,i),e}Ue.writeFloat32BE=zb;function Bb(i,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.setFloat32(r,i,!0),e}Ue.writeFloat32LE=Bb;function kb(i,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.setFloat64(r,i),e}Ue.writeFloat64BE=kb;function Kb(i,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.setFloat64(r,i,!0),e}Ue.writeFloat64LE=Kb;var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});function Vb(i){for(var e=0;e<i.length;e++)i[e]=0;return i}Tr.wipe=Vb;Object.defineProperty(ya,"__esModule",{value:!0});var tr=Ue,Tu=Tr,Wb=20;function Gb(i,e,r){for(var s=1634760805,o=857760878,h=2036477234,p=1797285236,f=r[3]<<24|r[2]<<16|r[1]<<8|r[0],g=r[7]<<24|r[6]<<16|r[5]<<8|r[4],b=r[11]<<24|r[10]<<16|r[9]<<8|r[8],E=r[15]<<24|r[14]<<16|r[13]<<8|r[12],C=r[19]<<24|r[18]<<16|r[17]<<8|r[16],N=r[23]<<24|r[22]<<16|r[21]<<8|r[20],P=r[27]<<24|r[26]<<16|r[25]<<8|r[24],F=r[31]<<24|r[30]<<16|r[29]<<8|r[28],k=e[3]<<24|e[2]<<16|e[1]<<8|e[0],K=e[7]<<24|e[6]<<16|e[5]<<8|e[4],ee=e[11]<<24|e[10]<<16|e[9]<<8|e[8],A=e[15]<<24|e[14]<<16|e[13]<<8|e[12],$=s,S=o,I=h,_=p,c=f,m=g,B=b,z=E,W=C,oe=N,fe=P,T=F,H=k,ce=K,ie=ee,Y=A,re=0;re<Wb;re+=2)$=$+c|0,H^=$,H=H>>>32-16|H<<16,W=W+H|0,c^=W,c=c>>>32-12|c<<12,S=S+m|0,ce^=S,ce=ce>>>32-16|ce<<16,oe=oe+ce|0,m^=oe,m=m>>>32-12|m<<12,I=I+B|0,ie^=I,ie=ie>>>32-16|ie<<16,fe=fe+ie|0,B^=fe,B=B>>>32-12|B<<12,_=_+z|0,Y^=_,Y=Y>>>32-16|Y<<16,T=T+Y|0,z^=T,z=z>>>32-12|z<<12,I=I+B|0,ie^=I,ie=ie>>>32-8|ie<<8,fe=fe+ie|0,B^=fe,B=B>>>32-7|B<<7,_=_+z|0,Y^=_,Y=Y>>>32-8|Y<<8,T=T+Y|0,z^=T,z=z>>>32-7|z<<7,S=S+m|0,ce^=S,ce=ce>>>32-8|ce<<8,oe=oe+ce|0,m^=oe,m=m>>>32-7|m<<7,$=$+c|0,H^=$,H=H>>>32-8|H<<8,W=W+H|0,c^=W,c=c>>>32-7|c<<7,$=$+m|0,Y^=$,Y=Y>>>32-16|Y<<16,fe=fe+Y|0,m^=fe,m=m>>>32-12|m<<12,S=S+B|0,H^=S,H=H>>>32-16|H<<16,T=T+H|0,B^=T,B=B>>>32-12|B<<12,I=I+z|0,ce^=I,ce=ce>>>32-16|ce<<16,W=W+ce|0,z^=W,z=z>>>32-12|z<<12,_=_+c|0,ie^=_,ie=ie>>>32-16|ie<<16,oe=oe+ie|0,c^=oe,c=c>>>32-12|c<<12,I=I+z|0,ce^=I,ce=ce>>>32-8|ce<<8,W=W+ce|0,z^=W,z=z>>>32-7|z<<7,_=_+c|0,ie^=_,ie=ie>>>32-8|ie<<8,oe=oe+ie|0,c^=oe,c=c>>>32-7|c<<7,S=S+B|0,H^=S,H=H>>>32-8|H<<8,T=T+H|0,B^=T,B=B>>>32-7|B<<7,$=$+m|0,Y^=$,Y=Y>>>32-8|Y<<8,fe=fe+Y|0,m^=fe,m=m>>>32-7|m<<7;tr.writeUint32LE($+s|0,i,0),tr.writeUint32LE(S+o|0,i,4),tr.writeUint32LE(I+h|0,i,8),tr.writeUint32LE(_+p|0,i,12),tr.writeUint32LE(c+f|0,i,16),tr.writeUint32LE(m+g|0,i,20),tr.writeUint32LE(B+b|0,i,24),tr.writeUint32LE(z+E|0,i,28),tr.writeUint32LE(W+C|0,i,32),tr.writeUint32LE(oe+N|0,i,36),tr.writeUint32LE(fe+P|0,i,40),tr.writeUint32LE(T+F|0,i,44),tr.writeUint32LE(H+k|0,i,48),tr.writeUint32LE(ce+K|0,i,52),tr.writeUint32LE(ie+ee|0,i,56),tr.writeUint32LE(Y+A|0,i,60)}function lp(i,e,r,s,o){if(o===void 0&&(o=0),i.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(s.length<r.length)throw new Error("ChaCha: destination is shorter than source");var h,p;if(o===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");h=new Uint8Array(16),p=h.length-e.length,h.set(e,p)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");h=e,p=o}for(var f=new Uint8Array(64),g=0;g<r.length;g+=64){Gb(f,h,i);for(var b=g;b<g+64&&b<r.length;b++)s[b]=r[b]^f[b-g];Jb(h,0,p)}return Tu.wipe(f),o===0&&Tu.wipe(h),s}ya.streamXOR=lp;function Yb(i,e,r,s){return s===void 0&&(s=0),Tu.wipe(r),lp(i,e,r,r,s)}ya.stream=Yb;function Jb(i,e,r){for(var s=1;r--;)s=s+(i[e]&255)|0,i[e]=s&255,s>>>=8,e++;if(s>0)throw new Error("ChaCha: counter overflow")}var fp={},Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});function Qb(i,e,r){return~(i-1)&e|i-1&r}Wi.select=Qb;function Xb(i,e){return(i|0)-(e|0)-1>>>31&1}Wi.lessOrEqual=Xb;function dp(i,e){if(i.length!==e.length)return 0;for(var r=0,s=0;s<i.length;s++)r|=i[s]^e[s];return 1&r-1>>>8}Wi.compare=dp;function Zb(i,e){return i.length===0||e.length===0?!1:dp(i,e)!==0}Wi.equal=Zb;(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=Wi,r=Tr;i.DIGEST_LENGTH=16;var s=function(){function p(f){this.digestLength=i.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var g=f[0]|f[1]<<8;this._r[0]=g&8191;var b=f[2]|f[3]<<8;this._r[1]=(g>>>13|b<<3)&8191;var E=f[4]|f[5]<<8;this._r[2]=(b>>>10|E<<6)&7939;var C=f[6]|f[7]<<8;this._r[3]=(E>>>7|C<<9)&8191;var N=f[8]|f[9]<<8;this._r[4]=(C>>>4|N<<12)&255,this._r[5]=N>>>1&8190;var P=f[10]|f[11]<<8;this._r[6]=(N>>>14|P<<2)&8191;var F=f[12]|f[13]<<8;this._r[7]=(P>>>11|F<<5)&8065;var k=f[14]|f[15]<<8;this._r[8]=(F>>>8|k<<8)&8191,this._r[9]=k>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return p.prototype._blocks=function(f,g,b){for(var E=this._fin?0:2048,C=this._h[0],N=this._h[1],P=this._h[2],F=this._h[3],k=this._h[4],K=this._h[5],ee=this._h[6],A=this._h[7],$=this._h[8],S=this._h[9],I=this._r[0],_=this._r[1],c=this._r[2],m=this._r[3],B=this._r[4],z=this._r[5],W=this._r[6],oe=this._r[7],fe=this._r[8],T=this._r[9];b>=16;){var H=f[g+0]|f[g+1]<<8;C+=H&8191;var ce=f[g+2]|f[g+3]<<8;N+=(H>>>13|ce<<3)&8191;var ie=f[g+4]|f[g+5]<<8;P+=(ce>>>10|ie<<6)&8191;var Y=f[g+6]|f[g+7]<<8;F+=(ie>>>7|Y<<9)&8191;var re=f[g+8]|f[g+9]<<8;k+=(Y>>>4|re<<12)&8191,K+=re>>>1&8191;var J=f[g+10]|f[g+11]<<8;ee+=(re>>>14|J<<2)&8191;var ne=f[g+12]|f[g+13]<<8;A+=(J>>>11|ne<<5)&8191;var xe=f[g+14]|f[g+15]<<8;$+=(ne>>>8|xe<<8)&8191,S+=xe>>>5|E;var se=0,be=se;be+=C*I,be+=N*(5*T),be+=P*(5*fe),be+=F*(5*oe),be+=k*(5*W),se=be>>>13,be&=8191,be+=K*(5*z),be+=ee*(5*B),be+=A*(5*m),be+=$*(5*c),be+=S*(5*_),se+=be>>>13,be&=8191;var le=se;le+=C*_,le+=N*I,le+=P*(5*T),le+=F*(5*fe),le+=k*(5*oe),se=le>>>13,le&=8191,le+=K*(5*W),le+=ee*(5*z),le+=A*(5*B),le+=$*(5*m),le+=S*(5*c),se+=le>>>13,le&=8191;var me=se;me+=C*c,me+=N*_,me+=P*I,me+=F*(5*T),me+=k*(5*fe),se=me>>>13,me&=8191,me+=K*(5*oe),me+=ee*(5*W),me+=A*(5*z),me+=$*(5*B),me+=S*(5*m),se+=me>>>13,me&=8191;var q=se;q+=C*m,q+=N*c,q+=P*_,q+=F*I,q+=k*(5*T),se=q>>>13,q&=8191,q+=K*(5*fe),q+=ee*(5*oe),q+=A*(5*W),q+=$*(5*z),q+=S*(5*B),se+=q>>>13,q&=8191;var j=se;j+=C*B,j+=N*m,j+=P*c,j+=F*_,j+=k*I,se=j>>>13,j&=8191,j+=K*(5*T),j+=ee*(5*fe),j+=A*(5*oe),j+=$*(5*W),j+=S*(5*z),se+=j>>>13,j&=8191;var R=se;R+=C*z,R+=N*B,R+=P*m,R+=F*c,R+=k*_,se=R>>>13,R&=8191,R+=K*I,R+=ee*(5*T),R+=A*(5*fe),R+=$*(5*oe),R+=S*(5*W),se+=R>>>13,R&=8191;var l=se;l+=C*W,l+=N*z,l+=P*B,l+=F*m,l+=k*c,se=l>>>13,l&=8191,l+=K*_,l+=ee*I,l+=A*(5*T),l+=$*(5*fe),l+=S*(5*oe),se+=l>>>13,l&=8191;var x=se;x+=C*oe,x+=N*W,x+=P*z,x+=F*B,x+=k*m,se=x>>>13,x&=8191,x+=K*c,x+=ee*_,x+=A*I,x+=$*(5*T),x+=S*(5*fe),se+=x>>>13,x&=8191;var ae=se;ae+=C*fe,ae+=N*oe,ae+=P*W,ae+=F*z,ae+=k*B,se=ae>>>13,ae&=8191,ae+=K*m,ae+=ee*c,ae+=A*_,ae+=$*I,ae+=S*(5*T),se+=ae>>>13,ae&=8191;var de=se;de+=C*T,de+=N*fe,de+=P*oe,de+=F*W,de+=k*z,se=de>>>13,de&=8191,de+=K*B,de+=ee*m,de+=A*c,de+=$*_,de+=S*I,se+=de>>>13,de&=8191,se=(se<<2)+se|0,se=se+be|0,be=se&8191,se=se>>>13,le+=se,C=be,N=le,P=me,F=q,k=j,K=R,ee=l,A=x,$=ae,S=de,g+=16,b-=16}this._h[0]=C,this._h[1]=N,this._h[2]=P,this._h[3]=F,this._h[4]=k,this._h[5]=K,this._h[6]=ee,this._h[7]=A,this._h[8]=$,this._h[9]=S},p.prototype.finish=function(f,g){g===void 0&&(g=0);var b=new Uint16Array(10),E,C,N,P;if(this._leftover){for(P=this._leftover,this._buffer[P++]=1;P<16;P++)this._buffer[P]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(E=this._h[1]>>>13,this._h[1]&=8191,P=2;P<10;P++)this._h[P]+=E,E=this._h[P]>>>13,this._h[P]&=8191;for(this._h[0]+=E*5,E=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=E,E=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=E,b[0]=this._h[0]+5,E=b[0]>>>13,b[0]&=8191,P=1;P<10;P++)b[P]=this._h[P]+E,E=b[P]>>>13,b[P]&=8191;for(b[9]-=8192,C=(E^1)-1,P=0;P<10;P++)b[P]&=C;for(C=~C,P=0;P<10;P++)this._h[P]=this._h[P]&C|b[P];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,N=this._h[0]+this._pad[0],this._h[0]=N&65535,P=1;P<8;P++)N=(this._h[P]+this._pad[P]|0)+(N>>>16)|0,this._h[P]=N&65535;return f[g+0]=this._h[0]>>>0,f[g+1]=this._h[0]>>>8,f[g+2]=this._h[1]>>>0,f[g+3]=this._h[1]>>>8,f[g+4]=this._h[2]>>>0,f[g+5]=this._h[2]>>>8,f[g+6]=this._h[3]>>>0,f[g+7]=this._h[3]>>>8,f[g+8]=this._h[4]>>>0,f[g+9]=this._h[4]>>>8,f[g+10]=this._h[5]>>>0,f[g+11]=this._h[5]>>>8,f[g+12]=this._h[6]>>>0,f[g+13]=this._h[6]>>>8,f[g+14]=this._h[7]>>>0,f[g+15]=this._h[7]>>>8,this._finished=!0,this},p.prototype.update=function(f){var g=0,b=f.length,E;if(this._leftover){E=16-this._leftover,E>b&&(E=b);for(var C=0;C<E;C++)this._buffer[this._leftover+C]=f[g+C];if(b-=E,g+=E,this._leftover+=E,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(b>=16&&(E=b-b%16,this._blocks(f,g,E),g+=E,b-=E),b){for(var C=0;C<b;C++)this._buffer[this._leftover+C]=f[g+C];this._leftover+=b}return this},p.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var f=new Uint8Array(16);return this.finish(f),f},p.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},p}();i.Poly1305=s;function o(p,f){var g=new s(p);g.update(f);var b=g.digest();return g.clean(),b}i.oneTimeAuth=o;function h(p,f){return p.length!==i.DIGEST_LENGTH||f.length!==i.DIGEST_LENGTH?!1:e.equal(p,f)}i.equal=h})(fp);(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=ya,r=fp,s=Tr,o=Ue,h=Wi;i.KEY_LENGTH=32,i.NONCE_LENGTH=12,i.TAG_LENGTH=16;var p=new Uint8Array(16),f=function(){function g(b){if(this.nonceLength=i.NONCE_LENGTH,this.tagLength=i.TAG_LENGTH,b.length!==i.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(b)}return g.prototype.seal=function(b,E,C,N){if(b.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var P=new Uint8Array(16);P.set(b,P.length-b.length);var F=new Uint8Array(32);e.stream(this._key,P,F,4);var k=E.length+this.tagLength,K;if(N){if(N.length!==k)throw new Error("ChaCha20Poly1305: incorrect destination length");K=N}else K=new Uint8Array(k);return e.streamXOR(this._key,P,E,K,4),this._authenticate(K.subarray(K.length-this.tagLength,K.length),F,K.subarray(0,K.length-this.tagLength),C),s.wipe(P),K},g.prototype.open=function(b,E,C,N){if(b.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(E.length<this.tagLength)return null;var P=new Uint8Array(16);P.set(b,P.length-b.length);var F=new Uint8Array(32);e.stream(this._key,P,F,4);var k=new Uint8Array(this.tagLength);if(this._authenticate(k,F,E.subarray(0,E.length-this.tagLength),C),!h.equal(k,E.subarray(E.length-this.tagLength,E.length)))return null;var K=E.length-this.tagLength,ee;if(N){if(N.length!==K)throw new Error("ChaCha20Poly1305: incorrect destination length");ee=N}else ee=new Uint8Array(K);return e.streamXOR(this._key,P,E.subarray(0,E.length-this.tagLength),ee,4),s.wipe(P),ee},g.prototype.clean=function(){return s.wipe(this._key),this},g.prototype._authenticate=function(b,E,C,N){var P=new r.Poly1305(E);N&&(P.update(N),N.length%16>0&&P.update(p.subarray(N.length%16))),P.update(C),C.length%16>0&&P.update(p.subarray(C.length%16));var F=new Uint8Array(8);N&&o.writeUint64LE(N.length,F),P.update(F),o.writeUint64LE(C.length,F),P.update(F);for(var k=P.digest(),K=0;K<k.length;K++)b[K]=k[K];P.clean(),s.wipe(k),s.wipe(F)},g}();i.ChaCha20Poly1305=f})(ku);var pp={},qs={},Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});function ew(i){return typeof i.saveState<"u"&&typeof i.restoreState<"u"&&typeof i.cleanSavedState<"u"}Ku.isSerializableHash=ew;Object.defineProperty(qs,"__esModule",{value:!0});var ci=Ku,tw=Wi,rw=Tr,gp=function(){function i(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var s=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(s).clean():s.set(r);for(var o=0;o<s.length;o++)s[o]^=54;this._inner.update(s);for(var o=0;o<s.length;o++)s[o]^=106;this._outer.update(s),ci.isSerializableHash(this._inner)&&ci.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),rw.wipe(s)}return i.prototype.reset=function(){if(!ci.isSerializableHash(this._inner)||!ci.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},i.prototype.clean=function(){ci.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),ci.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},i.prototype.update=function(e){return this._inner.update(e),this},i.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},i.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},i.prototype.saveState=function(){if(!ci.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},i.prototype.restoreState=function(e){if(!ci.isSerializableHash(this._inner)||!ci.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},i.prototype.cleanSavedState=function(e){if(!ci.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},i}();qs.HMAC=gp;function iw(i,e,r){var s=new gp(i,e);s.update(r);var o=s.digest();return s.clean(),o}qs.hmac=iw;qs.equal=tw.equal;Object.defineProperty(pp,"__esModule",{value:!0});var Ef=qs,Df=Tr,nw=function(){function i(e,r,s,o){s===void 0&&(s=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=o;var h=Ef.hmac(this._hash,s,r);this._hmac=new Ef.HMAC(e,h),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return i.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},i.prototype.expand=function(e){for(var r=new Uint8Array(e),s=0;s<r.length;s++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[s]=this._buffer[this._bufpos++];return r},i.prototype.clean=function(){this._hmac.clean(),Df.wipe(this._buffer),Df.wipe(this._counter),this._bufpos=0},i}(),sw=pp.HKDF=nw,Qn={},ma={},_a={};Object.defineProperty(_a,"__esModule",{value:!0});_a.BrowserRandomSource=void 0;const Sf=65536;class ow{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let s=0;s<r.length;s+=Sf)this._crypto.getRandomValues(r.subarray(s,s+Math.min(r.length-s,Sf)));return r}}_a.BrowserRandomSource=ow;var ba={};Object.defineProperty(ba,"__esModule",{value:!0});ba.NodeRandomSource=void 0;const aw=Tr;class cw{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof X_<"u"){const e=Z_();e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const s=new Uint8Array(e);for(let o=0;o<s.length;o++)s[o]=r[o];return(0,aw.wipe)(r),s}}ba.NodeRandomSource=cw;Object.defineProperty(ma,"__esModule",{value:!0});ma.SystemRandomSource=void 0;const uw=_a,hw=ba;class lw{constructor(){if(this.isAvailable=!1,this.name="",this._source=new uw.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new hw.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}ma.SystemRandomSource=lw;(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.randomStringForEntropy=i.randomString=i.randomUint32=i.randomBytes=i.defaultRandomSource=void 0;const e=ma,r=Ue,s=Tr;i.defaultRandomSource=new e.SystemRandomSource;function o(b,E=i.defaultRandomSource){return E.randomBytes(b)}i.randomBytes=o;function h(b=i.defaultRandomSource){const E=o(4,b),C=(0,r.readUint32LE)(E);return(0,s.wipe)(E),C}i.randomUint32=h;const p="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(b,E=p,C=i.defaultRandomSource){if(E.length<2)throw new Error("randomString charset is too short");if(E.length>256)throw new Error("randomString charset is too long");let N="";const P=E.length,F=256-256%P;for(;b>0;){const k=o(Math.ceil(b*256/F),C);for(let K=0;K<k.length&&b>0;K++){const ee=k[K];ee<F&&(N+=E.charAt(ee%P),b--)}(0,s.wipe)(k)}return N}i.randomString=f;function g(b,E=p,C=i.defaultRandomSource){const N=Math.ceil(b/(Math.log(E.length)/Math.LN2));return f(N,E,C)}i.randomStringForEntropy=g})(Qn);var wa={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=Ue,r=Tr;i.DIGEST_LENGTH=32,i.BLOCK_SIZE=64;var s=function(){function f(){this.digestLength=i.DIGEST_LENGTH,this.blockSize=i.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},f.prototype.update=function(g,b){if(b===void 0&&(b=g.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var E=0;if(this._bytesHashed+=b,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&b>0;)this._buffer[this._bufferLength++]=g[E++],b--;this._bufferLength===this.blockSize&&(h(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(b>=this.blockSize&&(E=h(this._temp,this._state,g,E,b),b%=this.blockSize);b>0;)this._buffer[this._bufferLength++]=g[E++],b--;return this},f.prototype.finish=function(g){if(!this._finished){var b=this._bytesHashed,E=this._bufferLength,C=b/536870912|0,N=b<<3,P=b%64<56?64:128;this._buffer[E]=128;for(var F=E+1;F<P-8;F++)this._buffer[F]=0;e.writeUint32BE(C,this._buffer,P-8),e.writeUint32BE(N,this._buffer,P-4),h(this._temp,this._state,this._buffer,0,P),this._finished=!0}for(var F=0;F<this.digestLength/4;F++)e.writeUint32BE(this._state[F],g,F*4);return this},f.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},f.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(g){return this._state.set(g.state),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(g){r.wipe(g.state),g.buffer&&r.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},f}();i.SHA256=s;var o=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function h(f,g,b,E,C){for(;C>=64;){for(var N=g[0],P=g[1],F=g[2],k=g[3],K=g[4],ee=g[5],A=g[6],$=g[7],S=0;S<16;S++){var I=E+S*4;f[S]=e.readUint32BE(b,I)}for(var S=16;S<64;S++){var _=f[S-2],c=(_>>>17|_<<32-17)^(_>>>19|_<<32-19)^_>>>10;_=f[S-15];var m=(_>>>7|_<<32-7)^(_>>>18|_<<32-18)^_>>>3;f[S]=(c+f[S-7]|0)+(m+f[S-16]|0)}for(var S=0;S<64;S++){var c=(((K>>>6|K<<26)^(K>>>11|K<<21)^(K>>>25|K<<7))+(K&ee^~K&A)|0)+($+(o[S]+f[S]|0)|0)|0,m=((N>>>2|N<<32-2)^(N>>>13|N<<32-13)^(N>>>22|N<<32-22))+(N&P^N&F^P&F)|0;$=A,A=ee,ee=K,K=k+c|0,k=F,F=P,P=N,N=c+m|0}g[0]+=N,g[1]+=P,g[2]+=F,g[3]+=k,g[4]+=K,g[5]+=ee,g[6]+=A,g[7]+=$,E+=64,C-=64}return E}function p(f){var g=new s;g.update(f);var b=g.digest();return g.clean(),b}i.hash=p})(wa);var Vu={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.sharedKey=i.generateKeyPair=i.generateKeyPairFromSeed=i.scalarMultBase=i.scalarMult=i.SHARED_KEY_LENGTH=i.SECRET_KEY_LENGTH=i.PUBLIC_KEY_LENGTH=void 0;const e=Qn,r=Tr;i.PUBLIC_KEY_LENGTH=32,i.SECRET_KEY_LENGTH=32,i.SHARED_KEY_LENGTH=32;function s(S){const I=new Float64Array(16);if(S)for(let _=0;_<S.length;_++)I[_]=S[_];return I}const o=new Uint8Array(32);o[0]=9;const h=s([56129,1]);function p(S){let I=1;for(let _=0;_<16;_++){let c=S[_]+I+65535;I=Math.floor(c/65536),S[_]=c-I*65536}S[0]+=I-1+37*(I-1)}function f(S,I,_){const c=~(_-1);for(let m=0;m<16;m++){const B=c&(S[m]^I[m]);S[m]^=B,I[m]^=B}}function g(S,I){const _=s(),c=s();for(let m=0;m<16;m++)c[m]=I[m];p(c),p(c),p(c);for(let m=0;m<2;m++){_[0]=c[0]-65517;for(let z=1;z<15;z++)_[z]=c[z]-65535-(_[z-1]>>16&1),_[z-1]&=65535;_[15]=c[15]-32767-(_[14]>>16&1);const B=_[15]>>16&1;_[14]&=65535,f(c,_,1-B)}for(let m=0;m<16;m++)S[2*m]=c[m]&255,S[2*m+1]=c[m]>>8}function b(S,I){for(let _=0;_<16;_++)S[_]=I[2*_]+(I[2*_+1]<<8);S[15]&=32767}function E(S,I,_){for(let c=0;c<16;c++)S[c]=I[c]+_[c]}function C(S,I,_){for(let c=0;c<16;c++)S[c]=I[c]-_[c]}function N(S,I,_){let c,m,B=0,z=0,W=0,oe=0,fe=0,T=0,H=0,ce=0,ie=0,Y=0,re=0,J=0,ne=0,xe=0,se=0,be=0,le=0,me=0,q=0,j=0,R=0,l=0,x=0,ae=0,de=0,Se=0,ze=0,Ke=0,Fe=0,pt=0,gt=0,je=_[0],Ie=_[1],Ne=_[2],$e=_[3],qe=_[4],Ce=_[5],Le=_[6],De=_[7],Pe=_[8],Be=_[9],Oe=_[10],Ve=_[11],Ge=_[12],et=_[13],tt=_[14],Je=_[15];c=I[0],B+=c*je,z+=c*Ie,W+=c*Ne,oe+=c*$e,fe+=c*qe,T+=c*Ce,H+=c*Le,ce+=c*De,ie+=c*Pe,Y+=c*Be,re+=c*Oe,J+=c*Ve,ne+=c*Ge,xe+=c*et,se+=c*tt,be+=c*Je,c=I[1],z+=c*je,W+=c*Ie,oe+=c*Ne,fe+=c*$e,T+=c*qe,H+=c*Ce,ce+=c*Le,ie+=c*De,Y+=c*Pe,re+=c*Be,J+=c*Oe,ne+=c*Ve,xe+=c*Ge,se+=c*et,be+=c*tt,le+=c*Je,c=I[2],W+=c*je,oe+=c*Ie,fe+=c*Ne,T+=c*$e,H+=c*qe,ce+=c*Ce,ie+=c*Le,Y+=c*De,re+=c*Pe,J+=c*Be,ne+=c*Oe,xe+=c*Ve,se+=c*Ge,be+=c*et,le+=c*tt,me+=c*Je,c=I[3],oe+=c*je,fe+=c*Ie,T+=c*Ne,H+=c*$e,ce+=c*qe,ie+=c*Ce,Y+=c*Le,re+=c*De,J+=c*Pe,ne+=c*Be,xe+=c*Oe,se+=c*Ve,be+=c*Ge,le+=c*et,me+=c*tt,q+=c*Je,c=I[4],fe+=c*je,T+=c*Ie,H+=c*Ne,ce+=c*$e,ie+=c*qe,Y+=c*Ce,re+=c*Le,J+=c*De,ne+=c*Pe,xe+=c*Be,se+=c*Oe,be+=c*Ve,le+=c*Ge,me+=c*et,q+=c*tt,j+=c*Je,c=I[5],T+=c*je,H+=c*Ie,ce+=c*Ne,ie+=c*$e,Y+=c*qe,re+=c*Ce,J+=c*Le,ne+=c*De,xe+=c*Pe,se+=c*Be,be+=c*Oe,le+=c*Ve,me+=c*Ge,q+=c*et,j+=c*tt,R+=c*Je,c=I[6],H+=c*je,ce+=c*Ie,ie+=c*Ne,Y+=c*$e,re+=c*qe,J+=c*Ce,ne+=c*Le,xe+=c*De,se+=c*Pe,be+=c*Be,le+=c*Oe,me+=c*Ve,q+=c*Ge,j+=c*et,R+=c*tt,l+=c*Je,c=I[7],ce+=c*je,ie+=c*Ie,Y+=c*Ne,re+=c*$e,J+=c*qe,ne+=c*Ce,xe+=c*Le,se+=c*De,be+=c*Pe,le+=c*Be,me+=c*Oe,q+=c*Ve,j+=c*Ge,R+=c*et,l+=c*tt,x+=c*Je,c=I[8],ie+=c*je,Y+=c*Ie,re+=c*Ne,J+=c*$e,ne+=c*qe,xe+=c*Ce,se+=c*Le,be+=c*De,le+=c*Pe,me+=c*Be,q+=c*Oe,j+=c*Ve,R+=c*Ge,l+=c*et,x+=c*tt,ae+=c*Je,c=I[9],Y+=c*je,re+=c*Ie,J+=c*Ne,ne+=c*$e,xe+=c*qe,se+=c*Ce,be+=c*Le,le+=c*De,me+=c*Pe,q+=c*Be,j+=c*Oe,R+=c*Ve,l+=c*Ge,x+=c*et,ae+=c*tt,de+=c*Je,c=I[10],re+=c*je,J+=c*Ie,ne+=c*Ne,xe+=c*$e,se+=c*qe,be+=c*Ce,le+=c*Le,me+=c*De,q+=c*Pe,j+=c*Be,R+=c*Oe,l+=c*Ve,x+=c*Ge,ae+=c*et,de+=c*tt,Se+=c*Je,c=I[11],J+=c*je,ne+=c*Ie,xe+=c*Ne,se+=c*$e,be+=c*qe,le+=c*Ce,me+=c*Le,q+=c*De,j+=c*Pe,R+=c*Be,l+=c*Oe,x+=c*Ve,ae+=c*Ge,de+=c*et,Se+=c*tt,ze+=c*Je,c=I[12],ne+=c*je,xe+=c*Ie,se+=c*Ne,be+=c*$e,le+=c*qe,me+=c*Ce,q+=c*Le,j+=c*De,R+=c*Pe,l+=c*Be,x+=c*Oe,ae+=c*Ve,de+=c*Ge,Se+=c*et,ze+=c*tt,Ke+=c*Je,c=I[13],xe+=c*je,se+=c*Ie,be+=c*Ne,le+=c*$e,me+=c*qe,q+=c*Ce,j+=c*Le,R+=c*De,l+=c*Pe,x+=c*Be,ae+=c*Oe,de+=c*Ve,Se+=c*Ge,ze+=c*et,Ke+=c*tt,Fe+=c*Je,c=I[14],se+=c*je,be+=c*Ie,le+=c*Ne,me+=c*$e,q+=c*qe,j+=c*Ce,R+=c*Le,l+=c*De,x+=c*Pe,ae+=c*Be,de+=c*Oe,Se+=c*Ve,ze+=c*Ge,Ke+=c*et,Fe+=c*tt,pt+=c*Je,c=I[15],be+=c*je,le+=c*Ie,me+=c*Ne,q+=c*$e,j+=c*qe,R+=c*Ce,l+=c*Le,x+=c*De,ae+=c*Pe,de+=c*Be,Se+=c*Oe,ze+=c*Ve,Ke+=c*Ge,Fe+=c*et,pt+=c*tt,gt+=c*Je,B+=38*le,z+=38*me,W+=38*q,oe+=38*j,fe+=38*R,T+=38*l,H+=38*x,ce+=38*ae,ie+=38*de,Y+=38*Se,re+=38*ze,J+=38*Ke,ne+=38*Fe,xe+=38*pt,se+=38*gt,m=1,c=B+m+65535,m=Math.floor(c/65536),B=c-m*65536,c=z+m+65535,m=Math.floor(c/65536),z=c-m*65536,c=W+m+65535,m=Math.floor(c/65536),W=c-m*65536,c=oe+m+65535,m=Math.floor(c/65536),oe=c-m*65536,c=fe+m+65535,m=Math.floor(c/65536),fe=c-m*65536,c=T+m+65535,m=Math.floor(c/65536),T=c-m*65536,c=H+m+65535,m=Math.floor(c/65536),H=c-m*65536,c=ce+m+65535,m=Math.floor(c/65536),ce=c-m*65536,c=ie+m+65535,m=Math.floor(c/65536),ie=c-m*65536,c=Y+m+65535,m=Math.floor(c/65536),Y=c-m*65536,c=re+m+65535,m=Math.floor(c/65536),re=c-m*65536,c=J+m+65535,m=Math.floor(c/65536),J=c-m*65536,c=ne+m+65535,m=Math.floor(c/65536),ne=c-m*65536,c=xe+m+65535,m=Math.floor(c/65536),xe=c-m*65536,c=se+m+65535,m=Math.floor(c/65536),se=c-m*65536,c=be+m+65535,m=Math.floor(c/65536),be=c-m*65536,B+=m-1+37*(m-1),m=1,c=B+m+65535,m=Math.floor(c/65536),B=c-m*65536,c=z+m+65535,m=Math.floor(c/65536),z=c-m*65536,c=W+m+65535,m=Math.floor(c/65536),W=c-m*65536,c=oe+m+65535,m=Math.floor(c/65536),oe=c-m*65536,c=fe+m+65535,m=Math.floor(c/65536),fe=c-m*65536,c=T+m+65535,m=Math.floor(c/65536),T=c-m*65536,c=H+m+65535,m=Math.floor(c/65536),H=c-m*65536,c=ce+m+65535,m=Math.floor(c/65536),ce=c-m*65536,c=ie+m+65535,m=Math.floor(c/65536),ie=c-m*65536,c=Y+m+65535,m=Math.floor(c/65536),Y=c-m*65536,c=re+m+65535,m=Math.floor(c/65536),re=c-m*65536,c=J+m+65535,m=Math.floor(c/65536),J=c-m*65536,c=ne+m+65535,m=Math.floor(c/65536),ne=c-m*65536,c=xe+m+65535,m=Math.floor(c/65536),xe=c-m*65536,c=se+m+65535,m=Math.floor(c/65536),se=c-m*65536,c=be+m+65535,m=Math.floor(c/65536),be=c-m*65536,B+=m-1+37*(m-1),S[0]=B,S[1]=z,S[2]=W,S[3]=oe,S[4]=fe,S[5]=T,S[6]=H,S[7]=ce,S[8]=ie,S[9]=Y,S[10]=re,S[11]=J,S[12]=ne,S[13]=xe,S[14]=se,S[15]=be}function P(S,I){N(S,I,I)}function F(S,I){const _=s();for(let c=0;c<16;c++)_[c]=I[c];for(let c=253;c>=0;c--)P(_,_),c!==2&&c!==4&&N(_,_,I);for(let c=0;c<16;c++)S[c]=_[c]}function k(S,I){const _=new Uint8Array(32),c=new Float64Array(80),m=s(),B=s(),z=s(),W=s(),oe=s(),fe=s();for(let ie=0;ie<31;ie++)_[ie]=S[ie];_[31]=S[31]&127|64,_[0]&=248,b(c,I);for(let ie=0;ie<16;ie++)B[ie]=c[ie];m[0]=W[0]=1;for(let ie=254;ie>=0;--ie){const Y=_[ie>>>3]>>>(ie&7)&1;f(m,B,Y),f(z,W,Y),E(oe,m,z),C(m,m,z),E(z,B,W),C(B,B,W),P(W,oe),P(fe,m),N(m,z,m),N(z,B,oe),E(oe,m,z),C(m,m,z),P(B,m),C(z,W,fe),N(m,z,h),E(m,m,W),N(z,z,m),N(m,W,fe),N(W,B,c),P(B,oe),f(m,B,Y),f(z,W,Y)}for(let ie=0;ie<16;ie++)c[ie+16]=m[ie],c[ie+32]=z[ie],c[ie+48]=B[ie],c[ie+64]=W[ie];const T=c.subarray(32),H=c.subarray(16);F(T,T),N(H,H,T);const ce=new Uint8Array(32);return g(ce,H),ce}i.scalarMult=k;function K(S){return k(S,o)}i.scalarMultBase=K;function ee(S){if(S.length!==i.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${i.SECRET_KEY_LENGTH} bytes`);const I=new Uint8Array(S);return{publicKey:K(I),secretKey:I}}i.generateKeyPairFromSeed=ee;function A(S){const I=(0,e.randomBytes)(32,S),_=ee(I);return(0,r.wipe)(I),_}i.generateKeyPair=A;function $(S,I,_=!1){if(S.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const c=k(S,I);if(_){let m=0;for(let B=0;B<c.length;B++)m|=c[B];if(m===0)throw new Error("X25519: invalid shared key")}return c}i.sharedKey=$})(Vu);function Wu(i){return globalThis.Buffer!=null?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):i}function vp(i=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Wu(globalThis.Buffer.allocUnsafe(i)):new Uint8Array(i)}function Ru(i,e){e||(e=i.reduce((o,h)=>o+h.length,0));const r=vp(e);let s=0;for(const o of i)r.set(o,s),s+=o.length;return Wu(r)}function fw(i,e){if(i.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),s=0;s<r.length;s++)r[s]=255;for(var o=0;o<i.length;o++){var h=i.charAt(o),p=h.charCodeAt(0);if(r[p]!==255)throw new TypeError(h+" is ambiguous");r[p]=o}var f=i.length,g=i.charAt(0),b=Math.log(f)/Math.log(256),E=Math.log(256)/Math.log(f);function C(F){if(F instanceof Uint8Array||(ArrayBuffer.isView(F)?F=new Uint8Array(F.buffer,F.byteOffset,F.byteLength):Array.isArray(F)&&(F=Uint8Array.from(F))),!(F instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(F.length===0)return"";for(var k=0,K=0,ee=0,A=F.length;ee!==A&&F[ee]===0;)ee++,k++;for(var $=(A-ee)*E+1>>>0,S=new Uint8Array($);ee!==A;){for(var I=F[ee],_=0,c=$-1;(I!==0||_<K)&&c!==-1;c--,_++)I+=256*S[c]>>>0,S[c]=I%f>>>0,I=I/f>>>0;if(I!==0)throw new Error("Non-zero carry");K=_,ee++}for(var m=$-K;m!==$&&S[m]===0;)m++;for(var B=g.repeat(k);m<$;++m)B+=i.charAt(S[m]);return B}function N(F){if(typeof F!="string")throw new TypeError("Expected String");if(F.length===0)return new Uint8Array;var k=0;if(F[k]!==" "){for(var K=0,ee=0;F[k]===g;)K++,k++;for(var A=(F.length-k)*b+1>>>0,$=new Uint8Array(A);F[k];){var S=r[F.charCodeAt(k)];if(S===255)return;for(var I=0,_=A-1;(S!==0||I<ee)&&_!==-1;_--,I++)S+=f*$[_]>>>0,$[_]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");ee=I,k++}if(F[k]!==" "){for(var c=A-ee;c!==A&&$[c]===0;)c++;for(var m=new Uint8Array(K+(A-c)),B=K;c!==A;)m[B++]=$[c++];return m}}}function P(F){var k=N(F);if(k)return k;throw new Error(`Non-${e} character`)}return{encode:C,decodeUnsafe:N,decode:P}}var dw=fw,pw=dw;const gw=i=>{if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")},vw=i=>new TextEncoder().encode(i),yw=i=>new TextDecoder().decode(i);class mw{constructor(e,r,s){this.name=e,this.prefix=r,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class _w{constructor(e,r,s){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=s}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return yp(this,e)}}class bw{constructor(e){this.decoders=e}or(e){return yp(this,e)}decode(e){const r=e[0],s=this.decoders[r];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const yp=(i,e)=>new bw({...i.decoders||{[i.prefix]:i},...e.decoders||{[e.prefix]:e}});class ww{constructor(e,r,s,o){this.name=e,this.prefix=r,this.baseEncode=s,this.baseDecode=o,this.encoder=new mw(e,r,s),this.decoder=new _w(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ea=({name:i,prefix:e,encode:r,decode:s})=>new ww(i,e,r,s),Hs=({prefix:i,name:e,alphabet:r})=>{const{encode:s,decode:o}=pw(r,e);return Ea({prefix:i,name:e,encode:s,decode:h=>gw(o(h))})},Ew=(i,e,r,s)=>{const o={};for(let E=0;E<e.length;++E)o[e[E]]=E;let h=i.length;for(;i[h-1]==="=";)--h;const p=new Uint8Array(h*r/8|0);let f=0,g=0,b=0;for(let E=0;E<h;++E){const C=o[i[E]];if(C===void 0)throw new SyntaxError(`Non-${s} character`);g=g<<r|C,f+=r,f>=8&&(f-=8,p[b++]=255&g>>f)}if(f>=r||255&g<<8-f)throw new SyntaxError("Unexpected end of data");return p},Dw=(i,e,r)=>{const s=e[e.length-1]==="=",o=(1<<r)-1;let h="",p=0,f=0;for(let g=0;g<i.length;++g)for(f=f<<8|i[g],p+=8;p>r;)p-=r,h+=e[o&f>>p];if(p&&(h+=e[o&f<<r-p]),s)for(;h.length*r&7;)h+="=";return h},Jt=({name:i,prefix:e,bitsPerChar:r,alphabet:s})=>Ea({prefix:e,name:i,encode(o){return Dw(o,s,r)},decode(o){return Ew(o,s,r,i)}}),Sw=Ea({prefix:"\0",name:"identity",encode:i=>yw(i),decode:i=>vw(i)}),Iw=Object.freeze(Object.defineProperty({__proto__:null,identity:Sw},Symbol.toStringTag,{value:"Module"})),xw=Jt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Ow=Object.freeze(Object.defineProperty({__proto__:null,base2:xw},Symbol.toStringTag,{value:"Module"})),Cw=Jt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Pw=Object.freeze(Object.defineProperty({__proto__:null,base8:Cw},Symbol.toStringTag,{value:"Module"})),Aw=Hs({prefix:"9",name:"base10",alphabet:"0123456789"}),Tw=Object.freeze(Object.defineProperty({__proto__:null,base10:Aw},Symbol.toStringTag,{value:"Module"})),Rw=Jt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Nw=Jt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),$w=Object.freeze(Object.defineProperty({__proto__:null,base16:Rw,base16upper:Nw},Symbol.toStringTag,{value:"Module"})),Lw=Jt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Uw=Jt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Fw=Jt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Mw=Jt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),jw=Jt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),qw=Jt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Hw=Jt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),zw=Jt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Bw=Jt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),kw=Object.freeze(Object.defineProperty({__proto__:null,base32:Lw,base32hex:jw,base32hexpad:Hw,base32hexpadupper:zw,base32hexupper:qw,base32pad:Fw,base32padupper:Mw,base32upper:Uw,base32z:Bw},Symbol.toStringTag,{value:"Module"})),Kw=Hs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Vw=Hs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Ww=Object.freeze(Object.defineProperty({__proto__:null,base36:Kw,base36upper:Vw},Symbol.toStringTag,{value:"Module"})),Gw=Hs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Yw=Hs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Jw=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Gw,base58flickr:Yw},Symbol.toStringTag,{value:"Module"})),Qw=Jt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Xw=Jt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Zw=Jt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),eE=Jt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),tE=Object.freeze(Object.defineProperty({__proto__:null,base64:Qw,base64pad:Xw,base64url:Zw,base64urlpad:eE},Symbol.toStringTag,{value:"Module"})),mp=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),rE=mp.reduce((i,e,r)=>(i[r]=e,i),[]),iE=mp.reduce((i,e,r)=>(i[e.codePointAt(0)]=r,i),[]);function nE(i){return i.reduce((e,r)=>(e+=rE[r],e),"")}function sE(i){const e=[];for(const r of i){const s=iE[r.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(s)}return new Uint8Array(e)}const oE=Ea({prefix:"🚀",name:"base256emoji",encode:nE,decode:sE}),aE=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:oE},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const If={...Iw,...Ow,...Pw,...Tw,...$w,...kw,...Ww,...Jw,...tE,...aE};function _p(i,e,r,s){return{name:i,prefix:e,encoder:{name:i,prefix:e,encode:r},decoder:{decode:s}}}const xf=_p("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),tu=_p("ascii","a",i=>{let e="a";for(let r=0;r<i.length;r++)e+=String.fromCharCode(i[r]);return e},i=>{i=i.substring(1);const e=vp(i.length);for(let r=0;r<i.length;r++)e[r]=i.charCodeAt(r);return e}),bp={utf8:xf,"utf-8":xf,hex:If.base16,latin1:tu,ascii:tu,binary:tu,...If};function Er(i,e="utf8"){const r=bp[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Wu(globalThis.Buffer.from(i,"utf-8")):r.decoder.decode(`${r.prefix}${i}`)}function dr(i,e="utf8"){const r=bp[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(i.buffer,i.byteOffset,i.byteLength).toString("utf8"):r.encoder.encode(i).substring(1)}var Of=globalThis&&globalThis.__spreadArray||function(i,e,r){if(r||arguments.length===2)for(var s=0,o=e.length,h;s<o;s++)(h||!(s in e))&&(h||(h=Array.prototype.slice.call(e,0,s)),h[s]=e[s]);return i.concat(h||Array.prototype.slice.call(e))},cE=function(){function i(e,r,s){this.name=e,this.version=r,this.os=s,this.type="browser"}return i}(),uE=function(){function i(e){this.version=e,this.type="node",this.name="node",this.os=hi.platform}return i}(),hE=function(){function i(e,r,s,o){this.name=e,this.version=r,this.os=s,this.bot=o,this.type="bot-device"}return i}(),lE=function(){function i(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return i}(),fE=function(){function i(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return i}(),dE=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,pE=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Cf=3,gE=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",dE]],Pf=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function vE(i){return i?Af(i):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new fE:typeof navigator<"u"?Af(navigator.userAgent):_E()}function yE(i){return i!==""&&gE.reduce(function(e,r){var s=r[0],o=r[1];if(e)return e;var h=o.exec(i);return!!h&&[s,h]},!1)}function Af(i){var e=yE(i);if(!e)return null;var r=e[0],s=e[1];if(r==="searchbot")return new lE;var o=s[1]&&s[1].split(".").join("_").split("_").slice(0,3);o?o.length<Cf&&(o=Of(Of([],o,!0),bE(Cf-o.length),!0)):o=[];var h=o.join("."),p=mE(i),f=pE.exec(i);return f&&f[1]?new hE(r,h,p,f[1]):new cE(r,h,p)}function mE(i){for(var e=0,r=Pf.length;e<r;e++){var s=Pf[e],o=s[0],h=s[1],p=h.exec(i);if(p)return o}return null}function _E(){var i=typeof hi<"u"&&hi.version;return i?new uE(hi.version.slice(1)):null}function bE(i){for(var e=[],r=0;r<i;r++)e.push("0");return e}var ye={};const Br=zu(tb);var ru={},ws={},Tf;function wE(){if(Tf)return ws;Tf=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.delay=void 0;function i(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return ws.delay=i,ws}var fn={},iu={},dn={},Rf;function EE(){return Rf||(Rf=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.ONE_THOUSAND=dn.ONE_HUNDRED=void 0,dn.ONE_HUNDRED=100,dn.ONE_THOUSAND=1e3),dn}var nu={},Nf;function DE(){return Nf||(Nf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.ONE_YEAR=i.FOUR_WEEKS=i.THREE_WEEKS=i.TWO_WEEKS=i.ONE_WEEK=i.THIRTY_DAYS=i.SEVEN_DAYS=i.FIVE_DAYS=i.THREE_DAYS=i.ONE_DAY=i.TWENTY_FOUR_HOURS=i.TWELVE_HOURS=i.SIX_HOURS=i.THREE_HOURS=i.ONE_HOUR=i.SIXTY_MINUTES=i.THIRTY_MINUTES=i.TEN_MINUTES=i.FIVE_MINUTES=i.ONE_MINUTE=i.SIXTY_SECONDS=i.THIRTY_SECONDS=i.TEN_SECONDS=i.FIVE_SECONDS=i.ONE_SECOND=void 0,i.ONE_SECOND=1,i.FIVE_SECONDS=5,i.TEN_SECONDS=10,i.THIRTY_SECONDS=30,i.SIXTY_SECONDS=60,i.ONE_MINUTE=i.SIXTY_SECONDS,i.FIVE_MINUTES=i.ONE_MINUTE*5,i.TEN_MINUTES=i.ONE_MINUTE*10,i.THIRTY_MINUTES=i.ONE_MINUTE*30,i.SIXTY_MINUTES=i.ONE_MINUTE*60,i.ONE_HOUR=i.SIXTY_MINUTES,i.THREE_HOURS=i.ONE_HOUR*3,i.SIX_HOURS=i.ONE_HOUR*6,i.TWELVE_HOURS=i.ONE_HOUR*12,i.TWENTY_FOUR_HOURS=i.ONE_HOUR*24,i.ONE_DAY=i.TWENTY_FOUR_HOURS,i.THREE_DAYS=i.ONE_DAY*3,i.FIVE_DAYS=i.ONE_DAY*5,i.SEVEN_DAYS=i.ONE_DAY*7,i.THIRTY_DAYS=i.ONE_DAY*30,i.ONE_WEEK=i.SEVEN_DAYS,i.TWO_WEEKS=i.ONE_WEEK*2,i.THREE_WEEKS=i.ONE_WEEK*3,i.FOUR_WEEKS=i.ONE_WEEK*4,i.ONE_YEAR=i.ONE_DAY*365}(nu)),nu}var $f;function wp(){return $f||($f=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=Br;e.__exportStar(EE(),i),e.__exportStar(DE(),i)}(iu)),iu}var Lf;function SE(){if(Lf)return fn;Lf=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.fromMiliseconds=fn.toMiliseconds=void 0;const i=wp();function e(s){return s*i.ONE_THOUSAND}fn.toMiliseconds=e;function r(s){return Math.floor(s/i.ONE_THOUSAND)}return fn.fromMiliseconds=r,fn}var Uf;function IE(){return Uf||(Uf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=Br;e.__exportStar(wE(),i),e.__exportStar(SE(),i)}(ru)),ru}var Bn={},Ff;function xE(){if(Ff)return Bn;Ff=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.Watch=void 0;class i{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const s=this.get(r);if(typeof s.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const o=Date.now()-s.started;this.timestamps.set(r,{started:s.started,elapsed:o})}get(r){const s=this.timestamps.get(r);if(typeof s>"u")throw new Error(`No timestamp found for label: ${r}`);return s}elapsed(r){const s=this.get(r);return s.elapsed||Date.now()-s.started}}return Bn.Watch=i,Bn.default=i,Bn}var su={},Es={},Mf;function OE(){if(Mf)return Es;Mf=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.IWatch=void 0;class i{}return Es.IWatch=i,Es}var jf;function CE(){return jf||(jf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Br.__exportStar(OE(),i)}(su)),su}(function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=Br;e.__exportStar(IE(),i),e.__exportStar(xE(),i),e.__exportStar(CE(),i),e.__exportStar(wp(),i)})(ye);var lt={};Object.defineProperty(lt,"__esModule",{value:!0});lt.getLocalStorage=lt.getLocalStorageOrThrow=lt.getCrypto=lt.getCryptoOrThrow=Dp=lt.getLocation=lt.getLocationOrThrow=Gu=lt.getNavigator=lt.getNavigatorOrThrow=Ep=lt.getDocument=lt.getDocumentOrThrow=lt.getFromWindowOrThrow=lt.getFromWindow=void 0;function mn(i){let e;return typeof window<"u"&&typeof window[i]<"u"&&(e=window[i]),e}lt.getFromWindow=mn;function Xn(i){const e=mn(i);if(!e)throw new Error(`${i} is not defined in Window`);return e}lt.getFromWindowOrThrow=Xn;function PE(){return Xn("document")}lt.getDocumentOrThrow=PE;function AE(){return mn("document")}var Ep=lt.getDocument=AE;function TE(){return Xn("navigator")}lt.getNavigatorOrThrow=TE;function RE(){return mn("navigator")}var Gu=lt.getNavigator=RE;function NE(){return Xn("location")}lt.getLocationOrThrow=NE;function $E(){return mn("location")}var Dp=lt.getLocation=$E;function LE(){return Xn("crypto")}lt.getCryptoOrThrow=LE;function UE(){return mn("crypto")}lt.getCrypto=UE;function FE(){return Xn("localStorage")}lt.getLocalStorageOrThrow=FE;function ME(){return mn("localStorage")}lt.getLocalStorage=ME;var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0});var Sp=Yu.getWindowMetadata=void 0;const qf=lt;function jE(){let i,e;try{i=qf.getDocumentOrThrow(),e=qf.getLocationOrThrow()}catch{return null}function r(){const C=i.getElementsByTagName("link"),N=[];for(let P=0;P<C.length;P++){const F=C[P],k=F.getAttribute("rel");if(k&&k.toLowerCase().indexOf("icon")>-1){const K=F.getAttribute("href");if(K)if(K.toLowerCase().indexOf("https:")===-1&&K.toLowerCase().indexOf("http:")===-1&&K.indexOf("//")!==0){let ee=e.protocol+"//"+e.host;if(K.indexOf("/")===0)ee+=K;else{const A=e.pathname.split("/");A.pop();const $=A.join("/");ee+=$+"/"+K}N.push(ee)}else if(K.indexOf("//")===0){const ee=e.protocol+K;N.push(ee)}else N.push(K)}}return N}function s(...C){const N=i.getElementsByTagName("meta");for(let P=0;P<N.length;P++){const F=N[P],k=["itemprop","property","name"].map(K=>F.getAttribute(K)).filter(K=>K?C.includes(K):!1);if(k.length&&k){const K=F.getAttribute("content");if(K)return K}}return""}function o(){let C=s("name","og:site_name","og:title","twitter:title");return C||(C=i.title),C}function h(){return s("description","og:description","twitter:description","keywords")}const p=o(),f=h(),g=e.origin,b=r();return{description:f,url:g,icons:b,name:p}}Sp=Yu.getWindowMetadata=jE;var Fs={},qE=i=>encodeURIComponent(i).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Ip="%[a-f0-9]{2}",Hf=new RegExp("("+Ip+")|([^%]+?)","gi"),zf=new RegExp("("+Ip+")+","gi");function Nu(i,e){try{return[decodeURIComponent(i.join(""))]}catch{}if(i.length===1)return i;e=e||1;var r=i.slice(0,e),s=i.slice(e);return Array.prototype.concat.call([],Nu(r),Nu(s))}function HE(i){try{return decodeURIComponent(i)}catch{for(var e=i.match(Hf)||[],r=1;r<e.length;r++)i=Nu(e,r).join(""),e=i.match(Hf)||[];return i}}function zE(i){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=zf.exec(i);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var s=HE(r[0]);s!==r[0]&&(e[r[0]]=s)}r=zf.exec(i)}e["%C2"]="�";for(var o=Object.keys(e),h=0;h<o.length;h++){var p=o[h];i=i.replace(new RegExp(p,"g"),e[p])}return i}var BE=function(i){if(typeof i!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof i+"`");try{return i=i.replace(/\+/g," "),decodeURIComponent(i)}catch{return zE(i)}},kE=(i,e)=>{if(!(typeof i=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[i];const r=i.indexOf(e);return r===-1?[i]:[i.slice(0,r),i.slice(r+e.length)]},KE=function(i,e){for(var r={},s=Object.keys(i),o=Array.isArray(e),h=0;h<s.length;h++){var p=s[h],f=i[p];(o?e.indexOf(p)!==-1:e(p,f,i))&&(r[p]=f)}return r};(function(i){const e=qE,r=BE,s=kE,o=KE,h=A=>A==null,p=Symbol("encodeFragmentIdentifier");function f(A){switch(A.arrayFormat){case"index":return $=>(S,I)=>{const _=S.length;return I===void 0||A.skipNull&&I===null||A.skipEmptyString&&I===""?S:I===null?[...S,[E($,A),"[",_,"]"].join("")]:[...S,[E($,A),"[",E(_,A),"]=",E(I,A)].join("")]};case"bracket":return $=>(S,I)=>I===void 0||A.skipNull&&I===null||A.skipEmptyString&&I===""?S:I===null?[...S,[E($,A),"[]"].join("")]:[...S,[E($,A),"[]=",E(I,A)].join("")];case"colon-list-separator":return $=>(S,I)=>I===void 0||A.skipNull&&I===null||A.skipEmptyString&&I===""?S:I===null?[...S,[E($,A),":list="].join("")]:[...S,[E($,A),":list=",E(I,A)].join("")];case"comma":case"separator":case"bracket-separator":{const $=A.arrayFormat==="bracket-separator"?"[]=":"=";return S=>(I,_)=>_===void 0||A.skipNull&&_===null||A.skipEmptyString&&_===""?I:(_=_===null?"":_,I.length===0?[[E(S,A),$,E(_,A)].join("")]:[[I,E(_,A)].join(A.arrayFormatSeparator)])}default:return $=>(S,I)=>I===void 0||A.skipNull&&I===null||A.skipEmptyString&&I===""?S:I===null?[...S,E($,A)]:[...S,[E($,A),"=",E(I,A)].join("")]}}function g(A){let $;switch(A.arrayFormat){case"index":return(S,I,_)=>{if($=/\[(\d*)\]$/.exec(S),S=S.replace(/\[\d*\]$/,""),!$){_[S]=I;return}_[S]===void 0&&(_[S]={}),_[S][$[1]]=I};case"bracket":return(S,I,_)=>{if($=/(\[\])$/.exec(S),S=S.replace(/\[\]$/,""),!$){_[S]=I;return}if(_[S]===void 0){_[S]=[I];return}_[S]=[].concat(_[S],I)};case"colon-list-separator":return(S,I,_)=>{if($=/(:list)$/.exec(S),S=S.replace(/:list$/,""),!$){_[S]=I;return}if(_[S]===void 0){_[S]=[I];return}_[S]=[].concat(_[S],I)};case"comma":case"separator":return(S,I,_)=>{const c=typeof I=="string"&&I.includes(A.arrayFormatSeparator),m=typeof I=="string"&&!c&&C(I,A).includes(A.arrayFormatSeparator);I=m?C(I,A):I;const B=c||m?I.split(A.arrayFormatSeparator).map(z=>C(z,A)):I===null?I:C(I,A);_[S]=B};case"bracket-separator":return(S,I,_)=>{const c=/(\[\])$/.test(S);if(S=S.replace(/\[\]$/,""),!c){_[S]=I&&C(I,A);return}const m=I===null?[]:I.split(A.arrayFormatSeparator).map(B=>C(B,A));if(_[S]===void 0){_[S]=m;return}_[S]=[].concat(_[S],m)};default:return(S,I,_)=>{if(_[S]===void 0){_[S]=I;return}_[S]=[].concat(_[S],I)}}}function b(A){if(typeof A!="string"||A.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function E(A,$){return $.encode?$.strict?e(A):encodeURIComponent(A):A}function C(A,$){return $.decode?r(A):A}function N(A){return Array.isArray(A)?A.sort():typeof A=="object"?N(Object.keys(A)).sort(($,S)=>Number($)-Number(S)).map($=>A[$]):A}function P(A){const $=A.indexOf("#");return $!==-1&&(A=A.slice(0,$)),A}function F(A){let $="";const S=A.indexOf("#");return S!==-1&&($=A.slice(S)),$}function k(A){A=P(A);const $=A.indexOf("?");return $===-1?"":A.slice($+1)}function K(A,$){return $.parseNumbers&&!Number.isNaN(Number(A))&&typeof A=="string"&&A.trim()!==""?A=Number(A):$.parseBooleans&&A!==null&&(A.toLowerCase()==="true"||A.toLowerCase()==="false")&&(A=A.toLowerCase()==="true"),A}function ee(A,$){$=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},$),b($.arrayFormatSeparator);const S=g($),I=Object.create(null);if(typeof A!="string"||(A=A.trim().replace(/^[?#&]/,""),!A))return I;for(const _ of A.split("&")){if(_==="")continue;let[c,m]=s($.decode?_.replace(/\+/g," "):_,"=");m=m===void 0?null:["comma","separator","bracket-separator"].includes($.arrayFormat)?m:C(m,$),S(C(c,$),m,I)}for(const _ of Object.keys(I)){const c=I[_];if(typeof c=="object"&&c!==null)for(const m of Object.keys(c))c[m]=K(c[m],$);else I[_]=K(c,$)}return $.sort===!1?I:($.sort===!0?Object.keys(I).sort():Object.keys(I).sort($.sort)).reduce((_,c)=>{const m=I[c];return m&&typeof m=="object"&&!Array.isArray(m)?_[c]=N(m):_[c]=m,_},Object.create(null))}i.extract=k,i.parse=ee,i.stringify=(A,$)=>{if(!A)return"";$=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},$),b($.arrayFormatSeparator);const S=m=>$.skipNull&&h(A[m])||$.skipEmptyString&&A[m]==="",I=f($),_={};for(const m of Object.keys(A))S(m)||(_[m]=A[m]);const c=Object.keys(_);return $.sort!==!1&&c.sort($.sort),c.map(m=>{const B=A[m];return B===void 0?"":B===null?E(m,$):Array.isArray(B)?B.length===0&&$.arrayFormat==="bracket-separator"?E(m,$)+"[]":B.reduce(I(m),[]).join("&"):E(m,$)+"="+E(B,$)}).filter(m=>m.length>0).join("&")},i.parseUrl=(A,$)=>{$=Object.assign({decode:!0},$);const[S,I]=s(A,"#");return Object.assign({url:S.split("?")[0]||"",query:ee(k(A),$)},$&&$.parseFragmentIdentifier&&I?{fragmentIdentifier:C(I,$)}:{})},i.stringifyUrl=(A,$)=>{$=Object.assign({encode:!0,strict:!0,[p]:!0},$);const S=P(A.url).split("?")[0]||"",I=i.extract(A.url),_=i.parse(I,{sort:!1}),c=Object.assign(_,A.query);let m=i.stringify(c,$);m&&(m=`?${m}`);let B=F(A.url);return A.fragmentIdentifier&&(B=`#${$[p]?E(A.fragmentIdentifier,$):A.fragmentIdentifier}`),`${S}${m}${B}`},i.pick=(A,$,S)=>{S=Object.assign({parseFragmentIdentifier:!0,[p]:!1},S);const{url:I,query:_,fragmentIdentifier:c}=i.parseUrl(A,S);return i.stringifyUrl({url:I,query:o(_,$),fragmentIdentifier:c},S)},i.exclude=(A,$,S)=>{const I=Array.isArray($)?_=>!$.includes(_):(_,c)=>!$(_,c);return i.pick(A,I,S)}})(Fs);const VE={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},WE=":";function GE(i){const[e,r]=i.split(WE);return{namespace:e,reference:r}}function YE(i,e=[]){const r=[];return Object.keys(i).forEach(s=>{if(e.length&&!e.includes(s))return;const o=i[s];r.push(...o.accounts)}),r}function xp(i,e){return i.includes(":")?[i]:e.chains||[]}const Op="base10",fr="base16",$u="base64pad",Ju="utf8",Cp=0,_n=1,JE=0,Bf=1,Lu=12,Qu=32;function QE(){const i=Vu.generateKeyPair();return{privateKey:dr(i.secretKey,fr),publicKey:dr(i.publicKey,fr)}}function Uu(){const i=Qn.randomBytes(Qu);return dr(i,fr)}function XE(i,e){const r=Vu.sharedKey(Er(i,fr),Er(e,fr),!0),s=new sw(wa.SHA256,r).expand(Qu);return dr(s,fr)}function ZE(i){const e=wa.hash(Er(i,fr));return dr(e,fr)}function Wn(i){const e=wa.hash(Er(i,Ju));return dr(e,fr)}function e3(i){return Er(`${i}`,Op)}function zs(i){return Number(dr(i,Op))}function t3(i){const e=e3(typeof i.type<"u"?i.type:Cp);if(zs(e)===_n&&typeof i.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof i.senderPublicKey<"u"?Er(i.senderPublicKey,fr):void 0,s=typeof i.iv<"u"?Er(i.iv,fr):Qn.randomBytes(Lu),o=new ku.ChaCha20Poly1305(Er(i.symKey,fr)).seal(s,Er(i.message,Ju));return i3({type:e,sealed:o,iv:s,senderPublicKey:r})}function r3(i){const e=new ku.ChaCha20Poly1305(Er(i.symKey,fr)),{sealed:r,iv:s}=ha(i.encoded),o=e.open(s,r);if(o===null)throw new Error("Failed to decrypt");return dr(o,Ju)}function i3(i){if(zs(i.type)===_n){if(typeof i.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return dr(Ru([i.type,i.senderPublicKey,i.iv,i.sealed]),$u)}return dr(Ru([i.type,i.iv,i.sealed]),$u)}function ha(i){const e=Er(i,$u),r=e.slice(JE,Bf),s=Bf;if(zs(r)===_n){const f=s+Qu,g=f+Lu,b=e.slice(s,f),E=e.slice(f,g),C=e.slice(g);return{type:r,sealed:C,iv:E,senderPublicKey:b}}const o=s+Lu,h=e.slice(s,o),p=e.slice(o);return{type:r,sealed:p,iv:h}}function n3(i,e){const r=ha(i);return Pp({type:zs(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?dr(r.senderPublicKey,fr):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Pp(i){const e=(i==null?void 0:i.type)||Cp;if(e===_n){if(typeof(i==null?void 0:i.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(i==null?void 0:i.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:i==null?void 0:i.senderPublicKey,receiverPublicKey:i==null?void 0:i.receiverPublicKey}}function kf(i){return i.type===_n&&typeof i.senderPublicKey=="string"&&typeof i.receiverPublicKey=="string"}var s3=Object.defineProperty,Kf=Object.getOwnPropertySymbols,o3=Object.prototype.hasOwnProperty,a3=Object.prototype.propertyIsEnumerable,Vf=(i,e,r)=>e in i?s3(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,Wf=(i,e)=>{for(var r in e||(e={}))o3.call(e,r)&&Vf(i,r,e[r]);if(Kf)for(var r of Kf(e))a3.call(e,r)&&Vf(i,r,e[r]);return i};const c3="ReactNative",Ar={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},u3="js";function Xu(){return typeof hi<"u"&&typeof hi.versions<"u"&&typeof hi.versions.node<"u"}function Bs(){return!Ep()&&!!Gu()&&navigator.product===c3}function ks(){return!Xu()&&!!Gu()}function Ks(){return Bs()?Ar.reactNative:Xu()?Ar.node:ks()?Ar.browser:Ar.unknown}function h3(i,e){let r=Fs.parse(i);return r=Wf(Wf({},r),e),i=Fs.stringify(r),i}function l3(){return Sp()||{name:"",description:"",url:"",icons:[""]}}function f3(){if(Ks()===Ar.reactNative&&typeof Et<"u"&&typeof(Et==null?void 0:Et.Platform)<"u"){const{OS:r,Version:s}=Et.Platform;return[r,s].join("-")}const i=vE();if(i===null)return"unknown";const e=i.os?i.os.replace(" ","").toLowerCase():"unknown";return i.type==="browser"?[e,i.name,i.version].join("-"):[e,i.version].join("-")}function d3(){var i;const e=Ks();return e===Ar.browser?[e,((i=Dp())==null?void 0:i.host)||"unknown"].join(":"):e}function p3(i,e,r){const s=f3(),o=d3();return[[i,e].join("-"),[u3,r].join("-"),s,o].join("/")}function g3({protocol:i,version:e,relayUrl:r,sdkVersion:s,auth:o,projectId:h,useOnCloseEvent:p}){const f=r.split("?"),g=p3(i,e,s),b={auth:o,ua:g,projectId:h,useOnCloseEvent:p||void 0},E=h3(f[1]||"",b);return f[0]+"?"+E}function vn(i,e){return i.filter(r=>e.includes(r)).length===i.length}function Ap(i){return Object.fromEntries(i.entries())}function Tp(i){return new Map(Object.entries(i))}function kn(i=ye.FIVE_MINUTES,e){const r=ye.toMiliseconds(i||ye.FIVE_MINUTES);let s,o,h;return{resolve:p=>{h&&s&&(clearTimeout(h),s(p))},reject:p=>{h&&o&&(clearTimeout(h),o(p))},done:()=>new Promise((p,f)=>{h=setTimeout(()=>{f(new Error(e))},r),s=p,o=f})}}function Ms(i,e,r){return new Promise(async(s,o)=>{const h=setTimeout(()=>o(new Error(r)),e);try{const p=await i;s(p)}catch(p){o(p)}clearTimeout(h)})}function Rp(i,e){if(typeof e=="string"&&e.startsWith(`${i}:`))return e;if(i.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(i.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${i}`)}function v3(i){return Rp("topic",i)}function y3(i){return Rp("id",i)}function Np(i){const[e,r]=i.split(":"),s={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")s.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))s.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return s}function Qr(i,e){return ye.fromMiliseconds((e||Date.now())+ye.toMiliseconds(i))}function Bi(i){return Date.now()>=ye.toMiliseconds(i)}function zt(i,e){return`${i}${e?`:${e}`:""}`}function ou(i=[],e=[]){return[...new Set([...i,...e])]}async function m3({id:i,topic:e,wcDeepLink:r}){try{if(!r)return;const s=typeof r=="string"?JSON.parse(r):r;let o=s==null?void 0:s.href;if(typeof o!="string")return;o.endsWith("/")&&(o=o.slice(0,-1));const h=`${o}/wc?requestId=${i}&sessionTopic=${e}`,p=Ks();p===Ar.browser?h.startsWith("https://")?window.open(h,"_blank","noreferrer noopener"):window.open(h,"_self","noreferrer noopener"):p===Ar.reactNative&&typeof(Et==null?void 0:Et.Linking)<"u"&&await Et.Linking.openURL(h)}catch(s){console.error(s)}}const _3="irn";function Fu(i){return(i==null?void 0:i.relay)||{protocol:_3}}function oa(i){const e=VE[i];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${i}`);return e}var b3=Object.defineProperty,Gf=Object.getOwnPropertySymbols,w3=Object.prototype.hasOwnProperty,E3=Object.prototype.propertyIsEnumerable,Yf=(i,e,r)=>e in i?b3(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,D3=(i,e)=>{for(var r in e||(e={}))w3.call(e,r)&&Yf(i,r,e[r]);if(Gf)for(var r of Gf(e))E3.call(e,r)&&Yf(i,r,e[r]);return i};function S3(i,e="-"){const r={},s="relay"+e;return Object.keys(i).forEach(o=>{if(o.startsWith(s)){const h=o.replace(s,""),p=i[o];r[h]=p}}),r}function I3(i){i=i.includes("wc://")?i.replace("wc://",""):i,i=i.includes("wc:")?i.replace("wc:",""):i;const e=i.indexOf(":"),r=i.indexOf("?")!==-1?i.indexOf("?"):void 0,s=i.substring(0,e),o=i.substring(e+1,r).split("@"),h=typeof r<"u"?i.substring(r):"",p=Fs.parse(h);return{protocol:s,topic:x3(o[0]),version:parseInt(o[1],10),symKey:p.symKey,relay:S3(p)}}function x3(i){return i.startsWith("//")?i.substring(2):i}function O3(i,e="-"){const r="relay",s={};return Object.keys(i).forEach(o=>{const h=r+e+o;i[o]&&(s[h]=i[o])}),s}function C3(i){return`${i.protocol}:${i.topic}@${i.version}?`+Fs.stringify(D3({symKey:i.symKey},O3(i.relay)))}function Zn(i){const e=[];return i.forEach(r=>{const[s,o]=r.split(":");e.push(`${s}:${o}`)}),e}function P3(i){const e=[];return Object.values(i).forEach(r=>{e.push(...Zn(r.accounts))}),e}function A3(i,e){const r=[];return Object.values(i).forEach(s=>{Zn(s.accounts).includes(e)&&r.push(...s.methods)}),r}function T3(i,e){const r=[];return Object.values(i).forEach(s=>{Zn(s.accounts).includes(e)&&r.push(...s.events)}),r}function R3(i,e){const r=aa(i,e);if(r)throw new Error(r.message);const s={};for(const[o,h]of Object.entries(i))s[o]={methods:h.methods,events:h.events,chains:h.accounts.map(p=>`${p.split(":")[0]}:${p.split(":")[1]}`)};return s}function Zu(i){return i.includes(":")}function Ns(i){return Zu(i)?i.split(":")[0]:i}const N3={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}},$3={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 he(i,e){const{message:r,code:s}=$3[i];return{message:e?`${r} ${e}`:r,code:s}}function $t(i,e){const{message:r,code:s}=N3[i];return{message:e?`${r} ${e}`:r,code:s}}function li(i,e){return Array.isArray(i)?typeof e<"u"&&i.length?i.every(e):!0:!1}function Gn(i){return Object.getPrototypeOf(i)===Object.prototype&&Object.keys(i).length}function lr(i){return typeof i>"u"}function Gt(i,e){return e&&lr(i)?!0:typeof i=="string"&&!!i.trim().length}function eh(i,e){return e&&lr(i)?!0:typeof i=="number"&&!isNaN(i)}function L3(i,e){const{requiredNamespaces:r}=e,s=Object.keys(i.namespaces),o=Object.keys(r);let h=!0;return vn(o,s)?(s.forEach(p=>{const{accounts:f,methods:g,events:b}=i.namespaces[p],E=Zn(f),C=r[p];(!vn(xp(p,C),E)||!vn(C.methods,g)||!vn(C.events,b))&&(h=!1)}),h):!1}function la(i){return Gt(i,!1)&&i.includes(":")?i.split(":").length===2:!1}function U3(i){if(Gt(i,!1)&&i.includes(":")){const e=i.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&la(r)}}return!1}function F3(i){if(Gt(i,!1))try{return typeof new URL(i)<"u"}catch{return!1}return!1}function M3(i){var e;return(e=i==null?void 0:i.proposer)==null?void 0:e.publicKey}function j3(i){return i==null?void 0:i.topic}function q3(i,e){let r=null;return Gt(i==null?void 0:i.publicKey,!1)||(r=he("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function Jf(i){let e=!0;return li(i)?i.length&&(e=i.every(r=>Gt(r,!1))):e=!1,e}function H3(i,e,r){let s=null;return li(e)&&e.length?e.forEach(o=>{s||la(o)||(s=$t("UNSUPPORTED_CHAINS",`${r}, chain ${o} should be a string and conform to "namespace:chainId" format`))}):la(i)||(s=$t("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),s}function z3(i,e,r){let s=null;return Object.entries(i).forEach(([o,h])=>{if(s)return;const p=H3(o,xp(o,h),`${e} ${r}`);p&&(s=p)}),s}function B3(i,e){let r=null;return li(i)?i.forEach(s=>{r||U3(s)||(r=$t("UNSUPPORTED_ACCOUNTS",`${e}, account ${s} should be a string and conform to "namespace:chainId:address" format`))}):r=$t("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function k3(i,e){let r=null;return Object.values(i).forEach(s=>{if(r)return;const o=B3(s==null?void 0:s.accounts,`${e} namespace`);o&&(r=o)}),r}function K3(i,e){let r=null;return Jf(i==null?void 0:i.methods)?Jf(i==null?void 0:i.events)||(r=$t("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=$t("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function $p(i,e){let r=null;return Object.values(i).forEach(s=>{if(r)return;const o=K3(s,`${e}, namespace`);o&&(r=o)}),r}function V3(i,e,r){let s=null;if(i&&Gn(i)){const o=$p(i,e);o&&(s=o);const h=z3(i,e,r);h&&(s=h)}else s=he("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return s}function aa(i,e){let r=null;if(i&&Gn(i)){const s=$p(i,e);s&&(r=s);const o=k3(i,e);o&&(r=o)}else r=he("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Lp(i){return Gt(i.protocol,!0)}function W3(i,e){let r=!1;return e&&!i?r=!0:i&&li(i)&&i.length&&i.forEach(s=>{r=Lp(s)}),r}function G3(i){return typeof i=="number"}function wr(i){return typeof i<"u"&&typeof i!==null}function Y3(i){return!(!i||typeof i!="object"||!i.code||!eh(i.code,!1)||!i.message||!Gt(i.message,!1))}function J3(i){return!(lr(i)||!Gt(i.method,!1))}function Q3(i){return!(lr(i)||lr(i.result)&&lr(i.error)||!eh(i.id,!1)||!Gt(i.jsonrpc,!1))}function X3(i){return!(lr(i)||!Gt(i.name,!1))}function Qf(i,e){return!(!la(e)||!P3(i).includes(e))}function Z3(i,e,r){return Gt(r,!1)?A3(i,e).includes(r):!1}function e6(i,e,r){return Gt(r,!1)?T3(i,e).includes(r):!1}function Xf(i,e,r){let s=null;const o=t6(i),h=r6(e),p=Object.keys(o),f=Object.keys(h),g=Zf(Object.keys(i)),b=Zf(Object.keys(e)),E=g.filter(C=>!b.includes(C));return E.length&&(s=he("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
1
|
+
import{_ as Q_,b as zu,d as X_,r as Z_,p as hi,g as Et,c as Pr,e as zr,a as eb,$ as Bu,f as lf}from"./index-9959df27.js";import{t as tb}from"./tslib.es6-c2094241.js";const rb=Symbol(),ff=Object.getPrototypeOf,Du=new WeakMap,ib=i=>i&&(Du.has(i)?Du.get(i):ff(i)===Object.prototype||ff(i)===Array.prototype),nb=i=>ib(i)&&i[rb]||null,df=(i,e=!0)=>{Du.set(i,e)},Zc=i=>typeof i=="object"&&i!==null,zi=new WeakMap,Zo=new WeakSet,sb=(i=Object.is,e=(b,E)=>new Proxy(b,E),r=b=>Zc(b)&&!Zo.has(b)&&(Array.isArray(b)||!(Symbol.iterator in b))&&!(b instanceof WeakMap)&&!(b instanceof WeakSet)&&!(b instanceof Error)&&!(b instanceof Number)&&!(b instanceof Date)&&!(b instanceof String)&&!(b instanceof RegExp)&&!(b instanceof ArrayBuffer),s=b=>{switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:throw b}},o=new WeakMap,h=(b,E,C=s)=>{const N=o.get(b);if((N==null?void 0:N[0])===E)return N[1];const P=Array.isArray(b)?[]:Object.create(Object.getPrototypeOf(b));return df(P,!0),o.set(b,[E,P]),Reflect.ownKeys(b).forEach(F=>{if(Object.getOwnPropertyDescriptor(P,F))return;const k=Reflect.get(b,F),K={value:k,enumerable:!0,configurable:!0};if(Zo.has(k))df(k,!1);else if(k instanceof Promise)delete K.value,K.get=()=>C(k);else if(zi.has(k)){const[ee,A]=zi.get(k);K.value=h(ee,A(),C)}Object.defineProperty(P,F,K)}),Object.preventExtensions(P)},p=new WeakMap,f=[1,1],g=b=>{if(!Zc(b))throw new Error("object required");const E=p.get(b);if(E)return E;let C=f[0];const N=new Set,P=(B,z=++f[0])=>{C!==z&&(C=z,N.forEach(W=>W(B,z)))};let F=f[1];const k=(B=++f[1])=>(F!==B&&!N.size&&(F=B,ee.forEach(([z])=>{const W=z[1](B);W>C&&(C=W)})),C),K=B=>(z,W)=>{const oe=[...z];oe[1]=[B,...oe[1]],P(oe,W)},ee=new Map,A=(B,z)=>{if(N.size){const W=z[3](K(B));ee.set(B,[z,W])}else ee.set(B,[z])},$=B=>{var z;const W=ee.get(B);W&&(ee.delete(B),(z=W[1])==null||z.call(W))},S=B=>(N.add(B),N.size===1&&ee.forEach(([W,oe],fe)=>{const T=W[3](K(fe));ee.set(fe,[W,T])}),()=>{N.delete(B),N.size===0&&ee.forEach(([W,oe],fe)=>{oe&&(oe(),ee.set(fe,[W]))})}),I=Array.isArray(b)?[]:Object.create(Object.getPrototypeOf(b)),c=e(I,{deleteProperty(B,z){const W=Reflect.get(B,z);$(z);const oe=Reflect.deleteProperty(B,z);return oe&&P(["delete",[z],W]),oe},set(B,z,W,oe){const fe=Reflect.has(B,z),T=Reflect.get(B,z,oe);if(fe&&(i(T,W)||p.has(W)&&i(T,p.get(W))))return!0;$(z),Zc(W)&&(W=nb(W)||W);let H=W;if(W instanceof Promise)W.then(ce=>{W.status="fulfilled",W.value=ce,P(["resolve",[z],ce])}).catch(ce=>{W.status="rejected",W.reason=ce,P(["reject",[z],ce])});else{!zi.has(W)&&r(W)&&(H=g(W));const ce=!Zo.has(H)&&zi.get(H);ce&&A(z,ce)}return Reflect.set(B,z,H,oe),P(["set",[z],W,T]),!0}});p.set(b,c);const m=[I,k,h,S];return zi.set(c,m),Reflect.ownKeys(b).forEach(B=>{const z=Object.getOwnPropertyDescriptor(b,B);"value"in z&&(c[B]=b[B],delete z.value,delete z.writable),Object.defineProperty(I,B,z)}),c})=>[g,zi,Zo,i,e,r,s,o,h,p,f],[ob]=sb();function Vi(i={}){return ob(i)}function yn(i,e,r){const s=zi.get(i);let o;const h=[],p=s[3];let f=!1;const b=p(E=>{if(h.push(E),r){e(h.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,f&&e(h.splice(0))}))});return f=!0,()=>{f=!1,b()}}function ab(i,e){const r=zi.get(i),[s,o,h]=r;return h(s,o(),e)}const Wt=Vi({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),np={state:Wt,subscribe(i){return yn(Wt,()=>i(Wt))},push(i,e){i!==Wt.view&&(Wt.view=i,e&&(Wt.data=e),Wt.history.push(i))},reset(i){Wt.view=i,Wt.history=[i]},replace(i){Wt.history.length>1&&(Wt.history[Wt.history.length-1]=i,Wt.view=i)},goBack(){if(Wt.history.length>1){Wt.history.pop();const[i]=Wt.history.slice(-1);Wt.view=i}},setData(i){Wt.data=i}},rr={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return rr.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const i=navigator.userAgent.toLowerCase();return rr.isMobile()&&(i.includes("iphone")||i.includes("ipad"))},isHttpUrl(i){return i.startsWith("http://")||i.startsWith("https://")},isArray(i){return Array.isArray(i)&&i.length>0},formatNativeUrl(i,e,r){if(rr.isHttpUrl(i))return this.formatUniversalUrl(i,e,r);let s=i;s.includes("://")||(s=i.replaceAll("/","").replaceAll(":",""),s=`${s}://`),s.endsWith("/")||(s=`${s}/`),this.setWalletConnectDeepLink(s,r);const o=encodeURIComponent(e);return`${s}wc?uri=${o}`},formatUniversalUrl(i,e,r){if(!rr.isHttpUrl(i))return this.formatNativeUrl(i,e,r);let s=i;s.endsWith("/")||(s=`${s}/`),this.setWalletConnectDeepLink(s,r);const o=encodeURIComponent(e);return`${s}wc?uri=${o}`},async wait(i){return new Promise(e=>{setTimeout(e,i)})},openHref(i,e){window.open(i,e,"noreferrer noopener")},setWalletConnectDeepLink(i,e){try{localStorage.setItem(rr.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:i,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(i){try{const[e]=i.split("?");localStorage.setItem(rr.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(rr.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(rr.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var i;const e=(i=np.state.data)==null?void 0:i.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},cb=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),er=Vi({enabled:cb,userSessionId:"",events:[],connectedWalletId:void 0}),ub={state:er,subscribe(i){return yn(er.events,()=>i(ab(er.events[er.events.length-1])))},initialize(){er.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(er.userSessionId=crypto.randomUUID())},setConnectedWalletId(i){er.connectedWalletId=i},click(i){if(er.enabled){const e={type:"CLICK",name:i.name,userSessionId:er.userSessionId,timestamp:Date.now(),data:i};er.events.push(e)}},track(i){if(er.enabled){const e={type:"TRACK",name:i.name,userSessionId:er.userSessionId,timestamp:Date.now(),data:i};er.events.push(e)}},view(i){if(er.enabled){const e={type:"VIEW",name:i.name,userSessionId:er.userSessionId,timestamp:Date.now(),data:i};er.events.push(e)}}},oi=Vi({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Zr={state:oi,subscribe(i){return yn(oi,()=>i(oi))},setChains(i){oi.chains=i},setWalletConnectUri(i){oi.walletConnectUri=i},setIsCustomDesktop(i){oi.isCustomDesktop=i},setIsCustomMobile(i){oi.isCustomMobile=i},setIsDataLoaded(i){oi.isDataLoaded=i},setIsUiLoaded(i){oi.isUiLoaded=i},setIsAuth(i){oi.isAuth=i}},ea=Vi({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Jn={state:ea,subscribe(i){return yn(ea,()=>i(ea))},setConfig(i){var e,r;ub.initialize(),Zr.setChains(i.chains),Zr.setIsAuth(!!i.enableAuthMode),Zr.setIsCustomMobile(!!((e=i.mobileWallets)!=null&&e.length)),Zr.setIsCustomDesktop(!!((r=i.desktopWallets)!=null&&r.length)),rr.setModalVersionInStorage(),Object.assign(ea,i)}};var hb=Object.defineProperty,pf=Object.getOwnPropertySymbols,lb=Object.prototype.hasOwnProperty,fb=Object.prototype.propertyIsEnumerable,gf=(i,e,r)=>e in i?hb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,db=(i,e)=>{for(var r in e||(e={}))lb.call(e,r)&&gf(i,r,e[r]);if(pf)for(var r of pf(e))fb.call(e,r)&&gf(i,r,e[r]);return i};const Su="https://explorer-api.walletconnect.com",Iu="wcm",xu="js-2.6.2";async function ta(i,e){const r=db({sdkType:Iu,sdkVersion:xu},e),s=new URL(i,Su);return s.searchParams.append("projectId",Jn.state.projectId),Object.entries(r).forEach(([o,h])=>{h&&s.searchParams.append(o,String(h))}),(await fetch(s)).json()}const hn={async getDesktopListings(i){return ta("/w3m/v1/getDesktopListings",i)},async getMobileListings(i){return ta("/w3m/v1/getMobileListings",i)},async getInjectedListings(i){return ta("/w3m/v1/getInjectedListings",i)},async getAllListings(i){return ta("/w3m/v1/getAllListings",i)},getWalletImageUrl(i){return`${Su}/w3m/v1/getWalletImage/${i}?projectId=${Jn.state.projectId}&sdkType=${Iu}&sdkVersion=${xu}`},getAssetImageUrl(i){return`${Su}/w3m/v1/getAssetImage/${i}?projectId=${Jn.state.projectId}&sdkType=${Iu}&sdkVersion=${xu}`}};var pb=Object.defineProperty,vf=Object.getOwnPropertySymbols,gb=Object.prototype.hasOwnProperty,vb=Object.prototype.propertyIsEnumerable,yf=(i,e,r)=>e in i?pb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,yb=(i,e)=>{for(var r in e||(e={}))gb.call(e,r)&&yf(i,r,e[r]);if(vf)for(var r of vf(e))vb.call(e,r)&&yf(i,r,e[r]);return i};const mf=rr.isMobile(),ai=Vi({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),eI={state:ai,async getRecomendedWallets(){const{explorerRecommendedWalletIds:i,explorerExcludedWalletIds:e}=Jn.state;if(i==="NONE"||e==="ALL"&&!i)return ai.recomendedWallets;if(rr.isArray(i)){const r={recommendedIds:i.join(",")},{listings:s}=await hn.getAllListings(r),o=Object.values(s);o.sort((h,p)=>{const f=i.indexOf(h.id),g=i.indexOf(p.id);return f-g}),ai.recomendedWallets=o}else{const{chains:r,isAuth:s}=Zr.state,o=r==null?void 0:r.join(","),h=rr.isArray(e),p={page:1,sdks:s?"auth_v1":void 0,entries:rr.RECOMMENDED_WALLET_AMOUNT,chains:o,version:2,excludedIds:h?e.join(","):void 0},{listings:f}=mf?await hn.getMobileListings(p):await hn.getDesktopListings(p);ai.recomendedWallets=Object.values(f)}return ai.recomendedWallets},async getWallets(i){const e=yb({},i),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:s}=Jn.state,{recomendedWallets:o}=ai;if(s==="ALL")return ai.wallets;o.length?e.excludedIds=o.map(C=>C.id).join(","):rr.isArray(r)&&(e.excludedIds=r.join(",")),rr.isArray(s)&&(e.excludedIds=[e.excludedIds,s].filter(Boolean).join(",")),Zr.state.isAuth&&(e.sdks="auth_v1");const{page:h,search:p}=i,{listings:f,total:g}=mf?await hn.getMobileListings(e):await hn.getDesktopListings(e),b=Object.values(f),E=p?"search":"wallets";return ai[E]={listings:[...ai[E].listings,...b],total:g,page:h??1},{listings:b,total:g}},getWalletImageUrl(i){return hn.getWalletImageUrl(i)},getAssetImageUrl(i){return hn.getAssetImageUrl(i)},resetSearch(){ai.search={listings:[],total:0,page:1}}},zn=Vi({open:!1}),eu={state:zn,subscribe(i){return yn(zn,()=>i(zn))},async open(i){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:s}=Zr.state;if(rr.removeWalletConnectDeepLink(),Zr.setWalletConnectUri(i==null?void 0:i.uri),Zr.setChains(i==null?void 0:i.chains),np.reset("ConnectWallet"),r&&s)zn.open=!0,e();else{const o=setInterval(()=>{const h=Zr.state;h.isUiLoaded&&h.isDataLoaded&&(clearInterval(o),zn.open=!0,e())},200)}})},close(){zn.open=!1}};var mb=Object.defineProperty,_f=Object.getOwnPropertySymbols,_b=Object.prototype.hasOwnProperty,bb=Object.prototype.propertyIsEnumerable,bf=(i,e,r)=>e in i?mb(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,wb=(i,e)=>{for(var r in e||(e={}))_b.call(e,r)&&bf(i,r,e[r]);if(_f)for(var r of _f(e))bb.call(e,r)&&bf(i,r,e[r]);return i};function Eb(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const bs=Vi({themeMode:Eb()?"dark":"light"}),wf={state:bs,subscribe(i){return yn(bs,()=>i(bs))},setThemeConfig(i){const{themeMode:e,themeVariables:r}=i;e&&(bs.themeMode=e),r&&(bs.themeVariables=wb({},r))}},ln=Vi({open:!1,message:"",variant:"success"}),tI={state:ln,subscribe(i){return yn(ln,()=>i(ln))},openToast(i,e){ln.open=!0,ln.message=i,ln.variant=e},closeToast(){ln.open=!1}};let Db=class{constructor(e){this.openModal=eu.open,this.closeModal=eu.close,this.subscribeModal=eu.subscribe,this.setTheme=wf.setThemeConfig,wf.setThemeConfig(e),Jn.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Q_(()=>import("./index-f9c772b7.js"),["assets/index-f9c772b7.js","assets/index-9959df27.js","assets/index-ecafd01d.css","assets/tslib.es6-c2094241.js"]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Zr.setIsUiLoaded(!0)}}};const Sb=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Db},Symbol.toStringTag,{value:"Module"})),Ib=zu(Sb);var ku={},ya={},Ue={},sp={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});function e(f,g){var b=f>>>16&65535,E=f&65535,C=g>>>16&65535,N=g&65535;return E*N+(b*N+E*C<<16>>>0)|0}i.mul=Math.imul||e;function r(f,g){return f+g|0}i.add=r;function s(f,g){return f-g|0}i.sub=s;function o(f,g){return f<<g|f>>>32-g}i.rotl=o;function h(f,g){return f<<32-g|f>>>g}i.rotr=h;function p(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}i.isInteger=Number.isInteger||p,i.MAX_SAFE_INTEGER=9007199254740991,i.isSafeInteger=function(f){return i.isInteger(f)&&f>=-i.MAX_SAFE_INTEGER&&f<=i.MAX_SAFE_INTEGER}})(sp);Object.defineProperty(Ue,"__esModule",{value:!0});var op=sp;function xb(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])<<16>>16}Ue.readInt16BE=xb;function Ob(i,e){return e===void 0&&(e=0),(i[e+0]<<8|i[e+1])>>>0}Ue.readUint16BE=Ob;function Cb(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])<<16>>16}Ue.readInt16LE=Cb;function Pb(i,e){return e===void 0&&(e=0),(i[e+1]<<8|i[e])>>>0}Ue.readUint16LE=Pb;function ap(i,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=i>>>8,e[r+1]=i>>>0,e}Ue.writeUint16BE=ap;Ue.writeInt16BE=ap;function cp(i,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=i>>>0,e[r+1]=i>>>8,e}Ue.writeUint16LE=cp;Ue.writeInt16LE=cp;function Ou(i,e){return e===void 0&&(e=0),i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}Ue.readInt32BE=Ou;function Cu(i,e){return e===void 0&&(e=0),(i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3])>>>0}Ue.readUint32BE=Cu;function Pu(i,e){return e===void 0&&(e=0),i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e]}Ue.readInt32LE=Pu;function Au(i,e){return e===void 0&&(e=0),(i[e+3]<<24|i[e+2]<<16|i[e+1]<<8|i[e])>>>0}Ue.readUint32LE=Au;function ca(i,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=i>>>24,e[r+1]=i>>>16,e[r+2]=i>>>8,e[r+3]=i>>>0,e}Ue.writeUint32BE=ca;Ue.writeInt32BE=ca;function ua(i,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=i>>>0,e[r+1]=i>>>8,e[r+2]=i>>>16,e[r+3]=i>>>24,e}Ue.writeUint32LE=ua;Ue.writeInt32LE=ua;function Ab(i,e){e===void 0&&(e=0);var r=Ou(i,e),s=Ou(i,e+4);return r*4294967296+s-(s>>31)*4294967296}Ue.readInt64BE=Ab;function Tb(i,e){e===void 0&&(e=0);var r=Cu(i,e),s=Cu(i,e+4);return r*4294967296+s}Ue.readUint64BE=Tb;function Rb(i,e){e===void 0&&(e=0);var r=Pu(i,e),s=Pu(i,e+4);return s*4294967296+r-(r>>31)*4294967296}Ue.readInt64LE=Rb;function Nb(i,e){e===void 0&&(e=0);var r=Au(i,e),s=Au(i,e+4);return s*4294967296+r}Ue.readUint64LE=Nb;function up(i,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ca(i/4294967296>>>0,e,r),ca(i>>>0,e,r+4),e}Ue.writeUint64BE=up;Ue.writeInt64BE=up;function hp(i,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),ua(i>>>0,e,r),ua(i/4294967296>>>0,e,r+4),e}Ue.writeUint64LE=hp;Ue.writeInt64LE=hp;function $b(i,e,r){if(r===void 0&&(r=0),i%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(i/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var s=0,o=1,h=i/8+r-1;h>=r;h--)s+=e[h]*o,o*=256;return s}Ue.readUintBE=$b;function Lb(i,e,r){if(r===void 0&&(r=0),i%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(i/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var s=0,o=1,h=r;h<r+i/8;h++)s+=e[h]*o,o*=256;return s}Ue.readUintLE=Lb;function Ub(i,e,r,s){if(r===void 0&&(r=new Uint8Array(i/8)),s===void 0&&(s=0),i%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!op.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var o=1,h=i/8+s-1;h>=s;h--)r[h]=e/o&255,o*=256;return r}Ue.writeUintBE=Ub;function Fb(i,e,r,s){if(r===void 0&&(r=new Uint8Array(i/8)),s===void 0&&(s=0),i%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!op.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var o=1,h=s;h<s+i/8;h++)r[h]=e/o&255,o*=256;return r}Ue.writeUintLE=Fb;function Mb(i,e){e===void 0&&(e=0);var r=new DataView(i.buffer,i.byteOffset,i.byteLength);return r.getFloat32(e)}Ue.readFloat32BE=Mb;function jb(i,e){e===void 0&&(e=0);var r=new DataView(i.buffer,i.byteOffset,i.byteLength);return r.getFloat32(e,!0)}Ue.readFloat32LE=jb;function qb(i,e){e===void 0&&(e=0);var r=new DataView(i.buffer,i.byteOffset,i.byteLength);return r.getFloat64(e)}Ue.readFloat64BE=qb;function Hb(i,e){e===void 0&&(e=0);var r=new DataView(i.buffer,i.byteOffset,i.byteLength);return r.getFloat64(e,!0)}Ue.readFloat64LE=Hb;function zb(i,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.setFloat32(r,i),e}Ue.writeFloat32BE=zb;function Bb(i,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.setFloat32(r,i,!0),e}Ue.writeFloat32LE=Bb;function kb(i,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.setFloat64(r,i),e}Ue.writeFloat64BE=kb;function Kb(i,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.setFloat64(r,i,!0),e}Ue.writeFloat64LE=Kb;var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0});function Vb(i){for(var e=0;e<i.length;e++)i[e]=0;return i}Tr.wipe=Vb;Object.defineProperty(ya,"__esModule",{value:!0});var tr=Ue,Tu=Tr,Wb=20;function Gb(i,e,r){for(var s=1634760805,o=857760878,h=2036477234,p=1797285236,f=r[3]<<24|r[2]<<16|r[1]<<8|r[0],g=r[7]<<24|r[6]<<16|r[5]<<8|r[4],b=r[11]<<24|r[10]<<16|r[9]<<8|r[8],E=r[15]<<24|r[14]<<16|r[13]<<8|r[12],C=r[19]<<24|r[18]<<16|r[17]<<8|r[16],N=r[23]<<24|r[22]<<16|r[21]<<8|r[20],P=r[27]<<24|r[26]<<16|r[25]<<8|r[24],F=r[31]<<24|r[30]<<16|r[29]<<8|r[28],k=e[3]<<24|e[2]<<16|e[1]<<8|e[0],K=e[7]<<24|e[6]<<16|e[5]<<8|e[4],ee=e[11]<<24|e[10]<<16|e[9]<<8|e[8],A=e[15]<<24|e[14]<<16|e[13]<<8|e[12],$=s,S=o,I=h,_=p,c=f,m=g,B=b,z=E,W=C,oe=N,fe=P,T=F,H=k,ce=K,ie=ee,Y=A,re=0;re<Wb;re+=2)$=$+c|0,H^=$,H=H>>>32-16|H<<16,W=W+H|0,c^=W,c=c>>>32-12|c<<12,S=S+m|0,ce^=S,ce=ce>>>32-16|ce<<16,oe=oe+ce|0,m^=oe,m=m>>>32-12|m<<12,I=I+B|0,ie^=I,ie=ie>>>32-16|ie<<16,fe=fe+ie|0,B^=fe,B=B>>>32-12|B<<12,_=_+z|0,Y^=_,Y=Y>>>32-16|Y<<16,T=T+Y|0,z^=T,z=z>>>32-12|z<<12,I=I+B|0,ie^=I,ie=ie>>>32-8|ie<<8,fe=fe+ie|0,B^=fe,B=B>>>32-7|B<<7,_=_+z|0,Y^=_,Y=Y>>>32-8|Y<<8,T=T+Y|0,z^=T,z=z>>>32-7|z<<7,S=S+m|0,ce^=S,ce=ce>>>32-8|ce<<8,oe=oe+ce|0,m^=oe,m=m>>>32-7|m<<7,$=$+c|0,H^=$,H=H>>>32-8|H<<8,W=W+H|0,c^=W,c=c>>>32-7|c<<7,$=$+m|0,Y^=$,Y=Y>>>32-16|Y<<16,fe=fe+Y|0,m^=fe,m=m>>>32-12|m<<12,S=S+B|0,H^=S,H=H>>>32-16|H<<16,T=T+H|0,B^=T,B=B>>>32-12|B<<12,I=I+z|0,ce^=I,ce=ce>>>32-16|ce<<16,W=W+ce|0,z^=W,z=z>>>32-12|z<<12,_=_+c|0,ie^=_,ie=ie>>>32-16|ie<<16,oe=oe+ie|0,c^=oe,c=c>>>32-12|c<<12,I=I+z|0,ce^=I,ce=ce>>>32-8|ce<<8,W=W+ce|0,z^=W,z=z>>>32-7|z<<7,_=_+c|0,ie^=_,ie=ie>>>32-8|ie<<8,oe=oe+ie|0,c^=oe,c=c>>>32-7|c<<7,S=S+B|0,H^=S,H=H>>>32-8|H<<8,T=T+H|0,B^=T,B=B>>>32-7|B<<7,$=$+m|0,Y^=$,Y=Y>>>32-8|Y<<8,fe=fe+Y|0,m^=fe,m=m>>>32-7|m<<7;tr.writeUint32LE($+s|0,i,0),tr.writeUint32LE(S+o|0,i,4),tr.writeUint32LE(I+h|0,i,8),tr.writeUint32LE(_+p|0,i,12),tr.writeUint32LE(c+f|0,i,16),tr.writeUint32LE(m+g|0,i,20),tr.writeUint32LE(B+b|0,i,24),tr.writeUint32LE(z+E|0,i,28),tr.writeUint32LE(W+C|0,i,32),tr.writeUint32LE(oe+N|0,i,36),tr.writeUint32LE(fe+P|0,i,40),tr.writeUint32LE(T+F|0,i,44),tr.writeUint32LE(H+k|0,i,48),tr.writeUint32LE(ce+K|0,i,52),tr.writeUint32LE(ie+ee|0,i,56),tr.writeUint32LE(Y+A|0,i,60)}function lp(i,e,r,s,o){if(o===void 0&&(o=0),i.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(s.length<r.length)throw new Error("ChaCha: destination is shorter than source");var h,p;if(o===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");h=new Uint8Array(16),p=h.length-e.length,h.set(e,p)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");h=e,p=o}for(var f=new Uint8Array(64),g=0;g<r.length;g+=64){Gb(f,h,i);for(var b=g;b<g+64&&b<r.length;b++)s[b]=r[b]^f[b-g];Jb(h,0,p)}return Tu.wipe(f),o===0&&Tu.wipe(h),s}ya.streamXOR=lp;function Yb(i,e,r,s){return s===void 0&&(s=0),Tu.wipe(r),lp(i,e,r,r,s)}ya.stream=Yb;function Jb(i,e,r){for(var s=1;r--;)s=s+(i[e]&255)|0,i[e]=s&255,s>>>=8,e++;if(s>0)throw new Error("ChaCha: counter overflow")}var fp={},Wi={};Object.defineProperty(Wi,"__esModule",{value:!0});function Qb(i,e,r){return~(i-1)&e|i-1&r}Wi.select=Qb;function Xb(i,e){return(i|0)-(e|0)-1>>>31&1}Wi.lessOrEqual=Xb;function dp(i,e){if(i.length!==e.length)return 0;for(var r=0,s=0;s<i.length;s++)r|=i[s]^e[s];return 1&r-1>>>8}Wi.compare=dp;function Zb(i,e){return i.length===0||e.length===0?!1:dp(i,e)!==0}Wi.equal=Zb;(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=Wi,r=Tr;i.DIGEST_LENGTH=16;var s=function(){function p(f){this.digestLength=i.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var g=f[0]|f[1]<<8;this._r[0]=g&8191;var b=f[2]|f[3]<<8;this._r[1]=(g>>>13|b<<3)&8191;var E=f[4]|f[5]<<8;this._r[2]=(b>>>10|E<<6)&7939;var C=f[6]|f[7]<<8;this._r[3]=(E>>>7|C<<9)&8191;var N=f[8]|f[9]<<8;this._r[4]=(C>>>4|N<<12)&255,this._r[5]=N>>>1&8190;var P=f[10]|f[11]<<8;this._r[6]=(N>>>14|P<<2)&8191;var F=f[12]|f[13]<<8;this._r[7]=(P>>>11|F<<5)&8065;var k=f[14]|f[15]<<8;this._r[8]=(F>>>8|k<<8)&8191,this._r[9]=k>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return p.prototype._blocks=function(f,g,b){for(var E=this._fin?0:2048,C=this._h[0],N=this._h[1],P=this._h[2],F=this._h[3],k=this._h[4],K=this._h[5],ee=this._h[6],A=this._h[7],$=this._h[8],S=this._h[9],I=this._r[0],_=this._r[1],c=this._r[2],m=this._r[3],B=this._r[4],z=this._r[5],W=this._r[6],oe=this._r[7],fe=this._r[8],T=this._r[9];b>=16;){var H=f[g+0]|f[g+1]<<8;C+=H&8191;var ce=f[g+2]|f[g+3]<<8;N+=(H>>>13|ce<<3)&8191;var ie=f[g+4]|f[g+5]<<8;P+=(ce>>>10|ie<<6)&8191;var Y=f[g+6]|f[g+7]<<8;F+=(ie>>>7|Y<<9)&8191;var re=f[g+8]|f[g+9]<<8;k+=(Y>>>4|re<<12)&8191,K+=re>>>1&8191;var J=f[g+10]|f[g+11]<<8;ee+=(re>>>14|J<<2)&8191;var ne=f[g+12]|f[g+13]<<8;A+=(J>>>11|ne<<5)&8191;var xe=f[g+14]|f[g+15]<<8;$+=(ne>>>8|xe<<8)&8191,S+=xe>>>5|E;var se=0,be=se;be+=C*I,be+=N*(5*T),be+=P*(5*fe),be+=F*(5*oe),be+=k*(5*W),se=be>>>13,be&=8191,be+=K*(5*z),be+=ee*(5*B),be+=A*(5*m),be+=$*(5*c),be+=S*(5*_),se+=be>>>13,be&=8191;var le=se;le+=C*_,le+=N*I,le+=P*(5*T),le+=F*(5*fe),le+=k*(5*oe),se=le>>>13,le&=8191,le+=K*(5*W),le+=ee*(5*z),le+=A*(5*B),le+=$*(5*m),le+=S*(5*c),se+=le>>>13,le&=8191;var me=se;me+=C*c,me+=N*_,me+=P*I,me+=F*(5*T),me+=k*(5*fe),se=me>>>13,me&=8191,me+=K*(5*oe),me+=ee*(5*W),me+=A*(5*z),me+=$*(5*B),me+=S*(5*m),se+=me>>>13,me&=8191;var q=se;q+=C*m,q+=N*c,q+=P*_,q+=F*I,q+=k*(5*T),se=q>>>13,q&=8191,q+=K*(5*fe),q+=ee*(5*oe),q+=A*(5*W),q+=$*(5*z),q+=S*(5*B),se+=q>>>13,q&=8191;var j=se;j+=C*B,j+=N*m,j+=P*c,j+=F*_,j+=k*I,se=j>>>13,j&=8191,j+=K*(5*T),j+=ee*(5*fe),j+=A*(5*oe),j+=$*(5*W),j+=S*(5*z),se+=j>>>13,j&=8191;var R=se;R+=C*z,R+=N*B,R+=P*m,R+=F*c,R+=k*_,se=R>>>13,R&=8191,R+=K*I,R+=ee*(5*T),R+=A*(5*fe),R+=$*(5*oe),R+=S*(5*W),se+=R>>>13,R&=8191;var l=se;l+=C*W,l+=N*z,l+=P*B,l+=F*m,l+=k*c,se=l>>>13,l&=8191,l+=K*_,l+=ee*I,l+=A*(5*T),l+=$*(5*fe),l+=S*(5*oe),se+=l>>>13,l&=8191;var x=se;x+=C*oe,x+=N*W,x+=P*z,x+=F*B,x+=k*m,se=x>>>13,x&=8191,x+=K*c,x+=ee*_,x+=A*I,x+=$*(5*T),x+=S*(5*fe),se+=x>>>13,x&=8191;var ae=se;ae+=C*fe,ae+=N*oe,ae+=P*W,ae+=F*z,ae+=k*B,se=ae>>>13,ae&=8191,ae+=K*m,ae+=ee*c,ae+=A*_,ae+=$*I,ae+=S*(5*T),se+=ae>>>13,ae&=8191;var de=se;de+=C*T,de+=N*fe,de+=P*oe,de+=F*W,de+=k*z,se=de>>>13,de&=8191,de+=K*B,de+=ee*m,de+=A*c,de+=$*_,de+=S*I,se+=de>>>13,de&=8191,se=(se<<2)+se|0,se=se+be|0,be=se&8191,se=se>>>13,le+=se,C=be,N=le,P=me,F=q,k=j,K=R,ee=l,A=x,$=ae,S=de,g+=16,b-=16}this._h[0]=C,this._h[1]=N,this._h[2]=P,this._h[3]=F,this._h[4]=k,this._h[5]=K,this._h[6]=ee,this._h[7]=A,this._h[8]=$,this._h[9]=S},p.prototype.finish=function(f,g){g===void 0&&(g=0);var b=new Uint16Array(10),E,C,N,P;if(this._leftover){for(P=this._leftover,this._buffer[P++]=1;P<16;P++)this._buffer[P]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(E=this._h[1]>>>13,this._h[1]&=8191,P=2;P<10;P++)this._h[P]+=E,E=this._h[P]>>>13,this._h[P]&=8191;for(this._h[0]+=E*5,E=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=E,E=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=E,b[0]=this._h[0]+5,E=b[0]>>>13,b[0]&=8191,P=1;P<10;P++)b[P]=this._h[P]+E,E=b[P]>>>13,b[P]&=8191;for(b[9]-=8192,C=(E^1)-1,P=0;P<10;P++)b[P]&=C;for(C=~C,P=0;P<10;P++)this._h[P]=this._h[P]&C|b[P];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,N=this._h[0]+this._pad[0],this._h[0]=N&65535,P=1;P<8;P++)N=(this._h[P]+this._pad[P]|0)+(N>>>16)|0,this._h[P]=N&65535;return f[g+0]=this._h[0]>>>0,f[g+1]=this._h[0]>>>8,f[g+2]=this._h[1]>>>0,f[g+3]=this._h[1]>>>8,f[g+4]=this._h[2]>>>0,f[g+5]=this._h[2]>>>8,f[g+6]=this._h[3]>>>0,f[g+7]=this._h[3]>>>8,f[g+8]=this._h[4]>>>0,f[g+9]=this._h[4]>>>8,f[g+10]=this._h[5]>>>0,f[g+11]=this._h[5]>>>8,f[g+12]=this._h[6]>>>0,f[g+13]=this._h[6]>>>8,f[g+14]=this._h[7]>>>0,f[g+15]=this._h[7]>>>8,this._finished=!0,this},p.prototype.update=function(f){var g=0,b=f.length,E;if(this._leftover){E=16-this._leftover,E>b&&(E=b);for(var C=0;C<E;C++)this._buffer[this._leftover+C]=f[g+C];if(b-=E,g+=E,this._leftover+=E,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(b>=16&&(E=b-b%16,this._blocks(f,g,E),g+=E,b-=E),b){for(var C=0;C<b;C++)this._buffer[this._leftover+C]=f[g+C];this._leftover+=b}return this},p.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var f=new Uint8Array(16);return this.finish(f),f},p.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},p}();i.Poly1305=s;function o(p,f){var g=new s(p);g.update(f);var b=g.digest();return g.clean(),b}i.oneTimeAuth=o;function h(p,f){return p.length!==i.DIGEST_LENGTH||f.length!==i.DIGEST_LENGTH?!1:e.equal(p,f)}i.equal=h})(fp);(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=ya,r=fp,s=Tr,o=Ue,h=Wi;i.KEY_LENGTH=32,i.NONCE_LENGTH=12,i.TAG_LENGTH=16;var p=new Uint8Array(16),f=function(){function g(b){if(this.nonceLength=i.NONCE_LENGTH,this.tagLength=i.TAG_LENGTH,b.length!==i.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(b)}return g.prototype.seal=function(b,E,C,N){if(b.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var P=new Uint8Array(16);P.set(b,P.length-b.length);var F=new Uint8Array(32);e.stream(this._key,P,F,4);var k=E.length+this.tagLength,K;if(N){if(N.length!==k)throw new Error("ChaCha20Poly1305: incorrect destination length");K=N}else K=new Uint8Array(k);return e.streamXOR(this._key,P,E,K,4),this._authenticate(K.subarray(K.length-this.tagLength,K.length),F,K.subarray(0,K.length-this.tagLength),C),s.wipe(P),K},g.prototype.open=function(b,E,C,N){if(b.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(E.length<this.tagLength)return null;var P=new Uint8Array(16);P.set(b,P.length-b.length);var F=new Uint8Array(32);e.stream(this._key,P,F,4);var k=new Uint8Array(this.tagLength);if(this._authenticate(k,F,E.subarray(0,E.length-this.tagLength),C),!h.equal(k,E.subarray(E.length-this.tagLength,E.length)))return null;var K=E.length-this.tagLength,ee;if(N){if(N.length!==K)throw new Error("ChaCha20Poly1305: incorrect destination length");ee=N}else ee=new Uint8Array(K);return e.streamXOR(this._key,P,E.subarray(0,E.length-this.tagLength),ee,4),s.wipe(P),ee},g.prototype.clean=function(){return s.wipe(this._key),this},g.prototype._authenticate=function(b,E,C,N){var P=new r.Poly1305(E);N&&(P.update(N),N.length%16>0&&P.update(p.subarray(N.length%16))),P.update(C),C.length%16>0&&P.update(p.subarray(C.length%16));var F=new Uint8Array(8);N&&o.writeUint64LE(N.length,F),P.update(F),o.writeUint64LE(C.length,F),P.update(F);for(var k=P.digest(),K=0;K<k.length;K++)b[K]=k[K];P.clean(),s.wipe(k),s.wipe(F)},g}();i.ChaCha20Poly1305=f})(ku);var pp={},qs={},Ku={};Object.defineProperty(Ku,"__esModule",{value:!0});function ew(i){return typeof i.saveState<"u"&&typeof i.restoreState<"u"&&typeof i.cleanSavedState<"u"}Ku.isSerializableHash=ew;Object.defineProperty(qs,"__esModule",{value:!0});var ci=Ku,tw=Wi,rw=Tr,gp=function(){function i(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var s=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(s).clean():s.set(r);for(var o=0;o<s.length;o++)s[o]^=54;this._inner.update(s);for(var o=0;o<s.length;o++)s[o]^=106;this._outer.update(s),ci.isSerializableHash(this._inner)&&ci.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),rw.wipe(s)}return i.prototype.reset=function(){if(!ci.isSerializableHash(this._inner)||!ci.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},i.prototype.clean=function(){ci.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),ci.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},i.prototype.update=function(e){return this._inner.update(e),this},i.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},i.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},i.prototype.saveState=function(){if(!ci.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},i.prototype.restoreState=function(e){if(!ci.isSerializableHash(this._inner)||!ci.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},i.prototype.cleanSavedState=function(e){if(!ci.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},i}();qs.HMAC=gp;function iw(i,e,r){var s=new gp(i,e);s.update(r);var o=s.digest();return s.clean(),o}qs.hmac=iw;qs.equal=tw.equal;Object.defineProperty(pp,"__esModule",{value:!0});var Ef=qs,Df=Tr,nw=function(){function i(e,r,s,o){s===void 0&&(s=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=o;var h=Ef.hmac(this._hash,s,r);this._hmac=new Ef.HMAC(e,h),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return i.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},i.prototype.expand=function(e){for(var r=new Uint8Array(e),s=0;s<r.length;s++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[s]=this._buffer[this._bufpos++];return r},i.prototype.clean=function(){this._hmac.clean(),Df.wipe(this._buffer),Df.wipe(this._counter),this._bufpos=0},i}(),sw=pp.HKDF=nw,Qn={},ma={},_a={};Object.defineProperty(_a,"__esModule",{value:!0});_a.BrowserRandomSource=void 0;const Sf=65536;class ow{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let s=0;s<r.length;s+=Sf)this._crypto.getRandomValues(r.subarray(s,s+Math.min(r.length-s,Sf)));return r}}_a.BrowserRandomSource=ow;var ba={};Object.defineProperty(ba,"__esModule",{value:!0});ba.NodeRandomSource=void 0;const aw=Tr;class cw{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof X_<"u"){const e=Z_();e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const s=new Uint8Array(e);for(let o=0;o<s.length;o++)s[o]=r[o];return(0,aw.wipe)(r),s}}ba.NodeRandomSource=cw;Object.defineProperty(ma,"__esModule",{value:!0});ma.SystemRandomSource=void 0;const uw=_a,hw=ba;class lw{constructor(){if(this.isAvailable=!1,this.name="",this._source=new uw.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new hw.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}ma.SystemRandomSource=lw;(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.randomStringForEntropy=i.randomString=i.randomUint32=i.randomBytes=i.defaultRandomSource=void 0;const e=ma,r=Ue,s=Tr;i.defaultRandomSource=new e.SystemRandomSource;function o(b,E=i.defaultRandomSource){return E.randomBytes(b)}i.randomBytes=o;function h(b=i.defaultRandomSource){const E=o(4,b),C=(0,r.readUint32LE)(E);return(0,s.wipe)(E),C}i.randomUint32=h;const p="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(b,E=p,C=i.defaultRandomSource){if(E.length<2)throw new Error("randomString charset is too short");if(E.length>256)throw new Error("randomString charset is too long");let N="";const P=E.length,F=256-256%P;for(;b>0;){const k=o(Math.ceil(b*256/F),C);for(let K=0;K<k.length&&b>0;K++){const ee=k[K];ee<F&&(N+=E.charAt(ee%P),b--)}(0,s.wipe)(k)}return N}i.randomString=f;function g(b,E=p,C=i.defaultRandomSource){const N=Math.ceil(b/(Math.log(E.length)/Math.LN2));return f(N,E,C)}i.randomStringForEntropy=g})(Qn);var wa={};(function(i){Object.defineProperty(i,"__esModule",{value:!0});var e=Ue,r=Tr;i.DIGEST_LENGTH=32,i.BLOCK_SIZE=64;var s=function(){function f(){this.digestLength=i.DIGEST_LENGTH,this.blockSize=i.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},f.prototype.update=function(g,b){if(b===void 0&&(b=g.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var E=0;if(this._bytesHashed+=b,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&b>0;)this._buffer[this._bufferLength++]=g[E++],b--;this._bufferLength===this.blockSize&&(h(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(b>=this.blockSize&&(E=h(this._temp,this._state,g,E,b),b%=this.blockSize);b>0;)this._buffer[this._bufferLength++]=g[E++],b--;return this},f.prototype.finish=function(g){if(!this._finished){var b=this._bytesHashed,E=this._bufferLength,C=b/536870912|0,N=b<<3,P=b%64<56?64:128;this._buffer[E]=128;for(var F=E+1;F<P-8;F++)this._buffer[F]=0;e.writeUint32BE(C,this._buffer,P-8),e.writeUint32BE(N,this._buffer,P-4),h(this._temp,this._state,this._buffer,0,P),this._finished=!0}for(var F=0;F<this.digestLength/4;F++)e.writeUint32BE(this._state[F],g,F*4);return this},f.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},f.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(g){return this._state.set(g.state),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(g){r.wipe(g.state),g.buffer&&r.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},f}();i.SHA256=s;var o=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function h(f,g,b,E,C){for(;C>=64;){for(var N=g[0],P=g[1],F=g[2],k=g[3],K=g[4],ee=g[5],A=g[6],$=g[7],S=0;S<16;S++){var I=E+S*4;f[S]=e.readUint32BE(b,I)}for(var S=16;S<64;S++){var _=f[S-2],c=(_>>>17|_<<32-17)^(_>>>19|_<<32-19)^_>>>10;_=f[S-15];var m=(_>>>7|_<<32-7)^(_>>>18|_<<32-18)^_>>>3;f[S]=(c+f[S-7]|0)+(m+f[S-16]|0)}for(var S=0;S<64;S++){var c=(((K>>>6|K<<26)^(K>>>11|K<<21)^(K>>>25|K<<7))+(K&ee^~K&A)|0)+($+(o[S]+f[S]|0)|0)|0,m=((N>>>2|N<<32-2)^(N>>>13|N<<32-13)^(N>>>22|N<<32-22))+(N&P^N&F^P&F)|0;$=A,A=ee,ee=K,K=k+c|0,k=F,F=P,P=N,N=c+m|0}g[0]+=N,g[1]+=P,g[2]+=F,g[3]+=k,g[4]+=K,g[5]+=ee,g[6]+=A,g[7]+=$,E+=64,C-=64}return E}function p(f){var g=new s;g.update(f);var b=g.digest();return g.clean(),b}i.hash=p})(wa);var Vu={};(function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.sharedKey=i.generateKeyPair=i.generateKeyPairFromSeed=i.scalarMultBase=i.scalarMult=i.SHARED_KEY_LENGTH=i.SECRET_KEY_LENGTH=i.PUBLIC_KEY_LENGTH=void 0;const e=Qn,r=Tr;i.PUBLIC_KEY_LENGTH=32,i.SECRET_KEY_LENGTH=32,i.SHARED_KEY_LENGTH=32;function s(S){const I=new Float64Array(16);if(S)for(let _=0;_<S.length;_++)I[_]=S[_];return I}const o=new Uint8Array(32);o[0]=9;const h=s([56129,1]);function p(S){let I=1;for(let _=0;_<16;_++){let c=S[_]+I+65535;I=Math.floor(c/65536),S[_]=c-I*65536}S[0]+=I-1+37*(I-1)}function f(S,I,_){const c=~(_-1);for(let m=0;m<16;m++){const B=c&(S[m]^I[m]);S[m]^=B,I[m]^=B}}function g(S,I){const _=s(),c=s();for(let m=0;m<16;m++)c[m]=I[m];p(c),p(c),p(c);for(let m=0;m<2;m++){_[0]=c[0]-65517;for(let z=1;z<15;z++)_[z]=c[z]-65535-(_[z-1]>>16&1),_[z-1]&=65535;_[15]=c[15]-32767-(_[14]>>16&1);const B=_[15]>>16&1;_[14]&=65535,f(c,_,1-B)}for(let m=0;m<16;m++)S[2*m]=c[m]&255,S[2*m+1]=c[m]>>8}function b(S,I){for(let _=0;_<16;_++)S[_]=I[2*_]+(I[2*_+1]<<8);S[15]&=32767}function E(S,I,_){for(let c=0;c<16;c++)S[c]=I[c]+_[c]}function C(S,I,_){for(let c=0;c<16;c++)S[c]=I[c]-_[c]}function N(S,I,_){let c,m,B=0,z=0,W=0,oe=0,fe=0,T=0,H=0,ce=0,ie=0,Y=0,re=0,J=0,ne=0,xe=0,se=0,be=0,le=0,me=0,q=0,j=0,R=0,l=0,x=0,ae=0,de=0,Se=0,ze=0,Ke=0,Fe=0,pt=0,gt=0,je=_[0],Ie=_[1],Ne=_[2],$e=_[3],qe=_[4],Ce=_[5],Le=_[6],De=_[7],Pe=_[8],Be=_[9],Oe=_[10],Ve=_[11],Ge=_[12],et=_[13],tt=_[14],Je=_[15];c=I[0],B+=c*je,z+=c*Ie,W+=c*Ne,oe+=c*$e,fe+=c*qe,T+=c*Ce,H+=c*Le,ce+=c*De,ie+=c*Pe,Y+=c*Be,re+=c*Oe,J+=c*Ve,ne+=c*Ge,xe+=c*et,se+=c*tt,be+=c*Je,c=I[1],z+=c*je,W+=c*Ie,oe+=c*Ne,fe+=c*$e,T+=c*qe,H+=c*Ce,ce+=c*Le,ie+=c*De,Y+=c*Pe,re+=c*Be,J+=c*Oe,ne+=c*Ve,xe+=c*Ge,se+=c*et,be+=c*tt,le+=c*Je,c=I[2],W+=c*je,oe+=c*Ie,fe+=c*Ne,T+=c*$e,H+=c*qe,ce+=c*Ce,ie+=c*Le,Y+=c*De,re+=c*Pe,J+=c*Be,ne+=c*Oe,xe+=c*Ve,se+=c*Ge,be+=c*et,le+=c*tt,me+=c*Je,c=I[3],oe+=c*je,fe+=c*Ie,T+=c*Ne,H+=c*$e,ce+=c*qe,ie+=c*Ce,Y+=c*Le,re+=c*De,J+=c*Pe,ne+=c*Be,xe+=c*Oe,se+=c*Ve,be+=c*Ge,le+=c*et,me+=c*tt,q+=c*Je,c=I[4],fe+=c*je,T+=c*Ie,H+=c*Ne,ce+=c*$e,ie+=c*qe,Y+=c*Ce,re+=c*Le,J+=c*De,ne+=c*Pe,xe+=c*Be,se+=c*Oe,be+=c*Ve,le+=c*Ge,me+=c*et,q+=c*tt,j+=c*Je,c=I[5],T+=c*je,H+=c*Ie,ce+=c*Ne,ie+=c*$e,Y+=c*qe,re+=c*Ce,J+=c*Le,ne+=c*De,xe+=c*Pe,se+=c*Be,be+=c*Oe,le+=c*Ve,me+=c*Ge,q+=c*et,j+=c*tt,R+=c*Je,c=I[6],H+=c*je,ce+=c*Ie,ie+=c*Ne,Y+=c*$e,re+=c*qe,J+=c*Ce,ne+=c*Le,xe+=c*De,se+=c*Pe,be+=c*Be,le+=c*Oe,me+=c*Ve,q+=c*Ge,j+=c*et,R+=c*tt,l+=c*Je,c=I[7],ce+=c*je,ie+=c*Ie,Y+=c*Ne,re+=c*$e,J+=c*qe,ne+=c*Ce,xe+=c*Le,se+=c*De,be+=c*Pe,le+=c*Be,me+=c*Oe,q+=c*Ve,j+=c*Ge,R+=c*et,l+=c*tt,x+=c*Je,c=I[8],ie+=c*je,Y+=c*Ie,re+=c*Ne,J+=c*$e,ne+=c*qe,xe+=c*Ce,se+=c*Le,be+=c*De,le+=c*Pe,me+=c*Be,q+=c*Oe,j+=c*Ve,R+=c*Ge,l+=c*et,x+=c*tt,ae+=c*Je,c=I[9],Y+=c*je,re+=c*Ie,J+=c*Ne,ne+=c*$e,xe+=c*qe,se+=c*Ce,be+=c*Le,le+=c*De,me+=c*Pe,q+=c*Be,j+=c*Oe,R+=c*Ve,l+=c*Ge,x+=c*et,ae+=c*tt,de+=c*Je,c=I[10],re+=c*je,J+=c*Ie,ne+=c*Ne,xe+=c*$e,se+=c*qe,be+=c*Ce,le+=c*Le,me+=c*De,q+=c*Pe,j+=c*Be,R+=c*Oe,l+=c*Ve,x+=c*Ge,ae+=c*et,de+=c*tt,Se+=c*Je,c=I[11],J+=c*je,ne+=c*Ie,xe+=c*Ne,se+=c*$e,be+=c*qe,le+=c*Ce,me+=c*Le,q+=c*De,j+=c*Pe,R+=c*Be,l+=c*Oe,x+=c*Ve,ae+=c*Ge,de+=c*et,Se+=c*tt,ze+=c*Je,c=I[12],ne+=c*je,xe+=c*Ie,se+=c*Ne,be+=c*$e,le+=c*qe,me+=c*Ce,q+=c*Le,j+=c*De,R+=c*Pe,l+=c*Be,x+=c*Oe,ae+=c*Ve,de+=c*Ge,Se+=c*et,ze+=c*tt,Ke+=c*Je,c=I[13],xe+=c*je,se+=c*Ie,be+=c*Ne,le+=c*$e,me+=c*qe,q+=c*Ce,j+=c*Le,R+=c*De,l+=c*Pe,x+=c*Be,ae+=c*Oe,de+=c*Ve,Se+=c*Ge,ze+=c*et,Ke+=c*tt,Fe+=c*Je,c=I[14],se+=c*je,be+=c*Ie,le+=c*Ne,me+=c*$e,q+=c*qe,j+=c*Ce,R+=c*Le,l+=c*De,x+=c*Pe,ae+=c*Be,de+=c*Oe,Se+=c*Ve,ze+=c*Ge,Ke+=c*et,Fe+=c*tt,pt+=c*Je,c=I[15],be+=c*je,le+=c*Ie,me+=c*Ne,q+=c*$e,j+=c*qe,R+=c*Ce,l+=c*Le,x+=c*De,ae+=c*Pe,de+=c*Be,Se+=c*Oe,ze+=c*Ve,Ke+=c*Ge,Fe+=c*et,pt+=c*tt,gt+=c*Je,B+=38*le,z+=38*me,W+=38*q,oe+=38*j,fe+=38*R,T+=38*l,H+=38*x,ce+=38*ae,ie+=38*de,Y+=38*Se,re+=38*ze,J+=38*Ke,ne+=38*Fe,xe+=38*pt,se+=38*gt,m=1,c=B+m+65535,m=Math.floor(c/65536),B=c-m*65536,c=z+m+65535,m=Math.floor(c/65536),z=c-m*65536,c=W+m+65535,m=Math.floor(c/65536),W=c-m*65536,c=oe+m+65535,m=Math.floor(c/65536),oe=c-m*65536,c=fe+m+65535,m=Math.floor(c/65536),fe=c-m*65536,c=T+m+65535,m=Math.floor(c/65536),T=c-m*65536,c=H+m+65535,m=Math.floor(c/65536),H=c-m*65536,c=ce+m+65535,m=Math.floor(c/65536),ce=c-m*65536,c=ie+m+65535,m=Math.floor(c/65536),ie=c-m*65536,c=Y+m+65535,m=Math.floor(c/65536),Y=c-m*65536,c=re+m+65535,m=Math.floor(c/65536),re=c-m*65536,c=J+m+65535,m=Math.floor(c/65536),J=c-m*65536,c=ne+m+65535,m=Math.floor(c/65536),ne=c-m*65536,c=xe+m+65535,m=Math.floor(c/65536),xe=c-m*65536,c=se+m+65535,m=Math.floor(c/65536),se=c-m*65536,c=be+m+65535,m=Math.floor(c/65536),be=c-m*65536,B+=m-1+37*(m-1),m=1,c=B+m+65535,m=Math.floor(c/65536),B=c-m*65536,c=z+m+65535,m=Math.floor(c/65536),z=c-m*65536,c=W+m+65535,m=Math.floor(c/65536),W=c-m*65536,c=oe+m+65535,m=Math.floor(c/65536),oe=c-m*65536,c=fe+m+65535,m=Math.floor(c/65536),fe=c-m*65536,c=T+m+65535,m=Math.floor(c/65536),T=c-m*65536,c=H+m+65535,m=Math.floor(c/65536),H=c-m*65536,c=ce+m+65535,m=Math.floor(c/65536),ce=c-m*65536,c=ie+m+65535,m=Math.floor(c/65536),ie=c-m*65536,c=Y+m+65535,m=Math.floor(c/65536),Y=c-m*65536,c=re+m+65535,m=Math.floor(c/65536),re=c-m*65536,c=J+m+65535,m=Math.floor(c/65536),J=c-m*65536,c=ne+m+65535,m=Math.floor(c/65536),ne=c-m*65536,c=xe+m+65535,m=Math.floor(c/65536),xe=c-m*65536,c=se+m+65535,m=Math.floor(c/65536),se=c-m*65536,c=be+m+65535,m=Math.floor(c/65536),be=c-m*65536,B+=m-1+37*(m-1),S[0]=B,S[1]=z,S[2]=W,S[3]=oe,S[4]=fe,S[5]=T,S[6]=H,S[7]=ce,S[8]=ie,S[9]=Y,S[10]=re,S[11]=J,S[12]=ne,S[13]=xe,S[14]=se,S[15]=be}function P(S,I){N(S,I,I)}function F(S,I){const _=s();for(let c=0;c<16;c++)_[c]=I[c];for(let c=253;c>=0;c--)P(_,_),c!==2&&c!==4&&N(_,_,I);for(let c=0;c<16;c++)S[c]=_[c]}function k(S,I){const _=new Uint8Array(32),c=new Float64Array(80),m=s(),B=s(),z=s(),W=s(),oe=s(),fe=s();for(let ie=0;ie<31;ie++)_[ie]=S[ie];_[31]=S[31]&127|64,_[0]&=248,b(c,I);for(let ie=0;ie<16;ie++)B[ie]=c[ie];m[0]=W[0]=1;for(let ie=254;ie>=0;--ie){const Y=_[ie>>>3]>>>(ie&7)&1;f(m,B,Y),f(z,W,Y),E(oe,m,z),C(m,m,z),E(z,B,W),C(B,B,W),P(W,oe),P(fe,m),N(m,z,m),N(z,B,oe),E(oe,m,z),C(m,m,z),P(B,m),C(z,W,fe),N(m,z,h),E(m,m,W),N(z,z,m),N(m,W,fe),N(W,B,c),P(B,oe),f(m,B,Y),f(z,W,Y)}for(let ie=0;ie<16;ie++)c[ie+16]=m[ie],c[ie+32]=z[ie],c[ie+48]=B[ie],c[ie+64]=W[ie];const T=c.subarray(32),H=c.subarray(16);F(T,T),N(H,H,T);const ce=new Uint8Array(32);return g(ce,H),ce}i.scalarMult=k;function K(S){return k(S,o)}i.scalarMultBase=K;function ee(S){if(S.length!==i.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${i.SECRET_KEY_LENGTH} bytes`);const I=new Uint8Array(S);return{publicKey:K(I),secretKey:I}}i.generateKeyPairFromSeed=ee;function A(S){const I=(0,e.randomBytes)(32,S),_=ee(I);return(0,r.wipe)(I),_}i.generateKeyPair=A;function $(S,I,_=!1){if(S.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(I.length!==i.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const c=k(S,I);if(_){let m=0;for(let B=0;B<c.length;B++)m|=c[B];if(m===0)throw new Error("X25519: invalid shared key")}return c}i.sharedKey=$})(Vu);function Wu(i){return globalThis.Buffer!=null?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):i}function vp(i=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Wu(globalThis.Buffer.allocUnsafe(i)):new Uint8Array(i)}function Ru(i,e){e||(e=i.reduce((o,h)=>o+h.length,0));const r=vp(e);let s=0;for(const o of i)r.set(o,s),s+=o.length;return Wu(r)}function fw(i,e){if(i.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),s=0;s<r.length;s++)r[s]=255;for(var o=0;o<i.length;o++){var h=i.charAt(o),p=h.charCodeAt(0);if(r[p]!==255)throw new TypeError(h+" is ambiguous");r[p]=o}var f=i.length,g=i.charAt(0),b=Math.log(f)/Math.log(256),E=Math.log(256)/Math.log(f);function C(F){if(F instanceof Uint8Array||(ArrayBuffer.isView(F)?F=new Uint8Array(F.buffer,F.byteOffset,F.byteLength):Array.isArray(F)&&(F=Uint8Array.from(F))),!(F instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(F.length===0)return"";for(var k=0,K=0,ee=0,A=F.length;ee!==A&&F[ee]===0;)ee++,k++;for(var $=(A-ee)*E+1>>>0,S=new Uint8Array($);ee!==A;){for(var I=F[ee],_=0,c=$-1;(I!==0||_<K)&&c!==-1;c--,_++)I+=256*S[c]>>>0,S[c]=I%f>>>0,I=I/f>>>0;if(I!==0)throw new Error("Non-zero carry");K=_,ee++}for(var m=$-K;m!==$&&S[m]===0;)m++;for(var B=g.repeat(k);m<$;++m)B+=i.charAt(S[m]);return B}function N(F){if(typeof F!="string")throw new TypeError("Expected String");if(F.length===0)return new Uint8Array;var k=0;if(F[k]!==" "){for(var K=0,ee=0;F[k]===g;)K++,k++;for(var A=(F.length-k)*b+1>>>0,$=new Uint8Array(A);F[k];){var S=r[F.charCodeAt(k)];if(S===255)return;for(var I=0,_=A-1;(S!==0||I<ee)&&_!==-1;_--,I++)S+=f*$[_]>>>0,$[_]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");ee=I,k++}if(F[k]!==" "){for(var c=A-ee;c!==A&&$[c]===0;)c++;for(var m=new Uint8Array(K+(A-c)),B=K;c!==A;)m[B++]=$[c++];return m}}}function P(F){var k=N(F);if(k)return k;throw new Error(`Non-${e} character`)}return{encode:C,decodeUnsafe:N,decode:P}}var dw=fw,pw=dw;const gw=i=>{if(i instanceof Uint8Array&&i.constructor.name==="Uint8Array")return i;if(i instanceof ArrayBuffer)return new Uint8Array(i);if(ArrayBuffer.isView(i))return new Uint8Array(i.buffer,i.byteOffset,i.byteLength);throw new Error("Unknown type, must be binary type")},vw=i=>new TextEncoder().encode(i),yw=i=>new TextDecoder().decode(i);class mw{constructor(e,r,s){this.name=e,this.prefix=r,this.baseEncode=s}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class _w{constructor(e,r,s){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=s}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return yp(this,e)}}class bw{constructor(e){this.decoders=e}or(e){return yp(this,e)}decode(e){const r=e[0],s=this.decoders[r];if(s)return s.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const yp=(i,e)=>new bw({...i.decoders||{[i.prefix]:i},...e.decoders||{[e.prefix]:e}});class ww{constructor(e,r,s,o){this.name=e,this.prefix=r,this.baseEncode=s,this.baseDecode=o,this.encoder=new mw(e,r,s),this.decoder=new _w(e,r,o)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ea=({name:i,prefix:e,encode:r,decode:s})=>new ww(i,e,r,s),Hs=({prefix:i,name:e,alphabet:r})=>{const{encode:s,decode:o}=pw(r,e);return Ea({prefix:i,name:e,encode:s,decode:h=>gw(o(h))})},Ew=(i,e,r,s)=>{const o={};for(let E=0;E<e.length;++E)o[e[E]]=E;let h=i.length;for(;i[h-1]==="=";)--h;const p=new Uint8Array(h*r/8|0);let f=0,g=0,b=0;for(let E=0;E<h;++E){const C=o[i[E]];if(C===void 0)throw new SyntaxError(`Non-${s} character`);g=g<<r|C,f+=r,f>=8&&(f-=8,p[b++]=255&g>>f)}if(f>=r||255&g<<8-f)throw new SyntaxError("Unexpected end of data");return p},Dw=(i,e,r)=>{const s=e[e.length-1]==="=",o=(1<<r)-1;let h="",p=0,f=0;for(let g=0;g<i.length;++g)for(f=f<<8|i[g],p+=8;p>r;)p-=r,h+=e[o&f>>p];if(p&&(h+=e[o&f<<r-p]),s)for(;h.length*r&7;)h+="=";return h},Jt=({name:i,prefix:e,bitsPerChar:r,alphabet:s})=>Ea({prefix:e,name:i,encode(o){return Dw(o,s,r)},decode(o){return Ew(o,s,r,i)}}),Sw=Ea({prefix:"\0",name:"identity",encode:i=>yw(i),decode:i=>vw(i)}),Iw=Object.freeze(Object.defineProperty({__proto__:null,identity:Sw},Symbol.toStringTag,{value:"Module"})),xw=Jt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Ow=Object.freeze(Object.defineProperty({__proto__:null,base2:xw},Symbol.toStringTag,{value:"Module"})),Cw=Jt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Pw=Object.freeze(Object.defineProperty({__proto__:null,base8:Cw},Symbol.toStringTag,{value:"Module"})),Aw=Hs({prefix:"9",name:"base10",alphabet:"0123456789"}),Tw=Object.freeze(Object.defineProperty({__proto__:null,base10:Aw},Symbol.toStringTag,{value:"Module"})),Rw=Jt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Nw=Jt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),$w=Object.freeze(Object.defineProperty({__proto__:null,base16:Rw,base16upper:Nw},Symbol.toStringTag,{value:"Module"})),Lw=Jt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Uw=Jt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Fw=Jt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Mw=Jt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),jw=Jt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),qw=Jt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Hw=Jt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),zw=Jt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Bw=Jt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),kw=Object.freeze(Object.defineProperty({__proto__:null,base32:Lw,base32hex:jw,base32hexpad:Hw,base32hexpadupper:zw,base32hexupper:qw,base32pad:Fw,base32padupper:Mw,base32upper:Uw,base32z:Bw},Symbol.toStringTag,{value:"Module"})),Kw=Hs({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Vw=Hs({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Ww=Object.freeze(Object.defineProperty({__proto__:null,base36:Kw,base36upper:Vw},Symbol.toStringTag,{value:"Module"})),Gw=Hs({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Yw=Hs({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Jw=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Gw,base58flickr:Yw},Symbol.toStringTag,{value:"Module"})),Qw=Jt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Xw=Jt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Zw=Jt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),eE=Jt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),tE=Object.freeze(Object.defineProperty({__proto__:null,base64:Qw,base64pad:Xw,base64url:Zw,base64urlpad:eE},Symbol.toStringTag,{value:"Module"})),mp=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),rE=mp.reduce((i,e,r)=>(i[r]=e,i),[]),iE=mp.reduce((i,e,r)=>(i[e.codePointAt(0)]=r,i),[]);function nE(i){return i.reduce((e,r)=>(e+=rE[r],e),"")}function sE(i){const e=[];for(const r of i){const s=iE[r.codePointAt(0)];if(s===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(s)}return new Uint8Array(e)}const oE=Ea({prefix:"🚀",name:"base256emoji",encode:nE,decode:sE}),aE=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:oE},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const If={...Iw,...Ow,...Pw,...Tw,...$w,...kw,...Ww,...Jw,...tE,...aE};function _p(i,e,r,s){return{name:i,prefix:e,encoder:{name:i,prefix:e,encode:r},decoder:{decode:s}}}const xf=_p("utf8","u",i=>"u"+new TextDecoder("utf8").decode(i),i=>new TextEncoder().encode(i.substring(1))),tu=_p("ascii","a",i=>{let e="a";for(let r=0;r<i.length;r++)e+=String.fromCharCode(i[r]);return e},i=>{i=i.substring(1);const e=vp(i.length);for(let r=0;r<i.length;r++)e[r]=i.charCodeAt(r);return e}),bp={utf8:xf,"utf-8":xf,hex:If.base16,latin1:tu,ascii:tu,binary:tu,...If};function Er(i,e="utf8"){const r=bp[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Wu(globalThis.Buffer.from(i,"utf-8")):r.decoder.decode(`${r.prefix}${i}`)}function dr(i,e="utf8"){const r=bp[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(i.buffer,i.byteOffset,i.byteLength).toString("utf8"):r.encoder.encode(i).substring(1)}var Of=globalThis&&globalThis.__spreadArray||function(i,e,r){if(r||arguments.length===2)for(var s=0,o=e.length,h;s<o;s++)(h||!(s in e))&&(h||(h=Array.prototype.slice.call(e,0,s)),h[s]=e[s]);return i.concat(h||Array.prototype.slice.call(e))},cE=function(){function i(e,r,s){this.name=e,this.version=r,this.os=s,this.type="browser"}return i}(),uE=function(){function i(e){this.version=e,this.type="node",this.name="node",this.os=hi.platform}return i}(),hE=function(){function i(e,r,s,o){this.name=e,this.version=r,this.os=s,this.bot=o,this.type="bot-device"}return i}(),lE=function(){function i(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return i}(),fE=function(){function i(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return i}(),dE=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,pE=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Cf=3,gE=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",dE]],Pf=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function vE(i){return i?Af(i):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new fE:typeof navigator<"u"?Af(navigator.userAgent):_E()}function yE(i){return i!==""&&gE.reduce(function(e,r){var s=r[0],o=r[1];if(e)return e;var h=o.exec(i);return!!h&&[s,h]},!1)}function Af(i){var e=yE(i);if(!e)return null;var r=e[0],s=e[1];if(r==="searchbot")return new lE;var o=s[1]&&s[1].split(".").join("_").split("_").slice(0,3);o?o.length<Cf&&(o=Of(Of([],o,!0),bE(Cf-o.length),!0)):o=[];var h=o.join("."),p=mE(i),f=pE.exec(i);return f&&f[1]?new hE(r,h,p,f[1]):new cE(r,h,p)}function mE(i){for(var e=0,r=Pf.length;e<r;e++){var s=Pf[e],o=s[0],h=s[1],p=h.exec(i);if(p)return o}return null}function _E(){var i=typeof hi<"u"&&hi.version;return i?new uE(hi.version.slice(1)):null}function bE(i){for(var e=[],r=0;r<i;r++)e.push("0");return e}var ye={};const Br=zu(tb);var ru={},ws={},Tf;function wE(){if(Tf)return ws;Tf=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.delay=void 0;function i(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return ws.delay=i,ws}var fn={},iu={},dn={},Rf;function EE(){return Rf||(Rf=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.ONE_THOUSAND=dn.ONE_HUNDRED=void 0,dn.ONE_HUNDRED=100,dn.ONE_THOUSAND=1e3),dn}var nu={},Nf;function DE(){return Nf||(Nf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),i.ONE_YEAR=i.FOUR_WEEKS=i.THREE_WEEKS=i.TWO_WEEKS=i.ONE_WEEK=i.THIRTY_DAYS=i.SEVEN_DAYS=i.FIVE_DAYS=i.THREE_DAYS=i.ONE_DAY=i.TWENTY_FOUR_HOURS=i.TWELVE_HOURS=i.SIX_HOURS=i.THREE_HOURS=i.ONE_HOUR=i.SIXTY_MINUTES=i.THIRTY_MINUTES=i.TEN_MINUTES=i.FIVE_MINUTES=i.ONE_MINUTE=i.SIXTY_SECONDS=i.THIRTY_SECONDS=i.TEN_SECONDS=i.FIVE_SECONDS=i.ONE_SECOND=void 0,i.ONE_SECOND=1,i.FIVE_SECONDS=5,i.TEN_SECONDS=10,i.THIRTY_SECONDS=30,i.SIXTY_SECONDS=60,i.ONE_MINUTE=i.SIXTY_SECONDS,i.FIVE_MINUTES=i.ONE_MINUTE*5,i.TEN_MINUTES=i.ONE_MINUTE*10,i.THIRTY_MINUTES=i.ONE_MINUTE*30,i.SIXTY_MINUTES=i.ONE_MINUTE*60,i.ONE_HOUR=i.SIXTY_MINUTES,i.THREE_HOURS=i.ONE_HOUR*3,i.SIX_HOURS=i.ONE_HOUR*6,i.TWELVE_HOURS=i.ONE_HOUR*12,i.TWENTY_FOUR_HOURS=i.ONE_HOUR*24,i.ONE_DAY=i.TWENTY_FOUR_HOURS,i.THREE_DAYS=i.ONE_DAY*3,i.FIVE_DAYS=i.ONE_DAY*5,i.SEVEN_DAYS=i.ONE_DAY*7,i.THIRTY_DAYS=i.ONE_DAY*30,i.ONE_WEEK=i.SEVEN_DAYS,i.TWO_WEEKS=i.ONE_WEEK*2,i.THREE_WEEKS=i.ONE_WEEK*3,i.FOUR_WEEKS=i.ONE_WEEK*4,i.ONE_YEAR=i.ONE_DAY*365}(nu)),nu}var $f;function wp(){return $f||($f=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=Br;e.__exportStar(EE(),i),e.__exportStar(DE(),i)}(iu)),iu}var Lf;function SE(){if(Lf)return fn;Lf=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.fromMiliseconds=fn.toMiliseconds=void 0;const i=wp();function e(s){return s*i.ONE_THOUSAND}fn.toMiliseconds=e;function r(s){return Math.floor(s/i.ONE_THOUSAND)}return fn.fromMiliseconds=r,fn}var Uf;function IE(){return Uf||(Uf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=Br;e.__exportStar(wE(),i),e.__exportStar(SE(),i)}(ru)),ru}var Bn={},Ff;function xE(){if(Ff)return Bn;Ff=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.Watch=void 0;class i{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const s=this.get(r);if(typeof s.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const o=Date.now()-s.started;this.timestamps.set(r,{started:s.started,elapsed:o})}get(r){const s=this.timestamps.get(r);if(typeof s>"u")throw new Error(`No timestamp found for label: ${r}`);return s}elapsed(r){const s=this.get(r);return s.elapsed||Date.now()-s.started}}return Bn.Watch=i,Bn.default=i,Bn}var su={},Es={},Mf;function OE(){if(Mf)return Es;Mf=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.IWatch=void 0;class i{}return Es.IWatch=i,Es}var jf;function CE(){return jf||(jf=1,function(i){Object.defineProperty(i,"__esModule",{value:!0}),Br.__exportStar(OE(),i)}(su)),su}(function(i){Object.defineProperty(i,"__esModule",{value:!0});const e=Br;e.__exportStar(IE(),i),e.__exportStar(xE(),i),e.__exportStar(CE(),i),e.__exportStar(wp(),i)})(ye);var lt={};Object.defineProperty(lt,"__esModule",{value:!0});lt.getLocalStorage=lt.getLocalStorageOrThrow=lt.getCrypto=lt.getCryptoOrThrow=Dp=lt.getLocation=lt.getLocationOrThrow=Gu=lt.getNavigator=lt.getNavigatorOrThrow=Ep=lt.getDocument=lt.getDocumentOrThrow=lt.getFromWindowOrThrow=lt.getFromWindow=void 0;function mn(i){let e;return typeof window<"u"&&typeof window[i]<"u"&&(e=window[i]),e}lt.getFromWindow=mn;function Xn(i){const e=mn(i);if(!e)throw new Error(`${i} is not defined in Window`);return e}lt.getFromWindowOrThrow=Xn;function PE(){return Xn("document")}lt.getDocumentOrThrow=PE;function AE(){return mn("document")}var Ep=lt.getDocument=AE;function TE(){return Xn("navigator")}lt.getNavigatorOrThrow=TE;function RE(){return mn("navigator")}var Gu=lt.getNavigator=RE;function NE(){return Xn("location")}lt.getLocationOrThrow=NE;function $E(){return mn("location")}var Dp=lt.getLocation=$E;function LE(){return Xn("crypto")}lt.getCryptoOrThrow=LE;function UE(){return mn("crypto")}lt.getCrypto=UE;function FE(){return Xn("localStorage")}lt.getLocalStorageOrThrow=FE;function ME(){return mn("localStorage")}lt.getLocalStorage=ME;var Yu={};Object.defineProperty(Yu,"__esModule",{value:!0});var Sp=Yu.getWindowMetadata=void 0;const qf=lt;function jE(){let i,e;try{i=qf.getDocumentOrThrow(),e=qf.getLocationOrThrow()}catch{return null}function r(){const C=i.getElementsByTagName("link"),N=[];for(let P=0;P<C.length;P++){const F=C[P],k=F.getAttribute("rel");if(k&&k.toLowerCase().indexOf("icon")>-1){const K=F.getAttribute("href");if(K)if(K.toLowerCase().indexOf("https:")===-1&&K.toLowerCase().indexOf("http:")===-1&&K.indexOf("//")!==0){let ee=e.protocol+"//"+e.host;if(K.indexOf("/")===0)ee+=K;else{const A=e.pathname.split("/");A.pop();const $=A.join("/");ee+=$+"/"+K}N.push(ee)}else if(K.indexOf("//")===0){const ee=e.protocol+K;N.push(ee)}else N.push(K)}}return N}function s(...C){const N=i.getElementsByTagName("meta");for(let P=0;P<N.length;P++){const F=N[P],k=["itemprop","property","name"].map(K=>F.getAttribute(K)).filter(K=>K?C.includes(K):!1);if(k.length&&k){const K=F.getAttribute("content");if(K)return K}}return""}function o(){let C=s("name","og:site_name","og:title","twitter:title");return C||(C=i.title),C}function h(){return s("description","og:description","twitter:description","keywords")}const p=o(),f=h(),g=e.origin,b=r();return{description:f,url:g,icons:b,name:p}}Sp=Yu.getWindowMetadata=jE;var Fs={},qE=i=>encodeURIComponent(i).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Ip="%[a-f0-9]{2}",Hf=new RegExp("("+Ip+")|([^%]+?)","gi"),zf=new RegExp("("+Ip+")+","gi");function Nu(i,e){try{return[decodeURIComponent(i.join(""))]}catch{}if(i.length===1)return i;e=e||1;var r=i.slice(0,e),s=i.slice(e);return Array.prototype.concat.call([],Nu(r),Nu(s))}function HE(i){try{return decodeURIComponent(i)}catch{for(var e=i.match(Hf)||[],r=1;r<e.length;r++)i=Nu(e,r).join(""),e=i.match(Hf)||[];return i}}function zE(i){for(var e={"%FE%FF":"��","%FF%FE":"��"},r=zf.exec(i);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var s=HE(r[0]);s!==r[0]&&(e[r[0]]=s)}r=zf.exec(i)}e["%C2"]="�";for(var o=Object.keys(e),h=0;h<o.length;h++){var p=o[h];i=i.replace(new RegExp(p,"g"),e[p])}return i}var BE=function(i){if(typeof i!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof i+"`");try{return i=i.replace(/\+/g," "),decodeURIComponent(i)}catch{return zE(i)}},kE=(i,e)=>{if(!(typeof i=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[i];const r=i.indexOf(e);return r===-1?[i]:[i.slice(0,r),i.slice(r+e.length)]},KE=function(i,e){for(var r={},s=Object.keys(i),o=Array.isArray(e),h=0;h<s.length;h++){var p=s[h],f=i[p];(o?e.indexOf(p)!==-1:e(p,f,i))&&(r[p]=f)}return r};(function(i){const e=qE,r=BE,s=kE,o=KE,h=A=>A==null,p=Symbol("encodeFragmentIdentifier");function f(A){switch(A.arrayFormat){case"index":return $=>(S,I)=>{const _=S.length;return I===void 0||A.skipNull&&I===null||A.skipEmptyString&&I===""?S:I===null?[...S,[E($,A),"[",_,"]"].join("")]:[...S,[E($,A),"[",E(_,A),"]=",E(I,A)].join("")]};case"bracket":return $=>(S,I)=>I===void 0||A.skipNull&&I===null||A.skipEmptyString&&I===""?S:I===null?[...S,[E($,A),"[]"].join("")]:[...S,[E($,A),"[]=",E(I,A)].join("")];case"colon-list-separator":return $=>(S,I)=>I===void 0||A.skipNull&&I===null||A.skipEmptyString&&I===""?S:I===null?[...S,[E($,A),":list="].join("")]:[...S,[E($,A),":list=",E(I,A)].join("")];case"comma":case"separator":case"bracket-separator":{const $=A.arrayFormat==="bracket-separator"?"[]=":"=";return S=>(I,_)=>_===void 0||A.skipNull&&_===null||A.skipEmptyString&&_===""?I:(_=_===null?"":_,I.length===0?[[E(S,A),$,E(_,A)].join("")]:[[I,E(_,A)].join(A.arrayFormatSeparator)])}default:return $=>(S,I)=>I===void 0||A.skipNull&&I===null||A.skipEmptyString&&I===""?S:I===null?[...S,E($,A)]:[...S,[E($,A),"=",E(I,A)].join("")]}}function g(A){let $;switch(A.arrayFormat){case"index":return(S,I,_)=>{if($=/\[(\d*)\]$/.exec(S),S=S.replace(/\[\d*\]$/,""),!$){_[S]=I;return}_[S]===void 0&&(_[S]={}),_[S][$[1]]=I};case"bracket":return(S,I,_)=>{if($=/(\[\])$/.exec(S),S=S.replace(/\[\]$/,""),!$){_[S]=I;return}if(_[S]===void 0){_[S]=[I];return}_[S]=[].concat(_[S],I)};case"colon-list-separator":return(S,I,_)=>{if($=/(:list)$/.exec(S),S=S.replace(/:list$/,""),!$){_[S]=I;return}if(_[S]===void 0){_[S]=[I];return}_[S]=[].concat(_[S],I)};case"comma":case"separator":return(S,I,_)=>{const c=typeof I=="string"&&I.includes(A.arrayFormatSeparator),m=typeof I=="string"&&!c&&C(I,A).includes(A.arrayFormatSeparator);I=m?C(I,A):I;const B=c||m?I.split(A.arrayFormatSeparator).map(z=>C(z,A)):I===null?I:C(I,A);_[S]=B};case"bracket-separator":return(S,I,_)=>{const c=/(\[\])$/.test(S);if(S=S.replace(/\[\]$/,""),!c){_[S]=I&&C(I,A);return}const m=I===null?[]:I.split(A.arrayFormatSeparator).map(B=>C(B,A));if(_[S]===void 0){_[S]=m;return}_[S]=[].concat(_[S],m)};default:return(S,I,_)=>{if(_[S]===void 0){_[S]=I;return}_[S]=[].concat(_[S],I)}}}function b(A){if(typeof A!="string"||A.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function E(A,$){return $.encode?$.strict?e(A):encodeURIComponent(A):A}function C(A,$){return $.decode?r(A):A}function N(A){return Array.isArray(A)?A.sort():typeof A=="object"?N(Object.keys(A)).sort(($,S)=>Number($)-Number(S)).map($=>A[$]):A}function P(A){const $=A.indexOf("#");return $!==-1&&(A=A.slice(0,$)),A}function F(A){let $="";const S=A.indexOf("#");return S!==-1&&($=A.slice(S)),$}function k(A){A=P(A);const $=A.indexOf("?");return $===-1?"":A.slice($+1)}function K(A,$){return $.parseNumbers&&!Number.isNaN(Number(A))&&typeof A=="string"&&A.trim()!==""?A=Number(A):$.parseBooleans&&A!==null&&(A.toLowerCase()==="true"||A.toLowerCase()==="false")&&(A=A.toLowerCase()==="true"),A}function ee(A,$){$=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},$),b($.arrayFormatSeparator);const S=g($),I=Object.create(null);if(typeof A!="string"||(A=A.trim().replace(/^[?#&]/,""),!A))return I;for(const _ of A.split("&")){if(_==="")continue;let[c,m]=s($.decode?_.replace(/\+/g," "):_,"=");m=m===void 0?null:["comma","separator","bracket-separator"].includes($.arrayFormat)?m:C(m,$),S(C(c,$),m,I)}for(const _ of Object.keys(I)){const c=I[_];if(typeof c=="object"&&c!==null)for(const m of Object.keys(c))c[m]=K(c[m],$);else I[_]=K(c,$)}return $.sort===!1?I:($.sort===!0?Object.keys(I).sort():Object.keys(I).sort($.sort)).reduce((_,c)=>{const m=I[c];return m&&typeof m=="object"&&!Array.isArray(m)?_[c]=N(m):_[c]=m,_},Object.create(null))}i.extract=k,i.parse=ee,i.stringify=(A,$)=>{if(!A)return"";$=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},$),b($.arrayFormatSeparator);const S=m=>$.skipNull&&h(A[m])||$.skipEmptyString&&A[m]==="",I=f($),_={};for(const m of Object.keys(A))S(m)||(_[m]=A[m]);const c=Object.keys(_);return $.sort!==!1&&c.sort($.sort),c.map(m=>{const B=A[m];return B===void 0?"":B===null?E(m,$):Array.isArray(B)?B.length===0&&$.arrayFormat==="bracket-separator"?E(m,$)+"[]":B.reduce(I(m),[]).join("&"):E(m,$)+"="+E(B,$)}).filter(m=>m.length>0).join("&")},i.parseUrl=(A,$)=>{$=Object.assign({decode:!0},$);const[S,I]=s(A,"#");return Object.assign({url:S.split("?")[0]||"",query:ee(k(A),$)},$&&$.parseFragmentIdentifier&&I?{fragmentIdentifier:C(I,$)}:{})},i.stringifyUrl=(A,$)=>{$=Object.assign({encode:!0,strict:!0,[p]:!0},$);const S=P(A.url).split("?")[0]||"",I=i.extract(A.url),_=i.parse(I,{sort:!1}),c=Object.assign(_,A.query);let m=i.stringify(c,$);m&&(m=`?${m}`);let B=F(A.url);return A.fragmentIdentifier&&(B=`#${$[p]?E(A.fragmentIdentifier,$):A.fragmentIdentifier}`),`${S}${m}${B}`},i.pick=(A,$,S)=>{S=Object.assign({parseFragmentIdentifier:!0,[p]:!1},S);const{url:I,query:_,fragmentIdentifier:c}=i.parseUrl(A,S);return i.stringifyUrl({url:I,query:o(_,$),fragmentIdentifier:c},S)},i.exclude=(A,$,S)=>{const I=Array.isArray($)?_=>!$.includes(_):(_,c)=>!$(_,c);return i.pick(A,I,S)}})(Fs);const VE={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe"}},WE=":";function GE(i){const[e,r]=i.split(WE);return{namespace:e,reference:r}}function YE(i,e=[]){const r=[];return Object.keys(i).forEach(s=>{if(e.length&&!e.includes(s))return;const o=i[s];r.push(...o.accounts)}),r}function xp(i,e){return i.includes(":")?[i]:e.chains||[]}const Op="base10",fr="base16",$u="base64pad",Ju="utf8",Cp=0,_n=1,JE=0,Bf=1,Lu=12,Qu=32;function QE(){const i=Vu.generateKeyPair();return{privateKey:dr(i.secretKey,fr),publicKey:dr(i.publicKey,fr)}}function Uu(){const i=Qn.randomBytes(Qu);return dr(i,fr)}function XE(i,e){const r=Vu.sharedKey(Er(i,fr),Er(e,fr),!0),s=new sw(wa.SHA256,r).expand(Qu);return dr(s,fr)}function ZE(i){const e=wa.hash(Er(i,fr));return dr(e,fr)}function Wn(i){const e=wa.hash(Er(i,Ju));return dr(e,fr)}function e3(i){return Er(`${i}`,Op)}function zs(i){return Number(dr(i,Op))}function t3(i){const e=e3(typeof i.type<"u"?i.type:Cp);if(zs(e)===_n&&typeof i.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof i.senderPublicKey<"u"?Er(i.senderPublicKey,fr):void 0,s=typeof i.iv<"u"?Er(i.iv,fr):Qn.randomBytes(Lu),o=new ku.ChaCha20Poly1305(Er(i.symKey,fr)).seal(s,Er(i.message,Ju));return i3({type:e,sealed:o,iv:s,senderPublicKey:r})}function r3(i){const e=new ku.ChaCha20Poly1305(Er(i.symKey,fr)),{sealed:r,iv:s}=ha(i.encoded),o=e.open(s,r);if(o===null)throw new Error("Failed to decrypt");return dr(o,Ju)}function i3(i){if(zs(i.type)===_n){if(typeof i.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return dr(Ru([i.type,i.senderPublicKey,i.iv,i.sealed]),$u)}return dr(Ru([i.type,i.iv,i.sealed]),$u)}function ha(i){const e=Er(i,$u),r=e.slice(JE,Bf),s=Bf;if(zs(r)===_n){const f=s+Qu,g=f+Lu,b=e.slice(s,f),E=e.slice(f,g),C=e.slice(g);return{type:r,sealed:C,iv:E,senderPublicKey:b}}const o=s+Lu,h=e.slice(s,o),p=e.slice(o);return{type:r,sealed:p,iv:h}}function n3(i,e){const r=ha(i);return Pp({type:zs(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?dr(r.senderPublicKey,fr):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Pp(i){const e=(i==null?void 0:i.type)||Cp;if(e===_n){if(typeof(i==null?void 0:i.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(i==null?void 0:i.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:i==null?void 0:i.senderPublicKey,receiverPublicKey:i==null?void 0:i.receiverPublicKey}}function kf(i){return i.type===_n&&typeof i.senderPublicKey=="string"&&typeof i.receiverPublicKey=="string"}var s3=Object.defineProperty,Kf=Object.getOwnPropertySymbols,o3=Object.prototype.hasOwnProperty,a3=Object.prototype.propertyIsEnumerable,Vf=(i,e,r)=>e in i?s3(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,Wf=(i,e)=>{for(var r in e||(e={}))o3.call(e,r)&&Vf(i,r,e[r]);if(Kf)for(var r of Kf(e))a3.call(e,r)&&Vf(i,r,e[r]);return i};const c3="ReactNative",Ar={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},u3="js";function Xu(){return typeof hi<"u"&&typeof hi.versions<"u"&&typeof hi.versions.node<"u"}function Bs(){return!Ep()&&!!Gu()&&navigator.product===c3}function ks(){return!Xu()&&!!Gu()}function Ks(){return Bs()?Ar.reactNative:Xu()?Ar.node:ks()?Ar.browser:Ar.unknown}function h3(i,e){let r=Fs.parse(i);return r=Wf(Wf({},r),e),i=Fs.stringify(r),i}function l3(){return Sp()||{name:"",description:"",url:"",icons:[""]}}function f3(){if(Ks()===Ar.reactNative&&typeof Et<"u"&&typeof(Et==null?void 0:Et.Platform)<"u"){const{OS:r,Version:s}=Et.Platform;return[r,s].join("-")}const i=vE();if(i===null)return"unknown";const e=i.os?i.os.replace(" ","").toLowerCase():"unknown";return i.type==="browser"?[e,i.name,i.version].join("-"):[e,i.version].join("-")}function d3(){var i;const e=Ks();return e===Ar.browser?[e,((i=Dp())==null?void 0:i.host)||"unknown"].join(":"):e}function p3(i,e,r){const s=f3(),o=d3();return[[i,e].join("-"),[u3,r].join("-"),s,o].join("/")}function g3({protocol:i,version:e,relayUrl:r,sdkVersion:s,auth:o,projectId:h,useOnCloseEvent:p}){const f=r.split("?"),g=p3(i,e,s),b={auth:o,ua:g,projectId:h,useOnCloseEvent:p||void 0},E=h3(f[1]||"",b);return f[0]+"?"+E}function vn(i,e){return i.filter(r=>e.includes(r)).length===i.length}function Ap(i){return Object.fromEntries(i.entries())}function Tp(i){return new Map(Object.entries(i))}function kn(i=ye.FIVE_MINUTES,e){const r=ye.toMiliseconds(i||ye.FIVE_MINUTES);let s,o,h;return{resolve:p=>{h&&s&&(clearTimeout(h),s(p))},reject:p=>{h&&o&&(clearTimeout(h),o(p))},done:()=>new Promise((p,f)=>{h=setTimeout(()=>{f(new Error(e))},r),s=p,o=f})}}function Ms(i,e,r){return new Promise(async(s,o)=>{const h=setTimeout(()=>o(new Error(r)),e);try{const p=await i;s(p)}catch(p){o(p)}clearTimeout(h)})}function Rp(i,e){if(typeof e=="string"&&e.startsWith(`${i}:`))return e;if(i.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(i.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${i}`)}function v3(i){return Rp("topic",i)}function y3(i){return Rp("id",i)}function Np(i){const[e,r]=i.split(":"),s={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")s.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))s.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return s}function Qr(i,e){return ye.fromMiliseconds((e||Date.now())+ye.toMiliseconds(i))}function Bi(i){return Date.now()>=ye.toMiliseconds(i)}function zt(i,e){return`${i}${e?`:${e}`:""}`}function ou(i=[],e=[]){return[...new Set([...i,...e])]}async function m3({id:i,topic:e,wcDeepLink:r}){try{if(!r)return;const s=typeof r=="string"?JSON.parse(r):r;let o=s==null?void 0:s.href;if(typeof o!="string")return;o.endsWith("/")&&(o=o.slice(0,-1));const h=`${o}/wc?requestId=${i}&sessionTopic=${e}`,p=Ks();p===Ar.browser?h.startsWith("https://")?window.open(h,"_blank","noreferrer noopener"):window.open(h,"_self","noreferrer noopener"):p===Ar.reactNative&&typeof(Et==null?void 0:Et.Linking)<"u"&&await Et.Linking.openURL(h)}catch(s){console.error(s)}}const _3="irn";function Fu(i){return(i==null?void 0:i.relay)||{protocol:_3}}function oa(i){const e=VE[i];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${i}`);return e}var b3=Object.defineProperty,Gf=Object.getOwnPropertySymbols,w3=Object.prototype.hasOwnProperty,E3=Object.prototype.propertyIsEnumerable,Yf=(i,e,r)=>e in i?b3(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,D3=(i,e)=>{for(var r in e||(e={}))w3.call(e,r)&&Yf(i,r,e[r]);if(Gf)for(var r of Gf(e))E3.call(e,r)&&Yf(i,r,e[r]);return i};function S3(i,e="-"){const r={},s="relay"+e;return Object.keys(i).forEach(o=>{if(o.startsWith(s)){const h=o.replace(s,""),p=i[o];r[h]=p}}),r}function I3(i){i=i.includes("wc://")?i.replace("wc://",""):i,i=i.includes("wc:")?i.replace("wc:",""):i;const e=i.indexOf(":"),r=i.indexOf("?")!==-1?i.indexOf("?"):void 0,s=i.substring(0,e),o=i.substring(e+1,r).split("@"),h=typeof r<"u"?i.substring(r):"",p=Fs.parse(h);return{protocol:s,topic:x3(o[0]),version:parseInt(o[1],10),symKey:p.symKey,relay:S3(p)}}function x3(i){return i.startsWith("//")?i.substring(2):i}function O3(i,e="-"){const r="relay",s={};return Object.keys(i).forEach(o=>{const h=r+e+o;i[o]&&(s[h]=i[o])}),s}function C3(i){return`${i.protocol}:${i.topic}@${i.version}?`+Fs.stringify(D3({symKey:i.symKey},O3(i.relay)))}function Zn(i){const e=[];return i.forEach(r=>{const[s,o]=r.split(":");e.push(`${s}:${o}`)}),e}function P3(i){const e=[];return Object.values(i).forEach(r=>{e.push(...Zn(r.accounts))}),e}function A3(i,e){const r=[];return Object.values(i).forEach(s=>{Zn(s.accounts).includes(e)&&r.push(...s.methods)}),r}function T3(i,e){const r=[];return Object.values(i).forEach(s=>{Zn(s.accounts).includes(e)&&r.push(...s.events)}),r}function R3(i,e){const r=aa(i,e);if(r)throw new Error(r.message);const s={};for(const[o,h]of Object.entries(i))s[o]={methods:h.methods,events:h.events,chains:h.accounts.map(p=>`${p.split(":")[0]}:${p.split(":")[1]}`)};return s}function Zu(i){return i.includes(":")}function Ns(i){return Zu(i)?i.split(":")[0]:i}const N3={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}},$3={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 he(i,e){const{message:r,code:s}=$3[i];return{message:e?`${r} ${e}`:r,code:s}}function $t(i,e){const{message:r,code:s}=N3[i];return{message:e?`${r} ${e}`:r,code:s}}function li(i,e){return Array.isArray(i)?typeof e<"u"&&i.length?i.every(e):!0:!1}function Gn(i){return Object.getPrototypeOf(i)===Object.prototype&&Object.keys(i).length}function lr(i){return typeof i>"u"}function Gt(i,e){return e&&lr(i)?!0:typeof i=="string"&&!!i.trim().length}function eh(i,e){return e&&lr(i)?!0:typeof i=="number"&&!isNaN(i)}function L3(i,e){const{requiredNamespaces:r}=e,s=Object.keys(i.namespaces),o=Object.keys(r);let h=!0;return vn(o,s)?(s.forEach(p=>{const{accounts:f,methods:g,events:b}=i.namespaces[p],E=Zn(f),C=r[p];(!vn(xp(p,C),E)||!vn(C.methods,g)||!vn(C.events,b))&&(h=!1)}),h):!1}function la(i){return Gt(i,!1)&&i.includes(":")?i.split(":").length===2:!1}function U3(i){if(Gt(i,!1)&&i.includes(":")){const e=i.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&la(r)}}return!1}function F3(i){if(Gt(i,!1))try{return typeof new URL(i)<"u"}catch{return!1}return!1}function M3(i){var e;return(e=i==null?void 0:i.proposer)==null?void 0:e.publicKey}function j3(i){return i==null?void 0:i.topic}function q3(i,e){let r=null;return Gt(i==null?void 0:i.publicKey,!1)||(r=he("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function Jf(i){let e=!0;return li(i)?i.length&&(e=i.every(r=>Gt(r,!1))):e=!1,e}function H3(i,e,r){let s=null;return li(e)&&e.length?e.forEach(o=>{s||la(o)||(s=$t("UNSUPPORTED_CHAINS",`${r}, chain ${o} should be a string and conform to "namespace:chainId" format`))}):la(i)||(s=$t("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),s}function z3(i,e,r){let s=null;return Object.entries(i).forEach(([o,h])=>{if(s)return;const p=H3(o,xp(o,h),`${e} ${r}`);p&&(s=p)}),s}function B3(i,e){let r=null;return li(i)?i.forEach(s=>{r||U3(s)||(r=$t("UNSUPPORTED_ACCOUNTS",`${e}, account ${s} should be a string and conform to "namespace:chainId:address" format`))}):r=$t("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function k3(i,e){let r=null;return Object.values(i).forEach(s=>{if(r)return;const o=B3(s==null?void 0:s.accounts,`${e} namespace`);o&&(r=o)}),r}function K3(i,e){let r=null;return Jf(i==null?void 0:i.methods)?Jf(i==null?void 0:i.events)||(r=$t("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=$t("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function $p(i,e){let r=null;return Object.values(i).forEach(s=>{if(r)return;const o=K3(s,`${e}, namespace`);o&&(r=o)}),r}function V3(i,e,r){let s=null;if(i&&Gn(i)){const o=$p(i,e);o&&(s=o);const h=z3(i,e,r);h&&(s=h)}else s=he("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return s}function aa(i,e){let r=null;if(i&&Gn(i)){const s=$p(i,e);s&&(r=s);const o=k3(i,e);o&&(r=o)}else r=he("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Lp(i){return Gt(i.protocol,!0)}function W3(i,e){let r=!1;return e&&!i?r=!0:i&&li(i)&&i.length&&i.forEach(s=>{r=Lp(s)}),r}function G3(i){return typeof i=="number"}function wr(i){return typeof i<"u"&&typeof i!==null}function Y3(i){return!(!i||typeof i!="object"||!i.code||!eh(i.code,!1)||!i.message||!Gt(i.message,!1))}function J3(i){return!(lr(i)||!Gt(i.method,!1))}function Q3(i){return!(lr(i)||lr(i.result)&&lr(i.error)||!eh(i.id,!1)||!Gt(i.jsonrpc,!1))}function X3(i){return!(lr(i)||!Gt(i.name,!1))}function Qf(i,e){return!(!la(e)||!P3(i).includes(e))}function Z3(i,e,r){return Gt(r,!1)?A3(i,e).includes(r):!1}function e6(i,e,r){return Gt(r,!1)?T3(i,e).includes(r):!1}function Xf(i,e,r){let s=null;const o=t6(i),h=r6(e),p=Object.keys(o),f=Object.keys(h),g=Zf(Object.keys(i)),b=Zf(Object.keys(e)),E=g.filter(C=>!b.includes(C));return E.length&&(s=he("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
|
|
2
2
|
Required: ${E.toString()}
|
|
3
3
|
Received: ${Object.keys(e).toString()}`)),vn(p,f)||(s=he("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
|
|
4
4
|
Required: ${p.toString()}
|
|
@@ -31,4 +31,4 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
31
31
|
`:`;
|
|
32
32
|
`)+te+`return __p
|
|
33
33
|
}`;var He=cf(function(){return rt(y,ve+"return "+te).apply(r,D)});if(He.source=te,zc(He))throw He;return He}function n_(t){return it(t).toLowerCase()}function s_(t){return it(t).toUpperCase()}function o_(t,n,a){if(t=it(t),t&&(a||n===r))return vh(t);if(!t||!(n=Ir(n)))return t;var u=Vr(t),d=Vr(n),y=yh(u,d),D=mh(u,d)+1;return qi(u,y,D).join("")}function a_(t,n,a){if(t=it(t),t&&(a||n===r))return t.slice(0,bh(t)+1);if(!t||!(n=Ir(n)))return t;var u=Vr(t),d=mh(u,Vr(n))+1;return qi(u,0,d).join("")}function c_(t,n,a){if(t=it(t),t&&(a||n===r))return t.replace(Ot,"");if(!t||!(n=Ir(n)))return t;var u=Vr(t),d=yh(u,Vr(n));return qi(u,d).join("")}function u_(t,n){var a=z,u=W;if(wt(n)){var d="separator"in n?n.separator:d;a="length"in n?Me(n.length):a,u="omission"in n?Ir(n.omission):u}t=it(t);var y=t.length;if(An(t)){var D=Vr(t);y=D.length}if(a>=y)return t;var O=a-Tn(u);if(O<1)return u;var M=D?qi(D,0,O).join(""):t.slice(0,O);if(d===r)return M+u;if(D&&(O+=M.length-O),Bc(d)){if(t.slice(O).search(d)){var Q,X=M;for(d.global||(d=sc(d.source,it(Rr.exec(d))+"g")),d.lastIndex=0;Q=d.exec(X);)var te=Q.index;M=M.slice(0,te===r?O:te)}}else if(t.indexOf(Ir(d),O)!=O){var ue=M.lastIndexOf(d);ue>-1&&(M=M.slice(0,ue))}return M+u}function h_(t){return t=it(t),t&&Dt.test(t)?t.replace(Ti,jg):t}var l_=Mn(function(t,n,a){return t+(a?" ":"")+n.toUpperCase()}),Vc=cl("toUpperCase");function af(t,n,a){return t=it(t),n=a?r:n,n===r?$g(t)?zg(t):Ig(t):t.match(n)||[]}var cf=ke(function(t,n){try{return Kt(t,r,n)}catch(a){return zc(a)?a:new Ae(a)}}),f_=_i(function(t,n){return $r(n,function(a){a=si(a),yi(t,a,qc(t[a],t))}),t});function d_(t){var n=t==null?0:t.length,a=_e();return t=n?mt(t,function(u){if(typeof u[1]!="function")throw new Lr(p);return[a(u[0]),u[1]]}):[],ke(function(u){for(var d=-1;++d<n;){var y=t[d];if(Kt(y[0],this,u))return Kt(y[1],this,u)}})}function p_(t){return j0(Fr(t,C))}function Wc(t){return function(){return t}}function g_(t,n){return t==null||t!==t?n:t}var v_=hl(),y_=hl(!0);function _r(t){return t}function Gc(t){return qh(typeof t=="function"?t:Fr(t,C))}function m_(t){return zh(Fr(t,C))}function __(t,n){return Bh(t,Fr(n,C))}var b_=ke(function(t,n){return function(a){return ds(a,t,n)}}),w_=ke(function(t,n){return function(a){return ds(t,a,n)}});function Yc(t,n,a){var u=Vt(n),d=No(n,u);a==null&&!(wt(n)&&(d.length||!u.length))&&(a=n,n=t,t=this,d=No(n,Vt(n)));var y=!(wt(a)&&"chain"in a)||!!a.chain,D=wi(t);return $r(d,function(O){var M=n[O];t[O]=M,D&&(t.prototype[O]=function(){var Q=this.__chain__;if(y||Q){var X=t(this.__wrapped__),te=X.__actions__=vr(this.__actions__);return te.push({func:M,args:arguments,thisArg:t}),X.__chain__=Q,X}return M.apply(t,$i([this.value()],arguments))})}),t}function E_(){return Qe._===this&&(Qe._=Gg),this}function Jc(){}function D_(t){return t=Me(t),ke(function(n){return kh(n,t)})}var S_=Oc(mt),I_=Oc(lh),x_=Oc(Xa);function uf(t){return $c(t)?Za(si(t)):r1(t)}function O_(t){return function(n){return t==null?r:on(t,n)}}var C_=fl(),P_=fl(!0);function Qc(){return[]}function Xc(){return!1}function A_(){return{}}function T_(){return""}function R_(){return!0}function N_(t,n){if(t=Me(t),t<1||t>Y)return[];var a=ne,u=Xt(t,ne);n=_e(n),t-=ne;for(var d=rc(u,n);++a<t;)n(a);return d}function $_(t){return Re(t)?mt(t,si):xr(t)?[t]:vr(Cl(it(t)))}function L_(t){var n=++Vg;return it(t)+n}var U_=jo(function(t,n){return t+n},0),F_=Cc("ceil"),M_=jo(function(t,n){return t/n},1),j_=Cc("floor");function q_(t){return t&&t.length?Ro(t,_r,dc):r}function H_(t,n){return t&&t.length?Ro(t,_e(n,2),dc):r}function z_(t){return ph(t,_r)}function B_(t,n){return ph(t,_e(n,2))}function k_(t){return t&&t.length?Ro(t,_r,yc):r}function K_(t,n){return t&&t.length?Ro(t,_e(n,2),yc):r}var V_=jo(function(t,n){return t*n},1),W_=Cc("round"),G_=jo(function(t,n){return t-n},0);function Y_(t){return t&&t.length?tc(t,_r):0}function J_(t,n){return t&&t.length?tc(t,_e(n,2)):0}return v.after=my,v.ary=jl,v.assign=sm,v.assignIn=Zl,v.assignInWith=Xo,v.assignWith=om,v.at=am,v.before=ql,v.bind=qc,v.bindAll=f_,v.bindKey=Hl,v.castArray=Ay,v.chain=Ul,v.chunk=j1,v.compact=q1,v.concat=H1,v.cond=d_,v.conforms=p_,v.constant=Wc,v.countBy=Yv,v.create=cm,v.curry=zl,v.curryRight=Bl,v.debounce=kl,v.defaults=um,v.defaultsDeep=hm,v.defer=_y,v.delay=by,v.difference=z1,v.differenceBy=B1,v.differenceWith=k1,v.drop=K1,v.dropRight=V1,v.dropRightWhile=W1,v.dropWhile=G1,v.fill=Y1,v.filter=Qv,v.flatMap=ey,v.flatMapDeep=ty,v.flatMapDepth=ry,v.flatten=Rl,v.flattenDeep=J1,v.flattenDepth=Q1,v.flip=wy,v.flow=v_,v.flowRight=y_,v.fromPairs=X1,v.functions=ym,v.functionsIn=mm,v.groupBy=iy,v.initial=ev,v.intersection=tv,v.intersectionBy=rv,v.intersectionWith=iv,v.invert=bm,v.invertBy=wm,v.invokeMap=sy,v.iteratee=Gc,v.keyBy=oy,v.keys=Vt,v.keysIn=mr,v.map=Vo,v.mapKeys=Dm,v.mapValues=Sm,v.matches=m_,v.matchesProperty=__,v.memoize=Go,v.merge=Im,v.mergeWith=ef,v.method=b_,v.methodOf=w_,v.mixin=Yc,v.negate=Yo,v.nthArg=D_,v.omit=xm,v.omitBy=Om,v.once=Ey,v.orderBy=ay,v.over=S_,v.overArgs=Dy,v.overEvery=I_,v.overSome=x_,v.partial=Hc,v.partialRight=Kl,v.partition=cy,v.pick=Cm,v.pickBy=tf,v.property=uf,v.propertyOf=O_,v.pull=av,v.pullAll=$l,v.pullAllBy=cv,v.pullAllWith=uv,v.pullAt=hv,v.range=C_,v.rangeRight=P_,v.rearg=Sy,v.reject=ly,v.remove=lv,v.rest=Iy,v.reverse=Mc,v.sampleSize=dy,v.set=Am,v.setWith=Tm,v.shuffle=py,v.slice=fv,v.sortBy=yy,v.sortedUniq=_v,v.sortedUniqBy=bv,v.split=e_,v.spread=xy,v.tail=wv,v.take=Ev,v.takeRight=Dv,v.takeRightWhile=Sv,v.takeWhile=Iv,v.tap=qv,v.throttle=Oy,v.thru=Ko,v.toArray=Jl,v.toPairs=rf,v.toPairsIn=nf,v.toPath=$_,v.toPlainObject=Xl,v.transform=Rm,v.unary=Cy,v.union=xv,v.unionBy=Ov,v.unionWith=Cv,v.uniq=Pv,v.uniqBy=Av,v.uniqWith=Tv,v.unset=Nm,v.unzip=jc,v.unzipWith=Ll,v.update=$m,v.updateWith=Lm,v.values=Hn,v.valuesIn=Um,v.without=Rv,v.words=af,v.wrap=Py,v.xor=Nv,v.xorBy=$v,v.xorWith=Lv,v.zip=Uv,v.zipObject=Fv,v.zipObjectDeep=Mv,v.zipWith=jv,v.entries=rf,v.entriesIn=nf,v.extend=Zl,v.extendWith=Xo,Yc(v,v),v.add=U_,v.attempt=cf,v.camelCase=qm,v.capitalize=sf,v.ceil=F_,v.clamp=Fm,v.clone=Ty,v.cloneDeep=Ny,v.cloneDeepWith=$y,v.cloneWith=Ry,v.conformsTo=Ly,v.deburr=of,v.defaultTo=g_,v.divide=M_,v.endsWith=Hm,v.eq=Gr,v.escape=zm,v.escapeRegExp=Bm,v.every=Jv,v.find=Xv,v.findIndex=Al,v.findKey=lm,v.findLast=Zv,v.findLastIndex=Tl,v.findLastKey=fm,v.floor=j_,v.forEach=Fl,v.forEachRight=Ml,v.forIn=dm,v.forInRight=pm,v.forOwn=gm,v.forOwnRight=vm,v.get=kc,v.gt=Uy,v.gte=Fy,v.has=_m,v.hasIn=Kc,v.head=Nl,v.identity=_r,v.includes=ny,v.indexOf=Z1,v.inRange=Mm,v.invoke=Em,v.isArguments=un,v.isArray=Re,v.isArrayBuffer=My,v.isArrayLike=yr,v.isArrayLikeObject=Rt,v.isBoolean=jy,v.isBuffer=Hi,v.isDate=qy,v.isElement=Hy,v.isEmpty=zy,v.isEqual=By,v.isEqualWith=ky,v.isError=zc,v.isFinite=Ky,v.isFunction=wi,v.isInteger=Vl,v.isLength=Jo,v.isMap=Wl,v.isMatch=Vy,v.isMatchWith=Wy,v.isNaN=Gy,v.isNative=Yy,v.isNil=Qy,v.isNull=Jy,v.isNumber=Gl,v.isObject=wt,v.isObjectLike=Pt,v.isPlainObject=_s,v.isRegExp=Bc,v.isSafeInteger=Xy,v.isSet=Yl,v.isString=Qo,v.isSymbol=xr,v.isTypedArray=qn,v.isUndefined=Zy,v.isWeakMap=em,v.isWeakSet=tm,v.join=nv,v.kebabCase=km,v.last=jr,v.lastIndexOf=sv,v.lowerCase=Km,v.lowerFirst=Vm,v.lt=rm,v.lte=im,v.max=q_,v.maxBy=H_,v.mean=z_,v.meanBy=B_,v.min=k_,v.minBy=K_,v.stubArray=Qc,v.stubFalse=Xc,v.stubObject=A_,v.stubString=T_,v.stubTrue=R_,v.multiply=V_,v.nth=ov,v.noConflict=E_,v.noop=Jc,v.now=Wo,v.pad=Wm,v.padEnd=Gm,v.padStart=Ym,v.parseInt=Jm,v.random=jm,v.reduce=uy,v.reduceRight=hy,v.repeat=Qm,v.replace=Xm,v.result=Pm,v.round=W_,v.runInContext=U,v.sample=fy,v.size=gy,v.snakeCase=Zm,v.some=vy,v.sortedIndex=dv,v.sortedIndexBy=pv,v.sortedIndexOf=gv,v.sortedLastIndex=vv,v.sortedLastIndexBy=yv,v.sortedLastIndexOf=mv,v.startCase=t_,v.startsWith=r_,v.subtract=G_,v.sum=Y_,v.sumBy=J_,v.template=i_,v.times=N_,v.toFinite=Ei,v.toInteger=Me,v.toLength=Ql,v.toLower=n_,v.toNumber=qr,v.toSafeInteger=nm,v.toString=it,v.toUpper=s_,v.trim=o_,v.trimEnd=a_,v.trimStart=c_,v.truncate=u_,v.unescape=h_,v.uniqueId=L_,v.upperCase=l_,v.upperFirst=Vc,v.each=Fl,v.eachRight=Ml,v.first=Nl,Yc(v,function(){var t={};return ii(v,function(n,a){nt.call(v.prototype,a)||(t[a]=n)}),t}(),{chain:!1}),v.VERSION=s,$r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){v[t].placeholder=v}),$r(["drop","take"],function(t,n){Ye.prototype[t]=function(a){a=a===r?1:kt(Me(a),0);var u=this.__filtered__&&!n?new Ye(this):this.clone();return u.__filtered__?u.__takeCount__=Xt(a,u.__takeCount__):u.__views__.push({size:Xt(a,ne),type:t+(u.__dir__<0?"Right":"")}),u},Ye.prototype[t+"Right"]=function(a){return this.reverse()[t](a).reverse()}}),$r(["filter","map","takeWhile"],function(t,n){var a=n+1,u=a==T||a==ce;Ye.prototype[t]=function(d){var y=this.clone();return y.__iteratees__.push({iteratee:_e(d,3),type:a}),y.__filtered__=y.__filtered__||u,y}}),$r(["head","last"],function(t,n){var a="take"+(n?"Right":"");Ye.prototype[t]=function(){return this[a](1).value()[0]}}),$r(["initial","tail"],function(t,n){var a="drop"+(n?"":"Right");Ye.prototype[t]=function(){return this.__filtered__?new Ye(this):this[a](1)}}),Ye.prototype.compact=function(){return this.filter(_r)},Ye.prototype.find=function(t){return this.filter(t).head()},Ye.prototype.findLast=function(t){return this.reverse().find(t)},Ye.prototype.invokeMap=ke(function(t,n){return typeof t=="function"?new Ye(this):this.map(function(a){return ds(a,t,n)})}),Ye.prototype.reject=function(t){return this.filter(Yo(_e(t)))},Ye.prototype.slice=function(t,n){t=Me(t);var a=this;return a.__filtered__&&(t>0||n<0)?new Ye(a):(t<0?a=a.takeRight(-t):t&&(a=a.drop(t)),n!==r&&(n=Me(n),a=n<0?a.dropRight(-n):a.take(n-t)),a)},Ye.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Ye.prototype.toArray=function(){return this.take(ne)},ii(Ye.prototype,function(t,n){var a=/^(?:filter|find|map|reject)|While$/.test(n),u=/^(?:head|last)$/.test(n),d=v[u?"take"+(n=="last"?"Right":""):n],y=u||/^find/.test(n);d&&(v.prototype[n]=function(){var D=this.__wrapped__,O=u?[1]:arguments,M=D instanceof Ye,Q=O[0],X=M||Re(D),te=function(We){var Xe=d.apply(v,$i([We],O));return u&&ue?Xe[0]:Xe};X&&a&&typeof Q=="function"&&Q.length!=1&&(M=X=!1);var ue=this.__chain__,ve=!!this.__actions__.length,we=y&&!ue,He=M&&!ve;if(!y&&X){D=He?D:new Ye(this);var Ee=t.apply(D,O);return Ee.__actions__.push({func:Ko,args:[te],thisArg:r}),new Ur(Ee,ue)}return we&&He?t.apply(this,O):(Ee=this.thru(te),we?u?Ee.value()[0]:Ee.value():Ee)})}),$r(["pop","push","shift","sort","splice","unshift"],function(t){var n=yo[t],a=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",u=/^(?:pop|shift)$/.test(t);v.prototype[t]=function(){var d=arguments;if(u&&!this.__chain__){var y=this.value();return n.apply(Re(y)?y:[],d)}return this[a](function(D){return n.apply(Re(D)?D:[],d)})}}),ii(Ye.prototype,function(t,n){var a=v[n];if(a){var u=a.name+"";nt.call(Ln,u)||(Ln[u]=[]),Ln[u].push({name:n,func:a})}}),Ln[Mo(r,ee).name]=[{name:"wrapper",func:r}],Ye.prototype.clone=h0,Ye.prototype.reverse=l0,Ye.prototype.value=f0,v.prototype.at=Hv,v.prototype.chain=zv,v.prototype.commit=Bv,v.prototype.next=kv,v.prototype.plant=Vv,v.prototype.reverse=Wv,v.prototype.toJSON=v.prototype.valueOf=v.prototype.value=Gv,v.prototype.first=v.prototype.head,os&&(v.prototype[os]=Kv),v},Rn=Bg();Tt?((Tt.exports=Rn)._=Rn,ct._=Rn):Qe._=Rn}).call(Rs)})(Hu,Hu.exports);var y5=Object.defineProperty,m5=Object.defineProperties,_5=Object.getOwnPropertyDescriptors,Jd=Object.getOwnPropertySymbols,b5=Object.prototype.hasOwnProperty,w5=Object.prototype.propertyIsEnumerable,Qd=(i,e,r)=>e in i?y5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,na=(i,e)=>{for(var r in e||(e={}))b5.call(e,r)&&Qd(i,r,e[r]);if(Jd)for(var r of Jd(e))w5.call(e,r)&&Qd(i,r,e[r]);return i},E5=(i,e)=>m5(i,_5(e));function Ki(i,e,r){var s;const o=GE(i);return((s=e.rpcMap)==null?void 0:s[o.reference])||`${v5}?chainId=${o.namespace}:${o.reference}&projectId=${r}`}function wn(i){return i.includes(":")?i.split(":")[1]:i}function vg(i){return i.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function D5(i,e){const r=Object.keys(e.namespaces).filter(o=>o.includes(i));if(!r.length)return[];const s=[];return r.forEach(o=>{const h=e.namespaces[o].accounts;s.push(...h)}),s}function S5(i={},e={}){const r=Xd(i),s=Xd(e);return Hu.exports.merge(r,s)}function Xd(i){var e,r,s,o;const h={};if(!Gn(i))return h;for(const[p,f]of Object.entries(i)){const g=Zu(p)?[p]:f.chains,b=f.methods||[],E=f.events||[],C=f.rpcMap||{},N=Ns(p);h[N]=E5(na(na({},h[N]),f),{chains:ou(g,(e=h[N])==null?void 0:e.chains),methods:ou(b,(r=h[N])==null?void 0:r.methods),events:ou(E,(s=h[N])==null?void 0:s.events),rpcMap:na(na({},C),(o=h[N])==null?void 0:o.rpcMap)})}return h}function I5(i){return i.includes(":")?i.split(":")[2]:i}function x5(i){const e={};for(const[r,s]of Object.entries(i)){const o=s.methods||[],h=s.events||[],p=s.accounts||[],f=Zu(r)?[r]:s.chains?s.chains:vg(s.accounts);e[r]={chains:f,methods:o,events:h,accounts:p}}return e}function _u(i){return typeof i=="number"?i:i.includes("0x")?parseInt(i,16):i.includes(":")?Number(i.split(":")[1]):Number(i)}const yg={},_t=i=>yg[i],bu=(i,e)=>{yg[i]=e};class O5{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ai.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var s;const o=wn(r);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const s=this.createHttpProvider(e,r);s&&(this.httpProviders[e]=s)}createHttpProvider(e,r){const s=r||Ki(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Pi(new Gi(s,_t("disableProviderPing")))}}class C5{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Ai.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const s=r||Ki(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Pi(new Gi(s,_t("disableProviderPing")))}setHttpProvider(e,r){const s=this.createHttpProvider(e,r);s&&(this.httpProviders[e]=s)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var s;const o=parseInt(wn(r));e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,s;let o=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;const h=parseInt(o,16);if(this.isChainApproved(h))this.setDefaultChain(`${h}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:o}]},chainId:(s=this.namespace.chains)==null?void 0:s[0]}),this.setDefaultChain(`${h}`);else throw new Error(`Failed to switch to chain 'eip155:${h}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class P5{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ai.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var s;const o=wn(r);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const s=this.createHttpProvider(e,r);s&&(this.httpProviders[e]=s)}createHttpProvider(e,r){const s=r||Ki(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Pi(new Gi(s,_t("disableProviderPing")))}}class A5{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ai.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var s;const o=wn(r);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const s=this.createHttpProvider(e,r);s&&(this.httpProviders[e]=s)}createHttpProvider(e,r){const s=r||Ki(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Pi(new Gi(s,_t("disableProviderPing")))}}class T5{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ai.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const s=this.getCardanoRPCUrl(r),o=wn(r);e[o]=this.createHttpProvider(o,s)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const s=this.createHttpProvider(e,r);s&&(this.httpProviders[e]=s)}createHttpProvider(e,r){const s=r||this.getCardanoRPCUrl(e);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Pi(new Gi(s,_t("disableProviderPing")))}}class R5{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ai.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var s;const o=wn(r);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const s=this.createHttpProvider(e,r);s&&(this.httpProviders[e]=s)}createHttpProvider(e,r){const s=r||Ki(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Pi(new Gi(s,_t("disableProviderPing")))}}class N5{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Ai.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var s;const o=wn(r);e[o]=this.createHttpProvider(o,(s=this.namespace.rpcMap)==null?void 0:s[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const s=this.createHttpProvider(e,r);s&&(this.httpProviders[e]=s)}createHttpProvider(e,r){const s=r||Ki(e,this.namespace,this.client.core.projectId);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);return new Pi(new Gi(s,_t("disableProviderPing")))}}class $5{constructor(e){this.name="near",this.namespace=e.namespace,this.events=_t("events"),this.client=_t("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const s=r||Ki(`${this.name}:${e}`,this.namespace);if(!s)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,s)}this.events.emit(Ai.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var s;e[r]=this.createHttpProvider(r,(s=this.namespace.rpcMap)==null?void 0:s[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const s=this.createHttpProvider(e,r);s&&(this.httpProviders[e]=s)}createHttpProvider(e,r){const s=r||Ki(e,this.namespace);return typeof s>"u"?void 0:new Pi(new Gi(s,_t("disableProviderPing")))}}var L5=Object.defineProperty,U5=Object.defineProperties,F5=Object.getOwnPropertyDescriptors,Zd=Object.getOwnPropertySymbols,M5=Object.prototype.hasOwnProperty,j5=Object.prototype.propertyIsEnumerable,ep=(i,e,r)=>e in i?L5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,sa=(i,e)=>{for(var r in e||(e={}))M5.call(e,r)&&ep(i,r,e[r]);if(Zd)for(var r of Zd(e))j5.call(e,r)&&ep(i,r,e[r]);return i},wu=(i,e)=>U5(i,F5(e));class hh{constructor(e){this.events=new Bu,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Ze.pino(Ze.getDefaultLoggerOptions({level:(e==null?void 0:e.logger)||Gd})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new hh(e);return await r.initialize(),r}async request(e,r){const[s,o]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(s).request({request:sa({},e),chainId:`${s}:${o}`,topic:this.session.topic})}sendAsync(e,r,s){this.request(e,s).then(o=>r(null,o)).catch(o=>r(o,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:$t("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:s,approval:o}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});s&&(this.uri=s,this.events.emit("display_uri",s)),await o().then(h=>{this.session=h,this.namespaces||(this.namespaces=x5(h.namespaces),this.persist("namespaces",this.namespaces))}).catch(h=>{if(h.message!==pg)throw h;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[s,o]=this.validateChain(e);this.getProvider(s).setDefaultChain(o,r)}catch(s){if(!/Please call connect/.test(s.message))throw s}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(li(r)){for(const s of r)e.deletePairings?this.client.core.expirer.set(s.topic,0):await this.client.core.relayer.subscriber.unsubscribe(s.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await h5.init({logger:this.providerOpts.logger||Gd,relayUrl:this.providerOpts.relayUrl||d5,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>Ns(r)))];bu("client",this.client),bu("events",this.events),bu("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const s=D5(r,this.session),o=vg(s),h=S5(this.namespaces,this.optionalNamespaces),p=wu(sa({},h[r]),{accounts:s,chains:o});switch(r){case"eip155":this.rpcProviders[r]=new C5({namespace:p});break;case"solana":this.rpcProviders[r]=new P5({namespace:p});break;case"cosmos":this.rpcProviders[r]=new A5({namespace:p});break;case"polkadot":this.rpcProviders[r]=new O5({namespace:p});break;case"cip34":this.rpcProviders[r]=new T5({namespace:p});break;case"elrond":this.rpcProviders[r]=new R5({namespace:p});break;case"multiversx":this.rpcProviders[r]=new N5({namespace:p});break;case"near":this.rpcProviders[r]=new $5({namespace:p});break}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:s}=r;if(s.name==="accountsChanged"){const o=s.data;o&&li(o)&&this.events.emit("accountsChanged",o.map(I5))}else if(s.name==="chainChanged"){const o=r.chainId,h=r.event.data,p=Ns(o),f=_u(o)!==_u(h)?`${p}:${_u(h)}`:o;this.onChainChanged(f)}else this.events.emit(s.name,s.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var s;const{namespaces:o}=r,h=(s=this.client)==null?void 0:s.session.get(e);this.session=wu(sa({},h),{namespaces:o}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",wu(sa({},$t("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Ai.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:s,sessionProperties:o}=e;r&&Object.keys(r).length&&(this.namespaces=r),s&&Object.keys(s).length&&(this.optionalNamespaces=s),this.sessionProperties=o,this.persist("namespaces",r),this.persist("optionalNamespaces",s)}validateChain(e){const[r,s]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,s];if(r&&!Object.keys(this.namespaces||{}).map(p=>Ns(p)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&s)return[r,s];const o=Ns(Object.keys(this.namespaces)[0]),h=this.rpcProviders[o].getDefaultChain();return[o,h]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){var s;if(!this.namespaces)return;const[o,h]=this.validateChain(e);r||this.getProvider(o).setDefaultChain(h),((s=this.namespaces[o])!=null?s:this.namespaces[`${o}:${h}`]).defaultChain=h,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",h)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${Yd}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${Yd}/${e}`)}}const q5=hh,H5="wc",z5="ethereum_provider",B5=`${H5}@2:${z5}:`,k5="https://rpc.walletconnect.com/v1/",pa=["eth_sendTransaction","personal_sign"],mg=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode"],ga=["chainChanged","accountsChanged"],_g=["chainChanged","accountsChanged","message","disconnect","connect"];var K5=Object.defineProperty,V5=Object.defineProperties,W5=Object.getOwnPropertyDescriptors,tp=Object.getOwnPropertySymbols,G5=Object.prototype.hasOwnProperty,Y5=Object.prototype.propertyIsEnumerable,rp=(i,e,r)=>e in i?K5(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r,Ls=(i,e)=>{for(var r in e||(e={}))G5.call(e,r)&&rp(i,r,e[r]);if(tp)for(var r of tp(e))Y5.call(e,r)&&rp(i,r,e[r]);return i},ip=(i,e)=>V5(i,W5(e));function va(i){return Number(i[0].split(":")[1])}function Eu(i){return`0x${i.toString(16)}`}function J5(i){const{chains:e,optionalChains:r,methods:s,optionalMethods:o,events:h,optionalEvents:p,rpcMap:f}=i;if(!li(e))throw new Error("Invalid chains");const g={chains:e,methods:s||pa,events:h||ga,rpcMap:Ls({},e.length?{[va(e)]:f[va(e)]}:{})},b=h==null?void 0:h.filter(P=>!ga.includes(P)),E=s==null?void 0:s.filter(P=>!pa.includes(P));if(!r&&!p&&!o&&!(b!=null&&b.length)&&!(E!=null&&E.length))return{required:e.length?g:void 0};const C=(b==null?void 0:b.length)&&(E==null?void 0:E.length)||!r,N={chains:[...new Set(C?g.chains.concat(r||[]):r)],methods:[...new Set(g.methods.concat(o!=null&&o.length?o:mg))],events:[...new Set(g.events.concat(p!=null&&p.length?p:_g))],rpcMap:f};return{required:e.length?g:void 0,optional:r.length?N:void 0}}class Ca{constructor(){this.events=new zr.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=B5,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Ca;return await r.initialize(e),r}async request(e){return await this.signer.request(e,this.formatChainId(this.chainId))}sendAsync(e,r){this.signer.sendAsync(e,r,this.formatChainId(this.chainId))}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:s}=J5(this.rpc);try{const o=await new Promise(async(p,f)=>{var g;this.rpc.showQrModal&&((g=this.modal)==null||g.subscribeModal(b=>{!b.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(ip(Ls({namespaces:Ls({},r&&{[this.namespace]:r})},s&&{optionalNamespaces:{[this.namespace]:s}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(b=>{p(b)}).catch(b=>{f(new Error(b.message))})});if(!o)return;const h=YE(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:h),this.setAccounts(h),this.events.emit("connect",{chainId:Eu(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:s}=r;s.name==="accountsChanged"?(this.accounts=this.parseAccounts(s.data),this.events.emit("accountsChanged",this.accounts)):s.name==="chainChanged"?this.setChainId(this.formatChainId(s.data)):this.events.emit(s.name,s.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Eu(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",ip(Ls({},$t("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,s;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(s=this.modal)==null||s.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(s=>this.isCompatibleChainId(s)).map(s=>this.parseChainId(s));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Eu(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,s,o]=e.split(":");return{chainId:`${r}:${s}`,address:o}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,s;const o=(r=e==null?void 0:e.chains)!=null?r:[],h=(s=e==null?void 0:e.optionalChains)!=null?s:[],p=o.concat(h);if(!p.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const f=o.length?(e==null?void 0:e.methods)||pa:[],g=o.length?(e==null?void 0:e.events)||ga:[],b=(e==null?void 0:e.optionalMethods)||[],E=(e==null?void 0:e.optionalEvents)||[],C=(e==null?void 0:e.rpcMap)||this.buildRpcMap(p,e.projectId),N=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:o==null?void 0:o.map(P=>this.formatChainId(P)),optionalChains:h.map(P=>this.formatChainId(P)),methods:f,events:g,optionalMethods:b,optionalEvents:E,rpcMap:C,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:N,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const s={};return e.forEach(o=>{s[o]=this.getRpcUrl(o,r)}),s}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?va(this.rpc.chains):va(this.rpc.optionalChains),this.signer=await q5.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{r=Ib.WalletConnectModal}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Ls({walletConnectVersion:2,projectId:this.rpc.projectId,standaloneChains:this.rpc.chains},this.rpc.qrModalOptions))}catch(s){throw this.signer.logger.error(s),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:s,rpcMap:o}=e;r&&li(r)&&(this.rpc.chains=r.map(h=>this.formatChainId(h)),r.forEach(h=>{this.rpc.rpcMap[h]=(o==null?void 0:o[h])||this.getRpcUrl(h)})),s&&li(s)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=s==null?void 0:s.map(h=>this.formatChainId(h)),s.forEach(h=>{this.rpc.rpcMap[h]=(o==null?void 0:o[h])||this.getRpcUrl(h)}))}getRpcUrl(e,r){var s;return((s=this.rpc.rpcMap)==null?void 0:s[e])||`${k5}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(!this.session)return;const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const Q5=Ca,dI=Object.freeze(Object.defineProperty({__proto__:null,EthereumProvider:Q5,OPTIONAL_EVENTS:_g,OPTIONAL_METHODS:mg,REQUIRED_EVENTS:ga,REQUIRED_METHODS:pa,default:Ca},Symbol.toStringTag,{value:"Module"}));export{ub as R,np as T,rr as a,dI as i,wf as n,tI as o,Zr as p,eu as s,eI as t,Jn as y};
|
|
34
|
-
//# sourceMappingURL=index.es-
|
|
34
|
+
//# sourceMappingURL=index.es-5d9b029f.js.map
|