@wormhole-foundation/wormhole-connect 2.2.0 → 2.3.0-beta.0-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.
Files changed (156) hide show
  1. package/README.md +0 -1
  2. package/dist/main.js +108 -108
  3. package/dist/src/config/tokens.d.ts +1 -1
  4. package/dist/src/config/tokens.d.ts.map +1 -1
  5. package/dist/src/consts/wallet.d.ts.map +1 -1
  6. package/dist/src/hooks/useConfirmTransaction.d.ts +12 -0
  7. package/dist/src/hooks/useConfirmTransaction.d.ts.map +1 -0
  8. package/dist/src/hooks/useGasSlider.d.ts +1 -2
  9. package/dist/src/hooks/useGasSlider.d.ts.map +1 -1
  10. package/dist/src/index.d.ts +3 -3
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/routes/operator.d.ts +0 -1
  13. package/dist/src/routes/operator.d.ts.map +1 -1
  14. package/dist/src/routes/sdkv2/route.d.ts +0 -1
  15. package/dist/src/routes/sdkv2/route.d.ts.map +1 -1
  16. package/dist/src/store/transferInput.d.ts +2 -4
  17. package/dist/src/store/transferInput.d.ts.map +1 -1
  18. package/dist/src/utils/wallet/index.d.ts +1 -1
  19. package/dist/src/utils/wallet/index.d.ts.map +1 -1
  20. package/dist/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
  21. package/dist/src/views/v2/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -1
  22. package/dist/src/views/v2/Bridge/AssetPicker/index.d.ts +1 -0
  23. package/dist/src/views/v2/Bridge/AssetPicker/index.d.ts.map +1 -1
  24. package/dist/src/views/v2/Bridge/{ReviewTransaction/GasSlider.d.ts → GasSlider/index.d.ts} +1 -1
  25. package/dist/src/views/v2/Bridge/GasSlider/index.d.ts.map +1 -0
  26. package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  27. package/dist/src/views/v2/Bridge/SwapInputs/index.d.ts.map +1 -1
  28. package/dist/src/views/v2/Bridge/WalletConnector/Controller.d.ts.map +1 -1
  29. package/dist/src/views/v2/Bridge/index.d.ts.map +1 -1
  30. package/dist/src/views/v2/TxHistory/Item/index.d.ts.map +1 -1
  31. package/dist/src/views/v2/TxHistory/Widget/Item.d.ts +1 -0
  32. package/dist/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -1
  33. package/dist/src/views/v2/TxHistory/Widget/index.d.ts +3 -1
  34. package/dist/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -1
  35. package/lib/{aptos-CWfp2v_P.js → aptos-C8wWowIo.js} +2 -2
  36. package/lib/{aptos-7dMQQEIW.mjs → aptos-D7c67ZLW.mjs} +5 -5
  37. package/lib/{aptos-BUemveTM.mjs → aptos-DDn36CHg.mjs} +2 -2
  38. package/lib/{aptos-umg2ncs_.js → aptos-DdE-0VJe.js} +1 -1
  39. package/lib/{base64-CIH-T7Pn.mjs → base64-DDHFdAly.mjs} +1 -1
  40. package/lib/{base64-BlOlyzUY.js → base64-ezgPiVRC.js} +1 -1
  41. package/lib/{ccip-CdkU-__S.js → ccip-CcmdyG6F.js} +1 -1
  42. package/lib/{ccip-BhU7SDb9.mjs → ccip-cCuo9AgF.mjs} +1 -1
  43. package/lib/{chunk-IMTC3J2M-Bm_KxGLU.mjs → chunk-IMTC3J2M-CVDcZzUA.mjs} +3 -3
  44. package/lib/{chunk-IMTC3J2M-CG7LPkYt.js → chunk-IMTC3J2M-DxYYEZPQ.js} +1 -1
  45. package/lib/{events-jQ_Do8B1.js → events-BJ__ydp1.js} +1 -1
  46. package/lib/{events-hPS-mKjU.mjs → events-Cx0TtMEs.mjs} +1 -1
  47. package/lib/{evm-D4OaAvxv.js → evm-0ozMa6lt.js} +1 -1
  48. package/lib/{evm-DvlAO_-c.mjs → evm-B2N6Szko.mjs} +5 -5
  49. package/lib/{evm-Ck-LC8K1.js → evm-C1P39f42.js} +3 -3
  50. package/lib/{evm-AFZ_po3U.mjs → evm-DnyX6-E0.mjs} +5 -5
  51. package/lib/{index-ihbUzPuY.mjs → index-B2v3lWOA.mjs} +1 -1
  52. package/lib/{index-DyvLFo_F.mjs → index-BAH37FLm.mjs} +2 -2
  53. package/lib/{index-Bu1PkKLG.js → index-BCYsl46V.js} +1 -1
  54. package/lib/{index-CUR8Z8Cf.js → index-BD2_PLZI.js} +1 -1
  55. package/lib/{index-BZs20N4K.mjs → index-Be1t7NdK.mjs} +2 -2
  56. package/lib/{index-B3nUhqKI.mjs → index-Bj6DHbUk.mjs} +2 -2
  57. package/lib/{index-BUDas0Q7.mjs → index-Bu-ZkvDv.mjs} +1 -1
  58. package/lib/{index-JVwNffKI.mjs → index-BuYa5pxo.mjs} +2 -2
  59. package/lib/{index-C0ecUbom.mjs → index-BxP3fEtC.mjs} +2 -2
  60. package/lib/{index-MxqIZiRX.mjs → index-BxXt3T2L.mjs} +2 -2
  61. package/lib/{index-BWsfR9uT.mjs → index-BzcZiOc0.mjs} +1 -1
  62. package/lib/{index-hus1Sl4S.js → index-C6dpONOU.js} +1 -1
  63. package/lib/{index-D9o7O_OT.js → index-C7o_1w2b.js} +1 -1
  64. package/lib/{index-DV2Mc1nu.js → index-C8klYEIV.js} +1 -1
  65. package/lib/{index-BNe7LUKU.mjs → index-CFMLZ1vA.mjs} +5 -5
  66. package/lib/{index-DTfWrGt3.mjs → index-CUb31_lx.mjs} +1 -1
  67. package/lib/{index-CHWND-D1.mjs → index-CeGgtsu2.mjs} +3 -3
  68. package/lib/{index-BKBGPzmc.mjs → index-Cfoq6joM.mjs} +1 -1
  69. package/lib/{index-BFXBE_Mo.js → index-CkwnTFud.js} +1 -1
  70. package/lib/{index-BbSC7v8g.js → index-CyQ9IEH0.js} +1 -1
  71. package/lib/{index-KdiLn9Rj.js → index-D4vjV5Cn.js} +1 -1
  72. package/lib/{index-AVSrA-i6.js → index-D5xbHPoy.js} +1 -1
  73. package/lib/{index-nWaQESZp.mjs → index-DH7AJ70P.mjs} +1 -1
  74. package/lib/{index-Bi5J2r-k.js → index-DLxALGi6.js} +1 -1
  75. package/lib/{index-BEhe2aRM.js → index-DP4LajXh.js} +99 -99
  76. package/lib/{index-WPYOQdpa.js → index-DPCJduN1.js} +1 -1
  77. package/lib/{index-D1q2O2Av.mjs → index-DPf2pllz.mjs} +3 -3
  78. package/lib/{index-D0QNNKvo.mjs → index-DRcPh_kU.mjs} +4 -4
  79. package/lib/{index-PNYcH9VB.js → index-DTPmVH0m.js} +1 -1
  80. package/lib/{index-D5fAF0iQ.js → index-DcIAHxwS.js} +1 -1
  81. package/lib/{index-CaNzAG1x.mjs → index-DiGgidBd.mjs} +7604 -7681
  82. package/lib/{index-NWE7RRiw.mjs → index-DvpfNUKf.mjs} +2 -2
  83. package/lib/{index-CtS6jcgq.js → index-DzM-GaLm.js} +1 -1
  84. package/lib/{index-Derjp7Zu.mjs → index-DziLpE9R.mjs} +2 -2
  85. package/lib/{index-wHDS4NqS.js → index-JqJdK8nh.js} +1 -1
  86. package/lib/{index-Bd3pCFb1.js → index-LbLfiRUY.js} +1 -1
  87. package/lib/{index-Dhyj87bh.mjs → index-PlcYoJ_e.mjs} +1 -1
  88. package/lib/{index-B9WBHQFN.js → index-ZFWFaT_g.js} +1 -1
  89. package/lib/{index-CdrPNIu_.js → index-mCqIYfBy.js} +1 -1
  90. package/lib/{index-BchoBDpT.mjs → index-uXXxfGyN.mjs} +2 -2
  91. package/lib/{index-Df5E8ttw.js → index-vipvKyDe.js} +1 -1
  92. package/lib/{index-DirgoiOD.js → index-wzIjatvw.js} +1 -1
  93. package/lib/{index.es-D6eM34wK.mjs → index.es-CGjw8LBi.mjs} +6 -6
  94. package/lib/{index.es-CJrTwrY5.js → index.es-D45qOiuD.js} +2 -2
  95. package/lib/index.js +1 -1
  96. package/lib/index.mjs +1 -1
  97. package/lib/{signer-C1hgiPI9.js → signer-DteZwBbB.js} +1 -1
  98. package/lib/{signer-CXxUSLSd.mjs → signer-StZFWU4E.mjs} +1 -1
  99. package/lib/{solana-XXmHFxEb.js → solana-643BgaAW.js} +1 -1
  100. package/lib/solana-BuuMVrdp.js +1 -0
  101. package/lib/{solana-D4eoBu_Q.mjs → solana-IP1dZh2r.mjs} +4 -4
  102. package/lib/{solana-C06kaujM.mjs → solana-oxjhG-3b.mjs} +5 -5
  103. package/lib/{solanaEmbed.esm-CBSm6nV9.js → solanaEmbed.esm-Cp1hmjAh.js} +1 -1
  104. package/lib/{solanaEmbed.esm-dce8g5AQ.mjs → solanaEmbed.esm-nYODBqHJ.mjs} +2 -2
  105. package/lib/src/config/tokens.d.ts +1 -1
  106. package/lib/src/config/tokens.d.ts.map +1 -1
  107. package/lib/src/consts/wallet.d.ts.map +1 -1
  108. package/lib/src/hooks/useConfirmTransaction.d.ts +12 -0
  109. package/lib/src/hooks/useConfirmTransaction.d.ts.map +1 -0
  110. package/lib/src/hooks/useGasSlider.d.ts +1 -2
  111. package/lib/src/hooks/useGasSlider.d.ts.map +1 -1
  112. package/lib/src/index.d.ts +3 -3
  113. package/lib/src/index.d.ts.map +1 -1
  114. package/lib/src/routes/operator.d.ts +0 -1
  115. package/lib/src/routes/operator.d.ts.map +1 -1
  116. package/lib/src/routes/sdkv2/route.d.ts +0 -1
  117. package/lib/src/routes/sdkv2/route.d.ts.map +1 -1
  118. package/lib/src/store/transferInput.d.ts +2 -4
  119. package/lib/src/store/transferInput.d.ts.map +1 -1
  120. package/lib/src/utils/wallet/index.d.ts +1 -1
  121. package/lib/src/utils/wallet/index.d.ts.map +1 -1
  122. package/lib/src/views/v2/Bridge/AmountInput/index.d.ts.map +1 -1
  123. package/lib/src/views/v2/Bridge/AssetPicker/SearchableList/index.d.ts.map +1 -1
  124. package/lib/src/views/v2/Bridge/AssetPicker/index.d.ts +1 -0
  125. package/lib/src/views/v2/Bridge/AssetPicker/index.d.ts.map +1 -1
  126. package/lib/src/views/v2/Bridge/{ReviewTransaction/GasSlider.d.ts → GasSlider/index.d.ts} +1 -1
  127. package/lib/src/views/v2/Bridge/GasSlider/index.d.ts.map +1 -0
  128. package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  129. package/lib/src/views/v2/Bridge/SwapInputs/index.d.ts.map +1 -1
  130. package/lib/src/views/v2/Bridge/WalletConnector/Controller.d.ts.map +1 -1
  131. package/lib/src/views/v2/Bridge/index.d.ts.map +1 -1
  132. package/lib/src/views/v2/TxHistory/Item/index.d.ts.map +1 -1
  133. package/lib/src/views/v2/TxHistory/Widget/Item.d.ts +1 -0
  134. package/lib/src/views/v2/TxHistory/Widget/Item.d.ts.map +1 -1
  135. package/lib/src/views/v2/TxHistory/Widget/index.d.ts +3 -1
  136. package/lib/src/views/v2/TxHistory/Widget/index.d.ts.map +1 -1
  137. package/lib/{sui-BDZkyTVG.js → sui-BV_WN62T.js} +1 -1
  138. package/lib/{sui-BEvt3G9o.mjs → sui-DbQenqxx.mjs} +1 -1
  139. package/lib/{sui-CrYGHvcd.js → sui-DdU63C8s.js} +2 -2
  140. package/lib/{sui-D8i87rc-.mjs → sui-OujMcwQK.mjs} +5 -5
  141. package/package.json +18 -18
  142. package/dist/src/hooks/useComputeSourceTokens.d.ts +0 -15
  143. package/dist/src/hooks/useComputeSourceTokens.d.ts.map +0 -1
  144. package/dist/src/views/v2/Bridge/ReviewTransaction/GasSlider.d.ts.map +0 -1
  145. package/dist/src/views/v2/Bridge/ReviewTransaction/SendError.d.ts +0 -8
  146. package/dist/src/views/v2/Bridge/ReviewTransaction/SendError.d.ts.map +0 -1
  147. package/dist/src/views/v2/Bridge/ReviewTransaction/index.d.ts +0 -9
  148. package/dist/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +0 -1
  149. package/lib/solana-B0ZJBh57.js +0 -1
  150. package/lib/src/hooks/useComputeSourceTokens.d.ts +0 -15
  151. package/lib/src/hooks/useComputeSourceTokens.d.ts.map +0 -1
  152. package/lib/src/views/v2/Bridge/ReviewTransaction/GasSlider.d.ts.map +0 -1
  153. package/lib/src/views/v2/Bridge/ReviewTransaction/SendError.d.ts +0 -8
  154. package/lib/src/views/v2/Bridge/ReviewTransaction/SendError.d.ts.map +0 -1
  155. package/lib/src/views/v2/Bridge/ReviewTransaction/index.d.ts +0 -9
  156. package/lib/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +0 -1
@@ -13,7 +13,7 @@ var E = (e, t, s, i) => ({
13
13
  return h(e, t, i);
14
14
  }
15
15
  });
16
- import { A as W, d as b, W as $, E as f, P as M, a as R, b as j, c as q, _ as z } from "./index-CaNzAG1x.mjs";
16
+ import { A as W, d as b, W as $, E as f, P as M, a as R, b as j, c as q, _ as z } from "./index-DiGgidBd.mjs";
17
17
  var a, c;
