@aptos-labs/ts-sdk 0.0.5 → 0.0.7

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 (434) hide show
  1. package/README.md +12 -7
  2. package/dist/browser/index.d.ts +874 -596
  3. package/dist/browser/index.global.js +75 -30
  4. package/dist/browser/index.global.js.map +1 -1
  5. package/dist/common/index.d.ts +874 -596
  6. package/dist/common/index.js +45 -24
  7. package/dist/common/index.js.map +1 -1
  8. package/dist/esm/api/{account.d.ts → account.d.mts} +17 -17
  9. package/dist/esm/api/account.mjs +1 -1
  10. package/dist/esm/api/ans.d.mts +273 -0
  11. package/dist/esm/api/ans.mjs +1 -1
  12. package/dist/esm/api/aptos.d.mts +80 -0
  13. package/dist/esm/api/aptos.mjs +1 -1
  14. package/dist/esm/api/{aptosConfig.d.ts → aptosConfig.d.mts} +6 -6
  15. package/dist/esm/api/aptosConfig.mjs +1 -1
  16. package/dist/esm/api/coin.d.mts +59 -0
  17. package/dist/esm/api/coin.mjs +1 -1
  18. package/dist/esm/api/{digitalAsset.d.ts → digitalAsset.d.mts} +35 -35
  19. package/dist/esm/api/digitalAsset.mjs +1 -1
  20. package/dist/esm/api/{event.d.ts → event.d.mts} +14 -14
  21. package/dist/esm/api/event.mjs +1 -1
  22. package/dist/esm/api/{faucet.d.ts → faucet.d.mts} +13 -13
  23. package/dist/esm/api/faucet.mjs +1 -1
  24. package/dist/esm/api/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
  25. package/dist/esm/api/fungibleAsset.mjs +1 -1
  26. package/dist/esm/api/{general.d.ts → general.d.mts} +11 -11
  27. package/dist/esm/api/general.mjs +1 -1
  28. package/dist/esm/api/index.d.mts +50 -0
  29. package/dist/esm/api/index.mjs +1 -1
  30. package/dist/esm/api/{staking.d.ts → staking.d.mts} +13 -13
  31. package/dist/esm/api/staking.mjs +1 -1
  32. package/dist/esm/api/{transaction.d.ts → transaction.d.mts} +7 -7
  33. package/dist/esm/api/transaction.mjs +1 -1
  34. package/dist/esm/api/transactionSubmission/build.d.mts +53 -0
  35. package/dist/esm/api/transactionSubmission/build.mjs +2 -0
  36. package/dist/esm/api/transactionSubmission/sign.d.mts +50 -0
  37. package/dist/esm/api/transactionSubmission/sign.mjs +2 -0
  38. package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -0
  39. package/dist/esm/api/transactionSubmission/simulate.d.mts +53 -0
  40. package/dist/esm/api/transactionSubmission/simulate.mjs +2 -0
  41. package/dist/esm/api/transactionSubmission/simulate.mjs.map +1 -0
  42. package/dist/esm/api/transactionSubmission/submit.d.mts +51 -0
  43. package/dist/esm/api/transactionSubmission/submit.mjs +2 -0
  44. package/dist/esm/api/transactionSubmission/submit.mjs.map +1 -0
  45. package/dist/esm/api/transactionSubmission.d.mts +91 -0
  46. package/dist/esm/api/transactionSubmission.mjs +1 -1
  47. package/dist/esm/bcs/{consts.d.ts → consts.d.mts} +5 -5
  48. package/dist/esm/bcs/consts.mjs +1 -1
  49. package/dist/esm/bcs/{deserializer.d.ts → deserializer.d.mts} +5 -5
  50. package/dist/esm/bcs/deserializer.mjs +1 -1
  51. package/dist/esm/bcs/index.d.mts +14 -0
  52. package/dist/esm/bcs/index.mjs +1 -1
  53. package/dist/esm/bcs/serializable/{entryFunctionBytes.d.ts → entryFunctionBytes.d.mts} +11 -11
  54. package/dist/esm/bcs/serializable/entryFunctionBytes.mjs +1 -1
  55. package/dist/esm/bcs/serializable/{fixedBytes.d.ts → fixedBytes.d.mts} +10 -10
  56. package/dist/esm/bcs/serializable/fixedBytes.mjs +1 -1
  57. package/dist/esm/bcs/serializable/{movePrimitives.d.ts → movePrimitives.d.mts} +10 -10
  58. package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
  59. package/dist/esm/bcs/serializable/{moveStructs.d.ts → moveStructs.d.mts} +11 -11
  60. package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
  61. package/dist/esm/bcs/{serializer.d.ts → serializer.d.mts} +7 -7
  62. package/dist/esm/bcs/serializer.mjs +1 -1
  63. package/dist/esm/{chunk-2B5QXKPU.mjs → chunk-2OZRBXLM.mjs} +2 -2
  64. package/dist/esm/chunk-2OZRBXLM.mjs.map +1 -0
  65. package/dist/esm/{chunk-O243HOP3.mjs → chunk-33T7WTB6.mjs} +2 -2
  66. package/dist/esm/chunk-33T7WTB6.mjs.map +1 -0
  67. package/dist/esm/chunk-3732I6BR.mjs +2 -0
  68. package/dist/esm/chunk-3732I6BR.mjs.map +1 -0
  69. package/dist/esm/chunk-3VZ3OZKC.mjs +2 -0
  70. package/dist/esm/chunk-3VZ3OZKC.mjs.map +1 -0
  71. package/dist/esm/chunk-44MGBJ73.mjs +2 -0
  72. package/dist/esm/{chunk-CZZJAR3B.mjs.map → chunk-44MGBJ73.mjs.map} +1 -1
  73. package/dist/esm/chunk-4ADA5BE7.mjs +2 -0
  74. package/dist/esm/{chunk-7AQXAH6Q.mjs.map → chunk-4ADA5BE7.mjs.map} +1 -1
  75. package/dist/esm/chunk-4KTQIWUP.mjs +2 -0
  76. package/dist/esm/chunk-4KTQIWUP.mjs.map +1 -0
  77. package/dist/esm/chunk-5LO7FR2P.mjs +2 -0
  78. package/dist/esm/chunk-5LO7FR2P.mjs.map +1 -0
  79. package/dist/esm/chunk-62SCW5NH.mjs +2 -0
  80. package/dist/esm/{chunk-YS2OX7AB.mjs.map → chunk-62SCW5NH.mjs.map} +1 -1
  81. package/dist/esm/{chunk-DNYVUM3K.mjs → chunk-67OGU66P.mjs} +2 -2
  82. package/dist/esm/{chunk-DNYVUM3K.mjs.map → chunk-67OGU66P.mjs.map} +1 -1
  83. package/dist/esm/{chunk-XFSL7O6Q.mjs → chunk-72F5YXGC.mjs} +2 -2
  84. package/dist/esm/chunk-72F5YXGC.mjs.map +1 -0
  85. package/dist/esm/{chunk-N6XWY4UT.mjs → chunk-ARVSIDVB.mjs} +1 -1
  86. package/dist/esm/{chunk-N6XWY4UT.mjs.map → chunk-ARVSIDVB.mjs.map} +1 -1
  87. package/dist/esm/{chunk-WVMDCC4V.mjs → chunk-BFQRMCY2.mjs} +2 -2
  88. package/dist/esm/{chunk-WVMDCC4V.mjs.map → chunk-BFQRMCY2.mjs.map} +1 -1
  89. package/dist/esm/{chunk-XFS5O5GJ.mjs → chunk-BM4HBROC.mjs} +2 -2
  90. package/dist/esm/{chunk-XFS5O5GJ.mjs.map → chunk-BM4HBROC.mjs.map} +1 -1
  91. package/dist/esm/chunk-BPYLPPEQ.mjs +2 -0
  92. package/dist/esm/{chunk-V6AAQLLJ.mjs.map → chunk-BPYLPPEQ.mjs.map} +1 -1
  93. package/dist/esm/{chunk-3OJN4I42.mjs → chunk-BV4OOU5Y.mjs} +2 -2
  94. package/dist/esm/{chunk-3OJN4I42.mjs.map → chunk-BV4OOU5Y.mjs.map} +1 -1
  95. package/dist/esm/chunk-CYDWEPFL.mjs +1 -0
  96. package/dist/esm/chunk-CYDWEPFL.mjs.map +1 -0
  97. package/dist/esm/chunk-DRPMIJH7.mjs +2 -0
  98. package/dist/esm/chunk-DRPMIJH7.mjs.map +1 -0
  99. package/dist/esm/chunk-EFIYW4WK.mjs +2 -0
  100. package/dist/esm/chunk-EWTHPMEE.mjs +2 -0
  101. package/dist/esm/{chunk-LAXIJRYU.mjs.map → chunk-EWTHPMEE.mjs.map} +1 -1
  102. package/dist/esm/chunk-GAI75GOG.mjs +2 -0
  103. package/dist/esm/{chunk-J3QOSJFP.mjs.map → chunk-GAI75GOG.mjs.map} +1 -1
  104. package/dist/esm/{chunk-BC2NOUYT.mjs → chunk-GTC7WHMV.mjs} +2 -2
  105. package/dist/esm/{chunk-BC2NOUYT.mjs.map → chunk-GTC7WHMV.mjs.map} +1 -1
  106. package/dist/esm/{chunk-MIBLZSNS.mjs → chunk-GU4OUKAF.mjs} +2 -2
  107. package/dist/esm/chunk-GU4OUKAF.mjs.map +1 -0
  108. package/dist/esm/{chunk-27P7PELS.mjs → chunk-HA6JD5R6.mjs} +2 -2
  109. package/dist/esm/{chunk-27P7PELS.mjs.map → chunk-HA6JD5R6.mjs.map} +1 -1
  110. package/dist/esm/chunk-HO7K2UAK.mjs +2 -0
  111. package/dist/esm/{chunk-ADR4XQPR.mjs.map → chunk-HO7K2UAK.mjs.map} +1 -1
  112. package/dist/esm/chunk-HVADSXTB.mjs +2 -0
  113. package/dist/esm/{chunk-LU6VS7PJ.mjs.map → chunk-HVADSXTB.mjs.map} +1 -1
  114. package/dist/esm/chunk-IBH7IOIM.mjs +2 -0
  115. package/dist/esm/{chunk-ZXJ5ZBTL.mjs.map → chunk-IBH7IOIM.mjs.map} +1 -1
  116. package/dist/esm/chunk-J5BH7V37.mjs +2 -0
  117. package/dist/esm/chunk-J5BH7V37.mjs.map +1 -0
  118. package/dist/esm/chunk-JZNLZMUC.mjs +2 -0
  119. package/dist/esm/{chunk-WGXAIQ7K.mjs.map → chunk-JZNLZMUC.mjs.map} +1 -1
  120. package/dist/esm/chunk-KQXRH5FK.mjs +2 -0
  121. package/dist/esm/{chunk-UQIOMAXE.mjs.map → chunk-KQXRH5FK.mjs.map} +1 -1
  122. package/dist/esm/chunk-L7AA75WZ.mjs +2 -0
  123. package/dist/esm/chunk-L7AA75WZ.mjs.map +1 -0
  124. package/dist/esm/chunk-LACQ537H.mjs +2 -0
  125. package/dist/esm/{chunk-KFP7MDSD.mjs.map → chunk-LACQ537H.mjs.map} +1 -1
  126. package/dist/esm/{chunk-2MQZUGO6.mjs → chunk-LDAD54H5.mjs} +1 -1
  127. package/dist/esm/chunk-LDAD54H5.mjs.map +1 -0
  128. package/dist/esm/chunk-LXW3A3MJ.mjs +2 -0
  129. package/dist/esm/chunk-LXW3A3MJ.mjs.map +1 -0
  130. package/dist/esm/{chunk-KYWYIK5P.mjs → chunk-M2V2POWK.mjs} +2 -2
  131. package/dist/esm/chunk-M2V2POWK.mjs.map +1 -0
  132. package/dist/esm/chunk-ND3ZQKTT.mjs +2 -0
  133. package/dist/esm/chunk-ND3ZQKTT.mjs.map +1 -0
  134. package/dist/esm/chunk-NZIJV4O2.mjs +2 -0
  135. package/dist/esm/{chunk-HH5RSP2H.mjs.map → chunk-NZIJV4O2.mjs.map} +1 -1
  136. package/dist/esm/chunk-O2B54NZT.mjs +2 -0
  137. package/dist/esm/chunk-O2B54NZT.mjs.map +1 -0
  138. package/dist/esm/chunk-OCW2L33Q.mjs +2 -0
  139. package/dist/esm/chunk-OCW2L33Q.mjs.map +1 -0
  140. package/dist/esm/{chunk-PJDVHU7X.mjs → chunk-OCYS4V2V.mjs} +2 -2
  141. package/dist/esm/{chunk-PJDVHU7X.mjs.map → chunk-OCYS4V2V.mjs.map} +1 -1
  142. package/dist/esm/{chunk-VAGYTPSI.mjs → chunk-OSTH5JRX.mjs} +2 -2
  143. package/dist/esm/chunk-OSTH5JRX.mjs.map +1 -0
  144. package/dist/esm/chunk-OVHY6ZUJ.mjs +2 -0
  145. package/dist/esm/{chunk-JTGGMXB7.mjs.map → chunk-OVHY6ZUJ.mjs.map} +1 -1
  146. package/dist/esm/chunk-PZCMSHY6.mjs +2 -0
  147. package/dist/esm/chunk-QWVR4RCV.mjs +2 -0
  148. package/dist/esm/{chunk-IPJKGHQY.mjs.map → chunk-QWVR4RCV.mjs.map} +1 -1
  149. package/dist/esm/chunk-R3KWVOFG.mjs +2 -0
  150. package/dist/esm/{chunk-KWJ6XKNF.mjs.map → chunk-R3KWVOFG.mjs.map} +1 -1
  151. package/dist/esm/{chunk-TXUMB5ZO.mjs → chunk-RHS5ROLP.mjs} +2 -2
  152. package/dist/esm/chunk-RHS5ROLP.mjs.map +1 -0
  153. package/dist/esm/{chunk-IXMH6AXJ.mjs → chunk-RKKU2SY5.mjs} +2 -2
  154. package/dist/esm/chunk-RYETO74W.mjs +2 -0
  155. package/dist/esm/{chunk-BIUGRAMO.mjs.map → chunk-RYETO74W.mjs.map} +1 -1
  156. package/dist/esm/chunk-S36IYY6K.mjs +2 -0
  157. package/dist/esm/{chunk-DXUIJ6KA.mjs.map → chunk-S36IYY6K.mjs.map} +1 -1
  158. package/dist/esm/chunk-TGKB6ALT.mjs +2 -0
  159. package/dist/esm/chunk-TGKB6ALT.mjs.map +1 -0
  160. package/dist/esm/chunk-TIH6ARYP.mjs +2 -0
  161. package/dist/esm/{chunk-IZHPCZE3.mjs.map → chunk-TIH6ARYP.mjs.map} +1 -1
  162. package/dist/esm/chunk-TPWSHFFI.mjs +2 -0
  163. package/dist/esm/chunk-TPWSHFFI.mjs.map +1 -0
  164. package/dist/esm/chunk-U25N2VWA.mjs +2 -0
  165. package/dist/esm/{chunk-FNB6CFQR.mjs.map → chunk-U25N2VWA.mjs.map} +1 -1
  166. package/dist/esm/chunk-U6SZNNVL.mjs +2 -0
  167. package/dist/esm/chunk-U6SZNNVL.mjs.map +1 -0
  168. package/dist/esm/{chunk-EKAOAGNQ.mjs → chunk-UAAI3NCA.mjs} +2 -2
  169. package/dist/esm/{chunk-BTK34A5U.mjs → chunk-UDBH4CER.mjs} +42 -21
  170. package/dist/esm/chunk-UDBH4CER.mjs.map +1 -0
  171. package/dist/esm/chunk-VWVEDCBM.mjs +2 -0
  172. package/dist/esm/{chunk-BREUBEPM.mjs.map → chunk-VWVEDCBM.mjs.map} +1 -1
  173. package/dist/esm/{chunk-ZT2A5ABR.mjs → chunk-WEJAI26R.mjs} +2 -2
  174. package/dist/esm/{chunk-ZT2A5ABR.mjs.map → chunk-WEJAI26R.mjs.map} +1 -1
  175. package/dist/esm/chunk-WL4OXZLN.mjs +2 -0
  176. package/dist/esm/{chunk-KNLMUSIO.mjs.map → chunk-WL4OXZLN.mjs.map} +1 -1
  177. package/dist/esm/chunk-X32O46IB.mjs +2 -0
  178. package/dist/esm/{chunk-PDLUCVJB.mjs.map → chunk-X32O46IB.mjs.map} +1 -1
  179. package/dist/esm/{chunk-KPESAXVI.mjs → chunk-Y2HRRUZ6.mjs} +2 -2
  180. package/dist/esm/{chunk-GUT3G5CG.mjs → chunk-Y7VR7X5W.mjs} +2 -2
  181. package/dist/esm/chunk-Y7VR7X5W.mjs.map +1 -0
  182. package/dist/esm/chunk-YYRDFZE6.mjs +2 -0
  183. package/dist/esm/{chunk-UVGCVCNG.mjs.map → chunk-YYRDFZE6.mjs.map} +1 -1
  184. package/dist/esm/{chunk-TYHBYRUA.mjs → chunk-ZLW65YCO.mjs} +2 -2
  185. package/dist/esm/chunk-ZLW65YCO.mjs.map +1 -0
  186. package/dist/esm/chunk-ZUHN56GM.mjs +2 -0
  187. package/dist/esm/chunk-ZUHN56GM.mjs.map +1 -0
  188. package/dist/esm/{chunk-XNFEUXDS.mjs → chunk-ZWH2ESXT.mjs} +1 -1
  189. package/dist/esm/chunk-ZWH2ESXT.mjs.map +1 -0
  190. package/dist/esm/client/{core.d.ts → core.d.mts} +9 -9
  191. package/dist/esm/client/core.mjs +1 -1
  192. package/dist/esm/client/{get.d.ts → get.d.mts} +12 -12
  193. package/dist/esm/client/get.mjs +1 -1
  194. package/dist/esm/client/index.d.mts +11 -0
  195. package/dist/esm/client/index.mjs +1 -1
  196. package/dist/esm/client/{post.d.ts → post.d.mts} +14 -14
  197. package/dist/esm/client/post.mjs +1 -1
  198. package/dist/esm/client/{types.d.ts → types.d.mts} +5 -5
  199. package/dist/esm/client/types.mjs +1 -1
  200. package/dist/esm/core/{account.d.ts → account.d.mts} +13 -13
  201. package/dist/esm/core/account.mjs +1 -1
  202. package/dist/esm/core/{accountAddress.d.ts → accountAddress.d.mts} +11 -11
  203. package/dist/esm/core/accountAddress.mjs +1 -1
  204. package/dist/esm/core/{authenticationKey.d.ts → authenticationKey.d.mts} +12 -12
  205. package/dist/esm/core/authenticationKey.mjs +1 -1
  206. package/dist/esm/core/{common.d.ts → common.d.mts} +1 -1
  207. package/dist/esm/core/common.mjs +1 -1
  208. package/dist/esm/core/crypto/{anyPublicKey.d.ts → anyPublicKey.d.mts} +11 -11
  209. package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
  210. package/dist/esm/core/crypto/{anySignature.d.ts → anySignature.d.mts} +10 -10
  211. package/dist/esm/core/crypto/anySignature.mjs +1 -1
  212. package/dist/esm/core/crypto/{asymmetricCrypto.d.ts → asymmetricCrypto.d.mts} +8 -8
  213. package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
  214. package/dist/esm/core/crypto/{ed25519.d.ts → ed25519.d.mts} +10 -10
  215. package/dist/esm/core/crypto/ed25519.mjs +1 -1
  216. package/dist/esm/core/crypto/{hdKey.d.ts → hdKey.d.mts} +1 -1
  217. package/dist/esm/core/crypto/hdKey.mjs +1 -1
  218. package/dist/esm/core/crypto/index.d.mts +17 -0
  219. package/dist/esm/core/crypto/index.mjs +1 -1
  220. package/dist/esm/core/crypto/{multiEd25519.d.ts → multiEd25519.d.mts} +11 -11
  221. package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
  222. package/dist/esm/core/crypto/{multiKey.d.ts → multiKey.d.mts} +12 -12
  223. package/dist/esm/core/crypto/multiKey.mjs +1 -1
  224. package/dist/esm/core/crypto/{secp256k1.d.ts → secp256k1.d.mts} +10 -10
  225. package/dist/esm/core/crypto/secp256k1.mjs +1 -1
  226. package/dist/esm/core/{hex.d.ts → hex.d.mts} +6 -6
  227. package/dist/esm/core/hex.mjs +1 -1
  228. package/dist/esm/core/index.d.mts +21 -0
  229. package/dist/esm/core/index.mjs +1 -1
  230. package/dist/esm/index.d.mts +64 -0
  231. package/dist/esm/index.mjs +1 -1
  232. package/dist/esm/internal/{account.d.ts → account.d.mts} +17 -17
  233. package/dist/esm/internal/account.mjs +1 -1
  234. package/dist/esm/internal/ans.d.mts +150 -0
  235. package/dist/esm/internal/ans.mjs +1 -1
  236. package/dist/esm/internal/coin.d.mts +43 -0
  237. package/dist/esm/internal/coin.mjs +1 -1
  238. package/dist/esm/internal/{digitalAsset.d.ts → digitalAsset.d.mts} +34 -34
  239. package/dist/esm/internal/digitalAsset.mjs +1 -1
  240. package/dist/esm/internal/{event.d.ts → event.d.mts} +14 -14
  241. package/dist/esm/internal/event.mjs +1 -1
  242. package/dist/esm/internal/faucet.d.mts +29 -0
  243. package/dist/esm/internal/faucet.mjs +1 -1
  244. package/dist/esm/internal/{fungibleAsset.d.ts → fungibleAsset.d.mts} +7 -7
  245. package/dist/esm/internal/fungibleAsset.mjs +1 -1
  246. package/dist/esm/internal/{general.d.ts → general.d.mts} +11 -11
  247. package/dist/esm/internal/general.mjs +1 -1
  248. package/dist/esm/internal/{staking.d.ts → staking.d.mts} +13 -13
  249. package/dist/esm/internal/staking.mjs +1 -1
  250. package/dist/esm/internal/{transaction.d.ts → transaction.d.mts} +7 -7
  251. package/dist/esm/internal/transaction.mjs +1 -1
  252. package/dist/esm/internal/{transactionSubmission.d.ts → transactionSubmission.d.mts} +41 -72
  253. package/dist/esm/internal/transactionSubmission.mjs +1 -1
  254. package/dist/esm/transactions/authenticator/{account.d.ts → account.d.mts} +15 -15
  255. package/dist/esm/transactions/authenticator/account.mjs +1 -1
  256. package/dist/esm/transactions/authenticator/index.d.mts +19 -0
  257. package/dist/esm/transactions/authenticator/index.mjs +1 -1
  258. package/dist/esm/transactions/authenticator/{transaction.d.ts → transaction.d.mts} +18 -18
  259. package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
  260. package/dist/esm/transactions/index.d.mts +39 -0
  261. package/dist/esm/transactions/index.mjs +1 -1
  262. package/dist/esm/transactions/instances/chainId.d.mts +21 -0
  263. package/dist/esm/transactions/instances/chainId.mjs +1 -1
  264. package/dist/esm/transactions/instances/{identifier.d.ts → identifier.d.mts} +9 -9
  265. package/dist/esm/transactions/instances/identifier.mjs +1 -1
  266. package/dist/esm/transactions/instances/index.d.mts +29 -0
  267. package/dist/esm/transactions/instances/index.mjs +1 -1
  268. package/dist/esm/transactions/instances/{moduleId.d.ts → moduleId.d.mts} +12 -12
  269. package/dist/esm/transactions/instances/moduleId.mjs +1 -1
  270. package/dist/esm/transactions/instances/{rawTransaction.d.ts → rawTransaction.d.mts} +16 -16
  271. package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
  272. package/dist/esm/transactions/instances/{rotationProofChallenge.d.ts → rotationProofChallenge.d.mts} +14 -14
  273. package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
  274. package/dist/esm/transactions/instances/{signedTransaction.d.ts → signedTransaction.d.mts} +25 -25
  275. package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
  276. package/dist/esm/transactions/instances/{transactionArgument.d.ts → transactionArgument.d.mts} +8 -8
  277. package/dist/esm/transactions/instances/{transactionPayload.d.ts → transactionPayload.d.mts} +14 -14
  278. package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
  279. package/dist/esm/transactions/transactionBuilder/{helpers.d.ts → helpers.d.mts} +31 -31
  280. package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
  281. package/dist/esm/transactions/transactionBuilder/index.d.mts +35 -0
  282. package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
  283. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.mts +54 -0
  284. package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
  285. package/dist/esm/transactions/transactionBuilder/{transactionBuilder.d.ts → transactionBuilder.d.mts} +35 -40
  286. package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
  287. package/dist/esm/transactions/typeTag/{index.d.ts → index.d.mts} +12 -12
  288. package/dist/esm/transactions/typeTag/index.mjs +1 -1
  289. package/dist/esm/transactions/typeTag/{parser.d.ts → parser.d.mts} +14 -13
  290. package/dist/esm/transactions/typeTag/parser.mjs +1 -1
  291. package/dist/esm/transactions/{types.d.ts → types.d.mts} +60 -97
  292. package/dist/esm/types/generated/{operations.d.ts → operations.d.mts} +105 -79
  293. package/dist/esm/types/generated/{queries.d.ts → queries.d.mts} +35 -32
  294. package/dist/esm/types/generated/queries.mjs +1 -1
  295. package/dist/esm/types/generated/{types.d.ts → types.d.mts} +3184 -3146
  296. package/dist/esm/types/generated/types.mjs +1 -1
  297. package/dist/esm/types/generated/types.mjs.map +1 -1
  298. package/dist/esm/types/{index.d.ts → index.d.mts} +94 -92
  299. package/dist/esm/types/index.mjs +1 -1
  300. package/dist/esm/types/indexer.d.mts +63 -0
  301. package/dist/esm/utils/apiEndpoints.mjs +1 -1
  302. package/dist/esm/utils/const.mjs +1 -1
  303. package/dist/esm/utils/helpers.mjs +1 -1
  304. package/dist/esm/utils/index.d.mts +2 -0
  305. package/dist/esm/utils/index.mjs +2 -0
  306. package/dist/esm/utils/index.mjs.map +1 -0
  307. package/dist/esm/utils/memoize.mjs +1 -1
  308. package/dist/esm/version.mjs +1 -1
  309. package/package.json +30 -30
  310. package/src/api/account.ts +2 -2
  311. package/src/api/ans.ts +250 -11
  312. package/src/api/aptos.ts +20 -0
  313. package/src/api/coin.ts +4 -4
  314. package/src/api/digitalAsset.ts +3 -3
  315. package/src/api/event.ts +2 -2
  316. package/src/api/general.ts +4 -4
  317. package/src/api/transactionSubmission/build.ts +42 -0
  318. package/src/api/transactionSubmission/sign.ts +44 -0
  319. package/src/api/transactionSubmission/simulate.ts +56 -0
  320. package/src/api/transactionSubmission/submit.ts +53 -0
  321. package/src/api/transactionSubmission.ts +4 -138
  322. package/src/client/core.ts +1 -1
  323. package/src/client/get.ts +6 -2
  324. package/src/client/post.ts +12 -4
  325. package/src/index.ts +1 -1
  326. package/src/internal/account.ts +2 -2
  327. package/src/internal/ans.ts +408 -22
  328. package/src/internal/coin.ts +5 -5
  329. package/src/internal/digitalAsset.ts +5 -5
  330. package/src/internal/event.ts +2 -2
  331. package/src/internal/general.ts +7 -6
  332. package/src/internal/queries/ansTokenFragment.graphql +9 -0
  333. package/src/internal/queries/getNames.graphql +11 -0
  334. package/src/internal/transactionSubmission.ts +52 -12
  335. package/src/transactions/transactionBuilder/helpers.ts +2 -2
  336. package/src/transactions/transactionBuilder/transactionBuilder.ts +22 -46
  337. package/src/transactions/typeTag/parser.ts +10 -2
  338. package/src/transactions/types.ts +16 -56
  339. package/src/types/generated/operations.ts +62 -33
  340. package/src/types/generated/queries.ts +56 -22
  341. package/src/types/generated/types.ts +2253 -2251
  342. package/src/types/index.ts +16 -10
  343. package/src/types/indexer.ts +3 -0
  344. package/src/utils/index.ts +2 -0
  345. package/dist/esm/api/ans.d.ts +0 -79
  346. package/dist/esm/api/aptos.d.ts +0 -72
  347. package/dist/esm/api/coin.d.ts +0 -59
  348. package/dist/esm/api/index.d.ts +0 -46
  349. package/dist/esm/api/transactionSubmission.d.ts +0 -142
  350. package/dist/esm/bcs/index.d.ts +0 -14
  351. package/dist/esm/chunk-2444YR3Y.mjs +0 -2
  352. package/dist/esm/chunk-2444YR3Y.mjs.map +0 -1
  353. package/dist/esm/chunk-2B5QXKPU.mjs.map +0 -1
  354. package/dist/esm/chunk-2MQZUGO6.mjs.map +0 -1
  355. package/dist/esm/chunk-3YOV42H5.mjs +0 -2
  356. package/dist/esm/chunk-3YOV42H5.mjs.map +0 -1
  357. package/dist/esm/chunk-7AIV5FEN.mjs +0 -2
  358. package/dist/esm/chunk-7AIV5FEN.mjs.map +0 -1
  359. package/dist/esm/chunk-7AQXAH6Q.mjs +0 -2
  360. package/dist/esm/chunk-7TL2MY2B.mjs +0 -2
  361. package/dist/esm/chunk-7TL2MY2B.mjs.map +0 -1
  362. package/dist/esm/chunk-ADR4XQPR.mjs +0 -2
  363. package/dist/esm/chunk-AY2HWVDO.mjs +0 -2
  364. package/dist/esm/chunk-AY2HWVDO.mjs.map +0 -1
  365. package/dist/esm/chunk-BIUGRAMO.mjs +0 -2
  366. package/dist/esm/chunk-BREUBEPM.mjs +0 -2
  367. package/dist/esm/chunk-BTK34A5U.mjs.map +0 -1
  368. package/dist/esm/chunk-CZZJAR3B.mjs +0 -2
  369. package/dist/esm/chunk-DXUIJ6KA.mjs +0 -2
  370. package/dist/esm/chunk-E72CFUU4.mjs +0 -2
  371. package/dist/esm/chunk-FHJ7F7Z6.mjs +0 -2
  372. package/dist/esm/chunk-FHJ7F7Z6.mjs.map +0 -1
  373. package/dist/esm/chunk-FNB6CFQR.mjs +0 -2
  374. package/dist/esm/chunk-GUT3G5CG.mjs.map +0 -1
  375. package/dist/esm/chunk-HH5RSP2H.mjs +0 -2
  376. package/dist/esm/chunk-IPJKGHQY.mjs +0 -2
  377. package/dist/esm/chunk-IZHPCZE3.mjs +0 -2
  378. package/dist/esm/chunk-J3QOSJFP.mjs +0 -2
  379. package/dist/esm/chunk-J5OKXARS.mjs +0 -2
  380. package/dist/esm/chunk-J5OKXARS.mjs.map +0 -1
  381. package/dist/esm/chunk-JTGGMXB7.mjs +0 -2
  382. package/dist/esm/chunk-KFP7MDSD.mjs +0 -2
  383. package/dist/esm/chunk-KJDY66XF.mjs +0 -2
  384. package/dist/esm/chunk-KJDY66XF.mjs.map +0 -1
  385. package/dist/esm/chunk-KNLMUSIO.mjs +0 -2
  386. package/dist/esm/chunk-KWJ6XKNF.mjs +0 -2
  387. package/dist/esm/chunk-KYWYIK5P.mjs.map +0 -1
  388. package/dist/esm/chunk-LAXIJRYU.mjs +0 -2
  389. package/dist/esm/chunk-LU6VS7PJ.mjs +0 -2
  390. package/dist/esm/chunk-MIBLZSNS.mjs.map +0 -1
  391. package/dist/esm/chunk-NKTKHC3Z.mjs +0 -2
  392. package/dist/esm/chunk-NKTKHC3Z.mjs.map +0 -1
  393. package/dist/esm/chunk-O243HOP3.mjs.map +0 -1
  394. package/dist/esm/chunk-PDLUCVJB.mjs +0 -2
  395. package/dist/esm/chunk-SJLO3JIH.mjs +0 -2
  396. package/dist/esm/chunk-TXUMB5ZO.mjs.map +0 -1
  397. package/dist/esm/chunk-TYHBYRUA.mjs.map +0 -1
  398. package/dist/esm/chunk-UQIOMAXE.mjs +0 -2
  399. package/dist/esm/chunk-UVGCVCNG.mjs +0 -2
  400. package/dist/esm/chunk-V6AAQLLJ.mjs +0 -2
  401. package/dist/esm/chunk-VAGYTPSI.mjs.map +0 -1
  402. package/dist/esm/chunk-WGXAIQ7K.mjs +0 -2
  403. package/dist/esm/chunk-WNEZCERQ.mjs +0 -2
  404. package/dist/esm/chunk-WNEZCERQ.mjs.map +0 -1
  405. package/dist/esm/chunk-XFSL7O6Q.mjs.map +0 -1
  406. package/dist/esm/chunk-YS2OX7AB.mjs +0 -2
  407. package/dist/esm/chunk-Z56AKXJ7.mjs +0 -2
  408. package/dist/esm/chunk-Z56AKXJ7.mjs.map +0 -1
  409. package/dist/esm/chunk-ZXJ5ZBTL.mjs +0 -2
  410. package/dist/esm/client/index.d.ts +0 -11
  411. package/dist/esm/core/crypto/index.d.ts +0 -17
  412. package/dist/esm/core/index.d.ts +0 -21
  413. package/dist/esm/index.d.ts +0 -60
  414. package/dist/esm/internal/ans.d.ts +0 -83
  415. package/dist/esm/internal/coin.d.ts +0 -43
  416. package/dist/esm/internal/faucet.d.ts +0 -29
  417. package/dist/esm/transactions/authenticator/index.d.ts +0 -19
  418. package/dist/esm/transactions/index.d.ts +0 -39
  419. package/dist/esm/transactions/instances/chainId.d.ts +0 -21
  420. package/dist/esm/transactions/instances/index.d.ts +0 -29
  421. package/dist/esm/transactions/transactionBuilder/index.d.ts +0 -35
  422. package/dist/esm/transactions/transactionBuilder/remoteAbi.d.ts +0 -54
  423. package/dist/esm/types/indexer.d.ts +0 -62
  424. /package/dist/esm/{chunk-XNFEUXDS.mjs.map → api/transactionSubmission/build.mjs.map} +0 -0
  425. /package/dist/esm/{chunk-E72CFUU4.mjs.map → chunk-EFIYW4WK.mjs.map} +0 -0
  426. /package/dist/esm/{chunk-SJLO3JIH.mjs.map → chunk-PZCMSHY6.mjs.map} +0 -0
  427. /package/dist/esm/{chunk-IXMH6AXJ.mjs.map → chunk-RKKU2SY5.mjs.map} +0 -0
  428. /package/dist/esm/{chunk-EKAOAGNQ.mjs.map → chunk-UAAI3NCA.mjs.map} +0 -0
  429. /package/dist/esm/{chunk-KPESAXVI.mjs.map → chunk-Y2HRRUZ6.mjs.map} +0 -0
  430. /package/dist/esm/utils/{apiEndpoints.d.ts → apiEndpoints.d.mts} +0 -0
  431. /package/dist/esm/utils/{const.d.ts → const.d.mts} +0 -0
  432. /package/dist/esm/utils/{helpers.d.ts → helpers.d.mts} +0 -0
  433. /package/dist/esm/utils/{memoize.d.ts → memoize.d.mts} +0 -0
  434. /package/dist/esm/{version.d.ts → version.d.mts} +0 -0
@@ -1,5 +1,5 @@
1
- "use strict";var aptosSDK=(()=>{var Wp=Object.create;var ko=Object.defineProperty;var cu=Object.getOwnPropertyDescriptor;var Qp=Object.getOwnPropertyNames;var Yp=Object.getPrototypeOf,Xp=Object.prototype.hasOwnProperty;var uu=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+r+'" is not supported')});var fe=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),fu=(r,t)=>{for(var e in t)ko(r,e,{get:t[e],enumerable:!0})},du=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qp(t))!Xp.call(r,o)&&o!==e&&ko(r,o,{get:()=>t[o],enumerable:!(n=cu(t,o))||n.enumerable});return r};var Zi=(r,t,e)=>(e=r!=null?Wp(Yp(r)):{},du(t||!r||!r.__esModule?ko(e,"default",{value:r,enumerable:!0}):e,r)),Zp=r=>du(ko({},"__esModule",{value:!0}),r),Jr=(r,t,e,n)=>{for(var o=n>1?void 0:n?cu(t,e):t,s=r.length-1,a;s>=0;s--)(a=r[s])&&(o=(n?a(t,e,o):a(o))||o);return n&&o&&ko(t,e,o),o};var qu=fe(()=>{});var Lu=fe((Fx,Ds)=>{(function(r){"use strict";var t=function(u){var l,d=new Float64Array(16);if(u)for(l=0;l<u.length;l++)d[l]=u[l];return d},e=function(){throw new Error("no PRNG")},n=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),a=t([1]),c=t([56129,1]),f=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),h=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),g=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),y=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),w=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function b(u,l,d,i){u[l]=d>>24&255,u[l+1]=d>>16&255,u[l+2]=d>>8&255,u[l+3]=d&255,u[l+4]=i>>24&255,u[l+5]=i>>16&255,u[l+6]=i>>8&255,u[l+7]=i&255}function I(u,l,d,i,p){var x,A=0;for(x=0;x<p;x++)A|=u[l+x]^d[i+x];return(1&A-1>>>8)-1}function T(u,l,d,i){return I(u,l,d,i,16)}function S(u,l,d,i){return I(u,l,d,i,32)}function R(u,l,d,i){for(var p=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,A=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,B=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,N=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Y=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,L=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,Be=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,$=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,re=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,se=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ge=d[16]&255|(d[17]&255)<<8|(d[18]&255)<<16|(d[19]&255)<<24,he=d[20]&255|(d[21]&255)<<8|(d[22]&255)<<16|(d[23]&255)<<24,ie=d[24]&255|(d[25]&255)<<8|(d[26]&255)<<16|(d[27]&255)<<24,ue=d[28]&255|(d[29]&255)<<8|(d[30]&255)<<16|(d[31]&255)<<24,ae=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,j=p,X=x,H=A,W=B,Q=N,q=Y,_=L,v=Be,P=$,U=re,C=se,k=ge,ee=he,ye=ie,xe=ue,me=ae,m,_e=0;_e<20;_e+=2)m=j+ee|0,Q^=m<<7|m>>>32-7,m=Q+j|0,P^=m<<9|m>>>32-9,m=P+Q|0,ee^=m<<13|m>>>32-13,m=ee+P|0,j^=m<<18|m>>>32-18,m=q+X|0,U^=m<<7|m>>>32-7,m=U+q|0,ye^=m<<9|m>>>32-9,m=ye+U|0,X^=m<<13|m>>>32-13,m=X+ye|0,q^=m<<18|m>>>32-18,m=C+_|0,xe^=m<<7|m>>>32-7,m=xe+C|0,H^=m<<9|m>>>32-9,m=H+xe|0,_^=m<<13|m>>>32-13,m=_+H|0,C^=m<<18|m>>>32-18,m=me+k|0,W^=m<<7|m>>>32-7,m=W+me|0,v^=m<<9|m>>>32-9,m=v+W|0,k^=m<<13|m>>>32-13,m=k+v|0,me^=m<<18|m>>>32-18,m=j+W|0,X^=m<<7|m>>>32-7,m=X+j|0,H^=m<<9|m>>>32-9,m=H+X|0,W^=m<<13|m>>>32-13,m=W+H|0,j^=m<<18|m>>>32-18,m=q+Q|0,_^=m<<7|m>>>32-7,m=_+q|0,v^=m<<9|m>>>32-9,m=v+_|0,Q^=m<<13|m>>>32-13,m=Q+v|0,q^=m<<18|m>>>32-18,m=C+U|0,k^=m<<7|m>>>32-7,m=k+C|0,P^=m<<9|m>>>32-9,m=P+k|0,U^=m<<13|m>>>32-13,m=U+P|0,C^=m<<18|m>>>32-18,m=me+xe|0,ee^=m<<7|m>>>32-7,m=ee+me|0,ye^=m<<9|m>>>32-9,m=ye+ee|0,xe^=m<<13|m>>>32-13,m=xe+ye|0,me^=m<<18|m>>>32-18;j=j+p|0,X=X+x|0,H=H+A|0,W=W+B|0,Q=Q+N|0,q=q+Y|0,_=_+L|0,v=v+Be|0,P=P+$|0,U=U+re|0,C=C+se|0,k=k+ge|0,ee=ee+he|0,ye=ye+ie|0,xe=xe+ue|0,me=me+ae|0,u[0]=j>>>0&255,u[1]=j>>>8&255,u[2]=j>>>16&255,u[3]=j>>>24&255,u[4]=X>>>0&255,u[5]=X>>>8&255,u[6]=X>>>16&255,u[7]=X>>>24&255,u[8]=H>>>0&255,u[9]=H>>>8&255,u[10]=H>>>16&255,u[11]=H>>>24&255,u[12]=W>>>0&255,u[13]=W>>>8&255,u[14]=W>>>16&255,u[15]=W>>>24&255,u[16]=Q>>>0&255,u[17]=Q>>>8&255,u[18]=Q>>>16&255,u[19]=Q>>>24&255,u[20]=q>>>0&255,u[21]=q>>>8&255,u[22]=q>>>16&255,u[23]=q>>>24&255,u[24]=_>>>0&255,u[25]=_>>>8&255,u[26]=_>>>16&255,u[27]=_>>>24&255,u[28]=v>>>0&255,u[29]=v>>>8&255,u[30]=v>>>16&255,u[31]=v>>>24&255,u[32]=P>>>0&255,u[33]=P>>>8&255,u[34]=P>>>16&255,u[35]=P>>>24&255,u[36]=U>>>0&255,u[37]=U>>>8&255,u[38]=U>>>16&255,u[39]=U>>>24&255,u[40]=C>>>0&255,u[41]=C>>>8&255,u[42]=C>>>16&255,u[43]=C>>>24&255,u[44]=k>>>0&255,u[45]=k>>>8&255,u[46]=k>>>16&255,u[47]=k>>>24&255,u[48]=ee>>>0&255,u[49]=ee>>>8&255,u[50]=ee>>>16&255,u[51]=ee>>>24&255,u[52]=ye>>>0&255,u[53]=ye>>>8&255,u[54]=ye>>>16&255,u[55]=ye>>>24&255,u[56]=xe>>>0&255,u[57]=xe>>>8&255,u[58]=xe>>>16&255,u[59]=xe>>>24&255,u[60]=me>>>0&255,u[61]=me>>>8&255,u[62]=me>>>16&255,u[63]=me>>>24&255}function M(u,l,d,i){for(var p=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,x=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,A=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,B=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,N=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,Y=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,L=l[0]&255|(l[1]&255)<<8|(l[2]&255)<<16|(l[3]&255)<<24,Be=l[4]&255|(l[5]&255)<<8|(l[6]&255)<<16|(l[7]&255)<<24,$=l[8]&255|(l[9]&255)<<8|(l[10]&255)<<16|(l[11]&255)<<24,re=l[12]&255|(l[13]&255)<<8|(l[14]&255)<<16|(l[15]&255)<<24,se=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ge=d[16]&255|(d[17]&255)<<8|(d[18]&255)<<16|(d[19]&255)<<24,he=d[20]&255|(d[21]&255)<<8|(d[22]&255)<<16|(d[23]&255)<<24,ie=d[24]&255|(d[25]&255)<<8|(d[26]&255)<<16|(d[27]&255)<<24,ue=d[28]&255|(d[29]&255)<<8|(d[30]&255)<<16|(d[31]&255)<<24,ae=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,j=p,X=x,H=A,W=B,Q=N,q=Y,_=L,v=Be,P=$,U=re,C=se,k=ge,ee=he,ye=ie,xe=ue,me=ae,m,_e=0;_e<20;_e+=2)m=j+ee|0,Q^=m<<7|m>>>32-7,m=Q+j|0,P^=m<<9|m>>>32-9,m=P+Q|0,ee^=m<<13|m>>>32-13,m=ee+P|0,j^=m<<18|m>>>32-18,m=q+X|0,U^=m<<7|m>>>32-7,m=U+q|0,ye^=m<<9|m>>>32-9,m=ye+U|0,X^=m<<13|m>>>32-13,m=X+ye|0,q^=m<<18|m>>>32-18,m=C+_|0,xe^=m<<7|m>>>32-7,m=xe+C|0,H^=m<<9|m>>>32-9,m=H+xe|0,_^=m<<13|m>>>32-13,m=_+H|0,C^=m<<18|m>>>32-18,m=me+k|0,W^=m<<7|m>>>32-7,m=W+me|0,v^=m<<9|m>>>32-9,m=v+W|0,k^=m<<13|m>>>32-13,m=k+v|0,me^=m<<18|m>>>32-18,m=j+W|0,X^=m<<7|m>>>32-7,m=X+j|0,H^=m<<9|m>>>32-9,m=H+X|0,W^=m<<13|m>>>32-13,m=W+H|0,j^=m<<18|m>>>32-18,m=q+Q|0,_^=m<<7|m>>>32-7,m=_+q|0,v^=m<<9|m>>>32-9,m=v+_|0,Q^=m<<13|m>>>32-13,m=Q+v|0,q^=m<<18|m>>>32-18,m=C+U|0,k^=m<<7|m>>>32-7,m=k+C|0,P^=m<<9|m>>>32-9,m=P+k|0,U^=m<<13|m>>>32-13,m=U+P|0,C^=m<<18|m>>>32-18,m=me+xe|0,ee^=m<<7|m>>>32-7,m=ee+me|0,ye^=m<<9|m>>>32-9,m=ye+ee|0,xe^=m<<13|m>>>32-13,m=xe+ye|0,me^=m<<18|m>>>32-18;u[0]=j>>>0&255,u[1]=j>>>8&255,u[2]=j>>>16&255,u[3]=j>>>24&255,u[4]=q>>>0&255,u[5]=q>>>8&255,u[6]=q>>>16&255,u[7]=q>>>24&255,u[8]=C>>>0&255,u[9]=C>>>8&255,u[10]=C>>>16&255,u[11]=C>>>24&255,u[12]=me>>>0&255,u[13]=me>>>8&255,u[14]=me>>>16&255,u[15]=me>>>24&255,u[16]=_>>>0&255,u[17]=_>>>8&255,u[18]=_>>>16&255,u[19]=_>>>24&255,u[20]=v>>>0&255,u[21]=v>>>8&255,u[22]=v>>>16&255,u[23]=v>>>24&255,u[24]=P>>>0&255,u[25]=P>>>8&255,u[26]=P>>>16&255,u[27]=P>>>24&255,u[28]=U>>>0&255,u[29]=U>>>8&255,u[30]=U>>>16&255,u[31]=U>>>24&255}function E(u,l,d,i){R(u,l,d,i)}function K(u,l,d,i){M(u,l,d,i)}var D=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function F(u,l,d,i,p,x,A){var B=new Uint8Array(16),N=new Uint8Array(64),Y,L;for(L=0;L<16;L++)B[L]=0;for(L=0;L<8;L++)B[L]=x[L];for(;p>=64;){for(E(N,B,A,D),L=0;L<64;L++)u[l+L]=d[i+L]^N[L];for(Y=1,L=8;L<16;L++)Y=Y+(B[L]&255)|0,B[L]=Y&255,Y>>>=8;p-=64,l+=64,i+=64}if(p>0)for(E(N,B,A,D),L=0;L<p;L++)u[l+L]=d[i+L]^N[L];return 0}function J(u,l,d,i,p){var x=new Uint8Array(16),A=new Uint8Array(64),B,N;for(N=0;N<16;N++)x[N]=0;for(N=0;N<8;N++)x[N]=i[N];for(;d>=64;){for(E(A,x,p,D),N=0;N<64;N++)u[l+N]=A[N];for(B=1,N=8;N<16;N++)B=B+(x[N]&255)|0,x[N]=B&255,B>>>=8;d-=64,l+=64}if(d>0)for(E(A,x,p,D),N=0;N<d;N++)u[l+N]=A[N];return 0}function G(u,l,d,i,p){var x=new Uint8Array(32);K(x,i,p,D);for(var A=new Uint8Array(8),B=0;B<8;B++)A[B]=i[B+16];return J(u,l,d,A,x)}function oe(u,l,d,i,p,x,A){var B=new Uint8Array(32);K(B,x,A,D);for(var N=new Uint8Array(8),Y=0;Y<8;Y++)N[Y]=x[Y+16];return F(u,l,d,i,p,N,B)}var de=function(u){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var l,d,i,p,x,A,B,N;l=u[0]&255|(u[1]&255)<<8,this.r[0]=l&8191,d=u[2]&255|(u[3]&255)<<8,this.r[1]=(l>>>13|d<<3)&8191,i=u[4]&255|(u[5]&255)<<8,this.r[2]=(d>>>10|i<<6)&7939,p=u[6]&255|(u[7]&255)<<8,this.r[3]=(i>>>7|p<<9)&8191,x=u[8]&255|(u[9]&255)<<8,this.r[4]=(p>>>4|x<<12)&255,this.r[5]=x>>>1&8190,A=u[10]&255|(u[11]&255)<<8,this.r[6]=(x>>>14|A<<2)&8191,B=u[12]&255|(u[13]&255)<<8,this.r[7]=(A>>>11|B<<5)&8065,N=u[14]&255|(u[15]&255)<<8,this.r[8]=(B>>>8|N<<8)&8191,this.r[9]=N>>>5&127,this.pad[0]=u[16]&255|(u[17]&255)<<8,this.pad[1]=u[18]&255|(u[19]&255)<<8,this.pad[2]=u[20]&255|(u[21]&255)<<8,this.pad[3]=u[22]&255|(u[23]&255)<<8,this.pad[4]=u[24]&255|(u[25]&255)<<8,this.pad[5]=u[26]&255|(u[27]&255)<<8,this.pad[6]=u[28]&255|(u[29]&255)<<8,this.pad[7]=u[30]&255|(u[31]&255)<<8};de.prototype.blocks=function(u,l,d){for(var i=this.fin?0:2048,p,x,A,B,N,Y,L,Be,$,re,se,ge,he,ie,ue,ae,j,X,H,W=this.h[0],Q=this.h[1],q=this.h[2],_=this.h[3],v=this.h[4],P=this.h[5],U=this.h[6],C=this.h[7],k=this.h[8],ee=this.h[9],ye=this.r[0],xe=this.r[1],me=this.r[2],m=this.r[3],_e=this.r[4],Ce=this.r[5],Ie=this.r[6],we=this.r[7],Se=this.r[8],Ue=this.r[9];d>=16;)p=u[l+0]&255|(u[l+1]&255)<<8,W+=p&8191,x=u[l+2]&255|(u[l+3]&255)<<8,Q+=(p>>>13|x<<3)&8191,A=u[l+4]&255|(u[l+5]&255)<<8,q+=(x>>>10|A<<6)&8191,B=u[l+6]&255|(u[l+7]&255)<<8,_+=(A>>>7|B<<9)&8191,N=u[l+8]&255|(u[l+9]&255)<<8,v+=(B>>>4|N<<12)&8191,P+=N>>>1&8191,Y=u[l+10]&255|(u[l+11]&255)<<8,U+=(N>>>14|Y<<2)&8191,L=u[l+12]&255|(u[l+13]&255)<<8,C+=(Y>>>11|L<<5)&8191,Be=u[l+14]&255|(u[l+15]&255)<<8,k+=(L>>>8|Be<<8)&8191,ee+=Be>>>5|i,$=0,re=$,re+=W*ye,re+=Q*(5*Ue),re+=q*(5*Se),re+=_*(5*we),re+=v*(5*Ie),$=re>>>13,re&=8191,re+=P*(5*Ce),re+=U*(5*_e),re+=C*(5*m),re+=k*(5*me),re+=ee*(5*xe),$+=re>>>13,re&=8191,se=$,se+=W*xe,se+=Q*ye,se+=q*(5*Ue),se+=_*(5*Se),se+=v*(5*we),$=se>>>13,se&=8191,se+=P*(5*Ie),se+=U*(5*Ce),se+=C*(5*_e),se+=k*(5*m),se+=ee*(5*me),$+=se>>>13,se&=8191,ge=$,ge+=W*me,ge+=Q*xe,ge+=q*ye,ge+=_*(5*Ue),ge+=v*(5*Se),$=ge>>>13,ge&=8191,ge+=P*(5*we),ge+=U*(5*Ie),ge+=C*(5*Ce),ge+=k*(5*_e),ge+=ee*(5*m),$+=ge>>>13,ge&=8191,he=$,he+=W*m,he+=Q*me,he+=q*xe,he+=_*ye,he+=v*(5*Ue),$=he>>>13,he&=8191,he+=P*(5*Se),he+=U*(5*we),he+=C*(5*Ie),he+=k*(5*Ce),he+=ee*(5*_e),$+=he>>>13,he&=8191,ie=$,ie+=W*_e,ie+=Q*m,ie+=q*me,ie+=_*xe,ie+=v*ye,$=ie>>>13,ie&=8191,ie+=P*(5*Ue),ie+=U*(5*Se),ie+=C*(5*we),ie+=k*(5*Ie),ie+=ee*(5*Ce),$+=ie>>>13,ie&=8191,ue=$,ue+=W*Ce,ue+=Q*_e,ue+=q*m,ue+=_*me,ue+=v*xe,$=ue>>>13,ue&=8191,ue+=P*ye,ue+=U*(5*Ue),ue+=C*(5*Se),ue+=k*(5*we),ue+=ee*(5*Ie),$+=ue>>>13,ue&=8191,ae=$,ae+=W*Ie,ae+=Q*Ce,ae+=q*_e,ae+=_*m,ae+=v*me,$=ae>>>13,ae&=8191,ae+=P*xe,ae+=U*ye,ae+=C*(5*Ue),ae+=k*(5*Se),ae+=ee*(5*we),$+=ae>>>13,ae&=8191,j=$,j+=W*we,j+=Q*Ie,j+=q*Ce,j+=_*_e,j+=v*m,$=j>>>13,j&=8191,j+=P*me,j+=U*xe,j+=C*ye,j+=k*(5*Ue),j+=ee*(5*Se),$+=j>>>13,j&=8191,X=$,X+=W*Se,X+=Q*we,X+=q*Ie,X+=_*Ce,X+=v*_e,$=X>>>13,X&=8191,X+=P*m,X+=U*me,X+=C*xe,X+=k*ye,X+=ee*(5*Ue),$+=X>>>13,X&=8191,H=$,H+=W*Ue,H+=Q*Se,H+=q*we,H+=_*Ie,H+=v*Ce,$=H>>>13,H&=8191,H+=P*_e,H+=U*m,H+=C*me,H+=k*xe,H+=ee*ye,$+=H>>>13,H&=8191,$=($<<2)+$|0,$=$+re|0,re=$&8191,$=$>>>13,se+=$,W=re,Q=se,q=ge,_=he,v=ie,P=ue,U=ae,C=j,k=X,ee=H,l+=16,d-=16;this.h[0]=W,this.h[1]=Q,this.h[2]=q,this.h[3]=_,this.h[4]=v,this.h[5]=P,this.h[6]=U,this.h[7]=C,this.h[8]=k,this.h[9]=ee},de.prototype.finish=function(u,l){var d=new Uint16Array(10),i,p,x,A;if(this.leftover){for(A=this.leftover,this.buffer[A++]=1;A<16;A++)this.buffer[A]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(i=this.h[1]>>>13,this.h[1]&=8191,A=2;A<10;A++)this.h[A]+=i,i=this.h[A]>>>13,this.h[A]&=8191;for(this.h[0]+=i*5,i=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=i,i=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=i,d[0]=this.h[0]+5,i=d[0]>>>13,d[0]&=8191,A=1;A<10;A++)d[A]=this.h[A]+i,i=d[A]>>>13,d[A]&=8191;for(d[9]-=1<<13,p=(i^1)-1,A=0;A<10;A++)d[A]&=p;for(p=~p,A=0;A<10;A++)this.h[A]=this.h[A]&p|d[A];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,x=this.h[0]+this.pad[0],this.h[0]=x&65535,A=1;A<8;A++)x=(this.h[A]+this.pad[A]|0)+(x>>>16)|0,this.h[A]=x&65535;u[l+0]=this.h[0]>>>0&255,u[l+1]=this.h[0]>>>8&255,u[l+2]=this.h[1]>>>0&255,u[l+3]=this.h[1]>>>8&255,u[l+4]=this.h[2]>>>0&255,u[l+5]=this.h[2]>>>8&255,u[l+6]=this.h[3]>>>0&255,u[l+7]=this.h[3]>>>8&255,u[l+8]=this.h[4]>>>0&255,u[l+9]=this.h[4]>>>8&255,u[l+10]=this.h[5]>>>0&255,u[l+11]=this.h[5]>>>8&255,u[l+12]=this.h[6]>>>0&255,u[l+13]=this.h[6]>>>8&255,u[l+14]=this.h[7]>>>0&255,u[l+15]=this.h[7]>>>8&255},de.prototype.update=function(u,l,d){var i,p;if(this.leftover){for(p=16-this.leftover,p>d&&(p=d),i=0;i<p;i++)this.buffer[this.leftover+i]=u[l+i];if(d-=p,l+=p,this.leftover+=p,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(d>=16&&(p=d-d%16,this.blocks(u,l,p),l+=p,d-=p),d){for(i=0;i<d;i++)this.buffer[this.leftover+i]=u[l+i];this.leftover+=d}};function ce(u,l,d,i,p,x){var A=new de(x);return A.update(d,i,p),A.finish(u,l),0}function Pe(u,l,d,i,p,x){var A=new Uint8Array(16);return ce(A,0,d,i,p,x),T(u,l,A,0)}function Oe(u,l,d,i,p){var x;if(d<32)return-1;for(oe(u,0,l,0,d,i,p),ce(u,16,u,32,d-32,u),x=0;x<16;x++)u[x]=0;return 0}function at(u,l,d,i,p){var x,A=new Uint8Array(32);if(d<32||(G(A,0,32,i,p),Pe(l,16,l,32,d-32,A)!==0))return-1;for(oe(u,0,l,0,d,i,p),x=0;x<32;x++)u[x]=0;return 0}function z(u,l){var d;for(d=0;d<16;d++)u[d]=l[d]|0}function V(u){var l,d,i=1;for(l=0;l<16;l++)d=u[l]+i+65535,i=Math.floor(d/65536),u[l]=d-i*65536;u[0]+=i-1+37*(i-1)}function le(u,l,d){for(var i,p=~(d-1),x=0;x<16;x++)i=p&(u[x]^l[x]),u[x]^=i,l[x]^=i}function Re(u,l){var d,i,p,x=t(),A=t();for(d=0;d<16;d++)A[d]=l[d];for(V(A),V(A),V(A),i=0;i<2;i++){for(x[0]=A[0]-65517,d=1;d<15;d++)x[d]=A[d]-65535-(x[d-1]>>16&1),x[d-1]&=65535;x[15]=A[15]-32767-(x[14]>>16&1),p=x[15]>>16&1,x[14]&=65535,le(A,x,1-p)}for(d=0;d<16;d++)u[2*d]=A[d]&255,u[2*d+1]=A[d]>>8}function ke(u,l){var d=new Uint8Array(32),i=new Uint8Array(32);return Re(d,u),Re(i,l),S(d,0,i,0)}function Ze(u){var l=new Uint8Array(32);return Re(l,u),l[0]&1}function dt(u,l){var d;for(d=0;d<16;d++)u[d]=l[2*d]+(l[2*d+1]<<8);u[15]&=32767}function Me(u,l,d){for(var i=0;i<16;i++)u[i]=l[i]+d[i]}function rt(u,l,d){for(var i=0;i<16;i++)u[i]=l[i]-d[i]}function pe(u,l,d){var i,p,x=0,A=0,B=0,N=0,Y=0,L=0,Be=0,$=0,re=0,se=0,ge=0,he=0,ie=0,ue=0,ae=0,j=0,X=0,H=0,W=0,Q=0,q=0,_=0,v=0,P=0,U=0,C=0,k=0,ee=0,ye=0,xe=0,me=0,m=d[0],_e=d[1],Ce=d[2],Ie=d[3],we=d[4],Se=d[5],Ue=d[6],Je=d[7],ze=d[8],Ve=d[9],We=d[10],Qe=d[11],ot=d[12],lt=d[13],pt=d[14],ht=d[15];i=l[0],x+=i*m,A+=i*_e,B+=i*Ce,N+=i*Ie,Y+=i*we,L+=i*Se,Be+=i*Ue,$+=i*Je,re+=i*ze,se+=i*Ve,ge+=i*We,he+=i*Qe,ie+=i*ot,ue+=i*lt,ae+=i*pt,j+=i*ht,i=l[1],A+=i*m,B+=i*_e,N+=i*Ce,Y+=i*Ie,L+=i*we,Be+=i*Se,$+=i*Ue,re+=i*Je,se+=i*ze,ge+=i*Ve,he+=i*We,ie+=i*Qe,ue+=i*ot,ae+=i*lt,j+=i*pt,X+=i*ht,i=l[2],B+=i*m,N+=i*_e,Y+=i*Ce,L+=i*Ie,Be+=i*we,$+=i*Se,re+=i*Ue,se+=i*Je,ge+=i*ze,he+=i*Ve,ie+=i*We,ue+=i*Qe,ae+=i*ot,j+=i*lt,X+=i*pt,H+=i*ht,i=l[3],N+=i*m,Y+=i*_e,L+=i*Ce,Be+=i*Ie,$+=i*we,re+=i*Se,se+=i*Ue,ge+=i*Je,he+=i*ze,ie+=i*Ve,ue+=i*We,ae+=i*Qe,j+=i*ot,X+=i*lt,H+=i*pt,W+=i*ht,i=l[4],Y+=i*m,L+=i*_e,Be+=i*Ce,$+=i*Ie,re+=i*we,se+=i*Se,ge+=i*Ue,he+=i*Je,ie+=i*ze,ue+=i*Ve,ae+=i*We,j+=i*Qe,X+=i*ot,H+=i*lt,W+=i*pt,Q+=i*ht,i=l[5],L+=i*m,Be+=i*_e,$+=i*Ce,re+=i*Ie,se+=i*we,ge+=i*Se,he+=i*Ue,ie+=i*Je,ue+=i*ze,ae+=i*Ve,j+=i*We,X+=i*Qe,H+=i*ot,W+=i*lt,Q+=i*pt,q+=i*ht,i=l[6],Be+=i*m,$+=i*_e,re+=i*Ce,se+=i*Ie,ge+=i*we,he+=i*Se,ie+=i*Ue,ue+=i*Je,ae+=i*ze,j+=i*Ve,X+=i*We,H+=i*Qe,W+=i*ot,Q+=i*lt,q+=i*pt,_+=i*ht,i=l[7],$+=i*m,re+=i*_e,se+=i*Ce,ge+=i*Ie,he+=i*we,ie+=i*Se,ue+=i*Ue,ae+=i*Je,j+=i*ze,X+=i*Ve,H+=i*We,W+=i*Qe,Q+=i*ot,q+=i*lt,_+=i*pt,v+=i*ht,i=l[8],re+=i*m,se+=i*_e,ge+=i*Ce,he+=i*Ie,ie+=i*we,ue+=i*Se,ae+=i*Ue,j+=i*Je,X+=i*ze,H+=i*Ve,W+=i*We,Q+=i*Qe,q+=i*ot,_+=i*lt,v+=i*pt,P+=i*ht,i=l[9],se+=i*m,ge+=i*_e,he+=i*Ce,ie+=i*Ie,ue+=i*we,ae+=i*Se,j+=i*Ue,X+=i*Je,H+=i*ze,W+=i*Ve,Q+=i*We,q+=i*Qe,_+=i*ot,v+=i*lt,P+=i*pt,U+=i*ht,i=l[10],ge+=i*m,he+=i*_e,ie+=i*Ce,ue+=i*Ie,ae+=i*we,j+=i*Se,X+=i*Ue,H+=i*Je,W+=i*ze,Q+=i*Ve,q+=i*We,_+=i*Qe,v+=i*ot,P+=i*lt,U+=i*pt,C+=i*ht,i=l[11],he+=i*m,ie+=i*_e,ue+=i*Ce,ae+=i*Ie,j+=i*we,X+=i*Se,H+=i*Ue,W+=i*Je,Q+=i*ze,q+=i*Ve,_+=i*We,v+=i*Qe,P+=i*ot,U+=i*lt,C+=i*pt,k+=i*ht,i=l[12],ie+=i*m,ue+=i*_e,ae+=i*Ce,j+=i*Ie,X+=i*we,H+=i*Se,W+=i*Ue,Q+=i*Je,q+=i*ze,_+=i*Ve,v+=i*We,P+=i*Qe,U+=i*ot,C+=i*lt,k+=i*pt,ee+=i*ht,i=l[13],ue+=i*m,ae+=i*_e,j+=i*Ce,X+=i*Ie,H+=i*we,W+=i*Se,Q+=i*Ue,q+=i*Je,_+=i*ze,v+=i*Ve,P+=i*We,U+=i*Qe,C+=i*ot,k+=i*lt,ee+=i*pt,ye+=i*ht,i=l[14],ae+=i*m,j+=i*_e,X+=i*Ce,H+=i*Ie,W+=i*we,Q+=i*Se,q+=i*Ue,_+=i*Je,v+=i*ze,P+=i*Ve,U+=i*We,C+=i*Qe,k+=i*ot,ee+=i*lt,ye+=i*pt,xe+=i*ht,i=l[15],j+=i*m,X+=i*_e,H+=i*Ce,W+=i*Ie,Q+=i*we,q+=i*Se,_+=i*Ue,v+=i*Je,P+=i*ze,U+=i*Ve,C+=i*We,k+=i*Qe,ee+=i*ot,ye+=i*lt,xe+=i*pt,me+=i*ht,x+=38*X,A+=38*H,B+=38*W,N+=38*Q,Y+=38*q,L+=38*_,Be+=38*v,$+=38*P,re+=38*U,se+=38*C,ge+=38*k,he+=38*ee,ie+=38*ye,ue+=38*xe,ae+=38*me,p=1,i=x+p+65535,p=Math.floor(i/65536),x=i-p*65536,i=A+p+65535,p=Math.floor(i/65536),A=i-p*65536,i=B+p+65535,p=Math.floor(i/65536),B=i-p*65536,i=N+p+65535,p=Math.floor(i/65536),N=i-p*65536,i=Y+p+65535,p=Math.floor(i/65536),Y=i-p*65536,i=L+p+65535,p=Math.floor(i/65536),L=i-p*65536,i=Be+p+65535,p=Math.floor(i/65536),Be=i-p*65536,i=$+p+65535,p=Math.floor(i/65536),$=i-p*65536,i=re+p+65535,p=Math.floor(i/65536),re=i-p*65536,i=se+p+65535,p=Math.floor(i/65536),se=i-p*65536,i=ge+p+65535,p=Math.floor(i/65536),ge=i-p*65536,i=he+p+65535,p=Math.floor(i/65536),he=i-p*65536,i=ie+p+65535,p=Math.floor(i/65536),ie=i-p*65536,i=ue+p+65535,p=Math.floor(i/65536),ue=i-p*65536,i=ae+p+65535,p=Math.floor(i/65536),ae=i-p*65536,i=j+p+65535,p=Math.floor(i/65536),j=i-p*65536,x+=p-1+37*(p-1),p=1,i=x+p+65535,p=Math.floor(i/65536),x=i-p*65536,i=A+p+65535,p=Math.floor(i/65536),A=i-p*65536,i=B+p+65535,p=Math.floor(i/65536),B=i-p*65536,i=N+p+65535,p=Math.floor(i/65536),N=i-p*65536,i=Y+p+65535,p=Math.floor(i/65536),Y=i-p*65536,i=L+p+65535,p=Math.floor(i/65536),L=i-p*65536,i=Be+p+65535,p=Math.floor(i/65536),Be=i-p*65536,i=$+p+65535,p=Math.floor(i/65536),$=i-p*65536,i=re+p+65535,p=Math.floor(i/65536),re=i-p*65536,i=se+p+65535,p=Math.floor(i/65536),se=i-p*65536,i=ge+p+65535,p=Math.floor(i/65536),ge=i-p*65536,i=he+p+65535,p=Math.floor(i/65536),he=i-p*65536,i=ie+p+65535,p=Math.floor(i/65536),ie=i-p*65536,i=ue+p+65535,p=Math.floor(i/65536),ue=i-p*65536,i=ae+p+65535,p=Math.floor(i/65536),ae=i-p*65536,i=j+p+65535,p=Math.floor(i/65536),j=i-p*65536,x+=p-1+37*(p-1),u[0]=x,u[1]=A,u[2]=B,u[3]=N,u[4]=Y,u[5]=L,u[6]=Be,u[7]=$,u[8]=re,u[9]=se,u[10]=ge,u[11]=he,u[12]=ie,u[13]=ue,u[14]=ae,u[15]=j}function nt(u,l){pe(u,l,l)}function Yr(u,l){var d=t(),i;for(i=0;i<16;i++)d[i]=l[i];for(i=253;i>=0;i--)nt(d,d),i!==2&&i!==4&&pe(d,d,l);for(i=0;i<16;i++)u[i]=d[i]}function Vt(u,l){var d=t(),i;for(i=0;i<16;i++)d[i]=l[i];for(i=250;i>=0;i--)nt(d,d),i!==1&&pe(d,d,l);for(i=0;i<16;i++)u[i]=d[i]}function Xr(u,l,d){var i=new Uint8Array(32),p=new Float64Array(80),x,A,B=t(),N=t(),Y=t(),L=t(),Be=t(),$=t();for(A=0;A<31;A++)i[A]=l[A];for(i[31]=l[31]&127|64,i[0]&=248,dt(p,d),A=0;A<16;A++)N[A]=p[A],L[A]=B[A]=Y[A]=0;for(B[0]=L[0]=1,A=254;A>=0;--A)x=i[A>>>3]>>>(A&7)&1,le(B,N,x),le(Y,L,x),Me(Be,B,Y),rt(B,B,Y),Me(Y,N,L),rt(N,N,L),nt(L,Be),nt($,B),pe(B,Y,B),pe(Y,N,Be),Me(Be,B,Y),rt(B,B,Y),nt(N,B),rt(Y,L,$),pe(B,Y,c),Me(B,B,L),pe(Y,Y,B),pe(B,L,$),pe(L,N,p),nt(N,Be),le(B,N,x),le(Y,L,x);for(A=0;A<16;A++)p[A+16]=B[A],p[A+32]=Y[A],p[A+48]=N[A],p[A+64]=L[A];var re=p.subarray(32),se=p.subarray(16);return Yr(re,re),pe(se,se,re),Re(u,se),0}function Mt(u,l){return Xr(u,l,o)}function Tr(u,l){return e(l,32),Mt(u,l)}function Rn(u,l,d){var i=new Uint8Array(32);return Xr(i,d,l),K(u,n,i,D)}var It=Oe,Zr=at;function Jn(u,l,d,i,p,x){var A=new Uint8Array(32);return Rn(A,p,x),It(u,l,d,i,A)}function bs(u,l,d,i,p,x){var A=new Uint8Array(32);return Rn(A,p,x),Zr(u,l,d,i,A)}var Bo=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ru(u,l,d,i){for(var p=new Int32Array(16),x=new Int32Array(16),A,B,N,Y,L,Be,$,re,se,ge,he,ie,ue,ae,j,X,H,W,Q,q,_,v,P,U,C,k,ee=u[0],ye=u[1],xe=u[2],me=u[3],m=u[4],_e=u[5],Ce=u[6],Ie=u[7],we=l[0],Se=l[1],Ue=l[2],Je=l[3],ze=l[4],Ve=l[5],We=l[6],Qe=l[7],ot=0;i>=128;){for(Q=0;Q<16;Q++)q=8*Q+ot,p[Q]=d[q+0]<<24|d[q+1]<<16|d[q+2]<<8|d[q+3],x[Q]=d[q+4]<<24|d[q+5]<<16|d[q+6]<<8|d[q+7];for(Q=0;Q<80;Q++)if(A=ee,B=ye,N=xe,Y=me,L=m,Be=_e,$=Ce,re=Ie,se=we,ge=Se,he=Ue,ie=Je,ue=ze,ae=Ve,j=We,X=Qe,_=Ie,v=Qe,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=(m>>>14|ze<<32-14)^(m>>>18|ze<<32-18)^(ze>>>41-32|m<<32-(41-32)),v=(ze>>>14|m<<32-14)^(ze>>>18|m<<32-18)^(m>>>41-32|ze<<32-(41-32)),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=m&_e^~m&Ce,v=ze&Ve^~ze&We,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=Bo[Q*2],v=Bo[Q*2+1],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=p[Q%16],v=x[Q%16],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,H=C&65535|k<<16,W=P&65535|U<<16,_=H,v=W,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=(ee>>>28|we<<32-28)^(we>>>34-32|ee<<32-(34-32))^(we>>>39-32|ee<<32-(39-32)),v=(we>>>28|ee<<32-28)^(ee>>>34-32|we<<32-(34-32))^(ee>>>39-32|we<<32-(39-32)),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,_=ee&ye^ee&xe^ye&xe,v=we&Se^we&Ue^Se&Ue,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,re=C&65535|k<<16,X=P&65535|U<<16,_=Y,v=ie,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=H,v=W,P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,Y=C&65535|k<<16,ie=P&65535|U<<16,ye=A,xe=B,me=N,m=Y,_e=L,Ce=Be,Ie=$,ee=re,Se=se,Ue=ge,Je=he,ze=ie,Ve=ue,We=ae,Qe=j,we=X,Q%16===15)for(q=0;q<16;q++)_=p[q],v=x[q],P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=p[(q+9)%16],v=x[(q+9)%16],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,H=p[(q+1)%16],W=x[(q+1)%16],_=(H>>>1|W<<32-1)^(H>>>8|W<<32-8)^H>>>7,v=(W>>>1|H<<32-1)^(W>>>8|H<<32-8)^(W>>>7|H<<32-7),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,H=p[(q+14)%16],W=x[(q+14)%16],_=(H>>>19|W<<32-19)^(W>>>61-32|H<<32-(61-32))^H>>>6,v=(W>>>19|H<<32-19)^(H>>>61-32|W<<32-(61-32))^(W>>>6|H<<32-6),P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,p[q]=C&65535|k<<16,x[q]=P&65535|U<<16;_=ee,v=we,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[0],v=l[0],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[0]=ee=C&65535|k<<16,l[0]=we=P&65535|U<<16,_=ye,v=Se,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[1],v=l[1],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[1]=ye=C&65535|k<<16,l[1]=Se=P&65535|U<<16,_=xe,v=Ue,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[2],v=l[2],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[2]=xe=C&65535|k<<16,l[2]=Ue=P&65535|U<<16,_=me,v=Je,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[3],v=l[3],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[3]=me=C&65535|k<<16,l[3]=Je=P&65535|U<<16,_=m,v=ze,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[4],v=l[4],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[4]=m=C&65535|k<<16,l[4]=ze=P&65535|U<<16,_=_e,v=Ve,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[5],v=l[5],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[5]=_e=C&65535|k<<16,l[5]=Ve=P&65535|U<<16,_=Ce,v=We,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[6],v=l[6],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[6]=Ce=C&65535|k<<16,l[6]=We=P&65535|U<<16,_=Ie,v=Qe,P=v&65535,U=v>>>16,C=_&65535,k=_>>>16,_=u[7],v=l[7],P+=v&65535,U+=v>>>16,C+=_&65535,k+=_>>>16,U+=P>>>16,C+=U>>>16,k+=C>>>16,u[7]=Ie=C&65535|k<<16,l[7]=Qe=P&65535|U<<16,ot+=128,i-=128}return i}function Pn(u,l,d){var i=new Int32Array(8),p=new Int32Array(8),x=new Uint8Array(256),A,B=d;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,p[0]=4089235720,p[1]=2227873595,p[2]=4271175723,p[3]=1595750129,p[4]=2917565137,p[5]=725511199,p[6]=4215389547,p[7]=327033209,ru(i,p,l,d),d%=128,A=0;A<d;A++)x[A]=l[B-d+A];for(x[d]=128,d=256-128*(d<112?1:0),x[d-9]=0,b(x,d-8,B/536870912|0,B<<3),ru(i,p,x,d),A=0;A<8;A++)b(u,8*A,i[A],p[A]);return 0}function As(u,l){var d=t(),i=t(),p=t(),x=t(),A=t(),B=t(),N=t(),Y=t(),L=t();rt(d,u[1],u[0]),rt(L,l[1],l[0]),pe(d,d,L),Me(i,u[0],u[1]),Me(L,l[0],l[1]),pe(i,i,L),pe(p,u[3],l[3]),pe(p,p,h),pe(x,u[2],l[2]),Me(x,x,x),rt(A,i,d),rt(B,x,p),Me(N,x,p),Me(Y,i,d),pe(u[0],A,B),pe(u[1],Y,N),pe(u[2],N,B),pe(u[3],A,Y)}function nu(u,l,d){var i;for(i=0;i<4;i++)le(u[i],l[i],d)}function Gi(u,l){var d=t(),i=t(),p=t();Yr(p,l[2]),pe(d,l[0],p),pe(i,l[1],p),Re(u,i),u[31]^=Ze(d)<<7}function Fi(u,l,d){var i,p;for(z(u[0],s),z(u[1],a),z(u[2],a),z(u[3],s),p=255;p>=0;--p)i=d[p/8|0]>>(p&7)&1,nu(u,l,i),As(l,u),As(u,u),nu(u,l,i)}function ws(u,l){var d=[t(),t(),t(),t()];z(d[0],g),z(d[1],y),z(d[2],a),pe(d[3],g,y),Fi(u,d,l)}function $i(u,l,d){var i=new Uint8Array(64),p=[t(),t(),t(),t()],x;for(d||e(l,32),Pn(i,l,32),i[0]&=248,i[31]&=127,i[31]|=64,ws(p,i),Gi(u,p),x=0;x<32;x++)l[x+32]=u[x];return 0}var Ts=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Ki(u,l){var d,i,p,x;for(i=63;i>=32;--i){for(d=0,p=i-32,x=i-12;p<x;++p)l[p]+=d-16*l[i]*Ts[p-(i-32)],d=Math.floor((l[p]+128)/256),l[p]-=d*256;l[p]+=d,l[i]=0}for(d=0,p=0;p<32;p++)l[p]+=d-(l[31]>>4)*Ts[p],d=l[p]>>8,l[p]&=255;for(p=0;p<32;p++)l[p]-=d*Ts[p];for(i=0;i<32;i++)l[i+1]+=l[i]>>8,u[i]=l[i]&255}function ji(u){var l=new Float64Array(64),d;for(d=0;d<64;d++)l[d]=u[d];for(d=0;d<64;d++)u[d]=0;Ki(u,l)}function ou(u,l,d,i){var p=new Uint8Array(64),x=new Uint8Array(64),A=new Uint8Array(64),B,N,Y=new Float64Array(64),L=[t(),t(),t(),t()];Pn(p,i,32),p[0]&=248,p[31]&=127,p[31]|=64;var Be=d+64;for(B=0;B<d;B++)u[64+B]=l[B];for(B=0;B<32;B++)u[32+B]=p[32+B];for(Pn(A,u.subarray(32),d+32),ji(A),ws(L,A),Gi(u,L),B=32;B<64;B++)u[B]=i[B];for(Pn(x,u,d+64),ji(x),B=0;B<64;B++)Y[B]=0;for(B=0;B<32;B++)Y[B]=A[B];for(B=0;B<32;B++)for(N=0;N<32;N++)Y[B+N]+=x[B]*p[N];return Ki(u.subarray(32),Y),Be}function $p(u,l){var d=t(),i=t(),p=t(),x=t(),A=t(),B=t(),N=t();return z(u[2],a),dt(u[1],l),nt(p,u[1]),pe(x,p,f),rt(p,p,u[2]),Me(x,u[2],x),nt(A,x),nt(B,A),pe(N,B,A),pe(d,N,p),pe(d,d,x),Vt(d,d),pe(d,d,p),pe(d,d,x),pe(d,d,x),pe(u[0],d,x),nt(i,u[0]),pe(i,i,x),ke(i,p)&&pe(u[0],u[0],w),nt(i,u[0]),pe(i,i,x),ke(i,p)?-1:(Ze(u[0])===l[31]>>7&&rt(u[0],s,u[0]),pe(u[3],u[0],u[1]),0)}function Vi(u,l,d,i){var p,x=new Uint8Array(32),A=new Uint8Array(64),B=[t(),t(),t(),t()],N=[t(),t(),t(),t()];if(d<64||$p(N,i))return-1;for(p=0;p<d;p++)u[p]=l[p];for(p=0;p<32;p++)u[p+32]=i[p];if(Pn(A,u,d),ji(A),Fi(B,N,A),ws(N,l.subarray(32)),As(B,N),Gi(x,B),d-=64,S(l,0,x,0)){for(p=0;p<d;p++)u[p]=0;return-1}for(p=0;p<d;p++)u[p]=l[p+64];return d}var Wi=32,_s=24,Co=32,eo=16,Io=32,vs=32,Ro=32,Po=32,Qi=32,su=_s,Kp=Co,jp=eo,_r=64,kn=32,to=64,Yi=32,Xi=64;r.lowlevel={crypto_core_hsalsa20:K,crypto_stream_xor:oe,crypto_stream:G,crypto_stream_salsa20_xor:F,crypto_stream_salsa20:J,crypto_onetimeauth:ce,crypto_onetimeauth_verify:Pe,crypto_verify_16:T,crypto_verify_32:S,crypto_secretbox:Oe,crypto_secretbox_open:at,crypto_scalarmult:Xr,crypto_scalarmult_base:Mt,crypto_box_beforenm:Rn,crypto_box_afternm:It,crypto_box:Jn,crypto_box_open:bs,crypto_box_keypair:Tr,crypto_hash:Pn,crypto_sign:ou,crypto_sign_keypair:$i,crypto_sign_open:Vi,crypto_secretbox_KEYBYTES:Wi,crypto_secretbox_NONCEBYTES:_s,crypto_secretbox_ZEROBYTES:Co,crypto_secretbox_BOXZEROBYTES:eo,crypto_scalarmult_BYTES:Io,crypto_scalarmult_SCALARBYTES:vs,crypto_box_PUBLICKEYBYTES:Ro,crypto_box_SECRETKEYBYTES:Po,crypto_box_BEFORENMBYTES:Qi,crypto_box_NONCEBYTES:su,crypto_box_ZEROBYTES:Kp,crypto_box_BOXZEROBYTES:jp,crypto_sign_BYTES:_r,crypto_sign_PUBLICKEYBYTES:kn,crypto_sign_SECRETKEYBYTES:to,crypto_sign_SEEDBYTES:Yi,crypto_hash_BYTES:Xi,gf:t,D:f,L:Ts,pack25519:Re,unpack25519:dt,M:pe,A:Me,S:nt,Z:rt,pow2523:Vt,add:As,set25519:z,modL:Ki,scalarmult:Fi,scalarbase:ws};function iu(u,l){if(u.length!==Wi)throw new Error("bad key size");if(l.length!==_s)throw new Error("bad nonce size")}function Vp(u,l){if(u.length!==Ro)throw new Error("bad public key size");if(l.length!==Po)throw new Error("bad secret key size")}function Rt(){for(var u=0;u<arguments.length;u++)if(!(arguments[u]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function au(u){for(var l=0;l<u.length;l++)u[l]=0}r.randomBytes=function(u){var l=new Uint8Array(u);return e(l,u),l},r.secretbox=function(u,l,d){Rt(u,l,d),iu(d,l);for(var i=new Uint8Array(Co+u.length),p=new Uint8Array(i.length),x=0;x<u.length;x++)i[x+Co]=u[x];return Oe(p,i,i.length,l,d),p.subarray(eo)},r.secretbox.open=function(u,l,d){Rt(u,l,d),iu(d,l);for(var i=new Uint8Array(eo+u.length),p=new Uint8Array(i.length),x=0;x<u.length;x++)i[x+eo]=u[x];return i.length<32||at(p,i,i.length,l,d)!==0?null:p.subarray(Co)},r.secretbox.keyLength=Wi,r.secretbox.nonceLength=_s,r.secretbox.overheadLength=eo,r.scalarMult=function(u,l){if(Rt(u,l),u.length!==vs)throw new Error("bad n size");if(l.length!==Io)throw new Error("bad p size");var d=new Uint8Array(Io);return Xr(d,u,l),d},r.scalarMult.base=function(u){if(Rt(u),u.length!==vs)throw new Error("bad n size");var l=new Uint8Array(Io);return Mt(l,u),l},r.scalarMult.scalarLength=vs,r.scalarMult.groupElementLength=Io,r.box=function(u,l,d,i){var p=r.box.before(d,i);return r.secretbox(u,l,p)},r.box.before=function(u,l){Rt(u,l),Vp(u,l);var d=new Uint8Array(Qi);return Rn(d,u,l),d},r.box.after=r.secretbox,r.box.open=function(u,l,d,i){var p=r.box.before(d,i);return r.secretbox.open(u,l,p)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var u=new Uint8Array(Ro),l=new Uint8Array(Po);return Tr(u,l),{publicKey:u,secretKey:l}},r.box.keyPair.fromSecretKey=function(u){if(Rt(u),u.length!==Po)throw new Error("bad secret key size");var l=new Uint8Array(Ro);return Mt(l,u),{publicKey:l,secretKey:new Uint8Array(u)}},r.box.publicKeyLength=Ro,r.box.secretKeyLength=Po,r.box.sharedKeyLength=Qi,r.box.nonceLength=su,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(u,l){if(Rt(u,l),l.length!==to)throw new Error("bad secret key size");var d=new Uint8Array(_r+u.length);return ou(d,u,u.length,l),d},r.sign.open=function(u,l){if(Rt(u,l),l.length!==kn)throw new Error("bad public key size");var d=new Uint8Array(u.length),i=Vi(d,u,u.length,l);if(i<0)return null;for(var p=new Uint8Array(i),x=0;x<p.length;x++)p[x]=d[x];return p},r.sign.detached=function(u,l){for(var d=r.sign(u,l),i=new Uint8Array(_r),p=0;p<i.length;p++)i[p]=d[p];return i},r.sign.detached.verify=function(u,l,d){if(Rt(u,l,d),l.length!==_r)throw new Error("bad signature size");if(d.length!==kn)throw new Error("bad public key size");var i=new Uint8Array(_r+u.length),p=new Uint8Array(_r+u.length),x;for(x=0;x<_r;x++)i[x]=l[x];for(x=0;x<u.length;x++)i[x+_r]=u[x];return Vi(p,i,i.length,d)>=0},r.sign.keyPair=function(){var u=new Uint8Array(kn),l=new Uint8Array(to);return $i(u,l),{publicKey:u,secretKey:l}},r.sign.keyPair.fromSecretKey=function(u){if(Rt(u),u.length!==to)throw new Error("bad secret key size");for(var l=new Uint8Array(kn),d=0;d<l.length;d++)l[d]=u[32+d];return{publicKey:l,secretKey:new Uint8Array(u)}},r.sign.keyPair.fromSeed=function(u){if(Rt(u),u.length!==Yi)throw new Error("bad seed size");for(var l=new Uint8Array(kn),d=new Uint8Array(to),i=0;i<32;i++)d[i]=u[i];return $i(l,d,!0),{publicKey:l,secretKey:d}},r.sign.publicKeyLength=kn,r.sign.secretKeyLength=to,r.sign.seedLength=Yi,r.sign.signatureLength=_r,r.hash=function(u){Rt(u);var l=new Uint8Array(Xi);return Pn(l,u,u.length),l},r.hash.hashLength=Xi,r.verify=function(u,l){return Rt(u,l),u.length===0||l.length===0||u.length!==l.length?!1:I(u,0,l,0,u.length)===0},r.setPRNG=function(u){e=u},function(){var u=typeof self<"u"?self.crypto||self.msCrypto:null;if(u&&u.getRandomValues){var l=65536;r.setPRNG(function(d,i){var p,x=new Uint8Array(i);for(p=0;p<i;p+=l)u.getRandomValues(x.subarray(p,p+Math.min(i-p,l)));for(p=0;p<i;p++)d[p]=x[p];au(x)})}else typeof uu<"u"&&(u=qu(),u&&u.randomBytes&&r.setPRNG(function(d,i){var p,x=u.randomBytes(i);for(p=0;p<i;p++)d[p]=x[p];au(x)}))}()})(typeof Ds<"u"&&Ds.exports?Ds.exports:self.nacl=self.nacl||{})});var Ho=fe(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.output=xt.exists=xt.hash=xt.bytes=xt.bool=xt.number=void 0;function Ls(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}xt.number=Ls;function Gu(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}xt.bool=Gu;function xa(r,...t){if(!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}xt.bytes=xa;function Fu(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Ls(r.outputLen),Ls(r.blockLen)}xt.hash=Fu;function $u(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}xt.exists=$u;function Ku(r,t){xa(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}xt.output=Ku;var Gh={number:Ls,bool:Gu,bytes:xa,hash:Fu,exists:$u,output:Ku};xt.default=Gh});var ju=fe(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.crypto=void 0;Hs.crypto={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0}});var Hn=fe(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.randomBytes=Ee.wrapConstructorWithOpts=Ee.wrapConstructor=Ee.checkOpts=Ee.Hash=Ee.concatBytes=Ee.toBytes=Ee.utf8ToBytes=Ee.asyncLoop=Ee.nextTick=Ee.hexToBytes=Ee.bytesToHex=Ee.isLE=Ee.rotr=Ee.createView=Ee.u32=Ee.u8=void 0;var Gs=ju(),Fh=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);Ee.u8=Fh;var $h=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));Ee.u32=$h;var Kh=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);Ee.createView=Kh;var jh=(r,t)=>r<<32-t|r>>>t;Ee.rotr=jh;Ee.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ee.isLE)throw new Error("Non little-endian hardware is not supported");var Vh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Wh(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Vh[r[e]];return t}Ee.bytesToHex=Wh;function Qh(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(r.length/2);for(let e=0;e<t.length;e++){let n=e*2,o=r.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[e]=s}return t}Ee.hexToBytes=Qh;var Yh=async()=>{};Ee.nextTick=Yh;async function Xh(r,t,e){let n=Date.now();for(let o=0;o<r;o++){e(o);let s=Date.now()-n;s>=0&&s<t||(await(0,Ee.nextTick)(),n+=s)}}Ee.asyncLoop=Xh;function Vu(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}Ee.utf8ToBytes=Vu;function Aa(r){if(typeof r=="string"&&(r=Vu(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}Ee.toBytes=Aa;function Zh(...r){if(!r.every(n=>n instanceof Uint8Array))throw new Error("Uint8Array list expected");if(r.length===1)return r[0];let t=r.reduce((n,o)=>n+o.length,0),e=new Uint8Array(t);for(let n=0,o=0;n<r.length;n++){let s=r[n];e.set(s,o),o+=s.length}return e}Ee.concatBytes=Zh;var ba=class{clone(){return this._cloneInto()}};Ee.Hash=ba;var Jh=r=>Object.prototype.toString.call(r)==="[object Object]"&&r.constructor===Object;function e0(r,t){if(t!==void 0&&(typeof t!="object"||!Jh(t)))throw new TypeError("Options should be object or undefined");return Object.assign(r,t)}Ee.checkOpts=e0;function t0(r){let t=n=>r().update(Aa(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}Ee.wrapConstructor=t0;function r0(r){let t=(n,o)=>r(o).update(Aa(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}Ee.wrapConstructorWithOpts=r0;function n0(r=32){if(Gs.crypto.web)return Gs.crypto.web.getRandomValues(new Uint8Array(r));if(Gs.crypto.node)return new Uint8Array(Gs.crypto.node.randomBytes(r).buffer);throw new Error("The environment doesn't have randomBytes function")}Ee.randomBytes=n0});var Qu=fe(Go=>{"use strict";Object.defineProperty(Go,"__esModule",{value:!0});Go.hmac=void 0;var Fs=Ho(),Wu=Hn(),$s=class extends Wu.Hash{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Fs.default.hash(t);let n=(0,Wu.toBytes)(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return Fs.default.exists(this),this.iHash.update(t),this}digestInto(t){Fs.default.exists(this),Fs.default.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},o0=(r,t,e)=>new $s(r,t).update(e).digest();Go.hmac=o0;Go.hmac.create=(r,t)=>new $s(r,t)});var Zu=fe(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.pbkdf2Async=ao.pbkdf2=void 0;var Ks=Ho(),s0=Qu(),io=Hn();function Yu(r,t,e,n){Ks.default.hash(r);let o=(0,io.checkOpts)({dkLen:32,asyncTick:10},n),{c:s,dkLen:a,asyncTick:c}=o;if(Ks.default.number(s),Ks.default.number(a),Ks.default.number(c),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let f=(0,io.toBytes)(t),h=(0,io.toBytes)(e),g=new Uint8Array(a),y=s0.hmac.create(r,f),w=y._cloneInto().update(h);return{c:s,dkLen:a,asyncTick:c,DK:g,PRF:y,PRFSalt:w}}function Xu(r,t,e,n,o){return r.destroy(),t.destroy(),n&&n.destroy(),o.fill(0),e}function i0(r,t,e,n){let{c:o,dkLen:s,DK:a,PRF:c,PRFSalt:f}=Yu(r,t,e,n),h,g=new Uint8Array(4),y=(0,io.createView)(g),w=new Uint8Array(c.outputLen);for(let b=1,I=0;I<s;b++,I+=c.outputLen){let T=a.subarray(I,I+c.outputLen);y.setInt32(0,b,!1),(h=f._cloneInto(h)).update(g).digestInto(w),T.set(w.subarray(0,T.length));for(let S=1;S<o;S++){c._cloneInto(h).update(w).digestInto(w);for(let R=0;R<T.length;R++)T[R]^=w[R]}}return Xu(c,f,a,h,w)}ao.pbkdf2=i0;async function a0(r,t,e,n){let{c:o,dkLen:s,asyncTick:a,DK:c,PRF:f,PRFSalt:h}=Yu(r,t,e,n),g,y=new Uint8Array(4),w=(0,io.createView)(y),b=new Uint8Array(f.outputLen);for(let I=1,T=0;T<s;I++,T+=f.outputLen){let S=c.subarray(T,T+f.outputLen);w.setInt32(0,I,!1),(g=h._cloneInto(g)).update(y).digestInto(b),S.set(b.subarray(0,S.length)),await(0,io.asyncLoop)(o-1,a,R=>{f._cloneInto(g).update(b).digestInto(b);for(let M=0;M<S.length;M++)S[M]^=b[M]})}return Xu(f,h,c,g,b)}ao.pbkdf2Async=a0});var _a=fe(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.SHA2=void 0;var wa=Ho(),Fo=Hn();function c0(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var Ta=class extends Fo.Hash{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,Fo.createView)(this.buffer)}update(t){wa.default.exists(this);let{view:e,buffer:n,blockLen:o}=this;t=(0,Fo.toBytes)(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=(0,Fo.createView)(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){wa.default.exists(this),wa.default.output(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let f=a;f<o;f++)e[f]=0;c0(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=(0,Fo.createView)(t);this.get().forEach((f,h)=>c.setUint32(4*h,f,s))}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};js.SHA2=Ta});var Ju=fe(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.sha256=void 0;var u0=_a(),Yt=Hn(),f0=(r,t,e)=>r&t^~r&e,d0=(r,t,e)=>r&t^r&e^t&e,l0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),sn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),an=new Uint32Array(64),va=class extends u0.SHA2{constructor(){super(64,32,8,!1),this.A=sn[0]|0,this.B=sn[1]|0,this.C=sn[2]|0,this.D=sn[3]|0,this.E=sn[4]|0,this.F=sn[5]|0,this.G=sn[6]|0,this.H=sn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:a,G:c,H:f}=this;return[t,e,n,o,s,a,c,f]}set(t,e,n,o,s,a,c,f){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=c|0,this.H=f|0}process(t,e){for(let y=0;y<16;y++,e+=4)an[y]=t.getUint32(e,!1);for(let y=16;y<64;y++){let w=an[y-15],b=an[y-2],I=(0,Yt.rotr)(w,7)^(0,Yt.rotr)(w,18)^w>>>3,T=(0,Yt.rotr)(b,17)^(0,Yt.rotr)(b,19)^b>>>10;an[y]=T+an[y-7]+I+an[y-16]|0}let{A:n,B:o,C:s,D:a,E:c,F:f,G:h,H:g}=this;for(let y=0;y<64;y++){let w=(0,Yt.rotr)(c,6)^(0,Yt.rotr)(c,11)^(0,Yt.rotr)(c,25),b=g+w+f0(c,f,h)+l0[y]+an[y]|0,T=((0,Yt.rotr)(n,2)^(0,Yt.rotr)(n,13)^(0,Yt.rotr)(n,22))+d0(n,o,s)|0;g=h,h=f,f=c,c=a+b|0,a=s,s=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,c=c+this.E|0,f=f+this.F|0,h=h+this.G|0,g=g+this.H|0,this.set(n,o,s,a,c,f,h,g)}roundClean(){an.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};Vs.sha256=(0,Yt.wrapConstructor)(()=>new va)});var rf=fe(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.add=qt.toBig=qt.split=qt.fromBig=void 0;var Ws=BigInt(2**32-1),Ea=BigInt(32);function Sa(r,t=!1){return t?{h:Number(r&Ws),l:Number(r>>Ea&Ws)}:{h:Number(r>>Ea&Ws)|0,l:Number(r&Ws)|0}}qt.fromBig=Sa;function ef(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=Sa(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}qt.split=ef;var p0=(r,t)=>BigInt(r>>>0)<<Ea|BigInt(t>>>0);qt.toBig=p0;var h0=(r,t,e)=>r>>>e,g0=(r,t,e)=>r<<32-e|t>>>e,y0=(r,t,e)=>r>>>e|t<<32-e,m0=(r,t,e)=>r<<32-e|t>>>e,x0=(r,t,e)=>r<<64-e|t>>>e-32,b0=(r,t,e)=>r>>>e-32|t<<64-e,A0=(r,t)=>t,w0=(r,t)=>r,T0=(r,t,e)=>r<<e|t>>>32-e,_0=(r,t,e)=>t<<e|r>>>32-e,v0=(r,t,e)=>t<<e-32|r>>>64-e,E0=(r,t,e)=>r<<e-32|t>>>64-e;function tf(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}qt.add=tf;var S0=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),U0=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,B0=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),C0=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,I0=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),R0=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0,P0={fromBig:Sa,split:ef,toBig:qt.toBig,shrSH:h0,shrSL:g0,rotrSH:y0,rotrSL:m0,rotrBH:x0,rotrBL:b0,rotr32H:A0,rotr32L:w0,rotlSH:T0,rotlSL:_0,rotlBH:v0,rotlBL:E0,add:tf,add3L:S0,add3H:U0,add4L:B0,add4H:C0,add5H:R0,add5L:I0};qt.default=P0});var nf=fe(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.sha384=fr.sha512_256=fr.sha512=fr.SHA512=void 0;var k0=_a(),Te=rf(),Ca=Hn(),[O0,z0]=Te.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),cn=new Uint32Array(80),un=new Uint32Array(80),co=class extends k0.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)cn[E]=t.getUint32(e),un[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=cn[E-15]|0,D=un[E-15]|0,F=Te.default.rotrSH(K,D,1)^Te.default.rotrSH(K,D,8)^Te.default.shrSH(K,D,7),J=Te.default.rotrSL(K,D,1)^Te.default.rotrSL(K,D,8)^Te.default.shrSL(K,D,7),G=cn[E-2]|0,oe=un[E-2]|0,de=Te.default.rotrSH(G,oe,19)^Te.default.rotrBH(G,oe,61)^Te.default.shrSH(G,oe,6),ce=Te.default.rotrSL(G,oe,19)^Te.default.rotrBL(G,oe,61)^Te.default.shrSL(G,oe,6),Pe=Te.default.add4L(J,ce,un[E-7],un[E-16]),Oe=Te.default.add4H(Pe,F,de,cn[E-7],cn[E-16]);cn[E]=Oe|0,un[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=Te.default.rotrSH(y,w,14)^Te.default.rotrSH(y,w,18)^Te.default.rotrBH(y,w,41),D=Te.default.rotrSL(y,w,14)^Te.default.rotrSL(y,w,18)^Te.default.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=Te.default.add5L(M,D,J,z0[E],un[E]),oe=Te.default.add5H(G,R,K,F,O0[E],cn[E]),de=G|0,ce=Te.default.rotrSH(n,o,28)^Te.default.rotrBH(n,o,34)^Te.default.rotrBH(n,o,39),Pe=Te.default.rotrSL(n,o,28)^Te.default.rotrBL(n,o,34)^Te.default.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=Te.default.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=Te.default.add3L(de,Pe,at);n=Te.default.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=Te.default.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=Te.default.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=Te.default.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=Te.default.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=Te.default.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=Te.default.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=Te.default.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=Te.default.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){cn.fill(0),un.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};fr.SHA512=co;var Ua=class extends co{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},Ba=class extends co{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};fr.sha512=(0,Ca.wrapConstructor)(()=>new co);fr.sha512_256=(0,Ca.wrapConstructor)(()=>new Ua);fr.sha384=(0,Ca.wrapConstructor)(()=>new Ba)});var yf=fe(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.bytes=Z.stringToBytes=Z.str=Z.bytesToString=Z.hex=Z.utf8=Z.bech32m=Z.bech32=Z.base58check=Z.base58xmr=Z.base58xrp=Z.base58flickr=Z.base58=Z.base64url=Z.base64=Z.base32crockford=Z.base32hex=Z.base32=Z.base16=Z.utils=Z.assertNumber=void 0;function fn(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}Z.assertNumber=fn;function Xt(...r){let t=(o,s)=>a=>o(s(a)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function dr(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(fn(e),e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function lr(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function jo(r,t="="){if(fn(r),typeof t!="string")throw new Error("padding chr should be string");return{encode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;e.length*r%8;)e.push(t);return e},decode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of e)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let n=e.length;if(n*r%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&e[n-1]===t;n--)if(!((n-1)*r%8))throw new Error("Invalid padding: string has too much padding");return e.slice(0,n)}}}function ff(r){if(typeof r!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>r(t)}}function of(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(a=>{if(fn(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let f=n;f<s.length;f++){let h=s[f],g=t*a+h;if(!Number.isSafeInteger(g)||t*a/t!==a||g-h!==t*a)throw new Error("convertRadix: carry overflow");if(a=g%e,s[f]=Math.floor(g/e),!Number.isSafeInteger(s[f])||s[f]*e+a!==g)throw new Error("convertRadix: carry overflow");if(c)s[f]?c=!1:n=f;else continue}if(o.push(a),c)break}for(let a=0;a<r.length-1&&r[a]===0;a++)o.push(0);return o.reverse()}var df=(r,t)=>t?df(t,r%t):r,Qs=(r,t)=>r+(t-df(r,t));function Ia(r,t,e,n){if(!Array.isArray(r))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(e<=0||e>32)throw new Error(`convertRadix2: wrong to=${e}`);if(Qs(t,e)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${e} carryBits=${Qs(t,e)}`);let o=0,s=0,a=2**e-1,c=[];for(let f of r){if(fn(f),f>=2**t)throw new Error(`convertRadix2: invalid data word=${f} from=${t}`);if(o=o<<t|f,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=e;s-=e)c.push((o>>s-e&a)>>>0);o&=2**s-1}if(o=o<<e-s&a,!n&&s>=t)throw new Error("Excess padding");if(!n&&o)throw new Error(`Non-zero padding: ${o}`);return n&&s>0&&c.push(o>>>0),c}function lf(r){return fn(r),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return of(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(of(t,r,2**8))}}}function Sr(r,t=!1){if(fn(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(Qs(8,r)>32||Qs(r,8)>32)throw new Error("radix2: carry overflow");return{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return Ia(Array.from(e),8,r,!t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(Ia(e,r,8,t))}}}function sf(r){if(typeof r!="function")throw new Error("unsafeWrapper fn should be function");return function(...t){try{return r.apply(null,t)}catch{}}}function pf(r,t){if(fn(r),typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return n}}}Z.utils={alphabet:dr,chain:Xt,checksum:pf,radix:lf,radix2:Sr,join:lr,padding:jo};Z.base16=Xt(Sr(4),dr("0123456789ABCDEF"),lr(""));Z.base32=Xt(Sr(5),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),jo(5),lr(""));Z.base32hex=Xt(Sr(5),dr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),jo(5),lr(""));Z.base32crockford=Xt(Sr(5),dr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),lr(""),ff(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));Z.base64=Xt(Sr(6),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),jo(6),lr(""));Z.base64url=Xt(Sr(6),dr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),jo(6),lr(""));var Pa=r=>Xt(lf(58),dr(r),lr(""));Z.base58=Pa("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");Z.base58flickr=Pa("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ");Z.base58xrp=Pa("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");var af=[0,2,3,5,6,7,9,10,11];Z.base58xmr={encode(r){let t="";for(let e=0;e<r.length;e+=8){let n=r.subarray(e,e+8);t+=Z.base58.encode(n).padStart(af[n.length],"1")}return t},decode(r){let t=[];for(let e=0;e<r.length;e+=11){let n=r.slice(e,e+11),o=af.indexOf(n.length),s=Z.base58.decode(n);for(let a=0;a<s.length-o;a++)if(s[a]!==0)throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(t)}};var N0=r=>Xt(pf(4,t=>r(r(t))),Z.base58);Z.base58check=N0;var Ra=Xt(dr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),lr("")),cf=[996825010,642813549,513874426,1027748829,705979059];function $o(r){let t=r>>25,e=(r&33554431)<<5;for(let n=0;n<cf.length;n++)(t>>n&1)===1&&(e^=cf[n]);return e}function uf(r,t,e=1){let n=r.length,o=1;for(let s=0;s<n;s++){let a=r.charCodeAt(s);if(a<33||a>126)throw new Error(`Invalid prefix (${r})`);o=$o(o)^a>>5}o=$o(o);for(let s=0;s<n;s++)o=$o(o)^r.charCodeAt(s)&31;for(let s of t)o=$o(o)^s;for(let s=0;s<6;s++)o=$o(o);return o^=e,Ra.encode(Ia([o%2**30],30,5,!1))}function hf(r){let t=r==="bech32"?1:734539939,e=Sr(5),n=e.decode,o=e.encode,s=sf(n);function a(g,y,w=90){if(typeof g!="string")throw new Error(`bech32.encode prefix should be string, not ${typeof g}`);if(!Array.isArray(y)||y.length&&typeof y[0]!="number")throw new Error(`bech32.encode words should be array of numbers, not ${typeof y}`);let b=g.length+7+y.length;if(w!==!1&&b>w)throw new TypeError(`Length ${b} exceeds limit ${w}`);return g=g.toLowerCase(),`${g}1${Ra.encode(y)}${uf(g,y,t)}`}function c(g,y=90){if(typeof g!="string")throw new Error(`bech32.decode input should be string, not ${typeof g}`);if(g.length<8||y!==!1&&g.length>y)throw new TypeError(`Wrong string length: ${g.length} (${g}). Expected (8..${y})`);let w=g.toLowerCase();if(g!==w&&g!==g.toUpperCase())throw new Error("String must be lowercase or uppercase");g=w;let b=g.lastIndexOf("1");if(b===0||b===-1)throw new Error('Letter "1" must be present between prefix and data only');let I=g.slice(0,b),T=g.slice(b+1);if(T.length<6)throw new Error("Data must be at least 6 characters long");let S=Ra.decode(T).slice(0,-6),R=uf(I,S,t);if(!T.endsWith(R))throw new Error(`Invalid checksum in ${g}: expected "${R}"`);return{prefix:I,words:S}}let f=sf(c);function h(g){let{prefix:y,words:w}=c(g,!1);return{prefix:y,words:w,bytes:n(w)}}return{encode:a,decode:c,decodeToBytes:h,decodeUnsafe:f,fromWords:n,fromWordsUnsafe:s,toWords:o}}Z.bech32=hf("bech32");Z.bech32m=hf("bech32m");Z.utf8={encode:r=>new TextDecoder().decode(r),decode:r=>new TextEncoder().encode(r)};Z.hex=Xt(Sr(4),dr("0123456789abcdef"),lr(""),ff(r=>{if(typeof r!="string"||r.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}));var Ko={utf8:Z.utf8,hex:Z.hex,base16:Z.base16,base32:Z.base32,base64:Z.base64,base64url:Z.base64url,base58:Z.base58,base58xmr:Z.base58xmr},gf=`Invalid encoding type. Available types: ${Object.keys(Ko).join(", ")}`,D0=(r,t)=>{if(typeof r!="string"||!Ko.hasOwnProperty(r))throw new TypeError(gf);if(!(t instanceof Uint8Array))throw new TypeError("bytesToString() expects Uint8Array");return Ko[r].encode(t)};Z.bytesToString=D0;Z.str=Z.bytesToString;var M0=(r,t)=>{if(!Ko.hasOwnProperty(r))throw new TypeError(gf);if(typeof t!="string")throw new TypeError("stringToBytes() expects string");return Ko[r].decode(t)};Z.stringToBytes=M0;Z.bytes=Z.stringToBytes});var Sf=fe(vt=>{"use strict";Object.defineProperty(vt,"__esModule",{value:!0});vt.mnemonicToSeedSync=vt.mnemonicToSeed=vt.validateMnemonic=vt.entropyToMnemonic=vt.mnemonicToEntropy=vt.generateMnemonic=void 0;var mf=Ho(),xf=Zu(),q0=Ju(),bf=nf(),L0=Hn(),Ys=yf(),H0=r=>r[0]==="\u3042\u3044\u3053\u304F\u3057\u3093";function Af(r){if(typeof r!="string")throw new TypeError(`Invalid mnemonic type: ${typeof r}`);return r.normalize("NFKD")}function ka(r){let t=Af(r),e=t.split(" ");if(![12,15,18,21,24].includes(e.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:e}}function wf(r){mf.default.bytes(r,16,20,24,28,32)}function G0(r,t=128){if(mf.default.number(t),t%32!==0||t>256)throw new TypeError("Invalid entropy");return vf((0,L0.randomBytes)(t/8),r)}vt.generateMnemonic=G0;var F0=r=>{let t=8-r.length/4;return new Uint8Array([(0,q0.sha256)(r)[0]>>t<<t])};function Tf(r){if(!Array.isArray(r)||r.length!==2**11||typeof r[0]!="string")throw new Error("Worlist: expected array of 2048 strings");return r.forEach(t=>{if(typeof t!="string")throw new Error(`Wordlist: non-string element: ${t}`)}),Ys.utils.chain(Ys.utils.checksum(1,F0),Ys.utils.radix2(11,!0),Ys.utils.alphabet(r))}function _f(r,t){let{words:e}=ka(r),n=Tf(t).decode(e);return wf(n),n}vt.mnemonicToEntropy=_f;function vf(r,t){return wf(r),Tf(t).encode(r).join(H0(t)?"\u3000":" ")}vt.entropyToMnemonic=vf;function $0(r,t){try{_f(r,t)}catch{return!1}return!0}vt.validateMnemonic=$0;var Ef=r=>Af(`mnemonic${r}`);function K0(r,t=""){return(0,xf.pbkdf2Async)(bf.sha512,ka(r).nfkd,Ef(t),{c:2048,dkLen:64})}vt.mnemonicToSeed=K0;function j0(r,t=""){return(0,xf.pbkdf2)(bf.sha512,ka(r).nfkd,Ef(t),{c:2048,dkLen:64})}vt.mnemonicToSeedSync=j0});var hc=fe((Qw,$d)=>{"use strict";$d.exports=function(t,e){return function(){for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];return t.apply(e,o)}}});var ut=fe((Yw,Vd)=>{"use strict";var hy=hc(),yc=Object.prototype.toString,mc=function(r){return function(t){var e=yc.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())}}(Object.create(null));function Qn(r){return r=r.toLowerCase(),function(e){return mc(e)===r}}function xc(r){return Array.isArray(r)}function bi(r){return typeof r>"u"}function gy(r){return r!==null&&!bi(r)&&r.constructor!==null&&!bi(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Kd=Qn("ArrayBuffer");function yy(r){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Kd(r.buffer),t}function my(r){return typeof r=="string"}function xy(r){return typeof r=="number"}function jd(r){return r!==null&&typeof r=="object"}function xi(r){if(mc(r)!=="object")return!1;var t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}var by=Qn("Date"),Ay=Qn("File"),wy=Qn("Blob"),Ty=Qn("FileList");function bc(r){return yc.call(r)==="[object Function]"}function _y(r){return jd(r)&&bc(r.pipe)}function vy(r){var t="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||yc.call(r)===t||bc(r.toString)&&r.toString()===t)}var Ey=Qn("URLSearchParams");function Sy(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Uy(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Ac(r,t){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),xc(r))for(var e=0,n=r.length;e<n;e++)t.call(null,r[e],e,r);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.call(null,r[o],o,r)}function gc(){var r={};function t(o,s){xi(r[s])&&xi(o)?r[s]=gc(r[s],o):xi(o)?r[s]=gc({},o):xc(o)?r[s]=o.slice():r[s]=o}for(var e=0,n=arguments.length;e<n;e++)Ac(arguments[e],t);return r}function By(r,t,e){return Ac(t,function(o,s){e&&typeof o=="function"?r[s]=hy(o,e):r[s]=o}),r}function Cy(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function Iy(r,t,e,n){r.prototype=Object.create(t.prototype,n),r.prototype.constructor=r,e&&Object.assign(r.prototype,e)}function Ry(r,t,e){var n,o,s,a={};t=t||{};do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)s=n[o],a[s]||(t[s]=r[s],a[s]=!0);r=Object.getPrototypeOf(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t}function Py(r,t,e){r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;var n=r.indexOf(t,e);return n!==-1&&n===e}function ky(r){if(!r)return null;var t=r.length;if(bi(t))return null;for(var e=new Array(t);t-- >0;)e[t]=r[t];return e}var Oy=function(r){return function(t){return r&&t instanceof r}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));Vd.exports={isArray:xc,isArrayBuffer:Kd,isBuffer:gy,isFormData:vy,isArrayBufferView:yy,isString:my,isNumber:xy,isObject:jd,isPlainObject:xi,isUndefined:bi,isDate:by,isFile:Ay,isBlob:wy,isFunction:bc,isStream:_y,isURLSearchParams:Ey,isStandardBrowserEnv:Uy,forEach:Ac,merge:gc,extend:By,trim:Sy,stripBOM:Cy,inherits:Iy,toFlatObject:Ry,kindOf:mc,kindOfTest:Qn,endsWith:Py,toArray:ky,isTypedArray:Oy,isFileList:Ty}});var wc=fe((Xw,Qd)=>{"use strict";var Ao=ut();function Wd(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}Qd.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(Ao.isURLSearchParams(e))o=e.toString();else{var s=[];Ao.forEach(e,function(f,h){f===null||typeof f>"u"||(Ao.isArray(f)?h=h+"[]":f=[f],Ao.forEach(f,function(y){Ao.isDate(y)?y=y.toISOString():Ao.isObject(y)&&(y=JSON.stringify(y)),s.push(Wd(h)+"="+Wd(y))}))}),o=s.join("&")}if(o){var a=t.indexOf("#");a!==-1&&(t=t.slice(0,a)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var Xd=fe((Zw,Yd)=>{"use strict";var zy=ut();function Ai(){this.handlers=[]}Ai.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};Ai.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};Ai.prototype.forEach=function(t){zy.forEach(this.handlers,function(n){n!==null&&t(n)})};Yd.exports=Ai});var Jd=fe((Jw,Zd)=>{"use strict";var Ny=ut();Zd.exports=function(t,e){Ny.forEach(t,function(o,s){s!==e&&s.toUpperCase()===e.toUpperCase()&&(t[e]=o,delete t[s])})}});var Yn=fe((e2,nl)=>{"use strict";var el=ut();function wo(r,t,e,n,o){Error.call(this),this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),o&&(this.response=o)}el.inherits(wo,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var tl=wo.prototype,rl={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){rl[r]={value:r}});Object.defineProperties(wo,rl);Object.defineProperty(tl,"isAxiosError",{value:!0});wo.from=function(r,t,e,n,o,s){var a=Object.create(tl);return el.toFlatObject(r,a,function(f){return f!==Error.prototype}),wo.call(a,r.message,t,e,n,o),a.name=r.name,s&&Object.assign(a,s),a};nl.exports=wo});var Tc=fe((t2,ol)=>{"use strict";ol.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var _c=fe((r2,sl)=>{"use strict";var tr=ut();function Dy(r,t){t=t||new FormData;var e=[];function n(s){return s===null?"":tr.isDate(s)?s.toISOString():tr.isArrayBuffer(s)||tr.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function o(s,a){if(tr.isPlainObject(s)||tr.isArray(s)){if(e.indexOf(s)!==-1)throw Error("Circular reference detected in "+a);e.push(s),tr.forEach(s,function(f,h){if(!tr.isUndefined(f)){var g=a?a+"."+h:h,y;if(f&&!a&&typeof f=="object"){if(tr.endsWith(h,"{}"))f=JSON.stringify(f);else if(tr.endsWith(h,"[]")&&(y=tr.toArray(f))){y.forEach(function(w){!tr.isUndefined(w)&&t.append(g,n(w))});return}}o(f,g)}}),e.pop()}else t.append(a,n(s))}return o(r),t}sl.exports=Dy});var al=fe((n2,il)=>{"use strict";var vc=Yn();il.exports=function(t,e,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):e(new vc("Request failed with status code "+n.status,[vc.ERR_BAD_REQUEST,vc.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}});var ul=fe((o2,cl)=>{"use strict";var wi=ut();cl.exports=wi.isStandardBrowserEnv()?function(){return{write:function(e,n,o,s,a,c){var f=[];f.push(e+"="+encodeURIComponent(n)),wi.isNumber(o)&&f.push("expires="+new Date(o).toGMTString()),wi.isString(s)&&f.push("path="+s),wi.isString(a)&&f.push("domain="+a),c===!0&&f.push("secure"),document.cookie=f.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var dl=fe((s2,fl)=>{"use strict";fl.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var pl=fe((i2,ll)=>{"use strict";ll.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}});var Ec=fe((a2,hl)=>{"use strict";var My=dl(),qy=pl();hl.exports=function(t,e){return t&&!My(e)?qy(t,e):e}});var yl=fe((c2,gl)=>{"use strict";var Sc=ut(),Ly=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];gl.exports=function(t){var e={},n,o,s;return t&&Sc.forEach(t.split(`
2
- `),function(c){if(s=c.indexOf(":"),n=Sc.trim(c.substr(0,s)).toLowerCase(),o=Sc.trim(c.substr(s+1)),n){if(e[n]&&Ly.indexOf(n)>=0)return;n==="set-cookie"?e[n]=(e[n]?e[n]:[]).concat([o]):e[n]=e[n]?e[n]+", "+o:o}}),e}});var bl=fe((u2,xl)=>{"use strict";var ml=ut();xl.exports=ml.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a"),n;function o(s){var a=s;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=o(window.location.href),function(a){var c=ml.isString(a)?o(a):a;return c.protocol===n.protocol&&c.host===n.host}}():function(){return function(){return!0}}()});var Jo=fe((f2,wl)=>{"use strict";var Uc=Yn(),Hy=ut();function Al(r){Uc.call(this,r??"canceled",Uc.ERR_CANCELED),this.name="CanceledError"}Hy.inherits(Al,Uc,{__CANCEL__:!0});wl.exports=Al});var _l=fe((d2,Tl)=>{"use strict";Tl.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}});var Bc=fe((l2,vl)=>{"use strict";var es=ut(),Gy=al(),Fy=ul(),$y=wc(),Ky=Ec(),jy=yl(),Vy=bl(),Wy=Tc(),kr=Yn(),Qy=Jo(),Yy=_l();vl.exports=function(t){return new Promise(function(n,o){var s=t.data,a=t.headers,c=t.responseType,f;function h(){t.cancelToken&&t.cancelToken.unsubscribe(f),t.signal&&t.signal.removeEventListener("abort",f)}es.isFormData(s)&&es.isStandardBrowserEnv()&&delete a["Content-Type"];var g=new XMLHttpRequest;if(t.auth){var y=t.auth.username||"",w=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";a.Authorization="Basic "+btoa(y+":"+w)}var b=Ky(t.baseURL,t.url);g.open(t.method.toUpperCase(),$y(b,t.params,t.paramsSerializer),!0),g.timeout=t.timeout;function I(){if(!!g){var R="getAllResponseHeaders"in g?jy(g.getAllResponseHeaders()):null,M=!c||c==="text"||c==="json"?g.responseText:g.response,E={data:M,status:g.status,statusText:g.statusText,headers:R,config:t,request:g};Gy(function(D){n(D),h()},function(D){o(D),h()},E),g=null}}if("onloadend"in g?g.onloadend=I:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(I)},g.onabort=function(){!g||(o(new kr("Request aborted",kr.ECONNABORTED,t,g)),g=null)},g.onerror=function(){o(new kr("Network Error",kr.ERR_NETWORK,t,g,g)),g=null},g.ontimeout=function(){var M=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",E=t.transitional||Wy;t.timeoutErrorMessage&&(M=t.timeoutErrorMessage),o(new kr(M,E.clarifyTimeoutError?kr.ETIMEDOUT:kr.ECONNABORTED,t,g)),g=null},es.isStandardBrowserEnv()){var T=(t.withCredentials||Vy(b))&&t.xsrfCookieName?Fy.read(t.xsrfCookieName):void 0;T&&(a[t.xsrfHeaderName]=T)}"setRequestHeader"in g&&es.forEach(a,function(M,E){typeof s>"u"&&E.toLowerCase()==="content-type"?delete a[E]:g.setRequestHeader(E,M)}),es.isUndefined(t.withCredentials)||(g.withCredentials=!!t.withCredentials),c&&c!=="json"&&(g.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&g.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&g.upload&&g.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(f=function(R){!g||(o(!R||R&&R.type?new Qy:R),g.abort(),g=null)},t.cancelToken&&t.cancelToken.subscribe(f),t.signal&&(t.signal.aborted?f():t.signal.addEventListener("abort",f))),s||(s=null);var S=Yy(b);if(S&&["http","https","file"].indexOf(S)===-1){o(new kr("Unsupported protocol "+S+":",kr.ERR_BAD_REQUEST,t));return}g.send(s)})}});var Sl=fe((p2,El)=>{El.exports=null});var _i=fe((h2,Il)=>{"use strict";var ft=ut(),Ul=Jd(),Bl=Yn(),Xy=Tc(),Zy=_c(),Jy={"Content-Type":"application/x-www-form-urlencoded"};function Cl(r,t){!ft.isUndefined(r)&&ft.isUndefined(r["Content-Type"])&&(r["Content-Type"]=t)}function em(){var r;return typeof XMLHttpRequest<"u"?r=Bc():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=Bc()),r}function tm(r,t,e){if(ft.isString(r))try{return(t||JSON.parse)(r),ft.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(r)}var Ti={transitional:Xy,adapter:em(),transformRequest:[function(t,e){if(Ul(e,"Accept"),Ul(e,"Content-Type"),ft.isFormData(t)||ft.isArrayBuffer(t)||ft.isBuffer(t)||ft.isStream(t)||ft.isFile(t)||ft.isBlob(t))return t;if(ft.isArrayBufferView(t))return t.buffer;if(ft.isURLSearchParams(t))return Cl(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n=ft.isObject(t),o=e&&e["Content-Type"],s;if((s=ft.isFileList(t))||n&&o==="multipart/form-data"){var a=this.env&&this.env.FormData;return Zy(s?{"files[]":t}:t,a&&new a)}else if(n||o==="application/json")return Cl(e,"application/json"),tm(t);return t}],transformResponse:[function(t){var e=this.transitional||Ti.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,s=!n&&this.responseType==="json";if(s||o&&ft.isString(t)&&t.length)try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?Bl.from(a,Bl.ERR_BAD_RESPONSE,this,null,this.response):a}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Sl()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ft.forEach(["delete","get","head"],function(t){Ti.headers[t]={}});ft.forEach(["post","put","patch"],function(t){Ti.headers[t]=ft.merge(Jy)});Il.exports=Ti});var Pl=fe((g2,Rl)=>{"use strict";var rm=ut(),nm=_i();Rl.exports=function(t,e,n){var o=this||nm;return rm.forEach(n,function(a){t=a.call(o,t,e)}),t}});var Cc=fe((y2,kl)=>{"use strict";kl.exports=function(t){return!!(t&&t.__CANCEL__)}});var Nl=fe((m2,zl)=>{"use strict";var Ol=ut(),Ic=Pl(),om=Cc(),sm=_i(),im=Jo();function Rc(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new im}zl.exports=function(t){Rc(t),t.headers=t.headers||{},t.data=Ic.call(t,t.data,t.headers,t.transformRequest),t.headers=Ol.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Ol.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var e=t.adapter||sm.adapter;return e(t).then(function(o){return Rc(t),o.data=Ic.call(t,o.data,o.headers,t.transformResponse),o},function(o){return om(o)||(Rc(t),o&&o.response&&(o.response.data=Ic.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var Pc=fe((x2,Dl)=>{"use strict";var zt=ut();Dl.exports=function(t,e){e=e||{};var n={};function o(g,y){return zt.isPlainObject(g)&&zt.isPlainObject(y)?zt.merge(g,y):zt.isPlainObject(y)?zt.merge({},y):zt.isArray(y)?y.slice():y}function s(g){if(zt.isUndefined(e[g])){if(!zt.isUndefined(t[g]))return o(void 0,t[g])}else return o(t[g],e[g])}function a(g){if(!zt.isUndefined(e[g]))return o(void 0,e[g])}function c(g){if(zt.isUndefined(e[g])){if(!zt.isUndefined(t[g]))return o(void 0,t[g])}else return o(void 0,e[g])}function f(g){if(g in e)return o(t[g],e[g]);if(g in t)return o(void 0,t[g])}var h={url:a,method:a,data:a,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:f};return zt.forEach(Object.keys(t).concat(Object.keys(e)),function(y){var w=h[y]||s,b=w(y);zt.isUndefined(b)&&w!==f||(n[y]=b)}),n}});var kc=fe((b2,Ml)=>{Ml.exports={version:"0.27.2"}});var Hl=fe((A2,Ll)=>{"use strict";var am=kc().version,Tn=Yn(),Oc={};["object","boolean","number","function","string","symbol"].forEach(function(r,t){Oc[r]=function(n){return typeof n===r||"a"+(t<1?"n ":" ")+r}});var ql={};Oc.transitional=function(t,e,n){function o(s,a){return"[Axios v"+am+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return function(s,a,c){if(t===!1)throw new Tn(o(a," has been removed"+(e?" in "+e:"")),Tn.ERR_DEPRECATED);return e&&!ql[a]&&(ql[a]=!0,console.warn(o(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,a,c):!0}};function cm(r,t,e){if(typeof r!="object")throw new Tn("options must be an object",Tn.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(r),o=n.length;o-- >0;){var s=n[o],a=t[s];if(a){var c=r[s],f=c===void 0||a(c,s,r);if(f!==!0)throw new Tn("option "+s+" must be "+f,Tn.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Tn("Unknown option "+s,Tn.ERR_BAD_OPTION)}}Ll.exports={assertOptions:cm,validators:Oc}});var Vl=fe((w2,jl)=>{"use strict";var $l=ut(),um=wc(),Gl=Xd(),Fl=Nl(),vi=Pc(),fm=Ec(),Kl=Hl(),To=Kl.validators;function _o(r){this.defaults=r,this.interceptors={request:new Gl,response:new Gl}}_o.prototype.request=function(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=vi(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;n!==void 0&&Kl.assertOptions(n,{silentJSONParsing:To.transitional(To.boolean),forcedJSONParsing:To.transitional(To.boolean),clarifyTimeoutError:To.transitional(To.boolean)},!1);var o=[],s=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(e)===!1||(s=s&&b.synchronous,o.unshift(b.fulfilled,b.rejected))});var a=[];this.interceptors.response.forEach(function(b){a.push(b.fulfilled,b.rejected)});var c;if(!s){var f=[Fl,void 0];for(Array.prototype.unshift.apply(f,o),f=f.concat(a),c=Promise.resolve(e);f.length;)c=c.then(f.shift(),f.shift());return c}for(var h=e;o.length;){var g=o.shift(),y=o.shift();try{h=g(h)}catch(w){y(w);break}}try{c=Fl(h)}catch(w){return Promise.reject(w)}for(;a.length;)c=c.then(a.shift(),a.shift());return c};_o.prototype.getUri=function(t){t=vi(this.defaults,t);var e=fm(t.baseURL,t.url);return um(e,t.params,t.paramsSerializer)};$l.forEach(["delete","get","head","options"],function(t){_o.prototype[t]=function(e,n){return this.request(vi(n||{},{method:t,url:e,data:(n||{}).data}))}});$l.forEach(["post","put","patch"],function(t){function e(n){return function(s,a,c){return this.request(vi(c||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}_o.prototype[t]=e(),_o.prototype[t+"Form"]=e(!0)});jl.exports=_o});var Ql=fe((T2,Wl)=>{"use strict";var dm=Jo();function vo(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var e=this;this.promise.then(function(n){if(!!e._listeners){var o,s=e._listeners.length;for(o=0;o<s;o++)e._listeners[o](n);e._listeners=null}}),this.promise.then=function(n){var o,s=new Promise(function(a){e.subscribe(a),o=a}).then(n);return s.cancel=function(){e.unsubscribe(o)},s},r(function(o){e.reason||(e.reason=new dm(o),t(e.reason))})}vo.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};vo.prototype.subscribe=function(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]};vo.prototype.unsubscribe=function(t){if(!!this._listeners){var e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}};vo.source=function(){var t,e=new vo(function(o){t=o});return{token:e,cancel:t}};Wl.exports=vo});var Xl=fe((_2,Yl)=>{"use strict";Yl.exports=function(t){return function(n){return t.apply(null,n)}}});var Jl=fe((v2,Zl)=>{"use strict";var lm=ut();Zl.exports=function(t){return lm.isObject(t)&&t.isAxiosError===!0}});var rp=fe((E2,zc)=>{"use strict";var ep=ut(),pm=hc(),Ei=Vl(),hm=Pc(),gm=_i();function tp(r){var t=new Ei(r),e=pm(Ei.prototype.request,t);return ep.extend(e,Ei.prototype,t),ep.extend(e,t),e.create=function(o){return tp(hm(r,o))},e}var Ut=tp(gm);Ut.Axios=Ei;Ut.CanceledError=Jo();Ut.CancelToken=Ql();Ut.isCancel=Cc();Ut.VERSION=kc().version;Ut.toFormData=_c();Ut.AxiosError=Yn();Ut.Cancel=Ut.CanceledError;Ut.all=function(t){return Promise.all(t)};Ut.spread=Xl();Ut.isAxiosError=Jl();zc.exports=Ut;zc.exports.default=Ut});var op=fe((S2,np)=>{np.exports=rp()});var Cm={};fu(Cm,{APTOS_BIP44_REGEX:()=>Cf,APTOS_HARDENED_REGEX:()=>Bf,Account:()=>St,AccountAddress:()=>O,AccountAuthenticator:()=>Bt,AccountAuthenticatorEd25519:()=>rr,AccountAuthenticatorMultiEd25519:()=>Eo,AccountAuthenticatorMultiKey:()=>_n,AccountAuthenticatorSingleKey:()=>Kt,AccountAuthenticatorVariant:()=>na,AddressInvalidReason:()=>Iu,AnyPublicKeyVariant:()=>oa,AnySignatureVariant:()=>sa,Aptos:()=>Ct,AptosApiError:()=>cr,AptosConfig:()=>ts,AuthenticationKey:()=>Ft,Bool:()=>Le,CKDPriv:()=>Da,ChainId:()=>Mr,DeriveScheme:()=>yu,Deserializer:()=>qo,Ed25519PrivateKey:()=>Zt,Ed25519PublicKey:()=>De,Ed25519Signature:()=>je,EntryFunction:()=>wr,EntryFunctionBytes:()=>qn,FeePayerRawTransaction:()=>sr,FixedBytes:()=>ur,HARDENED_OFFSET:()=>Oa,Hex:()=>be,HexInvalidReason:()=>Bu,Identifier:()=>qe,KeyType:()=>If,MimeType:()=>Es,ModuleId:()=>qr,MoveAbility:()=>hu,MoveFunctionVisibility:()=>pu,MoveOption:()=>tt,MoveString:()=>Ge,MoveVector:()=>ve,MultiAgentRawTransaction:()=>or,MultiEd25519PublicKey:()=>Et,MultiEd25519Signature:()=>Br,MultiKey:()=>Pr,MultiSig:()=>Cn,MultisigTransactionPayload:()=>In,Network:()=>zo,NetworkToChainId:()=>Us,NetworkToFaucetAPI:()=>ua,NetworkToIndexerAPI:()=>Ss,NetworkToNetworkName:()=>Jp,NetworkToNodeAPI:()=>ca,ParsingError:()=>mt,PrivateKey:()=>Ln,PublicKey:()=>Pt,RawTransaction:()=>Nt,RawTransactionWithData:()=>os,RoleType:()=>gu,RotationProofChallenge:()=>rs,Script:()=>Bn,ScriptTransactionArgumentVariants:()=>ro,Secp256k1PrivateKey:()=>mr,Secp256k1PublicKey:()=>Gt,Secp256k1Signature:()=>xr,Serializable:()=>te,Serializer:()=>Wt,Signature:()=>Qt,SignedTransaction:()=>Dt,SigningScheme:()=>no,SigningSchemeInput:()=>aa,StructTag:()=>jt,TransactionAuthenticator:()=>br,TransactionAuthenticatorEd25519:()=>Or,TransactionAuthenticatorFeePayer:()=>Nr,TransactionAuthenticatorMultiAgent:()=>zr,TransactionAuthenticatorMultiEd25519:()=>So,TransactionAuthenticatorSingleSender:()=>Dr,TransactionAuthenticatorVariant:()=>ra,TransactionPayload:()=>vn,TransactionPayloadEntryFunction:()=>Sn,TransactionPayloadMultisig:()=>Un,TransactionPayloadScript:()=>En,TransactionPayloadVariants:()=>ea,TransactionResponseType:()=>ia,TransactionVariants:()=>ta,TypeTag:()=>Xe,TypeTagAddress:()=>Vr,TypeTagBool:()=>Lr,TypeTagGeneric:()=>Wr,TypeTagParserError:()=>$e,TypeTagParserErrorType:()=>pp,TypeTagReference:()=>Xn,TypeTagSigner:()=>Ar,TypeTagStruct:()=>nr,TypeTagU128:()=>Kr,TypeTagU16:()=>Gr,TypeTagU256:()=>jr,TypeTagU32:()=>Fr,TypeTagU64:()=>$r,TypeTagU8:()=>Hr,TypeTagVariants:()=>Ji,TypeTagVector:()=>Qr,U128:()=>Tt,U16:()=>At,U256:()=>_t,U32:()=>wt,U64:()=>He,U8:()=>st,aptosCoinStructTag:()=>mm,aptosRequest:()=>Oo,buildTransaction:()=>jc,convertArgument:()=>$c,deriveKey:()=>Xs,deriveTransactionType:()=>Yc,deserializeFromScriptArgument:()=>fp,ensureBoolean:()=>zs,fetchEntryFunctionAbi:()=>Fc,findFirstNonSignerArg:()=>Hc,generateMultiSignersSignedTransaction:()=>mp,generateRawTransaction:()=>yp,generateSignedTransaction:()=>Qc,generateSignedTransactionForSimulation:()=>Vc,generateTransactionPayload:()=>Kc,generateTransactionPayloadWithABI:()=>hp,get:()=>Eu,getAptosFullNode:()=>bt,getAuthenticatorForSimulation:()=>cs,getFunctionParts:()=>qi,getSigningMessage:()=>xp,isBcsAddress:()=>as,isBcsBool:()=>Ii,isBcsFixedBytes:()=>Lc,isBcsString:()=>Ri,isBcsU128:()=>Ni,isBcsU16:()=>ki,isBcsU256:()=>Di,isBcsU32:()=>Oi,isBcsU64:()=>zi,isBcsU8:()=>Pi,isBool:()=>Mc,isLargeNumber:()=>is,isNull:()=>qc,isNumber:()=>ss,isScriptDataInput:()=>Mi,isString:()=>Zn,isValidBIP44Path:()=>za,isValidHardenedPath:()=>Na,mnemonicToSeed:()=>Vo,objectStructTag:()=>Am,optionStructTag:()=>bm,outOfRangeErrorMessage:()=>Cu,paginateWithCursor:()=>On,parseTypeTag:()=>Uo,post:()=>Cs,postAptosFaucet:()=>la,postAptosFullNode:()=>zn,postAptosIndexer:()=>da,request:()=>xu,sign:()=>Wc,splitPath:()=>Ma,standardizeTypeTags:()=>Gc,stringStructTag:()=>xm,throwTypeMismatch:()=>Ke,validateNumberInRange:()=>Er});var cr=class extends Error{constructor(e,n,o){super(o);this.name="AptosApiError",this.url=n.url,this.status=n.status,this.statusText=n.statusText,this.data=n.data,this.request=e}};var lu="0.0.4";var Es=(n=>(n.JSON="application/json",n.BCS="application/x-bcs",n.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",n))(Es||{}),Ji=(b=>(b[b.Bool=0]="Bool",b[b.U8=1]="U8",b[b.U64=2]="U64",b[b.U128=3]="U128",b[b.Address=4]="Address",b[b.Signer=5]="Signer",b[b.Vector=6]="Vector",b[b.Struct=7]="Struct",b[b.U16=8]="U16",b[b.U32=9]="U32",b[b.U256=10]="U256",b[b.Reference=254]="Reference",b[b.Generic=255]="Generic",b))(Ji||{}),ro=(h=>(h[h.U8=0]="U8",h[h.U64=1]="U64",h[h.U128=2]="U128",h[h.Address=3]="Address",h[h.U8Vector=4]="U8Vector",h[h.Bool=5]="Bool",h[h.U16=6]="U16",h[h.U32=7]="U32",h[h.U256=8]="U256",h))(ro||{}),ea=(n=>(n[n.Script=0]="Script",n[n.EntryFunction=2]="EntryFunction",n[n.Multisig=3]="Multisig",n))(ea||{}),ta=(e=>(e[e.MultiAgentTransaction=0]="MultiAgentTransaction",e[e.FeePayerTransaction=1]="FeePayerTransaction",e))(ta||{}),ra=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.MultiAgent=2]="MultiAgent",s[s.FeePayer=3]="FeePayer",s[s.SingleSender=4]="SingleSender",s))(ra||{}),na=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(na||{}),oa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(oa||{}),sa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(sa||{}),ia=(s=>(s.Pending="pending_transaction",s.User="user_transaction",s.Genesis="genesis_transaction",s.BlockMetadata="block_metadata_transaction",s.StateCheckpoint="state_checkpoint_transaction",s))(ia||{}),pu=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(pu||{}),hu=(o=>(o.STORE="store",o.DROP="drop",o.KEY="key",o.COPY="copy",o))(hu||{}),gu=(e=>(e.VALIDATOR="validator",e.FULL_NODE="full_node",e))(gu||{}),no=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(no||{}),aa=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",e))(aa||{}),yu=(s=>(s[s.DeriveAuid=251]="DeriveAuid",s[s.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",s[s.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",s[s.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",s[s.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",s))(yu||{});var mu={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function xu(r,t){let{url:e,method:n,body:o,contentType:s,params:a,overrides:c}=r,f={...c?.HEADERS,"x-aptos-client":`aptos-ts-sdk/${lu}`,"content-type":s??"application/json"};return c?.AUTH_TOKEN&&e.includes("faucet")&&(f.Authorization=`Bearer ${c?.AUTH_TOKEN}`),t.provider({url:e,method:n,body:o,params:a,headers:f,overrides:c})}async function Oo(r,t){let{url:e,path:n}=r,o=`${e}/${n??""}`,s=await xu({...r,url:o},t.client),a={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:o};if(t.isIndexerRequest(e)){let f=a.data;if(f.errors)throw new cr(r,a,f.errors[0].message??`Unhandled Error ${s.status} : ${s.statusText}`);a.data=f.data}if(a.status>=200&&a.status<300)return a;let c;throw"message"in s.data&&"error_code"in s.data?c=JSON.stringify(s.data):a.status in mu?c=mu[a.status]:c=`Unhandled Error ${s.status} : ${s.statusText}`,new cr(r,a,c)}var Ss={mainnet:"https://indexer.mainnet.aptoslabs.com/v1/graphql",testnet:"https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql",devnet:"https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},ca={mainnet:"https://fullnode.mainnet.aptoslabs.com/v1",testnet:"https://fullnode.testnet.aptoslabs.com/v1",devnet:"https://fullnode.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},ua={mainnet:"https://faucet.mainnet.aptoslabs.com",testnet:"https://faucet.testnet.aptoslabs.com",devnet:"https://faucet.devnet.aptoslabs.com",local:"http://127.0.0.1:8081"},zo=(s=>(s.MAINNET="mainnet",s.TESTNET="testnet",s.DEVNET="devnet",s.LOCAL="local",s.CUSTOM="custom",s))(zo||{}),Us={mainnet:1,testnet:2},Jp={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",local:"local",custom:"custom"};var bu="devnet",Au=2e5,wu=20,Bs=20,Tu="0x1::aptos_coin::AptosCoin",_u="APTOS::RawTransaction",fa="APTOS::RawTransactionWithData";async function Eu(r){let{aptosConfig:t,overrides:e,params:n,contentType:o,acceptType:s,path:a,originMethod:c,type:f}=r,h=t.getRequestUrl(f);return Oo({url:h,method:"GET",originMethod:c,path:a,contentType:o?.valueOf(),acceptType:s?.valueOf(),params:n,overrides:{...t.clientConfig,...e}},t)}async function bt(r){return Eu({...r,type:0})}async function On(r){let t=[],e,n=r.params;for(;;){n.start=e;let o=await bt({aptosConfig:r.aptosConfig,originMethod:r.originMethod,path:r.path,params:n,overrides:r.overrides});if(e=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),e==null)break}return t}async function Cs(r){let{type:t,originMethod:e,path:n,body:o,acceptType:s,contentType:a,params:c,aptosConfig:f,overrides:h}=r,g=f.getRequestUrl(t);return Oo({url:g,method:"POST",originMethod:e,path:n,body:o,contentType:a?.valueOf(),acceptType:s?.valueOf(),params:c,overrides:{...f.clientConfig,...h}},f)}async function zn(r){return Cs({...r,type:0})}async function da(r){return Cs({...r,type:1})}async function la(r){return Cs({...r,type:2})}var eh={node:void 0,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0};var Su=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Is=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);var th=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!th)throw new Error("Non little-endian hardware is not supported");var rh=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function No(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=rh[r[e]];return t}function Rs(r){if(typeof r!="string")throw new TypeError("hexToBytes: expected string, got "+typeof r);if(r.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let t=new Uint8Array(r.length/2);for(let e=0;e<t.length;e++){let n=e*2,o=r.slice(n,n+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[e]=s}return t}function nh(r){if(typeof r!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof r}`);return new TextEncoder().encode(r)}function tn(r){if(typeof r=="string"&&(r=nh(r)),!(r instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof r})`);return r}var en=class{clone(){return this._cloneInto()}};function oo(r){let t=n=>r().update(tn(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Uu(r){let t=(n,o)=>r(o).update(tn(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}var Ps=2**8-1,ks=2**16-1,vr=2**32-1,Nn=BigInt(2)**BigInt(64)-BigInt(1),Do=BigInt(2)**BigInt(128)-BigInt(1),Os=BigInt(2)**BigInt(256)-BigInt(1);var mt=class extends Error{constructor(e,n){super(e);this.invalidReason=n}};var Bu=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(Bu||{}),be=class{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return No(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromString(t){let e=t;if(e.startsWith("0x")&&(e=e.slice(2)),e.length===0)throw new mt("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(e.length%2!==0)throw new mt("Hex string must be an even number of hex characters.","invalid_length");try{return new be(Rs(e))}catch(n){let o=n;throw new mt(`Hex string contains invalid hex characters: ${o.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new be(t):be.fromString(t)}static isValid(t){try{return be.fromString(t),{valid:!0}}catch(e){let n=e;return{valid:!1,invalidReason:n.invalidReason,invalidReasonMessage:n.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};var te=class{bcsToBytes(){let t=new Wt;return this.serialize(t),t.toUint8Array()}bcsToHex(){let t=this.bcsToBytes();return be.fromHexInput(t)}},Wt=class{constructor(t=64){if(t<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(t),this.offset=0}ensureBufferWillHandleSize(t){for(;this.buffer.byteLength<this.offset+t;){let e=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}appendToBuffer(t){this.ensureBufferWillHandleSize(t.length),new Uint8Array(this.buffer,this.offset).set(t),this.offset+=t.length}serializeWithFunction(t,e,n){this.ensureBufferWillHandleSize(e);let o=new DataView(this.buffer,this.offset);t.apply(o,[0,n,!0]),this.offset+=e}serializeStr(t){let e=new TextEncoder;this.serializeBytes(e.encode(t))}serializeBytes(t){this.serializeU32AsUleb128(t.length),this.appendToBuffer(t)}serializeFixedBytes(t){this.appendToBuffer(t)}serializeBool(t){zs(t);let e=t?1:0;this.appendToBuffer(new Uint8Array([e]))}serializeU8(t){this.appendToBuffer(new Uint8Array([t]))}serializeU16(t){this.serializeWithFunction(DataView.prototype.setUint16,2,t)}serializeU32(t){this.serializeWithFunction(DataView.prototype.setUint32,4,t)}serializeU64(t){let e=BigInt(t)&BigInt(vr),n=BigInt(t)>>BigInt(32);this.serializeU32(Number(e)),this.serializeU32(Number(n))}serializeU128(t){let e=BigInt(t)&Nn,n=BigInt(t)>>BigInt(64);this.serializeU64(e),this.serializeU64(n)}serializeU256(t){let e=BigInt(t)&Do,n=BigInt(t)>>BigInt(128);this.serializeU128(e),this.serializeU128(n)}serializeU32AsUleb128(t){let e=t,n=[];for(;e>>>7!==0;)n.push(e&127|128),e>>>=7;n.push(e),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(t){t.serialize(this)}serializeVector(t){this.serializeU32AsUleb128(t.length),t.forEach(e=>{e.serialize(this)})}};Jr([Dn(0,Ps)],Wt.prototype,"serializeU8",1),Jr([Dn(0,ks)],Wt.prototype,"serializeU16",1),Jr([Dn(0,vr)],Wt.prototype,"serializeU32",1),Jr([Dn(BigInt(0),Nn)],Wt.prototype,"serializeU64",1),Jr([Dn(BigInt(0),Do)],Wt.prototype,"serializeU128",1),Jr([Dn(BigInt(0),Os)],Wt.prototype,"serializeU256",1),Jr([Dn(0,vr)],Wt.prototype,"serializeU32AsUleb128",1);function zs(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var Cu=(r,t,e)=>`${r} is out of range: [${t}, ${e}]`;function Er(r,t,e){let n=BigInt(r);if(n>BigInt(e)||n<BigInt(t))throw new Error(Cu(r,t,e))}function Dn(r,t){return(e,n,o)=>{let s=o.value;return o.value=function(c){return Er(c,r,t),s.apply(this,[c])},o}}var Iu=(c=>(c.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",c.INVALID_HEX_CHARS="invalid_hex_chars",c.TOO_SHORT="too_short",c.TOO_LONG="too_long",c.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",c.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",c.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",c))(Iu||{}),et=class extends te{constructor(e){super();if(e.length!==et.LENGTH)throw new mt("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=No(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return No(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let n=e.deserializeFixedBytes(et.LENGTH);return new et(n)}static fromString(e){if(!e.startsWith("0x"))throw new mt("Hex string must start with a leading 0x.","leading_zero_x_required");let n=et.fromStringRelaxed(e);if(e.length!==et.LONG_STRING_LENGTH+2)if(n.isSpecial()){if(e.length!==3)throw new mt(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new mt(`The given hex string ${n} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return n}static fromStringRelaxed(e){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new mt("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new mt("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let o;try{o=Rs(n.padStart(64,"0"))}catch(s){let a=s;throw new mt(`Hex characters are invalid: ${a.message}`,"invalid_hex_chars")}return new et(o)}static fromRelaxed(e){return e instanceof et?e:e instanceof Uint8Array?new et(e):et.fromStringRelaxed(e)}static from(e){return e instanceof et?e:e instanceof Uint8Array?new et(e):et.fromString(e)}static isValid(e){try{return e.relaxed?et.fromRelaxed(e.input):et.from(e.input),{valid:!0}}catch(n){let o=n;return{valid:!1,invalidReason:o.invalidReason,invalidReasonMessage:o.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((n,o)=>n===e.data[o])}},O=et;O.LENGTH=32,O.LONG_STRING_LENGTH=64,O.ZERO=et.from("0x0"),O.ONE=et.from("0x1"),O.TWO=et.from("0x2"),O.THREE=et.from("0x3"),O.FOUR=et.from("0x4");function pa(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function oh(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}function Ru(r,...t){if(!(r instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function sh(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");pa(r.outputLen),pa(r.blockLen)}function ih(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function ah(r,t){Ru(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var ch={number:pa,bool:oh,bytes:Ru,hash:sh,exists:ih,output:ah},gt=ch;var Ns=BigInt(4294967295),ha=BigInt(32);function Pu(r,t=!1){return t?{h:Number(r&Ns),l:Number(r>>ha&Ns)}:{h:Number(r>>ha&Ns)|0,l:Number(r&Ns)|0}}function uh(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=Pu(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}var fh=(r,t)=>BigInt(r>>>0)<<ha|BigInt(t>>>0),dh=(r,t,e)=>r>>>e,lh=(r,t,e)=>r<<32-e|t>>>e,ph=(r,t,e)=>r>>>e|t<<32-e,hh=(r,t,e)=>r<<32-e|t>>>e,gh=(r,t,e)=>r<<64-e|t>>>e-32,yh=(r,t,e)=>r>>>e-32|t<<64-e,mh=(r,t)=>t,xh=(r,t)=>r,bh=(r,t,e)=>r<<e|t>>>32-e,Ah=(r,t,e)=>t<<e|r>>>32-e,wh=(r,t,e)=>t<<e-32|r>>>64-e,Th=(r,t,e)=>r<<e-32|t>>>64-e;function _h(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var vh=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Eh=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Sh=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Uh=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Bh=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),Ch=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0,Ih={fromBig:Pu,split:uh,toBig:fh,shrSH:dh,shrSL:lh,rotrSH:ph,rotrSL:hh,rotrBH:gh,rotrBL:yh,rotr32H:mh,rotr32L:xh,rotlSH:bh,rotlSL:Ah,rotlBH:wh,rotlBL:Th,add:_h,add3L:vh,add3H:Eh,add4L:Sh,add4H:Uh,add5H:Ch,add5L:Bh},ne=Ih;var[zu,Nu,Du]=[[],[],[]],Rh=BigInt(0),Mo=BigInt(1),Ph=BigInt(2),kh=BigInt(7),Oh=BigInt(256),zh=BigInt(113);for(let r=0,t=Mo,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],zu.push(2*(5*n+e)),Nu.push((r+1)*(r+2)/2%64);let o=Rh;for(let s=0;s<7;s++)t=(t<<Mo^(t>>kh)*zh)%Oh,t&Ph&&(o^=Mo<<(Mo<<BigInt(s))-Mo);Du.push(o)}var[Nh,Dh]=ne.split(Du,!0),ku=(r,t,e)=>e>32?ne.rotlBH(r,t,e):ne.rotlSH(r,t,e),Ou=(r,t,e)=>e>32?ne.rotlBL(r,t,e):ne.rotlSL(r,t,e);function Mh(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)e[a]=r[a]^r[a+10]^r[a+20]^r[a+30]^r[a+40];for(let a=0;a<10;a+=2){let c=(a+8)%10,f=(a+2)%10,h=e[f],g=e[f+1],y=ku(h,g,1)^e[c],w=Ou(h,g,1)^e[c+1];for(let b=0;b<50;b+=10)r[a+b]^=y,r[a+b+1]^=w}let o=r[2],s=r[3];for(let a=0;a<24;a++){let c=Nu[a],f=ku(o,s,c),h=Ou(o,s,c),g=zu[a];o=r[g],s=r[g+1],r[g]=f,r[g+1]=h}for(let a=0;a<50;a+=10){for(let c=0;c<10;c++)e[c]=r[a+c];for(let c=0;c<10;c++)r[a+c]^=~e[(c+2)%10]&e[(c+4)%10]}r[0]^=Nh[n],r[1]^=Dh[n]}e.fill(0)}var so=class extends en{constructor(t,e,n,o=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,gt.number(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Su(this.state)}keccak(){Mh(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){gt.exists(this);let{blockLen:e,state:n}=this;t=tn(t);let o=t.length;for(let s=0;s<o;){let a=Math.min(e-this.pos,o-s);for(let c=0;c<a;c++)n[this.pos++]^=t[s++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:n,blockLen:o}=this;t[n]^=e,(e&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){gt.exists(this,!1),gt.bytes(t),this.finish();let e=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let a=Math.min(n-this.posOut,s-o);t.set(e.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return gt.number(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(gt.output(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:s,enableXOF:a}=this;return t||(t=new so(e,n,o,a,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}},rn=(r,t,e)=>oo(()=>new so(t,r,e)),Rx=rn(6,144,224/8),Mn=rn(6,136,256/8),Px=rn(6,104,384/8),kx=rn(6,72,512/8),Ox=rn(1,144,224/8),zx=rn(1,136,256/8),Nx=rn(1,104,384/8),Dx=rn(1,72,512/8),Mu=(r,t,e)=>Uu((n={})=>new so(t,r,n.dkLen===void 0?e:n.dkLen,!0)),Mx=Mu(31,168,128/8),qx=Mu(31,136,256/8);var Wo=Zi(Lu());var qo=class{constructor(t){this.buffer=new ArrayBuffer(t.length),new Uint8Array(this.buffer).set(t,0),this.offset=0}read(t){if(this.offset+t>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}deserializeStr(){let t=this.deserializeBytes();return new TextDecoder().decode(t)}deserializeBytes(){let t=this.deserializeUleb128AsU32();return new Uint8Array(this.read(t))}deserializeFixedBytes(t){return new Uint8Array(this.read(t))}deserializeBool(){let t=new Uint8Array(this.read(1))[0];if(t!==1&&t!==0)throw new Error("Invalid boolean value");return t===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let t=this.deserializeU32(),e=this.deserializeU32();return BigInt(BigInt(e)<<BigInt(32)|BigInt(t))}deserializeU128(){let t=this.deserializeU64(),e=this.deserializeU64();return BigInt(e<<BigInt(64)|t)}deserializeU256(){let t=this.deserializeU128(),e=this.deserializeU128();return BigInt(e<<BigInt(128)|t)}deserializeUleb128AsU32(){let t=BigInt(0),e=0;for(;t<vr;){let n=this.deserializeU8();if(t|=BigInt(n&127)<<BigInt(e),(n&128)===0)break;e+=7}if(t>vr)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(t)}deserialize(t){return t.deserialize(this)}deserializeVector(t){let e=this.deserializeUleb128AsU32(),n=new Array;for(let o=0;o<e;o+=1)n.push(this.deserialize(t));return n}};var ur=class extends te{constructor(e){super();this.value=be.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,n){let o=e.deserializeFixedBytes(n);return new ur(o)}};var qn=class extends te{constructor(e){super();this.value=new ur(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,n){let o=ur.deserialize(e,n);return new qn(o.value)}};var Le=class extends te{constructor(e){super();zs(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new Le(e.deserializeBool())}},st=class extends te{constructor(e){super();Er(e,0,Ps),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new st(e.deserializeU8())}},At=class extends te{constructor(e){super();Er(e,0,ks),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new At(e.deserializeU16())}},wt=class extends te{constructor(e){super();Er(e,0,vr),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new wt(e.deserializeU32())}},He=class extends te{constructor(e){super();Er(e,BigInt(0),Nn),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new He(e.deserializeU64())}},Tt=class extends te{constructor(e){super();Er(e,BigInt(0),Do),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new Tt(e.deserializeU128())}},_t=class extends te{constructor(e){super();Er(e,BigInt(0),Os),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new _t(e.deserializeU256())}};var ve=class extends te{constructor(e){super();this.values=e}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){if(!(this.values[0]instanceof st)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let n;if(Array.isArray(e)&&typeof e[0]=="number")n=e;else if(typeof e=="string"){let o=be.fromHexInput(e);n=Array.from(o.toUint8Array())}else if(e instanceof Uint8Array)n=Array.from(e);else throw new Error("Invalid input type");return new ve(n.map(o=>new st(o)))}static U16(e){return new ve(e.map(n=>new At(n)))}static U32(e){return new ve(e.map(n=>new wt(n)))}static U64(e){return new ve(e.map(n=>new He(n)))}static U128(e){return new ve(e.map(n=>new Tt(n)))}static U256(e){return new ve(e.map(n=>new _t(n)))}static Bool(e){return new ve(e.map(n=>new Le(n)))}static MoveString(e){return new ve(e.map(n=>new Ge(n)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,n){let o=e.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1)s.push(n.deserialize(e));return new ve(s)}},Ge=class extends te{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){let n=this.bcsToBytes().slice(1);ve.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new Ge(e.deserializeStr())}},tt=class extends te{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new ve([e]):this.vec=new ve([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new tt(e!=null?new st(e):void 0)}static U16(e){return new tt(e!=null?new At(e):void 0)}static U32(e){return new tt(e!=null?new wt(e):void 0)}static U64(e){return new tt(e!=null?new He(e):void 0)}static U128(e){return new tt(e!=null?new Tt(e):void 0)}static U256(e){return new tt(e!=null?new _t(e):void 0)}static Bool(e){return new tt(e!=null?new Le(e):void 0)}static MoveString(e){return new tt(e!=null?new Ge(e):void 0)}static deserialize(e,n){let o=ve.deserialize(e,n);return new tt(o.values[0])}};var Pt=class extends te{},Ln=class extends te{},Qt=class extends te{};var Ms=class extends en{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,gt.hash(t);let n=tn(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new TypeError("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return gt.exists(this),this.iHash.update(t),this}digestInto(t){gt.exists(this),gt.bytes(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},ga=(r,t,e)=>new Ms(r,t).update(e).digest();ga.create=(r,t)=>new Ms(r,t);function qh(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var qs=class extends en{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Is(this.buffer)}update(t){gt.exists(this);let{view:e,buffer:n,blockLen:o}=this;t=tn(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=Is(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){gt.exists(this),gt.output(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let f=a;f<o;f++)e[f]=0;qh(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=Is(t);this.get().forEach((f,h)=>c.setUint32(4*h,f,s))}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};var[Lh,Hh]=ne.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),nn=new Uint32Array(80),on=new Uint32Array(80),Lo=class extends qs{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)nn[E]=t.getUint32(e),on[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=nn[E-15]|0,D=on[E-15]|0,F=ne.rotrSH(K,D,1)^ne.rotrSH(K,D,8)^ne.shrSH(K,D,7),J=ne.rotrSL(K,D,1)^ne.rotrSL(K,D,8)^ne.shrSL(K,D,7),G=nn[E-2]|0,oe=on[E-2]|0,de=ne.rotrSH(G,oe,19)^ne.rotrBH(G,oe,61)^ne.shrSH(G,oe,6),ce=ne.rotrSL(G,oe,19)^ne.rotrBL(G,oe,61)^ne.shrSL(G,oe,6),Pe=ne.add4L(J,ce,on[E-7],on[E-16]),Oe=ne.add4H(Pe,F,de,nn[E-7],nn[E-16]);nn[E]=Oe|0,on[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=ne.rotrSH(y,w,14)^ne.rotrSH(y,w,18)^ne.rotrBH(y,w,41),D=ne.rotrSL(y,w,14)^ne.rotrSL(y,w,18)^ne.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=ne.add5L(M,D,J,Hh[E],on[E]),oe=ne.add5H(G,R,K,F,Lh[E],nn[E]),de=G|0,ce=ne.rotrSH(n,o,28)^ne.rotrBH(n,o,34)^ne.rotrBH(n,o,39),Pe=ne.rotrSL(n,o,28)^ne.rotrBL(n,o,34)^ne.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=ne.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=ne.add3L(de,Pe,at);n=ne.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=ne.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=ne.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=ne.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=ne.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=ne.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=ne.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=ne.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=ne.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){nn.fill(0),on.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},ya=class extends Lo{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},ma=class extends Lo{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}},Hu=oo(()=>new Lo),Db=oo(()=>new ya),Mb=oo(()=>new ma);var Uf=Zi(Sf()),Bf=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,Cf=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,If=(t=>(t.ED25519="ed25519 seed",t))(If||{}),Oa=2147483648;function za(r){return Cf.test(r)}function Na(r){return Bf.test(r)}var Xs=(r,t)=>{let e=ga.create(Hu,r).update(t).digest();return{key:e.slice(0,32),chainCode:e.slice(32)}},Da=({key:r,chainCode:t},e)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,e);let o=new Uint8Array(n),s=new Uint8Array([0]),a=new Uint8Array([...s,...r,...o]);return Xs(t,a)},V0=r=>r.replace("'",""),Ma=r=>r.split("/").slice(1).map(V0),Vo=r=>{let t=r.trim().split(/\s+/).map(e=>e.toLowerCase()).join(" ");return Uf.mnemonicToSeedSync(t)};var uo=class extends Pt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==uo.LENGTH)throw new Error(`PublicKey length should be ${uo.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=be.fromHexInput(n).toUint8Array(),a=o.toUint8Array();return Wo.default.sign.detached.verify(s,a,this.key.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new uo(n)}static load(e){let n=e.deserializeBytes();return new uo(n)}},De=uo;De.LENGTH=32;var Lt=class extends Ln{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==Lt.LENGTH)throw new Error(`PrivateKey length should be ${Lt.LENGTH}`);this.signingKeyPair=Wo.default.sign.keyPair.fromSeed(n.toUint8Array().slice(0,Lt.LENGTH))}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,Lt.LENGTH)}toString(){return be.fromHexInput(this.toUint8Array()).toString()}sign(e){let n=be.fromHexInput(e),o=Wo.default.sign.detached(n.toUint8Array(),this.signingKeyPair.secretKey);return new je(o)}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Lt(n)}static generate(){let e=Wo.default.sign.keyPair();return new Lt(e.secretKey.slice(0,Lt.LENGTH))}publicKey(){let e=this.signingKeyPair.publicKey;return new De(e)}static fromDerivationPath(e,n){if(!Na(e))throw new Error(`Invalid derivation path ${e}`);return Lt.fromDerivationPathInner(e,Vo(n))}static fromDerivationPathInner(e,n,o=Oa){let{key:s,chainCode:a}=Xs(Lt.SLIP_0010_SEED,n),c=Ma(e).map(h=>parseInt(h,10)),{key:f}=c.reduce((h,g)=>Da(h,g+o),{key:s,chainCode:a});return new Lt(f)}},Zt=Lt;Zt.LENGTH=32,Zt.SLIP_0010_SEED="ed25519 seed";var fo=class extends Qt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==fo.LENGTH)throw new Error(`Signature length should be ${fo.LENGTH}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new fo(n)}static load(e){let n=e.deserializeBytes();return new fo(n)}},je=fo;je.LENGTH=64;var Ur=class extends Pt{constructor(e){super();let{publicKeys:n,threshold:o}=e;if(n.length>Ur.MAX_KEYS||n.length<Ur.MIN_KEYS)throw new Error(`Must have between ${Ur.MIN_KEYS} and ${Ur.MAX_KEYS} public keys, inclusive`);if(o<Ur.MIN_THRESHOLD||o>n.length)throw new Error(`Threshold must be between ${Ur.MIN_THRESHOLD} and ${n.length}, inclusive`);this.publicKeys=n,this.threshold=o}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*De.LENGTH+1);return this.publicKeys.forEach((n,o)=>{e.set(n.toUint8Array(),o*De.LENGTH)}),e[this.publicKeys.length*De.LENGTH]=this.threshold,e}toString(){return be.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n[n.length-1],s=[];for(let a=0;a<n.length-1;a+=De.LENGTH){let c=a;s.push(new De(n.subarray(c,c+De.LENGTH)))}return new Ur({publicKeys:s,threshold:o})}},Et=Ur;Et.MAX_KEYS=32,Et.MIN_KEYS=2,Et.MIN_THRESHOLD=1;var pr=class extends Qt{constructor(e){super();let{signatures:n,bitmap:o}=e;if(o.length!==pr.BITMAP_LEN)throw new Error(`"bitmap" length should be ${pr.BITMAP_LEN}`);if(n.length>pr.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${pr.MAX_SIGNATURES_SUPPORTED}`);this.signatures=n,this.bitmap=o}toUint8Array(){let e=new Uint8Array(this.signatures.length*je.LENGTH+pr.BITMAP_LEN);return this.signatures.forEach((n,o)=>{e.set(n.toUint8Array(),o*je.LENGTH)}),e.set(this.bitmap,this.signatures.length*je.LENGTH),e}toString(){return be.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),a=new Set;return n.forEach(c=>{if(c>=pr.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${pr.MAX_SIGNATURES_SUPPORTED-1}.`);if(a.has(c))throw new Error("Duplicate bits detected.");a.add(c);let f=Math.floor(c/8),h=s[f];h|=o>>c%8,s[f]=h}),s}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n.subarray(n.length-4),s=[];for(let a=0;a<n.length-o.length;a+=je.LENGTH){let c=a;s.push(new je(n.subarray(c,c+je.LENGTH)))}return new pr({signatures:s,bitmap:o})}},Br=pr;Br.MAX_SIGNATURES_SUPPORTED=32,Br.BITMAP_LEN=4;function Rf(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Cr(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function Pf(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Rf(r.outputLen),Rf(r.blockLen)}function lo(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function kf(r,t){Cr(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var Zs=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var qa=r=>r instanceof Uint8Array;var dn=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Jt=(r,t)=>r<<32-t|r>>>t,W0=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!W0)throw new Error("Non little-endian hardware is not supported");var Q0=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Of(r){if(!qa(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=Q0[r[e]];return t}function zf(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),a=Number.parseInt(s,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");e[n]=a}return e}function La(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function Qo(r){if(typeof r=="string"&&(r=La(r)),!qa(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function Gn(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!qa(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}var po=class{clone(){return this._cloneInto()}},dA={}.toString;function ho(r){let t=n=>r().update(Qo(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Nf(r=32){if(Zs&&typeof Zs.getRandomValues=="function")return Zs.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}function Y0(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),a=Number(e>>o&s),c=Number(e&s),f=n?4:0,h=n?0:4;r.setUint32(t+f,a,n),r.setUint32(t+h,c,n)}var ln=class extends po{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=dn(this.buffer)}update(t){lo(this);let{view:e,buffer:n,blockLen:o}=this;t=Qo(t);let s=t.length;for(let a=0;a<s;){let c=Math.min(o-this.pos,s-a);if(c===o){let f=dn(t);for(;o<=s-a;a+=o)this.process(f,a);continue}n.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){lo(this),kf(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:a}=this;e[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>o-a&&(this.process(n,0),a=0);for(let y=a;y<o;y++)e[y]=0;Y0(n,o-8,BigInt(this.length*8),s),this.process(n,0);let c=dn(t),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let h=f/4,g=this.get();if(h>g.length)throw new Error("_sha2: outputLen bigger than state");for(let y=0;y<h;y++)c.setUint32(4*y,g[y],s)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:a,pos:c}=this;return t.length=o,t.pos=c,t.finished=s,t.destroyed=a,o%e&&t.buffer.set(n),t}};var X0=(r,t,e)=>r&t^~r&e,Z0=(r,t,e)=>r&t^r&e^t&e,J0=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),pn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),hn=new Uint32Array(64),Ha=class extends ln{constructor(){super(64,32,8,!1),this.A=pn[0]|0,this.B=pn[1]|0,this.C=pn[2]|0,this.D=pn[3]|0,this.E=pn[4]|0,this.F=pn[5]|0,this.G=pn[6]|0,this.H=pn[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:a,G:c,H:f}=this;return[t,e,n,o,s,a,c,f]}set(t,e,n,o,s,a,c,f){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=a|0,this.G=c|0,this.H=f|0}process(t,e){for(let y=0;y<16;y++,e+=4)hn[y]=t.getUint32(e,!1);for(let y=16;y<64;y++){let w=hn[y-15],b=hn[y-2],I=Jt(w,7)^Jt(w,18)^w>>>3,T=Jt(b,17)^Jt(b,19)^b>>>10;hn[y]=T+hn[y-7]+I+hn[y-16]|0}let{A:n,B:o,C:s,D:a,E:c,F:f,G:h,H:g}=this;for(let y=0;y<64;y++){let w=Jt(c,6)^Jt(c,11)^Jt(c,25),b=g+w+X0(c,f,h)+J0[y]+hn[y]|0,T=(Jt(n,2)^Jt(n,13)^Jt(n,22))+Z0(n,o,s)|0;g=h,h=f,f=c,c=a+b|0,a=s,s=o,o=n,n=b+T|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,a=a+this.D|0,c=c+this.E|0,f=f+this.F|0,h=h+this.G|0,g=g+this.H|0,this.set(n,o,s,a,c,f,h,g)}roundClean(){hn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var Yo=ho(()=>new Ha);var Ka={};fu(Ka,{bitGet:()=>ig,bitLen:()=>sg,bitMask:()=>Xo,bitSet:()=>ag,bytesToHex:()=>Fn,bytesToNumberBE:()=>Ir,bytesToNumberLE:()=>ti,concatBytes:()=>go,createHmacDrbg:()=>$a,ensureBytes:()=>kt,equalBytes:()=>ng,hexToBytes:()=>$n,hexToNumber:()=>Fa,numberToBytesBE:()=>gn,numberToBytesLE:()=>ri,numberToHexUnpadded:()=>qf,numberToVarBytesBE:()=>rg,utf8ToBytes:()=>og,validateObject:()=>yn});var Mf=BigInt(0),Js=BigInt(1),eg=BigInt(2),ei=r=>r instanceof Uint8Array,tg=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Fn(r){if(!ei(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=tg[r[e]];return t}function qf(r){let t=r.toString(16);return t.length&1?`0${t}`:t}function Fa(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function $n(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),a=Number.parseInt(s,16);if(Number.isNaN(a)||a<0)throw new Error("Invalid byte sequence");e[n]=a}return e}function Ir(r){return Fa(Fn(r))}function ti(r){if(!ei(r))throw new Error("Uint8Array expected");return Fa(Fn(Uint8Array.from(r).reverse()))}function gn(r,t){return $n(r.toString(16).padStart(t*2,"0"))}function ri(r,t){return gn(r,t).reverse()}function rg(r){return $n(qf(r))}function kt(r,t,e){let n;if(typeof t=="string")try{n=$n(t)}catch(s){throw new Error(`${r} must be valid hex string, got "${t}". Cause: ${s}`)}else if(ei(t))n=Uint8Array.from(t);else throw new Error(`${r} must be hex string or Uint8Array`);let o=n.length;if(typeof e=="number"&&o!==e)throw new Error(`${r} expected ${e} bytes, got ${o}`);return n}function go(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!ei(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}function ng(r,t){if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}function og(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function sg(r){let t;for(t=0;r>Mf;r>>=Js,t+=1);return t}function ig(r,t){return r>>BigInt(t)&Js}var ag=(r,t,e)=>r|(e?Js:Mf)<<BigInt(t),Xo=r=>(eg<<BigInt(r-1))-Js,Ga=r=>new Uint8Array(r),Df=r=>Uint8Array.from(r);function $a(r,t,e){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let n=Ga(r),o=Ga(r),s=0,a=()=>{n.fill(1),o.fill(0),s=0},c=(...y)=>e(o,n,...y),f=(y=Ga())=>{o=c(Df([0]),y),n=c(),y.length!==0&&(o=c(Df([1]),y),n=c())},h=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let y=0,w=[];for(;y<t;){n=c();let b=n.slice();w.push(b),y+=n.length}return go(...w)};return(y,w)=>{a(),f(y);let b;for(;!(b=w(h()));)f();return a(),b}}var cg={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function yn(r,t,e={}){let n=(o,s,a)=>{let c=cg[s];if(typeof c!="function")throw new Error(`Invalid validator "${s}", expected function`);let f=r[o];if(!(a&&f===void 0)&&!c(f,r))throw new Error(`Invalid param ${String(o)}=${f} (${typeof f}), expected ${s}`)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(e))n(o,s,!0);return r}var it=BigInt(0),Ye=BigInt(1),Kn=BigInt(2),ug=BigInt(3),ja=BigInt(4),Lf=BigInt(5),Hf=BigInt(8),fg=BigInt(9),dg=BigInt(16);function ct(r,t){let e=r%t;return e>=it?e:t+e}function lg(r,t,e){if(e<=it||t<it)throw new Error("Expected power/modulo > 0");if(e===Ye)return it;let n=Ye;for(;t>it;)t&Ye&&(n=n*r%e),r=r*r%e,t>>=Ye;return n}function Ot(r,t,e){let n=r;for(;t-- >it;)n*=n,n%=e;return n}function ni(r,t){if(r===it||t<=it)throw new Error(`invert: expected positive integers, got n=${r} mod=${t}`);let e=ct(r,t),n=t,o=it,s=Ye,a=Ye,c=it;for(;e!==it;){let h=n/e,g=n%e,y=o-a*h,w=s-c*h;n=e,e=g,o=a,s=c,a=y,c=w}if(n!==Ye)throw new Error("invert: does not exist");return ct(o,t)}function pg(r){let t=(r-Ye)/Kn,e,n,o;for(e=r-Ye,n=0;e%Kn===it;e/=Kn,n++);for(o=Kn;o<r&&lg(o,t,r)!==r-Ye;o++);if(n===1){let a=(r+Ye)/ja;return function(f,h){let g=f.pow(h,a);if(!f.eql(f.sqr(g),h))throw new Error("Cannot find square root");return g}}let s=(e+Ye)/Kn;return function(c,f){if(c.pow(f,t)===c.neg(c.ONE))throw new Error("Cannot find square root");let h=n,g=c.pow(c.mul(c.ONE,o),e),y=c.pow(f,s),w=c.pow(f,e);for(;!c.eql(w,c.ONE);){if(c.eql(w,c.ZERO))return c.ZERO;let b=1;for(let T=c.sqr(w);b<h&&!c.eql(T,c.ONE);b++)T=c.sqr(T);let I=c.pow(g,Ye<<BigInt(h-b-1));g=c.sqr(I),y=c.mul(y,I),w=c.mul(w,g),h=b}return y}}function hg(r){if(r%ja===ug){let t=(r+Ye)/ja;return function(n,o){let s=n.pow(o,t);if(!n.eql(n.sqr(s),o))throw new Error("Cannot find square root");return s}}if(r%Hf===Lf){let t=(r-Lf)/Hf;return function(n,o){let s=n.mul(o,Kn),a=n.pow(s,t),c=n.mul(o,a),f=n.mul(n.mul(c,Kn),a),h=n.mul(c,n.sub(f,n.ONE));if(!n.eql(n.sqr(h),o))throw new Error("Cannot find square root");return h}}return r%dg,pg(r)}var gg=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Va(r){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=gg.reduce((n,o)=>(n[o]="function",n),t);return yn(r,e)}function yg(r,t,e){if(e<it)throw new Error("Expected power > 0");if(e===it)return r.ONE;if(e===Ye)return t;let n=r.ONE,o=t;for(;e>it;)e&Ye&&(n=r.mul(n,o)),o=r.sqr(o),e>>=Ye;return n}function mg(r,t){let e=new Array(t.length),n=t.reduce((s,a,c)=>r.is0(a)?s:(e[c]=s,r.mul(s,a)),r.ONE),o=r.inv(n);return t.reduceRight((s,a,c)=>r.is0(a)?s:(e[c]=r.mul(s,e[c]),r.mul(s,a)),o),e}function Wa(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function Gf(r,t,e=!1,n={}){if(r<=it)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:o,nByteLength:s}=Wa(r,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let a=hg(r),c=Object.freeze({ORDER:r,BITS:o,BYTES:s,MASK:Xo(o),ZERO:it,ONE:Ye,create:f=>ct(f,r),isValid:f=>{if(typeof f!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof f}`);return it<=f&&f<r},is0:f=>f===it,isOdd:f=>(f&Ye)===Ye,neg:f=>ct(-f,r),eql:(f,h)=>f===h,sqr:f=>ct(f*f,r),add:(f,h)=>ct(f+h,r),sub:(f,h)=>ct(f-h,r),mul:(f,h)=>ct(f*h,r),pow:(f,h)=>yg(c,f,h),div:(f,h)=>ct(f*ni(h,r),r),sqrN:f=>f*f,addN:(f,h)=>f+h,subN:(f,h)=>f-h,mulN:(f,h)=>f*h,inv:f=>ni(f,r),sqrt:n.sqrt||(f=>a(c,f)),invertBatch:f=>mg(c,f),cmov:(f,h,g)=>g?h:f,toBytes:f=>e?ri(f,s):gn(f,s),fromBytes:f=>{if(f.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${f.length}`);return e?ti(f):Ir(f)}});return Object.freeze(c)}function Ff(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function Qa(r){let t=Ff(r);return t+Math.ceil(t/2)}function $f(r,t,e=!1){let n=r.length,o=Ff(t),s=Qa(t);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let a=e?Ir(r):ti(r),c=ct(a,t-Ye)+Ye;return e?ri(c,o):gn(c,o)}var bg=BigInt(0),Ya=BigInt(1);function Kf(r,t){let e=(o,s)=>{let a=s.negate();return o?a:s},n=o=>{let s=Math.ceil(t/o)+1,a=2**(o-1);return{windows:s,windowSize:a}};return{constTimeNegate:e,unsafeLadder(o,s){let a=r.ZERO,c=o;for(;s>bg;)s&Ya&&(a=a.add(c)),c=c.double(),s>>=Ya;return a},precomputeWindow(o,s){let{windows:a,windowSize:c}=n(s),f=[],h=o,g=h;for(let y=0;y<a;y++){g=h,f.push(g);for(let w=1;w<c;w++)g=g.add(h),f.push(g);h=g.double()}return f},wNAF(o,s,a){let{windows:c,windowSize:f}=n(o),h=r.ZERO,g=r.BASE,y=BigInt(2**o-1),w=2**o,b=BigInt(o);for(let I=0;I<c;I++){let T=I*f,S=Number(a&y);a>>=b,S>f&&(S-=w,a+=Ya);let R=T,M=T+Math.abs(S)-1,E=I%2!==0,K=S<0;S===0?g=g.add(e(E,s[R])):h=h.add(e(K,s[M]))}return{p:h,f:g}},wNAFCached(o,s,a,c){let f=o._WINDOW_SIZE||1,h=s.get(o);return h||(h=this.precomputeWindow(o,f),f!==1&&s.set(o,c(h))),this.wNAF(f,h,a)}}}function Xa(r){return Va(r.Fp),yn(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Wa(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function Ag(r){let t=Xa(r);yn(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:wg,hexToBytes:Tg}=Ka,jn={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(r){let{Err:t}=jn;if(r.length<2||r[0]!==2)throw new t("Invalid signature integer tag");let e=r[1],n=r.subarray(2,e+2);if(!e||n.length!==e)throw new t("Invalid signature integer: wrong length");if(n[0]&128)throw new t("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:wg(n),l:r.subarray(e+2)}},toSig(r){let{Err:t}=jn,e=typeof r=="string"?Tg(r):r;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let n=e.length;if(n<2||e[0]!=48)throw new t("Invalid signature tag");if(e[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:o,l:s}=jn._parseInt(e.subarray(2)),{d:a,l:c}=jn._parseInt(s);if(c.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:a}},hexFromSig(r){let t=h=>Number.parseInt(h[0],16)&8?"00"+h:h,e=h=>{let g=h.toString(16);return g.length&1?`0${g}`:g},n=t(e(r.s)),o=t(e(r.r)),s=n.length/2,a=o.length/2,c=e(s),f=e(a);return`30${e(a+s+4)}02${f}${o}02${c}${n}`}},Rr=BigInt(0),Ht=BigInt(1),SA=BigInt(2),jf=BigInt(3),UA=BigInt(4);function _g(r){let t=Ag(r),{Fp:e}=t,n=t.toBytes||((I,T,S)=>{let R=T.toAffine();return go(Uint8Array.from([4]),e.toBytes(R.x),e.toBytes(R.y))}),o=t.fromBytes||(I=>{let T=I.subarray(1),S=e.fromBytes(T.subarray(0,e.BYTES)),R=e.fromBytes(T.subarray(e.BYTES,2*e.BYTES));return{x:S,y:R}});function s(I){let{a:T,b:S}=t,R=e.sqr(I),M=e.mul(R,I);return e.add(e.add(M,e.mul(I,T)),S)}if(!e.eql(e.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function a(I){return typeof I=="bigint"&&Rr<I&&I<t.n}function c(I){if(!a(I))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function f(I){let{allowedPrivateKeyLengths:T,nByteLength:S,wrapPrivateKey:R,n:M}=t;if(T&&typeof I!="bigint"){if(I instanceof Uint8Array&&(I=Fn(I)),typeof I!="string"||!T.includes(I.length))throw new Error("Invalid key");I=I.padStart(S*2,"0")}let E;try{E=typeof I=="bigint"?I:Ir(kt("private key",I,S))}catch{throw new Error(`private key must be ${S} bytes, hex or bigint, not ${typeof I}`)}return R&&(E=ct(E,M)),c(E),E}let h=new Map;function g(I){if(!(I instanceof y))throw new Error("ProjectivePoint expected")}class y{constructor(T,S,R){if(this.px=T,this.py=S,this.pz=R,T==null||!e.isValid(T))throw new Error("x required");if(S==null||!e.isValid(S))throw new Error("y required");if(R==null||!e.isValid(R))throw new Error("z required")}static fromAffine(T){let{x:S,y:R}=T||{};if(!T||!e.isValid(S)||!e.isValid(R))throw new Error("invalid affine point");if(T instanceof y)throw new Error("projective point not allowed");let M=E=>e.eql(E,e.ZERO);return M(S)&&M(R)?y.ZERO:new y(S,R,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(T){let S=e.invertBatch(T.map(R=>R.pz));return T.map((R,M)=>R.toAffine(S[M])).map(y.fromAffine)}static fromHex(T){let S=y.fromAffine(o(kt("pointHex",T)));return S.assertValidity(),S}static fromPrivateKey(T){return y.BASE.multiply(f(T))}_setWindowSize(T){this._WINDOW_SIZE=T,h.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!e.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:T,y:S}=this.toAffine();if(!e.isValid(T)||!e.isValid(S))throw new Error("bad point: x or y not FE");let R=e.sqr(S),M=s(T);if(!e.eql(R,M))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:T}=this.toAffine();if(e.isOdd)return!e.isOdd(T);throw new Error("Field doesn't support isOdd")}equals(T){g(T);let{px:S,py:R,pz:M}=this,{px:E,py:K,pz:D}=T,F=e.eql(e.mul(S,D),e.mul(E,M)),J=e.eql(e.mul(R,D),e.mul(K,M));return F&&J}negate(){return new y(this.px,e.neg(this.py),this.pz)}double(){let{a:T,b:S}=t,R=e.mul(S,jf),{px:M,py:E,pz:K}=this,D=e.ZERO,F=e.ZERO,J=e.ZERO,G=e.mul(M,M),oe=e.mul(E,E),de=e.mul(K,K),ce=e.mul(M,E);return ce=e.add(ce,ce),J=e.mul(M,K),J=e.add(J,J),D=e.mul(T,J),F=e.mul(R,de),F=e.add(D,F),D=e.sub(oe,F),F=e.add(oe,F),F=e.mul(D,F),D=e.mul(ce,D),J=e.mul(R,J),de=e.mul(T,de),ce=e.sub(G,de),ce=e.mul(T,ce),ce=e.add(ce,J),J=e.add(G,G),G=e.add(J,G),G=e.add(G,de),G=e.mul(G,ce),F=e.add(F,G),de=e.mul(E,K),de=e.add(de,de),G=e.mul(de,ce),D=e.sub(D,G),J=e.mul(de,oe),J=e.add(J,J),J=e.add(J,J),new y(D,F,J)}add(T){g(T);let{px:S,py:R,pz:M}=this,{px:E,py:K,pz:D}=T,F=e.ZERO,J=e.ZERO,G=e.ZERO,oe=t.a,de=e.mul(t.b,jf),ce=e.mul(S,E),Pe=e.mul(R,K),Oe=e.mul(M,D),at=e.add(S,R),z=e.add(E,K);at=e.mul(at,z),z=e.add(ce,Pe),at=e.sub(at,z),z=e.add(S,M);let V=e.add(E,D);return z=e.mul(z,V),V=e.add(ce,Oe),z=e.sub(z,V),V=e.add(R,M),F=e.add(K,D),V=e.mul(V,F),F=e.add(Pe,Oe),V=e.sub(V,F),G=e.mul(oe,z),F=e.mul(de,Oe),G=e.add(F,G),F=e.sub(Pe,G),G=e.add(Pe,G),J=e.mul(F,G),Pe=e.add(ce,ce),Pe=e.add(Pe,ce),Oe=e.mul(oe,Oe),z=e.mul(de,z),Pe=e.add(Pe,Oe),Oe=e.sub(ce,Oe),Oe=e.mul(oe,Oe),z=e.add(z,Oe),ce=e.mul(Pe,z),J=e.add(J,ce),ce=e.mul(V,z),F=e.mul(at,F),F=e.sub(F,ce),ce=e.mul(at,Pe),G=e.mul(V,G),G=e.add(G,ce),new y(F,J,G)}subtract(T){return this.add(T.negate())}is0(){return this.equals(y.ZERO)}wNAF(T){return b.wNAFCached(this,h,T,S=>{let R=e.invertBatch(S.map(M=>M.pz));return S.map((M,E)=>M.toAffine(R[E])).map(y.fromAffine)})}multiplyUnsafe(T){let S=y.ZERO;if(T===Rr)return S;if(c(T),T===Ht)return this;let{endo:R}=t;if(!R)return b.unsafeLadder(this,T);let{k1neg:M,k1:E,k2neg:K,k2:D}=R.splitScalar(T),F=S,J=S,G=this;for(;E>Rr||D>Rr;)E&Ht&&(F=F.add(G)),D&Ht&&(J=J.add(G)),G=G.double(),E>>=Ht,D>>=Ht;return M&&(F=F.negate()),K&&(J=J.negate()),J=new y(e.mul(J.px,R.beta),J.py,J.pz),F.add(J)}multiply(T){c(T);let S=T,R,M,{endo:E}=t;if(E){let{k1neg:K,k1:D,k2neg:F,k2:J}=E.splitScalar(S),{p:G,f:oe}=this.wNAF(D),{p:de,f:ce}=this.wNAF(J);G=b.constTimeNegate(K,G),de=b.constTimeNegate(F,de),de=new y(e.mul(de.px,E.beta),de.py,de.pz),R=G.add(de),M=oe.add(ce)}else{let{p:K,f:D}=this.wNAF(S);R=K,M=D}return y.normalizeZ([R,M])[0]}multiplyAndAddUnsafe(T,S,R){let M=y.BASE,E=(D,F)=>F===Rr||F===Ht||!D.equals(M)?D.multiplyUnsafe(F):D.multiply(F),K=E(this,S).add(E(T,R));return K.is0()?void 0:K}toAffine(T){let{px:S,py:R,pz:M}=this,E=this.is0();T==null&&(T=E?e.ONE:e.inv(M));let K=e.mul(S,T),D=e.mul(R,T),F=e.mul(M,T);if(E)return{x:e.ZERO,y:e.ZERO};if(!e.eql(F,e.ONE))throw new Error("invZ was invalid");return{x:K,y:D}}isTorsionFree(){let{h:T,isTorsionFree:S}=t;if(T===Ht)return!0;if(S)return S(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:T,clearCofactor:S}=t;return T===Ht?this:S?S(y,this):this.multiplyUnsafe(t.h)}toRawBytes(T=!0){return this.assertValidity(),n(y,this,T)}toHex(T=!0){return Fn(this.toRawBytes(T))}}y.BASE=new y(t.Gx,t.Gy,e.ONE),y.ZERO=new y(e.ZERO,e.ONE,e.ZERO);let w=t.nBitLength,b=Kf(y,t.endo?Math.ceil(w/2):w);return{CURVE:t,ProjectivePoint:y,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:a}}function vg(r){let t=Xa(r);return yn(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Vf(r){let t=vg(r),{Fp:e,n}=t,o=e.BYTES+1,s=2*e.BYTES+1;function a(z){return Rr<z&&z<e.ORDER}function c(z){return ct(z,n)}function f(z){return ni(z,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:g,weierstrassEquation:y,isWithinCurveOrder:w}=_g({...t,toBytes(z,V,le){let Re=V.toAffine(),ke=e.toBytes(Re.x),Ze=go;return le?Ze(Uint8Array.from([V.hasEvenY()?2:3]),ke):Ze(Uint8Array.from([4]),ke,e.toBytes(Re.y))},fromBytes(z){let V=z.length,le=z[0],Re=z.subarray(1);if(V===o&&(le===2||le===3)){let ke=Ir(Re);if(!a(ke))throw new Error("Point is not on curve");let Ze=y(ke),dt=e.sqrt(Ze),Me=(dt&Ht)===Ht;return(le&1)===1!==Me&&(dt=e.neg(dt)),{x:ke,y:dt}}else if(V===s&&le===4){let ke=e.fromBytes(Re.subarray(0,e.BYTES)),Ze=e.fromBytes(Re.subarray(e.BYTES,2*e.BYTES));return{x:ke,y:Ze}}else throw new Error(`Point of length ${V} was invalid. Expected ${o} compressed bytes or ${s} uncompressed bytes`)}}),b=z=>Fn(gn(z,t.nByteLength));function I(z){let V=n>>Ht;return z>V}function T(z){return I(z)?c(-z):z}let S=(z,V,le)=>Ir(z.slice(V,le));class R{constructor(V,le,Re){this.r=V,this.s=le,this.recovery=Re,this.assertValidity()}static fromCompact(V){let le=t.nByteLength;return V=kt("compactSignature",V,le*2),new R(S(V,0,le),S(V,le,2*le))}static fromDER(V){let{r:le,s:Re}=jn.toSig(kt("DER",V));return new R(le,Re)}assertValidity(){if(!w(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!w(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(V){return new R(this.r,this.s,V)}recoverPublicKey(V){let{r:le,s:Re,recovery:ke}=this,Ze=J(kt("msgHash",V));if(ke==null||![0,1,2,3].includes(ke))throw new Error("recovery id invalid");let dt=ke===2||ke===3?le+t.n:le;if(dt>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let Me=(ke&1)===0?"02":"03",rt=h.fromHex(Me+b(dt)),pe=f(dt),nt=c(-Ze*pe),Yr=c(Re*pe),Vt=h.BASE.multiplyAndAddUnsafe(rt,nt,Yr);if(!Vt)throw new Error("point at infinify");return Vt.assertValidity(),Vt}hasHighS(){return I(this.s)}normalizeS(){return this.hasHighS()?new R(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return $n(this.toDERHex())}toDERHex(){return jn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return $n(this.toCompactHex())}toCompactHex(){return b(this.r)+b(this.s)}}let M={isValidPrivateKey(z){try{return g(z),!0}catch{return!1}},normPrivateKeyToScalar:g,randomPrivateKey:()=>{let z=Qa(t.n);return $f(t.randomBytes(z),t.n)},precompute(z=8,V=h.BASE){return V._setWindowSize(z),V.multiply(BigInt(3)),V}};function E(z,V=!0){return h.fromPrivateKey(z).toRawBytes(V)}function K(z){let V=z instanceof Uint8Array,le=typeof z=="string",Re=(V||le)&&z.length;return V?Re===o||Re===s:le?Re===2*o||Re===2*s:z instanceof h}function D(z,V,le=!0){if(K(z))throw new Error("first arg must be private key");if(!K(V))throw new Error("second arg must be public key");return h.fromHex(V).multiply(g(z)).toRawBytes(le)}let F=t.bits2int||function(z){let V=Ir(z),le=z.length*8-t.nBitLength;return le>0?V>>BigInt(le):V},J=t.bits2int_modN||function(z){return c(F(z))},G=Xo(t.nBitLength);function oe(z){if(typeof z!="bigint")throw new Error("bigint expected");if(!(Rr<=z&&z<G))throw new Error(`bigint expected < 2^${t.nBitLength}`);return gn(z,t.nByteLength)}function de(z,V,le=ce){if(["recovered","canonical"].some(Mt=>Mt in le))throw new Error("sign() legacy options not supported");let{hash:Re,randomBytes:ke}=t,{lowS:Ze,prehash:dt,extraEntropy:Me}=le;Ze==null&&(Ze=!0),z=kt("msgHash",z),dt&&(z=kt("prehashed msgHash",Re(z)));let rt=J(z),pe=g(V),nt=[oe(pe),oe(rt)];if(Me!=null){let Mt=Me===!0?ke(e.BYTES):Me;nt.push(kt("extraEntropy",Mt))}let Yr=go(...nt),Vt=rt;function Xr(Mt){let Tr=F(Mt);if(!w(Tr))return;let Rn=f(Tr),It=h.BASE.multiply(Tr).toAffine(),Zr=c(It.x);if(Zr===Rr)return;let Jn=c(Rn*c(Vt+Zr*pe));if(Jn===Rr)return;let bs=(It.x===Zr?0:2)|Number(It.y&Ht),Bo=Jn;return Ze&&I(Jn)&&(Bo=T(Jn),bs^=1),new R(Zr,Bo,bs)}return{seed:Yr,k2sig:Xr}}let ce={lowS:t.lowS,prehash:!1},Pe={lowS:t.lowS,prehash:!1};function Oe(z,V,le=ce){let{seed:Re,k2sig:ke}=de(z,V,le),Ze=t;return $a(Ze.hash.outputLen,Ze.nByteLength,Ze.hmac)(Re,ke)}h.BASE._setWindowSize(8);function at(z,V,le,Re=Pe){let ke=z;if(V=kt("msgHash",V),le=kt("publicKey",le),"strict"in Re)throw new Error("options.strict was renamed to lowS");let{lowS:Ze,prehash:dt}=Re,Me,rt;try{if(typeof ke=="string"||ke instanceof Uint8Array)try{Me=R.fromDER(ke)}catch(It){if(!(It instanceof jn.Err))throw It;Me=R.fromCompact(ke)}else if(typeof ke=="object"&&typeof ke.r=="bigint"&&typeof ke.s=="bigint"){let{r:It,s:Zr}=ke;Me=new R(It,Zr)}else throw new Error("PARSE");rt=h.fromHex(le)}catch(It){if(It.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ze&&Me.hasHighS())return!1;dt&&(V=t.hash(V));let{r:pe,s:nt}=Me,Yr=J(V),Vt=f(nt),Xr=c(Yr*Vt),Mt=c(pe*Vt),Tr=h.BASE.multiplyAndAddUnsafe(rt,Xr,Mt)?.toAffine();return Tr?c(Tr.x)===pe:!1}return{CURVE:t,getPublicKey:E,getSharedSecret:D,sign:Oe,verify:at,ProjectivePoint:h,Signature:R,utils:M}}var oi=class extends po{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,Pf(t);let n=Qo(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let a=0;a<s.length;a++)s[a]^=54;this.iHash.update(s),this.oHash=t.create();for(let a=0;a<s.length;a++)s[a]^=106;this.oHash.update(s),s.fill(0)}update(t){return lo(this),this.iHash.update(t),this}digestInto(t){lo(this),Cr(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:a,outputLen:c}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=a,t.outputLen=c,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},yo=(r,t,e)=>new oi(r,t).update(e).digest();yo.create=(r,t)=>new oi(r,t);function Eg(r){return{hash:r,hmac:(t,...e)=>yo(r,t,Gn(...e)),randomBytes:Nf}}function Wf(r,t){let e=n=>Vf({...r,...Eg(n)});return Object.freeze({...e(t),create:e})}var Xf=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Qf=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Sg=BigInt(1),Za=BigInt(2),Yf=(r,t)=>(r+t/Za)/t;function Ug(r){let t=Xf,e=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),a=BigInt(23),c=BigInt(44),f=BigInt(88),h=r*r*r%t,g=h*h*r%t,y=Ot(g,e,t)*g%t,w=Ot(y,e,t)*g%t,b=Ot(w,Za,t)*h%t,I=Ot(b,o,t)*b%t,T=Ot(I,s,t)*I%t,S=Ot(T,c,t)*T%t,R=Ot(S,f,t)*S%t,M=Ot(R,c,t)*T%t,E=Ot(M,e,t)*g%t,K=Ot(E,a,t)*I%t,D=Ot(K,n,t)*h%t,F=Ot(D,Za,t);if(!Ja.eql(Ja.sqr(F),r))throw new Error("Cannot find square root");return F}var Ja=Gf(Xf,void 0,void 0,{sqrt:Ug}),yt=Wf({a:BigInt(0),b:BigInt(7),Fp:Ja,n:Qf,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=Qf,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Sg*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=e,a=BigInt("0x100000000000000000000000000000000"),c=Yf(s*r,t),f=Yf(-n*r,t),h=ct(r-c*e-f*o,t),g=ct(-c*n-f*s,t),y=h>a,w=g>a;if(y&&(h=t-h),w&&(g=t-g),h>a||g>a)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:y,k1:h,k2neg:w,k2:g}}}},Yo),qA=BigInt(0);var LA=yt.ProjectivePoint;var Bg=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Jf=Uint8Array.from({length:16},(r,t)=>t),Cg=Jf.map(r=>(9*r+5)%16),tc=[Jf],rc=[Cg];for(let r=0;r<4;r++)for(let t of[tc,rc])t.push(t[r].map(e=>Bg[e]));var ed=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),Ig=tc.map((r,t)=>r.map(e=>ed[t][e])),Rg=rc.map((r,t)=>r.map(e=>ed[t][e])),Pg=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),kg=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),si=(r,t)=>r<<t|r>>>32-t;function Zf(r,t,e,n){return r===0?t^e^n:r===1?t&e|~t&n:r===2?(t|~e)^n:r===3?t&n|e&~n:t^(e|~n)}var ii=new Uint32Array(16),ec=class extends ln{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:n,h3:o,h4:s}=this;return[t,e,n,o,s]}set(t,e,n,o,s){this.h0=t|0,this.h1=e|0,this.h2=n|0,this.h3=o|0,this.h4=s|0}process(t,e){for(let b=0;b<16;b++,e+=4)ii[b]=t.getUint32(e,!0);let n=this.h0|0,o=n,s=this.h1|0,a=s,c=this.h2|0,f=c,h=this.h3|0,g=h,y=this.h4|0,w=y;for(let b=0;b<5;b++){let I=4-b,T=Pg[b],S=kg[b],R=tc[b],M=rc[b],E=Ig[b],K=Rg[b];for(let D=0;D<16;D++){let F=si(n+Zf(b,s,c,h)+ii[R[D]]+T,E[D])+y|0;n=y,y=h,h=si(c,10)|0,c=s,s=F}for(let D=0;D<16;D++){let F=si(o+Zf(I,a,f,g)+ii[M[D]]+S,K[D])+w|0;o=w,w=g,g=si(f,10)|0,f=a,a=F}}this.set(this.h1+c+g|0,this.h2+h+w|0,this.h3+y+o|0,this.h4+n+a|0,this.h0+s+f|0)}roundClean(){ii.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},td=ho(()=>new ec);var ai=BigInt(4294967295),nc=BigInt(32);function rd(r,t=!1){return t?{h:Number(r&ai),l:Number(r>>nc&ai)}:{h:Number(r>>nc&ai)|0,l:Number(r&ai)|0}}function Og(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:a}=rd(r[o],t);[e[o],n[o]]=[s,a]}return[e,n]}var zg=(r,t)=>BigInt(r>>>0)<<nc|BigInt(t>>>0),Ng=(r,t,e)=>r>>>e,Dg=(r,t,e)=>r<<32-e|t>>>e,Mg=(r,t,e)=>r>>>e|t<<32-e,qg=(r,t,e)=>r<<32-e|t>>>e,Lg=(r,t,e)=>r<<64-e|t>>>e-32,Hg=(r,t,e)=>r>>>e-32|t<<64-e,Gg=(r,t)=>t,Fg=(r,t)=>r,$g=(r,t,e)=>r<<e|t>>>32-e,Kg=(r,t,e)=>t<<e|r>>>32-e,jg=(r,t,e)=>t<<e-32|r>>>64-e,Vg=(r,t,e)=>r<<e-32|t>>>64-e;function Wg(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var Qg=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Yg=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Xg=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Zg=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Jg=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),ey=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0;var ty={fromBig:rd,split:Og,toBig:zg,shrSH:Ng,shrSL:Dg,rotrSH:Mg,rotrSL:qg,rotrBH:Lg,rotrBL:Hg,rotr32H:Gg,rotr32L:Fg,rotlSH:$g,rotlSL:Kg,rotlBH:jg,rotlBL:Vg,add:Wg,add3L:Qg,add3H:Yg,add4L:Xg,add4H:Zg,add5H:ey,add5L:Jg},Ae=ty;var[ry,ny]=(()=>Ae.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),mn=new Uint32Array(80),xn=new Uint32Array(80),oc=class extends ln{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:a,Dh:c,Dl:f,Eh:h,El:g,Fh:y,Fl:w,Gh:b,Gl:I,Hh:T,Hl:S}=this;return[t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S]}set(t,e,n,o,s,a,c,f,h,g,y,w,b,I,T,S){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=a|0,this.Dh=c|0,this.Dl=f|0,this.Eh=h|0,this.El=g|0,this.Fh=y|0,this.Fl=w|0,this.Gh=b|0,this.Gl=I|0,this.Hh=T|0,this.Hl=S|0}process(t,e){for(let E=0;E<16;E++,e+=4)mn[E]=t.getUint32(e),xn[E]=t.getUint32(e+=4);for(let E=16;E<80;E++){let K=mn[E-15]|0,D=xn[E-15]|0,F=Ae.rotrSH(K,D,1)^Ae.rotrSH(K,D,8)^Ae.shrSH(K,D,7),J=Ae.rotrSL(K,D,1)^Ae.rotrSL(K,D,8)^Ae.shrSL(K,D,7),G=mn[E-2]|0,oe=xn[E-2]|0,de=Ae.rotrSH(G,oe,19)^Ae.rotrBH(G,oe,61)^Ae.shrSH(G,oe,6),ce=Ae.rotrSL(G,oe,19)^Ae.rotrBL(G,oe,61)^Ae.shrSL(G,oe,6),Pe=Ae.add4L(J,ce,xn[E-7],xn[E-16]),Oe=Ae.add4H(Pe,F,de,mn[E-7],mn[E-16]);mn[E]=Oe|0,xn[E]=Pe|0}let{Ah:n,Al:o,Bh:s,Bl:a,Ch:c,Cl:f,Dh:h,Dl:g,Eh:y,El:w,Fh:b,Fl:I,Gh:T,Gl:S,Hh:R,Hl:M}=this;for(let E=0;E<80;E++){let K=Ae.rotrSH(y,w,14)^Ae.rotrSH(y,w,18)^Ae.rotrBH(y,w,41),D=Ae.rotrSL(y,w,14)^Ae.rotrSL(y,w,18)^Ae.rotrBL(y,w,41),F=y&b^~y&T,J=w&I^~w&S,G=Ae.add5L(M,D,J,ny[E],xn[E]),oe=Ae.add5H(G,R,K,F,ry[E],mn[E]),de=G|0,ce=Ae.rotrSH(n,o,28)^Ae.rotrBH(n,o,34)^Ae.rotrBH(n,o,39),Pe=Ae.rotrSL(n,o,28)^Ae.rotrBL(n,o,34)^Ae.rotrBL(n,o,39),Oe=n&s^n&c^s&c,at=o&a^o&f^a&f;R=T|0,M=S|0,T=b|0,S=I|0,b=y|0,I=w|0,{h:y,l:w}=Ae.add(h|0,g|0,oe|0,de|0),h=c|0,g=f|0,c=s|0,f=a|0,s=n|0,a=o|0;let z=Ae.add3L(de,Pe,at);n=Ae.add3H(z,oe,ce,Oe),o=z|0}({h:n,l:o}=Ae.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:a}=Ae.add(this.Bh|0,this.Bl|0,s|0,a|0),{h:c,l:f}=Ae.add(this.Ch|0,this.Cl|0,c|0,f|0),{h,l:g}=Ae.add(this.Dh|0,this.Dl|0,h|0,g|0),{h:y,l:w}=Ae.add(this.Eh|0,this.El|0,y|0,w|0),{h:b,l:I}=Ae.add(this.Fh|0,this.Fl|0,b|0,I|0),{h:T,l:S}=Ae.add(this.Gh|0,this.Gl|0,T|0,S|0),{h:R,l:M}=Ae.add(this.Hh|0,this.Hl|0,R|0,M|0),this.set(n,o,s,a,c,f,h,g,y,w,b,I,T,S,R,M)}roundClean(){mn.fill(0),xn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var sc=ho(()=>new oc);function Vn(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}function er(...r){let t=(o,s)=>a=>o(s(a)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function hr(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(Vn(e),e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function gr(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function ui(r,t="="){if(Vn(r),typeof t!="string")throw new Error("padding chr should be string");return{encode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let n of e)if(typeof n!="string")throw new Error(`padding.encode: non-string input=${n}`);for(;e.length*r%8;)e.push(t);return e},decode(e){if(!Array.isArray(e)||e.length&&typeof e[0]!="string")throw new Error("padding.encode input should be array of strings");for(let o of e)if(typeof o!="string")throw new Error(`padding.decode: non-string input=${o}`);let n=e.length;if(n*r%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&e[n-1]===t;n--)if(!((n-1)*r%8))throw new Error("Invalid padding: string has too much padding");return e.slice(0,n)}}}function sd(r){if(typeof r!="function")throw new Error("normalize fn should be function");return{encode:t=>t,decode:t=>r(t)}}function nd(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(a=>{if(Vn(a),a<0||a>=t)throw new Error(`Wrong integer: ${a}`)});;){let a=0,c=!0;for(let f=n;f<s.length;f++){let h=s[f],g=t*a+h;if(!Number.isSafeInteger(g)||t*a/t!==a||g-h!==t*a)throw new Error("convertRadix: carry overflow");a=g%e;let y=Math.floor(g/e);if(s[f]=y,!Number.isSafeInteger(y)||y*e+a!==g)throw new Error("convertRadix: carry overflow");if(c)y?c=!1:n=f;else continue}if(o.push(a),c)break}for(let a=0;a<r.length-1&&r[a]===0;a++)o.push(0);return o.reverse()}var id=(r,t)=>t?id(t,r%t):r,ci=(r,t)=>r+(t-id(r,t));function od(r,t,e,n){if(!Array.isArray(r))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(e<=0||e>32)throw new Error(`convertRadix2: wrong to=${e}`);if(ci(t,e)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${e} carryBits=${ci(t,e)}`);let o=0,s=0,a=2**e-1,c=[];for(let f of r){if(Vn(f),f>=2**t)throw new Error(`convertRadix2: invalid data word=${f} from=${t}`);if(o=o<<t|f,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=e;s-=e)c.push((o>>s-e&a)>>>0);o&=2**s-1}if(o=o<<e-s&a,!n&&s>=t)throw new Error("Excess padding");if(!n&&o)throw new Error(`Non-zero padding: ${o}`);return n&&s>0&&c.push(o>>>0),c}function oy(r){return Vn(r),{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return nd(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(nd(t,r,2**8))}}}function bn(r,t=!1){if(Vn(r),r<=0||r>32)throw new Error("radix2: bits should be in (0..32]");if(ci(8,r)>32||ci(r,8)>32)throw new Error("radix2: carry overflow");return{encode:e=>{if(!(e instanceof Uint8Array))throw new Error("radix2.encode input should be Uint8Array");return od(Array.from(e),8,r,!t)},decode:e=>{if(!Array.isArray(e)||e.length&&typeof e[0]!="number")throw new Error("radix2.decode input should be array of strings");return Uint8Array.from(od(e,r,8,t))}}}function sy(r,t){if(Vn(r),typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let a=0;a<r;a++)if(o[a]!==s[a])throw new Error("Invalid checksum");return n}}}var YA=er(bn(4),hr("0123456789ABCDEF"),gr("")),XA=er(bn(5),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),ui(5),gr("")),ZA=er(bn(5),hr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),ui(5),gr("")),JA=er(bn(5),hr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),gr(""),sd(r=>r.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1"))),e1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),ui(6),gr("")),t1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),ui(6),gr("")),r1=er(bn(6),hr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),gr("")),iy=r=>er(oy(58),hr(r),gr("")),ay=iy("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var ad=r=>er(sy(4,t=>r(r(t))),ay),n1=er(hr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),gr(""));var o1=er(bn(4),hr("0123456789abcdef"),gr(""),sd(r=>{if(typeof r!="string"||r.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof r} with length ${r.length}`);return r.toLowerCase()}));var fi=yt.ProjectivePoint,ic=ad(Yo);function cd(r){return BigInt(`0x${Of(r)}`)}function cy(r){return zf(r.toString(16).padStart(64,"0"))}var uy=La("Bitcoin seed"),ac={private:76066276,public:76067358},cc=2147483648,fy=r=>td(Yo(r)),dy=r=>dn(r).getUint32(0,!1),di=r=>{if(!Number.isSafeInteger(r)||r<0||r>2**32-1)throw new Error(`Invalid number=${r}. Should be from 0 to 2 ** 32 - 1`);let t=new Uint8Array(4);return dn(t).setUint32(0,r,!1),t},yr=class{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return dy(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let t=this.privateKey;if(!t)throw new Error("No private key");return ic.encode(this.serialize(this.versions.private,Gn(new Uint8Array([0]),t)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return ic.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(t,e=ac){if(Cr(t),8*t.length<128||8*t.length>512)throw new Error(`HDKey: wrong seed length=${t.length}. Should be between 128 and 512 bits; 256 bits is advised)`);let n=yo(sc,uy,t);return new yr({versions:e,chainCode:n.slice(32),privateKey:n.slice(0,32)})}static fromExtendedKey(t,e=ac){let n=ic.decode(t),o=dn(n),s=o.getUint32(0,!1),a={versions:e,depth:n[4],parentFingerprint:o.getUint32(5,!1),index:o.getUint32(9,!1),chainCode:n.slice(13,45)},c=n.slice(45),f=c[0]===0;if(s!==e[f?"private":"public"])throw new Error("Version mismatch");return f?new yr({...a,privateKey:c.slice(1)}):new yr({...a,publicKey:c})}static fromJSON(t){return yr.fromExtendedKey(t.xpriv)}constructor(t){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!t||typeof t!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=t.versions||ac,this.depth=t.depth||0,this.chainCode=t.chainCode,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(t.publicKey&&t.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(t.privateKey){if(!yt.utils.isValidPrivateKey(t.privateKey))throw new Error("Invalid private key");this.privKey=typeof t.privateKey=="bigint"?t.privateKey:cd(t.privateKey),this.privKeyBytes=cy(this.privKey),this.pubKey=yt.getPublicKey(t.privateKey,!0)}else if(t.publicKey)this.pubKey=fi.fromHex(t.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=fy(this.pubKey)}derive(t){if(!/^[mM]'?/.test(t))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;let e=t.replace(/^[mM]'?\//,"").split("/"),n=this;for(let o of e){let s=/^(\d+)('?)$/.exec(o),a=s&&s[1];if(!s||s.length!==3||typeof a!="string")throw new Error(`Invalid child index: ${o}`);let c=+a;if(!Number.isSafeInteger(c)||c>=cc)throw new Error("Invalid index");s[2]==="'"&&(c+=cc),n=n.deriveChild(c)}return n}deriveChild(t){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let e=di(t);if(t>=cc){let c=this.privateKey;if(!c)throw new Error("Could not derive hardened child key");e=Gn(new Uint8Array([0]),c,e)}else e=Gn(this.pubKey,e);let n=yo(sc,this.chainCode,e),o=cd(n.slice(0,32)),s=n.slice(32);if(!yt.utils.isValidPrivateKey(o))throw new Error("Tweak bigger than curve order");let a={versions:this.versions,chainCode:s,depth:this.depth+1,parentFingerprint:this.fingerprint,index:t};try{if(this.privateKey){let c=ct(this.privKey+o,yt.CURVE.n);if(!yt.utils.isValidPrivateKey(c))throw new Error("The tweak was out of range or the resulted private key is invalid");a.privateKey=c}else{let c=fi.fromHex(this.pubKey).add(fi.fromPrivateKey(o));if(c.equals(fi.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");a.publicKey=c.toRawBytes(!0)}return new yr(a)}catch{return this.deriveChild(t+1)}}sign(t){if(!this.privateKey)throw new Error("No privateKey set!");return Cr(t,32),yt.sign(t,this.privKey).toCompactRawBytes()}verify(t,e){if(Cr(t,32),Cr(e,64),!this.publicKey)throw new Error("No publicKey set!");let n;try{n=yt.Signature.fromCompact(e)}catch{return!1}return yt.verify(n,t,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(t,e){if(!this.chainCode)throw new Error("No chainCode set");return Cr(e,33),Gn(di(t),new Uint8Array([this.depth]),di(this.parentFingerprint),di(this.index),this.chainCode,e)}};var mo=class extends Pt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==mo.LENGTH)throw new Error(`PublicKey length should be ${mo.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=be.fromHexInput(n).toUint8Array(),a=Mn(s),c=o.toUint8Array();return yt.verify(c,a,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new mo(n)}static load(e){let n=e.deserializeBytes();return new mo(n)}},Gt=mo;Gt.LENGTH=65;var An=class extends Ln{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==An.LENGTH)throw new Error(`PrivateKey length should be ${An.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let n=be.fromHexInput(e),o=Mn(n.toUint8Array()),s=yt.sign(o,this.key.toUint8Array());return new xr(s.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new An(n)}static generate(){let e=yt.utils.randomPrivateKey();return new An(e)}publicKey(){let e=yt.getPublicKey(this.key.toUint8Array(),!1);return new Gt(e)}static fromDerivationPath(e,n){if(!za(e))throw new Error(`Invalid derivation path ${e}`);return An.fromDerivationPathInner(e,Vo(n))}static fromDerivationPathInner(e,n){let{privateKey:o}=yr.fromMasterSeed(n).derive(e);if(o===null)throw new Error("Invalid key");return new An(o)}},mr=An;mr.LENGTH=32;var xo=class extends Qt{constructor(e){super();let n=be.fromHexInput(e);if(n.toUint8Array().length!==xo.LENGTH)throw new Error(`Signature length should be ${xo.LENGTH}, recieved ${n.toUint8Array().length}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new xo(n)}static load(e){let n=e.deserializeBytes();return new xo(n)}},xr=xo;xr.LENGTH=64;var Fe=class extends Pt{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:n,signature:o}=e;return this.publicKey.verifySignature({message:n,signature:o})}serialize(e){if(this.publicKey instanceof De)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof Gt)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new Fe(De.load(e));case 1:return new Fe(Gt.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${n}`)}}};var Pr=class extends Pt{constructor(e){super();let{publicKeys:n,signaturesRequired:o}=e;if(o<1)throw new Error("The number of required signatures needs to be greater then 0");if(n.length<o)throw new Error(`Provided ${n.length} public keys is smaller than the ${o} required signatures`);let s=[];n.forEach(a=>{a instanceof Fe?s.push(a):s.push(new Fe(a))}),this.publicKeys=s,this.signaturesRequired=o}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),a=new Set;return n.forEach((c,f)=>{if(f+1>this.publicKeys.length)throw new Error(`Signature index ${f+1} is out of public keys range, ${this.publicKeys.length}.`);if(a.has(c))throw new Error(`Duplicate bit ${c} detected.`);a.add(c);let h=Math.floor(c/8),g=s[h];g|=o>>c%8,s[h]=g}),s}toString(){return be.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("not implemented")}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let n=e.deserializeVector(Fe),o=e.deserializeU8();return new Pr({publicKeys:n,signaturesRequired:o})}};var wn=class extends te{constructor(e){super();let{data:n}=e,o=be.fromHexInput(n);if(o.toUint8Array().length!==wn.LENGTH)throw new Error(`Authentication Key length should be ${wn.LENGTH}`);this.data=o}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeFixedBytes(wn.LENGTH);return new wn({data:n})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(e){let{publicKey:n,scheme:o}=e,s;switch(o){case 3:case 2:{let f=n.bcsToBytes();s=new Uint8Array([...f,o]);break}case 0:case 1:{let f=n.toUint8Array(),h=be.fromHexInput(f).toUint8Array();s=new Uint8Array([...h,o]);break}default:throw new Error(`Scheme ${o} is not supported`)}let a=Mn.create();a.update(s);let c=a.digest();return new wn({data:c})}static fromPublicKey(e){let{publicKey:n}=e,o;if(n instanceof De)o=0 .valueOf();else if(n instanceof Et)o=1 .valueOf();else if(n instanceof Fe)o=2 .valueOf();else if(n instanceof Pr)o=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return wn.fromPublicKeyAndScheme({publicKey:n,scheme:o})}derivedAddress(){return new O(this.data.toUint8Array())}},Ft=wn;Ft.LENGTH=32;var St=class{constructor(t){let{privateKey:e,address:n,legacy:o}=t,s=o??!0;if(this.publicKey=e.publicKey(),this.publicKey instanceof De)s?this.signingScheme=0:(this.publicKey=new Fe(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof Et)this.signingScheme=1;else if(this.publicKey instanceof Gt)this.publicKey=new Fe(this.publicKey),this.signingScheme=2;else throw new Error("Can not create new Account, unsupported public key type");this.privateKey=e,this.accountAddress=n}static generate(t){let e=t?.legacy??!0,n,o;switch(t?.scheme){case 2:n=mr.generate(),o=new Fe(n.publicKey());break;default:n=Zt.generate(),e===!1?o=new Fe(n.publicKey()):o=n.publicKey()}let a=Ft.fromPublicKey({publicKey:o}).derivedAddress();return new St({privateKey:n,address:a,legacy:t?.legacy})}static fromPrivateKey(t){let{privateKey:e,legacy:n}=t,o=n??!0,s;if(e instanceof mr)s=new Fe(e.publicKey());else if(e instanceof Zt)o?s=e.publicKey():s=new Fe(e.publicKey());else throw new Error(`Unsupported private key ${e}`);let c=Ft.fromPublicKey({publicKey:s}).derivedAddress();return new St({privateKey:e,address:c,legacy:o})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:n,legacy:o}=t;return new St({privateKey:e,address:n,legacy:o})}static fromDerivationPath(t){let{path:e,mnemonic:n,scheme:o,legacy:s}=t,a;switch(o){case 2:a=mr.fromDerivationPath(e,n);break;case 0:a=Zt.fromDerivationPath(e,n);break;default:throw new Error(`Unsupported scheme ${o}`)}return St.fromPrivateKey({privateKey:a,legacy:s})}static authKey(t){let{publicKey:e}=t;return Ft.fromPublicKey({publicKey:e})}sign(t){return this.privateKey.sign(t)}verifySignature(t){let{message:e,signature:n}=t,o=be.fromHexInput(e).toUint8Array();return this.publicKey.verifySignature({message:o,signature:n})}};var ly=`
1
+ "use strict";var aptosSDK=(()=>{var ul=Object.create;var oo=Object.defineProperty;var fc=Object.getOwnPropertyDescriptor;var fl=Object.getOwnPropertyNames;var dl=Object.getPrototypeOf,ll=Object.prototype.hasOwnProperty;var dc=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Te=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),lc=(r,t)=>{for(var e in t)oo(r,e,{get:t[e],enumerable:!0})},pc=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fl(t))!ll.call(r,o)&&o!==e&&oo(r,o,{get:()=>t[o],enumerable:!(n=fc(t,o))||n.enumerable});return r};var gc=(r,t,e)=>(e=r!=null?ul(dl(r)):{},pc(t||!r||!r.__esModule?oo(e,"default",{value:r,enumerable:!0}):e,r)),pl=r=>pc(oo({},"__esModule",{value:!0}),r),yt=(r,t,e,n)=>{for(var o=n>1?void 0:n?fc(t,e):t,s=r.length-1,c;s>=0;s--)(c=r[s])&&(o=(n?c(t,e,o):c(o))||o);return n&&o&&oo(t,e,o),o};var Mc=Te(()=>{"use strict"});var Dc=Te((vh,ci)=>{"use strict";(function(r){"use strict";var t=function(a){var d,f=new Float64Array(16);if(a)for(d=0;d<a.length;d++)f[d]=a[d];return f},e=function(){throw new Error("no PRNG")},n=new Uint8Array(16),o=new Uint8Array(32);o[0]=9;var s=t(),c=t([1]),u=t([56129,1]),p=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),y=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),h=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),x=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),C=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function T(a,d,f,i){a[d]=f>>24&255,a[d+1]=f>>16&255,a[d+2]=f>>8&255,a[d+3]=f&255,a[d+4]=i>>24&255,a[d+5]=i>>16&255,a[d+6]=i>>8&255,a[d+7]=i&255}function z(a,d,f,i,l){var m,A=0;for(m=0;m<l;m++)A|=a[d+m]^f[i+m];return(1&A-1>>>8)-1}function _(a,d,f,i){return z(a,d,f,i,16)}function I(a,d,f,i){return z(a,d,f,i,32)}function P(a,d,f,i){for(var l=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,m=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,A=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,S=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,R=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Q=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,D=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,_e=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,q=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,te=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,re=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ue=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,ce=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,ne=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,ie=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,oe=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,F=l,W=m,G=A,H=S,V=R,M=Q,b=D,w=_e,U=q,v=te,E=re,B=ue,Y=ce,fe=ne,le=ie,de=oe,g,ye=0;ye<20;ye+=2)g=F+Y|0,V^=g<<7|g>>>32-7,g=V+F|0,U^=g<<9|g>>>32-9,g=U+V|0,Y^=g<<13|g>>>32-13,g=Y+U|0,F^=g<<18|g>>>32-18,g=M+W|0,v^=g<<7|g>>>32-7,g=v+M|0,fe^=g<<9|g>>>32-9,g=fe+v|0,W^=g<<13|g>>>32-13,g=W+fe|0,M^=g<<18|g>>>32-18,g=E+b|0,le^=g<<7|g>>>32-7,g=le+E|0,G^=g<<9|g>>>32-9,g=G+le|0,b^=g<<13|g>>>32-13,g=b+G|0,E^=g<<18|g>>>32-18,g=de+B|0,H^=g<<7|g>>>32-7,g=H+de|0,w^=g<<9|g>>>32-9,g=w+H|0,B^=g<<13|g>>>32-13,g=B+w|0,de^=g<<18|g>>>32-18,g=F+H|0,W^=g<<7|g>>>32-7,g=W+F|0,G^=g<<9|g>>>32-9,g=G+W|0,H^=g<<13|g>>>32-13,g=H+G|0,F^=g<<18|g>>>32-18,g=M+V|0,b^=g<<7|g>>>32-7,g=b+M|0,w^=g<<9|g>>>32-9,g=w+b|0,V^=g<<13|g>>>32-13,g=V+w|0,M^=g<<18|g>>>32-18,g=E+v|0,B^=g<<7|g>>>32-7,g=B+E|0,U^=g<<9|g>>>32-9,g=U+B|0,v^=g<<13|g>>>32-13,g=v+U|0,E^=g<<18|g>>>32-18,g=de+le|0,Y^=g<<7|g>>>32-7,g=Y+de|0,fe^=g<<9|g>>>32-9,g=fe+Y|0,le^=g<<13|g>>>32-13,g=le+fe|0,de^=g<<18|g>>>32-18;F=F+l|0,W=W+m|0,G=G+A|0,H=H+S|0,V=V+R|0,M=M+Q|0,b=b+D|0,w=w+_e|0,U=U+q|0,v=v+te|0,E=E+re|0,B=B+ue|0,Y=Y+ce|0,fe=fe+ne|0,le=le+ie|0,de=de+oe|0,a[0]=F>>>0&255,a[1]=F>>>8&255,a[2]=F>>>16&255,a[3]=F>>>24&255,a[4]=W>>>0&255,a[5]=W>>>8&255,a[6]=W>>>16&255,a[7]=W>>>24&255,a[8]=G>>>0&255,a[9]=G>>>8&255,a[10]=G>>>16&255,a[11]=G>>>24&255,a[12]=H>>>0&255,a[13]=H>>>8&255,a[14]=H>>>16&255,a[15]=H>>>24&255,a[16]=V>>>0&255,a[17]=V>>>8&255,a[18]=V>>>16&255,a[19]=V>>>24&255,a[20]=M>>>0&255,a[21]=M>>>8&255,a[22]=M>>>16&255,a[23]=M>>>24&255,a[24]=b>>>0&255,a[25]=b>>>8&255,a[26]=b>>>16&255,a[27]=b>>>24&255,a[28]=w>>>0&255,a[29]=w>>>8&255,a[30]=w>>>16&255,a[31]=w>>>24&255,a[32]=U>>>0&255,a[33]=U>>>8&255,a[34]=U>>>16&255,a[35]=U>>>24&255,a[36]=v>>>0&255,a[37]=v>>>8&255,a[38]=v>>>16&255,a[39]=v>>>24&255,a[40]=E>>>0&255,a[41]=E>>>8&255,a[42]=E>>>16&255,a[43]=E>>>24&255,a[44]=B>>>0&255,a[45]=B>>>8&255,a[46]=B>>>16&255,a[47]=B>>>24&255,a[48]=Y>>>0&255,a[49]=Y>>>8&255,a[50]=Y>>>16&255,a[51]=Y>>>24&255,a[52]=fe>>>0&255,a[53]=fe>>>8&255,a[54]=fe>>>16&255,a[55]=fe>>>24&255,a[56]=le>>>0&255,a[57]=le>>>8&255,a[58]=le>>>16&255,a[59]=le>>>24&255,a[60]=de>>>0&255,a[61]=de>>>8&255,a[62]=de>>>16&255,a[63]=de>>>24&255}function $(a,d,f,i){for(var l=i[0]&255|(i[1]&255)<<8|(i[2]&255)<<16|(i[3]&255)<<24,m=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,A=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,S=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,R=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,Q=i[4]&255|(i[5]&255)<<8|(i[6]&255)<<16|(i[7]&255)<<24,D=d[0]&255|(d[1]&255)<<8|(d[2]&255)<<16|(d[3]&255)<<24,_e=d[4]&255|(d[5]&255)<<8|(d[6]&255)<<16|(d[7]&255)<<24,q=d[8]&255|(d[9]&255)<<8|(d[10]&255)<<16|(d[11]&255)<<24,te=d[12]&255|(d[13]&255)<<8|(d[14]&255)<<16|(d[15]&255)<<24,re=i[8]&255|(i[9]&255)<<8|(i[10]&255)<<16|(i[11]&255)<<24,ue=f[16]&255|(f[17]&255)<<8|(f[18]&255)<<16|(f[19]&255)<<24,ce=f[20]&255|(f[21]&255)<<8|(f[22]&255)<<16|(f[23]&255)<<24,ne=f[24]&255|(f[25]&255)<<8|(f[26]&255)<<16|(f[27]&255)<<24,ie=f[28]&255|(f[29]&255)<<8|(f[30]&255)<<16|(f[31]&255)<<24,oe=i[12]&255|(i[13]&255)<<8|(i[14]&255)<<16|(i[15]&255)<<24,F=l,W=m,G=A,H=S,V=R,M=Q,b=D,w=_e,U=q,v=te,E=re,B=ue,Y=ce,fe=ne,le=ie,de=oe,g,ye=0;ye<20;ye+=2)g=F+Y|0,V^=g<<7|g>>>32-7,g=V+F|0,U^=g<<9|g>>>32-9,g=U+V|0,Y^=g<<13|g>>>32-13,g=Y+U|0,F^=g<<18|g>>>32-18,g=M+W|0,v^=g<<7|g>>>32-7,g=v+M|0,fe^=g<<9|g>>>32-9,g=fe+v|0,W^=g<<13|g>>>32-13,g=W+fe|0,M^=g<<18|g>>>32-18,g=E+b|0,le^=g<<7|g>>>32-7,g=le+E|0,G^=g<<9|g>>>32-9,g=G+le|0,b^=g<<13|g>>>32-13,g=b+G|0,E^=g<<18|g>>>32-18,g=de+B|0,H^=g<<7|g>>>32-7,g=H+de|0,w^=g<<9|g>>>32-9,g=w+H|0,B^=g<<13|g>>>32-13,g=B+w|0,de^=g<<18|g>>>32-18,g=F+H|0,W^=g<<7|g>>>32-7,g=W+F|0,G^=g<<9|g>>>32-9,g=G+W|0,H^=g<<13|g>>>32-13,g=H+G|0,F^=g<<18|g>>>32-18,g=M+V|0,b^=g<<7|g>>>32-7,g=b+M|0,w^=g<<9|g>>>32-9,g=w+b|0,V^=g<<13|g>>>32-13,g=V+w|0,M^=g<<18|g>>>32-18,g=E+v|0,B^=g<<7|g>>>32-7,g=B+E|0,U^=g<<9|g>>>32-9,g=U+B|0,v^=g<<13|g>>>32-13,g=v+U|0,E^=g<<18|g>>>32-18,g=de+le|0,Y^=g<<7|g>>>32-7,g=Y+de|0,fe^=g<<9|g>>>32-9,g=fe+Y|0,le^=g<<13|g>>>32-13,g=le+fe|0,de^=g<<18|g>>>32-18;a[0]=F>>>0&255,a[1]=F>>>8&255,a[2]=F>>>16&255,a[3]=F>>>24&255,a[4]=M>>>0&255,a[5]=M>>>8&255,a[6]=M>>>16&255,a[7]=M>>>24&255,a[8]=E>>>0&255,a[9]=E>>>8&255,a[10]=E>>>16&255,a[11]=E>>>24&255,a[12]=de>>>0&255,a[13]=de>>>8&255,a[14]=de>>>16&255,a[15]=de>>>24&255,a[16]=b>>>0&255,a[17]=b>>>8&255,a[18]=b>>>16&255,a[19]=b>>>24&255,a[20]=w>>>0&255,a[21]=w>>>8&255,a[22]=w>>>16&255,a[23]=w>>>24&255,a[24]=U>>>0&255,a[25]=U>>>8&255,a[26]=U>>>16&255,a[27]=U>>>24&255,a[28]=v>>>0&255,a[29]=v>>>8&255,a[30]=v>>>16&255,a[31]=v>>>24&255}function N(a,d,f,i){P(a,d,f,i)}function ee(a,d,f,i){$(a,d,f,i)}var L=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function j(a,d,f,i,l,m,A){var S=new Uint8Array(16),R=new Uint8Array(64),Q,D;for(D=0;D<16;D++)S[D]=0;for(D=0;D<8;D++)S[D]=m[D];for(;l>=64;){for(N(R,S,A,L),D=0;D<64;D++)a[d+D]=f[i+D]^R[D];for(Q=1,D=8;D<16;D++)Q=Q+(S[D]&255)|0,S[D]=Q&255,Q>>>=8;l-=64,d+=64,i+=64}if(l>0)for(N(R,S,A,L),D=0;D<l;D++)a[d+D]=f[i+D]^R[D];return 0}function J(a,d,f,i,l){var m=new Uint8Array(16),A=new Uint8Array(64),S,R;for(R=0;R<16;R++)m[R]=0;for(R=0;R<8;R++)m[R]=i[R];for(;f>=64;){for(N(A,m,l,L),R=0;R<64;R++)a[d+R]=A[R];for(S=1,R=8;R<16;R++)S=S+(m[R]&255)|0,m[R]=S&255,S>>>=8;f-=64,d+=64}if(f>0)for(N(A,m,l,L),R=0;R<f;R++)a[d+R]=A[R];return 0}function X(a,d,f,i,l){var m=new Uint8Array(32);ee(m,i,l,L);for(var A=new Uint8Array(8),S=0;S<8;S++)A[S]=i[S+16];return J(a,d,f,A,m)}function Re(a,d,f,i,l,m,A){var S=new Uint8Array(32);ee(S,m,A,L);for(var R=new Uint8Array(8),Q=0;Q<8;Q++)R[Q]=m[Q+16];return j(a,d,f,i,l,R,S)}var Ae=function(a){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var d,f,i,l,m,A,S,R;d=a[0]&255|(a[1]&255)<<8,this.r[0]=d&8191,f=a[2]&255|(a[3]&255)<<8,this.r[1]=(d>>>13|f<<3)&8191,i=a[4]&255|(a[5]&255)<<8,this.r[2]=(f>>>10|i<<6)&7939,l=a[6]&255|(a[7]&255)<<8,this.r[3]=(i>>>7|l<<9)&8191,m=a[8]&255|(a[9]&255)<<8,this.r[4]=(l>>>4|m<<12)&255,this.r[5]=m>>>1&8190,A=a[10]&255|(a[11]&255)<<8,this.r[6]=(m>>>14|A<<2)&8191,S=a[12]&255|(a[13]&255)<<8,this.r[7]=(A>>>11|S<<5)&8065,R=a[14]&255|(a[15]&255)<<8,this.r[8]=(S>>>8|R<<8)&8191,this.r[9]=R>>>5&127,this.pad[0]=a[16]&255|(a[17]&255)<<8,this.pad[1]=a[18]&255|(a[19]&255)<<8,this.pad[2]=a[20]&255|(a[21]&255)<<8,this.pad[3]=a[22]&255|(a[23]&255)<<8,this.pad[4]=a[24]&255|(a[25]&255)<<8,this.pad[5]=a[26]&255|(a[27]&255)<<8,this.pad[6]=a[28]&255|(a[29]&255)<<8,this.pad[7]=a[30]&255|(a[31]&255)<<8};Ae.prototype.blocks=function(a,d,f){for(var i=this.fin?0:2048,l,m,A,S,R,Q,D,_e,q,te,re,ue,ce,ne,ie,oe,F,W,G,H=this.h[0],V=this.h[1],M=this.h[2],b=this.h[3],w=this.h[4],U=this.h[5],v=this.h[6],E=this.h[7],B=this.h[8],Y=this.h[9],fe=this.r[0],le=this.r[1],de=this.r[2],g=this.r[3],ye=this.r[4],ve=this.r[5],Se=this.r[6],ge=this.r[7],be=this.r[8],we=this.r[9];f>=16;)l=a[d+0]&255|(a[d+1]&255)<<8,H+=l&8191,m=a[d+2]&255|(a[d+3]&255)<<8,V+=(l>>>13|m<<3)&8191,A=a[d+4]&255|(a[d+5]&255)<<8,M+=(m>>>10|A<<6)&8191,S=a[d+6]&255|(a[d+7]&255)<<8,b+=(A>>>7|S<<9)&8191,R=a[d+8]&255|(a[d+9]&255)<<8,w+=(S>>>4|R<<12)&8191,U+=R>>>1&8191,Q=a[d+10]&255|(a[d+11]&255)<<8,v+=(R>>>14|Q<<2)&8191,D=a[d+12]&255|(a[d+13]&255)<<8,E+=(Q>>>11|D<<5)&8191,_e=a[d+14]&255|(a[d+15]&255)<<8,B+=(D>>>8|_e<<8)&8191,Y+=_e>>>5|i,q=0,te=q,te+=H*fe,te+=V*(5*we),te+=M*(5*be),te+=b*(5*ge),te+=w*(5*Se),q=te>>>13,te&=8191,te+=U*(5*ve),te+=v*(5*ye),te+=E*(5*g),te+=B*(5*de),te+=Y*(5*le),q+=te>>>13,te&=8191,re=q,re+=H*le,re+=V*fe,re+=M*(5*we),re+=b*(5*be),re+=w*(5*ge),q=re>>>13,re&=8191,re+=U*(5*Se),re+=v*(5*ve),re+=E*(5*ye),re+=B*(5*g),re+=Y*(5*de),q+=re>>>13,re&=8191,ue=q,ue+=H*de,ue+=V*le,ue+=M*fe,ue+=b*(5*we),ue+=w*(5*be),q=ue>>>13,ue&=8191,ue+=U*(5*ge),ue+=v*(5*Se),ue+=E*(5*ve),ue+=B*(5*ye),ue+=Y*(5*g),q+=ue>>>13,ue&=8191,ce=q,ce+=H*g,ce+=V*de,ce+=M*le,ce+=b*fe,ce+=w*(5*we),q=ce>>>13,ce&=8191,ce+=U*(5*be),ce+=v*(5*ge),ce+=E*(5*Se),ce+=B*(5*ve),ce+=Y*(5*ye),q+=ce>>>13,ce&=8191,ne=q,ne+=H*ye,ne+=V*g,ne+=M*de,ne+=b*le,ne+=w*fe,q=ne>>>13,ne&=8191,ne+=U*(5*we),ne+=v*(5*be),ne+=E*(5*ge),ne+=B*(5*Se),ne+=Y*(5*ve),q+=ne>>>13,ne&=8191,ie=q,ie+=H*ve,ie+=V*ye,ie+=M*g,ie+=b*de,ie+=w*le,q=ie>>>13,ie&=8191,ie+=U*fe,ie+=v*(5*we),ie+=E*(5*be),ie+=B*(5*ge),ie+=Y*(5*Se),q+=ie>>>13,ie&=8191,oe=q,oe+=H*Se,oe+=V*ve,oe+=M*ye,oe+=b*g,oe+=w*de,q=oe>>>13,oe&=8191,oe+=U*le,oe+=v*fe,oe+=E*(5*we),oe+=B*(5*be),oe+=Y*(5*ge),q+=oe>>>13,oe&=8191,F=q,F+=H*ge,F+=V*Se,F+=M*ve,F+=b*ye,F+=w*g,q=F>>>13,F&=8191,F+=U*de,F+=v*le,F+=E*fe,F+=B*(5*we),F+=Y*(5*be),q+=F>>>13,F&=8191,W=q,W+=H*be,W+=V*ge,W+=M*Se,W+=b*ve,W+=w*ye,q=W>>>13,W&=8191,W+=U*g,W+=v*de,W+=E*le,W+=B*fe,W+=Y*(5*we),q+=W>>>13,W&=8191,G=q,G+=H*we,G+=V*be,G+=M*ge,G+=b*Se,G+=w*ve,q=G>>>13,G&=8191,G+=U*ye,G+=v*g,G+=E*de,G+=B*le,G+=Y*fe,q+=G>>>13,G&=8191,q=(q<<2)+q|0,q=q+te|0,te=q&8191,q=q>>>13,re+=q,H=te,V=re,M=ue,b=ce,w=ne,U=ie,v=oe,E=F,B=W,Y=G,d+=16,f-=16;this.h[0]=H,this.h[1]=V,this.h[2]=M,this.h[3]=b,this.h[4]=w,this.h[5]=U,this.h[6]=v,this.h[7]=E,this.h[8]=B,this.h[9]=Y},Ae.prototype.finish=function(a,d){var f=new Uint16Array(10),i,l,m,A;if(this.leftover){for(A=this.leftover,this.buffer[A++]=1;A<16;A++)this.buffer[A]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(i=this.h[1]>>>13,this.h[1]&=8191,A=2;A<10;A++)this.h[A]+=i,i=this.h[A]>>>13,this.h[A]&=8191;for(this.h[0]+=i*5,i=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=i,i=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=i,f[0]=this.h[0]+5,i=f[0]>>>13,f[0]&=8191,A=1;A<10;A++)f[A]=this.h[A]+i,i=f[A]>>>13,f[A]&=8191;for(f[9]-=8192,l=(i^1)-1,A=0;A<10;A++)f[A]&=l;for(l=~l,A=0;A<10;A++)this.h[A]=this.h[A]&l|f[A];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,m=this.h[0]+this.pad[0],this.h[0]=m&65535,A=1;A<8;A++)m=(this.h[A]+this.pad[A]|0)+(m>>>16)|0,this.h[A]=m&65535;a[d+0]=this.h[0]>>>0&255,a[d+1]=this.h[0]>>>8&255,a[d+2]=this.h[1]>>>0&255,a[d+3]=this.h[1]>>>8&255,a[d+4]=this.h[2]>>>0&255,a[d+5]=this.h[2]>>>8&255,a[d+6]=this.h[3]>>>0&255,a[d+7]=this.h[3]>>>8&255,a[d+8]=this.h[4]>>>0&255,a[d+9]=this.h[4]>>>8&255,a[d+10]=this.h[5]>>>0&255,a[d+11]=this.h[5]>>>8&255,a[d+12]=this.h[6]>>>0&255,a[d+13]=this.h[6]>>>8&255,a[d+14]=this.h[7]>>>0&255,a[d+15]=this.h[7]>>>8&255},Ae.prototype.update=function(a,d,f){var i,l;if(this.leftover){for(l=16-this.leftover,l>f&&(l=f),i=0;i<l;i++)this.buffer[this.leftover+i]=a[d+i];if(f-=l,d+=l,this.leftover+=l,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(f>=16&&(l=f-f%16,this.blocks(a,d,l),d+=l,f-=l),f){for(i=0;i<f;i++)this.buffer[this.leftover+i]=a[d+i];this.leftover+=f}};function he(a,d,f,i,l,m){var A=new Ae(m);return A.update(f,i,l),A.finish(a,d),0}function He(a,d,f,i,l,m){var A=new Uint8Array(16);return he(A,0,f,i,l,m),_(a,d,A,0)}function $e(a,d,f,i,l){var m;if(f<32)return-1;for(Re(a,0,d,0,f,i,l),he(a,16,a,32,f-32,a),m=0;m<16;m++)a[m]=0;return 0}function gt(a,d,f,i,l){var m,A=new Uint8Array(32);if(f<32||(X(A,0,32,i,l),He(d,16,d,32,f-32,A)!==0))return-1;for(Re(a,0,d,0,f,i,l),m=0;m<32;m++)a[m]=0;return 0}function k(a,d){var f;for(f=0;f<16;f++)a[f]=d[f]|0}function K(a){var d,f,i=1;for(d=0;d<16;d++)f=a[d]+i+65535,i=Math.floor(f/65536),a[d]=f-i*65536;a[0]+=i-1+37*(i-1)}function se(a,d,f){for(var i,l=~(f-1),m=0;m<16;m++)i=l&(a[m]^d[m]),a[m]^=i,d[m]^=i}function Ee(a,d){var f,i,l,m=t(),A=t();for(f=0;f<16;f++)A[f]=d[f];for(K(A),K(A),K(A),i=0;i<2;i++){for(m[0]=A[0]-65517,f=1;f<15;f++)m[f]=A[f]-65535-(m[f-1]>>16&1),m[f-1]&=65535;m[15]=A[15]-32767-(m[14]>>16&1),l=m[15]>>16&1,m[14]&=65535,se(A,m,1-l)}for(f=0;f<16;f++)a[2*f]=A[f]&255,a[2*f+1]=A[f]>>8}function Ce(a,d){var f=new Uint8Array(32),i=new Uint8Array(32);return Ee(f,a),Ee(i,d),I(f,0,i,0)}function Ve(a){var d=new Uint8Array(32);return Ee(d,a),d[0]&1}function it(a,d){var f;for(f=0;f<16;f++)a[f]=d[2*f]+(d[2*f+1]<<8);a[15]&=32767}function Oe(a,d,f){for(var i=0;i<16;i++)a[i]=d[i]+f[i]}function We(a,d,f){for(var i=0;i<16;i++)a[i]=d[i]-f[i]}function ae(a,d,f){var i,l,m=0,A=0,S=0,R=0,Q=0,D=0,_e=0,q=0,te=0,re=0,ue=0,ce=0,ne=0,ie=0,oe=0,F=0,W=0,G=0,H=0,V=0,M=0,b=0,w=0,U=0,v=0,E=0,B=0,Y=0,fe=0,le=0,de=0,g=f[0],ye=f[1],ve=f[2],Se=f[3],ge=f[4],be=f[5],we=f[6],Qe=f[7],Ue=f[8],Me=f[9],De=f[10],Ge=f[11],Je=f[12],ct=f[13],ut=f[14],ft=f[15];i=d[0],m+=i*g,A+=i*ye,S+=i*ve,R+=i*Se,Q+=i*ge,D+=i*be,_e+=i*we,q+=i*Qe,te+=i*Ue,re+=i*Me,ue+=i*De,ce+=i*Ge,ne+=i*Je,ie+=i*ct,oe+=i*ut,F+=i*ft,i=d[1],A+=i*g,S+=i*ye,R+=i*ve,Q+=i*Se,D+=i*ge,_e+=i*be,q+=i*we,te+=i*Qe,re+=i*Ue,ue+=i*Me,ce+=i*De,ne+=i*Ge,ie+=i*Je,oe+=i*ct,F+=i*ut,W+=i*ft,i=d[2],S+=i*g,R+=i*ye,Q+=i*ve,D+=i*Se,_e+=i*ge,q+=i*be,te+=i*we,re+=i*Qe,ue+=i*Ue,ce+=i*Me,ne+=i*De,ie+=i*Ge,oe+=i*Je,F+=i*ct,W+=i*ut,G+=i*ft,i=d[3],R+=i*g,Q+=i*ye,D+=i*ve,_e+=i*Se,q+=i*ge,te+=i*be,re+=i*we,ue+=i*Qe,ce+=i*Ue,ne+=i*Me,ie+=i*De,oe+=i*Ge,F+=i*Je,W+=i*ct,G+=i*ut,H+=i*ft,i=d[4],Q+=i*g,D+=i*ye,_e+=i*ve,q+=i*Se,te+=i*ge,re+=i*be,ue+=i*we,ce+=i*Qe,ne+=i*Ue,ie+=i*Me,oe+=i*De,F+=i*Ge,W+=i*Je,G+=i*ct,H+=i*ut,V+=i*ft,i=d[5],D+=i*g,_e+=i*ye,q+=i*ve,te+=i*Se,re+=i*ge,ue+=i*be,ce+=i*we,ne+=i*Qe,ie+=i*Ue,oe+=i*Me,F+=i*De,W+=i*Ge,G+=i*Je,H+=i*ct,V+=i*ut,M+=i*ft,i=d[6],_e+=i*g,q+=i*ye,te+=i*ve,re+=i*Se,ue+=i*ge,ce+=i*be,ne+=i*we,ie+=i*Qe,oe+=i*Ue,F+=i*Me,W+=i*De,G+=i*Ge,H+=i*Je,V+=i*ct,M+=i*ut,b+=i*ft,i=d[7],q+=i*g,te+=i*ye,re+=i*ve,ue+=i*Se,ce+=i*ge,ne+=i*be,ie+=i*we,oe+=i*Qe,F+=i*Ue,W+=i*Me,G+=i*De,H+=i*Ge,V+=i*Je,M+=i*ct,b+=i*ut,w+=i*ft,i=d[8],te+=i*g,re+=i*ye,ue+=i*ve,ce+=i*Se,ne+=i*ge,ie+=i*be,oe+=i*we,F+=i*Qe,W+=i*Ue,G+=i*Me,H+=i*De,V+=i*Ge,M+=i*Je,b+=i*ct,w+=i*ut,U+=i*ft,i=d[9],re+=i*g,ue+=i*ye,ce+=i*ve,ne+=i*Se,ie+=i*ge,oe+=i*be,F+=i*we,W+=i*Qe,G+=i*Ue,H+=i*Me,V+=i*De,M+=i*Ge,b+=i*Je,w+=i*ct,U+=i*ut,v+=i*ft,i=d[10],ue+=i*g,ce+=i*ye,ne+=i*ve,ie+=i*Se,oe+=i*ge,F+=i*be,W+=i*we,G+=i*Qe,H+=i*Ue,V+=i*Me,M+=i*De,b+=i*Ge,w+=i*Je,U+=i*ct,v+=i*ut,E+=i*ft,i=d[11],ce+=i*g,ne+=i*ye,ie+=i*ve,oe+=i*Se,F+=i*ge,W+=i*be,G+=i*we,H+=i*Qe,V+=i*Ue,M+=i*Me,b+=i*De,w+=i*Ge,U+=i*Je,v+=i*ct,E+=i*ut,B+=i*ft,i=d[12],ne+=i*g,ie+=i*ye,oe+=i*ve,F+=i*Se,W+=i*ge,G+=i*be,H+=i*we,V+=i*Qe,M+=i*Ue,b+=i*Me,w+=i*De,U+=i*Ge,v+=i*Je,E+=i*ct,B+=i*ut,Y+=i*ft,i=d[13],ie+=i*g,oe+=i*ye,F+=i*ve,W+=i*Se,G+=i*ge,H+=i*be,V+=i*we,M+=i*Qe,b+=i*Ue,w+=i*Me,U+=i*De,v+=i*Ge,E+=i*Je,B+=i*ct,Y+=i*ut,fe+=i*ft,i=d[14],oe+=i*g,F+=i*ye,W+=i*ve,G+=i*Se,H+=i*ge,V+=i*be,M+=i*we,b+=i*Qe,w+=i*Ue,U+=i*Me,v+=i*De,E+=i*Ge,B+=i*Je,Y+=i*ct,fe+=i*ut,le+=i*ft,i=d[15],F+=i*g,W+=i*ye,G+=i*ve,H+=i*Se,V+=i*ge,M+=i*be,b+=i*we,w+=i*Qe,U+=i*Ue,v+=i*Me,E+=i*De,B+=i*Ge,Y+=i*Je,fe+=i*ct,le+=i*ut,de+=i*ft,m+=38*W,A+=38*G,S+=38*H,R+=38*V,Q+=38*M,D+=38*b,_e+=38*w,q+=38*U,te+=38*v,re+=38*E,ue+=38*B,ce+=38*Y,ne+=38*fe,ie+=38*le,oe+=38*de,l=1,i=m+l+65535,l=Math.floor(i/65536),m=i-l*65536,i=A+l+65535,l=Math.floor(i/65536),A=i-l*65536,i=S+l+65535,l=Math.floor(i/65536),S=i-l*65536,i=R+l+65535,l=Math.floor(i/65536),R=i-l*65536,i=Q+l+65535,l=Math.floor(i/65536),Q=i-l*65536,i=D+l+65535,l=Math.floor(i/65536),D=i-l*65536,i=_e+l+65535,l=Math.floor(i/65536),_e=i-l*65536,i=q+l+65535,l=Math.floor(i/65536),q=i-l*65536,i=te+l+65535,l=Math.floor(i/65536),te=i-l*65536,i=re+l+65535,l=Math.floor(i/65536),re=i-l*65536,i=ue+l+65535,l=Math.floor(i/65536),ue=i-l*65536,i=ce+l+65535,l=Math.floor(i/65536),ce=i-l*65536,i=ne+l+65535,l=Math.floor(i/65536),ne=i-l*65536,i=ie+l+65535,l=Math.floor(i/65536),ie=i-l*65536,i=oe+l+65535,l=Math.floor(i/65536),oe=i-l*65536,i=F+l+65535,l=Math.floor(i/65536),F=i-l*65536,m+=l-1+37*(l-1),l=1,i=m+l+65535,l=Math.floor(i/65536),m=i-l*65536,i=A+l+65535,l=Math.floor(i/65536),A=i-l*65536,i=S+l+65535,l=Math.floor(i/65536),S=i-l*65536,i=R+l+65535,l=Math.floor(i/65536),R=i-l*65536,i=Q+l+65535,l=Math.floor(i/65536),Q=i-l*65536,i=D+l+65535,l=Math.floor(i/65536),D=i-l*65536,i=_e+l+65535,l=Math.floor(i/65536),_e=i-l*65536,i=q+l+65535,l=Math.floor(i/65536),q=i-l*65536,i=te+l+65535,l=Math.floor(i/65536),te=i-l*65536,i=re+l+65535,l=Math.floor(i/65536),re=i-l*65536,i=ue+l+65535,l=Math.floor(i/65536),ue=i-l*65536,i=ce+l+65535,l=Math.floor(i/65536),ce=i-l*65536,i=ne+l+65535,l=Math.floor(i/65536),ne=i-l*65536,i=ie+l+65535,l=Math.floor(i/65536),ie=i-l*65536,i=oe+l+65535,l=Math.floor(i/65536),oe=i-l*65536,i=F+l+65535,l=Math.floor(i/65536),F=i-l*65536,m+=l-1+37*(l-1),a[0]=m,a[1]=A,a[2]=S,a[3]=R,a[4]=Q,a[5]=D,a[6]=_e,a[7]=q,a[8]=te,a[9]=re,a[10]=ue,a[11]=ce,a[12]=ne,a[13]=ie,a[14]=oe,a[15]=F}function Ze(a,d){ae(a,d,d)}function Ar(a,d){var f=t(),i;for(i=0;i<16;i++)f[i]=d[i];for(i=253;i>=0;i--)Ze(f,f),i!==2&&i!==4&&ae(f,f,d);for(i=0;i<16;i++)a[i]=f[i]}function kt(a,d){var f=t(),i;for(i=0;i<16;i++)f[i]=d[i];for(i=250;i>=0;i--)Ze(f,f),i!==1&&ae(f,f,d);for(i=0;i<16;i++)a[i]=f[i]}function br(a,d,f){var i=new Uint8Array(32),l=new Float64Array(80),m,A,S=t(),R=t(),Q=t(),D=t(),_e=t(),q=t();for(A=0;A<31;A++)i[A]=d[A];for(i[31]=d[31]&127|64,i[0]&=248,it(l,f),A=0;A<16;A++)R[A]=l[A],D[A]=S[A]=Q[A]=0;for(S[0]=D[0]=1,A=254;A>=0;--A)m=i[A>>>3]>>>(A&7)&1,se(S,R,m),se(Q,D,m),Oe(_e,S,Q),We(S,S,Q),Oe(Q,R,D),We(R,R,D),Ze(D,_e),Ze(q,S),ae(S,Q,S),ae(Q,R,_e),Oe(_e,S,Q),We(S,S,Q),Ze(R,S),We(Q,D,q),ae(S,Q,u),Oe(S,S,D),ae(Q,Q,S),ae(S,D,q),ae(D,R,l),Ze(R,_e),se(S,R,m),se(Q,D,m);for(A=0;A<16;A++)l[A+16]=S[A],l[A+32]=Q[A],l[A+48]=R[A],l[A+64]=D[A];var te=l.subarray(32),re=l.subarray(16);return Ar(te,te),ae(re,re,te),Ee(a,re),0}function Et(a,d){return br(a,d,o)}function Zt(a,d){return e(d,32),Et(a,d)}function Gr(a,d,f){var i=new Uint8Array(32);return br(i,f,d),ee(a,n,i,L)}var bt=$e,wr=gt;function In(a,d,f,i,l,m){var A=new Uint8Array(32);return Gr(A,l,m),bt(a,d,f,i,A)}function Fo(a,d,f,i,l,m){var A=new Uint8Array(32);return Gr(A,l,m),wr(a,d,f,i,A)}var Jn=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function oc(a,d,f,i){for(var l=new Int32Array(16),m=new Int32Array(16),A,S,R,Q,D,_e,q,te,re,ue,ce,ne,ie,oe,F,W,G,H,V,M,b,w,U,v,E,B,Y=a[0],fe=a[1],le=a[2],de=a[3],g=a[4],ye=a[5],ve=a[6],Se=a[7],ge=d[0],be=d[1],we=d[2],Qe=d[3],Ue=d[4],Me=d[5],De=d[6],Ge=d[7],Je=0;i>=128;){for(V=0;V<16;V++)M=8*V+Je,l[V]=f[M+0]<<24|f[M+1]<<16|f[M+2]<<8|f[M+3],m[V]=f[M+4]<<24|f[M+5]<<16|f[M+6]<<8|f[M+7];for(V=0;V<80;V++)if(A=Y,S=fe,R=le,Q=de,D=g,_e=ye,q=ve,te=Se,re=ge,ue=be,ce=we,ne=Qe,ie=Ue,oe=Me,F=De,W=Ge,b=Se,w=Ge,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=(g>>>14|Ue<<32-14)^(g>>>18|Ue<<32-18)^(Ue>>>41-32|g<<32-(41-32)),w=(Ue>>>14|g<<32-14)^(Ue>>>18|g<<32-18)^(g>>>41-32|Ue<<32-(41-32)),U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,b=g&ye^~g&ve,w=Ue&Me^~Ue&De,U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,b=Jn[V*2],w=Jn[V*2+1],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,b=l[V%16],w=m[V%16],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,G=E&65535|B<<16,H=U&65535|v<<16,b=G,w=H,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=(Y>>>28|ge<<32-28)^(ge>>>34-32|Y<<32-(34-32))^(ge>>>39-32|Y<<32-(39-32)),w=(ge>>>28|Y<<32-28)^(Y>>>34-32|ge<<32-(34-32))^(Y>>>39-32|ge<<32-(39-32)),U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,b=Y&fe^Y&le^fe&le,w=ge&be^ge&we^be&we,U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,te=E&65535|B<<16,W=U&65535|v<<16,b=Q,w=ne,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=G,w=H,U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,Q=E&65535|B<<16,ne=U&65535|v<<16,fe=A,le=S,de=R,g=Q,ye=D,ve=_e,Se=q,Y=te,be=re,we=ue,Qe=ce,Ue=ne,Me=ie,De=oe,Ge=F,ge=W,V%16===15)for(M=0;M<16;M++)b=l[M],w=m[M],U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=l[(M+9)%16],w=m[(M+9)%16],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,G=l[(M+1)%16],H=m[(M+1)%16],b=(G>>>1|H<<32-1)^(G>>>8|H<<32-8)^G>>>7,w=(H>>>1|G<<32-1)^(H>>>8|G<<32-8)^(H>>>7|G<<32-7),U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,G=l[(M+14)%16],H=m[(M+14)%16],b=(G>>>19|H<<32-19)^(H>>>61-32|G<<32-(61-32))^G>>>6,w=(H>>>19|G<<32-19)^(G>>>61-32|H<<32-(61-32))^(H>>>6|G<<32-6),U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,l[M]=E&65535|B<<16,m[M]=U&65535|v<<16;b=Y,w=ge,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=a[0],w=d[0],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,a[0]=Y=E&65535|B<<16,d[0]=ge=U&65535|v<<16,b=fe,w=be,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=a[1],w=d[1],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,a[1]=fe=E&65535|B<<16,d[1]=be=U&65535|v<<16,b=le,w=we,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=a[2],w=d[2],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,a[2]=le=E&65535|B<<16,d[2]=we=U&65535|v<<16,b=de,w=Qe,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=a[3],w=d[3],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,a[3]=de=E&65535|B<<16,d[3]=Qe=U&65535|v<<16,b=g,w=Ue,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=a[4],w=d[4],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,a[4]=g=E&65535|B<<16,d[4]=Ue=U&65535|v<<16,b=ye,w=Me,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=a[5],w=d[5],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,a[5]=ye=E&65535|B<<16,d[5]=Me=U&65535|v<<16,b=ve,w=De,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=a[6],w=d[6],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,a[6]=ve=E&65535|B<<16,d[6]=De=U&65535|v<<16,b=Se,w=Ge,U=w&65535,v=w>>>16,E=b&65535,B=b>>>16,b=a[7],w=d[7],U+=w&65535,v+=w>>>16,E+=b&65535,B+=b>>>16,v+=U>>>16,E+=v>>>16,B+=E>>>16,a[7]=Se=E&65535|B<<16,d[7]=Ge=U&65535|v<<16,Je+=128,i-=128}return i}function qr(a,d,f){var i=new Int32Array(8),l=new Int32Array(8),m=new Uint8Array(256),A,S=f;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,l[0]=4089235720,l[1]=2227873595,l[2]=4271175723,l[3]=1595750129,l[4]=2917565137,l[5]=725511199,l[6]=4215389547,l[7]=327033209,oc(i,l,d,f),f%=128,A=0;A<f;A++)m[A]=d[S-f+A];for(m[f]=128,f=256-128*(f<112?1:0),m[f-9]=0,T(m,f-8,S/536870912|0,S<<3),oc(i,l,m,f),A=0;A<8;A++)T(a,8*A,i[A],l[A]);return 0}function Ko(a,d){var f=t(),i=t(),l=t(),m=t(),A=t(),S=t(),R=t(),Q=t(),D=t();We(f,a[1],a[0]),We(D,d[1],d[0]),ae(f,f,D),Oe(i,a[0],a[1]),Oe(D,d[0],d[1]),ae(i,i,D),ae(l,a[3],d[3]),ae(l,l,y),ae(m,a[2],d[2]),Oe(m,m,m),We(A,i,f),We(S,m,l),Oe(R,m,l),Oe(Q,i,f),ae(a[0],A,S),ae(a[1],Q,R),ae(a[2],R,S),ae(a[3],A,Q)}function ic(a,d,f){var i;for(i=0;i<4;i++)se(a[i],d[i],f)}function ns(a,d){var f=t(),i=t(),l=t();Ar(l,d[2]),ae(f,d[0],l),ae(i,d[1],l),Ee(a,i),a[31]^=Ve(f)<<7}function os(a,d,f){var i,l;for(k(a[0],s),k(a[1],c),k(a[2],c),k(a[3],s),l=255;l>=0;--l)i=f[l/8|0]>>(l&7)&1,ic(a,d,i),Ko(d,a),Ko(a,a),ic(a,d,i)}function Ho(a,d){var f=[t(),t(),t(),t()];k(f[0],h),k(f[1],x),k(f[2],c),ae(f[3],h,x),os(a,f,d)}function is(a,d,f){var i=new Uint8Array(64),l=[t(),t(),t(),t()],m;for(f||e(d,32),qr(i,d,32),i[0]&=248,i[31]&=127,i[31]|=64,Ho(l,i),ns(a,l),m=0;m<32;m++)d[m+32]=a[m];return 0}var $o=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ss(a,d){var f,i,l,m;for(i=63;i>=32;--i){for(f=0,l=i-32,m=i-12;l<m;++l)d[l]+=f-16*d[i]*$o[l-(i-32)],f=Math.floor((d[l]+128)/256),d[l]-=f*256;d[l]+=f,d[i]=0}for(f=0,l=0;l<32;l++)d[l]+=f-(d[31]>>4)*$o[l],f=d[l]>>8,d[l]&=255;for(l=0;l<32;l++)d[l]-=f*$o[l];for(i=0;i<32;i++)d[i+1]+=d[i]>>8,a[i]=d[i]&255}function as(a){var d=new Float64Array(64),f;for(f=0;f<64;f++)d[f]=a[f];for(f=0;f<64;f++)a[f]=0;ss(a,d)}function sc(a,d,f,i){var l=new Uint8Array(64),m=new Uint8Array(64),A=new Uint8Array(64),S,R,Q=new Float64Array(64),D=[t(),t(),t(),t()];qr(l,i,32),l[0]&=248,l[31]&=127,l[31]|=64;var _e=f+64;for(S=0;S<f;S++)a[64+S]=d[S];for(S=0;S<32;S++)a[32+S]=l[32+S];for(qr(A,a.subarray(32),f+32),as(A),Ho(D,A),ns(a,D),S=32;S<64;S++)a[S]=i[S];for(qr(m,a,f+64),as(m),S=0;S<64;S++)Q[S]=0;for(S=0;S<32;S++)Q[S]=A[S];for(S=0;S<32;S++)for(R=0;R<32;R++)Q[S+R]+=m[S]*l[R];return ss(a.subarray(32),Q),_e}function il(a,d){var f=t(),i=t(),l=t(),m=t(),A=t(),S=t(),R=t();return k(a[2],c),it(a[1],d),Ze(l,a[1]),ae(m,l,p),We(l,l,a[2]),Oe(m,a[2],m),Ze(A,m),Ze(S,A),ae(R,S,A),ae(f,R,l),ae(f,f,m),kt(f,f),ae(f,f,l),ae(f,f,m),ae(f,f,m),ae(a[0],f,m),Ze(i,a[0]),ae(i,i,m),Ce(i,l)&&ae(a[0],a[0],C),Ze(i,a[0]),ae(i,i,m),Ce(i,l)?-1:(Ve(a[0])===d[31]>>7&&We(a[0],s,a[0]),ae(a[3],a[0],a[1]),0)}function cs(a,d,f,i){var l,m=new Uint8Array(32),A=new Uint8Array(64),S=[t(),t(),t(),t()],R=[t(),t(),t(),t()];if(f<64||il(R,i))return-1;for(l=0;l<f;l++)a[l]=d[l];for(l=0;l<32;l++)a[l+32]=i[l];if(qr(A,a,f),as(A),os(S,R,A),Ho(R,d.subarray(32)),Ko(S,R),ns(m,S),f-=64,I(d,0,m,0)){for(l=0;l<f;l++)a[l]=0;return-1}for(l=0;l<f;l++)a[l]=d[l+64];return f}var us=32,Vo=24,eo=32,Rn=16,to=32,Qo=32,ro=32,no=32,fs=32,ac=Vo,sl=eo,al=Rn,Jt=64,Lr=32,Pn=64,ds=32,ls=64;r.lowlevel={crypto_core_hsalsa20:ee,crypto_stream_xor:Re,crypto_stream:X,crypto_stream_salsa20_xor:j,crypto_stream_salsa20:J,crypto_onetimeauth:he,crypto_onetimeauth_verify:He,crypto_verify_16:_,crypto_verify_32:I,crypto_secretbox:$e,crypto_secretbox_open:gt,crypto_scalarmult:br,crypto_scalarmult_base:Et,crypto_box_beforenm:Gr,crypto_box_afternm:bt,crypto_box:In,crypto_box_open:Fo,crypto_box_keypair:Zt,crypto_hash:qr,crypto_sign:sc,crypto_sign_keypair:is,crypto_sign_open:cs,crypto_secretbox_KEYBYTES:us,crypto_secretbox_NONCEBYTES:Vo,crypto_secretbox_ZEROBYTES:eo,crypto_secretbox_BOXZEROBYTES:Rn,crypto_scalarmult_BYTES:to,crypto_scalarmult_SCALARBYTES:Qo,crypto_box_PUBLICKEYBYTES:ro,crypto_box_SECRETKEYBYTES:no,crypto_box_BEFORENMBYTES:fs,crypto_box_NONCEBYTES:ac,crypto_box_ZEROBYTES:sl,crypto_box_BOXZEROBYTES:al,crypto_sign_BYTES:Jt,crypto_sign_PUBLICKEYBYTES:Lr,crypto_sign_SECRETKEYBYTES:Pn,crypto_sign_SEEDBYTES:ds,crypto_hash_BYTES:ls,gf:t,D:p,L:$o,pack25519:Ee,unpack25519:it,M:ae,A:Oe,S:Ze,Z:We,pow2523:kt,add:Ko,set25519:k,modL:ss,scalarmult:os,scalarbase:Ho};function cc(a,d){if(a.length!==us)throw new Error("bad key size");if(d.length!==Vo)throw new Error("bad nonce size")}function cl(a,d){if(a.length!==ro)throw new Error("bad public key size");if(d.length!==no)throw new Error("bad secret key size")}function wt(){for(var a=0;a<arguments.length;a++)if(!(arguments[a]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function uc(a){for(var d=0;d<a.length;d++)a[d]=0}r.randomBytes=function(a){var d=new Uint8Array(a);return e(d,a),d},r.secretbox=function(a,d,f){wt(a,d,f),cc(f,d);for(var i=new Uint8Array(eo+a.length),l=new Uint8Array(i.length),m=0;m<a.length;m++)i[m+eo]=a[m];return $e(l,i,i.length,d,f),l.subarray(Rn)},r.secretbox.open=function(a,d,f){wt(a,d,f),cc(f,d);for(var i=new Uint8Array(Rn+a.length),l=new Uint8Array(i.length),m=0;m<a.length;m++)i[m+Rn]=a[m];return i.length<32||gt(l,i,i.length,d,f)!==0?null:l.subarray(eo)},r.secretbox.keyLength=us,r.secretbox.nonceLength=Vo,r.secretbox.overheadLength=Rn,r.scalarMult=function(a,d){if(wt(a,d),a.length!==Qo)throw new Error("bad n size");if(d.length!==to)throw new Error("bad p size");var f=new Uint8Array(to);return br(f,a,d),f},r.scalarMult.base=function(a){if(wt(a),a.length!==Qo)throw new Error("bad n size");var d=new Uint8Array(to);return Et(d,a),d},r.scalarMult.scalarLength=Qo,r.scalarMult.groupElementLength=to,r.box=function(a,d,f,i){var l=r.box.before(f,i);return r.secretbox(a,d,l)},r.box.before=function(a,d){wt(a,d),cl(a,d);var f=new Uint8Array(fs);return Gr(f,a,d),f},r.box.after=r.secretbox,r.box.open=function(a,d,f,i){var l=r.box.before(f,i);return r.secretbox.open(a,d,l)},r.box.open.after=r.secretbox.open,r.box.keyPair=function(){var a=new Uint8Array(ro),d=new Uint8Array(no);return Zt(a,d),{publicKey:a,secretKey:d}},r.box.keyPair.fromSecretKey=function(a){if(wt(a),a.length!==no)throw new Error("bad secret key size");var d=new Uint8Array(ro);return Et(d,a),{publicKey:d,secretKey:new Uint8Array(a)}},r.box.publicKeyLength=ro,r.box.secretKeyLength=no,r.box.sharedKeyLength=fs,r.box.nonceLength=ac,r.box.overheadLength=r.secretbox.overheadLength,r.sign=function(a,d){if(wt(a,d),d.length!==Pn)throw new Error("bad secret key size");var f=new Uint8Array(Jt+a.length);return sc(f,a,a.length,d),f},r.sign.open=function(a,d){if(wt(a,d),d.length!==Lr)throw new Error("bad public key size");var f=new Uint8Array(a.length),i=cs(f,a,a.length,d);if(i<0)return null;for(var l=new Uint8Array(i),m=0;m<l.length;m++)l[m]=f[m];return l},r.sign.detached=function(a,d){for(var f=r.sign(a,d),i=new Uint8Array(Jt),l=0;l<i.length;l++)i[l]=f[l];return i},r.sign.detached.verify=function(a,d,f){if(wt(a,d,f),d.length!==Jt)throw new Error("bad signature size");if(f.length!==Lr)throw new Error("bad public key size");var i=new Uint8Array(Jt+a.length),l=new Uint8Array(Jt+a.length),m;for(m=0;m<Jt;m++)i[m]=d[m];for(m=0;m<a.length;m++)i[m+Jt]=a[m];return cs(l,i,i.length,f)>=0},r.sign.keyPair=function(){var a=new Uint8Array(Lr),d=new Uint8Array(Pn);return is(a,d),{publicKey:a,secretKey:d}},r.sign.keyPair.fromSecretKey=function(a){if(wt(a),a.length!==Pn)throw new Error("bad secret key size");for(var d=new Uint8Array(Lr),f=0;f<d.length;f++)d[f]=a[32+f];return{publicKey:d,secretKey:new Uint8Array(a)}},r.sign.keyPair.fromSeed=function(a){if(wt(a),a.length!==ds)throw new Error("bad seed size");for(var d=new Uint8Array(Lr),f=new Uint8Array(Pn),i=0;i<32;i++)f[i]=a[i];return is(d,f,!0),{publicKey:d,secretKey:f}},r.sign.publicKeyLength=Lr,r.sign.secretKeyLength=Pn,r.sign.seedLength=ds,r.sign.signatureLength=Jt,r.hash=function(a){wt(a);var d=new Uint8Array(ls);return qr(d,a,a.length),d},r.hash.hashLength=ls,r.verify=function(a,d){return wt(a,d),a.length===0||d.length===0||a.length!==d.length?!1:z(a,0,d,0,a.length)===0},r.setPRNG=function(a){e=a},function(){var a=typeof self<"u"?self.crypto||self.msCrypto:null;if(a&&a.getRandomValues){var d=65536;r.setPRNG(function(f,i){var l,m=new Uint8Array(i);for(l=0;l<i;l+=d)a.getRandomValues(m.subarray(l,l+Math.min(i-l,d)));for(l=0;l<i;l++)f[l]=m[l];uc(m)})}else typeof dc<"u"&&(a=Mc(),a&&a.randomBytes&&r.setPRNG(function(f,i){var l,m=a.randomBytes(i);for(l=0;l<i;l++)f[l]=m[l];uc(m)}))}()})(typeof ci<"u"&&ci.exports?ci.exports:self.nacl=self.nacl||{})});var ha=Te((eA,Wu)=>{"use strict";Wu.exports=function(t,e){return function(){for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];return t.apply(e,o)}}});var rt=Te((tA,Zu)=>{"use strict";var jp=ha(),xa=Object.prototype.toString,Aa=function(r){return function(t){var e=xa.call(t);return r[e]||(r[e]=e.slice(8,-1).toLowerCase())}}(Object.create(null));function un(r){return r=r.toLowerCase(),function(e){return Aa(e)===r}}function ba(r){return Array.isArray(r)}function Ui(r){return typeof r>"u"}function Wp(r){return r!==null&&!Ui(r)&&r.constructor!==null&&!Ui(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}var Yu=un("ArrayBuffer");function Yp(r){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(r):t=r&&r.buffer&&Yu(r.buffer),t}function Xp(r){return typeof r=="string"}function Zp(r){return typeof r=="number"}function Xu(r){return r!==null&&typeof r=="object"}function Ci(r){if(Aa(r)!=="object")return!1;var t=Object.getPrototypeOf(r);return t===null||t===Object.prototype}var Jp=un("Date"),eg=un("File"),tg=un("Blob"),rg=un("FileList");function wa(r){return xa.call(r)==="[object Function]"}function ng(r){return Xu(r)&&wa(r.pipe)}function og(r){var t="[object FormData]";return r&&(typeof FormData=="function"&&r instanceof FormData||xa.call(r)===t||wa(r.toString)&&r.toString()===t)}var ig=un("URLSearchParams");function sg(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function ag(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Ta(r,t){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),ba(r))for(var e=0,n=r.length;e<n;e++)t.call(null,r[e],e,r);else for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.call(null,r[o],o,r)}function ma(){var r={};function t(o,s){Ci(r[s])&&Ci(o)?r[s]=ma(r[s],o):Ci(o)?r[s]=ma({},o):ba(o)?r[s]=o.slice():r[s]=o}for(var e=0,n=arguments.length;e<n;e++)Ta(arguments[e],t);return r}function cg(r,t,e){return Ta(t,function(o,s){e&&typeof o=="function"?r[s]=jp(o,e):r[s]=o}),r}function ug(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}function fg(r,t,e,n){r.prototype=Object.create(t.prototype,n),r.prototype.constructor=r,e&&Object.assign(r.prototype,e)}function dg(r,t,e){var n,o,s,c={};t=t||{};do{for(n=Object.getOwnPropertyNames(r),o=n.length;o-- >0;)s=n[o],c[s]||(t[s]=r[s],c[s]=!0);r=Object.getPrototypeOf(r)}while(r&&(!e||e(r,t))&&r!==Object.prototype);return t}function lg(r,t,e){r=String(r),(e===void 0||e>r.length)&&(e=r.length),e-=t.length;var n=r.indexOf(t,e);return n!==-1&&n===e}function pg(r){if(!r)return null;var t=r.length;if(Ui(t))return null;for(var e=new Array(t);t-- >0;)e[t]=r[t];return e}var gg=function(r){return function(t){return r&&t instanceof r}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array));Zu.exports={isArray:ba,isArrayBuffer:Yu,isBuffer:Wp,isFormData:og,isArrayBufferView:Yp,isString:Xp,isNumber:Zp,isObject:Xu,isPlainObject:Ci,isUndefined:Ui,isDate:Jp,isFile:eg,isBlob:tg,isFunction:wa,isStream:ng,isURLSearchParams:ig,isStandardBrowserEnv:ag,forEach:Ta,merge:ma,extend:cg,trim:sg,stripBOM:ug,inherits:fg,toFlatObject:dg,kindOf:Aa,kindOfTest:un,endsWith:lg,toArray:pg,isTypedArray:gg,isFileList:rg}});var _a=Te((rA,ef)=>{"use strict";var Gn=rt();function Ju(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}ef.exports=function(t,e,n){if(!e)return t;var o;if(n)o=n(e);else if(Gn.isURLSearchParams(e))o=e.toString();else{var s=[];Gn.forEach(e,function(p,y){p===null||typeof p>"u"||(Gn.isArray(p)?y=y+"[]":p=[p],Gn.forEach(p,function(x){Gn.isDate(x)?x=x.toISOString():Gn.isObject(x)&&(x=JSON.stringify(x)),s.push(Ju(y)+"="+Ju(x))}))}),o=s.join("&")}if(o){var c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}});var rf=Te((nA,tf)=>{"use strict";var yg=rt();function Bi(){this.handlers=[]}Bi.prototype.use=function(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1};Bi.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};Bi.prototype.forEach=function(t){yg.forEach(this.handlers,function(n){n!==null&&t(n)})};tf.exports=Bi});var of=Te((oA,nf)=>{"use strict";var hg=rt();nf.exports=function(t,e){hg.forEach(t,function(o,s){s!==e&&s.toUpperCase()===e.toUpperCase()&&(t[e]=o,delete t[s])})}});var fn=Te((iA,uf)=>{"use strict";var sf=rt();function qn(r,t,e,n,o){Error.call(this),this.message=r,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),n&&(this.request=n),o&&(this.response=o)}sf.inherits(qn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var af=qn.prototype,cf={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(r){cf[r]={value:r}});Object.defineProperties(qn,cf);Object.defineProperty(af,"isAxiosError",{value:!0});qn.from=function(r,t,e,n,o,s){var c=Object.create(af);return sf.toFlatObject(r,c,function(p){return p!==Error.prototype}),qn.call(c,r.message,t,e,n,o),c.name=r.name,s&&Object.assign(c,s),c};uf.exports=qn});var va=Te((sA,ff)=>{"use strict";ff.exports={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1}});var Sa=Te((aA,df)=>{"use strict";var Kt=rt();function mg(r,t){t=t||new FormData;var e=[];function n(s){return s===null?"":Kt.isDate(s)?s.toISOString():Kt.isArrayBuffer(s)||Kt.isTypedArray(s)?typeof Blob=="function"?new Blob([s]):Buffer.from(s):s}function o(s,c){if(Kt.isPlainObject(s)||Kt.isArray(s)){if(e.indexOf(s)!==-1)throw Error("Circular reference detected in "+c);e.push(s),Kt.forEach(s,function(p,y){if(!Kt.isUndefined(p)){var h=c?c+"."+y:y,x;if(p&&!c&&typeof p=="object"){if(Kt.endsWith(y,"{}"))p=JSON.stringify(p);else if(Kt.endsWith(y,"[]")&&(x=Kt.toArray(p))){x.forEach(function(C){!Kt.isUndefined(C)&&t.append(h,n(C))});return}}o(p,h)}}),e.pop()}else t.append(c,n(s))}return o(r),t}df.exports=mg});var pf=Te((cA,lf)=>{"use strict";var Ea=fn();lf.exports=function(t,e,n){var o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):e(new Ea("Request failed with status code "+n.status,[Ea.ERR_BAD_REQUEST,Ea.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}});var yf=Te((uA,gf)=>{"use strict";var Ii=rt();gf.exports=Ii.isStandardBrowserEnv()?function(){return{write:function(e,n,o,s,c,u){var p=[];p.push(e+"="+encodeURIComponent(n)),Ii.isNumber(o)&&p.push("expires="+new Date(o).toGMTString()),Ii.isString(s)&&p.push("path="+s),Ii.isString(c)&&p.push("domain="+c),u===!0&&p.push("secure"),document.cookie=p.join("; ")},read:function(e){var n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var mf=Te((fA,hf)=>{"use strict";hf.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}});var Af=Te((dA,xf)=>{"use strict";xf.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}});var Ca=Te((lA,bf)=>{"use strict";var xg=mf(),Ag=Af();bf.exports=function(t,e){return t&&!xg(e)?Ag(t,e):e}});var Tf=Te((pA,wf)=>{"use strict";var Ua=rt(),bg=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];wf.exports=function(t){var e={},n,o,s;return t&&Ua.forEach(t.split(`
2
+ `),function(u){if(s=u.indexOf(":"),n=Ua.trim(u.substr(0,s)).toLowerCase(),o=Ua.trim(u.substr(s+1)),n){if(e[n]&&bg.indexOf(n)>=0)return;n==="set-cookie"?e[n]=(e[n]?e[n]:[]).concat([o]):e[n]=e[n]?e[n]+", "+o:o}}),e}});var Sf=Te((gA,vf)=>{"use strict";var _f=rt();vf.exports=_f.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a"),n;function o(s){var c=s;return t&&(e.setAttribute("href",c),c=e.href),e.setAttribute("href",c),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return n=o(window.location.href),function(c){var u=_f.isString(c)?o(c):c;return u.protocol===n.protocol&&u.host===n.host}}():function(){return function(){return!0}}()});var xo=Te((yA,Cf)=>{"use strict";var Ba=fn(),wg=rt();function Ef(r){Ba.call(this,r??"canceled",Ba.ERR_CANCELED),this.name="CanceledError"}wg.inherits(Ef,Ba,{__CANCEL__:!0});Cf.exports=Ef});var Bf=Te((hA,Uf)=>{"use strict";Uf.exports=function(t){var e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}});var Ia=Te((mA,If)=>{"use strict";var Ao=rt(),Tg=pf(),_g=yf(),vg=_a(),Sg=Ca(),Eg=Tf(),Cg=Sf(),Ug=va(),lr=fn(),Bg=xo(),Ig=Bf();If.exports=function(t){return new Promise(function(n,o){var s=t.data,c=t.headers,u=t.responseType,p;function y(){t.cancelToken&&t.cancelToken.unsubscribe(p),t.signal&&t.signal.removeEventListener("abort",p)}Ao.isFormData(s)&&Ao.isStandardBrowserEnv()&&delete c["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var x=t.auth.username||"",C=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";c.Authorization="Basic "+btoa(x+":"+C)}var T=Sg(t.baseURL,t.url);h.open(t.method.toUpperCase(),vg(T,t.params,t.paramsSerializer),!0),h.timeout=t.timeout;function z(){if(h){var P="getAllResponseHeaders"in h?Eg(h.getAllResponseHeaders()):null,$=!u||u==="text"||u==="json"?h.responseText:h.response,N={data:$,status:h.status,statusText:h.statusText,headers:P,config:t,request:h};Tg(function(L){n(L),y()},function(L){o(L),y()},N),h=null}}if("onloadend"in h?h.onloadend=z:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(z)},h.onabort=function(){h&&(o(new lr("Request aborted",lr.ECONNABORTED,t,h)),h=null)},h.onerror=function(){o(new lr("Network Error",lr.ERR_NETWORK,t,h,h)),h=null},h.ontimeout=function(){var $=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",N=t.transitional||Ug;t.timeoutErrorMessage&&($=t.timeoutErrorMessage),o(new lr($,N.clarifyTimeoutError?lr.ETIMEDOUT:lr.ECONNABORTED,t,h)),h=null},Ao.isStandardBrowserEnv()){var _=(t.withCredentials||Cg(T))&&t.xsrfCookieName?_g.read(t.xsrfCookieName):void 0;_&&(c[t.xsrfHeaderName]=_)}"setRequestHeader"in h&&Ao.forEach(c,function($,N){typeof s>"u"&&N.toLowerCase()==="content-type"?delete c[N]:h.setRequestHeader(N,$)}),Ao.isUndefined(t.withCredentials)||(h.withCredentials=!!t.withCredentials),u&&u!=="json"&&(h.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&h.addEventListener("progress",t.onDownloadProgress),typeof t.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(p=function(P){h&&(o(!P||P&&P.type?new Bg:P),h.abort(),h=null)},t.cancelToken&&t.cancelToken.subscribe(p),t.signal&&(t.signal.aborted?p():t.signal.addEventListener("abort",p))),s||(s=null);var I=Ig(T);if(I&&["http","https","file"].indexOf(I)===-1){o(new lr("Unsupported protocol "+I+":",lr.ERR_BAD_REQUEST,t));return}h.send(s)})}});var Pf=Te((xA,Rf)=>{"use strict";Rf.exports=null});var Pi=Te((AA,zf)=>{"use strict";var nt=rt(),Of=of(),kf=fn(),Rg=va(),Pg=Sa(),Og={"Content-Type":"application/x-www-form-urlencoded"};function Nf(r,t){!nt.isUndefined(r)&&nt.isUndefined(r["Content-Type"])&&(r["Content-Type"]=t)}function kg(){var r;return typeof XMLHttpRequest<"u"?r=Ia():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=Ia()),r}function Ng(r,t,e){if(nt.isString(r))try{return(t||JSON.parse)(r),nt.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(e||JSON.stringify)(r)}var Ri={transitional:Rg,adapter:kg(),transformRequest:[function(t,e){if(Of(e,"Accept"),Of(e,"Content-Type"),nt.isFormData(t)||nt.isArrayBuffer(t)||nt.isBuffer(t)||nt.isStream(t)||nt.isFile(t)||nt.isBlob(t))return t;if(nt.isArrayBufferView(t))return t.buffer;if(nt.isURLSearchParams(t))return Nf(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var n=nt.isObject(t),o=e&&e["Content-Type"],s;if((s=nt.isFileList(t))||n&&o==="multipart/form-data"){var c=this.env&&this.env.FormData;return Pg(s?{"files[]":t}:t,c&&new c)}else if(n||o==="application/json")return Nf(e,"application/json"),Ng(t);return t}],transformResponse:[function(t){var e=this.transitional||Ri.transitional,n=e&&e.silentJSONParsing,o=e&&e.forcedJSONParsing,s=!n&&this.responseType==="json";if(s||o&&nt.isString(t)&&t.length)try{return JSON.parse(t)}catch(c){if(s)throw c.name==="SyntaxError"?kf.from(c,kf.ERR_BAD_RESPONSE,this,null,this.response):c}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pf()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};nt.forEach(["delete","get","head"],function(t){Ri.headers[t]={}});nt.forEach(["post","put","patch"],function(t){Ri.headers[t]=nt.merge(Og)});zf.exports=Ri});var Df=Te((bA,Mf)=>{"use strict";var zg=rt(),Mg=Pi();Mf.exports=function(t,e,n){var o=this||Mg;return zg.forEach(n,function(c){t=c.call(o,t,e)}),t}});var Ra=Te((wA,Gf)=>{"use strict";Gf.exports=function(t){return!!(t&&t.__CANCEL__)}});var Ff=Te((TA,Lf)=>{"use strict";var qf=rt(),Pa=Df(),Dg=Ra(),Gg=Pi(),qg=xo();function Oa(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new qg}Lf.exports=function(t){Oa(t),t.headers=t.headers||{},t.data=Pa.call(t,t.data,t.headers,t.transformRequest),t.headers=qf.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),qf.forEach(["delete","get","head","post","put","patch","common"],function(o){delete t.headers[o]});var e=t.adapter||Gg.adapter;return e(t).then(function(o){return Oa(t),o.data=Pa.call(t,o.data,o.headers,t.transformResponse),o},function(o){return Dg(o)||(Oa(t),o&&o.response&&(o.response.data=Pa.call(t,o.response.data,o.response.headers,t.transformResponse))),Promise.reject(o)})}});var ka=Te((_A,Kf)=>{"use strict";var St=rt();Kf.exports=function(t,e){e=e||{};var n={};function o(h,x){return St.isPlainObject(h)&&St.isPlainObject(x)?St.merge(h,x):St.isPlainObject(x)?St.merge({},x):St.isArray(x)?x.slice():x}function s(h){if(St.isUndefined(e[h])){if(!St.isUndefined(t[h]))return o(void 0,t[h])}else return o(t[h],e[h])}function c(h){if(!St.isUndefined(e[h]))return o(void 0,e[h])}function u(h){if(St.isUndefined(e[h])){if(!St.isUndefined(t[h]))return o(void 0,t[h])}else return o(void 0,e[h])}function p(h){if(h in e)return o(t[h],e[h]);if(h in t)return o(void 0,t[h])}var y={url:c,method:c,data:c,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:p};return St.forEach(Object.keys(t).concat(Object.keys(e)),function(x){var C=y[x]||s,T=C(x);St.isUndefined(T)&&C!==p||(n[x]=T)}),n}});var Na=Te((vA,Hf)=>{"use strict";Hf.exports={version:"0.27.2"}});var Qf=Te((SA,Vf)=>{"use strict";var Lg=Na().version,Nr=fn(),za={};["object","boolean","number","function","string","symbol"].forEach(function(r,t){za[r]=function(n){return typeof n===r||"a"+(t<1?"n ":" ")+r}});var $f={};za.transitional=function(t,e,n){function o(s,c){return"[Axios v"+Lg+"] Transitional option '"+s+"'"+c+(n?". "+n:"")}return function(s,c,u){if(t===!1)throw new Nr(o(c," has been removed"+(e?" in "+e:"")),Nr.ERR_DEPRECATED);return e&&!$f[c]&&($f[c]=!0,console.warn(o(c," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(s,c,u):!0}};function Fg(r,t,e){if(typeof r!="object")throw new Nr("options must be an object",Nr.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(r),o=n.length;o-- >0;){var s=n[o],c=t[s];if(c){var u=r[s],p=u===void 0||c(u,s,r);if(p!==!0)throw new Nr("option "+s+" must be "+p,Nr.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new Nr("Unknown option "+s,Nr.ERR_BAD_OPTION)}}Vf.exports={assertOptions:Fg,validators:za}});var Jf=Te((EA,Zf)=>{"use strict";var Yf=rt(),Kg=_a(),jf=rf(),Wf=Ff(),Oi=ka(),Hg=Ca(),Xf=Qf(),Ln=Xf.validators;function Fn(r){this.defaults=r,this.interceptors={request:new jf,response:new jf}}Fn.prototype.request=function(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=Oi(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var n=e.transitional;n!==void 0&&Xf.assertOptions(n,{silentJSONParsing:Ln.transitional(Ln.boolean),forcedJSONParsing:Ln.transitional(Ln.boolean),clarifyTimeoutError:Ln.transitional(Ln.boolean)},!1);var o=[],s=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(e)===!1||(s=s&&T.synchronous,o.unshift(T.fulfilled,T.rejected))});var c=[];this.interceptors.response.forEach(function(T){c.push(T.fulfilled,T.rejected)});var u;if(!s){var p=[Wf,void 0];for(Array.prototype.unshift.apply(p,o),p=p.concat(c),u=Promise.resolve(e);p.length;)u=u.then(p.shift(),p.shift());return u}for(var y=e;o.length;){var h=o.shift(),x=o.shift();try{y=h(y)}catch(C){x(C);break}}try{u=Wf(y)}catch(C){return Promise.reject(C)}for(;c.length;)u=u.then(c.shift(),c.shift());return u};Fn.prototype.getUri=function(t){t=Oi(this.defaults,t);var e=Hg(t.baseURL,t.url);return Kg(e,t.params,t.paramsSerializer)};Yf.forEach(["delete","get","head","options"],function(t){Fn.prototype[t]=function(e,n){return this.request(Oi(n||{},{method:t,url:e,data:(n||{}).data}))}});Yf.forEach(["post","put","patch"],function(t){function e(n){return function(s,c,u){return this.request(Oi(u||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:c}))}}Fn.prototype[t]=e(),Fn.prototype[t+"Form"]=e(!0)});Zf.exports=Fn});var td=Te((CA,ed)=>{"use strict";var $g=xo();function Kn(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(o){t=o});var e=this;this.promise.then(function(n){if(e._listeners){var o,s=e._listeners.length;for(o=0;o<s;o++)e._listeners[o](n);e._listeners=null}}),this.promise.then=function(n){var o,s=new Promise(function(c){e.subscribe(c),o=c}).then(n);return s.cancel=function(){e.unsubscribe(o)},s},r(function(o){e.reason||(e.reason=new $g(o),t(e.reason))})}Kn.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};Kn.prototype.subscribe=function(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]};Kn.prototype.unsubscribe=function(t){if(this._listeners){var e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}};Kn.source=function(){var t,e=new Kn(function(o){t=o});return{token:e,cancel:t}};ed.exports=Kn});var nd=Te((UA,rd)=>{"use strict";rd.exports=function(t){return function(n){return t.apply(null,n)}}});var id=Te((BA,od)=>{"use strict";var Vg=rt();od.exports=function(t){return Vg.isObject(t)&&t.isAxiosError===!0}});var cd=Te((IA,Ma)=>{"use strict";var sd=rt(),Qg=ha(),ki=Jf(),jg=ka(),Wg=Pi();function ad(r){var t=new ki(r),e=Qg(ki.prototype.request,t);return sd.extend(e,ki.prototype,t),sd.extend(e,t),e.create=function(o){return ad(jg(r,o))},e}var xt=ad(Wg);xt.Axios=ki;xt.CanceledError=xo();xt.CancelToken=td();xt.isCancel=Ra();xt.VERSION=Na().version;xt.toFormData=Sa();xt.AxiosError=fn();xt.Cancel=xt.CanceledError;xt.all=function(t){return Promise.all(t)};xt.spread=nd();xt.isAxiosError=id();Ma.exports=xt;Ma.exports.default=xt});var fd=Te((RA,ud)=>{"use strict";ud.exports=cd()});var fy={};lc(fy,{APTOS_BIP44_REGEX:()=>Vc,APTOS_COIN:()=>Cs,APTOS_HARDENED_REGEX:()=>$c,Account:()=>dr,AccountAddress:()=>O,AccountAuthenticator:()=>At,AccountAuthenticatorEd25519:()=>gr,AccountAuthenticatorMultiEd25519:()=>Di,AccountAuthenticatorMultiKey:()=>Hn,AccountAuthenticatorSingleKey:()=>jt,AccountAuthenticatorVariant:()=>ms,AddressInvalidReason:()=>Bc,AnyPublicKeyVariant:()=>xs,AnySignatureVariant:()=>As,Aptos:()=>ot,AptosApiError:()=>$t,AptosApiType:()=>ao,AptosConfig:()=>bo,AuthenticationKey:()=>Ft,Bool:()=>qe,CKDPriv:()=>$s,ChainId:()=>yn,DEFAULT_MAX_GAS_AMOUNT:()=>Ss,DEFAULT_NETWORK:()=>vs,DEFAULT_TXN_EXP_SEC_FROM_NOW:()=>Es,DEFAULT_TXN_TIMEOUT_SEC:()=>co,DeriveScheme:()=>Ac,Deserializer:()=>Gs,Ed25519PrivateKey:()=>or,Ed25519PublicKey:()=>Pe,Ed25519Signature:()=>Le,EntryFunction:()=>En,EntryFunctionBytes:()=>lo,FeePayerRawTransaction:()=>mr,FixedBytes:()=>Sr,HARDENED_OFFSET:()=>Fs,Hex:()=>me,HexInvalidReason:()=>Cc,Identifier:()=>ze,KeyType:()=>Qc,MimeType:()=>jo,ModuleId:()=>$n,MoveAbility:()=>mc,MoveFunctionVisibility:()=>hc,MoveOption:()=>Er,MoveString:()=>Xe,MoveVector:()=>Ie,MultiAgentRawTransaction:()=>hr,MultiEd25519PublicKey:()=>qt,MultiEd25519Signature:()=>Jr,MultiKey:()=>an,MultiSig:()=>Yn,MultisigTransactionPayload:()=>Xn,Network:()=>so,NetworkToChainId:()=>Yo,NetworkToFaucetAPI:()=>_s,NetworkToIndexerAPI:()=>Wo,NetworkToNetworkName:()=>gl,NetworkToNodeAPI:()=>Ts,ParsingError:()=>lt,PrivateKey:()=>Wr,PublicKey:()=>Tt,RAW_TRANSACTION_SALT:()=>Us,RAW_TRANSACTION_WITH_DATA_SALT:()=>Xo,RawTransaction:()=>Xt,RawTransactionWithData:()=>vo,RoleType:()=>xc,RotationProofChallenge:()=>wo,Script:()=>Wn,ScriptTransactionArgumentVariants:()=>On,Secp256k1PrivateKey:()=>cr,Secp256k1PublicKey:()=>Lt,Secp256k1Signature:()=>ur,Serializable:()=>Z,Serializer:()=>Mt,Signature:()=>Gt,SignedTransaction:()=>Ht,SigningScheme:()=>kn,SigningSchemeInput:()=>ws,StructTag:()=>Yt,TransactionAuthenticator:()=>Wt,TransactionAuthenticatorEd25519:()=>dn,TransactionAuthenticatorFeePayer:()=>pn,TransactionAuthenticatorMultiAgent:()=>ln,TransactionAuthenticatorMultiEd25519:()=>Gi,TransactionAuthenticatorSingleSender:()=>gn,TransactionAuthenticatorVariant:()=>hs,TransactionPayload:()=>Mr,TransactionPayloadEntryFunction:()=>Qn,TransactionPayloadMultisig:()=>jn,TransactionPayloadScript:()=>Vn,TransactionPayloadVariants:()=>gs,TransactionResponseType:()=>bs,TransactionVariants:()=>ys,TypeTag:()=>Ke,TypeTagAddress:()=>_n,TypeTagBool:()=>hn,TypeTagGeneric:()=>vn,TypeTagParserError:()=>ke,TypeTagParserErrorType:()=>Ad,TypeTagReference:()=>_o,TypeTagSigner:()=>zr,TypeTagStruct:()=>yr,TypeTagU128:()=>wn,TypeTagU16:()=>xn,TypeTagU256:()=>Tn,TypeTagU32:()=>An,TypeTagU64:()=>bn,TypeTagU8:()=>mn,TypeTagVariants:()=>ps,TypeTagVector:()=>Sn,U128:()=>Bt,U16:()=>Ct,U256:()=>It,U32:()=>Ut,U64:()=>Ye,U8:()=>st,aptosCoinStructTag:()=>Xg,aptosRequest:()=>io,buildTransaction:()=>Zi,convertArgument:()=>Va,deriveKey:()=>di,deriveTransactionType:()=>Ya,deserializeFromScriptArgument:()=>hd,ensureBoolean:()=>ni,fetchEntryFunctionAbi:()=>$a,findFirstNonSignerArg:()=>Ka,generateMultiSignersSignedTransaction:()=>_d,generateRawTransaction:()=>Td,generateSignedTransaction:()=>Wa,generateSignedTransactionForSimulation:()=>Qa,generateTransactionPayload:()=>Bo,generateTransactionPayloadWithABI:()=>bd,get:()=>Tc,getAptosFullNode:()=>ht,getAuthenticatorForSimulation:()=>Uo,getFunctionParts:()=>Yi,getSigningMessage:()=>vd,isBcsAddress:()=>Co,isBcsBool:()=>Li,isBcsFixedBytes:()=>Fa,isBcsString:()=>Fi,isBcsU128:()=>Qi,isBcsU16:()=>Hi,isBcsU256:()=>ji,isBcsU32:()=>$i,isBcsU64:()=>Vi,isBcsU8:()=>Ki,isBool:()=>qa,isLargeNumber:()=>Eo,isNull:()=>La,isNumber:()=>So,isScriptDataInput:()=>Wi,isString:()=>Cn,isValidBIP44Path:()=>Ks,isValidHardenedPath:()=>Hs,mnemonicToSeed:()=>go,objectStructTag:()=>ey,optionStructTag:()=>Jg,outOfRangeErrorMessage:()=>Uc,paginateWithCursor:()=>Fr,parseTypeTag:()=>Zn,post:()=>Zo,postAptosFaucet:()=>Is,postAptosFullNode:()=>Kr,postAptosIndexer:()=>Bs,request:()=>wc,sign:()=>ja,splitPath:()=>Vs,standardizeTypeTags:()=>Ha,stringStructTag:()=>Zg,throwTypeMismatch:()=>Ne,validateNumberInRange:()=>tr});var $t=class extends Error{constructor(e,n,o){super(o);this.name="AptosApiError",this.url=n.url,this.status=n.status,this.statusText=n.statusText,this.data=n.data,this.request=e}};var yc="0.0.4";var jo=(n=>(n.JSON="application/json",n.BCS="application/x-bcs",n.BCS_SIGNED_TRANSACTION="application/x.aptos.signed_transaction+bcs",n))(jo||{}),ps=(T=>(T[T.Bool=0]="Bool",T[T.U8=1]="U8",T[T.U64=2]="U64",T[T.U128=3]="U128",T[T.Address=4]="Address",T[T.Signer=5]="Signer",T[T.Vector=6]="Vector",T[T.Struct=7]="Struct",T[T.U16=8]="U16",T[T.U32=9]="U32",T[T.U256=10]="U256",T[T.Reference=254]="Reference",T[T.Generic=255]="Generic",T))(ps||{}),On=(y=>(y[y.U8=0]="U8",y[y.U64=1]="U64",y[y.U128=2]="U128",y[y.Address=3]="Address",y[y.U8Vector=4]="U8Vector",y[y.Bool=5]="Bool",y[y.U16=6]="U16",y[y.U32=7]="U32",y[y.U256=8]="U256",y))(On||{}),gs=(n=>(n[n.Script=0]="Script",n[n.EntryFunction=2]="EntryFunction",n[n.Multisig=3]="Multisig",n))(gs||{}),ys=(e=>(e[e.MultiAgentTransaction=0]="MultiAgentTransaction",e[e.FeePayerTransaction=1]="FeePayerTransaction",e))(ys||{}),hs=(s=>(s[s.Ed25519=0]="Ed25519",s[s.MultiEd25519=1]="MultiEd25519",s[s.MultiAgent=2]="MultiAgent",s[s.FeePayer=3]="FeePayer",s[s.SingleSender=4]="SingleSender",s))(hs||{}),ms=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(ms||{}),xs=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(xs||{}),As=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1=1]="Secp256k1",e))(As||{}),bs=(s=>(s.Pending="pending_transaction",s.User="user_transaction",s.Genesis="genesis_transaction",s.BlockMetadata="block_metadata_transaction",s.StateCheckpoint="state_checkpoint_transaction",s))(bs||{}),hc=(n=>(n.PRIVATE="private",n.PUBLIC="public",n.FRIEND="friend",n))(hc||{}),mc=(o=>(o.STORE="store",o.DROP="drop",o.KEY="key",o.COPY="copy",o))(mc||{}),xc=(e=>(e.VALIDATOR="validator",e.FULL_NODE="full_node",e))(xc||{}),kn=(o=>(o[o.Ed25519=0]="Ed25519",o[o.MultiEd25519=1]="MultiEd25519",o[o.SingleKey=2]="SingleKey",o[o.MultiKey=3]="MultiKey",o))(kn||{}),ws=(e=>(e[e.Ed25519=0]="Ed25519",e[e.Secp256k1Ecdsa=2]="Secp256k1Ecdsa",e))(ws||{}),Ac=(s=>(s[s.DeriveAuid=251]="DeriveAuid",s[s.DeriveObjectAddressFromObject=252]="DeriveObjectAddressFromObject",s[s.DeriveObjectAddressFromGuid=253]="DeriveObjectAddressFromGuid",s[s.DeriveObjectAddressFromSeed=254]="DeriveObjectAddressFromSeed",s[s.DeriveResourceAccountAddress=255]="DeriveResourceAccountAddress",s))(Ac||{});var bc={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function wc(r,t){let{url:e,method:n,body:o,contentType:s,params:c,overrides:u}=r,p={...u?.HEADERS,"x-aptos-client":`aptos-ts-sdk/${yc}`,"content-type":s??"application/json"};return u?.AUTH_TOKEN&&e.includes("faucet")&&(p.Authorization=`Bearer ${u?.AUTH_TOKEN}`),t.provider({url:e,method:n,body:o,params:c,headers:p,overrides:u})}async function io(r,t){let{url:e,path:n}=r,o=`${e}/${n??""}`,s=await wc({...r,url:o},t.client),c={status:s.status,statusText:s.statusText,data:s.data,headers:s.headers,config:s.config,request:s.request,url:o};if(t.isIndexerRequest(e)){let p=c.data;if(p.errors)throw new $t(r,c,p.errors[0].message??`Unhandled Error ${s.status} : ${s.statusText}`);c.data=p.data}if(c.status>=200&&c.status<300)return c;let u;throw"message"in s.data&&"error_code"in s.data?u=JSON.stringify(s.data):c.status in bc?u=bc[c.status]:u=`Unhandled Error ${s.status} : ${s.statusText}`,new $t(r,c,u)}var Wo={mainnet:"https://indexer.mainnet.aptoslabs.com/v1/graphql",testnet:"https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql",devnet:"https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},Ts={mainnet:"https://fullnode.mainnet.aptoslabs.com/v1",testnet:"https://fullnode.testnet.aptoslabs.com/v1",devnet:"https://fullnode.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},_s={mainnet:"https://faucet.mainnet.aptoslabs.com",testnet:"https://faucet.testnet.aptoslabs.com",devnet:"https://faucet.devnet.aptoslabs.com",local:"http://127.0.0.1:8081"},so=(s=>(s.MAINNET="mainnet",s.TESTNET="testnet",s.DEVNET="devnet",s.LOCAL="local",s.CUSTOM="custom",s))(so||{}),Yo={mainnet:1,testnet:2},gl={mainnet:"mainnet",testnet:"testnet",devnet:"devnet",local:"local",custom:"custom"};var ao=(n=>(n[n.FULLNODE=0]="FULLNODE",n[n.INDEXER=1]="INDEXER",n[n.FAUCET=2]="FAUCET",n))(ao||{}),vs="devnet",Ss=2e5,Es=20,co=20,Cs="0x1::aptos_coin::AptosCoin",Us="APTOS::RawTransaction",Xo="APTOS::RawTransactionWithData";async function Tc(r){let{aptosConfig:t,overrides:e,params:n,contentType:o,acceptType:s,path:c,originMethod:u,type:p}=r,y=t.getRequestUrl(p);return io({url:y,method:"GET",originMethod:u,path:c,contentType:o?.valueOf(),acceptType:s?.valueOf(),params:n,overrides:{...t.clientConfig,...e}},t)}async function ht(r){return Tc({...r,type:0})}async function Fr(r){let t=[],e,n=r.params;for(;;){n.start=e;let o=await ht({aptosConfig:r.aptosConfig,originMethod:r.originMethod,path:r.path,params:n,overrides:r.overrides});if(e=o.headers["x-aptos-cursor"],delete o.headers,t.push(...o.data),e==null)break}return t}async function Zo(r){let{type:t,originMethod:e,path:n,body:o,acceptType:s,contentType:c,params:u,aptosConfig:p,overrides:y}=r,h=p.getRequestUrl(t);return io({url:h,method:"POST",originMethod:e,path:n,body:o,contentType:c?.valueOf(),acceptType:s?.valueOf(),params:u,overrides:{...p.clientConfig,...y}},p)}async function Kr(r){return Zo({...r,type:0})}async function Bs(r){return Zo({...r,type:1})}async function Is(r){return Zo({...r,type:2})}var Jo=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;var Rs=r=>r instanceof Uint8Array;var _c=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4)),Vt=r=>new DataView(r.buffer,r.byteOffset,r.byteLength),Nt=(r,t)=>r<<32-t|r>>>t,yl=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!yl)throw new Error("Non little-endian hardware is not supported");var hl=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function Hr(r){if(!Rs(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=hl[r[e]];return t}function Nn(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),c=Number.parseInt(s,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");e[n]=c}return e}function Ps(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function zt(r){if(typeof r=="string"&&(r=Ps(r)),!Rs(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}function $r(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!Rs(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}var Tr=class{clone(){return this._cloneInto()}},ml={}.toString;function vc(r,t){if(t!==void 0&&ml.call(t)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,t)}function _r(r){let t=n=>r().update(zt(n)).digest(),e=r();return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=()=>r(),t}function Sc(r){let t=(n,o)=>r(o).update(zt(n)).digest(),e=r({});return t.outputLen=e.outputLen,t.blockLen=e.blockLen,t.create=n=>r(n),t}function Ec(r=32){if(Jo&&typeof Jo.getRandomValues=="function")return Jo.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}var ei=2**8-1,ti=2**16-1,er=2**32-1,Vr=BigInt(2)**BigInt(64)-BigInt(1),uo=BigInt(2)**BigInt(128)-BigInt(1),ri=BigInt(2)**BigInt(256)-BigInt(1);var lt=class extends Error{constructor(e,n){super(e);this.invalidReason=n}};var Cc=(n=>(n.TOO_SHORT="too_short",n.INVALID_LENGTH="invalid_length",n.INVALID_HEX_CHARS="invalid_hex_chars",n))(Cc||{}),me=class r{constructor(t){this.data=t}toUint8Array(){return this.data}toStringWithoutPrefix(){return Hr(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromString(t){let e=t;if(e.startsWith("0x")&&(e=e.slice(2)),e.length===0)throw new lt("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(e.length%2!==0)throw new lt("Hex string must be an even number of hex characters.","invalid_length");try{return new r(Nn(e))}catch(n){let o=n;throw new lt(`Hex string contains invalid hex characters: ${o.message}`,"invalid_hex_chars")}}static fromHexInput(t){return t instanceof Uint8Array?new r(t):r.fromString(t)}static isValid(t){try{return r.fromString(t),{valid:!0}}catch(e){let n=e;return{valid:!1,invalidReason:n.invalidReason,invalidReasonMessage:n.message}}}equals(t){return this.data.length!==t.data.length?!1:this.data.every((e,n)=>e===t.data[n])}};var Z=class{bcsToBytes(){let t=new Mt;return this.serialize(t),t.toUint8Array()}bcsToHex(){let t=this.bcsToBytes();return me.fromHexInput(t)}},Mt=class{constructor(t=64){if(t<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(t),this.offset=0}ensureBufferWillHandleSize(t){for(;this.buffer.byteLength<this.offset+t;){let e=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}appendToBuffer(t){this.ensureBufferWillHandleSize(t.length),new Uint8Array(this.buffer,this.offset).set(t),this.offset+=t.length}serializeWithFunction(t,e,n){this.ensureBufferWillHandleSize(e);let o=new DataView(this.buffer,this.offset);t.apply(o,[0,n,!0]),this.offset+=e}serializeStr(t){let e=new TextEncoder;this.serializeBytes(e.encode(t))}serializeBytes(t){this.serializeU32AsUleb128(t.length),this.appendToBuffer(t)}serializeFixedBytes(t){this.appendToBuffer(t)}serializeBool(t){ni(t);let e=t?1:0;this.appendToBuffer(new Uint8Array([e]))}serializeU8(t){this.appendToBuffer(new Uint8Array([t]))}serializeU16(t){this.serializeWithFunction(DataView.prototype.setUint16,2,t)}serializeU32(t){this.serializeWithFunction(DataView.prototype.setUint32,4,t)}serializeU64(t){let e=BigInt(t)&BigInt(er),n=BigInt(t)>>BigInt(32);this.serializeU32(Number(e)),this.serializeU32(Number(n))}serializeU128(t){let e=BigInt(t)&Vr,n=BigInt(t)>>BigInt(64);this.serializeU64(e),this.serializeU64(n)}serializeU256(t){let e=BigInt(t)&uo,n=BigInt(t)>>BigInt(128);this.serializeU128(e),this.serializeU128(n)}serializeU32AsUleb128(t){let e=t,n=[];for(;e>>>7;)n.push(e&127|128),e>>>=7;n.push(e),this.appendToBuffer(new Uint8Array(n))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(t){t.serialize(this)}serializeVector(t){this.serializeU32AsUleb128(t.length),t.forEach(e=>{e.serialize(this)})}};yt([Qr(0,ei)],Mt.prototype,"serializeU8",1),yt([Qr(0,ti)],Mt.prototype,"serializeU16",1),yt([Qr(0,er)],Mt.prototype,"serializeU32",1),yt([Qr(BigInt(0),Vr)],Mt.prototype,"serializeU64",1),yt([Qr(BigInt(0),uo)],Mt.prototype,"serializeU128",1),yt([Qr(BigInt(0),ri)],Mt.prototype,"serializeU256",1),yt([Qr(0,er)],Mt.prototype,"serializeU32AsUleb128",1);function ni(r){if(typeof r!="boolean")throw new Error(`${r} is not a boolean value`)}var Uc=(r,t,e)=>`${r} is out of range: [${t}, ${e}]`;function tr(r,t,e){let n=BigInt(r);if(n>BigInt(e)||n<BigInt(t))throw new Error(Uc(r,t,e))}function Qr(r,t){return(e,n,o)=>{let s=o.value;return o.value=function(u){return tr(u,r,t),s.apply(this,[u])},o}}var Bc=(u=>(u.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",u.INVALID_HEX_CHARS="invalid_hex_chars",u.TOO_SHORT="too_short",u.TOO_LONG="too_long",u.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",u.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",u.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",u))(Bc||{}),Be=class Be extends Z{constructor(e){super();if(e.length!==Be.LENGTH)throw new lt("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=Hr(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return Hr(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let n=e.deserializeFixedBytes(Be.LENGTH);return new Be(n)}static fromString(e){if(!e.startsWith("0x"))throw new lt("Hex string must start with a leading 0x.","leading_zero_x_required");let n=Be.fromStringRelaxed(e);if(e.length!==Be.LONG_STRING_LENGTH+2)if(n.isSpecial()){if(e.length!==3)throw new lt(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new lt(`The given hex string ${n} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return n}static fromStringRelaxed(e){let n=e;if(e.startsWith("0x")&&(n=e.slice(2)),n.length===0)throw new lt("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(n.length>64)throw new lt("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");let o;try{o=Nn(n.padStart(64,"0"))}catch(s){let c=s;throw new lt(`Hex characters are invalid: ${c.message}`,"invalid_hex_chars")}return new Be(o)}static fromRelaxed(e){return e instanceof Be?e:e instanceof Uint8Array?new Be(e):Be.fromStringRelaxed(e)}static from(e){return e instanceof Be?e:e instanceof Uint8Array?new Be(e):Be.fromString(e)}static isValid(e){try{return e.relaxed?Be.fromRelaxed(e.input):Be.from(e.input),{valid:!0}}catch(n){let o=n;return{valid:!1,invalidReason:o.invalidReason,invalidReasonMessage:o.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((n,o)=>n===e.data[o])}};Be.LENGTH=32,Be.LONG_STRING_LENGTH=64,Be.ZERO=Be.from("0x0"),Be.ONE=Be.from("0x1"),Be.TWO=Be.from("0x2"),Be.THREE=Be.from("0x3"),Be.FOUR=Be.from("0x4");var O=Be;function rr(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}function Dt(r,...t){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(r.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${r.length}`)}function oi(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");rr(r.outputLen),rr(r.blockLen)}function nr(r,t=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(t&&r.finished)throw new Error("Hash#digest() has already been called")}function ii(r,t){Dt(r);let e=t.outputLen;if(r.length<e)throw new Error(`digestInto() expects output buffer of length at least ${e}`)}var si=BigInt(4294967295),Os=BigInt(32);function Ic(r,t=!1){return t?{h:Number(r&si),l:Number(r>>Os&si)}:{h:Number(r>>Os&si)|0,l:Number(r&si)|0}}function ks(r,t=!1){let e=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let o=0;o<r.length;o++){let{h:s,l:c}=Ic(r[o],t);[e[o],n[o]]=[s,c]}return[e,n]}var xl=(r,t)=>BigInt(r>>>0)<<Os|BigInt(t>>>0),Al=(r,t,e)=>r>>>e,bl=(r,t,e)=>r<<32-e|t>>>e,wl=(r,t,e)=>r>>>e|t<<32-e,Tl=(r,t,e)=>r<<32-e|t>>>e,_l=(r,t,e)=>r<<64-e|t>>>e-32,vl=(r,t,e)=>r>>>e-32|t<<64-e,Sl=(r,t)=>t,El=(r,t)=>r,Ns=(r,t,e)=>r<<e|t>>>32-e,zs=(r,t,e)=>t<<e|r>>>32-e,Ms=(r,t,e)=>t<<e-32|r>>>64-e,Ds=(r,t,e)=>r<<e-32|t>>>64-e;function Cl(r,t,e,n){let o=(t>>>0)+(n>>>0);return{h:r+e+(o/2**32|0)|0,l:o|0}}var Ul=(r,t,e)=>(r>>>0)+(t>>>0)+(e>>>0),Bl=(r,t,e,n)=>t+e+n+(r/2**32|0)|0,Il=(r,t,e,n)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0),Rl=(r,t,e,n,o)=>t+e+n+o+(r/2**32|0)|0,Pl=(r,t,e,n,o)=>(r>>>0)+(t>>>0)+(e>>>0)+(n>>>0)+(o>>>0),Ol=(r,t,e,n,o,s)=>t+e+n+o+s+(r/2**32|0)|0;var kl={fromBig:Ic,split:ks,toBig:xl,shrSH:Al,shrSL:bl,rotrSH:wl,rotrSL:Tl,rotrBH:_l,rotrBL:vl,rotr32H:Sl,rotr32L:El,rotlSH:Ns,rotlSL:zs,rotlBH:Ms,rotlBL:Ds,add:Cl,add3L:Ul,add3H:Bl,add4L:Il,add4H:Rl,add5H:Ol,add5L:Pl},pe=kl;var[Oc,kc,Nc]=[[],[],[]],Nl=BigInt(0),fo=BigInt(1),zl=BigInt(2),Ml=BigInt(7),Dl=BigInt(256),Gl=BigInt(113);for(let r=0,t=fo,e=1,n=0;r<24;r++){[e,n]=[n,(2*e+3*n)%5],Oc.push(2*(5*n+e)),kc.push((r+1)*(r+2)/2%64);let o=Nl;for(let s=0;s<7;s++)t=(t<<fo^(t>>Ml)*Gl)%Dl,t&zl&&(o^=fo<<(fo<<BigInt(s))-fo);Nc.push(o)}var[ql,Ll]=ks(Nc,!0),Rc=(r,t,e)=>e>32?Ms(r,t,e):Ns(r,t,e),Pc=(r,t,e)=>e>32?Ds(r,t,e):zs(r,t,e);function Fl(r,t=24){let e=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let c=0;c<10;c++)e[c]=r[c]^r[c+10]^r[c+20]^r[c+30]^r[c+40];for(let c=0;c<10;c+=2){let u=(c+8)%10,p=(c+2)%10,y=e[p],h=e[p+1],x=Rc(y,h,1)^e[u],C=Pc(y,h,1)^e[u+1];for(let T=0;T<50;T+=10)r[c+T]^=x,r[c+T+1]^=C}let o=r[2],s=r[3];for(let c=0;c<24;c++){let u=kc[c],p=Rc(o,s,u),y=Pc(o,s,u),h=Oc[c];o=r[h],s=r[h+1],r[h]=p,r[h+1]=y}for(let c=0;c<50;c+=10){for(let u=0;u<10;u++)e[u]=r[c+u];for(let u=0;u<10;u++)r[c+u]^=~e[(u+2)%10]&e[(u+4)%10]}r[0]^=ql[n],r[1]^=Ll[n]}e.fill(0)}var ai=class r extends Tr{constructor(t,e,n,o=!1,s=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=o,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,rr(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=_c(this.state)}keccak(){Fl(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){nr(this);let{blockLen:e,state:n}=this;t=zt(t);let o=t.length;for(let s=0;s<o;){let c=Math.min(e-this.pos,o-s);for(let u=0;u<c;u++)n[this.pos++]^=t[s++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:e,pos:n,blockLen:o}=this;t[n]^=e,e&128&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){nr(this,!1),Dt(t),this.finish();let e=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let c=Math.min(n-this.posOut,s-o);t.set(e.subarray(this.posOut,this.posOut+c),o),this.posOut+=c,o+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return rr(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ii(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:e,suffix:n,outputLen:o,rounds:s,enableXOF:c}=this;return t||(t=new r(e,n,o,c,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=c,t.destroyed=this.destroyed,t}},vr=(r,t,e)=>_r(()=>new ai(t,r,e)),lh=vr(6,144,224/8),jr=vr(6,136,256/8),ph=vr(6,104,384/8),gh=vr(6,72,512/8),yh=vr(1,144,224/8),hh=vr(1,136,256/8),mh=vr(1,104,384/8),xh=vr(1,72,512/8),zc=(r,t,e)=>Sc((n={})=>new ai(t,r,n.dkLen===void 0?e:n.dkLen,!0)),Ah=zc(31,168,128/8),bh=zc(31,136,256/8);var yo=gc(Dc());var Gs=class{constructor(t){this.buffer=new ArrayBuffer(t.length),new Uint8Array(this.buffer).set(t,0),this.offset=0}read(t){if(this.offset+t>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}deserializeStr(){let t=this.deserializeBytes();return new TextDecoder().decode(t)}deserializeBytes(){let t=this.deserializeUleb128AsU32();return new Uint8Array(this.read(t))}deserializeFixedBytes(t){return new Uint8Array(this.read(t))}deserializeBool(){let t=new Uint8Array(this.read(1))[0];if(t!==1&&t!==0)throw new Error("Invalid boolean value");return t===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let t=this.deserializeU32(),e=this.deserializeU32();return BigInt(BigInt(e)<<BigInt(32)|BigInt(t))}deserializeU128(){let t=this.deserializeU64(),e=this.deserializeU64();return BigInt(e<<BigInt(64)|t)}deserializeU256(){let t=this.deserializeU128(),e=this.deserializeU128();return BigInt(e<<BigInt(128)|t)}deserializeUleb128AsU32(){let t=BigInt(0),e=0;for(;t<er;){let n=this.deserializeU8();if(t|=BigInt(n&127)<<BigInt(e),!(n&128))break;e+=7}if(t>er)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(t)}deserialize(t){return t.deserialize(this)}deserializeVector(t){let e=this.deserializeUleb128AsU32(),n=new Array;for(let o=0;o<e;o+=1)n.push(this.deserialize(t));return n}};var Sr=class r extends Z{constructor(e){super();this.value=me.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,n){let o=e.deserializeFixedBytes(n);return new r(o)}};var lo=class r extends Z{constructor(e){super();this.value=new Sr(e)}serialize(e){e.serialize(this.value)}serializeForEntryFunction(e){e.serializeU32AsUleb128(this.value.value.length),e.serialize(this)}static deserialize(e,n){let o=Sr.deserialize(e,n);return new r(o.value)}};var qe=class r extends Z{constructor(e){super();ni(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}static deserialize(e){return new r(e.deserializeBool())}},st=class r extends Z{constructor(e){super();tr(e,0,ei),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new r(e.deserializeU8())}},Ct=class r extends Z{constructor(e){super();tr(e,0,ti),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new r(e.deserializeU16())}},Ut=class r extends Z{constructor(e){super();tr(e,0,er),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new r(e.deserializeU32())}},Ye=class r extends Z{constructor(e){super();tr(e,BigInt(0),Vr),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new r(e.deserializeU64())}},Bt=class r extends Z{constructor(e){super();tr(e,BigInt(0),uo),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new r(e.deserializeU128())}},It=class r extends Z{constructor(e){super();tr(e,BigInt(0),ri),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new r(e.deserializeU256())}};var Ie=class r extends Z{constructor(e){super();this.values=e}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){if(!(this.values[0]instanceof st)&&this.values[0]!==void 0)throw new Error("Script function arguments only accept u8 vectors");e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let n;if(Array.isArray(e)&&typeof e[0]=="number")n=e;else if(typeof e=="string"){let o=me.fromHexInput(e);n=Array.from(o.toUint8Array())}else if(e instanceof Uint8Array)n=Array.from(e);else throw new Error("Invalid input type");return new r(n.map(o=>new st(o)))}static U16(e){return new r(e.map(n=>new Ct(n)))}static U32(e){return new r(e.map(n=>new Ut(n)))}static U64(e){return new r(e.map(n=>new Ye(n)))}static U128(e){return new r(e.map(n=>new Bt(n)))}static U256(e){return new r(e.map(n=>new It(n)))}static Bool(e){return new r(e.map(n=>new qe(n)))}static MoveString(e){return new r(e.map(n=>new Xe(n)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,n){let o=e.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1)s.push(n.deserialize(e));return new r(s)}},Xe=class r extends Z{constructor(e){super();this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}serializeForScriptFunction(e){let n=this.bcsToBytes().slice(1);Ie.U8(n).serializeForScriptFunction(e)}static deserialize(e){return new r(e.deserializeStr())}},Er=class r extends Z{constructor(e){super();typeof e<"u"&&e!==null?this.vec=new Ie([e]):this.vec=new Ie([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let n=this.bcsToBytes();e.serializeBytes(n)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new r(e!=null?new st(e):void 0)}static U16(e){return new r(e!=null?new Ct(e):void 0)}static U32(e){return new r(e!=null?new Ut(e):void 0)}static U64(e){return new r(e!=null?new Ye(e):void 0)}static U128(e){return new r(e!=null?new Bt(e):void 0)}static U256(e){return new r(e!=null?new It(e):void 0)}static Bool(e){return new r(e!=null?new qe(e):void 0)}static MoveString(e){return new r(e!=null?new Xe(e):void 0)}static deserialize(e,n){let o=Ie.deserialize(e,n);return new r(o.values[0])}};var Tt=class extends Z{},Wr=class extends Z{},Gt=class extends Z{};var ui=class extends Tr{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,oi(t);let n=zt(e);if(this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let c=0;c<s.length;c++)s[c]^=54;this.iHash.update(s),this.oHash=t.create();for(let c=0;c<s.length;c++)s[c]^=106;this.oHash.update(s),s.fill(0)}update(t){return nr(this),this.iHash.update(t),this}digestInto(t){nr(this),Dt(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:n,finished:o,destroyed:s,blockLen:c,outputLen:u}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=c,t.outputLen=u,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Qt=(r,t,e)=>new ui(r,t).update(e).digest();Qt.create=(r,t)=>new ui(r,t);function Kl(r,t,e,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(t,e,n);let o=BigInt(32),s=BigInt(4294967295),c=Number(e>>o&s),u=Number(e&s),p=n?4:0,y=n?0:4;r.setUint32(t+p,c,n),r.setUint32(t+y,u,n)}var Cr=class extends Tr{constructor(t,e,n,o){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Vt(this.buffer)}update(t){nr(this);let{view:e,buffer:n,blockLen:o}=this;t=zt(t);let s=t.length;for(let c=0;c<s;){let u=Math.min(o-this.pos,s-c);if(u===o){let p=Vt(t);for(;o<=s-c;c+=o)this.process(p,c);continue}n.set(t.subarray(c,c+u),this.pos),this.pos+=u,c+=u,this.pos===o&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){nr(this),ii(t,this),this.finished=!0;let{buffer:e,view:n,blockLen:o,isLE:s}=this,{pos:c}=this;e[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>o-c&&(this.process(n,0),c=0);for(let x=c;x<o;x++)e[x]=0;Kl(n,o-8,BigInt(this.length*8),s),this.process(n,0);let u=Vt(t),p=this.outputLen;if(p%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let y=p/4,h=this.get();if(y>h.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;x<y;x++)u.setUint32(4*x,h[x],s)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:n,length:o,finished:s,destroyed:c,pos:u}=this;return t.length=o,t.pos=u,t.finished=s,t.destroyed=c,o%e&&t.buffer.set(n),t}};var[Hl,$l]=(()=>pe.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))))(),Ur=new Uint32Array(80),Br=new Uint32Array(80),qs=class extends Cr{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:t,Al:e,Bh:n,Bl:o,Ch:s,Cl:c,Dh:u,Dl:p,Eh:y,El:h,Fh:x,Fl:C,Gh:T,Gl:z,Hh:_,Hl:I}=this;return[t,e,n,o,s,c,u,p,y,h,x,C,T,z,_,I]}set(t,e,n,o,s,c,u,p,y,h,x,C,T,z,_,I){this.Ah=t|0,this.Al=e|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=c|0,this.Dh=u|0,this.Dl=p|0,this.Eh=y|0,this.El=h|0,this.Fh=x|0,this.Fl=C|0,this.Gh=T|0,this.Gl=z|0,this.Hh=_|0,this.Hl=I|0}process(t,e){for(let N=0;N<16;N++,e+=4)Ur[N]=t.getUint32(e),Br[N]=t.getUint32(e+=4);for(let N=16;N<80;N++){let ee=Ur[N-15]|0,L=Br[N-15]|0,j=pe.rotrSH(ee,L,1)^pe.rotrSH(ee,L,8)^pe.shrSH(ee,L,7),J=pe.rotrSL(ee,L,1)^pe.rotrSL(ee,L,8)^pe.shrSL(ee,L,7),X=Ur[N-2]|0,Re=Br[N-2]|0,Ae=pe.rotrSH(X,Re,19)^pe.rotrBH(X,Re,61)^pe.shrSH(X,Re,6),he=pe.rotrSL(X,Re,19)^pe.rotrBL(X,Re,61)^pe.shrSL(X,Re,6),He=pe.add4L(J,he,Br[N-7],Br[N-16]),$e=pe.add4H(He,j,Ae,Ur[N-7],Ur[N-16]);Ur[N]=$e|0,Br[N]=He|0}let{Ah:n,Al:o,Bh:s,Bl:c,Ch:u,Cl:p,Dh:y,Dl:h,Eh:x,El:C,Fh:T,Fl:z,Gh:_,Gl:I,Hh:P,Hl:$}=this;for(let N=0;N<80;N++){let ee=pe.rotrSH(x,C,14)^pe.rotrSH(x,C,18)^pe.rotrBH(x,C,41),L=pe.rotrSL(x,C,14)^pe.rotrSL(x,C,18)^pe.rotrBL(x,C,41),j=x&T^~x&_,J=C&z^~C&I,X=pe.add5L($,L,J,$l[N],Br[N]),Re=pe.add5H(X,P,ee,j,Hl[N],Ur[N]),Ae=X|0,he=pe.rotrSH(n,o,28)^pe.rotrBH(n,o,34)^pe.rotrBH(n,o,39),He=pe.rotrSL(n,o,28)^pe.rotrBL(n,o,34)^pe.rotrBL(n,o,39),$e=n&s^n&u^s&u,gt=o&c^o&p^c&p;P=_|0,$=I|0,_=T|0,I=z|0,T=x|0,z=C|0,{h:x,l:C}=pe.add(y|0,h|0,Re|0,Ae|0),y=u|0,h=p|0,u=s|0,p=c|0,s=n|0,c=o|0;let k=pe.add3L(Ae,He,gt);n=pe.add3H(k,Re,he,$e),o=k|0}({h:n,l:o}=pe.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:c}=pe.add(this.Bh|0,this.Bl|0,s|0,c|0),{h:u,l:p}=pe.add(this.Ch|0,this.Cl|0,u|0,p|0),{h:y,l:h}=pe.add(this.Dh|0,this.Dl|0,y|0,h|0),{h:x,l:C}=pe.add(this.Eh|0,this.El|0,x|0,C|0),{h:T,l:z}=pe.add(this.Fh|0,this.Fl|0,T|0,z|0),{h:_,l:I}=pe.add(this.Gh|0,this.Gl|0,_|0,I|0),{h:P,l:$}=pe.add(this.Hh|0,this.Hl|0,P|0,$|0),this.set(n,o,s,c,u,p,y,h,x,C,T,z,_,I,P,$)}roundClean(){Ur.fill(0),Br.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};var Yr=_r(()=>new qs);function Vl(r,t,e,n){oi(r);let o=vc({dkLen:32,asyncTick:10},n),{c:s,dkLen:c,asyncTick:u}=o;if(rr(s),rr(c),rr(u),s<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let p=zt(t),y=zt(e),h=new Uint8Array(c),x=Qt.create(r,p),C=x._cloneInto().update(y);return{c:s,dkLen:c,asyncTick:u,DK:h,PRF:x,PRFSalt:C}}function Ql(r,t,e,n,o){return r.destroy(),t.destroy(),n&&n.destroy(),o.fill(0),e}function Gc(r,t,e,n){let{c:o,dkLen:s,DK:c,PRF:u,PRFSalt:p}=Vl(r,t,e,n),y,h=new Uint8Array(4),x=Vt(h),C=new Uint8Array(u.outputLen);for(let T=1,z=0;z<s;T++,z+=u.outputLen){let _=c.subarray(z,z+u.outputLen);x.setInt32(0,T,!1),(y=p._cloneInto(y)).update(h).digestInto(C),_.set(C.subarray(0,_.length));for(let I=1;I<o;I++){u._cloneInto(y).update(C).digestInto(C);for(let P=0;P<_.length;P++)_[P]^=C[P]}}return Ql(u,p,c,y,C)}var jl=(r,t,e)=>r&t^~r&e,Wl=(r,t,e)=>r&t^r&e^t&e,Yl=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ir=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Rr=new Uint32Array(64),Ls=class extends Cr{constructor(){super(64,32,8,!1),this.A=Ir[0]|0,this.B=Ir[1]|0,this.C=Ir[2]|0,this.D=Ir[3]|0,this.E=Ir[4]|0,this.F=Ir[5]|0,this.G=Ir[6]|0,this.H=Ir[7]|0}get(){let{A:t,B:e,C:n,D:o,E:s,F:c,G:u,H:p}=this;return[t,e,n,o,s,c,u,p]}set(t,e,n,o,s,c,u,p){this.A=t|0,this.B=e|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=c|0,this.G=u|0,this.H=p|0}process(t,e){for(let x=0;x<16;x++,e+=4)Rr[x]=t.getUint32(e,!1);for(let x=16;x<64;x++){let C=Rr[x-15],T=Rr[x-2],z=Nt(C,7)^Nt(C,18)^C>>>3,_=Nt(T,17)^Nt(T,19)^T>>>10;Rr[x]=_+Rr[x-7]+z+Rr[x-16]|0}let{A:n,B:o,C:s,D:c,E:u,F:p,G:y,H:h}=this;for(let x=0;x<64;x++){let C=Nt(u,6)^Nt(u,11)^Nt(u,25),T=h+C+jl(u,p,y)+Yl[x]+Rr[x]|0,_=(Nt(n,2)^Nt(n,13)^Nt(n,22))+Wl(n,o,s)|0;h=y,y=p,p=u,u=c+T|0,c=s,s=o,o=n,n=T+_|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,c=c+this.D|0,u=u+this.E|0,p=p+this.F|0,y=y+this.G|0,h=h+this.H|0,this.set(n,o,s,c,u,p,y,h)}roundClean(){Rr.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};var po=_r(()=>new Ls);function fi(r){if(!Number.isSafeInteger(r))throw new Error(`Wrong integer: ${r}`)}function Lc(...r){let t=(o,s)=>c=>o(s(c)),e=Array.from(r).reverse().reduce((o,s)=>o?t(o,s.encode):s.encode,void 0),n=r.reduce((o,s)=>o?t(o,s.decode):s.decode,void 0);return{encode:e,decode:n}}function Xl(r){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(e=>{if(e<0||e>=r.length)throw new Error(`Digit index outside alphabet: ${e} (alphabet: ${r.length})`);return r[e]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(e=>{if(typeof e!="string")throw new Error(`alphabet.decode: not string element=${e}`);let n=r.indexOf(e);if(n===-1)throw new Error(`Unknown letter: "${e}". Allowed: ${r}`);return n})}}}function Zl(r=""){if(typeof r!="string")throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("join.encode input should be array of strings");for(let e of t)if(typeof e!="string")throw new Error(`join.encode: non-string input=${e}`);return t.join(r)},decode:t=>{if(typeof t!="string")throw new Error("join.decode input should be string");return t.split(r)}}}function qc(r,t,e){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(e<2)throw new Error(`convertRadix: wrong to=${e}, base cannot be less than 2`);if(!Array.isArray(r))throw new Error("convertRadix: data should be array");if(!r.length)return[];let n=0,o=[],s=Array.from(r);for(s.forEach(c=>{if(c<0||c>=t)throw new Error(`Wrong integer: ${c}`)});;){let c=0,u=!0;for(let p=n;p<s.length;p++){let y=s[p],h=t*c+y;if(!Number.isSafeInteger(h)||t*c/t!==c||h-y!==t*c)throw new Error("convertRadix: carry overflow");c=h%e;let x=Math.floor(h/e);if(s[p]=x,!Number.isSafeInteger(x)||x*e+c!==h)throw new Error("convertRadix: carry overflow");if(u)x?u=!1:n=p;else continue}if(o.push(c),u)break}for(let c=0;c<r.length-1&&r[c]===0;c++)o.push(0);return o.reverse()}function Jl(r){return{encode:t=>{if(!(t instanceof Uint8Array))throw new Error("radix.encode input should be Uint8Array");return qc(Array.from(t),2**8,r)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("radix.decode input should be array of strings");return Uint8Array.from(qc(t,r,2**8))}}}function ep(r,t){if(typeof t!="function")throw new Error("checksum fn should be function");return{encode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.encode: input should be Uint8Array");let n=t(e).slice(0,r),o=new Uint8Array(e.length+r);return o.set(e),o.set(n,e.length),o},decode(e){if(!(e instanceof Uint8Array))throw new Error("checksum.decode: input should be Uint8Array");let n=e.slice(0,-r),o=t(n).slice(0,r),s=e.slice(-r);for(let c=0;c<r;c++)if(o[c]!==s[c])throw new Error("Invalid checksum");return n}}}var tp=r=>Lc(Jl(58),Xl(r),Zl("")),rp=tp("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var Fc=r=>Lc(ep(4,t=>r(r(t))),rp);function Kc(r){if(typeof r!="string")throw new TypeError(`Invalid mnemonic type: ${typeof r}`);return r.normalize("NFKD")}function np(r){let t=Kc(r),e=t.split(" ");if(![12,15,18,21,24].includes(e.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:e}}var op=r=>Kc(`mnemonic${r}`);function Hc(r,t=""){return Gc(Yr,np(r).nfkd,op(t),{c:2048,dkLen:64})}var $c=/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'?$/,Vc=/^m\/44'\/637'\/[0-9]+'\/[0-9]+\/[0-9]+$/,Qc=(t=>(t.ED25519="ed25519 seed",t))(Qc||{}),Fs=2147483648;function Ks(r){return Vc.test(r)}function Hs(r){return $c.test(r)}var di=(r,t)=>{let e=Qt.create(Yr,r).update(t).digest();return{key:e.slice(0,32),chainCode:e.slice(32)}},$s=({key:r,chainCode:t},e)=>{let n=new ArrayBuffer(4);new DataView(n).setUint32(0,e);let o=new Uint8Array(n),s=new Uint8Array([0]),c=new Uint8Array([...s,...r,...o]);return di(t,c)},sp=r=>r.replace("'",""),Vs=r=>r.split("/").slice(1).map(sp),go=r=>{let t=r.trim().split(/\s+/).map(e=>e.toLowerCase()).join(" ");return Hc(t)};var Xr=class Xr extends Tt{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==Xr.LENGTH)throw new Error(`PublicKey length should be ${Xr.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=me.fromHexInput(n).toUint8Array(),c=o.toUint8Array();return yo.default.sign.detached.verify(s,c,this.key.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Xr(n)}static load(e){let n=e.deserializeBytes();return new Xr(n)}};Xr.LENGTH=32;var Pe=Xr,mt=class mt extends Wr{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==mt.LENGTH)throw new Error(`PrivateKey length should be ${mt.LENGTH}`);this.signingKeyPair=yo.default.sign.keyPair.fromSeed(n.toUint8Array().slice(0,mt.LENGTH))}toUint8Array(){return this.signingKeyPair.secretKey.slice(0,mt.LENGTH)}toString(){return me.fromHexInput(this.toUint8Array()).toString()}sign(e){let n=me.fromHexInput(e),o=yo.default.sign.detached(n.toUint8Array(),this.signingKeyPair.secretKey);return new Le(o)}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new mt(n)}static generate(){let e=yo.default.sign.keyPair();return new mt(e.secretKey.slice(0,mt.LENGTH))}publicKey(){let e=this.signingKeyPair.publicKey;return new Pe(e)}static fromDerivationPath(e,n){if(!Hs(e))throw new Error(`Invalid derivation path ${e}`);return mt.fromDerivationPathInner(e,go(n))}static fromDerivationPathInner(e,n,o=Fs){let{key:s,chainCode:c}=di(mt.SLIP_0010_SEED,n),u=Vs(e).map(y=>parseInt(y,10)),{key:p}=u.reduce((y,h)=>$s(y,h+o),{key:s,chainCode:c});return new mt(p)}};mt.LENGTH=32,mt.SLIP_0010_SEED="ed25519 seed";var or=mt,Zr=class Zr extends Gt{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==Zr.LENGTH)throw new Error(`Signature length should be ${Zr.LENGTH}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new Zr(n)}static load(e){let n=e.deserializeBytes();return new Zr(n)}};Zr.LENGTH=64;var Le=Zr;var Rt=class Rt extends Tt{constructor(e){super();let{publicKeys:n,threshold:o}=e;if(n.length>Rt.MAX_KEYS||n.length<Rt.MIN_KEYS)throw new Error(`Must have between ${Rt.MIN_KEYS} and ${Rt.MAX_KEYS} public keys, inclusive`);if(o<Rt.MIN_THRESHOLD||o>n.length)throw new Error(`Threshold must be between ${Rt.MIN_THRESHOLD} and ${n.length}, inclusive`);this.publicKeys=n,this.threshold=o}toUint8Array(){let e=new Uint8Array(this.publicKeys.length*Pe.LENGTH+1);return this.publicKeys.forEach((n,o)=>{e.set(n.toUint8Array(),o*Pe.LENGTH)}),e[this.publicKeys.length*Pe.LENGTH]=this.threshold,e}toString(){return me.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("TODO - Method not implemented.")}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n[n.length-1],s=[];for(let c=0;c<n.length-1;c+=Pe.LENGTH){let u=c;s.push(new Pe(n.subarray(u,u+Pe.LENGTH)))}return new Rt({publicKeys:s,threshold:o})}};Rt.MAX_KEYS=32,Rt.MIN_KEYS=2,Rt.MIN_THRESHOLD=1;var qt=Rt,Pt=class Pt extends Gt{constructor(e){super();let{signatures:n,bitmap:o}=e;if(o.length!==Pt.BITMAP_LEN)throw new Error(`"bitmap" length should be ${Pt.BITMAP_LEN}`);if(n.length>Pt.MAX_SIGNATURES_SUPPORTED)throw new Error(`The number of signatures cannot be greater than ${Pt.MAX_SIGNATURES_SUPPORTED}`);this.signatures=n,this.bitmap=o}toUint8Array(){let e=new Uint8Array(this.signatures.length*Le.LENGTH+Pt.BITMAP_LEN);return this.signatures.forEach((n,o)=>{e.set(n.toUint8Array(),o*Le.LENGTH)}),e.set(this.bitmap,this.signatures.length*Le.LENGTH),e}toString(){return me.fromHexInput(this.toUint8Array()).toString()}static createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),c=new Set;return n.forEach(u=>{if(u>=Pt.MAX_SIGNATURES_SUPPORTED)throw new Error(`Cannot have a signature larger than ${Pt.MAX_SIGNATURES_SUPPORTED-1}.`);if(c.has(u))throw new Error("Duplicate bits detected.");c.add(u);let p=Math.floor(u/8),y=s[p];y|=o>>u%8,s[p]=y}),s}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes(),o=n.subarray(n.length-4),s=[];for(let c=0;c<n.length-o.length;c+=Le.LENGTH){let u=c;s.push(new Le(n.subarray(u,u+Le.LENGTH)))}return new Pt({signatures:s,bitmap:o})}};Pt.MAX_SIGNATURES_SUPPORTED=32,Pt.BITMAP_LEN=4;var Jr=Pt;var Ys={};lc(Ys,{bitGet:()=>pp,bitLen:()=>lp,bitMask:()=>ho,bitSet:()=>gp,bytesToHex:()=>en,bytesToNumberBE:()=>ir,bytesToNumberLE:()=>gi,concatBytes:()=>zn,createHmacDrbg:()=>Ws,ensureBytes:()=>_t,equalBytes:()=>fp,hexToBytes:()=>tn,hexToNumber:()=>js,numberToBytesBE:()=>Pr,numberToBytesLE:()=>yi,numberToHexUnpadded:()=>Yc,numberToVarBytesBE:()=>up,utf8ToBytes:()=>dp,validateObject:()=>Or});var Wc=BigInt(0),li=BigInt(1),ap=BigInt(2),pi=r=>r instanceof Uint8Array,cp=Array.from({length:256},(r,t)=>t.toString(16).padStart(2,"0"));function en(r){if(!pi(r))throw new Error("Uint8Array expected");let t="";for(let e=0;e<r.length;e++)t+=cp[r[e]];return t}function Yc(r){let t=r.toString(16);return t.length&1?`0${t}`:t}function js(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}function tn(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let t=r.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);let e=new Uint8Array(t/2);for(let n=0;n<e.length;n++){let o=n*2,s=r.slice(o,o+2),c=Number.parseInt(s,16);if(Number.isNaN(c)||c<0)throw new Error("Invalid byte sequence");e[n]=c}return e}function ir(r){return js(en(r))}function gi(r){if(!pi(r))throw new Error("Uint8Array expected");return js(en(Uint8Array.from(r).reverse()))}function Pr(r,t){return tn(r.toString(16).padStart(t*2,"0"))}function yi(r,t){return Pr(r,t).reverse()}function up(r){return tn(Yc(r))}function _t(r,t,e){let n;if(typeof t=="string")try{n=tn(t)}catch(s){throw new Error(`${r} must be valid hex string, got "${t}". Cause: ${s}`)}else if(pi(t))n=Uint8Array.from(t);else throw new Error(`${r} must be hex string or Uint8Array`);let o=n.length;if(typeof e=="number"&&o!==e)throw new Error(`${r} expected ${e} bytes, got ${o}`);return n}function zn(...r){let t=new Uint8Array(r.reduce((n,o)=>n+o.length,0)),e=0;return r.forEach(n=>{if(!pi(n))throw new Error("Uint8Array expected");t.set(n,e),e+=n.length}),t}function fp(r,t){if(r.length!==t.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==t[e])return!1;return!0}function dp(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}function lp(r){let t;for(t=0;r>Wc;r>>=li,t+=1);return t}function pp(r,t){return r>>BigInt(t)&li}var gp=(r,t,e)=>r|(e?li:Wc)<<BigInt(t),ho=r=>(ap<<BigInt(r-1))-li,Qs=r=>new Uint8Array(r),jc=r=>Uint8Array.from(r);function Ws(r,t,e){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof e!="function")throw new Error("hmacFn must be a function");let n=Qs(r),o=Qs(r),s=0,c=()=>{n.fill(1),o.fill(0),s=0},u=(...x)=>e(o,n,...x),p=(x=Qs())=>{o=u(jc([0]),x),n=u(),x.length!==0&&(o=u(jc([1]),x),n=u())},y=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let x=0,C=[];for(;x<t;){n=u();let T=n.slice();C.push(T),x+=n.length}return zn(...C)};return(x,C)=>{c(),p(x);let T;for(;!(T=C(y()));)p();return c(),T}}var yp={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,t)=>t.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function Or(r,t,e={}){let n=(o,s,c)=>{let u=yp[s];if(typeof u!="function")throw new Error(`Invalid validator "${s}", expected function`);let p=r[o];if(!(c&&p===void 0)&&!u(p,r))throw new Error(`Invalid param ${String(o)}=${p} (${typeof p}), expected ${s}`)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(e))n(o,s,!0);return r}var et=BigInt(0),Fe=BigInt(1),rn=BigInt(2),hp=BigInt(3),Xs=BigInt(4),Xc=BigInt(5),Zc=BigInt(8),mp=BigInt(9),xp=BigInt(16);function tt(r,t){let e=r%t;return e>=et?e:t+e}function Ap(r,t,e){if(e<=et||t<et)throw new Error("Expected power/modulo > 0");if(e===Fe)return et;let n=Fe;for(;t>et;)t&Fe&&(n=n*r%e),r=r*r%e,t>>=Fe;return n}function vt(r,t,e){let n=r;for(;t-- >et;)n*=n,n%=e;return n}function hi(r,t){if(r===et||t<=et)throw new Error(`invert: expected positive integers, got n=${r} mod=${t}`);let e=tt(r,t),n=t,o=et,s=Fe,c=Fe,u=et;for(;e!==et;){let y=n/e,h=n%e,x=o-c*y,C=s-u*y;n=e,e=h,o=c,s=u,c=x,u=C}if(n!==Fe)throw new Error("invert: does not exist");return tt(o,t)}function bp(r){let t=(r-Fe)/rn,e,n,o;for(e=r-Fe,n=0;e%rn===et;e/=rn,n++);for(o=rn;o<r&&Ap(o,t,r)!==r-Fe;o++);if(n===1){let c=(r+Fe)/Xs;return function(p,y){let h=p.pow(y,c);if(!p.eql(p.sqr(h),y))throw new Error("Cannot find square root");return h}}let s=(e+Fe)/rn;return function(u,p){if(u.pow(p,t)===u.neg(u.ONE))throw new Error("Cannot find square root");let y=n,h=u.pow(u.mul(u.ONE,o),e),x=u.pow(p,s),C=u.pow(p,e);for(;!u.eql(C,u.ONE);){if(u.eql(C,u.ZERO))return u.ZERO;let T=1;for(let _=u.sqr(C);T<y&&!u.eql(_,u.ONE);T++)_=u.sqr(_);let z=u.pow(h,Fe<<BigInt(y-T-1));h=u.sqr(z),x=u.mul(x,z),C=u.mul(C,h),y=T}return x}}function wp(r){if(r%Xs===hp){let t=(r+Fe)/Xs;return function(n,o){let s=n.pow(o,t);if(!n.eql(n.sqr(s),o))throw new Error("Cannot find square root");return s}}if(r%Zc===Xc){let t=(r-Xc)/Zc;return function(n,o){let s=n.mul(o,rn),c=n.pow(s,t),u=n.mul(o,c),p=n.mul(n.mul(u,rn),c),y=n.mul(u,n.sub(p,n.ONE));if(!n.eql(n.sqr(y),o))throw new Error("Cannot find square root");return y}}return r%xp,bp(r)}var Tp=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Zs(r){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},e=Tp.reduce((n,o)=>(n[o]="function",n),t);return Or(r,e)}function _p(r,t,e){if(e<et)throw new Error("Expected power > 0");if(e===et)return r.ONE;if(e===Fe)return t;let n=r.ONE,o=t;for(;e>et;)e&Fe&&(n=r.mul(n,o)),o=r.sqr(o),e>>=Fe;return n}function vp(r,t){let e=new Array(t.length),n=t.reduce((s,c,u)=>r.is0(c)?s:(e[u]=s,r.mul(s,c)),r.ONE),o=r.inv(n);return t.reduceRight((s,c,u)=>r.is0(c)?s:(e[u]=r.mul(s,e[u]),r.mul(s,c)),o),e}function Js(r,t){let e=t!==void 0?t:r.toString(2).length,n=Math.ceil(e/8);return{nBitLength:e,nByteLength:n}}function Jc(r,t,e=!1,n={}){if(r<=et)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:o,nByteLength:s}=Js(r,t);if(s>2048)throw new Error("Field lengths over 2048 bytes are not supported");let c=wp(r),u=Object.freeze({ORDER:r,BITS:o,BYTES:s,MASK:ho(o),ZERO:et,ONE:Fe,create:p=>tt(p,r),isValid:p=>{if(typeof p!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof p}`);return et<=p&&p<r},is0:p=>p===et,isOdd:p=>(p&Fe)===Fe,neg:p=>tt(-p,r),eql:(p,y)=>p===y,sqr:p=>tt(p*p,r),add:(p,y)=>tt(p+y,r),sub:(p,y)=>tt(p-y,r),mul:(p,y)=>tt(p*y,r),pow:(p,y)=>_p(u,p,y),div:(p,y)=>tt(p*hi(y,r),r),sqrN:p=>p*p,addN:(p,y)=>p+y,subN:(p,y)=>p-y,mulN:(p,y)=>p*y,inv:p=>hi(p,r),sqrt:n.sqrt||(p=>c(u,p)),invertBatch:p=>vp(u,p),cmov:(p,y,h)=>h?y:p,toBytes:p=>e?yi(p,s):Pr(p,s),fromBytes:p=>{if(p.length!==s)throw new Error(`Fp.fromBytes: expected ${s}, got ${p.length}`);return e?gi(p):ir(p)}});return Object.freeze(u)}function eu(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let t=r.toString(2).length;return Math.ceil(t/8)}function ea(r){let t=eu(r);return t+Math.ceil(t/2)}function tu(r,t,e=!1){let n=r.length,o=eu(t),s=ea(t);if(n<16||n<s||n>1024)throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);let c=e?ir(r):gi(r),u=tt(c,t-Fe)+Fe;return e?yi(u,o):Pr(u,o)}var Ep=BigInt(0),ta=BigInt(1);function ru(r,t){let e=(o,s)=>{let c=s.negate();return o?c:s},n=o=>{let s=Math.ceil(t/o)+1,c=2**(o-1);return{windows:s,windowSize:c}};return{constTimeNegate:e,unsafeLadder(o,s){let c=r.ZERO,u=o;for(;s>Ep;)s&ta&&(c=c.add(u)),u=u.double(),s>>=ta;return c},precomputeWindow(o,s){let{windows:c,windowSize:u}=n(s),p=[],y=o,h=y;for(let x=0;x<c;x++){h=y,p.push(h);for(let C=1;C<u;C++)h=h.add(y),p.push(h);y=h.double()}return p},wNAF(o,s,c){let{windows:u,windowSize:p}=n(o),y=r.ZERO,h=r.BASE,x=BigInt(2**o-1),C=2**o,T=BigInt(o);for(let z=0;z<u;z++){let _=z*p,I=Number(c&x);c>>=T,I>p&&(I-=C,c+=ta);let P=_,$=_+Math.abs(I)-1,N=z%2!==0,ee=I<0;I===0?h=h.add(e(N,s[P])):y=y.add(e(ee,s[$]))}return{p:y,f:h}},wNAFCached(o,s,c,u){let p=o._WINDOW_SIZE||1,y=s.get(o);return y||(y=this.precomputeWindow(o,p),p!==1&&s.set(o,u(y))),this.wNAF(p,y,c)}}}function ra(r){return Zs(r.Fp),Or(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Js(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}function Cp(r){let t=ra(r);Or(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:e,Fp:n,a:o}=t;if(e){if(!n.eql(o,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof e!="object"||typeof e.beta!="bigint"||typeof e.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}var{bytesToNumberBE:Up,hexToBytes:Bp}=Ys,nn={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(r){let{Err:t}=nn;if(r.length<2||r[0]!==2)throw new t("Invalid signature integer tag");let e=r[1],n=r.subarray(2,e+2);if(!e||n.length!==e)throw new t("Invalid signature integer: wrong length");if(n[0]&128)throw new t("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:Up(n),l:r.subarray(e+2)}},toSig(r){let{Err:t}=nn,e=typeof r=="string"?Bp(r):r;if(!(e instanceof Uint8Array))throw new Error("ui8a expected");let n=e.length;if(n<2||e[0]!=48)throw new t("Invalid signature tag");if(e[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:o,l:s}=nn._parseInt(e.subarray(2)),{d:c,l:u}=nn._parseInt(s);if(u.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:c}},hexFromSig(r){let t=y=>Number.parseInt(y[0],16)&8?"00"+y:y,e=y=>{let h=y.toString(16);return h.length&1?`0${h}`:h},n=t(e(r.s)),o=t(e(r.r)),s=n.length/2,c=o.length/2,u=e(s),p=e(c);return`30${e(c+s+4)}02${p}${o}02${u}${n}`}},sr=BigInt(0),Ot=BigInt(1),Wm=BigInt(2),nu=BigInt(3),Ym=BigInt(4);function Ip(r){let t=Cp(r),{Fp:e}=t,n=t.toBytes||((z,_,I)=>{let P=_.toAffine();return zn(Uint8Array.from([4]),e.toBytes(P.x),e.toBytes(P.y))}),o=t.fromBytes||(z=>{let _=z.subarray(1),I=e.fromBytes(_.subarray(0,e.BYTES)),P=e.fromBytes(_.subarray(e.BYTES,2*e.BYTES));return{x:I,y:P}});function s(z){let{a:_,b:I}=t,P=e.sqr(z),$=e.mul(P,z);return e.add(e.add($,e.mul(z,_)),I)}if(!e.eql(e.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function c(z){return typeof z=="bigint"&&sr<z&&z<t.n}function u(z){if(!c(z))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function p(z){let{allowedPrivateKeyLengths:_,nByteLength:I,wrapPrivateKey:P,n:$}=t;if(_&&typeof z!="bigint"){if(z instanceof Uint8Array&&(z=en(z)),typeof z!="string"||!_.includes(z.length))throw new Error("Invalid key");z=z.padStart(I*2,"0")}let N;try{N=typeof z=="bigint"?z:ir(_t("private key",z,I))}catch{throw new Error(`private key must be ${I} bytes, hex or bigint, not ${typeof z}`)}return P&&(N=tt(N,$)),u(N),N}let y=new Map;function h(z){if(!(z instanceof x))throw new Error("ProjectivePoint expected")}class x{constructor(_,I,P){if(this.px=_,this.py=I,this.pz=P,_==null||!e.isValid(_))throw new Error("x required");if(I==null||!e.isValid(I))throw new Error("y required");if(P==null||!e.isValid(P))throw new Error("z required")}static fromAffine(_){let{x:I,y:P}=_||{};if(!_||!e.isValid(I)||!e.isValid(P))throw new Error("invalid affine point");if(_ instanceof x)throw new Error("projective point not allowed");let $=N=>e.eql(N,e.ZERO);return $(I)&&$(P)?x.ZERO:new x(I,P,e.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(_){let I=e.invertBatch(_.map(P=>P.pz));return _.map((P,$)=>P.toAffine(I[$])).map(x.fromAffine)}static fromHex(_){let I=x.fromAffine(o(_t("pointHex",_)));return I.assertValidity(),I}static fromPrivateKey(_){return x.BASE.multiply(p(_))}_setWindowSize(_){this._WINDOW_SIZE=_,y.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!e.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:_,y:I}=this.toAffine();if(!e.isValid(_)||!e.isValid(I))throw new Error("bad point: x or y not FE");let P=e.sqr(I),$=s(_);if(!e.eql(P,$))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:_}=this.toAffine();if(e.isOdd)return!e.isOdd(_);throw new Error("Field doesn't support isOdd")}equals(_){h(_);let{px:I,py:P,pz:$}=this,{px:N,py:ee,pz:L}=_,j=e.eql(e.mul(I,L),e.mul(N,$)),J=e.eql(e.mul(P,L),e.mul(ee,$));return j&&J}negate(){return new x(this.px,e.neg(this.py),this.pz)}double(){let{a:_,b:I}=t,P=e.mul(I,nu),{px:$,py:N,pz:ee}=this,L=e.ZERO,j=e.ZERO,J=e.ZERO,X=e.mul($,$),Re=e.mul(N,N),Ae=e.mul(ee,ee),he=e.mul($,N);return he=e.add(he,he),J=e.mul($,ee),J=e.add(J,J),L=e.mul(_,J),j=e.mul(P,Ae),j=e.add(L,j),L=e.sub(Re,j),j=e.add(Re,j),j=e.mul(L,j),L=e.mul(he,L),J=e.mul(P,J),Ae=e.mul(_,Ae),he=e.sub(X,Ae),he=e.mul(_,he),he=e.add(he,J),J=e.add(X,X),X=e.add(J,X),X=e.add(X,Ae),X=e.mul(X,he),j=e.add(j,X),Ae=e.mul(N,ee),Ae=e.add(Ae,Ae),X=e.mul(Ae,he),L=e.sub(L,X),J=e.mul(Ae,Re),J=e.add(J,J),J=e.add(J,J),new x(L,j,J)}add(_){h(_);let{px:I,py:P,pz:$}=this,{px:N,py:ee,pz:L}=_,j=e.ZERO,J=e.ZERO,X=e.ZERO,Re=t.a,Ae=e.mul(t.b,nu),he=e.mul(I,N),He=e.mul(P,ee),$e=e.mul($,L),gt=e.add(I,P),k=e.add(N,ee);gt=e.mul(gt,k),k=e.add(he,He),gt=e.sub(gt,k),k=e.add(I,$);let K=e.add(N,L);return k=e.mul(k,K),K=e.add(he,$e),k=e.sub(k,K),K=e.add(P,$),j=e.add(ee,L),K=e.mul(K,j),j=e.add(He,$e),K=e.sub(K,j),X=e.mul(Re,k),j=e.mul(Ae,$e),X=e.add(j,X),j=e.sub(He,X),X=e.add(He,X),J=e.mul(j,X),He=e.add(he,he),He=e.add(He,he),$e=e.mul(Re,$e),k=e.mul(Ae,k),He=e.add(He,$e),$e=e.sub(he,$e),$e=e.mul(Re,$e),k=e.add(k,$e),he=e.mul(He,k),J=e.add(J,he),he=e.mul(K,k),j=e.mul(gt,j),j=e.sub(j,he),he=e.mul(gt,He),X=e.mul(K,X),X=e.add(X,he),new x(j,J,X)}subtract(_){return this.add(_.negate())}is0(){return this.equals(x.ZERO)}wNAF(_){return T.wNAFCached(this,y,_,I=>{let P=e.invertBatch(I.map($=>$.pz));return I.map(($,N)=>$.toAffine(P[N])).map(x.fromAffine)})}multiplyUnsafe(_){let I=x.ZERO;if(_===sr)return I;if(u(_),_===Ot)return this;let{endo:P}=t;if(!P)return T.unsafeLadder(this,_);let{k1neg:$,k1:N,k2neg:ee,k2:L}=P.splitScalar(_),j=I,J=I,X=this;for(;N>sr||L>sr;)N&Ot&&(j=j.add(X)),L&Ot&&(J=J.add(X)),X=X.double(),N>>=Ot,L>>=Ot;return $&&(j=j.negate()),ee&&(J=J.negate()),J=new x(e.mul(J.px,P.beta),J.py,J.pz),j.add(J)}multiply(_){u(_);let I=_,P,$,{endo:N}=t;if(N){let{k1neg:ee,k1:L,k2neg:j,k2:J}=N.splitScalar(I),{p:X,f:Re}=this.wNAF(L),{p:Ae,f:he}=this.wNAF(J);X=T.constTimeNegate(ee,X),Ae=T.constTimeNegate(j,Ae),Ae=new x(e.mul(Ae.px,N.beta),Ae.py,Ae.pz),P=X.add(Ae),$=Re.add(he)}else{let{p:ee,f:L}=this.wNAF(I);P=ee,$=L}return x.normalizeZ([P,$])[0]}multiplyAndAddUnsafe(_,I,P){let $=x.BASE,N=(L,j)=>j===sr||j===Ot||!L.equals($)?L.multiplyUnsafe(j):L.multiply(j),ee=N(this,I).add(N(_,P));return ee.is0()?void 0:ee}toAffine(_){let{px:I,py:P,pz:$}=this,N=this.is0();_==null&&(_=N?e.ONE:e.inv($));let ee=e.mul(I,_),L=e.mul(P,_),j=e.mul($,_);if(N)return{x:e.ZERO,y:e.ZERO};if(!e.eql(j,e.ONE))throw new Error("invZ was invalid");return{x:ee,y:L}}isTorsionFree(){let{h:_,isTorsionFree:I}=t;if(_===Ot)return!0;if(I)return I(x,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:_,clearCofactor:I}=t;return _===Ot?this:I?I(x,this):this.multiplyUnsafe(t.h)}toRawBytes(_=!0){return this.assertValidity(),n(x,this,_)}toHex(_=!0){return en(this.toRawBytes(_))}}x.BASE=new x(t.Gx,t.Gy,e.ONE),x.ZERO=new x(e.ZERO,e.ONE,e.ZERO);let C=t.nBitLength,T=ru(x,t.endo?Math.ceil(C/2):C);return{CURVE:t,ProjectivePoint:x,normPrivateKeyToScalar:p,weierstrassEquation:s,isWithinCurveOrder:c}}function Rp(r){let t=ra(r);return Or(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function ou(r){let t=Rp(r),{Fp:e,n}=t,o=e.BYTES+1,s=2*e.BYTES+1;function c(k){return sr<k&&k<e.ORDER}function u(k){return tt(k,n)}function p(k){return hi(k,n)}let{ProjectivePoint:y,normPrivateKeyToScalar:h,weierstrassEquation:x,isWithinCurveOrder:C}=Ip({...t,toBytes(k,K,se){let Ee=K.toAffine(),Ce=e.toBytes(Ee.x),Ve=zn;return se?Ve(Uint8Array.from([K.hasEvenY()?2:3]),Ce):Ve(Uint8Array.from([4]),Ce,e.toBytes(Ee.y))},fromBytes(k){let K=k.length,se=k[0],Ee=k.subarray(1);if(K===o&&(se===2||se===3)){let Ce=ir(Ee);if(!c(Ce))throw new Error("Point is not on curve");let Ve=x(Ce),it=e.sqrt(Ve),Oe=(it&Ot)===Ot;return(se&1)===1!==Oe&&(it=e.neg(it)),{x:Ce,y:it}}else if(K===s&&se===4){let Ce=e.fromBytes(Ee.subarray(0,e.BYTES)),Ve=e.fromBytes(Ee.subarray(e.BYTES,2*e.BYTES));return{x:Ce,y:Ve}}else throw new Error(`Point of length ${K} was invalid. Expected ${o} compressed bytes or ${s} uncompressed bytes`)}}),T=k=>en(Pr(k,t.nByteLength));function z(k){let K=n>>Ot;return k>K}function _(k){return z(k)?u(-k):k}let I=(k,K,se)=>ir(k.slice(K,se));class P{constructor(K,se,Ee){this.r=K,this.s=se,this.recovery=Ee,this.assertValidity()}static fromCompact(K){let se=t.nByteLength;return K=_t("compactSignature",K,se*2),new P(I(K,0,se),I(K,se,2*se))}static fromDER(K){let{r:se,s:Ee}=nn.toSig(_t("DER",K));return new P(se,Ee)}assertValidity(){if(!C(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!C(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(K){return new P(this.r,this.s,K)}recoverPublicKey(K){let{r:se,s:Ee,recovery:Ce}=this,Ve=J(_t("msgHash",K));if(Ce==null||![0,1,2,3].includes(Ce))throw new Error("recovery id invalid");let it=Ce===2||Ce===3?se+t.n:se;if(it>=e.ORDER)throw new Error("recovery id 2 or 3 invalid");let Oe=Ce&1?"03":"02",We=y.fromHex(Oe+T(it)),ae=p(it),Ze=u(-Ve*ae),Ar=u(Ee*ae),kt=y.BASE.multiplyAndAddUnsafe(We,Ze,Ar);if(!kt)throw new Error("point at infinify");return kt.assertValidity(),kt}hasHighS(){return z(this.s)}normalizeS(){return this.hasHighS()?new P(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return tn(this.toDERHex())}toDERHex(){return nn.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return tn(this.toCompactHex())}toCompactHex(){return T(this.r)+T(this.s)}}let $={isValidPrivateKey(k){try{return h(k),!0}catch{return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{let k=ea(t.n);return tu(t.randomBytes(k),t.n)},precompute(k=8,K=y.BASE){return K._setWindowSize(k),K.multiply(BigInt(3)),K}};function N(k,K=!0){return y.fromPrivateKey(k).toRawBytes(K)}function ee(k){let K=k instanceof Uint8Array,se=typeof k=="string",Ee=(K||se)&&k.length;return K?Ee===o||Ee===s:se?Ee===2*o||Ee===2*s:k instanceof y}function L(k,K,se=!0){if(ee(k))throw new Error("first arg must be private key");if(!ee(K))throw new Error("second arg must be public key");return y.fromHex(K).multiply(h(k)).toRawBytes(se)}let j=t.bits2int||function(k){let K=ir(k),se=k.length*8-t.nBitLength;return se>0?K>>BigInt(se):K},J=t.bits2int_modN||function(k){return u(j(k))},X=ho(t.nBitLength);function Re(k){if(typeof k!="bigint")throw new Error("bigint expected");if(!(sr<=k&&k<X))throw new Error(`bigint expected < 2^${t.nBitLength}`);return Pr(k,t.nByteLength)}function Ae(k,K,se=he){if(["recovered","canonical"].some(Et=>Et in se))throw new Error("sign() legacy options not supported");let{hash:Ee,randomBytes:Ce}=t,{lowS:Ve,prehash:it,extraEntropy:Oe}=se;Ve==null&&(Ve=!0),k=_t("msgHash",k),it&&(k=_t("prehashed msgHash",Ee(k)));let We=J(k),ae=h(K),Ze=[Re(ae),Re(We)];if(Oe!=null){let Et=Oe===!0?Ce(e.BYTES):Oe;Ze.push(_t("extraEntropy",Et))}let Ar=zn(...Ze),kt=We;function br(Et){let Zt=j(Et);if(!C(Zt))return;let Gr=p(Zt),bt=y.BASE.multiply(Zt).toAffine(),wr=u(bt.x);if(wr===sr)return;let In=u(Gr*u(kt+wr*ae));if(In===sr)return;let Fo=(bt.x===wr?0:2)|Number(bt.y&Ot),Jn=In;return Ve&&z(In)&&(Jn=_(In),Fo^=1),new P(wr,Jn,Fo)}return{seed:Ar,k2sig:br}}let he={lowS:t.lowS,prehash:!1},He={lowS:t.lowS,prehash:!1};function $e(k,K,se=he){let{seed:Ee,k2sig:Ce}=Ae(k,K,se),Ve=t;return Ws(Ve.hash.outputLen,Ve.nByteLength,Ve.hmac)(Ee,Ce)}y.BASE._setWindowSize(8);function gt(k,K,se,Ee=He){let Ce=k;if(K=_t("msgHash",K),se=_t("publicKey",se),"strict"in Ee)throw new Error("options.strict was renamed to lowS");let{lowS:Ve,prehash:it}=Ee,Oe,We;try{if(typeof Ce=="string"||Ce instanceof Uint8Array)try{Oe=P.fromDER(Ce)}catch(bt){if(!(bt instanceof nn.Err))throw bt;Oe=P.fromCompact(Ce)}else if(typeof Ce=="object"&&typeof Ce.r=="bigint"&&typeof Ce.s=="bigint"){let{r:bt,s:wr}=Ce;Oe=new P(bt,wr)}else throw new Error("PARSE");We=y.fromHex(se)}catch(bt){if(bt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Ve&&Oe.hasHighS())return!1;it&&(K=t.hash(K));let{r:ae,s:Ze}=Oe,Ar=J(K),kt=p(Ze),br=u(Ar*kt),Et=u(ae*kt),Zt=y.BASE.multiplyAndAddUnsafe(We,br,Et)?.toAffine();return Zt?u(Zt.x)===ae:!1}return{CURVE:t,getPublicKey:N,getSharedSecret:L,sign:$e,verify:gt,ProjectivePoint:y,Signature:P,utils:$}}function Pp(r){return{hash:r,hmac:(t,...e)=>Qt(r,t,$r(...e)),randomBytes:Ec}}function iu(r,t){let e=n=>ou({...r,...Pp(n)});return Object.freeze({...e(t),create:e})}var cu=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),su=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Op=BigInt(1),na=BigInt(2),au=(r,t)=>(r+t/na)/t;function kp(r){let t=cu,e=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),c=BigInt(23),u=BigInt(44),p=BigInt(88),y=r*r*r%t,h=y*y*r%t,x=vt(h,e,t)*h%t,C=vt(x,e,t)*h%t,T=vt(C,na,t)*y%t,z=vt(T,o,t)*T%t,_=vt(z,s,t)*z%t,I=vt(_,u,t)*_%t,P=vt(I,p,t)*I%t,$=vt(P,u,t)*_%t,N=vt($,e,t)*h%t,ee=vt(N,c,t)*z%t,L=vt(ee,n,t)*y%t,j=vt(L,na,t);if(!oa.eql(oa.sqr(j),r))throw new Error("Cannot find square root");return j}var oa=Jc(cu,void 0,void 0,{sqrt:kp}),dt=iu({a:BigInt(0),b:BigInt(7),Fp:oa,n:su,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let t=su,e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Op*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=e,c=BigInt("0x100000000000000000000000000000000"),u=au(s*r,t),p=au(-n*r,t),y=tt(r-u*e-p*o,t),h=tt(-u*n-p*s,t),x=y>c,C=h>c;if(x&&(y=t-y),C&&(h=t-h),y>c||h>c)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:x,k1:y,k2neg:C,k2:h}}}},po),i0=BigInt(0);var s0=dt.ProjectivePoint;var Np=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),fu=Uint8Array.from({length:16},(r,t)=>t),zp=fu.map(r=>(9*r+5)%16),sa=[fu],aa=[zp];for(let r=0;r<4;r++)for(let t of[sa,aa])t.push(t[r].map(e=>Np[e]));var du=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),Mp=sa.map((r,t)=>r.map(e=>du[t][e])),Dp=aa.map((r,t)=>r.map(e=>du[t][e])),Gp=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),qp=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),mi=(r,t)=>r<<t|r>>>32-t;function uu(r,t,e,n){return r===0?t^e^n:r===1?t&e|~t&n:r===2?(t|~e)^n:r===3?t&n|e&~n:t^(e|~n)}var xi=new Uint32Array(16),ia=class extends Cr{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:e,h2:n,h3:o,h4:s}=this;return[t,e,n,o,s]}set(t,e,n,o,s){this.h0=t|0,this.h1=e|0,this.h2=n|0,this.h3=o|0,this.h4=s|0}process(t,e){for(let T=0;T<16;T++,e+=4)xi[T]=t.getUint32(e,!0);let n=this.h0|0,o=n,s=this.h1|0,c=s,u=this.h2|0,p=u,y=this.h3|0,h=y,x=this.h4|0,C=x;for(let T=0;T<5;T++){let z=4-T,_=Gp[T],I=qp[T],P=sa[T],$=aa[T],N=Mp[T],ee=Dp[T];for(let L=0;L<16;L++){let j=mi(n+uu(T,s,u,y)+xi[P[L]]+_,N[L])+x|0;n=x,x=y,y=mi(u,10)|0,u=s,s=j}for(let L=0;L<16;L++){let j=mi(o+uu(z,c,p,h)+xi[$[L]]+I,ee[L])+C|0;o=C,C=h,h=mi(p,10)|0,p=c,c=j}}this.set(this.h1+u+h|0,this.h2+y+C|0,this.h3+x+o|0,this.h4+n+c|0,this.h0+s+p|0)}roundClean(){xi.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}},lu=_r(()=>new ia);var Ai=dt.ProjectivePoint,ca=Fc(po);function pu(r){return BigInt(`0x${Hr(r)}`)}function Lp(r){return Nn(r.toString(16).padStart(64,"0"))}var Fp=Ps("Bitcoin seed"),ua={private:76066276,public:76067358},fa=2147483648,Kp=r=>lu(po(r)),Hp=r=>Vt(r).getUint32(0,!1),bi=r=>{if(!Number.isSafeInteger(r)||r<0||r>2**32-1)throw new Error(`Invalid number=${r}. Should be from 0 to 2 ** 32 - 1`);let t=new Uint8Array(4);return Vt(t).setUint32(0,r,!1),t},wi=class r{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return Hp(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){let t=this.privateKey;if(!t)throw new Error("No private key");return ca.encode(this.serialize(this.versions.private,$r(new Uint8Array([0]),t)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return ca.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(t,e=ua){if(Dt(t),8*t.length<128||8*t.length>512)throw new Error(`HDKey: wrong seed length=${t.length}. Should be between 128 and 512 bits; 256 bits is advised)`);let n=Qt(Yr,Fp,t);return new r({versions:e,chainCode:n.slice(32),privateKey:n.slice(0,32)})}static fromExtendedKey(t,e=ua){let n=ca.decode(t),o=Vt(n),s=o.getUint32(0,!1),c={versions:e,depth:n[4],parentFingerprint:o.getUint32(5,!1),index:o.getUint32(9,!1),chainCode:n.slice(13,45)},u=n.slice(45),p=u[0]===0;if(s!==e[p?"private":"public"])throw new Error("Version mismatch");return p?new r({...c,privateKey:u.slice(1)}):new r({...c,publicKey:u})}static fromJSON(t){return r.fromExtendedKey(t.xpriv)}constructor(t){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!t||typeof t!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=t.versions||ua,this.depth=t.depth||0,this.chainCode=t.chainCode,this.index=t.index||0,this.parentFingerprint=t.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(t.publicKey&&t.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(t.privateKey){if(!dt.utils.isValidPrivateKey(t.privateKey))throw new Error("Invalid private key");this.privKey=typeof t.privateKey=="bigint"?t.privateKey:pu(t.privateKey),this.privKeyBytes=Lp(this.privKey),this.pubKey=dt.getPublicKey(t.privateKey,!0)}else if(t.publicKey)this.pubKey=Ai.fromHex(t.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=Kp(this.pubKey)}derive(t){if(!/^[mM]'?/.test(t))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(t))return this;let e=t.replace(/^[mM]'?\//,"").split("/"),n=this;for(let o of e){let s=/^(\d+)('?)$/.exec(o),c=s&&s[1];if(!s||s.length!==3||typeof c!="string")throw new Error(`Invalid child index: ${o}`);let u=+c;if(!Number.isSafeInteger(u)||u>=fa)throw new Error("Invalid index");s[2]==="'"&&(u+=fa),n=n.deriveChild(u)}return n}deriveChild(t){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let e=bi(t);if(t>=fa){let u=this.privateKey;if(!u)throw new Error("Could not derive hardened child key");e=$r(new Uint8Array([0]),u,e)}else e=$r(this.pubKey,e);let n=Qt(Yr,this.chainCode,e),o=pu(n.slice(0,32)),s=n.slice(32);if(!dt.utils.isValidPrivateKey(o))throw new Error("Tweak bigger than curve order");let c={versions:this.versions,chainCode:s,depth:this.depth+1,parentFingerprint:this.fingerprint,index:t};try{if(this.privateKey){let u=tt(this.privKey+o,dt.CURVE.n);if(!dt.utils.isValidPrivateKey(u))throw new Error("The tweak was out of range or the resulted private key is invalid");c.privateKey=u}else{let u=Ai.fromHex(this.pubKey).add(Ai.fromPrivateKey(o));if(u.equals(Ai.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");c.publicKey=u.toRawBytes(!0)}return new r(c)}catch{return this.deriveChild(t+1)}}sign(t){if(!this.privateKey)throw new Error("No privateKey set!");return Dt(t,32),dt.sign(t,this.privKey).toCompactRawBytes()}verify(t,e){if(Dt(t,32),Dt(e,64),!this.publicKey)throw new Error("No publicKey set!");let n;try{n=dt.Signature.fromCompact(e)}catch{return!1}return dt.verify(n,t,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(t,e){if(!this.chainCode)throw new Error("No chainCode set");return Dt(e,33),$r(bi(t),new Uint8Array([this.depth]),bi(this.parentFingerprint),bi(this.index),this.chainCode,e)}};var on=class on extends Tt{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==on.LENGTH)throw new Error(`PublicKey length should be ${on.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}verifySignature(e){let{message:n,signature:o}=e,s=me.fromHexInput(n).toUint8Array(),c=jr(s),u=o.toUint8Array();return dt.verify(u,c,this.toUint8Array())}serialize(e){e.serializeBytes(this.key.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new on(n)}static load(e){let n=e.deserializeBytes();return new on(n)}};on.LENGTH=65;var Lt=on,ar=class ar extends Wr{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==ar.LENGTH)throw new Error(`PrivateKey length should be ${ar.LENGTH}`);this.key=n}toUint8Array(){return this.key.toUint8Array()}toString(){return this.key.toString()}sign(e){let n=me.fromHexInput(e),o=jr(n.toUint8Array()),s=dt.sign(o,this.key.toUint8Array());return new ur(s.toCompactRawBytes())}serialize(e){e.serializeBytes(this.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new ar(n)}static generate(){let e=dt.utils.randomPrivateKey();return new ar(e)}publicKey(){let e=dt.getPublicKey(this.key.toUint8Array(),!1);return new Lt(e)}static fromDerivationPath(e,n){if(!Ks(e))throw new Error(`Invalid derivation path ${e}`);return ar.fromDerivationPathInner(e,go(n))}static fromDerivationPathInner(e,n){let{privateKey:o}=wi.fromMasterSeed(n).derive(e);if(o===null)throw new Error("Invalid key");return new ar(o)}};ar.LENGTH=32;var cr=ar,sn=class sn extends Gt{constructor(e){super();let n=me.fromHexInput(e);if(n.toUint8Array().length!==sn.LENGTH)throw new Error(`Signature length should be ${sn.LENGTH}, recieved ${n.toUint8Array().length}`);this.data=n}toUint8Array(){return this.data.toUint8Array()}toString(){return this.data.toString()}serialize(e){e.serializeBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeBytes();return new sn(n)}static load(e){let n=e.deserializeBytes();return new sn(n)}};sn.LENGTH=64;var ur=sn;var je=class r extends Tt{constructor(e){super();this.publicKey=e}toUint8Array(){return this.publicKey.toUint8Array()}toString(){return this.publicKey.toString()}verifySignature(e){let{message:n,signature:o}=e;return this.publicKey.verifySignature({message:n,signature:o})}serialize(e){if(this.publicKey instanceof Pe)e.serializeU32AsUleb128(0),this.publicKey.serialize(e);else if(this.publicKey instanceof Lt)e.serializeU32AsUleb128(1),this.publicKey.serialize(e);else throw new Error("Unknown public key type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new r(Pe.load(e));case 1:return new r(Lt.load(e));default:throw new Error(`Unknown variant index for AnyPublicKey: ${n}`)}}};var an=class r extends Tt{constructor(e){super();let{publicKeys:n,signaturesRequired:o}=e;if(o<1)throw new Error("The number of required signatures needs to be greater then 0");if(n.length<o)throw new Error(`Provided ${n.length} public keys is smaller than the ${o} required signatures`);let s=[];n.forEach(c=>{c instanceof je?s.push(c):s.push(new je(c))}),this.publicKeys=s,this.signaturesRequired=o}toUint8Array(){return this.bcsToBytes()}createBitmap(e){let{bits:n}=e,o=128,s=new Uint8Array([0,0,0,0]),c=new Set;return n.forEach((u,p)=>{if(p+1>this.publicKeys.length)throw new Error(`Signature index ${p+1} is out of public keys range, ${this.publicKeys.length}.`);if(c.has(u))throw new Error(`Duplicate bit ${u} detected.`);c.add(u);let y=Math.floor(u/8),h=s[y];h|=o>>u%8,s[y]=h}),s}toString(){return me.fromHexInput(this.toUint8Array()).toString()}verifySignature(e){throw new Error("not implemented")}serialize(e){e.serializeVector(this.publicKeys),e.serializeU8(this.signaturesRequired)}static deserialize(e){let n=e.deserializeVector(je),o=e.deserializeU8();return new r({publicKeys:n,signaturesRequired:o})}};var fr=class fr extends Z{constructor(e){super();let{data:n}=e,o=me.fromHexInput(n);if(o.toUint8Array().length!==fr.LENGTH)throw new Error(`Authentication Key length should be ${fr.LENGTH}`);this.data=o}serialize(e){e.serializeFixedBytes(this.data.toUint8Array())}static deserialize(e){let n=e.deserializeFixedBytes(fr.LENGTH);return new fr({data:n})}toString(){return this.data.toString()}toUint8Array(){return this.data.toUint8Array()}static fromPublicKeyAndScheme(e){let{publicKey:n,scheme:o}=e,s;switch(o){case 3:case 2:{let p=n.bcsToBytes();s=new Uint8Array([...p,o]);break}case 0:case 1:{let p=n.toUint8Array(),y=me.fromHexInput(p).toUint8Array();s=new Uint8Array([...y,o]);break}default:throw new Error(`Scheme ${o} is not supported`)}let c=jr.create();c.update(s);let u=c.digest();return new fr({data:u})}static fromPublicKey(e){let{publicKey:n}=e,o;if(n instanceof Pe)o=0 .valueOf();else if(n instanceof qt)o=1 .valueOf();else if(n instanceof je)o=2 .valueOf();else if(n instanceof an)o=3 .valueOf();else throw new Error("No supported authentication scheme for public key");return fr.fromPublicKeyAndScheme({publicKey:n,scheme:o})}derivedAddress(){return new O(this.data.toUint8Array())}};fr.LENGTH=32;var Ft=fr;var dr=class r{constructor(t){let{privateKey:e,address:n,legacy:o}=t,s=o??!0;if(this.publicKey=e.publicKey(),this.publicKey instanceof Pe)s?this.signingScheme=0:(this.publicKey=new je(this.publicKey),this.signingScheme=2);else if(this.publicKey instanceof qt)this.signingScheme=1;else if(this.publicKey instanceof Lt)this.publicKey=new je(this.publicKey),this.signingScheme=2;else throw new Error("Can not create new Account, unsupported public key type");this.privateKey=e,this.accountAddress=n}static generate(t){let e=t?.legacy??!0,n,o;switch(t?.scheme){case 2:n=cr.generate(),o=new je(n.publicKey());break;default:n=or.generate(),e===!1?o=new je(n.publicKey()):o=n.publicKey()}let c=Ft.fromPublicKey({publicKey:o}).derivedAddress();return new r({privateKey:n,address:c,legacy:t?.legacy})}static fromPrivateKey(t){let{privateKey:e,legacy:n}=t,o=n??!0,s;if(e instanceof cr)s=new je(e.publicKey());else if(e instanceof or)o?s=e.publicKey():s=new je(e.publicKey());else throw new Error(`Unsupported private key ${e}`);let u=Ft.fromPublicKey({publicKey:s}).derivedAddress();return new r({privateKey:e,address:u,legacy:o})}static fromPrivateKeyAndAddress(t){let{privateKey:e,address:n,legacy:o}=t;return new r({privateKey:e,address:n,legacy:o})}static fromDerivationPath(t){let{path:e,mnemonic:n,scheme:o,legacy:s}=t,c;switch(o){case 2:c=cr.fromDerivationPath(e,n);break;case 0:c=or.fromDerivationPath(e,n);break;default:throw new Error(`Unsupported scheme ${o}`)}return r.fromPrivateKey({privateKey:c,legacy:s})}static authKey(t){let{publicKey:e}=t;return Ft.fromPublicKey({publicKey:e})}sign(t){return this.privateKey.sign(t)}verifySignature(t){let{message:e,signature:n}=t,o=me.fromHexInput(e).toUint8Array();return this.publicKey.verifySignature({message:o,signature:n})}};var $p=`
3
3
  fragment TokenActivitiesFields on token_activities_v2 {
4
4
  after_value
5
5
  before_value
@@ -17,7 +17,17 @@
17
17
  transaction_version
18
18
  type
19
19
  }
20
- `,li=`
20
+ `,Vp=`
21
+ fragment AnsTokenFragment on current_aptos_names {
22
+ domain
23
+ expiration_timestamp
24
+ registered_address
25
+ subdomain
26
+ token_standard
27
+ is_primary
28
+ owner_address
29
+ }
30
+ `,Ti=`
21
31
  fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
22
32
  token_standard
23
33
  token_properties_mutated_v1
@@ -63,7 +73,7 @@
63
73
  }
64
74
  }
65
75
  }
66
- `,ud=`
76
+ `,gu=`
67
77
  query getAccountCoinsCount($address: String) {
68
78
  current_fungible_asset_balances_aggregate(
69
79
  where: {owner_address: {_eq: $address}}
@@ -73,7 +83,7 @@
73
83
  }
74
84
  }
75
85
  }
76
- `,fd=`
86
+ `,yu=`
77
87
  query getAccountCoinsData($where_condition: current_fungible_asset_balances_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_fungible_asset_balances_order_by!]) {
78
88
  current_fungible_asset_balances(
79
89
  where: $where_condition
@@ -106,7 +116,7 @@
106
116
  }
107
117
  }
108
118
  }
109
- `,dd=`
119
+ `,hu=`
110
120
  query getAccountCollectionsWithOwnedTokens($where_condition: current_collection_ownership_v2_view_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_collection_ownership_v2_view_order_by!]) {
111
121
  current_collection_ownership_v2_view(
112
122
  where: $where_condition
@@ -140,7 +150,7 @@
140
150
  single_token_uri
141
151
  }
142
152
  }
143
- `,ld=`
153
+ `,mu=`
144
154
  query getAccountOwnedObjects($where_condition: current_objects_bool_exp, $offset: Int, $limit: Int, $order_by: [current_objects_order_by!]) {
145
155
  current_objects(
146
156
  where: $where_condition
@@ -157,7 +167,7 @@
157
167
  is_deleted
158
168
  }
159
169
  }
160
- `,pd=`
170
+ `,xu=`
161
171
  query getAccountOwnedTokens($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
162
172
  current_token_ownerships_v2(
163
173
  where: $where_condition
@@ -168,7 +178,7 @@
168
178
  ...CurrentTokenOwnershipFields
169
179
  }
170
180
  }
171
- ${li}`,rw=`
181
+ ${Ti}`,ax=`
172
182
  query getAccountOwnedTokensByTokenData($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
173
183
  current_token_ownerships_v2(
174
184
  where: $where_condition
@@ -179,7 +189,7 @@
179
189
  ...CurrentTokenOwnershipFields
180
190
  }
181
191
  }
182
- ${li}`,hd=`
192
+ ${Ti}`,Au=`
183
193
  query getAccountOwnedTokensFromCollection($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
184
194
  current_token_ownerships_v2(
185
195
  where: $where_condition
@@ -190,7 +200,7 @@
190
200
  ...CurrentTokenOwnershipFields
191
201
  }
192
202
  }
193
- ${li}`,gd=`
203
+ ${Ti}`,bu=`
194
204
  query getAccountTokensCount($where_condition: current_token_ownerships_v2_bool_exp, $offset: Int, $limit: Int) {
195
205
  current_token_ownerships_v2_aggregate(
196
206
  where: $where_condition
@@ -202,7 +212,7 @@
202
212
  }
203
213
  }
204
214
  }
205
- `,yd=`
215
+ `,wu=`
206
216
  query getAccountTransactionsCount($address: String) {
207
217
  account_transactions_aggregate(where: {account_address: {_eq: $address}}) {
208
218
  aggregate {
@@ -210,13 +220,13 @@
210
220
  }
211
221
  }
212
222
  }
213
- `,md=`
223
+ `,Tu=`
214
224
  query getChainTopUserTransactions($limit: Int) {
215
225
  user_transactions(limit: $limit, order_by: {version: desc}) {
216
226
  version
217
227
  }
218
228
  }
219
- `,xd=`
229
+ `,_u=`
220
230
  query getCollectionData($where_condition: current_collections_v2_bool_exp!) {
221
231
  current_collections_v2(where: $where_condition) {
222
232
  collection_id
@@ -235,7 +245,7 @@
235
245
  uri
236
246
  }
237
247
  }
238
- `,bd=`
248
+ `,vu=`
239
249
  query getCurrentFungibleAssetBalances($where_condition: current_fungible_asset_balances_bool_exp, $offset: Int, $limit: Int) {
240
250
  current_fungible_asset_balances(
241
251
  where: $where_condition
@@ -253,7 +263,7 @@
253
263
  token_standard
254
264
  }
255
265
  }
256
- `,Ad=`
266
+ `,Su=`
257
267
  query getDelegatedStakingActivities($delegatorAddress: String, $poolAddress: String) {
258
268
  delegated_staking_activities(
259
269
  where: {delegator_address: {_eq: $delegatorAddress}, pool_address: {_eq: $poolAddress}}
@@ -266,7 +276,7 @@
266
276
  transaction_version
267
277
  }
268
278
  }
269
- `,wd=`
279
+ `,Eu=`
270
280
  query getEvents($where_condition: events_bool_exp, $offset: Int, $limit: Int, $order_by: [events_order_by!]) {
271
281
  events(
272
282
  where: $where_condition
@@ -285,7 +295,7 @@
285
295
  indexed_type
286
296
  }
287
297
  }
288
- `,Td=`
298
+ `,Cu=`
289
299
  query getFungibleAssetActivities($where_condition: fungible_asset_activities_bool_exp, $offset: Int, $limit: Int) {
290
300
  fungible_asset_activities(
291
301
  where: $where_condition
@@ -310,7 +320,7 @@
310
320
  type
311
321
  }
312
322
  }
313
- `,_d=`
323
+ `,Uu=`
314
324
  query getFungibleAssetMetadata($where_condition: fungible_asset_metadata_bool_exp, $offset: Int, $limit: Int) {
315
325
  fungible_asset_metadata(where: $where_condition, offset: $offset, limit: $limit) {
316
326
  icon_uri
@@ -327,14 +337,25 @@
327
337
  token_standard
328
338
  }
329
339
  }
330
- `,uc=`
340
+ `,Mn=`
341
+ query getNames($offset: Int, $limit: Int, $where_condition: current_aptos_names_bool_exp, $order_by: [current_aptos_names_order_by!]) {
342
+ current_aptos_names(
343
+ limit: $limit
344
+ where: $where_condition
345
+ order_by: $order_by
346
+ offset: $offset
347
+ ) {
348
+ ...AnsTokenFragment
349
+ }
350
+ }
351
+ ${Vp}`,da=`
331
352
  query getNumberOfDelegators($where_condition: num_active_delegator_per_pool_bool_exp!, $order_by: [num_active_delegator_per_pool_order_by!]) {
332
353
  num_active_delegator_per_pool(where: $where_condition, order_by: $order_by) {
333
354
  num_active_delegator
334
355
  pool_address
335
356
  }
336
357
  }
337
- `,vd=`
358
+ `,Bu=`
338
359
  query getProcessorStatus {
339
360
  processor_status {
340
361
  last_success_version
@@ -342,7 +363,7 @@
342
363
  last_updated
343
364
  }
344
365
  }
345
- `,Ed=`
366
+ `,Iu=`
346
367
  query getTokenActivity($where_condition: token_activities_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [token_activities_v2_order_by!]) {
347
368
  token_activities_v2(
348
369
  where: $where_condition
@@ -353,7 +374,7 @@
353
374
  ...TokenActivitiesFields
354
375
  }
355
376
  }
356
- ${ly}`,fc=`
377
+ ${$p}`,la=`
357
378
  query getCurrentTokenOwnership($where_condition: current_token_ownerships_v2_bool_exp!, $offset: Int, $limit: Int, $order_by: [current_token_ownerships_v2_order_by!]) {
358
379
  current_token_ownerships_v2(
359
380
  where: $where_condition
@@ -364,7 +385,7 @@
364
385
  ...CurrentTokenOwnershipFields
365
386
  }
366
387
  }
367
- ${li}`,Sd=`
388
+ ${Ti}`,Ru=`
368
389
  query getTokenData($where_condition: current_token_datas_v2_bool_exp, $offset: Int, $limit: Int, $order_by: [current_token_datas_v2_order_by!]) {
369
390
  current_token_datas_v2(
370
391
  where: $where_condition
@@ -403,10 +424,34 @@
403
424
  }
404
425
  }
405
426
  }
406
- `;async function pi(r){let{aptosConfig:t}=r,{data:e}=await bt({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function Ud(r){let{aptosConfig:t,ledgerVersion:e,options:n}=r,{data:o}=await bt({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function Bd(r){let{aptosConfig:t,blockHeight:e,options:n}=r,{data:o}=await bt({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function hi(r){let{aptosConfig:t,handle:e,data:n,options:o}=r;return(await zn({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:o?.ledgerVersion},body:n})).data}async function gi(r){let{aptosConfig:t,payload:e,options:n}=r,{data:o}=await zn({aptosConfig:t,originMethod:"view",path:"view",params:{ledger_version:n?.ledgerVersion},body:{function:e.function,type_arguments:e.typeArguments??[],arguments:e.functionArguments??[]}});return o}async function Cd(r){let{aptosConfig:t,limit:e}=r;return(await Ne({aptosConfig:t,query:{query:md,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function Ne(r){let{aptosConfig:t,query:e,originMethod:n}=r,{data:o}=await da({aptosConfig:t,originMethod:n??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return o}async function py(r){let{aptosConfig:t}=r;return(await Ne({aptosConfig:t,query:{query:vd},originMethod:"getProcessorStatuses"})).processor_status}async function yi(r){return(await py({aptosConfig:r.aptosConfig}))[0].last_success_version}var dc=new Map;function bo(r,t,e){return async(...n)=>{if(dc.has(t)){let{value:s,timestamp:a}=dc.get(t);if(e===void 0||Date.now()-a<=e)return s}let o=await r(...n);return dc.set(t,{value:o,timestamp:Date.now()}),o}}async function Wn(r){let{aptosConfig:t,accountAddress:e}=r,{data:n}=await bt({aptosConfig:t,originMethod:"getInfo",path:`accounts/${O.from(e).toString()}`});return n}async function Pd(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getModules",path:`accounts/${O.from(e).toString()}/modules`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??1e3}})}async function mi(r){return r.options?.ledgerVersion!==void 0?Id(r):bo(async()=>Id(r),`module-${r.accountAddress}-${r.moduleName}`,1e3*60*5)()}async function Id(r){let{aptosConfig:t,accountAddress:e,moduleName:n,options:o}=r,{data:s}=await bt({aptosConfig:t,originMethod:"getModule",path:`accounts/${O.from(e).toString()}/module/${n}`,params:{ledger_version:o?.ledgerVersion}});return s}async function kd(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getTransactions",path:`accounts/${O.from(e).toString()}/transactions`,params:{start:n?.offset,limit:n?.limit}})}async function Od(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return On({aptosConfig:t,originMethod:"getResources",path:`accounts/${O.from(e).toString()}/resources`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??999}})}async function lc(r){let{aptosConfig:t,accountAddress:e,resourceType:n,options:o}=r,{data:s}=await bt({aptosConfig:t,originMethod:"getResource",path:`accounts/${O.from(e).toString()}/resource/${n}`,params:{ledger_version:o?.ledgerVersion}});return s.data}async function pc(r){let{aptosConfig:t,authenticationKey:e,options:n}=r,o=await lc({aptosConfig:t,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:n}),{address_map:{handle:s}}=o,a=O.from(e);try{let c=await hi({aptosConfig:t,handle:s,data:{key:a.toString(),key_type:"address",value_type:"address"},options:n});return O.from(c)}catch(c){if(c instanceof cr&&c.data.error_code==="table_item_not_found")return a;throw c}}async function zd(r){let{aptosConfig:t,accountAddress:e}=r,o={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}},a=await Ne({aptosConfig:t,query:{query:gd,variables:{where_condition:o}},originMethod:"getAccountTokensCount"});if(!a.current_token_ownerships_v2_aggregate.aggregate)throw Error("Failed to get the count of account tokens");return a.current_token_ownerships_v2_aggregate.aggregate.count}async function Nd(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.token_standard={_eq:n?.tokenStandard});let a={query:pd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function Dd(r){let{aptosConfig:t,accountAddress:e,collectionAddress:n,options:o}=r,s=O.from(e).toStringLong(),a=O.from(n).toStringLong(),c={owner_address:{_eq:s},current_token_data:{collection_id:{_eq:a}},amount:{_gt:0}};o?.tokenStandard&&(c.token_standard={_eq:o?.tokenStandard});let f={query:hd,variables:{where_condition:c,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await Ne({aptosConfig:t,query:f,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Md(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.current_collection={token_standard:{_eq:n?.tokenStandard}});let a={query:dd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function qd(r){let{aptosConfig:t,accountAddress:e}=r,n=O.from(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:yd,variables:{address:n}},originMethod:"getAccountTransactionsCount"});if(!s.account_transactions_aggregate.aggregate)throw Error("Failed to get the count of account transactions");return s.account_transactions_aggregate.aggregate.count}async function Ld(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()}},a={query:fd,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Hd(r){let{aptosConfig:t,accountAddress:e}=r,n=O.from(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:ud,variables:{address:n}},originMethod:"getAccountCoinsCount"});if(!s.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return s.current_fungible_asset_balances_aggregate.aggregate.count}async function Gd(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()}},a={query:ld,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:a,originMethod:"getAccountOwnedObjects"})).current_objects}async function Fd(r){let{aptosConfig:t,privateKey:e}=r,n=new Fe(e.publicKey());if(e instanceof mr){let s=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:2}).derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:s})}if(e instanceof Zt){let o=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:2});if(await Rd({authKey:o,aptosConfig:t})){let f=o.derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:f,legacy:!1})}let a=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:0});if(await Rd({authKey:a,aptosConfig:t})){let f=a.derivedAddress();return St.fromPrivateKeyAndAddress({privateKey:e,address:f,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function Rd(r){let{aptosConfig:t,authKey:e}=r,n=await pc({aptosConfig:t,authenticationKey:e.derivedAddress()});try{return await Wn({aptosConfig:t,accountAddress:n}),!0}catch(o){if(o.status===404)return!1;throw new Error(`Error while looking for an account info ${n.toString()}`)}}var Zo=class{constructor(t){this.config=t}async getAccountInfo(t){return Wn({aptosConfig:this.config,...t})}async getAccountModules(t){return Pd({aptosConfig:this.config,...t})}async getAccountModule(t){return mi({aptosConfig:this.config,...t})}async getAccountTransactions(t){return kd({aptosConfig:this.config,...t})}async getAccountResources(t){return Od({aptosConfig:this.config,...t})}async getAccountResource(t){return lc({aptosConfig:this.config,...t})}async lookupOriginalAccountAddress(t){return pc({aptosConfig:this.config,...t})}async getAccountTokensCount(t){return zd({aptosConfig:this.config,...t})}async getAccountOwnedTokens(t){return Nd({aptosConfig:this.config,...t})}async getAccountOwnedTokensFromCollectionAddress(t){return Dd({aptosConfig:this.config,...t})}async getAccountCollectionsWithOwnedTokens(t){return Md({aptosConfig:this.config,...t})}async getAccountTransactionsCount(t){return qd({aptosConfig:this.config,...t})}async getAccountCoinsData(t){return Ld({aptosConfig:this.config,...t})}async getAccountCoinsCount(t){return Hd({aptosConfig:this.config,...t})}async getAccountOwnedObjects(t){return Gd({aptosConfig:this.config,...t})}async deriveAccountFromPrivateKey(t){return Fd({aptosConfig:this.config,...t})}};var sp=Zi(op(),1);async function ip(r){var t;let{params:e,method:n,url:o,headers:s,body:a,overrides:c}=r,f={headers:s,method:n,url:o,params:e,data:a,withCredentials:(t=c?.WITH_CREDENTIALS)!=null?t:!0};try{let h=await(0,sp.default)(f);return{status:h.status,statusText:h.statusText,data:h.data,headers:h.headers,config:h.config}}catch(h){let g=h;if(g.response)return g.response;throw h}}var ts=class{constructor(t){this.network=t?.network??bu,this.fullnode=t?.fullnode,this.faucet=t?.faucet,this.indexer=t?.indexer,this.client=t?.client??{provider:ip},this.clientConfig=t?.clientConfig??{}}getRequestUrl(t){switch(t){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return ca[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return ua[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return Ss[this.network];default:throw Error(`apiType ${t} is not supported`)}}isIndexerRequest(t){return Ss[this.network]===t}};var rs=class extends te{constructor(e){super();this.accountAddress=O.ONE;this.moduleName=new Ge("account");this.structName=new Ge("RotationProofChallenge");this.sequenceNumber=new He(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=ve.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};var $t=class extends Qt{constructor(e){super();this.signature=e}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(e){if(this.signature instanceof je)e.serializeU32AsUleb128(0),this.signature.serialize(e);else if(this.signature instanceof xr)e.serializeU32AsUleb128(1),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new $t(je.load(e));case 1:return new $t(xr.load(e));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};async function Nc(r){return new Promise(t=>{setTimeout(t,r)})}async function ap(r){let{aptosConfig:t,options:e}=r;return On({aptosConfig:t,originMethod:"getTransactions",path:"transactions",params:{start:e?.offset,limit:e?.limit}})}async function Si(r){let{aptosConfig:t}=r;return bo(async()=>{let{data:e}=await bt({aptosConfig:t,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return e},`gas-price-${t.network}`,1e3*60*5)()}async function cp(r){let{aptosConfig:t,ledgerVersion:e}=r,{data:n}=await bt({aptosConfig:t,originMethod:"getTransactionByVersion",path:`transactions/by_version/${e}`});return n}async function Ui(r){let{aptosConfig:t,transactionHash:e}=r,{data:n}=await bt({aptosConfig:t,path:`transactions/by_hash/${e}`,originMethod:"getTransactionByHash"});return n}async function up(r){let{aptosConfig:t,transactionHash:e}=r;try{return(await Ui({aptosConfig:t,transactionHash:e})).type==="pending_transaction"}catch(n){if(n?.status===404)return!0;throw n}}async function Bi(r){let{aptosConfig:t,transactionHash:e,options:n}=r,o=n?.timeoutSecs??Bs,s=n?.checkSuccess??!0,a=n?.indexerVersionCheck??!0,c=!0,f=0,h,g,y=200,w=1.5;for(;c&&!(f>=o);){try{if(h=await Ui({aptosConfig:t,transactionHash:e}),c=h.type==="pending_transaction",!c)break}catch(b){if(!(b instanceof cr)||(g=b,b.status!==404&&b.status>=400&&b.status<500))throw b}await Nc(y),f+=y/1e3,y*=w}if(h===void 0)throw g||new ns(`Fetching transaction ${e} failed and timed out after ${o} seconds`,h);if(h.type==="pending_transaction")throw new ns(`Transaction ${e} timed out in pending state after ${o} seconds`,h);if(!s)return h;if(!h.success)throw new Dc(`Transaction ${e} failed with an error: ${h.vm_status}`,h);if(a)try{await ym({aptosConfig:t,ledgerVersion:Number(h.version)})}catch{throw new ns(`Transaction ${e} committed, but timed out waiting for indexer to sync with ledger version ${h.version}.You can disable this check by setting \`indexerVersionCheck\` to false in the \`extraArgs\` parameter.`,h)}return h}async function ym(r){let{aptosConfig:t,ledgerVersion:e}=r,n=3e3,o=new Date().getTime(),s=-1;for(;s<e;){if(new Date().getTime()-o>n)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(s=await yi({aptosConfig:t}),s>=e)break;await Nc(200)}}var ns=class extends Error{constructor(e,n){super(e);this.lastSubmittedTransaction=n}},Dc=class extends Error{constructor(e,n){super(e);this.transaction=n}};var Bt=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return rr.load(t);case 1:return Eo.load(t);case 2:return Kt.load(t);case 3:return _n.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},rr=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=De.deserialize(e),o=je.deserialize(e);return new rr(n,o)}},Eo=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Et.deserialize(e),o=Br.deserialize(e);return new Eo(n,o)}},Kt=class extends Bt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Fe.deserialize(e),o=$t.deserialize(e);return new Kt(n,o)}},_n=class extends Bt{constructor(e,n,o){super();this.public_keys=e,this.signatures=n,this.signatures_bitmap=o}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let n=Pr.deserialize(e),o=e.deserializeVector($t),s=e.deserializeBytes();return new _n(n,o,s)}};var br=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Or.load(t);case 1:return So.load(t);case 2:return zr.load(t);case 3:return Nr.load(t);case 4:return Dr.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},Or=class extends br{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=De.deserialize(e),o=je.deserialize(e);return new Or(n,o)}},So=class extends br{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Et.deserialize(e),o=Br.deserialize(e);return new So(n,o)}},zr=class extends br{constructor(e,n,o){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let n=Bt.deserialize(e),o=e.deserializeVector(O),s=e.deserializeVector(Bt);return new zr(n,o,s)}},Nr=class extends br{constructor(e,n,o,s){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o,this.fee_payer=s}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let n=Bt.deserialize(e),o=e.deserializeVector(O),s=e.deserializeVector(Bt),a=O.deserialize(e),c=Bt.deserialize(e),f={address:a,authenticator:c};return new Nr(n,o,s,f)}},Dr=class extends br{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let n=Bt.deserialize(e);return new Dr(n)}};var Mr=class extends te{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let n=e.deserializeU8();return new Mr(n)}};var qe=class extends te{constructor(e){super();this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let n=e.deserializeStr();return new qe(n)}};var qr=class extends te{constructor(e,n){super();this.address=e,this.name=n}static fromStr(e){let n=e.split("::");if(n.length!==2)throw new Error("Invalid module id.");return new qr(O.fromStringRelaxed(n[0]),new qe(n[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let n=O.deserialize(e),o=qe.deserialize(e);return new qr(n,o)}};var Xe=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Lr.load(t);case 1:return Hr.load(t);case 2:return $r.load(t);case 3:return Kr.load(t);case 4:return Vr.load(t);case 5:return Ar.load(t);case 6:return Qr.load(t);case 7:return nr.load(t);case 8:return Gr.load(t);case 9:return Fr.load(t);case 10:return jr.load(t);case 255:return Wr.load(t);default:throw new Error(`Unknown variant index for TypeTag: ${e}`)}}isBool(){return this instanceof Lr}isAddress(){return this instanceof Vr}isGeneric(){return this instanceof Wr}isSigner(){return this instanceof Ar}isVector(){return this instanceof Qr}isStruct(){return this instanceof nr}isU8(){return this instanceof Hr}isU16(){return this instanceof Gr}isU32(){return this instanceof Fr}isU64(){return this instanceof $r}isU128(){return this instanceof Kr}isU256(){return this instanceof jr}},Lr=class extends Xe{toString(){return"bool"}serialize(t){t.serializeU32AsUleb128(0)}static load(t){return new Lr}},Hr=class extends Xe{toString(){return"u8"}serialize(t){t.serializeU32AsUleb128(1)}static load(t){return new Hr}},Gr=class extends Xe{toString(){return"u16"}serialize(t){t.serializeU32AsUleb128(8)}static load(t){return new Gr}},Fr=class extends Xe{toString(){return"u32"}serialize(t){t.serializeU32AsUleb128(9)}static load(t){return new Fr}},$r=class extends Xe{toString(){return"u64"}serialize(t){t.serializeU32AsUleb128(2)}static load(t){return new $r}},Kr=class extends Xe{toString(){return"u128"}serialize(t){t.serializeU32AsUleb128(3)}static load(t){return new Kr}},jr=class extends Xe{toString(){return"u256"}serialize(t){t.serializeU32AsUleb128(10)}static load(t){return new jr}},Vr=class extends Xe{toString(){return"address"}serialize(t){t.serializeU32AsUleb128(4)}static load(t){return new Vr}},Ar=class extends Xe{toString(){return"signer"}serialize(t){t.serializeU32AsUleb128(5)}static load(t){return new Ar}},Xn=class extends Xe{constructor(e){super();this.value=e}toString(){return`&${this.value.toString()}`}serialize(e){e.serializeU32AsUleb128(254)}static load(e){let n=Xe.deserialize(e);return new Xn(n)}},Wr=class extends Xe{constructor(e){super();this.value=e}toString(){return`T${this.value}`}serialize(e){e.serializeU32AsUleb128(255),e.serializeU32(this.value)}static load(e){let n=e.deserializeU32();return new Wr(n)}},Qr=class extends Xe{constructor(e){super();this.value=e}toString(){return`vector<${this.value.toString()}>`}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let n=Xe.deserialize(e);return new Qr(n)}},nr=class extends Xe{constructor(e){super();this.value=e}toString(){let e="";return this.value.typeArgs.length>0&&(e=`<${this.value.typeArgs.map(n=>n.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${e}`}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let n=jt.deserialize(e);return new nr(n)}isTypeTag(e,n,o){return this.value.moduleName.identifier===n&&this.value.name.identifier===o&&this.value.address.equals(e)}isString(){return this.isTypeTag(O.ONE,"string","String")}isOption(){return this.isTypeTag(O.ONE,"option","Option")}isObject(){return this.isTypeTag(O.ONE,"object","Object")}},jt=class extends te{constructor(e,n,o,s){super();this.address=e,this.moduleName=n,this.name=o,this.typeArgs=s}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let n=O.deserialize(e),o=qe.deserialize(e),s=qe.deserialize(e),a=e.deserializeVector(Xe);return new jt(n,o,s,a)}};function mm(){return new jt(O.ONE,new qe("aptos_coin"),new qe("AptosCoin"),[])}function xm(){return new jt(O.ONE,new qe("string"),new qe("String"),[])}function bm(r){return new jt(O.ONE,new qe("option"),new qe("Option"),[r])}function Am(r){return new jt(O.ONE,new qe("object"),new qe("Object"),[r])}function fp(r){let t=r.deserializeUleb128AsU32();switch(t){case 0:return st.deserialize(r);case 1:return He.deserialize(r);case 2:return Tt.deserialize(r);case 3:return O.deserialize(r);case 4:return ve.deserialize(r,st);case 5:return Le.deserialize(r);case 6:return At.deserialize(r);case 7:return wt.deserialize(r);case 8:return _t.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${t}`)}}var vn=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return En.load(t);case 2:return Sn.load(t);case 3:return Un.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},En=class extends vn{constructor(e){super();this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let n=Bn.deserialize(e);return new En(n)}},Sn=class extends vn{constructor(e){super();this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let n=wr.deserialize(e);return new Sn(n)}},Un=class extends vn{constructor(e){super();this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let n=Cn.deserialize(e);return new Un(n)}},wr=class{constructor(t,e,n,o){this.module_name=t,this.function_name=e,this.type_args=n,this.args=o}static build(t,e,n,o){return new wr(qr.fromStr(t),new qe(e),n,o)}serialize(t){this.module_name.serialize(t),this.function_name.serialize(t),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForEntryFunction(t)})}static deserialize(t){let e=qr.deserialize(t),n=qe.deserialize(t),o=t.deserializeVector(Xe),s=t.deserializeUleb128AsU32(),a=new Array;for(let c=0;c<s;c+=1){let f=t.deserializeUleb128AsU32(),h=qn.deserialize(t,f);a.push(h)}return new wr(e,n,o,a)}},Bn=class{constructor(t,e,n){this.bytecode=t,this.type_args=e,this.args=n}serialize(t){t.serializeBytes(this.bytecode),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForScriptFunction(t)})}static deserialize(t){let e=t.deserializeBytes(),n=t.deserializeVector(Xe),o=t.deserializeUleb128AsU32(),s=new Array;for(let a=0;a<o;a+=1){let c=fp(t);s.push(c)}return new Bn(e,n,s)}},Cn=class{constructor(t,e){this.multisig_address=t,this.transaction_payload=e}serialize(t){this.multisig_address.serialize(t),this.transaction_payload===void 0?t.serializeBool(!1):(t.serializeBool(!0),this.transaction_payload.serialize(t))}static deserialize(t){let e=O.deserialize(t),n=t.deserializeBool(),o;return n&&(o=In.deserialize(t)),new Cn(e,o)}},In=class{constructor(t){this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new In(wr.deserialize(t))}};var Nt=class extends te{constructor(e,n,o,s,a,c,f){super();this.sender=e,this.sequence_number=n,this.payload=o,this.max_gas_amount=s,this.gas_unit_price=a,this.expiration_timestamp_secs=c,this.chain_id=f}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let n=O.deserialize(e),o=e.deserializeU64(),s=vn.deserialize(e),a=e.deserializeU64(),c=e.deserializeU64(),f=e.deserializeU64(),h=Mr.deserialize(e);return new Nt(n,o,s,a,c,f,h)}},os=class extends te{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return or.load(t);case 1:return sr.load(t);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},or=class extends os{constructor(e,n){super();this.raw_txn=e,this.secondary_signer_addresses=n}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let n=Nt.deserialize(e),o=e.deserializeVector(O);return new or(n,o)}},sr=class extends os{constructor(e,n,o){super();this.raw_txn=e,this.secondary_signer_addresses=n,this.fee_payer_address=o}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let n=Nt.deserialize(e),o=e.deserializeVector(O),s=O.deserialize(e);return new sr(n,o,s)}};var Dt=class extends te{constructor(e,n){super();this.raw_txn=e,this.authenticator=n}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let n=Nt.deserialize(e),o=br.deserialize(e);return new Dt(n,o)}};function dp(r){return!!r.match(/^[_a-zA-Z0-9]+$/)}function lp(r){return!!r.match(/\s/)}function wm(r,t){let e=t;for(;e<r.length;e+=1){let n=r[e];if(!lp(n))break}return e}var pp=(y=>(y.InvalidTypeTag="unknown type",y.UnexpectedTypeArgumentClose="unexpected '>'",y.UnexpectedWhitespaceCharacter="unexpected whitespace character",y.UnexpectedComma="unexpected ','",y.TypeArgumentCountMismatch="type argument count doesn't match expected amount",y.MissingTypeArgumentClose="no matching '>' for '<'",y.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",y.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",y.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",y.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",y.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",y))(pp||{}),$e=class extends Error{constructor(t,e){super(`Failed to parse typeTag '${t}', ${e}`)}};function Uo(r,t){let e=t?.allowGenerics??!1,n=[],o=[],s=[],a=0,c="",f=1;for(;a<r.length;){let h=r[a];if(h==="<")n.push({savedExpectedTypes:f,savedStr:c,savedTypes:s}),c="",s=[],f=1;else if(h===">"){if(c!==""){let I=Ci(c,o,e);s.push(I)}let g=n.pop();if(g===void 0)throw new $e(r,"unexpected '>'");if(f!==s.length)throw new $e(r,"type argument count doesn't match expected amount");let{savedStr:y,savedTypes:w,savedExpectedTypes:b}=g;o=s,s=w,c=y,f=b}else if(h===","){if(c.length!==0){let g=Ci(c,o,e);o=[],s.push(g),c="",f+=1}}else if(lp(h)){let g=!1;if(c.length!==0){let w=Ci(c,o,e);o=[],s.push(w),c="",g=!0}a=wm(r,a);let y=r[a];if(a<r.length&&g&&y!==","&&y!==">")throw new $e(r,"unexpected whitespace character");continue}else c+=h;a+=1}if(n.length>0)throw new $e(r,"no matching '>' for '<'");switch(s.length){case 0:return Ci(c,o,e);case 1:if(c==="")return s[0];throw new $e(r,"unexpected ','");default:throw new $e(r,"unexpected whitespace character")}}function Ci(r,t,e){switch(r){case"&signer":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Xn(new Ar);case"signer":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Ar;case"bool":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Lr;case"address":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Vr;case"u8":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Hr;case"u16":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Gr;case"u32":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Fr;case"u64":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new $r;case"u128":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new Kr;case"u256":if(t.length>0)throw new $e(r,"primitive types not expected to have type arguments");return new jr;case"vector":if(t.length!==1)throw new $e(r,"vector type expected to have exactly one type argument");return new Qr(t[0]);default:if(e&&r.match(/^T[0-9]+$/))return new Wr(Number(r.split("T")[1]));if(!r.match(/.*:.*/))throw new $e(r,"unknown type");let n=r.split("::");if(n.length!==3)throw new $e(r,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!dp(n[1]))throw new $e(r,"module name must only contain alphanumeric or '_' characters");if(!dp(n[2]))throw new $e(r,"struct name must only contain alphanumeric or '_' characters");return new nr(new jt(O.fromStringRelaxed(n[0]),new qe(n[1]),new qe(n[2]),t))}}function Mc(r){return typeof r=="boolean"}function Zn(r){return typeof r=="string"}function ss(r){return typeof r=="number"}function is(r){return typeof r=="number"||typeof r=="bigint"||typeof r=="string"}function qc(r){return r==null}function Ii(r){return r instanceof Le}function as(r){return r instanceof O}function Ri(r){return r instanceof Ge}function Lc(r){return r instanceof ur}function Pi(r){return r instanceof st}function ki(r){return r instanceof At}function Oi(r){return r instanceof wt}function zi(r){return r instanceof He}function Ni(r){return r instanceof Tt}function Di(r){return r instanceof _t}function Mi(r){return"bytecode"in r}function Ke(r,t){throw new Error(`Type mismatch for argument ${t}, expected '${r}'`)}function Hc(r){let t=r.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?r.params.length:t}function qi(r){let t=r.split("::");if(t.length!==3)throw new Error(`Invalid function ${r}`);let e=t[0],n=t[1],o=t[2];return{moduleAddress:e,moduleName:n,functionName:o}}function Gc(r){return r?.map(t=>Zn(t)?Uo(t):t)??[]}async function Fc(r,t,e,n){let s=(await mi({aptosConfig:n,accountAddress:r,moduleName:t})).abi?.exposed_functions.find(f=>f.name===e);if(!s)throw new Error(`Could not find entry function ABI for '${r}::${t}::${e}'`);if(!s.is_entry)throw new Error(`'${r}::${t}::${e}' is not an entry function`);let a=Hc(s),c=[];for(let f=a;f<s.params.length;f+=1)c.push(Uo(s.params[f],{allowGenerics:!0}));return{typeParameters:s.generic_type_params,parameters:c}}function $c(r,t,e,n,o){if(n>=t.parameters.length)throw new Error(`Too many arguments for '${r}', expected ${t.parameters.length}`);return Ii(e)||Pi(e)||ki(e)||Oi(e)||zi(e)||Ni(e)||Di(e)||as(e)||Ri(e)||Lc(e)||e instanceof ve||e instanceof tt?(Tm(t,e,n),e):Li(e,t.parameters[n],n,o)}function Li(r,t,e,n){if(t.isBool()){if(Mc(r))return new Le(r);Ke("boolean",e)}if(t.isAddress()){if(Zn(r))return O.fromStringRelaxed(r);Ke("string",e)}if(t.isU8()){if(ss(r))return new st(r);Ke("number",e)}if(t.isU16()){if(ss(r))return new At(r);Ke("number",e)}if(t.isU32()){if(ss(r))return new wt(r);Ke("number",e)}if(t.isU64()){if(is(r))return new He(BigInt(r));Ke("bigint | number | string",e)}if(t.isU128()){if(is(r))return new Tt(BigInt(r));Ke("bigint | number | string",e)}if(t.isU256()){if(is(r))return new _t(BigInt(r));Ke("bigint | number | string",e)}if(t.isGeneric()){let o=t.value;if(o<0||o>=n.length)throw new Error(`Generic argument ${t.toString()} is invalid for argument ${e}`);Li(r,n[o],e,n)}if(t.isVector()){if(t.value.isU8()&&Zn(r))return ve.U8(be.fromHexInput(r).toUint8Array());if(Array.isArray(r))return new ve(r.map(o=>Li(o,t.value,e,n)));throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}if(t.isStruct()){if(t.isString()){if(Zn(r))return new Ge(r);Ke("string",e)}if(t.isObject()){if(Zn(r))return O.fromStringRelaxed(r);Ke("string",e)}if(t.isOption())return qc(r)?new tt(null):new tt(Li(r,t.value.typeArgs[0],e,n));throw new Error(`Unsupported struct input type for argument ${e}, type '${t.toString()}'`)}throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}function Tm(r,t,e){let n=r.parameters[e];if(n.isBool()){if(Ii(t))return;Ke("Bool",e)}if(n.isAddress()){if(as(t))return;Ke("AccountAddress",e)}if(n.isU8()){if(Pi(t))return;Ke("U8",e)}if(n.isU16()){if(ki(t))return;Ke("U16",e)}if(n.isU32()){if(Oi(t))return;Ke("U32",e)}if(n.isU64()){if(zi(t))return;Ke("U64",e)}if(n.isU128()){if(Ni(t))return;Ke("U128",e)}if(n.isU256()){if(Di(t))return;Ke("U256",e)}if(n.isVector()){if(t instanceof ve)return;Ke("MoveVector",e)}if(n instanceof nr){if(n.isString()){if(Ri(t))return;Ke("MoveString",e)}if(n.isObject()){if(as(t))return;Ke("AccountAddress",e)}if(n.isOption()){if(t instanceof tt)return;Ke("MoveOption",e)}}throw new Error(`Type mismatch for argument ${e}, expected '${n.toString()}'`)}async function Kc(r){if(Mi(r))return gp(r);let{moduleAddress:t,moduleName:e,functionName:n}=qi(r.function),o=await bo(async()=>Fc(t,e,n,r.aptosConfig),`entry-function-${r.aptosConfig.network}-${t}-${e}-${n}`,1e3*60*5)();return hp(r,o)}function hp(r,t){if(Mi(r))return gp(r);let{moduleAddress:e,moduleName:n,functionName:o}=qi(r.function),s=Gc(r.typeArguments);if(s.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${s.length}`);let a=r.functionArguments.map((f,h)=>$c(r.function,t,f,h,s));if(a.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${n}::${o}', expected ${t.parameters.length} but got ${a.length}`);let c=wr.build(`${e}::${n}`,o,s,a);if("multisigAddress"in r){let f;return typeof r.multisigAddress=="string"?f=O.from(r.multisigAddress):f=r.multisigAddress,new Un(new Cn(f,new In(c)))}return new Sn(c)}function gp(r){return new En(new Bn(be.fromHexInput(r.bytecode).toUint8Array(),r.typeArguments??[],r.functionArguments))}async function yp(r){let{aptosConfig:t,sender:e,payload:n,options:o}=r,s=o?.accountSequenceNumber?Promise.resolve({sequence_number:o.accountSequenceNumber}):Wn({aptosConfig:t,accountAddress:e}),a=Us[t.network]?Promise.resolve({chain_id:Us[t.network]}):pi({aptosConfig:t}),c=o?.gasUnitPrice?Promise.resolve({gas_estimate:o.gasUnitPrice}):Si({aptosConfig:t}),[{sequence_number:f},{chain_id:h},{gas_estimate:g}]=await Promise.all([s,a,c]),{maxGasAmount:y,gasUnitPrice:w,expireTimestamp:b}={maxGasAmount:BigInt(Au),gasUnitPrice:BigInt(g),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+wu),...o};return new Nt(O.fromRelaxed(e),BigInt(f),n,BigInt(y),BigInt(w),BigInt(b),new Mr(h))}async function jc(r){let{aptosConfig:t,sender:e,payload:n,options:o,secondarySignerAddresses:s,feePayerAddress:a}=r,c=await yp({aptosConfig:t,sender:e,payload:n,options:o});if(a){let f=s?s.map(h=>O.fromRelaxed(h)):[];return{rawTransaction:c,secondarySignerAddresses:f,feePayerAddress:O.fromRelaxed(a)}}if(s){let f=s.map(h=>O.fromRelaxed(h));return{rawTransaction:c,secondarySignerAddresses:f}}return{rawTransaction:c}}function Vc(r){let{signerPublicKey:t,transaction:e,secondarySignersPublicKeys:n,feePayerPublicKey:o}=r,s=new qo(e.rawTransaction.bcsToBytes()),a=Nt.deserialize(s),c=cs(t);if(e.feePayerAddress){let h=new sr(a,e.secondarySignerAddresses??[],e.feePayerAddress),g=[];n&&(g=n.map(b=>cs(b)));let y=cs(o),w=new Nr(c,e.secondarySignerAddresses??[],g,{address:e.feePayerAddress,authenticator:y});return new Dt(h.raw_txn,w).bcsToBytes()}if(e.secondarySignerAddresses){let h=new or(a,e.secondarySignerAddresses),g=[];g=n.map(w=>cs(w));let y=new zr(c,e.secondarySignerAddresses,g);return new Dt(h.raw_txn,y).bcsToBytes()}let f;if(c instanceof rr)f=new Or(c.public_key,c.signature);else if(c instanceof Kt)f=new Dr(c);else throw new Error("Invalid public key");return new Dt(a,f).bcsToBytes()}function cs(r){if(r instanceof Fe){if(r.publicKey instanceof De)return new Kt(r,new $t(new je(new Uint8Array(64))));if(r.publicKey instanceof Gt)return new Kt(r,new $t(new xr(new Uint8Array(64))))}return new rr(new De(r.toUint8Array()),new je(new Uint8Array(64)))}function Wc(r){let{signer:t,transaction:e}=r,n=Yc(e),o=xp(n),s=t.sign(o);switch(t.signingScheme){case 0:return new rr(new De(t.publicKey.toUint8Array()),new je(s.toUint8Array()));case 2:return new Kt(t.publicKey,new $t(s));default:throw new Error(`Cannot sign transaction, signing scheme ${t.signingScheme} not supported`)}}function Qc(r){let{transaction:t,senderAuthenticator:e,feePayerAuthenticator:n,additionalSignersAuthenticators:o}=r,s=Yc(t);if(n||o)return mp(s,e,n,o);if(e instanceof rr){let a=new Or(e.public_key,e.signature);return new Dt(s,a).bcsToBytes()}if(e instanceof Kt||e instanceof _n){let a=new Dr(e);return new Dt(s,a).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${e} is not a supported account authentication scheme`)}function Yc(r){return r.feePayerAddress?new sr(r.rawTransaction,r.secondarySignerAddresses??[],r.feePayerAddress):r.secondarySignerAddresses?new or(r.rawTransaction,r.secondarySignerAddresses):r.rawTransaction}function mp(r,t,e,n){if(r instanceof sr){if(!e)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let o=new Nr(t,r.secondary_signer_addresses,n??[],{address:r.fee_payer_address,authenticator:e});return new Dt(r.raw_txn,o).bcsToBytes()}if(r instanceof or){if(!n)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let o=new zr(t,r.secondary_signer_addresses,n??[]);return new Dt(r.raw_txn,o).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof r} transaction is not supported`)}function xp(r){let t=Mn.create();if(r instanceof Nt)t.update(_u);else if(r instanceof or)t.update(fa);else if(r instanceof sr)t.update(fa);else throw new Error(`Unknown transaction type to sign on: ${r}`);let e=t.digest(),n=r.bcsToBytes(),o=new Uint8Array(e.length+n.length);return o.set(e),o.set(n,e.length),o}async function ir(r){let{aptosConfig:t,sender:e,data:n,options:o,secondarySignerAddresses:s,hasFeePayer:a}=r,c;a===!0&&(c=O.ZERO.toString());let f;"bytecode"in n?f=n:"multisigAddress"in n?f={aptosConfig:t,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments}:f={aptosConfig:t,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments};let h=await Kc(f);return jc({aptosConfig:t,sender:e,payload:h,options:o,secondarySignerAddresses:s,feePayerAddress:c})}function Xc(r){return Wc({...r})}async function bp(r){let{aptosConfig:t,transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:a}=r,c=Vc({transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:a}),{data:f}=await zn({aptosConfig:t,body:c,path:"transactions/simulate",params:{estimate_gas_unit_price:r.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:r.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:r.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return f}async function Zc(r){let{aptosConfig:t}=r,e=Qc({...r}),{data:n}=await zn({aptosConfig:t,body:e,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return n}async function Jc(r){let{aptosConfig:t,signer:e,transaction:n}=r,o=Xc({signer:e,transaction:n});return Zc({aptosConfig:t,transaction:n,senderAuthenticator:o})}async function Ap(r){let{aptosConfig:t,account:e,metadataBytes:n,moduleBytecode:o,options:s}=r,a=o.map(f=>ve.U8(f));return await ir({aptosConfig:t,sender:O.fromRelaxed(e),data:{function:"0x1::code::publish_package_txn",functionArguments:[ve.U8(n),new ve(a)]},options:s})}async function wp(r){let{aptosConfig:t,fromAccount:e,toNewPrivateKey:n}=r,o=await Wn({aptosConfig:t,accountAddress:e.accountAddress.toString()}),s=St.fromPrivateKey({privateKey:n,legacy:!0}),c=new rs({sequenceNumber:BigInt(o.sequence_number),originator:e.accountAddress,currentAuthKey:O.from(o.authentication_key),newPublicKey:s.publicKey}).bcsToBytes(),f=e.sign(c),h=s.sign(c),g=await ir({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new st(e.signingScheme.valueOf()),ve.U8(e.publicKey.toUint8Array()),new st(s.signingScheme.valueOf()),ve.U8(s.publicKey.toUint8Array()),ve.U8(f.toUint8Array()),ve.U8(h.toUint8Array())]}});return await Jc({aptosConfig:t,signer:e,transaction:g})}async function Tp(r){let{aptosConfig:t,sender:e,recipient:n,amount:o,coinType:s,options:a}=r,c=s??Tu;return await ir({aptosConfig:t,sender:e.accountAddress,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[Uo(c)],functionArguments:[O.from(n),new He(o)]},options:a})}var us=class{constructor(t){this.config=t}async transferCoinTransaction(t){return Tp({aptosConfig:this.config,...t})}};async function _p(r){let{aptosConfig:t,options:e,creator:n}=r;return await ir({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new Ge(r.collection),new Ge(r.description),new Ge(r.name),new Ge(r.uri),ve.MoveString([]),ve.MoveString([]),new ve([])]},options:e})}async function vp(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:O.from(e).toStringLong()}};return(await Ne({aptosConfig:t,query:{query:Sd,variables:{where_condition:n}},originMethod:"getTokenData"})).current_token_datas_v2[0]}async function Ep(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:O.from(e).toStringLong()}};return(await Ne({aptosConfig:t,query:{query:fc,variables:{where_condition:n}},originMethod:"getCurrentTokenOwnership"})).current_token_ownerships_v2[0]}async function Sp(r){let{aptosConfig:t,ownerAddress:e,options:n}=r,o={owner_address:{_eq:O.from(e).toStringLong()}},s={query:fc,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:s,originMethod:"getOwnedTokens"})).current_token_ownerships_v2}async function Up(r){let{aptosConfig:t,tokenAddress:e,options:n}=r,o={token_data_id:{_eq:O.from(e).toStringLong()}},s={query:Ed,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await Ne({aptosConfig:t,query:s,originMethod:"getTokenActivity"})).token_activities_v2}async function Bp(r){let{aptosConfig:t,options:e,creator:n}=r;return await ir({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new Ge(r.description),new He(r.maxSupply??Nn),new Ge(r.name),new Ge(r.uri),new Le(r.mutableDescription??!0),new Le(r.mutableRoyalty??!0),new Le(r.mutableURI??!0),new Le(r.mutableTokenDescription??!0),new Le(r.mutableTokenName??!0),new Le(r.mutableTokenProperties??!0),new Le(r.mutableTokenURI??!0),new Le(r.tokensBurnableByCreator??!0),new Le(r.tokensFreezableByCreator??!0),new He(r.royaltyNumerator??0),new He(r.royaltyDenominator??1)]},options:e})}async function eu(r){let{aptosConfig:t,creatorAddress:e,collectionName:n,options:o}=r,s=O.from(e),a={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return o?.tokenStandard&&(a.token_standard={_eq:o?.tokenStandard??"v2"}),(await Ne({aptosConfig:t,query:{query:xd,variables:{where_condition:a}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function Cp(r){return(await eu(r)).collection_id}var fs=class{constructor(t){this.config=t}async createCollectionTransaction(t){return Bp({aptosConfig:this.config,...t})}async getCollectionData(t){return eu({aptosConfig:this.config,...t})}async getCollectionId(t){return Cp({aptosConfig:this.config,...t})}async mintTokenTransaction(t){return _p({aptosConfig:this.config,...t})}async getTokenData(t){return vp({aptosConfig:this.config,...t})}async getCurrentTokenOwnership(t){return Ep({aptosConfig:this.config,...t})}async getOwnedTokens(t){return Sp({aptosConfig:this.config,...t})}async getTokenActivity(t){return Up({aptosConfig:this.config,...t})}};async function Ip(r){let{accountAddress:t,aptosConfig:e,creationNumber:n}=r,s={account_address:{_eq:O.from(t).toStringLong()},creation_number:{_eq:n}};return Hi({aptosConfig:e,options:{where:s}})}async function Rp(r){let{accountAddress:t,aptosConfig:e,eventType:n,options:o}=r,c={where:{account_address:{_eq:O.fromRelaxed(t).toStringLong()},indexed_type:{_eq:n}},pagination:o?.pagination,orderBy:o?.orderBy};return Hi({aptosConfig:e,options:c})}async function Hi(r){let{aptosConfig:t,options:e}=r,n={query:wd,variables:{where_condition:e?.where,offset:e?.pagination?.offset,limit:e?.pagination?.limit,order_by:e?.orderBy}};return(await Ne({aptosConfig:t,query:n,originMethod:"getEvents"})).events}var ds=class{constructor(t){this.config=t}async getAccountEventsByCreationNumber(t){return Ip({aptosConfig:this.config,...t})}async getAccountEventsByEventType(t){return Rp({aptosConfig:this.config,...t})}async getEvents(t){return Hi({aptosConfig:this.config,...t})}};async function Pp(r){let{aptosConfig:t,accountAddress:e,amount:n,options:o}=r,s=o?.timeoutSecs||Bs,{data:a}=await la({aptosConfig:t,path:"fund",body:{address:O.fromRelaxed(e).toString(),amount:n},originMethod:"fundAccount"}),c=a.txn_hashes[0];return await Bi({aptosConfig:t,transactionHash:c,options:{timeoutSecs:s,checkSuccess:o?.checkSuccess,indexerVersionCheck:o?.indexerVersionCheck}}),c}var ls=class{constructor(t){this.config=t}async fundAccount(t){return Pp({aptosConfig:this.config,...t})}};async function tu(r){let{aptosConfig:t,options:e}=r,n={query:_d,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function kp(r){let{aptosConfig:t,options:e}=r,n={query:Td,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function Op(r){let{aptosConfig:t,options:e}=r,n={query:bd,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await Ne({aptosConfig:t,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var ps=class{constructor(t){this.config=t}async getFungibleAssetMetadata(t){return tu({aptosConfig:this.config,...t})}async getFungibleAssetMetadataByAssetType(t){return(await tu({aptosConfig:this.config,options:{where:{asset_type:{_eq:t}}}}))[0]}async getFungibleAssetActivities(t){return kp({aptosConfig:this.config,...t})}async getCurrentFungibleAssetBalances(t){return Op({aptosConfig:this.config,...t})}};var hs=class{constructor(t){this.config=t}async getLedgerInfo(){return pi({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(t){return Ud({aptosConfig:this.config,...t})}async getBlockByHeight(t){return Bd({aptosConfig:this.config,...t})}async getTableItem(t){return hi({aptosConfig:this.config,...t})}async view(t){return gi({aptosConfig:this.config,...t})}async getChainTopUserTransactions(t){return Cd({aptosConfig:this.config,...t})}async queryIndexer(t){return Ne({aptosConfig:this.config,...t})}async getIndexerLastSuccessVersion(){return yi({aptosConfig:this.config})}};var zp=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function Np(r){return!(!r||r.length<3||r.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(r))}function Dp(r){let[t,e,...n]=r.replace(/\.apt$/,"").split(".");if(n.length>0)throw new Error(`${r} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!Np(t))throw new Error(`${t} is not valid. ${zp}`);if(e&&!Np(e))throw new Error(`${e} is not valid. ${zp}`);return{domainName:e||t,subdomainName:e?t:void 0}}var _m="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",vm={["testnet"]:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",["mainnet"]:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",["local"]:_m,["custom"]:null,["devnet"]:null};function Mp(r){let t=vm[r.network];if(!t)throw new Error(`The ANS contract is not deployed to ${r.network}`);return t}var Em=r=>({vec:[r]}),Sm=()=>({vec:[]}),Um=r=>r!=null?Em(r):Sm(),Bm=r=>{if(!!r&&typeof r=="object"&&"vec"in r&&Array.isArray(r.vec))return r.vec[0]};async function qp(r){let{aptosConfig:t,name:e}=r,n=Mp(t),{domainName:o,subdomainName:s}=Dp(e),a=await gi({aptosConfig:t,payload:{function:`${n}::router::get_owner_addr`,functionArguments:[o,Um(s)]}}),c=Bm(a[0]);return c?O.fromRelaxed(c).toString():void 0}async function Lp(r){let{aptosConfig:t,expiration:e,name:n,sender:o,targetAddress:s,toAddress:a,options:c}=r,f=Mp(t),{domainName:h,subdomainName:g}=Dp(n),y=e.policy==="subdomain:independent"||e.policy==="subdomain:follow-domain";if(g&&!y)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(y&&!g)throw new Error(`Policy is set to ${e.policy} but no subdomain was provided`);if(e.policy==="domain"){if(e.years!==1)throw new Error("For now, names can only be registered for 1 year at a time");let w=e.years*31536e3;return await ir({aptosConfig:t,sender:o.accountAddress.toString(),data:{function:`${f}::router::register_domain`,functionArguments:[new Ge(h),new He(w),new tt(s?O.from(s):null),new tt(a?O.from(a):null)]},options:c})}throw new Error(`Policy ${e.policy} is not supported yet`)}var gs=class{constructor(t){this.config=t}async getOwnerAddress(t){return qp({aptosConfig:this.config,...t})}async registerName(t){return Lp({aptosConfig:this.config,...t})}};async function Hp(r){let{aptosConfig:t,poolAddress:e}=r,n=O.fromRelaxed(e).toStringLong(),s=await Ne({aptosConfig:t,query:{query:uc,variables:{where_condition:{pool_address:{_eq:n}}}}});if(s.num_active_delegator_per_pool.length===0)throw Error("Delegator pool not found");return s.num_active_delegator_per_pool[0].num_active_delegator}async function Gp(r){let{aptosConfig:t,options:e}=r,n={query:uc,variables:{where_condition:{},order_by:e?.orderBy}};return(await Ne({aptosConfig:t,query:n})).num_active_delegator_per_pool}async function Fp(r){let{aptosConfig:t,delegatorAddress:e,poolAddress:n}=r,o={query:Ad,variables:{delegatorAddress:O.fromRelaxed(e).toStringLong(),poolAddress:O.fromRelaxed(n).toStringLong()}};return(await Ne({aptosConfig:t,query:o})).delegated_staking_activities}var ys=class{constructor(t){this.config=t}async getNumberOfDelegators(t){return Hp({aptosConfig:this.config,...t})}async getNumberOfDelegatorsForAllPools(t){return Gp({aptosConfig:this.config,...t})}async getDelegatedStakingActivities(t){return Fp({aptosConfig:this.config,...t})}};var ms=class{constructor(t){this.config=t}async getTransactions(t){return ap({aptosConfig:this.config,...t})}async getTransactionByVersion(t){return cp({aptosConfig:this.config,...t})}async getTransactionByHash(t){return Ui({aptosConfig:this.config,...t})}async isPendingTransaction(t){return up({aptosConfig:this.config,...t})}async waitForTransaction(t){return Bi({aptosConfig:this.config,...t})}async getGasPriceEstimation(){return Si({aptosConfig:this.config})}};var xs=class{constructor(t){this.config=t}async generateTransaction(t){return ir({aptosConfig:this.config,...t})}signTransaction(t){let{signer:e,transaction:n,asFeePayer:o}=t;return o&&(n.feePayerAddress=e.accountAddress),Xc({signer:e,transaction:n})}async simulateTransaction(t){return bp({aptosConfig:this.config,...t})}async submitTransaction(t){return Zc({aptosConfig:this.config,...t})}async signAndSubmitTransaction(t){let{signer:e,transaction:n}=t;return Jc({aptosConfig:this.config,signer:e,transaction:n})}async publishPackageTransaction(t){return Ap({aptosConfig:this.config,...t})}async rotateAuthKey(t){return wp({aptosConfig:this.config,...t})}};var Ct=class{constructor(t){this.config=new ts(t),this.account=new Zo(this.config),this.ans=new gs(this.config),this.coin=new us(this.config),this.digitalAsset=new fs(this.config),this.event=new ds(this.config),this.faucet=new ls(this.config),this.fungibleAsset=new ps(this.config),this.general=new hs(this.config),this.staking=new ys(this.config),this.transaction=new ms(this.config),this.transactionSubmission=new xs(this.config)}};function ar(r,t,e){Object.getOwnPropertyNames(t.prototype).forEach(n=>{let o=Object.getOwnPropertyDescriptor(t.prototype,n);!o||(o.value=function(...s){return this[e][n](...s)},Object.defineProperty(r.prototype,n,o))})}ar(Ct,Zo,"account");ar(Ct,gs,"ans");ar(Ct,us,"coin");ar(Ct,fs,"digitalAsset");ar(Ct,ds,"event");ar(Ct,ls,"faucet");ar(Ct,ps,"fungibleAsset");ar(Ct,hs,"general");ar(Ct,ys,"staking");ar(Ct,ms,"transaction");ar(Ct,xs,"transactionSubmission");return Zp(Cm);})();
407
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
408
- /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
409
- /*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
410
- /*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
411
- /*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */
427
+ `;async function _i(r){let{aptosConfig:t}=r,{data:e}=await ht({aptosConfig:t,originMethod:"getLedgerInfo",path:""});return e}async function Pu(r){let{aptosConfig:t,ledgerVersion:e,options:n}=r,{data:o}=await ht({aptosConfig:t,originMethod:"getBlockByVersion",path:`blocks/by_version/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function Ou(r){let{aptosConfig:t,blockHeight:e,options:n}=r,{data:o}=await ht({aptosConfig:t,originMethod:"getBlockByHeight",path:`blocks/by_height/${e}`,params:{with_transactions:n?.withTransactions}});return o}async function vi(r){let{aptosConfig:t,handle:e,data:n,options:o}=r;return(await Kr({aptosConfig:t,originMethod:"getTableItem",path:`tables/${e}/item`,params:{ledger_version:o?.ledgerVersion},body:n})).data}async function kr(r){let{aptosConfig:t,payload:e,options:n}=r,{data:o}=await Kr({aptosConfig:t,originMethod:"view",path:"view",params:{ledger_version:n?.ledgerVersion},body:{function:e.function,type_arguments:e.typeArguments??[],arguments:e.functionArguments??[]}});return o}async function ku(r){let{aptosConfig:t,limit:e}=r;return(await xe({aptosConfig:t,query:{query:Tu,variables:{limit:e}},originMethod:"getChainTopUserTransactions"})).user_transactions}async function xe(r){let{aptosConfig:t,query:e,originMethod:n}=r,{data:o}=await Bs({aptosConfig:t,originMethod:n??"queryIndexer",path:"",body:e,overrides:{WITH_CREDENTIALS:!1}});return o}async function Qp(r){let{aptosConfig:t}=r;return(await xe({aptosConfig:t,query:{query:Bu},originMethod:"getProcessorStatuses"})).processor_status}async function Si(r){return(await Qp({aptosConfig:r.aptosConfig}))[0].last_success_version}var pa=new Map;function Dn(r,t,e){return async(...n)=>{if(pa.has(t)){let{value:s,timestamp:c}=pa.get(t);if(e===void 0||Date.now()-c<=e)return s}let o=await r(...n);return pa.set(t,{value:o,timestamp:Date.now()}),o}}async function cn(r){let{aptosConfig:t,accountAddress:e}=r,{data:n}=await ht({aptosConfig:t,originMethod:"getInfo",path:`accounts/${O.from(e).toString()}`});return n}async function Mu(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return Fr({aptosConfig:t,originMethod:"getModules",path:`accounts/${O.from(e).toString()}/modules`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??1e3}})}async function Ei(r){return r.options?.ledgerVersion!==void 0?Nu(r):Dn(async()=>Nu(r),`module-${r.accountAddress}-${r.moduleName}`,1e3*60*5)()}async function Nu(r){let{aptosConfig:t,accountAddress:e,moduleName:n,options:o}=r,{data:s}=await ht({aptosConfig:t,originMethod:"getModule",path:`accounts/${O.from(e).toString()}/module/${n}`,params:{ledger_version:o?.ledgerVersion}});return s}async function Du(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return Fr({aptosConfig:t,originMethod:"getTransactions",path:`accounts/${O.from(e).toString()}/transactions`,params:{start:n?.offset,limit:n?.limit}})}async function Gu(r){let{aptosConfig:t,accountAddress:e,options:n}=r;return Fr({aptosConfig:t,originMethod:"getResources",path:`accounts/${O.from(e).toString()}/resources`,params:{ledger_version:n?.ledgerVersion,start:n?.offset,limit:n?.limit??999}})}async function ga(r){let{aptosConfig:t,accountAddress:e,resourceType:n,options:o}=r,{data:s}=await ht({aptosConfig:t,originMethod:"getResource",path:`accounts/${O.from(e).toString()}/resource/${n}`,params:{ledger_version:o?.ledgerVersion}});return s.data}async function ya(r){let{aptosConfig:t,authenticationKey:e,options:n}=r,o=await ga({aptosConfig:t,accountAddress:"0x1",resourceType:"0x1::account::OriginatingAddress",options:n}),{address_map:{handle:s}}=o,c=O.from(e);try{let u=await vi({aptosConfig:t,handle:s,data:{key:c.toString(),key_type:"address",value_type:"address"},options:n});return O.from(u)}catch(u){if(u instanceof $t&&u.data.error_code==="table_item_not_found")return c;throw u}}async function qu(r){let{aptosConfig:t,accountAddress:e}=r,o={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}},c=await xe({aptosConfig:t,query:{query:bu,variables:{where_condition:o}},originMethod:"getAccountTokensCount"});if(!c.current_token_ownerships_v2_aggregate.aggregate)throw Error("Failed to get the count of account tokens");return c.current_token_ownerships_v2_aggregate.aggregate.count}async function Lu(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.token_standard={_eq:n?.tokenStandard});let c={query:xu,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await xe({aptosConfig:t,query:c,originMethod:"getAccountOwnedTokens"})).current_token_ownerships_v2}async function Fu(r){let{aptosConfig:t,accountAddress:e,collectionAddress:n,options:o}=r,s=O.from(e).toStringLong(),c=O.from(n).toStringLong(),u={owner_address:{_eq:s},current_token_data:{collection_id:{_eq:c}},amount:{_gt:0}};o?.tokenStandard&&(u.token_standard={_eq:o?.tokenStandard});let p={query:Au,variables:{where_condition:u,offset:o?.pagination?.offset,limit:o?.pagination?.limit,order_by:o?.orderBy}};return(await xe({aptosConfig:t,query:p,originMethod:"getAccountOwnedTokensFromCollectionAddress"})).current_token_ownerships_v2}async function Ku(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()},amount:{_gt:0}};n?.tokenStandard&&(s.current_collection={token_standard:{_eq:n?.tokenStandard}});let c={query:hu,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await xe({aptosConfig:t,query:c,originMethod:"getAccountCollectionsWithOwnedTokens"})).current_collection_ownership_v2_view}async function Hu(r){let{aptosConfig:t,accountAddress:e}=r,n=O.from(e).toStringLong(),s=await xe({aptosConfig:t,query:{query:wu,variables:{address:n}},originMethod:"getAccountTransactionsCount"});if(!s.account_transactions_aggregate.aggregate)throw Error("Failed to get the count of account transactions");return s.account_transactions_aggregate.aggregate.count}async function $u(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()}},c={query:yu,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await xe({aptosConfig:t,query:c,originMethod:"getAccountCoinsData"})).current_fungible_asset_balances}async function Vu(r){let{aptosConfig:t,accountAddress:e}=r,n=O.from(e).toStringLong(),s=await xe({aptosConfig:t,query:{query:gu,variables:{address:n}},originMethod:"getAccountCoinsCount"});if(!s.current_fungible_asset_balances_aggregate.aggregate)throw Error("Failed to get the count of account coins");return s.current_fungible_asset_balances_aggregate.aggregate.count}async function Qu(r){let{aptosConfig:t,accountAddress:e,options:n}=r,s={owner_address:{_eq:O.from(e).toStringLong()}},c={query:mu,variables:{where_condition:s,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await xe({aptosConfig:t,query:c,originMethod:"getAccountOwnedObjects"})).current_objects}async function ju(r){let{aptosConfig:t,privateKey:e}=r,n=new je(e.publicKey());if(e instanceof cr){let s=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:2}).derivedAddress();return dr.fromPrivateKeyAndAddress({privateKey:e,address:s})}if(e instanceof or){let o=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:2});if(await zu({authKey:o,aptosConfig:t})){let p=o.derivedAddress();return dr.fromPrivateKeyAndAddress({privateKey:e,address:p,legacy:!1})}let c=Ft.fromPublicKeyAndScheme({publicKey:n,scheme:0});if(await zu({authKey:c,aptosConfig:t})){let p=c.derivedAddress();return dr.fromPrivateKeyAndAddress({privateKey:e,address:p,legacy:!0})}}throw new Error(`Can't derive account from private key ${e}`)}async function zu(r){let{aptosConfig:t,authKey:e}=r,n=await ya({aptosConfig:t,authenticationKey:e.derivedAddress()});try{return await cn({aptosConfig:t,accountAddress:n}),!0}catch(o){if(o.status===404)return!1;throw new Error(`Error while looking for an account info ${n.toString()}`)}}var mo=class{constructor(t){this.config=t}async getAccountInfo(t){return cn({aptosConfig:this.config,...t})}async getAccountModules(t){return Mu({aptosConfig:this.config,...t})}async getAccountModule(t){return Ei({aptosConfig:this.config,...t})}async getAccountTransactions(t){return Du({aptosConfig:this.config,...t})}async getAccountResources(t){return Gu({aptosConfig:this.config,...t})}async getAccountResource(t){return ga({aptosConfig:this.config,...t})}async lookupOriginalAccountAddress(t){return ya({aptosConfig:this.config,...t})}async getAccountTokensCount(t){return qu({aptosConfig:this.config,...t})}async getAccountOwnedTokens(t){return Lu({aptosConfig:this.config,...t})}async getAccountOwnedTokensFromCollectionAddress(t){return Fu({aptosConfig:this.config,...t})}async getAccountCollectionsWithOwnedTokens(t){return Ku({aptosConfig:this.config,...t})}async getAccountTransactionsCount(t){return Hu({aptosConfig:this.config,...t})}async getAccountCoinsData(t){return $u({aptosConfig:this.config,...t})}async getAccountCoinsCount(t){return Vu({aptosConfig:this.config,...t})}async getAccountOwnedObjects(t){return Qu({aptosConfig:this.config,...t})}async deriveAccountFromPrivateKey(t){return ju({aptosConfig:this.config,...t})}};var dd=gc(fd(),1);async function ld(r){var t;let{params:e,method:n,url:o,headers:s,body:c,overrides:u}=r,p={headers:s,method:n,url:o,params:e,data:c,withCredentials:(t=u?.WITH_CREDENTIALS)!=null?t:!0};try{let y=await(0,dd.default)(p);return{status:y.status,statusText:y.statusText,data:y.data,headers:y.headers,config:y.config}}catch(y){let h=y;if(h.response)return h.response;throw y}}var bo=class{constructor(t){this.network=t?.network??vs,this.fullnode=t?.fullnode,this.faucet=t?.faucet,this.indexer=t?.indexer,this.client=t?.client??{provider:ld},this.clientConfig=t?.clientConfig??{}}getRequestUrl(t){switch(t){case 0:if(this.fullnode!==void 0)return this.fullnode;if(this.network==="custom")throw new Error("Please provide a custom full node url");return Ts[this.network];case 2:if(this.faucet!==void 0)return this.faucet;if(this.network==="custom")throw new Error("Please provide a custom faucet url");return _s[this.network];case 1:if(this.indexer!==void 0)return this.indexer;if(this.network==="custom")throw new Error("Please provide a custom indexer url");return Wo[this.network];default:throw Error(`apiType ${t} is not supported`)}}isIndexerRequest(t){return Wo[this.network]===t}};var wo=class extends Z{constructor(e){super();this.accountAddress=O.ONE;this.moduleName=new Xe("account");this.structName=new Xe("RotationProofChallenge");this.sequenceNumber=new Ye(e.sequenceNumber),this.originator=e.originator,this.currentAuthKey=e.currentAuthKey,this.newPublicKey=Ie.U8(e.newPublicKey.toUint8Array())}serialize(e){e.serialize(this.accountAddress),e.serialize(this.moduleName),e.serialize(this.structName),e.serialize(this.sequenceNumber),e.serialize(this.originator),e.serialize(this.currentAuthKey),e.serialize(this.newPublicKey)}};var pr=class r extends Gt{constructor(e){super();this.signature=e}toUint8Array(){return this.signature.toUint8Array()}toString(){return this.signature.toString()}serialize(e){if(this.signature instanceof Le)e.serializeU32AsUleb128(0),this.signature.serialize(e);else if(this.signature instanceof ur)e.serializeU32AsUleb128(1),this.signature.serialize(e);else throw new Error("Unknown signature type")}static deserialize(e){let n=e.deserializeUleb128AsU32();switch(n){case 0:return new r(Le.load(e));case 1:return new r(ur.load(e));default:throw new Error(`Unknown variant index for AnySignature: ${n}`)}}};async function Da(r){return new Promise(t=>{setTimeout(t,r)})}async function pd(r){let{aptosConfig:t,options:e}=r;return Fr({aptosConfig:t,originMethod:"getTransactions",path:"transactions",params:{start:e?.offset,limit:e?.limit}})}async function Ni(r){let{aptosConfig:t}=r;return Dn(async()=>{let{data:e}=await ht({aptosConfig:t,originMethod:"getGasPriceEstimation",path:"estimate_gas_price"});return e},`gas-price-${t.network}`,1e3*60*5)()}async function gd(r){let{aptosConfig:t,ledgerVersion:e}=r,{data:n}=await ht({aptosConfig:t,originMethod:"getTransactionByVersion",path:`transactions/by_version/${e}`});return n}async function zi(r){let{aptosConfig:t,transactionHash:e}=r,{data:n}=await ht({aptosConfig:t,path:`transactions/by_hash/${e}`,originMethod:"getTransactionByHash"});return n}async function yd(r){let{aptosConfig:t,transactionHash:e}=r;try{return(await zi({aptosConfig:t,transactionHash:e})).type==="pending_transaction"}catch(n){if(n?.status===404)return!0;throw n}}async function Mi(r){let{aptosConfig:t,transactionHash:e,options:n}=r,o=n?.timeoutSecs??co,s=n?.checkSuccess??!0,c=n?.indexerVersionCheck??!0,u=!0,p=0,y,h,x=200,C=1.5;for(;u&&!(p>=o);){try{if(y=await zi({aptosConfig:t,transactionHash:e}),u=y.type==="pending_transaction",!u)break}catch(T){if(!(T instanceof $t)||(h=T,T.status!==404&&T.status>=400&&T.status<500))throw T}await Da(x),p+=x/1e3,x*=C}if(y===void 0)throw h||new To(`Fetching transaction ${e} failed and timed out after ${o} seconds`,y);if(y.type==="pending_transaction")throw new To(`Transaction ${e} timed out in pending state after ${o} seconds`,y);if(!s)return y;if(!y.success)throw new Ga(`Transaction ${e} failed with an error: ${y.vm_status}`,y);if(c)try{await Yg({aptosConfig:t,ledgerVersion:Number(y.version)})}catch{throw new To(`Transaction ${e} committed, but timed out waiting for indexer to sync with ledger version ${y.version}.You can disable this check by setting \`indexerVersionCheck\` to false in the \`extraArgs\` parameter.`,y)}return y}async function Yg(r){let{aptosConfig:t,ledgerVersion:e}=r,n=3e3,o=new Date().getTime(),s=-1;for(;s<e;){if(new Date().getTime()-o>n)throw new Error("waitForLastSuccessIndexerVersionSync timeout");if(s=await Si({aptosConfig:t}),s>=e)break;await Da(200)}}var To=class extends Error{constructor(e,n){super(e);this.lastSubmittedTransaction=n}},Ga=class extends Error{constructor(e,n){super(e);this.transaction=n}};var At=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return gr.load(t);case 1:return Di.load(t);case 2:return jt.load(t);case 3:return Hn.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},gr=class r extends At{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Pe.deserialize(e),o=Le.deserialize(e);return new r(n,o)}},Di=class r extends At{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=qt.deserialize(e),o=Jr.deserialize(e);return new r(n,o)}},jt=class r extends At{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(2),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=je.deserialize(e),o=pr.deserialize(e);return new r(n,o)}},Hn=class r extends At{constructor(e,n,o){super();this.public_keys=e,this.signatures=n,this.signatures_bitmap=o}serialize(e){e.serializeU32AsUleb128(3),this.public_keys.serialize(e),e.serializeVector(this.signatures),e.serializeBytes(this.signatures_bitmap)}static load(e){let n=an.deserialize(e),o=e.deserializeVector(pr),s=e.deserializeBytes();return new r(n,o,s)}};var Wt=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return dn.load(t);case 1:return Gi.load(t);case 2:return ln.load(t);case 3:return pn.load(t);case 4:return gn.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},dn=class r extends Wt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=Pe.deserialize(e),o=Le.deserialize(e);return new r(n,o)}},Gi=class r extends Wt{constructor(e,n){super();this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){let n=qt.deserialize(e),o=Jr.deserialize(e);return new r(n,o)}},ln=class r extends Wt{constructor(e,n,o){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers)}static load(e){let n=At.deserialize(e),o=e.deserializeVector(O),s=e.deserializeVector(At);return new r(n,o,s)}},pn=class r extends Wt{constructor(e,n,o,s){super();this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=o,this.fee_payer=s}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),e.serializeVector(this.secondary_signer_addresses),e.serializeVector(this.secondary_signers),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){let n=At.deserialize(e),o=e.deserializeVector(O),s=e.deserializeVector(At),c=O.deserialize(e),u=At.deserialize(e),p={address:c,authenticator:u};return new r(n,o,s,p)}},gn=class r extends Wt{constructor(e){super();this.sender=e}serialize(e){e.serializeU32AsUleb128(4),this.sender.serialize(e)}static load(e){let n=At.deserialize(e);return new r(n)}};var yn=class r extends Z{constructor(e){super();this.chainId=e}serialize(e){e.serializeU8(this.chainId)}static deserialize(e){let n=e.deserializeU8();return new r(n)}};var ze=class r extends Z{constructor(e){super();this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let n=e.deserializeStr();return new r(n)}};var $n=class r extends Z{constructor(e,n){super();this.address=e,this.name=n}static fromStr(e){let n=e.split("::");if(n.length!==2)throw new Error("Invalid module id.");return new r(O.fromStringRelaxed(n[0]),new ze(n[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){let n=O.deserialize(e),o=ze.deserialize(e);return new r(n,o)}};var Ke=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return hn.load(t);case 1:return mn.load(t);case 2:return bn.load(t);case 3:return wn.load(t);case 4:return _n.load(t);case 5:return zr.load(t);case 6:return Sn.load(t);case 7:return yr.load(t);case 8:return xn.load(t);case 9:return An.load(t);case 10:return Tn.load(t);case 255:return vn.load(t);default:throw new Error(`Unknown variant index for TypeTag: ${e}`)}}isBool(){return this instanceof hn}isAddress(){return this instanceof _n}isGeneric(){return this instanceof vn}isSigner(){return this instanceof zr}isVector(){return this instanceof Sn}isStruct(){return this instanceof yr}isU8(){return this instanceof mn}isU16(){return this instanceof xn}isU32(){return this instanceof An}isU64(){return this instanceof bn}isU128(){return this instanceof wn}isU256(){return this instanceof Tn}},hn=class r extends Ke{toString(){return"bool"}serialize(t){t.serializeU32AsUleb128(0)}static load(t){return new r}},mn=class r extends Ke{toString(){return"u8"}serialize(t){t.serializeU32AsUleb128(1)}static load(t){return new r}},xn=class r extends Ke{toString(){return"u16"}serialize(t){t.serializeU32AsUleb128(8)}static load(t){return new r}},An=class r extends Ke{toString(){return"u32"}serialize(t){t.serializeU32AsUleb128(9)}static load(t){return new r}},bn=class r extends Ke{toString(){return"u64"}serialize(t){t.serializeU32AsUleb128(2)}static load(t){return new r}},wn=class r extends Ke{toString(){return"u128"}serialize(t){t.serializeU32AsUleb128(3)}static load(t){return new r}},Tn=class r extends Ke{toString(){return"u256"}serialize(t){t.serializeU32AsUleb128(10)}static load(t){return new r}},_n=class r extends Ke{toString(){return"address"}serialize(t){t.serializeU32AsUleb128(4)}static load(t){return new r}},zr=class r extends Ke{toString(){return"signer"}serialize(t){t.serializeU32AsUleb128(5)}static load(t){return new r}},_o=class r extends Ke{constructor(e){super();this.value=e}toString(){return`&${this.value.toString()}`}serialize(e){e.serializeU32AsUleb128(254)}static load(e){let n=Ke.deserialize(e);return new r(n)}},vn=class r extends Ke{constructor(e){super();this.value=e}toString(){return`T${this.value}`}serialize(e){e.serializeU32AsUleb128(255),e.serializeU32(this.value)}static load(e){let n=e.deserializeU32();return new r(n)}},Sn=class r extends Ke{constructor(e){super();this.value=e}toString(){return`vector<${this.value.toString()}>`}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let n=Ke.deserialize(e);return new r(n)}},yr=class r extends Ke{constructor(e){super();this.value=e}toString(){let e="";return this.value.typeArgs.length>0&&(e=`<${this.value.typeArgs.map(n=>n.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${e}`}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let n=Yt.deserialize(e);return new r(n)}isTypeTag(e,n,o){return this.value.moduleName.identifier===n&&this.value.name.identifier===o&&this.value.address.equals(e)}isString(){return this.isTypeTag(O.ONE,"string","String")}isOption(){return this.isTypeTag(O.ONE,"option","Option")}isObject(){return this.isTypeTag(O.ONE,"object","Object")}},Yt=class r extends Z{constructor(e,n,o,s){super();this.address=e,this.moduleName=n,this.name=o,this.typeArgs=s}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let n=O.deserialize(e),o=ze.deserialize(e),s=ze.deserialize(e),c=e.deserializeVector(Ke);return new r(n,o,s,c)}};function Xg(){return new Yt(O.ONE,new ze("aptos_coin"),new ze("AptosCoin"),[])}function Zg(){return new Yt(O.ONE,new ze("string"),new ze("String"),[])}function Jg(r){return new Yt(O.ONE,new ze("option"),new ze("Option"),[r])}function ey(r){return new Yt(O.ONE,new ze("object"),new ze("Object"),[r])}function hd(r){let t=r.deserializeUleb128AsU32();switch(t){case 0:return st.deserialize(r);case 1:return Ye.deserialize(r);case 2:return Bt.deserialize(r);case 3:return O.deserialize(r);case 4:return Ie.deserialize(r,st);case 5:return qe.deserialize(r);case 6:return Ct.deserialize(r);case 7:return Ut.deserialize(r);case 8:return It.deserialize(r);default:throw new Error(`Unknown variant index for ScriptTransactionArgument: ${t}`)}}var Mr=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return Vn.load(t);case 2:return Qn.load(t);case 3:return jn.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},Vn=class r extends Mr{constructor(e){super();this.script=e}serialize(e){e.serializeU32AsUleb128(0),this.script.serialize(e)}static load(e){let n=Wn.deserialize(e);return new r(n)}},Qn=class r extends Mr{constructor(e){super();this.entryFunction=e}serialize(e){e.serializeU32AsUleb128(2),this.entryFunction.serialize(e)}static load(e){let n=En.deserialize(e);return new r(n)}},jn=class r extends Mr{constructor(e){super();this.multiSig=e}serialize(e){e.serializeU32AsUleb128(3),this.multiSig.serialize(e)}static load(e){let n=Yn.deserialize(e);return new r(n)}},En=class r{constructor(t,e,n,o){this.module_name=t,this.function_name=e,this.type_args=n,this.args=o}static build(t,e,n,o){return new r($n.fromStr(t),new ze(e),n,o)}serialize(t){this.module_name.serialize(t),this.function_name.serialize(t),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForEntryFunction(t)})}static deserialize(t){let e=$n.deserialize(t),n=ze.deserialize(t),o=t.deserializeVector(Ke),s=t.deserializeUleb128AsU32(),c=new Array;for(let u=0;u<s;u+=1){let p=t.deserializeUleb128AsU32(),y=lo.deserialize(t,p);c.push(y)}return new r(e,n,o,c)}},Wn=class r{constructor(t,e,n){this.bytecode=t,this.type_args=e,this.args=n}serialize(t){t.serializeBytes(this.bytecode),t.serializeVector(this.type_args),t.serializeU32AsUleb128(this.args.length),this.args.forEach(e=>{e.serializeForScriptFunction(t)})}static deserialize(t){let e=t.deserializeBytes(),n=t.deserializeVector(Ke),o=t.deserializeUleb128AsU32(),s=new Array;for(let c=0;c<o;c+=1){let u=hd(t);s.push(u)}return new r(e,n,s)}},Yn=class r{constructor(t,e){this.multisig_address=t,this.transaction_payload=e}serialize(t){this.multisig_address.serialize(t),this.transaction_payload===void 0?t.serializeBool(!1):(t.serializeBool(!0),this.transaction_payload.serialize(t))}static deserialize(t){let e=O.deserialize(t),n=t.deserializeBool(),o;return n&&(o=Xn.deserialize(t)),new r(e,o)}},Xn=class r{constructor(t){this.transaction_payload=t}serialize(t){t.serializeU32AsUleb128(0),this.transaction_payload.serialize(t)}static deserialize(t){return t.deserializeUleb128AsU32(),new r(En.deserialize(t))}};var Xt=class r extends Z{constructor(e,n,o,s,c,u,p){super();this.sender=e,this.sequence_number=n,this.payload=o,this.max_gas_amount=s,this.gas_unit_price=c,this.expiration_timestamp_secs=u,this.chain_id=p}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){let n=O.deserialize(e),o=e.deserializeU64(),s=Mr.deserialize(e),c=e.deserializeU64(),u=e.deserializeU64(),p=e.deserializeU64(),y=yn.deserialize(e);return new r(n,o,s,c,u,p,y)}},vo=class extends Z{static deserialize(t){let e=t.deserializeUleb128AsU32();switch(e){case 0:return hr.load(t);case 1:return mr.load(t);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},hr=class r extends vo{constructor(e,n){super();this.raw_txn=e,this.secondary_signer_addresses=n}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses)}static load(e){let n=Xt.deserialize(e),o=e.deserializeVector(O);return new r(n,o)}},mr=class r extends vo{constructor(e,n,o){super();this.raw_txn=e,this.secondary_signer_addresses=n,this.fee_payer_address=o}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),e.serializeVector(this.secondary_signer_addresses),this.fee_payer_address.serialize(e)}static load(e){let n=Xt.deserialize(e),o=e.deserializeVector(O),s=O.deserialize(e);return new r(n,o,s)}};var Ht=class r extends Z{constructor(e,n){super();this.raw_txn=e,this.authenticator=n}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){let n=Xt.deserialize(e),o=Wt.deserialize(e);return new r(n,o)}};function md(r){return!!r.match(/^[_a-zA-Z0-9]+$/)}function xd(r){return!!r.match(/\s/)}function ty(r){return!!r.match(/^T[0-9]+$/)}function ry(r,t){let e=t;for(;e<r.length;e+=1){let n=r[e];if(!xd(n))break}return e}var Ad=(C=>(C.InvalidTypeTag="unknown type",C.UnexpectedGenericType="unexpected generic type",C.UnexpectedTypeArgumentClose="unexpected '>'",C.UnexpectedWhitespaceCharacter="unexpected whitespace character",C.UnexpectedComma="unexpected ','",C.TypeArgumentCountMismatch="type argument count doesn't match expected amount",C.MissingTypeArgumentClose="no matching '>' for '<'",C.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",C.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",C.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",C.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",C.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",C))(Ad||{}),ke=class extends Error{constructor(t,e){super(`Failed to parse typeTag '${t}', ${e}`)}};function Zn(r,t){let e=t?.allowGenerics??!1,n=[],o=[],s=[],c=0,u="",p=1;for(;c<r.length;){let y=r[c];if(y==="<")n.push({savedExpectedTypes:p,savedStr:u,savedTypes:s}),u="",s=[],p=1;else if(y===">"){if(u!==""){let z=qi(u,o,e);s.push(z)}let h=n.pop();if(h===void 0)throw new ke(r,"unexpected '>'");if(p!==s.length)throw new ke(r,"type argument count doesn't match expected amount");let{savedStr:x,savedTypes:C,savedExpectedTypes:T}=h;o=s,s=C,u=x,p=T}else if(y===","){if(u.length!==0){let h=qi(u,o,e);o=[],s.push(h),u="",p+=1}}else if(xd(y)){let h=!1;if(u.length!==0){let C=qi(u,o,e);o=[],s.push(C),u="",h=!0}c=ry(r,c);let x=r[c];if(c<r.length&&h&&x!==","&&x!==">")throw new ke(r,"unexpected whitespace character");continue}else u+=y;c+=1}if(n.length>0)throw new ke(r,"no matching '>' for '<'");switch(s.length){case 0:return qi(u,o,e);case 1:if(u==="")return s[0];throw new ke(r,"unexpected ','");default:throw new ke(r,"unexpected whitespace character")}}function qi(r,t,e){switch(r){case"&signer":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new _o(new zr);case"signer":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new zr;case"bool":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new hn;case"address":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new _n;case"u8":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new mn;case"u16":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new xn;case"u32":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new An;case"u64":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new bn;case"u128":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new wn;case"u256":if(t.length>0)throw new ke(r,"primitive types not expected to have type arguments");return new Tn;case"vector":if(t.length!==1)throw new ke(r,"vector type expected to have exactly one type argument");return new Sn(t[0]);default:if(ty(r)){if(e)return new vn(Number(r.split("T")[1]));throw new ke(r,"unexpected generic type")}if(!r.match(/.*:.*/))throw new ke(r,"unknown type");let n=r.split("::");if(n.length!==3)throw new ke(r,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");if(!md(n[1]))throw new ke(r,"module name must only contain alphanumeric or '_' characters");if(!md(n[2]))throw new ke(r,"struct name must only contain alphanumeric or '_' characters");return new yr(new Yt(O.fromStringRelaxed(n[0]),new ze(n[1]),new ze(n[2]),t))}}function qa(r){return typeof r=="boolean"}function Cn(r){return typeof r=="string"}function So(r){return typeof r=="number"}function Eo(r){return typeof r=="number"||typeof r=="bigint"||typeof r=="string"}function La(r){return r==null}function Li(r){return r instanceof qe}function Co(r){return r instanceof O}function Fi(r){return r instanceof Xe}function Fa(r){return r instanceof Sr}function Ki(r){return r instanceof st}function Hi(r){return r instanceof Ct}function $i(r){return r instanceof Ut}function Vi(r){return r instanceof Ye}function Qi(r){return r instanceof Bt}function ji(r){return r instanceof It}function Wi(r){return"bytecode"in r}function Ne(r,t){throw new Error(`Type mismatch for argument ${t}, expected '${r}'`)}function Ka(r){let t=r.params.findIndex(e=>e!=="signer"&&e!=="&signer");return t<0?r.params.length:t}function Yi(r){let t=r.split("::");if(t.length!==3)throw new Error(`Invalid function ${r}`);let e=t[0],n=t[1],o=t[2];return{moduleAddress:e,moduleName:n,functionName:o}}function Ha(r){return r?.map(t=>Cn(t)?Zn(t):t)??[]}async function $a(r,t,e,n){let s=(await Ei({aptosConfig:n,accountAddress:r,moduleName:t})).abi?.exposed_functions.find(p=>p.name===e);if(!s)throw new Error(`Could not find entry function ABI for '${r}::${t}::${e}'`);if(!s.is_entry)throw new Error(`'${r}::${t}::${e}' is not an entry function`);let c=Ka(s),u=[];for(let p=c;p<s.params.length;p+=1)u.push(Zn(s.params[p],{allowGenerics:!0}));return{typeParameters:s.generic_type_params,parameters:u}}function Va(r,t,e,n,o){if(n>=t.parameters.length)throw new Error(`Too many arguments for '${r}', expected ${t.parameters.length}`);return Li(e)||Ki(e)||Hi(e)||$i(e)||Vi(e)||Qi(e)||ji(e)||Co(e)||Fi(e)||Fa(e)||e instanceof Ie||e instanceof Er?(ny(t,e,n),e):Xi(e,t.parameters[n],n,o)}function Xi(r,t,e,n){if(t.isBool()){if(qa(r))return new qe(r);Ne("boolean",e)}if(t.isAddress()){if(Cn(r))return O.fromStringRelaxed(r);Ne("string",e)}if(t.isU8()){if(So(r))return new st(r);Ne("number",e)}if(t.isU16()){if(So(r))return new Ct(r);Ne("number",e)}if(t.isU32()){if(So(r))return new Ut(r);Ne("number",e)}if(t.isU64()){if(Eo(r))return new Ye(BigInt(r));Ne("bigint | number | string",e)}if(t.isU128()){if(Eo(r))return new Bt(BigInt(r));Ne("bigint | number | string",e)}if(t.isU256()){if(Eo(r))return new It(BigInt(r));Ne("bigint | number | string",e)}if(t.isGeneric()){let o=t.value;if(o<0||o>=n.length)throw new Error(`Generic argument ${t.toString()} is invalid for argument ${e}`);Xi(r,n[o],e,n)}if(t.isVector()){if(t.value.isU8()&&Cn(r))return Ie.U8(me.fromHexInput(r).toUint8Array());if(Array.isArray(r))return new Ie(r.map(o=>Xi(o,t.value,e,n)));throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}if(t.isStruct()){if(t.isString()){if(Cn(r))return new Xe(r);Ne("string",e)}if(t.isObject()){if(Cn(r))return O.fromStringRelaxed(r);Ne("string",e)}if(t.isOption())return La(r)?new Er(null):new Er(Xi(r,t.value.typeArgs[0],e,n));throw new Error(`Unsupported struct input type for argument ${e}, type '${t.toString()}'`)}throw new Error(`Type mismatch for argument ${e}, type '${t.toString()}'`)}function ny(r,t,e){let n=r.parameters[e];if(n.isBool()){if(Li(t))return;Ne("Bool",e)}if(n.isAddress()){if(Co(t))return;Ne("AccountAddress",e)}if(n.isU8()){if(Ki(t))return;Ne("U8",e)}if(n.isU16()){if(Hi(t))return;Ne("U16",e)}if(n.isU32()){if($i(t))return;Ne("U32",e)}if(n.isU64()){if(Vi(t))return;Ne("U64",e)}if(n.isU128()){if(Qi(t))return;Ne("U128",e)}if(n.isU256()){if(ji(t))return;Ne("U256",e)}if(n.isVector()){if(t instanceof Ie)return;Ne("MoveVector",e)}if(n instanceof yr){if(n.isString()){if(Fi(t))return;Ne("MoveString",e)}if(n.isObject()){if(Co(t))return;Ne("AccountAddress",e)}if(n.isOption()){if(t instanceof Er)return;Ne("MoveOption",e)}}throw new Error(`Type mismatch for argument ${e}, expected '${n.toString()}'`)}async function Bo(r){if(Wi(r))return wd(r);let{moduleAddress:t,moduleName:e,functionName:n}=Yi(r.function),o=await Dn(async()=>$a(t,e,n,r.aptosConfig),`entry-function-${r.aptosConfig.network}-${t}-${e}-${n}`,1e3*60*5)();return bd(r,o)}function bd(r,t){if(Wi(r))return wd(r);let{moduleAddress:e,moduleName:n,functionName:o}=Yi(r.function),s=Ha(r.typeArguments);if(s.length!==t.typeParameters.length)throw new Error(`Type argument count mismatch, expected ${t.typeParameters.length}, received ${s.length}`);let c=r.functionArguments.map((p,y)=>Va(r.function,t,p,y,s));if(c.length!==t.parameters.length)throw new Error(`Too few arguments for '${e}::${n}::${o}', expected ${t.parameters.length} but got ${c.length}`);let u=En.build(`${e}::${n}`,o,s,c);if("multisigAddress"in r){let p;return typeof r.multisigAddress=="string"?p=O.from(r.multisigAddress):p=r.multisigAddress,new jn(new Yn(p,new Xn(u)))}return new Qn(u)}function wd(r){return new Vn(new Wn(me.fromHexInput(r.bytecode).toUint8Array(),r.typeArguments??[],r.functionArguments))}async function Td(r){let{aptosConfig:t,sender:e,payload:n,options:o}=r,s=o?.accountSequenceNumber?Promise.resolve({sequence_number:o.accountSequenceNumber}):cn({aptosConfig:t,accountAddress:e}),c=Yo[t.network]?Promise.resolve({chain_id:Yo[t.network]}):_i({aptosConfig:t}),u=o?.gasUnitPrice?Promise.resolve({gas_estimate:o.gasUnitPrice}):Ni({aptosConfig:t}),[{sequence_number:p},{chain_id:y},{gas_estimate:h}]=await Promise.all([s,c,u]),{maxGasAmount:x,gasUnitPrice:C,expireTimestamp:T}={maxGasAmount:o?.maxGasAmount?BigInt(o.maxGasAmount):BigInt(Ss),gasUnitPrice:BigInt(h),expireTimestamp:BigInt(Math.floor(Date.now()/1e3)+Es),...o};return new Xt(O.fromRelaxed(e),BigInt(p),n,BigInt(x),BigInt(C),BigInt(T),new yn(y))}async function Zi(r){let{aptosConfig:t,sender:e,payload:n,options:o}=r,s=await Td({aptosConfig:t,sender:e,payload:n,options:o});if("secondarySignerAddresses"in r){let c=r.secondarySignerAddresses?.map(u=>O.fromRelaxed(u))??[];return{rawTransaction:s,secondarySignerAddresses:c,feePayerAddress:r.feePayerAddress?O.fromRelaxed(r.feePayerAddress):void 0}}return{rawTransaction:s,feePayerAddress:r.feePayerAddress?O.fromRelaxed(r.feePayerAddress):void 0}}function Qa(r){let{signerPublicKey:t,transaction:e,secondarySignersPublicKeys:n,feePayerPublicKey:o}=r,s=Uo(t);if(e.feePayerAddress){let u=new mr(e.rawTransaction,e.secondarySignerAddresses??[],e.feePayerAddress),p=[];n&&(p=n.map(x=>Uo(x)));let y=Uo(o),h=new pn(s,e.secondarySignerAddresses??[],p,{address:e.feePayerAddress,authenticator:y});return new Ht(u.raw_txn,h).bcsToBytes()}if(e.secondarySignerAddresses){let u=new hr(e.rawTransaction,e.secondarySignerAddresses),p=[];p=n.map(h=>Uo(h));let y=new ln(s,e.secondarySignerAddresses,p);return new Ht(u.raw_txn,y).bcsToBytes()}let c;if(s instanceof gr)c=new dn(s.public_key,s.signature);else if(s instanceof jt)c=new gn(s);else throw new Error("Invalid public key");return new Ht(e.rawTransaction,c).bcsToBytes()}function Uo(r){if(r instanceof je){if(r.publicKey instanceof Pe)return new jt(r,new pr(new Le(new Uint8Array(64))));if(r.publicKey instanceof Lt)return new jt(r,new pr(new ur(new Uint8Array(64))))}return new gr(new Pe(r.toUint8Array()),new Le(new Uint8Array(64)))}function ja(r){let{signer:t,transaction:e}=r,n=Ya(e),o=vd(n),s=t.sign(o);switch(t.signingScheme){case 0:return new gr(new Pe(t.publicKey.toUint8Array()),new Le(s.toUint8Array()));case 2:return new jt(t.publicKey,new pr(s));default:throw new Error(`Cannot sign transaction, signing scheme ${t.signingScheme} not supported`)}}function Wa(r){let{transaction:t,senderAuthenticator:e,feePayerAuthenticator:n,additionalSignersAuthenticators:o}=r,s=Ya(t);if(n||o)return _d(s,e,n,o);if(e instanceof gr){let c=new dn(e.public_key,e.signature);return new Ht(s,c).bcsToBytes()}if(e instanceof jt||e instanceof Hn){let c=new gn(e);return new Ht(s,c).bcsToBytes()}throw new Error(`Cannot generate a signed transaction, ${e} is not a supported account authentication scheme`)}function Ya(r){return r.feePayerAddress?new mr(r.rawTransaction,r.secondarySignerAddresses??[],r.feePayerAddress):r.secondarySignerAddresses?new hr(r.rawTransaction,r.secondarySignerAddresses):r.rawTransaction}function _d(r,t,e,n){if(r instanceof mr){if(!e)throw new Error("Must provide a feePayerAuthenticator argument to generate a signed fee payer transaction");let o=new pn(t,r.secondary_signer_addresses,n??[],{address:r.fee_payer_address,authenticator:e});return new Ht(r.raw_txn,o).bcsToBytes()}if(r instanceof hr){if(!n)throw new Error("Must provide a additionalSignersAuthenticators argument to generate a signed multi agent transaction");let o=new ln(t,r.secondary_signer_addresses,n??[]);return new Ht(r.raw_txn,o).bcsToBytes()}throw new Error(`Cannot prepare multi signers transaction to submission, ${typeof r} transaction is not supported`)}function vd(r){let t=jr.create();if(r instanceof Xt)t.update(Us);else if(r instanceof hr)t.update(Xo);else if(r instanceof mr)t.update(Xo);else throw new Error(`Unknown transaction type to sign on: ${r}`);let e=t.digest(),n=r.bcsToBytes(),o=new Uint8Array(e.length+n.length);return o.set(e),o.set(n,e.length),o}async function at(r){let{aptosConfig:t,sender:e,data:n,options:o}=r,s,c;"bytecode"in n?(s=n,c=await Bo(s)):"multisigAddress"in n?(s={aptosConfig:t,multisigAddress:n.multisigAddress,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments},c=await Bo(s)):(s={aptosConfig:t,function:n.function,functionArguments:n.functionArguments,typeArguments:n.typeArguments},c=await Bo(s));let u;if(oy(r)&&(u=O.ZERO.toString()),iy(r)){let{secondarySignerAddresses:p}=r;return Zi({aptosConfig:t,sender:e,payload:c,options:o,secondarySignerAddresses:p,feePayerAddress:u})}return Zi({aptosConfig:t,sender:e,payload:c,options:o,feePayerAddress:u})}function oy(r){return r.withFeePayer===!0}function iy(r){return"secondarySignerAddresses"in r}function Ji(r){return ja({...r})}async function Xa(r){let{aptosConfig:t,transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:c}=r,u=Qa({transaction:e,signerPublicKey:n,secondarySignersPublicKeys:o,feePayerPublicKey:s,options:c}),{data:p}=await Kr({aptosConfig:t,body:u,path:"transactions/simulate",params:{estimate_gas_unit_price:r.options?.estimateGasUnitPrice??!1,estimate_max_gas_amount:r.options?.estimateMaxGasAmount??!1,estimate_prioritized_gas_unit_price:r.options?.estimatePrioritizedGasUnitPrice??!1},originMethod:"simulateTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return p}async function es(r){let{aptosConfig:t}=r,e=Wa({...r}),{data:n}=await Kr({aptosConfig:t,body:e,path:"transactions",originMethod:"submitTransaction",contentType:"application/x.aptos.signed_transaction+bcs"});return n}async function Za(r){let{aptosConfig:t,signer:e,transaction:n}=r,o=Ji({signer:e,transaction:n});return es({aptosConfig:t,transaction:n,senderAuthenticator:o})}async function Sd(r){let{aptosConfig:t,account:e,metadataBytes:n,moduleBytecode:o,options:s}=r,c=o.map(p=>Ie.U8(p));return await at({aptosConfig:t,sender:O.fromRelaxed(e),data:{function:"0x1::code::publish_package_txn",functionArguments:[Ie.U8(n),new Ie(c)]},options:s})}async function Ed(r){let{aptosConfig:t,fromAccount:e,toNewPrivateKey:n}=r,o=await cn({aptosConfig:t,accountAddress:e.accountAddress.toString()}),s=dr.fromPrivateKey({privateKey:n,legacy:!0}),u=new wo({sequenceNumber:BigInt(o.sequence_number),originator:e.accountAddress,currentAuthKey:O.from(o.authentication_key),newPublicKey:s.publicKey}).bcsToBytes(),p=e.sign(u),y=s.sign(u),h=await at({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:"0x1::account::rotate_authentication_key",functionArguments:[new st(e.signingScheme.valueOf()),Ie.U8(e.publicKey.toUint8Array()),new st(s.signingScheme.valueOf()),Ie.U8(s.publicKey.toUint8Array()),Ie.U8(p.toUint8Array()),Ie.U8(y.toUint8Array())]}});return await Za({aptosConfig:t,signer:e,transaction:h})}async function Cd(r){let{aptosConfig:t,sender:e,recipient:n,amount:o,coinType:s,options:c}=r,u=s??Cs;return await at({aptosConfig:t,sender:e.accountAddress,data:{function:"0x1::aptos_account::transfer_coins",typeArguments:[Zn(u)],functionArguments:[O.from(n),new Ye(o)]},options:c})}var Io=class{constructor(t){this.config=t}async transferCoinTransaction(t){return Cd({aptosConfig:this.config,...t})}};async function Ud(r){let{aptosConfig:t,options:e,creator:n}=r;return await at({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::mint",functionArguments:[new Xe(r.collection),new Xe(r.description),new Xe(r.name),new Xe(r.uri),Ie.MoveString([]),Ie.MoveString([]),new Ie([])]},options:e})}async function Bd(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:O.from(e).toStringLong()}};return(await xe({aptosConfig:t,query:{query:Ru,variables:{where_condition:n}},originMethod:"getTokenData"})).current_token_datas_v2[0]}async function Id(r){let{aptosConfig:t,tokenAddress:e}=r,n={token_data_id:{_eq:O.from(e).toStringLong()}};return(await xe({aptosConfig:t,query:{query:la,variables:{where_condition:n}},originMethod:"getCurrentTokenOwnership"})).current_token_ownerships_v2[0]}async function Rd(r){let{aptosConfig:t,ownerAddress:e,options:n}=r,o={owner_address:{_eq:O.from(e).toStringLong()}},s={query:la,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await xe({aptosConfig:t,query:s,originMethod:"getOwnedTokens"})).current_token_ownerships_v2}async function Pd(r){let{aptosConfig:t,tokenAddress:e,options:n}=r,o={token_data_id:{_eq:O.from(e).toStringLong()}},s={query:Iu,variables:{where_condition:o,offset:n?.pagination?.offset,limit:n?.pagination?.limit,order_by:n?.orderBy}};return(await xe({aptosConfig:t,query:s,originMethod:"getTokenActivity"})).token_activities_v2}async function Od(r){let{aptosConfig:t,options:e,creator:n}=r;return await at({aptosConfig:t,sender:n.accountAddress,data:{function:"0x4::aptos_token::create_collection",functionArguments:[new Xe(r.description),new Ye(r.maxSupply??Vr),new Xe(r.name),new Xe(r.uri),new qe(r.mutableDescription??!0),new qe(r.mutableRoyalty??!0),new qe(r.mutableURI??!0),new qe(r.mutableTokenDescription??!0),new qe(r.mutableTokenName??!0),new qe(r.mutableTokenProperties??!0),new qe(r.mutableTokenURI??!0),new qe(r.tokensBurnableByCreator??!0),new qe(r.tokensFreezableByCreator??!0),new Ye(r.royaltyNumerator??0),new Ye(r.royaltyDenominator??1)]},options:e})}async function Ja(r){let{aptosConfig:t,creatorAddress:e,collectionName:n,options:o}=r,s=O.from(e),c={collection_name:{_eq:n},creator_address:{_eq:s.toStringLong()}};return o?.tokenStandard&&(c.token_standard={_eq:o?.tokenStandard??"v2"}),(await xe({aptosConfig:t,query:{query:_u,variables:{where_condition:c}},originMethod:"getCollectionData"})).current_collections_v2[0]}async function kd(r){return(await Ja(r)).collection_id}var Ro=class{constructor(t){this.config=t}async createCollectionTransaction(t){return Od({aptosConfig:this.config,...t})}async getCollectionData(t){return Ja({aptosConfig:this.config,...t})}async getCollectionId(t){return kd({aptosConfig:this.config,...t})}async mintTokenTransaction(t){return Ud({aptosConfig:this.config,...t})}async getTokenData(t){return Bd({aptosConfig:this.config,...t})}async getCurrentTokenOwnership(t){return Id({aptosConfig:this.config,...t})}async getOwnedTokens(t){return Rd({aptosConfig:this.config,...t})}async getTokenActivity(t){return Pd({aptosConfig:this.config,...t})}};async function Nd(r){let{accountAddress:t,aptosConfig:e,creationNumber:n}=r,s={account_address:{_eq:O.from(t).toStringLong()},creation_number:{_eq:n}};return ts({aptosConfig:e,options:{where:s}})}async function zd(r){let{accountAddress:t,aptosConfig:e,eventType:n,options:o}=r,u={where:{account_address:{_eq:O.fromRelaxed(t).toStringLong()},indexed_type:{_eq:n}},pagination:o?.pagination,orderBy:o?.orderBy};return ts({aptosConfig:e,options:u})}async function ts(r){let{aptosConfig:t,options:e}=r,n={query:Eu,variables:{where_condition:e?.where,offset:e?.pagination?.offset,limit:e?.pagination?.limit,order_by:e?.orderBy}};return(await xe({aptosConfig:t,query:n,originMethod:"getEvents"})).events}var Po=class{constructor(t){this.config=t}async getAccountEventsByCreationNumber(t){return Nd({aptosConfig:this.config,...t})}async getAccountEventsByEventType(t){return zd({aptosConfig:this.config,...t})}async getEvents(t){return ts({aptosConfig:this.config,...t})}};async function Md(r){let{aptosConfig:t,accountAddress:e,amount:n,options:o}=r,s=o?.timeoutSecs||co,{data:c}=await Is({aptosConfig:t,path:"fund",body:{address:O.fromRelaxed(e).toString(),amount:n},originMethod:"fundAccount"}),u=c.txn_hashes[0];return await Mi({aptosConfig:t,transactionHash:u,options:{timeoutSecs:s,checkSuccess:o?.checkSuccess,indexerVersionCheck:o?.indexerVersionCheck}}),u}var Oo=class{constructor(t){this.config=t}async fundAccount(t){return Md({aptosConfig:this.config,...t})}};async function ec(r){let{aptosConfig:t,options:e}=r,n={query:Uu,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await xe({aptosConfig:t,query:n,originMethod:"getFungibleAssetMetadata"})).fungible_asset_metadata}async function Dd(r){let{aptosConfig:t,options:e}=r,n={query:Cu,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await xe({aptosConfig:t,query:n,originMethod:"getFungibleAssetActivities"})).fungible_asset_activities}async function Gd(r){let{aptosConfig:t,options:e}=r,n={query:vu,variables:{where_condition:e?.where,limit:e?.pagination?.limit,offset:e?.pagination?.offset}};return(await xe({aptosConfig:t,query:n,originMethod:"getCurrentFungibleAssetBalances"})).current_fungible_asset_balances}var ko=class{constructor(t){this.config=t}async getFungibleAssetMetadata(t){return ec({aptosConfig:this.config,...t})}async getFungibleAssetMetadataByAssetType(t){return(await ec({aptosConfig:this.config,options:{where:{asset_type:{_eq:t}}}}))[0]}async getFungibleAssetActivities(t){return Dd({aptosConfig:this.config,...t})}async getCurrentFungibleAssetBalances(t){return Gd({aptosConfig:this.config,...t})}};var No=class{constructor(t){this.config=t}async getLedgerInfo(){return _i({aptosConfig:this.config})}async getChainId(){return(await this.getLedgerInfo()).chain_id}async getBlockByVersion(t){return Pu({aptosConfig:this.config,...t})}async getBlockByHeight(t){return Ou({aptosConfig:this.config,...t})}async getTableItem(t){return vi({aptosConfig:this.config,...t})}async view(t){return kr({aptosConfig:this.config,...t})}async getChainTopUserTransactions(t){return ku({aptosConfig:this.config,...t})}async queryIndexer(t){return xe({aptosConfig:this.config,...t})}async getIndexerLastSuccessVersion(){return Si({aptosConfig:this.config})}};var qd=["A name must be between 3 and 63 characters long,","and can only contain lowercase a-z, 0-9, and hyphens.","A name may not start or end with a hyphen."].join(" ");function Ld(r){return!(!r||r.length<3||r.length>63||!/^[a-z\d][a-z\d-]{1,61}[a-z\d]$/.test(r))}function Dr(r){let[t,e,...n]=r.replace(/\.apt$/,"").split(".");if(n.length>0)throw new Error(`${r} is invalid. A name can only have two parts, a domain and a subdomain separated by a "."`);if(!Ld(t))throw new Error(`${t} is not valid. ${qd}`);if(e&&!Ld(e))throw new Error(`${e} is not valid. ${qd}`);return{domainName:e||t,subdomainName:e?t:void 0}}var sy="0x585fc9f0f0c54183b039ffc770ca282ebd87307916c215a3e692f2f8e4305e82",ay={testnet:"0x5f8fd2347449685cf41d4db97926ec3a096eaf381332be4f1318ad4d16a8497c",mainnet:"0x867ed1f6bf916171b1de3ee92849b8978b7d1b9e0a8cc982a3d19d535dfd9c0c",local:sy,custom:null,devnet:null};function xr(r){let t=ay[r.network];if(!t)throw new Error(`The ANS contract is not deployed to ${r.network}`);return t}var cy=r=>({vec:[r]}),uy=()=>({vec:[]}),tc=r=>r!=null?cy(r):uy(),rs=r=>{if(r&&typeof r=="object"&&"vec"in r&&Array.isArray(r.vec))return r.vec[0]};async function Fd(r){let{aptosConfig:t,name:e}=r,n=xr(t),{domainName:o,subdomainName:s}=Dr(e),c=await kr({aptosConfig:t,payload:{function:`${n}::router::get_owner_addr`,functionArguments:[o,tc(s)]}}),u=rs(c[0]);return u?O.fromRelaxed(u).toString():void 0}async function Kd(r){let{aptosConfig:t,expiration:e,name:n,sender:o,targetAddress:s,toAddress:c,options:u,transferable:p}=r,y=xr(t),{domainName:h,subdomainName:x}=Dr(n),C=e.policy==="subdomain:independent"||e.policy==="subdomain:follow-domain";if(x&&!C)throw new Error("Subdomains must have an expiration policy of either 'subdomain:independent' or 'subdomain:follow-domain'");if(C&&!x)throw new Error(`Policy is set to ${e.policy} but no subdomain was provided`);if(e.policy==="domain"){let I=e.years??1;if(I!==1)throw new Error("For now, names can only be registered for 1 year at a time");let $=I*31536e3;return await at({aptosConfig:t,sender:o.accountAddress.toString(),data:{function:`${y}::router::register_domain`,functionArguments:[h,$,s,c]},options:u})}if(!x)throw new Error(`${e.policy} requires a subdomain to be provided.`);let T=await rc({aptosConfig:t,name:h});if(!T)throw new Error("The domain does not exist");T*=1e3;let z=e.policy==="subdomain:independent"?e.expirationDate.valueOf():T;if(z>T)throw new Error("The subdomain expiration time cannot be greater than the domain expiration time");return await at({aptosConfig:t,sender:o.accountAddress.toString(),data:{function:`${y}::router::register_subdomain`,functionArguments:[h,x,Math.round(z/1e3),e.policy==="subdomain:follow-domain"?1:0,!!p,s,c]},options:u})}async function rc(r){let{aptosConfig:t,name:e}=r,n=xr(t),{domainName:o,subdomainName:s}=Dr(e);try{return(await kr({aptosConfig:t,payload:{function:`${n}::router::get_expiration`,functionArguments:[o,tc(s)]}}))[0]}catch{return}}async function Hd(r){let{aptosConfig:t,address:e}=r,n=xr(t),o=await kr({aptosConfig:t,payload:{function:`${n}::router::get_primary_name`,functionArguments:[O.fromRelaxed(e).toString()]}}),s=rs(o[1]),c=rs(o[0]);if(s)return[c,s].filter(Boolean).join(".")}async function $d(r){let{aptosConfig:t,sender:e,name:n,options:o}=r,s=xr(t);if(!n)return await at({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:`${s}::router::clear_primary_name`,functionArguments:[]},options:o});let{domainName:c,subdomainName:u}=Dr(n);return await at({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:`${s}::router::set_primary_name`,functionArguments:[c,u]},options:o})}async function Vd(r){let{aptosConfig:t,name:e}=r,n=xr(t),{domainName:o,subdomainName:s}=Dr(e),c=await kr({aptosConfig:t,payload:{function:`${n}::router::get_target_addr`,functionArguments:[o,tc(s)]}}),u=rs(c[0]);return u?O.fromRelaxed(u).toString():void 0}async function Qd(r){let{aptosConfig:t,sender:e,name:n,address:o,options:s}=r,c=xr(t),{domainName:u,subdomainName:p}=Dr(n);return await at({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:`${c}::router::set_target_addr`,functionArguments:[u,p,o]},options:s})}async function jd(r){let{aptosConfig:t,name:e}=r,{domainName:n,subdomainName:o=""}=Dr(e);return(await xe({aptosConfig:t,query:{query:Mn,variables:{where_condition:{domain:{_eq:n},subdomain:{_eq:o}},limit:1}},originMethod:"getName"})).current_aptos_names[0]}async function Wd(r){let{aptosConfig:t,options:e,accountAddress:n}=r,o=await nc({aptosConfig:t});return(await xe({aptosConfig:t,originMethod:"getAccountNames",query:{query:Mn,variables:{limit:e?.pagination?.limit,offset:e?.pagination?.offset,order_by:e?.orderBy,where_condition:{...r.options?.where??{},owner_address:{_eq:n.toString()},expiration_timestamp:{_gte:o}}}}})).current_aptos_names}async function Yd(r){let{aptosConfig:t,options:e,accountAddress:n}=r,o=await nc({aptosConfig:t});return(await xe({aptosConfig:t,originMethod:"getAccountDomains",query:{query:Mn,variables:{limit:e?.pagination?.limit,offset:e?.pagination?.offset,order_by:e?.orderBy,where_condition:{...r.options?.where??{},owner_address:{_eq:n.toString()},expiration_timestamp:{_gte:o},subdomain:{_eq:""}}}}})).current_aptos_names}async function Xd(r){let{aptosConfig:t,options:e,accountAddress:n}=r,o=await nc({aptosConfig:t});return(await xe({aptosConfig:t,originMethod:"getAccountSubdomains",query:{query:Mn,variables:{limit:e?.pagination?.limit,offset:e?.pagination?.offset,order_by:e?.orderBy,where_condition:{...r.options?.where??{},owner_address:{_eq:n.toString()},expiration_timestamp:{_gte:o},subdomain:{_neq:""}}}}})).current_aptos_names}async function Zd(r){let{aptosConfig:t,options:e,domain:n}=r;return(await xe({aptosConfig:t,originMethod:"getDomainSubdomains",query:{query:Mn,variables:{limit:e?.pagination?.limit,offset:e?.pagination?.offset,order_by:e?.orderBy,where_condition:{...r.options?.where??{},domain:{_eq:n},subdomain:{_neq:""}}}}})).current_aptos_names}async function nc(r){let{aptosConfig:t}=r,e=xr(t),s=(await kr({aptosConfig:t,payload:{function:`${e}::config::reregistration_grace_sec`,functionArguments:[]}}))[0]/60/60/24,c=()=>new Date;return new Date(c().setDate(c().getDate()-s)).toISOString()}async function Jd(r){let{aptosConfig:t,sender:e,name:n,years:o=1,options:s}=r,c=xr(t),u=o*31536e3,{domainName:p,subdomainName:y}=Dr(n);if(y)throw new Error("Subdomains cannot be renewed");if(o!==1)throw new Error("Currently, only 1 year renewals are supported");return await at({aptosConfig:t,sender:e.accountAddress.toString(),data:{function:`${c}::router::renew_domain`,functionArguments:[p,u]},options:s})}var zo=class{constructor(t){this.config=t}async getOwnerAddress(t){return Fd({aptosConfig:this.config,...t})}async getExpiration(t){return rc({aptosConfig:this.config,...t})}async getTargetAddress(t){return Vd({aptosConfig:this.config,...t})}async setTargetAddress(t){return Qd({aptosConfig:this.config,...t})}async getPrimaryName(t){return Hd({aptosConfig:this.config,...t})}async setPrimaryName(t){return $d({aptosConfig:this.config,...t})}async registerName(t){return Kd({aptosConfig:this.config,...t})}async renewDomain(t){return Jd({aptosConfig:this.config,...t})}async getName(t){return jd({aptosConfig:this.config,...t})}async getAccountNames(t){return Wd({aptosConfig:this.config,...t})}async getAccountDomains(t){return Yd({aptosConfig:this.config,...t})}async getAccountSubdomains(t){return Xd({aptosConfig:this.config,...t})}async getDomainSubdomains(t){return Zd({aptosConfig:this.config,...t})}};async function el(r){let{aptosConfig:t,poolAddress:e}=r,n=O.fromRelaxed(e).toStringLong(),s=await xe({aptosConfig:t,query:{query:da,variables:{where_condition:{pool_address:{_eq:n}}}}});if(s.num_active_delegator_per_pool.length===0)throw Error("Delegator pool not found");return s.num_active_delegator_per_pool[0].num_active_delegator}async function tl(r){let{aptosConfig:t,options:e}=r,n={query:da,variables:{where_condition:{},order_by:e?.orderBy}};return(await xe({aptosConfig:t,query:n})).num_active_delegator_per_pool}async function rl(r){let{aptosConfig:t,delegatorAddress:e,poolAddress:n}=r,o={query:Su,variables:{delegatorAddress:O.fromRelaxed(e).toStringLong(),poolAddress:O.fromRelaxed(n).toStringLong()}};return(await xe({aptosConfig:t,query:o})).delegated_staking_activities}var Mo=class{constructor(t){this.config=t}async getNumberOfDelegators(t){return el({aptosConfig:this.config,...t})}async getNumberOfDelegatorsForAllPools(t){return tl({aptosConfig:this.config,...t})}async getDelegatedStakingActivities(t){return rl({aptosConfig:this.config,...t})}};var Do=class{constructor(t){this.config=t}async getTransactions(t){return pd({aptosConfig:this.config,...t})}async getTransactionByVersion(t){return gd({aptosConfig:this.config,...t})}async getTransactionByHash(t){return zi({aptosConfig:this.config,...t})}async isPendingTransaction(t){return yd({aptosConfig:this.config,...t})}async waitForTransaction(t){return Mi({aptosConfig:this.config,...t})}async getGasPriceEstimation(){return Ni({aptosConfig:this.config})}};var Go=class{constructor(t){this.config=t}async signAndSubmitTransaction(t){let{signer:e,transaction:n}=t;return Za({aptosConfig:this.config,signer:e,transaction:n})}async publishPackageTransaction(t){return Sd({aptosConfig:this.config,...t})}async rotateAuthKey(t){return Ed({aptosConfig:this.config,...t})}};var qo=class{constructor(t){this.config=t}async transaction(t){return at({aptosConfig:this.config,...t})}async multiAgentTransaction(t){return at({aptosConfig:this.config,...t})}};var Lo=class{constructor(t){this.config=t}transaction(t){return Ji({...t})}transactionAsFeePayer(t){let{signer:e,transaction:n}=t;if(!n.feePayerAddress)throw new Error(`Transaction ${n} is not a Fee Payer transaction`);return n.feePayerAddress=e.accountAddress,Ji({signer:e,transaction:n})}};var Un=class{constructor(t){this.config=t}async transaction(t){return Xa({aptosConfig:this.config,...t})}async multiAgentTransaction(t){return Xa({aptosConfig:this.config,...t})}};yt([nl],Un.prototype,"transaction",1),yt([nl],Un.prototype,"multiAgentTransaction",1);function nl(r,t,e){let n=e.value;return e.value=async function(...o){let[s]=o;if(s.transaction.feePayerAddress&&!s.feePayerPublicKey)throw new Error("You are simulating a Fee Payer transaction but missing the feePayerPublicKey");return n.apply(this,o)},e}var Bn=class{constructor(t){this.config=t}async transaction(t){return es({aptosConfig:this.config,...t})}async multiAgentTransaction(t){return es({aptosConfig:this.config,...t})}};yt([ol],Bn.prototype,"transaction",1),yt([ol],Bn.prototype,"multiAgentTransaction",1);function ol(r,t,e){let n=e.value;return e.value=async function(...o){let[s]=o;if(s.transaction.feePayerAddress&&!s.feePayerAuthenticator)throw new Error("You are submitting a Fee Payer transaction but missing the feePayerAuthenticator");return n.apply(this,o)},e}var ot=class{constructor(t){this.config=new bo(t),this.account=new mo(this.config),this.ans=new zo(this.config),this.coin=new Io(this.config),this.digitalAsset=new Ro(this.config),this.event=new Po(this.config),this.faucet=new Oo(this.config),this.fungibleAsset=new ko(this.config),this.general=new No(this.config),this.staking=new Mo(this.config),this.transaction=new Do(this.config),this.transactionSubmission=new Go(this.config),this.build=new qo(this.config),this.sign=new Lo(this.config),this.simulate=new Un(this.config),this.submit=new Bn(this.config)}};function pt(r,t,e){Object.getOwnPropertyNames(t.prototype).forEach(n=>{let o=Object.getOwnPropertyDescriptor(t.prototype,n);o&&(o.value=function(...s){return this[e][n](...s)},Object.defineProperty(r.prototype,n,o))})}pt(ot,mo,"account");pt(ot,zo,"ans");pt(ot,Io,"coin");pt(ot,Ro,"digitalAsset");pt(ot,Po,"event");pt(ot,Oo,"faucet");pt(ot,ko,"fungibleAsset");pt(ot,No,"general");pt(ot,Mo,"staking");pt(ot,Do,"transaction");pt(ot,Go,"transactionSubmission");pt(ot,qo,"build");pt(ot,Lo,"sign");pt(ot,Un,"simulate");pt(ot,Bn,"submit");return pl(fy);})();
428
+ /*! Bundled license information:
429
+
430
+ @noble/hashes/esm/utils.js:
431
+ (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
432
+
433
+ @scure/base/lib/esm/index.js:
434
+ (*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
435
+
436
+ @noble/curves/esm/abstract/utils.js:
437
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
438
+
439
+ @noble/curves/esm/abstract/modular.js:
440
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
441
+
442
+ @noble/curves/esm/abstract/curve.js:
443
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
444
+
445
+ @noble/curves/esm/abstract/weierstrass.js:
446
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
447
+
448
+ @noble/curves/esm/_shortw_utils.js:
449
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
450
+
451
+ @noble/curves/esm/secp256k1.js:
452
+ (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
453
+
454
+ @scure/bip32/lib/esm/index.js:
455
+ (*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
456
+ */
412
457
  //# sourceMappingURL=index.global.js.map