@wormhole-foundation/wormhole-connect 0.3.18-beta.2-development → 0.3.18-beta.3-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/assets/{ccip-Cn2GV6zJ.js → ccip-DZSSxbfG.js} +1 -1
  2. package/dist/assets/{evm-DtOGrurb.js → evm-DPbsPo2H.js} +4 -4
  3. package/dist/assets/{index-BMsphhTc.js → index-DQiwN_Ue.js} +2 -2
  4. package/dist/assets/{index-CgYSKnqj.js → index-DeBYURSI.js} +1 -1
  5. package/dist/assets/{index.es-CemSjxmT.js → index.es-YhlgvURC.js} +2 -2
  6. package/dist/main.js +4 -4
  7. package/dist/src/components/TokensModal.d.ts.map +1 -1
  8. package/lib/{algorand-BDEvXX59.js → algorand--fALMVQ6.js} +1 -1
  9. package/lib/{algorand-Zc_bwW4S.mjs → algorand-BscStaE0.mjs} +4 -4
  10. package/lib/{aptos-2xBTg_HB.js → aptos-B3AS31XA.js} +1 -1
  11. package/lib/{aptos-BXil1ow6.mjs → aptos-D3gQDkVy.mjs} +4 -4
  12. package/lib/{aptos-HGzvDQev.mjs → aptos-DblrFWKz.mjs} +1 -1
  13. package/lib/{aptos-DBVV7qfV.js → aptos-uzjcRbKQ.js} +2 -2
  14. package/lib/{browser-DkelnPvs.js → browser-CUR1_-g7.js} +1 -1
  15. package/lib/{browser-D9O31Eeu.mjs → browser-CzNUhOtu.mjs} +2 -2
  16. package/lib/{ccip-C6SEFKkH.js → ccip-5uEJrSao.js} +1 -1
  17. package/lib/{ccip-BbYeuDVL.mjs → ccip-6d6x_AR7.mjs} +1 -1
  18. package/lib/{chain-BNKwvp-5.js → chain-Bq0KV5Nv.js} +1 -1
  19. package/lib/{chain-CdLYfAPM.mjs → chain-WayEKuld.mjs} +1 -1
  20. package/lib/{cosmos-BquWOK1X.mjs → cosmos-CwUr8XHO.mjs} +3 -3
  21. package/lib/{cosmos-Bsg4ShMs.js → cosmos-uP_qWSoq.js} +1 -1
  22. package/lib/{cosmwasm-DYmgsUUs.mjs → cosmwasm-ByfSCJro.mjs} +6 -6
  23. package/lib/{cosmwasm-Bhw3FsD_.js → cosmwasm-nZ1bv1b_.js} +2 -2
  24. package/lib/{create-D0TucuHl.js → create-CvZ650sz.js} +1 -1
  25. package/lib/{create-HDqF-1ZK.mjs → create-DppBfW47.mjs} +1 -1
  26. package/lib/{ens-validation.es6-BCps0Eec.js → ens-validation.es6-CCfWbdrS.js} +1 -1
  27. package/lib/{ens-validation.es6-w8x_dHmb.mjs → ens-validation.es6-CJs8RCzz.mjs} +2 -2
  28. package/lib/{evm-BbX0J1y-.js → evm-B80a5HsG.js} +2 -2
  29. package/lib/{evm-Dr0UlgwP.mjs → evm-BHI64qKH.mjs} +6 -6
  30. package/lib/{evm-BpzK53GX.js → evm-BSRvb7zQ.js} +4 -4
  31. package/lib/{evm-2KelLB7H.mjs → evm-DYiU2-MQ.mjs} +6 -6
  32. package/lib/{index-DaO7I-qg.js → index--J8UGeLt.js} +1 -1
  33. package/lib/{index-BcDN2lKv.mjs → index-00seDHdc.mjs} +5 -5
  34. package/lib/{index-D3MP5ran.js → index-B98kSotj.js} +1 -1
  35. package/lib/{index-zIY9Ty8L.js → index-BCWmM6sh.js} +1 -1
  36. package/lib/{index-Cpoq8bln.mjs → index-BMEA_Z4x.mjs} +27 -29
  37. package/lib/{index-DsDKaGAZ.mjs → index-BO4gCfyo.mjs} +4 -4
  38. package/lib/{index--Ya24MuT.mjs → index-BPttYMSW.mjs} +4 -4
  39. package/lib/{index-DIvMhatg.js → index-BR0KcmSP.js} +1 -1
  40. package/lib/{index-BTzpW2CH.js → index-BRws2oLK.js} +1 -1
  41. package/lib/{index-B-SCKn9E.js → index-BUGVfe_P.js} +1 -1
  42. package/lib/{index-DnCA55BS.mjs → index-BVlhk1Zx.mjs} +5 -5
  43. package/lib/{index-Buf5ViDI.mjs → index-BfaX86DY.mjs} +3 -3
  44. package/lib/{index-NzkgoUpB.js → index-BmHNRhrd.js} +1 -1
  45. package/lib/{index-CZgNyZsy.js → index-Bn43dUZE.js} +1 -1
  46. package/lib/{index-BG6SOggM.mjs → index-Bo_tkV1D.mjs} +4 -4
  47. package/lib/{index-DDZSvfje.js → index-Bs2fWIwl.js} +1 -1
  48. package/lib/{index-X4H_rID0.mjs → index-BxsrjQ0g.mjs} +1 -1
  49. package/lib/{index-LXVztnX2.mjs → index-CGXg743L.mjs} +4 -4
  50. package/lib/{index-e7hjhyhE.js → index-CGpTGfVX.js} +1 -1
  51. package/lib/{index-BRGuBbmG.js → index-CLqv0W4C.js} +1 -1
  52. package/lib/{index-C6xc4p84.mjs → index-CQBMnJe7.mjs} +5 -5
  53. package/lib/{index-Cl-uVarz.mjs → index-CXpmXMhQ.mjs} +4 -4
  54. package/lib/{index-t7bJ4K5j.js → index-CjCHChpV.js} +1 -1
  55. package/lib/{index-Cv97j9VV.mjs → index-Cnyhr_GO.mjs} +4 -4
  56. package/lib/{index-lKHt_xhK.mjs → index-D1i1U0GS.mjs} +2 -2
  57. package/lib/{index-beeGh_NR.js → index-DAxvZmWh.js} +1 -1
  58. package/lib/{index-B5hw5mz3.js → index-DBG3lw8A.js} +1 -1
  59. package/lib/{index-BlByGb6g.js → index-DDYPSDXG.js} +1 -1
  60. package/lib/{index-BszwlEHw.js → index-DGy0PI4x.js} +1 -1
  61. package/lib/{index-axLvotHN.js → index-DL8e8Ka6.js} +1 -1
  62. package/lib/{index-DnBgHoFF.mjs → index-DNGg8WTv.mjs} +2 -2
  63. package/lib/{index-Dpo5JDQ4.mjs → index-DQ2pTa4G.mjs} +4 -4
  64. package/lib/{index-TS5n3zuc.mjs → index-D_T-tAub.mjs} +3 -3
  65. package/lib/{index-CccfGakZ.mjs → index-DgYJEsdX.mjs} +6 -6
  66. package/lib/{index-DTnmfiVy.mjs → index-E1UraJoM.mjs} +4 -4
  67. package/lib/{index-DJs2hxJ9.mjs → index-E1ooefEo.mjs} +2 -2
  68. package/lib/{index-DDgLIB9M.mjs → index-FWQH1rP1.mjs} +4 -4
  69. package/lib/{index-gttJGZ38.js → index-FbJRnzPp.js} +1 -1
  70. package/lib/{index-LA5IFiOg.js → index-OFbST_Zc.js} +1 -1
  71. package/lib/{index-Bk8dO7l7.mjs → index-Pwy5eDgZ.mjs} +3 -3
  72. package/lib/{index-DpAzpz2b.mjs → index-WptHX8MN.mjs} +1 -1
  73. package/lib/{index-TBqhnkaj.js → index-aCGqbPEi.js} +1 -1
  74. package/lib/{index-Cc0jpWQp.js → index-c66y1A6n.js} +1 -1
  75. package/lib/{index-dO02pyGr.mjs → index-eglOHB-b.mjs} +4 -4
  76. package/lib/{index-BYtnAVI1.js → index-haDnu8fh.js} +1 -1
  77. package/lib/{index-B4AF-Mv-.js → index-s2bgjlxF.js} +4 -4
  78. package/lib/{index.es-BuUqRsMC.js → index.es-C8TErlAd.js} +2 -2
  79. package/lib/{index.es-BNrPiOfV.mjs → index.es-CYR-A5sx.mjs} +4 -4
  80. package/lib/index.js +1 -1
  81. package/lib/index.mjs +1 -1
  82. package/lib/{libsodium-wrappers-ByFZy5hK.mjs → libsodium-wrappers-ARgV8dAO.mjs} +1 -1
  83. package/lib/{libsodium-wrappers-DEhSVGdH.js → libsodium-wrappers-DPGrOV2g.js} +1 -1
  84. package/lib/{sei-BjdQujMd.js → sei-Cjl5-5UW.js} +1 -1
  85. package/lib/{sei-D7pceI_5.mjs → sei-J9YwRQlR.mjs} +2 -2
  86. package/lib/{solana-BNgUb2lt.mjs → solana-3b1G6Ldj.mjs} +6 -6
  87. package/lib/{solana-DtLIToHc.mjs → solana-BnUyf5pK.mjs} +3 -3
  88. package/lib/{solana-D4Kn_xyO.js → solana-DFbLZfms.js} +2 -2
  89. package/lib/{solana-BuMaCwGs.js → solana-Dd_Vo-ZU.js} +1 -1
  90. package/lib/{solanaEmbed.esm-Cu68qIpS.mjs → solanaEmbed.esm-BeK6jZyl.mjs} +2 -2
  91. package/lib/{solanaEmbed.esm-BIYw7Z4-.js → solanaEmbed.esm-DWWS4MCV.js} +1 -1
  92. package/lib/src/components/TokensModal.d.ts.map +1 -1
  93. package/lib/{sui-B7wNAAIg.mjs → sui-B14yKSv0.mjs} +1 -1
  94. package/lib/{sui-BemqzeyY.js → sui-BwHn_8Xv.js} +2 -2
  95. package/lib/{sui-NM9S9bWA.js → sui-C9dQK1dR.js} +1 -1
  96. package/lib/{sui-D4a4x3cu.mjs → sui-Ccg74tOQ.mjs} +4 -4
  97. package/lib/{unsignedTransaction-CNIMIRIN.mjs → unsignedTransaction-N51EO9OV.mjs} +2 -2
  98. package/lib/{unsignedTransaction-DIjo7pbX.js → unsignedTransaction-qRahjlzp.js} +1 -1
  99. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { d as pn, g as Ca, C as Na, W as Da, a as Ta, N as kr, b as ja, c as oe, h as va, e as Er, f as za, i as Sa, j as Oa, k as La, B as Pa, l as Ua, m as ke } from "./index-Cpoq8bln.mjs";
