@madarco/agentbox 0.27.0 → 0.27.2

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 (233) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/{_cloud-attach-WDGM6FL5.js → _cloud-attach-FVD5YJCE.js} +6 -4
  3. package/dist/{chunk-NEF6MDJO.js → chunk-2PCU4OF5.js} +4 -4
  4. package/dist/{chunk-JE6UI5YR.js → chunk-47BVC7FN.js} +7 -59
  5. package/dist/chunk-47BVC7FN.js.map +1 -0
  6. package/dist/chunk-5ZK5MQA2.js +64 -0
  7. package/dist/chunk-5ZK5MQA2.js.map +1 -0
  8. package/dist/{chunk-26IKZRTT.js → chunk-A4OVGMVL.js} +23 -16
  9. package/dist/chunk-A4OVGMVL.js.map +1 -0
  10. package/dist/{chunk-KWOEUFVA.js → chunk-EZWPCTUO.js} +2 -2
  11. package/dist/{chunk-IDH5A4RR.js → chunk-F6NQZ4DC.js} +2 -2
  12. package/dist/chunk-G3H2L3O2.js +0 -0
  13. package/dist/chunk-IMN62QY5.js +285 -0
  14. package/dist/chunk-IMN62QY5.js.map +1 -0
  15. package/dist/chunk-JGZSA5ZI.js +0 -0
  16. package/dist/{chunk-V5XXJH63.js → chunk-JNFUWQ4N.js} +2 -2
  17. package/dist/{chunk-UJEH2NJT.js → chunk-JRXNVEV3.js} +2 -271
  18. package/dist/chunk-JRXNVEV3.js.map +1 -0
  19. package/dist/{chunk-LL7NCMUU.js → chunk-QAJQXZ3N.js} +3 -3
  20. package/dist/{chunk-SJ75AIA2.js → chunk-QJT2XOKH.js} +8 -6
  21. package/dist/{chunk-SJ75AIA2.js.map → chunk-QJT2XOKH.js.map} +1 -1
  22. package/dist/{chunk-HR7NHH5J.js → chunk-RK2CEABS.js} +205 -5
  23. package/dist/{chunk-HR7NHH5J.js.map → chunk-RK2CEABS.js.map} +1 -1
  24. package/dist/chunk-WJFZJZIM.js +0 -0
  25. package/dist/cloud-backends.js +28 -0
  26. package/dist/cloud-backends.js.map +1 -0
  27. package/dist/cloud-poller-SUNA6ZQC-7M5LJHHE.js +0 -0
  28. package/dist/{dist-O3LKOIE7.js → dist-2SXD3ITR.js} +6 -5
  29. package/dist/{dist-O3LKOIE7.js.map → dist-2SXD3ITR.js.map} +1 -1
  30. package/dist/{dist-FTKS2GI4.js → dist-4KTWNGU6.js} +6 -5
  31. package/dist/{dist-WVYAURMF.js → dist-6ZOCQZIP.js} +6 -5
  32. package/dist/{dist-OO52HARR.js → dist-7VCYREHM.js} +22 -20
  33. package/dist/{dist-KQTMCVME.js → dist-TL4YW7KZ.js} +6 -5
  34. package/dist/{dist-KQTMCVME.js.map → dist-TL4YW7KZ.js.map} +1 -1
  35. package/dist/dist-U2SVLJUQ.js +0 -0
  36. package/dist/{dist-TSFVB7AI.js → dist-UUOX4DBX.js} +6 -5
  37. package/dist/{dist-TSFVB7AI.js.map → dist-UUOX4DBX.js.map} +1 -1
  38. package/dist/dist-XSEK7LX3.js +156 -0
  39. package/dist/{dist-Z6L5MM5D.js → dist-YGXQMN2K.js} +6 -5
  40. package/dist/index.js +59 -55
  41. package/dist/index.js.map +1 -1
  42. package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js → prepared-state-75DIZ55S-B33TDOJZ.js} +3 -2
  43. package/dist/prepared-state-75DIZ55S-B33TDOJZ.js.map +1 -0
  44. package/package.json +31 -29
  45. package/runtime/_shared/agentbox-checkpoint-cleanup +0 -0
  46. package/runtime/_shared/agentbox-dockerd-start +0 -0
  47. package/runtime/_shared/agentbox-open +0 -0
  48. package/runtime/_shared/agentbox-portless-trust +0 -0
  49. package/runtime/_shared/agentbox-vnc-start +0 -0
  50. package/runtime/_shared/ctl.cjs +186 -172
  51. package/runtime/_shared/gh-shim +0 -0
  52. package/runtime/_shared/git-shim +0 -0
  53. package/runtime/_shared/linear-shim +0 -0
  54. package/runtime/_shared/ntn-shim +0 -0
  55. package/runtime/digitalocean/agentbox-checkpoint-cleanup +0 -0
  56. package/runtime/digitalocean/agentbox-dockerd-start +0 -0
  57. package/runtime/digitalocean/agentbox-open +0 -0
  58. package/runtime/digitalocean/agentbox-portless-trust +0 -0
  59. package/runtime/digitalocean/agentbox-vnc-start +0 -0
  60. package/runtime/digitalocean/ctl.cjs +186 -172
  61. package/runtime/digitalocean/gh-shim +0 -0
  62. package/runtime/digitalocean/git-shim +0 -0
  63. package/runtime/digitalocean/linear-shim +0 -0
  64. package/runtime/digitalocean/ntn-shim +0 -0
  65. package/runtime/digitalocean/scripts/install-box.sh +0 -0
  66. package/runtime/docker/packages/ctl/dist/bin.cjs +186 -172
  67. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-checkpoint-cleanup +0 -0
  68. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-dockerd-start +0 -0
  69. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-open +0 -0
  70. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-portless-trust +0 -0
  71. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-sshd-start +0 -0
  72. package/runtime/docker/packages/sandbox-docker/scripts/agentbox-vnc-start +0 -0
  73. package/runtime/docker/packages/sandbox-docker/scripts/chromium-resolver +0 -0
  74. package/runtime/docker/packages/sandbox-docker/scripts/gh-shim +0 -0
  75. package/runtime/docker/packages/sandbox-docker/scripts/git-shim +0 -0
  76. package/runtime/docker/packages/sandbox-docker/scripts/linear-shim +0 -0
  77. package/runtime/docker/packages/sandbox-docker/scripts/ntn-shim +0 -0
  78. package/runtime/e2b/agentbox-checkpoint-cleanup +0 -0
  79. package/runtime/e2b/agentbox-dockerd-start +0 -0
  80. package/runtime/e2b/agentbox-open +0 -0
  81. package/runtime/e2b/agentbox-vnc-start +0 -0
  82. package/runtime/e2b/ctl.cjs +186 -172
  83. package/runtime/e2b/gh-shim +0 -0
  84. package/runtime/e2b/git-shim +0 -0
  85. package/runtime/e2b/linear-shim +0 -0
  86. package/runtime/e2b/ntn-shim +0 -0
  87. package/runtime/e2b/scripts/build-template.sh +0 -0
  88. package/runtime/hetzner/agentbox-checkpoint-cleanup +0 -0
  89. package/runtime/hetzner/agentbox-dockerd-start +0 -0
  90. package/runtime/hetzner/agentbox-open +0 -0
  91. package/runtime/hetzner/agentbox-portless-trust +0 -0
  92. package/runtime/hetzner/agentbox-vnc-start +0 -0
  93. package/runtime/hetzner/ctl.cjs +186 -172
  94. package/runtime/hetzner/gh-shim +0 -0
  95. package/runtime/hetzner/git-shim +0 -0
  96. package/runtime/hetzner/linear-shim +0 -0
  97. package/runtime/hetzner/ntn-shim +0 -0
  98. package/runtime/hetzner/scripts/install-box.sh +0 -0
  99. package/runtime/hub/apps/hub/.next/BUILD_ID +1 -1
  100. package/runtime/hub/apps/hub/.next/build-manifest.json +3 -3
  101. package/runtime/hub/apps/hub/.next/prerender-manifest.json +3 -3
  102. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js +1 -1
  103. package/runtime/hub/apps/hub/.next/server/app/(auth)/api/auth/[...all]/route.js.nft.json +1 -1
  104. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page/server-reference-manifest.json +1 -1
  105. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/approvals/page_client-reference-manifest.js +1 -1
  106. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page/server-reference-manifest.json +12 -12
  107. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/boxes/[id]/page_client-reference-manifest.js +1 -1
  108. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page/server-reference-manifest.json +11 -11
  109. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  110. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page/server-reference-manifest.json +8 -8
  111. package/runtime/hub/apps/hub/.next/server/app/(dashboard)/projects/[id]/page_client-reference-manifest.js +1 -1
  112. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js +1 -1
  113. package/runtime/hub/apps/hub/.next/server/app/[...path]/route.js.nft.json +1 -1
  114. package/runtime/hub/apps/hub/.next/server/app/_global-error.html +1 -1
  115. package/runtime/hub/apps/hub/.next/server/app/_global-error.rsc +1 -1
  116. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  117. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  118. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  119. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  120. package/runtime/hub/apps/hub/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  121. package/runtime/hub/apps/hub/.next/server/chunks/0zhp_better-auth_dist_adapters_kysely-adapter_index_mjs_1rl4qnh._.js +3 -0
  122. package/runtime/hub/apps/hub/.next/server/chunks/151__@better-auth_core_dist_0ecdp_3._.js +1 -1
  123. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04h15ml._.js +1 -1
  124. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__04jgk9x._.js +1 -1
  125. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__07ednlo._.js +1 -1
  126. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0a7djvw._.js +1 -1
  127. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0d1lmiq._.js +5 -5
  128. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0ig1bot._.js +1 -1
  129. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0szd4sh._.js +1 -1
  130. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__0t7o5ed._.js +1 -1
  131. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-0flwc._.js +1 -1
  132. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1-9g0ae._.js +2 -2
  133. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1e4z_-v._.js → [root-of-the-server]__11izd5j._.js} +2 -2
  134. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13ioh5z._.js +1 -1
  135. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__13jwk_k._.js +1 -1
  136. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16_uteg._.js +1 -1
  137. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__16p2m-g._.js +1 -1
  138. package/runtime/hub/apps/hub/.next/server/chunks/{[root-of-the-server]__1k8g143._.js → [root-of-the-server]__19pc87s._.js} +2 -2
  139. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1_gu2yk._.js +1 -1
  140. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ai-945._.js +1 -1
  141. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1bu2zio._.js +1 -1
  142. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1ctczev._.js +1 -1
  143. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f2sueq._.js +1 -1
  144. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1f9zctr._.js +1 -1
  145. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1md9kdw._.js +1 -1
  146. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1mttufy._.js +1 -1
  147. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1pp5oib._.js +1 -1
  148. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1qwhzmi._.js +1 -1
  149. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1thipug._.js +1 -1
  150. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__1xeczo7._.js +1 -1
  151. package/runtime/hub/apps/hub/.next/server/chunks/[root-of-the-server]__20503l7._.js +1 -1
  152. package/runtime/hub/apps/hub/.next/server/chunks/_0760z6y._.js +3 -3
  153. package/runtime/hub/apps/hub/.next/server/chunks/packages_relay_dist_control-plane_03a-9aj.js +3 -3
  154. package/runtime/hub/apps/hub/.next/server/chunks/ssr/044u_hub__next-internal_server_app_(dashboard)_projects_[id]_page_actions_15f56np.js +1 -1
  155. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_0xy-j7z._.js +1 -1
  156. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_010858m.js +1 -1
  157. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_04zwxnx.js +1 -1
  158. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_06exuc7.js +1 -1
  159. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2ldrt.js +1 -1
  160. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_0f2tzep.js +1 -1
  161. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_116nh32.js +1 -1
  162. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_11dyjcb.js +1 -1
  163. package/runtime/hub/apps/hub/.next/server/chunks/ssr/09xn_next_dist_esm_build_templates_app-page_1_4knli.js +1 -1
  164. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__08-1wwu._.js +1 -1
  165. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0c9mbcn._.js +1 -1
  166. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0gdfxj4._.js +1 -1
  167. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0kc-hwp._.js +1 -1
  168. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__0lu73p6._.js +1 -1
  169. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__10bfmwi._.js +1 -1
  170. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__18qvdzb._.js +1 -1
  171. package/runtime/hub/apps/hub/.next/server/chunks/ssr/[root-of-the-server]__1l2urlw._.js +1 -1
  172. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_03s-ah2._.js +1 -1
  173. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0kpdmm-._.js +1 -1
  174. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0ozyjt1._.js +1 -1
  175. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_0r4px38._.js +1 -1
  176. package/runtime/hub/apps/hub/.next/server/chunks/ssr/_18w2zeh._.js +1 -1
  177. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_approvals_page_actions_1mi0bpn.js +1 -1
  178. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_boxes_[id]_page_actions_0k7kgn2.js +1 -1
  179. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub__next-internal_server_app_(dashboard)_page_actions_1t3u0xy.js +1 -1
  180. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_[id]_page_tsx_1-j_972._.js +1 -1
  181. package/runtime/hub/apps/hub/.next/server/chunks/ssr/apps_hub_app_(dashboard)_boxes_components_box-table_tsx_0a9pyn_._.js +1 -1
  182. package/runtime/hub/apps/hub/.next/server/chunks/ssr/packages_relay_dist_control-plane_0ve-wz4.js +1 -1
  183. package/runtime/hub/apps/hub/.next/server/middleware-build-manifest.js +3 -3
  184. package/runtime/hub/apps/hub/.next/server/pages/500.html +1 -1
  185. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.js +1 -1
  186. package/runtime/hub/apps/hub/.next/server/server-reference-manifest.json +18 -18
  187. package/runtime/hub/apps/hub/.next/static/chunks/{44j61g8lm9nvw.js → 1-maeq_pl3z29.js} +1 -1
  188. package/runtime/hub/apps/hub/.next/static/chunks/{3-zanu4ioia5i.js → 1f-pwhlfklk8h.js} +1 -1
  189. package/runtime/hub/apps/hub/.next/static/chunks/{0xdtiy_m2ygv8.js → 1g922r_mc5ciw.js} +1 -1
  190. package/runtime/hub/apps/hub/.next/static/chunks/{26rwu1f2gzemi.js → 2k1tvmngrtdgs.js} +1 -1
  191. package/runtime/hub/apps/hub/.next/static/chunks/{3v6kx35_lwjs8.js → 2omimeqtc8qnp.js} +1 -1
  192. package/runtime/hub/apps/hub/.next/static/chunks/{000a1sa7te1h8.js → 3urpddxa8b_je.js} +1 -1
  193. package/runtime/hub/apps/hub/{chunk-YJ5MJOXK.js → chunk-5ARPIPV4.js} +194 -171
  194. package/runtime/hub/apps/hub/{chunk-EHBJKZCL.js → chunk-AEIOQFZ4.js} +245 -2
  195. package/runtime/hub/apps/hub/dist-2EOAT3PC.js +155 -0
  196. package/runtime/hub/apps/hub/{dist-LYDHYTP2.js → dist-DQIL673Y.js} +2 -2
  197. package/runtime/hub/apps/hub/{dist-GTVVXCBP.js → dist-EURE7AUA.js} +2 -2
  198. package/runtime/hub/apps/hub/{dist-JG45OFT2.js → dist-EYHD64SR.js} +16 -16
  199. package/runtime/hub/apps/hub/{dist-G6TXUSPZ.js → dist-GFXXCXLS.js} +2 -2
  200. package/runtime/hub/apps/hub/{dist-DX6IYMAH.js → dist-IVA2PC7N.js} +2 -2
  201. package/runtime/hub/apps/hub/{dist-6FPPUSWZ.js → dist-MMTT7VYJ.js} +1 -1
  202. package/runtime/hub/apps/hub/{dist-3I7KUI6W.js → dist-TAWVTJGU.js} +2 -2
  203. package/runtime/hub/apps/hub/server.js +28 -15
  204. package/runtime/relay/bin.cjs +37 -3
  205. package/runtime/vercel/agentbox-checkpoint-cleanup +0 -0
  206. package/runtime/vercel/agentbox-dockerd-start +0 -0
  207. package/runtime/vercel/agentbox-open +0 -0
  208. package/runtime/vercel/agentbox-vnc-start +0 -0
  209. package/runtime/vercel/ctl.cjs +186 -172
  210. package/runtime/vercel/gh-shim +0 -0
  211. package/runtime/vercel/git-shim +0 -0
  212. package/runtime/vercel/linear-shim +0 -0
  213. package/runtime/vercel/ntn-shim +0 -0
  214. package/runtime/vercel/scripts/provision.sh +0 -0
  215. package/LICENSE +0 -21
  216. package/dist/chunk-26IKZRTT.js.map +0 -1
  217. package/dist/chunk-JE6UI5YR.js.map +0 -1
  218. package/dist/chunk-UJEH2NJT.js.map +0 -1
  219. package/runtime/hub/apps/hub/.next/server/chunks/0-fj_better-auth_dist_adapters_kysely-adapter_index_mjs_0btft52._.js +0 -3
  220. /package/dist/{_cloud-attach-WDGM6FL5.js.map → _cloud-attach-FVD5YJCE.js.map} +0 -0
  221. /package/dist/{chunk-NEF6MDJO.js.map → chunk-2PCU4OF5.js.map} +0 -0
  222. /package/dist/{chunk-KWOEUFVA.js.map → chunk-EZWPCTUO.js.map} +0 -0
  223. /package/dist/{chunk-IDH5A4RR.js.map → chunk-F6NQZ4DC.js.map} +0 -0
  224. /package/dist/{chunk-V5XXJH63.js.map → chunk-JNFUWQ4N.js.map} +0 -0
  225. /package/dist/{chunk-LL7NCMUU.js.map → chunk-QAJQXZ3N.js.map} +0 -0
  226. /package/dist/{dist-FTKS2GI4.js.map → dist-4KTWNGU6.js.map} +0 -0
  227. /package/dist/{dist-OO52HARR.js.map → dist-6ZOCQZIP.js.map} +0 -0
  228. /package/dist/{dist-WVYAURMF.js.map → dist-7VCYREHM.js.map} +0 -0
  229. /package/dist/{dist-Z6L5MM5D.js.map → dist-XSEK7LX3.js.map} +0 -0
  230. /package/dist/{prepared-state-75DIZ55S-TNJXWMXV.js.map → dist-YGXQMN2K.js.map} +0 -0
  231. /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → Wddru2A-5szSWhZWYoMwi}/_buildManifest.js +0 -0
  232. /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → Wddru2A-5szSWhZWYoMwi}/_clientMiddlewareManifest.js +0 -0
  233. /package/runtime/hub/apps/hub/.next/static/{S-yw9-SVffiEHRGm85NzP → Wddru2A-5szSWhZWYoMwi}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[58099,a=>{"use strict";let b,c;var d,e=a.i(33552),f=a.i(74455),g=a.i(17607),h=a.i(97187),i=a.i(71152),j=a.i(86834);function k({className:a,icon:b,title:c,children:d}){return(0,e.jsxs)("div",{className:(0,j.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",a),children:[b?(0,e.jsx)(b,{className:"mt-0.5 size-4 flex-none"}):null,(0,e.jsxs)("div",{className:"min-w-0",children:[c?(0,e.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:c}):null,(0,e.jsx)("div",{className:"text-[12.5px] leading-normal",children:d})]})]})}var l=a.i(87883),m=a.i(80007),n=a.i(60401);function o({boxId:a}){let{state:b}=(0,m.useStore)(),c=b.approvals.filter(b=>b.boxId===a).sort((a,b)=>a.createdAt-b.createdAt);return 0===c.length?null:(0,e.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,e.jsx)(h.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,e.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[c.length," pending approval",1===c.length?"":"s"]}),(0,e.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,e.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:c.map(a=>(0,e.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:a.command??a.message}),a.detail?(0,e.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:a.detail}):null,a.cwd?(0,e.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:a.cwd}):null,(0,e.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,e.jsx)(g.Ago,{ms:a.createdAt})})]}),(0,e.jsx)("div",{className:"flex-none pt-0.5",children:(0,e.jsx)(n.ApprovalActions,{id:a.id})})]},a.id))})]})}var p=a.i(50253),q=a.i(18071);function r(a,b,{checkForDefaultPrevented:c=!0}={}){return function(d){if(a?.(d),!1===c||!d||!d.defaultPrevented)return b?.(d)}}function s(a,b){if("function"==typeof a)return a(b);null!=a&&(a.current=b)}function t(...a){return p.useCallback(function(...a){return b=>{let c=!1,d=a.map(a=>{let d=s(a,b);return c||"function"!=typeof d||(c=!0),d});if(c)return()=>{for(let b=0;b<d.length;b++){let c=d[b];"function"==typeof c?c():s(a[b],null)}}}}(...a),a)}function u(a,b=[]){let c=[],d=()=>{let b=c.map(a=>p.createContext(a));return function(c){let d=c?.[a]||b;return p.useMemo(()=>({[`__scope${a}`]:{...c,[a]:d}}),[c,d])}};return d.scopeName=a,[function(b,d){let f=p.createContext(d);f.displayName=b+"Context";let g=c.length;c=[...c,d];let h=b=>{let{scope:c,children:d,...h}=b,i=c?.[a]?.[g]||f,j=p.useMemo(()=>h,Object.values(h));return(0,e.jsx)(i.Provider,{value:j,children:d})};return h.displayName=b+"Provider",[h,function(c,e,h={}){let{optional:i=!1}=h,j=e?.[a]?.[g]||f,k=p.useContext(j);if(k)return k;if(void 0!==d)return d;if(!i)throw Error(`\`${c}\` must be used within \`${b}\``)}]},function(...a){let b=a[0];if(1===a.length)return b;let c=()=>{let c=a.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(a){let d=c.reduce((b,{useScope:c,scopeName:d})=>{let e=c(a)[`__scope${d}`];return{...b,...e}},{});return p.useMemo(()=>({[`__scope${b.scopeName}`]:d}),[d])}};return c.scopeName=b.scopeName,c}(d,...b)]}var v=a.i(48365),w=Symbol.for("radix.slottable"),x=Symbol.for("react.lazy");function y(a){var b;return null!=a&&"object"==typeof a&&"$$typeof"in a&&a.$$typeof===x&&"_payload"in a&&"object"==typeof(b=a._payload)&&null!==b&&"then"in b}var z=p[" use ".trim().toString()],A=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,b)=>{var c;let d,f=(c=`Primitive.${b}`,(d=p.forwardRef((a,b)=>{var d;let e,f,{children:g,...h}=a,i=null,j=!1,k=[];y(g)&&"function"==typeof z&&(g=z(g._payload)),p.Children.forEach(g,a=>{var b;if(b=a,p.isValidElement(b)&&"function"==typeof b.type&&"__radixId"in b.type&&b.type.__radixId===w){j=!0;let b="child"in a.props?a.props.child:a.props.children;y(b)&&"function"==typeof z&&(b=z(b._payload)),i=((a,b)=>{if("child"in a.props){let b=a.props.child;return p.isValidElement(b)?p.cloneElement(b,void 0,a.props.children(b.props.children)):null}return p.isValidElement(b)?b:null})(a,b),k.push(i?.props?.children)}else k.push(a)}),i?i=p.cloneElement(i,void 0,k):!j&&1===p.Children.count(g)&&p.isValidElement(g)&&(i=g);let l=i?(d=i,(f=(e=Object.getOwnPropertyDescriptor(d.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?d.ref:(f=(e=Object.getOwnPropertyDescriptor(d,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?d.props.ref:d.props.ref||d.ref):void 0,m=t(b,l);if(!i){if(g||0===g){let a,b;throw Error(j?(a=c,`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(b=c,`${b} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return g}let n=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(h,i.props??{});return i.type!==p.Fragment&&(n.ref=b?m:l),p.cloneElement(i,n)})).displayName=`${c}.Slot`,d),g=p.forwardRef((a,c)=>{let{asChild:d,...g}=a;return(0,e.jsx)(d?f:b,{...g,ref:c})});return g.displayName=`Primitive.${b}`,{...a,[b]:g}},{});function B(a){let b=p.useRef(a);return p.useEffect(()=>{b.current=a}),p.useMemo(()=>(...a)=>b.current?.(...a),[])}var C="dismissableLayer.update",D=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),E=p.forwardRef((a,b)=>{let{disableOutsidePointerEvents:c=!1,deferPointerDownOutside:f=!1,onEscapeKeyDown:g,onPointerDownOutside:h,onFocusOutside:i,onInteractOutside:j,onDismiss:k,...l}=a,m=p.useContext(D),[n,o]=p.useState(null),q=n?.ownerDocument??globalThis?.document,[,s]=p.useState({}),u=t(b,o),v=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?v.indexOf(w):-1,y=n?v.indexOf(n):-1,z=m.layersWithOutsidePointerEventsDisabled.size>0,E=y>=x,I=p.useRef(!1),J=function(a,b){let{ownerDocument:c=globalThis?.document,deferPointerDownOutside:d=!1,isDeferredPointerDownOutsideRef:e,dismissableSurfaces:f,shouldHandlePointerDownOutside:g=F}=b,h=B(a),i=p.useRef(!1),j=p.useRef(!1),k=p.useRef(new Map),l=p.useRef(()=>{});return p.useEffect(()=>{function a(){j.current=!1,e.current=!1,k.current.clear()}function b(a){if(!j.current)return;let b=a.target;b instanceof Node&&[...f].some(a=>a.contains(b))||k.current.set(a.type,!0),"click"===a.type&&window.setTimeout(()=>{j.current&&l.current()},0)}function m(a){j.current&&k.current.set(a.type,!1)}let n=b=>{if(b.target&&!i.current){let f=function(){c.removeEventListener("click",l.current);let b=Array.from(k.current.values()).some(Boolean);a(),b||H("dismissableLayer.pointerDownOutside",h,m,{discrete:!0})};if(!g(b.target)){c.removeEventListener("click",l.current),a(),i.current=!1;return}let m={originalEvent:b};j.current=!0,e.current=d&&0===b.button,k.current.clear(),d&&0===b.button?(c.removeEventListener("click",l.current),l.current=f,c.addEventListener("click",l.current,{once:!0})):f()}else c.removeEventListener("click",l.current),a();i.current=!1},o=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let a of o)c.addEventListener(a,b,!0),c.addEventListener(a,m);let p=window.setTimeout(()=>{c.addEventListener("pointerdown",n)},0);return()=>{for(let a of(window.clearTimeout(p),c.removeEventListener("pointerdown",n),c.removeEventListener("click",l.current),o))c.removeEventListener(a,b,!0),c.removeEventListener(a,m)}},[c,h,d,e,f,g]),{onPointerDownCapture:()=>i.current=!0}}(a=>{h?.(a),j?.(a),a.defaultPrevented||k?.()},{ownerDocument:q,deferPointerDownOutside:f,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(a=>{if(!(a instanceof Node))return!1;let b=[...m.branches].some(b=>b.contains(a));return E&&!b},[m.branches,E])}),K=function(a,b=globalThis?.document){let c=B(a),d=p.useRef(!1);return p.useEffect(()=>{let a=a=>{a.target&&!d.current&&H("dismissableLayer.focusOutside",c,{originalEvent:a},{discrete:!1})};return b.addEventListener("focusin",a),()=>b.removeEventListener("focusin",a)},[b,c]),{onFocusCapture:()=>d.current=!0,onBlurCapture:()=>d.current=!1}}(a=>{if(f&&I.current)return;let b=a.target;![...m.branches].some(a=>a.contains(b))&&(i?.(a),j?.(a),a.defaultPrevented||k?.())},q),L=!!n&&y===v.length-1,M=B(a=>{"Escape"===a.key&&(g?.(a),!a.defaultPrevented&&k&&(a.preventDefault(),k()))});return p.useEffect(()=>{if(L)return q.addEventListener("keydown",M,{capture:!0}),()=>q.removeEventListener("keydown",M,{capture:!0})},[q,L,M]),p.useEffect(()=>{if(n)return c&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(d=q.body.style.pointerEvents,q.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(n)),m.layers.add(n),G(),()=>{c&&(m.layersWithOutsidePointerEventsDisabled.delete(n),0===m.layersWithOutsidePointerEventsDisabled.size&&(q.body.style.pointerEvents=d))}},[n,q,c,m]),p.useEffect(()=>()=>{n&&(m.layers.delete(n),m.layersWithOutsidePointerEventsDisabled.delete(n),G())},[n,m]),p.useEffect(()=>{let a=()=>s({});return document.addEventListener(C,a),()=>document.removeEventListener(C,a)},[]),(0,e.jsx)(A.div,{...l,ref:u,style:{pointerEvents:z?E?"auto":"none":void 0,...a.style},onFocusCapture:r(a.onFocusCapture,K.onFocusCapture),onBlurCapture:r(a.onBlurCapture,K.onBlurCapture),onPointerDownCapture:r(a.onPointerDownCapture,J.onPointerDownCapture)})});E.displayName="DismissableLayer",p.forwardRef((a,b)=>{let c=p.useContext(D),d=p.useRef(null),f=t(b,d);return p.useEffect(()=>{let a=d.current;if(a)return c.branches.add(a),()=>{c.branches.delete(a)}},[c.branches]),(0,e.jsx)(A.div,{...a,ref:f})}).displayName="DismissableLayerBranch";var F=()=>!0;function G(){let a=new CustomEvent(C);document.dispatchEvent(a)}function H(a,b,c,{discrete:d}){let e=c.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:c});if(b&&e.addEventListener(a,b,{once:!0}),d)e&&v.flushSync(()=>e.dispatchEvent(f));else e.dispatchEvent(f)}var I=globalThis?.document?p.useLayoutEffect:()=>{},J=p[" useId ".trim().toString()]||(()=>void 0),K=0;let L=["top","right","bottom","left"],M=Math.min,N=Math.max,O=Math.round,P=Math.floor,Q=a=>({x:a,y:a}),R={left:"right",right:"left",bottom:"top",top:"bottom"};function S(a,b){return"function"==typeof a?a(b):a}function T(a){return a.split("-")[0]}function U(a){return a.split("-")[1]}function V(a){return"x"===a?"y":"x"}function W(a){return"y"===a?"height":"width"}function X(a){let b=a[0];return"t"===b||"b"===b?"y":"x"}function Y(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}let Z=["left","right"],$=["right","left"],_=["top","bottom"],aa=["bottom","top"];function ab(a){let b=T(a);return R[b]+a.slice(b.length)}function ac(a){return"number"!=typeof a?{top:0,right:0,bottom:0,left:0,...a}:{top:a,right:a,bottom:a,left:a}}function ad(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function ae(a,b,c){let d,{reference:e,floating:f}=a,g=X(b),h=V(X(b)),i=W(h),j=T(b),k="y"===g,l=e.x+e.width/2-f.width/2,m=e.y+e.height/2-f.height/2,n=e[i]/2-f[i]/2;switch(j){case"top":d={x:l,y:e.y-f.height};break;case"bottom":d={x:l,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:m};break;case"left":d={x:e.x-f.width,y:m};break;default:d={x:e.x,y:e.y}}switch(U(b)){case"start":d[h]-=n*(c&&k?-1:1);break;case"end":d[h]+=n*(c&&k?-1:1)}return d}async function af(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=S(b,a),o=ac(n),p=h[m?"floating"===l?"reference":"floating":l],q=ad(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},u=ad(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-u.top+o.top)/t.y,bottom:(u.bottom-q.bottom+o.bottom)/t.y,left:(q.left-u.left+o.left)/t.x,right:(u.right-q.right+o.right)/t.x}}let ag=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=g.detectOverflow?g:{...g,detectOverflow:af},i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=ae(j,d,i),m=d,n=0,o={};for(let c=0;c<f.length;c++){let p=f[c];if(!p)continue;let{name:q,fn:r}=p,{x:s,y:t,data:u,reset:v}=await r({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:o,rects:j,platform:h,elements:{reference:a,floating:b}});k=null!=s?s:k,l=null!=t?t:l,o[q]={...o[q],...u},v&&n<50&&(n++,"object"==typeof v&&(v.placement&&(m=v.placement),v.rects&&(j=!0===v.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):v.rects),{x:k,y:l}=ae(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:o}};function ah(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function ai(a){return L.some(b=>a[b]>=0)}let aj=new Set(["left","top"]);async function ak(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=T(c),h=U(c),i="y"===X(c),j=aj.has(g)?-1:1,k=f&&i?-1:1,l=S(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function al(a){return function(a){return!1}(a)?(a.nodeName||"").toLowerCase():"#document"}function am(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function an(a){var b;return null==(b=(function(a){return!1}(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function ao(a){return!1}function ap(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=ax(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&"inline"!==e&&"contents"!==e}function aq(a){try{if(a.matches(":popover-open"))return!0}catch(a){}try{return a.matches(":modal")}catch(a){return!1}}let ar=/transform|translate|scale|rotate|perspective|filter/,as=/paint|layout|strict|content/,at=a=>!!a&&"none"!==a;function au(a){let b=a;return at(b.transform)||at(b.translate)||at(b.scale)||at(b.rotate)||at(b.perspective)||!av()&&(at(b.backdropFilter)||at(b.filter))||ar.test(b.willChange||"")||as.test(b.contain||"")}function av(){return null==b&&(b="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function aw(a){return/^(html|body|#document)$/.test(al(a))}function ax(a){return am(a).getComputedStyle(a)}function ay(a){return{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function az(a){if("html"===al(a))return a;let b=a.assignedSlot||a.parentNode||an(a);return b}function aA(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=az(b);return aw(c)?b.ownerDocument?b.ownerDocument.body:b.body:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=am(e);if(!f)return b.concat(e,aA(e,[],c));{let a=aB(g);return b.concat(g,g.visualViewport||[],ap(e)?e:[],a&&c?aA(a):[])}}function aB(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function aC(a){let b=ax(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=c,f=d,g=O(c)!==e||O(d)!==f;return g&&(c=e,d=f),{width:c,height:d,$:g}}function aD(a){return 0,a.contextElement}function aE(a){let b=aD(a);1;return Q(1)}let aF=Q(0);function aG(a){let b=am(a);return av()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:aF}function aH(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=aD(a),h=Q(1);b&&(d||(h=aE(a)));let i=(void 0===(e=c)&&(e=!1),d&&(!e||d===am(g))&&e)?aG(g):Q(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g){let a=am(g),b=d,c=a,e=aB(c);for(;e&&d&&b!==c;){let a=aE(e),b=e.getBoundingClientRect(),d=ax(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=aB(c=am(e))}}return ad({width:l,height:m,x:j,y:k})}function aI(a,b){let c=ay(a).scrollLeft;return b?b.left+c:aH(an(a)).left+c}function aJ(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-aI(a,c),y:c.top+b.scrollTop}}function aK(a,b,c){var d;let e;if("viewport"===b)e=function(a,b){let c=am(a),d=an(a),e=c.visualViewport,f=d.clientWidth,g=d.clientHeight,h=0,i=0;if(e){f=e.width,g=e.height;let a=av();(!a||a&&"fixed"===b)&&(h=e.offsetLeft,i=e.offsetTop)}let j=aI(d);if(j<=0){let a=d.ownerDocument,b=a.body,c=getComputedStyle(b),e="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,g=Math.abs(d.clientWidth-b.clientWidth-e);g<=25&&(f-=g)}else j<=25&&(f+=j);return{width:f,height:g,x:h,y:i}}(a,c);else if("document"===b){let b,c,f,g,h,i,j;d=an(a),b=an(d),c=ay(d),f=d.ownerDocument.body,g=N(b.scrollWidth,b.clientWidth,f.scrollWidth,f.clientWidth),h=N(b.scrollHeight,b.clientHeight,f.scrollHeight,f.clientHeight),i=-c.scrollLeft+aI(d),j=-c.scrollTop,"rtl"===ax(f).direction&&(i+=N(b.clientWidth,f.clientWidth)-g),e={width:g,height:h,x:i,y:j}}else if(1){let c=aG(a);e={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}else{let a,d,f,g,h,i;d=(a=aH(b,!0,"fixed"===c)).top+b.clientTop,f=a.left+b.clientLeft,g=Q(1),h=b.clientWidth*g.x,i=b.clientHeight*g.y,e={width:h,height:i,x:f*g.x,y:d*g.y}}return ad(e)}function aL(a){return"static"===ax(a).position}function aM(a,b){1;return null}function aN(a,b){var c;let d=am(a);if(aq(a))return d;1;{let b=az(a);for(;b&&!aw(b);){0;b=az(b)}return d}}let aO=async function(a){let b=this.getOffsetParent||aN,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){let d=an(b),e="fixed"===c,f=aH(a,!0,e,b),g={scrollLeft:0,scrollTop:0},h=Q(0);if(!e)if(("body"!==al(b)||ap(d))&&(g=ay(b)),1)d&&(h.x=aI(d));else{let a=aH(b,!0,e,b);h.x=a.x+b.clientLeft,h.y=a.y+b.clientTop}e&&d&&(h.x=aI(d));let i=!d||e?Q(0):aJ(d,g);return{x:f.left+g.scrollLeft-h.x-i.x,y:f.top+g.scrollTop-h.y-i.y,width:f.width,height:f.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},aP={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){let{elements:b,rect:c,offsetParent:d,strategy:e}=a,f="fixed"===e,g=an(d),h=!!b&&aq(b.floating);if(d===g||h&&f)return c;let i={scrollLeft:0,scrollTop:0},j=Q(1),k=Q(0);!f&&(("body"!==al(d)||ap(g))&&(i=ay(d)),0);let l=!g||f?Q(0):aJ(g,i);return{width:c.width*j.x,height:c.height*j.y,x:c.x*j.x-i.scrollLeft*j.x+k.x+l.x,y:c.y*j.y-i.scrollTop*j.y+k.y+l.y}},getDocumentElement:an,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?aq(b)?[]:function(a,b){let c=b.get(a);if(c)return c;let d=aA(a,[],!1).filter(a=>!1),e="fixed"===ax(a).position,f=e?az(a):a;return b.set(a,d),d}(b,this._c):[].concat(c),d],g=aK(b,f[0],e),h=g.top,i=g.right,j=g.bottom,k=g.left;for(let a=1;a<f.length;a++){let c=aK(b,f[a],e);h=N(c.top,h),i=M(c.right,i),j=M(c.bottom,j),k=N(c.left,k)}return{width:i-k,height:j-h,x:k,y:h}},getOffsetParent:aN,getElementRects:aO,getClientRects:function(a){return Array.from(a.getClientRects())},getDimensions:function(a){let{width:b,height:c}=aC(a);return{width:b,height:c}},getScale:aE,isElement:ao,isRTL:function(a){return"rtl"===ax(a).direction}};function aQ(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let aR=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=S(a,b)||{};if(null==j)return{};let l=ac(k),m={x:c,y:d},n=V(X(e)),o=W(n),p=await g.getDimensions(j),q="y"===n,r=q?"clientHeight":"clientWidth",s=f.reference[o]+f.reference[n]-m[n]-f.floating[o],t=m[n]-f.reference[n],u=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),v=u?u[r]:0;v&&await (null==g.isElement?void 0:g.isElement(u))||(v=h.floating[r]||f.floating[o]);let w=v/2-p[o]/2-1,x=M(l[q?"top":"left"],w),y=M(l[q?"bottom":"right"],w),z=v-p[o]-y,A=v/2-p[o]/2+(s/2-t/2),B=N(x,M(A,z)),C=!i.arrow&&null!=U(e)&&A!==B&&f.reference[o]/2-(A<x?x:y)-p[o]/2<0,D=C?A<x?A-x:A-z:0;return{[n]:m[n]+D,data:{[n]:B,centerOffset:A-B-D,...C&&{alignmentOffset:D}},reset:C}}});var aS="u">typeof document?p.useLayoutEffect:function(){};function aT(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!aT(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!aT(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function aU(a,b){return Math.round(+b)/1}function aV(a){let b=p.useRef(a);return aS(()=>{b.current=a}),b}var aW=p.forwardRef((a,b)=>{let{children:c,width:d=10,height:f=5,...g}=a;return(0,e.jsx)(A.svg,{...g,ref:b,width:d,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?c:(0,e.jsx)("polygon",{points:"0,0 30,0 15,10"})})});aW.displayName="Arrow";var aX="Popper",[aY,aZ]=u(aX),[a$,a_]=aY(aX),a0=a=>{let{__scopePopper:b,children:c}=a,[d,f]=p.useState(null),[g,h]=p.useState(void 0);return(0,e.jsx)(a$,{scope:b,anchor:d,onAnchorChange:f,placementState:g,setPlacementState:h,children:c})};a0.displayName=aX;var a1="PopperAnchor",a2=p.forwardRef((a,b)=>{let{__scopePopper:c,virtualRef:d,...f}=a,g=a_(a1,c),h=p.useRef(null),i=g.onAnchorChange,j=t(b,p.useCallback(a=>{h.current=a,a&&i(a)},[i])),k=p.useRef(null);p.useEffect(()=>{if(!d)return;let a=k.current;k.current=d.current,a!==k.current&&i(k.current)});let l=g.placementState&&bc(g.placementState),m=l?.[0],n=l?.[1];return d?null:(0,e.jsx)(A.div,{"data-radix-popper-side":m,"data-radix-popper-align":n,...f,ref:j})});a2.displayName=a1;var a3="PopperContent",[a4,a5]=aY(a3),a6=p.forwardRef((a,b)=>{var c,d,f,g,h,i,j,k,l,m,n,o,q;let r,s,u,w,x,y,{__scopePopper:z,side:C="bottom",sideOffset:D=0,align:E="center",alignOffset:F=0,arrowPadding:G=0,avoidCollisions:H=!0,collisionBoundary:J=[],collisionPadding:K=0,sticky:L="partial",hideWhenDetached:O=!1,updatePositionStrategy:Q="optimized",onPlaced:R,...ac}=a,ad=a_(a3,z),[ae,af]=p.useState(null),al=t(b,af),[am,ao]=p.useState(null),ap=function(a){let[b,c]=p.useState(void 0);return I(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=new ResizeObserver(b=>{let d,e;if(!Array.isArray(b)||!b.length)return;let f=b[0];if("borderBoxSize"in f){let a=f.borderBoxSize,b=Array.isArray(a)?a[0]:a;d=b.inlineSize,e=b.blockSize}else d=a.offsetWidth,e=a.offsetHeight;c({width:d,height:e})});return b.observe(a,{box:"border-box"}),()=>b.unobserve(a)}c(void 0)},[a]),b}(am),aq=ap?.width??0,ar=ap?.height??0,as="number"==typeof K?K:{top:0,right:0,bottom:0,left:0,...K},at=Array.isArray(J)?J:[J],au=at.length>0,av={padding:as,boundary:at.filter(ba),altBoundary:au},{refs:aw,floatingStyles:ax,placement:ay,isPositioned:az,middlewareData:aB}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:d=[],platform:e,elements:{reference:f,floating:g}={},transform:h=!0,whileElementsMounted:i,open:j}=a,[k,l]=p.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[m,n]=p.useState(d);aT(m,d)||n(d);let[o,q]=p.useState(null),[r,s]=p.useState(null),t=p.useCallback(a=>{a!==y.current&&(y.current=a,q(a))},[]),u=p.useCallback(a=>{a!==z.current&&(z.current=a,s(a))},[]),w=f||o,x=g||r,y=p.useRef(null),z=p.useRef(null),A=p.useRef(k),B=null!=i,C=aV(i),D=aV(e),E=aV(j),F=p.useCallback(()=>{var a,d;let e,f,g;if(!y.current||!z.current)return;let h={placement:b,strategy:c,middleware:m};D.current&&(h.platform=D.current),(a=y.current,d=z.current,e=new Map,g={...(f={platform:aP,...h}).platform,_c:e},ag(a,d,{...f,platform:g})).then(a=>{let b={...a,isPositioned:!1!==E.current};G.current&&!aT(A.current,b)&&(A.current=b,v.flushSync(()=>{l(b)}))})},[m,b,c,D,E]);aS(()=>{!1===j&&A.current.isPositioned&&(A.current.isPositioned=!1,l(a=>({...a,isPositioned:!1})))},[j]);let G=p.useRef(!1);aS(()=>(G.current=!0,()=>{G.current=!1}),[]),aS(()=>{if(w&&(y.current=w),x&&(z.current=x),w&&x){if(C.current)return C.current(w,x,F);F()}},[w,x,F,C,B]);let H=p.useMemo(()=>({reference:y,floating:z,setReference:t,setFloating:u}),[t,u]),I=p.useMemo(()=>({reference:w,floating:x}),[w,x]),J=p.useMemo(()=>{let a={position:c,left:0,top:0};if(!I.floating)return a;let b=aU(I.floating,k.x),d=aU(I.floating,k.y);if(h)return{...a,transform:"translate("+b+"px, "+d+"px)",...(I.floating,false)};return{position:c,left:b,top:d}},[c,h,I.floating,k.x,k.y]);return p.useMemo(()=>({...k,update:F,refs:H,elements:I,floatingStyles:J}),[k,F,H,I,J])}({strategy:"fixed",placement:C+("center"!==E?"-"+E:""),whileElementsMounted:(...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=aD(a),l=f||g?[...k?aA(k):[],...b?aA(b):[]]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c,{passive:!0}),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b){let c,d=null,e=an(a);function f(){var a;clearTimeout(c),null==(a=d)||a.disconnect(),d=null}return!function g(h,i){void 0===h&&(h=!1),void 0===i&&(i=1),f();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(h||b(),!m||!n)return;let o={rootMargin:-P(l)+"px "+-P(e.clientWidth-(k+m))+"px "+-P(e.clientHeight-(l+n))+"px "+-P(k)+"px",threshold:N(0,M(1,i))||1},p=!0;function q(b){let d=b[0].intersectionRatio;if(d!==i){if(!p)return g();d?g(!1,d):c=setTimeout(()=>{g(!1,1e-7)},1e3)}1!==d||aQ(j,a.getBoundingClientRect())||g(),p=!1}try{d=new IntersectionObserver(q,{...o,root:e.ownerDocument})}catch(a){d=new IntersectionObserver(q,o)}d.observe(a)}(!0),f}(k,c):null,n=-1,o=null;h&&(o=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&o&&b&&(o.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=o)||a.observe(b)})),c()}),k&&!j&&o.observe(k),b&&o.observe(b));let p=j?aH(a):null;return j&&function b(){let d=aH(a);p&&!aQ(p,d)&&c(),p=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=o)||a.disconnect(),o=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:"always"===Q}),elements:{reference:ad.anchor},middleware:[{name:(r={name:"offset",options:d=c={mainAxis:D+ar,alignmentAxis:F},async fn(a){var b,c;let{x:e,y:f,placement:g,middlewareData:h}=a,i=await ak(a,d);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(c=h.arrow)&&c.alignmentOffset?{}:{x:e+i.x,y:f+i.y,data:{...i,placement:g}}}}).name,fn:r.fn,options:[c,void 0]},H&&{name:(s={name:"shift",options:h=g={mainAxis:!0,crossAxis:!1,limiter:"partial"===L?{fn:(f=void 0,{options:f={},fn(a){let{x:b,y:c,placement:d,rects:e,middlewareData:g}=a,{offset:h=0,mainAxis:i=!0,crossAxis:j=!0}=S(f,a),k={x:b,y:c},l=X(d),m=V(l),n=k[m],o=k[l],p=S(h,a),q="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(i){let a="y"===m?"height":"width",b=e.reference[m]-e.floating[a]+q.mainAxis,c=e.reference[m]+e.reference[a]-q.mainAxis;n<b?n=b:n>c&&(n=c)}if(j){var r,s;let a="y"===m?"width":"height",b=aj.has(T(d)),c=e.reference[l]-e.floating[a]+(b&&(null==(r=g.offset)?void 0:r[l])||0)+(b?0:q.crossAxis),f=e.reference[l]+e.reference[a]+(b?0:(null==(s=g.offset)?void 0:s[l])||0)-(b?q.crossAxis:0);o<c?o=c:o>f&&(o=f)}return{[m]:n,[l]:o}}}).fn,options:[void 0,void 0]}:void 0,...av},async fn(a){let{x:b,y:c,placement:d,platform:e}=a,{mainAxis:f=!0,crossAxis:g=!1,limiter:i={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...j}=S(h,a),k={x:b,y:c},l=await e.detectOverflow(a,j),m=X(T(d)),n=V(m),o=k[n],p=k[m];if(f){let a="y"===n?"top":"left",b="y"===n?"bottom":"right",c=o+l[a],d=o-l[b];o=N(c,M(o,d))}if(g){let a="y"===m?"top":"left",b="y"===m?"bottom":"right",c=p+l[a],d=p-l[b];p=N(c,M(p,d))}let q=i.fn({...a,[n]:o,[m]:p});return{...q,data:{x:q.x-b,y:q.y-c,enabled:{[n]:f,[m]:g}}}}}).name,fn:s.fn,options:[g,void 0]},H&&{name:(u={name:"flip",options:j=i={...av},async fn(a){var b,c,d,e,f,g,h,i;let k,l,m,{placement:n,middlewareData:o,rects:p,initialPlacement:q,platform:r,elements:s}=a,{mainAxis:t=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...z}=S(j,a);if(null!=(b=o.arrow)&&b.alignmentOffset)return{};let A=T(n),B=X(q),C=T(q)===q,D=await (null==r.isRTL?void 0:r.isRTL(s.floating)),E=v||(C||!y?[ab(q)]:(k=ab(q),[Y(q),k,Y(k)])),F="none"!==x;!v&&F&&E.push(...(l=U(q),m=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?$:Z;return b?Z:$;case"left":case"right":return b?_:aa;default:return[]}}(T(q),"start"===x,D),l&&(m=m.map(a=>a+"-"+l),y&&(m=m.concat(m.map(Y)))),m));let G=[q,...E],H=await r.detectOverflow(a,z),I=[],J=(null==(c=o.flip)?void 0:c.overflows)||[];if(t&&I.push(H[A]),u){let a,b,c,d,e=(g=n,h=p,void 0===(i=D)&&(i=!1),a=U(g),c=W(b=V(X(g))),d="x"===b?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top",h.reference[c]>h.floating[c]&&(d=ab(d)),[d,ab(d)]);I.push(H[e[0]],H[e[1]])}if(J=[...J,{placement:n,overflows:I}],!I.every(a=>a<=0)){let a=((null==(d=o.flip)?void 0:d.index)||0)+1,b=G[a];if(b&&("alignment"!==u||B===X(b)||J.every(a=>X(a.placement)!==B||a.overflows[0]>0)))return{data:{index:a,overflows:J},reset:{placement:b}};let c=null==(e=J.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:e.placement;if(!c)switch(w){case"bestFit":{let a=null==(f=J.filter(a=>{if(F){let b=X(a.placement);return b===B||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:f[0];a&&(c=a);break}case"initialPlacement":c=q}if(n!==c)return{reset:{placement:c}}}return{}}}).name,fn:u.fn,options:[i,void 0]},{name:(w={name:"size",options:l=k={...av,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}},async fn(a){var b,c;let d,e,{placement:f,rects:g,platform:h,elements:i}=a,{apply:j=()=>{},...k}=S(l,a),m=await h.detectOverflow(a,k),n=T(f),o=U(f),p="y"===X(f),{width:q,height:r}=g.floating;"top"===n||"bottom"===n?(d=n,e=o===(await (null==h.isRTL?void 0:h.isRTL(i.floating))?"start":"end")?"left":"right"):(e=n,d="end"===o?"top":"bottom");let s=r-m.top-m.bottom,t=q-m.left-m.right,u=M(r-m[d],s),v=M(q-m[e],t),w=!a.middlewareData.shift,x=u,y=v;if(null!=(b=a.middlewareData.shift)&&b.enabled.x&&(y=t),null!=(c=a.middlewareData.shift)&&c.enabled.y&&(x=s),w&&!o){let a=N(m.left,0),b=N(m.right,0),c=N(m.top,0),d=N(m.bottom,0);p?y=q-2*(0!==a||0!==b?a+b:N(m.left,m.right)):x=r-2*(0!==c||0!==d?c+d:N(m.top,m.bottom))}await j({...a,availableWidth:y,availableHeight:x});let z=await h.getDimensions(i.floating);return q!==z.width||r!==z.height?{reset:{rects:!0}}:{}}}).name,fn:w.fn,options:[k,void 0]},am&&{name:(x={name:"arrow",options:n=m={element:am,padding:G},fn(a){let{element:b,padding:c}="function"==typeof n?n(a):n;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?aR({element:b.current,padding:c}).fn(a):{}:b?aR({element:b,padding:c}).fn(a):{}}}).name,fn:x.fn,options:[m,void 0]},bb({arrowWidth:aq,arrowHeight:ar}),O&&{name:(y={name:"hide",options:q=o={strategy:"referenceHidden",...av,boundary:au?av.boundary:void 0},async fn(a){let{rects:b,platform:c}=a,{strategy:d="referenceHidden",...e}=S(q,a);switch(d){case"referenceHidden":{let d=ah(await c.detectOverflow(a,{...e,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:ai(d)}}}case"escaped":{let d=ah(await c.detectOverflow(a,{...e,altBoundary:!0}),b.floating);return{data:{escapedOffsets:d,escaped:ai(d)}}}default:return{}}}}).name,fn:y.fn,options:[o,void 0]}]}),aC=ad.setPlacementState;I(()=>(aC(ay),()=>{aC(void 0)}),[ay,aC]);let[aE,aF]=bc(ay),aG=B(R);I(()=>{az&&aG?.()},[az,aG]);let aI=aB.arrow?.x,aJ=aB.arrow?.y,aK=aB.arrow?.centerOffset!==0,[aL,aM]=p.useState();return I(()=>{ae&&aM(window.getComputedStyle(ae).zIndex)},[ae]),(0,e.jsx)("div",{ref:aw.setFloating,"data-radix-popper-content-wrapper":"",style:{...ax,transform:az?ax.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:aL,"--radix-popper-transform-origin":[aB.transformOrigin?.x,aB.transformOrigin?.y].join(" "),...aB.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,e.jsx)(a4,{scope:z,placedSide:aE,placedAlign:aF,onArrowChange:ao,arrowX:aI,arrowY:aJ,shouldHideArrow:aK,children:(0,e.jsx)(A.div,{"data-side":aE,"data-align":aF,...ac,ref:al,style:{...ac.style,animation:az?void 0:"none"}})})})});a6.displayName=a3;var a7="PopperArrow",a8={top:"bottom",right:"left",bottom:"top",left:"right"},a9=p.forwardRef(function(a,b){let{__scopePopper:c,...d}=a,f=a5(a7,c),g=a8[f.placedSide];return(0,e.jsx)("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[g]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:(0,e.jsx)(aW,{...d,ref:b,style:{...d.style,display:"block"}})})});function ba(a){return null!==a}a9.displayName=a7;var bb=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=bc(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function bc(a){let[b,c="center"]=a.split("-");return[b,c]}var bd=p.forwardRef((a,b)=>{let{container:c,...d}=a,[f,g]=p.useState(!1);I(()=>g(!0),[]);let h=c||f&&globalThis?.document?.body;return h?v.createPortal((0,e.jsx)(A.div,{...d,ref:b}),h):null});bd.displayName="Portal";var be=a=>{var b;let c,d,{present:e,children:f}=a,g=function(a){var b,c;let[d,e]=p.useState(),f=p.useRef(null),g=p.useRef(a),h=p.useRef("none"),i=p.useRef(void 0),[j,k]=(b=a?"mounted":"unmounted",c={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},p.useReducer((a,b)=>c[a][b]??a,b));return p.useEffect(()=>{"mounted"===j?(h.current=i.current??bg(f.current),i.current=void 0):h.current="none"},[j]),I(()=>{let b=f.current,c=g.current;if(c!==a){let d=h.current,e=bg(b);a?(i.current=e,k("MOUNT")):"none"===e||b?.display==="none"?k("UNMOUNT"):c&&d!==e?k("ANIMATION_OUT"):k("UNMOUNT"),g.current=a}},[a,k]),I(()=>{if(d){let a,b=d.ownerDocument.defaultView??window,c=c=>{let e=bg(f.current).includes(CSS.escape(c.animationName));if(c.target===d&&e&&(k("ANIMATION_END"),!g.current)){let c=d.style.animationFillMode;d.style.animationFillMode="forwards",a=b.setTimeout(()=>{"forwards"===d.style.animationFillMode&&(d.style.animationFillMode=c)})}},e=a=>{a.target===d&&(h.current=bg(f.current))};return d.addEventListener("animationstart",e),d.addEventListener("animationcancel",c),d.addEventListener("animationend",c),()=>{b.clearTimeout(a),d.removeEventListener("animationstart",e),d.removeEventListener("animationcancel",c),d.removeEventListener("animationend",c)}}k("ANIMATION_END")},[d,k]),{isPresent:["mounted","unmountSuspended"].includes(j),ref:p.useCallback(a=>{if(a){let b=getComputedStyle(a);f.current=b,i.current=bg(b)}else f.current=null;e(a)},[])}}(e),h="function"==typeof f?f({present:g.isPresent}):p.Children.only(f),i=function(...a){let b=p.useRef(a);return b.current=a,p.useCallback(a=>{let c=b.current,d=!1,e=c.map(b=>{let c=bf(b,a);return d||"function"!=typeof c||(d=!0),c});if(d)return()=>{for(let a=0;a<e.length;a++){let b=e[a];"function"==typeof b?b():bf(c[a],null)}}},[])}(g.ref,(b=h,(d=(c=Object.getOwnPropertyDescriptor(b.props,"ref")?.get)&&"isReactWarning"in c&&c.isReactWarning)?b.ref:(d=(c=Object.getOwnPropertyDescriptor(b,"ref")?.get)&&"isReactWarning"in c&&c.isReactWarning)?b.props.ref:b.props.ref||b.ref));return"function"==typeof f||g.isPresent?p.cloneElement(h,{ref:i}):null};function bf(a,b){if("function"==typeof a)return a(b);null!=a&&(a.current=b)}function bg(a){return a?.animationName||"none"}be.displayName="Presence",p[" useEffectEvent ".trim().toString()],p[" useInsertionEffect ".trim().toString()];var bh=p[" useInsertionEffect ".trim().toString()]||I;Symbol("RADIX:SYNC_STATE");var bi=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"}),bj=p.forwardRef((a,b)=>(0,e.jsx)(A.span,{...a,ref:b,style:{...bi,...a.style}}));bj.displayName="VisuallyHidden";var[bk,bl]=u("Tooltip",[aZ]),bm=aZ(),bn="TooltipProvider",bo="tooltip.open",[bp,bq]=bk(bn),br=a=>{let{__scopeTooltip:b,delayDuration:c=700,skipDelayDuration:d=300,disableHoverableContent:f=!1,children:g}=a,h=p.useRef(!0),i=p.useRef(!1),j=p.useRef(0);return p.useEffect(()=>{let a=j.current;return()=>window.clearTimeout(a)},[]),(0,e.jsx)(bp,{scope:b,isOpenDelayedRef:h,delayDuration:c,onOpen:p.useCallback(()=>{d<=0||(window.clearTimeout(j.current),h.current=!1)},[d]),onClose:p.useCallback(()=>{d<=0||(window.clearTimeout(j.current),j.current=window.setTimeout(()=>h.current=!0,d))},[d]),isPointerInTransitRef:i,onPointerInTransitChange:p.useCallback(a=>{i.current=a},[]),disableHoverableContent:f,children:g})};br.displayName=bn;var bs="Tooltip",[bt,bu]=bk(bs),bv=a=>{let{__scopeTooltip:b,children:c,open:d,defaultOpen:f,onOpenChange:g,disableHoverableContent:h,delayDuration:i}=a,j=bq(bs,a.__scopeTooltip),k=bm(b),[l,m]=p.useState(null),n=function(){let[a,b]=p.useState(J());return I(()=>{b(a=>a??String(K++))},[void 0]),a?`radix-${a}`:""}(),o=p.useRef(0),q=h??j.disableHoverableContent,r=i??j.delayDuration,s=p.useRef(!1),[t,u]=function({prop:a,defaultProp:b,onChange:c=()=>{},caller:d}){let[e,f,g]=function({defaultProp:a,onChange:b}){let[c,d]=p.useState(a),e=p.useRef(c),f=p.useRef(b);return bh(()=>{f.current=b},[b]),p.useEffect(()=>{e.current!==c&&(f.current?.(c),e.current=c)},[c,e]),[c,d,f]}({defaultProp:b,onChange:c}),h=void 0!==a,i=h?a:e;{let b=p.useRef(void 0!==a);p.useEffect(()=>{let a=b.current;if(a!==h){let b=h?"controlled":"uncontrolled";console.warn(`${d} is changing from ${a?"controlled":"uncontrolled"} to ${b}. 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.`)}b.current=h},[h,d])}return[i,p.useCallback(b=>{if(h){let c="function"==typeof b?b(a):b;c!==a&&g.current?.(c)}else f(b)},[h,a,f,g])]}({prop:d,defaultProp:f??!1,onChange:a=>{a?(j.onOpen(),document.dispatchEvent(new CustomEvent(bo))):j.onClose(),g?.(a)},caller:bs}),v=p.useMemo(()=>t?s.current?"delayed-open":"instant-open":"closed",[t]),w=p.useCallback(()=>{window.clearTimeout(o.current),o.current=0,s.current=!1,u(!0)},[u]),x=p.useCallback(()=>{window.clearTimeout(o.current),o.current=0,u(!1)},[u]),y=p.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>{s.current=!0,u(!0),o.current=0},r)},[r,u]);return p.useEffect(()=>()=>{o.current&&(window.clearTimeout(o.current),o.current=0)},[]),(0,e.jsx)(a0,{...k,children:(0,e.jsx)(bt,{scope:b,contentId:n,open:t,stateAttribute:v,trigger:l,onTriggerChange:m,onTriggerEnter:p.useCallback(()=>{j.isOpenDelayedRef.current?y():w()},[j.isOpenDelayedRef,y,w]),onTriggerLeave:p.useCallback(()=>{q?x():(window.clearTimeout(o.current),o.current=0)},[x,q]),onOpen:w,onClose:x,disableHoverableContent:q,children:c})})};bv.displayName=bs;var bw="TooltipTrigger",bx=p.forwardRef((a,b)=>{let{__scopeTooltip:c,...d}=a,f=bu(bw,c),g=bq(bw,c),h=bm(c),i=t(b,p.useRef(null),f.onTriggerChange),j=p.useRef(!1),k=p.useRef(!1),l=p.useCallback(()=>j.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),(0,e.jsx)(a2,{asChild:!0,...h,children:(0,e.jsx)(A.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...d,ref:i,onPointerMove:r(a.onPointerMove,a=>{"touch"!==a.pointerType&&(k.current||g.isPointerInTransitRef.current||(f.onTriggerEnter(),k.current=!0))}),onPointerLeave:r(a.onPointerLeave,()=>{f.onTriggerLeave(),k.current=!1}),onPointerDown:r(a.onPointerDown,()=>{f.open&&f.onClose(),j.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:r(a.onFocus,()=>{j.current||f.onOpen()}),onBlur:r(a.onBlur,f.onClose),onClick:r(a.onClick,f.onClose)})})});bx.displayName=bw;var by="TooltipPortal",[bz,bA]=bk(by,{forceMount:void 0}),bB=a=>{let{__scopeTooltip:b,forceMount:c,children:d,container:f}=a,g=bu(by,b);return(0,e.jsx)(bz,{scope:b,forceMount:c,children:(0,e.jsx)(be,{present:c||g.open,children:(0,e.jsx)(bd,{asChild:!0,container:f,children:d})})})};bB.displayName=by;var bC="TooltipContent",bD=p.forwardRef((a,b)=>{let c=bA(bC,a.__scopeTooltip),{forceMount:d=c.forceMount,side:f="top",...g}=a,h=bu(bC,a.__scopeTooltip);return(0,e.jsx)(be,{present:d||h.open,children:h.disableHoverableContent?(0,e.jsx)(bI,{side:f,...g,ref:b}):(0,e.jsx)(bE,{side:f,...g,ref:b})})}),bE=p.forwardRef((a,b)=>{let c=bu(bC,a.__scopeTooltip),d=bq(bC,a.__scopeTooltip),f=p.useRef(null),g=t(b,f),[h,i]=p.useState(null),{trigger:j,onClose:k}=c,l=f.current,{onPointerInTransitChange:m}=d,n=p.useCallback(()=>{i(null),m(!1)},[m]),o=p.useCallback((a,b)=>{let c,d=a.currentTarget,e={x:a.clientX,y:a.clientY},f=function(a,b){let c=Math.abs(b.top-a.y),d=Math.abs(b.bottom-a.y),e=Math.abs(b.right-a.x),f=Math.abs(b.left-a.x);switch(Math.min(c,d,e,f)){case f:return"left";case e:return"right";case c:return"top";case d:return"bottom";default:throw Error("unreachable")}}(e,d.getBoundingClientRect());i(((c=[...function(a,b,c=5){let d=[];switch(b){case"top":d.push({x:a.x-c,y:a.y+c},{x:a.x+c,y:a.y+c});break;case"bottom":d.push({x:a.x-c,y:a.y-c},{x:a.x+c,y:a.y-c});break;case"left":d.push({x:a.x+c,y:a.y-c},{x:a.x+c,y:a.y+c});break;case"right":d.push({x:a.x-c,y:a.y-c},{x:a.x-c,y:a.y+c})}return d}(e,f),...function(a){let{top:b,right:c,bottom:d,left:e}=a;return[{x:e,y:b},{x:c,y:b},{x:c,y:d},{x:e,y:d}]}(b.getBoundingClientRect())].slice()).sort((a,b)=>a.x<b.x?-1:a.x>b.x?1:a.y<b.y?-1:1*!!(a.y>b.y)),function(a){if(a.length<=1)return a.slice();let b=[];for(let c=0;c<a.length;c++){let d=a[c];for(;b.length>=2;){let a=b[b.length-1],c=b[b.length-2];if((a.x-c.x)*(d.y-c.y)>=(a.y-c.y)*(d.x-c.x))b.pop();else break}b.push(d)}b.pop();let c=[];for(let b=a.length-1;b>=0;b--){let d=a[b];for(;c.length>=2;){let a=c[c.length-1],b=c[c.length-2];if((a.x-b.x)*(d.y-b.y)>=(a.y-b.y)*(d.x-b.x))c.pop();else break}c.push(d)}return(c.pop(),1===b.length&&1===c.length&&b[0].x===c[0].x&&b[0].y===c[0].y)?b:b.concat(c)}(c))),m(!0)},[m]);return p.useEffect(()=>()=>n(),[n]),p.useEffect(()=>{if(j&&l){let a=a=>o(a,l),b=a=>o(a,j);return j.addEventListener("pointerleave",a),l.addEventListener("pointerleave",b),()=>{j.removeEventListener("pointerleave",a),l.removeEventListener("pointerleave",b)}}},[j,l,o,n]),p.useEffect(()=>{if(h){let a=a=>{let b=a.target,c={x:a.clientX,y:a.clientY},d=j?.contains(b)||l?.contains(b),e=!function(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}(c,h);d?n():e&&(n(),k())};return document.addEventListener("pointermove",a),()=>document.removeEventListener("pointermove",a)}},[j,l,h,k,n]),(0,e.jsx)(bI,{...a,ref:g})}),[bF,bG]=bk(bs,{isInside:!1}),bH=((c=a=>"child"in a?a.children(a.child):a.children).displayName="TooltipContent.Slottable",c.__radixId=w,c),bI=p.forwardRef((a,b)=>{let{__scopeTooltip:c,children:d,"aria-label":f,onEscapeKeyDown:g,onPointerDownOutside:h,...i}=a,j=bu(bC,c),k=bm(c),{onClose:l}=j;return p.useEffect(()=>(document.addEventListener(bo,l),()=>document.removeEventListener(bo,l)),[l]),p.useEffect(()=>{if(j.trigger){let a=a=>{a.target instanceof Node&&a.target.contains(j.trigger)&&l()};return window.addEventListener("scroll",a,{capture:!0}),()=>window.removeEventListener("scroll",a,{capture:!0})}},[j.trigger,l]),(0,e.jsx)(E,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:g,onPointerDownOutside:h,onFocusOutside:a=>a.preventDefault(),onDismiss:l,children:(0,e.jsxs)(a6,{"data-state":j.stateAttribute,...k,...i,ref:b,style:{...i.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,e.jsx)(bH,{children:d}),(0,e.jsx)(bF,{scope:c,isInside:!0,children:(0,e.jsx)(bj,{id:j.contentId,role:"tooltip",children:f||d})})]})})});bD.displayName=bC;var bJ="TooltipArrow",bK=p.forwardRef((a,b)=>{let{__scopeTooltip:c,...d}=a,f=bm(c);return bG(bJ,c).isInside?null:(0,e.jsx)(a9,{...f,...d,ref:b})});function bL({delayDuration:a=0,...b}){return(0,e.jsx)(br,{delayDuration:a,...b})}function bM(a){return(0,e.jsx)(bL,{children:(0,e.jsx)(bv,{...a})})}function bN(a){return(0,e.jsx)(bx,{...a})}function bO({className:a,sideOffset:b=4,children:c,...d}){return(0,e.jsx)(bB,{children:(0,e.jsxs)(bD,{sideOffset:b,className:(0,j.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",a),...d,children:[c,(0,e.jsx)(bK,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] fill-primary"})]})})}bK.displayName=bJ;var bP=a.i(3015);let bQ=[{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 bR({url:a}){let[b,c]=(0,p.useState)(!1),d=(0,p.useRef)(null);(0,p.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]);let f=(0,p.useCallback)(async()=>{try{await navigator.clipboard.writeText(a),c(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>c(!1),1500)}catch{}},[a]);return(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",onClick:f,children:[b?(0,e.jsx)(h.Icons.check,{}):(0,e.jsx)(h.Icons.copy,{}),b?"Copied":"Copy URL"]})}function bS({reason:a,children:b}){return a?(0,e.jsxs)(bM,{children:[(0,e.jsx)(bN,{asChild:!0,children:(0,e.jsx)("span",{className:"cursor-not-allowed",children:b})}),(0,e.jsx)(bO,{children:a})]}):(0,e.jsx)(e.Fragment,{children:b})}function bT({box:a}){let{webUrl:b,vncUrl:c}=a,{apps:d,supported:f,pending:g,launch:i}=function(a){let[b,c]=(0,p.useState)(null),[d,e]=(0,p.useState)(null);(0,p.useEffect)(()=>{let a=!0;return(async()=>{try{let b=await fetch("/api/v1/open-targets",{credentials:"same-origin"});a&&c(b.ok?await b.json():null)}catch{a&&c(null)}})(),()=>{a=!1}},[]);let f=(0,p.useCallback)(async b=>{e(b);try{let c=await fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:b})});if(!c.ok){let a=await c.json().catch(()=>null);window.alert(`Open in ${b} failed: ${a?.error?.message??`HTTP ${c.status}`}`)}}catch(a){window.alert(`Open in ${b} failed: ${a instanceof Error?a.message:String(a)}`)}finally{e(null)}},[a.id]),g=b?.supported?b.targets:null;return{apps:g?bQ.map(({app:b,label:c,icon:d})=>{let e=g[b],f=e.available?e.providers&&!e.providers.includes(a.provider)?`Not available for ${a.provider} boxes`:null:e.reason??`${c} is not installed`;return{app:b,label:c,icon:d,disabledReason:f}}):[],supported:null!==g,pending:d,launch:f}}(a),j="paused"===a.status?"Box is paused — resume to access":"stopped"===a.status?"Box is stopped — start to access":null,k=b?null:j??"No web service exposed",m=c?null:!1===a.vncEnabled?"VNC is not enabled for this box":j??"VNC is not available";return f||b||c?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(bP.SectionLabel,{children:"Access"}),(0,e.jsxs)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,e.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,e.jsx)("div",{className:"text-[13.5px] font-medium",children:b||!c?"Web":"VNC"}),(0,e.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:b??(c?"Remote desktop":k)})]}),(0,e.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[b?(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",href:b,target:"_blank",rel:"noreferrer",children:[(0,e.jsx)(h.Icons.ext,{}),"Open web"]}):(0,e.jsx)(bS,{reason:k,children:(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,e.jsx)(h.Icons.ext,{}),"Open web"]})}),b?(0,e.jsx)(bR,{url:b}):null,c?(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",href:c,target:"_blank",rel:"noreferrer",onClick:()=>{fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/screen`,{method:"POST",credentials:"same-origin"}).catch(()=>{})},children:[(0,e.jsx)(h.Icons.ext,{}),"Open VNC"]}):(0,e.jsx)(bS,{reason:m,children:(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,e.jsx)(h.Icons.ext,{}),"Open VNC"]})})]})]}),f?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,e.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,e.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,e.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,e.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:d.map(({app:a,label:b,icon:c,disabledReason:d})=>{let f=h.Icons[c];return(0,e.jsx)(bS,{reason:d,children:(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:null!==d||null!==g,onClick:()=>void i(a),children:[(0,e.jsx)(f,{}),b]})},a)})})]}):null]})]}):null}var bU=a.i(24288),bV=a.i(17236),bW=a.i(51363);function bX({k:a,v:b,mono:c,link:d}){return(0,e.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,e.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:a}),(0,e.jsx)("div",{className:(0,j.cn)("min-w-0 text-[13.5px]",c?"font-mono text-[13px]":""),children:d?(0,e.jsx)(bW.default,{className:"cursor-pointer text-primary",href:d,children:b}):b})]})}var bY=a.i(12019),bZ=a.i(45515),b$=a.i(85883),b_=a.i(34537),b0=a.i(53596),b1=a.i(96664);let b2=(0,b1.createServerReference)("70fd109611adee18e2a11d04af4332c29e796848e9",b1.callServer,void 0,b1.findSourceMapURL,"gitBranchAction"),b3=(0,b1.createServerReference)("600e7ece96e4038f118842cef0ebcf51dadf743c9b",b1.callServer,void 0,b1.findSourceMapURL,"gitCheckoutAction"),b4=(0,b1.createServerReference)("605f4904ee0814a4a51c0445aa18e7dfbde590c7e5",b1.callServer,void 0,b1.findSourceMapURL,"gitPullAction"),b5=(0,b1.createServerReference)("60675b1179af1a57b7c4bb6e4d893805dd8f7b0b66",b1.callServer,void 0,b1.findSourceMapURL,"gitPushAction"),b6=(0,b1.createServerReference)("607692631dd5973ad6071d94f3fee9c7da56a766db",b1.callServer,void 0,b1.findSourceMapURL,"gitPushHostAction"),b7=0;function b8({toasts:a,dismiss:b}){return(0,e.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:a.map(a=>(0,e.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,e.jsx)("span",{className:(0,j.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===a.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===a.variant?(0,e.jsx)(h.Icons.warn,{className:"size-3.5"}):(0,e.jsx)(h.Icons.check,{className:"size-3.5"})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:a.title}),a.detail?(0,e.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:a.detail}):null]}),(0,e.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:()=>b(a.id),"aria-label":"Dismiss",children:(0,e.jsx)(h.Icons.x,{className:"size-3"})})]},a.id))})}function b9({label:a,desc:b,children:c}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,e.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,e.jsx)("div",{className:"text-[13.5px] font-medium",children:a}),(0,e.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:b})]}),(0,e.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:c})]})}function ca({icon:a,disabled:b,onRun:c,children:d}){let[f,g]=(0,p.useState)(!1),h=async()=>{g(!0);try{await c()}finally{g(!1)}};return(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:b||f,onClick:h,children:[f?(0,e.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,e.jsx)(a,{}),d]})}function cb(a,b){let c=(a??"").trim()||(b??"").trim();return c?c.split("\n")[0]:void 0}function cc({box:a}){let b=(0,f.useRouter)(),{toasts:c,push:d,dismiss:g}=function(){let[a,b]=(0,p.useState)([]),c=(0,p.useCallback)(a=>b(b=>b.filter(b=>b.id!==a)),[]);return{toasts:a,push:(0,p.useCallback)(a=>{let d=++b7;b(b=>[...b,{id:d,...a}]),setTimeout(()=>c(d),4200)},[c]),dismiss:c}}(),[i,k]=(0,p.useState)(null),[m,n]=(0,p.useState)(null),o="running"!==a.status,r=(0,p.useCallback)(async()=>{try{let b=await fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/git`,{credentials:"same-origin"});k(b.ok?await b.json():null)}catch{k(null)}},[a.id]);(0,p.useEffect)(()=>{r()},[r]);let s=i?.ok&&i.branch?i.branch:a.branch||"—",t=()=>{r(),b.refresh()},u=async(a,b)=>{let c=await b();c.ok?(d({title:a,detail:cb(c.stdout,c.stderr)}),t()):d({variant:"error",title:`${a} failed`,detail:c.error})};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(l.Card,{className:(0,j.cn)("divide-y divide-border/60 overflow-hidden",o?"opacity-90":""),children:[o?(0,e.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,e.jsx)(h.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",a.status," — git operations need a running box."]}):null,(0,e.jsxs)(b9,{label:"Sync",desc:`origin ↔ ${s}`,children:[(0,e.jsx)(ca,{icon:h.Icons.arrowL,disabled:o,onRun:()=>u("Pulled from origin",()=>b4(a.id)),children:"Pull"}),(0,e.jsx)(ca,{icon:h.Icons.ext,disabled:o,onRun:()=>u("Pushed to origin",()=>b5(a.id)),children:"Push"}),(0,e.jsx)(ca,{icon:h.Icons.host,disabled:o,onRun:()=>u("Pushed to host",()=>b6(a.id)),children:"Push to host"})]}),(0,e.jsxs)(b9,{label:"Branch",desc:`currently on ${s}`,children:[(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:o,onClick:()=>n("change"),children:[(0,e.jsx)(h.Icons.branch,{}),"Change branch"]}),(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:o,onClick:()=>n("new"),children:[(0,e.jsx)(h.Icons.plus,{}),"New branch"]})]})]}),"change"===m?(0,e.jsx)(cf,{box:a,branch:s,onClose:()=>n(null),onDone:d,onRefresh:t}):null,"new"===m?(0,e.jsx)(cg,{box:a,onClose:()=>n(null),onDone:d,onRefresh:t}):null,(0,e.jsx)(b8,{toasts:c,dismiss:g})]})}let cd="__manual__";function ce({boxId:a,value:b,onChange:c,id:d,headLabel:f,currentBranch:g}){let[h,i]=(0,p.useState)(null),[j,k]=(0,p.useState)(g??null),[l,m]=(0,p.useState)(!1);return((0,p.useEffect)(()=>{let b=!1;return(async()=>{try{let c=await fetch(`/api/v1/boxes/${encodeURIComponent(a)}/branches`,{credentials:"same-origin"}),d=c.ok?await c.json():null;if(b)return;d&&Array.isArray(d.branches)&&d.branches.length>0?(i(d.branches),g||"string"!=typeof d.current||k(d.current)):(i([]),m(!0))}catch{b||(i([]),m(!0))}})(),()=>{b=!0}},[a,g]),null===h)?(0,e.jsx)(b0.Select,{id:d,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,e.jsx)("option",{value:"",children:"Loading branches…"})}):l?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(b$.Input,{id:d,className:"font-mono text-[13px]",autoFocus:!0,value:b,onChange:a=>c(a.target.value),placeholder:f?"HEAD":"feature-x"}),h.length>0?(0,e.jsx)("button",{type:"button",onClick:()=>{m(!1),c("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,e.jsxs)(b0.Select,{id:d,value:b,wrapperClassName:"w-full",onChange:a=>{if(a.target.value===cd){m(!0),c("");return}c(a.target.value)},children:[f?(0,e.jsx)("option",{value:"",children:f}):(0,e.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,e.jsx)("option",{value:cd,children:"Other / type manually…"}),(0,e.jsx)("option",{disabled:!0,children:"────────────"}),h.map(a=>(0,e.jsxs)("option",{value:a,children:[a,a===j?" (current)":""]},a))]})}function cf({box:a,branch:b,onClose:c,onDone:d,onRefresh:f}){let[g,i]=(0,p.useState)(""),[j,k]=(0,p.useState)(!1),[l,m]=(0,p.useState)(null),n=g.trim().length>0;return(0,e.jsxs)(bZ.Dialog,{onClose:c,className:"max-w-[440px]",children:[(0,e.jsxs)(bZ.DialogHeader,{children:[(0,e.jsx)(bZ.DialogIcon,{children:(0,e.jsx)(h.Icons.branch,{})}),(0,e.jsxs)("div",{children:[(0,e.jsx)(bZ.DialogTitle,{children:"Change branch"}),(0,e.jsxs)(bZ.DialogDescription,{children:[a.id," · currently on ",b]})]})]}),(0,e.jsxs)(bZ.DialogBody,{children:[(0,e.jsx)(b_.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,e.jsx)(ce,{boxId:a.id,id:"gb-branch",value:g,onChange:i,currentBranch:b}),(0,e.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),l?(0,e.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:l}):null]}),(0,e.jsxs)(bZ.DialogFooter,{children:[(0,e.jsx)(q.Button,{variant:"outline",onClick:c,disabled:j,children:"Cancel"}),(0,e.jsxs)(q.Button,{onClick:()=>{n&&!j&&(k(!0),m(null),(async()=>{let b=await b3(a.id,g.trim());b.ok?(d({title:"Branch changed",detail:cb(b.stdout,b.stderr)}),c(),f()):(m(b.error),k(!1))})())},disabled:!n||j,children:[j?(0,e.jsx)("span",{className:"spin"}):(0,e.jsx)(h.Icons.check,{}),j?"Checking out…":"Change branch"]})]})]})}function cg({box:a,onClose:b,onDone:c,onRefresh:d}){let[f,g]=(0,p.useState)(""),[i,j]=(0,p.useState)(""),[k,l]=(0,p.useState)(!1),[m,n]=(0,p.useState)(null),o=f.trim().length>0,r=()=>{o&&!k&&(l(!0),n(null),(async()=>{let e=await b2(a.id,f.trim(),i.trim()||void 0);e.ok?(c({title:"Branch created",detail:cb(e.stdout,e.stderr)}),b(),d()):(n(e.error),l(!1))})())};return(0,e.jsxs)(bZ.Dialog,{onClose:b,className:"max-w-[440px]",children:[(0,e.jsxs)(bZ.DialogHeader,{children:[(0,e.jsx)(bZ.DialogIcon,{children:(0,e.jsx)(h.Icons.branch,{})}),(0,e.jsxs)("div",{children:[(0,e.jsx)(bZ.DialogTitle,{children:"New branch"}),(0,e.jsxs)(bZ.DialogDescription,{children:[a.id," · branching in the box workspace"]})]})]}),(0,e.jsxs)(bZ.DialogBody,{children:[(0,e.jsxs)("div",{className:"mb-4",children:[(0,e.jsx)(b_.Label,{htmlFor:"nb-name",children:"Name"}),(0,e.jsx)(b$.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:f,onChange:a=>g(a.target.value),onKeyDown:a=>{"Enter"===a.key&&r()},placeholder:"my-branch"}),(0,e.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,e.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,e.jsxs)(b_.Label,{htmlFor:"nb-from",children:["Base ref ",(0,e.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,e.jsx)(ce,{boxId:a.id,id:"nb-from",value:i,onChange:j,headLabel:"Current HEAD (default)"}),(0,e.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),m?(0,e.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:m}):null]}),(0,e.jsxs)(bZ.DialogFooter,{children:[(0,e.jsx)(q.Button,{variant:"outline",onClick:b,disabled:k,children:"Cancel"}),(0,e.jsxs)(q.Button,{onClick:r,disabled:!o||k,children:[k?(0,e.jsx)("span",{className:"spin"}):(0,e.jsx)(h.Icons.plus,{}),k?"Creating…":"Create branch"]})]})]})}let ch=(0,b1.createServerReference)("6096ff4dd5616157cf1da6a977c271641a3ddce491",b1.callServer,void 0,b1.findSourceMapURL,"restartServiceAction"),ci=new Set(["ready","running","done"]),cj=new Set(["crashed","unhealthy","backoff","failed"]),ck={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},cl={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function cm({svc:a,disabled:b,onRestart:c}){var d;let f=(d=a.state,ci.has(d)?"up":cj.has(d)?"bad":"idle");return(0,e.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,e.jsx)("span",{className:(0,j.cn)("badge-dot",ck[f]),"aria-hidden":!0}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:a.name}),(0,e.jsx)("span",{className:(0,j.cn)("font-mono text-xs",cl[f]),children:a.state}),a.restarts>0?(0,e.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",a.restarts]}):null,(0,e.jsx)(q.Button,{variant:"outline",size:"icon-sm",title:`Restart ${a.name}`,disabled:b,onClick:()=>c(a.name),children:(0,e.jsx)(h.Icons.refresh,{})})]})}function cn({id:a,running:b}){let[c,d]=(0,p.useState)(null),[f,g]=(0,p.useState)(null),[i,j]=(0,p.useTransition)(),k=(0,p.useCallback)(async()=>{try{let b=await fetch(`/api/v1/boxes/${encodeURIComponent(a)}/services`,{credentials:"same-origin"});if(!b.ok)return void g(`status ${String(b.status)}`);d(await b.json()),g(null)}catch(a){g(a instanceof Error?a.message:String(a))}},[a]);(0,p.useEffect)(()=>{if(k(),!b)return;let a=setInterval(()=>void k(),4e3);return()=>clearInterval(a)},[k,b]);let m=b=>{j(async()=>{let c=await ch(a,b);c.ok||window.alert(`Restart failed: ${c.error}`),await k()})},n=c?.services??[],o=n.length>0;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(bP.SectionLabel,{right:o?(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:!b||i,onClick:()=>m(void 0),children:[(0,e.jsx)(h.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,e.jsx)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:c||f?f?(0,e.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",f,")."]}):o?(0,e.jsxs)(e.Fragment,{children:[c?.source==="persisted"?(0,e.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,n.map(a=>(0,e.jsx)(cm,{svc:a,disabled:!b||i,onRestart:a=>m(a)},a.name))]}):(0,e.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:c?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,e.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var co=a.i(82337);a.s(["default",0,function(){let{id:a}=(0,f.useParams)(),{box:b,project:c}=(0,m.useStore)(),d=b(a);if(!d)return(0,e.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,e.jsx)(bU.BackLink,{to:"/",children:"All boxes"}),(0,e.jsx)(bY.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let j=c(d.projectId);return(0,e.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,e.jsx)(bU.BackLink,{to:"/projects/"+d.projectId,children:j?j.name:"Project"}),(0,e.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[d.task,(0,e.jsx)(i.StatusBadge,{status:d.status})]}),(0,e.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{className:"font-mono text-secondary-foreground",children:d.id})," ·"," ",(0,e.jsx)("span",{className:"font-mono text-secondary-foreground",children:d.repo})," · ",d.host]})]}),(0,e.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,e.jsx)(bV.BoxActions,{box:d,size:"lg"})})]}),d.error?(0,e.jsx)(k,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:h.Icons.warn,title:"Box errored",children:(0,e.jsx)("span",{className:"font-mono text-secondary-foreground",children:d.error})}):null,(0,e.jsx)(o,{boxId:d.id}),(0,e.jsx)(bP.SectionLabel,{children:"Overview"}),(0,e.jsxs)(co.StatGrid,{children:[(0,e.jsx)(co.Stat,{k:"Status",v:(0,e.jsx)(i.StatusBadge,{status:d.status})}),(0,e.jsx)(co.Stat,{k:"Agent CLI",v:d.agent,mono:!0}),(0,e.jsx)(co.Stat,{k:"Commits",v:d.commits??"—",icon:h.Icons.commit}),(0,e.jsx)(co.Stat,{k:"Files touched",v:d.filesTouched??"—",icon:h.Icons.file}),(0,e.jsx)(co.Stat,{k:"Last activity",v:(0,e.jsx)(g.Ago,{ms:d.lastActivity}),mono:!0})]}),(0,e.jsx)(bT,{box:d}),(0,e.jsx)(bP.SectionLabel,{children:"Git operations"}),(0,e.jsx)(cc,{box:d}),(0,e.jsx)(cn,{id:d.id,running:"running"===d.status}),(0,e.jsx)(bP.SectionLabel,{children:"Details"}),(0,e.jsxs)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,e.jsx)(bX,{k:"Box ID",v:d.id,mono:!0}),(0,e.jsx)(bX,{k:"Project",v:j?j.name:"—",link:j?"/projects/"+d.projectId:null}),(0,e.jsx)(bX,{k:"Repository",v:d.repo,mono:!0}),(0,e.jsx)(bX,{k:"Branch",v:d.branch,mono:!0}),(0,e.jsx)(bX,{k:"Host",v:d.host,mono:!0}),(0,e.jsx)(bX,{k:"Created",v:new Date(d.createdAt).toLocaleString(),mono:!0})]})]})}],58099)}];
1
+ module.exports=[58099,a=>{"use strict";let b,c;var d,e=a.i(33552),f=a.i(74455),g=a.i(17607),h=a.i(97187),i=a.i(71152),j=a.i(86834);function k({className:a,icon:b,title:c,children:d}){return(0,e.jsxs)("div",{className:(0,j.cn)("relative flex w-full items-start gap-3 rounded-xl border p-4",a),children:[b?(0,e.jsx)(b,{className:"mt-0.5 size-4 flex-none"}):null,(0,e.jsxs)("div",{className:"min-w-0",children:[c?(0,e.jsx)("div",{className:"mb-0.5 text-[13.5px] font-semibold leading-tight",children:c}):null,(0,e.jsx)("div",{className:"text-[12.5px] leading-normal",children:d})]})]})}var l=a.i(87883),m=a.i(80007),n=a.i(60401);function o({boxId:a}){let{state:b}=(0,m.useStore)(),c=b.approvals.filter(b=>b.boxId===a).sort((a,b)=>a.createdAt-b.createdAt);return 0===c.length?null:(0,e.jsxs)("div",{className:"mt-4 overflow-hidden rounded-xl border border-[var(--amber-line)] bg-[var(--amber-soft)]",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 border-b border-[var(--amber-line)] px-4 py-2.5",children:[(0,e.jsx)(h.Icons.shield,{className:"size-4 flex-none text-[var(--amber)]"}),(0,e.jsxs)("span",{className:"text-[13.5px] font-semibold",children:[c.length," pending approval",1===c.length?"":"s"]}),(0,e.jsx)("span",{className:"text-[12.5px] text-muted-foreground",children:"— this box is waiting on you."})]}),(0,e.jsx)("div",{className:"divide-y divide-[var(--amber-line)]",children:c.map(a=>(0,e.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3",children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"truncate font-mono text-[13px] text-secondary-foreground",children:a.command??a.message}),a.detail?(0,e.jsx)("div",{className:"mt-0.5 truncate text-[11.5px] text-muted-foreground",children:a.detail}):null,a.cwd?(0,e.jsx)("div",{className:"mt-0.5 truncate font-mono text-[11px] text-[#a4a9b0]",children:a.cwd}):null,(0,e.jsx)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:(0,e.jsx)(g.Ago,{ms:a.createdAt})})]}),(0,e.jsx)("div",{className:"flex-none pt-0.5",children:(0,e.jsx)(n.ApprovalActions,{id:a.id})})]},a.id))})]})}var p=a.i(50253),q=a.i(18071);function r(a,b,{checkForDefaultPrevented:c=!0}={}){return function(d){if(a?.(d),!1===c||!d||!d.defaultPrevented)return b?.(d)}}function s(a,b){if("function"==typeof a)return a(b);null!=a&&(a.current=b)}function t(...a){return p.useCallback(function(...a){return b=>{let c=!1,d=a.map(a=>{let d=s(a,b);return c||"function"!=typeof d||(c=!0),d});if(c)return()=>{for(let b=0;b<d.length;b++){let c=d[b];"function"==typeof c?c():s(a[b],null)}}}}(...a),a)}function u(a,b=[]){let c=[],d=()=>{let b=c.map(a=>p.createContext(a));return function(c){let d=c?.[a]||b;return p.useMemo(()=>({[`__scope${a}`]:{...c,[a]:d}}),[c,d])}};return d.scopeName=a,[function(b,d){let f=p.createContext(d);f.displayName=b+"Context";let g=c.length;c=[...c,d];let h=b=>{let{scope:c,children:d,...h}=b,i=c?.[a]?.[g]||f,j=p.useMemo(()=>h,Object.values(h));return(0,e.jsx)(i.Provider,{value:j,children:d})};return h.displayName=b+"Provider",[h,function(c,e,h={}){let{optional:i=!1}=h,j=e?.[a]?.[g]||f,k=p.useContext(j);if(k)return k;if(void 0!==d)return d;if(!i)throw Error(`\`${c}\` must be used within \`${b}\``)}]},function(...a){let b=a[0];if(1===a.length)return b;let c=()=>{let c=a.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(a){let d=c.reduce((b,{useScope:c,scopeName:d})=>{let e=c(a)[`__scope${d}`];return{...b,...e}},{});return p.useMemo(()=>({[`__scope${b.scopeName}`]:d}),[d])}};return c.scopeName=b.scopeName,c}(d,...b)]}var v=a.i(48365),w=Symbol.for("radix.slottable"),x=Symbol.for("react.lazy");function y(a){var b;return null!=a&&"object"==typeof a&&"$$typeof"in a&&a.$$typeof===x&&"_payload"in a&&"object"==typeof(b=a._payload)&&null!==b&&"then"in b}var z=p[" use ".trim().toString()],A=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,b)=>{var c;let d,f=(c=`Primitive.${b}`,(d=p.forwardRef((a,b)=>{var d;let e,f,{children:g,...h}=a,i=null,j=!1,k=[];y(g)&&"function"==typeof z&&(g=z(g._payload)),p.Children.forEach(g,a=>{var b;if(b=a,p.isValidElement(b)&&"function"==typeof b.type&&"__radixId"in b.type&&b.type.__radixId===w){j=!0;let b="child"in a.props?a.props.child:a.props.children;y(b)&&"function"==typeof z&&(b=z(b._payload)),i=((a,b)=>{if("child"in a.props){let b=a.props.child;return p.isValidElement(b)?p.cloneElement(b,void 0,a.props.children(b.props.children)):null}return p.isValidElement(b)?b:null})(a,b),k.push(i?.props?.children)}else k.push(a)}),i?i=p.cloneElement(i,void 0,k):!j&&1===p.Children.count(g)&&p.isValidElement(g)&&(i=g);let l=i?(d=i,(f=(e=Object.getOwnPropertyDescriptor(d.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?d.ref:(f=(e=Object.getOwnPropertyDescriptor(d,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?d.props.ref:d.props.ref||d.ref):void 0,m=t(b,l);if(!i){if(g||0===g){let a,b;throw Error(j?(a=c,`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`):(b=c,`${b} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`))}return g}let n=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(h,i.props??{});return i.type!==p.Fragment&&(n.ref=b?m:l),p.cloneElement(i,n)})).displayName=`${c}.Slot`,d),g=p.forwardRef((a,c)=>{let{asChild:d,...g}=a;return(0,e.jsx)(d?f:b,{...g,ref:c})});return g.displayName=`Primitive.${b}`,{...a,[b]:g}},{});function B(a){let b=p.useRef(a);return p.useEffect(()=>{b.current=a}),p.useMemo(()=>(...a)=>b.current?.(...a),[])}var C="dismissableLayer.update",D=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),E=p.forwardRef((a,b)=>{let{disableOutsidePointerEvents:c=!1,deferPointerDownOutside:f=!1,onEscapeKeyDown:g,onPointerDownOutside:h,onFocusOutside:i,onInteractOutside:j,onDismiss:k,...l}=a,m=p.useContext(D),[n,o]=p.useState(null),q=n?.ownerDocument??globalThis?.document,[,s]=p.useState({}),u=t(b,o),v=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),x=w?v.indexOf(w):-1,y=n?v.indexOf(n):-1,z=m.layersWithOutsidePointerEventsDisabled.size>0,E=y>=x,I=p.useRef(!1),J=function(a,b){let{ownerDocument:c=globalThis?.document,deferPointerDownOutside:d=!1,isDeferredPointerDownOutsideRef:e,dismissableSurfaces:f,shouldHandlePointerDownOutside:g=F}=b,h=B(a),i=p.useRef(!1),j=p.useRef(!1),k=p.useRef(new Map),l=p.useRef(()=>{});return p.useEffect(()=>{function a(){j.current=!1,e.current=!1,k.current.clear()}function b(a){if(!j.current)return;let b=a.target;b instanceof Node&&[...f].some(a=>a.contains(b))||k.current.set(a.type,!0),"click"===a.type&&window.setTimeout(()=>{j.current&&l.current()},0)}function m(a){j.current&&k.current.set(a.type,!1)}let n=b=>{if(b.target&&!i.current){let f=function(){c.removeEventListener("click",l.current);let b=Array.from(k.current.values()).some(Boolean);a(),b||H("dismissableLayer.pointerDownOutside",h,m,{discrete:!0})};if(!g(b.target)){c.removeEventListener("click",l.current),a(),i.current=!1;return}let m={originalEvent:b};j.current=!0,e.current=d&&0===b.button,k.current.clear(),d&&0===b.button?(c.removeEventListener("click",l.current),l.current=f,c.addEventListener("click",l.current,{once:!0})):f()}else c.removeEventListener("click",l.current),a();i.current=!1},o=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let a of o)c.addEventListener(a,b,!0),c.addEventListener(a,m);let p=window.setTimeout(()=>{c.addEventListener("pointerdown",n)},0);return()=>{for(let a of(window.clearTimeout(p),c.removeEventListener("pointerdown",n),c.removeEventListener("click",l.current),o))c.removeEventListener(a,b,!0),c.removeEventListener(a,m)}},[c,h,d,e,f,g]),{onPointerDownCapture:()=>i.current=!0}}(a=>{h?.(a),j?.(a),a.defaultPrevented||k?.()},{ownerDocument:q,deferPointerDownOutside:f,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(a=>{if(!(a instanceof Node))return!1;let b=[...m.branches].some(b=>b.contains(a));return E&&!b},[m.branches,E])}),K=function(a,b=globalThis?.document){let c=B(a),d=p.useRef(!1);return p.useEffect(()=>{let a=a=>{a.target&&!d.current&&H("dismissableLayer.focusOutside",c,{originalEvent:a},{discrete:!1})};return b.addEventListener("focusin",a),()=>b.removeEventListener("focusin",a)},[b,c]),{onFocusCapture:()=>d.current=!0,onBlurCapture:()=>d.current=!1}}(a=>{if(f&&I.current)return;let b=a.target;![...m.branches].some(a=>a.contains(b))&&(i?.(a),j?.(a),a.defaultPrevented||k?.())},q),L=!!n&&y===v.length-1,M=B(a=>{"Escape"===a.key&&(g?.(a),!a.defaultPrevented&&k&&(a.preventDefault(),k()))});return p.useEffect(()=>{if(L)return q.addEventListener("keydown",M,{capture:!0}),()=>q.removeEventListener("keydown",M,{capture:!0})},[q,L,M]),p.useEffect(()=>{if(n)return c&&(0===m.layersWithOutsidePointerEventsDisabled.size&&(d=q.body.style.pointerEvents,q.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(n)),m.layers.add(n),G(),()=>{c&&(m.layersWithOutsidePointerEventsDisabled.delete(n),0===m.layersWithOutsidePointerEventsDisabled.size&&(q.body.style.pointerEvents=d))}},[n,q,c,m]),p.useEffect(()=>()=>{n&&(m.layers.delete(n),m.layersWithOutsidePointerEventsDisabled.delete(n),G())},[n,m]),p.useEffect(()=>{let a=()=>s({});return document.addEventListener(C,a),()=>document.removeEventListener(C,a)},[]),(0,e.jsx)(A.div,{...l,ref:u,style:{pointerEvents:z?E?"auto":"none":void 0,...a.style},onFocusCapture:r(a.onFocusCapture,K.onFocusCapture),onBlurCapture:r(a.onBlurCapture,K.onBlurCapture),onPointerDownCapture:r(a.onPointerDownCapture,J.onPointerDownCapture)})});E.displayName="DismissableLayer",p.forwardRef((a,b)=>{let c=p.useContext(D),d=p.useRef(null),f=t(b,d);return p.useEffect(()=>{let a=d.current;if(a)return c.branches.add(a),()=>{c.branches.delete(a)}},[c.branches]),(0,e.jsx)(A.div,{...a,ref:f})}).displayName="DismissableLayerBranch";var F=()=>!0;function G(){let a=new CustomEvent(C);document.dispatchEvent(a)}function H(a,b,c,{discrete:d}){let e=c.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:c});if(b&&e.addEventListener(a,b,{once:!0}),d)e&&v.flushSync(()=>e.dispatchEvent(f));else e.dispatchEvent(f)}var I=globalThis?.document?p.useLayoutEffect:()=>{},J=p[" useId ".trim().toString()]||(()=>void 0),K=0;let L=["top","right","bottom","left"],M=Math.min,N=Math.max,O=Math.round,P=Math.floor,Q=a=>({x:a,y:a}),R={left:"right",right:"left",bottom:"top",top:"bottom"};function S(a,b){return"function"==typeof a?a(b):a}function T(a){return a.split("-")[0]}function U(a){return a.split("-")[1]}function V(a){return"x"===a?"y":"x"}function W(a){return"y"===a?"height":"width"}function X(a){let b=a[0];return"t"===b||"b"===b?"y":"x"}function Y(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}let Z=["left","right"],$=["right","left"],_=["top","bottom"],aa=["bottom","top"];function ab(a){let b=T(a);return R[b]+a.slice(b.length)}function ac(a){return"number"!=typeof a?{top:0,right:0,bottom:0,left:0,...a}:{top:a,right:a,bottom:a,left:a}}function ad(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function ae(a,b,c){let d,{reference:e,floating:f}=a,g=X(b),h=V(X(b)),i=W(h),j=T(b),k="y"===g,l=e.x+e.width/2-f.width/2,m=e.y+e.height/2-f.height/2,n=e[i]/2-f[i]/2;switch(j){case"top":d={x:l,y:e.y-f.height};break;case"bottom":d={x:l,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:m};break;case"left":d={x:e.x-f.width,y:m};break;default:d={x:e.x,y:e.y}}switch(U(b)){case"start":d[h]-=n*(c&&k?-1:1);break;case"end":d[h]+=n*(c&&k?-1:1)}return d}async function af(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=S(b,a),o=ac(n),p=h[m?"floating"===l?"reference":"floating":l],q=ad(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},u=ad(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-u.top+o.top)/t.y,bottom:(u.bottom-q.bottom+o.bottom)/t.y,left:(q.left-u.left+o.left)/t.x,right:(u.right-q.right+o.right)/t.x}}let ag=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=g.detectOverflow?g:{...g,detectOverflow:af},i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=ae(j,d,i),m=d,n=0,o={};for(let c=0;c<f.length;c++){let p=f[c];if(!p)continue;let{name:q,fn:r}=p,{x:s,y:t,data:u,reset:v}=await r({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:o,rects:j,platform:h,elements:{reference:a,floating:b}});k=null!=s?s:k,l=null!=t?t:l,o[q]={...o[q],...u},v&&n<50&&(n++,"object"==typeof v&&(v.placement&&(m=v.placement),v.rects&&(j=!0===v.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):v.rects),{x:k,y:l}=ae(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:o}};function ah(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function ai(a){return L.some(b=>a[b]>=0)}let aj=new Set(["left","top"]);async function ak(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=T(c),h=U(c),i="y"===X(c),j=aj.has(g)?-1:1,k=f&&i?-1:1,l=S(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function al(a){return function(a){return!1}(a)?(a.nodeName||"").toLowerCase():"#document"}function am(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function an(a){var b;return null==(b=(function(a){return!1}(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function ao(a){return!1}function ap(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=ax(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&"inline"!==e&&"contents"!==e}function aq(a){try{if(a.matches(":popover-open"))return!0}catch(a){}try{return a.matches(":modal")}catch(a){return!1}}let ar=/transform|translate|scale|rotate|perspective|filter/,as=/paint|layout|strict|content/,at=a=>!!a&&"none"!==a;function au(a){let b=a;return at(b.transform)||at(b.translate)||at(b.scale)||at(b.rotate)||at(b.perspective)||!av()&&(at(b.backdropFilter)||at(b.filter))||ar.test(b.willChange||"")||as.test(b.contain||"")}function av(){return null==b&&(b="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function aw(a){return/^(html|body|#document)$/.test(al(a))}function ax(a){return am(a).getComputedStyle(a)}function ay(a){return{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function az(a){if("html"===al(a))return a;let b=a.assignedSlot||a.parentNode||an(a);return b}function aA(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=az(b);return aw(c)?b.ownerDocument?b.ownerDocument.body:b.body:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=am(e);if(!f)return b.concat(e,aA(e,[],c));{let a=aB(g);return b.concat(g,g.visualViewport||[],ap(e)?e:[],a&&c?aA(a):[])}}function aB(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function aC(a){let b=ax(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=c,f=d,g=O(c)!==e||O(d)!==f;return g&&(c=e,d=f),{width:c,height:d,$:g}}function aD(a){return 0,a.contextElement}function aE(a){let b=aD(a);1;return Q(1)}let aF=Q(0);function aG(a){let b=am(a);return av()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:aF}function aH(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=aD(a),h=Q(1);b&&(d||(h=aE(a)));let i=(void 0===(e=c)&&(e=!1),d&&(!e||d===am(g))&&e)?aG(g):Q(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g){let a=am(g),b=d,c=a,e=aB(c);for(;e&&d&&b!==c;){let a=aE(e),b=e.getBoundingClientRect(),d=ax(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=aB(c=am(e))}}return ad({width:l,height:m,x:j,y:k})}function aI(a,b){let c=ay(a).scrollLeft;return b?b.left+c:aH(an(a)).left+c}function aJ(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-aI(a,c),y:c.top+b.scrollTop}}function aK(a,b,c){var d;let e;if("viewport"===b)e=function(a,b){let c=am(a),d=an(a),e=c.visualViewport,f=d.clientWidth,g=d.clientHeight,h=0,i=0;if(e){f=e.width,g=e.height;let a=av();(!a||a&&"fixed"===b)&&(h=e.offsetLeft,i=e.offsetTop)}let j=aI(d);if(j<=0){let a=d.ownerDocument,b=a.body,c=getComputedStyle(b),e="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,g=Math.abs(d.clientWidth-b.clientWidth-e);g<=25&&(f-=g)}else j<=25&&(f+=j);return{width:f,height:g,x:h,y:i}}(a,c);else if("document"===b){let b,c,f,g,h,i,j;d=an(a),b=an(d),c=ay(d),f=d.ownerDocument.body,g=N(b.scrollWidth,b.clientWidth,f.scrollWidth,f.clientWidth),h=N(b.scrollHeight,b.clientHeight,f.scrollHeight,f.clientHeight),i=-c.scrollLeft+aI(d),j=-c.scrollTop,"rtl"===ax(f).direction&&(i+=N(b.clientWidth,f.clientWidth)-g),e={width:g,height:h,x:i,y:j}}else if(1){let c=aG(a);e={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}else{let a,d,f,g,h,i;d=(a=aH(b,!0,"fixed"===c)).top+b.clientTop,f=a.left+b.clientLeft,g=Q(1),h=b.clientWidth*g.x,i=b.clientHeight*g.y,e={width:h,height:i,x:f*g.x,y:d*g.y}}return ad(e)}function aL(a){return"static"===ax(a).position}function aM(a,b){1;return null}function aN(a,b){var c;let d=am(a);if(aq(a))return d;1;{let b=az(a);for(;b&&!aw(b);){0;b=az(b)}return d}}let aO=async function(a){let b=this.getOffsetParent||aN,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){let d=an(b),e="fixed"===c,f=aH(a,!0,e,b),g={scrollLeft:0,scrollTop:0},h=Q(0);if(!e)if(("body"!==al(b)||ap(d))&&(g=ay(b)),1)d&&(h.x=aI(d));else{let a=aH(b,!0,e,b);h.x=a.x+b.clientLeft,h.y=a.y+b.clientTop}e&&d&&(h.x=aI(d));let i=!d||e?Q(0):aJ(d,g);return{x:f.left+g.scrollLeft-h.x-i.x,y:f.top+g.scrollTop-h.y-i.y,width:f.width,height:f.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},aP={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){let{elements:b,rect:c,offsetParent:d,strategy:e}=a,f="fixed"===e,g=an(d),h=!!b&&aq(b.floating);if(d===g||h&&f)return c;let i={scrollLeft:0,scrollTop:0},j=Q(1),k=Q(0);!f&&(("body"!==al(d)||ap(g))&&(i=ay(d)),0);let l=!g||f?Q(0):aJ(g,i);return{width:c.width*j.x,height:c.height*j.y,x:c.x*j.x-i.scrollLeft*j.x+k.x+l.x,y:c.y*j.y-i.scrollTop*j.y+k.y+l.y}},getDocumentElement:an,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?aq(b)?[]:function(a,b){let c=b.get(a);if(c)return c;let d=aA(a,[],!1).filter(a=>!1),e="fixed"===ax(a).position,f=e?az(a):a;return b.set(a,d),d}(b,this._c):[].concat(c),d],g=aK(b,f[0],e),h=g.top,i=g.right,j=g.bottom,k=g.left;for(let a=1;a<f.length;a++){let c=aK(b,f[a],e);h=N(c.top,h),i=M(c.right,i),j=M(c.bottom,j),k=N(c.left,k)}return{width:i-k,height:j-h,x:k,y:h}},getOffsetParent:aN,getElementRects:aO,getClientRects:function(a){return Array.from(a.getClientRects())},getDimensions:function(a){let{width:b,height:c}=aC(a);return{width:b,height:c}},getScale:aE,isElement:ao,isRTL:function(a){return"rtl"===ax(a).direction}};function aQ(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let aR=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=S(a,b)||{};if(null==j)return{};let l=ac(k),m={x:c,y:d},n=V(X(e)),o=W(n),p=await g.getDimensions(j),q="y"===n,r=q?"clientHeight":"clientWidth",s=f.reference[o]+f.reference[n]-m[n]-f.floating[o],t=m[n]-f.reference[n],u=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),v=u?u[r]:0;v&&await (null==g.isElement?void 0:g.isElement(u))||(v=h.floating[r]||f.floating[o]);let w=v/2-p[o]/2-1,x=M(l[q?"top":"left"],w),y=M(l[q?"bottom":"right"],w),z=v-p[o]-y,A=v/2-p[o]/2+(s/2-t/2),B=N(x,M(A,z)),C=!i.arrow&&null!=U(e)&&A!==B&&f.reference[o]/2-(A<x?x:y)-p[o]/2<0,D=C?A<x?A-x:A-z:0;return{[n]:m[n]+D,data:{[n]:B,centerOffset:A-B-D,...C&&{alignmentOffset:D}},reset:C}}});var aS="u">typeof document?p.useLayoutEffect:function(){};function aT(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!aT(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!aT(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function aU(a,b){return Math.round(+b)/1}function aV(a){let b=p.useRef(a);return aS(()=>{b.current=a}),b}var aW=p.forwardRef((a,b)=>{let{children:c,width:d=10,height:f=5,...g}=a;return(0,e.jsx)(A.svg,{...g,ref:b,width:d,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:a.asChild?c:(0,e.jsx)("polygon",{points:"0,0 30,0 15,10"})})});aW.displayName="Arrow";var aX="Popper",[aY,aZ]=u(aX),[a$,a_]=aY(aX),a0=a=>{let{__scopePopper:b,children:c}=a,[d,f]=p.useState(null),[g,h]=p.useState(void 0);return(0,e.jsx)(a$,{scope:b,anchor:d,onAnchorChange:f,placementState:g,setPlacementState:h,children:c})};a0.displayName=aX;var a1="PopperAnchor",a2=p.forwardRef((a,b)=>{let{__scopePopper:c,virtualRef:d,...f}=a,g=a_(a1,c),h=p.useRef(null),i=g.onAnchorChange,j=t(b,p.useCallback(a=>{h.current=a,a&&i(a)},[i])),k=p.useRef(null);p.useEffect(()=>{if(!d)return;let a=k.current;k.current=d.current,a!==k.current&&i(k.current)});let l=g.placementState&&bc(g.placementState),m=l?.[0],n=l?.[1];return d?null:(0,e.jsx)(A.div,{"data-radix-popper-side":m,"data-radix-popper-align":n,...f,ref:j})});a2.displayName=a1;var a3="PopperContent",[a4,a5]=aY(a3),a6=p.forwardRef((a,b)=>{var c,d,f,g,h,i,j,k,l,m,n,o,q;let r,s,u,w,x,y,{__scopePopper:z,side:C="bottom",sideOffset:D=0,align:E="center",alignOffset:F=0,arrowPadding:G=0,avoidCollisions:H=!0,collisionBoundary:J=[],collisionPadding:K=0,sticky:L="partial",hideWhenDetached:O=!1,updatePositionStrategy:Q="optimized",onPlaced:R,...ac}=a,ad=a_(a3,z),[ae,af]=p.useState(null),al=t(b,af),[am,ao]=p.useState(null),ap=function(a){let[b,c]=p.useState(void 0);return I(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=new ResizeObserver(b=>{let d,e;if(!Array.isArray(b)||!b.length)return;let f=b[0];if("borderBoxSize"in f){let a=f.borderBoxSize,b=Array.isArray(a)?a[0]:a;d=b.inlineSize,e=b.blockSize}else d=a.offsetWidth,e=a.offsetHeight;c({width:d,height:e})});return b.observe(a,{box:"border-box"}),()=>b.unobserve(a)}c(void 0)},[a]),b}(am),aq=ap?.width??0,ar=ap?.height??0,as="number"==typeof K?K:{top:0,right:0,bottom:0,left:0,...K},at=Array.isArray(J)?J:[J],au=at.length>0,av={padding:as,boundary:at.filter(ba),altBoundary:au},{refs:aw,floatingStyles:ax,placement:ay,isPositioned:az,middlewareData:aB}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:d=[],platform:e,elements:{reference:f,floating:g}={},transform:h=!0,whileElementsMounted:i,open:j}=a,[k,l]=p.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[m,n]=p.useState(d);aT(m,d)||n(d);let[o,q]=p.useState(null),[r,s]=p.useState(null),t=p.useCallback(a=>{a!==y.current&&(y.current=a,q(a))},[]),u=p.useCallback(a=>{a!==z.current&&(z.current=a,s(a))},[]),w=f||o,x=g||r,y=p.useRef(null),z=p.useRef(null),A=p.useRef(k),B=null!=i,C=aV(i),D=aV(e),E=aV(j),F=p.useCallback(()=>{var a,d;let e,f,g;if(!y.current||!z.current)return;let h={placement:b,strategy:c,middleware:m};D.current&&(h.platform=D.current),(a=y.current,d=z.current,e=new Map,g={...(f={platform:aP,...h}).platform,_c:e},ag(a,d,{...f,platform:g})).then(a=>{let b={...a,isPositioned:!1!==E.current};G.current&&!aT(A.current,b)&&(A.current=b,v.flushSync(()=>{l(b)}))})},[m,b,c,D,E]);aS(()=>{!1===j&&A.current.isPositioned&&(A.current.isPositioned=!1,l(a=>({...a,isPositioned:!1})))},[j]);let G=p.useRef(!1);aS(()=>(G.current=!0,()=>{G.current=!1}),[]),aS(()=>{if(w&&(y.current=w),x&&(z.current=x),w&&x){if(C.current)return C.current(w,x,F);F()}},[w,x,F,C,B]);let H=p.useMemo(()=>({reference:y,floating:z,setReference:t,setFloating:u}),[t,u]),I=p.useMemo(()=>({reference:w,floating:x}),[w,x]),J=p.useMemo(()=>{let a={position:c,left:0,top:0};if(!I.floating)return a;let b=aU(I.floating,k.x),d=aU(I.floating,k.y);if(h)return{...a,transform:"translate("+b+"px, "+d+"px)",...(I.floating,false)};return{position:c,left:b,top:d}},[c,h,I.floating,k.x,k.y]);return p.useMemo(()=>({...k,update:F,refs:H,elements:I,floatingStyles:J}),[k,F,H,I,J])}({strategy:"fixed",placement:C+("center"!==E?"-"+E:""),whileElementsMounted:(...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=aD(a),l=f||g?[...k?aA(k):[],...b?aA(b):[]]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c,{passive:!0}),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b){let c,d=null,e=an(a);function f(){var a;clearTimeout(c),null==(a=d)||a.disconnect(),d=null}return!function g(h,i){void 0===h&&(h=!1),void 0===i&&(i=1),f();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(h||b(),!m||!n)return;let o={rootMargin:-P(l)+"px "+-P(e.clientWidth-(k+m))+"px "+-P(e.clientHeight-(l+n))+"px "+-P(k)+"px",threshold:N(0,M(1,i))||1},p=!0;function q(b){let d=b[0].intersectionRatio;if(d!==i){if(!p)return g();d?g(!1,d):c=setTimeout(()=>{g(!1,1e-7)},1e3)}1!==d||aQ(j,a.getBoundingClientRect())||g(),p=!1}try{d=new IntersectionObserver(q,{...o,root:e.ownerDocument})}catch(a){d=new IntersectionObserver(q,o)}d.observe(a)}(!0),f}(k,c):null,n=-1,o=null;h&&(o=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&o&&b&&(o.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=o)||a.observe(b)})),c()}),k&&!j&&o.observe(k),b&&o.observe(b));let p=j?aH(a):null;return j&&function b(){let d=aH(a);p&&!aQ(p,d)&&c(),p=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=o)||a.disconnect(),o=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:"always"===Q}),elements:{reference:ad.anchor},middleware:[{name:(r={name:"offset",options:d=c={mainAxis:D+ar,alignmentAxis:F},async fn(a){var b,c;let{x:e,y:f,placement:g,middlewareData:h}=a,i=await ak(a,d);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(c=h.arrow)&&c.alignmentOffset?{}:{x:e+i.x,y:f+i.y,data:{...i,placement:g}}}}).name,fn:r.fn,options:[c,void 0]},H&&{name:(s={name:"shift",options:h=g={mainAxis:!0,crossAxis:!1,limiter:"partial"===L?{fn:(f=void 0,{options:f={},fn(a){let{x:b,y:c,placement:d,rects:e,middlewareData:g}=a,{offset:h=0,mainAxis:i=!0,crossAxis:j=!0}=S(f,a),k={x:b,y:c},l=X(d),m=V(l),n=k[m],o=k[l],p=S(h,a),q="number"==typeof p?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(i){let a="y"===m?"height":"width",b=e.reference[m]-e.floating[a]+q.mainAxis,c=e.reference[m]+e.reference[a]-q.mainAxis;n<b?n=b:n>c&&(n=c)}if(j){var r,s;let a="y"===m?"width":"height",b=aj.has(T(d)),c=e.reference[l]-e.floating[a]+(b&&(null==(r=g.offset)?void 0:r[l])||0)+(b?0:q.crossAxis),f=e.reference[l]+e.reference[a]+(b?0:(null==(s=g.offset)?void 0:s[l])||0)-(b?q.crossAxis:0);o<c?o=c:o>f&&(o=f)}return{[m]:n,[l]:o}}}).fn,options:[void 0,void 0]}:void 0,...av},async fn(a){let{x:b,y:c,placement:d,platform:e}=a,{mainAxis:f=!0,crossAxis:g=!1,limiter:i={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...j}=S(h,a),k={x:b,y:c},l=await e.detectOverflow(a,j),m=X(T(d)),n=V(m),o=k[n],p=k[m];if(f){let a="y"===n?"top":"left",b="y"===n?"bottom":"right",c=o+l[a],d=o-l[b];o=N(c,M(o,d))}if(g){let a="y"===m?"top":"left",b="y"===m?"bottom":"right",c=p+l[a],d=p-l[b];p=N(c,M(p,d))}let q=i.fn({...a,[n]:o,[m]:p});return{...q,data:{x:q.x-b,y:q.y-c,enabled:{[n]:f,[m]:g}}}}}).name,fn:s.fn,options:[g,void 0]},H&&{name:(u={name:"flip",options:j=i={...av},async fn(a){var b,c,d,e,f,g,h,i;let k,l,m,{placement:n,middlewareData:o,rects:p,initialPlacement:q,platform:r,elements:s}=a,{mainAxis:t=!0,crossAxis:u=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...z}=S(j,a);if(null!=(b=o.arrow)&&b.alignmentOffset)return{};let A=T(n),B=X(q),C=T(q)===q,D=await (null==r.isRTL?void 0:r.isRTL(s.floating)),E=v||(C||!y?[ab(q)]:(k=ab(q),[Y(q),k,Y(k)])),F="none"!==x;!v&&F&&E.push(...(l=U(q),m=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?$:Z;return b?Z:$;case"left":case"right":return b?_:aa;default:return[]}}(T(q),"start"===x,D),l&&(m=m.map(a=>a+"-"+l),y&&(m=m.concat(m.map(Y)))),m));let G=[q,...E],H=await r.detectOverflow(a,z),I=[],J=(null==(c=o.flip)?void 0:c.overflows)||[];if(t&&I.push(H[A]),u){let a,b,c,d,e=(g=n,h=p,void 0===(i=D)&&(i=!1),a=U(g),c=W(b=V(X(g))),d="x"===b?a===(i?"end":"start")?"right":"left":"start"===a?"bottom":"top",h.reference[c]>h.floating[c]&&(d=ab(d)),[d,ab(d)]);I.push(H[e[0]],H[e[1]])}if(J=[...J,{placement:n,overflows:I}],!I.every(a=>a<=0)){let a=((null==(d=o.flip)?void 0:d.index)||0)+1,b=G[a];if(b&&("alignment"!==u||B===X(b)||J.every(a=>X(a.placement)!==B||a.overflows[0]>0)))return{data:{index:a,overflows:J},reset:{placement:b}};let c=null==(e=J.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:e.placement;if(!c)switch(w){case"bestFit":{let a=null==(f=J.filter(a=>{if(F){let b=X(a.placement);return b===B||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:f[0];a&&(c=a);break}case"initialPlacement":c=q}if(n!==c)return{reset:{placement:c}}}return{}}}).name,fn:u.fn,options:[i,void 0]},{name:(w={name:"size",options:l=k={...av,apply:({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)}},async fn(a){var b,c;let d,e,{placement:f,rects:g,platform:h,elements:i}=a,{apply:j=()=>{},...k}=S(l,a),m=await h.detectOverflow(a,k),n=T(f),o=U(f),p="y"===X(f),{width:q,height:r}=g.floating;"top"===n||"bottom"===n?(d=n,e=o===(await (null==h.isRTL?void 0:h.isRTL(i.floating))?"start":"end")?"left":"right"):(e=n,d="end"===o?"top":"bottom");let s=r-m.top-m.bottom,t=q-m.left-m.right,u=M(r-m[d],s),v=M(q-m[e],t),w=!a.middlewareData.shift,x=u,y=v;if(null!=(b=a.middlewareData.shift)&&b.enabled.x&&(y=t),null!=(c=a.middlewareData.shift)&&c.enabled.y&&(x=s),w&&!o){let a=N(m.left,0),b=N(m.right,0),c=N(m.top,0),d=N(m.bottom,0);p?y=q-2*(0!==a||0!==b?a+b:N(m.left,m.right)):x=r-2*(0!==c||0!==d?c+d:N(m.top,m.bottom))}await j({...a,availableWidth:y,availableHeight:x});let z=await h.getDimensions(i.floating);return q!==z.width||r!==z.height?{reset:{rects:!0}}:{}}}).name,fn:w.fn,options:[k,void 0]},am&&{name:(x={name:"arrow",options:n=m={element:am,padding:G},fn(a){let{element:b,padding:c}="function"==typeof n?n(a):n;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?aR({element:b.current,padding:c}).fn(a):{}:b?aR({element:b,padding:c}).fn(a):{}}}).name,fn:x.fn,options:[m,void 0]},bb({arrowWidth:aq,arrowHeight:ar}),O&&{name:(y={name:"hide",options:q=o={strategy:"referenceHidden",...av,boundary:au?av.boundary:void 0},async fn(a){let{rects:b,platform:c}=a,{strategy:d="referenceHidden",...e}=S(q,a);switch(d){case"referenceHidden":{let d=ah(await c.detectOverflow(a,{...e,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:ai(d)}}}case"escaped":{let d=ah(await c.detectOverflow(a,{...e,altBoundary:!0}),b.floating);return{data:{escapedOffsets:d,escaped:ai(d)}}}default:return{}}}}).name,fn:y.fn,options:[o,void 0]}]}),aC=ad.setPlacementState;I(()=>(aC(ay),()=>{aC(void 0)}),[ay,aC]);let[aE,aF]=bc(ay),aG=B(R);I(()=>{az&&aG?.()},[az,aG]);let aI=aB.arrow?.x,aJ=aB.arrow?.y,aK=aB.arrow?.centerOffset!==0,[aL,aM]=p.useState();return I(()=>{ae&&aM(window.getComputedStyle(ae).zIndex)},[ae]),(0,e.jsx)("div",{ref:aw.setFloating,"data-radix-popper-content-wrapper":"",style:{...ax,transform:az?ax.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:aL,"--radix-popper-transform-origin":[aB.transformOrigin?.x,aB.transformOrigin?.y].join(" "),...aB.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,e.jsx)(a4,{scope:z,placedSide:aE,placedAlign:aF,onArrowChange:ao,arrowX:aI,arrowY:aJ,shouldHideArrow:aK,children:(0,e.jsx)(A.div,{"data-side":aE,"data-align":aF,...ac,ref:al,style:{...ac.style,animation:az?void 0:"none"}})})})});a6.displayName=a3;var a7="PopperArrow",a8={top:"bottom",right:"left",bottom:"top",left:"right"},a9=p.forwardRef(function(a,b){let{__scopePopper:c,...d}=a,f=a5(a7,c),g=a8[f.placedSide];return(0,e.jsx)("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[g]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:(0,e.jsx)(aW,{...d,ref:b,style:{...d.style,display:"block"}})})});function ba(a){return null!==a}a9.displayName=a7;var bb=a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=bc(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}});function bc(a){let[b,c="center"]=a.split("-");return[b,c]}var bd=p.forwardRef((a,b)=>{let{container:c,...d}=a,[f,g]=p.useState(!1);I(()=>g(!0),[]);let h=c||f&&globalThis?.document?.body;return h?v.createPortal((0,e.jsx)(A.div,{...d,ref:b}),h):null});bd.displayName="Portal";var be=a=>{var b;let c,d,{present:e,children:f}=a,g=function(a){var b,c;let[d,e]=p.useState(),f=p.useRef(null),g=p.useRef(a),h=p.useRef("none"),i=p.useRef(void 0),[j,k]=(b=a?"mounted":"unmounted",c={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},p.useReducer((a,b)=>c[a][b]??a,b));return p.useEffect(()=>{"mounted"===j?(h.current=i.current??bg(f.current),i.current=void 0):h.current="none"},[j]),I(()=>{let b=f.current,c=g.current;if(c!==a){let d=h.current,e=bg(b);a?(i.current=e,k("MOUNT")):"none"===e||b?.display==="none"?k("UNMOUNT"):c&&d!==e?k("ANIMATION_OUT"):k("UNMOUNT"),g.current=a}},[a,k]),I(()=>{if(d){let a,b=d.ownerDocument.defaultView??window,c=c=>{let e=bg(f.current).includes(CSS.escape(c.animationName));if(c.target===d&&e&&(k("ANIMATION_END"),!g.current)){let c=d.style.animationFillMode;d.style.animationFillMode="forwards",a=b.setTimeout(()=>{"forwards"===d.style.animationFillMode&&(d.style.animationFillMode=c)})}},e=a=>{a.target===d&&(h.current=bg(f.current))};return d.addEventListener("animationstart",e),d.addEventListener("animationcancel",c),d.addEventListener("animationend",c),()=>{b.clearTimeout(a),d.removeEventListener("animationstart",e),d.removeEventListener("animationcancel",c),d.removeEventListener("animationend",c)}}k("ANIMATION_END")},[d,k]),{isPresent:["mounted","unmountSuspended"].includes(j),ref:p.useCallback(a=>{if(a){let b=getComputedStyle(a);f.current=b,i.current=bg(b)}else f.current=null;e(a)},[])}}(e),h="function"==typeof f?f({present:g.isPresent}):p.Children.only(f),i=function(...a){let b=p.useRef(a);return b.current=a,p.useCallback(a=>{let c=b.current,d=!1,e=c.map(b=>{let c=bf(b,a);return d||"function"!=typeof c||(d=!0),c});if(d)return()=>{for(let a=0;a<e.length;a++){let b=e[a];"function"==typeof b?b():bf(c[a],null)}}},[])}(g.ref,(b=h,(d=(c=Object.getOwnPropertyDescriptor(b.props,"ref")?.get)&&"isReactWarning"in c&&c.isReactWarning)?b.ref:(d=(c=Object.getOwnPropertyDescriptor(b,"ref")?.get)&&"isReactWarning"in c&&c.isReactWarning)?b.props.ref:b.props.ref||b.ref));return"function"==typeof f||g.isPresent?p.cloneElement(h,{ref:i}):null};function bf(a,b){if("function"==typeof a)return a(b);null!=a&&(a.current=b)}function bg(a){return a?.animationName||"none"}be.displayName="Presence",p[" useEffectEvent ".trim().toString()],p[" useInsertionEffect ".trim().toString()];var bh=p[" useInsertionEffect ".trim().toString()]||I;Symbol("RADIX:SYNC_STATE");var bi=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"}),bj=p.forwardRef((a,b)=>(0,e.jsx)(A.span,{...a,ref:b,style:{...bi,...a.style}}));bj.displayName="VisuallyHidden";var[bk,bl]=u("Tooltip",[aZ]),bm=aZ(),bn="TooltipProvider",bo="tooltip.open",[bp,bq]=bk(bn),br=a=>{let{__scopeTooltip:b,delayDuration:c=700,skipDelayDuration:d=300,disableHoverableContent:f=!1,children:g}=a,h=p.useRef(!0),i=p.useRef(!1),j=p.useRef(0);return p.useEffect(()=>{let a=j.current;return()=>window.clearTimeout(a)},[]),(0,e.jsx)(bp,{scope:b,isOpenDelayedRef:h,delayDuration:c,onOpen:p.useCallback(()=>{d<=0||(window.clearTimeout(j.current),h.current=!1)},[d]),onClose:p.useCallback(()=>{d<=0||(window.clearTimeout(j.current),j.current=window.setTimeout(()=>h.current=!0,d))},[d]),isPointerInTransitRef:i,onPointerInTransitChange:p.useCallback(a=>{i.current=a},[]),disableHoverableContent:f,children:g})};br.displayName=bn;var bs="Tooltip",[bt,bu]=bk(bs),bv=a=>{let{__scopeTooltip:b,children:c,open:d,defaultOpen:f,onOpenChange:g,disableHoverableContent:h,delayDuration:i}=a,j=bq(bs,a.__scopeTooltip),k=bm(b),[l,m]=p.useState(null),n=function(){let[a,b]=p.useState(J());return I(()=>{b(a=>a??String(K++))},[void 0]),a?`radix-${a}`:""}(),o=p.useRef(0),q=h??j.disableHoverableContent,r=i??j.delayDuration,s=p.useRef(!1),[t,u]=function({prop:a,defaultProp:b,onChange:c=()=>{},caller:d}){let[e,f,g]=function({defaultProp:a,onChange:b}){let[c,d]=p.useState(a),e=p.useRef(c),f=p.useRef(b);return bh(()=>{f.current=b},[b]),p.useEffect(()=>{e.current!==c&&(f.current?.(c),e.current=c)},[c,e]),[c,d,f]}({defaultProp:b,onChange:c}),h=void 0!==a,i=h?a:e;{let b=p.useRef(void 0!==a);p.useEffect(()=>{let a=b.current;if(a!==h){let b=h?"controlled":"uncontrolled";console.warn(`${d} is changing from ${a?"controlled":"uncontrolled"} to ${b}. 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.`)}b.current=h},[h,d])}return[i,p.useCallback(b=>{if(h){let c="function"==typeof b?b(a):b;c!==a&&g.current?.(c)}else f(b)},[h,a,f,g])]}({prop:d,defaultProp:f??!1,onChange:a=>{a?(j.onOpen(),document.dispatchEvent(new CustomEvent(bo))):j.onClose(),g?.(a)},caller:bs}),v=p.useMemo(()=>t?s.current?"delayed-open":"instant-open":"closed",[t]),w=p.useCallback(()=>{window.clearTimeout(o.current),o.current=0,s.current=!1,u(!0)},[u]),x=p.useCallback(()=>{window.clearTimeout(o.current),o.current=0,u(!1)},[u]),y=p.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(()=>{s.current=!0,u(!0),o.current=0},r)},[r,u]);return p.useEffect(()=>()=>{o.current&&(window.clearTimeout(o.current),o.current=0)},[]),(0,e.jsx)(a0,{...k,children:(0,e.jsx)(bt,{scope:b,contentId:n,open:t,stateAttribute:v,trigger:l,onTriggerChange:m,onTriggerEnter:p.useCallback(()=>{j.isOpenDelayedRef.current?y():w()},[j.isOpenDelayedRef,y,w]),onTriggerLeave:p.useCallback(()=>{q?x():(window.clearTimeout(o.current),o.current=0)},[x,q]),onOpen:w,onClose:x,disableHoverableContent:q,children:c})})};bv.displayName=bs;var bw="TooltipTrigger",bx=p.forwardRef((a,b)=>{let{__scopeTooltip:c,...d}=a,f=bu(bw,c),g=bq(bw,c),h=bm(c),i=t(b,p.useRef(null),f.onTriggerChange),j=p.useRef(!1),k=p.useRef(!1),l=p.useCallback(()=>j.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",l),[l]),(0,e.jsx)(a2,{asChild:!0,...h,children:(0,e.jsx)(A.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...d,ref:i,onPointerMove:r(a.onPointerMove,a=>{"touch"!==a.pointerType&&(k.current||g.isPointerInTransitRef.current||(f.onTriggerEnter(),k.current=!0))}),onPointerLeave:r(a.onPointerLeave,()=>{f.onTriggerLeave(),k.current=!1}),onPointerDown:r(a.onPointerDown,()=>{f.open&&f.onClose(),j.current=!0,document.addEventListener("pointerup",l,{once:!0})}),onFocus:r(a.onFocus,()=>{j.current||f.onOpen()}),onBlur:r(a.onBlur,f.onClose),onClick:r(a.onClick,f.onClose)})})});bx.displayName=bw;var by="TooltipPortal",[bz,bA]=bk(by,{forceMount:void 0}),bB=a=>{let{__scopeTooltip:b,forceMount:c,children:d,container:f}=a,g=bu(by,b);return(0,e.jsx)(bz,{scope:b,forceMount:c,children:(0,e.jsx)(be,{present:c||g.open,children:(0,e.jsx)(bd,{asChild:!0,container:f,children:d})})})};bB.displayName=by;var bC="TooltipContent",bD=p.forwardRef((a,b)=>{let c=bA(bC,a.__scopeTooltip),{forceMount:d=c.forceMount,side:f="top",...g}=a,h=bu(bC,a.__scopeTooltip);return(0,e.jsx)(be,{present:d||h.open,children:h.disableHoverableContent?(0,e.jsx)(bI,{side:f,...g,ref:b}):(0,e.jsx)(bE,{side:f,...g,ref:b})})}),bE=p.forwardRef((a,b)=>{let c=bu(bC,a.__scopeTooltip),d=bq(bC,a.__scopeTooltip),f=p.useRef(null),g=t(b,f),[h,i]=p.useState(null),{trigger:j,onClose:k}=c,l=f.current,{onPointerInTransitChange:m}=d,n=p.useCallback(()=>{i(null),m(!1)},[m]),o=p.useCallback((a,b)=>{let c,d=a.currentTarget,e={x:a.clientX,y:a.clientY},f=function(a,b){let c=Math.abs(b.top-a.y),d=Math.abs(b.bottom-a.y),e=Math.abs(b.right-a.x),f=Math.abs(b.left-a.x);switch(Math.min(c,d,e,f)){case f:return"left";case e:return"right";case c:return"top";case d:return"bottom";default:throw Error("unreachable")}}(e,d.getBoundingClientRect());i(((c=[...function(a,b,c=5){let d=[];switch(b){case"top":d.push({x:a.x-c,y:a.y+c},{x:a.x+c,y:a.y+c});break;case"bottom":d.push({x:a.x-c,y:a.y-c},{x:a.x+c,y:a.y-c});break;case"left":d.push({x:a.x+c,y:a.y-c},{x:a.x+c,y:a.y+c});break;case"right":d.push({x:a.x-c,y:a.y-c},{x:a.x-c,y:a.y+c})}return d}(e,f),...function(a){let{top:b,right:c,bottom:d,left:e}=a;return[{x:e,y:b},{x:c,y:b},{x:c,y:d},{x:e,y:d}]}(b.getBoundingClientRect())].slice()).sort((a,b)=>a.x<b.x?-1:a.x>b.x?1:a.y<b.y?-1:1*!!(a.y>b.y)),function(a){if(a.length<=1)return a.slice();let b=[];for(let c=0;c<a.length;c++){let d=a[c];for(;b.length>=2;){let a=b[b.length-1],c=b[b.length-2];if((a.x-c.x)*(d.y-c.y)>=(a.y-c.y)*(d.x-c.x))b.pop();else break}b.push(d)}b.pop();let c=[];for(let b=a.length-1;b>=0;b--){let d=a[b];for(;c.length>=2;){let a=c[c.length-1],b=c[c.length-2];if((a.x-b.x)*(d.y-b.y)>=(a.y-b.y)*(d.x-b.x))c.pop();else break}c.push(d)}return(c.pop(),1===b.length&&1===c.length&&b[0].x===c[0].x&&b[0].y===c[0].y)?b:b.concat(c)}(c))),m(!0)},[m]);return p.useEffect(()=>()=>n(),[n]),p.useEffect(()=>{if(j&&l){let a=a=>o(a,l),b=a=>o(a,j);return j.addEventListener("pointerleave",a),l.addEventListener("pointerleave",b),()=>{j.removeEventListener("pointerleave",a),l.removeEventListener("pointerleave",b)}}},[j,l,o,n]),p.useEffect(()=>{if(h){let a=a=>{let b=a.target,c={x:a.clientX,y:a.clientY},d=j?.contains(b)||l?.contains(b),e=!function(a,b){let{x:c,y:d}=a,e=!1;for(let a=0,f=b.length-1;a<b.length;f=a++){let g=b[a],h=b[f],i=g.x,j=g.y,k=h.x,l=h.y;j>d!=l>d&&c<(k-i)*(d-j)/(l-j)+i&&(e=!e)}return e}(c,h);d?n():e&&(n(),k())};return document.addEventListener("pointermove",a),()=>document.removeEventListener("pointermove",a)}},[j,l,h,k,n]),(0,e.jsx)(bI,{...a,ref:g})}),[bF,bG]=bk(bs,{isInside:!1}),bH=((c=a=>"child"in a?a.children(a.child):a.children).displayName="TooltipContent.Slottable",c.__radixId=w,c),bI=p.forwardRef((a,b)=>{let{__scopeTooltip:c,children:d,"aria-label":f,onEscapeKeyDown:g,onPointerDownOutside:h,...i}=a,j=bu(bC,c),k=bm(c),{onClose:l}=j;return p.useEffect(()=>(document.addEventListener(bo,l),()=>document.removeEventListener(bo,l)),[l]),p.useEffect(()=>{if(j.trigger){let a=a=>{a.target instanceof Node&&a.target.contains(j.trigger)&&l()};return window.addEventListener("scroll",a,{capture:!0}),()=>window.removeEventListener("scroll",a,{capture:!0})}},[j.trigger,l]),(0,e.jsx)(E,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:g,onPointerDownOutside:h,onFocusOutside:a=>a.preventDefault(),onDismiss:l,children:(0,e.jsxs)(a6,{"data-state":j.stateAttribute,...k,...i,ref:b,style:{...i.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,e.jsx)(bH,{children:d}),(0,e.jsx)(bF,{scope:c,isInside:!0,children:(0,e.jsx)(bj,{id:j.contentId,role:"tooltip",children:f||d})})]})})});bD.displayName=bC;var bJ="TooltipArrow",bK=p.forwardRef((a,b)=>{let{__scopeTooltip:c,...d}=a,f=bm(c);return bG(bJ,c).isInside?null:(0,e.jsx)(a9,{...f,...d,ref:b})});function bL({delayDuration:a=0,...b}){return(0,e.jsx)(br,{delayDuration:a,...b})}function bM(a){return(0,e.jsx)(bL,{children:(0,e.jsx)(bv,{...a})})}function bN(a){return(0,e.jsx)(bx,{...a})}function bO({className:a,sideOffset:b=4,children:c,...d}){return(0,e.jsx)(bB,{children:(0,e.jsxs)(bD,{sideOffset:b,className:(0,j.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",a),...d,children:[c,(0,e.jsx)(bK,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] fill-primary"})]})})}bK.displayName=bJ;var bP=a.i(3015);let bQ=[{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 bR({url:a}){let[b,c]=(0,p.useState)(!1),d=(0,p.useRef)(null);(0,p.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]);let f=(0,p.useCallback)(async()=>{try{await navigator.clipboard.writeText(a),c(!0),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>c(!1),1500)}catch{}},[a]);return(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",onClick:f,children:[b?(0,e.jsx)(h.Icons.check,{}):(0,e.jsx)(h.Icons.copy,{}),b?"Copied":"Copy URL"]})}function bS({reason:a,children:b}){return a?(0,e.jsxs)(bM,{children:[(0,e.jsx)(bN,{asChild:!0,children:(0,e.jsx)("span",{className:"cursor-not-allowed",children:b})}),(0,e.jsx)(bO,{children:a})]}):(0,e.jsx)(e.Fragment,{children:b})}function bT({box:a}){let{webUrl:b,vncUrl:c}=a,{apps:d,supported:f,pending:g,launch:i}=function(a){let[b,c]=(0,p.useState)(null),[d,e]=(0,p.useState)(null);(0,p.useEffect)(()=>{let a=!0;return(async()=>{try{let b=await fetch("/api/v1/open-targets",{credentials:"same-origin"});a&&c(b.ok?await b.json():null)}catch{a&&c(null)}})(),()=>{a=!1}},[]);let f=(0,p.useCallback)(async b=>{e(b);try{let c=await fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/open`,{method:"POST",credentials:"same-origin",headers:{"content-type":"application/json"},body:JSON.stringify({app:b})});if(!c.ok){let a=await c.json().catch(()=>null);window.alert(`Open in ${b} failed: ${a?.error?.message??`HTTP ${c.status}`}`)}}catch(a){window.alert(`Open in ${b} failed: ${a instanceof Error?a.message:String(a)}`)}finally{e(null)}},[a.id]),g=b?.supported?b.targets:null;return{apps:g?bQ.map(({app:b,label:c,icon:d})=>{let e=g[b],f=e.available?e.providers&&!e.providers.includes(a.provider)?`Not available for ${a.provider} boxes`:null:e.reason??`${c} is not installed`;return{app:b,label:c,icon:d,disabledReason:f}}):[],supported:null!==g,pending:d,launch:f}}(a),j="paused"===a.status?"Box is paused — resume to access":"stopped"===a.status?"Box is stopped — start to access":null,k=b?null:j??"No web service exposed",m=c?null:!1===a.vncEnabled?"VNC is not enabled for this box":j??"VNC is not available";return f||b||c?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(bP.SectionLabel,{children:"Access"}),(0,e.jsxs)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,e.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,e.jsx)("div",{className:"text-[13.5px] font-medium",children:b||!c?"Web":"VNC"}),(0,e.jsx)("div",{className:"mt-0.5 break-all font-mono text-[11.5px] text-muted-foreground",children:b??(c?"Remote desktop":k)})]}),(0,e.jsxs)("div",{className:"flex flex-none flex-wrap gap-1.5",children:[b?(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",href:b,target:"_blank",rel:"noreferrer",children:[(0,e.jsx)(h.Icons.ext,{}),"Open web"]}):(0,e.jsx)(bS,{reason:k,children:(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,e.jsx)(h.Icons.ext,{}),"Open web"]})}),b?(0,e.jsx)(bR,{url:b}):null,c?(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",href:c,target:"_blank",rel:"noreferrer",onClick:()=>{fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/screen`,{method:"POST",credentials:"same-origin"}).catch(()=>{})},children:[(0,e.jsx)(h.Icons.ext,{}),"Open VNC"]}):(0,e.jsx)(bS,{reason:m,children:(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:!0,children:[(0,e.jsx)(h.Icons.ext,{}),"Open VNC"]})})]})]}),f?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,e.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,e.jsx)("div",{className:"text-[13.5px] font-medium",children:"Apps"}),(0,e.jsx)("div",{className:"mt-0.5 text-[11.5px] text-muted-foreground",children:"Open the box project from the host"})]}),(0,e.jsx)("div",{className:"flex flex-none flex-wrap justify-end gap-1.5",children:d.map(({app:a,label:b,icon:c,disabledReason:d})=>{let f=h.Icons[c];return(0,e.jsx)(bS,{reason:d,children:(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:null!==d||null!==g,onClick:()=>void i(a),children:[(0,e.jsx)(f,{}),b]})},a)})})]}):null]})]}):null}var bU=a.i(24288),bV=a.i(17236),bW=a.i(51363);function bX({k:a,v:b,mono:c,link:d}){return(0,e.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,e.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:a}),(0,e.jsx)("div",{className:(0,j.cn)("min-w-0 text-[13.5px]",c?"font-mono text-[13px]":""),children:d?(0,e.jsx)(bW.default,{className:"cursor-pointer text-primary",href:d,children:b}):b})]})}var bY=a.i(12019),bZ=a.i(45515),b$=a.i(85883),b_=a.i(34537),b0=a.i(53596),b1=a.i(96664);let b2=(0,b1.createServerReference)("701f76d6421dda43ffa384cecc8af68054ae932ae7",b1.callServer,void 0,b1.findSourceMapURL,"gitBranchAction"),b3=(0,b1.createServerReference)("60cbe55eef8623ee1978dbbca54a40a5a06908ca67",b1.callServer,void 0,b1.findSourceMapURL,"gitCheckoutAction"),b4=(0,b1.createServerReference)("6011fde4b290a5d458b0adfaf97f369069e0985dda",b1.callServer,void 0,b1.findSourceMapURL,"gitPullAction"),b5=(0,b1.createServerReference)("6009b05a36f2385aa4c99c3aee7d5889fe2ae88924",b1.callServer,void 0,b1.findSourceMapURL,"gitPushAction"),b6=(0,b1.createServerReference)("605ba44cb95608c5b28084880a16cacadea02e818d",b1.callServer,void 0,b1.findSourceMapURL,"gitPushHostAction"),b7=0;function b8({toasts:a,dismiss:b}){return(0,e.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:a.map(a=>(0,e.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,e.jsx)("span",{className:(0,j.cn)("mt-0.5 grid h-6 w-6 flex-none place-items-center rounded-md border","error"===a.variant?"border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]":"border-[var(--green-line)] bg-accent text-primary"),children:"error"===a.variant?(0,e.jsx)(h.Icons.warn,{className:"size-3.5"}):(0,e.jsx)(h.Icons.check,{className:"size-3.5"})}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-[13px] font-semibold leading-tight",children:a.title}),a.detail?(0,e.jsx)("div",{className:"mt-0.5 break-words font-mono text-[11.5px] leading-normal text-muted-foreground",children:a.detail}):null]}),(0,e.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:()=>b(a.id),"aria-label":"Dismiss",children:(0,e.jsx)(h.Icons.x,{className:"size-3"})})]},a.id))})}function b9({label:a,desc:b,children:c}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 px-4.5 p-3.5",children:[(0,e.jsxs)("div",{className:"min-w-[150px] flex-1",children:[(0,e.jsx)("div",{className:"text-[13.5px] font-medium",children:a}),(0,e.jsx)("div",{className:"mt-0.5 font-mono text-[11.5px] text-muted-foreground",children:b})]}),(0,e.jsx)("div",{className:"flex flex-none flex-wrap gap-1.5",children:c})]})}function ca({icon:a,disabled:b,onRun:c,children:d}){let[f,g]=(0,p.useState)(!1),h=async()=>{g(!0);try{await c()}finally{g(!1)}};return(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:b||f,onClick:h,children:[f?(0,e.jsx)("span",{className:"spin",style:{width:12,height:12}}):(0,e.jsx)(a,{}),d]})}function cb(a,b){let c=(a??"").trim()||(b??"").trim();return c?c.split("\n")[0]:void 0}function cc({box:a}){let b=(0,f.useRouter)(),{toasts:c,push:d,dismiss:g}=function(){let[a,b]=(0,p.useState)([]),c=(0,p.useCallback)(a=>b(b=>b.filter(b=>b.id!==a)),[]);return{toasts:a,push:(0,p.useCallback)(a=>{let d=++b7;b(b=>[...b,{id:d,...a}]),setTimeout(()=>c(d),4200)},[c]),dismiss:c}}(),[i,k]=(0,p.useState)(null),[m,n]=(0,p.useState)(null),o="running"!==a.status,r=(0,p.useCallback)(async()=>{try{let b=await fetch(`/api/v1/boxes/${encodeURIComponent(a.id)}/git`,{credentials:"same-origin"});k(b.ok?await b.json():null)}catch{k(null)}},[a.id]);(0,p.useEffect)(()=>{r()},[r]);let s=i?.ok&&i.branch?i.branch:a.branch||"—",t=()=>{r(),b.refresh()},u=async(a,b)=>{let c=await b();c.ok?(d({title:a,detail:cb(c.stdout,c.stderr)}),t()):d({variant:"error",title:`${a} failed`,detail:c.error})};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(l.Card,{className:(0,j.cn)("divide-y divide-border/60 overflow-hidden",o?"opacity-90":""),children:[o?(0,e.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,e.jsx)(h.Icons.warn,{className:"size-3.5 flex-none"}),"Box is ",a.status," — git operations need a running box."]}):null,(0,e.jsxs)(b9,{label:"Sync",desc:`origin ↔ ${s}`,children:[(0,e.jsx)(ca,{icon:h.Icons.arrowL,disabled:o,onRun:()=>u("Pulled from origin",()=>b4(a.id)),children:"Pull"}),(0,e.jsx)(ca,{icon:h.Icons.ext,disabled:o,onRun:()=>u("Pushed to origin",()=>b5(a.id)),children:"Push"}),(0,e.jsx)(ca,{icon:h.Icons.host,disabled:o,onRun:()=>u("Pushed to host",()=>b6(a.id)),children:"Push to host"})]}),(0,e.jsxs)(b9,{label:"Branch",desc:`currently on ${s}`,children:[(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:o,onClick:()=>n("change"),children:[(0,e.jsx)(h.Icons.branch,{}),"Change branch"]}),(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:o,onClick:()=>n("new"),children:[(0,e.jsx)(h.Icons.plus,{}),"New branch"]})]})]}),"change"===m?(0,e.jsx)(cf,{box:a,branch:s,onClose:()=>n(null),onDone:d,onRefresh:t}):null,"new"===m?(0,e.jsx)(cg,{box:a,onClose:()=>n(null),onDone:d,onRefresh:t}):null,(0,e.jsx)(b8,{toasts:c,dismiss:g})]})}let cd="__manual__";function ce({boxId:a,value:b,onChange:c,id:d,headLabel:f,currentBranch:g}){let[h,i]=(0,p.useState)(null),[j,k]=(0,p.useState)(g??null),[l,m]=(0,p.useState)(!1);return((0,p.useEffect)(()=>{let b=!1;return(async()=>{try{let c=await fetch(`/api/v1/boxes/${encodeURIComponent(a)}/branches`,{credentials:"same-origin"}),d=c.ok?await c.json():null;if(b)return;d&&Array.isArray(d.branches)&&d.branches.length>0?(i(d.branches),g||"string"!=typeof d.current||k(d.current)):(i([]),m(!0))}catch{b||(i([]),m(!0))}})(),()=>{b=!0}},[a,g]),null===h)?(0,e.jsx)(b0.Select,{id:d,value:"",disabled:!0,wrapperClassName:"w-full",children:(0,e.jsx)("option",{value:"",children:"Loading branches…"})}):l?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(b$.Input,{id:d,className:"font-mono text-[13px]",autoFocus:!0,value:b,onChange:a=>c(a.target.value),placeholder:f?"HEAD":"feature-x"}),h.length>0?(0,e.jsx)("button",{type:"button",onClick:()=>{m(!1),c("")},className:"mt-1.5 cursor-pointer text-xs text-secondary-foreground underline-offset-2 hover:underline",children:"← Back to branch list"}):null]}):(0,e.jsxs)(b0.Select,{id:d,value:b,wrapperClassName:"w-full",onChange:a=>{if(a.target.value===cd){m(!0),c("");return}c(a.target.value)},children:[f?(0,e.jsx)("option",{value:"",children:f}):(0,e.jsx)("option",{value:"",disabled:!0,children:"Select a branch…"}),(0,e.jsx)("option",{value:cd,children:"Other / type manually…"}),(0,e.jsx)("option",{disabled:!0,children:"────────────"}),h.map(a=>(0,e.jsxs)("option",{value:a,children:[a,a===j?" (current)":""]},a))]})}function cf({box:a,branch:b,onClose:c,onDone:d,onRefresh:f}){let[g,i]=(0,p.useState)(""),[j,k]=(0,p.useState)(!1),[l,m]=(0,p.useState)(null),n=g.trim().length>0;return(0,e.jsxs)(bZ.Dialog,{onClose:c,className:"max-w-[440px]",children:[(0,e.jsxs)(bZ.DialogHeader,{children:[(0,e.jsx)(bZ.DialogIcon,{children:(0,e.jsx)(h.Icons.branch,{})}),(0,e.jsxs)("div",{children:[(0,e.jsx)(bZ.DialogTitle,{children:"Change branch"}),(0,e.jsxs)(bZ.DialogDescription,{children:[a.id," · currently on ",b]})]})]}),(0,e.jsxs)(bZ.DialogBody,{children:[(0,e.jsx)(b_.Label,{htmlFor:"gb-branch",children:"Branch"}),(0,e.jsx)(ce,{boxId:a.id,id:"gb-branch",value:g,onChange:i,currentBranch:b}),(0,e.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"The branch must exist and not be checked out in another worktree."}),l?(0,e.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:l}):null]}),(0,e.jsxs)(bZ.DialogFooter,{children:[(0,e.jsx)(q.Button,{variant:"outline",onClick:c,disabled:j,children:"Cancel"}),(0,e.jsxs)(q.Button,{onClick:()=>{n&&!j&&(k(!0),m(null),(async()=>{let b=await b3(a.id,g.trim());b.ok?(d({title:"Branch changed",detail:cb(b.stdout,b.stderr)}),c(),f()):(m(b.error),k(!1))})())},disabled:!n||j,children:[j?(0,e.jsx)("span",{className:"spin"}):(0,e.jsx)(h.Icons.check,{}),j?"Checking out…":"Change branch"]})]})]})}function cg({box:a,onClose:b,onDone:c,onRefresh:d}){let[f,g]=(0,p.useState)(""),[i,j]=(0,p.useState)(""),[k,l]=(0,p.useState)(!1),[m,n]=(0,p.useState)(null),o=f.trim().length>0,r=()=>{o&&!k&&(l(!0),n(null),(async()=>{let e=await b2(a.id,f.trim(),i.trim()||void 0);e.ok?(c({title:"Branch created",detail:cb(e.stdout,e.stderr)}),b(),d()):(n(e.error),l(!1))})())};return(0,e.jsxs)(bZ.Dialog,{onClose:b,className:"max-w-[440px]",children:[(0,e.jsxs)(bZ.DialogHeader,{children:[(0,e.jsx)(bZ.DialogIcon,{children:(0,e.jsx)(h.Icons.branch,{})}),(0,e.jsxs)("div",{children:[(0,e.jsx)(bZ.DialogTitle,{children:"New branch"}),(0,e.jsxs)(bZ.DialogDescription,{children:[a.id," · branching in the box workspace"]})]})]}),(0,e.jsxs)(bZ.DialogBody,{children:[(0,e.jsxs)("div",{className:"mb-4",children:[(0,e.jsx)(b_.Label,{htmlFor:"nb-name",children:"Name"}),(0,e.jsx)(b$.Input,{id:"nb-name",className:"font-mono text-[13px]",autoFocus:!0,value:f,onChange:a=>g(a.target.value),onKeyDown:a=>{"Enter"===a.key&&r()},placeholder:"my-branch"}),(0,e.jsxs)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:["An ",(0,e.jsx)("span",{className:"font-mono",children:"agentbox/"})," prefix is added when missing."]})]}),(0,e.jsxs)(b_.Label,{htmlFor:"nb-from",children:["Base ref ",(0,e.jsx)("span",{className:"font-normal text-[#a4a9b0]",children:"(optional)"})]}),(0,e.jsx)(ce,{boxId:a.id,id:"nb-from",value:i,onChange:j,headLabel:"Current HEAD (default)"}),(0,e.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground",children:"Defaults to the box's current HEAD."}),m?(0,e.jsx)("p",{className:"mt-2 break-words font-mono text-xs text-destructive",children:m}):null]}),(0,e.jsxs)(bZ.DialogFooter,{children:[(0,e.jsx)(q.Button,{variant:"outline",onClick:b,disabled:k,children:"Cancel"}),(0,e.jsxs)(q.Button,{onClick:r,disabled:!o||k,children:[k?(0,e.jsx)("span",{className:"spin"}):(0,e.jsx)(h.Icons.plus,{}),k?"Creating…":"Create branch"]})]})]})}let ch=(0,b1.createServerReference)("60bb8c910c5e51fa1eff446da65f06ddf018948471",b1.callServer,void 0,b1.findSourceMapURL,"restartServiceAction"),ci=new Set(["ready","running","done"]),cj=new Set(["crashed","unhealthy","backoff","failed"]),ck={up:"bg-[var(--green)]",bad:"bg-[var(--red)]",idle:"bg-[var(--amber)]"},cl={up:"text-[var(--green-ink)]",bad:"text-[var(--red)]",idle:"text-[var(--amber)]"};function cm({svc:a,disabled:b,onRestart:c}){var d;let f=(d=a.state,ci.has(d)?"up":cj.has(d)?"bad":"idle");return(0,e.jsxs)("div",{className:"flex items-center gap-3 px-4 py-2.5",children:[(0,e.jsx)("span",{className:(0,j.cn)("badge-dot",ck[f]),"aria-hidden":!0}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-secondary-foreground",children:a.name}),(0,e.jsx)("span",{className:(0,j.cn)("font-mono text-xs",cl[f]),children:a.state}),a.restarts>0?(0,e.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground",children:["↻",a.restarts]}):null,(0,e.jsx)(q.Button,{variant:"outline",size:"icon-sm",title:`Restart ${a.name}`,disabled:b,onClick:()=>c(a.name),children:(0,e.jsx)(h.Icons.refresh,{})})]})}function cn({id:a,running:b}){let[c,d]=(0,p.useState)(null),[f,g]=(0,p.useState)(null),[i,j]=(0,p.useTransition)(),k=(0,p.useCallback)(async()=>{try{let b=await fetch(`/api/v1/boxes/${encodeURIComponent(a)}/services`,{credentials:"same-origin"});if(!b.ok)return void g(`status ${String(b.status)}`);d(await b.json()),g(null)}catch(a){g(a instanceof Error?a.message:String(a))}},[a]);(0,p.useEffect)(()=>{if(k(),!b)return;let a=setInterval(()=>void k(),4e3);return()=>clearInterval(a)},[k,b]);let m=b=>{j(async()=>{let c=await ch(a,b);c.ok||window.alert(`Restart failed: ${c.error}`),await k()})},n=c?.services??[],o=n.length>0;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(bP.SectionLabel,{right:o?(0,e.jsxs)(q.Button,{variant:"outline",size:"sm",disabled:!b||i,onClick:()=>m(void 0),children:[(0,e.jsx)(h.Icons.refresh,{}),"Restart all"]}):null,children:"Services"}),(0,e.jsx)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:c||f?f?(0,e.jsxs)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:["Could not load services (",f,")."]}):o?(0,e.jsxs)(e.Fragment,{children:[c?.source==="persisted"?(0,e.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,n.map(a=>(0,e.jsx)(cm,{svc:a,disabled:!b||i,onRestart:a=>m(a)},a.name))]}):(0,e.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:c?.source==="unavailable"?"No service status (box not running or no snapshot yet).":"No services declared in agentbox.yaml."}):(0,e.jsx)("div",{className:"px-4 py-3 text-sm text-muted-foreground",children:"Loading…"})})]})}var co=a.i(82337);a.s(["default",0,function(){let{id:a}=(0,f.useParams)(),{box:b,project:c}=(0,m.useStore)(),d=b(a);if(!d)return(0,e.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8",children:[(0,e.jsx)(bU.BackLink,{to:"/",children:"All boxes"}),(0,e.jsx)(bY.EmptyBox,{children:"This box no longer exists — it may have been destroyed."})]});let j=c(d.projectId);return(0,e.jsxs)("div",{className:"mx-auto w-full max-w-[1080px] px-8 pb-16 pt-8 max-sm:px-4",children:[(0,e.jsx)(bU.BackLink,{to:"/projects/"+d.projectId,children:j?j.name:"Project"}),(0,e.jsxs)("div",{className:"flex items-start gap-4 max-md:flex-col",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("h1",{className:"flex flex-wrap items-center gap-3 text-[25px] font-semibold leading-tight tracking-[-0.025em]",children:[d.task,(0,e.jsx)(i.StatusBadge,{status:d.status})]}),(0,e.jsxs)("div",{className:"mt-1.5 text-sm text-muted-foreground",children:[(0,e.jsx)("span",{className:"font-mono text-secondary-foreground",children:d.id})," ·"," ",(0,e.jsx)("span",{className:"font-mono text-secondary-foreground",children:d.repo})," · ",d.host]})]}),(0,e.jsx)("div",{className:"ml-auto flex-none max-md:ml-0",children:(0,e.jsx)(bV.BoxActions,{box:d,size:"lg"})})]}),d.error?(0,e.jsx)(k,{className:"mt-4 border-[var(--red-line)] bg-[var(--red-soft)] text-[var(--red)]",icon:h.Icons.warn,title:"Box errored",children:(0,e.jsx)("span",{className:"font-mono text-secondary-foreground",children:d.error})}):null,(0,e.jsx)(o,{boxId:d.id}),(0,e.jsx)(bP.SectionLabel,{children:"Overview"}),(0,e.jsxs)(co.StatGrid,{children:[(0,e.jsx)(co.Stat,{k:"Status",v:(0,e.jsx)(i.StatusBadge,{status:d.status})}),(0,e.jsx)(co.Stat,{k:"Agent CLI",v:d.agent,mono:!0}),(0,e.jsx)(co.Stat,{k:"Commits",v:d.commits??"—",icon:h.Icons.commit}),(0,e.jsx)(co.Stat,{k:"Files touched",v:d.filesTouched??"—",icon:h.Icons.file}),(0,e.jsx)(co.Stat,{k:"Last activity",v:(0,e.jsx)(g.Ago,{ms:d.lastActivity}),mono:!0})]}),(0,e.jsx)(bT,{box:d}),(0,e.jsx)(bP.SectionLabel,{children:"Git operations"}),(0,e.jsx)(cc,{box:d}),(0,e.jsx)(cn,{id:d.id,running:"running"===d.status}),(0,e.jsx)(bP.SectionLabel,{children:"Details"}),(0,e.jsxs)(l.Card,{className:"divide-y divide-border/60 overflow-hidden",children:[(0,e.jsx)(bX,{k:"Box ID",v:d.id,mono:!0}),(0,e.jsx)(bX,{k:"Project",v:j?j.name:"—",link:j?"/projects/"+d.projectId:null}),(0,e.jsx)(bX,{k:"Repository",v:d.repo,mono:!0}),(0,e.jsx)(bX,{k:"Branch",v:d.branch,mono:!0}),(0,e.jsx)(bX,{k:"Host",v:d.host,mono:!0}),(0,e.jsx)(bX,{k:"Created",v:new Date(d.createdAt).toLocaleString(),mono:!0})]})]})}],58099)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub_app_%28dashboard%29_boxes_%5Bid%5D_page_tsx_1-j_972._.js.map
@@ -1,3 +1,3 @@
1
- module.exports=[61688,10511,47685,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(17607),e=a.i(97187),f=a.i(71152),g=a.i(87883),h=a.i(24985),i=a.i(17236);a.s(["BoxTable",0,function({boxes:a}){let j=(0,c.useRouter)();return(0,b.jsx)(g.Card,{className:"overflow-hidden",children:(0,b.jsxs)(h.Table,{children:[(0,b.jsx)(h.TableHeader,{children:(0,b.jsxs)(h.TableRow,{className:"hover:bg-transparent",children:[(0,b.jsx)(h.TableHead,{className:"w-[38%]",children:"Task"}),(0,b.jsx)(h.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,b.jsx)(h.TableHead,{className:"max-md:hidden",children:"Status"}),(0,b.jsx)(h.TableHead,{className:"text-right",children:"Actions"})]})}),(0,b.jsx)(h.TableBody,{children:a.map(a=>(0,b.jsxs)(h.TableRow,{className:"cursor-pointer",onClick:()=>j.push("/boxes/"+a.id),children:[(0,b.jsxs)(h.TableCell,{children:[(0,b.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:a.task}),(0,b.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[a.id," · ",a.host]})]}),(0,b.jsxs)(h.TableCell,{className:"max-md:hidden",children:[(0,b.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,b.jsx)(e.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,b.jsx)("span",{className:"truncate",children:a.branch})]}),(0,b.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[a.agent," · ",(0,b.jsx)(d.Ago,{ms:a.lastActivity})]})]}),(0,b.jsx)(h.TableCell,{className:"max-md:hidden",children:(0,b.jsx)(f.StatusBadge,{status:a.status})}),(0,b.jsx)(h.TableCell,{className:"text-right",onClick:a=>a.stopPropagation(),children:(0,b.jsx)(i.BoxActions,{box:a})})]},a.id))})]})})}],61688);var j=a.i(50253),k=a.i(54473),l=a.i(18071),m=a.i(45515),n=a.i(85883),o=a.i(53596),p=a.i(86834);function q({className:a,...c}){return(0,b.jsx)("textarea",{className:(0,p.cn)("flex min-h-[76px] w-full resize-y rounded-lg border border-input bg-card px-3 py-2 text-sm leading-normal 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",a),...c})}var r=a.i(96664);let s=(0,r.createServerReference)("4070192706087364b8c7d220576a6f3e4d3e5c532b",r.callServer,void 0,r.findSourceMapURL,"createBoxAction"),t=(0,r.createServerReference)("40386bdce4d894a318a969412fa1299d2704ccdfb3",r.callServer,void 0,r.findSourceMapURL,"listBranchesAction");var u=a.i(80007),v=a.i(94290);let w=[{id:"docker",label:"Docker (local)",configured:!0}];function x({project:a,projects:d,onClose:f}){let g=(0,c.useRouter)(),{state:h}=(0,u.useStore)(),[i,k]=(0,j.useState)(null),r=i??(h.providers.length?h.providers:w),[A,B]=(0,j.useTransition)(),[C,D]=(0,j.useState)(a?.id??d[0]?.id??""),[E,F]=(0,j.useState)("claude"),[G,H]=(0,j.useState)("docker"),[I,J]=(0,j.useState)(""),[K,L]=(0,j.useState)(""),[M,N]=(0,j.useState)(""),[O,P]=(0,j.useState)(null),[Q,R]=(0,j.useState)(!1),[S,T]=(0,j.useState)(!1),[U,V]=(0,j.useState)(null),[W,X]=(0,j.useState)(null),[Y,Z]=(0,j.useState)("streaming"),[$,_]=(0,j.useState)(null),[aa,ab]=(0,j.useState)(null),[ac,ad]=(0,j.useState)(!1),[ae,af]=(0,j.useState)(null);(0,j.useEffect)(()=>{let a=!1;return(async()=>{try{let b=await fetch("/api/v1/providers?freshness=1&hosts=expand",{credentials:"same-origin"});if(!b.ok)return;let c=await b.json();if(a)return;let d=c.providers??[];k(d);let e={};for(let a of d)e[a.id]={baseStatus:a.baseStatus,baseStaleReason:a.baseStaleReason,jobId:a.jobId};af(e)}catch{}})(),()=>{a=!0}},[]);let ag=d.find(a=>a.id===C)??a,ah=G??"docker",ai=r.find(a=>a.id===ah),aj=ae?.[ah],ak=!!aj&&(!!aj.jobId||"unprepared"===aj.baseStatus||"stale"===aj.baseStatus);(0,j.useEffect)(()=>{if(!C||W)return;R(ag?.needsSetup??!1),H("docker");let a=!1;return P(null),N(ag?.currentBranch??""),t(C).then(b=>{if(a||!b.ok){a||b.ok||P([]);return}P(b.branches),b.current&&b.branches.includes(b.current)&&N(b.current)}),()=>{a=!0}},[C,W]);let al=()=>{V(null);let a=aj?.jobId;a?ab(a):B(async()=>{try{let a=await fetch(`/api/v1/providers/${encodeURIComponent(ah)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),b=await a.json().catch(()=>null);if(!a.ok||!b?.jobId)return void V(b?.error?.message??`base image build request failed (${a.status})`);ab(b.jobId)}catch(a){V(a instanceof Error?a.message:String(a))}})},am=()=>{V(null),B(async()=>{let a=await s({projectId:C,agent:E,provider:G,name:I.trim()||void 0,prompt:"none"===E?void 0:K.trim()||void 0,fromBranch:M.trim()&&M.trim()!==ag?.currentBranch?M.trim():void 0,setupWizard:"none"!==E&&Q});a.ok?(X(a.jobId),g.refresh()):V(a.error)})};return(0,b.jsxs)(m.Dialog,{onClose:f,className:W||aa?"max-w-[900px]":"max-w-[560px]",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogIcon,{children:(0,b.jsx)(e.Icons.box,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.DialogTitle,{children:!W&&aa?"Building base image":"Create box"}),(0,b.jsx)(m.DialogDescription,{children:ag?ag.name:"Start a box in a project"})]}),W||aa?(0,b.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,b.jsx)(y,{status:Y,loginPhase:$})}):null]}),(0,b.jsx)(m.DialogBody,{className:"flex flex-col gap-4",children:W?(0,b.jsx)(v.JobLogStream,{jobId:W,onStatus:Z,onDone:()=>g.refresh(),onLogin:a=>_(a?.phase??null)}):aa?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",ai?.label??ah," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,b.jsx)(v.JobLogStream,{jobId:aa,onStatus:Z,onDone:a=>{"done"===a?am():V(`base image build ${a}`)}}),U?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:U}):null]}):(0,b.jsxs)(b.Fragment,{children:[a?null:(0,b.jsx)(z,{label:"Project",children:(0,b.jsxs)(o.Select,{value:C,onChange:a=>D(a.target.value),children:[0===d.length?(0,b.jsx)("option",{value:"",children:"No projects — add one first"}):null,d.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))]})}),(0,b.jsx)(z,{label:"Provider",children:(0,b.jsx)(o.Select,{value:G,onChange:a=>H(a.target.value),children:r.map(a=>(0,b.jsxs)("option",{value:a.id,disabled:!a.configured,title:a.reason,children:[a.label,a.configured?"":" — not configured"]},a.id))})}),ak?(0,b.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:aj?.baseStaleReason,children:aj?.jobId?"A base-image build is already running — the box will be created when it finishes.":aj?.baseStatus==="unprepared"?"First use of this provider: the base image will be downloaded or built first (can take 5–10 minutes).":"The base image is out of date and will be rebuilt first (can take 5–10 minutes)."}):null,(0,b.jsx)(z,{label:"Agent",children:(0,b.jsxs)(o.Select,{value:E,onChange:a=>F(a.target.value),children:[(0,b.jsx)("option",{value:"claude",children:"Claude"}),(0,b.jsx)("option",{value:"codex",children:"Codex"}),(0,b.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,b.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,b.jsx)(z,{label:"Name (optional)",children:(0,b.jsx)(n.Input,{value:I,onChange:a=>J(a.target.value),placeholder:"auto"})}),ag?.needsSetup&&"none"!==E?(0,b.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",checked:Q,onChange:a=>R(a.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,b.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===E?(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,b.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>T(a=>!a),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,b.jsx)(e.Icons.chevR,{className:(0,p.cn)("size-3.5 transition-transform",S&&"rotate-90")}),"Advanced"]}),S?(0,b.jsxs)(b.Fragment,{children:[null===O?(0,b.jsx)(z,{label:"Base branch",children:(0,b.jsx)(o.Select,{value:"",disabled:!0,children:(0,b.jsx)("option",{value:"",children:"Loading branches…"})})}):O.length>0?(0,b.jsx)(z,{label:"Base branch",children:(0,b.jsxs)(o.Select,{value:M,onChange:a=>N(a.target.value),children:[ag?.currentBranch&&!O.includes(ag.currentBranch)?(0,b.jsxs)("option",{value:"",children:[ag.currentBranch," (current)"]}):null,O.map(a=>(0,b.jsxs)("option",{value:a,children:[a,a===ag?.currentBranch?" (current)":""]},a))]})}):null,"none"!==E?(0,b.jsx)(z,{label:"Initial prompt (optional)",children:(0,b.jsx)(q,{value:K,onChange:a=>L(a.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),U?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:U}):null]})}),(0,b.jsx)(m.DialogFooter,{children:W||aa?(0,b.jsxs)(b.Fragment,{children:["streaming"===Y?(0,b.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:W?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,b.jsx)(l.Button,{onClick:f,children:"Close"})]}):ac?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:aj?.baseStaleReason,children:["The ",ai?.label??ah," base image is out of date."]}),(0,b.jsx)(l.Button,{variant:"outline",onClick:()=>ad(!1),disabled:A,children:"Cancel"}),(0,b.jsx)(l.Button,{variant:"outline",onClick:()=>{ad(!1),am()},disabled:A,children:"Use existing image"}),(0,b.jsx)(l.Button,{onClick:()=>{ad(!1),al()},disabled:A,children:"Rebuild & create"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.Button,{variant:"outline",onClick:f,disabled:A,children:"Cancel"}),(0,b.jsx)(l.Button,{onClick:()=>{(V(null),C)?ak?"docker"===ah||aj?.baseStatus!=="stale"||aj.jobId?al():ad(!0):am():V("pick a project")},disabled:A||!C,children:A?"Starting…":"Create box"})]})})]})}function y({status:a,loginPhase:c}){return"done"===a?(0,b.jsxs)(k.Badge,{className:"badge-run",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===a||"error"===a||"cancelled"===a?(0,b.jsxs)(k.Badge,{className:"badge-err",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===c?(0,b.jsxs)(k.Badge,{className:"badge-err",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===c||"starting"===c||"exchanging"===c?(0,b.jsxs)(k.Badge,{className:"badge-create",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,b.jsxs)(k.Badge,{className:"badge-create",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Working…"]})}function z({label:a,children:c}){return(0,b.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:a}),c]})}a.s(["CreateBoxButton",0,function({project:a,projects:c,variant:d,size:f,className:g}){let[h,i]=(0,j.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(l.Button,{variant:d,size:f,className:g,onClick:()=>i(!0),children:[(0,b.jsx)(e.Icons.plus,{}),"Create box"]}),h?(0,b.jsx)(x,{project:a,projects:c??(a?[a]:[]),onClose:()=>i(!1)}):null]})}],10511);let A=(0,r.createServerReference)("40c7856bd78dddab224344045df78d51620e411335",r.callServer,void 0,r.findSourceMapURL,"removeProjectAction");a.s(["DeleteProjectButton",0,function({project:a,size:d,className:f,redirectHome:g}){let h=(0,c.useRouter)(),[i,k]=(0,j.useTransition)();return(0,b.jsxs)(l.Button,{variant:"destructive",size:d,className:f,title:"Delete project",disabled:i,onClick:b=>{b.stopPropagation(),b.preventDefault(),window.confirm(`Remove project "${a.name}" from the hub? Its folder and files are NOT deleted — this only unregisters it (and any hub-set project settings). This cannot be undone.`)&&k(async()=>{let b=await A(a.id);b.ok?g?h.push("/"):h.refresh():window.alert(`Delete failed: ${b.error}`)})},children:[(0,b.jsx)(e.Icons.trash,{}),"Delete"]})}],47685)}];
1
+ module.exports=[61688,10511,47685,a=>{"use strict";var b=a.i(33552),c=a.i(74455),d=a.i(17607),e=a.i(97187),f=a.i(71152),g=a.i(87883),h=a.i(24985),i=a.i(17236);a.s(["BoxTable",0,function({boxes:a}){let j=(0,c.useRouter)();return(0,b.jsx)(g.Card,{className:"overflow-hidden",children:(0,b.jsxs)(h.Table,{children:[(0,b.jsx)(h.TableHeader,{children:(0,b.jsxs)(h.TableRow,{className:"hover:bg-transparent",children:[(0,b.jsx)(h.TableHead,{className:"w-[38%]",children:"Task"}),(0,b.jsx)(h.TableHead,{className:"w-[27%] max-md:hidden",children:"Branch"}),(0,b.jsx)(h.TableHead,{className:"max-md:hidden",children:"Status"}),(0,b.jsx)(h.TableHead,{className:"text-right",children:"Actions"})]})}),(0,b.jsx)(h.TableBody,{children:a.map(a=>(0,b.jsxs)(h.TableRow,{className:"cursor-pointer",onClick:()=>j.push("/boxes/"+a.id),children:[(0,b.jsxs)(h.TableCell,{children:[(0,b.jsx)("div",{className:"truncate text-[13.5px] font-medium",children:a.task}),(0,b.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[a.id," · ",a.host]})]}),(0,b.jsxs)(h.TableCell,{className:"max-md:hidden",children:[(0,b.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1.5 font-mono text-xs text-secondary-foreground",children:[(0,b.jsx)(e.Icons.branch,{className:"size-3 flex-none text-muted-foreground"}),(0,b.jsx)("span",{className:"truncate",children:a.branch})]}),(0,b.jsxs)("div",{className:"mt-0.5 font-mono text-[11px] text-[#a4a9b0]",children:[a.agent," · ",(0,b.jsx)(d.Ago,{ms:a.lastActivity})]})]}),(0,b.jsx)(h.TableCell,{className:"max-md:hidden",children:(0,b.jsx)(f.StatusBadge,{status:a.status})}),(0,b.jsx)(h.TableCell,{className:"text-right",onClick:a=>a.stopPropagation(),children:(0,b.jsx)(i.BoxActions,{box:a})})]},a.id))})]})})}],61688);var j=a.i(50253),k=a.i(54473),l=a.i(18071),m=a.i(45515),n=a.i(85883),o=a.i(53596),p=a.i(86834);function q({className:a,...c}){return(0,b.jsx)("textarea",{className:(0,p.cn)("flex min-h-[76px] w-full resize-y rounded-lg border border-input bg-card px-3 py-2 text-sm leading-normal 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",a),...c})}var r=a.i(96664);let s=(0,r.createServerReference)("40aa1d1e1289f7180a05534388d9d3f85322941b7c",r.callServer,void 0,r.findSourceMapURL,"createBoxAction"),t=(0,r.createServerReference)("4028be1ee739986c801692d71e643ba90be579e38c",r.callServer,void 0,r.findSourceMapURL,"listBranchesAction");var u=a.i(80007),v=a.i(94290);let w=[{id:"docker",label:"Docker (local)",configured:!0}];function x({project:a,projects:d,onClose:f}){let g=(0,c.useRouter)(),{state:h}=(0,u.useStore)(),[i,k]=(0,j.useState)(null),r=i??(h.providers.length?h.providers:w),[A,B]=(0,j.useTransition)(),[C,D]=(0,j.useState)(a?.id??d[0]?.id??""),[E,F]=(0,j.useState)("claude"),[G,H]=(0,j.useState)("docker"),[I,J]=(0,j.useState)(""),[K,L]=(0,j.useState)(""),[M,N]=(0,j.useState)(""),[O,P]=(0,j.useState)(null),[Q,R]=(0,j.useState)(!1),[S,T]=(0,j.useState)(!1),[U,V]=(0,j.useState)(null),[W,X]=(0,j.useState)(null),[Y,Z]=(0,j.useState)("streaming"),[$,_]=(0,j.useState)(null),[aa,ab]=(0,j.useState)(null),[ac,ad]=(0,j.useState)(!1),[ae,af]=(0,j.useState)(null);(0,j.useEffect)(()=>{let a=!1;return(async()=>{try{let b=await fetch("/api/v1/providers?freshness=1&hosts=expand",{credentials:"same-origin"});if(!b.ok)return;let c=await b.json();if(a)return;let d=c.providers??[];k(d);let e={};for(let a of d)e[a.id]={baseStatus:a.baseStatus,baseStaleReason:a.baseStaleReason,jobId:a.jobId};af(e)}catch{}})(),()=>{a=!0}},[]);let ag=d.find(a=>a.id===C)??a,ah=G??"docker",ai=r.find(a=>a.id===ah),aj=ae?.[ah],ak=!!aj&&(!!aj.jobId||"unprepared"===aj.baseStatus||"stale"===aj.baseStatus);(0,j.useEffect)(()=>{if(!C||W)return;R(ag?.needsSetup??!1),H("docker");let a=!1;return P(null),N(ag?.currentBranch??""),t(C).then(b=>{if(a||!b.ok){a||b.ok||P([]);return}P(b.branches),b.current&&b.branches.includes(b.current)&&N(b.current)}),()=>{a=!0}},[C,W]);let al=()=>{V(null);let a=aj?.jobId;a?ab(a):B(async()=>{try{let a=await fetch(`/api/v1/providers/${encodeURIComponent(ah)}/prepare`,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify({})}),b=await a.json().catch(()=>null);if(!a.ok||!b?.jobId)return void V(b?.error?.message??`base image build request failed (${a.status})`);ab(b.jobId)}catch(a){V(a instanceof Error?a.message:String(a))}})},am=()=>{V(null),B(async()=>{let a=await s({projectId:C,agent:E,provider:G,name:I.trim()||void 0,prompt:"none"===E?void 0:K.trim()||void 0,fromBranch:M.trim()&&M.trim()!==ag?.currentBranch?M.trim():void 0,setupWizard:"none"!==E&&Q});a.ok?(X(a.jobId),g.refresh()):V(a.error)})};return(0,b.jsxs)(m.Dialog,{onClose:f,className:W||aa?"max-w-[900px]":"max-w-[560px]",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogIcon,{children:(0,b.jsx)(e.Icons.box,{})}),(0,b.jsxs)("div",{children:[(0,b.jsx)(m.DialogTitle,{children:!W&&aa?"Building base image":"Create box"}),(0,b.jsx)(m.DialogDescription,{children:ag?ag.name:"Start a box in a project"})]}),W||aa?(0,b.jsx)("div",{className:"ml-auto mr-8 flex-none pt-0.5",children:(0,b.jsx)(y,{status:Y,loginPhase:$})}):null]}),(0,b.jsx)(m.DialogBody,{className:"flex flex-col gap-4",children:W?(0,b.jsx)(v.JobLogStream,{jobId:W,onStatus:Z,onDone:()=>g.refresh(),onLogin:a=>_(a?.phase??null)}):aa?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["Building the ",ai?.label??ah," base image — one-time, can take several minutes. The box is created automatically when it finishes."]}),(0,b.jsx)(v.JobLogStream,{jobId:aa,onStatus:Z,onDone:a=>{"done"===a?am():V(`base image build ${a}`)}}),U?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:U}):null]}):(0,b.jsxs)(b.Fragment,{children:[a?null:(0,b.jsx)(z,{label:"Project",children:(0,b.jsxs)(o.Select,{value:C,onChange:a=>D(a.target.value),children:[0===d.length?(0,b.jsx)("option",{value:"",children:"No projects — add one first"}):null,d.map(a=>(0,b.jsx)("option",{value:a.id,children:a.name},a.id))]})}),(0,b.jsx)(z,{label:"Provider",children:(0,b.jsx)(o.Select,{value:G,onChange:a=>H(a.target.value),children:r.map(a=>(0,b.jsxs)("option",{value:a.id,disabled:!a.configured,title:a.reason,children:[a.label,a.configured?"":" — not configured"]},a.id))})}),ak?(0,b.jsx)("p",{className:"-mt-2 font-mono text-xs text-amber-600 dark:text-amber-400",title:aj?.baseStaleReason,children:aj?.jobId?"A base-image build is already running — the box will be created when it finishes.":aj?.baseStatus==="unprepared"?"First use of this provider: the base image will be downloaded or built first (can take 5–10 minutes).":"The base image is out of date and will be rebuilt first (can take 5–10 minutes)."}):null,(0,b.jsx)(z,{label:"Agent",children:(0,b.jsxs)(o.Select,{value:E,onChange:a=>F(a.target.value),children:[(0,b.jsx)("option",{value:"claude",children:"Claude"}),(0,b.jsx)("option",{value:"codex",children:"Codex"}),(0,b.jsx)("option",{value:"opencode",children:"OpenCode"}),(0,b.jsx)("option",{value:"none",children:"Empty — just create the box"})]})}),(0,b.jsx)(z,{label:"Name (optional)",children:(0,b.jsx)(n.Input,{value:I,onChange:a=>J(a.target.value),placeholder:"auto"})}),ag?.needsSetup&&"none"!==E?(0,b.jsxs)("label",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("input",{type:"checkbox",checked:Q,onChange:a=>R(a.target.checked),className:"mt-0.5 h-4 w-4 flex-none accent-primary"}),(0,b.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:"Run setup wizard"}),(0,b.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:"This project has no agentbox.yaml — the agent explores the repo and proposes one on its first turn."})]})]}):null,"none"===E?(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["The box is created and left running with no agent — attach later from a terminal or SSH (",(0,b.jsx)("span",{className:"text-secondary-foreground",children:"agentbox shell"}),")."]}):null,(0,b.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>T(a=>!a),className:"flex cursor-pointer items-center gap-1.5 self-start text-xs font-medium text-secondary-foreground transition-colors hover:text-foreground",children:[(0,b.jsx)(e.Icons.chevR,{className:(0,p.cn)("size-3.5 transition-transform",S&&"rotate-90")}),"Advanced"]}),S?(0,b.jsxs)(b.Fragment,{children:[null===O?(0,b.jsx)(z,{label:"Base branch",children:(0,b.jsx)(o.Select,{value:"",disabled:!0,children:(0,b.jsx)("option",{value:"",children:"Loading branches…"})})}):O.length>0?(0,b.jsx)(z,{label:"Base branch",children:(0,b.jsxs)(o.Select,{value:M,onChange:a=>N(a.target.value),children:[ag?.currentBranch&&!O.includes(ag.currentBranch)?(0,b.jsxs)("option",{value:"",children:[ag.currentBranch," (current)"]}):null,O.map(a=>(0,b.jsxs)("option",{value:a,children:[a,a===ag?.currentBranch?" (current)":""]},a))]})}):null,"none"!==E?(0,b.jsx)(z,{label:"Initial prompt (optional)",children:(0,b.jsx)(q,{value:K,onChange:a=>L(a.target.value),rows:3,placeholder:"Leave empty to just start the agent — attach later from a terminal or SSH."})}):null]}):null]}),U?(0,b.jsx)("div",{className:"font-mono text-xs text-destructive",children:U}):null]})}),(0,b.jsx)(m.DialogFooter,{children:W||aa?(0,b.jsxs)(b.Fragment,{children:["streaming"===Y?(0,b.jsx)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",children:W?"The box + agent start in the background — you can close this.":"Keep this open — the box is created when the build finishes."}):null,(0,b.jsx)(l.Button,{onClick:f,children:"Close"})]}):ac?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"mr-auto self-center font-mono text-xs text-muted-foreground",title:aj?.baseStaleReason,children:["The ",ai?.label??ah," base image is out of date."]}),(0,b.jsx)(l.Button,{variant:"outline",onClick:()=>ad(!1),disabled:A,children:"Cancel"}),(0,b.jsx)(l.Button,{variant:"outline",onClick:()=>{ad(!1),am()},disabled:A,children:"Use existing image"}),(0,b.jsx)(l.Button,{onClick:()=>{ad(!1),al()},disabled:A,children:"Rebuild & create"})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.Button,{variant:"outline",onClick:f,disabled:A,children:"Cancel"}),(0,b.jsx)(l.Button,{onClick:()=>{(V(null),C)?ak?"docker"===ah||aj?.baseStatus!=="stale"||aj.jobId?al():ad(!0):am():V("pick a project")},disabled:A||!C,children:A?"Starting…":"Create box"})]})})]})}function y({status:a,loginPhase:c}){return"done"===a?(0,b.jsxs)(k.Badge,{className:"badge-run",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Done"]}):"failed"===a||"error"===a||"cancelled"===a?(0,b.jsxs)(k.Badge,{className:"badge-err",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Failed"]}):"error"===c?(0,b.jsxs)(k.Badge,{className:"badge-err",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Login failed"]}):"awaiting-code"===c||"starting"===c||"exchanging"===c?(0,b.jsxs)(k.Badge,{className:"badge-create",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Login required"]}):(0,b.jsxs)(k.Badge,{className:"badge-create",children:[(0,b.jsx)("span",{className:"badge-dot"}),"Working…"]})}function z({label:a,children:c}){return(0,b.jsxs)("label",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-secondary-foreground",children:a}),c]})}a.s(["CreateBoxButton",0,function({project:a,projects:c,variant:d,size:f,className:g}){let[h,i]=(0,j.useState)(!1);return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(l.Button,{variant:d,size:f,className:g,onClick:()=>i(!0),children:[(0,b.jsx)(e.Icons.plus,{}),"Create box"]}),h?(0,b.jsx)(x,{project:a,projects:c??(a?[a]:[]),onClose:()=>i(!1)}):null]})}],10511);let A=(0,r.createServerReference)("403ea936f248e9bf7e9cc41e4e3f6afd979bdb5f55",r.callServer,void 0,r.findSourceMapURL,"removeProjectAction");a.s(["DeleteProjectButton",0,function({project:a,size:d,className:f,redirectHome:g}){let h=(0,c.useRouter)(),[i,k]=(0,j.useTransition)();return(0,b.jsxs)(l.Button,{variant:"destructive",size:d,className:f,title:"Delete project",disabled:i,onClick:b=>{b.stopPropagation(),b.preventDefault(),window.confirm(`Remove project "${a.name}" from the hub? Its folder and files are NOT deleted — this only unregisters it (and any hub-set project settings). This cannot be undone.`)&&k(async()=>{let b=await A(a.id);b.ok?g?h.push("/"):h.refresh():window.alert(`Delete failed: ${b.error}`)})},children:[(0,b.jsx)(e.Icons.trash,{}),"Delete"]})}],47685)}];
2
2
 
3
3
  //# sourceMappingURL=apps_hub_app_%28dashboard%29_boxes_components_box-table_tsx_0a9pyn_._.js.map
@@ -1,4 +1,4 @@
1
- module.exports=[41503,a=>{"use strict";a.i(24868),a.i(46786),a.i(14747),a.i(54799);var b=`
1
+ module.exports=[41503,a=>{"use strict";a.i(54799),a.i(24868),a.i(46786),a.i(14747);var b=`
2
2
  CREATE TABLE IF NOT EXISTS boxes (
3
3
  box_id text PRIMARY KEY,
4
4
  token text NOT NULL,
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
7
7
  "static/chunks/0cz1d0mv5g_q7.js"
8
8
  ],
9
9
  "lowPriorityFiles": [
10
- "static/S-yw9-SVffiEHRGm85NzP/_buildManifest.js",
11
- "static/S-yw9-SVffiEHRGm85NzP/_ssgManifest.js",
12
- "static/S-yw9-SVffiEHRGm85NzP/_clientMiddlewareManifest.js"
10
+ "static/Wddru2A-5szSWhZWYoMwi/_buildManifest.js",
11
+ "static/Wddru2A-5szSWhZWYoMwi/_ssgManifest.js",
12
+ "static/Wddru2A-5szSWhZWYoMwi/_clientMiddlewareManifest.js"
13
13
  ],
14
14
  "rootMainFiles": [
15
15
  "static/chunks/1y49eldffr2-_.js",
@@ -1 +1 @@
1
- <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1y49eldffr2-_.js"/><script src="/_next/static/chunks/2w65a9zig6ya7.js" async=""></script><script src="/_next/static/chunks/3x8k7so-uoat8.js" async=""></script><script src="/_next/static/chunks/0ptag81psa0nj.js" async=""></script><script src="/_next/static/chunks/turbopack-2x4_cva4cco3h.js" async=""></script><script src="/_next/static/chunks/2x7nfpuaaba_a.js" async=""></script><script src="/_next/static/chunks/3c49t4evjq8hf.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1y49eldffr2-_.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[20699,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\"]\n3:I[92242,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\"]\n4:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"ViewportBoundary\"]\na:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"MetadataBoundary\"]\nc:I[17506,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"S-yw9-SVffiEHRGm85NzP\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>
1
+ <!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1y49eldffr2-_.js"/><script src="/_next/static/chunks/2w65a9zig6ya7.js" async=""></script><script src="/_next/static/chunks/3x8k7so-uoat8.js" async=""></script><script src="/_next/static/chunks/0ptag81psa0nj.js" async=""></script><script src="/_next/static/chunks/turbopack-2x4_cva4cco3h.js" async=""></script><script src="/_next/static/chunks/2x7nfpuaaba_a.js" async=""></script><script src="/_next/static/chunks/3c49t4evjq8hf.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1y49eldffr2-_.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[20699,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\"]\n3:I[92242,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\"]\n4:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"ViewportBoundary\"]\na:I[43645,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"MetadataBoundary\"]\nc:I[17506,[\"/_next/static/chunks/2x7nfpuaaba_a.js\",\"/_next/static/chunks/3c49t4evjq8hf.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"Wddru2A-5szSWhZWYoMwi\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[]\n"])</script></body></html>