@wormhole-foundation/wormhole-connect 1.1.8-beta.2-development → 1.1.8

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 (94) hide show
  1. package/dist/assets/{ccip-B5VfDKOr.js → ccip-atE20ZEL.js} +1 -1
  2. package/dist/assets/{evm-CkbZddI4.js → evm-DiRlPnyB.js} +4 -4
  3. package/dist/assets/{index-BVl4T3LK.js → index-C6qclzFA.js} +1 -1
  4. package/dist/assets/index-CKe5Sopa.js +2 -0
  5. package/dist/assets/{index-CPZCe6ys.js → index-DOuohql9.js} +1 -1
  6. package/dist/assets/{index.es-D_CMbICm.js → index.es-BxGbRBbk.js} +2 -2
  7. package/dist/main.js +3 -3
  8. package/lib/{algorand-tXcNTbqw.js → algorand-BvtlkYvW.js} +1 -1
  9. package/lib/{algorand-DgpF_mXd.mjs → algorand-DUcbNcTT.mjs} +5 -5
  10. package/lib/{aptos-CTr4u3up.mjs → aptos-B4rlOyU6.mjs} +3 -3
  11. package/lib/{aptos-Cbmld6H3.js → aptos-BhgRAjHC.js} +2 -2
  12. package/lib/{aptos-CR0OcDBV.js → aptos-DhzeFi4o.js} +1 -1
  13. package/lib/{aptos-M_shWERr.mjs → aptos-nQowjIcb.mjs} +1 -1
  14. package/lib/{ccip-DaRd1xyq.js → ccip-BGUsNrsA.js} +1 -1
  15. package/lib/{ccip-C0KpO3UY.mjs → ccip-jzRXPLFO.mjs} +1 -1
  16. package/lib/{cosmwasm-u__X419O.js → cosmwasm-CGeqw6cI.js} +4 -4
  17. package/lib/{cosmwasm-BrumI-4g.mjs → cosmwasm-DrywDSkp.mjs} +10 -10
  18. package/lib/{events-B3M_mwnv.js → events-COjha8bx.js} +1 -1
  19. package/lib/{events-CpI6THlG.mjs → events-DuoZYNKO.mjs} +1 -1
  20. package/lib/{evm-Blf-_XHQ.js → evm-BBDClE2g.js} +4 -4
  21. package/lib/{evm-DTv3ll5g.mjs → evm-BuIItcEA.mjs} +12 -12
  22. package/lib/{evm-CcAiiNiN.mjs → evm-CEj34i-Y.mjs} +7 -7
  23. package/lib/{evm-B8QV0WMy.js → evm-CYnUn08H.js} +1 -1
  24. package/lib/{index-BWadlVxP.js → index-8IabBseN.js} +1 -1
  25. package/lib/{index-C24awnH1.mjs → index-A72nDBhY.mjs} +11 -11
  26. package/lib/{index-BLT1iLJO.js → index-B-LwhonE.js} +1 -1
  27. package/lib/{index-D_WLQWCk.js → index-B2JFHCjY.js} +1 -1
  28. package/lib/{index-CrvMtWJk.js → index-B6AFQ_fB.js} +1 -1
  29. package/lib/{index-lNjLQ3Ln.mjs → index-BISC0EuN.mjs} +9 -9
  30. package/lib/{index-NVVfqKqy.js → index-BIVNmWjC.js} +1 -1
  31. package/lib/{index-nvF_Vnsk.mjs → index-BJuAlURA.mjs} +3 -3
  32. package/lib/{index-Hj_44yP6.js → index-BJvQdk3o.js} +92 -92
  33. package/lib/{index-sqvrX5as.js → index-BTncL8og.js} +1 -1
  34. package/lib/{index-Br2oG_eT.mjs → index-BXkKxPSN.mjs} +2 -2
  35. package/lib/{index-BeR2pFP_.mjs → index-Bbhbkgfa.mjs} +2 -2
  36. package/lib/{index-DGUuTzq5.mjs → index-BeJsTgpu.mjs} +10 -10
  37. package/lib/{index-CH4v9fdl.mjs → index-Bh9u5bZu.mjs} +15 -15
  38. package/lib/{index-MAW-S7qJ.js → index-Bi4OJr6O.js} +1 -1
  39. package/lib/index-BsHKXTKU.js +1 -0
  40. package/lib/{index-CwrUNk7R.js → index-BuGRcK_Q.js} +1 -1
  41. package/lib/{index-CuqXZa2Q.mjs → index-CJEjOaWr.mjs} +1 -1
  42. package/lib/{index-BVEhvlmw.mjs → index-CRv6XxH6.mjs} +16 -16
  43. package/lib/{index-Dsp18Ki0.js → index-CTHiXye2.js} +1 -1
  44. package/lib/{index-iMGGdz1P.js → index-CWM3H2LC.js} +1 -1
  45. package/lib/{index-B9I8wNfR.js → index-CXIAreWV.js} +1 -1
  46. package/lib/{index-BVvayeum.mjs → index-CdExxm-8.mjs} +2 -2
  47. package/lib/{index-5iQ5GTSu.mjs → index-Cdpg2Kj3.mjs} +2 -2
  48. package/lib/{index-EFO4LCUD.mjs → index-CjexIr7B.mjs} +12 -12
  49. package/lib/{index-BPyIEVyq.js → index-Cyjyg63s.js} +1 -1
  50. package/lib/{index-DIeGmRzd.js → index-D5tJ7kz1.js} +1 -1
  51. package/lib/{index-DhvaqGhk.mjs → index-D7uCV0-2.mjs} +55 -55
  52. package/lib/{index-DSQmXjdq.mjs → index-D9fbH3oE.mjs} +35 -35
  53. package/lib/{index-B0-xPGuQ.mjs → index-D9h0sJ3x.mjs} +76 -76
  54. package/lib/{index-CaA38viB.js → index-DEi8dfu-.js} +1 -1
  55. package/lib/{index-BRV3iD_7.mjs → index-DKptU_Hc.mjs} +4 -4
  56. package/lib/{index-aB_fp0rM.mjs → index-Dc5wV51P.mjs} +20462 -20465
  57. package/lib/{index-CPe7WKSz.mjs → index-DcurocLc.mjs} +2 -2
  58. package/lib/{index-DZohPEoL.mjs → index-DdeuHj0J.mjs} +7 -7
  59. package/lib/{index-DcH-LW3u.js → index-DgbQ-dwi.js} +1 -1
  60. package/lib/{index-CU3bs1UO.js → index-DlnKgVH2.js} +1 -1
  61. package/lib/{index-CX4xrmvB.js → index-Ds_oSleh.js} +1 -1
  62. package/lib/{index-Dj9uX8Yq.mjs → index-HLOU4jOA.mjs} +2 -2
  63. package/lib/{index-QVDg02xQ.js → index-NNKFqYq6.js} +1 -1
  64. package/lib/{index-DXxIHcif.js → index-a5wU3oUB.js} +1 -1
  65. package/lib/{index-5Nsx5Sww.mjs → index-qoWS15WJ.mjs} +4 -4
  66. package/lib/{index-DaqgMXh5.mjs → index-uAstvLd8.mjs} +2 -2
  67. package/lib/{index-w19NhRI8.js → index-vjvft509.js} +1 -1
  68. package/lib/{index.es-8dGbttwj.js → index.es-ex5QzFoQ.js} +2 -2
  69. package/lib/{index.es-4k95rbkL.mjs → index.es-tj48a6VI.mjs} +5 -5
  70. package/lib/index.js +1 -1
  71. package/lib/index.mjs +2 -2
  72. package/lib/{keccak-BVl93H2h.mjs → keccak-CVFfUSfU.mjs} +1 -1
  73. package/lib/{keccak-DxPHQOs9.js → keccak-CzODwJ6V.js} +1 -1
  74. package/lib/{pbkdf2-C4tGHSl-.js → pbkdf2-DLmVRSHA.js} +1 -1
  75. package/lib/{pbkdf2-CrsCYTQU.mjs → pbkdf2-GUTNazYD.mjs} +1 -1
  76. package/lib/{signer-Du2DF25K.mjs → signer-Cqs1I7RB.mjs} +1 -1
  77. package/lib/{signer-BcAkKtkv.js → signer-rbcgQjZj.js} +1 -1
  78. package/lib/{solana-DS0mdgC1.mjs → solana-7ZFkKRtX.mjs} +4 -4
  79. package/lib/solana-BYPpXpJs.js +1 -0
  80. package/lib/solana-CcjhlsWI.mjs +16 -0
  81. package/lib/{solana-B2noqxW_.js → solana-DoqT3pca.js} +1 -1
  82. package/lib/{solanaEmbed.esm-Cr2BGkxp.js → solanaEmbed.esm-Bkti_f5v.js} +1 -1
  83. package/lib/{solanaEmbed.esm-B9HRNUtr.mjs → solanaEmbed.esm-LdO_IpPZ.mjs} +3 -3
  84. package/lib/{sui-CnGk4aWJ.mjs → sui-BffnXOND.mjs} +10 -10
  85. package/lib/{sui-CsizbSts.mjs → sui-Ch7mNd_P.mjs} +4 -4
  86. package/lib/{sui-Q9BM2cCK.js → sui-Df7REI6I.js} +2 -2
  87. package/lib/{sui-C7SxJ54B.js → sui-DfRirJoo.js} +1 -1
  88. package/lib/{unsignedTransaction-Cd7qXgBL.mjs → unsignedTransaction-CsCwFMvo.mjs} +4 -4
  89. package/lib/{unsignedTransaction-DDxT_548.js → unsignedTransaction-CvjJdjtG.js} +1 -1
  90. package/package.json +1 -1
  91. package/dist/assets/index-C_hywdem.js +0 -2
  92. package/lib/index-YmHc4VtK.js +0 -1
  93. package/lib/solana-CFMBUeJY.js +0 -1
  94. package/lib/solana-lSSqSdUq.mjs +0 -16
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("./index-Hj_44yP6.js"),xu=require("./dijkstra-CtFxn7S9.js"),kt=require("./events-B3M_mwnv.js"),F=require("./index-Dsp18Ki0.js"),T=require("./index-DIeGmRzd.js");let Nu=class extends T.r{constructor(e){super(e),this.events=new kt.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(T.formatJsonRpcRequest(e.method,e.params||[],e.id||T.getBigIntRpcId().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{T.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),T.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var Cu=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],i=0;i<t.rangeCount;i++)r.push(t.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||r.forEach(function(n){t.addRange(n)}),e&&e.focus()}},Ru=Cu,Bo={"text/plain":"Text","text/html":"Url",default:"Text"},Tu="Copy to clipboard: #{key}, Enter";function Pu(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function Ou(t,e){var r,i,n,s,o,a,h=!1;e||(e={}),r=e.debug||!1;try{n=Ru(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=t,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(f){if(f.stopPropagation(),e.format)if(f.preventDefault(),typeof f.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var m=Bo[e.format]||Bo.default;window.clipboardData.setData(m,t)}else f.clipboardData.clearData(),f.clipboardData.setData(e.format,t);e.onCopy&&(f.preventDefault(),e.onCopy(f.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");h=!0}catch(f){r&&console.error("unable to copy using execCommand: ",f),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),h=!0}catch(m){r&&console.error("unable to copy using clipboardData: ",m),r&&console.error("falling back to prompt"),i=Pu("message"in e?e.message:Tu),window.prompt(i,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return h}var ku=Ou,Bu={}.toString,to=Array.isArray||function(t){return Bu.call(t)=="[object Array]"},Du=K.requireElliptic(),ro={},le={};Object.defineProperty(le,"__esModule",{value:!0});var kc=le.getLocalStorage=Vc=le.getLocalStorageOrThrow=Kc=le.getCrypto=jc=le.getCryptoOrThrow=zc=le.getLocation=$c=le.getLocationOrThrow=Uc=le.getNavigator=qc=le.getNavigatorOrThrow=Lc=le.getDocument=Fc=le.getDocumentOrThrow=Dc=le.getFromWindowOrThrow=Bc=le.getFromWindow=void 0;function Vr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}var Bc=le.getFromWindow=Vr;function ui(t){const e=Vr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}var Dc=le.getFromWindowOrThrow=ui;function Fu(){return ui("document")}var Fc=le.getDocumentOrThrow=Fu;function Lu(){return Vr("document")}var Lc=le.getDocument=Lu;function qu(){return ui("navigator")}var qc=le.getNavigatorOrThrow=qu;function Uu(){return Vr("navigator")}var Uc=le.getNavigator=Uu;function $u(){return ui("location")}var $c=le.getLocationOrThrow=$u;function zu(){return Vr("location")}var zc=le.getLocation=zu;function ju(){return ui("crypto")}var jc=le.getCryptoOrThrow=ju;function Ku(){return Vr("crypto")}var Kc=le.getCrypto=Ku;function Vu(){return ui("localStorage")}var Vc=le.getLocalStorageOrThrow=Vu;function Wu(){return Vr("localStorage")}kc=le.getLocalStorage=Wu;Object.defineProperty(ro,"__esModule",{value:!0});var Wc=ro.getWindowMetadata=void 0;const Do=le;function Hu(){let t,e;try{t=Do.getDocumentOrThrow(),e=Do.getLocationOrThrow()}catch{return null}function r(){const m=t.getElementsByTagName("link"),b=[];for(let v=0;v<m.length;v++){const E=m[v],x=E.getAttribute("rel");if(x&&x.toLowerCase().indexOf("icon")>-1){const S=E.getAttribute("href");if(S)if(S.toLowerCase().indexOf("https:")===-1&&S.toLowerCase().indexOf("http:")===-1&&S.indexOf("//")!==0){let N=e.protocol+"//"+e.host;if(S.indexOf("/")===0)N+=S;else{const R=e.pathname.split("/");R.pop();const O=R.join("/");N+=O+"/"+S}b.push(N)}else if(S.indexOf("//")===0){const N=e.protocol+S;b.push(N)}else b.push(S)}}return b}function i(...m){const b=t.getElementsByTagName("meta");for(let v=0;v<b.length;v++){const E=b[v],x=["itemprop","property","name"].map(S=>E.getAttribute(S)).filter(S=>S?m.includes(S):!1);if(x.length&&x){const S=E.getAttribute("content");if(S)return S}}return""}function n(){let m=i("name","og:site_name","og:title","twitter:title");return m||(m=t.title),m}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),h=e.origin,u=r();return{description:a,url:h,icons:u,name:o}}Wc=ro.getWindowMetadata=Hu;var Ju=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Qu=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),Gu=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=K.dist.process.platform}return t}(),Yu=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),Xu=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Zu=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),ed=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,td=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Fo=3,rd=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",ed]],Lo=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function id(t){return t?qo(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Zu:typeof navigator<"u"?qo(navigator.userAgent):od()}function nd(t){return t!==""&&rd.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function qo(t){var e=nd(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new Xu;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Fo&&(n=Ju(n,ad(Fo-n.length))):n=[];var s=n.join("."),o=sd(t),a=td.exec(t);return a&&a[1]?new Yu(r,s,o,a[1]):new Qu(r,s,o)}function sd(t){for(var e=0,r=Lo.length;e<r;e++){var i=Lo[e],n=i[0],s=i[1],o=s.exec(t);if(o)return n}return null}function od(){var t=typeof K.dist.process<"u"&&K.dist.process.version;return t?new Gu(K.dist.process.version.slice(1)):null}function ad(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}function io(t){return id(t)}function Tn(){const t=io();return t&&t.os?t.os:void 0}function Hc(){const t=Tn();return t?t.toLowerCase().includes("android"):!1}function Jc(){const t=Tn();return t?t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function cd(){return Tn()?Hc()||Jc():!1}function Qc(){const t=io();return t&&t.name?t.name.toLowerCase()==="node":!1}function hd(){return!Qc()&&!!Gc()}const ld=Bc,ud=Dc,dd=Fc,fd=Lc,pd=qc,Gc=Uc,gd=$c,md=zc,yd=jc,vd=Kc,wd=Vc,Pn=kc;function _d(){return Wc()}function bd(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function Ad(t){return typeof t=="string"?t:JSON.stringify(t)}const Yc=bd,Xc=Ad;function Zc(t,e){const r=Xc(e),i=Pn();i&&i.setItem(t,r)}function Ed(t){let e=null,r=null;const i=Pn();return i&&(r=i.getItem(t)),e=r&&Yc(r),e}function Sd(t){const e=Pn();e&&e.removeItem(t)}const eh="WALLETCONNECT_DEEPLINK_CHOICE";function Id(t,e){const r=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${r}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function Md(t){const e=t.href.split("?")[0];Zc(eh,Object.assign(Object.assign({},t),{href:e}))}function th(t,e){return t.filter(r=>r.name.toLowerCase().includes(e.toLowerCase()))[0]}function xd(t,e){let r=t;return e&&(r=e.map(i=>th(t,i)).filter(Boolean)),r}const rh="https://registry.walletconnect.com";function Nd(){return rh+"/api/v2/wallets"}function Cd(){return rh+"/api/v2/dapps"}function ih(t,e="mobile"){var r;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:(r=t.image_url.sm)!==null&&r!==void 0?r:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function Rd(t,e="mobile"){return Object.values(t).filter(r=>!!r[e].universal||!!r[e].native).map(r=>ih(r,e))}const Td=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:io,detectOS:Tn,formatIOSMobile:Id,formatMobileRegistry:Rd,formatMobileRegistryEntry:ih,getClientMeta:_d,getCrypto:vd,getCryptoOrThrow:yd,getDappRegistryUrl:Cd,getDocument:fd,getDocumentOrThrow:dd,getFromWindow:ld,getFromWindowOrThrow:ud,getLocal:Ed,getLocalStorage:Pn,getLocalStorageOrThrow:wd,getLocation:md,getLocationOrThrow:gd,getMobileLinkRegistry:xd,getMobileRegistryEntry:th,getNavigator:Gc,getNavigatorOrThrow:pd,getWalletRegistryUrl:Nd,isAndroid:Hc,isBrowser:hd,isIOS:Jc,isMobile:cd,isNode:Qc,mobileLinkChoiceKey:eh,removeLocal:Sd,safeJsonParse:Yc,safeJsonStringify:Xc,saveMobileLinkInfo:Md,setLocal:Zc},Symbol.toStringTag,{value:"Module"})),Pd=K.getAugmentedNamespace(Td);var Wi={},Od=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},nh={},_r={},kd=to;function Bd(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},t.foo()===42}catch{return!1}}ne.TYPED_ARRAY_SUPPORT=Bd();var Uo=ne.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function ne(t,e,r){return!ne.TYPED_ARRAY_SUPPORT&&!(this instanceof ne)?new ne(t,e,r):typeof t=="number"?sh(this,t):zd(this,t,e,r)}ne.TYPED_ARRAY_SUPPORT&&(ne.prototype.__proto__=Uint8Array.prototype,ne.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&ne[Symbol.species]===ne&&Object.defineProperty(ne,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function no(t){if(t>=Uo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Uo.toString(16)+" bytes");return t|0}function Dd(t){return t!==t}function ii(t,e){var r;return ne.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=ne.prototype):(r=t,r===null&&(r=new ne(e)),r.length=e),r}function sh(t,e){var r=ii(t,e<0?0:no(e)|0);if(!ne.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)r[i]=0;return r}function Fd(t,e){var r=ah(e)|0,i=ii(t,r),n=i.write(e);return n!==r&&(i=i.slice(0,n)),i}function ks(t,e){for(var r=e.length<0?0:no(e.length)|0,i=ii(t,r),n=0;n<r;n+=1)i[n]=e[n]&255;return i}function Ld(t,e,r,i){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");var n;return r===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,i),ne.TYPED_ARRAY_SUPPORT?n.__proto__=ne.prototype:n=ks(t,n),n}function qd(t,e){if(ne.isBuffer(e)){var r=no(e.length)|0,i=ii(t,r);return i.length===0||e.copy(i,0,0,r),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Dd(e.length)?ii(t,0):ks(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return ks(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function oh(t,e){e=e||1/0;for(var r,i=t.length,n=null,s=[],o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function ah(t){if(ne.isBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;return e===0?0:oh(t).length}function Ud(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function $d(t,e,r,i){return Ud(oh(e,t.length-r),t,r,i)}function zd(t,e,r,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Ld(t,e,r,i):typeof e=="string"?Fd(t,e):qd(t,e)}ne.prototype.write=function(e,r,i){r===void 0?(i=this.length,r=0):i===void 0&&typeof r=="string"?(i=this.length,r=0):isFinite(r)&&(r=r|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-r;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return $d(this,e,r,i)};ne.prototype.slice=function(e,r){var i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);var n;if(ne.TYPED_ARRAY_SUPPORT)n=this.subarray(e,r),n.__proto__=ne.prototype;else{var s=r-e;n=new ne(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};ne.prototype.copy=function(e,r,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);var s=n-i,o;if(this===e&&i<r&&r<n)for(o=s-1;o>=0;--o)e[o+r]=this[o+i];else if(s<1e3||!ne.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),r);return s};ne.prototype.fill=function(e,r,i){if(typeof e=="string"){if(typeof r=="string"?(r=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{var o=ne.isBuffer(e)?e:new ne(e),a=o.length;for(s=0;s<i-r;++s)this[s+r]=o[s%a]}return this};ne.concat=function(e,r){if(!kd(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return ii(null,0);var i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;var n=sh(null,r),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!ne.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};ne.byteLength=ah;ne.prototype._isBuffer=!0;ne.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};_r.alloc=function(t){var e=new ne(t);return e.fill(0),e};_r.from=function(t){return new ne(t)};var wt={},so,jd=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];wt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};wt.getSymbolTotalCodewords=function(e){return jd[e]};wt.getBCHDigit=function(t){for(var e=0;t!==0;)e++,t>>>=1;return e};wt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');so=e};wt.isKanjiModeEnabled=function(){return typeof so<"u"};wt.toSJIS=function(e){return so(e)};var On={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");var i=r.toLowerCase();switch(i){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(On);function ch(){this.buffer=[],this.length=0}ch.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Kd=ch,$o=_r;function Hi(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=$o.alloc(t*t),this.reservedBit=$o.alloc(t*t)}Hi.prototype.set=function(t,e,r,i){var n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)};Hi.prototype.get=function(t,e){return this.data[t*this.size+e]};Hi.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Hi.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Vd=Hi,hh={};(function(t){var e=wt.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],h=1;h<n-1;h++)a[h]=a[h-1]-o;return a.push(6),a.reverse()},t.getPositions=function(i){for(var n=[],s=t.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var h=0;h<o;h++)a===0&&h===0||a===0&&h===o-1||a===o-1&&h===0||n.push([s[a],s[h]]);return n}})(hh);var lh={},Wd=wt.getSymbolSize,zo=7;lh.getPositions=function(e){var r=Wd(e);return[[0,0],[r-zo,0],[0,r-zo]]};var uh={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,h=0,u=null,f=null,m=0;m<s;m++){a=h=0,u=f=null;for(var b=0;b<s;b++){var v=n.get(m,b);v===u?a++:(a>=5&&(o+=e.N1+(a-5)),u=v,a=1),v=n.get(b,m),v===f?h++:(h>=5&&(o+=e.N1+(h-5)),f=v,h=1)}a>=5&&(o+=e.N1+(a-5)),h>=5&&(o+=e.N1+(h-5))}return o},t.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var h=0;h<s-1;h++){var u=n.get(a,h)+n.get(a,h+1)+n.get(a+1,h)+n.get(a+1,h+1);(u===4||u===0)&&o++}return o*e.N2},t.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,h=0,u=0;u<s;u++){a=h=0;for(var f=0;f<s;f++)a=a<<1&2047|n.get(u,f),f>=10&&(a===1488||a===93)&&o++,h=h<<1&2047|n.get(f,u),f>=10&&(h===1488||h===93)&&o++}return o*e.N3},t.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var h=Math.abs(Math.ceil(s*100/o/5)-10);return h*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var h=0;h<o;h++)s.isReserved(h,a)||s.xor(h,a,r(n,h,a))},t.getBestMask=function(n,s){for(var o=Object.keys(t.Patterns).length,a=0,h=1/0,u=0;u<o;u++){s(u),t.applyMask(u,n);var f=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),f<h&&(h=f,a=u)}return a}})(uh);var kn={},yr=On,rn=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],nn=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];kn.getBlocksCount=function(e,r){switch(r){case yr.L:return rn[(e-1)*4+0];case yr.M:return rn[(e-1)*4+1];case yr.Q:return rn[(e-1)*4+2];case yr.H:return rn[(e-1)*4+3];default:return}};kn.getTotalCodewordsCount=function(e,r){switch(r){case yr.L:return nn[(e-1)*4+0];case yr.M:return nn[(e-1)*4+1];case yr.Q:return nn[(e-1)*4+2];case yr.H:return nn[(e-1)*4+3];default:return}};var dh={},Bn={},fh=_r,Oi=fh.alloc(512),vn=fh.alloc(256);(function(){for(var e=1,r=0;r<255;r++)Oi[r]=e,vn[e]=r,e<<=1,e&256&&(e^=285);for(r=255;r<512;r++)Oi[r]=Oi[r-255]})();Bn.log=function(e){if(e<1)throw new Error("log("+e+")");return vn[e]};Bn.exp=function(e){return Oi[e]};Bn.mul=function(e,r){return e===0||r===0?0:Oi[vn[e]+vn[r]]};(function(t){var e=_r,r=Bn;t.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var h=0;h<s.length;h++)o[a+h]^=r.mul(n[a],s[h]);return o},t.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],h=0;h<s.length;h++)o[h]^=r.mul(s[h],a);for(var u=0;u<o.length&&o[u]===0;)u++;o=o.slice(u)}return o},t.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=t.mul(s,[1,r.exp(o)]);return s}})(dh);var jo=_r,ph=dh,Hd=K.bufferPolyfill.Buffer;function oo(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}oo.prototype.initialize=function(e){this.degree=e,this.genPoly=ph.generateECPolynomial(this.degree)};oo.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var r=jo.alloc(this.degree),i=Hd.concat([e,r],e.length+this.degree),n=ph.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=jo.alloc(this.degree);return n.copy(o,s),o}return n};var Jd=oo,gh={},br={},ao={};ao.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Ht={},mh="[0-9]+",Qd="[A-Z $%*+\\-./:]+",Ui="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ui=Ui.replace(/u/g,"\\u");var Gd="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ui+`)(?:.|[\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("./index-BJvQdk3o.js"),xu=require("./dijkstra-CtFxn7S9.js"),kt=require("./events-COjha8bx.js"),F=require("./index-CTHiXye2.js"),T=require("./index-D5tJ7kz1.js");let Nu=class extends T.r{constructor(e){super(e),this.events=new kt.eventsExports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(T.formatJsonRpcRequest(e.method,e.params||[],e.id||T.getBigIntRpcId().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{T.isJsonRpcError(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),T.isJsonRpcResponse(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};var Cu=function(){var t=document.getSelection();if(!t.rangeCount)return function(){};for(var e=document.activeElement,r=[],i=0;i<t.rangeCount;i++)r.push(t.getRangeAt(i));switch(e.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":e.blur();break;default:e=null;break}return t.removeAllRanges(),function(){t.type==="Caret"&&t.removeAllRanges(),t.rangeCount||r.forEach(function(n){t.addRange(n)}),e&&e.focus()}},Ru=Cu,Bo={"text/plain":"Text","text/html":"Url",default:"Text"},Tu="Copy to clipboard: #{key}, Enter";function Pu(t){var e=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return t.replace(/#{\s*key\s*}/g,e)}function Ou(t,e){var r,i,n,s,o,a,h=!1;e||(e={}),r=e.debug||!1;try{n=Ru(),s=document.createRange(),o=document.getSelection(),a=document.createElement("span"),a.textContent=t,a.ariaHidden="true",a.style.all="unset",a.style.position="fixed",a.style.top=0,a.style.clip="rect(0, 0, 0, 0)",a.style.whiteSpace="pre",a.style.webkitUserSelect="text",a.style.MozUserSelect="text",a.style.msUserSelect="text",a.style.userSelect="text",a.addEventListener("copy",function(f){if(f.stopPropagation(),e.format)if(f.preventDefault(),typeof f.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var m=Bo[e.format]||Bo.default;window.clipboardData.setData(m,t)}else f.clipboardData.clearData(),f.clipboardData.setData(e.format,t);e.onCopy&&(f.preventDefault(),e.onCopy(f.clipboardData))}),document.body.appendChild(a),s.selectNodeContents(a),o.addRange(s);var u=document.execCommand("copy");if(!u)throw new Error("copy command was unsuccessful");h=!0}catch(f){r&&console.error("unable to copy using execCommand: ",f),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(e.format||"text",t),e.onCopy&&e.onCopy(window.clipboardData),h=!0}catch(m){r&&console.error("unable to copy using clipboardData: ",m),r&&console.error("falling back to prompt"),i=Pu("message"in e?e.message:Tu),window.prompt(i,t)}}finally{o&&(typeof o.removeRange=="function"?o.removeRange(s):o.removeAllRanges()),a&&document.body.removeChild(a),n()}return h}var ku=Ou,Bu={}.toString,to=Array.isArray||function(t){return Bu.call(t)=="[object Array]"},Du=K.requireElliptic(),ro={},le={};Object.defineProperty(le,"__esModule",{value:!0});var kc=le.getLocalStorage=Vc=le.getLocalStorageOrThrow=Kc=le.getCrypto=jc=le.getCryptoOrThrow=zc=le.getLocation=$c=le.getLocationOrThrow=Uc=le.getNavigator=qc=le.getNavigatorOrThrow=Lc=le.getDocument=Fc=le.getDocumentOrThrow=Dc=le.getFromWindowOrThrow=Bc=le.getFromWindow=void 0;function Vr(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}var Bc=le.getFromWindow=Vr;function ui(t){const e=Vr(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}var Dc=le.getFromWindowOrThrow=ui;function Fu(){return ui("document")}var Fc=le.getDocumentOrThrow=Fu;function Lu(){return Vr("document")}var Lc=le.getDocument=Lu;function qu(){return ui("navigator")}var qc=le.getNavigatorOrThrow=qu;function Uu(){return Vr("navigator")}var Uc=le.getNavigator=Uu;function $u(){return ui("location")}var $c=le.getLocationOrThrow=$u;function zu(){return Vr("location")}var zc=le.getLocation=zu;function ju(){return ui("crypto")}var jc=le.getCryptoOrThrow=ju;function Ku(){return Vr("crypto")}var Kc=le.getCrypto=Ku;function Vu(){return ui("localStorage")}var Vc=le.getLocalStorageOrThrow=Vu;function Wu(){return Vr("localStorage")}kc=le.getLocalStorage=Wu;Object.defineProperty(ro,"__esModule",{value:!0});var Wc=ro.getWindowMetadata=void 0;const Do=le;function Hu(){let t,e;try{t=Do.getDocumentOrThrow(),e=Do.getLocationOrThrow()}catch{return null}function r(){const m=t.getElementsByTagName("link"),b=[];for(let v=0;v<m.length;v++){const E=m[v],x=E.getAttribute("rel");if(x&&x.toLowerCase().indexOf("icon")>-1){const S=E.getAttribute("href");if(S)if(S.toLowerCase().indexOf("https:")===-1&&S.toLowerCase().indexOf("http:")===-1&&S.indexOf("//")!==0){let N=e.protocol+"//"+e.host;if(S.indexOf("/")===0)N+=S;else{const R=e.pathname.split("/");R.pop();const O=R.join("/");N+=O+"/"+S}b.push(N)}else if(S.indexOf("//")===0){const N=e.protocol+S;b.push(N)}else b.push(S)}}return b}function i(...m){const b=t.getElementsByTagName("meta");for(let v=0;v<b.length;v++){const E=b[v],x=["itemprop","property","name"].map(S=>E.getAttribute(S)).filter(S=>S?m.includes(S):!1);if(x.length&&x){const S=E.getAttribute("content");if(S)return S}}return""}function n(){let m=i("name","og:site_name","og:title","twitter:title");return m||(m=t.title),m}function s(){return i("description","og:description","twitter:description","keywords")}const o=n(),a=s(),h=e.origin,u=r();return{description:a,url:h,icons:u,name:o}}Wc=ro.getWindowMetadata=Hu;var Ju=function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i},Qu=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),Gu=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=K.dist.process.platform}return t}(),Yu=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),Xu=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Zu=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),ed=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,td=/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,Fo=3,rd=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FBAV\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["searchbot",ed]],Lo=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function id(t){return t?qo(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Zu:typeof navigator<"u"?qo(navigator.userAgent):od()}function nd(t){return t!==""&&rd.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function qo(t){var e=nd(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new Xu;var n=i[1]&&i[1].split(/[._]/).slice(0,3);n?n.length<Fo&&(n=Ju(n,ad(Fo-n.length))):n=[];var s=n.join("."),o=sd(t),a=td.exec(t);return a&&a[1]?new Yu(r,s,o,a[1]):new Qu(r,s,o)}function sd(t){for(var e=0,r=Lo.length;e<r;e++){var i=Lo[e],n=i[0],s=i[1],o=s.exec(t);if(o)return n}return null}function od(){var t=typeof K.dist.process<"u"&&K.dist.process.version;return t?new Gu(K.dist.process.version.slice(1)):null}function ad(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}function io(t){return id(t)}function Tn(){const t=io();return t&&t.os?t.os:void 0}function Hc(){const t=Tn();return t?t.toLowerCase().includes("android"):!1}function Jc(){const t=Tn();return t?t.toLowerCase().includes("ios")||t.toLowerCase().includes("mac")&&navigator.maxTouchPoints>1:!1}function cd(){return Tn()?Hc()||Jc():!1}function Qc(){const t=io();return t&&t.name?t.name.toLowerCase()==="node":!1}function hd(){return!Qc()&&!!Gc()}const ld=Bc,ud=Dc,dd=Fc,fd=Lc,pd=qc,Gc=Uc,gd=$c,md=zc,yd=jc,vd=Kc,wd=Vc,Pn=kc;function _d(){return Wc()}function bd(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return JSON.parse(t)}catch{return t}}function Ad(t){return typeof t=="string"?t:JSON.stringify(t)}const Yc=bd,Xc=Ad;function Zc(t,e){const r=Xc(e),i=Pn();i&&i.setItem(t,r)}function Ed(t){let e=null,r=null;const i=Pn();return i&&(r=i.getItem(t)),e=r&&Yc(r),e}function Sd(t){const e=Pn();e&&e.removeItem(t)}const eh="WALLETCONNECT_DEEPLINK_CHOICE";function Id(t,e){const r=encodeURIComponent(t);return e.universalLink?`${e.universalLink}/wc?uri=${r}`:e.deepLink?`${e.deepLink}${e.deepLink.endsWith(":")?"//":"/"}wc?uri=${r}`:""}function Md(t){const e=t.href.split("?")[0];Zc(eh,Object.assign(Object.assign({},t),{href:e}))}function th(t,e){return t.filter(r=>r.name.toLowerCase().includes(e.toLowerCase()))[0]}function xd(t,e){let r=t;return e&&(r=e.map(i=>th(t,i)).filter(Boolean)),r}const rh="https://registry.walletconnect.com";function Nd(){return rh+"/api/v2/wallets"}function Cd(){return rh+"/api/v2/dapps"}function ih(t,e="mobile"){var r;return{name:t.name||"",shortName:t.metadata.shortName||"",color:t.metadata.colors.primary||"",logo:(r=t.image_url.sm)!==null&&r!==void 0?r:"",universalLink:t[e].universal||"",deepLink:t[e].native||""}}function Rd(t,e="mobile"){return Object.values(t).filter(r=>!!r[e].universal||!!r[e].native).map(r=>ih(r,e))}const Td=Object.freeze(Object.defineProperty({__proto__:null,detectEnv:io,detectOS:Tn,formatIOSMobile:Id,formatMobileRegistry:Rd,formatMobileRegistryEntry:ih,getClientMeta:_d,getCrypto:vd,getCryptoOrThrow:yd,getDappRegistryUrl:Cd,getDocument:fd,getDocumentOrThrow:dd,getFromWindow:ld,getFromWindowOrThrow:ud,getLocal:Ed,getLocalStorage:Pn,getLocalStorageOrThrow:wd,getLocation:md,getLocationOrThrow:gd,getMobileLinkRegistry:xd,getMobileRegistryEntry:th,getNavigator:Gc,getNavigatorOrThrow:pd,getWalletRegistryUrl:Nd,isAndroid:Hc,isBrowser:hd,isIOS:Jc,isMobile:cd,isNode:Qc,mobileLinkChoiceKey:eh,removeLocal:Sd,safeJsonParse:Yc,safeJsonStringify:Xc,saveMobileLinkInfo:Md,setLocal:Zc},Symbol.toStringTag,{value:"Module"})),Pd=K.getAugmentedNamespace(Td);var Wi={},Od=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},nh={},_r={},kd=to;function Bd(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},t.foo()===42}catch{return!1}}ne.TYPED_ARRAY_SUPPORT=Bd();var Uo=ne.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function ne(t,e,r){return!ne.TYPED_ARRAY_SUPPORT&&!(this instanceof ne)?new ne(t,e,r):typeof t=="number"?sh(this,t):zd(this,t,e,r)}ne.TYPED_ARRAY_SUPPORT&&(ne.prototype.__proto__=Uint8Array.prototype,ne.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&ne[Symbol.species]===ne&&Object.defineProperty(ne,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}));function no(t){if(t>=Uo)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Uo.toString(16)+" bytes");return t|0}function Dd(t){return t!==t}function ii(t,e){var r;return ne.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=ne.prototype):(r=t,r===null&&(r=new ne(e)),r.length=e),r}function sh(t,e){var r=ii(t,e<0?0:no(e)|0);if(!ne.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)r[i]=0;return r}function Fd(t,e){var r=ah(e)|0,i=ii(t,r),n=i.write(e);return n!==r&&(i=i.slice(0,n)),i}function ks(t,e){for(var r=e.length<0?0:no(e.length)|0,i=ii(t,r),n=0;n<r;n+=1)i[n]=e[n]&255;return i}function Ld(t,e,r,i){if(r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");var n;return r===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,r):n=new Uint8Array(e,r,i),ne.TYPED_ARRAY_SUPPORT?n.__proto__=ne.prototype:n=ks(t,n),n}function qd(t,e){if(ne.isBuffer(e)){var r=no(e.length)|0,i=ii(t,r);return i.length===0||e.copy(i,0,0,r),i}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||Dd(e.length)?ii(t,0):ks(t,e);if(e.type==="Buffer"&&Array.isArray(e.data))return ks(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function oh(t,e){e=e||1/0;for(var r,i=t.length,n=null,s=[],o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function ah(t){if(ne.isBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var e=t.length;return e===0?0:oh(t).length}function Ud(t,e,r,i){for(var n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function $d(t,e,r,i){return Ud(oh(e,t.length-r),t,r,i)}function zd(t,e,r,i){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Ld(t,e,r,i):typeof e=="string"?Fd(t,e):qd(t,e)}ne.prototype.write=function(e,r,i){r===void 0?(i=this.length,r=0):i===void 0&&typeof r=="string"?(i=this.length,r=0):isFinite(r)&&(r=r|0,isFinite(i)?i=i|0:i=void 0);var n=this.length-r;if((i===void 0||i>n)&&(i=n),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");return $d(this,e,r,i)};ne.prototype.slice=function(e,r){var i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);var n;if(ne.TYPED_ARRAY_SUPPORT)n=this.subarray(e,r),n.__proto__=ne.prototype;else{var s=r-e;n=new ne(s,void 0);for(var o=0;o<s;++o)n[o]=this[o+e]}return n};ne.prototype.copy=function(e,r,i,n){if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);var s=n-i,o;if(this===e&&i<r&&r<n)for(o=s-1;o>=0;--o)e[o+r]=this[o+i];else if(s<1e3||!ne.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+r]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,i+s),r);return s};ne.prototype.fill=function(e,r,i){if(typeof e=="string"){if(typeof r=="string"?(r=0,i=this.length):typeof i=="string"&&(i=this.length),e.length===1){var n=e.charCodeAt(0);n<256&&(e=n)}}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);var s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{var o=ne.isBuffer(e)?e:new ne(e),a=o.length;for(s=0;s<i-r;++s)this[s+r]=o[s%a]}return this};ne.concat=function(e,r){if(!kd(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return ii(null,0);var i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;var n=sh(null,r),s=0;for(i=0;i<e.length;++i){var o=e[i];if(!ne.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,s),s+=o.length}return n};ne.byteLength=ah;ne.prototype._isBuffer=!0;ne.isBuffer=function(e){return!!(e!=null&&e._isBuffer)};_r.alloc=function(t){var e=new ne(t);return e.fill(0),e};_r.from=function(t){return new ne(t)};var wt={},so,jd=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];wt.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};wt.getSymbolTotalCodewords=function(e){return jd[e]};wt.getBCHDigit=function(t){for(var e=0;t!==0;)e++,t>>>=1;return e};wt.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');so=e};wt.isKanjiModeEnabled=function(){return typeof so<"u"};wt.toSJIS=function(e){return so(e)};var On={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");var i=r.toLowerCase();switch(i){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(On);function ch(){this.buffer=[],this.length=0}ch.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Kd=ch,$o=_r;function Hi(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=$o.alloc(t*t),this.reservedBit=$o.alloc(t*t)}Hi.prototype.set=function(t,e,r,i){var n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)};Hi.prototype.get=function(t,e){return this.data[t*this.size+e]};Hi.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Hi.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var Vd=Hi,hh={};(function(t){var e=wt.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];for(var n=Math.floor(i/7)+2,s=e(i),o=s===145?26:Math.ceil((s-13)/(2*n-2))*2,a=[s-7],h=1;h<n-1;h++)a[h]=a[h-1]-o;return a.push(6),a.reverse()},t.getPositions=function(i){for(var n=[],s=t.getRowColCoords(i),o=s.length,a=0;a<o;a++)for(var h=0;h<o;h++)a===0&&h===0||a===0&&h===o-1||a===o-1&&h===0||n.push([s[a],s[h]]);return n}})(hh);var lh={},Wd=wt.getSymbolSize,zo=7;lh.getPositions=function(e){var r=Wd(e);return[[0,0],[r-zo,0],[0,r-zo]]};var uh={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){for(var s=n.size,o=0,a=0,h=0,u=null,f=null,m=0;m<s;m++){a=h=0,u=f=null;for(var b=0;b<s;b++){var v=n.get(m,b);v===u?a++:(a>=5&&(o+=e.N1+(a-5)),u=v,a=1),v=n.get(b,m),v===f?h++:(h>=5&&(o+=e.N1+(h-5)),f=v,h=1)}a>=5&&(o+=e.N1+(a-5)),h>=5&&(o+=e.N1+(h-5))}return o},t.getPenaltyN2=function(n){for(var s=n.size,o=0,a=0;a<s-1;a++)for(var h=0;h<s-1;h++){var u=n.get(a,h)+n.get(a,h+1)+n.get(a+1,h)+n.get(a+1,h+1);(u===4||u===0)&&o++}return o*e.N2},t.getPenaltyN3=function(n){for(var s=n.size,o=0,a=0,h=0,u=0;u<s;u++){a=h=0;for(var f=0;f<s;f++)a=a<<1&2047|n.get(u,f),f>=10&&(a===1488||a===93)&&o++,h=h<<1&2047|n.get(f,u),f>=10&&(h===1488||h===93)&&o++}return o*e.N3},t.getPenaltyN4=function(n){for(var s=0,o=n.data.length,a=0;a<o;a++)s+=n.data[a];var h=Math.abs(Math.ceil(s*100/o/5)-10);return h*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){for(var o=s.size,a=0;a<o;a++)for(var h=0;h<o;h++)s.isReserved(h,a)||s.xor(h,a,r(n,h,a))},t.getBestMask=function(n,s){for(var o=Object.keys(t.Patterns).length,a=0,h=1/0,u=0;u<o;u++){s(u),t.applyMask(u,n);var f=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(u,n),f<h&&(h=f,a=u)}return a}})(uh);var kn={},yr=On,rn=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],nn=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];kn.getBlocksCount=function(e,r){switch(r){case yr.L:return rn[(e-1)*4+0];case yr.M:return rn[(e-1)*4+1];case yr.Q:return rn[(e-1)*4+2];case yr.H:return rn[(e-1)*4+3];default:return}};kn.getTotalCodewordsCount=function(e,r){switch(r){case yr.L:return nn[(e-1)*4+0];case yr.M:return nn[(e-1)*4+1];case yr.Q:return nn[(e-1)*4+2];case yr.H:return nn[(e-1)*4+3];default:return}};var dh={},Bn={},fh=_r,Oi=fh.alloc(512),vn=fh.alloc(256);(function(){for(var e=1,r=0;r<255;r++)Oi[r]=e,vn[e]=r,e<<=1,e&256&&(e^=285);for(r=255;r<512;r++)Oi[r]=Oi[r-255]})();Bn.log=function(e){if(e<1)throw new Error("log("+e+")");return vn[e]};Bn.exp=function(e){return Oi[e]};Bn.mul=function(e,r){return e===0||r===0?0:Oi[vn[e]+vn[r]]};(function(t){var e=_r,r=Bn;t.mul=function(n,s){for(var o=e.alloc(n.length+s.length-1),a=0;a<n.length;a++)for(var h=0;h<s.length;h++)o[a+h]^=r.mul(n[a],s[h]);return o},t.mod=function(n,s){for(var o=e.from(n);o.length-s.length>=0;){for(var a=o[0],h=0;h<s.length;h++)o[h]^=r.mul(s[h],a);for(var u=0;u<o.length&&o[u]===0;)u++;o=o.slice(u)}return o},t.generateECPolynomial=function(n){for(var s=e.from([1]),o=0;o<n;o++)s=t.mul(s,[1,r.exp(o)]);return s}})(dh);var jo=_r,ph=dh,Hd=K.bufferPolyfill.Buffer;function oo(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}oo.prototype.initialize=function(e){this.degree=e,this.genPoly=ph.generateECPolynomial(this.degree)};oo.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var r=jo.alloc(this.degree),i=Hd.concat([e,r],e.length+this.degree),n=ph.mod(i,this.genPoly),s=this.degree-n.length;if(s>0){var o=jo.alloc(this.degree);return n.copy(o,s),o}return n};var Jd=oo,gh={},br={},ao={};ao.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Ht={},mh="[0-9]+",Qd="[A-Z $%*+\\-./:]+",Ui="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ui=Ui.replace(/u/g,"\\u");var Gd="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ui+`)(?:.|[\r
2
2
  ]))+`;Ht.KANJI=new RegExp(Ui,"g");Ht.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ht.BYTE=new RegExp(Gd,"g");Ht.NUMERIC=new RegExp(mh,"g");Ht.ALPHANUMERIC=new RegExp(Qd,"g");var Yd=new RegExp("^"+Ui+"$"),Xd=new RegExp("^"+mh+"$"),Zd=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ht.testKanji=function(e){return Yd.test(e)};Ht.testNumeric=function(e){return Xd.test(e)};Ht.testAlphanumeric=function(e){return Zd.test(e)};(function(t){var e=ao,r=Ht;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,o){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?s.ccBits[0]:o<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");var s=n.toLowerCase();switch(s){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(s,o){if(t.isValid(s))return s;try{return i(s)}catch{return o}}})(br);(function(t){var e=wt,r=kn,i=On,n=br,s=ao,o=to,a=7973,h=e.getBCHDigit(a);function u(v,E,x){for(var S=1;S<=40;S++)if(E<=t.getCapacity(S,x,v))return S}function f(v,E){return n.getCharCountIndicator(v,E)+4}function m(v,E){var x=0;return v.forEach(function(S){var N=f(S.mode,E);x+=N+S.getBitsLength()}),x}function b(v,E){for(var x=1;x<=40;x++){var S=m(v,x);if(S<=t.getCapacity(x,E,n.MIXED))return x}}t.from=function(E,x){return s.isValid(E)?parseInt(E,10):x},t.getCapacity=function(E,x,S){if(!s.isValid(E))throw new Error("Invalid QR Code version");typeof S>"u"&&(S=n.BYTE);var N=e.getSymbolTotalCodewords(E),R=r.getTotalCodewordsCount(E,x),O=(N-R)*8;if(S===n.MIXED)return O;var C=O-f(S,E);switch(S){case n.NUMERIC:return Math.floor(C/10*3);case n.ALPHANUMERIC:return Math.floor(C/11*2);case n.KANJI:return Math.floor(C/13);case n.BYTE:default:return Math.floor(C/8)}},t.getBestVersionForData=function(E,x){var S,N=i.from(x,i.M);if(o(E)){if(E.length>1)return b(E,N);if(E.length===0)return 1;S=E[0]}else S=E;return u(S.mode,S.getLength(),N)},t.getEncodedBits=function(E){if(!s.isValid(E)||E<7)throw new Error("Invalid QR Code version");for(var x=E<<12;e.getBCHDigit(x)-h>=0;)x^=a<<e.getBCHDigit(x)-h;return E<<12|x}})(gh);var yh={},Bs=wt,vh=1335,ef=21522,Ko=Bs.getBCHDigit(vh);yh.getEncodedBits=function(e,r){for(var i=e.bit<<3|r,n=i<<10;Bs.getBCHDigit(n)-Ko>=0;)n^=vh<<Bs.getBCHDigit(n)-Ko;return(i<<10|n)^ef};var wh={},tf=br;function ni(t){this.mode=tf.NUMERIC,this.data=t.toString()}ni.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};ni.prototype.getLength=function(){return this.data.length};ni.prototype.getBitsLength=function(){return ni.getBitsLength(this.data.length)};ni.prototype.write=function(e){var r,i,n;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),n=parseInt(i,10),e.put(n,10);var s=this.data.length-r;s>0&&(i=this.data.substr(r),n=parseInt(i,10),e.put(n,s*3+1))};var rf=ni,nf=br,ns=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function si(t){this.mode=nf.ALPHANUMERIC,this.data=t}si.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};si.prototype.getLength=function(){return this.data.length};si.prototype.getBitsLength=function(){return si.getBitsLength(this.data.length)};si.prototype.write=function(e){var r;for(r=0;r+2<=this.data.length;r+=2){var i=ns.indexOf(this.data[r])*45;i+=ns.indexOf(this.data[r+1]),e.put(i,11)}this.data.length%2&&e.put(ns.indexOf(this.data[r]),6)};var sf=si,of=_r,af=br;function oi(t){this.mode=af.BYTE,this.data=of.from(t)}oi.getBitsLength=function(e){return e*8};oi.prototype.getLength=function(){return this.data.length};oi.prototype.getBitsLength=function(){return oi.getBitsLength(this.data.length)};oi.prototype.write=function(t){for(var e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var cf=oi,hf=br,lf=wt;function ai(t){this.mode=hf.KANJI,this.data=t}ai.getBitsLength=function(e){return e*13};ai.prototype.getLength=function(){return this.data.length};ai.prototype.getBitsLength=function(){return ai.getBitsLength(this.data.length)};ai.prototype.write=function(t){var e;for(e=0;e<this.data.length;e++){var r=lf.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
3
3
  Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var uf=ai;(function(t){var e=br,r=rf,i=sf,n=cf,s=uf,o=Ht,a=wt,h=xu.dijkstraExports;function u(N){return unescape(encodeURIComponent(N)).length}function f(N,R,O){for(var C=[],D;(D=N.exec(O))!==null;)C.push({data:D[0],index:D.index,mode:R,length:D[0].length});return C}function m(N){var R=f(o.NUMERIC,e.NUMERIC,N),O=f(o.ALPHANUMERIC,e.ALPHANUMERIC,N),C,D;a.isKanjiModeEnabled()?(C=f(o.BYTE,e.BYTE,N),D=f(o.KANJI,e.KANJI,N)):(C=f(o.BYTE_KANJI,e.BYTE,N),D=[]);var L=R.concat(O,C,D);return L.sort(function($,U){return $.index-U.index}).map(function($){return{data:$.data,mode:$.mode,length:$.length}})}function b(N,R){switch(R){case e.NUMERIC:return r.getBitsLength(N);case e.ALPHANUMERIC:return i.getBitsLength(N);case e.KANJI:return s.getBitsLength(N);case e.BYTE:return n.getBitsLength(N)}}function v(N){return N.reduce(function(R,O){var C=R.length-1>=0?R[R.length-1]:null;return C&&C.mode===O.mode?(R[R.length-1].data+=O.data,R):(R.push(O),R)},[])}function E(N){for(var R=[],O=0;O<N.length;O++){var C=N[O];switch(C.mode){case e.NUMERIC:R.push([C,{data:C.data,mode:e.ALPHANUMERIC,length:C.length},{data:C.data,mode:e.BYTE,length:C.length}]);break;case e.ALPHANUMERIC:R.push([C,{data:C.data,mode:e.BYTE,length:C.length}]);break;case e.KANJI:R.push([C,{data:C.data,mode:e.BYTE,length:u(C.data)}]);break;case e.BYTE:R.push([{data:C.data,mode:e.BYTE,length:u(C.data)}])}}return R}function x(N,R){for(var O={},C={start:{}},D=["start"],L=0;L<N.length;L++){for(var $=N[L],U=[],ee=0;ee<$.length;ee++){var oe=$[ee],te=""+L+ee;U.push(te),O[te]={node:oe,lastCount:0},C[te]={};for(var he=0;he<D.length;he++){var c=D[he];O[c]&&O[c].node.mode===oe.mode?(C[c][te]=b(O[c].lastCount+oe.length,oe.mode)-b(O[c].lastCount,oe.mode),O[c].lastCount+=oe.length):(O[c]&&(O[c].lastCount=oe.length),C[c][te]=b(oe.length,oe.mode)+4+e.getCharCountIndicator(oe.mode,R))}}D=U}for(he=0;he<D.length;he++)C[D[he]].end=0;return{map:C,table:O}}function S(N,R){var O,C=e.getBestModeForData(N);if(O=e.from(R,C),O!==e.BYTE&&O.bit<C.bit)throw new Error('"'+N+'" cannot be encoded with mode '+e.toString(O)+`.
4
4
  Suggested mode is: `+e.toString(C));switch(O===e.KANJI&&!a.isKanjiModeEnabled()&&(O=e.BYTE),O){case e.NUMERIC:return new r(N);case e.ALPHANUMERIC:return new i(N);case e.KANJI:return new s(N);case e.BYTE:return new n(N)}}t.fromArray=function(R){return R.reduce(function(O,C){return typeof C=="string"?O.push(S(C,null)):C.data&&O.push(S(C.data,C.mode)),O},[])},t.fromString=function(R,O){for(var C=m(R,a.isKanjiModeEnabled()),D=E(C),L=x(D,O),$=h.find_path(L.map,"start","end"),U=[],ee=1;ee<$.length-1;ee++)U.push(L.table[$[ee]].node);return t.fromArray(v(U))},t.rawSplit=function(R){return t.fromArray(m(R,a.isKanjiModeEnabled()))}})(wh);var Vo=_r,Dn=wt,ss=On,df=Kd,ff=Vd,pf=hh,gf=lh,Ds=uh,Fs=kn,mf=Jd,wn=gh,yf=yh,vf=br,os=wh,wf=to;function _f(t,e){for(var r=t.size,i=gf.getPositions(e),n=0;n<i.length;n++)for(var s=i[n][0],o=i[n][1],a=-1;a<=7;a++)if(!(s+a<=-1||r<=s+a))for(var h=-1;h<=7;h++)o+h<=-1||r<=o+h||(a>=0&&a<=6&&(h===0||h===6)||h>=0&&h<=6&&(a===0||a===6)||a>=2&&a<=4&&h>=2&&h<=4?t.set(s+a,o+h,!0,!0):t.set(s+a,o+h,!1,!0))}function bf(t){for(var e=t.size,r=8;r<e-8;r++){var i=r%2===0;t.set(r,6,i,!0),t.set(6,r,i,!0)}}function Af(t,e){for(var r=pf.getPositions(e),i=0;i<r.length;i++)for(var n=r[i][0],s=r[i][1],o=-2;o<=2;o++)for(var a=-2;a<=2;a++)o===-2||o===2||a===-2||a===2||o===0&&a===0?t.set(n+o,s+a,!0,!0):t.set(n+o,s+a,!1,!0)}function Ef(t,e){for(var r=t.size,i=wn.getEncodedBits(e),n,s,o,a=0;a<18;a++)n=Math.floor(a/3),s=a%3+r-8-3,o=(i>>a&1)===1,t.set(n,s,o,!0),t.set(s,n,o,!0)}function as(t,e,r){var i=t.size,n=yf.getEncodedBits(e,r),s,o;for(s=0;s<15;s++)o=(n>>s&1)===1,s<6?t.set(s,8,o,!0):s<8?t.set(s+1,8,o,!0):t.set(i-15+s,8,o,!0),s<8?t.set(8,i-s-1,o,!0):s<9?t.set(8,15-s-1+1,o,!0):t.set(8,15-s-1,o,!0);t.set(i-8,8,1,!0)}function Sf(t,e){for(var r=t.size,i=-1,n=r-1,s=7,o=0,a=r-1;a>0;a-=2)for(a===6&&a--;;){for(var h=0;h<2;h++)if(!t.isReserved(n,a-h)){var u=!1;o<e.length&&(u=(e[o]>>>s&1)===1),t.set(n,a-h,u),s--,s===-1&&(o++,s=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}function If(t,e,r){var i=new df;r.forEach(function(u){i.put(u.mode.bit,4),i.put(u.getLength(),vf.getCharCountIndicator(u.mode,t)),u.write(i)});var n=Dn.getSymbolTotalCodewords(t),s=Fs.getTotalCodewordsCount(t,e),o=(n-s)*8;for(i.getLengthInBits()+4<=o&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);for(var a=(o-i.getLengthInBits())/8,h=0;h<a;h++)i.put(h%2?17:236,8);return Mf(i,t,e)}function Mf(t,e,r){for(var i=Dn.getSymbolTotalCodewords(e),n=Fs.getTotalCodewordsCount(e,r),s=i-n,o=Fs.getBlocksCount(e,r),a=i%o,h=o-a,u=Math.floor(i/o),f=Math.floor(s/o),m=f+1,b=u-f,v=new mf(b),E=0,x=new Array(o),S=new Array(o),N=0,R=Vo.from(t.buffer),O=0;O<o;O++){var C=O<h?f:m;x[O]=R.slice(E,E+C),S[O]=v.encode(x[O]),E+=C,N=Math.max(N,C)}var D=Vo.alloc(i),L=0,$,U;for($=0;$<N;$++)for(U=0;U<o;U++)$<x[U].length&&(D[L++]=x[U][$]);for($=0;$<b;$++)for(U=0;U<o;U++)D[L++]=S[U][$];return D}function xf(t,e,r,i){var n;if(wf(t))n=os.fromArray(t);else if(typeof t=="string"){var s=e;if(!s){var o=os.rawSplit(t);s=wn.getBestVersionForData(o,r)}n=os.fromString(t,s||40)}else throw new Error("Invalid data");var a=wn.getBestVersionForData(n,r);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=a;else if(e<a)throw new Error(`
@@ -1,5 +1,5 @@
1
- import { bo as f, bp as t, bq as e, br as c, bs as O, bt as b, b2 as o, bu as d, bv as p } from "./index-aB_fp0rM.mjs";
2
- import { bw as h } from "./index-aB_fp0rM.mjs";
1
+ import { bn as f, bo as t, bp as e, bq as c, br as O, bs as b, b1 as o, bt as d, bu as p } from "./index-Dc5wV51P.mjs";
2
+ import { bv as h } from "./index-Dc5wV51P.mjs";
3
3
  class A extends Error {
4
4
  constructor(r) {
5
5
  super(r);
@@ -1,6 +1,6 @@
1
- import { n as _t, s as ce, T as N, o as ot, R as Do, a as C, t as H, p as K, y as gt } from "./index-DaqgMXh5.mjs";
1
+ import { n as _t, s as ce, T as N, o as ot, R as Do, a as C, t as H, p as K, y as gt } from "./index-uAstvLd8.mjs";
2
2
  import { d as Uo } from "./dijkstra-BZM-8g-B.mjs";
3
- import { h as Wo } from "./index-aB_fp0rM.mjs";
3
+ import { h as Wo } from "./index-Dc5wV51P.mjs";
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2019 Google LLC
@@ -1,8 +1,8 @@
1
1
  var se = Object.defineProperty;
2
2
  var oe = (s, e, t) => e in s ? se(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
3
  var d = (s, e, t) => oe(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { d4 as l, d7 as T, d0 as y, cf as B, ag as C, ad as f, p as re, u as M, db as Q, dc as ae, N as S, d2 as ce, h as ie, aI as X, d3 as N, d5 as P, dd as de, de as J, cB as pe, d6 as ge, df as ue, dg as Z, c1 as fe, bE as le, bJ as he } from "./index-aB_fp0rM.mjs";
5
- import { A as Ae } from "./algorand-DgpF_mXd.mjs";
4
+ import { d3 as l, d6 as T, c$ as y, ce as _, ag as C, ad as f, p as re, u as M, da as Q, db as ae, N as S, d1 as ce, h as ie, aH as X, d2 as N, d4 as P, dc as de, dd as Z, cA as pe, d5 as ge, de as ue, df as J, c0 as fe, bD as le, bI as he } from "./index-Dc5wV51P.mjs";
5
+ import { A as Ae } from "./algorand-DUcbNcTT.mjs";
6
6
  class ye {
7
7
  constructor(e, t, o, n, r = !1) {
8
8
  d(this, "transaction");
@@ -46,7 +46,7 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
46
46
  }, g = {
47
47
  // Get the storage lsig for a Wormhole message ID
48
48
  forMessageId: (s, e) => {
49
- const t = T(y(s)).publicKey, o = e.emitter.toUniversalAddress().toUint8Array(), n = B.toBytes(BigInt(C(e.chain)), 2), r = f.concat(n, o);
49
+ const t = T(y(s)).publicKey, o = e.emitter.toUniversalAddress().toUint8Array(), n = _.toBytes(BigInt(C(e.chain)), 2), r = f.concat(n, o);
50
50
  return g.fromData({
51
51
  appId: s,
52
52
  appAddress: t,
@@ -153,7 +153,7 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
153
153
  BigInt(m.id) === e && (r = m.keyValue);
154
154
  }), (r == null ? void 0 : r.length) === 0)
155
155
  return n;
156
- const u = BigInt(V), A = BigInt(8), I = o / u * u, w = l(o - I), _ = Math.floor(w / K), b = Math.floor((w - _ * K) / 8), U = S.encode(B.toBytes(_, 1));
156
+ const u = BigInt(V), A = BigInt(8), I = o / u * u, w = l(o - I), B = Math.floor(w / K), b = Math.floor((w - B * K) / 8), U = S.encode(_.toBytes(B, 1));
157
157
  return r == null || r.forEach((m) => {
158
158
  if (m.key === U) {
159
159
  const v = ie.Buffer.from(m.value.bytes, "base64"), E = 1 << l(o % A);
@@ -217,7 +217,7 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
217
217
  const u = N({
218
218
  from: n,
219
219
  appIndex: l(this.coreAppId),
220
- appArgs: [c.publishMessage, t, B.toBytes(0n, 8)],
220
+ appArgs: [c.publishMessage, t, _.toBytes(0n, 8)],
221
221
  accounts: a,
222
222
  onComplete: P.NoOpOC,
223
223
  suggestedParams: r
@@ -239,7 +239,7 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
239
239
  throw new Error("Not implemented");
240
240
  }
241
241
  async parseTransaction(e) {
242
- const t = await this.connection.pendingTransactionInformation(e).do(), o = J.from_obj_for_encoding(t);
242
+ const t = await this.connection.pendingTransactionInformation(e).do(), o = Z.from_obj_for_encoding(t);
243
243
  return this.parseTx(o).map((n) => ({
244
244
  chain: n.emitterChain,
245
245
  emitter: n.emitterAddress,
@@ -247,7 +247,7 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
247
247
  }));
248
248
  }
249
249
  async parseMessages(e) {
250
- const t = await this.connection.pendingTransactionInformation(e).do(), o = J.from_obj_for_encoding(t);
250
+ const t = await this.connection.pendingTransactionInformation(e).do(), o = Z.from_obj_for_encoding(t);
251
251
  return this.parseTx(o);
252
252
  }
253
253
  parseTx(e) {
@@ -257,7 +257,7 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
257
257
  const o = e.txn.txn.apaa ?? [];
258
258
  if (o.length !== 3 || !f.equals(new Uint8Array(o[0]), c.publishMessage))
259
259
  return t;
260
- const n = B.decode(e.logs[0]), r = new X(e.txn.txn.snd).toUniversalAddress(), i = new Uint8Array(o[1]), a = B.decode(o[2]);
260
+ const n = _.decode(e.logs[0]), r = new X(e.txn.txn.snd).toUniversalAddress(), i = new Uint8Array(o[1]), a = _.decode(o[2]);
261
261
  return t.push(pe("Uint8Array", {
262
262
  emitterChain: this.chain,
263
263
  emitterAddress: r,
@@ -302,7 +302,7 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
302
302
  tx: A,
303
303
  signer: {
304
304
  address: n.address(),
305
- signTxn: (I) => Promise.resolve(Z(I, n).blob)
305
+ signTxn: (I) => Promise.resolve(J(I, n).blob)
306
306
  }
307
307
  }), {
308
308
  accounts: [a],
@@ -327,8 +327,8 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
327
327
  emitter: n.emitterAddress
328
328
  }), { accounts: u, txs: A } = await c.maybeCreateStorageTx(e, r, o, p, i);
329
329
  a.push(...A);
330
- const I = g.forGuardianSet(t, n.guardianSet), { accounts: [w], txs: _ } = await c.maybeCreateStorageTx(e, r, t, I, i);
331
- a.push(..._);
330
+ const I = g.forGuardianSet(t, n.guardianSet), { accounts: [w], txs: B } = await c.maybeCreateStorageTx(e, r, t, I, i);
331
+ a.push(...B);
332
332
  let b = [...u, w];
333
333
  const U = await g.decodeLocalState(e, t, w), m = fe(n.hash), v = n.signatures.length, E = Math.ceil(v / c.MAX_SIGS_PER_TXN), G = 20, F = new Q(c.ALGO_VERIFY);
334
334
  for (let O = 0; O < E; O++) {
@@ -354,7 +354,7 @@ const W = 1002e3, j = 15, Y = 127, D = 8, K = Y * D, ee = Y * j, V = D * ee, x =
354
354
  tx: z,
355
355
  signer: {
356
356
  address: F.address(),
357
- signTxn: (h) => Promise.resolve(Z(h, F).blob)
357
+ signTxn: (h) => Promise.resolve(J(h, F).blob)
358
358
  }
359
359
  });
360
360
  }
@@ -1 +1 @@
1
- "use strict";var m=Object.defineProperty;var w=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-Hj_44yP6.js"),g=require("./aptos-Cbmld6H3.js");class d{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=c.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 g.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new d(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(e);if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const o=t.events.filter(n=>n.type.endsWith("WormholeMessage"));if(!o||o.length===0)throw new Error(`WormholeMessage not found for ${e}`);return o.map(n=>{const a=n.data,h=new c.UniversalAddress(BigInt(a.sender).toString(16).padStart(64,"0"));return c.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:h,sequence:BigInt(a.sequence),timestamp:Number(a.timestamp),consistencyLevel:a.consistency_level,nonce:Number(a.nonce),signatures:[],payload:c.hex.decode(a.payload)})})}}c.registerProtocol("Aptos","WormholeCore",d);exports.AptosWormholeCore=d;
1
+ "use strict";var m=Object.defineProperty;var w=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-BJvQdk3o.js"),g=require("./aptos-BhgRAjHC.js");class d{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=c.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 g.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new d(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(e);if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const o=t.events.filter(n=>n.type.endsWith("WormholeMessage"));if(!o||o.length===0)throw new Error(`WormholeMessage not found for ${e}`);return o.map(n=>{const a=n.data,h=new c.UniversalAddress(BigInt(a.sender).toString(16).padStart(64,"0"));return c.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:h,sequence:BigInt(a.sequence),timestamp:Number(a.timestamp),consistencyLevel:a.consistency_level,nonce:Number(a.nonce),signatures:[],payload:c.hex.decode(a.payload)})})}}c.registerProtocol("Aptos","WormholeCore",d);exports.AptosWormholeCore=d;
@@ -1,4 +1,4 @@
1
- "use strict";const H=require("./index-Hj_44yP6.js"),Bt=require("./index-Dsp18Ki0.js"),ti=require("./events-B3M_mwnv.js");function Kr(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Ur(t,r){r||(r=t.reduce((o,h)=>o+h.length,0));const n=Kr(r);let c=0;for(const o of t)n.set(o,c),c+=o.length;return n}const wr={...Bt.identityBase,...Bt.base2,...Bt.base8,...Bt.base10,...Bt.base16,...Bt.base32,...Bt.base36,...Bt.base58,...Bt.base64,...Bt.base256emoji};function Hr(t,r,n,c){return{name:t,prefix:r,encoder:{name:t,prefix:r,encode:n},decoder:{decode:c}}}const vr=Hr("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Ye=Hr("ascii","a",t=>{let r="a";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return r},t=>{t=t.substring(1);const r=Kr(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}),Gr={utf8:vr,"utf-8":vr,hex:wr.base16,latin1:Ye,ascii:Ye,binary:Ye,...wr};function de(t,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):n.decoder.decode(`${n.prefix}${t}`)}function Le(t,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}const ei={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"}},ri=/"(?:_|\\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*:/,ni=/"(?: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*:/,ii=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function si(t,r){if(t==="__proto__"||t==="constructor"&&r&&typeof r=="object"&&"prototype"in r){oi(t);return}return r}function oi(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function De(t,r={}){if(typeof t!="string")return t;const n=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return n.slice(1,-1);if(n.length<=9){const c=n.toLowerCase();if(c==="true")return!0;if(c==="false")return!1;if(c==="undefined")return;if(c==="null")return null;if(c==="nan")return Number.NaN;if(c==="infinity")return Number.POSITIVE_INFINITY;if(c==="-infinity")return Number.NEGATIVE_INFINITY}if(!ii.test(t)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(ri.test(t)||ni.test(t)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,si)}return JSON.parse(t)}catch(c){if(r.strict)throw c;return t}}function ai(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Tt(t,...r){try{return ai(t(...r))}catch(n){return Promise.reject(n)}}function fi(t){const r=typeof t;return t===null||r!=="object"&&r!=="function"}function ci(t){const r=Object.getPrototypeOf(t);return!r||r.isPrototypeOf(Object)}function Ue(t){if(fi(t))return String(t);if(ci(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Ue(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Jr(){if(typeof H.dist.Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const er="base64:";function ui(t){if(typeof t=="string")return t;Jr();const r=H.dist.Buffer.from(t).toString("base64");return er+r}function li(t){return typeof t!="string"||!t.startsWith(er)?t:(Jr(),H.dist.Buffer.from(t.slice(er.length),"base64"))}function Kt(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function hi(...t){return Kt(t.join(":"))}function $e(t){return t=Kt(t),t?t+":":""}const di="memory",bi=()=>{const t=new Map;return{name:di,getInstance:()=>t,hasItem(r){return t.has(r)},getItem(r){return t.get(r)??null},getItemRaw(r){return t.get(r)??null},setItem(r,n){t.set(r,n)},setItemRaw(r,n){t.set(r,n)},removeItem(r){t.delete(r)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function gi(t={}){const r={mounts:{"":t.driver||bi()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=s=>{for(const u of r.mountpoints)if(s.startsWith(u))return{base:u,relativeKey:s.slice(u.length),driver:r.mounts[u]};return{base:"",relativeKey:s,driver:r.mounts[""]}},c=(s,u)=>r.mountpoints.filter(y=>y.startsWith(s)||u&&s.startsWith(y)).map(y=>({relativeBase:s.length>y.length?s.slice(y.length):void 0,mountpoint:y,driver:r.mounts[y]})),o=(s,u)=>{if(r.watching){u=Kt(u);for(const y of r.watchListeners)y(s,u)}},h=async()=>{if(!r.watching){r.watching=!0;for(const s in r.mounts)r.unwatch[s]=await Er(r.mounts[s],o,s)}},S=async()=>{if(r.watching){for(const s in r.unwatch)await r.unwatch[s]();r.unwatch={},r.watching=!1}},E=(s,u,y)=>{const v=new Map,w=x=>{let N=v.get(x.base);return N||(N={driver:x.driver,base:x.base,items:[]},v.set(x.base,N)),N};for(const x of s){const N=typeof x=="string",G=Kt(N?x:x.key),ut=N?void 0:x.value,M=N||!x.options?u:{...u,...x.options},Lt=n(G);w(Lt).items.push({key:G,value:ut,relativeKey:Lt.relativeKey,options:M})}return Promise.all([...v.values()].map(x=>y(x))).then(x=>x.flat())},g={hasItem(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return Tt(v.hasItem,y,u)},getItem(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return Tt(v.getItem,y,u).then(w=>De(w))},getItems(s,u){return E(s,u,y=>y.driver.getItems?Tt(y.driver.getItems,y.items.map(v=>({key:v.relativeKey,options:v.options})),u).then(v=>v.map(w=>({key:hi(y.base,w.key),value:De(w.value)}))):Promise.all(y.items.map(v=>Tt(y.driver.getItem,v.relativeKey,v.options).then(w=>({key:v.key,value:De(w)})))))},getItemRaw(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return v.getItemRaw?Tt(v.getItemRaw,y,u):Tt(v.getItem,y,u).then(w=>li(w))},async setItem(s,u,y={}){if(u===void 0)return g.removeItem(s);s=Kt(s);const{relativeKey:v,driver:w}=n(s);w.setItem&&(await Tt(w.setItem,v,Ue(u),y),w.watch||o("update",s))},async setItems(s,u){await E(s,u,async y=>{if(y.driver.setItems)return Tt(y.driver.setItems,y.items.map(v=>({key:v.relativeKey,value:Ue(v.value),options:v.options})),u);y.driver.setItem&&await Promise.all(y.items.map(v=>Tt(y.driver.setItem,v.relativeKey,Ue(v.value),v.options)))})},async setItemRaw(s,u,y={}){if(u===void 0)return g.removeItem(s,y);s=Kt(s);const{relativeKey:v,driver:w}=n(s);if(w.setItemRaw)await Tt(w.setItemRaw,v,u,y);else if(w.setItem)await Tt(w.setItem,v,ui(u),y);else return;w.watch||o("update",s)},async removeItem(s,u={}){typeof u=="boolean"&&(u={removeMeta:u}),s=Kt(s);const{relativeKey:y,driver:v}=n(s);v.removeItem&&(await Tt(v.removeItem,y,u),(u.removeMeta||u.removeMata)&&await Tt(v.removeItem,y+"$",u),v.watch||o("remove",s))},async getMeta(s,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),s=Kt(s);const{relativeKey:y,driver:v}=n(s),w=Object.create(null);if(v.getMeta&&Object.assign(w,await Tt(v.getMeta,y,u)),!u.nativeOnly){const x=await Tt(v.getItem,y+"$",u).then(N=>De(N));x&&typeof x=="object"&&(typeof x.atime=="string"&&(x.atime=new Date(x.atime)),typeof x.mtime=="string"&&(x.mtime=new Date(x.mtime)),Object.assign(w,x))}return w},setMeta(s,u,y={}){return this.setItem(s+"$",u,y)},removeMeta(s,u={}){return this.removeItem(s+"$",u)},async getKeys(s,u={}){s=$e(s);const y=c(s,!0);let v=[];const w=[];for(const x of y){const N=await Tt(x.driver.getKeys,x.relativeBase,u);for(const G of N){const ut=x.mountpoint+Kt(G);v.some(M=>ut.startsWith(M))||w.push(ut)}v=[x.mountpoint,...v.filter(G=>!G.startsWith(x.mountpoint))]}return s?w.filter(x=>x.startsWith(s)&&x[x.length-1]!=="$"):w.filter(x=>x[x.length-1]!=="$")},async clear(s,u={}){s=$e(s),await Promise.all(c(s,!1).map(async y=>{if(y.driver.clear)return Tt(y.driver.clear,y.relativeBase,u);if(y.driver.removeItem){const v=await y.driver.getKeys(y.relativeBase||"",u);return Promise.all(v.map(w=>y.driver.removeItem(w,u)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(s=>Sr(s)))},async watch(s){return await h(),r.watchListeners.push(s),async()=>{r.watchListeners=r.watchListeners.filter(u=>u!==s),r.watchListeners.length===0&&await S()}},async unwatch(){r.watchListeners=[],await S()},mount(s,u){if(s=$e(s),s&&r.mounts[s])throw new Error(`already mounted at ${s}`);return s&&(r.mountpoints.push(s),r.mountpoints.sort((y,v)=>v.length-y.length)),r.mounts[s]=u,r.watching&&Promise.resolve(Er(u,o,s)).then(y=>{r.unwatch[s]=y}).catch(console.error),g},async unmount(s,u=!0){s=$e(s),!(!s||!r.mounts[s])&&(r.watching&&s in r.unwatch&&(r.unwatch[s](),delete r.unwatch[s]),u&&await Sr(r.mounts[s]),r.mountpoints=r.mountpoints.filter(y=>y!==s),delete r.mounts[s])},getMount(s=""){s=Kt(s)+":";const u=n(s);return{driver:u.driver,base:u.base}},getMounts(s="",u={}){return s=Kt(s),c(s,u.parents).map(v=>({driver:v.driver,base:v.mountpoint}))},keys:(s,u={})=>g.getKeys(s,u),get:(s,u={})=>g.getItem(s,u),set:(s,u,y={})=>g.setItem(s,u,y),has:(s,u={})=>g.hasItem(s,u),del:(s,u={})=>g.removeItem(s,u),remove:(s,u={})=>g.removeItem(s,u)};return g}function Er(t,r,n){return t.watch?t.watch((c,o)=>r(c,n+o)):()=>{}}async function Sr(t){typeof t.dispose=="function"&&await Tt(t.dispose)}function be(t){return new Promise((r,n)=>{t.oncomplete=t.onsuccess=()=>r(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Fr(t,r){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(r);const c=be(n);return(o,h)=>c.then(S=>h(S.transaction(r,o).objectStore(r)))}let Ze;function Ae(){return Ze||(Ze=Fr("keyval-store","keyval")),Ze}function Ir(t,r=Ae()){return r("readonly",n=>be(n.get(t)))}function yi(t,r,n=Ae()){return n("readwrite",c=>(c.put(r,t),be(c.transaction)))}function pi(t,r=Ae()){return r("readwrite",n=>(n.delete(t),be(n.transaction)))}function _i(t=Ae()){return t("readwrite",r=>(r.clear(),be(r.transaction)))}function mi(t,r){return t.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},be(t.transaction)}function xi(t=Ae()){return t("readonly",r=>{if(r.getAllKeys)return be(r.getAllKeys());const n=[];return mi(r,c=>n.push(c.key)).then(()=>n)})}const wi=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),vi=t=>{const r=/([\[:])?(\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,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(c,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function kr(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return vi(t)}catch{return t}}function Wr(t){return typeof t=="string"?t:wi(t)||""}const Ei="idb-keyval";var Si=(t={})=>{const r=t.base&&t.base.length>0?`${t.base}:`:"",n=o=>r+o;let c;return t.dbName&&t.storeName&&(c=Fr(t.dbName,t.storeName)),{name:Ei,options:t,async hasItem(o){return!(typeof await Ir(n(o),c)>"u")},async getItem(o){return await Ir(n(o),c)??null},setItem(o,h){return yi(n(o),h,c)},removeItem(o){return pi(n(o),c)},getKeys(){return xi(c)},clear(){return _i(c)}}};const Ii="WALLET_CONNECT_V2_INDEXED_DB",Oi="keyvaluestorage";let Ti=class{constructor(){this.indexedDb=gi({driver:Si({dbName:Ii,storeName:Oi})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const n=await this.indexedDb.getItem(r);if(n!==null)return n}async setItem(r,n){await this.indexedDb.setItem(r,Wr(n))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof H.dist.global<"u"?H.dist.global:typeof self<"u"?self:{},He={exports:{}};(function(){let t;function r(){}t=r,t.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},t.prototype.setItem=function(n,c){this[n]=String(c)},t.prototype.removeItem=function(n){delete this[n]},t.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(c){n[c]=void 0,delete n[c]})},t.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Qe<"u"&&Qe.localStorage?He.exports=Qe.localStorage:typeof window<"u"&&window.localStorage?He.exports=window.localStorage:He.exports=new r})();function Li(t){var r;return[t[0],kr((r=t[1])!=null?r:"")]}class Ai{constructor(){this.localStorage=He.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Li)}async getItem(r){const n=this.localStorage.getItem(r);if(n!==null)return kr(n)}async setItem(r,n){this.localStorage.setItem(r,Wr(n))}async removeItem(r){this.localStorage.removeItem(r)}}const Ri="wc_storage_version",Or=1,Pi=async(t,r,n)=>{const c=Ri,o=await r.getItem(c);if(o&&o>=Or){n(r);return}const h=await t.getKeys();if(!h.length){n(r);return}const S=[];for(;h.length;){const E=h.shift();if(!E)continue;const g=E.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const s=await t.getItem(E);await r.setItem(E,s),S.push(E)}}await r.setItem(c,Or),n(r),ji(t,S)},ji=async(t,r)=>{r.length&&r.forEach(async n=>{await t.removeItem(n)})};let Ci=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const r=new Ai;this.storage=r;try{const n=new Ti;Pi(r,n,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(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,n){return await this.initialize(),this.storage.setItem(r,n)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),r())},20)})}};class Ni{}function Mi(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var zi=Bi;function Bi(t,r,n){var c=n&&n.stringify||Mi,o=1;if(typeof t=="object"&&t!==null){var h=r.length+o;if(h===1)return t;var S=new Array(h);S[0]=c(t);for(var E=1;E<h;E++)S[E]=c(r[E]);return S.join(" ")}if(typeof t!="string")return t;var g=r.length;if(g===0)return t;for(var s="",u=1-o,y=-1,v=t&&t.length||0,w=0;w<v;){if(t.charCodeAt(w)===37&&w+1<v){switch(y=y>-1?y:0,t.charCodeAt(w+1)){case 100:case 102:if(u>=g||r[u]==null)break;y<w&&(s+=t.slice(y,w)),s+=Number(r[u]),y=w+2,w++;break;case 105:if(u>=g||r[u]==null)break;y<w&&(s+=t.slice(y,w)),s+=Math.floor(Number(r[u])),y=w+2,w++;break;case 79:case 111:case 106:if(u>=g||r[u]===void 0)break;y<w&&(s+=t.slice(y,w));var x=typeof r[u];if(x==="string"){s+="'"+r[u]+"'",y=w+2,w++;break}if(x==="function"){s+=r[u].name||"<anonymous>",y=w+2,w++;break}s+=c(r[u]),y=w+2,w++;break;case 115:if(u>=g)break;y<w&&(s+=t.slice(y,w)),s+=String(r[u]),y=w+2,w++;break;case 37:y<w&&(s+=t.slice(y,w)),s+="%",y=w+2,w++,u--;break}++u}++w}return y===-1?t:(y<v&&(s+=t.slice(y)),s)}const Tr=zi;var me=Qt;const Ie=Wi().console||{},Di={mapHttpRequest:Ke,mapHttpResponse:Ke,wrapRequestSerializer:tr,wrapResponseSerializer:tr,wrapErrorSerializer:tr,req:Ke,res:Ke,err:Gi};function $i(t,r){return Array.isArray(t)?t.filter(function(c){return c!=="!stdSerializers.err"}):t===!0?Object.keys(r):!1}function Qt(t){t=t||{},t.browser=t.browser||{};const r=t.browser.transmit;if(r&&typeof r.send!="function")throw Error("pino: transmit option must have a send function");const n=t.browser.write||Ie;t.browser.write&&(t.browser.asObject=!0);const c=t.serializers||{},o=$i(t.browser.serialize,c);let h=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(h=!1);const S=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),t.enabled===!1&&(t.level="silent");const E=t.level||"info",g=Object.create(n);g.log||(g.log=Oe),Object.defineProperty(g,"levelVal",{get:u}),Object.defineProperty(g,"level",{get:y,set:v});const s={transmit:r,serialize:o,asObject:t.browser.asObject,levels:S,timestamp:Ji(t)};g.levels=Qt.levels,g.level=E,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Oe,g.serializers=c,g._serialize=o,g._stdErrSerialize=h,g.child=w,r&&(g._logEvent=rr());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function v(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,pe(s,g,"error","log"),pe(s,g,"fatal","error"),pe(s,g,"warn","error"),pe(s,g,"info","log"),pe(s,g,"debug","log"),pe(s,g,"trace","log")}function w(x,N){if(!x)throw new Error("missing bindings for child Pino");N=N||{},o&&x.serializers&&(N.serializers=x.serializers);const G=N.serializers;if(o&&G){var ut=Object.assign({},c,G),M=t.browser.serialize===!0?Object.keys(ut):o;delete x.serializers,Ve([x],M,ut,this._stdErrSerialize)}function Lt(gt){this._childLevel=(gt._childLevel|0)+1,this.error=_e(gt,x,"error"),this.fatal=_e(gt,x,"fatal"),this.warn=_e(gt,x,"warn"),this.info=_e(gt,x,"info"),this.debug=_e(gt,x,"debug"),this.trace=_e(gt,x,"trace"),ut&&(this.serializers=ut,this._serialize=M),r&&(this._logEvent=rr([].concat(gt._logEvent.bindings,x)))}return Lt.prototype=this,new Lt(this)}return g}Qt.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"}};Qt.stdSerializers=Di;Qt.stdTimeFunctions=Object.assign({},{nullTime:Vr,epochTime:qr,unixTime:Fi,isoTime:ki});function pe(t,r,n,c){const o=Object.getPrototypeOf(r);r[n]=r.levelVal>r.levels.values[n]?Oe:o[n]?o[n]:Ie[n]||Ie[c]||Oe,Ki(t,r,n)}function Ki(t,r,n){!t.transmit&&r[n]===Oe||(r[n]=function(c){return function(){const h=t.timestamp(),S=new Array(arguments.length),E=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ie?Ie:this;for(var g=0;g<S.length;g++)S[g]=arguments[g];if(t.serialize&&!t.asObject&&Ve(S,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?c.call(E,Ui(this,n,S,h)):c.apply(E,S),t.transmit){const s=t.transmit.level||r.level,u=Qt.levels.values[s],y=Qt.levels.values[n];if(y<u)return;Hi(this,{ts:h,methodLevel:n,methodValue:y,transmitLevel:s,transmitValue:Qt.levels.values[t.transmit.level||r.level],send:t.transmit.send,val:r.levelVal},S)}}}(r[n]))}function Ui(t,r,n,c){t._serialize&&Ve(n,t._serialize,t.serializers,t._stdErrSerialize);const o=n.slice();let h=o[0];const S={};c&&(S.time=c),S.level=Qt.levels.values[r];let E=(t._childLevel|0)+1;if(E<1&&(E=1),h!==null&&typeof h=="object"){for(;E--&&typeof o[0]=="object";)Object.assign(S,o.shift());h=o.length?Tr(o.shift(),o):void 0}else typeof h=="string"&&(h=Tr(o.shift(),o));return h!==void 0&&(S.msg=h),S}function Ve(t,r,n,c){for(const o in t)if(c&&t[o]instanceof Error)t[o]=Qt.stdSerializers.err(t[o]);else if(typeof t[o]=="object"&&!Array.isArray(t[o]))for(const h in t[o])r&&r.indexOf(h)>-1&&h in n&&(t[o][h]=n[h](t[o][h]))}function _e(t,r,n){return function(){const c=new Array(1+arguments.length);c[0]=r;for(var o=1;o<c.length;o++)c[o]=arguments[o-1];return t[n].apply(this,c)}}function Hi(t,r,n){const c=r.send,o=r.ts,h=r.methodLevel,S=r.methodValue,E=r.val,g=t._logEvent.bindings;Ve(n,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=o,t._logEvent.messages=n.filter(function(s){return g.indexOf(s)===-1}),t._logEvent.level.label=h,t._logEvent.level.value=S,c(h,t._logEvent,E),t._logEvent=rr(g)}function rr(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function Gi(t){const r={type:t.constructor.name,msg:t.message,stack:t.stack};for(const n in t)r[n]===void 0&&(r[n]=t[n]);return r}function Ji(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Vr:qr}function Ke(){return{}}function tr(t){return t}function Oe(){}function Vr(){return!1}function qr(){return Date.now()}function Fi(){return Math.round(Date.now()/1e3)}function ki(){return new Date(Date.now()).toISOString()}function Wi(){function t(r){return typeof r<"u"&&r}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 t(self)||t(window)||t(this)||{}}}const or=H.getDefaultExportFromCjs(me),Vi=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n);function Lr(t){return typeof t=="string"?t:Vi(t)||""}const qi={level:"info"},Re="custom_context",ar=1e3*1024;class Xi{constructor(r){this.nodeValue=r,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Ar{constructor(r){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=r,this.sizeInBytes=0}append(r){const n=new Xi(r);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${r} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const r=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=r.size}toArray(){const r=[];let n=this.head;for(;n!==null;)r.push(n.value),n=n.next;return r}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let r=this.head;return{next:()=>{if(!r)return{done:!0,value:null};const n=r.value;return r=r.next,{done:!1,value:n}}}}}class Xr{constructor(r,n=ar){this.level=r??"error",this.levelValue=me.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Ar(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(r,n){n===me.levels.values.error?console.error(r):n===me.levels.values.warn?console.warn(r):n===me.levels.values.debug?console.debug(r):n===me.levels.values.trace?console.trace(r):console.log(r)}appendToLogs(r){this.logs.append(Lr({timestamp:new Date().toISOString(),log:r}));const n=typeof r=="string"?JSON.parse(r).level:r.level;n>=this.levelValue&&this.forwardToConsole(r,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Ar(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(r){const n=this.getLogArray();return n.push(Lr({extraMetadata:r})),new Blob(n,{type:"application/json"})}}class Yi{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}downloadLogsBlobInBrowser(r){const n=URL.createObjectURL(this.logsToBlob(r)),c=document.createElement("a");c.href=n,c.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(n)}}class Zi{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}}var Qi=Object.defineProperty,ts=Object.defineProperties,es=Object.getOwnPropertyDescriptors,Rr=Object.getOwnPropertySymbols,rs=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,Pr=(t,r,n)=>r in t?Qi(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,Ge=(t,r)=>{for(var n in r||(r={}))rs.call(r,n)&&Pr(t,n,r[n]);if(Rr)for(var n of Rr(r))ns.call(r,n)&&Pr(t,n,r[n]);return t},Je=(t,r)=>ts(t,es(r));function is(t){return Je(Ge({},t),{level:(t==null?void 0:t.level)||qi.level})}function ss(t,r=Re){return t[r]||""}function os(t,r,n=Re){return t[n]=r,t}function Yr(t,r=Re){let n="";return typeof t.bindings>"u"?n=ss(t,r):n=t.bindings().context||"",n}function as(t,r,n=Re){const c=Yr(t,n);return c.trim()?`${c}/${r}`:r}function fs(t,r,n=Re){const c=as(t,r,n),o=t.child({context:c});return os(o,c,n)}function cs(t){var r,n;const c=new Yi((r=t.opts)==null?void 0:r.level,t.maxSizeInBytes);return{logger:or(Je(Ge({},t.opts),{level:"trace",browser:Je(Ge({},(n=t.opts)==null?void 0:n.browser),{write:o=>c.write(o)})})),chunkLoggerController:c}}function us(t){var r;const n=new Zi((r=t.opts)==null?void 0:r.level,t.maxSizeInBytes);return{logger:or(Je(Ge({},t.opts),{level:"trace"}),n),chunkLoggerController:n}}function ls(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?cs(t):us(t)}var fr={},Zr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=Bt.binary,n=Bt.wipe;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var c=function(){function E(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return E.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},E.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},E.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},E.prototype.update=function(g,s){if(s===void 0&&(s=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var u=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&s>0;)this._buffer[this._bufferLength++]=g[u++],s--;this._bufferLength===this.blockSize&&(h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(u=h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,u,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=g[u++],s--;return this},E.prototype.finish=function(g){if(!this._finished){var s=this._bytesHashed,u=this._bufferLength,y=s/536870912|0,v=s<<3,w=s%128<112?128:256;this._buffer[u]=128;for(var x=u+1;x<w-8;x++)this._buffer[x]=0;r.writeUint32BE(y,this._buffer,w-8),r.writeUint32BE(v,this._buffer,w-4),h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,w),this._finished=!0}for(var x=0;x<this.digestLength/8;x++)r.writeUint32BE(this._stateHi[x],g,x*8),r.writeUint32BE(this._stateLo[x],g,x*8+4);return this},E.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},E.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},E.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},E.prototype.cleanSavedState=function(g){n.wipe(g.stateHi),n.wipe(g.stateLo),g.buffer&&n.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},E}();t.SHA512=c;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function h(E,g,s,u,y,v,w){for(var x=s[0],N=s[1],G=s[2],ut=s[3],M=s[4],Lt=s[5],gt=s[6],Ct=s[7],J=u[0],C=u[1],Nt=u[2],te=u[3],yt=u[4],kt=u[5],Ut=u[6],qt=u[7],m,_,X,lt,A,I,O,L;w>=128;){for(var At=0;At<16;At++){var rt=8*At+v;E[At]=r.readUint32BE(y,rt),g[At]=r.readUint32BE(y,rt+4)}for(var At=0;At<80;At++){var xe=x,z=N,ge=G,b=ut,d=M,l=Lt,e=gt,a=Ct,R=J,P=C,D=Nt,$=te,B=yt,K=kt,Rt=Ut,ht=qt;if(m=Ct,_=qt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=(M>>>14|yt<<18)^(M>>>18|yt<<14)^(yt>>>9|M<<23),_=(yt>>>14|M<<18)^(yt>>>18|M<<14)^(M>>>9|yt<<23),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=M&Lt^~M&gt,_=yt&kt^~yt&Ut,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=o[At*2],_=o[At*2+1],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=E[At%16],_=g[At%16],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,X=O&65535|L<<16,lt=A&65535|I<<16,m=X,_=lt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=(x>>>28|J<<4)^(J>>>2|x<<30)^(J>>>7|x<<25),_=(J>>>28|x<<4)^(x>>>2|J<<30)^(x>>>7|J<<25),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=x&N^x&G^N&G,_=J&C^J&Nt^C&Nt,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,a=O&65535|L<<16,ht=A&65535|I<<16,m=b,_=$,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=X,_=lt,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,b=O&65535|L<<16,$=A&65535|I<<16,N=xe,G=z,ut=ge,M=b,Lt=d,gt=l,Ct=e,x=a,C=R,Nt=P,te=D,yt=$,kt=B,Ut=K,qt=Rt,J=ht,At%16===15)for(var rt=0;rt<16;rt++)m=E[rt],_=g[rt],A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=E[(rt+9)%16],_=g[(rt+9)%16],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,X=E[(rt+1)%16],lt=g[(rt+1)%16],m=(X>>>1|lt<<31)^(X>>>8|lt<<24)^X>>>7,_=(lt>>>1|X<<31)^(lt>>>8|X<<24)^(lt>>>7|X<<25),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,X=E[(rt+14)%16],lt=g[(rt+14)%16],m=(X>>>19|lt<<13)^(lt>>>29|X<<3)^X>>>6,_=(lt>>>19|X<<13)^(X>>>29|lt<<3)^(lt>>>6|X<<26),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,E[rt]=O&65535|L<<16,g[rt]=A&65535|I<<16}m=x,_=J,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[0],_=u[0],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[0]=x=O&65535|L<<16,u[0]=J=A&65535|I<<16,m=N,_=C,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[1],_=u[1],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[1]=N=O&65535|L<<16,u[1]=C=A&65535|I<<16,m=G,_=Nt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[2],_=u[2],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[2]=G=O&65535|L<<16,u[2]=Nt=A&65535|I<<16,m=ut,_=te,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[3],_=u[3],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[3]=ut=O&65535|L<<16,u[3]=te=A&65535|I<<16,m=M,_=yt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[4],_=u[4],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[4]=M=O&65535|L<<16,u[4]=yt=A&65535|I<<16,m=Lt,_=kt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[5],_=u[5],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[5]=Lt=O&65535|L<<16,u[5]=kt=A&65535|I<<16,m=gt,_=Ut,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[6],_=u[6],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[6]=gt=O&65535|L<<16,u[6]=Ut=A&65535|I<<16,m=Ct,_=qt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[7],_=u[7],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[7]=Ct=O&65535|L<<16,u[7]=qt=A&65535|I<<16,v+=128,w-=128}return v}function S(E){var g=new c;g.update(E);var s=g.digest();return g.clean(),s}t.hash=S})(Zr);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const r=Bt.random,n=Zr,c=Bt.wipe;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function o(b){const d=new Float64Array(16);if(b)for(let l=0;l<b.length;l++)d[l]=b[l];return d}const h=new Uint8Array(32);h[0]=9;const S=o(),E=o([1]),g=o([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),s=o([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function w(b,d){for(let l=0;l<16;l++)b[l]=d[l]|0}function x(b){let d=1;for(let l=0;l<16;l++){let e=b[l]+d+65535;d=Math.floor(e/65536),b[l]=e-d*65536}b[0]+=d-1+37*(d-1)}function N(b,d,l){const e=~(l-1);for(let a=0;a<16;a++){const R=e&(b[a]^d[a]);b[a]^=R,d[a]^=R}}function G(b,d){const l=o(),e=o();for(let a=0;a<16;a++)e[a]=d[a];x(e),x(e),x(e);for(let a=0;a<2;a++){l[0]=e[0]-65517;for(let P=1;P<15;P++)l[P]=e[P]-65535-(l[P-1]>>16&1),l[P-1]&=65535;l[15]=e[15]-32767-(l[14]>>16&1);const R=l[15]>>16&1;l[14]&=65535,N(e,l,1-R)}for(let a=0;a<16;a++)b[2*a]=e[a]&255,b[2*a+1]=e[a]>>8}function ut(b,d){let l=0;for(let e=0;e<32;e++)l|=b[e]^d[e];return(1&l-1>>>8)-1}function M(b,d){const l=new Uint8Array(32),e=new Uint8Array(32);return G(l,b),G(e,d),ut(l,e)}function Lt(b){const d=new Uint8Array(32);return G(d,b),d[0]&1}function gt(b,d){for(let l=0;l<16;l++)b[l]=d[2*l]+(d[2*l+1]<<8);b[15]&=32767}function Ct(b,d,l){for(let e=0;e<16;e++)b[e]=d[e]+l[e]}function J(b,d,l){for(let e=0;e<16;e++)b[e]=d[e]-l[e]}function C(b,d,l){let e,a,R=0,P=0,D=0,$=0,B=0,K=0,Rt=0,ht=0,Pt=0,pt=0,dt=0,nt=0,et=0,Y=0,V=0,U=0,it=0,_t=0,F=0,Mt=0,Dt=0,Ht=0,Gt=0,$t=0,Xt=0,Zt=0,se=0,Jt=0,ce=0,we=0,Pe=0,st=l[0],Z=l[1],ot=l[2],at=l[3],ft=l[4],Q=l[5],mt=l[6],xt=l[7],wt=l[8],vt=l[9],Et=l[10],bt=l[11],ct=l[12],W=l[13],St=l[14],It=l[15];e=d[0],R+=e*st,P+=e*Z,D+=e*ot,$+=e*at,B+=e*ft,K+=e*Q,Rt+=e*mt,ht+=e*xt,Pt+=e*wt,pt+=e*vt,dt+=e*Et,nt+=e*bt,et+=e*ct,Y+=e*W,V+=e*St,U+=e*It,e=d[1],P+=e*st,D+=e*Z,$+=e*ot,B+=e*at,K+=e*ft,Rt+=e*Q,ht+=e*mt,Pt+=e*xt,pt+=e*wt,dt+=e*vt,nt+=e*Et,et+=e*bt,Y+=e*ct,V+=e*W,U+=e*St,it+=e*It,e=d[2],D+=e*st,$+=e*Z,B+=e*ot,K+=e*at,Rt+=e*ft,ht+=e*Q,Pt+=e*mt,pt+=e*xt,dt+=e*wt,nt+=e*vt,et+=e*Et,Y+=e*bt,V+=e*ct,U+=e*W,it+=e*St,_t+=e*It,e=d[3],$+=e*st,B+=e*Z,K+=e*ot,Rt+=e*at,ht+=e*ft,Pt+=e*Q,pt+=e*mt,dt+=e*xt,nt+=e*wt,et+=e*vt,Y+=e*Et,V+=e*bt,U+=e*ct,it+=e*W,_t+=e*St,F+=e*It,e=d[4],B+=e*st,K+=e*Z,Rt+=e*ot,ht+=e*at,Pt+=e*ft,pt+=e*Q,dt+=e*mt,nt+=e*xt,et+=e*wt,Y+=e*vt,V+=e*Et,U+=e*bt,it+=e*ct,_t+=e*W,F+=e*St,Mt+=e*It,e=d[5],K+=e*st,Rt+=e*Z,ht+=e*ot,Pt+=e*at,pt+=e*ft,dt+=e*Q,nt+=e*mt,et+=e*xt,Y+=e*wt,V+=e*vt,U+=e*Et,it+=e*bt,_t+=e*ct,F+=e*W,Mt+=e*St,Dt+=e*It,e=d[6],Rt+=e*st,ht+=e*Z,Pt+=e*ot,pt+=e*at,dt+=e*ft,nt+=e*Q,et+=e*mt,Y+=e*xt,V+=e*wt,U+=e*vt,it+=e*Et,_t+=e*bt,F+=e*ct,Mt+=e*W,Dt+=e*St,Ht+=e*It,e=d[7],ht+=e*st,Pt+=e*Z,pt+=e*ot,dt+=e*at,nt+=e*ft,et+=e*Q,Y+=e*mt,V+=e*xt,U+=e*wt,it+=e*vt,_t+=e*Et,F+=e*bt,Mt+=e*ct,Dt+=e*W,Ht+=e*St,Gt+=e*It,e=d[8],Pt+=e*st,pt+=e*Z,dt+=e*ot,nt+=e*at,et+=e*ft,Y+=e*Q,V+=e*mt,U+=e*xt,it+=e*wt,_t+=e*vt,F+=e*Et,Mt+=e*bt,Dt+=e*ct,Ht+=e*W,Gt+=e*St,$t+=e*It,e=d[9],pt+=e*st,dt+=e*Z,nt+=e*ot,et+=e*at,Y+=e*ft,V+=e*Q,U+=e*mt,it+=e*xt,_t+=e*wt,F+=e*vt,Mt+=e*Et,Dt+=e*bt,Ht+=e*ct,Gt+=e*W,$t+=e*St,Xt+=e*It,e=d[10],dt+=e*st,nt+=e*Z,et+=e*ot,Y+=e*at,V+=e*ft,U+=e*Q,it+=e*mt,_t+=e*xt,F+=e*wt,Mt+=e*vt,Dt+=e*Et,Ht+=e*bt,Gt+=e*ct,$t+=e*W,Xt+=e*St,Zt+=e*It,e=d[11],nt+=e*st,et+=e*Z,Y+=e*ot,V+=e*at,U+=e*ft,it+=e*Q,_t+=e*mt,F+=e*xt,Mt+=e*wt,Dt+=e*vt,Ht+=e*Et,Gt+=e*bt,$t+=e*ct,Xt+=e*W,Zt+=e*St,se+=e*It,e=d[12],et+=e*st,Y+=e*Z,V+=e*ot,U+=e*at,it+=e*ft,_t+=e*Q,F+=e*mt,Mt+=e*xt,Dt+=e*wt,Ht+=e*vt,Gt+=e*Et,$t+=e*bt,Xt+=e*ct,Zt+=e*W,se+=e*St,Jt+=e*It,e=d[13],Y+=e*st,V+=e*Z,U+=e*ot,it+=e*at,_t+=e*ft,F+=e*Q,Mt+=e*mt,Dt+=e*xt,Ht+=e*wt,Gt+=e*vt,$t+=e*Et,Xt+=e*bt,Zt+=e*ct,se+=e*W,Jt+=e*St,ce+=e*It,e=d[14],V+=e*st,U+=e*Z,it+=e*ot,_t+=e*at,F+=e*ft,Mt+=e*Q,Dt+=e*mt,Ht+=e*xt,Gt+=e*wt,$t+=e*vt,Xt+=e*Et,Zt+=e*bt,se+=e*ct,Jt+=e*W,ce+=e*St,we+=e*It,e=d[15],U+=e*st,it+=e*Z,_t+=e*ot,F+=e*at,Mt+=e*ft,Dt+=e*Q,Ht+=e*mt,Gt+=e*xt,$t+=e*wt,Xt+=e*vt,Zt+=e*Et,se+=e*bt,Jt+=e*ct,ce+=e*W,we+=e*St,Pe+=e*It,R+=38*it,P+=38*_t,D+=38*F,$+=38*Mt,B+=38*Dt,K+=38*Ht,Rt+=38*Gt,ht+=38*$t,Pt+=38*Xt,pt+=38*Zt,dt+=38*se,nt+=38*Jt,et+=38*ce,Y+=38*we,V+=38*Pe,a=1,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,e=P+a+65535,a=Math.floor(e/65536),P=e-a*65536,e=D+a+65535,a=Math.floor(e/65536),D=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=K+a+65535,a=Math.floor(e/65536),K=e-a*65536,e=Rt+a+65535,a=Math.floor(e/65536),Rt=e-a*65536,e=ht+a+65535,a=Math.floor(e/65536),ht=e-a*65536,e=Pt+a+65535,a=Math.floor(e/65536),Pt=e-a*65536,e=pt+a+65535,a=Math.floor(e/65536),pt=e-a*65536,e=dt+a+65535,a=Math.floor(e/65536),dt=e-a*65536,e=nt+a+65535,a=Math.floor(e/65536),nt=e-a*65536,e=et+a+65535,a=Math.floor(e/65536),et=e-a*65536,e=Y+a+65535,a=Math.floor(e/65536),Y=e-a*65536,e=V+a+65535,a=Math.floor(e/65536),V=e-a*65536,e=U+a+65535,a=Math.floor(e/65536),U=e-a*65536,R+=a-1+37*(a-1),a=1,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,e=P+a+65535,a=Math.floor(e/65536),P=e-a*65536,e=D+a+65535,a=Math.floor(e/65536),D=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=K+a+65535,a=Math.floor(e/65536),K=e-a*65536,e=Rt+a+65535,a=Math.floor(e/65536),Rt=e-a*65536,e=ht+a+65535,a=Math.floor(e/65536),ht=e-a*65536,e=Pt+a+65535,a=Math.floor(e/65536),Pt=e-a*65536,e=pt+a+65535,a=Math.floor(e/65536),pt=e-a*65536,e=dt+a+65535,a=Math.floor(e/65536),dt=e-a*65536,e=nt+a+65535,a=Math.floor(e/65536),nt=e-a*65536,e=et+a+65535,a=Math.floor(e/65536),et=e-a*65536,e=Y+a+65535,a=Math.floor(e/65536),Y=e-a*65536,e=V+a+65535,a=Math.floor(e/65536),V=e-a*65536,e=U+a+65535,a=Math.floor(e/65536),U=e-a*65536,R+=a-1+37*(a-1),b[0]=R,b[1]=P,b[2]=D,b[3]=$,b[4]=B,b[5]=K,b[6]=Rt,b[7]=ht,b[8]=Pt,b[9]=pt,b[10]=dt,b[11]=nt,b[12]=et,b[13]=Y,b[14]=V,b[15]=U}function Nt(b,d){C(b,d,d)}function te(b,d){const l=o();let e;for(e=0;e<16;e++)l[e]=d[e];for(e=253;e>=0;e--)Nt(l,l),e!==2&&e!==4&&C(l,l,d);for(e=0;e<16;e++)b[e]=l[e]}function yt(b,d){const l=o();let e;for(e=0;e<16;e++)l[e]=d[e];for(e=250;e>=0;e--)Nt(l,l),e!==1&&C(l,l,d);for(e=0;e<16;e++)b[e]=l[e]}function kt(b,d){const l=o(),e=o(),a=o(),R=o(),P=o(),D=o(),$=o(),B=o(),K=o();J(l,b[1],b[0]),J(K,d[1],d[0]),C(l,l,K),Ct(e,b[0],b[1]),Ct(K,d[0],d[1]),C(e,e,K),C(a,b[3],d[3]),C(a,a,s),C(R,b[2],d[2]),Ct(R,R,R),J(P,e,l),J(D,R,a),Ct($,R,a),Ct(B,e,l),C(b[0],P,D),C(b[1],B,$),C(b[2],$,D),C(b[3],P,B)}function Ut(b,d,l){for(let e=0;e<4;e++)N(b[e],d[e],l)}function qt(b,d){const l=o(),e=o(),a=o();te(a,d[2]),C(l,d[0],a),C(e,d[1],a),G(b,e),b[31]^=Lt(l)<<7}function m(b,d,l){w(b[0],S),w(b[1],E),w(b[2],E),w(b[3],S);for(let e=255;e>=0;--e){const a=l[e/8|0]>>(e&7)&1;Ut(b,d,a),kt(d,b),kt(b,b),Ut(b,d,a)}}function _(b,d){const l=[o(),o(),o(),o()];w(l[0],u),w(l[1],y),w(l[2],E),C(l[3],u,y),m(b,l,d)}function X(b){if(b.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const d=(0,n.hash)(b);d[0]&=248,d[31]&=127,d[31]|=64;const l=new Uint8Array(32),e=[o(),o(),o(),o()];_(e,d),qt(l,e);const a=new Uint8Array(64);return a.set(b),a.set(l,32),{publicKey:l,secretKey:a}}t.generateKeyPairFromSeed=X;function lt(b){const d=(0,r.randomBytes)(32,b),l=X(d);return(0,c.wipe)(d),l}t.generateKeyPair=lt;function A(b){if(b.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(b.subarray(32))}t.extractPublicKeyFromSecretKey=A;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function O(b,d){let l,e,a,R;for(e=63;e>=32;--e){for(l=0,a=e-32,R=e-12;a<R;++a)d[a]+=l-16*d[e]*I[a-(e-32)],l=Math.floor((d[a]+128)/256),d[a]-=l*256;d[a]+=l,d[e]=0}for(l=0,a=0;a<32;a++)d[a]+=l-(d[31]>>4)*I[a],l=d[a]>>8,d[a]&=255;for(a=0;a<32;a++)d[a]-=l*I[a];for(e=0;e<32;e++)d[e+1]+=d[e]>>8,b[e]=d[e]&255}function L(b){const d=new Float64Array(64);for(let l=0;l<64;l++)d[l]=b[l];for(let l=0;l<64;l++)b[l]=0;O(b,d)}function At(b,d){const l=new Float64Array(64),e=[o(),o(),o(),o()],a=(0,n.hash)(b.subarray(0,32));a[0]&=248,a[31]&=127,a[31]|=64;const R=new Uint8Array(64);R.set(a.subarray(32),32);const P=new n.SHA512;P.update(R.subarray(32)),P.update(d);const D=P.digest();P.clean(),L(D),_(e,D),qt(R,e),P.reset(),P.update(R.subarray(0,32)),P.update(b.subarray(32)),P.update(d);const $=P.digest();L($);for(let B=0;B<32;B++)l[B]=D[B];for(let B=0;B<32;B++)for(let K=0;K<32;K++)l[B+K]+=$[B]*a[K];return O(R.subarray(32),l),R}t.sign=At;function rt(b,d){const l=o(),e=o(),a=o(),R=o(),P=o(),D=o(),$=o();return w(b[2],E),gt(b[1],d),Nt(a,b[1]),C(R,a,g),J(a,a,b[2]),Ct(R,b[2],R),Nt(P,R),Nt(D,P),C($,D,P),C(l,$,a),C(l,l,R),yt(l,l),C(l,l,a),C(l,l,R),C(l,l,R),C(b[0],l,R),Nt(e,b[0]),C(e,e,R),M(e,a)&&C(b[0],b[0],v),Nt(e,b[0]),C(e,e,R),M(e,a)?-1:(Lt(b[0])===d[31]>>7&&J(b[0],S,b[0]),C(b[3],b[0],b[1]),0)}function xe(b,d,l){const e=new Uint8Array(32),a=[o(),o(),o(),o()],R=[o(),o(),o(),o()];if(l.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(rt(R,b))return!1;const P=new n.SHA512;P.update(l.subarray(0,32)),P.update(b),P.update(d);const D=P.digest();return L(D),m(a,R,D),_(R,l.subarray(32)),kt(a,R),qt(e,a),!ut(l,e)}t.verify=xe;function z(b){let d=[o(),o(),o(),o()];if(rt(d,b))throw new Error("Ed25519: invalid public key");let l=o(),e=o(),a=d[1];Ct(l,E,a),J(e,E,a),te(e,e),C(l,l,e);let R=new Uint8Array(32);return G(R,l),R}t.convertPublicKeyToX25519=z;function ge(b){const d=(0,n.hash)(b.subarray(0,32));d[0]&=248,d[31]&=127,d[31]|=64;const l=new Uint8Array(d.subarray(0,32));return(0,c.wipe)(d),l}t.convertSecretKeyToX25519=ge})(fr);const hs="EdDSA",ds="JWT",Fe=".",qe="base64url",Qr="utf8",tn="utf8",bs=":",gs="did",ys="key",jr="base58btc",ps="z",_s="K36",ms=32,xs=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),ws=t=>{const r=/([\[:])?(\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,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(c,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function vs(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return ws(t)}catch{return t}}function Es(t){return typeof t=="string"?t:xs(t)||""}function Cr(t){return vs(Le(de(t,qe),Qr))}function ke(t){return Le(de(Es(t),Qr),qe)}function en(t){const r=de(_s,jr),n=ps+Le(Ur([r,t]),jr);return[gs,ys,n].join(bs)}function Ss(t){return Le(t,qe)}function Is(t){return de(t,qe)}function Os(t){return de([ke(t.header),ke(t.payload)].join(Fe),tn)}function Ts(t){return[ke(t.header),ke(t.payload),Ss(t.signature)].join(Fe)}function Ls(t){const r=t.split(Fe),n=Cr(r[0]),c=Cr(r[1]),o=Is(r[2]),h=de(r.slice(0,2).join(Fe),tn);return{header:n,payload:c,signature:o,data:h}}function As(t=Bt.random.randomBytes(ms)){return fr.generateKeyPairFromSeed(t)}async function Rs(t,r,n,c,o=Bt.cjs.fromMiliseconds(Date.now())){const h={alg:hs,typ:ds},S=en(c.publicKey),E=o+n,g={iss:S,sub:t,aud:r,iat:o,exp:E},s=Os({header:h,payload:g}),u=fr.sign(c.secretKey,s);return Ts({header:h,payload:g,signature:u})}const Ps="PARSE_ERROR",js="INVALID_REQUEST",Cs="METHOD_NOT_FOUND",Ns="INVALID_PARAMS",rn="INTERNAL_ERROR",cr="SERVER_ERROR",Ms=[-32700,-32600,-32601,-32602,-32603],Se={[Ps]:{code:-32700,message:"Parse error"},[js]:{code:-32600,message:"Invalid Request"},[Cs]:{code:-32601,message:"Method not found"},[Ns]:{code:-32602,message:"Invalid params"},[rn]:{code:-32603,message:"Internal error"},[cr]:{code:-32e3,message:"Server error"}},nn=cr;function zs(t){return Ms.includes(t)}function Nr(t){return Object.keys(Se).includes(t)?Se[t]:Se[nn]}function Bs(t){const r=Object.values(Se).find(n=>n.code===t);return r||Se[nn]}function sn(t,r,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${r}`):t}var on={};/*! *****************************************************************************
1
+ "use strict";const H=require("./index-BJvQdk3o.js"),Bt=require("./index-CTHiXye2.js"),ti=require("./events-COjha8bx.js");function Kr(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Ur(t,r){r||(r=t.reduce((o,h)=>o+h.length,0));const n=Kr(r);let c=0;for(const o of t)n.set(o,c),c+=o.length;return n}const wr={...Bt.identityBase,...Bt.base2,...Bt.base8,...Bt.base10,...Bt.base16,...Bt.base32,...Bt.base36,...Bt.base58,...Bt.base64,...Bt.base256emoji};function Hr(t,r,n,c){return{name:t,prefix:r,encoder:{name:t,prefix:r,encode:n},decoder:{decode:c}}}const vr=Hr("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Ye=Hr("ascii","a",t=>{let r="a";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return r},t=>{t=t.substring(1);const r=Kr(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}),Gr={utf8:vr,"utf-8":vr,hex:wr.base16,latin1:Ye,ascii:Ye,binary:Ye,...wr};function de(t,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):n.decoder.decode(`${n.prefix}${t}`)}function Le(t,r="utf8"){const n=Gr[r];if(!n)throw new Error(`Unsupported encoding "${r}"`);return(r==="utf8"||r==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):n.encoder.encode(t).substring(1)}const ei={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"}},ri=/"(?:_|\\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*:/,ni=/"(?: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*:/,ii=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function si(t,r){if(t==="__proto__"||t==="constructor"&&r&&typeof r=="object"&&"prototype"in r){oi(t);return}return r}function oi(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function De(t,r={}){if(typeof t!="string")return t;const n=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return n.slice(1,-1);if(n.length<=9){const c=n.toLowerCase();if(c==="true")return!0;if(c==="false")return!1;if(c==="undefined")return;if(c==="null")return null;if(c==="nan")return Number.NaN;if(c==="infinity")return Number.POSITIVE_INFINITY;if(c==="-infinity")return Number.NEGATIVE_INFINITY}if(!ii.test(t)){if(r.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(ri.test(t)||ni.test(t)){if(r.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,si)}return JSON.parse(t)}catch(c){if(r.strict)throw c;return t}}function ai(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Tt(t,...r){try{return ai(t(...r))}catch(n){return Promise.reject(n)}}function fi(t){const r=typeof t;return t===null||r!=="object"&&r!=="function"}function ci(t){const r=Object.getPrototypeOf(t);return!r||r.isPrototypeOf(Object)}function Ue(t){if(fi(t))return String(t);if(ci(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return Ue(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Jr(){if(typeof H.dist.Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const er="base64:";function ui(t){if(typeof t=="string")return t;Jr();const r=H.dist.Buffer.from(t).toString("base64");return er+r}function li(t){return typeof t!="string"||!t.startsWith(er)?t:(Jr(),H.dist.Buffer.from(t.slice(er.length),"base64"))}function Kt(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function hi(...t){return Kt(t.join(":"))}function $e(t){return t=Kt(t),t?t+":":""}const di="memory",bi=()=>{const t=new Map;return{name:di,getInstance:()=>t,hasItem(r){return t.has(r)},getItem(r){return t.get(r)??null},getItemRaw(r){return t.get(r)??null},setItem(r,n){t.set(r,n)},setItemRaw(r,n){t.set(r,n)},removeItem(r){t.delete(r)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function gi(t={}){const r={mounts:{"":t.driver||bi()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=s=>{for(const u of r.mountpoints)if(s.startsWith(u))return{base:u,relativeKey:s.slice(u.length),driver:r.mounts[u]};return{base:"",relativeKey:s,driver:r.mounts[""]}},c=(s,u)=>r.mountpoints.filter(y=>y.startsWith(s)||u&&s.startsWith(y)).map(y=>({relativeBase:s.length>y.length?s.slice(y.length):void 0,mountpoint:y,driver:r.mounts[y]})),o=(s,u)=>{if(r.watching){u=Kt(u);for(const y of r.watchListeners)y(s,u)}},h=async()=>{if(!r.watching){r.watching=!0;for(const s in r.mounts)r.unwatch[s]=await Er(r.mounts[s],o,s)}},S=async()=>{if(r.watching){for(const s in r.unwatch)await r.unwatch[s]();r.unwatch={},r.watching=!1}},E=(s,u,y)=>{const v=new Map,w=x=>{let N=v.get(x.base);return N||(N={driver:x.driver,base:x.base,items:[]},v.set(x.base,N)),N};for(const x of s){const N=typeof x=="string",G=Kt(N?x:x.key),ut=N?void 0:x.value,M=N||!x.options?u:{...u,...x.options},Lt=n(G);w(Lt).items.push({key:G,value:ut,relativeKey:Lt.relativeKey,options:M})}return Promise.all([...v.values()].map(x=>y(x))).then(x=>x.flat())},g={hasItem(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return Tt(v.hasItem,y,u)},getItem(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return Tt(v.getItem,y,u).then(w=>De(w))},getItems(s,u){return E(s,u,y=>y.driver.getItems?Tt(y.driver.getItems,y.items.map(v=>({key:v.relativeKey,options:v.options})),u).then(v=>v.map(w=>({key:hi(y.base,w.key),value:De(w.value)}))):Promise.all(y.items.map(v=>Tt(y.driver.getItem,v.relativeKey,v.options).then(w=>({key:v.key,value:De(w)})))))},getItemRaw(s,u={}){s=Kt(s);const{relativeKey:y,driver:v}=n(s);return v.getItemRaw?Tt(v.getItemRaw,y,u):Tt(v.getItem,y,u).then(w=>li(w))},async setItem(s,u,y={}){if(u===void 0)return g.removeItem(s);s=Kt(s);const{relativeKey:v,driver:w}=n(s);w.setItem&&(await Tt(w.setItem,v,Ue(u),y),w.watch||o("update",s))},async setItems(s,u){await E(s,u,async y=>{if(y.driver.setItems)return Tt(y.driver.setItems,y.items.map(v=>({key:v.relativeKey,value:Ue(v.value),options:v.options})),u);y.driver.setItem&&await Promise.all(y.items.map(v=>Tt(y.driver.setItem,v.relativeKey,Ue(v.value),v.options)))})},async setItemRaw(s,u,y={}){if(u===void 0)return g.removeItem(s,y);s=Kt(s);const{relativeKey:v,driver:w}=n(s);if(w.setItemRaw)await Tt(w.setItemRaw,v,u,y);else if(w.setItem)await Tt(w.setItem,v,ui(u),y);else return;w.watch||o("update",s)},async removeItem(s,u={}){typeof u=="boolean"&&(u={removeMeta:u}),s=Kt(s);const{relativeKey:y,driver:v}=n(s);v.removeItem&&(await Tt(v.removeItem,y,u),(u.removeMeta||u.removeMata)&&await Tt(v.removeItem,y+"$",u),v.watch||o("remove",s))},async getMeta(s,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),s=Kt(s);const{relativeKey:y,driver:v}=n(s),w=Object.create(null);if(v.getMeta&&Object.assign(w,await Tt(v.getMeta,y,u)),!u.nativeOnly){const x=await Tt(v.getItem,y+"$",u).then(N=>De(N));x&&typeof x=="object"&&(typeof x.atime=="string"&&(x.atime=new Date(x.atime)),typeof x.mtime=="string"&&(x.mtime=new Date(x.mtime)),Object.assign(w,x))}return w},setMeta(s,u,y={}){return this.setItem(s+"$",u,y)},removeMeta(s,u={}){return this.removeItem(s+"$",u)},async getKeys(s,u={}){s=$e(s);const y=c(s,!0);let v=[];const w=[];for(const x of y){const N=await Tt(x.driver.getKeys,x.relativeBase,u);for(const G of N){const ut=x.mountpoint+Kt(G);v.some(M=>ut.startsWith(M))||w.push(ut)}v=[x.mountpoint,...v.filter(G=>!G.startsWith(x.mountpoint))]}return s?w.filter(x=>x.startsWith(s)&&x[x.length-1]!=="$"):w.filter(x=>x[x.length-1]!=="$")},async clear(s,u={}){s=$e(s),await Promise.all(c(s,!1).map(async y=>{if(y.driver.clear)return Tt(y.driver.clear,y.relativeBase,u);if(y.driver.removeItem){const v=await y.driver.getKeys(y.relativeBase||"",u);return Promise.all(v.map(w=>y.driver.removeItem(w,u)))}}))},async dispose(){await Promise.all(Object.values(r.mounts).map(s=>Sr(s)))},async watch(s){return await h(),r.watchListeners.push(s),async()=>{r.watchListeners=r.watchListeners.filter(u=>u!==s),r.watchListeners.length===0&&await S()}},async unwatch(){r.watchListeners=[],await S()},mount(s,u){if(s=$e(s),s&&r.mounts[s])throw new Error(`already mounted at ${s}`);return s&&(r.mountpoints.push(s),r.mountpoints.sort((y,v)=>v.length-y.length)),r.mounts[s]=u,r.watching&&Promise.resolve(Er(u,o,s)).then(y=>{r.unwatch[s]=y}).catch(console.error),g},async unmount(s,u=!0){s=$e(s),!(!s||!r.mounts[s])&&(r.watching&&s in r.unwatch&&(r.unwatch[s](),delete r.unwatch[s]),u&&await Sr(r.mounts[s]),r.mountpoints=r.mountpoints.filter(y=>y!==s),delete r.mounts[s])},getMount(s=""){s=Kt(s)+":";const u=n(s);return{driver:u.driver,base:u.base}},getMounts(s="",u={}){return s=Kt(s),c(s,u.parents).map(v=>({driver:v.driver,base:v.mountpoint}))},keys:(s,u={})=>g.getKeys(s,u),get:(s,u={})=>g.getItem(s,u),set:(s,u,y={})=>g.setItem(s,u,y),has:(s,u={})=>g.hasItem(s,u),del:(s,u={})=>g.removeItem(s,u),remove:(s,u={})=>g.removeItem(s,u)};return g}function Er(t,r,n){return t.watch?t.watch((c,o)=>r(c,n+o)):()=>{}}async function Sr(t){typeof t.dispose=="function"&&await Tt(t.dispose)}function be(t){return new Promise((r,n)=>{t.oncomplete=t.onsuccess=()=>r(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Fr(t,r){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(r);const c=be(n);return(o,h)=>c.then(S=>h(S.transaction(r,o).objectStore(r)))}let Ze;function Ae(){return Ze||(Ze=Fr("keyval-store","keyval")),Ze}function Ir(t,r=Ae()){return r("readonly",n=>be(n.get(t)))}function yi(t,r,n=Ae()){return n("readwrite",c=>(c.put(r,t),be(c.transaction)))}function pi(t,r=Ae()){return r("readwrite",n=>(n.delete(t),be(n.transaction)))}function _i(t=Ae()){return t("readwrite",r=>(r.clear(),be(r.transaction)))}function mi(t,r){return t.openCursor().onsuccess=function(){this.result&&(r(this.result),this.result.continue())},be(t.transaction)}function xi(t=Ae()){return t("readonly",r=>{if(r.getAllKeys)return be(r.getAllKeys());const n=[];return mi(r,c=>n.push(c.key)).then(()=>n)})}const wi=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),vi=t=>{const r=/([\[:])?(\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,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(c,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function kr(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return vi(t)}catch{return t}}function Wr(t){return typeof t=="string"?t:wi(t)||""}const Ei="idb-keyval";var Si=(t={})=>{const r=t.base&&t.base.length>0?`${t.base}:`:"",n=o=>r+o;let c;return t.dbName&&t.storeName&&(c=Fr(t.dbName,t.storeName)),{name:Ei,options:t,async hasItem(o){return!(typeof await Ir(n(o),c)>"u")},async getItem(o){return await Ir(n(o),c)??null},setItem(o,h){return yi(n(o),h,c)},removeItem(o){return pi(n(o),c)},getKeys(){return xi(c)},clear(){return _i(c)}}};const Ii="WALLET_CONNECT_V2_INDEXED_DB",Oi="keyvaluestorage";let Ti=class{constructor(){this.indexedDb=gi({driver:Si({dbName:Ii,storeName:Oi})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(r=>[r.key,r.value])}async getItem(r){const n=await this.indexedDb.getItem(r);if(n!==null)return n}async setItem(r,n){await this.indexedDb.setItem(r,Wr(n))}async removeItem(r){await this.indexedDb.removeItem(r)}};var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof H.dist.global<"u"?H.dist.global:typeof self<"u"?self:{},He={exports:{}};(function(){let t;function r(){}t=r,t.prototype.getItem=function(n){return this.hasOwnProperty(n)?String(this[n]):null},t.prototype.setItem=function(n,c){this[n]=String(c)},t.prototype.removeItem=function(n){delete this[n]},t.prototype.clear=function(){const n=this;Object.keys(n).forEach(function(c){n[c]=void 0,delete n[c]})},t.prototype.key=function(n){return n=n||0,Object.keys(this)[n]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Qe<"u"&&Qe.localStorage?He.exports=Qe.localStorage:typeof window<"u"&&window.localStorage?He.exports=window.localStorage:He.exports=new r})();function Li(t){var r;return[t[0],kr((r=t[1])!=null?r:"")]}class Ai{constructor(){this.localStorage=He.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(Li)}async getItem(r){const n=this.localStorage.getItem(r);if(n!==null)return kr(n)}async setItem(r,n){this.localStorage.setItem(r,Wr(n))}async removeItem(r){this.localStorage.removeItem(r)}}const Ri="wc_storage_version",Or=1,Pi=async(t,r,n)=>{const c=Ri,o=await r.getItem(c);if(o&&o>=Or){n(r);return}const h=await t.getKeys();if(!h.length){n(r);return}const S=[];for(;h.length;){const E=h.shift();if(!E)continue;const g=E.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const s=await t.getItem(E);await r.setItem(E,s),S.push(E)}}await r.setItem(c,Or),n(r),ji(t,S)},ji=async(t,r)=>{r.length&&r.forEach(async n=>{await t.removeItem(n)})};let Ci=class{constructor(){this.initialized=!1,this.setInitialized=n=>{this.storage=n,this.initialized=!0};const r=new Ai;this.storage=r;try{const n=new Ti;Pi(r,n,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(r){return await this.initialize(),this.storage.getItem(r)}async setItem(r,n){return await this.initialize(),this.storage.setItem(r,n)}async removeItem(r){return await this.initialize(),this.storage.removeItem(r)}async initialize(){this.initialized||await new Promise(r=>{const n=setInterval(()=>{this.initialized&&(clearInterval(n),r())},20)})}};class Ni{}function Mi(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var zi=Bi;function Bi(t,r,n){var c=n&&n.stringify||Mi,o=1;if(typeof t=="object"&&t!==null){var h=r.length+o;if(h===1)return t;var S=new Array(h);S[0]=c(t);for(var E=1;E<h;E++)S[E]=c(r[E]);return S.join(" ")}if(typeof t!="string")return t;var g=r.length;if(g===0)return t;for(var s="",u=1-o,y=-1,v=t&&t.length||0,w=0;w<v;){if(t.charCodeAt(w)===37&&w+1<v){switch(y=y>-1?y:0,t.charCodeAt(w+1)){case 100:case 102:if(u>=g||r[u]==null)break;y<w&&(s+=t.slice(y,w)),s+=Number(r[u]),y=w+2,w++;break;case 105:if(u>=g||r[u]==null)break;y<w&&(s+=t.slice(y,w)),s+=Math.floor(Number(r[u])),y=w+2,w++;break;case 79:case 111:case 106:if(u>=g||r[u]===void 0)break;y<w&&(s+=t.slice(y,w));var x=typeof r[u];if(x==="string"){s+="'"+r[u]+"'",y=w+2,w++;break}if(x==="function"){s+=r[u].name||"<anonymous>",y=w+2,w++;break}s+=c(r[u]),y=w+2,w++;break;case 115:if(u>=g)break;y<w&&(s+=t.slice(y,w)),s+=String(r[u]),y=w+2,w++;break;case 37:y<w&&(s+=t.slice(y,w)),s+="%",y=w+2,w++,u--;break}++u}++w}return y===-1?t:(y<v&&(s+=t.slice(y)),s)}const Tr=zi;var me=Qt;const Ie=Wi().console||{},Di={mapHttpRequest:Ke,mapHttpResponse:Ke,wrapRequestSerializer:tr,wrapResponseSerializer:tr,wrapErrorSerializer:tr,req:Ke,res:Ke,err:Gi};function $i(t,r){return Array.isArray(t)?t.filter(function(c){return c!=="!stdSerializers.err"}):t===!0?Object.keys(r):!1}function Qt(t){t=t||{},t.browser=t.browser||{};const r=t.browser.transmit;if(r&&typeof r.send!="function")throw Error("pino: transmit option must have a send function");const n=t.browser.write||Ie;t.browser.write&&(t.browser.asObject=!0);const c=t.serializers||{},o=$i(t.browser.serialize,c);let h=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(h=!1);const S=["error","fatal","warn","info","debug","trace"];typeof n=="function"&&(n.error=n.fatal=n.warn=n.info=n.debug=n.trace=n),t.enabled===!1&&(t.level="silent");const E=t.level||"info",g=Object.create(n);g.log||(g.log=Oe),Object.defineProperty(g,"levelVal",{get:u}),Object.defineProperty(g,"level",{get:y,set:v});const s={transmit:r,serialize:o,asObject:t.browser.asObject,levels:S,timestamp:Ji(t)};g.levels=Qt.levels,g.level=E,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Oe,g.serializers=c,g._serialize=o,g._stdErrSerialize=h,g.child=w,r&&(g._logEvent=rr());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function y(){return this._level}function v(x){if(x!=="silent"&&!this.levels.values[x])throw Error("unknown level "+x);this._level=x,pe(s,g,"error","log"),pe(s,g,"fatal","error"),pe(s,g,"warn","error"),pe(s,g,"info","log"),pe(s,g,"debug","log"),pe(s,g,"trace","log")}function w(x,N){if(!x)throw new Error("missing bindings for child Pino");N=N||{},o&&x.serializers&&(N.serializers=x.serializers);const G=N.serializers;if(o&&G){var ut=Object.assign({},c,G),M=t.browser.serialize===!0?Object.keys(ut):o;delete x.serializers,Ve([x],M,ut,this._stdErrSerialize)}function Lt(gt){this._childLevel=(gt._childLevel|0)+1,this.error=_e(gt,x,"error"),this.fatal=_e(gt,x,"fatal"),this.warn=_e(gt,x,"warn"),this.info=_e(gt,x,"info"),this.debug=_e(gt,x,"debug"),this.trace=_e(gt,x,"trace"),ut&&(this.serializers=ut,this._serialize=M),r&&(this._logEvent=rr([].concat(gt._logEvent.bindings,x)))}return Lt.prototype=this,new Lt(this)}return g}Qt.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"}};Qt.stdSerializers=Di;Qt.stdTimeFunctions=Object.assign({},{nullTime:Vr,epochTime:qr,unixTime:Fi,isoTime:ki});function pe(t,r,n,c){const o=Object.getPrototypeOf(r);r[n]=r.levelVal>r.levels.values[n]?Oe:o[n]?o[n]:Ie[n]||Ie[c]||Oe,Ki(t,r,n)}function Ki(t,r,n){!t.transmit&&r[n]===Oe||(r[n]=function(c){return function(){const h=t.timestamp(),S=new Array(arguments.length),E=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Ie?Ie:this;for(var g=0;g<S.length;g++)S[g]=arguments[g];if(t.serialize&&!t.asObject&&Ve(S,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?c.call(E,Ui(this,n,S,h)):c.apply(E,S),t.transmit){const s=t.transmit.level||r.level,u=Qt.levels.values[s],y=Qt.levels.values[n];if(y<u)return;Hi(this,{ts:h,methodLevel:n,methodValue:y,transmitLevel:s,transmitValue:Qt.levels.values[t.transmit.level||r.level],send:t.transmit.send,val:r.levelVal},S)}}}(r[n]))}function Ui(t,r,n,c){t._serialize&&Ve(n,t._serialize,t.serializers,t._stdErrSerialize);const o=n.slice();let h=o[0];const S={};c&&(S.time=c),S.level=Qt.levels.values[r];let E=(t._childLevel|0)+1;if(E<1&&(E=1),h!==null&&typeof h=="object"){for(;E--&&typeof o[0]=="object";)Object.assign(S,o.shift());h=o.length?Tr(o.shift(),o):void 0}else typeof h=="string"&&(h=Tr(o.shift(),o));return h!==void 0&&(S.msg=h),S}function Ve(t,r,n,c){for(const o in t)if(c&&t[o]instanceof Error)t[o]=Qt.stdSerializers.err(t[o]);else if(typeof t[o]=="object"&&!Array.isArray(t[o]))for(const h in t[o])r&&r.indexOf(h)>-1&&h in n&&(t[o][h]=n[h](t[o][h]))}function _e(t,r,n){return function(){const c=new Array(1+arguments.length);c[0]=r;for(var o=1;o<c.length;o++)c[o]=arguments[o-1];return t[n].apply(this,c)}}function Hi(t,r,n){const c=r.send,o=r.ts,h=r.methodLevel,S=r.methodValue,E=r.val,g=t._logEvent.bindings;Ve(n,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=o,t._logEvent.messages=n.filter(function(s){return g.indexOf(s)===-1}),t._logEvent.level.label=h,t._logEvent.level.value=S,c(h,t._logEvent,E),t._logEvent=rr(g)}function rr(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function Gi(t){const r={type:t.constructor.name,msg:t.message,stack:t.stack};for(const n in t)r[n]===void 0&&(r[n]=t[n]);return r}function Ji(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Vr:qr}function Ke(){return{}}function tr(t){return t}function Oe(){}function Vr(){return!1}function qr(){return Date.now()}function Fi(){return Math.round(Date.now()/1e3)}function ki(){return new Date(Date.now()).toISOString()}function Wi(){function t(r){return typeof r<"u"&&r}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 t(self)||t(window)||t(this)||{}}}const or=H.getDefaultExportFromCjs(me),Vi=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n);function Lr(t){return typeof t=="string"?t:Vi(t)||""}const qi={level:"info"},Re="custom_context",ar=1e3*1024;class Xi{constructor(r){this.nodeValue=r,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Ar{constructor(r){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=r,this.sizeInBytes=0}append(r){const n=new Xi(r);if(n.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${r} with size ${n.size}`);for(;this.size+n.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=n),this.tail=n):(this.head=n,this.tail=n),this.lengthInNodes++,this.sizeInBytes+=n.size}shift(){if(!this.head)return;const r=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=r.size}toArray(){const r=[];let n=this.head;for(;n!==null;)r.push(n.value),n=n.next;return r}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let r=this.head;return{next:()=>{if(!r)return{done:!0,value:null};const n=r.value;return r=r.next,{done:!1,value:n}}}}}class Xr{constructor(r,n=ar){this.level=r??"error",this.levelValue=me.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=n,this.logs=new Ar(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(r,n){n===me.levels.values.error?console.error(r):n===me.levels.values.warn?console.warn(r):n===me.levels.values.debug?console.debug(r):n===me.levels.values.trace?console.trace(r):console.log(r)}appendToLogs(r){this.logs.append(Lr({timestamp:new Date().toISOString(),log:r}));const n=typeof r=="string"?JSON.parse(r).level:r.level;n>=this.levelValue&&this.forwardToConsole(r,n)}getLogs(){return this.logs}clearLogs(){this.logs=new Ar(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(r){const n=this.getLogArray();return n.push(Lr({extraMetadata:r})),new Blob(n,{type:"application/json"})}}class Yi{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}downloadLogsBlobInBrowser(r){const n=URL.createObjectURL(this.logsToBlob(r)),c=document.createElement("a");c.href=n,c.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(n)}}class Zi{constructor(r,n=ar){this.baseChunkLogger=new Xr(r,n)}write(r){this.baseChunkLogger.appendToLogs(r)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(r){return this.baseChunkLogger.logsToBlob(r)}}var Qi=Object.defineProperty,ts=Object.defineProperties,es=Object.getOwnPropertyDescriptors,Rr=Object.getOwnPropertySymbols,rs=Object.prototype.hasOwnProperty,ns=Object.prototype.propertyIsEnumerable,Pr=(t,r,n)=>r in t?Qi(t,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[r]=n,Ge=(t,r)=>{for(var n in r||(r={}))rs.call(r,n)&&Pr(t,n,r[n]);if(Rr)for(var n of Rr(r))ns.call(r,n)&&Pr(t,n,r[n]);return t},Je=(t,r)=>ts(t,es(r));function is(t){return Je(Ge({},t),{level:(t==null?void 0:t.level)||qi.level})}function ss(t,r=Re){return t[r]||""}function os(t,r,n=Re){return t[n]=r,t}function Yr(t,r=Re){let n="";return typeof t.bindings>"u"?n=ss(t,r):n=t.bindings().context||"",n}function as(t,r,n=Re){const c=Yr(t,n);return c.trim()?`${c}/${r}`:r}function fs(t,r,n=Re){const c=as(t,r,n),o=t.child({context:c});return os(o,c,n)}function cs(t){var r,n;const c=new Yi((r=t.opts)==null?void 0:r.level,t.maxSizeInBytes);return{logger:or(Je(Ge({},t.opts),{level:"trace",browser:Je(Ge({},(n=t.opts)==null?void 0:n.browser),{write:o=>c.write(o)})})),chunkLoggerController:c}}function us(t){var r;const n=new Zi((r=t.opts)==null?void 0:r.level,t.maxSizeInBytes);return{logger:or(Je(Ge({},t.opts),{level:"trace"}),n),chunkLoggerController:n}}function ls(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?cs(t):us(t)}var fr={},Zr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var r=Bt.binary,n=Bt.wipe;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var c=function(){function E(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return E.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},E.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},E.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._tempHi),n.wipe(this._tempLo),this.reset()},E.prototype.update=function(g,s){if(s===void 0&&(s=g.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var u=0;if(this._bytesHashed+=s,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&s>0;)this._buffer[this._bufferLength++]=g[u++],s--;this._bufferLength===this.blockSize&&(h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(s>=this.blockSize&&(u=h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,u,s),s%=this.blockSize);s>0;)this._buffer[this._bufferLength++]=g[u++],s--;return this},E.prototype.finish=function(g){if(!this._finished){var s=this._bytesHashed,u=this._bufferLength,y=s/536870912|0,v=s<<3,w=s%128<112?128:256;this._buffer[u]=128;for(var x=u+1;x<w-8;x++)this._buffer[x]=0;r.writeUint32BE(y,this._buffer,w-8),r.writeUint32BE(v,this._buffer,w-4),h(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,w),this._finished=!0}for(var x=0;x<this.digestLength/8;x++)r.writeUint32BE(this._stateHi[x],g,x*8),r.writeUint32BE(this._stateLo[x],g,x*8+4);return this},E.prototype.digest=function(){var g=new Uint8Array(this.digestLength);return this.finish(g),g},E.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},E.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},E.prototype.cleanSavedState=function(g){n.wipe(g.stateHi),n.wipe(g.stateLo),g.buffer&&n.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},E}();t.SHA512=c;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function h(E,g,s,u,y,v,w){for(var x=s[0],N=s[1],G=s[2],ut=s[3],M=s[4],Lt=s[5],gt=s[6],Ct=s[7],J=u[0],C=u[1],Nt=u[2],te=u[3],yt=u[4],kt=u[5],Ut=u[6],qt=u[7],m,_,X,lt,A,I,O,L;w>=128;){for(var At=0;At<16;At++){var rt=8*At+v;E[At]=r.readUint32BE(y,rt),g[At]=r.readUint32BE(y,rt+4)}for(var At=0;At<80;At++){var xe=x,z=N,ge=G,b=ut,d=M,l=Lt,e=gt,a=Ct,R=J,P=C,D=Nt,$=te,B=yt,K=kt,Rt=Ut,ht=qt;if(m=Ct,_=qt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=(M>>>14|yt<<18)^(M>>>18|yt<<14)^(yt>>>9|M<<23),_=(yt>>>14|M<<18)^(yt>>>18|M<<14)^(M>>>9|yt<<23),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=M&Lt^~M&gt,_=yt&kt^~yt&Ut,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=o[At*2],_=o[At*2+1],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=E[At%16],_=g[At%16],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,X=O&65535|L<<16,lt=A&65535|I<<16,m=X,_=lt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=(x>>>28|J<<4)^(J>>>2|x<<30)^(J>>>7|x<<25),_=(J>>>28|x<<4)^(x>>>2|J<<30)^(x>>>7|J<<25),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,m=x&N^x&G^N&G,_=J&C^J&Nt^C&Nt,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,a=O&65535|L<<16,ht=A&65535|I<<16,m=b,_=$,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=X,_=lt,A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,b=O&65535|L<<16,$=A&65535|I<<16,N=xe,G=z,ut=ge,M=b,Lt=d,gt=l,Ct=e,x=a,C=R,Nt=P,te=D,yt=$,kt=B,Ut=K,qt=Rt,J=ht,At%16===15)for(var rt=0;rt<16;rt++)m=E[rt],_=g[rt],A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=E[(rt+9)%16],_=g[(rt+9)%16],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,X=E[(rt+1)%16],lt=g[(rt+1)%16],m=(X>>>1|lt<<31)^(X>>>8|lt<<24)^X>>>7,_=(lt>>>1|X<<31)^(lt>>>8|X<<24)^(lt>>>7|X<<25),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,X=E[(rt+14)%16],lt=g[(rt+14)%16],m=(X>>>19|lt<<13)^(lt>>>29|X<<3)^X>>>6,_=(lt>>>19|X<<13)^(X>>>29|lt<<3)^(lt>>>6|X<<26),A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,E[rt]=O&65535|L<<16,g[rt]=A&65535|I<<16}m=x,_=J,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[0],_=u[0],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[0]=x=O&65535|L<<16,u[0]=J=A&65535|I<<16,m=N,_=C,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[1],_=u[1],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[1]=N=O&65535|L<<16,u[1]=C=A&65535|I<<16,m=G,_=Nt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[2],_=u[2],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[2]=G=O&65535|L<<16,u[2]=Nt=A&65535|I<<16,m=ut,_=te,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[3],_=u[3],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[3]=ut=O&65535|L<<16,u[3]=te=A&65535|I<<16,m=M,_=yt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[4],_=u[4],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[4]=M=O&65535|L<<16,u[4]=yt=A&65535|I<<16,m=Lt,_=kt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[5],_=u[5],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[5]=Lt=O&65535|L<<16,u[5]=kt=A&65535|I<<16,m=gt,_=Ut,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[6],_=u[6],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[6]=gt=O&65535|L<<16,u[6]=Ut=A&65535|I<<16,m=Ct,_=qt,A=_&65535,I=_>>>16,O=m&65535,L=m>>>16,m=s[7],_=u[7],A+=_&65535,I+=_>>>16,O+=m&65535,L+=m>>>16,I+=A>>>16,O+=I>>>16,L+=O>>>16,s[7]=Ct=O&65535|L<<16,u[7]=qt=A&65535|I<<16,v+=128,w-=128}return v}function S(E){var g=new c;g.update(E);var s=g.digest();return g.clean(),s}t.hash=S})(Zr);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const r=Bt.random,n=Zr,c=Bt.wipe;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function o(b){const d=new Float64Array(16);if(b)for(let l=0;l<b.length;l++)d[l]=b[l];return d}const h=new Uint8Array(32);h[0]=9;const S=o(),E=o([1]),g=o([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),s=o([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=o([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=o([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),v=o([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function w(b,d){for(let l=0;l<16;l++)b[l]=d[l]|0}function x(b){let d=1;for(let l=0;l<16;l++){let e=b[l]+d+65535;d=Math.floor(e/65536),b[l]=e-d*65536}b[0]+=d-1+37*(d-1)}function N(b,d,l){const e=~(l-1);for(let a=0;a<16;a++){const R=e&(b[a]^d[a]);b[a]^=R,d[a]^=R}}function G(b,d){const l=o(),e=o();for(let a=0;a<16;a++)e[a]=d[a];x(e),x(e),x(e);for(let a=0;a<2;a++){l[0]=e[0]-65517;for(let P=1;P<15;P++)l[P]=e[P]-65535-(l[P-1]>>16&1),l[P-1]&=65535;l[15]=e[15]-32767-(l[14]>>16&1);const R=l[15]>>16&1;l[14]&=65535,N(e,l,1-R)}for(let a=0;a<16;a++)b[2*a]=e[a]&255,b[2*a+1]=e[a]>>8}function ut(b,d){let l=0;for(let e=0;e<32;e++)l|=b[e]^d[e];return(1&l-1>>>8)-1}function M(b,d){const l=new Uint8Array(32),e=new Uint8Array(32);return G(l,b),G(e,d),ut(l,e)}function Lt(b){const d=new Uint8Array(32);return G(d,b),d[0]&1}function gt(b,d){for(let l=0;l<16;l++)b[l]=d[2*l]+(d[2*l+1]<<8);b[15]&=32767}function Ct(b,d,l){for(let e=0;e<16;e++)b[e]=d[e]+l[e]}function J(b,d,l){for(let e=0;e<16;e++)b[e]=d[e]-l[e]}function C(b,d,l){let e,a,R=0,P=0,D=0,$=0,B=0,K=0,Rt=0,ht=0,Pt=0,pt=0,dt=0,nt=0,et=0,Y=0,V=0,U=0,it=0,_t=0,F=0,Mt=0,Dt=0,Ht=0,Gt=0,$t=0,Xt=0,Zt=0,se=0,Jt=0,ce=0,we=0,Pe=0,st=l[0],Z=l[1],ot=l[2],at=l[3],ft=l[4],Q=l[5],mt=l[6],xt=l[7],wt=l[8],vt=l[9],Et=l[10],bt=l[11],ct=l[12],W=l[13],St=l[14],It=l[15];e=d[0],R+=e*st,P+=e*Z,D+=e*ot,$+=e*at,B+=e*ft,K+=e*Q,Rt+=e*mt,ht+=e*xt,Pt+=e*wt,pt+=e*vt,dt+=e*Et,nt+=e*bt,et+=e*ct,Y+=e*W,V+=e*St,U+=e*It,e=d[1],P+=e*st,D+=e*Z,$+=e*ot,B+=e*at,K+=e*ft,Rt+=e*Q,ht+=e*mt,Pt+=e*xt,pt+=e*wt,dt+=e*vt,nt+=e*Et,et+=e*bt,Y+=e*ct,V+=e*W,U+=e*St,it+=e*It,e=d[2],D+=e*st,$+=e*Z,B+=e*ot,K+=e*at,Rt+=e*ft,ht+=e*Q,Pt+=e*mt,pt+=e*xt,dt+=e*wt,nt+=e*vt,et+=e*Et,Y+=e*bt,V+=e*ct,U+=e*W,it+=e*St,_t+=e*It,e=d[3],$+=e*st,B+=e*Z,K+=e*ot,Rt+=e*at,ht+=e*ft,Pt+=e*Q,pt+=e*mt,dt+=e*xt,nt+=e*wt,et+=e*vt,Y+=e*Et,V+=e*bt,U+=e*ct,it+=e*W,_t+=e*St,F+=e*It,e=d[4],B+=e*st,K+=e*Z,Rt+=e*ot,ht+=e*at,Pt+=e*ft,pt+=e*Q,dt+=e*mt,nt+=e*xt,et+=e*wt,Y+=e*vt,V+=e*Et,U+=e*bt,it+=e*ct,_t+=e*W,F+=e*St,Mt+=e*It,e=d[5],K+=e*st,Rt+=e*Z,ht+=e*ot,Pt+=e*at,pt+=e*ft,dt+=e*Q,nt+=e*mt,et+=e*xt,Y+=e*wt,V+=e*vt,U+=e*Et,it+=e*bt,_t+=e*ct,F+=e*W,Mt+=e*St,Dt+=e*It,e=d[6],Rt+=e*st,ht+=e*Z,Pt+=e*ot,pt+=e*at,dt+=e*ft,nt+=e*Q,et+=e*mt,Y+=e*xt,V+=e*wt,U+=e*vt,it+=e*Et,_t+=e*bt,F+=e*ct,Mt+=e*W,Dt+=e*St,Ht+=e*It,e=d[7],ht+=e*st,Pt+=e*Z,pt+=e*ot,dt+=e*at,nt+=e*ft,et+=e*Q,Y+=e*mt,V+=e*xt,U+=e*wt,it+=e*vt,_t+=e*Et,F+=e*bt,Mt+=e*ct,Dt+=e*W,Ht+=e*St,Gt+=e*It,e=d[8],Pt+=e*st,pt+=e*Z,dt+=e*ot,nt+=e*at,et+=e*ft,Y+=e*Q,V+=e*mt,U+=e*xt,it+=e*wt,_t+=e*vt,F+=e*Et,Mt+=e*bt,Dt+=e*ct,Ht+=e*W,Gt+=e*St,$t+=e*It,e=d[9],pt+=e*st,dt+=e*Z,nt+=e*ot,et+=e*at,Y+=e*ft,V+=e*Q,U+=e*mt,it+=e*xt,_t+=e*wt,F+=e*vt,Mt+=e*Et,Dt+=e*bt,Ht+=e*ct,Gt+=e*W,$t+=e*St,Xt+=e*It,e=d[10],dt+=e*st,nt+=e*Z,et+=e*ot,Y+=e*at,V+=e*ft,U+=e*Q,it+=e*mt,_t+=e*xt,F+=e*wt,Mt+=e*vt,Dt+=e*Et,Ht+=e*bt,Gt+=e*ct,$t+=e*W,Xt+=e*St,Zt+=e*It,e=d[11],nt+=e*st,et+=e*Z,Y+=e*ot,V+=e*at,U+=e*ft,it+=e*Q,_t+=e*mt,F+=e*xt,Mt+=e*wt,Dt+=e*vt,Ht+=e*Et,Gt+=e*bt,$t+=e*ct,Xt+=e*W,Zt+=e*St,se+=e*It,e=d[12],et+=e*st,Y+=e*Z,V+=e*ot,U+=e*at,it+=e*ft,_t+=e*Q,F+=e*mt,Mt+=e*xt,Dt+=e*wt,Ht+=e*vt,Gt+=e*Et,$t+=e*bt,Xt+=e*ct,Zt+=e*W,se+=e*St,Jt+=e*It,e=d[13],Y+=e*st,V+=e*Z,U+=e*ot,it+=e*at,_t+=e*ft,F+=e*Q,Mt+=e*mt,Dt+=e*xt,Ht+=e*wt,Gt+=e*vt,$t+=e*Et,Xt+=e*bt,Zt+=e*ct,se+=e*W,Jt+=e*St,ce+=e*It,e=d[14],V+=e*st,U+=e*Z,it+=e*ot,_t+=e*at,F+=e*ft,Mt+=e*Q,Dt+=e*mt,Ht+=e*xt,Gt+=e*wt,$t+=e*vt,Xt+=e*Et,Zt+=e*bt,se+=e*ct,Jt+=e*W,ce+=e*St,we+=e*It,e=d[15],U+=e*st,it+=e*Z,_t+=e*ot,F+=e*at,Mt+=e*ft,Dt+=e*Q,Ht+=e*mt,Gt+=e*xt,$t+=e*wt,Xt+=e*vt,Zt+=e*Et,se+=e*bt,Jt+=e*ct,ce+=e*W,we+=e*St,Pe+=e*It,R+=38*it,P+=38*_t,D+=38*F,$+=38*Mt,B+=38*Dt,K+=38*Ht,Rt+=38*Gt,ht+=38*$t,Pt+=38*Xt,pt+=38*Zt,dt+=38*se,nt+=38*Jt,et+=38*ce,Y+=38*we,V+=38*Pe,a=1,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,e=P+a+65535,a=Math.floor(e/65536),P=e-a*65536,e=D+a+65535,a=Math.floor(e/65536),D=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=K+a+65535,a=Math.floor(e/65536),K=e-a*65536,e=Rt+a+65535,a=Math.floor(e/65536),Rt=e-a*65536,e=ht+a+65535,a=Math.floor(e/65536),ht=e-a*65536,e=Pt+a+65535,a=Math.floor(e/65536),Pt=e-a*65536,e=pt+a+65535,a=Math.floor(e/65536),pt=e-a*65536,e=dt+a+65535,a=Math.floor(e/65536),dt=e-a*65536,e=nt+a+65535,a=Math.floor(e/65536),nt=e-a*65536,e=et+a+65535,a=Math.floor(e/65536),et=e-a*65536,e=Y+a+65535,a=Math.floor(e/65536),Y=e-a*65536,e=V+a+65535,a=Math.floor(e/65536),V=e-a*65536,e=U+a+65535,a=Math.floor(e/65536),U=e-a*65536,R+=a-1+37*(a-1),a=1,e=R+a+65535,a=Math.floor(e/65536),R=e-a*65536,e=P+a+65535,a=Math.floor(e/65536),P=e-a*65536,e=D+a+65535,a=Math.floor(e/65536),D=e-a*65536,e=$+a+65535,a=Math.floor(e/65536),$=e-a*65536,e=B+a+65535,a=Math.floor(e/65536),B=e-a*65536,e=K+a+65535,a=Math.floor(e/65536),K=e-a*65536,e=Rt+a+65535,a=Math.floor(e/65536),Rt=e-a*65536,e=ht+a+65535,a=Math.floor(e/65536),ht=e-a*65536,e=Pt+a+65535,a=Math.floor(e/65536),Pt=e-a*65536,e=pt+a+65535,a=Math.floor(e/65536),pt=e-a*65536,e=dt+a+65535,a=Math.floor(e/65536),dt=e-a*65536,e=nt+a+65535,a=Math.floor(e/65536),nt=e-a*65536,e=et+a+65535,a=Math.floor(e/65536),et=e-a*65536,e=Y+a+65535,a=Math.floor(e/65536),Y=e-a*65536,e=V+a+65535,a=Math.floor(e/65536),V=e-a*65536,e=U+a+65535,a=Math.floor(e/65536),U=e-a*65536,R+=a-1+37*(a-1),b[0]=R,b[1]=P,b[2]=D,b[3]=$,b[4]=B,b[5]=K,b[6]=Rt,b[7]=ht,b[8]=Pt,b[9]=pt,b[10]=dt,b[11]=nt,b[12]=et,b[13]=Y,b[14]=V,b[15]=U}function Nt(b,d){C(b,d,d)}function te(b,d){const l=o();let e;for(e=0;e<16;e++)l[e]=d[e];for(e=253;e>=0;e--)Nt(l,l),e!==2&&e!==4&&C(l,l,d);for(e=0;e<16;e++)b[e]=l[e]}function yt(b,d){const l=o();let e;for(e=0;e<16;e++)l[e]=d[e];for(e=250;e>=0;e--)Nt(l,l),e!==1&&C(l,l,d);for(e=0;e<16;e++)b[e]=l[e]}function kt(b,d){const l=o(),e=o(),a=o(),R=o(),P=o(),D=o(),$=o(),B=o(),K=o();J(l,b[1],b[0]),J(K,d[1],d[0]),C(l,l,K),Ct(e,b[0],b[1]),Ct(K,d[0],d[1]),C(e,e,K),C(a,b[3],d[3]),C(a,a,s),C(R,b[2],d[2]),Ct(R,R,R),J(P,e,l),J(D,R,a),Ct($,R,a),Ct(B,e,l),C(b[0],P,D),C(b[1],B,$),C(b[2],$,D),C(b[3],P,B)}function Ut(b,d,l){for(let e=0;e<4;e++)N(b[e],d[e],l)}function qt(b,d){const l=o(),e=o(),a=o();te(a,d[2]),C(l,d[0],a),C(e,d[1],a),G(b,e),b[31]^=Lt(l)<<7}function m(b,d,l){w(b[0],S),w(b[1],E),w(b[2],E),w(b[3],S);for(let e=255;e>=0;--e){const a=l[e/8|0]>>(e&7)&1;Ut(b,d,a),kt(d,b),kt(b,b),Ut(b,d,a)}}function _(b,d){const l=[o(),o(),o(),o()];w(l[0],u),w(l[1],y),w(l[2],E),C(l[3],u,y),m(b,l,d)}function X(b){if(b.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const d=(0,n.hash)(b);d[0]&=248,d[31]&=127,d[31]|=64;const l=new Uint8Array(32),e=[o(),o(),o(),o()];_(e,d),qt(l,e);const a=new Uint8Array(64);return a.set(b),a.set(l,32),{publicKey:l,secretKey:a}}t.generateKeyPairFromSeed=X;function lt(b){const d=(0,r.randomBytes)(32,b),l=X(d);return(0,c.wipe)(d),l}t.generateKeyPair=lt;function A(b){if(b.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(b.subarray(32))}t.extractPublicKeyFromSecretKey=A;const I=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function O(b,d){let l,e,a,R;for(e=63;e>=32;--e){for(l=0,a=e-32,R=e-12;a<R;++a)d[a]+=l-16*d[e]*I[a-(e-32)],l=Math.floor((d[a]+128)/256),d[a]-=l*256;d[a]+=l,d[e]=0}for(l=0,a=0;a<32;a++)d[a]+=l-(d[31]>>4)*I[a],l=d[a]>>8,d[a]&=255;for(a=0;a<32;a++)d[a]-=l*I[a];for(e=0;e<32;e++)d[e+1]+=d[e]>>8,b[e]=d[e]&255}function L(b){const d=new Float64Array(64);for(let l=0;l<64;l++)d[l]=b[l];for(let l=0;l<64;l++)b[l]=0;O(b,d)}function At(b,d){const l=new Float64Array(64),e=[o(),o(),o(),o()],a=(0,n.hash)(b.subarray(0,32));a[0]&=248,a[31]&=127,a[31]|=64;const R=new Uint8Array(64);R.set(a.subarray(32),32);const P=new n.SHA512;P.update(R.subarray(32)),P.update(d);const D=P.digest();P.clean(),L(D),_(e,D),qt(R,e),P.reset(),P.update(R.subarray(0,32)),P.update(b.subarray(32)),P.update(d);const $=P.digest();L($);for(let B=0;B<32;B++)l[B]=D[B];for(let B=0;B<32;B++)for(let K=0;K<32;K++)l[B+K]+=$[B]*a[K];return O(R.subarray(32),l),R}t.sign=At;function rt(b,d){const l=o(),e=o(),a=o(),R=o(),P=o(),D=o(),$=o();return w(b[2],E),gt(b[1],d),Nt(a,b[1]),C(R,a,g),J(a,a,b[2]),Ct(R,b[2],R),Nt(P,R),Nt(D,P),C($,D,P),C(l,$,a),C(l,l,R),yt(l,l),C(l,l,a),C(l,l,R),C(l,l,R),C(b[0],l,R),Nt(e,b[0]),C(e,e,R),M(e,a)&&C(b[0],b[0],v),Nt(e,b[0]),C(e,e,R),M(e,a)?-1:(Lt(b[0])===d[31]>>7&&J(b[0],S,b[0]),C(b[3],b[0],b[1]),0)}function xe(b,d,l){const e=new Uint8Array(32),a=[o(),o(),o(),o()],R=[o(),o(),o(),o()];if(l.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(rt(R,b))return!1;const P=new n.SHA512;P.update(l.subarray(0,32)),P.update(b),P.update(d);const D=P.digest();return L(D),m(a,R,D),_(R,l.subarray(32)),kt(a,R),qt(e,a),!ut(l,e)}t.verify=xe;function z(b){let d=[o(),o(),o(),o()];if(rt(d,b))throw new Error("Ed25519: invalid public key");let l=o(),e=o(),a=d[1];Ct(l,E,a),J(e,E,a),te(e,e),C(l,l,e);let R=new Uint8Array(32);return G(R,l),R}t.convertPublicKeyToX25519=z;function ge(b){const d=(0,n.hash)(b.subarray(0,32));d[0]&=248,d[31]&=127,d[31]|=64;const l=new Uint8Array(d.subarray(0,32));return(0,c.wipe)(d),l}t.convertSecretKeyToX25519=ge})(fr);const hs="EdDSA",ds="JWT",Fe=".",qe="base64url",Qr="utf8",tn="utf8",bs=":",gs="did",ys="key",jr="base58btc",ps="z",_s="K36",ms=32,xs=t=>JSON.stringify(t,(r,n)=>typeof n=="bigint"?n.toString()+"n":n),ws=t=>{const r=/([\[:])?(\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,n=t.replace(r,'$1"$2n"$3');return JSON.parse(n,(c,o)=>typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)};function vs(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return ws(t)}catch{return t}}function Es(t){return typeof t=="string"?t:xs(t)||""}function Cr(t){return vs(Le(de(t,qe),Qr))}function ke(t){return Le(de(Es(t),Qr),qe)}function en(t){const r=de(_s,jr),n=ps+Le(Ur([r,t]),jr);return[gs,ys,n].join(bs)}function Ss(t){return Le(t,qe)}function Is(t){return de(t,qe)}function Os(t){return de([ke(t.header),ke(t.payload)].join(Fe),tn)}function Ts(t){return[ke(t.header),ke(t.payload),Ss(t.signature)].join(Fe)}function Ls(t){const r=t.split(Fe),n=Cr(r[0]),c=Cr(r[1]),o=Is(r[2]),h=de(r.slice(0,2).join(Fe),tn);return{header:n,payload:c,signature:o,data:h}}function As(t=Bt.random.randomBytes(ms)){return fr.generateKeyPairFromSeed(t)}async function Rs(t,r,n,c,o=Bt.cjs.fromMiliseconds(Date.now())){const h={alg:hs,typ:ds},S=en(c.publicKey),E=o+n,g={iss:S,sub:t,aud:r,iat:o,exp:E},s=Os({header:h,payload:g}),u=fr.sign(c.secretKey,s);return Ts({header:h,payload:g,signature:u})}const Ps="PARSE_ERROR",js="INVALID_REQUEST",Cs="METHOD_NOT_FOUND",Ns="INVALID_PARAMS",rn="INTERNAL_ERROR",cr="SERVER_ERROR",Ms=[-32700,-32600,-32601,-32602,-32603],Se={[Ps]:{code:-32700,message:"Parse error"},[js]:{code:-32600,message:"Invalid Request"},[Cs]:{code:-32601,message:"Method not found"},[Ns]:{code:-32602,message:"Invalid params"},[rn]:{code:-32603,message:"Internal error"},[cr]:{code:-32e3,message:"Server error"}},nn=cr;function zs(t){return Ms.includes(t)}function Nr(t){return Object.keys(Se).includes(t)?Se[t]:Se[nn]}function Bs(t){const r=Object.values(Se).find(n=>n.code===t);return r||Se[nn]}function sn(t,r,n){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${n} RPC url at ${r}`):t}var on={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any