@madarco/agentbox 0.28.1 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) hide show
  1. package/CHANGELOG.md +124 -0
  2. package/dist/_cloud-attach-HKRHYCY7.js +30 -0
  3. package/dist/{chunk-JNC7MCWJ.js → chunk-3INUZQTR.js} +10 -10
  4. package/dist/chunk-3INUZQTR.js.map +1 -0
  5. package/dist/{chunk-4PR3KJ5X.js → chunk-6PIGTR4D.js} +20 -20
  6. package/dist/{chunk-NHVGKFVY.js → chunk-7LNXTPEE.js} +340 -22
  7. package/dist/chunk-7LNXTPEE.js.map +1 -0
  8. package/dist/{chunk-WB6S4W7O.js → chunk-7Q6BG5AN.js} +2413 -1012
  9. package/dist/chunk-7Q6BG5AN.js.map +1 -0
  10. package/dist/{chunk-BUMKBUXS.js → chunk-7QU6XENE.js} +3 -3
  11. package/dist/chunk-BWE2I5QG.js +17 -0
  12. package/dist/chunk-BWE2I5QG.js.map +1 -0
  13. package/dist/{chunk-7ABO7OIF.js → chunk-CO2I3CQI.js} +4 -4
  14. package/dist/{chunk-OUF3YTQO.js → chunk-DBXCFLAR.js} +14 -17
  15. package/dist/chunk-DBXCFLAR.js.map +1 -0
  16. package/dist/{chunk-74VIUGY6.js → chunk-DYETLPUT.js} +6 -9
  17. package/dist/chunk-DYETLPUT.js.map +1 -0
  18. package/dist/{chunk-HYXCH4GA.js → chunk-EFVTQ7YB.js} +7 -7
  19. package/dist/{chunk-46NNZMZT.js → chunk-EPFXLXCW.js} +372 -72
  20. package/dist/chunk-EPFXLXCW.js.map +1 -0
  21. package/dist/chunk-GWKGSXDC.js +71 -0
  22. package/dist/chunk-GWKGSXDC.js.map +1 -0
  23. package/dist/{chunk-CKD3PRON.js → chunk-GWYD7YBK.js} +12 -9
  24. package/dist/{chunk-CKD3PRON.js.map → chunk-GWYD7YBK.js.map} +1 -1
  25. package/dist/{chunk-NHTRTST5.js → chunk-HNWZO2XU.js} +38 -15
  26. package/dist/chunk-HNWZO2XU.js.map +1 -0
  27. package/dist/{chunk-EVT2SNF2.js → chunk-HO2ACZES.js} +3 -3
  28. package/dist/{chunk-V5NWSLWD.js → chunk-HP4L45LW.js} +14 -14
  29. package/dist/{chunk-B4DAH2F2.js → chunk-LHOKRCNF.js} +3 -3
  30. package/dist/{chunk-G3H2L3O2.js → chunk-MNDKP4VS.js} +23 -3
  31. package/dist/chunk-MNDKP4VS.js.map +1 -0
  32. package/dist/{chunk-JDSYMTMS.js → chunk-NAT2H7J4.js} +110 -66
  33. package/dist/chunk-NAT2H7J4.js.map +1 -0
  34. package/dist/{chunk-KFLGXE3R.js → chunk-NGERWFSA.js} +133 -22
  35. package/dist/chunk-NGERWFSA.js.map +1 -0
  36. package/dist/{chunk-GFOWBXV7.js → chunk-OKLEPEWZ.js} +460 -253
  37. package/dist/chunk-OKLEPEWZ.js.map +1 -0
  38. package/dist/{chunk-YI4GHC2E.js → chunk-QU5BI2HC.js} +12 -15
  39. package/dist/chunk-QU5BI2HC.js.map +1 -0
  40. package/dist/{chunk-BWM56FKY.js → chunk-RQURMAPA.js} +11 -11
  41. package/dist/{chunk-FPMRFMVK.js → chunk-RZCLRWNY.js} +9 -9
  42. package/dist/{chunk-JQLOGVZK.js → chunk-THUST2QK.js} +85 -21
  43. package/dist/chunk-THUST2QK.js.map +1 -0
  44. package/dist/{chunk-OXKW4GWD.js → chunk-UPVP6YGJ.js} +4 -70
  45. package/dist/chunk-UPVP6YGJ.js.map +1 -0
  46. package/dist/{chunk-7RSE7ESY.js → chunk-VVNXQ4XS.js} +27 -18
  47. package/dist/chunk-VVNXQ4XS.js.map +1 -0
  48. package/dist/{chunk-FGQFVUMH.js → chunk-VY54AX4T.js} +3 -3
  49. package/dist/{chunk-OUWVN2F2.js → chunk-WGNI24H2.js} +16 -13
  50. package/dist/chunk-WGNI24H2.js.map +1 -0
  51. package/dist/{chunk-PSA6GADQ.js → chunk-WHFCJBMO.js} +14 -1
  52. package/dist/chunk-WHFCJBMO.js.map +1 -0
  53. package/dist/{chunk-KJ5TCYNI.js → chunk-WHJYOO5H.js} +7 -6
  54. package/dist/chunk-WHJYOO5H.js.map +1 -0
  55. package/dist/cloud-backends.js +5 -5
  56. package/dist/{cloud-poller-SUNA6ZQC-7M5LJHHE.js → cloud-poller-QJRZXB4W-LJ2BRB3L.js} +2 -2
  57. package/dist/{control-plane-5R7PYRQ6.js → control-plane-UKKYXHIQ.js} +19 -18
  58. package/dist/cp-hub-upload-BM2OLTOS.js +81 -0
  59. package/dist/cp-hub-upload-BM2OLTOS.js.map +1 -0
  60. package/dist/{custody-client-PNCC2HBJ.js → custody-client-NPXJ46TB.js} +5 -4
  61. package/dist/{deploy-hetzner-SSGSXAKA.js → deploy-hetzner-Y3ILCDRF.js} +10 -10
  62. package/dist/{dist-RN6JOAG4.js → dist-5OGQ3CJQ.js} +81 -45
  63. package/dist/{dist-5OR4QTQW.js → dist-7B3VCLZI.js} +9 -9
  64. package/dist/{dist-EPFS5PRI.js → dist-A5ZEIVAW.js} +10 -10
  65. package/dist/{dist-6PYXFREL.js → dist-DOEGENNW.js} +61 -16
  66. package/dist/dist-DOEGENNW.js.map +1 -0
  67. package/dist/{dist-XQLKK7H3.js → dist-EOGD7KD6.js} +54 -28
  68. package/dist/dist-EOGD7KD6.js.map +1 -0
  69. package/dist/{dist-XATN4ZIR.js → dist-FBM2WS5S.js} +22 -4
  70. package/dist/{dist-POILUDVJ.js → dist-MUTFY7FA.js} +9 -9
  71. package/dist/{dist-ZNQZHTUN.js → dist-SMDXLPZO.js} +35 -6
  72. package/dist/{dist-M4O5MU5K.js → dist-VTLQKZ2E.js} +8 -8
  73. package/dist/{dist-SN2TCRZ5.js → dist-ZJIJHCZB.js} +9 -9
  74. package/dist/{dist-K5M4HKG7.js → dist-ZNYS7CVF.js} +21 -9
  75. package/dist/host-reach-drainer-ZJU2STQQ.js +9 -0
  76. package/dist/hub-Q4VOF4WN.js +37 -0
  77. package/dist/{hub-adopt-I44VGSBL.js → hub-adopt-OA336ZXZ.js} +8 -8
  78. package/dist/{hub-api-client-WJPBXZAZ.js → hub-api-client-5U6WOTZ3.js} +2 -2
  79. package/dist/{hub-docker-target-REEEWUG2.js → hub-docker-target-JKFCABK4.js} +16 -16
  80. package/dist/index.js +1321 -882
  81. package/dist/index.js.map +1 -1
  82. package/dist/prepare-GFWWKWGF.js +41 -0
  83. package/dist/prepared-custody-KU4PDVBT.js +36 -0
  84. package/dist/{prepared-state-PV3GUBHO-MF56HWMZ.js → prepared-state-LNQ7DYSU-AR5RMXAO.js} +4 -3
  85. package/dist/{publish-credentials-BPHUO5VL.js → publish-credentials-3SQXX45P.js} +11 -11
  86. package/dist/registry-AFKV3EO2.js +18 -0
  87. package/dist/relay-QH6OEY2V.js +20 -0
  88. package/dist/relay-QH6OEY2V.js.map +1 -0
  89. package/dist/{remote-docker-share-RX5ARK45.js → remote-docker-share-RMS6IB5X.js} +11 -11
  90. package/dist/remote-docker-share-RMS6IB5X.js.map +1 -0
  91. package/dist/tool-grant-push-T6DRBY3W.js +90 -0
  92. package/dist/tool-grant-push-T6DRBY3W.js.map +1 -0
  93. package/package.json +1 -2
  94. package/runtime/_shared/agentbox-tool-shim +21 -0
  95. package/runtime/_shared/ctl.cjs +6757 -5299
  96. package/runtime/_shared/gh-shim +103 -228
  97. package/runtime/digitalocean/agentbox-tool-shim +21 -0
  98. package/runtime/digitalocean/ctl.cjs +6757 -5299
  99. package/runtime/digitalocean/gh-shim +103 -228
  100. package/runtime/digitalocean/scripts/install-box.sh +9 -15
  101. package/runtime/docker/Dockerfile.box +8 -18
  102. package/runtime/docker/packages/ctl/dist/bin.cjs +6757 -5299
  103. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-tool-shim +21 -0
  104. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +103 -228
  105. package/runtime/e2b/agentbox-tool-shim +21 -0
  106. package/runtime/e2b/ctl.cjs +6757 -5299
  107. package/runtime/e2b/gh-shim +103 -228
  108. package/runtime/e2b/scripts/build-template.sh +5 -9
  109. package/runtime/hetzner/agentbox-tool-shim +21 -0
  110. package/runtime/hetzner/ctl.cjs +6757 -5299
  111. package/runtime/hetzner/gh-shim +103 -228
  112. package/runtime/hetzner/scripts/install-box.sh +9 -15
  113. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  114. package/runtime/hub/apps/hub/.next/app-path-routes-manifest.json +2 -0
  115. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  116. package/runtime/hub/apps/hub/.next/routes-manifest.json +16 -0
  117. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +5 -5
  118. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
  119. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js +2 -2
  120. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/[id]/answer/route.js.nft.json +1 -1
  121. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js +2 -2
  122. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/approvals/route.js.nft.json +1 -1
  123. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js +2 -2
  124. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/[action]/route.js.nft.json +1 -1
  125. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js +2 -2
  126. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/agent/route.js.nft.json +1 -1
  127. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js +2 -2
  128. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/branches/route.js.nft.json +1 -1
  129. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js +2 -2
  130. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/checkpoint/route.js.nft.json +1 -1
  131. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js +2 -2
  132. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/[op]/route.js.nft.json +1 -1
  133. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js +2 -2
  134. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/git/route.js.nft.json +1 -1
  135. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js +1 -1
  136. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/logs/route.js.nft.json +1 -1
  137. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js +2 -2
  138. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/open/route.js.nft.json +1 -1
  139. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js +2 -2
  140. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/rename/route.js.nft.json +1 -1
  141. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js +2 -2
  142. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/route.js.nft.json +1 -1
  143. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js +2 -2
  144. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/restart/route.js.nft.json +1 -1
  145. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js +2 -2
  146. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/services/route.js.nft.json +1 -1
  147. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route/app-paths-manifest.json +3 -0
  148. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route/build-manifest.json +9 -0
  149. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route/server-reference-manifest.json +4 -0
  150. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js +8 -0
  151. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.map +5 -0
  152. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route.js.nft.json +1 -0
  153. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/[id]/vnc/route_client-reference-manifest.js +3 -0
  154. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js +2 -2
  155. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/boxes/route.js.nft.json +1 -1
  156. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js +2 -2
  157. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/checkpoints/route.js.nft.json +1 -1
  158. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/[...path]/route.js +1 -1
  159. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/[...path]/route.js.nft.json +1 -1
  160. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/blob/[...path]/route.js +2 -2
  161. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/custody/blob/[...path]/route.js.nft.json +1 -1
  162. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js +2 -2
  163. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/health/route.js.nft.json +1 -1
  164. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js +2 -2
  165. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/bake/route.js.nft.json +1 -1
  166. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js +2 -2
  167. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/[alias]/route.js.nft.json +1 -1
  168. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js +2 -2
  169. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/hosts/route.js.nft.json +1 -1
  170. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js +2 -2
  171. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/login-code/route.js.nft.json +1 -1
  172. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js +2 -2
  173. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/logs/route.js.nft.json +1 -1
  174. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js +2 -2
  175. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/[id]/route.js.nft.json +1 -1
  176. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js +2 -2
  177. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/jobs/route.js.nft.json +1 -1
  178. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js +2 -2
  179. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/open-targets/route.js.nft.json +1 -1
  180. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js +2 -2
  181. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/branches/route.js.nft.json +1 -1
  182. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js +2 -2
  183. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/route.js.nft.json +1 -1
  184. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js +2 -2
  185. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/[id]/seed/route.js.nft.json +1 -1
  186. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js +2 -2
  187. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/projects/route.js.nft.json +1 -1
  188. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js +2 -2
  189. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/credentials/route.js.nft.json +1 -1
  190. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js +2 -2
  191. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/[id]/prepare/route.js.nft.json +1 -1
  192. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js +2 -2
  193. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/providers/route.js.nft.json +1 -1
  194. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js +2 -2
  195. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/prune/route.js.nft.json +1 -1
  196. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js +2 -2
  197. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/api/v1/system/route.js.nft.json +1 -1
  198. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js +1 -1
  199. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page.js.nft.json +1 -1
  200. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js +1 -1
  201. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page.js.nft.json +1 -1
  202. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  203. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route/app-paths-manifest.json +3 -0
  204. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route/build-manifest.json +9 -0
  205. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route/server-reference-manifest.json +4 -0
  206. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js +8 -0
  207. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.map +5 -0
  208. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route.js.nft.json +1 -0
  209. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/vnc/route_client-reference-manifest.js +3 -0
  210. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js +1 -1
  211. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/custody/page.js.nft.json +1 -1
  212. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js +1 -1
  213. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  214. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js +1 -1
  215. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page.js.nft.json +1 -1
  216. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js +1 -1
  217. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
  218. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  219. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js +1 -1
  220. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/system/page.js.nft.json +1 -1
  221. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +4 -4
  222. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  223. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  224. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  225. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  226. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  227. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  228. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  229. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  230. package/runtime/hub/apps/hub/.next/server/app-paths-manifest.json +2 -0
  231. package/runtime/hub/apps/hub/.next/server/chunks/044u_hub__next-internal_server_app_(dashboard)_boxes_[id]_vnc_route_actions_1cy1392.js +3 -0
  232. package/runtime/hub/apps/hub/.next/server/chunks/1jcg_server_app_(dashboard)_api_v1_boxes_[id]_vnc_route_actions_10y_e83.js +3 -0
  233. package/runtime/hub/apps/hub/.next/server/chunks/{[externals]__1nj4awx._.js → [externals]__02a249v._.js} +2 -2
  234. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__00f9v4p._.js +1 -1
  235. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__01nppdu._.js +1 -1
  236. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__02f8rwr._.js +1 -1
  237. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__068_052._.js +1 -1
  238. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__06ma5m4._.js +3 -0
  239. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07kp2fu._.js +1 -1
  240. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1yi-2wa._.js → [root-of-the-server]__08u01ud._.js} +3 -3
  241. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__098bkh3._.js +3 -0
  242. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1hxo1tv._.js → [root-of-the-server]__09hbkgm._.js} +2 -2
  243. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__09tmbom._.js +3 -0
  244. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0_3m9sf._.js +1 -1
  245. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0aotdzg._.js +3 -0
  246. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0bn6-pu._.js +1 -1
  247. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0cpt9f9._.js +1 -1
  248. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +15 -15
  249. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0dom248._.js +1 -1
  250. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0f0bb7o._.js +1 -1
  251. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0gb04bp._.js +1 -1
  252. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0glplq7._.js +1 -1
  253. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0xrdbh9._.js → [root-of-the-server]__0gxfyol._.js} +2 -2
  254. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0hsb2ak._.js +1 -1
  255. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0joqm8t._.js +1 -1
  256. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0jp-895._.js +1 -1
  257. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1leda2s._.js → [root-of-the-server]__0jpqg_t._.js} +2 -2
  258. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__17bhgkz._.js → [root-of-the-server]__0lgnu00._.js} +2 -2
  259. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0lsv9-6._.js +1 -1
  260. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0pzgufc._.js +1 -1
  261. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qfv7z6._.js +1 -1
  262. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0qlr61y._.js +1 -1
  263. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0s8srqi._.js +1 -1
  264. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0urn9j5._.js +1 -1
  265. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0vb8mk2._.js +4 -0
  266. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__17w5eaa._.js → [root-of-the-server]__0x27ifo._.js} +2 -2
  267. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0y7rvy1._.js +1 -1
  268. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0zsgjre._.js +1 -1
  269. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-bqa8a._.js +1 -1
  270. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__11uspjg._.js +1 -1
  271. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0zvr6ul._.js → [root-of-the-server]__15tgdh6._.js} +2 -2
  272. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1ek7nxv._.js → [root-of-the-server]__16bz_kz._.js} +2 -2
  273. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1w7jw4q._.js → [root-of-the-server]__18tehjj._.js} +2 -2
  274. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1ds8g0e._.js → [root-of-the-server]__1_hzv4s._.js} +2 -2
  275. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0cgpsh8._.js → [root-of-the-server]__1b5f5h4._.js} +2 -2
  276. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__10-aihp._.js → [root-of-the-server]__1dv80yf._.js} +2 -2
  277. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1eanlxn._.js +1 -1
  278. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__16lcb2d._.js → [root-of-the-server]__1fc-nvn._.js} +2 -2
  279. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1h4iahl._.js +1 -1
  280. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0f-c-eh._.js → [root-of-the-server]__1j0vnh3._.js} +2 -2
  281. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1lgrtx6._.js +1 -1
  282. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1unqgd7._.js → [root-of-the-server]__1lz7931._.js} +2 -2
  283. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1oclxlx._.js → [root-of-the-server]__1n3u6-5._.js} +2 -2
  284. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qky5cd._.js +1 -1
  285. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1r2quye._.js +3 -0
  286. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1rb_nc5._.js +1 -1
  287. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0cv16py._.js → [root-of-the-server]__1spr8ss._.js} +2 -2
  288. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1t_juqb._.js +1 -1
  289. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0t8kwy3._.js → [root-of-the-server]__1tct9rj._.js} +3 -3
  290. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0gfa1jg._.js → [root-of-the-server]__1tjtt06._.js} +2 -2
  291. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__09cigc7._.js → [root-of-the-server]__1whjno0._.js} +2 -2
  292. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1wn4-iv._.js +3 -0
  293. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1x6zxrf._.js +1 -1
  294. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__0tyixgg._.js → [root-of-the-server]__1xfxc6i._.js} +2 -2
  295. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1m1_gm_._.js → [root-of-the-server]__1xqcvi4._.js} +2 -2
  296. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__207d30i._.js +1 -1
  297. package/runtime/hub/apps/hub/.next/server/chunks/_07icdxf._.js +1 -1
  298. package/runtime/hub/apps/hub/.next/server/chunks/_0907rw0._.js +1 -1
  299. package/runtime/hub/apps/hub/.next/server/chunks/_0adm87k._.js +1 -1
  300. package/runtime/hub/apps/hub/.next/server/chunks/_0g01mkg._.js +1 -1
  301. package/runtime/hub/apps/hub/.next/server/chunks/_0l_klgd._.js +1 -1
  302. package/runtime/hub/apps/hub/.next/server/chunks/_0lfm81x._.js +1 -1
  303. package/runtime/hub/apps/hub/.next/server/chunks/_0tbg83f._.js +1 -1
  304. package/runtime/hub/apps/hub/.next/server/chunks/_0tms_au._.js +1 -1
  305. package/runtime/hub/apps/hub/.next/server/chunks/_0zhli27._.js +1 -1
  306. package/runtime/hub/apps/hub/.next/server/chunks/_10yfoq5._.js +1 -1
  307. package/runtime/hub/apps/hub/.next/server/chunks/_12uhpbp._.js +1 -1
  308. package/runtime/hub/apps/hub/.next/server/chunks/_17a9v8y._.js +2 -2
  309. package/runtime/hub/apps/hub/.next/server/chunks/_1c7x9ee._.js +1 -1
  310. package/runtime/hub/apps/hub/.next/server/chunks/_1n-c443._.js +1 -1
  311. package/runtime/hub/apps/hub/.next/server/chunks/_1y80vfg._.js +1 -1
  312. package/runtime/hub/apps/hub/.next/server/chunks/_214_q-1._.js +1 -1
  313. package/runtime/hub/apps/hub/.next/server/chunks/apps_hub_app_(dashboard)_api_v1_lib_openapi_ts_1yokmzt._.js +1 -1
  314. package/runtime/hub/apps/hub/.next/server/chunks/{packages_relay_dist_0eg7ay1._.js → packages_relay_dist_0p8dnf4._.js} +4 -4
  315. package/runtime/hub/apps/hub/.next/server/chunks/ssr/{[root-of-the-server]__1plrs94._.js → [root-of-the-server]__0-c5j6l._.js} +2 -2
  316. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r2xlss._.js +1 -1
  317. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_19vy9ni._.js +2 -2
  318. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  319. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_settings_page_tsx_0hv6n82._.js +1 -1
  320. package/runtime/hub/apps/hub/.next/server/chunks/ssr/{packages_relay_dist_1z9j3g0._.js → packages_relay_dist_0sap-2l._.js} +4 -4
  321. package/runtime/hub/apps/hub/.next/server/functions-config-manifest.json +3 -1
  322. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  323. package/runtime/hub/apps/hub/.next/server/middleware.js +1 -1
  324. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  325. package/runtime/hub/apps/hub/.next/static/chunks/{328ny-3zs_h7m.js → 0jefm3re1-2jv.js} +1 -1
  326. package/runtime/hub/apps/hub/.next/static/chunks/{30h8mz040b5-l.js → 3u4odx1_-dy6b.js} +1 -1
  327. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/boxes/[id]/vnc/route.ts +45 -0
  328. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/openapi.ts +45 -1
  329. package/runtime/hub/apps/hub/app/(dashboard)/api/v1/lib/validate.ts +14 -3
  330. package/runtime/hub/apps/hub/app/(dashboard)/boxes/[id]/vnc/route.ts +58 -0
  331. package/runtime/hub/apps/hub/app/(dashboard)/boxes/components/access.tsx +26 -9
  332. package/runtime/hub/apps/hub/app/(dashboard)/settings/components/provider-actions.tsx +34 -26
  333. package/runtime/hub/apps/hub/{auth-JMVHQKWY.js → auth-V7KPRWPS.js} +2 -2
  334. package/runtime/hub/apps/hub/{auth-config-5IFRWOK4.js → auth-config-B3Y3BT2I.js} +2 -2
  335. package/runtime/hub/apps/hub/{chunk-VKOCY6SX.js → chunk-3AD3MYNV.js} +49 -14
  336. package/runtime/hub/apps/hub/{chunk-KTVETF3F.js → chunk-3ZDBZYOY.js} +11 -8
  337. package/runtime/hub/apps/hub/{chunk-LPYK2354.js → chunk-5ABFGGPT.js} +339 -21
  338. package/runtime/hub/apps/hub/{chunk-UMPTTQBE.js → chunk-GBYD2ODL.js} +458 -251
  339. package/runtime/hub/apps/hub/{chunk-5TM7XXLT.js → chunk-H5SUXDZA.js} +2833 -1277
  340. package/runtime/hub/apps/hub/{chunk-QU3FFGJY.js → chunk-UQ5XNPOF.js} +11 -14
  341. package/runtime/hub/apps/hub/{chunk-3LAHFDJF.js → chunk-VWQNSZGI.js} +22 -2
  342. package/runtime/hub/apps/hub/{chunk-EZUK53CC.js → chunk-WHGY7HOC.js} +85 -21
  343. package/runtime/hub/apps/hub/{chunk-D33EV4YZ.js → chunk-ZP4RYI4U.js} +1 -1
  344. package/runtime/hub/apps/hub/{cloud-poller-SUNA6ZQC-VSKVMYHL.js → cloud-poller-QJRZXB4W-G7ECKNKQ.js} +1 -1
  345. package/runtime/hub/apps/hub/{dist-ELZHBQEM.js → dist-37EKQ6RZ.js} +11 -11
  346. package/runtime/hub/apps/hub/{dist-D265LCAN.js → dist-CGH7PEMZ.js} +21 -3
  347. package/runtime/hub/apps/hub/{dist-SYWTB6RD.js → dist-CMVSARW5.js} +15 -18
  348. package/runtime/hub/apps/hub/{dist-5HTJSOHS.js → dist-EGXZRZH2.js} +19 -7
  349. package/runtime/hub/apps/hub/{dist-YK5FFPXZ.js → dist-EOGGFZZS.js} +62 -20
  350. package/runtime/hub/apps/hub/{dist-E2FTSTCY.js → dist-LJBHOO3K.js} +34 -5
  351. package/runtime/hub/apps/hub/{dist-N3E5YAYY.js → dist-R77W6WJ5.js} +53 -26
  352. package/runtime/hub/apps/hub/{dist-JVEDVVVG.js → dist-TH2JZYZY.js} +7 -7
  353. package/runtime/hub/apps/hub/{dist-2YP57GMB.js → dist-XPRGHQH2.js} +13 -13
  354. package/runtime/hub/apps/hub/{dist-NKCXH5DW.js → dist-Z2Y5F7AF.js} +6 -6
  355. package/runtime/hub/apps/hub/docker-compose.yml +1 -0
  356. package/runtime/hub/apps/hub/{hub-token-MDOBY7MZ.js → hub-token-DDJ5Z6RS.js} +2 -2
  357. package/runtime/hub/apps/hub/{hub-worker-UFFLF37F.js → hub-worker-DXVMUQWF.js} +16 -16
  358. package/runtime/hub/apps/hub/lib/boxes/backend-types.ts +11 -0
  359. package/runtime/hub/apps/hub/lib/boxes/types.ts +43 -0
  360. package/runtime/hub/apps/hub/lib/boxes/vnc-link.ts +51 -0
  361. package/runtime/hub/apps/hub/lib/hub-backend.ts +127 -54
  362. package/runtime/hub/apps/hub/lib/hub-worker.ts +4 -4
  363. package/runtime/hub/apps/hub/lib/provider-importers.ts +66 -1
  364. package/runtime/hub/apps/hub/{prepared-state-PV3GUBHO-PPRQDYFR.js → prepared-state-LNQ7DYSU-ABC2EQVI.js} +3 -2
  365. package/runtime/hub/apps/hub/server.js +130 -72
  366. package/runtime/hub/apps/hub/server.ts +18 -0
  367. package/runtime/hub/apps/hub/test/vnc-link.test.ts +61 -0
  368. package/runtime/hub/apps/hub/tsconfig.tsbuildinfo +1 -1
  369. package/runtime/hub-deploy/docker-compose.yml +1 -0
  370. package/runtime/relay/bin.cjs +16623 -14688
  371. package/runtime/vercel/agentbox-tool-shim +21 -0
  372. package/runtime/vercel/ctl.cjs +6757 -5299
  373. package/runtime/vercel/gh-shim +103 -228
  374. package/runtime/vercel/scripts/provision.sh +5 -9
  375. package/share/host-skills/agentbox-info/SKILL.md +24 -14
  376. package/dist/_cloud-attach-Y5HIQ373.js +0 -28
  377. package/dist/chunk-46NNZMZT.js.map +0 -1
  378. package/dist/chunk-74VIUGY6.js.map +0 -1
  379. package/dist/chunk-7RSE7ESY.js.map +0 -1
  380. package/dist/chunk-G3H2L3O2.js.map +0 -1
  381. package/dist/chunk-GFOWBXV7.js.map +0 -1
  382. package/dist/chunk-JDSYMTMS.js.map +0 -1
  383. package/dist/chunk-JNC7MCWJ.js.map +0 -1
  384. package/dist/chunk-JQLOGVZK.js.map +0 -1
  385. package/dist/chunk-KFLGXE3R.js.map +0 -1
  386. package/dist/chunk-KJ5TCYNI.js.map +0 -1
  387. package/dist/chunk-NHTRTST5.js.map +0 -1
  388. package/dist/chunk-NHVGKFVY.js.map +0 -1
  389. package/dist/chunk-OUF3YTQO.js.map +0 -1
  390. package/dist/chunk-OUWVN2F2.js.map +0 -1
  391. package/dist/chunk-OXKW4GWD.js.map +0 -1
  392. package/dist/chunk-PSA6GADQ.js.map +0 -1
  393. package/dist/chunk-WB6S4W7O.js.map +0 -1
  394. package/dist/chunk-YI4GHC2E.js.map +0 -1
  395. package/dist/dist-6PYXFREL.js.map +0 -1
  396. package/dist/dist-XQLKK7H3.js.map +0 -1
  397. package/dist/hub-MJ7O4WXW.js +0 -36
  398. package/dist/prepare-V4U5HVJU.js +0 -40
  399. package/dist/prepared-custody-QIXW7MJM.js +0 -35
  400. package/dist/relay-DRDELF6B.js +0 -20
  401. package/runtime/_shared/linear-shim +0 -181
  402. package/runtime/_shared/ntn-shim +0 -95
  403. package/runtime/digitalocean/linear-shim +0 -181
  404. package/runtime/digitalocean/ntn-shim +0 -95
  405. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -181
  406. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -95
  407. package/runtime/e2b/linear-shim +0 -181
  408. package/runtime/e2b/ntn-shim +0 -95
  409. package/runtime/hetzner/linear-shim +0 -181
  410. package/runtime/hetzner/ntn-shim +0 -95
  411. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__039tc0m._.js +0 -3
  412. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0c_3x8u._.js +0 -3
  413. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ty7ew1._.js +0 -3
  414. package/runtime/vercel/linear-shim +0 -181
  415. package/runtime/vercel/ntn-shim +0 -95
  416. /package/dist/{_cloud-attach-Y5HIQ373.js.map → _cloud-attach-HKRHYCY7.js.map} +0 -0
  417. /package/dist/{chunk-4PR3KJ5X.js.map → chunk-6PIGTR4D.js.map} +0 -0
  418. /package/dist/{chunk-BUMKBUXS.js.map → chunk-7QU6XENE.js.map} +0 -0
  419. /package/dist/{chunk-7ABO7OIF.js.map → chunk-CO2I3CQI.js.map} +0 -0
  420. /package/dist/{chunk-HYXCH4GA.js.map → chunk-EFVTQ7YB.js.map} +0 -0
  421. /package/dist/{chunk-EVT2SNF2.js.map → chunk-HO2ACZES.js.map} +0 -0
  422. /package/dist/{chunk-V5NWSLWD.js.map → chunk-HP4L45LW.js.map} +0 -0
  423. /package/dist/{chunk-B4DAH2F2.js.map → chunk-LHOKRCNF.js.map} +0 -0
  424. /package/dist/{chunk-BWM56FKY.js.map → chunk-RQURMAPA.js.map} +0 -0
  425. /package/dist/{chunk-FPMRFMVK.js.map → chunk-RZCLRWNY.js.map} +0 -0
  426. /package/dist/{chunk-FGQFVUMH.js.map → chunk-VY54AX4T.js.map} +0 -0
  427. /package/dist/{cloud-poller-SUNA6ZQC-7M5LJHHE.js.map → cloud-poller-QJRZXB4W-LJ2BRB3L.js.map} +0 -0
  428. /package/dist/{control-plane-5R7PYRQ6.js.map → control-plane-UKKYXHIQ.js.map} +0 -0
  429. /package/dist/{custody-client-PNCC2HBJ.js.map → custody-client-NPXJ46TB.js.map} +0 -0
  430. /package/dist/{deploy-hetzner-SSGSXAKA.js.map → deploy-hetzner-Y3ILCDRF.js.map} +0 -0
  431. /package/dist/{dist-5OR4QTQW.js.map → dist-5OGQ3CJQ.js.map} +0 -0
  432. /package/dist/{dist-EPFS5PRI.js.map → dist-7B3VCLZI.js.map} +0 -0
  433. /package/dist/{dist-K5M4HKG7.js.map → dist-A5ZEIVAW.js.map} +0 -0
  434. /package/dist/{dist-M4O5MU5K.js.map → dist-FBM2WS5S.js.map} +0 -0
  435. /package/dist/{dist-POILUDVJ.js.map → dist-MUTFY7FA.js.map} +0 -0
  436. /package/dist/{dist-RN6JOAG4.js.map → dist-SMDXLPZO.js.map} +0 -0
  437. /package/dist/{dist-SN2TCRZ5.js.map → dist-VTLQKZ2E.js.map} +0 -0
  438. /package/dist/{dist-XATN4ZIR.js.map → dist-ZJIJHCZB.js.map} +0 -0
  439. /package/dist/{dist-ZNQZHTUN.js.map → dist-ZNYS7CVF.js.map} +0 -0
  440. /package/dist/{hub-MJ7O4WXW.js.map → host-reach-drainer-ZJU2STQQ.js.map} +0 -0
  441. /package/dist/{hub-adopt-I44VGSBL.js.map → hub-Q4VOF4WN.js.map} +0 -0
  442. /package/dist/{hub-api-client-WJPBXZAZ.js.map → hub-adopt-OA336ZXZ.js.map} +0 -0
  443. /package/dist/{prepare-V4U5HVJU.js.map → hub-api-client-5U6WOTZ3.js.map} +0 -0
  444. /package/dist/{hub-docker-target-REEEWUG2.js.map → hub-docker-target-JKFCABK4.js.map} +0 -0
  445. /package/dist/{prepared-custody-QIXW7MJM.js.map → prepare-GFWWKWGF.js.map} +0 -0
  446. /package/dist/{prepared-state-PV3GUBHO-MF56HWMZ.js.map → prepared-custody-KU4PDVBT.js.map} +0 -0
  447. /package/dist/{relay-DRDELF6B.js.map → prepared-state-LNQ7DYSU-AR5RMXAO.js.map} +0 -0
  448. /package/dist/{publish-credentials-BPHUO5VL.js.map → publish-credentials-3SQXX45P.js.map} +0 -0
  449. /package/dist/{remote-docker-share-RX5ARK45.js.map → registry-AFKV3EO2.js.map} +0 -0
  450. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → XIx10ozuCZRzwSsiCF_5t}/_buildManifest.js +0 -0
  451. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → XIx10ozuCZRzwSsiCF_5t}/_clientMiddlewareManifest.js +0 -0
  452. /package/runtime/hub/apps/hub/.next/static/{z7_2bKU93xE7GwllL1Duv → XIx10ozuCZRzwSsiCF_5t}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77084,e=>{"use strict";let t,n;var r,i=e.i(1262),o=e.i(45971),l=e.i(33789),a=e.i(44344),s=e.i(86892),c=e.i(65232);function u({className:e,icon:t,title:n,children:r}){return(0,i.jsxs)("div",{className:(0,c.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",e),children:[t?(0,i.jsx)(t,{className:"mt-0.5 size-4 flex-none"}):null,(0,i.jsxs)("div",{className:"min-w-0",children:[n?(0,i.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:n}):null,(0,i.jsx)("div",{className:"text-[12.5px] leading-normal",children:r})]})]})}var d=e.i(8536),f=e.i(96621),p=e.i(88451);function m({boxId:e}){let{state:t}=(0,f.useStore)(),n=t.approvals.filter(t=>t.boxId===e).sort((e,t)=>e.createdAt-t.createdAt);return 0===n.length?null:(0,i.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,i.jsx)(a.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,i.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[n.length," pending approval",1===n.length?"":"s"]}),(0,i.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,i.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:n.map(e=>(0,i.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:e.command??e.message}),e.detail?(0,i.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:e.detail}):null,e.cwd?(0,i.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:e.cwd}):null,(0,i.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,i.jsx)(l.Ago,{ms:e.createdAt})})]}),(0,i.jsx)("div",{className:"flex-none pt-0.5",children:(0,i.jsx)(p.ApprovalActions,{id:e.id})})]},e.id))})]})}var x=e.i(54129),h=e.i(69377);function v(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)}}function g(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function b(...e){return x.useCallback(function(...e){return t=>{let n=!1,r=e.map(e=>{let r=g(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():g(e[t],null)}}}}(...e),e)}function y(e,t=[]){let n=[],r=()=>{let t=n.map(e=>x.createContext(e));return function(n){let r=n?.[e]||t;return x.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let o=x.createContext(r);o.displayName=t+"Context";let l=n.length;n=[...n,r];let a=t=>{let{scope:n,children:r,...a}=t,s=n?.[e]?.[l]||o,c=x.useMemo(()=>a,Object.values(a));return(0,i.jsx)(s.Provider,{value:c,children:r})};return a.displayName=t+"Provider",[a,function(n,i,a={}){let{optional:s=!1}=a,c=i?.[e]?.[l]||o,u=x.useContext(c);if(u)return u;if(void 0!==r)return r;if(!s)throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}"u">typeof window&&window.document&&window.document.createElement;var w=e.i(94766),j=Symbol.for("radix.slottable"),N=Symbol.for("react.lazy");function C(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===N&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var S=x[" use ".trim().toString()],E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var n;let r,o=(n=`Primitive.${t}`,(r=x.forwardRef((e,t)=>{var r;let i,o,{children:l,...a}=e,s=null,c=!1,u=[];C(l)&&"function"==typeof S&&(l=S(l._payload)),x.Children.forEach(l,e=>{var t;if(t=e,x.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===j){c=!0;let t="child"in e.props?e.props.child:e.props.children;C(t)&&"function"==typeof S&&(t=S(t._payload)),s=((e,t)=>{if("child"in e.props){let t=e.props.child;return x.isValidElement(t)?x.cloneElement(t,void 0,e.props.children(t.props.children)):null}return x.isValidElement(t)?t:null})(e,t),u.push(s?.props?.children)}else u.push(e)}),s?s=x.cloneElement(s,void 0,u):!c&&1===x.Children.count(l)&&x.isValidElement(l)&&(s=l);let d=s?(r=s,(o=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(o=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,f=b(t,d);if(!s){if(l||0===l){let e,t;throw Error(c?(e=n,`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(t=n,`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return l}let p=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(a,s.props??{});return s.type!==x.Fragment&&(p.ref=t?f:d),x.cloneElement(s,p)})).displayName=`${n}.Slot`,r),l=x.forwardRef((e,n)=>{let{asChild:r,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(r?o:t,{...l,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function R(e){let t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...e)=>t.current?.(...e),[])}var k="dismissableLayer.update",T=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),L=x.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:u,...d}=e,f=x.useContext(T),[p,m]=x.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=x.useState({}),y=b(t,m),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=j?w.indexOf(j):-1,C=p?w.indexOf(p):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,L=C>=N,D=x.useRef(!1),I=function(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:l=A}=t,a=R(e),s=x.useRef(!1),c=x.useRef(!1),u=x.useRef(new Map),d=x.useRef(()=>{});return x.useEffect(()=>{function e(){c.current=!1,i.current=!1,u.current.clear()}function t(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function f(e){c.current&&u.current.set(e.type,!1)}let p=t=>{if(t.target&&!s.current){let o=function(){n.removeEventListener("click",d.current);let t=Array.from(u.current.values()).some(Boolean);e(),t||P("dismissableLayer.pointerDownOutside",a,f,{discrete:!0})};if(!l(t.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let f={originalEvent:t};c.current=!0,i.current=r&&0===t.button,u.current.clear(),r&&0===t.button?(n.removeEventListener("click",d.current),d.current=o,n.addEventListener("click",d.current,{once:!0})):o()}else n.removeEventListener("click",d.current),e();s.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)n.addEventListener(e,t,!0),n.addEventListener(e,f);let x=window.setTimeout(()=>{n.addEventListener("pointerdown",p)},0);return()=>{for(let e of(window.clearTimeout(x),n.removeEventListener("pointerdown",p),n.removeEventListener("click",d.current),m))n.removeEventListener(e,t,!0),n.removeEventListener(e,f)}},[n,a,r,i,o,l]),{onPointerDownCapture:()=>s.current=!0}}(e=>{a?.(e),c?.(e),e.defaultPrevented||u?.()},{ownerDocument:h,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:D,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...f.branches].some(t=>t.contains(e));return L&&!t},[f.branches,L])}),B=function(e,t=globalThis?.document){let n=R(e),r=x.useRef(!1);return x.useEffect(()=>{let e=e=>{e.target&&!r.current&&P("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(o&&D.current)return;let t=e.target;![...f.branches].some(e=>e.contains(t))&&(s?.(e),c?.(e),e.defaultPrevented||u?.())},h),$=!!p&&C===w.length-1,M=R(e=>{"Escape"===e.key&&(l?.(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))});return x.useEffect(()=>{if($)return h.addEventListener("keydown",M,{capture:!0}),()=>h.removeEventListener("keydown",M,{capture:!0})},[h,$,M]),x.useEffect(()=>{if(p)return n&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(r=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),O(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(p),0===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=r))}},[p,h,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),O())},[p,f]),x.useEffect(()=>{let e=()=>g({});return document.addEventListener(k,e),()=>document.removeEventListener(k,e)},[]),(0,i.jsx)(E.div,{...d,ref:y,style:{pointerEvents:S?L?"auto":"none":void 0,...e.style},onFocusCapture:v(e.onFocusCapture,B.onFocusCapture),onBlurCapture:v(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:v(e.onPointerDownCapture,I.onPointerDownCapture)})});L.displayName="DismissableLayer",x.forwardRef((e,t)=>{let n=x.useContext(T),r=x.useRef(null),o=b(t,r);return x.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,i.jsx)(E.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var A=()=>!0;function O(){let e=new CustomEvent(k);document.dispatchEvent(e)}function P(e,t,n,{discrete:r}){let i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&i.addEventListener(e,t,{once:!0}),r)i&&w.flushSync(()=>i.dispatchEvent(o));else i.dispatchEvent(o)}var D=globalThis?.document?x.useLayoutEffect:()=>{},I=x[" useId ".trim().toString()]||(()=>void 0),B=0;let $=["top","right","bottom","left"],M=Math.min,_=Math.max,F=Math.round,z=Math.floor,H=e=>({x:e,y:e}),W={left:"right",right:"left",bottom:"top",top:"bottom"};function U(e,t){return"function"==typeof e?e(t):e}function V(e){return e.split("-")[0]}function Y(e){return e.split("-")[1]}function X(e){return"x"===e?"y":"x"}function K(e){return"y"===e?"height":"width"}function q(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function G(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let J=["left","right"],Z=["right","left"],Q=["top","bottom"],ee=["bottom","top"];function et(e){let t=V(e);return W[t]+e.slice(t.length)}function en(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function er(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ei(e,t,n){let r,{reference:i,floating:o}=e,l=q(t),a=X(q(t)),s=K(a),c=V(t),u="y"===l,d=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,p=i[s]/2-o[s]/2;switch(c){case"top":r={x:d,y:i.y-o.height};break;case"bottom":r={x:d,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:f};break;case"left":r={x:i.x-o.width,y:f};break;default:r={x:i.x,y:i.y}}switch(Y(t)){case"start":r[a]-=p*(n&&u?-1:1);break;case"end":r[a]+=p*(n&&u?-1:1)}return r}async function eo(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:o,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=U(t,e),m=en(p),x=a[f?"floating"===d?"reference":"floating":d],h=er(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(x)))||n?x:x.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===d?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,g=await (null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),b=await (null==o.isElement?void 0:o.isElement(g))&&await (null==o.getScale?void 0:o.getScale(g))||{x:1,y:1},y=er(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:g,strategy:s}):v);return{top:(h.top-y.top+m.top)/b.y,bottom:(y.bottom-h.bottom+m.bottom)/b.y,left:(h.left-y.left+m.left)/b.x,right:(y.right-h.right+m.right)/b.x}}let el=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:eo},s=await (null==l.isRTL?void 0:l.isRTL(t)),c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ei(c,r,s),f=r,p=0,m={};for(let n=0;n<o.length;n++){let x=o[n];if(!x)continue;let{name:h,fn:v}=x,{x:g,y:b,data:y,reset:w}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=b?b:d,m[h]={...m[h],...y},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:u,y:d}=ei(c,f,s)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}};function ea(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function es(e){return $.some(t=>e[t]>=0)}let ec=new Set(["left","top"]);async function eu(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),l=V(n),a=Y(n),s="y"===q(n),c=ec.has(l)?-1:1,u=o&&s?-1:1,d=U(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function ed(){return"u">typeof window}function ef(e){return ex(e)?(e.nodeName||"").toLowerCase():"#document"}function ep(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function em(e){var t;return null==(t=(ex(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ex(e){return!!ed()&&(e instanceof Node||e instanceof ep(e).Node)}function eh(e){return!!ed()&&(e instanceof Element||e instanceof ep(e).Element)}function ev(e){return!!ed()&&(e instanceof HTMLElement||e instanceof ep(e).HTMLElement)}function eg(e){return!(!ed()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ep(e).ShadowRoot)}function eb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=eR(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function ey(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let ew=/transform|translate|scale|rotate|perspective|filter/,ej=/paint|layout|strict|content/,eN=e=>!!e&&"none"!==e;function eC(e){let t=eh(e)?eR(e):e;return eN(t.transform)||eN(t.translate)||eN(t.scale)||eN(t.rotate)||eN(t.perspective)||!eS()&&(eN(t.backdropFilter)||eN(t.filter))||ew.test(t.willChange||"")||ej.test(t.contain||"")}function eS(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function eE(e){return/^(html|body|#document)$/.test(ef(e))}function eR(e){return ep(e).getComputedStyle(e)}function ek(e){return eh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eT(e){if("html"===ef(e))return e;let t=e.assignedSlot||e.parentNode||eg(e)&&e.host||em(e);return eg(t)?t.host:t}function eL(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=eT(t);return eE(n)?t.ownerDocument?t.ownerDocument.body:t.body:ev(n)&&eb(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),l=ep(i);if(!o)return t.concat(i,eL(i,[],n));{let e=eA(l);return t.concat(l,l.visualViewport||[],eb(i)?i:[],e&&n?eL(e):[])}}function eA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eO(e){let t=eR(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ev(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=F(n)!==o||F(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function eP(e){return eh(e)?e:e.contextElement}function eD(e){let t=eP(e);if(!ev(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=eO(t),l=(o?F(n.width):n.width)/r,a=(o?F(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let eI=H(0);function eB(e){let t=ep(e);return eS()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eI}function e$(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),l=eP(e),a=H(1);t&&(r?eh(r)&&(a=eD(r)):a=eD(e));let s=(void 0===(i=n)&&(i=!1),r&&(!i||r===ep(l))&&i)?eB(l):H(0),c=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(l){let e=ep(l),t=r&&eh(r)?ep(r):r,n=e,i=eA(n);for(;i&&r&&t!==n;){let e=eD(i),t=i.getBoundingClientRect(),r=eR(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=o,u+=l,i=eA(n=ep(i))}}return er({width:d,height:f,x:c,y:u})}function eM(e,t){let n=ek(e).scrollLeft;return t?t.left+n:e$(em(e)).left+n}function e_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eM(e,n),y:n.top+t.scrollTop}}function eF(e,t,n){var r;let i;if("viewport"===t)i=function(e,t){let n=ep(e),r=em(e),i=n.visualViewport,o=r.clientWidth,l=r.clientHeight,a=0,s=0;if(i){o=i.width,l=i.height;let e=eS();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,s=i.offsetTop)}let c=eM(r);if(c<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-i);l<=25&&(o-=l)}else c<=25&&(o+=c);return{width:o,height:l,x:a,y:s}}(e,n);else if("document"===t){let t,n,o,l,a,s,c;r=em(e),t=em(r),n=ek(r),o=r.ownerDocument.body,l=_(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=_(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+eM(r),c=-n.scrollTop,"rtl"===eR(o).direction&&(s+=_(t.clientWidth,o.clientWidth)-l),i={width:l,height:a,x:s,y:c}}else if(eh(t)){let e,r,o,l,a,s;r=(e=e$(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,l=ev(t)?eD(t):H(1),a=t.clientWidth*l.x,s=t.clientHeight*l.y,i={width:a,height:s,x:o*l.x,y:r*l.y}}else{let n=eB(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return er(i)}function ez(e){return"static"===eR(e).position}function eH(e,t){if(!ev(e)||"fixed"===eR(e).position)return null;if(t)return t(e);let n=e.offsetParent;return em(e)===n&&(n=n.ownerDocument.body),n}function eW(e,t){var n;let r=ep(e);if(ey(e))return r;if(!ev(e)){let t=eT(e);for(;t&&!eE(t);){if(eh(t)&&!ez(t))return t;t=eT(t)}return r}let i=eH(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(ef(n)))&&ez(i);)i=eH(i,t);return i&&eE(i)&&ez(i)&&!eC(i)?r:i||function(e){let t=eT(e);for(;ev(t)&&!eE(t);){if(eC(t))return t;if(ey(t))break;t=eT(t)}return null}(e)||r}let eU=async function(e){let t=this.getOffsetParent||eW,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=ev(t),i=em(t),o="fixed"===n,l=e$(e,!0,o,t),a={scrollLeft:0,scrollTop:0},s=H(0);if(r||!r&&!o)if(("body"!==ef(t)||eb(i))&&(a=ek(t)),r){let e=e$(t,!0,o,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=eM(i));o&&!r&&i&&(s.x=eM(i));let c=!i||r||o?H(0):e_(i,a);return{x:l.left+a.scrollLeft-s.x-c.x,y:l.top+a.scrollTop-s.y-c.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},eV={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,l=em(r),a=!!t&&ey(t.floating);if(r===l||a&&o)return n;let s={scrollLeft:0,scrollTop:0},c=H(1),u=H(0),d=ev(r);if((d||!d&&!o)&&(("body"!==ef(r)||eb(l))&&(s=ek(r)),d)){let e=e$(r);c=eD(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!l||d||o?H(0):e_(l,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-s.scrollTop*c.y+u.y+f.y}},getDocumentElement:em,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?ey(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=eL(e,[],!1).filter(e=>eh(e)&&"body"!==ef(e)),i=null,o="fixed"===eR(e).position,l=o?eT(e):e;for(;eh(l)&&!eE(l);){let t=eR(l),n=eC(l);n||"fixed"!==t.position||(i=null),(o?n||i:!(!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||eb(l)&&!n&&function e(t,n){let r=eT(t);return!(r===n||!eh(r)||eE(r))&&("fixed"===eR(r).position||e(r,n))}(e,l)))?i=t:r=r.filter(e=>e!==l),l=eT(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=eF(t,o[0],i),a=l.top,s=l.right,c=l.bottom,u=l.left;for(let e=1;e<o.length;e++){let n=eF(t,o[e],i);a=_(n.top,a),s=M(n.right,s),c=M(n.bottom,c),u=_(n.left,u)}return{width:s-u,height:c-a,x:u,y:a}},getOffsetParent:eW,getElementRects:eU,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=eO(e);return{width:t,height:n}},getScale:eD,isElement:eh,isRTL:function(e){return"rtl"===eR(e).direction}};function eY(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let eX=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:i,rects:o,platform:l,elements:a,middlewareData:s}=t,{element:c,padding:u=0}=U(e,t)||{};if(null==c)return{};let d=en(u),f={x:n,y:r},p=X(q(i)),m=K(p),x=await l.getDimensions(c),h="y"===p,v=h?"clientHeight":"clientWidth",g=o.reference[m]+o.reference[p]-f[p]-o.floating[m],b=f[p]-o.reference[p],y=await (null==l.getOffsetParent?void 0:l.getOffsetParent(c)),w=y?y[v]:0;w&&await (null==l.isElement?void 0:l.isElement(y))||(w=a.floating[v]||o.floating[m]);let j=w/2-x[m]/2-1,N=M(d[h?"top":"left"],j),C=M(d[h?"bottom":"right"],j),S=w-x[m]-C,E=w/2-x[m]/2+(g/2-b/2),R=_(N,M(E,S)),k=!s.arrow&&null!=Y(i)&&E!==R&&o.reference[m]/2-(E<N?N:C)-x[m]/2<0,T=k?E<N?E-N:E-S:0;return{[p]:f[p]+T,data:{[p]:R,centerOffset:E-R-T,...k&&{alignmentOffset:T}},reset:k}}});var eK="u">typeof document?x.useLayoutEffect:function(){};function eq(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!eq(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!eq(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function eG(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eJ(e,t){let n=eG(e);return Math.round(t*n)/n}function eZ(e){let t=x.useRef(e);return eK(()=>{t.current=e}),t}var eQ=x.forwardRef((e,t)=>{let{children:n,width:r=10,height:o=5,...l}=e;return(0,i.jsx)(E.svg,{...l,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,i.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eQ.displayName="Arrow";var e0="Popper",[e1,e5]=y(e0),[e2,e3]=e1(e0),e4=e=>{let{__scopePopper:t,children:n}=e,[r,o]=x.useState(null),[l,a]=x.useState(void 0);return(0,i.jsx)(e2,{scope:t,anchor:r,onAnchorChange:o,placementState:l,setPlacementState:a,children:n})};e4.displayName=e0;var e6="PopperAnchor",e8=x.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,l=e3(e6,n),a=x.useRef(null),s=l.onAnchorChange,c=b(t,x.useCallback(e=>{a.current=e,e&&s(e)},[s])),u=x.useRef(null);x.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=l.placementState&&ta(l.placementState),f=d?.[0],p=d?.[1];return r?null:(0,i.jsx)(E.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...o,ref:c})});e8.displayName=e6;var e9="PopperContent",[e7,te]=e1(e9),tt=x.forwardRef((e,t)=>{var n,r,o,l,a,s,c,u,d,f,p,m,h;let v,g,y,j,N,C,{__scopePopper:S,side:k="bottom",sideOffset:T=0,align:L="center",alignOffset:A=0,arrowPadding:O=0,avoidCollisions:P=!0,collisionBoundary:I=[],collisionPadding:B=0,sticky:$="partial",hideWhenDetached:F=!1,updatePositionStrategy:H="optimized",onPlaced:W,...en}=e,er=e3(e9,S),[ei,eo]=x.useState(null),ed=b(t,eo),[ef,ep]=x.useState(null),ex=function(e){let[t,n]=x.useState(void 0);return D(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(ef),eh=ex?.width??0,ev=ex?.height??0,eg="number"==typeof B?B:{top:0,right:0,bottom:0,left:0,...B},eb=Array.isArray(I)?I:[I],ey=eb.length>0,ew={padding:eg,boundary:eb.filter(to),altBoundary:ey},{refs:ej,floatingStyles:eN,placement:eC,isPositioned:eS,middlewareData:eE}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:a=!0,whileElementsMounted:s,open:c}=e,[u,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(r);eq(f,r)||p(r);let[m,h]=x.useState(null),[v,g]=x.useState(null),b=x.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=x.useCallback(e=>{e!==S.current&&(S.current=e,g(e))},[]),j=o||m,N=l||v,C=x.useRef(null),S=x.useRef(null),E=x.useRef(u),R=null!=s,k=eZ(s),T=eZ(i),L=eZ(c),A=x.useCallback(()=>{var e,r;let i,o,l;if(!C.current||!S.current)return;let a={placement:t,strategy:n,middleware:f};T.current&&(a.platform=T.current),(e=C.current,r=S.current,i=new Map,l={...(o={platform:eV,...a}).platform,_c:i},el(e,r,{...o,platform:l})).then(e=>{let t={...e,isPositioned:!1!==L.current};O.current&&!eq(E.current,t)&&(E.current=t,w.flushSync(()=>{d(t)}))})},[f,t,n,T,L]);eK(()=>{!1===c&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let O=x.useRef(!1);eK(()=>(O.current=!0,()=>{O.current=!1}),[]),eK(()=>{if(j&&(C.current=j),N&&(S.current=N),j&&N){if(k.current)return k.current(j,N,A);A()}},[j,N,A,k,R]);let P=x.useMemo(()=>({reference:C,floating:S,setReference:b,setFloating:y}),[b,y]),D=x.useMemo(()=>({reference:j,floating:N}),[j,N]),I=x.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=eJ(D.floating,u.x),r=eJ(D.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...eG(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,D.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:A,refs:P,elements:D,floatingStyles:I}),[u,A,P,D,I])}({strategy:"fixed",placement:k+("center"!==L?"-"+L:""),whileElementsMounted:(...e)=>(function(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,u=eP(e),d=o||l?[...u?eL(u):[],...t?eL(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});let f=u&&s?function(e,t){let n,r=null,i=em(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),o();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(a||t(),!f||!p)return;let m={rootMargin:-z(d)+"px "+-z(i.clientWidth-(u+f))+"px "+-z(i.clientHeight-(d+p))+"px "+-z(u)+"px",threshold:_(0,M(1,s))||1},x=!0;function h(t){let r=t[0].intersectionRatio;if(r!==s){if(!x)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||eY(c,e.getBoundingClientRect())||l(),x=!1}try{r=new IntersectionObserver(h,{...m,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),o}(u,n):null,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let x=c?e$(e):null;return c&&function t(){let r=e$(e);x&&!eY(x,r)&&n(),x=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(i)}})(...e,{animationFrame:"always"===H}),elements:{reference:er.anchor},middleware:[{name:(v={name:"offset",options:r=n={mainAxis:T+ev,alignmentAxis:A},async fn(e){var t,n;let{x:i,y:o,placement:l,middlewareData:a}=e,s=await eu(e,r);return l===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+s.x,y:o+s.y,data:{...s,placement:l}}}}).name,fn:v.fn,options:[n,void 0]},P&&{name:(g={name:"shift",options:a=l={mainAxis:!0,crossAxis:!1,limiter:"partial"===$?{fn:(o=void 0,{options:o={},fn(e){let{x:t,y:n,placement:r,rects:i,middlewareData:l}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=U(o,e),u={x:t,y:n},d=q(r),f=X(d),p=u[f],m=u[d],x=U(a,e),h="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(s){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+h.mainAxis,n=i.reference[f]+i.reference[e]-h.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var v,g;let e="y"===f?"width":"height",t=ec.has(V(r)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=l.offset)?void 0:v[d])||0)+(t?0:h.crossAxis),o=i.reference[d]+i.reference[e]+(t?0:(null==(g=l.offset)?void 0:g[d])||0)-(t?h.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[f]:p,[d]:m}}}).fn,options:[void 0,void 0]}:void 0,...ew},async fn(e){let{x:t,y:n,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=U(a,e),u={x:t,y:n},d=await i.detectOverflow(e,c),f=q(V(r)),p=X(f),m=u[p],x=u[f];if(o){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=m+d[e],r=m-d[t];m=_(n,M(m,r))}if(l){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",n=x+d[e],r=x-d[t];x=_(n,M(x,r))}let h=s.fn({...e,[p]:m,[f]:x});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[p]:o,[f]:l}}}}}).name,fn:g.fn,options:[l,void 0]},P&&{name:(y={name:"flip",options:c=s={...ew},async fn(e){var t,n,r,i,o,l,a,s;let u,d,f,{placement:p,middlewareData:m,rects:x,initialPlacement:h,platform:v,elements:g}=e,{mainAxis:b=!0,crossAxis:y=!0,fallbackPlacements:w,fallbackStrategy:j="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:C=!0,...S}=U(c,e);if(null!=(t=m.arrow)&&t.alignmentOffset)return{};let E=V(p),R=q(h),k=V(h)===h,T=await (null==v.isRTL?void 0:v.isRTL(g.floating)),L=w||(k||!C?[et(h)]:(u=et(h),[G(h),u,G(u)])),A="none"!==N;!w&&A&&L.push(...(d=Y(h),f=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?Z:J;return t?J:Z;case"left":case"right":return t?Q:ee;default:return[]}}(V(h),"start"===N,T),d&&(f=f.map(e=>e+"-"+d),C&&(f=f.concat(f.map(G)))),f));let O=[h,...L],P=await v.detectOverflow(e,S),D=[],I=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&D.push(P[E]),y){let e,t,n,r,i=(l=p,a=x,void 0===(s=T)&&(s=!1),e=Y(l),n=K(t=X(q(l))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[n]>a.floating[n]&&(r=et(r)),[r,et(r)]);D.push(P[i[0]],P[i[1]])}if(I=[...I,{placement:p,overflows:D}],!D.every(e=>e<=0)){let e=((null==(r=m.flip)?void 0:r.index)||0)+1,t=O[e];if(t&&("alignment"!==y||R===q(t)||I.every(e=>q(e.placement)!==R||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(i=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(j){case"bestFit":{let e=null==(o=I.filter(e=>{if(A){let t=q(e.placement);return t===R||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=h}if(p!==n)return{reset:{placement:n}}}return{}}}).name,fn:y.fn,options:[s,void 0]},{name:(j={name:"size",options:d=u={...ew,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:o}=t.reference,l=e.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${i}px`),l.setProperty("--radix-popper-anchor-height",`${o}px`)}},async fn(e){var t,n;let r,i,{placement:o,rects:l,platform:a,elements:s}=e,{apply:c=()=>{},...u}=U(d,e),f=await a.detectOverflow(e,u),p=V(o),m=Y(o),x="y"===q(o),{width:h,height:v}=l.floating;"top"===p||"bottom"===p?(r=p,i=m===(await (null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,r="end"===m?"top":"bottom");let g=v-f.top-f.bottom,b=h-f.left-f.right,y=M(v-f[r],g),w=M(h-f[i],b),j=!e.middlewareData.shift,N=y,C=w;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(C=b),null!=(n=e.middlewareData.shift)&&n.enabled.y&&(N=g),j&&!m){let e=_(f.left,0),t=_(f.right,0),n=_(f.top,0),r=_(f.bottom,0);x?C=h-2*(0!==e||0!==t?e+t:_(f.left,f.right)):N=v-2*(0!==n||0!==r?n+r:_(f.top,f.bottom))}await c({...e,availableWidth:C,availableHeight:N});let S=await a.getDimensions(s.floating);return h!==S.width||v!==S.height?{reset:{rects:!0}}:{}}}).name,fn:j.fn,options:[u,void 0]},ef&&{name:(N={name:"arrow",options:p=f={element:ef,padding:O},fn(e){let{element:t,padding:n}="function"==typeof p?p(e):p;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?eX({element:t.current,padding:n}).fn(e):{}:t?eX({element:t,padding:n}).fn(e):{}}}).name,fn:N.fn,options:[f,void 0]},tl({arrowWidth:eh,arrowHeight:ev}),F&&{name:(C={name:"hide",options:h=m={strategy:"referenceHidden",...ew,boundary:ey?ew.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...i}=U(h,e);switch(r){case"referenceHidden":{let r=ea(await n.detectOverflow(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:es(r)}}}case"escaped":{let r=ea(await n.detectOverflow(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:es(r)}}}default:return{}}}}).name,fn:C.fn,options:[m,void 0]}]}),eR=er.setPlacementState;D(()=>(eR(eC),()=>{eR(void 0)}),[eC,eR]);let[ek,eT]=ta(eC),eA=R(W);D(()=>{eS&&eA?.()},[eS,eA]);let eO=eE.arrow?.x,eD=eE.arrow?.y,eI=eE.arrow?.centerOffset!==0,[eB,eM]=x.useState();return D(()=>{ei&&eM(window.getComputedStyle(ei).zIndex)},[ei]),(0,i.jsx)("div",{ref:ej.setFloating,"data-radix-popper-content-wrapper":"",style:{...eN,transform:eS?eN.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eB,"--radix-popper-transform-origin":[eE.transformOrigin?.x,eE.transformOrigin?.y].join(" "),...eE.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,i.jsx)(e7,{scope:S,placedSide:ek,placedAlign:eT,onArrowChange:ep,arrowX:eO,arrowY:eD,shouldHideArrow:eI,children:(0,i.jsx)(E.div,{"data-side":ek,"data-align":eT,...en,ref:ed,style:{...en.style,animation:eS?void 0:"none"}})})})});tt.displayName=e9;var tn="PopperArrow",tr={top:"bottom",right:"left",bottom:"top",left:"right"},ti=x.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,o=te(tn,n),l=tr[o.placedSide];return(0,i.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,i.jsx)(eQ,{...r,ref:t,style:{...r.style,display:"block"}})})});function to(e){return null!==e}ti.displayName=tn;var tl=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,l=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[s,c]=ta(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(i.arrow?.x??0)+l/2,f=(i.arrow?.y??0)+a/2,p="",m="";return"bottom"===s?(p=o?u:`${d}px`,m=`${-a}px`):"top"===s?(p=o?u:`${d}px`,m=`${r.floating.height+a}px`):"right"===s?(p=`${-a}px`,m=o?u:`${f}px`):"left"===s&&(p=`${r.floating.width+a}px`,m=o?u:`${f}px`),{data:{x:p,y:m}}}});function ta(e){let[t,n="center"]=e.split("-");return[t,n]}var ts=x.forwardRef((e,t)=>{let{container:n,...r}=e,[o,l]=x.useState(!1);D(()=>l(!0),[]);let a=n||o&&globalThis?.document?.body;return a?w.createPortal((0,i.jsx)(E.div,{...r,ref:t}),a):null});ts.displayName="Portal";var tc=e=>{var t;let n,r,{present:i,children:o}=e,l=function(e){var t,n;let[r,i]=x.useState(),o=x.useRef(null),l=x.useRef(e),a=x.useRef("none"),s=x.useRef(void 0),[c,u]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},x.useReducer((e,t)=>n[e][t]??e,t));return x.useEffect(()=>{"mounted"===c?(a.current=s.current??td(o.current),s.current=void 0):a.current="none"},[c]),D(()=>{let t=o.current,n=l.current;if(n!==e){let r=a.current,i=td(t);e?(s.current=i,u("MOUNT")):"none"===i||t?.display==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),l.current=e}},[e,u]),D(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=td(o.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(u("ANIMATION_END"),!l.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},i=e=>{e.target===r&&(a.current=td(o.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(e=>{if(e){let t=getComputedStyle(e);o.current=t,s.current=td(t)}else o.current=null;i(e)},[])}}(i),a="function"==typeof o?o({present:l.isPresent}):x.Children.only(o),s=function(...e){let t=x.useRef(e);return t.current=e,x.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=tu(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():tu(n[e],null)}}},[])}(l.ref,(t=a,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||l.isPresent?x.cloneElement(a,{ref:s}):null};function tu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function td(e){return e?.animationName||"none"}tc.displayName="Presence",x[" useEffectEvent ".trim().toString()],x[" useInsertionEffect ".trim().toString()];var tf=x[" useInsertionEffect ".trim().toString()]||D;Symbol("RADIX:SYNC_STATE");var tp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),tm=x.forwardRef((e,t)=>(0,i.jsx)(E.span,{...e,ref:t,style:{...tp,...e.style}}));tm.displayName="VisuallyHidden";var[tx,th]=y("Tooltip",[e5]),tv=e5(),tg="TooltipProvider",tb="tooltip.open",[ty,tw]=tx(tg),tj=e=>{let{__scopeTooltip:t,delayDuration:n=700,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:l}=e,a=x.useRef(!0),s=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,i.jsx)(ty,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:x.useCallback(e=>{s.current=e},[]),disableHoverableContent:o,children:l})};tj.displayName=tg;var tN="Tooltip",[tC,tS]=tx(tN),tE=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:l,disableHoverableContent:a,delayDuration:s}=e,c=tw(tN,e.__scopeTooltip),u=tv(t),[d,f]=x.useState(null),p=function(){let[e,t]=x.useState(I());return D(()=>{t(e=>e??String(B++))},[void 0]),e?`radix-${e}`:""}(),m=x.useRef(0),h=a??c.disableHoverableContent,v=s??c.delayDuration,g=x.useRef(!1),[b,y]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,l]=function({defaultProp:e,onChange:t}){let[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return tf(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}({defaultProp:t,onChange:n}),a=void 0!==e,s=a?e:i;{let t=x.useRef(void 0!==e);x.useEffect(()=>{let e=t.current;if(e!==a){let t=a?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=a},[a,r])}return[s,x.useCallback(t=>{if(a){let n="function"==typeof t?t(e):t;n!==e&&l.current?.(n)}else o(t)},[a,e,o,l])]}({prop:r,defaultProp:o??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(tb))):c.onClose(),l?.(e)},caller:tN}),w=x.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),j=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,y(!0)},[y]),N=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,y(!0),m.current=0},v)},[v,y]);return x.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),(0,i.jsx)(e4,{...u,children:(0,i.jsx)(tC,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?C():j()},[c.isOpenDelayedRef,C,j]),onTriggerLeave:x.useCallback(()=>{h?N():(window.clearTimeout(m.current),m.current=0)},[N,h]),onOpen:j,onClose:N,disableHoverableContent:h,children:n})})};tE.displayName=tN;var tR="TooltipTrigger",tk=x.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=tS(tR,n),l=tw(tR,n),a=tv(n),s=b(t,x.useRef(null),o.onTriggerChange),c=x.useRef(!1),u=x.useRef(!1),d=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,i.jsx)(e8,{asChild:!0,...a,children:(0,i.jsx)(E.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:s,onPointerMove:v(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||l.isPointerInTransitRef.current||(o.onTriggerEnter(),u.current=!0))}),onPointerLeave:v(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:v(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:v(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:v(e.onBlur,o.onClose),onClick:v(e.onClick,o.onClose)})})});tk.displayName=tR;var tT="TooltipPortal",[tL,tA]=tx(tT,{forceMount:void 0}),tO=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,l=tS(tT,t);return(0,i.jsx)(tL,{scope:t,forceMount:n,children:(0,i.jsx)(tc,{present:n||l.open,children:(0,i.jsx)(ts,{asChild:!0,container:o,children:r})})})};tO.displayName=tT;var tP="TooltipContent",tD=x.forwardRef((e,t)=>{let n=tA(tP,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...l}=e,a=tS(tP,e.__scopeTooltip);return(0,i.jsx)(tc,{present:r||a.open,children:a.disableHoverableContent?(0,i.jsx)(t_,{side:o,...l,ref:t}):(0,i.jsx)(tI,{side:o,...l,ref:t})})}),tI=x.forwardRef((e,t)=>{let n=tS(tP,e.__scopeTooltip),r=tw(tP,e.__scopeTooltip),o=x.useRef(null),l=b(t,o),[a,s]=x.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=x.useCallback(()=>{s(null),f(!1)},[f]),m=x.useCallback((e,t)=>{let n,r=e.currentTarget,i={x:e.clientX,y:e.clientY},o=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw Error("unreachable")}}(i,r.getBoundingClientRect());s(((n=[...function(e,t,n=5){let r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(i,o),...function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())].slice()).sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(n))),f(!0)},[f]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}},[c,d,m,p]),x.useEffect(()=>{if(a){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let l=t[e],a=t[o],s=l.x,c=l.y,u=a.x,d=a.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(i=!i)}return i}(n,a);r?p():i&&(p(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,d,a,u,p]),(0,i.jsx)(t_,{...e,ref:l})}),[tB,t$]=tx(tN,{isInside:!1}),tM=((n=e=>"child"in e?e.children(e.child):e.children).displayName="TooltipContent.Slottable",n.__radixId=j,n),t_=x.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:a,...s}=e,c=tS(tP,n),u=tv(n),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(tb,d),()=>document.removeEventListener(tb,d)),[d]),x.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]),(0,i.jsx)(L,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,i.jsxs)(tt,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,i.jsx)(tM,{children:r}),(0,i.jsx)(tB,{scope:n,isInside:!0,children:(0,i.jsx)(tm,{id:c.contentId,role:"tooltip",children:o||r})})]})})});tD.displayName=tP;var tF="TooltipArrow",tz=x.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=tv(n);return t$(tF,n).isInside?null:(0,i.jsx)(ti,{...o,...r,ref:t})});function tH({delayDuration:e=0,...t}){return(0,i.jsx)(tj,{delayDuration:e,...t})}function tW(e){return(0,i.jsx)(tH,{children:(0,i.jsx)(tE,{...e})})}function tU(e){return(0,i.jsx)(tk,{...e})}function tV({className:e,sideOffset:t=4,children:n,...r}){return(0,i.jsx)(tO,{children:(0,i.jsxs)(tD,{sideOffset:t,className:(0,c.cn)("z-50 w-fit max-w-64 origin-(--radix-tooltip-content-transform-origin) rounded-md bg-primary px-3 py-1.5 text-xs text-balance text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r,children:[n,(0,i.jsx)(tz,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] fill-primary"})]})})}tz.displayName=tF;var tY=e.i(1485);let tX=[{app:"claude",label:"Claude",icon:"claude"},{app:"codex",label:"Codex",icon:"codex"},{app:"vscode",label:"VS Code",icon:"ext"},{app:"cmux",label:"cmux",icon:"terminal"},{app:"herdr",label:"Herdr",icon:"terminal"},{app:"iterm2",label:"iTerm2",icon:"terminal"},{app:"finder",label:"Finder",icon:"folder"}];function tK({url:e}){let[t,n]=(0,x.useState)(!1),r=(0,x.useRef)(null);(0,x.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let o=(0,x.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1500)}catch{}},[e]);return(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:o,children:[t?(0,i.jsx)(a.Icons.check,{}):(0,i.jsx)(a.Icons.copy,{}),t?"Copied":"Copy URL"]})}function tq({reason:e,children:t}){return e?(0,i.jsxs)(tW,{children:[(0,i.jsx)(tU,{asChild:!0,children:(0,i.jsx)("span",{className:"cursor-not-allowed",children:t})}),(0,i.jsx)(tV,{children:e})]}):(0,i.jsx)(i.Fragment,{children:t})}function tG({box:e}){let{webUrl:t,vncUrl:n}=e,{apps:r,supported:o,pending:l,launch:s}=function(e){let[t,n]=(0,x.useState)(null),[r,i]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/v1/open-targets",{credentials:"same-origin"});e&&n(t.ok?await t.json():null)}catch{e&&n(null)}})(),()=>{e=!1}},[]);let o=(0,x.useCallback)(async t=>{i(t);try{let n=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:t})});if(!n.ok){let e=await n.json().catch(()=>null);window.alert(`Open in ${t} failed: ${e?.error?.message??`HTTP ${n.status}`}`)}}catch(e){window.alert(`Open in ${t} failed: ${e instanceof Error?e.message:String(e)}`)}finally{i(null)}},[e.id]),l=t?.supported?t.targets:null;return{apps:l?tX.map(({app:t,label:n,icon:r})=>{let i=l[t],o=i.available?i.providers&&!i.providers.includes(e.provider)?`Not available for ${e.provider} boxes`:null:i.reason??`${n} is not installed`;return{app:t,label:n,icon:r,disabledReason:o}}):[],supported:null!==l,pending:r,launch:o}}(e),c="paused"===e.status?"Box is paused — resume to access":"stopped"===e.status?"Box is stopped — start to access":null,u=t?null:c??"No web service exposed",f=n?null:!1===e.vncEnabled?"VNC is not enabled for this box":c??"VNC is not available";return o||t||n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tY.SectionLabel,{children:"Access"}),(0,i.jsxs)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:t||!n?"Web":"VNC"}),(0,i.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:t??(n?"Remote desktop":u)})]}),(0,i.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[t?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",href:t,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)(a.Icons.ext,{}),"Open web"]}):(0,i.jsx)(tq,{reason:u,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,i.jsx)(a.Icons.ext,{}),"Open web"]})}),t?(0,i.jsx)(tK,{url:t}):null,n?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",href:n,target:"_blank",rel:"noreferrer",onClick:()=>{fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/screen`,{method:"POST",credentials:"same-origin"}).catch(()=>{})},children:[(0,i.jsx)(a.Icons.ext,{}),"Open VNC"]}):(0,i.jsx)(tq,{reason:f,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,i.jsx)(a.Icons.ext,{}),"Open VNC"]})})]})]}),o?(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,i.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,i.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:r.map(({app:e,label:t,icon:n,disabledReason:r})=>{let o=a.Icons[n];return(0,i.jsx)(tq,{reason:r,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:null!==r||null!==l,onClick:()=>void s(e),children:[(0,i.jsx)(o,{}),t]})},e)})})]}):null]})]}):null}var tJ=e.i(80922),tZ=e.i(30544),tQ=e.i(51096);function t0({k:e,v:t,mono:n,link:r}){return(0,i.jsxs)("div",{className:"grid grid-cols-[156px_1fr] items-baseline gap-4 px-4.5 p-3 max-sm:grid-cols-1 max-sm:gap-1",children:[(0,i.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,i.jsx)("div",{className:(0,c.cn)("min-w-0 text-[13.5px]",n?"font-mono text-[13px]":""),children:r?(0,i.jsx)(tQ.default,{className:"cursor-pointer text-primary",href:r,children:t}):t})]})}var t1=e.i(31758),t5=e.i(95141),t2=e.i(3060),t3=e.i(16200),t4=e.i(49604),t6=e.i(9383);let t8=(0,t6.createServerReference)("70137307c04959a7a87b0e738c2d22a7c0eafade51",t6.callServer,void 0,t6.findSourceMapURL,"gitBranchAction"),t9=(0,t6.createServerReference)("60a2d1c9acc13909e16f84535e8738b59d8e0fa45b",t6.callServer,void 0,t6.findSourceMapURL,"gitCheckoutAction"),t7=(0,t6.createServerReference)("60551254c747186d54906f2f9805c02811f233a085",t6.callServer,void 0,t6.findSourceMapURL,"gitPullAction"),ne=(0,t6.createServerReference)("602fbbc8a351885a63f297205c405aa663802175db",t6.callServer,void 0,t6.findSourceMapURL,"gitPushAction"),nt=(0,t6.createServerReference)("60825f263c633940d187614c03fcfc77deeb86554d",t6.callServer,void 0,t6.findSourceMapURL,"gitPushHostAction"),nn=0;function nr({toasts:e,dismiss:t}){return(0,i.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex w-[340px] max-w-[calc(100vw-40px)] flex-col gap-2",children:e.map(e=>(0,i.jsxs)("div",{className:"anim-pop pointer-events-auto relative flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 pr-9 shadow-[0_16px_40px_-18px_rgba(20,24,30,.35)]",children:[(0,i.jsx)("span",{className:(0,c.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===e.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===e.variant?(0,i.jsx)(a.Icons.warn,{className:"size-3.5"}):(0,i.jsx)(a.Icons.check,{className:"size-3.5"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:e.title}),e.detail?(0,i.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:e.detail}):null]}),(0,i.jsx)("button",{className:"absolute right-2.5 top-2.5 grid h-5 w-5 cursor-pointer place-items-center rounded border-0 bg-transparent text-[#a4a9b0] hover:text-foreground",onClick:()=>t(e.id),"aria-label":"Dismiss",children:(0,i.jsx)(a.Icons.x,{className:"size-3"})})]},e.id))})}function ni({label:e,desc:t,children:n}){return(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:e}),(0,i.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:t})]}),(0,i.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:n})]})}function no({icon:e,disabled:t,onRun:n,children:r}){let[o,l]=(0,x.useState)(!1),a=async()=>{l(!0);try{await n()}finally{l(!1)}};return(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:t||o,onClick:a,children:[o?(0,i.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,i.jsx)(e,{}),r]})}function nl(e,t){let n=(e??"").trim()||(t??"").trim();return n?n.split("\n")[0]:void 0}function na({box:e}){let t=(0,o.useRouter)(),{toasts:n,push:r,dismiss:l}=function(){let[e,t]=(0,x.useState)([]),n=(0,x.useCallback)(e=>t(t=>t.filter(t=>t.id!==e)),[]);return{toasts:e,push:(0,x.useCallback)(e=>{let r=++nn;t(t=>[...t,{id:r,...e}]),setTimeout(()=>n(r),4200)},[n]),dismiss:n}}(),[s,u]=(0,x.useState)(null),[f,p]=(0,x.useState)(null),m="running"!==e.status,v=(0,x.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/git`,{credentials:"same-origin"});u(t.ok?await t.json():null)}catch{u(null)}},[e.id]);(0,x.useEffect)(()=>{v()},[v]);let g=s?.ok&&s.branch?s.branch:e.branch||"—",b=()=>{v(),t.refresh()},y=async(e,t)=>{let n=await t();n.ok?(r({title:e,detail:nl(n.stdout,n.stderr)}),b()):r({variant:"error",title:`${e} failed`,detail:n.error})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.Card,{className:(0,c.cn)("divide-y divide-border/60 overflow-hidden",m?"opacity-90":""),children:[m?(0,i.jsxs)("div",{className:"flex items-center gap-2.5 bg-[var(--amber-soft)] px-4.5 p-2.5 text-[12.5px] text-[var(--amber)]",children:[(0,i.jsx)(a.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",e.status," — git operations need a running box."]}):null,(0,i.jsxs)(ni,{label:"Sync",desc:`origin ↔ ${g}`,children:[(0,i.jsx)(no,{icon:a.Icons.arrowL,disabled:m,onRun:()=>y("Pulled from origin",()=>t7(e.id)),children:"Pull"}),(0,i.jsx)(no,{icon:a.Icons.ext,disabled:m,onRun:()=>y("Pushed to origin",()=>ne(e.id)),children:"Push"}),(0,i.jsx)(no,{icon:a.Icons.host,disabled:m,onRun:()=>y("Pushed to host",()=>nt(e.id)),children:"Push to host"})]}),(0,i.jsxs)(ni,{label:"Branch",desc:`currently on ${g}`,children:[(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:m,onClick:()=>p("change"),children:[(0,i.jsx)(a.Icons.branch,{}),"Change branch"]}),(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:m,onClick:()=>p("new"),children:[(0,i.jsx)(a.Icons.plus,{}),"New branch"]})]})]}),"change"===f?(0,i.jsx)(nu,{box:e,branch:g,onClose:()=>p(null),onDone:r,onRefresh:b}):null,"new"===f?(0,i.jsx)(nd,{box:e,onClose:()=>p(null),onDone:r,onRefresh:b}):null,(0,i.jsx)(nr,{toasts:n,dismiss:l})]})}let ns="__manual__";function nc({boxId:e,value:t,onChange:n,id:r,headLabel:o,currentBranch:l}){let[a,s]=(0,x.useState)(null),[c,u]=(0,x.useState)(l??null),[d,f]=(0,x.useState)(!1);return((0,x.useEffect)(()=>{let t=!1;return(async()=>{try{let n=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/branches`,{credentials:"same-origin"}),r=n.ok?await n.json():null;if(t)return;r&&Array.isArray(r.branches)&&r.branches.length>0?(s(r.branches),l||"string"!=typeof r.current||u(r.current)):(s([]),f(!0))}catch{t||(s([]),f(!0))}})(),()=>{t=!0}},[e,l]),null===a)?(0,i.jsx)(t4.Select,{id:r,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,i.jsx)("option",{value:"",children:"Loading branches…"})}):d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t2.Input,{id:r,className:"font-mono text-[13px]",autoFocus:!0,value:t,onChange:e=>n(e.target.value),placeholder:o?"HEAD":"feature-x"}),a.length>0?(0,i.jsx)("button",{type:"button",onClick:()=>{f(!1),n("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,i.jsxs)(t4.Select,{id:r,value:t,wrapperClassName:"w-full",onChange:e=>{if(e.target.value===ns){f(!0),n("");return}n(e.target.value)},children:[o?(0,i.jsx)("option",{value:"",children:o}):(0,i.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,i.jsx)("option",{value:ns,children:"Other / type manually…"}),(0,i.jsx)("option",{disabled:!0,children:"────────────"}),a.map(e=>(0,i.jsxs)("option",{value:e,children:[e,e===c?" (current)":""]},e))]})}function nu({box:e,branch:t,onClose:n,onDone:r,onRefresh:o}){let[l,s]=(0,x.useState)(""),[c,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(null),p=l.trim().length>0;return(0,i.jsxs)(t5.Dialog,{onClose:n,className:"max-w-[440px]",children:[(0,i.jsxs)(t5.DialogHeader,{children:[(0,i.jsx)(t5.DialogIcon,{children:(0,i.jsx)(a.Icons.branch,{})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t5.DialogTitle,{children:"Change branch"}),(0,i.jsxs)(t5.DialogDescription,{children:[e.id," · currently on ",t]})]})]}),(0,i.jsxs)(t5.DialogBody,{children:[(0,i.jsx)(t3.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,i.jsx)(nc,{boxId:e.id,id:"gb-branch",value:l,onChange:s,currentBranch:t}),(0,i.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),d?(0,i.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:d}):null]}),(0,i.jsxs)(t5.DialogFooter,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:n,disabled:c,children:"Cancel"}),(0,i.jsxs)(h.Button,{onClick:()=>{p&&!c&&(u(!0),f(null),(async()=>{let t=await t9(e.id,l.trim());t.ok?(r({title:"Branch changed",detail:nl(t.stdout,t.stderr)}),n(),o()):(f(t.error),u(!1))})())},disabled:!p||c,children:[c?(0,i.jsx)("span",{className:"spin"}):(0,i.jsx)(a.Icons.check,{}),c?"Checking out…":"Change branch"]})]})]})}function nd({box:e,onClose:t,onDone:n,onRefresh:r}){let[o,l]=(0,x.useState)(""),[s,c]=(0,x.useState)(""),[u,d]=(0,x.useState)(!1),[f,p]=(0,x.useState)(null),m=o.trim().length>0,v=()=>{m&&!u&&(d(!0),p(null),(async()=>{let i=await t8(e.id,o.trim(),s.trim()||void 0);i.ok?(n({title:"Branch created",detail:nl(i.stdout,i.stderr)}),t(),r()):(p(i.error),d(!1))})())};return(0,i.jsxs)(t5.Dialog,{onClose:t,className:"max-w-[440px]",children:[(0,i.jsxs)(t5.DialogHeader,{children:[(0,i.jsx)(t5.DialogIcon,{children:(0,i.jsx)(a.Icons.branch,{})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t5.DialogTitle,{children:"New branch"}),(0,i.jsxs)(t5.DialogDescription,{children:[e.id," · branching in the box workspace"]})]})]}),(0,i.jsxs)(t5.DialogBody,{children:[(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsx)(t3.Label,{htmlFor:"nb-name",children:"Name"}),(0,i.jsx)(t2.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&v()},placeholder:"my-branch"}),(0,i.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,i.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,i.jsxs)(t3.Label,{htmlFor:"nb-from",children:["Base ref ",(0,i.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,i.jsx)(nc,{boxId:e.id,id:"nb-from",value:s,onChange:c,headLabel:"Current HEAD (default)"}),(0,i.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),f?(0,i.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:f}):null]}),(0,i.jsxs)(t5.DialogFooter,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:t,disabled:u,children:"Cancel"}),(0,i.jsxs)(h.Button,{onClick:v,disabled:!m||u,children:[u?(0,i.jsx)("span",{className:"spin"}):(0,i.jsx)(a.Icons.plus,{}),u?"Creating…":"Create branch"]})]})]})}let nf=(0,t6.createServerReference)("609ba80514592f08c476672e7d77ab956504674bb6",t6.callServer,void 0,t6.findSourceMapURL,"restartServiceAction"),np=new Set(["ready","running","done"]),nm=new Set(["crashed","unhealthy","backoff","failed"]),nx={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},nh={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function nv({svc:e,disabled:t,onRestart:n}){var r;let o=(r=e.state,np.has(r)?"up":nm.has(r)?"bad":"idle");return(0,i.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,i.jsx)("span",{className:(0,c.cn)("badge-dot",nx[o]),"aria-hidden":!0}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:e.name}),(0,i.jsx)("span",{className:(0,c.cn)("font-mono text-xs",nh[o]),children:e.state}),e.restarts>0?(0,i.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",e.restarts]}):null,(0,i.jsx)(h.Button,{variant:"outline",size:"icon-sm",title:`Restart ${e.name}`,disabled:t,onClick:()=>n(e.name),children:(0,i.jsx)(a.Icons.refresh,{})})]})}function ng({id:e,running:t}){let[n,r]=(0,x.useState)(null),[o,l]=(0,x.useState)(null),[s,c]=(0,x.useTransition)(),u=(0,x.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/services`,{credentials:"same-origin"});if(!t.ok)return void l(`status ${String(t.status)}`);r(await t.json()),l(null)}catch(e){l(e instanceof Error?e.message:String(e))}},[e]);(0,x.useEffect)(()=>{if(u(),!t)return;let e=setInterval(()=>void u(),4e3);return()=>clearInterval(e)},[u,t]);let f=t=>{c(async()=>{let n=await nf(e,t);n.ok||window.alert(`Restart failed: ${n.error}`),await u()})},p=n?.services??[],m=p.length>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tY.SectionLabel,{right:m?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!t||s,onClick:()=>f(void 0),children:[(0,i.jsx)(a.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,i.jsx)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:n||o?o?(0,i.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",o,")."]}):m?(0,i.jsxs)(i.Fragment,{children:[n?.source==="persisted"?(0,i.jsx)("div",{className:"bg-muted/30 px-4 py-1.5 font-mono text-[11px] text-muted-foreground",children:"persisted snapshot — box not running"}):null,p.map(e=>(0,i.jsx)(nv,{svc:e,disabled:!t||s,onRestart:e=>f(e)},e.name))]}):(0,i.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:n?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,i.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var nb=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,o.useParams)(),{box:t,project:n}=(0,f.useStore)(),r=t(e);if(!r)return(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,i.jsx)(tJ.BackLink,{to:"/",children:"All boxes"}),(0,i.jsx)(t1.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let c=n(r.projectId);return(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,i.jsx)(tJ.BackLink,{to:"/projects/"+r.projectId,children:c?c.name:"Project"}),(0,i.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[r.task,(0,i.jsx)(s.StatusBadge,{status:r.status})]}),(0,i.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.id})," ·"," ",(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.repo})," · ",r.host]})]}),(0,i.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,i.jsx)(tZ.BoxActions,{box:r,size:"lg"})})]}),r.error?(0,i.jsx)(u,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:a.Icons.warn,title:"Box errored",children:(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.error})}):null,(0,i.jsx)(m,{boxId:r.id}),(0,i.jsx)(tY.SectionLabel,{children:"Overview"}),(0,i.jsxs)(nb.StatGrid,{children:[(0,i.jsx)(nb.Stat,{k:"Status",v:(0,i.jsx)(s.StatusBadge,{status:r.status})}),(0,i.jsx)(nb.Stat,{k:"Agent CLI",v:r.agent,mono:!0}),(0,i.jsx)(nb.Stat,{k:"Commits",v:r.commits??"—",icon:a.Icons.commit}),(0,i.jsx)(nb.Stat,{k:"Files touched",v:r.filesTouched??"—",icon:a.Icons.file}),(0,i.jsx)(nb.Stat,{k:"Last activity",v:(0,i.jsx)(l.Ago,{ms:r.lastActivity}),mono:!0})]}),(0,i.jsx)(tG,{box:r}),(0,i.jsx)(tY.SectionLabel,{children:"Git operations"}),(0,i.jsx)(na,{box:r}),(0,i.jsx)(ng,{id:r.id,running:"running"===r.status}),(0,i.jsx)(tY.SectionLabel,{children:"Details"}),(0,i.jsxs)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,i.jsx)(t0,{k:"Box ID",v:r.id,mono:!0}),(0,i.jsx)(t0,{k:"Project",v:c?c.name:"—",link:c?"/projects/"+r.projectId:null}),(0,i.jsx)(t0,{k:"Repository",v:r.repo,mono:!0}),(0,i.jsx)(t0,{k:"Branch",v:r.branch,mono:!0}),(0,i.jsx)(t0,{k:"Host",v:r.host,mono:!0}),(0,i.jsx)(t0,{k:"Created",v:new Date(r.createdAt).toLocaleString(),mono:!0})]})]})}],77084)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77084,e=>{"use strict";let t,n;var r,i=e.i(1262),o=e.i(45971),l=e.i(33789),a=e.i(44344),s=e.i(86892),c=e.i(65232);function u({className:e,icon:t,title:n,children:r}){return(0,i.jsxs)("div",{className:(0,c.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",e),children:[t?(0,i.jsx)(t,{className:"mt-0.5 size-4 flex-none"}):null,(0,i.jsxs)("div",{className:"min-w-0",children:[n?(0,i.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:n}):null,(0,i.jsx)("div",{className:"text-[12.5px] leading-normal",children:r})]})]})}var d=e.i(8536),f=e.i(96621),p=e.i(88451);function m({boxId:e}){let{state:t}=(0,f.useStore)(),n=t.approvals.filter(t=>t.boxId===e).sort((e,t)=>e.createdAt-t.createdAt);return 0===n.length?null:(0,i.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,i.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,i.jsx)(a.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,i.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[n.length," pending approval",1===n.length?"":"s"]}),(0,i.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,i.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:n.map(e=>(0,i.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,i.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,i.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:e.command??e.message}),e.detail?(0,i.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:e.detail}):null,e.cwd?(0,i.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:e.cwd}):null,(0,i.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,i.jsx)(l.Ago,{ms:e.createdAt})})]}),(0,i.jsx)("div",{className:"flex-none pt-0.5",children:(0,i.jsx)(p.ApprovalActions,{id:e.id})})]},e.id))})]})}var x=e.i(54129),h=e.i(69377);function v(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)}}function g(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function b(...e){return x.useCallback(function(...e){return t=>{let n=!1,r=e.map(e=>{let r=g(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():g(e[t],null)}}}}(...e),e)}function y(e,t=[]){let n=[],r=()=>{let t=n.map(e=>x.createContext(e));return function(n){let r=n?.[e]||t;return x.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let o=x.createContext(r);o.displayName=t+"Context";let l=n.length;n=[...n,r];let a=t=>{let{scope:n,children:r,...a}=t,s=n?.[e]?.[l]||o,c=x.useMemo(()=>a,Object.values(a));return(0,i.jsx)(s.Provider,{value:c,children:r})};return a.displayName=t+"Provider",[a,function(n,i,a={}){let{optional:s=!1}=a,c=i?.[e]?.[l]||o,u=x.useContext(c);if(u)return u;if(void 0!==r)return r;if(!s)throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}"u">typeof window&&window.document&&window.document.createElement;var w=e.i(94766),j=Symbol.for("radix.slottable"),N=Symbol.for("react.lazy");function C(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===N&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var S=x[" use ".trim().toString()],E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var n;let r,o=(n=`Primitive.${t}`,(r=x.forwardRef((e,t)=>{var r;let i,o,{children:l,...a}=e,s=null,c=!1,u=[];C(l)&&"function"==typeof S&&(l=S(l._payload)),x.Children.forEach(l,e=>{var t;if(t=e,x.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===j){c=!0;let t="child"in e.props?e.props.child:e.props.children;C(t)&&"function"==typeof S&&(t=S(t._payload)),s=((e,t)=>{if("child"in e.props){let t=e.props.child;return x.isValidElement(t)?x.cloneElement(t,void 0,e.props.children(t.props.children)):null}return x.isValidElement(t)?t:null})(e,t),u.push(s?.props?.children)}else u.push(e)}),s?s=x.cloneElement(s,void 0,u):!c&&1===x.Children.count(l)&&x.isValidElement(l)&&(s=l);let d=s?(r=s,(o=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(o=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,f=b(t,d);if(!s){if(l||0===l){let e,t;throw Error(c?(e=n,`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(t=n,`${t} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return l}let p=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(a,s.props??{});return s.type!==x.Fragment&&(p.ref=t?f:d),x.cloneElement(s,p)})).displayName=`${n}.Slot`,r),l=x.forwardRef((e,n)=>{let{asChild:r,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(r?o:t,{...l,ref:n})});return l.displayName=`Primitive.${t}`,{...e,[t]:l}},{});function R(e){let t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...e)=>t.current?.(...e),[])}var k="dismissableLayer.update",T=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),L=x.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:c,onDismiss:u,...d}=e,f=x.useContext(T),[p,m]=x.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=x.useState({}),y=b(t,m),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=j?w.indexOf(j):-1,C=p?w.indexOf(p):-1,S=f.layersWithOutsidePointerEventsDisabled.size>0,L=C>=N,D=x.useRef(!1),I=function(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o,shouldHandlePointerDownOutside:l=A}=t,a=R(e),s=x.useRef(!1),c=x.useRef(!1),u=x.useRef(new Map),d=x.useRef(()=>{});return x.useEffect(()=>{function e(){c.current=!1,i.current=!1,u.current.clear()}function t(e){if(!c.current)return;let t=e.target;t instanceof Node&&[...o].some(e=>e.contains(t))||u.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&d.current()},0)}function f(e){c.current&&u.current.set(e.type,!1)}let p=t=>{if(t.target&&!s.current){let o=function(){n.removeEventListener("click",d.current);let t=Array.from(u.current.values()).some(Boolean);e(),t||P("dismissableLayer.pointerDownOutside",a,f,{discrete:!0})};if(!l(t.target)){n.removeEventListener("click",d.current),e(),s.current=!1;return}let f={originalEvent:t};c.current=!0,i.current=r&&0===t.button,u.current.clear(),r&&0===t.button?(n.removeEventListener("click",d.current),d.current=o,n.addEventListener("click",d.current,{once:!0})):o()}else n.removeEventListener("click",d.current),e();s.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of m)n.addEventListener(e,t,!0),n.addEventListener(e,f);let x=window.setTimeout(()=>{n.addEventListener("pointerdown",p)},0);return()=>{for(let e of(window.clearTimeout(x),n.removeEventListener("pointerdown",p),n.removeEventListener("click",d.current),m))n.removeEventListener(e,t,!0),n.removeEventListener(e,f)}},[n,a,r,i,o,l]),{onPointerDownCapture:()=>s.current=!0}}(e=>{a?.(e),c?.(e),e.defaultPrevented||u?.()},{ownerDocument:h,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:D,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:x.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...f.branches].some(t=>t.contains(e));return L&&!t},[f.branches,L])}),B=function(e,t=globalThis?.document){let n=R(e),r=x.useRef(!1);return x.useEffect(()=>{let e=e=>{e.target&&!r.current&&P("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(o&&D.current)return;let t=e.target;![...f.branches].some(e=>e.contains(t))&&(s?.(e),c?.(e),e.defaultPrevented||u?.())},h),$=!!p&&C===w.length-1,M=R(e=>{"Escape"===e.key&&(l?.(e),!e.defaultPrevented&&u&&(e.preventDefault(),u()))});return x.useEffect(()=>{if($)return h.addEventListener("keydown",M,{capture:!0}),()=>h.removeEventListener("keydown",M,{capture:!0})},[h,$,M]),x.useEffect(()=>{if(p)return n&&(0===f.layersWithOutsidePointerEventsDisabled.size&&(r=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(p)),f.layers.add(p),O(),()=>{n&&(f.layersWithOutsidePointerEventsDisabled.delete(p),0===f.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=r))}},[p,h,n,f]),x.useEffect(()=>()=>{p&&(f.layers.delete(p),f.layersWithOutsidePointerEventsDisabled.delete(p),O())},[p,f]),x.useEffect(()=>{let e=()=>g({});return document.addEventListener(k,e),()=>document.removeEventListener(k,e)},[]),(0,i.jsx)(E.div,{...d,ref:y,style:{pointerEvents:S?L?"auto":"none":void 0,...e.style},onFocusCapture:v(e.onFocusCapture,B.onFocusCapture),onBlurCapture:v(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:v(e.onPointerDownCapture,I.onPointerDownCapture)})});L.displayName="DismissableLayer",x.forwardRef((e,t)=>{let n=x.useContext(T),r=x.useRef(null),o=b(t,r);return x.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,i.jsx)(E.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var A=()=>!0;function O(){let e=new CustomEvent(k);document.dispatchEvent(e)}function P(e,t,n,{discrete:r}){let i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&i.addEventListener(e,t,{once:!0}),r)i&&w.flushSync(()=>i.dispatchEvent(o));else i.dispatchEvent(o)}var D=globalThis?.document?x.useLayoutEffect:()=>{},I=x[" useId ".trim().toString()]||(()=>void 0),B=0;let $=["top","right","bottom","left"],M=Math.min,_=Math.max,F=Math.round,z=Math.floor,H=e=>({x:e,y:e}),W={left:"right",right:"left",bottom:"top",top:"bottom"};function U(e,t){return"function"==typeof e?e(t):e}function V(e){return e.split("-")[0]}function Y(e){return e.split("-")[1]}function X(e){return"x"===e?"y":"x"}function K(e){return"y"===e?"height":"width"}function q(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function G(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let J=["left","right"],Z=["right","left"],Q=["top","bottom"],ee=["bottom","top"];function et(e){let t=V(e);return W[t]+e.slice(t.length)}function en(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function er(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ei(e,t,n){let r,{reference:i,floating:o}=e,l=q(t),a=X(q(t)),s=K(a),c=V(t),u="y"===l,d=i.x+i.width/2-o.width/2,f=i.y+i.height/2-o.height/2,p=i[s]/2-o[s]/2;switch(c){case"top":r={x:d,y:i.y-o.height};break;case"bottom":r={x:d,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:f};break;case"left":r={x:i.x-o.width,y:f};break;default:r={x:i.x,y:i.y}}switch(Y(t)){case"start":r[a]-=p*(n&&u?-1:1);break;case"end":r[a]+=p*(n&&u?-1:1)}return r}async function eo(e,t){var n;void 0===t&&(t={});let{x:r,y:i,platform:o,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=U(t,e),m=en(p),x=a[f?"floating"===d?"reference":"floating":d],h=er(await o.getClippingRect({element:null==(n=await (null==o.isElement?void 0:o.isElement(x)))||n?x:x.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),v="floating"===d?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,g=await (null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),b=await (null==o.isElement?void 0:o.isElement(g))&&await (null==o.getScale?void 0:o.getScale(g))||{x:1,y:1},y=er(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:g,strategy:s}):v);return{top:(h.top-y.top+m.top)/b.y,bottom:(y.bottom-h.bottom+m.bottom)/b.y,left:(h.left-y.left+m.left)/b.x,right:(y.right-h.right+m.right)/b.x}}let el=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:eo},s=await (null==l.isRTL?void 0:l.isRTL(t)),c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ei(c,r,s),f=r,p=0,m={};for(let n=0;n<o.length;n++){let x=o[n];if(!x)continue;let{name:h,fn:v}=x,{x:g,y:b,data:y,reset:w}=await v({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=b?b:d,m[h]={...m[h],...y},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(f=w.placement),w.rects&&(c=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:u,y:d}=ei(c,f,s)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}};function ea(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function es(e){return $.some(t=>e[t]>=0)}let ec=new Set(["left","top"]);async function eu(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),l=V(n),a=Y(n),s="y"===q(n),c=ec.has(l)?-1:1,u=o&&s?-1:1,d=U(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function ed(){return"u">typeof window}function ef(e){return ex(e)?(e.nodeName||"").toLowerCase():"#document"}function ep(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function em(e){var t;return null==(t=(ex(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ex(e){return!!ed()&&(e instanceof Node||e instanceof ep(e).Node)}function eh(e){return!!ed()&&(e instanceof Element||e instanceof ep(e).Element)}function ev(e){return!!ed()&&(e instanceof HTMLElement||e instanceof ep(e).HTMLElement)}function eg(e){return!(!ed()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ep(e).ShadowRoot)}function eb(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=eR(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function ey(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let ew=/transform|translate|scale|rotate|perspective|filter/,ej=/paint|layout|strict|content/,eN=e=>!!e&&"none"!==e;function eC(e){let t=eh(e)?eR(e):e;return eN(t.transform)||eN(t.translate)||eN(t.scale)||eN(t.rotate)||eN(t.perspective)||!eS()&&(eN(t.backdropFilter)||eN(t.filter))||ew.test(t.willChange||"")||ej.test(t.contain||"")}function eS(){return null==t&&(t="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),t}function eE(e){return/^(html|body|#document)$/.test(ef(e))}function eR(e){return ep(e).getComputedStyle(e)}function ek(e){return eh(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eT(e){if("html"===ef(e))return e;let t=e.assignedSlot||e.parentNode||eg(e)&&e.host||em(e);return eg(t)?t.host:t}function eL(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=eT(t);return eE(n)?t.ownerDocument?t.ownerDocument.body:t.body:ev(n)&&eb(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),l=ep(i);if(!o)return t.concat(i,eL(i,[],n));{let e=eA(l);return t.concat(l,l.visualViewport||[],eb(i)?i:[],e&&n?eL(e):[])}}function eA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eO(e){let t=eR(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ev(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,a=F(n)!==o||F(r)!==l;return a&&(n=o,r=l),{width:n,height:r,$:a}}function eP(e){return eh(e)?e:e.contextElement}function eD(e){let t=eP(e);if(!ev(t))return H(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=eO(t),l=(o?F(n.width):n.width)/r,a=(o?F(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}let eI=H(0);function eB(e){let t=ep(e);return eS()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eI}function e$(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),l=eP(e),a=H(1);t&&(r?eh(r)&&(a=eD(r)):a=eD(e));let s=(void 0===(i=n)&&(i=!1),r&&(!i||r===ep(l))&&i)?eB(l):H(0),c=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(l){let e=ep(l),t=r&&eh(r)?ep(r):r,n=e,i=eA(n);for(;i&&r&&t!==n;){let e=eD(i),t=i.getBoundingClientRect(),r=eR(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=o,u+=l,i=eA(n=ep(i))}}return er({width:d,height:f,x:c,y:u})}function eM(e,t){let n=ek(e).scrollLeft;return t?t.left+n:e$(em(e)).left+n}function e_(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-eM(e,n),y:n.top+t.scrollTop}}function eF(e,t,n){var r;let i;if("viewport"===t)i=function(e,t){let n=ep(e),r=em(e),i=n.visualViewport,o=r.clientWidth,l=r.clientHeight,a=0,s=0;if(i){o=i.width,l=i.height;let e=eS();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,s=i.offsetTop)}let c=eM(r);if(c<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(r.clientWidth-t.clientWidth-i);l<=25&&(o-=l)}else c<=25&&(o+=c);return{width:o,height:l,x:a,y:s}}(e,n);else if("document"===t){let t,n,o,l,a,s,c;r=em(e),t=em(r),n=ek(r),o=r.ownerDocument.body,l=_(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=_(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+eM(r),c=-n.scrollTop,"rtl"===eR(o).direction&&(s+=_(t.clientWidth,o.clientWidth)-l),i={width:l,height:a,x:s,y:c}}else if(eh(t)){let e,r,o,l,a,s;r=(e=e$(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,l=ev(t)?eD(t):H(1),a=t.clientWidth*l.x,s=t.clientHeight*l.y,i={width:a,height:s,x:o*l.x,y:r*l.y}}else{let n=eB(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return er(i)}function ez(e){return"static"===eR(e).position}function eH(e,t){if(!ev(e)||"fixed"===eR(e).position)return null;if(t)return t(e);let n=e.offsetParent;return em(e)===n&&(n=n.ownerDocument.body),n}function eW(e,t){var n;let r=ep(e);if(ey(e))return r;if(!ev(e)){let t=eT(e);for(;t&&!eE(t);){if(eh(t)&&!ez(t))return t;t=eT(t)}return r}let i=eH(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(ef(n)))&&ez(i);)i=eH(i,t);return i&&eE(i)&&ez(i)&&!eC(i)?r:i||function(e){let t=eT(e);for(;ev(t)&&!eE(t);){if(eC(t))return t;if(ey(t))break;t=eT(t)}return null}(e)||r}let eU=async function(e){let t=this.getOffsetParent||eW,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=ev(t),i=em(t),o="fixed"===n,l=e$(e,!0,o,t),a={scrollLeft:0,scrollTop:0},s=H(0);if(r||!r&&!o)if(("body"!==ef(t)||eb(i))&&(a=ek(t)),r){let e=e$(t,!0,o,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=eM(i));o&&!r&&i&&(s.x=eM(i));let c=!i||r||o?H(0):e_(i,a);return{x:l.left+a.scrollLeft-s.x-c.x,y:l.top+a.scrollTop-s.y-c.y,width:l.width,height:l.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},eV={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,l=em(r),a=!!t&&ey(t.floating);if(r===l||a&&o)return n;let s={scrollLeft:0,scrollTop:0},c=H(1),u=H(0),d=ev(r);if((d||!d&&!o)&&(("body"!==ef(r)||eb(l))&&(s=ek(r)),d)){let e=e$(r);c=eD(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!l||d||o?H(0):e_(l,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-s.scrollTop*c.y+u.y+f.y}},getDocumentElement:em,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?ey(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=eL(e,[],!1).filter(e=>eh(e)&&"body"!==ef(e)),i=null,o="fixed"===eR(e).position,l=o?eT(e):e;for(;eh(l)&&!eE(l);){let t=eR(l),n=eC(l);n||"fixed"!==t.position||(i=null),(o?n||i:!(!n&&"static"===t.position&&i&&("absolute"===i.position||"fixed"===i.position)||eb(l)&&!n&&function e(t,n){let r=eT(t);return!(r===n||!eh(r)||eE(r))&&("fixed"===eR(r).position||e(r,n))}(e,l)))?i=t:r=r.filter(e=>e!==l),l=eT(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=eF(t,o[0],i),a=l.top,s=l.right,c=l.bottom,u=l.left;for(let e=1;e<o.length;e++){let n=eF(t,o[e],i);a=_(n.top,a),s=M(n.right,s),c=M(n.bottom,c),u=_(n.left,u)}return{width:s-u,height:c-a,x:u,y:a}},getOffsetParent:eW,getElementRects:eU,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:n}=eO(e);return{width:t,height:n}},getScale:eD,isElement:eh,isRTL:function(e){return"rtl"===eR(e).direction}};function eY(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let eX=e=>({name:"arrow",options:e,async fn(t){let{x:n,y:r,placement:i,rects:o,platform:l,elements:a,middlewareData:s}=t,{element:c,padding:u=0}=U(e,t)||{};if(null==c)return{};let d=en(u),f={x:n,y:r},p=X(q(i)),m=K(p),x=await l.getDimensions(c),h="y"===p,v=h?"clientHeight":"clientWidth",g=o.reference[m]+o.reference[p]-f[p]-o.floating[m],b=f[p]-o.reference[p],y=await (null==l.getOffsetParent?void 0:l.getOffsetParent(c)),w=y?y[v]:0;w&&await (null==l.isElement?void 0:l.isElement(y))||(w=a.floating[v]||o.floating[m]);let j=w/2-x[m]/2-1,N=M(d[h?"top":"left"],j),C=M(d[h?"bottom":"right"],j),S=w-x[m]-C,E=w/2-x[m]/2+(g/2-b/2),R=_(N,M(E,S)),k=!s.arrow&&null!=Y(i)&&E!==R&&o.reference[m]/2-(E<N?N:C)-x[m]/2<0,T=k?E<N?E-N:E-S:0;return{[p]:f[p]+T,data:{[p]:R,centerOffset:E-R-T,...k&&{alignmentOffset:T}},reset:k}}});var eK="u">typeof document?x.useLayoutEffect:function(){};function eq(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!eq(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!eq(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function eG(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eJ(e,t){let n=eG(e);return Math.round(t*n)/n}function eZ(e){let t=x.useRef(e);return eK(()=>{t.current=e}),t}var eQ=x.forwardRef((e,t)=>{let{children:n,width:r=10,height:o=5,...l}=e;return(0,i.jsx)(E.svg,{...l,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,i.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eQ.displayName="Arrow";var e0="Popper",[e1,e5]=y(e0),[e2,e3]=e1(e0),e4=e=>{let{__scopePopper:t,children:n}=e,[r,o]=x.useState(null),[l,a]=x.useState(void 0);return(0,i.jsx)(e2,{scope:t,anchor:r,onAnchorChange:o,placementState:l,setPlacementState:a,children:n})};e4.displayName=e0;var e6="PopperAnchor",e8=x.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,l=e3(e6,n),a=x.useRef(null),s=l.onAnchorChange,c=b(t,x.useCallback(e=>{a.current=e,e&&s(e)},[s])),u=x.useRef(null);x.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=l.placementState&&ta(l.placementState),f=d?.[0],p=d?.[1];return r?null:(0,i.jsx)(E.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...o,ref:c})});e8.displayName=e6;var e9="PopperContent",[e7,te]=e1(e9),tt=x.forwardRef((e,t)=>{var n,r,o,l,a,s,c,u,d,f,p,m,h;let v,g,y,j,N,C,{__scopePopper:S,side:k="bottom",sideOffset:T=0,align:L="center",alignOffset:A=0,arrowPadding:O=0,avoidCollisions:P=!0,collisionBoundary:I=[],collisionPadding:B=0,sticky:$="partial",hideWhenDetached:F=!1,updatePositionStrategy:H="optimized",onPlaced:W,...en}=e,er=e3(e9,S),[ei,eo]=x.useState(null),ed=b(t,eo),[ef,ep]=x.useState(null),ex=function(e){let[t,n]=x.useState(void 0);return D(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(ef),eh=ex?.width??0,ev=ex?.height??0,eg="number"==typeof B?B:{top:0,right:0,bottom:0,left:0,...B},eb=Array.isArray(I)?I:[I],ey=eb.length>0,ew={padding:eg,boundary:eb.filter(to),altBoundary:ey},{refs:ej,floatingStyles:eN,placement:eC,isPositioned:eS,middlewareData:eE}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:l}={},transform:a=!0,whileElementsMounted:s,open:c}=e,[u,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(r);eq(f,r)||p(r);let[m,h]=x.useState(null),[v,g]=x.useState(null),b=x.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=x.useCallback(e=>{e!==S.current&&(S.current=e,g(e))},[]),j=o||m,N=l||v,C=x.useRef(null),S=x.useRef(null),E=x.useRef(u),R=null!=s,k=eZ(s),T=eZ(i),L=eZ(c),A=x.useCallback(()=>{var e,r;let i,o,l;if(!C.current||!S.current)return;let a={placement:t,strategy:n,middleware:f};T.current&&(a.platform=T.current),(e=C.current,r=S.current,i=new Map,l={...(o={platform:eV,...a}).platform,_c:i},el(e,r,{...o,platform:l})).then(e=>{let t={...e,isPositioned:!1!==L.current};O.current&&!eq(E.current,t)&&(E.current=t,w.flushSync(()=>{d(t)}))})},[f,t,n,T,L]);eK(()=>{!1===c&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let O=x.useRef(!1);eK(()=>(O.current=!0,()=>{O.current=!1}),[]),eK(()=>{if(j&&(C.current=j),N&&(S.current=N),j&&N){if(k.current)return k.current(j,N,A);A()}},[j,N,A,k,R]);let P=x.useMemo(()=>({reference:C,floating:S,setReference:b,setFloating:y}),[b,y]),D=x.useMemo(()=>({reference:j,floating:N}),[j,N]),I=x.useMemo(()=>{let e={position:n,left:0,top:0};if(!D.floating)return e;let t=eJ(D.floating,u.x),r=eJ(D.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...eG(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,a,D.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:A,refs:P,elements:D,floatingStyles:I}),[u,A,P,D,I])}({strategy:"fixed",placement:k+("center"!==L?"-"+L:""),whileElementsMounted:(...e)=>(function(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,u=eP(e),d=o||l?[...u?eL(u):[],...t?eL(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)});let f=u&&s?function(e,t){let n,r=null,i=em(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return!function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),o();let c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(a||t(),!f||!p)return;let m={rootMargin:-z(d)+"px "+-z(i.clientWidth-(u+f))+"px "+-z(i.clientHeight-(d+p))+"px "+-z(u)+"px",threshold:_(0,M(1,s))||1},x=!0;function h(t){let r=t[0].intersectionRatio;if(r!==s){if(!x)return l();r?l(!1,r):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==r||eY(c,e.getBoundingClientRect())||l(),x=!1}try{r=new IntersectionObserver(h,{...m,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),o}(u,n):null,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let x=c?e$(e):null;return c&&function t(){let r=e$(e);x&&!eY(x,r)&&n(),x=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(i)}})(...e,{animationFrame:"always"===H}),elements:{reference:er.anchor},middleware:[{name:(v={name:"offset",options:r=n={mainAxis:T+ev,alignmentAxis:A},async fn(e){var t,n;let{x:i,y:o,placement:l,middlewareData:a}=e,s=await eu(e,r);return l===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+s.x,y:o+s.y,data:{...s,placement:l}}}}).name,fn:v.fn,options:[n,void 0]},P&&{name:(g={name:"shift",options:a=l={mainAxis:!0,crossAxis:!1,limiter:"partial"===$?{fn:(o=void 0,{options:o={},fn(e){let{x:t,y:n,placement:r,rects:i,middlewareData:l}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=U(o,e),u={x:t,y:n},d=q(r),f=X(d),p=u[f],m=u[d],x=U(a,e),h="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(s){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+h.mainAxis,n=i.reference[f]+i.reference[e]-h.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var v,g;let e="y"===f?"width":"height",t=ec.has(V(r)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=l.offset)?void 0:v[d])||0)+(t?0:h.crossAxis),o=i.reference[d]+i.reference[e]+(t?0:(null==(g=l.offset)?void 0:g[d])||0)-(t?h.crossAxis:0);m<n?m=n:m>o&&(m=o)}return{[f]:p,[d]:m}}}).fn,options:[void 0,void 0]}:void 0,...ew},async fn(e){let{x:t,y:n,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=U(a,e),u={x:t,y:n},d=await i.detectOverflow(e,c),f=q(V(r)),p=X(f),m=u[p],x=u[f];if(o){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=m+d[e],r=m-d[t];m=_(n,M(m,r))}if(l){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",n=x+d[e],r=x-d[t];x=_(n,M(x,r))}let h=s.fn({...e,[p]:m,[f]:x});return{...h,data:{x:h.x-t,y:h.y-n,enabled:{[p]:o,[f]:l}}}}}).name,fn:g.fn,options:[l,void 0]},P&&{name:(y={name:"flip",options:c=s={...ew},async fn(e){var t,n,r,i,o,l,a,s;let u,d,f,{placement:p,middlewareData:m,rects:x,initialPlacement:h,platform:v,elements:g}=e,{mainAxis:b=!0,crossAxis:y=!0,fallbackPlacements:w,fallbackStrategy:j="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:C=!0,...S}=U(c,e);if(null!=(t=m.arrow)&&t.alignmentOffset)return{};let E=V(p),R=q(h),k=V(h)===h,T=await (null==v.isRTL?void 0:v.isRTL(g.floating)),L=w||(k||!C?[et(h)]:(u=et(h),[G(h),u,G(u)])),A="none"!==N;!w&&A&&L.push(...(d=Y(h),f=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?Z:J;return t?J:Z;case"left":case"right":return t?Q:ee;default:return[]}}(V(h),"start"===N,T),d&&(f=f.map(e=>e+"-"+d),C&&(f=f.concat(f.map(G)))),f));let O=[h,...L],P=await v.detectOverflow(e,S),D=[],I=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&D.push(P[E]),y){let e,t,n,r,i=(l=p,a=x,void 0===(s=T)&&(s=!1),e=Y(l),n=K(t=X(q(l))),r="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",a.reference[n]>a.floating[n]&&(r=et(r)),[r,et(r)]);D.push(P[i[0]],P[i[1]])}if(I=[...I,{placement:p,overflows:D}],!D.every(e=>e<=0)){let e=((null==(r=m.flip)?void 0:r.index)||0)+1,t=O[e];if(t&&("alignment"!==y||R===q(t)||I.every(e=>q(e.placement)!==R||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(i=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(j){case"bestFit":{let e=null==(o=I.filter(e=>{if(A){let t=q(e.placement);return t===R||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=h}if(p!==n)return{reset:{placement:n}}}return{}}}).name,fn:y.fn,options:[s,void 0]},{name:(j={name:"size",options:d=u={...ew,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:o}=t.reference,l=e.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${i}px`),l.setProperty("--radix-popper-anchor-height",`${o}px`)}},async fn(e){var t,n;let r,i,{placement:o,rects:l,platform:a,elements:s}=e,{apply:c=()=>{},...u}=U(d,e),f=await a.detectOverflow(e,u),p=V(o),m=Y(o),x="y"===q(o),{width:h,height:v}=l.floating;"top"===p||"bottom"===p?(r=p,i=m===(await (null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,r="end"===m?"top":"bottom");let g=v-f.top-f.bottom,b=h-f.left-f.right,y=M(v-f[r],g),w=M(h-f[i],b),j=!e.middlewareData.shift,N=y,C=w;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(C=b),null!=(n=e.middlewareData.shift)&&n.enabled.y&&(N=g),j&&!m){let e=_(f.left,0),t=_(f.right,0),n=_(f.top,0),r=_(f.bottom,0);x?C=h-2*(0!==e||0!==t?e+t:_(f.left,f.right)):N=v-2*(0!==n||0!==r?n+r:_(f.top,f.bottom))}await c({...e,availableWidth:C,availableHeight:N});let S=await a.getDimensions(s.floating);return h!==S.width||v!==S.height?{reset:{rects:!0}}:{}}}).name,fn:j.fn,options:[u,void 0]},ef&&{name:(N={name:"arrow",options:p=f={element:ef,padding:O},fn(e){let{element:t,padding:n}="function"==typeof p?p(e):p;return t&&({}).hasOwnProperty.call(t,"current")?null!=t.current?eX({element:t.current,padding:n}).fn(e):{}:t?eX({element:t,padding:n}).fn(e):{}}}).name,fn:N.fn,options:[f,void 0]},tl({arrowWidth:eh,arrowHeight:ev}),F&&{name:(C={name:"hide",options:h=m={strategy:"referenceHidden",...ew,boundary:ey?ew.boundary:void 0},async fn(e){let{rects:t,platform:n}=e,{strategy:r="referenceHidden",...i}=U(h,e);switch(r){case"referenceHidden":{let r=ea(await n.detectOverflow(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:es(r)}}}case"escaped":{let r=ea(await n.detectOverflow(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:es(r)}}}default:return{}}}}).name,fn:C.fn,options:[m,void 0]}]}),eR=er.setPlacementState;D(()=>(eR(eC),()=>{eR(void 0)}),[eC,eR]);let[ek,eT]=ta(eC),eA=R(W);D(()=>{eS&&eA?.()},[eS,eA]);let eO=eE.arrow?.x,eD=eE.arrow?.y,eI=eE.arrow?.centerOffset!==0,[eB,eM]=x.useState();return D(()=>{ei&&eM(window.getComputedStyle(ei).zIndex)},[ei]),(0,i.jsx)("div",{ref:ej.setFloating,"data-radix-popper-content-wrapper":"",style:{...eN,transform:eS?eN.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eB,"--radix-popper-transform-origin":[eE.transformOrigin?.x,eE.transformOrigin?.y].join(" "),...eE.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,i.jsx)(e7,{scope:S,placedSide:ek,placedAlign:eT,onArrowChange:ep,arrowX:eO,arrowY:eD,shouldHideArrow:eI,children:(0,i.jsx)(E.div,{"data-side":ek,"data-align":eT,...en,ref:ed,style:{...en.style,animation:eS?void 0:"none"}})})})});tt.displayName=e9;var tn="PopperArrow",tr={top:"bottom",right:"left",bottom:"top",left:"right"},ti=x.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,o=te(tn,n),l=tr[o.placedSide];return(0,i.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,i.jsx)(eQ,{...r,ref:t,style:{...r.style,display:"block"}})})});function to(e){return null!==e}ti.displayName=tn;var tl=e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,l=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[s,c]=ta(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(i.arrow?.x??0)+l/2,f=(i.arrow?.y??0)+a/2,p="",m="";return"bottom"===s?(p=o?u:`${d}px`,m=`${-a}px`):"top"===s?(p=o?u:`${d}px`,m=`${r.floating.height+a}px`):"right"===s?(p=`${-a}px`,m=o?u:`${f}px`):"left"===s&&(p=`${r.floating.width+a}px`,m=o?u:`${f}px`),{data:{x:p,y:m}}}});function ta(e){let[t,n="center"]=e.split("-");return[t,n]}var ts=x.forwardRef((e,t)=>{let{container:n,...r}=e,[o,l]=x.useState(!1);D(()=>l(!0),[]);let a=n||o&&globalThis?.document?.body;return a?w.createPortal((0,i.jsx)(E.div,{...r,ref:t}),a):null});ts.displayName="Portal";var tc=e=>{var t;let n,r,{present:i,children:o}=e,l=function(e){var t,n;let[r,i]=x.useState(),o=x.useRef(null),l=x.useRef(e),a=x.useRef("none"),s=x.useRef(void 0),[c,u]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},x.useReducer((e,t)=>n[e][t]??e,t));return x.useEffect(()=>{"mounted"===c?(a.current=s.current??td(o.current),s.current=void 0):a.current="none"},[c]),D(()=>{let t=o.current,n=l.current;if(n!==e){let r=a.current,i=td(t);e?(s.current=i,u("MOUNT")):"none"===i||t?.display==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),l.current=e}},[e,u]),D(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=td(o.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(u("ANIMATION_END"),!l.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},i=e=>{e.target===r&&(a.current=td(o.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:x.useCallback(e=>{if(e){let t=getComputedStyle(e);o.current=t,s.current=td(t)}else o.current=null;i(e)},[])}}(i),a="function"==typeof o?o({present:l.isPresent}):x.Children.only(o),s=function(...e){let t=x.useRef(e);return t.current=e,x.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=tu(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():tu(n[e],null)}}},[])}(l.ref,(t=a,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||l.isPresent?x.cloneElement(a,{ref:s}):null};function tu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function td(e){return e?.animationName||"none"}tc.displayName="Presence",x[" useEffectEvent ".trim().toString()],x[" useInsertionEffect ".trim().toString()];var tf=x[" useInsertionEffect ".trim().toString()]||D;Symbol("RADIX:SYNC_STATE");var tp=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),tm=x.forwardRef((e,t)=>(0,i.jsx)(E.span,{...e,ref:t,style:{...tp,...e.style}}));tm.displayName="VisuallyHidden";var[tx,th]=y("Tooltip",[e5]),tv=e5(),tg="TooltipProvider",tb="tooltip.open",[ty,tw]=tx(tg),tj=e=>{let{__scopeTooltip:t,delayDuration:n=700,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:l}=e,a=x.useRef(!0),s=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,i.jsx)(ty,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),a.current=!1)},[r]),onClose:x.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:x.useCallback(e=>{s.current=e},[]),disableHoverableContent:o,children:l})};tj.displayName=tg;var tN="Tooltip",[tC,tS]=tx(tN),tE=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:l,disableHoverableContent:a,delayDuration:s}=e,c=tw(tN,e.__scopeTooltip),u=tv(t),[d,f]=x.useState(null),p=function(){let[e,t]=x.useState(I());return D(()=>{t(e=>e??String(B++))},[void 0]),e?`radix-${e}`:""}(),m=x.useRef(0),h=a??c.disableHoverableContent,v=s??c.delayDuration,g=x.useRef(!1),[b,y]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,o,l]=function({defaultProp:e,onChange:t}){let[n,r]=x.useState(e),i=x.useRef(n),o=x.useRef(t);return tf(()=>{o.current=t},[t]),x.useEffect(()=>{i.current!==n&&(o.current?.(n),i.current=n)},[n,i]),[n,r,o]}({defaultProp:t,onChange:n}),a=void 0!==e,s=a?e:i;{let t=x.useRef(void 0!==e);x.useEffect(()=>{let e=t.current;if(e!==a){let t=a?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=a},[a,r])}return[s,x.useCallback(t=>{if(a){let n="function"==typeof t?t(e):t;n!==e&&l.current?.(n)}else o(t)},[a,e,o,l])]}({prop:r,defaultProp:o??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(tb))):c.onClose(),l?.(e)},caller:tN}),w=x.useMemo(()=>b?g.current?"delayed-open":"instant-open":"closed",[b]),j=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,y(!0)},[y]),N=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,y(!0),m.current=0},v)},[v,y]);return x.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),(0,i.jsx)(e4,{...u,children:(0,i.jsx)(tC,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:d,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?C():j()},[c.isOpenDelayedRef,C,j]),onTriggerLeave:x.useCallback(()=>{h?N():(window.clearTimeout(m.current),m.current=0)},[N,h]),onOpen:j,onClose:N,disableHoverableContent:h,children:n})})};tE.displayName=tN;var tR="TooltipTrigger",tk=x.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=tS(tR,n),l=tw(tR,n),a=tv(n),s=b(t,x.useRef(null),o.onTriggerChange),c=x.useRef(!1),u=x.useRef(!1),d=x.useCallback(()=>c.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,i.jsx)(e8,{asChild:!0,...a,children:(0,i.jsx)(E.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:s,onPointerMove:v(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||l.isPointerInTransitRef.current||(o.onTriggerEnter(),u.current=!0))}),onPointerLeave:v(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:v(e.onPointerDown,()=>{o.open&&o.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:v(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:v(e.onBlur,o.onClose),onClick:v(e.onClick,o.onClose)})})});tk.displayName=tR;var tT="TooltipPortal",[tL,tA]=tx(tT,{forceMount:void 0}),tO=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,l=tS(tT,t);return(0,i.jsx)(tL,{scope:t,forceMount:n,children:(0,i.jsx)(tc,{present:n||l.open,children:(0,i.jsx)(ts,{asChild:!0,container:o,children:r})})})};tO.displayName=tT;var tP="TooltipContent",tD=x.forwardRef((e,t)=>{let n=tA(tP,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...l}=e,a=tS(tP,e.__scopeTooltip);return(0,i.jsx)(tc,{present:r||a.open,children:a.disableHoverableContent?(0,i.jsx)(t_,{side:o,...l,ref:t}):(0,i.jsx)(tI,{side:o,...l,ref:t})})}),tI=x.forwardRef((e,t)=>{let n=tS(tP,e.__scopeTooltip),r=tw(tP,e.__scopeTooltip),o=x.useRef(null),l=b(t,o),[a,s]=x.useState(null),{trigger:c,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=x.useCallback(()=>{s(null),f(!1)},[f]),m=x.useCallback((e,t)=>{let n,r=e.currentTarget,i={x:e.clientX,y:e.clientY},o=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw Error("unreachable")}}(i,r.getBoundingClientRect());s(((n=[...function(e,t,n=5){let r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(i,o),...function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())].slice()).sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:1*!!(e.y>t.y)),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(n))),f(!0)},[f]);return x.useEffect(()=>()=>p(),[p]),x.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener("pointerleave",e),d.addEventListener("pointerleave",t),()=>{c.removeEventListener("pointerleave",e),d.removeEventListener("pointerleave",t)}}},[c,d,m,p]),x.useEffect(()=>{if(a){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let l=t[e],a=t[o],s=l.x,c=l.y,u=a.x,d=a.y;c>r!=d>r&&n<(u-s)*(r-c)/(d-c)+s&&(i=!i)}return i}(n,a);r?p():i&&(p(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[c,d,a,u,p]),(0,i.jsx)(t_,{...e,ref:l})}),[tB,t$]=tx(tN,{isInside:!1}),tM=((n=e=>"child"in e?e.children(e.child):e.children).displayName="TooltipContent.Slottable",n.__radixId=j,n),t_=x.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:a,...s}=e,c=tS(tP,n),u=tv(n),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(tb,d),()=>document.removeEventListener(tb,d)),[d]),x.useEffect(()=>{if(c.trigger){let e=e=>{e.target instanceof Node&&e.target.contains(c.trigger)&&d()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,d]),(0,i.jsx)(L,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,i.jsxs)(tt,{"data-state":c.stateAttribute,...u,...s,ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,i.jsx)(tM,{children:r}),(0,i.jsx)(tB,{scope:n,isInside:!0,children:(0,i.jsx)(tm,{id:c.contentId,role:"tooltip",children:o||r})})]})})});tD.displayName=tP;var tF="TooltipArrow",tz=x.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=tv(n);return t$(tF,n).isInside?null:(0,i.jsx)(ti,{...o,...r,ref:t})});function tH({delayDuration:e=0,...t}){return(0,i.jsx)(tj,{delayDuration:e,...t})}function tW(e){return(0,i.jsx)(tH,{children:(0,i.jsx)(tE,{...e})})}function tU(e){return(0,i.jsx)(tk,{...e})}function tV({className:e,sideOffset:t=4,children:n,...r}){return(0,i.jsx)(tO,{children:(0,i.jsxs)(tD,{sideOffset:t,className:(0,c.cn)("z-50 w-fit max-w-64 origin-(--radix-tooltip-content-transform-origin) rounded-md bg-primary px-3 py-1.5 text-xs text-balance text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r,children:[n,(0,i.jsx)(tz,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] fill-primary"})]})})}tz.displayName=tF;var tY=e.i(1485);let tX=[{app:"claude",label:"Claude",icon:"claude"},{app:"codex",label:"Codex",icon:"codex"},{app:"vscode",label:"VS Code",icon:"ext"},{app:"cmux",label:"cmux",icon:"terminal"},{app:"herdr",label:"Herdr",icon:"terminal"},{app:"iterm2",label:"iTerm2",icon:"terminal"},{app:"finder",label:"Finder",icon:"folder"}];function tK({url:e}){let[t,n]=(0,x.useState)(!1),r=(0,x.useRef)(null);(0,x.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let o=(0,x.useCallback)(async()=>{try{await navigator.clipboard.writeText(e),n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1500)}catch{}},[e]);return(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",onClick:o,children:[t?(0,i.jsx)(a.Icons.check,{}):(0,i.jsx)(a.Icons.copy,{}),t?"Copied":"Copy URL"]})}function tq({reason:e,children:t}){return e?(0,i.jsxs)(tW,{children:[(0,i.jsx)(tU,{asChild:!0,children:(0,i.jsx)("span",{className:"cursor-not-allowed",children:t})}),(0,i.jsx)(tV,{children:e})]}):(0,i.jsx)(i.Fragment,{children:t})}function tG({box:e}){let{webUrl:t,vncUrl:n}=e,{apps:r,supported:o,pending:l,launch:s}=function(e){let[t,n]=(0,x.useState)(null),[r,i]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/v1/open-targets",{credentials:"same-origin"});e&&n(t.ok?await t.json():null)}catch{e&&n(null)}})(),()=>{e=!1}},[]);let o=(0,x.useCallback)(async t=>{i(t);try{let n=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:t})});if(!n.ok){let e=await n.json().catch(()=>null);window.alert(`Open in ${t} failed: ${e?.error?.message??`HTTP ${n.status}`}`)}}catch(e){window.alert(`Open in ${t} failed: ${e instanceof Error?e.message:String(e)}`)}finally{i(null)}},[e.id]),l=t?.supported?t.targets:null;return{apps:l?tX.map(({app:t,label:n,icon:r})=>{let i=l[t],o=i.available?i.providers&&!i.providers.includes(e.provider)?`Not available for ${e.provider} boxes`:null:i.reason??`${n} is not installed`;return{app:t,label:n,icon:r,disabledReason:o}}):[],supported:null!==l,pending:r,launch:o}}(e),c="paused"===e.status?"Box is paused — resume to access":"stopped"===e.status?"Box is stopped — start to access":null,u=t?null:c??"No web service exposed",f=n??(e.vncEnabled&&"running"===e.status?`/boxes/${encodeURIComponent(e.id)}/vnc`:null),p=f?null:!1===e.vncEnabled?"VNC is not enabled for this box":c??"VNC is not available";return o||t||f?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tY.SectionLabel,{children:"Access"}),(0,i.jsxs)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:t||!f?"Web":"VNC"}),(0,i.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:t??(f?"Remote desktop":u)})]}),(0,i.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[t?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",href:t,target:"_blank",rel:"noreferrer",children:[(0,i.jsx)(a.Icons.ext,{}),"Open web"]}):(0,i.jsx)(tq,{reason:u,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,i.jsx)(a.Icons.ext,{}),"Open web"]})}),t?(0,i.jsx)(tK,{url:t}):null,f?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",href:f,target:"_blank",rel:"noreferrer",onClick:()=>{n&&fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/screen`,{method:"POST",credentials:"same-origin"}).catch(()=>{})},children:[(0,i.jsx)(a.Icons.ext,{}),"Open VNC"]}):(0,i.jsx)(tq,{reason:p,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,i.jsx)(a.Icons.ext,{}),"Open VNC"]})})]})]}),o?(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,i.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,i.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:r.map(({app:e,label:t,icon:n,disabledReason:r})=>{let o=a.Icons[n];return(0,i.jsx)(tq,{reason:r,children:(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:null!==r||null!==l,onClick:()=>void s(e),children:[(0,i.jsx)(o,{}),t]})},e)})})]}):null]})]}):null}var tJ=e.i(80922),tZ=e.i(30544),tQ=e.i(51096);function t0({k:e,v:t,mono:n,link:r}){return(0,i.jsxs)("div",{className:"grid grid-cols-[156px_1fr] items-baseline gap-4 px-4.5 p-3 max-sm:grid-cols-1 max-sm:gap-1",children:[(0,i.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:e}),(0,i.jsx)("div",{className:(0,c.cn)("min-w-0 text-[13.5px]",n?"font-mono text-[13px]":""),children:r?(0,i.jsx)(tQ.default,{className:"cursor-pointer text-primary",href:r,children:t}):t})]})}var t1=e.i(31758),t5=e.i(95141),t2=e.i(3060),t3=e.i(16200),t4=e.i(49604),t6=e.i(9383);let t8=(0,t6.createServerReference)("70137307c04959a7a87b0e738c2d22a7c0eafade51",t6.callServer,void 0,t6.findSourceMapURL,"gitBranchAction"),t9=(0,t6.createServerReference)("60a2d1c9acc13909e16f84535e8738b59d8e0fa45b",t6.callServer,void 0,t6.findSourceMapURL,"gitCheckoutAction"),t7=(0,t6.createServerReference)("60551254c747186d54906f2f9805c02811f233a085",t6.callServer,void 0,t6.findSourceMapURL,"gitPullAction"),ne=(0,t6.createServerReference)("602fbbc8a351885a63f297205c405aa663802175db",t6.callServer,void 0,t6.findSourceMapURL,"gitPushAction"),nt=(0,t6.createServerReference)("60825f263c633940d187614c03fcfc77deeb86554d",t6.callServer,void 0,t6.findSourceMapURL,"gitPushHostAction"),nn=0;function nr({toasts:e,dismiss:t}){return(0,i.jsx)("div",{className:"pointer-events-none fixed bottom-5 right-5 z-[60] flex w-[340px] max-w-[calc(100vw-40px)] flex-col gap-2",children:e.map(e=>(0,i.jsxs)("div",{className:"anim-pop pointer-events-auto relative flex items-start gap-3 rounded-xl border border-border bg-card p-3.5 pr-9 shadow-[0_16px_40px_-18px_rgba(20,24,30,.35)]",children:[(0,i.jsx)("span",{className:(0,c.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===e.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===e.variant?(0,i.jsx)(a.Icons.warn,{className:"size-3.5"}):(0,i.jsx)(a.Icons.check,{className:"size-3.5"})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:e.title}),e.detail?(0,i.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:e.detail}):null]}),(0,i.jsx)("button",{className:"absolute right-2.5 top-2.5 grid h-5 w-5 cursor-pointer place-items-center rounded border-0 bg-transparent text-[#a4a9b0] hover:text-foreground",onClick:()=>t(e.id),"aria-label":"Dismiss",children:(0,i.jsx)(a.Icons.x,{className:"size-3"})})]},e.id))})}function ni({label:e,desc:t,children:n}){return(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,i.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,i.jsx)("div",{className:"text-[13.5px] font-medium",children:e}),(0,i.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:t})]}),(0,i.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:n})]})}function no({icon:e,disabled:t,onRun:n,children:r}){let[o,l]=(0,x.useState)(!1),a=async()=>{l(!0);try{await n()}finally{l(!1)}};return(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:t||o,onClick:a,children:[o?(0,i.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,i.jsx)(e,{}),r]})}function nl(e,t){let n=(e??"").trim()||(t??"").trim();return n?n.split("\n")[0]:void 0}function na({box:e}){let t=(0,o.useRouter)(),{toasts:n,push:r,dismiss:l}=function(){let[e,t]=(0,x.useState)([]),n=(0,x.useCallback)(e=>t(t=>t.filter(t=>t.id!==e)),[]);return{toasts:e,push:(0,x.useCallback)(e=>{let r=++nn;t(t=>[...t,{id:r,...e}]),setTimeout(()=>n(r),4200)},[n]),dismiss:n}}(),[s,u]=(0,x.useState)(null),[f,p]=(0,x.useState)(null),m="running"!==e.status,v=(0,x.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e.id)}/git`,{credentials:"same-origin"});u(t.ok?await t.json():null)}catch{u(null)}},[e.id]);(0,x.useEffect)(()=>{v()},[v]);let g=s?.ok&&s.branch?s.branch:e.branch||"—",b=()=>{v(),t.refresh()},y=async(e,t)=>{let n=await t();n.ok?(r({title:e,detail:nl(n.stdout,n.stderr)}),b()):r({variant:"error",title:`${e} failed`,detail:n.error})};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.Card,{className:(0,c.cn)("divide-y divide-border/60 overflow-hidden",m?"opacity-90":""),children:[m?(0,i.jsxs)("div",{className:"flex items-center gap-2.5 bg-[var(--amber-soft)] px-4.5 p-2.5 text-[12.5px] text-[var(--amber)]",children:[(0,i.jsx)(a.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",e.status," — git operations need a running box."]}):null,(0,i.jsxs)(ni,{label:"Sync",desc:`origin ↔ ${g}`,children:[(0,i.jsx)(no,{icon:a.Icons.arrowL,disabled:m,onRun:()=>y("Pulled from origin",()=>t7(e.id)),children:"Pull"}),(0,i.jsx)(no,{icon:a.Icons.ext,disabled:m,onRun:()=>y("Pushed to origin",()=>ne(e.id)),children:"Push"}),(0,i.jsx)(no,{icon:a.Icons.host,disabled:m,onRun:()=>y("Pushed to host",()=>nt(e.id)),children:"Push to host"})]}),(0,i.jsxs)(ni,{label:"Branch",desc:`currently on ${g}`,children:[(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:m,onClick:()=>p("change"),children:[(0,i.jsx)(a.Icons.branch,{}),"Change branch"]}),(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:m,onClick:()=>p("new"),children:[(0,i.jsx)(a.Icons.plus,{}),"New branch"]})]})]}),"change"===f?(0,i.jsx)(nu,{box:e,branch:g,onClose:()=>p(null),onDone:r,onRefresh:b}):null,"new"===f?(0,i.jsx)(nd,{box:e,onClose:()=>p(null),onDone:r,onRefresh:b}):null,(0,i.jsx)(nr,{toasts:n,dismiss:l})]})}let ns="__manual__";function nc({boxId:e,value:t,onChange:n,id:r,headLabel:o,currentBranch:l}){let[a,s]=(0,x.useState)(null),[c,u]=(0,x.useState)(l??null),[d,f]=(0,x.useState)(!1);return((0,x.useEffect)(()=>{let t=!1;return(async()=>{try{let n=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/branches`,{credentials:"same-origin"}),r=n.ok?await n.json():null;if(t)return;r&&Array.isArray(r.branches)&&r.branches.length>0?(s(r.branches),l||"string"!=typeof r.current||u(r.current)):(s([]),f(!0))}catch{t||(s([]),f(!0))}})(),()=>{t=!0}},[e,l]),null===a)?(0,i.jsx)(t4.Select,{id:r,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,i.jsx)("option",{value:"",children:"Loading branches…"})}):d?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t2.Input,{id:r,className:"font-mono text-[13px]",autoFocus:!0,value:t,onChange:e=>n(e.target.value),placeholder:o?"HEAD":"feature-x"}),a.length>0?(0,i.jsx)("button",{type:"button",onClick:()=>{f(!1),n("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,i.jsxs)(t4.Select,{id:r,value:t,wrapperClassName:"w-full",onChange:e=>{if(e.target.value===ns){f(!0),n("");return}n(e.target.value)},children:[o?(0,i.jsx)("option",{value:"",children:o}):(0,i.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,i.jsx)("option",{value:ns,children:"Other / type manually…"}),(0,i.jsx)("option",{disabled:!0,children:"────────────"}),a.map(e=>(0,i.jsxs)("option",{value:e,children:[e,e===c?" (current)":""]},e))]})}function nu({box:e,branch:t,onClose:n,onDone:r,onRefresh:o}){let[l,s]=(0,x.useState)(""),[c,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(null),p=l.trim().length>0;return(0,i.jsxs)(t5.Dialog,{onClose:n,className:"max-w-[440px]",children:[(0,i.jsxs)(t5.DialogHeader,{children:[(0,i.jsx)(t5.DialogIcon,{children:(0,i.jsx)(a.Icons.branch,{})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t5.DialogTitle,{children:"Change branch"}),(0,i.jsxs)(t5.DialogDescription,{children:[e.id," · currently on ",t]})]})]}),(0,i.jsxs)(t5.DialogBody,{children:[(0,i.jsx)(t3.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,i.jsx)(nc,{boxId:e.id,id:"gb-branch",value:l,onChange:s,currentBranch:t}),(0,i.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),d?(0,i.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:d}):null]}),(0,i.jsxs)(t5.DialogFooter,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:n,disabled:c,children:"Cancel"}),(0,i.jsxs)(h.Button,{onClick:()=>{p&&!c&&(u(!0),f(null),(async()=>{let t=await t9(e.id,l.trim());t.ok?(r({title:"Branch changed",detail:nl(t.stdout,t.stderr)}),n(),o()):(f(t.error),u(!1))})())},disabled:!p||c,children:[c?(0,i.jsx)("span",{className:"spin"}):(0,i.jsx)(a.Icons.check,{}),c?"Checking out…":"Change branch"]})]})]})}function nd({box:e,onClose:t,onDone:n,onRefresh:r}){let[o,l]=(0,x.useState)(""),[s,c]=(0,x.useState)(""),[u,d]=(0,x.useState)(!1),[f,p]=(0,x.useState)(null),m=o.trim().length>0,v=()=>{m&&!u&&(d(!0),p(null),(async()=>{let i=await t8(e.id,o.trim(),s.trim()||void 0);i.ok?(n({title:"Branch created",detail:nl(i.stdout,i.stderr)}),t(),r()):(p(i.error),d(!1))})())};return(0,i.jsxs)(t5.Dialog,{onClose:t,className:"max-w-[440px]",children:[(0,i.jsxs)(t5.DialogHeader,{children:[(0,i.jsx)(t5.DialogIcon,{children:(0,i.jsx)(a.Icons.branch,{})}),(0,i.jsxs)("div",{children:[(0,i.jsx)(t5.DialogTitle,{children:"New branch"}),(0,i.jsxs)(t5.DialogDescription,{children:[e.id," · branching in the box workspace"]})]})]}),(0,i.jsxs)(t5.DialogBody,{children:[(0,i.jsxs)("div",{className:"mb-4",children:[(0,i.jsx)(t3.Label,{htmlFor:"nb-name",children:"Name"}),(0,i.jsx)(t2.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:o,onChange:e=>l(e.target.value),onKeyDown:e=>{"Enter"===e.key&&v()},placeholder:"my-branch"}),(0,i.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,i.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,i.jsxs)(t3.Label,{htmlFor:"nb-from",children:["Base ref ",(0,i.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,i.jsx)(nc,{boxId:e.id,id:"nb-from",value:s,onChange:c,headLabel:"Current HEAD (default)"}),(0,i.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),f?(0,i.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:f}):null]}),(0,i.jsxs)(t5.DialogFooter,{children:[(0,i.jsx)(h.Button,{variant:"outline",onClick:t,disabled:u,children:"Cancel"}),(0,i.jsxs)(h.Button,{onClick:v,disabled:!m||u,children:[u?(0,i.jsx)("span",{className:"spin"}):(0,i.jsx)(a.Icons.plus,{}),u?"Creating…":"Create branch"]})]})]})}let nf=(0,t6.createServerReference)("609ba80514592f08c476672e7d77ab956504674bb6",t6.callServer,void 0,t6.findSourceMapURL,"restartServiceAction"),np=new Set(["ready","running","done"]),nm=new Set(["crashed","unhealthy","backoff","failed"]),nx={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},nh={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function nv({svc:e,disabled:t,onRestart:n}){var r;let o=(r=e.state,np.has(r)?"up":nm.has(r)?"bad":"idle");return(0,i.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,i.jsx)("span",{className:(0,c.cn)("badge-dot",nx[o]),"aria-hidden":!0}),(0,i.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:e.name}),(0,i.jsx)("span",{className:(0,c.cn)("font-mono text-xs",nh[o]),children:e.state}),e.restarts>0?(0,i.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",e.restarts]}):null,(0,i.jsx)(h.Button,{variant:"outline",size:"icon-sm",title:`Restart ${e.name}`,disabled:t,onClick:()=>n(e.name),children:(0,i.jsx)(a.Icons.refresh,{})})]})}function ng({id:e,running:t}){let[n,r]=(0,x.useState)(null),[o,l]=(0,x.useState)(null),[s,c]=(0,x.useTransition)(),u=(0,x.useCallback)(async()=>{try{let t=await fetch(`/api/v1/boxes/${encodeURIComponent(e)}/services`,{credentials:"same-origin"});if(!t.ok)return void l(`status ${String(t.status)}`);r(await t.json()),l(null)}catch(e){l(e instanceof Error?e.message:String(e))}},[e]);(0,x.useEffect)(()=>{if(u(),!t)return;let e=setInterval(()=>void u(),4e3);return()=>clearInterval(e)},[u,t]);let f=t=>{c(async()=>{let n=await nf(e,t);n.ok||window.alert(`Restart failed: ${n.error}`),await u()})},p=n?.services??[],m=p.length>0;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tY.SectionLabel,{right:m?(0,i.jsxs)(h.Button,{variant:"outline",size:"sm",disabled:!t||s,onClick:()=>f(void 0),children:[(0,i.jsx)(a.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,i.jsx)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:n||o?o?(0,i.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",o,")."]}):m?(0,i.jsxs)(i.Fragment,{children:[n?.source==="persisted"?(0,i.jsx)("div",{className:"bg-muted/30 px-4 py-1.5 font-mono text-[11px] text-muted-foreground",children:"persisted snapshot — box not running"}):null,p.map(e=>(0,i.jsx)(nv,{svc:e,disabled:!t||s,onRestart:e=>f(e)},e.name))]}):(0,i.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:n?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,i.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var nb=e.i(35594);e.s(["default",0,function(){let{id:e}=(0,o.useParams)(),{box:t,project:n}=(0,f.useStore)(),r=t(e);if(!r)return(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,i.jsx)(tJ.BackLink,{to:"/",children:"All boxes"}),(0,i.jsx)(t1.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let c=n(r.projectId);return(0,i.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,i.jsx)(tJ.BackLink,{to:"/projects/"+r.projectId,children:c?c.name:"Project"}),(0,i.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[r.task,(0,i.jsx)(s.StatusBadge,{status:r.status})]}),(0,i.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.id})," ·"," ",(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.repo})," · ",r.host]})]}),(0,i.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,i.jsx)(tZ.BoxActions,{box:r,size:"lg"})})]}),r.error?(0,i.jsx)(u,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:a.Icons.warn,title:"Box errored",children:(0,i.jsx)("span",{className:"font-mono text-secondary-foreground",children:r.error})}):null,(0,i.jsx)(m,{boxId:r.id}),(0,i.jsx)(tY.SectionLabel,{children:"Overview"}),(0,i.jsxs)(nb.StatGrid,{children:[(0,i.jsx)(nb.Stat,{k:"Status",v:(0,i.jsx)(s.StatusBadge,{status:r.status})}),(0,i.jsx)(nb.Stat,{k:"Agent CLI",v:r.agent,mono:!0}),(0,i.jsx)(nb.Stat,{k:"Commits",v:r.commits??"—",icon:a.Icons.commit}),(0,i.jsx)(nb.Stat,{k:"Files touched",v:r.filesTouched??"—",icon:a.Icons.file}),(0,i.jsx)(nb.Stat,{k:"Last activity",v:(0,i.jsx)(l.Ago,{ms:r.lastActivity}),mono:!0})]}),(0,i.jsx)(tG,{box:r}),(0,i.jsx)(tY.SectionLabel,{children:"Git operations"}),(0,i.jsx)(na,{box:r}),(0,i.jsx)(ng,{id:r.id,running:"running"===r.status}),(0,i.jsx)(tY.SectionLabel,{children:"Details"}),(0,i.jsxs)(d.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,i.jsx)(t0,{k:"Box ID",v:r.id,mono:!0}),(0,i.jsx)(t0,{k:"Project",v:c?c.name:"—",link:c?"/projects/"+r.projectId:null}),(0,i.jsx)(t0,{k:"Repository",v:r.repo,mono:!0}),(0,i.jsx)(t0,{k:"Branch",v:r.branch,mono:!0}),(0,i.jsx)(t0,{k:"Host",v:r.host,mono:!0}),(0,i.jsx)(t0,{k:"Created",v:new Date(r.createdAt).toLocaleString(),mono:!0})]})]})}],77084)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8536,e=>{"use strict";var t=e.i(1262),s=e.i(65232);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("p-5 pt-0",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("text-[12.5px] text-muted-foreground",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1 p-5",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...a})}])},33789,51497,1485,e=>{"use strict";var t=e.i(1262),s=e.i(54129);function a(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let s=Math.floor(t/60);if(s<60)return s+"m ago";let a=Math.floor(s/60);return a<24?a+"h ago":Math.floor(a/24)+"d ago"}e.s(["fmtAgo",0,a,"fmtBytes",0,function(e){return e<1024?e+"B":e<1048576?(e/1024).toFixed(1)+"KB":(e/1048576).toFixed(1)+"MB"}],51497),e.s(["Ago",0,function({ms:e}){let[n,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>r(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:n?a(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:s}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),s??null]})}],1485)},3060,e=>{"use strict";var t=e.i(1262),s=e.i(65232);e.s(["Input",0,function({className:e,...a}){return(0,t.jsx)("input",{className:(0,s.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...a})}])},95141,e=>{"use strict";var t=e.i(1262),s=e.i(54129),a=e.i(65232),n=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:r,children:l}){return(0,s.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,a.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",r),onClick:e=>e.stopPropagation(),children:[l,(0,t.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,t.jsx)(n.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("px-5 py-4",e),...s})},"DialogDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...s})},"DialogFooter",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...s})},"DialogHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...s})},"DialogIcon",0,function({children:e}){return(0,t.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("text-base font-semibold leading-tight tracking-tight",e),...s})}])},86184,e=>{"use strict";var t=e.i(1262),s=e.i(54129),a=e.i(69377),n=e.i(3060);function r({jobId:e,login:l}){let[o,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(!1),[u,x]=(0,s.useState)(null),m="exchanging"===l.phase,p=async()=>{let t=o.trim();if(t&&!d){c(!0),x(null);try{let s=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!s.ok){let e=await s.json().catch(()=>null);x(e?.error?.message??`request failed (${s.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{c(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),l.url?(0,t.jsx)("a",{href:l.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(n.Input,{value:o,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(a.Button,{type:"button",onClick:()=>void p(),disabled:!o.trim()||d||m,children:m?"Verifying…":d?"Submitting…":"Submit"})]}),l.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:l.lastError}):null,"error"===l.phase&&l.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:l.error}):null,u?(0,t.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:a,onDone:n,onStatus:l,onLogin:o}){let[i,d]=(0,s.useState)([]),[c,u]=(0,s.useState)(null),x=(0,s.useRef)(null),m=(0,s.useRef)(n);m.current=n;let p=(0,s.useRef)(l);p.current=l;let h=(0,s.useRef)(o);return h.current=o,(0,s.useEffect)(()=>{p.current?.("streaming");let t=new EventSource(a??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);d(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);u(t),h.current?.(t)}),t.addEventListener("end",e=>{let s=JSON.parse(e.data);p.current?.(s.status),m.current?.(s.status),t.close()}),()=>t.close()},[e,a]),(0,s.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[c&&"done"!==c.phase?(0,t.jsx)(r,{jobId:e,login:c}):null,(0,t.jsx)("pre",{ref:x,className:"max-h-[440px] min-h-[220px] overflow-auto whitespace-pre rounded-lg bg-[#16181c] p-3 font-mono text-[11.5px] leading-relaxed text-[#d6d9de]",children:0===i.length?"starting…":i.join("\n")})]})}])},50557,e=>{"use strict";var t=e.i(1262),s=e.i(54129),a=e.i(33789),n=e.i(44344),r=e.i(64595),l=e.i(8536),o=e.i(65232);function i({className:e,...s}){return(0,t.jsx)("div",{className:(0,o.cn)("h-px w-full shrink-0 bg-border",e),...s})}var d=e.i(96621),c=e.i(1485),u=e.i(45971),x=e.i(69377),m=e.i(3060),p=e.i(86184),h=e.i(95141);let g=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function f(e,t){return e?.error?.message??`request failed (${t})`}function b({onCount:e}){let[a,l]=(0,s.useState)(null),[o,i]=(0,s.useState)(null),[d,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(null),[v,N]=(0,s.useState)({}),[y,k]=(0,s.useState)(null),[S,w]=(0,s.useState)(null),C=(0,s.useCallback)(async()=>{try{let t=await fetch("/api/v1/hosts",{credentials:"same-origin"});if(!t.ok)return void i(f(await t.json().catch(()=>null),t.status));let s=(await t.json()).hosts??[];l(s),i(null),e?.(s.length)}catch(e){i(e instanceof Error?e.message:String(e))}},[e]);(0,s.useEffect)(()=>{C()},[C]);let B=async e=>{k(null),w(e);try{let t=await fetch(`/api/v1/hosts/${encodeURIComponent(e)}/bake`,{method:"POST",credentials:"same-origin"}),s=await t.json().catch(()=>null);if(!t.ok||!s?.jobId)return void k(`${e}: ${f(s,t.status)}`);let a=s.jobId;N(t=>({...t,[e]:a}))}catch(t){k(`${e}: ${t instanceof Error?t.message:String(t)}`)}finally{w(null)}},I=async e=>{if(window.confirm(`Remove host "${e}"? Boxes created on it become unreachable. The remote machine is untouched.`)){m(null),g(null),w(e);try{let t=await fetch(`/api/v1/hosts/${encodeURIComponent(e)}`,{method:"DELETE",credentials:"same-origin"});if(!t.ok)return void m(f(await t.json().catch(()=>null),t.status));let s=await t.json().catch(()=>null),a=s?.boxesAffected??[];a.length>0&&g(`Removed ${e}. ${a.length} box(es) are now unreachable: ${a.join(", ")}`),await C()}catch(e){m(e instanceof Error?e.message:String(e))}finally{w(null)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[o?(0,t.jsxs)("div",{className:"text-xs text-red-400",children:["Could not load hosts: ",o]}):null,a&&0===a.length?(0,t.jsx)("div",{className:"text-[12.5px] text-muted-foreground",children:"No hosts yet — add a machine you can SSH into to run boxes on its Docker engine."}):null,a?.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[13px] font-semibold",children:e.alias}),e.default?(0,t.jsx)(r.Badge,{className:"normal-case",children:"default"}):null,e.baked?null:(0,t.jsx)(r.Badge,{className:"badge-warn normal-case",children:"not baked"})]}),(0,t.jsx)("div",{className:"truncate font-mono text-[11.5px] text-muted-foreground",children:e.ssh})]}),(0,t.jsxs)(x.Button,{type:"button",size:"sm",variant:"outline",disabled:S===e.alias||!!v[e.alias],onClick:()=>void B(e.alias),title:"Bake the box image on this host",children:[(0,t.jsx)(n.Icons.refresh,{className:"size-3.5"}),v[e.alias]?"Baking…":e.baked?"Re-bake":"Bake"]}),(0,t.jsxs)(x.Button,{type:"button",size:"sm",variant:"destructive",disabled:S===e.alias||!!v[e.alias],onClick:()=>void I(e.alias),children:[(0,t.jsx)(n.Icons.trash,{className:"size-3.5"}),"Remove"]})]}),v[e.alias]?(0,t.jsx)(p.JobLogStream,{jobId:v[e.alias],endpoint:`/api/v1/jobs/${encodeURIComponent(v[e.alias])}/logs`,onDone:()=>{N(t=>{let s={...t};return delete s[e.alias],s}),C()}}):null]},e.alias)),y?(0,t.jsx)("div",{className:"text-xs text-red-400",children:y}):null,u?(0,t.jsx)("div",{className:"text-xs text-red-400",children:u}):null,h?(0,t.jsx)("div",{className:"text-xs text-amber-400",children:h}):null,(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)(x.Button,{type:"button",size:"sm",onClick:()=>c(!0),children:[(0,t.jsx)(n.Icons.plus,{className:"size-3.5"}),"Add host"]})}),d?(0,t.jsx)(j,{firstHost:(a?.length??0)===0,onClose:()=>c(!1),onAdded:()=>{c(!1),C()}}):null]})}function j({firstHost:e,onClose:a,onAdded:n}){let[r,l]=(0,s.useState)(""),[o,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(!1),[u,p]=(0,s.useState)(null),b=async()=>{let t=r.trim(),s=o.trim();if(!g.test(t))return void p("Alias must be a plain name (letters, digits, ., _, -; no @, :, /).");if(!s)return void p("SSH connection is required.");c(!0),p(null);try{let a=await fetch("/api/v1/hosts",{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({alias:t,ssh:s,default:e})});if(!a.ok)return void p(f(await a.json().catch(()=>null),a.status));n()}catch(e){p(e instanceof Error?e.message:String(e))}finally{c(!1)}};return(0,t.jsxs)(h.Dialog,{onClose:a,children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsx)(h.DialogTitle,{children:"Add Remote Docker host"})}),(0,t.jsxs)(h.DialogBody,{className:"flex flex-col gap-3",children:[(0,t.jsx)("p",{className:"text-[12.5px] text-muted-foreground",children:"Register a machine you can SSH into — AgentBox runs boxes on its Docker engine. The host is probed (ssh + docker) before it's saved."}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:"Alias"}),(0,t.jsx)(m.Input,{value:r,placeholder:"buildbox",autoFocus:!0,onChange:e=>l(e.target.value)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:"SSH connection"}),(0,t.jsx)(m.Input,{value:o,placeholder:"user@host (or an ~/.ssh/config alias)",className:"font-mono text-xs",onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&b()}})]}),u?(0,t.jsx)("div",{className:"text-xs text-red-400",children:u}):null]}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(x.Button,{type:"button",variant:"ghost",onClick:a,disabled:d,children:"Cancel"}),(0,t.jsx)(x.Button,{type:"button",onClick:()=>void b(),disabled:d,children:d?"Adding…":"Add host"})]})]})}let v={docker:[],e2b:[{key:"apiKey",label:"API key",placeholder:"e2b_…"}],daytona:[{key:"apiKey",label:"API key",placeholder:"dtn_…"}],hetzner:[{key:"token",label:"API token",placeholder:"project read+write token"}],vercel:[{key:"token",label:"Access token",placeholder:"vercel token"},{key:"teamId",label:"Team ID",placeholder:"team_… (optional)",optional:!0},{key:"projectId",label:"Project ID",placeholder:"prj_… (optional)",optional:!0}],digitalocean:[{key:"token",label:"API token",placeholder:"personal access token (read+write)"},{key:"project",label:"Project",placeholder:"name or UUID — blank leaves it unchanged",optional:!0}]};function N(){let{state:e}=(0,d.useStore)(),[a,n]=(0,s.useState)({});return(0,s.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!t.ok)return;let s=await t.json();if(e)return;let a={};for(let e of s.providers??[])a[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason};n(a)}catch{}})(),()=>{e=!0}},[e.providers]),(0,t.jsx)(l.Card,{id:"providers",className:"scroll-mt-6 divide-y divide-border/60 overflow-hidden",children:e.providers.map(e=>(0,t.jsx)(y,{provider:{...e,...a[e.id]}},e.id))})}function y({provider:e}){var a;let l=(0,u.useRouter)(),i=v[e.id]??[],d=new Set(i.filter(e=>!e.optional).map(e=>e.key)),[c,h]=(0,s.useState)({}),[g,f]=(0,s.useState)(()=>e.hasCredentials?Object.fromEntries(i.filter(e=>!e.optional).map(e=>[e.key,!0])):{}),[j,N]=(0,s.useState)(!1),[k,S]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[B,I]=(0,s.useState)(e.jobId??null),[E,A]=(0,s.useState)(!1),[D,R]=(0,s.useState)(null),$="remote-docker"===e.id,[z,O]=(0,s.useState)(null),P=async()=>{N(!0),S(null);try{let t={};for(let e of i){if(g[e.key])continue;let s=(c[e.key]??"").trim();s&&(t[e.key]=s)}let s=await fetch(`/api/v1/providers/${encodeURIComponent(e.id)}/credentials`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)});if(!s.ok){let e=await s.json().catch(()=>null);S(e?.error?.message??`request failed (${s.status})`);return}h({}),f(Object.fromEntries([...d].map(e=>[e,!0]))),C(!1),l.refresh()}catch(e){S(e instanceof Error?e.message:String(e))}finally{N(!1)}},T=async()=>{A(!0),R(null);try{let t=await fetch(`/api/v1/providers/${encodeURIComponent(e.id)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(e.configured?{force:!0}:{})}),s=await t.json().catch(()=>null);if(!t.ok||!s?.jobId)return void R(s?.error?.message??`request failed (${t.status})`);I(s.jobId)}catch(e){R(e instanceof Error?e.message:String(e))}finally{A(!1)}},H="hub"===e.origin,L="docker"===e.id||e.hasCredentials,U=i.length>0,_=!H&&(U||$);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 px-5",children:[(0,t.jsxs)("div",{className:(0,o.cn)("flex items-center gap-3",_&&"cursor-pointer"),onClick:_?()=>C(e=>!e):void 0,children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.label,$?null===z?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"…"}):0===z?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"no hosts"}):(0,t.jsxs)(r.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,t.jsx)("span",{className:"badge-dot"}),z," ",1===z?"host":"hosts"]}):(a=e).configured?"stale"===a.baseStatus?(0,t.jsx)(r.Badge,{className:"badge-warn gap-1.5 normal-case",title:a.baseStaleReason,children:"stale — re-bake"}):"unprepared"===a.baseStatus?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,t.jsxs)(r.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,t.jsx)("span",{className:"badge-dot"}),"ready"]}):a.hasCredentials?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):void 0===a.hasCredentials&&"hub"===a.origin?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"unknown"}):(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs credentials"}),H?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",title:"Boxes on this provider are created and baked on the control box, so this is its state — not this machine's.",children:"control box"}):null]}),$?(0,t.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:"No login — connects over your own SSH."}):e.reason?(0,t.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:e.reason}):null]}),H?(0,t.jsx)("a",{href:e.hubUrl?`${e.hubUrl}/settings`:void 0,target:"_blank",rel:"noreferrer",className:"flex-none text-[12.5px] text-muted-foreground underline underline-offset-2 hover:text-foreground",onClick:e=>e.stopPropagation(),children:"Manage on the control box ↗"}):$?null:(0,t.jsx)("div",{className:"flex flex-none items-center gap-2",onClick:e=>e.stopPropagation(),children:(0,t.jsxs)(x.Button,{type:"button",size:"sm",variant:e.configured?"outline":"default",disabled:!L||E||!!B,onClick:()=>void T(),title:L?void 0:"Add credentials first",children:[(0,t.jsx)(n.Icons.refresh,{className:"size-3.5"}),B?"Baking…":E?"Starting…":e.configured?"Re-bake":"Bake image"]})}),_?(0,t.jsx)(n.Icons.chevR,{className:(0,o.cn)("size-4 flex-none text-muted-foreground transition-transform",w&&"rotate-90")}):(0,t.jsx)("span",{className:"size-4 flex-none","aria-hidden":!0})]}),$?(0,t.jsx)("div",{className:(0,o.cn)(!w&&"hidden"),children:(0,t.jsx)(b,{onCount:O})}):null,!H&&w&&i.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[i.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:[e.label,e.optional?" (optional)":""]}),(0,t.jsx)(m.Input,{type:"password",autoComplete:"off",value:g[e.key]?"••••••••••••":c[e.key]??"",placeholder:e.placeholder,onFocus:()=>{g[e.key]&&(f(t=>({...t,[e.key]:!1})),h(t=>({...t,[e.key]:""})))},onBlur:()=>{d.has(e.key)&&!(c[e.key]??"").trim()&&f(t=>({...t,[e.key]:!0}))},onChange:t=>h(s=>({...s,[e.key]:t.target.value})),className:"font-mono text-xs"})]},e.key)),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)(x.Button,{type:"button",size:"sm",disabled:j,onClick:()=>void P(),children:j?"Saving…":"Save credentials"}),k?(0,t.jsx)("span",{className:"text-xs text-red-400",children:k}):null]})]}):null,D?(0,t.jsx)("div",{className:"text-xs text-red-400",children:D}):null,B?(0,t.jsx)(p.JobLogStream,{jobId:B,endpoint:`/api/v1/jobs/${encodeURIComponent(B)}/logs`,onDone:()=>{I(null),l.refresh()}}):null]})}e.s(["default",0,function(){let{state:e}=(0,d.useStore)(),u=e.github,[x,m]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=!0;return fetch("/api/v1/health",{credentials:"same-origin"}).then(e=>e.ok?e.json():null).then(t=>{e&&t?.version&&m(t.version)}).catch(()=>{}),()=>{e=!1}},[]),(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,t.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Settings"}),(0,t.jsx)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:"Providers, GitHub access & hub configuration."}),(0,t.jsx)(c.SectionLabel,{right:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:"credentials & base images"}),children:"Sandbox providers"}),(0,t.jsx)(N,{}),(0,t.jsx)(c.SectionLabel,{children:"GitHub App"}),u.available?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Card,{className:"overflow-hidden",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,t.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-foreground text-background",children:(0,t.jsx)(n.Icons.github,{className:"size-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:[u.appName,u.installed?(0,t.jsxs)(r.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,t.jsx)("span",{className:"badge-dot"}),"installed"]}):null]}),(0,t.jsx)("div",{className:"mt-0.5 font-mono text-[12.5px] text-muted-foreground",children:u.installed?`@${u.account}`:"Not installed"})]})]})}),(0,t.jsx)(c.SectionLabel,{right:(0,t.jsxs)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:[u.repos.length," repos"]}),children:"Authorized repositories"}),(0,t.jsx)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:u.repos.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("span",{className:"grid h-[30px] w-[30px] flex-none place-items-center rounded-md border border-border bg-background text-secondary-foreground",children:(0,t.jsx)(n.Icons.repo,{className:"size-[15px]"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block font-mono text-[13px] font-medium",children:e.full}),(0,t.jsxs)("span",{className:"mt-0.5 flex items-center gap-3 font-mono text-[11.5px] text-muted-foreground",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(n.LangDot,{lang:e.lang}),e.lang]}),(0,t.jsxs)("span",{children:["updated ",(0,t.jsx)(a.Ago,{ms:e.pushedAt})]}),(0,t.jsx)(r.Badge,{className:(0,o.cn)("px-1.5 py-0 text-[10px] uppercase tracking-[.03em]",e.private?"":"border-[var(--green-line)] text-primary"),children:e.private?"private":"public"})]})]})]},e.id))})]}):(0,t.jsxs)(l.Card,{className:"overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,t.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-secondary text-muted-foreground",children:(0,t.jsx)(n.Icons.github,{className:"size-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:["GitHub App",(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"not available"})]}),(0,t.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:"The GitHub App leases repo-scoped tokens to cloud boxes from the hosted hub. On a local machine boxes use your own git credentials directly, so there is nothing to configure here."})]})]}),(0,t.jsx)(i,{}),(0,t.jsxs)("div",{className:"flex items-start gap-3 p-4 px-5 text-[12.5px] text-muted-foreground",children:[(0,t.jsx)(n.Icons.shield,{className:"mt-0.5 size-[15px] flex-none text-primary"}),(0,t.jsx)("span",{children:"Available when the hub runs in a hosted profile (hetzner or vercel)."})]})]}),(0,t.jsxs)("div",{className:"mt-10 text-center font-mono text-[11px] text-muted-foreground",children:["AgentBox ",x??"…"]})]})}],50557)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8536,e=>{"use strict";var t=e.i(1262),s=e.i(65232);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("rounded-xl border border-border bg-card text-card-foreground",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("p-5 pt-0",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("text-[12.5px] text-muted-foreground",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1 p-5",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{className:(0,s.cn)("text-[15px] font-semibold leading-none tracking-tight",e),...a})}])},33789,51497,1485,e=>{"use strict";var t=e.i(1262),s=e.i(54129);function a(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return t+"s ago";let s=Math.floor(t/60);if(s<60)return s+"m ago";let a=Math.floor(s/60);return a<24?a+"h ago":Math.floor(a/24)+"d ago"}e.s(["fmtAgo",0,a,"fmtBytes",0,function(e){return e<1024?e+"B":e<1048576?(e/1024).toFixed(1)+"KB":(e/1048576).toFixed(1)+"MB"}],51497),e.s(["Ago",0,function({ms:e}){let[n,r]=(0,s.useState)(!1);return(0,s.useEffect)(()=>r(!0),[]),(0,t.jsx)("span",{suppressHydrationWarning:!0,children:n?a(e):new Date(e).toLocaleDateString()})}],33789),e.s(["SectionLabel",0,function({children:e,right:s}){return(0,t.jsxs)("div",{className:"mb-3 mt-8 flex items-center gap-2.5 font-mono text-[11px] uppercase tracking-[.1em] text-[#a4a9b0]",children:[e,(0,t.jsx)("span",{className:"h-px flex-1 bg-border"}),s??null]})}],1485)},3060,e=>{"use strict";var t=e.i(1262),s=e.i(65232);e.s(["Input",0,function({className:e,...a}){return(0,t.jsx)("input",{className:(0,s.cn)("flex h-10 w-full rounded-lg border border-input bg-card px-3 py-1 text-sm shadow-sm transition-[border-color,box-shadow] placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-primary focus-visible:ring-[3px] focus-visible:ring-primary/15",e),...a})}])},95141,e=>{"use strict";var t=e.i(1262),s=e.i(54129),a=e.i(65232),n=e.i(44344);e.s(["Dialog",0,function({onClose:e,className:r,children:l}){return(0,s.useEffect)(()=>{let t=t=>{"Escape"===t.key&&e()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[e]),(0,t.jsx)("div",{className:"anim-fade fixed inset-0 z-50 grid place-items-center overflow-y-auto bg-[rgba(20,24,30,.42)] p-6 backdrop-blur-[2px]",onClick:e,children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true",className:(0,a.cn)("anim-pop relative m-auto w-full max-w-[500px] rounded-2xl border border-border bg-card shadow-[0_40px_80px_-30px_rgba(20,24,30,.5)]",r),onClick:e=>e.stopPropagation(),children:[l,(0,t.jsx)("button",{className:"absolute right-4 top-4 grid h-7 w-7 cursor-pointer place-items-center rounded-md border-0 bg-transparent text-[#a4a9b0] transition-colors hover:bg-secondary hover:text-foreground",onClick:e,"aria-label":"Close",children:(0,t.jsx)(n.Icons.x,{style:{width:15,height:15}})})]})})},"DialogBody",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("px-5 py-4",e),...s})},"DialogDescription",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("mt-1 font-mono text-xs text-muted-foreground",e),...s})},"DialogFooter",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("flex justify-end gap-2.5 rounded-b-2xl border-t border-border/70 bg-background px-5 py-3.5",e),...s})},"DialogHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("flex items-start gap-3 border-b border-border/70 px-5 pb-4 pt-5",e),...s})},"DialogIcon",0,function({children:e}){return(0,t.jsx)("span",{className:"grid h-9 w-9 flex-none place-items-center rounded-lg border border-[var(--green-line)] bg-accent text-primary [&_svg]:size-[17px]",children:e})},"DialogTitle",0,function({className:e,...s}){return(0,t.jsx)("div",{className:(0,a.cn)("text-base font-semibold leading-tight tracking-tight",e),...s})}])},86184,e=>{"use strict";var t=e.i(1262),s=e.i(54129),a=e.i(69377),n=e.i(3060);function r({jobId:e,login:l}){let[o,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(!1),[u,x]=(0,s.useState)(null),m="exchanging"===l.phase,p=async()=>{let t=o.trim();if(t&&!d){c(!0),x(null);try{let s=await fetch(`/api/v1/jobs/${encodeURIComponent(e)}/login-code`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({code:t})});if(!s.ok){let e=await s.json().catch(()=>null);x(e?.error?.message??`request failed (${s.status})`);return}i("")}catch(e){x(e instanceof Error?e.message:String(e))}finally{c(!1)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 p-3",children:[(0,t.jsx)("div",{className:"text-sm font-semibold text-amber-200",children:"Claude login required"}),(0,t.jsx)("p",{className:"text-xs text-amber-100/80",children:"Your saved Claude login is expired. Open the sign-in page, approve access, then paste the code Claude shows you."}),l.url?(0,t.jsx)("a",{href:l.url,target:"_blank",rel:"noreferrer",className:"w-fit rounded-md bg-amber-500/20 px-2.5 py-1 text-xs font-medium text-amber-100 underline decoration-amber-400/50 underline-offset-2 hover:bg-amber-500/30",children:"Open Claude sign-in ↗"}):(0,t.jsx)("span",{className:"text-xs text-amber-100/60",children:"waiting for the sign-in link…"}),(0,t.jsxs)("div",{className:"mt-1 flex gap-2",children:[(0,t.jsx)(n.Input,{value:o,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()},placeholder:"Paste approval code",disabled:m,className:"flex-1 font-mono text-xs"}),(0,t.jsx)(a.Button,{type:"button",onClick:()=>void p(),disabled:!o.trim()||d||m,children:m?"Verifying…":d?"Submitting…":"Submit"})]}),l.lastError?(0,t.jsx)("p",{className:"text-xs text-amber-300",children:l.lastError}):null,"error"===l.phase&&l.error?(0,t.jsx)("p",{className:"text-xs text-red-400",children:l.error}):null,u?(0,t.jsx)("p",{className:"text-xs text-red-400",children:u}):null]})}e.s(["JobLogStream",0,function({jobId:e,endpoint:a,onDone:n,onStatus:l,onLogin:o}){let[i,d]=(0,s.useState)([]),[c,u]=(0,s.useState)(null),x=(0,s.useRef)(null),m=(0,s.useRef)(n);m.current=n;let p=(0,s.useRef)(l);p.current=l;let h=(0,s.useRef)(o);return h.current=o,(0,s.useEffect)(()=>{p.current?.("streaming");let t=new EventSource(a??`/api/jobs/${encodeURIComponent(e)}/logs`);return t.addEventListener("log",e=>{let t=JSON.parse(e.data);d(e=>[...e,t])}),t.addEventListener("login",e=>{let t=JSON.parse(e.data);u(t),h.current?.(t)}),t.addEventListener("end",e=>{let s=JSON.parse(e.data);p.current?.(s.status),m.current?.(s.status),t.close()}),()=>t.close()},[e,a]),(0,s.useEffect)(()=>{let e=x.current;e&&(e.scrollTop=e.scrollHeight)},[i]),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[c&&"done"!==c.phase?(0,t.jsx)(r,{jobId:e,login:c}):null,(0,t.jsx)("pre",{ref:x,className:"max-h-[440px] min-h-[220px] overflow-auto whitespace-pre rounded-lg bg-[#16181c] p-3 font-mono text-[11.5px] leading-relaxed text-[#d6d9de]",children:0===i.length?"starting…":i.join("\n")})]})}])},50557,e=>{"use strict";var t=e.i(1262),s=e.i(54129),a=e.i(33789),n=e.i(44344),r=e.i(64595),l=e.i(8536),o=e.i(65232);function i({className:e,...s}){return(0,t.jsx)("div",{className:(0,o.cn)("h-px w-full shrink-0 bg-border",e),...s})}var d=e.i(96621),c=e.i(1485),u=e.i(45971),x=e.i(69377),m=e.i(3060),p=e.i(86184),h=e.i(95141);let g=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function f(e,t){return e?.error?.message??`request failed (${t})`}function b({onCount:e}){let[a,l]=(0,s.useState)(null),[o,i]=(0,s.useState)(null),[d,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(null),[h,g]=(0,s.useState)(null),[v,N]=(0,s.useState)({}),[y,k]=(0,s.useState)(null),[S,w]=(0,s.useState)(null),C=(0,s.useCallback)(async()=>{try{let t=await fetch("/api/v1/hosts",{credentials:"same-origin"});if(!t.ok)return void i(f(await t.json().catch(()=>null),t.status));let s=(await t.json()).hosts??[];l(s),i(null),e?.(s.length)}catch(e){i(e instanceof Error?e.message:String(e))}},[e]);(0,s.useEffect)(()=>{C()},[C]);let B=async e=>{k(null),w(e);try{let t=await fetch(`/api/v1/hosts/${encodeURIComponent(e)}/bake`,{method:"POST",credentials:"same-origin"}),s=await t.json().catch(()=>null);if(!t.ok||!s?.jobId)return void k(`${e}: ${f(s,t.status)}`);let a=s.jobId;N(t=>({...t,[e]:a}))}catch(t){k(`${e}: ${t instanceof Error?t.message:String(t)}`)}finally{w(null)}},I=async e=>{if(window.confirm(`Remove host "${e}"? Boxes created on it become unreachable. The remote machine is untouched.`)){m(null),g(null),w(e);try{let t=await fetch(`/api/v1/hosts/${encodeURIComponent(e)}`,{method:"DELETE",credentials:"same-origin"});if(!t.ok)return void m(f(await t.json().catch(()=>null),t.status));let s=await t.json().catch(()=>null),a=s?.boxesAffected??[];a.length>0&&g(`Removed ${e}. ${a.length} box(es) are now unreachable: ${a.join(", ")}`),await C()}catch(e){m(e instanceof Error?e.message:String(e))}finally{w(null)}}};return(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[o?(0,t.jsxs)("div",{className:"text-xs text-red-400",children:["Could not load hosts: ",o]}):null,a&&0===a.length?(0,t.jsx)("div",{className:"text-[12.5px] text-muted-foreground",children:"No hosts yet — add a machine you can SSH into to run boxes on its Docker engine."}):null,a?.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[13px] font-semibold",children:e.alias}),e.default?(0,t.jsx)(r.Badge,{className:"normal-case",children:"default"}):null,e.baked?null:(0,t.jsx)(r.Badge,{className:"badge-warn normal-case",children:"not baked"})]}),(0,t.jsx)("div",{className:"truncate font-mono text-[11.5px] text-muted-foreground",children:e.ssh})]}),(0,t.jsxs)(x.Button,{type:"button",size:"sm",variant:"outline",disabled:S===e.alias||!!v[e.alias],onClick:()=>void B(e.alias),title:"Bake the box image on this host",children:[(0,t.jsx)(n.Icons.refresh,{className:"size-3.5"}),v[e.alias]?"Baking…":e.baked?"Re-bake":"Bake"]}),(0,t.jsxs)(x.Button,{type:"button",size:"sm",variant:"destructive",disabled:S===e.alias||!!v[e.alias],onClick:()=>void I(e.alias),children:[(0,t.jsx)(n.Icons.trash,{className:"size-3.5"}),"Remove"]})]}),v[e.alias]?(0,t.jsx)(p.JobLogStream,{jobId:v[e.alias],endpoint:`/api/v1/jobs/${encodeURIComponent(v[e.alias])}/logs`,onDone:()=>{N(t=>{let s={...t};return delete s[e.alias],s}),C()}}):null]},e.alias)),y?(0,t.jsx)("div",{className:"text-xs text-red-400",children:y}):null,u?(0,t.jsx)("div",{className:"text-xs text-red-400",children:u}):null,h?(0,t.jsx)("div",{className:"text-xs text-amber-400",children:h}):null,(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsxs)(x.Button,{type:"button",size:"sm",onClick:()=>c(!0),children:[(0,t.jsx)(n.Icons.plus,{className:"size-3.5"}),"Add host"]})}),d?(0,t.jsx)(j,{firstHost:(a?.length??0)===0,onClose:()=>c(!1),onAdded:()=>{c(!1),C()}}):null]})}function j({firstHost:e,onClose:a,onAdded:n}){let[r,l]=(0,s.useState)(""),[o,i]=(0,s.useState)(""),[d,c]=(0,s.useState)(!1),[u,p]=(0,s.useState)(null),b=async()=>{let t=r.trim(),s=o.trim();if(!g.test(t))return void p("Alias must be a plain name (letters, digits, ., _, -; no @, :, /).");if(!s)return void p("SSH connection is required.");c(!0),p(null);try{let a=await fetch("/api/v1/hosts",{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({alias:t,ssh:s,default:e})});if(!a.ok)return void p(f(await a.json().catch(()=>null),a.status));n()}catch(e){p(e instanceof Error?e.message:String(e))}finally{c(!1)}};return(0,t.jsxs)(h.Dialog,{onClose:a,children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsx)(h.DialogTitle,{children:"Add Remote Docker host"})}),(0,t.jsxs)(h.DialogBody,{className:"flex flex-col gap-3",children:[(0,t.jsx)("p",{className:"text-[12.5px] text-muted-foreground",children:"Register a machine you can SSH into — AgentBox runs boxes on its Docker engine. The host is probed (ssh + docker) before it's saved."}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:"Alias"}),(0,t.jsx)(m.Input,{value:r,placeholder:"buildbox",autoFocus:!0,onChange:e=>l(e.target.value)})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:"SSH connection"}),(0,t.jsx)(m.Input,{value:o,placeholder:"user@host (or an ~/.ssh/config alias)",className:"font-mono text-xs",onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&b()}})]}),u?(0,t.jsx)("div",{className:"text-xs text-red-400",children:u}):null]}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(x.Button,{type:"button",variant:"ghost",onClick:a,disabled:d,children:"Cancel"}),(0,t.jsx)(x.Button,{type:"button",onClick:()=>void b(),disabled:d,children:d?"Adding…":"Add host"})]})]})}let v={"e2b.apiKey":"e2b_…","daytona.apiKey":"dtn_…","hetzner.token":"project read+write token","vercel.token":"vercel token","vercel.teamId":"team_… (optional)","vercel.projectId":"prj_… (optional)","digitalocean.token":"personal access token (read+write)","digitalocean.project":"name or UUID — blank leaves it unchanged"};function N(){let{state:e}=(0,d.useStore)(),[a,n]=(0,s.useState)({});return(0,s.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/v1/providers?freshness=1",{credentials:"same-origin"});if(!t.ok)return;let s=await t.json();if(e)return;let a={};for(let e of s.providers??[])a[e.id]={baseStatus:e.baseStatus,baseStaleReason:e.baseStaleReason};n(a)}catch{}})(),()=>{e=!0}},[e.providers]),(0,t.jsx)(l.Card,{id:"providers",className:"scroll-mt-6 divide-y divide-border/60 overflow-hidden",children:e.providers.map(e=>(0,t.jsx)(y,{provider:{...e,...a[e.id]}},e.id))})}function y({provider:e}){var a;let l=(0,u.useRouter)(),i=(e.credentials?.fields??[]).map(t=>({key:t.key,label:t.label,placeholder:v[`${e.id}.${t.key}`]??t.hint,optional:t.optional})),d=new Set(i.filter(e=>!e.optional).map(e=>e.key)),[c,h]=(0,s.useState)({}),[g,f]=(0,s.useState)(()=>e.hasCredentials?Object.fromEntries(i.filter(e=>!e.optional).map(e=>[e.key,!0])):{}),[j,N]=(0,s.useState)(!1),[k,S]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[B,I]=(0,s.useState)(e.jobId??null),[E,D]=(0,s.useState)(!1),[R,$]=(0,s.useState)(null),A="remote-docker"===e.id,[z,O]=(0,s.useState)(null),T=async()=>{N(!0),S(null);try{let t={};for(let e of i){if(g[e.key])continue;let s=(c[e.key]??"").trim();s&&(t[e.key]=s)}let s=await fetch(`/api/v1/providers/${encodeURIComponent(e.id)}/credentials`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(t)});if(!s.ok){let e=await s.json().catch(()=>null);S(e?.error?.message??`request failed (${s.status})`);return}h({}),f(Object.fromEntries([...d].map(e=>[e,!0]))),C(!1),l.refresh()}catch(e){S(e instanceof Error?e.message:String(e))}finally{N(!1)}},H=async()=>{D(!0),$(null);try{let t=await fetch(`/api/v1/providers/${encodeURIComponent(e.id)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(e.configured?{force:!0}:{})}),s=await t.json().catch(()=>null);if(!t.ok||!s?.jobId)return void $(s?.error?.message??`request failed (${t.status})`);I(s.jobId)}catch(e){$(e instanceof Error?e.message:String(e))}finally{D(!1)}},L="hub"===e.origin,U=0===i.length||e.hasCredentials,_=i.length>0,P=!L&&(_||A);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4 px-5",children:[(0,t.jsxs)("div",{className:(0,o.cn)("flex items-center gap-3",P&&"cursor-pointer"),onClick:P?()=>C(e=>!e):void 0,children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14px] font-semibold",children:[e.label,A?null===z?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"…"}):0===z?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"no hosts"}):(0,t.jsxs)(r.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,t.jsx)("span",{className:"badge-dot"}),z," ",1===z?"host":"hosts"]}):(a=e).configured?"stale"===a.baseStatus?(0,t.jsx)(r.Badge,{className:"badge-warn gap-1.5 normal-case",title:a.baseStaleReason,children:"stale — re-bake"}):"unprepared"===a.baseStatus?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):(0,t.jsxs)(r.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,t.jsx)("span",{className:"badge-dot"}),"ready"]}):a.hasCredentials?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs bake"}):void 0===a.hasCredentials&&"hub"===a.origin?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"unknown"}):(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"needs credentials"}),L?(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",title:"Boxes on this provider are created and baked on the control box, so this is its state — not this machine's.",children:"control box"}):null]}),A?(0,t.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:"No login — connects over your own SSH."}):e.reason?(0,t.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:e.reason}):null]}),L?(0,t.jsx)("a",{href:e.hubUrl?`${e.hubUrl}/settings`:void 0,target:"_blank",rel:"noreferrer",className:"flex-none text-[12.5px] text-muted-foreground underline underline-offset-2 hover:text-foreground",onClick:e=>e.stopPropagation(),children:"Manage on the control box ↗"}):A?null:(0,t.jsx)("div",{className:"flex flex-none items-center gap-2",onClick:e=>e.stopPropagation(),children:(0,t.jsxs)(x.Button,{type:"button",size:"sm",variant:e.configured?"outline":"default",disabled:!U||E||!!B,onClick:()=>void H(),title:U?void 0:"Add credentials first",children:[(0,t.jsx)(n.Icons.refresh,{className:"size-3.5"}),B?"Baking…":E?"Starting…":e.configured?"Re-bake":"Bake image"]})}),P?(0,t.jsx)(n.Icons.chevR,{className:(0,o.cn)("size-4 flex-none text-muted-foreground transition-transform",w&&"rotate-90")}):(0,t.jsx)("span",{className:"size-4 flex-none","aria-hidden":!0})]}),A?(0,t.jsx)("div",{className:(0,o.cn)(!w&&"hidden"),children:(0,t.jsx)(b,{onCount:O})}):null,!L&&w&&i.length>0?(0,t.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-border/70 bg-card/50 p-3",children:[i.map(e=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("label",{className:"text-[11.5px] font-medium text-muted-foreground",children:[e.label,e.optional?" (optional)":""]}),(0,t.jsx)(m.Input,{type:"password",autoComplete:"off",value:g[e.key]?"••••••••••••":c[e.key]??"",placeholder:e.placeholder,onFocus:()=>{g[e.key]&&(f(t=>({...t,[e.key]:!1})),h(t=>({...t,[e.key]:""})))},onBlur:()=>{d.has(e.key)&&!(c[e.key]??"").trim()&&f(t=>({...t,[e.key]:!0}))},onChange:t=>h(s=>({...s,[e.key]:t.target.value})),className:"font-mono text-xs"})]},e.key)),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)(x.Button,{type:"button",size:"sm",disabled:j,onClick:()=>void T(),children:j?"Saving…":"Save credentials"}),k?(0,t.jsx)("span",{className:"text-xs text-red-400",children:k}):null]})]}):null,R?(0,t.jsx)("div",{className:"text-xs text-red-400",children:R}):null,B?(0,t.jsx)(p.JobLogStream,{jobId:B,endpoint:`/api/v1/jobs/${encodeURIComponent(B)}/logs`,onDone:()=>{I(null),l.refresh()}}):null]})}e.s(["default",0,function(){let{state:e}=(0,d.useStore)(),u=e.github,[x,m]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=!0;return fetch("/api/v1/health",{credentials:"same-origin"}).then(e=>e.ok?e.json():null).then(t=>{e&&t?.version&&m(t.version)}).catch(()=>{}),()=>{e=!1}},[]),(0,t.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,t.jsx)("h1",{className:"text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:"Settings"}),(0,t.jsx)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:"Providers, GitHub access & hub configuration."}),(0,t.jsx)(c.SectionLabel,{right:(0,t.jsx)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:"credentials & base images"}),children:"Sandbox providers"}),(0,t.jsx)(N,{}),(0,t.jsx)(c.SectionLabel,{children:"GitHub App"}),u.available?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Card,{className:"overflow-hidden",children:(0,t.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,t.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-foreground text-background",children:(0,t.jsx)(n.Icons.github,{className:"size-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:[u.appName,u.installed?(0,t.jsxs)(r.Badge,{className:"badge-run gap-1.5 normal-case",children:[(0,t.jsx)("span",{className:"badge-dot"}),"installed"]}):null]}),(0,t.jsx)("div",{className:"mt-0.5 font-mono text-[12.5px] text-muted-foreground",children:u.installed?`@${u.account}`:"Not installed"})]})]})}),(0,t.jsx)(c.SectionLabel,{right:(0,t.jsxs)("span",{className:"font-mono text-[11px] tracking-normal text-[#a4a9b0]",children:[u.repos.length," repos"]}),children:"Authorized repositories"}),(0,t.jsx)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:u.repos.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("span",{className:"grid h-[30px] w-[30px] flex-none place-items-center rounded-md border border-border bg-background text-secondary-foreground",children:(0,t.jsx)(n.Icons.repo,{className:"size-[15px]"})}),(0,t.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block font-mono text-[13px] font-medium",children:e.full}),(0,t.jsxs)("span",{className:"mt-0.5 flex items-center gap-3 font-mono text-[11.5px] text-muted-foreground",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,t.jsx)(n.LangDot,{lang:e.lang}),e.lang]}),(0,t.jsxs)("span",{children:["updated ",(0,t.jsx)(a.Ago,{ms:e.pushedAt})]}),(0,t.jsx)(r.Badge,{className:(0,o.cn)("px-1.5 py-0 text-[10px] uppercase tracking-[.03em]",e.private?"":"border-[var(--green-line)] text-primary"),children:e.private?"private":"public"})]})]})]},e.id))})]}):(0,t.jsxs)(l.Card,{className:"overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 p-5",children:[(0,t.jsx)("span",{className:"grid h-11 w-11 flex-none place-items-center rounded-xl bg-secondary text-muted-foreground",children:(0,t.jsx)(n.Icons.github,{className:"size-6"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-[14.5px] font-semibold",children:["GitHub App",(0,t.jsx)(r.Badge,{className:"gap-1.5 normal-case",children:"not available"})]}),(0,t.jsx)("div",{className:"mt-0.5 text-[12.5px] text-muted-foreground",children:"The GitHub App leases repo-scoped tokens to cloud boxes from the hosted hub. On a local machine boxes use your own git credentials directly, so there is nothing to configure here."})]})]}),(0,t.jsx)(i,{}),(0,t.jsxs)("div",{className:"flex items-start gap-3 p-4 px-5 text-[12.5px] text-muted-foreground",children:[(0,t.jsx)(n.Icons.shield,{className:"mt-0.5 size-[15px] flex-none text-primary"}),(0,t.jsx)("span",{children:"Available when the hub runs in a hosted profile (hetzner or vercel)."})]})]}),(0,t.jsxs)("div",{className:"mt-10 text-center font-mono text-[11px] text-muted-foreground",children:["AgentBox ",x??"…"]})]})}],50557)}]);
@@ -0,0 +1,45 @@
1
+ // GET /api/v1/boxes/:id/vnc — mint a ready-to-open noVNC viewer URL.
2
+ //
3
+ // Cloud signed preview URLs expire (default 3600s), so the URL can't ride the
4
+ // Box payload's `vncUrl` — which is why that stays null for daytona/vercel/e2b
5
+ // and every client calls this at click time instead. Docker/hetzner boxes get
6
+ // their stable Portless/OrbStack/loopback URL from the same call.
7
+ //
8
+ // Needs the in-process host backend for provider credentials; the Postgres/plane
9
+ // path 503s like the other provider-driven routes.
10
+ import { backendOrNull } from '../../../lib/backend';
11
+ import { fail, failFromAction } from '../../../lib/envelope';
12
+ import { parseVncTtl } from '@/lib/boxes/vnc-link';
13
+
14
+ export const runtime = 'nodejs';
15
+ export const dynamic = 'force-dynamic';
16
+
17
+ export async function GET(
18
+ req: Request,
19
+ ctx: { params: Promise<{ id: string }> },
20
+ ): Promise<Response> {
21
+ const { id } = await ctx.params;
22
+ if (id.startsWith('job:')) {
23
+ return fail('conflict', `box ${id} is still being created; its desktop is not available yet`, {
24
+ jobId: id.slice('job:'.length),
25
+ });
26
+ }
27
+ const backend = backendOrNull();
28
+ if (!backend) return fail('backend_unavailable', 'hub backend unavailable (run the hub server)');
29
+
30
+ const params = new URL(req.url).searchParams;
31
+ const ttl = parseVncTtl(params.get('ttl'));
32
+ if (!ttl.ok) return fail('invalid_request', ttl.message);
33
+ const loopback = params.get('loopback') === '1';
34
+
35
+ const res = await backend.vncUrl(id, {
36
+ ...(ttl.ttl === undefined ? {} : { ttl: ttl.ttl }),
37
+ loopback,
38
+ });
39
+ if (!res.ok) return failFromAction(res.error);
40
+ // The URL carries the box's VNC password in its query string — never cache it.
41
+ return Response.json(
42
+ { url: res.url, ...(res.ttl === undefined ? {} : { ttl: res.ttl }) },
43
+ { headers: { 'cache-control': 'no-store' } },
44
+ );
45
+ }