18
18
  const w = class w extends W {
19
19
  /**
@@ -126,10 +126,10 @@ const Q = {
126
126
  Platform: f,
127
127
  getSigner: H,
128
128
  protocols: {
129
- WormholeCore: () => import("./index-CaNzAG1x.mjs").then((e) => e.c_),
130
- TokenBridge: () => import("./index-BWsfR9uT.mjs"),
131
- PorticoBridge: () => import("./index-NWE7RRiw.mjs"),
132
- CircleBridge: () => import("./index-BchoBDpT.mjs")
129
+ WormholeCore: () => import("./index-DiGgidBd.mjs").then((e) => e.c_),
130
+ TokenBridge: () => import("./index-BzcZiOc0.mjs"),
131
+ PorticoBridge: () => import("./index-DvpfNUKf.mjs"),
132
+ CircleBridge: () => import("./index-uXXxfGyN.mjs")
133
133
  },
134
134
  getChain: (e, t, s) => new R(t, new f(e, q(e, z, {
135
135
  [t]: s
@@ -1,7 +1,7 @@
1
1
  var Pt = Object.defineProperty;
2
2
  var _t = (e, t, r) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var f = (e, t, r) => _t(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { ae as c, V as l, a_ as A, bH as le, b2 as z, b1 as U, b3 as G, b0 as S, a$ as V, bI as Ge, bJ as Ze, bK as Wt, bL as It, bM as Ut, bN as Nt, bO as O, bP as E, b6 as y, bQ as T, bR as Ft, bS as ye, bB as dt, bT as xt, bU as lt, bV as zt, bW as Ot, bX as Q, bY as Lt, bZ as Z, b_ as H, b$ as Dt, c0 as qt, c1 as Kt, c2 as Vt, c3 as Se, c4 as Gt, c5 as v, c6 as Zt, e as oe, f as k, bA as Ce, bd as Ht, m as $, bG as Be, c7 as Yt, c8 as Qt, at as ae, ai as L, c9 as Xt, ca as ft, bj as mt, g as gt } from "./index-CaNzAG1x.mjs";
4
+ import { ae as c, V as l, a_ as A, bH as le, b2 as z, b1 as U, b3 as G, b0 as S, a$ as V, bI as Ge, bJ as Ze, bK as Wt, bL as It, bM as Ut, bN as Nt, bO as O, bP as E, b6 as y, bQ as T, bR as Ft, bS as ye, bB as dt, bT as xt, bU as lt, bV as zt, bW as Ot, bX as Q, bY as Lt, bZ as Z, b_ as H, b$ as Dt, c0 as qt, c1 as Kt, c2 as Vt, c3 as Se, c4 as Gt, c5 as v, c6 as Zt, e as oe, f as k, bA as Ce, bd as Ht, m as $, bG as Be, c7 as Yt, c8 as Qt, at as ae, ai as L, c9 as Xt, ca as ft, bj as mt, g as gt } from "./index-DiGgidBd.mjs";
5
5
  const M = new c("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
6
6
  new c("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
7
7
  const Ae = new c("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"), D = new c("So11111111111111111111111111111111111111112");
@@ -1,8 +1,8 @@
1
1
  var d = Object.defineProperty;
2
2
  var h = (i, e, r) => e in i ? d(i, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[e] = r;
3
3
  var o = (i, e, r) => h(i, typeof e != "symbol" ? e + "" : e, r);
4
- import { b6 as m, cc as w, K as g, bj as p } from "./index-CaNzAG1x.mjs";
5
- import { S as u } from "./sui-D8i87rc-.mjs";
4
+ import { b6 as m, cc as w, K as g, bj as p } from "./index-DiGgidBd.mjs";
5
+ import { S as u } from "./sui-OujMcwQK.mjs";
6
6
  class c {
7
7
  constructor(e, r, t, n) {
8
8
  o(this, "network");
@@ -1,4 +1,4 @@
1
- "use strict";const ge=require("./index-wHDS4NqS.js"),$=require("./index-BEhe2aRM.js");function Rn(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Fo(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=Rn(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}const Zr={...ge.identityBase,...ge.base2,...ge.base8,...ge.base10,...ge.base16,...ge.base32,...ge.base36,...ge.base58,...ge.base64,...ge.base256emoji};function Ln(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Yr=Ln("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),er=Ln("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Rn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Pn={utf8:Yr,"utf-8":Yr,hex:Zr.base16,latin1:er,ascii:er,binary:er,...Zr};function So(e,t="utf8"){const r=Pn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function Ao(e,t="utf8"){const r=Pn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var Xr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},Bo=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),Io=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=$.dist.process.platform}return e}(),Oo=function(){function e(t,r,n,i){this.name=t,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return e}(),To=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Co=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Ro=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Lo=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Qr=3,Po=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Ro]],en=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function jo(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Co:typeof navigator<"u"?zo(navigator.userAgent):Do()}function No(e){return e!==""&&Po.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function zo(e){var t=No(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new To;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Qr&&(i=Xr(Xr([],i,!0),Mo(Qr-i.length),!0)):i=[];var o=i.join("."),f=Uo(e),d=Lo.exec(e);return d&&d[1]?new Oo(r,o,f,d[1]):new Bo(r,o,f)}function Uo(e){for(var t=0,r=en.length;t<r;t++){var n=en[t],i=n[0],o=n[1],f=o.exec(e);if(f)return i}return null}function Do(){var e=typeof $.dist.process<"u"&&$.dist.process.version;return e?new Io($.dist.process.version.slice(1)):null}function Mo(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}const $o={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},Ko=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Ho=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Wo=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Go(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Vo(e);return}return t}function Vo(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function At(e,t={}){if(typeof e!="string")return e;const r=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!Wo.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Ko.test(e)||Ho.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Go)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function qo(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Y(e,...t){try{return qo(e(...t))}catch(r){return Promise.reject(r)}}function Jo(e){const t=typeof e;return e===null||t!=="object"&&t!=="function"}function ko(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function Rt(e){if(Jo(e))return String(e);if(ko(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Rt(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const hr="base64:";function Zo(e){return typeof e=="string"?e:hr+Qo(e)}function Yo(e){return typeof e!="string"||!e.startsWith(hr)?e:Xo(e.slice(hr.length))}function Xo(e){return globalThis.Buffer?$.dist.Buffer.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function Qo(e){return globalThis.Buffer?$.dist.Buffer.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function oe(e){var t;return e&&((t=e.split("?")[0])==null?void 0:t.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function es(...e){return oe(e.join(":"))}function Bt(e){return e=oe(e),e?e+":":""}const ts="memory",rs=()=>{const e=new Map;return{name:ts,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}};function ns(e={}){const t={mounts:{"":e.driver||rs()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=a=>{for(const u of t.mountpoints)if(a.startsWith(u))return{base:u,relativeKey:a.slice(u.length),driver:t.mounts[u]};return{base:"",relativeKey:a,driver:t.mounts[""]}},n=(a,u)=>t.mountpoints.filter(h=>h.startsWith(a)||u&&a.startsWith(h)).map(h=>({relativeBase:a.length>h.length?a.slice(h.length):void 0,mountpoint:h,driver:t.mounts[h]})),i=(a,u)=>{if(t.watching){u=oe(u);for(const h of t.watchListeners)h(a,u)}},o=async()=>{if(!t.watching){t.watching=!0;for(const a in t.mounts)t.unwatch[a]=await tn(t.mounts[a],i,a)}},f=async()=>{if(t.watching){for(const a in t.unwatch)await t.unwatch[a]();t.unwatch={},t.watching=!1}},d=(a,u,h)=>{const p=new Map,b=g=>{let _=p.get(g.base);return _||(_={driver:g.driver,base:g.base,items:[]},p.set(g.base,_)),_};for(const g of a){const _=typeof g=="string",O=oe(_?g:g.key),R=_?void 0:g.value,T=_||!g.options?u:{...u,...g.options},m=r(O);b(m).items.push({key:O,value:R,relativeKey:m.relativeKey,options:T})}return Promise.all([...p.values()].map(g=>h(g))).then(g=>g.flat())},c={hasItem(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return Y(p.hasItem,h,u)},getItem(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return Y(p.getItem,h,u).then(b=>At(b))},getItems(a,u={}){return d(a,u,h=>h.driver.getItems?Y(h.driver.getItems,h.items.map(p=>({key:p.relativeKey,options:p.options})),u).then(p=>p.map(b=>({key:es(h.base,b.key),value:At(b.value)}))):Promise.all(h.items.map(p=>Y(h.driver.getItem,p.relativeKey,p.options).then(b=>({key:p.key,value:At(b)})))))},getItemRaw(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return p.getItemRaw?Y(p.getItemRaw,h,u):Y(p.getItem,h,u).then(b=>Yo(b))},async setItem(a,u,h={}){if(u===void 0)return c.removeItem(a);a=oe(a);const{relativeKey:p,driver:b}=r(a);b.setItem&&(await Y(b.setItem,p,Rt(u),h),b.watch||i("update",a))},async setItems(a,u){await d(a,u,async h=>{if(h.driver.setItems)return Y(h.driver.setItems,h.items.map(p=>({key:p.relativeKey,value:Rt(p.value),options:p.options})),u);h.driver.setItem&&await Promise.all(h.items.map(p=>Y(h.driver.setItem,p.relativeKey,Rt(p.value),p.options)))})},async setItemRaw(a,u,h={}){if(u===void 0)return c.removeItem(a,h);a=oe(a);const{relativeKey:p,driver:b}=r(a);if(b.setItemRaw)await Y(b.setItemRaw,p,u,h);else if(b.setItem)await Y(b.setItem,p,Zo(u),h);else return;b.watch||i("update",a)},async removeItem(a,u={}){typeof u=="boolean"&&(u={removeMeta:u}),a=oe(a);const{relativeKey:h,driver:p}=r(a);p.removeItem&&(await Y(p.removeItem,h,u),(u.removeMeta||u.removeMata)&&await Y(p.removeItem,h+"$",u),p.watch||i("remove",a))},async getMeta(a,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),a=oe(a);const{relativeKey:h,driver:p}=r(a),b=Object.create(null);if(p.getMeta&&Object.assign(b,await Y(p.getMeta,h,u)),!u.nativeOnly){const g=await Y(p.getItem,h+"$",u).then(_=>At(_));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(b,g))}return b},setMeta(a,u,h={}){return this.setItem(a+"$",u,h)},removeMeta(a,u={}){return this.removeItem(a+"$",u)},async getKeys(a,u={}){a=Bt(a);const h=n(a,!0);let p=[];const b=[];for(const g of h){const _=await Y(g.driver.getKeys,g.relativeBase,u);for(const O of _){const R=g.mountpoint+oe(O);p.some(T=>R.startsWith(T))||b.push(R)}p=[g.mountpoint,...p.filter(O=>!O.startsWith(g.mountpoint))]}return a?b.filter(g=>g.startsWith(a)&&g[g.length-1]!=="$"):b.filter(g=>g[g.length-1]!=="$")},async clear(a,u={}){a=Bt(a),await Promise.all(n(a,!1).map(async h=>{if(h.driver.clear)return Y(h.driver.clear,h.relativeBase,u);if(h.driver.removeItem){const p=await h.driver.getKeys(h.relativeBase||"",u);return Promise.all(p.map(b=>h.driver.removeItem(b,u)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(a=>rn(a)))},async watch(a){return await o(),t.watchListeners.push(a),async()=>{t.watchListeners=t.watchListeners.filter(u=>u!==a),t.watchListeners.length===0&&await f()}},async unwatch(){t.watchListeners=[],await f()},mount(a,u){if(a=Bt(a),a&&t.mounts[a])throw new Error(`already mounted at ${a}`);return a&&(t.mountpoints.push(a),t.mountpoints.sort((h,p)=>p.length-h.length)),t.mounts[a]=u,t.watching&&Promise.resolve(tn(u,i,a)).then(h=>{t.unwatch[a]=h}).catch(console.error),c},async unmount(a,u=!0){var h,p;a=Bt(a),!(!a||!t.mounts[a])&&(t.watching&&a in t.unwatch&&((p=(h=t.unwatch)[a])==null||p.call(h),delete t.unwatch[a]),u&&await rn(t.mounts[a]),t.mountpoints=t.mountpoints.filter(b=>b!==a),delete t.mounts[a])},getMount(a=""){a=oe(a)+":";const u=r(a);return{driver:u.driver,base:u.base}},getMounts(a="",u={}){return a=oe(a),n(a,u.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(a,u={})=>c.getKeys(a,u),get:(a,u={})=>c.getItem(a,u),set:(a,u,h={})=>c.setItem(a,u,h),has:(a,u={})=>c.hasItem(a,u),del:(a,u={})=>c.removeItem(a,u),remove:(a,u={})=>c.removeItem(a,u)};return c}function tn(e,t,r){return e.watch?e.watch((n,i)=>t(n,r+i)):()=>{}}async function rn(e){typeof e.dispose=="function"&&await Y(e.dispose)}function Me(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function jn(e,t){const r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);const n=Me(r);return(i,o)=>n.then(f=>o(f.transaction(t,i).objectStore(t)))}let tr;function ut(){return tr||(tr=jn("keyval-store","keyval")),tr}function nn(e,t=ut()){return t("readonly",r=>Me(r.get(e)))}function is(e,t,r=ut()){return r("readwrite",n=>(n.put(t,e),Me(n.transaction)))}function os(e,t=ut()){return t("readwrite",r=>(r.delete(e),Me(r.transaction)))}function ss(e=ut()){return e("readwrite",t=>(t.clear(),Me(t.transaction)))}function as(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Me(e.transaction)}function us(e=ut()){return e("readonly",t=>{if(t.getAllKeys)return Me(t.getAllKeys());const r=[];return as(t,n=>r.push(n.key)).then(()=>r)})}const cs=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),fs=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Nn(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return fs(e)}catch{return e}}function zn(e){return typeof e=="string"?e:cs(e)||""}const ls="idb-keyval";var hs=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=i=>t+i;let n;return e.dbName&&e.storeName&&(n=jn(e.dbName,e.storeName)),{name:ls,options:e,async hasItem(i){return!(typeof await nn(r(i),n)>"u")},async getItem(i){return await nn(r(i),n)??null},setItem(i,o){return is(r(i),o,n)},removeItem(i){return os(r(i),n)},getKeys(){return us(n)},clear(){return ss(n)}}};const ds="WALLET_CONNECT_V2_INDEXED_DB",ps="keyvaluestorage";let gs=class{constructor(){this.indexedDb=ns({driver:hs({dbName:ds,storeName:ps})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const r=await this.indexedDb.getItem(t);if(r!==null)return r}async setItem(t,r){await this.indexedDb.setItem(t,zn(r))}async removeItem(t){await this.indexedDb.removeItem(t)}};var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof $.dist.global<"u"?$.dist.global:typeof self<"u"?self:{},Lt={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},e.prototype.setItem=function(r,n){this[r]=String(n)},e.prototype.removeItem=function(r){delete this[r]},e.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},e.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof rr<"u"&&rr.localStorage?Lt.exports=rr.localStorage:typeof window<"u"&&window.localStorage?Lt.exports=window.localStorage:Lt.exports=new t})();function bs(e){var t;return[e[0],Nn((t=e[1])!=null?t:"")]}let ys=class{constructor(){this.localStorage=Lt.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(bs)}async getItem(t){const r=this.localStorage.getItem(t);if(r!==null)return Nn(r)}async setItem(t,r){this.localStorage.setItem(t,zn(r))}async removeItem(t){this.localStorage.removeItem(t)}};const ws="wc_storage_version",on=1,ms=async(e,t,r)=>{const n=ws,i=await t.getItem(n);if(i&&i>=on){r(t);return}const o=await e.getKeys();if(!o.length){r(t);return}const f=[];for(;o.length;){const d=o.shift();if(!d)continue;const c=d.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const a=await e.getItem(d);await t.setItem(d,a),f.push(d)}}await t.setItem(n,on),r(t),vs(e,f)},vs=async(e,t)=>{t.length&&t.forEach(async r=>{await e.removeItem(r)})};class _s{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const t=new ys;this.storage=t;try{const r=new gs;ms(t,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,r){return await this.initialize(),this.storage.setItem(t,r)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),t())},20)})}}class Es{}function xs(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Fs=Ss;function Ss(e,t,r){var n=r&&r.stringify||xs,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var f=new Array(o);f[0]=n(e);for(var d=1;d<o;d++)f[d]=n(t[d]);return f.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var a="",u=1-i,h=-1,p=e&&e.length||0,b=0;b<p;){if(e.charCodeAt(b)===37&&b+1<p){switch(h=h>-1?h:0,e.charCodeAt(b+1)){case 100:case 102:if(u>=c||t[u]==null)break;h<b&&(a+=e.slice(h,b)),a+=Number(t[u]),h=b+2,b++;break;case 105:if(u>=c||t[u]==null)break;h<b&&(a+=e.slice(h,b)),a+=Math.floor(Number(t[u])),h=b+2,b++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;h<b&&(a+=e.slice(h,b));var g=typeof t[u];if(g==="string"){a+="'"+t[u]+"'",h=b+2,b++;break}if(g==="function"){a+=t[u].name||"<anonymous>",h=b+2,b++;break}a+=n(t[u]),h=b+2,b++;break;case 115:if(u>=c)break;h<b&&(a+=e.slice(h,b)),a+=String(t[u]),h=b+2,b++;break;case 37:h<b&&(a+=e.slice(h,b)),a+="%",h=b+2,b++,u--;break}++u}++b}return h===-1?e:(h<p&&(a+=e.slice(h)),a)}const sn=Fs;var Ve=ve;const ot=js().console||{},As={mapHttpRequest:It,mapHttpResponse:It,wrapRequestSerializer:nr,wrapResponseSerializer:nr,wrapErrorSerializer:nr,req:It,res:It,err:Cs};function Bs(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function ve(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const r=e.browser.write||ot;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=Bs(e.browser.serialize,n);let o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const f=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),e.enabled===!1&&(e.level="silent");const d=e.level||"info",c=Object.create(r);c.log||(c.log=st),Object.defineProperty(c,"levelVal",{get:u}),Object.defineProperty(c,"level",{get:h,set:p});const a={transmit:t,serialize:i,asObject:e.browser.asObject,levels:f,timestamp:Rs(e)};c.levels=ve.levels,c.level=d,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=st,c.serializers=n,c._serialize=i,c._stdErrSerialize=o,c.child=b,t&&(c._logEvent=dr());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function h(){return this._level}function p(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,He(a,c,"error","log"),He(a,c,"fatal","error"),He(a,c,"warn","error"),He(a,c,"info","log"),He(a,c,"debug","log"),He(a,c,"trace","log")}function b(g,_){if(!g)throw new Error("missing bindings for child Pino");_=_||{},i&&g.serializers&&(_.serializers=g.serializers);const O=_.serializers;if(i&&O){var R=Object.assign({},n,O),T=e.browser.serialize===!0?Object.keys(R):i;delete g.serializers,Mt([g],T,R,this._stdErrSerialize)}function m(I){this._childLevel=(I._childLevel|0)+1,this.error=We(I,g,"error"),this.fatal=We(I,g,"fatal"),this.warn=We(I,g,"warn"),this.info=We(I,g,"info"),this.debug=We(I,g,"debug"),this.trace=We(I,g,"trace"),R&&(this.serializers=R,this._serialize=T),t&&(this._logEvent=dr([].concat(I._logEvent.bindings,g)))}return m.prototype=this,new m(this)}return c}ve.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};ve.stdSerializers=As;ve.stdTimeFunctions=Object.assign({},{nullTime:Un,epochTime:Dn,unixTime:Ls,isoTime:Ps});function He(e,t,r,n){const i=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?st:i[r]?i[r]:ot[r]||ot[n]||st,Is(e,t,r)}function Is(e,t,r){!e.transmit&&t[r]===st||(t[r]=function(n){return function(){const o=e.timestamp(),f=new Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ot?ot:this;for(var c=0;c<f.length;c++)f[c]=arguments[c];if(e.serialize&&!e.asObject&&Mt(f,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?n.call(d,Os(this,r,f,o)):n.apply(d,f),e.transmit){const a=e.transmit.level||t.level,u=ve.levels.values[a],h=ve.levels.values[r];if(h<u)return;Ts(this,{ts:o,methodLevel:r,methodValue:h,transmitValue:ve.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},f)}}}(t[r]))}function Os(e,t,r,n){e._serialize&&Mt(r,e._serialize,e.serializers,e._stdErrSerialize);const i=r.slice();let o=i[0];const f={};n&&(f.time=n),f.level=ve.levels.values[t];let d=(e._childLevel|0)+1;if(d<1&&(d=1),o!==null&&typeof o=="object"){for(;d--&&typeof i[0]=="object";)Object.assign(f,i.shift());o=i.length?sn(i.shift(),i):void 0}else typeof o=="string"&&(o=sn(i.shift(),i));return o!==void 0&&(f.msg=o),f}function Mt(e,t,r,n){for(const i in e)if(n&&e[i]instanceof Error)e[i]=ve.stdSerializers.err(e[i]);else if(typeof e[i]=="object"&&!Array.isArray(e[i]))for(const o in e[i])t&&t.indexOf(o)>-1&&o in r&&(e[i][o]=r[o](e[i][o]))}function We(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return e[r].apply(this,n)}}function Ts(e,t,r){const n=t.send,i=t.ts,o=t.methodLevel,f=t.methodValue,d=t.val,c=e._logEvent.bindings;Mt(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(a){return c.indexOf(a)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=f,n(o,e._logEvent,d),e._logEvent=dr(c)}function dr(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Cs(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)t[r]===void 0&&(t[r]=e[r]);return t}function Rs(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Un:Dn}function It(){return{}}function nr(e){return e}function st(){}function Un(){return!1}function Dn(){return Date.now()}function Ls(){return Math.round(Date.now()/1e3)}function Ps(){return new Date(Date.now()).toISOString()}function js(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const Er=$.getDefaultExportFromCjs(Ve),Ns=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r);function an(e){return typeof e=="string"?e:Ns(e)||""}const zs={level:"info"},ct="custom_context",xr=1e3*1024;class Us{constructor(t){this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class un{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const r=new Us(t);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let r=this.head;for(;r!==null;)t.push(r.value),r=r.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const r=t.value;return t=t.next,{done:!1,value:r}}}}}class Mn{constructor(t,r=xr){this.level=t??"error",this.levelValue=Ve.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new un(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,r){r===Ve.levels.values.error?console.error(t):r===Ve.levels.values.warn?console.warn(t):r===Ve.levels.values.debug?console.debug(t):r===Ve.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(an({timestamp:new Date().toISOString(),log:t}));const r=typeof t=="string"?JSON.parse(t).level:t.level;r>=this.levelValue&&this.forwardToConsole(t,r)}getLogs(){return this.logs}clearLogs(){this.logs=new un(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const r=this.getLogArray();return r.push(an({extraMetadata:t})),new Blob(r,{type:"application/json"})}}class Ds{constructor(t,r=xr){this.baseChunkLogger=new Mn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const r=URL.createObjectURL(this.logsToBlob(t)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}class Ms{constructor(t,r=xr){this.baseChunkLogger=new Mn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var $s=Object.defineProperty,Ks=Object.defineProperties,Hs=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,Ws=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable,fn=(e,t,r)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jt=(e,t)=>{for(var r in t||(t={}))Ws.call(t,r)&&fn(e,r,t[r]);if(cn)for(var r of cn(t))Gs.call(t,r)&&fn(e,r,t[r]);return e},Nt=(e,t)=>Ks(e,Hs(t));function Vs(e){return Nt(jt({},e),{level:(e==null?void 0:e.level)||zs.level})}function qs(e,t=ct){return e[t]||""}function Js(e,t,r=ct){return e[r]=t,e}function $n(e,t=ct){let r="";return typeof e.bindings>"u"?r=qs(e,t):r=e.bindings().context||"",r}function ks(e,t,r=ct){const n=$n(e,r);return n.trim()?`${n}/${t}`:t}function Zs(e,t,r=ct){const n=ks(e,t,r),i=e.child({context:n});return Js(i,n,r)}function Ys(e){var t,r;const n=new Ds((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Er(Nt(jt({},e.opts),{level:"trace",browser:Nt(jt({},(r=e.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function Xs(e){var t;const r=new Ms((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Er(Nt(jt({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}function Qs(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?Ys(e):Xs(e)}const ea=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),ta=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ra(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return ta(e)}catch{return e}}function na(e){return typeof e=="string"?e:ea(e)||""}function ia(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Kn(e,...t){if(!ia(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ln(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function oa(e,t){Kn(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Ge=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ir=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function sa(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Hn(e){return typeof e=="string"&&(e=sa(e)),Kn(e),e}class aa{clone(){return this._cloneInto()}}function ua(e){const t=n=>e().update(Hn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Wn(e=32){if(Ge&&typeof Ge.getRandomValues=="function")return Ge.getRandomValues(new Uint8Array(e));if(Ge&&typeof Ge.randomBytes=="function")return Ge.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function ca(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),f=Number(r>>i&o),d=Number(r&o),c=n?4:0,a=n?0:4;e.setUint32(t+c,f,n),e.setUint32(t+a,d,n)}class fa extends aa{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ir(this.buffer)}update(t){ln(this);const{view:r,buffer:n,blockLen:i}=this;t=Hn(t);const o=t.length;for(let f=0;f<o;){const d=Math.min(i-this.pos,o-f);if(d===i){const c=ir(t);for(;i<=o-f;f+=i)this.process(c,f);continue}n.set(t.subarray(f,f+d),this.pos),this.pos+=d,f+=d,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ln(this),oa(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:f}=this;r[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>i-f&&(this.process(n,0),f=0);for(let h=f;h<i;h++)r[h]=0;ca(n,i-8,BigInt(this.length*8),o),this.process(n,0);const d=ir(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=c/4,u=this.get();if(a>u.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<a;h++)d.setUint32(4*h,u[h],o)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:o,destroyed:f,pos:d}=this;return t.length=i,t.pos=d,t.finished=o,t.destroyed=f,i%r&&t.buffer.set(n),t}}const Ot=BigInt(2**32-1),pr=BigInt(32);function Gn(e,t=!1){return t?{h:Number(e&Ot),l:Number(e>>pr&Ot)}:{h:Number(e>>pr&Ot)|0,l:Number(e&Ot)|0}}function la(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:f}=Gn(e[i],t);[r[i],n[i]]=[o,f]}return[r,n]}const ha=(e,t)=>BigInt(e>>>0)<<pr|BigInt(t>>>0),da=(e,t,r)=>e>>>r,pa=(e,t,r)=>e<<32-r|t>>>r,ga=(e,t,r)=>e>>>r|t<<32-r,ba=(e,t,r)=>e<<32-r|t>>>r,ya=(e,t,r)=>e<<64-r|t>>>r-32,wa=(e,t,r)=>e>>>r-32|t<<64-r,ma=(e,t)=>t,va=(e,t)=>e,_a=(e,t,r)=>e<<r|t>>>32-r,Ea=(e,t,r)=>t<<r|e>>>32-r,xa=(e,t,r)=>t<<r-32|e>>>64-r,Fa=(e,t,r)=>e<<r-32|t>>>64-r;function Sa(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const Aa=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Ba=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Ia=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Oa=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,Ta=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Ca=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,B={fromBig:Gn,split:la,toBig:ha,shrSH:da,shrSL:pa,rotrSH:ga,rotrSL:ba,rotrBH:ya,rotrBL:wa,rotr32H:ma,rotr32L:va,rotlSH:_a,rotlSL:Ea,rotlBH:xa,rotlBL:Fa,add:Sa,add3L:Aa,add3H:Ba,add4L:Ia,add4H:Oa,add5H:Ca,add5L:Ta},[Ra,La]=B.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Ce=new Uint32Array(80),Re=new Uint32Array(80);class Pa extends fa{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:i,Ch:o,Cl:f,Dh:d,Dl:c,Eh:a,El:u,Fh:h,Fl:p,Gh:b,Gl:g,Hh:_,Hl:O}=this;return[t,r,n,i,o,f,d,c,a,u,h,p,b,g,_,O]}set(t,r,n,i,o,f,d,c,a,u,h,p,b,g,_,O){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=f|0,this.Dh=d|0,this.Dl=c|0,this.Eh=a|0,this.El=u|0,this.Fh=h|0,this.Fl=p|0,this.Gh=b|0,this.Gl=g|0,this.Hh=_|0,this.Hl=O|0}process(t,r){for(let m=0;m<16;m++,r+=4)Ce[m]=t.getUint32(r),Re[m]=t.getUint32(r+=4);for(let m=16;m<80;m++){const I=Ce[m-15]|0,z=Re[m-15]|0,H=B.rotrSH(I,z,1)^B.rotrSH(I,z,8)^B.shrSH(I,z,7),G=B.rotrSL(I,z,1)^B.rotrSL(I,z,8)^B.shrSL(I,z,7),U=Ce[m-2]|0,V=Re[m-2]|0,be=B.rotrSH(U,V,19)^B.rotrBH(U,V,61)^B.shrSH(U,V,6),ye=B.rotrSL(U,V,19)^B.rotrBL(U,V,61)^B.shrSL(U,V,6),fe=B.add4L(G,ye,Re[m-7],Re[m-16]),Le=B.add4H(fe,H,be,Ce[m-7],Ce[m-16]);Ce[m]=Le|0,Re[m]=fe|0}let{Ah:n,Al:i,Bh:o,Bl:f,Ch:d,Cl:c,Dh:a,Dl:u,Eh:h,El:p,Fh:b,Fl:g,Gh:_,Gl:O,Hh:R,Hl:T}=this;for(let m=0;m<80;m++){const I=B.rotrSH(h,p,14)^B.rotrSH(h,p,18)^B.rotrBH(h,p,41),z=B.rotrSL(h,p,14)^B.rotrSL(h,p,18)^B.rotrBL(h,p,41),H=h&b^~h&_,G=p&g^~p&O,U=B.add5L(T,z,G,La[m],Re[m]),V=B.add5H(U,R,I,H,Ra[m],Ce[m]),be=U|0,ye=B.rotrSH(n,i,28)^B.rotrBH(n,i,34)^B.rotrBH(n,i,39),fe=B.rotrSL(n,i,28)^B.rotrBL(n,i,34)^B.rotrBL(n,i,39),Le=n&o^n&d^o&d,Je=i&f^i&c^f&c;R=_|0,T=O|0,_=b|0,O=g|0,b=h|0,g=p|0,{h,l:p}=B.add(a|0,u|0,V|0,be|0),a=d|0,u=c|0,d=o|0,c=f|0,o=n|0,f=i|0;const x=B.add3L(be,fe,Je);n=B.add3H(x,V,ye,Le),i=x|0}({h:n,l:i}=B.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:f}=B.add(this.Bh|0,this.Bl|0,o|0,f|0),{h:d,l:c}=B.add(this.Ch|0,this.Cl|0,d|0,c|0),{h:a,l:u}=B.add(this.Dh|0,this.Dl|0,a|0,u|0),{h,l:p}=B.add(this.Eh|0,this.El|0,h|0,p|0),{h:b,l:g}=B.add(this.Fh|0,this.Fl|0,b|0,g|0),{h:_,l:O}=B.add(this.Gh|0,this.Gl|0,_|0,O|0),{h:R,l:T}=B.add(this.Hh|0,this.Hl|0,R|0,T|0),this.set(n,i,o,f,d,c,a,u,h,p,b,g,_,O,R,T)}roundClean(){Ce.fill(0),Re.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const ja=ua(()=>new Pa);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Fr=BigInt(0),Vn=BigInt(1),Na=BigInt(2);function Sr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ar(e){if(!Sr(e))throw new Error("Uint8Array expected")}function or(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const za=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Br(e){Ar(e);let t="";for(let r=0;r<e.length;r++)t+=za[e[r]];return t}function qn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Fr:BigInt("0x"+e)}const xe={_0:48,_9:57,A:65,F:70,a:97,f:102};function hn(e){if(e>=xe._0&&e<=xe._9)return e-xe._0;if(e>=xe.A&&e<=xe.F)return e-(xe.A-10);if(e>=xe.a&&e<=xe.f)return e-(xe.a-10)}function Jn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){const f=hn(e.charCodeAt(o)),d=hn(e.charCodeAt(o+1));if(f===void 0||d===void 0){const c=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}n[i]=f*16+d}return n}function Ua(e){return qn(Br(e))}function Pt(e){return Ar(e),qn(Br(Uint8Array.from(e).reverse()))}function kn(e,t){return Jn(e.toString(16).padStart(t*2,"0"))}function gr(e,t){return kn(e,t).reverse()}function Fe(e,t,r){let n;if(typeof t=="string")try{n=Jn(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else if(Sr(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(e+" of length "+r+" expected, got "+i);return n}function dn(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];Ar(i),t+=i.length}const r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){const o=e[n];r.set(o,i),i+=o.length}return r}const sr=e=>typeof e=="bigint"&&Fr<=e;function Da(e,t,r){return sr(e)&&sr(t)&&sr(r)&&t<=e&&e<r}function nt(e,t,r,n){if(!Da(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Ma(e){let t;for(t=0;e>Fr;e>>=Vn,t+=1);return t}const $a=e=>(Na<<BigInt(e-1))-Vn,Ka={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Sr(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ir(e,t,r={}){const n=(i,o,f)=>{const d=Ka[o];if(typeof d!="function")throw new Error("invalid validator function");const c=e[i];if(!(f&&c===void 0)&&!d(c,e))throw new Error("param "+String(i)+" is invalid. Expected "+o+", got "+c)};for(const[i,o]of Object.entries(t))n(i,o,!1);for(const[i,o]of Object.entries(r))n(i,o,!0);return e}function pn(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(i!==void 0)return i;const o=e(r,...n);return t.set(r,o),o}}const X=BigInt(0),q=BigInt(1),De=BigInt(2),Ha=BigInt(3),br=BigInt(4),gn=BigInt(5),bn=BigInt(8);function k(e,t){const r=e%t;return r>=X?r:t+r}function Wa(e,t,r){if(t<X)throw new Error("invalid exponent, negatives unsupported");if(r<=X)throw new Error("invalid modulus");if(r===q)return X;let n=q;for(;t>X;)t&q&&(n=n*e%r),e=e*e%r,t>>=q;return n}function me(e,t,r){let n=e;for(;t-- >X;)n*=n,n%=r;return n}function yn(e,t){if(e===X)throw new Error("invert: expected non-zero number");if(t<=X)throw new Error("invert: expected positive modulus, got "+t);let r=k(e,t),n=t,i=X,o=q;for(;r!==X;){const f=n/r,d=n%r,c=i-o*f;n=r,r=d,i=o,o=c}if(n!==q)throw new Error("invert: does not exist");return k(i,t)}function Ga(e){const t=(e-q)/De;let r,n,i;for(r=e-q,n=0;r%De===X;r/=De,n++);for(i=De;i<e&&Wa(i,t,e)!==e-q;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const f=(e+q)/br;return function(d,c){const a=d.pow(c,f);if(!d.eql(d.sqr(a),c))throw new Error("Cannot find square root");return a}}const o=(r+q)/De;return function(f,d){if(f.pow(d,t)===f.neg(f.ONE))throw new Error("Cannot find square root");let c=n,a=f.pow(f.mul(f.ONE,i),r),u=f.pow(d,o),h=f.pow(d,r);for(;!f.eql(h,f.ONE);){if(f.eql(h,f.ZERO))return f.ZERO;let p=1;for(let g=f.sqr(h);p<c&&!f.eql(g,f.ONE);p++)g=f.sqr(g);const b=f.pow(a,q<<BigInt(c-p-1));a=f.sqr(b),u=f.mul(u,b),h=f.mul(h,a),c=p}return u}}function Va(e){if(e%br===Ha){const t=(e+q)/br;return function(r,n){const i=r.pow(n,t);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(e%bn===gn){const t=(e-gn)/bn;return function(r,n){const i=r.mul(n,De),o=r.pow(i,t),f=r.mul(n,o),d=r.mul(r.mul(f,De),o),c=r.mul(f,r.sub(d,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return Ga(e)}const qa=(e,t)=>(k(e,t)&q)===q,Ja=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ka(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Ja.reduce((n,i)=>(n[i]="function",n),t);return Ir(e,r)}function Za(e,t,r){if(r<X)throw new Error("invalid exponent, negatives unsupported");if(r===X)return e.ONE;if(r===q)return t;let n=e.ONE,i=t;for(;r>X;)r&q&&(n=e.mul(n,i)),i=e.sqr(i),r>>=q;return n}function Ya(e,t){const r=new Array(t.length),n=t.reduce((o,f,d)=>e.is0(f)?o:(r[d]=o,e.mul(o,f)),e.ONE),i=e.inv(n);return t.reduceRight((o,f,d)=>e.is0(f)?o:(r[d]=e.mul(o,r[d]),e.mul(o,f)),i),r}function Zn(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Yn(e,t,r=!1,n={}){if(e<=X)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:i,nByteLength:o}=Zn(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let f;const d=Object.freeze({ORDER:e,isLE:r,BITS:i,BYTES:o,MASK:$a(i),ZERO:X,ONE:q,create:c=>k(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return X<=c&&c<e},is0:c=>c===X,isOdd:c=>(c&q)===q,neg:c=>k(-c,e),eql:(c,a)=>c===a,sqr:c=>k(c*c,e),add:(c,a)=>k(c+a,e),sub:(c,a)=>k(c-a,e),mul:(c,a)=>k(c*a,e),pow:(c,a)=>Za(d,c,a),div:(c,a)=>k(c*yn(a,e),e),sqrN:c=>c*c,addN:(c,a)=>c+a,subN:(c,a)=>c-a,mulN:(c,a)=>c*a,inv:c=>yn(c,e),sqrt:n.sqrt||(c=>(f||(f=Va(e)),f(d,c))),invertBatch:c=>Ya(d,c),cmov:(c,a,u)=>u?a:c,toBytes:c=>r?gr(c,o):kn(c,o),fromBytes:c=>{if(c.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+c.length);return r?Pt(c):Ua(c)}});return Object.freeze(d)}const wn=BigInt(0),Tt=BigInt(1);function ar(e,t){const r=t.negate();return e?r:t}function Xn(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ur(e,t){Xn(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function Xa(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function Qa(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const cr=new WeakMap,Qn=new WeakMap;function fr(e){return Qn.get(e)||1}function eu(e,t){return{constTimeNegate:ar,hasPrecomputes(r){return fr(r)!==1},unsafeLadder(r,n,i=e.ZERO){let o=r;for(;n>wn;)n&Tt&&(i=i.add(o)),o=o.double(),n>>=Tt;return i},precomputeWindow(r,n){const{windows:i,windowSize:o}=ur(n,t),f=[];let d=r,c=d;for(let a=0;a<i;a++){c=d,f.push(c);for(let u=1;u<o;u++)c=c.add(d),f.push(c);d=c.double()}return f},wNAF(r,n,i){const{windows:o,windowSize:f}=ur(r,t);let d=e.ZERO,c=e.BASE;const a=BigInt(2**r-1),u=2**r,h=BigInt(r);for(let p=0;p<o;p++){const b=p*f;let g=Number(i&a);i>>=h,g>f&&(g-=u,i+=Tt);const _=b,O=b+Math.abs(g)-1,R=p%2!==0,T=g<0;g===0?c=c.add(ar(R,n[_])):d=d.add(ar(T,n[O]))}return{p:d,f:c}},wNAFUnsafe(r,n,i,o=e.ZERO){const{windows:f,windowSize:d}=ur(r,t),c=BigInt(2**r-1),a=2**r,u=BigInt(r);for(let h=0;h<f;h++){const p=h*d;if(i===wn)break;let b=Number(i&c);if(i>>=u,b>d&&(b-=a,i+=Tt),b===0)continue;let g=n[p+Math.abs(b)-1];b<0&&(g=g.negate()),o=o.add(g)}return o},getPrecomputes(r,n,i){let o=cr.get(n);return o||(o=this.precomputeWindow(n,r),r!==1&&cr.set(n,i(o))),o},wNAFCached(r,n,i){const o=fr(r);return this.wNAF(o,this.getPrecomputes(o,r,i),n)},wNAFCachedUnsafe(r,n,i,o){const f=fr(r);return f===1?this.unsafeLadder(r,n,o):this.wNAFUnsafe(f,this.getPrecomputes(f,r,i),n,o)},setWindowSize(r,n){Xn(n,t),Qn.set(r,n),cr.delete(r)}}}function tu(e,t,r,n){if(Xa(r,e),Qa(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,o=Ma(BigInt(r.length)),f=o>12?o-3:o>4?o-2:o?2:1,d=(1<<f)-1,c=new Array(d+1).fill(i),a=Math.floor((t.BITS-1)/f)*f;let u=i;for(let h=a;h>=0;h-=f){c.fill(i);for(let b=0;b<n.length;b++){const g=n[b],_=Number(g>>BigInt(h)&BigInt(d));c[_]=c[_].add(r[b])}let p=i;for(let b=c.length-1,g=i;b>0;b--)g=g.add(c[b]),p=p.add(g);if(u=u.add(p),h!==0)for(let b=0;b<f;b++)u=u.double()}return u}function ru(e){return ka(e.Fp),Ir(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Zn(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const pe=BigInt(0),ie=BigInt(1),Ct=BigInt(2),nu=BigInt(8),iu={zip215:!0};function ou(e){const t=ru(e);return Ir(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function su(e){const t=ou(e),{Fp:r,n,prehash:i,hash:o,randomBytes:f,nByteLength:d,h:c}=t,a=Ct<<BigInt(d*8)-ie,u=r.create,h=Yn(t.n,t.nBitLength),p=t.uvRatio||((x,w)=>{try{return{isValid:!0,value:r.sqrt(x*r.inv(w))}}catch{return{isValid:!1,value:pe}}}),b=t.adjustScalarBytes||(x=>x),g=t.domain||((x,w,E)=>{if(or("phflag",E),w.length||E)throw new Error("Contexts/pre-hash are not supported");return x});function _(x,w){nt("coordinate "+x,w,pe,a)}function O(x){if(!(x instanceof m))throw new Error("ExtendedPoint expected")}const R=pn((x,w)=>{const{ex:E,ey:F,ez:C}=x,L=x.is0();w==null&&(w=L?nu:r.inv(C));const P=u(E*w),D=u(F*w),j=u(C*w);if(L)return{x:pe,y:ie};if(j!==ie)throw new Error("invZ was invalid");return{x:P,y:D}}),T=pn(x=>{const{a:w,d:E}=t;if(x.is0())throw new Error("bad point: ZERO");const{ex:F,ey:C,ez:L,et:P}=x,D=u(F*F),j=u(C*C),M=u(L*L),S=u(M*M),Q=u(D*w),le=u(M*u(Q+j)),J=u(S+u(E*u(D*j)));if(le!==J)throw new Error("bad point: equation left != right (1)");const ne=u(F*C),he=u(L*P);if(ne!==he)throw new Error("bad point: equation left != right (2)");return!0});class m{constructor(w,E,F,C){this.ex=w,this.ey=E,this.ez=F,this.et=C,_("x",w),_("y",E),_("z",F),_("t",C),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof m)throw new Error("extended point not allowed");const{x:E,y:F}=w||{};return _("x",E),_("y",F),new m(E,F,ie,u(E*F))}static normalizeZ(w){const E=r.invertBatch(w.map(F=>F.ez));return w.map((F,C)=>F.toAffine(E[C])).map(m.fromAffine)}static msm(w,E){return tu(m,h,w,E)}_setWindowSize(w){H.setWindowSize(this,w)}assertValidity(){T(this)}equals(w){O(w);const{ex:E,ey:F,ez:C}=this,{ex:L,ey:P,ez:D}=w,j=u(E*D),M=u(L*C),S=u(F*D),Q=u(P*C);return j===M&&S===Q}is0(){return this.equals(m.ZERO)}negate(){return new m(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:w}=t,{ex:E,ey:F,ez:C}=this,L=u(E*E),P=u(F*F),D=u(Ct*u(C*C)),j=u(w*L),M=E+F,S=u(u(M*M)-L-P),Q=j+P,le=Q-D,J=j-P,ne=u(S*le),he=u(Q*J),we=u(S*J),Be=u(le*Q);return new m(ne,he,Be,we)}add(w){O(w);const{a:E,d:F}=t,{ex:C,ey:L,ez:P,et:D}=this,{ex:j,ey:M,ez:S,et:Q}=w;if(E===BigInt(-1)){const lt=u((L-C)*(M+j)),ht=u((L+C)*(M-j)),Ye=u(ht-lt);if(Ye===pe)return this.double();const dt=u(P*Ct*Q),pt=u(D*Ct*S),gt=pt+dt,bt=ht+lt,yt=pt-dt,$e=u(gt*Ye),Xe=u(bt*yt),wt=u(gt*yt),ae=u(Ye*bt);return new m($e,Xe,ae,wt)}const le=u(C*j),J=u(L*M),ne=u(D*F*Q),he=u(P*S),we=u((C+L)*(j+M)-le-J),Be=he-ne,ke=he+ne,Ze=u(J-E*le),Wt=u(we*Be),Gt=u(ke*Ze),Vt=u(we*Ze),qt=u(Be*ke);return new m(Wt,Gt,qt,Vt)}subtract(w){return this.add(w.negate())}wNAF(w){return H.wNAFCached(this,w,m.normalizeZ)}multiply(w){const E=w;nt("scalar",E,ie,n);const{p:F,f:C}=this.wNAF(E);return m.normalizeZ([F,C])[0]}multiplyUnsafe(w,E=m.ZERO){const F=w;return nt("scalar",F,pe,n),F===pe?z:this.is0()||F===ie?this:H.wNAFCachedUnsafe(this,F,m.normalizeZ,E)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return H.unsafeLadder(this,n).is0()}toAffine(w){return R(this,w)}clearCofactor(){const{h:w}=t;return w===ie?this:this.multiplyUnsafe(w)}static fromHex(w,E=!1){const{d:F,a:C}=t,L=r.BYTES;w=Fe("pointHex",w,L),or("zip215",E);const P=w.slice(),D=w[L-1];P[L-1]=D&-129;const j=Pt(P),M=E?a:r.ORDER;nt("pointHex.y",j,pe,M);const S=u(j*j),Q=u(S-ie),le=u(F*S-C);let{isValid:J,value:ne}=p(Q,le);if(!J)throw new Error("Point.fromHex: invalid y coordinate");const he=(ne&ie)===ie,we=(D&128)!==0;if(!E&&ne===pe&&we)throw new Error("Point.fromHex: x=0 and x_0=1");return we!==he&&(ne=u(-ne)),m.fromAffine({x:ne,y:j})}static fromPrivateKey(w){return V(w).point}toRawBytes(){const{x:w,y:E}=this.toAffine(),F=gr(E,r.BYTES);return F[F.length-1]|=w&ie?128:0,F}toHex(){return Br(this.toRawBytes())}}m.BASE=new m(t.Gx,t.Gy,ie,u(t.Gx*t.Gy)),m.ZERO=new m(pe,ie,ie,pe);const{BASE:I,ZERO:z}=m,H=eu(m,d*8);function G(x){return k(x,n)}function U(x){return G(Pt(x))}function V(x){const w=r.BYTES;x=Fe("private key",x,w);const E=Fe("hashed private key",o(x),2*w),F=b(E.slice(0,w)),C=E.slice(w,2*w),L=U(F),P=I.multiply(L),D=P.toRawBytes();return{head:F,prefix:C,scalar:L,point:P,pointBytes:D}}function be(x){return V(x).pointBytes}function ye(x=new Uint8Array,...w){const E=dn(...w);return U(o(g(E,Fe("context",x),!!i)))}function fe(x,w,E={}){x=Fe("message",x),i&&(x=i(x));const{prefix:F,scalar:C,pointBytes:L}=V(w),P=ye(E.context,F,x),D=I.multiply(P).toRawBytes(),j=ye(E.context,D,L,x),M=G(P+j*C);nt("signature.s",M,pe,n);const S=dn(D,gr(M,r.BYTES));return Fe("result",S,r.BYTES*2)}const Le=iu;function Je(x,w,E,F=Le){const{context:C,zip215:L}=F,P=r.BYTES;x=Fe("signature",x,2*P),w=Fe("message",w),E=Fe("publicKey",E,P),L!==void 0&&or("zip215",L),i&&(w=i(w));const D=Pt(x.slice(P,2*P));let j,M,S;try{j=m.fromHex(E,L),M=m.fromHex(x.slice(0,P),L),S=I.multiplyUnsafe(D)}catch{return!1}if(!L&&j.isSmallOrder())return!1;const Q=ye(C,M.toRawBytes(),j.toRawBytes(),w);return M.add(j.multiplyUnsafe(Q)).subtract(S).clearCofactor().equals(m.ZERO)}return I._setWindowSize(8),{CURVE:t,getPublicKey:be,sign:fe,verify:Je,ExtendedPoint:m,utils:{getExtendedPublicKey:V,randomPrivateKey:()=>f(r.BYTES),precompute(x=8,w=m.BASE){return w._setWindowSize(x),w.multiply(BigInt(3)),w}}}}BigInt(0),BigInt(1);const Or=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),mn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const au=BigInt(1),vn=BigInt(2);BigInt(3);const uu=BigInt(5),cu=BigInt(8);function fu(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=Or,f=e*e%o*e%o,d=me(f,vn,o)*f%o,c=me(d,au,o)*e%o,a=me(c,uu,o)*c%o,u=me(a,t,o)*a%o,h=me(u,r,o)*u%o,p=me(h,n,o)*h%o,b=me(p,i,o)*p%o,g=me(b,i,o)*p%o,_=me(g,t,o)*a%o;return{pow_p_5_8:me(_,vn,o)*e%o,b2:f}}function lu(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function hu(e,t){const r=Or,n=k(t*t*t,r),i=k(n*n*t,r),o=fu(e*i).pow_p_5_8;let f=k(e*n*o,r);const d=k(t*f*f,r),c=f,a=k(f*mn,r),u=d===e,h=d===k(-e,r),p=d===k(-e*mn,r);return u&&(f=c),(h||p)&&(f=a),qa(f,r)&&(f=k(-f,r)),{isValid:u||h,value:f}}const du=Yn(Or,void 0,!0),pu={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:du,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:cu,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ja,randomBytes:Wn,adjustScalarBytes:lu,uvRatio:hu},ei=su(pu),gu="EdDSA",bu="JWT",zt=".",$t="base64url",ti="utf8",ri="utf8",yu=":",wu="did",mu="key",_n="base58btc",vu="z",_u="K36",Eu=32;function Tr(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function ni(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Tr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ii(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=ni(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return Tr(r)}function xu(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),f=o.charCodeAt(0);if(r[f]!==255)throw new TypeError(o+" is ambiguous");r[f]=i}var d=e.length,c=e.charAt(0),a=Math.log(d)/Math.log(256),u=Math.log(256)/Math.log(d);function h(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var _=0,O=0,R=0,T=g.length;R!==T&&g[R]===0;)R++,_++;for(var m=(T-R)*u+1>>>0,I=new Uint8Array(m);R!==T;){for(var z=g[R],H=0,G=m-1;(z!==0||H<O)&&G!==-1;G--,H++)z+=256*I[G]>>>0,I[G]=z%d>>>0,z=z/d>>>0;if(z!==0)throw new Error("Non-zero carry");O=H,R++}for(var U=m-O;U!==m&&I[U]===0;)U++;for(var V=c.repeat(_);U<m;++U)V+=e.charAt(I[U]);return V}function p(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var _=0;if(g[_]!==" "){for(var O=0,R=0;g[_]===c;)O++,_++;for(var T=(g.length-_)*a+1>>>0,m=new Uint8Array(T);g[_];){var I=r[g.charCodeAt(_)];if(I===255)return;for(var z=0,H=T-1;(I!==0||z<R)&&H!==-1;H--,z++)I+=d*m[H]>>>0,m[H]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");R=z,_++}if(g[_]!==" "){for(var G=T-R;G!==T&&m[G]===0;)G++;for(var U=new Uint8Array(O+(T-G)),V=O;G!==T;)U[V++]=m[G++];return U}}}function b(g){var _=p(g);if(_)return _;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:b}}var Fu=xu,Su=Fu;const oi=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")},Au=e=>new TextEncoder().encode(e),Bu=e=>new TextDecoder().decode(e);class Iu{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Ou{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return si(this,t)}}class Tu{constructor(t){this.decoders=t}or(t){return si(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const si=(e,t)=>new Tu({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Cu{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Iu(t,r,n),this.decoder=new Ou(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Kt=({name:e,prefix:t,encode:r,decode:n})=>new Cu(e,t,r,n),ft=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=Su(r,t);return Kt({prefix:e,name:t,encode:n,decode:o=>oi(i(o))})},Ru=(e,t,r,n)=>{const i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let o=e.length;for(;e[o-1]==="=";)--o;const f=new Uint8Array(o*r/8|0);let d=0,c=0,a=0;for(let u=0;u<o;++u){const h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,d+=r,d>=8&&(d-=8,f[a++]=255&c>>d)}if(d>=r||255&c<<8-d)throw new SyntaxError("Unexpected end of data");return f},Lu=(e,t,r)=>{const n=t[t.length-1]==="=",i=(1<<r)-1;let o="",f=0,d=0;for(let c=0;c<e.length;++c)for(d=d<<8|e[c],f+=8;f>r;)f-=r,o+=t[i&d>>f];if(f&&(o+=t[i&d<<r-f]),n)for(;o.length*r&7;)o+="=";return o},te=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Kt({prefix:t,name:e,encode(i){return Lu(i,n,r)},decode(i){return Ru(i,n,r,e)}}),Pu=Kt({prefix:"\0",name:"identity",encode:e=>Bu(e),decode:e=>Au(e)});var ju=Object.freeze({__proto__:null,identity:Pu});const Nu=te({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var zu=Object.freeze({__proto__:null,base2:Nu});const Uu=te({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Du=Object.freeze({__proto__:null,base8:Uu});const Mu=ft({prefix:"9",name:"base10",alphabet:"0123456789"});var $u=Object.freeze({__proto__:null,base10:Mu});const Ku=te({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Hu=te({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Wu=Object.freeze({__proto__:null,base16:Ku,base16upper:Hu});const Gu=te({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vu=te({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qu=te({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ju=te({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ku=te({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zu=te({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yu=te({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xu=te({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qu=te({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ec=Object.freeze({__proto__:null,base32:Gu,base32upper:Vu,base32pad:qu,base32padupper:Ju,base32hex:ku,base32hexupper:Zu,base32hexpad:Yu,base32hexpadupper:Xu,base32z:Qu});const tc=ft({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rc=ft({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var nc=Object.freeze({__proto__:null,base36:tc,base36upper:rc});const ic=ft({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),oc=ft({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var sc=Object.freeze({__proto__:null,base58btc:ic,base58flickr:oc});const ac=te({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),uc=te({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cc=te({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fc=te({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var lc=Object.freeze({__proto__:null,base64:ac,base64pad:uc,base64url:cc,base64urlpad:fc});const ai=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),hc=ai.reduce((e,t,r)=>(e[r]=t,e),[]),dc=ai.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function pc(e){return e.reduce((t,r)=>(t+=hc[r],t),"")}function gc(e){const t=[];for(const r of e){const n=dc[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const bc=Kt({prefix:"🚀",name:"base256emoji",encode:pc,decode:gc});var yc=Object.freeze({__proto__:null,base256emoji:bc}),wc=ui,En=128,mc=-128,vc=Math.pow(2,31);function ui(e,t,r){t=t||[],r=r||0;for(var n=r;e>=vc;)t[r++]=e&255|En,e/=128;for(;e&mc;)t[r++]=e&255|En,e>>>=7;return t[r]=e|0,ui.bytes=r-n+1,t}var _c=yr,Ec=128,xn=127;function yr(e,n){var r=0,n=n||0,i=0,o=n,f,d=e.length;do{if(o>=d)throw yr.bytes=0,new RangeError("Could not decode varint");f=e[o++],r+=i<28?(f&xn)<<i:(f&xn)*Math.pow(2,i),i+=7}while(f>=Ec);return yr.bytes=o-n,r}var xc=Math.pow(2,7),Fc=Math.pow(2,14),Sc=Math.pow(2,21),Ac=Math.pow(2,28),Bc=Math.pow(2,35),Ic=Math.pow(2,42),Oc=Math.pow(2,49),Tc=Math.pow(2,56),Cc=Math.pow(2,63),Rc=function(e){return e<xc?1:e<Fc?2:e<Sc?3:e<Ac?4:e<Bc?5:e<Ic?6:e<Oc?7:e<Tc?8:e<Cc?9:10},Lc={encode:wc,decode:_c,encodingLength:Rc},ci=Lc;const Fn=(e,t,r=0)=>(ci.encode(e,t,r),t),Sn=e=>ci.encodingLength(e),wr=(e,t)=>{const r=t.byteLength,n=Sn(e),i=n+Sn(r),o=new Uint8Array(i+r);return Fn(e,o,0),Fn(r,o,n),o.set(t,i),new Pc(e,r,t,o)};class Pc{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}}const fi=({name:e,code:t,encode:r})=>new jc(e,t,r);class jc{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?wr(this.code,r):r.then(n=>wr(this.code,n))}else throw Error("Unknown type, must be binary type")}}const li=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Nc=fi({name:"sha2-256",code:18,encode:li("SHA-256")}),zc=fi({name:"sha2-512",code:19,encode:li("SHA-512")});var Uc=Object.freeze({__proto__:null,sha256:Nc,sha512:zc});const hi=0,Dc="identity",di=oi,Mc=e=>wr(hi,di(e)),$c={code:hi,name:Dc,encode:di,digest:Mc};var Kc=Object.freeze({__proto__:null,identity:$c});new TextEncoder,new TextDecoder;const An={...ju,...zu,...Du,...$u,...Wu,...ec,...nc,...sc,...lc,...yc};({...Uc,...Kc});function pi(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Bn=pi("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),lr=pi("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=ni(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),gi={utf8:Bn,"utf-8":Bn,hex:An.base16,latin1:lr,ascii:lr,binary:lr,...An};function Ht(e,t="utf8"){const r=gi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function qe(e,t="utf8"){const r=gi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Tr(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function In(e){return ra(Ht(qe(e,$t),ti))}function Ut(e){return Ht(qe(na(e),ti),$t)}function bi(e){const t=qe(_u,_n),r=vu+Ht(ii([t,e]),_n);return[wu,mu,r].join(yu)}function Hc(e){return Ht(e,$t)}function Wc(e){return qe(e,$t)}function Gc(e){return qe([Ut(e.header),Ut(e.payload)].join(zt),ri)}function Vc(e){return[Ut(e.header),Ut(e.payload),Hc(e.signature)].join(zt)}function qc(e){const t=e.split(zt),r=In(t[0]),n=In(t[1]),i=Wc(t[2]),o=qe(t.slice(0,2).join(zt),ri);return{header:r,payload:n,signature:i,data:o}}function Jc(e=Wn(Eu)){const t=ei.getPublicKey(e);return{secretKey:ii([e,t]),publicKey:t}}async function kc(e,t,r,n,i=ge.cjs.fromMiliseconds(Date.now())){const o={alg:gu,typ:bu},f=bi(n.publicKey),d=i+r,c={iss:f,sub:e,aud:t,iat:i,exp:d},a=Gc({header:o,payload:c}),u=ei.sign(a,n.secretKey.slice(0,32));return Vc({header:o,payload:c,signature:u})}const Zc="PARSE_ERROR",Yc="INVALID_REQUEST",Xc="METHOD_NOT_FOUND",Qc="INVALID_PARAMS",yi="INTERNAL_ERROR",Cr="SERVER_ERROR",ef=[-32700,-32600,-32601,-32602,-32603],it={[Zc]:{code:-32700,message:"Parse error"},[Yc]:{code:-32600,message:"Invalid Request"},[Xc]:{code:-32601,message:"Method not found"},[Qc]:{code:-32602,message:"Invalid params"},[yi]:{code:-32603,message:"Internal error"},[Cr]:{code:-32e3,message:"Server error"}},wi=Cr;function tf(e){return ef.includes(e)}function On(e){return Object.keys(it).includes(e)?it[e]:it[wi]}function rf(e){const t=Object.values(it).find(r=>r.code===e);return t||it[wi]}function nf(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var mi={};/*! *****************************************************************************
1
+ "use strict";const ge=require("./index-JqJdK8nh.js"),$=require("./index-DP4LajXh.js");function Rn(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Fo(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=Rn(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}const Zr={...ge.identityBase,...ge.base2,...ge.base8,...ge.base10,...ge.base16,...ge.base32,...ge.base36,...ge.base58,...ge.base64,...ge.base256emoji};function Ln(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Yr=Ln("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),er=Ln("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Rn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),Pn={utf8:Yr,"utf-8":Yr,hex:Zr.base16,latin1:er,ascii:er,binary:er,...Zr};function So(e,t="utf8"){const r=Pn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}function Ao(e,t="utf8"){const r=Pn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var Xr=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},Bo=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),Io=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=$.dist.process.platform}return e}(),Oo=function(){function e(t,r,n,i){this.name=t,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return e}(),To=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),Co=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),Ro=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Lo=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Qr=3,Po=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Ro]],en=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function jo(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Co:typeof navigator<"u"?zo(navigator.userAgent):Do()}function No(e){return e!==""&&Po.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function zo(e){var t=No(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new To;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<Qr&&(i=Xr(Xr([],i,!0),Mo(Qr-i.length),!0)):i=[];var o=i.join("."),f=Uo(e),d=Lo.exec(e);return d&&d[1]?new Oo(r,o,f,d[1]):new Bo(r,o,f)}function Uo(e){for(var t=0,r=en.length;t<r;t++){var n=en[t],i=n[0],o=n[1],f=o.exec(e);if(f)return i}return null}function Do(){var e=typeof $.dist.process<"u"&&$.dist.process.version;return e?new Io($.dist.process.version.slice(1)):null}function Mo(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}const $o={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},Ko=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Ho=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Wo=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Go(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Vo(e);return}return t}function Vo(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function At(e,t={}){if(typeof e!="string")return e;const r=e.trim();if(e[0]==='"'&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!Wo.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Ko.test(e)||Ho.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Go)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function qo(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function Y(e,...t){try{return qo(e(...t))}catch(r){return Promise.reject(r)}}function Jo(e){const t=typeof e;return e===null||t!=="object"&&t!=="function"}function ko(e){const t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function Rt(e){if(Jo(e))return String(e);if(ko(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return Rt(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const hr="base64:";function Zo(e){return typeof e=="string"?e:hr+Qo(e)}function Yo(e){return typeof e!="string"||!e.startsWith(hr)?e:Xo(e.slice(hr.length))}function Xo(e){return globalThis.Buffer?$.dist.Buffer.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function Qo(e){return globalThis.Buffer?$.dist.Buffer.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function oe(e){var t;return e&&((t=e.split("?")[0])==null?void 0:t.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function es(...e){return oe(e.join(":"))}function Bt(e){return e=oe(e),e?e+":":""}const ts="memory",rs=()=>{const e=new Map;return{name:ts,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}};function ns(e={}){const t={mounts:{"":e.driver||rs()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=a=>{for(const u of t.mountpoints)if(a.startsWith(u))return{base:u,relativeKey:a.slice(u.length),driver:t.mounts[u]};return{base:"",relativeKey:a,driver:t.mounts[""]}},n=(a,u)=>t.mountpoints.filter(h=>h.startsWith(a)||u&&a.startsWith(h)).map(h=>({relativeBase:a.length>h.length?a.slice(h.length):void 0,mountpoint:h,driver:t.mounts[h]})),i=(a,u)=>{if(t.watching){u=oe(u);for(const h of t.watchListeners)h(a,u)}},o=async()=>{if(!t.watching){t.watching=!0;for(const a in t.mounts)t.unwatch[a]=await tn(t.mounts[a],i,a)}},f=async()=>{if(t.watching){for(const a in t.unwatch)await t.unwatch[a]();t.unwatch={},t.watching=!1}},d=(a,u,h)=>{const p=new Map,b=g=>{let _=p.get(g.base);return _||(_={driver:g.driver,base:g.base,items:[]},p.set(g.base,_)),_};for(const g of a){const _=typeof g=="string",O=oe(_?g:g.key),R=_?void 0:g.value,T=_||!g.options?u:{...u,...g.options},m=r(O);b(m).items.push({key:O,value:R,relativeKey:m.relativeKey,options:T})}return Promise.all([...p.values()].map(g=>h(g))).then(g=>g.flat())},c={hasItem(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return Y(p.hasItem,h,u)},getItem(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return Y(p.getItem,h,u).then(b=>At(b))},getItems(a,u={}){return d(a,u,h=>h.driver.getItems?Y(h.driver.getItems,h.items.map(p=>({key:p.relativeKey,options:p.options})),u).then(p=>p.map(b=>({key:es(h.base,b.key),value:At(b.value)}))):Promise.all(h.items.map(p=>Y(h.driver.getItem,p.relativeKey,p.options).then(b=>({key:p.key,value:At(b)})))))},getItemRaw(a,u={}){a=oe(a);const{relativeKey:h,driver:p}=r(a);return p.getItemRaw?Y(p.getItemRaw,h,u):Y(p.getItem,h,u).then(b=>Yo(b))},async setItem(a,u,h={}){if(u===void 0)return c.removeItem(a);a=oe(a);const{relativeKey:p,driver:b}=r(a);b.setItem&&(await Y(b.setItem,p,Rt(u),h),b.watch||i("update",a))},async setItems(a,u){await d(a,u,async h=>{if(h.driver.setItems)return Y(h.driver.setItems,h.items.map(p=>({key:p.relativeKey,value:Rt(p.value),options:p.options})),u);h.driver.setItem&&await Promise.all(h.items.map(p=>Y(h.driver.setItem,p.relativeKey,Rt(p.value),p.options)))})},async setItemRaw(a,u,h={}){if(u===void 0)return c.removeItem(a,h);a=oe(a);const{relativeKey:p,driver:b}=r(a);if(b.setItemRaw)await Y(b.setItemRaw,p,u,h);else if(b.setItem)await Y(b.setItem,p,Zo(u),h);else return;b.watch||i("update",a)},async removeItem(a,u={}){typeof u=="boolean"&&(u={removeMeta:u}),a=oe(a);const{relativeKey:h,driver:p}=r(a);p.removeItem&&(await Y(p.removeItem,h,u),(u.removeMeta||u.removeMata)&&await Y(p.removeItem,h+"$",u),p.watch||i("remove",a))},async getMeta(a,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),a=oe(a);const{relativeKey:h,driver:p}=r(a),b=Object.create(null);if(p.getMeta&&Object.assign(b,await Y(p.getMeta,h,u)),!u.nativeOnly){const g=await Y(p.getItem,h+"$",u).then(_=>At(_));g&&typeof g=="object"&&(typeof g.atime=="string"&&(g.atime=new Date(g.atime)),typeof g.mtime=="string"&&(g.mtime=new Date(g.mtime)),Object.assign(b,g))}return b},setMeta(a,u,h={}){return this.setItem(a+"$",u,h)},removeMeta(a,u={}){return this.removeItem(a+"$",u)},async getKeys(a,u={}){a=Bt(a);const h=n(a,!0);let p=[];const b=[];for(const g of h){const _=await Y(g.driver.getKeys,g.relativeBase,u);for(const O of _){const R=g.mountpoint+oe(O);p.some(T=>R.startsWith(T))||b.push(R)}p=[g.mountpoint,...p.filter(O=>!O.startsWith(g.mountpoint))]}return a?b.filter(g=>g.startsWith(a)&&g[g.length-1]!=="$"):b.filter(g=>g[g.length-1]!=="$")},async clear(a,u={}){a=Bt(a),await Promise.all(n(a,!1).map(async h=>{if(h.driver.clear)return Y(h.driver.clear,h.relativeBase,u);if(h.driver.removeItem){const p=await h.driver.getKeys(h.relativeBase||"",u);return Promise.all(p.map(b=>h.driver.removeItem(b,u)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(a=>rn(a)))},async watch(a){return await o(),t.watchListeners.push(a),async()=>{t.watchListeners=t.watchListeners.filter(u=>u!==a),t.watchListeners.length===0&&await f()}},async unwatch(){t.watchListeners=[],await f()},mount(a,u){if(a=Bt(a),a&&t.mounts[a])throw new Error(`already mounted at ${a}`);return a&&(t.mountpoints.push(a),t.mountpoints.sort((h,p)=>p.length-h.length)),t.mounts[a]=u,t.watching&&Promise.resolve(tn(u,i,a)).then(h=>{t.unwatch[a]=h}).catch(console.error),c},async unmount(a,u=!0){var h,p;a=Bt(a),!(!a||!t.mounts[a])&&(t.watching&&a in t.unwatch&&((p=(h=t.unwatch)[a])==null||p.call(h),delete t.unwatch[a]),u&&await rn(t.mounts[a]),t.mountpoints=t.mountpoints.filter(b=>b!==a),delete t.mounts[a])},getMount(a=""){a=oe(a)+":";const u=r(a);return{driver:u.driver,base:u.base}},getMounts(a="",u={}){return a=oe(a),n(a,u.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(a,u={})=>c.getKeys(a,u),get:(a,u={})=>c.getItem(a,u),set:(a,u,h={})=>c.setItem(a,u,h),has:(a,u={})=>c.hasItem(a,u),del:(a,u={})=>c.removeItem(a,u),remove:(a,u={})=>c.removeItem(a,u)};return c}function tn(e,t,r){return e.watch?e.watch((n,i)=>t(n,r+i)):()=>{}}async function rn(e){typeof e.dispose=="function"&&await Y(e.dispose)}function Me(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function jn(e,t){const r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);const n=Me(r);return(i,o)=>n.then(f=>o(f.transaction(t,i).objectStore(t)))}let tr;function ut(){return tr||(tr=jn("keyval-store","keyval")),tr}function nn(e,t=ut()){return t("readonly",r=>Me(r.get(e)))}function is(e,t,r=ut()){return r("readwrite",n=>(n.put(t,e),Me(n.transaction)))}function os(e,t=ut()){return t("readwrite",r=>(r.delete(e),Me(r.transaction)))}function ss(e=ut()){return e("readwrite",t=>(t.clear(),Me(t.transaction)))}function as(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},Me(e.transaction)}function us(e=ut()){return e("readonly",t=>{if(t.getAllKeys)return Me(t.getAllKeys());const r=[];return as(t,n=>r.push(n.key)).then(()=>r)})}const cs=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),fs=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Nn(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return fs(e)}catch{return e}}function zn(e){return typeof e=="string"?e:cs(e)||""}const ls="idb-keyval";var hs=(e={})=>{const t=e.base&&e.base.length>0?`${e.base}:`:"",r=i=>t+i;let n;return e.dbName&&e.storeName&&(n=jn(e.dbName,e.storeName)),{name:ls,options:e,async hasItem(i){return!(typeof await nn(r(i),n)>"u")},async getItem(i){return await nn(r(i),n)??null},setItem(i,o){return is(r(i),o,n)},removeItem(i){return os(r(i),n)},getKeys(){return us(n)},clear(){return ss(n)}}};const ds="WALLET_CONNECT_V2_INDEXED_DB",ps="keyvaluestorage";let gs=class{constructor(){this.indexedDb=ns({driver:hs({dbName:ds,storeName:ps})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){const r=await this.indexedDb.getItem(t);if(r!==null)return r}async setItem(t,r){await this.indexedDb.setItem(t,zn(r))}async removeItem(t){await this.indexedDb.removeItem(t)}};var rr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof $.dist.global<"u"?$.dist.global:typeof self<"u"?self:{},Lt={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},e.prototype.setItem=function(r,n){this[r]=String(n)},e.prototype.removeItem=function(r){delete this[r]},e.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},e.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof rr<"u"&&rr.localStorage?Lt.exports=rr.localStorage:typeof window<"u"&&window.localStorage?Lt.exports=window.localStorage:Lt.exports=new t})();function bs(e){var t;return[e[0],Nn((t=e[1])!=null?t:"")]}let ys=class{constructor(){this.localStorage=Lt.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(bs)}async getItem(t){const r=this.localStorage.getItem(t);if(r!==null)return Nn(r)}async setItem(t,r){this.localStorage.setItem(t,zn(r))}async removeItem(t){this.localStorage.removeItem(t)}};const ws="wc_storage_version",on=1,ms=async(e,t,r)=>{const n=ws,i=await t.getItem(n);if(i&&i>=on){r(t);return}const o=await e.getKeys();if(!o.length){r(t);return}const f=[];for(;o.length;){const d=o.shift();if(!d)continue;const c=d.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){const a=await e.getItem(d);await t.setItem(d,a),f.push(d)}}await t.setItem(n,on),r(t),vs(e,f)},vs=async(e,t)=>{t.length&&t.forEach(async r=>{await e.removeItem(r)})};class _s{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const t=new ys;this.storage=t;try{const r=new gs;ms(t,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,r){return await this.initialize(),this.storage.setItem(t,r)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),t())},20)})}}class Es{}function xs(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}var Fs=Ss;function Ss(e,t,r){var n=r&&r.stringify||xs,i=1;if(typeof e=="object"&&e!==null){var o=t.length+i;if(o===1)return e;var f=new Array(o);f[0]=n(e);for(var d=1;d<o;d++)f[d]=n(t[d]);return f.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var a="",u=1-i,h=-1,p=e&&e.length||0,b=0;b<p;){if(e.charCodeAt(b)===37&&b+1<p){switch(h=h>-1?h:0,e.charCodeAt(b+1)){case 100:case 102:if(u>=c||t[u]==null)break;h<b&&(a+=e.slice(h,b)),a+=Number(t[u]),h=b+2,b++;break;case 105:if(u>=c||t[u]==null)break;h<b&&(a+=e.slice(h,b)),a+=Math.floor(Number(t[u])),h=b+2,b++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;h<b&&(a+=e.slice(h,b));var g=typeof t[u];if(g==="string"){a+="'"+t[u]+"'",h=b+2,b++;break}if(g==="function"){a+=t[u].name||"<anonymous>",h=b+2,b++;break}a+=n(t[u]),h=b+2,b++;break;case 115:if(u>=c)break;h<b&&(a+=e.slice(h,b)),a+=String(t[u]),h=b+2,b++;break;case 37:h<b&&(a+=e.slice(h,b)),a+="%",h=b+2,b++,u--;break}++u}++b}return h===-1?e:(h<p&&(a+=e.slice(h)),a)}const sn=Fs;var Ve=ve;const ot=js().console||{},As={mapHttpRequest:It,mapHttpResponse:It,wrapRequestSerializer:nr,wrapResponseSerializer:nr,wrapErrorSerializer:nr,req:It,res:It,err:Cs};function Bs(e,t){return Array.isArray(e)?e.filter(function(n){return n!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function ve(e){e=e||{},e.browser=e.browser||{};const t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");const r=e.browser.write||ot;e.browser.write&&(e.browser.asObject=!0);const n=e.serializers||{},i=Bs(e.browser.serialize,n);let o=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(o=!1);const f=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),e.enabled===!1&&(e.level="silent");const d=e.level||"info",c=Object.create(r);c.log||(c.log=st),Object.defineProperty(c,"levelVal",{get:u}),Object.defineProperty(c,"level",{get:h,set:p});const a={transmit:t,serialize:i,asObject:e.browser.asObject,levels:f,timestamp:Rs(e)};c.levels=ve.levels,c.level=d,c.setMaxListeners=c.getMaxListeners=c.emit=c.addListener=c.on=c.prependListener=c.once=c.prependOnceListener=c.removeListener=c.removeAllListeners=c.listeners=c.listenerCount=c.eventNames=c.write=c.flush=st,c.serializers=n,c._serialize=i,c._stdErrSerialize=o,c.child=b,t&&(c._logEvent=dr());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function h(){return this._level}function p(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,He(a,c,"error","log"),He(a,c,"fatal","error"),He(a,c,"warn","error"),He(a,c,"info","log"),He(a,c,"debug","log"),He(a,c,"trace","log")}function b(g,_){if(!g)throw new Error("missing bindings for child Pino");_=_||{},i&&g.serializers&&(_.serializers=g.serializers);const O=_.serializers;if(i&&O){var R=Object.assign({},n,O),T=e.browser.serialize===!0?Object.keys(R):i;delete g.serializers,Mt([g],T,R,this._stdErrSerialize)}function m(I){this._childLevel=(I._childLevel|0)+1,this.error=We(I,g,"error"),this.fatal=We(I,g,"fatal"),this.warn=We(I,g,"warn"),this.info=We(I,g,"info"),this.debug=We(I,g,"debug"),this.trace=We(I,g,"trace"),R&&(this.serializers=R,this._serialize=T),t&&(this._logEvent=dr([].concat(I._logEvent.bindings,g)))}return m.prototype=this,new m(this)}return c}ve.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};ve.stdSerializers=As;ve.stdTimeFunctions=Object.assign({},{nullTime:Un,epochTime:Dn,unixTime:Ls,isoTime:Ps});function He(e,t,r,n){const i=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?st:i[r]?i[r]:ot[r]||ot[n]||st,Is(e,t,r)}function Is(e,t,r){!e.transmit&&t[r]===st||(t[r]=function(n){return function(){const o=e.timestamp(),f=new Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===ot?ot:this;for(var c=0;c<f.length;c++)f[c]=arguments[c];if(e.serialize&&!e.asObject&&Mt(f,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?n.call(d,Os(this,r,f,o)):n.apply(d,f),e.transmit){const a=e.transmit.level||t.level,u=ve.levels.values[a],h=ve.levels.values[r];if(h<u)return;Ts(this,{ts:o,methodLevel:r,methodValue:h,transmitValue:ve.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},f)}}}(t[r]))}function Os(e,t,r,n){e._serialize&&Mt(r,e._serialize,e.serializers,e._stdErrSerialize);const i=r.slice();let o=i[0];const f={};n&&(f.time=n),f.level=ve.levels.values[t];let d=(e._childLevel|0)+1;if(d<1&&(d=1),o!==null&&typeof o=="object"){for(;d--&&typeof i[0]=="object";)Object.assign(f,i.shift());o=i.length?sn(i.shift(),i):void 0}else typeof o=="string"&&(o=sn(i.shift(),i));return o!==void 0&&(f.msg=o),f}function Mt(e,t,r,n){for(const i in e)if(n&&e[i]instanceof Error)e[i]=ve.stdSerializers.err(e[i]);else if(typeof e[i]=="object"&&!Array.isArray(e[i]))for(const o in e[i])t&&t.indexOf(o)>-1&&o in r&&(e[i][o]=r[o](e[i][o]))}function We(e,t,r){return function(){const n=new Array(1+arguments.length);n[0]=t;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return e[r].apply(this,n)}}function Ts(e,t,r){const n=t.send,i=t.ts,o=t.methodLevel,f=t.methodValue,d=t.val,c=e._logEvent.bindings;Mt(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(a){return c.indexOf(a)===-1}),e._logEvent.level.label=o,e._logEvent.level.value=f,n(o,e._logEvent,d),e._logEvent=dr(c)}function dr(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function Cs(e){const t={type:e.constructor.name,msg:e.message,stack:e.stack};for(const r in e)t[r]===void 0&&(t[r]=e[r]);return t}function Rs(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?Un:Dn}function It(){return{}}function nr(e){return e}function st(){}function Un(){return!1}function Dn(){return Date.now()}function Ls(){return Math.round(Date.now()/1e3)}function Ps(){return new Date(Date.now()).toISOString()}function js(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}const Er=$.getDefaultExportFromCjs(Ve),Ns=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r);function an(e){return typeof e=="string"?e:Ns(e)||""}const zs={level:"info"},ct="custom_context",xr=1e3*1024;class Us{constructor(t){this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class un{constructor(t){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){const r=new Us(t);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){const t=[];let r=this.head;for(;r!==null;)t.push(r.value),r=r.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};const r=t.value;return t=t.next,{done:!1,value:r}}}}}class Mn{constructor(t,r=xr){this.level=t??"error",this.levelValue=Ve.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new un(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,r){r===Ve.levels.values.error?console.error(t):r===Ve.levels.values.warn?console.warn(t):r===Ve.levels.values.debug?console.debug(t):r===Ve.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(an({timestamp:new Date().toISOString(),log:t}));const r=typeof t=="string"?JSON.parse(t).level:t.level;r>=this.levelValue&&this.forwardToConsole(t,r)}getLogs(){return this.logs}clearLogs(){this.logs=new un(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){const r=this.getLogArray();return r.push(an({extraMetadata:t})),new Blob(r,{type:"application/json"})}}class Ds{constructor(t,r=xr){this.baseChunkLogger=new Mn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){const r=URL.createObjectURL(this.logsToBlob(t)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}}class Ms{constructor(t,r=xr){this.baseChunkLogger=new Mn(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}}var $s=Object.defineProperty,Ks=Object.defineProperties,Hs=Object.getOwnPropertyDescriptors,cn=Object.getOwnPropertySymbols,Ws=Object.prototype.hasOwnProperty,Gs=Object.prototype.propertyIsEnumerable,fn=(e,t,r)=>t in e?$s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jt=(e,t)=>{for(var r in t||(t={}))Ws.call(t,r)&&fn(e,r,t[r]);if(cn)for(var r of cn(t))Gs.call(t,r)&&fn(e,r,t[r]);return e},Nt=(e,t)=>Ks(e,Hs(t));function Vs(e){return Nt(jt({},e),{level:(e==null?void 0:e.level)||zs.level})}function qs(e,t=ct){return e[t]||""}function Js(e,t,r=ct){return e[r]=t,e}function $n(e,t=ct){let r="";return typeof e.bindings>"u"?r=qs(e,t):r=e.bindings().context||"",r}function ks(e,t,r=ct){const n=$n(e,r);return n.trim()?`${n}/${t}`:t}function Zs(e,t,r=ct){const n=ks(e,t,r),i=e.child({context:n});return Js(i,n,r)}function Ys(e){var t,r;const n=new Ds((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Er(Nt(jt({},e.opts),{level:"trace",browser:Nt(jt({},(r=e.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function Xs(e){var t;const r=new Ms((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Er(Nt(jt({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}function Qs(e){return typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string"?{logger:e.loggerOverride,chunkLoggerController:null}:typeof window<"u"?Ys(e):Xs(e)}const ea=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),ta=e=>{const t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function ra(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return ta(e)}catch{return e}}function na(e){return typeof e=="string"?e:ea(e)||""}function ia(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Kn(e,...t){if(!ia(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ln(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function oa(e,t){Kn(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Ge=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ir=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function sa(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Hn(e){return typeof e=="string"&&(e=sa(e)),Kn(e),e}class aa{clone(){return this._cloneInto()}}function ua(e){const t=n=>e().update(Hn(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Wn(e=32){if(Ge&&typeof Ge.getRandomValues=="function")return Ge.getRandomValues(new Uint8Array(e));if(Ge&&typeof Ge.randomBytes=="function")return Ge.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function ca(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),f=Number(r>>i&o),d=Number(r&o),c=n?4:0,a=n?0:4;e.setUint32(t+c,f,n),e.setUint32(t+a,d,n)}class fa extends aa{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=ir(this.buffer)}update(t){ln(this);const{view:r,buffer:n,blockLen:i}=this;t=Hn(t);const o=t.length;for(let f=0;f<o;){const d=Math.min(i-this.pos,o-f);if(d===i){const c=ir(t);for(;i<=o-f;f+=i)this.process(c,f);continue}n.set(t.subarray(f,f+d),this.pos),this.pos+=d,f+=d,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ln(this),oa(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:f}=this;r[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>i-f&&(this.process(n,0),f=0);for(let h=f;h<i;h++)r[h]=0;ca(n,i-8,BigInt(this.length*8),o),this.process(n,0);const d=ir(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const a=c/4,u=this.get();if(a>u.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<a;h++)d.setUint32(4*h,u[h],o)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:o,destroyed:f,pos:d}=this;return t.length=i,t.pos=d,t.finished=o,t.destroyed=f,i%r&&t.buffer.set(n),t}}const Ot=BigInt(2**32-1),pr=BigInt(32);function Gn(e,t=!1){return t?{h:Number(e&Ot),l:Number(e>>pr&Ot)}:{h:Number(e>>pr&Ot)|0,l:Number(e&Ot)|0}}function la(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:f}=Gn(e[i],t);[r[i],n[i]]=[o,f]}return[r,n]}const ha=(e,t)=>BigInt(e>>>0)<<pr|BigInt(t>>>0),da=(e,t,r)=>e>>>r,pa=(e,t,r)=>e<<32-r|t>>>r,ga=(e,t,r)=>e>>>r|t<<32-r,ba=(e,t,r)=>e<<32-r|t>>>r,ya=(e,t,r)=>e<<64-r|t>>>r-32,wa=(e,t,r)=>e>>>r-32|t<<64-r,ma=(e,t)=>t,va=(e,t)=>e,_a=(e,t,r)=>e<<r|t>>>32-r,Ea=(e,t,r)=>t<<r|e>>>32-r,xa=(e,t,r)=>t<<r-32|e>>>64-r,Fa=(e,t,r)=>e<<r-32|t>>>64-r;function Sa(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const Aa=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Ba=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Ia=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Oa=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,Ta=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Ca=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,B={fromBig:Gn,split:la,toBig:ha,shrSH:da,shrSL:pa,rotrSH:ga,rotrSL:ba,rotrBH:ya,rotrBL:wa,rotr32H:ma,rotr32L:va,rotlSH:_a,rotlSL:Ea,rotlBH:xa,rotlBL:Fa,add:Sa,add3L:Aa,add3H:Ba,add4L:Ia,add4H:Oa,add5H:Ca,add5L:Ta},[Ra,La]=B.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Ce=new Uint32Array(80),Re=new Uint32Array(80);class Pa extends fa{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:i,Ch:o,Cl:f,Dh:d,Dl:c,Eh:a,El:u,Fh:h,Fl:p,Gh:b,Gl:g,Hh:_,Hl:O}=this;return[t,r,n,i,o,f,d,c,a,u,h,p,b,g,_,O]}set(t,r,n,i,o,f,d,c,a,u,h,p,b,g,_,O){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=f|0,this.Dh=d|0,this.Dl=c|0,this.Eh=a|0,this.El=u|0,this.Fh=h|0,this.Fl=p|0,this.Gh=b|0,this.Gl=g|0,this.Hh=_|0,this.Hl=O|0}process(t,r){for(let m=0;m<16;m++,r+=4)Ce[m]=t.getUint32(r),Re[m]=t.getUint32(r+=4);for(let m=16;m<80;m++){const I=Ce[m-15]|0,z=Re[m-15]|0,H=B.rotrSH(I,z,1)^B.rotrSH(I,z,8)^B.shrSH(I,z,7),G=B.rotrSL(I,z,1)^B.rotrSL(I,z,8)^B.shrSL(I,z,7),U=Ce[m-2]|0,V=Re[m-2]|0,be=B.rotrSH(U,V,19)^B.rotrBH(U,V,61)^B.shrSH(U,V,6),ye=B.rotrSL(U,V,19)^B.rotrBL(U,V,61)^B.shrSL(U,V,6),fe=B.add4L(G,ye,Re[m-7],Re[m-16]),Le=B.add4H(fe,H,be,Ce[m-7],Ce[m-16]);Ce[m]=Le|0,Re[m]=fe|0}let{Ah:n,Al:i,Bh:o,Bl:f,Ch:d,Cl:c,Dh:a,Dl:u,Eh:h,El:p,Fh:b,Fl:g,Gh:_,Gl:O,Hh:R,Hl:T}=this;for(let m=0;m<80;m++){const I=B.rotrSH(h,p,14)^B.rotrSH(h,p,18)^B.rotrBH(h,p,41),z=B.rotrSL(h,p,14)^B.rotrSL(h,p,18)^B.rotrBL(h,p,41),H=h&b^~h&_,G=p&g^~p&O,U=B.add5L(T,z,G,La[m],Re[m]),V=B.add5H(U,R,I,H,Ra[m],Ce[m]),be=U|0,ye=B.rotrSH(n,i,28)^B.rotrBH(n,i,34)^B.rotrBH(n,i,39),fe=B.rotrSL(n,i,28)^B.rotrBL(n,i,34)^B.rotrBL(n,i,39),Le=n&o^n&d^o&d,Je=i&f^i&c^f&c;R=_|0,T=O|0,_=b|0,O=g|0,b=h|0,g=p|0,{h,l:p}=B.add(a|0,u|0,V|0,be|0),a=d|0,u=c|0,d=o|0,c=f|0,o=n|0,f=i|0;const x=B.add3L(be,fe,Je);n=B.add3H(x,V,ye,Le),i=x|0}({h:n,l:i}=B.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:f}=B.add(this.Bh|0,this.Bl|0,o|0,f|0),{h:d,l:c}=B.add(this.Ch|0,this.Cl|0,d|0,c|0),{h:a,l:u}=B.add(this.Dh|0,this.Dl|0,a|0,u|0),{h,l:p}=B.add(this.Eh|0,this.El|0,h|0,p|0),{h:b,l:g}=B.add(this.Fh|0,this.Fl|0,b|0,g|0),{h:_,l:O}=B.add(this.Gh|0,this.Gl|0,_|0,O|0),{h:R,l:T}=B.add(this.Hh|0,this.Hl|0,R|0,T|0),this.set(n,i,o,f,d,c,a,u,h,p,b,g,_,O,R,T)}roundClean(){Ce.fill(0),Re.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const ja=ua(()=>new Pa);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Fr=BigInt(0),Vn=BigInt(1),Na=BigInt(2);function Sr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ar(e){if(!Sr(e))throw new Error("Uint8Array expected")}function or(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const za=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Br(e){Ar(e);let t="";for(let r=0;r<e.length;r++)t+=za[e[r]];return t}function qn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?Fr:BigInt("0x"+e)}const xe={_0:48,_9:57,A:65,F:70,a:97,f:102};function hn(e){if(e>=xe._0&&e<=xe._9)return e-xe._0;if(e>=xe.A&&e<=xe.F)return e-(xe.A-10);if(e>=xe.a&&e<=xe.f)return e-(xe.a-10)}function Jn(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){const f=hn(e.charCodeAt(o)),d=hn(e.charCodeAt(o+1));if(f===void 0||d===void 0){const c=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}n[i]=f*16+d}return n}function Ua(e){return qn(Br(e))}function Pt(e){return Ar(e),qn(Br(Uint8Array.from(e).reverse()))}function kn(e,t){return Jn(e.toString(16).padStart(t*2,"0"))}function gr(e,t){return kn(e,t).reverse()}function Fe(e,t,r){let n;if(typeof t=="string")try{n=Jn(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else if(Sr(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(e+" of length "+r+" expected, got "+i);return n}function dn(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];Ar(i),t+=i.length}const r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){const o=e[n];r.set(o,i),i+=o.length}return r}const sr=e=>typeof e=="bigint"&&Fr<=e;function Da(e,t,r){return sr(e)&&sr(t)&&sr(r)&&t<=e&&e<r}function nt(e,t,r,n){if(!Da(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Ma(e){let t;for(t=0;e>Fr;e>>=Vn,t+=1);return t}const $a=e=>(Na<<BigInt(e-1))-Vn,Ka={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Sr(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Ir(e,t,r={}){const n=(i,o,f)=>{const d=Ka[o];if(typeof d!="function")throw new Error("invalid validator function");const c=e[i];if(!(f&&c===void 0)&&!d(c,e))throw new Error("param "+String(i)+" is invalid. Expected "+o+", got "+c)};for(const[i,o]of Object.entries(t))n(i,o,!1);for(const[i,o]of Object.entries(r))n(i,o,!0);return e}function pn(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(i!==void 0)return i;const o=e(r,...n);return t.set(r,o),o}}const X=BigInt(0),q=BigInt(1),De=BigInt(2),Ha=BigInt(3),br=BigInt(4),gn=BigInt(5),bn=BigInt(8);function k(e,t){const r=e%t;return r>=X?r:t+r}function Wa(e,t,r){if(t<X)throw new Error("invalid exponent, negatives unsupported");if(r<=X)throw new Error("invalid modulus");if(r===q)return X;let n=q;for(;t>X;)t&q&&(n=n*e%r),e=e*e%r,t>>=q;return n}function me(e,t,r){let n=e;for(;t-- >X;)n*=n,n%=r;return n}function yn(e,t){if(e===X)throw new Error("invert: expected non-zero number");if(t<=X)throw new Error("invert: expected positive modulus, got "+t);let r=k(e,t),n=t,i=X,o=q;for(;r!==X;){const f=n/r,d=n%r,c=i-o*f;n=r,r=d,i=o,o=c}if(n!==q)throw new Error("invert: does not exist");return k(i,t)}function Ga(e){const t=(e-q)/De;let r,n,i;for(r=e-q,n=0;r%De===X;r/=De,n++);for(i=De;i<e&&Wa(i,t,e)!==e-q;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const f=(e+q)/br;return function(d,c){const a=d.pow(c,f);if(!d.eql(d.sqr(a),c))throw new Error("Cannot find square root");return a}}const o=(r+q)/De;return function(f,d){if(f.pow(d,t)===f.neg(f.ONE))throw new Error("Cannot find square root");let c=n,a=f.pow(f.mul(f.ONE,i),r),u=f.pow(d,o),h=f.pow(d,r);for(;!f.eql(h,f.ONE);){if(f.eql(h,f.ZERO))return f.ZERO;let p=1;for(let g=f.sqr(h);p<c&&!f.eql(g,f.ONE);p++)g=f.sqr(g);const b=f.pow(a,q<<BigInt(c-p-1));a=f.sqr(b),u=f.mul(u,b),h=f.mul(h,a),c=p}return u}}function Va(e){if(e%br===Ha){const t=(e+q)/br;return function(r,n){const i=r.pow(n,t);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(e%bn===gn){const t=(e-gn)/bn;return function(r,n){const i=r.mul(n,De),o=r.pow(i,t),f=r.mul(n,o),d=r.mul(r.mul(f,De),o),c=r.mul(f,r.sub(d,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return Ga(e)}const qa=(e,t)=>(k(e,t)&q)===q,Ja=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ka(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=Ja.reduce((n,i)=>(n[i]="function",n),t);return Ir(e,r)}function Za(e,t,r){if(r<X)throw new Error("invalid exponent, negatives unsupported");if(r===X)return e.ONE;if(r===q)return t;let n=e.ONE,i=t;for(;r>X;)r&q&&(n=e.mul(n,i)),i=e.sqr(i),r>>=q;return n}function Ya(e,t){const r=new Array(t.length),n=t.reduce((o,f,d)=>e.is0(f)?o:(r[d]=o,e.mul(o,f)),e.ONE),i=e.inv(n);return t.reduceRight((o,f,d)=>e.is0(f)?o:(r[d]=e.mul(o,r[d]),e.mul(o,f)),i),r}function Zn(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Yn(e,t,r=!1,n={}){if(e<=X)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:i,nByteLength:o}=Zn(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let f;const d=Object.freeze({ORDER:e,isLE:r,BITS:i,BYTES:o,MASK:$a(i),ZERO:X,ONE:q,create:c=>k(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return X<=c&&c<e},is0:c=>c===X,isOdd:c=>(c&q)===q,neg:c=>k(-c,e),eql:(c,a)=>c===a,sqr:c=>k(c*c,e),add:(c,a)=>k(c+a,e),sub:(c,a)=>k(c-a,e),mul:(c,a)=>k(c*a,e),pow:(c,a)=>Za(d,c,a),div:(c,a)=>k(c*yn(a,e),e),sqrN:c=>c*c,addN:(c,a)=>c+a,subN:(c,a)=>c-a,mulN:(c,a)=>c*a,inv:c=>yn(c,e),sqrt:n.sqrt||(c=>(f||(f=Va(e)),f(d,c))),invertBatch:c=>Ya(d,c),cmov:(c,a,u)=>u?a:c,toBytes:c=>r?gr(c,o):kn(c,o),fromBytes:c=>{if(c.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+c.length);return r?Pt(c):Ua(c)}});return Object.freeze(d)}const wn=BigInt(0),Tt=BigInt(1);function ar(e,t){const r=t.negate();return e?r:t}function Xn(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function ur(e,t){Xn(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function Xa(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function Qa(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const cr=new WeakMap,Qn=new WeakMap;function fr(e){return Qn.get(e)||1}function eu(e,t){return{constTimeNegate:ar,hasPrecomputes(r){return fr(r)!==1},unsafeLadder(r,n,i=e.ZERO){let o=r;for(;n>wn;)n&Tt&&(i=i.add(o)),o=o.double(),n>>=Tt;return i},precomputeWindow(r,n){const{windows:i,windowSize:o}=ur(n,t),f=[];let d=r,c=d;for(let a=0;a<i;a++){c=d,f.push(c);for(let u=1;u<o;u++)c=c.add(d),f.push(c);d=c.double()}return f},wNAF(r,n,i){const{windows:o,windowSize:f}=ur(r,t);let d=e.ZERO,c=e.BASE;const a=BigInt(2**r-1),u=2**r,h=BigInt(r);for(let p=0;p<o;p++){const b=p*f;let g=Number(i&a);i>>=h,g>f&&(g-=u,i+=Tt);const _=b,O=b+Math.abs(g)-1,R=p%2!==0,T=g<0;g===0?c=c.add(ar(R,n[_])):d=d.add(ar(T,n[O]))}return{p:d,f:c}},wNAFUnsafe(r,n,i,o=e.ZERO){const{windows:f,windowSize:d}=ur(r,t),c=BigInt(2**r-1),a=2**r,u=BigInt(r);for(let h=0;h<f;h++){const p=h*d;if(i===wn)break;let b=Number(i&c);if(i>>=u,b>d&&(b-=a,i+=Tt),b===0)continue;let g=n[p+Math.abs(b)-1];b<0&&(g=g.negate()),o=o.add(g)}return o},getPrecomputes(r,n,i){let o=cr.get(n);return o||(o=this.precomputeWindow(n,r),r!==1&&cr.set(n,i(o))),o},wNAFCached(r,n,i){const o=fr(r);return this.wNAF(o,this.getPrecomputes(o,r,i),n)},wNAFCachedUnsafe(r,n,i,o){const f=fr(r);return f===1?this.unsafeLadder(r,n,o):this.wNAFUnsafe(f,this.getPrecomputes(f,r,i),n,o)},setWindowSize(r,n){Xn(n,t),Qn.set(r,n),cr.delete(r)}}}function tu(e,t,r,n){if(Xa(r,e),Qa(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,o=Ma(BigInt(r.length)),f=o>12?o-3:o>4?o-2:o?2:1,d=(1<<f)-1,c=new Array(d+1).fill(i),a=Math.floor((t.BITS-1)/f)*f;let u=i;for(let h=a;h>=0;h-=f){c.fill(i);for(let b=0;b<n.length;b++){const g=n[b],_=Number(g>>BigInt(h)&BigInt(d));c[_]=c[_].add(r[b])}let p=i;for(let b=c.length-1,g=i;b>0;b--)g=g.add(c[b]),p=p.add(g);if(u=u.add(p),h!==0)for(let b=0;b<f;b++)u=u.double()}return u}function ru(e){return ka(e.Fp),Ir(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Zn(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const pe=BigInt(0),ie=BigInt(1),Ct=BigInt(2),nu=BigInt(8),iu={zip215:!0};function ou(e){const t=ru(e);return Ir(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function su(e){const t=ou(e),{Fp:r,n,prehash:i,hash:o,randomBytes:f,nByteLength:d,h:c}=t,a=Ct<<BigInt(d*8)-ie,u=r.create,h=Yn(t.n,t.nBitLength),p=t.uvRatio||((x,w)=>{try{return{isValid:!0,value:r.sqrt(x*r.inv(w))}}catch{return{isValid:!1,value:pe}}}),b=t.adjustScalarBytes||(x=>x),g=t.domain||((x,w,E)=>{if(or("phflag",E),w.length||E)throw new Error("Contexts/pre-hash are not supported");return x});function _(x,w){nt("coordinate "+x,w,pe,a)}function O(x){if(!(x instanceof m))throw new Error("ExtendedPoint expected")}const R=pn((x,w)=>{const{ex:E,ey:F,ez:C}=x,L=x.is0();w==null&&(w=L?nu:r.inv(C));const P=u(E*w),D=u(F*w),j=u(C*w);if(L)return{x:pe,y:ie};if(j!==ie)throw new Error("invZ was invalid");return{x:P,y:D}}),T=pn(x=>{const{a:w,d:E}=t;if(x.is0())throw new Error("bad point: ZERO");const{ex:F,ey:C,ez:L,et:P}=x,D=u(F*F),j=u(C*C),M=u(L*L),S=u(M*M),Q=u(D*w),le=u(M*u(Q+j)),J=u(S+u(E*u(D*j)));if(le!==J)throw new Error("bad point: equation left != right (1)");const ne=u(F*C),he=u(L*P);if(ne!==he)throw new Error("bad point: equation left != right (2)");return!0});class m{constructor(w,E,F,C){this.ex=w,this.ey=E,this.ez=F,this.et=C,_("x",w),_("y",E),_("z",F),_("t",C),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(w){if(w instanceof m)throw new Error("extended point not allowed");const{x:E,y:F}=w||{};return _("x",E),_("y",F),new m(E,F,ie,u(E*F))}static normalizeZ(w){const E=r.invertBatch(w.map(F=>F.ez));return w.map((F,C)=>F.toAffine(E[C])).map(m.fromAffine)}static msm(w,E){return tu(m,h,w,E)}_setWindowSize(w){H.setWindowSize(this,w)}assertValidity(){T(this)}equals(w){O(w);const{ex:E,ey:F,ez:C}=this,{ex:L,ey:P,ez:D}=w,j=u(E*D),M=u(L*C),S=u(F*D),Q=u(P*C);return j===M&&S===Q}is0(){return this.equals(m.ZERO)}negate(){return new m(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){const{a:w}=t,{ex:E,ey:F,ez:C}=this,L=u(E*E),P=u(F*F),D=u(Ct*u(C*C)),j=u(w*L),M=E+F,S=u(u(M*M)-L-P),Q=j+P,le=Q-D,J=j-P,ne=u(S*le),he=u(Q*J),we=u(S*J),Be=u(le*Q);return new m(ne,he,Be,we)}add(w){O(w);const{a:E,d:F}=t,{ex:C,ey:L,ez:P,et:D}=this,{ex:j,ey:M,ez:S,et:Q}=w;if(E===BigInt(-1)){const lt=u((L-C)*(M+j)),ht=u((L+C)*(M-j)),Ye=u(ht-lt);if(Ye===pe)return this.double();const dt=u(P*Ct*Q),pt=u(D*Ct*S),gt=pt+dt,bt=ht+lt,yt=pt-dt,$e=u(gt*Ye),Xe=u(bt*yt),wt=u(gt*yt),ae=u(Ye*bt);return new m($e,Xe,ae,wt)}const le=u(C*j),J=u(L*M),ne=u(D*F*Q),he=u(P*S),we=u((C+L)*(j+M)-le-J),Be=he-ne,ke=he+ne,Ze=u(J-E*le),Wt=u(we*Be),Gt=u(ke*Ze),Vt=u(we*Ze),qt=u(Be*ke);return new m(Wt,Gt,qt,Vt)}subtract(w){return this.add(w.negate())}wNAF(w){return H.wNAFCached(this,w,m.normalizeZ)}multiply(w){const E=w;nt("scalar",E,ie,n);const{p:F,f:C}=this.wNAF(E);return m.normalizeZ([F,C])[0]}multiplyUnsafe(w,E=m.ZERO){const F=w;return nt("scalar",F,pe,n),F===pe?z:this.is0()||F===ie?this:H.wNAFCachedUnsafe(this,F,m.normalizeZ,E)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return H.unsafeLadder(this,n).is0()}toAffine(w){return R(this,w)}clearCofactor(){const{h:w}=t;return w===ie?this:this.multiplyUnsafe(w)}static fromHex(w,E=!1){const{d:F,a:C}=t,L=r.BYTES;w=Fe("pointHex",w,L),or("zip215",E);const P=w.slice(),D=w[L-1];P[L-1]=D&-129;const j=Pt(P),M=E?a:r.ORDER;nt("pointHex.y",j,pe,M);const S=u(j*j),Q=u(S-ie),le=u(F*S-C);let{isValid:J,value:ne}=p(Q,le);if(!J)throw new Error("Point.fromHex: invalid y coordinate");const he=(ne&ie)===ie,we=(D&128)!==0;if(!E&&ne===pe&&we)throw new Error("Point.fromHex: x=0 and x_0=1");return we!==he&&(ne=u(-ne)),m.fromAffine({x:ne,y:j})}static fromPrivateKey(w){return V(w).point}toRawBytes(){const{x:w,y:E}=this.toAffine(),F=gr(E,r.BYTES);return F[F.length-1]|=w&ie?128:0,F}toHex(){return Br(this.toRawBytes())}}m.BASE=new m(t.Gx,t.Gy,ie,u(t.Gx*t.Gy)),m.ZERO=new m(pe,ie,ie,pe);const{BASE:I,ZERO:z}=m,H=eu(m,d*8);function G(x){return k(x,n)}function U(x){return G(Pt(x))}function V(x){const w=r.BYTES;x=Fe("private key",x,w);const E=Fe("hashed private key",o(x),2*w),F=b(E.slice(0,w)),C=E.slice(w,2*w),L=U(F),P=I.multiply(L),D=P.toRawBytes();return{head:F,prefix:C,scalar:L,point:P,pointBytes:D}}function be(x){return V(x).pointBytes}function ye(x=new Uint8Array,...w){const E=dn(...w);return U(o(g(E,Fe("context",x),!!i)))}function fe(x,w,E={}){x=Fe("message",x),i&&(x=i(x));const{prefix:F,scalar:C,pointBytes:L}=V(w),P=ye(E.context,F,x),D=I.multiply(P).toRawBytes(),j=ye(E.context,D,L,x),M=G(P+j*C);nt("signature.s",M,pe,n);const S=dn(D,gr(M,r.BYTES));return Fe("result",S,r.BYTES*2)}const Le=iu;function Je(x,w,E,F=Le){const{context:C,zip215:L}=F,P=r.BYTES;x=Fe("signature",x,2*P),w=Fe("message",w),E=Fe("publicKey",E,P),L!==void 0&&or("zip215",L),i&&(w=i(w));const D=Pt(x.slice(P,2*P));let j,M,S;try{j=m.fromHex(E,L),M=m.fromHex(x.slice(0,P),L),S=I.multiplyUnsafe(D)}catch{return!1}if(!L&&j.isSmallOrder())return!1;const Q=ye(C,M.toRawBytes(),j.toRawBytes(),w);return M.add(j.multiplyUnsafe(Q)).subtract(S).clearCofactor().equals(m.ZERO)}return I._setWindowSize(8),{CURVE:t,getPublicKey:be,sign:fe,verify:Je,ExtendedPoint:m,utils:{getExtendedPublicKey:V,randomPrivateKey:()=>f(r.BYTES),precompute(x=8,w=m.BASE){return w._setWindowSize(x),w.multiply(BigInt(3)),w}}}}BigInt(0),BigInt(1);const Or=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),mn=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const au=BigInt(1),vn=BigInt(2);BigInt(3);const uu=BigInt(5),cu=BigInt(8);function fu(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=Or,f=e*e%o*e%o,d=me(f,vn,o)*f%o,c=me(d,au,o)*e%o,a=me(c,uu,o)*c%o,u=me(a,t,o)*a%o,h=me(u,r,o)*u%o,p=me(h,n,o)*h%o,b=me(p,i,o)*p%o,g=me(b,i,o)*p%o,_=me(g,t,o)*a%o;return{pow_p_5_8:me(_,vn,o)*e%o,b2:f}}function lu(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function hu(e,t){const r=Or,n=k(t*t*t,r),i=k(n*n*t,r),o=fu(e*i).pow_p_5_8;let f=k(e*n*o,r);const d=k(t*f*f,r),c=f,a=k(f*mn,r),u=d===e,h=d===k(-e,r),p=d===k(-e*mn,r);return u&&(f=c),(h||p)&&(f=a),qa(f,r)&&(f=k(-f,r)),{isValid:u||h,value:f}}const du=Yn(Or,void 0,!0),pu={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:du,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:cu,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:ja,randomBytes:Wn,adjustScalarBytes:lu,uvRatio:hu},ei=su(pu),gu="EdDSA",bu="JWT",zt=".",$t="base64url",ti="utf8",ri="utf8",yu=":",wu="did",mu="key",_n="base58btc",vu="z",_u="K36",Eu=32;function Tr(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function ni(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Tr(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ii(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=ni(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return Tr(r)}function xu(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),f=o.charCodeAt(0);if(r[f]!==255)throw new TypeError(o+" is ambiguous");r[f]=i}var d=e.length,c=e.charAt(0),a=Math.log(d)/Math.log(256),u=Math.log(256)/Math.log(d);function h(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var _=0,O=0,R=0,T=g.length;R!==T&&g[R]===0;)R++,_++;for(var m=(T-R)*u+1>>>0,I=new Uint8Array(m);R!==T;){for(var z=g[R],H=0,G=m-1;(z!==0||H<O)&&G!==-1;G--,H++)z+=256*I[G]>>>0,I[G]=z%d>>>0,z=z/d>>>0;if(z!==0)throw new Error("Non-zero carry");O=H,R++}for(var U=m-O;U!==m&&I[U]===0;)U++;for(var V=c.repeat(_);U<m;++U)V+=e.charAt(I[U]);return V}function p(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var _=0;if(g[_]!==" "){for(var O=0,R=0;g[_]===c;)O++,_++;for(var T=(g.length-_)*a+1>>>0,m=new Uint8Array(T);g[_];){var I=r[g.charCodeAt(_)];if(I===255)return;for(var z=0,H=T-1;(I!==0||z<R)&&H!==-1;H--,z++)I+=d*m[H]>>>0,m[H]=I%256>>>0,I=I/256>>>0;if(I!==0)throw new Error("Non-zero carry");R=z,_++}if(g[_]!==" "){for(var G=T-R;G!==T&&m[G]===0;)G++;for(var U=new Uint8Array(O+(T-G)),V=O;G!==T;)U[V++]=m[G++];return U}}}function b(g){var _=p(g);if(_)return _;throw new Error(`Non-${t} character`)}return{encode:h,decodeUnsafe:p,decode:b}}var Fu=xu,Su=Fu;const oi=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")},Au=e=>new TextEncoder().encode(e),Bu=e=>new TextDecoder().decode(e);class Iu{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Ou{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return si(this,t)}}class Tu{constructor(t){this.decoders=t}or(t){return si(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const si=(e,t)=>new Tu({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Cu{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Iu(t,r,n),this.decoder=new Ou(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Kt=({name:e,prefix:t,encode:r,decode:n})=>new Cu(e,t,r,n),ft=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=Su(r,t);return Kt({prefix:e,name:t,encode:n,decode:o=>oi(i(o))})},Ru=(e,t,r,n)=>{const i={};for(let u=0;u<t.length;++u)i[t[u]]=u;let o=e.length;for(;e[o-1]==="=";)--o;const f=new Uint8Array(o*r/8|0);let d=0,c=0,a=0;for(let u=0;u<o;++u){const h=i[e[u]];if(h===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|h,d+=r,d>=8&&(d-=8,f[a++]=255&c>>d)}if(d>=r||255&c<<8-d)throw new SyntaxError("Unexpected end of data");return f},Lu=(e,t,r)=>{const n=t[t.length-1]==="=",i=(1<<r)-1;let o="",f=0,d=0;for(let c=0;c<e.length;++c)for(d=d<<8|e[c],f+=8;f>r;)f-=r,o+=t[i&d>>f];if(f&&(o+=t[i&d<<r-f]),n)for(;o.length*r&7;)o+="=";return o},te=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Kt({prefix:t,name:e,encode(i){return Lu(i,n,r)},decode(i){return Ru(i,n,r,e)}}),Pu=Kt({prefix:"\0",name:"identity",encode:e=>Bu(e),decode:e=>Au(e)});var ju=Object.freeze({__proto__:null,identity:Pu});const Nu=te({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var zu=Object.freeze({__proto__:null,base2:Nu});const Uu=te({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Du=Object.freeze({__proto__:null,base8:Uu});const Mu=ft({prefix:"9",name:"base10",alphabet:"0123456789"});var $u=Object.freeze({__proto__:null,base10:Mu});const Ku=te({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Hu=te({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Wu=Object.freeze({__proto__:null,base16:Ku,base16upper:Hu});const Gu=te({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vu=te({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),qu=te({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ju=te({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ku=te({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Zu=te({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Yu=te({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),Xu=te({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Qu=te({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ec=Object.freeze({__proto__:null,base32:Gu,base32upper:Vu,base32pad:qu,base32padupper:Ju,base32hex:ku,base32hexupper:Zu,base32hexpad:Yu,base32hexpadupper:Xu,base32z:Qu});const tc=ft({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),rc=ft({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var nc=Object.freeze({__proto__:null,base36:tc,base36upper:rc});const ic=ft({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),oc=ft({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var sc=Object.freeze({__proto__:null,base58btc:ic,base58flickr:oc});const ac=te({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),uc=te({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cc=te({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),fc=te({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var lc=Object.freeze({__proto__:null,base64:ac,base64pad:uc,base64url:cc,base64urlpad:fc});const ai=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),hc=ai.reduce((e,t,r)=>(e[r]=t,e),[]),dc=ai.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function pc(e){return e.reduce((t,r)=>(t+=hc[r],t),"")}function gc(e){const t=[];for(const r of e){const n=dc[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const bc=Kt({prefix:"🚀",name:"base256emoji",encode:pc,decode:gc});var yc=Object.freeze({__proto__:null,base256emoji:bc}),wc=ui,En=128,mc=-128,vc=Math.pow(2,31);function ui(e,t,r){t=t||[],r=r||0;for(var n=r;e>=vc;)t[r++]=e&255|En,e/=128;for(;e&mc;)t[r++]=e&255|En,e>>>=7;return t[r]=e|0,ui.bytes=r-n+1,t}var _c=yr,Ec=128,xn=127;function yr(e,n){var r=0,n=n||0,i=0,o=n,f,d=e.length;do{if(o>=d)throw yr.bytes=0,new RangeError("Could not decode varint");f=e[o++],r+=i<28?(f&xn)<<i:(f&xn)*Math.pow(2,i),i+=7}while(f>=Ec);return yr.bytes=o-n,r}var xc=Math.pow(2,7),Fc=Math.pow(2,14),Sc=Math.pow(2,21),Ac=Math.pow(2,28),Bc=Math.pow(2,35),Ic=Math.pow(2,42),Oc=Math.pow(2,49),Tc=Math.pow(2,56),Cc=Math.pow(2,63),Rc=function(e){return e<xc?1:e<Fc?2:e<Sc?3:e<Ac?4:e<Bc?5:e<Ic?6:e<Oc?7:e<Tc?8:e<Cc?9:10},Lc={encode:wc,decode:_c,encodingLength:Rc},ci=Lc;const Fn=(e,t,r=0)=>(ci.encode(e,t,r),t),Sn=e=>ci.encodingLength(e),wr=(e,t)=>{const r=t.byteLength,n=Sn(e),i=n+Sn(r),o=new Uint8Array(i+r);return Fn(e,o,0),Fn(r,o,n),o.set(t,i),new Pc(e,r,t,o)};class Pc{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}}const fi=({name:e,code:t,encode:r})=>new jc(e,t,r);class jc{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?wr(this.code,r):r.then(n=>wr(this.code,n))}else throw Error("Unknown type, must be binary type")}}const li=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Nc=fi({name:"sha2-256",code:18,encode:li("SHA-256")}),zc=fi({name:"sha2-512",code:19,encode:li("SHA-512")});var Uc=Object.freeze({__proto__:null,sha256:Nc,sha512:zc});const hi=0,Dc="identity",di=oi,Mc=e=>wr(hi,di(e)),$c={code:hi,name:Dc,encode:di,digest:Mc};var Kc=Object.freeze({__proto__:null,identity:$c});new TextEncoder,new TextDecoder;const An={...ju,...zu,...Du,...$u,...Wu,...ec,...nc,...sc,...lc,...yc};({...Uc,...Kc});function pi(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const Bn=pi("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),lr=pi("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=ni(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),gi={utf8:Bn,"utf-8":Bn,hex:An.base16,latin1:lr,ascii:lr,binary:lr,...An};function Ht(e,t="utf8"){const r=gi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function qe(e,t="utf8"){const r=gi[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Tr(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function In(e){return ra(Ht(qe(e,$t),ti))}function Ut(e){return Ht(qe(na(e),ti),$t)}function bi(e){const t=qe(_u,_n),r=vu+Ht(ii([t,e]),_n);return[wu,mu,r].join(yu)}function Hc(e){return Ht(e,$t)}function Wc(e){return qe(e,$t)}function Gc(e){return qe([Ut(e.header),Ut(e.payload)].join(zt),ri)}function Vc(e){return[Ut(e.header),Ut(e.payload),Hc(e.signature)].join(zt)}function qc(e){const t=e.split(zt),r=In(t[0]),n=In(t[1]),i=Wc(t[2]),o=qe(t.slice(0,2).join(zt),ri);return{header:r,payload:n,signature:i,data:o}}function Jc(e=Wn(Eu)){const t=ei.getPublicKey(e);return{secretKey:ii([e,t]),publicKey:t}}async function kc(e,t,r,n,i=ge.cjs.fromMiliseconds(Date.now())){const o={alg:gu,typ:bu},f=bi(n.publicKey),d=i+r,c={iss:f,sub:e,aud:t,iat:i,exp:d},a=Gc({header:o,payload:c}),u=ei.sign(a,n.secretKey.slice(0,32));return Vc({header:o,payload:c,signature:u})}const Zc="PARSE_ERROR",Yc="INVALID_REQUEST",Xc="METHOD_NOT_FOUND",Qc="INVALID_PARAMS",yi="INTERNAL_ERROR",Cr="SERVER_ERROR",ef=[-32700,-32600,-32601,-32602,-32603],it={[Zc]:{code:-32700,message:"Parse error"},[Yc]:{code:-32600,message:"Invalid Request"},[Xc]:{code:-32601,message:"Method not found"},[Qc]:{code:-32602,message:"Invalid params"},[yi]:{code:-32603,message:"Internal error"},[Cr]:{code:-32e3,message:"Server error"}},wi=Cr;function tf(e){return ef.includes(e)}function On(e){return Object.keys(it).includes(e)?it[e]:it[wi]}function rf(e){const t=Object.values(it).find(r=>r.code===e);return t||it[wi]}function nf(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var mi={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1 +1 @@
1
- "use strict";const me=Symbol(),se=Object.getPrototypeOf,G=new WeakMap,he=e=>e&&(G.has(e)?G.get(e):se(e)===Object.prototype||se(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,ne=(e,t=!0)=>{G.set(e,t)},H={},F=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,g)=>new Proxy(n,g),s=n=>F(n)&&!x.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),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,g,I=r)=>{const v=l.get(n);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return ne(w,!0),l.set(n,[g,w]),Reflect.ownKeys(n).forEach(k=>{if(Object.getOwnPropertyDescriptor(w,k))return;const O=Reflect.get(n,k),M={value:O,enumerable:!0,configurable:!0};if(x.has(O))ne(O,!1);else if(O instanceof Promise)delete M.value,M.get=()=>I(O);else if(A.has(O)){const[b,q]=A.get(O);M.value=c(b,q(),I)}Object.defineProperty(w,k,M)}),Object.preventExtensions(w)},m=new WeakMap,p=[1,1],E=n=>{if(!F(n))throw new Error("object required");const g=m.get(n);if(g)return g;let I=p[0];const v=new Set,w=(i,a=++p[0])=>{I!==a&&(I=a,v.forEach(o=>o(i,a)))};let k=p[1];const O=(i=++p[1])=>(k!==i&&!v.size&&(k=i,b.forEach(([a])=>{const o=a[1](i);o>I&&(I=o)})),I),M=i=>(a,o)=>{const h=[...a];h[1]=[i,...h[1]],w(h,o)},b=new Map,q=(i,a)=>{if((H?"production":void 0)!=="production"&&b.has(i))throw new Error("prop listener already exists");if(v.size){const o=a[3](M(i));b.set(i,[a,o])}else b.set(i,[a])},te=i=>{var a;const o=b.get(i);o&&(b.delete(i),(a=o[1])==null||a.call(o))},fe=i=>(v.add(i),v.size===1&&b.forEach(([o,h],_)=>{if((H?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const T=o[3](M(_));b.set(_,[o,T])}),()=>{v.delete(i),v.size===0&&b.forEach(([o,h],_)=>{h&&(h(),b.set(_,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(i,a){const o=Reflect.get(i,a);te(a);const h=Reflect.deleteProperty(i,a);return h&&w(["delete",[a],o]),h},set(i,a,o,h){const _=Reflect.has(i,a),T=Reflect.get(i,a,h);if(_&&(e(T,o)||m.has(o)&&e(T,m.get(o))))return!0;te(a),F(o)&&(o=ge(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,w(["resolve",[a],C])}).catch(C=>{o.status="rejected",o.reason=C,w(["reject",[a],C])});else{!A.has(o)&&s(o)&&(V=E(o));const C=!x.has(V)&&A.get(V);C&&q(a,C)}return Reflect.set(i,a,V,h),w(["set",[a],o,T]),!0}});m.set(n,$);const pe=[J,O,c,fe];return A.set($,pe),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(J,i,a)}),$})=>[E,A,x,e,t,s,r,l,c,m,p],[ye]=be();function j(e={}){return ye(e)}function D(e,t,s){const r=A.get(e);(H?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let p=!1;const n=m(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,p&&t(c.splice(0))}))});return p=!0,()=>{p=!1,n()}}function ve(e,t){const s=A.get(e);(H?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ee={state:d,subscribe(e){return D(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 r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!u.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}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=ee.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),f=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),ue={state:f,subscribe(e){return D(f.events,()=>e(ve(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)}}},L=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),y={state:L,subscribe(e){return D(L,()=>e(L))},setChains(e){L.chains=e},setWalletConnectUri(e){L.walletConnectUri=e},setIsCustomDesktop(e){L.isCustomDesktop=e},setIsCustomMobile(e){L.isCustomMobile=e},setIsDataLoaded(e){L.isDataLoaded=e},setIsUiLoaded(e){L.isUiLoaded=e},setIsAuth(e){L.isAuth=e}},B=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}),S={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;ue.initialize(),y.setChains(e.chains),y.setIsAuth(!!e.enableAuthMode),y.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),y.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),u.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,oe=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ie(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(oe)for(var s of oe(t))We.call(t,s)&&re(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=Oe({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",S.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const U={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${S.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${S.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var Ee=Object.defineProperty,ae=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,ie=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&ie(e,s,t[s]);if(ae)for(var s of ae(t))Ae.call(t,s)&&ie(e,s,t[s]);return e};const le=u.isMobile(),W=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Me={state:W,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=S.state;if(e==="NONE"||t==="ALL"&&!e)return W.recomendedWallets;if(u.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await U.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const p=e.indexOf(c.id),E=e.indexOf(m.id);return p-E}),W.recomendedWallets=l}else{const{chains:s,isAuth:r}=y.state,l=s==null?void 0:s.join(","),c=u.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:u.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:p}=le?await U.getMobileListings(m):await U.getDesktopListings(m);W.recomendedWallets=Object.values(p)}return W.recomendedWallets},async getWallets(e){const t=je({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=S.state,{recomendedWallets:l}=W;if(r==="ALL")return W.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):u.isArray(s)&&(t.excludedIds=s.join(",")),u.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),y.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:p,total:E}=le?await U.getMobileListings(t):await U.getDesktopListings(t),n=Object.values(p),g=m?"search":"wallets";return W[g]={listings:[...W[g].listings,...n],total:E,page:c??1},{listings:n,total:E}},getWalletImageUrl(e){return U.getWalletImageUrl(e)},getAssetImageUrl(e){return U.getAssetImageUrl(e)},resetSearch(){W.search={listings:[],total:0,page:1}}},N=j({open:!1}),z={state:N,subscribe(e){return D(N,()=>e(N))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=y.state;if(u.removeWalletConnectDeepLink(),y.setWalletConnectUri(e==null?void 0:e.uri),y.setChains(e==null?void 0:e.chains),ee.reset("ConnectWallet"),s&&r)N.open=!0,t();else{const l=setInterval(()=>{const c=y.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),N.open=!0,t())},200)}})},close(){N.open=!1}};var Ue=Object.defineProperty,ce=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,de=(e,t,s)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&de(e,s,t[s]);if(ce)for(var s of ce(t))Se.call(t,s)&&de(e,s,t[s]);return e};function ke(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=j({themeMode:ke()?"dark":"light"}),Z={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=De({},s))}},P=j({open:!1,message:"",variant:"success"}),_e={state:P,subscribe(e){return D(P,()=>e(P))},openToast(e,t){P.open=!0,P.message=e,P.variant=t},closeToast(){P.open=!1}};class Ne{constructor(t){this.openModal=z.open,this.closeModal=z.close,this.subscribeModal=z.subscribe,this.setTheme=Z.setThemeConfig,Z.setThemeConfig(t),S.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(()=>require("./index-BFXBE_Mo.js"));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),y.setIsUiLoaded(!0)}}}const Te=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ne},Symbol.toStringTag,{value:"Module"}));exports.R=ue;exports.T=ee;exports.a=u;exports.index=Te;exports.ne=Z;exports.oe=_e;exports.p=y;exports.se=z;exports.te=Me;exports.y=S;
1
+ "use strict";const me=Symbol(),se=Object.getPrototypeOf,G=new WeakMap,he=e=>e&&(G.has(e)?G.get(e):se(e)===Object.prototype||se(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,ne=(e,t=!0)=>{G.set(e,t)},H={},F=e=>typeof e=="object"&&e!==null,A=new WeakMap,x=new WeakSet,be=(e=Object.is,t=(n,g)=>new Proxy(n,g),s=n=>F(n)&&!x.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),r=n=>{switch(n.status){case"fulfilled":return n.value;case"rejected":throw n.reason;default:throw n}},l=new WeakMap,c=(n,g,I=r)=>{const v=l.get(n);if((v==null?void 0:v[0])===g)return v[1];const w=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n));return ne(w,!0),l.set(n,[g,w]),Reflect.ownKeys(n).forEach(k=>{if(Object.getOwnPropertyDescriptor(w,k))return;const O=Reflect.get(n,k),M={value:O,enumerable:!0,configurable:!0};if(x.has(O))ne(O,!1);else if(O instanceof Promise)delete M.value,M.get=()=>I(O);else if(A.has(O)){const[b,q]=A.get(O);M.value=c(b,q(),I)}Object.defineProperty(w,k,M)}),Object.preventExtensions(w)},m=new WeakMap,p=[1,1],E=n=>{if(!F(n))throw new Error("object required");const g=m.get(n);if(g)return g;let I=p[0];const v=new Set,w=(i,a=++p[0])=>{I!==a&&(I=a,v.forEach(o=>o(i,a)))};let k=p[1];const O=(i=++p[1])=>(k!==i&&!v.size&&(k=i,b.forEach(([a])=>{const o=a[1](i);o>I&&(I=o)})),I),M=i=>(a,o)=>{const h=[...a];h[1]=[i,...h[1]],w(h,o)},b=new Map,q=(i,a)=>{if((H?"production":void 0)!=="production"&&b.has(i))throw new Error("prop listener already exists");if(v.size){const o=a[3](M(i));b.set(i,[a,o])}else b.set(i,[a])},te=i=>{var a;const o=b.get(i);o&&(b.delete(i),(a=o[1])==null||a.call(o))},fe=i=>(v.add(i),v.size===1&&b.forEach(([o,h],_)=>{if((H?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const T=o[3](M(_));b.set(_,[o,T])}),()=>{v.delete(i),v.size===0&&b.forEach(([o,h],_)=>{h&&(h(),b.set(_,[o]))})}),J=Array.isArray(n)?[]:Object.create(Object.getPrototypeOf(n)),$=t(J,{deleteProperty(i,a){const o=Reflect.get(i,a);te(a);const h=Reflect.deleteProperty(i,a);return h&&w(["delete",[a],o]),h},set(i,a,o,h){const _=Reflect.has(i,a),T=Reflect.get(i,a,h);if(_&&(e(T,o)||m.has(o)&&e(T,m.get(o))))return!0;te(a),F(o)&&(o=ge(o)||o);let V=o;if(o instanceof Promise)o.then(C=>{o.status="fulfilled",o.value=C,w(["resolve",[a],C])}).catch(C=>{o.status="rejected",o.reason=C,w(["reject",[a],C])});else{!A.has(o)&&s(o)&&(V=E(o));const C=!x.has(V)&&A.get(V);C&&q(a,C)}return Reflect.set(i,a,V,h),w(["set",[a],o,T]),!0}});m.set(n,$);const pe=[J,O,c,fe];return A.set($,pe),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(J,i,a)}),$})=>[E,A,x,e,t,s,r,l,c,m,p],[ye]=be();function j(e={}){return ye(e)}function D(e,t,s){const r=A.get(e);(H?"production":void 0)!=="production"&&!r&&console.warn("Please use proxy object");let l;const c=[],m=r[3];let p=!1;const n=m(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,p&&t(c.splice(0))}))});return p=!0,()=>{p=!1,n()}}function ve(e,t){const s=A.get(e);(H?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[r,l,c]=s;return c(r,l(),t)}const d=j({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ee={state:d,subscribe(e){return D(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 r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!u.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);const l=encodeURIComponent(t);return`${r}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=ee.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),f=j({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),ue={state:f,subscribe(e){return D(f.events,()=>e(ve(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)}}},L=j({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),y={state:L,subscribe(e){return D(L,()=>e(L))},setChains(e){L.chains=e},setWalletConnectUri(e){L.walletConnectUri=e},setIsCustomDesktop(e){L.isCustomDesktop=e},setIsCustomMobile(e){L.isCustomMobile=e},setIsDataLoaded(e){L.isDataLoaded=e},setIsUiLoaded(e){L.isUiLoaded=e},setIsAuth(e){L.isAuth=e}},B=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}),S={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;ue.initialize(),y.setChains(e.chains),y.setIsAuth(!!e.enableAuthMode),y.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),y.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),u.setModalVersionInStorage(),Object.assign(B,e)}};var Ie=Object.defineProperty,oe=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ie(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(oe)for(var s of oe(t))We.call(t,s)&&re(e,s,t[s]);return e};const Q="https://explorer-api.walletconnect.com",X="wcm",Y="js-2.6.2";async function K(e,t){const s=Oe({sdkType:X,sdkVersion:Y},t),r=new URL(e,Q);return r.searchParams.append("projectId",S.state.projectId),Object.entries(s).forEach(([l,c])=>{c&&r.searchParams.append(l,String(c))}),(await fetch(r)).json()}const U={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${Q}/w3m/v1/getWalletImage/${e}?projectId=${S.state.projectId}&sdkType=${X}&sdkVersion=${Y}`},getAssetImageUrl(e){return`${Q}/w3m/v1/getAssetImage/${e}?projectId=${S.state.projectId}&sdkType=${X}&sdkVersion=${Y}`}};var Ee=Object.defineProperty,ae=Object.getOwnPropertySymbols,Ce=Object.prototype.hasOwnProperty,Ae=Object.prototype.propertyIsEnumerable,ie=(e,t,s)=>t in e?Ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Ce.call(t,s)&&ie(e,s,t[s]);if(ae)for(var s of ae(t))Ae.call(t,s)&&ie(e,s,t[s]);return e};const le=u.isMobile(),W=j({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Me={state:W,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=S.state;if(e==="NONE"||t==="ALL"&&!e)return W.recomendedWallets;if(u.isArray(e)){const s={recommendedIds:e.join(",")},{listings:r}=await U.getAllListings(s),l=Object.values(r);l.sort((c,m)=>{const p=e.indexOf(c.id),E=e.indexOf(m.id);return p-E}),W.recomendedWallets=l}else{const{chains:s,isAuth:r}=y.state,l=s==null?void 0:s.join(","),c=u.isArray(t),m={page:1,sdks:r?"auth_v1":void 0,entries:u.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:p}=le?await U.getMobileListings(m):await U.getDesktopListings(m);W.recomendedWallets=Object.values(p)}return W.recomendedWallets},async getWallets(e){const t=je({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=S.state,{recomendedWallets:l}=W;if(r==="ALL")return W.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):u.isArray(s)&&(t.excludedIds=s.join(",")),u.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),y.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:m}=e,{listings:p,total:E}=le?await U.getMobileListings(t):await U.getDesktopListings(t),n=Object.values(p),g=m?"search":"wallets";return W[g]={listings:[...W[g].listings,...n],total:E,page:c??1},{listings:n,total:E}},getWalletImageUrl(e){return U.getWalletImageUrl(e)},getAssetImageUrl(e){return U.getAssetImageUrl(e)},resetSearch(){W.search={listings:[],total:0,page:1}}},N=j({open:!1}),z={state:N,subscribe(e){return D(N,()=>e(N))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:r}=y.state;if(u.removeWalletConnectDeepLink(),y.setWalletConnectUri(e==null?void 0:e.uri),y.setChains(e==null?void 0:e.chains),ee.reset("ConnectWallet"),s&&r)N.open=!0,t();else{const l=setInterval(()=>{const c=y.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),N.open=!0,t())},200)}})},close(){N.open=!1}};var Ue=Object.defineProperty,ce=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,de=(e,t,s)=>t in e?Ue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,De=(e,t)=>{for(var s in t||(t={}))Pe.call(t,s)&&de(e,s,t[s]);if(ce)for(var s of ce(t))Se.call(t,s)&&de(e,s,t[s]);return e};function ke(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const R=j({themeMode:ke()?"dark":"light"}),Z={state:R,subscribe(e){return D(R,()=>e(R))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(R.themeMode=t),s&&(R.themeVariables=De({},s))}},P=j({open:!1,message:"",variant:"success"}),_e={state:P,subscribe(e){return D(P,()=>e(P))},openToast(e,t){P.open=!0,P.message=e,P.variant=t},closeToast(){P.open=!1}};class Ne{constructor(t){this.openModal=z.open,this.closeModal=z.close,this.subscribeModal=z.subscribe,this.setTheme=Z.setThemeConfig,Z.setThemeConfig(t),S.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(()=>require("./index-CkwnTFud.js"));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),y.setIsUiLoaded(!0)}}}const Te=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Ne},Symbol.toStringTag,{value:"Module"}));exports.R=ue;exports.T=ee;exports.a=u;exports.index=Te;exports.ne=Z;exports.oe=_e;exports.p=y;exports.se=z;exports.te=Me;exports.y=S;
@@ -1,8 +1,8 @@
1
1
  var Er = Object.defineProperty;
2
2
  var xr = (e, t, r) => t in e ? Er(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var F = (e, t, r) => xr(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { X as jr, y as Ir, cj as Or, bw as Ar, bu as kr, bv as Bt, r as _r, bx as Rt, bj as Cr } from "./index-CaNzAG1x.mjs";
5
- import { S as Nt, u as Pt } from "./sui-D8i87rc-.mjs";
4
+ import { X as jr, y as Ir, cj as Or, bw as Ar, bu as kr, bv as Bt, r as _r, bx as Rt, bj as Cr } from "./index-DiGgidBd.mjs";
5
+ import { S as Nt, u as Pt } from "./sui-OujMcwQK.mjs";
6
6
  import { S as $r } from "./unsignedTransaction-BD81leu1.mjs";
7
7
  class Mr extends TypeError {
8
8
  constructor(t, r) {
@@ -1,5 +1,5 @@
1
- import { aY as f, aZ as c, ae as s, a_ as O, a$ as t, b0 as o, b1 as d, b2 as A, b3 as p } from "./index-CaNzAG1x.mjs";
2
- import { b4 as h } from "./index-CaNzAG1x.mjs";
1
+ import { aY as f, aZ as c, ae as s, a_ as O, a$ as t, b0 as o, b1 as d, b2 as A, b3 as p } from "./index-DiGgidBd.mjs";
2
+ import { b4 as h } from "./index-DiGgidBd.mjs";
3
3
  class l extends Error {
4
4
  constructor(r) {
5
5
  super(r);
@@ -1,4 +1,4 @@
1
- import { aJ as L, aU as g, aV as F, aW as k, aX as I, O as P, Q as T } from "./index-CaNzAG1x.mjs";
1
+ import { aJ as L, aU as g, aV as F, aW as k, aX as I, O as P, Q as T } from "./index-DiGgidBd.mjs";
2
2
  function D(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,8 +1,8 @@
1
1
  var d = Object.defineProperty;
2
2
  var h = (a, e, t) => e in a ? d(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var o = (a, e, t) => h(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { b6 as m, bB as w, cc as g, r as p, bj as u } from "./index-CaNzAG1x.mjs";
5
- import { A as l } from "./aptos-7dMQQEIW.mjs";
4
+ import { b6 as m, bB as w, cc as g, r as p, bj as u } from "./index-DiGgidBd.mjs";
5
+ import { A as l } from "./aptos-D7c67ZLW.mjs";
6
6
  class i {
7
7
  constructor(e, t, r, s) {
8
8
  o(this, "network");
@@ -1,9 +1,9 @@
1
1
  var S = Object.defineProperty;
2
2
  var b = (a, e, t) => e in a ? S(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var i = (a, e, t) => b(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { cd as v, ce as f, cf as I, c9 as x, cg as A, b6 as w, bA as U, bd as $, bB as m, r as o, aC as k, p as c, m as h, ch as C, bG as T, V as E, bD as F, k as _, be as u, ci as W, bj as N } from "./index-CaNzAG1x.mjs";
4
+ import { cd as v, ce as f, cf as I, c9 as x, cg as A, b6 as w, bA as U, bd as $, bB as m, r as o, aC as k, p as c, m as h, ch as C, bG as T, V as E, bD as F, k as _, be as u, ci as W, bj as N } from "./index-DiGgidBd.mjs";
5
5
  import { A as O } from "./unsignedTransaction-BDOQhqcZ.mjs";
6
- import { A as Q } from "./aptos-7dMQQEIW.mjs";
6
+ import { A as Q } from "./aptos-D7c67ZLW.mjs";
7
7
  const R = [
8
8
  { name: "tokenBridgeAddress", ...f },
9
9
  { name: "chain", ...I() },
@@ -1,5 +1,5 @@
1
- import { b as vo, d as _o, f as xo, g as Eo, i as Fo, j as Ao, k as So, l as Bo, m as Io, n as Oo, c as To } from "./index-nWaQESZp.mjs";
2
- import { V as ge, X as Tn, cr as Co, aB as me } from "./index-CaNzAG1x.mjs";
1
+ import { b as vo, d as _o, f as xo, g as Eo, i as Fo, j as Ao, k as So, l as Bo, m as Io, n as Oo, c as To } from "./index-DH7AJ70P.mjs";
2
+ import { V as ge, X as Tn, cr as Co, aB as me } from "./index-DiGgidBd.mjs";
3
3
  function Cn(e = 0) {
4
4
  return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? globalThis.Buffer.allocUnsafe(e) : new Uint8Array(e);
5
5
  }
@@ -1,7 +1,7 @@
1
1
  var $ = Object.defineProperty;
2
2
  var V = (i, e, b) => e in i ? $(i, e, { enumerable: !0, configurable: !0, writable: !0, value: b }) : i[e] = b;
3
3
  var d = (i, e, b) => V(i, typeof e != "symbol" ? e + "" : e, b);
4
- import { b8 as E, E as o, bA as x, b6 as l, bd as z, bB as j, b as c, m as k, bC as L, bD as G, be as g, bE as W, bF as T, bc as s, bG as _, bh as P, bi as F, bz as N, b5 as q, a4 as D, bj as H, _ as O } from "./index-CaNzAG1x.mjs";
4
+ import { b8 as E, E as o, bA as x, b6 as l, bd as z, bB as j, b as c, m as k, bC as L, bD as G, be as g, bE as W, bF as T, bc as s, bG as _, bh as P, bi as F, bz as N, b5 as q, a4 as D, bj as H, _ as O } from "./index-DiGgidBd.mjs";
5
5
  class B {
6
6
  constructor(e, b, a, t) {
7
7
  d(this, "network");
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var m=(a,e,t)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e,t)=>m(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-BEhe2aRM.js"),w=require("./aptos-CWfp2v_P.js");class c{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=i.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await w.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new c(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash({transactionHash:e});if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const r=t.events.filter(o=>o.type.endsWith("WormholeMessage"));if(!r||r.length===0)throw new Error(`WormholeMessage not found for ${e}`);return r.map(o=>{const n=o.data,d=new i.UniversalAddress(BigInt(n.sender).toString(16).padStart(64,"0"));return i.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:d,sequence:BigInt(n.sequence),timestamp:Number(n.timestamp),consistencyLevel:n.consistency_level,nonce:Number(n.nonce),signatures:[],payload:i.hex.decode(n.payload)})})}}i.registerProtocol("Aptos","WormholeCore",c);exports.AptosWormholeCore=c;
1
+ "use strict";var h=Object.defineProperty;var m=(a,e,t)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e,t)=>m(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-DP4LajXh.js"),w=require("./aptos-C8wWowIo.js");class c{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=i.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await w.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new c(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash({transactionHash:e});if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const r=t.events.filter(o=>o.type.endsWith("WormholeMessage"));if(!r||r.length===0)throw new Error(`WormholeMessage not found for ${e}`);return r.map(o=>{const n=o.data,d=new i.UniversalAddress(BigInt(n.sender).toString(16).padStart(64,"0"));return i.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:d,sequence:BigInt(n.sequence),timestamp:Number(n.timestamp),consistencyLevel:n.consistency_level,nonce:Number(n.nonce),signatures:[],payload:i.hex.decode(n.payload)})})}}i.registerProtocol("Aptos","WormholeCore",c);exports.AptosWormholeCore=c;
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>m(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-BEhe2aRM.js"),u=require("./sui-CrYGHvcd.js");class d{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=c.toChainId(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await u.SuiPlatform.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new d(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const i=s.parsedJson;return c.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:new c.SuiAddress(i.sender).toUniversalAddress(),sequence:BigInt(i.sequence),guardianSet:0,timestamp:Number(i.timestamp),consistencyLevel:i.consistency_level,nonce:i.nonce,signatures:[],payload:new Uint8Array(i.payload)})})}}c.registerProtocol("Sui","WormholeCore",d);exports.SuiWormholeCore=d;
1
+ "use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>m(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-DP4LajXh.js"),u=require("./sui-DdU63C8s.js");class d{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=c.toChainId(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await u.SuiPlatform.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new d(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const i=s.parsedJson;return c.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:new c.SuiAddress(i.sender).toUniversalAddress(),sequence:BigInt(i.sequence),guardianSet:0,timestamp:Number(i.timestamp),consistencyLevel:i.consistency_level,nonce:i.nonce,signatures:[],payload:new Uint8Array(i.payload)})})}}c.registerProtocol("Sui","WormholeCore",d);exports.SuiWormholeCore=d;