@wormhole-foundation/wormhole-connect 2.0.0-beta.0-development → 2.0.0-beta.1-development
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/dist/main.js +69 -69
- package/dist/src/config/utils.d.ts.map +1 -1
- package/dist/src/views/v2/Bridge/AssetPicker/ChainList.d.ts.map +1 -1
- package/lib/{aptos-Ck1Sf3c1.js → aptos-C698CxDU.js} +2 -2
- package/lib/{aptos-CAZnfR2B.js → aptos-DBP3jmW7.js} +1 -1
- package/lib/{aptos-VlcdOXIs.mjs → aptos-ZmgQfu2i.mjs} +2 -2
- package/lib/{aptos-G95l4D5Y.mjs → aptos-szFJdwGu.mjs} +4 -4
- package/lib/{base64-DScLQWIJ.js → base64-BFA_udDL.js} +1 -1
- package/lib/{base64-SRM73VOK.mjs → base64-DJKqMaey.mjs} +1 -1
- package/lib/{ccip-CwCUSl64.js → ccip-DA2Nx1SC.js} +1 -1
- package/lib/{ccip-ZQo50dYX.mjs → ccip-urjf2Ohy.mjs} +1 -1
- package/lib/{chunk-OR6GFWLG-qW5dukvV.mjs → chunk-OR6GFWLG-BxTMqzEc.mjs} +3 -3
- package/lib/{chunk-OR6GFWLG-oZZxBIBy.js → chunk-OR6GFWLG-DMRHoX5e.js} +1 -1
- package/lib/{events-uBYsqfrl.js → events-CeUTM3JY.js} +1 -1
- package/lib/{events-Dgn4K9rN.mjs → events-VkSlTRL0.mjs} +1 -1
- package/lib/{evm-BM1jPLwl.mjs → evm-CVR26OSW.mjs} +5 -5
- package/lib/{evm-CgSzbeCb.js → evm-DR1h6onf.js} +3 -3
- package/lib/{evm-D5LTDUcP.mjs → evm-DSWmFw3D.mjs} +5 -5
- package/lib/{evm-Cocl1Qx2.js → evm-rBfvNQnC.js} +1 -1
- package/lib/{index-B6JrPvDW.mjs → index-2Hoo-RF7.mjs} +1 -1
- package/lib/{index-BCi7GitD.mjs → index-42eVh0Hb.mjs} +2 -2
- package/lib/{index-D8yrwfK5.mjs → index-B54uaK5S.mjs} +3 -3
- package/lib/{index-SzAoRhpC.js → index-B6Cq1iZ2.js} +1 -1
- package/lib/{index-C_045fAm.js → index-BD-n4Jda.js} +1 -1
- package/lib/{index-tT8fg8Q5.mjs → index-BGMRuYE4.mjs} +1 -1
- package/lib/{index-DXcVEr2U.mjs → index-BN7FfORx.mjs} +18 -19
- package/lib/{index-DBJPUF0X.js → index-BVdejQdc.js} +1 -1
- package/lib/{index-DaLPPso5.mjs → index-BXHKeAv4.mjs} +2 -2
- package/lib/{index-aw5kQCwX.mjs → index-BZWHrS5h.mjs} +2 -2
- package/lib/{index-CCDkkZN6.js → index-Bb6FMstR.js} +1 -1
- package/lib/{index-CusHYtsc.mjs → index-BdgBgC9M.mjs} +2 -2
- package/lib/{index-DgaACuCq.js → index-Bh_VUH6w.js} +3 -3
- package/lib/{index-CXFBf2VR.mjs → index-C23ZcDqk.mjs} +2 -2
- package/lib/{index-a-G25ciF.js → index-C92Lbp7R.js} +1 -1
- package/lib/{index-DPacNsBv.mjs → index-CCwF2yAJ.mjs} +5 -5
- package/lib/{index-3VUjPBnj.js → index-CMS03ogd.js} +1 -1
- package/lib/{index-Cu6RQt8e.js → index-COMVJ9EC.js} +1 -1
- package/lib/{index-i8-I-Kx6.mjs → index-CP1YtvQl.mjs} +2 -2
- package/lib/{index-CoDv0EFX.mjs → index-CUD_KSHh.mjs} +4 -4
- package/lib/{index-C9mu4l7o.mjs → index-Ccg2yYsG.mjs} +2 -2
- package/lib/{index-DZz_hUYe.mjs → index-Cm2DqtOc.mjs} +2 -2
- package/lib/{index-DuM5_evN.mjs → index-Coap6PLP.mjs} +1 -1
- package/lib/{index-CffsvCdp.js → index-CtzDS4Ek.js} +1 -1
- package/lib/{index-DY59SYJT.mjs → index-D2ZFuAXe.mjs} +1 -1
- package/lib/{index-DRZXoRVn.mjs → index-DGzYkbea.mjs} +1 -1
- package/lib/{index-BgSe6vZM.js → index-DVxKNFdQ.js} +1 -1
- package/lib/{index-xZ5vsuO7.js → index-DaebrvyB.js} +1 -1
- package/lib/{index-DU3Jxks1.js → index-DbFTlikk.js} +1 -1
- package/lib/{index-BpHM17iv.js → index-DdleqS-C.js} +1 -1
- package/lib/{index-CZ8GDYHq.js → index-Ds36ZJFd.js} +1 -1
- package/lib/{index-C9_Xqcp_.mjs → index-Fsd-hYv7.mjs} +2 -2
- package/lib/{index-CjYsC-nW.js → index-Gq0crvhx.js} +1 -1
- package/lib/{index-BWgeRtvV.mjs → index-KKiy1Hrx.mjs} +1 -1
- package/lib/{index-BERVkvac.js → index-fTMcBh-E.js} +1 -1
- package/lib/{index-BLwbqj4f.js → index-pf1Hd87D.js} +1 -1
- package/lib/{index-TdVwI_k_.js → index-sGgOiMAb.js} +1 -1
- package/lib/{index-JaS46BVB.js → index-y6JzKy7h.js} +1 -1
- package/lib/{index.es-c-VQ7iU7.js → index.es-Bb3szEaY.js} +2 -2
- package/lib/{index.es-CfDkO3SA.mjs → index.es-BwVfbE63.mjs} +6 -6
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{signer-Uy7DwUiY.js → signer-BYquDVs4.js} +1 -1
- package/lib/{signer-CsSNNgXY.mjs → signer-DOhyF9G-.mjs} +1 -1
- package/lib/{solana-Doh_jgqw.mjs → solana-B0yxLYge.mjs} +5 -5
- package/lib/{solana-D8Z8oyUb.mjs → solana-C7zGAW8V.mjs} +4 -4
- package/lib/{solana-CnbQnU0Q.js → solana-cxRzZXbi.js} +1 -1
- package/lib/solana-i-1aVGyQ.js +1 -0
- package/lib/{solanaEmbed.esm-BMN20IzZ.js → solanaEmbed.esm-Bw4WVPNb.js} +1 -1
- package/lib/{solanaEmbed.esm-CnTsBpfN.mjs → solanaEmbed.esm-DYuDmeOj.mjs} +2 -2
- package/lib/src/config/utils.d.ts.map +1 -1
- package/lib/src/views/v2/Bridge/AssetPicker/ChainList.d.ts.map +1 -1
- package/lib/{sui-Dl3Uvu88.mjs → sui--QzlscdW.mjs} +5 -5
- package/lib/{sui-0upbYB1a.mjs → sui-BAj9wCLR.mjs} +1 -1
- package/lib/{sui-a-MPtxai.js → sui-D2Lx7sNr.js} +1 -1
- package/lib/{sui-CkzAXofi.js → sui-DFYvs2lh.js} +2 -2
- package/lib/{utf8-PS_55WKJ.js → utf8-C9mhtl0f.js} +1 -1
- package/lib/{utf8-YN1IXfNg.mjs → utf8-D8MD86af.mjs} +1 -1
- package/package.json +1 -1
- package/lib/solana-M-G4laS9.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { cC as Dc, X as x, cn as oo, aB as Fc, Y as ao, c3 as C, ad as Lc, ah as qc } from "./index-
|
|
1
|
+
import { cC as Dc, X as x, cn as oo, aB as Fc, Y as ao, c3 as C, ad as Lc, ah as qc } from "./index-BN7FfORx.mjs";
|
|
2
2
|
import { d as Uc } from "./dijkstra-BZM-8g-B.mjs";
|
|
3
|
-
import { e as Ae, s as co } from "./events-
|
|
4
|
-
import { c as E, b as Oe, s as $r, x as lo, r as Mr, H as Bc, a as uo } from "./index-
|
|
5
|
-
import { r as zc, a as ot, g as at, i as be, b as kr, I as ht, f as pe, t as ne, c as ei, z as _i, d as Kc, C as jc, e as In, h as Vc, j as Wc, k as Li, p as Hc, _ as Jc, E as te, y as ce, l as qi, A as Gc, m as Yc, n as xn, o as Qc, s as Xc, T as ho, q as Ui, u as Bi, v as $e, w as et } from "./index-
|
|
6
|
-
import { t as ti, k as fo, c as Zc, s as po, a as fe, b as go, L as el, d as Dt, m as tl, e as ri, g as rl, j as Pn } from "./utf8-
|
|
3
|
+
import { e as Ae, s as co } from "./events-VkSlTRL0.mjs";
|
|
4
|
+
import { c as E, b as Oe, s as $r, x as lo, r as Mr, H as Bc, a as uo } from "./index-D2ZFuAXe.mjs";
|
|
5
|
+
import { r as zc, a as ot, g as at, i as be, b as kr, I as ht, f as pe, t as ne, c as ei, z as _i, d as Kc, C as jc, e as In, h as Vc, j as Wc, k as Li, p as Hc, _ as Jc, E as te, y as ce, l as qi, A as Gc, m as Yc, n as xn, o as Qc, s as Xc, T as ho, q as Ui, u as Bi, v as $e, w as et } from "./index-CP1YtvQl.mjs";
|
|
6
|
+
import { t as ti, k as fo, c as Zc, s as po, a as fe, b as go, L as el, d as Dt, m as tl, e as ri, g as rl, j as Pn } from "./utf8-D8MD86af.mjs";
|
|
7
7
|
const il = `Ethereum Signed Message:
|
|
8
8
|
`;
|
|
9
9
|
function mo(r) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const pe=Symbol(),te=Object.getPrototypeOf,F=new WeakMap,me=e=>e&&(F.has(e)?F.get(e):te(e)===Object.prototype||te(e)===Array.prototype),ge=e=>me(e)&&e[pe]||null,se=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,A=new WeakMap,B=new WeakSet,he=(e=Object.is,t=(n,h)=>new Proxy(n,h),s=n=>J(n)&&!B.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),o=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,h,L=o)=>{const y=l.get(n);if((y==null?void 0:y[0])===h)return y[1];const I=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return se(I,!0),l.set(n,[h,I]),Reflect.ownKeys(n).forEach(k=>{if(Object.getOwnPropertyDescriptor(I,k))return;const v=Reflect.get(n,k),M={value:v,enumerable:!0,configurable:!0};if(B.has(v))se(v,!1);else if(v instanceof Promise)delete M.value,M.get=()=>L(v);else if(A.has(v)){const[w,H]=A.get(v);M.value=c(w,H(),L)}Object.defineProperty(I,k,M)}),Object.preventExtensions(I)},m=new WeakMap,p=[1,1],E=n=>{if(!J(n))throw new Error("object required");const h=m.get(n);if(h)return h;let L=p[0];const y=new Set,I=(i,a=++p[0])=>{L!==a&&(L=a,y.forEach(r=>r(i,a)))};let k=p[1];const v=(i=++p[1])=>(k!==i&&!y.size&&(k=i,w.forEach(([a])=>{const r=a[1](i);r>L&&(L=r)})),L),M=i=>(a,r)=>{const g=[...a];g[1]=[i,...g[1]],I(g,r)},w=new Map,H=(i,a)=>{if(y.size){const r=a[3](M(i));w.set(i,[a,r])}else w.set(i,[a])},ee=i=>{var a;const r=w.get(i);r&&(w.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(y.add(i),y.size===1&&w.forEach(([r,g],N)=>{const R=r[3](M(N));w.set(N,[r,R])}),()=>{y.delete(i),y.size===0&&w.forEach(([r,g],N)=>{g&&(g(),w.set(N,[r]))})}),q=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);ee(a);const g=Reflect.deleteProperty(i,a);return g&&I(["delete",[a],r]),g},set(i,a,r,g){const N=Reflect.has(i,a),R=Reflect.get(i,a,g);if(N&&(e(R,r)||m.has(r)&&e(R,m.get(r))))return!0;ee(a),J(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(C=>{r.status="fulfilled",r.value=C,I(["resolve",[a],C])}).catch(C=>{r.status="rejected",r.reason=C,I(["reject",[a],C])});else{!A.has(r)&&s(r)&&(V=E(r));const C=!B.has(V)&&A.get(V);C&&H(a,C)}return Reflect.set(i,a,V,g),I(["set",[a],r,R]),!0}});m.set(n,$);const fe=[q,v,c,ue];return A.set($,fe),Reflect.ownKeys(n).forEach(i=>{const a=Object.getOwnPropertyDescriptor(n,i);"value"in a&&($[i]=n[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),$})=>[E,A,B,e,t,s,o,l,c,m,p],[be]=he();function j(e={}){return be(e)}function P(e,t,s){const o=A.get(e);let l;const c=[],m=o[3];let p=!1;const n=m(h=>{c.push(h),l||(l=Promise.resolve().then(()=>{l=void 0,p&&t(c.splice(0))}))});return p=!0,()=>{p=!1,n()}}function ye(e,t){const s=A.get(e),[o,l,c]=s;return c(o,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Z={state:d,subscribe(e){return P(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},u={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 u.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return u.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(u.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const l=encodeURIComponent(t);return`${o}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!u.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const l=encodeURIComponent(t);return`${o}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(u.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(u.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=Z.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),f=j({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),de={state:f,subscribe(e){return P(f.events,()=>e(ye(f.events[f.events.length-1])))},initialize(){f.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(f.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){f.connectedWalletId=e},click(e){if(f.enabled){const t={type:"CLICK",name:e.name,userSessionId:f.userSessionId,timestamp:Date.now(),data:e};f.events.push(t)}},track(e){if(f.enabled){const t={type:"TRACK",name:e.name,userSessionId:f.userSessionId,timestamp:Date.now(),data:e};f.events.push(t)}},view(e){if(f.enabled){const t={type:"VIEW",name:e.name,userSessionId:f.userSessionId,timestamp:Date.now(),data:e};f.events.push(t)}}},W=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:W,subscribe(e){return P(W,()=>e(W))},setChains(e){W.chains=e},setWalletConnectUri(e){W.walletConnectUri=e},setIsCustomDesktop(e){W.isCustomDesktop=e},setIsCustomMobile(e){W.isCustomMobile=e},setIsDataLoaded(e){W.isDataLoaded=e},setIsUiLoaded(e){W.isUiLoaded=e},setIsAuth(e){W.isAuth=e}},K=j({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}),D={state:K,subscribe(e){return P(K,()=>e(K))},setConfig(e){var t,s;de.initialize(),b.setChains(e.chains),b.setIsAuth(!!e.enableAuthMode),b.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),b.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),u.setModalVersionInStorage(),Object.assign(K,e)}};var we=Object.defineProperty,ne=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Oe=(e,t)=>{for(var s in t||(t={}))Le.call(t,s)&&re(e,s,t[s]);if(ne)for(var s of ne(t))We.call(t,s)&&re(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.6.2";async function x(e,t){const s=Oe({sdkType:Q,sdkVersion:X},t),o=new URL(e,G);return o.searchParams.append("projectId",D.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&o.searchParams.append(l,String(c))}),(await fetch(o)).json()}const U={async getDesktopListings(e){return x("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return x("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return x("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return x("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${D.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${D.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var ve=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,ae=(e,t,s)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ae(e,s,t[s]);if(oe)for(var s of oe(t))Ce.call(t,s)&&ae(e,s,t[s]);return e};const ie=u.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),je={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=D.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(u.isArray(e)){const s={recommendedIds:e.join(",")},{listings:o}=await U.getAllListings(s),l=Object.values(o);l.sort((c,m)=>{const p=e.indexOf(c.id),E=e.indexOf(m.id);return p-E}),O.recomendedWallets=l}else{const{chains:s,isAuth:o}=b.state,l=s==null?void 0:s.join(","),c=u.isArray(t),m={page:1,sdks:o?"auth_v1":void 0,entries:u.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:p}=ie?await U.getMobileListings(m):await U.getDesktopListings(m);O.recomendedWallets=Object.values(p)}return O.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=D.state,{recomendedWallets:l}=O;if(o==="ALL")return O.wallets;l.length?t.excludedIds=l.map(L=>L.id).join(","):u.isArray(s)&&(t.excludedIds=s.join(",")),u.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:p,total:E}=ie?await U.getMobileListings(t):await U.getDesktopListings(t),n=Object.values(p),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...n],total:E,page:c??1},{listings:n,total:E}},getWalletImageUrl(e){return U.getWalletImageUrl(e)},getAssetImageUrl(e){return U.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},T=j({open:!1}),z={state:T,subscribe(e){return P(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:o}=b.state;if(u.removeWalletConnectDeepLink(),b.setWalletConnectUri(e==null?void 0:e.uri),b.setChains(e==null?void 0:e.chains),Z.reset("ConnectWallet"),s&&o)T.open=!0,t();else{const l=setInterval(()=>{const c=b.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,le=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,ce=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Ue.call(t,s)&&ce(e,s,t[s]);if(le)for(var s of le(t))Se.call(t,s)&&ce(e,s,t[s]);return e};function Pe(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const _=j({themeMode:Pe()?"dark":"light"}),Y={state:_,subscribe(e){return P(_,()=>e(_))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(_.themeMode=t),s&&(_.themeVariables=De({},s))}},S=j({open:!1,message:"",variant:"success"}),ke={state:S,subscribe(e){return P(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Ne{constructor(t){this.openModal=z.open,this.closeModal=z.close,this.subscribeModal=z.subscribe,this.setTheme=Y.setThemeConfig,Y.setThemeConfig(t),D.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(()=>require("./index-BpHM17iv.js"));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),b.setIsUiLoaded(!0)}}}const Te=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ne},Symbol.toStringTag,{value:"Module"}));exports.R=de;exports.T=Z;exports.a=u;exports.index=Te;exports.ne=Y;exports.oe=ke;exports.p=b;exports.se=z;exports.te=je;exports.y=D;
|
|
1
|
+
"use strict";const pe=Symbol(),te=Object.getPrototypeOf,F=new WeakMap,me=e=>e&&(F.has(e)?F.get(e):te(e)===Object.prototype||te(e)===Array.prototype),ge=e=>me(e)&&e[pe]||null,se=(e,t=!0)=>{F.set(e,t)},J=e=>typeof e=="object"&&e!==null,A=new WeakMap,B=new WeakSet,he=(e=Object.is,t=(n,h)=>new Proxy(n,h),s=n=>J(n)&&!B.has(n)&&(Array.isArray(n)||!(Symbol.iterator in n))&&!(n instanceof WeakMap)&&!(n instanceof WeakSet)&&!(n instanceof Error)&&!(n instanceof Number)&&!(n instanceof Date)&&!(n instanceof String)&&!(n instanceof RegExp)&&!(n instanceof ArrayBuffer),o=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,h,L=o)=>{const y=l.get(n);if((y==null?void 0:y[0])===h)return y[1];const I=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return se(I,!0),l.set(n,[h,I]),Reflect.ownKeys(n).forEach(k=>{if(Object.getOwnPropertyDescriptor(I,k))return;const v=Reflect.get(n,k),M={value:v,enumerable:!0,configurable:!0};if(B.has(v))se(v,!1);else if(v instanceof Promise)delete M.value,M.get=()=>L(v);else if(A.has(v)){const[w,H]=A.get(v);M.value=c(w,H(),L)}Object.defineProperty(I,k,M)}),Object.preventExtensions(I)},m=new WeakMap,p=[1,1],E=n=>{if(!J(n))throw new Error("object required");const h=m.get(n);if(h)return h;let L=p[0];const y=new Set,I=(i,a=++p[0])=>{L!==a&&(L=a,y.forEach(r=>r(i,a)))};let k=p[1];const v=(i=++p[1])=>(k!==i&&!y.size&&(k=i,w.forEach(([a])=>{const r=a[1](i);r>L&&(L=r)})),L),M=i=>(a,r)=>{const g=[...a];g[1]=[i,...g[1]],I(g,r)},w=new Map,H=(i,a)=>{if(y.size){const r=a[3](M(i));w.set(i,[a,r])}else w.set(i,[a])},ee=i=>{var a;const r=w.get(i);r&&(w.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(y.add(i),y.size===1&&w.forEach(([r,g],N)=>{const R=r[3](M(N));w.set(N,[r,R])}),()=>{y.delete(i),y.size===0&&w.forEach(([r,g],N)=>{g&&(g(),w.set(N,[r]))})}),q=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);ee(a);const g=Reflect.deleteProperty(i,a);return g&&I(["delete",[a],r]),g},set(i,a,r,g){const N=Reflect.has(i,a),R=Reflect.get(i,a,g);if(N&&(e(R,r)||m.has(r)&&e(R,m.get(r))))return!0;ee(a),J(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(C=>{r.status="fulfilled",r.value=C,I(["resolve",[a],C])}).catch(C=>{r.status="rejected",r.reason=C,I(["reject",[a],C])});else{!A.has(r)&&s(r)&&(V=E(r));const C=!B.has(V)&&A.get(V);C&&H(a,C)}return Reflect.set(i,a,V,g),I(["set",[a],r,R]),!0}});m.set(n,$);const fe=[q,v,c,ue];return A.set($,fe),Reflect.ownKeys(n).forEach(i=>{const a=Object.getOwnPropertyDescriptor(n,i);"value"in a&&($[i]=n[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),$})=>[E,A,B,e,t,s,o,l,c,m,p],[be]=he();function j(e={}){return be(e)}function P(e,t,s){const o=A.get(e);let l;const c=[],m=o[3];let p=!1;const n=m(h=>{c.push(h),l||(l=Promise.resolve().then(()=>{l=void 0,p&&t(c.splice(0))}))});return p=!0,()=>{p=!1,n()}}function ye(e,t){const s=A.get(e),[o,l,c]=s;return c(o,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),Z={state:d,subscribe(e){return P(d,()=>e(d))},push(e,t){e!==d.view&&(d.view=e,t&&(d.data=t),d.history.push(e))},reset(e){d.view=e,d.history=[e]},replace(e){d.history.length>1&&(d.history[d.history.length-1]=e,d.view=e)},goBack(){if(d.history.length>1){d.history.pop();const[e]=d.history.slice(-1);d.view=e}},setData(e){d.data=e}},u={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 u.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return u.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},formatNativeUrl(e,t,s){if(u.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let o=e;o.includes("://")||(o=e.replaceAll("/","").replaceAll(":",""),o=`${o}://`),o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const l=encodeURIComponent(t);return`${o}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!u.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let o=e;o.endsWith("/")||(o=`${o}/`),this.setWalletConnectDeepLink(o,s);const l=encodeURIComponent(t);return`${o}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(u.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(u.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(u.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=Z.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},Ie=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),f=j({enabled:Ie,userSessionId:"",events:[],connectedWalletId:void 0}),de={state:f,subscribe(e){return P(f.events,()=>e(ye(f.events[f.events.length-1])))},initialize(){f.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(f.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){f.connectedWalletId=e},click(e){if(f.enabled){const t={type:"CLICK",name:e.name,userSessionId:f.userSessionId,timestamp:Date.now(),data:e};f.events.push(t)}},track(e){if(f.enabled){const t={type:"TRACK",name:e.name,userSessionId:f.userSessionId,timestamp:Date.now(),data:e};f.events.push(t)}},view(e){if(f.enabled){const t={type:"VIEW",name:e.name,userSessionId:f.userSessionId,timestamp:Date.now(),data:e};f.events.push(t)}}},W=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),b={state:W,subscribe(e){return P(W,()=>e(W))},setChains(e){W.chains=e},setWalletConnectUri(e){W.walletConnectUri=e},setIsCustomDesktop(e){W.isCustomDesktop=e},setIsCustomMobile(e){W.isCustomMobile=e},setIsDataLoaded(e){W.isDataLoaded=e},setIsUiLoaded(e){W.isUiLoaded=e},setIsAuth(e){W.isAuth=e}},K=j({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}),D={state:K,subscribe(e){return P(K,()=>e(K))},setConfig(e){var t,s;de.initialize(),b.setChains(e.chains),b.setIsAuth(!!e.enableAuthMode),b.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),b.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),u.setModalVersionInStorage(),Object.assign(K,e)}};var we=Object.defineProperty,ne=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Oe=(e,t)=>{for(var s in t||(t={}))Le.call(t,s)&&re(e,s,t[s]);if(ne)for(var s of ne(t))We.call(t,s)&&re(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.6.2";async function x(e,t){const s=Oe({sdkType:Q,sdkVersion:X},t),o=new URL(e,G);return o.searchParams.append("projectId",D.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&o.searchParams.append(l,String(c))}),(await fetch(o)).json()}const U={async getDesktopListings(e){return x("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return x("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return x("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return x("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${D.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${D.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var ve=Object.defineProperty,oe=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,ae=(e,t,s)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ae(e,s,t[s]);if(oe)for(var s of oe(t))Ce.call(t,s)&&ae(e,s,t[s]);return e};const ie=u.isMobile(),O=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),je={state:O,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=D.state;if(e==="NONE"||t==="ALL"&&!e)return O.recomendedWallets;if(u.isArray(e)){const s={recommendedIds:e.join(",")},{listings:o}=await U.getAllListings(s),l=Object.values(o);l.sort((c,m)=>{const p=e.indexOf(c.id),E=e.indexOf(m.id);return p-E}),O.recomendedWallets=l}else{const{chains:s,isAuth:o}=b.state,l=s==null?void 0:s.join(","),c=u.isArray(t),m={page:1,sdks:o?"auth_v1":void 0,entries:u.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:p}=ie?await U.getMobileListings(m):await U.getDesktopListings(m);O.recomendedWallets=Object.values(p)}return O.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:o}=D.state,{recomendedWallets:l}=O;if(o==="ALL")return O.wallets;l.length?t.excludedIds=l.map(L=>L.id).join(","):u.isArray(s)&&(t.excludedIds=s.join(",")),u.isArray(o)&&(t.excludedIds=[t.excludedIds,o].filter(Boolean).join(",")),b.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:p,total:E}=ie?await U.getMobileListings(t):await U.getDesktopListings(t),n=Object.values(p),h=m?"search":"wallets";return O[h]={listings:[...O[h].listings,...n],total:E,page:c??1},{listings:n,total:E}},getWalletImageUrl(e){return U.getWalletImageUrl(e)},getAssetImageUrl(e){return U.getAssetImageUrl(e)},resetSearch(){O.search={listings:[],total:0,page:1}}},T=j({open:!1}),z={state:T,subscribe(e){return P(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:o}=b.state;if(u.removeWalletConnectDeepLink(),b.setWalletConnectUri(e==null?void 0:e.uri),b.setChains(e==null?void 0:e.chains),Z.reset("ConnectWallet"),s&&o)T.open=!0,t();else{const l=setInterval(()=>{const c=b.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,le=Object.getOwnPropertySymbols,Ue=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,ce=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Ue.call(t,s)&&ce(e,s,t[s]);if(le)for(var s of le(t))Se.call(t,s)&&ce(e,s,t[s]);return e};function Pe(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const _=j({themeMode:Pe()?"dark":"light"}),Y={state:_,subscribe(e){return P(_,()=>e(_))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(_.themeMode=t),s&&(_.themeVariables=De({},s))}},S=j({open:!1,message:"",variant:"success"}),ke={state:S,subscribe(e){return P(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Ne{constructor(t){this.openModal=z.open,this.closeModal=z.close,this.subscribeModal=z.subscribe,this.setTheme=Y.setThemeConfig,Y.setThemeConfig(t),D.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(()=>require("./index-DdleqS-C.js"));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),b.setIsUiLoaded(!0)}}}const Te=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ne},Symbol.toStringTag,{value:"Module"}));exports.R=de;exports.T=Z;exports.a=u;exports.index=Te;exports.ne=Y;exports.oe=ke;exports.p=b;exports.se=z;exports.te=je;exports.y=D;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("./index-Bh_VUH6w.js"),Za=require("./dijkstra-CtFxn7S9.js"),de=require("./events-CeUTM3JY.js"),S=require("./index-CtzDS4Ek.js"),w=require("./index-BVdejQdc.js"),$=require("./utf8-C9mhtl0f.js"),ec=`Ethereum Signed Message:
|
|
2
2
|
`;function Os(r){return typeof r=="string"&&(r=$.toUtf8Bytes(r)),$.keccak256($.concat([$.toUtf8Bytes(ec),$.toUtf8Bytes(String(r.length)),r]))}let tc=class extends w.r{constructor(e){super(e),this.events=new de.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(w.formatJsonRpcRequest(e.method,e.params||[],e.id||w.getBigIntRpcId().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{w.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,t)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),w.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var rc=function(){var r=document.getSelection();if(!r.rangeCount)return function(){};for(var e=document.activeElement,t=[],i=0;i<r.rangeCount;i++)t.push(r.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return r.removeAllRanges(),function(){r.type==="Caret"&&r.removeAllRanges(),r.rangeCount||t.forEach(function(n){r.addRange(n)}),e&&e.focus()}},ic=rc,Zi={"text/plain":"Text","text/html":"Url",default:"Text"},nc="Copy to clipboard: #{key}, Enter";function sc(r){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return r.replace(/#{\s*key\s*}/g,e)}function oc(r,e){var t,i,n,s,o,a,c=!1;e||(e={}),t=e.debug||!1;try{n=ic(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=r,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(u){if(u.stopPropagation(),e.format)if(u.preventDefault(),typeof u.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var h=Zi[e.format]||Zi.default;window.clipboardData.setData(h,r)}else u.clipboardData.clearData(),u.clipboardData.setData(e.format,r);e.onCopy&&(u.preventDefault(),e.onCopy(u.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var l=document.execCommand("copy");if(!l)throw new Error("copy command was unsuccessful");c=!0}catch(u){t&&console.error("unable to copy using execCommand: ",u),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",r),e.onCopy&&e.onCopy(window.clipboardData),c=!0}catch(h){t&&console.error("unable to copy using clipboardData: ",h),t&&console.error("falling back to prompt"),i=sc("message"in e?e.message:nc),window.prompt(i,r)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return c}var ac=oc,cc={}.toString,_i=Array.isArray||function(r){return cc.call(r)=="[object Array]"},lc=b.requireElliptic(),bi={},q={};Object.defineProperty(q,"__esModule",{value:!0});var $s=q.getLocalStorage=Ks=q.getLocalStorageOrThrow=zs=q.getCrypto=js=q.getCryptoOrThrow=Us=q.getLocation=Bs=q.getLocationOrThrow=Ls=q.getNavigator=Fs=q.getNavigatorOrThrow=qs=q.getDocument=Ds=q.getDocumentOrThrow=ks=q.getFromWindowOrThrow=Ms=q.getFromWindow=void 0;function tt(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}var Ms=q.getFromWindow=tt;function gt(r){const e=tt(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}var ks=q.getFromWindowOrThrow=gt;function uc(){return gt("document")}var Ds=q.getDocumentOrThrow=uc;function hc(){return tt("document")}var qs=q.getDocument=hc;function dc(){return gt("navigator")}var Fs=q.getNavigatorOrThrow=dc;function fc(){return tt("navigator")}var Ls=q.getNavigator=fc;function pc(){return gt("location")}var Bs=q.getLocationOrThrow=pc;function gc(){return tt("location")}var Us=q.getLocation=gc;function mc(){return gt("crypto")}var js=q.getCryptoOrThrow=mc;function yc(){return tt("crypto")}var zs=q.getCrypto=yc;function vc(){return gt("localStorage")}var Ks=q.getLocalStorageOrThrow=vc;function wc(){return tt("localStorage")}$s=q.getLocalStorage=wc;Object.defineProperty(bi,"__esModule",{value:!0});var Vs=bi.getWindowMetadata=void 0;const en=q;function _c(){let r,e;try{r=en.getDocumentOrThrow(),e=en.getLocationOrThrow()}catch{return null}function t(){const h=r.getElementsByTagName("link"),p=[];for(let d=0;d<h.length;d++){const f=h[d],g=f.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){const m=f.getAttribute("href");if(m)if(m.toLowerCase().indexOf("https:")===-1&&m.toLowerCase().indexOf("http:")===-1&&m.indexOf("//")!==0){let y=e.protocol+"//"+e.host;if(m.indexOf("/")===0)y+=m;else{const v=e.pathname.split("/");v.pop();const E=v.join("/");y+=E+"/"+m}p.push(y)}else if(m.indexOf("//")===0){const y=e.protocol+m;p.push(y)}else p.push(m)}}return p}function i(...h){const p=r.getElementsByTagName("meta");for(let d=0;d<p.length;d++){const f=p[d],g=["itemprop","property","name"].map(m=>f.getAttribute(m)).filter(m=>m?h.includes(m):!1);if(g.length&&g){const m=f.getAttribute("content");if(m)return m}}return""}function n(){let h=i("name","og:site_name","og:title","twitter:title");return h||(h=r.title),h}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),c=e.origin,l=t();return{description:a,url:c,icons:l,name:o}}Vs=bi.getWindowMetadata=_c;var bc=function(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var i=Array(r),n=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Ec=function(){function r(e,t,i){this.name=e,this.version=t,this.os=i,this.type="browser"}return r}(),Sc=function(){function r(e){this.version=e,this.type="node",this.name="node",this.os=b.dist.process.platform}return r}(),Ic=function(){function r(e,t,i,n){this.name=e,this.version=t,this.os=i,this.bot=n,this.type="bot-device"}return r}(),xc=function(){function r(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return r}(),Pc=function(){function r(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return r}(),Rc=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Tc=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,tn=3,Nc=[["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|$)/],["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",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",Rc]],rn=[["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/],["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 Ac(r){return r?nn(r):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Pc:typeof navigator<"u"?nn(navigator.userAgent):$c()}function Cc(r){return r!==""&&Nc.reduce(function(e,t){var i=t[0],n=t[1];if(e)return e;var s=n.exec(r);return!!s&&[i,s]},!1)}function nn(r){var e=Cc(r);if(!e)return null;var t=e[0],i=e[1];if(t==="searchbot")return new xc;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<tn&&(n=bc(n,Mc(tn-n.length))):n=[];var s=n.join("."),o=Oc(r),a=Tc.exec(r);return a&&a[1]?new Ic(t,s,o,a[1]):new Ec(t,s,o)}function Oc(r){for(var e=0,t=rn.length;e<t;e++){var i=rn[e],n=i[0],s=i[1],o=s.exec(r);if(o)return n}return null}function $c(){var r=typeof b.dist.process<"u"&&b.dist.process.version;return r?new Sc(b.dist.process.version.slice(1)):null}function Mc(r){for(var e=[],t=0;t<r;t++)e.push("0");return e}function Ei(r){return Ac(r)}function _r(){const r=Ei();return r&&r.os?r.os:void 0}function Ws(){const r=_r();return r?r.toLowerCase().includes("android"):!1}function Js(){const r=_r();return r?r.toLowerCase().includes("ios")||r.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function kc(){return _r()?Ws()||Js():!1}function Hs(){const r=Ei();return r&&r.name?r.name.toLowerCase()==="node":!1}function Dc(){return!Hs()&&!!Gs()}const qc=Ms,Fc=ks,Lc=Ds,Bc=qs,Uc=Fs,Gs=Ls,jc=Bs,zc=Us,Kc=js,Vc=zs,Wc=Ks,br=$s;function Jc(){return Vs()}function Hc(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return JSON.parse(r)}catch{return r}}function Gc(r){return typeof r=="string"?r:JSON.stringify(r)}const Ys=Hc,Qs=Gc;function Xs(r,e){const t=Qs(e),i=br();i&&i.setItem(r,t)}function Yc(r){let e=null,t=null;const i=br();return i&&(t=i.getItem(r)),e=t&&Ys(t),e}function Qc(r){const e=br();e&&e.removeItem(r)}const Zs="WALLETCONNECT_DEEPLINK_CHOICE";function Xc(r,e){const t=encodeURIComponent(r);return e.universalLink?`${e.universalLink}/wc?uri=${t}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${t}`:""}function Zc(r){const e=r.href.split("?")[0];Xs(Zs,Object.assign(Object.assign({},r),{href:e}))}function eo(r,e){return r.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))[0]}function el(r,e){let t=r;return e&&(t=e.map(i=>eo(r,i)).filter(Boolean)),t}const to="https://registry.walletconnect.com";function tl(){return to+"/api/v2/wallets"}function rl(){return to+"/api/v2/dapps"}function ro(r,e="mobile"){var t;return{name:r.name||"",shortName:r.metadata.shortName||"",color:r.metadata.colors.primary||"",logo:(t=r.image_url.sm)!==null&&t!==void 0?t:"",universalLink:r[e].universal||"",deepLink:r[e].native||""}}function il(r,e="mobile"){return Object.values(r).filter(t=>!!t[e].universal||!!t[e].native).map(t=>ro(t,e))}const nl=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:Ei,detectOS:_r,formatIOSMobile:Xc,formatMobileRegistry:il,formatMobileRegistryEntry:ro,getClientMeta:Jc,getCrypto:Vc,getCryptoOrThrow:Kc,getDappRegistryUrl:rl,getDocument:Bc,getDocumentOrThrow:Lc,getFromWindow:qc,getFromWindowOrThrow:Fc,getLocal:Yc,getLocalStorage:br,getLocalStorageOrThrow:Wc,getLocation:zc,getLocationOrThrow:jc,getMobileLinkRegistry:el,getMobileRegistryEntry:eo,getNavigator:Gs,getNavigatorOrThrow:Uc,getWalletRegistryUrl:tl,isAndroid:Ws,isBrowser:Dc,isIOS:Js,isMobile:kc,isNode:Hs,mobileLinkChoiceKey:Zs,removeLocal:Qc,safeJsonParse:Ys,safeJsonStringify:Qs,saveMobileLinkInfo:Zc,setLocal:Xs},Symbol.toStringTag,{value:"Module"})),sl=b.getAugmentedNamespace(nl);var Ut={},ol=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},io={},Ue={},al=_i;function cl(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},r.foo()===42}catch{return!1}}O.TYPED_ARRAY_SUPPORT=cl();var sn=O.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function O(r,e,t){return!O.TYPED_ARRAY_SUPPORT&&!(this instanceof O)?new O(r,e,t):typeof r=="number"?no(this,r):gl(this,r,e,t)}O.TYPED_ARRAY_SUPPORT&&(O.prototype.__proto__=Uint8Array.prototype,O.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&O[Symbol.species]===O&&Object.defineProperty(O,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function Si(r){if(r>=sn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+sn.toString(16)+" bytes");return r|0}function ll(r){return r!==r}function lt(r,e){var t;return O.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=O.prototype):(t=r,t===null&&(t=new O(e)),t.length=e),t}function no(r,e){var t=lt(r,e<0?0:Si(e)|0);if(!O.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function ul(r,e){var t=oo(e)|0,i=lt(r,t),n=i.write(e);return n!==t&&(i=i.slice(0,n)),i}function ii(r,e){for(var t=e.length<0?0:Si(e.length)|0,i=lt(r,t),n=0;n<t;n+=1)i[n]=e[n]&255;return i}function hl(r,e,t,i){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(i||0))throw new RangeError("'length' is out of bounds");var n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),O.TYPED_ARRAY_SUPPORT?n.__proto__=O.prototype:n=ii(r,n),n}function dl(r,e){if(O.isBuffer(e)){var t=Si(e.length)|0,i=lt(r,t);return i.length===0||e.copy(i,0,0,t),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||ll(e.length)?lt(r,0):ii(r,e);if(e.type==="Buffer"&&Array.isArray(e.data))return ii(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function so(r,e){e=e||1/0;for(var t,i=r.length,n=null,s=[],o=0;o<i;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function oo(r){if(O.isBuffer(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var e=r.length;return e===0?0:so(r).length}function fl(r,e,t,i){for(var n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function pl(r,e,t,i){return fl(so(e,r.length-t),r,t,i)}function gl(r,e,t,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?hl(r,e,t,i):typeof e=="string"?ul(r,e):dl(r,e)}O.prototype.write=function(e,t,i){t===void 0?(i=this.length,t=0):i===void 0&&typeof t=="string"?(i=this.length,t=0):isFinite(t)&&(t=t|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-t;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return pl(this,e,t,i)};O.prototype.slice=function(e,t){var i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);var n;if(O.TYPED_ARRAY_SUPPORT)n=this.subarray(e,t),n.__proto__=O.prototype;else{var s=t-e;n=new O(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};O.prototype.copy=function(e,t,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var s=n-i,o;if(this===e&&i<t&&t<n)for(o=s-1;o>=0;--o)e[o+t]=this[o+i];else if(s<1e3||!O.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),t);return s};O.prototype.fill=function(e,t,i){if(typeof e=="string"){if(typeof t=="string"?(t=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{var o=O.isBuffer(e)?e:new O(e),a=o.length;for(s=0;s<i-t;++s)this[s+t]=o[s%a]}return this};O.concat=function(e,t){if(!al(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return lt(null,0);var i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=no(null,t),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!O.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};O.byteLength=oo;O.prototype._isBuffer=!0;O.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};Ue.alloc=function(r){var e=new O(r);return e.fill(0),e};Ue.from=function(r){return new O(r)};var ae={},Ii,ml=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];ae.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};ae.getSymbolTotalCodewords=function(e){return ml[e]};ae.getBCHDigit=function(r){for(var e=0;r!==0;)e++,r>>>=1;return e};ae.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Ii=e};ae.isKanjiModeEnabled=function(){return typeof Ii<"u"};ae.toSJIS=function(e){return Ii(e)};var Er={};(function(r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2};function e(t){if(typeof t!="string")throw new Error("Param is not a string");var i=t.toLowerCase();switch(i){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}r.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},r.from=function(i,n){if(r.isValid(i))return i;try{return e(i)}catch{return n}}})(Er);function ao(){this.buffer=[],this.length=0}ao.prototype={get:function(r){var e=Math.floor(r/8);return(this.buffer[e]>>>7-r%8&1)===1},put:function(r,e){for(var t=0;t<e;t++)this.putBit((r>>>e-t-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),r&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var yl=ao,on=Ue;function jt(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=on.alloc(r*r),this.reservedBit=on.alloc(r*r)}jt.prototype.set=function(r,e,t,i){var n=r*this.size+e;this.data[n]=t,i&&(this.reservedBit[n]=!0)};jt.prototype.get=function(r,e){return this.data[r*this.size+e]};jt.prototype.xor=function(r,e,t){this.data[r*this.size+e]^=t};jt.prototype.isReserved=function(r,e){return this.reservedBit[r*this.size+e]};var vl=jt,co={};(function(r){var e=ae.getSymbolSize;r.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],c=1;c<n-1;c++)a[c]=a[c-1]-o;return a.push(6),a.reverse()},r.getPositions=function(i){for(var n=[],s=r.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var c=0;c<o;c++)a===0&&c===0||a===0&&c===o-1||a===o-1&&c===0||n.push([s[a],s[c]]);return n}})(co);var lo={},wl=ae.getSymbolSize,an=7;lo.getPositions=function(e){var t=wl(e);return[[0,0],[t-an,0],[0,t-an]]};var uo={};(function(r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};r.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},r.from=function(n){return r.isValid(n)?parseInt(n,10):void 0},r.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,c=0,l=null,u=null,h=0;h<s;h++){a=c=0,l=u=null;for(var p=0;p<s;p++){var d=n.get(h,p);d===l?a++:(a>=5&&(o+=e.N1+(a-5)),l=d,a=1),d=n.get(p,h),d===u?c++:(c>=5&&(o+=e.N1+(c-5)),u=d,c=1)}a>=5&&(o+=e.N1+(a-5)),c>=5&&(o+=e.N1+(c-5))}return o},r.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var c=0;c<s-1;c++){var l=n.get(a,c)+n.get(a,c+1)+n.get(a+1,c)+n.get(a+1,c+1);(l===4||l===0)&&o++}return o*e.N2},r.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,c=0,l=0;l<s;l++){a=c=0;for(var u=0;u<s;u++)a=a<<1&2047|n.get(l,u),u>=10&&(a===1488||a===93)&&o++,c=c<<1&2047|n.get(u,l),u>=10&&(c===1488||c===93)&&o++}return o*e.N3},r.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var c=Math.abs(Math.ceil(s*100/o/5)-10);return c*e.N4};function t(i,n,s){switch(i){case r.Patterns.PATTERN000:return(n+s)%2===0;case r.Patterns.PATTERN001:return n%2===0;case r.Patterns.PATTERN010:return s%3===0;case r.Patterns.PATTERN011:return(n+s)%3===0;case r.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case r.Patterns.PATTERN101:return n*s%2+n*s%3===0;case r.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case r.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}r.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var c=0;c<o;c++)s.isReserved(c,a)||s.xor(c,a,t(n,c,a))},r.getBestMask=function(n,s){for(var o=Object.keys(r.Patterns).length,a=0,c=1/0,l=0;l<o;l++){s(l),r.applyMask(l,n);var u=r.getPenaltyN1(n)+r.getPenaltyN2(n)+r.getPenaltyN3(n)+r.getPenaltyN4(n);r.applyMask(l,n),u<c&&(c=u,a=l)}return a}})(uo);var Sr={},De=Er,Qt=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Xt=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Sr.getBlocksCount=function(e,t){switch(t){case De.L:return Qt[(e-1)*4+0];case De.M:return Qt[(e-1)*4+1];case De.Q:return Qt[(e-1)*4+2];case De.H:return Qt[(e-1)*4+3];default:return}};Sr.getTotalCodewordsCount=function(e,t){switch(t){case De.L:return Xt[(e-1)*4+0];case De.M:return Xt[(e-1)*4+1];case De.Q:return Xt[(e-1)*4+2];case De.H:return Xt[(e-1)*4+3];default:return}};var ho={},Ir={},fo=Ue,Ct=fo.alloc(512),ar=fo.alloc(256);(function(){for(var e=1,t=0;t<255;t++)Ct[t]=e,ar[e]=t,e<<=1,e&256&&(e^=285);for(t=255;t<512;t++)Ct[t]=Ct[t-255]})();Ir.log=function(e){if(e<1)throw new Error("log("+e+")");return ar[e]};Ir.exp=function(e){return Ct[e]};Ir.mul=function(e,t){return e===0||t===0?0:Ct[ar[e]+ar[t]]};(function(r){var e=Ue,t=Ir;r.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var c=0;c<s.length;c++)o[a+c]^=t.mul(n[a],s[c]);return o},r.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],c=0;c<s.length;c++)o[c]^=t.mul(s[c],a);for(var l=0;l<o.length&&o[l]===0;)l++;o=o.slice(l)}return o},r.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=r.mul(s,[1,t.exp(o)]);return s}})(ho);var cn=Ue,po=ho,_l=b.bufferPolyfill.Buffer;function xi(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}xi.prototype.initialize=function(e){this.degree=e,this.genPoly=po.generateECPolynomial(this.degree)};xi.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=cn.alloc(this.degree),i=_l.concat([e,t],e.length+this.degree),n=po.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=cn.alloc(this.degree);return n.copy(o,s),o}return n};var bl=xi,go={},je={},Pi={};Pi.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Ie={},mo="[0-9]+",El="[A-Z $%*+\\-./:]+",Dt="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Dt=Dt.replace(/u/g,"\\u");var Sl="(?:(?![A-Z0-9 $%*+\\-./:]|"+Dt+`)(?:.|[\r
|
|
3
3
|
]))+`;Ie.KANJI=new RegExp(Dt,"g");Ie.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ie.BYTE=new RegExp(Sl,"g");Ie.NUMERIC=new RegExp(mo,"g");Ie.ALPHANUMERIC=new RegExp(El,"g");var Il=new RegExp("^"+Dt+"$"),xl=new RegExp("^"+mo+"$"),Pl=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ie.testKanji=function(e){return Il.test(e)};Ie.testNumeric=function(e){return xl.test(e)};Ie.testAlphanumeric=function(e){return Pl.test(e)};(function(r){var e=Pi,t=Ie;r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},r.getBestModeForData=function(s){return t.testNumeric(s)?r.NUMERIC:t.testAlphanumeric(s)?r.ALPHANUMERIC:t.testKanji(s)?r.KANJI:r.BYTE},r.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},r.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");var s=n.toLowerCase();switch(s){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+n)}}r.from=function(s,o){if(r.isValid(s))return s;try{return i(s)}catch{return o}}})(je);(function(r){var e=ae,t=Sr,i=Er,n=je,s=Pi,o=_i,a=7973,c=e.getBCHDigit(a);function l(d,f,g){for(var m=1;m<=40;m++)if(f<=r.getCapacity(m,g,d))return m}function u(d,f){return n.getCharCountIndicator(d,f)+4}function h(d,f){var g=0;return d.forEach(function(m){var y=u(m.mode,f);g+=y+m.getBitsLength()}),g}function p(d,f){for(var g=1;g<=40;g++){var m=h(d,g);if(m<=r.getCapacity(g,f,n.MIXED))return g}}r.from=function(f,g){return s.isValid(f)?parseInt(f,10):g},r.getCapacity=function(f,g,m){if(!s.isValid(f))throw new Error("Invalid QR Code version");typeof m>"u"&&(m=n.BYTE);var y=e.getSymbolTotalCodewords(f),v=t.getTotalCodewordsCount(f,g),E=(y-v)*8;if(m===n.MIXED)return E;var _=E-u(m,f);switch(m){case n.NUMERIC:return Math.floor(_/10*3);case n.ALPHANUMERIC:return Math.floor(_/11*2);case n.KANJI:return Math.floor(_/13);case n.BYTE:default:return Math.floor(_/8)}},r.getBestVersionForData=function(f,g){var m,y=i.from(g,i.M);if(o(f)){if(f.length>1)return p(f,y);if(f.length===0)return 1;m=f[0]}else m=f;return l(m.mode,m.getLength(),y)},r.getEncodedBits=function(f){if(!s.isValid(f)||f<7)throw new Error("Invalid QR Code version");for(var g=f<<12;e.getBCHDigit(g)-c>=0;)g^=a<<e.getBCHDigit(g)-c;return f<<12|g}})(go);var yo={},ni=ae,vo=1335,Rl=21522,ln=ni.getBCHDigit(vo);yo.getEncodedBits=function(e,t){for(var i=e.bit<<3|t,n=i<<10;ni.getBCHDigit(n)-ln>=0;)n^=vo<<ni.getBCHDigit(n)-ln;return(i<<10|n)^Rl};var wo={},Tl=je;function ut(r){this.mode=Tl.NUMERIC,this.data=r.toString()}ut.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};ut.prototype.getLength=function(){return this.data.length};ut.prototype.getBitsLength=function(){return ut.getBitsLength(this.data.length)};ut.prototype.write=function(e){var t,i,n;for(t=0;t+3<=this.data.length;t+=3)i=this.data.substr(t,3),n=parseInt(i,10),e.put(n,10);var s=this.data.length-t;s>0&&(i=this.data.substr(t),n=parseInt(i,10),e.put(n,s*3+1))};var Nl=ut,Al=je,Br=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function ht(r){this.mode=Al.ALPHANUMERIC,this.data=r}ht.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};ht.prototype.getLength=function(){return this.data.length};ht.prototype.getBitsLength=function(){return ht.getBitsLength(this.data.length)};ht.prototype.write=function(e){var t;for(t=0;t+2<=this.data.length;t+=2){var i=Br.indexOf(this.data[t])*45;i+=Br.indexOf(this.data[t+1]),e.put(i,11)}this.data.length%2&&e.put(Br.indexOf(this.data[t]),6)};var Cl=ht,Ol=Ue,$l=je;function dt(r){this.mode=$l.BYTE,this.data=Ol.from(r)}dt.getBitsLength=function(e){return e*8};dt.prototype.getLength=function(){return this.data.length};dt.prototype.getBitsLength=function(){return dt.getBitsLength(this.data.length)};dt.prototype.write=function(r){for(var e=0,t=this.data.length;e<t;e++)r.put(this.data[e],8)};var Ml=dt,kl=je,Dl=ae;function ft(r){this.mode=kl.KANJI,this.data=r}ft.getBitsLength=function(e){return e*13};ft.prototype.getLength=function(){return this.data.length};ft.prototype.getBitsLength=function(){return ft.getBitsLength(this.data.length)};ft.prototype.write=function(r){var e;for(e=0;e<this.data.length;e++){var t=Dl.toSJIS(this.data[e]);if(t>=33088&&t<=40956)t-=33088;else if(t>=57408&&t<=60351)t-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
|
|
4
4
|
Make sure your charset is UTF-8`);t=(t>>>8&255)*192+(t&255),r.put(t,13)}};var ql=ft;(function(r){var e=je,t=Nl,i=Cl,n=Ml,s=ql,o=Ie,a=ae,c=Za.dijkstraExports;function l(y){return unescape(encodeURIComponent(y)).length}function u(y,v,E){for(var _=[],I;(I=y.exec(E))!==null;)_.push({data:I[0],index:I.index,mode:v,length:I[0].length});return _}function h(y){var v=u(o.NUMERIC,e.NUMERIC,y),E=u(o.ALPHANUMERIC,e.ALPHANUMERIC,y),_,I;a.isKanjiModeEnabled()?(_=u(o.BYTE,e.BYTE,y),I=u(o.KANJI,e.KANJI,y)):(_=u(o.BYTE_KANJI,e.BYTE,y),I=[]);var R=v.concat(E,_,I);return R.sort(function(T,N){return T.index-N.index}).map(function(T){return{data:T.data,mode:T.mode,length:T.length}})}function p(y,v){switch(v){case e.NUMERIC:return t.getBitsLength(y);case e.ALPHANUMERIC:return i.getBitsLength(y);case e.KANJI:return s.getBitsLength(y);case e.BYTE:return n.getBitsLength(y)}}function d(y){return y.reduce(function(v,E){var _=v.length-1>=0?v[v.length-1]:null;return _&&_.mode===E.mode?(v[v.length-1].data+=E.data,v):(v.push(E),v)},[])}function f(y){for(var v=[],E=0;E<y.length;E++){var _=y[E];switch(_.mode){case e.NUMERIC:v.push([_,{data:_.data,mode:e.ALPHANUMERIC,length:_.length},{data:_.data,mode:e.BYTE,length:_.length}]);break;case e.ALPHANUMERIC:v.push([_,{data:_.data,mode:e.BYTE,length:_.length}]);break;case e.KANJI:v.push([_,{data:_.data,mode:e.BYTE,length:l(_.data)}]);break;case e.BYTE:v.push([{data:_.data,mode:e.BYTE,length:l(_.data)}])}}return v}function g(y,v){for(var E={},_={start:{}},I=["start"],R=0;R<y.length;R++){for(var T=y[R],N=[],M=0;M<T.length;M++){var z=T[M],_e=""+R+M;N.push(_e),E[_e]={node:z,lastCount:0},_[_e]={};for(var ne=0;ne<I.length;ne++){var V=I[ne];E[V]&&E[V].node.mode===z.mode?(_[V][_e]=p(E[V].lastCount+z.length,z.mode)-p(E[V].lastCount,z.mode),E[V].lastCount+=z.length):(E[V]&&(E[V].lastCount=z.length),_[V][_e]=p(z.length,z.mode)+4+e.getCharCountIndicator(z.mode,v))}}I=N}for(ne=0;ne<I.length;ne++)_[I[ne]].end=0;return{map:_,table:E}}function m(y,v){var E,_=e.getBestModeForData(y);if(E=e.from(v,_),E!==e.BYTE&&E.bit<_.bit)throw new Error('"'+y+'" cannot be encoded with mode '+e.toString(E)+`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as Ye, Y as Kn, cn as Vr, az as Ze } from "./index-
|
|
2
|
-
import { i as Xr, d as Yr, f as qr, g as Zr, j as Qr, k as ei, l as ti, m as ni, n as ri, o as ii, p as si, w as Un, r as $n, c as oi } from "./index-
|
|
1
|
+
import { X as Ye, Y as Kn, cn as Vr, az as Ze } from "./index-BN7FfORx.mjs";
|
|
2
|
+
import { i as Xr, d as Yr, f as qr, g as Zr, j as Qr, k as ei, l as ti, m as ni, n as ri, o as ii, p as si, w as Un, r as $n, c as oi } from "./index-D2ZFuAXe.mjs";
|
|
3
3
|
function Hn(e = 0) {
|
|
4
4
|
return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? globalThis.Buffer.allocUnsafe(e) : new Uint8Array(e);
|
|
5
5
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { aQ as a2, cm as S4, X as R, Y as y5, aR as m5 } from "./index-
|
|
2
|
-
import { h as g5, e as b5 } from "./index-
|
|
3
|
-
import { e as x4, d as w5 } from "./base64-
|
|
1
|
+
import { aQ as a2, cm as S4, X as R, Y as y5, aR as m5 } from "./index-BN7FfORx.mjs";
|
|
2
|
+
import { h as g5, e as b5 } from "./index-D2ZFuAXe.mjs";
|
|
3
|
+
import { e as x4, d as w5 } from "./base64-DJKqMaey.mjs";
|
|
4
4
|
import * as h3 from "react";
|
|
5
5
|
import y, { createContext as v5, useState as q2, useEffect as d0, useCallback as k5, useContext as E5 } from "react";
|
|
6
6
|
import _5 from "react-dom";
|
|
7
|
-
import { L as A, B as K, d as C, h as A5, c as N1, a as G, b as x, g as E3, e as h0, t as p0, f as O5, k as _3, i as l2, j as $5, l as f2, D as i3 } from "./utf8-
|
|
7
|
+
import { L as A, B as K, d as C, h as A5, c as N1, a as G, b as x, g as E3, e as h0, t as p0, f as O5, k as _3, i as l2, j as $5, l as f2, D as i3 } from "./utf8-D8MD86af.mjs";
|
|
8
8
|
function A3(t, e) {
|
|
9
9
|
(e == null || e > t.length) && (e = t.length);
|
|
10
10
|
for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Y = Object.defineProperty;
|
|
2
2
|
var Z = (n, f, e) => f in n ? Y(n, f, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[f] = e;
|
|
3
3
|
var d = (n, f, e) => Z(n, typeof f != "symbol" ? f + "" : f, e);
|
|
4
|
-
import { V as y, bi as f0, bj as W, bk as p, bl as e0, bm as a0, bn as t0, bo as _, bp as b0, bq as n0, br as d0, b6 as L, bs as O, E as v, a as C, bt as D, s as U, ba as u, bu as q, bd as c0, bv as N, bf as H, bg as j, b4 as s0, bw as i0, bx as I, b3 as S, a5 as $, bh as V, _ as G } from "./index-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { V as y, bi as f0, bj as W, bk as p, bl as e0, bm as a0, bn as t0, bo as _, bp as b0, bq as n0, br as d0, b6 as L, bs as O, E as v, a as C, bt as D, s as U, ba as u, bu as q, bd as c0, bv as N, bf as H, bg as j, b4 as s0, bw as i0, bx as I, b3 as S, a5 as $, bh as V, _ as G } from "./index-BN7FfORx.mjs";
|
|
5
|
+
import "./index-2Hoo-RF7.mjs";
|
|
6
6
|
const r0 = new RegExp("^bytes([0-9]+)$"), p0 = new RegExp("^(u?int)([0-9]*)$"), y0 = new RegExp("^(.*)\\[([0-9]*)\\]$");
|
|
7
7
|
function J(n, f, e) {
|
|
8
8
|
switch (n) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var B = Object.defineProperty;
|
|
2
2
|
var S = (i, e, t) => e in i ? B(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var a = (i, e, t) => S(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { cb as f, cc as v, c7 as I, p, cd as x, b4 as w, by as E, bb as U, bz as m, s as o, aA as k, q as c, m as h, ce as $, bE as T, X as F, bB as C, k as _, bc as u, cf as W, bh as N } from "./index-
|
|
5
|
-
import { A as O } from "./aptos-
|
|
4
|
+
import { cb as f, cc as v, c7 as I, p, cd as x, b4 as w, by as E, bb as U, bz as m, s as o, aA as k, q as c, m as h, ce as $, bE as T, X as F, bB as C, k as _, bc as u, cf as W, bh as N } from "./index-BN7FfORx.mjs";
|
|
5
|
+
import { A as O } from "./aptos-szFJdwGu.mjs";
|
|
6
6
|
class Q {
|
|
7
7
|
constructor(e, t, s, n, r = !1) {
|
|
8
8
|
a(this, "transaction");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aL as b, aS as g, aT as F, aU as k, aV as I, Q as T, R as P } from "./index-
|
|
1
|
+
import { aL as b, aS as g, aT as F, aU as k, aV as I, Q as T, R as P } from "./index-BN7FfORx.mjs";
|
|
2
2
|
function R(n, t, e, s) {
|
|
3
3
|
g(n);
|
|
4
4
|
const i = F({ dkLen: 32, asyncTick: 10 }, s), { c: u, dkLen: a, asyncTick: o } = i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ue=require("./index-DgaACuCq.js");function Bt(e,r){for(var n=0;n<r.length;n++){const i=r[n];if(typeof i!="string"&&!Array.isArray(i)){for(const h in i)if(h!=="default"&&!(h in e)){const o=Object.getOwnPropertyDescriptor(i,h);o&&Object.defineProperty(e,h,o.get?o:{enumerable:!0,get:()=>i[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Qe=Ue.requireHash();const _t=Ue.getDefaultExportFromCjs(Qe),xt=Bt({__proto__:null,default:_t},[Qe]);var dt={},Le={},F={},Et={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(a,f){var s=a>>>16&65535,c=a&65535,v=f>>>16&65535,d=f&65535;return c*d+(s*d+c*v<<16>>>0)|0}e.mul=Math.imul||r;function n(a,f){return a+f|0}e.add=n;function i(a,f){return a-f|0}e.sub=i;function h(a,f){return a<<f|a>>>32-f}e.rotl=h;function o(a,f){return a<<32-f|a>>>f}e.rotr=o;function b(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}e.isInteger=Number.isInteger||b,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(a){return e.isInteger(a)&&a>=-e.MAX_SAFE_INTEGER&&a<=e.MAX_SAFE_INTEGER}})(Et);Object.defineProperty(F,"__esModule",{value:!0});var bt=Et;function Pt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}F.readInt16BE=Pt;function Rt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}F.readUint16BE=Rt;function jt(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}F.readInt16LE=jt;function It(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}F.readUint16LE=It;function wt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}F.writeUint16BE=wt;F.writeInt16BE=wt;function vt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}F.writeUint16LE=vt;F.writeInt16LE=vt;function qe(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}F.readInt32BE=qe;function Ge(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}F.readUint32BE=Ge;function We(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}F.readInt32LE=We;function Ve(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}F.readUint32LE=Ve;function Me(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}F.writeUint32BE=Me;F.writeInt32BE=Me;function Fe(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}F.writeUint32LE=Fe;F.writeInt32LE=Fe;function Ht(e,r){r===void 0&&(r=0);var n=qe(e,r),i=qe(e,r+4);return n*4294967296+i-(i>>31)*4294967296}F.readInt64BE=Ht;function Kt(e,r){r===void 0&&(r=0);var n=Ge(e,r),i=Ge(e,r+4);return n*4294967296+i}F.readUint64BE=Kt;function zt(e,r){r===void 0&&(r=0);var n=We(e,r),i=We(e,r+4);return i*4294967296+n-(n>>31)*4294967296}F.readInt64LE=zt;function Yt(e,r){r===void 0&&(r=0);var n=Ve(e,r),i=Ve(e,r+4);return i*4294967296+n}F.readUint64LE=Yt;function yt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Me(e/4294967296>>>0,r,n),Me(e>>>0,r,n+4),r}F.writeUint64BE=yt;F.writeInt64BE=yt;function gt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Fe(e>>>0,r,n),Fe(e/4294967296>>>0,r,n+4),r}F.writeUint64LE=gt;F.writeInt64LE=gt;function qt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,h=1,o=e/8+n-1;o>=n;o--)i+=r[o]*h,h*=256;return i}F.readUintBE=qt;function Gt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,h=1,o=n;o<n+e/8;o++)i+=r[o]*h,h*=256;return i}F.readUintLE=Gt;function Wt(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!bt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var h=1,o=e/8+i-1;o>=i;o--)n[o]=r/h&255,h*=256;return n}F.writeUintBE=Wt;function Vt(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!bt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var h=1,o=i;o<i+e/8;o++)n[o]=r/h&255,h*=256;return n}F.writeUintLE=Vt;function $t(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}F.readFloat32BE=$t;function Xt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}F.readFloat32LE=Xt;function Jt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}F.readFloat64BE=Jt;function Zt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}F.readFloat64LE=Zt;function Qt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e),r}F.writeFloat32BE=Qt;function kt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e,!0),r}F.writeFloat32LE=kt;function er(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e),r}F.writeFloat64BE=er;function tr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e,!0),r}F.writeFloat64LE=tr;var de={};Object.defineProperty(de,"__esModule",{value:!0});function rr(e){for(var r=0;r<e.length;r++)e[r]=0;return e}de.wipe=rr;Object.defineProperty(Le,"__esModule",{value:!0});var _e=F,$e=de,nr=20;function ir(e,r,n){for(var i=1634760805,h=857760878,o=2036477234,b=1797285236,a=n[3]<<24|n[2]<<16|n[1]<<8|n[0],f=n[7]<<24|n[6]<<16|n[5]<<8|n[4],s=n[11]<<24|n[10]<<16|n[9]<<8|n[8],c=n[15]<<24|n[14]<<16|n[13]<<8|n[12],v=n[19]<<24|n[18]<<16|n[17]<<8|n[16],d=n[23]<<24|n[22]<<16|n[21]<<8|n[20],_=n[27]<<24|n[26]<<16|n[25]<<8|n[24],w=n[31]<<24|n[30]<<16|n[29]<<8|n[28],m=r[3]<<24|r[2]<<16|r[1]<<8|r[0],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],R=r[15]<<24|r[14]<<16|r[13]<<8|r[12],T=i,l=h,E=o,D=b,t=a,u=f,y=s,S=c,U=v,L=d,x=_,B=w,N=m,M=p,g=O,A=R,W=0;W<nr;W+=2)T=T+t|0,N^=T,N=N>>>16|N<<16,U=U+N|0,t^=U,t=t>>>20|t<<12,l=l+u|0,M^=l,M=M>>>16|M<<16,L=L+M|0,u^=L,u=u>>>20|u<<12,E=E+y|0,g^=E,g=g>>>16|g<<16,x=x+g|0,y^=x,y=y>>>20|y<<12,D=D+S|0,A^=D,A=A>>>16|A<<16,B=B+A|0,S^=B,S=S>>>20|S<<12,E=E+y|0,g^=E,g=g>>>24|g<<8,x=x+g|0,y^=x,y=y>>>25|y<<7,D=D+S|0,A^=D,A=A>>>24|A<<8,B=B+A|0,S^=B,S=S>>>25|S<<7,l=l+u|0,M^=l,M=M>>>24|M<<8,L=L+M|0,u^=L,u=u>>>25|u<<7,T=T+t|0,N^=T,N=N>>>24|N<<8,U=U+N|0,t^=U,t=t>>>25|t<<7,T=T+u|0,A^=T,A=A>>>16|A<<16,x=x+A|0,u^=x,u=u>>>20|u<<12,l=l+y|0,N^=l,N=N>>>16|N<<16,B=B+N|0,y^=B,y=y>>>20|y<<12,E=E+S|0,M^=E,M=M>>>16|M<<16,U=U+M|0,S^=U,S=S>>>20|S<<12,D=D+t|0,g^=D,g=g>>>16|g<<16,L=L+g|0,t^=L,t=t>>>20|t<<12,E=E+S|0,M^=E,M=M>>>24|M<<8,U=U+M|0,S^=U,S=S>>>25|S<<7,D=D+t|0,g^=D,g=g>>>24|g<<8,L=L+g|0,t^=L,t=t>>>25|t<<7,l=l+y|0,N^=l,N=N>>>24|N<<8,B=B+N|0,y^=B,y=y>>>25|y<<7,T=T+u|0,A^=T,A=A>>>24|A<<8,x=x+A|0,u^=x,u=u>>>25|u<<7;_e.writeUint32LE(T+i|0,e,0),_e.writeUint32LE(l+h|0,e,4),_e.writeUint32LE(E+o|0,e,8),_e.writeUint32LE(D+b|0,e,12),_e.writeUint32LE(t+a|0,e,16),_e.writeUint32LE(u+f|0,e,20),_e.writeUint32LE(y+s|0,e,24),_e.writeUint32LE(S+c|0,e,28),_e.writeUint32LE(U+v|0,e,32),_e.writeUint32LE(L+d|0,e,36),_e.writeUint32LE(x+_|0,e,40),_e.writeUint32LE(B+w|0,e,44),_e.writeUint32LE(N+m|0,e,48),_e.writeUint32LE(M+p|0,e,52),_e.writeUint32LE(g+O|0,e,56),_e.writeUint32LE(A+R|0,e,60)}function St(e,r,n,i,h){if(h===void 0&&(h=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<n.length)throw new Error("ChaCha: destination is shorter than source");var o,b;if(h===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),b=o.length-r.length,o.set(r,b)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=r,b=h}for(var a=new Uint8Array(64),f=0;f<n.length;f+=64){ir(a,o,e);for(var s=f;s<f+64&&s<n.length;s++)i[s]=n[s]^a[s-f];ar(o,0,b)}return $e.wipe(a),h===0&&$e.wipe(o),i}Le.streamXOR=St;function ur(e,r,n,i){return i===void 0&&(i=0),$e.wipe(n),St(e,r,n,n,i)}Le.stream=ur;function ar(e,r,n){for(var i=1;n--;)i=i+(e[r]&255)|0,e[r]=i&255,i>>>=8,r++;if(i>0)throw new Error("ChaCha: counter overflow")}var pt={},be={};Object.defineProperty(be,"__esModule",{value:!0});function fr(e,r,n){return~(e-1)&r|e-1&n}be.select=fr;function hr(e,r){return(e|0)-(r|0)-1>>>31&1}be.lessOrEqual=hr;function Ct(e,r){if(e.length!==r.length)return 0;for(var n=0,i=0;i<e.length;i++)n|=e[i]^r[i];return 1&n-1>>>8}be.compare=Ct;function or(e,r){return e.length===0||r.length===0?!1:Ct(e,r)!==0}be.equal=or;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=be,n=de;e.DIGEST_LENGTH=16;var i=function(){function b(a){this.digestLength=e.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 f=a[0]|a[1]<<8;this._r[0]=f&8191;var s=a[2]|a[3]<<8;this._r[1]=(f>>>13|s<<3)&8191;var c=a[4]|a[5]<<8;this._r[2]=(s>>>10|c<<6)&7939;var v=a[6]|a[7]<<8;this._r[3]=(c>>>7|v<<9)&8191;var d=a[8]|a[9]<<8;this._r[4]=(v>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var _=a[10]|a[11]<<8;this._r[6]=(d>>>14|_<<2)&8191;var w=a[12]|a[13]<<8;this._r[7]=(_>>>11|w<<5)&8065;var m=a[14]|a[15]<<8;this._r[8]=(w>>>8|m<<8)&8191,this._r[9]=m>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return b.prototype._blocks=function(a,f,s){for(var c=this._fin?0:2048,v=this._h[0],d=this._h[1],_=this._h[2],w=this._h[3],m=this._h[4],p=this._h[5],O=this._h[6],R=this._h[7],T=this._h[8],l=this._h[9],E=this._r[0],D=this._r[1],t=this._r[2],u=this._r[3],y=this._r[4],S=this._r[5],U=this._r[6],L=this._r[7],x=this._r[8],B=this._r[9];s>=16;){var N=a[f+0]|a[f+1]<<8;v+=N&8191;var M=a[f+2]|a[f+3]<<8;d+=(N>>>13|M<<3)&8191;var g=a[f+4]|a[f+5]<<8;_+=(M>>>10|g<<6)&8191;var A=a[f+6]|a[f+7]<<8;w+=(g>>>7|A<<9)&8191;var W=a[f+8]|a[f+9]<<8;m+=(A>>>4|W<<12)&8191,p+=W>>>1&8191;var J=a[f+10]|a[f+11]<<8;O+=(W>>>14|J<<2)&8191;var X=a[f+12]|a[f+13]<<8;R+=(J>>>11|X<<5)&8191;var $=a[f+14]|a[f+15]<<8;T+=(X>>>8|$<<8)&8191,l+=$>>>5|c;var C=0,P=C;P+=v*E,P+=d*(5*B),P+=_*(5*x),P+=w*(5*L),P+=m*(5*U),C=P>>>13,P&=8191,P+=p*(5*S),P+=O*(5*y),P+=R*(5*u),P+=T*(5*t),P+=l*(5*D),C+=P>>>13,P&=8191;var j=C;j+=v*D,j+=d*E,j+=_*(5*B),j+=w*(5*x),j+=m*(5*L),C=j>>>13,j&=8191,j+=p*(5*U),j+=O*(5*S),j+=R*(5*y),j+=T*(5*u),j+=l*(5*t),C+=j>>>13,j&=8191;var I=C;I+=v*t,I+=d*D,I+=_*E,I+=w*(5*B),I+=m*(5*x),C=I>>>13,I&=8191,I+=p*(5*L),I+=O*(5*U),I+=R*(5*S),I+=T*(5*y),I+=l*(5*u),C+=I>>>13,I&=8191;var H=C;H+=v*u,H+=d*t,H+=_*D,H+=w*E,H+=m*(5*B),C=H>>>13,H&=8191,H+=p*(5*x),H+=O*(5*L),H+=R*(5*U),H+=T*(5*S),H+=l*(5*y),C+=H>>>13,H&=8191;var K=C;K+=v*y,K+=d*u,K+=_*t,K+=w*D,K+=m*E,C=K>>>13,K&=8191,K+=p*(5*B),K+=O*(5*x),K+=R*(5*L),K+=T*(5*U),K+=l*(5*S),C+=K>>>13,K&=8191;var z=C;z+=v*S,z+=d*y,z+=_*u,z+=w*t,z+=m*D,C=z>>>13,z&=8191,z+=p*E,z+=O*(5*B),z+=R*(5*x),z+=T*(5*L),z+=l*(5*U),C+=z>>>13,z&=8191;var Y=C;Y+=v*U,Y+=d*S,Y+=_*y,Y+=w*u,Y+=m*t,C=Y>>>13,Y&=8191,Y+=p*D,Y+=O*E,Y+=R*(5*B),Y+=T*(5*x),Y+=l*(5*L),C+=Y>>>13,Y&=8191;var q=C;q+=v*L,q+=d*U,q+=_*S,q+=w*y,q+=m*u,C=q>>>13,q&=8191,q+=p*t,q+=O*D,q+=R*E,q+=T*(5*B),q+=l*(5*x),C+=q>>>13,q&=8191;var G=C;G+=v*x,G+=d*L,G+=_*U,G+=w*S,G+=m*y,C=G>>>13,G&=8191,G+=p*u,G+=O*t,G+=R*D,G+=T*E,G+=l*(5*B),C+=G>>>13,G&=8191;var V=C;V+=v*B,V+=d*x,V+=_*L,V+=w*U,V+=m*S,C=V>>>13,V&=8191,V+=p*y,V+=O*u,V+=R*t,V+=T*D,V+=l*E,C+=V>>>13,V&=8191,C=(C<<2)+C|0,C=C+P|0,P=C&8191,C=C>>>13,j+=C,v=P,d=j,_=I,w=H,m=K,p=z,O=Y,R=q,T=G,l=V,f+=16,s-=16}this._h[0]=v,this._h[1]=d,this._h[2]=_,this._h[3]=w,this._h[4]=m,this._h[5]=p,this._h[6]=O,this._h[7]=R,this._h[8]=T,this._h[9]=l},b.prototype.finish=function(a,f){f===void 0&&(f=0);var s=new Uint16Array(10),c,v,d,_;if(this._leftover){for(_=this._leftover,this._buffer[_++]=1;_<16;_++)this._buffer[_]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(c=this._h[1]>>>13,this._h[1]&=8191,_=2;_<10;_++)this._h[_]+=c,c=this._h[_]>>>13,this._h[_]&=8191;for(this._h[0]+=c*5,c=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=c,c=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=c,s[0]=this._h[0]+5,c=s[0]>>>13,s[0]&=8191,_=1;_<10;_++)s[_]=this._h[_]+c,c=s[_]>>>13,s[_]&=8191;for(s[9]-=8192,v=(c^1)-1,_=0;_<10;_++)s[_]&=v;for(v=~v,_=0;_<10;_++)this._h[_]=this._h[_]&v|s[_];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,d=this._h[0]+this._pad[0],this._h[0]=d&65535,_=1;_<8;_++)d=(this._h[_]+this._pad[_]|0)+(d>>>16)|0,this._h[_]=d&65535;return a[f+0]=this._h[0]>>>0,a[f+1]=this._h[0]>>>8,a[f+2]=this._h[1]>>>0,a[f+3]=this._h[1]>>>8,a[f+4]=this._h[2]>>>0,a[f+5]=this._h[2]>>>8,a[f+6]=this._h[3]>>>0,a[f+7]=this._h[3]>>>8,a[f+8]=this._h[4]>>>0,a[f+9]=this._h[4]>>>8,a[f+10]=this._h[5]>>>0,a[f+11]=this._h[5]>>>8,a[f+12]=this._h[6]>>>0,a[f+13]=this._h[6]>>>8,a[f+14]=this._h[7]>>>0,a[f+15]=this._h[7]>>>8,this._finished=!0,this},b.prototype.update=function(a){var f=0,s=a.length,c;if(this._leftover){c=16-this._leftover,c>s&&(c=s);for(var v=0;v<c;v++)this._buffer[this._leftover+v]=a[f+v];if(s-=c,f+=c,this._leftover+=c,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(s>=16&&(c=s-s%16,this._blocks(a,f,c),f+=c,s-=c),s){for(var v=0;v<s;v++)this._buffer[this._leftover+v]=a[f+v];this._leftover+=s}return this},b.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var a=new Uint8Array(16);return this.finish(a),a},b.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},b}();e.Poly1305=i;function h(b,a){var f=new i(b);f.update(a);var s=f.digest();return f.clean(),s}e.oneTimeAuth=h;function o(b,a){return b.length!==e.DIGEST_LENGTH||a.length!==e.DIGEST_LENGTH?!1:r.equal(b,a)}e.equal=o})(pt);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=Le,n=pt,i=de,h=F,o=be;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var b=new Uint8Array(16),a=function(){function f(s){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,s.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(s)}return f.prototype.seal=function(s,c,v,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var _=new Uint8Array(16);_.set(s,_.length-s.length);var w=new Uint8Array(32);r.stream(this._key,_,w,4);var m=c.length+this.tagLength,p;if(d){if(d.length!==m)throw new Error("ChaCha20Poly1305: incorrect destination length");p=d}else p=new Uint8Array(m);return r.streamXOR(this._key,_,c,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),w,p.subarray(0,p.length-this.tagLength),v),i.wipe(_),p},f.prototype.open=function(s,c,v,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(c.length<this.tagLength)return null;var _=new Uint8Array(16);_.set(s,_.length-s.length);var w=new Uint8Array(32);r.stream(this._key,_,w,4);var m=new Uint8Array(this.tagLength);if(this._authenticate(m,w,c.subarray(0,c.length-this.tagLength),v),!o.equal(m,c.subarray(c.length-this.tagLength,c.length)))return null;var p=c.length-this.tagLength,O;if(d){if(d.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");O=d}else O=new Uint8Array(p);return r.streamXOR(this._key,_,c.subarray(0,c.length-this.tagLength),O,4),i.wipe(_),O},f.prototype.clean=function(){return i.wipe(this._key),this},f.prototype._authenticate=function(s,c,v,d){var _=new n.Poly1305(c);d&&(_.update(d),d.length%16>0&&_.update(b.subarray(d.length%16))),_.update(v),v.length%16>0&&_.update(b.subarray(v.length%16));var w=new Uint8Array(8);d&&h.writeUint64LE(d.length,w),_.update(w),h.writeUint64LE(v.length,w),_.update(w);for(var m=_.digest(),p=0;p<m.length;p++)s[p]=m[p];_.clean(),i.wipe(m),i.wipe(w)},f}();e.ChaCha20Poly1305=a})(dt);var mt={},Oe={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});function sr(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}ke.isSerializableHash=sr;Object.defineProperty(Oe,"__esModule",{value:!0});var Ee=ke,lr=be,Dr=de,Ut=function(){function e(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(i).clean():i.set(n);for(var h=0;h<i.length;h++)i[h]^=54;this._inner.update(i);for(var h=0;h<i.length;h++)i[h]^=106;this._outer.update(i),Ee.isSerializableHash(this._inner)&&Ee.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Dr.wipe(i)}return e.prototype.reset=function(){if(!Ee.isSerializableHash(this._inner)||!Ee.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},e.prototype.clean=function(){Ee.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ee.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(r){return this._inner.update(r),this},e.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},e.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},e.prototype.saveState=function(){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(r){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(r){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},e}();Oe.HMAC=Ut;function cr(e,r,n){var i=new Ut(e,r);i.update(n);var h=i.digest();return i.clean(),h}Oe.hmac=cr;Oe.equal=lr.equal;Object.defineProperty(mt,"__esModule",{value:!0});var rt=Oe,nt=de,_r=function(){function e(r,n,i,h){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=h;var o=rt.hmac(this._hash,i,n);this._hmac=new rt.HMAC(r,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>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},e.prototype.expand=function(r){for(var n=new Uint8Array(r),i=0;i<n.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[i]=this._buffer[this._bufpos++];return n},e.prototype.clean=function(){this._hmac.clean(),nt.wipe(this._buffer),nt.wipe(this._counter),this._bufpos=0},e}(),dr=mt.HKDF=_r,et={},Be={},xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.BrowserRandomSource=void 0;const it=65536;class Er{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let i=0;i<n.length;i+=it)this._crypto.getRandomValues(n.subarray(i,i+Math.min(n.length-i,it)));return n}}xe.BrowserRandomSource=Er;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.NodeRandomSource=void 0;const br=de;class wr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Ue.commonjsRequire<"u"){const r=Ue.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(r);for(let h=0;h<i.length;h++)i[h]=n[h];return(0,br.wipe)(n),i}}Pe.NodeRandomSource=wr;Object.defineProperty(Be,"__esModule",{value:!0});Be.SystemRandomSource=void 0;const vr=xe,yr=Pe;class gr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new vr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new yr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}Be.SystemRandomSource=gr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=Be,n=F,i=de;e.defaultRandomSource=new r.SystemRandomSource;function h(s,c=e.defaultRandomSource){return c.randomBytes(s)}e.randomBytes=h;function o(s=e.defaultRandomSource){const c=h(4,s),v=(0,n.readUint32LE)(c);return(0,i.wipe)(c),v}e.randomUint32=o;const b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(s,c=b,v=e.defaultRandomSource){if(c.length<2)throw new Error("randomString charset is too short");if(c.length>256)throw new Error("randomString charset is too long");let d="";const _=c.length,w=256-256%_;for(;s>0;){const m=h(Math.ceil(s*256/w),v);for(let p=0;p<m.length&&s>0;p++){const O=m[p];O<w&&(d+=c.charAt(O%_),s--)}(0,i.wipe)(m)}return d}e.randomString=a;function f(s,c=b,v=e.defaultRandomSource){const d=Math.ceil(s/(Math.log(c.length)/Math.LN2));return a(d,c,v)}e.randomStringForEntropy=f})(et);var At={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=F,n=de;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var i=function(){function a(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 a.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},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},a.prototype.update=function(f,s){if(s===void 0&&(s=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var c=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&s>0;)this._buffer[this._bufferLength++]=f[c++],s--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(c=o(this._temp,this._state,f,c,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=f[c++],s--;return this},a.prototype.finish=function(f){if(!this._finished){var s=this._bytesHashed,c=this._bufferLength,v=s/536870912|0,d=s<<3,_=s%64<56?64:128;this._buffer[c]=128;for(var w=c+1;w<_-8;w++)this._buffer[w]=0;r.writeUint32BE(v,this._buffer,_-8),r.writeUint32BE(d,this._buffer,_-4),o(this._temp,this._state,this._buffer,0,_),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)r.writeUint32BE(this._state[w],f,w*4);return this},a.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},a.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}},a.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(f){n.wipe(f.state),f.buffer&&n.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},a}();e.SHA256=i;var h=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 o(a,f,s,c,v){for(;v>=64;){for(var d=f[0],_=f[1],w=f[2],m=f[3],p=f[4],O=f[5],R=f[6],T=f[7],l=0;l<16;l++){var E=c+l*4;a[l]=r.readUint32BE(s,E)}for(var l=16;l<64;l++){var D=a[l-2],t=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10;D=a[l-15];var u=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3;a[l]=(t+a[l-7]|0)+(u+a[l-16]|0)}for(var l=0;l<64;l++){var t=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&O^~p&R)|0)+(T+(h[l]+a[l]|0)|0)|0,u=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&_^d&w^_&w)|0;T=R,R=O,O=p,p=m+t|0,m=w,w=_,_=d,d=t+u|0}f[0]+=d,f[1]+=_,f[2]+=w,f[3]+=m,f[4]+=p,f[5]+=O,f[6]+=R,f[7]+=T,c+=64,v-=64}return c}function b(a){var f=new i;f.update(a);var s=f.digest();return f.clean(),s}e.hash=b})(At);var Ot={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const r=et,n=de;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function i(l){const E=new Float64Array(16);if(l)for(let D=0;D<l.length;D++)E[D]=l[D];return E}const h=new Uint8Array(32);h[0]=9;const o=i([56129,1]);function b(l){let E=1;for(let D=0;D<16;D++){let t=l[D]+E+65535;E=Math.floor(t/65536),l[D]=t-E*65536}l[0]+=E-1+37*(E-1)}function a(l,E,D){const t=~(D-1);for(let u=0;u<16;u++){const y=t&(l[u]^E[u]);l[u]^=y,E[u]^=y}}function f(l,E){const D=i(),t=i();for(let u=0;u<16;u++)t[u]=E[u];b(t),b(t),b(t);for(let u=0;u<2;u++){D[0]=t[0]-65517;for(let S=1;S<15;S++)D[S]=t[S]-65535-(D[S-1]>>16&1),D[S-1]&=65535;D[15]=t[15]-32767-(D[14]>>16&1);const y=D[15]>>16&1;D[14]&=65535,a(t,D,1-y)}for(let u=0;u<16;u++)l[2*u]=t[u]&255,l[2*u+1]=t[u]>>8}function s(l,E){for(let D=0;D<16;D++)l[D]=E[2*D]+(E[2*D+1]<<8);l[15]&=32767}function c(l,E,D){for(let t=0;t<16;t++)l[t]=E[t]+D[t]}function v(l,E,D){for(let t=0;t<16;t++)l[t]=E[t]-D[t]}function d(l,E,D){let t,u,y=0,S=0,U=0,L=0,x=0,B=0,N=0,M=0,g=0,A=0,W=0,J=0,X=0,$=0,C=0,P=0,j=0,I=0,H=0,K=0,z=0,Y=0,q=0,G=0,V=0,we=0,ge=0,pe=0,Ne=0,Ie=0,tt=0,Q=D[0],k=D[1],ee=D[2],te=D[3],re=D[4],ne=D[5],ie=D[6],ue=D[7],ae=D[8],fe=D[9],he=D[10],oe=D[11],se=D[12],le=D[13],De=D[14],ce=D[15];t=E[0],y+=t*Q,S+=t*k,U+=t*ee,L+=t*te,x+=t*re,B+=t*ne,N+=t*ie,M+=t*ue,g+=t*ae,A+=t*fe,W+=t*he,J+=t*oe,X+=t*se,$+=t*le,C+=t*De,P+=t*ce,t=E[1],S+=t*Q,U+=t*k,L+=t*ee,x+=t*te,B+=t*re,N+=t*ne,M+=t*ie,g+=t*ue,A+=t*ae,W+=t*fe,J+=t*he,X+=t*oe,$+=t*se,C+=t*le,P+=t*De,j+=t*ce,t=E[2],U+=t*Q,L+=t*k,x+=t*ee,B+=t*te,N+=t*re,M+=t*ne,g+=t*ie,A+=t*ue,W+=t*ae,J+=t*fe,X+=t*he,$+=t*oe,C+=t*se,P+=t*le,j+=t*De,I+=t*ce,t=E[3],L+=t*Q,x+=t*k,B+=t*ee,N+=t*te,M+=t*re,g+=t*ne,A+=t*ie,W+=t*ue,J+=t*ae,X+=t*fe,$+=t*he,C+=t*oe,P+=t*se,j+=t*le,I+=t*De,H+=t*ce,t=E[4],x+=t*Q,B+=t*k,N+=t*ee,M+=t*te,g+=t*re,A+=t*ne,W+=t*ie,J+=t*ue,X+=t*ae,$+=t*fe,C+=t*he,P+=t*oe,j+=t*se,I+=t*le,H+=t*De,K+=t*ce,t=E[5],B+=t*Q,N+=t*k,M+=t*ee,g+=t*te,A+=t*re,W+=t*ne,J+=t*ie,X+=t*ue,$+=t*ae,C+=t*fe,P+=t*he,j+=t*oe,I+=t*se,H+=t*le,K+=t*De,z+=t*ce,t=E[6],N+=t*Q,M+=t*k,g+=t*ee,A+=t*te,W+=t*re,J+=t*ne,X+=t*ie,$+=t*ue,C+=t*ae,P+=t*fe,j+=t*he,I+=t*oe,H+=t*se,K+=t*le,z+=t*De,Y+=t*ce,t=E[7],M+=t*Q,g+=t*k,A+=t*ee,W+=t*te,J+=t*re,X+=t*ne,$+=t*ie,C+=t*ue,P+=t*ae,j+=t*fe,I+=t*he,H+=t*oe,K+=t*se,z+=t*le,Y+=t*De,q+=t*ce,t=E[8],g+=t*Q,A+=t*k,W+=t*ee,J+=t*te,X+=t*re,$+=t*ne,C+=t*ie,P+=t*ue,j+=t*ae,I+=t*fe,H+=t*he,K+=t*oe,z+=t*se,Y+=t*le,q+=t*De,G+=t*ce,t=E[9],A+=t*Q,W+=t*k,J+=t*ee,X+=t*te,$+=t*re,C+=t*ne,P+=t*ie,j+=t*ue,I+=t*ae,H+=t*fe,K+=t*he,z+=t*oe,Y+=t*se,q+=t*le,G+=t*De,V+=t*ce,t=E[10],W+=t*Q,J+=t*k,X+=t*ee,$+=t*te,C+=t*re,P+=t*ne,j+=t*ie,I+=t*ue,H+=t*ae,K+=t*fe,z+=t*he,Y+=t*oe,q+=t*se,G+=t*le,V+=t*De,we+=t*ce,t=E[11],J+=t*Q,X+=t*k,$+=t*ee,C+=t*te,P+=t*re,j+=t*ne,I+=t*ie,H+=t*ue,K+=t*ae,z+=t*fe,Y+=t*he,q+=t*oe,G+=t*se,V+=t*le,we+=t*De,ge+=t*ce,t=E[12],X+=t*Q,$+=t*k,C+=t*ee,P+=t*te,j+=t*re,I+=t*ne,H+=t*ie,K+=t*ue,z+=t*ae,Y+=t*fe,q+=t*he,G+=t*oe,V+=t*se,we+=t*le,ge+=t*De,pe+=t*ce,t=E[13],$+=t*Q,C+=t*k,P+=t*ee,j+=t*te,I+=t*re,H+=t*ne,K+=t*ie,z+=t*ue,Y+=t*ae,q+=t*fe,G+=t*he,V+=t*oe,we+=t*se,ge+=t*le,pe+=t*De,Ne+=t*ce,t=E[14],C+=t*Q,P+=t*k,j+=t*ee,I+=t*te,H+=t*re,K+=t*ne,z+=t*ie,Y+=t*ue,q+=t*ae,G+=t*fe,V+=t*he,we+=t*oe,ge+=t*se,pe+=t*le,Ne+=t*De,Ie+=t*ce,t=E[15],P+=t*Q,j+=t*k,I+=t*ee,H+=t*te,K+=t*re,z+=t*ne,Y+=t*ie,q+=t*ue,G+=t*ae,V+=t*fe,we+=t*he,ge+=t*oe,pe+=t*se,Ne+=t*le,Ie+=t*De,tt+=t*ce,y+=38*j,S+=38*I,U+=38*H,L+=38*K,x+=38*z,B+=38*Y,N+=38*q,M+=38*G,g+=38*V,A+=38*we,W+=38*ge,J+=38*pe,X+=38*Ne,$+=38*Ie,C+=38*tt,u=1,t=y+u+65535,u=Math.floor(t/65536),y=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=U+u+65535,u=Math.floor(t/65536),U=t-u*65536,t=L+u+65535,u=Math.floor(t/65536),L=t-u*65536,t=x+u+65535,u=Math.floor(t/65536),x=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=N+u+65535,u=Math.floor(t/65536),N=t-u*65536,t=M+u+65535,u=Math.floor(t/65536),M=t-u*65536,t=g+u+65535,u=Math.floor(t/65536),g=t-u*65536,t=A+u+65535,u=Math.floor(t/65536),A=t-u*65536,t=W+u+65535,u=Math.floor(t/65536),W=t-u*65536,t=J+u+65535,u=Math.floor(t/65536),J=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=$+u+65535,u=Math.floor(t/65536),$=t-u*65536,t=C+u+65535,u=Math.floor(t/65536),C=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,y+=u-1+37*(u-1),u=1,t=y+u+65535,u=Math.floor(t/65536),y=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=U+u+65535,u=Math.floor(t/65536),U=t-u*65536,t=L+u+65535,u=Math.floor(t/65536),L=t-u*65536,t=x+u+65535,u=Math.floor(t/65536),x=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=N+u+65535,u=Math.floor(t/65536),N=t-u*65536,t=M+u+65535,u=Math.floor(t/65536),M=t-u*65536,t=g+u+65535,u=Math.floor(t/65536),g=t-u*65536,t=A+u+65535,u=Math.floor(t/65536),A=t-u*65536,t=W+u+65535,u=Math.floor(t/65536),W=t-u*65536,t=J+u+65535,u=Math.floor(t/65536),J=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=$+u+65535,u=Math.floor(t/65536),$=t-u*65536,t=C+u+65535,u=Math.floor(t/65536),C=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,y+=u-1+37*(u-1),l[0]=y,l[1]=S,l[2]=U,l[3]=L,l[4]=x,l[5]=B,l[6]=N,l[7]=M,l[8]=g,l[9]=A,l[10]=W,l[11]=J,l[12]=X,l[13]=$,l[14]=C,l[15]=P}function _(l,E){d(l,E,E)}function w(l,E){const D=i();for(let t=0;t<16;t++)D[t]=E[t];for(let t=253;t>=0;t--)_(D,D),t!==2&&t!==4&&d(D,D,E);for(let t=0;t<16;t++)l[t]=D[t]}function m(l,E){const D=new Uint8Array(32),t=new Float64Array(80),u=i(),y=i(),S=i(),U=i(),L=i(),x=i();for(let g=0;g<31;g++)D[g]=l[g];D[31]=l[31]&127|64,D[0]&=248,s(t,E);for(let g=0;g<16;g++)y[g]=t[g];u[0]=U[0]=1;for(let g=254;g>=0;--g){const A=D[g>>>3]>>>(g&7)&1;a(u,y,A),a(S,U,A),c(L,u,S),v(u,u,S),c(S,y,U),v(y,y,U),_(U,L),_(x,u),d(u,S,u),d(S,y,L),c(L,u,S),v(u,u,S),_(y,u),v(S,U,x),d(u,S,o),c(u,u,U),d(S,S,u),d(u,U,x),d(U,y,t),_(y,L),a(u,y,A),a(S,U,A)}for(let g=0;g<16;g++)t[g+16]=u[g],t[g+32]=S[g],t[g+48]=y[g],t[g+64]=U[g];const B=t.subarray(32),N=t.subarray(16);w(B,B),d(N,N,B);const M=new Uint8Array(32);return f(M,N),M}e.scalarMult=m;function p(l){return m(l,h)}e.scalarMultBase=p;function O(l){if(l.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const E=new Uint8Array(l);return{publicKey:p(E),secretKey:E}}e.generateKeyPairFromSeed=O;function R(l){const E=(0,r.randomBytes)(32,l),D=O(E);return(0,n.wipe)(E),D}e.generateKeyPair=R;function T(l,E,D=!1){if(l.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(E.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const t=m(l,E);if(D){let u=0;for(let y=0;y<t.length;y++)u|=t[y];if(u===0)throw new Error("X25519: invalid shared key")}return t}e.sharedKey=T})(Ot);function Sr(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var h=0;h<e.length;h++){var o=e.charAt(h),b=o.charCodeAt(0);if(n[b]!==255)throw new TypeError(o+" is ambiguous");n[b]=h}var a=e.length,f=e.charAt(0),s=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function v(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var m=0,p=0,O=0,R=w.length;O!==R&&w[O]===0;)O++,m++;for(var T=(R-O)*c+1>>>0,l=new Uint8Array(T);O!==R;){for(var E=w[O],D=0,t=T-1;(E!==0||D<p)&&t!==-1;t--,D++)E+=256*l[t]>>>0,l[t]=E%a>>>0,E=E/a>>>0;if(E!==0)throw new Error("Non-zero carry");p=D,O++}for(var u=T-p;u!==T&&l[u]===0;)u++;for(var y=f.repeat(m);u<T;++u)y+=e.charAt(l[u]);return y}function d(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var m=0;if(w[m]!==" "){for(var p=0,O=0;w[m]===f;)p++,m++;for(var R=(w.length-m)*s+1>>>0,T=new Uint8Array(R);w[m];){var l=n[w.charCodeAt(m)];if(l===255)return;for(var E=0,D=R-1;(l!==0||E<O)&&D!==-1;D--,E++)l+=a*T[D]>>>0,T[D]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");O=E,m++}if(w[m]!==" "){for(var t=R-O;t!==R&&T[t]===0;)t++;for(var u=new Uint8Array(p+(R-t)),y=p;t!==R;)u[y++]=T[t++];return u}}}function _(w){var m=d(w);if(m)return m;throw new Error(`Non-${r} character`)}return{encode:v,decodeUnsafe:d,decode:_}}var pr=Sr,Cr=pr;const mr=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ur=e=>new TextEncoder().encode(e),Ar=e=>new TextDecoder().decode(e);class Or{constructor(r,n,i){this.name=r,this.prefix=n,this.baseEncode=i}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Tr{constructor(r,n,i){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Tt(this,r)}}class Nr{constructor(r){this.decoders=r}or(r){return Tt(this,r)}decode(r){const n=r[0],i=this.decoders[n];if(i)return i.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Tt=(e,r)=>new Nr({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Mr{constructor(r,n,i,h){this.name=r,this.prefix=n,this.baseEncode=i,this.baseDecode=h,this.encoder=new Or(r,n,i),this.decoder=new Tr(r,n,h)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const Re=({name:e,prefix:r,encode:n,decode:i})=>new Mr(e,r,n,i),Te=({prefix:e,name:r,alphabet:n})=>{const{encode:i,decode:h}=Cr(n,r);return Re({prefix:e,name:r,encode:i,decode:o=>mr(h(o))})},Fr=(e,r,n,i)=>{const h={};for(let c=0;c<r.length;++c)h[r[c]]=c;let o=e.length;for(;e[o-1]==="=";)--o;const b=new Uint8Array(o*n/8|0);let a=0,f=0,s=0;for(let c=0;c<o;++c){const v=h[e[c]];if(v===void 0)throw new SyntaxError(`Non-${i} character`);f=f<<n|v,a+=n,a>=8&&(a-=8,b[s++]=255&f>>a)}if(a>=n||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return b},Lr=(e,r,n)=>{const i=r[r.length-1]==="=",h=(1<<n)-1;let o="",b=0,a=0;for(let f=0;f<e.length;++f)for(a=a<<8|e[f],b+=8;b>n;)b-=n,o+=r[h&a>>b];if(b&&(o+=r[h&a<<n-b]),i)for(;o.length*n&7;)o+="=";return o},Z=({name:e,prefix:r,bitsPerChar:n,alphabet:i})=>Re({prefix:r,name:e,encode(h){return Lr(h,i,n)},decode(h){return Fr(h,i,n,e)}}),Br=Re({prefix:"\0",name:"identity",encode:e=>Ar(e),decode:e=>Ur(e)}),xr=Object.freeze(Object.defineProperty({__proto__:null,identity:Br},Symbol.toStringTag,{value:"Module"})),Pr=Z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Rr=Object.freeze(Object.defineProperty({__proto__:null,base2:Pr},Symbol.toStringTag,{value:"Module"})),jr=Z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Ir=Object.freeze(Object.defineProperty({__proto__:null,base8:jr},Symbol.toStringTag,{value:"Module"})),Hr=Te({prefix:"9",name:"base10",alphabet:"0123456789"}),Kr=Object.freeze(Object.defineProperty({__proto__:null,base10:Hr},Symbol.toStringTag,{value:"Module"})),zr=Z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Yr=Z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),qr=Object.freeze(Object.defineProperty({__proto__:null,base16:zr,base16upper:Yr},Symbol.toStringTag,{value:"Module"})),Gr=Z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Wr=Z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vr=Z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$r=Z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Xr=Z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Jr=Z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=Z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qr=Z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kr=Z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),en=Object.freeze(Object.defineProperty({__proto__:null,base32:Gr,base32hex:Xr,base32hexpad:Zr,base32hexpadupper:Qr,base32hexupper:Jr,base32pad:Vr,base32padupper:$r,base32upper:Wr,base32z:kr},Symbol.toStringTag,{value:"Module"})),tn=Te({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rn=Te({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),nn=Object.freeze(Object.defineProperty({__proto__:null,base36:tn,base36upper:rn},Symbol.toStringTag,{value:"Module"})),un=Te({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),an=Te({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),fn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:un,base58flickr:an},Symbol.toStringTag,{value:"Module"})),hn=Z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),on=Z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),sn=Z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=Z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base64:hn,base64pad:on,base64url:sn,base64urlpad:ln},Symbol.toStringTag,{value:"Module"})),Nt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),cn=Nt.reduce((e,r,n)=>(e[n]=r,e),[]),_n=Nt.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function dn(e){return e.reduce((r,n)=>(r+=cn[n],r),"")}function En(e){const r=[];for(const n of e){const i=_n[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(i)}return new Uint8Array(r)}const bn=Re({prefix:"🚀",name:"base256emoji",encode:dn,decode:En}),wn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:bn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var Mt={};/*! *****************************************************************************
|
|
1
|
+
"use strict";const Ue=require("./index-Bh_VUH6w.js");function Bt(e,r){for(var n=0;n<r.length;n++){const i=r[n];if(typeof i!="string"&&!Array.isArray(i)){for(const h in i)if(h!=="default"&&!(h in e)){const o=Object.getOwnPropertyDescriptor(i,h);o&&Object.defineProperty(e,h,o.get?o:{enumerable:!0,get:()=>i[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Qe=Ue.requireHash();const _t=Ue.getDefaultExportFromCjs(Qe),xt=Bt({__proto__:null,default:_t},[Qe]);var dt={},Le={},F={},Et={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(a,f){var s=a>>>16&65535,c=a&65535,v=f>>>16&65535,d=f&65535;return c*d+(s*d+c*v<<16>>>0)|0}e.mul=Math.imul||r;function n(a,f){return a+f|0}e.add=n;function i(a,f){return a-f|0}e.sub=i;function h(a,f){return a<<f|a>>>32-f}e.rotl=h;function o(a,f){return a<<32-f|a>>>f}e.rotr=o;function b(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a}e.isInteger=Number.isInteger||b,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(a){return e.isInteger(a)&&a>=-e.MAX_SAFE_INTEGER&&a<=e.MAX_SAFE_INTEGER}})(Et);Object.defineProperty(F,"__esModule",{value:!0});var bt=Et;function Pt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}F.readInt16BE=Pt;function Rt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}F.readUint16BE=Rt;function jt(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}F.readInt16LE=jt;function It(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}F.readUint16LE=It;function wt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}F.writeUint16BE=wt;F.writeInt16BE=wt;function vt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}F.writeUint16LE=vt;F.writeInt16LE=vt;function qe(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}F.readInt32BE=qe;function Ge(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}F.readUint32BE=Ge;function We(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}F.readInt32LE=We;function Ve(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}F.readUint32LE=Ve;function Me(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}F.writeUint32BE=Me;F.writeInt32BE=Me;function Fe(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}F.writeUint32LE=Fe;F.writeInt32LE=Fe;function Ht(e,r){r===void 0&&(r=0);var n=qe(e,r),i=qe(e,r+4);return n*4294967296+i-(i>>31)*4294967296}F.readInt64BE=Ht;function Kt(e,r){r===void 0&&(r=0);var n=Ge(e,r),i=Ge(e,r+4);return n*4294967296+i}F.readUint64BE=Kt;function zt(e,r){r===void 0&&(r=0);var n=We(e,r),i=We(e,r+4);return i*4294967296+n-(n>>31)*4294967296}F.readInt64LE=zt;function Yt(e,r){r===void 0&&(r=0);var n=Ve(e,r),i=Ve(e,r+4);return i*4294967296+n}F.readUint64LE=Yt;function yt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Me(e/4294967296>>>0,r,n),Me(e>>>0,r,n+4),r}F.writeUint64BE=yt;F.writeInt64BE=yt;function gt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Fe(e>>>0,r,n),Fe(e/4294967296>>>0,r,n+4),r}F.writeUint64LE=gt;F.writeInt64LE=gt;function qt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,h=1,o=e/8+n-1;o>=n;o--)i+=r[o]*h,h*=256;return i}F.readUintBE=qt;function Gt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,h=1,o=n;o<n+e/8;o++)i+=r[o]*h,h*=256;return i}F.readUintLE=Gt;function Wt(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!bt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var h=1,o=e/8+i-1;o>=i;o--)n[o]=r/h&255,h*=256;return n}F.writeUintBE=Wt;function Vt(e,r,n,i){if(n===void 0&&(n=new Uint8Array(e/8)),i===void 0&&(i=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!bt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var h=1,o=i;o<i+e/8;o++)n[o]=r/h&255,h*=256;return n}F.writeUintLE=Vt;function $t(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}F.readFloat32BE=$t;function Xt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}F.readFloat32LE=Xt;function Jt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}F.readFloat64BE=Jt;function Zt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}F.readFloat64LE=Zt;function Qt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e),r}F.writeFloat32BE=Qt;function kt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat32(n,e,!0),r}F.writeFloat32LE=kt;function er(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e),r}F.writeFloat64BE=er;function tr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var i=new DataView(r.buffer,r.byteOffset,r.byteLength);return i.setFloat64(n,e,!0),r}F.writeFloat64LE=tr;var de={};Object.defineProperty(de,"__esModule",{value:!0});function rr(e){for(var r=0;r<e.length;r++)e[r]=0;return e}de.wipe=rr;Object.defineProperty(Le,"__esModule",{value:!0});var _e=F,$e=de,nr=20;function ir(e,r,n){for(var i=1634760805,h=857760878,o=2036477234,b=1797285236,a=n[3]<<24|n[2]<<16|n[1]<<8|n[0],f=n[7]<<24|n[6]<<16|n[5]<<8|n[4],s=n[11]<<24|n[10]<<16|n[9]<<8|n[8],c=n[15]<<24|n[14]<<16|n[13]<<8|n[12],v=n[19]<<24|n[18]<<16|n[17]<<8|n[16],d=n[23]<<24|n[22]<<16|n[21]<<8|n[20],_=n[27]<<24|n[26]<<16|n[25]<<8|n[24],w=n[31]<<24|n[30]<<16|n[29]<<8|n[28],m=r[3]<<24|r[2]<<16|r[1]<<8|r[0],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],R=r[15]<<24|r[14]<<16|r[13]<<8|r[12],T=i,l=h,E=o,D=b,t=a,u=f,y=s,S=c,U=v,L=d,x=_,B=w,N=m,M=p,g=O,A=R,W=0;W<nr;W+=2)T=T+t|0,N^=T,N=N>>>16|N<<16,U=U+N|0,t^=U,t=t>>>20|t<<12,l=l+u|0,M^=l,M=M>>>16|M<<16,L=L+M|0,u^=L,u=u>>>20|u<<12,E=E+y|0,g^=E,g=g>>>16|g<<16,x=x+g|0,y^=x,y=y>>>20|y<<12,D=D+S|0,A^=D,A=A>>>16|A<<16,B=B+A|0,S^=B,S=S>>>20|S<<12,E=E+y|0,g^=E,g=g>>>24|g<<8,x=x+g|0,y^=x,y=y>>>25|y<<7,D=D+S|0,A^=D,A=A>>>24|A<<8,B=B+A|0,S^=B,S=S>>>25|S<<7,l=l+u|0,M^=l,M=M>>>24|M<<8,L=L+M|0,u^=L,u=u>>>25|u<<7,T=T+t|0,N^=T,N=N>>>24|N<<8,U=U+N|0,t^=U,t=t>>>25|t<<7,T=T+u|0,A^=T,A=A>>>16|A<<16,x=x+A|0,u^=x,u=u>>>20|u<<12,l=l+y|0,N^=l,N=N>>>16|N<<16,B=B+N|0,y^=B,y=y>>>20|y<<12,E=E+S|0,M^=E,M=M>>>16|M<<16,U=U+M|0,S^=U,S=S>>>20|S<<12,D=D+t|0,g^=D,g=g>>>16|g<<16,L=L+g|0,t^=L,t=t>>>20|t<<12,E=E+S|0,M^=E,M=M>>>24|M<<8,U=U+M|0,S^=U,S=S>>>25|S<<7,D=D+t|0,g^=D,g=g>>>24|g<<8,L=L+g|0,t^=L,t=t>>>25|t<<7,l=l+y|0,N^=l,N=N>>>24|N<<8,B=B+N|0,y^=B,y=y>>>25|y<<7,T=T+u|0,A^=T,A=A>>>24|A<<8,x=x+A|0,u^=x,u=u>>>25|u<<7;_e.writeUint32LE(T+i|0,e,0),_e.writeUint32LE(l+h|0,e,4),_e.writeUint32LE(E+o|0,e,8),_e.writeUint32LE(D+b|0,e,12),_e.writeUint32LE(t+a|0,e,16),_e.writeUint32LE(u+f|0,e,20),_e.writeUint32LE(y+s|0,e,24),_e.writeUint32LE(S+c|0,e,28),_e.writeUint32LE(U+v|0,e,32),_e.writeUint32LE(L+d|0,e,36),_e.writeUint32LE(x+_|0,e,40),_e.writeUint32LE(B+w|0,e,44),_e.writeUint32LE(N+m|0,e,48),_e.writeUint32LE(M+p|0,e,52),_e.writeUint32LE(g+O|0,e,56),_e.writeUint32LE(A+R|0,e,60)}function St(e,r,n,i,h){if(h===void 0&&(h=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<n.length)throw new Error("ChaCha: destination is shorter than source");var o,b;if(h===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");o=new Uint8Array(16),b=o.length-r.length,o.set(r,b)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");o=r,b=h}for(var a=new Uint8Array(64),f=0;f<n.length;f+=64){ir(a,o,e);for(var s=f;s<f+64&&s<n.length;s++)i[s]=n[s]^a[s-f];ar(o,0,b)}return $e.wipe(a),h===0&&$e.wipe(o),i}Le.streamXOR=St;function ur(e,r,n,i){return i===void 0&&(i=0),$e.wipe(n),St(e,r,n,n,i)}Le.stream=ur;function ar(e,r,n){for(var i=1;n--;)i=i+(e[r]&255)|0,e[r]=i&255,i>>>=8,r++;if(i>0)throw new Error("ChaCha: counter overflow")}var pt={},be={};Object.defineProperty(be,"__esModule",{value:!0});function fr(e,r,n){return~(e-1)&r|e-1&n}be.select=fr;function hr(e,r){return(e|0)-(r|0)-1>>>31&1}be.lessOrEqual=hr;function Ct(e,r){if(e.length!==r.length)return 0;for(var n=0,i=0;i<e.length;i++)n|=e[i]^r[i];return 1&n-1>>>8}be.compare=Ct;function or(e,r){return e.length===0||r.length===0?!1:Ct(e,r)!==0}be.equal=or;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=be,n=de;e.DIGEST_LENGTH=16;var i=function(){function b(a){this.digestLength=e.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 f=a[0]|a[1]<<8;this._r[0]=f&8191;var s=a[2]|a[3]<<8;this._r[1]=(f>>>13|s<<3)&8191;var c=a[4]|a[5]<<8;this._r[2]=(s>>>10|c<<6)&7939;var v=a[6]|a[7]<<8;this._r[3]=(c>>>7|v<<9)&8191;var d=a[8]|a[9]<<8;this._r[4]=(v>>>4|d<<12)&255,this._r[5]=d>>>1&8190;var _=a[10]|a[11]<<8;this._r[6]=(d>>>14|_<<2)&8191;var w=a[12]|a[13]<<8;this._r[7]=(_>>>11|w<<5)&8065;var m=a[14]|a[15]<<8;this._r[8]=(w>>>8|m<<8)&8191,this._r[9]=m>>>5&127,this._pad[0]=a[16]|a[17]<<8,this._pad[1]=a[18]|a[19]<<8,this._pad[2]=a[20]|a[21]<<8,this._pad[3]=a[22]|a[23]<<8,this._pad[4]=a[24]|a[25]<<8,this._pad[5]=a[26]|a[27]<<8,this._pad[6]=a[28]|a[29]<<8,this._pad[7]=a[30]|a[31]<<8}return b.prototype._blocks=function(a,f,s){for(var c=this._fin?0:2048,v=this._h[0],d=this._h[1],_=this._h[2],w=this._h[3],m=this._h[4],p=this._h[5],O=this._h[6],R=this._h[7],T=this._h[8],l=this._h[9],E=this._r[0],D=this._r[1],t=this._r[2],u=this._r[3],y=this._r[4],S=this._r[5],U=this._r[6],L=this._r[7],x=this._r[8],B=this._r[9];s>=16;){var N=a[f+0]|a[f+1]<<8;v+=N&8191;var M=a[f+2]|a[f+3]<<8;d+=(N>>>13|M<<3)&8191;var g=a[f+4]|a[f+5]<<8;_+=(M>>>10|g<<6)&8191;var A=a[f+6]|a[f+7]<<8;w+=(g>>>7|A<<9)&8191;var W=a[f+8]|a[f+9]<<8;m+=(A>>>4|W<<12)&8191,p+=W>>>1&8191;var J=a[f+10]|a[f+11]<<8;O+=(W>>>14|J<<2)&8191;var X=a[f+12]|a[f+13]<<8;R+=(J>>>11|X<<5)&8191;var $=a[f+14]|a[f+15]<<8;T+=(X>>>8|$<<8)&8191,l+=$>>>5|c;var C=0,P=C;P+=v*E,P+=d*(5*B),P+=_*(5*x),P+=w*(5*L),P+=m*(5*U),C=P>>>13,P&=8191,P+=p*(5*S),P+=O*(5*y),P+=R*(5*u),P+=T*(5*t),P+=l*(5*D),C+=P>>>13,P&=8191;var j=C;j+=v*D,j+=d*E,j+=_*(5*B),j+=w*(5*x),j+=m*(5*L),C=j>>>13,j&=8191,j+=p*(5*U),j+=O*(5*S),j+=R*(5*y),j+=T*(5*u),j+=l*(5*t),C+=j>>>13,j&=8191;var I=C;I+=v*t,I+=d*D,I+=_*E,I+=w*(5*B),I+=m*(5*x),C=I>>>13,I&=8191,I+=p*(5*L),I+=O*(5*U),I+=R*(5*S),I+=T*(5*y),I+=l*(5*u),C+=I>>>13,I&=8191;var H=C;H+=v*u,H+=d*t,H+=_*D,H+=w*E,H+=m*(5*B),C=H>>>13,H&=8191,H+=p*(5*x),H+=O*(5*L),H+=R*(5*U),H+=T*(5*S),H+=l*(5*y),C+=H>>>13,H&=8191;var K=C;K+=v*y,K+=d*u,K+=_*t,K+=w*D,K+=m*E,C=K>>>13,K&=8191,K+=p*(5*B),K+=O*(5*x),K+=R*(5*L),K+=T*(5*U),K+=l*(5*S),C+=K>>>13,K&=8191;var z=C;z+=v*S,z+=d*y,z+=_*u,z+=w*t,z+=m*D,C=z>>>13,z&=8191,z+=p*E,z+=O*(5*B),z+=R*(5*x),z+=T*(5*L),z+=l*(5*U),C+=z>>>13,z&=8191;var Y=C;Y+=v*U,Y+=d*S,Y+=_*y,Y+=w*u,Y+=m*t,C=Y>>>13,Y&=8191,Y+=p*D,Y+=O*E,Y+=R*(5*B),Y+=T*(5*x),Y+=l*(5*L),C+=Y>>>13,Y&=8191;var q=C;q+=v*L,q+=d*U,q+=_*S,q+=w*y,q+=m*u,C=q>>>13,q&=8191,q+=p*t,q+=O*D,q+=R*E,q+=T*(5*B),q+=l*(5*x),C+=q>>>13,q&=8191;var G=C;G+=v*x,G+=d*L,G+=_*U,G+=w*S,G+=m*y,C=G>>>13,G&=8191,G+=p*u,G+=O*t,G+=R*D,G+=T*E,G+=l*(5*B),C+=G>>>13,G&=8191;var V=C;V+=v*B,V+=d*x,V+=_*L,V+=w*U,V+=m*S,C=V>>>13,V&=8191,V+=p*y,V+=O*u,V+=R*t,V+=T*D,V+=l*E,C+=V>>>13,V&=8191,C=(C<<2)+C|0,C=C+P|0,P=C&8191,C=C>>>13,j+=C,v=P,d=j,_=I,w=H,m=K,p=z,O=Y,R=q,T=G,l=V,f+=16,s-=16}this._h[0]=v,this._h[1]=d,this._h[2]=_,this._h[3]=w,this._h[4]=m,this._h[5]=p,this._h[6]=O,this._h[7]=R,this._h[8]=T,this._h[9]=l},b.prototype.finish=function(a,f){f===void 0&&(f=0);var s=new Uint16Array(10),c,v,d,_;if(this._leftover){for(_=this._leftover,this._buffer[_++]=1;_<16;_++)this._buffer[_]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(c=this._h[1]>>>13,this._h[1]&=8191,_=2;_<10;_++)this._h[_]+=c,c=this._h[_]>>>13,this._h[_]&=8191;for(this._h[0]+=c*5,c=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=c,c=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=c,s[0]=this._h[0]+5,c=s[0]>>>13,s[0]&=8191,_=1;_<10;_++)s[_]=this._h[_]+c,c=s[_]>>>13,s[_]&=8191;for(s[9]-=8192,v=(c^1)-1,_=0;_<10;_++)s[_]&=v;for(v=~v,_=0;_<10;_++)this._h[_]=this._h[_]&v|s[_];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,d=this._h[0]+this._pad[0],this._h[0]=d&65535,_=1;_<8;_++)d=(this._h[_]+this._pad[_]|0)+(d>>>16)|0,this._h[_]=d&65535;return a[f+0]=this._h[0]>>>0,a[f+1]=this._h[0]>>>8,a[f+2]=this._h[1]>>>0,a[f+3]=this._h[1]>>>8,a[f+4]=this._h[2]>>>0,a[f+5]=this._h[2]>>>8,a[f+6]=this._h[3]>>>0,a[f+7]=this._h[3]>>>8,a[f+8]=this._h[4]>>>0,a[f+9]=this._h[4]>>>8,a[f+10]=this._h[5]>>>0,a[f+11]=this._h[5]>>>8,a[f+12]=this._h[6]>>>0,a[f+13]=this._h[6]>>>8,a[f+14]=this._h[7]>>>0,a[f+15]=this._h[7]>>>8,this._finished=!0,this},b.prototype.update=function(a){var f=0,s=a.length,c;if(this._leftover){c=16-this._leftover,c>s&&(c=s);for(var v=0;v<c;v++)this._buffer[this._leftover+v]=a[f+v];if(s-=c,f+=c,this._leftover+=c,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(s>=16&&(c=s-s%16,this._blocks(a,f,c),f+=c,s-=c),s){for(var v=0;v<s;v++)this._buffer[this._leftover+v]=a[f+v];this._leftover+=s}return this},b.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var a=new Uint8Array(16);return this.finish(a),a},b.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},b}();e.Poly1305=i;function h(b,a){var f=new i(b);f.update(a);var s=f.digest();return f.clean(),s}e.oneTimeAuth=h;function o(b,a){return b.length!==e.DIGEST_LENGTH||a.length!==e.DIGEST_LENGTH?!1:r.equal(b,a)}e.equal=o})(pt);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=Le,n=pt,i=de,h=F,o=be;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var b=new Uint8Array(16),a=function(){function f(s){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,s.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(s)}return f.prototype.seal=function(s,c,v,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var _=new Uint8Array(16);_.set(s,_.length-s.length);var w=new Uint8Array(32);r.stream(this._key,_,w,4);var m=c.length+this.tagLength,p;if(d){if(d.length!==m)throw new Error("ChaCha20Poly1305: incorrect destination length");p=d}else p=new Uint8Array(m);return r.streamXOR(this._key,_,c,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),w,p.subarray(0,p.length-this.tagLength),v),i.wipe(_),p},f.prototype.open=function(s,c,v,d){if(s.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(c.length<this.tagLength)return null;var _=new Uint8Array(16);_.set(s,_.length-s.length);var w=new Uint8Array(32);r.stream(this._key,_,w,4);var m=new Uint8Array(this.tagLength);if(this._authenticate(m,w,c.subarray(0,c.length-this.tagLength),v),!o.equal(m,c.subarray(c.length-this.tagLength,c.length)))return null;var p=c.length-this.tagLength,O;if(d){if(d.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");O=d}else O=new Uint8Array(p);return r.streamXOR(this._key,_,c.subarray(0,c.length-this.tagLength),O,4),i.wipe(_),O},f.prototype.clean=function(){return i.wipe(this._key),this},f.prototype._authenticate=function(s,c,v,d){var _=new n.Poly1305(c);d&&(_.update(d),d.length%16>0&&_.update(b.subarray(d.length%16))),_.update(v),v.length%16>0&&_.update(b.subarray(v.length%16));var w=new Uint8Array(8);d&&h.writeUint64LE(d.length,w),_.update(w),h.writeUint64LE(v.length,w),_.update(w);for(var m=_.digest(),p=0;p<m.length;p++)s[p]=m[p];_.clean(),i.wipe(m),i.wipe(w)},f}();e.ChaCha20Poly1305=a})(dt);var mt={},Oe={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});function sr(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}ke.isSerializableHash=sr;Object.defineProperty(Oe,"__esModule",{value:!0});var Ee=ke,lr=be,Dr=de,Ut=function(){function e(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(i).clean():i.set(n);for(var h=0;h<i.length;h++)i[h]^=54;this._inner.update(i);for(var h=0;h<i.length;h++)i[h]^=106;this._outer.update(i),Ee.isSerializableHash(this._inner)&&Ee.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Dr.wipe(i)}return e.prototype.reset=function(){if(!Ee.isSerializableHash(this._inner)||!Ee.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},e.prototype.clean=function(){Ee.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ee.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(r){return this._inner.update(r),this},e.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},e.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},e.prototype.saveState=function(){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(r){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(r){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},e}();Oe.HMAC=Ut;function cr(e,r,n){var i=new Ut(e,r);i.update(n);var h=i.digest();return i.clean(),h}Oe.hmac=cr;Oe.equal=lr.equal;Object.defineProperty(mt,"__esModule",{value:!0});var rt=Oe,nt=de,_r=function(){function e(r,n,i,h){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=h;var o=rt.hmac(this._hash,i,n);this._hmac=new rt.HMAC(r,o),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>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},e.prototype.expand=function(r){for(var n=new Uint8Array(r),i=0;i<n.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[i]=this._buffer[this._bufpos++];return n},e.prototype.clean=function(){this._hmac.clean(),nt.wipe(this._buffer),nt.wipe(this._counter),this._bufpos=0},e}(),dr=mt.HKDF=_r,et={},Be={},xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.BrowserRandomSource=void 0;const it=65536;class Er{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let i=0;i<n.length;i+=it)this._crypto.getRandomValues(n.subarray(i,i+Math.min(n.length-i,it)));return n}}xe.BrowserRandomSource=Er;var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.NodeRandomSource=void 0;const br=de;class wr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Ue.commonjsRequire<"u"){const r=Ue.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(r);for(let h=0;h<i.length;h++)i[h]=n[h];return(0,br.wipe)(n),i}}Pe.NodeRandomSource=wr;Object.defineProperty(Be,"__esModule",{value:!0});Be.SystemRandomSource=void 0;const vr=xe,yr=Pe;class gr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new vr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new yr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}Be.SystemRandomSource=gr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=Be,n=F,i=de;e.defaultRandomSource=new r.SystemRandomSource;function h(s,c=e.defaultRandomSource){return c.randomBytes(s)}e.randomBytes=h;function o(s=e.defaultRandomSource){const c=h(4,s),v=(0,n.readUint32LE)(c);return(0,i.wipe)(c),v}e.randomUint32=o;const b="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(s,c=b,v=e.defaultRandomSource){if(c.length<2)throw new Error("randomString charset is too short");if(c.length>256)throw new Error("randomString charset is too long");let d="";const _=c.length,w=256-256%_;for(;s>0;){const m=h(Math.ceil(s*256/w),v);for(let p=0;p<m.length&&s>0;p++){const O=m[p];O<w&&(d+=c.charAt(O%_),s--)}(0,i.wipe)(m)}return d}e.randomString=a;function f(s,c=b,v=e.defaultRandomSource){const d=Math.ceil(s/(Math.log(c.length)/Math.LN2));return a(d,c,v)}e.randomStringForEntropy=f})(et);var At={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=F,n=de;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var i=function(){function a(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.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 a.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},a.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},a.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},a.prototype.update=function(f,s){if(s===void 0&&(s=f.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var c=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&s>0;)this._buffer[this._bufferLength++]=f[c++],s--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(c=o(this._temp,this._state,f,c,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=f[c++],s--;return this},a.prototype.finish=function(f){if(!this._finished){var s=this._bytesHashed,c=this._bufferLength,v=s/536870912|0,d=s<<3,_=s%64<56?64:128;this._buffer[c]=128;for(var w=c+1;w<_-8;w++)this._buffer[w]=0;r.writeUint32BE(v,this._buffer,_-8),r.writeUint32BE(d,this._buffer,_-4),o(this._temp,this._state,this._buffer,0,_),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)r.writeUint32BE(this._state[w],f,w*4);return this},a.prototype.digest=function(){var f=new Uint8Array(this.digestLength);return this.finish(f),f},a.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}},a.prototype.restoreState=function(f){return this._state.set(f.state),this._bufferLength=f.bufferLength,f.buffer&&this._buffer.set(f.buffer),this._bytesHashed=f.bytesHashed,this._finished=!1,this},a.prototype.cleanSavedState=function(f){n.wipe(f.state),f.buffer&&n.wipe(f.buffer),f.bufferLength=0,f.bytesHashed=0},a}();e.SHA256=i;var h=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 o(a,f,s,c,v){for(;v>=64;){for(var d=f[0],_=f[1],w=f[2],m=f[3],p=f[4],O=f[5],R=f[6],T=f[7],l=0;l<16;l++){var E=c+l*4;a[l]=r.readUint32BE(s,E)}for(var l=16;l<64;l++){var D=a[l-2],t=(D>>>17|D<<15)^(D>>>19|D<<13)^D>>>10;D=a[l-15];var u=(D>>>7|D<<25)^(D>>>18|D<<14)^D>>>3;a[l]=(t+a[l-7]|0)+(u+a[l-16]|0)}for(var l=0;l<64;l++){var t=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&O^~p&R)|0)+(T+(h[l]+a[l]|0)|0)|0,u=((d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10))+(d&_^d&w^_&w)|0;T=R,R=O,O=p,p=m+t|0,m=w,w=_,_=d,d=t+u|0}f[0]+=d,f[1]+=_,f[2]+=w,f[3]+=m,f[4]+=p,f[5]+=O,f[6]+=R,f[7]+=T,c+=64,v-=64}return c}function b(a){var f=new i;f.update(a);var s=f.digest();return f.clean(),s}e.hash=b})(At);var Ot={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const r=et,n=de;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function i(l){const E=new Float64Array(16);if(l)for(let D=0;D<l.length;D++)E[D]=l[D];return E}const h=new Uint8Array(32);h[0]=9;const o=i([56129,1]);function b(l){let E=1;for(let D=0;D<16;D++){let t=l[D]+E+65535;E=Math.floor(t/65536),l[D]=t-E*65536}l[0]+=E-1+37*(E-1)}function a(l,E,D){const t=~(D-1);for(let u=0;u<16;u++){const y=t&(l[u]^E[u]);l[u]^=y,E[u]^=y}}function f(l,E){const D=i(),t=i();for(let u=0;u<16;u++)t[u]=E[u];b(t),b(t),b(t);for(let u=0;u<2;u++){D[0]=t[0]-65517;for(let S=1;S<15;S++)D[S]=t[S]-65535-(D[S-1]>>16&1),D[S-1]&=65535;D[15]=t[15]-32767-(D[14]>>16&1);const y=D[15]>>16&1;D[14]&=65535,a(t,D,1-y)}for(let u=0;u<16;u++)l[2*u]=t[u]&255,l[2*u+1]=t[u]>>8}function s(l,E){for(let D=0;D<16;D++)l[D]=E[2*D]+(E[2*D+1]<<8);l[15]&=32767}function c(l,E,D){for(let t=0;t<16;t++)l[t]=E[t]+D[t]}function v(l,E,D){for(let t=0;t<16;t++)l[t]=E[t]-D[t]}function d(l,E,D){let t,u,y=0,S=0,U=0,L=0,x=0,B=0,N=0,M=0,g=0,A=0,W=0,J=0,X=0,$=0,C=0,P=0,j=0,I=0,H=0,K=0,z=0,Y=0,q=0,G=0,V=0,we=0,ge=0,pe=0,Ne=0,Ie=0,tt=0,Q=D[0],k=D[1],ee=D[2],te=D[3],re=D[4],ne=D[5],ie=D[6],ue=D[7],ae=D[8],fe=D[9],he=D[10],oe=D[11],se=D[12],le=D[13],De=D[14],ce=D[15];t=E[0],y+=t*Q,S+=t*k,U+=t*ee,L+=t*te,x+=t*re,B+=t*ne,N+=t*ie,M+=t*ue,g+=t*ae,A+=t*fe,W+=t*he,J+=t*oe,X+=t*se,$+=t*le,C+=t*De,P+=t*ce,t=E[1],S+=t*Q,U+=t*k,L+=t*ee,x+=t*te,B+=t*re,N+=t*ne,M+=t*ie,g+=t*ue,A+=t*ae,W+=t*fe,J+=t*he,X+=t*oe,$+=t*se,C+=t*le,P+=t*De,j+=t*ce,t=E[2],U+=t*Q,L+=t*k,x+=t*ee,B+=t*te,N+=t*re,M+=t*ne,g+=t*ie,A+=t*ue,W+=t*ae,J+=t*fe,X+=t*he,$+=t*oe,C+=t*se,P+=t*le,j+=t*De,I+=t*ce,t=E[3],L+=t*Q,x+=t*k,B+=t*ee,N+=t*te,M+=t*re,g+=t*ne,A+=t*ie,W+=t*ue,J+=t*ae,X+=t*fe,$+=t*he,C+=t*oe,P+=t*se,j+=t*le,I+=t*De,H+=t*ce,t=E[4],x+=t*Q,B+=t*k,N+=t*ee,M+=t*te,g+=t*re,A+=t*ne,W+=t*ie,J+=t*ue,X+=t*ae,$+=t*fe,C+=t*he,P+=t*oe,j+=t*se,I+=t*le,H+=t*De,K+=t*ce,t=E[5],B+=t*Q,N+=t*k,M+=t*ee,g+=t*te,A+=t*re,W+=t*ne,J+=t*ie,X+=t*ue,$+=t*ae,C+=t*fe,P+=t*he,j+=t*oe,I+=t*se,H+=t*le,K+=t*De,z+=t*ce,t=E[6],N+=t*Q,M+=t*k,g+=t*ee,A+=t*te,W+=t*re,J+=t*ne,X+=t*ie,$+=t*ue,C+=t*ae,P+=t*fe,j+=t*he,I+=t*oe,H+=t*se,K+=t*le,z+=t*De,Y+=t*ce,t=E[7],M+=t*Q,g+=t*k,A+=t*ee,W+=t*te,J+=t*re,X+=t*ne,$+=t*ie,C+=t*ue,P+=t*ae,j+=t*fe,I+=t*he,H+=t*oe,K+=t*se,z+=t*le,Y+=t*De,q+=t*ce,t=E[8],g+=t*Q,A+=t*k,W+=t*ee,J+=t*te,X+=t*re,$+=t*ne,C+=t*ie,P+=t*ue,j+=t*ae,I+=t*fe,H+=t*he,K+=t*oe,z+=t*se,Y+=t*le,q+=t*De,G+=t*ce,t=E[9],A+=t*Q,W+=t*k,J+=t*ee,X+=t*te,$+=t*re,C+=t*ne,P+=t*ie,j+=t*ue,I+=t*ae,H+=t*fe,K+=t*he,z+=t*oe,Y+=t*se,q+=t*le,G+=t*De,V+=t*ce,t=E[10],W+=t*Q,J+=t*k,X+=t*ee,$+=t*te,C+=t*re,P+=t*ne,j+=t*ie,I+=t*ue,H+=t*ae,K+=t*fe,z+=t*he,Y+=t*oe,q+=t*se,G+=t*le,V+=t*De,we+=t*ce,t=E[11],J+=t*Q,X+=t*k,$+=t*ee,C+=t*te,P+=t*re,j+=t*ne,I+=t*ie,H+=t*ue,K+=t*ae,z+=t*fe,Y+=t*he,q+=t*oe,G+=t*se,V+=t*le,we+=t*De,ge+=t*ce,t=E[12],X+=t*Q,$+=t*k,C+=t*ee,P+=t*te,j+=t*re,I+=t*ne,H+=t*ie,K+=t*ue,z+=t*ae,Y+=t*fe,q+=t*he,G+=t*oe,V+=t*se,we+=t*le,ge+=t*De,pe+=t*ce,t=E[13],$+=t*Q,C+=t*k,P+=t*ee,j+=t*te,I+=t*re,H+=t*ne,K+=t*ie,z+=t*ue,Y+=t*ae,q+=t*fe,G+=t*he,V+=t*oe,we+=t*se,ge+=t*le,pe+=t*De,Ne+=t*ce,t=E[14],C+=t*Q,P+=t*k,j+=t*ee,I+=t*te,H+=t*re,K+=t*ne,z+=t*ie,Y+=t*ue,q+=t*ae,G+=t*fe,V+=t*he,we+=t*oe,ge+=t*se,pe+=t*le,Ne+=t*De,Ie+=t*ce,t=E[15],P+=t*Q,j+=t*k,I+=t*ee,H+=t*te,K+=t*re,z+=t*ne,Y+=t*ie,q+=t*ue,G+=t*ae,V+=t*fe,we+=t*he,ge+=t*oe,pe+=t*se,Ne+=t*le,Ie+=t*De,tt+=t*ce,y+=38*j,S+=38*I,U+=38*H,L+=38*K,x+=38*z,B+=38*Y,N+=38*q,M+=38*G,g+=38*V,A+=38*we,W+=38*ge,J+=38*pe,X+=38*Ne,$+=38*Ie,C+=38*tt,u=1,t=y+u+65535,u=Math.floor(t/65536),y=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=U+u+65535,u=Math.floor(t/65536),U=t-u*65536,t=L+u+65535,u=Math.floor(t/65536),L=t-u*65536,t=x+u+65535,u=Math.floor(t/65536),x=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=N+u+65535,u=Math.floor(t/65536),N=t-u*65536,t=M+u+65535,u=Math.floor(t/65536),M=t-u*65536,t=g+u+65535,u=Math.floor(t/65536),g=t-u*65536,t=A+u+65535,u=Math.floor(t/65536),A=t-u*65536,t=W+u+65535,u=Math.floor(t/65536),W=t-u*65536,t=J+u+65535,u=Math.floor(t/65536),J=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=$+u+65535,u=Math.floor(t/65536),$=t-u*65536,t=C+u+65535,u=Math.floor(t/65536),C=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,y+=u-1+37*(u-1),u=1,t=y+u+65535,u=Math.floor(t/65536),y=t-u*65536,t=S+u+65535,u=Math.floor(t/65536),S=t-u*65536,t=U+u+65535,u=Math.floor(t/65536),U=t-u*65536,t=L+u+65535,u=Math.floor(t/65536),L=t-u*65536,t=x+u+65535,u=Math.floor(t/65536),x=t-u*65536,t=B+u+65535,u=Math.floor(t/65536),B=t-u*65536,t=N+u+65535,u=Math.floor(t/65536),N=t-u*65536,t=M+u+65535,u=Math.floor(t/65536),M=t-u*65536,t=g+u+65535,u=Math.floor(t/65536),g=t-u*65536,t=A+u+65535,u=Math.floor(t/65536),A=t-u*65536,t=W+u+65535,u=Math.floor(t/65536),W=t-u*65536,t=J+u+65535,u=Math.floor(t/65536),J=t-u*65536,t=X+u+65535,u=Math.floor(t/65536),X=t-u*65536,t=$+u+65535,u=Math.floor(t/65536),$=t-u*65536,t=C+u+65535,u=Math.floor(t/65536),C=t-u*65536,t=P+u+65535,u=Math.floor(t/65536),P=t-u*65536,y+=u-1+37*(u-1),l[0]=y,l[1]=S,l[2]=U,l[3]=L,l[4]=x,l[5]=B,l[6]=N,l[7]=M,l[8]=g,l[9]=A,l[10]=W,l[11]=J,l[12]=X,l[13]=$,l[14]=C,l[15]=P}function _(l,E){d(l,E,E)}function w(l,E){const D=i();for(let t=0;t<16;t++)D[t]=E[t];for(let t=253;t>=0;t--)_(D,D),t!==2&&t!==4&&d(D,D,E);for(let t=0;t<16;t++)l[t]=D[t]}function m(l,E){const D=new Uint8Array(32),t=new Float64Array(80),u=i(),y=i(),S=i(),U=i(),L=i(),x=i();for(let g=0;g<31;g++)D[g]=l[g];D[31]=l[31]&127|64,D[0]&=248,s(t,E);for(let g=0;g<16;g++)y[g]=t[g];u[0]=U[0]=1;for(let g=254;g>=0;--g){const A=D[g>>>3]>>>(g&7)&1;a(u,y,A),a(S,U,A),c(L,u,S),v(u,u,S),c(S,y,U),v(y,y,U),_(U,L),_(x,u),d(u,S,u),d(S,y,L),c(L,u,S),v(u,u,S),_(y,u),v(S,U,x),d(u,S,o),c(u,u,U),d(S,S,u),d(u,U,x),d(U,y,t),_(y,L),a(u,y,A),a(S,U,A)}for(let g=0;g<16;g++)t[g+16]=u[g],t[g+32]=S[g],t[g+48]=y[g],t[g+64]=U[g];const B=t.subarray(32),N=t.subarray(16);w(B,B),d(N,N,B);const M=new Uint8Array(32);return f(M,N),M}e.scalarMult=m;function p(l){return m(l,h)}e.scalarMultBase=p;function O(l){if(l.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const E=new Uint8Array(l);return{publicKey:p(E),secretKey:E}}e.generateKeyPairFromSeed=O;function R(l){const E=(0,r.randomBytes)(32,l),D=O(E);return(0,n.wipe)(E),D}e.generateKeyPair=R;function T(l,E,D=!1){if(l.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(E.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const t=m(l,E);if(D){let u=0;for(let y=0;y<t.length;y++)u|=t[y];if(u===0)throw new Error("X25519: invalid shared key")}return t}e.sharedKey=T})(Ot);function Sr(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var h=0;h<e.length;h++){var o=e.charAt(h),b=o.charCodeAt(0);if(n[b]!==255)throw new TypeError(o+" is ambiguous");n[b]=h}var a=e.length,f=e.charAt(0),s=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function v(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var m=0,p=0,O=0,R=w.length;O!==R&&w[O]===0;)O++,m++;for(var T=(R-O)*c+1>>>0,l=new Uint8Array(T);O!==R;){for(var E=w[O],D=0,t=T-1;(E!==0||D<p)&&t!==-1;t--,D++)E+=256*l[t]>>>0,l[t]=E%a>>>0,E=E/a>>>0;if(E!==0)throw new Error("Non-zero carry");p=D,O++}for(var u=T-p;u!==T&&l[u]===0;)u++;for(var y=f.repeat(m);u<T;++u)y+=e.charAt(l[u]);return y}function d(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var m=0;if(w[m]!==" "){for(var p=0,O=0;w[m]===f;)p++,m++;for(var R=(w.length-m)*s+1>>>0,T=new Uint8Array(R);w[m];){var l=n[w.charCodeAt(m)];if(l===255)return;for(var E=0,D=R-1;(l!==0||E<O)&&D!==-1;D--,E++)l+=a*T[D]>>>0,T[D]=l%256>>>0,l=l/256>>>0;if(l!==0)throw new Error("Non-zero carry");O=E,m++}if(w[m]!==" "){for(var t=R-O;t!==R&&T[t]===0;)t++;for(var u=new Uint8Array(p+(R-t)),y=p;t!==R;)u[y++]=T[t++];return u}}}function _(w){var m=d(w);if(m)return m;throw new Error(`Non-${r} character`)}return{encode:v,decodeUnsafe:d,decode:_}}var pr=Sr,Cr=pr;const mr=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ur=e=>new TextEncoder().encode(e),Ar=e=>new TextDecoder().decode(e);class Or{constructor(r,n,i){this.name=r,this.prefix=n,this.baseEncode=i}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Tr{constructor(r,n,i){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=i}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Tt(this,r)}}class Nr{constructor(r){this.decoders=r}or(r){return Tt(this,r)}decode(r){const n=r[0],i=this.decoders[n];if(i)return i.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Tt=(e,r)=>new Nr({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Mr{constructor(r,n,i,h){this.name=r,this.prefix=n,this.baseEncode=i,this.baseDecode=h,this.encoder=new Or(r,n,i),this.decoder=new Tr(r,n,h)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const Re=({name:e,prefix:r,encode:n,decode:i})=>new Mr(e,r,n,i),Te=({prefix:e,name:r,alphabet:n})=>{const{encode:i,decode:h}=Cr(n,r);return Re({prefix:e,name:r,encode:i,decode:o=>mr(h(o))})},Fr=(e,r,n,i)=>{const h={};for(let c=0;c<r.length;++c)h[r[c]]=c;let o=e.length;for(;e[o-1]==="=";)--o;const b=new Uint8Array(o*n/8|0);let a=0,f=0,s=0;for(let c=0;c<o;++c){const v=h[e[c]];if(v===void 0)throw new SyntaxError(`Non-${i} character`);f=f<<n|v,a+=n,a>=8&&(a-=8,b[s++]=255&f>>a)}if(a>=n||255&f<<8-a)throw new SyntaxError("Unexpected end of data");return b},Lr=(e,r,n)=>{const i=r[r.length-1]==="=",h=(1<<n)-1;let o="",b=0,a=0;for(let f=0;f<e.length;++f)for(a=a<<8|e[f],b+=8;b>n;)b-=n,o+=r[h&a>>b];if(b&&(o+=r[h&a<<n-b]),i)for(;o.length*n&7;)o+="=";return o},Z=({name:e,prefix:r,bitsPerChar:n,alphabet:i})=>Re({prefix:r,name:e,encode(h){return Lr(h,i,n)},decode(h){return Fr(h,i,n,e)}}),Br=Re({prefix:"\0",name:"identity",encode:e=>Ar(e),decode:e=>Ur(e)}),xr=Object.freeze(Object.defineProperty({__proto__:null,identity:Br},Symbol.toStringTag,{value:"Module"})),Pr=Z({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Rr=Object.freeze(Object.defineProperty({__proto__:null,base2:Pr},Symbol.toStringTag,{value:"Module"})),jr=Z({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Ir=Object.freeze(Object.defineProperty({__proto__:null,base8:jr},Symbol.toStringTag,{value:"Module"})),Hr=Te({prefix:"9",name:"base10",alphabet:"0123456789"}),Kr=Object.freeze(Object.defineProperty({__proto__:null,base10:Hr},Symbol.toStringTag,{value:"Module"})),zr=Z({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Yr=Z({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),qr=Object.freeze(Object.defineProperty({__proto__:null,base16:zr,base16upper:Yr},Symbol.toStringTag,{value:"Module"})),Gr=Z({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Wr=Z({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Vr=Z({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$r=Z({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Xr=Z({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Jr=Z({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=Z({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Qr=Z({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),kr=Z({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),en=Object.freeze(Object.defineProperty({__proto__:null,base32:Gr,base32hex:Xr,base32hexpad:Zr,base32hexpadupper:Qr,base32hexupper:Jr,base32pad:Vr,base32padupper:$r,base32upper:Wr,base32z:kr},Symbol.toStringTag,{value:"Module"})),tn=Te({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rn=Te({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),nn=Object.freeze(Object.defineProperty({__proto__:null,base36:tn,base36upper:rn},Symbol.toStringTag,{value:"Module"})),un=Te({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),an=Te({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),fn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:un,base58flickr:an},Symbol.toStringTag,{value:"Module"})),hn=Z({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),on=Z({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),sn=Z({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=Z({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base64:hn,base64pad:on,base64url:sn,base64urlpad:ln},Symbol.toStringTag,{value:"Module"})),Nt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),cn=Nt.reduce((e,r,n)=>(e[n]=r,e),[]),_n=Nt.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function dn(e){return e.reduce((r,n)=>(r+=cn[n],r),"")}function En(e){const r=[];for(const n of e){const i=_n[n.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(i)}return new Uint8Array(r)}const bn=Re({prefix:"🚀",name:"base256emoji",encode:dn,decode:En}),wn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:bn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var Mt={};/*! *****************************************************************************
|
|
2
2
|
Copyright (c) Microsoft Corporation.
|
|
3
3
|
|
|
4
4
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Q = Object.defineProperty;
|
|
2
2
|
var j = (t, e, s) => e in t ? Q(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
3
|
var y = (t, e, s) => j(t, typeof e != "symbol" ? e + "" : e, s);
|
|
4
|
-
import { ad as u, aW as Y, aX as I, aY as x, aZ as ee, a_ as ne, a$ as se, X as M, bN as O, bF as ae, bS as E, bT as N, c9 as B, c3 as _, bt as U, s as te, S as b, e as ie, bu as D, ah as T, bs as re, aq as me, bv as R, c8 as oe, bh as ue, g as le } from "./index-
|
|
4
|
+
import { ad as u, aW as Y, aX as I, aY as x, aZ as ee, a_ as ne, a$ as se, X as M, bN as O, bF as ae, bS as E, bT as N, c9 as B, c3 as _, bt as U, s as te, S as b, e as ie, bu as D, ah as T, bs as re, aq as me, bv as R, c8 as oe, bh as ue, g as le } from "./index-BN7FfORx.mjs";
|
|
5
5
|
const h = new u("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
6
6
|
new u("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
7
7
|
const A = new u("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var p=Object.defineProperty;var y=(o,e,t)=>e in o?p(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>y(o,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-
|
|
1
|
+
"use strict";var p=Object.defineProperty;var y=(o,e,t)=>e in o?p(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>y(o,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-Bh_VUH6w.js"),g=require("./aptos-C698CxDU.js");class f{constructor(e,t,n,r,a=!1){i(this,"transaction");i(this,"network");i(this,"chain");i(this,"description");i(this,"parallelizable");this.transaction=e,this.network=t,this.chain=n,this.description=r,this.parallelizable=a}}const w=[{name:"tokenBridgeAddress",...s.universalAddressItem},{name:"chain",...s.chainItem()},{name:"domainSeparator",binary:"bytes",custom:s.bytes.encode(s.APTOS_SEPARATOR),omit:!0},{name:"tokenId",...s.universalAddressItem},{name:"domainSeparator",binary:"bytes",custom:new Uint8Array([255]),omit:!0}],T=o=>s.serialize$1(w,o);class d{constructor(e,t,n,r){i(this,"network");i(this,"chain");i(this,"connection");i(this,"contracts");i(this,"chainId");i(this,"tokenBridgeAddress");this.network=e,this.chain=t,this.connection=n,this.contracts=r,this.chainId=s.toChainId(t);const a=r.tokenBridge;if(!a)throw new Error(`TokenBridge contract Address for chain ${t} not found`);this.tokenBridgeAddress=a}static async fromRpc(e,t){const[n,r]=await g.AptosPlatform.chainFromRpc(e),a=t[r];if(a.network!==n)throw new Error("Network mismatch "+a.network+" !== "+n);return new d(n,r,e,a.contracts)}async isWrappedAsset(e){try{return await this.getOriginalAsset(e),!0}catch{return!1}}async getOriginalAsset(e){const t=e.toString().split(s.APTOS_SEPARATOR),n=await this.connection.getAccountResource({accountAddress:t[0],resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`});if(!n)throw s.ErrNotWrapped(e.toString());const r=s.toChain(parseInt(n.token_chain.number)),a=new s.UniversalAddress(n.token_address.external_address);return{chain:r,address:a}}async getTokenUniversalAddress(e){return new s.UniversalAddress(s.hex.encode(s.sha3_256(e.toString()),!0))}async getTokenNativeAddress(e,t){const n=e===this.chain?await this.getTypeFromExternalAddress(t.toString()):await this.getAssetFullyQualifiedType({chain:e,address:t});if(!n)throw new Error("Invalid asset address.");return new s.AptosAddress(n)}async hasWrappedAsset(e){try{return await this.getWrappedAsset(e),!0}catch{}return!1}async getWrappedAsset(e){if(s.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const t=await this.getAssetFullyQualifiedType(e);if(!t)throw new Error("Invalid asset address.");return await this.connection.getAccountResource({accountAddress:s.coalesceModuleAddress(t),resourceType:`${this.tokenBridgeAddress}::state::OriginInfo`}),s.toNative(this.chain,t)}async isTransferCompleted(e){const n=(await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`})).consumed_vaas.elems.handle;try{return await this.connection.getTableItem({handle:n,data:{key_type:"vector<u8>",value_type:"u8",key:`0x${s.dist.Buffer.from(s.keccak_256(e.hash)).toString("hex")}`}}),!0}catch{return!1}}async getWrappedNative(){return s.toNative(this.chain,s.APTOS_COIN)}async*createAttestation(e,t){const n={chain:this.chain,address:new s.AptosAddress(e)},r=await this.getAssetFullyQualifiedType(n);if(!r)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::attest_token::attest_token_entry`,typeArguments:[r],functionArguments:[]},"Aptos.AttestToken")}async*submitAttestation(e,t){yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin_type`,typeArguments:[],functionArguments:[s.serialize(e)]},"Aptos.CreateWrappedCoinType");const n=await this.getAssetFullyQualifiedType(e.payload.token);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin`,typeArguments:[n],functionArguments:[s.serialize(e)]},"Aptos.CreateWrappedCoin")}async*transfer(e,t,n,r,a){const l=0n,c=0n,h=s.isNative(n)?s.APTOS_COIN:n.toString(),u=t.address.toUniversalAddress().toUint8Array(),A=s.toChainId(t.chain);a?yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_with_payload_entry`,typeArguments:[h],functionArguments:[r,A,u,c,a]},"Aptos.TransferTokensWithPayload"):yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_entry`,typeArguments:[h],functionArguments:[r,A,u,l,c]},"Aptos.TransferTokens")}async*redeem(e,t,n=!0){const r=t.payload.token.chain===this.chain?await this.getTypeFromExternalAddress(t.payload.token.address.toString()):await this.getAssetFullyQualifiedType(t.payload.token);if(!r)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::complete_transfer::submit_vaa_and_register_entry`,typeArguments:[r],functionArguments:[s.serialize(t)]},"Aptos.CompleteTransfer")}async getAssetFullyQualifiedType(e){return e.chain===this.chain?s.isValidAptosType(e.address.toString())?e.address.toString():null:`${d.getForeignAssetAddress(this.chain,this.tokenBridgeAddress,e)}::coin::T`}async getTypeFromExternalAddress(e){try{const t=await this.connection.getAccountResource({accountAddress:this.tokenBridgeAddress,resourceType:`${this.tokenBridgeAddress}::state::State`}),{handle:n}=t.native_infos,r=await this.connection.getTableItem({handle:n,data:{key_type:`${this.tokenBridgeAddress}::token_hash::TokenHash`,value_type:"0x1::type_info::TypeInfo",key:{hash:e}}});return r?[r.account_address,String.fromCharCode(...s.hex.decode(r.module_name)),String.fromCharCode(...s.hex.decode(r.struct_name))].join(s.APTOS_SEPARATOR):null}catch{return null}}static getForeignAssetAddress(e,t,n){if(s.isNative(n.address))throw new Error("Invalid token address");const r=T({chain:n.chain,tokenBridgeAddress:new s.AptosAddress(t).toUniversalAddress(),tokenId:n.address.toUniversalAddress()});return s.hex.encode(s.sha3_256(r),!0)}createUnsignedTx(e,t,n=!1){return new f(e,this.network,this.chain,t,n)}}s.registerProtocol("Aptos","TokenBridge",d);exports.AptosTokenBridge=d;
|