@wormhole-foundation/wormhole-connect 4.1.0-beta.1-development → 5.0.0

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 (352) hide show
  1. package/dist/assets/{aptos-C9pj8h2Q.js → aptos-DgUCX7ng.js} +3 -3
  2. package/dist/assets/{evm-DCydYqBI.js → evm-B6bqAPTR.js} +4 -4
  3. package/dist/assets/{evm-CJXv6IQV.js → evm-Ve5nG8Fs.js} +1 -1
  4. package/dist/assets/{index-LvDsy6wR.js → index-BJokXZAc.js} +1 -1
  5. package/dist/assets/{index-BqxX-Ey7.js → index-BJv9sngo.js} +1 -1
  6. package/dist/assets/{index-C9cy4cDs.js → index-BjZMFLjq.js} +1 -1
  7. package/dist/assets/{index-FJ-n91Op.js → index-BwbPlAQZ.js} +1 -1
  8. package/dist/assets/{index-Clu5I99l.js → index-Bzg4DNh9.js} +1 -1
  9. package/dist/assets/{index-ezhfpCvx.js → index-CKXa657f.js} +1 -1
  10. package/dist/assets/index-CXiuP738.js +1 -0
  11. package/dist/assets/{index-CNExx9Zb.js → index-CvTvoHH-.js} +1 -1
  12. package/dist/assets/{index-C25bHdOM.js → index-D1ULRVbZ.js} +1 -1
  13. package/dist/assets/{index-DpabQJOX.js → index-DlH9IMQl.js} +1 -1
  14. package/dist/assets/{index-C8u74RER.js → index-Dsb-5apv.js} +1 -1
  15. package/dist/assets/{index-D9ApKauA.js → index-_YFUWLUM.js} +1 -1
  16. package/dist/assets/{index-CoIvdDsX.js → index-jg26xdEi.js} +1 -1
  17. package/dist/assets/{provider-jsonrpc-DuMpLBV0.js → provider-jsonrpc-DNgUKjG6.js} +1 -1
  18. package/dist/assets/{solana-DWuIx6gK.js → solana-D4RepnSA.js} +2 -2
  19. package/dist/assets/{sui-BcTGBE_4.js → sui-Du5h-f8S.js} +3 -3
  20. package/dist/main.mjs +185 -140
  21. package/dist/src/components/ConfigurablePageHeader.d.ts +1 -1
  22. package/dist/src/components/ConfigurablePageHeader.d.ts.map +1 -1
  23. package/dist/src/components/Header.d.ts +1 -0
  24. package/dist/src/components/Header.d.ts.map +1 -1
  25. package/dist/src/components/PageHeader.d.ts +1 -3
  26. package/dist/src/components/PageHeader.d.ts.map +1 -1
  27. package/dist/src/components/SampleApp/index.d.ts.map +1 -1
  28. package/dist/src/components/v3/BackButton.d.ts +6 -0
  29. package/dist/src/components/v3/BackButton.d.ts.map +1 -0
  30. package/dist/src/components/v3/FormContent.d.ts +5 -0
  31. package/dist/src/components/v3/FormContent.d.ts.map +1 -0
  32. package/dist/src/config/constants.d.ts.map +1 -1
  33. package/dist/src/config/events.d.ts +2 -1
  34. package/dist/src/config/events.d.ts.map +1 -1
  35. package/dist/src/config/mainnet/chains.d.ts.map +1 -1
  36. package/dist/src/config/mainnet/rpcs.d.ts.map +1 -1
  37. package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
  38. package/dist/src/config/mainnet/wrappedTokens.d.ts +6 -0
  39. package/dist/src/config/mainnet/wrappedTokens.d.ts.map +1 -1
  40. package/dist/src/config/types.d.ts +6 -11
  41. package/dist/src/config/types.d.ts.map +1 -1
  42. package/dist/src/config/ui.d.ts +9 -0
  43. package/dist/src/config/ui.d.ts.map +1 -1
  44. package/dist/src/consts/wallet.d.ts.map +1 -1
  45. package/dist/src/hooks/useAutoEnableGasDropoff.d.ts +3 -1
  46. package/dist/src/hooks/useAutoEnableGasDropoff.d.ts.map +1 -1
  47. package/dist/src/hooks/useConnectToLastUsedWallet.d.ts.map +1 -1
  48. package/dist/src/hooks/useSortedRoutesWithQuotes.d.ts.map +1 -1
  49. package/dist/src/hooks/useTransactionHistory.d.ts.map +1 -1
  50. package/dist/src/hooks/useTransactionHistoryLiFi.d.ts +2 -0
  51. package/dist/src/hooks/useTransactionHistoryLiFi.d.ts.map +1 -1
  52. package/dist/src/hooks/useTransactionHistoryMayan.d.ts +2 -0
  53. package/dist/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
  54. package/dist/src/hooks/useTransactionHistoryWHScan.d.ts +2 -1
  55. package/dist/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
  56. package/dist/src/icons/PoweredBy.d.ts.map +1 -1
  57. package/dist/src/icons/TokenIcons.d.ts.map +1 -1
  58. package/dist/src/icons/Tokens/AUSD.d.ts +4 -0
  59. package/dist/src/icons/Tokens/AUSD.d.ts.map +1 -0
  60. package/dist/src/routes/lifi/LiFiRoute.d.ts.map +1 -1
  61. package/dist/src/routes/mayan/utils.d.ts.map +1 -1
  62. package/dist/src/routes/monad/consts.d.ts +1 -0
  63. package/dist/src/routes/monad/consts.d.ts.map +1 -1
  64. package/dist/src/routes/monad/monad.test.d.ts +1 -0
  65. package/dist/src/routes/monad/monad.test.d.ts.map +1 -0
  66. package/dist/src/routes/monad/utils.d.ts.map +1 -1
  67. package/dist/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
  68. package/dist/src/telemetry/types.d.ts +5 -2
  69. package/dist/src/telemetry/types.d.ts.map +1 -1
  70. package/dist/src/theme.d.ts +4 -3
  71. package/dist/src/theme.d.ts.map +1 -1
  72. package/dist/src/utils/errors.d.ts +1 -0
  73. package/dist/src/utils/errors.d.ts.map +1 -1
  74. package/dist/src/utils/fees.d.ts.map +1 -1
  75. package/dist/src/utils/index.d.ts.map +1 -1
  76. package/dist/src/utils/sdkv2.d.ts.map +1 -1
  77. package/dist/src/utils/wallet/index.d.ts +1 -0
  78. package/dist/src/utils/wallet/index.d.ts.map +1 -1
  79. package/dist/src/views/Terms.d.ts.map +1 -1
  80. package/dist/src/views/TxSearch.d.ts.map +1 -1
  81. package/dist/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts.map +1 -1
  82. package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts +17 -0
  83. package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts.map +1 -0
  84. package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts +8 -0
  85. package/dist/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts.map +1 -0
  86. package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts +2 -0
  87. package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts.map +1 -0
  88. package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts +2 -0
  89. package/dist/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts.map +1 -0
  90. package/dist/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
  91. package/dist/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
  92. package/dist/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  93. package/dist/src/views/v3/Bridge/Routes/index.d.ts +2 -1
  94. package/dist/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
  95. package/dist/src/views/v3/Bridge/WalletConnector/Controller.d.ts.map +1 -1
  96. package/dist/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts.map +1 -1
  97. package/dist/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts +9 -0
  98. package/dist/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts.map +1 -0
  99. package/dist/src/views/v3/Bridge/WalletConnector/WalletPickerContent.d.ts.map +1 -1
  100. package/dist/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts +2 -0
  101. package/dist/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts.map +1 -0
  102. package/dist/src/views/v3/Bridge/index.d.ts.map +1 -1
  103. package/dist/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
  104. package/dist/src/views/v3/Redeem/index.d.ts.map +1 -1
  105. package/dist/src/views/v3/TxHistory/Item/index.d.ts.map +1 -1
  106. package/dist/src/views/v3/TxHistory/Widget/Item.d.ts.map +1 -1
  107. package/lib/{account-cIQhxn1E.js → account-K005OXgL.js} +1 -1
  108. package/lib/{account-BVl6Reot.mjs → account-TXlxMyv4.mjs} +2 -2
  109. package/lib/{address-rVHWlcKQ.mjs → address-CX0E32ut.mjs} +1 -1
  110. package/lib/{address-W9jn6Qdk.js → address-DqbIfKOu.js} +1 -1
  111. package/lib/{aptos-DWDR5o78.js → aptos-BnjZOhUE.js} +1 -1
  112. package/lib/{aptos-CNHYHK9c.js → aptos-CnswqE-C.js} +2 -2
  113. package/lib/{aptos-D1WFzBMy.mjs → aptos-DRfXJ8Ba.mjs} +7 -7
  114. package/lib/{aptos-B84P9rJZ.mjs → aptos-fTiHvXXE.mjs} +5 -5
  115. package/lib/{associatedTokenAccount-C4vEEbG5.js → associatedTokenAccount-CeqdaO2m.js} +1 -1
  116. package/lib/{associatedTokenAccount-DF6phO3l.mjs → associatedTokenAccount-Dsm4Hq32.mjs} +3 -3
  117. package/lib/{basic-BERCwt2M.mjs → basic-BqusrmRE.mjs} +3 -3
  118. package/lib/{basic-NhXxxbR1.js → basic-BrW22Cj9.js} +1 -1
  119. package/lib/{basic-CukRIaOD.mjs → basic-CK5Bsf0B.mjs} +3 -3
  120. package/lib/{basic-DJXXfABO.js → basic-ChOmeQQk.js} +1 -1
  121. package/lib/{chunk-KJH4KKG6-Brt4fyqz.mjs → chunk-KJH4KKG6-BfVMUPsB.mjs} +3 -3
  122. package/lib/{chunk-KJH4KKG6-BbF5W1_N.js → chunk-KJH4KKG6-CJx-rDa6.js} +1 -1
  123. package/lib/constants-C1w_RyOP.js +1 -0
  124. package/lib/{constants-VaoVbllu.mjs → constants-DcDpDarO.mjs} +6 -5
  125. package/lib/{core-BCZrVb_s.mjs → core-DQ-6Q1F1.mjs} +6 -6
  126. package/lib/{core-BE6SS7Ye.js → core-FA2gBc-s.js} +3 -3
  127. package/lib/{create-CChLkbGc.mjs → create-C5dhTMHL.mjs} +1 -1
  128. package/lib/{create-4w0DrcRO.js → create-bA3Gyivs.js} +1 -1
  129. package/lib/{evm-CmmnpcFD.mjs → evm-BJ4Lx-r9.mjs} +5 -5
  130. package/lib/{evm--K7mr7Kr.js → evm-BTgO_HRP.js} +2 -2
  131. package/lib/{evm-DKaWm7eC.mjs → evm-C-vXMfGr.mjs} +7 -7
  132. package/lib/{evm-C5BixKBn.js → evm-qxndAh3z.js} +1 -1
  133. package/lib/executor.js +1 -1
  134. package/lib/executor.mjs +13 -15
  135. package/lib/hosted.js +1 -1
  136. package/lib/hosted.mjs +1 -1
  137. package/lib/hypercore-D7kZiwbe.js +4 -0
  138. package/lib/{hypercore-birmbh9T.mjs → hypercore-DKqayfki.mjs} +4858 -3107
  139. package/lib/{index-qL4D-cpk.js → index-1T4sIL8n.js} +1 -1
  140. package/lib/{index-Ap7250Gf.mjs → index-39tU5Y5t.mjs} +6 -6
  141. package/lib/{index-BUbUhbMe.js → index-3Zg1AdoI.js} +1 -1
  142. package/lib/{index-D7gCsil9.js → index-6m7yero0.js} +1 -1
  143. package/lib/{index-CH0iw38J.mjs → index-B1URQBlH.mjs} +3 -3
  144. package/lib/{index-C5I7QiZ7.mjs → index-B6Ppg6EZ.mjs} +3 -3
  145. package/lib/{index-CED5jdrg.js → index-B7b8sctd.js} +1 -1
  146. package/lib/{index-xvG6cxNx.js → index-BEIFBxtP.js} +1 -1
  147. package/lib/{index-zIzzPp6D.mjs → index-BHpJUZne.mjs} +3 -3
  148. package/lib/{index-BTcij9Np.js → index-BJ0xVutl.js} +1 -1
  149. package/lib/{index-C61IKE_V.mjs → index-BSIPYyeZ.mjs} +2 -2
  150. package/lib/{index-EbSw7SbC.js → index-BTjUHY0e.js} +1 -1
  151. package/lib/{index-C8YhpD9T.mjs → index-BVciucyT.mjs} +4 -4
  152. package/lib/{index-BuHdMHLz.mjs → index-Ba1zbu3Q.mjs} +2 -2
  153. package/lib/{index-BU35GfG0.mjs → index-Bdtj4LUz.mjs} +2 -2
  154. package/lib/{index-Bs28m4ya.js → index-BfzaCmg7.js} +1 -1
  155. package/lib/{index-CN7M4gwf.mjs → index-BviSNDV7.mjs} +5 -5
  156. package/lib/{index-BRFbmsc_.js → index-C-F8_8dY.js} +1 -1
  157. package/lib/{index-Cys9e11O.js → index-C-SMuVS3.js} +1 -1
  158. package/lib/{index-pYTU7pQK.mjs → index-C6MalNd5.mjs} +4 -3
  159. package/lib/{index-Cg1Xo1eZ.js → index-C85u3Gj5.js} +1 -1
  160. package/lib/{index-Da9rvmCc.js → index-Cb0UWLGI.js} +1 -1
  161. package/lib/{index-HrZv1SyT.js → index-Cb_8WAm1.js} +8 -8
  162. package/lib/{index-DHnmtpvA.mjs → index-CcbY14s5.mjs} +4 -4
  163. package/lib/{index-CR1itkLl.mjs → index-CgqBQ88K.mjs} +3248 -3055
  164. package/lib/{index-Txz5xwr6.mjs → index-CowAVUcg.mjs} +1 -1
  165. package/lib/{index-BKgliEPZ.mjs → index-CrWTw0Se.mjs} +2 -2
  166. package/lib/{index-B_JJ50Y-.mjs → index-D-HUNEka.mjs} +4 -4
  167. package/lib/{index-BhMcIAHt.js → index-DJ2w1fz1.js} +1 -1
  168. package/lib/{index-BN_2mA2n.mjs → index-DcFL403C.mjs} +1 -1
  169. package/lib/{index-CO4ZoIAU.mjs → index-DjmVBSGQ.mjs} +4 -4
  170. package/lib/{index-Co3mm7UN.mjs → index-DrJE8udd.mjs} +1 -1
  171. package/lib/{index-fTUcaKb4.js → index-DuhYwr0t.js} +1 -1
  172. package/lib/{index-BQ0lWQfT.mjs → index-DwEx1Hn-.mjs} +2 -2
  173. package/lib/{index-DBofyYkS.js → index-DziujHu1.js} +1 -1
  174. package/lib/{index-Dou5sFku.js → index-JWbF-m3e.js} +1 -1
  175. package/lib/index-Oxm0y6-t.js +1 -0
  176. package/lib/{index-D1odbjeH.mjs → index-VnJcNK62.mjs} +3 -3
  177. package/lib/{index-DVxmRy4C.js → index-WrXSs0ic.js} +1 -1
  178. package/lib/{index-Cw0jWBks.js → index-XjDX4fWv.js} +1 -1
  179. package/lib/{index-CsdD1TNi.js → index-aMKUba1k.js} +1 -1
  180. package/lib/{index-DSnylejH.mjs → index-dufPAW5T.mjs} +292 -269
  181. package/lib/{index-lZY5fTXF.js → index-lAqXlt-a.js} +1 -1
  182. package/lib/{index-N4FkpEh9.mjs → index-mNO1mk2F.mjs} +4 -4
  183. package/lib/{index-BScgBddV.mjs → index-o1SAPXm_.mjs} +3 -3
  184. package/lib/{index-DNZ-Pkpm.mjs → index-rxQSA9t0.mjs} +6 -6
  185. package/lib/{index-DALvn9lg.js → index-v7w8krM0.js} +1 -1
  186. package/lib/{index-japympio.js → index-wadjmD_G.js} +1 -1
  187. package/lib/{index.es-DmmqAOLD.js → index.es-B9kBDkCQ.js} +3 -3
  188. package/lib/{index.es-Dg6IFrL4.js → index.es-BZRO-bNH.js} +1 -1
  189. package/lib/{index.es-B0fk_42a.mjs → index.es-CF3YY88z.mjs} +4 -4
  190. package/lib/{index.es-CDqFguL5.mjs → index.es-CaAL5X4E.mjs} +4 -4
  191. package/lib/index.js +78 -33
  192. package/lib/index.mjs +9158 -8833
  193. package/lib/{keypair-DWucLGoA.js → keypair-DCgXFOw5.js} +1 -1
  194. package/lib/{keypair-CP7syX9B.mjs → keypair-vpG2fl-q.mjs} +3 -3
  195. package/lib/lifi.js +1 -1
  196. package/lib/lifi.mjs +75 -76
  197. package/lib/mayan.js +2 -2
  198. package/lib/mayan.mjs +11 -10
  199. package/lib/{mint-CoNdQTGM.mjs → mint-BPrKG-Zc.mjs} +3 -3
  200. package/lib/{mint-CxQ6P5lT.js → mint-DW-XgF68.js} +1 -1
  201. package/lib/monad.js +1 -1
  202. package/lib/monad.mjs +91 -58
  203. package/lib/multiToken-B9BoSxdr.js +1 -0
  204. package/lib/{multiToken-Bm-K5dRJ.mjs → multiToken-DMllgxzT.mjs} +4 -3
  205. package/lib/ntt.js +2 -2
  206. package/lib/ntt.mjs +77 -86
  207. package/lib/{platform-Cil_UtAQ.mjs → platform-CSpAb386.mjs} +2788 -2748
  208. package/lib/{platform-BMKYxqvv.js → platform-Csj1Outc.js} +1 -1
  209. package/lib/platform-DCcL7jHP.js +11 -0
  210. package/lib/{platform-vRQufc6j.mjs → platform-YzJZdSCf.mjs} +3 -3
  211. package/lib/{secp256k1-LTcmQEQ5.mjs → secp256k1-1o6o1kFy.mjs} +1 -1
  212. package/lib/{secp256k1-DzRCmd6a.mjs → secp256k1-BjlnTj1_.mjs} +1 -1
  213. package/lib/{secp256k1-CglUNI04.js → secp256k1-CeYT4ndf.js} +1 -1
  214. package/lib/{secp256k1-DROP2Lhv.mjs → secp256k1-Cw_BiEuN.mjs} +1 -1
  215. package/lib/{secp256k1-BkoM1Jum.js → secp256k1-D5cKS6q_.js} +1 -1
  216. package/lib/{secp256k1-CcVQkYNr.js → secp256k1-_QlJc7sK.js} +1 -1
  217. package/lib/{signer-0hWrZ5BZ.mjs → signer-D2GRgRrw.mjs} +2 -2
  218. package/lib/{signer-DyqulDUM.js → signer-gjSiV5v3.js} +1 -1
  219. package/lib/solana-DfW5T_64.mjs +18 -0
  220. package/lib/{solana-C4k_Yg7w.js → solana-DvHFhri3.js} +4 -4
  221. package/lib/solana-Edd9tIkX.js +1 -0
  222. package/lib/{solana-D1LVIhGd.mjs → solana-TgPr9kpk.mjs} +10 -10
  223. package/lib/{solanaEmbed.esm-AvWQUA9e.mjs → solanaEmbed.esm-Bh1-aAL4.mjs} +4 -4
  224. package/lib/{solanaEmbed.esm--Ac-IlRA.js → solanaEmbed.esm-C8TjRcIV.js} +1 -1
  225. package/lib/{solidity-CbDkqHjE.js → solidity-BW7c8rFv.js} +1 -1
  226. package/lib/{solidity-Dk_mvceo.mjs → solidity-D9gSgFcp.mjs} +1 -1
  227. package/lib/src/components/ConfigurablePageHeader.d.ts +1 -1
  228. package/lib/src/components/ConfigurablePageHeader.d.ts.map +1 -1
  229. package/lib/src/components/Header.d.ts +1 -0
  230. package/lib/src/components/Header.d.ts.map +1 -1
  231. package/lib/src/components/PageHeader.d.ts +1 -3
  232. package/lib/src/components/PageHeader.d.ts.map +1 -1
  233. package/lib/src/components/SampleApp/index.d.ts.map +1 -1
  234. package/lib/src/components/v3/BackButton.d.ts +6 -0
  235. package/lib/src/components/v3/BackButton.d.ts.map +1 -0
  236. package/lib/src/components/v3/FormContent.d.ts +5 -0
  237. package/lib/src/components/v3/FormContent.d.ts.map +1 -0
  238. package/lib/src/config/constants.d.ts.map +1 -1
  239. package/lib/src/config/events.d.ts +2 -1
  240. package/lib/src/config/events.d.ts.map +1 -1
  241. package/lib/src/config/mainnet/chains.d.ts.map +1 -1
  242. package/lib/src/config/mainnet/rpcs.d.ts.map +1 -1
  243. package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
  244. package/lib/src/config/mainnet/wrappedTokens.d.ts +6 -0
  245. package/lib/src/config/mainnet/wrappedTokens.d.ts.map +1 -1
  246. package/lib/src/config/types.d.ts +6 -11
  247. package/lib/src/config/types.d.ts.map +1 -1
  248. package/lib/src/config/ui.d.ts +9 -0
  249. package/lib/src/config/ui.d.ts.map +1 -1
  250. package/lib/src/consts/wallet.d.ts.map +1 -1
  251. package/lib/src/hooks/useAutoEnableGasDropoff.d.ts +3 -1
  252. package/lib/src/hooks/useAutoEnableGasDropoff.d.ts.map +1 -1
  253. package/lib/src/hooks/useConnectToLastUsedWallet.d.ts.map +1 -1
  254. package/lib/src/hooks/useSortedRoutesWithQuotes.d.ts.map +1 -1
  255. package/lib/src/hooks/useTransactionHistory.d.ts.map +1 -1
  256. package/lib/src/hooks/useTransactionHistoryLiFi.d.ts +2 -0
  257. package/lib/src/hooks/useTransactionHistoryLiFi.d.ts.map +1 -1
  258. package/lib/src/hooks/useTransactionHistoryMayan.d.ts +2 -0
  259. package/lib/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
  260. package/lib/src/hooks/useTransactionHistoryWHScan.d.ts +2 -1
  261. package/lib/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
  262. package/lib/src/icons/PoweredBy.d.ts.map +1 -1
  263. package/lib/src/icons/TokenIcons.d.ts.map +1 -1
  264. package/lib/src/icons/Tokens/AUSD.d.ts +4 -0
  265. package/lib/src/icons/Tokens/AUSD.d.ts.map +1 -0
  266. package/lib/src/routes/lifi/LiFiRoute.d.ts.map +1 -1
  267. package/lib/src/routes/mayan/utils.d.ts.map +1 -1
  268. package/lib/src/routes/monad/consts.d.ts +1 -0
  269. package/lib/src/routes/monad/consts.d.ts.map +1 -1
  270. package/lib/src/routes/monad/monad.test.d.ts +1 -0
  271. package/lib/src/routes/monad/monad.test.d.ts.map +1 -0
  272. package/lib/src/routes/monad/utils.d.ts.map +1 -1
  273. package/lib/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
  274. package/lib/src/telemetry/types.d.ts +5 -2
  275. package/lib/src/telemetry/types.d.ts.map +1 -1
  276. package/lib/src/theme.d.ts +4 -3
  277. package/lib/src/theme.d.ts.map +1 -1
  278. package/lib/src/utils/errors.d.ts +1 -0
  279. package/lib/src/utils/errors.d.ts.map +1 -1
  280. package/lib/src/utils/fees.d.ts.map +1 -1
  281. package/lib/src/utils/index.d.ts.map +1 -1
  282. package/lib/src/utils/sdkv2.d.ts.map +1 -1
  283. package/lib/src/utils/wallet/index.d.ts +1 -0
  284. package/lib/src/utils/wallet/index.d.ts.map +1 -1
  285. package/lib/src/views/Terms.d.ts.map +1 -1
  286. package/lib/src/views/TxSearch.d.ts.map +1 -1
  287. package/lib/src/views/v3/Bridge/AssetPicker/PickerModal.d.ts.map +1 -1
  288. package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts +17 -0
  289. package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButton.d.ts.map +1 -0
  290. package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts +8 -0
  291. package/lib/src/views/v3/Bridge/AssetPicker/TokenPickerButtonContent.d.ts.map +1 -0
  292. package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts +2 -0
  293. package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButton.test.d.ts.map +1 -0
  294. package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts +2 -0
  295. package/lib/src/views/v3/Bridge/AssetPicker/__tests__/TokenPickerButtonContent.test.d.ts.map +1 -0
  296. package/lib/src/views/v3/Bridge/AssetPicker/index.d.ts.map +1 -1
  297. package/lib/src/views/v3/Bridge/GasSlider/index.d.ts.map +1 -1
  298. package/lib/src/views/v3/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  299. package/lib/src/views/v3/Bridge/Routes/index.d.ts +2 -1
  300. package/lib/src/views/v3/Bridge/Routes/index.d.ts.map +1 -1
  301. package/lib/src/views/v3/Bridge/WalletConnector/Controller.d.ts.map +1 -1
  302. package/lib/src/views/v3/Bridge/WalletConnector/ExplorerLink.d.ts.map +1 -1
  303. package/lib/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts +9 -0
  304. package/lib/src/views/v3/Bridge/WalletConnector/WalletAddress.d.ts.map +1 -0
  305. package/lib/src/views/v3/Bridge/WalletConnector/WalletPickerContent.d.ts.map +1 -1
  306. package/lib/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts +2 -0
  307. package/lib/src/views/v3/Bridge/WalletConnector/__tests__/WalletAddress.test.d.ts.map +1 -0
  308. package/lib/src/views/v3/Bridge/index.d.ts.map +1 -1
  309. package/lib/src/views/v3/Redeem/TransactionDetails/index.d.ts.map +1 -1
  310. package/lib/src/views/v3/Redeem/index.d.ts.map +1 -1
  311. package/lib/src/views/v3/TxHistory/Item/index.d.ts.map +1 -1
  312. package/lib/src/views/v3/TxHistory/Widget/Item.d.ts.map +1 -1
  313. package/lib/{sui-LiXjD27c.js → sui-BtyZE8YC.js} +1 -1
  314. package/lib/{sui-BPAb7kcs.mjs → sui-CoWRa3vr.mjs} +4 -4
  315. package/lib/{sui-CgmDTkXK.js → sui-DwFrGd2Y.js} +1 -1
  316. package/lib/{sui-cpCvd7RC.mjs → sui-QP4AZGNc.mjs} +6 -6
  317. package/lib/{tokenHelpers-CbE0g9BP.js → tokenHelpers-CeTyb4rG.js} +1 -1
  318. package/lib/{tokenHelpers-DvWQs1tu.mjs → tokenHelpers-VYjmKUxj.mjs} +1 -1
  319. package/lib/{tokens-BJDttoCp.mjs → tokens-D6uJqrsR.mjs} +3 -3
  320. package/lib/{tokens-CvZuVW-g.js → tokens-mXZqt-qL.js} +1 -1
  321. package/lib/types-CgveSjsw.js +1 -0
  322. package/lib/{types-iFgwQ7vG.mjs → types-Dxx2g1wS.mjs} +170 -168
  323. package/lib/{unsignedTransaction-DCDxTFq8.mjs → unsignedTransaction-D2Ja0SuN.mjs} +2 -2
  324. package/lib/{unsignedTransaction-DA4tlY5u.js → unsignedTransaction-qRBv5Cnd.js} +2 -2
  325. package/lib/{utils-DMf7wRGI.js → utils-BEljbqMf.js} +1 -1
  326. package/lib/{utils-BSxsyW2c.mjs → utils-mBHX3Jpu.mjs} +4 -4
  327. package/lib/{w3m-modal-DM5Pf8SH.mjs → w3m-modal-BEe8ji9_.mjs} +2 -2
  328. package/lib/{w3m-modal-CtQ0TPA4.mjs → w3m-modal-D3eqrCT1.mjs} +2 -2
  329. package/lib/{w3m-modal-k23UDiov.js → w3m-modal-Duc13ei7.js} +1 -1
  330. package/lib/{w3m-modal-ByamyZny.js → w3m-modal-f_sUVzPx.js} +1 -1
  331. package/lib/{wallet-CMTEE6Oa.mjs → wallet-Cyosy4Hc.mjs} +1 -1
  332. package/lib/{wallet-BMli0fbu.js → wallet-a0_jwP8j.js} +1 -1
  333. package/lib/{web3-CUwFm9Lx.mjs → web3-CdErAVj5.mjs} +2 -2
  334. package/lib/{web3-DdUeM7iQ.js → web3-x1WCGDiy.js} +1 -1
  335. package/package.json +49 -47
  336. package/dist/assets/index-_UMHESh0.js +0 -1
  337. package/dist/src/components/Button.d.ts +0 -13
  338. package/dist/src/components/Button.d.ts.map +0 -1
  339. package/dist/src/icons/Down.d.ts +0 -5
  340. package/dist/src/icons/Down.d.ts.map +0 -1
  341. package/lib/constants-B9TBfA4z.js +0 -1
  342. package/lib/hypercore-4R7JGmbr.js +0 -4
  343. package/lib/index-C8eqQ_7p.js +0 -1
  344. package/lib/multiToken-YoNvxjur.js +0 -1
  345. package/lib/platform-CCG_jgOO.js +0 -11
  346. package/lib/solana-DKFJvqX8.mjs +0 -18
  347. package/lib/solana-Dmje_Si8.js +0 -1
  348. package/lib/src/components/Button.d.ts +0 -13
  349. package/lib/src/components/Button.d.ts.map +0 -1
  350. package/lib/src/icons/Down.d.ts +0 -5
  351. package/lib/src/icons/Down.d.ts.map +0 -1
  352. package/lib/types-CjNs2oB0.js +0 -1