2
- import "./index-X4H_rID0.mjs";
1
+ import { d as pn, g as Ca, C as Na, W as Da, a as Ta, N as kr, b as ja, c as oe, h as va, e as Er, f as za, i as Sa, j as Oa, k as La, B as Pa, l as Ua, m as ke } from "./index-BMEA_Z4x.mjs";
2
+ import "./index-BxsrjQ0g.mjs";
3
3
  function m(e, t = {}) {
4
4
  const { fees: n = e.fees, formatters: r = e.formatters, serializers: s = e.serializers } = t;
5
5
  return {
@@ -4242,7 +4242,7 @@ async function Kt(e, t) {
4242
4242
  });
4243
4243
  return be === "0x" ? { data: void 0 } : { data: be };
4244
4244
  } catch (A) {
4245
- const I = gc(A), { offchainLookup: C, offchainLookupSignature: B } = await import("./ccip-BbYeuDVL.mjs");
4245
+ const I = gc(A), { offchainLookup: C, offchainLookupSignature: B } = await import("./ccip-6d6x_AR7.mjs");
4246
4246
  if ((I == null ? void 0 : I.slice(0, 10)) === B && f)
4247
4247
  return { data: await C(e, { data: I, to: f }) };
4248
4248
  throw mc(A, {
@@ -11746,7 +11746,7 @@ var fr = (e, t, n) => {
11746
11746
  if (t.has(e))
11747
11747
  throw TypeError("Cannot add the same private member more than once");
11748
11748
  t instanceof WeakSet ? t.add(e) : t.set(e, n);
11749
- }, Ct = (e, t, n, r) => (fr(e, t, "write to private field"), t.set(e, n), n), ch = (e, t, n) => (fr(e, t, "access private method"), n), lh = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.18-beta.2-development" };
11749
+ }, Ct = (e, t, n, r) => (fr(e, t, "write to private field"), t.set(e, n), n), ch = (e, t, n) => (fr(e, t, "access private method"), n), lh = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.18-beta.3-development" };
11750
11750
  const uh = (e) => (t, n, r) => {
11751
11751
  const s = r.subscribe;
11752
11752
  return r.subscribe = (o, i, c) => {
@@ -12011,7 +12011,7 @@ const dt = (e) => (t) => {
12011
12011
  }, bh = (e, t) => "getStorage" in t || "serialize" in t || "deserialize" in t ? ((lh ? "production" : void 0) !== "production" && console.warn(
12012
12012
  "[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."
12013
12013
  ), hh(e, t)) : mh(e, t), fh = bh;
12014
- var gh = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.18-beta.2-development" };
12014
+ var gh = { BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1, REACT_APP_CONNECT_VERSION: "0.3.18-beta.3-development" };
12015
12015
  const Zr = (e) => {
12016
12016
  let t;
12017
12017
  const n = /* @__PURE__ */ new Set(), r = (u, d) => {
@@ -13418,7 +13418,7 @@ Ln = async function() {
13418
13418
  };
13419
13419
  yr = /* @__PURE__ */ new WeakSet();
13420
13420
  ka = async function() {
13421
- const { EthereumProvider: e } = await import("./index.es-BNrPiOfV.mjs"), t = this.chains.map(({ id: n }) => n);
13421
+ const { EthereumProvider: e } = await import("./index.es-CYR-A5sx.mjs"), t = this.chains.map(({ id: n }) => n);
13422
13422
  if (t.length) {
13423
13423
  const {
13424
13424
  projectId: n,
@@ -1 +1 @@
1
- "use strict";var m=Object.defineProperty;var u=(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)=>(u(i,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-B4AF-Mv-.js"),w=require("./aptos-DBVV7qfV.js"),g=require("./create-D0TucuHl.js"),p=require("./chain-BNKwvp-5.js");class c{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=d.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await w.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new c(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash(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 d.UniversalAddress(BigInt(a.sender).toString(16).padStart(64,"0"));return g.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:d.hex.decode(a.payload)})})}}p.registerProtocol("Aptos","WormholeCore",c);exports.AptosWormholeCore=c;
1
+ "use strict";var m=Object.defineProperty;var u=(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)=>(u(i,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index-s2bgjlxF.js"),w=require("./aptos-uzjcRbKQ.js"),g=require("./create-CvZ650sz.js"),p=require("./chain-Bq0KV5Nv.js");class c{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=d.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await w.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new c(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash(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 d.UniversalAddress(BigInt(a.sender).toString(16).padStart(64,"0"));return g.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:d.hex.decode(a.payload)})})}}p.registerProtocol("Aptos","WormholeCore",c);exports.AptosWormholeCore=c;
@@ -17,11 +17,11 @@ var fn = (r, t, e, n) => ({
17
17
  return h(r, t, n);
18
18
  }
19
19
  }), v = (r, t, e) => (Ce(r, t, "access private method"), e);
20
- import { bM as rt, bW as Lt, bX as De, by as Ve, bb as ce, bY as Bt, at as Be, bZ as Hn, aB as Cr, bp as Me, az as hn, b_ as Br, ax as dn, bN as Fr, b$ as Lr } from "./index-Cpoq8bln.mjs";
21
- import { E as _r, a as $r } from "./index-DsDKaGAZ.mjs";
22
- import "./index-DTnmfiVy.mjs";
23
- import { E as pn, a as gn, b as Fe, c as Dr, _ as Vr } from "./evm-Dr0UlgwP.mjs";
24
- import { r as Mr } from "./chain-CdLYfAPM.mjs";
20
+ import { bM as rt, bW as Lt, bX as De, by as Ve, bb as ce, bY as Bt, at as Be, bZ as Hn, aB as Cr, bp as Me, az as hn, b_ as Br, ax as dn, bN as Fr, b$ as Lr } from "./index-BMEA_Z4x.mjs";
21
+ import { E as _r, a as $r } from "./index-BO4gCfyo.mjs";
22
+ import "./index-E1UraJoM.mjs";
23
+ import { E as pn, a as gn, b as Fe, c as Dr, _ as Vr } from "./evm-BHI64qKH.mjs";
24
+ import { r as Mr } from "./chain-WayEKuld.mjs";
25
25
  const Gr = "6.12.1";
26
26
  function Hr(r, t, e) {
27
27
  const n = t.split("|").map((i) => i.trim());
@@ -1,4 +1,4 @@
1
- "use strict";const Ye=require("./index-B4AF-Mv-.js");var Et={},Me={},x={},bt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(f,c){var d=f>>>16&65535,E=f&65535,y=c>>>16&65535,v=c&65535;return E*v+(d*v+E*y<<16>>>0)|0}e.mul=Math.imul||r;function n(f,c){return f+c|0}e.add=n;function a(f,c){return f-c|0}e.sub=a;function D(f,c){return f<<c|f>>>32-c}e.rotl=D;function l(f,c){return f<<32-c|f>>>c}e.rotr=l;function w(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}e.isInteger=Number.isInteger||w,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(f){return e.isInteger(f)&&f>=-e.MAX_SAFE_INTEGER&&f<=e.MAX_SAFE_INTEGER}})(bt);Object.defineProperty(x,"__esModule",{value:!0});var vt=bt;function It(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}x.readInt16BE=It;function Rt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}x.readUint16BE=Rt;function Pt(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}x.readInt16LE=Pt;function Ht(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}x.readUint16LE=Ht;function wt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}x.writeUint16BE=wt;x.writeInt16BE=wt;function yt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}x.writeUint16LE=yt;x.writeInt16LE=yt;function qe(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}x.readInt32BE=qe;function $e(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}x.readUint32BE=$e;function Ge(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}x.readInt32LE=Ge;function Ve(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}x.readUint32LE=Ve;function Ne(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}x.writeUint32BE=Ne;x.writeInt32BE=Ne;function Te(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}x.writeUint32LE=Te;x.writeInt32LE=Te;function Kt(e,r){r===void 0&&(r=0);var n=qe(e,r),a=qe(e,r+4);return n*4294967296+a-(a>>31)*4294967296}x.readInt64BE=Kt;function zt(e,r){r===void 0&&(r=0);var n=$e(e,r),a=$e(e,r+4);return n*4294967296+a}x.readUint64BE=zt;function Yt(e,r){r===void 0&&(r=0);var n=Ge(e,r),a=Ge(e,r+4);return a*4294967296+n-(n>>31)*4294967296}x.readInt64LE=Yt;function qt(e,r){r===void 0&&(r=0);var n=Ve(e,r),a=Ve(e,r+4);return a*4294967296+n}x.readUint64LE=qt;function gt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Ne(e/4294967296>>>0,r,n),Ne(e>>>0,r,n+4),r}x.writeUint64BE=gt;x.writeInt64BE=gt;function St(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Te(e>>>0,r,n),Te(e/4294967296>>>0,r,n+4),r}x.writeUint64LE=St;x.writeInt64LE=St;function $t(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var a=0,D=1,l=e/8+n-1;l>=n;l--)a+=r[l]*D,D*=256;return a}x.readUintBE=$t;function Gt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var a=0,D=1,l=n;l<n+e/8;l++)a+=r[l]*D,D*=256;return a}x.readUintLE=Gt;function Vt(e,r,n,a){if(n===void 0&&(n=new Uint8Array(e/8)),a===void 0&&(a=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!vt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var D=1,l=e/8+a-1;l>=a;l--)n[l]=r/D&255,D*=256;return n}x.writeUintBE=Vt;function Wt(e,r,n,a){if(n===void 0&&(n=new Uint8Array(e/8)),a===void 0&&(a=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!vt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var D=1,l=a;l<a+e/8;l++)n[l]=r/D&255,D*=256;return n}x.writeUintLE=Wt;function Xt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}x.readFloat32BE=Xt;function Jt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}x.readFloat32LE=Jt;function Qt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}x.readFloat64BE=Qt;function Zt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}x.readFloat64LE=Zt;function kt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat32(n,e),r}x.writeFloat32BE=kt;function er(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat32(n,e,!0),r}x.writeFloat32LE=er;function tr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat64(n,e),r}x.writeFloat64BE=tr;function rr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat64(n,e,!0),r}x.writeFloat64LE=rr;var de={};Object.defineProperty(de,"__esModule",{value:!0});function nr(e){for(var r=0;r<e.length;r++)e[r]=0;return e}de.wipe=nr;Object.defineProperty(Me,"__esModule",{value:!0});var _e=x,We=de,ir=20;function ar(e,r,n){for(var a=1634760805,D=857760878,l=2036477234,w=1797285236,f=n[3]<<24|n[2]<<16|n[1]<<8|n[0],c=n[7]<<24|n[6]<<16|n[5]<<8|n[4],d=n[11]<<24|n[10]<<16|n[9]<<8|n[8],E=n[15]<<24|n[14]<<16|n[13]<<8|n[12],y=n[19]<<24|n[18]<<16|n[17]<<8|n[16],v=n[23]<<24|n[22]<<16|n[21]<<8|n[20],b=n[27]<<24|n[26]<<16|n[25]<<8|n[24],g=n[31]<<24|n[30]<<16|n[29]<<8|n[28],A=r[3]<<24|r[2]<<16|r[1]<<8|r[0],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],o=r[15]<<24|r[14]<<16|r[13]<<8|r[12],_=a,u=D,s=l,h=w,t=f,i=c,S=d,C=E,F=y,L=v,j=b,B=g,T=A,M=p,m=O,N=o,G=0;G<ir;G+=2)_=_+t|0,T^=_,T=T>>>16|T<<16,F=F+T|0,t^=F,t=t>>>20|t<<12,u=u+i|0,M^=u,M=M>>>16|M<<16,L=L+M|0,i^=L,i=i>>>20|i<<12,s=s+S|0,m^=s,m=m>>>16|m<<16,j=j+m|0,S^=j,S=S>>>20|S<<12,h=h+C|0,N^=h,N=N>>>16|N<<16,B=B+N|0,C^=B,C=C>>>20|C<<12,s=s+S|0,m^=s,m=m>>>24|m<<8,j=j+m|0,S^=j,S=S>>>25|S<<7,h=h+C|0,N^=h,N=N>>>24|N<<8,B=B+N|0,C^=B,C=C>>>25|C<<7,u=u+i|0,M^=u,M=M>>>24|M<<8,L=L+M|0,i^=L,i=i>>>25|i<<7,_=_+t|0,T^=_,T=T>>>24|T<<8,F=F+T|0,t^=F,t=t>>>25|t<<7,_=_+i|0,N^=_,N=N>>>16|N<<16,j=j+N|0,i^=j,i=i>>>20|i<<12,u=u+S|0,T^=u,T=T>>>16|T<<16,B=B+T|0,S^=B,S=S>>>20|S<<12,s=s+C|0,M^=s,M=M>>>16|M<<16,F=F+M|0,C^=F,C=C>>>20|C<<12,h=h+t|0,m^=h,m=m>>>16|m<<16,L=L+m|0,t^=L,t=t>>>20|t<<12,s=s+C|0,M^=s,M=M>>>24|M<<8,F=F+M|0,C^=F,C=C>>>25|C<<7,h=h+t|0,m^=h,m=m>>>24|m<<8,L=L+m|0,t^=L,t=t>>>25|t<<7,u=u+S|0,T^=u,T=T>>>24|T<<8,B=B+T|0,S^=B,S=S>>>25|S<<7,_=_+i|0,N^=_,N=N>>>24|N<<8,j=j+N|0,i^=j,i=i>>>25|i<<7;_e.writeUint32LE(_+a|0,e,0),_e.writeUint32LE(u+D|0,e,4),_e.writeUint32LE(s+l|0,e,8),_e.writeUint32LE(h+w|0,e,12),_e.writeUint32LE(t+f|0,e,16),_e.writeUint32LE(i+c|0,e,20),_e.writeUint32LE(S+d|0,e,24),_e.writeUint32LE(C+E|0,e,28),_e.writeUint32LE(F+y|0,e,32),_e.writeUint32LE(L+v|0,e,36),_e.writeUint32LE(j+b|0,e,40),_e.writeUint32LE(B+g|0,e,44),_e.writeUint32LE(T+A|0,e,48),_e.writeUint32LE(M+p|0,e,52),_e.writeUint32LE(m+O|0,e,56),_e.writeUint32LE(N+o|0,e,60)}function mt(e,r,n,a,D){if(D===void 0&&(D=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(a.length<n.length)throw new Error("ChaCha: destination is shorter than source");var l,w;if(D===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");l=new Uint8Array(16),w=l.length-r.length,l.set(r,w)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");l=r,w=D}for(var f=new Uint8Array(64),c=0;c<n.length;c+=64){ar(f,l,e);for(var d=c;d<c+64&&d<n.length;d++)a[d]=n[d]^f[d-c];fr(l,0,w)}return We.wipe(f),D===0&&We.wipe(l),a}Me.streamXOR=mt;function ur(e,r,n,a){return a===void 0&&(a=0),We.wipe(n),mt(e,r,n,n,a)}Me.stream=ur;function fr(e,r,n){for(var a=1;n--;)a=a+(e[r]&255)|0,e[r]=a&255,a>>>=8,r++;if(a>0)throw new Error("ChaCha: counter overflow")}var Ct={},be={};Object.defineProperty(be,"__esModule",{value:!0});function hr(e,r,n){return~(e-1)&r|e-1&n}be.select=hr;function sr(e,r){return(e|0)-(r|0)-1>>>31&1}be.lessOrEqual=sr;function pt(e,r){if(e.length!==r.length)return 0;for(var n=0,a=0;a<e.length;a++)n|=e[a]^r[a];return 1&n-1>>>8}be.compare=pt;function or(e,r){return e.length===0||r.length===0?!1:pt(e,r)!==0}be.equal=or;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=be,n=de;e.DIGEST_LENGTH=16;var a=function(){function w(f){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=f[0]|f[1]<<8;this._r[0]=c&8191;var d=f[2]|f[3]<<8;this._r[1]=(c>>>13|d<<3)&8191;var E=f[4]|f[5]<<8;this._r[2]=(d>>>10|E<<6)&7939;var y=f[6]|f[7]<<8;this._r[3]=(E>>>7|y<<9)&8191;var v=f[8]|f[9]<<8;this._r[4]=(y>>>4|v<<12)&255,this._r[5]=v>>>1&8190;var b=f[10]|f[11]<<8;this._r[6]=(v>>>14|b<<2)&8191;var g=f[12]|f[13]<<8;this._r[7]=(b>>>11|g<<5)&8065;var A=f[14]|f[15]<<8;this._r[8]=(g>>>8|A<<8)&8191,this._r[9]=A>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return w.prototype._blocks=function(f,c,d){for(var E=this._fin?0:2048,y=this._h[0],v=this._h[1],b=this._h[2],g=this._h[3],A=this._h[4],p=this._h[5],O=this._h[6],o=this._h[7],_=this._h[8],u=this._h[9],s=this._r[0],h=this._r[1],t=this._r[2],i=this._r[3],S=this._r[4],C=this._r[5],F=this._r[6],L=this._r[7],j=this._r[8],B=this._r[9];d>=16;){var T=f[c+0]|f[c+1]<<8;y+=T&8191;var M=f[c+2]|f[c+3]<<8;v+=(T>>>13|M<<3)&8191;var m=f[c+4]|f[c+5]<<8;b+=(M>>>10|m<<6)&8191;var N=f[c+6]|f[c+7]<<8;g+=(m>>>7|N<<9)&8191;var G=f[c+8]|f[c+9]<<8;A+=(N>>>4|G<<12)&8191,p+=G>>>1&8191;var J=f[c+10]|f[c+11]<<8;O+=(G>>>14|J<<2)&8191;var X=f[c+12]|f[c+13]<<8;o+=(J>>>11|X<<5)&8191;var W=f[c+14]|f[c+15]<<8;_+=(X>>>8|W<<8)&8191,u+=W>>>5|E;var U=0,I=U;I+=y*s,I+=v*(5*B),I+=b*(5*j),I+=g*(5*L),I+=A*(5*F),U=I>>>13,I&=8191,I+=p*(5*C),I+=O*(5*S),I+=o*(5*i),I+=_*(5*t),I+=u*(5*h),U+=I>>>13,I&=8191;var R=U;R+=y*h,R+=v*s,R+=b*(5*B),R+=g*(5*j),R+=A*(5*L),U=R>>>13,R&=8191,R+=p*(5*F),R+=O*(5*C),R+=o*(5*S),R+=_*(5*i),R+=u*(5*t),U+=R>>>13,R&=8191;var P=U;P+=y*t,P+=v*h,P+=b*s,P+=g*(5*B),P+=A*(5*j),U=P>>>13,P&=8191,P+=p*(5*L),P+=O*(5*F),P+=o*(5*C),P+=_*(5*S),P+=u*(5*i),U+=P>>>13,P&=8191;var H=U;H+=y*i,H+=v*t,H+=b*h,H+=g*s,H+=A*(5*B),U=H>>>13,H&=8191,H+=p*(5*j),H+=O*(5*L),H+=o*(5*F),H+=_*(5*C),H+=u*(5*S),U+=H>>>13,H&=8191;var K=U;K+=y*S,K+=v*i,K+=b*t,K+=g*h,K+=A*s,U=K>>>13,K&=8191,K+=p*(5*B),K+=O*(5*j),K+=o*(5*L),K+=_*(5*F),K+=u*(5*C),U+=K>>>13,K&=8191;var z=U;z+=y*C,z+=v*S,z+=b*i,z+=g*t,z+=A*h,U=z>>>13,z&=8191,z+=p*s,z+=O*(5*B),z+=o*(5*j),z+=_*(5*L),z+=u*(5*F),U+=z>>>13,z&=8191;var Y=U;Y+=y*F,Y+=v*C,Y+=b*S,Y+=g*i,Y+=A*t,U=Y>>>13,Y&=8191,Y+=p*h,Y+=O*s,Y+=o*(5*B),Y+=_*(5*j),Y+=u*(5*L),U+=Y>>>13,Y&=8191;var q=U;q+=y*L,q+=v*F,q+=b*C,q+=g*S,q+=A*i,U=q>>>13,q&=8191,q+=p*t,q+=O*h,q+=o*s,q+=_*(5*B),q+=u*(5*j),U+=q>>>13,q&=8191;var $=U;$+=y*j,$+=v*L,$+=b*F,$+=g*C,$+=A*S,U=$>>>13,$&=8191,$+=p*i,$+=O*t,$+=o*h,$+=_*s,$+=u*(5*B),U+=$>>>13,$&=8191;var V=U;V+=y*B,V+=v*j,V+=b*L,V+=g*F,V+=A*C,U=V>>>13,V&=8191,V+=p*S,V+=O*i,V+=o*t,V+=_*h,V+=u*s,U+=V>>>13,V&=8191,U=(U<<2)+U|0,U=U+I|0,I=U&8191,U=U>>>13,R+=U,y=I,v=R,b=P,g=H,A=K,p=z,O=Y,o=q,_=$,u=V,c+=16,d-=16}this._h[0]=y,this._h[1]=v,this._h[2]=b,this._h[3]=g,this._h[4]=A,this._h[5]=p,this._h[6]=O,this._h[7]=o,this._h[8]=_,this._h[9]=u},w.prototype.finish=function(f,c){c===void 0&&(c=0);var d=new Uint16Array(10),E,y,v,b;if(this._leftover){for(b=this._leftover,this._buffer[b++]=1;b<16;b++)this._buffer[b]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(E=this._h[1]>>>13,this._h[1]&=8191,b=2;b<10;b++)this._h[b]+=E,E=this._h[b]>>>13,this._h[b]&=8191;for(this._h[0]+=E*5,E=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=E,E=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=E,d[0]=this._h[0]+5,E=d[0]>>>13,d[0]&=8191,b=1;b<10;b++)d[b]=this._h[b]+E,E=d[b]>>>13,d[b]&=8191;for(d[9]-=8192,y=(E^1)-1,b=0;b<10;b++)d[b]&=y;for(y=~y,b=0;b<10;b++)this._h[b]=this._h[b]&y|d[b];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,v=this._h[0]+this._pad[0],this._h[0]=v&65535,b=1;b<8;b++)v=(this._h[b]+this._pad[b]|0)+(v>>>16)|0,this._h[b]=v&65535;return f[c+0]=this._h[0]>>>0,f[c+1]=this._h[0]>>>8,f[c+2]=this._h[1]>>>0,f[c+3]=this._h[1]>>>8,f[c+4]=this._h[2]>>>0,f[c+5]=this._h[2]>>>8,f[c+6]=this._h[3]>>>0,f[c+7]=this._h[3]>>>8,f[c+8]=this._h[4]>>>0,f[c+9]=this._h[4]>>>8,f[c+10]=this._h[5]>>>0,f[c+11]=this._h[5]>>>8,f[c+12]=this._h[6]>>>0,f[c+13]=this._h[6]>>>8,f[c+14]=this._h[7]>>>0,f[c+15]=this._h[7]>>>8,this._finished=!0,this},w.prototype.update=function(f){var c=0,d=f.length,E;if(this._leftover){E=16-this._leftover,E>d&&(E=d);for(var y=0;y<E;y++)this._buffer[this._leftover+y]=f[c+y];if(d-=E,c+=E,this._leftover+=E,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(E=d-d%16,this._blocks(f,c,E),c+=E,d-=E),d){for(var y=0;y<d;y++)this._buffer[this._leftover+y]=f[c+y];this._leftover+=d}return this},w.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var f=new Uint8Array(16);return this.finish(f),f},w.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},w}();e.Poly1305=a;function D(w,f){var c=new a(w);c.update(f);var d=c.digest();return c.clean(),d}e.oneTimeAuth=D;function l(w,f){return w.length!==e.DIGEST_LENGTH||f.length!==e.DIGEST_LENGTH?!1:r.equal(w,f)}e.equal=l})(Ct);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=Me,n=Ct,a=de,D=x,l=be;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var w=new Uint8Array(16),f=function(){function c(d){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,d.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return c.prototype.seal=function(d,E,y,v){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var b=new Uint8Array(16);b.set(d,b.length-d.length);var g=new Uint8Array(32);r.stream(this._key,b,g,4);var A=E.length+this.tagLength,p;if(v){if(v.length!==A)throw new Error("ChaCha20Poly1305: incorrect destination length");p=v}else p=new Uint8Array(A);return r.streamXOR(this._key,b,E,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),g,p.subarray(0,p.length-this.tagLength),y),a.wipe(b),p},c.prototype.open=function(d,E,y,v){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(E.length<this.tagLength)return null;var b=new Uint8Array(16);b.set(d,b.length-d.length);var g=new Uint8Array(32);r.stream(this._key,b,g,4);var A=new Uint8Array(this.tagLength);if(this._authenticate(A,g,E.subarray(0,E.length-this.tagLength),y),!l.equal(A,E.subarray(E.length-this.tagLength,E.length)))return null;var p=E.length-this.tagLength,O;if(v){if(v.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");O=v}else O=new Uint8Array(p);return r.streamXOR(this._key,b,E.subarray(0,E.length-this.tagLength),O,4),a.wipe(b),O},c.prototype.clean=function(){return a.wipe(this._key),this},c.prototype._authenticate=function(d,E,y,v){var b=new n.Poly1305(E);v&&(b.update(v),v.length%16>0&&b.update(w.subarray(v.length%16))),b.update(y),y.length%16>0&&b.update(w.subarray(y.length%16));var g=new Uint8Array(8);v&&D.writeUint64LE(v.length,g),b.update(g),D.writeUint64LE(y.length,g),b.update(g);for(var A=b.digest(),p=0;p<A.length;p++)d[p]=A[p];b.clean(),a.wipe(A),a.wipe(g)},c}();e.ChaCha20Poly1305=f})(Et);var At={},Ue={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});function cr(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}ke.isSerializableHash=cr;Object.defineProperty(Ue,"__esModule",{value:!0});var Ee=ke,lr=be,Dr=de,Ut=function(){function e(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var a=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(a).clean():a.set(n);for(var D=0;D<a.length;D++)a[D]^=54;this._inner.update(a);for(var D=0;D<a.length;D++)a[D]^=106;this._outer.update(a),Ee.isSerializableHash(this._inner)&&Ee.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Dr.wipe(a)}return e.prototype.reset=function(){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){Ee.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ee.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(r){return this._inner.update(r),this},e.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},e.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},e.prototype.saveState=function(){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(r){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(r){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},e}();Ue.HMAC=Ut;function _r(e,r,n){var a=new Ut(e,r);a.update(n);var D=a.digest();return a.clean(),D}Ue.hmac=_r;Ue.equal=lr.equal;Object.defineProperty(At,"__esModule",{value:!0});var rt=Ue,nt=de,dr=function(){function e(r,n,a,D){a===void 0&&(a=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=D;var l=rt.hmac(this._hash,a,n);this._hmac=new rt.HMAC(r,l),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(r){for(var n=new Uint8Array(r),a=0;a<n.length;a++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[a]=this._buffer[this._bufpos++];return n},e.prototype.clean=function(){this._hmac.clean(),nt.wipe(this._buffer),nt.wipe(this._counter),this._bufpos=0},e}(),Er=At.HKDF=dr,et={},xe={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.BrowserRandomSource=void 0;const it=65536;class br{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let a=0;a<n.length;a+=it)this._crypto.getRandomValues(n.subarray(a,a+Math.min(n.length-a,it)));return n}}Le.BrowserRandomSource=br;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.NodeRandomSource=void 0;const vr=de;class wr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Ye.commonjsRequire<"u"){const r=Ye.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const a=new Uint8Array(r);for(let D=0;D<a.length;D++)a[D]=n[D];return(0,vr.wipe)(n),a}}Be.NodeRandomSource=wr;Object.defineProperty(xe,"__esModule",{value:!0});xe.SystemRandomSource=void 0;const yr=Le,gr=Be;class Sr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new yr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new gr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}xe.SystemRandomSource=Sr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=xe,n=x,a=de;e.defaultRandomSource=new r.SystemRandomSource;function D(d,E=e.defaultRandomSource){return E.randomBytes(d)}e.randomBytes=D;function l(d=e.defaultRandomSource){const E=D(4,d),y=(0,n.readUint32LE)(E);return(0,a.wipe)(E),y}e.randomUint32=l;const w="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(d,E=w,y=e.defaultRandomSource){if(E.length<2)throw new Error("randomString charset is too short");if(E.length>256)throw new Error("randomString charset is too long");let v="";const b=E.length,g=256-256%b;for(;d>0;){const A=D(Math.ceil(d*256/g),y);for(let p=0;p<A.length&&d>0;p++){const O=A[p];O<g&&(v+=E.charAt(O%b),d--)}(0,a.wipe)(A)}return v}e.randomString=f;function c(d,E=w,y=e.defaultRandomSource){const v=Math.ceil(d/(Math.log(E.length)/Math.LN2));return f(v,E,y)}e.randomStringForEntropy=c})(et);var Ot={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=x,n=de;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var a=function(){function f(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},f.prototype.update=function(c,d){if(d===void 0&&(d=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var E=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=c[E++],d--;this._bufferLength===this.blockSize&&(l(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(E=l(this._temp,this._state,c,E,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=c[E++],d--;return this},f.prototype.finish=function(c){if(!this._finished){var d=this._bytesHashed,E=this._bufferLength,y=d/536870912|0,v=d<<3,b=d%64<56?64:128;this._buffer[E]=128;for(var g=E+1;g<b-8;g++)this._buffer[g]=0;r.writeUint32BE(y,this._buffer,b-8),r.writeUint32BE(v,this._buffer,b-4),l(this._temp,this._state,this._buffer,0,b),this._finished=!0}for(var g=0;g<this.digestLength/4;g++)r.writeUint32BE(this._state[g],c,g*4);return this},f.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},f.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(c){n.wipe(c.state),c.buffer&&n.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},f}();e.SHA256=a;var D=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function l(f,c,d,E,y){for(;y>=64;){for(var v=c[0],b=c[1],g=c[2],A=c[3],p=c[4],O=c[5],o=c[6],_=c[7],u=0;u<16;u++){var s=E+u*4;f[u]=r.readUint32BE(d,s)}for(var u=16;u<64;u++){var h=f[u-2],t=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=f[u-15];var i=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;f[u]=(t+f[u-7]|0)+(i+f[u-16]|0)}for(var u=0;u<64;u++){var t=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&O^~p&o)|0)+(_+(D[u]+f[u]|0)|0)|0,i=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&b^v&g^b&g)|0;_=o,o=O,O=p,p=A+t|0,A=g,g=b,b=v,v=t+i|0}c[0]+=v,c[1]+=b,c[2]+=g,c[3]+=A,c[4]+=p,c[5]+=O,c[6]+=o,c[7]+=_,E+=64,y-=64}return E}function w(f){var c=new a;c.update(f);var d=c.digest();return c.clean(),d}e.hash=w})(Ot);var Ft={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const r=et,n=de;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function a(u){const s=new Float64Array(16);if(u)for(let h=0;h<u.length;h++)s[h]=u[h];return s}const D=new Uint8Array(32);D[0]=9;const l=a([56129,1]);function w(u){let s=1;for(let h=0;h<16;h++){let t=u[h]+s+65535;s=Math.floor(t/65536),u[h]=t-s*65536}u[0]+=s-1+37*(s-1)}function f(u,s,h){const t=~(h-1);for(let i=0;i<16;i++){const S=t&(u[i]^s[i]);u[i]^=S,s[i]^=S}}function c(u,s){const h=a(),t=a();for(let i=0;i<16;i++)t[i]=s[i];w(t),w(t),w(t);for(let i=0;i<2;i++){h[0]=t[0]-65517;for(let C=1;C<15;C++)h[C]=t[C]-65535-(h[C-1]>>16&1),h[C-1]&=65535;h[15]=t[15]-32767-(h[14]>>16&1);const S=h[15]>>16&1;h[14]&=65535,f(t,h,1-S)}for(let i=0;i<16;i++)u[2*i]=t[i]&255,u[2*i+1]=t[i]>>8}function d(u,s){for(let h=0;h<16;h++)u[h]=s[2*h]+(s[2*h+1]<<8);u[15]&=32767}function E(u,s,h){for(let t=0;t<16;t++)u[t]=s[t]+h[t]}function y(u,s,h){for(let t=0;t<16;t++)u[t]=s[t]-h[t]}function v(u,s,h){let t,i,S=0,C=0,F=0,L=0,j=0,B=0,T=0,M=0,m=0,N=0,G=0,J=0,X=0,W=0,U=0,I=0,R=0,P=0,H=0,K=0,z=0,Y=0,q=0,$=0,V=0,ve=0,ge=0,me=0,Fe=0,Re=0,tt=0,Z=h[0],k=h[1],ee=h[2],te=h[3],re=h[4],ne=h[5],ie=h[6],ae=h[7],ue=h[8],fe=h[9],he=h[10],se=h[11],oe=h[12],ce=h[13],le=h[14],De=h[15];t=s[0],S+=t*Z,C+=t*k,F+=t*ee,L+=t*te,j+=t*re,B+=t*ne,T+=t*ie,M+=t*ae,m+=t*ue,N+=t*fe,G+=t*he,J+=t*se,X+=t*oe,W+=t*ce,U+=t*le,I+=t*De,t=s[1],C+=t*Z,F+=t*k,L+=t*ee,j+=t*te,B+=t*re,T+=t*ne,M+=t*ie,m+=t*ae,N+=t*ue,G+=t*fe,J+=t*he,X+=t*se,W+=t*oe,U+=t*ce,I+=t*le,R+=t*De,t=s[2],F+=t*Z,L+=t*k,j+=t*ee,B+=t*te,T+=t*re,M+=t*ne,m+=t*ie,N+=t*ae,G+=t*ue,J+=t*fe,X+=t*he,W+=t*se,U+=t*oe,I+=t*ce,R+=t*le,P+=t*De,t=s[3],L+=t*Z,j+=t*k,B+=t*ee,T+=t*te,M+=t*re,m+=t*ne,N+=t*ie,G+=t*ae,J+=t*ue,X+=t*fe,W+=t*he,U+=t*se,I+=t*oe,R+=t*ce,P+=t*le,H+=t*De,t=s[4],j+=t*Z,B+=t*k,T+=t*ee,M+=t*te,m+=t*re,N+=t*ne,G+=t*ie,J+=t*ae,X+=t*ue,W+=t*fe,U+=t*he,I+=t*se,R+=t*oe,P+=t*ce,H+=t*le,K+=t*De,t=s[5],B+=t*Z,T+=t*k,M+=t*ee,m+=t*te,N+=t*re,G+=t*ne,J+=t*ie,X+=t*ae,W+=t*ue,U+=t*fe,I+=t*he,R+=t*se,P+=t*oe,H+=t*ce,K+=t*le,z+=t*De,t=s[6],T+=t*Z,M+=t*k,m+=t*ee,N+=t*te,G+=t*re,J+=t*ne,X+=t*ie,W+=t*ae,U+=t*ue,I+=t*fe,R+=t*he,P+=t*se,H+=t*oe,K+=t*ce,z+=t*le,Y+=t*De,t=s[7],M+=t*Z,m+=t*k,N+=t*ee,G+=t*te,J+=t*re,X+=t*ne,W+=t*ie,U+=t*ae,I+=t*ue,R+=t*fe,P+=t*he,H+=t*se,K+=t*oe,z+=t*ce,Y+=t*le,q+=t*De,t=s[8],m+=t*Z,N+=t*k,G+=t*ee,J+=t*te,X+=t*re,W+=t*ne,U+=t*ie,I+=t*ae,R+=t*ue,P+=t*fe,H+=t*he,K+=t*se,z+=t*oe,Y+=t*ce,q+=t*le,$+=t*De,t=s[9],N+=t*Z,G+=t*k,J+=t*ee,X+=t*te,W+=t*re,U+=t*ne,I+=t*ie,R+=t*ae,P+=t*ue,H+=t*fe,K+=t*he,z+=t*se,Y+=t*oe,q+=t*ce,$+=t*le,V+=t*De,t=s[10],G+=t*Z,J+=t*k,X+=t*ee,W+=t*te,U+=t*re,I+=t*ne,R+=t*ie,P+=t*ae,H+=t*ue,K+=t*fe,z+=t*he,Y+=t*se,q+=t*oe,$+=t*ce,V+=t*le,ve+=t*De,t=s[11],J+=t*Z,X+=t*k,W+=t*ee,U+=t*te,I+=t*re,R+=t*ne,P+=t*ie,H+=t*ae,K+=t*ue,z+=t*fe,Y+=t*he,q+=t*se,$+=t*oe,V+=t*ce,ve+=t*le,ge+=t*De,t=s[12],X+=t*Z,W+=t*k,U+=t*ee,I+=t*te,R+=t*re,P+=t*ne,H+=t*ie,K+=t*ae,z+=t*ue,Y+=t*fe,q+=t*he,$+=t*se,V+=t*oe,ve+=t*ce,ge+=t*le,me+=t*De,t=s[13],W+=t*Z,U+=t*k,I+=t*ee,R+=t*te,P+=t*re,H+=t*ne,K+=t*ie,z+=t*ae,Y+=t*ue,q+=t*fe,$+=t*he,V+=t*se,ve+=t*oe,ge+=t*ce,me+=t*le,Fe+=t*De,t=s[14],U+=t*Z,I+=t*k,R+=t*ee,P+=t*te,H+=t*re,K+=t*ne,z+=t*ie,Y+=t*ae,q+=t*ue,$+=t*fe,V+=t*he,ve+=t*se,ge+=t*oe,me+=t*ce,Fe+=t*le,Re+=t*De,t=s[15],I+=t*Z,R+=t*k,P+=t*ee,H+=t*te,K+=t*re,z+=t*ne,Y+=t*ie,q+=t*ae,$+=t*ue,V+=t*fe,ve+=t*he,ge+=t*se,me+=t*oe,Fe+=t*ce,Re+=t*le,tt+=t*De,S+=38*R,C+=38*P,F+=38*H,L+=38*K,j+=38*z,B+=38*Y,T+=38*q,M+=38*$,m+=38*V,N+=38*ve,G+=38*ge,J+=38*me,X+=38*Fe,W+=38*Re,U+=38*tt,i=1,t=S+i+65535,i=Math.floor(t/65536),S=t-i*65536,t=C+i+65535,i=Math.floor(t/65536),C=t-i*65536,t=F+i+65535,i=Math.floor(t/65536),F=t-i*65536,t=L+i+65535,i=Math.floor(t/65536),L=t-i*65536,t=j+i+65535,i=Math.floor(t/65536),j=t-i*65536,t=B+i+65535,i=Math.floor(t/65536),B=t-i*65536,t=T+i+65535,i=Math.floor(t/65536),T=t-i*65536,t=M+i+65535,i=Math.floor(t/65536),M=t-i*65536,t=m+i+65535,i=Math.floor(t/65536),m=t-i*65536,t=N+i+65535,i=Math.floor(t/65536),N=t-i*65536,t=G+i+65535,i=Math.floor(t/65536),G=t-i*65536,t=J+i+65535,i=Math.floor(t/65536),J=t-i*65536,t=X+i+65535,i=Math.floor(t/65536),X=t-i*65536,t=W+i+65535,i=Math.floor(t/65536),W=t-i*65536,t=U+i+65535,i=Math.floor(t/65536),U=t-i*65536,t=I+i+65535,i=Math.floor(t/65536),I=t-i*65536,S+=i-1+37*(i-1),i=1,t=S+i+65535,i=Math.floor(t/65536),S=t-i*65536,t=C+i+65535,i=Math.floor(t/65536),C=t-i*65536,t=F+i+65535,i=Math.floor(t/65536),F=t-i*65536,t=L+i+65535,i=Math.floor(t/65536),L=t-i*65536,t=j+i+65535,i=Math.floor(t/65536),j=t-i*65536,t=B+i+65535,i=Math.floor(t/65536),B=t-i*65536,t=T+i+65535,i=Math.floor(t/65536),T=t-i*65536,t=M+i+65535,i=Math.floor(t/65536),M=t-i*65536,t=m+i+65535,i=Math.floor(t/65536),m=t-i*65536,t=N+i+65535,i=Math.floor(t/65536),N=t-i*65536,t=G+i+65535,i=Math.floor(t/65536),G=t-i*65536,t=J+i+65535,i=Math.floor(t/65536),J=t-i*65536,t=X+i+65535,i=Math.floor(t/65536),X=t-i*65536,t=W+i+65535,i=Math.floor(t/65536),W=t-i*65536,t=U+i+65535,i=Math.floor(t/65536),U=t-i*65536,t=I+i+65535,i=Math.floor(t/65536),I=t-i*65536,S+=i-1+37*(i-1),u[0]=S,u[1]=C,u[2]=F,u[3]=L,u[4]=j,u[5]=B,u[6]=T,u[7]=M,u[8]=m,u[9]=N,u[10]=G,u[11]=J,u[12]=X,u[13]=W,u[14]=U,u[15]=I}function b(u,s){v(u,s,s)}function g(u,s){const h=a();for(let t=0;t<16;t++)h[t]=s[t];for(let t=253;t>=0;t--)b(h,h),t!==2&&t!==4&&v(h,h,s);for(let t=0;t<16;t++)u[t]=h[t]}function A(u,s){const h=new Uint8Array(32),t=new Float64Array(80),i=a(),S=a(),C=a(),F=a(),L=a(),j=a();for(let m=0;m<31;m++)h[m]=u[m];h[31]=u[31]&127|64,h[0]&=248,d(t,s);for(let m=0;m<16;m++)S[m]=t[m];i[0]=F[0]=1;for(let m=254;m>=0;--m){const N=h[m>>>3]>>>(m&7)&1;f(i,S,N),f(C,F,N),E(L,i,C),y(i,i,C),E(C,S,F),y(S,S,F),b(F,L),b(j,i),v(i,C,i),v(C,S,L),E(L,i,C),y(i,i,C),b(S,i),y(C,F,j),v(i,C,l),E(i,i,F),v(C,C,i),v(i,F,j),v(F,S,t),b(S,L),f(i,S,N),f(C,F,N)}for(let m=0;m<16;m++)t[m+16]=i[m],t[m+32]=C[m],t[m+48]=S[m],t[m+64]=F[m];const B=t.subarray(32),T=t.subarray(16);g(B,B),v(T,T,B);const M=new Uint8Array(32);return c(M,T),M}e.scalarMult=A;function p(u){return A(u,D)}e.scalarMultBase=p;function O(u){if(u.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const s=new Uint8Array(u);return{publicKey:p(s),secretKey:s}}e.generateKeyPairFromSeed=O;function o(u){const s=(0,r.randomBytes)(32,u),h=O(s);return(0,n.wipe)(s),h}e.generateKeyPair=o;function _(u,s,h=!1){if(u.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(s.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const t=A(u,s);if(h){let i=0;for(let S=0;S<t.length;S++)i|=t[S];if(i===0)throw new Error("X25519: invalid shared key")}return t}e.sharedKey=_})(Ft);function mr(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),a=0;a<n.length;a++)n[a]=255;for(var D=0;D<e.length;D++){var l=e.charAt(D),w=l.charCodeAt(0);if(n[w]!==255)throw new TypeError(l+" is ambiguous");n[w]=D}var f=e.length,c=e.charAt(0),d=Math.log(f)/Math.log(256),E=Math.log(256)/Math.log(f);function y(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var A=0,p=0,O=0,o=g.length;O!==o&&g[O]===0;)O++,A++;for(var _=(o-O)*E+1>>>0,u=new Uint8Array(_);O!==o;){for(var s=g[O],h=0,t=_-1;(s!==0||h<p)&&t!==-1;t--,h++)s+=256*u[t]>>>0,u[t]=s%f>>>0,s=s/f>>>0;if(s!==0)throw new Error("Non-zero carry");p=h,O++}for(var i=_-p;i!==_&&u[i]===0;)i++;for(var S=c.repeat(A);i<_;++i)S+=e.charAt(u[i]);return S}function v(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var A=0;if(g[A]!==" "){for(var p=0,O=0;g[A]===c;)p++,A++;for(var o=(g.length-A)*d+1>>>0,_=new Uint8Array(o);g[A];){var u=n[g.charCodeAt(A)];if(u===255)return;for(var s=0,h=o-1;(u!==0||s<O)&&h!==-1;h--,s++)u+=f*_[h]>>>0,_[h]=u%256>>>0,u=u/256>>>0;if(u!==0)throw new Error("Non-zero carry");O=s,A++}if(g[A]!==" "){for(var t=o-O;t!==o&&_[t]===0;)t++;for(var i=new Uint8Array(p+(o-t)),S=p;t!==o;)i[S++]=_[t++];return i}}}function b(g){var A=v(g);if(A)return A;throw new Error(`Non-${r} character`)}return{encode:y,decodeUnsafe:v,decode:b}}var Cr=mr,pr=Cr;const Ar=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ur=e=>new TextEncoder().encode(e),Or=e=>new TextDecoder().decode(e);class Fr{constructor(r,n,a){this.name=r,this.prefix=n,this.baseEncode=a}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Nr{constructor(r,n,a){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=a}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Nt(this,r)}}class Tr{constructor(r){this.decoders=r}or(r){return Nt(this,r)}decode(r){const n=r[0],a=this.decoders[n];if(a)return a.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Nt=(e,r)=>new Tr({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Mr{constructor(r,n,a,D){this.name=r,this.prefix=n,this.baseEncode=a,this.baseDecode=D,this.encoder=new Fr(r,n,a),this.decoder=new Nr(r,n,D)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const je=({name:e,prefix:r,encode:n,decode:a})=>new Mr(e,r,n,a),Oe=({prefix:e,name:r,alphabet:n})=>{const{encode:a,decode:D}=pr(n,r);return je({prefix:e,name:r,encode:a,decode:l=>Ar(D(l))})},xr=(e,r,n,a)=>{const D={};for(let E=0;E<r.length;++E)D[r[E]]=E;let l=e.length;for(;e[l-1]==="=";)--l;const w=new Uint8Array(l*n/8|0);let f=0,c=0,d=0;for(let E=0;E<l;++E){const y=D[e[E]];if(y===void 0)throw new SyntaxError(`Non-${a} character`);c=c<<n|y,f+=n,f>=8&&(f-=8,w[d++]=255&c>>f)}if(f>=n||255&c<<8-f)throw new SyntaxError("Unexpected end of data");return w},Lr=(e,r,n)=>{const a=r[r.length-1]==="=",D=(1<<n)-1;let l="",w=0,f=0;for(let c=0;c<e.length;++c)for(f=f<<8|e[c],w+=8;w>n;)w-=n,l+=r[D&f>>w];if(w&&(l+=r[D&f<<n-w]),a)for(;l.length*n&7;)l+="=";return l},Q=({name:e,prefix:r,bitsPerChar:n,alphabet:a})=>je({prefix:r,name:e,encode(D){return Lr(D,a,n)},decode(D){return xr(D,a,n,e)}}),Br=je({prefix:"\0",name:"identity",encode:e=>Or(e),decode:e=>Ur(e)}),jr=Object.freeze(Object.defineProperty({__proto__:null,identity:Br},Symbol.toStringTag,{value:"Module"})),Ir=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Rr=Object.freeze(Object.defineProperty({__proto__:null,base2:Ir},Symbol.toStringTag,{value:"Module"})),Pr=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Hr=Object.freeze(Object.defineProperty({__proto__:null,base8:Pr},Symbol.toStringTag,{value:"Module"})),Kr=Oe({prefix:"9",name:"base10",alphabet:"0123456789"}),zr=Object.freeze(Object.defineProperty({__proto__:null,base10:Kr},Symbol.toStringTag,{value:"Module"})),Yr=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qr=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),$r=Object.freeze(Object.defineProperty({__proto__:null,base16:Yr,base16upper:qr},Symbol.toStringTag,{value:"Module"})),Gr=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vr=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wr=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Xr=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jr=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qr=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),kr=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),en=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),tn=Object.freeze(Object.defineProperty({__proto__:null,base32:Gr,base32hex:Jr,base32hexpad:Zr,base32hexpadupper:kr,base32hexupper:Qr,base32pad:Wr,base32padupper:Xr,base32upper:Vr,base32z:en},Symbol.toStringTag,{value:"Module"})),rn=Oe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nn=Oe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),an=Object.freeze(Object.defineProperty({__proto__:null,base36:rn,base36upper:nn},Symbol.toStringTag,{value:"Module"})),un=Oe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fn=Oe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),hn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:un,base58flickr:fn},Symbol.toStringTag,{value:"Module"})),sn=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),on=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cn=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base64:sn,base64pad:on,base64url:cn,base64urlpad:ln},Symbol.toStringTag,{value:"Module"})),Tt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),_n=Tt.reduce((e,r,n)=>(e[n]=r,e),[]),dn=Tt.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function En(e){return e.reduce((r,n)=>(r+=_n[n],r),"")}function bn(e){const r=[];for(const n of e){const a=dn[n.codePointAt(0)];if(a===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(a)}return new Uint8Array(r)}const vn=je({prefix:"🚀",name:"base256emoji",encode:En,decode:bn}),wn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:vn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var Mt={};/*! *****************************************************************************
1
+ "use strict";const Ye=require("./index-s2bgjlxF.js");var Et={},Me={},x={},bt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});function r(f,c){var d=f>>>16&65535,E=f&65535,y=c>>>16&65535,v=c&65535;return E*v+(d*v+E*y<<16>>>0)|0}e.mul=Math.imul||r;function n(f,c){return f+c|0}e.add=n;function a(f,c){return f-c|0}e.sub=a;function D(f,c){return f<<c|f>>>32-c}e.rotl=D;function l(f,c){return f<<32-c|f>>>c}e.rotr=l;function w(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}e.isInteger=Number.isInteger||w,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(f){return e.isInteger(f)&&f>=-e.MAX_SAFE_INTEGER&&f<=e.MAX_SAFE_INTEGER}})(bt);Object.defineProperty(x,"__esModule",{value:!0});var vt=bt;function It(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])<<16>>16}x.readInt16BE=It;function Rt(e,r){return r===void 0&&(r=0),(e[r+0]<<8|e[r+1])>>>0}x.readUint16BE=Rt;function Pt(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])<<16>>16}x.readInt16LE=Pt;function Ht(e,r){return r===void 0&&(r=0),(e[r+1]<<8|e[r])>>>0}x.readUint16LE=Ht;function wt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>8,r[n+1]=e>>>0,r}x.writeUint16BE=wt;x.writeInt16BE=wt;function yt(e,r,n){return r===void 0&&(r=new Uint8Array(2)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r}x.writeUint16LE=yt;x.writeInt16LE=yt;function qe(e,r){return r===void 0&&(r=0),e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]}x.readInt32BE=qe;function $e(e,r){return r===void 0&&(r=0),(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0}x.readUint32BE=$e;function Ge(e,r){return r===void 0&&(r=0),e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r]}x.readInt32LE=Ge;function Ve(e,r){return r===void 0&&(r=0),(e[r+3]<<24|e[r+2]<<16|e[r+1]<<8|e[r])>>>0}x.readUint32LE=Ve;function Ne(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>24,r[n+1]=e>>>16,r[n+2]=e>>>8,r[n+3]=e>>>0,r}x.writeUint32BE=Ne;x.writeInt32BE=Ne;function Te(e,r,n){return r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0),r[n+0]=e>>>0,r[n+1]=e>>>8,r[n+2]=e>>>16,r[n+3]=e>>>24,r}x.writeUint32LE=Te;x.writeInt32LE=Te;function Kt(e,r){r===void 0&&(r=0);var n=qe(e,r),a=qe(e,r+4);return n*4294967296+a-(a>>31)*4294967296}x.readInt64BE=Kt;function zt(e,r){r===void 0&&(r=0);var n=$e(e,r),a=$e(e,r+4);return n*4294967296+a}x.readUint64BE=zt;function Yt(e,r){r===void 0&&(r=0);var n=Ge(e,r),a=Ge(e,r+4);return a*4294967296+n-(n>>31)*4294967296}x.readInt64LE=Yt;function qt(e,r){r===void 0&&(r=0);var n=Ve(e,r),a=Ve(e,r+4);return a*4294967296+n}x.readUint64LE=qt;function gt(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Ne(e/4294967296>>>0,r,n),Ne(e>>>0,r,n+4),r}x.writeUint64BE=gt;x.writeInt64BE=gt;function St(e,r,n){return r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0),Te(e>>>0,r,n),Te(e/4294967296>>>0,r,n+4),r}x.writeUint64LE=St;x.writeInt64LE=St;function $t(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintBE: array is too short for the given bitLength");for(var a=0,D=1,l=e/8+n-1;l>=n;l--)a+=r[l]*D,D*=256;return a}x.readUintBE=$t;function Gt(e,r,n){if(n===void 0&&(n=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>r.length-n)throw new Error("readUintLE: array is too short for the given bitLength");for(var a=0,D=1,l=n;l<n+e/8;l++)a+=r[l]*D,D*=256;return a}x.readUintLE=Gt;function Vt(e,r,n,a){if(n===void 0&&(n=new Uint8Array(e/8)),a===void 0&&(a=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!vt.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var D=1,l=e/8+a-1;l>=a;l--)n[l]=r/D&255,D*=256;return n}x.writeUintBE=Vt;function Wt(e,r,n,a){if(n===void 0&&(n=new Uint8Array(e/8)),a===void 0&&(a=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!vt.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var D=1,l=a;l<a+e/8;l++)n[l]=r/D&255,D*=256;return n}x.writeUintLE=Wt;function Xt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r)}x.readFloat32BE=Xt;function Jt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat32(r,!0)}x.readFloat32LE=Jt;function Qt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r)}x.readFloat64BE=Qt;function Zt(e,r){r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getFloat64(r,!0)}x.readFloat64LE=Zt;function kt(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat32(n,e),r}x.writeFloat32BE=kt;function er(e,r,n){r===void 0&&(r=new Uint8Array(4)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat32(n,e,!0),r}x.writeFloat32LE=er;function tr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat64(n,e),r}x.writeFloat64BE=tr;function rr(e,r,n){r===void 0&&(r=new Uint8Array(8)),n===void 0&&(n=0);var a=new DataView(r.buffer,r.byteOffset,r.byteLength);return a.setFloat64(n,e,!0),r}x.writeFloat64LE=rr;var de={};Object.defineProperty(de,"__esModule",{value:!0});function nr(e){for(var r=0;r<e.length;r++)e[r]=0;return e}de.wipe=nr;Object.defineProperty(Me,"__esModule",{value:!0});var _e=x,We=de,ir=20;function ar(e,r,n){for(var a=1634760805,D=857760878,l=2036477234,w=1797285236,f=n[3]<<24|n[2]<<16|n[1]<<8|n[0],c=n[7]<<24|n[6]<<16|n[5]<<8|n[4],d=n[11]<<24|n[10]<<16|n[9]<<8|n[8],E=n[15]<<24|n[14]<<16|n[13]<<8|n[12],y=n[19]<<24|n[18]<<16|n[17]<<8|n[16],v=n[23]<<24|n[22]<<16|n[21]<<8|n[20],b=n[27]<<24|n[26]<<16|n[25]<<8|n[24],g=n[31]<<24|n[30]<<16|n[29]<<8|n[28],A=r[3]<<24|r[2]<<16|r[1]<<8|r[0],p=r[7]<<24|r[6]<<16|r[5]<<8|r[4],O=r[11]<<24|r[10]<<16|r[9]<<8|r[8],o=r[15]<<24|r[14]<<16|r[13]<<8|r[12],_=a,u=D,s=l,h=w,t=f,i=c,S=d,C=E,F=y,L=v,j=b,B=g,T=A,M=p,m=O,N=o,G=0;G<ir;G+=2)_=_+t|0,T^=_,T=T>>>16|T<<16,F=F+T|0,t^=F,t=t>>>20|t<<12,u=u+i|0,M^=u,M=M>>>16|M<<16,L=L+M|0,i^=L,i=i>>>20|i<<12,s=s+S|0,m^=s,m=m>>>16|m<<16,j=j+m|0,S^=j,S=S>>>20|S<<12,h=h+C|0,N^=h,N=N>>>16|N<<16,B=B+N|0,C^=B,C=C>>>20|C<<12,s=s+S|0,m^=s,m=m>>>24|m<<8,j=j+m|0,S^=j,S=S>>>25|S<<7,h=h+C|0,N^=h,N=N>>>24|N<<8,B=B+N|0,C^=B,C=C>>>25|C<<7,u=u+i|0,M^=u,M=M>>>24|M<<8,L=L+M|0,i^=L,i=i>>>25|i<<7,_=_+t|0,T^=_,T=T>>>24|T<<8,F=F+T|0,t^=F,t=t>>>25|t<<7,_=_+i|0,N^=_,N=N>>>16|N<<16,j=j+N|0,i^=j,i=i>>>20|i<<12,u=u+S|0,T^=u,T=T>>>16|T<<16,B=B+T|0,S^=B,S=S>>>20|S<<12,s=s+C|0,M^=s,M=M>>>16|M<<16,F=F+M|0,C^=F,C=C>>>20|C<<12,h=h+t|0,m^=h,m=m>>>16|m<<16,L=L+m|0,t^=L,t=t>>>20|t<<12,s=s+C|0,M^=s,M=M>>>24|M<<8,F=F+M|0,C^=F,C=C>>>25|C<<7,h=h+t|0,m^=h,m=m>>>24|m<<8,L=L+m|0,t^=L,t=t>>>25|t<<7,u=u+S|0,T^=u,T=T>>>24|T<<8,B=B+T|0,S^=B,S=S>>>25|S<<7,_=_+i|0,N^=_,N=N>>>24|N<<8,j=j+N|0,i^=j,i=i>>>25|i<<7;_e.writeUint32LE(_+a|0,e,0),_e.writeUint32LE(u+D|0,e,4),_e.writeUint32LE(s+l|0,e,8),_e.writeUint32LE(h+w|0,e,12),_e.writeUint32LE(t+f|0,e,16),_e.writeUint32LE(i+c|0,e,20),_e.writeUint32LE(S+d|0,e,24),_e.writeUint32LE(C+E|0,e,28),_e.writeUint32LE(F+y|0,e,32),_e.writeUint32LE(L+v|0,e,36),_e.writeUint32LE(j+b|0,e,40),_e.writeUint32LE(B+g|0,e,44),_e.writeUint32LE(T+A|0,e,48),_e.writeUint32LE(M+p|0,e,52),_e.writeUint32LE(m+O|0,e,56),_e.writeUint32LE(N+o|0,e,60)}function mt(e,r,n,a,D){if(D===void 0&&(D=0),e.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(a.length<n.length)throw new Error("ChaCha: destination is shorter than source");var l,w;if(D===0){if(r.length!==8&&r.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");l=new Uint8Array(16),w=l.length-r.length,l.set(r,w)}else{if(r.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");l=r,w=D}for(var f=new Uint8Array(64),c=0;c<n.length;c+=64){ar(f,l,e);for(var d=c;d<c+64&&d<n.length;d++)a[d]=n[d]^f[d-c];fr(l,0,w)}return We.wipe(f),D===0&&We.wipe(l),a}Me.streamXOR=mt;function ur(e,r,n,a){return a===void 0&&(a=0),We.wipe(n),mt(e,r,n,n,a)}Me.stream=ur;function fr(e,r,n){for(var a=1;n--;)a=a+(e[r]&255)|0,e[r]=a&255,a>>>=8,r++;if(a>0)throw new Error("ChaCha: counter overflow")}var Ct={},be={};Object.defineProperty(be,"__esModule",{value:!0});function hr(e,r,n){return~(e-1)&r|e-1&n}be.select=hr;function sr(e,r){return(e|0)-(r|0)-1>>>31&1}be.lessOrEqual=sr;function pt(e,r){if(e.length!==r.length)return 0;for(var n=0,a=0;a<e.length;a++)n|=e[a]^r[a];return 1&n-1>>>8}be.compare=pt;function or(e,r){return e.length===0||r.length===0?!1:pt(e,r)!==0}be.equal=or;(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=be,n=de;e.DIGEST_LENGTH=16;var a=function(){function w(f){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=f[0]|f[1]<<8;this._r[0]=c&8191;var d=f[2]|f[3]<<8;this._r[1]=(c>>>13|d<<3)&8191;var E=f[4]|f[5]<<8;this._r[2]=(d>>>10|E<<6)&7939;var y=f[6]|f[7]<<8;this._r[3]=(E>>>7|y<<9)&8191;var v=f[8]|f[9]<<8;this._r[4]=(y>>>4|v<<12)&255,this._r[5]=v>>>1&8190;var b=f[10]|f[11]<<8;this._r[6]=(v>>>14|b<<2)&8191;var g=f[12]|f[13]<<8;this._r[7]=(b>>>11|g<<5)&8065;var A=f[14]|f[15]<<8;this._r[8]=(g>>>8|A<<8)&8191,this._r[9]=A>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return w.prototype._blocks=function(f,c,d){for(var E=this._fin?0:2048,y=this._h[0],v=this._h[1],b=this._h[2],g=this._h[3],A=this._h[4],p=this._h[5],O=this._h[6],o=this._h[7],_=this._h[8],u=this._h[9],s=this._r[0],h=this._r[1],t=this._r[2],i=this._r[3],S=this._r[4],C=this._r[5],F=this._r[6],L=this._r[7],j=this._r[8],B=this._r[9];d>=16;){var T=f[c+0]|f[c+1]<<8;y+=T&8191;var M=f[c+2]|f[c+3]<<8;v+=(T>>>13|M<<3)&8191;var m=f[c+4]|f[c+5]<<8;b+=(M>>>10|m<<6)&8191;var N=f[c+6]|f[c+7]<<8;g+=(m>>>7|N<<9)&8191;var G=f[c+8]|f[c+9]<<8;A+=(N>>>4|G<<12)&8191,p+=G>>>1&8191;var J=f[c+10]|f[c+11]<<8;O+=(G>>>14|J<<2)&8191;var X=f[c+12]|f[c+13]<<8;o+=(J>>>11|X<<5)&8191;var W=f[c+14]|f[c+15]<<8;_+=(X>>>8|W<<8)&8191,u+=W>>>5|E;var U=0,I=U;I+=y*s,I+=v*(5*B),I+=b*(5*j),I+=g*(5*L),I+=A*(5*F),U=I>>>13,I&=8191,I+=p*(5*C),I+=O*(5*S),I+=o*(5*i),I+=_*(5*t),I+=u*(5*h),U+=I>>>13,I&=8191;var R=U;R+=y*h,R+=v*s,R+=b*(5*B),R+=g*(5*j),R+=A*(5*L),U=R>>>13,R&=8191,R+=p*(5*F),R+=O*(5*C),R+=o*(5*S),R+=_*(5*i),R+=u*(5*t),U+=R>>>13,R&=8191;var P=U;P+=y*t,P+=v*h,P+=b*s,P+=g*(5*B),P+=A*(5*j),U=P>>>13,P&=8191,P+=p*(5*L),P+=O*(5*F),P+=o*(5*C),P+=_*(5*S),P+=u*(5*i),U+=P>>>13,P&=8191;var H=U;H+=y*i,H+=v*t,H+=b*h,H+=g*s,H+=A*(5*B),U=H>>>13,H&=8191,H+=p*(5*j),H+=O*(5*L),H+=o*(5*F),H+=_*(5*C),H+=u*(5*S),U+=H>>>13,H&=8191;var K=U;K+=y*S,K+=v*i,K+=b*t,K+=g*h,K+=A*s,U=K>>>13,K&=8191,K+=p*(5*B),K+=O*(5*j),K+=o*(5*L),K+=_*(5*F),K+=u*(5*C),U+=K>>>13,K&=8191;var z=U;z+=y*C,z+=v*S,z+=b*i,z+=g*t,z+=A*h,U=z>>>13,z&=8191,z+=p*s,z+=O*(5*B),z+=o*(5*j),z+=_*(5*L),z+=u*(5*F),U+=z>>>13,z&=8191;var Y=U;Y+=y*F,Y+=v*C,Y+=b*S,Y+=g*i,Y+=A*t,U=Y>>>13,Y&=8191,Y+=p*h,Y+=O*s,Y+=o*(5*B),Y+=_*(5*j),Y+=u*(5*L),U+=Y>>>13,Y&=8191;var q=U;q+=y*L,q+=v*F,q+=b*C,q+=g*S,q+=A*i,U=q>>>13,q&=8191,q+=p*t,q+=O*h,q+=o*s,q+=_*(5*B),q+=u*(5*j),U+=q>>>13,q&=8191;var $=U;$+=y*j,$+=v*L,$+=b*F,$+=g*C,$+=A*S,U=$>>>13,$&=8191,$+=p*i,$+=O*t,$+=o*h,$+=_*s,$+=u*(5*B),U+=$>>>13,$&=8191;var V=U;V+=y*B,V+=v*j,V+=b*L,V+=g*F,V+=A*C,U=V>>>13,V&=8191,V+=p*S,V+=O*i,V+=o*t,V+=_*h,V+=u*s,U+=V>>>13,V&=8191,U=(U<<2)+U|0,U=U+I|0,I=U&8191,U=U>>>13,R+=U,y=I,v=R,b=P,g=H,A=K,p=z,O=Y,o=q,_=$,u=V,c+=16,d-=16}this._h[0]=y,this._h[1]=v,this._h[2]=b,this._h[3]=g,this._h[4]=A,this._h[5]=p,this._h[6]=O,this._h[7]=o,this._h[8]=_,this._h[9]=u},w.prototype.finish=function(f,c){c===void 0&&(c=0);var d=new Uint16Array(10),E,y,v,b;if(this._leftover){for(b=this._leftover,this._buffer[b++]=1;b<16;b++)this._buffer[b]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(E=this._h[1]>>>13,this._h[1]&=8191,b=2;b<10;b++)this._h[b]+=E,E=this._h[b]>>>13,this._h[b]&=8191;for(this._h[0]+=E*5,E=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=E,E=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=E,d[0]=this._h[0]+5,E=d[0]>>>13,d[0]&=8191,b=1;b<10;b++)d[b]=this._h[b]+E,E=d[b]>>>13,d[b]&=8191;for(d[9]-=8192,y=(E^1)-1,b=0;b<10;b++)d[b]&=y;for(y=~y,b=0;b<10;b++)this._h[b]=this._h[b]&y|d[b];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,v=this._h[0]+this._pad[0],this._h[0]=v&65535,b=1;b<8;b++)v=(this._h[b]+this._pad[b]|0)+(v>>>16)|0,this._h[b]=v&65535;return f[c+0]=this._h[0]>>>0,f[c+1]=this._h[0]>>>8,f[c+2]=this._h[1]>>>0,f[c+3]=this._h[1]>>>8,f[c+4]=this._h[2]>>>0,f[c+5]=this._h[2]>>>8,f[c+6]=this._h[3]>>>0,f[c+7]=this._h[3]>>>8,f[c+8]=this._h[4]>>>0,f[c+9]=this._h[4]>>>8,f[c+10]=this._h[5]>>>0,f[c+11]=this._h[5]>>>8,f[c+12]=this._h[6]>>>0,f[c+13]=this._h[6]>>>8,f[c+14]=this._h[7]>>>0,f[c+15]=this._h[7]>>>8,this._finished=!0,this},w.prototype.update=function(f){var c=0,d=f.length,E;if(this._leftover){E=16-this._leftover,E>d&&(E=d);for(var y=0;y<E;y++)this._buffer[this._leftover+y]=f[c+y];if(d-=E,c+=E,this._leftover+=E,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(E=d-d%16,this._blocks(f,c,E),c+=E,d-=E),d){for(var y=0;y<d;y++)this._buffer[this._leftover+y]=f[c+y];this._leftover+=d}return this},w.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var f=new Uint8Array(16);return this.finish(f),f},w.prototype.clean=function(){return n.wipe(this._buffer),n.wipe(this._r),n.wipe(this._h),n.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},w}();e.Poly1305=a;function D(w,f){var c=new a(w);c.update(f);var d=c.digest();return c.clean(),d}e.oneTimeAuth=D;function l(w,f){return w.length!==e.DIGEST_LENGTH||f.length!==e.DIGEST_LENGTH?!1:r.equal(w,f)}e.equal=l})(Ct);(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=Me,n=Ct,a=de,D=x,l=be;e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var w=new Uint8Array(16),f=function(){function c(d){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,d.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return c.prototype.seal=function(d,E,y,v){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var b=new Uint8Array(16);b.set(d,b.length-d.length);var g=new Uint8Array(32);r.stream(this._key,b,g,4);var A=E.length+this.tagLength,p;if(v){if(v.length!==A)throw new Error("ChaCha20Poly1305: incorrect destination length");p=v}else p=new Uint8Array(A);return r.streamXOR(this._key,b,E,p,4),this._authenticate(p.subarray(p.length-this.tagLength,p.length),g,p.subarray(0,p.length-this.tagLength),y),a.wipe(b),p},c.prototype.open=function(d,E,y,v){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(E.length<this.tagLength)return null;var b=new Uint8Array(16);b.set(d,b.length-d.length);var g=new Uint8Array(32);r.stream(this._key,b,g,4);var A=new Uint8Array(this.tagLength);if(this._authenticate(A,g,E.subarray(0,E.length-this.tagLength),y),!l.equal(A,E.subarray(E.length-this.tagLength,E.length)))return null;var p=E.length-this.tagLength,O;if(v){if(v.length!==p)throw new Error("ChaCha20Poly1305: incorrect destination length");O=v}else O=new Uint8Array(p);return r.streamXOR(this._key,b,E.subarray(0,E.length-this.tagLength),O,4),a.wipe(b),O},c.prototype.clean=function(){return a.wipe(this._key),this},c.prototype._authenticate=function(d,E,y,v){var b=new n.Poly1305(E);v&&(b.update(v),v.length%16>0&&b.update(w.subarray(v.length%16))),b.update(y),y.length%16>0&&b.update(w.subarray(y.length%16));var g=new Uint8Array(8);v&&D.writeUint64LE(v.length,g),b.update(g),D.writeUint64LE(y.length,g),b.update(g);for(var A=b.digest(),p=0;p<A.length;p++)d[p]=A[p];b.clean(),a.wipe(A),a.wipe(g)},c}();e.ChaCha20Poly1305=f})(Et);var At={},Ue={},ke={};Object.defineProperty(ke,"__esModule",{value:!0});function cr(e){return typeof e.saveState<"u"&&typeof e.restoreState<"u"&&typeof e.cleanSavedState<"u"}ke.isSerializableHash=cr;Object.defineProperty(Ue,"__esModule",{value:!0});var Ee=ke,lr=be,Dr=de,Ut=function(){function e(r,n){this._finished=!1,this._inner=new r,this._outer=new r,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var a=new Uint8Array(this.blockSize);n.length>this.blockSize?this._inner.update(n).finish(a).clean():a.set(n);for(var D=0;D<a.length;D++)a[D]^=54;this._inner.update(a);for(var D=0;D<a.length;D++)a[D]^=106;this._outer.update(a),Ee.isSerializableHash(this._inner)&&Ee.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),Dr.wipe(a)}return e.prototype.reset=function(){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.clean=function(){Ee.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Ee.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},e.prototype.update=function(r){return this._inner.update(r),this},e.prototype.finish=function(r){return this._finished?(this._outer.finish(r),this):(this._inner.finish(r),this._outer.update(r.subarray(0,this.digestLength)).finish(r),this._finished=!0,this)},e.prototype.digest=function(){var r=new Uint8Array(this.digestLength);return this.finish(r),r},e.prototype.saveState=function(){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},e.prototype.restoreState=function(r){if(!Ee.isSerializableHash(this._inner)||!Ee.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(r),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},e.prototype.cleanSavedState=function(r){if(!Ee.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(r)},e}();Ue.HMAC=Ut;function _r(e,r,n){var a=new Ut(e,r);a.update(n);var D=a.digest();return a.clean(),D}Ue.hmac=_r;Ue.equal=lr.equal;Object.defineProperty(At,"__esModule",{value:!0});var rt=Ue,nt=de,dr=function(){function e(r,n,a,D){a===void 0&&(a=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=r,this._info=D;var l=rt.hmac(this._hash,a,n);this._hmac=new rt.HMAC(r,l),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var r=this._counter[0];if(r===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),r>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(r){for(var n=new Uint8Array(r),a=0;a<n.length;a++)this._bufpos===this._buffer.length&&this._fillBuffer(),n[a]=this._buffer[this._bufpos++];return n},e.prototype.clean=function(){this._hmac.clean(),nt.wipe(this._buffer),nt.wipe(this._counter),this._bufpos=0},e}(),Er=At.HKDF=dr,et={},xe={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.BrowserRandomSource=void 0;const it=65536;class br{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const r=typeof self<"u"?self.crypto||self.msCrypto:null;r&&r.getRandomValues!==void 0&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const n=new Uint8Array(r);for(let a=0;a<n.length;a+=it)this._crypto.getRandomValues(n.subarray(a,a+Math.min(n.length-a,it)));return n}}Le.BrowserRandomSource=br;var Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.NodeRandomSource=void 0;const vr=de;class wr{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Ye.commonjsRequire<"u"){const r=Ye.requireCryptoBrowserify();r&&r.randomBytes&&(this._crypto=r,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(r){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let n=this._crypto.randomBytes(r);if(n.length!==r)throw new Error("NodeRandomSource: got fewer bytes than requested");const a=new Uint8Array(r);for(let D=0;D<a.length;D++)a[D]=n[D];return(0,vr.wipe)(n),a}}Be.NodeRandomSource=wr;Object.defineProperty(xe,"__esModule",{value:!0});xe.SystemRandomSource=void 0;const yr=Le,gr=Be;class Sr{constructor(){if(this.isAvailable=!1,this.name="",this._source=new yr.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new gr.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(r){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(r)}}xe.SystemRandomSource=Sr;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;const r=xe,n=x,a=de;e.defaultRandomSource=new r.SystemRandomSource;function D(d,E=e.defaultRandomSource){return E.randomBytes(d)}e.randomBytes=D;function l(d=e.defaultRandomSource){const E=D(4,d),y=(0,n.readUint32LE)(E);return(0,a.wipe)(E),y}e.randomUint32=l;const w="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function f(d,E=w,y=e.defaultRandomSource){if(E.length<2)throw new Error("randomString charset is too short");if(E.length>256)throw new Error("randomString charset is too long");let v="";const b=E.length,g=256-256%b;for(;d>0;){const A=D(Math.ceil(d*256/g),y);for(let p=0;p<A.length&&d>0;p++){const O=A[p];O<g&&(v+=E.charAt(O%b),d--)}(0,a.wipe)(A)}return v}e.randomString=f;function c(d,E=w,y=e.defaultRandomSource){const v=Math.ceil(d/(Math.log(E.length)/Math.LN2));return f(v,E,y)}e.randomStringForEntropy=c})(et);var Ot={};(function(e){Object.defineProperty(e,"__esModule",{value:!0});var r=x,n=de;e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var a=function(){function f(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return f.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},f.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},f.prototype.clean=function(){n.wipe(this._buffer),n.wipe(this._temp),this.reset()},f.prototype.update=function(c,d){if(d===void 0&&(d=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var E=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=c[E++],d--;this._bufferLength===this.blockSize&&(l(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(E=l(this._temp,this._state,c,E,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=c[E++],d--;return this},f.prototype.finish=function(c){if(!this._finished){var d=this._bytesHashed,E=this._bufferLength,y=d/536870912|0,v=d<<3,b=d%64<56?64:128;this._buffer[E]=128;for(var g=E+1;g<b-8;g++)this._buffer[g]=0;r.writeUint32BE(y,this._buffer,b-8),r.writeUint32BE(v,this._buffer,b-4),l(this._temp,this._state,this._buffer,0,b),this._finished=!0}for(var g=0;g<this.digestLength/4;g++)r.writeUint32BE(this._state[g],c,g*4);return this},f.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},f.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(c){n.wipe(c.state),c.buffer&&n.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},f}();e.SHA256=a;var D=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function l(f,c,d,E,y){for(;y>=64;){for(var v=c[0],b=c[1],g=c[2],A=c[3],p=c[4],O=c[5],o=c[6],_=c[7],u=0;u<16;u++){var s=E+u*4;f[u]=r.readUint32BE(d,s)}for(var u=16;u<64;u++){var h=f[u-2],t=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10;h=f[u-15];var i=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3;f[u]=(t+f[u-7]|0)+(i+f[u-16]|0)}for(var u=0;u<64;u++){var t=(((p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&O^~p&o)|0)+(_+(D[u]+f[u]|0)|0)|0,i=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&b^v&g^b&g)|0;_=o,o=O,O=p,p=A+t|0,A=g,g=b,b=v,v=t+i|0}c[0]+=v,c[1]+=b,c[2]+=g,c[3]+=A,c[4]+=p,c[5]+=O,c[6]+=o,c[7]+=_,E+=64,y-=64}return E}function w(f){var c=new a;c.update(f);var d=c.digest();return c.clean(),d}e.hash=w})(Ot);var Ft={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;const r=et,n=de;e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function a(u){const s=new Float64Array(16);if(u)for(let h=0;h<u.length;h++)s[h]=u[h];return s}const D=new Uint8Array(32);D[0]=9;const l=a([56129,1]);function w(u){let s=1;for(let h=0;h<16;h++){let t=u[h]+s+65535;s=Math.floor(t/65536),u[h]=t-s*65536}u[0]+=s-1+37*(s-1)}function f(u,s,h){const t=~(h-1);for(let i=0;i<16;i++){const S=t&(u[i]^s[i]);u[i]^=S,s[i]^=S}}function c(u,s){const h=a(),t=a();for(let i=0;i<16;i++)t[i]=s[i];w(t),w(t),w(t);for(let i=0;i<2;i++){h[0]=t[0]-65517;for(let C=1;C<15;C++)h[C]=t[C]-65535-(h[C-1]>>16&1),h[C-1]&=65535;h[15]=t[15]-32767-(h[14]>>16&1);const S=h[15]>>16&1;h[14]&=65535,f(t,h,1-S)}for(let i=0;i<16;i++)u[2*i]=t[i]&255,u[2*i+1]=t[i]>>8}function d(u,s){for(let h=0;h<16;h++)u[h]=s[2*h]+(s[2*h+1]<<8);u[15]&=32767}function E(u,s,h){for(let t=0;t<16;t++)u[t]=s[t]+h[t]}function y(u,s,h){for(let t=0;t<16;t++)u[t]=s[t]-h[t]}function v(u,s,h){let t,i,S=0,C=0,F=0,L=0,j=0,B=0,T=0,M=0,m=0,N=0,G=0,J=0,X=0,W=0,U=0,I=0,R=0,P=0,H=0,K=0,z=0,Y=0,q=0,$=0,V=0,ve=0,ge=0,me=0,Fe=0,Re=0,tt=0,Z=h[0],k=h[1],ee=h[2],te=h[3],re=h[4],ne=h[5],ie=h[6],ae=h[7],ue=h[8],fe=h[9],he=h[10],se=h[11],oe=h[12],ce=h[13],le=h[14],De=h[15];t=s[0],S+=t*Z,C+=t*k,F+=t*ee,L+=t*te,j+=t*re,B+=t*ne,T+=t*ie,M+=t*ae,m+=t*ue,N+=t*fe,G+=t*he,J+=t*se,X+=t*oe,W+=t*ce,U+=t*le,I+=t*De,t=s[1],C+=t*Z,F+=t*k,L+=t*ee,j+=t*te,B+=t*re,T+=t*ne,M+=t*ie,m+=t*ae,N+=t*ue,G+=t*fe,J+=t*he,X+=t*se,W+=t*oe,U+=t*ce,I+=t*le,R+=t*De,t=s[2],F+=t*Z,L+=t*k,j+=t*ee,B+=t*te,T+=t*re,M+=t*ne,m+=t*ie,N+=t*ae,G+=t*ue,J+=t*fe,X+=t*he,W+=t*se,U+=t*oe,I+=t*ce,R+=t*le,P+=t*De,t=s[3],L+=t*Z,j+=t*k,B+=t*ee,T+=t*te,M+=t*re,m+=t*ne,N+=t*ie,G+=t*ae,J+=t*ue,X+=t*fe,W+=t*he,U+=t*se,I+=t*oe,R+=t*ce,P+=t*le,H+=t*De,t=s[4],j+=t*Z,B+=t*k,T+=t*ee,M+=t*te,m+=t*re,N+=t*ne,G+=t*ie,J+=t*ae,X+=t*ue,W+=t*fe,U+=t*he,I+=t*se,R+=t*oe,P+=t*ce,H+=t*le,K+=t*De,t=s[5],B+=t*Z,T+=t*k,M+=t*ee,m+=t*te,N+=t*re,G+=t*ne,J+=t*ie,X+=t*ae,W+=t*ue,U+=t*fe,I+=t*he,R+=t*se,P+=t*oe,H+=t*ce,K+=t*le,z+=t*De,t=s[6],T+=t*Z,M+=t*k,m+=t*ee,N+=t*te,G+=t*re,J+=t*ne,X+=t*ie,W+=t*ae,U+=t*ue,I+=t*fe,R+=t*he,P+=t*se,H+=t*oe,K+=t*ce,z+=t*le,Y+=t*De,t=s[7],M+=t*Z,m+=t*k,N+=t*ee,G+=t*te,J+=t*re,X+=t*ne,W+=t*ie,U+=t*ae,I+=t*ue,R+=t*fe,P+=t*he,H+=t*se,K+=t*oe,z+=t*ce,Y+=t*le,q+=t*De,t=s[8],m+=t*Z,N+=t*k,G+=t*ee,J+=t*te,X+=t*re,W+=t*ne,U+=t*ie,I+=t*ae,R+=t*ue,P+=t*fe,H+=t*he,K+=t*se,z+=t*oe,Y+=t*ce,q+=t*le,$+=t*De,t=s[9],N+=t*Z,G+=t*k,J+=t*ee,X+=t*te,W+=t*re,U+=t*ne,I+=t*ie,R+=t*ae,P+=t*ue,H+=t*fe,K+=t*he,z+=t*se,Y+=t*oe,q+=t*ce,$+=t*le,V+=t*De,t=s[10],G+=t*Z,J+=t*k,X+=t*ee,W+=t*te,U+=t*re,I+=t*ne,R+=t*ie,P+=t*ae,H+=t*ue,K+=t*fe,z+=t*he,Y+=t*se,q+=t*oe,$+=t*ce,V+=t*le,ve+=t*De,t=s[11],J+=t*Z,X+=t*k,W+=t*ee,U+=t*te,I+=t*re,R+=t*ne,P+=t*ie,H+=t*ae,K+=t*ue,z+=t*fe,Y+=t*he,q+=t*se,$+=t*oe,V+=t*ce,ve+=t*le,ge+=t*De,t=s[12],X+=t*Z,W+=t*k,U+=t*ee,I+=t*te,R+=t*re,P+=t*ne,H+=t*ie,K+=t*ae,z+=t*ue,Y+=t*fe,q+=t*he,$+=t*se,V+=t*oe,ve+=t*ce,ge+=t*le,me+=t*De,t=s[13],W+=t*Z,U+=t*k,I+=t*ee,R+=t*te,P+=t*re,H+=t*ne,K+=t*ie,z+=t*ae,Y+=t*ue,q+=t*fe,$+=t*he,V+=t*se,ve+=t*oe,ge+=t*ce,me+=t*le,Fe+=t*De,t=s[14],U+=t*Z,I+=t*k,R+=t*ee,P+=t*te,H+=t*re,K+=t*ne,z+=t*ie,Y+=t*ae,q+=t*ue,$+=t*fe,V+=t*he,ve+=t*se,ge+=t*oe,me+=t*ce,Fe+=t*le,Re+=t*De,t=s[15],I+=t*Z,R+=t*k,P+=t*ee,H+=t*te,K+=t*re,z+=t*ne,Y+=t*ie,q+=t*ae,$+=t*ue,V+=t*fe,ve+=t*he,ge+=t*se,me+=t*oe,Fe+=t*ce,Re+=t*le,tt+=t*De,S+=38*R,C+=38*P,F+=38*H,L+=38*K,j+=38*z,B+=38*Y,T+=38*q,M+=38*$,m+=38*V,N+=38*ve,G+=38*ge,J+=38*me,X+=38*Fe,W+=38*Re,U+=38*tt,i=1,t=S+i+65535,i=Math.floor(t/65536),S=t-i*65536,t=C+i+65535,i=Math.floor(t/65536),C=t-i*65536,t=F+i+65535,i=Math.floor(t/65536),F=t-i*65536,t=L+i+65535,i=Math.floor(t/65536),L=t-i*65536,t=j+i+65535,i=Math.floor(t/65536),j=t-i*65536,t=B+i+65535,i=Math.floor(t/65536),B=t-i*65536,t=T+i+65535,i=Math.floor(t/65536),T=t-i*65536,t=M+i+65535,i=Math.floor(t/65536),M=t-i*65536,t=m+i+65535,i=Math.floor(t/65536),m=t-i*65536,t=N+i+65535,i=Math.floor(t/65536),N=t-i*65536,t=G+i+65535,i=Math.floor(t/65536),G=t-i*65536,t=J+i+65535,i=Math.floor(t/65536),J=t-i*65536,t=X+i+65535,i=Math.floor(t/65536),X=t-i*65536,t=W+i+65535,i=Math.floor(t/65536),W=t-i*65536,t=U+i+65535,i=Math.floor(t/65536),U=t-i*65536,t=I+i+65535,i=Math.floor(t/65536),I=t-i*65536,S+=i-1+37*(i-1),i=1,t=S+i+65535,i=Math.floor(t/65536),S=t-i*65536,t=C+i+65535,i=Math.floor(t/65536),C=t-i*65536,t=F+i+65535,i=Math.floor(t/65536),F=t-i*65536,t=L+i+65535,i=Math.floor(t/65536),L=t-i*65536,t=j+i+65535,i=Math.floor(t/65536),j=t-i*65536,t=B+i+65535,i=Math.floor(t/65536),B=t-i*65536,t=T+i+65535,i=Math.floor(t/65536),T=t-i*65536,t=M+i+65535,i=Math.floor(t/65536),M=t-i*65536,t=m+i+65535,i=Math.floor(t/65536),m=t-i*65536,t=N+i+65535,i=Math.floor(t/65536),N=t-i*65536,t=G+i+65535,i=Math.floor(t/65536),G=t-i*65536,t=J+i+65535,i=Math.floor(t/65536),J=t-i*65536,t=X+i+65535,i=Math.floor(t/65536),X=t-i*65536,t=W+i+65535,i=Math.floor(t/65536),W=t-i*65536,t=U+i+65535,i=Math.floor(t/65536),U=t-i*65536,t=I+i+65535,i=Math.floor(t/65536),I=t-i*65536,S+=i-1+37*(i-1),u[0]=S,u[1]=C,u[2]=F,u[3]=L,u[4]=j,u[5]=B,u[6]=T,u[7]=M,u[8]=m,u[9]=N,u[10]=G,u[11]=J,u[12]=X,u[13]=W,u[14]=U,u[15]=I}function b(u,s){v(u,s,s)}function g(u,s){const h=a();for(let t=0;t<16;t++)h[t]=s[t];for(let t=253;t>=0;t--)b(h,h),t!==2&&t!==4&&v(h,h,s);for(let t=0;t<16;t++)u[t]=h[t]}function A(u,s){const h=new Uint8Array(32),t=new Float64Array(80),i=a(),S=a(),C=a(),F=a(),L=a(),j=a();for(let m=0;m<31;m++)h[m]=u[m];h[31]=u[31]&127|64,h[0]&=248,d(t,s);for(let m=0;m<16;m++)S[m]=t[m];i[0]=F[0]=1;for(let m=254;m>=0;--m){const N=h[m>>>3]>>>(m&7)&1;f(i,S,N),f(C,F,N),E(L,i,C),y(i,i,C),E(C,S,F),y(S,S,F),b(F,L),b(j,i),v(i,C,i),v(C,S,L),E(L,i,C),y(i,i,C),b(S,i),y(C,F,j),v(i,C,l),E(i,i,F),v(C,C,i),v(i,F,j),v(F,S,t),b(S,L),f(i,S,N),f(C,F,N)}for(let m=0;m<16;m++)t[m+16]=i[m],t[m+32]=C[m],t[m+48]=S[m],t[m+64]=F[m];const B=t.subarray(32),T=t.subarray(16);g(B,B),v(T,T,B);const M=new Uint8Array(32);return c(M,T),M}e.scalarMult=A;function p(u){return A(u,D)}e.scalarMultBase=p;function O(u){if(u.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);const s=new Uint8Array(u);return{publicKey:p(s),secretKey:s}}e.generateKeyPairFromSeed=O;function o(u){const s=(0,r.randomBytes)(32,u),h=O(s);return(0,n.wipe)(s),h}e.generateKeyPair=o;function _(u,s,h=!1){if(u.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(s.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const t=A(u,s);if(h){let i=0;for(let S=0;S<t.length;S++)i|=t[S];if(i===0)throw new Error("X25519: invalid shared key")}return t}e.sharedKey=_})(Ft);function mr(e,r){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),a=0;a<n.length;a++)n[a]=255;for(var D=0;D<e.length;D++){var l=e.charAt(D),w=l.charCodeAt(0);if(n[w]!==255)throw new TypeError(l+" is ambiguous");n[w]=D}var f=e.length,c=e.charAt(0),d=Math.log(f)/Math.log(256),E=Math.log(256)/Math.log(f);function y(g){if(g instanceof Uint8Array||(ArrayBuffer.isView(g)?g=new Uint8Array(g.buffer,g.byteOffset,g.byteLength):Array.isArray(g)&&(g=Uint8Array.from(g))),!(g instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(g.length===0)return"";for(var A=0,p=0,O=0,o=g.length;O!==o&&g[O]===0;)O++,A++;for(var _=(o-O)*E+1>>>0,u=new Uint8Array(_);O!==o;){for(var s=g[O],h=0,t=_-1;(s!==0||h<p)&&t!==-1;t--,h++)s+=256*u[t]>>>0,u[t]=s%f>>>0,s=s/f>>>0;if(s!==0)throw new Error("Non-zero carry");p=h,O++}for(var i=_-p;i!==_&&u[i]===0;)i++;for(var S=c.repeat(A);i<_;++i)S+=e.charAt(u[i]);return S}function v(g){if(typeof g!="string")throw new TypeError("Expected String");if(g.length===0)return new Uint8Array;var A=0;if(g[A]!==" "){for(var p=0,O=0;g[A]===c;)p++,A++;for(var o=(g.length-A)*d+1>>>0,_=new Uint8Array(o);g[A];){var u=n[g.charCodeAt(A)];if(u===255)return;for(var s=0,h=o-1;(u!==0||s<O)&&h!==-1;h--,s++)u+=f*_[h]>>>0,_[h]=u%256>>>0,u=u/256>>>0;if(u!==0)throw new Error("Non-zero carry");O=s,A++}if(g[A]!==" "){for(var t=o-O;t!==o&&_[t]===0;)t++;for(var i=new Uint8Array(p+(o-t)),S=p;t!==o;)i[S++]=_[t++];return i}}}function b(g){var A=v(g);if(A)return A;throw new Error(`Non-${r} character`)}return{encode:y,decodeUnsafe:v,decode:b}}var Cr=mr,pr=Cr;const Ar=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ur=e=>new TextEncoder().encode(e),Or=e=>new TextDecoder().decode(e);class Fr{constructor(r,n,a){this.name=r,this.prefix=n,this.baseEncode=a}encode(r){if(r instanceof Uint8Array)return`${this.prefix}${this.baseEncode(r)}`;throw Error("Unknown type, must be binary type")}}class Nr{constructor(r,n,a){if(this.name=r,this.prefix=n,n.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n.codePointAt(0),this.baseDecode=a}decode(r){if(typeof r=="string"){if(r.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(r)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(r.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(r){return Nt(this,r)}}class Tr{constructor(r){this.decoders=r}or(r){return Nt(this,r)}decode(r){const n=r[0],a=this.decoders[n];if(a)return a.decode(r);throw RangeError(`Unable to decode multibase string ${JSON.stringify(r)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Nt=(e,r)=>new Tr({...e.decoders||{[e.prefix]:e},...r.decoders||{[r.prefix]:r}});class Mr{constructor(r,n,a,D){this.name=r,this.prefix=n,this.baseEncode=a,this.baseDecode=D,this.encoder=new Fr(r,n,a),this.decoder=new Nr(r,n,D)}encode(r){return this.encoder.encode(r)}decode(r){return this.decoder.decode(r)}}const je=({name:e,prefix:r,encode:n,decode:a})=>new Mr(e,r,n,a),Oe=({prefix:e,name:r,alphabet:n})=>{const{encode:a,decode:D}=pr(n,r);return je({prefix:e,name:r,encode:a,decode:l=>Ar(D(l))})},xr=(e,r,n,a)=>{const D={};for(let E=0;E<r.length;++E)D[r[E]]=E;let l=e.length;for(;e[l-1]==="=";)--l;const w=new Uint8Array(l*n/8|0);let f=0,c=0,d=0;for(let E=0;E<l;++E){const y=D[e[E]];if(y===void 0)throw new SyntaxError(`Non-${a} character`);c=c<<n|y,f+=n,f>=8&&(f-=8,w[d++]=255&c>>f)}if(f>=n||255&c<<8-f)throw new SyntaxError("Unexpected end of data");return w},Lr=(e,r,n)=>{const a=r[r.length-1]==="=",D=(1<<n)-1;let l="",w=0,f=0;for(let c=0;c<e.length;++c)for(f=f<<8|e[c],w+=8;w>n;)w-=n,l+=r[D&f>>w];if(w&&(l+=r[D&f<<n-w]),a)for(;l.length*n&7;)l+="=";return l},Q=({name:e,prefix:r,bitsPerChar:n,alphabet:a})=>je({prefix:r,name:e,encode(D){return Lr(D,a,n)},decode(D){return xr(D,a,n,e)}}),Br=je({prefix:"\0",name:"identity",encode:e=>Or(e),decode:e=>Ur(e)}),jr=Object.freeze(Object.defineProperty({__proto__:null,identity:Br},Symbol.toStringTag,{value:"Module"})),Ir=Q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Rr=Object.freeze(Object.defineProperty({__proto__:null,base2:Ir},Symbol.toStringTag,{value:"Module"})),Pr=Q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Hr=Object.freeze(Object.defineProperty({__proto__:null,base8:Pr},Symbol.toStringTag,{value:"Module"})),Kr=Oe({prefix:"9",name:"base10",alphabet:"0123456789"}),zr=Object.freeze(Object.defineProperty({__proto__:null,base10:Kr},Symbol.toStringTag,{value:"Module"})),Yr=Q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),qr=Q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),$r=Object.freeze(Object.defineProperty({__proto__:null,base16:Yr,base16upper:qr},Symbol.toStringTag,{value:"Module"})),Gr=Q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Vr=Q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Wr=Q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Xr=Q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Jr=Q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Qr=Q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Zr=Q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),kr=Q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),en=Q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),tn=Object.freeze(Object.defineProperty({__proto__:null,base32:Gr,base32hex:Jr,base32hexpad:Zr,base32hexpadupper:kr,base32hexupper:Qr,base32pad:Wr,base32padupper:Xr,base32upper:Vr,base32z:en},Symbol.toStringTag,{value:"Module"})),rn=Oe({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nn=Oe({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),an=Object.freeze(Object.defineProperty({__proto__:null,base36:rn,base36upper:nn},Symbol.toStringTag,{value:"Module"})),un=Oe({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),fn=Oe({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),hn=Object.freeze(Object.defineProperty({__proto__:null,base58btc:un,base58flickr:fn},Symbol.toStringTag,{value:"Module"})),sn=Q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),on=Q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cn=Q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ln=Q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Dn=Object.freeze(Object.defineProperty({__proto__:null,base64:sn,base64pad:on,base64url:cn,base64urlpad:ln},Symbol.toStringTag,{value:"Module"})),Tt=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),_n=Tt.reduce((e,r,n)=>(e[n]=r,e),[]),dn=Tt.reduce((e,r,n)=>(e[r.codePointAt(0)]=n,e),[]);function En(e){return e.reduce((r,n)=>(r+=_n[n],r),"")}function bn(e){const r=[];for(const n of e){const a=dn[n.codePointAt(0)];if(a===void 0)throw new Error(`Non-base256emoji character: ${n}`);r.push(a)}return new Uint8Array(r)}const vn=je({prefix:"🚀",name:"base256emoji",encode:En,decode:bn}),wn=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:vn},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var Mt={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1,3 +1,3 @@
1
- "use strict";var yt=Object.defineProperty;var pt=(r,e,t)=>e in r?yt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var V=(r,e,t)=>(pt(r,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-B4AF-Mv-.js"),ht=require("./chain-BNKwvp-5.js"),$=require("./solana-D4Kn_xyO.js"),Le=require("./index-DnneI5--.js");class bt extends TypeError{constructor(e,t){let s;const{message:i,...a}=e,{path:u}=e,m=u.length===0?i:"At path: "+u.join(".")+" -- "+i;super(m),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>{var l;return(l=s)!=null?l:s=[e,...t()]}}}function St(r){return q(r)&&typeof r[Symbol.iterator]=="function"}function q(r){return typeof r=="object"&&r!=null}function W(r){return typeof r=="string"?JSON.stringify(r):""+r}function kt(r){const{done:e,value:t}=r.next();return e?void 0:t}function Mt(r,e,t,s){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});const{path:i,branch:a}=e,{type:u}=t,{refinement:m,message:l="Expected a value of type `"+u+"`"+(m?" with refinement `"+m+"`":"")+", but received: `"+W(s)+"`"}=r;return{value:s,type:u,refinement:m,key:i[i.length-1],path:i,branch:a,...r,message:l}}function*Re(r,e,t,s){St(r)||(r=[r]);for(const i of r){const a=Mt(i,e,t,s);a&&(yield a)}}function*ke(r,e,t={}){const{path:s=[],branch:i=[r],coerce:a=!1,mask:u=!1}=t,m={path:s,branch:i};if(a&&(r=e.coercer(r,m),u&&e.type!=="type"&&q(e.schema)&&q(r)&&!Array.isArray(r)))for(const b in r)e.schema[b]===void 0&&delete r[b];let l=!0;for(const b of e.validator(r,m))l=!1,yield[b,void 0];for(let[b,k,M]of e.entries(r,m)){const I=ke(k,M,{path:b===void 0?s:[...s,b],branch:b===void 0?i:[...i,k],coerce:a,mask:u});for(const v of I)v[0]?(l=!1,yield[v[0],void 0]):a&&(k=v[1],b===void 0?r=k:r instanceof Map?r.set(b,k):r instanceof Set?r.add(k):q(r)&&(r[b]=k))}if(l)for(const b of e.refiner(r,m))l=!1,yield[b,void 0];l&&(yield[void 0,r])}let U=class{constructor(e){const{type:t,schema:s,validator:i,refiner:a,coercer:u=l=>l,entries:m=function*(){}}=e;this.type=t,this.schema=s,this.entries=m,this.coercer=u,i?this.validator=(l,b)=>{const k=i(l,b);return Re(k,b,this,l)}:this.validator=()=>[],a?this.refiner=(l,b)=>{const k=a(l,b);return Re(k,b,this,l)}:this.refiner=()=>[]}assert(e){return wt(e,this)}create(e){return re(e,this)}is(e){return Ue(e,this)}mask(e){return Pt(e,this)}validate(e,t={}){return oe(e,this,t)}};function wt(r,e){const t=oe(r,e);if(t[0])throw t[0]}function re(r,e){const t=oe(r,e,{coerce:!0});if(t[0])throw t[0];return t[1]}function Pt(r,e){const t=oe(r,e,{coerce:!0,mask:!0});if(t[0])throw t[0];return t[1]}function Ue(r,e){return!oe(r,e)[0]}function oe(r,e,t={}){const s=ke(r,e,t),i=kt(s);return i[0]?[new bt(i[0],function*(){for(const u of s)u[0]&&(yield u[0])}),void 0]:[void 0,i[1]]}function H(r,e){return new U({type:r,schema:null,validator:e})}function At(){return H("any",()=>!0)}function g(r){return new U({type:"array",schema:r,*entries(e){if(r&&Array.isArray(e))for(const[t,s]of e.entries())yield[t,s,r]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+W(e)}})}function L(){return H("boolean",r=>typeof r=="boolean")}function Me(r){return H("instance",e=>e instanceof r||"Expected a `"+r.name+"` instance, but received: "+W(e))}function A(r){const e=W(r),t=typeof r;return new U({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?r:null,validator(s){return s===r||"Expected the literal `"+e+"`, but received: "+W(s)}})}function It(){return H("never",()=>!1)}function f(r){return new U({...r,validator:(e,t)=>e===null||r.validator(e,t),refiner:(e,t)=>e===null||r.refiner(e,t)})}function o(){return H("number",r=>typeof r=="number"&&!isNaN(r)||"Expected a number, but received: "+W(r))}function p(r){return new U({...r,validator:(e,t)=>e===void 0||r.validator(e,t),refiner:(e,t)=>e===void 0||r.refiner(e,t)})}function qe(r,e){return new U({type:"record",schema:null,*entries(t){if(q(t))for(const s in t){const i=t[s];yield[s,s,r],yield[s,i,e]}},validator(t){return q(t)||"Expected an object, but received: "+W(t)}})}function d(){return H("string",r=>typeof r=="string"||"Expected a string, but received: "+W(r))}function we(r){const e=It();return new U({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const s=Math.max(r.length,t.length);for(let i=0;i<s;i++)yield[i,t[i],r[i]||e]}},validator(t){return Array.isArray(t)||"Expected an array, but received: "+W(t)}})}function c(r){const e=Object.keys(r);return new U({type:"type",schema:r,*entries(t){if(q(t))for(const s of e)yield[s,t[s],r[s]]},validator(t){return q(t)||"Expected an object, but received: "+W(t)}})}function R(r){const e=r.map(t=>t.type).join(" | ");return new U({type:"union",schema:null,validator(t,s){const i=[];for(const a of r){const[...u]=ke(t,a,s),[m]=u;if(m[0])for(const[l]of u)l&&i.push(l);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+W(t),...i]}})}function ue(){return H("unknown",()=>!0)}function ce(r,e,t){return new U({...r,coercer:(s,i)=>Ue(s,e)?r.coercer(t(s,i),i):r.coercer(s,i)})}const Ee=()=>{const r=n.ed25519.utils.randomPrivateKey(),e=he(r),t=new Uint8Array(64);return t.set(r),t.set(e,32),{publicKey:e,secretKey:t}},he=n.ed25519.getPublicKey;function Ce(r){try{return n.ed25519.ExtendedPoint.fromHex(r),!0}catch{return!1}}const vt=(r,e)=>n.ed25519.sign(r,e.slice(0,32)),Tt=n.ed25519.verify,K=r=>n.bufferPolyfill.Buffer.isBuffer(r)?r:r instanceof Uint8Array?n.bufferPolyfill.Buffer.from(r.buffer,r.byteOffset,r.byteLength):n.bufferPolyfill.Buffer.from(r);class xt{constructor(e){Object.assign(this,e)}encode(){return n.bufferPolyfill.Buffer.from(n.serialize_1(de,this))}static decode(e){return n.deserialize_1(de,this,e)}static decodeUnchecked(e){return n.deserializeUnchecked_1(de,this,e)}}const de=new Map;var Fe;let Ve;const Bt=32,ne=32;function Kt(r){return r._bn!==void 0}let Oe=1;Ve=Symbol.toStringTag;class y extends xt{constructor(e){if(super({}),this._bn=void 0,Kt(e))this._bn=e._bn;else{if(typeof e=="string"){const t=n.bs58.decode(e);if(t.length!=ne)throw new Error("Invalid public key input");this._bn=new n.BN(t)}else this._bn=new n.BN(e);if(this._bn.byteLength()>ne)throw new Error("Invalid public key input")}}static unique(){const e=new y(Oe);return Oe+=1,new y(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return n.bs58.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(n.bufferPolyfill.Buffer);if(e.length===ne)return e;const t=n.bufferPolyfill.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Ve](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,s){const i=n.bufferPolyfill.Buffer.concat([e.toBuffer(),n.bufferPolyfill.Buffer.from(t),s.toBuffer()]),a=n.sha256(i);return new y(a)}static createProgramAddressSync(e,t){let s=n.bufferPolyfill.Buffer.alloc(0);e.forEach(function(a){if(a.length>Bt)throw new TypeError("Max seed length exceeded");s=n.bufferPolyfill.Buffer.concat([s,K(a)])}),s=n.bufferPolyfill.Buffer.concat([s,t.toBuffer(),n.bufferPolyfill.Buffer.from("ProgramDerivedAddress")]);const i=n.sha256(s);if(Ce(i))throw new Error("Invalid seeds, address must fall off the curve");return new y(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let s=255,i;for(;s!=0;){try{const a=e.concat(n.bufferPolyfill.Buffer.from([s]));i=this.createProgramAddressSync(a,t)}catch(a){if(a instanceof TypeError)throw a;s--;continue}return[i,s]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){const t=new y(e);return Ce(t.toBytes())}}Fe=y;y.default=new Fe("11111111111111111111111111111111");de.set(y,{kind:"struct",fields:[["_bn","u256"]]});new y("BPFLoader1111111111111111111111111111111111");const be=1232,Rt=127,He=64;class Ne{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const s=new Map;this.keySegments().flat().forEach((a,u)=>{s.set(a.toBase58(),u)});const i=a=>{const u=s.get(a.toBase58());if(u===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return u};return e.map(a=>({programIdIndex:i(a.programId),accountKeyIndexes:a.keys.map(u=>i(u.pubkey)),data:a.data}))}}const S=(r="publicKey")=>n.blob(32,r),J=(r="string")=>{const e=n.struct([n.u32("length"),n.u32("lengthPadding"),n.blob(n.offset(n.u32(),-8),"chars")],r),t=e.decode.bind(e),s=e.encode.bind(e),i=e;return i.decode=(a,u)=>t(a,u).chars.toString(),i.encode=(a,u,m)=>{const l={chars:n.bufferPolyfill.Buffer.from(a,"utf8")};return s(l,u,m)},i.alloc=a=>n.u32().span+n.u32().span+n.bufferPolyfill.Buffer.from(a,"utf8").length,i},Et=(r="authorized")=>n.struct([S("staker"),S("withdrawer")],r),Ct=(r="lockup")=>n.struct([n.ns64("unixTimestamp"),n.ns64("epoch"),S("custodian")],r),Ot=(r="voteInit")=>n.struct([S("nodePubkey"),S("authorizedVoter"),S("authorizedWithdrawer"),n.u8("commission")],r),Nt=(r="voteAuthorizeWithSeedArgs")=>n.struct([n.u32("voteAuthorizationType"),S("currentAuthorityDerivedKeyOwnerPubkey"),J("currentAuthorityDerivedKeySeed"),S("newAuthorized")],r);function je(r,e){const t=i=>{if(i.span>=0)return i.span;if(typeof i.alloc=="function")return i.alloc(e[i.property]);if("count"in i&&"elementLayout"in i){const a=e[i.property];if(Array.isArray(a))return a.length*t(i.elementLayout)}else if("fields"in i)return je({layout:i},e[i.property]);return 0};let s=0;return r.layout.fields.forEach(i=>{s+=t(i)}),s}function Q(r){let e=0,t=0;for(;;){let s=r.shift();if(e|=(s&127)<<t*7,t+=1,!(s&128))break}return e}function ee(r,e){let t=e;for(;;){let s=t&127;if(t>>=7,t==0){r.push(s);break}else s|=128,r.push(s)}}function C(r,e){if(!r)throw new Error(e||"Assertion failed")}class Pe{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const s=new Map,i=u=>{const m=u.toBase58();let l=s.get(m);return l===void 0&&(l={isSigner:!1,isWritable:!1,isInvoked:!1},s.set(m,l)),l},a=i(t);a.isSigner=!0,a.isWritable=!0;for(const u of e){i(u.programId).isInvoked=!0;for(const m of u.keys){const l=i(m.pubkey);l.isSigner||(l.isSigner=m.isSigner),l.isWritable||(l.isWritable=m.isWritable)}}return new Pe(t,s)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];C(e.length<=256,"Max static account keys length exceeded");const t=e.filter(([,l])=>l.isSigner&&l.isWritable),s=e.filter(([,l])=>l.isSigner&&!l.isWritable),i=e.filter(([,l])=>!l.isSigner&&l.isWritable),a=e.filter(([,l])=>!l.isSigner&&!l.isWritable),u={numRequiredSignatures:t.length+s.length,numReadonlySignedAccounts:s.length,numReadonlyUnsignedAccounts:a.length};{C(t.length>0,"Expected at least one writable signer key");const[l]=t[0];C(l===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const m=[...t.map(([l])=>new y(l)),...s.map(([l])=>new y(l)),...i.map(([l])=>new y(l)),...a.map(([l])=>new y(l))];return[u,m]}extractTableLookup(e){const[t,s]=this.drainKeysFoundInLookupTable(e.state.addresses,u=>!u.isSigner&&!u.isInvoked&&u.isWritable),[i,a]=this.drainKeysFoundInLookupTable(e.state.addresses,u=>!u.isSigner&&!u.isInvoked&&!u.isWritable);if(!(t.length===0&&i.length===0))return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:i},{writable:s,readonly:a}]}drainKeysFoundInLookupTable(e,t){const s=new Array,i=new Array;for(const[a,u]of this.keyMetaMap.entries())if(t(u)){const m=new y(a),l=e.findIndex(b=>b.equals(m));l>=0&&(C(l<256,"Max lookup table index exceeded"),s.push(l),i.push(m),this.keyMetaMap.delete(a))}return[s,i]}}const Ge="Reached end of buffer unexpectedly";function le(r){if(r.length===0)throw new Error(Ge);return r.shift()}function te(r,...e){const[t]=e;if(e.length===2?t+(e[1]??0)>r.length:t>=r.length)throw new Error(Ge);return r.splice(...e)}class ie{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(t=>new y(t)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:n.bs58.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Ne(this.staticAccountKeys)}static compile(e){const t=Pe.compile(e.instructions,e.payerKey),[s,i]=t.getMessageComponents(),u=new Ne(i).compileInstructions(e.instructions).map(m=>({programIdIndex:m.programIdIndex,accounts:m.accountKeyIndexes,data:n.bs58.encode(m.data)}));return new ie({header:s,accountKeys:i,recentBlockhash:e.recentBlockhash,instructions:u})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const s=e-t,a=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return s<a}else{const s=t-this.header.numReadonlySignedAccounts;return e<s}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){const e=this.accountKeys.length;let t=[];ee(t,e);const s=this.instructions.map(M=>{const{accounts:I,programIdIndex:v}=M,E=Array.from(n.bs58.decode(M.data));let h=[];ee(h,I.length);let w=[];return ee(w,E.length),{programIdIndex:v,keyIndicesCount:n.bufferPolyfill.Buffer.from(h),keyIndices:I,dataLength:n.bufferPolyfill.Buffer.from(w),data:E}});let i=[];ee(i,s.length);let a=n.bufferPolyfill.Buffer.alloc(be);n.bufferPolyfill.Buffer.from(i).copy(a);let u=i.length;s.forEach(M=>{const v=n.struct([n.u8("programIdIndex"),n.blob(M.keyIndicesCount.length,"keyIndicesCount"),n.seq(n.u8("keyIndex"),M.keyIndices.length,"keyIndices"),n.blob(M.dataLength.length,"dataLength"),n.seq(n.u8("userdatum"),M.data.length,"data")]).encode(M,a,u);u+=v}),a=a.slice(0,u);const m=n.struct([n.blob(1,"numRequiredSignatures"),n.blob(1,"numReadonlySignedAccounts"),n.blob(1,"numReadonlyUnsignedAccounts"),n.blob(t.length,"keyCount"),n.seq(S("key"),e,"keys"),S("recentBlockhash")]),l={numRequiredSignatures:n.bufferPolyfill.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:n.bufferPolyfill.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:n.bufferPolyfill.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:n.bufferPolyfill.Buffer.from(t),keys:this.accountKeys.map(M=>K(M.toBytes())),recentBlockhash:n.bs58.decode(this.recentBlockhash)};let b=n.bufferPolyfill.Buffer.alloc(2048);const k=m.encode(l,b);return a.copy(b,k),b.slice(0,k+a.length)}static from(e){let t=[...e];const s=le(t);if(s!==(s&Rt))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=le(t),a=le(t),u=Q(t);let m=[];for(let I=0;I<u;I++){const v=te(t,0,ne);m.push(new y(n.bufferPolyfill.Buffer.from(v)))}const l=te(t,0,ne),b=Q(t);let k=[];for(let I=0;I<b;I++){const v=le(t),E=Q(t),h=te(t,0,E),w=Q(t),T=te(t,0,w),F=n.bs58.encode(n.bufferPolyfill.Buffer.from(T));k.push({programIdIndex:v,accounts:h,data:F})}const M={header:{numRequiredSignatures:s,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:a},recentBlockhash:n.bs58.encode(n.bufferPolyfill.Buffer.from(l)),accountKeys:m,instructions:k};return new ie(M)}}const _t=n.bufferPolyfill.Buffer.alloc(He).fill(0);class z{constructor(e){this.keys=void 0,this.programId=void 0,this.data=n.bufferPolyfill.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:s})=>({pubkey:e.toJSON(),isSigner:t,isWritable:s})),programId:this.programId.toJSON(),data:[...this.data]}}}class X{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:s}=e;this.minNonceContextSlot=t,this.nonceInfo=s}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:s}=e;this.recentBlockhash=t,this.lastValidBlockHeight=s}else{const{recentBlockhash:t,nonceInfo:s}=e;s&&(this.nonceInfo=s),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new z(t))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?t=[this.nonceInfo.nonceInstruction,...this.instructions]:t=this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");t.length<1&&console.warn("No instructions provided");let s;if(this.feePayer)s=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)s=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let h=0;h<t.length;h++)if(t[h].programId===void 0)throw new Error(`Transaction instruction index ${h} has undefined program id`);const i=[],a=[];t.forEach(h=>{h.keys.forEach(T=>{a.push({...T})});const w=h.programId.toString();i.includes(w)||i.push(w)}),i.forEach(h=>{a.push({pubkey:new y(h),isSigner:!1,isWritable:!1})});const u=[];a.forEach(h=>{const w=h.pubkey.toString(),T=u.findIndex(F=>F.pubkey.toString()===w);T>-1?(u[T].isWritable=u[T].isWritable||h.isWritable,u[T].isSigner=u[T].isSigner||h.isSigner):u.push(h)}),u.sort(function(h,w){if(h.isSigner!==w.isSigner)return h.isSigner?-1:1;if(h.isWritable!==w.isWritable)return h.isWritable?-1:1;const T={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return h.pubkey.toBase58().localeCompare(w.pubkey.toBase58(),"en",T)});const m=u.findIndex(h=>h.pubkey.equals(s));if(m>-1){const[h]=u.splice(m,1);h.isSigner=!0,h.isWritable=!0,u.unshift(h)}else u.unshift({pubkey:s,isSigner:!0,isWritable:!0});for(const h of this.signatures){const w=u.findIndex(T=>T.pubkey.equals(h.publicKey));if(w>-1)u[w].isSigner||(u[w].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${h.publicKey.toString()}`)}let l=0,b=0,k=0;const M=[],I=[];u.forEach(({pubkey:h,isSigner:w,isWritable:T})=>{w?(M.push(h.toString()),l+=1,T||(b+=1)):(I.push(h.toString()),T||(k+=1))});const v=M.concat(I),E=t.map(h=>{const{data:w,programId:T}=h;return{programIdIndex:v.indexOf(T.toString()),accounts:h.keys.map(F=>v.indexOf(F.pubkey.toString())),data:n.bs58.encode(w)}});return E.forEach(h=>{C(h.programIdIndex>=0),h.accounts.forEach(w=>C(w>=0))}),new ie({header:{numRequiredSignatures:l,numReadonlySignedAccounts:b,numReadonlyUnsignedAccounts:k},accountKeys:v,recentBlockhash:e,instructions:E})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((i,a)=>t[a].equals(i.publicKey))||(this.signatures=t.map(s=>({signature:null,publicKey:s}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const t=new Set;this.signatures=e.filter(s=>{const i=s.toString();return t.has(i)?!1:(t.add(i),!0)}).map(s=>({signature:null,publicKey:s}))}sign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,s=[];for(const a of e){const u=a.publicKey.toString();t.has(u)||(t.add(u),s.push(a))}this.signatures=s.map(a=>({signature:null,publicKey:a.publicKey}));const i=this._compile();this._partialSign(i,...s)}partialSign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,s=[];for(const a of e){const u=a.publicKey.toString();t.has(u)||(t.add(u),s.push(a))}const i=this._compile();this._partialSign(i,...s)}_partialSign(e,...t){const s=e.serialize();t.forEach(i=>{const a=vt(s,i.secretKey);this._addSignature(i.publicKey,K(a))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){C(t.length===64);const s=this.signatures.findIndex(i=>e.equals(i.publicKey));if(s<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[s].signature=n.bufferPolyfill.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const s={};for(const{signature:i,publicKey:a}of this.signatures)i===null?t&&(s.missing||(s.missing=[])).push(a):Tt(i,e,a.toBytes())||(s.invalid||(s.invalid=[])).push(a);return s.invalid||s.missing?s:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:s}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),i=this.serializeMessage();if(s){const a=this._getMessageSignednessErrors(i,t);if(a){let u="Signature verification failed.";throw a.invalid&&(u+=`
1
+ "use strict";var yt=Object.defineProperty;var pt=(r,e,t)=>e in r?yt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var V=(r,e,t)=>(pt(r,typeof e!="symbol"?e+"":e,t),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-s2bgjlxF.js"),ht=require("./chain-Bq0KV5Nv.js"),$=require("./solana-DFbLZfms.js"),Le=require("./index-DnneI5--.js");class bt extends TypeError{constructor(e,t){let s;const{message:i,...a}=e,{path:u}=e,m=u.length===0?i:"At path: "+u.join(".")+" -- "+i;super(m),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>{var l;return(l=s)!=null?l:s=[e,...t()]}}}function St(r){return q(r)&&typeof r[Symbol.iterator]=="function"}function q(r){return typeof r=="object"&&r!=null}function W(r){return typeof r=="string"?JSON.stringify(r):""+r}function kt(r){const{done:e,value:t}=r.next();return e?void 0:t}function Mt(r,e,t,s){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});const{path:i,branch:a}=e,{type:u}=t,{refinement:m,message:l="Expected a value of type `"+u+"`"+(m?" with refinement `"+m+"`":"")+", but received: `"+W(s)+"`"}=r;return{value:s,type:u,refinement:m,key:i[i.length-1],path:i,branch:a,...r,message:l}}function*Re(r,e,t,s){St(r)||(r=[r]);for(const i of r){const a=Mt(i,e,t,s);a&&(yield a)}}function*ke(r,e,t={}){const{path:s=[],branch:i=[r],coerce:a=!1,mask:u=!1}=t,m={path:s,branch:i};if(a&&(r=e.coercer(r,m),u&&e.type!=="type"&&q(e.schema)&&q(r)&&!Array.isArray(r)))for(const b in r)e.schema[b]===void 0&&delete r[b];let l=!0;for(const b of e.validator(r,m))l=!1,yield[b,void 0];for(let[b,k,M]of e.entries(r,m)){const I=ke(k,M,{path:b===void 0?s:[...s,b],branch:b===void 0?i:[...i,k],coerce:a,mask:u});for(const v of I)v[0]?(l=!1,yield[v[0],void 0]):a&&(k=v[1],b===void 0?r=k:r instanceof Map?r.set(b,k):r instanceof Set?r.add(k):q(r)&&(r[b]=k))}if(l)for(const b of e.refiner(r,m))l=!1,yield[b,void 0];l&&(yield[void 0,r])}let U=class{constructor(e){const{type:t,schema:s,validator:i,refiner:a,coercer:u=l=>l,entries:m=function*(){}}=e;this.type=t,this.schema=s,this.entries=m,this.coercer=u,i?this.validator=(l,b)=>{const k=i(l,b);return Re(k,b,this,l)}:this.validator=()=>[],a?this.refiner=(l,b)=>{const k=a(l,b);return Re(k,b,this,l)}:this.refiner=()=>[]}assert(e){return wt(e,this)}create(e){return re(e,this)}is(e){return Ue(e,this)}mask(e){return Pt(e,this)}validate(e,t={}){return oe(e,this,t)}};function wt(r,e){const t=oe(r,e);if(t[0])throw t[0]}function re(r,e){const t=oe(r,e,{coerce:!0});if(t[0])throw t[0];return t[1]}function Pt(r,e){const t=oe(r,e,{coerce:!0,mask:!0});if(t[0])throw t[0];return t[1]}function Ue(r,e){return!oe(r,e)[0]}function oe(r,e,t={}){const s=ke(r,e,t),i=kt(s);return i[0]?[new bt(i[0],function*(){for(const u of s)u[0]&&(yield u[0])}),void 0]:[void 0,i[1]]}function H(r,e){return new U({type:r,schema:null,validator:e})}function At(){return H("any",()=>!0)}function g(r){return new U({type:"array",schema:r,*entries(e){if(r&&Array.isArray(e))for(const[t,s]of e.entries())yield[t,s,r]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||"Expected an array value, but received: "+W(e)}})}function L(){return H("boolean",r=>typeof r=="boolean")}function Me(r){return H("instance",e=>e instanceof r||"Expected a `"+r.name+"` instance, but received: "+W(e))}function A(r){const e=W(r),t=typeof r;return new U({type:"literal",schema:t==="string"||t==="number"||t==="boolean"?r:null,validator(s){return s===r||"Expected the literal `"+e+"`, but received: "+W(s)}})}function It(){return H("never",()=>!1)}function f(r){return new U({...r,validator:(e,t)=>e===null||r.validator(e,t),refiner:(e,t)=>e===null||r.refiner(e,t)})}function o(){return H("number",r=>typeof r=="number"&&!isNaN(r)||"Expected a number, but received: "+W(r))}function p(r){return new U({...r,validator:(e,t)=>e===void 0||r.validator(e,t),refiner:(e,t)=>e===void 0||r.refiner(e,t)})}function qe(r,e){return new U({type:"record",schema:null,*entries(t){if(q(t))for(const s in t){const i=t[s];yield[s,s,r],yield[s,i,e]}},validator(t){return q(t)||"Expected an object, but received: "+W(t)}})}function d(){return H("string",r=>typeof r=="string"||"Expected a string, but received: "+W(r))}function we(r){const e=It();return new U({type:"tuple",schema:null,*entries(t){if(Array.isArray(t)){const s=Math.max(r.length,t.length);for(let i=0;i<s;i++)yield[i,t[i],r[i]||e]}},validator(t){return Array.isArray(t)||"Expected an array, but received: "+W(t)}})}function c(r){const e=Object.keys(r);return new U({type:"type",schema:r,*entries(t){if(q(t))for(const s of e)yield[s,t[s],r[s]]},validator(t){return q(t)||"Expected an object, but received: "+W(t)}})}function R(r){const e=r.map(t=>t.type).join(" | ");return new U({type:"union",schema:null,validator(t,s){const i=[];for(const a of r){const[...u]=ke(t,a,s),[m]=u;if(m[0])for(const[l]of u)l&&i.push(l);else return[]}return["Expected the value to satisfy a union of `"+e+"`, but received: "+W(t),...i]}})}function ue(){return H("unknown",()=>!0)}function ce(r,e,t){return new U({...r,coercer:(s,i)=>Ue(s,e)?r.coercer(t(s,i),i):r.coercer(s,i)})}const Ee=()=>{const r=n.ed25519.utils.randomPrivateKey(),e=he(r),t=new Uint8Array(64);return t.set(r),t.set(e,32),{publicKey:e,secretKey:t}},he=n.ed25519.getPublicKey;function Ce(r){try{return n.ed25519.ExtendedPoint.fromHex(r),!0}catch{return!1}}const vt=(r,e)=>n.ed25519.sign(r,e.slice(0,32)),Tt=n.ed25519.verify,K=r=>n.bufferPolyfill.Buffer.isBuffer(r)?r:r instanceof Uint8Array?n.bufferPolyfill.Buffer.from(r.buffer,r.byteOffset,r.byteLength):n.bufferPolyfill.Buffer.from(r);class xt{constructor(e){Object.assign(this,e)}encode(){return n.bufferPolyfill.Buffer.from(n.serialize_1(de,this))}static decode(e){return n.deserialize_1(de,this,e)}static decodeUnchecked(e){return n.deserializeUnchecked_1(de,this,e)}}const de=new Map;var Fe;let Ve;const Bt=32,ne=32;function Kt(r){return r._bn!==void 0}let Oe=1;Ve=Symbol.toStringTag;class y extends xt{constructor(e){if(super({}),this._bn=void 0,Kt(e))this._bn=e._bn;else{if(typeof e=="string"){const t=n.bs58.decode(e);if(t.length!=ne)throw new Error("Invalid public key input");this._bn=new n.BN(t)}else this._bn=new n.BN(e);if(this._bn.byteLength()>ne)throw new Error("Invalid public key input")}}static unique(){const e=new y(Oe);return Oe+=1,new y(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return n.bs58.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(n.bufferPolyfill.Buffer);if(e.length===ne)return e;const t=n.bufferPolyfill.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Ve](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,s){const i=n.bufferPolyfill.Buffer.concat([e.toBuffer(),n.bufferPolyfill.Buffer.from(t),s.toBuffer()]),a=n.sha256(i);return new y(a)}static createProgramAddressSync(e,t){let s=n.bufferPolyfill.Buffer.alloc(0);e.forEach(function(a){if(a.length>Bt)throw new TypeError("Max seed length exceeded");s=n.bufferPolyfill.Buffer.concat([s,K(a)])}),s=n.bufferPolyfill.Buffer.concat([s,t.toBuffer(),n.bufferPolyfill.Buffer.from("ProgramDerivedAddress")]);const i=n.sha256(s);if(Ce(i))throw new Error("Invalid seeds, address must fall off the curve");return new y(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let s=255,i;for(;s!=0;){try{const a=e.concat(n.bufferPolyfill.Buffer.from([s]));i=this.createProgramAddressSync(a,t)}catch(a){if(a instanceof TypeError)throw a;s--;continue}return[i,s]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){const t=new y(e);return Ce(t.toBytes())}}Fe=y;y.default=new Fe("11111111111111111111111111111111");de.set(y,{kind:"struct",fields:[["_bn","u256"]]});new y("BPFLoader1111111111111111111111111111111111");const be=1232,Rt=127,He=64;class Ne{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const s=new Map;this.keySegments().flat().forEach((a,u)=>{s.set(a.toBase58(),u)});const i=a=>{const u=s.get(a.toBase58());if(u===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return u};return e.map(a=>({programIdIndex:i(a.programId),accountKeyIndexes:a.keys.map(u=>i(u.pubkey)),data:a.data}))}}const S=(r="publicKey")=>n.blob(32,r),J=(r="string")=>{const e=n.struct([n.u32("length"),n.u32("lengthPadding"),n.blob(n.offset(n.u32(),-8),"chars")],r),t=e.decode.bind(e),s=e.encode.bind(e),i=e;return i.decode=(a,u)=>t(a,u).chars.toString(),i.encode=(a,u,m)=>{const l={chars:n.bufferPolyfill.Buffer.from(a,"utf8")};return s(l,u,m)},i.alloc=a=>n.u32().span+n.u32().span+n.bufferPolyfill.Buffer.from(a,"utf8").length,i},Et=(r="authorized")=>n.struct([S("staker"),S("withdrawer")],r),Ct=(r="lockup")=>n.struct([n.ns64("unixTimestamp"),n.ns64("epoch"),S("custodian")],r),Ot=(r="voteInit")=>n.struct([S("nodePubkey"),S("authorizedVoter"),S("authorizedWithdrawer"),n.u8("commission")],r),Nt=(r="voteAuthorizeWithSeedArgs")=>n.struct([n.u32("voteAuthorizationType"),S("currentAuthorityDerivedKeyOwnerPubkey"),J("currentAuthorityDerivedKeySeed"),S("newAuthorized")],r);function je(r,e){const t=i=>{if(i.span>=0)return i.span;if(typeof i.alloc=="function")return i.alloc(e[i.property]);if("count"in i&&"elementLayout"in i){const a=e[i.property];if(Array.isArray(a))return a.length*t(i.elementLayout)}else if("fields"in i)return je({layout:i},e[i.property]);return 0};let s=0;return r.layout.fields.forEach(i=>{s+=t(i)}),s}function Q(r){let e=0,t=0;for(;;){let s=r.shift();if(e|=(s&127)<<t*7,t+=1,!(s&128))break}return e}function ee(r,e){let t=e;for(;;){let s=t&127;if(t>>=7,t==0){r.push(s);break}else s|=128,r.push(s)}}function C(r,e){if(!r)throw new Error(e||"Assertion failed")}class Pe{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){const s=new Map,i=u=>{const m=u.toBase58();let l=s.get(m);return l===void 0&&(l={isSigner:!1,isWritable:!1,isInvoked:!1},s.set(m,l)),l},a=i(t);a.isSigner=!0,a.isWritable=!0;for(const u of e){i(u.programId).isInvoked=!0;for(const m of u.keys){const l=i(m.pubkey);l.isSigner||(l.isSigner=m.isSigner),l.isWritable||(l.isWritable=m.isWritable)}}return new Pe(t,s)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];C(e.length<=256,"Max static account keys length exceeded");const t=e.filter(([,l])=>l.isSigner&&l.isWritable),s=e.filter(([,l])=>l.isSigner&&!l.isWritable),i=e.filter(([,l])=>!l.isSigner&&l.isWritable),a=e.filter(([,l])=>!l.isSigner&&!l.isWritable),u={numRequiredSignatures:t.length+s.length,numReadonlySignedAccounts:s.length,numReadonlyUnsignedAccounts:a.length};{C(t.length>0,"Expected at least one writable signer key");const[l]=t[0];C(l===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const m=[...t.map(([l])=>new y(l)),...s.map(([l])=>new y(l)),...i.map(([l])=>new y(l)),...a.map(([l])=>new y(l))];return[u,m]}extractTableLookup(e){const[t,s]=this.drainKeysFoundInLookupTable(e.state.addresses,u=>!u.isSigner&&!u.isInvoked&&u.isWritable),[i,a]=this.drainKeysFoundInLookupTable(e.state.addresses,u=>!u.isSigner&&!u.isInvoked&&!u.isWritable);if(!(t.length===0&&i.length===0))return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:i},{writable:s,readonly:a}]}drainKeysFoundInLookupTable(e,t){const s=new Array,i=new Array;for(const[a,u]of this.keyMetaMap.entries())if(t(u)){const m=new y(a),l=e.findIndex(b=>b.equals(m));l>=0&&(C(l<256,"Max lookup table index exceeded"),s.push(l),i.push(m),this.keyMetaMap.delete(a))}return[s,i]}}const Ge="Reached end of buffer unexpectedly";function le(r){if(r.length===0)throw new Error(Ge);return r.shift()}function te(r,...e){const[t]=e;if(e.length===2?t+(e[1]??0)>r.length:t>=r.length)throw new Error(Ge);return r.splice(...e)}class ie{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(t=>new y(t)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(t=>this.indexToProgramIds.set(t.programIdIndex,this.accountKeys[t.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:n.bs58.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Ne(this.staticAccountKeys)}static compile(e){const t=Pe.compile(e.instructions,e.payerKey),[s,i]=t.getMessageComponents(),u=new Ne(i).compileInstructions(e.instructions).map(m=>({programIdIndex:m.programIdIndex,accounts:m.accountKeyIndexes,data:n.bs58.encode(m.data)}));return new ie({header:s,accountKeys:i,recentBlockhash:e.recentBlockhash,instructions:u})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const t=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const s=e-t,a=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return s<a}else{const s=t-this.header.numReadonlySignedAccounts;return e<s}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){const e=this.accountKeys.length;let t=[];ee(t,e);const s=this.instructions.map(M=>{const{accounts:I,programIdIndex:v}=M,E=Array.from(n.bs58.decode(M.data));let h=[];ee(h,I.length);let w=[];return ee(w,E.length),{programIdIndex:v,keyIndicesCount:n.bufferPolyfill.Buffer.from(h),keyIndices:I,dataLength:n.bufferPolyfill.Buffer.from(w),data:E}});let i=[];ee(i,s.length);let a=n.bufferPolyfill.Buffer.alloc(be);n.bufferPolyfill.Buffer.from(i).copy(a);let u=i.length;s.forEach(M=>{const v=n.struct([n.u8("programIdIndex"),n.blob(M.keyIndicesCount.length,"keyIndicesCount"),n.seq(n.u8("keyIndex"),M.keyIndices.length,"keyIndices"),n.blob(M.dataLength.length,"dataLength"),n.seq(n.u8("userdatum"),M.data.length,"data")]).encode(M,a,u);u+=v}),a=a.slice(0,u);const m=n.struct([n.blob(1,"numRequiredSignatures"),n.blob(1,"numReadonlySignedAccounts"),n.blob(1,"numReadonlyUnsignedAccounts"),n.blob(t.length,"keyCount"),n.seq(S("key"),e,"keys"),S("recentBlockhash")]),l={numRequiredSignatures:n.bufferPolyfill.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:n.bufferPolyfill.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:n.bufferPolyfill.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:n.bufferPolyfill.Buffer.from(t),keys:this.accountKeys.map(M=>K(M.toBytes())),recentBlockhash:n.bs58.decode(this.recentBlockhash)};let b=n.bufferPolyfill.Buffer.alloc(2048);const k=m.encode(l,b);return a.copy(b,k),b.slice(0,k+a.length)}static from(e){let t=[...e];const s=le(t);if(s!==(s&Rt))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=le(t),a=le(t),u=Q(t);let m=[];for(let I=0;I<u;I++){const v=te(t,0,ne);m.push(new y(n.bufferPolyfill.Buffer.from(v)))}const l=te(t,0,ne),b=Q(t);let k=[];for(let I=0;I<b;I++){const v=le(t),E=Q(t),h=te(t,0,E),w=Q(t),T=te(t,0,w),F=n.bs58.encode(n.bufferPolyfill.Buffer.from(T));k.push({programIdIndex:v,accounts:h,data:F})}const M={header:{numRequiredSignatures:s,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:a},recentBlockhash:n.bs58.encode(n.bufferPolyfill.Buffer.from(l)),accountKeys:m,instructions:k};return new ie(M)}}const _t=n.bufferPolyfill.Buffer.alloc(He).fill(0);class z{constructor(e){this.keys=void 0,this.programId=void 0,this.data=n.bufferPolyfill.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:s})=>({pubkey:e.toJSON(),isSigner:t,isWritable:s})),programId:this.programId.toJSON(),data:[...this.data]}}}class X{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:t,nonceInfo:s}=e;this.minNonceContextSlot=t,this.nonceInfo=s}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:t,lastValidBlockHeight:s}=e;this.recentBlockhash=t,this.lastValidBlockHeight=s}else{const{recentBlockhash:t,nonceInfo:s}=e;s&&(this.nonceInfo=s),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(t=>{"instructions"in t?this.instructions=this.instructions.concat(t.instructions):"data"in t&&"programId"in t&&"keys"in t?this.instructions.push(t):this.instructions.push(new z(t))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,t;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?t=[this.nonceInfo.nonceInstruction,...this.instructions]:t=this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw new Error("Transaction recentBlockhash required");t.length<1&&console.warn("No instructions provided");let s;if(this.feePayer)s=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)s=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let h=0;h<t.length;h++)if(t[h].programId===void 0)throw new Error(`Transaction instruction index ${h} has undefined program id`);const i=[],a=[];t.forEach(h=>{h.keys.forEach(T=>{a.push({...T})});const w=h.programId.toString();i.includes(w)||i.push(w)}),i.forEach(h=>{a.push({pubkey:new y(h),isSigner:!1,isWritable:!1})});const u=[];a.forEach(h=>{const w=h.pubkey.toString(),T=u.findIndex(F=>F.pubkey.toString()===w);T>-1?(u[T].isWritable=u[T].isWritable||h.isWritable,u[T].isSigner=u[T].isSigner||h.isSigner):u.push(h)}),u.sort(function(h,w){if(h.isSigner!==w.isSigner)return h.isSigner?-1:1;if(h.isWritable!==w.isWritable)return h.isWritable?-1:1;const T={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return h.pubkey.toBase58().localeCompare(w.pubkey.toBase58(),"en",T)});const m=u.findIndex(h=>h.pubkey.equals(s));if(m>-1){const[h]=u.splice(m,1);h.isSigner=!0,h.isWritable=!0,u.unshift(h)}else u.unshift({pubkey:s,isSigner:!0,isWritable:!0});for(const h of this.signatures){const w=u.findIndex(T=>T.pubkey.equals(h.publicKey));if(w>-1)u[w].isSigner||(u[w].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${h.publicKey.toString()}`)}let l=0,b=0,k=0;const M=[],I=[];u.forEach(({pubkey:h,isSigner:w,isWritable:T})=>{w?(M.push(h.toString()),l+=1,T||(b+=1)):(I.push(h.toString()),T||(k+=1))});const v=M.concat(I),E=t.map(h=>{const{data:w,programId:T}=h;return{programIdIndex:v.indexOf(T.toString()),accounts:h.keys.map(F=>v.indexOf(F.pubkey.toString())),data:n.bs58.encode(w)}});return E.forEach(h=>{C(h.programIdIndex>=0),h.accounts.forEach(w=>C(w>=0))}),new ie({header:{numRequiredSignatures:l,numReadonlySignedAccounts:b,numReadonlyUnsignedAccounts:k},accountKeys:v,recentBlockhash:e,instructions:E})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((i,a)=>t[a].equals(i.publicKey))||(this.signatures=t.map(s=>({signature:null,publicKey:s}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const t=new Set;this.signatures=e.filter(s=>{const i=s.toString();return t.has(i)?!1:(t.add(i),!0)}).map(s=>({signature:null,publicKey:s}))}sign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,s=[];for(const a of e){const u=a.publicKey.toString();t.has(u)||(t.add(u),s.push(a))}this.signatures=s.map(a=>({signature:null,publicKey:a.publicKey}));const i=this._compile();this._partialSign(i,...s)}partialSign(...e){if(e.length===0)throw new Error("No signers");const t=new Set,s=[];for(const a of e){const u=a.publicKey.toString();t.has(u)||(t.add(u),s.push(a))}const i=this._compile();this._partialSign(i,...s)}_partialSign(e,...t){const s=e.serialize();t.forEach(i=>{const a=vt(s,i.secretKey);this._addSignature(i.publicKey,K(a))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){C(t.length===64);const s=this.signatures.findIndex(i=>e.equals(i.publicKey));if(s<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[s].signature=n.bufferPolyfill.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){const s={};for(const{signature:i,publicKey:a}of this.signatures)i===null?t&&(s.missing||(s.missing=[])).push(a):Tt(i,e,a.toBytes())||(s.invalid||(s.invalid=[])).push(a);return s.invalid||s.missing?s:void 0}serialize(e){const{requireAllSignatures:t,verifySignatures:s}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),i=this.serializeMessage();if(s){const a=this._getMessageSignednessErrors(i,t);if(a){let u="Signature verification failed.";throw a.invalid&&(u+=`
2
2
  Invalid signature for public key${a.invalid.length===1?"":"(s)"} [\`${a.invalid.map(m=>m.toBase58()).join("`, `")}\`].`),a.missing&&(u+=`
3
3
  Missing signature for public key${a.missing.length===1?"":"(s)"} [\`${a.missing.map(m=>m.toBase58()).join("`, `")}\`].`),new Error(u)}}return this._serialize(i)}_serialize(e){const{signatures:t}=this,s=[];ee(s,t.length);const i=s.length+t.length*64+e.length,a=n.bufferPolyfill.Buffer.alloc(i);return C(t.length<256),n.bufferPolyfill.Buffer.from(s).copy(a,0),t.forEach(({signature:u},m)=>{u!==null&&(C(u.length===64,"signature has invalid length"),n.bufferPolyfill.Buffer.from(u).copy(a,s.length+m*64))}),e.copy(a,s.length+t.length*64),C(a.length<=be,`Transaction too large: ${a.length} > ${be}`),a}get keys(){return C(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return C(this.instructions.length===1),this.instructions[0].programId}get data(){return C(this.instructions.length===1),this.instructions[0].data}static from(e){let t=[...e];const s=Q(t);let i=[];for(let a=0;a<s;a++){const u=te(t,0,He);i.push(n.bs58.encode(n.bufferPolyfill.Buffer.from(u)))}return X.populate(ie.from(t),i)}static populate(e,t=[]){const s=new X;return s.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(s.feePayer=e.accountKeys[0]),t.forEach((i,a)=>{const u={signature:i==n.bs58.encode(_t)?null:n.bs58.decode(i),publicKey:e.accountKeys[a]};s.signatures.push(u)}),e.instructions.forEach(i=>{const a=i.accounts.map(u=>{const m=e.accountKeys[u];return{pubkey:m,isSigner:s.signatures.some(l=>l.publicKey.toString()===m.toString())||e.isAccountSigner(u),isWritable:e.isAccountWritable(u)}});s.instructions.push(new z({keys:a,programId:e.accountKeys[i.programIdIndex],data:n.bs58.decode(i.data)}))}),s._message=e,s._json=s.toJSON(),s}}new y("SysvarC1ock11111111111111111111111111111111");new y("SysvarEpochSchedu1e111111111111111111111111");new y("Sysvar1nstructions1111111111111111111111111");const pe=new y("SysvarRecentB1ockHashes11111111111111111111"),_e=new y("SysvarRent111111111111111111111111111111111");new y("SysvarRewards111111111111111111111111111111");new y("SysvarS1otHashes111111111111111111111111111");new y("SysvarS1otHistory11111111111111111111111111");new y("SysvarStakeHistory1111111111111111111111111");function O(r,e){const t=r.layout.span>=0?r.layout.span:je(r,e),s=n.bufferPolyfill.Buffer.alloc(t),i=Object.assign({instruction:r.index},e);return r.layout.encode(i,s),s}const Dt=n.nu64("lamportsPerSignature"),zt=n.struct([n.u32("version"),n.u32("state"),S("authorizedPubkey"),S("nonce"),n.struct([Dt],"feeCalculator")]),De=zt.span,Wt=r=>{const e=r.decode.bind(r),t=r.encode.bind(r);return{decode:e,encode:t}},Lt=r=>e=>{const t=n.blob(r,e),{encode:s,decode:i}=Wt(t),a=t;return a.decode=(u,m)=>{const l=i(u,m);return n.toBigIntLE_1(n.bufferPolyfill.Buffer.from(l))},a.encode=(u,m,l)=>{const b=n.toBufferLE_1(u,r);return s(b,m,l)},a},Y=Lt(8),N=Object.freeze({Create:{index:0,layout:n.struct([n.u32("instruction"),n.ns64("lamports"),n.ns64("space"),S("programId")])},Assign:{index:1,layout:n.struct([n.u32("instruction"),S("programId")])},Transfer:{index:2,layout:n.struct([n.u32("instruction"),Y("lamports")])},CreateWithSeed:{index:3,layout:n.struct([n.u32("instruction"),S("base"),J("seed"),n.ns64("lamports"),n.ns64("space"),S("programId")])},AdvanceNonceAccount:{index:4,layout:n.struct([n.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:n.struct([n.u32("instruction"),n.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:n.struct([n.u32("instruction"),S("authorized")])},AuthorizeNonceAccount:{index:7,layout:n.struct([n.u32("instruction"),S("authorized")])},Allocate:{index:8,layout:n.struct([n.u32("instruction"),n.ns64("space")])},AllocateWithSeed:{index:9,layout:n.struct([n.u32("instruction"),S("base"),J("seed"),n.ns64("space"),S("programId")])},AssignWithSeed:{index:10,layout:n.struct([n.u32("instruction"),S("base"),J("seed"),S("programId")])},TransferWithSeed:{index:11,layout:n.struct([n.u32("instruction"),Y("lamports"),J("seed"),S("programId")])},UpgradeNonceAccount:{index:12,layout:n.struct([n.u32("instruction")])}});class ae{constructor(){}static createAccount(e){const t=N.Create,s=O(t,{lamports:e.lamports,space:e.space,programId:K(e.programId.toBuffer())});return new z({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:s})}static transfer(e){let t,s;if("basePubkey"in e){const i=N.TransferWithSeed;t=O(i,{lamports:BigInt(e.lamports),seed:e.seed,programId:K(e.programId.toBuffer())}),s=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const i=N.Transfer;t=O(i,{lamports:BigInt(e.lamports)}),s=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new z({keys:s,programId:this.programId,data:t})}static assign(e){let t,s;if("basePubkey"in e){const i=N.AssignWithSeed;t=O(i,{base:K(e.basePubkey.toBuffer()),seed:e.seed,programId:K(e.programId.toBuffer())}),s=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=N.Assign;t=O(i,{programId:K(e.programId.toBuffer())}),s=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new z({keys:s,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=N.CreateWithSeed,s=O(t,{base:K(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:K(e.programId.toBuffer())});let i=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&i.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new z({keys:i,programId:this.programId,data:s})}static createNonceAccount(e){const t=new X;"basePubkey"in e&&"seed"in e?t.add(ae.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:De,programId:this.programId})):t.add(ae.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:De,programId:this.programId}));const s={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(s)),t}static nonceInitialize(e){const t=N.InitializeNonceAccount,s=O(t,{authorized:K(e.authorizedPubkey.toBuffer())}),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:pe,isSigner:!1,isWritable:!1},{pubkey:_e,isSigner:!1,isWritable:!1}],programId:this.programId,data:s};return new z(i)}static nonceAdvance(e){const t=N.AdvanceNonceAccount,s=O(t),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:pe,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:s};return new z(i)}static nonceWithdraw(e){const t=N.WithdrawNonceAccount,s=O(t,{lamports:e.lamports});return new z({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:pe,isSigner:!1,isWritable:!1},{pubkey:_e,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static nonceAuthorize(e){const t=N.AuthorizeNonceAccount,s=O(t,{authorized:K(e.newAuthorizedPubkey.toBuffer())});return new z({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static allocate(e){let t,s;if("basePubkey"in e){const i=N.AllocateWithSeed;t=O(i,{base:K(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:K(e.programId.toBuffer())}),s=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=N.Allocate;t=O(i,{space:e.space}),s=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new z({keys:s,programId:this.programId,data:t})}}ae.programId=new y("11111111111111111111111111111111");new y("BPFLoader2111111111111111111111111111111111");n.struct([n.u32("typeIndex"),Y("deactivationSlot"),n.nu64("lastExtendedSlot"),n.u8("lastExtendedStartIndex"),n.u8(),n.seq(S(),n.offset(n.u8(),-1),"authority")]);const x=ce(Me(y),d(),r=>new y(r)),$e=we([d(),A("base64")]),Ae=ce(Me(n.bufferPolyfill.Buffer),$e,r=>n.bufferPolyfill.Buffer.from(r[0],"base64"));function Je(r){return R([c({jsonrpc:A("2.0"),id:d(),result:r}),c({jsonrpc:A("2.0"),id:d(),error:c({code:ue(),message:d(),data:p(At())})})])}const Ut=Je(ue());function P(r){return ce(Je(r),Ut,e=>"error"in e?e:{...e,result:re(e.result,r)})}function _(r){return P(c({context:c({slot:o()}),value:r}))}function fe(r){return c({context:c({slot:o()}),value:r})}const qt=c({foundation:o(),foundationTerm:o(),initial:o(),taper:o(),terminal:o()});P(g(f(c({epoch:o(),effectiveSlot:o(),amount:o(),postBalance:o(),commission:p(f(o()))}))));const Ft=g(c({slot:o(),prioritizationFee:o()})),Vt=c({total:o(),validator:o(),foundation:o(),epoch:o()}),Ht=c({epoch:o(),slotIndex:o(),slotsInEpoch:o(),absoluteSlot:o(),blockHeight:p(o()),transactionCount:p(o())}),jt=c({slotsPerEpoch:o(),leaderScheduleSlotOffset:o(),warmup:L(),firstNormalEpoch:o(),firstNormalSlot:o()}),Gt=qe(d(),g(o())),j=f(R([c({}),d()])),$t=c({err:j}),Jt=A("receivedSignature");c({"solana-core":d(),"feature-set":p(o())});_(c({err:f(R([c({}),d()])),logs:f(g(d())),accounts:p(f(g(f(c({executable:L(),owner:d(),lamports:o(),data:g(d()),rentEpoch:p(o())}))))),unitsConsumed:p(o()),returnData:p(f(c({programId:d(),data:we([d(),A("base64")])})))}));_(c({byIdentity:qe(d(),g(o())),range:c({firstSlot:o(),lastSlot:o()})}));P(qt);P(Vt);P(Ft);P(Ht);P(jt);P(Gt);P(o());_(c({total:o(),circulating:o(),nonCirculating:o(),nonCirculatingAccounts:g(x)}));const Xt=c({amount:d(),uiAmount:f(o()),decimals:o(),uiAmountString:p(d())});_(g(c({address:x,amount:d(),uiAmount:f(o()),decimals:o(),uiAmountString:p(d())})));_(g(c({pubkey:x,account:c({executable:L(),owner:x,lamports:o(),data:Ae,rentEpoch:o()})})));const Se=c({program:d(),parsed:ue(),space:o()});_(g(c({pubkey:x,account:c({executable:L(),owner:x,lamports:o(),data:Se,rentEpoch:o()})})));_(g(c({lamports:o(),address:x})));const Ie=c({executable:L(),owner:x,lamports:o(),data:Ae,rentEpoch:o()});c({pubkey:x,account:Ie});const Yt=ce(R([Me(n.bufferPolyfill.Buffer),Se]),R([$e,Se]),r=>Array.isArray(r)?re(r,Ae):r),Zt=c({executable:L(),owner:x,lamports:o(),data:Yt,rentEpoch:o()});c({pubkey:x,account:Zt});c({state:R([A("active"),A("inactive"),A("activating"),A("deactivating")]),active:o(),inactive:o()});P(g(c({signature:d(),slot:o(),err:j,memo:f(d()),blockTime:p(f(o()))})));P(g(c({signature:d(),slot:o(),err:j,memo:f(d()),blockTime:p(f(o()))})));c({subscription:o(),result:fe(Ie)});const Qt=c({pubkey:x,account:Ie});c({subscription:o(),result:fe(Qt)});const en=c({parent:o(),slot:o(),root:o()});c({subscription:o(),result:en});const tn=R([c({type:R([A("firstShredReceived"),A("completed"),A("optimisticConfirmation"),A("root")]),slot:o(),timestamp:o()}),c({type:A("createdBank"),parent:o(),slot:o(),timestamp:o()}),c({type:A("frozen"),slot:o(),timestamp:o(),stats:c({numTransactionEntries:o(),numSuccessfulTransactions:o(),numFailedTransactions:o(),maxTransactionsPerEntry:o()})}),c({type:A("dead"),slot:o(),timestamp:o(),err:d()})]);c({subscription:o(),result:tn});c({subscription:o(),result:fe(R([$t,Jt]))});c({subscription:o(),result:o()});c({pubkey:d(),gossip:f(d()),tpu:f(d()),rpc:f(d()),version:f(d())});const ze=c({votePubkey:d(),nodePubkey:d(),activatedStake:o(),epochVoteAccount:L(),epochCredits:g(we([o(),o(),o()])),commission:o(),lastVote:o(),rootSlot:f(o())});P(c({current:g(ze),delinquent:g(ze)}));const nn=R([A("processed"),A("confirmed"),A("finalized")]),sn=c({slot:o(),confirmations:f(o()),err:j,confirmationStatus:p(nn)});_(g(f(sn)));P(o());const Xe=c({accountKey:x,writableIndexes:g(o()),readonlyIndexes:g(o())}),ve=c({signatures:g(d()),message:c({accountKeys:g(d()),header:c({numRequiredSignatures:o(),numReadonlySignedAccounts:o(),numReadonlyUnsignedAccounts:o()}),instructions:g(c({accounts:g(o()),data:d(),programIdIndex:o()})),recentBlockhash:d(),addressTableLookups:p(g(Xe))})}),Ye=c({pubkey:x,signer:L(),writable:L(),source:p(R([A("transaction"),A("lookupTable")]))}),Ze=c({accountKeys:g(Ye),signatures:g(d())}),Qe=c({parsed:ue(),program:d(),programId:x}),et=c({accounts:g(x),data:d(),programId:x}),rn=R([et,Qe]),an=R([c({parsed:ue(),program:d(),programId:d()}),c({accounts:g(d()),data:d(),programId:d()})]),tt=ce(rn,an,r=>"accounts"in r?re(r,et):re(r,Qe)),nt=c({signatures:g(d()),message:c({accountKeys:g(Ye),instructions:g(tt),recentBlockhash:d(),addressTableLookups:p(f(g(Xe)))})}),me=c({accountIndex:o(),mint:d(),owner:p(d()),uiTokenAmount:Xt}),st=c({writable:g(x),readonly:g(x)}),ge=c({err:j,fee:o(),innerInstructions:p(f(g(c({index:o(),instructions:g(c({accounts:g(o()),data:d(),programIdIndex:o()}))})))),preBalances:g(o()),postBalances:g(o()),logMessages:p(f(g(d()))),preTokenBalances:p(f(g(me))),postTokenBalances:p(f(g(me))),loadedAddresses:p(st),computeUnitsConsumed:p(o())}),Te=c({err:j,fee:o(),innerInstructions:p(f(g(c({index:o(),instructions:g(tt)})))),preBalances:g(o()),postBalances:g(o()),logMessages:p(f(g(d()))),preTokenBalances:p(f(g(me))),postTokenBalances:p(f(g(me))),loadedAddresses:p(st),computeUnitsConsumed:p(o())}),Z=R([A(0),A("legacy")]),G=c({pubkey:d(),lamports:o(),postBalance:f(o()),rewardType:f(d()),commission:p(f(o()))});P(f(c({blockhash:d(),previousBlockhash:d(),parentSlot:o(),transactions:g(c({transaction:ve,meta:f(ge),version:p(Z)})),rewards:p(g(G)),blockTime:f(o()),blockHeight:f(o())})));P(f(c({blockhash:d(),previousBlockhash:d(),parentSlot:o(),rewards:p(g(G)),blockTime:f(o()),blockHeight:f(o())})));P(f(c({blockhash:d(),previousBlockhash:d(),parentSlot:o(),transactions:g(c({transaction:Ze,meta:f(ge),version:p(Z)})),rewards:p(g(G)),blockTime:f(o()),blockHeight:f(o())})));P(f(c({blockhash:d(),previousBlockhash:d(),parentSlot:o(),transactions:g(c({transaction:nt,meta:f(Te),version:p(Z)})),rewards:p(g(G)),blockTime:f(o()),blockHeight:f(o())})));P(f(c({blockhash:d(),previousBlockhash:d(),parentSlot:o(),transactions:g(c({transaction:Ze,meta:f(Te),version:p(Z)})),rewards:p(g(G)),blockTime:f(o()),blockHeight:f(o())})));P(f(c({blockhash:d(),previousBlockhash:d(),parentSlot:o(),rewards:p(g(G)),blockTime:f(o()),blockHeight:f(o())})));P(f(c({blockhash:d(),previousBlockhash:d(),parentSlot:o(),transactions:g(c({transaction:ve,meta:f(ge)})),rewards:p(g(G)),blockTime:f(o())})));P(f(c({blockhash:d(),previousBlockhash:d(),parentSlot:o(),signatures:g(d()),blockTime:f(o())})));P(f(c({slot:o(),meta:f(ge),blockTime:p(f(o())),transaction:ve,version:p(Z)})));P(f(c({slot:o(),transaction:nt,meta:f(Te),blockTime:p(f(o())),version:p(Z)})));_(c({blockhash:d(),feeCalculator:c({lamportsPerSignature:o()})}));_(c({blockhash:d(),lastValidBlockHeight:o()}));_(L());const on=c({slot:o(),numTransactions:o(),numSlots:o(),samplePeriodSecs:o()});P(g(on));_(f(c({feeCalculator:c({lamportsPerSignature:o()})})));P(d());P(d());const un=c({err:j,logs:g(d()),signature:d()});c({result:fe(un),subscription:o()});class se{constructor(e){this._keypair=void 0,this._keypair=e??Ee()}static generate(){return new se(Ee())}static fromSecretKey(e,t){if(e.byteLength!==64)throw new Error("bad secret key size");const s=e.slice(32,64);if(!t||!t.skipValidation){const i=e.slice(0,32),a=he(i);for(let u=0;u<32;u++)if(s[u]!==a[u])throw new Error("provided secretKey is invalid")}return new se({publicKey:s,secretKey:e})}static fromSeed(e){const t=he(e),s=new Uint8Array(64);return s.set(e),s.set(t,32),new se({publicKey:t,secretKey:s})}get publicKey(){return new y(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}Object.freeze({CreateLookupTable:{index:0,layout:n.struct([n.u32("instruction"),Y("recentSlot"),n.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:n.struct([n.u32("instruction")])},ExtendLookupTable:{index:2,layout:n.struct([n.u32("instruction"),Y(),n.seq(S(),n.offset(n.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:n.struct([n.u32("instruction")])},CloseLookupTable:{index:4,layout:n.struct([n.u32("instruction")])}});new y("AddressLookupTab1e1111111111111111111111111");Object.freeze({RequestUnits:{index:0,layout:n.struct([n.u8("instruction"),n.u32("units"),n.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:n.struct([n.u8("instruction"),n.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:n.struct([n.u8("instruction"),n.u32("units")])},SetComputeUnitPrice:{index:3,layout:n.struct([n.u8("instruction"),Y("microLamports")])}});new y("ComputeBudget111111111111111111111111111111");n.struct([n.u8("numSignatures"),n.u8("padding"),n.u16("signatureOffset"),n.u16("signatureInstructionIndex"),n.u16("publicKeyOffset"),n.u16("publicKeyInstructionIndex"),n.u16("messageDataOffset"),n.u16("messageDataSize"),n.u16("messageInstructionIndex")]);new y("Ed25519SigVerify111111111111111111111111111");n.secp256k1.utils.isValidPrivateKey;n.secp256k1.getPublicKey;n.struct([n.u8("numSignatures"),n.u16("signatureOffset"),n.u8("signatureInstructionIndex"),n.u16("ethAddressOffset"),n.u8("ethAddressInstructionIndex"),n.u16("messageDataOffset"),n.u16("messageDataSize"),n.u8("messageInstructionIndex"),n.blob(20,"ethAddress"),n.blob(64,"signature"),n.u8("recoveryId")]);new y("KeccakSecp256k11111111111111111111111111111");var rt;new y("StakeConfig11111111111111111111111111111111");class it{constructor(e,t,s){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=s}}rt=it;it.default=new rt(0,0,y.default);Object.freeze({Initialize:{index:0,layout:n.struct([n.u32("instruction"),Et(),Ct()])},Authorize:{index:1,layout:n.struct([n.u32("instruction"),S("newAuthorized"),n.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:n.struct([n.u32("instruction")])},Split:{index:3,layout:n.struct([n.u32("instruction"),n.ns64("lamports")])},Withdraw:{index:4,layout:n.struct([n.u32("instruction"),n.ns64("lamports")])},Deactivate:{index:5,layout:n.struct([n.u32("instruction")])},Merge:{index:7,layout:n.struct([n.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:n.struct([n.u32("instruction"),S("newAuthorized"),n.u32("stakeAuthorizationType"),J("authoritySeed"),S("authorityOwner")])}});new y("Stake11111111111111111111111111111111111111");Object.freeze({InitializeAccount:{index:0,layout:n.struct([n.u32("instruction"),Ot()])},Authorize:{index:1,layout:n.struct([n.u32("instruction"),S("newAuthorized"),n.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:n.struct([n.u32("instruction"),n.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:n.struct([n.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:n.struct([n.u32("instruction"),Nt()])}});new y("Vote111111111111111111111111111111111111111");new y("Va1idator1nfo111111111111111111111111111111");c({name:d(),website:p(d()),details:p(d()),keybaseUsername:p(d())});new y("Vote111111111111111111111111111111111111111");n.struct([S("nodePubkey"),S("authorizedWithdrawer"),n.u8("commission"),n.nu64(),n.seq(n.struct([n.nu64("slot"),n.u32("confirmationCount")]),n.offset(n.u32(),-8),"votes"),n.u8("rootSlotValid"),n.nu64("rootSlot"),n.nu64(),n.seq(n.struct([n.nu64("epoch"),S("authorizedVoter")]),n.offset(n.u32(),-8),"authorizedVoters"),n.struct([n.seq(n.struct([S("authorizedPubkey"),n.nu64("epochOfLastAuthorizedSwitch"),n.nu64("targetEpoch")]),32,"buf"),n.nu64("idx"),n.u8("isEmpty")],"priorVoters"),n.nu64(),n.seq(n.struct([n.nu64("epoch"),n.nu64("credits"),n.nu64("prevCredits")]),n.offset(n.u32(),-8),"epochCredits"),n.struct([n.nu64("slot"),n.nu64("timestamp")],"lastTimestamp")]);const xe=new y("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");new y("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");const cn=new y("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");new y("So11111111111111111111111111111111111111112");new y("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");class ln extends Error{constructor(e){super(e)}}class dn extends ln{constructor(){super(...arguments),this.name="TokenOwnerOffCurveError"}}const mn=n.struct([n.u32("mintAuthorityOption"),n.publicKey("mintAuthority"),n.u64("supply"),n.u8("decimals"),n.bool("isInitialized"),n.u32("freezeAuthorityOption"),n.publicKey("freezeAuthority")]);mn.span;function fn(r,e,t=!1,s=xe,i=cn){if(!t&&!y.isOnCurve(e.toBuffer()))throw new dn;const[a]=y.findProgramAddressSync([e.toBuffer(),s.toBuffer(),r.toBuffer()],i);return a}function at(r,e){return new n.Program(Be.TokenMessengerIdl,new y(r),e===void 0?{connection:null}:e)}function gn(r,e){return at(r,Le.createReadOnlyProvider(e))}function ot(r,e){return new n.Program(Be.MessageTransmitterIdl,new y(r),e===void 0?{connection:null}:e)}function yn(r,e){return ot(r,Le.createReadOnlyProvider(e))}const B=(r,e,t)=>{const s=[n.dist.Buffer.from(n.index.bytes.utf8.encode(r))];if(t)for(const a of t)typeof a=="string"?s.push(n.dist.Buffer.from(n.index.bytes.utf8.encode(a))):Array.isArray(a)?s.push(n.dist.Buffer.from(a)):n.dist.Buffer.isBuffer(a)?s.push(a):s.push(a.toBuffer());const i=y.findProgramAddressSync(s,e);return{publicKey:i[0],bump:i[1]}};function pn(r,e,t,s,i,a,u,m,l){const b=B("message_transmitter",r),k=B("token_messenger",e),M=B("token_minter",e),I=B("local_token",e,[t]),v=B("remote_token_messenger",e,[s.toString()]),E=B("sender_authority",e),h=at(e),w=B("__event_authority",e);return h.methods.depositForBurn({amount:new n.BN(m.toString()),destinationDomain:s,mintRecipient:new y(u.toUint8Array())}).accounts({owner:i,senderAuthorityPda:E.publicKey,burnTokenAccount:a,messageTransmitter:b.publicKey,tokenMessenger:k.publicKey,remoteTokenMessenger:v.publicKey,tokenMinter:M.publicKey,localToken:I.publicKey,burnTokenMint:t,messageTransmitterProgram:r,tokenMessengerMinterProgram:e,tokenProgram:xe,eventAuthority:w.publicKey,eventRentPayer:i,messageSentEventData:l}).instruction()}const We=6400n;function ut(r){return(r-BigInt(1))/We*We+BigInt(1)}function ct(r,e,t){const s=e.toString();return B("used_nonces",t,[s,ut(r).toString()]).publicKey}async function hn(r,e,t,s,i,a){const u=n.dist.Buffer.from(n.CircleBridge.serialize(s)),m=n.dist.Buffer.from(n.hex.decode(i)),l=new y(t),b=new y(s.payload.burnToken.toUint8Array()),k=new $.SolanaAddress(s.payload.mintRecipient).unwrap(),M=a?new y(a):k,I=s.sourceDomain.toString(),v=B("message_transmitter",r),E=B("token_messenger",e),h=B("token_minter",e),w=B("local_token",e,[l]),T=B("remote_token_messenger",e,[I]),F=B("token_pair",e,[I,b]),lt=B("custody",e,[l]),dt=B("message_transmitter_authority",r,[e]).publicKey,mt=ct(s.nonce,s.sourceDomain,r),ft=B("__event_authority",r),gt=B("__event_authority",e),D=[];D.push({isSigner:!1,isWritable:!1,pubkey:E.publicKey}),D.push({isSigner:!1,isWritable:!1,pubkey:T.publicKey}),D.push({isSigner:!1,isWritable:!0,pubkey:h.publicKey}),D.push({isSigner:!1,isWritable:!0,pubkey:w.publicKey}),D.push({isSigner:!1,isWritable:!1,pubkey:F.publicKey}),D.push({isSigner:!1,isWritable:!0,pubkey:k}),D.push({isSigner:!1,isWritable:!0,pubkey:lt.publicKey}),D.push({isSigner:!1,isWritable:!1,pubkey:xe}),D.push({isSigner:!1,isWritable:!1,pubkey:gt.publicKey}),D.push({isSigner:!1,isWritable:!1,pubkey:e});const Ke=ot(r);return Ke.methods.receiveMessage({message:u,attestation:m}).accounts({payer:M,caller:M,authorityPda:dt,messageTransmitter:v.publicKey,usedNonces:mt,receiver:e,systemProgram:ae.programId,eventAuthority:ft.publicKey,program:Ke.programId}).remainingAccounts(D).transaction()}class ye{constructor(e,t,s,i){V(this,"network");V(this,"chain");V(this,"connection");V(this,"contracts");V(this,"tokenMessenger");V(this,"messageTransmitter");var m,l;if(this.network=e,this.chain=t,this.connection=s,this.contracts=i,e==="Devnet")throw new Error("CircleBridge not supported on Devnet");const a=(m=i.cctp)==null?void 0:m.messageTransmitter;if(!a)throw new Error(`Circle Messenge Transmitter contract for domain ${t} not found`);this.messageTransmitter=yn(new y(a),this.connection);const u=(l=i.cctp)==null?void 0:l.tokenMessenger;if(!u)throw new Error(`Circle Token Messenger contract for domain ${t} not found`);this.tokenMessenger=gn(new y(u),this.connection)}static async fromRpc(e,t){const[s,i]=await $.SolanaPlatform.chainFromRpc(e),a=t[i];if(a.network!==s)throw new Error(`Network mismatch: ${a.network} != ${s}`);return new ye(s,i,e,a.contracts)}async*redeem(e,t,s){const i=new y(n.usdcContract.get(this.network,this.chain)),a=new $.SolanaAddress(e).unwrap(),u=await hn(this.messageTransmitter.programId,this.tokenMessenger.programId,i,t,s,a),m=new X;m.feePayer=a,m.add(u),yield this.createUnsignedTx({transaction:m},"CircleBridge.Redeem")}async*transfer(e,t,s){const i=new y(n.usdcContract.get(this.network,this.chain)),a=new $.SolanaAddress(e).unwrap(),u=fn(i,a),m=n.circleChainId.get(this.network,t.chain),l=t.address.toUniversalAddress(),b=se.generate(),k=await pn(this.messageTransmitter.programId,this.tokenMessenger.programId,i,m,a,u,l,s,b.publicKey),M=new X;M.feePayer=a,M.add(k),yield this.createUnsignedTx({transaction:M,signers:[b]},"CircleBridge.Transfer")}async isTransferCompleted(e){const t=ct(e.nonce,e.sourceDomain,this.messageTransmitter.programId),s=ut(e.nonce),{usedNonces:i}=await this.messageTransmitter.account.usedNonces.fetch(t),a=Number(e.nonce-s),u=i[Math.floor(a/64)];if(!u)throw new Error("Invalid nonce byte index");const m=a%64,l=new n.BN((BigInt(1)<<BigInt(m)).toString());return!u.and(l).isZero()}async parseTransactionDetails(e){const t=await this.connection.getTransaction(e);if(!t||!t.meta)throw new Error("Transaction not found");const s=t.transaction.message.getAccountKeys();if(s.length<2)throw new Error("No message account found");const i=s.get(1),a=await this.connection.getAccountInfo(i);if(!a)throw new Error("No account data found");const u=new Uint8Array(a.data).slice(44),[m,l]=n.CircleBridge.deserialize(u),{payload:b}=m,k=b.messageSender,M=b.mintRecipient,I=n.toCircleChain(this.network,m.sourceDomain),v=n.toCircleChain(this.network,m.destinationDomain),E={chain:I,address:b.burnToken};return{from:{chain:I,address:k},to:{chain:v,address:M},token:E,amount:b.amount,message:m,id:{hash:l}}}createUnsignedTx(e,t,s=!1){return new $.SolanaUnsignedTransaction(e,this.network,this.chain,t,s)}}const bn={version:"0.1.0",name:"token_messenger_minter",instructions:[{name:"initialize",accounts:[{name:"payer",isMut:!0,isSigner:!0},{name:"upgradeAuthority",isMut:!1,isSigner:!0},{name:"authorityPda",isMut:!1,isSigner:!1},{name:"tokenMessenger",isMut:!0,isSigner:!1},{name:"tokenMinter",isMut:!0,isSigner:!1},{name:"tokenMessengerMinterProgramData",isMut:!1,isSigner:!1},{name:"tokenMessengerMinterProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"InitializeParams"}}]},{name:"transferOwnership",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"tokenMessenger",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"TransferOwnershipParams"}}]},{name:"acceptOwnership",accounts:[{name:"pendingOwner",isMut:!1,isSigner:!0},{name:"tokenMessenger",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"AcceptOwnershipParams"}}]},{name:"addRemoteTokenMessenger",accounts:[{name:"payer",isMut:!0,isSigner:!0},{name:"owner",isMut:!1,isSigner:!0},{name:"tokenMessenger",isMut:!1,isSigner:!1},{name:"remoteTokenMessenger",isMut:!0,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"AddRemoteTokenMessengerParams"}}]},{name:"removeRemoteTokenMessenger",accounts:[{name:"payee",isMut:!0,isSigner:!0},{name:"owner",isMut:!1,isSigner:!0},{name:"tokenMessenger",isMut:!1,isSigner:!1},{name:"remoteTokenMessenger",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"RemoveRemoteTokenMessengerParams"}}]},{name:"depositForBurn",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"eventRentPayer",isMut:!0,isSigner:!0},{name:"senderAuthorityPda",isMut:!1,isSigner:!1},{name:"burnTokenAccount",isMut:!0,isSigner:!1},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"tokenMessenger",isMut:!1,isSigner:!1},{name:"remoteTokenMessenger",isMut:!1,isSigner:!1},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"localToken",isMut:!0,isSigner:!1},{name:"burnTokenMint",isMut:!0,isSigner:!1},{name:"messageSentEventData",isMut:!0,isSigner:!0},{name:"messageTransmitterProgram",isMut:!1,isSigner:!1},{name:"tokenMessengerMinterProgram",isMut:!1,isSigner:!1},{name:"tokenProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"DepositForBurnParams"}}],returns:"u64"},{name:"depositForBurnWithCaller",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"eventRentPayer",isMut:!0,isSigner:!0},{name:"senderAuthorityPda",isMut:!1,isSigner:!1},{name:"burnTokenAccount",isMut:!0,isSigner:!1},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"tokenMessenger",isMut:!1,isSigner:!1},{name:"remoteTokenMessenger",isMut:!1,isSigner:!1},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"localToken",isMut:!0,isSigner:!1},{name:"burnTokenMint",isMut:!0,isSigner:!1},{name:"messageSentEventData",isMut:!0,isSigner:!0},{name:"messageTransmitterProgram",isMut:!1,isSigner:!1},{name:"tokenMessengerMinterProgram",isMut:!1,isSigner:!1},{name:"tokenProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"DepositForBurnWithCallerParams"}}],returns:"u64"},{name:"replaceDepositForBurn",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"eventRentPayer",isMut:!0,isSigner:!0},{name:"senderAuthorityPda",isMut:!1,isSigner:!1},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"tokenMessenger",isMut:!1,isSigner:!1},{name:"messageSentEventData",isMut:!0,isSigner:!0},{name:"messageTransmitterProgram",isMut:!1,isSigner:!1},{name:"tokenMessengerMinterProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"ReplaceDepositForBurnParams"}}],returns:"u64"},{name:"handleReceiveMessage",accounts:[{name:"authorityPda",isMut:!1,isSigner:!0},{name:"tokenMessenger",isMut:!1,isSigner:!1},{name:"remoteTokenMessenger",isMut:!1,isSigner:!1},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"localToken",isMut:!0,isSigner:!1},{name:"tokenPair",isMut:!1,isSigner:!1},{name:"recipientTokenAccount",isMut:!0,isSigner:!1},{name:"custodyTokenAccount",isMut:!0,isSigner:!1},{name:"tokenProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"HandleReceiveMessageParams"}}]},{name:"setTokenController",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"tokenMessenger",isMut:!1,isSigner:!1},{name:"tokenMinter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"SetTokenControllerParams"}}]},{name:"pause",accounts:[{name:"pauser",isMut:!1,isSigner:!0},{name:"tokenMinter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"PauseParams"}}]},{name:"unpause",accounts:[{name:"pauser",isMut:!1,isSigner:!0},{name:"tokenMinter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"UnpauseParams"}}]},{name:"updatePauser",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"tokenMessenger",isMut:!1,isSigner:!1},{name:"tokenMinter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"UpdatePauserParams"}}]},{name:"setMaxBurnAmountPerMessage",accounts:[{name:"tokenController",isMut:!1,isSigner:!0},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"localToken",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"SetMaxBurnAmountPerMessageParams"}}]},{name:"addLocalToken",accounts:[{name:"payer",isMut:!0,isSigner:!0},{name:"tokenController",isMut:!1,isSigner:!0},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"localToken",isMut:!0,isSigner:!1},{name:"custodyTokenAccount",isMut:!0,isSigner:!1},{name:"localTokenMint",isMut:!1,isSigner:!1},{name:"tokenProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"AddLocalTokenParams"}}]},{name:"removeLocalToken",accounts:[{name:"payee",isMut:!0,isSigner:!0},{name:"tokenController",isMut:!1,isSigner:!0},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"localToken",isMut:!0,isSigner:!1},{name:"custodyTokenAccount",isMut:!0,isSigner:!1},{name:"tokenProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"RemoveLocalTokenParams"}}]},{name:"linkTokenPair",accounts:[{name:"payer",isMut:!0,isSigner:!0},{name:"tokenController",isMut:!1,isSigner:!0},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"tokenPair",isMut:!0,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"LinkTokenPairParams"}}]},{name:"unlinkTokenPair",accounts:[{name:"payee",isMut:!0,isSigner:!0},{name:"tokenController",isMut:!1,isSigner:!0},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"tokenPair",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"UninkTokenPairParams"}}]},{name:"burnTokenCustody",accounts:[{name:"payee",isMut:!0,isSigner:!0},{name:"tokenController",isMut:!1,isSigner:!0},{name:"tokenMinter",isMut:!1,isSigner:!1},{name:"localToken",isMut:!1,isSigner:!1},{name:"custodyTokenAccount",isMut:!0,isSigner:!1},{name:"custodyTokenMint",isMut:!0,isSigner:!1},{name:"tokenProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"BurnTokenCustodyParams"}}]}],accounts:[{name:"tokenMessenger",type:{kind:"struct",fields:[{name:"owner",type:"publicKey"},{name:"pendingOwner",type:"publicKey"},{name:"localMessageTransmitter",type:"publicKey"},{name:"messageBodyVersion",type:"u32"},{name:"authorityBump",type:"u8"}]}},{name:"remoteTokenMessenger",type:{kind:"struct",fields:[{name:"domain",type:"u32"},{name:"tokenMessenger",type:"publicKey"}]}},{name:"tokenMinter",type:{kind:"struct",fields:[{name:"tokenController",type:"publicKey"},{name:"pauser",type:"publicKey"},{name:"paused",type:"bool"},{name:"bump",type:"u8"}]}},{name:"tokenPair",type:{kind:"struct",fields:[{name:"remoteDomain",type:"u32"},{name:"remoteToken",type:"publicKey"},{name:"localToken",type:"publicKey"},{name:"bump",type:"u8"}]}},{name:"localToken",type:{kind:"struct",fields:[{name:"custody",type:"publicKey"},{name:"mint",type:"publicKey"},{name:"burnLimitPerMessage",type:"u64"},{name:"messagesSent",type:"u64"},{name:"messagesReceived",type:"u64"},{name:"amountSent",type:"u128"},{name:"amountReceived",type:"u128"},{name:"bump",type:"u8"},{name:"custodyBump",type:"u8"}]}}],types:[{name:"AcceptOwnershipParams",type:{kind:"struct",fields:[]}},{name:"AddRemoteTokenMessengerParams",type:{kind:"struct",fields:[{name:"domain",type:"u32"},{name:"tokenMessenger",type:"publicKey"}]}},{name:"DepositForBurnWithCallerParams",type:{kind:"struct",fields:[{name:"amount",type:"u64"},{name:"destinationDomain",type:"u32"},{name:"mintRecipient",type:"publicKey"},{name:"destinationCaller",type:"publicKey"}]}},{name:"DepositForBurnParams",type:{kind:"struct",fields:[{name:"amount",type:"u64"},{name:"destinationDomain",type:"u32"},{name:"mintRecipient",type:"publicKey"}]}},{name:"HandleReceiveMessageParams",type:{kind:"struct",fields:[{name:"remoteDomain",type:"u32"},{name:"sender",type:"publicKey"},{name:"messageBody",type:"bytes"},{name:"authorityBump",type:"u8"}]}},{name:"InitializeParams",type:{kind:"struct",fields:[{name:"tokenController",type:"publicKey"},{name:"localMessageTransmitter",type:"publicKey"},{name:"messageBodyVersion",type:"u32"}]}},{name:"RemoveRemoteTokenMessengerParams",type:{kind:"struct",fields:[]}},{name:"ReplaceDepositForBurnParams",type:{kind:"struct",fields:[{name:"originalMessage",type:"bytes"},{name:"originalAttestation",type:"bytes"},{name:"newDestinationCaller",type:"publicKey"},{name:"newMintRecipient",type:"publicKey"}]}},{name:"TransferOwnershipParams",type:{kind:"struct",fields:[{name:"newOwner",type:"publicKey"}]}},{name:"AddLocalTokenParams",type:{kind:"struct",fields:[]}},{name:"BurnTokenCustodyParams",type:{kind:"struct",fields:[{name:"amount",type:"u64"}]}},{name:"LinkTokenPairParams",type:{kind:"struct",fields:[{name:"localToken",type:"publicKey"},{name:"remoteDomain",type:"u32"},{name:"remoteToken",type:"publicKey"}]}},{name:"PauseParams",type:{kind:"struct",fields:[]}},{name:"RemoveLocalTokenParams",type:{kind:"struct",fields:[]}},{name:"SetMaxBurnAmountPerMessageParams",type:{kind:"struct",fields:[{name:"burnLimitPerMessage",type:"u64"}]}},{name:"SetTokenControllerParams",type:{kind:"struct",fields:[{name:"tokenController",type:"publicKey"}]}},{name:"UninkTokenPairParams",type:{kind:"struct",fields:[]}},{name:"UnpauseParams",type:{kind:"struct",fields:[]}},{name:"UpdatePauserParams",type:{kind:"struct",fields:[{name:"newPauser",type:"publicKey"}]}},{name:"TokenMinterError",type:{kind:"enum",variants:[{name:"InvalidAuthority"},{name:"InvalidTokenMinterState"},{name:"ProgramPaused"},{name:"InvalidTokenPairState"},{name:"InvalidLocalTokenState"},{name:"InvalidPauser"},{name:"InvalidTokenController"},{name:"BurnAmountExceeded"},{name:"InvalidAmount"}]}}],events:[{name:"OwnershipTransferStarted",fields:[{name:"previousOwner",type:"publicKey",index:!1},{name:"newOwner",type:"publicKey",index:!1}]},{name:"OwnershipTransferred",fields:[{name:"previousOwner",type:"publicKey",index:!1},{name:"newOwner",type:"publicKey",index:!1}]},{name:"DepositForBurn",fields:[{name:"nonce",type:"u64",index:!1},{name:"burnToken",type:"publicKey",index:!1},{name:"amount",type:"u64",index:!1},{name:"depositor",type:"publicKey",index:!1},{name:"mintRecipient",type:"publicKey",index:!1},{name:"destinationDomain",type:"u32",index:!1},{name:"destinationTokenMessenger",type:"publicKey",index:!1},{name:"destinationCaller",type:"publicKey",index:!1}]},{name:"MintAndWithdraw",fields:[{name:"mintRecipient",type:"publicKey",index:!1},{name:"amount",type:"u64",index:!1},{name:"mintToken",type:"publicKey",index:!1}]},{name:"RemoteTokenMessengerAdded",fields:[{name:"domain",type:"u32",index:!1},{name:"tokenMessenger",type:"publicKey",index:!1}]},{name:"RemoteTokenMessengerRemoved",fields:[{name:"domain",type:"u32",index:!1},{name:"tokenMessenger",type:"publicKey",index:!1}]},{name:"SetTokenController",fields:[{name:"tokenController",type:"publicKey",index:!1}]},{name:"PauserChanged",fields:[{name:"newAddress",type:"publicKey",index:!1}]},{name:"SetBurnLimitPerMessage",fields:[{name:"token",type:"publicKey",index:!1},{name:"burnLimitPerMessage",type:"u64",index:!1}]},{name:"LocalTokenAdded",fields:[{name:"custody",type:"publicKey",index:!1},{name:"mint",type:"publicKey",index:!1}]},{name:"LocalTokenRemoved",fields:[{name:"custody",type:"publicKey",index:!1},{name:"mint",type:"publicKey",index:!1}]},{name:"TokenPairLinked",fields:[{name:"localToken",type:"publicKey",index:!1},{name:"remoteDomain",type:"u32",index:!1},{name:"remoteToken",type:"publicKey",index:!1}]},{name:"TokenPairUnlinked",fields:[{name:"localToken",type:"publicKey",index:!1},{name:"remoteDomain",type:"u32",index:!1},{name:"remoteToken",type:"publicKey",index:!1}]},{name:"Pause",fields:[]},{name:"Unpause",fields:[]},{name:"TokenCustodyBurned",fields:[{name:"custodyTokenAccount",type:"publicKey",index:!1},{name:"amount",type:"u64",index:!1}]}],errors:[{code:6e3,name:"InvalidAuthority",msg:"Invalid authority"},{code:6001,name:"InvalidTokenMessengerState",msg:"Invalid token messenger state"},{code:6002,name:"InvalidTokenMessenger",msg:"Invalid token messenger"},{code:6003,name:"InvalidOwner",msg:"Invalid owner"},{code:6004,name:"MalformedMessage",msg:"Malformed message"},{code:6005,name:"InvalidMessageBodyVersion",msg:"Invalid message body version"},{code:6006,name:"InvalidAmount",msg:"Invalid amount"},{code:6007,name:"InvalidDestinationDomain",msg:"Invalid destination domain"},{code:6008,name:"InvalidDestinationCaller",msg:"Invalid destination caller"},{code:6009,name:"InvalidMintRecipient",msg:"Invalid mint recipient"},{code:6010,name:"InvalidSender",msg:"Invalid sender"},{code:6011,name:"InvalidTokenPair",msg:"Invalid token pair"},{code:6012,name:"InvalidTokenMint",msg:"Invalid token mint"}]},Sn={version:"0.1.0",name:"message_transmitter",instructions:[{name:"initialize",accounts:[{name:"payer",isMut:!0,isSigner:!0},{name:"upgradeAuthority",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"messageTransmitterProgramData",isMut:!1,isSigner:!1},{name:"messageTransmitterProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"InitializeParams"}}]},{name:"transferOwnership",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"TransferOwnershipParams"}}]},{name:"acceptOwnership",accounts:[{name:"pendingOwner",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"AcceptOwnershipParams"}}]},{name:"updatePauser",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"UpdatePauserParams"}}]},{name:"updateAttesterManager",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"UpdateAttesterManagerParams"}}]},{name:"pause",accounts:[{name:"pauser",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"PauseParams"}}]},{name:"unpause",accounts:[{name:"pauser",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"UnpauseParams"}}]},{name:"setMaxMessageBodySize",accounts:[{name:"owner",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"SetMaxMessageBodySizeParams"}}]},{name:"enableAttester",accounts:[{name:"payer",isMut:!0,isSigner:!0},{name:"attesterManager",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"EnableAttesterParams"}}]},{name:"disableAttester",accounts:[{name:"payer",isMut:!0,isSigner:!0},{name:"attesterManager",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"DisableAttesterParams"}}]},{name:"setSignatureThreshold",accounts:[{name:"attesterManager",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"SetSignatureThresholdParams"}}]},{name:"sendMessage",accounts:[{name:"eventRentPayer",isMut:!0,isSigner:!0},{name:"senderAuthorityPda",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"messageSentEventData",isMut:!0,isSigner:!0},{name:"senderProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"SendMessageParams"}}],returns:"u64"},{name:"sendMessageWithCaller",accounts:[{name:"eventRentPayer",isMut:!0,isSigner:!0},{name:"senderAuthorityPda",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"messageSentEventData",isMut:!0,isSigner:!0},{name:"senderProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"SendMessageWithCallerParams"}}],returns:"u64"},{name:"replaceMessage",accounts:[{name:"eventRentPayer",isMut:!0,isSigner:!0},{name:"senderAuthorityPda",isMut:!1,isSigner:!0},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"messageSentEventData",isMut:!0,isSigner:!0},{name:"senderProgram",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"ReplaceMessageParams"}}],returns:"u64"},{name:"receiveMessage",accounts:[{name:"payer",isMut:!0,isSigner:!0},{name:"caller",isMut:!1,isSigner:!0},{name:"authorityPda",isMut:!1,isSigner:!1},{name:"messageTransmitter",isMut:!1,isSigner:!1},{name:"usedNonces",isMut:!0,isSigner:!1},{name:"receiver",isMut:!1,isSigner:!1},{name:"systemProgram",isMut:!1,isSigner:!1},{name:"eventAuthority",isMut:!1,isSigner:!1},{name:"program",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"ReceiveMessageParams"}}]},{name:"reclaimEventAccount",accounts:[{name:"payee",isMut:!0,isSigner:!0,docs:["rent SOL receiver, should match original rent payer"]},{name:"messageTransmitter",isMut:!0,isSigner:!1},{name:"messageSentEventData",isMut:!0,isSigner:!1}],args:[{name:"params",type:{defined:"ReclaimEventAccountParams"}}]},{name:"getNoncePda",accounts:[{name:"messageTransmitter",isMut:!1,isSigner:!1}],args:[{name:"params",type:{defined:"GetNoncePDAParams"}}],returns:"publicKey"},{name:"isNonceUsed",accounts:[{name:"usedNonces",isMut:!1,isSigner:!1,docs:["Account will be explicitly loaded to avoid error when it's not initialized"]}],args:[{name:"params",type:{defined:"IsNonceUsedParams"}}],returns:"bool"}],accounts:[{name:"messageSent",type:{kind:"struct",fields:[{name:"rentPayer",type:"publicKey"},{name:"message",type:"bytes"}]}},{name:"messageTransmitter",docs:["Main state of the MessageTransmitter program"],type:{kind:"struct",fields:[{name:"owner",type:"publicKey"},{name:"pendingOwner",type:"publicKey"},{name:"attesterManager",type:"publicKey"},{name:"pauser",type:"publicKey"},{name:"paused",type:"bool"},{name:"localDomain",type:"u32"},{name:"version",type:"u32"},{name:"signatureThreshold",type:"u32"},{name:"enabledAttesters",type:{vec:"publicKey"}},{name:"maxMessageBodySize",type:"u64"},{name:"nextAvailableNonce",type:"u64"}]}},{name:"usedNonces",docs:["UsedNonces account holds an array of bits that indicate which nonces were already used","so they can't be resused to receive new messages. Array starts with the first_nonce and","holds flags for UsedNonces::MAX_NONCES. Nonces are recorded separately for each remote_domain."],type:{kind:"struct",fields:[{name:"remoteDomain",type:"u32"},{name:"firstNonce",type:"u64"},{name:"usedNonces",type:{array:["u64",100]}}]}}],types:[{name:"AcceptOwnershipParams",type:{kind:"struct",fields:[]}},{name:"DisableAttesterParams",type:{kind:"struct",fields:[{name:"attester",type:"publicKey"}]}},{name:"EnableAttesterParams",type:{kind:"struct",fields:[{name:"newAttester",type:"publicKey"}]}},{name:"GetNoncePDAParams",type:{kind:"struct",fields:[{name:"nonce",type:"u64"},{name:"sourceDomain",type:"u32"}]}},{name:"InitializeParams",type:{kind:"struct",fields:[{name:"localDomain",type:"u32"},{name:"attester",type:"publicKey"},{name:"maxMessageBodySize",type:"u64"},{name:"version",type:"u32"}]}},{name:"IsNonceUsedParams",type:{kind:"struct",fields:[{name:"nonce",type:"u64"}]}},{name:"PauseParams",type:{kind:"struct",fields:[]}},{name:"ReceiveMessageParams",type:{kind:"struct",fields:[{name:"message",type:"bytes"},{name:"attestation",type:"bytes"}]}},{name:"HandleReceiveMessageParams",type:{kind:"struct",fields:[{name:"remoteDomain",type:"u32"},{name:"sender",type:"publicKey"},{name:"messageBody",type:"bytes"},{name:"authorityBump",type:"u8"}]}},{name:"ReclaimEventAccountParams",type:{kind:"struct",fields:[{name:"attestation",type:"bytes"}]}},{name:"ReplaceMessageParams",type:{kind:"struct",fields:[{name:"originalMessage",type:"bytes"},{name:"originalAttestation",type:"bytes"},{name:"newMessageBody",type:"bytes"},{name:"newDestinationCaller",type:"publicKey"}]}},{name:"SendMessageWithCallerParams",type:{kind:"struct",fields:[{name:"destinationDomain",type:"u32"},{name:"recipient",type:"publicKey"},{name:"messageBody",type:"bytes"},{name:"destinationCaller",type:"publicKey"}]}},{name:"SendMessageParams",type:{kind:"struct",fields:[{name:"destinationDomain",type:"u32"},{name:"recipient",type:"publicKey"},{name:"messageBody",type:"bytes"}]}},{name:"SetMaxMessageBodySizeParams",type:{kind:"struct",fields:[{name:"newMaxMessageBodySize",type:"u64"}]}},{name:"SetSignatureThresholdParams",type:{kind:"struct",fields:[{name:"newSignatureThreshold",type:"u32"}]}},{name:"TransferOwnershipParams",type:{kind:"struct",fields:[{name:"newOwner",type:"publicKey"}]}},{name:"UnpauseParams",type:{kind:"struct",fields:[]}},{name:"UpdateAttesterManagerParams",type:{kind:"struct",fields:[{name:"newAttesterManager",type:"publicKey"}]}},{name:"UpdatePauserParams",type:{kind:"struct",fields:[{name:"newPauser",type:"publicKey"}]}},{name:"MathError",type:{kind:"enum",variants:[{name:"MathOverflow"},{name:"MathUnderflow"},{name:"ErrorInDivision"}]}}],events:[{name:"OwnershipTransferStarted",fields:[{name:"previousOwner",type:"publicKey",index:!1},{name:"newOwner",type:"publicKey",index:!1}]},{name:"OwnershipTransferred",fields:[{name:"previousOwner",type:"publicKey",index:!1},{name:"newOwner",type:"publicKey",index:!1}]},{name:"PauserChanged",fields:[{name:"newAddress",type:"publicKey",index:!1}]},{name:"AttesterManagerUpdated",fields:[{name:"previousAttesterManager",type:"publicKey",index:!1},{name:"newAttesterManager",type:"publicKey",index:!1}]},{name:"MessageReceived",fields:[{name:"caller",type:"publicKey",index:!1},{name:"sourceDomain",type:"u32",index:!1},{name:"nonce",type:"u64",index:!1},{name:"sender",type:"publicKey",index:!1},{name:"messageBody",type:"bytes",index:!1}]},{name:"SignatureThresholdUpdated",fields:[{name:"oldSignatureThreshold",type:"u32",index:!1},{name:"newSignatureThreshold",type:"u32",index:!1}]},{name:"AttesterEnabled",fields:[{name:"attester",type:"publicKey",index:!1}]},{name:"AttesterDisabled",fields:[{name:"attester",type:"publicKey",index:!1}]},{name:"MaxMessageBodySizeUpdated",fields:[{name:"newMaxMessageBodySize",type:"u64",index:!1}]},{name:"Pause",fields:[]},{name:"Unpause",fields:[]}],errors:[{code:6e3,name:"InvalidAuthority",msg:"Invalid authority"},{code:6001,name:"ProgramPaused",msg:"Instruction is not allowed at this time"},{code:6002,name:"InvalidMessageTransmitterState",msg:"Invalid message transmitter state"},{code:6003,name:"InvalidSignatureThreshold",msg:"Invalid signature threshold"},{code:6004,name:"SignatureThresholdAlreadySet",msg:"Signature threshold already set"},{code:6005,name:"InvalidOwner",msg:"Invalid owner"},{code:6006,name:"InvalidPauser",msg:"Invalid pauser"},{code:6007,name:"InvalidAttesterManager",msg:"Invalid attester manager"},{code:6008,name:"InvalidAttester",msg:"Invalid attester"},{code:6009,name:"AttesterAlreadyEnabled",msg:"Attester already enabled"},{code:6010,name:"TooFewEnabledAttesters",msg:"Too few enabled attesters"},{code:6011,name:"SignatureThresholdTooLow",msg:"Signature threshold is too low"},{code:6012,name:"AttesterAlreadyDisabled",msg:"Attester already disabled"},{code:6013,name:"MessageBodyLimitExceeded",msg:"Message body exceeds max size"},{code:6014,name:"InvalidDestinationCaller",msg:"Invalid destination caller"},{code:6015,name:"InvalidRecipient",msg:"Invalid message recipient"},{code:6016,name:"SenderNotPermitted",msg:"Sender is not permitted"},{code:6017,name:"InvalidSourceDomain",msg:"Invalid source domain"},{code:6018,name:"InvalidDestinationDomain",msg:"Invalid destination domain"},{code:6019,name:"InvalidMessageVersion",msg:"Invalid message version"},{code:6020,name:"InvalidUsedNoncesAccount",msg:"Invalid used nonces account"},{code:6021,name:"InvalidRecipientProgram",msg:"Invalid recipient program"},{code:6022,name:"InvalidNonce",msg:"Invalid nonce"},{code:6023,name:"NonceAlreadyUsed",msg:"Nonce already used"},{code:6024,name:"MessageTooShort",msg:"Message is too short"},{code:6025,name:"MalformedMessage",msg:"Malformed message"},{code:6026,name:"InvalidSignatureOrderOrDupe",msg:"Invalid signature order or dupe"},{code:6027,name:"InvalidAttesterSignature",msg:"Invalid attester signature"},{code:6028,name:"InvalidAttestationLength",msg:"Invalid attestation length"},{code:6029,name:"InvalidSignatureRecoveryId",msg:"Invalid signature recovery ID"},{code:6030,name:"InvalidSignatureSValue",msg:"Invalid signature S value"},{code:6031,name:"InvalidMessageHash",msg:"Invalid message hash"}]};ht.registerProtocol($._platform,"CircleBridge",ye);const Be={TokenMessengerIdl:bn,MessageTransmitterIdl:Sn};exports.SolanaCircleBridge=ye;exports.idl=Be;