@antseed/gateway-console 0.1.12 → 0.1.13

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 (163) hide show
  1. package/dist/assets/{Activity-BcXN_DqV.js → Activity-DATDm05n.js} +1 -1
  2. package/dist/assets/{Audit-nk0K4aQy.js → Audit-DoUfhCFC.js} +1 -1
  3. package/dist/assets/{BrandIcon-6gq42Dg-.js → BrandIcon-_kk81WuK.js} +1 -1
  4. package/dist/assets/{ChainGate-Do1wYOPQ.js → ChainGate-Bp0uTPIx.js} +1 -1
  5. package/dist/assets/{ChannelClose-CdHUKMFm.js → ChannelClose-BR31CpqA.js} +1 -1
  6. package/dist/assets/{Charts-BMsoEfDr.js → Charts-kvs4OmQ5.js} +1 -1
  7. package/dist/assets/{Chat-C4DsUQG-.js → Chat-DXeiNUvp.js} +3 -3
  8. package/dist/assets/{ConnectWallet-BYdqZipy.js → ConnectWallet-BgF0sOSn.js} +1 -1
  9. package/dist/assets/{DataTable-BCgVRqY6.js → DataTable-DsVQCeW0.js} +1 -1
  10. package/dist/assets/{KeyHolder-JK1zjm4r.js → KeyHolder-DxMTzn2W.js} +1 -1
  11. package/dist/assets/Keys-BjYvx7sT.js +1 -0
  12. package/dist/assets/{Logs-DfacvRY6.js → Logs-oKL9uKOU.js} +1 -1
  13. package/dist/assets/Members-T-UrNdtc.js +1 -0
  14. package/dist/assets/{Migrate-Bqnu-HEP.js → Migrate-Cf0OtMIJ.js} +1 -1
  15. package/dist/assets/ModelDetails-Cui5mNEy.js +1 -0
  16. package/dist/assets/Models-PTbGWvAC.js +1 -0
  17. package/dist/assets/{OperatorActions-DWX4uK6I.js → OperatorActions-CnSuoVIH.js} +1 -1
  18. package/dist/assets/{OperatorGateAlert-cpvsO9yT.js → OperatorGateAlert-B6C_5PEr.js} +1 -1
  19. package/dist/assets/{Overview-C4Bu8z8u.js → Overview-CJl9bY9L.js} +1 -1
  20. package/dist/assets/{PeerPicker-CcMSXxY3.js → PeerPicker-C_8PqMUU.js} +1 -1
  21. package/dist/assets/PolicyEditor-DAaebg1f.js +1 -0
  22. package/dist/assets/{PolicyField-ldIq_Yw-.js → PolicyField-CHfrLOyB.js} +1 -1
  23. package/dist/assets/Presets-wZYcL1FD.js +4 -0
  24. package/dist/assets/Providers-BAhStRFF.js +1 -0
  25. package/dist/assets/{RequestLog-ChzJA1hM.js → RequestLog-Bqg0utI3.js} +1 -1
  26. package/dist/assets/{Rewards-Cgw7r3bc.js → Rewards-DlbuI--y.js} +2 -2
  27. package/dist/assets/{RewardsClaim-Df0QQMHb.js → RewardsClaim-CAnaSpmX.js} +1 -1
  28. package/dist/assets/Routing-BlkYS_0B.js +1 -0
  29. package/dist/assets/{Segmented-DYnoemT9.js → Segmented-C2AVrIR7.js} +1 -1
  30. package/dist/assets/{SelectField-m1sMIgMa.js → SelectField-DjRyrny7.js} +1 -1
  31. package/dist/assets/{Settings-D2MkmqAU.js → Settings-yiWxbHdt.js} +3 -3
  32. package/dist/assets/SidePanel-DHP0GHL-.js +1 -0
  33. package/dist/assets/{Staking-2rSdK2Ob.js → Staking-Bmp79Jmy.js} +1 -1
  34. package/dist/assets/{StakingDashboard-DvLxJ1j4.js → StakingDashboard-Ijg1EDMe.js} +1 -1
  35. package/dist/assets/Switch-DClkimeN.js +1 -0
  36. package/dist/assets/{Tabs-CCabxVNK.js → Tabs-DOfs9pV6.js} +1 -1
  37. package/dist/assets/{TextAreaField-BCi-qMua.js → TextAreaField-BzOoHz0q.js} +1 -1
  38. package/dist/assets/{UsageByModel-Fb68pvpD.js → UsageByModel-Ck9YsQAj.js} +1 -1
  39. package/dist/assets/{VerificationLinks-CWyl6ZEp.js → VerificationLinks-CgB1oqeh.js} +1 -1
  40. package/dist/assets/{Wallet-BVuVEAB5.js → Wallet-CqvNVXRO.js} +3 -3
  41. package/dist/assets/{WalletConfirm-Bs7CFRaa.js → WalletConfirm-Ca7r5H8h.js} +1 -1
  42. package/dist/assets/{WalletFunding-w9MlXB0t.js → WalletFunding-CClRgkd3.js} +1 -1
  43. package/dist/assets/{WalletSignIn-CFxQjhbw.js → WalletSignIn-OeYy6k9J.js} +1 -1
  44. package/dist/assets/Workspaces-DdMaBlC2.js +1 -0
  45. package/dist/assets/{add-CWU7ACA6.js → add-BIV9ozpT.js} +1 -1
  46. package/dist/assets/{all-wallets-C7xN3fay.js → all-wallets-DTcdqYms.js} +1 -1
  47. package/dist/assets/{app-store-C9LYdcrl.js → app-store-sivsgaWo.js} +1 -1
  48. package/dist/assets/{apple-DyeheYaR.js → apple-CnEh2Z0o.js} +1 -1
  49. package/dist/assets/{arrow-bottom-C-Ld0QTs.js → arrow-bottom-CV61GKUR.js} +1 -1
  50. package/dist/assets/{arrow-bottom-circle-CBZDZ8Ab.js → arrow-bottom-circle-DFzyOmM2.js} +1 -1
  51. package/dist/assets/{arrow-left-DpJrY7yH.js → arrow-left-C15ZaZSP.js} +1 -1
  52. package/dist/assets/{arrow-right-C12AYUbo.js → arrow-right-91Gw6L2M.js} +1 -1
  53. package/dist/assets/{arrow-top-DTpoR1JD.js → arrow-top-DPQixVIo.js} +1 -1
  54. package/dist/assets/{bank-Ce19qcX5.js → bank-9Hiz5n1N.js} +1 -1
  55. package/dist/assets/{basic-xSJded8g.js → basic-BSP1_xZI.js} +1 -1
  56. package/dist/assets/{browser-efLjW-nE.js → browser-CyasGPFE.js} +1 -1
  57. package/dist/assets/{bundle-full-Bo_XusKG.js → bundle-full-C3z6oPNG.js} +1 -1
  58. package/dist/assets/{card-C5hP1T57.js → card-DuAFw0fG.js} +1 -1
  59. package/dist/assets/{ccip-B61TPyfu.js → ccip-CnjHj1RZ.js} +1 -1
  60. package/dist/assets/{checkmark-D6TDn2nt.js → checkmark-Did8RFKg.js} +1 -1
  61. package/dist/assets/{checkmark-bold-D6Dl_7lL.js → checkmark-bold-WTuNIh6X.js} +1 -1
  62. package/dist/assets/{chevron-bottom-BN93pLQ-.js → chevron-bottom-YjhZRIXC.js} +1 -1
  63. package/dist/assets/{chevron-left-BRtPfxLq.js → chevron-left-C9RIiMNF.js} +1 -1
  64. package/dist/assets/{chevron-right-q6ckJ6mb.js → chevron-right-n1LdC3Bu.js} +1 -1
  65. package/dist/assets/{chevron-top-C1AX5sm6.js → chevron-top-BukRfdTL.js} +1 -1
  66. package/dist/assets/{chrome-store-Bo_BoLHJ.js → chrome-store-BkN1NWnM.js} +1 -1
  67. package/dist/assets/{clock-BhAO_7G0.js → clock-D1bJyWIM.js} +1 -1
  68. package/dist/assets/{close-BtzdVDHu.js → close-DL88TIDj.js} +1 -1
  69. package/dist/assets/code-block-DwCsSJzh.js +3 -0
  70. package/dist/assets/{coinPlaceholder-Di1b8fYJ.js → coinPlaceholder-CfwG-TTk.js} +1 -1
  71. package/dist/assets/{compass-C10lNmou.js → compass-ZpTR_nrR.js} +1 -1
  72. package/dist/assets/{copy-B5e38uFc.js → copy-judiAK2Z.js} +1 -1
  73. package/dist/assets/{core-B0f6zAPS.js → core-CA5S1nbm.js} +3 -3
  74. package/dist/assets/cursor-DvOm1Cji.js +3 -0
  75. package/dist/assets/{cursor-transparent-DzGICXfN.js → cursor-transparent-BmGrLznf.js} +1 -1
  76. package/dist/assets/{desktop-DSb6a3DL.js → desktop-BuMTjH7M.js} +1 -1
  77. package/dist/assets/{disconnect-DRzHq1ok.js → disconnect-De2ZlK-6.js} +1 -1
  78. package/dist/assets/{discord-c_RQc3fB.js → discord-BNL_ltCn.js} +1 -1
  79. package/dist/assets/{en_US-Y4ZOVFV4-Bkc-z49M.js → en_US-Y4ZOVFV4-B7L59ik1.js} +4 -4
  80. package/dist/assets/{etherscan-CQGvGKJu.js → etherscan-HbcRO2IH.js} +1 -1
  81. package/dist/assets/{exclamation-triangle-CPWxzsHw.js → exclamation-triangle-x5ImWOJX.js} +1 -1
  82. package/dist/assets/{extension-ytWXOqXr.js → extension-rfKIvpqo.js} +1 -1
  83. package/dist/assets/{external-link-BYoSE2u3.js → external-link-7kjdDR71.js} +1 -1
  84. package/dist/assets/{facebook-CMBv0nnN.js → facebook-BclEg-_B.js} +1 -1
  85. package/dist/assets/{farcaster-CJmfWTQP.js → farcaster-D2oH1JNb.js} +1 -1
  86. package/dist/assets/{filters-DEiNVvyn.js → filters-JMxKoXjp.js} +1 -1
  87. package/dist/assets/{github-CdMwJkf8.js → github-MlVki9qk.js} +1 -1
  88. package/dist/assets/{google-CHI5gfH8.js → google-D65ws424.js} +1 -1
  89. package/dist/assets/{help-circle-dA36a8fM.js → help-circle-BK3cKTQP.js} +1 -1
  90. package/dist/assets/highlighted-body-KQOG7T2V-CAY_ZWoa.js +1 -0
  91. package/dist/assets/{id-Dm0-1g1D.js → id-B-GhJWbg.js} +1 -1
  92. package/dist/assets/{image-BL3ODVX_.js → image-CiFhN0rj.js} +1 -1
  93. package/dist/assets/{index-BRgGxCKs.js → index-B3lQX3LL.js} +3 -3
  94. package/dist/assets/{index-BAcoKUeC.css → index-B5U62otb.css} +1 -1
  95. package/dist/assets/{index-DPXW_JSn.js → index-BJa4Qaxt.js} +4 -4
  96. package/dist/assets/{index-CHeO_lLD.js → index-ByQIfYvU.js} +1 -1
  97. package/dist/assets/{index-D1OXThJP.js → index-DNDRe5Tn.js} +1 -1
  98. package/dist/assets/{index-BXzZZOmS.js → index-DuaHPDzN.js} +1 -1
  99. package/dist/assets/{index.es-XdMmjy3e.js → index.es-B6D0HpEZ.js} +3 -3
  100. package/dist/assets/{info-circle-CKgnYdF-.js → info-circle-xhU8sugp.js} +1 -1
  101. package/dist/assets/{info-BbBzpLWs.js → info-exBeWZDh.js} +1 -1
  102. package/dist/assets/{lightbulb-B6Xv9kMK.js → lightbulb-gxTCeOnq.js} +1 -1
  103. package/dist/assets/{limits-uCwhqY-O.js → limits-CFW9YnA7.js} +1 -1
  104. package/dist/assets/{mail-BdCMypwE.js → mail-DmWSDPhy.js} +1 -1
  105. package/dist/assets/{mermaid-MCJ5UELQ-BaHsArCB.js → mermaid-MCJ5UELQ-sIadr4pS.js} +3 -3
  106. package/dist/assets/{metamask-sdk-BL7QLxcU.js → metamask-sdk-DY00rxTf.js} +1 -1
  107. package/dist/assets/{mobile-F_82dhUb.js → mobile-B3BxvHa9.js} +1 -1
  108. package/dist/assets/{more-CtMTtAsM.js → more-BjVWPgrZ.js} +1 -1
  109. package/dist/assets/{network-placeholder-BRs4Lylz.js → network-placeholder-YeNSVIJz.js} +1 -1
  110. package/dist/assets/{nftPlaceholder-DONTHyad.js → nftPlaceholder-DbHcJNrA.js} +1 -1
  111. package/dist/assets/{off-Bwru40fy.js → off-CtPqpcbp.js} +1 -1
  112. package/dist/assets/{play-store-CDeNquGq.js → play-store-D9paBHV6.js} +1 -1
  113. package/dist/assets/{plus-EcrYfJFM.js → plus-D60mJLP4.js} +1 -1
  114. package/dist/assets/{qr-code-CF-SIZQq.js → qr-code-D7sh4LqT.js} +1 -1
  115. package/dist/assets/{recycle-horizontal-CQAPujmy.js → recycle-horizontal-G2tc-boO.js} +1 -1
  116. package/dist/assets/{refresh-BErGEy2b.js → refresh-DbRsPfeH.js} +1 -1
  117. package/dist/assets/{reown-logo-Ge2o4AAI.js → reown-logo-C7-J6a93.js} +1 -1
  118. package/dist/assets/{search-Ca88O9BA.js → search-Cifbb1kp.js} +1 -1
  119. package/dist/assets/selection-GKCY6QaK.js +1 -0
  120. package/dist/assets/{send-VS1TUwft.js → send-C7VNtheK.js} +1 -1
  121. package/dist/assets/{sendTransaction-k8aDYfd4.js → sendTransaction-OKix18Wz.js} +1 -1
  122. package/dist/assets/stored-C5eGF9Ho.js +1 -0
  123. package/dist/assets/{swapHorizontal-UNJ9wJ3Z.js → swapHorizontal-_un_Nt7W.js} +1 -1
  124. package/dist/assets/{swapHorizontalBold-eQTpC4fd.js → swapHorizontalBold-DipkGXtT.js} +1 -1
  125. package/dist/assets/{swapHorizontalMedium-DaFWQu14.js → swapHorizontalMedium-BwrG3AId.js} +1 -1
  126. package/dist/assets/{swapHorizontalRoundedBold-BbRZUmJZ.js → swapHorizontalRoundedBold-CzxQhZjN.js} +1 -1
  127. package/dist/assets/{swapVertical-CrZ6Be2R.js → swapVertical-DVrrmwGq.js} +1 -1
  128. package/dist/assets/{telegram-CDAYT0ej.js → telegram-CM4CyaZC.js} +1 -1
  129. package/dist/assets/{three-dots-CK__4w5S.js → three-dots-BCalKpaE.js} +1 -1
  130. package/dist/assets/{twitch-BS50nSpU.js → twitch-CfAHmkC8.js} +1 -1
  131. package/dist/assets/{twitterIcon-BtVx5zJI.js → twitterIcon-1tyE-UqP.js} +1 -1
  132. package/dist/assets/{usage-DQGKL0DJ.js → usage-CckQzwRu.js} +1 -1
  133. package/dist/assets/{useInfiniteQuery-CAj47QRO.js → useInfiniteQuery-Bq7y7uuf.js} +1 -1
  134. package/dist/assets/{useTx-DzRlz7Ez.js → useTx-B3hhNYvk.js} +1 -1
  135. package/dist/assets/{verify-hRAQBjoS.js → verify-CepTEVee.js} +1 -1
  136. package/dist/assets/{verify-filled-E4LyUumx.js → verify-filled-DgTBeCbs.js} +1 -1
  137. package/dist/assets/{w3m-modal-CLSVKDRP.js → w3m-modal-Cz6YrUSP.js} +1 -1
  138. package/dist/assets/{waitForCallsStatus-C51Vv8Tt.js → waitForCallsStatus-Bb1t_wzE.js} +1 -1
  139. package/dist/assets/{wallet-D-TGx4VA.js → wallet-CEqn1yNE.js} +1 -1
  140. package/dist/assets/{wallet-placeholder-SjwHckDA.js → wallet-placeholder-Dy7Awuau.js} +1 -1
  141. package/dist/assets/{walletconnect-7nuI2nwG.js → walletconnect-IC3BdQZa.js} +1 -1
  142. package/dist/assets/{warning-circle-BI2BfSeD.js → warning-circle-Csh8khJG.js} +1 -1
  143. package/dist/assets/{writeContract-CaMlmKcK.js → writeContract-D27zB12y.js} +1 -1
  144. package/dist/assets/{x-DoGk7CZD.js → x-fLBvtS6t.js} +1 -1
  145. package/dist/index.html +2 -2
  146. package/package.json +1 -1
  147. package/dist/assets/Disclosure-CQMtWM0M.js +0 -1
  148. package/dist/assets/Keys-BndDLQdj.js +0 -1
  149. package/dist/assets/Members-pSSyfBFp.js +0 -1
  150. package/dist/assets/ModelDetails-Sgq3MjfG.js +0 -1
  151. package/dist/assets/Models-C6QzCAh4.js +0 -1
  152. package/dist/assets/PolicyEditor-COREmE0O.js +0 -1
  153. package/dist/assets/Presets-DFKw93HK.js +0 -4
  154. package/dist/assets/Providers-D_0V31og.js +0 -1
  155. package/dist/assets/Routing-KpWxzlwc.js +0 -1
  156. package/dist/assets/SidePanel-BFQArkoa.js +0 -1
  157. package/dist/assets/Switch-Db8Sm64J.js +0 -1
  158. package/dist/assets/Workspaces-DktyLm08.js +0 -1
  159. package/dist/assets/code-block-DqMh9vFo.js +0 -3
  160. package/dist/assets/cursor-zACYQT2t.js +0 -3
  161. package/dist/assets/highlighted-body-KQOG7T2V-BFlyrf-z.js +0 -1
  162. package/dist/assets/selection-BV37SUs_.js +0 -1
  163. package/dist/assets/stored-e0tX90bC.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WalletSignIn-CFxQjhbw.js","assets/en_US-Y4ZOVFV4-Bkc-z49M.js","assets/clsx-B-dksMZM.js","assets/index-BhwNCc8y.js","assets/en_US-Y4ZOVFV4-CcVPgXVa.css","assets/WalletConfirm-Bs7CFRaa.js","assets/ConnectWallet-BYdqZipy.js","assets/Overview-C4Bu8z8u.js","assets/UsageByModel-Fb68pvpD.js","assets/usage-DQGKL0DJ.js","assets/Charts-BMsoEfDr.js","assets/Segmented-DYnoemT9.js","assets/roving-DkptacxO.js","assets/Chat-C4DsUQG-.js","assets/SidePanel-BFQArkoa.js","assets/selection-BV37SUs_.js","assets/ModelDetails-Sgq3MjfG.js","assets/Tabs-CCabxVNK.js","assets/stored-e0tX90bC.js","assets/Disclosure-CQMtWM0M.js","assets/VerificationLinks-CWyl6ZEp.js","assets/SelectField-m1sMIgMa.js","assets/Chat-Dtte195G.css","assets/Activity-BcXN_DqV.js","assets/PeerPicker-CcMSXxY3.js","assets/DataTable-BCgVRqY6.js","assets/Logs-DfacvRY6.js","assets/RequestLog-ChzJA1hM.js","assets/useInfiniteQuery-CAj47QRO.js","assets/dates-Pi3-Ywng.js","assets/Keys-BndDLQdj.js","assets/PolicyField-ldIq_Yw-.js","assets/PolicyEditor-COREmE0O.js","assets/Switch-Db8Sm64J.js","assets/limits-uCwhqY-O.js","assets/Members-pSSyfBFp.js","assets/Workspaces-DktyLm08.js","assets/Wallet-BVuVEAB5.js","assets/ChainGate-Do1wYOPQ.js","assets/dijkstra-COg3n3zL.js","assets/Rewards-Cgw7r3bc.js","assets/ants-B38m9Phv.js","assets/Staking-2rSdK2Ob.js","assets/StakingDashboard-DvLxJ1j4.js","assets/sendTransaction-k8aDYfd4.js","assets/waitForCallsStatus-C51Vv8Tt.js","assets/writeContract-CaMlmKcK.js","assets/StakingDashboard-CJbBUUQE.css","assets/Providers-D_0V31og.js","assets/Presets-DFKw93HK.js","assets/TextAreaField-BCi-qMua.js","assets/Models-C6QzCAh4.js","assets/BrandIcon-6gq42Dg-.js","assets/Routing-KpWxzlwc.js","assets/Audit-nk0K4aQy.js","assets/Settings-D2MkmqAU.js","assets/KeyHolder-JK1zjm4r.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WalletSignIn-OeYy6k9J.js","assets/en_US-Y4ZOVFV4-B7L59ik1.js","assets/clsx-B-dksMZM.js","assets/index-BhwNCc8y.js","assets/en_US-Y4ZOVFV4-CcVPgXVa.css","assets/WalletConfirm-Ca7r5H8h.js","assets/ConnectWallet-BgF0sOSn.js","assets/Overview-CJl9bY9L.js","assets/UsageByModel-Ck9YsQAj.js","assets/usage-CckQzwRu.js","assets/Charts-kvs4OmQ5.js","assets/Segmented-C2AVrIR7.js","assets/roving-DkptacxO.js","assets/Chat-DXeiNUvp.js","assets/SidePanel-DHP0GHL-.js","assets/PeerPicker-C_8PqMUU.js","assets/SelectField-DjRyrny7.js","assets/selection-GKCY6QaK.js","assets/ModelDetails-Cui5mNEy.js","assets/Tabs-DOfs9pV6.js","assets/stored-C5eGF9Ho.js","assets/VerificationLinks-CgB1oqeh.js","assets/Chat-Dtte195G.css","assets/Activity-DATDm05n.js","assets/DataTable-DsVQCeW0.js","assets/Logs-oKL9uKOU.js","assets/RequestLog-Bqg0utI3.js","assets/useInfiniteQuery-Bq7y7uuf.js","assets/dates-Pi3-Ywng.js","assets/Keys-BjYvx7sT.js","assets/PolicyField-CHfrLOyB.js","assets/PolicyEditor-DAaebg1f.js","assets/Switch-DClkimeN.js","assets/limits-CFW9YnA7.js","assets/Members-T-UrNdtc.js","assets/Workspaces-DdMaBlC2.js","assets/Wallet-CqvNVXRO.js","assets/ChainGate-Bp0uTPIx.js","assets/dijkstra-COg3n3zL.js","assets/Rewards-DlbuI--y.js","assets/ants-B38m9Phv.js","assets/Staking-Bmp79Jmy.js","assets/StakingDashboard-Ijg1EDMe.js","assets/sendTransaction-OKix18Wz.js","assets/waitForCallsStatus-Bb1t_wzE.js","assets/writeContract-D27zB12y.js","assets/StakingDashboard-CJbBUUQE.css","assets/Providers-BAhStRFF.js","assets/Presets-wZYcL1FD.js","assets/TextAreaField-BzOoHz0q.js","assets/Models-PTbGWvAC.js","assets/BrandIcon-_kk81WuK.js","assets/Routing-BlkYS_0B.js","assets/Audit-DoUfhCFC.js","assets/Settings-yiWxbHdt.js","assets/KeyHolder-DxMTzn2W.js"])))=>i.map(i=>d[i]);
2
2
  var vw=Object.defineProperty;var ep=t=>{throw TypeError(t)};var gw=(t,r,i)=>r in t?vw(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var ku=(t,r,i)=>gw(t,typeof r!="symbol"?r+"":r,i),Su=(t,r,i)=>r.has(t)||ep("Cannot "+i);var k=(t,r,i)=>(Su(t,r,"read from private field"),i?i.call(t):r.get(t)),ne=(t,r,i)=>r.has(t)?ep("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,i),q=(t,r,i,s)=>(Su(t,r,"write to private field"),s?s.call(t,i):r.set(t,i),i),fe=(t,r,i)=>(Su(t,r,"access private method"),i);var ea=(t,r,i,s)=>({set _(l){q(t,r,l,i)},get _(){return k(t,r,s)}});function yw(t,r){for(var i=0;i<r.length;i++){const s=r[i];if(typeof s!="string"&&!Array.isArray(s)){for(const l in s)if(l!=="default"&&!(l in t)){const f=Object.getOwnPropertyDescriptor(s,l);f&&Object.defineProperty(t,l,f.get?f:{enumerable:!0,get:()=>s[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))s(l);new MutationObserver(l=>{for(const f of l)if(f.type==="childList")for(const v of f.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&s(v)}).observe(document,{childList:!0,subtree:!0});function i(l){const f={};return l.integrity&&(f.integrity=l.integrity),l.referrerPolicy&&(f.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?f.credentials="include":l.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function s(l){if(l.ep)return;l.ep=!0;const f=i(l);fetch(l.href,f)}})();const ww="modulepreload",xw=function(t){return"/console/"+t},tp={},ze=function(r,i,s){let l=Promise.resolve();if(i&&i.length>0){let v=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const p=document.querySelector("meta[property=csp-nonce]"),g=(p==null?void 0:p.nonce)||(p==null?void 0:p.getAttribute("nonce"));l=v(i.map(h=>{if(h=xw(h),h in tp)return;tp[h]=!0;const y=h.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${x}`))return;const C=document.createElement("link");if(C.rel=y?"stylesheet":ww,y||(C.as="script"),C.crossOrigin="",C.href=h,g&&C.setAttribute("nonce",g),document.head.appendChild(C),y)return new Promise((N,A)=>{C.addEventListener("load",N),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function f(v){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=v,window.dispatchEvent(p),!p.defaultPrevented)throw v}return l.then(v=>{for(const p of v||[])p.status==="rejected"&&f(p.reason);return r().catch(f)})};var AS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function DS(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var r=t.default;if(typeof r=="function"){var i=function s(){return this instanceof s?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};i.prototype=r.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(s){var l=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(i,s,l.get?l:{enumerable:!0,get:function(){return t[s]}})}),i}var Cu={exports:{}},So={},_u={exports:{}},pe={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -78,9 +78,9 @@ Error generating stack: `+c.message+`
78
78
  `)},Tp=function(){var t=parseInt(document.body.getAttribute(yi)||"0",10);return isFinite(t)?t:0},q0=function(){M.useEffect(function(){return document.body.setAttribute(yi,(Tp()+1).toString()),function(){var t=Tp()-1;t<=0?document.body.removeAttribute(yi):document.body.setAttribute(yi,t.toString())}},[])},K0=function(t){var r=t.noRelative,i=t.noImportant,s=t.gapMode,l=s===void 0?"margin":s;q0();var f=M.useMemo(function(){return H0(l)},[l]);return M.createElement(W0,{styles:V0(f,!r,l,i?"":"!important")})},ac=!1;if(typeof window<"u")try{var ra=Object.defineProperty({},"passive",{get:function(){return ac=!0,!0}});window.addEventListener("test",ra,ra),window.removeEventListener("test",ra,ra)}catch{ac=!1}var ui=ac?{passive:!1}:!1,Q0=function(t){return t.tagName==="TEXTAREA"},uv=function(t,r){if(!(t instanceof Element))return!1;var i=window.getComputedStyle(t);return i[r]!=="hidden"&&!(i.overflowY===i.overflowX&&!Q0(t)&&i[r]==="visible")},G0=function(t){return uv(t,"overflowY")},Y0=function(t){return uv(t,"overflowX")},Rp=function(t,r){var i=r.ownerDocument,s=r;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var l=cv(t,s);if(l){var f=dv(t,s),v=f[1],p=f[2];if(v>p)return!0}s=s.parentNode}while(s&&s!==i.body);return!1},Z0=function(t){var r=t.scrollTop,i=t.scrollHeight,s=t.clientHeight;return[r,i,s]},X0=function(t){var r=t.scrollLeft,i=t.scrollWidth,s=t.clientWidth;return[r,i,s]},cv=function(t,r){return t==="v"?G0(r):Y0(r)},dv=function(t,r){return t==="v"?Z0(r):X0(r)},J0=function(t,r){return t==="h"&&r==="rtl"?-1:1},ex=function(t,r,i,s,l){var f=J0(t,window.getComputedStyle(r).direction),v=f*s,p=i.target,g=r.contains(p),h=!1,y=v>0,x=0,C=0;do{if(!p)break;var N=dv(t,p),A=N[0],P=N[1],R=N[2],F=P-R-f*A;(A||F)&&cv(t,p)&&(x+=F,C+=A);var O=p.parentNode;p=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!g&&p!==document.body||g&&(r.contains(p)||r===p));return(y&&Math.abs(x)<1||!y&&Math.abs(C)<1)&&(h=!0),h},ia=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Np=function(t){return[t.deltaX,t.deltaY]},Ip=function(t){return t&&"current"in t?t.current:t},tx=function(t,r){return t[0]===r[0]&&t[1]===r[1]},nx=function(t){return`
79
79
  .block-interactivity-`.concat(t,` {pointer-events: none;}
80
80
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
81
- `)},rx=0,ci=[];function ix(t){var r=M.useRef([]),i=M.useRef([0,0]),s=M.useRef(),l=M.useState(rx++)[0],f=M.useState(lv)[0],v=M.useRef(t);M.useEffect(function(){v.current=t},[t]),M.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var P=C1([t.lockRef.current],(t.shards||[]).map(Ip),!0).filter(Boolean);return P.forEach(function(R){return R.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),P.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var p=M.useCallback(function(P,R){if("touches"in P&&P.touches.length===2||P.type==="wheel"&&P.ctrlKey)return!v.current.allowPinchZoom;var F=ia(P),O=i.current,E="deltaX"in P?P.deltaX:O[0]-F[0],b="deltaY"in P?P.deltaY:O[1]-F[1],D,W=P.target,J=Math.abs(E)>Math.abs(b)?"h":"v";if("touches"in P&&J==="h"&&W.type==="range")return!1;var Q=window.getSelection(),ie=Q&&Q.anchorNode,ue=ie?ie===W||ie.contains(W):!1;if(ue)return!1;var Y=Rp(J,W);if(!Y)return!0;if(Y?D=J:(D=J==="v"?"h":"v",Y=Rp(J,W)),!Y)return!1;if(!s.current&&"changedTouches"in P&&(E||b)&&(s.current=D),!D)return!0;var Ee=s.current||D;return ex(Ee,R,P,Ee==="h"?E:b)},[]),g=M.useCallback(function(P){var R=P;if(!(!ci.length||ci[ci.length-1]!==f)){var F="deltaY"in R?Np(R):ia(R),O=r.current.filter(function(D){return D.name===R.type&&(D.target===R.target||R.target===D.shadowParent)&&tx(D.delta,F)})[0];if(O&&O.should){R.cancelable&&R.preventDefault();return}if(!O){var E=(v.current.shards||[]).map(Ip).filter(Boolean).filter(function(D){return D.contains(R.target)}),b=E.length>0?p(R,E[0]):!v.current.noIsolation;b&&R.cancelable&&R.preventDefault()}}},[]),h=M.useCallback(function(P,R,F,O){var E={name:P,delta:R,target:F,should:O,shadowParent:ox(F)};r.current.push(E),setTimeout(function(){r.current=r.current.filter(function(b){return b!==E})},1)},[]),y=M.useCallback(function(P){i.current=ia(P),s.current=void 0},[]),x=M.useCallback(function(P){h(P.type,Np(P),P.target,p(P,t.lockRef.current))},[]),C=M.useCallback(function(P){h(P.type,ia(P),P.target,p(P,t.lockRef.current))},[]);M.useEffect(function(){return ci.push(f),t.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:C}),document.addEventListener("wheel",g,ui),document.addEventListener("touchmove",g,ui),document.addEventListener("touchstart",y,ui),function(){ci=ci.filter(function(P){return P!==f}),document.removeEventListener("wheel",g,ui),document.removeEventListener("touchmove",g,ui),document.removeEventListener("touchstart",y,ui)}},[]);var N=t.removeScrollBar,A=t.inert;return M.createElement(M.Fragment,null,A?M.createElement(f,{styles:nx(l)}):null,N?M.createElement(K0,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function ox(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const sx=_1(av,ix);var Uc=M.forwardRef(function(t,r){return M.createElement(Pa,sn({},t,{ref:r,sideCar:sx}))});Uc.classNames=Pa.classNames;var fv=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},di=new WeakMap,oa=new WeakMap,sa={},Ou=0,hv=function(t){return t&&(t.host||hv(t.parentNode))},ax=function(t,r){return r.map(function(i){if(t.contains(i))return i;var s=hv(i);return s&&t.contains(s)?s:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},pv=function(t,r,i,s){var l=ax(r,Array.isArray(t)?t:[t]);sa[i]||(sa[i]=new WeakMap);var f=sa[i],v=[],p=new Set,g=new Set(l),h=function(x){!x||p.has(x)||(p.add(x),h(x.parentNode))};l.forEach(h);var y=function(x){!x||g.has(x)||Array.prototype.forEach.call(x.children,function(C){if(p.has(C))y(C);else try{var N=C.getAttribute(s),A=N!==null&&N!=="false",P=(di.get(C)||0)+1,R=(f.get(C)||0)+1;di.set(C,P),f.set(C,R),v.push(C),P===1&&A&&oa.set(C,!0),R===1&&C.setAttribute(i,"true"),A||C.setAttribute(s,"true")}catch(F){console.error("aria-hidden: cannot operate on ",C,F)}})};return y(r),p.clear(),Ou++,function(){v.forEach(function(x){var C=di.get(x)-1,N=f.get(x)-1;di.set(x,C),f.set(x,N),C||(oa.has(x)||x.removeAttribute(s),oa.delete(x)),N||x.removeAttribute(i)}),Ou--,Ou||(di=new WeakMap,di=new WeakMap,oa=new WeakMap,sa={})}},lx=function(t,r,i){i===void 0&&(i="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),l=r||fv(t);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),pv(s,l,i,"aria-hidden")):function(){return null}},ux=function(t,r,i){i===void 0&&(i="data-inert-ed");var s=r||fv(t);return s?pv(t,s,i,"inert"):function(){return null}},cx=function(){return typeof HTMLElement<"u"&&HTMLElement.prototype.hasOwnProperty("inert")},dx=function(t,r,i){return i===void 0&&(i="data-suppressed"),(cx()?ux:lx)(t,r,i)};let Rr=[];const lc=new Set;function mv(){lc.forEach(t=>t())}function fx(t){Rr=Rr.filter(r=>r!==t),Rr.push(t),mv()}function hx(t){Rr=Rr.filter(r=>r!==t),mv()}function Au(t){return Rr[Rr.length-1]===t}function vv(t,r,i){const s=M.useRef(i),l=M.useRef(null),[f,v]=M.useState(!1);M.useEffect(()=>{s.current=i},[i]);const p=M.useCallback(()=>{const h=l.current;l.current=null,h&&document.contains(h)&&h.focus({preventScroll:!0})},[]),g=M.useCallback(()=>{s.current()},[]);return M.useEffect(()=>{if(!t)return;const h=r.current;if(!h)return;const y=h;l.current=document.activeElement instanceof HTMLElement?document.activeElement:null,fx(y),v(Au(y));function x(){v(Au(y))}function C(N){if(!Au(y))return;const A=N.target instanceof Element?N.target:null,P=A==null?void 0:A.closest('[role="dialog"]');P&&P!==y&&!y.contains(P)||N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),N.stopImmediatePropagation(),g())}return lc.add(x),window.addEventListener("keydown",C,!0),()=>{window.removeEventListener("keydown",C,!0),lc.delete(x),hx(y),p()}},[g,t,r,p]),M.useEffect(()=>{var x,C;if(!t||!f)return;const h=r.current;if(!h)return;const y=((C=(x=h.parentElement)==null?void 0:x.parentElement)==null?void 0:C.querySelectorAll("[data-focus-guard]"))??[];return dx([h,...y])},[t,f,r]),{closeDialog:g,isTopDialog:f}}const px={sm:"24rem",md:"28.75rem",lg:"35rem",xl:"52rem"};function mx(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function gv({bodyClassName:t,children:r,className:i,closeLabel:s="Close",eyebrow:l,footer:f,isOpen:v,onClose:p,overlayClassName:g,size:h="md",subtitle:y,title:x}){const C=M.useRef(null),N=M.useId(),A=M.useId(),{closeDialog:P,isTopDialog:R}=vv(v,C,p);if(!v)return null;const F=["as-modal-overlay",g].filter(Boolean).join(" "),O=["as-modal",`as-modal--${h}`,i].filter(Boolean).join(" "),E=["as-modal__body",t].filter(Boolean).join(" "),b={"--as-modal-width":px[h]};return d.jsx("div",{className:F,role:"presentation",onMouseDown:P,children:d.jsx(Uc,{allowPinchZoom:!0,className:"as-modal__scroll-lock",enabled:R,style:b,children:d.jsx(zc,{autoFocus:!0,className:"as-modal__focus-lock",disabled:!R,focusOptions:{preventScroll:!0},returnFocus:!1,children:d.jsxs("div",{"aria-describedby":y?A:void 0,"aria-hidden":R?void 0:!0,"aria-labelledby":N,"aria-modal":R?"true":void 0,className:O,ref:C,role:"dialog",tabIndex:-1,onMouseDown:D=>D.stopPropagation(),children:[d.jsxs("header",{className:"as-modal__header",children:[d.jsxs("div",{className:"as-modal__titles",children:[l&&d.jsx("div",{className:"as-modal__eyebrow",children:l}),d.jsx("h2",{className:"as-modal__title",id:N,children:x}),y&&d.jsx("p",{className:"as-modal__subtitle",id:A,children:y})]}),d.jsx(vx,{label:s,className:"as-modal__close",onClick:P,children:d.jsx(mx,{})})]}),d.jsx("div",{className:E,children:r}),f&&d.jsx("footer",{className:"as-modal__footer",children:f})]})})})})}function vx({children:t,className:r,label:i,onClick:s}){return d.jsx("button",{type:"button",className:r,onClick:s,"aria-label":i,children:t})}function gx(t){return t instanceof Error?t.message:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"Something went wrong."}function yv({isOpen:t,title:r,body:i,confirmLabel:s="Confirm",cancelLabel:l="Cancel",busyLabel:f="Working…",tone:v="danger",busy:p,error:g,errorTitle:h="That did not work",confirmDisabled:y,onConfirm:x,onClose:C}){return d.jsx(gv,{isOpen:t,onClose:p?()=>{}:C,title:r,size:"sm",children:d.jsxs("div",{className:"as-confirm",children:[d.jsx("div",{className:"as-confirm__body",children:i}),g?d.jsx(lt,{tone:"danger",title:h,children:gx(g)}):null,d.jsxs("div",{className:"as-confirm__actions",children:[d.jsx(Pe,{variant:"ghost",onClick:C,disabled:p,children:l}),d.jsx(Pe,{variant:v,onClick:x,disabled:p||y,children:p?f:s})]})]})})}function Bo({children:t,className:r,label:i,size:s="md",type:l="button",...f}){const v=["as-icon-button",s==="sm"?"as-icon-button--sm":null,r].filter(Boolean).join(" ");return d.jsx("button",{type:l,className:v,"aria-label":i,title:f.title??i,...f,children:t})}async function wv(t){try{return await navigator.clipboard.writeText(t),!0}catch{return!1}}function Mp(){return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),d.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function Lp(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"m5 12 5 5L20 7"})})}function Bc({value:t,label:r="Copy",copiedLabel:i="Copied",size:s="sm",variant:l="outline",className:f,iconOnly:v,onCopied:p}){const[g,h]=M.useState(!1),y=M.useRef(void 0);M.useEffect(()=>()=>window.clearTimeout(y.current),[]);const x=async()=>{await wv(t)&&(h(!0),p==null||p(),window.clearTimeout(y.current),y.current=window.setTimeout(()=>h(!1),1500))};return v?d.jsx(Bo,{label:g?i:r,size:"sm",className:f,onClick:()=>void x(),children:g?d.jsx(Lp,{}):d.jsx(Mp,{})}):d.jsx(Pe,{variant:l,size:s,className:f,leadingIcon:g?d.jsx(Lp,{}):d.jsx(Mp,{}),"aria-live":"polite",onClick:()=>void x(),children:g?i:r})}function yx(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function wx({actions:t,backdropClassName:r,bodyClassName:i,children:s,className:l,closeLabel:f="Close",eyebrow:v,isOpen:p,onClose:g,side:h="right",subtitle:y,title:x}){const C=M.useRef(null),N=M.useId(),A=M.useId(),{closeDialog:P,isTopDialog:R}=vv(p,C,g),F=p&&R,O=["as-drawer-backdrop",p?"as-drawer-backdrop--open":null,r].filter(Boolean).join(" "),E=["as-drawer",`as-drawer--${h}`,p?"as-drawer--open":null,l].filter(Boolean).join(" "),b=["as-drawer__body",i].filter(Boolean).join(" ");return M.useEffect(()=>{if(!p||!R)return;function D(W){const J=C.current;J&&(W.target instanceof Node&&J.contains(W.target)||W.target instanceof Element&&W.target.closest('[role="dialog"], [role="menu"]')!==null||P())}return document.addEventListener("pointerdown",D,!0),()=>document.removeEventListener("pointerdown",D,!0)},[P,p,R]),d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":!p,className:O,onClick:P}),d.jsx(Uc,{allowPinchZoom:!0,className:"as-drawer__scroll-lock",enabled:p&&R,children:d.jsx(zc,{autoFocus:!0,className:"as-drawer__focus-lock",disabled:!p||!R,focusOptions:{preventScroll:!0},returnFocus:!1,children:d.jsxs("aside",{"aria-describedby":y?A:void 0,"aria-hidden":F?void 0:!0,"aria-labelledby":N,"aria-modal":F?"true":void 0,className:E,ref:C,role:"dialog",tabIndex:-1,children:[d.jsxs("header",{className:"as-drawer__header",children:[d.jsxs("div",{className:"as-drawer__titles",children:[v&&d.jsx("div",{className:"as-drawer__eyebrow",children:v}),d.jsx("h2",{className:"as-drawer__title",id:N,children:x}),y&&d.jsx("p",{className:"as-drawer__subtitle",id:A,children:y})]}),d.jsxs("div",{className:"as-drawer__actions",children:[t,d.jsx("button",{type:"button",className:"as-drawer__close",onClick:P,"aria-label":f,children:d.jsx(yx,{})})]})]}),d.jsx("div",{className:b,children:s})]})})})]})}const xx=["M42.4461 10.2767H39.6752L35.9506 25.7053H38.2537L39.0994 21.902H43.0219L43.8495 25.7053H46.1346L42.4821 10.4203L42.4461 10.2767ZM42.59 19.9286H39.5132L41.0426 12.7525L42.59 19.9286Z","M53.9616 22.494L50.8668 10.2767H47.4841V25.7053H49.5893V13.506L52.6301 25.5618L52.6661 25.7053H56.0667V10.2767H53.9616V22.494Z","M57.7221 12.2681H61.1588V25.7053H63.3899V12.2681H66.8265V10.2767H57.7221V12.2681Z","M72.0265 16.7173H71.3788C70.9649 16.7173 70.6411 16.5917 70.3892 16.3226C70.1373 16.0535 70.0113 15.7485 70.0113 15.3359V13.7033C70.0113 13.3086 70.1552 12.9678 70.4611 12.6987C70.767 12.4116 71.1449 12.2681 71.6307 12.2681H75.1213V10.2767H71.8466C70.5511 10.2767 69.5435 10.5997 68.8418 11.2455C68.14 11.8914 67.7802 12.8601 67.7802 14.116V14.9412C67.7802 16.1791 68.104 17.1299 68.7518 17.7937C69.3995 18.4575 70.2992 18.7804 71.4148 18.7804H72.0625C72.4583 18.7804 72.7462 18.888 72.9262 19.1213C73.1241 19.3545 73.214 19.6595 73.214 20.0542V22.2967C73.214 22.6914 73.0701 23.0322 72.7642 23.3013C72.4583 23.5884 72.0805 23.7319 71.5947 23.7319H68.14V25.7233H71.3788C72.6743 25.7233 73.6819 25.4003 74.3836 24.7545C75.0853 24.1086 75.4452 23.1399 75.4452 21.8841V20.4668C75.4452 19.2289 75.1393 18.296 74.5455 17.6681C73.9518 17.0402 73.0881 16.7352 72.0265 16.7352V16.7173Z","M77.0825 25.7053H84.6576V23.7857H79.3317V18.7086H84.1178V16.7711H79.3317V12.2143H84.6576V10.2767H77.0825V25.7053Z","M86.3129 25.7053H93.888V23.7857H88.544V18.7086H93.3482V16.7711H88.544V12.2143H93.888V10.2767H86.3129V25.7053Z","M102.938 11.102C102.255 10.5459 101.211 10.2767 99.8976 10.2767H95.5253V25.7053H100.149C101.499 25.7053 102.489 25.4362 103.082 24.8801C103.694 24.3239 104 23.409 104 22.1173V13.811C104 12.5731 103.64 11.6581 102.938 11.102ZM100.347 23.7319H97.7564V12.2502H100.365C100.797 12.2502 101.121 12.3758 101.391 12.6269C101.643 12.8781 101.769 13.201 101.769 13.6316V22.3505C101.769 22.8349 101.661 23.1937 101.427 23.409C101.211 23.6243 100.833 23.7319 100.347 23.7319Z"],xv=["M12.5827 3.84445C13.2032 3.84445 13.7062 3.34146 13.7062 2.72099C13.7062 2.10052 13.2032 1.59753 12.5827 1.59753C11.9623 1.59753 11.4593 2.10052 11.4593 2.72099C11.4593 3.34146 11.9623 3.84445 12.5827 3.84445Z","M23.3679 3.84445C23.9884 3.84445 24.4914 3.34146 24.4914 2.72099C24.4914 2.10052 23.9884 1.59753 23.3679 1.59753C22.7474 1.59753 22.2445 2.10052 22.2445 2.72099C22.2445 3.34146 22.7474 3.84445 23.3679 3.84445Z","M8.0889 11.0346C8.70936 11.0346 9.21235 10.5316 9.21235 9.91112C9.21235 9.29065 8.70936 8.78766 8.0889 8.78766C7.46843 8.78766 6.96544 9.29065 6.96544 9.91112C6.96544 10.5316 7.46843 11.0346 8.0889 11.0346Z","M27.8617 11.0346C28.4822 11.0346 28.9852 10.5316 28.9852 9.91112C28.9852 9.29065 28.4822 8.78766 27.8617 8.78766C27.2413 8.78766 26.7383 9.29065 26.7383 9.91112C26.7383 10.5316 27.2413 11.0346 27.8617 11.0346Z","M6.29136 19.1235C6.91183 19.1235 7.41482 18.6205 7.41482 18C7.41482 17.3795 6.91183 16.8766 6.29136 16.8766C5.6709 16.8766 5.16791 17.3795 5.16791 18C5.16791 18.6205 5.6709 19.1235 6.29136 19.1235Z","M29.6593 19.1235C30.2797 19.1235 30.7827 18.6205 30.7827 18C30.7827 17.3795 30.2797 16.8766 29.6593 16.8766C29.0388 16.8766 28.5358 17.3795 28.5358 18C28.5358 18.6205 29.0388 19.1235 29.6593 19.1235Z","M7.19014 28.1111C7.81061 28.1111 8.31359 27.6081 8.31359 26.9877C8.31359 26.3672 7.81061 25.8642 7.19014 25.8642C6.56967 25.8642 6.06668 26.3672 6.06668 26.9877C6.06668 27.6081 6.56967 28.1111 7.19014 28.1111Z","M28.7605 28.1111C29.381 28.1111 29.884 27.6081 29.884 26.9877C29.884 26.3672 29.381 25.8642 28.7605 25.8642C28.14 25.8642 27.6371 26.3672 27.6371 26.9877C27.6371 27.6081 28.14 28.1111 28.7605 28.1111Z","M17.9753 12.3827C19.2163 12.3827 20.2222 11.2762 20.2222 9.91112C20.2222 8.54609 19.2163 7.43951 17.9753 7.43951C16.7344 7.43951 15.7284 8.54609 15.7284 9.91112C15.7284 11.2762 16.7344 12.3827 17.9753 12.3827Z","M17.9753 19.7975C19.7126 19.7975 21.121 18.188 21.121 16.2025C21.121 14.217 19.7126 12.6074 17.9753 12.6074C16.238 12.6074 14.8296 14.217 14.8296 16.2025C14.8296 18.188 16.238 19.7975 17.9753 19.7975Z","M17.9753 30.1333C20.209 30.1333 22.0198 27.719 22.0198 24.7408C22.0198 21.7625 20.209 19.3482 17.9753 19.3482C15.7416 19.3482 13.9309 21.7625 13.9309 24.7408C13.9309 27.719 15.7416 30.1333 17.9753 30.1333Z","M12.3264 2.40809C12.4993 2.26669 12.7542 2.29198 12.8956 2.4647L16.9401 7.40792C17.0815 7.58074 17.0562 7.83563 16.8835 7.9771C16.7106 8.1185 16.4558 8.09322 16.3143 7.92049L12.2698 2.97728C12.1284 2.80446 12.1537 2.54957 12.3264 2.40809Z","M23.055 2.4647C23.1965 2.29198 23.4514 2.26669 23.6242 2.40809C23.7969 2.54957 23.8222 2.80446 23.6808 2.97728L19.6364 7.92049C19.4949 8.09322 19.24 8.1185 19.0672 7.9771C18.8945 7.83563 18.8692 7.58074 19.0106 7.40792L23.055 2.4647Z","M7.73168 9.72198C7.83619 9.52458 8.08064 9.44939 8.27805 9.5539L15.9176 13.5983C16.1149 13.7029 16.1901 13.9473 16.0856 14.1447C15.9811 14.3421 15.7367 14.4173 15.5393 14.3128L7.89976 10.2683C7.70236 10.1638 7.62717 9.91938 7.73168 9.72198Z","M27.6726 9.5539C27.87 9.44939 28.1144 9.52458 28.219 9.72198C28.3235 9.91938 28.2483 10.1638 28.0509 10.2683L20.4114 14.3128C20.214 14.4173 19.9695 14.3421 19.865 14.1447C19.7605 13.9473 19.8357 13.7029 20.0331 13.5983L27.6726 9.5539Z","M14.7875 16.6988C15.0096 16.6756 15.2087 16.8371 15.2321 17.0591C15.2553 17.2812 15.0938 17.4803 14.8718 17.5037L6.3335 18.4024C6.11145 18.4257 5.91232 18.2642 5.88895 18.0421C5.8657 17.8201 6.02718 17.621 6.24924 17.5976L14.7875 16.6988Z","M21.1631 16.6988L29.7014 17.5976C29.9235 17.621 30.085 17.8201 30.0617 18.0421C30.0383 18.2642 29.8392 18.4257 29.6171 18.4024L21.0789 17.5037C20.8568 17.4803 20.6953 17.2812 20.7186 17.0591C20.742 16.8371 20.9411 16.6756 21.1631 16.6988Z","M15.1149 23.0231C15.319 22.9324 15.5578 23.0244 15.6485 23.2285C15.7392 23.4326 15.6472 23.6714 15.4432 23.7621L7.35427 27.3572C7.15017 27.4478 6.91133 27.3559 6.82063 27.1518C6.72997 26.9477 6.82192 26.7089 7.02601 26.6182L15.1149 23.0231Z","M20.3021 23.2285C20.3928 23.0244 20.6316 22.9324 20.8357 23.0231L28.9246 26.6182C29.1287 26.7089 29.2207 26.9477 29.13 27.1518C29.0393 27.3559 28.8005 27.4478 28.5964 27.3572L20.5075 23.7621C20.3034 23.6714 20.2114 23.4326 20.3021 23.2285Z"],kv="#10B981";function kx({height:t=24,className:r}){return d.jsxs("svg",{className:r,height:t,width:t*104/36,viewBox:"0 0 104 36",fill:"none",role:"img","aria-label":"Antseed",children:[xv.map(i=>d.jsx("path",{d:i,fill:kv},i)),xx.map(i=>d.jsx("path",{d:i,fill:"currentColor"},i))]})}function Sx({size:t=24,className:r}){return d.jsx("svg",{className:r,height:t,width:t,viewBox:"4 0 28 32",fill:"none",role:"img","aria-label":"Antseed",children:xv.map(i=>d.jsx("path",{d:i,fill:kv},i))})}function Mo({className:t,height:r,radius:i,style:s,width:l,...f}){const v=["as-skeleton",t].filter(Boolean).join(" ");return d.jsx("div",{className:v,style:{...s,...r!==void 0?{height:r}:{},...i!==void 0?{borderRadius:i}:{},...l!==void 0?{width:l}:{}},...f})}function BS({title:t,description:r,actions:i}){return d.jsxs("header",{className:"as-page-header",children:[d.jsxs("div",{className:"as-page-header__text",children:[d.jsx("h1",{children:t}),r&&d.jsx("p",{children:r})]}),i&&d.jsx("div",{className:"as-page-header__actions",children:i})]})}function Cx({title:t,description:r,actions:i,children:s,flush:l,className:f}){return d.jsxs("section",{className:["as-panel",f].filter(Boolean).join(" "),children:[(t||i)&&d.jsxs("div",{className:"as-panel__head",children:[d.jsxs("div",{children:[t&&d.jsx("h2",{className:"as-panel__title",children:t}),r&&d.jsx("p",{className:"as-panel__desc",children:r})]}),i&&d.jsx("div",{className:"as-panel__actions",children:i})]}),d.jsx(Pc,{className:"as-panel__card",children:d.jsx("div",{className:l?"as-panel__body as-panel__body--flush":"as-panel__body",children:s})})]})}function _x(t){return t!==null&&t>=1?"danger":t!==null&&t>=.8?"warning":"default"}function HS({label:t,value:r,sub:i,meter:s,tone:l}){const f=s==null?null:Math.max(0,Math.min(1,s));return d.jsxs(Pc,{className:"as-stat",children:[d.jsx("div",{className:"as-stat__label",children:t}),d.jsx("div",{className:"as-stat__value",children:r}),i&&d.jsx("div",{className:"as-stat__sub",children:i}),f!==null&&d.jsx("div",{className:`as-meter as-meter--${l??_x(f)}`,role:"meter","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f*100),children:d.jsx("span",{style:{width:`${f*100}%`}})})]})}function WS({title:t,body:r,action:i,icon:s}){return d.jsxs("div",{className:"as-empty",children:[s&&d.jsx("div",{className:"as-empty__icon","aria-hidden":"true",children:s}),d.jsx("div",{className:"as-empty__title",children:t}),r&&d.jsx("div",{className:"as-empty__body",children:r}),i&&d.jsx("div",{className:"as-empty__action",children:i})]})}function Ii({rows:t=4,height:r=28}){return d.jsx("div",{className:"as-loading","aria-busy":"true","aria-label":"Loading",children:Array.from({length:t},(i,s)=>d.jsx(Mo,{height:r},s))})}function Ex({items:t}){return d.jsx("dl",{className:"as-details",children:t.map(([r,i],s)=>d.jsxs("div",{className:"as-details__row",children:[d.jsx("dt",{children:r}),d.jsx("dd",{children:i})]},s))})}function Px({code:t,label:r}){return d.jsxs("div",{className:"as-code",children:[d.jsxs("div",{className:"as-code__bar",children:[d.jsx("span",{className:"as-code__label",children:r}),d.jsx(Bc,{value:t})]}),d.jsx("pre",{children:d.jsx("code",{children:t})})]})}function VS({secret:t,note:r="Copy it now. It will not be shown again."}){return d.jsxs("div",{className:"as-secret",children:[d.jsxs("div",{className:"as-secret__row",children:[d.jsx("code",{className:"as-secret__value",children:t}),d.jsx(Bc,{value:t})]}),d.jsx("p",{className:"as-secret__note",children:r})]})}function jx(t,r){return["as-field",r==="sm"?"as-field--sm":null,t].filter(Boolean).join(" ")}function bx(t,r){return["as-field__input",t,r?"as-field__input--mono":null].filter(Boolean).join(" ")}function Tx({error:t,hint:r}){return t?d.jsx("span",{className:"as-field__error",children:t}):r?d.jsx("span",{className:"as-field__hint",children:r}):null}function Rx({className:t,error:r,hint:i,id:s,label:l,size:f,mono:v,...p}){const g=M.useId(),h=s??p.name??g;return d.jsxs("label",{className:jx(t,f),htmlFor:h,children:[l&&d.jsx("span",{className:"as-field__label",children:l}),d.jsx("input",{id:h,className:bx(void 0,v),"aria-invalid":r?!0:void 0,...p}),d.jsx(Tx,{error:r,hint:i})]})}const Sv=M.createContext(()=>{});function Hc(){return M.useContext(Sv)}let Nx=1;function Ix({children:t}){const[r,i]=M.useState([]),s=M.useCallback((l,f="success")=>{const v=Nx++;i(p=>[...p.slice(-3),{id:v,tone:f,text:l}]),window.setTimeout(()=>i(p=>p.filter(g=>g.id!==v)),4e3)},[]);return d.jsxs(Sv.Provider,{value:s,children:[t,d.jsx("div",{className:"as-toasts",role:"status","aria-live":"polite",children:r.map(l=>d.jsx("div",{className:`as-toast as-toast--${l.tone}`,children:l.text},l.id))})]})}const Mx="/console/api",Lx="x-antseed-console";class ja extends Error{constructor(i,s,l,f={}){super(l);ku(this,"details");this.status=i,this.code=s,this.name="ConsoleApiError",this.details=f}}function Lr(t,r){return t instanceof ja&&(r===void 0||t.code===r)}const Op={buyer_policy_unsupported:"The buyer behind this gateway cannot apply routing policies yet. Update Antseed on the buyer host and restart it.",restart_unsupported:"The buyer cannot restart itself here. The change is saved; restart the buyer yourself to apply it.",reauth_required:"For this action, sign in again first.",config_unreadable:"The gateway could not read the buyer configuration file, so nothing was changed. Check the file on the gateway host.",operator_not_yours:"That wallet is not one of your sign-in methods. Add it as a sign-in method first, then authorize it.",reauth_wrong_member:"That passkey or wallet belongs to someone else. Confirm with one of your own sign-in methods.",reauth_unavailable:"You are signed in through Cloudflare Access, which cannot confirm this action. Sign in with a passkey or wallet instead (add one under Your sign-in methods first if you have none), then retry.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then retry.",reauth_other_credential:"Confirm with a different passkey or wallet than the one you are making the operator, then retry.",session_required:"Only an organization admin signed in to the console can change the export endpoint or content logging. Management tokens cannot.",otlp_headers_required:"You changed the endpoint, so the saved header values are not sent to it. Enter the header values again.",empty_allow_list:"This allow list is empty, so no seller could serve. Confirm to save it anyway.",last_credential:"You cannot remove your only sign-in method, or you could not sign in again. Add another passkey or wallet first.",credential_exists:"This passkey or wallet is already registered.",update_unsupported:"This gateway cannot update itself from the console. Run the update command on its host.",update_in_progress:"An update is already running. Try again when it is done.",max_keys_reached:"You already have as many keys as you are allowed. Revoke one, or ask an admin to raise your limit."};function ba(t){return t instanceof ja&&Object.hasOwn(Op,t.code)?Op[t.code]:t instanceof Error?t.message:typeof t=="string"?t:"Something went wrong."}function gr(t,r){return{...t,...r!=null&&r.confirmEmpty?{confirmEmpty:!0}:{},...r!=null&&r.acceptNarrowed?{acceptNarrowed:!0}:{}}}function aa(t){if(!t)return"";const r=new URLSearchParams;for(const[s,l]of Object.entries(t))l==null||l===""||r.set(s,String(l));const i=r.toString();return i?`?${i}`:""}async function Ox(t){let r=`http_${t.status}`,i=t.statusText||`Request failed (${t.status})`,s={};try{const l=await t.json();l!=null&&l.error&&typeof l.error.code=="string"&&(r=l.error.code),l!=null&&l.error&&typeof l.error.message=="string"&&(i=l.error.message),l&&typeof l=="object"&&(s={...l.error,...l})}catch{}return new ja(t.status,r,i,s)}function Ax(t=(i,s)=>fetch(i,s),r=Mx){async function i(h,y,x={}){const C={accept:"application/json"};h!=="GET"&&h!=="HEAD"&&(C[Lx]="1");let A;x.body!==void 0&&(C["content-type"]="application/json",A=JSON.stringify(x.body));let P;try{P=await t(`${r}${y}${aa(x.query)}`,{method:h,headers:C,body:A,credentials:"same-origin"})}catch{throw new ja(0,"network_error","Could not reach the gateway.")}if(!P.ok)throw await Ox(P);return P.status===204?void 0:(P.headers.get("content-type")??"").includes("json")?await P.json():await P.text()}const s=(h,y)=>i("GET",h,{query:y}),l=(h,y)=>i("POST",h,{body:y??{}}),f=(h,y)=>i("PATCH",h,{body:y}),v=(h,y)=>i("PUT",h,{body:y}),p=h=>i("DELETE",h),g=encodeURIComponent;return{request:i,auth:{config:()=>s("/auth/config"),me:()=>s("/auth/me"),setup:h=>l("/auth/setup",{token:h}),invite:h=>l("/auth/invite",{token:h}),passkeyRegisterOptions:h=>l("/auth/passkey/register/options",{enrollment:h}),passkeyRegisterVerify:(h,y)=>l("/auth/passkey/register/verify",{enrollment:y,response:h}),passkeyLoginOptions:()=>l("/auth/passkey/login/options",{}),passkeyLoginVerify:h=>l("/auth/passkey/login/verify",{response:h}),walletNonce:h=>l("/auth/wallet/nonce",{address:h}),walletVerify:(h,y,x)=>l("/auth/wallet/verify",{message:h,signature:y,enrollment:x}),oidcStartUrl:h=>`${r}/auth/oidc/start${aa({enrollment:h})}`,oidcLinkUrl:()=>`${r}/auth/oidc/start?link=1`,reauthPasskeyOptions:()=>l("/auth/reauth/passkey/options",{}),reauthPasskeyVerify:h=>l("/auth/reauth/passkey/verify",{response:h}),reauthWalletNonce:h=>l("/auth/reauth/wallet/nonce",{address:h}),reauthWalletVerify:(h,y)=>l("/auth/reauth/wallet/verify",{message:h,signature:y}),apiKey:h=>l("/auth/api-key",{key:h}),logout:()=>l("/auth/logout")},members:{list:()=>s("/members"),update:(h,y,x)=>f(`/members/${g(h)}`,gr(y,x)),disable:h=>l(`/members/${g(h)}/disable`),enable:h=>l(`/members/${g(h)}/enable`),removeCredential:(h,y)=>p(`/members/${g(h)}/credentials/${g(y)}`)},invites:{list:()=>s("/invites"),create:h=>l("/invites",h),revoke:h=>p(`/invites/${g(h)}`)},workspaces:{list:()=>s("/workspaces"),get:h=>s(`/workspaces/${g(h)}`),create:(h,y)=>l("/workspaces",gr(h,y)),update:(h,y,x)=>f(`/workspaces/${g(h)}`,gr(y,x)),remove:h=>p(`/workspaces/${g(h)}`),members:h=>s(`/workspaces/${g(h)}/members`),setMember:(h,y,x)=>v(`/workspaces/${g(h)}/members/${g(y)}`,{role:x}),removeMember:(h,y)=>p(`/workspaces/${g(h)}/members/${g(y)}`)},keys:{list:(h={})=>s("/keys",h),create:(h,y)=>l("/keys",gr(h,y)),update:(h,y,x)=>f(`/keys/${g(h)}`,gr(y,x)),rotate:h=>l(`/keys/${g(h)}/rotate`),revoke:h=>l(`/keys/${g(h)}/revoke`)},adminTokens:{list:()=>s("/admin-tokens"),create:(h,y,x)=>l("/admin-tokens",{label:h,scope:y,...x!==void 0?{expiresInDays:x}:{}}),revoke:h=>p(`/admin-tokens/${g(h)}`)},usage:{report:h=>s("/usage",h),requests:h=>s("/requests",h),request:h=>s(`/requests/${g(h)}`),exportUrl:h=>`${r}/usage/export.csv${aa(h)}`},favorites:{list:()=>s("/favorites"),add:h=>i("PUT",`/favorites/${g(h)}`),remove:h=>p(`/favorites/${g(h)}`)},audit:{list:h=>s("/audit",h)},wallet:{get:h=>s(`/workspaces/${g(h)}/wallet`),cardLink:(h,y,x)=>l(`/workspaces/${g(h)}/wallet/card-link`,{amountUsd:y,provider:x}),watch:(h,y)=>l(`/workspaces/${g(h)}/wallet/watch`,{mode:y}),deposits:h=>s(`/workspaces/${g(h)}/deposits`),addDeposit:(h,y)=>l(`/workspaces/${g(h)}/deposits`,{txHash:y}),approveDeposit:(h,y,x)=>v(`/workspaces/${g(h)}/deposits/${g(y)}/approval`,{note:x}),unapproveDeposit:(h,y)=>i("DELETE",`/workspaces/${g(h)}/deposits/${g(y)}/approval`),operator:(h,y=!1)=>s(`/workspaces/${g(h)}/wallet/operator`,{fresh:y?1:void 0}),operators:()=>s("/wallet/operators"),operatorSync:(h,y)=>l(`/workspaces/${g(h)}/wallet/operator/sync`,y?{txHash:y}:{}),operatorAuth:(h,y)=>l(`/workspaces/${g(h)}/wallet/operator-auth`,{operator:y}),channels:(h,y=!1,x=!1)=>s(`/workspaces/${g(h)}/channels`,{all:y?1:void 0,fresh:x?1:void 0}),closeChannel:(h,y)=>l(`/workspaces/${g(h)}/channels/close`,{peerId:y}),rewards:h=>s(`/workspaces/${g(h)}/rewards`),chain:()=>s("/chain")},chat:{models:h=>s("/chat/models",{workspace:h}),context:h=>s("/chat/context",{workspace:h}),threads:h=>s("/chat/threads",{workspace:h}),thread:(h,y)=>s(`/chat/threads/${g(y)}`,{workspace:h}),deleteThread:(h,y)=>p(`/chat/threads/${g(y)}${aa({workspace:h})}`)},network:{peers:()=>s("/peers"),models:()=>s("/models"),routers:()=>s("/routers"),routePreview:h=>s("/route-preview",h),resetSellerHistory:h=>l("/routing/seller-history/reset",{peerId:h}),gatewayPolicy:()=>s("/routing"),buyerLimits:()=>s("/routing/buyer-limits"),setGatewayPolicy:(h,y)=>i("PUT","/routing",{body:h,query:{confirmEmpty:y!=null&&y.confirmEmpty?1:void 0,acceptNarrowed:y!=null&&y.acceptNarrowed?1:void 0}}),peerLists:()=>s("/peer-lists"),createPeerList:h=>l("/peer-lists",h),updatePeerList:(h,y)=>f(`/peer-lists/${g(h)}`,y),removePeerList:h=>p(`/peer-lists/${g(h)}`)},presets:{list:h=>s("/presets",{workspace:h}),create:(h,y)=>l("/presets",gr(h,y)),update:(h,y,x)=>f(`/presets/${g(h)}`,gr(y,x)),remove:h=>p(`/presets/${g(h)}`)},settings:{status:()=>s("/status"),get:()=>s("/settings"),updateBuyer:h=>f("/settings/buyer",h),setObservability:h=>v("/settings/observability",h)},update:{get:()=>s("/update"),check:()=>l("/update/check"),apply:h=>l("/update",{action:h})}}}function Cv(t){return!!t&&"ownerRoutingPolicy"in t}const ae=Ax();function Li(t){return t.orgRole==="owner"||t.orgRole==="admin"}function Wc(t){return Li(t)||t.workspaceRole==="admin"}const Vc=[{id:"overview",label:"Overview",group:"Workspace",access:"member"},{id:"chat",label:"Chat",group:"Workspace",access:"member"},{id:"activity",label:"Activity",group:"Workspace",access:"member"},{id:"logs",label:"Logs",group:"Workspace",access:"member"},{id:"keys",label:"Keys",group:"Workspace",access:"member"},{id:"presets",label:"Presets",group:"Workspace",access:"member"},{id:"wallet",label:"Wallet & Funding",group:"Money",access:"workspaceAdmin"},{id:"rewards",label:"Rewards",group:"Money",access:"workspaceAdmin"},{id:"staking",label:"Staking",group:"Money",access:"workspaceAdmin"},{id:"providers",label:"Providers",group:"Routing",access:"member"},{id:"models",label:"Models",group:"Routing",access:"member"},{id:"routing",label:"Routing",group:"Routing",access:"workspaceAdmin"},{id:"members",label:"Members",group:"Organization",access:"workspaceAdmin"},{id:"workspaces",label:"Workspaces",group:"Organization",access:"workspaceAdmin"},{id:"audit",label:"Audit log",group:"Organization",access:"orgAdmin"},{id:"settings",label:"Settings",group:"Organization",access:"orgAdmin"}];function qc(t,r){const i=Vc.find(s=>s.id===t);return i?i.access==="orgAdmin"?Li(r):i.access==="workspaceAdmin"?Wc(r):!0:!1}function Dx(t){return Vc.filter(r=>qc(r.id,t))}function Fx(t,r){const i=t.me.workspaces.find(s=>s.workspace.id===r);return{orgRole:t.me.member.orgRole,workspaceRole:(i==null?void 0:i.role)??null}}const Kc={owner:"Owner",admin:"Admin",member:"Member"};function $x(t,r){return r?`${t}/${encodeURIComponent(r)}`:t}function zx(t){const r=t.join("/");return r===""?null:r}function Ux(t,r){return t==="network"?$x("providers",zx(r)):null}const _v=M.createContext(null);function Pn(){const t=M.useContext(_v);if(!t)throw new Error("useConsole outside the console shell");return t}const Ev="antseed-console-workspace";function Bx(){try{return localStorage.getItem(Ev)}catch{return null}}function Hx(t){try{localStorage.setItem(Ev,t)}catch{}}function Ap(t,r){const i=t.workspaces.map(s=>s.workspace);return i.find(s=>s.id===r)??i.find(s=>s.isDefault)??i[0]??null}function qS(){const{workspace:t,viewer:r,me:i}=Pn();return Wc(r)?{workspace:t.id}:{workspace:t.id,member:i.member.id}}const uc="antseed-console-theme";function Pv(){try{const t=localStorage.getItem(uc);return t==="light"||t==="dark"?t:"system"}catch{return"system"}}function Wx(){const t=Pv();t!=="system"&&(document.documentElement.dataset.theme=t)}function Vx(){const[t,r]=M.useState(Pv);return M.useEffect(()=>{t==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=t;try{t==="system"?localStorage.removeItem(uc):localStorage.setItem(uc,t)}catch{}},[t]),[t,r]}function KS(){var r;const t=document.documentElement.dataset.theme;return t?t==="dark":((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}const Lo="/console";function qx(t){try{return decodeURIComponent(t)}catch{return t}}function jv(t,r="",i=""){const l=(t.startsWith(Lo)?t.slice(Lo.length):t).split("/").filter(Boolean).map(qx);return{page:l[0]??"",rest:l.slice(1),query:new URLSearchParams(r),hash:i.replace(/^#/,"")}}function Dp(){return jv(window.location.pathname,window.location.search,window.location.hash)}const cc=new Set;function Kt(t,r={}){const i=t.startsWith("/")?`${Lo}${t}`:`${Lo}/${t}`;r.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),cc.forEach(s=>s())}function Kx(t){return cc.add(t),window.addEventListener("popstate",t),()=>{cc.delete(t),window.removeEventListener("popstate",t)}}function Qc(){const[t,r]=M.useState(Dp);return M.useEffect(()=>Kx(()=>r(Dp())),[]),t}function Ho(t){return`${Lo}/${t.replace(/^\//,"")}`}function Gc(t){return r=>{r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||(r.preventDefault(),Kt(t))}}const Qx=6;function Xe(t){if(t==null||t==="")return 0;const r=Number(t);return Number.isFinite(r)?r:0}function Gx(t,r={}){if(t==null)return"—";const i=typeof t=="number"?t:Xe(t),s=i<0?"-":"",l=Math.abs(i);return r.compact&&l>=1e4?`${s}$${new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(l)}`:l!==0&&l<1e-4?`${s}<$0.0001`:l!==0&&l<.01?`${s}$${l.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`:`${s}$${l.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function QS(t){const r=t.trim().replace(/^\$/,"").replace(/,/g,"");if(r==="")return null;const i=/^(\d+)(?:\.(\d{0,6}))?$/.exec(r);if(!i)throw new Error("Use a dollar amount like 5 or 12.50 (up to 6 decimals).");const s=i[1].replace(/^0+(?=\d)/,""),l=(i[2]??"").padEnd(Qx,"0");return`${s}.${l}`}function GS(t){return t==null?"":t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t}function Yx(t,r={}){return t==null||!Number.isFinite(t)?"—":r.compact&&Math.abs(t)>=1e4?new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(t):t.toLocaleString("en-US")}function YS(t){return Yx(t,{compact:!0})}function Du(t){return t==null?"—":t===0?"Free":t<.01?`$${t.toLocaleString("en-US",{maximumSignificantDigits:2})}`:`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:t<1?3:2})}`}function ZS(t){return t?t.min===t.max?Du(t.min):`${t.min===0?"$0":Du(t.min)}–${Du(t.max)}`:"—"}function XS(t){return t==null?"—":t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)} s`:`${Math.round(t)} ms`}function JS(t){return t==null?"—":`${Math.round(t)} tok/s`}function eC(t){if(t==null)return"—";const r=Math.floor(t/6e4);if(r<1)return"<1 min";if(r<60)return`${r} min`;const i=Math.floor(r/60);return i<48?`${i} h ${r%60} min`:`${Math.floor(i/24)} d ${i%24} h`}function Zx(t){return t?new Date(t).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function Xx(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"—"}function wa(t,r=Date.now()){if(!t)return"Never";const i=r-t,s=i<0,l=Math.abs(i),f=6e4,v=60*f,p=24*v;let g;if(l<f)return s?"in a moment":"just now";if(l<v)g=`${Math.round(l/f)} min`;else if(l<p)g=`${Math.round(l/v)} h`;else if(l<30*p)g=`${Math.round(l/p)} d`;else return Xx(t);return s?`in ${g}`:`${g} ago`}function ln(t,r=6,i=4){return t?t.length<=r+i+1?t:`${t.slice(0,r)}…${t.slice(-i)}`:"—"}const bv=["daily","weekly","monthly","total"],tC={daily:"Daily",weekly:"Weekly",monthly:"Monthly",total:"Total"};function Jx(t){if(!t)return"No limits";const r={daily:"/day",weekly:"/week",monthly:"/month",total:" total"},i=bv.filter(s=>t[s]!==null).map(s=>`${Gx(t[s])}${r[s]}`);return i.length>0?i.join(" · "):"No limits"}function nC(t,r=Date.now()){const i=new Date(r),s=Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate());if(t==="daily")return s;if(t==="monthly")return Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1);const l=(i.getUTCDay()+6)%7;return s-l*864e5}const e2=15*6e4;function t2(t){return t.status==="active"||t.status==="open"||t.status==="closing"||t.status==="withdrawable"}function rC(t,r){return t.status==="withdrawable"?"withdraw":t.status!=="active"&&t.status!=="open"?"none":t.canCooperativeClose&&!r?"cooperative":"on-chain"}function n2(t){return t.closeRequestedAt===null?null:t.closeRequestedAt+e2}function r2(t,r=Date.now()){const i=Math.max(0,t-r);return i>=6e4?`${Math.ceil(i/6e4)} min`:`${Math.ceil(i/1e3)} s`}function iC(t,r=Date.now()){if(t.status==="closing"){const i=n2(t);return i===null?"closing":`closing · ${r2(i,r)} left`}return t.status==="withdrawable"?"ready to withdraw":t.status==="timedout"?"withdrawn":t.status}function oC(t){return t.status==="active"||t.status==="open"?"success":t.status==="withdrawable"?"warning":t.status==="closing"?"info":"neutral"}function i2(t){return Math.max(0,Xe(t.reserved)-Xe(t.spent))}function o2(t){const r=t.filter(i=>i.status==="withdrawable");return{count:r.length,amount:r.reduce((i,s)=>i+i2(s),0)}}function sC(t){return t.filter(t2).reduce((r,i)=>r+Math.max(0,Xe(i.spent)-Xe(i.settled??"0")),0)}function aC(t){return Xe(t.reserved)>0&&Xe(t.available)<=0&&Xe(t.walletUsdc)<=0}function s2(t){const r=Xe(t.walletUsdc);if(r<=0)return!1;const i=t.creditLimit===null?0:Xe(t.creditLimit),s=Math.max(0,i-Xe(t.available)-Xe(t.reserved));return!(i>0&&r>s)}function lC(t){const r=Xe(t.walletUsdc),i=t.creditLimit===null?0:Xe(t.creditLimit),s=Math.max(0,i-Xe(t.available)-Xe(t.reserved));return i>0&&r>s?"Credits are at or near the credit limit, so this USDC waits in the workspace wallet and tops the credits up as they are spent.":"This USDC is in the workspace wallet and moves into the credits automatically."}function uC(t){const r=t.toLowerCase();return r.includes("already in flight")?"A close request to this seller is still waiting for an answer (it gives up after a minute). Close on chain instead, or try again shortly.":r.includes("busy")||r.includes("still processing")?"The seller is still processing a request. Try again shortly, or close on chain.":r.includes("pending_auth")||r.includes("latest payment authorization")?"The seller is waiting for the latest payment authorization. Try again shortly, or close on chain.":r.includes("no_channel")||r.includes("no longer has this channel")?"The seller no longer has this channel open. It may already be settled; refresh the list, or close on chain.":r.includes("did not answer")||r.includes("not connected")||r.includes("could not be found")||r.includes("disconnected")?"The seller did not answer. Close on chain instead: it does not need the seller.":r.includes("does not support cooperative close")?"This seller does not support a cooperative close. Close on chain instead.":`${t} The channel is unchanged; close on chain instead.`}const a2={usdc:["usdc","USDC","usdcToken"],deposits:["deposits","AntseedDeposits","antseedDeposits"],usageRewards:["usageRewards","AntseedUsageRewards","UsageRewards"],channels:["channels","AntseedChannels","antseedChannels"]};function cC(t,r){if(!t)return null;const i=Object.entries(t.contracts);for(const s of a2[r]){const l=i.find(([f])=>f.toLowerCase()===s.toLowerCase());if(l&&/^0x[0-9a-fA-F]{40}$/.test(l[1]))return l[1]}return null}function Oo(t,r){return!!t&&!!r&&t.toLowerCase()===r.toLowerCase()}const l2="0x0000000000000000000000000000000000000000";function Yc(t){return!!t&&/^0x[0-9a-fA-F]{40}$/.test(t)&&t.toLowerCase()!==l2}function dC(t,r){return t!=null&&t.explorerUrl?`${t.explorerUrl.replace(/\/+$/,"")}/tx/${r}`:null}const me={group:t=>[t],me:["me"],authConfig:["auth-config"],status:["status"],update:["update"],settings:["settings"],workspaces:["workspaces","list"],workspace:t=>["workspaces","detail",t],workspaceMembers:t=>["workspaces","members",t],members:["members","list"],invites:["invites"],keys:t=>["keys","list",t],usage:t=>["usage",t],requests:t=>["requests","list",t],request:t=>["requests","detail",t],audit:t=>["audit",t],wallet:t=>["wallet",t],deposits:t=>["deposits",t],channels:(t,r)=>["channels",t,r],operators:["wallet-operators"],rewards:t=>["rewards",t],chain:["chain"],chatModels:t=>["chat-models",t],chatContext:t=>["chat-context",t],chatThreads:t=>["chat-threads",t],chatThread:(t,r)=>["chat-thread",t,r],peers:["peers"],models:["models"],routers:["routers"],favorites:["favorites"],peerLists:["peer-lists"],gatewayPolicy:["routing","gateway"],buyerLimits:["routing","buyer-limits"],routePreview:t=>["routing","preview",t],presets:t=>["presets",t],adminTokens:["admin-tokens"]},fC=["routing","workspaces","members","keys","presets"];function u2(t,r=ae){return{queryKey:me.workspace(t),queryFn:()=>r.workspaces.get(t)}}function hC(t,r=!0){return Te({...u2(t),enabled:r})}function pC(t=!0){return Te({queryKey:me.peers,queryFn:ae.network.peers,staleTime:3e4,enabled:t})}const c2=2160*60*60*1e3;function mC(t){return Te({queryKey:me.usage({...t,groupBy:"router",routersUsed:!0}),queryFn:async()=>(await ae.usage.report({...t,groupBy:"router",from:Date.now()-c2})).groups.map(i=>i.group).filter(i=>i!==""),staleTime:6e4})}function vC(t=!0){return Te({queryKey:me.models,queryFn:ae.network.models,staleTime:3e4,enabled:t})}function gC(){return Te({queryKey:me.routers,queryFn:()=>ae.network.routers().catch(()=>[]),staleTime:3e4})}function yC(){return Te({queryKey:me.favorites,queryFn:()=>ae.favorites.list().then(t=>t.models).catch(()=>[]),staleTime:6e4})}function wC(){const t=Qt();return bm({mutationFn:({id:r,favorite:i})=>i?ae.favorites.add(r):ae.favorites.remove(r),onMutate:async({id:r,favorite:i})=>{await t.cancelQueries({queryKey:me.favorites});const s=t.getQueryData(me.favorites);return t.setQueryData(me.favorites,(l=[])=>i?[...l.filter(f=>f!==r),r]:l.filter(f=>f!==r)),{previous:s}},onError:(r,i,s)=>{s!=null&&s.previous&&t.setQueryData(me.favorites,s.previous)},onSettled:()=>{t.invalidateQueries({queryKey:me.favorites})}})}function xC(t=!0){return Te({queryKey:me.peerLists,queryFn:ae.network.peerLists,staleTime:3e4,enabled:t})}function kC(){return Te({queryKey:me.workspaces,queryFn:ae.workspaces.list})}function SC(t,r=!0){return Te({queryKey:me.workspaceMembers(t),queryFn:()=>ae.workspaces.members(t),enabled:r})}function CC(t=!0){return Te({queryKey:me.members,queryFn:ae.members.list,enabled:t})}function _C(){return Te({queryKey:me.invites,queryFn:ae.invites.list})}function EC(t,r=!0){return Te({queryKey:me.keys(t),queryFn:()=>ae.keys.list(t),enabled:r})}function PC(t,r=!0){return Te({queryKey:me.presets(t),queryFn:()=>ae.presets.list(t),enabled:r})}function jC(t,r=!0){return Te({queryKey:me.wallet(t),queryFn:()=>ae.wallet.get(t),enabled:r,refetchInterval:i=>i.state.data&&s2(i.state.data)?5e3:!1})}function bC(){return Te({queryKey:me.gatewayPolicy,queryFn:ae.network.gatewayPolicy})}function TC(){return Te({queryKey:me.buyerLimits,queryFn:ae.network.buyerLimits})}function RC(){return Te({queryKey:me.adminTokens,queryFn:ae.adminTokens.list})}function d2(){return Te({queryKey:me.me,queryFn:ae.auth.me})}function Zc(t=!0){return Te({queryKey:me.authConfig,queryFn:ae.auth.config,enabled:t})}function Xc(){return Te({queryKey:me.status,queryFn:ae.settings.status,refetchInterval:3e4})}function Tv(t=!0){return Te({queryKey:me.update,queryFn:ae.update.get,enabled:t,retry:!1,refetchInterval:r=>{var s,l;const i=(l=(s=r.state.data)==null?void 0:s.progress)==null?void 0:l.state;return i==="requested"||i==="running"?2e3:10*6e4}})}function NC(t=!0){return Te({queryKey:me.chain,queryFn:ae.wallet.chain,staleTime:1/0,enabled:t})}function IC(t){const r=new Set;for(const i of t??[])for(const s of i.services)r.add(s.service);return[...r].sort()}const Rv=t=>["wallet-operator",t],Nv={get:(t,r=!1)=>ae.wallet.operator(t,r),sync:(t,r)=>ae.wallet.operatorSync(t,r),authorize:(t,r)=>ae.wallet.operatorAuth(t,r)};function MC(t,r=!0){return Te({queryKey:Rv(t),queryFn:()=>Nv.get(t),staleTime:3e4,enabled:r})}function f2(t=!0){return Te({queryKey:me.operators,queryFn:()=>ae.wallet.operators(),staleTime:6e4,enabled:t})}function h2(t){return(t==null?void 0:t.relation)==="none"}function LC(t){const r=Qt(),i=s=>{r.setQueryData(Rv(t),s),r.invalidateQueries({queryKey:me.operators}),r.invalidateQueries({queryKey:me.wallet(t)}),r.invalidateQueries({queryKey:me.rewards(t)})};return{apply:i,refresh:async()=>i(await Nv.get(t,!0))}}function OC(t,r){const i=t.operator,s=ln(i),l=Yc(i)&&Oo(r,i),f=v=>l?{canManage:!0,manageHint:null}:{canManage:!1,manageHint:`Only ${v} can transfer or remove it: connect ${s} to do so.`};switch(t.relation){case"none":return{tone:"warning",badge:"Not set",title:"No authorized wallet",summary:t.canAuthorize?"Authorize one of your wallets to withdraw funds and claim ANTS rewards. Requests keep working meanwhile.":"Nobody can withdraw funds or claim ANTS rewards until the organization owner authorizes a wallet.",body:t.canAuthorize?"Nobody can withdraw this workspace's funds or claim its ANTS rewards until you authorize one of your wallets. Requests keep working meanwhile.":"Nobody can withdraw this workspace's funds or claim its ANTS rewards until one is authorized. Only the organization owner can authorize a wallet; requests keep working meanwhile.",canAuthorize:t.canAuthorize,canManage:!1,manageHint:null,canLink:!1};case"self":return{tone:"info",badge:"Workspace wallet",title:"The workspace wallet authorizes itself",summary:"Withdrawals and rewards stay in the wallet the gateway holds.",body:"Withdrawals and rewards stay in the wallet the gateway holds. To hand the role to a personal wallet, run `antseed gateway workspace operator transfer <workspace> <address>` on the gateway host (the workspace wallet pays the gas).",canAuthorize:!1,canManage:!1,manageHint:null,canLink:!1};case"yours":return{tone:"success",badge:"Your wallet",title:`Your wallet ${s}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...f("this wallet")};case"member":{const v=t.memberLabel?`${t.memberLabel}'s wallet`:"Another member's wallet";return{tone:"info",badge:t.memberLabel?t.memberLabel:"Member",title:`${v} ${s}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...f(t.memberLabel?`${t.memberLabel}'s wallet`:"that member's wallet")}}case"unknown":return{tone:"info",badge:"Not linked to a console member",title:`Authorized wallet ${s}`,summary:"Withdrawals and ANTS rewards go to this wallet. If it is yours, link it to your account to manage it here.",body:"No member of this gateway signs in with this address, yet withdrawals and ANTS rewards go to it, and only it can transfer or remove the role: not the gateway, not the organization owner. If nobody on your team controls it, do not add more than you plan to spend (the gateway can still spend the balance on requests, but it cannot be withdrawn). Ask whoever controls it to transfer the role, or move to a new workspace with a fresh wallet.",canAuthorize:!1,canLink:!0,...f("that wallet")}}}function AC(t,r,i){if(!t)return{ok:!1,reason:"Checking the authorized wallet…",operator:null};const s=Yc(t.operator)?t.operator:null;return s?t.relation==="self"?{ok:!1,operator:s,reason:`This workspace's authorized wallet is the gateway-held wallet itself, so a browser wallet cannot ${i}. Use the antseed CLI on the gateway host, or transfer the role to a personal wallet.`}:r?Oo(r,s)?{ok:!0,operator:s,reason:null}:{ok:!1,operator:s,reason:`The connected wallet ${ln(r)} is not the authorized wallet ${ln(s)}. Switch to ${ln(s)} in your wallet to ${i}.`}:{ok:!1,operator:s,reason:`Connect the authorized wallet ${ln(s)} to ${i}. Funds go to that wallet.`}:{ok:!1,operator:null,reason:`Only the authorized wallet can ${i}, and none is set. ${t.canAuthorize?"Authorize one of your wallets under Authorized wallet.":"Ask the organization owner to authorize one."}`}}function DC(t,r=Date.now()){return t.eligibleWallets.map(i=>({...i,ready:i.eligibleAt<=r}))}function FC(t,r,i=Date.now()){if(!t.canAuthorize)return t.relation==="none"?"Only the organization owner can authorize a wallet.":"A wallet is already authorized; only it can transfer the role.";if(!r)return"Connect the wallet you want to authorize.";const s=t.eligibleWallets.find(l=>Oo(l.address,r));return s?s.eligibleAt>i?`${ln(r)} was added as a sign-in method recently. For your safety it can be authorized from ${Zx(s.eligibleAt)}.`:null:`${ln(r)} is not one of your sign-in methods. Add it under Your sign-in methods first; it can be authorized 24 hours later.`}const Iv={OperatorAlreadySet:{message:"Another wallet was authorized in the meantime. The panel now shows the current authorized wallet.",refresh:!0},InvalidNonce:{message:"The authorization expired: the operator nonce changed on chain. Start again to get a fresh authorization.",refresh:!0},InvalidSignature:{message:"The contract rejected the gateway's signature. The gateway and your wallet may be on different chains or deposits contracts.",refresh:!1},NotAuthorized:{message:"The connected wallet is not (or no longer) the authorized wallet. The panel now shows the current one.",refresh:!0},NotRewardRecipient:{message:"Only the authorized wallet can claim. The panel now shows the current one.",refresh:!0},RewardRecipientUnavailable:{message:"No authorized wallet is set, so rewards cannot be claimed yet.",refresh:!0},InsufficientBalance:{message:"Not enough available balance; funds reserved in open channels cannot be withdrawn.",refresh:!0},InvalidAddress:{message:"The contract rejected the address.",refresh:!1},ChannelNotActive:{message:"This channel is already settled or closed; nothing is left to do. The list now shows it.",refresh:!0},CloseAlreadyRequested:{message:"A close was already requested for this channel. The list now shows when the reserve can be withdrawn.",refresh:!0},CloseNotReady:{message:"The 15-minute grace period has not ended yet. Withdraw once the countdown reaches zero.",refresh:!0}};function p2(t){const r=new Set;let i=t;for(;i&&typeof i=="object"&&!r.has(i);){r.add(i);const l=i.data;if(l&&typeof l.errorName=="string")return l.errorName;i=i.cause}const s=t instanceof Error?`${t.message} ${t.shortMessage??""}`:String(t??"");return Object.keys(Iv).find(l=>s.includes(l))??null}function $C(t){const r=p2(t);return r?Iv[r]??null:null}class _o extends Error{constructor(r,i,s=!1){super(r),this.refresh=i,this.retryAuth=s,this.name="OperatorPreflightError"}}function zC(t,r,i){if(t.chainId!==void 0&&t.chainId!==i.chainId)throw new _o(`The gateway signed for chain ${t.chainId} but the console is set up for chain ${i.chainId}.`,!1);if(t.depositsContract&&i.depositsContract&&!Oo(t.depositsContract,i.depositsContract))throw new _o("The gateway signed for a different deposits contract than the one the console reports. Reload the page.",!1);if(t.operator&&!Oo(t.operator,i.operator))throw new _o(`The authorization is for ${ln(t.operator)}, not ${ln(i.operator)}.`,!1);if(Yc(r.operator))throw new _o(`An authorized wallet is already set (${ln(r.operator)}). The panel now shows it.`,!0);if(r.nonce.toString()!==t.nonce)throw new _o("The operator nonce changed since the gateway signed. Getting a fresh authorization…",!0,!0)}function m2(t,r=!0){return Te({queryKey:me.channels(t,!1),queryFn:()=>ae.wallet.channels(t,!1),enabled:r})}function Mv(){const{workspace:t,viewer:r}=Pn(),i=Wc(r),s=f2(i),l=m2(t.id,i),f=s.data??[],v=new Set(f.filter(h2).map(y=>y.workspaceId)),p=f.find(y=>y.workspaceId===t.id),g=o2(l.data??[]),h=v.has(t.id);return{missingOperator:v,currentMissingOperator:h,canAuthorize:(p==null?void 0:p.canAuthorize)??!1,withdrawable:g,wallet:h||g.count>0}}const Lv=["pointerdown","mousedown","pointerup","mouseup","click"],dc=new WeakMap;function Ov(t,r,i){Jc(t);let s=l=>{let f=l.target;t.contains(f)&&((!i||i(f))&&(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation()),l.type==="click"&&(r==null||r(l)))};for(let l of Lv)document.addEventListener(l,s,!0);dc.set(t,s)}function Jc(t){let r=dc.get(t);if(r){for(let i of Lv)document.removeEventListener(i,r,!0);dc.delete(t)}}function v2(t,r){let i=t.wrapper.getBoundingClientRect();return{width:i.width+r,height:i.height+r,realWidth:i.width,realHeight:i.height}}function Fp(t,r){let{elementDimensions:i,popoverDimensions:s,popoverPadding:l,popoverArrowDimensions:f}=r;return t==="start"?Math.max(Math.min(i.top-l,window.innerHeight-s.realHeight-f.width),f.width):t==="end"?Math.max(Math.min(i.top-(s==null?void 0:s.realHeight)+i.height+l,window.innerHeight-(s==null?void 0:s.realHeight)-f.width),f.width):t==="center"?Math.max(Math.min(i.top+i.height/2-(s==null?void 0:s.realHeight)/2,window.innerHeight-(s==null?void 0:s.realHeight)-f.width),f.width):0}function $p(t,r){let{elementDimensions:i,popoverDimensions:s,popoverPadding:l,popoverArrowDimensions:f}=r;return t==="start"?Math.max(Math.min(i.left-l,window.innerWidth-s.realWidth-f.width),f.width):t==="end"?Math.max(Math.min(i.left-(s==null?void 0:s.realWidth)+i.width+l,window.innerWidth-(s==null?void 0:s.realWidth)-f.width),f.width):t==="center"?Math.max(Math.min(i.left+i.width/2-(s==null?void 0:s.realWidth)/2,window.innerWidth-(s==null?void 0:s.realWidth)-f.width),f.width):0}function ed(t,r,i){let{align:s,side:l}=i,f=i.centered?"over":l,v=i.padding,p=v2(t,i.offset),g=t.arrow.getBoundingClientRect(),h=r.getBoundingClientRect(),y=h.top-p.height,x=y>=0,C=window.innerHeight-(h.bottom+p.height),N=C>=0,A=h.left-p.width,P=A>=0,R=window.innerWidth-(h.right+p.width),F=R>=0,O=!x&&!N&&!P&&!F,E=f;if(f==="top"&&x?F=P=N=!1:f==="bottom"&&N?F=P=x=!1:f==="left"&&P?F=x=N=!1:f==="right"&&F&&(P=x=N=!1),f==="over"){let b=window.innerWidth/2-p.realWidth/2,D=window.innerHeight/2-p.realHeight/2;t.wrapper.style.left=`${b}px`,t.wrapper.style.right="auto",t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto"}else if(O){let b=window.innerWidth/2-(p==null?void 0:p.realWidth)/2;t.wrapper.style.left=`${b}px`,t.wrapper.style.right="auto",t.wrapper.style.bottom="10px",t.wrapper.style.top="auto"}else if(P){let b=Math.min(A,window.innerWidth-(p==null?void 0:p.realWidth)-g.width),D=Fp(s,{elementDimensions:h,popoverDimensions:p,popoverPadding:v,popoverArrowDimensions:g});t.wrapper.style.left=`${b}px`,t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",E="left"}else if(F){let b=Math.min(R,window.innerWidth-(p==null?void 0:p.realWidth)-g.width),D=Fp(s,{elementDimensions:h,popoverDimensions:p,popoverPadding:v,popoverArrowDimensions:g});t.wrapper.style.right=`${b}px`,t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.left="auto",E="right"}else if(x){let b=Math.min(y,window.innerHeight-p.realHeight-g.width),D=$p(s,{elementDimensions:h,popoverDimensions:p,popoverPadding:v,popoverArrowDimensions:g});t.wrapper.style.top=`${b}px`,t.wrapper.style.left=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",E="top"}else if(N){let b=Math.min(C,window.innerHeight-(p==null?void 0:p.realHeight)-g.width),D=$p(s,{elementDimensions:h,popoverDimensions:p,popoverPadding:v,popoverArrowDimensions:g});t.wrapper.style.left=`${D}px`,t.wrapper.style.bottom=`${b}px`,t.wrapper.style.top="auto",t.wrapper.style.right="auto",E="bottom"}y2(t,O?"over":E,s,r),[...t.wrapper.classList].filter(b=>b.startsWith("driver-popover-side-")||b.startsWith("driver-popover-align-")).forEach(b=>t.wrapper.classList.remove(b)),t.wrapper.classList.add(`driver-popover-side-${E}`),t.wrapper.classList.add(`driver-popover-align-${s}`)}function zp(t,r,i,s,l,f=10){let v=s-i;return t<=i&&r>=s?l==="start"?15+f/2:l==="end"?v-15-f/2:v/2:(Math.min(Math.max(t,i),s)+Math.min(Math.max(r,i),s))/2-i}function Up(t,r,i=10){let s=r-15-i;if(s<15)return Math.max(0,(r-i)/2);let l=t-i/2;return Math.min(Math.max(l,15),s)}function g2(t,r,i){return t==="left"||t==="right"?r.bottom>i.top&&r.top<i.bottom?t:r.bottom<=i.top?"bottom":"top":r.right>i.left&&r.left<i.right?t:r.right<=i.left?"right":"left"}function y2(t,r,i,s){let l=t.arrow;if(l.className="driver-popover-arrow",l.style.top="",l.style.right="",l.style.bottom="",l.style.left="",r==="over"){l.classList.add("driver-popover-arrow-none");return}let f=s.getBoundingClientRect(),v=t.wrapper.getBoundingClientRect(),p=g2(r,f,v);l.classList.add(`driver-popover-arrow-side-${p}`);let g=l.getBoundingClientRect().width||10;if(p==="left"||p==="right"){let h=zp(f.top,f.bottom,v.top,v.bottom,i,g);l.style.top=`${Up(h,v.height,g)}px`}else{let h=zp(f.left,f.right,v.left,v.right,i,g);l.style.left=`${Up(h,v.width,g)}px`}}function xa(t){return typeof t=="function"?t():typeof t=="string"?document.querySelector(t):t}function w2(t){let r=window.getComputedStyle(t);return[r.overflow,r.overflowX,r.overflowY].some(i=>i==="auto"||i==="scroll")}function la(t,r,i,s){return(t/=s/2)<1?i/2*t*t+r:-i/2*(--t*(t-2)-1)+r}function Av(t){let r='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return t.flatMap(i=>{let s=i.matches(r),l=Array.from(i.querySelectorAll(r));return[...s?[i]:[],...l]}).filter(i=>getComputedStyle(i).pointerEvents!=="none"&&S2(i))}function Dv(t,r){if(!t||k2(t))return;let i=t.offsetHeight>window.innerHeight;t.scrollIntoView({behavior:!r||x2(t)?"auto":"smooth",inline:"center",block:i?"start":"center"})}function x2(t){if(!t||!t.parentElement)return;let r=t.parentElement;return r.scrollHeight>r.clientHeight}function k2(t){let r=t.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&r.right<=(window.innerWidth||document.documentElement.clientWidth)}function S2(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function Fv(t){t&&(t.wrapper.style.display="none")}function C2(t,r){var P;let i=E2();document.body.appendChild(i.wrapper);let{title:s,description:l,showButtons:f,disableButtons:v,showProgress:p,nextBtnText:g,prevBtnText:h,progressText:y}=r;i.nextButton.innerHTML=g,i.previousButton.innerHTML=h,i.progress.innerHTML=y,i.closeButton.setAttribute("aria-label",r.closeBtnLabel),r.doneButton&&i.nextButton.classList.add("driver-popover-done-btn"),s?(i.title.innerHTML=s,i.title.style.display="block"):i.title.style.display="none",l?(i.description.innerHTML=l,i.description.style.display="block"):i.description.style.display="none";let x=f.includes("next")||f.includes("previous")||p;i.closeButton.style.display=f.includes("close")?"block":"none",x?(i.footer.style.display="flex",i.progress.style.display=p?"block":"none",i.nextButton.style.display=f.includes("next")?"block":"none",i.previousButton.style.display=f.includes("previous")?"block":"none"):i.footer.style.display="none",v.includes("next")&&(i.nextButton.disabled=!0,i.nextButton.classList.add("driver-popover-btn-disabled")),v.includes("previous")&&(i.previousButton.disabled=!0,i.previousButton.classList.add("driver-popover-btn-disabled")),v.includes("close")&&(i.closeButton.disabled=!0,i.closeButton.classList.add("driver-popover-btn-disabled"));let C=i.wrapper;C.style.display="block",C.style.left="",C.style.top="",C.style.bottom="",C.style.right="",C.id="driver-popover-content",C.setAttribute("role","dialog"),C.setAttribute("aria-labelledby","driver-popover-title"),C.setAttribute("aria-describedby","driver-popover-description");let N=i.arrow;N.className="driver-popover-arrow",C.className=`driver-popover ${r.popoverClass||""}`.trim(),Ov(i.wrapper,R=>{var O,E,b;let F=R.target;if(F.closest(".driver-popover-next-btn"))return(O=r.onNextClick)==null?void 0:O.call(r);if(F.closest(".driver-popover-prev-btn"))return(E=r.onPrevClick)==null?void 0:E.call(r);if(F.closest(".driver-popover-close-btn"))return(b=r.onCloseClick)==null?void 0:b.call(r)},R=>i.description.contains(R)||i.title.contains(R)?!1:!!R.closest(".driver-popover-prev-btn, .driver-popover-next-btn, .driver-popover-close-btn")),(P=r.onRender)==null||P.call(r,i),ed(i,t,r.position),_2(i,t,r.position),Dv(C,r.smoothScroll);let A=Av([C,t]);return A.length>0&&A[0].focus(),i}function _2(t,r,i){t.wrapper.querySelectorAll("img").forEach(s=>{if(s.complete)return;let l=()=>ed(t,r,i);s.addEventListener("load",l,{once:!0}),s.addEventListener("error",l,{once:!0})})}function E2(){let t=document.createElement("div");t.classList.add("driver-popover");let r=document.createElement("div");r.classList.add("driver-popover-arrow");let i=document.createElement("header");i.id="driver-popover-title",i.classList.add("driver-popover-title"),i.style.display="none",i.innerText="Popover Title";let s=document.createElement("div");s.id="driver-popover-description",s.classList.add("driver-popover-description"),s.style.display="none",s.innerText="Popover description is here";let l=document.createElement("button");l.type="button",l.classList.add("driver-popover-close-btn"),l.innerHTML="&times;";let f=document.createElement("footer");f.classList.add("driver-popover-footer");let v=document.createElement("span");v.classList.add("driver-popover-progress-text"),v.innerText="";let p=document.createElement("span");p.classList.add("driver-popover-navigation-btns");let g=document.createElement("button");g.type="button",g.classList.add("driver-popover-prev-btn","driver-popover-footer-btn"),g.innerHTML="Previous";let h=document.createElement("button");return h.type="button",h.classList.add("driver-popover-next-btn","driver-popover-footer-btn"),h.innerHTML="Next",p.appendChild(g),p.appendChild(h),f.appendChild(v),f.appendChild(p),t.appendChild(l),t.appendChild(r),t.appendChild(i),t.appendChild(s),t.appendChild(f),{wrapper:t,arrow:r,title:i,description:s,footer:f,previousButton:g,nextButton:h,closeButton:l,footerButtons:p,progress:v}}function $v(t){var r;t&&(Jc(t.wrapper),(r=t.wrapper.parentElement)==null||r.removeChild(t.wrapper))}function zv(t,r){let i=window.innerWidth,s=window.innerHeight,l=r.padding,f=r.radius,v=t.width+l*2,p=t.height+l*2,g=Math.min(f,v/2,p/2),h=Math.floor(Math.max(g,0)),y=t.x-l+h,x=t.y-l,C=v-h*2,N=p-h*2;return`M${i},0L0,0L0,${s}L${i},${s}L${i},0Z
81
+ `)},rx=0,ci=[];function ix(t){var r=M.useRef([]),i=M.useRef([0,0]),s=M.useRef(),l=M.useState(rx++)[0],f=M.useState(lv)[0],v=M.useRef(t);M.useEffect(function(){v.current=t},[t]),M.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(l));var P=C1([t.lockRef.current],(t.shards||[]).map(Ip),!0).filter(Boolean);return P.forEach(function(R){return R.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),P.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(l))})}}},[t.inert,t.lockRef.current,t.shards]);var p=M.useCallback(function(P,R){if("touches"in P&&P.touches.length===2||P.type==="wheel"&&P.ctrlKey)return!v.current.allowPinchZoom;var F=ia(P),O=i.current,E="deltaX"in P?P.deltaX:O[0]-F[0],b="deltaY"in P?P.deltaY:O[1]-F[1],D,W=P.target,J=Math.abs(E)>Math.abs(b)?"h":"v";if("touches"in P&&J==="h"&&W.type==="range")return!1;var Q=window.getSelection(),ie=Q&&Q.anchorNode,ue=ie?ie===W||ie.contains(W):!1;if(ue)return!1;var Y=Rp(J,W);if(!Y)return!0;if(Y?D=J:(D=J==="v"?"h":"v",Y=Rp(J,W)),!Y)return!1;if(!s.current&&"changedTouches"in P&&(E||b)&&(s.current=D),!D)return!0;var Ee=s.current||D;return ex(Ee,R,P,Ee==="h"?E:b)},[]),g=M.useCallback(function(P){var R=P;if(!(!ci.length||ci[ci.length-1]!==f)){var F="deltaY"in R?Np(R):ia(R),O=r.current.filter(function(D){return D.name===R.type&&(D.target===R.target||R.target===D.shadowParent)&&tx(D.delta,F)})[0];if(O&&O.should){R.cancelable&&R.preventDefault();return}if(!O){var E=(v.current.shards||[]).map(Ip).filter(Boolean).filter(function(D){return D.contains(R.target)}),b=E.length>0?p(R,E[0]):!v.current.noIsolation;b&&R.cancelable&&R.preventDefault()}}},[]),h=M.useCallback(function(P,R,F,O){var E={name:P,delta:R,target:F,should:O,shadowParent:ox(F)};r.current.push(E),setTimeout(function(){r.current=r.current.filter(function(b){return b!==E})},1)},[]),y=M.useCallback(function(P){i.current=ia(P),s.current=void 0},[]),x=M.useCallback(function(P){h(P.type,Np(P),P.target,p(P,t.lockRef.current))},[]),C=M.useCallback(function(P){h(P.type,ia(P),P.target,p(P,t.lockRef.current))},[]);M.useEffect(function(){return ci.push(f),t.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:C}),document.addEventListener("wheel",g,ui),document.addEventListener("touchmove",g,ui),document.addEventListener("touchstart",y,ui),function(){ci=ci.filter(function(P){return P!==f}),document.removeEventListener("wheel",g,ui),document.removeEventListener("touchmove",g,ui),document.removeEventListener("touchstart",y,ui)}},[]);var N=t.removeScrollBar,A=t.inert;return M.createElement(M.Fragment,null,A?M.createElement(f,{styles:nx(l)}):null,N?M.createElement(K0,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function ox(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const sx=_1(av,ix);var Uc=M.forwardRef(function(t,r){return M.createElement(Pa,sn({},t,{ref:r,sideCar:sx}))});Uc.classNames=Pa.classNames;var fv=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},di=new WeakMap,oa=new WeakMap,sa={},Ou=0,hv=function(t){return t&&(t.host||hv(t.parentNode))},ax=function(t,r){return r.map(function(i){if(t.contains(i))return i;var s=hv(i);return s&&t.contains(s)?s:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},pv=function(t,r,i,s){var l=ax(r,Array.isArray(t)?t:[t]);sa[i]||(sa[i]=new WeakMap);var f=sa[i],v=[],p=new Set,g=new Set(l),h=function(x){!x||p.has(x)||(p.add(x),h(x.parentNode))};l.forEach(h);var y=function(x){!x||g.has(x)||Array.prototype.forEach.call(x.children,function(C){if(p.has(C))y(C);else try{var N=C.getAttribute(s),A=N!==null&&N!=="false",P=(di.get(C)||0)+1,R=(f.get(C)||0)+1;di.set(C,P),f.set(C,R),v.push(C),P===1&&A&&oa.set(C,!0),R===1&&C.setAttribute(i,"true"),A||C.setAttribute(s,"true")}catch(F){console.error("aria-hidden: cannot operate on ",C,F)}})};return y(r),p.clear(),Ou++,function(){v.forEach(function(x){var C=di.get(x)-1,N=f.get(x)-1;di.set(x,C),f.set(x,N),C||(oa.has(x)||x.removeAttribute(s),oa.delete(x)),N||x.removeAttribute(i)}),Ou--,Ou||(di=new WeakMap,di=new WeakMap,oa=new WeakMap,sa={})}},lx=function(t,r,i){i===void 0&&(i="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),l=r||fv(t);return l?(s.push.apply(s,Array.from(l.querySelectorAll("[aria-live], script"))),pv(s,l,i,"aria-hidden")):function(){return null}},ux=function(t,r,i){i===void 0&&(i="data-inert-ed");var s=r||fv(t);return s?pv(t,s,i,"inert"):function(){return null}},cx=function(){return typeof HTMLElement<"u"&&HTMLElement.prototype.hasOwnProperty("inert")},dx=function(t,r,i){return i===void 0&&(i="data-suppressed"),(cx()?ux:lx)(t,r,i)};let Rr=[];const lc=new Set;function mv(){lc.forEach(t=>t())}function fx(t){Rr=Rr.filter(r=>r!==t),Rr.push(t),mv()}function hx(t){Rr=Rr.filter(r=>r!==t),mv()}function Au(t){return Rr[Rr.length-1]===t}function vv(t,r,i){const s=M.useRef(i),l=M.useRef(null),[f,v]=M.useState(!1);M.useEffect(()=>{s.current=i},[i]);const p=M.useCallback(()=>{const h=l.current;l.current=null,h&&document.contains(h)&&h.focus({preventScroll:!0})},[]),g=M.useCallback(()=>{s.current()},[]);return M.useEffect(()=>{if(!t)return;const h=r.current;if(!h)return;const y=h;l.current=document.activeElement instanceof HTMLElement?document.activeElement:null,fx(y),v(Au(y));function x(){v(Au(y))}function C(N){if(!Au(y))return;const A=N.target instanceof Element?N.target:null,P=A==null?void 0:A.closest('[role="dialog"]');P&&P!==y&&!y.contains(P)||N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),N.stopImmediatePropagation(),g())}return lc.add(x),window.addEventListener("keydown",C,!0),()=>{window.removeEventListener("keydown",C,!0),lc.delete(x),hx(y),p()}},[g,t,r,p]),M.useEffect(()=>{var x,C;if(!t||!f)return;const h=r.current;if(!h)return;const y=((C=(x=h.parentElement)==null?void 0:x.parentElement)==null?void 0:C.querySelectorAll("[data-focus-guard]"))??[];return dx([h,...y])},[t,f,r]),{closeDialog:g,isTopDialog:f}}const px={sm:"24rem",md:"28.75rem",lg:"35rem",xl:"52rem"};function mx(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function gv({bodyClassName:t,children:r,className:i,closeLabel:s="Close",eyebrow:l,footer:f,isOpen:v,onClose:p,overlayClassName:g,size:h="md",subtitle:y,title:x}){const C=M.useRef(null),N=M.useId(),A=M.useId(),{closeDialog:P,isTopDialog:R}=vv(v,C,p);if(!v)return null;const F=["as-modal-overlay",g].filter(Boolean).join(" "),O=["as-modal",`as-modal--${h}`,i].filter(Boolean).join(" "),E=["as-modal__body",t].filter(Boolean).join(" "),b={"--as-modal-width":px[h]};return d.jsx("div",{className:F,role:"presentation",onMouseDown:P,children:d.jsx(Uc,{allowPinchZoom:!0,className:"as-modal__scroll-lock",enabled:R,style:b,children:d.jsx(zc,{autoFocus:!0,className:"as-modal__focus-lock",disabled:!R,focusOptions:{preventScroll:!0},returnFocus:!1,children:d.jsxs("div",{"aria-describedby":y?A:void 0,"aria-hidden":R?void 0:!0,"aria-labelledby":N,"aria-modal":R?"true":void 0,className:O,ref:C,role:"dialog",tabIndex:-1,onMouseDown:D=>D.stopPropagation(),children:[d.jsxs("header",{className:"as-modal__header",children:[d.jsxs("div",{className:"as-modal__titles",children:[l&&d.jsx("div",{className:"as-modal__eyebrow",children:l}),d.jsx("h2",{className:"as-modal__title",id:N,children:x}),y&&d.jsx("p",{className:"as-modal__subtitle",id:A,children:y})]}),d.jsx(vx,{label:s,className:"as-modal__close",onClick:P,children:d.jsx(mx,{})})]}),d.jsx("div",{className:E,children:r}),f&&d.jsx("footer",{className:"as-modal__footer",children:f})]})})})})}function vx({children:t,className:r,label:i,onClick:s}){return d.jsx("button",{type:"button",className:r,onClick:s,"aria-label":i,children:t})}function gx(t){return t instanceof Error?t.message:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"Something went wrong."}function yv({isOpen:t,title:r,body:i,confirmLabel:s="Confirm",cancelLabel:l="Cancel",busyLabel:f="Working…",tone:v="danger",busy:p,error:g,errorTitle:h="That did not work",confirmDisabled:y,onConfirm:x,onClose:C}){return d.jsx(gv,{isOpen:t,onClose:p?()=>{}:C,title:r,size:"sm",children:d.jsxs("div",{className:"as-confirm",children:[d.jsx("div",{className:"as-confirm__body",children:i}),g?d.jsx(lt,{tone:"danger",title:h,children:gx(g)}):null,d.jsxs("div",{className:"as-confirm__actions",children:[d.jsx(Pe,{variant:"ghost",onClick:C,disabled:p,children:l}),d.jsx(Pe,{variant:v,onClick:x,disabled:p||y,children:p?f:s})]})]})})}function Bo({children:t,className:r,label:i,size:s="md",type:l="button",...f}){const v=["as-icon-button",s==="sm"?"as-icon-button--sm":null,r].filter(Boolean).join(" ");return d.jsx("button",{type:l,className:v,"aria-label":i,title:f.title??i,...f,children:t})}async function wv(t){try{return await navigator.clipboard.writeText(t),!0}catch{return!1}}function Mp(){return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),d.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function Lp(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"m5 12 5 5L20 7"})})}function Bc({value:t,label:r="Copy",copiedLabel:i="Copied",size:s="sm",variant:l="outline",className:f,iconOnly:v,onCopied:p}){const[g,h]=M.useState(!1),y=M.useRef(void 0);M.useEffect(()=>()=>window.clearTimeout(y.current),[]);const x=async()=>{await wv(t)&&(h(!0),p==null||p(),window.clearTimeout(y.current),y.current=window.setTimeout(()=>h(!1),1500))};return v?d.jsx(Bo,{label:g?i:r,size:"sm",className:f,onClick:()=>void x(),children:g?d.jsx(Lp,{}):d.jsx(Mp,{})}):d.jsx(Pe,{variant:l,size:s,className:f,leadingIcon:g?d.jsx(Lp,{}):d.jsx(Mp,{}),"aria-live":"polite",onClick:()=>void x(),children:g?i:r})}function yx(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function wx({actions:t,backdropClassName:r,bodyClassName:i,children:s,className:l,closeLabel:f="Close",eyebrow:v,isOpen:p,onClose:g,side:h="right",subtitle:y,title:x}){const C=M.useRef(null),N=M.useId(),A=M.useId(),{closeDialog:P,isTopDialog:R}=vv(p,C,g),F=p&&R,O=["as-drawer-backdrop",p?"as-drawer-backdrop--open":null,r].filter(Boolean).join(" "),E=["as-drawer",`as-drawer--${h}`,p?"as-drawer--open":null,l].filter(Boolean).join(" "),b=["as-drawer__body",i].filter(Boolean).join(" ");return M.useEffect(()=>{if(!p||!R)return;function D(W){const J=C.current;J&&(W.target instanceof Node&&J.contains(W.target)||W.target instanceof Element&&W.target.closest('[role="dialog"], [role="menu"]')!==null||P())}return document.addEventListener("pointerdown",D,!0),()=>document.removeEventListener("pointerdown",D,!0)},[P,p,R]),d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":!p,className:O,onClick:P}),d.jsx(Uc,{allowPinchZoom:!0,className:"as-drawer__scroll-lock",enabled:p&&R,children:d.jsx(zc,{autoFocus:!0,className:"as-drawer__focus-lock",disabled:!p||!R,focusOptions:{preventScroll:!0},returnFocus:!1,children:d.jsxs("aside",{"aria-describedby":y?A:void 0,"aria-hidden":F?void 0:!0,"aria-labelledby":N,"aria-modal":F?"true":void 0,className:E,ref:C,role:"dialog",tabIndex:-1,children:[d.jsxs("header",{className:"as-drawer__header",children:[d.jsxs("div",{className:"as-drawer__titles",children:[v&&d.jsx("div",{className:"as-drawer__eyebrow",children:v}),d.jsx("h2",{className:"as-drawer__title",id:N,children:x}),y&&d.jsx("p",{className:"as-drawer__subtitle",id:A,children:y})]}),d.jsxs("div",{className:"as-drawer__actions",children:[t,d.jsx("button",{type:"button",className:"as-drawer__close",onClick:P,"aria-label":f,children:d.jsx(yx,{})})]})]}),d.jsx("div",{className:b,children:s})]})})})]})}const xx=["M42.4461 10.2767H39.6752L35.9506 25.7053H38.2537L39.0994 21.902H43.0219L43.8495 25.7053H46.1346L42.4821 10.4203L42.4461 10.2767ZM42.59 19.9286H39.5132L41.0426 12.7525L42.59 19.9286Z","M53.9616 22.494L50.8668 10.2767H47.4841V25.7053H49.5893V13.506L52.6301 25.5618L52.6661 25.7053H56.0667V10.2767H53.9616V22.494Z","M57.7221 12.2681H61.1588V25.7053H63.3899V12.2681H66.8265V10.2767H57.7221V12.2681Z","M72.0265 16.7173H71.3788C70.9649 16.7173 70.6411 16.5917 70.3892 16.3226C70.1373 16.0535 70.0113 15.7485 70.0113 15.3359V13.7033C70.0113 13.3086 70.1552 12.9678 70.4611 12.6987C70.767 12.4116 71.1449 12.2681 71.6307 12.2681H75.1213V10.2767H71.8466C70.5511 10.2767 69.5435 10.5997 68.8418 11.2455C68.14 11.8914 67.7802 12.8601 67.7802 14.116V14.9412C67.7802 16.1791 68.104 17.1299 68.7518 17.7937C69.3995 18.4575 70.2992 18.7804 71.4148 18.7804H72.0625C72.4583 18.7804 72.7462 18.888 72.9262 19.1213C73.1241 19.3545 73.214 19.6595 73.214 20.0542V22.2967C73.214 22.6914 73.0701 23.0322 72.7642 23.3013C72.4583 23.5884 72.0805 23.7319 71.5947 23.7319H68.14V25.7233H71.3788C72.6743 25.7233 73.6819 25.4003 74.3836 24.7545C75.0853 24.1086 75.4452 23.1399 75.4452 21.8841V20.4668C75.4452 19.2289 75.1393 18.296 74.5455 17.6681C73.9518 17.0402 73.0881 16.7352 72.0265 16.7352V16.7173Z","M77.0825 25.7053H84.6576V23.7857H79.3317V18.7086H84.1178V16.7711H79.3317V12.2143H84.6576V10.2767H77.0825V25.7053Z","M86.3129 25.7053H93.888V23.7857H88.544V18.7086H93.3482V16.7711H88.544V12.2143H93.888V10.2767H86.3129V25.7053Z","M102.938 11.102C102.255 10.5459 101.211 10.2767 99.8976 10.2767H95.5253V25.7053H100.149C101.499 25.7053 102.489 25.4362 103.082 24.8801C103.694 24.3239 104 23.409 104 22.1173V13.811C104 12.5731 103.64 11.6581 102.938 11.102ZM100.347 23.7319H97.7564V12.2502H100.365C100.797 12.2502 101.121 12.3758 101.391 12.6269C101.643 12.8781 101.769 13.201 101.769 13.6316V22.3505C101.769 22.8349 101.661 23.1937 101.427 23.409C101.211 23.6243 100.833 23.7319 100.347 23.7319Z"],xv=["M12.5827 3.84445C13.2032 3.84445 13.7062 3.34146 13.7062 2.72099C13.7062 2.10052 13.2032 1.59753 12.5827 1.59753C11.9623 1.59753 11.4593 2.10052 11.4593 2.72099C11.4593 3.34146 11.9623 3.84445 12.5827 3.84445Z","M23.3679 3.84445C23.9884 3.84445 24.4914 3.34146 24.4914 2.72099C24.4914 2.10052 23.9884 1.59753 23.3679 1.59753C22.7474 1.59753 22.2445 2.10052 22.2445 2.72099C22.2445 3.34146 22.7474 3.84445 23.3679 3.84445Z","M8.0889 11.0346C8.70936 11.0346 9.21235 10.5316 9.21235 9.91112C9.21235 9.29065 8.70936 8.78766 8.0889 8.78766C7.46843 8.78766 6.96544 9.29065 6.96544 9.91112C6.96544 10.5316 7.46843 11.0346 8.0889 11.0346Z","M27.8617 11.0346C28.4822 11.0346 28.9852 10.5316 28.9852 9.91112C28.9852 9.29065 28.4822 8.78766 27.8617 8.78766C27.2413 8.78766 26.7383 9.29065 26.7383 9.91112C26.7383 10.5316 27.2413 11.0346 27.8617 11.0346Z","M6.29136 19.1235C6.91183 19.1235 7.41482 18.6205 7.41482 18C7.41482 17.3795 6.91183 16.8766 6.29136 16.8766C5.6709 16.8766 5.16791 17.3795 5.16791 18C5.16791 18.6205 5.6709 19.1235 6.29136 19.1235Z","M29.6593 19.1235C30.2797 19.1235 30.7827 18.6205 30.7827 18C30.7827 17.3795 30.2797 16.8766 29.6593 16.8766C29.0388 16.8766 28.5358 17.3795 28.5358 18C28.5358 18.6205 29.0388 19.1235 29.6593 19.1235Z","M7.19014 28.1111C7.81061 28.1111 8.31359 27.6081 8.31359 26.9877C8.31359 26.3672 7.81061 25.8642 7.19014 25.8642C6.56967 25.8642 6.06668 26.3672 6.06668 26.9877C6.06668 27.6081 6.56967 28.1111 7.19014 28.1111Z","M28.7605 28.1111C29.381 28.1111 29.884 27.6081 29.884 26.9877C29.884 26.3672 29.381 25.8642 28.7605 25.8642C28.14 25.8642 27.6371 26.3672 27.6371 26.9877C27.6371 27.6081 28.14 28.1111 28.7605 28.1111Z","M17.9753 12.3827C19.2163 12.3827 20.2222 11.2762 20.2222 9.91112C20.2222 8.54609 19.2163 7.43951 17.9753 7.43951C16.7344 7.43951 15.7284 8.54609 15.7284 9.91112C15.7284 11.2762 16.7344 12.3827 17.9753 12.3827Z","M17.9753 19.7975C19.7126 19.7975 21.121 18.188 21.121 16.2025C21.121 14.217 19.7126 12.6074 17.9753 12.6074C16.238 12.6074 14.8296 14.217 14.8296 16.2025C14.8296 18.188 16.238 19.7975 17.9753 19.7975Z","M17.9753 30.1333C20.209 30.1333 22.0198 27.719 22.0198 24.7408C22.0198 21.7625 20.209 19.3482 17.9753 19.3482C15.7416 19.3482 13.9309 21.7625 13.9309 24.7408C13.9309 27.719 15.7416 30.1333 17.9753 30.1333Z","M12.3264 2.40809C12.4993 2.26669 12.7542 2.29198 12.8956 2.4647L16.9401 7.40792C17.0815 7.58074 17.0562 7.83563 16.8835 7.9771C16.7106 8.1185 16.4558 8.09322 16.3143 7.92049L12.2698 2.97728C12.1284 2.80446 12.1537 2.54957 12.3264 2.40809Z","M23.055 2.4647C23.1965 2.29198 23.4514 2.26669 23.6242 2.40809C23.7969 2.54957 23.8222 2.80446 23.6808 2.97728L19.6364 7.92049C19.4949 8.09322 19.24 8.1185 19.0672 7.9771C18.8945 7.83563 18.8692 7.58074 19.0106 7.40792L23.055 2.4647Z","M7.73168 9.72198C7.83619 9.52458 8.08064 9.44939 8.27805 9.5539L15.9176 13.5983C16.1149 13.7029 16.1901 13.9473 16.0856 14.1447C15.9811 14.3421 15.7367 14.4173 15.5393 14.3128L7.89976 10.2683C7.70236 10.1638 7.62717 9.91938 7.73168 9.72198Z","M27.6726 9.5539C27.87 9.44939 28.1144 9.52458 28.219 9.72198C28.3235 9.91938 28.2483 10.1638 28.0509 10.2683L20.4114 14.3128C20.214 14.4173 19.9695 14.3421 19.865 14.1447C19.7605 13.9473 19.8357 13.7029 20.0331 13.5983L27.6726 9.5539Z","M14.7875 16.6988C15.0096 16.6756 15.2087 16.8371 15.2321 17.0591C15.2553 17.2812 15.0938 17.4803 14.8718 17.5037L6.3335 18.4024C6.11145 18.4257 5.91232 18.2642 5.88895 18.0421C5.8657 17.8201 6.02718 17.621 6.24924 17.5976L14.7875 16.6988Z","M21.1631 16.6988L29.7014 17.5976C29.9235 17.621 30.085 17.8201 30.0617 18.0421C30.0383 18.2642 29.8392 18.4257 29.6171 18.4024L21.0789 17.5037C20.8568 17.4803 20.6953 17.2812 20.7186 17.0591C20.742 16.8371 20.9411 16.6756 21.1631 16.6988Z","M15.1149 23.0231C15.319 22.9324 15.5578 23.0244 15.6485 23.2285C15.7392 23.4326 15.6472 23.6714 15.4432 23.7621L7.35427 27.3572C7.15017 27.4478 6.91133 27.3559 6.82063 27.1518C6.72997 26.9477 6.82192 26.7089 7.02601 26.6182L15.1149 23.0231Z","M20.3021 23.2285C20.3928 23.0244 20.6316 22.9324 20.8357 23.0231L28.9246 26.6182C29.1287 26.7089 29.2207 26.9477 29.13 27.1518C29.0393 27.3559 28.8005 27.4478 28.5964 27.3572L20.5075 23.7621C20.3034 23.6714 20.2114 23.4326 20.3021 23.2285Z"],kv="#10B981";function kx({height:t=24,className:r}){return d.jsxs("svg",{className:r,height:t,width:t*104/36,viewBox:"0 0 104 36",fill:"none",role:"img","aria-label":"Antseed",children:[xv.map(i=>d.jsx("path",{d:i,fill:kv},i)),xx.map(i=>d.jsx("path",{d:i,fill:"currentColor"},i))]})}function Sx({size:t=24,className:r}){return d.jsx("svg",{className:r,height:t,width:t,viewBox:"4 0 28 32",fill:"none",role:"img","aria-label":"Antseed",children:xv.map(i=>d.jsx("path",{d:i,fill:kv},i))})}function Mo({className:t,height:r,radius:i,style:s,width:l,...f}){const v=["as-skeleton",t].filter(Boolean).join(" ");return d.jsx("div",{className:v,style:{...s,...r!==void 0?{height:r}:{},...i!==void 0?{borderRadius:i}:{},...l!==void 0?{width:l}:{}},...f})}function BS({title:t,description:r,actions:i}){return d.jsxs("header",{className:"as-page-header",children:[d.jsxs("div",{className:"as-page-header__text",children:[d.jsx("h1",{children:t}),r&&d.jsx("p",{children:r})]}),i&&d.jsx("div",{className:"as-page-header__actions",children:i})]})}function Cx({title:t,description:r,actions:i,children:s,flush:l,className:f}){return d.jsxs("section",{className:["as-panel",f].filter(Boolean).join(" "),children:[(t||i)&&d.jsxs("div",{className:"as-panel__head",children:[d.jsxs("div",{children:[t&&d.jsx("h2",{className:"as-panel__title",children:t}),r&&d.jsx("p",{className:"as-panel__desc",children:r})]}),i&&d.jsx("div",{className:"as-panel__actions",children:i})]}),d.jsx(Pc,{className:"as-panel__card",children:d.jsx("div",{className:l?"as-panel__body as-panel__body--flush":"as-panel__body",children:s})})]})}function _x(t){return t!==null&&t>=1?"danger":t!==null&&t>=.8?"warning":"default"}function HS({label:t,value:r,sub:i,meter:s,tone:l}){const f=s==null?null:Math.max(0,Math.min(1,s));return d.jsxs(Pc,{className:"as-stat",children:[d.jsx("div",{className:"as-stat__label",children:t}),d.jsx("div",{className:"as-stat__value",children:r}),i&&d.jsx("div",{className:"as-stat__sub",children:i}),f!==null&&d.jsx("div",{className:`as-meter as-meter--${l??_x(f)}`,role:"meter","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f*100),children:d.jsx("span",{style:{width:`${f*100}%`}})})]})}function WS({title:t,body:r,action:i,icon:s}){return d.jsxs("div",{className:"as-empty",children:[s&&d.jsx("div",{className:"as-empty__icon","aria-hidden":"true",children:s}),d.jsx("div",{className:"as-empty__title",children:t}),r&&d.jsx("div",{className:"as-empty__body",children:r}),i&&d.jsx("div",{className:"as-empty__action",children:i})]})}function Ii({rows:t=4,height:r=28}){return d.jsx("div",{className:"as-loading","aria-busy":"true","aria-label":"Loading",children:Array.from({length:t},(i,s)=>d.jsx(Mo,{height:r},s))})}function Ex({items:t}){return d.jsx("dl",{className:"as-details",children:t.map(([r,i],s)=>d.jsxs("div",{className:"as-details__row",children:[d.jsx("dt",{children:r}),d.jsx("dd",{children:i})]},s))})}function Px({code:t,label:r}){return d.jsxs("div",{className:"as-code",children:[d.jsxs("div",{className:"as-code__bar",children:[d.jsx("span",{className:"as-code__label",children:r}),d.jsx(Bc,{value:t})]}),d.jsx("pre",{children:d.jsx("code",{children:t})})]})}function VS({secret:t,note:r="Copy it now. It will not be shown again."}){return d.jsxs("div",{className:"as-secret",children:[d.jsxs("div",{className:"as-secret__row",children:[d.jsx("code",{className:"as-secret__value",children:t}),d.jsx(Bc,{value:t})]}),d.jsx("p",{className:"as-secret__note",children:r})]})}function jx(t,r){return["as-field",r==="sm"?"as-field--sm":null,t].filter(Boolean).join(" ")}function bx(t,r){return["as-field__input",t,r?"as-field__input--mono":null].filter(Boolean).join(" ")}function Tx({error:t,hint:r}){return t?d.jsx("span",{className:"as-field__error",children:t}):r?d.jsx("span",{className:"as-field__hint",children:r}):null}function Rx({className:t,error:r,hint:i,id:s,label:l,size:f,mono:v,...p}){const g=M.useId(),h=s??p.name??g;return d.jsxs("label",{className:jx(t,f),htmlFor:h,children:[l&&d.jsx("span",{className:"as-field__label",children:l}),d.jsx("input",{id:h,className:bx(void 0,v),"aria-invalid":r?!0:void 0,...p}),d.jsx(Tx,{error:r,hint:i})]})}const Sv=M.createContext(()=>{});function Hc(){return M.useContext(Sv)}let Nx=1;function Ix({children:t}){const[r,i]=M.useState([]),s=M.useCallback((l,f="success")=>{const v=Nx++;i(p=>[...p.slice(-3),{id:v,tone:f,text:l}]),window.setTimeout(()=>i(p=>p.filter(g=>g.id!==v)),4e3)},[]);return d.jsxs(Sv.Provider,{value:s,children:[t,d.jsx("div",{className:"as-toasts",role:"status","aria-live":"polite",children:r.map(l=>d.jsx("div",{className:`as-toast as-toast--${l.tone}`,children:l.text},l.id))})]})}const Mx="/console/api",Lx="x-antseed-console";class ja extends Error{constructor(i,s,l,f={}){super(l);ku(this,"details");this.status=i,this.code=s,this.name="ConsoleApiError",this.details=f}}function Lr(t,r){return t instanceof ja&&(r===void 0||t.code===r)}const Op={buyer_policy_unsupported:"The buyer behind this gateway cannot apply routing policies yet. Update Antseed on the buyer host and restart it.",restart_unsupported:"The buyer cannot restart itself here. The change is saved; restart the buyer yourself to apply it.",reauth_required:"For this action, sign in again first.",config_unreadable:"The gateway could not read the buyer configuration file, so nothing was changed. Check the file on the gateway host.",operator_not_yours:"That wallet is not one of your sign-in methods. Add it as a sign-in method first, then authorize it.",reauth_wrong_member:"That passkey or wallet belongs to someone else. Confirm with one of your own sign-in methods.",reauth_unavailable:"You are signed in through Cloudflare Access, which cannot confirm this action. Sign in with a passkey or wallet instead (add one under Your sign-in methods first if you have none), then retry.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then retry.",reauth_other_credential:"Confirm with a different passkey or wallet than the one you are making the operator, then retry.",session_required:"Only an organization admin signed in to the console can change the export endpoint or content logging. Management tokens cannot.",otlp_headers_required:"You changed the endpoint, so the saved header values are not sent to it. Enter the header values again.",empty_allow_list:"This allow list is empty, so no seller could serve. Confirm to save it anyway.",last_credential:"You cannot remove your only sign-in method, or you could not sign in again. Add another passkey or wallet first.",credential_exists:"This passkey or wallet is already registered.",update_unsupported:"This gateway cannot update itself from the console. Run the update command on its host.",update_in_progress:"An update is already running. Try again when it is done.",max_keys_reached:"You already have as many keys as you are allowed. Revoke one, or ask an admin to raise your limit."};function ba(t){return t instanceof ja&&Object.hasOwn(Op,t.code)?Op[t.code]:t instanceof Error?t.message:typeof t=="string"?t:"Something went wrong."}function gr(t,r){return{...t,...r!=null&&r.confirmEmpty?{confirmEmpty:!0}:{},...r!=null&&r.acceptNarrowed?{acceptNarrowed:!0}:{}}}function aa(t){if(!t)return"";const r=new URLSearchParams;for(const[s,l]of Object.entries(t))l==null||l===""||r.set(s,String(l));const i=r.toString();return i?`?${i}`:""}async function Ox(t){let r=`http_${t.status}`,i=t.statusText||`Request failed (${t.status})`,s={};try{const l=await t.json();l!=null&&l.error&&typeof l.error.code=="string"&&(r=l.error.code),l!=null&&l.error&&typeof l.error.message=="string"&&(i=l.error.message),l&&typeof l=="object"&&(s={...l.error,...l})}catch{}return new ja(t.status,r,i,s)}function Ax(t=(i,s)=>fetch(i,s),r=Mx){async function i(h,y,x={}){const C={accept:"application/json"};h!=="GET"&&h!=="HEAD"&&(C[Lx]="1");let A;x.body!==void 0&&(C["content-type"]="application/json",A=JSON.stringify(x.body));let P;try{P=await t(`${r}${y}${aa(x.query)}`,{method:h,headers:C,body:A,credentials:"same-origin"})}catch{throw new ja(0,"network_error","Could not reach the gateway.")}if(!P.ok)throw await Ox(P);return P.status===204?void 0:(P.headers.get("content-type")??"").includes("json")?await P.json():await P.text()}const s=(h,y)=>i("GET",h,{query:y}),l=(h,y)=>i("POST",h,{body:y??{}}),f=(h,y)=>i("PATCH",h,{body:y}),v=(h,y)=>i("PUT",h,{body:y}),p=h=>i("DELETE",h),g=encodeURIComponent;return{request:i,auth:{config:()=>s("/auth/config"),me:()=>s("/auth/me"),setup:h=>l("/auth/setup",{token:h}),invite:h=>l("/auth/invite",{token:h}),passkeyRegisterOptions:h=>l("/auth/passkey/register/options",{enrollment:h}),passkeyRegisterVerify:(h,y)=>l("/auth/passkey/register/verify",{enrollment:y,response:h}),passkeyLoginOptions:()=>l("/auth/passkey/login/options",{}),passkeyLoginVerify:h=>l("/auth/passkey/login/verify",{response:h}),walletNonce:h=>l("/auth/wallet/nonce",{address:h}),walletVerify:(h,y,x)=>l("/auth/wallet/verify",{message:h,signature:y,enrollment:x}),oidcStartUrl:h=>`${r}/auth/oidc/start${aa({enrollment:h})}`,oidcLinkUrl:()=>`${r}/auth/oidc/start?link=1`,reauthPasskeyOptions:()=>l("/auth/reauth/passkey/options",{}),reauthPasskeyVerify:h=>l("/auth/reauth/passkey/verify",{response:h}),reauthWalletNonce:h=>l("/auth/reauth/wallet/nonce",{address:h}),reauthWalletVerify:(h,y)=>l("/auth/reauth/wallet/verify",{message:h,signature:y}),apiKey:h=>l("/auth/api-key",{key:h}),logout:()=>l("/auth/logout")},members:{list:()=>s("/members"),update:(h,y,x)=>f(`/members/${g(h)}`,gr(y,x)),disable:h=>l(`/members/${g(h)}/disable`),enable:h=>l(`/members/${g(h)}/enable`),removeCredential:(h,y)=>p(`/members/${g(h)}/credentials/${g(y)}`)},invites:{list:()=>s("/invites"),create:h=>l("/invites",h),revoke:h=>p(`/invites/${g(h)}`)},workspaces:{list:()=>s("/workspaces"),get:h=>s(`/workspaces/${g(h)}`),create:(h,y)=>l("/workspaces",gr(h,y)),update:(h,y,x)=>f(`/workspaces/${g(h)}`,gr(y,x)),remove:h=>p(`/workspaces/${g(h)}`),members:h=>s(`/workspaces/${g(h)}/members`),setMember:(h,y,x)=>v(`/workspaces/${g(h)}/members/${g(y)}`,{role:x}),removeMember:(h,y)=>p(`/workspaces/${g(h)}/members/${g(y)}`)},keys:{list:(h={})=>s("/keys",h),create:(h,y)=>l("/keys",gr(h,y)),update:(h,y,x)=>f(`/keys/${g(h)}`,gr(y,x)),rotate:h=>l(`/keys/${g(h)}/rotate`),revoke:h=>l(`/keys/${g(h)}/revoke`)},adminTokens:{list:()=>s("/admin-tokens"),create:(h,y,x)=>l("/admin-tokens",{label:h,scope:y,...x!==void 0?{expiresInDays:x}:{}}),revoke:h=>p(`/admin-tokens/${g(h)}`)},usage:{report:h=>s("/usage",h),requests:h=>s("/requests",h),request:h=>s(`/requests/${g(h)}`),exportUrl:h=>`${r}/usage/export.csv${aa(h)}`},favorites:{list:()=>s("/favorites"),add:h=>i("PUT",`/favorites/${g(h)}`),remove:h=>p(`/favorites/${g(h)}`)},audit:{list:h=>s("/audit",h)},wallet:{get:h=>s(`/workspaces/${g(h)}/wallet`),cardLink:(h,y,x)=>l(`/workspaces/${g(h)}/wallet/card-link`,{amountUsd:y,provider:x}),watch:(h,y)=>l(`/workspaces/${g(h)}/wallet/watch`,{mode:y}),deposits:h=>s(`/workspaces/${g(h)}/deposits`),addDeposit:(h,y)=>l(`/workspaces/${g(h)}/deposits`,{txHash:y}),approveDeposit:(h,y,x)=>v(`/workspaces/${g(h)}/deposits/${g(y)}/approval`,{note:x}),unapproveDeposit:(h,y)=>i("DELETE",`/workspaces/${g(h)}/deposits/${g(y)}/approval`),operator:(h,y=!1)=>s(`/workspaces/${g(h)}/wallet/operator`,{fresh:y?1:void 0}),operators:()=>s("/wallet/operators"),operatorSync:(h,y)=>l(`/workspaces/${g(h)}/wallet/operator/sync`,y?{txHash:y}:{}),operatorAuth:(h,y)=>l(`/workspaces/${g(h)}/wallet/operator-auth`,{operator:y}),channels:(h,y=!1,x=!1)=>s(`/workspaces/${g(h)}/channels`,{all:y?1:void 0,fresh:x?1:void 0}),closeChannel:(h,y,x)=>l(`/workspaces/${g(h)}/channels/close`,{peerId:y,channelId:x}),rewards:h=>s(`/workspaces/${g(h)}/rewards`),chain:()=>s("/chain")},chat:{models:h=>s("/chat/models",{workspace:h}),context:h=>s("/chat/context",{workspace:h}),threads:h=>s("/chat/threads",{workspace:h}),thread:(h,y)=>s(`/chat/threads/${g(y)}`,{workspace:h}),deleteThread:(h,y)=>p(`/chat/threads/${g(y)}${aa({workspace:h})}`)},network:{peers:()=>s("/peers"),models:()=>s("/models"),routers:()=>s("/routers"),routePreview:h=>s("/route-preview",h),resetSellerHistory:h=>l("/routing/seller-history/reset",{peerId:h}),gatewayPolicy:()=>s("/routing"),buyerLimits:()=>s("/routing/buyer-limits"),setGatewayPolicy:(h,y)=>i("PUT","/routing",{body:h,query:{confirmEmpty:y!=null&&y.confirmEmpty?1:void 0,acceptNarrowed:y!=null&&y.acceptNarrowed?1:void 0}}),peerLists:()=>s("/peer-lists"),createPeerList:h=>l("/peer-lists",h),updatePeerList:(h,y)=>f(`/peer-lists/${g(h)}`,y),removePeerList:h=>p(`/peer-lists/${g(h)}`)},presets:{list:h=>s("/presets",{workspace:h}),create:(h,y)=>l("/presets",gr(h,y)),update:(h,y,x)=>f(`/presets/${g(h)}`,gr(y,x)),remove:h=>p(`/presets/${g(h)}`)},settings:{status:()=>s("/status"),get:()=>s("/settings"),updateBuyer:h=>f("/settings/buyer",h),setObservability:h=>v("/settings/observability",h)},update:{get:()=>s("/update"),check:()=>l("/update/check"),apply:h=>l("/update",{action:h})}}}function Cv(t){return!!t&&"ownerRoutingPolicy"in t}const ae=Ax();function Li(t){return t.orgRole==="owner"||t.orgRole==="admin"}function Wc(t){return Li(t)||t.workspaceRole==="admin"}const Vc=[{id:"overview",label:"Overview",group:"Workspace",access:"member"},{id:"chat",label:"Chat",group:"Workspace",access:"member"},{id:"activity",label:"Activity",group:"Workspace",access:"member"},{id:"logs",label:"Logs",group:"Workspace",access:"member"},{id:"keys",label:"Keys",group:"Workspace",access:"member"},{id:"presets",label:"Presets",group:"Workspace",access:"member"},{id:"wallet",label:"Wallet & Funding",group:"Money",access:"workspaceAdmin"},{id:"rewards",label:"Rewards",group:"Money",access:"workspaceAdmin"},{id:"staking",label:"Staking",group:"Money",access:"workspaceAdmin"},{id:"providers",label:"Providers",group:"Routing",access:"member"},{id:"models",label:"Models",group:"Routing",access:"member"},{id:"routing",label:"Routing",group:"Routing",access:"workspaceAdmin"},{id:"members",label:"Members",group:"Organization",access:"workspaceAdmin"},{id:"workspaces",label:"Workspaces",group:"Organization",access:"workspaceAdmin"},{id:"audit",label:"Audit log",group:"Organization",access:"orgAdmin"},{id:"settings",label:"Settings",group:"Organization",access:"orgAdmin"}];function qc(t,r){const i=Vc.find(s=>s.id===t);return i?i.access==="orgAdmin"?Li(r):i.access==="workspaceAdmin"?Wc(r):!0:!1}function Dx(t){return Vc.filter(r=>qc(r.id,t))}function Fx(t,r){const i=t.me.workspaces.find(s=>s.workspace.id===r);return{orgRole:t.me.member.orgRole,workspaceRole:(i==null?void 0:i.role)??null}}const Kc={owner:"Owner",admin:"Admin",member:"Member"};function $x(t,r){return r?`${t}/${encodeURIComponent(r)}`:t}function zx(t){const r=t.join("/");return r===""?null:r}function Ux(t,r){return t==="network"?$x("providers",zx(r)):null}const _v=M.createContext(null);function Pn(){const t=M.useContext(_v);if(!t)throw new Error("useConsole outside the console shell");return t}const Ev="antseed-console-workspace";function Bx(){try{return localStorage.getItem(Ev)}catch{return null}}function Hx(t){try{localStorage.setItem(Ev,t)}catch{}}function Ap(t,r){const i=t.workspaces.map(s=>s.workspace);return i.find(s=>s.id===r)??i.find(s=>s.isDefault)??i[0]??null}function qS(){const{workspace:t,viewer:r,me:i}=Pn();return Wc(r)?{workspace:t.id}:{workspace:t.id,member:i.member.id}}const uc="antseed-console-theme";function Pv(){try{const t=localStorage.getItem(uc);return t==="light"||t==="dark"?t:"system"}catch{return"system"}}function Wx(){const t=Pv();t!=="system"&&(document.documentElement.dataset.theme=t)}function Vx(){const[t,r]=M.useState(Pv);return M.useEffect(()=>{t==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=t;try{t==="system"?localStorage.removeItem(uc):localStorage.setItem(uc,t)}catch{}},[t]),[t,r]}function KS(){var r;const t=document.documentElement.dataset.theme;return t?t==="dark":((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}const Lo="/console";function qx(t){try{return decodeURIComponent(t)}catch{return t}}function jv(t,r="",i=""){const l=(t.startsWith(Lo)?t.slice(Lo.length):t).split("/").filter(Boolean).map(qx);return{page:l[0]??"",rest:l.slice(1),query:new URLSearchParams(r),hash:i.replace(/^#/,"")}}function Dp(){return jv(window.location.pathname,window.location.search,window.location.hash)}const cc=new Set;function Kt(t,r={}){const i=t.startsWith("/")?`${Lo}${t}`:`${Lo}/${t}`;r.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),cc.forEach(s=>s())}function Kx(t){return cc.add(t),window.addEventListener("popstate",t),()=>{cc.delete(t),window.removeEventListener("popstate",t)}}function Qc(){const[t,r]=M.useState(Dp);return M.useEffect(()=>Kx(()=>r(Dp())),[]),t}function Ho(t){return`${Lo}/${t.replace(/^\//,"")}`}function Gc(t){return r=>{r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||(r.preventDefault(),Kt(t))}}const Qx=6;function Xe(t){if(t==null||t==="")return 0;const r=Number(t);return Number.isFinite(r)?r:0}function Gx(t,r={}){if(t==null)return"—";const i=typeof t=="number"?t:Xe(t),s=i<0?"-":"",l=Math.abs(i);return r.compact&&l>=1e4?`${s}$${new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(l)}`:l!==0&&l<1e-4?`${s}<$0.0001`:l!==0&&l<.01?`${s}$${l.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`:`${s}$${l.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function QS(t){const r=t.trim().replace(/^\$/,"").replace(/,/g,"");if(r==="")return null;const i=/^(\d+)(?:\.(\d{0,6}))?$/.exec(r);if(!i)throw new Error("Use a dollar amount like 5 or 12.50 (up to 6 decimals).");const s=i[1].replace(/^0+(?=\d)/,""),l=(i[2]??"").padEnd(Qx,"0");return`${s}.${l}`}function GS(t){return t==null?"":t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t}function Yx(t,r={}){return t==null||!Number.isFinite(t)?"—":r.compact&&Math.abs(t)>=1e4?new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(t):t.toLocaleString("en-US")}function YS(t){return Yx(t,{compact:!0})}function Du(t){return t==null?"—":t===0?"Free":t<.01?`$${t.toLocaleString("en-US",{maximumSignificantDigits:2})}`:`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:t<1?3:2})}`}function ZS(t){return t?t.min===t.max?Du(t.min):`${t.min===0?"$0":Du(t.min)}–${Du(t.max)}`:"—"}function XS(t){return t==null?"—":t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)} s`:`${Math.round(t)} ms`}function JS(t){return t==null?"—":`${Math.round(t)} tok/s`}function eC(t){if(t==null)return"—";const r=Math.floor(t/6e4);if(r<1)return"<1 min";if(r<60)return`${r} min`;const i=Math.floor(r/60);return i<48?`${i} h ${r%60} min`:`${Math.floor(i/24)} d ${i%24} h`}function Zx(t){return t?new Date(t).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function Xx(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"—"}function wa(t,r=Date.now()){if(!t)return"Never";const i=r-t,s=i<0,l=Math.abs(i),f=6e4,v=60*f,p=24*v;let g;if(l<f)return s?"in a moment":"just now";if(l<v)g=`${Math.round(l/f)} min`;else if(l<p)g=`${Math.round(l/v)} h`;else if(l<30*p)g=`${Math.round(l/p)} d`;else return Xx(t);return s?`in ${g}`:`${g} ago`}function ln(t,r=6,i=4){return t?t.length<=r+i+1?t:`${t.slice(0,r)}…${t.slice(-i)}`:"—"}const bv=["daily","weekly","monthly","total"],tC={daily:"Daily",weekly:"Weekly",monthly:"Monthly",total:"Total"};function Jx(t){if(!t)return"No limits";const r={daily:"/day",weekly:"/week",monthly:"/month",total:" total"},i=bv.filter(s=>t[s]!==null).map(s=>`${Gx(t[s])}${r[s]}`);return i.length>0?i.join(" · "):"No limits"}function nC(t,r=Date.now()){const i=new Date(r),s=Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate());if(t==="daily")return s;if(t==="monthly")return Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1);const l=(i.getUTCDay()+6)%7;return s-l*864e5}const e2=15*6e4;function t2(t){return t.status==="active"||t.status==="open"||t.status==="closing"||t.status==="withdrawable"}function rC(t,r){return t.status==="withdrawable"?"withdraw":t.status!=="active"&&t.status!=="open"?"none":t.canCooperativeClose&&!r?"cooperative":"on-chain"}function n2(t){return t.closeRequestedAt===null?null:t.closeRequestedAt+e2}function r2(t,r=Date.now()){const i=Math.max(0,t-r);return i>=6e4?`${Math.ceil(i/6e4)} min`:`${Math.ceil(i/1e3)} s`}function iC(t,r=Date.now()){if(t.status==="closing"){const i=n2(t);return i===null?"closing":`closing · ${r2(i,r)} left`}return t.status==="withdrawable"?"ready to withdraw":t.status==="timedout"?"withdrawn":t.status}function oC(t){return t.status==="active"||t.status==="open"?"success":t.status==="withdrawable"?"warning":t.status==="closing"?"info":"neutral"}function i2(t){return Math.max(0,Xe(t.reserved)-Xe(t.spent))}function o2(t){const r=t.filter(i=>i.status==="withdrawable");return{count:r.length,amount:r.reduce((i,s)=>i+i2(s),0)}}function sC(t){return t.filter(t2).reduce((r,i)=>r+Math.max(0,Xe(i.spent)-Xe(i.settled??"0")),0)}function aC(t){return Xe(t.reserved)>0&&Xe(t.available)<=0&&Xe(t.walletUsdc)<=0}function s2(t){const r=Xe(t.walletUsdc);if(r<=0)return!1;const i=t.creditLimit===null?0:Xe(t.creditLimit),s=Math.max(0,i-Xe(t.available)-Xe(t.reserved));return!(i>0&&r>s)}function lC(t){const r=Xe(t.walletUsdc),i=t.creditLimit===null?0:Xe(t.creditLimit),s=Math.max(0,i-Xe(t.available)-Xe(t.reserved));return i>0&&r>s?"Credits are at or near the credit limit, so this USDC waits in the workspace wallet and tops the credits up as they are spent.":"This USDC is in the workspace wallet and moves into the credits automatically."}function uC(t){const r=t.toLowerCase();return r.includes("already in flight")?"A close request to this seller is still waiting for an answer (it gives up after a minute). Close on chain instead, or try again shortly.":r.includes("busy")||r.includes("still processing")?"The seller is still processing a request. Try again shortly, or close on chain.":r.includes("pending_auth")||r.includes("latest payment authorization")?"The seller is waiting for the latest payment authorization. Try again shortly, or close on chain.":r.includes("no_channel")||r.includes("no longer has this channel")?"The seller no longer has this channel open. It may already be settled; refresh the list, or close on chain.":r.includes("did not answer")||r.includes("not connected")||r.includes("could not be found")||r.includes("disconnected")?"The seller did not answer. Close on chain instead: it does not need the seller.":r.includes("not the live channel")?"The seller can only close the channel it is serving now, and this is an older one. Close it on chain instead: it does not need the seller.":r.includes("does not support cooperative close")?"This seller does not support a cooperative close. Close on chain instead.":`${t} The channel is unchanged; close on chain instead.`}const a2={usdc:["usdc","USDC","usdcToken"],deposits:["deposits","AntseedDeposits","antseedDeposits"],usageRewards:["usageRewards","AntseedUsageRewards","UsageRewards"],channels:["channels","AntseedChannels","antseedChannels"]};function cC(t,r){if(!t)return null;const i=Object.entries(t.contracts);for(const s of a2[r]){const l=i.find(([f])=>f.toLowerCase()===s.toLowerCase());if(l&&/^0x[0-9a-fA-F]{40}$/.test(l[1]))return l[1]}return null}function Oo(t,r){return!!t&&!!r&&t.toLowerCase()===r.toLowerCase()}const l2="0x0000000000000000000000000000000000000000";function Yc(t){return!!t&&/^0x[0-9a-fA-F]{40}$/.test(t)&&t.toLowerCase()!==l2}function dC(t,r){return t!=null&&t.explorerUrl?`${t.explorerUrl.replace(/\/+$/,"")}/tx/${r}`:null}const me={group:t=>[t],me:["me"],authConfig:["auth-config"],status:["status"],update:["update"],settings:["settings"],workspaces:["workspaces","list"],workspace:t=>["workspaces","detail",t],workspaceMembers:t=>["workspaces","members",t],members:["members","list"],invites:["invites"],keys:t=>["keys","list",t],usage:t=>["usage",t],requests:t=>["requests","list",t],request:t=>["requests","detail",t],audit:t=>["audit",t],wallet:t=>["wallet",t],deposits:t=>["deposits",t],channels:(t,r)=>["channels",t,r],operators:["wallet-operators"],rewards:t=>["rewards",t],chain:["chain"],chatModels:t=>["chat-models",t],chatContext:t=>["chat-context",t],chatThreads:t=>["chat-threads",t],chatThread:(t,r)=>["chat-thread",t,r],peers:["peers"],models:["models"],routers:["routers"],favorites:["favorites"],peerLists:["peer-lists"],gatewayPolicy:["routing","gateway"],buyerLimits:["routing","buyer-limits"],routePreview:t=>["routing","preview",t],presets:t=>["presets",t],adminTokens:["admin-tokens"]},fC=["routing","workspaces","members","keys","presets","chat-route-preview"];function u2(t,r=ae){return{queryKey:me.workspace(t),queryFn:()=>r.workspaces.get(t)}}function hC(t,r=!0){return Te({...u2(t),enabled:r})}function pC(t=!0){return Te({queryKey:me.peers,queryFn:ae.network.peers,staleTime:3e4,enabled:t})}const c2=2160*60*60*1e3;function mC(t){return Te({queryKey:me.usage({...t,groupBy:"router",routersUsed:!0}),queryFn:async()=>(await ae.usage.report({...t,groupBy:"router",from:Date.now()-c2})).groups.map(i=>i.group).filter(i=>i!==""),staleTime:6e4})}function vC(t=!0){return Te({queryKey:me.models,queryFn:ae.network.models,staleTime:3e4,enabled:t})}function gC(){return Te({queryKey:me.routers,queryFn:()=>ae.network.routers().catch(()=>[]),staleTime:3e4})}function yC(){return Te({queryKey:me.favorites,queryFn:()=>ae.favorites.list().then(t=>t.models).catch(()=>[]),staleTime:6e4})}function wC(){const t=Qt();return bm({mutationFn:({id:r,favorite:i})=>i?ae.favorites.add(r):ae.favorites.remove(r),onMutate:async({id:r,favorite:i})=>{await t.cancelQueries({queryKey:me.favorites});const s=t.getQueryData(me.favorites);return t.setQueryData(me.favorites,(l=[])=>i?[...l.filter(f=>f!==r),r]:l.filter(f=>f!==r)),{previous:s}},onError:(r,i,s)=>{s!=null&&s.previous&&t.setQueryData(me.favorites,s.previous)},onSettled:()=>{t.invalidateQueries({queryKey:me.favorites})}})}function xC(t=!0){return Te({queryKey:me.peerLists,queryFn:ae.network.peerLists,staleTime:3e4,enabled:t})}function kC(){return Te({queryKey:me.workspaces,queryFn:ae.workspaces.list})}function SC(t,r=!0){return Te({queryKey:me.workspaceMembers(t),queryFn:()=>ae.workspaces.members(t),enabled:r})}function CC(t=!0){return Te({queryKey:me.members,queryFn:ae.members.list,enabled:t})}function _C(){return Te({queryKey:me.invites,queryFn:ae.invites.list})}function EC(t,r=!0){return Te({queryKey:me.keys(t),queryFn:()=>ae.keys.list(t),enabled:r})}function PC(t,r=!0){return Te({queryKey:me.presets(t),queryFn:()=>ae.presets.list(t),enabled:r})}function jC(t,r=!0){return Te({queryKey:me.wallet(t),queryFn:()=>ae.wallet.get(t),enabled:r,refetchInterval:i=>i.state.data&&s2(i.state.data)?5e3:!1})}function bC(){return Te({queryKey:me.gatewayPolicy,queryFn:ae.network.gatewayPolicy})}function TC(){return Te({queryKey:me.buyerLimits,queryFn:ae.network.buyerLimits})}function RC(){return Te({queryKey:me.adminTokens,queryFn:ae.adminTokens.list})}function d2(){return Te({queryKey:me.me,queryFn:ae.auth.me})}function Zc(t=!0){return Te({queryKey:me.authConfig,queryFn:ae.auth.config,enabled:t})}function Xc(){return Te({queryKey:me.status,queryFn:ae.settings.status,refetchInterval:3e4})}function Tv(t=!0){return Te({queryKey:me.update,queryFn:ae.update.get,enabled:t,retry:!1,refetchInterval:r=>{var s,l;const i=(l=(s=r.state.data)==null?void 0:s.progress)==null?void 0:l.state;return i==="requested"||i==="running"?2e3:10*6e4}})}function NC(t=!0){return Te({queryKey:me.chain,queryFn:ae.wallet.chain,staleTime:1/0,enabled:t})}function IC(t){const r=new Set;for(const i of t??[])for(const s of i.services)r.add(s.service);return[...r].sort()}const Rv=t=>["wallet-operator",t],Nv={get:(t,r=!1)=>ae.wallet.operator(t,r),sync:(t,r)=>ae.wallet.operatorSync(t,r),authorize:(t,r)=>ae.wallet.operatorAuth(t,r)};function MC(t,r=!0){return Te({queryKey:Rv(t),queryFn:()=>Nv.get(t),staleTime:3e4,enabled:r})}function f2(t=!0){return Te({queryKey:me.operators,queryFn:()=>ae.wallet.operators(),staleTime:6e4,enabled:t})}function h2(t){return(t==null?void 0:t.relation)==="none"}function LC(t){const r=Qt(),i=s=>{r.setQueryData(Rv(t),s),r.invalidateQueries({queryKey:me.operators}),r.invalidateQueries({queryKey:me.wallet(t)}),r.invalidateQueries({queryKey:me.rewards(t)})};return{apply:i,refresh:async()=>i(await Nv.get(t,!0))}}function OC(t,r){const i=t.operator,s=ln(i),l=Yc(i)&&Oo(r,i),f=v=>l?{canManage:!0,manageHint:null}:{canManage:!1,manageHint:`Only ${v} can transfer or remove it: connect ${s} to do so.`};switch(t.relation){case"none":return{tone:"warning",badge:"Not set",title:"No authorized wallet",summary:t.canAuthorize?"Authorize one of your wallets to withdraw funds and claim ANTS rewards. Requests keep working meanwhile.":"Nobody can withdraw funds or claim ANTS rewards until the organization owner authorizes a wallet.",body:t.canAuthorize?"Nobody can withdraw this workspace's funds or claim its ANTS rewards until you authorize one of your wallets. Requests keep working meanwhile.":"Nobody can withdraw this workspace's funds or claim its ANTS rewards until one is authorized. Only the organization owner can authorize a wallet; requests keep working meanwhile.",canAuthorize:t.canAuthorize,canManage:!1,manageHint:null,canLink:!1};case"self":return{tone:"info",badge:"Workspace wallet",title:"The workspace wallet authorizes itself",summary:"Withdrawals and rewards stay in the wallet the gateway holds.",body:"Withdrawals and rewards stay in the wallet the gateway holds. To hand the role to a personal wallet, run `antseed gateway workspace operator transfer <workspace> <address>` on the gateway host (the workspace wallet pays the gas).",canAuthorize:!1,canManage:!1,manageHint:null,canLink:!1};case"yours":return{tone:"success",badge:"Your wallet",title:`Your wallet ${s}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...f("this wallet")};case"member":{const v=t.memberLabel?`${t.memberLabel}'s wallet`:"Another member's wallet";return{tone:"info",badge:t.memberLabel?t.memberLabel:"Member",title:`${v} ${s}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...f(t.memberLabel?`${t.memberLabel}'s wallet`:"that member's wallet")}}case"unknown":return{tone:"info",badge:"Not linked to a console member",title:`Authorized wallet ${s}`,summary:"Withdrawals and ANTS rewards go to this wallet. If it is yours, link it to your account to manage it here.",body:"No member of this gateway signs in with this address, yet withdrawals and ANTS rewards go to it, and only it can transfer or remove the role: not the gateway, not the organization owner. If nobody on your team controls it, do not add more than you plan to spend (the gateway can still spend the balance on requests, but it cannot be withdrawn). Ask whoever controls it to transfer the role, or move to a new workspace with a fresh wallet.",canAuthorize:!1,canLink:!0,...f("that wallet")}}}function AC(t,r,i){if(!t)return{ok:!1,reason:"Checking the authorized wallet…",operator:null};const s=Yc(t.operator)?t.operator:null;return s?t.relation==="self"?{ok:!1,operator:s,reason:`This workspace's authorized wallet is the gateway-held wallet itself, so a browser wallet cannot ${i}. Use the antseed CLI on the gateway host, or transfer the role to a personal wallet.`}:r?Oo(r,s)?{ok:!0,operator:s,reason:null}:{ok:!1,operator:s,reason:`The connected wallet ${ln(r)} is not the authorized wallet ${ln(s)}. Switch to ${ln(s)} in your wallet to ${i}.`}:{ok:!1,operator:s,reason:`Connect the authorized wallet ${ln(s)} to ${i}. Funds go to that wallet.`}:{ok:!1,operator:null,reason:`Only the authorized wallet can ${i}, and none is set. ${t.canAuthorize?"Authorize one of your wallets under Authorized wallet.":"Ask the organization owner to authorize one."}`}}function DC(t,r=Date.now()){return t.eligibleWallets.map(i=>({...i,ready:i.eligibleAt<=r}))}function FC(t,r,i=Date.now()){if(!t.canAuthorize)return t.relation==="none"?"Only the organization owner can authorize a wallet.":"A wallet is already authorized; only it can transfer the role.";if(!r)return"Connect the wallet you want to authorize.";const s=t.eligibleWallets.find(l=>Oo(l.address,r));return s?s.eligibleAt>i?`${ln(r)} was added as a sign-in method recently. For your safety it can be authorized from ${Zx(s.eligibleAt)}.`:null:`${ln(r)} is not one of your sign-in methods. Add it under Your sign-in methods first; it can be authorized 24 hours later.`}const Iv={OperatorAlreadySet:{message:"Another wallet was authorized in the meantime. The panel now shows the current authorized wallet.",refresh:!0},InvalidNonce:{message:"The authorization expired: the operator nonce changed on chain. Start again to get a fresh authorization.",refresh:!0},InvalidSignature:{message:"The contract rejected the gateway's signature. The gateway and your wallet may be on different chains or deposits contracts.",refresh:!1},NotAuthorized:{message:"The connected wallet is not (or no longer) the authorized wallet. The panel now shows the current one.",refresh:!0},NotRewardRecipient:{message:"Only the authorized wallet can claim. The panel now shows the current one.",refresh:!0},RewardRecipientUnavailable:{message:"No authorized wallet is set, so rewards cannot be claimed yet.",refresh:!0},InsufficientBalance:{message:"Not enough available balance; funds reserved in open channels cannot be withdrawn.",refresh:!0},InvalidAddress:{message:"The contract rejected the address.",refresh:!1},ChannelNotActive:{message:"This channel is already settled or closed; nothing is left to do. The list now shows it.",refresh:!0},CloseAlreadyRequested:{message:"A close was already requested for this channel. The list now shows when the reserve can be withdrawn.",refresh:!0},CloseNotReady:{message:"The 15-minute grace period has not ended yet. Withdraw once the countdown reaches zero.",refresh:!0}};function p2(t){const r=new Set;let i=t;for(;i&&typeof i=="object"&&!r.has(i);){r.add(i);const l=i.data;if(l&&typeof l.errorName=="string")return l.errorName;i=i.cause}const s=t instanceof Error?`${t.message} ${t.shortMessage??""}`:String(t??"");return Object.keys(Iv).find(l=>s.includes(l))??null}function $C(t){const r=p2(t);return r?Iv[r]??null:null}class _o extends Error{constructor(r,i,s=!1){super(r),this.refresh=i,this.retryAuth=s,this.name="OperatorPreflightError"}}function zC(t,r,i){if(t.chainId!==void 0&&t.chainId!==i.chainId)throw new _o(`The gateway signed for chain ${t.chainId} but the console is set up for chain ${i.chainId}.`,!1);if(t.depositsContract&&i.depositsContract&&!Oo(t.depositsContract,i.depositsContract))throw new _o("The gateway signed for a different deposits contract than the one the console reports. Reload the page.",!1);if(t.operator&&!Oo(t.operator,i.operator))throw new _o(`The authorization is for ${ln(t.operator)}, not ${ln(i.operator)}.`,!1);if(Yc(r.operator))throw new _o(`An authorized wallet is already set (${ln(r.operator)}). The panel now shows it.`,!0);if(r.nonce.toString()!==t.nonce)throw new _o("The operator nonce changed since the gateway signed. Getting a fresh authorization…",!0,!0)}function m2(t,r=!0){return Te({queryKey:me.channels(t,!1),queryFn:()=>ae.wallet.channels(t,!1),enabled:r})}function Mv(){const{workspace:t,viewer:r}=Pn(),i=Wc(r),s=f2(i),l=m2(t.id,i),f=s.data??[],v=new Set(f.filter(h2).map(y=>y.workspaceId)),p=f.find(y=>y.workspaceId===t.id),g=o2(l.data??[]),h=v.has(t.id);return{missingOperator:v,currentMissingOperator:h,canAuthorize:(p==null?void 0:p.canAuthorize)??!1,withdrawable:g,wallet:h||g.count>0}}const Lv=["pointerdown","mousedown","pointerup","mouseup","click"],dc=new WeakMap;function Ov(t,r,i){Jc(t);let s=l=>{let f=l.target;t.contains(f)&&((!i||i(f))&&(l.preventDefault(),l.stopPropagation(),l.stopImmediatePropagation()),l.type==="click"&&(r==null||r(l)))};for(let l of Lv)document.addEventListener(l,s,!0);dc.set(t,s)}function Jc(t){let r=dc.get(t);if(r){for(let i of Lv)document.removeEventListener(i,r,!0);dc.delete(t)}}function v2(t,r){let i=t.wrapper.getBoundingClientRect();return{width:i.width+r,height:i.height+r,realWidth:i.width,realHeight:i.height}}function Fp(t,r){let{elementDimensions:i,popoverDimensions:s,popoverPadding:l,popoverArrowDimensions:f}=r;return t==="start"?Math.max(Math.min(i.top-l,window.innerHeight-s.realHeight-f.width),f.width):t==="end"?Math.max(Math.min(i.top-(s==null?void 0:s.realHeight)+i.height+l,window.innerHeight-(s==null?void 0:s.realHeight)-f.width),f.width):t==="center"?Math.max(Math.min(i.top+i.height/2-(s==null?void 0:s.realHeight)/2,window.innerHeight-(s==null?void 0:s.realHeight)-f.width),f.width):0}function $p(t,r){let{elementDimensions:i,popoverDimensions:s,popoverPadding:l,popoverArrowDimensions:f}=r;return t==="start"?Math.max(Math.min(i.left-l,window.innerWidth-s.realWidth-f.width),f.width):t==="end"?Math.max(Math.min(i.left-(s==null?void 0:s.realWidth)+i.width+l,window.innerWidth-(s==null?void 0:s.realWidth)-f.width),f.width):t==="center"?Math.max(Math.min(i.left+i.width/2-(s==null?void 0:s.realWidth)/2,window.innerWidth-(s==null?void 0:s.realWidth)-f.width),f.width):0}function ed(t,r,i){let{align:s,side:l}=i,f=i.centered?"over":l,v=i.padding,p=v2(t,i.offset),g=t.arrow.getBoundingClientRect(),h=r.getBoundingClientRect(),y=h.top-p.height,x=y>=0,C=window.innerHeight-(h.bottom+p.height),N=C>=0,A=h.left-p.width,P=A>=0,R=window.innerWidth-(h.right+p.width),F=R>=0,O=!x&&!N&&!P&&!F,E=f;if(f==="top"&&x?F=P=N=!1:f==="bottom"&&N?F=P=x=!1:f==="left"&&P?F=x=N=!1:f==="right"&&F&&(P=x=N=!1),f==="over"){let b=window.innerWidth/2-p.realWidth/2,D=window.innerHeight/2-p.realHeight/2;t.wrapper.style.left=`${b}px`,t.wrapper.style.right="auto",t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto"}else if(O){let b=window.innerWidth/2-(p==null?void 0:p.realWidth)/2;t.wrapper.style.left=`${b}px`,t.wrapper.style.right="auto",t.wrapper.style.bottom="10px",t.wrapper.style.top="auto"}else if(P){let b=Math.min(A,window.innerWidth-(p==null?void 0:p.realWidth)-g.width),D=Fp(s,{elementDimensions:h,popoverDimensions:p,popoverPadding:v,popoverArrowDimensions:g});t.wrapper.style.left=`${b}px`,t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",E="left"}else if(F){let b=Math.min(R,window.innerWidth-(p==null?void 0:p.realWidth)-g.width),D=Fp(s,{elementDimensions:h,popoverDimensions:p,popoverPadding:v,popoverArrowDimensions:g});t.wrapper.style.right=`${b}px`,t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.left="auto",E="right"}else if(x){let b=Math.min(y,window.innerHeight-p.realHeight-g.width),D=$p(s,{elementDimensions:h,popoverDimensions:p,popoverPadding:v,popoverArrowDimensions:g});t.wrapper.style.top=`${b}px`,t.wrapper.style.left=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",E="top"}else if(N){let b=Math.min(C,window.innerHeight-(p==null?void 0:p.realHeight)-g.width),D=$p(s,{elementDimensions:h,popoverDimensions:p,popoverPadding:v,popoverArrowDimensions:g});t.wrapper.style.left=`${D}px`,t.wrapper.style.bottom=`${b}px`,t.wrapper.style.top="auto",t.wrapper.style.right="auto",E="bottom"}y2(t,O?"over":E,s,r),[...t.wrapper.classList].filter(b=>b.startsWith("driver-popover-side-")||b.startsWith("driver-popover-align-")).forEach(b=>t.wrapper.classList.remove(b)),t.wrapper.classList.add(`driver-popover-side-${E}`),t.wrapper.classList.add(`driver-popover-align-${s}`)}function zp(t,r,i,s,l,f=10){let v=s-i;return t<=i&&r>=s?l==="start"?15+f/2:l==="end"?v-15-f/2:v/2:(Math.min(Math.max(t,i),s)+Math.min(Math.max(r,i),s))/2-i}function Up(t,r,i=10){let s=r-15-i;if(s<15)return Math.max(0,(r-i)/2);let l=t-i/2;return Math.min(Math.max(l,15),s)}function g2(t,r,i){return t==="left"||t==="right"?r.bottom>i.top&&r.top<i.bottom?t:r.bottom<=i.top?"bottom":"top":r.right>i.left&&r.left<i.right?t:r.right<=i.left?"right":"left"}function y2(t,r,i,s){let l=t.arrow;if(l.className="driver-popover-arrow",l.style.top="",l.style.right="",l.style.bottom="",l.style.left="",r==="over"){l.classList.add("driver-popover-arrow-none");return}let f=s.getBoundingClientRect(),v=t.wrapper.getBoundingClientRect(),p=g2(r,f,v);l.classList.add(`driver-popover-arrow-side-${p}`);let g=l.getBoundingClientRect().width||10;if(p==="left"||p==="right"){let h=zp(f.top,f.bottom,v.top,v.bottom,i,g);l.style.top=`${Up(h,v.height,g)}px`}else{let h=zp(f.left,f.right,v.left,v.right,i,g);l.style.left=`${Up(h,v.width,g)}px`}}function xa(t){return typeof t=="function"?t():typeof t=="string"?document.querySelector(t):t}function w2(t){let r=window.getComputedStyle(t);return[r.overflow,r.overflowX,r.overflowY].some(i=>i==="auto"||i==="scroll")}function la(t,r,i,s){return(t/=s/2)<1?i/2*t*t+r:-i/2*(--t*(t-2)-1)+r}function Av(t){let r='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return t.flatMap(i=>{let s=i.matches(r),l=Array.from(i.querySelectorAll(r));return[...s?[i]:[],...l]}).filter(i=>getComputedStyle(i).pointerEvents!=="none"&&S2(i))}function Dv(t,r){if(!t||k2(t))return;let i=t.offsetHeight>window.innerHeight;t.scrollIntoView({behavior:!r||x2(t)?"auto":"smooth",inline:"center",block:i?"start":"center"})}function x2(t){if(!t||!t.parentElement)return;let r=t.parentElement;return r.scrollHeight>r.clientHeight}function k2(t){let r=t.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&r.right<=(window.innerWidth||document.documentElement.clientWidth)}function S2(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function Fv(t){t&&(t.wrapper.style.display="none")}function C2(t,r){var P;let i=E2();document.body.appendChild(i.wrapper);let{title:s,description:l,showButtons:f,disableButtons:v,showProgress:p,nextBtnText:g,prevBtnText:h,progressText:y}=r;i.nextButton.innerHTML=g,i.previousButton.innerHTML=h,i.progress.innerHTML=y,i.closeButton.setAttribute("aria-label",r.closeBtnLabel),r.doneButton&&i.nextButton.classList.add("driver-popover-done-btn"),s?(i.title.innerHTML=s,i.title.style.display="block"):i.title.style.display="none",l?(i.description.innerHTML=l,i.description.style.display="block"):i.description.style.display="none";let x=f.includes("next")||f.includes("previous")||p;i.closeButton.style.display=f.includes("close")?"block":"none",x?(i.footer.style.display="flex",i.progress.style.display=p?"block":"none",i.nextButton.style.display=f.includes("next")?"block":"none",i.previousButton.style.display=f.includes("previous")?"block":"none"):i.footer.style.display="none",v.includes("next")&&(i.nextButton.disabled=!0,i.nextButton.classList.add("driver-popover-btn-disabled")),v.includes("previous")&&(i.previousButton.disabled=!0,i.previousButton.classList.add("driver-popover-btn-disabled")),v.includes("close")&&(i.closeButton.disabled=!0,i.closeButton.classList.add("driver-popover-btn-disabled"));let C=i.wrapper;C.style.display="block",C.style.left="",C.style.top="",C.style.bottom="",C.style.right="",C.id="driver-popover-content",C.setAttribute("role","dialog"),C.setAttribute("aria-labelledby","driver-popover-title"),C.setAttribute("aria-describedby","driver-popover-description");let N=i.arrow;N.className="driver-popover-arrow",C.className=`driver-popover ${r.popoverClass||""}`.trim(),Ov(i.wrapper,R=>{var O,E,b;let F=R.target;if(F.closest(".driver-popover-next-btn"))return(O=r.onNextClick)==null?void 0:O.call(r);if(F.closest(".driver-popover-prev-btn"))return(E=r.onPrevClick)==null?void 0:E.call(r);if(F.closest(".driver-popover-close-btn"))return(b=r.onCloseClick)==null?void 0:b.call(r)},R=>i.description.contains(R)||i.title.contains(R)?!1:!!R.closest(".driver-popover-prev-btn, .driver-popover-next-btn, .driver-popover-close-btn")),(P=r.onRender)==null||P.call(r,i),ed(i,t,r.position),_2(i,t,r.position),Dv(C,r.smoothScroll);let A=Av([C,t]);return A.length>0&&A[0].focus(),i}function _2(t,r,i){t.wrapper.querySelectorAll("img").forEach(s=>{if(s.complete)return;let l=()=>ed(t,r,i);s.addEventListener("load",l,{once:!0}),s.addEventListener("error",l,{once:!0})})}function E2(){let t=document.createElement("div");t.classList.add("driver-popover");let r=document.createElement("div");r.classList.add("driver-popover-arrow");let i=document.createElement("header");i.id="driver-popover-title",i.classList.add("driver-popover-title"),i.style.display="none",i.innerText="Popover Title";let s=document.createElement("div");s.id="driver-popover-description",s.classList.add("driver-popover-description"),s.style.display="none",s.innerText="Popover description is here";let l=document.createElement("button");l.type="button",l.classList.add("driver-popover-close-btn"),l.innerHTML="&times;";let f=document.createElement("footer");f.classList.add("driver-popover-footer");let v=document.createElement("span");v.classList.add("driver-popover-progress-text"),v.innerText="";let p=document.createElement("span");p.classList.add("driver-popover-navigation-btns");let g=document.createElement("button");g.type="button",g.classList.add("driver-popover-prev-btn","driver-popover-footer-btn"),g.innerHTML="Previous";let h=document.createElement("button");return h.type="button",h.classList.add("driver-popover-next-btn","driver-popover-footer-btn"),h.innerHTML="Next",p.appendChild(g),p.appendChild(h),f.appendChild(v),f.appendChild(p),t.appendChild(l),t.appendChild(r),t.appendChild(i),t.appendChild(s),t.appendChild(f),{wrapper:t,arrow:r,title:i,description:s,footer:f,previousButton:g,nextButton:h,closeButton:l,footerButtons:p,progress:v}}function $v(t){var r;t&&(Jc(t.wrapper),(r=t.wrapper.parentElement)==null||r.removeChild(t.wrapper))}function zv(t,r){let i=window.innerWidth,s=window.innerHeight,l=r.padding,f=r.radius,v=t.width+l*2,p=t.height+l*2,g=Math.min(f,v/2,p/2),h=Math.floor(Math.max(g,0)),y=t.x-l+h,x=t.y-l,C=v-h*2,N=p-h*2;return`M${i},0L0,0L0,${s}L${i},${s}L${i},0Z
82
82
  M${y},${x} h${C} a${h},${h} 0 0 1 ${h},${h} v${N} a${h},${h} 0 0 1 -${h},${h} h-${C} a${h},${h} 0 0 1 -${h},-${h} v-${N} a${h},${h} 0 0 1 ${h},-${h} z`}function P2(t,r,i,s,l){let f=t.getState("__activeStagePosition"),v=f||s.getBoundingClientRect(),p=l.getBoundingClientRect();f={x:la(r,v.x,p.x-v.x,i),y:la(r,v.y,p.y-v.y,i),width:la(r,v.width,p.width-v.width,i),height:la(r,v.height,p.height-v.height,i)},Bv(t,f),t.setState("__activeStagePosition",f)}function Uv(t,r){if(!r)return;let i=r.getBoundingClientRect(),s={x:i.x,y:i.y,width:i.width,height:i.height};t.setState("__activeStagePosition",s),Bv(t,s)}function j2(t){let r=t.getState("__activeStagePosition"),i=t.getState("__overlaySvg");if(!r)return;if(!i){console.warn("No stage svg found.");return}let s=window.innerWidth,l=window.innerHeight;i.setAttribute("viewBox",`0 0 ${s} ${l}`)}function b2(t,r){let i=T2(t,r);document.body.appendChild(i),Ov(i,s=>{s.target.tagName==="path"&&t.emit("overlayClick")}),t.setState("__overlaySvg",i)}function Bv(t,r){let i=t.getState("__overlaySvg");if(!i){b2(t,r);return}let s=i.firstElementChild;if((s==null?void 0:s.tagName)!=="path")throw Error("no path element found in stage svg");s.setAttribute("d",zv(r,Hv(t)))}function Hv(t){var r;return((r=t.getState("activeElement"))==null?void 0:r.id)==="driver-dummy-element"?{padding:0,radius:0}:{padding:t.getConfig("stagePadding")||0,radius:t.getConfig("stageRadius")||0}}function T2(t,r){let i=window.innerWidth,s=window.innerHeight,l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.classList.add("driver-overlay","driver-overlay-animated"),l.setAttribute("viewBox",`0 0 ${i} ${s}`),l.setAttribute("xmlSpace","preserve"),l.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),l.setAttribute("version","1.1"),l.setAttribute("preserveAspectRatio","xMinYMin slice"),l.style.fillRule="evenodd",l.style.clipRule="evenodd",l.style.strokeLinejoin="round",l.style.strokeMiterlimit="2",l.style.zIndex="10000",l.style.position="fixed",l.style.top="0",l.style.left="0",l.style.width="100%",l.style.height="100%";let f=document.createElementNS("http://www.w3.org/2000/svg","path");return f.setAttribute("d",zv(r,Hv(t))),f.style.fill=t.getConfig("overlayColor")||"rgb(0,0,0)",f.style.opacity=`${t.getConfig("overlayOpacity")}`,f.style.pointerEvents="auto",f.style.cursor="auto",l.appendChild(f),l}function R2(t){let r=t.getState("__overlaySvg");r&&(Jc(r),r.remove())}const Wv="{{current}} of {{total}}";function Vv(t,r){return!(r.skipMissingElement??t.getConfig("skipMissingElement"))||!r.element?!1:!xa(r.element)}function _n(t,r,i){let s=t.getConfig("steps")||[];for(let l=r;l>=0&&l<s.length;l+=i)if(!Vv(t,s[l]))return l}function pa(t,r){var f,v;let i=t.getState("activeIndex"),s=i!==void 0&&_n(t,i+1,1)===void 0,l=((f=r==null?void 0:r.popover)==null?void 0:f.onDoneClick)||t.getConfig("onDoneClick");return s&&l?l:((v=r==null?void 0:r.popover)==null?void 0:v.onNextClick)||t.getConfig("onNextClick")}function qv(t,r){var i;return((i=r==null?void 0:r.popover)==null?void 0:i.onPrevClick)||t.getConfig("onPrevClick")}function N2(t,r){var i;return((i=r==null?void 0:r.popover)==null?void 0:i.onCloseClick)||t.getConfig("onCloseClick")}function I2(t,r,i){let s=t.getConfig("steps")||[],l=s[r],f=l.popover||{},v=_n(t,r+1,1)!==void 0,p=_n(t,r-1,-1)!==void 0,g=f.doneBtnText||t.getConfig("doneBtnText")||"Done",h=t.getConfig("allowClose"),y=f.showProgress===void 0?t.getConfig("showProgress"):f.showProgress,x=(f.progressText||t.getConfig("progressText")||Wv).replace("{{current}}",`${r+1}`).replace("{{total}}",`${s.length}`),C=f.showButtons||t.getConfig("showButtons"),N=["next","previous",...h?["close"]:[]].filter(F=>!(C!=null&&C.length)||C.includes(F)),A=f.onNextClick||t.getConfig("onNextClick"),P=f.onPrevClick||t.getConfig("onPrevClick"),R=f.onCloseClick||t.getConfig("onCloseClick");return{...l,popover:{showButtons:N,nextBtnText:v?void 0:g,disableButtons:[...t.getConfig("disableButtons")||[],...p?[]:["previous"]],showProgress:y,onNextClick:A||i.onNextClick,onPrevClick:P||i.onPrevClick,onCloseClick:R||i.onCloseClick,...f,progressText:x}}}function fc(t,r){var i,s;return{showButtons:((i=r==null?void 0:r.popover)==null?void 0:i.showButtons)||t.getConfig("showButtons")||[],disableButtons:((s=r==null?void 0:r.popover)==null?void 0:s.disableButtons)||t.getConfig("disableButtons")||[]}}function Kv(t,r,i){var l,f;let s=t.getConfig("stagePadding")||0;return{side:((l=i.popover)==null?void 0:l.side)||"bottom",align:((f=i.popover)==null?void 0:f.align)||"start",offset:s+(t.getConfig("popoverOffset")||0),padding:s,centered:r.id==="driver-dummy-element"}}function M2(t,r,i){let s=i.popover||{},l=t.getState("activeIndex"),f=l!==void 0&&_n(t,l+1,1)===void 0;return{title:s.title,description:s.description,...fc(t,i),showProgress:s.showProgress||t.getConfig("showProgress")||!1,progressText:s.progressText??(t.getConfig("progressText")||Wv),nextBtnText:s.nextBtnText??(t.getConfig("nextBtnText")||"Next"),prevBtnText:s.prevBtnText??(t.getConfig("prevBtnText")||"Previous"),closeBtnLabel:s.closeBtnLabel??(t.getConfig("closeBtnLabel")||"Close"),doneButton:f,popoverClass:s.popoverClass||t.getConfig("popoverClass")||"",smoothScroll:t.getConfig("smoothScroll"),onNextClick:()=>{let v=pa(t,i);return v?v(r,i,t.getHookOpts()):t.emit("nextClick")},onPrevClick:()=>{let v=qv(t,i);return v?v(r,i,t.getHookOpts()):t.emit("prevClick")},onCloseClick:()=>{let v=N2(t,i);return v?v(r,i,t.getHookOpts()):t.emit("closeClick")},onRender:v=>{var p;t.setState("popover",v),(p=s.onPopoverRender||t.getConfig("onPopoverRender"))==null||p(v,t.getHookOpts())},position:Kv(t,r,i)}}function Bp(t,r,i){$v(t.getState("popover")),C2(r,M2(t,r,i))}function L2(t,r,i){let s=t.getState("popover");s&&ed(s,r,Kv(t,r,i))}const Hp={"aria-haspopup":"dialog","aria-expanded":"true","aria-controls":"driver-popover-content"},ka=new WeakMap;function O2(t){if(!ka.has(t)){let r=Object.fromEntries(Object.keys(Hp).map(i=>[i,t.getAttribute(i)]));ka.set(t,r)}for(let[r,i]of Object.entries(Hp))t.setAttribute(r,i)}function Qv(t){let r=ka.get(t);if(r){for(let[i,s]of Object.entries(r))s===null?t.removeAttribute(i):t.setAttribute(i,s);ka.delete(t)}}function A2(){let t=document.getElementById("driver-dummy-element");if(t)return t;let r=document.createElement("div");return r.id="driver-dummy-element",r.style.width="0",r.style.height="0",r.style.pointerEvents="none",r.style.opacity="0",r.style.position="fixed",r.style.top="50%",r.style.left="50%",document.body.appendChild(r),r}function Wp(t,r){let i=xa(r.element);i||(i=A2()),F2(t,i,r)}function D2(t){let r=t.getState("__activeElement"),i=t.getState("__activeStep");r&&(Uv(t,r),j2(t),L2(t,r,i))}function F2(t,r,i){let s=t.getConfig("duration")||400,l=Date.now(),f=t.getState("__activeStep"),v=t.getState("__activeElement")||r,p=!v||v===r,g=r.id==="driver-dummy-element",h=v.id==="driver-dummy-element",y=t.getConfig("animate"),x=i.onHighlightStarted||t.getConfig("onHighlightStarted"),C=(i==null?void 0:i.onHighlighted)||t.getConfig("onHighlighted"),N=(f==null?void 0:f.onDeselected)||t.getConfig("onDeselected"),A=t.getHookOpts();f&&f!==i&&N&&N(h?void 0:v,f,A),x&&x(g?void 0:r,i,A);let P=!p&&y,R=!1;Fv(t.getState("popover")),t.setState("previousStep",f),t.setState("previousElement",v),t.setState("activeStep",i),t.setState("activeElement",r);let F=()=>{if(t.getState("__transitionCallback")!==F)return;let E=Date.now()-l,b=s-E<=s/2;i.popover&&b&&!R&&P&&(Bp(t,r,i),R=!0),t.getConfig("animate")&&E<s?P2(t,E,s,v,r):(Uv(t,r),C&&C(g?void 0:r,i,t.getHookOpts()),t.setState("__transitionCallback",void 0),t.setState("__previousStep",f),t.setState("__previousElement",v),t.setState("__activeStep",i),t.setState("__activeElement",r)),window.requestAnimationFrame(F)};t.setState("__transitionCallback",F),window.requestAnimationFrame(F),Dv(r,t.getConfig("smoothScroll")),!P&&i.popover&&Bp(t,r,i),document.querySelectorAll(".driver-active-element-parent").forEach(E=>{E.classList.remove("driver-active-element-parent","driver-active-element-parent-no-scroll")}),document.querySelectorAll(".driver-active-element").forEach(E=>{E.classList.remove("driver-active-element","driver-no-interaction"),Qv(E)}),(i.disableActiveInteraction??t.getConfig("disableActiveInteraction"))&&r.classList.add("driver-no-interaction");let O=r.parentElement;O&&O!==document.body&&(O.classList.add("driver-active-element-parent"),w2(O)&&O.classList.add("driver-active-element-parent-no-scroll")),r.classList.add("driver-active-element"),O2(r)}function $2(){var t;(t=document.getElementById("driver-dummy-element"))==null||t.remove(),document.querySelectorAll(".driver-active-element").forEach(r=>{let i=r.parentElement;i&&i!==document.body&&i.classList.remove("driver-active-element-parent","driver-active-element-parent-no-scroll"),r.classList.remove("driver-active-element","driver-no-interaction"),Qv(r)})}function hc(t){let r=t.getState("__resizeTimeout");r&&window.cancelAnimationFrame(r),t.setState("__resizeTimeout",window.requestAnimationFrame(()=>D2(t)))}function z2(t,r){var p,g,h;if(!t.getState("isInitialized")||!(r.key==="Tab"||r.keyCode===9))return;let i=t.getState("__activeElement"),s=(p=t.getState("popover"))==null?void 0:p.wrapper,l=Av([...s?[s]:[],...i?[i]:[]]),f=l[0],v=l[l.length-1];r.preventDefault(),r.shiftKey?(g=l[l.indexOf(document.activeElement)-1]||v)==null||g.focus():(h=l[l.indexOf(document.activeElement)+1]||f)==null||h.focus()}function U2(t,r){(t.getConfig("allowKeyboardControl")??!0)&&(r.key==="Escape"?t.emit("escapePress"):r.key==="ArrowRight"?t.emit("arrowRightPress"):r.key==="ArrowLeft"&&t.emit("arrowLeftPress"))}function B2(t,r){let i=t.getState("__activeElement"),s=r.target;!i||!s||!i.contains(s)||t.emit("activeElementClick")}function H2(t){let r=v=>U2(t,v),i=v=>z2(t,v),s=()=>hc(t),l=()=>hc(t),f=v=>B2(t,v);t.setState("__events",{onKeyup:r,onKeydown:i,onResize:s,onScroll:l,onClick:f}),window.addEventListener("keyup",r,!1),window.addEventListener("keydown",i,!1),window.addEventListener("resize",s),window.addEventListener("scroll",l),document.addEventListener("click",f,!1)}function W2(t){let r=t.getState("__events");r&&(window.removeEventListener("keyup",r.onKeyup),window.removeEventListener("keydown",r.onKeydown),window.removeEventListener("resize",r.onResize),window.removeEventListener("scroll",r.onScroll),document.removeEventListener("click",r.onClick,!1))}function V2(){let t={};function r(i={}){t={animate:!0,duration:400,allowClose:!0,allowScroll:!0,overlayClickBehavior:"close",overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,advanceOnClick:!1,skipMissingElement:!1,waitForElement:0,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...i}}return r(),{getConfig:(i=>i?t[i]:t),configure:r}}function q2(){let t={},r=(l=>l?t[l]:t),i=(l,f)=>{t[l]=f};function s(){t={}}return{getState:r,setState:i,resetState:s}}function K2(){let t={};function r(l,f){t[l]=f}function i(l){var f;(f=t[l])==null||f.call(t)}function s(){t={}}return{listen:r,emit:i,reset:s}}function Q2(t={}){let r=V2();r.configure(t);let i=q2(),s=K2(),l;return{getConfig:r.getConfig,setConfig:r.configure,getState:i.getState,setState:i.setState,resetState:i.resetState,listen:s.listen,emit:s.emit,resetEmitter:s.reset,getDriver:()=>l,setDriver:f=>{l=f},getHookOpts:f=>{let v=f||i.getState();return{config:r.getConfig(),state:v,driver:l,index:v.activeIndex}}}}let fi;function G2(t={}){let r=Q2(t),i=()=>F(!1);function s(){r.getConfig("allowClose")&&F()}function l(){let{disableButtons:E}=fc(r,r.getState("__activeStep"));E.includes("close")||s()}function f(E){let{showButtons:b,disableButtons:D}=fc(r,r.getState("__activeStep"));return b.includes(E)&&!D.includes(E)}function v(){let E=r.getConfig("overlayClickBehavior");if(r.getConfig("allowClose")&&E==="close"){F();return}if(typeof E=="function"){let b=r.getState("__activeStep");E(r.getState("__activeElement"),b,r.getHookOpts());return}if(E==="nextStep"){let b=r.getState("activeStep"),D=r.getState("activeElement"),W=pa(r,b);if(W){W(D,b,r.getHookOpts());return}p()}}function p(){let E=r.getState("activeIndex"),b=r.getConfig("steps")||[];if(E===void 0)return;let D=E+1;b[D]?R(D):F()}function g(){let E=r.getState("activeIndex"),b=r.getConfig("steps")||[];if(E===void 0)return;let D=E-1;b[D]?R(D):F()}function h(E){(r.getConfig("steps")||[])[E]?R(E):F()}function y(){if(r.getState("__transitionCallback"))return;let E=r.getState("__activeStep");if(!E||!(E.advanceOnClick??r.getConfig("advanceOnClick")))return;let b=r.getState("__activeElement"),D=pa(r,E);if(D){D(b,E,r.getHookOpts());return}p()}function x(){if(r.getState("__transitionCallback"))return;let E=r.getState("activeIndex"),b=r.getState("__activeStep"),D=r.getState("__activeElement");if(E===void 0||b===void 0||!(r.getConfig("steps")||[])[E-1]||!f("previous"))return;let W=qv(r,b);if(W)return W(D,b,r.getHookOpts());g()}function C(){if(r.getState("__transitionCallback"))return;let E=r.getState("activeIndex"),b=r.getState("__activeStep"),D=r.getState("__activeElement");if(E===void 0||b===void 0||!f("next"))return;let W=pa(r,b);if(W)return W(D,b,r.getHookOpts());p()}function N(){r.getState("isInitialized")||(fi&&fi!==i&&fi(),fi=i,r.setState("isInitialized",!0),document.body.classList.add("driver-active",r.getConfig("animate")?"driver-fade":"driver-simple"),r.getConfig("allowScroll")||document.body.classList.add("driver-no-scroll"),document.body.style.setProperty("--driver-animation-duration",`${r.getConfig("duration")||400}ms`),H2(r),r.listen("overlayClick",v),r.listen("activeElementClick",y),r.listen("escapePress",l),r.listen("closeClick",s),r.listen("arrowLeftPress",x),r.listen("arrowRightPress",C))}function A(){let E=r.getState("__pendingWaitCancel");E&&(r.setState("__pendingWaitCancel",void 0),E())}function P(E,b,D){let W=()=>{J.disconnect(),window.clearTimeout(Q),r.setState("__pendingWaitCancel",void 0),D()},J=new MutationObserver(()=>{xa(E.element)&&W()}),Q=window.setTimeout(W,b);r.setState("__pendingWaitCancel",()=>{J.disconnect(),window.clearTimeout(Q)}),J.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}function R(E=0,b=!1){A();let D=r.getConfig("steps");if(!D){console.error("No steps to drive through"),F();return}if(!D[E]){F();return}let W=D[E],J=W.waitForElement??r.getConfig("waitForElement")??0;if(!b&&J>0&&W.element&&!xa(W.element)){Fv(r.getState("popover")),P(W,J,()=>R(E,!0));return}if(Vv(r,W)){let ie=r.getState("activeIndex"),ue=typeof ie=="number"&&E<ie?-1:1;D[E+ue]?R(E+ue):ue===1&&F();return}r.setState("__activeOnDestroyed",document.activeElement),r.setState("activeIndex",E);let Q=D[E+1];Wp(r,I2(r,E,{onNextClick:()=>{Q?R(E+1):F()},onPrevClick:()=>{R(E-1)},onCloseClick:()=>{F()}}))}function F(E=!0){if(!r.getState("isInitialized"))return;let b=r.getState("__activeElement"),D=r.getState("__activeStep"),W=r.getState("__activeOnDestroyed"),J=r.getConfig("onDestroyStarted");if(E&&J){J(!b||(b==null?void 0:b.id)==="driver-dummy-element"?void 0:b,D,r.getHookOpts());return}fi===i&&(fi=void 0);let Q=(D==null?void 0:D.onDeselected)||r.getConfig("onDeselected"),ie=r.getConfig("onDestroyed");document.body.classList.remove("driver-active","driver-fade","driver-simple","driver-no-scroll"),document.body.style.removeProperty("--driver-animation-duration"),A(),W2(r),$v(r.getState("popover")),$2(),R2(r),r.resetEmitter();let ue=r.getState();if(r.resetState(),b&&D){let Y=b.id==="driver-dummy-element";Q&&Q(Y?void 0:b,D,r.getHookOpts(ue)),ie&&ie(Y?void 0:b,D,r.getHookOpts(ue))}W&&W.focus()}let O={isActive:()=>r.getState("isInitialized")||!1,refresh:()=>hc(r),drive:(E=0)=>{N(),R(E)},setConfig:r.setConfig,setSteps:E=>{A(),r.resetState(),r.setConfig({...r.getConfig(),steps:E})},getConfig:r.getConfig,getState:r.getState,getActiveIndex:()=>r.getState("activeIndex"),isFirstStep:()=>{let E=r.getState("activeIndex");return E!==void 0&&_n(r,E-1,-1)===void 0},isLastStep:()=>{let E=r.getState("activeIndex");return E!==void 0&&_n(r,E+1,1)===void 0},getActiveStep:()=>r.getState("activeStep"),getActiveElement:()=>r.getState("activeElement"),getPreviousElement:()=>r.getState("previousElement"),getPreviousStep:()=>r.getState("previousStep"),getNextStep:()=>{let E=r.getConfig("steps")||[],b=r.getState("activeIndex");if(b===void 0)return;let D=_n(r,b+1,1);return D===void 0?void 0:E[D]},moveNext:p,movePrevious:g,moveTo:h,hasNextStep:()=>{let E=r.getState("activeIndex");return E!==void 0&&_n(r,E+1,1)!==void 0},hasPreviousStep:()=>{let E=r.getState("activeIndex");return E!==void 0&&_n(r,E-1,-1)!==void 0},highlight:E=>{N(),Wp(r,{...E,popover:E.popover?{showButtons:[],showProgress:!1,progressText:"",...E.popover}:void 0})},destroy:()=>{F(!1)}};return r.setDriver(O),O}const Y2="antseed-console:tour-seen",Z2=t=>`nav-${t}`;function X2(t){const r=(i,s)=>qc(i,t)?[{target:Z2(i),...s}]:[];return[{title:"Welcome to your gateway",description:"This console runs on your gateway. It decides who can call the API, which sellers on the Antseed network serve those calls, and what they cost. Here is where everything lives."},{target:"workspace",title:"Workspaces",description:"Each workspace has its own wallet, members, keys and budgets. Switch between them here."},...r("wallet",{title:"Fund the wallet",description:"Requests are paid in USDC from the workspace wallet. Add funds by card where available or by sending USDC, and authorize the wallet that may withdraw."}),...r("keys",{title:"API keys",description:"Create a key for each app or person. Each key can have daily, weekly, monthly and total budgets and its own routing policy. Clients call the gateway's /v1 address with the key."}),...Li(t)?r("settings",{title:"Buyer settings come first",description:"Settings → Buyer is the top of every routing policy: price caps, minimum trust (60 by default) and reputation, verification, payment limits and the RPC endpoint. If sellers you expect are missing, look here first."}):[],...r("routing",{title:"Routing policies",description:"Choose which sellers may serve: allow or block sellers, minimum trust, price caps, TEE only, fallback chains. Policies go from the buyer settings to the gateway default, workspaces, members, keys and presets, and each level can only narrow the one above. The route preview shows which sellers a request would use."}),...r("providers",{title:"Providers",description:"Every provider (seller) on the network this gateway sees, with prices, trust and the latency it measured. Open one to copy its models and an API call, or allow, block or prefer it."}),...r("activity",{title:"Usage and logs",description:"Spend and requests by model, key and member, and a searchable log of every request."}),...r("chat",{title:"Try it in Chat",description:"Chat with any model on the network, paid by your own Web chat key. Every answer shows which seller served it and what it cost."}),{target:"account",title:"That is the tour",description:"Replay it any time from your account menu."}]}function J2(t){return t instanceof HTMLElement&&t.getClientRects().length>0}function ek(t){var s;const r=t.target?document.querySelector(`[data-tour="${t.target}"]`):null,i=(s=t.target)!=null&&s.startsWith("nav-")?"right":"bottom";return{...J2(r)?{element:r}:{},popover:{title:t.title,description:t.description,side:i,align:"start"}}}function Gv(t){return`${Y2}:${t}`}function tk(t){try{return localStorage.getItem(Gv(t))==="1"}catch{return!0}}function nk(t){try{localStorage.setItem(Gv(t),"1")}catch{}}function Vp(t,r){const i=X2(t).map(ek);G2({steps:i,showProgress:!0,progressText:"{{current}} of {{total}}",nextBtnText:"Next",prevBtnText:"Back",doneBtnText:"Done",popoverClass:"gc-tour",stagePadding:4,stageRadius:8,onDestroyed:()=>nk(r)}).drive()}function an(t){const r=new Uint8Array(t);let i="";for(const l of r)i+=String.fromCharCode(l);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Sa(t){const r=t.replace(/-/g,"+").replace(/_/g,"/"),i=(4-r.length%4)%4,s=r.padEnd(r.length+i,"="),l=atob(s),f=new ArrayBuffer(l.length),v=new Uint8Array(f);for(let p=0;p<l.length;p++)v[p]=l.charCodeAt(p);return f}function Wo(){return rk.stubThis((globalThis==null?void 0:globalThis.PublicKeyCredential)!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const rk={stubThis:t=>t};function Yv(t){const{id:r}=t;return{...t,id:Sa(r),transports:t.transports}}function Zv(t){return t==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)}class tt extends Error{constructor({message:r,code:i,cause:s,name:l}){super(r,{cause:s}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=l??s.name,this.code=i}}function ik({error:t,options:r}){var s,l,f;const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((s=i.authenticatorSelection)==null?void 0:s.requireResidentKey)===!0)return new tt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(r.mediation==="conditional"&&((l=i.authenticatorSelection)==null?void 0:l.userVerification)==="required")return new tt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((f=i.authenticatorSelection)==null?void 0:f.userVerification)==="required")return new tt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new tt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(p=>p.type==="public-key").length===0?new tt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new tt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const v=globalThis.location.hostname;if(Zv(v)){if(i.rp.id!==v)return new tt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new tt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}class ok{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const i=new Error("Cancelling existing WebAuthn API call for new one");i.name="AbortError",this.controller.abort(i)}const r=new AbortController;return this.controller=r,r.signal}cancelCeremony(){if(this.controller){const r=new Error("Manually cancelling existing WebAuthn API call");r.name="AbortError",this.controller.abort(r),this.controller=void 0}}}const Xv=new ok,sk=["cross-platform","platform"];function Jv(t){if(t&&!(sk.indexOf(t)<0))return t}async function eg(t){var A;!t.optionsJSON&&t.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useAutoRegister:i=!1}=t;if(!Wo())throw new Error("WebAuthn is not supported in this browser");const s={...r,challenge:Sa(r.challenge),user:{...r.user,id:Sa(r.user.id)},excludeCredentials:(A=r.excludeCredentials)==null?void 0:A.map(Yv)},l={};i&&(l.mediation="conditional"),l.publicKey=s,l.signal=Xv.createNewAbortSignal();let f;try{f=await navigator.credentials.create(l)}catch(P){throw ik({error:P,options:l})}if(!f)throw new Error("Registration was not completed");const{id:v,rawId:p,response:g,type:h}=f;let y;typeof g.getTransports=="function"&&(y=g.getTransports());let x;if(typeof g.getPublicKeyAlgorithm=="function")try{x=g.getPublicKeyAlgorithm()}catch(P){Fu("getPublicKeyAlgorithm()",P)}let C;if(typeof g.getPublicKey=="function")try{const P=g.getPublicKey();P!==null&&(C=an(P))}catch(P){Fu("getPublicKey()",P)}let N;if(typeof g.getAuthenticatorData=="function")try{N=an(g.getAuthenticatorData())}catch(P){Fu("getAuthenticatorData()",P)}return{id:v,rawId:an(p),response:{attestationObject:an(g.attestationObject),clientDataJSON:an(g.clientDataJSON),transports:y,publicKeyAlgorithm:x,publicKey:C,authenticatorData:N},type:h,clientExtensionResults:f.getClientExtensionResults(),authenticatorAttachment:Jv(f.authenticatorAttachment)}}function Fu(t,r){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
83
- `,r)}function ak(){if(!Wo())return $u.stubThis(new Promise(r=>r(!1)));const t=globalThis.PublicKeyCredential;return(t==null?void 0:t.isConditionalMediationAvailable)===void 0?$u.stubThis(new Promise(r=>r(!1))):$u.stubThis(t.isConditionalMediationAvailable())}const $u={stubThis:t=>t};function lk({error:t,options:r}){const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const s=globalThis.location.hostname;if(Zv(s)){if(i.rpId!==s)return new tt({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function tg(t){var N,A;!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useBrowserAutofill:i=!1,verifyBrowserAutofillInput:s=!0}=t;if(!Wo())throw new Error("WebAuthn is not supported in this browser");let l;((N=r.allowCredentials)==null?void 0:N.length)!==0&&(l=(A=r.allowCredentials)==null?void 0:A.map(Yv));const f={...r,challenge:Sa(r.challenge),allowCredentials:l},v={};if(i){if(!await ak())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&s)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');v.mediation="conditional",f.allowCredentials=[]}v.publicKey=f,v.signal=Xv.createNewAbortSignal();let p;try{p=await navigator.credentials.get(v)}catch(P){throw lk({error:P,options:v})}if(!p)throw new Error("Authentication was not completed");const{id:g,rawId:h,response:y,type:x}=p;let C;return y.userHandle&&(C=an(y.userHandle)),{id:g,rawId:an(h),response:{authenticatorData:an(y.authenticatorData),clientDataJSON:an(y.clientDataJSON),signature:an(y.signature),userHandle:C},type:x,clientExtensionResults:p.getClientExtensionResults(),authenticatorAttachment:Jv(p.authenticatorAttachment)}}function Nr(t){return t.trim().toLowerCase().replace(/^0x/,"")}function ng(t,r){return Nr(t)===Nr(r)}const uk={balanced:"Balanced",price:"Lowest price",latency:"Lowest latency",trust:"Highest trust"};function td(){return{allowMode:"any",allowedPeerIds:[],allowedListIds:[],blockedPeerIds:[],blockedListIds:[],minTrustScore:"",minReputation:"",requireVerified:!1,requireTee:!1,maxInputUsdPerMillion:"",maxOutputUsdPerMillion:"",maxCachedInputUsdPerMillion:"",maxImageUsdPerImage:"",preferFreePeers:"inherit",sort:"",modelsMode:"any",allowedModels:[],routes:[]}}function hi(t){return t===void 0?"":String(t)}function ck(t){return t===void 0?"inherit":t?"yes":"no"}function dk(t){const r=td();return t?{...r,allowMode:t.allowedPeerIds||t.allowedPeerLists?"only":"any",allowedPeerIds:[...t.allowedPeerIds??[]],allowedListIds:[...t.allowedPeerLists??[]],blockedPeerIds:[...t.blockedPeerIds??[]],blockedListIds:[...t.blockedPeerLists??[]],minTrustScore:hi(t.minTrustScore),minReputation:hi(t.minReputation),requireVerified:t.requireVerified===!0,requireTee:t.requireTee===!0,maxInputUsdPerMillion:hi(t.maxInputUsdPerMillion),maxOutputUsdPerMillion:hi(t.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:hi(t.maxCachedInputUsdPerMillion),maxImageUsdPerImage:hi(t.maxImageUsdPerImage),preferFreePeers:ck(t.preferFreePeers),sort:t.sort??"",modelsMode:t.allowedModels?"only":"any",allowedModels:[...t.allowedModels??[]],routes:Object.entries(t.modelRoutes??{}).map(([i,s])=>({model:i,peerIds:[...s.peerIds],strict:s.strict===!0}))}:r}class Ca extends Error{}function zu(t,r,i){const s=r.trim();if(s==="")return;const l=Number(s);if(!Number.isFinite(l)||l<0)throw new Ca(`${t} must be a positive number.`);if(i!==void 0&&l>i)throw new Ca(`${t} must be at most ${i}.`);return l}function mi(t){return[...new Set(t.map(r=>r.trim()).filter(Boolean))]}function qp(t,r){const i=mi(t);return r?i.filter(s=>r.some(l=>l.id===s)):i}function UC(t,r=null){const i={};if(t.allowMode==="only"){const h=qp(t.allowedListIds,r),y=mi(t.allowedPeerIds);(y.length>0||h.length===0)&&(i.allowedPeerIds=y),h.length>0&&(i.allowedPeerLists=h)}const s=mi(t.blockedPeerIds);s.length>0&&(i.blockedPeerIds=s);const l=qp(t.blockedListIds,r);l.length>0&&(i.blockedPeerLists=l);const f=zu("Minimum trust",t.minTrustScore,100);f!==void 0&&(i.minTrustScore=f);const v=zu("Minimum reputation",t.minReputation,100);v!==void 0&&(i.minReputation=v),t.requireVerified&&(i.requireVerified=!0),t.requireTee&&(i.requireTee=!0);const p=[["maxInputUsdPerMillion","Input price cap"],["maxOutputUsdPerMillion","Output price cap"],["maxCachedInputUsdPerMillion","Cached input price cap"],["maxImageUsdPerImage","Image price cap"]];for(const[h,y]of p){const x=zu(y,t[h]);x!==void 0&&(i[h]=x)}t.preferFreePeers!=="inherit"&&(i.preferFreePeers=t.preferFreePeers==="yes"),t.sort&&(i.sort=t.sort),t.modelsMode==="only"&&(i.allowedModels=mi(t.allowedModels));const g=t.routes.filter(h=>h.model.trim()!=="");if(g.length>0){const h=new Set;i.modelRoutes={};for(const y of g){const x=y.model.trim();if(h.has(x))throw new Ca(`Model "${x}" has two fallback chains.`);h.add(x);const C=mi(y.peerIds);if(C.length===0)throw new Ca(`Add at least one seller to the "${x}" chain.`);i.modelRoutes[x]=y.strict?{peerIds:C,strict:!0}:{peerIds:C}}}return i}function nd(t){return!t||Object.keys(t).length===0}function BC(t){return nd(t)?null:t}function fk(t){var s,l,f,v,p,g;if(nd(t))return"Inherits";const r=t,i=[];if(r.allowedPeerIds||r.allowedPeerLists){const h=(s=r.allowedPeerLists)!=null&&s.length?` + ${r.allowedPeerLists.length} list${r.allowedPeerLists.length===1?"":"s"}`:"";i.push(`${((l=r.allowedPeerIds)==null?void 0:l.length)??0} allowed${h}`)}if((f=r.blockedPeerIds)!=null&&f.length||(v=r.blockedPeerLists)!=null&&v.length){const h=(p=r.blockedPeerLists)!=null&&p.length?` + ${r.blockedPeerLists.length} list${r.blockedPeerLists.length===1?"":"s"}`:"";i.push(`${((g=r.blockedPeerIds)==null?void 0:g.length)??0} blocked${h}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("verified only"),r.minTrustScore!==void 0&&i.push(`trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`reputation ≥ ${r.minReputation}`),(r.maxInputUsdPerMillion!==void 0||r.maxOutputUsdPerMillion!==void 0)&&i.push("price caps"),r.allowedModels&&i.push(`${r.allowedModels.length} models`),r.modelRoutes&&i.push(`${Object.keys(r.modelRoutes).length} fallback chains`),r.sort&&i.push(uk[r.sort].toLowerCase()),r.preferFreePeers&&i.push("free first"),i.join(" · ")||"Custom"}function HC(t){if(!t)return null;const r={};t.minPeerReputation>0&&(r.minReputation=t.minPeerReputation),t.requireVerifier&&(r.requireVerified=!0),t.maxPricing&&(r.maxInputUsdPerMillion=t.maxPricing.inputUsdPerMillion,r.maxOutputUsdPerMillion=t.maxPricing.outputUsdPerMillion,t.maxPricing.cachedInputUsdPerMillion!==null&&(r.maxCachedInputUsdPerMillion=t.maxPricing.cachedInputUsdPerMillion));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&(r.minTrustScore=i.minTrustScore),i.allowedPeerIds.length>0&&(r.allowedPeerIds=[...i.allowedPeerIds]),i.blockedPeerIds.length>0&&(r.blockedPeerIds=[...i.blockedPeerIds])),r}const yr=(t,r)=>`${t} ${r}${t===1?"":"s"}`,hk={balanced:"balanced",price:"price",latency:"latency",trust:"trust"};function WC(t){var l,f,v,p,g,h,y;if(nd(t))return[];const r=t,i=[],s=x=>x?` + ${yr(x,"list")}`:"";if(r.allowedPeerIds||r.allowedPeerLists){const x=((l=r.allowedPeerIds)==null?void 0:l.length)??0;i.push(x===0&&!((f=r.allowedPeerLists)!=null&&f.length)?"No seller allowed":`Allow ${x?yr(x,"seller"):""}${x?s((v=r.allowedPeerLists)==null?void 0:v.length):yr(r.allowedPeerLists.length,"list")}`)}if((p=r.blockedPeerIds)!=null&&p.length||(g=r.blockedPeerLists)!=null&&g.length){const x=((h=r.blockedPeerIds)==null?void 0:h.length)??0;i.push(`Block ${x?yr(x,"seller")+s((y=r.blockedPeerLists)==null?void 0:y.length):yr(r.blockedPeerLists.length,"list")}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("Verified only"),r.minTrustScore!==void 0&&i.push(`Trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`Reputation ≥ ${r.minReputation}`),r.maxInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxInputUsdPerMillion}/M in`),r.maxOutputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxOutputUsdPerMillion}/M out`),r.maxCachedInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxCachedInputUsdPerMillion}/M cached`),r.maxImageUsdPerImage!==void 0&&i.push(`≤ $${r.maxImageUsdPerImage}/image`),r.allowedModels&&i.push(r.allowedModels.length===0?"No model allowed":yr(r.allowedModels.length,"model")),r.modelRoutes&&Object.keys(r.modelRoutes).length>0&&i.push(yr(Object.keys(r.modelRoutes).length,"fallback chain")),r.sort&&i.push(`Sort: ${hk[r.sort]}`),r.preferFreePeers!==void 0&&i.push(r.preferFreePeers?"Free sellers first":"Free sellers not first"),i}const VC=[{id:"cheapest",label:"Cheapest",description:"Lowest price first, free sellers ahead."},{id:"trusted",label:"Most trusted",description:"Trust 70+, ranked by trust."},{id:"tee",label:"TEE only",description:"Only sellers running in a trusted execution environment."},{id:"own",label:"Own peers only",description:"Only sellers in one of your seller lists."}];function qC(t,r=[]){switch(t){case"cheapest":return{sort:"price",preferFreePeers:!0};case"trusted":return{sort:"trust",minTrustScore:70};case"tee":return{requireTee:!0};case"own":return{allowedPeerIds:mi(r)}}}function KC(t,r,i,s){var v,p,g;const l=structuredClone(t??{}),f=h=>h==null?void 0:h.filter(y=>!ng(y,i));if(r==="allow")l.allowedPeerIds=[...f(l.allowedPeerIds)??[],i],l.blockedPeerIds=f(l.blockedPeerIds);else if(r==="block")l.blockedPeerIds=[...f(l.blockedPeerIds)??[],i],l.allowedPeerIds&&(l.allowedPeerIds=f(l.allowedPeerIds)),((v=l.allowedPeerIds)==null?void 0:v.length)===0&&!((p=l.allowedPeerLists)!=null&&p.length)&&delete l.allowedPeerIds;else if(r==="prefer"){if(!s)throw new Error("Pick a model to prefer this seller for.");const h={...l.modelRoutes??{}},y=h[s];h[s]={...y??{},peerIds:[i,...f(y==null?void 0:y.peerIds)??[]]},l.modelRoutes=h,l.blockedPeerIds=f(l.blockedPeerIds)}else l.allowedPeerIds&&(l.allowedPeerIds=f(l.allowedPeerIds)),l.blockedPeerIds=f(l.blockedPeerIds),l.modelRoutes&&(l.modelRoutes=Object.fromEntries(Object.entries(l.modelRoutes).map(([h,y])=>[h,{...y,peerIds:f(y.peerIds)??[]}]).filter(([,h])=>h.peerIds.length>0)));return((g=l.blockedPeerIds)==null?void 0:g.length)===0&&delete l.blockedPeerIds,l.modelRoutes&&Object.keys(l.modelRoutes).length===0&&delete l.modelRoutes,l}function QC(t,r){var s;const i=t==null?void 0:t.allowedPeerIds;return!i||(s=t==null?void 0:t.allowedPeerLists)!=null&&s.length?!1:i.length>0&&i.every(l=>ng(l,r))}const pk={allowMode:"allowed sellers",minTrustScore:"minimum trust",minReputation:"minimum reputation",requireVerified:"verified only",requireTee:"TEE only",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",preferFreePeers:"free sellers first",sort:"sort order",modelsMode:"allowed models"};function GC(t){const r=dk(t),i=td(),s={};for(const l of Object.keys(r))JSON.stringify(r[l])!==JSON.stringify(i[l])&&(s[l]=r[l]);return(t.allowedPeerIds||t.allowedPeerLists)&&(s.allowMode="only",s.allowedPeerIds=r.allowedPeerIds,s.allowedListIds=r.allowedListIds),s}function YC(t,r){const i=td(),s=new Set;for(const l of Object.keys(r)){const f=JSON.stringify(t[l]);if(f===JSON.stringify(i[l])||f===JSON.stringify(r[l]))continue;const v=pk[l]??(l==="allowedPeerIds"||l==="allowedListIds"?"allowed sellers":null);v&&s.add(v)}return[...s]}function ZC(t,r){return{...t,...r}}function XC(t,r,i){const s=[...t],l=r+i;if(r<0||r>=s.length||l<0||l>=s.length)return s;const[f]=s.splice(r,1);return s.splice(l,0,f),s}function JC(t,r=null){if(!t||t.allowedPeerIds===void 0&&t.allowedPeerLists===void 0||(t.allowedPeerIds??[]).some(s=>s.trim()!==""))return!1;const i=t.allowedPeerLists??[];return i.length===0?!0:r?i.every(s=>{var l;return(((l=r.find(f=>f.id===s))==null?void 0:l.peerIds.length)??0)===0}):!1}function mk(t,r){if(t===void 0)return r;if(r===void 0)return t;const i=new Set(r.map(Nr));return t.filter(s=>i.has(Nr(s)))}function vk(t,r){return t===void 0?r:r===void 0?t:[...new Set([...t,...r])]}function rd(t,r,i){return t===void 0?r:r===void 0?t:i(t,r)}const Kp=(t,r)=>rd(t,r,Math.max),ua=(t,r)=>rd(t,r,Math.min),gk=(t,r)=>t.filter(i=>r.some(s=>s.toLowerCase()===i.toLowerCase()));function yk(t,r){const{allowedPeerLists:i,blockedPeerLists:s,...l}=t,f=p=>p.flatMap(g=>{var h;return((h=r.find(y=>y.id===g))==null?void 0:h.peerIds)??[]}),v={...l};return i!==void 0&&(v.allowedPeerIds=[...l.allowedPeerIds??[],...f(i)]),s!=null&&s.length&&(v.blockedPeerIds=[...l.blockedPeerIds??[],...f(s)]),v}function wk(...t){let r={};for(const i of t){if(!i)continue;const s={allowedPeerIds:mk(r.allowedPeerIds,i.allowedPeerIds),blockedPeerIds:vk(r.blockedPeerIds,i.blockedPeerIds),minTrustScore:Kp(r.minTrustScore,i.minTrustScore),minReputation:Kp(r.minReputation,i.minReputation),requireVerified:r.requireVerified||i.requireVerified?!0:void 0,requireTee:r.requireTee||i.requireTee?!0:void 0,maxInputUsdPerMillion:ua(r.maxInputUsdPerMillion,i.maxInputUsdPerMillion),maxOutputUsdPerMillion:ua(r.maxOutputUsdPerMillion,i.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:ua(r.maxCachedInputUsdPerMillion,i.maxCachedInputUsdPerMillion),maxImageUsdPerImage:ua(r.maxImageUsdPerImage,i.maxImageUsdPerImage),preferFreePeers:i.preferFreePeers??r.preferFreePeers,sort:i.sort??r.sort,allowedModels:rd(r.allowedModels,i.allowedModels,gk),modelRoutes:i.modelRoutes||r.modelRoutes?{...r.modelRoutes??{},...i.modelRoutes??{}}:void 0};r=Object.fromEntries(Object.entries(s).filter(([,l])=>l!==void 0))}return r}function xk(t,r){if(t.allowedModels&&!t.allowedModels.some(s=>s.toLowerCase()===r.service.toLowerCase()))return!1;const i=(s,l)=>l!==void 0&&s!==null&&s>l;return!(i(r.inputUsdPerMillion,t.maxInputUsdPerMillion)||i(r.outputUsdPerMillion,t.maxOutputUsdPerMillion)||i(r.cachedInputUsdPerMillion,t.maxCachedInputUsdPerMillion))}function e_(t,r,i=[]){const s=yk(t,i),l=s.allowedPeerIds?new Set(s.allowedPeerIds.map(Nr)):null,f=new Set((s.blockedPeerIds??[]).map(Nr));return r.filter(v=>{const p=Nr(v.peerId);return f.has(p)||l&&!l.has(p)||s.minTrustScore!==void 0&&(v.trustScore??0)<s.minTrustScore||s.minReputation!==void 0&&(v.reputationScore??0)<s.minReputation||s.requireVerified&&!v.verified||s.requireTee&&!v.tee?!1:v.services.some(g=>xk(s,g))})}function t_(t){return!!t&&t.some(r=>r.reputationScore!==null)}function n_(t,r,i=!1){const s=t?t.ownerMemberId===r.memberId:!0;return{admin:r.workspaceAdmin,owner:s,layered:t?Cv(t):i}}function kk(t,r){return t===null?r:r===null||Xe(t)<=Xe(r)?t:r}function Sk(t,r){const i={};for(const s of bv)i[s]=kk((t==null?void 0:t[s])??null,(r==null?void 0:r[s])??null);return i}function r_(t){const r=Cv(t)?t:null;return{limits:Sk(t.limits,r==null?void 0:r.ownerLimits),policy:wk(t.routingPolicy,(r==null?void 0:r.ownerRoutingPolicy)??null)}}function i_(t,r,i){const s={label:i.label};return i.expiresAt!==r.expiresAt&&(s.expiresAt=i.expiresAt),t.admin&&(s.limits=i.adminLimits,s.routingPolicy=i.adminPolicy,i.topupEnabled!==r.topupEnabled&&(s.topupEnabled=i.topupEnabled)),t.owner&&t.layered?(s.ownerLimits=i.ownerLimits,s.ownerRoutingPolicy=i.ownerPolicy):t.owner&&!t.admin&&(s.limits=i.ownerLimits,s.routingPolicy=i.ownerPolicy),s}const Ck={allowedPeerIds:"allowed sellers",allowedPeerLists:"allowed seller lists",allowedModels:"allowed models",modelRoutes:"fallback chains",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",minTrustScore:"minimum trust",minReputation:"minimum reputation"};function _k(t){const[,r=t]=t.split(".");return/Limits$|^limits$/.test(t.split(".")[0]??"")?`${r} limit`:Ck[r]??r}function Ek(t){const r=[],i=t.fields;Array.isArray(i)&&i.length&&r.push(`Narrowed by the levels above: ${[...new Set(i.map(f=>_k(String(f))))].join(", ")}.`);const s=t.effectiveRoutingPolicy;s&&typeof s=="object"&&r.push(`Routing that would apply: ${fk(s)}.`);const l=t.effectiveLimits;return l&&typeof l=="object"&&r.push(`Limits that would apply: ${Jx(l)}.`),r}const ma=Symbol("cancelled");async function o_(t,r,i){const s={};if(t){if(!await i({kind:"empty"}))return ma;s.confirmEmpty=!0}for(;;)try{return await r({...s})}catch(l){if(Lr(l,"empty_allow_list")&&!s.confirmEmpty){if(!await i({kind:"empty"}))return ma;s.confirmEmpty=!0}else if(Lr(l,"narrowed")&&!s.acceptNarrowed){if(!await i({kind:"narrowed",message:l.message,lines:Ek(l.details)}))return ma;s.acceptNarrowed=!0}else throw l}}function _a(t){const r=Qt(),i=Hc();return bm({mutationFn:t.mutationFn,onSuccess:(s,l)=>{var p;if(s===ma)return;const f=s;(p=t.onSuccess)==null||p.call(t,f,l);for(const g of t.invalidate??[])r.invalidateQueries({queryKey:g});const v=typeof t.toast=="function"?t.toast(f,l):t.toast;v&&i(v)},onError:t.onError})}async function Pk(t=ae){const r=await t.auth.reauthPasskeyOptions(),i=await tg({optionsJSON:r});return t.auth.reauthPasskeyVerify(i)}async function s_(t,r,i=ae){const{message:s}=await i.auth.reauthWalletNonce(t);return i.auth.reauthWalletVerify(s,await r(s))}function jk(t,r){if(t.kind!=="member"||t.me.member.id!==r)throw new Error("That sign-in belongs to a different account. Reload the page and sign in as yourself.")}const pc="The passkey prompt was closed.";function mc(t){return t instanceof Error&&t.name==="NotAllowedError"}function Ao({error:t,onRetry:r,title:i="Could not load this"}){return d.jsx(lt,{tone:"danger",title:i,action:r?d.jsx(Pe,{variant:"outline",size:"sm",onClick:r,children:"Retry"}):void 0,children:ba(t)})}function bk({query:t,children:r,rows:i}){return t.isLoading?d.jsx(Ii,{rows:i}):t.error?d.jsx(Ao,{error:t.error,onRetry:()=>void t.refetch()}):t.data===void 0?null:d.jsx(d.Fragment,{children:r(t.data)})}function a_({children:t,title:r}){return d.jsx("code",{className:"gc-mono",title:r,children:t})}function l_({label:t,value:r,strong:i}){return d.jsxs("div",{className:"gc-figure",children:[d.jsx("div",{className:"gc-figure__label",children:t}),d.jsx("div",{className:i?"gc-figure__value gc-figure__value--strong":"gc-figure__value",children:r})]})}function u_({name:t,hint:r}){return d.jsxs("div",{children:[d.jsx("div",{className:"gc-strong",children:t}),d.jsx("code",{className:"gc-mono gc-muted",children:r})]})}function c_({at:t,format:r}){return t===null?d.jsx(d.Fragment,{children:"Never"}):t<Date.now()?d.jsx(pi,{tone:"warning",children:"Expired"}):d.jsx(d.Fragment,{children:r(t)})}const Tk="Showing last known values — the chain RPC is busy.";function d_({stale:t}){return t?d.jsx("p",{className:"gc-muted",role:"status",children:Tk}):null}function f_({to:t,children:r}){return d.jsx("a",{className:"gc-link",href:Ho(t),onClick:Gc(t),children:r})}const Rk=M.lazy(()=>ze(()=>import("./WalletSignIn-CFxQjhbw.js"),__vite__mapDeps([0,1,2,3,4]))),Nk=M.lazy(()=>ze(()=>import("./WalletConfirm-Bs7CFRaa.js"),__vite__mapDeps([5,6,1,2,3,4])));function Ik({isOpen:t,onClose:r,startWith:i,intro:s,onCredentialAdded:l}){const{me:f}=Pn(),v=Qt(),p=Zc(t),[g,h]=M.useState("idle"),[y,x]=M.useState(i==="wallet"?"add":null),[C,N]=M.useState(null),[A,P]=M.useState(null),[R,F]=M.useState(!1),O=f.member.credentials,E=O.some(Y=>Y.kind==="passkey"),b=O.some(Y=>Y.kind==="wallet");function D(Y){jk(Y,f.member.id),v.setQueryData(me.me,Y)}function W(Y){return Lr(Y,"reauth_required")?(h("needed"),N(null)):N(Y),!0}async function J(){F(!0),N(null);try{const Y=await ae.auth.passkeyRegisterOptions(),Ee=await eg({optionsJSON:Y});D(await ae.auth.passkeyRegisterVerify(Ee)),h("idle"),l==null||l()}catch(Y){mc(Y)?N(new Error(pc)):W(Y)}finally{F(!1)}}async function Q(){F(!0),N(null);try{D(await Pk()),h("done")}catch(Y){N(mc(Y)?new Error(pc):Y)}finally{F(!1)}}const ie=_a({mutationFn:Y=>ae.members.removeCredential(f.member.id,Y.id),onSuccess:()=>P(null),onError:Y=>{Lr(Y,"reauth_required")&&(P(null),h("needed"))},invalidate:[me.me]}),ue=O.length<=1;return d.jsxs(gv,{isOpen:t,onClose:r,size:"lg",eyebrow:Kc[f.member.orgRole],title:f.member.label,subtitle:f.member.email??void 0,children:[d.jsxs("div",{className:"gc-stack",children:[s,d.jsxs("section",{className:"gc-stack gc-stack--tight",children:[d.jsx("div",{className:"as-field__label",children:"Your sign-in methods"}),O.length===0?d.jsx(lt,{tone:"info",children:"You signed in through your organization's access proxy and have no passkey or wallet here. Add one to approve sensitive actions, such as authorizing a withdrawal wallet."}):d.jsx("ul",{className:"gc-list gc-credentials",children:O.map(Y=>d.jsxs("li",{className:"gc-inline gc-inline--between",children:[d.jsxs("span",{className:"gc-credential",children:[d.jsx(pi,{children:Y.kind})," ",d.jsx("span",{className:"gc-credential__label",children:Y.label}),d.jsxs("span",{className:"gc-muted",children:[" · added ",wa(Y.createdAt)," · last used ",wa(Y.lastUsedAt)]})]}),d.jsx(Pe,{variant:"ghost",size:"sm",disabled:ue,title:ue?"Add another sign-in method first":void 0,onClick:()=>{ie.reset(),P(Y)},children:"Remove"})]},Y.id))}),ue&&O.length===1&&d.jsx("p",{className:"gc-fineprint",children:"This is your only sign-in method. Add another before removing it."})]}),g==="needed"&&d.jsx(lt,{tone:"info",title:"Confirm it is you",children:d.jsxs("div",{className:"gc-stack gc-stack--tight",children:[d.jsx("span",{children:"Changing your sign-in methods needs a recent sign-in. Confirm with one you already have, then try again."}),d.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[E&&d.jsx(Pe,{size:"sm",disabled:R,onClick:()=>void Q(),children:"Confirm with a passkey"}),b&&y!=="confirm"&&d.jsx(Pe,{size:"sm",variant:"outline",onClick:()=>x("confirm"),children:"Confirm with a wallet"})]}),y==="confirm"&&d.jsx(M.Suspense,{fallback:d.jsx(Pe,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:d.jsx(Nk,{onConfirmed:Y=>{D(Y),h("done"),x(null)}})}),!E&&!b&&d.jsx("span",{children:"Sign out and sign in again, then add it."})]})}),g==="done"&&d.jsx(lt,{tone:"success",children:"Confirmed. Add or remove the sign-in method now."}),p.data&&d.jsxs("section",{className:"gc-stack gc-stack--tight",children:[d.jsx("div",{className:"as-field__label",children:"Add a sign-in method"}),d.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[p.data.passkey&&d.jsx(Pe,{variant:"outline",size:"sm",disabled:R||!Wo(),onClick:()=>void J(),children:R?"Waiting for your passkey…":"Add a passkey"}),p.data.wallet&&y!=="add"&&d.jsx(Pe,{variant:"outline",size:"sm",onClick:()=>x("add"),children:"Add a wallet"}),p.data.oidc&&d.jsxs(Pe,{variant:"outline",size:"sm",href:ae.auth.oidcLinkUrl(),children:["Link ",p.data.oidc.label]})]}),y==="add"&&d.jsx(M.Suspense,{fallback:d.jsx(Pe,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:d.jsx(Rk,{autoConnect:!0,actionLabel:Y=>`Add ${Y} as a sign-in method`,onError:W,onSignedIn:Y=>{D(Y),x(null),h("idle"),l==null||l()}})}),d.jsx("p",{className:"gc-fineprint",children:"A wallet you add can become this workspace's withdrawal wallet only 24 hours later."})]}),C?d.jsx(lt,{tone:"danger",children:ba(C)}):null,d.jsx("div",{className:"gc-actions",children:d.jsx(Pe,{onClick:r,children:"Done"})})]}),d.jsx(yv,{isOpen:A!==null,busy:ie.isPending,error:ie.error,onClose:()=>{P(null),ie.reset()},onConfirm:()=>A&&ie.mutate(A),title:"Remove this sign-in method?",confirmLabel:"Remove",body:`You can no longer sign in with ${(A==null?void 0:A.label)??"it"}.`})]})}const rg="antseed-console-exposure-dismissed";function Mk(t,r,i){return!r||r.mode==="public"||i?!1:Li(t)}function Qp(t){if(!t)return!1;try{return sessionStorage.getItem(rg)===t}catch{return!1}}function Lk(t){try{sessionStorage.setItem(rg,t)}catch{}}function Ok(t){return t.mode==="local"?"This gateway runs on this computer":"This gateway is only reachable on your network"}function Ak(t){return t.mode==="local"?"Keys only work while it's on and can't be reached from other machines.":t.personalComputer?"Keys only work while this computer is on, over plain HTTP, and not from outside your network.":"It has no public HTTPS address: keys travel over plain HTTP and do not work from outside your network."}const Dk=/^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function h_(t){const r=t.trim().toLowerCase().replace(/^https?:\/\//,"").replace(/[/:].*$/,"");return Dk.test(r)?r:null}const ca="antseed-gateway.bundle";function p_(t){const r=t.domain??"llm.example.com",i=t.server.trim()||"user@your-server",s=`/tmp/${ca}`;return{exportBundle:`antseed gateway export --out ${ca}`,copy:`scp ${ca} ${i}:${s}`,install:`curl -fsSL https://antseed.com/install-gateway.sh | sudo bash -s -- --domain ${r} --import ${s}`,baseUrl:`https://${r}/v1`,stop:`rm ${ca}`,recover:"antseed gateway console-link --recover",tunnel:`CLOUDFLARED_TUNNEL_TOKEN=<tunnel-token> ANTSEED_TUNNEL_PUBLIC_URL=https://${r} \\
83
+ `,r)}function ak(){if(!Wo())return $u.stubThis(new Promise(r=>r(!1)));const t=globalThis.PublicKeyCredential;return(t==null?void 0:t.isConditionalMediationAvailable)===void 0?$u.stubThis(new Promise(r=>r(!1))):$u.stubThis(t.isConditionalMediationAvailable())}const $u={stubThis:t=>t};function lk({error:t,options:r}){const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const s=globalThis.location.hostname;if(Zv(s)){if(i.rpId!==s)return new tt({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function tg(t){var N,A;!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useBrowserAutofill:i=!1,verifyBrowserAutofillInput:s=!0}=t;if(!Wo())throw new Error("WebAuthn is not supported in this browser");let l;((N=r.allowCredentials)==null?void 0:N.length)!==0&&(l=(A=r.allowCredentials)==null?void 0:A.map(Yv));const f={...r,challenge:Sa(r.challenge),allowCredentials:l},v={};if(i){if(!await ak())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&s)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');v.mediation="conditional",f.allowCredentials=[]}v.publicKey=f,v.signal=Xv.createNewAbortSignal();let p;try{p=await navigator.credentials.get(v)}catch(P){throw lk({error:P,options:v})}if(!p)throw new Error("Authentication was not completed");const{id:g,rawId:h,response:y,type:x}=p;let C;return y.userHandle&&(C=an(y.userHandle)),{id:g,rawId:an(h),response:{authenticatorData:an(y.authenticatorData),clientDataJSON:an(y.clientDataJSON),signature:an(y.signature),userHandle:C},type:x,clientExtensionResults:p.getClientExtensionResults(),authenticatorAttachment:Jv(p.authenticatorAttachment)}}function Nr(t){return t.trim().toLowerCase().replace(/^0x/,"")}function ng(t,r){return Nr(t)===Nr(r)}const uk={balanced:"Balanced",price:"Lowest price",latency:"Lowest latency",trust:"Highest trust"};function td(){return{allowMode:"any",allowedPeerIds:[],allowedListIds:[],blockedPeerIds:[],blockedListIds:[],minTrustScore:"",minReputation:"",requireVerified:!1,requireTee:!1,maxInputUsdPerMillion:"",maxOutputUsdPerMillion:"",maxCachedInputUsdPerMillion:"",maxImageUsdPerImage:"",preferFreePeers:"inherit",sort:"",modelsMode:"any",allowedModels:[],routes:[]}}function hi(t){return t===void 0?"":String(t)}function ck(t){return t===void 0?"inherit":t?"yes":"no"}function dk(t){const r=td();return t?{...r,allowMode:t.allowedPeerIds||t.allowedPeerLists?"only":"any",allowedPeerIds:[...t.allowedPeerIds??[]],allowedListIds:[...t.allowedPeerLists??[]],blockedPeerIds:[...t.blockedPeerIds??[]],blockedListIds:[...t.blockedPeerLists??[]],minTrustScore:hi(t.minTrustScore),minReputation:hi(t.minReputation),requireVerified:t.requireVerified===!0,requireTee:t.requireTee===!0,maxInputUsdPerMillion:hi(t.maxInputUsdPerMillion),maxOutputUsdPerMillion:hi(t.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:hi(t.maxCachedInputUsdPerMillion),maxImageUsdPerImage:hi(t.maxImageUsdPerImage),preferFreePeers:ck(t.preferFreePeers),sort:t.sort??"",modelsMode:t.allowedModels?"only":"any",allowedModels:[...t.allowedModels??[]],routes:Object.entries(t.modelRoutes??{}).map(([i,s])=>({model:i,peerIds:[...s.peerIds],strict:s.strict===!0}))}:r}class Ca extends Error{}function zu(t,r,i){const s=r.trim();if(s==="")return;const l=Number(s);if(!Number.isFinite(l)||l<0)throw new Ca(`${t} must be a positive number.`);if(i!==void 0&&l>i)throw new Ca(`${t} must be at most ${i}.`);return l}function mi(t){return[...new Set(t.map(r=>r.trim()).filter(Boolean))]}function qp(t,r){const i=mi(t);return r?i.filter(s=>r.some(l=>l.id===s)):i}function UC(t,r=null){const i={};if(t.allowMode==="only"){const h=qp(t.allowedListIds,r),y=mi(t.allowedPeerIds);(y.length>0||h.length===0)&&(i.allowedPeerIds=y),h.length>0&&(i.allowedPeerLists=h)}const s=mi(t.blockedPeerIds);s.length>0&&(i.blockedPeerIds=s);const l=qp(t.blockedListIds,r);l.length>0&&(i.blockedPeerLists=l);const f=zu("Minimum trust",t.minTrustScore,100);f!==void 0&&(i.minTrustScore=f);const v=zu("Minimum reputation",t.minReputation,100);v!==void 0&&(i.minReputation=v),t.requireVerified&&(i.requireVerified=!0),t.requireTee&&(i.requireTee=!0);const p=[["maxInputUsdPerMillion","Input price cap"],["maxOutputUsdPerMillion","Output price cap"],["maxCachedInputUsdPerMillion","Cached input price cap"],["maxImageUsdPerImage","Image price cap"]];for(const[h,y]of p){const x=zu(y,t[h]);x!==void 0&&(i[h]=x)}t.preferFreePeers!=="inherit"&&(i.preferFreePeers=t.preferFreePeers==="yes"),t.sort&&(i.sort=t.sort),t.modelsMode==="only"&&(i.allowedModels=mi(t.allowedModels));const g=t.routes.filter(h=>h.model.trim()!=="");if(g.length>0){const h=new Set;i.modelRoutes={};for(const y of g){const x=y.model.trim();if(h.has(x))throw new Ca(`Model "${x}" has two fallback chains.`);h.add(x);const C=mi(y.peerIds);if(C.length===0)throw new Ca(`Add at least one seller to the "${x}" chain.`);i.modelRoutes[x]=y.strict?{peerIds:C,strict:!0}:{peerIds:C}}}return i}function nd(t){return!t||Object.keys(t).length===0}function BC(t){return nd(t)?null:t}function fk(t){var s,l,f,v,p,g;if(nd(t))return"Inherits";const r=t,i=[];if(r.allowedPeerIds||r.allowedPeerLists){const h=(s=r.allowedPeerLists)!=null&&s.length?` + ${r.allowedPeerLists.length} list${r.allowedPeerLists.length===1?"":"s"}`:"";i.push(`${((l=r.allowedPeerIds)==null?void 0:l.length)??0} allowed${h}`)}if((f=r.blockedPeerIds)!=null&&f.length||(v=r.blockedPeerLists)!=null&&v.length){const h=(p=r.blockedPeerLists)!=null&&p.length?` + ${r.blockedPeerLists.length} list${r.blockedPeerLists.length===1?"":"s"}`:"";i.push(`${((g=r.blockedPeerIds)==null?void 0:g.length)??0} blocked${h}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("verified only"),r.minTrustScore!==void 0&&i.push(`trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`reputation ≥ ${r.minReputation}`),(r.maxInputUsdPerMillion!==void 0||r.maxOutputUsdPerMillion!==void 0)&&i.push("price caps"),r.allowedModels&&i.push(`${r.allowedModels.length} models`),r.modelRoutes&&i.push(`${Object.keys(r.modelRoutes).length} fallback chains`),r.sort&&i.push(uk[r.sort].toLowerCase()),r.preferFreePeers&&i.push("free first"),i.join(" · ")||"Custom"}function HC(t){if(!t)return null;const r={};t.minPeerReputation>0&&(r.minReputation=t.minPeerReputation),t.requireVerifier&&(r.requireVerified=!0),t.maxPricing&&(r.maxInputUsdPerMillion=t.maxPricing.inputUsdPerMillion,r.maxOutputUsdPerMillion=t.maxPricing.outputUsdPerMillion,t.maxPricing.cachedInputUsdPerMillion!==null&&(r.maxCachedInputUsdPerMillion=t.maxPricing.cachedInputUsdPerMillion));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&(r.minTrustScore=i.minTrustScore),i.allowedPeerIds.length>0&&(r.allowedPeerIds=[...i.allowedPeerIds]),i.blockedPeerIds.length>0&&(r.blockedPeerIds=[...i.blockedPeerIds])),r}const yr=(t,r)=>`${t} ${r}${t===1?"":"s"}`,hk={balanced:"balanced",price:"price",latency:"latency",trust:"trust"};function WC(t){var l,f,v,p,g,h,y;if(nd(t))return[];const r=t,i=[],s=x=>x?` + ${yr(x,"list")}`:"";if(r.allowedPeerIds||r.allowedPeerLists){const x=((l=r.allowedPeerIds)==null?void 0:l.length)??0;i.push(x===0&&!((f=r.allowedPeerLists)!=null&&f.length)?"No seller allowed":`Allow ${x?yr(x,"seller"):""}${x?s((v=r.allowedPeerLists)==null?void 0:v.length):yr(r.allowedPeerLists.length,"list")}`)}if((p=r.blockedPeerIds)!=null&&p.length||(g=r.blockedPeerLists)!=null&&g.length){const x=((h=r.blockedPeerIds)==null?void 0:h.length)??0;i.push(`Block ${x?yr(x,"seller")+s((y=r.blockedPeerLists)==null?void 0:y.length):yr(r.blockedPeerLists.length,"list")}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("Verified only"),r.minTrustScore!==void 0&&i.push(`Trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`Reputation ≥ ${r.minReputation}`),r.maxInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxInputUsdPerMillion}/M in`),r.maxOutputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxOutputUsdPerMillion}/M out`),r.maxCachedInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxCachedInputUsdPerMillion}/M cached`),r.maxImageUsdPerImage!==void 0&&i.push(`≤ $${r.maxImageUsdPerImage}/image`),r.allowedModels&&i.push(r.allowedModels.length===0?"No model allowed":yr(r.allowedModels.length,"model")),r.modelRoutes&&Object.keys(r.modelRoutes).length>0&&i.push(yr(Object.keys(r.modelRoutes).length,"fallback chain")),r.sort&&i.push(`Sort: ${hk[r.sort]}`),r.preferFreePeers!==void 0&&i.push(r.preferFreePeers?"Free sellers first":"Free sellers not first"),i}const VC=[{id:"cheapest",label:"Cheapest",description:"Lowest price first, free sellers ahead."},{id:"trusted",label:"Most trusted",description:"Trust 70+, ranked by trust."},{id:"tee",label:"TEE only",description:"Only sellers running in a trusted execution environment."},{id:"own",label:"Own peers only",description:"Only sellers in one of your seller lists."}];function qC(t,r=[]){switch(t){case"cheapest":return{sort:"price",preferFreePeers:!0};case"trusted":return{sort:"trust",minTrustScore:70};case"tee":return{requireTee:!0};case"own":return{allowedPeerIds:mi(r)}}}function KC(t,r,i,s){var v,p,g;const l=structuredClone(t??{}),f=h=>h==null?void 0:h.filter(y=>!ng(y,i));if(r==="allow")l.allowedPeerIds=[...f(l.allowedPeerIds)??[],i],l.blockedPeerIds=f(l.blockedPeerIds);else if(r==="block")l.blockedPeerIds=[...f(l.blockedPeerIds)??[],i],l.allowedPeerIds&&(l.allowedPeerIds=f(l.allowedPeerIds)),((v=l.allowedPeerIds)==null?void 0:v.length)===0&&!((p=l.allowedPeerLists)!=null&&p.length)&&delete l.allowedPeerIds;else if(r==="prefer"){if(!s)throw new Error("Pick a model to prefer this seller for.");const h={...l.modelRoutes??{}},y=h[s];h[s]={...y??{},peerIds:[i,...f(y==null?void 0:y.peerIds)??[]]},l.modelRoutes=h,l.blockedPeerIds=f(l.blockedPeerIds)}else l.allowedPeerIds&&(l.allowedPeerIds=f(l.allowedPeerIds)),l.blockedPeerIds=f(l.blockedPeerIds),l.modelRoutes&&(l.modelRoutes=Object.fromEntries(Object.entries(l.modelRoutes).map(([h,y])=>[h,{...y,peerIds:f(y.peerIds)??[]}]).filter(([,h])=>h.peerIds.length>0)));return((g=l.blockedPeerIds)==null?void 0:g.length)===0&&delete l.blockedPeerIds,l.modelRoutes&&Object.keys(l.modelRoutes).length===0&&delete l.modelRoutes,l}function QC(t,r){var s;const i=t==null?void 0:t.allowedPeerIds;return!i||(s=t==null?void 0:t.allowedPeerLists)!=null&&s.length?!1:i.length>0&&i.every(l=>ng(l,r))}const pk={allowMode:"allowed sellers",minTrustScore:"minimum trust",minReputation:"minimum reputation",requireVerified:"verified only",requireTee:"TEE only",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",preferFreePeers:"free sellers first",sort:"sort order",modelsMode:"allowed models"};function GC(t){const r=dk(t),i=td(),s={};for(const l of Object.keys(r))JSON.stringify(r[l])!==JSON.stringify(i[l])&&(s[l]=r[l]);return(t.allowedPeerIds||t.allowedPeerLists)&&(s.allowMode="only",s.allowedPeerIds=r.allowedPeerIds,s.allowedListIds=r.allowedListIds),s}function YC(t,r){const i=td(),s=new Set;for(const l of Object.keys(r)){const f=JSON.stringify(t[l]);if(f===JSON.stringify(i[l])||f===JSON.stringify(r[l]))continue;const v=pk[l]??(l==="allowedPeerIds"||l==="allowedListIds"?"allowed sellers":null);v&&s.add(v)}return[...s]}function ZC(t,r){return{...t,...r}}function XC(t,r,i){const s=[...t],l=r+i;if(r<0||r>=s.length||l<0||l>=s.length)return s;const[f]=s.splice(r,1);return s.splice(l,0,f),s}function JC(t,r=null){if(!t||t.allowedPeerIds===void 0&&t.allowedPeerLists===void 0||(t.allowedPeerIds??[]).some(s=>s.trim()!==""))return!1;const i=t.allowedPeerLists??[];return i.length===0?!0:r?i.every(s=>{var l;return(((l=r.find(f=>f.id===s))==null?void 0:l.peerIds.length)??0)===0}):!1}function mk(t,r){if(t===void 0)return r;if(r===void 0)return t;const i=new Set(r.map(Nr));return t.filter(s=>i.has(Nr(s)))}function vk(t,r){return t===void 0?r:r===void 0?t:[...new Set([...t,...r])]}function rd(t,r,i){return t===void 0?r:r===void 0?t:i(t,r)}const Kp=(t,r)=>rd(t,r,Math.max),ua=(t,r)=>rd(t,r,Math.min),gk=(t,r)=>t.filter(i=>r.some(s=>s.toLowerCase()===i.toLowerCase()));function yk(t,r){const{allowedPeerLists:i,blockedPeerLists:s,...l}=t,f=p=>p.flatMap(g=>{var h;return((h=r.find(y=>y.id===g))==null?void 0:h.peerIds)??[]}),v={...l};return i!==void 0&&(v.allowedPeerIds=[...l.allowedPeerIds??[],...f(i)]),s!=null&&s.length&&(v.blockedPeerIds=[...l.blockedPeerIds??[],...f(s)]),v}function wk(...t){let r={};for(const i of t){if(!i)continue;const s={allowedPeerIds:mk(r.allowedPeerIds,i.allowedPeerIds),blockedPeerIds:vk(r.blockedPeerIds,i.blockedPeerIds),minTrustScore:Kp(r.minTrustScore,i.minTrustScore),minReputation:Kp(r.minReputation,i.minReputation),requireVerified:r.requireVerified||i.requireVerified?!0:void 0,requireTee:r.requireTee||i.requireTee?!0:void 0,maxInputUsdPerMillion:ua(r.maxInputUsdPerMillion,i.maxInputUsdPerMillion),maxOutputUsdPerMillion:ua(r.maxOutputUsdPerMillion,i.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:ua(r.maxCachedInputUsdPerMillion,i.maxCachedInputUsdPerMillion),maxImageUsdPerImage:ua(r.maxImageUsdPerImage,i.maxImageUsdPerImage),preferFreePeers:i.preferFreePeers??r.preferFreePeers,sort:i.sort??r.sort,allowedModels:rd(r.allowedModels,i.allowedModels,gk),modelRoutes:i.modelRoutes||r.modelRoutes?{...r.modelRoutes??{},...i.modelRoutes??{}}:void 0};r=Object.fromEntries(Object.entries(s).filter(([,l])=>l!==void 0))}return r}function xk(t,r){if(t.allowedModels&&!t.allowedModels.some(s=>s.toLowerCase()===r.service.toLowerCase()))return!1;const i=(s,l)=>l!==void 0&&s!==null&&s>l;return!(i(r.inputUsdPerMillion,t.maxInputUsdPerMillion)||i(r.outputUsdPerMillion,t.maxOutputUsdPerMillion)||i(r.cachedInputUsdPerMillion,t.maxCachedInputUsdPerMillion))}function e_(t,r,i=[]){const s=yk(t,i),l=s.allowedPeerIds?new Set(s.allowedPeerIds.map(Nr)):null,f=new Set((s.blockedPeerIds??[]).map(Nr));return r.filter(v=>{const p=Nr(v.peerId);return f.has(p)||l&&!l.has(p)||s.minTrustScore!==void 0&&(v.trustScore??0)<s.minTrustScore||s.minReputation!==void 0&&(v.reputationScore??0)<s.minReputation||s.requireVerified&&!v.verified||s.requireTee&&!v.tee?!1:v.services.some(g=>xk(s,g))})}function t_(t){return!!t&&t.some(r=>r.reputationScore!==null)}function n_(t,r,i=!1){const s=t?t.ownerMemberId===r.memberId:!0;return{admin:r.workspaceAdmin,owner:s,layered:t?Cv(t):i}}function kk(t,r){return t===null?r:r===null||Xe(t)<=Xe(r)?t:r}function Sk(t,r){const i={};for(const s of bv)i[s]=kk((t==null?void 0:t[s])??null,(r==null?void 0:r[s])??null);return i}function r_(t){const r=Cv(t)?t:null;return{limits:Sk(t.limits,r==null?void 0:r.ownerLimits),policy:wk(t.routingPolicy,(r==null?void 0:r.ownerRoutingPolicy)??null)}}function i_(t,r,i){const s={label:i.label};return i.expiresAt!==r.expiresAt&&(s.expiresAt=i.expiresAt),t.admin&&(s.limits=i.adminLimits,s.routingPolicy=i.adminPolicy,i.topupEnabled!==r.topupEnabled&&(s.topupEnabled=i.topupEnabled)),t.owner&&t.layered?(s.ownerLimits=i.ownerLimits,s.ownerRoutingPolicy=i.ownerPolicy):t.owner&&!t.admin&&(s.limits=i.ownerLimits,s.routingPolicy=i.ownerPolicy),s}const Ck={allowedPeerIds:"allowed sellers",allowedPeerLists:"allowed seller lists",allowedModels:"allowed models",modelRoutes:"fallback chains",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",minTrustScore:"minimum trust",minReputation:"minimum reputation"};function _k(t){const[,r=t]=t.split(".");return/Limits$|^limits$/.test(t.split(".")[0]??"")?`${r} limit`:Ck[r]??r}function Ek(t){const r=[],i=t.fields;Array.isArray(i)&&i.length&&r.push(`Narrowed by the levels above: ${[...new Set(i.map(f=>_k(String(f))))].join(", ")}.`);const s=t.effectiveRoutingPolicy;s&&typeof s=="object"&&r.push(`Routing that would apply: ${fk(s)}.`);const l=t.effectiveLimits;return l&&typeof l=="object"&&r.push(`Limits that would apply: ${Jx(l)}.`),r}const ma=Symbol("cancelled");async function o_(t,r,i){const s={};if(t){if(!await i({kind:"empty"}))return ma;s.confirmEmpty=!0}for(;;)try{return await r({...s})}catch(l){if(Lr(l,"empty_allow_list")&&!s.confirmEmpty){if(!await i({kind:"empty"}))return ma;s.confirmEmpty=!0}else if(Lr(l,"narrowed")&&!s.acceptNarrowed){if(!await i({kind:"narrowed",message:l.message,lines:Ek(l.details)}))return ma;s.acceptNarrowed=!0}else throw l}}function _a(t){const r=Qt(),i=Hc();return bm({mutationFn:t.mutationFn,onSuccess:(s,l)=>{var p;if(s===ma)return;const f=s;(p=t.onSuccess)==null||p.call(t,f,l);for(const g of t.invalidate??[])r.invalidateQueries({queryKey:g});const v=typeof t.toast=="function"?t.toast(f,l):t.toast;v&&i(v)},onError:t.onError})}async function Pk(t=ae){const r=await t.auth.reauthPasskeyOptions(),i=await tg({optionsJSON:r});return t.auth.reauthPasskeyVerify(i)}async function s_(t,r,i=ae){const{message:s}=await i.auth.reauthWalletNonce(t);return i.auth.reauthWalletVerify(s,await r(s))}function jk(t,r){if(t.kind!=="member"||t.me.member.id!==r)throw new Error("That sign-in belongs to a different account. Reload the page and sign in as yourself.")}const pc="The passkey prompt was closed.";function mc(t){return t instanceof Error&&t.name==="NotAllowedError"}function Ao({error:t,onRetry:r,title:i="Could not load this"}){return d.jsx(lt,{tone:"danger",title:i,action:r?d.jsx(Pe,{variant:"outline",size:"sm",onClick:r,children:"Retry"}):void 0,children:ba(t)})}function bk({query:t,children:r,rows:i}){return t.isLoading?d.jsx(Ii,{rows:i}):t.error?d.jsx(Ao,{error:t.error,onRetry:()=>void t.refetch()}):t.data===void 0?null:d.jsx(d.Fragment,{children:r(t.data)})}function a_({children:t,title:r}){return d.jsx("code",{className:"gc-mono",title:r,children:t})}function l_({label:t,value:r,strong:i}){return d.jsxs("div",{className:"gc-figure",children:[d.jsx("div",{className:"gc-figure__label",children:t}),d.jsx("div",{className:i?"gc-figure__value gc-figure__value--strong":"gc-figure__value",children:r})]})}function u_({name:t,hint:r}){return d.jsxs("div",{children:[d.jsx("div",{className:"gc-strong",children:t}),d.jsx("code",{className:"gc-mono gc-muted",children:r})]})}function c_({at:t,format:r}){return t===null?d.jsx(d.Fragment,{children:"Never"}):t<Date.now()?d.jsx(pi,{tone:"warning",children:"Expired"}):d.jsx(d.Fragment,{children:r(t)})}const Tk="Showing last known values — the chain RPC is busy.";function d_({stale:t}){return t?d.jsx("p",{className:"gc-muted",role:"status",children:Tk}):null}function f_({to:t,children:r}){return d.jsx("a",{className:"gc-link",href:Ho(t),onClick:Gc(t),children:r})}const Rk=M.lazy(()=>ze(()=>import("./WalletSignIn-OeYy6k9J.js"),__vite__mapDeps([0,1,2,3,4]))),Nk=M.lazy(()=>ze(()=>import("./WalletConfirm-Ca7r5H8h.js"),__vite__mapDeps([5,6,1,2,3,4])));function Ik({isOpen:t,onClose:r,startWith:i,intro:s,onCredentialAdded:l}){const{me:f}=Pn(),v=Qt(),p=Zc(t),[g,h]=M.useState("idle"),[y,x]=M.useState(i==="wallet"?"add":null),[C,N]=M.useState(null),[A,P]=M.useState(null),[R,F]=M.useState(!1),O=f.member.credentials,E=O.some(Y=>Y.kind==="passkey"),b=O.some(Y=>Y.kind==="wallet");function D(Y){jk(Y,f.member.id),v.setQueryData(me.me,Y)}function W(Y){return Lr(Y,"reauth_required")?(h("needed"),N(null)):N(Y),!0}async function J(){F(!0),N(null);try{const Y=await ae.auth.passkeyRegisterOptions(),Ee=await eg({optionsJSON:Y});D(await ae.auth.passkeyRegisterVerify(Ee)),h("idle"),l==null||l()}catch(Y){mc(Y)?N(new Error(pc)):W(Y)}finally{F(!1)}}async function Q(){F(!0),N(null);try{D(await Pk()),h("done")}catch(Y){N(mc(Y)?new Error(pc):Y)}finally{F(!1)}}const ie=_a({mutationFn:Y=>ae.members.removeCredential(f.member.id,Y.id),onSuccess:()=>P(null),onError:Y=>{Lr(Y,"reauth_required")&&(P(null),h("needed"))},invalidate:[me.me]}),ue=O.length<=1;return d.jsxs(gv,{isOpen:t,onClose:r,size:"lg",eyebrow:Kc[f.member.orgRole],title:f.member.label,subtitle:f.member.email??void 0,children:[d.jsxs("div",{className:"gc-stack",children:[s,d.jsxs("section",{className:"gc-stack gc-stack--tight",children:[d.jsx("div",{className:"as-field__label",children:"Your sign-in methods"}),O.length===0?d.jsx(lt,{tone:"info",children:"You signed in through your organization's access proxy and have no passkey or wallet here. Add one to approve sensitive actions, such as authorizing a withdrawal wallet."}):d.jsx("ul",{className:"gc-list gc-credentials",children:O.map(Y=>d.jsxs("li",{className:"gc-inline gc-inline--between",children:[d.jsxs("span",{className:"gc-credential",children:[d.jsx(pi,{children:Y.kind})," ",d.jsx("span",{className:"gc-credential__label",children:Y.label}),d.jsxs("span",{className:"gc-muted",children:[" · added ",wa(Y.createdAt)," · last used ",wa(Y.lastUsedAt)]})]}),d.jsx(Pe,{variant:"ghost",size:"sm",disabled:ue,title:ue?"Add another sign-in method first":void 0,onClick:()=>{ie.reset(),P(Y)},children:"Remove"})]},Y.id))}),ue&&O.length===1&&d.jsx("p",{className:"gc-fineprint",children:"This is your only sign-in method. Add another before removing it."})]}),g==="needed"&&d.jsx(lt,{tone:"info",title:"Confirm it is you",children:d.jsxs("div",{className:"gc-stack gc-stack--tight",children:[d.jsx("span",{children:"Changing your sign-in methods needs a recent sign-in. Confirm with one you already have, then try again."}),d.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[E&&d.jsx(Pe,{size:"sm",disabled:R,onClick:()=>void Q(),children:"Confirm with a passkey"}),b&&y!=="confirm"&&d.jsx(Pe,{size:"sm",variant:"outline",onClick:()=>x("confirm"),children:"Confirm with a wallet"})]}),y==="confirm"&&d.jsx(M.Suspense,{fallback:d.jsx(Pe,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:d.jsx(Nk,{onConfirmed:Y=>{D(Y),h("done"),x(null)}})}),!E&&!b&&d.jsx("span",{children:"Sign out and sign in again, then add it."})]})}),g==="done"&&d.jsx(lt,{tone:"success",children:"Confirmed. Add or remove the sign-in method now."}),p.data&&d.jsxs("section",{className:"gc-stack gc-stack--tight",children:[d.jsx("div",{className:"as-field__label",children:"Add a sign-in method"}),d.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[p.data.passkey&&d.jsx(Pe,{variant:"outline",size:"sm",disabled:R||!Wo(),onClick:()=>void J(),children:R?"Waiting for your passkey…":"Add a passkey"}),p.data.wallet&&y!=="add"&&d.jsx(Pe,{variant:"outline",size:"sm",onClick:()=>x("add"),children:"Add a wallet"}),p.data.oidc&&d.jsxs(Pe,{variant:"outline",size:"sm",href:ae.auth.oidcLinkUrl(),children:["Link ",p.data.oidc.label]})]}),y==="add"&&d.jsx(M.Suspense,{fallback:d.jsx(Pe,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:d.jsx(Rk,{autoConnect:!0,actionLabel:Y=>`Add ${Y} as a sign-in method`,onError:W,onSignedIn:Y=>{D(Y),x(null),h("idle"),l==null||l()}})}),d.jsx("p",{className:"gc-fineprint",children:"A wallet you add can become this workspace's withdrawal wallet only 24 hours later."})]}),C?d.jsx(lt,{tone:"danger",children:ba(C)}):null,d.jsx("div",{className:"gc-actions",children:d.jsx(Pe,{onClick:r,children:"Done"})})]}),d.jsx(yv,{isOpen:A!==null,busy:ie.isPending,error:ie.error,onClose:()=>{P(null),ie.reset()},onConfirm:()=>A&&ie.mutate(A),title:"Remove this sign-in method?",confirmLabel:"Remove",body:`You can no longer sign in with ${(A==null?void 0:A.label)??"it"}.`})]})}const rg="antseed-console-exposure-dismissed";function Mk(t,r,i){return!r||r.mode==="public"||i?!1:Li(t)}function Qp(t){if(!t)return!1;try{return sessionStorage.getItem(rg)===t}catch{return!1}}function Lk(t){try{sessionStorage.setItem(rg,t)}catch{}}function Ok(t){return t.mode==="local"?"This gateway runs on this computer":"This gateway is only reachable on your network"}function Ak(t){return t.mode==="local"?"Keys only work while it's on and can't be reached from other machines.":t.personalComputer?"Keys only work while this computer is on, over plain HTTP, and not from outside your network.":"It has no public HTTPS address: keys travel over plain HTTP and do not work from outside your network."}const Dk=/^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function h_(t){const r=t.trim().toLowerCase().replace(/^https?:\/\//,"").replace(/[/:].*$/,"");return Dk.test(r)?r:null}const ca="antseed-gateway.bundle";function p_(t){const r=t.domain??"llm.example.com",i=t.server.trim()||"user@your-server",s=`/tmp/${ca}`;return{exportBundle:`antseed gateway export --out ${ca}`,copy:`scp ${ca} ${i}:${s}`,install:`curl -fsSL https://antseed.com/install-gateway.sh | sudo bash -s -- --domain ${r} --import ${s}`,baseUrl:`https://${r}/v1`,stop:`rm ${ca}`,recover:"antseed gateway console-link --recover",tunnel:`CLOUDFLARED_TUNNEL_TOKEN=<tunnel-token> ANTSEED_TUNNEL_PUBLIC_URL=https://${r} \\
84
84
  antseed tunnel start --provider cloudflare`}}function ce({size:t=16,children:r,...i}){return d.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:r})}const ut={teeFull:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"M12 3 4.5 6v5.5c0 4.6 3.2 8.4 7.5 9.5 4.3-1.1 7.5-4.9 7.5-9.5V6z"}),d.jsx("path",{d:"m8.8 12 2.2 2.2 4.2-4.4"})]}),teePartial:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"M12 3 4.5 6v5.5c0 4.6 3.2 8.4 7.5 9.5 4.3-1.1 7.5-4.9 7.5-9.5V6z"}),d.jsx("path",{d:"M12 3v18c-4.3-1.1-7.5-4.9-7.5-9.5V6z",fill:"currentColor",stroke:"none"})]}),overview:t=>d.jsxs(ce,{...t,children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"9",rx:"1.5"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1.5"}),d.jsx("rect",{x:"14",y:"12",width:"7",height:"9",rx:"1.5"}),d.jsx("rect",{x:"3",y:"16",width:"7",height:"5",rx:"1.5"})]}),chat:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"M4 5h16v11H9l-5 4z"}),d.jsx("path",{d:"M8 9.5h8M8 12.5h5"})]}),activity:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M3 12h4l3 8 4-16 3 8h4"})}),logs:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),keys:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"8",cy:"15",r:"4"}),d.jsx("path",{d:"m10.8 12.2 9.2-9.2M17 6l3 3M14 9l2 2"})]}),members:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"9",cy:"8",r:"3.5"}),d.jsx("path",{d:"M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14.5a6.5 6.5 0 0 1 3.5 5.5"})]}),workspaces:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M3 7h18v13H3zM8 7V4h8v3"})}),wallet:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h13v4"}),d.jsx("rect",{x:"3",y:"7",width:"18",height:"13",rx:"2"}),d.jsx("circle",{cx:"16.5",cy:"13.5",r:"1.3"})]}),rewards:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"M12 15a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"}),d.jsx("path",{d:"m8.5 14-1.5 7 5-3 5 3-1.5-7"})]}),staking:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M3 20h18M5 16v-4M10 16V7M15 16v-6M20 16V4"})}),providers:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"12",cy:"5",r:"2.2"}),d.jsx("circle",{cx:"5",cy:"18",r:"2.2"}),d.jsx("circle",{cx:"19",cy:"18",r:"2.2"}),d.jsx("path",{d:"M11 7 6 16M13 7l5 9M7.2 18h9.6"})]}),network:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"12",cy:"5",r:"2.2"}),d.jsx("circle",{cx:"5",cy:"18",r:"2.2"}),d.jsx("circle",{cx:"19",cy:"18",r:"2.2"}),d.jsx("path",{d:"M11 7 6 16M13 7l5 9M7.2 18h9.6"})]}),models:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"m12 3 9 5-9 5-9-5z"}),d.jsx("path",{d:"m3 12.5 9 5 9-5M3 17l9 5 9-5"})]}),routing:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M6 3v6a4 4 0 0 0 4 4h8M14 9l4 4-4 4M6 21v-4"})}),presets:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0"}),d.jsx("circle",{cx:"16",cy:"6",r:"2"}),d.jsx("circle",{cx:"10",cy:"12",r:"2"}),d.jsx("circle",{cx:"18",cy:"18",r:"2"})]}),settings:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"3"}),d.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"})]}),audit:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"M9 4h6a1 1 0 0 1 1 1v1H8V5a1 1 0 0 1 1-1Z"}),d.jsx("path",{d:"M8 6H6a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-2M9 12h6M9 16h4"})]}),copy:t=>d.jsxs(ce,{...t,children:[d.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),d.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]}),info:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"9"}),d.jsx("path",{d:"M12 11v6M12 7.5h.01"})]}),check:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"m5 12 5 5L20 7"})}),star:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"m12 3.5 2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z"})}),starFilled:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"m12 3.5 2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9l-5.2 2.7 1-5.8-4.3-4.1 5.9-.9z",fill:"currentColor"})}),right:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"m9 6 6 6-6 6"})}),left:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"m15 6-6 6 6 6"})}),qr:t=>d.jsxs(ce,{...t,children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),d.jsx("path",{d:"M14 14h3v3M21 14v.01M14 21h3M20 18v3"})]}),lock:t=>d.jsxs(ce,{...t,children:[d.jsx("rect",{x:"4",y:"10",width:"16",height:"11",rx:"2"}),d.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}),plus:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M12 5v14M5 12h14"})}),up:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"m6 15 6-6 6 6"})}),down:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"m6 9 6 6 6-6"})}),x:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),menu:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),sun:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"4"}),d.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),monitor:t=>d.jsxs(ce,{...t,children:[d.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),d.jsx("path",{d:"M8 20h8M12 16v4"})]}),moon:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),external:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"})}),download:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M12 4v11M7 10l5 5 5-5M4 20h16"})}),more:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"5",cy:"12",r:"1"}),d.jsx("circle",{cx:"12",cy:"12",r:"1"}),d.jsx("circle",{cx:"19",cy:"12",r:"1"})]}),shield:t=>d.jsxs(ce,{...t,children:[d.jsx("path",{d:"M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6Z"}),d.jsx("path",{d:"m9 12 2 2 4-4"})]}),compass:t=>d.jsxs(ce,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"9"}),d.jsx("path",{d:"m15.5 8.5-2 5-5 2 2-5z"})]}),logout:t=>d.jsx(ce,{...t,children:d.jsx("path",{d:"M15 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4M10 17l5-5-5-5M15 12H3"})})};function Fk(t){t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),Kt("migrate"))}function $k(){var f;const{viewer:t}=Pn(),i=(f=Xc().data)==null?void 0:f.exposure,[s,l]=M.useState(()=>Qp(i==null?void 0:i.mode));return!Mk(t,i,s||Qp(i==null?void 0:i.mode))||!i?null:d.jsxs("div",{className:"gc-exposure",role:"region","aria-label":"Gateway reachability",children:[d.jsx("span",{className:"gc-exposure__icon","aria-hidden":"true",children:d.jsx(ut.monitor,{size:16})}),d.jsxs("div",{className:"gc-exposure__text",children:[d.jsxs("strong",{children:[Ok(i),"."]})," ",d.jsx("span",{children:Ak(i)})]}),d.jsxs("div",{className:"gc-exposure__actions",children:[d.jsxs(Pe,{size:"sm",variant:"outline",href:Ho("migrate"),onClick:Fk,className:"gc-exposure__cta",children:["Move to a server ",d.jsx("span",{className:"gc-exposure__rec",children:"(recommended)"})]}),d.jsx(Bo,{label:"Dismiss for this session",className:"gc-exposure__close",onClick:()=>{Lk(i.mode),l(!0)},children:d.jsx(ut.x,{size:14})})]})]})}const ig="antseed-console-update-dismissed",zk=6e4;function Or(t){return t.downloaded??null}function id(t,r=Date.now()){const i=t.progress;return(i==null?void 0:i.state)==="requested"?r-i.startedAt>zk?"stalled":"requested":(i==null?void 0:i.state)==="running"?i.action==="download"?"downloading":"installing":Or(t)?"ready":(i==null?void 0:i.state)==="failed"&&t.available?"failed":t.available?"available":"current"}function od(t){var r,i;return((r=t==null?void 0:t.progress)==null?void 0:r.state)==="requested"||((i=t==null?void 0:t.progress)==null?void 0:i.state)==="running"}function Uk(t){var r;return od(t)&&((r=t==null?void 0:t.progress)==null?void 0:r.action)!=="download"}function Bk(t,r,i){return!r||!Li(t)||r.apply==="none"?!1:od(r)?!0:(r.available||Or(r)!==null)&&og(r)!==i}function og(t){return Or(t)??t.latest}function Hk(){try{return localStorage.getItem(ig)}catch{return null}}function Wk(t){try{localStorage.setItem(ig,t)}catch{}}function sd(t){return t.product==="desktop"?"Antseed Desktop":"Antseed"}function Vk(t){const r=Hc(),i=M.useRef(null);M.useEffect(()=>{if(t){if(Uk(t)){i.current??(i.current=t.current);return}if(i.current&&t.current!==i.current){i.current=null,r(`Updated to ${sd(t)} ${t.current}. Reloading…`);const s=window.setTimeout(()=>window.location.reload(),1500);return()=>window.clearTimeout(s)}}},[t,r])}function sg(){const t=Qt(),[r,i]=M.useState(!1),s=_a({mutationFn:()=>ae.update.apply("download"),onSuccess:f=>t.setQueryData(me.update,f)}),l=_a({mutationFn:()=>ae.update.apply("install"),onSuccess:f=>{i(!1),t.setQueryData(me.update,f)}});return{download:s,install:l,confirming:r,setConfirming:i}}function ag({update:t,actions:r}){const i=t?Or(t)??t.latest:null;return d.jsx(yv,{isOpen:r.confirming,busy:r.install.isPending,error:r.install.error,onClose:()=>r.setConfirming(!1),onConfirm:()=>r.install.mutate(),title:`Restart on ${t?sd(t):"Antseed"} ${i??""}?`,confirmLabel:"Restart & update",body:(t==null?void 0:t.product)==="desktop"?"The desktop app restarts into the new release. The gateway is unreachable while the app restarts, usually under a minute, and requests sent meanwhile fail. This page reloads by itself when the gateway is back.":"The buyer and the gateway restart one at a time on the new version. Requests in flight get up to a minute to finish, and new ones wait instead of failing, except through a Cloudflare tunnel while the gateway itself restarts (a few seconds). If the new version does not start, the server goes back to this one."})}function qk(t){t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),Kt("settings"))}function Kk({quiet:t=!1}){var C;const{viewer:r}=Pn(),i=Li(r),s=Tv(i),l=sg(),[f,v]=M.useState(Hk);Vk(s.data);const p=s.data;if(t||!p||!Bk(r,p,f))return null;const g=id(p),h=sd(p),y=d.jsx("button",{type:"button",className:"gc-update-notice__link",onClick:()=>{const N=og(p);Wk(N),v(N)},children:"Dismiss"});let x;return g==="installing"||g==="requested"&&((C=p.progress)==null?void 0:C.action)!=="download"?x=d.jsxs("span",{children:["Updating ",h,p.latest?` to ${p.latest}`:"",". ",p.product==="desktop"?"The app restarts":"The gateway restarts"," when it is done; this page reloads by itself."]}):g==="downloading"||g==="requested"?x=d.jsxs("span",{children:["Downloading ",h," ",p.latest,"…"]}):g==="ready"?x=d.jsxs(d.Fragment,{children:[d.jsxs("span",{children:[h," ",Or(p)," is downloaded and ready to install."]}),d.jsx("button",{type:"button",className:"gc-update-notice__link",onClick:()=>l.setConfirming(!0),children:"Restart & update"}),y]}):x=d.jsxs(d.Fragment,{children:[d.jsxs("span",{children:[h," ",p.latest," is available. This gateway runs ",p.current,"."]}),p.apply==="console"?d.jsx("button",{type:"button",className:"gc-update-notice__link",disabled:l.download.isPending,onClick:()=>l.download.mutate(),children:"Download"}):d.jsx("a",{className:"gc-update-notice__link",href:Ho("settings"),onClick:qk,children:"Update"}),y]}),d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"gc-update-notice",role:"status",children:[d.jsx("span",{className:"gc-attention","aria-hidden":"true"}),x]}),d.jsx(ag,{update:p,actions:l})]})}function Qk({update:t}){const r=Or(t);return r?d.jsxs(pi,{tone:"warning",children:[r," ready to install"]}):t.available?d.jsxs(pi,{tone:"warning",children:[t.latest," available"]}):t.latest?d.jsx(pi,{tone:"success",children:"Up to date"}):d.jsx(pi,{children:"Not checked"})}function Gk({update:t}){var l,f,v;const r=id(t),i=t.product==="desktop",s=((l=t.progress)==null?void 0:l.to)??t.latest??"";if(r==="requested")return d.jsx("p",{className:"gc-muted",children:i?"Waiting for the desktop app…":"Waiting for the update service…"});if(r==="downloading")return d.jsx("p",{className:"gc-muted",children:i?`Downloading Antseed Desktop ${s}. The app keeps running until you restart it.`:`Downloading @antseed/cli ${s} next to the running version. The gateway keeps serving until you restart it.`});if(r==="ready"){const p=Or(t),g=t.latest&&t.latest!==p?` ${t.latest} came out since; download it after this update.`:"";return d.jsx("p",{className:"gc-muted",children:i?`Antseed Desktop ${p} is downloaded. Restart & update restarts the app into it.${g}`:`@antseed/cli ${p} is downloaded. Restart & update restarts the buyer and the gateway on it, one at a time, while requests wait for them.${g}`})}return r==="installing"?d.jsx("p",{className:"gc-muted",children:i?`Restarting into Antseed Desktop ${s}. This page reloads once it is back.`:`Restarting the buyer and the gateway on ${s} one at a time, while requests wait for them. This page reloads when it is done.`}):r==="stalled"&&i?d.jsxs("p",{className:"gc-override",children:[d.jsx("span",{className:"gc-attention","aria-hidden":"true"}),"The desktop app has not picked this up. Update it from the app on that computer instead."]}):r==="failed"&&i?d.jsxs("p",{className:"gc-override",children:[d.jsx("span",{className:"gc-attention","aria-hidden":"true"}),"The last update failed: ",((f=t.progress)==null?void 0:f.error)??"unknown error",". The app's log has the details."]}):r==="stalled"?d.jsxs("p",{className:"gc-override",children:[d.jsx("span",{className:"gc-attention","aria-hidden":"true"}),"The update service has not picked this up. On the server, check ",d.jsx("code",{children:"systemctl status antseed-update.path"}),"; servers installed before it existed need the installer re-run once."]}):r==="failed"?d.jsxs("p",{className:"gc-override",children:[d.jsx("span",{className:"gc-attention","aria-hidden":"true"}),"The last update failed: ",((v=t.progress)==null?void 0:v.error)??"unknown error",". Details: ",d.jsx("code",{children:"journalctl -u antseed-update"})]}):null}function m_(){var l;const t=Qt(),r=Tv(),i=sg(),s=_a({mutationFn:()=>ae.update.check(),onSuccess:f=>t.setQueryData(me.update,f)});return d.jsxs(Cx,{title:"Updates",description:((l=r.data)==null?void 0:l.product)==="desktop"?"This gateway runs in Antseed Desktop, which checks for new releases every 30 minutes. Nothing installs until you choose to.":"The gateway asks npm for the latest @antseed/cli every 30 minutes. Nothing installs until you choose to.",children:[d.jsx(bk,{query:r,children:f=>{const v=od(f),p=id(f);return d.jsxs("div",{className:"gc-stack",children:[d.jsx(Ex,{items:[["Running",d.jsxs("span",{className:"gc-update__version",children:[f.current," ",d.jsx(Qk,{update:f})]},"v")],[f.product==="desktop"?"Latest release":"Latest on npm",f.latest??"—"],["Last checked",f.checkError?d.jsxs("span",{className:"gc-override",children:[d.jsx("span",{className:"gc-attention","aria-hidden":"true"}),f.product==="desktop"?"Could not check":"Could not reach npm"," ",wa(f.checkedAt),": ",f.checkError]},"c"):wa(f.checkedAt)]]}),d.jsx(Gk,{update:f}),f.available&&!v&&f.apply==="command"&&f.command&&d.jsxs("div",{className:"gc-stack",children:[d.jsxs("p",{className:"gc-muted",children:[f.note," Update it on the gateway host, then restart the gateway:"]}),d.jsx(Px,{code:f.command,label:"Gateway host"})]}),f.available&&f.apply==="none"&&d.jsx("p",{className:"gc-muted",children:f.note}),s.error?d.jsx(Ao,{error:s.error,title:"Could not check for updates"}):null,i.download.error?d.jsx(Ao,{error:i.download.error,title:"Could not start the download"}):null,d.jsxs("div",{className:"gc-actions gc-actions--start",children:[f.apply==="console"&&(p==="available"||p==="failed")&&d.jsxs(Pe,{disabled:i.download.isPending,onClick:()=>i.download.mutate(),children:["Download ",f.latest]}),f.apply==="console"&&p==="downloading"&&d.jsx(Pe,{disabled:!0,children:"Downloading…"}),f.apply==="console"&&p==="ready"&&d.jsx(Pe,{onClick:()=>i.setConfirming(!0),children:"Restart & update"}),d.jsx(Pe,{variant:"outline",disabled:s.isPending||v,onClick:()=>s.mutate(),children:s.isPending?"Checking…":"Check now"})]})]})}}),d.jsx(ag,{update:r.data,actions:i})]})}function Yk(t,r){return(t||r).replace(/\/+$/,"")}function Zk(t){return`${t}/v1`}const Ta="ANTSEED_API_KEY",Ra={env:Ta};function Xk(t){return"secret"in t?t.secret:`$${t.env}`}function lg(t){return"secret"in t?`'${t.secret}'`:`process.env.${t.env}`}function Jk(t){return"secret"in t?`"${t.secret}"`:`os.environ["${t.env}"]`}function ug(t,r){return`${t.trim().toLowerCase().replace(/^0x/,"")}@${r.trim()}`}function eS(t){const r=t.apiProtocols??[];if(r.includes("openai-chat-completions"))return"openai-chat-completions";if(r.includes("anthropic-messages"))return"anthropic-messages";if(r.includes("openai-responses"))return"openai-responses";if(r.includes("openai-images"))return"openai-images";const i=t.provider.toLowerCase();return i.includes("anthropic")||i.includes("claude")?"anthropic-messages":i.includes("responses")?"openai-responses":"openai-chat-completions"}const tS={"anthropic-messages":"/v1/messages","openai-responses":"/v1/responses","openai-chat-completions":"/v1/chat/completions","openai-images":"/v1/images/generations"};function v_(t,r){if(t==="image")return"openai-images";if(t!=="text")return null;if(!r)return"openai-chat-completions";const i=eS({provider:r.provider,apiProtocols:r.protocols});return i==="openai-images"?"openai-chat-completions":i}const ad="A lighthouse on a cliff at dawn, watercolor";function nS(t,r){return JSON.stringify(t==="anthropic-messages"?{model:r,max_tokens:1024,messages:[{role:"user",content:"Hello"}]}:t==="openai-responses"?{model:r,input:"Hello"}:t==="openai-images"?{model:r,prompt:ad,n:1}:{model:r,messages:[{role:"user",content:"Hello"}]})}function cg(t,r,i="openai-chat-completions",s=Ra){return[`curl ${t}${tS[i]} \\`,` -H "Authorization: Bearer ${Xk(s)}" \\`,' -H "Content-Type: application/json" \\',` -d '${nS(i,r).replaceAll("'","'\\''")}'`].join(`
85
85
  `)}function dg(t,r,i="openai-chat-completions",s=Ra){return["import OpenAI from 'openai'","","const client = new OpenAI({",` baseURL: '${t}/v1',`,` apiKey: ${lg(s)},`,"})","",...i==="openai-images"?["const result = await client.images.generate({",` model: '${r}',`,` prompt: '${ad}',`,"})","console.log(result.data[0].url ?? result.data[0].b64_json)"]:i==="openai-responses"?["const reply = await client.responses.create({",` model: '${r}',`," input: 'Hello',","})","console.log(reply.output_text)"]:["const reply = await client.chat.completions.create({",` model: '${r}',`," messages: [{ role: 'user', content: 'Hello' }],","})","console.log(reply.choices[0].message.content)"]].join(`
86
86
  `)}function rS(t,r,i="openai-chat-completions",s=Ra){return[..."env"in s?["import os"]:[],"from openai import OpenAI","",`client = OpenAI(base_url="${t}/v1", api_key=${Jk(s)})`,"",...i==="openai-images"?[`result = client.images.generate(model="${r}", prompt="${ad}")`,"print(result.data[0].url or result.data[0].b64_json)"]:i==="openai-responses"?[`reply = client.responses.create(model="${r}", input="Hello")`,"print(reply.output_text)"]:["reply = client.chat.completions.create(",` model="${r}",`,' messages=[{"role": "user", "content": "Hello"}],',")","print(reply.choices[0].message.content)"]].join(`
@@ -88,4 +88,4 @@ Error generating stack: `+c.message+`
88
88
  `)}function iS(t,r){return["# ~/.codex/config.toml",`model = "${r}"`,'model_provider = "antseed"',"","[model_providers.antseed]",'name = "Antseed gateway"',`base_url = "${t}/v1"`,`env_key = "${Ta}"`,'wire_api = "responses"'].join(`
89
89
  `)}function oS(t,r){return[`export ANTHROPIC_BASE_URL="${t}"`,`export ANTHROPIC_AUTH_TOKEN="$${Ta}"`,`export ANTHROPIC_MODEL="${r}"`,"claude"].join(`
90
90
  `)}function sS(t,r){return[`Base URL: ${t}/v1`,`API key: $${Ta} (your Antseed key)`,`Model: ${r}`].join(`
91
- `)}function g_(t,r,i="<model>"){const s={secret:r};return[{id:"curl",label:"curl",code:cg(t,i,"openai-chat-completions",s)},{id:"openai",label:"OpenAI SDK",code:dg(t,i,"openai-chat-completions",s)},{id:"anthropic",label:"Anthropic SDK",code:fg(t,i,s)}]}function aS(t,r,i){const s=[{id:"curl",label:"curl",language:"shell",code:cg(t,r,i)},{id:"openai-python",label:"Python",language:"python",code:rS(t,r,i)},{id:"openai-js",label:"JavaScript",language:"javascript",code:dg(t,r,i)}];return i==="anthropic-messages"&&s.push({id:"anthropic",label:"Anthropic SDK",language:"javascript",code:fg(t,r)}),s}function y_(t,r,i,s,l){const f=ug(r,i),v=aS(t,f,s);return s==="openai-images"||v.push({id:"codex",label:"Codex",language:"toml",code:iS(t,l??"@preset/<your-preset>")},{id:"claude-code",label:"Claude Code",language:"shell",code:oS(t,f)},{id:"openai-compatible",label:"Cursor / OpenAI-compatible",language:"text",code:sS(t,f)}),v}function lS(){var r;const t=Xc();return Yk((r=t.data)==null?void 0:r.publicUrl,window.location.origin)}function uS(){const t=Hc();return async r=>{await wv(r)?t("Copied"):t("Could not copy to the clipboard","danger")}}function w_(t,r,i){return{label:"Copy model id",onSelect:()=>void t(ug(r,i))}}function x_({value:t,label:r}){const i=uS();return d.jsx(Bo,{label:r,size:"sm",className:"gc-copy-id",onClick:s=>{s.stopPropagation(),i(t)},children:d.jsx(ut.copy,{size:13})})}function Gp({className:t}){const r=Zk(lS());return d.jsxs("div",{className:["gc-endpoint",t].filter(Boolean).join(" "),title:`OpenAI-compatible base URL: ${r}`,children:[d.jsx("span",{className:"gc-endpoint__label",children:"API"}),d.jsx("code",{className:"gc-endpoint__url",children:r}),d.jsx(Bc,{iconOnly:!0,value:r,label:"Copy the gateway API URL",className:"gc-endpoint__copy"})]})}const hg="https://antseed.com/docs/gateway",cS=M.lazy(()=>ze(()=>import("./Migrate-Bqnu-HEP.js"),[]));function vc({to:t="overview",tagged:r,size:i=26}){const s=d.jsxs(d.Fragment,{children:[d.jsx(kx,{height:i,className:"gc-brand__full"}),d.jsx(Sx,{size:26,className:"gc-brand__mark"}),d.jsx("span",{className:"gc-brand__tag",children:"Console"})]}),l=r?"gc-brand gc-brand--tagged":"gc-brand";return t===null?d.jsx("span",{className:l,children:s}):d.jsx("a",{className:l,href:Ho(t),onClick:Gc(t),"aria-label":"Antseed console home",children:s})}const gc="No authorized wallet: nobody can withdraw funds or claim ANTS rewards";function dS(){var p;const{me:t,workspace:r,setWorkspaceId:i}=Pn(),{missingOperator:s,currentMissingOperator:l}=Mv(),f=l&&d.jsx("span",{className:"gc-attention",role:"img","aria-label":gc,title:gc});if(t.workspaces.length<=1)return d.jsxs("span",{className:"gc-ws",title:"Workspace","data-tour":"workspace",children:[d.jsx(ut.workspaces,{size:14}),d.jsx("span",{className:"gc-ws__name",children:r.name}),f]});const v=(p=t.workspaces.find(g=>g.workspace.id===r.id))==null?void 0:p.role;return d.jsx("span",{"data-tour":"workspace",className:"gc-ws-wrap",children:d.jsx(v1,{label:`Workspace: ${r.name}. Switch workspace`,triggerStyle:"plain",align:"start",width:260,className:"gc-ws gc-ws--select",trigger:d.jsxs(d.Fragment,{children:[d.jsx(ut.workspaces,{size:14}),d.jsx("span",{className:"gc-ws__name",children:r.name}),v==="admin"&&d.jsx("span",{className:"gc-ws__role",children:"admin"}),f,d.jsx(ut.down,{size:14,className:"gc-ws__chevron"})]}),items:t.workspaces.map(({workspace:g,role:h})=>({label:g.name,description:[h==="admin"?"Admin":"Member",g.id!==r.id&&s.has(g.id)?"no authorized wallet":null].filter(Boolean).join(" · "),checked:g.id===r.id,onSelect:()=>{g.id!==r.id&&i(g.id)}}))})})}function fS(t,r){return t!=="wallet"?null:r.currentMissingOperator?gc:r.withdrawable.count>0?`${r.withdrawable.count} channel${r.withdrawable.count===1?"":"s"} ready to withdraw`:null}function Yp({current:t,onNavigate:r}){const{viewer:i}=Pn(),s=Mv(),l=Dx(i),f=[...new Set(l.map(v=>v.group))];return d.jsx("nav",{className:"gc-nav","aria-label":"Console",children:f.map(v=>d.jsxs("div",{className:"gc-nav__group",children:[d.jsx("div",{className:"gc-nav__heading",children:v}),l.filter(p=>p.group===v).map(p=>{const g=ut[p.id]??ut.overview;return d.jsxs("a",{href:Ho(p.id),"aria-current":p.id===t?"page":void 0,"data-tour":`nav-${p.id}`,className:p.id===t?"gc-nav__item gc-nav__item--on":"gc-nav__item",onClick:h=>{Gc(p.id)(h),r==null||r()},children:[d.jsx(g,{size:16}),d.jsx("span",{children:p.label}),(()=>{const h=fS(p.id,s);return h&&d.jsx("span",{className:"gc-attention gc-nav__attention",role:"img","aria-label":h,title:h})})()]},p.id)})]},v))})}const Zp={system:"System",dark:"Dark",light:"Light"},hS={system:"dark",dark:"light",light:"system"},pS={system:ut.monitor,dark:ut.moon,light:ut.sun};function pg(){const[t,r]=Vx(),i=hS[t],s=pS[t];return d.jsx(Bo,{className:"gc-topbar__icon",label:`Color theme: ${Zp[t]}. Switch to ${Zp[i]}.`,onClick:()=>r(i),children:d.jsx(s,{size:16})})}function mS(){const t=Qt();return async()=>{try{await ae.auth.logout()}finally{t.clear(),Kt("login",{replace:!0})}}}function vS(t){var l;const r=t.trim().split(/\s+/).filter(Boolean),i=((l=r[0])==null?void 0:l[0])??"?",s=r.length>1?r[r.length-1][0]:"";return(i+s).toUpperCase()}function gS({onAccount:t,onTour:r,onSignOut:i}){const{me:s}=Pn(),[l,f]=M.useState(!1),v=M.useRef(null),p=M.useRef(null);M.useEffect(()=>{var N,A;if(!l)return;const x=P=>{var R;(R=v.current)!=null&&R.contains(P.target)||f(!1)},C=P=>{var R;P.key==="Escape"&&(f(!1),(R=p.current)==null||R.focus())};return document.addEventListener("mousedown",x),document.addEventListener("keydown",C),(A=(N=v.current)==null?void 0:N.querySelector('[role="menuitem"]'))==null||A.focus(),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",C)}},[l]);const g=x=>()=>{f(!1),x()},h=Kc[s.member.orgRole],y=s.member.email?`${s.member.email} · ${h}`:h;return d.jsxs("div",{className:"gc-account",ref:v,"data-tour":"account",children:[d.jsx("button",{ref:p,type:"button",className:"gc-user","aria-haspopup":"menu","aria-expanded":l,"aria-label":`Your account: ${s.member.label}`,onClick:()=>f(x=>!x),children:d.jsx("span",{className:"gc-avatar","aria-hidden":"true",children:vS(s.member.label)})}),l&&d.jsxs("div",{className:"gc-account__menu",role:"menu","aria-label":"Account",children:[d.jsxs("div",{className:"gc-account__who",children:[d.jsx("div",{className:"gc-account__name",children:s.member.label}),d.jsx("div",{className:"gc-account__meta",children:y})]}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(t),children:[d.jsx(ut.shield,{size:15}),"Account and sign-in"]}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(r),children:[d.jsx(ut.compass,{size:15}),"Take the tour"]}),d.jsxs("a",{role:"menuitem",className:"gc-account__item",href:hg,target:"_blank",rel:"noreferrer",onClick:()=>f(!1),children:[d.jsx(ut.external,{size:15}),"Documentation"]}),d.jsx("div",{className:"gc-account__sep"}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(i),children:[d.jsx(ut.logout,{size:15}),"Sign out"]})]})]})}function Xp(){var r;const t=(r=Xc().data)==null?void 0:r.version;return t?d.jsxs("p",{className:"gc-version",children:["Antseed v",t]}):null}function yS({page:t,children:r}){const[i,s]=M.useState(!1),[l,f]=M.useState(()=>new URLSearchParams(window.location.search).get("account")==="1"),v=mS(),p=Qc().page==="migrate",g=p?null:t,{me:h,viewer:y}=Pn();return M.useEffect(()=>{if(p||tk(h.member.id))return;const x=window.setTimeout(()=>Vp(y,h.member.id),600);return()=>window.clearTimeout(x)},[h.member.id]),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"gc-app","data-page":g??void 0,children:[d.jsx("a",{className:"gc-skip",href:"#gc-main",children:"Skip to content"}),d.jsxs("header",{className:"gc-topbar",children:[d.jsxs("div",{className:"gc-topbar__inner",children:[d.jsx(Bo,{label:"Open menu",className:"gc-topbar__menu gc-topbar__icon",onClick:()=>s(!0),children:d.jsx(ut.menu,{size:16})}),d.jsx(vc,{}),d.jsx("span",{className:"gc-topbar__sep","aria-hidden":"true",children:"/"}),d.jsx(dS,{}),d.jsx("div",{className:"gc-topbar__spacer"}),d.jsx(Gp,{className:"gc-endpoint--inline"}),d.jsx("a",{className:"gc-topbar__link",href:hg,target:"_blank",rel:"noreferrer",children:"Docs"}),d.jsx(pg,{}),d.jsx(gS,{onAccount:()=>f(!0),onTour:()=>Vp(y,h.member.id),onSignOut:()=>void v()})]}),d.jsx("div",{className:"gc-topbar__strip",children:d.jsx(Gp,{})})]}),d.jsxs("div",{className:"gc-body",children:[d.jsxs("aside",{className:"gc-rail",children:[d.jsx(Yp,{current:g}),d.jsx(Xp,{})]}),d.jsx("main",{id:"gc-main",className:"gc-main",tabIndex:-1,children:p?d.jsx(M.Suspense,{fallback:d.jsx(Ii,{rows:6}),children:d.jsx(cS,{})}):d.jsxs(d.Fragment,{children:[d.jsx(Kk,{quiet:g==="settings"}),d.jsx($k,{}),r]})})]})]}),d.jsxs(wx,{isOpen:i,onClose:()=>s(!1),side:"left",title:d.jsx(vc,{to:null}),className:"gc-mobile-nav",children:[d.jsx(Yp,{current:g,onNavigate:()=>s(!1)}),d.jsx(Xp,{})]}),d.jsx(Ik,{isOpen:l,onClose:()=>f(!1)})]})}const wS=M.lazy(()=>ze(()=>import("./WalletSignIn-CFxQjhbw.js"),__vite__mapDeps([0,1,2,3,4]))),Jp={not_invited:"This account has not been invited to this console. Ask an admin for an invite link.",invite_expired:"This invite link has expired. Ask an admin for a new one.",invite_used:"This invite link was already used. Sign in instead.",invalid_token:"This link is not valid. Check that you copied all of it.",setup_complete:"This console is already set up. Sign in instead.",member_disabled:"Your access to this console has been turned off.",unknown_credential:"This passkey or wallet is not registered here.",key_revoked:"This API key has been revoked.",invalid_key:"That API key is not valid.",rate_limited:"Too many attempts. Wait a minute and try again.",key_expired:"This API key has expired.",not_linked:"This account is not linked to a member yet. Sign in another way and link it from your profile, or use your invite link.",invalid_enrollment:"This sign-up link has expired. Open your invite link again, or ask for a new one.",unauthenticated:"Sign in first.",oidc_denied:"Single sign-on was cancelled.",oidc_state:"The single sign-on attempt expired. Try again.",oidc_failed:"Single sign-on could not be verified. Try again, or use another sign-in method.",oidc_unavailable:"The single sign-on provider could not be reached. Try again later.",reauth_required:"Linking a sign-in provider needs a fresh sign-in. Go back to the console, confirm it is you under Your sign-in methods, then link it again.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then link the provider again.",credential_exists:"This single sign-on account is already linked to another member."},xS=new Set(["reauth_required","access_reauth_required","credential_exists"]);function mg(t){return Object.hasOwn(Jp,t)?Jp[t]:void 0}function ld(t){return Lr(t)&&mg(t.code)||ba(t)}function yc({title:t,subtitle:r,children:i}){return d.jsxs("div",{className:"gc-auth",children:[d.jsx("div",{className:"gc-auth__theme",children:d.jsx(pg,{})}),d.jsx("div",{className:"gc-auth__logo",children:d.jsx(vc,{to:null,tagged:!0,size:30})}),d.jsxs(Pc,{className:"gc-auth__card",children:[d.jsx("h1",{className:"gc-auth__title",children:t}),r&&d.jsx("p",{className:"gc-auth__subtitle",children:r}),i]}),d.jsx("p",{className:"gc-auth__foot",children:"Self-hosted Antseed gateway"})]})}function vg(){const t=Qt();return r=>{t.setQueryData(me.me,r),Kt(r.kind==="key"?"key":"overview",{replace:!0})}}function em({label:t,run:r,primary:i}){const[s,l]=M.useState(!1),[f,v]=M.useState(null),p=Wo();return d.jsxs("div",{className:"gc-stack gc-stack--tight",children:[d.jsx(Pe,{fullWidth:!0,variant:i?"primary":"outline",disabled:s||!p,onClick:async()=>{l(!0),v(null);try{await r()}catch(g){v(mc(g)?pc:ld(g))}finally{l(!1)}},children:s?"Waiting for your passkey…":t}),!p&&d.jsx("p",{className:"gc-fineprint",children:"This browser does not support passkeys."}),f&&d.jsx(lt,{tone:"danger",children:f})]})}function kS({enrollment:t,onSignedIn:r}){const[i,s]=M.useState(!1);return i?d.jsx(M.Suspense,{fallback:d.jsx(Pe,{variant:"outline",fullWidth:!0,disabled:!0,children:"Loading wallets…"}),children:d.jsx(wS,{enrollment:t,onSignedIn:r,autoConnect:!0})}):d.jsx(Pe,{variant:"outline",fullWidth:!0,onClick:()=>s(!0),children:"Sign in with a wallet"})}function SS(){return d.jsx("div",{className:"gc-divider",children:d.jsx("span",{children:"or"})})}function CS({onSignedIn:t}){const[r,i]=M.useState(""),[s,l]=M.useState(!1),[f,v]=M.useState(null);return d.jsxs("form",{className:"gc-stack gc-stack--tight",onSubmit:async p=>{p.preventDefault(),l(!0),v(null);try{t(await ae.auth.apiKey(r.trim()))}catch(g){v(ld(g))}finally{l(!1)}},children:[d.jsx(Rx,{label:"API key",type:"password",autoComplete:"off",placeholder:"Paste your key to see its usage",value:r,onChange:p=>i(p.target.value)}),d.jsx(Pe,{type:"submit",variant:"outline",fullWidth:!0,disabled:s||!r.trim(),children:s?"Checking…":"View key usage"}),f&&d.jsx(lt,{tone:"danger",children:f})]})}function _S({mode:t,enrollment:r,onSignedIn:i}){return t==="login"?d.jsx(em,{primary:!0,label:"Sign in with a passkey",run:async()=>{const s=await ae.auth.passkeyLoginOptions(),l=await tg({optionsJSON:s});i(await ae.auth.passkeyLoginVerify(l))}}):d.jsx(em,{primary:!0,label:"Create a passkey",run:async()=>{const s=await ae.auth.passkeyRegisterOptions(r),l=await eg({optionsJSON:s});i(await ae.auth.passkeyRegisterVerify(l,r))}})}function gg({config:t,enrollment:r,onSignedIn:i,mode:s}){const l=[];return t.passkey&&l.push(d.jsx(_S,{mode:s,enrollment:r,onSignedIn:i},"passkey")),t.wallet&&l.push(d.jsx(kS,{enrollment:r,onSignedIn:i},"wallet")),t.oidc&&l.push(d.jsxs(Pe,{variant:"outline",fullWidth:!0,href:ae.auth.oidcStartUrl(r),children:["Continue with ",t.oidc.label]},"oidc")),l.length===0?d.jsx(lt,{tone:"warning",children:"No sign-in method is enabled on this gateway. Check the gateway's console auth settings."}):d.jsx("div",{className:"gc-stack",children:l})}function ES(){const t=Zc(),r=vg(),i=new URLSearchParams(window.location.search).get("error");return d.jsxs(yc,{title:"Sign in",subtitle:"Manage keys, budgets, routing and funding for this gateway.",children:[i&&d.jsx(lt,{tone:"danger",action:xS.has(i)?d.jsx(Pe,{size:"sm",variant:"outline",onClick:()=>Kt("overview?account=1",{replace:!0}),children:"Back to the console"}):void 0,children:mg(i)??"Sign-in did not complete. Try again."}),t.isLoading&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(Mo,{height:34}),d.jsx(Mo,{height:34})]}),t.error?d.jsx(lt,{tone:"danger",title:"Could not reach the gateway",children:ba(t.error)}):null,t.data&&d.jsxs("div",{className:"gc-stack",children:[t.data.setupRequired&&d.jsxs(lt,{tone:"info",title:"Not set up yet",children:["Get a one-time setup link by running ",d.jsx("code",{children:"antseed gateway console-link"})," on the gateway, or ask the operator for it."]}),d.jsx(gg,{config:t.data,mode:"login",onSignedIn:r}),t.data.cloudflareAccess&&d.jsx("p",{className:"gc-fineprint",children:"This gateway also accepts Cloudflare Access. If you signed in there, reload this page."}),t.data.apiKeyLogin&&d.jsxs(d.Fragment,{children:[d.jsx(SS,{}),d.jsx(CS,{onSignedIn:r})]})]})]})}function PS({kind:t}){const[r,i]=M.useState(()=>window.location.hash.replace(/^#/,""));M.useEffect(()=>{const p=()=>{const g=window.location.hash.replace(/^#/,"");g&&(i(g),window.history.replaceState(null,"",window.location.pathname))};return p(),window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[]);const s=vg(),l=Zc(),f=Te({queryKey:["enrollment",t,r],queryFn:()=>t==="setup"?ae.auth.setup(r):t==="recover"?ae.request("POST","/auth/recover",{body:{token:r}}):ae.auth.invite(r),enabled:r!=="",retry:!1,staleTime:1/0}),v=t==="setup"?"Set up your Antseed console":t==="recover"?"Add a sign-in method":"You are invited";return r?d.jsxs(yc,{title:v,subtitle:f.data?t==="recover"?d.jsxs(d.Fragment,{children:["Welcome back, ",d.jsx("strong",{children:f.data.label}),". Add a passkey, wallet or single sign-on to sign in on this address."]}):d.jsxs(d.Fragment,{children:["Welcome, ",d.jsx("strong",{children:f.data.label}),". You will join as ",Kc[f.data.orgRole].toLowerCase(),". Choose how you sign in."]}):"Checking your link…",children:[(f.isLoading||l.isLoading)&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(Mo,{height:34}),d.jsx(Mo,{height:34})]}),f.error?d.jsxs("div",{className:"gc-stack",children:[d.jsx(lt,{tone:"danger",children:ld(f.error)}),d.jsx(Pe,{variant:"ghost",onClick:()=>Kt("login"),children:"Go to sign in"})]}):null,f.data&&l.data&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(gg,{config:l.data,mode:"enroll",enrollment:f.data.enrollment,onSignedIn:s}),d.jsx("p",{className:"gc-fineprint",children:"A passkey uses your device's screen lock or a security key. Nothing to remember."})]})]}):d.jsxs(yc,{title:v,children:[d.jsx(lt,{tone:"danger",children:"This link is missing its token. Open the full link you were given."}),d.jsx(Pe,{variant:"ghost",onClick:()=>Kt("login"),children:"Go to sign in"})]})}const Ea={overview:()=>ze(()=>import("./Overview-C4Bu8z8u.js"),__vite__mapDeps([7,8,9,10,11,12])),chat:()=>ze(()=>import("./Chat-C4DsUQG-.js").then(t=>t.C),__vite__mapDeps([13,14,15,16,17,12,18,19,20,21,2,22])),activity:()=>ze(()=>import("./Activity-BcXN_DqV.js"),__vite__mapDeps([23,8,9,10,24,11,12,21,25])),logs:()=>ze(()=>import("./Logs-DfacvRY6.js"),__vite__mapDeps([26,27,28,24,9,15,25,29,21])),keys:()=>ze(()=>import("./Keys-BndDLQdj.js"),__vite__mapDeps([30,31,32,24,25,21,11,12,33,19,17,34,29,9,10])),members:()=>ze(()=>import("./Members-pSSyfBFp.js"),__vite__mapDeps([35,31,32,24,25,21,11,12,33,19,34])),workspaces:()=>ze(()=>import("./Workspaces-DktyLm08.js"),__vite__mapDeps([36,31,32,24,25,21,11,12,33,19,34])),wallet:()=>ze(()=>import("./Wallet-BVuVEAB5.js"),__vite__mapDeps([37,38,3,39,25,19,33])),rewards:()=>ze(()=>import("./Rewards-Cgw7r3bc.js"),__vite__mapDeps([40,38,41,25])),staking:()=>ze(()=>import("./Staking-2rSdK2Ob.js"),__vite__mapDeps([42,43,1,2,3,4,44,45,46,38,47,17,12])),providers:()=>ze(()=>import("./Providers-D_0V31og.js"),__vite__mapDeps([48,24,21,20,14,32,25,11,12,33,19,41,49,31,50,17])),models:()=>ze(()=>import("./Models-C6QzCAh4.js"),__vite__mapDeps([51,16,14,17,12,18,15,19,20,21,52,25])),routing:()=>ze(()=>import("./Routing-KpWxzlwc.js"),__vite__mapDeps([53,31,32,24,25,21,11,12,33,19,14,52,18,15])),presets:()=>ze(()=>import("./Presets-DFKw93HK.js"),__vite__mapDeps([49,31,32,24,25,21,11,12,33,19,50])),audit:()=>ze(()=>import("./Audit-nk0K4aQy.js"),__vite__mapDeps([54,28,21,25])),settings:()=>ze(()=>import("./Settings-D2MkmqAU.js"),__vite__mapDeps([55,32,24,25,21,11,12,33,19,50,17]))},yg={};for(const t of Object.keys(Ea))yg[t]=M.lazy(Ea[t]);const tm=jv(window.location.pathname).page;wg(tm)&&Ea[tm]().catch(()=>{});const nm=()=>{Ea.chat().catch(()=>{})};"requestIdleCallback"in window?window.requestIdleCallback(nm,{timeout:4e3}):setTimeout(nm,2e3);const jS=M.lazy(()=>ze(()=>import("./KeyHolder-JK1zjm4r.js"),__vite__mapDeps([56,27,28,24,9,15,25,10]))),bS=new Jw({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:(t,r)=>!(Lr(r)&&r.status>=400&&r.status<500)&&t<2}}});class TS extends M.Component{constructor(){super(...arguments);ku(this,"state",{failed:!1})}static getDerivedStateFromError(i){return{failed:!0,error:i}}render(){return this.state.failed?d.jsx(Ao,{error:this.state.error,title:"This page failed to load",onRetry:()=>this.setState({failed:!1,error:void 0})}):this.props.children}}function wg(t){return Vc.some(r=>r.id===t)}function RS({me:t,page:r}){const[i,s]=M.useState(()=>{var C;return((C=Ap(t,Bx()))==null?void 0:C.id)??null}),l=Ap(t,i),f=Qt(),v=Qc(),p=Ux(v.page,v.rest);M.useEffect(()=>{p&&Kt(p,{replace:!0})},[p]);const g=M.useMemo(()=>{if(!l)return null;const C=Fx({me:t},l.id);return{me:t,workspace:l,workspaceRole:C.workspaceRole,viewer:C,setWorkspaceId:N=>{Hx(N),s(N),f.invalidateQueries()}}},[t,l,f]);if(p)return d.jsx("div",{className:"gc-centered",children:d.jsx(Ii,{rows:3})});if(!g)return d.jsx("div",{className:"gc-centered",children:d.jsx(lt,{tone:"warning",title:"No workspace",children:"You are not a member of any workspace yet. Ask an admin to add you."})});const h=wg(r)?r:"overview",y=qc(h,g.viewer),x=yg[h];return d.jsx(_v.Provider,{value:g,children:d.jsx(yS,{page:h,children:d.jsx(TS,{children:d.jsx(M.Suspense,{fallback:d.jsx(Ii,{rows:6}),children:y?d.jsx(x,{}):d.jsx(lt,{tone:"warning",title:"Not available",children:"Your role cannot open this page."})})},v.page)})})}function NS({page:t}){const r=d2(),i=Lr(r.error)&&r.error.status===401;return M.useEffect(()=>{i&&Kt("login",{replace:!0})},[i]),r.isLoading||i?d.jsx("div",{className:"gc-centered",children:d.jsx(Ii,{rows:3})}):r.error?d.jsxs("div",{className:"gc-centered gc-stack",children:[d.jsx(Ao,{error:r.error,title:"Could not open the console",onRetry:()=>void r.refetch()}),d.jsx(Pe,{variant:"ghost",onClick:()=>Kt("login"),children:"Go to sign in"})]}):r.data?r.data.kind==="key"?d.jsx(M.Suspense,{fallback:d.jsx(Ii,{rows:6}),children:d.jsx(jS,{})}):d.jsx(RS,{me:r.data.me,page:t}):null}function IS(){const t=Qc();return t.page==="login"?d.jsx(ES,{}):t.page==="setup"||t.page==="invite"||t.page==="recover"?d.jsx(PS,{kind:t.page}):d.jsx(NS,{page:t.page})}function MS(){return d.jsx(e1,{client:bS,children:d.jsx(Ix,{children:d.jsx(IS,{})})})}Wx();async function LS(){const t=document.getElementById("root");if(!t)throw new Error("#root element is missing");Tw.createRoot(t).render(d.jsx(M.StrictMode,{children:d.jsx(MS,{})}))}LS();export{Lr as $,fk as A,Pe as B,gv as C,yv as D,WS as E,Qt as F,Hc as G,NC as H,ut as I,MC as J,d_ as K,Ii as L,a_ as M,Yc as N,f_ as O,BS as P,bk as Q,Qc as R,HS as S,Rx as T,CC as U,RC as V,wx as W,Ex as X,Px as Y,Zx as Z,ze as _,qS as a,Ta as a$,bx as a0,Tx as a1,jx as a2,mS as a3,d2 as a4,vc as a5,Gp as a6,pg as a7,bv as a8,tC as a9,Oo as aA,OC as aB,l2 as aC,Pk as aD,jk as aE,pc as aF,mc as aG,zC as aH,Nv as aI,mC as aJ,Yk as aK,g_ as aL,VS as aM,u_ as aN,r_ as aO,Cv as aP,n_ as aQ,hC as aR,i_ as aS,ma as aT,Kc as aU,_C as aV,c_ as aW,GS as aX,QS as aY,lS as aZ,aS as a_,wa as aa,Xx as ab,nC as ac,XS as ad,JS as ae,lt as af,ng as ag,Bo as ah,XC as ai,v1 as aj,Xc as ak,h_ as al,p_ as am,ba as an,s_ as ao,LC as ap,cC as aq,AC as ar,n2 as as,i2 as at,r2 as au,Bc as av,_o as aw,e2 as ax,FC as ay,DC as az,pC as b,Nr as b$,ug as b0,v_ as b1,ZS as b2,$x as b3,Du as b4,PC as b5,IC as b6,qw as b7,wp as b8,zS as b9,va as bA,vm as bB,t1 as bC,i1 as bD,l1 as bE,o1 as bF,s1 as bG,pt as bH,c1 as bI,xp as bJ,a1 as bK,qc as bL,Gc as bM,Ho as bN,jC as bO,Mv as bP,l_ as bQ,eC as bR,KC as bS,QC as bT,Ek as bU,fC as bV,eS as bW,y_ as bX,t_ as bY,w_ as bZ,f1 as b_,$S as ba,d1 as bb,vC as bc,yC as bd,xC as be,TC as bf,bC as bg,yk as bh,HC as bi,wk as bj,BC as bk,dk as bl,bm,UC as bn,o_ as bo,JC as bp,WC as bq,zx as br,gC as bs,wC as bt,uS as bu,x_ as bv,e_ as bw,m_ as bx,Mi as by,Ve as bz,EC as c,VC as c0,uk as c1,ZC as c2,td as c3,GC as c4,qC as c5,YC as c6,dC as c7,$C as c8,AS as c9,Nm as cA,Rm as cB,sn as cC,fa as cD,ha as cE,lv as cF,C1 as cG,K0 as cH,_1 as cI,tn as cJ,kw as ca,m2 as cb,sC as cc,kx as cd,Ik as ce,s2 as cf,aC as cg,lC as ch,o2 as ci,iC as cj,oC as ck,t2 as cl,rC as cm,uC as cn,e1 as co,Jw as cp,Kx as cq,Mx as cr,Lx as cs,KS as ct,DS as cu,FS as cv,Uc as cw,lx as cx,xc as cy,Lm as cz,SC as d,Te as e,ae as f,Gx as g,Yx as h,Wc as i,d as j,YS as k,Cx as l,Xe as m,Li as n,Ao as o,kC as p,me as q,M as r,f2 as s,_a as t,Pn as u,pi as v,ln as w,h2 as x,Kt as y,Jx as z};
91
+ `)}function g_(t,r,i="<model>"){const s={secret:r};return[{id:"curl",label:"curl",code:cg(t,i,"openai-chat-completions",s)},{id:"openai",label:"OpenAI SDK",code:dg(t,i,"openai-chat-completions",s)},{id:"anthropic",label:"Anthropic SDK",code:fg(t,i,s)}]}function aS(t,r,i){const s=[{id:"curl",label:"curl",language:"shell",code:cg(t,r,i)},{id:"openai-python",label:"Python",language:"python",code:rS(t,r,i)},{id:"openai-js",label:"JavaScript",language:"javascript",code:dg(t,r,i)}];return i==="anthropic-messages"&&s.push({id:"anthropic",label:"Anthropic SDK",language:"javascript",code:fg(t,r)}),s}function y_(t,r,i,s,l){const f=ug(r,i),v=aS(t,f,s);return s==="openai-images"||v.push({id:"codex",label:"Codex",language:"toml",code:iS(t,l??"@preset/<your-preset>")},{id:"claude-code",label:"Claude Code",language:"shell",code:oS(t,f)},{id:"openai-compatible",label:"Cursor / OpenAI-compatible",language:"text",code:sS(t,f)}),v}function lS(){var r;const t=Xc();return Yk((r=t.data)==null?void 0:r.publicUrl,window.location.origin)}function uS(){const t=Hc();return async r=>{await wv(r)?t("Copied"):t("Could not copy to the clipboard","danger")}}function w_(t,r,i){return{label:"Copy model id",onSelect:()=>void t(ug(r,i))}}function x_({value:t,label:r}){const i=uS();return d.jsx(Bo,{label:r,size:"sm",className:"gc-copy-id",onClick:s=>{s.stopPropagation(),i(t)},children:d.jsx(ut.copy,{size:13})})}function Gp({className:t}){const r=Zk(lS());return d.jsxs("div",{className:["gc-endpoint",t].filter(Boolean).join(" "),title:`OpenAI-compatible base URL: ${r}`,children:[d.jsx("span",{className:"gc-endpoint__label",children:"API"}),d.jsx("code",{className:"gc-endpoint__url",children:r}),d.jsx(Bc,{iconOnly:!0,value:r,label:"Copy the gateway API URL",className:"gc-endpoint__copy"})]})}const hg="https://antseed.com/docs/gateway",cS=M.lazy(()=>ze(()=>import("./Migrate-Cf0OtMIJ.js"),[]));function vc({to:t="overview",tagged:r,size:i=26}){const s=d.jsxs(d.Fragment,{children:[d.jsx(kx,{height:i,className:"gc-brand__full"}),d.jsx(Sx,{size:26,className:"gc-brand__mark"}),d.jsx("span",{className:"gc-brand__tag",children:"Console"})]}),l=r?"gc-brand gc-brand--tagged":"gc-brand";return t===null?d.jsx("span",{className:l,children:s}):d.jsx("a",{className:l,href:Ho(t),onClick:Gc(t),"aria-label":"Antseed console home",children:s})}const gc="No authorized wallet: nobody can withdraw funds or claim ANTS rewards";function dS(){var p;const{me:t,workspace:r,setWorkspaceId:i}=Pn(),{missingOperator:s,currentMissingOperator:l}=Mv(),f=l&&d.jsx("span",{className:"gc-attention",role:"img","aria-label":gc,title:gc});if(t.workspaces.length<=1)return d.jsxs("span",{className:"gc-ws",title:"Workspace","data-tour":"workspace",children:[d.jsx(ut.workspaces,{size:14}),d.jsx("span",{className:"gc-ws__name",children:r.name}),f]});const v=(p=t.workspaces.find(g=>g.workspace.id===r.id))==null?void 0:p.role;return d.jsx("span",{"data-tour":"workspace",className:"gc-ws-wrap",children:d.jsx(v1,{label:`Workspace: ${r.name}. Switch workspace`,triggerStyle:"plain",align:"start",width:260,className:"gc-ws gc-ws--select",trigger:d.jsxs(d.Fragment,{children:[d.jsx(ut.workspaces,{size:14}),d.jsx("span",{className:"gc-ws__name",children:r.name}),v==="admin"&&d.jsx("span",{className:"gc-ws__role",children:"admin"}),f,d.jsx(ut.down,{size:14,className:"gc-ws__chevron"})]}),items:t.workspaces.map(({workspace:g,role:h})=>({label:g.name,description:[h==="admin"?"Admin":"Member",g.id!==r.id&&s.has(g.id)?"no authorized wallet":null].filter(Boolean).join(" · "),checked:g.id===r.id,onSelect:()=>{g.id!==r.id&&i(g.id)}}))})})}function fS(t,r){return t!=="wallet"?null:r.currentMissingOperator?gc:r.withdrawable.count>0?`${r.withdrawable.count} channel${r.withdrawable.count===1?"":"s"} ready to withdraw`:null}function Yp({current:t,onNavigate:r}){const{viewer:i}=Pn(),s=Mv(),l=Dx(i),f=[...new Set(l.map(v=>v.group))];return d.jsx("nav",{className:"gc-nav","aria-label":"Console",children:f.map(v=>d.jsxs("div",{className:"gc-nav__group",children:[d.jsx("div",{className:"gc-nav__heading",children:v}),l.filter(p=>p.group===v).map(p=>{const g=ut[p.id]??ut.overview;return d.jsxs("a",{href:Ho(p.id),"aria-current":p.id===t?"page":void 0,"data-tour":`nav-${p.id}`,className:p.id===t?"gc-nav__item gc-nav__item--on":"gc-nav__item",onClick:h=>{Gc(p.id)(h),r==null||r()},children:[d.jsx(g,{size:16}),d.jsx("span",{children:p.label}),(()=>{const h=fS(p.id,s);return h&&d.jsx("span",{className:"gc-attention gc-nav__attention",role:"img","aria-label":h,title:h})})()]},p.id)})]},v))})}const Zp={system:"System",dark:"Dark",light:"Light"},hS={system:"dark",dark:"light",light:"system"},pS={system:ut.monitor,dark:ut.moon,light:ut.sun};function pg(){const[t,r]=Vx(),i=hS[t],s=pS[t];return d.jsx(Bo,{className:"gc-topbar__icon",label:`Color theme: ${Zp[t]}. Switch to ${Zp[i]}.`,onClick:()=>r(i),children:d.jsx(s,{size:16})})}function mS(){const t=Qt();return async()=>{try{await ae.auth.logout()}finally{t.clear(),Kt("login",{replace:!0})}}}function vS(t){var l;const r=t.trim().split(/\s+/).filter(Boolean),i=((l=r[0])==null?void 0:l[0])??"?",s=r.length>1?r[r.length-1][0]:"";return(i+s).toUpperCase()}function gS({onAccount:t,onTour:r,onSignOut:i}){const{me:s}=Pn(),[l,f]=M.useState(!1),v=M.useRef(null),p=M.useRef(null);M.useEffect(()=>{var N,A;if(!l)return;const x=P=>{var R;(R=v.current)!=null&&R.contains(P.target)||f(!1)},C=P=>{var R;P.key==="Escape"&&(f(!1),(R=p.current)==null||R.focus())};return document.addEventListener("mousedown",x),document.addEventListener("keydown",C),(A=(N=v.current)==null?void 0:N.querySelector('[role="menuitem"]'))==null||A.focus(),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",C)}},[l]);const g=x=>()=>{f(!1),x()},h=Kc[s.member.orgRole],y=s.member.email?`${s.member.email} · ${h}`:h;return d.jsxs("div",{className:"gc-account",ref:v,"data-tour":"account",children:[d.jsx("button",{ref:p,type:"button",className:"gc-user","aria-haspopup":"menu","aria-expanded":l,"aria-label":`Your account: ${s.member.label}`,onClick:()=>f(x=>!x),children:d.jsx("span",{className:"gc-avatar","aria-hidden":"true",children:vS(s.member.label)})}),l&&d.jsxs("div",{className:"gc-account__menu",role:"menu","aria-label":"Account",children:[d.jsxs("div",{className:"gc-account__who",children:[d.jsx("div",{className:"gc-account__name",children:s.member.label}),d.jsx("div",{className:"gc-account__meta",children:y})]}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(t),children:[d.jsx(ut.shield,{size:15}),"Account and sign-in"]}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(r),children:[d.jsx(ut.compass,{size:15}),"Take the tour"]}),d.jsxs("a",{role:"menuitem",className:"gc-account__item",href:hg,target:"_blank",rel:"noreferrer",onClick:()=>f(!1),children:[d.jsx(ut.external,{size:15}),"Documentation"]}),d.jsx("div",{className:"gc-account__sep"}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(i),children:[d.jsx(ut.logout,{size:15}),"Sign out"]})]})]})}function Xp(){var r;const t=(r=Xc().data)==null?void 0:r.version;return t?d.jsxs("p",{className:"gc-version",children:["Antseed v",t]}):null}function yS({page:t,children:r}){const[i,s]=M.useState(!1),[l,f]=M.useState(()=>new URLSearchParams(window.location.search).get("account")==="1"),v=mS(),p=Qc().page==="migrate",g=p?null:t,{me:h,viewer:y}=Pn();return M.useEffect(()=>{if(p||tk(h.member.id))return;const x=window.setTimeout(()=>Vp(y,h.member.id),600);return()=>window.clearTimeout(x)},[h.member.id]),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"gc-app","data-page":g??void 0,children:[d.jsx("a",{className:"gc-skip",href:"#gc-main",children:"Skip to content"}),d.jsxs("header",{className:"gc-topbar",children:[d.jsxs("div",{className:"gc-topbar__inner",children:[d.jsx(Bo,{label:"Open menu",className:"gc-topbar__menu gc-topbar__icon",onClick:()=>s(!0),children:d.jsx(ut.menu,{size:16})}),d.jsx(vc,{}),d.jsx("span",{className:"gc-topbar__sep","aria-hidden":"true",children:"/"}),d.jsx(dS,{}),d.jsx("div",{className:"gc-topbar__spacer"}),d.jsx(Gp,{className:"gc-endpoint--inline"}),d.jsx("a",{className:"gc-topbar__link",href:hg,target:"_blank",rel:"noreferrer",children:"Docs"}),d.jsx(pg,{}),d.jsx(gS,{onAccount:()=>f(!0),onTour:()=>Vp(y,h.member.id),onSignOut:()=>void v()})]}),d.jsx("div",{className:"gc-topbar__strip",children:d.jsx(Gp,{})})]}),d.jsxs("div",{className:"gc-body",children:[d.jsxs("aside",{className:"gc-rail",children:[d.jsx(Yp,{current:g}),d.jsx(Xp,{})]}),d.jsx("main",{id:"gc-main",className:"gc-main",tabIndex:-1,children:p?d.jsx(M.Suspense,{fallback:d.jsx(Ii,{rows:6}),children:d.jsx(cS,{})}):d.jsxs(d.Fragment,{children:[d.jsx(Kk,{quiet:g==="settings"}),d.jsx($k,{}),r]})})]})]}),d.jsxs(wx,{isOpen:i,onClose:()=>s(!1),side:"left",title:d.jsx(vc,{to:null}),className:"gc-mobile-nav",children:[d.jsx(Yp,{current:g,onNavigate:()=>s(!1)}),d.jsx(Xp,{})]}),d.jsx(Ik,{isOpen:l,onClose:()=>f(!1)})]})}const wS=M.lazy(()=>ze(()=>import("./WalletSignIn-OeYy6k9J.js"),__vite__mapDeps([0,1,2,3,4]))),Jp={not_invited:"This account has not been invited to this console. Ask an admin for an invite link.",invite_expired:"This invite link has expired. Ask an admin for a new one.",invite_used:"This invite link was already used. Sign in instead.",invalid_token:"This link is not valid. Check that you copied all of it.",setup_complete:"This console is already set up. Sign in instead.",member_disabled:"Your access to this console has been turned off.",unknown_credential:"This passkey or wallet is not registered here.",key_revoked:"This API key has been revoked.",invalid_key:"That API key is not valid.",rate_limited:"Too many attempts. Wait a minute and try again.",key_expired:"This API key has expired.",not_linked:"This account is not linked to a member yet. Sign in another way and link it from your profile, or use your invite link.",invalid_enrollment:"This sign-up link has expired. Open your invite link again, or ask for a new one.",unauthenticated:"Sign in first.",oidc_denied:"Single sign-on was cancelled.",oidc_state:"The single sign-on attempt expired. Try again.",oidc_failed:"Single sign-on could not be verified. Try again, or use another sign-in method.",oidc_unavailable:"The single sign-on provider could not be reached. Try again later.",reauth_required:"Linking a sign-in provider needs a fresh sign-in. Go back to the console, confirm it is you under Your sign-in methods, then link it again.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then link the provider again.",credential_exists:"This single sign-on account is already linked to another member."},xS=new Set(["reauth_required","access_reauth_required","credential_exists"]);function mg(t){return Object.hasOwn(Jp,t)?Jp[t]:void 0}function ld(t){return Lr(t)&&mg(t.code)||ba(t)}function yc({title:t,subtitle:r,children:i}){return d.jsxs("div",{className:"gc-auth",children:[d.jsx("div",{className:"gc-auth__theme",children:d.jsx(pg,{})}),d.jsx("div",{className:"gc-auth__logo",children:d.jsx(vc,{to:null,tagged:!0,size:30})}),d.jsxs(Pc,{className:"gc-auth__card",children:[d.jsx("h1",{className:"gc-auth__title",children:t}),r&&d.jsx("p",{className:"gc-auth__subtitle",children:r}),i]}),d.jsx("p",{className:"gc-auth__foot",children:"Self-hosted Antseed gateway"})]})}function vg(){const t=Qt();return r=>{t.setQueryData(me.me,r),Kt(r.kind==="key"?"key":"overview",{replace:!0})}}function em({label:t,run:r,primary:i}){const[s,l]=M.useState(!1),[f,v]=M.useState(null),p=Wo();return d.jsxs("div",{className:"gc-stack gc-stack--tight",children:[d.jsx(Pe,{fullWidth:!0,variant:i?"primary":"outline",disabled:s||!p,onClick:async()=>{l(!0),v(null);try{await r()}catch(g){v(mc(g)?pc:ld(g))}finally{l(!1)}},children:s?"Waiting for your passkey…":t}),!p&&d.jsx("p",{className:"gc-fineprint",children:"This browser does not support passkeys."}),f&&d.jsx(lt,{tone:"danger",children:f})]})}function kS({enrollment:t,onSignedIn:r}){const[i,s]=M.useState(!1);return i?d.jsx(M.Suspense,{fallback:d.jsx(Pe,{variant:"outline",fullWidth:!0,disabled:!0,children:"Loading wallets…"}),children:d.jsx(wS,{enrollment:t,onSignedIn:r,autoConnect:!0})}):d.jsx(Pe,{variant:"outline",fullWidth:!0,onClick:()=>s(!0),children:"Sign in with a wallet"})}function SS(){return d.jsx("div",{className:"gc-divider",children:d.jsx("span",{children:"or"})})}function CS({onSignedIn:t}){const[r,i]=M.useState(""),[s,l]=M.useState(!1),[f,v]=M.useState(null);return d.jsxs("form",{className:"gc-stack gc-stack--tight",onSubmit:async p=>{p.preventDefault(),l(!0),v(null);try{t(await ae.auth.apiKey(r.trim()))}catch(g){v(ld(g))}finally{l(!1)}},children:[d.jsx(Rx,{label:"API key",type:"password",autoComplete:"off",placeholder:"Paste your key to see its usage",value:r,onChange:p=>i(p.target.value)}),d.jsx(Pe,{type:"submit",variant:"outline",fullWidth:!0,disabled:s||!r.trim(),children:s?"Checking…":"View key usage"}),f&&d.jsx(lt,{tone:"danger",children:f})]})}function _S({mode:t,enrollment:r,onSignedIn:i}){return t==="login"?d.jsx(em,{primary:!0,label:"Sign in with a passkey",run:async()=>{const s=await ae.auth.passkeyLoginOptions(),l=await tg({optionsJSON:s});i(await ae.auth.passkeyLoginVerify(l))}}):d.jsx(em,{primary:!0,label:"Create a passkey",run:async()=>{const s=await ae.auth.passkeyRegisterOptions(r),l=await eg({optionsJSON:s});i(await ae.auth.passkeyRegisterVerify(l,r))}})}function gg({config:t,enrollment:r,onSignedIn:i,mode:s}){const l=[];return t.passkey&&l.push(d.jsx(_S,{mode:s,enrollment:r,onSignedIn:i},"passkey")),t.wallet&&l.push(d.jsx(kS,{enrollment:r,onSignedIn:i},"wallet")),t.oidc&&l.push(d.jsxs(Pe,{variant:"outline",fullWidth:!0,href:ae.auth.oidcStartUrl(r),children:["Continue with ",t.oidc.label]},"oidc")),l.length===0?d.jsx(lt,{tone:"warning",children:"No sign-in method is enabled on this gateway. Check the gateway's console auth settings."}):d.jsx("div",{className:"gc-stack",children:l})}function ES(){const t=Zc(),r=vg(),i=new URLSearchParams(window.location.search).get("error");return d.jsxs(yc,{title:"Sign in",subtitle:"Manage keys, budgets, routing and funding for this gateway.",children:[i&&d.jsx(lt,{tone:"danger",action:xS.has(i)?d.jsx(Pe,{size:"sm",variant:"outline",onClick:()=>Kt("overview?account=1",{replace:!0}),children:"Back to the console"}):void 0,children:mg(i)??"Sign-in did not complete. Try again."}),t.isLoading&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(Mo,{height:34}),d.jsx(Mo,{height:34})]}),t.error?d.jsx(lt,{tone:"danger",title:"Could not reach the gateway",children:ba(t.error)}):null,t.data&&d.jsxs("div",{className:"gc-stack",children:[t.data.setupRequired&&d.jsxs(lt,{tone:"info",title:"Not set up yet",children:["Get a one-time setup link by running ",d.jsx("code",{children:"antseed gateway console-link"})," on the gateway, or ask the operator for it."]}),d.jsx(gg,{config:t.data,mode:"login",onSignedIn:r}),t.data.cloudflareAccess&&d.jsx("p",{className:"gc-fineprint",children:"This gateway also accepts Cloudflare Access. If you signed in there, reload this page."}),t.data.apiKeyLogin&&d.jsxs(d.Fragment,{children:[d.jsx(SS,{}),d.jsx(CS,{onSignedIn:r})]})]})]})}function PS({kind:t}){const[r,i]=M.useState(()=>window.location.hash.replace(/^#/,""));M.useEffect(()=>{const p=()=>{const g=window.location.hash.replace(/^#/,"");g&&(i(g),window.history.replaceState(null,"",window.location.pathname))};return p(),window.addEventListener("hashchange",p),()=>window.removeEventListener("hashchange",p)},[]);const s=vg(),l=Zc(),f=Te({queryKey:["enrollment",t,r],queryFn:()=>t==="setup"?ae.auth.setup(r):t==="recover"?ae.request("POST","/auth/recover",{body:{token:r}}):ae.auth.invite(r),enabled:r!=="",retry:!1,staleTime:1/0}),v=t==="setup"?"Set up your Antseed console":t==="recover"?"Add a sign-in method":"You are invited";return r?d.jsxs(yc,{title:v,subtitle:f.data?t==="recover"?d.jsxs(d.Fragment,{children:["Welcome back, ",d.jsx("strong",{children:f.data.label}),". Add a passkey, wallet or single sign-on to sign in on this address."]}):d.jsxs(d.Fragment,{children:["Welcome, ",d.jsx("strong",{children:f.data.label}),". You will join as ",Kc[f.data.orgRole].toLowerCase(),". Choose how you sign in."]}):"Checking your link…",children:[(f.isLoading||l.isLoading)&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(Mo,{height:34}),d.jsx(Mo,{height:34})]}),f.error?d.jsxs("div",{className:"gc-stack",children:[d.jsx(lt,{tone:"danger",children:ld(f.error)}),d.jsx(Pe,{variant:"ghost",onClick:()=>Kt("login"),children:"Go to sign in"})]}):null,f.data&&l.data&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(gg,{config:l.data,mode:"enroll",enrollment:f.data.enrollment,onSignedIn:s}),d.jsx("p",{className:"gc-fineprint",children:"A passkey uses your device's screen lock or a security key. Nothing to remember."})]})]}):d.jsxs(yc,{title:v,children:[d.jsx(lt,{tone:"danger",children:"This link is missing its token. Open the full link you were given."}),d.jsx(Pe,{variant:"ghost",onClick:()=>Kt("login"),children:"Go to sign in"})]})}const Ea={overview:()=>ze(()=>import("./Overview-CJl9bY9L.js"),__vite__mapDeps([7,8,9,10,11,12])),chat:()=>ze(()=>import("./Chat-DXeiNUvp.js").then(t=>t.C),__vite__mapDeps([13,14,15,16,17,18,19,12,20,11,21,2,22])),activity:()=>ze(()=>import("./Activity-DATDm05n.js"),__vite__mapDeps([23,8,9,10,15,11,12,16,24])),logs:()=>ze(()=>import("./Logs-oKL9uKOU.js"),__vite__mapDeps([25,26,27,15,9,17,24,28,16])),keys:()=>ze(()=>import("./Keys-BjYvx7sT.js"),__vite__mapDeps([29,30,31,15,24,16,11,12,32,19,33,28,9,10])),members:()=>ze(()=>import("./Members-T-UrNdtc.js"),__vite__mapDeps([34,30,31,15,24,16,11,12,32,33])),workspaces:()=>ze(()=>import("./Workspaces-DdMaBlC2.js"),__vite__mapDeps([35,30,31,15,24,16,11,12,32,33])),wallet:()=>ze(()=>import("./Wallet-CqvNVXRO.js"),__vite__mapDeps([36,37,3,38,24,32])),rewards:()=>ze(()=>import("./Rewards-DlbuI--y.js"),__vite__mapDeps([39,37,40,24])),staking:()=>ze(()=>import("./Staking-Bmp79Jmy.js"),__vite__mapDeps([41,42,1,2,3,4,43,44,45,37,46,19,12])),providers:()=>ze(()=>import("./Providers-BAhStRFF.js"),__vite__mapDeps([47,14,15,16,21,31,24,11,12,32,17,40,48,30,49,19])),models:()=>ze(()=>import("./Models-PTbGWvAC.js"),__vite__mapDeps([50,18,14,15,16,19,12,17,20,11,21,51,24])),routing:()=>ze(()=>import("./Routing-BlkYS_0B.js"),__vite__mapDeps([52,30,31,15,24,16,11,12,32,14,51,20,17])),presets:()=>ze(()=>import("./Presets-wZYcL1FD.js"),__vite__mapDeps([48,30,31,15,24,16,11,12,32,49])),audit:()=>ze(()=>import("./Audit-DoUfhCFC.js"),__vite__mapDeps([53,27,16,24])),settings:()=>ze(()=>import("./Settings-yiWxbHdt.js"),__vite__mapDeps([54,31,15,24,16,11,12,32,49,19]))},yg={};for(const t of Object.keys(Ea))yg[t]=M.lazy(Ea[t]);const tm=jv(window.location.pathname).page;wg(tm)&&Ea[tm]().catch(()=>{});const nm=()=>{Ea.chat().catch(()=>{})};"requestIdleCallback"in window?window.requestIdleCallback(nm,{timeout:4e3}):setTimeout(nm,2e3);const jS=M.lazy(()=>ze(()=>import("./KeyHolder-DxMTzn2W.js"),__vite__mapDeps([55,26,27,15,9,17,24,10]))),bS=new Jw({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:(t,r)=>!(Lr(r)&&r.status>=400&&r.status<500)&&t<2}}});class TS extends M.Component{constructor(){super(...arguments);ku(this,"state",{failed:!1})}static getDerivedStateFromError(i){return{failed:!0,error:i}}render(){return this.state.failed?d.jsx(Ao,{error:this.state.error,title:"This page failed to load",onRetry:()=>this.setState({failed:!1,error:void 0})}):this.props.children}}function wg(t){return Vc.some(r=>r.id===t)}function RS({me:t,page:r}){const[i,s]=M.useState(()=>{var C;return((C=Ap(t,Bx()))==null?void 0:C.id)??null}),l=Ap(t,i),f=Qt(),v=Qc(),p=Ux(v.page,v.rest);M.useEffect(()=>{p&&Kt(p,{replace:!0})},[p]);const g=M.useMemo(()=>{if(!l)return null;const C=Fx({me:t},l.id);return{me:t,workspace:l,workspaceRole:C.workspaceRole,viewer:C,setWorkspaceId:N=>{Hx(N),s(N),f.invalidateQueries()}}},[t,l,f]);if(p)return d.jsx("div",{className:"gc-centered",children:d.jsx(Ii,{rows:3})});if(!g)return d.jsx("div",{className:"gc-centered",children:d.jsx(lt,{tone:"warning",title:"No workspace",children:"You are not a member of any workspace yet. Ask an admin to add you."})});const h=wg(r)?r:"overview",y=qc(h,g.viewer),x=yg[h];return d.jsx(_v.Provider,{value:g,children:d.jsx(yS,{page:h,children:d.jsx(TS,{children:d.jsx(M.Suspense,{fallback:d.jsx(Ii,{rows:6}),children:y?d.jsx(x,{}):d.jsx(lt,{tone:"warning",title:"Not available",children:"Your role cannot open this page."})})},v.page)})})}function NS({page:t}){const r=d2(),i=Lr(r.error)&&r.error.status===401;return M.useEffect(()=>{i&&Kt("login",{replace:!0})},[i]),r.isLoading||i?d.jsx("div",{className:"gc-centered",children:d.jsx(Ii,{rows:3})}):r.error?d.jsxs("div",{className:"gc-centered gc-stack",children:[d.jsx(Ao,{error:r.error,title:"Could not open the console",onRetry:()=>void r.refetch()}),d.jsx(Pe,{variant:"ghost",onClick:()=>Kt("login"),children:"Go to sign in"})]}):r.data?r.data.kind==="key"?d.jsx(M.Suspense,{fallback:d.jsx(Ii,{rows:6}),children:d.jsx(jS,{})}):d.jsx(RS,{me:r.data.me,page:t}):null}function IS(){const t=Qc();return t.page==="login"?d.jsx(ES,{}):t.page==="setup"||t.page==="invite"||t.page==="recover"?d.jsx(PS,{kind:t.page}):d.jsx(NS,{page:t.page})}function MS(){return d.jsx(e1,{client:bS,children:d.jsx(Ix,{children:d.jsx(IS,{})})})}Wx();async function LS(){const t=document.getElementById("root");if(!t)throw new Error("#root element is missing");Tw.createRoot(t).render(d.jsx(M.StrictMode,{children:d.jsx(MS,{})}))}LS();export{Lr as $,fk as A,Pe as B,gv as C,yv as D,WS as E,Qt as F,Hc as G,NC as H,ut as I,MC as J,d_ as K,Ii as L,a_ as M,Yc as N,f_ as O,BS as P,bk as Q,Qc as R,HS as S,Rx as T,CC as U,RC as V,wx as W,Ex as X,Px as Y,Zx as Z,ze as _,qS as a,Ta as a$,bx as a0,Tx as a1,jx as a2,mS as a3,d2 as a4,vc as a5,Gp as a6,pg as a7,bv as a8,tC as a9,Oo as aA,OC as aB,l2 as aC,Pk as aD,jk as aE,pc as aF,mc as aG,zC as aH,Nv as aI,mC as aJ,Yk as aK,g_ as aL,VS as aM,u_ as aN,r_ as aO,Cv as aP,n_ as aQ,hC as aR,i_ as aS,ma as aT,Kc as aU,_C as aV,c_ as aW,GS as aX,QS as aY,lS as aZ,aS as a_,wa as aa,Xx as ab,nC as ac,XS as ad,JS as ae,lt as af,ng as ag,Bo as ah,XC as ai,v1 as aj,Xc as ak,h_ as al,p_ as am,ba as an,s_ as ao,LC as ap,cC as aq,AC as ar,n2 as as,i2 as at,r2 as au,Bc as av,_o as aw,e2 as ax,FC as ay,DC as az,pC as b,Nr as b$,ug as b0,v_ as b1,ZS as b2,$x as b3,PC as b4,IC as b5,qw as b6,wp as b7,zS as b8,$S as b9,wC as bA,Du as bB,KC as bC,QC as bD,Ek as bE,fC as bF,e_ as bG,m_ as bH,Mi as bI,Ve as bJ,va as bK,vm as bL,t1 as bM,i1 as bN,l1 as bO,o1 as bP,s1 as bQ,pt as bR,c1 as bS,xp as bT,a1 as bU,Gc as bV,Ho as bW,jC as bX,Mv as bY,eC as bZ,f1 as b_,d1 as ba,l_ as bb,eS as bc,y_ as bd,zx as be,t_ as bf,uS as bg,x_ as bh,w_ as bi,qc as bj,vC as bk,yC as bl,xC as bm,TC as bn,bC as bo,yk as bp,HC as bq,wk as br,BC as bs,dk as bt,bm as bu,UC as bv,o_ as bw,JC as bx,WC as by,gC as bz,EC as c,VC as c0,uk as c1,ZC as c2,td as c3,GC as c4,qC as c5,YC as c6,dC as c7,$C as c8,AS as c9,Nm as cA,Rm as cB,sn as cC,fa as cD,ha as cE,lv as cF,C1 as cG,K0 as cH,_1 as cI,tn as cJ,kw as ca,m2 as cb,sC as cc,kx as cd,Ik as ce,s2 as cf,aC as cg,lC as ch,o2 as ci,iC as cj,oC as ck,t2 as cl,rC as cm,uC as cn,e1 as co,Jw as cp,Kx as cq,Mx as cr,Lx as cs,KS as ct,DS as cu,FS as cv,Uc as cw,lx as cx,xc as cy,Lm as cz,SC as d,Te as e,ae as f,Gx as g,Yx as h,Wc as i,d as j,YS as k,Cx as l,Xe as m,Li as n,Ao as o,kC as p,me as q,M as r,f2 as s,_a as t,Pn as u,pi as v,ln as w,h2 as x,Kt as y,Jx as z};