@@ -1,3 +1,3 @@
1
- "use strict";const $=require("./platform-CCG_jgOO.js"),F=require("./unsignedTransaction-DA4tlY5u.js");function br(r){if(r!==void 0)return{connection:r}}var Ae={},L={},Mt;function $t(){if(Mt)return L;Mt=1;class r{constructor(o,a){if(!Number.isInteger(o))throw new TypeError("span must be an integer");this.span=o,this.property=a}makeDestinationObject(){return{}}decode(o,a){throw new Error("Layout is abstract")}encode(o,a,f){throw new Error("Layout is abstract")}getSpan(o,a){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(o){const a=Object.create(this.constructor.prototype);return Object.assign(a,this),a.property=o,a}fromArray(o){}}L.Layout=r;function t(g,o){return o.property?g+"["+o.property+"]":g}L.nameWithProperty=t;function e(g,o){if(typeof g!="function")throw new TypeError("Class must be constructor");if(g.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(o&&o instanceof r))throw new TypeError("layout must be a Layout");if(o.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");g.layout_=o,o.boundConstructor_=g,o.makeDestinationObject=(()=>new g),Object.defineProperty(g.prototype,"encode",{value:function(a,f){return o.encode(this,a,f)},writable:!0}),Object.defineProperty(g,"decode",{value:function(a,f){return o.decode(a,f)},writable:!0})}L.bindConstructorLayout=e;class n extends r{isCount(){throw new Error("ExternalLayout is abstract")}}class s extends n{constructor(o,a){if(o===void 0&&(o=1),!Number.isInteger(o)||0>=o)throw new TypeError("elementSpan must be a (positive) integer");super(-1,a),this.elementSpan=o}isCount(){return!0}decode(o,a){a===void 0&&(a=0);const f=o.length-a;return Math.floor(f/this.elementSpan)}encode(o,a,f){return 0}}class i extends n{constructor(o,a,f){if(!(o instanceof r))throw new TypeError("layout must be a Layout");if(a===void 0)a=0;else if(!Number.isInteger(a))throw new TypeError("offset must be integer or undefined");super(o.span,f||o.property),this.layout=o,this.offset=a}isCount(){return this.layout instanceof u||this.layout instanceof c}decode(o,a){return a===void 0&&(a=0),this.layout.decode(o,a+this.offset)}encode(o,a,f){return f===void 0&&(f=0),this.layout.encode(o,a,f+this.offset)}}class u extends r{constructor(o,a){if(super(o,a),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(o,a){return a===void 0&&(a=0),o.readUIntLE(a,this.span)}encode(o,a,f){return f===void 0&&(f=0),a.writeUIntLE(o,f,this.span),this.span}}class c extends r{constructor(o,a){if(super(o,a),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(o,a){return a===void 0&&(a=0),o.readUIntBE(a,this.span)}encode(o,a,f){return f===void 0&&(f=0),a.writeUIntBE(o,f,this.span),this.span}}class w extends r{constructor(o,a){if(super(o,a),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(o,a){return a===void 0&&(a=0),o.readIntLE(a,this.span)}encode(o,a,f){return f===void 0&&(f=0),a.writeIntLE(o,f,this.span),this.span}}class l extends r{constructor(o,a){if(super(o,a),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(o,a){return a===void 0&&(a=0),o.readIntBE(a,this.span)}encode(o,a,f){return f===void 0&&(f=0),a.writeIntBE(o,f,this.span),this.span}}const d=Math.pow(2,32);function v(g){const o=Math.floor(g/d),a=g-o*d;return{hi32:o,lo32:a}}function y(g,o){return g*d+o}class p extends r{constructor(o){super(8,o)}decode(o,a){a===void 0&&(a=0);const f=o.readUInt32LE(a),E=o.readUInt32LE(a+4);return y(E,f)}encode(o,a,f){f===void 0&&(f=0);const E=v(o);return a.writeUInt32LE(E.lo32,f),a.writeUInt32LE(E.hi32,f+4),8}}class m extends r{constructor(o){super(8,o)}decode(o,a){a===void 0&&(a=0);const f=o.readUInt32BE(a),E=o.readUInt32BE(a+4);return y(f,E)}encode(o,a,f){f===void 0&&(f=0);const E=v(o);return a.writeUInt32BE(E.hi32,f),a.writeUInt32BE(E.lo32,f+4),8}}class I extends r{constructor(o){super(8,o)}decode(o,a){a===void 0&&(a=0);const f=o.readUInt32LE(a),E=o.readInt32LE(a+4);return y(E,f)}encode(o,a,f){f===void 0&&(f=0);const E=v(o);return a.writeUInt32LE(E.lo32,f),a.writeInt32LE(E.hi32,f+4),8}}class _ extends r{constructor(o){super(8,o)}decode(o,a){a===void 0&&(a=0);const f=o.readInt32BE(a),E=o.readUInt32BE(a+4);return y(f,E)}encode(o,a,f){f===void 0&&(f=0);const E=v(o);return a.writeInt32BE(E.hi32,f),a.writeUInt32BE(E.lo32,f+4),8}}class A extends r{constructor(o){super(4,o)}decode(o,a){return a===void 0&&(a=0),o.readFloatLE(a)}encode(o,a,f){return f===void 0&&(f=0),a.writeFloatLE(o,f),4}}class R extends r{constructor(o){super(4,o)}decode(o,a){return a===void 0&&(a=0),o.readFloatBE(a)}encode(o,a,f){return f===void 0&&(f=0),a.writeFloatBE(o,f),4}}class k extends r{constructor(o){super(8,o)}decode(o,a){return a===void 0&&(a=0),o.readDoubleLE(a)}encode(o,a,f){return f===void 0&&(f=0),a.writeDoubleLE(o,f),8}}class x extends r{constructor(o){super(8,o)}decode(o,a){return a===void 0&&(a=0),o.readDoubleBE(a)}encode(o,a,f){return f===void 0&&(f=0),a.writeDoubleBE(o,f),8}}class U extends r{constructor(o,a,f){if(!(o instanceof r))throw new TypeError("elementLayout must be a Layout");if(!(a instanceof n&&a.isCount()||Number.isInteger(a)&&0<=a))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let E=-1;!(a instanceof n)&&0<o.span&&(E=a*o.span),super(E,f),this.elementLayout=o,this.count=a}getSpan(o,a){if(0<=this.span)return this.span;a===void 0&&(a=0);let f=0,E=this.count;if(E instanceof n&&(E=E.decode(o,a)),0<this.elementLayout.span)f=E*this.elementLayout.span;else{let T=0;for(;T<E;)f+=this.elementLayout.getSpan(o,a+f),++T}return f}decode(o,a){a===void 0&&(a=0);const f=[];let E=0,T=this.count;for(T instanceof n&&(T=T.decode(o,a));E<T;)f.push(this.elementLayout.decode(o,a)),a+=this.elementLayout.getSpan(o,a),E+=1;return f}encode(o,a,f){f===void 0&&(f=0);const E=this.elementLayout,T=o.reduce((q,W)=>q+E.encode(W,a,f+q),0);return this.count instanceof n&&this.count.encode(o.length,a,f),T}}class K extends r{constructor(o,a,f){if(!(Array.isArray(o)&&o.reduce((T,q)=>T&&q instanceof r,!0)))throw new TypeError("fields must be array of Layout instances");typeof a=="boolean"&&f===void 0&&(f=a,a=void 0);for(const T of o)if(0>T.span&&T.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let E=-1;try{E=o.reduce((T,q)=>T+q.getSpan(),0)}catch{}super(E,a),this.fields=o,this.decodePrefixes=!!f}getSpan(o,a){if(0<=this.span)return this.span;a===void 0&&(a=0);let f=0;try{f=this.fields.reduce((E,T)=>{const q=T.getSpan(o,a);return a+=q,E+q},0)}catch{throw new RangeError("indeterminate span")}return f}decode(o,a){a===void 0&&(a=0);const f=this.makeDestinationObject();for(const E of this.fields)if(E.property!==void 0&&(f[E.property]=E.decode(o,a)),a+=E.getSpan(o,a),this.decodePrefixes&&o.length===a)break;return f}encode(o,a,f){f===void 0&&(f=0);const E=f;let T=0,q=0;for(const W of this.fields){let Ee=W.span;if(q=0<Ee?Ee:0,W.property!==void 0){const Nt=o[W.property];Nt!==void 0&&(q=W.encode(Nt,a,f),0>Ee&&(Ee=W.getSpan(a,f)))}T=f,f+=Ee}return T+q-E}fromArray(o){const a=this.makeDestinationObject();for(const f of this.fields)f.property!==void 0&&0<o.length&&(a[f.property]=o.shift());return a}layoutFor(o){if(typeof o!="string")throw new TypeError("property must be string");for(const a of this.fields)if(a.property===o)return a}offsetOf(o){if(typeof o!="string")throw new TypeError("property must be string");let a=0;for(const f of this.fields){if(f.property===o)return a;0>f.span?a=-1:0<=a&&(a+=f.span)}}}class P{constructor(o){this.property=o}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}}class j extends P{constructor(o,a){if(!(o instanceof n&&o.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(a||o.property||"variant"),this.layout=o}decode(o,a){return this.layout.decode(o,a)}encode(o,a,f){return this.layout.encode(o,a,f)}}class V extends r{constructor(o,a,f){const E=o instanceof u||o instanceof c;if(E)o=new j(new i(o));else if(o instanceof n&&o.isCount())o=new j(o);else if(!(o instanceof P))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(a===void 0&&(a=null),!(a===null||a instanceof r))throw new TypeError("defaultLayout must be null or a Layout");if(a!==null){if(0>a.span)throw new Error("defaultLayout must have constant span");a.property===void 0&&(a=a.replicate("content"))}let T=-1;a&&(T=a.span,0<=T&&E&&(T+=o.layout.span)),super(T,f),this.discriminator=o,this.usesPrefixDiscriminator=E,this.defaultLayout=a,this.registry={};let q=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(W){return q(W)},this.configGetSourceVariant=function(W){q=W.bind(this)}}getSpan(o,a){if(0<=this.span)return this.span;a===void 0&&(a=0);const f=this.getVariant(o,a);if(!f)throw new Error("unable to determine span for unrecognized variant");return f.getSpan(o,a)}defaultGetSourceVariant(o){if(o.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&o.hasOwnProperty(this.defaultLayout.property))return;const a=this.registry[o[this.discriminator.property]];if(a&&(!a.layout||o.hasOwnProperty(a.property)))return a}else for(const a in this.registry){const f=this.registry[a];if(o.hasOwnProperty(f.property))return f}throw new Error("unable to infer src variant")}decode(o,a){a===void 0&&(a=0);let f;const E=this.discriminator,T=E.decode(o,a);let q=this.registry[T];if(q===void 0){let W=0;q=this.defaultLayout,this.usesPrefixDiscriminator&&(W=E.layout.span),f=this.makeDestinationObject(),f[E.property]=T,f[q.property]=this.defaultLayout.decode(o,a+W)}else f=q.decode(o,a);return f}encode(o,a,f){f===void 0&&(f=0);const E=this.getSourceVariant(o);if(E===void 0){const T=this.discriminator,q=this.defaultLayout;let W=0;return this.usesPrefixDiscriminator&&(W=T.layout.span),T.encode(o[T.property],a,f),W+q.encode(o[q.property],a,f+W)}return E.encode(o,a,f)}addVariant(o,a,f){const E=new N(this,o,a,f);return this.registry[o]=E,E}getVariant(o,a){let f=o;return $.Buffer.isBuffer(o)&&(a===void 0&&(a=0),f=this.discriminator.decode(o,a)),this.registry[f]}}class N extends r{constructor(o,a,f,E){if(!(o instanceof V))throw new TypeError("union must be a Union");if(!Number.isInteger(a)||0>a)throw new TypeError("variant must be a (non-negative) integer");if(typeof f=="string"&&E===void 0&&(E=f,f=null),f){if(!(f instanceof r))throw new TypeError("layout must be a Layout");if(o.defaultLayout!==null&&0<=f.span&&f.span>o.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof E!="string")throw new TypeError("variant must have a String property")}let T=o.span;0>o.span&&(T=f?f.span:0,0<=T&&o.usesPrefixDiscriminator&&(T+=o.discriminator.layout.span)),super(T,E),this.union=o,this.variant=a,this.layout=f||null}getSpan(o,a){if(0<=this.span)return this.span;a===void 0&&(a=0);let f=0;return this.union.usesPrefixDiscriminator&&(f=this.union.discriminator.layout.span),f+this.layout.getSpan(o,a+f)}decode(o,a){const f=this.makeDestinationObject();if(a===void 0&&(a=0),this!==this.union.getVariant(o,a))throw new Error("variant mismatch");let E=0;return this.union.usesPrefixDiscriminator&&(E=this.union.discriminator.layout.span),this.layout?f[this.property]=this.layout.decode(o,a+E):this.property?f[this.property]=!0:this.union.usesPrefixDiscriminator&&(f[this.union.discriminator.property]=this.variant),f}encode(o,a,f){f===void 0&&(f=0);let E=0;if(this.union.usesPrefixDiscriminator&&(E=this.union.discriminator.layout.span),this.layout&&!o.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,a,f);let T=E;if(this.layout&&(this.layout.encode(o[this.property],a,f+E),T+=this.layout.getSpan(a,f+E),0<=this.union.span&&T>this.union.span))throw new Error("encoded variant overruns containing union");return T}fromArray(o){if(this.layout)return this.layout.fromArray(o)}}function B(g){return 0>g&&(g+=4294967296),g}class O extends r{constructor(o,a,f){if(!(o instanceof u||o instanceof c))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof a=="string"&&f===void 0&&(f=a,a=void 0),4<o.span)throw new RangeError("word cannot exceed 32 bits");super(o.span,f),this.word=o,this.msb=!!a,this.fields=[];let E=0;this._packedSetValue=function(T){return E=B(T),this},this._packedGetValue=function(){return E}}decode(o,a){const f=this.makeDestinationObject();a===void 0&&(a=0);const E=this.word.decode(o,a);this._packedSetValue(E);for(const T of this.fields)T.property!==void 0&&(f[T.property]=T.decode(E));return f}encode(o,a,f){f===void 0&&(f=0);const E=this.word.decode(a,f);this._packedSetValue(E);for(const T of this.fields)if(T.property!==void 0){const q=o[T.property];q!==void 0&&T.encode(q)}return this.word.encode(this._packedGetValue(),a,f)}addField(o,a){const f=new S(this,o,a);return this.fields.push(f),f}addBoolean(o){const a=new h(this,o);return this.fields.push(a),a}fieldFor(o){if(typeof o!="string")throw new TypeError("property must be string");for(const a of this.fields)if(a.property===o)return a}}class S{constructor(o,a,f){if(!(o instanceof O))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(a)||0>=a)throw new TypeError("bits must be positive integer");const E=8*o.span,T=o.fields.reduce((q,W)=>q+W.bits,0);if(a+T>E)throw new Error("bits too long for span remainder ("+(E-T)+" of "+E+" remain)");this.container=o,this.bits=a,this.valueMask=(1<<a)-1,a===32&&(this.valueMask=4294967295),this.start=T,this.container.msb&&(this.start=E-T-a),this.wordMask=B(this.valueMask<<this.start),this.property=f}decode(){const o=this.container._packedGetValue();return B(o&this.wordMask)>>>this.start}encode(o){if(!Number.isInteger(o)||o!==B(o&this.valueMask))throw new TypeError(t("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const a=this.container._packedGetValue(),f=B(o<<this.start);this.container._packedSetValue(B(a&~this.wordMask)|f)}}class h extends S{constructor(o,a){super(o,1,a)}decode(o,a){return!!S.prototype.decode.call(this,o,a)}encode(o){return typeof o=="boolean"&&(o=+o),S.prototype.encode.call(this,o)}}class b extends r{constructor(o,a){if(!(o instanceof n&&o.isCount()||Number.isInteger(o)&&0<=o))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let f=-1;o instanceof n||(f=o),super(f,a),this.length=o}getSpan(o,a){let f=this.span;return 0>f&&(f=this.length.decode(o,a)),f}decode(o,a){a===void 0&&(a=0);let f=this.span;return 0>f&&(f=this.length.decode(o,a)),o.slice(a,a+f)}encode(o,a,f){let E=this.length;if(this.length instanceof n&&(E=o.length),!($.Buffer.isBuffer(o)&&E===o.length))throw new TypeError(t("Blob.encode",this)+" requires (length "+E+") Buffer as src");if(f+E>a.length)throw new RangeError("encoding overruns Buffer");return a.write(o.toString("hex"),f,E,"hex"),this.length instanceof n&&this.length.encode(E,a,f),E}}class C extends r{constructor(o){super(-1,o)}getSpan(o,a){if(!$.Buffer.isBuffer(o))throw new TypeError("b must be a Buffer");a===void 0&&(a=0);let f=a;for(;f<o.length&&o[f]!==0;)f+=1;return 1+f-a}decode(o,a,f){a===void 0&&(a=0);let E=this.getSpan(o,a);return o.slice(a,a+E-1).toString("utf-8")}encode(o,a,f){f===void 0&&(f=0),typeof o!="string"&&(o=o.toString());const E=new $.Buffer(o,"utf8"),T=E.length;if(f+T>a.length)throw new RangeError("encoding overruns Buffer");return E.copy(a,f),a[f+T]=0,T+1}}class z extends r{constructor(o,a){if(typeof o=="string"&&a===void 0&&(a=o,o=void 0),o===void 0)o=-1;else if(!Number.isInteger(o))throw new TypeError("maxSpan must be an integer");super(-1,a),this.maxSpan=o}getSpan(o,a){if(!$.Buffer.isBuffer(o))throw new TypeError("b must be a Buffer");return a===void 0&&(a=0),o.length-a}decode(o,a,f){a===void 0&&(a=0);let E=this.getSpan(o,a);if(0<=this.maxSpan&&this.maxSpan<E)throw new RangeError("text length exceeds maxSpan");return o.slice(a,a+E).toString("utf-8")}encode(o,a,f){f===void 0&&(f=0),typeof o!="string"&&(o=o.toString());const E=new $.Buffer(o,"utf8"),T=E.length;if(0<=this.maxSpan&&this.maxSpan<T)throw new RangeError("text length exceeds maxSpan");if(f+T>a.length)throw new RangeError("encoding overruns Buffer");return E.copy(a,f),T}}class H extends r{constructor(o,a){super(0,a),this.value=o}decode(o,a,f){return this.value}encode(o,a,f){return 0}}return L.ExternalLayout=n,L.GreedyCount=s,L.OffsetLayout=i,L.UInt=u,L.UIntBE=c,L.Int=w,L.IntBE=l,L.Float=A,L.FloatBE=R,L.Double=k,L.DoubleBE=x,L.Sequence=U,L.Structure=K,L.UnionDiscriminator=P,L.UnionLayoutDiscriminator=j,L.Union=V,L.VariantLayout=N,L.BitStructure=O,L.BitField=S,L.Boolean=h,L.Blob=b,L.CString=C,L.UTF8=z,L.Constant=H,L.greedy=((g,o)=>new s(g,o)),L.offset=((g,o,a)=>new i(g,o,a)),L.u8=(g=>new u(1,g)),L.u16=(g=>new u(2,g)),L.u24=(g=>new u(3,g)),L.u32=(g=>new u(4,g)),L.u40=(g=>new u(5,g)),L.u48=(g=>new u(6,g)),L.nu64=(g=>new p(g)),L.u16be=(g=>new c(2,g)),L.u24be=(g=>new c(3,g)),L.u32be=(g=>new c(4,g)),L.u40be=(g=>new c(5,g)),L.u48be=(g=>new c(6,g)),L.nu64be=(g=>new m(g)),L.s8=(g=>new w(1,g)),L.s16=(g=>new w(2,g)),L.s24=(g=>new w(3,g)),L.s32=(g=>new w(4,g)),L.s40=(g=>new w(5,g)),L.s48=(g=>new w(6,g)),L.ns64=(g=>new I(g)),L.s16be=(g=>new l(2,g)),L.s24be=(g=>new l(3,g)),L.s32be=(g=>new l(4,g)),L.s40be=(g=>new l(5,g)),L.s48be=(g=>new l(6,g)),L.ns64be=(g=>new _(g)),L.f32=(g=>new A(g)),L.f32be=(g=>new R(g)),L.f64=(g=>new k(g)),L.f64be=(g=>new x(g)),L.struct=((g,o,a)=>new K(g,o,a)),L.bits=((g,o,a)=>new O(g,o,a)),L.seq=((g,o,a)=>new U(g,o,a)),L.union=((g,o,a)=>new V(g,o,a)),L.unionLayoutDiscriminator=((g,o)=>new j(g,o)),L.blob=((g,o)=>new b(g,o)),L.cstr=(g=>new C(g)),L.utf8=((g,o)=>new z(g,o)),L.const=((g,o)=>new H(g,o)),L}const vr=F.getAugmentedNamespace(F.index_browser_esm);var jt;function _r(){return jt||(jt=1,(function(r){var t=Ae&&Ae.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(r,"__esModule",{value:!0}),r.map=r.array=r.rustEnum=r.str=r.vecU8=r.tagged=r.vec=r.bool=r.option=r.publicKey=r.i256=r.u256=r.i128=r.u128=r.i64=r.u64=r.struct=r.f64=r.f32=r.i32=r.u32=r.i16=r.u16=r.i8=r.u8=void 0;const e=$t(),n=vr,s=t(F.requireBn());var i=$t();Object.defineProperty(r,"u8",{enumerable:!0,get:function(){return i.u8}}),Object.defineProperty(r,"i8",{enumerable:!0,get:function(){return i.s8}}),Object.defineProperty(r,"u16",{enumerable:!0,get:function(){return i.u16}}),Object.defineProperty(r,"i16",{enumerable:!0,get:function(){return i.s16}}),Object.defineProperty(r,"u32",{enumerable:!0,get:function(){return i.u32}}),Object.defineProperty(r,"i32",{enumerable:!0,get:function(){return i.s32}}),Object.defineProperty(r,"f32",{enumerable:!0,get:function(){return i.f32}}),Object.defineProperty(r,"f64",{enumerable:!0,get:function(){return i.f64}}),Object.defineProperty(r,"struct",{enumerable:!0,get:function(){return i.struct}});class u extends e.Layout{constructor(S,h,b){super(S,b),this.blob=(0,e.blob)(S),this.signed=h}decode(S,h=0){const b=new s.default(this.blob.decode(S,h),10,"le");return this.signed?b.fromTwos(this.span*8).clone():b}encode(S,h,b=0){return this.signed&&(S=S.toTwos(this.span*8)),this.blob.encode(S.toArrayLike($.Buffer,"le",this.span),h,b)}}function c(O){return new u(8,!1,O)}r.u64=c;function w(O){return new u(8,!0,O)}r.i64=w;function l(O){return new u(16,!1,O)}r.u128=l;function d(O){return new u(16,!0,O)}r.i128=d;function v(O){return new u(32,!1,O)}r.u256=v;function y(O){return new u(32,!0,O)}r.i256=y;class p extends e.Layout{constructor(S,h,b,C){super(S.span,C),this.layout=S,this.decoder=h,this.encoder=b}decode(S,h){return this.decoder(this.layout.decode(S,h))}encode(S,h,b){return this.layout.encode(this.encoder(S),h,b)}getSpan(S,h){return this.layout.getSpan(S,h)}}function m(O){return new p((0,e.blob)(32),S=>new n.PublicKey(S),S=>S.toBuffer(),O)}r.publicKey=m;class I extends e.Layout{constructor(S,h){super(-1,h),this.layout=S,this.discriminator=(0,e.u8)()}encode(S,h,b=0){return S==null?this.discriminator.encode(0,h,b):(this.discriminator.encode(1,h,b),this.layout.encode(S,h,b+1)+1)}decode(S,h=0){const b=this.discriminator.decode(S,h);if(b===0)return null;if(b===1)return this.layout.decode(S,h+1);throw new Error("Invalid option "+this.property)}getSpan(S,h=0){const b=this.discriminator.decode(S,h);if(b===0)return 1;if(b===1)return this.layout.getSpan(S,h+1)+1;throw new Error("Invalid option "+this.property)}}function _(O,S){return new I(O,S)}r.option=_;function A(O){return new p((0,e.u8)(),R,k,O)}r.bool=A;function R(O){if(O===0)return!1;if(O===1)return!0;throw new Error("Invalid bool: "+O)}function k(O){return O?1:0}function x(O,S){const h=(0,e.u32)("length"),b=(0,e.struct)([h,(0,e.seq)(O,(0,e.offset)(h,-h.span),"values")]);return new p(b,({values:C})=>C,C=>({values:C}),S)}r.vec=x;function U(O,S,h){const b=(0,e.struct)([c("tag"),S.replicate("data")]);function C({tag:z,data:H}){if(!z.eq(O))throw new Error("Invalid tag, expected: "+O.toString("hex")+", got: "+z.toString("hex"));return H}return new p(b,C,z=>({tag:O,data:z}),h)}r.tagged=U;function K(O){const S=(0,e.u32)("length"),h=(0,e.struct)([S,(0,e.blob)((0,e.offset)(S,-S.span),"data")]);return new p(h,({data:b})=>b,b=>({data:b}),O)}r.vecU8=K;function P(O){return new p(K(),S=>S.toString("utf-8"),S=>$.Buffer.from(S,"utf-8"),O)}r.str=P;function j(O,S,h){const b=(0,e.union)(h??(0,e.u8)(),S);return O.forEach((C,z)=>b.addVariant(z,C,C.property)),b}r.rustEnum=j;function V(O,S,h){const b=(0,e.struct)([(0,e.seq)(O,S,"values")]);return new p(b,({values:C})=>C,C=>({values:C}),h)}r.array=V;class N extends e.Layout{constructor(S,h,b){super(S.span+h.span,b),this.keyLayout=S,this.valueLayout=h}decode(S,h){h=h||0;const b=this.keyLayout.decode(S,h),C=this.valueLayout.decode(S,h+this.keyLayout.getSpan(S,h));return[b,C]}encode(S,h,b){b=b||0;const C=this.keyLayout.encode(S[0],h,b),z=this.valueLayout.encode(S[1],h,b+C);return C+z}getSpan(S,h){return this.keyLayout.getSpan(S,h)+this.valueLayout.getSpan(S,h)}}function B(O,S,h){const b=(0,e.u32)("length"),C=(0,e.struct)([b,(0,e.seq)(new N(O,S),(0,e.offset)(b,-b.span),"values")]);return new p(C,({values:z})=>new Map(z),z=>({values:Array.from(z.entries())}),h)}r.map=B})(Ae)),Ae}var M=_r(),De={exports:{}},Vt;function Er(){if(Vt)return De.exports;Vt=1;const r=/[\p{Lu}]/u,t=/[\p{Ll}]/u,e=/^[\p{Lu}](?![\p{Lu}])/gu,n=/([\p{Alpha}\p{N}_]|$)/u,s=/[_.\- ]+/,i=new RegExp("^"+s.source),u=new RegExp(s.source+n.source,"gu"),c=new RegExp("\\d+"+n.source,"gu"),w=(y,p,m)=>{let I=!1,_=!1,A=!1;for(let R=0;R<y.length;R++){const k=y[R];I&&r.test(k)?(y=y.slice(0,R)+"-"+y.slice(R),I=!1,A=_,_=!0,R++):_&&A&&t.test(k)?(y=y.slice(0,R-1)+"-"+y.slice(R-1),A=_,_=!1,I=!0):(I=p(k)===k&&m(k)!==k,A=_,_=m(k)===k&&p(k)!==k)}return y},l=(y,p)=>(e.lastIndex=0,y.replace(e,m=>p(m))),d=(y,p)=>(u.lastIndex=0,c.lastIndex=0,y.replace(u,(m,I)=>p(I)).replace(c,m=>p(m))),v=(y,p)=>{if(!(typeof y=="string"||Array.isArray(y)))throw new TypeError("Expected the input to be `string | string[]`");if(p={pascalCase:!1,preserveConsecutiveUppercase:!1,...p},Array.isArray(y)?y=y.map(A=>A.trim()).filter(A=>A.length).join("-"):y=y.trim(),y.length===0)return"";const m=p.locale===!1?A=>A.toLowerCase():A=>A.toLocaleLowerCase(p.locale),I=p.locale===!1?A=>A.toUpperCase():A=>A.toLocaleUpperCase(p.locale);return y.length===1?p.pascalCase?I(y):m(y):(y!==m(y)&&(y=w(y,m,I)),y=y.replace(i,""),p.preserveConsecutiveUppercase?y=l(y,m):y=m(y),p.pascalCase&&(y=I(y.charAt(0))+y.slice(1)),d(y,I))};return De.exports=v,De.exports.default=v,De.exports}var Ar=Er();const Z=F.getDefaultExportFromCjs(Ar);function _e(r){let t=r.length;for(;--t>=0;)r[t]=0}const xr=3,kr=258,Cn=29,Sr=256,Ir=Sr+1+Cn,On=30,Lr=512,Tr=new Array((Ir+2)*2);_e(Tr);const Cr=new Array(On*2);_e(Cr);const Or=new Array(Lr);_e(Or);const Rr=new Array(kr-xr+1);_e(Rr);const Pr=new Array(Cn);_e(Pr);const Br=new Array(On);_e(Br);const Dr=(r,t,e,n)=>{let s=r&65535|0,i=r>>>16&65535|0,u=0;for(;e!==0;){u=e>2e3?2e3:e,e-=u;do s=s+t[n++]|0,i=i+s|0;while(--u);s%=65521,i%=65521}return s|i<<16|0};var ht=Dr;const Ur=()=>{let r,t=[];for(var e=0;e<256;e++){r=e;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r}return t},Nr=new Uint32Array(Ur()),Mr=(r,t,e,n)=>{const s=Nr,i=n+e;r^=-1;for(let u=n;u<i;u++)r=r>>>8^s[(r^t[u])&255];return r^-1};var re=Mr,pt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Rn={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const $r=(r,t)=>Object.prototype.hasOwnProperty.call(r,t);var jr=function(r){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(const n in e)$r(e,n)&&(r[n]=e[n])}}return r},Vr=r=>{let t=0;for(let n=0,s=r.length;n<s;n++)t+=r[n].length;const e=new Uint8Array(t);for(let n=0,s=0,i=r.length;n<i;n++){let u=r[n];e.set(u,s),s+=u.length}return e},Pn={assign:jr,flattenChunks:Vr};let Bn=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Bn=!1}const Le=new Uint8Array(256);for(let r=0;r<256;r++)Le[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Le[254]=Le[254]=1;var Fr=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let t,e,n,s,i,u=r.length,c=0;for(s=0;s<u;s++)e=r.charCodeAt(s),(e&64512)===55296&&s+1<u&&(n=r.charCodeAt(s+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),s++)),c+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(c),i=0,s=0;i<c;s++)e=r.charCodeAt(s),(e&64512)===55296&&s+1<u&&(n=r.charCodeAt(s+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),s++)),e<128?t[i++]=e:e<2048?(t[i++]=192|e>>>6,t[i++]=128|e&63):e<65536?(t[i++]=224|e>>>12,t[i++]=128|e>>>6&63,t[i++]=128|e&63):(t[i++]=240|e>>>18,t[i++]=128|e>>>12&63,t[i++]=128|e>>>6&63,t[i++]=128|e&63);return t};const zr=(r,t)=>{if(t<65534&&r.subarray&&Bn)return String.fromCharCode.apply(null,r.length===t?r:r.subarray(0,t));let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(r[n]);return e};var qr=(r,t)=>{const e=t||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,t));let n,s;const i=new Array(e*2);for(s=0,n=0;n<e;){let u=r[n++];if(u<128){i[s++]=u;continue}let c=Le[u];if(c>4){i[s++]=65533,n+=c-1;continue}for(u&=c===2?31:c===3?15:7;c>1&&n<e;)u=u<<6|r[n++]&63,c--;if(c>1){i[s++]=65533;continue}u<65536?i[s++]=u:(u-=65536,i[s++]=55296|u>>10&1023,i[s++]=56320|u&1023)}return zr(i,s)},Kr=(r,t)=>{t=t||r.length,t>r.length&&(t=r.length);let e=t-1;for(;e>=0&&(r[e]&192)===128;)e--;return e<0||e===0?t:e+Le[r[e]]>t?e:t},wt={string2buf:Fr,buf2string:qr,utf8border:Kr};function Gr(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Zr=Gr;const Ue=16209,Hr=16191;var Wr=function(t,e){let n,s,i,u,c,w,l,d,v,y,p,m,I,_,A,R,k,x,U,K,P,j,V,N;const B=t.state;n=t.next_in,V=t.input,s=n+(t.avail_in-5),i=t.next_out,N=t.output,u=i-(e-t.avail_out),c=i+(t.avail_out-257),w=B.dmax,l=B.wsize,d=B.whave,v=B.wnext,y=B.window,p=B.hold,m=B.bits,I=B.lencode,_=B.distcode,A=(1<<B.lenbits)-1,R=(1<<B.distbits)-1;e:do{m<15&&(p+=V[n++]<<m,m+=8,p+=V[n++]<<m,m+=8),k=I[p&A];t:for(;;){if(x=k>>>24,p>>>=x,m-=x,x=k>>>16&255,x===0)N[i++]=k&65535;else if(x&16){U=k&65535,x&=15,x&&(m<x&&(p+=V[n++]<<m,m+=8),U+=p&(1<<x)-1,p>>>=x,m-=x),m<15&&(p+=V[n++]<<m,m+=8,p+=V[n++]<<m,m+=8),k=_[p&R];n:for(;;){if(x=k>>>24,p>>>=x,m-=x,x=k>>>16&255,x&16){if(K=k&65535,x&=15,m<x&&(p+=V[n++]<<m,m+=8,m<x&&(p+=V[n++]<<m,m+=8)),K+=p&(1<<x)-1,K>w){t.msg="invalid distance too far back",B.mode=Ue;break e}if(p>>>=x,m-=x,x=i-u,K>x){if(x=K-x,x>d&&B.sane){t.msg="invalid distance too far back",B.mode=Ue;break e}if(P=0,j=y,v===0){if(P+=l-x,x<U){U-=x;do N[i++]=y[P++];while(--x);P=i-K,j=N}}else if(v<x){if(P+=l+v-x,x-=v,x<U){U-=x;do N[i++]=y[P++];while(--x);if(P=0,v<U){x=v,U-=x;do N[i++]=y[P++];while(--x);P=i-K,j=N}}}else if(P+=v-x,x<U){U-=x;do N[i++]=y[P++];while(--x);P=i-K,j=N}for(;U>2;)N[i++]=j[P++],N[i++]=j[P++],N[i++]=j[P++],U-=3;U&&(N[i++]=j[P++],U>1&&(N[i++]=j[P++]))}else{P=i-K;do N[i++]=N[P++],N[i++]=N[P++],N[i++]=N[P++],U-=3;while(U>2);U&&(N[i++]=N[P++],U>1&&(N[i++]=N[P++]))}}else if((x&64)===0){k=_[(k&65535)+(p&(1<<x)-1)];continue n}else{t.msg="invalid distance code",B.mode=Ue;break e}break}}else if((x&64)===0){k=I[(k&65535)+(p&(1<<x)-1)];continue t}else if(x&32){B.mode=Hr;break e}else{t.msg="invalid literal/length code",B.mode=Ue;break e}break}}while(n<s&&i<c);U=m>>3,n-=U,m-=U<<3,p&=(1<<m)-1,t.next_in=n,t.next_out=i,t.avail_in=n<s?5+(s-n):5-(n-s),t.avail_out=i<c?257+(c-i):257-(i-c),B.hold=p,B.bits=m};const ge=15,Ft=852,zt=592,qt=0,tt=1,Kt=2,Xr=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Yr=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Jr=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Qr=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ei=(r,t,e,n,s,i,u,c)=>{const w=c.bits;let l=0,d=0,v=0,y=0,p=0,m=0,I=0,_=0,A=0,R=0,k,x,U,K,P,j=null,V;const N=new Uint16Array(ge+1),B=new Uint16Array(ge+1);let O=null,S,h,b;for(l=0;l<=ge;l++)N[l]=0;for(d=0;d<n;d++)N[t[e+d]]++;for(p=w,y=ge;y>=1&&N[y]===0;y--);if(p>y&&(p=y),y===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,c.bits=1,0;for(v=1;v<y&&N[v]===0;v++);for(p<v&&(p=v),_=1,l=1;l<=ge;l++)if(_<<=1,_-=N[l],_<0)return-1;if(_>0&&(r===qt||y!==1))return-1;for(B[1]=0,l=1;l<ge;l++)B[l+1]=B[l]+N[l];for(d=0;d<n;d++)t[e+d]!==0&&(u[B[t[e+d]]++]=d);if(r===qt?(j=O=u,V=20):r===tt?(j=Xr,O=Yr,V=257):(j=Jr,O=Qr,V=0),R=0,d=0,l=v,P=i,m=p,I=0,U=-1,A=1<<p,K=A-1,r===tt&&A>Ft||r===Kt&&A>zt)return 1;for(;;){S=l-I,u[d]+1<V?(h=0,b=u[d]):u[d]>=V?(h=O[u[d]-V],b=j[u[d]-V]):(h=96,b=0),k=1<<l-I,x=1<<m,v=x;do x-=k,s[P+(R>>I)+x]=S<<24|h<<16|b|0;while(x!==0);for(k=1<<l-1;R&k;)k>>=1;if(k!==0?(R&=k-1,R+=k):R=0,d++,--N[l]===0){if(l===y)break;l=t[e+u[d]]}if(l>p&&(R&K)!==U){for(I===0&&(I=p),P+=v,m=l-I,_=1<<m;m+I<y&&(_-=N[m+I],!(_<=0));)m++,_<<=1;if(A+=1<<m,r===tt&&A>Ft||r===Kt&&A>zt)return 1;U=R&K,s[U]=p<<24|m<<16|P-i|0}}return R!==0&&(s[P+R]=l-I<<24|64<<16|0),c.bits=p,0};var Se=ei;const ti=0,Dn=1,Un=2,{Z_FINISH:Gt,Z_BLOCK:ni,Z_TREES:Ne,Z_OK:we,Z_STREAM_END:ri,Z_NEED_DICT:ii,Z_STREAM_ERROR:te,Z_DATA_ERROR:Nn,Z_MEM_ERROR:Mn,Z_BUF_ERROR:si,Z_DEFLATED:Zt}=Rn,We=16180,Ht=16181,Wt=16182,Xt=16183,Yt=16184,Jt=16185,Qt=16186,en=16187,tn=16188,nn=16189,qe=16190,se=16191,nt=16192,rn=16193,rt=16194,sn=16195,on=16196,an=16197,cn=16198,Me=16199,$e=16200,un=16201,ln=16202,dn=16203,fn=16204,hn=16205,it=16206,pn=16207,wn=16208,G=16209,$n=16210,jn=16211,oi=852,ai=592,ci=15,ui=ci,yn=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function li(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ye=r=>{if(!r)return 1;const t=r.state;return!t||t.strm!==r||t.mode<We||t.mode>jn?1:0},Vn=r=>{if(ye(r))return te;const t=r.state;return r.total_in=r.total_out=t.total=0,r.msg="",t.wrap&&(r.adler=t.wrap&1),t.mode=We,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(oi),t.distcode=t.distdyn=new Int32Array(ai),t.sane=1,t.back=-1,we},Fn=r=>{if(ye(r))return te;const t=r.state;return t.wsize=0,t.whave=0,t.wnext=0,Vn(r)},zn=(r,t)=>{let e;if(ye(r))return te;const n=r.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?te:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,Fn(r))},qn=(r,t)=>{if(!r)return te;const e=new li;r.state=e,e.strm=r,e.window=null,e.mode=We;const n=zn(r,t);return n!==we&&(r.state=null),n},di=r=>qn(r,ui);let gn=!0,st,ot;const fi=r=>{if(gn){st=new Int32Array(512),ot=new Int32Array(32);let t=0;for(;t<144;)r.lens[t++]=8;for(;t<256;)r.lens[t++]=9;for(;t<280;)r.lens[t++]=7;for(;t<288;)r.lens[t++]=8;for(Se(Dn,r.lens,0,288,st,0,r.work,{bits:9}),t=0;t<32;)r.lens[t++]=5;Se(Un,r.lens,0,32,ot,0,r.work,{bits:5}),gn=!1}r.lencode=st,r.lenbits=9,r.distcode=ot,r.distbits=5},Kn=(r,t,e,n)=>{let s;const i=r.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),n>=i.wsize?(i.window.set(t.subarray(e-i.wsize,e),0),i.wnext=0,i.whave=i.wsize):(s=i.wsize-i.wnext,s>n&&(s=n),i.window.set(t.subarray(e-n,e-n+s),i.wnext),n-=s,n?(i.window.set(t.subarray(e-n,e),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=s,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=s))),0},hi=(r,t)=>{let e,n,s,i,u,c,w,l,d,v,y,p,m,I,_=0,A,R,k,x,U,K,P,j;const V=new Uint8Array(4);let N,B;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ye(r)||!r.output||!r.input&&r.avail_in!==0)return te;e=r.state,e.mode===se&&(e.mode=nt),u=r.next_out,s=r.output,w=r.avail_out,i=r.next_in,n=r.input,c=r.avail_in,l=e.hold,d=e.bits,v=c,y=w,j=we;e:for(;;)switch(e.mode){case We:if(e.wrap===0){e.mode=nt;break}for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.wrap&2&&l===35615){e.wbits===0&&(e.wbits=15),e.check=0,V[0]=l&255,V[1]=l>>>8&255,e.check=re(e.check,V,2,0),l=0,d=0,e.mode=Ht;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((l&255)<<8)+(l>>8))%31){r.msg="incorrect header check",e.mode=G;break}if((l&15)!==Zt){r.msg="unknown compression method",e.mode=G;break}if(l>>>=4,d-=4,P=(l&15)+8,e.wbits===0&&(e.wbits=P),P>15||P>e.wbits){r.msg="invalid window size",e.mode=G;break}e.dmax=1<<e.wbits,e.flags=0,r.adler=e.check=1,e.mode=l&512?nn:se,l=0,d=0;break;case Ht:for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.flags=l,(e.flags&255)!==Zt){r.msg="unknown compression method",e.mode=G;break}if(e.flags&57344){r.msg="unknown header flags set",e.mode=G;break}e.head&&(e.head.text=l>>8&1),e.flags&512&&e.wrap&4&&(V[0]=l&255,V[1]=l>>>8&255,e.check=re(e.check,V,2,0)),l=0,d=0,e.mode=Wt;case Wt:for(;d<32;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.head&&(e.head.time=l),e.flags&512&&e.wrap&4&&(V[0]=l&255,V[1]=l>>>8&255,V[2]=l>>>16&255,V[3]=l>>>24&255,e.check=re(e.check,V,4,0)),l=0,d=0,e.mode=Xt;case Xt:for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.head&&(e.head.xflags=l&255,e.head.os=l>>8),e.flags&512&&e.wrap&4&&(V[0]=l&255,V[1]=l>>>8&255,e.check=re(e.check,V,2,0)),l=0,d=0,e.mode=Yt;case Yt:if(e.flags&1024){for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.length=l,e.head&&(e.head.extra_len=l),e.flags&512&&e.wrap&4&&(V[0]=l&255,V[1]=l>>>8&255,e.check=re(e.check,V,2,0)),l=0,d=0}else e.head&&(e.head.extra=null);e.mode=Jt;case Jt:if(e.flags&1024&&(p=e.length,p>c&&(p=c),p&&(e.head&&(P=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(n.subarray(i,i+p),P)),e.flags&512&&e.wrap&4&&(e.check=re(e.check,n,p,i)),c-=p,i+=p,e.length-=p),e.length))break e;e.length=0,e.mode=Qt;case Qt:if(e.flags&2048){if(c===0)break e;p=0;do P=n[i+p++],e.head&&P&&e.length<65536&&(e.head.name+=String.fromCharCode(P));while(P&&p<c);if(e.flags&512&&e.wrap&4&&(e.check=re(e.check,n,p,i)),c-=p,i+=p,P)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=en;case en:if(e.flags&4096){if(c===0)break e;p=0;do P=n[i+p++],e.head&&P&&e.length<65536&&(e.head.comment+=String.fromCharCode(P));while(P&&p<c);if(e.flags&512&&e.wrap&4&&(e.check=re(e.check,n,p,i)),c-=p,i+=p,P)break e}else e.head&&(e.head.comment=null);e.mode=tn;case tn:if(e.flags&512){for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.wrap&4&&l!==(e.check&65535)){r.msg="header crc mismatch",e.mode=G;break}l=0,d=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),r.adler=e.check=0,e.mode=se;break;case nn:for(;d<32;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}r.adler=e.check=yn(l),l=0,d=0,e.mode=qe;case qe:if(e.havedict===0)return r.next_out=u,r.avail_out=w,r.next_in=i,r.avail_in=c,e.hold=l,e.bits=d,ii;r.adler=e.check=1,e.mode=se;case se:if(t===ni||t===Ne)break e;case nt:if(e.last){l>>>=d&7,d-=d&7,e.mode=it;break}for(;d<3;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}switch(e.last=l&1,l>>>=1,d-=1,l&3){case 0:e.mode=rn;break;case 1:if(fi(e),e.mode=Me,t===Ne){l>>>=2,d-=2;break e}break;case 2:e.mode=on;break;case 3:r.msg="invalid block type",e.mode=G}l>>>=2,d-=2;break;case rn:for(l>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if((l&65535)!==(l>>>16^65535)){r.msg="invalid stored block lengths",e.mode=G;break}if(e.length=l&65535,l=0,d=0,e.mode=rt,t===Ne)break e;case rt:e.mode=sn;case sn:if(p=e.length,p){if(p>c&&(p=c),p>w&&(p=w),p===0)break e;s.set(n.subarray(i,i+p),u),c-=p,i+=p,w-=p,u+=p,e.length-=p;break}e.mode=se;break;case on:for(;d<14;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.nlen=(l&31)+257,l>>>=5,d-=5,e.ndist=(l&31)+1,l>>>=5,d-=5,e.ncode=(l&15)+4,l>>>=4,d-=4,e.nlen>286||e.ndist>30){r.msg="too many length or distance symbols",e.mode=G;break}e.have=0,e.mode=an;case an:for(;e.have<e.ncode;){for(;d<3;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.lens[O[e.have++]]=l&7,l>>>=3,d-=3}for(;e.have<19;)e.lens[O[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,N={bits:e.lenbits},j=Se(ti,e.lens,0,19,e.lencode,0,e.work,N),e.lenbits=N.bits,j){r.msg="invalid code lengths set",e.mode=G;break}e.have=0,e.mode=cn;case cn:for(;e.have<e.nlen+e.ndist;){for(;_=e.lencode[l&(1<<e.lenbits)-1],A=_>>>24,R=_>>>16&255,k=_&65535,!(A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(k<16)l>>>=A,d-=A,e.lens[e.have++]=k;else{if(k===16){for(B=A+2;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(l>>>=A,d-=A,e.have===0){r.msg="invalid bit length repeat",e.mode=G;break}P=e.lens[e.have-1],p=3+(l&3),l>>>=2,d-=2}else if(k===17){for(B=A+3;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}l>>>=A,d-=A,P=0,p=3+(l&7),l>>>=3,d-=3}else{for(B=A+7;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}l>>>=A,d-=A,P=0,p=11+(l&127),l>>>=7,d-=7}if(e.have+p>e.nlen+e.ndist){r.msg="invalid bit length repeat",e.mode=G;break}for(;p--;)e.lens[e.have++]=P}}if(e.mode===G)break;if(e.lens[256]===0){r.msg="invalid code -- missing end-of-block",e.mode=G;break}if(e.lenbits=9,N={bits:e.lenbits},j=Se(Dn,e.lens,0,e.nlen,e.lencode,0,e.work,N),e.lenbits=N.bits,j){r.msg="invalid literal/lengths set",e.mode=G;break}if(e.distbits=6,e.distcode=e.distdyn,N={bits:e.distbits},j=Se(Un,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,N),e.distbits=N.bits,j){r.msg="invalid distances set",e.mode=G;break}if(e.mode=Me,t===Ne)break e;case Me:e.mode=$e;case $e:if(c>=6&&w>=258){r.next_out=u,r.avail_out=w,r.next_in=i,r.avail_in=c,e.hold=l,e.bits=d,Wr(r,y),u=r.next_out,s=r.output,w=r.avail_out,i=r.next_in,n=r.input,c=r.avail_in,l=e.hold,d=e.bits,e.mode===se&&(e.back=-1);break}for(e.back=0;_=e.lencode[l&(1<<e.lenbits)-1],A=_>>>24,R=_>>>16&255,k=_&65535,!(A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(R&&(R&240)===0){for(x=A,U=R,K=k;_=e.lencode[K+((l&(1<<x+U)-1)>>x)],A=_>>>24,R=_>>>16&255,k=_&65535,!(x+A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}l>>>=x,d-=x,e.back+=x}if(l>>>=A,d-=A,e.back+=A,e.length=k,R===0){e.mode=hn;break}if(R&32){e.back=-1,e.mode=se;break}if(R&64){r.msg="invalid literal/length code",e.mode=G;break}e.extra=R&15,e.mode=un;case un:if(e.extra){for(B=e.extra;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.length+=l&(1<<e.extra)-1,l>>>=e.extra,d-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=ln;case ln:for(;_=e.distcode[l&(1<<e.distbits)-1],A=_>>>24,R=_>>>16&255,k=_&65535,!(A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if((R&240)===0){for(x=A,U=R,K=k;_=e.distcode[K+((l&(1<<x+U)-1)>>x)],A=_>>>24,R=_>>>16&255,k=_&65535,!(x+A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}l>>>=x,d-=x,e.back+=x}if(l>>>=A,d-=A,e.back+=A,R&64){r.msg="invalid distance code",e.mode=G;break}e.offset=k,e.extra=R&15,e.mode=dn;case dn:if(e.extra){for(B=e.extra;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.offset+=l&(1<<e.extra)-1,l>>>=e.extra,d-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){r.msg="invalid distance too far back",e.mode=G;break}e.mode=fn;case fn:if(w===0)break e;if(p=y-w,e.offset>p){if(p=e.offset-p,p>e.whave&&e.sane){r.msg="invalid distance too far back",e.mode=G;break}p>e.wnext?(p-=e.wnext,m=e.wsize-p):m=e.wnext-p,p>e.length&&(p=e.length),I=e.window}else I=s,m=u-e.offset,p=e.length;p>w&&(p=w),w-=p,e.length-=p;do s[u++]=I[m++];while(--p);e.length===0&&(e.mode=$e);break;case hn:if(w===0)break e;s[u++]=e.length,w--,e.mode=$e;break;case it:if(e.wrap){for(;d<32;){if(c===0)break e;c--,l|=n[i++]<<d,d+=8}if(y-=w,r.total_out+=y,e.total+=y,e.wrap&4&&y&&(r.adler=e.check=e.flags?re(e.check,s,y,u-y):ht(e.check,s,y,u-y)),y=w,e.wrap&4&&(e.flags?l:yn(l))!==e.check){r.msg="incorrect data check",e.mode=G;break}l=0,d=0}e.mode=pn;case pn:if(e.wrap&&e.flags){for(;d<32;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.wrap&4&&l!==(e.total&4294967295)){r.msg="incorrect length check",e.mode=G;break}l=0,d=0}e.mode=wn;case wn:j=ri;break e;case G:j=Nn;break e;case $n:return Mn;case jn:default:return te}return r.next_out=u,r.avail_out=w,r.next_in=i,r.avail_in=c,e.hold=l,e.bits=d,(e.wsize||y!==r.avail_out&&e.mode<G&&(e.mode<it||t!==Gt))&&Kn(r,r.output,r.next_out,y-r.avail_out),v-=r.avail_in,y-=r.avail_out,r.total_in+=v,r.total_out+=y,e.total+=y,e.wrap&4&&y&&(r.adler=e.check=e.flags?re(e.check,s,y,r.next_out-y):ht(e.check,s,y,r.next_out-y)),r.data_type=e.bits+(e.last?64:0)+(e.mode===se?128:0)+(e.mode===Me||e.mode===rt?256:0),(v===0&&y===0||t===Gt)&&j===we&&(j=si),j},pi=r=>{if(ye(r))return te;let t=r.state;return t.window&&(t.window=null),r.state=null,we},wi=(r,t)=>{if(ye(r))return te;const e=r.state;return(e.wrap&2)===0?te:(e.head=t,t.done=!1,we)},yi=(r,t)=>{const e=t.length;let n,s,i;return ye(r)||(n=r.state,n.wrap!==0&&n.mode!==qe)?te:n.mode===qe&&(s=1,s=ht(s,t,e,0),s!==n.check)?Nn:(i=Kn(r,t,e,e),i?(n.mode=$n,Mn):(n.havedict=1,we))};var gi=Fn,mi=zn,bi=Vn,vi=di,_i=qn,Ei=hi,Ai=pi,xi=wi,ki=yi,Si="pako inflate (from Nodeca project)",oe={inflateReset:gi,inflateReset2:mi,inflateResetKeep:bi,inflateInit:vi,inflateInit2:_i,inflate:Ei,inflateEnd:Ai,inflateGetHeader:xi,inflateSetDictionary:ki,inflateInfo:Si};function Ii(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Li=Ii;const Gn=Object.prototype.toString,{Z_NO_FLUSH:Ti,Z_FINISH:Ci,Z_OK:Te,Z_STREAM_END:at,Z_NEED_DICT:ct,Z_STREAM_ERROR:Oi,Z_DATA_ERROR:mn,Z_MEM_ERROR:Ri}=Rn;function Xe(r){this.options=Pn.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(r&&r.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zr,this.strm.avail_out=0;let e=oe.inflateInit2(this.strm,t.windowBits);if(e!==Te)throw new Error(pt[e]);if(this.header=new Li,oe.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wt.string2buf(t.dictionary):Gn.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=oe.inflateSetDictionary(this.strm,t.dictionary),e!==Te)))throw new Error(pt[e])}Xe.prototype.push=function(r,t){const e=this.strm,n=this.options.chunkSize,s=this.options.dictionary;let i,u,c;if(this.ended)return!1;for(t===~~t?u=t:u=t===!0?Ci:Ti,Gn.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),i=oe.inflate(e,u),i===ct&&s&&(i=oe.inflateSetDictionary(e,s),i===Te?i=oe.inflate(e,u):i===mn&&(i=ct));e.avail_in>0&&i===at&&e.state.wrap>0&&r[e.next_in]!==0;)oe.inflateReset(e),i=oe.inflate(e,u);switch(i){case Oi:case mn:case ct:case Ri:return this.onEnd(i),this.ended=!0,!1}if(c=e.avail_out,e.next_out&&(e.avail_out===0||i===at))if(this.options.to==="string"){let w=wt.utf8border(e.output,e.next_out),l=e.next_out-w,d=wt.buf2string(e.output,w);e.next_out=l,e.avail_out=n-l,l&&e.output.set(e.output.subarray(w,w+l),0),this.onData(d)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(i===Te&&c===0)){if(i===at)return i=oe.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};Xe.prototype.onData=function(r){this.chunks.push(r)};Xe.prototype.onEnd=function(r){r===Te&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Pn.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Pi(r,t){const e=new Xe(t);if(e.push(r),e.err)throw e.msg||pt[e.err];return e.result}var Bi=Pi,Di={inflate:Bi};const{inflate:Ui}=Di;var Ni=Ui,ut={exports:{}},bn;function Mi(){return bn||(bn=1,(function(r){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function s(w,l,d){this.fn=w,this.context=l,this.once=d||!1}function i(w,l,d,v,y){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,v||w,y),m=e?e+l:l;return w._events[m]?w._events[m].fn?w._events[m]=[w._events[m],p]:w._events[m].push(p):(w._events[m]=p,w._eventsCount++),w}function u(w,l){--w._eventsCount===0?w._events=new n:delete w._events[l]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var l=[],d,v;if(this._eventsCount===0)return l;for(v in d=this._events)t.call(d,v)&&l.push(e?v.slice(1):v);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},c.prototype.listeners=function(l){var d=e?e+l:l,v=this._events[d];if(!v)return[];if(v.fn)return[v.fn];for(var y=0,p=v.length,m=new Array(p);y<p;y++)m[y]=v[y].fn;return m},c.prototype.listenerCount=function(l){var d=e?e+l:l,v=this._events[d];return v?v.fn?1:v.length:0},c.prototype.emit=function(l,d,v,y,p,m){var I=e?e+l:l;if(!this._events[I])return!1;var _=this._events[I],A=arguments.length,R,k;if(_.fn){switch(_.once&&this.removeListener(l,_.fn,void 0,!0),A){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,d),!0;case 3:return _.fn.call(_.context,d,v),!0;case 4:return _.fn.call(_.context,d,v,y),!0;case 5:return _.fn.call(_.context,d,v,y,p),!0;case 6:return _.fn.call(_.context,d,v,y,p,m),!0}for(k=1,R=new Array(A-1);k<A;k++)R[k-1]=arguments[k];_.fn.apply(_.context,R)}else{var x=_.length,U;for(k=0;k<x;k++)switch(_[k].once&&this.removeListener(l,_[k].fn,void 0,!0),A){case 1:_[k].fn.call(_[k].context);break;case 2:_[k].fn.call(_[k].context,d);break;case 3:_[k].fn.call(_[k].context,d,v);break;case 4:_[k].fn.call(_[k].context,d,v,y);break;default:if(!R)for(U=1,R=new Array(A-1);U<A;U++)R[U-1]=arguments[U];_[k].fn.apply(_[k].context,R)}}return!0},c.prototype.on=function(l,d,v){return i(this,l,d,v,!1)},c.prototype.once=function(l,d,v){return i(this,l,d,v,!0)},c.prototype.removeListener=function(l,d,v,y){var p=e?e+l:l;if(!this._events[p])return this;if(!d)return u(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!y||m.once)&&(!v||m.context===v)&&u(this,p);else{for(var I=0,_=[],A=m.length;I<A;I++)(m[I].fn!==d||y&&!m[I].once||v&&m[I].context!==v)&&_.push(m[I]);_.length?this._events[p]=_.length===1?_[0]:_:u(this,p)}return this},c.prototype.removeAllListeners=function(l){var d;return l?(d=e?e+l:l,this._events[d]&&u(this,d)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=e,c.EventEmitter=c,r.exports=c})(ut)),ut.exports}var $i=Mi();const ji=F.getDefaultExportFromCjs($i);function Vi(r,t){return Array.apply(0,new Array(Math.ceil(r.length/t))).map((e,n)=>r.slice(n*t,(n+1)*t))}const xe=r=>"version"in r;function Fi(r){return r.reduce((t,e)=>t+e.toString(16).padStart(2,"0"),"0x")}function zi(r){r.indexOf("0x")===0&&(r=r.substr(2)),r.length%2===1&&(r="0"+r);let t=r.match(/.{2}/g);return t===null?$.Buffer$1.from([]):$.Buffer$1.from(t.map(e=>parseInt(e,16)))}var qi=Object.freeze({__proto__:null,encode:Fi,decode:zi});function Zn(r){return new TextDecoder("utf-8").decode(r)}function Hn(r){return new TextEncoder().encode(r)}var Ki=Object.freeze({__proto__:null,decode:Zn,encode:Hn});function yt(r){return F.bs58.encode(r)}function Gi(r){return F.bs58.decode(r)}var Zi=Object.freeze({__proto__:null,encode:yt,decode:Gi});function gt(r){return r.toString("base64")}function St(r){return $.Buffer$1.from(r,"base64")}var Hi=Object.freeze({__proto__:null,encode:gt,decode:St}),Wi=Object.freeze({__proto__:null,hex:qi,utf8:Ki,bs58:Zi,base64:Hi});function Wn(r){const t=new Map;return r.errors&&r.errors.forEach(e=>{var n;let s=(n=e.msg)!==null&&n!==void 0?n:e.name;t.set(e.code,s)}),t}function Xi(r,...t){if(r.args.length!=t.length)throw new Error("Invalid argument length");const e={};let n=0;return r.args.forEach(s=>{e[s.name]=t[n],n+=1}),e}function Xn(r,t={}){r.forEach(e=>{if("accounts"in e)Xn(e.accounts,t[e.name]);else if(t[e.name]===void 0)throw new Error(`Invalid arguments: ${e.name} not provided.`)})}function Q(r){return r instanceof F.PublicKey?r:new F.PublicKey(r)}class Yi extends TypeError{constructor(t,e){let n;const{message:s,...i}=t,{path:u}=t,c=u.length===0?s:"At path: "+u.join(".")+" -- "+s;super(c),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var w;return(w=n)!=null?w:n=[t,...e()]}}}function Ji(r){return be(r)&&typeof r[Symbol.iterator]=="function"}function be(r){return typeof r=="object"&&r!=null}function le(r){return typeof r=="string"?JSON.stringify(r):""+r}function Qi(r){const{done:t,value:e}=r.next();return t?void 0:e}function es(r,t,e,n){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});const{path:s,branch:i}=t,{type:u}=e,{refinement:c,message:w="Expected a value of type `"+u+"`"+(c?" with refinement `"+c+"`":"")+", but received: `"+le(n)+"`"}=r;return{value:n,type:u,refinement:c,key:s[s.length-1],path:s,branch:i,...r,message:w}}function*vn(r,t,e,n){Ji(r)||(r=[r]);for(const s of r){const i=es(s,t,e,n);i&&(yield i)}}function*It(r,t,e){e===void 0&&(e={});const{path:n=[],branch:s=[r],coerce:i=!1,mask:u=!1}=e,c={path:n,branch:s};if(i&&(r=t.coercer(r,c),u&&t.type!=="type"&&be(t.schema)&&be(r)&&!Array.isArray(r)))for(const l in r)t.schema[l]===void 0&&delete r[l];let w=!0;for(const l of t.validator(r,c))w=!1,yield[l,void 0];for(let[l,d,v]of t.entries(r,c)){const y=It(d,v,{path:l===void 0?n:[...n,l],branch:l===void 0?s:[...s,d],coerce:i,mask:u});for(const p of y)p[0]?(w=!1,yield[p[0],void 0]):i&&(d=p[1],l===void 0?r=d:r instanceof Map?r.set(l,d):r instanceof Set?r.add(d):be(r)&&(r[l]=d))}if(w)for(const l of t.refiner(r,c))w=!1,yield[l,void 0];w&&(yield[void 0,r])}class de{constructor(t){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:e,schema:n,validator:s,refiner:i,coercer:u=w=>w,entries:c=function*(){}}=t;this.type=e,this.schema=n,this.entries=c,this.coercer=u,s?this.validator=(w,l)=>{const d=s(w,l);return vn(d,l,this,w)}:this.validator=()=>[],i?this.refiner=(w,l)=>{const d=i(w,l);return vn(d,l,this,w)}:this.refiner=()=>[]}assert(t){return ts(t,this)}create(t){return Lt(t,this)}is(t){return Yn(t,this)}mask(t){return ns(t,this)}validate(t,e){return e===void 0&&(e={}),Oe(t,this,e)}}function ts(r,t){const e=Oe(r,t);if(e[0])throw e[0]}function Lt(r,t){const e=Oe(r,t,{coerce:!0});if(e[0])throw e[0];return e[1]}function ns(r,t){const e=Oe(r,t,{coerce:!0,mask:!0});if(e[0])throw e[0];return e[1]}function Yn(r,t){return!Oe(r,t)[0]}function Oe(r,t,e){e===void 0&&(e={});const n=It(r,t,e),s=Qi(n);return s[0]?[new Yi(s[0],function*(){for(const u of n)u[0]&&(yield u[0])}),void 0]:[void 0,s[1]]}function Re(r,t){return new de({type:r,schema:null,validator:t})}function rs(){return Re("any",()=>!0)}function lt(r){return new de({type:"array",schema:r,*entries(t){if(r&&Array.isArray(t))for(const[e,n]of t.entries())yield[e,n,r]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||"Expected an array value, but received: "+le(t)}})}function is(){return Re("boolean",r=>typeof r=="boolean")}function _n(r){const t=le(r);return new de({type:"literal",schema:r,validator(e){return e===r||"Expected the literal `"+t+"`, but received: "+le(e)}})}function je(r){return new de({...r,validator:(t,e)=>t===null||r.validator(t,e),refiner:(t,e)=>t===null||r.refiner(t,e)})}function Fe(){return Re("number",r=>typeof r=="number"&&!isNaN(r)||"Expected a number, but received: "+le(r))}function ze(r){return new de({...r,validator:(t,e)=>t===void 0||r.validator(t,e),refiner:(t,e)=>t===void 0||r.refiner(t,e)})}function fe(){return Re("string",r=>typeof r=="string"||"Expected a string, but received: "+le(r))}function ue(r){const t=Object.keys(r);return new de({type:"type",schema:r,*entries(e){if(be(e))for(const n of t)yield[n,e[n],r[n]]},validator(e){return be(e)||"Expected an object, but received: "+le(e)}})}function Jn(r){const t=r.map(e=>e.type).join(" | ");return new de({type:"union",schema:null,coercer(e,n){return(r.find(i=>{const[u]=i.validate(e,{coerce:!0});return!u})||Tt()).coercer(e,n)},validator(e,n){const s=[];for(const i of r){const[...u]=It(e,i,n),[c]=u;if(c[0])for(const[w]of u)w&&s.push(w);else return[]}return["Expected the value to satisfy a union of `"+t+"`, but received: "+le(e),...s]}})}function Tt(){return Re("unknown",()=>!0)}function ss(r,t,e){return new de({...r,coercer:(n,s)=>Yn(n,t)?r.coercer(e(n,s),s):r.coercer(n,s)})}async function os(r,t,e,n){r=Q(r),n||(n=Ke());const s=new F.Transaction$1;if(s.add(new F.TransactionInstruction({programId:r,keys:t??[],data:e})),n.sendAndConfirm===void 0)throw new Error("This function requires 'Provider.sendAndConfirm' to be implemented.");return await n.sendAndConfirm(s,[])}const En=99;async function as(r,t,e){return(await Ct(r,t,e)).map(s=>s?{publicKey:s.publicKey,account:s.account}:null)}async function Ct(r,t,e){if(t.length<=En)return await An(r,t,e);{const n=Vi(t,En);return(await Promise.all(n.map(i=>An(r,i,e)))).flat()}}async function An(r,t,e){const n=e??r.commitment,{value:s,context:i}=await r.getMultipleAccountsInfoAndContext(t,n);return s.map((c,w)=>c===null?null:{publicKey:t[w],account:c,context:i})}async function Qn(r,t,e,n,s){var i;e&&e.length>0&&t.sign(...e);const u=t._compile(),c=u.serialize(),l=t._serialize(c).toString("base64"),d={encoding:"base64",commitment:n??r.commitment};if(s){const m=(Array.isArray(s)?s:u.nonProgramIds()).map(I=>I.toBase58());d.accounts={encoding:"base64",addresses:m}}e&&(d.sigVerify=!0);const v=[l,d],y=await r._rpcRequest("simulateTransaction",v),p=Lt(y,ds);if("error"in p){let m;if("data"in p.error&&(m=(i=p.error.data)===null||i===void 0?void 0:i.logs,m&&Array.isArray(m))){const I=`
1
+ "use strict";const $=require("./platform-DCcL7jHP.js"),F=require("./unsignedTransaction-qRBv5Cnd.js");function br(r){if(r!==void 0)return{connection:r}}var Ae={},L={},Mt;function $t(){if(Mt)return L;Mt=1;class r{constructor(o,a){if(!Number.isInteger(o))throw new TypeError("span must be an integer");this.span=o,this.property=a}makeDestinationObject(){return{}}decode(o,a){throw new Error("Layout is abstract")}encode(o,a,f){throw new Error("Layout is abstract")}getSpan(o,a){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(o){const a=Object.create(this.constructor.prototype);return Object.assign(a,this),a.property=o,a}fromArray(o){}}L.Layout=r;function t(g,o){return o.property?g+"["+o.property+"]":g}L.nameWithProperty=t;function e(g,o){if(typeof g!="function")throw new TypeError("Class must be constructor");if(g.hasOwnProperty("layout_"))throw new Error("Class is already bound to a layout");if(!(o&&o instanceof r))throw new TypeError("layout must be a Layout");if(o.hasOwnProperty("boundConstructor_"))throw new Error("layout is already bound to a constructor");g.layout_=o,o.boundConstructor_=g,o.makeDestinationObject=(()=>new g),Object.defineProperty(g.prototype,"encode",{value:function(a,f){return o.encode(this,a,f)},writable:!0}),Object.defineProperty(g,"decode",{value:function(a,f){return o.decode(a,f)},writable:!0})}L.bindConstructorLayout=e;class n extends r{isCount(){throw new Error("ExternalLayout is abstract")}}class s extends n{constructor(o,a){if(o===void 0&&(o=1),!Number.isInteger(o)||0>=o)throw new TypeError("elementSpan must be a (positive) integer");super(-1,a),this.elementSpan=o}isCount(){return!0}decode(o,a){a===void 0&&(a=0);const f=o.length-a;return Math.floor(f/this.elementSpan)}encode(o,a,f){return 0}}class i extends n{constructor(o,a,f){if(!(o instanceof r))throw new TypeError("layout must be a Layout");if(a===void 0)a=0;else if(!Number.isInteger(a))throw new TypeError("offset must be integer or undefined");super(o.span,f||o.property),this.layout=o,this.offset=a}isCount(){return this.layout instanceof u||this.layout instanceof c}decode(o,a){return a===void 0&&(a=0),this.layout.decode(o,a+this.offset)}encode(o,a,f){return f===void 0&&(f=0),this.layout.encode(o,a,f+this.offset)}}class u extends r{constructor(o,a){if(super(o,a),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(o,a){return a===void 0&&(a=0),o.readUIntLE(a,this.span)}encode(o,a,f){return f===void 0&&(f=0),a.writeUIntLE(o,f,this.span),this.span}}class c extends r{constructor(o,a){if(super(o,a),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(o,a){return a===void 0&&(a=0),o.readUIntBE(a,this.span)}encode(o,a,f){return f===void 0&&(f=0),a.writeUIntBE(o,f,this.span),this.span}}class w extends r{constructor(o,a){if(super(o,a),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(o,a){return a===void 0&&(a=0),o.readIntLE(a,this.span)}encode(o,a,f){return f===void 0&&(f=0),a.writeIntLE(o,f,this.span),this.span}}class l extends r{constructor(o,a){if(super(o,a),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(o,a){return a===void 0&&(a=0),o.readIntBE(a,this.span)}encode(o,a,f){return f===void 0&&(f=0),a.writeIntBE(o,f,this.span),this.span}}const d=Math.pow(2,32);function v(g){const o=Math.floor(g/d),a=g-o*d;return{hi32:o,lo32:a}}function y(g,o){return g*d+o}class p extends r{constructor(o){super(8,o)}decode(o,a){a===void 0&&(a=0);const f=o.readUInt32LE(a),E=o.readUInt32LE(a+4);return y(E,f)}encode(o,a,f){f===void 0&&(f=0);const E=v(o);return a.writeUInt32LE(E.lo32,f),a.writeUInt32LE(E.hi32,f+4),8}}class m extends r{constructor(o){super(8,o)}decode(o,a){a===void 0&&(a=0);const f=o.readUInt32BE(a),E=o.readUInt32BE(a+4);return y(f,E)}encode(o,a,f){f===void 0&&(f=0);const E=v(o);return a.writeUInt32BE(E.hi32,f),a.writeUInt32BE(E.lo32,f+4),8}}class I extends r{constructor(o){super(8,o)}decode(o,a){a===void 0&&(a=0);const f=o.readUInt32LE(a),E=o.readInt32LE(a+4);return y(E,f)}encode(o,a,f){f===void 0&&(f=0);const E=v(o);return a.writeUInt32LE(E.lo32,f),a.writeInt32LE(E.hi32,f+4),8}}class _ extends r{constructor(o){super(8,o)}decode(o,a){a===void 0&&(a=0);const f=o.readInt32BE(a),E=o.readUInt32BE(a+4);return y(f,E)}encode(o,a,f){f===void 0&&(f=0);const E=v(o);return a.writeInt32BE(E.hi32,f),a.writeUInt32BE(E.lo32,f+4),8}}class A extends r{constructor(o){super(4,o)}decode(o,a){return a===void 0&&(a=0),o.readFloatLE(a)}encode(o,a,f){return f===void 0&&(f=0),a.writeFloatLE(o,f),4}}class R extends r{constructor(o){super(4,o)}decode(o,a){return a===void 0&&(a=0),o.readFloatBE(a)}encode(o,a,f){return f===void 0&&(f=0),a.writeFloatBE(o,f),4}}class k extends r{constructor(o){super(8,o)}decode(o,a){return a===void 0&&(a=0),o.readDoubleLE(a)}encode(o,a,f){return f===void 0&&(f=0),a.writeDoubleLE(o,f),8}}class x extends r{constructor(o){super(8,o)}decode(o,a){return a===void 0&&(a=0),o.readDoubleBE(a)}encode(o,a,f){return f===void 0&&(f=0),a.writeDoubleBE(o,f),8}}class U extends r{constructor(o,a,f){if(!(o instanceof r))throw new TypeError("elementLayout must be a Layout");if(!(a instanceof n&&a.isCount()||Number.isInteger(a)&&0<=a))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let E=-1;!(a instanceof n)&&0<o.span&&(E=a*o.span),super(E,f),this.elementLayout=o,this.count=a}getSpan(o,a){if(0<=this.span)return this.span;a===void 0&&(a=0);let f=0,E=this.count;if(E instanceof n&&(E=E.decode(o,a)),0<this.elementLayout.span)f=E*this.elementLayout.span;else{let T=0;for(;T<E;)f+=this.elementLayout.getSpan(o,a+f),++T}return f}decode(o,a){a===void 0&&(a=0);const f=[];let E=0,T=this.count;for(T instanceof n&&(T=T.decode(o,a));E<T;)f.push(this.elementLayout.decode(o,a)),a+=this.elementLayout.getSpan(o,a),E+=1;return f}encode(o,a,f){f===void 0&&(f=0);const E=this.elementLayout,T=o.reduce((q,W)=>q+E.encode(W,a,f+q),0);return this.count instanceof n&&this.count.encode(o.length,a,f),T}}class K extends r{constructor(o,a,f){if(!(Array.isArray(o)&&o.reduce((T,q)=>T&&q instanceof r,!0)))throw new TypeError("fields must be array of Layout instances");typeof a=="boolean"&&f===void 0&&(f=a,a=void 0);for(const T of o)if(0>T.span&&T.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let E=-1;try{E=o.reduce((T,q)=>T+q.getSpan(),0)}catch{}super(E,a),this.fields=o,this.decodePrefixes=!!f}getSpan(o,a){if(0<=this.span)return this.span;a===void 0&&(a=0);let f=0;try{f=this.fields.reduce((E,T)=>{const q=T.getSpan(o,a);return a+=q,E+q},0)}catch{throw new RangeError("indeterminate span")}return f}decode(o,a){a===void 0&&(a=0);const f=this.makeDestinationObject();for(const E of this.fields)if(E.property!==void 0&&(f[E.property]=E.decode(o,a)),a+=E.getSpan(o,a),this.decodePrefixes&&o.length===a)break;return f}encode(o,a,f){f===void 0&&(f=0);const E=f;let T=0,q=0;for(const W of this.fields){let Ee=W.span;if(q=0<Ee?Ee:0,W.property!==void 0){const Nt=o[W.property];Nt!==void 0&&(q=W.encode(Nt,a,f),0>Ee&&(Ee=W.getSpan(a,f)))}T=f,f+=Ee}return T+q-E}fromArray(o){const a=this.makeDestinationObject();for(const f of this.fields)f.property!==void 0&&0<o.length&&(a[f.property]=o.shift());return a}layoutFor(o){if(typeof o!="string")throw new TypeError("property must be string");for(const a of this.fields)if(a.property===o)return a}offsetOf(o){if(typeof o!="string")throw new TypeError("property must be string");let a=0;for(const f of this.fields){if(f.property===o)return a;0>f.span?a=-1:0<=a&&(a+=f.span)}}}class P{constructor(o){this.property=o}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}}class j extends P{constructor(o,a){if(!(o instanceof n&&o.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(a||o.property||"variant"),this.layout=o}decode(o,a){return this.layout.decode(o,a)}encode(o,a,f){return this.layout.encode(o,a,f)}}class V extends r{constructor(o,a,f){const E=o instanceof u||o instanceof c;if(E)o=new j(new i(o));else if(o instanceof n&&o.isCount())o=new j(o);else if(!(o instanceof P))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(a===void 0&&(a=null),!(a===null||a instanceof r))throw new TypeError("defaultLayout must be null or a Layout");if(a!==null){if(0>a.span)throw new Error("defaultLayout must have constant span");a.property===void 0&&(a=a.replicate("content"))}let T=-1;a&&(T=a.span,0<=T&&E&&(T+=o.layout.span)),super(T,f),this.discriminator=o,this.usesPrefixDiscriminator=E,this.defaultLayout=a,this.registry={};let q=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(W){return q(W)},this.configGetSourceVariant=function(W){q=W.bind(this)}}getSpan(o,a){if(0<=this.span)return this.span;a===void 0&&(a=0);const f=this.getVariant(o,a);if(!f)throw new Error("unable to determine span for unrecognized variant");return f.getSpan(o,a)}defaultGetSourceVariant(o){if(o.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&o.hasOwnProperty(this.defaultLayout.property))return;const a=this.registry[o[this.discriminator.property]];if(a&&(!a.layout||o.hasOwnProperty(a.property)))return a}else for(const a in this.registry){const f=this.registry[a];if(o.hasOwnProperty(f.property))return f}throw new Error("unable to infer src variant")}decode(o,a){a===void 0&&(a=0);let f;const E=this.discriminator,T=E.decode(o,a);let q=this.registry[T];if(q===void 0){let W=0;q=this.defaultLayout,this.usesPrefixDiscriminator&&(W=E.layout.span),f=this.makeDestinationObject(),f[E.property]=T,f[q.property]=this.defaultLayout.decode(o,a+W)}else f=q.decode(o,a);return f}encode(o,a,f){f===void 0&&(f=0);const E=this.getSourceVariant(o);if(E===void 0){const T=this.discriminator,q=this.defaultLayout;let W=0;return this.usesPrefixDiscriminator&&(W=T.layout.span),T.encode(o[T.property],a,f),W+q.encode(o[q.property],a,f+W)}return E.encode(o,a,f)}addVariant(o,a,f){const E=new N(this,o,a,f);return this.registry[o]=E,E}getVariant(o,a){let f=o;return $.Buffer.isBuffer(o)&&(a===void 0&&(a=0),f=this.discriminator.decode(o,a)),this.registry[f]}}class N extends r{constructor(o,a,f,E){if(!(o instanceof V))throw new TypeError("union must be a Union");if(!Number.isInteger(a)||0>a)throw new TypeError("variant must be a (non-negative) integer");if(typeof f=="string"&&E===void 0&&(E=f,f=null),f){if(!(f instanceof r))throw new TypeError("layout must be a Layout");if(o.defaultLayout!==null&&0<=f.span&&f.span>o.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof E!="string")throw new TypeError("variant must have a String property")}let T=o.span;0>o.span&&(T=f?f.span:0,0<=T&&o.usesPrefixDiscriminator&&(T+=o.discriminator.layout.span)),super(T,E),this.union=o,this.variant=a,this.layout=f||null}getSpan(o,a){if(0<=this.span)return this.span;a===void 0&&(a=0);let f=0;return this.union.usesPrefixDiscriminator&&(f=this.union.discriminator.layout.span),f+this.layout.getSpan(o,a+f)}decode(o,a){const f=this.makeDestinationObject();if(a===void 0&&(a=0),this!==this.union.getVariant(o,a))throw new Error("variant mismatch");let E=0;return this.union.usesPrefixDiscriminator&&(E=this.union.discriminator.layout.span),this.layout?f[this.property]=this.layout.decode(o,a+E):this.property?f[this.property]=!0:this.union.usesPrefixDiscriminator&&(f[this.union.discriminator.property]=this.variant),f}encode(o,a,f){f===void 0&&(f=0);let E=0;if(this.union.usesPrefixDiscriminator&&(E=this.union.discriminator.layout.span),this.layout&&!o.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,a,f);let T=E;if(this.layout&&(this.layout.encode(o[this.property],a,f+E),T+=this.layout.getSpan(a,f+E),0<=this.union.span&&T>this.union.span))throw new Error("encoded variant overruns containing union");return T}fromArray(o){if(this.layout)return this.layout.fromArray(o)}}function B(g){return 0>g&&(g+=4294967296),g}class O extends r{constructor(o,a,f){if(!(o instanceof u||o instanceof c))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof a=="string"&&f===void 0&&(f=a,a=void 0),4<o.span)throw new RangeError("word cannot exceed 32 bits");super(o.span,f),this.word=o,this.msb=!!a,this.fields=[];let E=0;this._packedSetValue=function(T){return E=B(T),this},this._packedGetValue=function(){return E}}decode(o,a){const f=this.makeDestinationObject();a===void 0&&(a=0);const E=this.word.decode(o,a);this._packedSetValue(E);for(const T of this.fields)T.property!==void 0&&(f[T.property]=T.decode(E));return f}encode(o,a,f){f===void 0&&(f=0);const E=this.word.decode(a,f);this._packedSetValue(E);for(const T of this.fields)if(T.property!==void 0){const q=o[T.property];q!==void 0&&T.encode(q)}return this.word.encode(this._packedGetValue(),a,f)}addField(o,a){const f=new S(this,o,a);return this.fields.push(f),f}addBoolean(o){const a=new h(this,o);return this.fields.push(a),a}fieldFor(o){if(typeof o!="string")throw new TypeError("property must be string");for(const a of this.fields)if(a.property===o)return a}}class S{constructor(o,a,f){if(!(o instanceof O))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(a)||0>=a)throw new TypeError("bits must be positive integer");const E=8*o.span,T=o.fields.reduce((q,W)=>q+W.bits,0);if(a+T>E)throw new Error("bits too long for span remainder ("+(E-T)+" of "+E+" remain)");this.container=o,this.bits=a,this.valueMask=(1<<a)-1,a===32&&(this.valueMask=4294967295),this.start=T,this.container.msb&&(this.start=E-T-a),this.wordMask=B(this.valueMask<<this.start),this.property=f}decode(){const o=this.container._packedGetValue();return B(o&this.wordMask)>>>this.start}encode(o){if(!Number.isInteger(o)||o!==B(o&this.valueMask))throw new TypeError(t("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const a=this.container._packedGetValue(),f=B(o<<this.start);this.container._packedSetValue(B(a&~this.wordMask)|f)}}class h extends S{constructor(o,a){super(o,1,a)}decode(o,a){return!!S.prototype.decode.call(this,o,a)}encode(o){return typeof o=="boolean"&&(o=+o),S.prototype.encode.call(this,o)}}class b extends r{constructor(o,a){if(!(o instanceof n&&o.isCount()||Number.isInteger(o)&&0<=o))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let f=-1;o instanceof n||(f=o),super(f,a),this.length=o}getSpan(o,a){let f=this.span;return 0>f&&(f=this.length.decode(o,a)),f}decode(o,a){a===void 0&&(a=0);let f=this.span;return 0>f&&(f=this.length.decode(o,a)),o.slice(a,a+f)}encode(o,a,f){let E=this.length;if(this.length instanceof n&&(E=o.length),!($.Buffer.isBuffer(o)&&E===o.length))throw new TypeError(t("Blob.encode",this)+" requires (length "+E+") Buffer as src");if(f+E>a.length)throw new RangeError("encoding overruns Buffer");return a.write(o.toString("hex"),f,E,"hex"),this.length instanceof n&&this.length.encode(E,a,f),E}}class C extends r{constructor(o){super(-1,o)}getSpan(o,a){if(!$.Buffer.isBuffer(o))throw new TypeError("b must be a Buffer");a===void 0&&(a=0);let f=a;for(;f<o.length&&o[f]!==0;)f+=1;return 1+f-a}decode(o,a,f){a===void 0&&(a=0);let E=this.getSpan(o,a);return o.slice(a,a+E-1).toString("utf-8")}encode(o,a,f){f===void 0&&(f=0),typeof o!="string"&&(o=o.toString());const E=new $.Buffer(o,"utf8"),T=E.length;if(f+T>a.length)throw new RangeError("encoding overruns Buffer");return E.copy(a,f),a[f+T]=0,T+1}}class z extends r{constructor(o,a){if(typeof o=="string"&&a===void 0&&(a=o,o=void 0),o===void 0)o=-1;else if(!Number.isInteger(o))throw new TypeError("maxSpan must be an integer");super(-1,a),this.maxSpan=o}getSpan(o,a){if(!$.Buffer.isBuffer(o))throw new TypeError("b must be a Buffer");return a===void 0&&(a=0),o.length-a}decode(o,a,f){a===void 0&&(a=0);let E=this.getSpan(o,a);if(0<=this.maxSpan&&this.maxSpan<E)throw new RangeError("text length exceeds maxSpan");return o.slice(a,a+E).toString("utf-8")}encode(o,a,f){f===void 0&&(f=0),typeof o!="string"&&(o=o.toString());const E=new $.Buffer(o,"utf8"),T=E.length;if(0<=this.maxSpan&&this.maxSpan<T)throw new RangeError("text length exceeds maxSpan");if(f+T>a.length)throw new RangeError("encoding overruns Buffer");return E.copy(a,f),T}}class H extends r{constructor(o,a){super(0,a),this.value=o}decode(o,a,f){return this.value}encode(o,a,f){return 0}}return L.ExternalLayout=n,L.GreedyCount=s,L.OffsetLayout=i,L.UInt=u,L.UIntBE=c,L.Int=w,L.IntBE=l,L.Float=A,L.FloatBE=R,L.Double=k,L.DoubleBE=x,L.Sequence=U,L.Structure=K,L.UnionDiscriminator=P,L.UnionLayoutDiscriminator=j,L.Union=V,L.VariantLayout=N,L.BitStructure=O,L.BitField=S,L.Boolean=h,L.Blob=b,L.CString=C,L.UTF8=z,L.Constant=H,L.greedy=((g,o)=>new s(g,o)),L.offset=((g,o,a)=>new i(g,o,a)),L.u8=(g=>new u(1,g)),L.u16=(g=>new u(2,g)),L.u24=(g=>new u(3,g)),L.u32=(g=>new u(4,g)),L.u40=(g=>new u(5,g)),L.u48=(g=>new u(6,g)),L.nu64=(g=>new p(g)),L.u16be=(g=>new c(2,g)),L.u24be=(g=>new c(3,g)),L.u32be=(g=>new c(4,g)),L.u40be=(g=>new c(5,g)),L.u48be=(g=>new c(6,g)),L.nu64be=(g=>new m(g)),L.s8=(g=>new w(1,g)),L.s16=(g=>new w(2,g)),L.s24=(g=>new w(3,g)),L.s32=(g=>new w(4,g)),L.s40=(g=>new w(5,g)),L.s48=(g=>new w(6,g)),L.ns64=(g=>new I(g)),L.s16be=(g=>new l(2,g)),L.s24be=(g=>new l(3,g)),L.s32be=(g=>new l(4,g)),L.s40be=(g=>new l(5,g)),L.s48be=(g=>new l(6,g)),L.ns64be=(g=>new _(g)),L.f32=(g=>new A(g)),L.f32be=(g=>new R(g)),L.f64=(g=>new k(g)),L.f64be=(g=>new x(g)),L.struct=((g,o,a)=>new K(g,o,a)),L.bits=((g,o,a)=>new O(g,o,a)),L.seq=((g,o,a)=>new U(g,o,a)),L.union=((g,o,a)=>new V(g,o,a)),L.unionLayoutDiscriminator=((g,o)=>new j(g,o)),L.blob=((g,o)=>new b(g,o)),L.cstr=(g=>new C(g)),L.utf8=((g,o)=>new z(g,o)),L.const=((g,o)=>new H(g,o)),L}const vr=F.getAugmentedNamespace(F.index_browser_esm);var jt;function _r(){return jt||(jt=1,(function(r){var t=Ae&&Ae.__importDefault||function(O){return O&&O.__esModule?O:{default:O}};Object.defineProperty(r,"__esModule",{value:!0}),r.map=r.array=r.rustEnum=r.str=r.vecU8=r.tagged=r.vec=r.bool=r.option=r.publicKey=r.i256=r.u256=r.i128=r.u128=r.i64=r.u64=r.struct=r.f64=r.f32=r.i32=r.u32=r.i16=r.u16=r.i8=r.u8=void 0;const e=$t(),n=vr,s=t(F.requireBn());var i=$t();Object.defineProperty(r,"u8",{enumerable:!0,get:function(){return i.u8}}),Object.defineProperty(r,"i8",{enumerable:!0,get:function(){return i.s8}}),Object.defineProperty(r,"u16",{enumerable:!0,get:function(){return i.u16}}),Object.defineProperty(r,"i16",{enumerable:!0,get:function(){return i.s16}}),Object.defineProperty(r,"u32",{enumerable:!0,get:function(){return i.u32}}),Object.defineProperty(r,"i32",{enumerable:!0,get:function(){return i.s32}}),Object.defineProperty(r,"f32",{enumerable:!0,get:function(){return i.f32}}),Object.defineProperty(r,"f64",{enumerable:!0,get:function(){return i.f64}}),Object.defineProperty(r,"struct",{enumerable:!0,get:function(){return i.struct}});class u extends e.Layout{constructor(S,h,b){super(S,b),this.blob=(0,e.blob)(S),this.signed=h}decode(S,h=0){const b=new s.default(this.blob.decode(S,h),10,"le");return this.signed?b.fromTwos(this.span*8).clone():b}encode(S,h,b=0){return this.signed&&(S=S.toTwos(this.span*8)),this.blob.encode(S.toArrayLike($.Buffer,"le",this.span),h,b)}}function c(O){return new u(8,!1,O)}r.u64=c;function w(O){return new u(8,!0,O)}r.i64=w;function l(O){return new u(16,!1,O)}r.u128=l;function d(O){return new u(16,!0,O)}r.i128=d;function v(O){return new u(32,!1,O)}r.u256=v;function y(O){return new u(32,!0,O)}r.i256=y;class p extends e.Layout{constructor(S,h,b,C){super(S.span,C),this.layout=S,this.decoder=h,this.encoder=b}decode(S,h){return this.decoder(this.layout.decode(S,h))}encode(S,h,b){return this.layout.encode(this.encoder(S),h,b)}getSpan(S,h){return this.layout.getSpan(S,h)}}function m(O){return new p((0,e.blob)(32),S=>new n.PublicKey(S),S=>S.toBuffer(),O)}r.publicKey=m;class I extends e.Layout{constructor(S,h){super(-1,h),this.layout=S,this.discriminator=(0,e.u8)()}encode(S,h,b=0){return S==null?this.discriminator.encode(0,h,b):(this.discriminator.encode(1,h,b),this.layout.encode(S,h,b+1)+1)}decode(S,h=0){const b=this.discriminator.decode(S,h);if(b===0)return null;if(b===1)return this.layout.decode(S,h+1);throw new Error("Invalid option "+this.property)}getSpan(S,h=0){const b=this.discriminator.decode(S,h);if(b===0)return 1;if(b===1)return this.layout.getSpan(S,h+1)+1;throw new Error("Invalid option "+this.property)}}function _(O,S){return new I(O,S)}r.option=_;function A(O){return new p((0,e.u8)(),R,k,O)}r.bool=A;function R(O){if(O===0)return!1;if(O===1)return!0;throw new Error("Invalid bool: "+O)}function k(O){return O?1:0}function x(O,S){const h=(0,e.u32)("length"),b=(0,e.struct)([h,(0,e.seq)(O,(0,e.offset)(h,-h.span),"values")]);return new p(b,({values:C})=>C,C=>({values:C}),S)}r.vec=x;function U(O,S,h){const b=(0,e.struct)([c("tag"),S.replicate("data")]);function C({tag:z,data:H}){if(!z.eq(O))throw new Error("Invalid tag, expected: "+O.toString("hex")+", got: "+z.toString("hex"));return H}return new p(b,C,z=>({tag:O,data:z}),h)}r.tagged=U;function K(O){const S=(0,e.u32)("length"),h=(0,e.struct)([S,(0,e.blob)((0,e.offset)(S,-S.span),"data")]);return new p(h,({data:b})=>b,b=>({data:b}),O)}r.vecU8=K;function P(O){return new p(K(),S=>S.toString("utf-8"),S=>$.Buffer.from(S,"utf-8"),O)}r.str=P;function j(O,S,h){const b=(0,e.union)(h??(0,e.u8)(),S);return O.forEach((C,z)=>b.addVariant(z,C,C.property)),b}r.rustEnum=j;function V(O,S,h){const b=(0,e.struct)([(0,e.seq)(O,S,"values")]);return new p(b,({values:C})=>C,C=>({values:C}),h)}r.array=V;class N extends e.Layout{constructor(S,h,b){super(S.span+h.span,b),this.keyLayout=S,this.valueLayout=h}decode(S,h){h=h||0;const b=this.keyLayout.decode(S,h),C=this.valueLayout.decode(S,h+this.keyLayout.getSpan(S,h));return[b,C]}encode(S,h,b){b=b||0;const C=this.keyLayout.encode(S[0],h,b),z=this.valueLayout.encode(S[1],h,b+C);return C+z}getSpan(S,h){return this.keyLayout.getSpan(S,h)+this.valueLayout.getSpan(S,h)}}function B(O,S,h){const b=(0,e.u32)("length"),C=(0,e.struct)([b,(0,e.seq)(new N(O,S),(0,e.offset)(b,-b.span),"values")]);return new p(C,({values:z})=>new Map(z),z=>({values:Array.from(z.entries())}),h)}r.map=B})(Ae)),Ae}var M=_r(),De={exports:{}},Vt;function Er(){if(Vt)return De.exports;Vt=1;const r=/[\p{Lu}]/u,t=/[\p{Ll}]/u,e=/^[\p{Lu}](?![\p{Lu}])/gu,n=/([\p{Alpha}\p{N}_]|$)/u,s=/[_.\- ]+/,i=new RegExp("^"+s.source),u=new RegExp(s.source+n.source,"gu"),c=new RegExp("\\d+"+n.source,"gu"),w=(y,p,m)=>{let I=!1,_=!1,A=!1;for(let R=0;R<y.length;R++){const k=y[R];I&&r.test(k)?(y=y.slice(0,R)+"-"+y.slice(R),I=!1,A=_,_=!0,R++):_&&A&&t.test(k)?(y=y.slice(0,R-1)+"-"+y.slice(R-1),A=_,_=!1,I=!0):(I=p(k)===k&&m(k)!==k,A=_,_=m(k)===k&&p(k)!==k)}return y},l=(y,p)=>(e.lastIndex=0,y.replace(e,m=>p(m))),d=(y,p)=>(u.lastIndex=0,c.lastIndex=0,y.replace(u,(m,I)=>p(I)).replace(c,m=>p(m))),v=(y,p)=>{if(!(typeof y=="string"||Array.isArray(y)))throw new TypeError("Expected the input to be `string | string[]`");if(p={pascalCase:!1,preserveConsecutiveUppercase:!1,...p},Array.isArray(y)?y=y.map(A=>A.trim()).filter(A=>A.length).join("-"):y=y.trim(),y.length===0)return"";const m=p.locale===!1?A=>A.toLowerCase():A=>A.toLocaleLowerCase(p.locale),I=p.locale===!1?A=>A.toUpperCase():A=>A.toLocaleUpperCase(p.locale);return y.length===1?p.pascalCase?I(y):m(y):(y!==m(y)&&(y=w(y,m,I)),y=y.replace(i,""),p.preserveConsecutiveUppercase?y=l(y,m):y=m(y),p.pascalCase&&(y=I(y.charAt(0))+y.slice(1)),d(y,I))};return De.exports=v,De.exports.default=v,De.exports}var Ar=Er();const Z=F.getDefaultExportFromCjs(Ar);function _e(r){let t=r.length;for(;--t>=0;)r[t]=0}const xr=3,kr=258,Cn=29,Sr=256,Ir=Sr+1+Cn,On=30,Lr=512,Tr=new Array((Ir+2)*2);_e(Tr);const Cr=new Array(On*2);_e(Cr);const Or=new Array(Lr);_e(Or);const Rr=new Array(kr-xr+1);_e(Rr);const Pr=new Array(Cn);_e(Pr);const Br=new Array(On);_e(Br);const Dr=(r,t,e,n)=>{let s=r&65535|0,i=r>>>16&65535|0,u=0;for(;e!==0;){u=e>2e3?2e3:e,e-=u;do s=s+t[n++]|0,i=i+s|0;while(--u);s%=65521,i%=65521}return s|i<<16|0};var ht=Dr;const Ur=()=>{let r,t=[];for(var e=0;e<256;e++){r=e;for(var n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r}return t},Nr=new Uint32Array(Ur()),Mr=(r,t,e,n)=>{const s=Nr,i=n+e;r^=-1;for(let u=n;u<i;u++)r=r>>>8^s[(r^t[u])&255];return r^-1};var re=Mr,pt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Rn={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const $r=(r,t)=>Object.prototype.hasOwnProperty.call(r,t);var jr=function(r){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if(typeof e!="object")throw new TypeError(e+"must be non-object");for(const n in e)$r(e,n)&&(r[n]=e[n])}}return r},Vr=r=>{let t=0;for(let n=0,s=r.length;n<s;n++)t+=r[n].length;const e=new Uint8Array(t);for(let n=0,s=0,i=r.length;n<i;n++){let u=r[n];e.set(u,s),s+=u.length}return e},Pn={assign:jr,flattenChunks:Vr};let Bn=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Bn=!1}const Le=new Uint8Array(256);for(let r=0;r<256;r++)Le[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;Le[254]=Le[254]=1;var Fr=r=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(r);let t,e,n,s,i,u=r.length,c=0;for(s=0;s<u;s++)e=r.charCodeAt(s),(e&64512)===55296&&s+1<u&&(n=r.charCodeAt(s+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),s++)),c+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(c),i=0,s=0;i<c;s++)e=r.charCodeAt(s),(e&64512)===55296&&s+1<u&&(n=r.charCodeAt(s+1),(n&64512)===56320&&(e=65536+(e-55296<<10)+(n-56320),s++)),e<128?t[i++]=e:e<2048?(t[i++]=192|e>>>6,t[i++]=128|e&63):e<65536?(t[i++]=224|e>>>12,t[i++]=128|e>>>6&63,t[i++]=128|e&63):(t[i++]=240|e>>>18,t[i++]=128|e>>>12&63,t[i++]=128|e>>>6&63,t[i++]=128|e&63);return t};const zr=(r,t)=>{if(t<65534&&r.subarray&&Bn)return String.fromCharCode.apply(null,r.length===t?r:r.subarray(0,t));let e="";for(let n=0;n<t;n++)e+=String.fromCharCode(r[n]);return e};var qr=(r,t)=>{const e=t||r.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(r.subarray(0,t));let n,s;const i=new Array(e*2);for(s=0,n=0;n<e;){let u=r[n++];if(u<128){i[s++]=u;continue}let c=Le[u];if(c>4){i[s++]=65533,n+=c-1;continue}for(u&=c===2?31:c===3?15:7;c>1&&n<e;)u=u<<6|r[n++]&63,c--;if(c>1){i[s++]=65533;continue}u<65536?i[s++]=u:(u-=65536,i[s++]=55296|u>>10&1023,i[s++]=56320|u&1023)}return zr(i,s)},Kr=(r,t)=>{t=t||r.length,t>r.length&&(t=r.length);let e=t-1;for(;e>=0&&(r[e]&192)===128;)e--;return e<0||e===0?t:e+Le[r[e]]>t?e:t},wt={string2buf:Fr,buf2string:qr,utf8border:Kr};function Gr(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Zr=Gr;const Ue=16209,Hr=16191;var Wr=function(t,e){let n,s,i,u,c,w,l,d,v,y,p,m,I,_,A,R,k,x,U,K,P,j,V,N;const B=t.state;n=t.next_in,V=t.input,s=n+(t.avail_in-5),i=t.next_out,N=t.output,u=i-(e-t.avail_out),c=i+(t.avail_out-257),w=B.dmax,l=B.wsize,d=B.whave,v=B.wnext,y=B.window,p=B.hold,m=B.bits,I=B.lencode,_=B.distcode,A=(1<<B.lenbits)-1,R=(1<<B.distbits)-1;e:do{m<15&&(p+=V[n++]<<m,m+=8,p+=V[n++]<<m,m+=8),k=I[p&A];t:for(;;){if(x=k>>>24,p>>>=x,m-=x,x=k>>>16&255,x===0)N[i++]=k&65535;else if(x&16){U=k&65535,x&=15,x&&(m<x&&(p+=V[n++]<<m,m+=8),U+=p&(1<<x)-1,p>>>=x,m-=x),m<15&&(p+=V[n++]<<m,m+=8,p+=V[n++]<<m,m+=8),k=_[p&R];n:for(;;){if(x=k>>>24,p>>>=x,m-=x,x=k>>>16&255,x&16){if(K=k&65535,x&=15,m<x&&(p+=V[n++]<<m,m+=8,m<x&&(p+=V[n++]<<m,m+=8)),K+=p&(1<<x)-1,K>w){t.msg="invalid distance too far back",B.mode=Ue;break e}if(p>>>=x,m-=x,x=i-u,K>x){if(x=K-x,x>d&&B.sane){t.msg="invalid distance too far back",B.mode=Ue;break e}if(P=0,j=y,v===0){if(P+=l-x,x<U){U-=x;do N[i++]=y[P++];while(--x);P=i-K,j=N}}else if(v<x){if(P+=l+v-x,x-=v,x<U){U-=x;do N[i++]=y[P++];while(--x);if(P=0,v<U){x=v,U-=x;do N[i++]=y[P++];while(--x);P=i-K,j=N}}}else if(P+=v-x,x<U){U-=x;do N[i++]=y[P++];while(--x);P=i-K,j=N}for(;U>2;)N[i++]=j[P++],N[i++]=j[P++],N[i++]=j[P++],U-=3;U&&(N[i++]=j[P++],U>1&&(N[i++]=j[P++]))}else{P=i-K;do N[i++]=N[P++],N[i++]=N[P++],N[i++]=N[P++],U-=3;while(U>2);U&&(N[i++]=N[P++],U>1&&(N[i++]=N[P++]))}}else if((x&64)===0){k=_[(k&65535)+(p&(1<<x)-1)];continue n}else{t.msg="invalid distance code",B.mode=Ue;break e}break}}else if((x&64)===0){k=I[(k&65535)+(p&(1<<x)-1)];continue t}else if(x&32){B.mode=Hr;break e}else{t.msg="invalid literal/length code",B.mode=Ue;break e}break}}while(n<s&&i<c);U=m>>3,n-=U,m-=U<<3,p&=(1<<m)-1,t.next_in=n,t.next_out=i,t.avail_in=n<s?5+(s-n):5-(n-s),t.avail_out=i<c?257+(c-i):257-(i-c),B.hold=p,B.bits=m};const ge=15,Ft=852,zt=592,qt=0,tt=1,Kt=2,Xr=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Yr=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Jr=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Qr=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),ei=(r,t,e,n,s,i,u,c)=>{const w=c.bits;let l=0,d=0,v=0,y=0,p=0,m=0,I=0,_=0,A=0,R=0,k,x,U,K,P,j=null,V;const N=new Uint16Array(ge+1),B=new Uint16Array(ge+1);let O=null,S,h,b;for(l=0;l<=ge;l++)N[l]=0;for(d=0;d<n;d++)N[t[e+d]]++;for(p=w,y=ge;y>=1&&N[y]===0;y--);if(p>y&&(p=y),y===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,c.bits=1,0;for(v=1;v<y&&N[v]===0;v++);for(p<v&&(p=v),_=1,l=1;l<=ge;l++)if(_<<=1,_-=N[l],_<0)return-1;if(_>0&&(r===qt||y!==1))return-1;for(B[1]=0,l=1;l<ge;l++)B[l+1]=B[l]+N[l];for(d=0;d<n;d++)t[e+d]!==0&&(u[B[t[e+d]]++]=d);if(r===qt?(j=O=u,V=20):r===tt?(j=Xr,O=Yr,V=257):(j=Jr,O=Qr,V=0),R=0,d=0,l=v,P=i,m=p,I=0,U=-1,A=1<<p,K=A-1,r===tt&&A>Ft||r===Kt&&A>zt)return 1;for(;;){S=l-I,u[d]+1<V?(h=0,b=u[d]):u[d]>=V?(h=O[u[d]-V],b=j[u[d]-V]):(h=96,b=0),k=1<<l-I,x=1<<m,v=x;do x-=k,s[P+(R>>I)+x]=S<<24|h<<16|b|0;while(x!==0);for(k=1<<l-1;R&k;)k>>=1;if(k!==0?(R&=k-1,R+=k):R=0,d++,--N[l]===0){if(l===y)break;l=t[e+u[d]]}if(l>p&&(R&K)!==U){for(I===0&&(I=p),P+=v,m=l-I,_=1<<m;m+I<y&&(_-=N[m+I],!(_<=0));)m++,_<<=1;if(A+=1<<m,r===tt&&A>Ft||r===Kt&&A>zt)return 1;U=R&K,s[U]=p<<24|m<<16|P-i|0}}return R!==0&&(s[P+R]=l-I<<24|64<<16|0),c.bits=p,0};var Se=ei;const ti=0,Dn=1,Un=2,{Z_FINISH:Gt,Z_BLOCK:ni,Z_TREES:Ne,Z_OK:we,Z_STREAM_END:ri,Z_NEED_DICT:ii,Z_STREAM_ERROR:te,Z_DATA_ERROR:Nn,Z_MEM_ERROR:Mn,Z_BUF_ERROR:si,Z_DEFLATED:Zt}=Rn,We=16180,Ht=16181,Wt=16182,Xt=16183,Yt=16184,Jt=16185,Qt=16186,en=16187,tn=16188,nn=16189,qe=16190,se=16191,nt=16192,rn=16193,rt=16194,sn=16195,on=16196,an=16197,cn=16198,Me=16199,$e=16200,un=16201,ln=16202,dn=16203,fn=16204,hn=16205,it=16206,pn=16207,wn=16208,G=16209,$n=16210,jn=16211,oi=852,ai=592,ci=15,ui=ci,yn=r=>(r>>>24&255)+(r>>>8&65280)+((r&65280)<<8)+((r&255)<<24);function li(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ye=r=>{if(!r)return 1;const t=r.state;return!t||t.strm!==r||t.mode<We||t.mode>jn?1:0},Vn=r=>{if(ye(r))return te;const t=r.state;return r.total_in=r.total_out=t.total=0,r.msg="",t.wrap&&(r.adler=t.wrap&1),t.mode=We,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(oi),t.distcode=t.distdyn=new Int32Array(ai),t.sane=1,t.back=-1,we},Fn=r=>{if(ye(r))return te;const t=r.state;return t.wsize=0,t.whave=0,t.wnext=0,Vn(r)},zn=(r,t)=>{let e;if(ye(r))return te;const n=r.state;return t<0?(e=0,t=-t):(e=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?te:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=e,n.wbits=t,Fn(r))},qn=(r,t)=>{if(!r)return te;const e=new li;r.state=e,e.strm=r,e.window=null,e.mode=We;const n=zn(r,t);return n!==we&&(r.state=null),n},di=r=>qn(r,ui);let gn=!0,st,ot;const fi=r=>{if(gn){st=new Int32Array(512),ot=new Int32Array(32);let t=0;for(;t<144;)r.lens[t++]=8;for(;t<256;)r.lens[t++]=9;for(;t<280;)r.lens[t++]=7;for(;t<288;)r.lens[t++]=8;for(Se(Dn,r.lens,0,288,st,0,r.work,{bits:9}),t=0;t<32;)r.lens[t++]=5;Se(Un,r.lens,0,32,ot,0,r.work,{bits:5}),gn=!1}r.lencode=st,r.lenbits=9,r.distcode=ot,r.distbits=5},Kn=(r,t,e,n)=>{let s;const i=r.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),n>=i.wsize?(i.window.set(t.subarray(e-i.wsize,e),0),i.wnext=0,i.whave=i.wsize):(s=i.wsize-i.wnext,s>n&&(s=n),i.window.set(t.subarray(e-n,e-n+s),i.wnext),n-=s,n?(i.window.set(t.subarray(e-n,e),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=s,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=s))),0},hi=(r,t)=>{let e,n,s,i,u,c,w,l,d,v,y,p,m,I,_=0,A,R,k,x,U,K,P,j;const V=new Uint8Array(4);let N,B;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ye(r)||!r.output||!r.input&&r.avail_in!==0)return te;e=r.state,e.mode===se&&(e.mode=nt),u=r.next_out,s=r.output,w=r.avail_out,i=r.next_in,n=r.input,c=r.avail_in,l=e.hold,d=e.bits,v=c,y=w,j=we;e:for(;;)switch(e.mode){case We:if(e.wrap===0){e.mode=nt;break}for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.wrap&2&&l===35615){e.wbits===0&&(e.wbits=15),e.check=0,V[0]=l&255,V[1]=l>>>8&255,e.check=re(e.check,V,2,0),l=0,d=0,e.mode=Ht;break}if(e.head&&(e.head.done=!1),!(e.wrap&1)||(((l&255)<<8)+(l>>8))%31){r.msg="incorrect header check",e.mode=G;break}if((l&15)!==Zt){r.msg="unknown compression method",e.mode=G;break}if(l>>>=4,d-=4,P=(l&15)+8,e.wbits===0&&(e.wbits=P),P>15||P>e.wbits){r.msg="invalid window size",e.mode=G;break}e.dmax=1<<e.wbits,e.flags=0,r.adler=e.check=1,e.mode=l&512?nn:se,l=0,d=0;break;case Ht:for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.flags=l,(e.flags&255)!==Zt){r.msg="unknown compression method",e.mode=G;break}if(e.flags&57344){r.msg="unknown header flags set",e.mode=G;break}e.head&&(e.head.text=l>>8&1),e.flags&512&&e.wrap&4&&(V[0]=l&255,V[1]=l>>>8&255,e.check=re(e.check,V,2,0)),l=0,d=0,e.mode=Wt;case Wt:for(;d<32;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.head&&(e.head.time=l),e.flags&512&&e.wrap&4&&(V[0]=l&255,V[1]=l>>>8&255,V[2]=l>>>16&255,V[3]=l>>>24&255,e.check=re(e.check,V,4,0)),l=0,d=0,e.mode=Xt;case Xt:for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.head&&(e.head.xflags=l&255,e.head.os=l>>8),e.flags&512&&e.wrap&4&&(V[0]=l&255,V[1]=l>>>8&255,e.check=re(e.check,V,2,0)),l=0,d=0,e.mode=Yt;case Yt:if(e.flags&1024){for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.length=l,e.head&&(e.head.extra_len=l),e.flags&512&&e.wrap&4&&(V[0]=l&255,V[1]=l>>>8&255,e.check=re(e.check,V,2,0)),l=0,d=0}else e.head&&(e.head.extra=null);e.mode=Jt;case Jt:if(e.flags&1024&&(p=e.length,p>c&&(p=c),p&&(e.head&&(P=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(n.subarray(i,i+p),P)),e.flags&512&&e.wrap&4&&(e.check=re(e.check,n,p,i)),c-=p,i+=p,e.length-=p),e.length))break e;e.length=0,e.mode=Qt;case Qt:if(e.flags&2048){if(c===0)break e;p=0;do P=n[i+p++],e.head&&P&&e.length<65536&&(e.head.name+=String.fromCharCode(P));while(P&&p<c);if(e.flags&512&&e.wrap&4&&(e.check=re(e.check,n,p,i)),c-=p,i+=p,P)break e}else e.head&&(e.head.name=null);e.length=0,e.mode=en;case en:if(e.flags&4096){if(c===0)break e;p=0;do P=n[i+p++],e.head&&P&&e.length<65536&&(e.head.comment+=String.fromCharCode(P));while(P&&p<c);if(e.flags&512&&e.wrap&4&&(e.check=re(e.check,n,p,i)),c-=p,i+=p,P)break e}else e.head&&(e.head.comment=null);e.mode=tn;case tn:if(e.flags&512){for(;d<16;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.wrap&4&&l!==(e.check&65535)){r.msg="header crc mismatch",e.mode=G;break}l=0,d=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),r.adler=e.check=0,e.mode=se;break;case nn:for(;d<32;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}r.adler=e.check=yn(l),l=0,d=0,e.mode=qe;case qe:if(e.havedict===0)return r.next_out=u,r.avail_out=w,r.next_in=i,r.avail_in=c,e.hold=l,e.bits=d,ii;r.adler=e.check=1,e.mode=se;case se:if(t===ni||t===Ne)break e;case nt:if(e.last){l>>>=d&7,d-=d&7,e.mode=it;break}for(;d<3;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}switch(e.last=l&1,l>>>=1,d-=1,l&3){case 0:e.mode=rn;break;case 1:if(fi(e),e.mode=Me,t===Ne){l>>>=2,d-=2;break e}break;case 2:e.mode=on;break;case 3:r.msg="invalid block type",e.mode=G}l>>>=2,d-=2;break;case rn:for(l>>>=d&7,d-=d&7;d<32;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if((l&65535)!==(l>>>16^65535)){r.msg="invalid stored block lengths",e.mode=G;break}if(e.length=l&65535,l=0,d=0,e.mode=rt,t===Ne)break e;case rt:e.mode=sn;case sn:if(p=e.length,p){if(p>c&&(p=c),p>w&&(p=w),p===0)break e;s.set(n.subarray(i,i+p),u),c-=p,i+=p,w-=p,u+=p,e.length-=p;break}e.mode=se;break;case on:for(;d<14;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.nlen=(l&31)+257,l>>>=5,d-=5,e.ndist=(l&31)+1,l>>>=5,d-=5,e.ncode=(l&15)+4,l>>>=4,d-=4,e.nlen>286||e.ndist>30){r.msg="too many length or distance symbols",e.mode=G;break}e.have=0,e.mode=an;case an:for(;e.have<e.ncode;){for(;d<3;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.lens[O[e.have++]]=l&7,l>>>=3,d-=3}for(;e.have<19;)e.lens[O[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,N={bits:e.lenbits},j=Se(ti,e.lens,0,19,e.lencode,0,e.work,N),e.lenbits=N.bits,j){r.msg="invalid code lengths set",e.mode=G;break}e.have=0,e.mode=cn;case cn:for(;e.have<e.nlen+e.ndist;){for(;_=e.lencode[l&(1<<e.lenbits)-1],A=_>>>24,R=_>>>16&255,k=_&65535,!(A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(k<16)l>>>=A,d-=A,e.lens[e.have++]=k;else{if(k===16){for(B=A+2;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(l>>>=A,d-=A,e.have===0){r.msg="invalid bit length repeat",e.mode=G;break}P=e.lens[e.have-1],p=3+(l&3),l>>>=2,d-=2}else if(k===17){for(B=A+3;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}l>>>=A,d-=A,P=0,p=3+(l&7),l>>>=3,d-=3}else{for(B=A+7;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}l>>>=A,d-=A,P=0,p=11+(l&127),l>>>=7,d-=7}if(e.have+p>e.nlen+e.ndist){r.msg="invalid bit length repeat",e.mode=G;break}for(;p--;)e.lens[e.have++]=P}}if(e.mode===G)break;if(e.lens[256]===0){r.msg="invalid code -- missing end-of-block",e.mode=G;break}if(e.lenbits=9,N={bits:e.lenbits},j=Se(Dn,e.lens,0,e.nlen,e.lencode,0,e.work,N),e.lenbits=N.bits,j){r.msg="invalid literal/lengths set",e.mode=G;break}if(e.distbits=6,e.distcode=e.distdyn,N={bits:e.distbits},j=Se(Un,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,N),e.distbits=N.bits,j){r.msg="invalid distances set",e.mode=G;break}if(e.mode=Me,t===Ne)break e;case Me:e.mode=$e;case $e:if(c>=6&&w>=258){r.next_out=u,r.avail_out=w,r.next_in=i,r.avail_in=c,e.hold=l,e.bits=d,Wr(r,y),u=r.next_out,s=r.output,w=r.avail_out,i=r.next_in,n=r.input,c=r.avail_in,l=e.hold,d=e.bits,e.mode===se&&(e.back=-1);break}for(e.back=0;_=e.lencode[l&(1<<e.lenbits)-1],A=_>>>24,R=_>>>16&255,k=_&65535,!(A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(R&&(R&240)===0){for(x=A,U=R,K=k;_=e.lencode[K+((l&(1<<x+U)-1)>>x)],A=_>>>24,R=_>>>16&255,k=_&65535,!(x+A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}l>>>=x,d-=x,e.back+=x}if(l>>>=A,d-=A,e.back+=A,e.length=k,R===0){e.mode=hn;break}if(R&32){e.back=-1,e.mode=se;break}if(R&64){r.msg="invalid literal/length code",e.mode=G;break}e.extra=R&15,e.mode=un;case un:if(e.extra){for(B=e.extra;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.length+=l&(1<<e.extra)-1,l>>>=e.extra,d-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=ln;case ln:for(;_=e.distcode[l&(1<<e.distbits)-1],A=_>>>24,R=_>>>16&255,k=_&65535,!(A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if((R&240)===0){for(x=A,U=R,K=k;_=e.distcode[K+((l&(1<<x+U)-1)>>x)],A=_>>>24,R=_>>>16&255,k=_&65535,!(x+A<=d);){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}l>>>=x,d-=x,e.back+=x}if(l>>>=A,d-=A,e.back+=A,R&64){r.msg="invalid distance code",e.mode=G;break}e.offset=k,e.extra=R&15,e.mode=dn;case dn:if(e.extra){for(B=e.extra;d<B;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}e.offset+=l&(1<<e.extra)-1,l>>>=e.extra,d-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){r.msg="invalid distance too far back",e.mode=G;break}e.mode=fn;case fn:if(w===0)break e;if(p=y-w,e.offset>p){if(p=e.offset-p,p>e.whave&&e.sane){r.msg="invalid distance too far back",e.mode=G;break}p>e.wnext?(p-=e.wnext,m=e.wsize-p):m=e.wnext-p,p>e.length&&(p=e.length),I=e.window}else I=s,m=u-e.offset,p=e.length;p>w&&(p=w),w-=p,e.length-=p;do s[u++]=I[m++];while(--p);e.length===0&&(e.mode=$e);break;case hn:if(w===0)break e;s[u++]=e.length,w--,e.mode=$e;break;case it:if(e.wrap){for(;d<32;){if(c===0)break e;c--,l|=n[i++]<<d,d+=8}if(y-=w,r.total_out+=y,e.total+=y,e.wrap&4&&y&&(r.adler=e.check=e.flags?re(e.check,s,y,u-y):ht(e.check,s,y,u-y)),y=w,e.wrap&4&&(e.flags?l:yn(l))!==e.check){r.msg="incorrect data check",e.mode=G;break}l=0,d=0}e.mode=pn;case pn:if(e.wrap&&e.flags){for(;d<32;){if(c===0)break e;c--,l+=n[i++]<<d,d+=8}if(e.wrap&4&&l!==(e.total&4294967295)){r.msg="incorrect length check",e.mode=G;break}l=0,d=0}e.mode=wn;case wn:j=ri;break e;case G:j=Nn;break e;case $n:return Mn;case jn:default:return te}return r.next_out=u,r.avail_out=w,r.next_in=i,r.avail_in=c,e.hold=l,e.bits=d,(e.wsize||y!==r.avail_out&&e.mode<G&&(e.mode<it||t!==Gt))&&Kn(r,r.output,r.next_out,y-r.avail_out),v-=r.avail_in,y-=r.avail_out,r.total_in+=v,r.total_out+=y,e.total+=y,e.wrap&4&&y&&(r.adler=e.check=e.flags?re(e.check,s,y,r.next_out-y):ht(e.check,s,y,r.next_out-y)),r.data_type=e.bits+(e.last?64:0)+(e.mode===se?128:0)+(e.mode===Me||e.mode===rt?256:0),(v===0&&y===0||t===Gt)&&j===we&&(j=si),j},pi=r=>{if(ye(r))return te;let t=r.state;return t.window&&(t.window=null),r.state=null,we},wi=(r,t)=>{if(ye(r))return te;const e=r.state;return(e.wrap&2)===0?te:(e.head=t,t.done=!1,we)},yi=(r,t)=>{const e=t.length;let n,s,i;return ye(r)||(n=r.state,n.wrap!==0&&n.mode!==qe)?te:n.mode===qe&&(s=1,s=ht(s,t,e,0),s!==n.check)?Nn:(i=Kn(r,t,e,e),i?(n.mode=$n,Mn):(n.havedict=1,we))};var gi=Fn,mi=zn,bi=Vn,vi=di,_i=qn,Ei=hi,Ai=pi,xi=wi,ki=yi,Si="pako inflate (from Nodeca project)",oe={inflateReset:gi,inflateReset2:mi,inflateResetKeep:bi,inflateInit:vi,inflateInit2:_i,inflate:Ei,inflateEnd:Ai,inflateGetHeader:xi,inflateSetDictionary:ki,inflateInfo:Si};function Ii(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Li=Ii;const Gn=Object.prototype.toString,{Z_NO_FLUSH:Ti,Z_FINISH:Ci,Z_OK:Te,Z_STREAM_END:at,Z_NEED_DICT:ct,Z_STREAM_ERROR:Oi,Z_DATA_ERROR:mn,Z_MEM_ERROR:Ri}=Rn;function Xe(r){this.options=Pn.assign({chunkSize:1024*64,windowBits:15,to:""},r||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(r&&r.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15)===0&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Zr,this.strm.avail_out=0;let e=oe.inflateInit2(this.strm,t.windowBits);if(e!==Te)throw new Error(pt[e]);if(this.header=new Li,oe.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wt.string2buf(t.dictionary):Gn.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=oe.inflateSetDictionary(this.strm,t.dictionary),e!==Te)))throw new Error(pt[e])}Xe.prototype.push=function(r,t){const e=this.strm,n=this.options.chunkSize,s=this.options.dictionary;let i,u,c;if(this.ended)return!1;for(t===~~t?u=t:u=t===!0?Ci:Ti,Gn.call(r)==="[object ArrayBuffer]"?e.input=new Uint8Array(r):e.input=r,e.next_in=0,e.avail_in=e.input.length;;){for(e.avail_out===0&&(e.output=new Uint8Array(n),e.next_out=0,e.avail_out=n),i=oe.inflate(e,u),i===ct&&s&&(i=oe.inflateSetDictionary(e,s),i===Te?i=oe.inflate(e,u):i===mn&&(i=ct));e.avail_in>0&&i===at&&e.state.wrap>0&&r[e.next_in]!==0;)oe.inflateReset(e),i=oe.inflate(e,u);switch(i){case Oi:case mn:case ct:case Ri:return this.onEnd(i),this.ended=!0,!1}if(c=e.avail_out,e.next_out&&(e.avail_out===0||i===at))if(this.options.to==="string"){let w=wt.utf8border(e.output,e.next_out),l=e.next_out-w,d=wt.buf2string(e.output,w);e.next_out=l,e.avail_out=n-l,l&&e.output.set(e.output.subarray(w,w+l),0),this.onData(d)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(!(i===Te&&c===0)){if(i===at)return i=oe.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(e.avail_in===0)break}}return!0};Xe.prototype.onData=function(r){this.chunks.push(r)};Xe.prototype.onEnd=function(r){r===Te&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Pn.flattenChunks(this.chunks)),this.chunks=[],this.err=r,this.msg=this.strm.msg};function Pi(r,t){const e=new Xe(t);if(e.push(r),e.err)throw e.msg||pt[e.err];return e.result}var Bi=Pi,Di={inflate:Bi};const{inflate:Ui}=Di;var Ni=Ui,ut={exports:{}},bn;function Mi(){return bn||(bn=1,(function(r){var t=Object.prototype.hasOwnProperty,e="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(e=!1));function s(w,l,d){this.fn=w,this.context=l,this.once=d||!1}function i(w,l,d,v,y){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,v||w,y),m=e?e+l:l;return w._events[m]?w._events[m].fn?w._events[m]=[w._events[m],p]:w._events[m].push(p):(w._events[m]=p,w._eventsCount++),w}function u(w,l){--w._eventsCount===0?w._events=new n:delete w._events[l]}function c(){this._events=new n,this._eventsCount=0}c.prototype.eventNames=function(){var l=[],d,v;if(this._eventsCount===0)return l;for(v in d=this._events)t.call(d,v)&&l.push(e?v.slice(1):v);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},c.prototype.listeners=function(l){var d=e?e+l:l,v=this._events[d];if(!v)return[];if(v.fn)return[v.fn];for(var y=0,p=v.length,m=new Array(p);y<p;y++)m[y]=v[y].fn;return m},c.prototype.listenerCount=function(l){var d=e?e+l:l,v=this._events[d];return v?v.fn?1:v.length:0},c.prototype.emit=function(l,d,v,y,p,m){var I=e?e+l:l;if(!this._events[I])return!1;var _=this._events[I],A=arguments.length,R,k;if(_.fn){switch(_.once&&this.removeListener(l,_.fn,void 0,!0),A){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,d),!0;case 3:return _.fn.call(_.context,d,v),!0;case 4:return _.fn.call(_.context,d,v,y),!0;case 5:return _.fn.call(_.context,d,v,y,p),!0;case 6:return _.fn.call(_.context,d,v,y,p,m),!0}for(k=1,R=new Array(A-1);k<A;k++)R[k-1]=arguments[k];_.fn.apply(_.context,R)}else{var x=_.length,U;for(k=0;k<x;k++)switch(_[k].once&&this.removeListener(l,_[k].fn,void 0,!0),A){case 1:_[k].fn.call(_[k].context);break;case 2:_[k].fn.call(_[k].context,d);break;case 3:_[k].fn.call(_[k].context,d,v);break;case 4:_[k].fn.call(_[k].context,d,v,y);break;default:if(!R)for(U=1,R=new Array(A-1);U<A;U++)R[U-1]=arguments[U];_[k].fn.apply(_[k].context,R)}}return!0},c.prototype.on=function(l,d,v){return i(this,l,d,v,!1)},c.prototype.once=function(l,d,v){return i(this,l,d,v,!0)},c.prototype.removeListener=function(l,d,v,y){var p=e?e+l:l;if(!this._events[p])return this;if(!d)return u(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!y||m.once)&&(!v||m.context===v)&&u(this,p);else{for(var I=0,_=[],A=m.length;I<A;I++)(m[I].fn!==d||y&&!m[I].once||v&&m[I].context!==v)&&_.push(m[I]);_.length?this._events[p]=_.length===1?_[0]:_:u(this,p)}return this},c.prototype.removeAllListeners=function(l){var d;return l?(d=e?e+l:l,this._events[d]&&u(this,d)):(this._events=new n,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=e,c.EventEmitter=c,r.exports=c})(ut)),ut.exports}var $i=Mi();const ji=F.getDefaultExportFromCjs($i);function Vi(r,t){return Array.apply(0,new Array(Math.ceil(r.length/t))).map((e,n)=>r.slice(n*t,(n+1)*t))}const xe=r=>"version"in r;function Fi(r){return r.reduce((t,e)=>t+e.toString(16).padStart(2,"0"),"0x")}function zi(r){r.indexOf("0x")===0&&(r=r.substr(2)),r.length%2===1&&(r="0"+r);let t=r.match(/.{2}/g);return t===null?$.Buffer$1.from([]):$.Buffer$1.from(t.map(e=>parseInt(e,16)))}var qi=Object.freeze({__proto__:null,encode:Fi,decode:zi});function Zn(r){return new TextDecoder("utf-8").decode(r)}function Hn(r){return new TextEncoder().encode(r)}var Ki=Object.freeze({__proto__:null,decode:Zn,encode:Hn});function yt(r){return F.bs58.encode(r)}function Gi(r){return F.bs58.decode(r)}var Zi=Object.freeze({__proto__:null,encode:yt,decode:Gi});function gt(r){return r.toString("base64")}function St(r){return $.Buffer$1.from(r,"base64")}var Hi=Object.freeze({__proto__:null,encode:gt,decode:St}),Wi=Object.freeze({__proto__:null,hex:qi,utf8:Ki,bs58:Zi,base64:Hi});function Wn(r){const t=new Map;return r.errors&&r.errors.forEach(e=>{var n;let s=(n=e.msg)!==null&&n!==void 0?n:e.name;t.set(e.code,s)}),t}function Xi(r,...t){if(r.args.length!=t.length)throw new Error("Invalid argument length");const e={};let n=0;return r.args.forEach(s=>{e[s.name]=t[n],n+=1}),e}function Xn(r,t={}){r.forEach(e=>{if("accounts"in e)Xn(e.accounts,t[e.name]);else if(t[e.name]===void 0)throw new Error(`Invalid arguments: ${e.name} not provided.`)})}function Q(r){return r instanceof F.PublicKey?r:new F.PublicKey(r)}class Yi extends TypeError{constructor(t,e){let n;const{message:s,...i}=t,{path:u}=t,c=u.length===0?s:"At path: "+u.join(".")+" -- "+s;super(c),this.value=void 0,this.key=void 0,this.type=void 0,this.refinement=void 0,this.path=void 0,this.branch=void 0,this.failures=void 0,Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var w;return(w=n)!=null?w:n=[t,...e()]}}}function Ji(r){return be(r)&&typeof r[Symbol.iterator]=="function"}function be(r){return typeof r=="object"&&r!=null}function le(r){return typeof r=="string"?JSON.stringify(r):""+r}function Qi(r){const{done:t,value:e}=r.next();return t?void 0:e}function es(r,t,e,n){if(r===!0)return;r===!1?r={}:typeof r=="string"&&(r={message:r});const{path:s,branch:i}=t,{type:u}=e,{refinement:c,message:w="Expected a value of type `"+u+"`"+(c?" with refinement `"+c+"`":"")+", but received: `"+le(n)+"`"}=r;return{value:n,type:u,refinement:c,key:s[s.length-1],path:s,branch:i,...r,message:w}}function*vn(r,t,e,n){Ji(r)||(r=[r]);for(const s of r){const i=es(s,t,e,n);i&&(yield i)}}function*It(r,t,e){e===void 0&&(e={});const{path:n=[],branch:s=[r],coerce:i=!1,mask:u=!1}=e,c={path:n,branch:s};if(i&&(r=t.coercer(r,c),u&&t.type!=="type"&&be(t.schema)&&be(r)&&!Array.isArray(r)))for(const l in r)t.schema[l]===void 0&&delete r[l];let w=!0;for(const l of t.validator(r,c))w=!1,yield[l,void 0];for(let[l,d,v]of t.entries(r,c)){const y=It(d,v,{path:l===void 0?n:[...n,l],branch:l===void 0?s:[...s,d],coerce:i,mask:u});for(const p of y)p[0]?(w=!1,yield[p[0],void 0]):i&&(d=p[1],l===void 0?r=d:r instanceof Map?r.set(l,d):r instanceof Set?r.add(d):be(r)&&(r[l]=d))}if(w)for(const l of t.refiner(r,c))w=!1,yield[l,void 0];w&&(yield[void 0,r])}class de{constructor(t){this.TYPE=void 0,this.type=void 0,this.schema=void 0,this.coercer=void 0,this.validator=void 0,this.refiner=void 0,this.entries=void 0;const{type:e,schema:n,validator:s,refiner:i,coercer:u=w=>w,entries:c=function*(){}}=t;this.type=e,this.schema=n,this.entries=c,this.coercer=u,s?this.validator=(w,l)=>{const d=s(w,l);return vn(d,l,this,w)}:this.validator=()=>[],i?this.refiner=(w,l)=>{const d=i(w,l);return vn(d,l,this,w)}:this.refiner=()=>[]}assert(t){return ts(t,this)}create(t){return Lt(t,this)}is(t){return Yn(t,this)}mask(t){return ns(t,this)}validate(t,e){return e===void 0&&(e={}),Oe(t,this,e)}}function ts(r,t){const e=Oe(r,t);if(e[0])throw e[0]}function Lt(r,t){const e=Oe(r,t,{coerce:!0});if(e[0])throw e[0];return e[1]}function ns(r,t){const e=Oe(r,t,{coerce:!0,mask:!0});if(e[0])throw e[0];return e[1]}function Yn(r,t){return!Oe(r,t)[0]}function Oe(r,t,e){e===void 0&&(e={});const n=It(r,t,e),s=Qi(n);return s[0]?[new Yi(s[0],function*(){for(const u of n)u[0]&&(yield u[0])}),void 0]:[void 0,s[1]]}function Re(r,t){return new de({type:r,schema:null,validator:t})}function rs(){return Re("any",()=>!0)}function lt(r){return new de({type:"array",schema:r,*entries(t){if(r&&Array.isArray(t))for(const[e,n]of t.entries())yield[e,n,r]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||"Expected an array value, but received: "+le(t)}})}function is(){return Re("boolean",r=>typeof r=="boolean")}function _n(r){const t=le(r);return new de({type:"literal",schema:r,validator(e){return e===r||"Expected the literal `"+t+"`, but received: "+le(e)}})}function je(r){return new de({...r,validator:(t,e)=>t===null||r.validator(t,e),refiner:(t,e)=>t===null||r.refiner(t,e)})}function Fe(){return Re("number",r=>typeof r=="number"&&!isNaN(r)||"Expected a number, but received: "+le(r))}function ze(r){return new de({...r,validator:(t,e)=>t===void 0||r.validator(t,e),refiner:(t,e)=>t===void 0||r.refiner(t,e)})}function fe(){return Re("string",r=>typeof r=="string"||"Expected a string, but received: "+le(r))}function ue(r){const t=Object.keys(r);return new de({type:"type",schema:r,*entries(e){if(be(e))for(const n of t)yield[n,e[n],r[n]]},validator(e){return be(e)||"Expected an object, but received: "+le(e)}})}function Jn(r){const t=r.map(e=>e.type).join(" | ");return new de({type:"union",schema:null,coercer(e,n){return(r.find(i=>{const[u]=i.validate(e,{coerce:!0});return!u})||Tt()).coercer(e,n)},validator(e,n){const s=[];for(const i of r){const[...u]=It(e,i,n),[c]=u;if(c[0])for(const[w]of u)w&&s.push(w);else return[]}return["Expected the value to satisfy a union of `"+t+"`, but received: "+le(e),...s]}})}function Tt(){return Re("unknown",()=>!0)}function ss(r,t,e){return new de({...r,coercer:(n,s)=>Yn(n,t)?r.coercer(e(n,s),s):r.coercer(n,s)})}async function os(r,t,e,n){r=Q(r),n||(n=Ke());const s=new F.Transaction$1;if(s.add(new F.TransactionInstruction({programId:r,keys:t??[],data:e})),n.sendAndConfirm===void 0)throw new Error("This function requires 'Provider.sendAndConfirm' to be implemented.");return await n.sendAndConfirm(s,[])}const En=99;async function as(r,t,e){return(await Ct(r,t,e)).map(s=>s?{publicKey:s.publicKey,account:s.account}:null)}async function Ct(r,t,e){if(t.length<=En)return await An(r,t,e);{const n=Vi(t,En);return(await Promise.all(n.map(i=>An(r,i,e)))).flat()}}async function An(r,t,e){const n=e??r.commitment,{value:s,context:i}=await r.getMultipleAccountsInfoAndContext(t,n);return s.map((c,w)=>c===null?null:{publicKey:t[w],account:c,context:i})}async function Qn(r,t,e,n,s){var i;e&&e.length>0&&t.sign(...e);const u=t._compile(),c=u.serialize(),l=t._serialize(c).toString("base64"),d={encoding:"base64",commitment:n??r.commitment};if(s){const m=(Array.isArray(s)?s:u.nonProgramIds()).map(I=>I.toBase58());d.accounts={encoding:"base64",addresses:m}}e&&(d.sigVerify=!0);const v=[l,d],y=await r._rpcRequest("simulateTransaction",v),p=Lt(y,ds);if("error"in p){let m;if("data"in p.error&&(m=(i=p.error.data)===null||i===void 0?void 0:i.logs,m&&Array.isArray(m))){const I=`
2
2
  `,_=I+m.join(I);console.error(p.error.message,_)}throw new F.SendTransactionError("failed to simulate transaction: "+p.error.message,m)}return p.result}function cs(r){return ss(er(r),us,t=>"error"in t?t:{...t,result:Lt(t.result,r)})}const us=er(Tt());function er(r){return Jn([ue({jsonrpc:_n("2.0"),id:fe(),result:r}),ue({jsonrpc:_n("2.0"),id:fe(),error:ue({code:Tt(),message:fe(),data:ze(rs())})})])}function ls(r){return cs(ue({context:ue({slot:Fe()}),value:r}))}const ds=ls(ue({err:je(Jn([ue({}),fe()])),logs:je(lt(fe())),accounts:ze(je(lt(je(ue({executable:is(),owner:fe(),lamports:Fe(),data:lt(fe()),rentEpoch:ze(Fe())}))))),unitsConsumed:ze(Fe())}));var fs=Object.freeze({__proto__:null,invoke:os,getMultipleAccounts:as,getMultipleAccountsAndContext:Ct,simulateTransaction:Qn});class hs{constructor(t,e,n){this.connection=t,this.wallet=e,this.opts=n,this.publicKey=e?.publicKey}static defaultOptions(){return{preflightCommitment:"processed",commitment:"processed"}}static local(t,e){throw new Error("Provider local is not available on browser.")}static env(){throw new Error("Provider env is not available on browser.")}async sendAndConfirm(t,e,n){var s,i,u,c;if(n===void 0&&(n=this.opts),xe(t))e&&t.sign(e);else if(t.feePayer=(s=t.feePayer)!==null&&s!==void 0?s:this.wallet.publicKey,t.recentBlockhash=(await this.connection.getLatestBlockhash(n.preflightCommitment)).blockhash,e)for(const l of e)t.partialSign(l);t=await this.wallet.signTransaction(t);const w=t.serialize();try{return await xn(this.connection,w,n)}catch(l){if(l instanceof mt){const d=yt(xe(t)?((i=t.signatures)===null||i===void 0?void 0:i[0])||new Uint8Array:(u=t.signature)!==null&&u!==void 0?u:new Uint8Array),v=await this.connection.getTransaction(d,{commitment:"confirmed"});if(v){const y=(c=v.meta)===null||c===void 0?void 0:c.logMessages;throw y?new F.SendTransactionError(l.message,y):l}else throw l}else throw l}}async sendAll(t,e){var n,s,i;e===void 0&&(e=this.opts);const u=(await this.connection.getLatestBlockhash(e.preflightCommitment)).blockhash;let c=t.map(d=>{var v,y;if(xe(d.tx)){let p=d.tx;return d.signers&&p.sign(d.signers),p}else{let p=d.tx,m=(v=d.signers)!==null&&v!==void 0?v:[];return p.feePayer=(y=p.feePayer)!==null&&y!==void 0?y:this.wallet.publicKey,p.recentBlockhash=u,m.forEach(I=>{p.partialSign(I)}),p}});const w=await this.wallet.signAllTransactions(c),l=[];for(let d=0;d<c.length;d+=1){const v=w[d],y=v.serialize();try{l.push(await xn(this.connection,y,e))}catch(p){if(p instanceof mt){const m=yt(xe(v)?((n=v.signatures)===null||n===void 0?void 0:n[0])||new Uint8Array:(s=v.signature)!==null&&s!==void 0?s:new Uint8Array),I=await this.connection.getTransaction(m,{commitment:"confirmed"});if(I){const _=(i=I.meta)===null||i===void 0?void 0:i.logMessages;throw _?new F.SendTransactionError(p.message,_):p}else throw p}else throw p}}return l}async simulate(t,e,n,s){let i=(await this.connection.getLatestBlockhash(n??this.connection.commitment)).blockhash,u;if(xe(t)?(e&&(t.sign(e),t=await this.wallet.signTransaction(t)),u=await this.connection.simulateTransaction(t,{commitment:n})):(t.feePayer=t.feePayer||this.wallet.publicKey,t.recentBlockhash=i,e&&(t=await this.wallet.signTransaction(t)),u=await Qn(this.connection,t,e,n,s)),u.value.err)throw new ps(u.value);return u.value}}class ps extends Error{constructor(t,e){super(e),this.simulationResponse=t}}async function xn(r,t,e){const n=e&&{skipPreflight:e.skipPreflight,preflightCommitment:e.preflightCommitment||e.commitment},s=await r.sendRawTransaction(t,n),i=(await r.confirmTransaction(s,e&&e.commitment)).value;if(i.err)throw new mt(`Raw transaction ${s} failed (${JSON.stringify(i)})`);return s}class mt extends Error{constructor(t){super(t)}}function Ke(){return hs.local()}const ws=new Set(["anchor-deprecated-state","debug-logs"]),tr=new Map;function ys(r){if(!ws.has(r))throw new Error("Invalid feature");tr.set(r,!0)}function Ot(r){return tr.get(r)!==void 0}var gs=Object.freeze({__proto__:null,set:ys,isSet:Ot});class Ge extends Error{constructor(t){super(t),this.name="IdlError"}}class Pe{constructor(t){this.stack=t}static parse(t){var e;const n=/^Program (\w*) invoke/,s=/^Program \w* success/,i=[];for(let u=0;u<t.length;u++){if(s.exec(t[u])){i.pop();continue}const c=(e=n.exec(t[u]))===null||e===void 0?void 0:e[1];c&&i.push(new F.PublicKey(c))}return new Pe(i)}}class Ie extends Error{constructor(t,e,n,s,i,u){super(n.join(`
3
3
  `).replace("Program log: ","")),this.errorLogs=n,this.logs=s,this.error={errorCode:t,errorMessage:e,comparedValues:u,origin:i},this._programErrorStack=Pe.parse(s)}static parse(t){if(!t)return null;const e=t.findIndex(y=>y.startsWith("Program log: AnchorError"));if(e===-1)return null;const n=t[e],s=[n];let i;if(e+1<t.length){if(t[e+1]==="Program log: Left:"){const y=/^Program log: (.*)$/,p=y.exec(t[e+2])[1],m=y.exec(t[e+4])[1];i=[new F.PublicKey(p),new F.PublicKey(m)],s.push(...t.slice(e+1,e+5))}else if(t[e+1].startsWith("Program log: Left:")){const y=/^Program log: (Left|Right): (.*)$/,p=y.exec(t[e+1])[2],m=y.exec(t[e+2])[2];s.push(...t.slice(e+1,e+3)),i=[p,m]}}const c=/^Program log: AnchorError occurred\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(n),l=/^Program log: AnchorError thrown in (.*):(\d*)\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(n),v=/^Program log: AnchorError caused by account: (.*)\. Error Code: (.*)\. Error Number: (\d*)\. Error Message: (.*)\./.exec(n);if(c){const[y,p,m]=c.slice(1,4),I={code:y,number:parseInt(p)};return new Ie(I,m,s,t,void 0,i)}else if(l){const[y,p,m,I,_]=l.slice(1,6),A={code:m,number:parseInt(I)},R={file:y,line:parseInt(p)};return new Ie(A,_,s,t,R,i)}else if(v){const[y,p,m,I]=v.slice(1,5),_=y,A={code:p,number:parseInt(m)};return new Ie(A,I,s,t,_,i)}else return null}get program(){return this._programErrorStack.stack[this._programErrorStack.stack.length-1]}get programErrorStack(){return this._programErrorStack.stack}toString(){return this.message}}class Ze extends Error{constructor(t,e,n){super(),this.code=t,this.msg=e,this.logs=n,n&&(this._programErrorStack=Pe.parse(n))}static parse(t,e){const n=t.toString();let s;if(n.includes("custom program error:")){let c=n.split("custom program error: ");if(c.length!==2)return null;s=c[1]}else{const c=n.match(/"Custom":([0-9]+)}/g);if(!c||c.length>1)return null;s=c[0].match(/([0-9]+)/g)[0]}let i;try{i=parseInt(s)}catch{return null}let u=e.get(i);return u!==void 0?new Ze(i,u,t.logs):(u=ms.get(i),u!==void 0?new Ze(i,u,t.logs):null)}get program(){var t;return(t=this._programErrorStack)===null||t===void 0?void 0:t.stack[this._programErrorStack.stack.length-1]}get programErrorStack(){var t;return(t=this._programErrorStack)===null||t===void 0?void 0:t.stack}toString(){return this.msg}}function Rt(r,t){Ot("debug-logs")&&console.log("Translating error:",r);const e=Ie.parse(r.logs);if(e)return e;const n=Ze.parse(r,t);if(n)return n;if(r.logs){const s={get:function(i,u){return u==="programErrorStack"?i.programErrorStack.stack:u==="program"?i.programErrorStack.stack[r.programErrorStack.stack.length-1]:Reflect.get(...arguments)}};return r.programErrorStack=Pe.parse(r.logs),new Proxy(r,s)}return r}const D={InstructionMissing:100,InstructionFallbackNotFound:101,InstructionDidNotDeserialize:102,InstructionDidNotSerialize:103,IdlInstructionStub:1e3,IdlInstructionInvalidProgram:1001,ConstraintMut:2e3,ConstraintHasOne:2001,ConstraintSigner:2002,ConstraintRaw:2003,ConstraintOwner:2004,ConstraintRentExempt:2005,ConstraintSeeds:2006,ConstraintExecutable:2007,ConstraintState:2008,ConstraintAssociated:2009,ConstraintAssociatedInit:2010,ConstraintClose:2011,ConstraintAddress:2012,ConstraintZero:2013,ConstraintTokenMint:2014,ConstraintTokenOwner:2015,ConstraintMintMintAuthority:2016,ConstraintMintFreezeAuthority:2017,ConstraintMintDecimals:2018,ConstraintSpace:2019,ConstraintAccountIsNone:2020,RequireViolated:2500,RequireEqViolated:2501,RequireKeysEqViolated:2502,RequireNeqViolated:2503,RequireKeysNeqViolated:2504,RequireGtViolated:2505,RequireGteViolated:2506,AccountDiscriminatorAlreadySet:3e3,AccountDiscriminatorNotFound:3001,AccountDiscriminatorMismatch:3002,AccountDidNotDeserialize:3003,AccountDidNotSerialize:3004,AccountNotEnoughKeys:3005,AccountNotMutable:3006,AccountOwnedByWrongProgram:3007,InvalidProgramId:3008,InvalidProgramExecutable:3009,AccountNotSigner:3010,AccountNotSystemOwned:3011,AccountNotInitialized:3012,AccountNotProgramData:3013,AccountNotAssociatedTokenAccount:3014,AccountSysvarMismatch:3015,AccountReallocExceedsLimit:3016,AccountDuplicateReallocs:3017,DeclaredProgramIdMismatch:4100,Deprecated:5e3},ms=new Map([[D.InstructionMissing,"8 byte instruction identifier not provided"],[D.InstructionFallbackNotFound,"Fallback functions are not supported"],[D.InstructionDidNotDeserialize,"The program could not deserialize the given instruction"],[D.InstructionDidNotSerialize,"The program could not serialize the given instruction"],[D.IdlInstructionStub,"The program was compiled without idl instructions"],[D.IdlInstructionInvalidProgram,"The transaction was given an invalid program for the IDL instruction"],[D.ConstraintMut,"A mut constraint was violated"],[D.ConstraintHasOne,"A has one constraint was violated"],[D.ConstraintSigner,"A signer constraint was violated"],[D.ConstraintRaw,"A raw constraint was violated"],[D.ConstraintOwner,"An owner constraint was violated"],[D.ConstraintRentExempt,"A rent exemption constraint was violated"],[D.ConstraintSeeds,"A seeds constraint was violated"],[D.ConstraintExecutable,"An executable constraint was violated"],[D.ConstraintState,"Deprecated Error, feel free to replace with something else"],[D.ConstraintAssociated,"An associated constraint was violated"],[D.ConstraintAssociatedInit,"An associated init constraint was violated"],[D.ConstraintClose,"A close constraint was violated"],[D.ConstraintAddress,"An address constraint was violated"],[D.ConstraintZero,"Expected zero account discriminant"],[D.ConstraintTokenMint,"A token mint constraint was violated"],[D.ConstraintTokenOwner,"A token owner constraint was violated"],[D.ConstraintMintMintAuthority,"A mint mint authority constraint was violated"],[D.ConstraintMintFreezeAuthority,"A mint freeze authority constraint was violated"],[D.ConstraintMintDecimals,"A mint decimals constraint was violated"],[D.ConstraintSpace,"A space constraint was violated"],[D.ConstraintAccountIsNone,"A required account for the constraint is None"],[D.RequireViolated,"A require expression was violated"],[D.RequireEqViolated,"A require_eq expression was violated"],[D.RequireKeysEqViolated,"A require_keys_eq expression was violated"],[D.RequireNeqViolated,"A require_neq expression was violated"],[D.RequireKeysNeqViolated,"A require_keys_neq expression was violated"],[D.RequireGtViolated,"A require_gt expression was violated"],[D.RequireGteViolated,"A require_gte expression was violated"],[D.AccountDiscriminatorAlreadySet,"The account discriminator was already set on this account"],[D.AccountDiscriminatorNotFound,"No 8 byte discriminator was found on the account"],[D.AccountDiscriminatorMismatch,"8 byte discriminator did not match what was expected"],[D.AccountDidNotDeserialize,"Failed to deserialize the account"],[D.AccountDidNotSerialize,"Failed to serialize the account"],[D.AccountNotEnoughKeys,"Not enough account keys given to the instruction"],[D.AccountNotMutable,"The given account is not mutable"],[D.AccountOwnedByWrongProgram,"The given account is owned by a different program than expected"],[D.InvalidProgramId,"Program ID was not as expected"],[D.InvalidProgramExecutable,"Program account is not executable"],[D.AccountNotSigner,"The given account did not sign"],[D.AccountNotSystemOwned,"The given account is not owned by the system program"],[D.AccountNotInitialized,"The program expected this account to be already initialized"],[D.AccountNotProgramData,"The given account is not a program data account"],[D.AccountNotAssociatedTokenAccount,"The given account is not the associated token account"],[D.AccountSysvarMismatch,"The given public key does not match the required sysvar"],[D.AccountReallocExceedsLimit,"The account reallocation exceeds the MAX_PERMITTED_DATA_INCREASE limit"],[D.AccountDuplicateReallocs,"The account was duplicated for more than one reallocation"],[D.DeclaredProgramIdMismatch,"The declared program id does not match the actual program id"],[D.Deprecated,"The API being used is deprecated and should no longer be used"]]);var bt=function(){return bt=Object.assign||function(t){for(var e,n=1,s=arguments.length;n<s;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},bt.apply(this,arguments)},vt=function(){return vt=Object.assign||function(t){for(var e,n=1,s=arguments.length;n<s;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},vt.apply(this,arguments)};function bs(r){return r.toLowerCase()}var vs=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],_s=/[^A-Z0-9]+/gi;function Es(r,t){t===void 0&&(t={});for(var e=t.splitRegexp,n=e===void 0?vs:e,s=t.stripRegexp,i=s===void 0?_s:s,u=t.transform,c=u===void 0?bs:u,w=t.delimiter,l=w===void 0?" ":w,d=kn(kn(r,n,"$1\0$2"),i,"\0"),v=0,y=d.length;d.charAt(v)==="\0";)v++;for(;d.charAt(y-1)==="\0";)y--;return d.slice(v,y).split("\0").map(c).join(l)}function kn(r,t,e){return t instanceof RegExp?r.replace(t,e):t.reduce(function(n,s){return n.replace(s,e)},r)}function As(r,t){return t===void 0&&(t={}),Es(r,vt({delimiter:"."},t))}function xs(r,t){return t===void 0&&(t={}),As(r,bt({delimiter:"_"},t))}class Y{static fieldLayout(t,e){const n=t.name!==void 0?Z(t.name):void 0;switch(t.type){case"bool":return M.bool(n);case"u8":return M.u8(n);case"i8":return M.i8(n);case"u16":return M.u16(n);case"i16":return M.i16(n);case"u32":return M.u32(n);case"i32":return M.i32(n);case"f32":return M.f32(n);case"u64":return M.u64(n);case"i64":return M.i64(n);case"f64":return M.f64(n);case"u128":return M.u128(n);case"i128":return M.i128(n);case"u256":return M.u256(n);case"i256":return M.i256(n);case"bytes":return M.vecU8(n);case"string":return M.str(n);case"publicKey":return M.publicKey(n);default:{if("vec"in t.type)return M.vec(Y.fieldLayout({name:void 0,type:t.type.vec},e),n);if("option"in t.type)return M.option(Y.fieldLayout({name:void 0,type:t.type.option},e),n);if("defined"in t.type){if(!e)throw new Ge("User defined types not provided");const s=t.type.defined,i=e.filter(u=>u.name===s);if(i.length!==1)throw new Ge(`Type not found: ${JSON.stringify(t)}`);return Y.typeDefLayout(i[0],e,n)}else if("array"in t.type){let s=t.type.array[0],i=t.type.array[1],u=Y.fieldLayout({name:void 0,type:s},e);return M.array(u,i,n)}else throw new Error(`Not yet implemented: ${t}`)}}}static typeDefLayout(t,e=[],n){switch(t.type.kind){case"struct":{const s=t.type.fields.map(i=>Y.fieldLayout(i,e));return M.struct(s,n)}case"enum":{let s=t.type.variants.map(i=>{const u=Z(i.name);if(!i.fields)return M.struct([],u);const c=i.fields.map((w,l)=>w?.name?Y.fieldLayout(w,e):Y.fieldLayout({type:w,name:l.toString()},e));return M.struct(c,u)});return n!==void 0?M.rustEnum(s).replicate(n):M.rustEnum(s,n)}case"alias":return Y.fieldLayout({type:t.type.value,name:t.name},e)}}}const Sn="global";class Pt{constructor(t){this.idl=t,this.ixLayout=Pt.parseIxLayout(t);const e=new Map;t.instructions.forEach(n=>{const s=In(Sn,n.name);e.set(F.bs58.encode(s),{layout:this.ixLayout.get(n.name),name:n.name})}),this.sighashLayouts=e}encode(t,e){return this._encode(Sn,t,e)}_encode(t,e,n){const s=$.Buffer$1.alloc(1e3),i=Z(e),u=this.ixLayout.get(i);if(!u)throw new Error(`Unknown method: ${i}`);const c=u.encode(n,s),w=s.slice(0,c);return $.Buffer$1.concat([In(t,e),w])}static parseIxLayout(t){const e=t.instructions.map(n=>{let s=n.args.map(u=>{var c,w;return Y.fieldLayout(u,Array.from([...(c=t.accounts)!==null&&c!==void 0?c:[],...(w=t.types)!==null&&w!==void 0?w:[]]))});const i=Z(n.name);return[i,M.struct(s,i)]});return new Map(e)}decode(t,e="hex"){typeof t=="string"&&(t=e==="hex"?$.Buffer$1.from(t,"hex"):F.bs58.decode(t));let n=F.bs58.encode(t.slice(0,8)),s=t.slice(8);const i=this.sighashLayouts.get(n);return i?{data:i.layout.decode(s),name:i.name}:null}format(t,e){return ie.format(t,e,this.idl)}}class ie{static format(t,e,n){const s=n.instructions.filter(w=>t.name===w.name)[0];if(s===void 0)return console.error("Invalid instruction given"),null;const i=s.args.map(w=>({name:w.name,type:ie.formatIdlType(w.type),data:ie.formatIdlData(w,t.data[w.name],n.types)})),u=ie.flattenIdlAccounts(s.accounts),c=e.map((w,l)=>l<u.length?{name:u[l].name,...w}:{name:void 0,...w});return{args:i,accounts:c}}static formatIdlType(t){if(typeof t=="string")return t;if("vec"in t)return`Vec<${this.formatIdlType(t.vec)}>`;if("option"in t)return`Option<${this.formatIdlType(t.option)}>`;if("defined"in t)return t.defined;if("array"in t)return`Array<${t.array[0]}; ${t.array[1]}>`;throw new Error(`Unknown IDL type: ${t}`)}static formatIdlData(t,e,n){if(typeof t.type=="string")return e.toString();if(t.type.hasOwnProperty("vec"))return"["+e.map(s=>this.formatIdlData({name:"",type:t.type.vec},s)).join(", ")+"]";if(t.type.hasOwnProperty("option"))return e===null?"null":this.formatIdlData({name:"",type:t.type.option},e,n);if(t.type.hasOwnProperty("defined")){if(n===void 0)throw new Error("User defined types not provided");const s=n.filter(i=>i.name===t.type.defined);if(s.length!==1)throw new Error(`Type not found: ${t.type.defined}`);return ie.formatIdlDataDefined(s[0],e,n)}return"unknown"}static formatIdlDataDefined(t,e,n){switch(t.type.kind){case"struct":{const s=t.type;return"{ "+Object.keys(e).map(u=>{const c=s.fields.find(w=>w.name===u);if(!c)throw new Error("Unable to find type");return u+": "+ie.formatIdlData(c,e[u],n)}).join(", ")+" }"}case"enum":{if(t.type.variants.length===0)return"{}";if(t.type.variants[0].name){const s=t.type.variants,i=Object.keys(e)[0],u=e[i],c=Object.keys(u).map(l=>{var d;const v=u[l],y=(d=s[i])===null||d===void 0?void 0:d.find(p=>p.name===l);if(!y)throw new Error("Unable to find variant");return l+": "+ie.formatIdlData(y,v,n)}).join(", "),w=Z(i,{pascalCase:!0});return c.length===0?w:`${w} { ${c} }`}else return"Tuple formatting not yet implemented"}case"alias":return ie.formatIdlType(t.type.value)}}static flattenIdlAccounts(t,e){return t.map(n=>{const s=ks(n.name);if(n.hasOwnProperty("accounts")){const i=e?`${e} > ${s}`:s;return ie.flattenIdlAccounts(n.accounts,i)}else return{...n,name:e?`${e} > ${s}`:s}}).flat()}}function ks(r){const t=r.replace(/([A-Z])/g," $1");return t.charAt(0).toUpperCase()+t.slice(1)}function In(r,t){let e=xs(t),n=`${r}:${e}`;return $.Buffer$1.from($.sha256$1(n).slice(0,8))}function nr(r,t){switch(t.type.kind){case"struct":return t.type.fields.map(e=>he(r,e.type)).reduce((e,n)=>e+n,0);case"enum":{const e=t.type.variants.map(n=>n.fields?n.fields.map(s=>typeof s=="object"&&"name"in s?he(r,s.type):he(r,s)).reduce((s,i)=>s+i,0):0);return Math.max(...e)+1}case"alias":return he(r,t.type.value)}}function he(r,t){var e,n;switch(t){case"bool":return 1;case"u8":return 1;case"i8":return 1;case"i16":return 2;case"u16":return 2;case"u32":return 4;case"i32":return 4;case"f32":return 4;case"u64":return 8;case"i64":return 8;case"f64":return 8;case"u128":return 16;case"i128":return 16;case"u256":return 32;case"i256":return 32;case"bytes":return 1;case"string":return 1;case"publicKey":return 32;default:if("vec"in t)return 1;if("option"in t)return 1+he(r,t.option);if("coption"in t)return 4+he(r,t.coption);if("defined"in t){const s=(n=(e=r.types)===null||e===void 0?void 0:e.filter(u=>u.name===t.defined))!==null&&n!==void 0?n:[];if(s.length!==1)throw new Ge(`Type not found: ${JSON.stringify(t)}`);let i=s[0];return nr(r,i)}if("array"in t){let s=t.array[0],i=t.array[1];return he(r,s)*i}throw new Error(`Invalid type ${JSON.stringify(t)}`)}}const _t=8;function rr(r){return $.Buffer.from($.sha256$1(r).slice(0,_t))}class me{constructor(t){if(t.accounts===void 0){this.accountLayouts=new Map;return}const e=t.accounts.map(n=>[n.name,Y.typeDefLayout(n,t.types)]);this.accountLayouts=new Map(e),this.idl=t}async encode(t,e){const n=$.Buffer$1.alloc(1e3),s=this.accountLayouts.get(t);if(!s)throw new Error(`Unknown account: ${t}`);const i=s.encode(e,n);let u=n.slice(0,i),c=me.accountDiscriminator(t);return $.Buffer$1.concat([c,u])}decode(t,e){if(me.accountDiscriminator(t).compare(e.slice(0,8)))throw new Error("Invalid account discriminator");return this.decodeUnchecked(t,e)}decodeAny(t){const e=t.slice(0,8),n=Array.from(this.accountLayouts.keys()).find(s=>me.accountDiscriminator(s).equals(e));if(!n)throw new Error("Account descriminator not found");return this.decodeUnchecked(n,t)}decodeUnchecked(t,e){const n=e.subarray(_t),s=this.accountLayouts.get(t);if(!s)throw new Error(`Unknown account: ${t}`);return s.decode(n)}memcmp(t,e){const n=me.accountDiscriminator(t);return{offset:0,bytes:F.bs58.encode(e?$.Buffer$1.concat([n,e]):n)}}size(t){var e;return _t+((e=nr(this.idl,t))!==null&&e!==void 0?e:0)}static accountDiscriminator(t){const e=`account:${Z(t,{pascalCase:!0,preserveConsecutiveUppercase:!0})}`;return rr(e)}}class Ss{constructor(t){if(t.events===void 0){this.layouts=new Map;return}const e=t.events.map(n=>{let s={name:n.name,type:{kind:"struct",fields:n.fields.map(i=>({name:i.name,type:i.type}))}};return[n.name,Y.typeDefLayout(s,t.types)]});this.layouts=new Map(e),this.discriminators=new Map(t.events===void 0?[]:t.events.map(n=>[gt(Is(n.name)),n.name]))}decode(t){let e;try{e=St(t)}catch{return null}const n=gt(e.slice(0,8)),s=this.discriminators.get(n);if(s===void 0)return null;const i=this.layouts.get(s);if(!i)throw new Error(`Unknown event: ${s}`);return{data:i.decode(e.slice(8)),name:s}}}function Is(r){return rr(`event:${r}`)}class Ls{constructor(t){if(t.types===void 0){this.typeLayouts=new Map;return}const e=t.types.map(n=>[n.name,Y.typeDefLayout(n,t.types)]);this.typeLayouts=new Map(e),this.idl=t}encode(t,e){const n=$.Buffer$1.alloc(1e3),s=this.typeLayouts.get(t);if(!s)throw new Error(`Unknown type: ${t}`);const i=s.encode(e,n);return n.slice(0,i)}decode(t,e){const n=this.typeLayouts.get(t);if(!n)throw new Error(`Unknown type: ${t}`);return n.decode(e)}}class ir{constructor(t){this.instruction=new Pt(t),this.accounts=new me(t),this.events=new Ss(t),this.types=new Ls(t)}}var Ts=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof $.global<"u"?$.global:typeof self<"u"?self:{};function Cs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}class J{constructor(t,e){if(!Number.isInteger(t))throw new TypeError("span must be an integer");this.span=t,this.property=e}makeDestinationObject(){return{}}decode(t,e){throw new Error("Layout is abstract")}encode(t,e,n){throw new Error("Layout is abstract")}getSpan(t,e){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(t){const e=Object.create(this.constructor.prototype);return Object.assign(e,this),e.property=t,e}fromArray(t){}}var Ye=J;function Os(r,t){return t.property?r+"["+t.property+"]":r}class pe extends J{isCount(){throw new Error("ExternalLayout is abstract")}}class sr extends pe{constructor(t,e,n){if(!(t instanceof J))throw new TypeError("layout must be a Layout");if(e===void 0)e=0;else if(!Number.isInteger(e))throw new TypeError("offset must be integer or undefined");super(t.span,n||t.property),this.layout=t,this.offset=e}isCount(){return this.layout instanceof Je||this.layout instanceof or}decode(t,e){return e===void 0&&(e=0),this.layout.decode(t,e+this.offset)}encode(t,e,n){return n===void 0&&(n=0),this.layout.encode(t,e,n+this.offset)}}class Je extends J{constructor(t,e){if(super(t,e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,e){return e===void 0&&(e=0),t.readUIntLE(e,this.span)}encode(t,e,n){return n===void 0&&(n=0),e.writeUIntLE(t,n,this.span),this.span}}class or extends J{constructor(t,e){if(super(t,e),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(t,e){return e===void 0&&(e=0),t.readUIntBE(e,this.span)}encode(t,e,n){return n===void 0&&(n=0),e.writeUIntBE(t,n,this.span),this.span}}const Et=Math.pow(2,32);function ar(r){const t=Math.floor(r/Et),e=r-t*Et;return{hi32:t,lo32:e}}function cr(r,t){return r*Et+t}class Rs extends J{constructor(t){super(8,t)}decode(t,e){e===void 0&&(e=0);const n=t.readUInt32LE(e),s=t.readUInt32LE(e+4);return cr(s,n)}encode(t,e,n){n===void 0&&(n=0);const s=ar(t);return e.writeUInt32LE(s.lo32,n),e.writeUInt32LE(s.hi32,n+4),8}}class Ps extends J{constructor(t){super(8,t)}decode(t,e){e===void 0&&(e=0);const n=t.readUInt32LE(e),s=t.readInt32LE(e+4);return cr(s,n)}encode(t,e,n){n===void 0&&(n=0);const s=ar(t);return e.writeUInt32LE(s.lo32,n),e.writeInt32LE(s.hi32,n+4),8}}class Bs extends J{constructor(t,e,n){if(!(Array.isArray(t)&&t.reduce((i,u)=>i&&u instanceof J,!0)))throw new TypeError("fields must be array of Layout instances");typeof e=="boolean"&&n===void 0&&(n=e,e=void 0);for(const i of t)if(0>i.span&&i.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let s=-1;try{s=t.reduce((i,u)=>i+u.getSpan(),0)}catch{}super(s,e),this.fields=t,this.decodePrefixes=!!n}getSpan(t,e){if(0<=this.span)return this.span;e===void 0&&(e=0);let n=0;try{n=this.fields.reduce((s,i)=>{const u=i.getSpan(t,e);return e+=u,s+u},0)}catch{throw new RangeError("indeterminate span")}return n}decode(t,e){e===void 0&&(e=0);const n=this.makeDestinationObject();for(const s of this.fields)if(s.property!==void 0&&(n[s.property]=s.decode(t,e)),e+=s.getSpan(t,e),this.decodePrefixes&&t.length===e)break;return n}encode(t,e,n){n===void 0&&(n=0);const s=n;let i=0,u=0;for(const c of this.fields){let w=c.span;if(u=0<w?w:0,c.property!==void 0){const l=t[c.property];l!==void 0&&(u=c.encode(l,e,n),0>w&&(w=c.getSpan(e,n)))}i=n,n+=w}return i+u-s}fromArray(t){const e=this.makeDestinationObject();for(const n of this.fields)n.property!==void 0&&0<t.length&&(e[n.property]=t.shift());return e}layoutFor(t){if(typeof t!="string")throw new TypeError("property must be string");for(const e of this.fields)if(e.property===t)return e}offsetOf(t){if(typeof t!="string")throw new TypeError("property must be string");let e=0;for(const n of this.fields){if(n.property===t)return e;0>n.span?e=-1:0<=e&&(e+=n.span)}}}class ur{constructor(t){this.property=t}decode(){throw new Error("UnionDiscriminator is abstract")}encode(){throw new Error("UnionDiscriminator is abstract")}}class Ln extends ur{constructor(t,e){if(!(t instanceof pe&&t.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(e||t.property||"variant"),this.layout=t}decode(t,e){return this.layout.decode(t,e)}encode(t,e,n){return this.layout.encode(t,e,n)}}class lr extends J{constructor(t,e,n){const s=t instanceof Je||t instanceof or;if(s)t=new Ln(new sr(t));else if(t instanceof pe&&t.isCount())t=new Ln(t);else if(!(t instanceof ur))throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(e===void 0&&(e=null),!(e===null||e instanceof J))throw new TypeError("defaultLayout must be null or a Layout");if(e!==null){if(0>e.span)throw new Error("defaultLayout must have constant span");e.property===void 0&&(e=e.replicate("content"))}let i=-1;e&&(i=e.span,0<=i&&s&&(i+=t.layout.span)),super(i,n),this.discriminator=t,this.usesPrefixDiscriminator=s,this.defaultLayout=e,this.registry={};let u=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(c){return u(c)},this.configGetSourceVariant=function(c){u=c.bind(this)}}getSpan(t,e){if(0<=this.span)return this.span;e===void 0&&(e=0);const n=this.getVariant(t,e);if(!n)throw new Error("unable to determine span for unrecognized variant");return n.getSpan(t,e)}defaultGetSourceVariant(t){if(t.hasOwnProperty(this.discriminator.property)){if(this.defaultLayout&&t.hasOwnProperty(this.defaultLayout.property))return;const e=this.registry[t[this.discriminator.property]];if(e&&(!e.layout||t.hasOwnProperty(e.property)))return e}else for(const e in this.registry){const n=this.registry[e];if(t.hasOwnProperty(n.property))return n}throw new Error("unable to infer src variant")}decode(t,e){e===void 0&&(e=0);let n;const s=this.discriminator,i=s.decode(t,e);let u=this.registry[i];if(u===void 0){let c=0;u=this.defaultLayout,this.usesPrefixDiscriminator&&(c=s.layout.span),n=this.makeDestinationObject(),n[s.property]=i,n[u.property]=this.defaultLayout.decode(t,e+c)}else n=u.decode(t,e);return n}encode(t,e,n){n===void 0&&(n=0);const s=this.getSourceVariant(t);if(s===void 0){const i=this.discriminator,u=this.defaultLayout;let c=0;return this.usesPrefixDiscriminator&&(c=i.layout.span),i.encode(t[i.property],e,n),c+u.encode(t[u.property],e,n+c)}return s.encode(t,e,n)}addVariant(t,e,n){const s=new Ds(this,t,e,n);return this.registry[t]=s,s}getVariant(t,e){let n=t;return $.Buffer.isBuffer(t)&&(e===void 0&&(e=0),n=this.discriminator.decode(t,e)),this.registry[n]}}class Ds extends J{constructor(t,e,n,s){if(!(t instanceof lr))throw new TypeError("union must be a Union");if(!Number.isInteger(e)||0>e)throw new TypeError("variant must be a (non-negative) integer");if(typeof n=="string"&&s===void 0&&(s=n,n=null),n){if(!(n instanceof J))throw new TypeError("layout must be a Layout");if(t.defaultLayout!==null&&0<=n.span&&n.span>t.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof s!="string")throw new TypeError("variant must have a String property")}let i=t.span;0>t.span&&(i=n?n.span:0,0<=i&&t.usesPrefixDiscriminator&&(i+=t.discriminator.layout.span)),super(i,s),this.union=t,this.variant=e,this.layout=n||null}getSpan(t,e){if(0<=this.span)return this.span;e===void 0&&(e=0);let n=0;return this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span),n+this.layout.getSpan(t,e+n)}decode(t,e){const n=this.makeDestinationObject();if(e===void 0&&(e=0),this!==this.union.getVariant(t,e))throw new Error("variant mismatch");let s=0;return this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(t,e+s):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(t,e,n){n===void 0&&(n=0);let s=0;if(this.union.usesPrefixDiscriminator&&(s=this.union.discriminator.layout.span),this.layout&&!t.hasOwnProperty(this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,e,n);let i=s;if(this.layout&&(this.layout.encode(t[this.property],e,n+s),i+=this.layout.getSpan(e,n+s),0<=this.union.span&&i>this.union.span))throw new Error("encoded variant overruns containing union");return i}fromArray(t){if(this.layout)return this.layout.fromArray(t)}}class Us extends J{constructor(t,e){if(!(t instanceof pe&&t.isCount()||Number.isInteger(t)&&0<=t))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let n=-1;t instanceof pe||(n=t),super(n,e),this.length=t}getSpan(t,e){let n=this.span;return 0>n&&(n=this.length.decode(t,e)),n}decode(t,e){e===void 0&&(e=0);let n=this.span;return 0>n&&(n=this.length.decode(t,e)),t.slice(e,e+n)}encode(t,e,n){let s=this.length;if(this.length instanceof pe&&(s=t.length),!($.Buffer.isBuffer(t)&&s===t.length))throw new TypeError(Os("Blob.encode",this)+" requires (length "+s+") Buffer as src");if(n+s>e.length)throw new RangeError("encoding overruns Buffer");return e.write(t.toString("hex"),n,s,"hex"),this.length instanceof pe&&this.length.encode(s,e,n),s}}var Ns=((r,t,e)=>new sr(r,t,e)),Ms=(r=>new Je(1,r)),ae=(r=>new Je(4,r)),$s=(r=>new Rs(r)),ce=(r=>new Ps(r)),X=((r,t,e)=>new Bs(r,t,e)),dr=((r,t,e)=>new lr(r,t,e)),Be=((r,t)=>new Us(r,t));class js extends Ye{constructor(t){super(-1,t),this.property=t,this.layout=X([ae("length"),ae("lengthPadding"),Be(Ns(ae(),-8),"chars")],this.property)}encode(t,e,n=0){if(t==null)return this.layout.span;const s={chars:$.Buffer.from(t,"utf8")};return this.layout.encode(s,e,n)}decode(t,e=0){return this.layout.decode(t,e).chars.toString()}getSpan(t,e=0){return ae().span+ae().span+new F.BN(new Uint8Array(t).slice(e,e+4),10,"le").toNumber()}}function Qe(r){return new js(r)}function ne(r){return Be(32,r)}const ee=dr(ae("instruction"));ee.addVariant(0,X([ce("lamports"),ce("space"),ne("owner")]),"createAccount");ee.addVariant(1,X([ne("owner")]),"assign");ee.addVariant(2,X([ce("lamports")]),"transfer");ee.addVariant(3,X([ne("base"),Qe("seed"),ce("lamports"),ce("space"),ne("owner")]),"createAccountWithSeed");ee.addVariant(4,X([ne("authorized")]),"advanceNonceAccount");ee.addVariant(5,X([ce("lamports")]),"withdrawNonceAccount");ee.addVariant(6,X([ne("authorized")]),"initializeNonceAccount");ee.addVariant(7,X([ne("authorized")]),"authorizeNonceAccount");ee.addVariant(8,X([ce("space")]),"allocate");ee.addVariant(9,X([ne("base"),Qe("seed"),ce("space"),ne("owner")]),"allocateWithSeed");ee.addVariant(10,X([ne("base"),Qe("seed"),ne("owner")]),"assignWithSeed");ee.addVariant(11,X([ce("lamports"),Qe("seed"),ne("owner")]),"transferWithSeed");Math.max(...Object.values(ee.registry).map(r=>r.span));class Vs extends Ye{constructor(t,e,n,s){super(t.span,s),this.layout=t,this.decoder=e,this.encoder=n}decode(t,e){return this.decoder(this.layout.decode(t,e))}encode(t,e,n){return this.layout.encode(this.encoder(t),e,n)}getSpan(t,e){return this.layout.getSpan(t,e)}}function Tn(r){return new Vs(Be(32),t=>new F.PublicKey(t),t=>t.toBuffer(),r)}X([ae("version"),ae("state"),Tn("authorizedPubkey"),Tn("nonce"),X([$s("lamportsPerSignature")],"feeCalculator")]);function Fs(r){return new TextDecoder().decode($.sha256$1(r))}var zs=Object.freeze({__proto__:null,hash:Fs});function qs(r,t,e){const n=$.Buffer$1.concat([r.toBuffer(),$.Buffer$1.from(t),e.toBuffer()]);return new F.PublicKey($.sha256$1(n))}function fr(r,...t){let e=[$.Buffer$1.from([97,110,99,104,111,114])];t.forEach(s=>{e.push(s instanceof $.Buffer$1?s:Q(s).toBuffer())});const[n]=F.PublicKey.findProgramAddressSync(e,Q(r));return n}var Ks=Object.freeze({__proto__:null,createWithSeedSync:qs,associated:fr});const Bt=new F.PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),Dt=new F.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");function Gs({mint:r,owner:t}){return F.PublicKey.findProgramAddressSync([t.toBuffer(),Bt.toBuffer(),r.toBuffer()],Dt)[0]}var Zs=Object.freeze({__proto__:null,TOKEN_PROGRAM_ID:Bt,ASSOCIATED_PROGRAM_ID:Dt,associatedAddress:Gs}),At={exports:{}};(function(r,t){var e=typeof self<"u"?self:Ts,n=(function(){function i(){this.fetch=!1,this.DOMException=e.DOMException}return i.prototype=e,new i})();(function(i){(function(u){var c={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function w(h){return h&&DataView.prototype.isPrototypeOf(h)}if(c.arrayBuffer)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(h){return h&&l.indexOf(Object.prototype.toString.call(h))>-1};function v(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function y(h){return typeof h!="string"&&(h=String(h)),h}function p(h){var b={next:function(){var C=h.shift();return{done:C===void 0,value:C}}};return c.iterable&&(b[Symbol.iterator]=function(){return b}),b}function m(h){this.map={},h instanceof m?h.forEach(function(b,C){this.append(C,b)},this):Array.isArray(h)?h.forEach(function(b){this.append(b[0],b[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(b){this.append(b,h[b])},this)}m.prototype.append=function(h,b){h=v(h),b=y(b);var C=this.map[h];this.map[h]=C?C+", "+b:b},m.prototype.delete=function(h){delete this.map[v(h)]},m.prototype.get=function(h){return h=v(h),this.has(h)?this.map[h]:null},m.prototype.has=function(h){return this.map.hasOwnProperty(v(h))},m.prototype.set=function(h,b){this.map[v(h)]=y(b)},m.prototype.forEach=function(h,b){for(var C in this.map)this.map.hasOwnProperty(C)&&h.call(b,this.map[C],C,this)},m.prototype.keys=function(){var h=[];return this.forEach(function(b,C){h.push(C)}),p(h)},m.prototype.values=function(){var h=[];return this.forEach(function(b){h.push(b)}),p(h)},m.prototype.entries=function(){var h=[];return this.forEach(function(b,C){h.push([C,b])}),p(h)},c.iterable&&(m.prototype[Symbol.iterator]=m.prototype.entries);function I(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function _(h){return new Promise(function(b,C){h.onload=function(){b(h.result)},h.onerror=function(){C(h.error)}})}function A(h){var b=new FileReader,C=_(b);return b.readAsArrayBuffer(h),C}function R(h){var b=new FileReader,C=_(b);return b.readAsText(h),C}function k(h){for(var b=new Uint8Array(h),C=new Array(b.length),z=0;z<b.length;z++)C[z]=String.fromCharCode(b[z]);return C.join("")}function x(h){if(h.slice)return h.slice(0);var b=new Uint8Array(h.byteLength);return b.set(new Uint8Array(h)),b.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(h){this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:c.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:c.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():c.arrayBuffer&&c.blob&&w(h)?(this._bodyArrayBuffer=x(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||d(h))?this._bodyArrayBuffer=x(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var h=I(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?I(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(A)}),this.text=function(){var h=I(this);if(h)return h;if(this._bodyBlob)return R(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(k(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(V)}),this.json=function(){return this.text().then(JSON.parse)},this}var K=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function P(h){var b=h.toUpperCase();return K.indexOf(b)>-1?b:h}function j(h,b){b=b||{};var C=b.body;if(h instanceof j){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,b.headers||(this.headers=new m(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!C&&h._bodyInit!=null&&(C=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=b.credentials||this.credentials||"same-origin",(b.headers||!this.headers)&&(this.headers=new m(b.headers)),this.method=P(b.method||this.method||"GET"),this.mode=b.mode||this.mode||null,this.signal=b.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&C)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(C)}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function V(h){var b=new FormData;return h.trim().split("&").forEach(function(C){if(C){var z=C.split("="),H=z.shift().replace(/\+/g," "),g=z.join("=").replace(/\+/g," ");b.append(decodeURIComponent(H),decodeURIComponent(g))}}),b}function N(h){var b=new m,C=h.replace(/\r?\n[\t ]+/g," ");return C.split(/\r?\n/).forEach(function(z){var H=z.split(":"),g=H.shift().trim();if(g){var o=H.join(":").trim();b.append(g,o)}}),b}U.call(j.prototype);function B(h,b){b||(b={}),this.type="default",this.status=b.status===void 0?200:b.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in b?b.statusText:"OK",this.headers=new m(b.headers),this.url=b.url||"",this._initBody(h)}U.call(B.prototype),B.prototype.clone=function(){return new B(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},B.error=function(){var h=new B(null,{status:0,statusText:""});return h.type="error",h};var O=[301,302,303,307,308];B.redirect=function(h,b){if(O.indexOf(b)===-1)throw new RangeError("Invalid status code");return new B(null,{status:b,headers:{location:h}})},u.DOMException=i.DOMException;try{new u.DOMException}catch{u.DOMException=function(b,C){this.message=b,this.name=C;var z=Error(b);this.stack=z.stack},u.DOMException.prototype=Object.create(Error.prototype),u.DOMException.prototype.constructor=u.DOMException}function S(h,b){return new Promise(function(C,z){var H=new j(h,b);if(H.signal&&H.signal.aborted)return z(new u.DOMException("Aborted","AbortError"));var g=new XMLHttpRequest;function o(){g.abort()}g.onload=function(){var a={status:g.status,statusText:g.statusText,headers:N(g.getAllResponseHeaders()||"")};a.url="responseURL"in g?g.responseURL:a.headers.get("X-Request-URL");var f="response"in g?g.response:g.responseText;C(new B(f,a))},g.onerror=function(){z(new TypeError("Network request failed"))},g.ontimeout=function(){z(new TypeError("Network request failed"))},g.onabort=function(){z(new u.DOMException("Aborted","AbortError"))},g.open(H.method,H.url,!0),H.credentials==="include"?g.withCredentials=!0:H.credentials==="omit"&&(g.withCredentials=!1),"responseType"in g&&c.blob&&(g.responseType="blob"),H.headers.forEach(function(a,f){g.setRequestHeader(f,a)}),H.signal&&(H.signal.addEventListener("abort",o),g.onreadystatechange=function(){g.readyState===4&&H.signal.removeEventListener("abort",o)}),g.send(typeof H._bodyInit>"u"?null:H._bodyInit)})}return S.polyfill=!0,i.fetch||(i.fetch=S,i.Headers=m,i.Request=j,i.Response=B),u.Headers=m,u.Request=j,u.Response=B,u.fetch=S,Object.defineProperty(u,"__esModule",{value:!0}),u})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=n;t=s.fetch,t.default=s.fetch,t.fetch=s.fetch,t.Headers=s.Headers,t.Request=s.Request,t.Response=s.Response,r.exports=t})(At,At.exports);var Hs=Cs(At.exports);async function Ws(r,t,e=5){const n=`https://api.apr.dev/api/v0/program/${t.toString()}/latest?limit=${e}`,[s,i]=await Promise.all([hr(r,t),Hs(n)]),u=(await i.json()).filter(w=>!w.aborted&&w.state==="Built"&&w.verified==="Verified");if(u.length===0)return null;const c=u[0];return s.slot.toNumber()!==c.verified_slot?null:c}async function hr(r,t){const e=await r.getAccountInfo(t);if(e===null)throw new Error("program account not found");const{program:n}=xt(e.data),s=await r.getAccountInfo(n.programdataAddress);if(s===null)throw new Error("program data account not found");const{programData:i}=xt(s.data);return i}const Xs=M.rustEnum([M.struct([],"uninitialized"),M.struct([M.option(M.publicKey(),"authorityAddress")],"buffer"),M.struct([M.publicKey("programdataAddress")],"program"),M.struct([M.u64("slot"),M.option(M.publicKey(),"upgradeAuthorityAddress")],"programData")],void 0,M.u32());function xt(r){return Xs.decode(r)}var Ys=Object.freeze({__proto__:null,verifiedBuild:Ws,fetchData:hr,decodeUpgradeableLoaderState:xt}),Js=Object.freeze({__proto__:null,sha256:zs,rpc:fs,publicKey:Ks,bytes:Wi,token:Zs,features:gs,registry:Ys});function Qs(r){return"accounts"in r}async function eo(r){const t=(await F.PublicKey.findProgramAddress([],r))[0];return await F.PublicKey.createWithSeed(t,to(),r)}function to(){return"anchor:idl"}const no=M.struct([M.publicKey("authority"),M.vecU8("data")]);function ro(r){return no.decode(r)}function et(r,t){var e,n;let s={};const i=r.args?r.args.length:0;if(t.length>i){if(t.length!==i+1)throw new Error(`provided too many arguments ${t} to instruction ${r?.name} expecting: ${(n=(e=r.args)===null||e===void 0?void 0:e.map(u=>u.name))!==null&&n!==void 0?n:[]}`);s=t.pop()}return[t,s]}class He{static build(t,e,n){if(t.name==="_inner")throw new Ge("the _inner name is reserved");const s=(...i)=>{const[u,c]=et(t,[...i]);Xn(t.accounts,c.accounts),io(t,...i);const w=s.accounts(c.accounts);return c.remainingAccounts!==void 0&&w.push(...c.remainingAccounts),Ot("debug-logs")&&console.log("Outgoing account metas:",w),new F.TransactionInstruction({keys:w,programId:n,data:e(t.name,Xi(t,...u))})};return s.accounts=i=>He.accountsArray(i,t.accounts,n,t.name),s}static accountsArray(t,e,n,s){return t?e.map(i=>{if(("accounts"in i?i.accounts:void 0)!==void 0){const c=t[i.name];return He.accountsArray(c,i.accounts,n,s).flat()}else{const c=i;let w;try{w=Q(t[i.name])}catch{throw new Error(`Wrong input type for account "${i.name}" in the instruction accounts object${s!==void 0?' for instruction "'+s+'"':""}. Expected PublicKey or string.`)}const l=c.isOptional&&w.equals(n),d=c.isMut&&!l,v=c.isSigner&&!l;return{pubkey:w,isWritable:d,isSigner:v}}}).flat():[]}}function io(r,...t){}class so{static build(t,e){return(...s)=>{var i,u,c;const[,w]=et(t,[...s]),l=new F.Transaction$1;if(w.preInstructions&&w.instructions)throw new Error("instructions is deprecated, use preInstructions");return(i=w.preInstructions)===null||i===void 0||i.forEach(d=>l.add(d)),(u=w.instructions)===null||u===void 0||u.forEach(d=>l.add(d)),l.add(e(...s)),(c=w.postInstructions)===null||c===void 0||c.forEach(d=>l.add(d)),l}}}class oo{static build(t,e,n,s){return async(...u)=>{var c;const w=e(...u),[,l]=et(t,[...u]);if(s.sendAndConfirm===void 0)throw new Error("This function requires 'Provider.sendAndConfirm' to be implemented.");try{return await s.sendAndConfirm(w,(c=l.signers)!==null&&c!==void 0?c:[],l.options)}catch(d){throw Rt(d,n)}}}}class ao{static build(t,e,n,s){var i;const u={};return(i=t.accounts)===null||i===void 0||i.forEach(c=>{const w=Z(c.name);u[w]=new co(t,c,n,s,e)}),u}}class co{get size(){return this._size}get programId(){return this._programId}get provider(){return this._provider}get coder(){return this._coder}get idlAccount(){return this._idlAccount}constructor(t,e,n,s,i){this._idlAccount=e,this._programId=n,this._provider=s??Ke(),this._coder=i??new ir(t),this._size=this._coder.accounts.size(e)}async fetchNullable(t,e){const{data:n}=await this.fetchNullableAndContext(t,e);return n}async fetchNullableAndContext(t,e){const n=await this.getAccountInfoAndContext(t,e),{value:s,context:i}=n;return{data:s&&s.data.length!==0?this._coder.accounts.decode(this._idlAccount.name,s.data):null,context:i}}async fetch(t,e){const{data:n}=await this.fetchNullableAndContext(t,e);if(n===null)throw new Error(`Account does not exist or has no data ${t.toString()}`);return n}async fetchAndContext(t,e){const{data:n,context:s}=await this.fetchNullableAndContext(t,e);if(n===null)throw new Error(`Account does not exist ${t.toString()}`);return{data:n,context:s}}async fetchMultiple(t,e){return(await this.fetchMultipleAndContext(t,e)).map(s=>s?s.data:null)}async fetchMultipleAndContext(t,e){return(await Ct(this._provider.connection,t.map(s=>Q(s)),e)).map(s=>{if(s==null)return null;const{account:i,context:u}=s;return{data:this._coder.accounts.decode(this._idlAccount.name,i.data),context:u}})}async all(t){const e=this.coder.accounts.memcmp(this._idlAccount.name,t instanceof $.Buffer?t:void 0),n=[];return e?.offset!=null&&e?.bytes!=null&&n.push({memcmp:{offset:e.offset,bytes:e.bytes}}),e?.dataSize!=null&&n.push({dataSize:e.dataSize}),(await this._provider.connection.getProgramAccounts(this._programId,{commitment:this._provider.connection.commitment,filters:[...n,...Array.isArray(t)?t:[]]})).map(({pubkey:i,account:u})=>({publicKey:i,account:this._coder.accounts.decode(this._idlAccount.name,u.data)}))}subscribe(t,e){const n=ke.get(t.toString());if(n)return n.ee;const s=new ji;t=Q(t);const i=this._provider.connection.onAccountChange(t,u=>{const c=this._coder.accounts.decode(this._idlAccount.name,u.data);s.emit("change",c)},e);return ke.set(t.toString(),{ee:s,listener:i}),s}async unsubscribe(t){let e=ke.get(t.toString());if(!e){console.warn("Address is not subscribed");return}ke&&await this._provider.connection.removeAccountChangeListener(e.listener).then(()=>{ke.delete(t.toString())}).catch(console.error)}async createInstruction(t,e){const n=this.size;if(this._provider.publicKey===void 0)throw new Error("This function requires the Provider interface implementor to have a 'publicKey' field.");return F.SystemProgram.createAccount({fromPubkey:this._provider.publicKey,newAccountPubkey:t.publicKey,space:e??n,lamports:await this._provider.connection.getMinimumBalanceForRentExemption(e??n),programId:this._programId})}async associated(...t){const e=await this.associatedAddress(...t);return await this.fetch(e)}async associatedAddress(...t){return await fr(this._programId,...t)}async getAccountInfo(t,e){return await this._provider.connection.getAccountInfo(Q(t),e)}async getAccountInfoAndContext(t,e){return await this._provider.connection.getAccountInfoAndContext(Q(t),e)}}const ke=new Map,kt="Program log: ",pr="Program data: ",uo=kt.length,lo=pr.length;class fo{constructor(t,e,n){this._programId=t,this._provider=e,this._eventParser=new wr(t,n),this._eventCallbacks=new Map,this._eventListeners=new Map,this._listenerIdCount=0}addEventListener(t,e){var n;let s=this._listenerIdCount;return this._listenerIdCount+=1,this._eventListeners.has(t)||this._eventListeners.set(t,[]),this._eventListeners.set(t,((n=this._eventListeners.get(t))!==null&&n!==void 0?n:[]).concat(s)),this._eventCallbacks.set(s,[t,e]),this._onLogsSubscriptionId!==void 0||(this._onLogsSubscriptionId=this._provider.connection.onLogs(this._programId,(i,u)=>{if(!i.err)for(const c of this._eventParser.parseLogs(i.logs)){const w=this._eventListeners.get(c.name);w&&w.forEach(l=>{const d=this._eventCallbacks.get(l);if(d){const[,v]=d;v(c.data,u.slot,i.signature)}})}})),s}async removeEventListener(t){const e=this._eventCallbacks.get(t);if(!e)throw new Error(`Event listener ${t} doesn't exist!`);const[n]=e;let s=this._eventListeners.get(n);if(!s)throw new Error(`Event listeners don't exist for ${n}!`);if(this._eventCallbacks.delete(t),s=s.filter(i=>i!==t),this._eventListeners.set(n,s),s.length===0&&this._eventListeners.delete(n),this._eventCallbacks.size===0){if(this._eventListeners.size!==0)throw new Error(`Expected event listeners size to be 0 but got ${this._eventListeners.size}`);this._onLogsSubscriptionId!==void 0&&(await this._provider.connection.removeOnLogsListener(this._onLogsSubscriptionId),this._onLogsSubscriptionId=void 0)}}}class wr{constructor(t,e){this.coder=e,this.programId=t}*parseLogs(t,e=!1){const n=new po(t),s=new ho;let i=n.next();for(;i!==null;){let[u,c,w]=this.handleLog(s,i,e);u&&(yield u),c&&s.push(c),w&&s.pop(),i=n.next()}}handleLog(t,e,n){return t.stack.length>0&&t.program()===this.programId.toString()?this.handleProgramLog(e,n):[null,...this.handleSystemLog(e)]}handleProgramLog(t,e){if(t.startsWith(kt)||t.startsWith(pr)){const n=t.startsWith(kt)?t.slice(uo):t.slice(lo),s=this.coder.events.decode(n);if(e&&s===null)throw new Error(`Unable to decode event ${n}`);return[s,null,!1]}else return[null,...this.handleSystemLog(t)]}handleSystemLog(t){const e=t.split(":")[0];return e.match(/^Program (.*) success/g)!==null?[null,!0]:e.startsWith(`Program ${this.programId.toString()} invoke`)?[this.programId.toString(),!1]:e.includes("invoke")?["cpi",!1]:[null,!1]}}class ho{constructor(){this.stack=[]}program(){if(!this.stack.length)throw new Error("Expected the stack to have elements");return this.stack[this.stack.length-1]}push(t){this.stack.push(t)}pop(){if(!this.stack.length)throw new Error("Expected the stack to have elements");this.stack.pop()}}class po{constructor(t){this.logs=t}next(){if(this.logs.length===0)return null;let t=this.logs[0];return this.logs=this.logs.slice(1),t}}class wo{static build(t,e,n,s,i,u,c){return async(...l)=>{var d;const v=e(...l),[,y]=et(t,[...l]);let p;if(s.simulate===void 0)throw new Error("This function requires 'Provider.simulate' to be implemented.");try{p=await s.simulate(v,y.signers,(d=y.options)===null||d===void 0?void 0:d.commitment)}catch(_){throw Rt(_,n)}if(p===void 0)throw new Error("Unable to simulate transaction");const m=p.logs;if(!m)throw new Error("Simulated logs not found");const I=[];if(c.events){let _=new wr(u,i);for(const A of _.parseLogs(m))I.push(A)}return{events:I,raw:m}}}}function dt(r){return new yr(Be(8),t=>Ut.fromBuffer(t),t=>t.toBuffer(),r)}function Ve(r){return new yr(Be(32),t=>new F.PublicKey(t),t=>t.toBuffer(),r)}function ft(r,t){return new yo(r,t)}class yr extends Ye{constructor(t,e,n,s){super(t.span,s),this.layout=t,this.decoder=e,this.encoder=n}decode(t,e){return this.decoder(this.layout.decode(t,e))}encode(t,e,n){return this.layout.encode(this.encoder(t),e,n)}getSpan(t,e){return this.layout.getSpan(t,e)}}class yo extends Ye{constructor(t,e){super(-1,e),this.layout=t,this.discriminator=ae()}encode(t,e,n=0){return t==null?this.layout.span+this.discriminator.encode(0,e,n):(this.discriminator.encode(1,e,n),this.layout.encode(t,e,n+4)+4)}decode(t,e=0){const n=this.discriminator.decode(t,e);if(n===0)return null;if(n===1)return this.layout.decode(t,e+4);throw new Error("Invalid coption "+this.layout.property)}getSpan(t,e=0){return this.layout.getSpan(t,e+4)+4}}class Ut extends F.BN{toBuffer(){const t=super.toArray().reverse(),e=$.Buffer.from(t);if(e.length===8)return e;if(e.length>=8)throw new Error("u64 too large");const n=$.Buffer.alloc(8);return e.copy(n),n}static fromBuffer(t){if(t.length!==8)throw new Error(`Invalid buffer length: ${t.length}`);return new Ut([...t].reverse().map(e=>`00${e.toString(16)}`.slice(-2)).join(""),16)}}const go=X([Ve("mint"),Ve("owner"),dt("amount"),ft(Ve(),"delegate"),(r=>{const t=dr(Ms("discriminator"),null,r);return t.addVariant(0,X([]),"uninitialized"),t.addVariant(1,X([]),"initialized"),t.addVariant(2,X([]),"frozen"),t})("state"),ft(dt(),"isNative"),dt("delegatedAmount"),ft(Ve(),"closeAuthority")]);function mo(r){return go.decode(r)}class Ce{constructor(t,e,n,s,i,u,c,w){this._accounts=e,this._provider=n,this._programId=s,this._idlIx=i,this._idlTypes=c,this._customResolver=w,this._args=t,this._accountStore=new bo(n,u,this._programId)}args(t){this._args=t}async resolve(){for(await this.resolveConst(this._idlIx.accounts),this._resolveEventCpi(this._idlIx.accounts);await this.resolvePdas(this._idlIx.accounts)+await this.resolveRelations(this._idlIx.accounts)+await this.resolveCustom()>0;);}async resolveCustom(){if(this._customResolver){const{accounts:t,resolved:e}=await this._customResolver({args:this._args,accounts:this._accounts,provider:this._provider,programId:this._programId,idlIx:this._idlIx});return this._accounts=t,e}return 0}resolveOptionalsHelper(t,e){const n={};for(const s of e){const i=s.name,u=t[i];u!==void 0&&(gr(u)?Qs(s)?n[i]=this.resolveOptionalsHelper(u,s.accounts):n[i]=mr(u):u!==null?n[i]=Q(u):s.isOptional&&(n[i]=this._programId))}return n}resolveOptionals(t){Object.assign(this._accounts,this.resolveOptionalsHelper(t,this._idlIx.accounts))}get(t){const e=t.reduce((n,s)=>n&&n[s],this._accounts);if(e&&e.toBase58)return e}set(t,e){let n=this._accounts;t.forEach((s,i)=>{i==t.length-1&&(n[s]=e),n[s]=n[s]||{},n=n[s]})}async resolveConst(t,e=[]){for(let n=0;n<t.length;n+=1){const s=t[n],i=s.accounts;i&&await this.resolveConst(i,[...e,Z(s.name)]);const u=s,c=Z(s.name);if(u.isSigner&&!this.get([...e,c])){if(this._provider.wallet===void 0)throw new Error("This function requires the Provider interface implementor to have a 'wallet' field.");this.set([...e,c],this._provider.wallet.publicKey)}Reflect.has(Ce.CONST_ACCOUNTS,c)&&!this.get([...e,c])&&this.set([...e,c],Ce.CONST_ACCOUNTS[c])}}_resolveEventCpi(t,e=[]){for(const n in t){const s=t[n],i=s.accounts;i&&this._resolveEventCpi(i,[...e,Z(s.name)]);const u=+n+1;if(u===t.length)return;const c=Z(t[n].name),w=Z(t[u].name);if(c==="eventAuthority"&&w==="program"){const l=[...e,c],d=[...e,w];this.get(l)||this.set(l,F.PublicKey.findProgramAddressSync([$.Buffer.from("__event_authority")],this._programId)[0]),this.get(d)||this.set(d,this._programId);return}}}async resolvePdas(t,e=[]){let n=0;for(let s=0;s<t.length;s+=1){const i=t[s],u=i.accounts;u&&(n+=await this.resolvePdas(u,[...e,Z(i.name)]));const c=i,w=Z(i.name);c.pda&&c.pda.seeds.length>0&&!this.get([...e,w])&&await this.autoPopulatePda(c,e)&&(n+=1)}return n}async resolveRelations(t,e=[]){let n=0;for(let s=0;s<t.length;s+=1){const i=t[s],u=i.accounts;u&&(n+=await this.resolveRelations(u,[...e,Z(i.name)]));const c=i.relations||[],w=Z(i.name),l=[...e,w],d=this.get(l);if(d){const v=c.filter(y=>!this.get([...e,Z(y)]));if(n+=v.length,v.length>0){const y=await this._accountStore.fetchAccount({publicKey:d});await Promise.all(v.map(async p=>{const m=Z(p);return this.set([...e,m],y[m]),y[m]}))}}}return n}async autoPopulatePda(t,e=[]){if(!t.pda||!t.pda.seeds)throw new Error("Must have seeds");const n=await Promise.all(t.pda.seeds.map(u=>this.toBuffer(u,e)));if(n.some(u=>typeof u>"u"))return;const s=await this.parseProgramId(t,e);if(!s)return;const[i]=await F.PublicKey.findProgramAddress(n,s);this.set([...e,Z(t.name)],i)}async parseProgramId(t,e=[]){var n;if(!(!((n=t.pda)===null||n===void 0)&&n.programId))return this._programId;switch(t.pda.programId.kind){case"const":return new F.PublicKey(this.toBufferConst(t.pda.programId.value));case"arg":return this.argValue(t.pda.programId);case"account":return await this.accountValue(t.pda.programId,e);default:throw new Error(`Unexpected program seed kind: ${t.pda.programId.kind}`)}}async toBuffer(t,e=[]){switch(t.kind){case"const":return this.toBufferConst(t);case"arg":return await this.toBufferArg(t);case"account":return await this.toBufferAccount(t,e);default:throw new Error(`Unexpected seed kind: ${t.kind}`)}}getType(t,e=[]){if(e.length>0&&t.defined){const n=this._idlTypes.find(u=>u.name===t.defined);if(!n)throw new Error(`Cannot find type ${t.defined}`);const i=n.type.fields.find(u=>u.name===e[0]);return this.getType(i.type,e.slice(1))}return t}toBufferConst(t){return this.toBufferValue(this.getType(t.type,(t.path||"").split(".").slice(1)),t.value)}async toBufferArg(t){const e=this.argValue(t);if(!(typeof e>"u"))return this.toBufferValue(this.getType(t.type,(t.path||"").split(".").slice(1)),e)}argValue(t){const e=t.path.split("."),n=Z(e[0]),s=this._idlIx.args.findIndex(i=>i.name===n);if(s===-1)throw new Error(`Unable to find argument for seed: ${n}`);return e.slice(1).reduce((i,u)=>(i||{})[u],this._args[s])}async toBufferAccount(t,e=[]){const n=await this.accountValue(t,e);if(n)return this.toBufferValue(t.type,n)}async accountValue(t,e=[]){const n=t.path.split("."),s=n[0],i=this.get([...e,Z(s)]);if(i===null)throw new Error("fieldPubkey is null");if(n.length===1)return i;const u=await this._accountStore.fetchAccount({publicKey:i,name:t.account});return this.parseAccountValue(u,n.slice(1))}parseAccountValue(t,e){let n;for(;e.length>0;)n=t[Z(e[0])],e=e.slice(1);return n}toBufferValue(t,e){switch(t){case"u8":return $.Buffer.from([e]);case"u16":let n=$.Buffer.alloc(2);return n.writeUInt16LE(e),n;case"u32":let s=$.Buffer.alloc(4);return s.writeUInt32LE(e),s;case"u64":let i=$.Buffer.alloc(8);return i.writeBigUInt64LE(BigInt(e)),i;case"string":return $.Buffer.from(Hn(e));case"publicKey":return e.toBuffer();default:if(t.array)return $.Buffer.from(e);throw new Error(`Unexpected seed type: ${t}`)}}}Ce.CONST_ACCOUNTS={associatedTokenProgram:Dt,rent:F.SYSVAR_RENT_PUBKEY,systemProgram:F.SystemProgram.programId,tokenProgram:Bt,clock:F.SYSVAR_CLOCK_PUBKEY};class bo{constructor(t,e,n){this._provider=t,this._programId=n,this._cache=new Map,this._idls={},this._idls[n.toBase58()]=e}async ensureIdl(t){if(!this._idls[t.toBase58()]){const e=await ve.fetchIdl(t,this._provider);if(e){const n=new ve(e,t,this._provider);this._idls[t.toBase58()]=n.account}}return this._idls[t.toBase58()]}async fetchAccount({publicKey:t,name:e,programId:n=this._programId}){const s=t.toString();if(!this._cache.has(s))if(e==="TokenAccount"){const i=await this._provider.connection.getAccountInfo(t);if(i===null)throw new Error(`invalid account info for ${s}`);const u=mo(i.data);this._cache.set(s,u)}else if(e){const i=await this.ensureIdl(n);if(i){const u=i[Z(e)];if(u){const c=await u.fetch(t);this._cache.set(s,c)}}}else{const i=await this._provider.connection.getAccountInfo(t);if(i===null)throw new Error(`invalid account info for ${s}`);const u=i.data,c=await this.ensureIdl(i.owner);if(c){const w=Object.values(c)[0];if(!w)throw new Error("No accounts for this program");const l=w.coder.accounts.decodeAny(u);this._cache.set(s,l)}}return this._cache.get(s)}}class vo{static build(t,e,n,s,i,u,c,w,l,d,v){return(...y)=>new _o(y,s,i,u,c,w,t,e,n,l,d,v)}}function gr(r){return typeof r=="object"&&r!==null&&!("_bn"in r)}function mr(r,t){const e={};for(const n in r){const s=r[n];if(s===null)throw new Error("Failed to resolve optionals due to IDL type mismatch with input accounts!");e[n]=gr(s)?mr(s):Q(s)}return e}class _o{constructor(t,e,n,s,i,u,c,w,l,d,v,y){this._ixFn=e,this._txFn=n,this._rpcFn=s,this._simulateFn=i,this._viewFn=u,this._programId=w,this._accounts={},this._remainingAccounts=[],this._signers=[],this._preInstructions=[],this._postInstructions=[],this._autoResolveAccounts=!0,this._args=t,this._accountsResolver=new Ce(t,this._accounts,c,w,l,d,v,y)}args(t){this._args=t,this._accountsResolver.args(t)}async pubkeys(){return this._autoResolveAccounts&&await this._accountsResolver.resolve(),this._accounts}accounts(t){return this._autoResolveAccounts=!0,this._accountsResolver.resolveOptionals(t),this}accountsStrict(t){return this._autoResolveAccounts=!1,this._accountsResolver.resolveOptionals(t),this}signers(t){return this._signers=this._signers.concat(t),this}remainingAccounts(t){return this._remainingAccounts=this._remainingAccounts.concat(t),this}preInstructions(t){return this._preInstructions=this._preInstructions.concat(t),this}postInstructions(t){return this._postInstructions=this._postInstructions.concat(t),this}async rpc(t){return this._autoResolveAccounts&&await this._accountsResolver.resolve(),this._rpcFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:t})}async rpcAndKeys(t){return{pubkeys:await this.pubkeys(),signature:await this.rpc(t)}}async view(t){if(this._autoResolveAccounts&&await this._accountsResolver.resolve(),!this._viewFn)throw new Error("Method does not support views");return this._viewFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:t})}async simulate(t){return this._autoResolveAccounts&&await this._accountsResolver.resolve(),this._simulateFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions,options:t})}async instruction(){return this._autoResolveAccounts&&await this._accountsResolver.resolve(),this._ixFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions})}async prepare(){return{instruction:await this.instruction(),pubkeys:await this.pubkeys(),signers:await this._signers}}async transaction(){return this._autoResolveAccounts&&await this._accountsResolver.resolve(),this._txFn(...this._args,{accounts:this._accounts,signers:this._signers,remainingAccounts:this._remainingAccounts,preInstructions:this._preInstructions,postInstructions:this._postInstructions})}}class Eo{static build(t,e,n,s){const i=e.accounts.find(w=>w.isMut),u=!!e.returns;return i||!u?void 0:async(...w)=>{var l,d;let v=await n(...w);const y=`Program return: ${t} `;let p=v.raw.find(A=>A.startsWith(y));if(!p)throw new Error("View expected return log");let m=St(p.slice(y.length)),I=e.returns;if(!I)throw new Error("View expected return type");return Y.fieldLayout({type:I},Array.from([...(l=s.accounts)!==null&&l!==void 0?l:[],...(d=s.types)!==null&&d!==void 0?d:[]])).decode(m)}}}class Ao{static build(t,e,n,s,i){const u={},c={},w={},l={},d={},v={},y=Wn(t),p=t.accounts?ao.build(t,e,n,s):{};return t.instructions.forEach(m=>{const I=He.build(m,(K,P)=>e.instruction.encode(K,P),n),_=so.build(m,I),A=oo.build(m,_,y,s),R=wo.build(m,_,y,s,e,n,t),k=Eo.build(n,m,R,t),x=vo.build(s,n,m,I,_,A,R,k,p,t.types||[],i&&i(m)),U=Z(m.name);c[U]=I,w[U]=_,u[U]=A,l[U]=R,d[U]=x,k&&(v[U]=k)}),[u,c,w,p,l,d,v]}}class ve{get programId(){return this._programId}get idl(){return this._idl}get coder(){return this._coder}get provider(){return this._provider}constructor(t,e,n,s,i){e=Q(e),n||(n=Ke()),this._idl=t,this._provider=n,this._programId=e,this._coder=s??new ir(t),this._events=new fo(this._programId,n,this._coder);const[u,c,w,l,d,v,y]=Ao.build(t,this._coder,e,n,i??(()=>{}));this.rpc=u,this.instruction=c,this.transaction=w,this.account=l,this.simulate=d,this.methods=v,this.views=y}static async at(t,e){const n=Q(t),s=await ve.fetchIdl(n,e);if(!s)throw new Error(`IDL not found for program: ${t.toString()}`);return new ve(s,n,e)}static async fetchIdl(t,e){e=e??Ke();const n=Q(t),s=await eo(n),i=await e.connection.getAccountInfo(s);if(!i)return null;let u=ro(i.data.slice(8));const c=Ni(u.data);return JSON.parse(Zn(c))}addEventListener(t,e){return this._events.addEventListener(t,e)}async removeEventListener(t){return await this._events.removeEventListener(t)}}new F.PublicKey("11111111111111111111111111111111");exports.Program=ve;exports.createReadOnlyProvider=br;exports.distExports=M;exports.index=Js;exports.parseIdlErrors=Wn;exports.translateError=Rt;
@@ -1,7 +1,7 @@
1
- import "./index-pYTU7pQK.mjs";
2
- import { EvmWormholeCore as q } from "./index-BKgliEPZ.mjs";
3
- import { l as D, aJ as C, V as T, aK as v, bd as I, m as S, aL as p, b as F, H as j, de as $, X as N, aM as U, ah as V, c as J, c1 as k, I as R, E as x, au as P, aN as W } from "./platform-Cil_UtAQ.mjs";
4
- import { a as K } from "./solidity-Dk_mvceo.mjs";
1
+ import "./index-C6MalNd5.mjs";
2
+ import { EvmWormholeCore as q } from "./index-CrWTw0Se.mjs";
3
+ import { l as D, aJ as C, V as T, aK as v, bd as I, m as S, aL as p, b as F, H as j, de as $, X as N, aM as U, ah as V, c as J, c1 as k, I as R, E as x, au as P, aN as W } from "./platform-CSpAb386.mjs";
4
+ import { a as K } from "./solidity-D9gSgFcp.mjs";
5
5
  class _ {
6
6
  network;
7
7
  chain;
@@ -1,6 +1,6 @@
1
- import { ah as i, ai as c, m as h, au as d } from "./platform-Cil_UtAQ.mjs";
2
- import { A as m } from "./platform-vRQufc6j.mjs";
3
- import { c as w } from "./create-CChLkbGc.mjs";
1
+ import { ah as i, ai as c, m as h, au as d } from "./platform-CSpAb386.mjs";
2
+ import { A as m } from "./platform-YzJZdSCf.mjs";
3
+ import { c as w } from "./create-C5dhTMHL.mjs";
4
4
  class o {
5
5
  network;
6
6
  chain;
@@ -1,9 +1,9 @@
1
- import { C as c, ah as p, bf as H, au as Z } from "./platform-Cil_UtAQ.mjs";
2
- import { k as j, l as Q, m as X, n as Y, o as J, S as $, c as ee, d as te } from "./index-CN7M4gwf.mjs";
3
- import { deriveWrappedMetaKey as E, deriveTokenBridgeConfigKey as W, deriveAuthoritySignerKey as ne, deriveSenderAccountKey as ie, deriveMintAuthorityKey as se, deriveEndpointKey as ae } from "./index-Ap7250Gf.mjs";
4
- import { P as i, L as l, S as re, T as oe, j as ce, B as x, aC as K, d as N, b as de, M as v, V as G, l as ue, _ as me } from "./unsignedTransaction-DCDxTFq8.mjs";
5
- import { P as ge } from "./index-BU35GfG0.mjs";
6
- import { p as L, u as fe, b as le } from "./web3-CUwFm9Lx.mjs";
1
+ import { C as c, ah as p, bf as H, au as Z } from "./platform-CSpAb386.mjs";
2
+ import { k as j, l as Q, m as X, n as Y, o as J, S as $, c as ee, d as te } from "./index-BviSNDV7.mjs";
3
+ import { deriveWrappedMetaKey as E, deriveTokenBridgeConfigKey as W, deriveAuthoritySignerKey as ne, deriveSenderAccountKey as ie, deriveMintAuthorityKey as se, deriveEndpointKey as ae } from "./index-39tU5Y5t.mjs";
4
+ import { P as i, L as l, S as re, T as oe, j as ce, B as x, aC as K, d as N, b as de, M as v, V as G, l as ue, _ as me } from "./unsignedTransaction-D2Ja0SuN.mjs";
5
+ import { P as ge } from "./index-Bdtj4LUz.mjs";
6
+ import { p as L, u as fe, b as le } from "./web3-CdErAVj5.mjs";
7
7
  const pe = {
8
8
  version: "0.1.0",
9
9
  name: "wormhole_gateway",