tower-studio 0.2.21 → 0.2.23

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 (212) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +25 -25
  13. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  17. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  32. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +55 -55
  33. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  35. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  36. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +25 -25
  37. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  40. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +25 -25
  41. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  44. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +106 -82
  45. package/.next/standalone/.next/server/app/settings/page.js +2 -2
  46. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  48. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  49. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +86 -86
  50. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  52. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  53. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +80 -80
  54. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  57. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +63 -63
  58. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  61. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +59 -59
  62. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
  66. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +62 -62
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +68 -68
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  76. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  77. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +45 -45
  78. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +5 -5
  81. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
  82. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +2 -2
  83. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +2 -2
  84. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05~g1fm._.js +1 -1
  85. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +2 -2
  86. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_6swdz._.js +1 -1
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0hc9vir._.js +1 -1
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3iihg._.js +1 -1
  89. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0otyifi._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q.piu~._.js +2 -2
  91. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qdvear._.js +1 -1
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sy6lau._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0umocfj._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xot7fu._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z-k6vg._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  100. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0hy3~f.._.js → [root-of-the-server]__0-o.l41._.js} +2 -2
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02-6df-._.js +3 -3
  102. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0th0_fo._.js → [root-of-the-server]__03e009u._.js} +4 -4
  103. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e_-mj-._.js +3 -3
  104. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fzkdjl._.js +3 -3
  105. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jti4~k._.js +3 -0
  106. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pu-v0l._.js +3 -3
  108. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0q-abig._.js → [root-of-the-server]__0s-a4ku._.js} +2 -2
  109. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ty1ao1._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0um1ugs._.js +3 -3
  111. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__10ol5vl._.js → [root-of-the-server]__12p2zz2._.js} +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_xv.._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vgkq5._.js +3 -3
  115. package/.next/standalone/.next/server/chunks/ssr/_0-9.ea2._.js +3 -0
  116. package/.next/standalone/.next/server/chunks/ssr/_012.igw._.js +3 -0
  117. package/.next/standalone/.next/server/chunks/ssr/_0385-.g._.js +4 -0
  118. package/.next/standalone/.next/server/chunks/ssr/_04y89b3._.js +3 -0
  119. package/.next/standalone/.next/server/chunks/ssr/_04yogxq._.js +7 -0
  120. package/.next/standalone/.next/server/chunks/ssr/{_0rqf5w7._.js → _05xdaz3._.js} +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/{_0unw1fq._.js → _070t_mh._.js} +3 -3
  122. package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
  123. package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
  124. package/.next/standalone/.next/server/chunks/ssr/_0bk06da._.js +3 -0
  125. package/.next/standalone/.next/server/chunks/ssr/_0cc0gt8._.js +7 -0
  126. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/{_0aw2qq6._.js → _0hzckhd._.js} +2 -2
  128. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  129. package/.next/standalone/.next/server/chunks/ssr/_0m.4akk._.js +3 -0
  130. package/.next/standalone/.next/server/chunks/ssr/_0oq26rv._.js +3 -0
  131. package/.next/standalone/.next/server/chunks/ssr/_0r6gweb._.js +3 -3
  132. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/_0rt8jf_._.js +3 -3
  134. package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +1 -1
  135. package/.next/standalone/.next/server/chunks/ssr/_0uuzh5m._.js +3 -3
  136. package/.next/standalone/.next/server/chunks/ssr/_0z-b00b._.js +7 -0
  137. package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
  138. package/.next/standalone/.next/server/chunks/ssr/{_09j4imi._.js → _0~v4z8z._.js} +2 -2
  139. package/.next/standalone/.next/server/chunks/ssr/_10-.n35._.js +3 -0
  140. package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  150. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  151. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0153vha._.js → src_lib_0.aklj3._.js} +1 -1
  152. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  153. package/.next/standalone/.next/server/pages/500.html +1 -1
  154. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  155. package/.next/standalone/.next/server/server-reference-manifest.json +269 -245
  156. package/.next/standalone/.next/static/chunks/{0ol16355~utic.js → 0-.9k92iyul5o.js} +2 -2
  157. package/.next/standalone/.next/static/chunks/0.qj9vorfgtnt.js +1 -0
  158. package/.next/standalone/.next/static/chunks/00-6_m40h14vl.js +1 -0
  159. package/.next/standalone/.next/static/chunks/02.ihz-~spbi-.js +1 -0
  160. package/.next/standalone/.next/static/chunks/{0f1gk0.5slqqh.js → 04axhlp_leiii.js} +1 -1
  161. package/.next/standalone/.next/static/chunks/{0o8jf4a30e_ri.js → 05a6uzgclxdsk.js} +2 -2
  162. package/.next/standalone/.next/static/chunks/{01tnwkggn5.s-.js → 099eecj285cbx.js} +1 -1
  163. package/.next/standalone/.next/static/chunks/0c~0amyhws3l0.js +1 -0
  164. package/.next/standalone/.next/static/chunks/{05.wfh773dxo9.js → 0e8r37m0q.z0p.js} +1 -1
  165. package/.next/standalone/.next/static/chunks/0ik7-_3wrtspq.js +1 -0
  166. package/.next/standalone/.next/static/chunks/0ima0i0p489ty.js +1 -0
  167. package/.next/standalone/.next/static/chunks/{0rwca.wrfl3b9.js → 0p9zhbwmnn0j4.js} +1 -1
  168. package/.next/standalone/.next/static/chunks/{0pg_rf2cch5pv.js → 0rec91xfsdv8r.js} +1 -1
  169. package/.next/standalone/.next/static/chunks/0so-w5.m3jaxi.js +1 -0
  170. package/.next/standalone/.next/static/chunks/0x3tiuoe.l18z.js +1 -0
  171. package/.next/standalone/.next/static/chunks/{0j16~sj50uq_m.js → 0zfszxiw4cx9b.js} +1 -1
  172. package/.next/standalone/.next/static/chunks/0ztty8z0obk5f.js +1 -0
  173. package/.next/standalone/.next/static/chunks/1007_ur3fj.~m.js +1 -0
  174. package/.next/standalone/.next/static/chunks/{0aq7ksckxr-8-.js → 10r4y1zzk24jy.js} +2 -2
  175. package/.next/standalone/.next/static/chunks/10vl5vq1_rh1..js +1 -0
  176. package/.next/standalone/.next/static/chunks/120x-nmim1wfz.js +1 -0
  177. package/.next/standalone/.next/static/chunks/{0ip_37zz4f080.js → 12iivlft6u_tt.js} +1 -1
  178. package/.next/standalone/.next/static/chunks/134onqxk2foh5.js +5 -0
  179. package/.next/standalone/.next/static/chunks/{00p3.tda-56.l.js → 16r-tz37aqyoa.js} +1 -1
  180. package/.next/standalone/.next/static/chunks/{0srx~7bncp64q.js → 16ukg_cswejw4.js} +1 -1
  181. package/.next/standalone/.next/static/chunks/{0vyvdsh1mkl5d.js → 17n~0msyl8bur.js} +1 -1
  182. package/.next/standalone/package.json +1 -1
  183. package/dist/mcp-server.cjs +19 -5
  184. package/package.json +1 -1
  185. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q~lxnz._.js +0 -3
  186. package/.next/standalone/.next/server/chunks/ssr/_00jadm8._.js +0 -3
  187. package/.next/standalone/.next/server/chunks/ssr/_03.a~r1._.js +0 -3
  188. package/.next/standalone/.next/server/chunks/ssr/_053zyvm._.js +0 -3
  189. package/.next/standalone/.next/server/chunks/ssr/_08x3jaa._.js +0 -3
  190. package/.next/standalone/.next/server/chunks/ssr/_09r0_z9._.js +0 -3
  191. package/.next/standalone/.next/server/chunks/ssr/_0a554d8._.js +0 -3
  192. package/.next/standalone/.next/server/chunks/ssr/_0bmywa6._.js +0 -3
  193. package/.next/standalone/.next/server/chunks/ssr/_0ghovf3._.js +0 -4
  194. package/.next/standalone/.next/server/chunks/ssr/_0jyj~t3._.js +0 -7
  195. package/.next/standalone/.next/server/chunks/ssr/_0yakvlq._.js +0 -7
  196. package/.next/standalone/.next/server/chunks/ssr/_13r9dxk._.js +0 -7
  197. package/.next/standalone/.next/static/chunks/00fv~h4rni5hv.js +0 -1
  198. package/.next/standalone/.next/static/chunks/02bobmiee9ss8.js +0 -1
  199. package/.next/standalone/.next/static/chunks/039ntokp82-em.js +0 -1
  200. package/.next/standalone/.next/static/chunks/04yrp-8ps3q_-.js +0 -1
  201. package/.next/standalone/.next/static/chunks/06~1n6of8ll__.js +0 -5
  202. package/.next/standalone/.next/static/chunks/08rokhw7bg_zn.js +0 -1
  203. package/.next/standalone/.next/static/chunks/0_n2l3jehwcsq.js +0 -1
  204. package/.next/standalone/.next/static/chunks/0d4~4k4hv01ah.js +0 -1
  205. package/.next/standalone/.next/static/chunks/0pwe0m3i1rro1.js +0 -1
  206. package/.next/standalone/.next/static/chunks/10h~50kdsu5fx.js +0 -1
  207. package/.next/standalone/.next/static/chunks/15esfko8asvh7.js +0 -1
  208. package/.next/standalone/.next/static/chunks/16sn2ij01qrfz.js +0 -1
  209. package/.next/standalone/.next/static/chunks/17oxpxjm7_smn.js +0 -1
  210. /package/.next/standalone/.next/static/{zosKR5i2aA392qu0Ka1j9 → l8InE32VLIGdUBVP3BJKt}/_buildManifest.js +0 -0
  211. /package/.next/standalone/.next/static/{zosKR5i2aA392qu0Ka1j9 → l8InE32VLIGdUBVP3BJKt}/_clientMiddlewareManifest.js +0 -0
  212. /package/.next/standalone/.next/static/{zosKR5i2aA392qu0Ka1j9 → l8InE32VLIGdUBVP3BJKt}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,565893,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={assign:function(){return o},searchParamsToUrlQuery:function(){return s},urlQueryToSearchParams:function(){return l}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});function s(e){let t={};for(let[r,a]of e.entries()){let e=t[r];void 0===e?t[r]=a:Array.isArray(e)?e.push(a):t[r]=[e,a]}return t}function i(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function l(e){let t=new URLSearchParams;for(let[r,a]of Object.entries(e))if(Array.isArray(a))for(let e of a)t.append(r,i(e));else t.set(r,i(a));return t}function o(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,a]of r.entries())e.append(t,a)}return e}},204575,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={DecodeError:function(){return v},MiddlewareNotFoundError:function(){return k},MissingStaticPage:function(){return x},NormalizeError:function(){return y},PageNotFoundError:function(){return b},SP:function(){return p},ST:function(){return g},WEB_VITALS:function(){return s},execOnce:function(){return i},getDisplayName:function(){return u},getLocationOrigin:function(){return c},getURL:function(){return d},isAbsoluteUrl:function(){return o},isResSent:function(){return f},loadGetInitialProps:function(){return m},normalizeRepeatedSlashes:function(){return h},stringifyError:function(){return S}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=["CLS","FCP","FID","INP","LCP","TTFB"];function i(e){let t,r=!1;return(...a)=>(r||(r=!0,t=e(...a)),t)}let l=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>l.test(e);function c(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function d(){let{href:e}=window.location,t=c();return e.substring(t.length)}function u(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function h(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function m(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await m(t.Component,t.ctx)}:{};let a=await e.getInitialProps(t);if(r&&f(r))return a;if(!a)throw Object.defineProperty(Error(`"${u(e)}.getInitialProps()" should resolve to an object. But found "${a}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return a}let p="u">typeof performance,g=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class v extends Error{}class y extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class x extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class k extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function S(e){return JSON.stringify({message:e.message,stack:e.stack})}},619172,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return a}});let a=e=>{}},339733,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40c62fb00530ae3e071a18e1b5cc7097b2ce49490b",t.callServer,void 0,t.findSourceMapURL,"getLabelsForWorkspace");e.s(["getLabelsForWorkspace",0,r])},464249,e=>{"use strict";let t=(0,e.i(572989).default)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);e.s(["Pencil",0,t],464249)},821957,e=>{"use strict";var t=e.i(965652),r=(e,t,r,a,n,s,i,l)=>{let o=document.documentElement,c=["light","dark"];function d(t){var r;(Array.isArray(e)?e:[e]).forEach(e=>{let r="class"===e,a=r&&s?n.map(e=>s[e]||e):n;r?(o.classList.remove(...a),o.classList.add(s&&s[t]?s[t]:t)):o.setAttribute(e,t)}),r=t,l&&c.includes(r)&&(o.style.colorScheme=r)}if(a)d(a);else try{let e=localStorage.getItem(t)||r,a=i&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;d(a)}catch(e){}},a=["light","dark"],n="(prefers-color-scheme: dark)",s="u"<typeof window,i=t.createContext(void 0),l={setTheme:e=>{},themes:[]},o=["light","dark"],c=({forcedTheme:e,disableTransitionOnChange:r=!1,enableSystem:s=!0,enableColorScheme:l=!0,storageKey:c="theme",themes:m=o,defaultTheme:p=s?"system":"light",attribute:g="data-theme",value:v,children:y,nonce:b,scriptProps:x})=>{let[k,S]=t.useState(()=>u(c,p)),[w,C]=t.useState(()=>"system"===k?h():k),j=v?Object.values(v):m,E=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&s&&(t=h());let n=v?v[t]:t,i=r?f(b):null,o=document.documentElement,c=e=>{"class"===e?(o.classList.remove(...j),n&&o.classList.add(n)):e.startsWith("data-")&&(n?o.setAttribute(e,n):o.removeAttribute(e))};if(Array.isArray(g)?g.forEach(c):c(g),l){let e=a.includes(p)?p:null,r=a.includes(t)?t:e;o.style.colorScheme=r}null==i||i()},[b]),N=t.useCallback(e=>{let t="function"==typeof e?e(k):e;S(t);try{localStorage.setItem(c,t)}catch(e){}},[k]),M=t.useCallback(t=>{C(h(t)),"system"===k&&s&&!e&&E("system")},[k,e]);t.useEffect(()=>{let e=window.matchMedia(n);return e.addListener(M),M(e),()=>e.removeListener(M)},[M]),t.useEffect(()=>{let e=e=>{e.key===c&&(e.newValue?S(e.newValue):N(p))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[N]),t.useEffect(()=>{E(null!=e?e:k)},[e,k]);let P=t.useMemo(()=>({theme:k,setTheme:N,forcedTheme:e,resolvedTheme:"system"===k?w:k,themes:s?[...m,"system"]:m,systemTheme:s?w:void 0}),[k,N,e,w,s,m]);return t.createElement(i.Provider,{value:P},t.createElement(d,{forcedTheme:e,storageKey:c,attribute:g,enableSystem:s,enableColorScheme:l,defaultTheme:p,value:v,themes:m,nonce:b,scriptProps:x}),y)},d=t.memo(({forcedTheme:e,storageKey:a,attribute:n,enableSystem:s,enableColorScheme:i,defaultTheme:l,value:o,themes:c,nonce:d,scriptProps:u})=>{let f=JSON.stringify([n,a,l,e,c,o,s,i]).slice(1,-1);return t.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"u"<typeof window?d:"",dangerouslySetInnerHTML:{__html:`(${r.toString()})(${f})`}})}),u=(e,t)=>{let r;if(!s){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},h=e=>(e||(e=window.matchMedia(n)),e.matches?"dark":"light");e.s(["ThemeProvider",0,e=>t.useContext(i)?t.createElement(t.Fragment,null,e.children):t.createElement(c,{...e}),"useTheme",0,()=>{var e;return null!=(e=t.useContext(i))?e:l}])},392970,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("00c3f4a8b16c1e7967c2458b5e9b7fd2b57d9bcf6b",t.callServer,void 0,t.findSourceMapURL,"getActualWsPort");e.s(["getActualWsPort",0,r])},966001,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(938499),n=e.i(194358),s=e.i(519455);class i extends r.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error("[ErrorBoundary]",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 p-8 text-center",children:[(0,t.jsx)(a.AlertCircle,{className:"h-8 w-8 text-destructive"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Something went wrong"}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:this.state.error?.message??"An unexpected error occurred"})]}),(0,t.jsxs)(s.Button,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:[(0,t.jsx)(n.RefreshCw,{className:"mr-2 h-3.5 w-3.5"}),"Retry"]})]}):this.props.children}}e.s(["ErrorBoundary",0,i])},570835,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40ca362c38454d1a8b11e77c4e837e440da6547f6f",t.callServer,void 0,t.findSourceMapURL,"installExtension");e.s(["installExtension",0,r])},812983,e=>{"use strict";let t=(0,e.i(572989).default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]);e.s(["FileCode",0,t],812983)},887911,e=>{"use strict";var t=e.i(738690),r=e.i(812983);let a={rg:{id:"rg",name:"代码搜索 (ripgrep)",description:"基于 rg 的全文代码搜索",icon:t.Search,sizeMB:5,homepageUrl:"https://github.com/BurntSushi/ripgrep#installation",manualInstall:!0},monaco:{id:"monaco",name:"代码编辑器 (Monaco)",description:"VS Code 同款 Web 编辑器",icon:r.FileCode,sizeMB:15,homepageUrl:"https://microsoft.github.io/monaco-editor/"}},n=[a.rg,a.monaco];e.s(["listExtensionMetadata",0,function(){return n}])},288285,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("600ac086d615749a75443aa273f648b191a575c17d",t.callServer,void 0,t.findSourceMapURL,"setConfigValue");e.s(["setConfigValue",0,r])},387091,15299,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,r],387091);let a=(0,t.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,a],15299)},699375,e=>{"use strict";var t,r=e.i(289721);e.s([],159880),e.i(159880),e.i(708878);var a=e.i(965652),n=e.i(314757),s=e.i(887642),i=e.i(362891),l=e.i(804849),o=e.i(416369),c=e.i(954588),d=e.i(581263),u=e.i(565455),f=e.i(207516),h=e.i(282109),m=e.i(462902);let p=a.createContext(void 0);var g=e.i(551974);let v=((t={}).checked="data-checked",t.unchecked="data-unchecked",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),y={...g.fieldValidityMapping,checked:e=>e?{[v.checked]:""}:{[v.unchecked]:""}};var b=e.i(421689),x=e.i(890514),k=e.i(571870),S=e.i(179279),w=e.i(103353),C=e.i(67077),j=e.i(586622),E=e.i(353052);let N=a.forwardRef(function(e,t){let{checked:m,className:g,defaultChecked:v,"aria-labelledby":N,id:M,inputRef:P,name:T,nativeButton:O=!1,onCheckedChange:I,readOnly:R=!1,required:L=!1,disabled:F=!1,render:A,uncheckedValue:z,value:D,...V}=e,{clearErrors:B}=(0,k.useFormContext)(),{state:U,setTouched:_,setDirty:H,validityData:$,setFilled:K,setFocused:J,shouldValidateOnChange:q,validationMode:W,disabled:G,name:Y,validation:Z}=(0,x.useFieldRootContext)(),{labelId:Q}=(0,S.useLabelableContext)(),X=G||F,ee=Y??T,et=(0,s.useStableCallback)(I),er=a.useRef(null),ea=(0,i.useMergedRefs)(er,P,Z.inputRef),en=a.useRef(null),es=(0,f.useBaseUiId)(),ei=(0,w.useLabelableId)({id:M,implicit:!1,controlRef:en}),el=O?void 0:ei,[eo,ec]=(0,n.useControlled)({controlled:m,default:!!v,name:"Switch",state:"checked"});(0,b.useField)({id:es,commit:Z.commit,value:eo,controlRef:en,name:ee,getValue:()=>eo}),(0,l.useIsoLayoutEffect)(()=>{er.current&&K(er.current.checked)},[er,K]),(0,E.useValueChanged)(eo,()=>{B(ee),H(eo!==$.initialValue),K(eo),q()?Z.commit(eo):Z.commit(eo,!0)});let{getButtonProps:ed,buttonRef:eu}=(0,h.useButton)({disabled:X,native:O}),ef=function(e,t,r,n=!0,s){let[i,o]=a.useState(),c=(0,f.useBaseUiId)(s?`${s}-label`:void 0),d=e??t??i;return(0,l.useIsoLayoutEffect)(()=>{let a=e||t||!n?void 0:function(e,t){let r=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let r=e.id;if(r){let t=e.nextElementSibling;if(t&&t.htmlFor===r)return t}let a=e.labels;return a&&a[0]}(e);if(r)return!r.id&&t&&(r.id=t),r.id||void 0}(r.current,c);i!==a&&o(a)}),d}(N,Q,er,!O,el),eh=a.useMemo(()=>(0,u.mergeProps)({checked:eo,disabled:X,id:el,name:ee,required:L,style:ee?o.visuallyHiddenInput:o.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:ea,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,r=(0,C.createChangeEventDetails)(j.REASONS.none,e.nativeEvent);et?.(t,r),r.isCanceled||ec(t)},onFocus(){en.current?.focus()}},Z.getInputValidationProps,void 0!==D?{value:D}:c.EMPTY_OBJECT),[eo,X,ea,el,ee,et,L,ec,Z,D]),em=a.useMemo(()=>({...U,checked:eo,disabled:X,readOnly:R,required:L}),[U,eo,X,R,L]),ep=(0,d.useRenderElement)("span",e,{state:em,ref:[t,en,eu],props:[{id:O?ei:es,role:"switch","aria-checked":eo,"aria-readonly":R||void 0,"aria-required":L||void 0,"aria-labelledby":ef,onFocus(){X||J(!0)},onBlur(){let e=er.current;e&&!X&&(_(!0),J(!1),"onBlur"===W&&Z.commit(e.checked))},onClick(e){R||X||(e.preventDefault(),er.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},Z.getValidationProps,V,ed],stateAttributesMapping:y});return(0,r.jsxs)(p.Provider,{value:em,children:[ep,!eo&&ee&&void 0!==z&&(0,r.jsx)("input",{type:"hidden",name:ee,value:z}),(0,r.jsx)("input",{...eh})]})}),M=a.forwardRef(function(e,t){let{render:r,className:n,...s}=e,{state:i}=(0,x.useFieldRootContext)(),l=function(){let e=a.useContext(p);if(void 0===e)throw Error((0,m.default)(63));return e}(),o={...i,...l};return(0,d.useRenderElement)("span",e,{state:o,ref:t,stateAttributesMapping:y,props:s})});e.s(["Root",0,N,"Thumb",0,M],803205);var P=e.i(803205),P=P,T=e.i(975157);e.s(["Switch",0,function({className:e,size:t="default",...a}){return(0,r.jsx)(P.Root,{"data-slot":"switch","data-size":t,className:(0,T.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...a,children:(0,r.jsx)(P.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}],699375)},263938,e=>{"use strict";let t=(0,e.i(572989).default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);e.s(["Tag",0,t],263938)},989548,338187,e=>{"use strict";let t=(0,e.i(572989).default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",0,t],989548);var r=e.i(289721),a=e.i(965652),n=e.i(715207);let s="tower-assistant-sessions",i="tower-assistant-active-session";function l(){try{let e=localStorage.getItem(s);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t}catch{return[]}}function o(){return localStorage.getItem(i)}function c(e){null===e?localStorage.removeItem(i):localStorage.setItem(i,e)}let d=(0,a.createContext)(null);function u(){return"u">typeof crypto&&crypto.randomUUID?crypto.randomUUID():`msg-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}let f="assistant-attachment-cache";function h(e,t,r){try{let a=sessionStorage.getItem(f),n=a?JSON.parse(a):{};n[e]||(n[e]={}),n[e][t]=r,sessionStorage.setItem(f,JSON.stringify(n))}catch{}}e.s(["AssistantProvider",0,function({children:e}){let[t,i]=(0,a.useState)(!1),[m,p]=(0,a.useState)(!1),[g,v]=(0,a.useState)("sidebar"),[y,b]=(0,a.useState)(null),[x,k]=(0,a.useState)([]),[S,w]=(0,a.useState)("idle"),[C,j]=(0,a.useState)(!1),E=(0,a.useRef)([]),N=(0,a.useRef)(null),M=(0,a.useRef)(null),[P,T]=(0,a.useState)([]),[O,I]=(0,a.useState)(null),R=(0,a.useRef)(!1),L=(0,a.useCallback)(()=>{k([...E.current])},[]),F=(0,a.useCallback)(async()=>{v("dialog"===await (0,n.getConfigValue)("assistant.displayMode","sidebar")?"dialog":"sidebar")},[]);(0,a.useEffect)(()=>{F()},[F]);let A=(0,a.useCallback)(async()=>{T(l())},[]),z=(0,a.useCallback)(async e=>{j(!0);try{let t=await fetch(`/api/internal/assistant/sessions?sessionId=${encodeURIComponent(e)}`);if(!t.ok)return;let r=await t.json();if(Array.isArray(r.messages)){E.current=r.messages;let t=function(e){try{let t=sessionStorage.getItem(f);if(!t)return{};return JSON.parse(t)[e]??{}}catch{return{}}}(e);if(Object.keys(t).length>0){let e=0;E.current=E.current.map(r=>{if("user"===r.role){let a=t[e];if(e++,a?.length)return{...r,attachmentFilenames:a}}return r})}k([...E.current])}}catch{}finally{j(!1)}},[]);(0,a.useEffect)(()=>{A();let e=o();e&&(I(e),N.current=e,z(e))},[A,z]);let D=(0,a.useCallback)(()=>{M.current?.abort(),N.current=null,R.current=!1,I(null),c(null),E.current=[],k([]),w("idle")},[]),V=(0,a.useCallback)(e=>{M.current?.abort(),N.current=e,R.current=!0,I(e),c(e),E.current=[],k([]),w("idle"),z(e)},[z]),B=(0,a.useCallback)(e=>{let t;t=l().filter(t=>t.id!==e),localStorage.setItem(s,JSON.stringify(t)),o()===e&&c(null),T(l()),O===e&&D()},[O,D]),U=(0,a.useCallback)(async()=>{p(!0);try{await F(),i(!0)}finally{p(!1)}},[F]),_=(0,a.useCallback)(()=>{i(!1),M.current?.abort()},[]),H=(0,a.useCallback)(()=>{t||m?_():U()},[t,m,_,U]);(0,a.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"l"===e.key&&(e.preventDefault(),H())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[H]);let $=(0,a.useCallback)(async(e,t)=>{if(!e.trim()&&!t?.attachmentFilenames?.length)return;M.current?.abort();let r=new AbortController;M.current=r;let a=0!==E.current.length||R.current?null:e,n=u();if(E.current=[...E.current,{id:u(),role:"user",content:e,attachmentFilenames:t?.attachmentFilenames?.length?t.attachmentFilenames:void 0},{id:n,role:"thinking",content:"",isStreaming:!0}],L(),t?.attachmentFilenames?.length&&N.current){let e=E.current.filter(e=>"user"===e.role).length-1;h(N.current,e,t.attachmentFilenames)}w("connecting");let i=null;try{let o=await fetch("/api/internal/assistant/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e,sessionId:N.current,attachmentFilenames:t?.attachmentFilenames??[]}),signal:r.signal});if(!o.ok||!o.body)throw Error(`HTTP ${o.status}`);w("streaming");let d=o.body.getReader(),f=new TextDecoder,m="";for(;;){let{done:e,value:r}=await d.read();if(e)break;let o=(m+=f.decode(r,{stream:!0})).split("\n");for(let e of(m=o.pop()??"",o)){let r;if(e.startsWith("data: ")){try{r=JSON.parse(e.slice(6).trim())}catch{continue}if(r.sessionId){let e=N.current;if(N.current=r.sessionId,a&&!R.current&&r.sessionId!==e){R.current=!0;let e=new Date().toISOString(),n={id:r.sessionId,title:function(e){let t=e.trim();return t?t.length>30?t.slice(0,30):t:"New Session"}(a),createdAt:e,updatedAt:e};!function(e){let t=[e,...l().filter(t=>t.id!==e.id)].slice(0,10);localStorage.setItem(s,JSON.stringify(t))}(n),T(l()),I(r.sessionId),c(r.sessionId),t?.attachmentFilenames?.length&&h(r.sessionId,0,t.attachmentFilenames)}}switch(r.type){case"text_delta":{let e=E.current.filter(e=>e.id!==n);i?E.current=e.map(e=>e.id===i?{...e,content:e.content+(r.content??""),isStreaming:!0}:e):(i=u(),E.current=[...e,{id:i,role:"assistant",content:r.content??"",isStreaming:!0}]),L();break}case"text":{let e=E.current.filter(e=>e.id!==n);i?E.current=e.map(e=>e.id===i?{...e,content:r.content??e.content,isStreaming:!0}:e):(i=u(),E.current=[...e,{id:i,role:"assistant",content:r.content??"",isStreaming:!0}]),L();break}case"tool_start":{let e=E.current.filter(e=>e.id!==n);i?(E.current=e.map(e=>e.id===i?{...e,isStreaming:!1}:e),i=null):E.current=e,E.current=[...E.current,{id:u(),role:"tool",content:`Calling ${r.content??"tool"}...`,toolName:r.content,isStreaming:!0}],L();break}case"tool_use":{let e=E.current.filter(e=>e.id!==n),t=i?e.map(e=>e.id===i?{...e,isStreaming:!1}:e):e;i=null,E.current=[...t,{id:u(),role:"tool",content:JSON.stringify(r.toolInput??{},null,2),toolName:r.content}],L();break}case"tool_result":E.current=[...E.current,{id:u(),role:"tool",content:String(r.toolOutput??""),toolName:`${r.content??"tool"} (result)`}],L();break;case"error":E.current=[...E.current.filter(e=>e.id!==n),{id:u(),role:"assistant",content:`Error: ${r.content??"Unknown error"}`}],L(),w("error");break;case"done":i&&(E.current=E.current.map(e=>e.id===i?{...e,isStreaming:!1}:e)),E.current=E.current.filter(e=>e.id!==n),L(),w("idle")}}}}E.current=E.current.filter(e=>e.id!==n),L(),w(e=>"streaming"===e?"idle":e),A()}catch(e){if("AbortError"===e.name)return;E.current=[...E.current.filter(e=>e.id!==n),{id:u(),role:"assistant",content:`Connection error: ${e.message??"Unknown error"}`}],L(),w("error")}},[L,A]),K=(0,a.useCallback)(()=>{M.current?.abort(),M.current=null;let e=[...E.current].reverse().find(e=>"user"===e.role),t=e?.content??null;if(e){let t=E.current.lastIndexOf(e);E.current=E.current.slice(0,t),k([...E.current])}return w("idle"),t},[]),J=x[x.length-1],q="connecting"===S||"streaming"===S||J?.role==="thinking"&&!0===J.isStreaming;return(0,r.jsx)(d.Provider,{value:{isOpen:t,isStarting:m,displayMode:g,worktreePath:y,toggleAssistant:H,closeAssistant:_,chatMessages:x,chatStatus:S,isChatThinking:q,isLoadingHistory:C,sendChatMessage:$,cancelChat:K,sessions:P,activeSessionId:O,createNewSession:D,switchSession:V,removeSession:B,refreshSessions:A},children:e})},"useAssistant",0,function(){let e=(0,a.useContext)(d);if(!e)throw Error("useAssistant must be used within an AssistantProvider");return e}],338187)},275360,e=>{"use strict";let t=(0,e.i(572989).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",0,t],275360)},431828,763131,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);e.s(["FolderGit2",0,r],431828);let a=(0,t.default)("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]);e.s(["Home",0,a],763131)},256753,e=>{"use strict";let t=(0,e.i(572989).default)("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]);e.s(["HardDrive",0,t],256753)},224277,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(977982),n=e.i(431828),s=e.i(763131),i=e.i(472074),l=e.i(738690),o=e.i(256753),c=e.i(275360),d=e.i(597746),u=e.i(657153),f=e.i(776639),h=e.i(519455),m=e.i(793479),p=e.i(746798),g=e.i(533499),v=e.i(759684);e.s(["FolderBrowserDialog",0,function({open:e,onOpenChange:y,onSelect:b,gitOnly:x=!1}){let{t:k}=(0,g.useI18n)(),[S,w]=(0,r.useState)(null),[C,j]=(0,r.useState)(!1),[E,N]=(0,r.useState)(null),[M,P]=(0,r.useState)(""),[T,O]=(0,r.useState)(""),[I,R]=(0,r.useState)(!1),L=(0,r.useRef)(null),[F,A]=(0,r.useState)(!1),[z,D]=(0,r.useState)(""),V=(0,r.useRef)(null),B=(0,r.useCallback)(async e=>{j(!0),N(null),O(""),R(!1);try{let t=e?`/api/browse-fs?path=${encodeURIComponent(e)}`:"/api/browse-fs",r=await fetch(t);if(!r.ok){let e=await r.json();N(e.error||"Failed");return}let a=await r.json();w(a),P(a.currentPath)}catch{N("Failed to browse filesystem")}finally{j(!1)}},[]);(0,r.useEffect)(()=>{e&&(B(),setTimeout(()=>L.current?.focus(),200))},[e,B]);let U=()=>{M.trim()&&B(M.trim())},_=async()=>{let e=z.trim();if(e&&S?.currentPath)try{let t=await fetch("/api/browse-fs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({parentPath:S.currentPath,name:e})});if(!t.ok){let e=await t.json();N(e.error||k("folder.newFolderError"));return}A(!1),D(""),B(S.currentPath)}catch{N(k("folder.newFolderError"))}},H=()=>{A(!1),D("")},$=S?.folders.filter(e=>e.name.toLowerCase().includes(T.toLowerCase()))??[];return(0,t.jsx)(f.Dialog,{open:e,onOpenChange:y,children:(0,t.jsx)(f.DialogContent,{className:"p-0 gap-0",style:{maxWidth:"36rem",overflow:"hidden"},children:(0,t.jsxs)("div",{className:"flex flex-col max-h-[60vh] overflow-hidden",children:[(0,t.jsxs)("div",{className:"px-5 pt-5 pb-3 shrink-0",children:[(0,t.jsx)(f.DialogTitle,{children:x?k("folder.selectGitRepo"):k("folder.selectFolder")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:k("folder.hint")})]}),(0,t.jsxs)("div",{className:"border-t border-border px-4 pt-3 pb-2 shrink-0",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("folder.manualInput")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(m.Input,{ref:L,value:M,onChange:e=>P(e.target.value),onKeyDown:e=>"Enter"===e.key&&U(),placeholder:"/path/to/your/project",title:M,className:"flex-1 min-w-0"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:U,className:"h-8 px-3 shrink-0",children:k("folder.goTo")})]})]}),(0,t.jsxs)("div",{className:"px-4 py-2 shrink-0",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("folder.searchDir")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsx)(l.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("input",{value:T,onChange:e=>O(e.target.value),placeholder:"Filter folders and files...",className:"h-8 w-full rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 border-y border-border px-4 py-2 shrink-0 min-w-0",children:[(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>S?.homePath&&B(S.homePath),className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(s.Home,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Home"})]}),(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{S&&("__DRIVES__"===S.parentPath?R(!0):(R(!1),B(S.parentPath)))},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(i.ChevronUp,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Parent"})]}),S?.drives&&S.drives.length>0&&(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:I?"default":"outline",size:"icon-sm",onClick:()=>R(e=>!e),className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(o.HardDrive,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:"Drives"})]}),(0,t.jsxs)(p.Tooltip,{children:[(0,t.jsx)(p.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:()=>{A(!0),D(""),setTimeout(()=>V.current?.focus(),50)},className:"shrink-0 text-muted-foreground"}),children:(0,t.jsx)(c.FolderPlus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(p.TooltipContent,{side:"bottom",sideOffset:4,children:k("folder.newFolder")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 truncate text-sm text-foreground font-mono",title:S?.currentPath??"",children:S?.currentPath??"..."})]}),(0,t.jsxs)(v.ScrollArea,{className:"min-h-0 flex-1",children:[F&&(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b border-border/30 px-4 py-2",children:[(0,t.jsx)(a.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,t.jsx)("input",{ref:V,value:z,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&_(),"Escape"===e.key&&H()},placeholder:k("folder.newFolderPlaceholder"),className:"h-7 flex-1 rounded-md border border-border bg-background px-2 text-sm text-foreground placeholder-muted-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:_,disabled:!z.trim(),className:"text-emerald-400 hover:text-emerald-300",children:(0,t.jsx)(d.Check,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:H,className:"text-muted-foreground",children:(0,t.jsx)(u.X,{className:"h-3.5 w-3.5"})})]}),C&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}),E&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-rose-400",children:E}),I&&S?.drives&&S.drives.map(e=>(0,t.jsxs)("button",{onClick:()=>{var t;return t=e.path,void(R(!1),B(t))},className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)(o.HardDrive,{className:"h-4 w-4 text-blue-400 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:e.name}),(0,t.jsx)("span",{className:"shrink-0 text-xs text-muted-foreground",children:e.path})]},e.path)),!I&&!C&&!E&&0===$.length&&(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:k("folder.empty")}),!I&&!C&&!E&&$.map(e=>(0,t.jsxs)("button",{onClick:()=>{e.isGit||x?(b(e.path),y(!1)):B(e.path)},onDoubleClick:()=>B(e.path),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-2.5 text-left transition-colors hover:bg-accent last:border-b-0",children:[e.isGit?(0,t.jsx)(n.FolderGit2,{className:"h-4 w-4 text-emerald-400 shrink-0"}):(0,t.jsx)(a.Folder,{className:"h-4 w-4 text-primary/70 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",children:e.name}),e.isGit&&(0,t.jsx)("span",{className:"shrink-0 rounded-md bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400 ring-1 ring-emerald-500/20",children:"git"})]},e.path))]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 shrink-0 border-t border-border",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>y(!1),children:k("common.cancel")}),(0,t.jsx)(h.Button,{onClick:()=>{S?.currentPath&&(b(S.currentPath),y(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:k("folder.selectPath")})]})]})})})}])},905455,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["SegmentedControl",0,function({options:e,value:a,onChange:n,className:s}){return(0,t.jsx)("div",{className:(0,r.cn)("inline-flex rounded-md border border-border bg-muted p-1 gap-1",s),children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>n(e.value),className:(0,r.cn)("rounded px-3 py-1 text-sm transition-colors",a===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}])},902539,e=>{"use strict";let t=(0,e.i(572989).default)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);e.s(["ChevronsLeft",0,t],902539)},233274,e=>{"use strict";let t=(0,e.i(572989).default)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);e.s(["Sparkles",0,t],233274)},796997,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60c04f31783506683945f873bb2f23b60b545118bb",t.callServer,void 0,t.findSourceMapURL,"analyzeProjectDirectory");e.s(["analyzeProjectDirectory",0,r])},387292,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40a26582229b4a342d27d3eb6da88392b7e70836f4",t.callServer,void 0,t.findSourceMapURL,"createProject");e.s(["createProject",0,r])},232545,e=>{"use strict";let t=(0,e.i(572989).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,t],232545)},538059,(e,t,r)=>{t.exports=e.r(322195)},314757,e=>{"use strict";var t=e.i(965652);e.s(["useControlled",0,function({controlled:e,default:r,name:a,state:n="value"}){let{current:s}=t.useRef(void 0!==e),[i,l]=t.useState(r),o=t.useCallback(e=>{s||l(e)},[]);return[s?e:i,o]}])},890514,551974,e=>{"use strict";e.i(708878);var t,r=e.i(462902),a=e.i(965652),n=e.i(954588);let s=((t={}).disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t),i={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},l={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},o={disabled:!1,...l};e.s(["DEFAULT_FIELD_ROOT_STATE",0,o,"DEFAULT_FIELD_STATE_ATTRIBUTES",0,l,"DEFAULT_VALIDITY_STATE",0,i,"fieldValidityMapping",0,{valid:e=>null===e?null:e?{[s.valid]:""}:{[s.invalid]:""}}],551974);let c=a.createContext({invalid:void 0,name:void 0,validityData:{state:i,errors:[],error:"",value:"",initialValue:null},setValidityData:n.NOOP,disabled:void 0,touched:l.touched,setTouched:n.NOOP,dirty:l.dirty,setDirty:n.NOOP,filled:l.filled,setFilled:n.NOOP,focused:l.focused,setFocused:n.NOOP,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:o,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=n.EMPTY_OBJECT)=>e,getInputValidationProps:(e=n.EMPTY_OBJECT)=>e,inputRef:{current:null},commit:async()=>{}}});e.s(["FieldRootContext",0,c,"useFieldRootContext",0,function(e=!0){let t=a.useContext(c);if(t.setValidityData===n.NOOP&&!e)throw Error((0,r.default)(28));return t}],890514)},571870,e=>{"use strict";var t=e.i(965652),r=e.i(954588);let a=t.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:r.NOOP,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});e.s(["useFormContext",0,function(){return t.useContext(a)}])},179279,e=>{"use strict";var t=e.i(965652),r=e.i(954588);let a=t.createContext({controlId:void 0,registerControlId:r.NOOP,labelId:void 0,setLabelId:r.NOOP,messageIds:[],setMessageIds:r.NOOP,getDescriptionProps:e=>e});e.s(["LabelableContext",0,a,"useLabelableContext",0,function(){return t.useContext(a)}])},956181,e=>{"use strict";e.s(["getCombinedFieldValidityData",0,function(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}])},397791,e=>{"use strict";var t=e.i(92615),r=e.i(102094),a=e.i(887642),n=e.i(682354),s=e.i(804849),i=e.i(207516),l=e.i(179279);e.s(["useLabel",0,function(e={}){let o,{id:c,fallbackControlId:d,native:u=!1,setLabelId:f,focusControl:h}=e,{controlId:m,setLabelId:p}=(0,l.useLabelableContext)(),g=(0,a.useStableCallback)(e=>{p(e),f?.(e)}),v=(o=(0,i.useBaseUiId)(c),(0,s.useIsoLayoutEffect)(()=>(g(o),()=>{g(void 0)}),[o,g]),o),y=m??d;function b(e){let a=(0,n.getTarget)(e.nativeEvent);a?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),u||function(e){if(h)return h(e,y);if(!y)return;let a=(0,r.ownerDocument)(e.currentTarget).getElementById(y);(0,t.isHTMLElement)(a)&&a.focus({focusVisible:!0})}(e))}return u?{id:v,htmlFor:y??void 0,onMouseDown:b}:{id:v,onClick:b,onPointerDown(e){e.preventDefault()}}}],397791)},103353,e=>{"use strict";var t=e.i(965652),r=e.i(804849),a=e.i(887642),n=e.i(903224),s=e.i(92615),i=e.i(954588),l=e.i(207516),o=e.i(179279);e.s(["useLabelableId",0,function(e={}){let{id:c,implicit:d=!1,controlRef:u}=e,{controlId:f,registerControlId:h}=(0,o.useLabelableContext)(),m=(0,l.useBaseUiId)(c),p=d?f:void 0,g=(0,n.useRefWithInit)(()=>Symbol("labelable-control")),v=t.useRef(!1),y=t.useRef(null!=c),b=(0,a.useStableCallback)(()=>{v.current&&h!==i.NOOP&&(v.current=!1,h(g.current,void 0))});return(0,r.useIsoLayoutEffect)(()=>{let e;if(h!==i.NOOP){if(d){let t=u?.current;e=(0,s.isElement)(t)&&null!=t.closest("label")?c??null:p??m}else if(null!=c)y.current=!0,e=c;else{if(!y.current)return void b();e=m}if(void 0===e)return void b();v.current=!0,h(g.current,e)}},[c,u,p,h,d,m,g,b]),t.useEffect(()=>b,[b]),f??m}])},421689,e=>{"use strict";var t=e.i(585012),r=e.i(804849),a=e.i(887642),n=e.i(956181),s=e.i(571870),i=e.i(890514);e.s(["useField",0,function(e){let{enabled:l=!0,value:o,id:c,name:d,controlRef:u,commit:f}=e,{formRef:h}=(0,s.useFormContext)(),{invalid:m,markedDirtyRef:p,validityData:g,setValidityData:v}=(0,i.useFieldRootContext)(),y=(0,a.useStableCallback)(e.getValue);(0,r.useIsoLayoutEffect)(()=>{if(!l)return;let e=o;void 0===e&&(e=y()),null===g.initialValue&&null!==e&&v(t=>({...t,initialValue:e}))},[l,v,o,g.initialValue,y]),(0,r.useIsoLayoutEffect)(()=>{l&&c&&h.current.fields.set(c,{getValue:y,name:d,controlRef:u,validityData:(0,n.getCombinedFieldValidityData)(g,m),validate(e=!0){let r=o;void 0===r&&(r=y()),p.current=!0,e?t.flushSync(()=>f(r)):f(r)}})},[f,u,l,h,y,c,m,p,d,g,o]),(0,r.useIsoLayoutEffect)(()=>{let e=h.current.fields;return()=>{c&&e.delete(c)}},[h,c])}])},792566,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["default",0,t])},453889,e=>{"use strict";let t=(0,e.i(572989).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",0,t],453889)},998626,e=>{"use strict";let t=(0,e.i(572989).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,t],998626)},59737,e=>{"use strict";let t=(0,e.i(572989).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",0,t])},977982,472074,e=>{"use strict";let t=(0,e.i(572989).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,t],977982);var r=e.i(792566);e.s(["ChevronUp",()=>r.default],472074)},194358,e=>{"use strict";let t=(0,e.i(572989).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",0,t],194358)},567098,e=>{"use strict";let t=(0,e.i(572989).default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);e.s(["default",0,t])},770303,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(514798);let n=(0,a.createServerReference)("4040c7dadb7c3e097da9f6b5ea7b34753aed553d3c",a.callServer,void 0,a.findSourceMapURL,"checkExtension");var s=e.i(570835);let i=(0,a.createServerReference)("4045a06ad46f6ca52053a502d00fb918a2354b7c11",a.callServer,void 0,a.findSourceMapURL,"uninstallExtension");var l=e.i(887911);let o={installed:!1},c=(0,r.createContext)(null);e.s(["ExtensionContext",0,c,"ExtensionProvider",0,function({children:e,initialStatus:a}){let[d,u]=(0,r.useState)(()=>a??Object.fromEntries((0,l.listExtensionMetadata)().map(e=>[e.id,o]))),[f,h]=(0,r.useState)(new Set),m=(0,r.useRef)(new Set),p=(0,r.useCallback)(async e=>{let t=await n(e);u(r=>({...r,[e]:t}))},[]),g=(0,r.useCallback)(async e=>{if(m.current.has(e))return{success:!1,error:"install already in progress"};m.current.add(e),h(t=>{let r=new Set(t);return r.add(e),r});try{let t=await (0,s.installExtension)(e);return t.success&&await p(e),t}finally{m.current.delete(e),h(t=>{let r=new Set(t);return r.delete(e),r})}},[p]),v=(0,r.useCallback)(async e=>{if(m.current.has(e))return{success:!1,error:"operation already in progress"};m.current.add(e),h(t=>{let r=new Set(t);return r.add(e),r});try{let t=await i(e);return t.success&&await p(e),t}finally{m.current.delete(e),h(t=>{let r=new Set(t);return r.delete(e),r})}},[p]),y=(0,r.useMemo)(()=>({statusMap:d,loading:!1,installing:f,refresh:p,install:g,uninstall:v}),[d,f,p,g,v]);return(0,t.jsx)(c.Provider,{value:y,children:e})}],770303)},715207,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60af59ff136f132f6f6c9f32423f2b701196b93694",t.callServer,void 0,t.findSourceMapURL,"getConfigValue");e.s(["getConfigValue",0,r])},386343,125177,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",0,r],386343);let a=(0,t.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);e.s(["Bell",0,a],125177)},243288,e=>{e.v(t=>Promise.all(["static/chunks/0pg_rf2cch5pv.js","static/chunks/0ep-qrl_zzch8.js","static/chunks/17oc2l.ekcs8b.css"].map(t=>e.l(t))).then(()=>t(346069)))},427768,e=>{e.v(t=>Promise.all(["static/chunks/05lky664ou92k.js","static/chunks/0o6zqtzz_7ysr.js"].map(t=>e.l(t))).then(()=>t(103363)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let a=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,a],181209)},236967,e=>{"use strict";var t=e.i(289721),a=e.i(210702),r=e.i(538059),s=e.i(259846),n=e.i(645378),i=e.i(453889),l=e.i(487278),o=e.i(533499);let d=[{key:"notes",icon:n.FileText},{key:"assets",icon:i.FolderOpen},{key:"archive",icon:l.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:n}=(0,o.useI18n)(),i=(0,r.usePathname)(),l=d.find(e=>i.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(a.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(s.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),d.map(r=>{let s=r.icon,i=l===r.key;return(0,t.jsxs)(a.default,{href:`/workspaces/${e}/${r.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${i?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n(`sidebar.${r.key}`)})]},r.key)})]})}])},245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},685149,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},487486,e=>{"use strict";var t=e.i(565455),a=e.i(581263),r=e.i(294237),s=e.i(975157);let n=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:i,...l}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,s.cn)(n({variant:r}),e)},l),render:i,state:{slot:"badge",variant:r}},(0,a.useRenderElement)(o.defaultTagName??"div",o,o)}],487486)},583329,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40761db40351e40c001ff439284f4ab6a350d93b1b",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,a])},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},197550,852494,12659,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("4072804d823a8f55231ec0829fb98a68bc38646216",t.callServer,void 0,t.findSourceMapURL,"openInFileManager");e.s(["openInFileManager",0,a],197550);let r=(0,t.createServerReference)("40a7283207727ed21a6ecaca85b390988b3687e1dd",t.callServer,void 0,t.findSourceMapURL,"openInEditor");e.s(["openInEditor",0,r],852494);let s=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,s],12659)},736061,460707,e=>{"use strict";var t=e.i(572989);let a=(0,t.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);e.s(["FolderSearch",0,a],736061);let r=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,r],460707)},35967,e=>{"use strict";var t=e.i(289721);let a=(0,e.i(572989).default)("milestone",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",key:"8gz4t4"}]]);var r=e.i(533499);let s=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function n(e){return s[function(e){let t=0;for(let a=0;a<e.length;a++)t=31*t+e.charCodeAt(a)>>>0;return t}(e)%s.length]}let i={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};e.s(["TaskVersionTag",0,function({number:e,name:r,showName:s=!1,className:n="",title:i}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground ${n}`,title:i??(r?`${e} \xb7 ${r}`:e),children:[(0,t.jsx)(a,{className:"h-2.5 w-2.5 shrink-0"}),(0,t.jsx)("span",{className:"font-mono",children:e}),s&&r?(0,t.jsx)("span",{className:"max-w-[140px] truncate",children:r}):null]})},"VersionStatusBadge",0,function({status:e}){let{t:a}=(0,r.useI18n)();return(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${i[e]}`,children:a(`version.status.${e}`)})},"VersionTypeBadge",0,function({name:e}){let{t:a}=(0,r.useI18n)();return e?(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${n(e)}`,children:e}):(0,t.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:a("version.type.uncategorized")})},"typeBadgeColor",0,n],35967)},980376,661149,e=>{"use strict";var t=e.i(289721),a=e.i(225061),r=e.i(975157),s=e.i(519455),n=e.i(670123);function i({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function l({className:e,...s}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,r.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...s})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:o,side:d="right",showCloseButton:c=!0,...u}){return(0,t.jsxs)(i,{children:[(0,t.jsx)(l,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,r.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...u,children:[o,c&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(s.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(n.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...s})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,r.cn)("flex flex-col gap-0.5 p-4",e),...a})},"SheetTitle",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,r.cn)("font-heading text-base font-medium text-foreground",e),...s})}],980376);var o=e.i(514798);let d=(0,o.createServerReference)("403b726cc7d9cff0549ec73b0b63b5550d931ba5bc",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,d],661149)},606393,e=>{"use strict";let t=(0,e.i(572989).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],606393)},605005,e=>{"use strict";var t=e.i(289721),a=e.i(965652),r=e.i(980376),s=e.i(759684),n=e.i(487486),i=e.i(519455),l=e.i(533499),o=e.i(157972),d=e.i(661149),c=e.i(339733),u=e.i(197550),x=e.i(852494),m=e.i(583329),h=e.i(744798),p=e.i(685149),g=e.i(606393),f=e.i(875840),b=e.i(245697),v=e.i(12659),y=e.i(736061),j=e.i(460707),N=e.i(567860);function k({added:e,removed:a}){let{t:r}=(0,l.useI18n)();return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,t.jsx)("span",{children:r("diff.filesChanged",{count:String(e+a)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),a>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",a]})]})}var w=e.i(35967),S=e.i(360112);e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:C,taskId:I}){let{t:T}=(0,l.useI18n)(),[D,E]=(0,a.useState)(null),[A,M]=(0,a.useTransition)(),[O,R]=(0,a.useState)(!1),[P,$]=(0,a.useState)([]);(0,a.useEffect)(()=>{I&&e?M(async()=>{let e=await (0,d.getTaskOverview)(I);e&&(E(e),e.project?.workspaceId&&(0,c.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{$(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>$([])))}):E(null)},[I,e]);let L=D?p.BOARD_COLUMNS.find(e=>e.id===D.status):null,B=D?p.PRIORITY_CONFIG[D.priority]:null,F=D?.executions?.[0]??null,z=(()=>{if(F?.worktreePath)return F.worktreePath;let e=D?.project?.localPath;return e?D?.subPath?`${e}/${D.subPath}`:e:null})(),V=(()=>{let e=F?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),U=async e=>{if(D?.project)try{let{autoStart:t,...a}=e;await (0,o.createTask)({...a,projectId:D.project.id}),S.toast.success(T("taskDrawer.duplicateSuccess")),R(!1),C(!1)}catch{S.toast.error(T("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(r.Sheet,{open:e,onOpenChange:C,children:[(0,t.jsxs)(r.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(r.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(r.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:D?.title??""}),(0,t.jsx)(r.SheetDescription,{className:"sr-only",children:T("taskDrawer.title")}),D&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[L&&(0,t.jsxs)(n.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${L.color}`}),L.label]}),B&&(0,t.jsx)(n.Badge,{variant:"secondary",className:`text-xs ${B.color}`,children:B.label}),D.version&&(0,t.jsx)(w.TaskVersionTag,{number:D.version.number,name:D.version.name,showName:!0})]})]}),(0,t.jsx)(s.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:A&&!D?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:T("assets.loading")}):D?(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:T("taskDrawer.description")}),(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:D.description||T("taskDrawer.noDescription")})]}),D.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:T("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:D.labels.map(e=>(0,t.jsx)(n.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(g.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:T("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(D.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(b.Package,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:T("taskDrawer.resources")}),(0,t.jsx)("span",{className:"text-foreground",children:D._count.assets})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:T("taskDrawer.fileChanges")}),V?(0,t.jsx)(k,{added:V.added,removed:V.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:T("taskDrawer.noFileChanges")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(v.PlayCircle,{className:"h-3.5 w-3.5"}),T("taskDrawer.lastExecution")]}),F?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(n.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:F.status}),F.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:F.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:T("taskDrawer.noExecution")})]}),z&&(0,t.jsxs)("section",{className:"flex flex-col",children:[(0,t.jsxs)(i.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,u.openInFileManager)(z)}catch(e){console.error("openInFileManager failed:",e),S.toast.error(T("git.openInFileManagerFailed"))}},children:[(0,t.jsx)(y.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),T("git.openInFileManager")]}),(0,t.jsxs)(i.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,x.openInEditor)(z)}catch(e){console.error("openInEditor failed:",e),S.toast.error(T("git.openInEditorFailed"))}},children:[(0,t.jsx)(j.Code,{className:"h-3.5 w-3.5 shrink-0"}),T("git.openInEditor")]}),(0,t.jsxs)(i.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,m.openInTerminal)(z)}catch(e){console.error("openInTerminal failed:",e),S.toast.error(T("git.openInTerminalFailed"))}},children:[(0,t.jsx)(N.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),T("git.openInTerminal")]})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(i.Button,{variant:"default",className:"w-full",onClick:()=>{D&&R(!0)},disabled:!D,children:[(0,t.jsx)(f.Copy,{className:"h-4 w-4"}),T("taskDrawer.duplicate")]})})]}):null})]}),D?.project&&(0,t.jsx)(h.CreateTaskDialog,{open:O,onOpenChange:R,onSubmit:U,labels:P,projectType:D.project.type,projectLocalPath:D.project.localPath,prefillFromTask:{title:D.title,description:D.description,priority:D.priority,subPath:D.subPath,labelIds:D.labels.map(e=>e.label.id),baseBranch:D.baseBranch}})]})}],605005)},107830,e=>{"use strict";var t=e.i(289721),a=e.i(965652),r=e.i(487278),s=e.i(301348),n=e.i(181209),i=e.i(400355),l=e.i(280027),o=e.i(533499),d=e.i(236967),c=e.i(514798);let u=(0,c.createServerReference)("40292a7c769eb13bbc34ac66e49c9698605ad03e12",c.callServer,void 0,c.findSourceMapURL,"getArchivedTasks");var x=e.i(605005),m=e.i(35967);function h(e){return new Date(e).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function p({priority:e}){return(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${{LOW:"bg-slate-400",MEDIUM:"bg-amber-400",HIGH:"bg-orange-500",CRITICAL:"bg-rose-500"}[e]??"bg-slate-400"}`})}e.s(["ArchivePageClient",0,function({allWorkspaces:e,initialWorkspaceId:c,initialProjectId:g,initialTasks:f}){let b,{t:v}=(0,o.useI18n)(),[y,j]=(0,a.useTransition)(),[N,k]=(0,a.useState)(c),[w,S]=(0,a.useState)(g),[C,I]=(0,a.useState)(f),[T,D]=(0,a.useState)(null),E=e.find(e=>e.id===N),A=E?.projects??[],M=(0,a.useCallback)(e=>{e?j(async()=>{I(await u(e))}):I([])},[j]);return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(d.SubPageNav,{workspaceId:N}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(l.Select,{value:N,onValueChange:t=>t&&(t=>{if(t===N)return;k(t);let a=e.find(e=>e.id===t),r=a?.projects[0]??null;S(r?.id??null),M(r?.id??null)})(t),children:[(0,t.jsx)(l.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:E?.name??N})}),(0,t.jsx)(l.SelectContent,{children:e.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))})]}),A.length>0&&(0,t.jsxs)(l.Select,{value:w??"",onValueChange:e=>e&&void(e!==w&&(S(e),M(e))),children:[(0,t.jsx)(l.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(b=A.find(e=>e.id===w))?b.alias?`${b.name} (${b.alias})`:b.name:""})}),(0,t.jsx)(l.SelectContent,{children:A.map(e=>(0,t.jsxs)(l.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,t.jsxs)("span",{className:"ml-auto rounded-full bg-muted px-2.5 py-0.5 text-[11px] text-muted-foreground",children:[C.length," ",v("archive.tasksCount")]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,t.jsxs)("div",{className:`relative ${y?"opacity-40 pointer-events-none":""} transition-opacity`,children:[y&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(i.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===C.length?(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)(r.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:v("archive.noTasks")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:v("archive.noTasksDesc")})]}):(0,t.jsx)("div",{className:"space-y-2",children:C.map(e=>{let a="DONE"===e.status,r=e.executions[0];return(0,t.jsx)("div",{role:"button",tabIndex:0,onClick:()=>D(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),D(e.id))},className:"group cursor-pointer rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:border-border/80 hover:bg-accent/30 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:a?(0,t.jsx)(s.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}):(0,t.jsx)(n.XCircle,{className:"h-4 w-4 text-rose-500"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p,{priority:e.priority}),(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.title}),(0,t.jsx)("span",{className:`ml-1 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${a?"bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20":"bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20"}`,children:a?v("archive.status.done"):v("archive.status.cancelled")}),e.version&&(0,t.jsx)(m.TaskVersionTag,{number:e.version.number,name:e.version.name,showName:!0,className:"shrink-0"})]}),e.labels.length>0&&(0,t.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,t.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,outline:`1px solid ${e.label.color}40`},children:e.label.name},e.label.id))}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{children:[v("archive.createdAt"),": ",h(e.createdAt)]}),(0,t.jsxs)("span",{children:[a?v("archive.completedAt"):v("archive.cancelledAt"),": ",h(e.updatedAt)]}),r&&(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[v("archive.lastExecution"),":"," ",(0,t.jsx)("span",{className:`rounded px-1 py-0.5 font-mono text-[10px] ${"COMPLETED"===r.status?"bg-emerald-500/10 text-emerald-400":"FAILED"===r.status?"bg-rose-500/10 text-rose-400":"bg-amber-500/10 text-amber-400"}`,children:r.status})]})]})]})]})},e.id)})})]})}),(0,t.jsx)(x.TaskOverviewDrawer,{open:!!T,onOpenChange:e=>{e||D(null)},taskId:T})]})}],107830)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,113399,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),n=e.i(821957),i=e.i(533499),r=e.i(519455),l=e.i(793479),o=e.i(624687),c=e.i(110204),d=e.i(487486),m=e.i(699375),u=e.i(776639),x=e.i(975157),g=e.i(386343),p=e.i(572989);let h=(0,p.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var f=e.i(645378);let b=(0,p.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var j=e.i(125177),v=e.i(256753),N=e.i(245697),y=e.i(657153),k=e.i(232545);let w=(0,p.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var C=e.i(998626);let S=(0,p.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),T=(0,p.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var M=e.i(400355),D=e.i(301348),B=e.i(181209),R=e.i(453889),P=e.i(715207),L=e.i(288285),U=e.i(200694),I=e.i(514798);let F=(0,I.createServerReference)("00a1cead187343d5168c4fd4e369d907515a6faa74",I.callServer,void 0,I.findSourceMapURL,"getAvailableTerminalApps"),H=(0,I.createServerReference)("005a06cc0d7f06dc6e024778e20be30a6d8ee3901a",I.callServer,void 0,I.findSourceMapURL,"getAvailableEditors");var E=e.i(436325);let V=(0,I.createServerReference)("40abff11f62507e94641e5bfbb49c01adcd12a45d3",I.callServer,void 0,I.findSourceMapURL,"createPrompt"),z=(0,I.createServerReference)("6060045bbf8c915448fb3f6cc34bdc320dfa044635",I.callServer,void 0,I.findSourceMapURL,"updatePrompt"),$=(0,I.createServerReference)("400df3667df21c9a48c89a463f1f80bf3122351c50",I.callServer,void 0,I.findSourceMapURL,"deletePrompt"),A=(0,I.createServerReference)("6015d584d79c9a518547354b76efe7027fd0222457",I.callServer,void 0,I.findSourceMapURL,"setDefaultPrompt"),K=(0,I.createServerReference)("00cfe9c54648d807cd2a05b279be0983752ad2d1d5",I.callServer,void 0,I.findSourceMapURL,"getAvailableProviders");var O=e.i(746798),W=e.i(224277);let q=(0,p.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var G=e.i(631675);let X=(0,p.default)("folder-up",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var Y=e.i(922541),Z=e.i(759686),_=e.i(487278),J=e.i(360112);let Q=(0,I.createServerReference)("402c500c9c5b6b55b06685945404442a3e304e4f46",I.callServer,void 0,I.findSourceMapURL,"createBackup"),ee=(0,I.createServerReference)("008c16087e9059dc6346b9708b7d7df5d38f4898a1",I.callServer,void 0,I.findSourceMapURL,"listBackupFiles"),et=(0,I.createServerReference)("4060dff1430a16433a55b3abb784c483de29763367",I.callServer,void 0,I.findSourceMapURL,"deleteBackupFile"),es=(0,I.createServerReference)("409caf0fbe206cb3780809785e353bd7b24138ee41",I.callServer,void 0,I.findSourceMapURL,"restoreBackup"),ea=(0,I.createServerReference)("40e8ae6815d9b1efccb9499ac4168f46d5a8152656",I.callServer,void 0,I.findSourceMapURL,"resetSystem"),en=(0,I.createServerReference)("003e805ab61012118717ca7313a5a15a1cf0c651aa",I.callServer,void 0,I.findSourceMapURL,"getBackupDir"),ei=(0,I.createServerReference)("401c2813bf560faaee7f20b8bf8b9fe16d8895a941",I.callServer,void 0,I.findSourceMapURL,"setBackupDir");function er(){let{t:e,locale:n}=(0,i.useI18n)(),o=(0,a.useRouter)(),[c,d]=(0,s.useState)([]),[m,x]=(0,s.useState)(""),[g,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(!0),[b,j]=(0,s.useState)(null),[v,N]=(0,s.useState)(!1),[y,k]=(0,s.useState)(""),w=(0,s.useRef)(null),[S,T]=(0,s.useState)(!1),[D,B]=(0,s.useState)(""),R=(0,s.useCallback)(async()=>{f(!0);try{let[e,t]=await Promise.all([ee(),en()]);d(e),x(t)}finally{f(!1)}},[]);(0,s.useEffect)(()=>{R()},[R]);let P=async()=>{let t=y.trim()||void 0;N(!1),k(""),j("create");try{await Q(t),J.toast.success(e("settings.backup.createSuccess")),await R()}catch{J.toast.error(e("settings.backup.createError"))}finally{j(null)}},L=async t=>{if(confirm(e("settings.backup.restoreConfirm"))){j("restore");try{await es(t),J.toast.success(e("settings.backup.restoreSuccess"),{action:{label:e("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await R()}catch{J.toast.error(e("settings.backup.restoreError"))}finally{j(null)}}},U=async t=>{if(confirm(e("settings.backup.deleteConfirm")))try{await et(t),J.toast.success(e("settings.backup.deleteSuccess")),d(e=>e.filter(e=>e.filename!==t))}catch{J.toast.error(e("settings.backup.deleteError"))}},I=async t=>{p(!1);try{await ei(t),x(t),J.toast.success(e("settings.backup.dirSaved")),await R()}catch{J.toast.error(e("settings.backup.dirError"))}},F=async t=>{let s=t.target.files?.[0];if(s){t.target.value="",j("import");try{let t=new FormData;t.append("file",s);let a=await fetch("/api/internal/backup/import",{method:"POST",body:t});if(!a.ok){let t=await a.json();J.toast.error("Invalid backup archive"===t.error?e("settings.backup.importInvalid"):(t.error,e("settings.backup.importError")));return}J.toast.success(e("settings.backup.importSuccess")),await R()}catch{J.toast.error(e("settings.backup.importError"))}finally{j(null)}}},H=async()=>{if("RESET"===D){T(!1),B(""),j("reset");try{await ea("RESET"),J.toast.success(e("settings.backup.resetSuccess")),o.push("/")}catch{J.toast.error(e("settings.backup.resetError"))}finally{j(null)}}},E=null!==b;return(0,t.jsxs)("div",{className:"space-y-6",children:[("restore"===b||"reset"===b)&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)(M.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===b?e("settings.backup.restoring"):e("settings.backup.resetting")})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold",children:e("settings.backup.sectionTitle")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e("settings.backup.dir"),":"]}),(0,t.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:m}),(0,t.jsx)(r.Button,{variant:"ghost",onClick:()=>p(!0),className:"text-xs text-muted-foreground",children:e("settings.backup.dirChange")})]}),(0,t.jsx)(W.FolderBrowserDialog,{open:g,onOpenChange:p,onSelect:I})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Button,{onClick:()=>{k(""),N(!0)},disabled:E,className:"gap-2",children:"create"===b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-4 w-4 animate-spin"})," ",e("settings.backup.creating")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q,{className:"h-4 w-4"})," ",e("settings.backup.create")]})}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsxs)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",disabled:E,onClick:()=>w.current?.click(),className:"gap-2"}),children:[(0,t.jsx)(X,{className:"h-4 w-4"}),e("settings.backup.import")]}),(0,t.jsx)(O.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.importHint")})]}),(0,t.jsx)("input",{ref:w,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:F})]}),(0,t.jsx)(u.Dialog,{open:v,onOpenChange:N,children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(u.DialogHeader,{children:(0,t.jsx)(u.DialogTitle,{children:e("settings.backup.create")})}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.createLabel")}),(0,t.jsx)(l.Input,{value:y,onChange:e=>k(e.target.value),onKeyDown:e=>"Enter"===e.key&&P(),placeholder:e("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>N(!1),children:e("common.cancel")}),(0,t.jsx)(r.Button,{onClick:P,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:e("settings.backup.create")})]})]})}),h?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(M.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===c.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,t.jsx)(_.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.backup.empty")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e("settings.backup.emptyDesc")})]}):(0,t.jsx)("div",{className:"space-y-3",children:c.map(s=>{var a,i;return(0,t.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s.label?(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:s.label}):(0,t.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:s.filename}),s.autoBackup&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:e("settings.backup.autoLabel")})]}),s.label&&(0,t.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:s.filename}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(a=s.size)<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`," · ",(i=s.createdAt,new Date(i).toLocaleString("zh"===n?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),s.preview.length>0&&(0,t.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[s.preview.map((e,s)=>(0,t.jsxs)("span",{children:[s>0&&" ",e.workspace,"(",e.projects.join(", "),")"]},s)),s.stats.workspaces>s.preview.length&&(0,t.jsxs)("span",{children:[" ",e("settings.backup.workspaces",{count:String(s.stats.workspaces)})]})]}),(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e("settings.backup.projects",{count:String(s.stats.projects)})," · ",e("settings.backup.tasks",{count:String(s.stats.tasks)})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",onClick:()=>L(s.filename),disabled:E,className:"text-muted-foreground hover:text-foreground"}),children:(0,t.jsx)(G.Upload,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(O.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.restore")})]}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",onClick:()=>U(s.filename),disabled:E,className:"text-muted-foreground hover:text-rose-400"}),children:(0,t.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(O.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.delete")})]})]})]})},s.filename)})}),(0,t.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,t.jsx)(Z.AlertTriangle,{className:"h-4 w-4"}),e("settings.backup.dangerZone")]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:e("settings.backup.resetDesc")}),(0,t.jsxs)(r.Button,{variant:"outline",onClick:()=>{B(""),T(!0)},disabled:E,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,t.jsx)(Y.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),e("settings.backup.reset")]})]}),(0,t.jsx)(u.Dialog,{open:S,onOpenChange:T,children:(0,t.jsxs)(u.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:e("settings.backup.resetConfirmTitle")}),(0,t.jsx)(u.DialogDescription,{children:e("settings.backup.resetConfirmDesc")})]}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.resetConfirmInput")}),(0,t.jsx)(l.Input,{value:D,onChange:e=>B(e.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>T(!1),children:e("common.cancel")}),(0,t.jsx)(r.Button,{disabled:"RESET"!==D,onClick:H,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:e("settings.backup.reset")})]})]})})]})}var el=e.i(887911),eo=e.i(597746);let ec=(0,p.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ed=e.i(875840),em=e.i(475958),eu=e.i(194358),ex=e.i(337822),eg=e.i(991838);let ep=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function eh({cmd:e}){let{t:a}=(0,i.useI18n)(),[n,l]=(0,s.useState)(!1),o=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}l(!0),J.toast.success(a("common.copied")),setTimeout(()=>l(!1),1500)}catch{J.toast.error(a("common.copyFailed"))}};return(0,t.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-background/60 pl-2 pr-1 py-1 ring-1 ring-border/60",children:[(0,t.jsx)("code",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-relaxed",children:e}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":a("common.copy"),onClick:o,children:n?(0,t.jsx)(eo.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(ed.Copy,{className:"h-3 w-3"})})]})}function ef({extension:e}){let{t:a}=(0,i.useI18n)(),{status:n,loading:l,isInstalling:o,install:c,uninstall:d,refresh:m}=(0,eg.useExtension)(e.id),[u,x]=(0,s.useState)(!1),g=e.icon,p=n.installed,h=async()=>{let t=await c();t.success?J.toast.success(a("settings.extensions.installSuccess").replace("{name}",e.name)):J.toast.error(a("settings.extensions.installFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},f=async()=>{let t=await d();t.success?J.toast.success(a("settings.extensions.uninstallSuccess").replace("{name}",e.name)):J.toast.error(a("settings.extensions.uninstallFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},b=async()=>{x(!0);try{await m()}finally{x(!1)}},j=()=>{window.open(e.homepageUrl,"_blank","noopener,noreferrer")};return(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,t.jsx)(g,{className:"h-5 w-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e.name}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]})]}),(0,t.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",e.sizeMB," MB"]})]}),(0,t.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("common.loading")})]}):p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-foreground",children:[a("settings.extensions.installed"),n.version?` v${n.version}`:""]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("settings.extensions.notInstalledShort")})]})}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.Button,{variant:"default",onClick:h,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.reinstalling")]}):a("settings.extensions.reinstall")}),(0,t.jsx)(r.Button,{variant:"outline",onClick:f,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.uninstalling")]}):a("settings.extensions.uninstall")})]}):e.manualInstall?(0,t.jsxs)(ex.Popover,{children:[(0,t.jsx)(ex.PopoverTrigger,{render:e=>(0,t.jsxs)(r.Button,{variant:"default",...e,children:[(0,t.jsx)(q,{className:"h-3.5 w-3.5"}),a("settings.extensions.installViaHomepage")]})}),(0,t.jsxs)(ex.PopoverContent,{align:"start",className:"w-80 max-w-[90vw] gap-2 text-xs leading-relaxed",children:[(0,t.jsx)("p",{children:a("settings.extensions.manualInstallHintIntro")}),(0,t.jsx)("div",{className:"space-y-2",children:ep.map(({os:e,cmd:s})=>(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:e}),(0,t.jsx)(eh,{cmd:s})]},e))}),(0,t.jsx)("p",{className:"text-muted-foreground",children:a("settings.extensions.manualInstallHintAfter")}),(0,t.jsxs)("button",{type:"button",onClick:j,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,t.jsx)(em.ExternalLink,{className:"h-3 w-3"}),a("settings.extensions.visitHomepage")]})]})]}):(0,t.jsx)(r.Button,{variant:"default",onClick:h,disabled:o,children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.installing")]}):a("settings.extensions.install")}),(0,t.jsxs)(r.Button,{variant:"ghost",onClick:b,disabled:u,children:[(0,t.jsx)(eu.RefreshCw,{className:`h-3.5 w-3.5 ${u?"animate-spin":""}`}),a("settings.extensions.recheck")]}),(0,t.jsxs)(r.Button,{variant:"ghost",onClick:j,children:[(0,t.jsx)(em.ExternalLink,{className:"h-3.5 w-3.5"}),a("settings.extensions.visitHomepage")]})]})]})}function eb(){let{t:e}=(0,i.useI18n)(),s=(0,el.listExtensionMetadata)();return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("header",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold",children:e("settings.extensions.title")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("settings.extensions.desc")})]}),(0,t.jsx)("div",{className:"space-y-3",children:s.map(e=>(0,t.jsx)(ef,{extension:e},e.id))})]})}function ej({options:e,value:s,onChange:a}){return(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.value),className:(0,x.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}function ev({label:e,description:s,children:a,className:n}){return(0,t.jsxs)("div",{className:(0,x.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",n),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e}),s&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:s})]}),(0,t.jsx)("div",{className:"shrink-0",children:a})]})}let eN=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:g.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:h,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:f.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:b,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:N.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:j.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:v.HardDrive,accent:"cyan"}],ey={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},ek="ai-manager:default-cli-adapter",ew={host:"",ownerMatch:"*",localPathTemplate:"",priority:0};function eC(){let e=(0,a.useRouter)(),{t:g}=(0,i.useI18n)(),{theme:p,setTheme:h}=(0,n.useTheme)(),{locale:f,setLocale:b}=(0,i.useI18n)(),[j,v]=(0,s.useState)("general"),N=(0,s.useRef)(null),[I,q]=(0,s.useState)({left:0,width:0}),[G,X]=(0,s.useState)(!1),[Y,Z]=(0,s.useState)("Terminal"),[_,J]=(0,s.useState)([]),[Q,ee]=(0,s.useState)(""),[et,es]=(0,s.useState)([]),[ea,en]=(0,s.useState)([]),[ei,el]=(0,s.useState)("claude"),[eo,ec]=(0,s.useState)(null),[ed,em]=(0,s.useState)({}),[eu,ex]=(0,s.useState)([]),[eg,ep]=(0,s.useState)(!1),[eh,ef]=(0,s.useState)(null),[eC,eS]=(0,s.useState)(null),[eT,eM]=(0,s.useState)(""),[eD,eB]=(0,s.useState)(""),[eR,eP]=(0,s.useState)(""),[eL,eU]=(0,s.useState)([]),[eI,eF]=(0,s.useState)(null),[eH,eE]=(0,s.useState)({...ew}),[eV,ez]=(0,s.useState)(!1),[e$,eA]=(0,s.useState)({...ew}),[eK,eO]=(0,s.useState)(!1),[eW,eq]=(0,s.useState)(!1),[eG,eX]=(0,s.useState)(0),[eY,eZ]=(0,s.useState)(null),[e_,eJ]=(0,s.useState)(null),[eQ,e0]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[e1,e2]=(0,s.useState)({timeoutSec:30}),[e5,e3]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[e4,e8]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[e6,e7]=(0,s.useState)(null),[e9,te]=(0,s.useState)(!1),[tt,ts]=(0,s.useState)(""),[ta,tn]=(0,s.useState)(!0);(0,s.useEffect)(()=>X(!0),[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("terminal.app","Terminal").then(Z),F().then(J),(0,P.getConfigValue)("editor.command","").then(ee),H().then(es)},[]),(0,s.useEffect)(()=>{if(0===_.length||!Y||_.some(e=>e.value===Y))return;let e=_.find(e=>e.name===Y);e&&(Z(e.value),(0,L.setConfigValue)("terminal.app",e.value))},[_,Y]),(0,s.useEffect)(()=>{if(0===et.length||!Q||et.some(e=>e.command===Q))return;let e=et.find(e=>e.name===Q);e&&(ee(e.command),(0,L.setConfigValue)("editor.command",e.command))},[et,Q]),(0,s.useEffect)(()=>{K().then(en);let e=localStorage.getItem(ek);e&&el(e)},[]),(0,s.useEffect)(()=>{(0,E.getPrompts)().then(ex)},[]);let ti=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();e7(t)}}catch{}};async function tr(e){if(!eo){ec(e),em(t=>{let s={...t};return delete s[e],s});try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})}),s=await t.json();em(t=>({...t,[e]:s}))}catch{em(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{ec(null)}}}(0,s.useEffect)(()=>{(0,P.getConfigValue)("git.pathMappingRules",[]).then(e=>{let t=new Set,s=!1,a=e.map(e=>{if(!e.id||t.has(e.id)){s=!0;let a={...e,id:crypto.randomUUID()};return t.add(a.id),a}return t.add(e.id),e});eU(a),s&&(0,L.setConfigValue)("git.pathMappingRules",a)}),(0,P.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{ts(e.join(", "))}),ti(),(0,U.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","task.defaultUseWorktree","task.defaultAutoStart","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{let t=e["system.maxUploadBytes"]??0x3200000,s=e["system.maxReadableFileBytes"]??5242880;e0({maxUploadMb:Math.round(t/1024/1024),maxConcurrent:e["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(s/1024/1024),taskDefaultUseWorktree:"boolean"!=typeof e["task.defaultUseWorktree"]||e["task.defaultUseWorktree"],taskDefaultAutoStart:"boolean"==typeof e["task.defaultAutoStart"]&&e["task.defaultAutoStart"]}),e2({timeoutSec:e["git.timeoutSec"]??30}),e3({resultLimit:e["search.resultLimit"]??20,allModeCap:e["search.allModeCap"]??5,debounceMs:e["search.debounceMs"]??250,snippetLength:e["search.snippetLength"]??80,codeTimeoutSec:e["search.codeTimeoutSec"]??30}),e8({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("notification.enabled",!0).then(tn)},[]);let tl=(0,s.useCallback)(()=>{ef(null),eM(""),eB(""),eP(""),ep(!0)},[]),to=(0,s.useCallback)(e=>{ef(e),eM(e.name),eB(e.description??""),eP(e.content),ep(!0)},[]),tc=(0,s.useCallback)(async()=>{eT.trim()&&eR.trim()&&(eh?await z(eh.id,{name:eT.trim(),description:eD.trim()||void 0,content:eR.trim()}):await V({name:eT.trim(),description:eD.trim()||void 0,content:eR.trim()}),ep(!1),ex(await (0,E.getPrompts)()),e.refresh())},[eT,eD,eR,eh,e]),td=(0,s.useCallback)(async()=>{eC&&(await $(eC),eS(null),ex(await (0,E.getPrompts)()),e.refresh())},[eC,e]),tm=(0,s.useCallback)(async t=>{await A(t),ex(await (0,E.getPrompts)()),e.refresh()},[e]),tu=async()=>{await (0,L.setConfigValue)("system.maxUploadBytes",1024*eQ.maxUploadMb*1024),await (0,L.setConfigValue)("system.maxConcurrentExecutions",eQ.maxConcurrent),await (0,L.setConfigValue)("system.maxReadableFileBytes",1024*eQ.maxReadableMb*1024)},tx=async()=>{await (0,L.setConfigValue)("task.defaultUseWorktree",eQ.taskDefaultUseWorktree),await (0,L.setConfigValue)("task.defaultAutoStart",eQ.taskDefaultAutoStart),await (0,L.setConfigValue)("task.mcpDefaultsConfigured",!0)},tg=async()=>{await (0,L.setConfigValue)("git.timeoutSec",e1.timeoutSec)},tp=async()=>{await (0,L.setConfigValue)("search.resultLimit",e5.resultLimit),await (0,L.setConfigValue)("search.allModeCap",e5.allModeCap),await (0,L.setConfigValue)("search.debounceMs",e5.debounceMs),await (0,L.setConfigValue)("search.snippetLength",e5.snippetLength),await (0,L.setConfigValue)("search.codeTimeoutSec",e5.codeTimeoutSec)},th=async()=>{let e=Math.min(e4.minCols,e4.maxCols),t=Math.max(e4.minCols,e4.maxCols),s=Math.min(e4.minRows,e4.maxRows),a=Math.max(e4.minRows,e4.maxRows);e8({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,L.setConfigValue)("missions.grid.minCols",e),await (0,L.setConfigValue)("missions.grid.maxCols",t),await (0,L.setConfigValue)("missions.grid.minRows",s),await (0,L.setConfigValue)("missions.grid.maxRows",a)},tf=async()=>{let e=tt.split(",").map(e=>e.trim()).filter(Boolean);await (0,L.setConfigValue)("hooks.autoUploadTypes",e)},tb=async()=>{if(e6){te(!0);try{let e=e6.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await ti()}finally{te(!1)}}},tj=async()=>{if(!e$.host.trim()||!e$.localPathTemplate.trim())return;let e=e$.localPathTemplate.trim().replace(/\/+$/,""),t=eK?`${e}/{path}`:e,s=[...eL,{id:crypto.randomUUID(),host:e$.host.trim(),ownerMatch:e$.ownerMatch.trim()||"*",localPathTemplate:t,priority:e$.priority}];await (0,L.setConfigValue)("git.pathMappingRules",s),eU(s),eA({...ew}),eO(!1),ez(!1)},tv=async e=>{if(!eH.host.trim()||!eH.localPathTemplate.trim())return;let t=eH.localPathTemplate.trim().replace(/\/+$/,""),s=eW?`${t}/{path}`:t,a=eL.map(t=>t.id===e?{...t,host:eH.host.trim(),ownerMatch:eH.ownerMatch.trim()||"*",localPathTemplate:s,priority:eH.priority}:t);await (0,L.setConfigValue)("git.pathMappingRules",a),eU(a),eF(null),eq(!1)},tN=async e=>{let t=eL.filter(t=>t.id!==e);await (0,L.setConfigValue)("git.pathMappingRules",t),eU(t),eZ(null)};async function ty(){let e=!ta;tn(e),await (0,L.setConfigValue)("notification.enabled",e)}let tk=(0,s.useCallback)(()=>{e.back()},[e]);(0,s.useEffect)(()=>{let e=N.current;if(!e)return;let t=e.querySelector(`[data-section="${j}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();q({left:a.left-s.left,width:a.width})},[j]);let tw=eN.find(e=>e.id===j),tC=tw?ey[tw.accent]:ey.blue;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:g("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:g("settings.configDesc")})]}),(0,t.jsxs)(r.Button,{variant:"outline",onClick:tk,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(y.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{ref:N,className:"relative flex gap-1 overflow-x-auto",children:[eN.map(e=>{let s=e.icon,a=j===e.id,n=ey[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>v(e.id),className:(0,x.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a?`${n.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:(0,x.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",a?n.bg:"bg-transparent"),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{children:g(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,x.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",tC.indicator),style:{left:I.left,width:I.width}})]})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[tw&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,x.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",tC.bg,tC.text,tC.ring),children:(0,t.jsx)(tw.icon,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:g(tw.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:g(tw.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(j){case"general":let e;return e=[{value:"light",label:g("settings.themeLight")},{value:"dark",label:g("settings.themeDark")},{value:"system",label:g("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(ev,{label:g("settings.theme"),description:g("settings.themeDesc"),children:G?(0,t.jsx)(ej,{options:e,value:p??"system",onChange:e=>h(e)}):(0,t.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,t.jsx)(ev,{label:g("settings.language"),description:g("settings.languageDesc"),children:(0,t.jsx)(ej,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:f,onChange:e=>b(e)})}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.terminal.desc")})]}),_.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:_.map(e=>{let s=Y===e.value,a=(0,x.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",e.installed?s?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),n=()=>{e.installed&&(Z(e.value),(0,L.setConfigValue)("terminal.app",e.value))};return e.installed?(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name},e.value):(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(O.TooltipContent,{side:"top",children:g("settings.app.notInstalled")})]},e.value)})})]}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.editor.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.editor.desc")})]}),et.length>0&&(0,t.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:et.map(e=>{let s=Q===e.command,a=(0,x.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",e.installed?s?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),n=()=>{e.installed&&(ee(e.command),(0,L.setConfigValue)("editor.command",e.command))};return e.installed?(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name},e.command):(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)("button",{type:"button",onClick:n,className:a,children:e.name})}),(0,t.jsx)(O.TooltipContent,{side:"top",children:g("settings.app.notInstalled")})]},e.command)})})]})]});case"ai-tools":return(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ea.map(e=>{let s=ei===e.name,a=eo===e.name,n=ed[e.name];return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.displayName}),(0,t.jsx)(d.Badge,{variant:"outline",children:g("label.builtin")}),s&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(w,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),g("settings.prompts.default")]}),n&&(0,t.jsx)(d.Badge,{variant:n.ok?"secondary":"destructive",className:(0,x.cn)("shrink-0",n.ok&&"bg-green-600 text-white hover:bg-green-700"),children:n.ok?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(D.CheckCircle2,{className:"h-3 w-3 mr-1"}),g("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.XCircle,{className:"h-3 w-3 mr-1"}),g("settings.aiTools.testFailed")]})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.cli.available&&e.cli.version?`${e.name} \xb7 ${e.cli.version}`:e.name})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)(r.Button,{variant:"outline",size:"sm",onClick:()=>{var t;el(t=e.name),localStorage.setItem(ek,t)},children:[(0,t.jsx)(w,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),g("settings.prompts.setDefault")]}),(0,t.jsx)(r.Button,{variant:"outline",size:"sm",onClick:()=>tr(e.name),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),g("settings.aiTools.testing")]}):g("settings.aiTools.testConnection")})]})]}),n&&(0,t.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,t.jsx)("div",{className:"space-y-1.5",children:n.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:(0,x.cn)("w-1.5 h-1.5 rounded-full shrink-0",s.passed?"bg-green-500":"bg-red-500")}),(0,t.jsx)("span",{className:(0,x.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.name}-${s.name}`))})})]})},e.name)})});case"prompts":return G?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(r.Button,{onClick:tl,variant:"default",children:[(0,t.jsx)(k.Plus,{className:"h-4 w-4 mr-2"}),g("settings.prompts.newPrompt")]})}),0===eu.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:g("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:g("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:eu.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),e.isDefault&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,t.jsx)(w,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),g("settings.prompts.default")]})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tm(e.id),title:g("settings.prompts.setDefault"),children:(0,t.jsx)(w,{className:(0,x.cn)("h-4 w-4",e.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>to(e),title:g("settings.prompts.editPrompt"),children:(0,t.jsx)(S,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>eS(e.id),className:"text-destructive",title:g("settings.prompts.delete"),children:(0,t.jsx)(C.Trash2,{className:"h-4 w-4"})})]})]},e.id))}),(0,t.jsx)(u.Dialog,{open:eg,onOpenChange:ep,children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:eh?g("settings.prompts.editPrompt"):g("settings.prompts.newPrompt")}),(0,t.jsx)(u.DialogDescription,{children:eh?g("settings.prompts.editPrompt"):g("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-name",children:g("settings.prompts.promptName")}),(0,t.jsx)(l.Input,{id:"prompt-name",value:eT,onChange:e=>eM(e.target.value),placeholder:g("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-description",children:g("settings.prompts.promptDescription")}),(0,t.jsx)(l.Input,{id:"prompt-description",value:eD,onChange:e=>eB(e.target.value),placeholder:g("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-content",children:g("settings.prompts.promptContent")}),(0,t.jsx)(o.Textarea,{id:"prompt-content",value:eR,onChange:e=>eP(e.target.value),placeholder:g("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>ep(!1),children:g("settings.prompts.cancel")}),(0,t.jsx)(r.Button,{onClick:tc,disabled:!eT.trim()||!eR.trim(),children:g("settings.prompts.save")})]})]})}),(0,t.jsx)(u.Dialog,{open:!!eC,onOpenChange:e=>!e&&eS(null),children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:g("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(u.DialogDescription,{children:g("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>eS(null),children:g("settings.prompts.cancel")}),(0,t.jsx)(r.Button,{variant:"destructive",onClick:td,children:g("settings.prompts.delete")})]})]})})]}):(0,t.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let s,a,n;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.git.desc")})]}),(0,t.jsxs)(r.Button,{onClick:()=>{eA({...ew}),ez(!0)},children:[(0,t.jsx)(k.Plus,{className:"mr-2 h-4 w-4"}),g("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==eL.length||eV?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eL.map(e=>eI===e.id?(0,t.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.host")}),(0,t.jsx)(l.Input,{value:eH.host,onChange:e=>eE(t=>({...t,host:e.target.value})),placeholder:g("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.ownerMatch")}),(0,t.jsx)(l.Input,{value:eH.ownerMatch,onChange:e=>eE(t=>({...t,ownerMatch:e.target.value})),placeholder:g("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{value:eH.localPathTemplate,onChange:e=>eE(t=>({...t,localPathTemplate:e.target.value})),placeholder:g("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:eW?"default":"outline",size:"sm",type:"button",onClick:()=>eq(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(O.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:g("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:g("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>eJ("edit"),children:(0,t.jsx)(R.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(O.TooltipContent,{children:g("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eW?g("onboarding.step3.pathHintFull"):g("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:g("settings.config.git.priority")}),(0,t.jsx)(l.Input,{type:"number",value:eH.priority,onChange:e=>eE(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>{eF(null),eq(!1)},children:g("settings.config.git.cancel")}),(0,t.jsx)(r.Button,{size:"sm",onClick:()=>tv(e.id),children:g("settings.config.git.save")})]})]},e.id):(0,t.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.host}),"*"!==e.ownerMatch&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",e.ownerMatch]}),(0,t.jsxs)(d.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[g("settings.config.git.priority")," ",e.priority]})]}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:e.localPathTemplate})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t,s,a;return t=e.localPathTemplate,a=(s=/\/\{path\}\/?$/.test(t))?t.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):t,void(eF(e.id),eE({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:a,priority:e.priority}),eq(s))},title:g("settings.config.git.edit"),children:(0,t.jsx)(S,{className:"h-4 w-4"})}),(0,t.jsx)(r.Button,{variant:"ghost",size:"icon-sm",onClick:()=>eZ(e.id),className:"text-destructive",title:g("settings.config.git.delete"),children:(0,t.jsx)(C.Trash2,{className:"h-4 w-4"})})]})]})},e.id))}):(0,t.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:g("settings.config.git.noRules")})}),eV&&(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:g("settings.config.git.host")}),(0,t.jsx)(l.Input,{value:e$.host,onChange:e=>eA(t=>({...t,host:e.target.value})),placeholder:g("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:g("settings.config.git.ownerMatch")}),(0,t.jsx)(l.Input,{value:e$.ownerMatch,onChange:e=>eA(t=>({...t,ownerMatch:e.target.value})),placeholder:g("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:g("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{value:e$.localPathTemplate,onChange:e=>eA(t=>({...t,localPathTemplate:e.target.value})),placeholder:g("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:eK?"default":"outline",size:"sm",type:"button",onClick:()=>eO(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(O.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:g("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:g("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(O.Tooltip,{children:[(0,t.jsx)(O.TooltipTrigger,{render:(0,t.jsx)(r.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>eJ("add"),children:(0,t.jsx)(R.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(O.TooltipContent,{children:g("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eK?g("onboarding.step3.pathHintFull"):g("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:g("settings.config.git.priority")}),(0,t.jsx)(l.Input,{type:"number",value:e$.priority,onChange:e=>eA(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),e$.localPathTemplate&&(s=e$.localPathTemplate.trim().replace(/\/+$/,""),a=eK?`${s}/{path}`:s,n=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:g("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:n.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>eX(s),className:(0,x.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",eG===s?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:e.label},s))})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:n[eG].url}),(0,t.jsxs)("p",{className:"font-mono text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-foreground font-medium",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],n=s.match(/^git@[^:]+:(.+)$/);if(n)a=n[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(s);a=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!a.length)return"";let i=a[0],r=a[a.length-1],l=a.join("/");if(e.includes("{path}"))return e.replace("{path}",l).replace("{owner}",i).replace("{repo}",r).replace(/\/+$/,"");let o=e.replace("{owner}",i).replace("{repo}","").replace(/\/+$/,"");return`${o}/${r}`}(a,n[eG].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(r.Button,{variant:"ghost",size:"sm",onClick:()=>ez(!1),children:g("settings.config.git.cancel")}),(0,t.jsxs)(r.Button,{size:"sm",onClick:tj,disabled:!e$.host.trim()||!e$.localPathTemplate.trim(),children:[(0,t.jsx)(T,{className:"h-3.5 w-3.5 mr-1.5"}),g("settings.config.git.save")]})]})]})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.system.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:500,value:eQ.maxUploadMb,onChange:e=>e0(t=>({...t,maxUploadMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:eQ.maxConcurrent,onChange:e=>e0(t=>({...t,maxConcurrent:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.maxReadable")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.maxReadableHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:1,max:50,value:eQ.maxReadableMb,onChange:e=>e0(t=>({...t,maxReadableMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]})]}),(0,t.jsx)(r.Button,{onClick:tu,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.task.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.task.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.taskDefaultWorktree")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.taskDefaultWorktreeHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e0(e=>({...e,taskDefaultUseWorktree:!e.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${eQ.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:eQ.taskDefaultUseWorktree?g("task.worktreeYes"):g("task.worktreeNo")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.system.taskDefaultAutoStart")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.system.taskDefaultAutoStartHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e0(e=>({...e,taskDefaultAutoStart:!e.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${eQ.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:eQ.taskDefaultAutoStart?g("task.autoStartYes"):g("task.autoStartNo")})]})]}),(0,t.jsx)(r.Button,{onClick:tx,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.gitParams.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:5,max:300,value:e1.timeoutSec,onChange:e=>e2(t=>({...t,timeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,t.jsx)(r.Button,{onClick:tg,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.search.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:5,max:100,value:e5.resultLimit,onChange:e=>e3(t=>({...t,resultLimit:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:1,max:20,value:e5.allModeCap,onChange:e=>e3(t=>({...t,allModeCap:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:50,max:1e3,value:e5.debounceMs,onChange:e=>e3(t=>({...t,debounceMs:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(l.Input,{type:"number",min:20,max:500,value:e5.snippetLength,onChange:e=>e3(t=>({...t,snippetLength:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.search.codeTimeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.search.codeTimeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Input,{type:"number",min:5,max:300,step:5,value:e5.codeTimeoutSec,onChange:e=>e3(t=>({...t,codeTimeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,t.jsx)(r.Button,{onClick:tp,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.missions.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.minCols")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e4.minCols,onChange:e=>e8(t=>({...t,minCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.maxCols")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e4.maxCols,onChange:e=>e8(t=>({...t,maxCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.minRows")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e4.minRows,onChange:e=>e8(t=>({...t,minRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:g("settings.config.missions.maxRows")}),(0,t.jsx)(l.Input,{type:"number",min:1,max:10,value:e4.maxRows,onChange:e=>e8(t=>({...t,maxRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(r.Button,{onClick:th,className:"rounded-lg",children:g("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:g("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:g("settings.config.hooks.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:g("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(l.Input,{value:tt,onChange:e=>ts(e.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsx)(r.Button,{onClick:tf,className:"rounded-lg",children:g("common.save")}),(0,t.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:e6?.installed?g("settings.config.hooks.installed"):g("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:g("settings.config.hooks.installHint")})]}),(0,t.jsx)(r.Button,{variant:e6?.installed?"destructive":"default",onClick:tb,disabled:e9||!e6,className:"rounded-lg",children:e6?.installed?g("settings.config.hooks.uninstall"):g("settings.config.hooks.install")})]})]}),(0,t.jsx)(u.Dialog,{open:!!eY,onOpenChange:e=>!e&&eZ(null),children:(0,t.jsxs)(u.DialogContent,{children:[(0,t.jsxs)(u.DialogHeader,{children:[(0,t.jsx)(u.DialogTitle,{children:g("settings.config.git.deleteConfirm")}),(0,t.jsx)(u.DialogDescription,{children:g("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(u.DialogFooter,{children:[(0,t.jsx)(r.Button,{variant:"outline",onClick:()=>eZ(null),children:g("settings.config.git.cancel")}),(0,t.jsx)(r.Button,{variant:"destructive",onClick:()=>eY&&tN(eY),children:g("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsx)("div",{className:"divide-y divide-border/50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:g("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:g("settings.notifications.enableDesc")})]}),(0,t.jsx)(m.Switch,{checked:ta,onCheckedChange:ty})]})});case"backup":return(0,t.jsx)(er,{});case"extensions":return(0,t.jsx)(eb,{})}}()]})}),(0,t.jsx)(W.FolderBrowserDialog,{open:null!==e_,onOpenChange:e=>{e||eJ(null)},onSelect:e=>{"add"===e_?eA(t=>({...t,localPathTemplate:e})):"edit"===e_&&eE(t=>({...t,localPathTemplate:e})),eJ(null)}})]})}e.s(["default",0,function(){return(0,t.jsx)(eC,{})}],113399)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14842,865514,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),a=e.i(232280),n=e.i(759686),i=e.i(960518),l=e.i(340873),o=e.i(400355),c=e.i(519455),d=e.i(912505),m=e.i(487486),h=e.i(776639),u=e.i(624687),x=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:a}=(0,x.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:a("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:a("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:a("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,x.useI18n)(),r=e.split("\n"),a=r.length>500,n=a?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:n.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),a&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:o,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,x.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[M,D]=(0,s.useState)(!1),[L,A]=(0,s.useState)(""),[F,T]=(0,s.useState)(!1),B=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[o.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>D(!0),className:"gap-2",children:[(0,t.jsx)(l.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===o.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:o.map(e=>{let s=v.has(e.filename),n=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&B(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(m.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:n,isLargeFold:!n&&i>200,onLoad:()=>B(e.filename)})})]},e.filename)})})}),(0,t.jsx)(h.Dialog,{open:M,onOpenChange:D,children:(0,t.jsxs)(h.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsx)(h.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(u.Textarea,{value:L,onChange:e=>A(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>D(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(L.trim()&&w){T(!0);try{await w(L.trim()),A(""),D(!1)}finally{T(!1)}}},disabled:!L.trim()||F,children:F?"...":y("diff.commit")})]})]})})]})}],14842);var g=e.i(538059);let j=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:r,taskId:a,taskTitle:n,baseBranch:i,fileCount:l,commitCount:d,commitLog:m=[],onMergeComplete:u}){let x=(0,g.useRouter)(),[f,p]=(0,s.useState)(!1),[b,w]=(0,s.useState)(null),N=async()=>{p(!0),w(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){r(!1),u(),x.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?w(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):w(t.error??"Merge failed")}catch{w("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(h.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(h.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsxs)(h.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(j,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:i})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),m.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:m.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>r(!1),disabled:f,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:N,disabled:f,className:"gap-2",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},244354,e=>{"use strict";async function t(e,s,r={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!a.ok)throw Error((await a.json()).error||`${s} failed`);return a.json()}e.s(["gitAction",0,t])},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let a=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,a],755696);let n=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,n],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let l=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,l],719493);let o=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,o],436539)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),a=e.i(48019),n=e.i(782516),i=e.i(755696),l=e.i(886156),o=e.i(400355),c=e.i(586564),d=e.i(719493),m=e.i(597746),h=e.i(368490),u=e.i(232280),x=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),M=e.i(755146),D=e.i(759684),L=e.i(746798),A=e.i(776639),F=e.i(793479),T=e.i(624687),B=e.i(533499);function E({open:e,onOpenChange:r,branches:a,currentBranch:n,localPath:i,onCreated:l,onError:c}){let{t:d}=(0,B.useI18n)(),[h,x]=(0,s.useState)(""),[f,p]=(0,s.useState)(n),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,M]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(x(""),p(n),j(""),k(""))},[e,n]);let D=[...new Set(a)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),L=async()=>{if(h.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:h.trim(),baseBranch:f})});if(e.ok)r(!1),l();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(A.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(A.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(A.DialogHeader,{children:(0,t.jsx)(A.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(F.Input,{value:h,onChange:e=>x(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&L()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>M(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:D.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),M(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(m.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(T.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(A.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:L,disabled:!h.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var I=e.i(360112),$=e.i(244354);let R={modified:l.FileEdit,added:a.FilePlus,deleted:n.FileMinus,untracked:i.FileQuestion,renamed:l.FileEdit},z={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},P={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function U(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/"),r=t;for(let t=0;t<e.length;t++){let a=e[t],n=t===e.length-1,i=e.slice(0,t+1).join("/");if(n)r.children.push({name:a,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function G({label:e,count:r,labelColor:a,tree:n,batchAction:i,batchLabel:l,batchIcon:o,onFileClick:c,onFileAction:d,fileActionIcon:m,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(h.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${a}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:n.map(e=>(0,t.jsx)(O,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:m,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function O({node:e,depth:a,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:m}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${a} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(h.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(x.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(O,{node:e,depth:a+1,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:m},e.path))]});let j=e.file,b=R[j.status]||r.File,w=z[j.status]||"text-muted-foreground",N=P[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>n(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":m??"",children:d}),m&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:m})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":o??"",children:l}),o&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:o})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:a="project"}){let n="task"===a,{t:i}=(0,B.useI18n)(),[l,h]=(0,s.useState)(null),[x,A]=(0,s.useState)(!0),[F,T]=(0,s.useState)(""),[R,z]=(0,s.useState)(!1),[P,O]=(0,s.useState)(!1),[H,W]=(0,s.useState)(!1),[V,K]=(0,s.useState)(!1),[q,J]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(""),Y=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(q)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){Y.current&&!Y.current.contains(e.target)&&J(!1)}},[q]);let[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();h({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{A(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,$.gitAction)(e,"stage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,$.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(F.trim()){z(!0);try{await (0,$.gitAction)(e,"commit",{message:F}),T(""),I.toast.success(i("git.commitSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{z(!1)}}},ea=async t=>{O(!0);try{await (0,$.gitAction)(e,"pull",t?{branch:t}:{}),I.toast.success(i("git.pullSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{O(!1)}},en=async t=>{W(!0);try{await (0,$.gitAction)(e,"push",t?{branch:t}:{}),I.toast.success(i("git.pushSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{W(!1)}},ei=async()=>{K(!0);try{await (0,$.gitAction)(e,"fetch"),I.toast.success(i("git.fetchSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{K(!1)}},el=async t=>{try{await (0,$.gitAction)(e,"checkout",{branch:t}),J(!1),I.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eo=async()=>{try{await (0,$.gitAction)(e,"stash-save",{message:F||void 0}),T(""),I.toast.success(i("git.stashSaved")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,$.gitAction)(e,"stash-pop",{index:0}),I.toast.success(i("git.stashApplied")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,$.gitAction)(e,"discard-file",{file:t}),I.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},em=async()=>{try{await (0,$.gitAction)(e,"discard-all"),I.toast.success(i("git.discardSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eh=async t=>{if("deleted"===t.status)return;let s=l?.topLevel??e;try{let a=await (0,$.gitAction)(e,"show",{file:t.file});r?.(t.file,a.content??"",s)}catch{r?.(t.file,"",s)}},eu=l?.changedFiles.filter(e=>e.staged)??[],ex=l?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>U(eu),[eu]),ep=(0,s.useMemo)(()=>U(ex),[ex]);if(x)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!l)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...l?.branches??[],...(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e))],eb=Q?ej.filter(e=>e.toLowerCase().includes(Q.toLowerCase())):ej;return(0,t.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[n?(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:l?.currentBranch||"—"})]})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:l?.currentBranch||"—"})]}):(0,t.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Y,children:[(0,t.jsxs)("button",{onClick:()=>{J(!q),X("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l?.currentBranch||void 0,children:l?.currentBranch||"—"})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${q?"rotate-180":""}`})]}),q&&(0,t.jsxs)("div",{className:"absolute left-0 top-full z-30 mt-1 min-w-full w-max max-w-[320px] rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:Q,onChange:e=>X(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>{let s=e===l?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?J(!1):el(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(m.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>el(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:ei,disabled:V,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${V?"animate-spin":""}`})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:()=>{J(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:F,onChange:e=>T(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:R||!F.trim()||0===eu.length,children:[R?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(m.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(M.DropdownMenu,{children:[(0,t.jsx)(M.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(M.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:er,disabled:!F.trim()||0===eu.length,children:[(0,t.jsx)(m.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===ex.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===eu.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:em,disabled:0===ex.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),disabled:P,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:P,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",l.behind]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",l.ahead]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ei,disabled:V,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${V?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eo,disabled:0===l.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),l.currentBranch]})]})]})]})]}),(0,t.jsxs)(D.ScrollArea,{className:"flex-1 min-h-0",children:[(0,t.jsx)(G,{label:i("git.stagedChanges"),count:eu.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:eh,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(G,{label:i("git.unstagedChanges"),count:ex.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:eh,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===l.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(m.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...l?.branches??[],...l?.remoteBranches??[]],currentBranch:l?.currentBranch??"",localPath:e,onCreated:async()=>{I.toast.success(i("git.createSuccess")),await ee()},onError:e=>I.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},517677,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60e903d81016ad087f0673954b19123d6402d9ea4d",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])},37170,382216,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c5e3b54118977428104afc6d77720611257ac522a",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],37170);let r=(0,t.createServerReference)("40d0c8238b487e664660cb962acdf111f015db29da",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],382216)},188013,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("400329c68fcd02edea883a2bcaf2651767b169dfd3",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},714039,309955,629777,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60f81021da1a9765ca9d3ef0fdcc96463310df9374",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,s],714039);let r=(0,t.createServerReference)("40b0c9a5c3b37cdf74d8565ce067e8917e63c79c45",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,r],309955);let a=(0,t.createServerReference)("6017cfb7c1ea9098673c3fb41bf5fb4209494d7dd7",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],629777)},486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),a=e.i(472074),n=e.i(301348),i=e.i(181209),l=e.i(400355),o=e.i(989383),c=e.i(12659),d=e.i(922541),m=e.i(486077),h=e.i(769824),u=e.i(519455),x=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(n.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:n,onContinueLatest:i}){let{t:l,locale:o}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(x.EmptyState,{icon:h.History,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(s=>{let h=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),x=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let a=Math.floor(r/60);if(a<60)return`${a}m ${r%60}s`;let n=Math.floor(a/60);return`${n}h ${a%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",n=s.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===r?n:1===r?"zh"===t?`昨天 ${n}`:`Yesterday ${n}`:r<7?"zh"===t?`${r}天前 ${n}`:`${r}d ago ${n}`:s.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+n}(s.startedAt??null,o)}),x&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",x,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||l("execution.noSummary")}),h&&(h.commits||h.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[h.commits?(0,t.jsxs)("span",{children:[h.commits," ",l("execution.commits")]}):null,h.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[h.filesChanged," ",l("execution.files")]})]}):null,h.insertions||h.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),h.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",h.insertions]}):null,h.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",h.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(m.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&n?(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>n(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(u.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(u.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},685149,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},583329,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40761db40351e40c001ff439284f4ab6a350d93b1b",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,r])},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},35967,e=>{"use strict";var t=e.i(289721);let r=(0,e.i(572989).default)("milestone",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",key:"8gz4t4"}]]);var a=e.i(533499);let s=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function l(e){return s[function(e){let t=0;for(let r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)>>>0;return t}(e)%s.length]}let n={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};e.s(["TaskVersionTag",0,function({number:e,name:a,showName:s=!1,className:l="",title:n}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground ${l}`,title:n??(a?`${e} \xb7 ${a}`:e),children:[(0,t.jsx)(r,{className:"h-2.5 w-2.5 shrink-0"}),(0,t.jsx)("span",{className:"font-mono",children:e}),s&&a?(0,t.jsx)("span",{className:"max-w-[140px] truncate",children:a}):null]})},"VersionStatusBadge",0,function({status:e}){let{t:r}=(0,a.useI18n)();return(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${n[e]}`,children:r(`version.status.${e}`)})},"VersionTypeBadge",0,function({name:e}){let{t:r}=(0,a.useI18n)();return e?(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${l(e)}`,children:e}):(0,t.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:r("version.type.uncategorized")})},"typeBadgeColor",0,l],35967)},736061,460707,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);e.s(["FolderSearch",0,r],736061);let a=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,a],460707)},197550,852494,12659,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("4072804d823a8f55231ec0829fb98a68bc38646216",t.callServer,void 0,t.findSourceMapURL,"openInFileManager");e.s(["openInFileManager",0,r],197550);let a=(0,t.createServerReference)("40a7283207727ed21a6ecaca85b390988b3687e1dd",t.callServer,void 0,t.findSourceMapURL,"openInEditor");e.s(["openInEditor",0,a],852494);let s=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,s],12659)},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},436325,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("406e2e4cc47185291de78e1588274f4b8e46cedb04",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},960518,e=>{"use strict";let t=(0,e.i(572989).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);e.s(["GitCompare",0,t],960518)},340873,e=>{"use strict";let t=(0,e.i(572989).default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);e.s(["GitCommitHorizontal",0,t],340873)},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let r=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],181209)},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},563733,873753,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40252ce6324c0a56a08d03d678ff95af7c0e773e32",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],563733);let a=(0,t.createServerReference)("405307474d0da8ca50db2ee023d1f65f98b80aa7c9",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,a],873753)},313029,e=>{"use strict";let t=(0,e.i(572989).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],313029)},340966,e=>{"use strict";let t=(0,e.i(572989).default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);e.s(["ClipboardList",0,t],340966)},429210,473221,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40bdcb74096059f4c6d1bf545d5c112909b8e31288",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r],429210);let a=(0,t.createServerReference)("60a23bafb2c8929e089c752c7bd461cd011370b31b",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,a],473221)},892734,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("7c50b2b2b3cc8fcb16701e9f4144bccc1b03e04d4f",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,r])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:a,description:s,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:s}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},438304,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("404c7c8c8659fa543c75c036f8ab21e65ffe609add",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,r])},796299,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40a687436d6cfb65f9c73a1833051c6880315d0db5",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,r])},235357,144640,e=>{"use strict";var t=e.i(289721),r=e.i(965652),a=e.i(585012),s=e.i(657153),l=e.i(19671),n=e.i(368490),i=e.i(902539);let c=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var o=e.i(922541),d=e.i(533499);function u({children:e,onClick:r,title:a,disabled:s,...l}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),s||r()},title:a,disabled:s,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...l,children:e})}e.s(["ImageLightbox",0,function({imageUrl:e,filename:x,open:h,onOpenChange:b,assets:p,currentIndex:f,onIndexChange:m}){let{t:g}=(0,d.useI18n)(),[v,y]=(0,r.useState)(1),[k,w]=(0,r.useState)({x:0,y:0}),[j,N]=(0,r.useState)(!1),S=(0,r.useRef)(null),[C,M]=(0,r.useState)(!1),E=!!p&&p.length>1&&"number"==typeof f&&!!m,R=E&&f>0,L=E&&f<p.length-1,P=E?p.length:0,I=P>0?Math.ceil(P/10):0,T=E?Math.floor(f/10):0,A=10*T,O=Math.min(A+10,P),z=I>1,D=E&&T>0,$=E&&T<I-1;(0,r.useEffect)(()=>{M(!0)},[]),(0,r.useEffect)(()=>{y(1),w({x:0,y:0})},[e]),(0,r.useEffect)(()=>{if(!h)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[h]);let U=(0,r.useCallback)(()=>b(!1),[b]),_=(0,r.useCallback)(()=>{E&&R&&m(f-1)},[E,R,m,f]),H=(0,r.useCallback)(()=>{E&&L&&m(f+1)},[E,L,m,f]),q=(0,r.useCallback)(()=>{E&&D&&m((T-1)*10)},[E,D,m,T]),V=(0,r.useCallback)(()=>{E&&$&&m(Math.min((T+1)*10,P-1))},[E,$,m,T,P]),G=(0,r.useCallback)(()=>{y(e=>Math.min(8,1.25*e))},[]),F=(0,r.useCallback)(()=>{y(e=>{let t=Math.max(.1,e/1.25);return t<=1&&w({x:0,y:0}),t})},[]),B=(0,r.useCallback)(()=>{y(1),w({x:0,y:0})},[]);(0,r.useEffect)(()=>{if(!h)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),U();break;case"ArrowLeft":E&&(e.preventDefault(),_());break;case"ArrowRight":E&&(e.preventDefault(),H());break;case"+":case"=":e.preventDefault(),G();break;case"-":case"_":e.preventDefault(),F();break;case"0":e.preventDefault(),B()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[h,E,U,_,H,G,F,B]);let X=(0,r.useRef)(!1),Y=()=>{j&&N(!1),S.current=null},W=j?"cursor-grabbing":"cursor-grab";if(!h||!C)return null;let J=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":g("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[x,E?` \xb7 ${f+1} / ${p.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${W}`,onClick:e=>{e.target===e.currentTarget&&U()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;y(e=>{let r=Math.min(8,Math.max(.1,e*t));return r<=1&&w({x:0,y:0}),r})},children:e&&(0,t.jsx)("img",{src:e,alt:x,onClick:e=>{e.stopPropagation(),X.current&&(X.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),X.current=!1,e.target.setPointerCapture?.(e.pointerId),S.current={x:e.clientX,y:e.clientY,panX:k.x,panY:k.y},N(!0))},onPointerMove:e=>{if(!S.current)return;let t=e.clientX-S.current.x,r=e.clientY-S.current.y;Math.abs(t)+Math.abs(r)>5&&(X.current=!0),j&&w({x:S.current.panX+t,y:S.current.panY+r})},onPointerUp:Y,onPointerLeave:Y,onPointerCancel:Y,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${k.x}px, ${k.y}px, 0) scale(${v})`,transformOrigin:"center center",transition:j?"none":"transform 120ms ease-out",willChange:j?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[E&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[z&&(0,t.jsx)(u,{onClick:q,title:`${g("assets.lightbox.prev")} (-10)`,"aria-label":`${g("assets.lightbox.prev")} (-10)`,disabled:!D,children:(0,t.jsx)(i.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(u,{onClick:_,title:g("assets.lightbox.prev"),"aria-label":g("assets.lightbox.prev"),disabled:!R,children:(0,t.jsx)(l.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:p.slice(A,O).map((e,r)=>{let a=A+r,s=a===f;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),s||m(a)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${s?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+a)})}),(0,t.jsx)(u,{onClick:H,title:g("assets.lightbox.next"),"aria-label":g("assets.lightbox.next"),disabled:!L,children:(0,t.jsx)(n.ChevronRight,{className:"h-4 w-4"})}),z&&(0,t.jsx)(u,{onClick:V,title:`${g("assets.lightbox.next")} (+10)`,"aria-label":`${g("assets.lightbox.next")} (+10)`,disabled:!$,children:(0,t.jsx)(c,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*v),"%"]}),(0,t.jsx)(u,{onClick:B,title:g("assets.lightbox.reset"),"aria-label":g("assets.lightbox.reset"),disabled:1===v&&0===k.x&&0===k.y,children:(0,t.jsx)(o.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(u,{onClick:U,title:g("assets.lightbox.close"),"aria-label":g("assets.lightbox.close"),children:(0,t.jsx)(s.X,{className:"h-4 w-4"})})]})]})]});return(0,a.createPortal)(J,document.body)}],235357);var x=e.i(400355);e.i(254826);var h=e.i(309735),b=e.i(776639);e.s(["TextPreviewDialog",0,function({url:e,filename:a,open:s,onOpenChange:l}){let{t:n}=(0,d.useI18n)(),[i,c]=(0,r.useState)(null),[o,u]=(0,r.useState)(!1),[p,f]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!s||!e){c(null),f(null);return}let t=!1;return u(!0),f(null),c(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(c(e),u(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?f(n("assets.fileTooLarge")):f(n("assets.previewError")),u(!1))}),()=>{t=!0}},[s,e,n]);let m=a.split(".").pop()?.toLowerCase();return(0,t.jsx)(b.Dialog,{open:s,onOpenChange:l,children:(0,t.jsxs)(b.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:a}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(o)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(x.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:n("assets.loadingPreview")})]});if(p)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:p});if(null===i)return null;if("md"===m)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(h.Streamdown,{children:i})});if("json"===m){let e;try{e=JSON.stringify(JSON.parse(i),null,2)}catch{e=i}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:i})})()})]})})}],144640)},937304,e=>{"use strict";let t=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif","apng"]);e.s(["isImageAsset",0,function(e,r){if(r?.startsWith("image/"))return!0;let a=e.split(".").pop()?.toLowerCase();return!!a&&t.has(a)},"localPathToApiUrl",0,function(e){let t=e.match(/(?:^|\/)(?:storage|data)\/assets\/([^/]+)\/([^/]+)$/);return t?`/api/files/assets/${t[1]}/${t[2]}`:e}])},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);