@shadowob/cloud 1.1.6-dev.311

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 (334) hide show
  1. package/README.md +509 -0
  2. package/dist/agent-browser-CERTMCDL.js +117 -0
  3. package/dist/agent-browser-CIRZRIY4.js +118 -0
  4. package/dist/agent-pack-LF3O5TR4.js +1236 -0
  5. package/dist/agent-pack-RQT27V7R.js +1235 -0
  6. package/dist/airtable-BG2Q75G2.js +82 -0
  7. package/dist/airtable-JCQXFM5D.js +83 -0
  8. package/dist/alipay-MZX2XCDB.js +52 -0
  9. package/dist/alipay-TZQI34RB.js +51 -0
  10. package/dist/amap-5RQB3VGC.js +45 -0
  11. package/dist/amap-KPCLZYYL.js +44 -0
  12. package/dist/atlassian-LGOEWYC7.js +54 -0
  13. package/dist/atlassian-TVS2A4IU.js +55 -0
  14. package/dist/baidu-appbuilder-6UMESXHW.js +41 -0
  15. package/dist/baidu-appbuilder-QRRL3ETM.js +42 -0
  16. package/dist/baidu-maps-HEPMVP5D.js +44 -0
  17. package/dist/baidu-maps-HXC4FBVP.js +45 -0
  18. package/dist/baidu-netdisk-G5Q6B5NH.js +45 -0
  19. package/dist/baidu-netdisk-RS2K5W2M.js +44 -0
  20. package/dist/baidu-smartprogram-EWTK5WKK.js +41 -0
  21. package/dist/baidu-smartprogram-JHD3XWF6.js +40 -0
  22. package/dist/browserbase-IUIYVYI7.js +67 -0
  23. package/dist/browserbase-JFO2PCIA.js +68 -0
  24. package/dist/canva-3YOFL7JS.js +62 -0
  25. package/dist/canva-FMYN65SM.js +61 -0
  26. package/dist/chunk-6P2K6QZR.js +529 -0
  27. package/dist/chunk-7VMRQ7MG.js +90 -0
  28. package/dist/chunk-AD3JTIU3.js +17 -0
  29. package/dist/chunk-BF6CV2Y4.js +64 -0
  30. package/dist/chunk-CTNUKOQE.js +439 -0
  31. package/dist/chunk-EEFMJYKB.js +97 -0
  32. package/dist/chunk-EJKFQ35I.js +739 -0
  33. package/dist/chunk-HUICDC56.js +62 -0
  34. package/dist/chunk-JUPAE5IA.js +527 -0
  35. package/dist/chunk-JY2HTT7Q.js +437 -0
  36. package/dist/chunk-KEPTCLUO.js +121 -0
  37. package/dist/chunk-KKK5H7YX.js +3622 -0
  38. package/dist/chunk-POSVEKIY.js +210 -0
  39. package/dist/chunk-QET4LT4J.js +5769 -0
  40. package/dist/chunk-QV4XWO3P.js +30 -0
  41. package/dist/chunk-R52J3PH2.js +120 -0
  42. package/dist/chunk-R5U7XKVJ.js +16 -0
  43. package/dist/chunk-RECNVWMT.js +212 -0
  44. package/dist/chunk-RTPBU5HF.js +92 -0
  45. package/dist/chunk-SUZ2ATT6.js +5774 -0
  46. package/dist/chunk-SVMXSIMG.js +98 -0
  47. package/dist/chunk-TV3CBM7R.js +28 -0
  48. package/dist/chunk-V2LU736V.js +3495 -0
  49. package/dist/chunk-ZUYL3W53.js +741 -0
  50. package/dist/claude-plugin-577TAQVS.js +1463 -0
  51. package/dist/claude-plugin-L3MXJJ6J.js +1464 -0
  52. package/dist/cli.js +7021 -0
  53. package/dist/cloudflare-HBBABPK6.js +114 -0
  54. package/dist/cloudflare-RDFPKMM5.js +115 -0
  55. package/dist/cnb-FLP3QX46.js +44 -0
  56. package/dist/cnb-YAVVEYFB.js +45 -0
  57. package/dist/console/index.html +12 -0
  58. package/dist/console/logo.png +0 -0
  59. package/dist/console/static/css/5079.f9e0918d.css +1 -0
  60. package/dist/console/static/css/index.7f91f806.css +1 -0
  61. package/dist/console/static/font/codicon.5b7d6fac.ttf +0 -0
  62. package/dist/console/static/js/5079.72a51ca2.js +699 -0
  63. package/dist/console/static/js/5079.72a51ca2.js.LICENSE.txt +35 -0
  64. package/dist/console/static/js/7426.f8d483ea.js +1 -0
  65. package/dist/console/static/js/async/1008.4df521b7.js +1 -0
  66. package/dist/console/static/js/async/102.1d473ec7.js +1 -0
  67. package/dist/console/static/js/async/1134.3f9fd9e7.js +1 -0
  68. package/dist/console/static/js/async/1318.4b8e48e7.js +1 -0
  69. package/dist/console/static/js/async/1360.5606da88.js +7 -0
  70. package/dist/console/static/js/async/1546.045f484f.js +1 -0
  71. package/dist/console/static/js/async/1562.187de2a8.js +1 -0
  72. package/dist/console/static/js/async/168.456d4813.js +1 -0
  73. package/dist/console/static/js/async/1750.e6dc2664.js +1 -0
  74. package/dist/console/static/js/async/1994.3fc86066.js +1 -0
  75. package/dist/console/static/js/async/2348.613ae3d9.js +1 -0
  76. package/dist/console/static/js/async/2390.1b890b9d.js +1 -0
  77. package/dist/console/static/js/async/2414.9d040212.js +1 -0
  78. package/dist/console/static/js/async/2454.4c1784ab.js +1 -0
  79. package/dist/console/static/js/async/2498.f5f92030.js +1 -0
  80. package/dist/console/static/js/async/2924.b823cd1a.js +1 -0
  81. package/dist/console/static/js/async/3062.63fddea6.js +1 -0
  82. package/dist/console/static/js/async/3078.dd712008.js +1 -0
  83. package/dist/console/static/js/async/3198.1f307065.js +1 -0
  84. package/dist/console/static/js/async/3246.3d5a899f.js +1 -0
  85. package/dist/console/static/js/async/3286.871676eb.js +1 -0
  86. package/dist/console/static/js/async/342.10bf3b90.js +1 -0
  87. package/dist/console/static/js/async/3446.9681a4d7.js +1 -0
  88. package/dist/console/static/js/async/3698.ccfaabec.js +1 -0
  89. package/dist/console/static/js/async/3790.2a1106a6.js +1 -0
  90. package/dist/console/static/js/async/4231.b29784d4.js +1 -0
  91. package/dist/console/static/js/async/4551.515bd41d.js +1 -0
  92. package/dist/console/static/js/async/4596.40f6e71b.js +1 -0
  93. package/dist/console/static/js/async/4600.4aaebe6d.js +1 -0
  94. package/dist/console/static/js/async/4718.1aae022f.js +1 -0
  95. package/dist/console/static/js/async/4846.a347c020.js +1 -0
  96. package/dist/console/static/js/async/4860.83dadf89.js +1 -0
  97. package/dist/console/static/js/async/500.fcfa37cb.js +1 -0
  98. package/dist/console/static/js/async/5096.b360203d.js +1 -0
  99. package/dist/console/static/js/async/5222.043274fe.js +1 -0
  100. package/dist/console/static/js/async/5362.f498001c.js +1 -0
  101. package/dist/console/static/js/async/54.c94f0755.js +1 -0
  102. package/dist/console/static/js/async/5478.50dd9ef0.js +2 -0
  103. package/dist/console/static/js/async/5478.50dd9ef0.js.LICENSE.txt +3 -0
  104. package/dist/console/static/js/async/5507.a6a1f793.js +1 -0
  105. package/dist/console/static/js/async/5638.bc6b102d.js +1 -0
  106. package/dist/console/static/js/async/5722.e0029049.js +1 -0
  107. package/dist/console/static/js/async/5942.74635c6b.js +1 -0
  108. package/dist/console/static/js/async/5994.1c5629c1.js +1 -0
  109. package/dist/console/static/js/async/6054.6bddf720.js +1 -0
  110. package/dist/console/static/js/async/6118.45e754e5.js +1 -0
  111. package/dist/console/static/js/async/6127.adcbcbb6.js +1 -0
  112. package/dist/console/static/js/async/614.3f434c20.js +1 -0
  113. package/dist/console/static/js/async/6234.ba3b002d.js +1 -0
  114. package/dist/console/static/js/async/6310.6546a9ba.js +1 -0
  115. package/dist/console/static/js/async/6378.9f805419.js +1 -0
  116. package/dist/console/static/js/async/6380.e4433c49.js +1 -0
  117. package/dist/console/static/js/async/6418.f23bcfda.js +1 -0
  118. package/dist/console/static/js/async/6428.77c86114.js +1 -0
  119. package/dist/console/static/js/async/6443.83318a6c.js +1 -0
  120. package/dist/console/static/js/async/6508.2b445d62.js +3 -0
  121. package/dist/console/static/js/async/6542.e82a26c8.js +1 -0
  122. package/dist/console/static/js/async/6544.62111ecb.js +1 -0
  123. package/dist/console/static/js/async/6612.a0c9fcf4.js +1 -0
  124. package/dist/console/static/js/async/6740.695aebf0.js +1 -0
  125. package/dist/console/static/js/async/6822.dbbb32bc.js +1 -0
  126. package/dist/console/static/js/async/6824.ad3540ab.js +1 -0
  127. package/dist/console/static/js/async/6930.585dab94.js +1 -0
  128. package/dist/console/static/js/async/6982.c81b95e6.js +1 -0
  129. package/dist/console/static/js/async/7046.ab2378c1.js +1 -0
  130. package/dist/console/static/js/async/7110.a603277f.js +1 -0
  131. package/dist/console/static/js/async/7142.4a21366f.js +1 -0
  132. package/dist/console/static/js/async/7348.15cc6148.js +1373 -0
  133. package/dist/console/static/js/async/7348.15cc6148.js.LICENSE.txt +14 -0
  134. package/dist/console/static/js/async/7374.b1ac5c44.js +1 -0
  135. package/dist/console/static/js/async/742.847f17ca.js +1 -0
  136. package/dist/console/static/js/async/7446.743954d8.js +1 -0
  137. package/dist/console/static/js/async/7673.59bbbaac.js +1 -0
  138. package/dist/console/static/js/async/7684.c5760c8c.js +1 -0
  139. package/dist/console/static/js/async/7714.c30d0f94.js +1 -0
  140. package/dist/console/static/js/async/8118.36d5a3bf.js +298 -0
  141. package/dist/console/static/js/async/8145.4bcf043a.js +1 -0
  142. package/dist/console/static/js/async/8246.408de938.js +1 -0
  143. package/dist/console/static/js/async/8390.bdae1f7d.js +1 -0
  144. package/dist/console/static/js/async/8422.fd94dbe1.js +1 -0
  145. package/dist/console/static/js/async/8434.94a0e2ae.js +1 -0
  146. package/dist/console/static/js/async/8518.3158de13.js +1 -0
  147. package/dist/console/static/js/async/8564.fc2eb841.js +1 -0
  148. package/dist/console/static/js/async/8678.73af4c9b.js +1 -0
  149. package/dist/console/static/js/async/8694.79747168.js +1 -0
  150. package/dist/console/static/js/async/8756.1de37b83.js +1 -0
  151. package/dist/console/static/js/async/8804.7fe6bdf9.js +3 -0
  152. package/dist/console/static/js/async/8883.e717ee94.js +1 -0
  153. package/dist/console/static/js/async/8886.fe6e876c.js +1 -0
  154. package/dist/console/static/js/async/9030.fc1ae402.js +1 -0
  155. package/dist/console/static/js/async/9094.5598d084.js +1 -0
  156. package/dist/console/static/js/async/9218.ee7b84b7.js +1 -0
  157. package/dist/console/static/js/async/94.9b80bc35.js +1 -0
  158. package/dist/console/static/js/async/9526.92aba34c.js +1 -0
  159. package/dist/console/static/js/async/9762.f83bc4f3.js +1 -0
  160. package/dist/console/static/js/async/984.e11c113a.js +1 -0
  161. package/dist/console/static/js/async/9846.246653cd.js +1 -0
  162. package/dist/console/static/js/index.4487e1ff.js +1 -0
  163. package/dist/console/static/js/lib-react.15d7ca9a.js +2 -0
  164. package/dist/console/static/js/lib-react.15d7ca9a.js.LICENSE.txt +49 -0
  165. package/dist/coze-C6PMDPBI.js +49 -0
  166. package/dist/coze-E6VGRNLV.js +48 -0
  167. package/dist/dashboard.command-J7XOZNXU.js +8 -0
  168. package/dist/dashboard.command-RV2NHDKW.js +7 -0
  169. package/dist/dingtalk-JNRNRN7E.js +77 -0
  170. package/dist/dingtalk-WZGGIAHJ.js +76 -0
  171. package/dist/douyin-miniprogram-AIJPPIZH.js +41 -0
  172. package/dist/douyin-miniprogram-HCYZ5NBW.js +42 -0
  173. package/dist/figma-2YYNSCDX.js +103 -0
  174. package/dist/figma-RYOBMENP.js +102 -0
  175. package/dist/firebase-2IJDDBXX.js +112 -0
  176. package/dist/firebase-OYSY6HPT.js +111 -0
  177. package/dist/firecrawl-2T3SBUW7.js +66 -0
  178. package/dist/firecrawl-IYYXLAZM.js +65 -0
  179. package/dist/flyai-7FJ4TRAG.js +81 -0
  180. package/dist/flyai-QS5Q6FJR.js +82 -0
  181. package/dist/gitagent-MWI75OIX.js +725 -0
  182. package/dist/gitagent-YBMWY7NZ.js +726 -0
  183. package/dist/gitee-3N7OFOM7.js +53 -0
  184. package/dist/gitee-KVNK6KLZ.js +54 -0
  185. package/dist/github-LUEC2LID.js +143 -0
  186. package/dist/github-XRO5Z3GC.js +142 -0
  187. package/dist/google-ads-A3QAJI4D.js +88 -0
  188. package/dist/google-ads-VPKWTX67.js +89 -0
  189. package/dist/google-analytics-C4UR5ZR2.js +50 -0
  190. package/dist/google-analytics-XDYZA2B7.js +49 -0
  191. package/dist/google-workspace-LL3EWVHH.js +320 -0
  192. package/dist/google-workspace-YX35SHHX.js +321 -0
  193. package/dist/huawei-xiaoyi-6BSMGJHR.js +40 -0
  194. package/dist/huawei-xiaoyi-KPWLTSHB.js +41 -0
  195. package/dist/hubspot-DIUHGEDI.js +45 -0
  196. package/dist/hubspot-FTIEMNZO.js +44 -0
  197. package/dist/huggingface-MJCOXA7E.js +116 -0
  198. package/dist/huggingface-UUXK2RHK.js +117 -0
  199. package/dist/index.d.ts +3013 -0
  200. package/dist/index.js +15649 -0
  201. package/dist/inference-ai-image-generation-CMI6R5T3.js +106 -0
  202. package/dist/inference-ai-image-generation-PXV6IG4U.js +107 -0
  203. package/dist/inference-sh-7AZOLEFI.js +94 -0
  204. package/dist/inference-sh-ABQOD3YF.js +95 -0
  205. package/dist/init.command-6E24K4H3.js +9 -0
  206. package/dist/init.command-O4HG4HKR.js +10 -0
  207. package/dist/klaviyo-6K5YEFNH.js +45 -0
  208. package/dist/klaviyo-LDPBWBSS.js +44 -0
  209. package/dist/kuaidi100-HGFM5VK2.js +42 -0
  210. package/dist/kuaidi100-UHPFCVXP.js +41 -0
  211. package/dist/lark-6LNA3LUQ.js +103 -0
  212. package/dist/lark-URVBZNS4.js +102 -0
  213. package/dist/linear-7QFSFPOD.js +57 -0
  214. package/dist/linear-T4ORUP7N.js +56 -0
  215. package/dist/lovart-PDUXRUHJ.js +99 -0
  216. package/dist/lovart-QO3SK55T.js +100 -0
  217. package/dist/meta-ads-SCNFI45S.js +42 -0
  218. package/dist/meta-ads-V6XPZWX3.js +41 -0
  219. package/dist/miclaw-5CNTW7VV.js +36 -0
  220. package/dist/miclaw-TPPPS2WN.js +35 -0
  221. package/dist/model-provider-AVSFJSZP.js +393 -0
  222. package/dist/model-provider-KFB76XV5.js +392 -0
  223. package/dist/notion-FZK76MN2.js +69 -0
  224. package/dist/notion-WFA7KGZZ.js +70 -0
  225. package/dist/oceanengine-3JZUS3PP.js +43 -0
  226. package/dist/oceanengine-5BRIJVJE.js +42 -0
  227. package/dist/opencli-PFXHGCS2.js +81 -0
  228. package/dist/opencli-VIGRJTGH.js +80 -0
  229. package/dist/paypal-33UADIPR.js +54 -0
  230. package/dist/paypal-Z5JYHIWD.js +55 -0
  231. package/dist/playwright-MG5WHK47.js +58 -0
  232. package/dist/playwright-SQAQ3DZG.js +59 -0
  233. package/dist/plugins-HZBWK3WQ.js +120 -0
  234. package/dist/plugins-I4GD5SZX.js +121 -0
  235. package/dist/posthog-MU5MAJOQ.js +79 -0
  236. package/dist/posthog-RJRRKDWB.js +80 -0
  237. package/dist/salesforce-34FVIJTG.js +82 -0
  238. package/dist/salesforce-3QZ6OFVO.js +83 -0
  239. package/dist/sentry-MCIRMACU.js +111 -0
  240. package/dist/sentry-PIWW46VA.js +110 -0
  241. package/dist/seo-suite-4SQ3I67Q.js +54 -0
  242. package/dist/seo-suite-WJXMA3S4.js +55 -0
  243. package/dist/serve.command-5FMIPQRY.js +10 -0
  244. package/dist/serve.command-DNE6GPMK.js +9 -0
  245. package/dist/shadowob-JELOWHWX.js +1068 -0
  246. package/dist/shadowob-PRSMI5MW.js +1069 -0
  247. package/dist/sherlock-2PKY2E2Y.js +66 -0
  248. package/dist/sherlock-C5ZWPPVT.js +67 -0
  249. package/dist/shopify-GL3NFVGE.js +94 -0
  250. package/dist/shopify-R4G3UXM6.js +93 -0
  251. package/dist/skill-discovery-7INAUP4D.js +77 -0
  252. package/dist/skill-discovery-YPXXV622.js +78 -0
  253. package/dist/state-7MCZBTR5.js +17 -0
  254. package/dist/state-FGOFLFBE.js +18 -0
  255. package/dist/stripe-C22RR4ZS.js +83 -0
  256. package/dist/stripe-LJNPQ3CQ.js +82 -0
  257. package/dist/supabase-IRNQ54FJ.js +98 -0
  258. package/dist/supabase-N4ONFJNQ.js +97 -0
  259. package/dist/taobao-aipaas-LRR4GMO3.js +45 -0
  260. package/dist/taobao-aipaas-RVKORSF4.js +46 -0
  261. package/dist/tapd-3JPVJ7XH.js +46 -0
  262. package/dist/tapd-TMQRSMFG.js +47 -0
  263. package/dist/tencent-ads-IGD33LO7.js +42 -0
  264. package/dist/tencent-ads-UHC6OPBV.js +43 -0
  265. package/dist/tencent-docs-C3A4J3CJ.js +47 -0
  266. package/dist/tencent-docs-O2SC4FHL.js +48 -0
  267. package/dist/tencent-maps-HMMWMNF4.js +37 -0
  268. package/dist/tencent-maps-OQOKHVW2.js +36 -0
  269. package/dist/vercel-KOXDDTHX.js +73 -0
  270. package/dist/vercel-OLNVDWMG.js +74 -0
  271. package/dist/webflow-FULU5Q2I.js +114 -0
  272. package/dist/webflow-OMJKZM54.js +115 -0
  273. package/dist/wechat-miniprogram-skyline-KYCDMQNW.js +74 -0
  274. package/dist/wechat-miniprogram-skyline-VR4FVIQL.js +75 -0
  275. package/dist/wechat-pay-BCMAJ6UW.js +50 -0
  276. package/dist/wechat-pay-YQQKXVUI.js +51 -0
  277. package/dist/wonda-NGWIORYN.js +81 -0
  278. package/dist/wonda-RBABXFNM.js +82 -0
  279. package/dist/wordpress-woocommerce-RDIUTHYT.js +57 -0
  280. package/dist/wordpress-woocommerce-RNA5HB3N.js +58 -0
  281. package/dist/wps-DAEFQHDE.js +47 -0
  282. package/dist/wps-LUWHMZQQ.js +48 -0
  283. package/dist/yuque-HCHTJWNI.js +72 -0
  284. package/dist/yuque-KRH5O74J.js +71 -0
  285. package/images/RUNNERS.md +270 -0
  286. package/images/cc-connect-runner/entrypoint.mjs +311 -0
  287. package/images/claude-runner/Dockerfile +88 -0
  288. package/images/claude-runner/RUNNER.md +222 -0
  289. package/images/claude-runner/entrypoint.mjs +2 -0
  290. package/images/codex-runner/Dockerfile +87 -0
  291. package/images/codex-runner/RUNNER.md +226 -0
  292. package/images/codex-runner/entrypoint.mjs +2 -0
  293. package/images/gemini-runner/Dockerfile +87 -0
  294. package/images/gemini-runner/RUNNER.md +218 -0
  295. package/images/gemini-runner/entrypoint.mjs +2 -0
  296. package/images/hermes-runner/Dockerfile +74 -0
  297. package/images/hermes-runner/RUNNER.md +243 -0
  298. package/images/hermes-runner/entrypoint.mjs +283 -0
  299. package/images/openclaw-runner/Dockerfile +212 -0
  300. package/images/openclaw-runner/RUNNER.md +170 -0
  301. package/images/openclaw-runner/entrypoint.mjs +1113 -0
  302. package/images/openclaw-runner/warm-runtime-deps.mjs +95 -0
  303. package/images/opencode-runner/Dockerfile +87 -0
  304. package/images/opencode-runner/RUNNER.md +202 -0
  305. package/images/opencode-runner/entrypoint.mjs +2 -0
  306. package/package.json +121 -0
  307. package/templates/agent-marketplace-buddy.template.json +131 -0
  308. package/templates/ai-werewolf.template.json +92 -0
  309. package/templates/bmad-method-buddy.template.json +123 -0
  310. package/templates/brain-fix.template.json +92 -0
  311. package/templates/claude-ads-buddy.template.json +123 -0
  312. package/templates/claude-financial-services-buddy.template.json +111 -0
  313. package/templates/claude-seo-buddy.template.json +123 -0
  314. package/templates/code-arena.template.json +92 -0
  315. package/templates/daily-brief.template.json +92 -0
  316. package/templates/e-wife.template.json +92 -0
  317. package/templates/everything-claude-code-buddy.template.json +125 -0
  318. package/templates/financial-freedom.template.json +92 -0
  319. package/templates/gitstory.template.json +92 -0
  320. package/templates/google-workspace-buddy.template.json +88 -0
  321. package/templates/gsd-buddy.template.json +119 -0
  322. package/templates/gstack-buddy.template.json +143 -0
  323. package/templates/gstack.template.json +92 -0
  324. package/templates/little-match-girl.template.json +114 -0
  325. package/templates/lovart-buddy.template.json +110 -0
  326. package/templates/marketingskills-buddy.template.json +102 -0
  327. package/templates/retire-buddy.template.json +92 -0
  328. package/templates/scientific-skills-buddy.template.json +119 -0
  329. package/templates/seomachine-buddy.template.json +113 -0
  330. package/templates/shadow-server-app-demo.template.json +105 -0
  331. package/templates/slavingia-skills-buddy.template.json +102 -0
  332. package/templates/superclaude-buddy.template.json +146 -0
  333. package/templates/superpowers-buddy.template.json +108 -0
  334. package/templates/world-pulse.template.json +92 -0
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e,t,s,a,r,n,i,l={65639(e,t,s){var a=s(41627),r=s(19658),n=s(82650),i=s(30064),l=s(11979),o=s(40725),d=s(59708),c=s(93566),m=s(18068),p=JSON.parse('{"nav":{"deploy":"Deploy","consoleHome":"Console Home","agentStore":"Shadow Store","myTemplates":"My Templates","manage":"Manage","clusters":"Clusters","deployments":"Deployments","deployTasks":"Deploy Tasks","providers":"Providers","secrets":"Secrets","monitoring":"Dashboard","system":"System","activity":"Activity","settings":"Settings","shadowCloud":"Shadow Cloud","console":"Console","community":"Community","shrimp":"Shadow Store","wallet":"Wallet & Billing"},"common":{"save":"Save","saved":"Saved","cancel":"Cancel","confirm":"Confirm","delete":"Delete","loading":"Loading...","viewAll":"View all","deploy":"Deploy","deployNew":"Deploy New","back":"Back","next":"Next","continue":"Continue","clearAll":"Clear All","edit":"Edit","add":"Add","saving":"Saving...","share":"Share","fork":"Fork","refresh":"Refresh","close":"Close","actions":"Actions","none":"—","search":"Search","favorite":"Favorite","noData":"No data found","copied":"Copied!","copy":"Copy","clear":"Clear","download":"Download","retry":"Retry","expand":"Expand","collapse":"Collapse","details":"Details","or":"or","show":"Show","hide":"Hide","enabled":"Enabled","disabled":"Disabled","on":"On","off":"Off","error":"Error","success":"Success","warning":"Warning","info":"Info","darkMode":"Dark mode","lightMode":"Light mode","language":"Language","breadcrumb":"Breadcrumb","prev":"Previous"},"configEditor":{"title":"Config Editor","unsaved":"unsaved","editing":"Editing:","selectTemplateOrScratch":"Select a template to load, or start from scratch","storeTemplates":"Store Templates","myTemplates":"My Templates","saveToMyTemplates":"Save to My Templates","saveAsTemplate":"Save as Template","saved":"Config saved","saveFailed":"Failed to save config","loadingConfig":"Loading config...","noConfigLoaded":"No config file loaded. Use the template selector above to load a store template or one of your saved templates.","loadedTemplate":"Loaded template: {{name}}","loadTemplateFailed":"Failed to load template","savedAsTemplate":"Saved to My Templates as \\"{{name}}\\"","validationSummaryInvalid":"Invalid: {{violations}} violation(s), {{extendsErrors}} extends error(s)","chars":"chars"},"overview":{"title":"Console Home","subtitle":"Shadow Cloud Console","description":"AI Agent cluster management platform — deploy, monitor, and manage agent teams.","deployments":"Deployments","ready":"Ready","namespaces":"Namespaces","templates":"Templates","quickActions":"Quick Actions","browseAndDeploy":"Browse & deploy templates","managedDeployments":"Manage deployments","editAgentConfig":"Edit agent config","healthEvents":"Health & events","recentDeployments":"Recent Deployments","deployFirstAgent":"Deploy your first agent team.","noDeploymentsYet":"No deployments yet.","recentActivity":"Recent Activity","noRecentActivity":"No recent activity.","systemHealth":"System Health","checkingHealth":"Checking health...","healthUnavailable":"Health check unavailable","pass":"pass","warn":"warn","fail":"fail","reRunChecks":"Re-run checks"},"doctor":{"title":"System Health","subtitle":"Prerequisites and dependency checks","recheck":"Re-check","runningTitle":"Running checks...","runningDescription":"Checking prerequisites and dependencies","failedTitle":"Failed to run health checks","failedDescription":"Please try again.","allChecksPassed":"All checks passed — system is ready"},"images":{"title":"Images","subtitle":"Available container images for agents","loading":"Loading images...","loadFailed":"Failed to load images","emptyTitle":"No images found","emptyDescription":"Images are defined in your templates and configuration","totalImages":"Total images","withDockerfile":"With Dockerfile","withoutDockerfile":"No Dockerfile"},"runtimes":{"title":"Runtimes","subtitle":"Available agent runtimes and their default images","loading":"Loading runtimes...","loadFailed":"Failed to load runtimes","emptyTitle":"No runtimes found","emptyDescription":"Check runtime registration in your configuration.","availableRuntimes":"Available runtimes","id":"ID","image":"Image"},"store":{"title":"Agents Store","heroTitle":"Deploy AI Agent Teams in One Click","description":"","searchPlaceholder":"Search templates by name, category, or feature...","typewriterPhrases":["Find a code review team template...","Deploy a DevOps agent pipeline...","Search for security scanner templates...","Browse customer support agents...","Explore research automation teams..."],"totalTemplates":"templates","totalAgents":"total agents","totalCategories":"categories","featuredTemplates":"Featured Templates","topCharts":"Top Charts","recommended":"Recommended","recommendedDescription":"High-signal templates to help you launch faster.","browseByCategory":"Browse the catalog by category.","backToDiscover":"Back to Discover","sortPopular":"Most Popular","sortNameAZ":"Name (A-Z)","sortMostAgents":"Most Agents","sortFewestAgents":"Fewest Agents","matching":"matching","noTemplatesFound":"No templates found","noTemplatesInCategory":"No templates available in this category.","clearFilters":"Clear Filters","allTemplatesOpenSource":"All templates are open-source and maintained by the Shadow Cloud team.","customTemplatesNote":"Custom templates can be added via","featured":"Featured","popularity":"Popularity","agentCount":"{{count}} agents","popularPercent":"{{count}}% popular","viewTemplate":"View","matchingTemplates":"{{count}} templates","matchingQuery":"matching \\"{{query}}\\"","noTemplatesMatch":"No templates match \\"{{query}}\\".","deployTemplate":"Deploy Template","forkTemplate":"Fork to My Templates","backToStore":"Back to Store","categories":{"all":"All","devops":"DevOps","security":"Security","support":"Support","research":"Research","monitoring":"Monitoring","business":"Business","demo":"Demo"},"difficulties":{"beginner":"Beginner","intermediate":"Intermediate","advanced":"Advanced"},"communitySource":"Community","localSource":"Local","communityUnavailable":"Community server unavailable. Showing local templates."},"storeDetail":{"overview":"Overview","agents":"Agents","configuration":"Configuration","templateNotFound":"Template not found","templateNotFoundDesc":"The template does not exist or is not available.","backToStore":"Back to Store","agentDetailsUnavailable":"Agent details unavailable","deployToSeeConfig":"Deploy this template to see the full agent configuration.","fullTemplateConfig":"Full template configuration. This will be used as the base config for deployment.","forked":"Forked to My Templates as","failedToFork":"Failed to fork template","identity":"Identity","personality":"Personality","systemPrompt":"System Prompt","integrations":"Integrations","resources":"Resources","tools":"Tools","credentials":"credentials","cpuRequest":"CPU Request","cpuLimit":"CPU Limit","memRequest":"Memory Request","memLimit":"Memory Limit","requiredEnvVars":"Required Environment Variables","noEnvVarsRequired":"No environment variables required.","templateSlug":"Template slug","popularity":"Popularity","file":"File","updated":"Updated","cliQuickDeploy":"CLI Quick Deploy","includesAgents":"This template includes {{count}} agents:","templateConfiguration":"Template Configuration"},"deploy":{"reviewTemplate":"Review Template","confirmDeployKubernetes":"Review the deployment you are about to start.","ownTemplateDescription":"Your custom template.","agentsLabel":"Agents","namespaceLabel":"Namespace","deployTimeLabel":"Deploy Time","whatYouWillGet":"What you\'ll get","prerequisites":"Prerequisites","configureDeploy":"Configure Deployment","setNamespaceEnv":"Confirm the deployment name and fill the required variables.","namespace":"Namespace","kubernetesNamespaceDesc":"Use this name to separate this deployment. The default usually works well.","default":"Default:","requiredEnvVars":"Required Environment Variables","templateRequiresVars":"This template requires {{count}} environment variable(s).","envVarsAllRequired":"All must be provided before deployment.","envFieldSlotsTitle":"Connections & Variables","envFieldSlotsDescription":"{{count}} total, {{required}} required.","templateFieldSource":"Template Config","templateFieldDescription":"A value this template needs.","pluginFieldDescription":"Connects this service. Saved secrets can be reused.","templateFieldGroupDescription":"Variables this template needs.","pluginFieldGroupDescription":"{{plugin}} connection credentials. Saved secrets are reused automatically.","templateSourceBadge":"Template","pluginSourceBadge":"Plugin","requiredBadge":"Required","optionalBadge":"Optional","sensitiveBadge":"Sensitive","savedBadge":"Saved","requiredCount":"{{count}} required","fieldGroupProgress":"{{filled}} / {{total}} ready","autoDetectedVarsTitle":"{{count}} variable(s) handled automatically","autoDetectedVarsDescription":"Existing configuration is reused, so these do not need to be filled here.","restoreSavedValue":"Restore saved value","usingSavedValue":"Using saved value from Secrets","override":"Override","useSaved":"Use saved","fillFromGroup":"Group fill","selectGroup":"Select group...","secretPersistenceTitle":"Secret reuse","secretPersistenceDescription":"New values can be saved to \\"{{group}}\\" and reused automatically next time.","rememberSecrets":"Remember new values","rememberSecretsDescription":"Save filled values to the \\"{{group}}\\" reusable group.","bindSecretsToNamespace":"Bind to this namespace","bindSecretsToNamespaceDescription":"Also save values as namespace overrides after deploy.","secretSaveFailed":"Deployment succeeded, but some secrets could not be saved.","additionalVariables":"Additional Variables","optionalKeyValue":"Optional key-value pairs beyond the required ones.","noAdditionalVars":"No additional variables.","addVariable":"Add Variable","reviewDeploy":"Review & Deploy","missingRequiredVars":"Missing required variables:","startDeployment":"Start Deployment","deploying":"Deploying...","deployingToCluster":"Deploying your agent team to the cluster...","deploymentComplete":"Deployment Complete","deploySuccessDesc":"Your agent team has been deployed successfully.","deploymentFailed":"Deployment Failed","deployFailDesc":"Deployment encountered an error. Check the logs below.","reviewConfig":"Review your configuration and start the deployment.","template":"Template","envVariables":"Env Variables","configured":"configured","whatHappensNext":"What happens next:","whatHappensNextDesc":"Shadow Cloud will initialize the template, generate Kubernetes manifests, and deploy them to your cluster. You can monitor the progress in real time below.","deploymentLog":"Deployment Log","download":"Download","showTimestamps":"Show timestamps","hideTimestamps":"Hide timestamps","logLinesReceived":"{{count}} log lines received","shadowConnectionTitle":"Shadow Platform Connection","shadowConnectionDescription":"Server URL and API token for provisioning Shadow resources (servers, channels, buddies).","enterValue":"Enter value","includes":"Includes","asConfigured":"As configured","deploymentSuccessful":"Deployment Successful!","initializingDeployment":"Initializing deployment...","agentRunningInNamespace":"Your agent team is now running in the {{namespace}} namespace.","openNamespace":"Open Namespace","openNamespaceDescription":"Inspect agents, logs, environment values, and cost details.","openShadowServer":"Open New Server","shadowServerReadyDescription":"The Shadow server is ready. Open the new server to start using it.","namespaceReadyDescription":"Deployment is complete. Open the {{namespace}} namespace to inspect runtime status.","stepTemplateLabel":"Template","stepTemplateDescription":"Review template","stepConfigureLabel":"Configure","stepConfigureDescription":"Confirm name & variables","stepDeployLabel":"Deploy","stepDeployDescription":"Deploy & monitor","providersTitle":"LLM Providers","providersDescription":"Configure at least one LLM provider so your agents can connect to model APIs.","modelProviderTitle":"Model provider","modelProviderDescription":"Choose how this template connects to models before deployment.","modelProviderOfficialTitle":"Official provider","modelProviderOfficialBadge":"Shrimp billing","modelProviderOfficialDescription":"Use the official OpenAI-compatible proxy, with usage billed from your Shrimp Coin wallet.","modelProviderOfficialPricingLoading":"Loading billing standard...","modelProviderOfficialPricingTokens":"Billing: input {{input}} tokens / Shrimp Coin, output {{output}} tokens / Shrimp Coin.","modelProviderOfficialPricingDeepSeek":"Billing: cached input {{cacheHit}} Shrimp Coins / 1M tokens, regular input {{cacheMiss}} Shrimp Coins / 1M tokens, output {{output}} Shrimp Coins / 1M tokens. Exchange: 1 CNY = {{shrimpPerCny}} Shrimp Coins.","modelProviderRateInput":"Input","modelProviderRateOutput":"Output","modelProviderRateCacheHit":"Cached input","modelProviderRateCacheMiss":"Regular input","modelProviderRateTokensValue":"{{tokenCount}} tokens / coin","modelProviderRatePerMillionValue":"{{amount}} coins / 1M tokens","modelProviderExchangeRate":"Exchange rate: 1 CNY = {{shrimpPerCny}} Shrimp Coins. Small token usage is accumulated precisely before it becomes a whole-coin wallet charge.","modelProviderOfficialWalletHint":"The official provider is ready to use after deployment. It never exposes the upstream provider key to your server.","modelProviderCustomTitle":"My provider","modelProviderCustomBadge":"Self paid","modelProviderCustomDescription":"Use your own encrypted provider profile and bill usage directly through that provider.","modelProviderCustomSelfPaidNote":"Usage is billed through your own provider account.","modelProviderCustomSecureNote":"Provider keys are stored securely and are not shown in this deployment form.","modelProviderOfficialSummary":"Official provider \xb7 Shrimp billing","modelProviderCustomSummary":"My provider \xb7 self paid","modelProviderSummaryLabel":"Model Provider","viewWalletAndBilling":"Wallet & billing","customProviderRequired":"Please configure an enabled model provider before using your own provider.","providerProfilesReady":"Provider profiles ready","providerProfilesReadyDesc":"A usable model configuration is available.","providerProfilesMissing":"No provider profiles configured","providerProfilesMissingDesc":"Add a model configuration now, or continue filling in variables.","manageProviderProfiles":"Manage provider profiles","openProviderSettings":"Open model provider settings","openConfigHelp":"Open configuration help","providersConfiguredInSettings":"{{count}} providers configured in Settings","providersUseExistingDescription":"Your existing provider settings will be used automatically.","useExisting":"Use existing","addProvider":"Add provider","deployFailedWithCode":"Deploy failed (exit code {{code}})","successfullyDeployed":"Successfully deployed {{name}}!","unknownError":"Unknown error","deployFailedWithMessage":"Deploy failed: {{message}}","cancelDeployment":"Cancel Deployment","cancelling":"Cancelling...","cancelRequested":"Cancellation requested. Waiting for the deployment to stop.","deploymentCancelled":"Deployment cancelled.","estimatedCost":"Estimated Cost","shrimpCoinsPerMonth":"Shrimp Coins / month","shrimpCoinsPerHour":"Shrimp Coins / hour","walletBalance":"Your Balance","shrimpCoins":"Shrimp Coins","insufficientBalance":"Insufficient balance.","insufficientBalanceDesc":"You don\'t have enough Shrimp Coins to deploy this app. Top up to continue.","topUp":"Top Up","preparingDeployment":"Preparing…","rechargeUnavailable":"Recharge is only available inside the Shadow app."},"clusters":{"title":"Cluster Management","description":"Manage agent deployments across all Kubernetes namespaces.","totalDeployments":"Total Deployments","notReady":"Not Ready","noClustersFound":"No clusters found","noNamespacesMatch":"No namespaces or deployments match","noDeploymentsYet":"No agent deployments yet. Deploy your first agent team from the store.","browseAgentStore":"Browse Agents Store","destroyNamespace":"Destroy Namespace","destroyWarning":"This will destroy all deployments in namespace \\"{{namespace}}\\". This action cannot be undone.","destroy":"Destroy","destroying":"Destroying...","destroyed":"Destroyed namespace","pods":"pods","namespace":"Namespace","status":"Status","scale":"Scale","viewLogs":"View Logs","restart":"Restart","ready":"Ready","discovered":"Discovered"},"deployments":{"title":"Deployments","description":"","infrastructure":"Infrastructure","taskHistory":"Task History","namespaces":"Namespaces","namespaceDescription":"Namespace-level operations for all agents, logs, environment values, and costs.","namespaceLabel":"Namespace","agents":"Agents","readyAgents":"Ready Agents","pausedAgents":"Paused Agents","pausedDeployments":"Paused","selectedPods":"Selected Pods","selectedPodsCount":"{{count}} pods","namespaceCost":"Namespace Cost","tokenCost":"Token Cost","totalCost":"Total Cost","totalTokens":"Total Tokens","tokens":"tokens","agentSelector":"Agent Selector","agentSelectorDescription":"Pick an agent to inspect pods and logs without leaving this namespace.","currentSelection":"Selected","currentAgent":"Current Agent","noAgentSelected":"Choose an agent to inspect this namespace.","noPodsForAgent":"No pods found for {{agent}}.","pausedNoPodsTitle":"Agent is paused","pausedNoPodsDescription":"The sandbox Pod is stopped, but its persistent state volume is retained.","selectAgentForLogs":"Select an agent to load historical and live logs.","recentLogs":"Recent Logs","logsHistoryDescription":"Browse recent log history for {{agent}} with pagination.","linesPerPage":"{{count}} lines / page","pageLabel":"Page {{page}}","newerLogs":"Newer","olderLogs":"Older","noLogsYet":"No logs available yet.","pausedLogsTitle":"Live logs are paused","pausedLogsDescription":"The sandbox Pod is stopped. Historical logs remain available; resume the agent to reconnect live streaming.","liveLogs":"Live Logs","liveLogsDescription":"Connect to the selected agent to stream new log lines in real time.","streaming":"Streaming","connectLogs":"Connect","connectLiveLogs":"Click Connect to stream logs.","waitingForLogs":"Waiting for log output...","scopedEnvTitle":"Namespace Environment Values","scopedEnvDescription":"These values are stored for this namespace only and override any global defaults.","addScopedEnv":"Add Namespace Value","editScopedEnv":"Edit Namespace Value","noScopedEnv":"No namespace-scoped environment values yet.","fallbackEnvTitle":"Inherited Fallback Values","fallbackEnvDescription":"These values come from broader scopes and are applied when no namespace override exists.","noFallbackEnv":"No inherited fallback values found.","globalFallback":"Global fallback","namespaceScoped":"Scoped override","envGuideScopedTitle":"Deployment overrides","envGuideScopedDescription":"Use namespace values for one Buddy deployment. They are encrypted, override global values, and are read during the next deploy or redeploy.","envGuideGlobalTitle":"Global fallback","envGuideGlobalDescription":"Global values live in Secrets & Environment and are reused only when a template or plugin asks for the same key.","cookieJarTitle":"Browser session","cookieJarDescription":"Import Playwright storageState JSON or Netscape cookies.txt for browser automation agents. Cookie values stay encrypted as deployment environment data.","cookieJarImportTitle":"Import Browser CookieJar","cookieJarImportDescription":"Paste or upload a browser session export. Shadow normalizes it to Playwright storageState JSON before saving.","cookieJarEnvKey":"Environment key","cookieJarFile":"Upload file","cookieJarPaste":"Paste CookieJar","cookieJarPastePlaceholder":"Paste Playwright storageState JSON or Netscape cookies.txt content...","cookieJarFormats":"Supported formats: Playwright storageState JSON, JSON cookie array, or Netscape cookies.txt.","cookieJarParsed":"Detected {{format}} with {{cookies}} cookies and {{origins}} origins.","cookieJarInvalid":"CookieJar content is not valid Playwright storageState JSON or Netscape cookies.txt.","cookieJarImportAction":"Import CookieJar","cookieJarImported":"Imported {{cookies}} cookies into {{key}}","cookieJarImportFailed":"Failed to import CookieJar","templateManifestTitle":"Template & Manifest","templateManifestDescription":"Track the source template, deployed manifest revision, and whether the catalog template changed after this deployment.","templateSlug":"Template slug","manifestRevision":"Manifest revision","configHash":"Config hash","templateUpdatedAt":"Template updated","manifestDrift":{"up-to-date":"Up to date","template-updated":"Template updated","missing-template":"Template missing","unlinked":"Unlinked","unknown":"Unknown"},"redeploySnapshot":"Redeploy snapshot","redeployLatestTemplate":"Redeploy latest template","saveEditableTemplate":"Save editable template","saveTemplateAndRedeploy":"Save template & redeploy","templateUpdated":"Template updated","templateForked":"Forked template {{name}}","templateSyncFailed":"Failed to save template","templateSyncRedeployFailed":"Failed to save template and redeploy","deleteScopedEnvConfirm":"Delete namespace environment value \\"{{key}}\\"?","noTasksInNamespace":"This namespace has no deploy tasks yet.","costTab":"Cost","costUnavailable":"Cost data unavailable","costUnavailableDescription":"Usage data could not be collected from the running agents yet.","costNoRunningPod":"No running pod is available for usage collection.","costUsageUnavailableMessage":"OpenClaw has not returned token usage yet. Refresh after the agent handles a message.","costTelemetryMissing":"No usage snapshot has been reported yet. Refresh after this Buddy handles a new message.","liveLogsUnavailableTransport":"The Kubernetes log stream is temporarily unavailable. Retry later or use recent logs.","availableAgents":"Available Agents","unavailableAgents":"Unavailable Agents","generatedAt":"Generated at","noProvidersReported":"No provider usage reported yet.","totalRestarts":"Total Restarts","kubectlCommands":"Kubectl Commands","viewAgents":"View agents","viewPods":"View pods","noDeploymentsInNamespace":"No deployments found in this namespace","noDeploymentsInNamespaceDescription":"Namespace \\"{{namespace}}\\" does not currently have any active agents.","destroyQueued":"Created destroy task for namespace \\"{{namespace}}\\"","destroyNamespaceFailed":"Failed to destroy namespace","noTaskToRedeploy":"No deploy task found for this namespace","redeployFailed":"Redeploy failed","scaledAgent":"Scaled {{agent}} to {{count}} replicas","scaleFailed":"Failed to scale {{agent}}","plainText":"Plain text","runningTasksCount":"{{count}} running tasks","restarts":"Restarts","age":"Age","rollbackInitiated":"Rollback initiated","rollbackFailed":"Rollback failed","rollbackWarning":"This will roll back all deployments in namespace \\"{{namespace}}\\" to the previous state.","pauseAgent":"Pause","resumeAgent":"Resume","backupAgent":"Backup","pauseQueued":"Paused {{agent}}","resumeQueued":"Resuming {{agent}}","backupCreated":"Backup requested","restoreQueued":"Restore started","pauseFailed":"Failed to pause agent","resumeFailed":"Failed to resume agent","backupFailed":"Failed to create backup","restoreFailed":"Failed to restore backup","runtimeActionInProgress":"A runtime operation is already in progress.","pauseUnavailableResuming":"The sandbox is already resuming.","workloadKind":"Workload","runtimeStateLabel":"Runtime State","sandboxName":"Sandbox","statePvc":"State PVC","serviceFQDN":"Service FQDN","sandboxShort":"Sandbox","agentSandboxCount":"{{count}} sandbox","pausedCount":"{{count}} paused","resumingCount":"{{count}} resuming","lastActiveAt":"Last active","pausedAt":"Paused at","runtimeState":{"running":"Running","paused":"Paused","resuming":"Resuming","failed":"Failed","unknown":"Unknown"},"backupsTitle":"State Backups","backupsDescription":"Shadow automatically uses CSI snapshots when available, or object archives when the cluster has no VolumeSnapshot API.","backupsUnavailableTitle":"Backups require agent-sandbox","backupsUnavailableDescription":"This agent is still running on the legacy Kubernetes Deployment backend.","createBackup":"Create Backup","backupUnavailableRuntime":"Backups are available only while the sandbox is running or paused.","backupUnavailableActiveOperation":"A backup or restore operation is already running for this agent.","backupActiveOperation":"A backup or restore is running. This view will refresh more frequently until it finishes.","restoreBackup":"Restore","restoreUnavailableActiveOperation":"A restore operation is already in progress.","restoreUnavailableArtifact":"This backup has no restorable snapshot or object archive.","restoreUnavailableStatus":"Only succeeded backups can be restored. Current status: {{status}}.","restoreBackupConfirmTitle":"Restore state backup?","restoreBackupConfirmDescription":"This will pause the agent, replace PVC {{pvc}} with backup artifact {{artifact}}, and resume the sandbox.","restoreBackupConfirmAction":"Restore backup","noBackups":"No backups yet","backupStatus":"Status","backupDriver":"Driver","backupDriverVolumeSnapshot":"VolumeSnapshot","backupDriverObject":"Object archive","backupStatusPending":"Pending","backupStatusRunning":"Running","backupStatusSucceeded":"Succeeded","backupStatusFailed":"Failed","backupStatusExpired":"Expired","backupPhase":"Phase: {{phase}}","backupPhaseQueued":"Queued","backupPhaseCheckingSnapshotApi":"Checking snapshot API","backupPhaseSnapshotCreating":"Creating snapshot","backupPhaseSnapshotWaiting":"Waiting for snapshot","backupPhaseObjectArchiving":"Archiving state","backupPhaseObjectStoring":"Storing archive","backupPhaseRestoringPausing":"Pausing sandbox","backupPhaseRestoringPvc":"Restoring PVC","backupPhaseRestoringResuming":"Resuming sandbox","backupPhaseRestoreFailed":"Restore failed","backupPvc":"PVC","backupSnapshot":"Artifact","backupCreatedAt":"Created","backupUpdatedAt":"Updated","backupActions":"Actions","configDescription":"Edit the cloud configuration JSON. Changes take effect after redeployment.","format":"Format","validate":"Validate","tabPods":"Pods","tabLogs":"Logs","tabConfig":"Config","tabEnv":"Environment","tabBackups":"Backups","tabTasks":"Tasks","tabInfo":"Info"},"deploymentDetail":{"namespace":"Namespace","destroy":"Destroy","stats":{"pods":"Pods","running":"Running","notReady":"Not Ready","replicas":"Replicas"},"podsLoading":"Loading pods...","podsEmptyTitle":"No pods found","podsEmptyDescription":"The deployment may be scaling up.","podsSummary":"{{count}} {{label}} in this deployment.","logsDescription":"Real-time log stream from all pods in this deployment.","logsLines":"{{count}} lines","logsConnectHint":"Click \\"Connect\\" to stream logs…","logsWaiting":"Waiting for log output…","info":{"deploymentName":"Deployment Name","namespace":"Namespace","totalPods":"Total Pods","runningPods":"Running Pods","totalRestarts":"Total Restarts","cliCommands":"CLI Commands","viewPods":"View pods","viewLogs":"View logs","scaleDeployment":"Scale deployment"},"deleteEnvConfirm":"Delete environment variable \\"{{key}}\\"?","scaleSuccess":"Scaled to {{count}} replicas","scaleFailed":"Failed to scale deployment","destroySuccess":"Destroyed namespace {{namespace}}","scaleActivityTitle":"Scaled {{agent}}","scaleActivityDetail":"Replicas: {{count}}","destroyActivityTitle":"Destroyed namespace {{namespace}}","destroyQueuedActivityTitle":"Queued destroy for namespace {{namespace}}"},"templates":{"title":"My Templates","description":"Fork templates from the Agent Store, customize them, and deploy your own versions.","createTemplate":"Create Template","createTemplateDescription":"Create a blank template and start editing it in your workspace.","importGit":"Import from Git","forkFromStore":"Store","forkTemplate":"Fork Template","chooseStoreTemplate":"Choose a store template to fork. You\'ll get an editable copy.","sourceTemplate":"Source Template","newTemplateName":"New Template Name","noCustomTemplates":"No custom templates yet","noCustomTemplateHint":"Create from scratch or fork from the store to get started.","importFromGit":"Import from Git","cloneGitRepository":"Clone a git repository and import the template config.","repositoryUrl":"Repository URL","templateName":"Template Name","autoDetectFromRepo":"auto-detect from repo","branch":"Branch","defaultBranch":"default branch","configFilePath":"Config file path","autoDetect":"auto-detect (shadowob.json, *.template.json)","cloning":"Cloning...","forkedAs":"Forked as","importedFromGit":"Imported from git","deleteConfirm":"Delete template \\"{{name}}\\"? This action cannot be undone.","deleteApprovedTitle":"Remove from Community","deleteApprovedConfirm":"Template \\"{{name}}\\" is published in the community store. Deleting it will immediately remove it from the store and all users will lose access. This cannot be undone.","deletePendingConfirm":"Template \\"{{name}}\\" is currently under review. Deleting it will cancel the review submission. This action cannot be undone.","searchPlaceholder":"Search templates...","noTemplatesMatch":"No templates match \\"{{query}}\\"","templateNamePlaceholder":"my-custom-template","importAction":"Import","loadingTemplates":"Loading templates...","searchSavedPlaceholder":"Search saved templates by name, source, or namespace...","typewriterPhrases":["Search by template name...","Find templates by agent namespace...","Browse your store forks...","Filter by git-imported templates..."],"recentlyUpdated":"Recently Updated","recentlyUpdatedDescription":"Jump back into what you edited most recently and keep shipping.","openEditor":"Open Editor","deployNow":"Deploy Now","emptyFiltered":"No saved templates match the current filters.","clearSearch":"Clear search","clearFilters":"Clear filters","updated":"Updated","shareCopied":"Template JSON copied to clipboard — share with others!","shareFailed":"Failed to generate share link","forkFailed":"Fork failed: {{message}}","createFailed":"Create failed: {{message}}","templateCreated":"Created template \\"{{name}}\\"","importFailed":"Import failed: {{message}}","templateDeleted":"Template deleted","deleteFailed":"Failed to delete","stats":{"saved":"Saved templates","storeForks":"Store forks","gitImports":"Git imports"},"filters":{"all":"All","store":"Store forks","git":"Git imports","custom":"Custom"}},"templateDetail":{"editor":"Editor","format":"Format","validate":"Validate","validJSON":"Valid JSON","invalidJSON":"Invalid JSON","invalidJSONCannotSave":"Invalid JSON — cannot save","invalidJSONSyntax":"Invalid JSON syntax","lines":"lines","count":"Count","agentsCount":"{{count}} agent(s)","agentsInTemplate":"{{count}} agent(s) in this template:","formatted":"Formatted","cannotFormat":"Cannot format: invalid JSON","validConfig":"Valid:","invalidConfig":"Invalid:","validationSummaryValid":"Valid: {{agents}} agent(s), {{configurations}} configuration(s)","validationSummaryInvalid":"Invalid: {{count}} violation(s)","schemaLoadFailed":"Schema validation is unavailable: {{message}}","templateSaved":"Template saved","saveFailed":"Save failed","agents":"Agents","versions":"Versions","version":"Version","updated":"Updated","currentVersion":"Current version:","current":"Current","versionLabel":"Version {{version}}","noVersionHistory":"No version history","editAndSaveToCreate":"Edit and save the template to create version history.","loadingVersions":"Loading versions...","totalVersions":"total","overview":"Overview","configurations":"Configurations","providers":"Providers","agentSummary":"Agent Summary","configPreview":"Config Preview","configPreviewDescription":"Review the shared JSON source that powers this custom template.","restore":"Restore","restored":"Restored version {{version}}","restoreFailed":"Restore failed","templateDeleted":"Template deleted","templateDeleteFailed":"Failed to delete template","loadingTemplate":"Loading template...","missingTemplateDescription":"The template \\"{{name}}\\" does not exist.","backToTemplates":"Back to My Templates","forkedDescription":"Forked from {{name}} and ready for your custom edits and redeploys.","customDescription":"A custom template stored in your workspace, ready to edit, version, and deploy.","forkedFrom":"Forked from","quickInfo":"Quick Info","identity":"Identity","personality":"Personality","systemPrompt":"System Prompt","integrations":"Integrations","resources":"Resources","requests":"Requests","limits":"Limits","environment":"Environment","tools":"Tools","noContent":"No content","noContentDescription":"Template has no configuration data.","noAgents":"No agent definitions found in this template.","publishToCommunity":"Submit for Review","publishing":"Submitting...","publishSuccess":"Template submitted for review. The admin will review it shortly.","publishFailed":"Failed to submit. Please try again.","publishTooltip":"Submit this template for community review","publishConfirmTitle":"Submit for Community Review?","publishConfirmDescription":"Your template will be submitted for admin review. It won\'t be visible publicly until approved.","resubmitToCommunity":"Resubmit for Review","resubmitConfirmTitle":"Resubmit for Review?","resubmitConfirmDescription":"You are resubmitting this template after the previous rejection. Please ensure you\'ve addressed the feedback.","reviewStatusDraft":"Draft","reviewStatusPending":"Pending Review","reviewStatusApproved":"Approved","reviewStatusRejected":"Rejected","reviewStatusLabel":"Review Status","reviewNoteLabel":"Rejection Note","rejectionBannerTitle":"Your template was rejected","rejectionBannerDesc":"Please review the admin\'s feedback below, make changes, and resubmit.","pendingBannerTitle":"Under Review","pendingBannerDesc":"Your template is currently being reviewed. You cannot edit it until the review is complete.","approvedBannerTitle":"Published to Community","approvedBannerDesc":"Your template is live in the community store.","editorLockedPending":"Editing is disabled while your template is under review.","editorLockedApproved":"This template is published and cannot be edited."},"secrets":{"title":"Secrets and Environment Variables","description":"Keep deployment credentials and environment variables together in a secure workspace.","encryptionActive":"Encryption is enabled","allSecretsEncrypted":"All secrets are encrypted at rest using platform-managed keys.","setPassphraseEnv":"Set","envVarToUseCustom":"Set this environment variable to use a custom passphrase.","encryptedValues":"encrypted items","createGroup":"Create group","groupNamePlaceholder":"Group name","groupCreated":"Group created","groupCreateFailed":"Failed to create group","groupDeleted":"Group deleted","groupDeleteFailed":"Failed to delete group","deleteGroup":"Delete group","deleteGroupTitle":"Delete group?","deleteGroupDescription":"This will permanently delete the \\"{{group}}\\" group and all its environment variables. This cannot be undone.","providerSecrets":"Provider secrets","providerSecretsDesc":"API keys and credentials for LLM providers, saved with the same protection.","addSecret":"Add secret","providerId":"Provider ID (for example: openai)","secretKey":"Key (for example, apiKey)","secretValue":"Value","noSecretsInGroup":"No secrets in this group yet","yet":"yet.","environmentVariables":"Environment Variables","environmentValuesDescription":"Store deployment keys and variables in one place. Use secret mode for sensitive values.","globalScopedEnvVars":"Global and scoped environment variables injected into deployments.","addEnvironmentValue":"Add variable","addEnvironmentValueDescription":"A new value will be added to the \\"{{group}}\\" group.","editEnvironmentValue":"Edit Environment Value","editEnvironmentValueDescription":"Update the value stored in the \\"{{group}}\\" group.","addEnvVar":"Add Environment Variable","scope":"Scope (for example: global, production)","keyName":"Variable name","secret":"Secret","noEnvVarsInGroup":"No variables in this group yet","noValuesInGroup":"No values in \\"{{group}}\\" yet.","emptyDescription":"Add values to this group to start managing deployment secrets and environment variables, which are stored securely and organized by group.","valueLoadFailed":"Failed to load environment value","valueSaved":"Environment value saved","valueSaveFailed":"Failed to save environment value","valueUpdated":"Environment value updated","valueUpdateFailed":"Failed to update environment value","valueDeleted":"Environment value deleted","valueDeleteFailed":"Failed to delete environment value","leaveEmptyKeep":"Leave empty to keep current value"},"providers":{"title":"Model providers","tabs":{"providers":"Connections","routing":"Advanced routing","limits":"Budget"},"addProvider":"Add provider","connectProvidersTitle":"Add a model provider","connectProvidersDescription":"Choose a provider, then paste its API key. We will validate and enable it automatically.","connectProviderTitle":"Connect {{provider}}","connectTabs":{"apiKey":"API Keys","local":"Local"},"apiKeyProvidersDescription":"Choose a provider first, paste your API key, and save to validate before using it.","providerConnected":"Connected","providerAvailable":"Ready","backToProviders":"Back","addCustomProvider":"Add custom provider","customProviderDescription":"Supports OpenAI-compatible APIs, including private or gateway-based URLs.","noLocalProviders":"No local providers yet","noLocalProvidersDescription":"Add a custom compatible endpoint using localhost or private network access.","localProviderSubtitle":"Local model endpoint","createProfile":"Add provider","editProfile":"Edit provider","profileDialogDescription":"Set the provider key, endpoint, and model mapping here. Changes apply to future deployments.","connectionTitle":"Connection settings","connectionDescription":"These settings are used during tests and deployments.","profileStatusEnabled":"Enabled","profileStatusDisabled":"Disabled","encryptionActive":"Keys are encrypted","encryptionDescription":"They are decrypted only during tests and deployments.","enabledProfiles":"Enabled providers","officialProviderTitle":"Official provider","officialProviderDescription":"Use Shadow\'s built-in OpenAI-compatible gateway. Usage is charged from your Shrimp Coin wallet.","officialPricingLoading":"Loading official billing standard...","officialPricingTokens":"Official billing: input {{input}} tokens / Shrimp Coin, output {{output}} tokens / Shrimp Coin.","officialPricingDeepSeek":"Official billing: cached input {{cacheHit}} Shrimp Coins / 1M tokens, regular input {{cacheMiss}} Shrimp Coins / 1M tokens, output {{output}} Shrimp Coins / 1M tokens. Exchange: 1 CNY = {{shrimpPerCny}} Shrimp Coins.","noProfiles":"No model providers connected yet","noProfilesDescription":"Add one compatible provider such as OpenAI, Anthropic, Gemini, DeepSeek, or Qwen to get started.","basicTitle":"Quick start","basicDescription":"Choose a provider and enter its API key.","advancedTitle":"Advanced","advancedDescription":"optional","provider":"Connected providers","selectProvider":"Select provider","profileName":"Connection name","profileNamePlaceholder":"Give this connection a clear name, such as OpenAI.","apiKey":"API Key","apiKeyPlaceholder":"Enter your API key","apiKeyEditPlaceholder":"Already saved. Enter a new key only if you want to replace it","apiKeyHelp":"For security, this field is masked after saving. It is replaced only when you type a new key.","baseUrl":"API Endpoint","baseUrlPlaceholder":"https://api.openai.com/v1","baseUrlHelp":"Leave blank to use the default endpoint. You can also use your own gateway URL.","apiFormat":"API format","apiFormats":{"openai":"OpenAI compatible","anthropic":"Anthropic messages","gemini":"Gemini"},"authType":"Auth type","authTypes":{"api_key":"API key","subscription":"Subscription","local":"Local"},"defaultModel":"Default model","configuredModels":"Configured models","modelNotPinned":"Not pinned","modelsNotConfigured":"No models configured","modelsTitle":"Models to use","modelsDescription":"Keep at least one model ID. These are used by your deployments.","modelTagHint":"Use tags to organize models by scenario. Matching by model ID still works.","modelTag":"Model tag","noModelTag":"No tags selected","modelRequired":"Please add at least one model.","modelIdRequired":"Model ID is required.","modelDuplicate":"Model IDs cannot be duplicated.","addModel":"Add model","addFirstModel":"Add the first model","modelIdPlaceholder":"For example: gpt-4o, gemini-1.5-pro","modelNamePlaceholder":"Display name (optional)","contextWindowPlaceholder":"Context window (optional)","maxTokensPlaceholder":"Default max output tokens (optional)","inputCostPlaceholder":"Input token price (optional)","outputCostPlaceholder":"Output token price (optional)","capabilities":{"vision":"Vision","tools":"Tools","reasoning":"Reasoning"},"moreModels":"+{{count}} more","modelTags":{"default":"Default","fast":"Fast","flash":"Flash","reasoning":"Reasoning","vision":"Vision","tools":"Tools"},"selectModel":"Select model","enabled":"Enabled","disabled":"Disabled","keySaved":"Key saved","modelsCount":"{{count}} model(s): {{modelList}}","secretFields":"Secret fields","noSecretValue":"No secret saved yet","testConnection":"Check connection","testConnectionShort":"Check","refreshModels":"Refresh models","refreshModelsShort":"Refresh","modelsRefreshed":"Models refreshed","modelsRefreshFailed":"Failed to refresh models","testPassed":"Connection is working","testFailed":"Connection failed","modelDetails":"Model settings","routingTitle":"Routing","routingDescription":"Pick models for simple, standard, complex, and reasoning work.","routingManifestDescription":"{{count}} › Pick which model handles each type of request","connectProvidersAction":"Connect providers","connectionCount":"Connected providers","howRoutingWorks":"How routing works","routingModes":{"default":"Default","taskSpecific":"Task-specific","custom":"Custom"},"routingModeTitles":{"taskSpecific":"Task-specific routing","custom":"Custom routing"},"routingModeDescriptions":{"taskSpecific":"Configure dedicated models for coding, browsing, analysis, and other task types. Phase 1 reuses the complexity route model pool.","custom":"Later this can add request rules by header, template, or Agent."},"routeByComplexity":"Route by complexity","routeByComplexityDescription":"Analyzes the complexity of each request on the fly and routes it to the matching tier.","noFallbacks":"No fallbacks","noFallbacksDescription":"Add fallback models to guarantee a response if the provider fails.","addFallback":"Add fallback","setupInstructions":"Setup instructions","keepDefaults":"If you prefer, keep the default settings.","saveRouting":"Save routing","routingSaved":"Routing policy saved","routingSaveFailed":"Failed to save routing policy","routingLoadFailed":"Failed to load routing","routingLoadFailedDescription":"Could not read model routing and budget settings. Please retry.","routes":{"default":"Default","simple":"Simple","standard":"Standard","complex":"Complex","reasoning":"Reasoning"},"routeDescriptions":{"default":"Regular requests and deployment fallback.","simple":"Fast, cheap traffic such as greetings and status checks.","standard":"Balanced everyday work.","complex":"Higher quality tasks with more context or nuance.","reasoning":"Planning, analysis, and hard decision-making."},"selectorPlaceholder":"Tag selector, e.g. fast or reasoning","autoSelect":"Auto select by tag","manual":"Manual","auto":"Auto","fallbacks":"Fallbacks","fallbackSlot":"Fallback {{index}}","limitsTitle":"Limits","limitsDescription":"Phase 1 stores the contract used by future proxy enforcement and billing dashboards.","limitsManifestDescription":"{{count}} › Get notified or block requests when token or cost thresholds are exceeded","limitsLoadFailed":"Failed to load budget","createRule":"Create rule","createRuleTitle":"Create rule","editRule":"Edit rule","createRuleDescription":"You\'ll receive an email alert when usage exceeds the threshold.","ruleMetric":"Metric","ruleThreshold":"Threshold","ruleThresholdPlaceholder":"e.g. 50000","rulePeriod":"Period","blockRequests":"Block requests when exceeded","connectProviderForHardLimits":"Connect a provider to set hard limits","connectProviderForHardLimitsDescription":"Hard limits automatically block proxy requests when usage exceeds a threshold. Email alerts work without a connected provider; only hard limits require one.","emailAlerts":"Email alerts","emailAlertsDescription":"Alerts will be sent to {{email}}","rulesTitle":"Rules","noRulesYet":"No rules yet","noRulesYetDescription":"Set up alerts for usage spikes, or hard limits to block requests over budget.","ruleType":"Type","ruleTriggered":"Triggered","ruleActions":"Actions","advancedLimits":"Advanced limits","ruleMetrics":{"tokens":"tokens","cost":"cost"},"rulePeriods":{"day":"Per day","month":"Per month","inline":{"day":"per day","month":"per month"}},"requestsPerMinute":"Requests / minute","concurrentRequests":"Concurrent requests","monthlyBudgetUsd":"Monthly budget USD","fallbackPolicy":"Fallback policy","fallbackPolicyDescription":"Fallback on these upstream status codes before surfacing an error to the agent.","modelPricesTitle":"Model prices","modelPricesDescription":"Compare saved model costs used by routing.","noModelPrices":"Refresh or add models to see pricing here.","priceModel":"Model","priceProvider":"Provider","priceInput":"Input / 1M","priceOutput":"Output / 1M","enabledProfilesMetric":"Enabled profiles","enabledModelsMetric":"Enabled models","billingModeMetric":"Billing mode","byok":"BYOK","profileSaved":"Provider profile saved","profileSaveFailed":"Failed to save provider profile","profileDeleted":"Provider profile deleted","profileDeleteFailed":"Failed to delete provider profile","deleteTitle":"Delete provider profile?","deleteDescription":"This deletes \\"{{name}}\\" and its encrypted keys. This cannot be undone."},"monitoring":{"title":"Dashboard","description":"Health, deployments, costs, and activity in one place.","overview":"Overview","costs":"Costs","namespaces":"Namespaces","healthScore":"Health Score","healthChecks":"Health Checks","deployments":"Deployments","readyTotal":"Ready / Total","events":"Events","passed":"passed","warnings":"warnings","failed":"failed","statusLabels":{"pass":"Pass","warn":"Warn","fail":"Fail"},"runningHealthChecks":"Running health checks...","failedHealthChecks":"Failed to run health checks.","across":"across","deploymentsAcross":"{{deployments}} deployments across {{namespaces}} namespaces","latestHealthFindings":"Latest Health Findings","allSystemsHealthy":"All health checks are passing.","costSnapshot":"Cost Snapshot","namespaceInventory":"Namespace Inventory","configuredNamespaces":"Configured","discoveredNamespaces":"Discovered","trackedNamespaces":"Tracked","recentActivity":"Recent Activity","deploymentReadiness":"Deployment Readiness","loadingCostDetails":"Loading namespace cost details...","costSources":{"tracked":"tracked","json":"json","text":"text","telemetry":"telemetry","unavailable":"unavailable"},"name":"NAME","namespace":"NAMESPACE","ready":"READY","status":"STATUS","noDeploymentsFound":"No deployments found.","noRecentEvents":"No recent events. Deploy an agent team to see activity here."},"activity":{"title":"Activity Log","description":"Track all operations — deploys, scales, destroys, and configuration changes.","total":"total","activities":"activities","today":"today","deploys":"deploys","destroys":"destroys","searchActivities":"Search activities...","allTypes":"All Types","sortOrder":"Sort order","newestFirst":"Newest first","oldestFirst":"Oldest first","noActivityRecorded":"No activity recorded","operationsWillAppear":"Operations like deploy, destroy, and scale will appear here automatically.","noActivitiesMatch":"No activities match your filters.","showingMostRecent":"Showing the most recent 100 activities.","types":{"deploy":"Deploy","destroy":"Destroy","scale":"Scale","config_update":"Config Update","cluster_add":"Cluster Added","cluster_remove":"Cluster Removed","envvar_update":"Environment Variables Updated","template_approved":"Template Approved","template_rejected":"Template Rejected","billing_deduct":"Billing Deducted","template_submit":"Template Submit","template_update":"Template Update","template_delete":"Template Delete","config":"Config","init":"Init","settings":"Settings"},"meta":{"namespace":"Namespace","template":"Template","template_slug":"Template","task_id":"Task","deployment_id":"Deployment","cluster_id":"Cluster","config_id":"Config","user_id":"User","resource_tier":"Resource Tier","monthly_cost":"Monthly Cost","hourly_cost":"Hourly Cost","billing_precision_minutes":"Billing Precision (minutes)","key":"Env Key","count":"Count","name":"Name","was_approved":"Approved","redeploy_from":"Redeploy From"}},"settings":{"appearance":"Appearance","providers":"Providers","pageDescription":"Theme, language, providers, and system preferences.","configureLLMProviders":"Configure LLM providers and API keys for agent deployments.","configureProvidersMetadata":"Configure provider metadata here. Store provider credentials in Secrets & Environment.","themeSection":"Theme","themeSectionDescription":"Choose how the console looks in this browser.","languageSection":"Language","languageSectionDescription":"Choose which language the console uses.","languageEnglish":"English","languageChinese":"简体中文","addProvider":"Add provider","noProvidersConfigured":"No providers configured. Add one to get started.","apiKey":"API Key","baseUrl":"Base URL","secretEnvKey":"Secret environment key","credentialsManagedInSecrets":"Sensitive credentials now live in Secrets & Environment instead of settings.json.","credentialsMoveNotice":"Provider API keys are now managed as encrypted environment values. Add keys like OPENAI_API_KEY on the Secrets & Environment page.","saveSettings":"Save settings","settingsSaved":"Settings saved","settingsSaveFailed":"Failed to save settings","updatedProviderSettings":"Updated provider settings","configuredProviders":"{{count}} provider(s) configured","system":"System","apiStatus":"API Status","healthy":"Healthy","unknown":"Unknown","doctorChecks":"Doctor Checks","passing":"passing","dashboardPort":"Dashboard Port","apiEndpoint":"API Endpoint","environment":"Environment","userAgent":"User Agent","language":"Language","timezone":"Timezone","about":"About","consoleTagline":"AI Agent Cluster Management Platform","aboutDescription":"Shadow Cloud Console provides full lifecycle management for AI agent clusters on Kubernetes. Deploy, monitor, scale, and manage your agent teams with an intuitive cloud-native interface.","platform":"Platform","interface":"Interface","consoleWeb":"Console (Web)","license":"License","quickLinks":"Quick Links","gitHubRepository":"GitHub Repository →","documentation":"Documentation →","plugins":"Plugins","pluginsAvailable":"plugins available","enabled":"enabled","shown":"shown","skills":"Skills","cli":"CLI","mcp":"MCP","channel":"Channel","configuration":"Configuration","searchPlugins":"Search plugins...","allCategories":"All Categories","developer":"Developer","community":"Community","communityDescription":"Connect to the Shadow community hub to browse and fork templates shared by the community.","communityServer":"Server Configuration","communityBaseUrl":"Community Server URL","communityBaseUrlHint":"The URL of the Shadow community server. Defaults to https://shadowob.com.","communityToken":"Access Token","communityTokenSet":"Token set","communityTokenPlaceholder":"Paste your token here...","communityTokenHint":"Personal access token for the community server. Leave blank to use OAuth instead.","communityConnected":"Connected to community","communityNotConnected":"Not connected","communitySaved":"Community settings saved.","communityOAuth":"Authorize via OAuth","communityOAuthHint":"Open the community server in a popup to authorize with your account.","communityOAuthSuccess":"Successfully connected via OAuth.","communityOAuthError":"OAuth authorization failed. Please try again.","connectViaOAuth":"Connect via OAuth","communityBrowse":"Visit Community","communityBrowseHint":"Browse the full template catalog on the community server.","openCommunity":"Open Community"},"deployTask":{"title":"Deployment Task","description":"Track a deploy task through completion and reopen it later from the same fixed URL.","loading":"Loading deployment task...","taskNotFound":"Deployment task not found","taskNotFoundDescription":"The requested deployment task does not exist or has already been removed.","invalidTaskId":"The deployment task URL is invalid.","backToStore":"Back to Store","refresh":"Refresh","copyLink":"Copy link","linkCopied":"Deployment task link copied","linkCopyFailed":"Failed to copy deployment task link","openClusters":"Open Clusters","openTask":"Open Deploy Task","openTaskDescription":"Resume live progress and revisit the full deploy log later.","listTitle":"Deployment Tasks","listDescription":"Track active and completed deployments, then reopen any task from one place.","noTasks":"No deployment tasks yet","noTasksDescription":"Start a deployment from the store and it will appear here.","openStore":"Open Store","runningTasks":"Running Tasks","totalTasks":"Total Tasks","taskHistory":"Task History","activeNow":"Active now","taskId":"Task ID","template":"Template","namespace":"Namespace","taskUrl":"Task URL","created":"Created","updated":"Updated","streamStatus":"Stream status","error":"Task error","logs":"Logs","logDescription":"Historical logs are replayed first, then live output continues automatically while the task is still running.","waitingForLogs":"Waiting for deployment output…","liveStreaming":"Live streaming","logReplay":"Replay available","runningMessage":"Deployment in progress","runningDescription":"You can leave this page at any time and come back later with the same URL.","destroyRunningMessage":"Destroy in progress","destroySuccessMessage":"Destroy completed","destroySuccessDescription":"Pulumi completed the destroy and verified the namespace was removed.","blockedBy":"Waiting for task","blockedByDescription":"Waiting for #{{id}} ({{status}}) to finish before continuing.","openBlockingTask":"Open blocking task","cancelTask":"Cancel Task","cancelTaskDescription":"Request cancellation for this deployment task. Queued tasks stop immediately; running Pulumi operations receive a cooperative cancel signal.","cancelRequested":"Cancellation requested","cancelFailed":"Failed to cancel deployment task","successMessage":"Deployment finished successfully","successDescription":"The full task history stays available here for later review.","failedMessage":"Deployment failed","failedDescription":"The failure details and full log output are preserved here for debugging.","statuses":{"pending":"Queued","running":"Running","deploying":"Deploying","cancelling":"Cancelling","deployed":"Deployed","failed":"Failed","destroying":"Destroying","destroyed":"Destroyed"},"streamStatuses":{"idle":"Idle","connecting":"Connecting","connected":"Connected","done":"Completed","error":"Error"},"redeploy":"Redeploy","rollback":"Rollback","rollbackConfirm":"Click again to confirm"},"validate":{"title":"Validate Config","description":"Paste or edit a shadowob-cloud.json config and validate it.","pasteConfig":"Paste your shadowob-cloud.json here...","loadTemplate":"Load template","validating":"Validating...","validationPassedToast":"Valid: {{agents}} agent(s)","validationFailedToast":"Invalid: {{count}} violation(s)","invalidJsonCannotValidate":"Invalid JSON — cannot validate","validationError":"Validation Error","configValid":"Config is valid!","configHasIssues":"Config has issues","agents":"Agents","configurations":"Configurations","templateRefs":"Template Refs","env":"env","secret":"secret","file":"file","inlineApiKeys":"Inline API Keys:","prefixLabel":"prefix","extendsErrors":"Extends Errors:","templateLoaded":"Template loaded"},"theme":{"light":"Light","dark":"Dark","system":"System"},"errorBoundary":{"title":"Something went wrong"},"confirmDialog":{"typeToConfirm":"Type {{text}} to confirm:"},"community":{"title":"Community Templates","description":"Browse templates shared by the Shadow community.","searchPlaceholder":"Search community templates...","forkToLocal":"Fork to Local","forking":"Forking...","forkSuccess":"Forked \\"{{name}}\\" to your templates.","forkError":"Failed to fork template. Please try again.","noTemplates":"No templates found","noTemplatesHint":"Try a different search or check your community server connection.","errorTitle":"Could not load community templates","errorHint":"Check your community server URL and token in Settings → Community.","configure":"Configure"},"wallet":{"title":"Wallet & Billing","description":"Your Shrimp Coin balance and transaction history.","currentBalance":"Current Balance","shrimpCoins":"Shrimp Coins","topUp":"Top Up","topUpSuccess":"Successfully topped up 10,000 Shrimp Coins!","topUpFailed":"Top-up failed. Please try again.","transactionHistory":"Transaction History","noTransactions":"No transactions yet","noTransactionsDesc":"Your billing history will appear here once you deploy an app.","txType":"Type","txNote":"Description","txAmount":"Amount","txBalance":"Balance","txDate":"Date","page":"Page {{current}} / {{total}}","txTypes":{"topup":"Top-up","purchase":"Purchase","refund":"Refund","reward":"Reward","transfer":"Transfer","adjustment":"Adjustment","settlement":"Settlement","cloud_deploy":"Deployment","cloud_hourly":"Usage billing"}}}'),u=JSON.parse('{"nav":{"deploy":"部署","consoleHome":"控制台首页","agentStore":"虾豆商店","myTemplates":"我的模板","manage":"管理","clusters":"集群","deployments":"部署管理","deployTasks":"部署任务","providers":"模型提供商","secrets":"密钥","monitoring":"仪表盘","system":"系统","activity":"活动","settings":"设置","shadowCloud":"Shadow Cloud","console":"控制台","shrimp":"虾豆商店","community":"社区","wallet":"钱包与账单"},"common":{"save":"保存","saved":"已保存","cancel":"取消","confirm":"确认","delete":"删除","loading":"加载中…","viewAll":"查看全部","deploy":"部署","deployNew":"新建部署","back":"返回","next":"下一页","continue":"继续","clearAll":"全部清除","edit":"编辑","add":"添加","saving":"保存中…","share":"分享","fork":"复刻","refresh":"刷新","close":"关闭","actions":"操作","none":"—","search":"搜索","favorite":"收藏","noData":"暂无数据","copied":"已复制!","copy":"复制","clear":"清空","download":"下载","retry":"重试","expand":"展开","collapse":"收起","details":"详情","or":"或","show":"显示","hide":"隐藏","enabled":"已启用","disabled":"已禁用","on":"开","off":"关","error":"错误","success":"成功","warning":"警告","info":"信息","darkMode":"深色模式","lightMode":"浅色模式","language":"语言","breadcrumb":"面包屑导航","prev":"上一页"},"configEditor":{"title":"配置编辑器","unsaved":"未保存","editing":"正在编辑:","selectTemplateOrScratch":"选择一个模板加载,或从空白开始","storeTemplates":"商店模板","myTemplates":"我的模板","saveToMyTemplates":"保存到我的模板","saveAsTemplate":"另存为模板","saved":"配置已保存","saveFailed":"保存配置失败","loadingConfig":"正在加载配置…","noConfigLoaded":"当前未加载配置文件。请使用上方模板选择器加载商店模板或你已保存的模板。","loadedTemplate":"已加载模板:{{name}}","loadTemplateFailed":"加载模板失败","savedAsTemplate":"已保存到我的模板:\\"{{name}}\\"","validationSummaryInvalid":"无效:{{violations}} 个违规项,{{extendsErrors}} 个继承错误","chars":"字符"},"overview":{"title":"控制台首页","subtitle":"Shadow Cloud 控制台","description":"AI Agent 集群管理平台 — 部署、监控和管理 Agent 团队。","deployments":"部署","ready":"就绪","namespaces":"命名空间","templates":"模板","quickActions":"快捷操作","browseAndDeploy":"浏览并部署模板","managedDeployments":"管理部署","editAgentConfig":"编辑 Agent 配置","healthEvents":"健康检查与事件","recentDeployments":"近期部署","deployFirstAgent":"部署你的第一个 Agent 团队。","noDeploymentsYet":"暂无部署。","recentActivity":"近期活动","noRecentActivity":"暂无近期活动。","systemHealth":"系统健康","checkingHealth":"正在检查系统健康…","healthUnavailable":"健康检查暂不可用","pass":"通过","warn":"警告","fail":"失败","reRunChecks":"重新检查"},"doctor":{"title":"系统健康","subtitle":"前置条件与依赖检查","recheck":"重新检查","runningTitle":"正在运行检查…","runningDescription":"正在检查前置条件与依赖","failedTitle":"运行健康检查失败","failedDescription":"请重试。","allChecksPassed":"所有检查均已通过——系统已就绪"},"images":{"title":"镜像","subtitle":"可供 Agent 使用的容器镜像","loading":"正在加载镜像…","loadFailed":"加载镜像失败","emptyTitle":"未找到镜像","emptyDescription":"镜像定义在你的模板和配置中","totalImages":"镜像总数","withDockerfile":"包含 Dockerfile","withoutDockerfile":"无 Dockerfile"},"runtimes":{"title":"运行时","subtitle":"可用的 Agent 运行时及其默认镜像","loading":"正在加载运行时…","loadFailed":"加载运行时失败","emptyTitle":"未找到运行时","emptyDescription":"请检查配置中的运行时注册。","availableRuntimes":"可用运行时","id":"ID","image":"镜像"},"store":{"title":"虾豆商店","heroTitle":"一键部署 AI Agent 团队","description":"","searchPlaceholder":"按名称、分类或功能搜索模板…","typewriterPhrases":["查找代码审查团队模板…","部署 DevOps Agent 流水线…","搜索安全扫描模板…","浏览客服 Agent 模板…","探索研究自动化团队…"],"totalTemplates":"个模板","totalAgents":"个 Agent","totalCategories":"个分类","featuredTemplates":"精选模板","topCharts":"排行榜","recommended":"推荐","recommendedDescription":"优先看看这些上手快、价值密度高的模板。","browseByCategory":"按分类浏览模板目录。","backToDiscover":"返回发现页","sortPopular":"最受欢迎","sortNameAZ":"名称 (A-Z)","sortMostAgents":"Agent 最多","sortFewestAgents":"Agent 最少","matching":"匹配","noTemplatesFound":"未找到模板","noTemplatesInCategory":"该分类下暂无可用模板。","clearFilters":"清除筛选","allTemplatesOpenSource":"所有模板均为开源,由 Shadow Cloud 团队维护。","customTemplatesNote":"可通过以下方式添加自定义模板","featured":"精选","popularity":"热度","agentCount":"{{count}} 个 Agent","popularPercent":"{{count}}% 热门","viewTemplate":"查看","matchingTemplates":"{{count}} 个模板","matchingQuery":"匹配“{{query}}”","noTemplatesMatch":"没有匹配“{{query}}”的模板。","deployTemplate":"部署模板","forkTemplate":"复刻到我的模板","backToStore":"返回商店","categories":{"all":"全部","devops":"DevOps","security":"安全","support":"支持","research":"研究","monitoring":"监控","business":"业务","demo":"演示"},"difficulties":{"beginner":"入门","intermediate":"进阶","advanced":"高级"},"communitySource":"社区","localSource":"本地","communityUnavailable":"社区服务器不可用,正在显示本地模版。"},"storeDetail":{"overview":"概览","agents":"Agent","configuration":"配置","templateNotFound":"模板未找到","templateNotFoundDesc":"该模板不存在或不可用。","backToStore":"返回商店","agentDetailsUnavailable":"Agent 详情不可用","deployToSeeConfig":"部署此模板以查看完整的 Agent 配置。","fullTemplateConfig":"完整模板配置。将作为部署的基础配置使用。","forked":"已复刻到我的模板","failedToFork":"复刻模板失败","identity":"身份","personality":"人格描述","systemPrompt":"系统提示词","integrations":"集成","resources":"资源","tools":"工具","credentials":"个凭据","cpuRequest":"CPU 请求","cpuLimit":"CPU 限制","memRequest":"内存请求","memLimit":"内存限制","requiredEnvVars":"所需环境变量","noEnvVarsRequired":"无需环境变量。","templateSlug":"模板标识","popularity":"热度","file":"文件","updated":"更新时间","cliQuickDeploy":"CLI 快速部署","includesAgents":"此模板包含 {{count}} 个 Agent:","templateConfiguration":"模板配置"},"deploy":{"reviewTemplate":"审查模板","confirmDeployKubernetes":"先确认本次即将执行的部署内容。","ownTemplateDescription":"你的自定义模板。","agentsLabel":"Agent","namespaceLabel":"命名空间","deployTimeLabel":"部署时间","whatYouWillGet":"部署内容","prerequisites":"前置条件","configureDeploy":"配置部署","setNamespaceEnv":"确认部署名称并填写必要变量。","namespace":"命名空间","kubernetesNamespaceDesc":"用于区分这次部署名称,通常保留默认即可。","default":"默认:","requiredEnvVars":"所需环境变量","templateRequiresVars":"此模板需要 {{count}} 个环境变量。","envVarsAllRequired":"部署前须全部填写。","envFieldSlotsTitle":"连接与变量","envFieldSlotsDescription":"共 {{count}} 项,{{required}} 项必填。","templateFieldSource":"模板配置","templateFieldDescription":"此模板需要的配置值。","pluginFieldDescription":"用于连接该服务,可使用已保存的密钥。","templateFieldGroupDescription":"此模板需要这些变量。","pluginFieldGroupDescription":"{{plugin}} 的连接凭据,已有密钥会自动复用。","templateSourceBadge":"模板","pluginSourceBadge":"插件","requiredBadge":"必填","optionalBadge":"可选","sensitiveBadge":"敏感","savedBadge":"已保存","requiredCount":"{{count}} 必填","fieldGroupProgress":"{{filled}} / {{total}} 已准备","autoDetectedVarsTitle":"{{count}} 个变量已自动处理","autoDetectedVarsDescription":"已有配置会自动使用,无需在这里逐项填写。","restoreSavedValue":"恢复已保存的值","usingSavedValue":"使用密钥中已保存的值","override":"覆盖","useSaved":"使用已保存","fillFromGroup":"分组填充","selectGroup":"选择分组...","secretPersistenceTitle":"密钥复用","secretPersistenceDescription":"新填写的值可以保存到“{{group}}”分组,下次自动复用。","rememberSecrets":"记住新填写的值","rememberSecretsDescription":"将本次填写的值保存到“{{group}}”可复用分组。","bindSecretsToNamespace":"绑定到当前命名空间","bindSecretsToNamespaceDescription":"部署后也保存为此命名空间的覆盖值。","secretSaveFailed":"部署已成功,但部分密钥未能保存。","additionalVariables":"附加变量","optionalKeyValue":"超出必填项的可选键值对。","noAdditionalVars":"无附加变量。","addVariable":"添加变量","reviewDeploy":"审查并部署","missingRequiredVars":"缺少必填变量:","startDeployment":"开始部署","deploying":"部署中…","deployingToCluster":"正在将 Agent 团队部署到集群…","deploymentComplete":"部署完成","deploySuccessDesc":"Agent 团队已成功部署。","deploymentFailed":"部署失败","deployFailDesc":"部署遇到错误,请查看下方日志。","reviewConfig":"审查配置并开始部署。","template":"模板","envVariables":"环境变量","configured":"已配置","whatHappensNext":"接下来会发生什么:","whatHappensNextDesc":"Shadow Cloud 将初始化模板、生成 Kubernetes 清单并部署到集群。你可以在下方实时监控部署进度。","deploymentLog":"部署日志","download":"下载","showTimestamps":"显示时间戳","hideTimestamps":"隐藏时间戳","logLinesReceived":"已接收 {{count}} 行日志","shadowConnectionTitle":"Shadow 平台连接","shadowConnectionDescription":"用于创建 Shadow 资源(服务器、频道、伙伴)的服务地址与 API 令牌。","enterValue":"输入值","includes":"包含","asConfigured":"按当前配置","deploymentSuccessful":"部署成功!","initializingDeployment":"正在初始化部署…","agentRunningInNamespace":"你的 Agent 团队现已运行在 {{namespace}} 命名空间中。","openNamespace":"打开命名空间","openNamespaceDescription":"查看 agents、日志、环境变量和 cost 详情。","openShadowServer":"打开新服务器","shadowServerReadyDescription":"Shadow 服务器已创建完成,可以直接进入新服务器开始使用。","namespaceReadyDescription":"部署已完成,可以打开 {{namespace}} 命名空间查看运行状态。","stepTemplateLabel":"模板","stepTemplateDescription":"审查模板","stepConfigureLabel":"配置","stepConfigureDescription":"确认部署名称与变量","stepDeployLabel":"部署","stepDeployDescription":"部署并监控","providersTitle":"LLM 服务商","providersDescription":"请先配置至少一个 LLM 服务商,确保 Agent 部署可访问对应的模型 API。","modelProviderTitle":"模型供应商","modelProviderDescription":"发布前先选择该模板将使用的模型连接方式。","modelProviderOfficialTitle":"官方供应商","modelProviderOfficialBadge":"虾币计费","modelProviderOfficialDescription":"使用官方 OpenAI 兼容代理,模型用量将从你的虾币钱包扣费。","modelProviderOfficialPricingLoading":"正在读取计费标准...","modelProviderOfficialPricingTokens":"计费:输入 {{input}} tokens / 虾币,输出 {{output}} tokens / 虾币。","modelProviderOfficialPricingDeepSeek":"计费:缓存命中输入 {{cacheHit}} 虾币 / 百万 tokens,普通输入 {{cacheMiss}} 虾币 / 百万 tokens,输出 {{output}} 虾币 / 百万 tokens。兑换比例:1 元 = {{shrimpPerCny}} 虾币。","modelProviderRateInput":"输入","modelProviderRateOutput":"输出","modelProviderRateCacheHit":"缓存命中输入","modelProviderRateCacheMiss":"普通输入","modelProviderRateTokensValue":"{{tokenCount}} tokens / 虾币","modelProviderRatePerMillionValue":"{{amount}} 虾币 / 百万 tokens","modelProviderExchangeRate":"兑换比例:1 元 = {{shrimpPerCny}} 虾币。小额 token 用量会先精确累计,达到整虾币后才体现在钱包扣费里。","modelProviderOfficialWalletHint":"选择官方供应商后,部署完成即可使用模型能力;真实上游 key 只保存在服务端,不会进入你的服务器。","modelProviderCustomTitle":"我的供应商","modelProviderCustomBadge":"自费","modelProviderCustomDescription":"使用你自己加密保存的供应商配置,模型用量将直接与你的供应商账户结算。","modelProviderCustomSelfPaidNote":"模型用量将走你自己的供应商账户结算,不消耗虾币。","modelProviderCustomSecureNote":"密钥保存在供应商配置中,部署表单不会明文展示。","modelProviderOfficialSummary":"官方供应商 \xb7 虾币计费","modelProviderCustomSummary":"我的供应商 \xb7 自费","modelProviderSummaryLabel":"模型供应商","viewWalletAndBilling":"钱包与计费","customProviderRequired":"请先配置一个已启用的模型供应商,再使用自己的供应商。","providerProfilesReady":"模型服务商已就绪","providerProfilesReadyDesc":"可用的模型配置已就绪。","providerProfilesMissing":"尚未配置模型服务商","providerProfilesMissingDesc":"你可先添加模型配置,也可以先继续填写变量。","manageProviderProfiles":"管理模型提供商","openProviderSettings":"打开模型提供商配置","openConfigHelp":"打开配置帮助","providersConfiguredInSettings":"设置中已配置 {{count}} 个服务商","providersUseExistingDescription":"系统会直接沿用你在设置中已有的服务商配置。","useExisting":"使用现有配置","addProvider":"添加服务商","deployFailedWithCode":"部署失败(退出码 {{code}})","successfullyDeployed":"已成功部署 {{name}}!","unknownError":"未知错误","deployFailedWithMessage":"部署失败:{{message}}","cancelDeployment":"取消部署","cancelling":"正在取消…","cancelRequested":"已请求取消,正在等待部署停止。","deploymentCancelled":"部署已取消。","estimatedCost":"预计费用","shrimpCoinsPerMonth":"虾币 / 月","shrimpCoinsPerHour":"虾币 / 小时","walletBalance":"当前余额","shrimpCoins":"虾币","insufficientBalance":"余额不足。","insufficientBalanceDesc":"虾币余额不足以部署此应用,请先充值虾币。","topUp":"充值","preparingDeployment":"准备中…","rechargeUnavailable":"充值需在 Shadow 主应用内完成"},"clusters":{"title":"集群管理","description":"管理所有 Kubernetes 命名空间中的 Agent 部署。","totalDeployments":"总部署数","notReady":"未就绪","noClustersFound":"未找到集群","noNamespacesMatch":"没有匹配的命名空间或部署","noDeploymentsYet":"暂无 Agent 部署。请从商店部署你的第一个 Agent 团队。","browseAgentStore":"浏览 Agent 商店","destroyNamespace":"销毁命名空间","destroyWarning":"这将销毁命名空间 \\"{{namespace}}\\" 中的所有部署。此操作不可撤销。","destroy":"销毁","destroying":"销毁中…","destroyed":"已销毁命名空间","pods":"个 Pod","namespace":"命名空间","status":"状态","scale":"扩缩容","viewLogs":"查看日志","restart":"重启","ready":"就绪","discovered":"已发现"},"deployments":{"title":"部署管理","description":"","infrastructure":"基础设施","taskHistory":"任务历史","namespaces":"命名空间","namespaceDescription":"在一个页面查看该命名空间下所有 agents、日志、环境变量与成本。","namespaceLabel":"命名空间","agents":"Agents","readyAgents":"就绪 Agents","pausedAgents":"已暂停 Agents","pausedDeployments":"已暂停","selectedPods":"当前 Pods","selectedPodsCount":"{{count}} 个 Pod","namespaceCost":"命名空间成本","tokenCost":"Token 成本","totalCost":"总成本","totalTokens":"总 Tokens","tokens":"Tokens","agentSelector":"Agent 选择器","agentSelectorDescription":"选择一个 agent,在当前命名空间内查看 pods 和日志。","currentSelection":"当前选中","currentAgent":"当前 Agent","noAgentSelected":"请选择一个 agent 来查看详情。","noPodsForAgent":"未找到 {{agent}} 的 Pod。","pausedNoPodsTitle":"Agent 已暂停","pausedNoPodsDescription":"Sandbox Pod 已停止,但持久状态卷仍会保留。","selectAgentForLogs":"请选择一个 agent 以查看历史日志和实时日志。","recentLogs":"最近日志","logsHistoryDescription":"按页查看 {{agent}} 的最近日志历史。","linesPerPage":"每页 {{count}} 行","pageLabel":"第 {{page}} 页","newerLogs":"更新的","olderLogs":"更旧的","noLogsYet":"暂无日志。","pausedLogsTitle":"实时日志已暂停","pausedLogsDescription":"Sandbox Pod 已停止。历史日志仍可查看,恢复 Agent 后即可重新连接实时日志。","liveLogs":"实时日志","liveLogsDescription":"连接到当前 agent,实时查看新输出。","streaming":"流式中","connectLogs":"连接","connectLiveLogs":"点击连接以开始实时日志。","waitingForLogs":"等待日志输出…","scopedEnvTitle":"命名空间环境变量","scopedEnvDescription":"这些值仅属于当前命名空间,并会覆盖全局默认值。","addScopedEnv":"添加命名空间变量","editScopedEnv":"编辑命名空间变量","noScopedEnv":"当前还没有命名空间级环境变量。","fallbackEnvTitle":"继承的回退变量","fallbackEnvDescription":"当命名空间没有覆盖值时,将使用这些来自更广作用域的变量。","noFallbackEnv":"未找到继承的回退变量。","globalFallback":"全局回退","namespaceScoped":"作用域覆盖","envGuideScopedTitle":"部署覆盖值","envGuideScopedDescription":"命名空间变量只作用于当前 Buddy 部署。它们会加密保存、覆盖全局变量,并在下一次部署或重新部署时读取。","envGuideGlobalTitle":"全局回退","envGuideGlobalDescription":"全局变量在“密钥与环境变量”中管理,仅当模板或插件声明同名 key 时才会被复用。","cookieJarTitle":"浏览器会话","cookieJarDescription":"为浏览器自动化 Agent 导入 Playwright storageState JSON 或 Netscape cookies.txt。Cookie 会作为部署环境变量加密保存。","cookieJarImportTitle":"导入浏览器 CookieJar","cookieJarImportDescription":"粘贴或上传浏览器会话导出内容。Shadow 会先标准化为 Playwright storageState JSON 再保存。","cookieJarEnvKey":"环境变量 key","cookieJarFile":"上传文件","cookieJarPaste":"粘贴 CookieJar","cookieJarPastePlaceholder":"粘贴 Playwright storageState JSON 或 Netscape cookies.txt 内容...","cookieJarFormats":"支持格式:Playwright storageState JSON、JSON cookie 数组或 Netscape cookies.txt。","cookieJarParsed":"已识别 {{format}},包含 {{cookies}} 个 cookie 和 {{origins}} 个 origin。","cookieJarInvalid":"CookieJar 内容不是有效的 Playwright storageState JSON 或 Netscape cookies.txt。","cookieJarImportAction":"导入 CookieJar","cookieJarImported":"已将 {{cookies}} 个 cookies 导入到 {{key}}","cookieJarImportFailed":"导入 CookieJar 失败","templateManifestTitle":"模板与 Manifest","templateManifestDescription":"追踪来源模板、已部署 manifest 版本,以及部署后模板是否发生变化。","templateSlug":"模板标识","manifestRevision":"Manifest 版本","configHash":"配置哈希","templateUpdatedAt":"模板更新时间","manifestDrift":{"up-to-date":"已同步","template-updated":"模板已更新","missing-template":"模板缺失","unlinked":"未关联","unknown":"未知"},"redeploySnapshot":"按快照重部署","redeployLatestTemplate":"按最新模板重部署","saveEditableTemplate":"保存可编辑模板","saveTemplateAndRedeploy":"保存模板并重部署","templateUpdated":"模板已更新","templateForked":"已 Fork 模板 {{name}}","templateSyncFailed":"保存模板失败","templateSyncRedeployFailed":"保存模板并重部署失败","deleteScopedEnvConfirm":"确定删除命名空间环境变量“{{key}}”?","noTasksInNamespace":"此命名空间还没有部署任务。","costTab":"成本","costUnavailable":"成本数据暂不可用","costUnavailableDescription":"暂时无法从运行中的 agents 收集使用量数据。","costNoRunningPod":"未找到可读取使用量的运行中 Pod。","costUsageUnavailableMessage":"OpenClaw 暂未返回 Token 使用量,请在 Agent 处理过消息后刷新。","costTelemetryMissing":"尚未收到使用量快照,请在该 Buddy 处理新消息后刷新。","liveLogsUnavailableTransport":"暂时无法连接 Kubernetes 日志流,请稍后重试或查看最近日志。","availableAgents":"可统计 Agents","unavailableAgents":"不可统计 Agents","generatedAt":"生成时间","noProvidersReported":"暂未上报任何 provider 使用量。","totalRestarts":"总重启次数","kubectlCommands":"Kubectl 命令","viewAgents":"查看 agents","viewPods":"查看 Pods","noDeploymentsInNamespace":"此命名空间下没有部署","noDeploymentsInNamespaceDescription":"命名空间“{{namespace}}”当前没有活跃的 agent。","destroyQueued":"已创建命名空间“{{namespace}}”的销毁任务","destroyNamespaceFailed":"销毁命名空间失败","noTaskToRedeploy":"此命名空间下未找到可重新部署的任务","redeployFailed":"重新部署失败","scaledAgent":"已将 {{agent}} 扩缩到 {{count}} 个副本","scaleFailed":"扩缩 {{agent}} 失败","plainText":"明文","runningTasksCount":"{{count}} 个运行中的任务","restarts":"重启次数","age":"运行时长","rollbackInitiated":"已发起回滚","rollbackFailed":"回滚失败","rollbackWarning":"这将把命名空间 \\"{{namespace}}\\" 中的所有部署回滚到上一个状态。","pauseAgent":"暂停","resumeAgent":"恢复","backupAgent":"备份","pauseQueued":"已暂停 {{agent}}","resumeQueued":"正在恢复 {{agent}}","backupCreated":"已请求备份","restoreQueued":"已开始恢复","pauseFailed":"暂停 Agent 失败","resumeFailed":"恢复 Agent 失败","backupFailed":"创建备份失败","restoreFailed":"恢复备份失败","runtimeActionInProgress":"已有运行时操作正在执行。","pauseUnavailableResuming":"Sandbox 正在恢复中。","workloadKind":"工作负载","runtimeStateLabel":"运行状态","sandboxName":"Sandbox","statePvc":"状态 PVC","serviceFQDN":"服务 FQDN","sandboxShort":"Sandbox","agentSandboxCount":"{{count}} 个 sandbox","pausedCount":"{{count}} 个已暂停","resumingCount":"{{count}} 个恢复中","lastActiveAt":"最近活跃","pausedAt":"暂停时间","runtimeState":{"running":"运行中","paused":"已暂停","resuming":"恢复中","failed":"失败","unknown":"未知"},"backupsTitle":"状态备份","backupsDescription":"Shadow 会优先使用 CSI 快照;如果集群没有 VolumeSnapshot API,会自动改用对象归档。","backupsUnavailableTitle":"备份需要 agent-sandbox","backupsUnavailableDescription":"该 Agent 仍运行在旧版 Kubernetes Deployment 后端。","createBackup":"创建备份","backupUnavailableRuntime":"仅在 Sandbox 运行中或已暂停时可以创建备份。","backupUnavailableActiveOperation":"该 Agent 已有备份或恢复操作正在执行。","backupActiveOperation":"备份或恢复正在执行中,此视图会提高刷新频率直到操作结束。","restoreBackup":"恢复","restoreUnavailableActiveOperation":"已有恢复操作正在执行。","restoreUnavailableArtifact":"该备份没有可恢复的快照或对象归档。","restoreUnavailableStatus":"只有已完成的备份可以恢复。当前状态:{{status}}。","restoreBackupConfirmTitle":"恢复状态备份?","restoreBackupConfirmDescription":"这会暂停 Agent,用备份对象 {{artifact}} 替换 PVC {{pvc}},然后恢复 Sandbox。","restoreBackupConfirmAction":"恢复备份","noBackups":"暂无备份","backupStatus":"状态","backupDriver":"驱动","backupDriverVolumeSnapshot":"VolumeSnapshot","backupDriverObject":"对象归档","backupStatusPending":"待处理","backupStatusRunning":"运行中","backupStatusSucceeded":"已完成","backupStatusFailed":"失败","backupStatusExpired":"已过期","backupPhase":"阶段:{{phase}}","backupPhaseQueued":"已排队","backupPhaseCheckingSnapshotApi":"检查快照 API","backupPhaseSnapshotCreating":"创建快照","backupPhaseSnapshotWaiting":"等待快照就绪","backupPhaseObjectArchiving":"归档状态目录","backupPhaseObjectStoring":"写入对象存储","backupPhaseRestoringPausing":"暂停 Sandbox","backupPhaseRestoringPvc":"恢复 PVC","backupPhaseRestoringResuming":"恢复 Sandbox","backupPhaseRestoreFailed":"恢复失败","backupPvc":"PVC","backupSnapshot":"备份对象","backupCreatedAt":"创建时间","backupUpdatedAt":"更新时间","backupActions":"操作","configDescription":"编辑云配置 JSON。更改在重新部署后生效。","format":"格式化","validate":"验证","tabPods":"Pods","tabLogs":"日志","tabConfig":"配置","tabEnv":"环境变量","tabBackups":"备份","tabTasks":"任务","tabInfo":"信息"},"deploymentDetail":{"namespace":"命名空间","destroy":"销毁","stats":{"pods":"Pods","running":"运行中","notReady":"未就绪","replicas":"副本"},"podsLoading":"正在加载 Pods…","podsEmptyTitle":"未找到 Pods","podsEmptyDescription":"部署可能仍在扩容中。","podsSummary":"此部署中有 {{count}} 个{{label}}。","logsDescription":"实时查看此部署下所有 Pod 的日志流。","logsLines":"{{count}} 行","logsConnectHint":"点击“连接”开始查看日志流…","logsWaiting":"正在等待日志输出…","info":{"deploymentName":"部署名称","namespace":"命名空间","totalPods":"Pod 总数","runningPods":"运行中的 Pods","totalRestarts":"总重启次数","cliCommands":"CLI 命令","viewPods":"查看 Pods","viewLogs":"查看日志","scaleDeployment":"扩缩部署"},"deleteEnvConfirm":"确定删除环境变量“{{key}}”?","scaleSuccess":"已扩缩到 {{count}} 个副本","scaleFailed":"扩缩部署失败","destroySuccess":"已销毁命名空间 {{namespace}}","scaleActivityTitle":"已扩缩 {{agent}}","scaleActivityDetail":"副本数:{{count}}","destroyActivityTitle":"已销毁命名空间 {{namespace}}","destroyQueuedActivityTitle":"已排队销毁命名空间 {{namespace}}"},"templates":{"title":"我的模板","description":"从 Agent 商店复刻模板,自定义修改后部署你自己的版本。","createTemplate":"新建模板","createTemplateDescription":"创建一个空白模板并在工作区开始编辑。","importGit":"从 Git 导入","forkFromStore":"商店","forkTemplate":"复刻模板","chooseStoreTemplate":"选择一个商店模板进行复刻,你将获得一份可编辑的副本。","sourceTemplate":"源模板","newTemplateName":"新模板名称","noCustomTemplates":"暂无自定义模板","noCustomTemplateHint":"可选择从零创建或从商店复刻模板开始。","importFromGit":"从 Git 导入","cloneGitRepository":"克隆 Git 仓库并导入模板配置。","repositoryUrl":"仓库地址","templateName":"模板名称","autoDetectFromRepo":"从仓库自动检测","branch":"分支","defaultBranch":"默认分支","configFilePath":"配置文件路径","autoDetect":"自动检测 (shadowob.json, *.template.json)","cloning":"克隆中…","forkedAs":"已复刻为","importedFromGit":"已从 Git 导入","deleteConfirm":"确定删除模板「{{name}}」?此操作无法撤销。","deleteApprovedTitle":"从社区下架","deleteApprovedConfirm":"模板「{{name}}」已发布在社区商店中。删除后将立即从商店下架,所有用户将无法访问。此操作无法撤销。","deletePendingConfirm":"模板「{{name}}」正在审核中。删除将取消本次审核申请。此操作无法撤销。","searchPlaceholder":"搜索模板…","noTemplatesMatch":"没有匹配“{{query}}”的模板","templateNamePlaceholder":"my-custom-template","importAction":"导入","loadingTemplates":"正在加载模板…","searchSavedPlaceholder":"按名称、来源或命名空间搜索已保存模板…","typewriterPhrases":["按模板名称搜索…","按 Agent 命名空间查找模板…","浏览商店复刻的模板…","筛选 Git 导入的模板…"],"recentlyUpdated":"最近更新","recentlyUpdatedDescription":"快速回到你最近编辑过的模板,继续完善或直接部署。","openEditor":"打开编辑器","deployNow":"立即部署","emptyFiltered":"当前筛选条件下没有匹配的已保存模板。","clearSearch":"清除搜索","clearFilters":"清除筛选","updated":"更新时间","shareCopied":"模板 JSON 已复制到剪贴板,可直接分享!","shareFailed":"生成分享内容失败","forkFailed":"复刻失败:{{message}}","createFailed":"创建失败:{{message}}","templateCreated":"已创建模板“{{name}}”","importFailed":"导入失败:{{message}}","templateDeleted":"模板已删除","deleteFailed":"删除失败","stats":{"saved":"已保存模板","storeForks":"商店复刻","gitImports":"Git 导入"},"filters":{"all":"全部","store":"商店复刻","git":"Git 导入","custom":"自定义"}},"templateDetail":{"editor":"编辑器","format":"格式化","validate":"校验","validJSON":"有效 JSON","invalidJSON":"无效 JSON","invalidJSONCannotSave":"无效 JSON,无法保存","invalidJSONSyntax":"JSON 语法无效","lines":"行","count":"数量","agentsCount":"{{count}} 个 Agent","agentsInTemplate":"此模板中包含 {{count}} 个 Agent:","formatted":"已格式化","cannotFormat":"无法格式化:无效 JSON","validConfig":"有效:","invalidConfig":"无效:","validationSummaryValid":"有效:{{agents}} 个 Agent,{{configurations}} 个配置项","validationSummaryInvalid":"无效:{{count}} 个违规项","schemaLoadFailed":"Schema 校验暂不可用:{{message}}","templateSaved":"模板已保存","saveFailed":"保存失败","agents":"Agent","versions":"版本","version":"版本","updated":"更新时间","currentVersion":"当前版本:","current":"当前","versionLabel":"版本 {{version}}","noVersionHistory":"暂无版本历史","editAndSaveToCreate":"编辑并保存模板以创建版本历史。","loadingVersions":"正在加载版本…","totalVersions":"个版本","overview":"概览","configurations":"配置项","providers":"服务商","agentSummary":"Agent 概要","configPreview":"配置预览","configPreviewDescription":"查看支撑此自定义模板的共享 JSON 源配置。","restore":"恢复","restored":"已恢复版本 {{version}}","restoreFailed":"恢复失败","templateDeleted":"模板已删除","templateDeleteFailed":"删除模板失败","loadingTemplate":"正在加载模板…","missingTemplateDescription":"模板“{{name}}”不存在。","backToTemplates":"返回我的模板","forkedDescription":"从 {{name}} 复刻而来,已准备好供你继续编辑和重新部署。","customDescription":"这是保存在你工作区中的自定义模板,可随时编辑、版本化并部署。","forkedFrom":"复刻自","quickInfo":"快速信息","identity":"身份","personality":"人格描述","systemPrompt":"系统提示词","integrations":"集成","resources":"资源","requests":"请求","limits":"限制","environment":"环境变量","tools":"工具","noContent":"没有内容","noContentDescription":"模板没有配置数据。","noAgents":"此模板中未找到 Agent 定义。","publishToCommunity":"提交审核","publishing":"提交中...","publishSuccess":"模板已提交审核,管理员审核通过后将公开展示。","publishFailed":"提交失败,请重试。","publishTooltip":"将此模板提交社区审核","publishConfirmTitle":"确认提交社区审核?","publishConfirmDescription":"您的模板将提交管理员审核,审核通过后才会公开展示。","resubmitToCommunity":"重新提交审核","resubmitConfirmTitle":"确认重新提交?","resubmitConfirmDescription":"您正在重新提交此模板,请确保已根据退回意见进行了修改。","reviewStatusDraft":"草稿","reviewStatusPending":"待审核","reviewStatusApproved":"已通过","reviewStatusRejected":"已拒绝","reviewStatusLabel":"审核状态","reviewNoteLabel":"退回说明","rejectionBannerTitle":"模板审核未通过","rejectionBannerDesc":"请查看管理员意见,修改后重新提交。","pendingBannerTitle":"审核中","pendingBannerDesc":"模板正在审核中,审核期间无法编辑。","approvedBannerTitle":"已上架社区","approvedBannerDesc":"您的模板已在社区商店公开展示。","editorLockedPending":"审核期间禁止编辑。","editorLockedApproved":"该模板已发布,无法编辑。"},"secrets":{"title":"密钥与环境变量","description":"在同一安全位置集中管理部署所需的 API Key、Token 与环境变量。","encryptionActive":"加密保护已启用","allSecretsEncrypted":"所有密钥与环境变量均由平台托管密钥进行静态加密。","setPassphraseEnv":"设置","envVarToUseCustom":"设置此环境变量以启用自定义口令。","encryptedValues":"条加密条目","createGroup":"创建分组","groupNamePlaceholder":"分组名称","groupCreated":"分组已创建","groupCreateFailed":"创建分组失败","groupDeleted":"分组已删除","groupDeleteFailed":"删除分组失败","deleteGroup":"删除分组","deleteGroupTitle":"删除分组?","deleteGroupDescription":"这将永久删除「{{group}}」分组及其所有环境变量,此操作无法撤销。","providerSecrets":"服务商密钥","providerSecretsDesc":"LLM 服务商密钥与其他敏感信息一并使用同一加密策略保存。","addSecret":"新增密钥","providerId":"服务商 ID(如 openai)","secretKey":"密钥名(如 apiKey)","secretValue":"密钥值","noSecretsInGroup":"该分组暂无密钥","yet":"。","environmentVariables":"环境变量","environmentValuesDescription":"在一个地方保存部署所需的 API Key、Token 与环境变量,敏感值请使用密钥模式。","globalScopedEnvVars":"注入到部署中的全局和作用域环境变量。","addEnvironmentValue":"添加环境变量","addEnvironmentValueDescription":"变量会保存到“{{group}}”分组。","editEnvironmentValue":"编辑环境变量","editEnvironmentValueDescription":"更新“{{group}}”分组中的变量值。","addEnvVar":"添加环境变量","scope":"作用域(例如 global、production)","keyName":"变量名","secret":"加密","noEnvVarsInGroup":"该分组暂无环境变量","noValuesInGroup":"分组“{{group}}”中暂无变量。","emptyDescription":"请先在当前分组添加变量,即可开始统一管理;所有密钥与环境变量会按分组安全保存。","valueLoadFailed":"加载环境值失败","valueSaved":"环境值已保存","valueSaveFailed":"保存环境值失败","valueUpdated":"环境值已更新","valueUpdateFailed":"更新环境值失败","valueDeleted":"环境值已删除","valueDeleteFailed":"删除环境值失败","leaveEmptyKeep":"留空保持当前值"},"providers":{"title":"模型接入","tabs":{"providers":"连接","routing":"高级路由","limits":"预算"},"addProvider":"添加提供商","connectProvidersTitle":"添加模型服务商","connectProvidersDescription":"先选择服务商,再填写 API Key,系统会自动完成连接校验。","connectProviderTitle":"连接 {{provider}}","connectTabs":{"apiKey":"API Key","local":"本地"},"apiKeyProvidersDescription":"先选择服务商并粘贴 API Key,保存后可进行校验并开始使用。","providerConnected":"已连接","providerAvailable":"可用","backToProviders":"返回","addCustomProvider":"添加自定义服务商","customProviderDescription":"支持 OpenAI 兼容接口,包括内网地址和网关地址。","noLocalProviders":"暂无本地提供商","noLocalProvidersDescription":"可添加一个基于 localhost 或内网的兼容接口。","localProviderSubtitle":"本地模型服务","createProfile":"添加服务商","editProfile":"编辑提供商","profileDialogDescription":"在这里设置服务商密钥、端点与模型映射,保存后会直接应用到后续部署。","connectionTitle":"连接设置","connectionDescription":"这些设置会用于测试和后续部署。","profileStatusEnabled":"已启用","profileStatusDisabled":"已禁用","encryptionActive":"密钥已加密","encryptionDescription":"仅在测试连接和部署期间临时解密。","enabledProfiles":"启用服务商","officialProviderTitle":"官方供应商","officialProviderDescription":"使用 Shadow 官方 OpenAI 兼容网关,模型用量按虾币钱包扣费。","officialPricingLoading":"正在读取官方计费标准...","officialPricingTokens":"官方计费:输入 {{input}} tokens / 虾币,输出 {{output}} tokens / 虾币。","officialPricingDeepSeek":"官方计费:缓存命中输入 {{cacheHit}} 虾币 / 百万 tokens,普通输入 {{cacheMiss}} 虾币 / 百万 tokens,输出 {{output}} 虾币 / 百万 tokens。兑换比例:1 元 = {{shrimpPerCny}} 虾币。","noProfiles":"暂未连接模型服务商","noProfilesDescription":"先添加 OpenAI、Anthropic、Gemini、DeepSeek、Qwen 等兼容服务商,即可开始使用。","basicTitle":"快速上手","basicDescription":"选择服务商并填写 Key。","advancedTitle":"进阶","advancedDescription":"可选","provider":"已接入服务商","selectProvider":"选择提供商","profileName":"连接名称","profileNamePlaceholder":"请为该连接设置名称,例如:OpenAI","apiKey":"API Key","apiKeyPlaceholder":"输入 API Key","apiKeyEditPlaceholder":"已保存;如需更换,请输入新 Key","apiKeyHelp":"为安全起见,保存后会自动遮挡显示,仅在你输入新值时覆盖旧密钥。","baseUrl":"接口地址","baseUrlPlaceholder":"https://api.openai.com/v1","baseUrlHelp":"可选。留空则使用默认地址,也可填网关或自定义地址。","apiFormat":"API 格式","apiFormats":{"openai":"OpenAI 兼容","anthropic":"Anthropic Messages","gemini":"Gemini"},"authType":"认证类型","authTypes":{"api_key":"API Key","subscription":"订阅","local":"本地"},"defaultModel":"默认模型","configuredModels":"已配置模型","modelNotPinned":"未固定","modelsNotConfigured":"尚未配置模型","modelsTitle":"要使用的模型","modelsDescription":"请至少添加一个模型 ID,部署时会使用这里的配置。","modelTagHint":"可用标签按场景给模型分组,标签未命中时默认仍按模型 ID 匹配。","modelTag":"模型标签","noModelTag":"尚未选择标签","modelRequired":"请先添加至少一个模型。","modelIdRequired":"模型 ID 为必填。","modelDuplicate":"模型 ID 不能重复。","addModel":"添加模型","addFirstModel":"添加第一个模型","modelIdPlaceholder":"例如:gpt-4o、gemini-1.5-pro","modelNamePlaceholder":"显示名称(可选)","contextWindowPlaceholder":"上下文窗口(可选)","maxTokensPlaceholder":"默认输出 token 上限(可选)","inputCostPlaceholder":"每百万输入 token 价格(可选)","outputCostPlaceholder":"每百万输出 token 价格(可选)","capabilities":{"vision":"视觉","tools":"工具","reasoning":"推理"},"moreModels":"另有 {{count}} 个","modelTags":{"default":"默认","fast":"快速","flash":"闪电","reasoning":"推理","vision":"视觉","tools":"工具"},"selectModel":"选择模型","enabled":"启用","disabled":"禁用","keySaved":"Key 已保存","modelsCount":"{{count}} 个模型:{{modelList}}","secretFields":"密钥字段","noSecretValue":"尚未保存密钥","testConnection":"检查连接","testConnectionShort":"检查","refreshModels":"刷新模型","refreshModelsShort":"刷新","modelsRefreshed":"模型已刷新","modelsRefreshFailed":"刷新模型失败","testPassed":"连接可用","testFailed":"连接失败","modelDetails":"模型详情","routingTitle":"路由","routingDescription":"为简单、标准、复杂、推理任务选择模型。","routingManifestDescription":"{{count}} › 选择每类请求由哪个模型处理","connectProvidersAction":"连接提供商","connectionCount":"已接入服务商","howRoutingWorks":"路由如何工作","routingModes":{"default":"默认","taskSpecific":"按任务","custom":"自定义"},"routingModeTitles":{"taskSpecific":"按任务路由","custom":"自定义路由"},"routingModeDescriptions":{"taskSpecific":"为代码、浏览、数据分析等任务类型配置专用模型。当前先复用复杂度路由的模型池。","custom":"后续可添加自定义请求规则,例如按 Header、模板或 Agent 选择模型。"},"routeByComplexity":"按复杂度路由","routeByComplexityDescription":"实时分析请求复杂度,并路由到匹配的模型层级。","noFallbacks":"暂无 Fallback","noFallbacksDescription":"添加备用模型,保证服务商失败时仍能响应。","addFallback":"添加 Fallback","setupInstructions":"设置说明","keepDefaults":"如不确定,请保留默认设置。","saveRouting":"保存路由","routingSaved":"路由策略已保存","routingSaveFailed":"保存路由策略失败","routingLoadFailed":"路由配置加载失败","routingLoadFailedDescription":"无法读取模型路由和预算配置,请稍后重试。","routes":{"default":"默认","simple":"简单","standard":"标准","complex":"复杂","reasoning":"推理"},"routeDescriptions":{"default":"常规请求与部署兜底。","simple":"问候、状态检查等快速低成本流量。","standard":"日常工作中的质量与成本平衡。","complex":"需要更多上下文、质量和细节的任务。","reasoning":"规划、分析和困难决策。"},"selectorPlaceholder":"Tag selector,例如 fast 或 reasoning","autoSelect":"按 tag 自动选择","manual":"手动","auto":"自动","fallbacks":"Fallback","fallbackSlot":"Fallback {{index}}","limitsTitle":"限额","limitsDescription":"第一期先保存未来代理执行与计费看板需要的接口契约。","limitsManifestDescription":"{{count}} › token 或成本超过阈值时通知或阻止请求","limitsLoadFailed":"预算配置加载失败","createRule":"创建规则","createRuleTitle":"创建规则","editRule":"编辑规则","createRuleDescription":"当用量超过阈值时,你会收到邮件提醒。","ruleMetric":"指标","ruleThreshold":"阈值","ruleThresholdPlaceholder":"例如 50000","rulePeriod":"周期","blockRequests":"超过后阻止请求","connectProviderForHardLimits":"连接提供商后可设置硬限额","connectProviderForHardLimitsDescription":"硬限额会在用量超过阈值时自动阻止代理请求。邮件提醒不需要连接提供商;只有硬限额需要。","emailAlerts":"邮件提醒","emailAlertsDescription":"提醒会发送到 {{email}}","rulesTitle":"规则","noRulesYet":"还没有规则","noRulesYetDescription":"为用量峰值设置提醒,或用硬限额阻止超预算请求。","ruleType":"类型","ruleTriggered":"触发次数","ruleActions":"操作","advancedLimits":"进阶限流","ruleMetrics":{"tokens":"tokens","cost":"成本"},"rulePeriods":{"day":"每天","month":"每月","inline":{"day":"每天","month":"每月"}},"requestsPerMinute":"每分钟请求数","concurrentRequests":"并发请求数","monthlyBudgetUsd":"每月预算 USD","fallbackPolicy":"Fallback 策略","fallbackPolicyDescription":"上游返回这些状态码时先尝试备用模型,再向 Agent 暴露错误。","modelPricesTitle":"模型价格","modelPricesDescription":"查看当前路由可用模型的成本。","noModelPrices":"刷新或添加模型后,这里会显示价格。","priceModel":"模型","priceProvider":"提供商","priceInput":"输入 / 1M","priceOutput":"输出 / 1M","enabledProfilesMetric":"启用 profile","enabledModelsMetric":"启用模型","billingModeMetric":"计费模式","byok":"自带 Key","profileSaved":"模型提供商已保存","profileSaveFailed":"保存模型提供商失败","profileDeleted":"模型提供商已删除","profileDeleteFailed":"删除模型提供商失败","deleteTitle":"删除模型提供商?","deleteDescription":"这会删除「{{name}}」及其加密密钥,此操作无法撤销。"},"monitoring":{"title":"仪表盘","description":"","overview":"总览","costs":"成本","namespaces":"命名空间","healthScore":"健康评分","healthChecks":"健康检查","deployments":"部署","readyTotal":"就绪 / 总数","events":"事件","passed":"通过","warnings":"警告","failed":"失败","statusLabels":{"pass":"通过","warn":"警告","fail":"失败"},"runningHealthChecks":"正在执行健康检查…","failedHealthChecks":"健康检查执行失败。","across":"跨","deploymentsAcross":"{{deployments}} 个部署,分布在 {{namespaces}} 个命名空间","latestHealthFindings":"最新健康发现","allSystemsHealthy":"所有健康检查均已通过。","costSnapshot":"成本快照","namespaceInventory":"命名空间清单","configuredNamespaces":"已配置","discoveredNamespaces":"已发现","trackedNamespaces":"已跟踪","recentActivity":"近期活动","deploymentReadiness":"部署就绪情况","loadingCostDetails":"正在加载命名空间成本详情…","costSources":{"tracked":"已跟踪","json":"json","text":"text","telemetry":"遥测","unavailable":"不可用"},"name":"名称","namespace":"命名空间","ready":"就绪","status":"状态","noDeploymentsFound":"未找到部署。","noRecentEvents":"暂无近期事件。部署一个 Agent 团队以查看活动。"},"activity":{"title":"活动日志","description":"跟踪所有操作 — 部署、扩缩容、销毁和配置变更。","total":"总计","activities":"条活动","today":"今日","deploys":"次部署","destroys":"次销毁","searchActivities":"搜索活动…","allTypes":"所有类型","sortOrder":"排序方式","newestFirst":"最新优先","oldestFirst":"最早优先","noActivityRecorded":"暂无活动记录","operationsWillAppear":"部署、销毁和扩缩容等操作将自动记录在此。","noActivitiesMatch":"没有匹配筛选条件的活动。","showingMostRecent":"显示最近 100 条活动记录。","types":{"deploy":"部署","destroy":"销毁","scale":"扩缩容","config_update":"配置更新","cluster_add":"集群添加","cluster_remove":"集群移除","envvar_update":"环境变量更新","template_approved":"模板审核通过","template_rejected":"模板审核驳回","billing_deduct":"扣费","template_submit":"模板提交","template_update":"模板更新","template_delete":"模板删除","config":"配置","init":"初始化","settings":"设置"},"meta":{"namespace":"命名空间","template":"模板","template_slug":"模板","task_id":"任务","deployment_id":"部署","cluster_id":"集群","config_id":"配置","user_id":"用户","resource_tier":"资源等级","monthly_cost":"月费","hourly_cost":"小时费","billing_precision_minutes":"计费精度(分钟)","key":"环境变量","count":"数量","name":"名称","was_approved":"已审核通过","redeploy_from":"重新部署自"}},"settings":{"appearance":"外观","providers":"服务商","pageDescription":"主题、语言、服务商和系统偏好设置。","configureLLMProviders":"配置 LLM 服务商和 API 密钥以用于 Agent 部署。","configureProvidersMetadata":"在这里配置服务商元数据,敏感凭据请放到“密钥与环境变量”页面。","themeSection":"主题","themeSectionDescription":"选择当前浏览器中的控制台外观。","languageSection":"语言","languageSectionDescription":"选择控制台界面使用的语言。","languageEnglish":"English","languageChinese":"简体中文","addProvider":"添加服务商","noProvidersConfigured":"尚未配置服务商。添加一个以开始使用。","apiKey":"API 密钥","baseUrl":"基础 URL","secretEnvKey":"密钥环境变量名","credentialsManagedInSecrets":"敏感凭据现在通过“密钥与环境变量”进行管理,不再写入 settings.json。","credentialsMoveNotice":"服务商 API Key 现在作为加密环境值管理。请在“密钥与环境变量”页面中添加如 OPENAI_API_KEY 这样的键。","saveSettings":"保存设置","settingsSaved":"设置已保存","settingsSaveFailed":"保存设置失败","updatedProviderSettings":"已更新服务商设置","configuredProviders":"已配置 {{count}} 个服务商","system":"系统","apiStatus":"API 状态","healthy":"健康","unknown":"未知","doctorChecks":"诊断检查","passing":"通过","dashboardPort":"仪表盘端口","apiEndpoint":"API 端点","environment":"环境","userAgent":"用户代理","language":"语言","timezone":"时区","about":"关于","consoleTagline":"AI Agent 集群管理平台","aboutDescription":"Shadow Cloud 控制台为 Kubernetes 上的 AI Agent 集群提供全生命周期管理。通过直观的云原生界面部署、监控、扩缩和管理你的 Agent 团队。","platform":"平台","interface":"界面","consoleWeb":"控制台(Web)","license":"许可证","quickLinks":"快速链接","gitHubRepository":"GitHub 仓库 →","documentation":"文档 →","plugins":"插件","pluginsAvailable":"个可用插件","enabled":"已启用","shown":"已显示","skills":"技能","cli":"CLI","mcp":"MCP","channel":"通道","configuration":"配置","searchPlugins":"搜索插件…","allCategories":"所有分类","developer":"开发者","community":"社区","communityDescription":"连接到 Shadow 社区中心,浏览并 Fork 社区分享的模版。","communityServer":"服务器配置","communityBaseUrl":"社区服务器地址","communityBaseUrlHint":"Shadow 社区服务器的 URL,默认为 https://shadowob.com。","communityToken":"访问令牌","communityTokenSet":"已设置","communityTokenPlaceholder":"粘贴您的令牌...","communityTokenHint":"社区服务器的个人访问令牌。如需通过 OAuth 授权,可留空。","communityConnected":"已连接到社区","communityNotConnected":"未连接","communitySaved":"社区设置已保存。","communityOAuth":"通过 OAuth 授权","communityOAuthHint":"弹出社区服务器页面,使用您的账号授权。","communityOAuthSuccess":"已通过 OAuth 成功连接。","communityOAuthError":"OAuth 授权失败,请重试。","connectViaOAuth":"通过 OAuth 连接","communityBrowse":"访问社区","communityBrowseHint":"在社区服务器上浏览完整的模版目录。","openCommunity":"打开社区"},"deployTask":{"title":"部署任务","description":"跟踪部署任务直到完成,并通过固定 URL 随时重新打开它。","loading":"正在加载部署任务…","taskNotFound":"未找到部署任务","taskNotFoundDescription":"请求的部署任务不存在,或已经被移除。","invalidTaskId":"部署任务 URL 无效。","backToStore":"返回商店","refresh":"刷新","copyLink":"复制链接","linkCopied":"已复制部署任务链接","linkCopyFailed":"复制部署任务链接失败","openClusters":"打开集群页","openTask":"打开部署任务","openTaskDescription":"恢复实时进度,并在之后重新查看完整部署日志。","listTitle":"部署任务","listDescription":"集中查看正在运行和已完成的部署,并从一个页面重新打开任何任务。","noTasks":"还没有部署任务","noTasksDescription":"从商店发起一次部署后,它就会出现在这里。","openStore":"打开商店","runningTasks":"运行中的任务","totalTasks":"任务总数","taskHistory":"任务历史","activeNow":"当前活跃","taskId":"任务 ID","template":"模板","namespace":"命名空间","taskUrl":"任务 URL","created":"创建时间","updated":"更新时间","streamStatus":"流状态","error":"任务错误","logs":"日志","logDescription":"会先回放历史日志,任务仍在运行时会自动继续实时输出。","waitingForLogs":"等待部署输出…","liveStreaming":"实时流","logReplay":"可回放","runningMessage":"部署进行中","runningDescription":"你可以随时离开此页面,之后再通过同一个 URL 返回。","destroyRunningMessage":"销毁进行中","destroySuccessMessage":"销毁已完成","destroySuccessDescription":"Pulumi 已完成销毁,并确认命名空间已经移除。","blockedBy":"等待任务","blockedByDescription":"正在等待 #{{id}}({{status}})完成后继续。","openBlockingTask":"打开阻塞任务","cancelTask":"取消任务","cancelTaskDescription":"请求取消此部署任务。排队中的任务会立即停止,正在运行的 Pulumi 操作会收到协作式取消信号。","cancelRequested":"已请求取消任务","cancelFailed":"取消部署任务失败","successMessage":"部署已成功完成","successDescription":"完整任务历史会保留在这里,方便之后复查。","failedMessage":"部署失败","failedDescription":"失败原因和完整日志都会保留在这里,便于排查。","statuses":{"pending":"排队中","running":"运行中","deploying":"部署中","cancelling":"取消中","deployed":"已部署","failed":"失败","destroying":"销毁中","destroyed":"已销毁"},"streamStatuses":{"idle":"空闲","connecting":"连接中","connected":"已连接","done":"已完成","error":"错误"},"redeploy":"重新部署","rollback":"回滚","rollbackConfirm":"再次点击确认回滚"},"validate":{"title":"校验配置","description":"粘贴或编辑 shadowob-cloud.json 配置进行校验。","pasteConfig":"在此粘贴你的 shadowob-cloud.json…","loadTemplate":"加载模板","validating":"校验中…","validationPassedToast":"校验通过:{{agents}} 个 Agent","validationFailedToast":"校验失败:{{count}} 个违规项","invalidJsonCannotValidate":"JSON 无效,无法校验","validationError":"校验错误","configValid":"配置有效!","configHasIssues":"配置存在问题","agents":"Agent","configurations":"配置项","templateRefs":"模板引用","env":"环境变量","secret":"密钥","file":"文件","inlineApiKeys":"内联 API 密钥:","prefixLabel":"前缀","extendsErrors":"继承错误:","templateLoaded":"模板已加载"},"theme":{"light":"浅色","dark":"深色","system":"跟随系统"},"errorBoundary":{"title":"出了点问题"},"confirmDialog":{"typeToConfirm":"输入 {{text}} 以确认:"},"community":{"title":"社区模版","description":"浏览 Shadow 社区分享的模版。","searchPlaceholder":"搜索社区模版...","forkToLocal":"Fork 到本地","forking":"Fork 中...","forkSuccess":"已将 \\"{{name}}\\" Fork 到您的模版。","forkError":"Fork 模版失败,请重试。","noTemplates":"未找到模版","noTemplatesHint":"尝试其他搜索词,或检查社区服务器连接配置。","errorTitle":"无法加载社区模版","errorHint":"请在 设置 → 社区 中检查社区服务器地址和令牌。","configure":"配置"},"wallet":{"title":"钱包与账单","description":"虾币余额和消费流水记录。","currentBalance":"当前余额","shrimpCoins":"虾币","topUp":"充值","topUpSuccess":"充值成功!已充入 10,000 虾币。","topUpFailed":"充值失败,请重试。","transactionHistory":"交易记录","noTransactions":"暂无交易记录","noTransactionsDesc":"部署应用后,交易记录将在此显示。","txType":"类型","txNote":"说明","txAmount":"金额","txBalance":"余额","txDate":"时间","page":"第 {{current}} / {{total}} 页","txTypes":{"topup":"充值","purchase":"消费","refund":"退款","reward":"奖励","transfer":"转账","adjustment":"调整","settlement":"结算","cloud_deploy":"部署","cloud_hourly":"用量计费"}}}');d.Ay.isInitialized?(d.Ay.addResourceBundle("en","translation",p,!0,!1),d.Ay.addResourceBundle("zh-CN","translation",u,!0,!1)):d.Ay.use(c.A).use(m.r9).init({resources:{en:{translation:p},"zh-CN":{translation:u}},fallbackLng:"en",interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"],lookupLocalStorage:"shadow-cloud-lang"}});let x=d.Ay;var g=s(55168),y=s(4478);let h=(0,g.v)()((0,y.Zr)(e=>({theme:"dark",setTheme:t=>e({theme:t})}),{name:"shadow-cloud-theme"}));function b(e){let t="system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;document.documentElement.classList.toggle("dark","dark"===t),document.documentElement.classList.toggle("light","light"===t)}var f=s(24781),v=s(96555),j=s(55972),N=s(16112),k=s(37060),w=s(96264),C=s(63499),S=s(70851),A=s(64840);function T(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,A.QP)((0,S.$)(t))}let D=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(w.q7,{ref:t,className:T("border-b border-border-subtle bg-bg-secondary/30 rounded-2xl overflow-hidden mb-2 last:mb-0",s),...r})});D.displayName="AccordionItem";let P=l.forwardRef((e,t)=>{let{className:s,children:r,icon:n,...i}=e;return(0,a.jsx)(w.Y9,{className:"flex",children:(0,a.jsxs)(w.l9,{ref:t,className:T("flex flex-1 items-center justify-between p-6 text-sm font-black uppercase tracking-tight transition-all hover:bg-bg-tertiary [&[data-state=open]>svg]:rotate-180",s),...i,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 text-left",children:[n&&(0,a.jsx)(n,{className:"h-5 w-5 text-primary shrink-0",strokeWidth:3}),r]}),(0,a.jsx)(C.A,{className:"h-4 w-4 shrink-0 transition-transform duration-200 text-text-muted ml-4"})]})})});P.displayName=w.l9.displayName;let _=l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsx)(w.UC,{ref:t,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:(0,a.jsx)("div",{className:T("px-6 pb-6 pt-0 font-bold text-text-secondary leading-relaxed",s),children:r})})});_.displayName=w.UC.displayName,l.forwardRef((e,t)=>{let{title:s,icon:r,children:n,...i}=e;if(s){if("single"===i.type){let{type:e,collapsible:l,...o}=i;return(0,a.jsx)(w.bL,{ref:t,type:"single",collapsible:!0,...o,children:(0,a.jsxs)(D,{value:"item-1",children:[(0,a.jsx)(P,{icon:r,children:s}),(0,a.jsx)(_,{children:n})]})})}let{type:e,...l}=i;return(0,a.jsx)(w.bL,{ref:t,type:"multiple",...l,children:(0,a.jsxs)(D,{value:"item-1",children:[(0,a.jsx)(P,{icon:r,children:s}),(0,a.jsx)(_,{children:n})]})})}return i.type,(0,a.jsx)(w.bL,{ref:t,...i})}).displayName="Accordion";var R=s(15445);let F=(0,R.F)("relative w-full rounded-[24px] border p-5 [&>svg~div]:pl-9 [&>svg]:absolute [&>svg]:left-5 [&>svg]:top-5 [&>svg]:text-text-primary shadow-sm backdrop-blur-md",{variants:{variant:{default:"bg-bg-secondary/80 border-border-subtle text-text-primary",destructive:"border-danger/30 bg-danger/5 text-danger [&>svg]:text-danger shadow-[0_0_15px_rgba(233,69,96,0.1)]",success:"border-success/30 bg-success/5 text-success [&>svg]:text-success shadow-[0_0_15px_rgba(87,242,135,0.1)]",info:"border-primary/30 bg-primary/5 text-primary [&>svg]:text-primary shadow-[0_0_15px_rgba(0,209,255,0.1)]",warning:"border-warning/30 bg-warning/5 text-warning [&>svg]:text-warning shadow-[0_0_15px_rgba(250,176,5,0.1)]"}},defaultVariants:{variant:"default"}});l.forwardRef((e,t)=>{let{className:s,variant:r,...n}=e;return(0,a.jsx)("div",{ref:t,role:"alert",className:T(F({variant:r}),s),...n})}).displayName="Alert",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("h5",{ref:t,className:T("mb-1 font-black leading-none uppercase tracking-tight",s),...r})}).displayName="AlertTitle",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("text-sm font-bold opacity-80 italic [&_p]:leading-relaxed",s),...r})}).displayName="AlertDescription";var z=s(48627),I=s(51810);let E=(0,R.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap font-black uppercase tracking-widest transition-all duration-500 disabled:pointer-events-none disabled:opacity-50 active:scale-95 shrink-0 select-none backdrop-blur-xl",{variants:{variant:{primary:"bg-gradient-to-br from-[#00F3FF] to-[#00c6d1] text-[#050508] border-none shadow-[0_10px_25px_rgba(0,198,209,0.35),inset_0_2px_4px_rgba(255,255,255,0.7)] dark:shadow-[0_10px_25px_rgba(0,243,255,0.4),inset_0_2px_4px_rgba(255,255,255,0.5)] hover:shadow-[0_12px_32px_rgba(0,198,209,0.5),inset_0_2px_4px_rgba(255,255,255,0.7)] dark:hover:shadow-[0_12px_32px_rgba(0,243,255,0.6),inset_0_2px_4px_rgba(255,255,255,0.5)] hover:-translate-y-1",secondary:"bg-gradient-to-br from-[#F8E71C] to-[#ffb300] text-[#050508] border-none shadow-[0_10px_25px_rgba(248,231,28,0.35),inset_0_2px_4px_rgba(255,255,255,0.7)] dark:shadow-[0_10px_25px_rgba(248,231,28,0.3),inset_0_2px_4px_rgba(255,255,255,0.5)] hover:shadow-[0_12px_32px_rgba(248,231,28,0.5),inset_0_2px_4px_rgba(255,255,255,0.7)] dark:hover:shadow-[0_12px_32px_rgba(248,231,28,0.5),inset_0_2px_4px_rgba(255,255,255,0.5)] hover:-translate-y-1",accent:"bg-gradient-to-br from-[#00F3FF] to-[#00a3b0] text-[#050508] border-none shadow-[0_10px_25px_rgba(0,198,209,0.4),inset_0_2px_4px_rgba(255,255,255,0.5)] hover:shadow-[0_12px_32px_rgba(0,243,255,0.6),inset_0_2px_4px_rgba(255,255,255,0.5)] hover:-translate-y-1",danger:"bg-gradient-to-br from-[#FF2A55] to-[#E11D48] text-white border-none shadow-[0_10px_25px_rgba(255,42,85,0.4),inset_0_2px_4px_rgba(255,255,255,0.3)] hover:shadow-[0_12px_32px_rgba(255,42,85,0.6),inset_0_2px_4px_rgba(255,255,255,0.3)] hover:-translate-y-1",glass:"bg-white/5 dark:bg-white/5 text-text-primary border border-white/10 hover:bg-white/10 shadow-[0_8px_32px_rgba(0,0,0,0.1),inset_0_1px_1px_rgba(255,255,255,0.05)] hover:-translate-y-0.5",ghost:"bg-transparent text-text-muted hover:text-text-primary hover:bg-black/5 dark:hover:bg-white/5 border border-transparent shadow-none",outline:"bg-transparent text-primary border border-primary/30 hover:border-primary hover:bg-primary/5 shadow-none"},size:{xs:"h-7 px-3 text-[10px] rounded-full gap-1",sm:"h-9 px-4 text-xs rounded-full gap-1.5",md:"h-11 px-6 text-sm rounded-full gap-2",lg:"h-14 px-10 text-base rounded-full gap-2.5",xl:"h-16 px-12 text-lg rounded-full gap-3",icon:"h-11 w-11 rounded-full"}},defaultVariants:{variant:"primary",size:"md"}}),L=l.forwardRef((e,t)=>{let{className:s,variant:r,size:n,asChild:i=!1,loading:l,icon:o,iconRight:d,children:c,...m}=e,p=i?I.DX:"button";return(0,a.jsxs)(p,{className:T(E({variant:r,size:n,className:s}),"bouncy"),ref:t,disabled:m.disabled||l,...m,children:[l?(0,a.jsx)("div",{className:"w-4 h-4 border-2 border-current border-t-transparent rounded-full animate-spin mr-2"}):o?(0,a.jsx)(o,{size:18,className:"shrink-0",strokeWidth:2.5}):null,(0,a.jsx)(I.xV,{children:c}),d&&(0,a.jsx)(d,{size:18,className:"shrink-0 ml-1",strokeWidth:2.5})]})});L.displayName="Button";let U=z.bL;z.l9;let O=z.ZL,$=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(z.hJ,{className:T("fixed inset-0 z-50 bg-bg-deep/80 backdrop-blur-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...r,ref:t})});$.displayName=z.hJ.displayName;let M=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsxs)(O,{children:[(0,a.jsx)($,{}),(0,a.jsx)(z.UC,{ref:t,className:T("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[50%] gap-6 border border-border-subtle bg-bg-secondary p-10 shadow-[0_32px_120px_rgba(0,0,0,0.5)] duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-[48px]",s),...r})]})});M.displayName=z.UC.displayName;let V=e=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:T("flex flex-col space-y-2 text-center sm:text-left",t),...s})};V.displayName="AlertDialogHeader";let q=e=>{let{className:t,...s}=e;return(0,a.jsx)("div",{className:T("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3",t),...s})};q.displayName="AlertDialogFooter";let B=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(z.hE,{ref:t,className:T("text-2xl font-black uppercase tracking-tight text-text-primary",s),...r})});B.displayName=z.hE.displayName;let K=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(z.VY,{ref:t,className:T("text-sm font-bold text-text-muted italic opacity-80",s),...r})});K.displayName=z.VY.displayName;let H=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(z.rc,{ref:t,className:T(E(),"rounded-2xl",s),...r})});H.displayName=z.rc.displayName;let W=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(z.ZD,{ref:t,className:T(E({variant:"secondary"}),"rounded-2xl mt-2 sm:mt-0",s),...r})});W.displayName=z.ZD.displayName,s(4494).b;var J=s(97015);let Q=[{body:"#2d2d30",stroke:"#1a1a1c",earInner:"#3d3d40",eyeL:"#f8e71c",eyeR:"#00f3ff",nose:"#3a2a26"},{body:"#e8842c",stroke:"#1a1a1c",earInner:"#f5a623",eyeL:"#4ade80",eyeR:"#4ade80",nose:"#d46b1a"},{body:"#e8e8e8",stroke:"#a0a0a0",earInner:"#ffc0cb",eyeL:"#60a5fa",eyeR:"#60a5fa",nose:"#f5a0b0"},{body:"#7a7a80",stroke:"#4a4a50",earInner:"#9a9aa0",eyeL:"#fbbf24",eyeR:"#fbbf24",nose:"#5a4a46"},{body:"#2d2d30",stroke:"#1a1a1c",earInner:"#e0e0e0",eyeL:"#22c55e",eyeR:"#22c55e",nose:"#3a2a26"},{body:"#d4a574",stroke:"#8b6914",earInner:"#e8c9a0",eyeL:"#d97706",eyeR:"#d97706",nose:"#a0705a"},{body:"#6b8094",stroke:"#3d5060",earInner:"#8ba0b4",eyeL:"#22c55e",eyeR:"#22c55e",nose:"#5a6a76"},{body:"#f472b6",stroke:"#be185d",earInner:"#f9a8d4",eyeL:"#a855f7",eyeR:"#c084fc",nose:"#d44a8c"}].map(e=>{let t=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M22,45 Q15,22 28,22 Q34,22 40,38" fill="${e.body}" stroke="${e.stroke}" stroke-width="2.5" stroke-linecap="round"/><path d="M78,45 Q85,22 72,22 Q66,22 60,38" fill="${e.body}" stroke="${e.stroke}" stroke-width="2.5" stroke-linecap="round"/><path d="M26,38 Q22,26 29,26 Q33,26 36,34" fill="${e.earInner}" opacity="0.5"/><path d="M74,38 Q78,26 71,26 Q67,26 64,34" fill="${e.earInner}" opacity="0.5"/><ellipse cx="50" cy="58" rx="36" ry="28" fill="${e.body}" stroke="${e.stroke}" stroke-width="2.5"/><circle cx="35" cy="52" r="7" fill="${e.eyeL}" stroke="${e.stroke}" stroke-width="1.5"/><circle cx="33" cy="49" r="2.5" fill="white"/><circle cx="65" cy="52" r="7" fill="${e.eyeR}" stroke="${e.stroke}" stroke-width="1.5"/><circle cx="63" cy="49" r="2.5" fill="white"/><ellipse cx="50" cy="62" rx="3.5" ry="2.2" fill="${e.nose}"/><path d="M42,67 Q46,72 50,67" fill="none" stroke="${e.stroke}" stroke-width="2" stroke-linecap="round"/><path d="M50,67 Q54,72 58,67" fill="none" stroke="${e.stroke}" stroke-width="2" stroke-linecap="round"/></svg>`;return`data:image/svg+xml,${encodeURIComponent(t)}`});l.forwardRef((e,t)=>{let{className:s,userId:r,avatarUrl:n,displayName:i,status:l,size:o="md",...d}=e,c={online:"bg-success shadow-[0_0_10px_rgba(0,230,118,0.6)]",running:"bg-success shadow-[0_0_10px_rgba(0,230,118,0.6)]",idle:"bg-warning shadow-[0_0_10px_rgba(255,145,0,0.4)]",dnd:"bg-danger shadow-[0_0_10px_rgba(255,42,85,0.4)]",error:"bg-danger shadow-[0_0_10px_rgba(255,42,85,0.4)]",offline:"bg-text-muted"};return(0,a.jsxs)("div",{className:T("relative inline-block shrink-0 select-none",{xs:"w-6 h-6",sm:"w-8 h-8",md:"w-11 h-11",lg:"w-16 h-16",xl:"w-24 h-24"}[o],s),children:[(0,a.jsxs)(J.bL,{ref:t,className:T("relative flex h-full w-full shrink-0 overflow-hidden rounded-full border border-border-subtle bg-bg-tertiary shadow-xl"),...d,children:[(0,a.jsx)(J._V,{src:n||(r?function(e){var t;let s=0;for(let t=0;t<e.length;t++)s=(s<<5)-s+e.charCodeAt(t)|0;return t=Math.abs(s)%Q.length,Q[t%Q.length]}(r):void 0),className:"aspect-square h-full w-full object-cover"}),(0,a.jsx)(J.H4,{className:"flex h-full w-full items-center justify-center rounded-full bg-bg-tertiary text-text-muted font-black uppercase text-[0.6em]",children:(null==i?void 0:i.slice(0,2))||(null==r?void 0:r.slice(0,2))||"?"})]}),l&&(0,a.jsx)("div",{className:T("absolute bottom-0 right-0 rounded-full border-2 border-bg-secondary ring-2 ring-bg-secondary z-10",{xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3.5 h-3.5",lg:"w-4.5 h-4.5 border-4",xl:"w-6 h-6 border-4"}[o],c[l]||c.offline)})]})}).displayName=J.bL.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(J._V,{ref:t,className:T("aspect-square h-full w-full",s),...r})}).displayName=J._V.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(J.H4,{ref:t,className:T("flex h-full w-full items-center justify-center rounded-full bg-muted",s),...r})}).displayName=J.H4.displayName;let G=(0,R.F)("inline-flex items-center rounded-full border font-black uppercase tracking-widest transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{primary:"border-primary/20 bg-primary/10 text-primary shadow-[0_0_10px_rgba(0,209,255,0.1)]",success:"border-success/20 bg-success/10 text-success shadow-[0_0_10px_rgba(87,242,135,0.1)]",warning:"border-warning/20 bg-warning/10 text-warning",danger:"border-danger/20 bg-danger/10 text-danger",info:"border-blue-500/20 bg-blue-500/10 text-blue-500",neutral:"border-border-subtle bg-bg-tertiary/50 text-text-muted"},size:{xs:"px-1.5 py-0.5 text-[9px]",sm:"px-2.5 py-0.5 text-[10px]",md:"px-3 py-1 text-xs"}},defaultVariants:{variant:"primary",size:"sm"}});function Y(e){let{className:t,variant:s,size:r,...n}=e;return(0,a.jsx)("div",{className:T(G({variant:s,size:r}),t),...n})}var Z=s(23029);s(39878);let X=l.forwardRef((e,t)=>{let{items:s,...r}=e;return(0,a.jsx)("nav",{ref:t,"aria-label":"breadcrumb",...r,children:s?(0,a.jsx)(ee,{children:s.map(e=>(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)(et,{children:e.href||e.onClick?(0,a.jsxs)(es,{href:e.href,onClick:t=>{e.onClick&&(t.preventDefault(),e.onClick())},children:[e.icon&&(0,a.jsx)(e.icon,{className:"mr-1 h-3 w-3 inline"}),e.label]}):(0,a.jsxs)(ea,{children:[e.icon&&(0,a.jsx)(e.icon,{className:"mr-1 h-3 w-3 inline"}),e.label]})}),s.indexOf(e)<s.length-1&&(0,a.jsx)(er,{})]},e.label))}):r.children})});X.displayName="Breadcrumb";let ee=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("ol",{ref:t,className:T("flex flex-wrap items-center gap-1.5 break-words text-sm text-text-muted",s),...r})});ee.displayName="BreadcrumbList";let et=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("li",{ref:t,className:T("inline-flex items-center gap-1.5",s),...r})});et.displayName="BreadcrumbItem";let es=l.forwardRef((e,t)=>{let{asChild:s,className:r,...n}=e,i=s?I.DX:"a";return(0,a.jsx)(i,{ref:t,className:T("transition-colors hover:text-text-primary font-bold uppercase tracking-widest text-[11px] cursor-pointer",r),...n})});es.displayName="BreadcrumbLink";let ea=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("span",{ref:t,"aria-current":"page",className:T("font-black text-primary uppercase tracking-widest text-[11px] outline-none",s),...r})});ea.displayName="BreadcrumbPage";let er=e=>{let{children:t,className:s,...r}=e;return(0,a.jsx)("li",{role:"presentation","aria-hidden":"true",className:T("[&>svg]:size-3.5 opacity-20",s),...r,children:t??(0,a.jsx)(Z.A,{})})};er.displayName="BreadcrumbSeparator",l.forwardRef((e,t)=>{let{className:s,variant:r="default",...n}=e;return(0,a.jsx)("div",{ref:t,className:T("flex items-center gap-1 p-1.5 border border-border-subtle rounded-[24px] shadow-2xl","default"===r?"bg-bg-secondary/90":"bg-bg-tertiary/50 backdrop-blur-xl",s),...n})}).displayName="ButtonGroup";let en=l.forwardRef((e,t)=>{let{className:s,variant:r="default",hoverable:n=!1,active:i=!1,...l}=e;return(0,a.jsx)("div",{ref:t,className:T("border transition-all duration-500 overflow-hidden",{default:"rounded-[40px] bg-bg-secondary border-border-subtle shadow-sm",surface:"rounded-3xl bg-bg-primary border-border-subtle shadow-md",glass:"rounded-[32px] bg-[rgba(255,255,255,0.75)] dark:bg-[rgba(255,255,255,0.03)] backdrop-blur-[32px] border-[var(--glass-line)] dark:border-[var(--glass-line)] dark:border-t-[var(--glass-line-strong)] shadow-[0_15px_45px_rgba(0,0,0,0.04),inset_0_2px_12px_rgba(255,255,255,0.8)] dark:shadow-[0_10px_40px_rgba(0,0,0,0.5)]",gradient:"rounded-3xl bg-gradient-to-br from-primary/10 via-bg-secondary to-bg-secondary border-primary/20 shadow-lg",danger:"rounded-3xl bg-danger/5 border-danger/20 shadow-sm",glassPanel:"rounded-3xl bg-[var(--glass-bg)] border-[var(--glass-line)] backdrop-blur-[48px] shadow-[inset_0_1px_0_0_var(--glass-line-soft),0_12px_48px_-12px_rgba(0,0,0,0.5)]",glassCard:"rounded-[32px] bg-[var(--glass-bg)] border-[var(--glass-line)] border-t-[var(--glass-line-strong)] backdrop-blur-[48px] shadow-[var(--shadow-soft)]",stat:"rounded-2xl bg-[var(--glass-bg)] border-[var(--glass-line)] backdrop-blur-[24px] shadow-[var(--shadow-soft)] hover:border-primary/20"}[r],i&&"border-primary/60 bg-bg-tertiary shadow-2xl scale-[1.02]",n&&"hover:border-primary/40 hover:bg-bg-tertiary hover:scale-[1.02] hover:shadow-2xl active:scale-[0.98]",s),...l})});en.displayName="Card",l.forwardRef((e,t)=>{let{className:s,subtitle:r,action:n,icon:i,children:l,...o}=e;return(0,a.jsx)("div",{ref:t,className:T("flex flex-col space-y-1.5 p-6 border-b border-border-subtle bg-bg-secondary/30",s),...o,children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[i&&(0,a.jsx)("div",{className:"w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center text-primary shrink-0",children:(0,a.jsx)(i,{size:20,strokeWidth:3})}),(0,a.jsxs)("div",{className:"flex flex-col space-y-1.5",children:[l,r&&(0,a.jsx)("p",{className:"text-sm font-bold italic text-text-muted opacity-60 m-0",children:r})]})]}),n&&(0,a.jsx)("div",{className:"shrink-0 ml-4",children:n})]})})}).displayName="CardHeader",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("h3",{ref:t,className:T("text-lg font-black leading-tight tracking-tight text-text-primary m-0",s),...r})}).displayName="CardTitle",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("p",{ref:t,className:T("text-sm font-bold italic text-text-muted opacity-60 m-0",s),...r})}).displayName="CardDescription",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("p-6 pt-0",s),...r})}).displayName="CardContent",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("flex items-center p-6 pt-0",s),...r})}).displayName="CardFooter";var ei=s(77123),el=s(42949);let eo=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ei.bL,{ref:t,className:T("peer h-6 w-6 shrink-0 rounded-lg border-2 border-border-subtle bg-bg-tertiary/50 shadow-inner transition-all focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/10 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:border-primary data-[state=checked]:text-bg-deep data-[state=checked]:shadow-[0_0_10px_rgba(0,209,255,0.3)]",s),...r,children:(0,a.jsx)(ei.C1,{className:T("flex items-center justify-center text-current"),children:(0,a.jsx)(el.A,{className:"h-4 w-4",strokeWidth:4})})})});eo.displayName=ei.bL.displayName;var ed=s(60305);ed.bL,ed.R6,ed.Ke;var ec=s(40623),em=s(6277),ep=s(52351),eu=s(21761);ep.l9;let ex=ep.ZL;ep.bm;let eg=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ep.hJ,{ref:t,className:T("fixed inset-0 z-[2147483000] bg-bg-deep/80 backdrop-blur-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...r})});eg.displayName=ep.hJ.displayName,l.forwardRef((e,t)=>{let{className:s,children:r,maxWidth:n,hideCloseButton:i=!1,...l}=e;return(0,a.jsxs)(ex,{children:[(0,a.jsx)(eg,{}),(0,a.jsxs)(ep.UC,{ref:t,className:T("fixed left-[50%] top-[50%] z-[2147483001] grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 rounded-[48px] border border-white dark:border-white/10 bg-[rgba(255,255,255,0.85)] dark:bg-bg-secondary/60 backdrop-blur-3xl p-10 shadow-[0_15px_45px_rgba(0,0,0,0.08)] dark:shadow-[0_32px_120px_rgba(0,0,0,0.5)] duration-300 ease-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-top-4 data-[state=open]:slide-in-from-top-4 motion-reduce:duration-0 motion-reduce:data-[state=open]:animate-none motion-reduce:data-[state=closed]:animate-none",n||"max-w-lg",s),...l,children:[r,!i&&(0,a.jsxs)(ep.bm,{className:"absolute right-5 top-5 z-20 rounded-2xl border border-black/5 bg-white/80 p-2.5 text-text-muted shadow-[0_10px_24px_rgba(15,23,42,0.12)] transition-all hover:-translate-y-0.5 hover:bg-white hover:text-text-primary dark:border-white/10 dark:bg-bg-secondary/80 dark:hover:bg-bg-secondary focus:outline-none disabled:pointer-events-none active:scale-95",children:[(0,a.jsx)(eu.A,{className:"h-5 w-5",strokeWidth:3}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}).displayName=ep.UC.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ep.hE,{ref:t,className:T("text-2xl font-black uppercase tracking-tight leading-none text-text-primary",s),...r})}).displayName=ep.hE.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ep.VY,{ref:t,className:T("text-sm font-bold text-text-muted italic opacity-80",s),...r})}).displayName=ep.VY.displayName,l.forwardRef((e,t)=>(0,a.jsx)(ec.uB,{ref:t,className:T("flex h-full w-full flex-col overflow-hidden rounded-[24px] bg-bg-secondary text-text-primary",e.className),...e})).displayName="Command",l.forwardRef((e,t)=>(0,a.jsxs)("div",{className:"flex items-center border-b border-border-subtle px-4","cmdk-input-wrapper":"",children:[(0,a.jsx)(em.A,{className:"mr-3 h-4 w-4 shrink-0 opacity-50",strokeWidth:3}),(0,a.jsx)(ec.uB.Input,{ref:t,className:T("flex h-12 w-full rounded-md bg-transparent py-3 text-sm font-bold outline-none placeholder:text-text-muted/40 disabled:cursor-not-allowed disabled:opacity-50",e.className),...e})]})).displayName="CommandInput",l.forwardRef((e,t)=>(0,a.jsx)(ec.uB.List,{ref:t,className:T("max-height-[300px] overflow-y-auto overflow-x-hidden p-2 custom-scrollbar",e.className),...e})).displayName="CommandList",l.forwardRef((e,t)=>(0,a.jsx)("div",{ref:t,className:T("py-10 text-center text-sm font-bold italic text-text-muted opacity-60",e.className),...e})).displayName="CommandEmpty",l.forwardRef((e,t)=>(0,a.jsx)(ec.uB.Group,{ref:t,className:T("overflow-hidden p-1 text-text-primary [&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-[10px] [&_[cmdk-group-heading]]:font-black [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-[0.2em] [&_[cmdk-group-heading]]:text-text-muted/50",e.className),...e})).displayName="CommandGroup",l.forwardRef((e,t)=>(0,a.jsx)(ec.uB.Separator,{ref:t,className:T("-mx-1 h-px bg-border-subtle opacity-50",e.className),...e})).displayName="CommandSeparator",l.forwardRef((e,t)=>(0,a.jsx)(ec.uB.Item,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl px-3 py-2.5 text-sm font-bold outline-none aria-selected:bg-primary aria-selected:text-bg-deep data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 transition-all active:scale-[0.98]",e.className),...e})).displayName="CommandItem";var ey=s(10524),eh=s(30877);ey.l9,ey.YJ,ey.ZL,ey.Pb,ey.z6,l.forwardRef((e,t)=>{let{className:s,inset:r,children:n,...i}=e;return(0,a.jsxs)(ey.ZP,{ref:t,className:T("flex cursor-default select-none items-center rounded-xl px-3 py-2 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[state=open]:bg-primary data-[state=open]:text-bg-deep transition-all",r&&"pl-8",s),...i,children:[n,(0,a.jsx)(Z.A,{className:"ml-auto h-4 w-4"})]})}).displayName=ey.ZP.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ey.G5,{ref:t,className:T("z-50 min-w-[8rem] overflow-hidden rounded-[24px] border border-border-subtle bg-bg-secondary/95 p-1 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.4)] backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",s),...r})}).displayName=ey.G5.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ey.ZL,{children:(0,a.jsx)(ey.UC,{ref:t,className:T("z-50 min-w-[12rem] overflow-hidden rounded-[24px] border border-border-subtle bg-bg-secondary/95 p-1 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.4)] backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",s),...r})})}).displayName=ey.UC.displayName,l.forwardRef((e,t)=>{let{className:s,inset:r,variant:n="default",label:i,icon:l,children:o,...d}=e;return(0,a.jsxs)(ey.q7,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl px-3 py-2.5 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all active:scale-[0.98] gap-2",r&&"pl-8","danger"===n&&"text-danger focus:bg-danger focus:text-white",s),...d,children:[l&&(0,a.jsx)(l,{size:16,strokeWidth:2.5}),i||o]})}).displayName=ey.q7.displayName,l.forwardRef((e,t)=>{let{className:s,children:r,checked:n,...i}=e;return(0,a.jsxs)(ey.H_,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl py-2 pl-8 pr-2 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all",s),checked:n,...i,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(ey.VF,{children:(0,a.jsx)(el.A,{className:"h-4 w-4",strokeWidth:4})})}),r]})}).displayName=ey.H_.displayName,l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(ey.hN,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl py-2 pl-8 pr-2 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all",s),...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(ey.VF,{children:(0,a.jsx)(eh.A,{className:"h-2 w-2 fill-current"})})}),r]})}).displayName=ey.hN.displayName,l.forwardRef((e,t)=>{let{className:s,inset:r,...n}=e;return(0,a.jsx)(ey.JU,{ref:t,className:T("px-3 py-2 text-[10px] font-black uppercase tracking-[0.2em] text-text-muted/50",r&&"pl-8",s),...n})}).displayName=ey.JU.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ey.wv,{ref:t,className:T("-mx-1 my-1 h-px bg-border-subtle opacity-50",s),...r})}).displayName=ey.wv.displayName;var eb=s(20979);let ef=eb._s.Portal,ev=l.forwardRef((e,t)=>(0,a.jsx)(eb._s.Overlay,{ref:t,className:T("fixed inset-0 z-50 bg-bg-deep/80 backdrop-blur-md",e.className),...e}));ev.displayName="DrawerOverlay",l.forwardRef((e,t)=>{let{children:s,...r}=e;return(0,a.jsxs)(ef,{children:[(0,a.jsx)(ev,{}),(0,a.jsxs)(eb._s.Content,{ref:t,className:T("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[48px] border border-border-subtle bg-bg-secondary p-6 shadow-[0_-32px_120px_rgba(0,0,0,0.5)] outline-none",r.className),...r,children:[(0,a.jsx)("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-bg-tertiary shadow-inner border border-border-subtle"}),s]})]})}).displayName="DrawerContent",l.forwardRef((e,t)=>(0,a.jsx)(eb._s.Title,{ref:t,className:T("text-2xl font-black uppercase tracking-tight leading-none text-text-primary",e.className),...e})).displayName="DrawerTitle",l.forwardRef((e,t)=>(0,a.jsx)(eb._s.Description,{ref:t,className:T("text-sm font-bold text-text-muted italic opacity-80",e.className),...e})).displayName="DrawerDescription";var ej=s(11151);ej.l9,ej.YJ,ej.ZL,ej.Pb,ej.z6,l.forwardRef((e,t)=>{let{className:s,inset:r,children:n,...i}=e;return(0,a.jsxs)(ej.ZP,{ref:t,className:T("flex cursor-default select-none items-center rounded-xl px-3 py-2 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[state=open]:bg-primary data-[state=open]:text-bg-deep transition-all",r&&"pl-8",s),...i,children:[n,(0,a.jsx)(Z.A,{className:"ml-auto h-4 w-4"})]})}).displayName=ej.ZP.displayName,l.forwardRef((e,t)=>{let{className:s,sideOffset:r=0,alignOffset:n=-4,...i}=e;return(0,a.jsx)(ej.ZL,{children:(0,a.jsx)(ej.G5,{ref:t,sideOffset:r,alignOffset:n,className:T("z-50 min-w-[8rem] overflow-hidden rounded-[24px] border border-border-subtle bg-bg-secondary/95 p-1 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.4)] backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",s),...i})})}).displayName=ej.G5.displayName,l.forwardRef((e,t)=>{let{className:s,sideOffset:r=4,...n}=e;return(0,a.jsx)(ej.ZL,{children:(0,a.jsx)(ej.UC,{ref:t,sideOffset:r,className:T("z-50 min-w-[12rem] overflow-hidden rounded-[24px] border border-border-subtle bg-bg-secondary/95 p-1 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.4)] backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",s),...n})})}).displayName=ej.UC.displayName,l.forwardRef((e,t)=>{let{className:s,inset:r,variant:n="default",...i}=e;return(0,a.jsx)(ej.q7,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl px-3 py-2.5 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all active:scale-[0.98]",r&&"pl-8","danger"===n&&"text-danger focus:bg-danger focus:text-white",s),...i})}).displayName=ej.q7.displayName,l.forwardRef((e,t)=>{let{className:s,children:r,checked:n,...i}=e;return(0,a.jsxs)(ej.H_,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl py-2 pl-8 pr-2 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all",s),checked:n,...i,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(ej.VF,{children:(0,a.jsx)(el.A,{className:"h-4 w-4",strokeWidth:4})})}),r]})}).displayName=ej.H_.displayName,l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(ej.hN,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl py-2 pl-8 pr-2 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all",s),...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(ej.VF,{children:(0,a.jsx)(eh.A,{className:"h-2 w-2 fill-current"})})}),r]})}).displayName=ej.hN.displayName,l.forwardRef((e,t)=>{let{className:s,inset:r,...n}=e;return(0,a.jsx)(ej.JU,{ref:t,className:T("px-3 py-2 text-[10px] font-black uppercase tracking-[0.2em] text-text-muted/50",r&&"pl-8",s),...n})}).displayName=ej.JU.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ej.wv,{ref:t,className:T("-mx-1 my-1 h-px bg-border-subtle opacity-50",s),...r})}).displayName=ej.wv.displayName;var eN=s(34892);function ek(e){let{title:t,description:s,icon:r,action:n,className:i=""}=e,l=r||eN.A;return(0,a.jsxs)("div",{className:T("flex flex-col items-center justify-center py-12 text-center",i),children:[(0,a.jsx)("div",{className:"mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg border border-border-subtle bg-bg-secondary/70 text-text-muted",children:(0,a.jsx)(l,{size:24,strokeWidth:1.8,"aria-hidden":"true"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-text-primary mb-2",children:t}),s&&(0,a.jsx)("p",{className:"text-sm text-text-muted max-w-sm mx-auto mb-6 leading-relaxed",children:s}),n]})}let ew={panel:{background:"color-mix(in srgb, var(--glass-bg) 78%, transparent)",border:"1px solid var(--glass-line)",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)",boxShadow:"var(--nf-shadow-card, var(--shadow-soft))",isolation:"isolate",contain:"paint"},surface:{background:"color-mix(in srgb, var(--glass-bg) 64%, transparent)",border:"1px solid var(--glass-line)",boxShadow:"var(--nf-shadow-soft, var(--shadow-soft))",contain:"paint",backdropFilter:"blur(20px)",WebkitBackdropFilter:"blur(20px)"},card:{border:"1px solid var(--glass-line)",borderTop:"1px solid var(--glass-line-strong)",boxShadow:"var(--nf-shadow-soft, var(--shadow-soft))",contain:"paint",isolation:"isolate"}},eC=l.forwardRef((e,t)=>{let{as:s="div",className:r,style:n,variant:i="panel",...l}=e;return(0,a.jsx)(s,{ref:t,className:T("card"===i?"relative isolate overflow-hidden rounded-[32px]":"rounded-3xl",r),style:{...ew[i],...n},...l})});eC.displayName="Glass";let eS=l.forwardRef((e,t)=>(0,a.jsx)(eC,{ref:t,variant:"panel",...e}));eS.displayName="GlassPanel";let eA=l.forwardRef((e,t)=>(0,a.jsx)(eC,{ref:t,variant:"surface",...e}));eA.displayName="GlassSurface";let eT=l.forwardRef((e,t)=>(0,a.jsx)(eC,{ref:t,variant:"card",...e}));eT.displayName="GlassCard",l.forwardRef((e,t)=>{let{as:s="div",className:r,style:n,...i}=e;return(0,a.jsx)(s,{ref:t,className:T("flex h-14 items-center px-6",r),style:{background:"color-mix(in srgb, var(--glass-bg) 78%, transparent)",backdropFilter:"blur(16px)",WebkitBackdropFilter:"blur(16px)",borderBottom:"1px solid var(--glass-line)",flexShrink:0,...n},...i})}).displayName="GlassHeader",l.forwardRef((e,t)=>{let{as:s="div",className:r,style:n,...i}=e;return(0,a.jsx)(s,{ref:t,className:T(r),style:{background:"color-mix(in srgb, var(--glass-bg) 82%, transparent)",border:"2px solid var(--color-border-subtle)",boxShadow:"inset 0 2px 4px color-mix(in srgb, var(--color-bg-deep) 45%, transparent)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",transition:"all 0.3s ease",...n},...i})}).displayName="InputValley";var eD=s(61493);function eP(e){let{status:t="online",size:s="md",className:r=""}=e,n={online:"bg-success shadow-[0_0_10px_rgba(87,242,135,0.6)]",running:"bg-success shadow-[0_0_10px_rgba(87,242,135,0.6)]",idle:"bg-warning shadow-[0_0_10px_rgba(250,176,5,0.4)]",dnd:"bg-danger shadow-[0_0_10px_rgba(240,56,71,0.4)]",error:"bg-danger shadow-[0_0_10px_rgba(240,56,71,0.4)]",offline:"bg-text-muted"},i=n[t]||n.offline;return(0,a.jsx)("div",{className:T("rounded-full shrink-0",i,{sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-4 h-4 border-[3px] border-bg-secondary"}[s],r)})}eD.bL,eD.l9,l.forwardRef((e,t)=>{let{className:s,align:r="center",sideOffset:n=4,...i}=e;return(0,a.jsx)(eD.UC,{ref:t,align:r,sideOffset:n,className:T("z-50 w-64 rounded-[24px] border border-border-subtle bg-bg-secondary/95 p-4 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.2)] backdrop-blur-xl outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",s),...i})}).displayName=eD.UC.displayName;let e_=l.forwardRef((e,t)=>{let{className:s,type:r,error:n,icon:i,label:o,id:d,...c}=e,m=l.useId(),p=d||m;return(0,a.jsxs)("div",{className:"relative group w-full space-y-2",children:[o&&(0,a.jsx)("label",{htmlFor:p,className:"block text-[11px] font-black uppercase text-text-muted tracking-[0.2em] ml-1",children:o}),(0,a.jsxs)("div",{className:"relative group w-full",children:[i&&(0,a.jsx)("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-text-muted group-focus-within:text-primary transition-colors",children:(0,a.jsx)(i,{size:18,strokeWidth:2.5})}),(0,a.jsx)("input",{id:p,type:r,className:T("flex h-12 w-full rounded-2xl border border-border-subtle/55 bg-bg-primary/45 px-4 py-0 text-sm font-bold text-text-primary outline-none shadow-[inset_0_1px_0_rgba(255,255,255,0.04)] transition-all placeholder:text-text-muted/35 disabled:cursor-not-allowed disabled:opacity-50","focus:border-primary/70 focus:bg-bg-primary/60 focus:shadow-[inset_0_1px_0_rgba(255,255,255,0.05),0_0_0_4px_rgba(0,198,209,0.12)]",i&&"pl-12",n&&"border-danger focus:border-danger focus:shadow-[0_0_0_4px_rgba(255,42,85,0.15)]",s),ref:t,...c})]})]})});e_.displayName="Input",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("flex items-center w-full gap-2",s),...r})}).displayName="InputGroup",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("span",{ref:t,className:T("flex items-center px-3 text-xs font-black uppercase tracking-widest text-text-muted",s),...r})}).displayName="InputGroupText",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("kbd",{ref:t,className:T("pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-border-subtle bg-bg-tertiary px-1.5 font-mono text-[10px] font-black uppercase text-text-muted opacity-100 shadow-sm",s),...r})}).displayName="Kbd";var eR=s(77194);let eF=(0,R.F)("text-[11px] font-black uppercase tracking-[0.2em] text-text-muted leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 select-none");l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(eR.b,{ref:t,className:T(eF(),s),...r})}).displayName=eR.b.displayName;var ez=s(48845);ez.YJ,ez.ZL,ez.Pb,ez.z6,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ez.bL,{ref:t,className:T("flex h-12 items-center space-x-1 rounded-2xl border border-border-subtle bg-bg-secondary/80 p-1 shadow-sm backdrop-blur-md",s),...r})}).displayName=ez.bL.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ez.l9,{ref:t,className:T("flex cursor-default select-none items-center rounded-xl px-3 py-1.5 text-sm font-black uppercase tracking-widest outline-none focus:bg-bg-tertiary data-[state=open]:bg-bg-tertiary data-[state=open]:text-primary transition-all",s),...r})}).displayName=ez.l9.displayName,l.forwardRef((e,t)=>{let{className:s,inset:r,children:n,...i}=e;return(0,a.jsxs)(ez.ZP,{ref:t,className:T("flex cursor-default select-none items-center rounded-xl px-2 py-1.5 text-sm font-bold outline-none focus:bg-primary focus:text-bg-deep data-[state=open]:bg-primary data-[state=open]:text-bg-deep transition-all",r&&"pl-8",s),...i,children:[n,(0,a.jsx)(Z.A,{className:"ml-auto h-4 w-4"})]})}).displayName=ez.ZP.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ez.G5,{ref:t,className:T("z-50 min-w-[8rem] overflow-hidden rounded-[24px] border border-border-subtle bg-bg-secondary/95 p-1 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.4)] backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",s),...r})}).displayName=ez.G5.displayName,l.forwardRef((e,t)=>{let{className:s,align:r="start",alignOffset:n=-4,sideOffset:i=8,...l}=e;return(0,a.jsx)(ez.ZL,{children:(0,a.jsx)(ez.UC,{ref:t,align:r,alignOffset:n,sideOffset:i,className:T("z-50 min-w-[12rem] overflow-hidden rounded-[24px] border border-border-subtle bg-bg-secondary/95 p-1 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.4)] backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",s),...l})})}).displayName=ez.UC.displayName,l.forwardRef((e,t)=>{let{className:s,inset:r,...n}=e;return(0,a.jsx)(ez.q7,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl px-2 py-1.5 text-sm font-bold outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all active:scale-[0.98]",r&&"pl-8",s),...n})}).displayName=ez.q7.displayName,l.forwardRef((e,t)=>{let{className:s,children:r,checked:n,...i}=e;return(0,a.jsxs)(ez.H_,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl py-1.5 pl-8 pr-2 text-sm font-bold outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all",s),checked:n,...i,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(ez.VF,{children:(0,a.jsx)(el.A,{className:"h-4 w-4",strokeWidth:4})})}),r]})}).displayName=ez.H_.displayName,l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(ez.hN,{ref:t,className:T("relative flex cursor-default select-none items-center rounded-xl py-1.5 pl-8 pr-2 text-sm font-bold outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all",s),...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(ez.VF,{children:(0,a.jsx)(eh.A,{className:"h-2 w-2 fill-current"})})}),r]})}).displayName=ez.hN.displayName,l.forwardRef((e,t)=>{let{className:s,inset:r,...n}=e;return(0,a.jsx)(ez.JU,{ref:t,className:T("px-2 py-1.5 text-[10px] font-black uppercase tracking-[0.2em] text-text-muted/50",r&&"pl-8",s),...n})}).displayName=ez.JU.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ez.wv,{ref:t,className:T("-mx-1 my-1 h-px bg-border-subtle opacity-50",s),...r})}).displayName=ez.wv.displayName;var eI=s(77708);let eE=l.createContext(null),eL=0,eU="",eO="";function e$(e){let{open:t,onClose:s,closeOnOverlayClick:r=!0,closeOnEscape:n=!0,children:i}=e,[o,d]=l.useState(!1);return(l.useEffect(()=>{d(!0)},[]),l.useEffect(()=>{if(!t)return;if("u">typeof document){if(0===eL){eU=document.body.style.overflow,eO=document.body.style.paddingRight;let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",e>0&&(document.body.style.paddingRight=`${e}px`)}eL+=1}let e=e=>{"Escape"===e.key&&n&&(null==s||s())};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e),"u">typeof document&&0===(eL=Math.max(0,eL-1))&&(document.body.style.overflow=eU,document.body.style.paddingRight=eO)}},[n,s,t]),o&&t&&!("u"<typeof document))?(0,eI.createPortal)((0,a.jsx)(eE.Provider,{value:{onClose:s},children:(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-bg-deep/70 backdrop-blur-md animate-in fade-in-0 duration-200",onClick:r?s:void 0,"aria-hidden":"true"}),(0,a.jsx)("div",{className:"relative z-10 flex h-full items-center justify-center p-4 md:p-6",children:i})]})}),document.body):null}let eM={sm:"max-w-md",md:"max-w-2xl",lg:"max-w-4xl",xl:"max-w-5xl"},eV=l.forwardRef((e,t)=>{let{className:s,size:r="md",maxWidth:n,children:i,...l}=e;return(0,a.jsx)("div",{ref:t,role:"dialog","aria-modal":"true",onClick:e=>e.stopPropagation(),className:T("relative flex w-full max-h-[calc(100vh-2rem)] flex-col overflow-hidden rounded-[36px] border border-border-subtle/80 bg-[var(--glass-bg)] text-text-primary shadow-[0_32px_120px_rgba(0,0,0,0.5)] backdrop-blur-[28px] animate-in fade-in-0 zoom-in-95 slide-in-from-bottom-4 duration-300 supports-[height:100dvh]:max-h-[calc(100dvh-2rem)]",n??eM[r],s),...l,children:i})});eV.displayName="ModalContent";let eq=l.forwardRef((e,t)=>{let{className:s,overline:r,icon:n,title:i,subtitle:o,action:d,onClose:c,closeLabel:m="Close",hideCloseButton:p=!1,...u}=e,x=l.useContext(eE),g=c??(null==x?void 0:x.onClose);return(0,a.jsxs)("div",{ref:t,className:T("flex items-start justify-between gap-4 border-b border-border-subtle/80 bg-bg-secondary/20 px-5 py-4 backdrop-blur-xl shrink-0",s),...u,children:[(0,a.jsxs)("div",{className:"min-w-0 flex items-start gap-3.5",children:[n&&(0,a.jsx)("div",{className:"mt-0.5 inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-2xl border border-primary/15 bg-primary/10 text-primary shadow-[0_14px_30px_rgba(0,198,209,0.12)]",children:n}),(0,a.jsxs)("div",{className:"min-w-0",children:[r&&(0,a.jsx)("p",{className:"text-[10px] font-black uppercase tracking-[0.24em] text-text-muted/50",children:r}),(0,a.jsx)("h2",{className:"truncate text-base font-black tracking-tight text-text-primary md:text-lg",children:i}),o&&(0,a.jsx)("p",{className:"mt-1 text-sm font-medium text-text-muted line-clamp-2",children:o})]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[d,!p&&g&&(0,a.jsx)("button",{type:"button",onClick:g,className:"inline-flex h-11 w-11 items-center justify-center rounded-2xl border border-border-subtle bg-[var(--glass-bg)] text-text-muted shadow-[var(--shadow-soft)] transition-all hover:-translate-y-0.5 hover:border-primary/25 hover:bg-bg-tertiary/60 hover:text-text-primary active:scale-95","aria-label":m,children:(0,a.jsx)(eu.A,{size:18,strokeWidth:2.6})})]})]})});eq.displayName="ModalHeader";let eB=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("section",{ref:t,className:T("flex-1 min-h-0 overflow-y-auto px-6 py-5",s),...r})});eB.displayName="ModalBody";let eK=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("flex items-center gap-3 border-t border-border-subtle/80 bg-bg-secondary/10 px-6 py-4 backdrop-blur-xl shrink-0",s),...r})});eK.displayName="ModalFooter";let eH=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("ml-auto flex flex-wrap items-center justify-end gap-3",s),...r})});eH.displayName="ModalButtonGroup";let eW=l.forwardRef((e,t)=>{let{className:s,error:r,children:n,...i}=e;return(0,a.jsxs)("div",{className:"relative group w-full",children:[(0,a.jsx)("select",{className:T("flex h-12 w-full cursor-pointer appearance-none rounded-2xl border border-border-subtle/55 bg-bg-primary/45 px-4 py-0 pr-11 text-sm font-bold text-text-primary outline-none shadow-[inset_0_1px_0_rgba(255,255,255,0.04)] transition-all placeholder:text-text-muted/35 disabled:cursor-not-allowed disabled:opacity-50","focus:border-primary/70 focus:bg-bg-primary/60 focus:shadow-[inset_0_1px_0_rgba(255,255,255,0.05),0_0_0_4px_rgba(0,198,209,0.12)]",r&&"border-danger focus:border-danger focus:shadow-[0_0_0_4px_rgba(255,42,85,0.15)]",s),ref:t,...i,children:n}),(0,a.jsx)("div",{className:"pointer-events-none absolute right-4 top-1/2 -translate-y-1/2 text-text-muted transition-colors group-focus-within:text-primary",children:(0,a.jsx)(C.A,{size:16,strokeWidth:3})})]})});eW.displayName="NativeSelect";var eJ=s(85243);l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(eJ.bL,{ref:t,className:T("relative z-10 flex max-w-max flex-1 items-center justify-center",s),...n,children:[r,(0,a.jsx)(eG,{})]})}).displayName=eJ.bL.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(eJ.B8,{ref:t,className:T("group flex flex-1 list-none items-center justify-center space-x-1",s),...r})}).displayName=eJ.B8.displayName,eJ.q7;let eQ=(0,R.F)("group inline-flex h-10 w-max items-center justify-center rounded-xl bg-transparent px-4 py-2 text-sm font-black uppercase tracking-widest text-text-muted transition-all hover:bg-bg-secondary hover:text-primary focus:bg-bg-secondary focus:text-primary focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-bg-secondary/50 data-[state=open]:bg-bg-secondary/50");l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(eJ.l9,{ref:t,className:T(eQ(),"group",s),...n,children:[r,"",(0,a.jsx)(C.A,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}).displayName=eJ.l9.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(eJ.UC,{ref:t,className:T("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",s),...r})}).displayName=eJ.UC.displayName,eJ.N_;let eG=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{className:T("absolute left-0 top-full flex justify-center"),children:(0,a.jsx)(eJ.LM,{className:T("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-[24px] border border-border-subtle bg-bg-secondary/95 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.4)] backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",s),ref:t,...r})})});eG.displayName=eJ.LM.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(eJ.C1,{ref:t,className:T("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",s),...r,children:(0,a.jsx)("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border-subtle shadow-md"})})}).displayName=eJ.C1.displayName,s(4018),l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("ul",{ref:t,className:T("flex flex-row items-center gap-1 bg-bg-tertiary/50 p-1.5 rounded-[24px] border border-border-subtle shadow-inner",s),...r})}).displayName="PaginationContent",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("li",{ref:t,className:T("",s),...r})}).displayName="PaginationItem";var eY=s(13854);eY.bL,eY.l9,l.forwardRef((e,t)=>{let{className:s,align:r="center",sideOffset:n=4,...i}=e;return(0,a.jsx)(eY.ZL,{children:(0,a.jsx)(eY.UC,{ref:t,align:r,sideOffset:n,className:T("z-50 w-72 rounded-[24px] border border-border-subtle bg-bg-secondary/95 p-4 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.4)] backdrop-blur-xl outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",s),...i})})}).displayName=eY.UC.displayName;var eZ=s(126);l.forwardRef((e,t)=>{let{className:s,value:r,variant:n="primary",showLabel:i,...l}=e;return(0,a.jsxs)("div",{className:"w-full space-y-2",children:[(0,a.jsx)(eZ.bL,{ref:t,className:T("relative h-3 w-full overflow-hidden rounded-full bg-bg-tertiary shadow-inner border border-border-subtle",s),...l,children:(0,a.jsx)(eZ.C1,{className:T("h-full w-full flex-1 transition-all duration-1000 ease-out rounded-full",{primary:"bg-primary shadow-[0_0_15px_rgba(0,209,255,0.5)]",success:"bg-success shadow-[0_0_15px_rgba(87,242,135,0.5)]",accent:"bg-accent shadow-[0_0_15px_rgba(250,176,5,0.5)]",danger:"bg-danger shadow-[0_0_15px_rgba(240,56,71,0.5)]"}[n]),style:{transform:`translateX(-${100-(r||0)}%)`}})}),i&&(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsxs)("span",{className:"text-[10px] font-black uppercase tracking-widest text-text-muted opacity-60",children:[Math.round(r||0),"%"]})})]})}).displayName=eZ.bL.displayName;var eX=s(78697);l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(eX.bL,{className:T("grid gap-2",s),...r,ref:t})}).displayName=eX.bL.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(eX.q7,{ref:t,className:T("aspect-square h-5 w-5 rounded-full border-2 border-border-subtle bg-bg-tertiary shadow-inner text-primary transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-primary/10 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:shadow-[0_0_10px_rgba(0,209,255,0.2)]",s),...r,children:(0,a.jsx)(eX.C1,{className:"flex items-center justify-center",children:(0,a.jsx)(eh.A,{className:"h-2.5 w-2.5 fill-current text-current"})})})}).displayName=eX.q7.displayName;var e0=s(95557);l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(e0.bL,{ref:t,className:T("relative overflow-hidden",s),...n,children:[(0,a.jsx)(e0.LM,{className:"h-full w-full rounded-[inherit]",children:r}),(0,a.jsx)(e1,{}),(0,a.jsx)(e0.OK,{})]})}).displayName=e0.bL.displayName;let e1=l.forwardRef((e,t)=>{let{className:s,orientation:r="vertical",...n}=e;return(0,a.jsx)(e0.Ze,{ref:t,orientation:r,className:T("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2 flex-col border-t border-t-transparent p-[1px]",s),...n,children:(0,a.jsx)(e0.zi,{className:"relative flex-1 rounded-full bg-border-subtle hover:bg-text-muted/30 transition-all duration-300"})})});e1.displayName=e0.Ze.displayName;let e2=l.forwardRef((e,t)=>{let{className:s,onChange:r,...n}=e;return(0,a.jsxs)("div",{className:"relative group w-full",children:[(0,a.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-4 flex items-center text-text-muted group-focus-within:text-primary transition-colors",children:(0,a.jsx)(em.A,{size:18,strokeWidth:2.5})}),(0,a.jsx)("input",{type:"text",className:T("h-11 w-full bg-bg-tertiary/50 border border-border-subtle text-text-primary rounded-2xl pl-11 pr-4 py-0 text-sm font-bold outline-none transition-all placeholder:text-text-muted/30 focus:ring-4 focus:ring-primary/10 focus:bg-bg-primary focus:border-primary/30 shadow-inner",s),ref:t,onChange:e=>null==r?void 0:r(e.target.value),...n})]})});e2.displayName="Search";var e5=s(52876),e3=s(20640);let e4=l.forwardRef((e,t)=>{let{className:s,error:r,label:n,id:i,style:o,autoComplete:d,...c}=e,m=l.useId(),p=i||m,[u,x]=l.useState(!1);return(0,a.jsxs)("div",{className:"relative group w-full space-y-2",children:[n&&(0,a.jsx)("label",{htmlFor:p,className:"block text-[11px] font-black uppercase text-text-muted tracking-[0.2em] ml-1",children:n}),(0,a.jsxs)("div",{className:"relative group w-full",children:[(0,a.jsx)("input",{id:p,type:"text",className:T("flex h-12 w-full rounded-2xl border border-border-subtle/55 bg-bg-primary/45 px-4 py-0 pr-12 text-sm font-bold text-text-primary outline-none shadow-[inset_0_1px_0_rgba(255,255,255,0.04)] transition-all placeholder:text-text-muted/35 disabled:cursor-not-allowed disabled:opacity-50","focus:border-primary/70 focus:bg-bg-primary/60 focus:shadow-[inset_0_1px_0_rgba(255,255,255,0.05),0_0_0_4px_rgba(0,198,209,0.12)]",r&&"border-danger focus:border-danger focus:shadow-[0_0_0_4px_rgba(255,42,85,0.15)]",s),ref:t,autoComplete:d??"new-password",spellCheck:!1,autoCapitalize:"off",autoCorrect:"off","data-1p-ignore":!0,"data-lpignore":"true","data-bwignore":"true","data-form-type":"other",style:u?o:{...o,WebkitTextSecurity:"disc"},...c}),(0,a.jsx)("button",{type:"button","aria-label":u?"Hide secret value":"Show secret value",onClick:()=>x(e=>!e),className:"absolute right-2 top-1/2 inline-flex h-9 w-9 -translate-y-1/2 items-center justify-center rounded-xl border border-border-subtle/45 bg-bg-secondary/30 text-text-muted transition-colors hover:bg-bg-modifier-hover hover:text-text-primary",children:u?(0,a.jsx)(e5.A,{size:14}):(0,a.jsx)(e3.A,{size:14})})]})]})});e4.displayName="SecretInput";var e8=s(64858),e6=s(9678);let e9=e8.bL;e8.YJ;let e7=e8.WT,te=l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(e8.l9,{ref:t,className:T("flex h-12 w-full items-center justify-between rounded-2xl border border-border-subtle/55 bg-bg-primary/45 px-4 py-0 text-sm font-bold text-text-primary outline-none shadow-[inset_0_1px_0_rgba(255,255,255,0.04)] transition-all placeholder:text-text-muted/35 focus:border-primary/70 focus:bg-bg-primary/60 focus:shadow-[inset_0_1px_0_rgba(255,255,255,0.05),0_0_0_4px_rgba(0,198,209,0.12)] disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...n,children:[r,(0,a.jsx)(e8.In,{asChild:!0,children:(0,a.jsx)(C.A,{className:"h-4 w-4 opacity-50"})})]})});te.displayName=e8.l9.displayName;let tt=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(e8.PP,{ref:t,className:T("flex cursor-default items-center justify-center py-1",s),...r,children:(0,a.jsx)(e6.A,{className:"h-4 w-4"})})});tt.displayName=e8.PP.displayName;let ts=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(e8.wn,{ref:t,className:T("flex cursor-default items-center justify-center py-1",s),...r,children:(0,a.jsx)(C.A,{className:"h-4 w-4"})})});ts.displayName=e8.wn.displayName;let ta=l.forwardRef((e,t)=>{let{className:s,children:r,position:n="popper",...i}=e;return(0,a.jsx)(e8.ZL,{children:(0,a.jsxs)(e8.UC,{ref:t,className:T("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-2xl border border-border-subtle/60 bg-bg-secondary/95 text-text-primary shadow-[0_20px_60px_rgba(0,0,0,0.28)] backdrop-blur-xl data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...i,children:[(0,a.jsx)(tt,{}),(0,a.jsx)(e8.LM,{className:T("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,a.jsx)(ts,{})]})})});ta.displayName=e8.UC.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(e8.JU,{ref:t,className:T("px-3 py-2 text-[10px] font-black uppercase tracking-[0.2em] text-text-muted/50",s),...r})}).displayName=e8.JU.displayName;let tr=l.forwardRef((e,t)=>{let{className:s,children:r,...n}=e;return(0,a.jsxs)(e8.q7,{ref:t,className:T("relative flex w-full cursor-default select-none items-center rounded-xl px-3 py-2.5 text-sm font-bold uppercase tracking-widest outline-none focus:bg-primary focus:text-bg-deep data-[disabled]:pointer-events-none data-[disabled]:opacity-50 transition-all active:scale-[0.98]",s),...n,children:[(0,a.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(e8.VF,{children:(0,a.jsx)(el.A,{className:"h-4 w-4",strokeWidth:4})})}),(0,a.jsx)(e8.p4,{children:r})]})});tr.displayName=e8.q7.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(e8.wv,{ref:t,className:T("-mx-1 my-1 h-px bg-border-subtle opacity-50",s),...r})}).displayName=e8.wv.displayName;var tn=s(23130);l.forwardRef((e,t)=>{let{className:s,orientation:r="horizontal",decorative:n=!0,...i}=e;return(0,a.jsx)(tn.b,{ref:t,decorative:n,orientation:r,className:T("shrink-0 bg-border-subtle opacity-50","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",s),...i})}).displayName=tn.b.displayName;let ti=["bg-[#00c6d1]","bg-[#0891b2]","bg-[#06b6d4]","bg-[#00a3b0]","bg-[#ffb300]","bg-[#e0a800]","bg-[#1565c0]","bg-[#0d47a1]","bg-[#00897B]","bg-[#FF2A55]","bg-[#37474f]","bg-[#455a64]"],tl=l.forwardRef((e,t)=>{let{iconUrl:s,name:r,className:n,...i}=e;return(0,a.jsx)("div",{className:T("relative inline-block shrink-0 select-none w-[56px] h-[56px]",n),children:(0,a.jsxs)(J.bL,{ref:t,className:"relative flex h-full w-full shrink-0 overflow-hidden rounded-3xl border border-border-subtle bg-bg-tertiary shadow-xl",...i,children:[s&&(0,a.jsx)(J._V,{src:s,alt:r,className:"aspect-square h-full w-full object-cover"}),(0,a.jsx)(J.H4,{className:T("flex h-full w-full items-center justify-center rounded-3xl text-[#050508] font-bold text-[18px]",function(e){let t=0;for(let s=0;s<e.length;s++)t=e.charCodeAt(s)+((t<<5)-t);return ti[Math.abs(t)%ti.length]}(r)),children:r.charAt(0).toUpperCase()})]})})});tl.displayName="ServerAvatar",ep.bL,ep.l9,ep.bm;let to=ep.ZL,td=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ep.hJ,{className:T("fixed inset-0 z-50 bg-bg-deep/80 backdrop-blur-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",s),...r,ref:t})});td.displayName=ep.hJ.displayName;let tc=(0,R.F)("fixed z-50 gap-4 bg-bg-secondary/60 backdrop-blur-3xl p-10 shadow-[0_32px_120px_rgba(0,0,0,0.5)] transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500 border-white/10",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top rounded-b-[48px]",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom rounded-t-[48px]",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm rounded-r-[48px]",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm rounded-l-[48px]"}},defaultVariants:{side:"right"}});l.forwardRef((e,t)=>{let{side:s="right",className:r,children:n,...i}=e;return(0,a.jsxs)(to,{children:[(0,a.jsx)(td,{}),(0,a.jsxs)(ep.UC,{ref:t,className:T(tc({side:s}),r),...i,children:[n,(0,a.jsxs)(ep.bm,{className:"absolute right-6 top-6 rounded-2xl bg-white/10 p-2 text-text-muted opacity-70 transition-all hover:opacity-100 hover:bg-white/20 focus:outline-none disabled:pointer-events-none active:scale-90 border border-white/10",children:[(0,a.jsx)(eu.A,{className:"h-5 w-5",strokeWidth:3}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}).displayName=ep.UC.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ep.hE,{ref:t,className:T("text-2xl font-black uppercase tracking-tight text-text-primary",s),...r})}).displayName=ep.hE.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(ep.VY,{ref:t,className:T("text-sm font-bold text-text-muted italic opacity-80",s),...r})}).displayName=ep.VY.displayName;let tm=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("flex h-full w-[260px] flex-col bg-bg-secondary/30 border-r border-border-subtle overflow-hidden",s),...r})});tm.displayName="Sidebar";let tp=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("p-6 border-b border-border-subtle bg-bg-secondary/30",s),...r})});tp.displayName="SidebarHeader";let tu=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("flex-1 overflow-y-auto custom-scrollbar px-4 py-6 space-y-8",s),...r})});tu.displayName="SidebarContent";let tx=l.forwardRef((e,t)=>{let{className:s,active:r,icon:n,variant:i="default",asChild:l=!1,children:o,...d}=e,c=l?I.DX:"button",m={default:{base:"w-full flex items-center gap-3 px-3 py-2.5 rounded-2xl text-[14px] font-black transition-all duration-300 group select-none outline-none",active:"bg-primary text-bg-deep shadow-xl shadow-primary/20 scale-[1.02]",inactive:"text-text-secondary hover:bg-white/5 hover:text-text-primary",icon:r?"text-bg-deep":"text-text-muted group-hover:text-primary",pulse:"bg-bg-deep"},dashboard:{base:"w-full flex items-center gap-3 rounded-[20px] border px-3 py-2.5 text-sm font-semibold normal-case tracking-normal transition-colors duration-200 outline-none focus-visible:ring-2 focus-visible:ring-primary/30",active:"border-primary/20 bg-primary/10 text-text-primary shadow-[inset_0_1px_0_rgba(255,255,255,0.12),0_14px_28px_rgba(0,198,209,0.14)]",inactive:"border-transparent bg-transparent text-text-secondary hover:bg-bg-modifier-hover hover:text-text-primary",icon:r?"text-primary":"text-text-muted",pulse:"bg-primary"}}[i];return(0,a.jsx)(c,{ref:t,className:T(m.base,r?m.active:m.inactive,s),...!l?{type:"button"}:{},...d,children:l?o:(0,a.jsxs)(a.Fragment,{children:[n&&(0,a.jsx)(n,{size:"dashboard"===i?16:20,className:T("shrink-0 transition-colors",m.icon),strokeWidth:r?2.75:2.25}),(0,a.jsx)("span",{className:"truncate flex-1 text-left",children:o}),r&&"default"===i&&(0,a.jsx)("div",{className:T("w-1.5 h-1.5 rounded-full animate-pulse",m.pulse)})]})})});tx.displayName="SidebarItem",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("p-4 bg-bg-deep/20 border-t border-border-subtle mt-auto",s),...r})}).displayName="SidebarFooter";let tg=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:T("px-2 mb-2 text-[10px] font-black uppercase tracking-[0.2em] text-text-muted/50",s),...r})});tg.displayName="SidebarSectionLabel";var ty=s(74658);l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsxs)(ty.bL,{ref:t,className:T("relative flex w-full touch-none select-none items-center",s),...r,children:[(0,a.jsx)(ty.CC,{className:"relative h-2.5 w-full grow overflow-hidden rounded-full bg-bg-tertiary shadow-inner border border-border-subtle",children:(0,a.jsx)(ty.Q6,{className:"absolute h-full bg-primary shadow-[0_0_10px_rgba(0,209,255,0.4)]"})}),(0,a.jsx)(ty.zi,{className:"block h-6 w-6 rounded-full border-4 border-white bg-primary shadow-[0_4px_10px_rgba(0,0,0,0.2)] transition-all hover:scale-110 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/20 disabled:pointer-events-none disabled:opacity-50"})]})}).displayName=ty.bL.displayName;var th=s(55827);let tb=e=>{let{style:t,...s}=e;return(0,a.jsx)(th.l$,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-[rgba(18,18,26,0.96)] group-[.toaster]:text-text-primary group-[.toaster]:border-[rgba(255,255,255,0.12)] group-[.toaster]:shadow-[0_20px_60px_rgba(0,0,0,0.45)] group-[.toaster]:backdrop-blur-xl group-[.toaster]:rounded-[20px] group-[.toaster]:p-4",description:"group-[.toast]:text-text-muted",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-bg-deep group-[.toast]:font-black group-[.toast]:uppercase group-[.toast]:rounded-xl",cancelButton:"group-[.toast]:bg-bg-tertiary group-[.toast]:text-text-muted group-[.toast]:rounded-xl",success:"group-[.toaster]:!bg-[rgba(6,78,59,0.96)] group-[.toaster]:!border-[rgba(16,185,129,0.55)] group-[.toaster]:!text-[rgb(220,252,231)]",error:"group-[.toaster]:!bg-[rgba(127,29,29,0.96)] group-[.toaster]:!border-[rgba(248,113,113,0.58)] group-[.toaster]:!text-[rgb(254,226,226)]",info:"group-[.toaster]:!bg-[rgba(12,74,110,0.96)] group-[.toaster]:!border-[rgba(56,189,248,0.58)] group-[.toaster]:!text-[rgb(224,242,254)]",warning:"group-[.toaster]:!bg-[rgba(120,53,15,0.97)] group-[.toaster]:!border-[rgba(251,191,36,0.6)] group-[.toaster]:!text-[rgb(254,243,199)]"}},...s,style:{zIndex:0x7fffffd0,...t}})};var tf=s(90535);let tv=l.forwardRef((e,t)=>{let{className:s,enabled:r,checked:n,onCheckedChange:i,onChange:l,...o}=e;return(0,a.jsx)(tf.bL,{className:T("peer inline-flex h-7 w-12 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/10 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-bg-tertiary shadow-inner",s),checked:void 0!==r?r:n,onCheckedChange:l||i,...o,ref:t,children:(0,a.jsx)(tf.zi,{className:T("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});tv.displayName=tf.bL.displayName;let tj=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{className:"relative w-full overflow-auto custom-scrollbar",children:(0,a.jsx)("table",{ref:t,className:T("w-full caption-bottom text-sm",s),...r})})});tj.displayName="Table";let tN=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("thead",{ref:t,className:T("[&_tr]:border-b border-border-subtle bg-bg-secondary/50",s),...r})});tN.displayName="TableHeader";let tk=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("tbody",{ref:t,className:T("[&_tr:last-child]:border-0",s),...r})});tk.displayName="TableBody",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("tfoot",{ref:t,className:T("border-t bg-bg-secondary/50 font-black uppercase tracking-widest",s),...r})}).displayName="TableFooter";let tw=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("tr",{ref:t,className:T("border-b border-border-subtle transition-colors hover:bg-bg-tertiary/50 data-[state=selected]:bg-primary/5",s),...r})});tw.displayName="TableRow";let tC=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("th",{ref:t,className:T("h-12 px-4 text-left align-middle font-black uppercase tracking-[0.2em] text-text-muted text-[10px]",s),...r})});tC.displayName="TableHead";let tS=l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("td",{ref:t,className:T("p-4 align-middle font-bold text-text-primary",s),...r})});tS.displayName="TableCell",l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("caption",{ref:t,className:T("mt-4 text-sm text-text-muted italic",s),...r})}).displayName="TableCaption";var tA=s(28654);let tT=l.forwardRef((e,t)=>{let{onValueChange:s,onChange:r,...n}=e;return(0,a.jsx)(tA.bL,{ref:t,onValueChange:e=>{null==s||s(e),null==r||r(e)},...n})});tT.displayName=tA.bL.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(tA.B8,{ref:t,className:T("inline-flex h-12 items-center justify-center rounded-[28px] bg-[var(--glass-bg)] p-1.5 border border-[var(--glass-line)] shadow-[inset_0_1px_0_var(--glass-line-soft)] backdrop-blur-[20px]",s),...r})}).displayName=tA.B8.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(tA.l9,{ref:t,className:T("inline-flex items-center justify-center whitespace-nowrap rounded-[20px] px-6 py-2 text-sm font-black uppercase tracking-widest transition-all focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/10 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-bg-secondary/85 data-[state=active]:text-primary data-[state=active]:border data-[state=active]:border-[var(--glass-line-strong)] data-[state=active]:shadow-[0_8px_20px_rgba(0,0,0,0.18)] active:scale-95",s),...r})}).displayName=tA.l9.displayName,l.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)(tA.UC,{ref:t,className:T("mt-4 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/10 rounded-[32px]",s),...r})}).displayName=tA.UC.displayName;let tD=l.forwardRef((e,t)=>{let{className:s,error:r,...n}=e;return(0,a.jsx)("textarea",{className:T("flex min-h-[100px] w-full bg-bg-tertiary/50 border border-border-subtle text-text-primary rounded-2xl px-4 py-3 text-sm font-bold outline-none transition-all placeholder:text-text-muted/30 disabled:cursor-not-allowed disabled:opacity-50 shadow-inner resize-none","focus:ring-4 focus:ring-primary/10 focus:bg-bg-primary focus:border-primary/30",r&&"border-danger focus:ring-danger/10 focus:border-danger/30",s),ref:t,...n})});tD.displayName="Textarea";var tP=s(89741);let t_=(0,R.F)("inline-flex items-center justify-center rounded-xl text-sm font-black uppercase tracking-widest ring-offset-background transition-all hover:bg-bg-secondary hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-primary data-[state=on]:text-bg-deep active:scale-95",{variants:{variant:{default:"bg-transparent",outline:"border border-border-subtle bg-transparent hover:bg-bg-tertiary hover:text-text-primary"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}});l.forwardRef((e,t)=>{let{className:s,variant:r,size:n,enabled:i,onChange:l,...o}=e;return(0,a.jsx)(tP.b,{ref:t,className:T(t_({variant:r,size:n,className:s})),pressed:void 0!==i?i:o.pressed,onPressedChange:l||o.onPressedChange,...o})}).displayName=tP.b.displayName;var tR=s(68171);let tF=l.createContext({size:"default",variant:"default"});l.forwardRef((e,t)=>{let{className:s,variant:r,size:n,children:i,...l}=e;return(0,a.jsx)(tR.bL,{ref:t,className:T("flex items-center justify-center gap-1 bg-bg-tertiary/50 p-1 rounded-2xl border border-border-subtle shadow-inner",s),...l,children:(0,a.jsx)(tF.Provider,{value:{variant:r,size:n},children:i})})}).displayName=tR.bL.displayName,l.forwardRef((e,t)=>{let{className:s,children:r,variant:n,size:i,...o}=e,d=l.useContext(tF);return(0,a.jsx)(tR.q7,{ref:t,className:T(t_({variant:d.variant||n,size:d.size||i}),"rounded-xl data-[state=on]:bg-bg-primary data-[state=on]:text-primary data-[state=on]:shadow-md",s),...o,children:r})}).displayName=tR.q7.displayName;var tz=s(66965);tz.Kq,tz.bL,tz.l9,tz.ZL,l.forwardRef((e,t)=>{let{className:s,sideOffset:r=4,...n}=e;return(0,a.jsx)(tz.UC,{ref:t,sideOffset:r,className:T("z-50 overflow-hidden rounded-xl border border-border-subtle bg-bg-secondary/95 px-3 py-1.5 text-xs font-black uppercase tracking-widest text-text-primary shadow-[0_10px_30px_rgba(0,0,0,0.2)] backdrop-blur-xl 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",s),...n})}).displayName=tz.UC.displayName;var tI=s(41905),tE=s(68622),tL=s(60178),tU=s(77824),tO=s(27862);function t$(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,A.QP)((0,S.$)(t))}function tM(e){let{ready:t,total:s}=function(e){let[t=0,s=0]=e.split("/").map(Number);return{ready:Number.isFinite(t)?t:0,total:Number.isFinite(s)?s:0}}(e);return t===s&&s>0}function tV(e){if(!e)return"—";try{return(0,tU.m)((0,tO.H)(e),{addSuffix:!0})}catch{return e}}function tq(e){try{return(0,tU.m)((0,tO.H)(e),{addSuffix:!0})}catch{return e}}function tB(e){let{rows:t=2,className:s,inline:r=!1}=e,{t:n}=(0,m.Bd)();return r?(0,a.jsxs)("div",{className:t$("flex items-center justify-center py-20 text-sm text-text-muted",s),children:[(0,a.jsx)(tL.A,{size:18,className:"mr-2 animate-spin"}),n("common.loading")]}):(0,a.jsx)("div",{className:t$("space-y-4",s),children:Array.from({length:t}).map((e,t)=>(0,a.jsxs)("div",{className:"animate-pulse rounded-xl border border-border-subtle bg-bg-secondary/60 p-4",children:[(0,a.jsx)("div",{className:"mb-4 h-5 w-32 rounded bg-bg-tertiary"}),(0,a.jsx)("div",{className:"h-12 rounded bg-bg-tertiary"})]},t))})}function tK(e){let{title:t,description:s,action:r,icon:n=tI.A,className:i}=e;return(0,a.jsx)("div",{className:t$("rounded-xl border border-danger/30 bg-danger/5 p-4",i),children:(0,a.jsx)(ek,{icon:n,title:t,description:s,action:r})})}class tH extends l.Component{static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t.componentStack)}render(){return this.state.error?this.props.fallback?this.props.fallback:(0,a.jsx)("div",{className:"px-6 py-16",children:(0,a.jsx)(tK,{icon:tI.A,title:x.t("errorBoundary.title"),description:this.state.error.message,action:(0,a.jsxs)(L,{type:"button",onClick:()=>this.setState({error:null}),variant:"ghost",size:"sm",className:"border border-border-subtle text-text-secondary hover:border-border hover:text-text-primary",children:[(0,a.jsx)(tE.A,{size:14}),x.t("common.retry")]})})}):this.props.children}constructor(...e){super(...e),(0,k._)(this,"state",{error:null})}}var tW=s(91438),tJ=s(69671),tQ=s(15521),tG=s(50219),tY=s(24383),tZ=s(6772),tX=s(44562),t0=s(96066),t1=s(32871),t2=s(6061),t5=s(98063),t3=s(71548),t4=s(10090),t8=s(23927),t6=s(18090),t9=s(56709),t7=s(78009),se=s(85075),st=s(5645),ss=s(99663),sa=s(72370),sr=s(63109),sn=s(26582);let si="/api";async function sl(e){let t=await fetch(`${si}${e}`);if(!t.ok)throw Error(`GET ${e} failed: ${t.status}`);return t.json()}async function so(e,t){let s=await fetch(`${si}${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok)throw Error(`PUT ${e} failed: ${s.status}`);return s.json()}async function sd(e,t){let s=await fetch(`${si}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok)throw Error(`POST ${e} failed: ${s.status}`);return s.json()}async function sc(e,t){let s=await fetch(`${si}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok)throw Error(`POST ${e} failed: ${s.status}`);return s}async function sm(e){var t;let s=null==(t=e.body)?void 0:t.getReader();if(!s)return null;let a=new TextDecoder,r="";for(;;){let{done:e,value:t}=await s.read();if(e)break;let n=(r+=a.decode(t,{stream:!0})).split("\n");for(let e of(r=n.pop()??"",n))if(e.startsWith("data: "))try{let t=JSON.parse(e.slice(6));if(void 0!==t.id&&null!==t.id){let e=Number(t.id);if(Number.isFinite(e))return s.cancel(),e;if("string"==typeof t.id&&t.id.trim().length>0)return s.cancel(),t.id}}catch{}}return null}let sp={health:()=>sl("/health"),schema:()=>sl("/schema"),deployments:{list:()=>sl("/deployments"),namespaces:()=>sl("/namespaces"),pods:(e,t)=>sl(`/deployments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/pods`),logsHistory:function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:200;return sl(`/deployments/${encodeURIComponent(e)}/logs?agent=${encodeURIComponent(t)}&page=${s}&limit=${a}`)},logsUrl:(e,t)=>`${si}/deployments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/logs`,pause:(e,t)=>sd(`/deployments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/pause`,{}),resume:(e,t)=>sd(`/deployments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/resume`,{}),backups:(e,t)=>sl(`/deployments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/backups`),createBackup:(e,t,s)=>sd(`/deployments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/backups`,s??{}),restore:(e,t,s)=>sd(`/deployments/${encodeURIComponent(e)}/${encodeURIComponent(t)}/restore`,s??{}),costs:()=>sl("/deployments/costs"),namespaceCosts:e=>sl(`/deployments/${encodeURIComponent(e)}/costs`),manifest:e=>sl(`/deployments/${encodeURIComponent(e)}/manifest`),syncTemplate:(e,t)=>sd(`/deployments/${encodeURIComponent(e)}/template`,t??{}),env:{list:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"effective";return sl(`/deployments/${encodeURIComponent(e)}/env?mode=${t}`)},getOne:(e,t)=>sl(`/deployments/${encodeURIComponent(e)}/env/${encodeURIComponent(t)}`),upsert:(e,t,s,a,r)=>so(`/deployments/${encodeURIComponent(e)}/env`,{key:t,value:s,isSecret:a,groupName:r}),delete:(e,t)=>fetch(`${si}/deployments/${encodeURIComponent(e)}/env/${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>e.json())}},templates:{list:()=>sl("/templates"),listByLocale:e=>sl(`/templates?locale=${encodeURIComponent(e)}`),catalog:e=>sl(`/templates/catalog?locale=${encodeURIComponent(e)}`),detail:(e,t)=>sl(`/templates/${encodeURIComponent(e)}/details?locale=${encodeURIComponent(t)}`),get:e=>sl(`/templates/${encodeURIComponent(e)}`),envRefs:e=>sl(`/templates/${encodeURIComponent(e)}/env-refs`)},myTemplates:{list:()=>sl("/my-templates"),get:e=>sl(`/my-templates/${encodeURIComponent(e)}`),save:(e,t,s)=>so(`/my-templates/${encodeURIComponent(e)}`,{content:t,templateSlug:s}),fork:(e,t)=>sd("/my-templates/fork",{source:e,name:t}),delete:e=>fetch(`${si}/my-templates/${encodeURIComponent(e)}`,{method:"DELETE"}).then(e=>e.json()),versions:e=>sl(`/my-templates/${encodeURIComponent(e)}/versions`),restoreVersion:(e,t)=>sd(`/my-templates/${encodeURIComponent(e)}/versions/${t}`,{}),share:e=>sl(`/my-templates/${encodeURIComponent(e)}/share`),import:e=>sd("/my-templates/import",e),importGit:e=>sd("/my-templates/import-git",e)},deploy:e=>sc("/deploy",e),deployTasks:{list:()=>sl("/deploy-tasks"),get:e=>sl(`/deploy-tasks/${encodeURIComponent(String(e))}`),streamUrl:e=>`${si}/deploy-tasks/${encodeURIComponent(String(e))}/stream`,redeploy:(e,t)=>sc(`/deploy-tasks/${encodeURIComponent(String(e))}/redeploy`,t??{}),redeployToTaskId:async(e,t)=>sm(await sc(`/deploy-tasks/${encodeURIComponent(String(e))}/redeploy`,t??{})),cancel:e=>sd(`/deploy-tasks/${encodeURIComponent(String(e))}/cancel`,{}),redeployUrl:e=>`${si}/deploy-tasks/${encodeURIComponent(String(e))}/redeploy`},destroy:e=>sd("/destroy",e),rollback:e=>sd("/rollback",e),validate:e=>sd("/validate",e),doctor:()=>sl("/doctor"),init:e=>sd("/init",{template:e}),generate:{manifests:e=>sd("/generate/manifests",e),openclawConfig:e=>sd("/generate/openclaw-config",e)},images:()=>sl("/images"),config:{get:e=>sl(`/config${e?`?path=${encodeURIComponent(e)}`:""}`),put:e=>so("/config",e)},runtimes:()=>sl("/runtimes"),settings:{get:()=>sl("/settings"),put:e=>so("/settings",e)},providerCatalogs:{list:()=>sl("/provider-catalogs")},providerProfiles:{list:()=>sl("/provider-profiles"),upsert:e=>so("/provider-profiles",e),test:e=>sd(`/provider-profiles/${encodeURIComponent(e)}/test`,{}),refreshModels:e=>sd(`/provider-profiles/${encodeURIComponent(e)}/models/refresh`,{}),delete:e=>fetch(`${si}/provider-profiles/${encodeURIComponent(e)}`,{method:"DELETE"}).then(e=>e.json())},activity:{list:()=>sl("/activity"),record:e=>sd("/activity",e)},secrets:{list:()=>sl("/secrets"),getByProvider:e=>sl(`/secrets/${encodeURIComponent(e)}`),upsert:(e,t,s,a)=>so(`/secrets/${encodeURIComponent(e)}`,{key:t,value:s,groupName:a}),delete:(e,t)=>fetch(`${si}/secrets/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>e.json()),deleteProvider:e=>fetch(`${si}/secrets/${encodeURIComponent(e)}`,{method:"DELETE"}).then(e=>e.json())},env:{list:()=>sl("/env"),groups:()=>sl("/env/groups"),createGroup:e=>sd("/env/groups",{name:e}),deleteGroup:e=>fetch(`${si}/env/groups/${encodeURIComponent(e)}`,{method:"DELETE"}).then(e=>e.json()),getByScope:e=>sl(`/env/${encodeURIComponent(e)}`),getOne:(e,t)=>sl(`/env/${encodeURIComponent(e)}/${encodeURIComponent(t)}`),upsert:(e,t,s,a,r)=>so(`/env/${encodeURIComponent(e)}`,{key:t,value:s,isSecret:a,groupName:r}),delete:(e,t)=>fetch(`${si}/env/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:"DELETE"}).then(e=>e.json())},community:{getSettings:()=>sl("/community/settings"),putSettings:e=>so("/community/settings",e),catalog:e=>sl(`/community/templates/catalog?locale=${encodeURIComponent(e)}`),oauthInit:()=>sl("/community/oauth/init"),publish:(e,t)=>sd("/community/templates/publish",{name:e,...t})}},su=(0,l.createContext)(sp);function sx(){return(0,l.useContext)(su)}function sg(){return{success:e=>th.oR.success(e),error:e=>th.oR.error(e),info:e=>th.oR.info(e),warning:e=>th.oR.warning(e)}}function sy(e){let{active:t,icon:s,label:r,onClick:n}=e;return(0,a.jsxs)(L,{type:"button",onClick:n,variant:"ghost",style:{background:t?"var(--nf-bg-raised)":"transparent",borderColor:t?"rgba(0, 243, 255, 0.2)":"var(--nf-border)",color:t?"var(--color-nf-cyan)":"var(--nf-text-high)",boxShadow:t?"var(--nf-shadow-soft)":"none"},children:[(0,a.jsxs)("span",{className:"flex items-center gap-3 min-w-0",children:[(0,a.jsx)("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full border",style:{background:t?"rgba(0, 243, 255, 0.12)":"var(--nf-bg-glass-2)",borderColor:t?"rgba(0, 243, 255, 0.18)":"var(--nf-border)"},children:s}),(0,a.jsx)("span",{className:"truncate text-sm font-semibold",children:r})]}),t&&(0,a.jsx)(t3.A,{size:14})]})}function sh(){var e;let{t,i18n:s}=(0,m.Bd)(),r=h(e=>e.theme),n=h(e=>e.setTheme),i=(null==(e=s.language)?void 0:e.startsWith("zh"))?"zh-CN":"en",l=[{value:"light",label:t("theme.light"),icon:(0,a.jsx)(t4.A,{size:16})},{value:"dark",label:t("theme.dark"),icon:(0,a.jsx)(t8.A,{size:16})},{value:"system",label:t("theme.system"),icon:(0,a.jsx)(t6.A,{size:16})}],o=[{value:"en",label:t("settings.languageEnglish")},{value:"zh-CN",label:t("settings.languageChinese")}];return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)(eT,{className:"p-6 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-bold text-text-primary",children:t("settings.themeSection")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:t("settings.themeSectionDescription")})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-3",children:l.map(e=>(0,a.jsx)(sy,{active:r===e.value,icon:e.icon,label:e.label,onClick:()=>n(e.value)},e.value))})]}),(0,a.jsxs)(eT,{className:"p-6 space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-bold text-text-primary",children:t("settings.languageSection")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:t("settings.languageSectionDescription")})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:o.map(e=>(0,a.jsx)(sy,{active:i===e.value,icon:(0,a.jsx)(t9.A,{size:16}),label:e.label,onClick:()=>s.changeLanguage(e.value)},e.value))})]})]})}function sb(){let{t:e}=(0,m.Bd)(),{data:t}=(0,t2.I)({queryKey:["health"],queryFn:sp.health}),{data:s}=(0,t2.I)({queryKey:["doctor"],queryFn:sp.doctor});return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)(eT,{className:"divide-y divide-border-subtle",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted",children:e("settings.apiStatus")}),(0,a.jsx)("span",{className:t$("text-sm font-semibold",t?"text-green-400":"text-red-400"),children:e(t?"settings.healthy":"settings.unknown")})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted",children:e("settings.doctorChecks")}),(0,a.jsx)("span",{className:"text-sm text-text-primary",children:s?`${s.checks.filter(e=>"pass"===e.status).length}/${s.checks.length} ${e("settings.passing")}`:e("common.none")})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted",children:e("settings.dashboardPort")}),(0,a.jsx)("span",{className:"text-sm font-mono text-text-primary",children:window.location.port||"80"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted",children:e("settings.apiEndpoint")}),(0,a.jsxs)("span",{className:"text-sm font-mono text-text-primary",children:[window.location.origin,"/api"]})]})]}),(0,a.jsxs)(eT,{className:"p-5",children:[(0,a.jsx)("h3",{className:"mb-4 text-sm font-bold text-text-primary",children:e("settings.environment")}),(0,a.jsxs)("div",{className:"space-y-2 text-xs",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:e("settings.userAgent")}),(0,a.jsx)("span",{className:"max-w-xs truncate font-mono text-micro text-text-secondary",children:navigator.userAgent.split(" ").slice(-2).join(" ")})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:e("settings.language")}),(0,a.jsx)("span",{className:"text-text-secondary",children:navigator.language})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-text-muted",children:e("settings.timezone")}),(0,a.jsx)("span",{className:"text-text-secondary",children:Intl.DateTimeFormat().resolvedOptions().timeZone})]})]})]})]})}function sf(){let{t:e}=(0,m.Bd)();return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)(eT,{className:"p-6",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-full",style:{background:"rgba(0, 243, 255, 0.12)",border:"1px solid rgba(0, 243, 255, 0.18)",boxShadow:"0 10px 24px rgba(0, 198, 209, 0.14)"},children:(0,a.jsx)(t7.A,{size:24,style:{color:"var(--color-nf-cyan)"}})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-lg font-bold text-text-primary",children:[e("nav.shadowCloud")," ",e("nav.console")]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("settings.consoleTagline")})]})]}),(0,a.jsx)("p",{className:"text-sm leading-7 text-text-secondary",children:e("settings.aboutDescription")})]}),(0,a.jsxs)(eT,{className:"divide-y divide-border-subtle",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted",children:e("settings.platform")}),(0,a.jsx)("span",{className:"text-sm text-text-primary",children:e("nav.shadowCloud")})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted",children:e("settings.interface")}),(0,a.jsx)("span",{className:"text-sm text-text-secondary",children:e("settings.consoleWeb")})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 px-5 py-4",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-muted",children:e("settings.license")}),(0,a.jsx)("span",{className:"text-sm text-text-secondary",children:"MIT"})]})]}),(0,a.jsxs)(eT,{className:"p-5",children:[(0,a.jsx)("h3",{className:"mb-4 text-sm font-bold text-text-primary",children:e("settings.quickLinks")}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsx)(L,{asChild:!0,variant:"secondary",size:"sm",children:(0,a.jsx)("a",{href:"https://github.com/nicepkg/shadow",target:"_blank",rel:"noopener noreferrer",children:e("settings.gitHubRepository")})}),(0,a.jsx)(L,{asChild:!0,variant:"secondary",size:"sm",children:(0,a.jsx)("a",{href:"https://shadow.nicepkg.cn",target:"_blank",rel:"noopener noreferrer",children:e("settings.documentation")})})]})]})]})}function sv(){let{t:e}=(0,m.Bd)(),t=(0,n.jE)(),s=sg(),r=sx(),{data:i,isLoading:o}=(0,t2.I)({queryKey:["community-settings"],queryFn:r.community.getSettings,retry:0}),[d,c]=(0,l.useState)(""),[p,u]=(0,l.useState)(""),x=d||(null==i?void 0:i.baseUrl)||"https://shadowob.com",g=(0,t5.n)({mutationFn:()=>r.community.putSettings({baseUrl:d||void 0,token:p||void 0}),onSuccess:()=>{t.invalidateQueries({queryKey:["community-settings"]}),u(""),s.success(e("settings.communitySaved"))}}),y=async()=>{try{let{url:a}=await r.community.oauthInit(),n=window.open(a,"community-oauth","width=800,height=600"),i=a=>{var r;(null==(r=a.data)?void 0:r.type)==="community-oauth-success"&&(window.removeEventListener("message",i),null==n||n.close(),t.invalidateQueries({queryKey:["community-settings"]}),s.success(e("settings.communityOAuthSuccess")))};window.addEventListener("message",i)}catch{s.error(e("settings.communityOAuthError"))}};if(o)return(0,a.jsx)("div",{className:"py-12 text-center text-sm text-text-muted",children:e("common.loading")});let h=(null==i?void 0:i.oauthConnected)||(null==i?void 0:i.hasToken);return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)(eT,{className:"p-5",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full",style:{background:h?"rgba(0, 243, 255, 0.12)":"var(--nf-bg-raised)",border:h?"1px solid rgba(0, 243, 255, 0.24)":"1px solid var(--glass-line-strong)"},children:h?(0,a.jsx)(se.A,{size:18,style:{color:"var(--color-nf-cyan)"}}):(0,a.jsx)(st.A,{size:18,className:"text-text-muted"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-bold text-text-primary",children:h?e("settings.communityConnected"):e("settings.communityNotConnected")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:(null==i?void 0:i.baseUrl)??"https://shadowob.com"})]})]}),(0,a.jsx)("p",{className:"text-sm leading-6 text-text-secondary",children:e("settings.communityDescription")})]}),(0,a.jsxs)(eT,{className:"space-y-4 p-5",children:[(0,a.jsx)("h3",{className:"text-sm font-bold text-text-primary",children:e("settings.communityServer")}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"text-xs font-semibold text-text-muted",children:e("settings.communityBaseUrl")}),(0,a.jsx)(e_,{value:d||(null==i?void 0:i.baseUrl)||"",onChange:e=>c(e.target.value),placeholder:"https://shadowob.com",className:"font-mono text-sm"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("settings.communityBaseUrlHint")})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"text-xs font-semibold text-text-muted",children:[e("settings.communityToken"),(null==i?void 0:i.hasToken)&&(0,a.jsx)("span",{className:"ml-2 rounded-full bg-primary/15 px-2 py-0.5 text-[10px] text-primary",children:e("settings.communityTokenSet")})]}),(0,a.jsx)(e_,{type:"password",value:p,onChange:e=>u(e.target.value),placeholder:(null==i?void 0:i.hasToken)?"••••••••":e("settings.communityTokenPlaceholder"),className:"font-mono text-sm",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true","data-form-type":"other"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("settings.communityTokenHint")})]}),(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)(L,{variant:"primary",size:"sm",disabled:g.isPending,onClick:()=>g.mutate(),children:[(0,a.jsx)(ss.A,{size:14,className:"mr-1.5"}),g.isPending?e("common.saving"):e("common.save")]})})]}),(0,a.jsxs)(eT,{className:"p-5",children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-bold text-text-primary",children:e("settings.communityOAuth")}),(0,a.jsx)("p",{className:"mb-4 text-xs text-text-secondary",children:e("settings.communityOAuthHint")}),(0,a.jsxs)(L,{variant:"secondary",size:"sm",onClick:y,children:[(0,a.jsx)(sa.A,{size:14,className:"mr-1.5"}),e("settings.connectViaOAuth")]})]}),(0,a.jsxs)(eT,{className:"p-5",children:[(0,a.jsx)("h3",{className:"mb-2 text-sm font-bold text-text-primary",children:e("settings.communityBrowse")}),(0,a.jsx)("p",{className:"mb-3 text-xs text-text-secondary",children:e("settings.communityBrowseHint")}),(0,a.jsx)(L,{asChild:!0,variant:"secondary",size:"sm",children:(0,a.jsxs)("a",{href:x,target:"_blank",rel:"noopener noreferrer",children:[(0,a.jsx)(t9.A,{size:14,className:"mr-1.5"}),e("settings.openCommunity")]})})]})]})}function sj(e){let{open:t,onClose:s,initialTab:r="community"}=e,{t:n}=(0,m.Bd)(),[i,o]=(0,l.useState)(r);(0,l.useEffect)(()=>{t&&o(r)},[t,r]);let d=[{id:"community",label:n("settings.community"),icon:t9.A},{id:"appearance",label:n("settings.appearance"),icon:t6.A},{id:"system",label:n("settings.system"),icon:sr.A},{id:"about",label:n("settings.about"),icon:sn.A}],c=d.find(e=>e.id===i)??d[0],p=c.icon;return(0,a.jsx)(e$,{open:t,onClose:s,children:(0,a.jsxs)(eV,{maxWidth:"max-w-4xl",className:"h-[min(85vh,720px)] flex flex-col overflow-hidden",children:[(0,a.jsx)(eq,{overline:n("nav.settings"),icon:(0,a.jsx)(p,{size:18}),title:c.label,closeLabel:n("common.close")}),(0,a.jsxs)(eB,{className:"flex flex-1 min-h-0 overflow-hidden p-0",children:[(0,a.jsx)("nav",{className:"w-48 shrink-0 border-r border-border-subtle p-4 flex flex-col overflow-y-auto space-y-1",children:d.map(e=>{let t=i===e.id,s=e.icon;return(0,a.jsxs)("button",{type:"button",onClick:()=>o(e.id),className:t$("flex w-full items-center gap-2.5 rounded-full px-3 py-2 text-[13px] font-bold transition-all duration-200",t?"bg-primary/15 text-primary":"text-text-secondary hover:bg-bg-modifier-hover hover:text-text-primary"),children:[(0,a.jsx)(s,{size:15,className:t$("shrink-0 transition-colors",t?"text-primary":"text-text-muted")}),(0,a.jsx)("span",{className:"truncate",children:e.label})]},e.id)})}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto p-6",children:["appearance"===i&&(0,a.jsx)(sh,{}),"community"===i&&(0,a.jsx)(sv,{}),"system"===i&&(0,a.jsx)(sb,{}),"about"===i&&(0,a.jsx)(sf,{})]})]})]})})}let sN="shadow-cloud-console";function sk(e){try{let t={activities:e.activities.slice(0,100),favorites:e.favorites,recentDeploys:e.recentDeploys.slice(0,20)};localStorage.setItem(sN,JSON.stringify(t))}catch{}}let sw=function(){try{let e=localStorage.getItem(sN);if(!e)return{};return JSON.parse(e)}catch{return{}}}(),sC=(0,g.v)((e,t)=>({settingsOpen:!1,settingsTab:"community",openSettings:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"community";return e({settingsOpen:!0,settingsTab:t})},closeSettings:()=>e({settingsOpen:!1}),activities:sw.activities??[],addActivity:t=>e(e=>{let s={...t,id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:Date.now()},a=[s,...e.activities].slice(0,200);return sk({...e,activities:a}),sp.activity.record.bind(sp.activity)(s).catch(()=>{}),{activities:a}}),clearActivities:()=>e(e=>(sk({...e,activities:[]}),{activities:[]})),favorites:sw.favorites??[],toggleFavorite:t=>e(e=>{let s=e.favorites.includes(t)?e.favorites.filter(e=>e!==t):[...e.favorites,t];return sk({...e,favorites:s}),{favorites:s}}),isFavorite:e=>t().favorites.includes(e),recentDeploys:sw.recentDeploys??[],addRecentDeploy:(t,s)=>e(e=>{let a=[{template:t,namespace:s,timestamp:Date.now()},...e.recentDeploys.filter(e=>e.template!==t||e.namespace!==s)].slice(0,20);return sk({...e,recentDeploys:a}),{recentDeploys:a}})})),sS=[{id:"discover",labelKey:"nav.deploy",items:[{to:"/store",labelKey:"nav.shrimp",icon:tQ.A},{to:"/my-templates",labelKey:"nav.myTemplates",icon:tG.A}]},{id:"manage",labelKey:"nav.manage",items:[{to:"/monitoring",labelKey:"nav.monitoring",icon:tY.A},{to:"/deployments",labelKey:"nav.deployments",icon:tZ.A},{to:"/providers",labelKey:"nav.providers",icon:tX.A},{to:"/secrets",labelKey:"nav.secrets",icon:t0.A}]}];function sA(e){let{item:t}=e,{t:s}=(0,m.Bd)(),{location:r}=(0,tW.k)(),n=t.exact?r.pathname===t.to:r.pathname===t.to||r.pathname.startsWith(`${t.to}/`),i=t.icon;return(0,a.jsx)(tx,{asChild:!0,variant:"dashboard",active:n,children:(0,a.jsxs)(tJ.N_,{to:t.to,className:"flex w-full min-w-0 items-center gap-3",children:[(0,a.jsx)(i,{size:16,className:t$("shrink-0",n?"text-primary":"text-text-muted")}),(0,a.jsx)("span",{className:"truncate",children:s(t.labelKey)})]})})}function sT(e){let{section:t}=e,{t:s}=(0,m.Bd)();return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(tg,{className:"px-3 pb-1 text-[10px] tracking-[0.24em] text-text-muted/70",children:s(t.labelKey)}),(0,a.jsx)("div",{className:"space-y-1",children:t.items.map(e=>(0,a.jsx)(sA,{item:e},e.to))})]})}function sD(){let{t:e}=(0,m.Bd)(),{settingsOpen:t,settingsTab:s,openSettings:r,closeSettings:n}=sC();return(0,a.jsxs)("aside",{className:"relative z-20 w-[248px] shrink-0 flex flex-col",children:[(0,a.jsx)("div",{className:"flex h-full flex-col px-2.5 py-0",children:(0,a.jsxs)(eS,{as:tm,className:"h-full w-full border-0 bg-transparent",children:[(0,a.jsx)(tp,{className:"border-b-0 bg-transparent p-3",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)(tJ.N_,{to:"/",className:"flex min-w-0 items-center gap-3 rounded-[20px]",children:[(0,a.jsx)(tl,{iconUrl:"/logo.png",name:e("nav.shadowCloud"),className:"h-12 w-12 rounded-[18px] [&>span]:rounded-[18px] [&_[data-slot='avatar']]:rounded-[18px]"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"truncate text-sm font-black text-text-primary",children:e("nav.shadowCloud")}),(0,a.jsx)("p",{className:"truncate text-[11px] tracking-[0.08em] text-text-muted",children:e("nav.console")})]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>r(),title:e("nav.settings"),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-bg-modifier-hover hover:text-text-primary",children:(0,a.jsx)(t1.A,{size:15})})]})}),(0,a.jsx)(tu,{className:"space-y-5 px-2 py-2",children:sS.map(e=>(0,a.jsx)(sT,{section:e},e.id))})]})}),(0,a.jsx)(sj,{open:t,onClose:n,initialTab:s})]})}function sP(){return(0,a.jsx)(tb,{position:"bottom-right",offset:20,visibleToasts:3,expand:!1,richColors:!0,closeButton:!0})}function s_(e){let{children:t}=e;return(0,a.jsxs)("div",{className:"dashboard-root relative flex h-full",children:[(0,a.jsxs)("div",{className:"fixed inset-0 overflow-hidden pointer-events-none -z-10",children:[(0,a.jsx)("div",{className:"absolute top-[-180px] left-[8%] w-[520px] h-[520px] rounded-full blur-[130px] opacity-[0.13]",style:{background:"radial-gradient(circle, #00F3FF 0%, transparent 70%)"}}),(0,a.jsx)("div",{className:"absolute top-[30%] right-[-120px] w-[580px] h-[580px] rounded-full blur-[130px] opacity-[0.09]",style:{background:"radial-gradient(circle, #FF2A55 0%, transparent 70%)"}}),(0,a.jsx)("div",{className:"absolute bottom-[-80px] left-[35%] w-[420px] h-[420px] rounded-full blur-[110px] opacity-[0.06]",style:{background:"radial-gradient(circle, #7C4DFF 0%, transparent 70%)"}})]}),(0,a.jsx)(sD,{}),(0,a.jsx)("main",{className:"flex-1 overflow-auto relative z-10",children:t}),(0,a.jsx)(sP,{})]})}var sR=s(88877),sF=s(49604),sz=s(54237),sI=s(45128),sE=s(97862),sL=s(68843),sU=s(10722),sO=s(52866),s$=s(72430),sM=s(75395),sV=s(47708),sq=s(17227),sB=s(68918),sK=s(80725),sH=s(51726),sW=s(78555),sJ=s(77129),sQ=s(51920),sG=s(90314),sY=s(65584),sZ=s(30550),sX=s(10623);function s0(e){let{open:t,onOpenChange:s,title:r,description:n,confirmText:i,cancelText:l,loading:o,onConfirm:d}=e;return(0,a.jsx)(U,{open:t,onOpenChange:s,children:(0,a.jsxs)(M,{children:[(0,a.jsxs)(V,{children:[(0,a.jsx)(B,{children:r}),(0,a.jsx)(K,{children:n})]}),(0,a.jsxs)(q,{children:[(0,a.jsx)(W,{asChild:!0,children:(0,a.jsx)(L,{variant:"ghost",children:l})}),(0,a.jsx)(H,{asChild:!0,children:(0,a.jsx)(L,{variant:"danger",loading:o,onClick:d,children:i})})]})]})})}function s1(e){let{icon:t,title:s,description:r,action:n,className:i,contentClassName:l,cardVariant:o="default"}=e;return(0,a.jsx)(en,{variant:o,className:t$("p-6",i),children:(0,a.jsx)(ek,{icon:t,title:s,description:r,action:n,className:t$("py-16",l)})})}function s2(e){let{tabs:t,className:s,activeId:r,onSelect:n}=e;return(0,a.jsx)("div",{role:"tablist",className:t$("inline-flex h-auto flex-nowrap items-center justify-start gap-1 rounded-[28px] border border-[var(--glass-line)] bg-white/[0.03] p-1.5 shadow-[inset_0_1px_0_var(--glass-line-soft)] overflow-x-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",s),children:t.map(e=>{let t=r===e.id;return(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":t,"data-state":t?"active":"inactive",onPointerDown:()=>null==n?void 0:n(e.id),onClick:()=>null==n?void 0:n(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(null==n||n(e.id))},className:"group inline-flex h-auto items-center justify-center whitespace-nowrap rounded-[20px] border border-transparent gap-2 px-4 py-2.5 text-xs font-bold normal-case tracking-normal text-text-secondary transition-all hover:bg-white/[0.03] hover:text-text-primary focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/10 data-[state=active]:!bg-white/[0.05] data-[state=active]:!text-primary data-[state=active]:!border-[var(--glass-line-strong)] data-[state=active]:shadow-[inset_0_1px_0_var(--glass-line-soft),0_10px_24px_rgba(0,0,0,0.12)]",children:[e.icon&&(0,a.jsx)("span",{className:"inline-flex items-center justify-center text-text-muted transition-colors group-data-[state=active]:text-primary",children:e.icon}),(0,a.jsx)("span",{children:e.label}),"number"==typeof e.count&&(0,a.jsx)("span",{className:"rounded-full bg-white/[0.04] px-2 py-0.5 text-[0.625rem] font-extrabold leading-[1.3] tracking-normal text-text-muted transition-colors group-data-[state=active]:bg-primary/12 group-data-[state=active]:text-primary",children:e.count})]},e.id)})})}var s5=s(45901),s3=s(2909),s4=s(33085);function s8(e){let{mode:t,initial:s,isSubmitting:r,onSubmit:n,onClose:i,overline:o,titleCreate:d,titleEdit:c,subtitleCreate:p,subtitleEdit:u}=e,{t:x}=(0,m.Bd)(),[g,y]=(0,l.useState)((null==s?void 0:s.key)??""),[h,b]=(0,l.useState)((null==s?void 0:s.value)??""),[f,v]=(0,l.useState)((null==s?void 0:s.isSecret)??!0),[j,N]=(0,l.useState)("create"===t);return(0,a.jsx)(e$,{open:!0,onClose:i,children:(0,a.jsxs)(eV,{maxWidth:"max-w-lg",children:[(0,a.jsx)(eq,{overline:o,icon:(0,a.jsx)(sB.A,{size:18}),title:"edit"===t?c:d,subtitle:"edit"===t?u:p,onClose:i}),(0,a.jsxs)(eB,{children:[(0,a.jsx)(e_,{label:x("secrets.keyName"),type:"text",value:g,onChange:e=>y(e.target.value),placeholder:"OPENAI_API_KEY",autoFocus:!0,disabled:"edit"===t}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"ml-1 text-[11px] font-bold uppercase tracking-[0.14em] text-text-muted",children:x("secrets.secretValue")}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(e_,{type:j?"text":"password",value:h,onChange:e=>b(e.target.value),placeholder:"edit"===t?x("secrets.leaveEmptyKeep"):"",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true","data-form-type":"other"}),(0,a.jsx)(L,{type:"button",variant:"ghost",size:"xs",className:"transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease active:translate-y-[0.5px] focus-visible:outline-none",onClick:()=>N(e=>!e),children:j?(0,a.jsx)(s5.A,{size:14}):(0,a.jsx)(s3.A,{size:14})})]})]}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-3 rounded-2xl border border-border-subtle bg-bg-secondary/50 px-4 py-3 text-sm font-semibold text-text-secondary",children:[(0,a.jsx)(eo,{checked:f,onCheckedChange:e=>v(!0===e)}),(0,a.jsx)(s4.A,{size:14,className:"text-text-muted"}),(0,a.jsx)("span",{children:x("secrets.secret")})]})]}),(0,a.jsx)(eK,{children:(0,a.jsxs)(eH,{children:[(0,a.jsx)(L,{type:"button",variant:"ghost",className:"transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease active:translate-y-[0.5px] focus-visible:outline-none",onClick:i,children:x("common.cancel")}),(0,a.jsxs)(L,{type:"button",variant:"primary",className:"transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease active:translate-y-[0.5px] focus-visible:outline-none",onClick:()=>g.trim()&&n({key:g.trim(),value:h,isSecret:f}),disabled:!g.trim()||r,children:[r?(0,a.jsx)(tL.A,{size:14,className:"animate-spin"}):null,x("edit"===t?"common.save":"common.add")]})]})})]})})}function s6(e){let{headerLeft:t,headerRight:s,lines:r,emptyText:n,bodyRef:i,bodyOnScroll:l,className:o,bodyClassName:d,footerLeft:c,footerRight:m,showTimestamps:p=!1,collapseRepeats:u=!1}=e,x=r.reduce((e,t,s)=>{var a;let r=("string"==typeof t?t:t.text)||"\xa0",n=(e=>{if("string"==typeof e||!e.createdAt)return null;let t=new Date(e.createdAt);return Number.isNaN(t.getTime())?null:t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})})(t);return u&&e.length>0&&(null==(a=e.at(-1))?void 0:a.text)===r?(e[e.length-1].repeatCount+=1,n&&(e[e.length-1].timestamp=n)):e.push({text:r,timestamp:n,repeatCount:1,key:`log-${s}-${r}-${n??"no-ts"}`}),e},[]);return(0,a.jsxs)(en,{className:t$("overflow-hidden rounded-xl border border-border-subtle bg-bg-secondary/25",o),children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border-subtle bg-bg-secondary/30 px-4 py-2.5",children:[(0,a.jsx)("div",{className:"text-xs text-text-muted",children:t}),s?(0,a.jsx)("div",{className:"shrink-0",children:s}):null]}),(0,a.jsx)("div",{ref:i,className:t$("min-h-[12rem] max-h-[16rem] overflow-auto p-4 font-mono text-xs text-text-secondary space-y-1 bg-bg-deep/80",d),onScroll:l,children:0===r.length?(0,a.jsx)("span",{className:"text-text-muted",children:n}):x.map(e=>(0,a.jsxs)("div",{className:"leading-relaxed",children:[p&&e.timestamp?(0,a.jsx)("span",{className:"text-[0.72rem] text-text-muted mr-2",children:e.timestamp}):null,e.text,e.repeatCount>1?(0,a.jsxs)("span",{className:"ml-2 rounded bg-bg-deep px-1.5 py-0.5 text-[0.7rem] text-text-muted",children:["x",e.repeatCount]}):null]},e.key))}),(c||m)&&(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-border-subtle bg-bg-secondary/30 px-4 py-2.5",children:[c?(0,a.jsx)("div",{className:"text-xs text-text-muted",children:c}):null,m?(0,a.jsx)("div",{className:"flex items-center gap-2",children:m}):null]})]})}function s9(e){let{icon:t,label:s,iconClassName:r,className:n,...i}=e;return(0,a.jsxs)(L,{size:"sm",className:t$("h-8 gap-2 px-3",n),...i,children:[(0,a.jsx)("span",{className:t$("inline-flex items-center justify-center align-middle",r),children:t}),(0,a.jsx)("span",{className:"align-middle",children:s})]})}function s7(e){let{showTimestamps:t,onShowTimestampsChange:s,showTimestampsLabel:r,hideTimestampsLabel:n,showTimestampsToggle:i=!0,actions:l,suffix:o}=e;return(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 text-xs text-text-muted",children:[i&&s?(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)(eo,{checked:!!t,onCheckedChange:e=>s(!0===e)}),(0,a.jsx)("span",{children:t?n:r})]}):null,l?l.map(e=>"button"===e.type?(0,a.jsxs)(L,{type:"button",variant:e.variant??"ghost",size:e.size??"sm",onClick:e.onClick,disabled:e.disabled,className:"h-8",children:[e.icon,e.label]},e.id??`log-header-action-${e.label}`):(0,a.jsx)(s9,{type:"button",onClick:e.onClick,variant:e.variant??"ghost",icon:e.icon,label:e.label,disabled:e.disabled,className:"h-8"},e.id??`log-header-action-${e.label}`)):null,o||null]})}function ae(e){let{children:t,className:s,onClick:r}=e;return(0,a.jsx)("div",{className:t$("min-w-0 rounded-xl border border-border-subtle bg-bg-secondary/35 px-4 py-3",s),onClick:r,children:t})}function at(e){let{label:t,value:s,icon:r,className:n,valueClassName:i,iconClassName:l}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-2 flex items-start justify-between gap-3",children:(0,a.jsxs)("div",{className:t$("flex min-w-0 flex-wrap items-center gap-2 text-xs",n),children:[r&&(0,a.jsx)("span",{className:t$("inline-flex shrink-0 items-center justify-center",l),children:r}),(0,a.jsx)("span",{className:"min-w-0 break-words text-[0.72rem] font-medium uppercase tracking-[0.08em] text-text-muted",children:t})]})}),(0,a.jsx)("p",{className:t$("break-words text-[clamp(1.25rem,2vw,1.75rem)] font-bold leading-tight tracking-tight",i),children:s})]})}var as=s(1160);function aa(e){let{items:t,className:s}=e,{t:r}=(0,m.Bd)();return(0,a.jsx)(X,{className:t$("pb-2",s),"aria-label":r("common.breadcrumb"),children:(0,a.jsxs)(ee,{className:"gap-1 text-sm",children:[(0,a.jsx)(et,{children:(0,a.jsx)(es,{asChild:!0,className:"flex items-center p-0.5 text-text-muted hover:text-text-primary",children:(0,a.jsx)(tJ.N_,{to:"/",title:r("nav.agentStore"),children:(0,a.jsx)(as.A,{size:14})})})}),t.map((e,t)=>(0,a.jsxs)(l.Fragment,{children:[(0,a.jsx)(er,{className:"opacity-40"}),(0,a.jsx)(et,{children:e.to?(0,a.jsx)(es,{asChild:!0,className:"font-bold tracking-[0.08em] text-text-secondary hover:text-text-primary",children:(0,a.jsx)(tJ.N_,{to:e.to,children:e.label})}):(0,a.jsx)(ea,{className:"tracking-[0.08em]",children:e.label})})]},`group-${e.label}-${t}`))]})})}function ar(e){let{breadcrumb:t,title:s,description:r,actions:n,headerContent:i,children:l,className:o,narrow:d,bodyClassName:c="space-y-6",breadcrumbPosition:m="inside"}=e,p=!!s||!!n,u=t.length>0&&"inside"===m;return(0,a.jsxs)("div",{className:t$("mx-auto max-w-[1440px] px-4 pt-0 pb-4 md:px-6 md:pb-5",d&&"max-w-[1280px]",o),children:[t.length>0&&"outside"===m?(0,a.jsx)(aa,{items:t,className:"mb-4"}):null,(0,a.jsxs)(eS,{as:"section",className:"p-6",children:[u?(0,a.jsx)(aa,{items:t,className:"mb-3"}):null,p?(0,a.jsxs)("div",{className:t$("flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",(r||i)&&"mb-3 md:mb-4"),children:[(0,a.jsx)("h1",{className:"text-[1.875rem] font-extrabold tracking-[-0.03em] text-text-primary md:text-[2.125rem]",children:s}),n&&(0,a.jsx)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:n})]}):null,r&&(0,a.jsx)("p",{className:t$("text-sm leading-6 text-text-muted",i&&"mb-4"),children:r}),i]}),l&&(0,a.jsx)("div",{className:t$("mt-4 md:mt-5",c),children:l})]})}function an(e){let{children:t,className:s}=e;return(0,a.jsx)("div",{className:t$("mb-6 grid grid-cols-2 gap-4 lg:grid-cols-4",s),children:t})}let ai={success:"running",warning:"idle",error:"error",info:"running",neutral:"offline"},al={success:"text-success",warning:"text-warning",error:"text-danger",info:"text-primary",neutral:"text-text-muted"};function ao(e){let{status:t,label:s,pulse:r,size:n="sm",className:i}=e;return(0,a.jsxs)("span",{className:t$("inline-flex items-center gap-1.5",i),children:[(0,a.jsx)("span",{className:t$(r&&"animate-pulse"),children:(0,a.jsx)(eP,{status:ai[t],size:"sm"===n?"sm":"md"})}),s&&(0,a.jsx)("span",{className:t$("text-xs font-medium",al[t]),children:s})]})}function ad(e){let{dotStatus:t,dotLabel:s,pulse:r,badgeText:n,badgeVariant:i,className:l}=e;return(0,a.jsxs)("div",{className:t$("inline-flex items-center gap-2.5",l),children:[(0,a.jsx)(ao,{status:t,label:s,pulse:r}),(0,a.jsx)(Y,{variant:i,size:"sm",className:"min-h-[1.3rem] rounded-full text-[0.68rem] font-bold tracking-[0.03em]",children:n})]})}function ac(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{maxLines:t=2e3}=e,[s,a]=(0,l.useState)([]),[r,n]=(0,l.useState)([]),[i,o]=(0,l.useState)("idle"),[d,c]=(0,l.useState)(null),m=(0,l.useRef)(null),p=(0,l.useCallback)(e=>{a(s=>[...s.slice(-(t-1)),e]),n(s=>[...s.slice(-(t-1)),{text:e,createdAt:new Date().toISOString()}])},[t]),u=(0,l.useCallback)(()=>{if("u"<typeof window)return{};try{let e=window.localStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:{}}catch{return{}}},[]),x=(0,l.useCallback)(e=>{if("string"==typeof e)return e;if(!e||"object"!=typeof e)return null;if("string"==typeof e.line)return e.line;if("string"==typeof e.message){let t="string"==typeof e.level?e.level.toUpperCase():null;return t?`[${t}] ${e.message}`:e.message}return"string"==typeof e.error?`Error: ${e.error}`:null},[]),g=(0,l.useCallback)(e=>{let t,s=e.split("\n"),a=[];for(let e of s){if(e.startsWith("event:")){t=e.slice(6).trim();continue}e.startsWith("data:")&&a.push(e.slice(5).trimStart())}if(0===a.length)return null;let r=a.join("\n");try{return{event:t,data:JSON.parse(r)}}catch{return{event:t,data:r}}},[]),y=(0,l.useCallback)(async(e,t)=>{var s;let a=null==(s=e.body)?void 0:s.getReader();if(!a)throw Error("No response body");let r=new TextDecoder,n="",i=e=>{var s;let a=g(e);if(!a)return;null==t||null==(s=t.onEvent)||s.call(t,a.event,a.data);let r=x(a.data);null!==r&&"done"!==a.event&&"end"!==a.event&&"close"!==a.event&&"status"!==a.event&&p(r)};for(;;){let{done:e,value:t}=await a.read();if(e)break;let s=(n+=r.decode(t,{stream:!0})).split("\n\n");for(let e of(n=s.pop()??"",s))i(e)}let l=n.trim();l.length>0&&i(l)},[p,x,g]),h=(0,l.useCallback)(()=>{m.current&&(m.current.abort(),m.current=null)},[]),b=(0,l.useCallback)(()=>{h(),o(e=>"done"===e||"error"===e?e:"idle")},[h]),f=(0,l.useCallback)(()=>{a([]),n([]),c(null),o("idle")},[]),v=(0,l.useCallback)((e,t)=>{h(),a([]),n([]),c(null),o("connecting");let s=new AbortController;m.current=s,(async()=>{try{let a=await fetch(e,{method:"GET",headers:{Accept:"text/event-stream",...u()},signal:s.signal});if(!a.ok)throw Error(`HTTP ${a.status}`);o("connected"),await y(a,t),o(e=>"error"===e?e:"done")}catch(e){if("AbortError"===e.name)return;c("Connection lost. Click Connect to retry."),o("error")}finally{m.current===s&&(m.current=null)}})()},[h,u,y]),j=(0,l.useCallback)(async(e,t,s)=>{h(),a([]),n([]),c(null),o("connecting");let r=new AbortController;m.current=r;let i={success:!1};try{let a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...u()},body:JSON.stringify(t),signal:r.signal});if(!a.ok)throw Error(`HTTP ${a.status}`);return o("connected"),await y(a,{onEvent:(e,t)=>{var a;if(null==s||null==(a=s.onEvent)||a.call(s,e,t),"done"===e){let e="object"==typeof t&&null!==t?t:null,s="number"==typeof(null==e?void 0:e.exitCode)?e.exitCode:void 0,a="string"==typeof(null==e?void 0:e.error)?e.error:void 0;i={success:0===s||void 0===s,exitCode:s,error:a},a&&(c(a),p(`Error: ${a}`)),o("done")}}}),!1!==i.success||i.error||(i={success:!0}),o(e=>"done"===e?e:"done"),i}catch(t){if("AbortError"===t.name)return{success:!1,error:"Aborted"};let e=String(t);return c(e),o("error"),{success:!1,error:e}}finally{m.current=null}},[p,h,x,u,y]);return(0,l.useEffect)(()=>h,[h]),{lines:s,entries:r,status:i,error:d,connect:v,startFetch:j,disconnect:b,clear:f}}function am(e,t){return null===e?"—":new Intl.NumberFormat(t??"en",{style:"currency",currency:"USD",maximumFractionDigits:e>=100?0:2}).format(e)}function ap(e,t){let s=e.billingAmount??e.totalUsd??null;return"shrimp"===(e.billingUnit??"usd")?function(e,t,s){if(null===e)return"—";let a=new Intl.NumberFormat(s??"en",{maximumFractionDigits:e>=100?0:2}).format(e);return`${a} ${t}`}(s,(null==t?void 0:t.shrimpUnitLabel)??"Shrimp Coins",null==t?void 0:t.locale):am(s,null==t?void 0:t.locale)}function au(e,t){return null===e?"—":new Intl.NumberFormat(t??"en").format(e)}function ax(e,t,s){return null===e?"—":`${au(e,t)} ${s}`}function ag(e){return e instanceof Error?e.message:String(e)}function ay(e,t){let s=e.trim();if(!s)throw Error("empty");try{let e=JSON.parse(s);if(e&&"object"==typeof e&&!Array.isArray(e)){let s=Array.isArray(e.cookies)?e.cookies:[],a=Array.isArray(e.origins)?e.origins:[];return{envKey:t,value:JSON.stringify({cookies:s,origins:a}),cookieCount:s.length,originCount:a.length,format:"playwright"}}if(Array.isArray(e))return{envKey:t,value:JSON.stringify({cookies:e,origins:[]}),cookieCount:e.length,originCount:0,format:"playwright"}}catch{}let a=s.split(/\r?\n/).map(e=>e.trim()).filter(e=>e&&!e.startsWith("#")).map(e=>{let t=e.split(" ");if(t.length<7)throw Error("invalid");let[s,a,r,n,i,l,...o]=t,d=Number.parseInt(i??"0",10);return{name:l,value:o.join(" "),domain:s,path:r||"/",expires:Number.isFinite(d)&&d>0?d:-1,httpOnly:!1,secure:(null==n?void 0:n.toUpperCase())==="TRUE"}});if(0===a.length)throw Error("invalid");return{envKey:t,value:JSON.stringify({cookies:a,origins:[]}),cookieCount:a.length,originCount:0,format:"netscape"}}function ah(e){let{namespace:t,agent:s,enabled:r,deployment:n,onResume:i,resumePending:l,resumeDisabledReason:o}=e,d=sx(),{t:c}=(0,m.Bd)(),{data:p,isLoading:u}=(0,t2.I)({queryKey:["pods",t,s],queryFn:()=>d.deployments.pods(t,s??""),enabled:r&&!!s,refetchInterval:1e4});if(!s)return(0,a.jsx)(s1,{icon:sz.A,title:c("deployments.noAgentSelected"),cardVariant:"glass"});if(u)return(0,a.jsxs)("div",{className:"py-10 text-center text-text-muted text-sm",children:[(0,a.jsx)(tL.A,{size:16,className:"animate-spin inline mr-2"}),c("common.loading")]});if(!p||0===p.length){let e=(null==n?void 0:n.runtimeState)==="paused";return(0,a.jsx)(s1,{icon:sz.A,title:e?c("deployments.pausedNoPodsTitle"):c("deployments.noPodsForAgent",{agent:s}),description:e?c("deployments.pausedNoPodsDescription"):void 0,action:e&&i?(0,a.jsxs)(L,{type:"button",variant:"glass",size:"sm",onClick:i,title:o,disabled:l||!!o,children:[l?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sI.A,{size:12}),c("deployments.resumeAgent")]}):void 0,cardVariant:"glass"})}return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:c("deployments.selectedPodsCount",{count:p.length})}),(0,a.jsx)(en,{variant:"glassPanel",children:(0,a.jsxs)(tj,{children:[(0,a.jsx)(tN,{children:(0,a.jsxs)(tw,{children:[(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:c("clusters.status")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:c("monitoring.name")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:c("deployments.restarts")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:c("deployments.age")})]})}),(0,a.jsx)(tk,{children:p.map(e=>{var t;return(0,a.jsxs)(tw,{children:[(0,a.jsx)(tS,{children:(0,a.jsx)(ad,{dotStatus:"Running"===(t=e.status)?"success":"Pending"===t?"warning":"Failed"===t?"error":"Succeeded"===t?"info":"warning",dotLabel:e.status,badgeVariant:"Running"===e.status?"success":"warning",badgeText:e.status})}),(0,a.jsx)(tS,{children:e.name}),(0,a.jsx)(tS,{children:e.restarts}),(0,a.jsx)(tS,{children:tq(e.age)})]},e.name)})})]})})]})}function ab(e){var t;let{namespace:s,agent:r,deployment:i}=e,o=sx(),{t:d}=(0,m.Bd)(),c=(0,n.jE)(),p=sg(),u=(null==i?void 0:i.workloadKind)==="agent-sandbox",[x,g]=(0,l.useState)(null),[y,h]=(0,l.useState)(!1),b=(0,t2.I)({queryKey:["deployment-backups",s,r],queryFn:()=>o.deployments.backups(s,r??""),enabled:!!r&&u,refetchInterval:y?3e3:15e3}),f=(0,t5.n)({mutationFn:()=>o.deployments.createBackup(s,r??""),onSuccess:()=>{h(!0),p.success(d("deployments.backupCreated"))},onError:e=>p.error(`${d("deployments.backupFailed")}: ${ag(e)}`),onSettled:()=>{c.invalidateQueries({queryKey:["deployment-backups",s,r]})}}),v=(0,t5.n)({mutationFn:e=>o.deployments.restore(s,r??"",{backupId:e.restoreKey??e.id}),onSuccess:()=>{h(!0),c.invalidateQueries({queryKey:["deployments"]}),c.invalidateQueries({queryKey:["pods",s,r]}),c.invalidateQueries({queryKey:["deployment-backups",s,r]}),g(null),p.success(d("deployments.restoreQueued"))},onError:e=>p.error(`${d("deployments.restoreFailed")}: ${ag(e)}`),onSettled:()=>{c.invalidateQueries({queryKey:["deployment-backups",s,r]})}}),j=(null==(t=b.data)?void 0:t.backups)??[],N=j.some(e=>"pending"===e.status||"running"===e.status);(0,l.useEffect)(()=>{h(N)},[N]);let k=((null==i?void 0:i.status)?"deployed"===i.status||"paused"===i.status:(null==i?void 0:i.runtimeState)==="running"||(null==i?void 0:i.runtimeState)==="paused")?N?d("deployments.backupUnavailableActiveOperation"):null:d("deployments.backupUnavailableRuntime");if(!r)return(0,a.jsx)(s1,{icon:sE.A,title:d("deployments.noAgentSelected"),cardVariant:"glass"});if(!u)return(0,a.jsx)(s1,{icon:sE.A,title:d("deployments.backupsUnavailableTitle"),description:d("deployments.backupsUnavailableDescription"),cardVariant:"glass"});let w=e=>"restic"===e?d("deployments.backupDriverObject"):"volumeSnapshot"===e?d("deployments.backupDriverVolumeSnapshot"):e,C=e=>"pending"===e?d("deployments.backupStatusPending"):"running"===e?d("deployments.backupStatusRunning"):"succeeded"===e?d("deployments.backupStatusSucceeded"):"failed"===e?d("deployments.backupStatusFailed"):"expired"===e?d("deployments.backupStatusExpired"):e,S=e=>e&&"completed"!==e&&"failed"!==e?"queued"===e?d("deployments.backupPhaseQueued"):"checking-snapshot-api"===e?d("deployments.backupPhaseCheckingSnapshotApi"):"snapshot-creating"===e?d("deployments.backupPhaseSnapshotCreating"):"snapshot-waiting"===e?d("deployments.backupPhaseSnapshotWaiting"):"object-archiving"===e?d("deployments.backupPhaseObjectArchiving"):"object-storing"===e?d("deployments.backupPhaseObjectStoring"):"restoring-pausing"===e?d("deployments.backupPhaseRestoringPausing"):"restoring-pvc"===e?d("deployments.backupPhaseRestoringPvc"):"restoring-resuming"===e?d("deployments.backupPhaseRestoringResuming"):"restore-failed"===e?d("deployments.backupPhaseRestoreFailed"):e:null,A=(e,t,s)=>{let r=v.isPending?d("deployments.restoreUnavailableActiveOperation"):"succeeded"!==e.status?d("deployments.restoreUnavailableStatus",{status:C(e.status)}):t?void 0:d("deployments.restoreUnavailableArtifact");return(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"sm",className:s,title:r,onClick:()=>g(e),disabled:!!r,children:[v.isPending&&(null==x?void 0:x.id)===e.id?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sL.A,{size:12}),d("deployments.restoreBackup")]})};return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-primary",children:d("deployments.backupsTitle")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:d("deployments.backupsDescription",{agent:r})})]}),(0,a.jsxs)(L,{type:"button",variant:"glass",size:"sm",onClick:()=>f.mutate(),title:k??void 0,disabled:f.isPending||!!k,children:[f.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sU.A,{size:12}),d("deployments.createBackup")]})]}),k?(0,a.jsx)("p",{className:"text-text-muted text-xs",children:k}):null,N?(0,a.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-warning text-xs",children:[(0,a.jsx)(tL.A,{size:13,className:"mt-0.5 shrink-0 animate-spin"}),(0,a.jsx)("span",{children:d("deployments.backupActiveOperation")})]}):null,b.isLoading?(0,a.jsxs)("div",{className:"py-10 text-center text-text-muted text-sm",children:[(0,a.jsx)(tL.A,{size:16,className:"animate-spin inline mr-2"}),d("common.loading")]}):0===j.length?(0,a.jsx)(s1,{icon:sE.A,title:d("deployments.noBackups"),cardVariant:"glass"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"space-y-3 lg:hidden",children:j.map(e=>{let t=e.snapshotName??e.objectKey,s=S(e.phase);return(0,a.jsxs)(en,{variant:"glassPanel",className:"space-y-3 p-4",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)(Y,{variant:"succeeded"===e.status?"success":"failed"===e.status?"danger":"warning",size:"sm",children:C(e.status)}),(0,a.jsx)("p",{className:"mt-2 text-text-muted text-xs",children:w(e.driver)}),s?(0,a.jsx)("p",{className:"mt-1 text-text-muted text-xs",children:d("deployments.backupPhase",{phase:s})}):null]}),A(e,t,"w-full justify-center")]}),(0,a.jsxs)("dl",{className:"space-y-2 text-xs",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("dt",{className:"text-text-muted",children:d("deployments.backupPvc")}),(0,a.jsx)("dd",{className:"mt-1 truncate font-mono text-text-primary",title:e.pvcName,children:e.pvcName})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("dt",{className:"text-text-muted",children:d("deployments.backupSnapshot")}),(0,a.jsx)("dd",{className:"mt-1 truncate font-mono text-text-primary",title:t??void 0,children:t??d("common.none")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("dt",{className:"text-text-muted",children:d("deployments.backupCreatedAt")}),(0,a.jsx)("dd",{className:"mt-1 text-text-primary",children:tV(e.createdAt)}),e.updatedAt?(0,a.jsxs)("dd",{className:"mt-1 text-text-muted",children:[d("deployments.backupUpdatedAt"),": ",tV(e.updatedAt)]}):null]})]}),e.error?(0,a.jsx)("p",{className:"break-words text-danger text-xs",children:e.error}):null]},e.id)})}),(0,a.jsx)(en,{variant:"glassPanel",className:"hidden overflow-x-auto lg:block",children:(0,a.jsxs)(tj,{className:"min-w-[760px]",children:[(0,a.jsx)(tN,{children:(0,a.jsxs)(tw,{children:[(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("deployments.backupStatus")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("deployments.backupDriver")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("deployments.backupPvc")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("deployments.backupSnapshot")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("deployments.backupCreatedAt")}),(0,a.jsx)(tC,{className:"text-right text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("deployments.backupActions")})]})}),(0,a.jsx)(tk,{children:j.map(e=>{let t=e.snapshotName??e.objectKey,s=S(e.phase);return(0,a.jsxs)(tw,{children:[(0,a.jsxs)(tS,{children:[(0,a.jsx)(Y,{variant:"succeeded"===e.status?"success":"failed"===e.status?"danger":"warning",size:"sm",children:C(e.status)}),e.error?(0,a.jsx)("p",{className:"mt-1 max-w-[18rem] break-words text-danger text-xs",children:e.error}):null,s?(0,a.jsx)("p",{className:"mt-1 text-text-muted text-xs",children:d("deployments.backupPhase",{phase:s})}):null]}),(0,a.jsx)(tS,{children:w(e.driver)}),(0,a.jsx)(tS,{className:"font-mono text-xs",children:(0,a.jsx)("span",{title:e.pvcName,className:"block max-w-[12rem] truncate",children:e.pvcName})}),(0,a.jsx)(tS,{className:"font-mono text-xs",children:t?(0,a.jsx)("span",{title:t,className:"block max-w-[18rem] truncate",children:t}):d("common.none")}),(0,a.jsxs)(tS,{children:[(0,a.jsx)("span",{children:tV(e.createdAt)}),e.updatedAt?(0,a.jsxs)("span",{className:"mt-1 block text-text-muted text-xs",children:[d("deployments.backupUpdatedAt"),": ",tV(e.updatedAt)]}):null]}),(0,a.jsx)(tS,{className:"text-right",children:A(e,t)})]},e.id)})})]})})]}),(0,a.jsx)(s0,{open:!!x,onOpenChange:e=>{e||v.isPending||g(null)},title:d("deployments.restoreBackupConfirmTitle"),description:x?d("deployments.restoreBackupConfirmDescription",{artifact:x.snapshotName??x.objectKey,pvc:x.pvcName}):"",confirmText:d("deployments.restoreBackupConfirmAction"),cancelText:d("common.cancel"),loading:v.isPending,onConfirm:()=>{x&&v.mutate(x)}})]})}function af(e){let{namespace:t,agent:s,deployment:r,deployments:n,onSelectAgent:i,onResume:o,resumePending:d,resumeDisabledReason:c}=e,p=sx(),{t:u}=(0,m.Bd)(),x=(0,l.useRef)(null),{lines:g,entries:y,status:h,error:b,connect:f,disconnect:v,clear:j}=ac({maxLines:4e3}),[N,k]=(0,l.useState)("recent"),[w,C]=(0,l.useState)(!1),S="live"===N,{data:A,isLoading:T,refetch:D}=(0,t2.I)({queryKey:["deployment-log-history",t,N],queryFn:()=>p.deployments.logsHistory(t,""),enabled:"recent"===N&&n.length>0});(0,l.useEffect)(()=>{v(),j()},[s,t,v,j]),(0,l.useEffect)(()=>{x.current&&(x.current.scrollTop=x.current.scrollHeight)},[g.length]);let P="connecting"===h||"connected"===h,_=(0,l.useMemo)(()=>y.map(e=>({text:e.text.startsWith("i18n:")?u(e.text.slice(5)):e.text,createdAt:e.createdAt})),[y,u]),R=T||!A?[]:A.lines,F=S?_:R,z=e=>"string"==typeof e?e:e.text;return 0===n.length?(0,a.jsx)(s1,{icon:sO.A,cardVariant:"glass",title:u("deployments.noDeploymentsInNamespace"),description:u("deployments.noDeploymentsInNamespaceDescription",{namespace:t})}):(0,a.jsxs)("div",{className:"space-y-6 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsx)("div",{className:"shrink-0",children:(0,a.jsx)(tT,{value:N,onChange:e=>k(e),children:(0,a.jsx)(s2,{className:"w-fit",activeId:N,onSelect:e=>k(e),tabs:[{id:"recent",label:u("deployments.recentLogs")},{id:"live",label:u("deployments.liveLogs")}]})})}),(0,a.jsx)("div",{className:"ml-auto flex shrink-0 flex-col justify-end gap-2",children:(0,a.jsx)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:S?(0,a.jsxs)(e9,{value:s??"",onValueChange:e=>{i(e)},children:[(0,a.jsx)(te,{className:"w-[240px]",children:(0,a.jsx)(e7,{placeholder:u("deployments.agentSelector")})}),(0,a.jsx)(ta,{children:n.map(e=>(0,a.jsx)(tr,{value:e.name,children:e.name},`${e.namespace}/${e.name}`))})]}):null})})]}),(null==r?void 0:r.runtimeState)==="paused"&&(0,a.jsxs)("div",{className:"flex flex-col gap-3 rounded-xl border border-warning/30 bg-warning/10 px-4 py-3 text-warning sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,a.jsx)(s$.A,{size:14,className:"mt-0.5 shrink-0"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-semibold",children:u("deployments.pausedLogsTitle")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-warning/80",children:u("deployments.pausedLogsDescription")})]})]}),o?(0,a.jsxs)(L,{type:"button",variant:"glass",size:"sm",onClick:o,title:c,disabled:d||!!c,className:"self-start sm:self-center",children:[d?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sI.A,{size:12}),u("deployments.resumeAgent")]}):null]}),b&&"live"===N&&(0,a.jsx)("div",{className:"rounded-lg border border-danger/25 bg-danger/8 px-4 py-3 text-xs text-danger",children:b}),(0,a.jsx)(s6,{headerLeft:(0,a.jsx)("div",{children:(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[t,(null==A?void 0:A.podName)?` \xb7 ${A.podName}`:"",S&&s?` / ${s}`:""]})}),headerRight:(0,a.jsx)(s7,{showTimestampsToggle:!1,showTimestamps:w,onShowTimestampsChange:C,showTimestampsLabel:u("deploy.showTimestamps"),hideTimestampsLabel:u("deploy.hideTimestamps"),actions:[...S&&(_.length>0||P)?[{id:"clear",type:"button",icon:(0,a.jsx)(sM.A,{size:11}),label:u("common.clearAll"),onClick:()=>{v(),j()}}]:[],{id:S?"stream":"refresh",type:"toolbar",icon:(0,a.jsx)(tE.A,{size:12,className:S&&P?"animate-spin":""}),label:S?P?u("deployments.streaming"):u("deployments.connectLogs"):u("common.refresh"),onClick:S?()=>{s&&f(p.deployments.logsUrl(t,s))}:()=>void D(),variant:S?P?"secondary":"primary":"ghost"},{id:"download",type:"toolbar",icon:(0,a.jsx)(sU.A,{size:12}),label:u("deploy.download"),onClick:()=>{if(0===F.length)return;let e=new Blob([F.map(z).join("\n")],{type:"text/plain"}),a=URL.createObjectURL(e),r=document.createElement("a");r.href=a,r.download=`${t}-${S?s??"live":"recent"}-${Date.now()}.log`,r.click(),URL.revokeObjectURL(a)},variant:"ghost"}]}),lines:F,showTimestamps:w,footerRight:S?(0,a.jsx)(s7,{showTimestamps:w,onShowTimestampsChange:C,showTimestampsLabel:u("deploy.showTimestamps"),hideTimestampsLabel:u("deploy.hideTimestamps")}):null,emptyText:S?P?u("deployments.waitingForLogs"):u("deployments.connectLiveLogs"):T?u("common.loading"):u("deployments.noLogsYet"),bodyRef:x,collapseRepeats:!0,footerLeft:(0,a.jsx)("span",{children:u("deploy.logLinesReceived",{count:F.length})}),bodyClassName:"max-h-[16rem]"})]})}function av(e){let{isSubmitting:t,onClose:s,onImport:r}=e,{t:n}=(0,m.Bd)(),[i,o]=(0,l.useState)("AGENT_BROWSER_STORAGE_STATE_JSON"),[d,c]=(0,l.useState)(""),[p,u]=(0,l.useState)(null),x=(0,l.useMemo)(()=>{try{return d.trim()?ay(d,i.trim()):null}catch{return null}},[i,d]);(0,l.useEffect)(()=>{u(null)},[i,d]);let g=async e=>{e&&c(await e.text())};return(0,a.jsx)(e$,{open:!0,onClose:s,children:(0,a.jsxs)(eV,{maxWidth:"max-w-2xl",children:[(0,a.jsx)(eq,{icon:(0,a.jsx)(sV.A,{size:18}),title:n("deployments.cookieJarImportTitle"),subtitle:n("deployments.cookieJarImportDescription"),onClose:s}),(0,a.jsxs)(eB,{children:[(0,a.jsx)(e_,{label:n("deployments.cookieJarEnvKey"),value:i,onChange:e=>o(e.target.value),placeholder:"AGENT_BROWSER_STORAGE_STATE_JSON"}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"ml-1 text-[11px] font-bold uppercase tracking-[0.14em] text-text-muted",children:n("deployments.cookieJarFile")}),(0,a.jsx)(e_,{type:"file",accept:".json,.txt",onChange:e=>{var t;g(null==(t=e.target.files)?void 0:t[0])}})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"ml-1 text-[11px] font-bold uppercase tracking-[0.14em] text-text-muted",children:n("deployments.cookieJarPaste")}),(0,a.jsx)(tD,{value:d,onChange:e=>c(e.target.value),placeholder:n("deployments.cookieJarPastePlaceholder"),className:"min-h-[220px] font-mono text-xs",error:!!p}),p?(0,a.jsx)("p",{className:"text-xs text-danger",children:p}):x?(0,a.jsx)("p",{className:"text-xs text-text-muted",children:n("deployments.cookieJarParsed",{format:x.format,cookies:x.cookieCount,origins:x.originCount})}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:n("deployments.cookieJarFormats")})]})]}),(0,a.jsx)(eK,{children:(0,a.jsxs)(eH,{children:[(0,a.jsx)(L,{type:"button",variant:"ghost",onClick:s,children:n("common.cancel")}),(0,a.jsxs)(L,{type:"button",variant:"primary",disabled:!d.trim()||!i.trim()||t,onClick:()=>{try{let e=ay(d,i.trim());u(null),r(e)}catch{u(n("deployments.cookieJarInvalid"))}},children:[t?(0,a.jsx)(tL.A,{size:14,className:"animate-spin"}):(0,a.jsx)(sq.A,{size:14}),n("deployments.cookieJarImportAction")]})]})})]})})}function aj(e){var t,s,r;let{namespace:i}=e,o=sx(),{t:d}=(0,m.Bd)(),c=sg(),p=(0,n.jE)(),[u,x]=(0,l.useState)(null),[g,y]=(0,l.useState)(null),[h,b]=(0,l.useState)(null),f=(0,t2.I)({queryKey:["deployment-env",i,"scoped"],queryFn:()=>o.deployments.env.list(i,"scoped")}),v=(0,t2.I)({queryKey:["deployment-env",i,"effective"],queryFn:()=>o.deployments.env.list(i,"effective")}),j=(null==(t=f.data)?void 0:t.envVars)??[],N=(0,l.useMemo)(()=>{var e,t;let s=null==(e=f.data)?void 0:e.scope;return((null==(t=v.data)?void 0:t.envVars)??[]).filter(e=>e.scope!==s)},[null==(s=v.data)?void 0:s.envVars,null==(r=f.data)?void 0:r.scope]),k=(0,t5.n)({mutationFn:async e=>{await o.deployments.env.upsert(i,e.key,e.value,e.isSecret)},onSuccess:()=>{p.invalidateQueries({queryKey:["deployment-env",i]}),x(null),y(null),c.success(d("secrets.valueSaved"))},onError:()=>c.error(d("secrets.valueSaveFailed"))}),w=(0,t5.n)({mutationFn:e=>o.deployments.env.delete(i,e),onSuccess:()=>{p.invalidateQueries({queryKey:["deployment-env",i]}),b(null),c.success(d("secrets.valueDeleted"))},onError:()=>c.error(d("secrets.valueDeleteFailed"))}),C=(0,t5.n)({mutationFn:async e=>(await o.deployments.env.upsert(i,e.envKey,e.value,!0),e),onSuccess:e=>{p.invalidateQueries({queryKey:["deployment-env",i]}),x(null),c.success(d("deployments.cookieJarImported",{key:e.envKey,cookies:e.cookieCount}))},onError:()=>c.error(d("deployments.cookieJarImportFailed"))}),S=async e=>{try{let{envVar:t}=await o.deployments.env.getOne(i,e.key);y({key:t.key,value:t.value,isSecret:t.isSecret}),x("edit")}catch{c.error(d("secrets.valueLoadFailed"))}};return f.isLoading||v.isLoading?(0,a.jsxs)("div",{className:"flex items-center justify-center py-14 text-text-muted text-sm",children:[(0,a.jsx)(tL.A,{size:16,className:"animate-spin mr-2"}),d("common.loading")]}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-3",children:[(0,a.jsxs)(en,{variant:"glassPanel",className:"p-4",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-sm font-semibold text-text-primary",children:[(0,a.jsx)(sB.A,{size:14,className:"text-primary"}),d("deployments.envGuideScopedTitle")]}),(0,a.jsx)("p",{className:"text-xs leading-relaxed text-text-muted",children:d("deployments.envGuideScopedDescription")})]}),(0,a.jsxs)(en,{variant:"glassPanel",className:"p-4",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-sm font-semibold text-text-primary",children:[(0,a.jsx)(sK.A,{size:14,className:"text-accent"}),d("deployments.envGuideGlobalTitle")]}),(0,a.jsx)("p",{className:"text-xs leading-relaxed text-text-muted",children:d("deployments.envGuideGlobalDescription")})]}),(0,a.jsxs)(en,{variant:"glassPanel",className:"p-4",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-sm font-semibold text-text-primary",children:[(0,a.jsx)(sV.A,{size:14,className:"text-warning"}),d("deployments.cookieJarTitle")]}),(0,a.jsx)("p",{className:"mb-3 text-xs leading-relaxed text-text-muted",children:d("deployments.cookieJarDescription")}),(0,a.jsxs)("button",{type:"button",onPointerDown:()=>x("cookie"),onClick:()=>x("cookie"),className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-full border border-white/10 bg-white/5 px-4 text-xs font-black uppercase tracking-widest text-text-primary shadow-[0_8px_32px_rgba(0,0,0,0.1),inset_0_1px_1px_rgba(255,255,255,0.05)] transition-all hover:-translate-y-0.5 hover:bg-white/10 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-primary/10",children:[(0,a.jsx)(sq.A,{size:12}),d("deployments.cookieJarImportAction")]})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary",children:d("deployments.scopedEnvTitle")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:d("deployments.scopedEnvDescription")})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,a.jsxs)(L,{type:"button",onPointerDown:()=>x("cookie"),onClick:()=>x("cookie"),variant:"glass",size:"sm",className:"transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease active:translate-y-[0.5px] focus-visible:outline-none",children:[(0,a.jsx)(sq.A,{size:11}),d("deployments.cookieJarImportAction")]}),(0,a.jsxs)(L,{type:"button",onClick:()=>{y(null),x("create")},variant:"primary",size:"sm",className:"transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease active:translate-y-[0.5px] focus-visible:outline-none",children:[(0,a.jsx)(sH.A,{size:11}),d("common.add")]})]})]}),0===j.length?(0,a.jsx)(s1,{icon:sB.A,title:d("deployments.noScopedEnv"),cardVariant:"glass"}):(0,a.jsx)(en,{variant:"glassPanel",children:(0,a.jsxs)(tj,{children:[(0,a.jsx)(tN,{children:(0,a.jsxs)(tw,{children:[(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("secrets.keyName")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("secrets.secretValue")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("secrets.secret")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("common.actions")})]})}),(0,a.jsx)(tk,{children:j.map(e=>(0,a.jsxs)(tw,{children:[(0,a.jsx)(tS,{children:e.key}),(0,a.jsx)(tS,{children:e.maskedValue}),(0,a.jsx)(tS,{children:e.isSecret?(0,a.jsx)(Y,{variant:"warning",size:"sm",children:d("secrets.secret")}):(0,a.jsx)(Y,{variant:"neutral",size:"sm",children:d("deployments.plainText")})}),(0,a.jsx)(tS,{children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(L,{type:"button",onClick:()=>void S(e),variant:"ghost",size:"icon",className:"transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease active:translate-y-[0.5px] focus-visible:outline-none",children:(0,a.jsx)(sW.A,{size:12})}),(0,a.jsx)(L,{type:"button",onClick:()=>b(e.key),variant:"ghost",size:"icon",className:"transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease active:translate-y-[0.5px] focus-visible:outline-none",children:(0,a.jsx)(sJ.A,{size:12})})]})})]},e.key))})]})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary mb-2",children:d("deployments.fallbackEnvTitle")}),(0,a.jsx)("p",{className:"text-xs text-text-muted mb-3",children:d("deployments.fallbackEnvDescription")}),0===N.length?(0,a.jsx)(s1,{icon:sB.A,title:d("deployments.noFallbackEnv"),cardVariant:"glass"}):(0,a.jsx)(en,{variant:"glassPanel",children:(0,a.jsxs)(tj,{children:[(0,a.jsx)(tN,{children:(0,a.jsxs)(tw,{children:[(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("secrets.keyName")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("secrets.secretValue")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:d("secrets.scope")})]})}),(0,a.jsx)(tk,{children:N.map(e=>(0,a.jsxs)(tw,{children:[(0,a.jsx)(tS,{children:e.key}),(0,a.jsx)(tS,{children:e.maskedValue}),(0,a.jsx)(tS,{children:(0,a.jsx)(Y,{variant:"neutral",size:"sm",children:"global"===e.scope?d("deployments.globalFallback"):d("deployments.namespaceScoped")})})]},`${e.scope}-${e.key}`))})]})})]}),("create"===u||"edit"===u)&&(0,a.jsx)(s8,{mode:u,initial:g??void 0,isSubmitting:k.isPending,titleCreate:d("deployments.addScopedEnv"),titleEdit:d("deployments.editScopedEnv"),subtitleCreate:d("deployments.scopedEnvDescription"),subtitleEdit:d("deployments.scopedEnvDescription"),onSubmit:e=>k.mutate(e),onClose:()=>{x(null),y(null)}}),(0,a.jsx)(s0,{open:!!h,onOpenChange:e=>{e||b(null)},title:d("common.delete"),description:h?d("deployments.deleteScopedEnvConfirm",{key:h}):"",confirmText:d("common.delete"),cancelText:d("common.cancel"),loading:w.isPending,onConfirm:()=>{h&&w.mutate(h)}}),"cookie"===u&&(0,a.jsx)(av,{isSubmitting:C.isPending,onClose:()=>x(null),onImport:e=>C.mutate(e)})]})}function aN(e){let{namespace:t}=e,s=sx(),{t:r,i18n:n}=(0,m.Bd)(),{data:i,isLoading:l}=(0,t2.I)({queryKey:["namespace-costs",t],queryFn:()=>s.deployments.namespaceCosts(t),refetchInterval:3e4,staleTime:1e4});return l?(0,a.jsxs)("div",{className:"flex items-center justify-center py-14 text-text-muted text-sm",children:[(0,a.jsx)(tL.A,{size:16,className:"animate-spin mr-2"}),r("common.loading")]}):i?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)(an,{className:"mb-4 grid-cols-1 md:grid-cols-2 xl:grid-cols-4",children:[(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.tokenCost"),value:am(i.totalUsd,n.language),icon:(0,a.jsx)(sQ.A,{size:13}),iconClassName:"text-success",valueClassName:"text-success"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.totalTokens"),value:au(i.totalTokens,n.language),icon:(0,a.jsx)(sG.A,{size:13}),iconClassName:"text-accent",valueClassName:"text-accent"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.availableAgents"),value:i.availableAgents,icon:(0,a.jsx)(sY.A,{size:13}),iconClassName:"text-primary",valueClassName:"text-primary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.unavailableAgents"),value:i.unavailableAgents,icon:(0,a.jsx)(sM.A,{size:13}),iconClassName:i.unavailableAgents>0?"text-warning":"text-text-muted",valueClassName:i.unavailableAgents>0?"text-warning":"text-text-muted"})})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted",children:[r("deployments.generatedAt"),": ",tV(i.generatedAt)]}),(0,a.jsx)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:i.agents.map(e=>{let t;return(0,a.jsxs)(en,{variant:"glassPanel",className:"min-w-0 p-5",children:[(0,a.jsxs)("div",{className:"mb-3 flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("p",{className:"text-sm font-mono text-text-primary",children:e.agentName}),(0,a.jsx)(Y,{variant:null!==e.totalUsd?"success":"neutral",size:"sm",children:e.source})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted mt-1",children:e.podName??r("common.none")})]}),(0,a.jsxs)("div",{className:"min-w-0 text-left md:max-w-[14rem] md:text-right",children:[(0,a.jsx)("p",{className:"break-words text-lg font-semibold leading-tight text-success",children:ap(e,{locale:n.language,shrimpUnitLabel:r("deploy.shrimpCoins")})}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:r("deployments.totalCost")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:ax(e.totalTokens,n.language,r("deployments.tokens"))})]})]}),e.providers.length>0?(0,a.jsx)("div",{className:"space-y-2",children:e.providers.map(t=>{var s;let l,o,d=(s={billingUnit:i.billingUnit,locale:n.language,tokenLabel:r("deployments.tokens")},l=null!==t.totalTokens?ax(t.totalTokens,s.locale,s.tokenLabel):null,o=t.usageLabel??t.raw??null,"shrimp"===s.billingUnit?{primary:l??o??"—",secondary:o&&o!==l?o:null}:{primary:am(t.amountUsd,s.locale),secondary:l??o});return(0,a.jsxs)("div",{className:"flex flex-col gap-1 text-xs sm:flex-row sm:items-center sm:justify-between sm:gap-3",children:[(0,a.jsx)("span",{className:"text-text-secondary",children:t.provider}),(0,a.jsxs)("div",{className:"min-w-0 text-left sm:text-right",children:[(0,a.jsx)("p",{className:"break-words text-text-secondary",children:d.primary}),d.secondary?(0,a.jsx)("p",{className:"break-words text-text-muted",children:d.secondary}):null]})]},`${e.agentName}-${t.provider}`)})}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:r("deployments.noProvidersReported")}),e.message&&(0,a.jsx)("p",{className:"text-xs text-warning mt-3",children:(t=e.message).startsWith("i18n:")?r(t.slice(5)):t})]},e.agentName)})})]}):(0,a.jsx)(s1,{icon:sQ.A,cardVariant:"glass",title:r("deployments.costUnavailable"),description:r("deployments.costUnavailableDescription")})}function ak(e){var t,s,r;let{namespace:i,latestTaskId:l}=e,o=sx(),{t:d}=(0,m.Bd)(),c=sg(),p=(0,sR.Z)(),u=(0,n.jE)(),x=(0,t2.I)({queryKey:["deployment-manifest",i],queryFn:()=>o.deployments.manifest(i),staleTime:1e4}),g=async e=>{if(!l)throw Error("No deployment task found");return o.deployTasks.redeployToTaskId(l,e)},y=(0,t5.n)({mutationFn:()=>g({mode:"snapshot"}),onSuccess:e=>{e&&(u.invalidateQueries({queryKey:["deploy-tasks"]}),u.invalidateQueries({queryKey:["deployments"]}),p({to:"/deploy-tasks/$taskId",params:{taskId:String(e)}}))},onError:e=>c.error(`${d("deployments.redeployFailed")}: ${ag(e)}`)}),h=(0,t5.n)({mutationFn:()=>{var e;return g({mode:"template",templateSlug:(null==(e=x.data)?void 0:e.templateSlug)??void 0})},onSuccess:e=>{e&&(u.invalidateQueries({queryKey:["deploy-tasks"]}),u.invalidateQueries({queryKey:["deployments"]}),u.invalidateQueries({queryKey:["deployment-manifest",i]}),p({to:"/deploy-tasks/$taskId",params:{taskId:String(e)}}))},onError:e=>c.error(`${d("deployments.redeployFailed")}: ${ag(e)}`)}),b=(0,t5.n)({mutationFn:async()=>{var e,t,s;return await o.deployments.syncTemplate(i,{name:(null==(t=x.data)||null==(e=t.template)?void 0:e.name)??(null==(s=x.data)?void 0:s.templateSlug)??i})},onSuccess:e=>{u.invalidateQueries({queryKey:["deployment-manifest",i]}),u.invalidateQueries({queryKey:["deployments"]}),c.success("updated"===e.action?d("deployments.templateUpdated"):d("deployments.templateForked",{name:e.template.slug}))},onError:e=>c.error(`${d("deployments.templateSyncFailed")}: ${ag(e)}`)}),f=(0,t5.n)({mutationFn:async()=>{var e,t,s;return g({mode:"template",templateSlug:(await o.deployments.syncTemplate(i,{name:(null==(t=x.data)||null==(e=t.template)?void 0:e.name)??(null==(s=x.data)?void 0:s.templateSlug)??i})).template.slug})},onSuccess:e=>{u.invalidateQueries({queryKey:["deployment-manifest",i]}),u.invalidateQueries({queryKey:["deploy-tasks"]}),u.invalidateQueries({queryKey:["deployments"]}),e&&p({to:"/deploy-tasks/$taskId",params:{taskId:String(e)}})},onError:e=>c.error(`${d("deployments.templateSyncRedeployFailed")}: ${ag(e)}`)}),v=x.data,j=y.isPending||h.isPending||b.isPending||f.isPending,N=(null==v?void 0:v.templateSlug)??d("common.none"),k=!!(l&&(null==v?void 0:v.templateSlug)&&(null==v?void 0:v.drift.templateAvailable));return(0,a.jsxs)(en,{variant:"glassPanel",className:"p-5",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(sK.A,{size:15,className:"text-primary"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary",children:d("deployments.templateManifestTitle")})]}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:d("deployments.templateManifestDescription")})]}),(0,a.jsx)(Y,{variant:"up-to-date"===(r=(null==v?void 0:v.drift.status)??"unknown")?"success":"template-updated"===r?"warning":"missing-template"===r?"danger":"neutral",size:"sm",children:d(`deployments.manifestDrift.${(null==v?void 0:v.drift.status)??"unknown"}`)})]}),x.isLoading?(0,a.jsxs)("div",{className:"flex items-center py-6 text-sm text-text-muted",children:[(0,a.jsx)(tL.A,{size:15,className:"mr-2 animate-spin"}),d("common.loading")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-4",children:[(0,a.jsxs)("div",{className:"min-w-0 rounded-xl border border-border-subtle bg-bg-secondary/40 p-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-text-muted",children:d("deployments.templateSlug")}),(0,a.jsx)("p",{className:"mt-1 truncate font-mono text-sm text-text-primary",children:N})]}),(0,a.jsxs)("div",{className:"min-w-0 rounded-xl border border-border-subtle bg-bg-secondary/40 p-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-text-muted",children:d("deployments.manifestRevision")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-primary",children:(null==v||null==(t=v.manifest)?void 0:t.revision)??d("common.none")})]}),(0,a.jsxs)("div",{className:"min-w-0 rounded-xl border border-border-subtle bg-bg-secondary/40 p-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-text-muted",children:d("deployments.configHash")}),(0,a.jsx)("p",{className:"mt-1 truncate font-mono text-sm text-text-primary",children:(null==v?void 0:v.drift.configHash)??d("common.none")})]}),(0,a.jsxs)("div",{className:"min-w-0 rounded-xl border border-border-subtle bg-bg-secondary/40 p-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-bold uppercase tracking-[0.12em] text-text-muted",children:d("deployments.templateUpdatedAt")}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-primary",children:(null==v||null==(s=v.template)?void 0:s.updatedAt)?tV(v.template.updatedAt):d("common.none")})]})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[(0,a.jsxs)(L,{type:"button",variant:"glass",size:"sm",disabled:!l||j,onClick:()=>y.mutate(),children:[y.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sL.A,{size:12}),d("deployments.redeploySnapshot")]}),(0,a.jsxs)(L,{type:"button",variant:"glass",size:"sm",disabled:!k||j,onClick:()=>h.mutate(),children:[h.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sZ.A,{size:12}),d("deployments.redeployLatestTemplate")]}),(0,a.jsxs)(L,{type:"button",variant:"glass",size:"sm",disabled:!v||j,onClick:()=>b.mutate(),children:[b.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(ss.A,{size:12}),d("deployments.saveEditableTemplate")]}),(0,a.jsxs)(L,{type:"button",variant:"primary",size:"sm",disabled:!l||!v||j,onClick:()=>f.mutate(),children:[f.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sZ.A,{size:12}),d("deployments.saveTemplateAndRedeploy")]})]})]})]})}function aw(e){let{namespace:t,agent:s,deployment:r,deployments:n,pods:i,latestTaskId:l}=e,{t:o}=(0,m.Bd)(),d=n.filter(e=>tM(e.ready)).length,c=(null==i?void 0:i.reduce((e,t)=>e+Number(t.restarts),0))??0;return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(ak,{namespace:t,latestTaskId:l}),(0,a.jsxs)(en,{variant:"glassPanel",className:"overflow-hidden p-0",children:[(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.namespaceLabel")}),(0,a.jsx)("span",{className:"text-sm font-mono text-text-secondary",children:t})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.agents")}),(0,a.jsx)("span",{className:"text-sm text-text-secondary",children:n.length})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.readyAgents")}),(0,a.jsx)("span",{className:"text-sm text-success",children:d})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.currentAgent")}),(0,a.jsx)("span",{className:"text-sm font-mono text-text-secondary",children:s??o("common.none")})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.workloadKind")}),(0,a.jsx)("span",{className:"text-sm text-text-secondary",children:(null==r?void 0:r.workloadKind)??"deployment"})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.runtimeStateLabel")}),(0,a.jsx)("span",{className:"text-sm text-text-secondary",children:o(`deployments.runtimeState.${(null==r?void 0:r.runtimeState)??"unknown"}`)})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.sandboxName")}),(0,a.jsx)("span",{className:"text-sm font-mono text-text-secondary",children:(null==r?void 0:r.sandboxName)??o("common.none")})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.statePvc")}),(0,a.jsx)("span",{className:"text-sm font-mono text-text-secondary",children:(null==r?void 0:r.statePvc)??o("common.none")})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.serviceFQDN")}),(0,a.jsx)("span",{className:"break-all text-right text-sm font-mono text-text-secondary",children:(null==r?void 0:r.serviceFQDN)??o("common.none")})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.lastActiveAt")}),(0,a.jsx)("span",{className:"text-right text-sm text-text-secondary",children:(null==r?void 0:r.lastActiveAt)?tV(r.lastActiveAt):o("common.none")})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.pausedAt")}),(0,a.jsx)("span",{className:"text-right text-sm text-text-secondary",children:(null==r?void 0:r.pausedAt)?tV(r.pausedAt):o("common.none")})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between border-b border-border-subtle",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.selectedPods")}),(0,a.jsx)("span",{className:"text-sm text-text-secondary",children:(null==i?void 0:i.length)??0})]}),(0,a.jsxs)("div",{className:"px-5 py-3 flex items-center justify-between",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:o("deployments.totalRestarts")}),(0,a.jsx)("span",{className:t$("text-sm",c>0?"text-warning":"text-text-secondary"),children:c})]})]})]})}var aC=s(18656),aS=s(82041);function aA(e){let{leading:t,main:s,sub:r,trailing:n,className:i}=e;return(0,a.jsxs)("div",{className:t$("px-5 py-3 flex items-center justify-between gap-3 transition-colors hover:bg-bg-modifier-hover/70",i),children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[t,(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"min-w-0",children:s}),r?(0,a.jsx)("div",{className:"mt-0.5 text-xs text-text-muted",children:r}):null]})]}),n?(0,a.jsx)("div",{className:"shrink-0",children:n}):null]})}function aT(e){let{headerLeft:t,headerRight:s,rows:r,footer:n,className:i}=e;return(0,a.jsxs)(en,{variant:"glassPanel",className:t$("rounded-xl border border-border-subtle bg-bg-secondary/20",i),children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 border-b border-[var(--glass-line)] px-4 py-3 md:flex-row md:items-center md:justify-between",children:[(0,a.jsx)("div",{className:"min-w-0",children:t}),s?(0,a.jsx)("div",{className:"w-full min-w-0 md:w-auto md:shrink-0",children:s}):null]}),(0,a.jsx)("div",{className:"divide-y divide-[var(--glass-line-soft)]",children:r}),n?(0,a.jsx)("div",{className:"flex flex-col gap-2 border-t border-[var(--glass-line)] bg-bg-secondary/35 px-4 py-2.5 md:flex-row md:items-center md:justify-between",children:n}):null]})}function aD(e){let{id:t,statusLabel:s,statusVariant:r,running:n,timestamp:i,meta:l,error:o,actions:d,className:c}=e;return(0,a.jsxs)(en,{variant:"glassPanel",className:t$("rounded-xl border border-border-subtle bg-bg-secondary/20 p-4",c),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-sm font-semibold text-text-primary",children:["#",t]}),(0,a.jsx)(Y,{variant:r,size:"sm",children:s}),n?(0,a.jsx)(tL.A,{size:12,className:"animate-spin text-primary"}):null]}),(0,a.jsx)("span",{className:"text-xs text-text-muted",children:i})]}),l?(0,a.jsx)("div",{className:"mt-1.5 flex items-center gap-3 text-xs text-text-muted",children:l}):null,o?(0,a.jsx)("div",{className:"mt-2 truncate text-xs text-danger",children:o}):null,d?(0,a.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:d}):null]})}function aP(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,[s,a]=(0,l.useState)(e);return(0,l.useEffect)(()=>{let s=setTimeout(()=>a(e),t);return()=>clearTimeout(s)},[e,t]),s}function a_(e){return"deployed"===e||"destroyed"===e?"success":"failed"===e?"danger":"running"===e||"paused"===e||"resuming"===e||"deploying"===e||"destroying"===e?"info":"pending"===e||"cancelling"===e?"warning":"neutral"}function aR(e){let{dep:t}=e,{t:s}=(0,m.Bd)(),r=tM(t.ready),n=t.runtimeState??(r?"running":"unknown"),i="paused"===n?"info":"failed"===n?"error":r?"success":"warning";return(0,a.jsx)(aA,{leading:(0,a.jsx)(ao,{status:i}),main:(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:t.namespace},className:"block truncate font-mono text-sm text-primary transition-colors hover:text-primary-strong",children:t.name}),sub:(0,a.jsxs)("span",{className:"inline-flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{children:tq(t.age)}),"agent-sandbox"===t.workloadKind&&(0,a.jsx)(Y,{variant:"neutral",size:"xs",children:"agent-sandbox"}),t.sandboxName&&(0,a.jsxs)("span",{className:"max-w-[220px] truncate rounded-full border border-border-subtle bg-bg-secondary px-2 py-0.5 font-mono text-[11px] text-text-muted",children:[s("deployments.sandboxShort"),": ",t.sandboxName]}),t.statePvc&&(0,a.jsx)("span",{className:"max-w-[220px] truncate rounded-full border border-border-subtle bg-bg-secondary px-2 py-0.5 font-mono text-[11px] text-text-muted",children:t.statePvc})]}),trailing:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["agent-sandbox"===t.workloadKind&&(0,a.jsx)(Y,{variant:"running"===n?"success":"paused"===n?"info":"failed"===n?"danger":"warning",size:"sm",children:s(`deployments.runtimeState.${n}`)}),(0,a.jsx)(ad,{dotStatus:i,badgeVariant:r?"success":"warning",badgeText:t.ready}),(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:t.namespace},className:"text-text-muted transition-colors hover:text-text-primary",children:(0,a.jsx)(aC.A,{size:14})})]})})}function aF(e){var t,s;let{group:r,isDestroying:n,isDiscovered:i,onDestroy:l,onRedeploy:o}=e,{t:d}=(0,m.Bd)(),c=r.latestTask,p=`${r.readyCount}/${r.totalCount} ${d("clusters.ready").toLowerCase()}`;return(0,a.jsx)(aT,{headerLeft:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"rounded-lg bg-primary/10 p-2",children:(0,a.jsx)(sX.A,{size:16,className:"text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:r.namespace},className:"text-sm font-semibold text-text-primary transition-colors hover:text-primary",children:r.namespace}),i&&(0,a.jsx)("span",{className:"rounded px-1.5 py-0.5 text-xs text-warning border border-warning/30 bg-warning/10",children:d("clusters.discovered")})]}),(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs",children:[(0,a.jsx)("span",{className:"rounded-full border border-border-subtle bg-bg-secondary px-2 py-0.5 text-text-subtle",children:p}),r.sandboxCount>0&&(0,a.jsx)("span",{className:"rounded-full border border-primary/30 bg-primary/10 px-2 py-0.5 text-primary",children:d("deployments.agentSandboxCount",{count:r.sandboxCount})}),r.pausedCount>0&&(0,a.jsx)("span",{className:"rounded-full border border-warning/30 bg-warning/10 px-2 py-0.5 text-warning",children:d("deployments.pausedCount",{count:r.pausedCount})}),r.resumingCount>0&&(0,a.jsx)("span",{className:"rounded-full border border-primary/30 bg-primary/10 px-2 py-0.5 text-primary",children:d("deployments.resumingCount",{count:r.resumingCount})}),(0,a.jsxs)("span",{className:"text-text-muted",children:[r.totalCount," ",(t=r.totalCount,s="deployment",1===t?s:(void 0)??`${s}s`)]})]})]})]}),headerRight:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[c&&(0,a.jsx)(s9,{type:"button",variant:"primary",onClick:()=>o(c.task.id),icon:(0,a.jsx)(tE.A,{size:11}),label:d("deployTask.redeploy")}),(0,a.jsx)(s9,{type:"button",variant:"danger",onClick:()=>l(r.namespace),disabled:n,icon:n?(0,a.jsx)(tL.A,{size:11,className:"animate-spin"}):(0,a.jsx)(sJ.A,{size:11}),label:d("clusters.destroy")})]}),rows:r.deployments.map(e=>(0,a.jsx)(aR,{dep:e},`${e.namespace}/${e.name}`)),footer:c?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)(aS.A,{size:12}),(0,a.jsx)(Y,{variant:a_(c.task.status),size:"sm",children:d(`deployTask.statuses.${c.task.status}`)}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)(tJ.N_,{to:"/deploy-tasks/$taskId",params:{taskId:String(c.task.id)},className:"text-primary transition-colors hover:text-primary-strong",children:["#",c.task.id]}),c.task.blockedBy&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("span",{children:[d("deployTask.blockedBy")," #",c.task.blockedBy.id]})]})]}):null})}function az(e){let{tasks:t}=e,{t:s}=(0,m.Bd)();return 0===t.length?(0,a.jsx)(s1,{icon:aS.A,title:s("deployTask.noTasks"),cardVariant:"glassPanel",className:"p-0"}):(0,a.jsx)("div",{className:"space-y-2",children:t.map(e=>{let{task:t,active:r}=e,n=r||"running"===t.status||"pending"===t.status||"deploying"===t.status||"cancelling"===t.status||"destroying"===t.status;return(0,a.jsx)(tJ.N_,{to:"/deploy-tasks/$taskId",params:{taskId:String(t.id)},className:"block",children:(0,a.jsx)(aD,{id:t.id,statusLabel:s(`deployTask.statuses.${t.status}`),statusVariant:a_(t.status),running:n,timestamp:tV(t.updatedAt??t.createdAt),meta:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:t.namespace}),t.templateSlug&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)("span",{children:t.templateSlug})]}),t.blockedBy&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsxs)("span",{children:[s("deployTask.blockedBy")," #",t.blockedBy.id]})]})]})})},t.id)})})}let aI=new Set(["pending","running","deploying","destroying","cancelling"]),aE=new Set(["pending","running","deploying","destroying"]);var aL=s(60077),aU=s(2856),aO=s(78462),a$=s(33723),aM=s(73623),aV=s(50819),aq=s(4244),aB=s(36259),aK=s(98186),aH=s(56147),aW=s(77435);let aJ={info:{banner:"bg-primary/8 border-primary/25",title:"text-primary",icon:"text-primary",listIcon:"text-success"},warning:{banner:"bg-warning/8 border-warning/25",title:"text-warning",icon:"text-warning",listIcon:"text-warning"},success:{banner:"bg-success/8 border-success/25",title:"text-success",icon:"text-success",listIcon:"text-success"},danger:{banner:"bg-danger/8 border-danger/25",title:"text-danger",icon:"text-danger",listIcon:"text-danger"}};function aQ(e){let{variant:t,icon:s,title:r,children:n,className:i}=e,l=aJ[t];return(0,a.jsxs)("div",{className:t$("rounded-lg border p-4",l.banner,i),children:[(0,a.jsxs)("h4",{className:t$("mb-2 flex items-center gap-2 text-sm font-medium",l.title),children:[(0,a.jsx)(s,{size:13,className:l.icon}),r]}),n]})}function aG(e){let{variant:t,items:s,bulletIcon:r}=e,n=aJ[t];return(0,a.jsx)("ul",{className:"space-y-2",children:s.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-2 text-sm text-text-secondary",children:[(0,a.jsx)(r,{size:13,className:t$("shrink-0",n.listIcon)}),e]},e))})}function aY(e){return e.toLowerCase().split("_").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}let aZ="default",aX=new Set(["OPENAI_COMPATIBLE_API_KEY","OPENAI_COMPATIBLE_BASE_URL","OPENAI_COMPATIBLE_MODEL_ID"]);function a0(e,t){return"official"===t&&aX.has(e)}function a1(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}let a2={remember:!0,bindNamespace:!0,groupName:aZ};function a5(e){var t;return{...a2,...e,groupName:(null==e||null==(t=e.groupName)?void 0:t.trim())||aZ}}function a3(e){return[...new Set(e)].sort((e,t)=>e===aZ?-1:t===aZ?1:e.localeCompare(t))}function a4(e){var t,s;let{name:r}=e,n=sx(),{t:i,i18n:l}=(0,m.Bd)(),{data:o,isError:d}=(0,t2.I)({queryKey:["template-detail",r,l.language],queryFn:()=>n.templates.detail(r,l.language),retry:!1}),{data:c}=(0,t2.I)({queryKey:["my-template-detail",r],queryFn:()=>n.myTemplates.get(r),enabled:d,retry:!1}),p=null==o?void 0:o.template,u=(null==p?void 0:p.title)||r;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(eS,{className:"rounded-2xl bg-bg-secondary/18 p-5",children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-1",children:i("deploy.reviewTemplate")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:i("deploy.confirmDeployKubernetes")})]}),(0,a.jsxs)("div",{className:"flex items-start gap-4",children:[(0,a.jsx)("span",{className:"text-4xl",children:(null==p?void 0:p.emoji)??"\uD83D\uDCE6"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("h3",{className:"text-xl font-bold mb-1",children:u}),(0,a.jsx)("p",{className:"text-sm text-text-secondary mb-3",children:(null==p?void 0:p.description)??i(c?"deploy.ownTemplateDescription":"common.loading")}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[p&&(0,a.jsx)(Y,{variant:"neutral",children:(t=p.category,i(`store.categories.${t}`))}),p&&(0,a.jsx)(Y,{variant:"neutral",children:(s=p.difficulty,i(`store.difficulties.${s}`))}),(null==p?void 0:p.featured)&&(0,a.jsxs)(Y,{variant:"info",children:[(0,a.jsx)(aL.A,{size:10}),i("store.featured")]})]}),(0,a.jsxs)(an,{className:"mb-0 mt-1 grid-cols-1 md:grid-cols-3",children:[(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deploy.agentsLabel"),value:(null==p?void 0:p.agentCount)??"—",icon:(0,a.jsx)(aU.A,{size:11}),iconClassName:"text-text-muted",valueClassName:"text-lg font-semibold"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deploy.namespaceLabel"),value:(null==p?void 0:p.namespace)??"—",icon:(0,a.jsx)(sX.A,{size:11}),iconClassName:"text-text-muted",valueClassName:"text-sm font-mono"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deploy.deployTimeLabel"),value:(null==p?void 0:p.estimatedDeployTime)??"—",icon:(0,a.jsx)(aO.A,{size:11}),iconClassName:"text-text-muted",valueClassName:"text-sm"})})]})]})]})]}),((null==p?void 0:p.requirements.length)??0)>0&&(0,a.jsx)(aQ,{variant:"warning",icon:tI.A,title:i("deploy.prerequisites"),children:(0,a.jsx)(aG,{variant:"warning",items:(null==p?void 0:p.requirements)??[],bulletIcon:aC.A})})]})}function a8(e){let{envKey:t,label:s,description:r,placeholder:n,required:i=!0,isSecret:l=!1,value:o,hasSaved:d,error:c,errorMessage:m,inputRef:p,onValueChange:u,onInputBlur:x,onUseSaved:g,onOverrideSaved:y,t:h}=e,b=`deploy-env-${t.toLowerCase()}`,f=`${b}-error`,v="__SAVED__"===o,j=v||!!o.trim();return(0,a.jsxs)("div",{className:t$("space-y-3 rounded-xl p-3 transition-colors",c?"bg-danger/8":j?"bg-success/8":"bg-bg-secondary/15"),children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("label",{htmlFor:v?void 0:b,className:t$("flex flex-wrap items-center gap-1.5 text-sm font-semibold",c?"text-danger":"text-text-primary"),children:[c?(0,a.jsx)(sM.A,{size:13,className:"text-danger"}):j?(0,a.jsx)(sY.A,{size:13,className:"text-success"}):l?(0,a.jsx)(a$.A,{size:13,className:"text-text-muted"}):i?(0,a.jsx)(tI.A,{size:13,className:"text-warning"}):(0,a.jsx)(a$.A,{size:13,className:"text-text-muted"}),(0,a.jsx)("span",{children:s||t}),(0,a.jsx)("span",{className:"rounded bg-bg-tertiary px-1.5 py-0.5 font-mono text-[10px] font-medium text-text-muted",children:t}),(0,a.jsx)("span",{className:t$("rounded-full px-1.5 py-0.5 text-[10px] font-semibold",i?"bg-warning/12 text-warning":"bg-bg-tertiary text-text-muted"),children:h(i?"deploy.requiredBadge":"deploy.optionalBadge")}),d&&(0,a.jsx)("span",{className:"rounded-full bg-success/10 px-1.5 py-0.5 text-[10px] font-semibold text-success",children:h("deploy.savedBadge")})]}),r&&(0,a.jsx)("p",{className:"text-xs leading-relaxed text-text-muted",children:r})]}),v?(0,a.jsxs)("div",{className:t$("flex items-center gap-2 rounded-lg px-3 py-2 transition-colors",c?"bg-danger/12":"bg-success/8"),children:[(0,a.jsx)(sY.A,{size:12,className:"text-success shrink-0"}),(0,a.jsx)("span",{className:"flex-1 text-xs text-success font-mono",children:h("deploy.usingSavedValue")}),(0,a.jsx)("button",{type:"button",onClick:y,className:"text-[11px] text-text-muted hover:text-text-primary transition-colors shrink-0",children:h("deploy.override")})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-xl p-1 transition-colors",children:[l?(0,a.jsx)(e4,{id:b,"data-testid":b,value:o,onChange:e=>u(e.target.value),onBlur:x,placeholder:n,autoComplete:"new-password",className:"flex-1",error:c,ref:p,"aria-invalid":c,"aria-describedby":m?f:void 0,"data-bwignore":"true"}):(0,a.jsx)(e_,{id:b,"data-testid":b,type:"text",value:o,onChange:e=>u(e.target.value),onBlur:x,placeholder:n,autoComplete:"SHADOW_SERVER_URL"===t?"url":"off",className:"flex-1",error:c,ref:p,"aria-invalid":c,"aria-describedby":m?f:void 0,"data-1p-ignore":!0,"data-lpignore":"true","data-form-type":"other","data-bwignore":"true"}),d&&(0,a.jsx)("button",{type:"button",onClick:g,className:"text-[11px] text-primary hover:text-primary/80 transition-colors whitespace-nowrap shrink-0",children:h("deploy.useSaved")})]}),m&&(0,a.jsx)("p",{id:f,className:"text-xs font-medium text-danger ml-0.5",children:m})]})}function a6(e,t){let s=e.envVars,a=null==s?void 0:s[t];return{hasError:!!a,message:"string"==typeof(null==a?void 0:a.message)?a.message:void 0}}function a9(e){var t;let s,r,{name:n,config:i,onChange:o,onBack:d,onNext:c}=e,p=sx(),{t:u,i18n:x}=(0,m.Bd)(),g=sg(),y=(0,sR.Z)(),h="function"==typeof p.deployFn,b=(0,l.useRef)({}),{watch:f,getValues:v,setValue:j,setError:N,clearErrors:k,handleSubmit:w,formState:{errors:C}}=(0,aW.mN)({defaultValues:{namespace:i.namespace,envVars:i.envVars,envPersistence:a5(i.envPersistence),modelProviderMode:i.modelProviderMode},mode:"onSubmit"}),S=f("namespace"),A=f("envVars")??{},T=f("modelProviderMode")??"official",D=f("envPersistence"),P=(0,l.useMemo)(()=>a5(D),[null==D?void 0:D.remember,null==D?void 0:D.bindNamespace,null==D?void 0:D.groupName]),{data:_}=(0,t2.I)({queryKey:["template-detail",n,x.language],queryFn:()=>p.templates.detail(n,x.language)}),R=null==_?void 0:_.template,F=S||(null==R?void 0:R.namespace)||n,{data:z,isError:I}=(0,t2.I)({queryKey:["template-env-refs",n],queryFn:()=>p.templates.envRefs(n),retry:!1}),{data:E}=(0,t2.I)({queryKey:["my-template-detail",n],queryFn:()=>p.myTemplates.get(n),enabled:I,retry:!1}),{data:U}=(0,t2.I)({queryKey:["env"],queryFn:p.env.list}),{data:O}=(0,t2.I)({queryKey:["provider-profiles"],queryFn:p.providerProfiles.list,enabled:h,retry:!1}),{data:$}=(0,t2.I)({queryKey:["model-proxy-billing"],queryFn:()=>{var e,t;return(null==(t=p.modelProxy)||null==(e=t.billing)?void 0:e.call(t))??Promise.resolve(null)},enabled:h,retry:!1}),[M,V]=(0,l.useState)(P.groupName),q=(0,l.useRef)(!1),[B,K]=(0,l.useState)({});(0,l.useEffect)(()=>{q.current=!1,V(P.groupName)},[n]);let H=(0,l.useMemo)(()=>((null==O?void 0:O.profiles)??[]).filter(e=>e.enabled),[null==O?void 0:O.profiles]),W=(0,l.useMemo)(()=>{let e=new Set([aZ]);for(let t of(null==U?void 0:U.groups)??[])e.add(t);for(let t of(null==U?void 0:U.envVars)??[])e.add(t.groupName??aZ);return a3(e)},[U]),J=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!J.current&&R&&(S||(J.current=!0,j("namespace",R.namespace??n,{shouldDirty:!0})))},[R,S,j,n]);let{data:Q}=(0,t2.I)({queryKey:["deployment-env",F,"scoped"],queryFn:()=>p.deployments.env.list(F,"scoped"),enabled:!!F}),G=(null==z?void 0:z.requiredEnvVars)??(I?(t=null==E?void 0:E.content,s=new Set,r=/\$\{env:([A-Za-z_][A-Za-z0-9_]*)\}/g,!function e(t){if("string"==typeof t)for(let e of t.matchAll(r))e[1]&&s.add(e[1]);else if(Array.isArray(t))for(let s of t)e(s);else if(t&&"object"==typeof t)for(let s of Object.values(t))e(s)}(t),[...s].sort()):[]),Z=(0,l.useMemo)(()=>{let e=new Map,t=new Set((null==z?void 0:z.autoDetectedEnvVars)??[]);for(let t of(null==z?void 0:z.fields)??[])"SHADOW_SERVER_URL"!==t.key&&"SHADOW_USER_TOKEN"!==t.key&&(a0(t.key,T)||e.set(t.key,{key:t.key,label:t.label||aY(t.key),description:t.description??("plugin"===t.source?u("deploy.pluginFieldDescription"):u("deploy.templateFieldDescription")),required:t.required,sensitive:t.sensitive,placeholder:t.placeholder,source:t.source??"template",sourceId:t.sourceId??"template",sourceLabel:t.sourceLabel??u("deploy.templateFieldSource"),helpUrl:t.helpUrl}));for(let s of G)"SHADOW_SERVER_URL"!==s&&"SHADOW_USER_TOKEN"!==s&&!a0(s,T)&&(e.has(s)||t.has(s)||e.set(s,{key:s,label:aY(s),required:!0,sensitive:/(TOKEN|SECRET|PASSWORD|PRIVATE|CREDENTIAL|API_KEY|_KEY$|_B64$)/i.test(s),source:"template",sourceId:"template",sourceLabel:u("deploy.templateFieldSource"),description:u("deploy.templateFieldDescription")}));return[...e.values()].sort((e,t)=>e.key.localeCompare(t.key))},[null==z?void 0:z.autoDetectedEnvVars,null==z?void 0:z.fields,T,G,u]),X=(0,l.useMemo)(()=>((null==z?void 0:z.autoDetectedEnvVars)??[]).filter(e=>!a0(e,T)),[null==z?void 0:z.autoDetectedEnvVars,T]),ee=(0,l.useMemo)(()=>Z.filter(e=>e.required).map(e=>e.key),[Z]),et=(0,l.useMemo)(()=>{let e=new Set;for(let t of(h||(e.add("SHADOW_SERVER_URL"),e.add("SHADOW_USER_TOKEN")),Z))e.add(t.key);for(let t of ee)e.add(t);return[...e]},[h,ee,Z]),es=(0,l.useMemo)(()=>{let e=new Map;for(let t of Z){let s="plugin"===t.source?`plugin:${t.sourceId}`:"template",a=e.get(s);if(a){a.fields.push(t),a.helpUrl??(a.helpUrl=t.helpUrl);continue}e.set(s,{id:s,source:t.source,title:"plugin"===t.source?t.sourceLabel||t.sourceId:u("deploy.templateFieldSource"),description:"plugin"===t.source?u("deploy.pluginFieldGroupDescription",{plugin:t.sourceLabel||t.sourceId}):u("deploy.templateFieldGroupDescription"),helpUrl:"plugin"===t.source?t.helpUrl:void 0,fields:[t]})}return[...e.values()].map(e=>({...e,fields:e.fields.sort((e,t)=>e.required!==t.required?e.required?-1:1:e.key.localeCompare(t.key))})).sort((e,t)=>"template"===e.id?-1:"template"===t.id?1:e.title.localeCompare(t.title))},[Z,u]),ea=(0,l.useMemo)(()=>{let e={};for(let t of(null==Q?void 0:Q.envVars)??[])e[t.key]=t.maskedValue;return e},[Q]),er=(0,l.useMemo)(()=>{let e={},t=M||aZ;for(let s of(null==U?void 0:U.envVars)??[])(s.groupName??aZ)===t&&(e[s.key]=s.maskedValue);return e},[U,M]),en=(0,l.useMemo)(()=>({...er,...ea}),[er,ea]);(0,l.useEffect)(()=>{if(q.current||!U)return;let e=function(e){var t,s,a;let{groups:r,envVars:n,keys:i}=e,l=a3(r.length>0?r:[aZ]),o=new Set(i.filter(Boolean));if(0===o.size)return l[0]??aZ;let d=new Map;for(let e of n){if(!o.has(e.key))continue;let t=(null==(s=e.groupName)?void 0:s.trim())||aZ,a=d.get(t)??new Set;a.add(e.key),d.set(t,a)}let c=l[0]??aZ,m=(null==(t=d.get(c))?void 0:t.size)??0;for(let e of l){let t=(null==(a=d.get(e))?void 0:a.size)??0;(t>m||t===m&&t>0&&c===aZ)&&(c=e,m=t)}return c}({groups:W,envVars:U.envVars??[],keys:et});V(e),j("envPersistence.groupName",e,{shouldDirty:!1})},[et,U,W,j]);let ei=(0,l.useRef)(!1);(0,l.useEffect)(()=>{ei.current=!1},[F,M]),(0,l.useEffect)(()=>{if(ei.current||0===Object.keys(en).length)return;ei.current=!0;let e={...v("envVars")},t=!1;for(let{key:s}of(!e.SHADOW_SERVER_URL&&en.SHADOW_SERVER_URL&&(e.SHADOW_SERVER_URL="__SAVED__",t=!0),Z))!e[s]&&en[s]&&(e[s]="__SAVED__",t=!0);t&&j("envVars",e,{shouldDirty:!0})},[Z,en,v,j]);let[el,ed]=(0,l.useState)([]),ec=(e,t)=>{j(`envVars.${e}`,t,{shouldDirty:!0,shouldTouch:!0}),k(`envVars.${e}`)},em=e=>{let t=a5({...P,...e});j("envPersistence",t,{shouldDirty:!0}),void 0!==e.groupName&&V(t.groupName)};(0,l.useEffect)(()=>{o({namespace:S??"",envVars:A,envPersistence:a5({...P,groupName:M||P.groupName}),modelProviderMode:T})},[S,A,P,M,T,o]);let ep=(0,l.useMemo)(()=>$?$.inputTokensPerShrimp||$.outputTokensPerShrimp?{kind:"tokens",input:a1($.inputTokensPerShrimp??$.outputTokensPerShrimp??1e3),output:a1($.outputTokensPerShrimp??$.inputTokensPerShrimp??1e3)}:{kind:"usage",cacheHit:a1($.inputCacheHitShrimpPerMillionTokens),cacheMiss:a1($.inputCacheMissShrimpPerMillionTokens),output:a1($.outputShrimpPerMillionTokens),shrimpPerCny:a1($.shrimpPerCny)}:{kind:"loading"},[$]);return(0,a.jsxs)("form",{id:"wizard-configure-form",onSubmit:w(()=>{if(h&&"custom"===T&&0===H.length)return void g.warning(u("deploy.customProviderRequired"));let e=v("envVars")??{},t=e.SHADOW_SERVER_URL,s=e.SHADOW_USER_TOKEN,a=[];!h&&(t&&("__SAVED__"===t||t.trim())||en.SHADOW_SERVER_URL||a.push("SHADOW_SERVER_URL"),s&&("__SAVED__"===s||s.trim())||en.SHADOW_USER_TOKEN||a.push("SHADOW_USER_TOKEN"));let r=[...a,...ee.filter(t=>{let s=e[t];return!s||""===s.trim()}).filter(e=>!en[e])];if(r.length>0){for(let e of r)N(`envVars.${e}`,{type:"required",message:u("deploy.missingRequiredVars")});let e=r[0];e&&requestAnimationFrame(()=>{let t=b.current[e];if(t){var s;t.removeAttribute("disabled"),t.scrollIntoView({behavior:"smooth",block:"center"}),t.focus({preventScroll:!0}),null==(s=t.select)||s.call(t)}});let t=r.slice(0,3).join(", "),s=r.length>3?` ... +${r.length-3}`:"";g.warning(`${u("deploy.missingRequiredVars")} ${t}${s}`);return}c()}),className:"space-y-4",autoComplete:"off","data-1p-ignore":!0,"data-lpignore":"true","data-form-type":"other",children:[(0,a.jsx)(eS,{className:"rounded-2xl space-y-4 p-4",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:u("deploy.stepConfigureLabel")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:u("deploy.stepConfigureDescription")})]}),(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/10 p-4 space-y-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"namespace",className:"block text-sm font-semibold mb-0.5",children:u("deploy.namespace")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("deploy.kubernetesNamespaceDesc")})]}),(0,a.jsx)(e_,{id:"namespace",type:"text",value:S??"",onChange:e=>j("namespace",e.target.value,{shouldDirty:!0}),placeholder:(null==R?void 0:R.namespace)??n})]}),W.length>0&&(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-xl bg-bg-secondary/10 px-4 py-3",children:[(0,a.jsx)(aM.A,{size:14,className:"text-text-muted shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-text-secondary shrink-0",children:u("deploy.fillFromGroup")}),(0,a.jsxs)("select",{value:M,onChange:e=>(e=>{let t=e||aZ;q.current=!0,V(t),j("envPersistence.groupName",t,{shouldDirty:!0});let s={};for(let e of(null==U?void 0:U.envVars)??[])(e.groupName??aZ)===t&&(s[e.key]=e.maskedValue);let a={...v("envVars")},r=!1;for(let e of["SHADOW_SERVER_URL",...Z.map(e=>e.key)])(s[e]||ea[e])&&(a[e]="__SAVED__",r=!0);r&&j("envVars",a,{shouldDirty:!0})})(e.target.value),className:"flex-1 min-w-0 bg-bg-secondary/20 text-xs text-text-primary rounded-lg px-2.5 py-1.5 focus:outline-none focus:border-primary/50",children:[(0,a.jsx)("option",{value:"",children:u("deploy.selectGroup")}),W.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]})]}),(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/10 p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(a$.A,{size:14,className:"mt-0.5 text-success"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:u("deploy.secretPersistenceTitle")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("deploy.secretPersistenceDescription",{group:M||aZ})})]})]}),(0,a.jsxs)("div",{className:"grid gap-2 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg bg-bg-secondary/12 px-3 py-2.5",children:[(0,a.jsx)(eo,{checked:P.remember,onCheckedChange:e=>em({remember:!0===e})}),(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"block text-xs font-medium text-text-primary",children:u("deploy.rememberSecrets")}),(0,a.jsx)("span",{className:"block text-[11px] leading-relaxed text-text-muted",children:u("deploy.rememberSecretsDescription",{group:M||aZ})})]})]}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-lg bg-bg-secondary/12 px-3 py-2.5",children:[(0,a.jsx)(eo,{checked:P.bindNamespace,onCheckedChange:e=>em({bindNamespace:!0===e})}),(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"block text-xs font-medium text-text-primary",children:u("deploy.bindSecretsToNamespace")}),(0,a.jsx)("span",{className:"block text-[11px] leading-relaxed text-text-muted",children:u("deploy.bindSecretsToNamespaceDescription")})]})]})]})]}),h&&(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/10 p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(aV.A,{size:14,className:"mt-0.5 text-primary"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:u("deploy.modelProviderTitle")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("deploy.modelProviderDescription")})]})]}),(0,a.jsxs)("div",{role:"tablist","aria-label":u("deploy.modelProviderTitle"),className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":"official"===T,onClick:()=>j("modelProviderMode","official",{shouldDirty:!0}),className:t$("group rounded-2xl p-3 text-left transition-all shadow-[0_0_0_1px_rgba(255,255,255,0.08)_inset]","official"===T?"bg-primary/12 text-text-primary shadow-[0_0_0_1px_rgba(34,211,238,0.45)_inset]":"bg-bg-primary/25 text-text-muted hover:bg-bg-primary/35 hover:text-text-primary"),children:[(0,a.jsxs)("span",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,a.jsx)("span",{className:t$("flex h-9 w-9 items-center justify-center rounded-xl","official"===T?"bg-primary text-bg-primary":"bg-bg-secondary/30 text-text-secondary group-hover:text-primary"),children:(0,a.jsx)(aV.A,{size:17})}),(0,a.jsx)(Y,{variant:"official"===T?"primary":"neutral",children:u("deploy.modelProviderOfficialBadge")})]}),(0,a.jsx)("span",{className:"block text-sm font-semibold",children:u("deploy.modelProviderOfficialTitle")}),(0,a.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-text-muted",children:u("deploy.modelProviderOfficialDescription")})]}),(0,a.jsxs)("button",{type:"button",role:"tab","aria-selected":"custom"===T,onClick:()=>j("modelProviderMode","custom",{shouldDirty:!0}),className:t$("group rounded-2xl p-3 text-left transition-all shadow-[0_0_0_1px_rgba(255,255,255,0.08)_inset]","custom"===T?"bg-primary/12 text-text-primary shadow-[0_0_0_1px_rgba(34,211,238,0.45)_inset]":"bg-bg-primary/25 text-text-muted hover:bg-bg-primary/35 hover:text-text-primary"),children:[(0,a.jsxs)("span",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,a.jsx)("span",{className:t$("flex h-9 w-9 items-center justify-center rounded-xl","custom"===T?"bg-primary text-bg-primary":"bg-bg-secondary/30 text-text-secondary group-hover:text-primary"),children:(0,a.jsx)(a$.A,{size:17})}),(0,a.jsx)(Y,{variant:"custom"===T?"primary":"neutral",children:u("deploy.modelProviderCustomBadge")})]}),(0,a.jsx)("span",{className:"block text-sm font-semibold",children:u("deploy.modelProviderCustomTitle")}),(0,a.jsx)("span",{className:"mt-1 block text-xs leading-relaxed text-text-muted",children:u("deploy.modelProviderCustomDescription")})]})]}),(0,a.jsx)("div",{role:"tabpanel",className:"rounded-2xl bg-bg-primary/25 p-4 shadow-[0_0_0_1px_rgba(255,255,255,0.06)_inset]",children:"official"===T?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-primary/12 text-primary",children:(0,a.jsx)(aV.A,{size:17})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-primary",children:u("deploy.modelProviderOfficialTitle")}),(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold text-primary",children:u("deploy.modelProviderOfficialBadge")})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:u("deploy.modelProviderOfficialDescription")})]})]}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-3",children:["loading"===ep.kind&&(0,a.jsx)("div",{className:"rounded-xl bg-bg-secondary/16 px-3 py-2 text-xs leading-relaxed text-text-secondary sm:col-span-3",children:u("deploy.modelProviderOfficialPricingLoading")}),"tokens"===ep.kind&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/16 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold text-text-muted",children:u("deploy.modelProviderRateInput")}),(0,a.jsx)("p",{className:"mt-1 text-sm font-black text-text-primary",children:u("deploy.modelProviderRateTokensValue",{tokenCount:ep.input})})]}),(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/16 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold text-text-muted",children:u("deploy.modelProviderRateOutput")}),(0,a.jsx)("p",{className:"mt-1 text-sm font-black text-text-primary",children:u("deploy.modelProviderRateTokensValue",{tokenCount:ep.output})})]})]}),"usage"===ep.kind&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/16 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold text-text-muted",children:u("deploy.modelProviderRateCacheHit")}),(0,a.jsx)("p",{className:"mt-1 text-sm font-black text-text-primary",children:u("deploy.modelProviderRatePerMillionValue",{amount:ep.cacheHit})})]}),(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/16 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold text-text-muted",children:u("deploy.modelProviderRateCacheMiss")}),(0,a.jsx)("p",{className:"mt-1 text-sm font-black text-text-primary",children:u("deploy.modelProviderRatePerMillionValue",{amount:ep.cacheMiss})})]}),(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/16 px-3 py-2",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold text-text-muted",children:u("deploy.modelProviderRateOutput")}),(0,a.jsx)("p",{className:"mt-1 text-sm font-black text-text-primary",children:u("deploy.modelProviderRatePerMillionValue",{amount:ep.output})})]})]})]}),"usage"===ep.kind&&(0,a.jsx)("div",{className:"rounded-xl bg-primary/8 px-3 py-2 text-xs leading-relaxed text-primary",children:u("deploy.modelProviderExchangeRate",{shrimpPerCny:ep.shrimpPerCny})}),(0,a.jsx)("div",{className:"rounded-xl bg-bg-secondary/12 px-3 py-2 text-xs leading-relaxed text-text-secondary",children:u("deploy.modelProviderOfficialWalletHint")}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>window.location.assign("/app/settings/wallet"),children:[(0,a.jsx)(aV.A,{size:13}),u("deploy.viewWalletAndBilling")]}),(0,a.jsxs)(L,{type:"button",onClick:()=>{if("u"<typeof window)return;let e=!1,t=()=>{e=!0,window.removeEventListener("shadow:open-recharge:ack",t)};window.addEventListener("shadow:open-recharge:ack",t),window.dispatchEvent(new CustomEvent("shadow:open-recharge",{detail:{source:"deploy-wizard-provider",amount:1e4}})),window.setTimeout(()=>{window.removeEventListener("shadow:open-recharge:ack",t),e||window.location.assign("/app/settings/wallet")},500)},variant:"ghost",size:"sm",children:[(0,a.jsx)(sQ.A,{size:13}),u("deploy.topUp")]})]})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl bg-bg-secondary/30 text-text-secondary",children:(0,a.jsx)(a$.A,{size:17})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-primary",children:u("deploy.modelProviderCustomTitle")}),(0,a.jsx)("span",{className:"rounded-full bg-bg-secondary/30 px-2 py-0.5 text-[10px] font-semibold text-text-muted",children:u("deploy.modelProviderCustomBadge")})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:u("deploy.modelProviderCustomDescription")})]})]}),(0,a.jsxs)("div",{className:t$("flex items-start gap-2 rounded-xl px-3 py-2 text-xs",H.length>0?"bg-success/8 text-success":"bg-warning/8 text-warning"),children:[H.length>0?(0,a.jsx)(sY.A,{size:13,className:"mt-0.5 shrink-0"}):(0,a.jsx)(tI.A,{size:13,className:"mt-0.5 shrink-0"}),(0,a.jsx)("span",{children:H.length>0?u("deploy.providerProfilesReadyDesc"):u("deploy.providerProfilesMissingDesc")})]}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsx)("div",{className:"rounded-xl bg-bg-secondary/16 px-3 py-2 text-xs leading-relaxed text-text-secondary",children:u("deploy.modelProviderCustomSelfPaidNote")}),(0,a.jsx)("div",{className:"rounded-xl bg-bg-secondary/16 px-3 py-2 text-xs leading-relaxed text-text-secondary",children:u("deploy.modelProviderCustomSecureNote")})]}),(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>y({to:"/providers"}),className:"w-full justify-center",children:[(0,a.jsx)(aq.A,{size:13}),u("deploy.manageProviderProfiles")]})]})})]}),!h&&(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/10 p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(st.A,{size:14,className:"text-text-muted"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:u("deploy.shadowConnectionTitle")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("deploy.shadowConnectionDescription")})]})]}),(0,a.jsx)(a8,{envKey:"SHADOW_SERVER_URL",placeholder:"https://your-shadow-server.example.com",isSecret:!1,value:A.SHADOW_SERVER_URL??"",hasSaved:!!en.SHADOW_SERVER_URL,error:a6(C,"SHADOW_SERVER_URL").hasError,errorMessage:a6(C,"SHADOW_SERVER_URL").message,inputRef:e=>{b.current.SHADOW_SERVER_URL=e},onValueChange:e=>ec("SHADOW_SERVER_URL",e),onInputBlur:()=>k("envVars.SHADOW_SERVER_URL"),onUseSaved:()=>ec("SHADOW_SERVER_URL","__SAVED__"),onOverrideSaved:()=>ec("SHADOW_SERVER_URL",""),t:u}),(0,a.jsx)(a8,{envKey:"SHADOW_USER_TOKEN",placeholder:"pat_...",isSecret:!0,value:A.SHADOW_USER_TOKEN??"",hasSaved:!!en.SHADOW_USER_TOKEN,error:a6(C,"SHADOW_USER_TOKEN").hasError,errorMessage:a6(C,"SHADOW_USER_TOKEN").message,inputRef:e=>{b.current.SHADOW_USER_TOKEN=e},onValueChange:e=>ec("SHADOW_USER_TOKEN",e),onInputBlur:()=>k("envVars.SHADOW_USER_TOKEN"),onUseSaved:()=>ec("SHADOW_USER_TOKEN","__SAVED__"),onOverrideSaved:()=>ec("SHADOW_USER_TOKEN",""),t:u})]}),(Z.length>0||X.length>0)&&(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/10 p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(a$.A,{size:14,className:"mt-0.5 text-warning"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:u("deploy.envFieldSlotsTitle")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("deploy.envFieldSlotsDescription",{count:Z.length,required:ee.length})})]})]}),(0,a.jsx)("div",{children:(0,a.jsx)("span",{className:"rounded-full bg-warning/10 px-2 py-1 text-[11px] font-semibold text-warning",children:u("deploy.requiredCount",{count:ee.length})})})]}),X.length>0&&(0,a.jsx)("div",{className:"rounded-lg bg-bg-secondary/12 px-3 py-2 text-xs text-text-secondary",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)(se.A,{size:13,className:"mt-0.5 shrink-0 text-success"}),(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"font-medium text-success",children:u("deploy.autoDetectedVarsTitle",{count:X.length})}),(0,a.jsx)("p",{children:u("deploy.autoDetectedVarsDescription")})]})]})}),es.map(e=>{let t=e.fields.filter(e=>e.required).length,s=B[e.id]??("plugin"===e.source&&0===t),r=e.fields.filter(e=>{let t=A[e.key];return"__SAVED__"===t||!!(null==t?void 0:t.trim())||!!en[e.key]}).length;return(0,a.jsxs)("div",{className:"overflow-hidden rounded-xl bg-bg-secondary/10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3 transition-colors hover:bg-bg-secondary/20",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>K(t=>({...t,[e.id]:!s})),className:"flex min-w-0 flex-1 items-center justify-between gap-3 text-left",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,a.jsx)("div",{className:t$("mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg","plugin"===e.source?"bg-bg-secondary/30 text-primary":"bg-bg-secondary/30 text-warning"),children:"plugin"===e.source?(0,a.jsx)(st.A,{size:14}):(0,a.jsx)(a$.A,{size:14})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold text-text-primary",children:e.title}),(0,a.jsx)("span",{className:"rounded-full bg-bg-secondary/30 px-2 py-0.5 text-[10px] font-semibold text-text-muted",children:"plugin"===e.source?u("deploy.pluginSourceBadge"):u("deploy.templateSourceBadge")}),t>0&&(0,a.jsx)("span",{className:"rounded-full bg-warning/10 px-2 py-0.5 text-[10px] font-semibold text-warning",children:u("deploy.requiredCount",{count:t})})]}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:e.description})]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("span",{children:u("deploy.fieldGroupProgress",{filled:r,total:e.fields.length})}),(0,a.jsx)(aC.A,{size:15,className:t$("transition-transform",!s&&"rotate-90")})]})]}),"plugin"===e.source&&(e.helpUrl?(0,a.jsx)("a",{href:e.helpUrl,target:"_blank",rel:"noreferrer",className:"inline-flex h-8 w-8 shrink-0 self-center items-center justify-center rounded-full bg-bg-primary/35 text-text-muted transition-colors hover:bg-primary/12 hover:text-primary","aria-label":u("deploy.openConfigHelp"),title:u("deploy.openConfigHelp"),children:(0,a.jsx)(aq.A,{size:15})}):(0,a.jsx)(tJ.N_,{to:"/secrets",className:"inline-flex h-8 w-8 shrink-0 self-center items-center justify-center rounded-full bg-bg-primary/35 text-text-muted transition-colors hover:bg-primary/12 hover:text-primary","aria-label":u("deploy.openConfigHelp"),title:u("deploy.openConfigHelp"),children:(0,a.jsx)(aq.A,{size:15})}))]}),!s&&(0,a.jsx)("div",{className:"space-y-3 p-3",children:e.fields.map(e=>{let{key:t}=e,s=a6(C,t);return(0,a.jsx)(a8,{envKey:t,label:e.label,description:e.description,required:e.required,isSecret:e.sensitive,placeholder:e.placeholder??(t.includes("KEY")||t.includes("TOKEN")||t.includes("SECRET")?"sk-...":u("deploy.enterValue")),value:A[t]??"",hasSaved:!!en[t],error:s.hasError,errorMessage:s.message,inputRef:e=>{b.current[t]=e},onValueChange:e=>ec(t,e),onInputBlur:()=>k(`envVars.${t}`),onUseSaved:()=>ec(t,"__SAVED__"),onOverrideSaved:()=>ec(t,""),t:u},t)})})]},e.id)})]}),(0,a.jsxs)("div",{className:"rounded-xl bg-bg-secondary/10 p-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:u("deploy.additionalVariables")}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:u("deploy.optionalKeyValue")})]}),(0,a.jsxs)(L,{type:"button",onClick:()=>ed([...el,{key:"",value:""}]),variant:"ghost",size:"sm",children:[(0,a.jsx)(sH.A,{size:12}),u("deploy.addVariable")]})]}),0===el.length?(0,a.jsx)("div",{className:"text-center py-3 text-xs text-text-muted rounded-lg bg-bg-secondary/10",children:u("deploy.noAdditionalVars")}):(0,a.jsx)("div",{className:"space-y-2",children:el.map((e,t)=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(e_,{type:"text",value:e.key,onChange:s=>{let a=[...el],r=a[t];r&&(a[t]={...r,key:s.target.value},ed(a),s.target.value&&ec(s.target.value,e.value))},placeholder:"KEY",className:"flex-1"}),(0,a.jsx)("span",{className:"text-text-muted text-xs",children:"="}),(0,a.jsx)(e_,{type:"text",value:e.value,onChange:s=>{let a=[...el],r=a[t];r&&(a[t]={...r,value:s.target.value},ed(a),e.key&&ec(e.key,s.target.value))},placeholder:"value",className:"flex-1"}),(0,a.jsx)(L,{type:"button",onClick:()=>{let e=el[t];if(ed(el.filter((e,s)=>s!==t)),null==e?void 0:e.key){let t={...A};delete t[e.key],j("envVars",t,{shouldDirty:!0})}},variant:"ghost",size:"icon",className:"h-7 w-7 p-1 text-text-muted hover:text-danger",children:(0,a.jsx)(sJ.A,{size:13})})]},t))})]})]})}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 px-1",children:[(0,a.jsxs)(L,{type:"button",onClick:d,variant:"ghost",children:[(0,a.jsx)(aB.A,{size:14}),u("common.back")]}),(0,a.jsxs)(L,{type:"submit",variant:"primary",children:[u("common.continue"),(0,a.jsx)(aK.A,{size:14})]})]})]})}function a7(e){let{name:t,config:s,onBack:r}=e,i=sx(),{t:o,i18n:d}=(0,m.Bd)(),c=(0,l.useRef)(null),p=(0,l.useRef)(!0),[u,x]=(0,l.useState)(!1),g=sg(),y=(0,sR.Z)(),h=(0,n.jE)(),b=sC(e=>e.addActivity),f=sC(e=>e.addRecentDeploy),{lines:v,entries:j,status:N,error:k,connect:w,startFetch:C,disconnect:S,clear:A}=ac(),[T,D]=(0,l.useState)(!1),[P,_]=(0,l.useState)(null),[R,F]=(0,l.useState)(null),[z,I]=(0,l.useState)(null),[E,U]=(0,l.useState)(null),[O,$]=(0,l.useState)(!1),[M,V]=(0,l.useState)(!1),[q,B]=(0,l.useState)(null),K=(0,l.useRef)(!1),{data:H}=(0,t2.I)({queryKey:["template-detail",t,d.language],queryFn:()=>i.templates.detail(t,d.language)}),W=null==H?void 0:H.template,J=(null==W?void 0:W.title)||t,Q=s.namespace||(null==W?void 0:W.namespace)||t,{data:G}=(0,t2.I)({queryKey:["wallet"],queryFn:()=>{var e,t;return(null==(t=i.wallet)||null==(e=t.get)?void 0:e.call(t))??Promise.resolve({balance:null})},retry:!1}),Y=(null==G?void 0:G.balance)??null,Z=null===Y||Y>=1,X=(0,l.useMemo)(()=>{var e;return e=s.envVars,"official"!==s.modelProviderMode?e:Object.fromEntries(Object.entries(e).filter(e=>{let[t]=e;return!aX.has(t)}))},[s.envVars,s.modelProviderMode]),ee=Object.keys(X).filter(e=>!!X[e]).length,et="official"===s.modelProviderMode?o("deploy.modelProviderOfficialSummary"):o("deploy.modelProviderCustomSummary"),es=(null==W?void 0:W.features)&&W.features.length>0?`${o("deploy.includes")}: ${(W.features??[]).slice(0,2).join(", ")}`:o("deploy.asConfigured"),ea=null===Y?o("common.loading"):`${Y} ${o("deploy.shrimpCoins")}`,er=R?new URL(R.url,window.location.origin).toString():"",en=(0,l.useCallback)(()=>{let e=c.current;e&&(p.current=e.scrollHeight-e.scrollTop-e.clientHeight<64)},[]);(0,l.useEffect)(()=>{let e=c.current;e&&p.current&&(e.scrollTop=e.scrollHeight)},[v.length]);let ei=(0,l.useCallback)(async()=>{if(K.current)return;K.current=!0,_(!0),U("deployed"),V(!0);let e=Object.entries(X).filter(e=>{let[,t]=e;return t&&"__SAVED__"!==t&&""!==t.trim()}),a=a5(s.envPersistence),r=[];for(let[t,s]of e)a.remember&&r.push(i.env.upsert("global",t,s,!0,a.groupName)),a.bindNamespace&&r.push(i.deployments.env.upsert(Q,t,s,!0));r.length>0&&(await Promise.allSettled(r)).some(e=>"rejected"===e.status)&&g.warning(o("deploy.secretSaveFailed")),b({type:"deploy",title:`Deployed ${t}`,detail:`Template: ${t}, Namespace: ${Q}`,namespace:Q,template:t}),f(t,Q),h.invalidateQueries({queryKey:["deployments"]}),h.invalidateQueries({queryKey:["deployment-env",Q]}),h.invalidateQueries({queryKey:["env"]}),h.invalidateQueries({queryKey:["namespace-costs",Q]}),h.invalidateQueries({queryKey:["cost-overview"]}),h.invalidateQueries({queryKey:["deployment-cost-overview"]})},[b,f,i.env,i.deployments.env,s.envPersistence,X,t,h,Q,o,g]),el=(0,l.useCallback)((e,s)=>{if(!K.current){if(K.current=!0,_(!1),null==s?void 0:s.cancelled){g.warning(e),b({type:"deploy",title:`Cancelled deployment ${t}`,detail:e,template:t});return}g.error(o("deploy.deployFailedWithMessage",{message:e})),b({type:"deploy",title:`Failed to deploy ${t}`,detail:e,template:t})}},[b,t,o,g]);(0,l.useEffect)(()=>{z&&"function"==typeof i.deploymentLogsUrlFn&&w(i.deploymentLogsUrlFn(z))},[z,w,i]),(0,l.useEffect)(()=>{if(!T||!z||null!==P||"function"!=typeof i.deploymentStatusFn)return;let e=!1;return(async()=>{for(;!e&&!K.current;){try{var t;let s=await (null==(t=i.deploymentStatusFn)?void 0:t.call(i,z));if(!s||e)return;if(U(s.status),s.shadowServerId&&B(s.shadowServerId),"deployed"===s.status)return void await ei();if("failed"===s.status)return void el(s.errorMessage??o("deploy.unknownError"));if("destroyed"===s.status)return void el(O?o("deploy.deploymentCancelled"):s.errorMessage??o("deploy.unknownError"),{cancelled:O})}catch(e){el(e instanceof Error?e.message:o("deploy.unknownError"));return}await new Promise(e=>window.setTimeout(e,2e3))}})(),()=>{e=!0}},[z,O,i,T,P,el,ei,o]);let eo=(0,t5.n)({mutationFn:()=>i.init(t)}),ed=async()=>{let e=function(e){let t;try{t=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{t=void 0}return{...e?{locale:e}:{},...t?{timezone:t}:{}}}(d.language);K.current=!1,D(!0),_(null),F(null),I(null),U(null),$(!1),V(!1),B(null),p.current=!0,S(),A();try{var a;let r,n=await eo.mutateAsync(),l="object"==typeof n?{...n}:{};l.templateSlug=t,l.runtimeContext=e,e.locale&&(l.locale=e.locale),s.namespace&&(l.namespace=s.namespace),X&&Object.keys(X).length>0&&(l.envVars=X);let d="object"==typeof n&&null!==n?{...n}:{},c=d.deployments&&"object"==typeof d.deployments?d.deployments:{};d.deployments={...c,namespace:Q},e.locale&&(d.locale=e.locale);let m=(a=d.__shadowobRuntime)&&"object"==typeof a&&!Array.isArray(a)?d.__shadowobRuntime:{};if(d.__shadowobRuntime={...m,modelProviderMode:s.modelProviderMode,officialModelProxy:"official"===s.modelProviderMode},"function"==typeof i.deployFn){if(!(r=await i.deployFn({templateSlug:t,namespace:Q,name:`${Q}-${Date.now()}`,resourceTier:"lightweight",configSnapshot:d,envVars:X,runtimeContext:e})).success||!r.deploymentId)throw _(!1),Error(r.error||o("deploy.unknownError"));I(r.deploymentId),F({id:r.deploymentId,url:`/app/cloud/deploy-tasks/${encodeURIComponent(r.deploymentId)}`}),U(r.status??"pending");return}if(!(r=await C("/api/deploy",l,{onEvent:(e,t)=>{"task"===e&&t&&"object"==typeof t&&"id"in t&&"url"in t&&"number"==typeof t.id&&"string"==typeof t.url&&F({id:t.id,url:t.url})}})).success)throw Error(r.error||o("deploy.deployFailedWithCode",{code:"exitCode"in r?r.exitCode??o("common.none"):o("common.none")}));await ei()}catch(e){el(e instanceof Error?e.message:o("deploy.unknownError"))}},ec=async()=>{if(z&&"function"==typeof i.cancelDeploymentFn)try{$(!0),U("cancelling"),await i.cancelDeploymentFn(z),g.warning(o("deploy.cancelRequested"))}catch(e){$(!1),U("deploying"),g.error(o("deploy.deployFailedWithMessage",{message:e instanceof Error?e.message:o("deploy.unknownError")}))}},em=async()=>{if(er)try{await navigator.clipboard.writeText(er),g.success(o("deployTask.linkCopied"))}catch{g.error(o("deployTask.linkCopyFailed"))}},ep=T&&null===P&&(null!==z||"done"!==N&&"error"!==N),eu="cancelling"===E,ex=!0===P,eg=!1===P;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(eS,{className:"rounded-2xl p-4",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold mb-1",children:T?ex?o("deploy.deploymentComplete"):eg?o("deploy.deploymentFailed"):eu?o("deploy.cancelling"):o("deploy.deploying"):o("deploy.reviewDeploy")}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:T?ex?o("deploy.deploySuccessDesc"):eg?o("deploy.deployFailDesc"):eu?o("deploy.cancelRequested"):o("deploy.deployingToCluster"):o("deploy.reviewConfig")})]}),!T&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(eS,{className:"rounded-2xl p-4",children:[(0,a.jsxs)(an,{className:"mb-0 grid-cols-1 md:grid-cols-2",children:[(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:o("deploy.template"),icon:(0,a.jsx)(sZ.A,{size:11}),iconClassName:"text-text-muted",value:`${(null==W?void 0:W.emoji)??"\uD83D\uDCE6"} ${J}`,valueClassName:"text-sm font-medium text-left"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:o("deploy.namespace"),icon:(0,a.jsx)(sX.A,{size:11}),iconClassName:"text-text-muted",value:Q,valueClassName:"text-sm font-mono"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:o("deploy.envVariables"),icon:(0,a.jsx)(a$.A,{size:11}),iconClassName:"text-text-muted",value:`${ee} ${o("deploy.configured")}`,valueClassName:"text-sm"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:o("deploy.agentsLabel"),icon:(0,a.jsx)(aU.A,{size:11}),iconClassName:"text-text-muted",value:es,valueClassName:"text-sm"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:o("deploy.modelProviderSummaryLabel"),icon:(0,a.jsx)(a$.A,{size:11}),iconClassName:"text-text-muted",value:et,valueClassName:"text-sm"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:o("deploy.estimatedCost"),icon:(0,a.jsx)(sQ.A,{size:11}),iconClassName:"text-text-muted",value:`1 ${o("deploy.shrimpCoinsPerHour")}`,valueClassName:"text-sm font-medium"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:o("deploy.walletBalance"),icon:(0,a.jsx)(aV.A,{size:11}),iconClassName:t$("text-text-muted",Z?"text-success":"text-danger"),value:ea,valueClassName:t$("text-sm font-medium",Z?"text-success":"text-danger")})})]}),!Z&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2.5 rounded-xl bg-danger/8 px-3 py-2.5 sm:flex-row sm:items-center sm:justify-between sm:gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-danger",children:[(0,a.jsx)("strong",{children:o("deploy.insufficientBalance")})," ",o("deploy.insufficientBalanceDesc")]}),(0,a.jsx)(L,{type:"button",size:"sm",variant:"ghost",className:"shrink-0 w-full sm:w-auto justify-center",onClick:()=>{if("u">typeof window){let e=!1,t=()=>{e=!0,window.removeEventListener("shadow:open-recharge:ack",t)};window.addEventListener("shadow:open-recharge:ack",t),window.dispatchEvent(new CustomEvent("shadow:open-recharge",{detail:{source:"deploy-wizard",amount:1e4}})),setTimeout(()=>{e||g.error(o("deploy.rechargeUnavailable"))},500)}},children:o("deploy.topUp")})]}),(0,a.jsxs)("div",{className:"mt-3 flex items-start gap-2 rounded-xl bg-bg-secondary/15 px-3 py-2.5",children:[(0,a.jsx)("span",{className:"mt-0.5 text-xs text-primary",children:"•"}),(0,a.jsxs)("p",{className:"text-xs text-text-secondary",children:[(0,a.jsx)("strong",{className:"text-text-primary",children:o("deploy.whatHappensNext")})," ",o("deploy.whatHappensNextDesc")]})]}),(0,a.jsxs)("div",{className:"mt-4 flex justify-between",children:[(0,a.jsxs)(L,{type:"button",onClick:r,variant:"ghost",disabled:eo.isPending,children:[(0,a.jsx)(aB.A,{size:14}),o("common.back")]}),(0,a.jsxs)(L,{type:"button",onClick:ed,variant:"primary",disabled:!Z||eo.isPending,children:[eo.isPending?(0,a.jsx)(tL.A,{size:16,className:"animate-spin"}):(0,a.jsx)(sZ.A,{size:16}),eo.isPending?o("deploy.preparingDeployment"):o("deploy.startDeployment")]})]})]})}),T&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eS,{className:"rounded-2xl p-4",children:(0,a.jsxs)("div",{className:t$("flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between rounded-xl px-3 py-2",ex&&"border-l-2 border-success",eg&&"border-l-2 border-danger",eu&&"border-l-2 border-warning",ep&&"border-l-2 border-primary"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[eu&&(0,a.jsx)(tL.A,{size:18,className:"animate-spin text-warning"}),!eu&&ep&&(0,a.jsx)(tL.A,{size:18,className:"text-primary animate-spin"}),ex&&(0,a.jsx)(sY.A,{size:18,className:"text-success"}),eg&&(0,a.jsx)(sM.A,{size:18,className:"text-danger"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:t$("text-sm font-medium",ex&&"text-success",eg&&"text-danger",eu&&"text-warning",ep&&!eu&&"text-primary"),children:[eu&&o("deploy.cancelling"),!eu&&ep&&o("deploy.deploying"),ex&&o("deploy.deploymentSuccessful"),eg&&o("deploy.deploymentFailed")]}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:eu?o("deploy.cancelRequested"):o("deploy.logLinesReceived",{count:v.length})})]})]}),!z||"function"!=typeof i.cancelDeploymentFn||ex||eg?null:(0,a.jsxs)(L,{type:"button",onClick:ec,variant:"ghost",size:"sm",disabled:O,children:[O?(0,a.jsx)(tL.A,{size:14,className:"animate-spin"}):(0,a.jsx)(sM.A,{size:14}),O?o("deploy.cancelling"):o("deploy.cancelDeployment")]})]})}),R&&(0,a.jsx)(eS,{className:"rounded-2xl p-4",children:(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-1",children:o("deployTask.taskUrl")}),(0,a.jsx)("code",{className:"block text-xs font-mono text-text-secondary break-all",children:er})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,a.jsxs)(L,{type:"button",onClick:em,variant:"ghost",size:"sm",children:[(0,a.jsx)(tG.A,{size:12}),o("deployTask.copyLink")]}),(0,a.jsx)(L,{asChild:!0,variant:"primary",size:"sm",children:(0,a.jsxs)(tJ.N_,{to:"/deploy-tasks/$taskId",params:{taskId:String(R.id)},children:[(0,a.jsx)(sr.A,{size:12}),o("deployTask.openTask")]})}),(0,a.jsxs)(tJ.N_,{to:"/deployments",className:"flex items-center gap-2 text-xs text-text-secondary hover:text-text-primary rounded-xl px-3 py-2 transition-colors",children:[(0,a.jsx)(aH.A,{size:12}),o("nav.deployments")]})]})]})}),(0,a.jsx)(eS,{className:"rounded-2xl p-0 overflow-hidden",children:(0,a.jsx)(s6,{headerLeft:o("deploy.deploymentLog"),headerRight:(0,a.jsx)(s7,{showTimestampsToggle:!1,actions:[...v.length>0?[{id:"download",type:"button",icon:(0,a.jsx)(sU.A,{size:11}),label:o("deploy.download"),onClick:()=>{let e=new Blob([v.join("\n")],{type:"text/plain"}),s=URL.createObjectURL(e),a=document.createElement("a");a.href=s,a.download=`deploy-${t}-${Date.now()}.log`,a.click(),URL.revokeObjectURL(s)}}]:[]]}),lines:j,collapseRepeats:!0,showTimestamps:u,footerRight:(0,a.jsx)(s7,{showTimestamps:u,onShowTimestampsChange:e=>x(e),showTimestampsLabel:o("deploy.showTimestamps"),hideTimestampsLabel:o("deploy.hideTimestamps")}),footerLeft:(0,a.jsx)("span",{children:o("deploy.logLinesReceived",{count:v.length})}),emptyText:ep?o("deploy.initializingDeployment"):o("deployments.noLogsYet"),bodyRef:c,bodyOnScroll:en,className:"rounded-none border-0"})}),k&&(0,a.jsx)(eS,{className:"rounded-2xl p-4",children:(0,a.jsx)("p",{className:"text-xs text-danger",children:k})}),ex&&(0,a.jsx)(e$,{open:M,onClose:()=>V(!1),children:(0,a.jsxs)(eV,{size:"md",children:[(0,a.jsx)(eq,{icon:(0,a.jsx)(se.A,{size:20,className:"text-success"}),title:o("deploy.deploymentSuccessful"),subtitle:o(q?"deploy.shadowServerReadyDescription":"deploy.namespaceReadyDescription",{namespace:Q}),closeLabel:o("common.close")}),(0,a.jsxs)(eB,{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-2xl bg-bg-secondary/25 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-text-muted",children:o("deploy.namespace")}),(0,a.jsx)("p",{className:"mt-1 font-mono text-sm text-text-primary",children:Q})]}),R&&(0,a.jsxs)("button",{type:"button",onClick:()=>y({to:"/deploy-tasks/$taskId",params:{taskId:String(R.id)}}),className:"flex w-full items-center gap-3 rounded-2xl bg-bg-secondary/20 px-4 py-3 text-left transition-colors hover:bg-primary/5",children:[(0,a.jsx)(sr.A,{size:18,className:"text-text-muted"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-sm font-semibold text-text-primary",children:o("deployTask.openTask")}),(0,a.jsx)("span",{className:"block text-xs text-text-muted",children:o("deployTask.openTaskDescription")})]})]})]}),(0,a.jsx)(eK,{children:(0,a.jsxs)(eH,{children:[(0,a.jsx)(L,{type:"button",variant:"ghost",onClick:()=>V(!1),children:o("common.close")}),(0,a.jsxs)(L,{type:"button",variant:"primary",onClick:()=>{q?window.location.assign(`/app/servers/${encodeURIComponent(q)}`):y({to:"/deployments/$namespace",params:{namespace:Q}})},children:[(0,a.jsx)(sX.A,{size:14}),q?o("deploy.openShadowServer"):o("deploy.openNamespace")]})]})})]})}),eg&&(0,a.jsx)(eS,{className:"rounded-2xl p-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(tJ.N_,{to:"/store",className:"flex items-center gap-2 text-sm text-text-secondary hover:text-text-primary bg-bg-secondary/20 px-4 py-2 rounded-lg transition-colors",children:o("store.backToStore")}),(0,a.jsx)(L,{type:"button",onClick:()=>{K.current=!1,S(),A(),D(!1),_(null),F(null),I(null),U(null),$(!1),V(!1),B(null),p.current=!0},variant:"ghost",children:o("common.retry")})]})})]})]})}var re=s(61567),rt=s(40159),rs=s(55449),ra=s(54874),rr=s(98604),rn=s(93704);function ri(e){let{rows:t,className:s}=e;return 0===t.length?null:(0,a.jsx)("table",{className:`mt-2 w-full border-collapse text-xs ${s??""}`,children:(0,a.jsx)("tbody",{children:t.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-border-subtle first:border-0",children:[(0,a.jsx)("td",{className:"w-28 max-w-28 py-1 pr-3 align-top text-text-muted",children:e.label}),(0,a.jsx)("td",{className:"py-1 text-text-primary break-all",children:e.value})]},`${e.label}-${e.value}-${t}`))})})}let rl=new Set(["createdAt","createdat","created_at"]),ro={template:"template_slug",templateSlug:"template_slug",template_slug:"template_slug",slug:"template_slug",taskId:"task_id",task_id:"task_id",deploymentId:"deployment_id",deployment_id:"deployment_id",clusterId:"cluster_id",cluster_id:"cluster_id",configId:"config_id",config_id:"config_id",resourceTier:"resource_tier",resource_tier:"resource_tier",monthlyCost:"monthly_cost",monthly_cost:"monthly_cost",hourlyCost:"hourly_cost",hourly_cost:"hourly_cost",billingPrecisionMinutes:"billing_precision_minutes",billing_precision_minutes:"billing_precision_minutes",userId:"user_id",user_id:"user_id",redeployFrom:"redeploy_from",wasApproved:"was_approved",name:"name",key:"key",count:"count"};function rd(e){return"object"==typeof e&&null!==e&&Object.getPrototypeOf(e)===Object.prototype}function rc(e){if("number"==typeof e)return Number.isFinite(e)?e:void 0;if("string"==typeof e){let t=e.trim();if(!t)return;let s=Number(t);return Number.isFinite(s)?s:void 0}}function rm(e){if(null!=e&&""!==e){if("string"==typeof e){let t=e.trim();return t.length>0?t:void 0}if("number"==typeof e||"boolean"==typeof e||"bigint"==typeof e)return String(e);if(e instanceof Date)return e.toISOString();if(e instanceof Error)return e.message||e.name;if(rd(e))try{return JSON.stringify(e)}catch{return}return Array.isArray(e)?e.length>0?JSON.stringify(e):void 0:String(e)}}function rp(e){for(let t of e){let e=rm(t);if(e)return e}}function ru(e,t,s){return null===e?"—":`${au(e,t)} ${s}`}function rx(e){return"pass"===e?"success":"warn"===e?"warning":"error"}function rg(e){return{deploy:{label:e("activity.types.deploy"),icon:(0,a.jsx)(sZ.A,{size:12}),variant:"success"},destroy:{label:e("activity.types.destroy"),icon:(0,a.jsx)(sJ.A,{size:12}),variant:"danger"},scale:{label:e("activity.types.scale"),icon:(0,a.jsx)(tY.A,{size:12}),variant:"info"},config:{label:e("activity.types.config"),icon:(0,a.jsx)(rt.A,{size:12}),variant:"warning"},config_update:{label:e("activity.types.config_update"),icon:(0,a.jsx)(t1.A,{size:12}),variant:"warning"},cluster_add:{label:e("activity.types.cluster_add"),icon:(0,a.jsx)(sz.A,{size:12}),variant:"info"},cluster_remove:{label:e("activity.types.cluster_remove"),icon:(0,a.jsx)(sJ.A,{size:12}),variant:"danger"},envvar_update:{label:e("activity.types.envvar_update"),icon:(0,a.jsx)(t1.A,{size:12}),variant:"info"},template_approved:{label:e("activity.types.template_approved"),icon:(0,a.jsx)(sY.A,{size:12}),variant:"success"},template_rejected:{label:e("activity.types.template_rejected"),icon:(0,a.jsx)(sM.A,{size:12}),variant:"danger"},billing_deduct:{label:e("activity.types.billing_deduct"),icon:(0,a.jsx)(sQ.A,{size:12}),variant:"warning"},template_submit:{label:e("activity.types.template_submit"),icon:(0,a.jsx)(sX.A,{size:12}),variant:"success"},template_update:{label:e("activity.types.template_update"),icon:(0,a.jsx)(sX.A,{size:12}),variant:"warning"},template_delete:{label:e("activity.types.template_delete"),icon:(0,a.jsx)(sJ.A,{size:12}),variant:"danger"},init:{label:e("activity.types.init"),icon:(0,a.jsx)(sz.A,{size:12}),variant:"neutral"},settings:{label:e("activity.types.settings"),icon:(0,a.jsx)(t1.A,{size:12}),variant:"neutral"}}}let ry=["deploy","destroy","scale","config","config_update","cluster_add","cluster_remove","envvar_update","template_approved","template_rejected","billing_deduct","template_submit","template_update","template_delete","init","settings"],rh="rounded-2xl border border-border-subtle bg-bg-secondary/40 p-4 space-y-4",rb="rounded-2xl border border-border-subtle bg-bg-secondary/30 px-4 py-3",rf="rounded-2xl border border-border-subtle bg-bg-secondary/30 p-4",rv={success:"border-success/35",danger:"border-danger/35",info:"border-info/35",warning:"border-warning/35",neutral:"border-border-subtle"},rj={success:"text-success",danger:"text-danger",info:"text-info",warning:"text-warning",neutral:"text-text-muted"},rN={success:{background:"linear-gradient(to bottom, rgb(16, 185, 129), rgba(16, 185, 129, 0.55))"},danger:{background:"linear-gradient(to bottom, rgb(239, 68, 68), rgba(239, 68, 68, 0.55))"},info:{background:"linear-gradient(to bottom, rgb(59, 130, 246), rgba(59, 130, 246, 0.55))"},warning:{background:"linear-gradient(to bottom, rgb(250, 204, 21), rgba(251, 191, 36, 0.55))"},neutral:{background:"linear-gradient(to bottom, rgb(148, 163, 184), rgba(148, 163, 184, 0.55))"}};function rk(e){let{activities:t,limit:s}=e,{t:r}=(0,m.Bd)(),n=(0,l.useMemo)(()=>rg(r),[r]),i=s?t.slice(0,s):t;return 0===i.length?(0,a.jsx)(ek,{icon:aH.A,title:r("activity.noActivityRecorded"),description:r("activity.operationsWillAppear")}):(0,a.jsx)("div",{className:"space-y-3",children:i.map(e=>{let t,s,i,l,o,d,c,m,p=n[e.type]??{label:e.type,icon:(0,a.jsx)(aH.A,{size:12}),variant:"neutral"},u=!Number.isNaN(new Date(e.timestamp).getTime()),x=rv[p.variant],g=rN[p.variant],y=[e.description,e.detail].map(e=>"string"==typeof e?e.trim():"").find(Boolean);return(0,a.jsxs)("div",{className:`relative overflow-hidden flex gap-4 px-4 py-3 rounded-xl border border-border-subtle bg-bg-secondary/50 transition-colors hover:bg-bg-modifier-hover ${x}`,children:[(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute left-0 top-0 bottom-0 w-2 rounded-l-xl",style:g}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("p",{className:"text-sm font-semibold text-text-primary truncate inline-flex items-center gap-2",children:[(0,a.jsx)("span",{className:rj[p.variant],children:p.icon}),e.title||r(`activity.types.${e.type}`)]}),(0,a.jsx)(ri,{rows:(t=e.metadata??[],s=new Set,t.reduce((e,t)=>{var a;let n,i,l=(a=t.label,(i=r(n=`activity.meta.${a}`))===n?a:i);return s.has(l)||(s.add(l),e.push({label:l,value:t.value})),e},[]))})]}),(0,a.jsx)("div",{className:"shrink-0 min-w-0 max-w-[13rem] text-right text-xs leading-5 text-text-primary",children:u?(0,a.jsx)("p",{className:"font-medium whitespace-nowrap",children:(l=(i=new Date(e.timestamp)).getFullYear(),o=`${i.getMonth()+1}`.padStart(2,"0"),d=`${i.getDate()}`.padStart(2,"0"),c=`${i.getHours()}`.padStart(2,"0"),m=`${i.getMinutes()}`.padStart(2,"0"),`${l}/${o}/${d} ${c}:${m}`)}):"—"})]}),y?(0,a.jsx)("p",{className:"text-sm leading-6 text-text-secondary",children:y}):null]})]},e.id)})})}function rw(e){let{doctor:t}=e,{t:s}=(0,m.Bd)(),r=(0,l.useMemo)(()=>t.checks.reduce((e,t)=>(e[t.status].push(t),e),{pass:[],warn:[],fail:[]}),[t.checks]),n=t.summary.pass+t.summary.warn+t.summary.fail,i=n>0?Math.round(t.summary.pass/n*100):100,o={pass:{colorClass:"text-success",bgClass:"bg-success/12",borderClass:"border-success/20"},warn:{colorClass:"text-warning",bgClass:"bg-warning/12",borderClass:"border-warning/20"},fail:{colorClass:"text-danger",bgClass:"bg-danger/12",borderClass:"border-danger/20"}};return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-2xl border border-success/30 bg-success/10 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:s("monitoring.passed")}),(0,a.jsx)("p",{className:"mt-2 text-2xl font-black text-success",children:t.summary.pass}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-success",children:[t.summary.pass," / ",n," ",s("monitoring.passed")]})]}),(0,a.jsxs)("div",{className:"rounded-2xl border border-warning/30 bg-warning/10 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:s("monitoring.warnings")}),(0,a.jsx)("p",{className:"mt-2 text-2xl font-black text-warning",children:t.summary.warn}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-warning",children:[t.summary.warn," ",s("monitoring.events")]})]}),(0,a.jsxs)("div",{className:"rounded-2xl border border-danger/30 bg-danger/10 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-text-muted uppercase tracking-wide",children:s("monitoring.failed")}),(0,a.jsx)("p",{className:"mt-2 text-2xl font-black text-danger",children:t.summary.fail}),(0,a.jsxs)("div",{className:"mt-1 text-xs text-danger",children:[t.summary.fail," ",s("monitoring.events")]})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-border-subtle bg-bg-secondary/40 px-4 py-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:s("monitoring.healthScore")}),(0,a.jsxs)("p",{className:"text-2xl font-black text-text-primary",children:[i,"%"]})]}),(0,a.jsx)(ao,{status:0===n?"neutral":i>=80?"success":i>=50?"warning":"error",label:s(i>=80?"monitoring.passed":i>=50?"monitoring.warnings":"monitoring.failed"),size:"sm"})]}),(0,a.jsx)("div",{className:"space-y-4",children:["fail","warn","pass"].map(e=>{let t=r[e],n=o[e];return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("p",{className:`text-xs uppercase tracking-wide font-semibold ${n.colorClass} flex items-center gap-2`,children:[(0,a.jsx)(ao,{status:rx(e),size:"sm"}),s(`monitoring.statusLabels.${e}`)," (",t.length,")"]}),0===t.length?(0,a.jsx)("div",{className:`${rf} ${n.bgClass} text-text-muted`,children:s("common.none")}):(0,a.jsx)("div",{className:"space-y-2",children:t.map(t=>(0,a.jsx)("div",{className:`${rb} ${n.borderClass} border-l-4`,children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(ao,{status:rx(t.status),size:"sm"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-primary",children:t.name}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:t.message})]})]})},`${e}-${t.name}`))})]},e)})})]})}function rC(e){let{deployments:t}=e,{t:s}=(0,m.Bd)(),r=(0,l.useMemo)(()=>[...new Set(t.map(e=>e.namespace))].sort(),[t]);return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:s("monitoring.deploymentsAcross",{deployments:t.length,namespaces:r.length})}),(0,a.jsx)("div",{className:"overflow-hidden rounded-2xl border border-[var(--glass-line)]",children:(0,a.jsxs)(tj,{children:[(0,a.jsx)(tN,{children:(0,a.jsxs)(tw,{children:[(0,a.jsx)(tC,{children:s("monitoring.status")}),(0,a.jsx)(tC,{children:s("monitoring.name")}),(0,a.jsx)(tC,{children:s("monitoring.namespace")}),(0,a.jsx)(tC,{children:s("monitoring.ready")}),(0,a.jsx)(tC,{})]})}),(0,a.jsx)(tk,{children:t.map(e=>{let t=tM(e.ready);return(0,a.jsxs)(tw,{children:[(0,a.jsx)(tS,{children:(0,a.jsx)(ao,{status:t?"success":"warning",pulse:!t})}),(0,a.jsx)(tS,{children:(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:e.namespace},className:"text-sm font-mono text-blue-400 hover:text-blue-300",children:e.name})}),(0,a.jsx)(tS,{children:e.namespace}),(0,a.jsx)(tS,{children:(0,a.jsx)(Y,{variant:t?"success":"warning",size:"sm",children:e.ready})}),(0,a.jsx)(tS,{children:(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:e.namespace},className:"text-text-muted hover:text-text-primary",children:(0,a.jsx)(aK.A,{size:13})})})]},`${e.namespace}/${e.name}`)})})]})})]})}function rS(e){let{doctor:t,deployments:s,namespaces:r,costOverview:n,activities:i}=e,{t:o,i18n:d}=(0,m.Bd)(),c=(0,l.useMemo)(()=>(null==t?void 0:t.checks.filter(e=>"pass"!==e.status))??[],[t]),p=(0,l.useMemo)(()=>{let e=new Map;for(let t of s){let s=e.get(t.namespace)??[];s.push(t),e.set(t.namespace,s)}return[...e.entries()].map(e=>{let[t,s]=e;return{namespace:t,total:s.length,ready:s.filter(e=>tM(e.ready)).length,deployments:s}}).sort((e,t)=>t.total-e.total)},[s]),u=(0,l.useMemo)(()=>[...(null==n?void 0:n.namespaces)??[]].sort((e,t)=>{let s=e.billingAmount??e.totalUsd,a=t.billingAmount??t.totalUsd;return null===s&&null===a?0:null===s?1:null===a?-1:a-s}).slice(0,4),[null==n?void 0:n.namespaces]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 xl:grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{className:rh,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(rs.A,{size:16,style:{color:"var(--color-nf-cyan)"}}),(0,a.jsx)("h2",{className:"text-sm font-black text-text-primary",children:o("monitoring.latestHealthFindings")})]}),t?c.length>0?(0,a.jsx)("div",{className:"space-y-3",children:c.slice(0,4).map(e=>(0,a.jsxs)("div",{className:rb,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(ao,{status:rx(e.status)}),(0,a.jsx)("p",{className:"text-sm font-medium truncate text-text-primary",children:e.name})]}),(0,a.jsx)(Y,{variant:"pass"===e.status?"success":"warn"===e.status?"warning":"danger",size:"sm",children:o(`monitoring.statusLabels.${e.status}`)})]}),(0,a.jsx)("p",{className:"text-xs text-text-secondary",children:e.message})]},e.name))}):(0,a.jsx)("div",{className:`${rb} py-4 text-sm text-text-secondary`,children:o("monitoring.allSystemsHealthy")}):(0,a.jsx)("div",{className:"text-sm text-text-muted",children:o("monitoring.runningHealthChecks")})]}),(0,a.jsxs)("div",{className:rh,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(sQ.A,{size:16,style:{color:"var(--color-nf-yellow)"}}),(0,a.jsx)("h2",{className:"text-sm font-black text-text-primary",children:o("monitoring.costSnapshot")})]}),n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-2xl font-black text-green-400",children:ap(n,{locale:d.language,shrimpUnitLabel:o("deploy.shrimpCoins")})}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:[o("deployments.totalTokens"),":"," ",au(n.totalTokens,d.language)]}),(0,a.jsxs)("p",{className:"text-xs mt-1 text-text-muted",children:[o("deployments.generatedAt"),": ",tV(n.generatedAt)]})]}),(0,a.jsx)("div",{className:"space-y-2",children:u.length>0?u.map(e=>(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:e.namespace},className:"block",children:(0,a.jsxs)("div",{className:`${rb} flex items-center justify-between gap-3`,children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate text-text-primary",children:e.namespace}),(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[null!==e.totalTokens&&(0,a.jsxs)(a.Fragment,{children:[o("deployments.totalTokens"),":"," ",au(e.totalTokens,d.language)," \xb7"," "]}),o("deployments.availableAgents"),": ",e.availableAgents," \xb7"," ",o("deployments.unavailableAgents"),": ",e.unavailableAgents]})]}),(0,a.jsx)("span",{className:"text-sm font-semibold text-green-400 shrink-0",children:ap(e,{locale:d.language,shrimpUnitLabel:o("deploy.shrimpCoins")})})]})},e.namespace)):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:o("deployments.costUnavailableDescription")})})]}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:o("common.loading")})]}),(0,a.jsxs)("div",{className:rh,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(sX.A,{size:16,style:{color:"var(--color-nf-cyan)"}}),(0,a.jsx)("h2",{className:"text-sm font-black text-text-primary",children:o("monitoring.namespaceInventory")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,a.jsxs)("div",{className:rf,children:[(0,a.jsx)("div",{className:"text-xs mb-1 text-text-muted",children:o("monitoring.configuredNamespaces")}),(0,a.jsx)("div",{className:"text-lg font-black text-text-primary",children:(null==r?void 0:r.configured.length)??0})]}),(0,a.jsxs)("div",{className:rf,children:[(0,a.jsx)("div",{className:"text-xs mb-1 text-text-muted",children:o("monitoring.discoveredNamespaces")}),(0,a.jsx)("div",{className:"text-lg font-black text-text-primary",children:(null==r?void 0:r.discovered.length)??0})]}),(0,a.jsxs)("div",{className:rf,children:[(0,a.jsx)("div",{className:"text-xs mb-1 text-text-muted",children:o("monitoring.trackedNamespaces")}),(0,a.jsx)("div",{className:"text-lg font-black text-text-primary",children:(null==r?void 0:r.all.length)??0})]})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:((null==r?void 0:r.all)??[]).map(e=>(0,a.jsx)(L,{asChild:!0,variant:"secondary",size:"sm",children:(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:e},children:(0,a.jsx)("span",{children:e})})},e))})]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 xl:grid-cols-[1.2fr_0.8fr] gap-4",children:[(0,a.jsxs)("div",{className:rh,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(aH.A,{size:16,style:{color:"var(--color-nf-cyan)"}}),(0,a.jsx)("h2",{className:"text-sm font-black text-text-primary",children:o("monitoring.recentActivity")})]}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:[i.length," ",o("activity.activities")]})]}),(0,a.jsx)(rk,{activities:i,limit:6})]}),(0,a.jsxs)("div",{className:rh,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(sz.A,{size:16,style:{color:"var(--color-nf-cyan)"}}),(0,a.jsx)("h2",{className:"text-sm font-black text-text-primary",children:o("monitoring.deploymentReadiness")})]}),p.length>0?(0,a.jsx)("div",{className:"space-y-3",children:p.map(e=>(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:e.namespace},className:"block",children:(0,a.jsxs)("div",{className:"rounded-2xl border border-border-subtle bg-bg-secondary/30 block px-4 py-3 transition-colors hover:bg-bg-modifier-hover",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-primary",children:e.namespace}),(0,a.jsxs)(Y,{variant:e.ready===e.total?"success":"warning",size:"sm",children:[e.ready,"/",e.total]})]}),(0,a.jsx)("p",{className:"line-clamp-2 text-xs text-text-muted",children:e.deployments.map(e=>e.name).join(", ")})]})},e.namespace))}):(0,a.jsx)(ek,{icon:sz.A,title:o("monitoring.noDeploymentsFound"),description:o("deployments.noDeploymentsYet")})]})]})]})}function rA(e){let{overview:t,namespaceCosts:s,loadingNamespaceCosts:r}=e,{t:n,i18n:i}=(0,m.Bd)(),o=(0,l.useMemo)(()=>new Map(s.map(e=>[e.namespace,e])),[s]),d=(0,l.useMemo)(()=>(null==t?void 0:t.namespaces.reduce((e,t)=>e+t.availableAgents,0))??0,[null==t?void 0:t.namespaces]),c=(0,l.useMemo)(()=>(null==t?void 0:t.namespaces.reduce((e,t)=>e+t.unavailableAgents,0))??0,[null==t?void 0:t.namespaces]);return t&&0!==t.namespaces.length?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)(an,{className:"mb-0 grid-cols-1 md:grid-cols-2 xl:grid-cols-5",children:[(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:n("deployments.totalCost"),value:ap(t,{locale:i.language,shrimpUnitLabel:n("deploy.shrimpCoins")}),icon:(0,a.jsx)(sQ.A,{size:13}),iconClassName:"text-success",valueClassName:"text-success"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:n("deployments.totalTokens"),value:au(t.totalTokens,i.language),icon:(0,a.jsx)(aH.A,{size:13}),iconClassName:"text-accent",valueClassName:"text-accent"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:n("monitoring.namespaces"),value:t.namespaces.length,icon:(0,a.jsx)(sX.A,{size:13}),iconClassName:"text-accent",valueClassName:"text-accent"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:n("deployments.availableAgents"),value:d,icon:(0,a.jsx)(sY.A,{size:13}),iconClassName:"text-primary",valueClassName:"text-primary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:n("deployments.unavailableAgents"),value:c,icon:(0,a.jsx)(sM.A,{size:13}),iconClassName:c>0?"text-warning":"text-text-muted",valueClassName:c>0?"text-warning":"text-text-muted"})})]}),(0,a.jsxs)("div",{className:"text-xs text-text-muted",children:[n("deployments.generatedAt"),": ",tV(t.generatedAt)]}),(0,a.jsx)("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4",children:t.namespaces.map(e=>{let t=o.get(e.namespace),s=t?t.availableAgents>0?"tracked":"unavailable":null;return(0,a.jsxs)("div",{className:rh,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(tJ.N_,{to:"/deployments/$namespace",params:{namespace:e.namespace},className:"text-base font-black hover:opacity-85 transition-opacity text-text-primary",children:e.namespace}),s&&(0,a.jsx)(Y,{variant:null!==e.totalUsd?"success":"neutral",size:"sm",children:n(`monitoring.costSources.${s}`)})]}),(0,a.jsxs)("p",{className:"text-xs mt-1 text-text-muted",children:[null!==e.totalTokens&&(0,a.jsxs)(a.Fragment,{children:[n("deployments.totalTokens"),":"," ",au(e.totalTokens,i.language)," \xb7"," "]}),n("deployments.availableAgents"),": ",e.availableAgents," \xb7"," ",n("deployments.unavailableAgents"),": ",e.unavailableAgents]})]}),(0,a.jsxs)("div",{className:"min-w-0 shrink-0 text-left md:max-w-[14rem] md:text-right",children:[(0,a.jsx)("p",{className:"break-words text-lg font-semibold leading-tight text-green-400",children:ap(e,{locale:i.language,shrimpUnitLabel:n("deploy.shrimpCoins")})}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:n("deployments.totalCost")})]})]}),t?t.agents.length>0?(0,a.jsx)("div",{className:"space-y-3",children:t.agents.map(e=>{let s;return(0,a.jsxs)("div",{className:rb,children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-col gap-3 md:flex-row md:items-start md:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("p",{className:"text-sm font-mono truncate text-text-primary",children:e.agentName}),(0,a.jsx)(Y,{variant:null!==e.totalUsd?"success":"neutral",size:"sm",children:n(`monitoring.costSources.${e.source}`)})]}),(0,a.jsx)("p",{className:"text-xs mt-1 text-text-muted",children:e.podName??n("common.none")})]}),(0,a.jsxs)("div",{className:"min-w-0 shrink-0 text-left md:max-w-[14rem] md:text-right",children:[(0,a.jsx)("p",{className:"break-words text-sm font-semibold text-green-400",children:ap(e,{locale:i.language,shrimpUnitLabel:n("deploy.shrimpCoins")})}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:n("deployments.totalCost")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:ru(e.totalTokens,i.language,n("deployments.tokens"))})]})]}),e.providers.length>0?(0,a.jsx)("div",{className:"space-y-2",children:e.providers.map(s=>{var r;let l,o,d=(r={billingUnit:t.billingUnit,locale:i.language,tokenLabel:n("deployments.tokens")},l=null!==s.totalTokens?ru(s.totalTokens,r.locale,r.tokenLabel):null,o=s.usageLabel??s.raw??null,"shrimp"===r.billingUnit?{primary:l??o??"—",secondary:o&&o!==l?o:null}:{primary:am(s.amountUsd,r.locale),secondary:l??o});return(0,a.jsxs)("div",{className:"flex flex-col gap-1 text-xs sm:flex-row sm:items-center sm:justify-between sm:gap-3",children:[(0,a.jsx)("span",{className:"text-text-secondary",children:s.provider}),(0,a.jsxs)("div",{className:"min-w-0 text-left sm:text-right",children:[(0,a.jsx)("p",{className:"break-words text-text-primary",children:d.primary}),d.secondary?(0,a.jsx)("p",{className:"break-words text-text-muted",children:d.secondary}):null]})]},`${e.agentName}-${s.provider}`)})}):(0,a.jsx)("p",{className:"text-xs text-text-muted",children:n("deployments.noProvidersReported")}),e.message&&(0,a.jsx)("p",{className:"text-xs text-yellow-500 mt-3",children:(s=e.message).startsWith("i18n:")?n(s.slice(5)):s})]},`${t.namespace}-${e.agentName}`)})}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:n("deployments.costUnavailableDescription")}):(0,a.jsx)("p",{className:"text-sm text-text-muted",children:r?n("monitoring.loadingCostDetails"):n("common.loading")})]},e.namespace)})})]}):(0,a.jsx)(ek,{icon:sQ.A,title:n("deployments.costUnavailable"),description:n("deployments.costUnavailableDescription")})}function rT(e){let{activities:t}=e,{t:s}=(0,m.Bd)(),r=(0,l.useMemo)(()=>rg(s),[s]),[n,i]=(0,l.useState)(""),[o,d]=(0,l.useState)("all"),[c,p]=(0,l.useState)("newest"),u=aP(n),x=(0,l.useMemo)(()=>{let e=t;if("all"!==o&&(e=e.filter(e=>e.type===o)),u){let t=u.toLowerCase();e=e.filter(e=>{var s,a,r,n;return e.title.toLowerCase().includes(t)||(null==(s=e.description)?void 0:s.toLowerCase().includes(t))||(null==(a=e.detail)?void 0:a.toLowerCase().includes(t))||(null==(r=e.namespace)?void 0:r.toLowerCase().includes(t))||(null==(n=e.template)?void 0:n.toLowerCase().includes(t))})}return"oldest"===c?[...e].reverse():e},[t,u,c,o]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)(e2,{value:n,onChange:i,placeholder:s("activity.searchActivities")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(ra.A,{size:12,className:"text-text-muted"}),(0,a.jsxs)(eW,{value:o,onChange:e=>d(e.target.value),children:[(0,a.jsx)("option",{value:"all",children:s("activity.allTypes")}),ry.map(e=>(0,a.jsx)("option",{value:e,children:r[e].label},e))]})]}),(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>p(e=>"newest"===e?"oldest":"newest"),children:[(0,a.jsx)(rr.A,{size:11}),"newest"===c?s("activity.newestFirst"):s("activity.oldestFirst")]})]}),(0,a.jsx)("div",{className:"flex items-center gap-6 text-xs text-text-muted",children:(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)(aH.A,{size:12}),t.length," ",s("activity.total")]})}),0===x.length?(0,a.jsx)(ek,{icon:aH.A,title:s("activity.noActivityRecorded"),description:0===t.length?s("activity.operationsWillAppear"):s("activity.noActivitiesMatch")}):(0,a.jsx)(rk,{activities:x})]})}var rD=s(30808),rP=s(46587),r_=s(13788),rR=s(72494),rF=s(86362),rz=s(23737),rI=s(84787),rE=s(93180);let rL=!1;function rU(){if(rL||"u"<typeof globalThis)return;let e=globalThis;rD.wG.config({monaco:rE}),e.MonacoEnvironment={getWorker:(e,t)=>"json"===t?new Worker(new URL(s.p+s.u("6612"),s.b),Object.assign({},{type:"module"},{type:void 0})):new Worker(new URL(s.p+s.u("2924"),s.b),Object.assign({},{type:"module"},{type:void 0}))},rL=!0}function rO(e){let{code:t,language:s="json",title:r,className:n,maxHeight:i="400px",showLineNumbers:o=!1}=e,{t:d}=(0,m.Bd)(),[c,p]=(0,l.useState)(!1),u=async()=>{await navigator.clipboard.writeText(t),p(!0),setTimeout(()=>p(!1),2e3)};return(0,a.jsxs)("div",{className:t$("overflow-hidden rounded-xl border border-border-subtle bg-[#1e1e1e]",n),children:[(r||s)&&(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-[var(--glass-line)] bg-[#252526] px-4 py-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[r&&(0,a.jsx)("span",{className:"text-xs text-[#cccccc]/70",children:r}),s&&(0,a.jsx)("span",{className:"rounded bg-white/8 px-1.5 py-0.5 text-[10px] text-[#cccccc]/50",children:s})]}),(0,a.jsxs)(L,{type:"button",onClick:u,variant:"ghost",size:"xs",className:"flex items-center gap-1 text-xs font-medium normal-case tracking-normal !text-[#cccccc]/60 transition-colors hover:!text-[#cccccc]",children:[c?(0,a.jsx)(t3.A,{size:12,className:"text-green-400"}):(0,a.jsx)(tG.A,{size:12}),d(c?"common.copied":"common.copy")]})]}),(0,a.jsx)(rD.Ay,{height:i,language:s,value:t,theme:"vs-dark",options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',lineNumbers:o?"on":"off",scrollBeyondLastLine:!1,wordWrap:"off",tabSize:2,automaticLayout:!0,padding:{top:8,bottom:8},folding:!0,renderLineHighlight:"none",overviewRulerBorder:!1,hideCursorInOverviewRuler:!0,scrollbar:{vertical:"auto",horizontal:"auto",verticalScrollbarSize:6,horizontalScrollbarSize:6},contextmenu:!1,links:!1}})]})}function r$(e){let t,s;return{id:String(e.id??e.name??"unknown"),name:(t=e.identity,String(e.name??(null==t?void 0:t.name)??e.id??"Unknown")),role:"string"==typeof e.role?e.role:"string"==typeof e.description?e.description:void 0,description:"string"==typeof e.description?e.description:void 0,tools:Array.isArray(e.tools)?e.tools.map(String):void 0,model:"string"==typeof(s=e.model)?s:s&&"object"==typeof s&&"preferred"in s&&"string"==typeof s.preferred?s.preferred:void 0,runtime:"string"==typeof e.runtime?e.runtime:void 0,identity:e.identity,integrations:e.integrations,configuration:e.configuration,resources:e.resources,env:e.env}}function rM(e){if(!e||"object"!=typeof e)return[];let t=e.deployments,s=null==t?void 0:t.agents;if(Array.isArray(s)&&s.length>0)return s.filter(e=>"object"==typeof e&&null!==e).map(r$);if(Array.isArray(e.agents)&&e.agents.length>0)return e.agents.filter(e=>"object"==typeof e&&null!==e).map(r$);let a=e.team,r=(null==a?void 0:a.members)??e.members;return Array.isArray(r)?r.filter(e=>"object"==typeof e&&null!==e).map(r$):[]}function rV(e){let{open:t,children:s}=e;return(0,a.jsx)("div",{style:{display:"grid",gridTemplateRows:t?"1fr":"0fr",transition:"grid-template-rows 260ms cubic-bezier(0.4, 0, 0.2, 1)"},children:(0,a.jsx)("div",{style:{overflow:"hidden"},children:s})})}function rq(e){var t,s;let{agent:r,index:n}=e,{t:i}=(0,m.Bd)(),[o,d]=(0,l.useState)(!1);return(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{type:"button",onClick:()=>d(!o),className:t$("flex w-full items-center gap-4 px-5 py-4 text-left transition-colors hover:bg-bg-modifier-hover/40",o&&"bg-bg-modifier-hover/20"),children:[(0,a.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-xs font-black",style:{background:"rgba(0,243,255,0.08)",border:"1px solid rgba(0,243,255,0.14)",color:"var(--color-nf-cyan)"},children:n+1}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm font-black uppercase tracking-[0.08em] text-text-primary",children:(null==(t=r.identity)?void 0:t.name)??r.name}),r.runtime&&(0,a.jsx)(Y,{variant:"neutral",size:"sm",children:r.runtime}),r.model&&(0,a.jsxs)(Y,{variant:"neutral",size:"sm",className:"gap-1",children:[(0,a.jsx)(rF.A,{size:9}),r.model]})]}),(r.role??r.description)&&(0,a.jsx)("p",{className:"mt-0.5 line-clamp-1 text-[11px] uppercase tracking-[0.12em] text-text-muted",children:r.role??r.description})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[r.integrations&&r.integrations.length>0&&(0,a.jsxs)(Y,{variant:"info",size:"sm",className:"gap-1",children:[(0,a.jsx)(tZ.A,{size:9}),r.integrations.length]}),(0,a.jsx)(aC.A,{size:14,className:t$("text-text-muted transition-transform duration-200",o&&"rotate-90")})]})]}),(0,a.jsx)(rV,{open:o,children:(0,a.jsxs)("div",{className:"space-y-3 border-t border-border-subtle px-5 pb-5 pt-4",children:[(null==(s=r.identity)?void 0:s.personality)&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{className:"mb-1.5 text-micro font-black uppercase tracking-[0.16em] text-text-muted",children:i("templateDetail.identity")}),(0,a.jsx)(eA,{as:"p",className:"line-clamp-4 rounded-[18px] px-3 py-3 text-xs leading-6 text-text-secondary",children:r.identity.personality})]}),r.integrations&&r.integrations.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{className:"mb-1.5 text-micro font-black uppercase tracking-[0.16em] text-text-muted",children:i("templateDetail.integrations")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:r.integrations.map(e=>(0,a.jsxs)(L,{type:"button",variant:"secondary",size:"sm",className:"pointer-events-none !h-8 !gap-1.5 !px-3 !text-xs",children:[(0,a.jsx)(rI.A,{size:10})," ",e.name]},e.name))})]}),r.resources&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{className:"mb-1.5 text-micro font-black uppercase tracking-[0.16em] text-text-muted",children:i("templateDetail.resources")}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[r.resources.requests&&(0,a.jsxs)(eA,{className:"rounded-[18px] px-3 py-3",children:[(0,a.jsx)("span",{className:"mb-1 block text-micro font-semibold text-text-muted",children:i("templateDetail.requests")}),Object.entries(r.resources.requests).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"flex justify-between gap-2 text-xs text-text-secondary",children:[(0,a.jsx)("span",{className:"text-text-muted",children:t}),(0,a.jsx)("span",{className:"font-mono",children:s})]},t)})]}),r.resources.limits&&(0,a.jsxs)(eA,{className:"rounded-[18px] px-3 py-3",children:[(0,a.jsx)("span",{className:"mb-1 block text-micro font-semibold text-text-muted",children:i("templateDetail.limits")}),Object.entries(r.resources.limits).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"flex justify-between gap-2 text-xs text-text-secondary",children:[(0,a.jsx)("span",{className:"text-text-muted",children:t}),(0,a.jsx)("span",{className:"font-mono",children:s})]},t)})]})]})]}),r.configuration&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h5",{className:"mb-1.5 flex items-center gap-1 text-micro font-black uppercase tracking-[0.16em] text-text-muted",children:[(0,a.jsx)(t1.A,{size:10})," ",i("storeDetail.configuration")]}),(0,a.jsx)(rO,{code:JSON.stringify(r.configuration,null,2),language:"json",maxHeight:"160px"})]}),r.env&&Object.keys(r.env).length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{className:"mb-1.5 text-micro font-black uppercase tracking-[0.16em] text-text-muted",children:i("templateDetail.environment")}),(0,a.jsx)("div",{className:"space-y-1",children:Object.entries(r.env).map(e=>{let[t,s]=e;return(0,a.jsxs)("div",{className:"flex gap-2 font-mono text-xs",children:[(0,a.jsx)("span",{style:{color:"var(--color-nf-yellow)"},children:t}),(0,a.jsx)("span",{className:"text-text-muted",children:"="}),(0,a.jsx)("span",{className:"truncate text-text-secondary",children:String(s)})]},t)})})]}),r.tools&&r.tools.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("h5",{className:"mb-1.5 text-micro font-black uppercase tracking-[0.16em] text-text-muted",children:i("templateDetail.tools")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5",children:r.tools.map(e=>(0,a.jsx)(eA,{as:"span",className:"rounded-full px-2 py-1 text-micro font-mono text-text-secondary",children:e},e))})]})]})})]})}function rB(e){let{agents:t,emptyTitle:s,emptyDescription:r,introText:n}=e,{t:i}=(0,m.Bd)();return 0===t.length?(0,a.jsx)(ek,{icon:aU.A,title:s,description:r}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:n??i("templateDetail.agentsCount",{count:t.length})}),(0,a.jsx)("div",{className:"overflow-hidden rounded-2xl border border-border-subtle divide-y divide-border-subtle",children:t.map((e,t)=>(0,a.jsx)(rq,{agent:e,index:t},e.id))})]})}function rK(e){let{templateData:t,description:s,title:r}=e,{t:n}=(0,m.Bd)(),i=t?JSON.stringify(t,null,2):"Loading...";return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:s}),(0,a.jsx)(rO,{code:t?i:n("common.loading"),language:"json",title:r,showLineNumbers:!0,maxHeight:"600px"})]})}function rH(e){let{title:t,items:s,className:r="rounded-3xl p-5",children:n}=e;return 0!==s.length||n?(0,a.jsxs)(eS,{className:t$("space-y-4",r),children:[(0,a.jsx)("h3",{className:"text-xs font-black uppercase tracking-[0.2em] text-text-muted",children:t}),s.length>0&&(0,a.jsx)("div",{className:"space-y-3 pt-3 text-sm",children:s.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("span",{className:"text-xs text-text-muted flex items-center gap-1.5",children:[e.icon,e.label]}),(0,a.jsx)("span",{className:t$("text-sm text-text-primary",e.valueClassName),children:e.value})]},e.label))}),n?(0,a.jsx)("div",{className:"space-y-2",children:n}):null]}):null}function rW(e){let{breadcrumbItems:t,heroIcon:s,title:r,titleMeta:n,titleActions:i,description:l,supportingText:o,badges:d,chips:c,actions:m,sidebar:p,tabs:u,activeTab:x,onTabChange:g,children:y}=e;return(0,a.jsxs)("div",{className:"mx-auto max-w-[1440px] px-4 md:px-6 detail-layout",children:[(0,a.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,a.jsxs)(eS,{className:"p-6",children:[(0,a.jsx)(aa,{items:t,className:"mb-3"}),(0,a.jsxs)("div",{className:"flex flex-col gap-5 md:flex-row md:items-start",children:[(0,a.jsx)("div",{className:"flex h-20 w-20 shrink-0 items-center justify-center rounded-2xl border border-border-subtle bg-bg-secondary/50",children:s}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsx)("h1",{className:"text-[1.875rem] font-extrabold tracking-[-0.03em] text-text-primary md:text-[2.125rem]",children:r}),n]}),(0,a.jsx)("div",{className:"max-w-3xl text-sm leading-7 text-text-secondary",children:l}),o&&(0,a.jsx)("div",{children:o})]}),i&&(0,a.jsx)("div",{className:"shrink-0",children:i})]}),d&&(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2.5",children:d}),c&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2.5",children:c}),m&&(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2.5 pt-1",children:m})]})]})]}),(0,a.jsx)(tT,{value:x,onChange:g,children:(0,a.jsx)(s2,{tabs:u,activeId:x,onSelect:g})}),y]}),(0,a.jsx)("div",{className:"detail-sidebar",children:p})]})}function rJ(e){let{name:t,content:s,templateSlug:r,readOnly:i=!1}=e,o=sx(),{t:d}=(0,m.Bd)(),c=sg(),p=(0,n.jE)(),[u,x]=(0,l.useState)(()=>s?JSON.stringify(s,null,2):""),[g,y]=(0,l.useState)(null),[h,b]=(0,l.useState)(null),[f,v]=(0,l.useState)(!0);(0,l.useEffect)(()=>{s&&x(JSON.stringify(s,null,2))},[s]);let j=(0,t5.n)({mutationFn:e=>o.myTemplates.save(t,e,r??void 0),onSuccess:()=>{p.invalidateQueries({queryKey:["my-templates"]}),p.invalidateQueries({queryKey:["my-template",t]}),v(!0),c.success(d("templateDetail.templateSaved"))},onError:e=>c.error(`${d("templateDetail.saveFailed")}: ${e.message}`)}),N=(0,t5.n)({mutationFn:e=>o.validate(e),onSuccess:e=>{y(e),e.valid?c.success(d("templateDetail.validationSummaryValid",{agents:e.agents,configurations:e.configurations})):c.error(d("templateDetail.validationSummaryInvalid",{count:e.violations.length}))}}),k=(0,l.useCallback)(e=>{x(e??""),v(!1),y(null)},[]),w=(0,l.useMemo)(()=>{try{return JSON.parse(u),!0}catch{return!1}},[u]);return(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsxs)("span",{children:[u.split("\n").length," ",d("templateDetail.lines")]}),(0,a.jsx)("span",{children:"\xb7"}),(0,a.jsx)("span",{className:w?"text-green-600":"text-red-500",children:u.trim()?w?d("templateDetail.validJSON"):d("templateDetail.invalidJSON"):""})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(L,{type:"button",onClick:()=>{try{x(JSON.stringify(JSON.parse(u),null,2)),c.info(d("templateDetail.formatted"))}catch{c.error(d("templateDetail.cannotFormat"))}},disabled:!w,variant:"ghost",size:"sm",children:[(0,a.jsx)(rP.A,{size:12}),d("templateDetail.format")]}),(0,a.jsxs)(L,{type:"button",onClick:()=>{try{y(null),N.mutate(JSON.parse(u))}catch{c.error(d("templateDetail.invalidJSONSyntax"))}},disabled:!w||N.isPending,variant:"ghost",size:"sm",children:[(0,a.jsx)(rt.A,{size:12}),d("templateDetail.validate")]}),(0,a.jsxs)(L,{type:"button",onClick:()=>{try{j.mutate(JSON.parse(u))}catch{c.error(d("templateDetail.invalidJSONCannotSave"))}},disabled:i||!w||j.isPending,variant:"secondary",size:"sm",children:[f?(0,a.jsx)(t3.A,{size:12}):(0,a.jsx)(ss.A,{size:12}),f?d("common.saved"):d("common.save")]})]})]}),g&&(0,a.jsxs)("div",{className:t$("border rounded-lg p-3 mb-3 flex items-center gap-2 text-sm",g.valid?"bg-green-900/20 border-green-800 text-green-400":"bg-red-900/20 border-red-800 text-red-400"),children:[(0,a.jsx)(rt.A,{size:14}),g.valid?d("templateDetail.validationSummaryValid",{agents:g.agents,configurations:g.configurations}):d("templateDetail.validationSummaryInvalid",{count:g.violations.length})]}),h&&(0,a.jsx)("div",{className:"mb-3 rounded-lg border border-yellow-800 bg-yellow-900/20 p-3 text-sm text-yellow-300",children:h}),(0,a.jsx)("div",{className:"overflow-hidden rounded-xl border border-border-subtle min-h-[500px]",children:(0,a.jsx)(rD.Ay,{height:"500px",language:"json",value:u,onChange:i?void 0:k,onMount:async(e,t)=>{try{let e=await o.schema();t.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,allowComments:!1,schemaValidation:"error",schemas:[{uri:"https://raw.githubusercontent.com/BuggyBlues/shadow/main/apps/cloud/schemas/config.schema.json",fileMatch:["*"],schema:e}]}),b(null)}catch(e){b(d("templateDetail.schemaLoadFailed",{message:e instanceof Error?e.message:d("common.error")}))}},theme:"vs-dark",options:{minimap:{enabled:!1},fontSize:12,fontFamily:'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",tabSize:2,formatOnPaste:!0,automaticLayout:!0,padding:{top:8},readOnly:i}})})]})}function rQ(e){let{name:t}=e,s=sx(),{t:r}=(0,m.Bd)(),i=sg(),l=(0,n.jE)(),{data:o,isLoading:d}=(0,t2.I)({queryKey:["my-template-versions",t],queryFn:()=>s.myTemplates.versions(t)}),c=(0,t5.n)({mutationFn:e=>s.myTemplates.restoreVersion(t,e),onSuccess:(e,s)=>{l.invalidateQueries({queryKey:["my-template",t]}),l.invalidateQueries({queryKey:["my-template-versions",t]}),i.success(r("templateDetail.restored",{version:s}))},onError:e=>i.error(`${r("templateDetail.restoreFailed")}: ${e.message}`)});if(d)return(0,a.jsxs)("div",{className:"flex items-center justify-center py-12 text-sm text-text-muted",children:[(0,a.jsx)(tL.A,{size:16,className:"animate-spin mr-2"}),r("templateDetail.loadingVersions")]});let p=(null==o?void 0:o.versions)??[];return p.length<=1?(0,a.jsx)(s1,{icon:r_.A,title:r("templateDetail.noVersionHistory"),description:r("templateDetail.editAndSaveToCreate")}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:[r("templateDetail.currentVersion")," ",(0,a.jsxs)("span",{className:"text-white font-medium",children:["v",(null==o?void 0:o.current)??1]})," \xb7 ",p.length," ",r("templateDetail.totalVersions")]}),(0,a.jsx)("div",{className:"space-y-2",children:p.map(e=>(0,a.jsxs)("div",{className:t$("flex items-center justify-between px-4 py-3 rounded-lg border transition-colors",e.current?"bg-blue-900/20 border-blue-800/50":"bg-bg-secondary/70 border-border-subtle hover:border-border-dim"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("div",{className:t$("w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold",e.current?"bg-primary text-black":"bg-bg-tertiary text-text-muted"),children:["v",e.version]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("span",{className:"text-sm text-text-primary",children:[r("templateDetail.versionLabel",{version:e.version}),e.current&&(0,a.jsx)(Y,{variant:"info",size:"sm",children:r("templateDetail.current")})]}),e.createdAt&&(0,a.jsxs)("p",{className:"mt-0.5 flex items-center gap-1 text-xs text-text-muted",children:[(0,a.jsx)(aO.A,{size:10}),new Date(e.createdAt).toLocaleString()]})]})]}),!e.current&&(0,a.jsxs)(L,{type:"button",onClick:()=>c.mutate(e.version),disabled:c.isPending,variant:"ghost",size:"sm",children:[(0,a.jsx)(sL.A,{size:12}),r("templateDetail.restore")]})]},e.version))})]})}rU(),rU();var rG=s(22050),rY=s(63938);let rZ={devops:{bg:"bg-gradient-to-br from-blue-600/40 via-blue-800/20 to-transparent",textColor:"text-blue-300"},security:{bg:"bg-gradient-to-br from-red-600/40 via-red-800/20 to-transparent",textColor:"text-red-300"},support:{bg:"bg-gradient-to-br from-teal-600/40 via-teal-800/20 to-transparent",textColor:"text-teal-300"},research:{bg:"bg-gradient-to-br from-violet-600/40 via-violet-800/20 to-transparent",textColor:"text-violet-300"},monitoring:{bg:"bg-gradient-to-br from-orange-600/40 via-orange-800/20 to-transparent",textColor:"text-orange-300"},business:{bg:"bg-gradient-to-br from-emerald-600/40 via-emerald-800/20 to-transparent",textColor:"text-emerald-300"},demo:{bg:"bg-gradient-to-br from-pink-600/40 via-pink-800/20 to-transparent",textColor:"text-pink-300"}},rX={bg:"bg-gradient-to-br from-primary/40 via-primary/15 to-transparent",textColor:"text-primary"};function r0(e){let{icon:t,value:s,label:r}=e,n=!!(null==r?void 0:r.trim()),i=null!=s&&""!==s,l=r?`${r} ${"string"==typeof s||"number"==typeof s?`\xb7 ${s}`:""}`.trim():"string"==typeof s||"number"==typeof s?String(s):void 0;return n||i?(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-xl border border-border-subtle bg-bg-primary/60 px-2.5 py-1.5 text-[11px] font-medium text-text-secondary",title:l,children:[t,n?(0,a.jsx)("span",{children:r}):null,i?(0,a.jsx)("span",{className:"text-text-muted",children:s}):null]}):null}function r1(e){let{template:t,categoryLabel:s,difficultyLabel:r,detailHref:n,title:i,summary:l,headerBadges:o,metadata:d,metrics:c,primaryAction:p,secondaryAction:u,headerActions:x}=e,{t:g}=(0,m.Bd)(),y=rZ[t.category]??rX,h=i.split(/[\s-]+/).slice(0,2);return(0,a.jsxs)(eT,{className:"relative overflow-hidden rounded-[18px] border border-border-subtle bg-bg-secondary/60 shadow-[0_16px_42px_rgba(0,0,0,0.14)] transition hover:border-primary/35 hover:bg-bg-secondary/72",children:[(0,a.jsx)(tJ.N_,{to:n,className:"block",children:(0,a.jsxs)("div",{className:t$("relative h-36 overflow-hidden border-b border-border-subtle/70",y.bg),children:[(0,a.jsx)("div",{className:"absolute inset-0 flex flex-col items-start justify-center gap-0.5 px-5 overflow-hidden",children:h.map((e,t)=>(0,a.jsx)("span",{className:t$("font-black tracking-tighter leading-none select-none",y.textColor),style:{fontSize:0===t?"2rem":1===t?"1.35rem":"0.9rem",opacity:1-.22*t},children:e.toUpperCase()},`${e}-${t}`))}),(0,a.jsx)("div",{className:"absolute inset-x-0 bottom-0 h-8 bg-gradient-to-t from-black/20 to-transparent pointer-events-none"}),t.featured&&(0,a.jsx)("div",{className:"absolute left-3 top-3",children:(0,a.jsx)(Y,{variant:"info",size:"sm",children:g("store.featured")})})]})}),(0,a.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[s?(0,a.jsx)(Y,{variant:"neutral",size:"sm",children:s}):null,r?(0,a.jsx)(Y,{variant:"neutral",size:"sm",children:r}):null,o]}),(0,a.jsxs)("div",{className:"min-w-0 space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsx)(tJ.N_,{to:n,className:"line-clamp-1 text-[15px] font-extrabold text-text-primary transition-colors hover:text-primary",children:i}),x?(0,a.jsx)("div",{className:"flex items-center gap-2",children:x}):null]}),(0,a.jsx)("p",{className:"line-clamp-2 text-[13px] leading-5 text-text-secondary",children:l})]}),d?(0,a.jsx)("div",{className:"text-sm text-text-muted",children:d}):null,c&&c.length>0?(0,a.jsx)("div",{className:"mt-auto flex flex-wrap items-center gap-2",children:c.map((e,t)=>(0,a.jsx)(r0,{icon:e.icon,value:e.value,label:e.label},`${e.label??e.value??"metric"}-${t}`))}):null,(p||u)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 border-t border-border-subtle pt-3",children:[p?(0,a.jsx)(L,{asChild:!0,variant:p.variant??"primary",size:"sm",className:u?"w-auto sm:flex-1":"w-full",children:(0,a.jsxs)(tJ.N_,{to:p.href,className:"inline-flex items-center gap-1.5",children:[p.icon?(0,a.jsx)("span",{className:"size-4 shrink-0",children:p.icon}):null,(0,a.jsx)("span",{className:"truncate",children:p.label})]})}):null,u?(0,a.jsx)(L,{asChild:!0,variant:u.variant??"secondary",size:"sm",className:p?"w-auto":"w-full",children:(0,a.jsxs)(tJ.N_,{to:u.href,className:"inline-flex items-center gap-1.5",children:[u.icon?(0,a.jsx)("span",{className:"size-4 shrink-0",children:u.icon}):null,(0,a.jsx)("span",{className:"truncate",children:u.label})]})}):null]})]})]})}function r2(e){let[t,s]=(0,l.useState)(e[0]??"");return(0,l.useEffect)(()=>{let a;if(0===e.length)return;let r=0,n=t.length,i=!1;return a=setTimeout(function t(){let l=e[r]??"";i?n>0?(n--,s(l.slice(0,n)),a=setTimeout(t,22)):(i=!1,r=(r+1)%e.length,n=0,a=setTimeout(t,400)):n<l.length?(n++,s(l.slice(0,n)),a=setTimeout(t,45)):(i=!0,a=setTimeout(t,1800))},1800),()=>clearTimeout(a)},[]),t}function r5(e){let t=rM(e),s=e&&"object"==typeof e?e:{},a="string"==typeof s.namespace?s.namespace:null;return{agentCount:t.length,namespace:a,agentHighlights:t.map(e=>{var t;return(null==(t=e.identity)?void 0:t.name)??e.name}).filter(Boolean).slice(0,3)}}function r3(e){let{onFork:t,onClose:s}=e,r=sx(),{t:n,i18n:i}=(0,m.Bd)(),{data:o}=(0,t2.I)({queryKey:["templates",i.language],queryFn:()=>r.templates.listByLocale(i.language)}),[d,c]=(0,l.useState)(""),[p,u]=(0,l.useState)(""),[x,g]=(0,l.useState)(""),[y,h]=(0,l.useState)(!1),b=(0,l.useRef)(null),f=(0,l.useMemo)(()=>{if(!o)return[];if(!x)return o;let e=x.toLowerCase();return o.filter(t=>{var s;return t.name.toLowerCase().includes(e)||t.title.toLowerCase().includes(e)||(null==(s=t.description)?void 0:s.toLowerCase().includes(e))})},[o,x]);return(0,l.useEffect)(()=>{d&&!p&&u(`my-${d}`)},[d,p]),(0,l.useEffect)(()=>{let e=e=>{b.current&&!b.current.contains(e.target)&&h(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,a.jsx)(e$,{open:!0,onClose:s,children:(0,a.jsxs)(eV,{maxWidth:"max-w-lg",children:[(0,a.jsx)(eq,{overline:n("templates.forkTemplate"),icon:(0,a.jsx)(rz.A,{size:18,className:"text-primary"}),title:n("templates.forkTemplate"),subtitle:n("templates.chooseStoreTemplate")}),(0,a.jsxs)(eB,{children:[(0,a.jsxs)("div",{ref:b,className:"relative",children:[(0,a.jsx)(e_,{type:"text",label:n("templates.sourceTemplate"),icon:rG.A,value:d||x,onChange:e=>{g(e.target.value),c(""),u(""),h(!0)},onFocus:()=>h(!0),placeholder:n("templates.searchPlaceholder")}),y&&f.length>0&&(0,a.jsx)("div",{className:"absolute z-10 mt-2 max-h-52 w-full overflow-y-auto rounded-[22px] border",style:{boxShadow:"var(--shadow-soft)"},children:f.map(e=>{let t=d===e.name;return(0,a.jsxs)(L,{type:"button",onClick:()=>{c(e.name),g(""),u(`my-${e.name}`),h(!1)},variant:"ghost",size:"sm",style:{background:t?"rgba(0, 209, 255, 0.08)":"transparent"},children:[(0,a.jsx)("span",{className:t$("truncate font-semibold",t?"text-text-primary":"text-text-secondary"),children:e.title||e.name}),(0,a.jsx)("span",{className:"ml-2 shrink-0 text-xs text-text-muted",children:n("store.agentCount",{count:e.agentCount})})]},e.name)})}),y&&x&&0===f.length&&(0,a.jsx)("div",{className:"absolute z-10 mt-2 w-full rounded-[22px] border px-4 py-3 text-center text-xs",style:{boxShadow:"var(--shadow-soft)"},children:n("templates.noTemplatesMatch",{query:x})})]}),(0,a.jsx)(e_,{type:"text",label:n("templates.newTemplateName"),value:p,onChange:e=>u(e.target.value),placeholder:n("templates.templateNamePlaceholder")})]}),(0,a.jsx)(eK,{children:(0,a.jsxs)(eH,{children:[(0,a.jsx)(L,{type:"button",variant:"ghost",onClick:s,children:n("common.cancel")}),(0,a.jsxs)(L,{type:"button",variant:"primary",onClick:()=>{d&&p.trim()&&t(d,p.trim())},disabled:!d||!p.trim(),children:[(0,a.jsx)(rz.A,{size:14}),n("common.fork")]})]})})]})})}function r4(e){let{onCreate:t,onClose:s,error:r,isPending:n=!1}=e,{t:i}=(0,m.Bd)(),[o,d]=(0,l.useState)("");return(0,a.jsx)(e$,{open:!0,onClose:s,children:(0,a.jsxs)(eV,{maxWidth:"max-w-lg",children:[(0,a.jsx)(eq,{overline:i("templates.createTemplate"),icon:(0,a.jsx)(sH.A,{size:18,className:"text-primary"}),title:i("templates.createTemplate"),subtitle:i("templates.createTemplateDescription")}),(0,a.jsxs)(eB,{children:[(0,a.jsx)(e_,{type:"text",label:i("templates.newTemplateName"),value:o,onChange:e=>d(e.target.value),placeholder:i("templates.templateNamePlaceholder")}),r&&(0,a.jsx)("div",{className:"rounded-xl border border-red-800 bg-red-900/20 px-4 py-3 text-sm text-red-300",children:r})]}),(0,a.jsx)(eK,{children:(0,a.jsxs)(eH,{children:[(0,a.jsx)(L,{type:"button",variant:"ghost",onClick:s,children:i("common.cancel")}),(0,a.jsxs)(L,{type:"button",variant:"primary",onClick:()=>{let e=o.trim();e&&t(e)},disabled:!o.trim()||n,loading:n,children:[(0,a.jsx)(sH.A,{size:14}),i("templates.createTemplate")]})]})})]})})}var r8=s(87029),r6=s(36823);let r9=["default","fast","flash","reasoning","vision","tools"],r7={providerId:"",name:"",apiKey:"",baseUrl:"",apiFormat:"openai",authType:"api_key",models:[],enabled:!0};function ne(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function nt(e){return/^[*•●∙·]{3,}$/u.test(e.trim())}function ns(e){let t=e.config.baseUrl;return"string"!=typeof t||nt(t)?"":t}function na(e){return(null==e?void 0:e.provider.api)==="google"||(null==e?void 0:e.provider.api)==="google-generative-ai"?"gemini":(null==e?void 0:e.provider.api)==="anthropic"||(null==e?void 0:e.provider.api)==="anthropic-messages"?"anthropic":"openai"}function nr(e,t){let s,a;return(a=(e&&(0===(s=e.pluginName.trim().toLowerCase()).length||"model provider"===s||"模型提供商"===s)?e.provider.id:(null==e?void 0:e.pluginName)??(null==e?void 0:e.provider.id)??t??"").trim())?a.split(/[-_]/).map(e=>e?e.charAt(0).toUpperCase()+e.slice(1):e).join(" "):""}function nn(e,t){return nr(e,t).charAt(0).toUpperCase()||"P"}function ni(e,t){return"gemini"===e.config.apiFormat?"gemini":"anthropic"===e.config.apiFormat?"anthropic":na(t)}function nl(e){return(null==e?void 0:e.provider.envKey)??""}function no(e,t){let s=[null==t?void 0:t.provider.envKey,...(null==t?void 0:t.provider.envKeyAliases)??[]].filter(e=>!!e),a=e.envVars.find(e=>s.includes(e.key));return(null==a?void 0:a.maskedValue)??""}function nd(){var e,t;return(null==(t=globalThis.crypto)||null==(e=t.randomUUID)?void 0:e.call(t))??`model-${Date.now()}-${Math.random()}`}function nc(){return{clientId:nd(),id:"",name:"",tags:["default"],contextWindow:"",maxTokens:"",inputCost:"",outputCost:"",vision:!1,tools:!0,reasoning:!1}}function nm(e){var t;let s=(null==e?void 0:e.provider.models.find(e=>{var t;return null==(t=e.tags)?void 0:t.includes("default")}))??(null==e?void 0:e.provider.models[0]);return{...nc(),id:(null==s?void 0:s.id)??"",name:(null==s?void 0:s.name)??"",tags:(null==s||null==(t=s.tags)?void 0:t.length)?s.tags:["default"]}}function np(e){let t=new Map,s=new Set;return e.forEach((e,a)=>{let r=e.id.trim();if(!r)return;let n=r.toLowerCase(),i=t.get(n);void 0===i?t.set(n,a):(t.set(n,i),s.add(i),s.add(a))}),s}function nu(e){let t=Number(e);return Number.isFinite(t)&&t>0?t:void 0}function nx(e){let t=(Array.isArray(e.config.models)?e.config.models:[]).map(e=>{var t,s,a,r,n,i;if(!e||"object"!=typeof e||Array.isArray(e))return null;let l="string"==typeof e.id?e.id.trim():"";return l?{clientId:nd(),id:l,name:"string"==typeof e.name?e.name:"",tags:Array.isArray(e.tags)?e.tags.filter(e=>"string"==typeof e):[],contextWindow:"number"==typeof e.contextWindow&&Number.isFinite(e.contextWindow)?String(e.contextWindow):"",maxTokens:"number"==typeof e.maxTokens&&Number.isFinite(e.maxTokens)?String(e.maxTokens):"",inputCost:"number"==typeof(null==(t=e.cost)?void 0:t.input)?String(e.cost.input):"",outputCost:"number"==typeof(null==(s=e.cost)?void 0:s.output)?String(e.cost.output):"",vision:!!(null==(a=e.capabilities)?void 0:a.vision),tools:(null==(r=e.capabilities)?void 0:r.tools)===void 0||!!(null==(n=e.capabilities)?void 0:n.tools),reasoning:!!(null==(i=e.capabilities)?void 0:i.reasoning)}:null}).filter(e=>!!e),s=e.config.modelId??e.config.defaultModel??e.config.model;return"string"==typeof s&&s.trim()&&t.push({...nc(),id:s.trim(),tags:["default"]}),t}function ng(e){let t=[],s=new Set;for(let a of e){let e=a.id.trim();if(!e)continue;let r=e.toLowerCase();if(s.has(r))continue;s.add(r);let n=nu(a.contextWindow),i=nu(a.maxTokens),l=nu(a.inputCost),o=nu(a.outputCost);t.push({id:e,...a.name.trim()?{name:a.name.trim()}:{},...a.tags.length>0?{tags:a.tags}:{},...n?{contextWindow:n}:{},...i?{maxTokens:i}:{},...l||o?{cost:{...l?{input:l}:{},...o?{output:o}:{}}}:{},capabilities:{vision:a.vision,tools:a.tools,reasoning:a.reasoning}})}return t}var ny=s(82532),nh=s(57839);function nb(e){return[...new Set(e)].sort((e,t)=>"default"===e?-1:"default"===t?1:e.localeCompare(t))}function nf(e){let{groups:t,activeGroup:s,onSelect:r,onCreate:n,onDelete:i}=e,{t:o}=(0,m.Bd)(),[d,c]=(0,l.useState)(!1),[p,u]=(0,l.useState)(""),[x,g]=(0,l.useState)(!1),[y,h]=(0,l.useState)(null),b=async()=>{let e=p.trim();if(e&&!x){g(!0);try{await n(e),u(""),c(!1)}finally{g(!1)}}},f=async e=>{h(null),await i(e)};return(0,a.jsxs)("div",{className:"flex items-center gap-2 overflow-x-auto",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 min-w-0 flex-1 flex-wrap",children:[t.map(e=>{let t=e===s,n="default"!==e;return(0,a.jsxs)("div",{className:"relative group/tab flex items-center",children:[(0,a.jsx)("button",{type:"button",onClick:()=>r(e),className:t$("flex items-center rounded-lg px-3 py-1.5 text-sm font-medium transition-all",t?"bg-primary/15 text-primary":"bg-bg-secondary text-text-secondary hover:bg-bg-tertiary hover:text-text-primary",n&&t&&"pr-7",n&&!t&&"group-hover/tab:pr-7"),children:e}),n&&(0,a.jsx)("button",{type:"button",title:o("secrets.deleteGroup"),onClick:t=>{t.stopPropagation(),h(e)},className:t$("absolute right-1.5 flex h-4 w-4 items-center justify-center rounded-full text-text-muted transition-all hover:bg-danger/15 hover:text-danger",t?"opacity-100":"opacity-0 group-hover/tab:opacity-100"),children:(0,a.jsx)(ny.A,{size:10})})]},e)}),d?(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,a.jsx)(e_,{type:"text",value:p,onChange:e=>u(e.target.value),onKeyDown:e=>{"Enter"===e.key&&b(),"Escape"===e.key&&(c(!1),u(""))},placeholder:o("secrets.groupNamePlaceholder"),disabled:x,autoFocus:!0,className:"h-8 w-36 text-sm"}),(0,a.jsx)(L,{type:"button",variant:"primary",size:"xs",onClick:()=>void b(),disabled:!p.trim()||x,children:x?(0,a.jsx)(tL.A,{size:11,className:"animate-spin"}):o("common.add")}),(0,a.jsx)(L,{type:"button",variant:"ghost",size:"xs",onClick:()=>{c(!1),u("")},disabled:x,children:(0,a.jsx)(ny.A,{size:11})})]}):(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"xs",className:"shrink-0 gap-1.5 text-text-muted hover:text-text-primary",onClick:()=>c(!0),title:o("secrets.createGroup"),children:[(0,a.jsx)(nh.A,{size:13}),(0,a.jsx)("span",{className:"hidden sm:inline",children:o("secrets.createGroup")})]})]}),(0,a.jsx)(U,{open:null!==y,onOpenChange:e=>!e&&h(null),children:(0,a.jsxs)(M,{children:[(0,a.jsxs)(V,{children:[(0,a.jsx)(B,{children:o("secrets.deleteGroupTitle")}),(0,a.jsx)(K,{children:o("secrets.deleteGroupDescription",{group:y??""})})]}),(0,a.jsxs)(q,{children:[(0,a.jsx)(W,{children:o("common.cancel")}),(0,a.jsx)(H,{className:"bg-danger text-white hover:bg-danger/90",onClick:()=>y&&void f(y),children:o("common.delete")})]})]})})]})}var nv=s(47912),nj=s(37525),nN=s(50512),nk=s(40938);function nw(e){return function(){return(0,a.jsx)(tH,{children:(0,a.jsx)(e,{})})}}let nC=(0,f.gI)({component:()=>(0,a.jsx)(s_,{children:(0,a.jsx)(v.s,{})})}),nS=(0,f.un)({getParentRoute:()=>nC,path:"/",beforeLoad:()=>{throw(0,j.V2)({to:"/store"})}}),nA=(0,f.un)({getParentRoute:()=>nC,path:"/store",component:nw(function(){let{t:e,i18n:t}=(0,m.Bd)(),s=sx(),[r,n]=(0,l.useState)(""),i=aP(r),{data:o,isLoading:d,isError:c}=(0,t2.I)({queryKey:["community-catalog",t.language],queryFn:()=>s.community.catalog(t.language)}),p=r2(e("store.typewriterPhrases",{returnObjects:!0})),u=(null==o?void 0:o.templates)??[],x=(null==o?void 0:o.categories)??[],g=(0,l.useMemo)(()=>Object.fromEntries(x.map(e=>[e.id,e.label])),[x]),y=(0,l.useMemo)(()=>{let e=u;if(i){let t=i.toLowerCase();e=e.filter(e=>{let s=g[e.category]??e.category;return e.name.toLowerCase().includes(t)||e.title.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||s.toLowerCase().includes(t)||e.features.some(e=>e.toLowerCase().includes(t))||e.highlights.some(e=>e.toLowerCase().includes(t))})}return[...e].sort((e,t)=>Number(t.featured)-Number(e.featured)||t.popularity-e.popularity||e.title.localeCompare(t.title)||e.name.localeCompare(t.name))},[g,i,u]);return(0,a.jsxs)(ar,{breadcrumb:[],title:e("store.title"),description:void 0,headerContent:(0,a.jsx)(e2,{value:r,onChange:n,placeholder:p||e("store.searchPlaceholder")}),bodyClassName:"space-y-4",children:[c&&(0,a.jsxs)(eT,{className:"flex items-center gap-3 px-5 py-4 text-sm",children:[(0,a.jsx)(nj.A,{size:16,className:"shrink-0 text-warning"}),(0,a.jsx)("span",{className:"text-text-secondary",children:e("store.communityUnavailable")}),(0,a.jsx)(L,{variant:"secondary",size:"sm",className:"ml-auto shrink-0",children:e("community.configure")})]}),r.trim()&&(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:[e("store.matchingTemplates",{count:y.length}),e("store.matchingQuery",{query:i})]}),(0,a.jsx)(L,{type:"button",variant:"secondary",size:"sm",onClick:()=>n(""),children:e("store.clearFilters")})]}),d&&(0,a.jsx)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:Array.from({length:6}).map((e,t)=>(0,a.jsx)("div",{className:"h-[240px] rounded-3xl border border-border-subtle bg-bg-secondary/60 animate-pulse"},`store-skeleton-${t}`))}),!d&&0===y.length&&(0,a.jsx)(s1,{icon:nN.A,title:e("store.noTemplatesFound"),description:i?e("store.noTemplatesMatch",{query:i}):e("store.noTemplatesInCategory"),action:(0,a.jsx)(L,{type:"button",variant:"primary",size:"sm",onClick:()=>n(""),children:e("store.clearFilters")})}),!d&&y.length>0&&(0,a.jsx)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:y.map(t=>(0,a.jsx)(r1,{template:t,categoryLabel:g[t.category]??t.category,difficultyLabel:e(`store.difficulties.${t.difficulty}`),title:t.title||t.name,summary:t.description||t.overview[0],detailHref:`/store/${encodeURIComponent(t.name)}`,primaryAction:{href:`/store/${encodeURIComponent(t.name)}/deploy`,label:e("store.deployTemplate"),icon:(0,a.jsx)(sZ.A,{size:14}),variant:"primary"},secondaryAction:{href:`/store/${encodeURIComponent(t.name)}`,label:e("store.viewTemplate"),icon:(0,a.jsx)(aC.A,{size:14}),variant:"secondary"},metrics:[{icon:(0,a.jsx)(aU.A,{size:11,className:"text-primary"}),value:t.agentCount,label:e("store.agentCount",{count:t.agentCount})},{icon:(0,a.jsx)(nk.A,{size:11,className:"text-warning"}),value:`${t.popularity}%`,label:e("store.popularity")}]},t.name))})]})})}),nT=(0,f.un)({getParentRoute:()=>nC,path:"/store/$name",component:nw(function(){let e=sx(),{t,i18n:s}=(0,m.Bd)(),{name:r}=(0,sF.g)({strict:!1}),[i,o]=(0,l.useState)("agents"),d=sg(),c=(0,sR.Z)(),p=(0,n.jE)(),u=(0,t5.n)({mutationFn:()=>e.myTemplates.fork(r),onSuccess:e=>{p.invalidateQueries({queryKey:["my-templates"]}),d.success(`${t("storeDetail.forked")} "${e.name}"`),c({to:"/my-templates/$name",params:{name:e.name}})},onError:()=>d.error(t("storeDetail.failedToFork"))}),{data:x,isLoading:g}=(0,t2.I)({queryKey:["template-detail",r,s.language],queryFn:()=>e.templates.detail(r,s.language)}),{data:y,isLoading:h}=(0,t2.I)({queryKey:["template-config",r],queryFn:()=>e.templates.get(r)}),b=null==x?void 0:x.template,f=rM(y),v=[{id:"agents",label:t("storeDetail.agents"),count:f.length,icon:(0,a.jsx)(aU.A,{size:13})},{id:"config",label:t("storeDetail.configuration"),icon:(0,a.jsx)(nv.A,{size:13})}];if(!b&&!g)return(0,a.jsx)(s1,{title:t("storeDetail.templateNotFound"),description:t("storeDetail.templateNotFoundDesc"),cardVariant:"glass"});let j=(null==b?void 0:b.title)||r;return(0,a.jsx)(rW,{breadcrumbItems:[{label:t("store.title"),to:"/store"},{label:j}],heroIcon:(0,a.jsx)("span",{className:"text-5xl",children:(null==b?void 0:b.emoji)??"\uD83D\uDCE6"}),title:j,description:(null==b?void 0:b.description)??t("common.loading"),actions:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{asChild:!0,variant:"primary",children:(0,a.jsxs)(tJ.N_,{to:"/store/$name/deploy",params:{name:r},children:[(0,a.jsx)(sZ.A,{size:14}),(0,a.jsx)("span",{children:t("store.deployTemplate")})]})}),(0,a.jsxs)(L,{type:"button",variant:"secondary",onClick:()=>u.mutate(),disabled:u.isPending,children:[(0,a.jsx)(rz.A,{size:14}),(0,a.jsx)("span",{children:u.isPending?t("common.loading"):t("store.forkTemplate")})]})]}),sidebar:b?(0,a.jsxs)(rH,{title:t("templateDetail.quickInfo"),items:[{icon:(0,a.jsx)(aU.A,{size:12}),label:t("deploy.agentsLabel"),value:(0,a.jsx)("span",{className:"font-bold",children:b.agentCount})},{icon:(0,a.jsx)(sX.A,{size:12}),label:t("deploy.namespaceLabel"),value:(0,a.jsx)("code",{className:"text-sm text-text-primary",children:b.namespace})},{icon:(0,a.jsx)(aO.A,{size:12}),label:t("deploy.deployTimeLabel"),value:b.estimatedDeployTime},{icon:(0,a.jsx)(a$.A,{size:12}),label:t("storeDetail.requiredEnvVars"),value:(0,a.jsx)("span",{className:"font-bold",children:b.requiredEnvVars.length})}],children:[b.requiredEnvVars.length>0&&(0,a.jsxs)("div",{className:"space-y-2 mt-3 border-t border-border-subtle pt-3",children:[(0,a.jsx)("div",{className:"text-[11px] font-semibold text-text-muted",children:t("storeDetail.requiredEnvVars")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:b.requiredEnvVars.map(e=>(0,a.jsx)("code",{className:"rounded-full border border-accent/25 bg-accent/10 px-2.5 py-1.5 text-[11px] text-text-primary",children:e},e))})]}),(0,a.jsxs)("div",{className:"space-y-2 border-t border-border-subtle pt-3",children:[(0,a.jsx)("div",{className:"text-[11px] font-semibold text-text-muted",children:t("storeDetail.cliQuickDeploy")}),(0,a.jsxs)("code",{className:"block break-all rounded-2xl border border-border-subtle bg-bg-tertiary px-4 py-3 text-xs text-text-primary",children:["shadowob-cloud deploy --template ",r]})]})]}):null,tabs:v,activeTab:i,onTabChange:o,children:(0,a.jsxs)(eS,{className:"rounded-3xl p-6",children:["agents"===i&&(0,a.jsx)(rB,{agents:f,emptyTitle:t("storeDetail.agentDetailsUnavailable"),emptyDescription:t("storeDetail.deployToSeeConfig"),introText:t("storeDetail.includesAgents",{count:f.length})}),"config"===i&&(0,a.jsx)(rK,{templateData:y,description:t("storeDetail.fullTemplateConfig"),title:h?t("common.loading"):t("storeDetail.templateConfiguration")})]})})})}),nD=(0,f.un)({getParentRoute:()=>nC,path:"/store/$name/deploy",component:nw(function(){let{t:e}=(0,m.Bd)(),{name:t}=(0,sF.g)({strict:!1}),[s,r]=(0,l.useState)(0),n=[{id:"overview",label:e("deploy.stepTemplateLabel"),description:e("deploy.stepTemplateDescription")},{id:"configure",label:e("deploy.stepConfigureLabel"),description:e("deploy.stepConfigureDescription")},{id:"deploy",label:e("deploy.stepDeployLabel"),description:e("deploy.stepDeployDescription")}],[i,o]=(0,l.useState)({namespace:"",envVars:{},envPersistence:a2,modelProviderMode:"official"}),d=0===s||1===s?e("common.continue"):null,c=()=>{s>0&&r(s-1)};return(0,a.jsxs)(ar,{breadcrumb:[{label:e("store.title"),to:"/store"},{label:t,to:`/store/${t}`},{label:e("common.deploy")}],breadcrumbPosition:"inside",title:t,bodyClassName:"space-y-4",headerContent:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:gap-4",children:[(0,a.jsx)("div",{className:"grid flex-1 min-w-0 grid-cols-1 sm:grid-cols-3 gap-2",children:n.map((e,t)=>{let n=t<s?"completed":t===s?"active":"upcoming",i=t<=s;return(0,a.jsxs)("button",{type:"button",disabled:!i,onClick:()=>i&&r(t),className:t$("group relative overflow-hidden rounded-xl px-3 py-2.5 text-left transition-all",i?"cursor-pointer hover:-translate-y-[1px]":"cursor-default","active"===n&&"bg-primary/12 shadow-[0_0_0_1px_rgba(0,243,255,0.06)_inset]","completed"===n&&"bg-success/8 hover:bg-success/12","upcoming"===n&&"bg-bg-secondary/45 text-text-muted"),children:[(0,a.jsx)("span",{"aria-hidden":!0,className:t$("absolute inset-x-0 top-0 h-[2px] opacity-0 transition-opacity","active"===n&&"bg-primary/60 opacity-100","completed"===n&&"bg-success/50 opacity-100")}),(0,a.jsxs)("div",{className:"relative flex items-center gap-2.5 min-w-0",children:[(0,a.jsx)("div",{className:t$("flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-[11px] font-semibold transition-all","active"===n&&"bg-primary text-bg-base shadow-[0_6px_18px_-10px_rgba(0,243,255,0.45)]","completed"===n&&"bg-success/20 text-success","upcoming"===n&&"bg-bg-secondary text-text-muted"),children:"completed"===n?(0,a.jsx)(se.A,{size:13}):t+1}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("span",{className:t$("text-xs md:text-sm font-medium block truncate transition-colors","active"===n&&"text-text-primary","completed"===n&&"text-text-secondary group-hover:text-text-primary","upcoming"===n&&"text-text-muted"),children:e.label}),(0,a.jsx)("span",{className:t$("hidden md:block text-[11px] truncate","active"===n?"text-text-secondary":"text-text-muted"),children:e.description})]})]})]},e.id)})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0 pt-1",children:[s>0&&s<2&&(0,a.jsxs)(L,{type:"button",onClick:c,variant:"ghost",size:"sm",children:[(0,a.jsx)(aB.A,{size:14}),e("common.back")]}),d&&0===s&&(0,a.jsxs)(L,{type:"button",onClick:()=>r(1),variant:"primary",size:"sm",children:[d,(0,a.jsx)(aK.A,{size:14})]}),d&&1===s&&(0,a.jsxs)(L,{type:"submit",form:"wizard-configure-form",variant:"primary",size:"sm",children:[d,(0,a.jsx)(aK.A,{size:14})]})]})]}),children:[0===s&&(0,a.jsx)(a4,{name:t}),1===s&&(0,a.jsx)(a9,{name:t,config:i,onChange:o,onBack:c,onNext:()=>r(2)}),2===s&&(0,a.jsx)(a7,{name:t,config:i,onBack:()=>r(1)})]})})}),nP=(0,f.un)({getParentRoute:()=>nC,path:"/deployments",component:nw(function(){let e=sx(),{t,i18n:s}=(0,m.Bd)(),r=(0,sR.Z)(),i=(0,n.jE)(),o=sg(),d=sC(e=>e.addActivity),[c,p]=(0,l.useState)(""),u=aP(c),[x,g]=(0,l.useState)(null),[y,h]=(0,l.useState)(null),[b,f]=(0,l.useState)("infrastructure"),{data:v,isLoading:j,refetch:N}=(0,t2.I)({queryKey:["deployments"],queryFn:e.deployments.list,refetchInterval:e=>(e.state.data??[]).some(e=>"resuming"===e.runtimeState||"paused"!==e.runtimeState&&(e.ready&&!e.ready.startsWith("1/")||"0"===e.available))?3e3:3e4,staleTime:2e3}),{data:k}=(0,t2.I)({queryKey:["namespaces"],queryFn:e.deployments.namespaces,staleTime:3e4}),{data:w,isLoading:C}=(0,t2.I)({queryKey:["deploy-tasks"],queryFn:e.deployTasks.list,refetchInterval:5e3}),{data:S}=(0,t2.I)({queryKey:["cost-overview"],queryFn:e.deployments.costs,refetchInterval:3e4,staleTime:1e4}),A=(null==w?void 0:w.tasks)??[],T=(0,t5.n)({mutationFn:t=>e.destroy({namespace:t}),onSuccess:async(e,s)=>{o.success(t("deployments.destroyQueued",{namespace:s})),d({type:"destroy",title:t("deploymentDetail.destroyQueuedActivityTitle",{namespace:s}),namespace:s}),g(null),i.invalidateQueries({queryKey:["deployments"]}),i.invalidateQueries({queryKey:["deploy-tasks"]}),e.taskId&&r({to:"/deploy-tasks/$taskId",params:{taskId:String(e.taskId)}})},onError:()=>{g(null),o.error(t("deployments.destroyNamespaceFailed"))}}),D=(0,t5.n)({mutationFn:t=>e.rollback({namespace:t}),onSuccess:()=>{h(null),i.invalidateQueries({queryKey:["deploy-tasks"]}),i.invalidateQueries({queryKey:["deployments"]}),o.success(t("deployments.rollbackInitiated"))},onError:()=>{o.error(t("deployments.rollbackFailed"))}}),P=async t=>{let s=await e.deployTasks.redeployToTaskId(t);s&&r({to:"/deploy-tasks/$taskId",params:{taskId:String(s)}})},_=(0,l.useMemo)(()=>{let e=new Map;for(let t of A){let s=t.task.namespace,a=e.get(s),r=Date.parse(t.task.createdAt??t.task.updatedAt??"")||0,n=Date.parse((null==a?void 0:a.task.createdAt)??(null==a?void 0:a.task.updatedAt)??"")||0;(!a||r>=n)&&e.set(s,t)}return e},[A]),R=(0,l.useMemo)(()=>{let e=Object.entries(function(e,t){let s={};for(let a of e){let e=t(a);s[e]||(s[e]=[]),s[e].push(a)}return s}(v??[],e=>e.namespace)).map(e=>{let[t,s]=e;return{namespace:t,deployments:s,readyCount:s.filter(e=>tM(e.ready)).length,totalCount:s.length,pausedCount:s.filter(e=>"paused"===e.runtimeState).length,resumingCount:s.filter(e=>"resuming"===e.runtimeState).length,sandboxCount:s.filter(e=>"agent-sandbox"===e.workloadKind).length,latestTask:_.get(t)}});if(u){let t=u.toLowerCase();e=e.filter(e=>e.namespace.toLowerCase().includes(t)||e.deployments.some(e=>e.name.toLowerCase().includes(t)))}return e.sort((e,t)=>e.namespace.localeCompare(t.namespace))},[v,u,_]),F=v??[],z=F.length,I=F.filter(e=>tM(e.ready)).length,E=F.filter(e=>"paused"===e.runtimeState).length,U=R.length,O=A.filter(e=>e.active||"running"===e.task.status).length,$=j&&C,M=[{id:"infrastructure",label:t("deployments.infrastructure"),icon:(0,a.jsx)(tZ.A,{size:13}),count:z},{id:"tasks",label:t("deployments.taskHistory"),icon:(0,a.jsx)(aS.A,{size:13}),count:A.length}];return(0,a.jsxs)(ar,{breadcrumb:[],title:t("deployments.title"),actions:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>N(),children:[(0,a.jsx)(tE.A,{size:12}),t("common.refresh")]}),(0,a.jsx)(L,{asChild:!0,variant:"primary",size:"sm",children:(0,a.jsxs)(tJ.N_,{to:"/store",children:[(0,a.jsx)(sZ.A,{size:12}),t("common.deployNew")]})})]}),headerContent:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(an,{className:"mb-4 grid-cols-2 md:grid-cols-3 xl:grid-cols-6",children:[(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("clusters.totalDeployments"),value:z,icon:(0,a.jsx)(sz.A,{size:13}),iconClassName:"text-text-muted",valueClassName:"text-text-muted"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("clusters.ready"),value:I,icon:(0,a.jsx)(sY.A,{size:13}),iconClassName:"text-success",valueClassName:"text-success"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("deployments.pausedDeployments"),value:E,icon:(0,a.jsx)(s$.A,{size:13}),iconClassName:E>0?"text-warning":"text-text-muted",valueClassName:E>0?"text-warning":"text-text-muted"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("deployments.namespaces"),value:U,icon:(0,a.jsx)(sX.A,{size:13}),iconClassName:"text-primary",valueClassName:"text-primary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("deployTask.runningTasks"),value:O,icon:(0,a.jsx)(sG.A,{size:13}),iconClassName:O>0?"text-primary":"text-text-muted",valueClassName:O>0?"text-primary":"text-text-muted"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("deployments.totalCost"),value:ap(S??{},{locale:s.language,shrimpUnitLabel:t("deploy.shrimpCoins")}),icon:(0,a.jsx)(sQ.A,{size:13}),iconClassName:"text-accent",valueClassName:"text-accent"})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)(tT,{value:b,onChange:f,children:(0,a.jsx)(s2,{tabs:M,activeId:b,onSelect:f})}),"infrastructure"===b&&(0,a.jsx)(e2,{value:c,onChange:p,placeholder:t("common.search")+"..."})]})]}),children:["infrastructure"===b&&(0,a.jsxs)(a.Fragment,{children:[$&&(0,a.jsx)(eS,{className:"rounded-2xl p-4 md:p-5",children:(0,a.jsx)(tB,{rows:2})}),!$&&0===R.length&&(0,a.jsx)(s1,{icon:tZ.A,title:t("clusters.noClustersFound"),description:u?t("clusters.noNamespacesMatch"):t("clusters.noDeploymentsYet"),cardVariant:"glassPanel",action:(0,a.jsx)(L,{asChild:!0,variant:"primary",size:"sm",children:(0,a.jsxs)(tJ.N_,{to:"/store",children:[(0,a.jsx)(sZ.A,{size:14}),t("clusters.browseAgentStore")]})})}),!$&&R.length>0&&(0,a.jsx)("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2 2xl:grid-cols-3",children:R.map(e=>{var t;return(0,a.jsx)(aF,{group:e,isDestroying:T.isPending&&x===e.namespace,isDiscovered:(null==k||null==(t=k.discovered)?void 0:t.includes(e.namespace))??!1,onDestroy:g,onRedeploy:P},e.namespace)})})]}),"tasks"===b&&(0,a.jsxs)(a.Fragment,{children:[C&&(0,a.jsx)(eS,{className:"rounded-2xl p-4 md:p-5",children:(0,a.jsx)(tB,{inline:!0})}),!C&&(0,a.jsx)(az,{tasks:A})]}),(0,a.jsx)(s0,{open:!!x,onOpenChange:e=>{e||g(null)},title:t("clusters.destroyNamespace"),description:x?t("clusters.destroyWarning",{namespace:x}):"",confirmText:T.isPending?t("clusters.destroying"):t("clusters.destroy"),cancelText:t("common.cancel"),loading:T.isPending,onConfirm:()=>{x&&T.mutate(x)}}),(0,a.jsx)(s0,{open:!!y,onOpenChange:e=>{e||h(null)},title:t("deployTask.rollback"),description:y?t("deployments.rollbackWarning",{namespace:y}):"",confirmText:t("deployTask.rollback"),cancelText:t("common.cancel"),loading:D.isPending,onConfirm:()=>{y&&D.mutate(y)}})]})})}),n_=(0,f.un)({getParentRoute:()=>nC,path:"/clusters",beforeLoad:()=>{throw(0,j.V2)({to:"/deployments"})}}),nR=(0,f.un)({getParentRoute:()=>nC,path:"/deployments/$namespace",component:nw(function(){var e,t;let s=sx(),{t:r,i18n:i}=(0,m.Bd)(),{namespace:o}=(0,sF.g)({strict:!1}),d=(0,sR.Z)(),c=(0,n.jE)(),p=sg(),u=sC(e=>e.addActivity),[x,g]=(0,l.useState)("agents"),[y,h]=(0,l.useState)(null),[b,f]=(0,l.useState)(!1),{data:v,isLoading:j,refetch:N}=(0,t2.I)({queryKey:["deployments"],queryFn:s.deployments.list,refetchInterval:1e4,staleTime:5e3}),k=(0,l.useMemo)(()=>(v??[]).filter(e=>e.namespace===o).sort((e,t)=>e.name.localeCompare(t.name)),[v,o]),w=(0,l.useMemo)(()=>y?k.find(e=>e.name===y)??null:null,[k,y]);(0,l.useEffect)(()=>{0===k.length?h(null):h(e=>{var t;return e&&k.some(t=>t.name===e)?e:(null==(t=k[0])?void 0:t.name)??null})},[k]);let C=(0,t2.I)({queryKey:["pods",o,y],queryFn:()=>s.deployments.pods(o,y??""),enabled:!!y,refetchInterval:1e4}),S=(0,t2.I)({queryKey:["namespace-costs",o],queryFn:()=>s.deployments.namespaceCosts(o),refetchInterval:3e4,staleTime:1e4}),A=(0,t2.I)({queryKey:["deploy-tasks"],queryFn:s.deployTasks.list,refetchInterval:1e4,staleTime:5e3}),T=(0,l.useMemo)(()=>{var e;return((null==(e=A.data)?void 0:e.tasks)??[]).filter(e=>e.task.namespace===o).sort((e,t)=>{let s=Date.parse(e.task.createdAt??e.task.updatedAt??"")||0;return(Date.parse(t.task.createdAt??t.task.updatedAt??"")||0)-s})[0]},[null==(e=A.data)?void 0:e.tasks,o]),D=(0,t5.n)({mutationFn:async()=>T?s.deployTasks.redeployToTaskId(T.task.id):null,onSuccess:e=>{e?(c.invalidateQueries({queryKey:["deploy-tasks"]}),c.invalidateQueries({queryKey:["deployments"]}),d({to:"/deploy-tasks/$taskId",params:{taskId:String(e)}})):p.error(r("deployments.noTaskToRedeploy"))},onError:()=>p.error(r("deployments.redeployFailed"))}),P=(0,t5.n)({mutationFn:()=>s.destroy({namespace:o}),onSuccess:e=>{c.invalidateQueries({queryKey:["deployments"]}),c.invalidateQueries({queryKey:["deploy-tasks"]}),p.success(r("deployments.destroyQueued",{namespace:o})),u({type:"destroy",title:r("deploymentDetail.destroyQueuedActivityTitle",{namespace:o}),namespace:o}),e.taskId?d({to:"/deploy-tasks/$taskId",params:{taskId:String(e.taskId)}}):d({to:"/deployments"})},onError:()=>p.error(r("deployments.destroyNamespaceFailed"))}),_=(0,t5.n)({mutationFn:async()=>{if(!y)throw Error("No selected agent");return s.deployments.pause(o,y)},onSuccess:()=>{c.invalidateQueries({queryKey:["deployments"]}),c.invalidateQueries({queryKey:["pods",o,y]}),p.success(r("deployments.pauseQueued",{agent:y})),u({type:"scale",title:r("deployments.pauseQueued",{agent:y}),namespace:o})},onError:e=>p.error(`${r("deployments.pauseFailed")}: ${ag(e)}`)}),R=(0,t5.n)({mutationFn:async()=>{if(!y)throw Error("No selected agent");return s.deployments.resume(o,y)},onSuccess:()=>{c.invalidateQueries({queryKey:["deployments"]}),c.invalidateQueries({queryKey:["pods",o,y]}),p.success(r("deployments.resumeQueued",{agent:y})),u({type:"scale",title:r("deployments.resumeQueued",{agent:y}),namespace:o})},onError:e=>p.error(`${r("deployments.resumeFailed")}: ${ag(e)}`)}),F=(0,t5.n)({mutationFn:async()=>{if(!y)throw Error("No selected agent");return s.deployments.createBackup(o,y)},onSuccess:()=>{p.success(r("deployments.backupCreated")),u({type:"scale",title:r("deployments.backupCreated"),namespace:o})},onError:e=>p.error(`${r("deployments.backupFailed")}: ${ag(e)}`),onSettled:()=>{c.invalidateQueries({queryKey:["deployment-backups",o,y]})}}),z=k.filter(e=>tM(e.ready)).length,I=k.filter(e=>"paused"===e.runtimeState).length,E=C.data??[],U=(null==w?void 0:w.runtimeState)??"unknown",O=(null==w?void 0:w.workloadKind)==="agent-sandbox",$=(null==w?void 0:w.status)?"deployed"===w.status||"paused"===w.status:"running"===U||"paused"===U,M=y?R.isPending?r("deployments.runtimeActionInProgress"):void 0:r("deployments.noAgentSelected"),V=y?_.isPending?r("deployments.runtimeActionInProgress"):"resuming"===U?r("deployments.pauseUnavailableResuming"):void 0:r("deployments.noAgentSelected"),q=y?F.isPending?r("deployments.runtimeActionInProgress"):$?void 0:r("deployments.backupUnavailableRuntime"):r("deployments.noAgentSelected"),B=[{id:"agents",label:r("deployments.agents"),icon:(0,a.jsx)(sz.A,{size:13}),count:k.length},{id:"logs",label:r("deployments.tabLogs"),icon:(0,a.jsx)(sO.A,{size:13})},{id:"env",label:r("deployments.tabEnv"),icon:(0,a.jsx)(sB.A,{size:13})},{id:"backups",label:r("deployments.tabBackups"),icon:(0,a.jsx)(sE.A,{size:13})},{id:"cost",label:r("deployments.costTab"),icon:(0,a.jsx)(sQ.A,{size:13})},{id:"info",label:r("deployments.tabInfo"),icon:(0,a.jsx)(sn.A,{size:13})}];return j||0!==k.length?(0,a.jsxs)(ar,{breadcrumb:[{label:r("deployments.title"),to:"/deployments"},{label:o}],breadcrumbPosition:"inside",title:o,actions:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[O&&"paused"===U&&(0,a.jsxs)(L,{type:"button",onClick:()=>R.mutate(),title:M,disabled:!!M,variant:"glass",size:"sm",children:[R.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sI.A,{size:12}),r("deployments.resumeAgent")]}),O&&"paused"!==U&&(0,a.jsxs)(L,{type:"button",onClick:()=>_.mutate(),title:V,disabled:!!V,variant:"glass",size:"sm",children:[_.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(s$.A,{size:12}),r("deployments.pauseAgent")]}),O&&(0,a.jsxs)(L,{type:"button",onClick:()=>F.mutate(),title:q,disabled:!!q,variant:"glass",size:"sm",children:[F.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sU.A,{size:12}),r("deployments.backupAgent")]}),(0,a.jsxs)(L,{type:"button",onClick:()=>{N(),c.invalidateQueries({queryKey:["namespace-costs",o]})},variant:"ghost",size:"sm",children:[(0,a.jsx)(tE.A,{size:12}),r("common.refresh")]}),(0,a.jsxs)(L,{type:"button",onClick:()=>D.mutate(),disabled:!T||D.isPending,variant:"primary",size:"sm",children:[D.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sZ.A,{size:12}),r("deployTask.redeploy")]}),(0,a.jsxs)(L,{type:"button",onClick:()=>f(!0),variant:"ghost",size:"sm",children:[(0,a.jsx)(sJ.A,{size:12}),r("clusters.destroy")]})]}),headerContent:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(an,{className:"mb-4 grid-cols-1 md:mb-5 sm:grid-cols-2 xl:grid-cols-5",children:[(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.agents"),value:k.length,icon:(0,a.jsx)(sz.A,{size:13}),iconClassName:"text-text-primary",valueClassName:"text-text-primary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.readyAgents"),value:z,icon:(0,a.jsx)(sY.A,{size:13}),iconClassName:"text-success",valueClassName:"text-success"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.pausedAgents"),value:I,icon:(0,a.jsx)(s$.A,{size:13}),iconClassName:"text-warning",valueClassName:"text-warning"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.selectedPods"),value:E.length,icon:(0,a.jsx)(sr.A,{size:13}),iconClassName:"text-primary",valueClassName:"text-primary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:r("deployments.tokenCost"),value:am((null==(t=S.data)?void 0:t.totalUsd)??null,i.language),icon:(0,a.jsx)(sQ.A,{size:13}),iconClassName:"text-accent",valueClassName:"text-accent"})})]}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)(tT,{value:x,onChange:g,children:(0,a.jsx)(s2,{tabs:B,activeId:x,onSelect:g})})})]}),narrow:!0,children:[(0,a.jsx)(eS,{className:"rounded-2xl p-4 md:p-5 lg:p-6",children:(0,a.jsx)("div",{className:"space-y-6",children:(0,a.jsxs)("div",{className:"min-h-[38vh]",children:["agents"===x&&(0,a.jsx)(ah,{namespace:o,agent:y,enabled:!j,deployment:w,onResume:()=>R.mutate(),resumePending:R.isPending,resumeDisabledReason:M}),"logs"===x&&(0,a.jsx)(af,{namespace:o,agent:y,deployment:w,deployments:k,onSelectAgent:h,onResume:()=>R.mutate(),resumePending:R.isPending,resumeDisabledReason:M}),"env"===x&&(0,a.jsx)(aj,{namespace:o}),"backups"===x&&(0,a.jsx)(ab,{namespace:o,agent:y,deployment:w}),"cost"===x&&(0,a.jsx)(aN,{namespace:o}),"info"===x&&(0,a.jsx)(aw,{namespace:o,agent:y,deployment:w,deployments:k,pods:C.data,latestTaskId:(null==T?void 0:T.task.id)??null})]})})}),(0,a.jsx)(s0,{open:b,onOpenChange:f,title:r("clusters.destroyNamespace"),description:r("clusters.destroyWarning",{namespace:o}),confirmText:P.isPending?r("clusters.destroying"):r("clusters.destroy"),cancelText:r("common.cancel"),loading:P.isPending,onConfirm:()=>P.mutate()})]}):(0,a.jsx)(ar,{breadcrumb:[{label:r("deployments.title"),to:"/deployments"},{label:o}],breadcrumbPosition:"inside",title:o,actions:(0,a.jsx)(L,{asChild:!0,variant:"primary",size:"sm",children:(0,a.jsxs)(tJ.N_,{to:"/store",children:[(0,a.jsx)(sZ.A,{size:14}),r("clusters.browseAgentStore")]})}),narrow:!0,children:(0,a.jsx)(s1,{icon:sX.A,cardVariant:"glass",title:r("deployments.noDeploymentsInNamespace"),description:r("deployments.noDeploymentsInNamespaceDescription",{namespace:o}),action:null})})})}),nF=(0,f.un)({getParentRoute:()=>nC,path:"/deployments/$namespace/$id",beforeLoad:e=>{let{params:t}=e;throw(0,j.V2)({to:"/deployments/$namespace",params:{namespace:t.namespace}})}}),nz=(0,f.un)({getParentRoute:()=>nC,path:"/deploy-tasks",beforeLoad:()=>{throw(0,j.V2)({to:"/deployments"})}}),nI=(0,f.un)({getParentRoute:()=>nC,path:"/deploy-tasks/$taskId",component:nw(function(){var e,t,s;let r=sx(),{t:i}=(0,m.Bd)(),o=sg(),d=(0,n.jE)(),c=(0,sF.g)({strict:!1}).taskId,p=(0,l.useRef)(null),[u,x]=(0,l.useState)(!1),g=(0,l.useRef)(!0),[y,h]=(0,l.useState)(!1),{lines:b,entries:f,status:v,error:j,connect:N}=ac({maxLines:4e3}),{data:k,isLoading:w,error:C,refetch:S}=(0,t2.I)({queryKey:["deploy-task",c],queryFn:()=>r.deployTasks.get(c),enabled:c.trim().length>0,refetchInterval:2e3}),A=null==k?void 0:k.task,T="string"==typeof(e=null==A?void 0:A.status)&&aE.has(e),D=(0,l.useMemo)(()=>{let e=null==k?void 0:k.url;return e?new URL(e,window.location.origin).toString():""},[null==k?void 0:k.url]);(0,l.useEffect)(()=>{0!==c.trim().length&&N(r.deployTasks.streamUrl(c))},[c,N]),(0,l.useEffect)(()=>{T||x(!1)},[T]),(0,l.useEffect)(()=>{g.current=!0},[c]),(0,l.useEffect)(()=>{("done"===v||"error"===v)&&(g.current=!0)},[v]),(0,l.useEffect)(()=>{p.current&&g.current&&(p.current.scrollTop=p.current.scrollHeight)},[b.length]);let P=(0,t5.n)({mutationFn:()=>r.deployTasks.cancel(c),onSuccess:async()=>{x(!1),o.warning(i("deployTask.cancelRequested")),await d.invalidateQueries({queryKey:["deploy-task",c]}),await d.invalidateQueries({queryKey:["deploy-tasks"]}),await d.invalidateQueries({queryKey:["deployments"]})},onError:()=>{o.error(i("deployTask.cancelFailed"))}});if(0===c.trim().length)return(0,a.jsx)("div",{className:"p-6",children:(0,a.jsx)(s1,{icon:sM.A,title:i("deployTask.taskNotFound"),description:i("deployTask.invalidTaskId")})});if(w)return(0,a.jsx)(tB,{inline:!0});if(C||!A)return(0,a.jsx)(ar,{breadcrumb:[{label:i("deployTask.title")}],breadcrumbPosition:"inside",narrow:!0,title:i("deployTask.title"),description:i("deployTask.taskNotFoundDescription"),actions:(0,a.jsx)(L,{asChild:!0,variant:"ghost",size:"sm",children:(0,a.jsxs)(tJ.N_,{to:"/store",children:[(0,a.jsx)(sX.A,{size:14}),i("deployTask.backToStore")]})}),children:(0,a.jsx)(tK,{icon:sM.A,title:i("deployTask.taskNotFound")})});let _="string"==typeof(t=A.status)&&aI.has(t),R="deployed"===A.status||"destroyed"===A.status,F="failed"===A.status,z=A.blockedBy?i(`deployTask.statuses.${A.blockedBy.status}`):"";return(0,a.jsxs)(ar,{breadcrumb:[{label:i("nav.deployments"),to:"/deployments"},{label:`#${A.id}`}],breadcrumbPosition:"inside",narrow:!0,title:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[i("deployTask.title"),(0,a.jsx)(Y,{variant:"deployed"===(s=A.status)||"destroyed"===s?"success":"failed"===s?"danger":"running"===s||"deploying"===s||"destroying"===s?"info":"pending"===s||"cancelling"===s?"warning":"neutral",size:"sm",children:i(`deployTask.statuses.${A.status}`)})]}),description:i("deployTask.description"),actions:(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)(s9,{type:"button",onClick:()=>S(),variant:"ghost",icon:(0,a.jsx)(tE.A,{size:12,className:_?"animate-spin":""}),label:i("deployTask.refresh")}),T&&(0,a.jsx)(s9,{type:"button",onClick:()=>x(!0),variant:"danger",disabled:!T||P.isPending,icon:P.isPending?(0,a.jsx)(tL.A,{size:12,className:"animate-spin"}):(0,a.jsx)(sM.A,{size:12}),label:i("deployTask.cancelTask")})]}),headerContent:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-lg border border-border-subtle bg-bg-secondary/40 px-4 py-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[_&&(0,a.jsx)(tL.A,{size:18,className:"text-primary animate-spin mt-1"}),R&&(0,a.jsx)(se.A,{size:18,className:"text-success mt-1"}),F&&(0,a.jsx)(sM.A,{size:18,className:"text-danger mt-1"}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:t$("text-sm font-medium",_&&"text-primary",R&&"text-success",F&&"text-danger"),children:[_&&("destroying"===A.status?i("deployTask.destroyRunningMessage"):i("deployTask.runningMessage")),R&&("destroyed"===A.status?i("deployTask.destroySuccessMessage"):i("deployTask.successMessage")),F&&i("deployTask.failedMessage")]}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:[_&&(A.blockedBy?i("deployTask.blockedByDescription",{id:A.blockedBy.id,status:z}):i("deployTask.runningDescription")),R&&("destroyed"===A.status?i("deployTask.destroySuccessDescription"):i("deployTask.successDescription")),F&&i("deployTask.failedDescription")]})]})]})}),A.blockedBy&&(0,a.jsx)("div",{className:"rounded-lg border border-warning/30 bg-warning/8 px-4 py-3",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-warning",children:i("deployTask.blockedBy")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:i("deployTask.blockedByDescription",{id:A.blockedBy.id,status:z})})]}),(0,a.jsx)(L,{asChild:!0,variant:"secondary",size:"sm",children:(0,a.jsxs)(tJ.N_,{to:"/deploy-tasks/$taskId",params:{taskId:String(A.blockedBy.id)},children:[(0,a.jsx)(sG.A,{size:12}),i("deployTask.openBlockingTask")]})})]})}),(0,a.jsxs)(an,{className:A.blockedBy?"lg:grid-cols-5":"lg:grid-cols-4",children:[(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.taskId"),value:`#${A.id}`,icon:(0,a.jsx)(sG.A,{size:13}),iconClassName:"text-text-primary",valueClassName:"text-text-primary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.template"),value:A.templateSlug??"—",icon:(0,a.jsx)(sX.A,{size:13}),iconClassName:"text-primary",valueClassName:"text-primary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.namespace"),value:A.namespace,icon:(0,a.jsx)(sX.A,{size:13}),iconClassName:"text-text-secondary",valueClassName:"text-text-secondary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.taskUrl"),value:D||"—",icon:(0,a.jsx)(sG.A,{size:13}),iconClassName:"text-primary",valueClassName:"text-primary break-all text-[0.85rem] leading-5"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.created"),value:tV(A.createdAt),icon:(0,a.jsx)(tL.A,{size:13}),iconClassName:"text-text-secondary",valueClassName:"text-text-secondary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.updated"),value:tV(A.updatedAt),icon:(0,a.jsx)(tL.A,{size:13}),iconClassName:"text-text-secondary",valueClassName:"text-text-secondary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.streamStatus"),value:i(`deployTask.streamStatuses.${v}`),icon:(0,a.jsx)(tL.A,{size:13}),iconClassName:"text-text-secondary",valueClassName:"text-text-secondary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.logs"),value:b.length,icon:(0,a.jsx)(sG.A,{size:13}),iconClassName:"text-success",valueClassName:"text-success"})}),A.blockedBy?(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:i("deployTask.blockedBy"),value:`#${A.blockedBy.id}`,icon:(0,a.jsx)(tL.A,{size:13}),iconClassName:"text-warning",valueClassName:"text-warning"})}):null]})]}),children:[A.error&&(0,a.jsxs)("div",{className:"rounded-lg border border-danger/25 bg-danger/8 p-4",children:[(0,a.jsx)("p",{className:"text-xs text-danger font-medium mb-1",children:i("deployTask.error")}),(0,a.jsx)("p",{className:"text-sm text-danger break-words",children:A.error})]}),j&&(0,a.jsx)(tK,{className:"mb-6",title:i("deployTask.error"),description:j}),(0,a.jsx)(s6,{headerLeft:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-text-primary",children:i("deployTask.logs")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:i("deployTask.logDescription")})]}),headerRight:(0,a.jsx)(s7,{showTimestampsToggle:!1,actions:[...b.length>0?[{id:"download",type:"button",icon:(0,a.jsx)(sU.A,{size:11}),label:i("deploy.download"),onClick:()=>{let e=new Blob([b.join("\n")],{type:"text/plain"}),t=URL.createObjectURL(e),s=document.createElement("a");s.href=t,s.download=`deploy-task-${c}-${Date.now()}.log`,s.click(),URL.revokeObjectURL(t)}}]:[]],suffix:(0,a.jsx)(Y,{variant:_?"info":R?"success":F?"danger":"neutral",size:"sm",children:_?i("deployTask.liveStreaming"):i("deployTask.logReplay")})}),footerRight:(0,a.jsx)(s7,{showTimestamps:y,onShowTimestampsChange:h,showTimestampsLabel:i("deploy.showTimestamps"),hideTimestampsLabel:i("deploy.hideTimestamps")}),lines:f,showTimestamps:y,footerLeft:(0,a.jsx)("span",{children:i("deploy.logLinesReceived",{count:b.length})}),emptyText:i("deployTask.waitingForLogs"),collapseRepeats:!0,bodyRef:p,bodyOnScroll:()=>{p.current&&(g.current=p.current.scrollHeight-p.current.scrollTop-p.current.clientHeight<64)}}),(0,a.jsx)(s0,{open:u&&T,onOpenChange:x,title:i("deployTask.cancelTask"),description:i("deployTask.cancelTaskDescription"),confirmText:i("deployTask.cancelTask"),cancelText:i("common.cancel"),loading:P.isPending,onConfirm:()=>{T&&!P.isPending&&P.mutate()}})]})})}),nE=(0,f.un)({getParentRoute:()=>nC,path:"/config",beforeLoad:()=>{throw(0,j.V2)({to:"/my-templates"})}}),nL=(0,f.un)({getParentRoute:()=>nC,path:"/validate",component:nw(function(){let{t:e}=(0,m.Bd)(),t=sg(),[s,r]=(0,l.useState)(""),[n,i]=(0,l.useState)(null),o=(0,t5.n)({mutationFn:e=>sp.validate(e),onSuccess:s=>{i(s),s.valid?t.success(e("validate.validationPassedToast",{agents:s.agents})):t.error(e("validate.validationFailedToast",{count:s.violations.length}))}}),d=async()=>{try{let s=await sp.init();r(JSON.stringify(s,null,2)),t.info(e("validate.templateLoaded"))}catch{}};return(0,a.jsx)(ar,{breadcrumb:[],title:e("validate.title"),description:e("validate.description"),actions:(0,a.jsx)(L,{type:"button",onClick:d,variant:"ghost",size:"sm",children:e("validate.loadTemplate")}),narrow:!0,children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(tD,{value:s,onChange:e=>r(e.target.value),placeholder:e("validate.pasteConfig"),spellCheck:!1}),(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)(L,{type:"button",onClick:()=>{try{let e=JSON.parse(s);i(null),o.mutate(e)}catch{t.error(e("validate.invalidJsonCannotValidate")),i(null),o.reset()}},disabled:!s.trim()||o.isPending,loading:o.isPending,variant:"primary",children:[(0,a.jsx)(rt.A,{size:14}),o.isPending?e("validate.validating"):e("validate.title")]})}),o.error&&(0,a.jsxs)("div",{className:"bg-red-900/30 border border-red-800 rounded-lg p-4 text-red-400 text-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1 font-medium",children:[(0,a.jsx)(tI.A,{size:14}),e("validate.validationError")]}),(0,a.jsx)("p",{className:"font-mono text-xs",children:o.error.message})]}),n&&(0,a.jsxs)("div",{className:(0,S.$)("border rounded-lg p-4",n.valid?"bg-green-900/20 border-green-800":"bg-red-900/20 border-red-800"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[n.valid?(0,a.jsx)(sY.A,{size:16,className:"text-green-400"}):(0,a.jsx)(tI.A,{size:16,className:"text-red-400"}),(0,a.jsx)("span",{className:(0,S.$)("text-sm font-medium",n.valid?"text-green-400":"text-red-400"),children:n.valid?e("validate.configValid"):e("validate.configHasIssues")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-3",children:[(0,a.jsxs)("div",{className:"bg-bg-secondary/50 rounded p-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("validate.agents")}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:n.agents})]}),(0,a.jsxs)("div",{className:"bg-bg-secondary/50 rounded p-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("validate.configurations")}),(0,a.jsx)("p",{className:"text-lg font-semibold",children:n.configurations})]}),(0,a.jsxs)("div",{className:"bg-bg-secondary/50 rounded p-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e("validate.templateRefs")}),(0,a.jsxs)("p",{className:"text-xs mt-1 text-text-secondary",children:[n.templateRefs.env," ",e("validate.env"),", ",n.templateRefs.secret," ",e("validate.secret"),", ",n.templateRefs.file," ",e("validate.file")]})]})]}),n.violations.length>0&&(0,a.jsxs)("div",{className:"space-y-1 mb-2",children:[(0,a.jsx)("p",{className:"text-xs text-red-400 font-medium",children:e("validate.inlineApiKeys")}),n.violations.map((t,s)=>(0,a.jsxs)("div",{className:"text-xs text-red-300 font-mono pl-4",children:[t.path," (",e("validate.prefixLabel"),": ",t.prefix,")"]},s))]}),n.extendsErrors.length>0&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("p",{className:"text-xs text-red-400 font-medium",children:e("validate.extendsErrors")}),n.extendsErrors.map((e,t)=>(0,a.jsx)("div",{className:"text-xs text-red-300 font-mono pl-4",children:e},t))]})]})]})})})}),nU=(0,f.un)({getParentRoute:()=>nC,path:"/monitoring",component:nw(function(){let e=sx(),{t,i18n:s}=(0,m.Bd)(),[r,n]=(0,l.useState)("overview"),{data:i,isLoading:o,refetch:d}=(0,t2.I)({queryKey:["deployments"],queryFn:e.deployments.list,refetchInterval:15e3,staleTime:5e3}),{data:c,isLoading:p,refetch:u}=(0,t2.I)({queryKey:["deployment-namespaces"],queryFn:e.deployments.namespaces,refetchInterval:3e4,staleTime:1e4}),{data:x,isLoading:g,refetch:y}=(0,t2.I)({queryKey:["deployment-cost-overview"],queryFn:e.deployments.costs,refetchInterval:3e4,staleTime:1e4}),h=(0,re.E)({queries:((null==x?void 0:x.namespaces)??[]).map(t=>({queryKey:["deployment-costs",t.namespace],queryFn:()=>e.deployments.namespaceCosts(t.namespace),refetchInterval:3e4,staleTime:1e4}))}),b=(0,l.useMemo)(()=>h.map(e=>e.data).filter(e=>!!e),[h]),f=h.some(e=>e.isLoading),{data:v,isLoading:j,refetch:N}=(0,t2.I)({queryKey:["activity"],queryFn:()=>e.activity.list(),staleTime:1e4,refetchInterval:15e3}),{data:k,isLoading:w,refetch:C}=(0,t2.I)({queryKey:["doctor"],queryFn:e.doctor,refetchInterval:3e4}),S=i??[],A=(0,l.useMemo)(()=>((null==v?void 0:v.activities)??[]).map(e=>{var t,s;let a,r,n,i,l,o,d,c,m,p,u,x,g,y,h,b,f,v,j,N,k;return a=rd(t=e.meta)?t:{},r="string"==typeof(s=e.type)&&s.trim()?s.trim():"settings",n=rp([e.namespace,a.namespace,a.namespace_name]),i=rp([e.template,a.template,a.template_slug,a.templateSlug,a.slug]),l=rp([e.templateSlug,a.templateSlug,a.slug]),o=rp([e.slug,a.slug,a.templateSlug]),d=rp([e.taskId,a.taskId,a.task_id]),c=rp([e.deploymentId,a.deploymentId,a.deployment_id]),m=rp([a.clusterId,a.cluster_id]),p=rp([a.configId,a.config_id]),u=rp([e.userId,a.userId,a.user_id]),x=rp([e.resourceTier,a.resourceTier,a.resource_tier]),g=rp([a.name,e.template]),y=rp([a.key]),h=rp([a.count]),b=rm(a.wasApproved??a.was_approved),f=rp([a.redeployFrom,a.redeploy_from]),v=rc(e.monthlyCost??a.monthlyCost??a.monthly_cost),j=rc(a.hourlyCost??a.hourly_cost),N=rc(a.billingPrecisionMinutes??a.billing_precision_minutes),k=function(e,t){let s=[],a=new Set,r=(e,t)=>{var r;let n=ro[r=e]??r.trim().replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[\s-]+/g,"_").toLowerCase();if(a.has(n))return;let i=rm(t);i&&(a.add(n),s.push({label:n,value:i}))};for(let[e,s]of t)rl.has(e)||r(e,s);for(let[t,s]of Object.entries(e))rl.has(t)||"meta"!==t&&r(t,s);return s}(a,[["namespace",n],["template",i],["template_slug",l],["template_slug",o],["slug",o],["task_id",d],["deployment_id",c],["cluster_id",m],["config_id",p],["user_id",u],["resource_tier",x],["monthly_cost",v],["hourly_cost",j],["billing_precision_minutes",N],["name",g],["key",y],["count",h],["was_approved",b],["redeploy_from",f]]),{...a,id:rm(e.id)??`activity-${Math.random().toString(36).slice(2,10)}`,type:r,title:rm(e.title)??"",description:rm(e.description),detail:rm(e.detail),namespace:n,template:i,templateSlug:l,slug:o,taskId:d,deploymentId:c,monthlyCost:v,resourceTier:x,userId:u,timestamp:function(e){if("number"==typeof e&&Number.isFinite(e))return e;if("string"==typeof e){let t=Date.parse(e);if(!Number.isNaN(t))return t;let s=rc(e);if(void 0!==s)return s}if(e instanceof Date){let t=e.getTime();if(!Number.isNaN(t))return t}return Date.now()}(e.timestamp??e.createdAt??e.created_at??e.createdAtTs),metadata:k}}),[v]),T=S.length,D=S.filter(e=>tM(e.ready)).length,P=k?k.summary.pass+k.summary.warn+k.summary.fail:0,_=k&&P>0?Math.round(k.summary.pass/P*100):0,R=(null==c?void 0:c.all.length)??new Set(S.map(e=>e.namespace)).size,F=(null==x?void 0:x.namespaces.reduce((e,t)=>e+t.unavailableAgents,0))??0,z=async()=>{await Promise.all([C(),d(),u(),y(),N(),...h.map(e=>e.refetch())])},I=[{id:"overview",label:t("monitoring.overview"),icon:(0,a.jsx)(tY.A,{size:13})},{id:"health",label:t("monitoring.healthChecks"),icon:(0,a.jsx)(rs.A,{size:13})},{id:"deployments",label:t("monitoring.deployments"),count:T,icon:(0,a.jsx)(sz.A,{size:13})},{id:"costs",label:t("monitoring.costs"),count:(null==x?void 0:x.namespaces.length)??0,icon:(0,a.jsx)(sQ.A,{size:13})},{id:"activity",label:t("activity.title"),icon:(0,a.jsx)(aH.A,{size:13})}],E="rounded-2xl p-6";return(0,a.jsx)(ar,{breadcrumb:[],title:t("monitoring.title"),actions:(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"sm",onClick:z,children:[(0,a.jsx)(tE.A,{size:12}),t("common.refresh")]}),headerContent:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)(an,{className:"grid-cols-1 md:grid-cols-2 xl:grid-cols-4",children:[(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("monitoring.healthScore"),value:k?`${_}%`:"—",icon:(0,a.jsx)(rn.A,{size:13}),iconClassName:_>=80?"text-success":_>=50?"text-warning":"text-danger",valueClassName:_>=80?"text-success":_>=50?"text-warning":"text-danger"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("monitoring.deployments"),value:T,icon:(0,a.jsx)(sz.A,{size:13}),iconClassName:"text-primary",valueClassName:"text-primary"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("monitoring.readyTotal"),value:`${D}/${T}`,icon:(0,a.jsx)(sY.A,{size:13}),iconClassName:D===T?"text-success":"text-warning",valueClassName:D===T?"text-success":"text-warning"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("monitoring.namespaces"),value:R,icon:(0,a.jsx)(sX.A,{size:13}),iconClassName:"text-accent",valueClassName:"text-accent"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("deployments.totalCost"),value:ap(x??{},{locale:s.language,shrimpUnitLabel:t("deploy.shrimpCoins")}),icon:(0,a.jsx)(sQ.A,{size:13}),iconClassName:"text-success",valueClassName:"text-success"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("deployments.totalTokens"),value:au((null==x?void 0:x.totalTokens)??null,s.language),icon:(0,a.jsx)(aH.A,{size:13}),iconClassName:"text-accent",valueClassName:"text-accent"})}),(0,a.jsx)(ae,{children:(0,a.jsx)(at,{label:t("deployments.unavailableAgents"),value:F,icon:(0,a.jsx)(tI.A,{size:13}),iconClassName:F>0?"text-warning":"text-text-muted",valueClassName:F>0?"text-warning":"text-text-muted"})})]}),(0,a.jsx)(tT,{value:r,onChange:n,children:(0,a.jsx)(s2,{tabs:I,activeId:r,onSelect:n})})]}),children:(0,a.jsxs)("div",{className:"min-h-[40vh]",children:["overview"===r&&(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(rS,{doctor:k,deployments:S,namespaces:c,costOverview:x,activities:A})}),"health"===r&&(w?(0,a.jsx)(eS,{className:E,children:(0,a.jsx)("div",{className:"min-h-[22vh] py-10 text-center text-sm text-text-muted",children:t("monitoring.runningHealthChecks")})}):k?(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(rw,{doctor:k})}):(0,a.jsx)(eS,{className:E,children:(0,a.jsx)("div",{className:"min-h-[22vh] py-10 text-center text-sm text-text-muted",children:t("monitoring.failedHealthChecks")})})),"deployments"===r&&(o?(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(tB,{inline:!0,className:"py-10"})}):S.length>0?(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(rC,{deployments:S})}):(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(ek,{icon:sz.A,title:t("monitoring.noDeploymentsFound"),description:t("deployments.noDeploymentsYet")})})),"costs"===r&&(g||p?(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(tB,{inline:!0,className:"py-10"})}):(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(rA,{overview:x,namespaceCosts:b,loadingNamespaceCosts:f})})),"activity"===r&&(j?(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(tB,{inline:!0,className:"py-10"})}):(0,a.jsx)(eS,{className:E,children:(0,a.jsx)(rT,{activities:A})}))]})})})}),nO=(0,f.un)({getParentRoute:()=>nC,path:"/doctor",beforeLoad:()=>{throw(0,j.V2)({to:"/monitoring"})}}),n$=(0,f.un)({getParentRoute:()=>nC,path:"/templates",beforeLoad:()=>{throw(0,j.V2)({to:"/store"})}}),nM=(0,f.un)({getParentRoute:()=>nC,path:"/activity",beforeLoad:()=>{throw(0,j.V2)({to:"/monitoring"})}}),nV=(0,f.un)({getParentRoute:()=>nC,path:"/settings",beforeLoad:()=>{throw(0,j.V2)({to:"/"})}}),nq=(0,f.un)({getParentRoute:()=>nC,path:"/secrets",component:nw(function(){let e=sx(),{t}=(0,m.Bd)(),s=sg(),r=(0,n.jE)(),[i,o]=(0,l.useState)("default"),[d,c]=(0,l.useState)(null),[p,u]=(0,l.useState)(null),[x,g]=(0,l.useState)(null),{data:y,isLoading:h}=(0,t2.I)({queryKey:["env"],queryFn:e.env.list}),b=(0,l.useMemo)(()=>{let e=new Set(["default"]);for(let t of(null==y?void 0:y.groups)??[])e.add(t);for(let t of(null==y?void 0:y.envVars)??[])e.add(t.groupName??"default");return nb(e)},[y]);(0,l.useEffect)(()=>{b.includes(i)||o(b[0]??"default")},[b,i]);let f=(0,t5.n)({mutationFn:t=>e.env.createGroup(t),onMutate:async e=>{await r.cancelQueries({queryKey:["env"]});let t=r.getQueryData(["env"]);return r.setQueryData(["env"],t=>({envVars:(null==t?void 0:t.envVars)??[],groups:nb(["default",...(null==t?void 0:t.groups)??[],e])})),o(e),{previous:t}},onSuccess:async()=>{await r.invalidateQueries({queryKey:["env"]}),s.success(t("secrets.groupCreated"))},onError:(e,a,n)=>{(null==n?void 0:n.previous)&&r.setQueryData(["env"],n.previous),s.error(t("secrets.groupCreateFailed"))}}),v=(0,t5.n)({mutationFn:t=>e.env.deleteGroup(t),onMutate:async e=>{await r.cancelQueries({queryKey:["env"]});let t=r.getQueryData(["env"]);return r.setQueryData(["env"],t=>({envVars:((null==t?void 0:t.envVars)??[]).filter(t=>(t.groupName??"default")!==e),groups:nb(((null==t?void 0:t.groups)??[]).filter(t=>t!==e))})),i===e&&o("default"),{previous:t}},onSuccess:async()=>{await r.invalidateQueries({queryKey:["env"]}),s.success(t("secrets.groupDeleted"))},onError:(e,a,n)=>{(null==n?void 0:n.previous)&&r.setQueryData(["env"],n.previous),s.error(t("secrets.groupDeleteFailed"))}}),j=(0,t5.n)({mutationFn:async t=>{await e.env.upsert(t.scope,t.key,t.value,t.isSecret,i),t.originalKey&&t.originalKey!==t.key&&await e.env.delete("global",t.originalKey)},onSuccess:async()=>{await r.invalidateQueries({queryKey:["env"]}),c(null),u(null),s.success("edit"===d?t("secrets.valueUpdated"):t("secrets.valueSaved"))},onError:()=>{s.error("edit"===d?t("secrets.valueUpdateFailed"):t("secrets.valueSaveFailed"))}}),N=(0,t5.n)({mutationFn:t=>{let{key:s}=t;return e.env.delete("global",s)},onSuccess:async()=>{await r.invalidateQueries({queryKey:["env"]}),g(null),s.success(t("secrets.valueDeleted"))},onError:()=>s.error(t("secrets.valueDeleteFailed"))}),k=async a=>{try{let{envVar:t}=await e.env.getOne(a.scope,a.key);u({key:t.key,value:t.value,isSecret:t.isSecret}),c("edit")}catch{s.error(t("secrets.valueLoadFailed"))}},w=((null==y?void 0:y.envVars)??[]).filter(e=>(e.groupName??"default")===i);return(0,a.jsxs)(ar,{breadcrumb:[],title:t("secrets.title"),description:t("secrets.description"),narrow:!0,actions:(0,a.jsxs)(L,{type:"button",variant:"primary",size:"sm",onClick:()=>{u(null),c("create")},children:[(0,a.jsx)(sH.A,{size:14}),t("secrets.addEnvironmentValue")]}),headerContent:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-success/20 bg-success/5 px-4 py-2.5",children:[(0,a.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-success/10 text-success",children:(0,a.jsx)(t0.A,{size:13})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-success",children:t("secrets.encryptionActive")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:t("secrets.allSecretsEncrypted")})]}),(0,a.jsxs)("span",{className:"shrink-0 rounded-full border border-success/20 bg-success/10 px-2.5 py-0.5 text-[11px] font-semibold text-success",children:[(null==y?void 0:y.envVars.length)??0," ",t("secrets.encryptedValues")]})]}),(0,a.jsx)(nf,{groups:b,activeGroup:i,onSelect:o,onCreate:e=>f.mutateAsync(e).then(()=>void 0),onDelete:e=>v.mutateAsync(e).then(()=>void 0)})]}),children:[h?(0,a.jsxs)("div",{className:"flex items-center justify-center py-20 text-sm text-text-muted",children:[(0,a.jsx)(tL.A,{size:18,className:"mr-2 animate-spin"}),t("common.loading")]}):0===w.length?(0,a.jsx)(s1,{cardVariant:"glass",icon:sB.A,title:t("secrets.noValuesInGroup",{group:i}),description:t("secrets.emptyDescription"),action:(0,a.jsxs)(L,{type:"button",variant:"primary",size:"sm",onClick:()=>{u(null),c("create")},children:[(0,a.jsx)(sH.A,{size:14}),t("secrets.addEnvironmentValue")]})}):(0,a.jsx)(en,{variant:"glass",children:(0,a.jsxs)(tj,{children:[(0,a.jsx)(tN,{children:(0,a.jsxs)(tw,{children:[(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:t("secrets.keyName")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:t("secrets.secretValue")}),(0,a.jsx)(tC,{className:"text-[0.72rem] font-bold uppercase tracking-[0.08em] text-text-muted",children:t("common.actions")})]})}),(0,a.jsx)(tk,{children:w.map(e=>(0,a.jsxs)(tw,{className:"group",children:[(0,a.jsx)(tS,{children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("code",{className:"text-sm font-mono text-text-primary",children:e.key}),e.isSecret&&(0,a.jsx)(s4.A,{size:12,className:"text-warning"})]})}),(0,a.jsx)(tS,{children:(0,a.jsx)("span",{className:"text-xs font-mono text-text-muted",children:e.maskedValue})}),(0,a.jsx)(tS,{children:(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"xs",className:"transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease active:translate-y-[0.5px] focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-primary)_36%,transparent)]",onClick:()=>void k(e),title:t("common.edit"),children:[(0,a.jsx)(sW.A,{size:13}),(0,a.jsx)("span",{className:"sr-only",children:t("common.edit")})]}),(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"xs",className:"text-danger/70 transition-[background-color,border-color,color,box-shadow,transform] duration-[160ms] ease hover:bg-danger/10 hover:text-danger active:translate-y-[0.5px] focus-visible:outline-none focus-visible:shadow-[0_0_0_2px_color-mix(in_srgb,var(--color-primary)_36%,transparent)]",onClick:()=>g({key:e.key}),title:t("common.delete"),children:[(0,a.jsx)(sJ.A,{size:13}),(0,a.jsx)("span",{className:"sr-only",children:t("common.delete")})]})]})})]},`${e.scope}-${e.key}`))})]})}),d&&(0,a.jsx)(s8,{mode:d,overline:i,initial:p??void 0,isSubmitting:j.isPending,titleCreate:t("secrets.addEnvironmentValue"),titleEdit:t("secrets.editEnvironmentValue"),subtitleCreate:t("secrets.addEnvironmentValueDescription",{group:i}),subtitleEdit:t("secrets.editEnvironmentValueDescription",{group:i}),onSubmit:e=>{j.mutate({scope:"global",...e,originalKey:null==p?void 0:p.key})},onClose:()=>{c(null),u(null)}}),(0,a.jsx)(U,{open:!!x,onOpenChange:e=>{e||g(null)},children:(0,a.jsxs)(M,{children:[(0,a.jsxs)(V,{children:[(0,a.jsx)(B,{children:t("common.delete")}),(0,a.jsx)(K,{children:x?`${t("common.delete")} ${x.key}?`:""})]}),(0,a.jsxs)(q,{children:[(0,a.jsx)(W,{asChild:!0,children:(0,a.jsx)(L,{variant:"ghost",children:t("common.cancel")})}),(0,a.jsx)(H,{asChild:!0,children:(0,a.jsx)(L,{variant:"danger",loading:N.isPending,onClick:()=>x&&N.mutate({key:x.key}),children:t("common.delete")})})]})]})})]})})}),nB=(0,f.un)({getParentRoute:()=>nC,path:"/providers",component:nw(function(){var e;let t=sx(),{t:s}=(0,m.Bd)(),r=sg(),i=(0,n.jE)(),[o,d]=(0,l.useState)(null),[c,p]=(0,l.useState)(null),[u,x]=(0,l.useState)({}),[g,y]=(0,l.useState)(!1),{data:h,isLoading:b}=(0,t2.I)({queryKey:["provider-catalogs"],queryFn:t.providerCatalogs.list}),{data:f,isLoading:v}=(0,t2.I)({queryKey:["provider-profiles"],queryFn:t.providerProfiles.list}),{data:j}=(0,t2.I)({queryKey:["model-proxy-billing"],queryFn:()=>{var e,s;return(null==(s=t.modelProxy)||null==(e=s.billing)?void 0:e.call(s))??Promise.resolve(null)},retry:!1}),N=(null==h?void 0:h.providers)??[],k=(null==f?void 0:f.profiles)??[],w=(0,l.useMemo)(()=>j?j.inputTokensPerShrimp||j.outputTokensPerShrimp?s("providers.officialPricingTokens",{input:ne(j.inputTokensPerShrimp??j.outputTokensPerShrimp??1e3),output:ne(j.outputTokensPerShrimp??j.inputTokensPerShrimp??1e3)}):s("providers.officialPricingDeepSeek",{cacheHit:ne(j.inputCacheHitShrimpPerMillionTokens),cacheMiss:ne(j.inputCacheMissShrimpPerMillionTokens),output:ne(j.outputShrimpPerMillionTokens),shrimpPerCny:ne(j.shrimpPerCny)}):s("providers.officialPricingLoading"),[j,s]),C=(0,l.useMemo)(()=>new Map(N.map(e=>[e.provider.id,e])),[N]),S=k.filter(e=>e.enabled).length,A=o?C.get(o.providerId):void 0,T=(0,l.useMemo)(()=>N.filter(e=>"custom"!==e.provider.id),[N]),D=N.find(e=>"custom"===e.provider.id),P=(0,t5.n)({mutationFn:e=>{let s=C.get(e.providerId),a={},r=nl(s),n=e.apiKey.trim();r&&n&&!nt(n)&&(a[r]=n);let i={},l=e.baseUrl.trim();return l&&!nt(l)&&(i.baseUrl=l),i.apiFormat=e.apiFormat,i.authType="api_key",i.models=ng(e.models),t.providerProfiles.upsert({id:e.id,providerId:e.providerId,name:e.name.trim(),enabled:e.enabled,config:i,envVars:a})},onSuccess:async()=>{await i.invalidateQueries({queryKey:["provider-profiles"]}),d(null),r.success(s("providers.profileSaved"))},onError:()=>r.error(s("providers.profileSaveFailed"))}),_=(0,t5.n)({mutationFn:e=>t.providerProfiles.delete(e.id),onSuccess:async()=>{await i.invalidateQueries({queryKey:["provider-profiles"]}),p(null),r.success(s("providers.profileDeleted"))},onError:()=>r.error(s("providers.profileDeleteFailed"))}),R=(0,t5.n)({mutationFn:e=>t.providerProfiles.test(e.id),onSuccess:(e,t)=>{x(s=>({...s,[t.id]:e})),e.ok?r.success(s("providers.testPassed")):r.error(s("providers.testFailed"))},onError:(e,t)=>{x(e=>({...e,[t.id]:{ok:!1,message:s("providers.testFailed")}})),r.error(s("providers.testFailed"))}}),F=()=>{d(null),y(!0)},z=e=>{var t;let s=e??(null==(t=N[0])?void 0:t.provider.id)??"",a=C.get(s);d({...r7,providerId:s,name:s?`${s}-default`:"",apiFormat:na(a),authType:"api_key",models:[nm(a)]}),y(!0)},I=e=>({id:e.id,providerId:e.providerId,name:e.name,apiKey:no(e,C.get(e.providerId)),baseUrl:ns(e),apiFormat:ni(e,C.get(e.providerId)),authType:"api_key",models:nx(e),enabled:e.enabled}),E=()=>{d(null),y(!1)},O=!!(o&&ng(o.models).length>0),$={hasDuplicateModel:np(e=(null==o?void 0:o.models)??[]).size>0,hasEmptyModelId:e.some(e=>!e.id.trim())},J=np((null==o?void 0:o.models)??[]),Q=A?!!(null==o?void 0:o.apiKey.trim())||!!(null==o?void 0:o.id):!!(null==o?void 0:o.apiKey.trim()),G=nl(A)||s("providers.apiKey"),Z=P.isPending||!(null==o?void 0:o.providerId)||!o.name.trim()||!A||!Q||!O||$.hasEmptyModelId||$.hasDuplicateModel,X=e=>nx(e).map(e=>e.id);return(0,a.jsxs)(ar,{breadcrumb:[],title:s("providers.title"),narrow:!0,actions:(0,a.jsxs)(L,{type:"button",variant:"primary",size:"sm",onClick:F,disabled:0===N.length,children:[(0,a.jsx)(sH.A,{size:14}),s("providers.addProvider")]}),headerContent:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-3",children:[(0,a.jsx)("div",{className:"rounded-xl border border-success/20 bg-success/5 px-4 py-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-lg bg-success/10 text-success",children:(0,a.jsx)(t0.A,{size:13})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-success",children:s("providers.encryptionActive")}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:s("providers.encryptionDescription")})]})]})}),(0,a.jsxs)("div",{className:"rounded-xl border border-border-subtle bg-bg-secondary/45 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs font-bold uppercase tracking-[0.1em] text-text-muted",children:s("providers.connectionCount",{count:k.length})}),(0,a.jsx)("p",{className:"mt-1 text-xl font-bold text-text-primary",children:k.length})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border-subtle bg-bg-secondary/45 px-4 py-3",children:[(0,a.jsx)("p",{className:"text-xs font-bold uppercase tracking-[0.1em] text-text-muted",children:s("providers.enabledProfiles")}),(0,a.jsx)("p",{className:"mt-1 text-xl font-bold text-text-primary",children:S})]})]}),(0,a.jsx)("div",{className:"rounded-xl border border-border-subtle bg-bg-secondary/35 px-4 py-3",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,a.jsx)("span",{className:"mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/12 text-primary",children:(0,a.jsx)(aV.A,{size:15})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-text-primary",children:s("providers.officialProviderTitle")}),(0,a.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-text-muted",children:s("providers.officialProviderDescription")}),(0,a.jsx)("p",{className:"mt-2 text-xs font-medium text-primary",children:w})]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>{window.location.assign("/app/settings/wallet")},children:[(0,a.jsx)(aV.A,{size:13}),s("deploy.viewWalletAndBilling")]}),(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"sm",onClick:()=>{if("u"<typeof window)return;let e=!1,t=()=>{e=!0,window.removeEventListener("shadow:open-recharge:ack",t)};window.addEventListener("shadow:open-recharge:ack",t),window.dispatchEvent(new CustomEvent("shadow:open-recharge",{detail:{source:"provider-profiles",amount:1e4}})),window.setTimeout(()=>{window.removeEventListener("shadow:open-recharge:ack",t),e||r.error(s("deploy.rechargeUnavailable"))},500)},children:[(0,a.jsx)(sQ.A,{size:13}),s("deploy.topUp")]})]})]})})]}),children:[b||v?(0,a.jsxs)("div",{className:"flex items-center justify-center py-20 text-sm text-text-muted",children:[(0,a.jsx)(tL.A,{size:18,className:"mr-2 animate-spin"}),s("common.loading")]}):0===k.length?(0,a.jsx)(s1,{cardVariant:"glass",icon:tX.A,title:s("providers.noProfiles"),description:s("providers.noProfilesDescription"),action:(0,a.jsxs)(L,{type:"button",variant:"primary",size:"sm",onClick:F,children:[(0,a.jsx)(sH.A,{size:14}),s("providers.addProvider")]})}):(0,a.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:k.map(e=>{var t;let r,n=u[e.id],i=R.isPending&&(null==(t=R.variables)?void 0:t.id)===e.id;return(0,a.jsxs)(en,{variant:"glass",className:"flex h-full flex-col p-4",children:[(0,a.jsx)("div",{className:"border-b border-border-subtle/60 pb-3",children:(0,a.jsxs)("div",{className:"cardHeader flex min-w-0 items-start gap-3",children:[(0,a.jsx)("div",{className:"min-w-0",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"truncate text-base font-black text-text-primary",children:e.name}),(0,a.jsx)(Y,{variant:e.enabled?"success":"neutral",size:"sm",children:e.enabled?s("providers.enabled"):s("providers.disabled")})]})}),(0,a.jsx)("div",{className:"ml-auto mt-1 flex shrink-0 items-center gap-2 sm:mt-0",children:(0,a.jsx)(tv,{id:`provider-profile-enabled-${e.id}`,checked:e.enabled,onCheckedChange:()=>{P.mutate({id:e.id,providerId:e.providerId,name:e.name,apiKey:no(e,C.get(e.providerId)),baseUrl:ns(e),apiFormat:ni(e,C.get(e.providerId)),authType:"api_key",models:nx(e),enabled:!e.enabled})},disabled:P.isPending})})]})}),(0,a.jsxs)("div",{className:"cardContent mt-3",children:[(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2",children:(0,a.jsxs)("div",{className:"rounded-lg border border-border-subtle/50 bg-bg-secondary/30 px-2.5 py-2 text-xs",children:[(0,a.jsx)("p",{className:"truncate text-sm font-semibold text-text-primary",children:s("providers.modelsCount",{count:(r=X(e)).length,modelList:r.length>0?r.join(", "):s("providers.modelsNotConfigured")})}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:X(e).map(t=>(0,a.jsx)("span",{className:"rounded-full border border-border-subtle/60 bg-bg-primary/10 px-2 py-0.5 text-[11px] leading-tight text-text-muted",children:t},`${e.id}-${t}`))})]})}),n&&(0,a.jsxs)("div",{className:t$("mt-3 flex items-start gap-2 rounded-xl border px-3 py-2 text-xs",n.ok?"border-success/25 bg-success/8 text-success":"border-danger/25 bg-danger/8 text-danger"),children:[n.ok?(0,a.jsx)(sY.A,{size:13,className:"mt-0.5 shrink-0"}):(0,a.jsx)(sM.A,{size:13,className:"mt-0.5 shrink-0"}),(0,a.jsx)("span",{className:"min-w-0 break-words",children:(null==n?void 0:n.message)??(null==n?void 0:n.error)??null})]})]}),(0,a.jsx)("div",{className:"cardFooter mt-auto pt-3",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 xl:grid-cols-3",children:[(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"xs",onClick:()=>R.mutate(e),disabled:i||!e.enabled,title:s("providers.testConnection"),className:"flex items-center justify-center gap-2",children:[i?(0,a.jsx)(tL.A,{size:13,className:"animate-spin"}):(0,a.jsx)(r8.A,{size:13}),s("providers.testConnectionShort")]}),(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"xs",onClick:()=>{y(!1),d(I(e))},title:s("common.edit"),className:"flex items-center justify-center gap-2",children:[(0,a.jsx)(sW.A,{size:13}),s("common.edit")]}),(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"xs",className:"flex items-center justify-center gap-2 text-danger/70 hover:text-danger",onClick:()=>p(e),title:s("common.delete"),children:[(0,a.jsx)(sJ.A,{size:13}),s("common.delete")]})]})})]},e.id)})}),g&&!o&&(0,a.jsx)(e$,{open:!0,onClose:E,children:(0,a.jsxs)(eV,{size:"md",children:[(0,a.jsx)(eq,{icon:(0,a.jsx)(tX.A,{size:18}),title:s("providers.connectProvidersTitle"),subtitle:s("providers.connectProvidersDescription")}),(0,a.jsxs)(eB,{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:s("providers.apiKeyProvidersDescription")}),(0,a.jsxs)("div",{className:"space-y-2",children:[T.map(e=>{var t;let r=(t=e.provider.id,k.find(e=>e.providerId===t));return(0,a.jsxs)("button",{type:"button",className:"group flex w-full items-center gap-3 rounded-2xl border border-border-subtle/70 bg-bg-secondary/20 px-4 py-3 text-left transition-colors hover:border-primary/35 hover:bg-primary/5",onClick:()=>r?void(y(!0),d(I(r))):z(e.provider.id),children:[(0,a.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-primary/20 bg-primary/10 text-sm font-black text-primary",children:nn(e)}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-black text-text-primary",children:nr(e)}),(0,a.jsx)("span",{className:"block truncate text-xs text-text-muted",children:nl(e)})]}),(0,a.jsx)(Y,{variant:(null==r?void 0:r.enabled)?"success":"neutral",size:"sm",children:r?s("providers.providerConnected"):s("providers.providerAvailable")}),(0,a.jsx)(aC.A,{size:16,className:"text-text-muted transition-colors group-hover:text-primary"})]},e.provider.id)}),D&&(0,a.jsxs)("button",{type:"button",className:"group flex w-full items-center gap-3 rounded-2xl border border-dashed border-border-subtle/80 bg-bg-secondary/10 px-4 py-3 text-left transition-colors hover:border-primary/35 hover:bg-primary/5",onClick:()=>z(D.provider.id),children:[(0,a.jsx)("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-primary/20 bg-primary/10 text-primary",children:(0,a.jsx)(r6.A,{size:16})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-sm font-black text-text-primary",children:s("providers.addCustomProvider")}),(0,a.jsx)("span",{className:"block text-xs text-text-muted",children:s("providers.customProviderDescription")})]}),(0,a.jsx)(aC.A,{size:16,className:"text-text-muted transition-colors group-hover:text-primary"})]})]})]}),(0,a.jsx)(eK,{children:(0,a.jsx)(eH,{children:(0,a.jsx)(L,{type:"button",variant:"ghost",onClick:E,children:s("common.cancel")})})})]})}),o&&(0,a.jsx)(e$,{open:!0,onClose:o.id||!g?()=>d(null):E,children:(0,a.jsxs)(eV,{size:"md",children:[(0,a.jsx)(eq,{icon:(0,a.jsx)("span",{className:"text-sm font-black",children:nn(A,o.providerId)}),title:o.id?s("providers.editProfile"):s("providers.connectProviderTitle",{provider:nr(A,o.providerId)}),subtitle:s("providers.profileDialogDescription"),action:!o.id&&g?(0,a.jsxs)(L,{type:"button",variant:"ghost",size:"xs",onClick:()=>{d(null),y(!0)},children:[(0,a.jsx)(aB.A,{size:13}),s("providers.backToProviders")]}):void 0}),(0,a.jsxs)(eB,{className:"space-y-4 py-5",children:[(0,a.jsxs)("section",{className:"rounded-2xl border border-border-subtle/45 bg-bg-secondary/15 p-4",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-wrap items-start justify-between gap-3",children:[(0,a.jsx)("div",{className:"min-w-0",children:(0,a.jsx)("p",{className:"text-xs font-black uppercase text-primary",children:s("providers.connectionTitle")})}),(0,a.jsx)("div",{className:"flex min-h-10 shrink-0 items-center rounded-full border border-border-subtle/60 bg-bg-primary/25 px-3",children:(0,a.jsx)(tv,{checked:o.enabled,onCheckedChange:e=>d({...o,enabled:e}),"aria-label":o.enabled?s("common.enabled"):s("common.disabled")})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"provider-profile-name",className:"mb-1 block text-xs font-bold",children:s("providers.profileName")}),(0,a.jsx)(e_,{id:"provider-profile-name",value:o.name,onChange:e=>d({...o,name:e.target.value}),placeholder:s("providers.profileNamePlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"provider-profile-api-format",className:"mb-1 block text-xs font-bold",children:s("providers.apiFormat")}),(0,a.jsxs)(eW,{id:"provider-profile-api-format",value:o.apiFormat,onChange:e=>d({...o,apiFormat:e.target.value}),children:[(0,a.jsx)("option",{value:"openai",children:s("providers.apiFormats.openai")}),(0,a.jsx)("option",{value:"anthropic",children:s("providers.apiFormats.anthropic")}),(0,a.jsx)("option",{value:"gemini",children:s("providers.apiFormats.gemini")})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{htmlFor:"provider-profile-base-url",className:"mb-1 block text-xs font-bold",children:s("providers.baseUrl")}),(0,a.jsx)(e_,{id:"provider-profile-base-url",value:o.baseUrl,onChange:e=>d({...o,baseUrl:e.target.value}),placeholder:(null==A?void 0:A.provider.baseUrl)??s("providers.baseUrlPlaceholder")}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:s("providers.baseUrlHelp")})]}),(0,a.jsxs)("div",{className:"sm:col-span-2",children:[(0,a.jsx)("div",{className:"mb-1 flex items-center justify-between gap-3",children:(0,a.jsx)("label",{htmlFor:"provider-profile-api-key",className:"block text-xs font-bold",children:G})}),(0,a.jsx)(e4,{id:"provider-profile-api-key",value:o.apiKey,onChange:e=>d({...o,apiKey:e.target.value}),placeholder:o.id?s("providers.apiKeyEditPlaceholder"):s("providers.apiKeyPlaceholder"),autoComplete:"new-password","data-bwignore":"true"}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:s("providers.apiKeyHelp")})]})]})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-2xl border border-border-subtle/45 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"text-sm font-black text-text-primary",children:[s("providers.modelsTitle"),(0,a.jsx)("span",{className:"ml-1 text-danger",children:"*"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:s("providers.modelsDescription")})]}),(0,a.jsxs)(L,{type:"button",variant:"secondary",size:"xs",onClick:()=>d({...o,models:[...o.models,nc()]}),children:[(0,a.jsx)(sH.A,{size:12}),s("providers.addModel")]})]}),(null==A?void 0:A.provider.models.length)?(0,a.jsx)("datalist",{id:"provider-profile-model-options",children:A.provider.models.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name??e.id},e.id))}):null,0===o.models.length?(0,a.jsxs)("button",{type:"button",className:"flex w-full items-center justify-center gap-2 rounded-2xl border border-dashed border-border-subtle/50 bg-bg-primary/10 px-4 py-3 text-sm font-bold text-text-muted transition-colors hover:border-primary/40 hover:text-primary",onClick:()=>d({...o,models:[nm(A)]}),children:[(0,a.jsx)(sH.A,{size:14}),s("providers.addFirstModel")]}):(0,a.jsx)("div",{className:"space-y-3",children:o.models.map((e,t)=>(0,a.jsxs)("div",{className:"rounded-xl border border-border-subtle/45 p-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex flex-nowrap items-center gap-2",children:[(0,a.jsx)(e_,{value:e.id,onChange:s=>{let a=[...o.models];a[t]={...e,id:s.target.value},d({...o,models:a})},placeholder:s("providers.modelIdPlaceholder"),list:"provider-profile-model-options",className:"min-w-0 flex-1"}),(0,a.jsx)("span",{className:"w-56 shrink-0",children:(0,a.jsxs)(e9,{value:e.tags[0]??"",onValueChange:s=>{let a=[...o.models];a[t]={...e,tags:[s]},d({...o,models:a})},children:[(0,a.jsx)(te,{children:(0,a.jsx)(e7,{placeholder:s("providers.modelTag")})}),(0,a.jsx)(ta,{children:r9.map(e=>(0,a.jsx)(tr,{value:e,children:s(`providers.modelTags.${e}`)},e))})]})}),(0,a.jsx)(L,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 rounded-lg text-text-muted hover:bg-bg-primary/40 hover:text-text-primary",title:s("common.copy"),onClick:()=>{var t;return d({...o,models:[...o.models,(t=o.models,{...e,clientId:nd(),id:function(e,t){let s=e.trim();if(!s)return"";let a=new Set(t.map(e=>e.id.trim().toLowerCase()).filter(e=>e.length>0)),r=`${s}-copy`,n=1;for(;a.has(r.toLowerCase());)n+=1,r=`${s}-copy-${n}`;return r}(e.id,t),tags:[...e.tags]})]})},children:(0,a.jsx)(tG.A,{size:14})}),(0,a.jsx)(L,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 rounded-lg text-danger/75 hover:bg-danger/10 hover:text-danger",title:s("common.delete"),onClick:()=>d({...o,models:o.models.filter(t=>t.clientId!==e.clientId)}),children:(0,a.jsx)(sJ.A,{size:14})})]}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:s("providers.modelTagHint")}),e.id.trim()?null:(0,a.jsx)("p",{className:"mt-2 text-xs font-bold text-danger",children:s("providers.modelIdRequired")}),J.has(t)?(0,a.jsx)("p",{className:"mt-2 text-xs font-bold text-danger",children:s("providers.modelDuplicate")}):null,(0,a.jsx)("div",{className:"mt-3 h-px bg-gradient-to-r from-transparent via-border-subtle/20 to-transparent"}),(0,a.jsxs)("details",{className:"pt-3",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-xs font-black text-text-muted",children:s("providers.modelDetails")}),(0,a.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,a.jsx)(e_,{value:e.name,onChange:s=>{let a=[...o.models];a[t]={...e,name:s.target.value},d({...o,models:a})},placeholder:s("providers.modelNamePlaceholder")}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,a.jsx)(e_,{type:"number",min:1,value:e.contextWindow,onChange:s=>{let a=[...o.models];a[t]={...e,contextWindow:s.target.value},d({...o,models:a})},placeholder:s("providers.contextWindowPlaceholder")}),(0,a.jsx)(e_,{type:"number",min:1,value:e.maxTokens,onChange:s=>{let a=[...o.models];a[t]={...e,maxTokens:s.target.value},d({...o,models:a})},placeholder:s("providers.maxTokensPlaceholder")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,a.jsx)(e_,{type:"number",min:0,step:"0.000001",value:e.inputCost,onChange:s=>{let a=[...o.models];a[t]={...e,inputCost:s.target.value},d({...o,models:a})},placeholder:s("providers.inputCostPlaceholder")}),(0,a.jsx)(e_,{type:"number",min:0,step:"0.000001",value:e.outputCost,onChange:s=>{let a=[...o.models];a[t]={...e,outputCost:s.target.value},d({...o,models:a})},placeholder:s("providers.outputCostPlaceholder")})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-3",children:["vision","tools","reasoning"].map(r=>(0,a.jsxs)("label",{className:"flex h-12 items-center justify-between rounded-2xl border border-border-subtle/60 bg-bg-primary/35 px-3 text-xs font-bold text-text-secondary",children:[(0,a.jsx)("span",{children:s(`providers.capabilities.${r}`)}),(0,a.jsx)(tv,{checked:e[r],onCheckedChange:s=>{let a=[...o.models];a[t]={...e,[r]:s},d({...o,models:a})}})]},r))})]})]})]},e.clientId))}),!O&&(0,a.jsx)("p",{className:"text-xs font-bold text-danger",children:s("providers.modelRequired")}),$.hasDuplicateModel?(0,a.jsx)("p",{className:"text-xs font-bold text-danger",children:s("providers.modelDuplicate")}):null]})]}),(0,a.jsx)(eK,{children:(0,a.jsxs)(eH,{children:[(0,a.jsx)(L,{type:"button",variant:"ghost",onClick:()=>d(null),children:s("common.cancel")}),(0,a.jsx)(L,{type:"button",variant:"primary",loading:P.isPending,disabled:Z,onClick:()=>o&&P.mutate(o),children:s("common.save")})]})})]})}),(0,a.jsx)(U,{open:!!c,onOpenChange:e=>{e||p(null)},children:(0,a.jsxs)(M,{children:[(0,a.jsxs)(V,{children:[(0,a.jsx)(B,{children:s("providers.deleteTitle")}),(0,a.jsx)(K,{children:s("providers.deleteDescription",{name:(null==c?void 0:c.name)??""})})]}),(0,a.jsxs)(q,{children:[(0,a.jsx)(W,{children:s("common.cancel")}),(0,a.jsx)(H,{asChild:!0,children:(0,a.jsx)(L,{variant:"danger",loading:_.isPending,onClick:()=>c&&_.mutate(c),children:s("common.delete")})})]})]})})]})})}),nK=(0,f.un)({getParentRoute:()=>nC,path:"/my-templates",component:nw(function(){let e=sx(),{t,i18n:s}=(0,m.Bd)(),r=sg(),i=(0,n.jE)(),o=(0,sR.Z)(),[d,c]=(0,l.useState)(!1),[p,u]=(0,l.useState)(!1),[x,g]=(0,l.useState)(null),[y,h]=(0,l.useState)(null),[b,f]=(0,l.useState)(""),v=aP(b),j=r2(t("templates.typewriterPhrases",{returnObjects:!0})),{data:N,isLoading:k}=(0,t2.I)({queryKey:["my-templates"],queryFn:e.myTemplates.list}),{data:w}=(0,t2.I)({queryKey:["template-catalog",s.language],queryFn:()=>e.templates.catalog(s.language)}),C=(0,t5.n)({mutationFn:t=>{let{source:s,name:a}=t;return e.myTemplates.fork(s,a)},onSuccess:e=>{i.invalidateQueries({queryKey:["my-templates"]}),c(!1),o({to:"/my-templates/$name",params:{name:e.name}}),r.success(`${t("templates.forkedAs")} "${e.name}"`)},onError:e=>r.error(t("templates.forkFailed",{message:e.message}))}),S=(0,t5.n)({mutationFn:t=>e.myTemplates.delete(t),onSuccess:()=>{i.invalidateQueries({queryKey:["my-templates"]}),r.success(t("templates.templateDeleted"))},onError:e=>r.error(t("templates.deleteFailed",{message:e.message}))}),A=N??[],T=(0,l.useMemo)(()=>new Set(A.map(e=>e.name)),[A]),D=(0,l.useMemo)(()=>new Map(((null==w?void 0:w.templates)??[]).map(e=>[e.name,e])),[null==w?void 0:w.templates]),P=(0,l.useMemo)(()=>Object.fromEntries(((null==w?void 0:w.categories)??[]).map(e=>[e.id,e.label])),[null==w?void 0:w.categories]),_=(0,l.useMemo)(()=>[...A].sort((e,t)=>new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime()),[A]),R=(0,t5.n)({mutationFn:async t=>{var s;let a,r,n=(await e.myTemplates.save(t,(a=(s=t).trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,63)||"custom-template",r=`${a}-buddy`.slice(0,63),{version:"1.0.0",name:a,title:s,description:"",use:[{plugin:"model-provider"},{plugin:"shadowob",options:{servers:[{id:"main",name:s,slug:a,channels:[{id:"general",title:"General",type:"text"}]}],buddies:[{id:r,name:`${s} Buddy`}],bindings:[{targetId:r,targetType:"buddy",servers:["main"],channels:["general"],agentId:r,replyPolicy:{mode:"mentionOnly"}}]}}],deployments:{namespace:a,agents:[{id:r,runtime:"openclaw",identity:{name:`${s} Buddy`,systemPrompt:"You are a helpful Shadow Buddy for this community."},configuration:{openclaw:{}}}]}}))).name;return{savedName:"string"==typeof n?n:t}},onSuccess:(e,s)=>{let{savedName:a}=e;i.invalidateQueries({queryKey:["my-templates"]}),g(null),u(!1),o({to:"/my-templates/$name",params:{name:a}}),r.success(t("templates.templateCreated",{name:s}))},onError:e=>{let s=t("templates.createFailed",{message:e.message});g(s),r.error(s)}}),F=(0,l.useMemo)(()=>{let e=v.trim().toLowerCase();return _.filter(t=>{if(!e)return!0;let s=t.templateSlug?D.get(t.templateSlug):void 0,a=r5(t.content);return[t.name,t.templateSlug??"",(null==s?void 0:s.description)??"",(null==s?void 0:s.overview.join(" "))??"",a.namespace??"",a.agentHighlights.join(" ")].join(" ").toLowerCase().includes(e)})},[D,v,_]);return(0,a.jsxs)(ar,{breadcrumb:[],title:t("templates.title"),headerContent:(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(e2,{value:b,onChange:f,placeholder:j||t("templates.searchSavedPlaceholder")}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:[t("store.matchingTemplates",{count:F.length}),v?` \xb7 ${t("store.matchingQuery",{query:v})}`:""]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(L,{type:"button",variant:"primary",size:"sm",onClick:()=>{g(null),u(!0)},children:[(0,a.jsx)(sH.A,{size:14}),(0,a.jsx)("span",{className:"truncate",children:t("templates.createTemplate")})]}),(0,a.jsxs)(L,{type:"button",variant:"secondary",size:"sm",onClick:()=>o({to:"/store"}),children:[(0,a.jsx)(tQ.A,{size:14}),(0,a.jsx)("span",{className:"truncate",children:t("templates.forkFromStore")})]})]})]})]}),children:[k&&(0,a.jsx)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:Array.from({length:8}).map((e,t)=>(0,a.jsx)("div",{className:"h-[240px] rounded-3xl border border-border-subtle bg-bg-secondary/60 animate-pulse"},`template-skeleton-${t}`))}),!k&&0===A.length&&(0,a.jsx)(s1,{cardVariant:"glassPanel",icon:tG.A,title:t("templates.noCustomTemplates"),description:t("templates.noCustomTemplateHint"),action:(0,a.jsxs)("div",{className:"flex flex-wrap justify-center gap-2",children:[(0,a.jsxs)(L,{type:"button",variant:"primary",size:"sm",onClick:()=>{g(null),u(!0)},children:[(0,a.jsx)(sH.A,{size:14}),t("templates.createTemplate")]}),(0,a.jsxs)(L,{type:"button",variant:"secondary",size:"sm",onClick:()=>o({to:"/store"}),children:[(0,a.jsx)(tQ.A,{size:14}),t("templates.forkFromStore")]})]})}),!k&&A.length>0&&0===F.length&&(0,a.jsx)(s1,{cardVariant:"glassPanel",icon:rG.A,title:t("templates.noTemplatesMatch",{query:v||t("templates.title")}),description:t("templates.emptyFiltered"),action:(0,a.jsx)(L,{type:"button",variant:"primary",size:"sm",onClick:()=>f(""),children:t("templates.clearSearch")})}),!k&&F.length>0&&(0,a.jsx)("div",{className:"grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4",children:F.map(e=>{var r,n;let i=r5(e.content),l=(null==(r=e.templateSlug)?void 0:r.startsWith("git:"))?"git":r?"store":"custom",o=e.templateSlug?D.get(e.templateSlug):void 0,d=(null==o?void 0:o.description)??(null==o?void 0:o.overview[0])??t("templateDetail.customDescription"),c=new Date(e.updatedAt).toLocaleString(s.language,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),m=o||(n=e.name,{name:n,title:n,description:d,namespace:n,tags:[],agentCount:i.agentCount,category:"demo",emoji:"✨",featured:!1,popularity:0,difficulty:"beginner",estimatedDeployTime:"",overview:[d],features:[],highlights:[]}),p=o?P[o.category]??o.category:t(`templates.filters.${l}`),u=encodeURIComponent(e.name),x=encodeURIComponent(e.slug);return(0,a.jsx)(r1,{template:m,categoryLabel:p,detailHref:`/my-templates/${u}`,title:e.name,summary:d,difficultyLabel:o?t(`store.difficulties.${o.difficulty}`):void 0,metrics:[{icon:(0,a.jsx)(aU.A,{size:11,className:"text-primary"}),value:i.agentCount,label:t("templateDetail.agents")},{icon:(0,a.jsx)(rY.A,{size:11,className:"text-primary"}),value:`v${e.version??1}`,label:t("templateDetail.version")},{icon:(0,a.jsx)(aO.A,{size:11,className:"text-primary"}),value:c,label:t("templates.updated")}],secondaryAction:{href:`/my-templates/${u}`,label:t("templates.openEditor"),icon:(0,a.jsx)(rR.A,{size:14}),variant:"secondary"},primaryAction:{href:`/store/${x}`,label:t("templates.deployNow"),icon:(0,a.jsx)(sZ.A,{size:14}),variant:"primary"}},e.slug)})}),(0,a.jsx)(U,{open:!!y,onOpenChange:e=>{e||h(null)},children:(0,a.jsxs)(M,{children:[(0,a.jsxs)(V,{children:[(0,a.jsx)(B,{children:(null==y?void 0:y.reviewStatus)==="approved"?t("templates.deleteApprovedTitle"):t("common.delete")}),(0,a.jsx)(K,{children:(null==y?void 0:y.reviewStatus)==="approved"?t("templates.deleteApprovedConfirm",{name:y.name}):(null==y?void 0:y.reviewStatus)==="pending"?t("templates.deletePendingConfirm",{name:y.name}):y?t("templates.deleteConfirm",{name:y.name}):""})]}),(0,a.jsxs)(q,{children:[(0,a.jsx)(W,{asChild:!0,children:(0,a.jsx)(L,{variant:"ghost",children:t("common.cancel")})}),(0,a.jsx)(H,{asChild:!0,children:(0,a.jsx)(L,{variant:"danger",loading:S.isPending,onClick:()=>{y&&S.mutate(y.name),h(null)},children:t("common.delete")})})]})]})}),d&&(0,a.jsx)(r3,{onFork:(e,t)=>C.mutate({source:e,name:t}),onClose:()=>c(!1)}),p&&(0,a.jsx)(r4,{onCreate:e=>{let t;g(null);let s=(t=e.trim())?t.replace(/[\\/?%*:|"<>]/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").slice(0,120):"";if(!s)return;let a=(e=>{let t=e,s=2;for(;T.has(t);)t=`${e}-${s}`,s+=1;return t})(s);R.mutate(a)},onClose:()=>{g(null),u(!1)},error:x,isPending:R.isPending})]})})}),nH=(0,f.un)({getParentRoute:()=>nC,path:"/my-templates/$name",component:nw(function(){let e=sx(),{t}=(0,m.Bd)(),{name:s}=(0,sF.g)({strict:!1}),[r,i]=(0,l.useState)("agents"),[o,d]=(0,l.useState)(!1),[c,p]=(0,l.useState)(!1),u=(0,sR.Z)(),x=sg(),g=(0,n.jE)(),{data:y,isLoading:h}=(0,t2.I)({queryKey:["my-template",s],queryFn:()=>e.myTemplates.get(s)}),b=null==y?void 0:y.reviewStatus,f=!b||"draft"===b||"rejected"===b,v="rejected"===b,j=(0,t5.n)({mutationFn:()=>e.myTemplates.delete(s),onSuccess:()=>{g.invalidateQueries({queryKey:["my-templates"]}),x.success(t("templateDetail.templateDeleted")),u({to:"/my-templates"})},onError:()=>x.error(t("templateDetail.templateDeleteFailed"))}),N=(0,t5.n)({mutationFn:()=>e.community.publish(s),onSuccess:()=>{p(!1),g.invalidateQueries({queryKey:["my-template",s]}),g.invalidateQueries({queryKey:["my-templates"]}),x.success(t("templateDetail.publishSuccess"))},onError:()=>{p(!1),x.error(t("templateDetail.publishFailed"))}}),k=(0,l.useMemo)(()=>(null==y?void 0:y.content)?rM(y.content):[],[null==y?void 0:y.content]),w=null==y?void 0:y.content,C=null==w?void 0:w.deployments,S=null==C?void 0:C.namespace,A=(null==w?void 0:w.configurations)??(null==C?void 0:C.configurations),T=(null==w?void 0:w.providers)??(null==C?void 0:C.providers),D=[{id:"agents",label:t("templateDetail.agents"),count:k.length,icon:(0,a.jsx)(aU.A,{size:13})},{id:"editor",label:t("templateDetail.editor"),icon:(0,a.jsx)(rR.A,{size:13})},{id:"versions",label:t("templateDetail.versions"),count:null==y?void 0:y.version,icon:(0,a.jsx)(r_.A,{size:13})}];return h?(0,a.jsxs)("div",{className:"flex items-center justify-center py-20 text-sm text-text-muted",children:[(0,a.jsx)(tL.A,{size:18,className:"animate-spin mr-2"}),t("templateDetail.loadingTemplate")]}):y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(rW,{breadcrumbItems:[{label:t("templates.title"),to:"/my-templates"},{label:s}],heroIcon:(0,a.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border border-primary/20 bg-primary/10",children:(0,a.jsx)(rP.A,{size:24,className:"text-primary"})}),title:s,titleMeta:(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(Y,{variant:"neutral",size:"sm",children:["v",y.version??1]})}),description:y.templateSlug?t("templateDetail.forkedDescription",{name:y.templateSlug}):t("templateDetail.customDescription"),actions:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(L,{asChild:!0,variant:"primary",children:(0,a.jsxs)(tJ.N_,{to:"/store/$name/deploy",params:{name:y.templateSlug??s},children:[(0,a.jsx)(sZ.A,{size:14}),(0,a.jsx)("span",{children:t("common.deploy")})]})}),(!b||"draft"===b||"rejected"===b)&&(0,a.jsxs)(L,{type:"button",variant:"secondary",disabled:N.isPending,onClick:()=>p(!0),title:t("templateDetail.publishTooltip"),children:[(0,a.jsx)(sq.A,{size:12}),(0,a.jsx)("span",{children:N.isPending?t("templateDetail.publishing"):v?t("templateDetail.resubmitToCommunity"):t("templateDetail.publishToCommunity")})]}),(0,a.jsxs)(L,{type:"button",onClick:()=>d(!0),variant:"ghost",children:[(0,a.jsx)(sJ.A,{size:14}),t("common.delete")]})]}),sidebar:(0,a.jsxs)(rH,{title:t("templateDetail.quickInfo"),items:[{icon:(0,a.jsx)(aU.A,{size:12}),label:t("templateDetail.agents"),value:(0,a.jsx)("span",{className:"font-medium text-text-primary",children:k.length})},{icon:(0,a.jsx)(tZ.A,{size:12}),label:t("clusters.namespace"),value:(0,a.jsx)("span",{className:"font-mono text-text-primary",children:S??t("common.none")})},{icon:(0,a.jsx)(t1.A,{size:12}),label:t("templateDetail.configurations"),value:Array.isArray(A)?A.length:0},{icon:(0,a.jsx)(rF.A,{size:12}),label:t("templateDetail.providers"),value:Array.isArray(T)?T.length:0}],children:["rejected"===y.reviewStatus&&y.reviewNote?(0,a.jsxs)("div",{className:"mt-1 rounded-lg border border-red-800/40 bg-red-900/20 p-3",children:[(0,a.jsxs)("p",{className:"mb-1 flex items-center gap-1.5 text-xs font-semibold text-red-400",children:[(0,a.jsx)(rt.A,{size:11}),t("templateDetail.reviewNoteLabel")]}),(0,a.jsx)("p",{className:"text-xs leading-relaxed text-red-300",children:y.reviewNote})]}):null,y.templateSlug?(0,a.jsxs)("div",{className:"space-y-2 border-t border-border-subtle pt-3",children:[(0,a.jsxs)("div",{className:"text-[11px] font-semibold text-text-muted flex items-center gap-1.5",children:[(0,a.jsx)(rz.A,{size:12}),(0,a.jsx)("span",{children:t("templateDetail.forkedFrom")})]}),(0,a.jsx)(tJ.N_,{to:"/store/$name",params:{name:y.templateSlug},className:"text-sm text-text-secondary transition-colors hover:text-primary",children:y.templateSlug})]}):null]}),tabs:D,activeTab:r,onTabChange:i,children:(0,a.jsxs)(eS,{className:"rounded-3xl p-6",children:["agents"===r&&(0,a.jsx)(rB,{agents:k,emptyTitle:t("templateDetail.noAgents"),emptyDescription:t("templateDetail.noAgents"),introText:t("templateDetail.agentsInTemplate",{count:k.length})}),"editor"===r&&(0,a.jsxs)(a.Fragment,{children:[!f&&(0,a.jsxs)("div",{className:t$("mb-4 rounded-lg border p-3 flex items-center gap-2 text-sm","pending"===b?"bg-yellow-900/20 border-yellow-800/40 text-yellow-300":"bg-blue-900/20 border-blue-800/40 text-blue-300"),children:[(0,a.jsx)(rt.A,{size:14}),"pending"===b?t("templateDetail.editorLockedPending"):t("templateDetail.editorLockedApproved")]}),(0,a.jsx)(rJ,{name:s,content:y.content,templateSlug:y.templateSlug,readOnly:!f})]}),"versions"===r&&(0,a.jsx)(rQ,{name:s})]})}),(0,a.jsx)(U,{open:o,onOpenChange:d,children:(0,a.jsxs)(M,{children:[(0,a.jsxs)(V,{children:[(0,a.jsx)(B,{children:t("common.delete")}),(0,a.jsx)(K,{children:t("templates.deleteConfirm",{name:s})})]}),(0,a.jsxs)(q,{children:[(0,a.jsx)(W,{asChild:!0,children:(0,a.jsx)(L,{variant:"ghost",children:t("common.cancel")})}),(0,a.jsx)(H,{asChild:!0,children:(0,a.jsx)(L,{variant:"danger",loading:j.isPending,onClick:()=>j.mutate(),children:t("common.delete")})})]})]})}),(0,a.jsx)(U,{open:c,onOpenChange:p,children:(0,a.jsxs)(M,{children:[(0,a.jsxs)(V,{children:[(0,a.jsx)(B,{children:v?t("templateDetail.resubmitConfirmTitle"):t("templateDetail.publishConfirmTitle")}),(0,a.jsx)(K,{children:v?t("templateDetail.resubmitConfirmDescription"):t("templateDetail.publishConfirmDescription")})]}),(0,a.jsxs)(q,{children:[(0,a.jsx)(W,{asChild:!0,children:(0,a.jsx)(L,{variant:"ghost",children:t("common.cancel")})}),(0,a.jsx)(H,{asChild:!0,children:(0,a.jsxs)(L,{variant:"primary",loading:N.isPending,onClick:()=>N.mutate(),children:[(0,a.jsx)(sq.A,{size:14}),v?t("templateDetail.resubmitToCommunity"):t("templateDetail.publishToCommunity")]})})]})]})})]}):(0,a.jsx)(ar,{breadcrumb:[{label:t("templates.title"),to:"/my-templates"},{label:s}],breadcrumbPosition:"inside",narrow:!0,title:s,description:t("templateDetail.missingTemplateDescription",{name:s}),actions:(0,a.jsx)(L,{asChild:!0,variant:"primary",size:"sm",children:(0,a.jsx)(tJ.N_,{to:"/my-templates",children:t("templateDetail.backToTemplates")})}),children:(0,a.jsx)(s1,{title:t("storeDetail.templateNotFound"),description:t("templateDetail.missingTemplateDescription",{name:s})})})})}),nW=nC.addChildren([nS,nA,nT,nD,nP,n_,nR,nF,nz,nI,nE,nL,nU,nO,n$,nM,nV,nB,nq,nK,nH]),nJ=(0,N.a)({routeTree:nW}),nQ=new r.E({defaultOptions:{queries:{staleTime:5e3,retry:1,refetchOnWindowFocus:!1},mutations:{retry:0}}}),nG=document.getElementById("root");if(!nG)throw Error("Root element not found");(0,o.createRoot)(nG).render((0,a.jsx)(l.StrictMode,{children:(0,a.jsxs)(n.Ht,{client:nQ,children:[(0,a.jsx)(function(){let e=h(e=>e.theme);return(0,l.useEffect)(()=>{if(b(e),"system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),s=()=>b("system");return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[e]),null},{}),(0,a.jsx)(i.p,{router:nJ})]})}))}},o={};function d(e){var t=o[e];if(void 0!==t)return t.exports;var s=o[e]={exports:{}};return l[e](s,s.exports,d),s.exports}d.m=l,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,d.t=function(s,a){if(1&a&&(s=this(s)),8&a||"object"==typeof s&&s&&(4&a&&s.__esModule||16&a&&"function"==typeof s.then))return s;var r=Object.create(null);d.r(r);var n={};e=e||[null,t({}),t([]),t(t)];for(var i=2&a&&s;("object"==typeof i||"function"==typeof i)&&!~e.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach(e=>{n[e]=()=>s[e]});return n.default=()=>s,d.d(r,n),r},d.d=(e,t)=>{for(var s in t)d.o(t,s)&&!d.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},d.f={},d.e=e=>Promise.all(Object.keys(d.f).reduce((t,s)=>(d.f[s](e,t),t),[])),d.u=e=>"static/js/async/"+e+"."+({1008:"4df521b7",102:"1d473ec7",1134:"3f9fd9e7",1318:"4b8e48e7",1360:"5606da88",1546:"045f484f",1562:"187de2a8",168:"456d4813",1750:"e6dc2664",1994:"3fc86066",2348:"613ae3d9",2390:"1b890b9d",2414:"9d040212",2454:"4c1784ab",2498:"f5f92030",2924:"b823cd1a",3062:"63fddea6",3078:"dd712008",3198:"1f307065",3246:"3d5a899f",3286:"871676eb",342:"10bf3b90",3446:"9681a4d7",3698:"ccfaabec",3790:"2a1106a6",4231:"b29784d4",4551:"515bd41d",4596:"40f6e71b",4600:"4aaebe6d",4718:"1aae022f",4846:"a347c020",4860:"83dadf89",500:"fcfa37cb",5096:"b360203d",5222:"043274fe",5362:"f498001c",54:"c94f0755",5478:"50dd9ef0",5638:"bc6b102d",5722:"e0029049",5942:"74635c6b",5994:"1c5629c1",6054:"6bddf720",6118:"45e754e5",6127:"adcbcbb6",614:"3f434c20",6234:"ba3b002d",6310:"6546a9ba",6378:"9f805419",6380:"e4433c49",6418:"f23bcfda",6428:"77c86114",6443:"83318a6c",6508:"2b445d62",6542:"e82a26c8",6544:"62111ecb",6612:"a0c9fcf4",6740:"695aebf0",6822:"dbbb32bc",6824:"ad3540ab",6930:"585dab94",6982:"c81b95e6",7046:"ab2378c1",7110:"a603277f",7142:"4a21366f",7348:"15cc6148",7374:"b1ac5c44",742:"847f17ca",7446:"743954d8",7673:"59bbbaac",7684:"c5760c8c",7714:"c30d0f94",8118:"36d5a3bf",8246:"408de938",8390:"bdae1f7d",8422:"fd94dbe1",8434:"94a0e2ae",8518:"3158de13",8564:"fc2eb841",8678:"73af4c9b",8694:"79747168",8756:"1de37b83",8804:"7fe6bdf9",8886:"fe6e876c",9030:"fc1ae402",9094:"5598d084",9218:"ee7b84b7",94:"9b80bc35",9526:"92aba34c",9762:"f83bc4f3",984:"e11c113a",9846:"246653cd"})[e]+".js",d.miniCssF=e=>""+e+".css",d.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s={},d.l=function(e,t,a,r){if(s[e])return void s[e].push(t);if(void 0!==a)for(var n,i,l=document.getElementsByTagName("script"),o=0;o<l.length;o++){var c=l[o];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@shadowob/cloud:"+a){n=c;break}}n||(i=!0,(n=document.createElement("script")).timeout=120,d.nc&&n.setAttribute("nonce",d.nc),n.setAttribute("data-rspack","@shadowob/cloud:"+a),n.src=e),s[e]=[t];var m=function(t,a){n.onerror=n.onload=null,clearTimeout(p);var r=s[e];if(delete s[e],n.parentNode&&n.parentNode.removeChild(n),r&&r.forEach(function(e){return e(a)}),t)return t(a)},p=setTimeout(m.bind(null,void 0,{type:"timeout",target:n}),12e4);n.onerror=m.bind(null,n.onerror),n.onload=m.bind(null,n.onload),i&&document.head.appendChild(n)},d.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.nc=void 0,a=[],d.O=(e,t,s,r)=>{if(t){r=r||0;for(var n=a.length;n>0&&a[n-1][2]>r;n--)a[n]=a[n-1];a[n]=[t,s,r];return}for(var i=1/0,n=0;n<a.length;n++){for(var[t,s,r]=a[n],l=!0,o=0;o<t.length;o++)(!1&r||i>=r)&&Object.keys(d.O).every(e=>d.O[e](t[o]))?t.splice(o--,1):(l=!1,r<i&&(i=r));if(l){a.splice(n--,1);var c=s();void 0!==c&&(e=c)}}return e},d.p="/",d.b=document.baseURI||self.location.href,r={8410:0},d.f.j=function(e,t){var s=d.o(r,e)?r[e]:void 0;if(0!==s)if(s)t.push(s[2]);else{var a=new Promise((t,a)=>s=r[e]=[t,a]);t.push(s[2]=a);var n=d.p+d.u(e),i=Error();d.l(n,function(t){if(d.o(r,e)&&(0!==(s=r[e])&&(r[e]=void 0),s)){var a=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+a+": "+n+")",i.name="ChunkLoadError",i.type=a,i.request=n,s[1](i)}},"chunk-"+e,e)}},d.O.j=e=>0===r[e],n=(e,t)=>{var s,a,[n,i,l]=t,o=0;if(n.some(e=>0!==r[e])){for(s in i)d.o(i,s)&&(d.m[s]=i[s]);if(l)var c=l(d)}for(e&&e(t);o<n.length;o++)a=n[o],d.o(r,a)&&r[a]&&r[a][0](),r[a]=0;return d.O(c)},(i=self.webpackChunk_shadowob_cloud=self.webpackChunk_shadowob_cloud||[]).forEach(n.bind(null,0)),i.push=n.bind(null,i.push.bind(i));var c=d.O(void 0,["9783","7426","5079"],()=>d(65639));c=d.O(c)})();