tower-studio 0.2.21 → 0.2.22

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 (204) 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 +65 -65
  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 +55 -55
  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 +64 -64
  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 +72 -72
  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 +43 -43
  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]__0umocfj._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
  94. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xot7fu._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z-k6vg._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  99. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02-6df-._.js +3 -3
  100. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0th0_fo._.js → [root-of-the-server]__03e009u._.js} +4 -4
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e_-mj-._.js +3 -3
  102. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fzkdjl._.js +3 -3
  103. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0hy3~f.._.js → [root-of-the-server]__0i~v.f0._.js} +2 -2
  104. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  105. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0q-abig._.js → [root-of-the-server]__0l1.bgv._.js} +2 -2
  106. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pu-v0l._.js +3 -3
  107. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ty1ao1._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0um1ugs._.js +3 -3
  109. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__10ol5vl._.js → [root-of-the-server]__0vrp4wc._.js} +1 -1
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0x2jop0._.js +3 -0
  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]__134_xv.._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vgkq5._.js +3 -3
  114. package/.next/standalone/.next/server/chunks/ssr/{_03.a~r1._.js → _00xgezz._.js} +2 -2
  115. package/.next/standalone/.next/server/chunks/ssr/{_0aw2qq6._.js → _01xe7~b._.js} +2 -2
  116. package/.next/standalone/.next/server/chunks/ssr/_02o-w3k._.js +3 -0
  117. package/.next/standalone/.next/server/chunks/ssr/{_0ghovf3._.js → _0564air._.js} +2 -2
  118. package/.next/standalone/.next/server/chunks/ssr/{_0rqf5w7._.js → _05xdaz3._.js} +1 -1
  119. package/.next/standalone/.next/server/chunks/ssr/_060_9cj._.js +3 -0
  120. package/.next/standalone/.next/server/chunks/ssr/{_0unw1fq._.js → _070t_mh._.js} +3 -3
  121. package/.next/standalone/.next/server/chunks/ssr/{_09j4imi._.js → _075_.cb._.js} +2 -2
  122. package/.next/standalone/.next/server/chunks/ssr/_07ca~8h._.js +3 -0
  123. package/.next/standalone/.next/server/chunks/ssr/{_0jyj~t3._.js → _084ifnn._.js} +3 -3
  124. package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
  125. package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
  126. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/_0ncltnn._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ssr/{_0yakvlq._.js → _0qq3k6g._.js} +3 -3
  130. package/.next/standalone/.next/server/chunks/ssr/_0r6gweb._.js +3 -3
  131. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/_0rt8jf_._.js +3 -3
  133. package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/_0uuzh5m._.js +3 -3
  135. package/.next/standalone/.next/server/chunks/ssr/{_13r9dxk._.js → _0z58pqh._.js} +3 -3
  136. package/.next/standalone/.next/server/chunks/ssr/_0zbuayb._.js +3 -0
  137. package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
  138. package/.next/standalone/.next/server/chunks/ssr/_13dksil._.js +3 -0
  139. package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  150. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0153vha._.js → src_lib_0.aklj3._.js} +1 -1
  151. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  152. package/.next/standalone/.next/server/pages/500.html +1 -1
  153. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  154. package/.next/standalone/.next/server/server-reference-manifest.json +300 -276
  155. package/.next/standalone/.next/static/chunks/{0f1gk0.5slqqh.js → 0.onfoo7t4w-m.js} +1 -1
  156. package/.next/standalone/.next/static/chunks/0132~w09sg8ej.js +1 -0
  157. package/.next/standalone/.next/static/chunks/{0ip_37zz4f080.js → 015m584n.xxu~.js} +1 -1
  158. package/.next/standalone/.next/static/chunks/{17oxpxjm7_smn.js → 01fk6.8bw14.7.js} +1 -1
  159. package/.next/standalone/.next/static/chunks/{0pg_rf2cch5pv.js → 01vvdks5yzk7x.js} +1 -1
  160. package/.next/standalone/.next/static/chunks/{0j16~sj50uq_m.js → 030g1-s.qdj2n.js} +1 -1
  161. package/.next/standalone/.next/static/chunks/{0vyvdsh1mkl5d.js → 07ucj-4sybtq9.js} +1 -1
  162. package/.next/standalone/.next/static/chunks/{0aq7ksckxr-8-.js → 08vuh22p.47~b.js} +2 -2
  163. package/.next/standalone/.next/static/chunks/0_t-j983f5f0p.js +1 -0
  164. package/.next/standalone/.next/static/chunks/{16sn2ij01qrfz.js → 0cn44krrztr-n.js} +1 -1
  165. package/.next/standalone/.next/static/chunks/{0rwca.wrfl3b9.js → 0feyhaj64gfd~.js} +1 -1
  166. package/.next/standalone/.next/static/chunks/{02bobmiee9ss8.js → 0hf2igz3z1v.5.js} +1 -1
  167. package/.next/standalone/.next/static/chunks/{0ol16355~utic.js → 0htnxzje.8d3f.js} +2 -2
  168. package/.next/standalone/.next/static/chunks/0lq9lfznfhl-6.js +1 -0
  169. package/.next/standalone/.next/static/chunks/0plqjpgas0ygu.js +1 -0
  170. package/.next/standalone/.next/static/chunks/{0o8jf4a30e_ri.js → 0t92fwd6kv5j_.js} +2 -2
  171. package/.next/standalone/.next/static/chunks/{06~1n6of8ll__.js → 0tfc~d_oxesgk.js} +2 -2
  172. package/.next/standalone/.next/static/chunks/{01tnwkggn5.s-.js → 0w1jry5z5w5~5.js} +1 -1
  173. package/.next/standalone/.next/static/chunks/0x3tiuoe.l18z.js +1 -0
  174. package/.next/standalone/.next/static/chunks/0y8ywrftfsnux.js +1 -0
  175. package/.next/standalone/.next/static/chunks/11jg-t_iw_8i6.js +1 -0
  176. package/.next/standalone/.next/static/chunks/11x05y67gti4v.js +5 -0
  177. package/.next/standalone/.next/static/chunks/11yv2zlsl_i7z.js +1 -0
  178. package/.next/standalone/.next/static/chunks/13z_8s26xa~p1.js +1 -0
  179. package/.next/standalone/.next/static/chunks/{00p3.tda-56.l.js → 15.pdp8xgoni1.js} +1 -1
  180. package/.next/standalone/.next/static/chunks/15vogvewouq8e.js +1 -0
  181. package/.next/standalone/package.json +1 -1
  182. package/dist/mcp-server.cjs +19 -5
  183. package/package.json +1 -1
  184. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q~lxnz._.js +0 -3
  185. package/.next/standalone/.next/server/chunks/ssr/_00jadm8._.js +0 -3
  186. package/.next/standalone/.next/server/chunks/ssr/_053zyvm._.js +0 -3
  187. package/.next/standalone/.next/server/chunks/ssr/_08x3jaa._.js +0 -3
  188. package/.next/standalone/.next/server/chunks/ssr/_09r0_z9._.js +0 -3
  189. package/.next/standalone/.next/server/chunks/ssr/_0a554d8._.js +0 -3
  190. package/.next/standalone/.next/server/chunks/ssr/_0bmywa6._.js +0 -3
  191. package/.next/standalone/.next/static/chunks/00fv~h4rni5hv.js +0 -1
  192. package/.next/standalone/.next/static/chunks/039ntokp82-em.js +0 -1
  193. package/.next/standalone/.next/static/chunks/04yrp-8ps3q_-.js +0 -1
  194. package/.next/standalone/.next/static/chunks/05.wfh773dxo9.js +0 -1
  195. package/.next/standalone/.next/static/chunks/08rokhw7bg_zn.js +0 -1
  196. package/.next/standalone/.next/static/chunks/0_n2l3jehwcsq.js +0 -1
  197. package/.next/standalone/.next/static/chunks/0d4~4k4hv01ah.js +0 -1
  198. package/.next/standalone/.next/static/chunks/0pwe0m3i1rro1.js +0 -1
  199. package/.next/standalone/.next/static/chunks/0srx~7bncp64q.js +0 -5
  200. package/.next/standalone/.next/static/chunks/10h~50kdsu5fx.js +0 -1
  201. package/.next/standalone/.next/static/chunks/15esfko8asvh7.js +0 -1
  202. /package/.next/standalone/.next/static/{zosKR5i2aA392qu0Ka1j9 → hA1HHDvQi_vSYi568JXho}/_buildManifest.js +0 -0
  203. /package/.next/standalone/.next/static/{zosKR5i2aA392qu0Ka1j9 → hA1HHDvQi_vSYi568JXho}/_clientMiddlewareManifest.js +0 -0
  204. /package/.next/standalone/.next/static/{zosKR5i2aA392qu0Ka1j9 → hA1HHDvQi_vSYi568JXho}/_ssgManifest.js +0 -0
@@ -1,3 +0,0 @@
1
- module.exports=[264589,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["Package",0,b],264589)},236196,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40f12a108d0c4d5258611b0dd1894d7aafae502aed",b.callServer,void 0,b.findSourceMapURL,"getConfigValues");a.s(["getConfigValues",0,c])},269280,a=>{"use strict";let b=(0,a.i(711796).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);a.s(["ArrowLeft",0,b],269280)},521007,a=>{"use strict";a.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"])},786304,a=>{"use strict";var b=a.i(475295),c=a.i(213200),d=a.i(142261),e=a.i(368114);let f=(0,d.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"}});a.s(["Badge",0,function({className:a,variant:d="default",render:g,...h}){var i;return i={defaultTagName:"span",props:(0,b.mergeProps)({className:(0,e.cn)(f({variant:d}),a)},h),render:g,state:{slot:"badge",variant:d}},(0,c.useRenderElement)(i.defaultTagName??"div",i,i)}],786304)},69544,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40761db40351e40c001ff439284f4ab6a350d93b1b",b.callServer,void 0,b.findSourceMapURL,"openInTerminal");a.s(["openInTerminal",0,c])},648512,a=>{"use strict";let b=(0,a.i(711796).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);a.s(["Terminal",0,b],648512)},974471,52251,165614,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("4072804d823a8f55231ec0829fb98a68bc38646216",b.callServer,void 0,b.findSourceMapURL,"openInFileManager");a.s(["openInFileManager",0,c],974471);let d=(0,b.createServerReference)("40a7283207727ed21a6ecaca85b390988b3687e1dd",b.callServer,void 0,b.findSourceMapURL,"openInEditor");a.s(["openInEditor",0,d],52251);let e=(0,a.i(711796).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"}]]);a.s(["PlayCircle",0,e],165614)},625892,939859,a=>{"use strict";var b=a.i(711796);let c=(0,b.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"}]]);a.s(["FolderSearch",0,c],625892);let d=(0,b.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);a.s(["Code",0,d],939859)},551578,a=>{"use strict";var b=a.i(728778);let c=(0,a.i(711796).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 d=a.i(951192);let e=["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 f(a){return e[function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)>>>0;return b}(a)%e.length]}let g={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"};a.s(["TaskVersionTag",0,function({number:a,name:d,showName:e=!1,className:f="",title:g}){return(0,b.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 ${f}`,title:g??(d?`${a} \xb7 ${d}`:a),children:[(0,b.jsx)(c,{className:"h-2.5 w-2.5 shrink-0"}),(0,b.jsx)("span",{className:"font-mono",children:a}),e&&d?(0,b.jsx)("span",{className:"max-w-[140px] truncate",children:d}):null]})},"VersionStatusBadge",0,function({status:a}){let{t:c}=(0,d.useI18n)();return(0,b.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${g[a]}`,children:c(`version.status.${a}`)})},"VersionTypeBadge",0,function({name:a}){let{t:c}=(0,d.useI18n)();return a?(0,b.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${f(a)}`,children:a}):(0,b.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:c("version.type.uncategorized")})},"typeBadgeColor",0,f],551578)},757061,462831,a=>{"use strict";var b=a.i(728778),c=a.i(432949),d=a.i(368114),e=a.i(699570),f=a.i(14906);function g({...a}){return(0,b.jsx)(c.Dialog.Portal,{"data-slot":"sheet-portal",...a})}function h({className:a,...e}){return(0,b.jsx)(c.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,d.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",a),...e})}a.s(["Sheet",0,function({...a}){return(0,b.jsx)(c.Dialog.Root,{"data-slot":"sheet",...a})},"SheetContent",0,function({className:a,children:i,side:j="right",showCloseButton:k=!0,...l}){return(0,b.jsxs)(g,{children:[(0,b.jsx)(h,{}),(0,b.jsxs)(c.Dialog.Popup,{"data-slot":"sheet-content","data-side":j,className:(0,d.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",a),...l,children:[i,k&&(0,b.jsxs)(c.Dialog.Close,{"data-slot":"sheet-close",render:(0,b.jsx)(e.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,b.jsx)(f.XIcon,{}),(0,b.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:a,...e}){return(0,b.jsx)(c.Dialog.Description,{"data-slot":"sheet-description",className:(0,d.cn)("text-sm text-muted-foreground",a),...e})},"SheetHeader",0,function({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"sheet-header",className:(0,d.cn)("flex flex-col gap-0.5 p-4",a),...c})},"SheetTitle",0,function({className:a,...e}){return(0,b.jsx)(c.Dialog.Title,{"data-slot":"sheet-title",className:(0,d.cn)("font-heading text-base font-medium text-foreground",a),...e})}],757061);var i=a.i(780410);let j=(0,i.createServerReference)("403b726cc7d9cff0549ec73b0b63b5550d931ba5bc",i.callServer,void 0,i.findSourceMapURL,"getTaskOverview");a.s(["getTaskOverview",0,j],462831)},157551,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["Calendar",0,b],157551)},972420,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(757061),e=a.i(269876),f=a.i(786304),g=a.i(699570),h=a.i(951192),i=a.i(851333),j=a.i(462831),k=a.i(540479),l=a.i(974471),m=a.i(52251),n=a.i(69544),o=a.i(445798),p=a.i(521007),q=a.i(157551),r=a.i(22761),s=a.i(264589),t=a.i(165614),u=a.i(625892),v=a.i(939859),w=a.i(648512);function x({added:a,removed:c}){let{t:d}=(0,h.useI18n)();return(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,b.jsx)("span",{children:d("diff.filesChanged",{count:String(a+c)})}),a>0&&(0,b.jsxs)("span",{className:"text-green-500",children:["+",a]}),c>0&&(0,b.jsxs)("span",{className:"text-red-500",children:["-",c]})]})}var y=a.i(551578),z=a.i(952313);a.s(["TaskOverviewDrawer",0,function({open:a,onOpenChange:A,taskId:B}){let{t:C}=(0,h.useI18n)(),[D,E]=(0,c.useState)(null),[F,G]=(0,c.useTransition)(),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)([]);(0,c.useEffect)(()=>{B&&a?G(async()=>{let a=await (0,j.getTaskOverview)(B);a&&(E(a),a.project?.workspaceId&&(0,k.getLabelsForWorkspace)(a.project.workspaceId).then(a=>{K(a.map(a=>({id:a.id,name:a.name,color:a.color,isBuiltin:a.isBuiltin})))}).catch(()=>K([])))}):E(null)},[B,a]);let L=D?p.BOARD_COLUMNS.find(a=>a.id===D.status):null,M=D?p.PRIORITY_CONFIG[D.priority]:null,N=D?.executions?.[0]??null,O=(()=>{if(N?.worktreePath)return N.worktreePath;let a=D?.project?.localPath;return a?D?.subPath?`${a}/${D.subPath}`:a:null})(),P=(()=>{let a=N?.gitStats;if(!a)return null;try{let b=JSON.parse(a);return{added:b.insertions??0,removed:b.deletions??0}}catch{return null}})(),Q=async a=>{if(D?.project)try{let{autoStart:b,...c}=a;await (0,i.createTask)({...c,projectId:D.project.id}),z.toast.success(C("taskDrawer.duplicateSuccess")),I(!1),A(!1)}catch{z.toast.error(C("taskDrawer.duplicateFailed"))}};return(0,b.jsxs)(d.Sheet,{open:a,onOpenChange:A,children:[(0,b.jsxs)(d.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,b.jsxs)(d.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,b.jsx)(d.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:D?.title??""}),(0,b.jsx)(d.SheetDescription,{className:"sr-only",children:C("taskDrawer.title")}),D&&(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[L&&(0,b.jsxs)(f.Badge,{variant:"secondary",className:"text-xs",children:[(0,b.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${L.color}`}),L.label]}),M&&(0,b.jsx)(f.Badge,{variant:"secondary",className:`text-xs ${M.color}`,children:M.label}),D.version&&(0,b.jsx)(y.TaskVersionTag,{number:D.version.number,name:D.version.name,showName:!0})]})]}),(0,b.jsx)(e.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:F&&!D?(0,b.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:C("assets.loading")}):D?(0,b.jsxs)("div",{className:"p-4 space-y-4",children:[(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:C("taskDrawer.description")}),(0,b.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:D.description||C("taskDrawer.noDescription")})]}),D.labels.length>0&&(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:C("taskDrawer.labels")}),(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:D.labels.map(a=>(0,b.jsx)(f.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${a.label.color}20`,color:a.label.color,borderColor:`${a.label.color}40`},children:a.label.name},a.label.id))})]}),(0,b.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(q.Calendar,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:C("taskDrawer.createdAt")}),(0,b.jsx)("span",{className:"text-foreground",children:new Date(D.createdAt).toLocaleDateString()})]}),(0,b.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(s.Package,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:C("taskDrawer.resources")}),(0,b.jsx)("span",{className:"text-foreground",children:D._count.assets})]}),(0,b.jsxs)("section",{children:[(0,b.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:C("taskDrawer.fileChanges")}),P?(0,b.jsx)(x,{added:P.added,removed:P.removed}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:C("taskDrawer.noFileChanges")})]}),(0,b.jsxs)("section",{children:[(0,b.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,b.jsx)(t.PlayCircle,{className:"h-3.5 w-3.5"}),C("taskDrawer.lastExecution")]}),N?(0,b.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,b.jsx)(f.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:N.status}),N.summary&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:N.summary.slice(0,200)})]}):(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:C("taskDrawer.noExecution")})]}),O&&(0,b.jsxs)("section",{className:"flex flex-col",children:[(0,b.jsxs)(g.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,l.openInFileManager)(O)}catch(a){console.error("openInFileManager failed:",a),z.toast.error(C("git.openInFileManagerFailed"))}},children:[(0,b.jsx)(u.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInFileManager")]}),(0,b.jsxs)(g.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.openInEditor)(O)}catch(a){console.error("openInEditor failed:",a),z.toast.error(C("git.openInEditorFailed"))}},children:[(0,b.jsx)(v.Code,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInEditor")]}),(0,b.jsxs)(g.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,n.openInTerminal)(O)}catch(a){console.error("openInTerminal failed:",a),z.toast.error(C("git.openInTerminalFailed"))}},children:[(0,b.jsx)(w.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),C("git.openInTerminal")]})]}),(0,b.jsx)("section",{children:(0,b.jsxs)(g.Button,{variant:"default",className:"w-full",onClick:()=>{D&&I(!0)},disabled:!D,children:[(0,b.jsx)(r.Copy,{className:"h-4 w-4"}),C("taskDrawer.duplicate")]})})]}):null})]}),D?.project&&(0,b.jsx)(o.CreateTaskDialog,{open:H,onOpenChange:I,onSubmit:Q,labels:J,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(a=>a.label.id),baseBranch:D.baseBranch}})]})}],972420)}];
2
-
3
- //# sourceMappingURL=_053zyvm._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[300141,639138,88757,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,c],300141);var d=a.i(728778),e=a.i(374637),f=a.i(10390),g=a.i(442620),h=a.i(811344),i=a.i(394869),j=a.i(207339),k=a.i(704494),l=a.i(699570),m=a.i(579834),n=a.i(786304),o=a.i(814574),p=a.i(429246),q=a.i(951192);function r({patchState:a,isLargeFold:b,onLoad:c}){let{t:e}=(0,q.useI18n)();return b?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,d.jsx)(l.Button,{variant:"link",onClick:c,className:"h-auto p-0 text-sm",children:e("diff.loadDiff")}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:e("diff.foldedLarge")})]}):a&&"loading"!==a.kind?"error"===a.kind?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,d.jsx)("span",{children:e("diff.loadFailed")}),(0,d.jsx)(l.Button,{variant:"ghost",onClick:c,children:e("diff.retry")})]}):"binary"===a.kind?(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:e("diff.binaryNotShown")}):"empty"===a.kind?(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:e("diff.noChanges")}):(0,d.jsx)(s,{patch:a.patch??""}):(0,d.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,d.jsx)(k.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function s({patch:a}){let{t:b}=(0,q.useI18n)(),c=a.split("\n"),e=c.length>500,f=e?c.slice(0,500):c;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:f.map((a,b)=>{let c=a.startsWith("+++")||a.startsWith("---")?"px-4 block text-muted-foreground":a.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":a.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":a.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,d.jsx)("span",{className:c,children:a||" "},b)})}),e&&(0,d.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:b("diff.patchTruncated",{n:String(500),total:String(c.length)})})]})}a.s(["TaskDiffView",0,function({taskId:a,files:b,totalAdded:c,totalRemoved:k,hasConflicts:s,conflictFiles:t,onCommit:u,hasUncommitted:v}){let{t:w}=(0,q.useI18n)(),[x,y]=(0,e.useState)(new Set),[z,A]=(0,e.useState)(new Map),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),H=b=>{A(a=>new Map(a).set(b,{kind:"loading"})),fetch(`/api/tasks/${a}/diff-patch?file=${encodeURIComponent(b)}`).then(a=>a.ok?a.json():Promise.reject(Error(`HTTP ${a.status}`))).then(a=>{A(c=>{let d=new Map(c);return"binary"===a.kind?d.set(b,{kind:"binary"}):"empty"===a.kind?d.set(b,{kind:"empty"}):d.set(b,{kind:"ready",patch:a.patch??""}),d})}).catch(()=>{A(a=>new Map(a).set(b,{kind:"error"}))})};return(0,d.jsxs)("div",{className:"flex flex-col h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,d.jsxs)("span",{className:"font-medium text-foreground",children:[b.length," files changed"]}),(0,d.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",c]}),(0,d.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",k]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:v&&u&&(0,d.jsxs)(l.Button,{variant:"outline",onClick:()=>C(!0),className:"gap-2",children:[(0,d.jsx)(j.GitCommitHorizontal,{className:"h-4 w-4"}),w("diff.commit")]})})]}),s&&(0,d.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,d.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,d.jsx)(h.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,d.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",t.length," conflicting file",1!==t.length?"s":""]})]}),(0,d.jsx)("ul",{className:"ml-6 space-y-1",children:t.map(a=>(0,d.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,d.jsx)("div",{className:"flex-1 overflow-auto",children:0===b.length?(0,d.jsx)(m.EmptyState,{icon:i.GitCompare,title:w("diff.noChanges"),className:"h-full"}):(0,d.jsx)("div",{className:"divide-y divide-border",children:b.map(a=>{let b=x.has(a.filename),c=z.get(a.filename),e=a.added+a.removed;return(0,d.jsxs)("div",{children:[(0,d.jsxs)(l.Button,{variant:"ghost",type:"button",onClick:()=>{let b;return b=x.has(a.filename),void(y(b=>{let c=new Set(b);return c.has(a.filename)?c.delete(a.filename):c.add(a.filename),c}),b||a.isBinary||z.has(a.filename)||a.added+a.removed<=200&&H(a.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:[b?(0,d.jsx)(g.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,d.jsx)(f.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,d.jsx)(n.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:w("diff.binary")}):(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,d.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),b&&!a.isBinary&&(0,d.jsx)("div",{className:"border-t border-border bg-background",children:(0,d.jsx)(r,{filename:a.filename,patchState:c,isLargeFold:!c&&e>200,onLoad:()=>H(a.filename)})})]},a.filename)})})}),(0,d.jsx)(o.Dialog,{open:B,onOpenChange:C,children:(0,d.jsxs)(o.DialogContent,{className:"max-w-md",children:[(0,d.jsx)(o.DialogHeader,{children:(0,d.jsx)(o.DialogTitle,{children:w("diff.commitChanges")})}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:(0,d.jsx)(p.Textarea,{value:D,onChange:a=>E(a.target.value),placeholder:w("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,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(l.Button,{variant:"ghost",onClick:()=>C(!1),children:w("common.cancel")}),(0,d.jsx)(l.Button,{onClick:async()=>{if(D.trim()&&u){G(!0);try{await u(D.trim()),E(""),C(!1)}finally{G(!1)}}},disabled:!D.trim()||F,children:F?"...":w("diff.commit")})]})]})})]})}],639138);var t=a.i(553798);let u=(0,b.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"}]]);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:b,taskId:c,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:j=[],onMergeComplete:m}){let n=(0,t.useRouter)(),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(null),v=async()=>{q(!0),s(null);try{let a=await fetch(`/api/tasks/${c}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){b(!1),m(),n.refresh();return}let d=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?s(`Merge conflicts detected: ${Array.isArray(d.conflictFiles)?d.conflictFiles.join(", "):"unknown files"}`):s(d.error??"Merge failed")}catch{s("Network error — merge failed")}finally{q(!1)}};return(0,d.jsx)(o.Dialog,{open:a,onOpenChange:b,children:(0,d.jsxs)(o.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,d.jsx)(o.DialogHeader,{children:(0,d.jsxs)(o.DialogTitle,{className:"flex items-center gap-2",children:[(0,d.jsx)(u,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,d.jsxs)("div",{className:"space-y-3 py-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,d.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),j.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,d.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:j.map((a,b)=>(0,d.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},b))})]}),r&&(0,d.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,d.jsx)("p",{className:"text-xs text-red-400",children:r})})]}),(0,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(l.Button,{variant:"outline",onClick:()=>b(!1),disabled:p,children:"Cancel"}),(0,d.jsx)(l.Button,{onClick:v,disabled:p,className:"gap-2",children:p?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],88757)},140597,694116,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["default",0,b],694116),a.s(["File",0,b],140597)},970535,359948,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,c],970535);let d=(0,b.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"}]]);a.s(["History",0,d],359948)},7285,a=>{"use strict";async function b(a,c,d={}){let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:c,path:a,...d})});if(!e.ok)throw Error((await e.json()).error||`${c} failed`);return e.json()}a.s(["gitAction",0,b])},771313,307373,646788,806671,114884,604456,703903,a=>{"use strict";var b=a.i(711796);let c=(0,b.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"}]]);a.s(["FilePlus",0,c],771313);let d=(0,b.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"}]]);a.s(["FileMinus",0,d],307373);let e=(0,b.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"}]]);a.s(["FileQuestion",0,e],646788);let f=(0,b.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"}]]);a.s(["FileEdit",0,f],806671);let g=(0,b.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);a.s(["ArrowDown",0,g],114884);let h=(0,b.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,h],604456);let i=(0,b.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);a.s(["Minus",0,i],703903)},324263,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["ArrowUpFromLine",0,b],324263)},985716,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(140597),e=a.i(771313),f=a.i(307373),g=a.i(646788),h=a.i(806671),i=a.i(704494),j=a.i(114884),k=a.i(604456),l=a.i(668116),m=a.i(10390),n=a.i(442620),o=a.i(146758),p=a.i(703903),q=a.i(774881),r=a.i(336771),s=a.i(192369),t=a.i(607219),u=a.i(324263);let v=(0,a.i(711796).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 w=a.i(577565),x=a.i(573242),y=a.i(851378),z=a.i(975231),A=a.i(699570),B=a.i(335732),C=a.i(269876),D=a.i(785259),E=a.i(814574),F=a.i(866718),G=a.i(429246),H=a.i(951192);function I({open:a,onOpenChange:d,branches:e,currentBranch:f,localPath:g,onCreated:h,onError:j}){let{t:k}=(0,H.useI18n)(),[m,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(f),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,y]=(0,c.useState)(""),[z,B]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(o(""),q(f),s(""),y(""))},[a,f]);let C=[...new Set(e)].filter(a=>a.toLowerCase().includes(v.toLowerCase())),D=async()=>{if(m.trim()){u(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:g,branch:m.trim(),baseBranch:p})});if(a.ok)d(!1),h();else{let b=await a.json();j(b.error||"Unknown error")}}catch{j("Network error")}finally{u(!1)}}};return(0,b.jsx)(E.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(E.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(E.DialogHeader,{children:(0,b.jsx)(E.DialogTitle,{children:k("git.createBranch")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("git.branchName")}),(0,b.jsx)(F.Input,{value:m,onChange:a=>o(a.target.value),placeholder:k("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&D()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>B(!z),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,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:p,children:p})]}),(0,b.jsx)(n.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${z?"rotate-180":""}`})]}),z&&(0,b.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,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:v,onChange:a=>y(a.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,b.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:C.map(a=>(0,b.jsxs)("button",{onClick:()=>{q(a),B(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===p?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a}),a===p&&(0,b.jsx)(l.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},a))})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("git.branchDesc")}),(0,b.jsx)(G.Textarea,{value:r,onChange:a=>s(a.target.value),placeholder:k("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,b.jsxs)(E.DialogFooter,{children:[(0,b.jsx)(A.Button,{variant:"outline",onClick:()=>d(!1),children:k("common.cancel")}),(0,b.jsxs)(A.Button,{onClick:D,disabled:!m.trim()||t,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[t?(0,b.jsx)(i.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,k("common.create")]})]})]})})}var J=a.i(952313),K=a.i(7285);let L={modified:h.FileEdit,added:e.FilePlus,deleted:f.FileMinus,untracked:g.FileQuestion,renamed:h.FileEdit},M={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},N={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function O(a){let b={name:"",path:"",isDir:!0,children:[]};for(let c of a){let a=c.file.split("/"),d=b;for(let b=0;b<a.length;b++){let e=a[b],f=b===a.length-1,g=a.slice(0,b+1).join("/");if(f)d.children.push({name:e,path:g,isDir:!1,children:[],file:c});else{let a=d.children.find(a=>a.isDir&&a.name===e);a||(a={name:e,path:g,isDir:!0,children:[]},d.children.push(a)),d=a}}}return(function a(b){if(b.isDir&&(b.children=b.children.map(a),1===b.children.length&&b.children[0].isDir&&""!==b.name)){let a=b.children[0];return{...a,name:`${b.name}/${a.name}`}}return b})(b).children.sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name))}function P({label:a,count:d,labelColor:e,tree:f,batchAction:g,batchLabel:h,batchIcon:i,onFileClick:j,onFileAction:k,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:p,fileSecondaryIcon:q,fileSecondaryLabel:r}){let[s,t]=(0,c.useState)(!0);return 0===d?null:(0,b.jsxs)("div",{className:"border-b border-border",children:[(0,b.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,b.jsxs)("button",{onClick:()=>t(!s),className:"flex items-center gap-1 flex-1 min-w-0",children:[s?(0,b.jsx)(n.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${e}`,children:[a," (",d,")"]})]}),(0,b.jsx)(A.Button,{variant:"ghost",size:"icon-xs",onClick:g,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":h,children:i})]}),s&&(0,b.jsx)("div",{className:"pb-1",children:f.map(a=>(0,b.jsx)(Q,{node:a,depth:0,onFileClick:j,onFileAction:k,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:p,fileSecondaryIcon:q,fileSecondaryLabel:r},a.path))})]})}function Q({node:a,depth:e,onFileClick:f,onFileAction:g,fileActionIcon:h,fileActionLabel:i,onFileSecondaryAction:j,fileSecondaryIcon:k,fileSecondaryLabel:l}){let[p,q]=(0,c.useState)(!0),r={paddingLeft:`calc(${e} * 8px + 4px)`};if(a.isDir)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:()=>q(!p),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:r,children:[p?(0,b.jsx)(n.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsx)(o.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,b.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:a.name})]}),p&&a.children.sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name)).map(a=>(0,b.jsx)(Q,{node:a,depth:e+1,onFileClick:f,onFileAction:g,fileActionIcon:h,fileActionLabel:i,onFileSecondaryAction:j,fileSecondaryIcon:k,fileSecondaryLabel:l},a.path))]});let s=a.file,t=L[s.status]||d.File,u=M[s.status]||"text-muted-foreground",v=N[s.status]||"?";return(0,b.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:r,onClick:()=>f(s),children:[(0,b.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,b.jsx)(t,{className:`h-3.5 w-3.5 shrink-0 ${u}`}),(0,b.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:a.name}),(0,b.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${u}`,children:v}),j&&(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:a=>{a.stopPropagation(),j(s.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":l??"",children:k}),l&&(0,b.jsx)(D.TooltipContent,{side:"bottom",children:l})]}),(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:a=>{a.stopPropagation(),g(s.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":i??"",children:h}),i&&(0,b.jsx)(D.TooltipContent,{side:"bottom",children:i})]})]})}a.s(["EditorGitPanel",0,function({localPath:a,onFileSelect:d,mode:e="project"}){let f="task"===e,{t:g}=(0,H.useI18n)(),[h,m]=(0,c.useState)(null),[o,E]=(0,c.useState)(!0),[F,G]=(0,c.useState)(""),[L,M]=(0,c.useState)(!1),[N,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)(!1),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(""),Z=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(V)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a);function a(a){Z.current&&!Z.current.contains(a.target)&&W(!1)}},[V]);let[$,_]=(0,c.useState)(!1),aa=(0,c.useCallback)(async()=>{try{let b=await fetch(`/api/git?path=${encodeURIComponent(a)}`);if(b.ok){let c=await b.json();m({changedFiles:c.changedFiles??[],ahead:c.ahead??0,behind:c.behind??0,remoteUrl:c.remoteUrl??"",currentBranch:c.currentBranch??"",branches:c.branches??[],remoteBranches:c.remoteBranches??[],topLevel:c.topLevel??a})}}catch{}finally{E(!1)}},[a]);(0,c.useEffect)(()=>{aa();let a=setInterval(aa,5e3);return()=>clearInterval(a)},[aa]);let ab=async b=>{try{await (0,K.gitAction)(a,"stage",{files:b}),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ac=async b=>{try{await (0,K.gitAction)(a,"unstage",{files:b}),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ad=async()=>{if(F.trim()){M(!0);try{await (0,K.gitAction)(a,"commit",{message:F}),G(""),J.toast.success(g("git.commitSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{M(!1)}}},ae=async b=>{Q(!0);try{await (0,K.gitAction)(a,"pull",b?{branch:b}:{}),J.toast.success(g("git.pullSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{Q(!1)}},af=async b=>{S(!0);try{await (0,K.gitAction)(a,"push",b?{branch:b}:{}),J.toast.success(g("git.pushSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{S(!1)}},ag=async()=>{U(!0);try{await (0,K.gitAction)(a,"fetch"),J.toast.success(g("git.fetchSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{U(!1)}},ah=async b=>{try{await (0,K.gitAction)(a,"checkout",{branch:b}),W(!1),J.toast.success(`${g("git.switchSuccess")} ${b}`),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ai=async()=>{try{await (0,K.gitAction)(a,"stash-save",{message:F||void 0}),G(""),J.toast.success(g("git.stashSaved")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},aj=async()=>{try{await (0,K.gitAction)(a,"stash-pop",{index:0}),J.toast.success(g("git.stashApplied")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ak=async b=>{try{await (0,K.gitAction)(a,"discard-file",{file:b}),J.toast.success(g("git.discardFileSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},al=async()=>{try{await (0,K.gitAction)(a,"discard-all"),J.toast.success(g("git.discardSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},am=async b=>{if("deleted"===b.status)return;let c=h?.topLevel??a;try{let e=await (0,K.gitAction)(a,"show",{file:b.file});d?.(b.file,e.content??"",c)}catch{d?.(b.file,"",c)}},an=h?.changedFiles.filter(a=>a.staged)??[],ao=h?.changedFiles.filter(a=>!a.staged)??[],ap=(0,c.useMemo)(()=>O(an),[an]),aq=(0,c.useMemo)(()=>O(ao),[ao]);if(o)return(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!h)return null;function ar(a){let b=[];for(let c of a)c.isDir?b.push(...ar(c.children)):c.file&&b.push(c.file.file);return b}let as=[...h?.branches??[],...(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a))],at=X?as.filter(a=>a.toLowerCase().includes(X.toLowerCase())):as;return(0,b.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[f?(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{render:(0,b.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,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:h?.currentBranch||"—"})]})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:h?.currentBranch||"—"})]}):(0,b.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Z,children:[(0,b.jsxs)("button",{onClick:()=>{W(!V),Y("")},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,b.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:h?.currentBranch||void 0,children:h?.currentBranch||"—"})]}),(0,b.jsx)(n.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${V?"rotate-180":""}`})]}),V&&(0,b.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,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:X,onChange:a=>Y(a.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,b.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(h?.branches??[]).filter(a=>a.toLowerCase().includes(X.toLowerCase())).length>0&&(0,b.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:g("git.localBranches")}),(h?.branches??[]).filter(a=>a.toLowerCase().includes(X.toLowerCase())).map(a=>{let c=a===h?.currentBranch;return(0,b.jsxs)("button",{onClick:()=>{c?W(!1):ah(a)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${c?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a}),c&&(0,b.jsx)(l.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${a}`)}),(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a)).filter(a=>a.toLowerCase().includes(X.toLowerCase())).length>0&&(0,b.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:g("git.remoteBranches")}),(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a)).filter(a=>a.toLowerCase().includes(X.toLowerCase())).map(a=>(0,b.jsxs)("button",{onClick:()=>ah(a),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,b.jsx)(y.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a})]},`remote-${a}`)),0===at.length&&(0,b.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:ag,disabled:T,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,b.jsx)(s.RefreshCw,{className:`h-3.5 w-3.5 ${T?"animate-spin":""}`})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:()=>{W(!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":g("git.createBranch"),children:(0,b.jsx)(q.Plus,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",children:g("git.createBranch")})]})]})]}),(0,b.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,b.jsx)("textarea",{value:F,onChange:a=>G(a.target.value),placeholder:g("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:a=>{(a.metaKey||a.ctrlKey)&&"Enter"===a.key&&ad()}}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(A.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:ad,disabled:L||!F.trim()||0===an.length,children:[L?(0,b.jsx)(i.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(l.Check,{className:"h-3 w-3"}),g("git.commit")]}),(0,b.jsxs)(B.DropdownMenu,{children:[(0,b.jsx)(B.DropdownMenuTrigger,{render:(0,b.jsx)(A.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,b.jsx)(r.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)(B.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.commit")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ad,disabled:!F.trim()||0===an.length,children:[(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 mr-2"}),g("git.commit")]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.changes")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ab(ar(aq)),disabled:0===ao.length,children:[(0,b.jsx)(q.Plus,{className:"h-3.5 w-3.5 mr-2"}),g("git.stageAll")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ac(ar(ap)),disabled:0===an.length,children:[(0,b.jsx)(p.Minus,{className:"h-3.5 w-3.5 mr-2"}),g("git.unstageAll")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:al,disabled:0===ao.length,children:[(0,b.jsx)(v,{className:"h-3.5 w-3.5 mr-2"}),g("git.discardAll")]})]}),!f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.sync")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(),disabled:N,children:[(0,b.jsx)(j.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),g("git.pull")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(),disabled:R,children:[(0,b.jsx)(k.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),g("git.push")]}),(0,b.jsxs)(B.DropdownMenuSub,{children:[(0,b.jsxs)(B.DropdownMenuSubTrigger,{disabled:N,children:[(0,b.jsx)(j.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),g("git.pullFrom"),"..."]}),(0,b.jsxs)(B.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),h.currentBranch,h.behind>0&&(0,b.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",h.behind]})]}),h.remoteBranches.filter(a=>a!==h.currentBranch).map(a=>(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(a),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),a]},a))]})]}),(0,b.jsxs)(B.DropdownMenuSub,{children:[(0,b.jsxs)(B.DropdownMenuSubTrigger,{disabled:R,children:[(0,b.jsx)(k.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),g("git.pushTo"),"..."]}),(0,b.jsxs)(B.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),h.currentBranch,h.ahead>0&&(0,b.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",h.ahead]})]}),h.remoteBranches.filter(a=>a!==h.currentBranch).map(a=>(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(a),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),a]},a))]})]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ag,disabled:T,children:[(0,b.jsx)(s.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${T?"animate-spin":""}`}),g("git.fetchAll")]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.stash")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ai,disabled:0===h.changedFiles.length,children:[(0,b.jsx)(t.Archive,{className:"h-3.5 w-3.5 mr-2"}),g("git.stashSave")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:aj,children:[(0,b.jsx)(u.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),g("git.stashPopLatest")]})]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,b.jsx)(w.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),h.currentBranch]})]})]})]})]}),(0,b.jsxs)(C.ScrollArea,{className:"flex-1 min-h-0",children:[(0,b.jsx)(P,{label:g("git.stagedChanges"),count:an.length,labelColor:"text-emerald-400",tree:ap,batchAction:()=>ac(ar(ap)),batchLabel:g("git.unstageAll"),batchIcon:(0,b.jsx)(p.Minus,{className:"h-3 w-3"}),onFileClick:am,onFileAction:a=>ac([a]),fileActionIcon:"−",fileActionLabel:g("git.unstageFile")}),(0,b.jsx)(P,{label:g("git.unstagedChanges"),count:ao.length,labelColor:"text-muted-foreground",tree:aq,batchAction:()=>ab(ar(aq)),batchLabel:g("git.stageAll"),batchIcon:(0,b.jsx)(q.Plus,{className:"h-3 w-3"}),onFileClick:am,onFileAction:a=>ab([a]),fileActionIcon:"+",fileActionLabel:g("git.stageFile"),onFileSecondaryAction:a=>ak(a),fileSecondaryIcon:(0,b.jsx)(z.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:g("git.discardFile")}),0===h.changedFiles.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,b.jsx)(l.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("git.noChanges")})]})]}),(0,b.jsx)(I,{open:$,onOpenChange:_,branches:[...h?.branches??[],...h?.remoteBranches??[]],currentBranch:h?.currentBranch??"",localPath:a,onCreated:async()=>{J.toast.success(g("git.createSuccess")),await aa()},onError:a=>J.toast.error(`${g("git.createFailed")}: ${a}`)})]})}],985716)},254480,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("60e903d81016ad087f0673954b19123d6402d9ea4d",b.callServer,void 0,b.findSourceMapURL,"updateTask");a.s(["updateTask",0,c])},986565,420436,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("7c5e3b54118977428104afc6d77720611257ac522a",b.callServer,void 0,b.findSourceMapURL,"startPtyExecutionSafe");a.s(["startPtyExecutionSafe",0,c],986565);let d=(0,b.createServerReference)("40d0c8238b487e664660cb962acdf111f015db29da",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,d],420436)},212524,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("400329c68fcd02edea883a2bcaf2651767b169dfd3",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},714812,329351,430756,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("60f81021da1a9765ca9d3ef0fdcc96463310df9374",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],714812);let d=(0,b.createServerReference)("40b0c9a5c3b37cdf74d8565ce067e8917e63c79c45",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],329351);let e=(0,b.createServerReference)("6017cfb7c1ea9098673c3fb41bf5fb4209494d7dd7",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],430756)},283857,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["Lightbulb",0,b],283857)},715525,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(442620),e=a.i(745539),f=a.i(913284),g=a.i(468862),h=a.i(704494),i=a.i(970535),j=a.i(165614),k=a.i(747798),l=a.i(283857),m=a.i(359948),n=a.i(699570),o=a.i(579834),p=a.i(951192);function q({status:a}){switch(a){case"COMPLETED":return(0,b.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,b.jsx)(g.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,b.jsx)(h.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,b.jsx)(i.Clock,{className:"h-4 w-4 text-neutral-500"})}}a.s(["ExecutionTimeline",0,function({executions:a,onResume:f,onContinueLatest:g}){let{t:h,locale:i}=(0,p.useI18n)(),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null);return 0===a.length?(0,b.jsx)(o.EmptyState,{icon:m.History,title:h("execution.noHistory")}):(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:h("execution.history")}),a.map(c=>{let m=function(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}(c.gitStats??null),o=function(a,b){if(!a||!b)return"";let c=new Date(b).getTime()-new Date(a).getTime();if(c<0)return"";let d=Math.floor(c/1e3);if(d<60)return`${d}s`;let e=Math.floor(d/60);if(e<60)return`${e}m ${d%60}s`;let f=Math.floor(e/60);return`${f}h ${e%60}m`}(c.startedAt??null,c.endedAt??null),p=r===c.id;return(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,b.jsxs)("div",{className:"p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)(q,{status:c.status}),(0,b.jsx)("span",{className:`font-medium ${function(a){switch(a){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(c.status)}`,children:function(a,b){switch(a){case"COMPLETED":return b("execution.success");case"FAILED":return b("execution.failed");case"RUNNING":return b("execution.running");default:return a}}(c.status,h)}),(0,b.jsx)("span",{className:"text-muted-foreground",children:function(a,b="zh"){if(!a)return"";let c=new Date(a),d=Math.floor((new Date().getTime()-c.getTime())/864e5),e="zh"===b?"zh-CN":"en-US",f=c.toLocaleTimeString(e,{hour:"2-digit",minute:"2-digit"});return 0===d?f:1===d?"zh"===b?`昨天 ${f}`:`Yesterday ${f}`:d<7?"zh"===b?`${d}天前 ${f}`:`${d}d ago ${f}`:c.toLocaleDateString(e,{month:"2-digit",day:"2-digit"})+" "+f}(c.startedAt??null,i)}),o&&(0,b.jsxs)("span",{className:"text-muted-foreground/60",children:["(",o,")"]})]}),(0,b.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:c.summary||h("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,b.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,b.jsxs)("span",{children:[m.commits," ",h("execution.commits")]}):null,m.filesChanged?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:[m.filesChanged," ",h("execution.files")]})]}):null,m.insertions||m.deletions?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),m.insertions?(0,b.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,b.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),c.insightNote&&(0,b.jsxs)("div",{className:"mt-2",children:[(0,b.jsxs)("button",{onClick:()=>u(t===c.id?null:c.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,b.jsx)(l.Lightbulb,{className:"h-3.5 w-3.5"}),(0,b.jsxs)("span",{className:"font-medium",children:[h("execution.insight"),":"]}),(0,b.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:c.insightNote.title}),t===c.id?(0,b.jsx)(e.ChevronUp,{className:"h-3 w-3"}):(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"})]}),t===c.id&&(0,b.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:c.insightNote.content})]}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[c.sessionId&&f?(0,b.jsxs)(n.Button,{size:"sm",onClick:()=>f(c.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),h("execution.resume")]}):!c.sessionId&&"FAILED"===c.status&&c.id===a[0]?.id&&g?(0,b.jsxs)(n.Button,{size:"sm",onClick:g,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,b.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),h("execution.tryRecover")]}):null,(0,b.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>s(p?null:c.id),className:"bg-muted text-muted-foreground",children:[p?(0,b.jsx)(e.ChevronUp,{className:"h-3.5 w-3.5"}):(0,b.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}),p?h("execution.collapse"):h("execution.details")]})]})]}),p&&(0,b.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[c.gitLog&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.gitLog")}),(0,b.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:c.gitLog.split("\n").slice(0,3).join("\n")})]}),c.terminalLog&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.terminalOutput")}),(0,b.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:c.terminalLog})]}),"FAILED"===c.status&&null!=c.exitCode&&(0,b.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",c.exitCode]})]})]},c.id)})]})}])}];
2
-
3
- //# sourceMappingURL=_08x3jaa._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[10390,a=>{"use strict";var b=a.i(421992);a.s(["ChevronRight",()=>b.default])},747798,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["RotateCcw",0,b],747798)},579834,a=>{"use strict";var b=a.i(728778),c=a.i(368114);a.s(["EmptyState",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",g),children:[a&&(0,b.jsx)(a,{className:"h-10 w-10 text-muted-foreground/40"}),(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:d}),e&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e}),f&&(0,b.jsx)("div",{className:"mt-2",children:f})]})}])},509405,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["Eye",0,b],509405)},324954,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["Upload",0,b],324954)},912868,a=>{"use strict";let b=(0,a.i(711796).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);a.s(["ChevronLeft",0,b],912868)},757942,950314,a=>{"use strict";var b=a.i(90393);a.s([],757942),a.s(["Streamdown",()=>b.C],950314)},75131,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40a687436d6cfb65f9c73a1833051c6880315d0db5",b.callServer,void 0,b.findSourceMapURL,"deleteAsset");a.s(["deleteAsset",0,c])},161181,a=>{"use strict";let b=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif","apng"]);a.s(["isImageAsset",0,function(a,c){if(c?.startsWith("image/"))return!0;let d=a.split(".").pop()?.toLowerCase();return!!d&&b.has(d)},"localPathToApiUrl",0,function(a){let b=a.match(/(?:^|\/)(?:storage|data)\/assets\/([^/]+)\/([^/]+)$/);return b?`/api/files/assets/${b[1]}/${b[2]}`:a}])},732427,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("404c7c8c8659fa543c75c036f8ab21e65ffe609add",b.callServer,void 0,b.findSourceMapURL,"uploadAsset");a.s(["uploadAsset",0,c])},532615,894148,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(986099),e=a.i(54384),f=a.i(912868),g=a.i(10390),h=a.i(91756);let i=(0,a.i(711796).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var j=a.i(747798),k=a.i(951192);function l({children:a,onClick:c,title:d,disabled:e,...f}){return(0,b.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),e||c()},title:d,disabled:e,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",...f,children:a})}a.s(["ImageLightbox",0,function({imageUrl:a,filename:m,open:n,onOpenChange:o,assets:p,currentIndex:q,onIndexChange:r}){let{t:s}=(0,k.useI18n)(),[t,u]=(0,c.useState)(1),[v,w]=(0,c.useState)({x:0,y:0}),[x,y]=(0,c.useState)(!1),z=(0,c.useRef)(null),[A,B]=(0,c.useState)(!1),C=!!p&&p.length>1&&"number"==typeof q&&!!r,D=C&&q>0,E=C&&q<p.length-1,F=C?p.length:0,G=F>0?Math.ceil(F/10):0,H=C?Math.floor(q/10):0,I=10*H,J=Math.min(I+10,F),K=G>1,L=C&&H>0,M=C&&H<G-1;(0,c.useEffect)(()=>{B(!0)},[]),(0,c.useEffect)(()=>{u(1),w({x:0,y:0})},[a]),(0,c.useEffect)(()=>{if(!n)return;let a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a}},[n]);let N=(0,c.useCallback)(()=>o(!1),[o]),O=(0,c.useCallback)(()=>{C&&D&&r(q-1)},[C,D,r,q]),P=(0,c.useCallback)(()=>{C&&E&&r(q+1)},[C,E,r,q]),Q=(0,c.useCallback)(()=>{C&&L&&r((H-1)*10)},[C,L,r,H]),R=(0,c.useCallback)(()=>{C&&M&&r(Math.min((H+1)*10,F-1))},[C,M,r,H,F]),S=(0,c.useCallback)(()=>{u(a=>Math.min(8,1.25*a))},[]),T=(0,c.useCallback)(()=>{u(a=>{let b=Math.max(.1,a/1.25);return b<=1&&w({x:0,y:0}),b})},[]),U=(0,c.useCallback)(()=>{u(1),w({x:0,y:0})},[]);(0,c.useEffect)(()=>{if(!n)return;let a=a=>{switch(a.key){case"Escape":a.preventDefault(),N();break;case"ArrowLeft":C&&(a.preventDefault(),O());break;case"ArrowRight":C&&(a.preventDefault(),P());break;case"+":case"=":a.preventDefault(),S();break;case"-":case"_":a.preventDefault(),T();break;case"0":a.preventDefault(),U()}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n,C,N,O,P,S,T,U]);let V=(0,c.useRef)(!1),W=()=>{x&&y(!1),z.current=null},X=x?"cursor-grabbing":"cursor-grab";if(!n||!A)return null;let Y=(0,b.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":s("assets.lightbox.zoomFit"),children:[(0,b.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:[m,C?` \xb7 ${q+1} / ${p.length}`:""]}),(0,b.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${X}`,onClick:a=>{a.target===a.currentTarget&&N()},onWheel:a=>{a.preventDefault();let b=-a.deltaY>0?1.25:.8;u(a=>{let c=Math.min(8,Math.max(.1,a*b));return c<=1&&w({x:0,y:0}),c})},children:a&&(0,b.jsx)("img",{src:a,alt:m,onClick:a=>{a.stopPropagation(),V.current&&(V.current=!1)},onPointerDown:a=>{0===a.button&&(a.stopPropagation(),V.current=!1,a.target.setPointerCapture?.(a.pointerId),z.current={x:a.clientX,y:a.clientY,panX:v.x,panY:v.y},y(!0))},onPointerMove:a=>{if(!z.current)return;let b=a.clientX-z.current.x,c=a.clientY-z.current.y;Math.abs(b)+Math.abs(c)>5&&(V.current=!0),x&&w({x:z.current.panX+b,y:z.current.panY+c})},onPointerUp:W,onPointerLeave:W,onPointerCancel:W,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${v.x}px, ${v.y}px, 0) scale(${t})`,transformOrigin:"center center",transition:x?"none":"transform 120ms ease-out",willChange:x?"transform":"auto"},draggable:!1})}),(0,b.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:a=>a.stopPropagation(),children:[C&&(0,b.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:[K&&(0,b.jsx)(l,{onClick:Q,title:`${s("assets.lightbox.prev")} (-10)`,"aria-label":`${s("assets.lightbox.prev")} (-10)`,disabled:!L,children:(0,b.jsx)(h.ChevronsLeft,{className:"h-4 w-4"})}),(0,b.jsx)(l,{onClick:O,title:s("assets.lightbox.prev"),"aria-label":s("assets.lightbox.prev"),disabled:!D,children:(0,b.jsx)(f.ChevronLeft,{className:"h-4 w-4"})}),(0,b.jsx)("div",{className:"flex items-center gap-1.5",children:p.slice(I,J).map((a,c)=>{let d=I+c,e=d===q;return(0,b.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),e||r(d)},title:a.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${e?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,b.jsx)("img",{src:a.url,alt:a.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},a.url+d)})}),(0,b.jsx)(l,{onClick:P,title:s("assets.lightbox.next"),"aria-label":s("assets.lightbox.next"),disabled:!E,children:(0,b.jsx)(g.ChevronRight,{className:"h-4 w-4"})}),K&&(0,b.jsx)(l,{onClick:R,title:`${s("assets.lightbox.next")} (+10)`,"aria-label":`${s("assets.lightbox.next")} (+10)`,disabled:!M,children:(0,b.jsx)(i,{className:"h-4 w-4"})})]}),(0,b.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,b.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*t),"%"]}),(0,b.jsx)(l,{onClick:U,title:s("assets.lightbox.reset"),"aria-label":s("assets.lightbox.reset"),disabled:1===t&&0===v.x&&0===v.y,children:(0,b.jsx)(j.RotateCcw,{className:"h-4 w-4"})}),(0,b.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,b.jsx)(l,{onClick:N,title:s("assets.lightbox.close"),"aria-label":s("assets.lightbox.close"),children:(0,b.jsx)(e.X,{className:"h-4 w-4"})})]})]})]});return(0,d.createPortal)(Y,document.body)}],532615);var m=a.i(704494);a.i(757942);var n=a.i(950314),o=a.i(814574);a.s(["TextPreviewDialog",0,function({url:a,filename:d,open:e,onOpenChange:f}){let{t:g}=(0,k.useI18n)(),[h,i]=(0,c.useState)(null),[j,l]=(0,c.useState)(!1),[p,q]=(0,c.useState)(null);(0,c.useEffect)(()=>{if(!e||!a){i(null),q(null);return}let b=!1;return l(!0),q(null),i(null),fetch(a).then(a=>{let b=a.headers.get("content-length");if(b&&parseInt(b,10)>1048576)throw Error("FILE_TOO_LARGE");return a.text()}).then(a=>{if(a.length>1048576)throw Error("FILE_TOO_LARGE");b||(i(a),l(!1))}).catch(a=>{b||(a instanceof Error&&"FILE_TOO_LARGE"===a.message?q(g("assets.fileTooLarge")):q(g("assets.previewError")),l(!1))}),()=>{b=!0}},[e,a,g]);let r=d.split(".").pop()?.toLowerCase();return(0,b.jsx)(o.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(o.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,b.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:d}),(0,b.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(j)return(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,b.jsx)(m.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:g("assets.loadingPreview")})]});if(p)return(0,b.jsx)("p",{className:"text-sm text-destructive",children:p});if(null===h)return null;if("md"===r)return(0,b.jsx)("div",{className:"text-sm leading-relaxed",children:(0,b.jsx)(n.Streamdown,{children:h})});if("json"===r){let a;try{a=JSON.stringify(JSON.parse(h),null,2)}catch{a=h}return(0,b.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:a})}return(0,b.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:h})})()})]})})}],894148)}];
2
-
3
- //# sourceMappingURL=_09r0_z9._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[10390,a=>{"use strict";var b=a.i(421992);a.s(["ChevronRight",()=>b.default])},747798,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["RotateCcw",0,b],747798)},579834,a=>{"use strict";var b=a.i(728778),c=a.i(368114);a.s(["EmptyState",0,function({icon:a,title:d,description:e,action:f,className:g}){return(0,b.jsxs)("div",{className:(0,c.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",g),children:[a&&(0,b.jsx)(a,{className:"h-10 w-10 text-muted-foreground/40"}),(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:d}),e&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e}),f&&(0,b.jsx)("div",{className:"mt-2",children:f})]})}])},509405,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["Eye",0,b],509405)},324954,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["Upload",0,b],324954)},912868,a=>{"use strict";let b=(0,a.i(711796).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);a.s(["ChevronLeft",0,b],912868)},732427,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("404c7c8c8659fa543c75c036f8ab21e65ffe609add",b.callServer,void 0,b.findSourceMapURL,"uploadAsset");a.s(["uploadAsset",0,c])},75131,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("40a687436d6cfb65f9c73a1833051c6880315d0db5",b.callServer,void 0,b.findSourceMapURL,"deleteAsset");a.s(["deleteAsset",0,c])},532615,894148,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(986099),e=a.i(54384),f=a.i(912868),g=a.i(10390),h=a.i(91756);let i=(0,a.i(711796).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var j=a.i(747798),k=a.i(951192);function l({children:a,onClick:c,title:d,disabled:e,...f}){return(0,b.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),e||c()},title:d,disabled:e,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",...f,children:a})}a.s(["ImageLightbox",0,function({imageUrl:a,filename:m,open:n,onOpenChange:o,assets:p,currentIndex:q,onIndexChange:r}){let{t:s}=(0,k.useI18n)(),[t,u]=(0,c.useState)(1),[v,w]=(0,c.useState)({x:0,y:0}),[x,y]=(0,c.useState)(!1),z=(0,c.useRef)(null),[A,B]=(0,c.useState)(!1),C=!!p&&p.length>1&&"number"==typeof q&&!!r,D=C&&q>0,E=C&&q<p.length-1,F=C?p.length:0,G=F>0?Math.ceil(F/10):0,H=C?Math.floor(q/10):0,I=10*H,J=Math.min(I+10,F),K=G>1,L=C&&H>0,M=C&&H<G-1;(0,c.useEffect)(()=>{B(!0)},[]),(0,c.useEffect)(()=>{u(1),w({x:0,y:0})},[a]),(0,c.useEffect)(()=>{if(!n)return;let a=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=a}},[n]);let N=(0,c.useCallback)(()=>o(!1),[o]),O=(0,c.useCallback)(()=>{C&&D&&r(q-1)},[C,D,r,q]),P=(0,c.useCallback)(()=>{C&&E&&r(q+1)},[C,E,r,q]),Q=(0,c.useCallback)(()=>{C&&L&&r((H-1)*10)},[C,L,r,H]),R=(0,c.useCallback)(()=>{C&&M&&r(Math.min((H+1)*10,F-1))},[C,M,r,H,F]),S=(0,c.useCallback)(()=>{u(a=>Math.min(8,1.25*a))},[]),T=(0,c.useCallback)(()=>{u(a=>{let b=Math.max(.1,a/1.25);return b<=1&&w({x:0,y:0}),b})},[]),U=(0,c.useCallback)(()=>{u(1),w({x:0,y:0})},[]);(0,c.useEffect)(()=>{if(!n)return;let a=a=>{switch(a.key){case"Escape":a.preventDefault(),N();break;case"ArrowLeft":C&&(a.preventDefault(),O());break;case"ArrowRight":C&&(a.preventDefault(),P());break;case"+":case"=":a.preventDefault(),S();break;case"-":case"_":a.preventDefault(),T();break;case"0":a.preventDefault(),U()}};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n,C,N,O,P,S,T,U]);let V=(0,c.useRef)(!1),W=()=>{x&&y(!1),z.current=null},X=x?"cursor-grabbing":"cursor-grab";if(!n||!A)return null;let Y=(0,b.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":s("assets.lightbox.zoomFit"),children:[(0,b.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:[m,C?` \xb7 ${q+1} / ${p.length}`:""]}),(0,b.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${X}`,onClick:a=>{a.target===a.currentTarget&&N()},onWheel:a=>{a.preventDefault();let b=-a.deltaY>0?1.25:.8;u(a=>{let c=Math.min(8,Math.max(.1,a*b));return c<=1&&w({x:0,y:0}),c})},children:a&&(0,b.jsx)("img",{src:a,alt:m,onClick:a=>{a.stopPropagation(),V.current&&(V.current=!1)},onPointerDown:a=>{0===a.button&&(a.stopPropagation(),V.current=!1,a.target.setPointerCapture?.(a.pointerId),z.current={x:a.clientX,y:a.clientY,panX:v.x,panY:v.y},y(!0))},onPointerMove:a=>{if(!z.current)return;let b=a.clientX-z.current.x,c=a.clientY-z.current.y;Math.abs(b)+Math.abs(c)>5&&(V.current=!0),x&&w({x:z.current.panX+b,y:z.current.panY+c})},onPointerUp:W,onPointerLeave:W,onPointerCancel:W,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${v.x}px, ${v.y}px, 0) scale(${t})`,transformOrigin:"center center",transition:x?"none":"transform 120ms ease-out",willChange:x?"transform":"auto"},draggable:!1})}),(0,b.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:a=>a.stopPropagation(),children:[C&&(0,b.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:[K&&(0,b.jsx)(l,{onClick:Q,title:`${s("assets.lightbox.prev")} (-10)`,"aria-label":`${s("assets.lightbox.prev")} (-10)`,disabled:!L,children:(0,b.jsx)(h.ChevronsLeft,{className:"h-4 w-4"})}),(0,b.jsx)(l,{onClick:O,title:s("assets.lightbox.prev"),"aria-label":s("assets.lightbox.prev"),disabled:!D,children:(0,b.jsx)(f.ChevronLeft,{className:"h-4 w-4"})}),(0,b.jsx)("div",{className:"flex items-center gap-1.5",children:p.slice(I,J).map((a,c)=>{let d=I+c,e=d===q;return(0,b.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),e||r(d)},title:a.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${e?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,b.jsx)("img",{src:a.url,alt:a.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},a.url+d)})}),(0,b.jsx)(l,{onClick:P,title:s("assets.lightbox.next"),"aria-label":s("assets.lightbox.next"),disabled:!E,children:(0,b.jsx)(g.ChevronRight,{className:"h-4 w-4"})}),K&&(0,b.jsx)(l,{onClick:R,title:`${s("assets.lightbox.next")} (+10)`,"aria-label":`${s("assets.lightbox.next")} (+10)`,disabled:!M,children:(0,b.jsx)(i,{className:"h-4 w-4"})})]}),(0,b.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,b.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*t),"%"]}),(0,b.jsx)(l,{onClick:U,title:s("assets.lightbox.reset"),"aria-label":s("assets.lightbox.reset"),disabled:1===t&&0===v.x&&0===v.y,children:(0,b.jsx)(j.RotateCcw,{className:"h-4 w-4"})}),(0,b.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,b.jsx)(l,{onClick:N,title:s("assets.lightbox.close"),"aria-label":s("assets.lightbox.close"),children:(0,b.jsx)(e.X,{className:"h-4 w-4"})})]})]})]});return(0,d.createPortal)(Y,document.body)}],532615);var m=a.i(704494);a.i(757942);var n=a.i(950314),o=a.i(814574);a.s(["TextPreviewDialog",0,function({url:a,filename:d,open:e,onOpenChange:f}){let{t:g}=(0,k.useI18n)(),[h,i]=(0,c.useState)(null),[j,l]=(0,c.useState)(!1),[p,q]=(0,c.useState)(null);(0,c.useEffect)(()=>{if(!e||!a){i(null),q(null);return}let b=!1;return l(!0),q(null),i(null),fetch(a).then(a=>{let b=a.headers.get("content-length");if(b&&parseInt(b,10)>1048576)throw Error("FILE_TOO_LARGE");return a.text()}).then(a=>{if(a.length>1048576)throw Error("FILE_TOO_LARGE");b||(i(a),l(!1))}).catch(a=>{b||(a instanceof Error&&"FILE_TOO_LARGE"===a.message?q(g("assets.fileTooLarge")):q(g("assets.previewError")),l(!1))}),()=>{b=!0}},[e,a,g]);let r=d.split(".").pop()?.toLowerCase();return(0,b.jsx)(o.Dialog,{open:e,onOpenChange:f,children:(0,b.jsxs)(o.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,b.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:d}),(0,b.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(j)return(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,b.jsx)(m.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:g("assets.loadingPreview")})]});if(p)return(0,b.jsx)("p",{className:"text-sm text-destructive",children:p});if(null===h)return null;if("md"===r)return(0,b.jsx)("div",{className:"text-sm leading-relaxed",children:(0,b.jsx)(n.Streamdown,{children:h})});if("json"===r){let a;try{a=JSON.stringify(JSON.parse(h),null,2)}catch{a=h}return(0,b.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:a})}return(0,b.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:h})})()})]})})}],894148)},161181,a=>{"use strict";let b=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif","apng"]);a.s(["isImageAsset",0,function(a,c){if(c?.startsWith("image/"))return!0;let d=a.split(".").pop()?.toLowerCase();return!!d&&b.has(d)},"localPathToApiUrl",0,function(a){let b=a.match(/(?:^|\/)(?:storage|data)\/assets\/([^/]+)\/([^/]+)$/);return b?`/api/files/assets/${b[1]}/${b[2]}`:a}])}];
2
-
3
- //# sourceMappingURL=_0a554d8._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[283857,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["Lightbulb",0,b],283857)},324263,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["ArrowUpFromLine",0,b],324263)},7285,a=>{"use strict";async function b(a,c,d={}){let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:c,path:a,...d})});if(!e.ok)throw Error((await e.json()).error||`${c} failed`);return e.json()}a.s(["gitAction",0,b])},140597,694116,a=>{"use strict";let b=(0,a.i(711796).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"}]]);a.s(["default",0,b],694116),a.s(["File",0,b],140597)},771313,307373,646788,806671,114884,604456,703903,a=>{"use strict";var b=a.i(711796);let c=(0,b.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"}]]);a.s(["FilePlus",0,c],771313);let d=(0,b.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"}]]);a.s(["FileMinus",0,d],307373);let e=(0,b.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"}]]);a.s(["FileQuestion",0,e],646788);let f=(0,b.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"}]]);a.s(["FileEdit",0,f],806671);let g=(0,b.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);a.s(["ArrowDown",0,g],114884);let h=(0,b.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);a.s(["ArrowUp",0,h],604456);let i=(0,b.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);a.s(["Minus",0,i],703903)},985716,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(140597),e=a.i(771313),f=a.i(307373),g=a.i(646788),h=a.i(806671),i=a.i(704494),j=a.i(114884),k=a.i(604456),l=a.i(668116),m=a.i(10390),n=a.i(442620),o=a.i(146758),p=a.i(703903),q=a.i(774881),r=a.i(336771),s=a.i(192369),t=a.i(607219),u=a.i(324263);let v=(0,a.i(711796).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 w=a.i(577565),x=a.i(573242),y=a.i(851378),z=a.i(975231),A=a.i(699570),B=a.i(335732),C=a.i(269876),D=a.i(785259),E=a.i(814574),F=a.i(866718),G=a.i(429246),H=a.i(951192);function I({open:a,onOpenChange:d,branches:e,currentBranch:f,localPath:g,onCreated:h,onError:j}){let{t:k}=(0,H.useI18n)(),[m,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(f),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,y]=(0,c.useState)(""),[z,B]=(0,c.useState)(!1);(0,c.useEffect)(()=>{a&&(o(""),q(f),s(""),y(""))},[a,f]);let C=[...new Set(e)].filter(a=>a.toLowerCase().includes(v.toLowerCase())),D=async()=>{if(m.trim()){u(!0);try{let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:g,branch:m.trim(),baseBranch:p})});if(a.ok)d(!1),h();else{let b=await a.json();j(b.error||"Unknown error")}}catch{j("Network error")}finally{u(!1)}}};return(0,b.jsx)(E.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(E.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(E.DialogHeader,{children:(0,b.jsx)(E.DialogTitle,{children:k("git.createBranch")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("git.branchName")}),(0,b.jsx)(F.Input,{value:m,onChange:a=>o(a.target.value),placeholder:k("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:a=>"Enter"===a.key&&D()})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("git.baseBranch")}),(0,b.jsxs)("div",{className:"relative mt-1.5",children:[(0,b.jsxs)("button",{onClick:()=>B(!z),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,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:p,children:p})]}),(0,b.jsx)(n.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${z?"rotate-180":""}`})]}),z&&(0,b.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,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:v,onChange:a=>y(a.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,b.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:C.map(a=>(0,b.jsxs)("button",{onClick:()=>{q(a),B(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${a===p?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a}),a===p&&(0,b.jsx)(l.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},a))})]})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:k("git.branchDesc")}),(0,b.jsx)(G.Textarea,{value:r,onChange:a=>s(a.target.value),placeholder:k("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,b.jsxs)(E.DialogFooter,{children:[(0,b.jsx)(A.Button,{variant:"outline",onClick:()=>d(!1),children:k("common.cancel")}),(0,b.jsxs)(A.Button,{onClick:D,disabled:!m.trim()||t,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[t?(0,b.jsx)(i.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,k("common.create")]})]})]})})}var J=a.i(952313),K=a.i(7285);let L={modified:h.FileEdit,added:e.FilePlus,deleted:f.FileMinus,untracked:g.FileQuestion,renamed:h.FileEdit},M={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},N={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function O(a){let b={name:"",path:"",isDir:!0,children:[]};for(let c of a){let a=c.file.split("/"),d=b;for(let b=0;b<a.length;b++){let e=a[b],f=b===a.length-1,g=a.slice(0,b+1).join("/");if(f)d.children.push({name:e,path:g,isDir:!1,children:[],file:c});else{let a=d.children.find(a=>a.isDir&&a.name===e);a||(a={name:e,path:g,isDir:!0,children:[]},d.children.push(a)),d=a}}}return(function a(b){if(b.isDir&&(b.children=b.children.map(a),1===b.children.length&&b.children[0].isDir&&""!==b.name)){let a=b.children[0];return{...a,name:`${b.name}/${a.name}`}}return b})(b).children.sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name))}function P({label:a,count:d,labelColor:e,tree:f,batchAction:g,batchLabel:h,batchIcon:i,onFileClick:j,onFileAction:k,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:p,fileSecondaryIcon:q,fileSecondaryLabel:r}){let[s,t]=(0,c.useState)(!0);return 0===d?null:(0,b.jsxs)("div",{className:"border-b border-border",children:[(0,b.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,b.jsxs)("button",{onClick:()=>t(!s),className:"flex items-center gap-1 flex-1 min-w-0",children:[s?(0,b.jsx)(n.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${e}`,children:[a," (",d,")"]})]}),(0,b.jsx)(A.Button,{variant:"ghost",size:"icon-xs",onClick:g,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":h,children:i})]}),s&&(0,b.jsx)("div",{className:"pb-1",children:f.map(a=>(0,b.jsx)(Q,{node:a,depth:0,onFileClick:j,onFileAction:k,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:p,fileSecondaryIcon:q,fileSecondaryLabel:r},a.path))})]})}function Q({node:a,depth:e,onFileClick:f,onFileAction:g,fileActionIcon:h,fileActionLabel:i,onFileSecondaryAction:j,fileSecondaryIcon:k,fileSecondaryLabel:l}){let[p,q]=(0,c.useState)(!0),r={paddingLeft:`calc(${e} * 8px + 4px)`};if(a.isDir)return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("button",{onClick:()=>q(!p),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:r,children:[p?(0,b.jsx)(n.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsx)(o.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,b.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:a.name})]}),p&&a.children.sort((a,b)=>a.isDir!==b.isDir?a.isDir?-1:1:a.name.localeCompare(b.name)).map(a=>(0,b.jsx)(Q,{node:a,depth:e+1,onFileClick:f,onFileAction:g,fileActionIcon:h,fileActionLabel:i,onFileSecondaryAction:j,fileSecondaryIcon:k,fileSecondaryLabel:l},a.path))]});let s=a.file,t=L[s.status]||d.File,u=M[s.status]||"text-muted-foreground",v=N[s.status]||"?";return(0,b.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:r,onClick:()=>f(s),children:[(0,b.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,b.jsx)(t,{className:`h-3.5 w-3.5 shrink-0 ${u}`}),(0,b.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:a.name}),(0,b.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${u}`,children:v}),j&&(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:a=>{a.stopPropagation(),j(s.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":l??"",children:k}),l&&(0,b.jsx)(D.TooltipContent,{side:"bottom",children:l})]}),(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:a=>{a.stopPropagation(),g(s.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":i??"",children:h}),i&&(0,b.jsx)(D.TooltipContent,{side:"bottom",children:i})]})]})}a.s(["EditorGitPanel",0,function({localPath:a,onFileSelect:d,mode:e="project"}){let f="task"===e,{t:g}=(0,H.useI18n)(),[h,m]=(0,c.useState)(null),[o,E]=(0,c.useState)(!0),[F,G]=(0,c.useState)(""),[L,M]=(0,c.useState)(!1),[N,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)(!1),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(""),Z=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(V)return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a);function a(a){Z.current&&!Z.current.contains(a.target)&&W(!1)}},[V]);let[$,_]=(0,c.useState)(!1),aa=(0,c.useCallback)(async()=>{try{let b=await fetch(`/api/git?path=${encodeURIComponent(a)}`);if(b.ok){let c=await b.json();m({changedFiles:c.changedFiles??[],ahead:c.ahead??0,behind:c.behind??0,remoteUrl:c.remoteUrl??"",currentBranch:c.currentBranch??"",branches:c.branches??[],remoteBranches:c.remoteBranches??[],topLevel:c.topLevel??a})}}catch{}finally{E(!1)}},[a]);(0,c.useEffect)(()=>{aa();let a=setInterval(aa,5e3);return()=>clearInterval(a)},[aa]);let ab=async b=>{try{await (0,K.gitAction)(a,"stage",{files:b}),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ac=async b=>{try{await (0,K.gitAction)(a,"unstage",{files:b}),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ad=async()=>{if(F.trim()){M(!0);try{await (0,K.gitAction)(a,"commit",{message:F}),G(""),J.toast.success(g("git.commitSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{M(!1)}}},ae=async b=>{Q(!0);try{await (0,K.gitAction)(a,"pull",b?{branch:b}:{}),J.toast.success(g("git.pullSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{Q(!1)}},af=async b=>{S(!0);try{await (0,K.gitAction)(a,"push",b?{branch:b}:{}),J.toast.success(g("git.pushSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{S(!1)}},ag=async()=>{U(!0);try{await (0,K.gitAction)(a,"fetch"),J.toast.success(g("git.fetchSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}finally{U(!1)}},ah=async b=>{try{await (0,K.gitAction)(a,"checkout",{branch:b}),W(!1),J.toast.success(`${g("git.switchSuccess")} ${b}`),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ai=async()=>{try{await (0,K.gitAction)(a,"stash-save",{message:F||void 0}),G(""),J.toast.success(g("git.stashSaved")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},aj=async()=>{try{await (0,K.gitAction)(a,"stash-pop",{index:0}),J.toast.success(g("git.stashApplied")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},ak=async b=>{try{await (0,K.gitAction)(a,"discard-file",{file:b}),J.toast.success(g("git.discardFileSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},al=async()=>{try{await (0,K.gitAction)(a,"discard-all"),J.toast.success(g("git.discardSuccess")),await aa()}catch(a){J.toast.error(a instanceof Error?a.message:String(a))}},am=async b=>{if("deleted"===b.status)return;let c=h?.topLevel??a;try{let e=await (0,K.gitAction)(a,"show",{file:b.file});d?.(b.file,e.content??"",c)}catch{d?.(b.file,"",c)}},an=h?.changedFiles.filter(a=>a.staged)??[],ao=h?.changedFiles.filter(a=>!a.staged)??[],ap=(0,c.useMemo)(()=>O(an),[an]),aq=(0,c.useMemo)(()=>O(ao),[ao]);if(o)return(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)(i.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!h)return null;function ar(a){let b=[];for(let c of a)c.isDir?b.push(...ar(c.children)):c.file&&b.push(c.file.file);return b}let as=[...h?.branches??[],...(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a))],at=X?as.filter(a=>a.toLowerCase().includes(X.toLowerCase())):as;return(0,b.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[f?(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{render:(0,b.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,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:h?.currentBranch||"—"})]})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:h?.currentBranch||"—"})]}):(0,b.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Z,children:[(0,b.jsxs)("button",{onClick:()=>{W(!V),Y("")},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,b.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:h?.currentBranch||void 0,children:h?.currentBranch||"—"})]}),(0,b.jsx)(n.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${V?"rotate-180":""}`})]}),V&&(0,b.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,b.jsx)("div",{className:"border-b border-border p-1.5",children:(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,b.jsx)("input",{value:X,onChange:a=>Y(a.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,b.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(h?.branches??[]).filter(a=>a.toLowerCase().includes(X.toLowerCase())).length>0&&(0,b.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:g("git.localBranches")}),(h?.branches??[]).filter(a=>a.toLowerCase().includes(X.toLowerCase())).map(a=>{let c=a===h?.currentBranch;return(0,b.jsxs)("button",{onClick:()=>{c?W(!1):ah(a)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${c?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a}),c&&(0,b.jsx)(l.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${a}`)}),(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a)).filter(a=>a.toLowerCase().includes(X.toLowerCase())).length>0&&(0,b.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:g("git.remoteBranches")}),(h?.remoteBranches??[]).filter(a=>!h?.branches?.includes(a)).filter(a=>a.toLowerCase().includes(X.toLowerCase())).map(a=>(0,b.jsxs)("button",{onClick:()=>ah(a),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,b.jsx)(y.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,b.jsx)("span",{className:"truncate font-mono text-xs",title:a,children:a})]},`remote-${a}`)),0===at.length&&(0,b.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:ag,disabled:T,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,b.jsx)(s.RefreshCw,{className:`h-3.5 w-3.5 ${T?"animate-spin":""}`})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,b.jsxs)(D.Tooltip,{children:[(0,b.jsx)(D.TooltipTrigger,{onClick:()=>{W(!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":g("git.createBranch"),children:(0,b.jsx)(q.Plus,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(D.TooltipContent,{side:"bottom",children:g("git.createBranch")})]})]})]}),(0,b.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,b.jsx)("textarea",{value:F,onChange:a=>G(a.target.value),placeholder:g("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:a=>{(a.metaKey||a.ctrlKey)&&"Enter"===a.key&&ad()}}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(A.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:ad,disabled:L||!F.trim()||0===an.length,children:[L?(0,b.jsx)(i.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(l.Check,{className:"h-3 w-3"}),g("git.commit")]}),(0,b.jsxs)(B.DropdownMenu,{children:[(0,b.jsx)(B.DropdownMenuTrigger,{render:(0,b.jsx)(A.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,b.jsx)(r.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,b.jsxs)(B.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.commit")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ad,disabled:!F.trim()||0===an.length,children:[(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 mr-2"}),g("git.commit")]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.changes")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ab(ar(aq)),disabled:0===ao.length,children:[(0,b.jsx)(q.Plus,{className:"h-3.5 w-3.5 mr-2"}),g("git.stageAll")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ac(ar(ap)),disabled:0===an.length,children:[(0,b.jsx)(p.Minus,{className:"h-3.5 w-3.5 mr-2"}),g("git.unstageAll")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:al,disabled:0===ao.length,children:[(0,b.jsx)(v,{className:"h-3.5 w-3.5 mr-2"}),g("git.discardAll")]})]}),!f&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.sync")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(),disabled:N,children:[(0,b.jsx)(j.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),g("git.pull")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(),disabled:R,children:[(0,b.jsx)(k.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),g("git.push")]}),(0,b.jsxs)(B.DropdownMenuSub,{children:[(0,b.jsxs)(B.DropdownMenuSubTrigger,{disabled:N,children:[(0,b.jsx)(j.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),g("git.pullFrom"),"..."]}),(0,b.jsxs)(B.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),h.currentBranch,h.behind>0&&(0,b.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",h.behind]})]}),h.remoteBranches.filter(a=>a!==h.currentBranch).map(a=>(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>ae(a),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),a]},a))]})]}),(0,b.jsxs)(B.DropdownMenuSub,{children:[(0,b.jsxs)(B.DropdownMenuSubTrigger,{disabled:R,children:[(0,b.jsx)(k.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),g("git.pushTo"),"..."]}),(0,b.jsxs)(B.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),h.currentBranch,h.ahead>0&&(0,b.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",h.ahead]})]}),h.remoteBranches.filter(a=>a!==h.currentBranch).map(a=>(0,b.jsxs)(B.DropdownMenuItem,{onClick:()=>af(a),children:[(0,b.jsx)(w.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),a]},a))]})]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ag,disabled:T,children:[(0,b.jsx)(s.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${T?"animate-spin":""}`}),g("git.fetchAll")]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuGroup,{children:[(0,b.jsx)(B.DropdownMenuLabel,{children:g("git.stash")}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:ai,disabled:0===h.changedFiles.length,children:[(0,b.jsx)(t.Archive,{className:"h-3.5 w-3.5 mr-2"}),g("git.stashSave")]}),(0,b.jsxs)(B.DropdownMenuItem,{onClick:aj,children:[(0,b.jsx)(u.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),g("git.stashPopLatest")]})]})]}),(0,b.jsx)(B.DropdownMenuSeparator,{}),(0,b.jsxs)(B.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,b.jsx)(w.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),h.currentBranch]})]})]})]})]}),(0,b.jsxs)(C.ScrollArea,{className:"flex-1 min-h-0",children:[(0,b.jsx)(P,{label:g("git.stagedChanges"),count:an.length,labelColor:"text-emerald-400",tree:ap,batchAction:()=>ac(ar(ap)),batchLabel:g("git.unstageAll"),batchIcon:(0,b.jsx)(p.Minus,{className:"h-3 w-3"}),onFileClick:am,onFileAction:a=>ac([a]),fileActionIcon:"−",fileActionLabel:g("git.unstageFile")}),(0,b.jsx)(P,{label:g("git.unstagedChanges"),count:ao.length,labelColor:"text-muted-foreground",tree:aq,batchAction:()=>ab(ar(aq)),batchLabel:g("git.stageAll"),batchIcon:(0,b.jsx)(q.Plus,{className:"h-3 w-3"}),onFileClick:am,onFileAction:a=>ab([a]),fileActionIcon:"+",fileActionLabel:g("git.stageFile"),onFileSecondaryAction:a=>ak(a),fileSecondaryIcon:(0,b.jsx)(z.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:g("git.discardFile")}),0===h.changedFiles.length&&(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,b.jsx)(l.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g("git.noChanges")})]})]}),(0,b.jsx)(I,{open:$,onOpenChange:_,branches:[...h?.branches??[],...h?.remoteBranches??[]],currentBranch:h?.currentBranch??"",localPath:a,onCreated:async()=>{J.toast.success(g("git.createSuccess")),await aa()},onError:a=>J.toast.error(`${g("git.createFailed")}: ${a}`)})]})}],985716)},300141,639138,88757,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);a.s(["Square",0,c],300141);var d=a.i(728778),e=a.i(374637),f=a.i(10390),g=a.i(442620),h=a.i(811344),i=a.i(394869),j=a.i(207339),k=a.i(704494),l=a.i(699570),m=a.i(579834),n=a.i(786304),o=a.i(814574),p=a.i(429246),q=a.i(951192);function r({patchState:a,isLargeFold:b,onLoad:c}){let{t:e}=(0,q.useI18n)();return b?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,d.jsx)(l.Button,{variant:"link",onClick:c,className:"h-auto p-0 text-sm",children:e("diff.loadDiff")}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:e("diff.foldedLarge")})]}):a&&"loading"!==a.kind?"error"===a.kind?(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,d.jsx)("span",{children:e("diff.loadFailed")}),(0,d.jsx)(l.Button,{variant:"ghost",onClick:c,children:e("diff.retry")})]}):"binary"===a.kind?(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:e("diff.binaryNotShown")}):"empty"===a.kind?(0,d.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:e("diff.noChanges")}):(0,d.jsx)(s,{patch:a.patch??""}):(0,d.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,d.jsx)(k.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function s({patch:a}){let{t:b}=(0,q.useI18n)(),c=a.split("\n"),e=c.length>500,f=e?c.slice(0,500):c;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:f.map((a,b)=>{let c=a.startsWith("+++")||a.startsWith("---")?"px-4 block text-muted-foreground":a.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":a.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":a.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,d.jsx)("span",{className:c,children:a||" "},b)})}),e&&(0,d.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:b("diff.patchTruncated",{n:String(500),total:String(c.length)})})]})}a.s(["TaskDiffView",0,function({taskId:a,files:b,totalAdded:c,totalRemoved:k,hasConflicts:s,conflictFiles:t,onCommit:u,hasUncommitted:v}){let{t:w}=(0,q.useI18n)(),[x,y]=(0,e.useState)(new Set),[z,A]=(0,e.useState)(new Map),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)(!1),H=b=>{A(a=>new Map(a).set(b,{kind:"loading"})),fetch(`/api/tasks/${a}/diff-patch?file=${encodeURIComponent(b)}`).then(a=>a.ok?a.json():Promise.reject(Error(`HTTP ${a.status}`))).then(a=>{A(c=>{let d=new Map(c);return"binary"===a.kind?d.set(b,{kind:"binary"}):"empty"===a.kind?d.set(b,{kind:"empty"}):d.set(b,{kind:"ready",patch:a.patch??""}),d})}).catch(()=>{A(a=>new Map(a).set(b,{kind:"error"}))})};return(0,d.jsxs)("div",{className:"flex flex-col h-full",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,d.jsxs)("span",{className:"font-medium text-foreground",children:[b.length," files changed"]}),(0,d.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",c]}),(0,d.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",k]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2",children:v&&u&&(0,d.jsxs)(l.Button,{variant:"outline",onClick:()=>C(!0),className:"gap-2",children:[(0,d.jsx)(j.GitCommitHorizontal,{className:"h-4 w-4"}),w("diff.commit")]})})]}),s&&(0,d.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,d.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,d.jsx)(h.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,d.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",t.length," conflicting file",1!==t.length?"s":""]})]}),(0,d.jsx)("ul",{className:"ml-6 space-y-1",children:t.map(a=>(0,d.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:a},a))})]}),(0,d.jsx)("div",{className:"flex-1 overflow-auto",children:0===b.length?(0,d.jsx)(m.EmptyState,{icon:i.GitCompare,title:w("diff.noChanges"),className:"h-full"}):(0,d.jsx)("div",{className:"divide-y divide-border",children:b.map(a=>{let b=x.has(a.filename),c=z.get(a.filename),e=a.added+a.removed;return(0,d.jsxs)("div",{children:[(0,d.jsxs)(l.Button,{variant:"ghost",type:"button",onClick:()=>{let b;return b=x.has(a.filename),void(y(b=>{let c=new Set(b);return c.has(a.filename)?c.delete(a.filename):c.add(a.filename),c}),b||a.isBinary||z.has(a.filename)||a.added+a.removed<=200&&H(a.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:[b?(0,d.jsx)(g.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,d.jsx)(f.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:a.filename}),a.isBinary?(0,d.jsx)(n.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:w("diff.binary")}):(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",a.added]}),(0,d.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",a.removed]})]})]}),b&&!a.isBinary&&(0,d.jsx)("div",{className:"border-t border-border bg-background",children:(0,d.jsx)(r,{filename:a.filename,patchState:c,isLargeFold:!c&&e>200,onLoad:()=>H(a.filename)})})]},a.filename)})})}),(0,d.jsx)(o.Dialog,{open:B,onOpenChange:C,children:(0,d.jsxs)(o.DialogContent,{className:"max-w-md",children:[(0,d.jsx)(o.DialogHeader,{children:(0,d.jsx)(o.DialogTitle,{children:w("diff.commitChanges")})}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:(0,d.jsx)(p.Textarea,{value:D,onChange:a=>E(a.target.value),placeholder:w("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,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(l.Button,{variant:"ghost",onClick:()=>C(!1),children:w("common.cancel")}),(0,d.jsx)(l.Button,{onClick:async()=>{if(D.trim()&&u){G(!0);try{await u(D.trim()),E(""),C(!1)}finally{G(!1)}}},disabled:!D.trim()||F,children:F?"...":w("diff.commit")})]})]})})]})}],639138);var t=a.i(553798);let u=(0,b.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"}]]);a.s(["TaskMergeConfirmDialog",0,function({open:a,onOpenChange:b,taskId:c,taskTitle:f,baseBranch:g,fileCount:h,commitCount:i,commitLog:j=[],onMergeComplete:m}){let n=(0,t.useRouter)(),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(null),v=async()=>{q(!0),s(null);try{let a=await fetch(`/api/tasks/${c}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(a.ok){b(!1),m(),n.refresh();return}let d=await a.json().catch(()=>({error:"Merge failed"}));409===a.status?s(`Merge conflicts detected: ${Array.isArray(d.conflictFiles)?d.conflictFiles.join(", "):"unknown files"}`):s(d.error??"Merge failed")}catch{s("Network error — merge failed")}finally{q(!1)}};return(0,d.jsx)(o.Dialog,{open:a,onOpenChange:b,children:(0,d.jsxs)(o.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,d.jsx)(o.DialogHeader,{children:(0,d.jsxs)(o.DialogTitle,{className:"flex items-center gap-2",children:[(0,d.jsx)(u,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,d.jsxs)("div",{className:"space-y-3 py-2",children:[(0,d.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,d.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:g})]}),(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:h})]}),(0,d.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]})]}),j.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,d.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:j.map((a,b)=>(0,d.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},b))})]}),r&&(0,d.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,d.jsx)("p",{className:"text-xs text-red-400",children:r})})]}),(0,d.jsxs)(o.DialogFooter,{children:[(0,d.jsx)(l.Button,{variant:"outline",onClick:()=>b(!1),disabled:p,children:"Cancel"}),(0,d.jsx)(l.Button,{onClick:v,disabled:p,className:"gap-2",children:p?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(k.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],88757)},212524,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("400329c68fcd02edea883a2bcaf2651767b169dfd3",b.callServer,void 0,b.findSourceMapURL,"getTaskExecutions");a.s(["getTaskExecutions",0,c])},986565,420436,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("7c5e3b54118977428104afc6d77720611257ac522a",b.callServer,void 0,b.findSourceMapURL,"startPtyExecutionSafe");a.s(["startPtyExecutionSafe",0,c],986565);let d=(0,b.createServerReference)("40d0c8238b487e664660cb962acdf111f015db29da",b.callServer,void 0,b.findSourceMapURL,"continueLatestPtyExecution");a.s(["continueLatestPtyExecution",0,d],420436)},714812,329351,430756,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("60f81021da1a9765ca9d3ef0fdcc96463310df9374",b.callServer,void 0,b.findSourceMapURL,"updateTaskStatus");a.s(["updateTaskStatus",0,c],714812);let d=(0,b.createServerReference)("40b0c9a5c3b37cdf74d8565ce067e8917e63c79c45",b.callServer,void 0,b.findSourceMapURL,"checkWorktreeClean");a.s(["checkWorktreeClean",0,d],329351);let e=(0,b.createServerReference)("6017cfb7c1ea9098673c3fb41bf5fb4209494d7dd7",b.callServer,void 0,b.findSourceMapURL,"commitWorktreeChanges");a.s(["commitWorktreeChanges",0,e],430756)},970535,359948,a=>{"use strict";var b=a.i(711796);let c=(0,b.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);a.s(["Clock",0,c],970535);let d=(0,b.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"}]]);a.s(["History",0,d],359948)},715525,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(442620),e=a.i(745539),f=a.i(913284),g=a.i(468862),h=a.i(704494),i=a.i(970535),j=a.i(165614),k=a.i(747798),l=a.i(283857),m=a.i(359948),n=a.i(699570),o=a.i(579834),p=a.i(951192);function q({status:a}){switch(a){case"COMPLETED":return(0,b.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,b.jsx)(g.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,b.jsx)(h.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,b.jsx)(i.Clock,{className:"h-4 w-4 text-neutral-500"})}}a.s(["ExecutionTimeline",0,function({executions:a,onResume:f,onContinueLatest:g}){let{t:h,locale:i}=(0,p.useI18n)(),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(null);return 0===a.length?(0,b.jsx)(o.EmptyState,{icon:m.History,title:h("execution.noHistory")}):(0,b.jsxs)("div",{className:"space-y-2 p-3",children:[(0,b.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:h("execution.history")}),a.map(c=>{let m=function(a){if(!a)return null;try{return JSON.parse(a)}catch{return null}}(c.gitStats??null),o=function(a,b){if(!a||!b)return"";let c=new Date(b).getTime()-new Date(a).getTime();if(c<0)return"";let d=Math.floor(c/1e3);if(d<60)return`${d}s`;let e=Math.floor(d/60);if(e<60)return`${e}m ${d%60}s`;let f=Math.floor(e/60);return`${f}h ${e%60}m`}(c.startedAt??null,c.endedAt??null),p=r===c.id;return(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,b.jsxs)("div",{className:"p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,b.jsx)(q,{status:c.status}),(0,b.jsx)("span",{className:`font-medium ${function(a){switch(a){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(c.status)}`,children:function(a,b){switch(a){case"COMPLETED":return b("execution.success");case"FAILED":return b("execution.failed");case"RUNNING":return b("execution.running");default:return a}}(c.status,h)}),(0,b.jsx)("span",{className:"text-muted-foreground",children:function(a,b="zh"){if(!a)return"";let c=new Date(a),d=Math.floor((new Date().getTime()-c.getTime())/864e5),e="zh"===b?"zh-CN":"en-US",f=c.toLocaleTimeString(e,{hour:"2-digit",minute:"2-digit"});return 0===d?f:1===d?"zh"===b?`昨天 ${f}`:`Yesterday ${f}`:d<7?"zh"===b?`${d}天前 ${f}`:`${d}d ago ${f}`:c.toLocaleDateString(e,{month:"2-digit",day:"2-digit"})+" "+f}(c.startedAt??null,i)}),o&&(0,b.jsxs)("span",{className:"text-muted-foreground/60",children:["(",o,")"]})]}),(0,b.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:c.summary||h("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,b.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,b.jsxs)("span",{children:[m.commits," ",h("execution.commits")]}):null,m.filesChanged?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),(0,b.jsxs)("span",{children:[m.filesChanged," ",h("execution.files")]})]}):null,m.insertions||m.deletions?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("span",{children:"·"}),m.insertions?(0,b.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,b.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),c.insightNote&&(0,b.jsxs)("div",{className:"mt-2",children:[(0,b.jsxs)("button",{onClick:()=>u(t===c.id?null:c.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,b.jsx)(l.Lightbulb,{className:"h-3.5 w-3.5"}),(0,b.jsxs)("span",{className:"font-medium",children:[h("execution.insight"),":"]}),(0,b.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:c.insightNote.title}),t===c.id?(0,b.jsx)(e.ChevronUp,{className:"h-3 w-3"}):(0,b.jsx)(d.ChevronDown,{className:"h-3 w-3"})]}),t===c.id&&(0,b.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:c.insightNote.content})]}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[c.sessionId&&f?(0,b.jsxs)(n.Button,{size:"sm",onClick:()=>f(c.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),h("execution.resume")]}):!c.sessionId&&"FAILED"===c.status&&c.id===a[0]?.id&&g?(0,b.jsxs)(n.Button,{size:"sm",onClick:g,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,b.jsx)(k.RotateCcw,{className:"h-3.5 w-3.5"}),h("execution.tryRecover")]}):null,(0,b.jsxs)(n.Button,{variant:"ghost",size:"sm",onClick:()=>s(p?null:c.id),className:"bg-muted text-muted-foreground",children:[p?(0,b.jsx)(e.ChevronUp,{className:"h-3.5 w-3.5"}):(0,b.jsx)(d.ChevronDown,{className:"h-3.5 w-3.5"}),p?h("execution.collapse"):h("execution.details")]})]})]}),p&&(0,b.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[c.gitLog&&(0,b.jsxs)("div",{className:"mt-3",children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.gitLog")}),(0,b.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:c.gitLog.split("\n").slice(0,3).join("\n")})]}),c.terminalLog&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:h("execution.terminalOutput")}),(0,b.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:c.terminalLog})]}),"FAILED"===c.status&&null!=c.exitCode&&(0,b.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",c.exitCode]})]})]},c.id)})]})}])},254480,a=>{"use strict";var b=a.i(780410);let c=(0,b.createServerReference)("60e903d81016ad087f0673954b19123d6402d9ea4d",b.callServer,void 0,b.findSourceMapURL,"updateTask");a.s(["updateTask",0,c])}];
2
-
3
- //# sourceMappingURL=_0bmywa6._.js.map
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,783426,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),r=e.i(340966),n=e.i(572989);let l=(0,n.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var i=e.i(486077),o=e.i(533499);function c({totalTasks:e,runningTasks:s}){let{t:a}=(0,o.useI18n)();return(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 px-6 py-4",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded-lg bg-sky-500/10 p-2 ring-1 ring-sky-500/20",children:(0,t.jsx)(r.ClipboardList,{className:"h-4 w-4 text-sky-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("board.overview")}),(0,t.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:e})]})]})}),(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded-lg bg-primary/10 p-2 ring-1 ring-primary/20",children:(0,t.jsx)(l,{className:"h-4 w-4 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("board.running")}),(0,t.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:s})]})]})}),(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded-lg bg-emerald-500/10 p-2 ring-1 ring-emerald-500/20",children:(0,t.jsx)(i.Lightbulb,{className:"h-4 w-4 text-emerald-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("board.tip")}),(0,t.jsx)("p",{className:"text-xs font-medium text-foreground/80",children:a("board.tipText")})]})]})})]})}var d=e.i(210702),m=e.i(232545),x=e.i(738690),u=e.i(226145),h=e.i(519455),p=e.i(793479),g=e.i(280027);function f({searchQuery:e,onSearchChange:s,versions:a=[],versionFilter:r="all",onVersionFilterChange:n,versionsHref:l,onCreateTask:i}){let c,{t:j}=(0,o.useI18n)(),b="all"===r?j("board.allVersions"):"backlog"===r?j("board.backlogFilter"):(c=a.find(e=>e.id===r))?`${c.number} ${c.name}`:j("board.allVersions");return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[n&&(0,t.jsxs)(g.Select,{value:r,onValueChange:e=>n(e||"all"),children:[(0,t.jsxs)(g.SelectTrigger,{className:"h-8 w-44 shrink-0 gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.GitBranch,{className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:b})]}),(0,t.jsxs)(g.SelectContent,{children:[(0,t.jsx)(g.SelectItem,{value:"all",children:j("board.allVersions")}),(0,t.jsx)(g.SelectItem,{value:"backlog",children:j("board.backlogFilter")}),a.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[(0,t.jsx)("span",{className:"font-mono",children:e.number})," ",e.name]},e.id))]})]}),(0,t.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,t.jsx)(x.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(p.Input,{type:"text",value:e,onChange:e=>s(e.target.value),placeholder:j("board.searchPlaceholder"),className:"pl-8 pr-3 text-xs"})]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[l&&(0,t.jsx)(d.default,{href:l,children:(0,t.jsxs)(h.Button,{variant:"outline",className:"h-8 gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.GitBranch,{className:"h-3.5 w-3.5"}),j("version.timeline")]})}),(0,t.jsxs)(h.Button,{"data-tour":"create-task",variant:"outline",className:"gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:i,children:[(0,t.jsx)(m.Plus,{className:"h-3.5 w-3.5"}),j("board.newTask")]})]})]})}var j=e.i(585012),b=e.i(597746),N=e.i(685149);function v({x:e,y:r,taskId:n,currentStatus:l,hasExecutions:i,workspaceId:c,onClose:d,onStatusChange:m,onLaunch:x}){let{t:u}=(0,o.useI18n)(),h=(0,a.useRouter)(),p=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&d()},t=e=>{"Escape"===e.key&&d()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[d]);let g="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",f=(0,t.jsxs)("div",{ref:p,style:{position:"fixed",top:r,left:e,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,t.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:u("board.contextMenu.changeStatus")}),N.BOARD_COLUMNS.map(e=>(0,t.jsxs)("button",{type:"button",className:g,onClick:()=>{m(n,e.id),d()},children:[l===e.id?(0,t.jsx)(b.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,t.jsx)("span",{className:"w-5 flex-shrink-0"}),e.label]},e.id)),(0,t.jsx)("hr",{className:"my-1 border-border"}),(0,t.jsx)("button",{type:"button",className:`${g} ${i?"opacity-50 cursor-not-allowed":""}`,disabled:i,onClick:()=>{i||(x(n),d())},children:u("board.contextMenu.launch")}),"DONE"!==l&&"CANCELLED"!==l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("hr",{className:"my-1 border-border"}),(0,t.jsx)("button",{type:"button",className:g,onClick:()=>{h.push(`/workspaces/${c}/tasks/${n}`),d()},children:u("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,j.createPortal)(f,document.body)}var k=e.i(720247),y=e.i(775712);let w=(0,n.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var C=e.i(67013),S=e.i(49007),T=e.i(464249),P=e.i(998626);let I=(0,n.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var E=e.i(487486),D=e.i(746798),L=e.i(755146),B=e.i(35967);function F({task:e,onClick:s,onEdit:a,onDelete:r,onTogglePin:n,onContextMenu:l}){let{t:i}=(0,o.useI18n)(),{attributes:c,listeners:d,setNodeRef:m,transform:x,transition:p,isDragging:g}=(0,y.useSortable)({id:e.id,data:{type:"task",task:e}}),f={transform:C.CSS.Transform.toString(x),transition:p,opacity:g?.4:1},j=N.PRIORITY_CONFIG[e.priority],b=!!e.baseBranch;return(0,t.jsxs)("div",{ref:m,style:f,...c,...d,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:s,onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),l?.(e,t.clientX,t.clientY)},"data-testid":"task-card",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-foreground",children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${e.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:t=>{t.stopPropagation(),n?.(e.id)},"aria-label":i(e.pinned?"board.unpin":"board.pin"),children:(0,t.jsx)(I,{className:`h-3.5 w-3.5 ${e.pinned?"-rotate-45":""}`})}),(0,t.jsxs)(L.DropdownMenu,{children:[(0,t.jsx)(L.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(S.MoreHorizontal,{className:"h-4 w-4"})}),(0,t.jsxs)(L.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(L.DropdownMenuItem,{onClick:t=>{t.stopPropagation(),a?.(e)},children:[(0,t.jsx)(T.Pencil,{className:"mr-2 h-3.5 w-3.5"}),i("common.edit")]}),(0,t.jsxs)(L.DropdownMenuItem,{className:"text-rose-400",onClick:t=>{t.stopPropagation(),r?.(e.id)},children:[(0,t.jsx)(P.Trash2,{className:"mr-2 h-3.5 w-3.5"}),i("common.delete")]})]})]})]})]}),e.description&&(0,t.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,t.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)(E.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${j.color}`,children:j.label}),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},children:e.label.name},e.label.id)),(b||e.version)&&(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[b&&(0,t.jsxs)(D.Tooltip,{disableHoverablePopup:!0,children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)("span",{className:"inline-flex cursor-default items-center rounded-md border border-border bg-muted px-1 py-0.5 text-muted-foreground",onPointerDown:e=>e.stopPropagation(),children:(0,t.jsx)(u.GitBranch,{className:"h-2.5 w-2.5 shrink-0"})})}),(0,t.jsx)(D.TooltipContent,{side:"top",children:i("board.card.worktree",{branch:e.baseBranch??""})})]}),e.version&&(0,t.jsxs)(D.Tooltip,{disableHoverablePopup:!0,children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)("span",{className:"cursor-default",onPointerDown:e=>e.stopPropagation(),children:(0,t.jsx)(B.TaskVersionTag,{number:e.version.number,title:""})})}),(0,t.jsx)(D.TooltipContent,{side:"top",children:i("board.card.version",{number:e.version.number,name:e.version.name})})]})]})]})]})}var R=e.i(776639),A=e.i(759684);function O({open:e,onOpenChange:s,columnLabel:a,columnColor:r,tasks:n,onTaskClick:l}){let{t:i}=(0,o.useI18n)();return(0,t.jsx)(R.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(R.DialogContent,{className:"sm:max-w-6xl max-h-[80vh]",children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsxs)(R.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${r}`}),(0,t.jsx)("span",{children:a}),(0,t.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:n.length})]})}),(0,t.jsx)(A.ScrollArea,{className:"max-h-[680px]",children:(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3 pr-3",children:[n.map(e=>{let a=N.PRIORITY_CONFIG[e.priority];return(0,t.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{l?.(e),s(!1)},children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:e.title}),e.description&&(0,t.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,t.jsx)(E.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${a.color}`,children:a.label}),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},children:e.label.name},e.label.id))]})]},e.id)}),0===n.length&&(0,t.jsx)("div",{className:"col-span-4 py-8 text-center text-sm text-muted-foreground",children:i("board.noTasks")})]})})]})})}function M({id:e,label:a,color:r,tasks:n,onTaskClick:l,onEditTask:i,onAddTask:c,onDeleteTask:d,onTogglePin:x,onContextMenu:u}){let{setNodeRef:p,isOver:g}=(0,k.useDroppable)({id:e}),[f,j]=(0,s.useState)(!1),{t:b}=(0,o.useI18n)();return(0,t.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${g?"bg-primary/[0.06]":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`h-2 w-2 rounded-full ${r}`}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:a}),(0,t.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:n.length})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>j(!0),className:"text-muted-foreground","aria-label":b("board.viewAll"),children:(0,t.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:c,className:"text-muted-foreground","aria-label":"add",children:(0,t.jsx)(m.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,t.jsx)(O,{open:f,onOpenChange:j,columnLabel:a,columnColor:r,tasks:n,onTaskClick:l}),(0,t.jsx)(A.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)("div",{ref:p,className:"flex flex-col gap-2 p-2",children:(0,t.jsx)(y.SortableContext,{items:n.map(e=>e.id),strategy:y.verticalListSortingStrategy,children:n.map(e=>(0,t.jsx)(F,{task:e,onClick:()=>l?.(e),onEdit:i,onDelete:d,onTogglePin:x,onContextMenu:u},e.id))})})})]})}function $({initialTasks:e,onTaskMove:a,onTaskClick:r,onEditTask:n,onAddTask:l,onDeleteTask:i,onTogglePin:o,onContextMenuStatusChange:c,onContextMenuLaunch:d,workspaceId:m}){let[x,u]=(0,s.useState)(e),[h,p]=(0,s.useState)(null),[g,f]=(0,s.useState)(null);(0,s.useEffect)(()=>{u(e)},[e]);let j=(0,k.useSensors)((0,k.useSensor)(k.PointerSensor,{activationConstraint:{distance:8}})),b=(0,s.useCallback)((e,t,s)=>{f({task:e,x:t,y:s})},[]),y=(0,s.useCallback)(e=>{let t=x.find(t=>t.id===e.active.id);t&&p(t)},[x]),w=(0,s.useCallback)(e=>{let t,{active:s,over:r}=e;if(p(null),!r)return;let n=s.id,l=r.id;if(N.BOARD_COLUMNS.some(e=>e.id===l))t=l;else{let e=x.find(e=>e.id===l);t=e?.status}t&&(u(e=>e.map(e=>e.id===n?{...e,status:t}:e)),a?.(n,t))},[x,a]);return(0,t.jsxs)(k.DndContext,{id:"kanban-board",sensors:j,collisionDetection:k.closestCorners,onDragStart:y,onDragEnd:w,children:[(0,t.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:N.BOARD_COLUMNS.map(e=>(0,t.jsx)(M,{id:e.id,label:e.label,color:e.color,tasks:x.filter(t=>t.status===e.id),onTaskClick:r,onEditTask:n,onAddTask:()=>l?.(e.id),onDeleteTask:i,onTogglePin:o,onContextMenu:b},e.id))}),(0,t.jsx)(k.DragOverlay,{children:h?(0,t.jsx)("div",{className:"rotate-3 scale-105",children:(0,t.jsx)(F,{task:h})}):null}),g&&(0,t.jsx)(v,{x:g.x,y:g.y,taskId:g.task.id,currentStatus:g.task.status,hasExecutions:(g.task._count?.executions??0)>0,workspaceId:m??"",onClose:()=>f(null),onStatusChange:(e,t)=>{c?.(e,t),f(null)},onLaunch:e=>{d?.(e),f(null)}})]})}var z=e.i(744798),U=e.i(232280),G=e.i(368490),W=e.i(645378),V=e.i(453889);let _=(0,n.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var H=e.i(938499),K=e.i(400355),Y=e.i(233274),q=e.i(736061),J=e.i(460707),X=e.i(567860),Q=e.i(875840),Z=e.i(624687),ee=e.i(514798);let et=(0,ee.createServerReference)("608352de1cc1602250a8ff2ac89d7162a531657d3f",ee.callServer,void 0,ee.findSourceMapURL,"updateProject");var es=e.i(387292);let ea=(0,ee.createServerReference)("400af64baf5eef2e6b627a6d20a331f3d5763c2646",ee.callServer,void 0,ee.findSourceMapURL,"deleteProject"),er=(0,ee.createServerReference)("40f56c724ff4de28b52994d784fb8faf4cdeb0c411",ee.callServer,void 0,ee.findSourceMapURL,"getRecentLocalProjects"),en=(0,ee.createServerReference)("408bcb914d056275e6454a031cc4bc59ce08cf5bc5",ee.callServer,void 0,ee.findSourceMapURL,"getOrCreateTowerTaskId");var el=e.i(197550),ei=e.i(852494),eo=e.i(583329),ec=e.i(796997),ed=e.i(360112),em=e.i(224277),ex=e.i(905455);function eu({commits:e}){let{t:a}=(0,o.useI18n)(),[r,n]=(0,s.useState)(!1);return 0===e.length?null:(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>n(!r),className:"flex w-full items-center justify-between py-1",children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:a("git.commitLog")}),r?(0,t.jsx)(U.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,t.jsx)(G.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),r&&(0,t.jsx)("div",{className:"mt-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:e.map(e=>(0,t.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,t.jsx)(_,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:e.message}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,t.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(e.shortHash),ed.toast.success(`Copied ${e.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[e.shortHash,(0,t.jsx)(Q.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.author}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m`;let s=Math.floor(t/60);if(s<24)return`${s}h`;let a=Math.floor(s/24);return a<30?`${a}d`:`${Math.floor(a/30)}mo`}(e.date)})]})]})]},e.hash))})]})}var eh=e.i(487278),ep=e.i(375306),eg=e.i(244354);function ef({localPath:e,stashes:a,hasChanges:r,onRefresh:n}){let{t:l}=(0,o.useI18n)(),[i,c]=(0,s.useState)(!1),[d,m]=(0,s.useState)(!1),[x,u]=(0,s.useState)(""),[g,f]=(0,s.useState)(null),j=async()=>{m(!0);try{await (0,eg.gitAction)(e,"stash-save",{message:x}),u(""),ed.toast.success(l("git.stashSaved")),await n()}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}finally{m(!1)}},b=async t=>{f(t);try{await (0,eg.gitAction)(e,"stash-pop",{index:t}),ed.toast.success(l("git.stashApplied")),await n()}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}finally{f(null)}},N=async t=>{f(t);try{await (0,eg.gitAction)(e,"stash-drop",{index:t}),ed.toast.success(l("git.stashDropped")),await n()}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}finally{f(null)}};return r||0!==a.length?(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>c(!i),className:"flex w-full items-center justify-between py-1",children:[(0,t.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[l("git.stash")," ",a.length>0&&`(${a.length})`]}),i?(0,t.jsx)(U.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,t.jsx)(G.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),i&&(0,t.jsxs)("div",{className:"mt-1.5 space-y-2",children:[r&&(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsx)(p.Input,{value:x,onChange:e=>u(e.target.value),placeholder:l("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:e=>"Enter"===e.key&&j()}),(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:j,disabled:d,className:"shrink-0",children:d?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eh.Archive,{className:"h-3 w-3"})})]}),a.length>0&&(0,t.jsx)("div",{className:"space-y-0.5",children:a.map(e=>(0,t.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,t.jsx)(eh.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:e.message||`stash@{${e.index}}`}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>b(e.index),disabled:g===e.index,className:"text-muted-foreground","aria-label":l("git.stashApply"),children:g===e.index?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(ep.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>N(e.index),disabled:g===e.index,className:"text-rose-400","aria-label":l("git.stashDrop"),children:(0,t.jsx)(P.Trash2,{className:"h-3 w-3"})})]})]},e.index))})]})]}):null}var ej=e.i(515135);function eb({value:e,ariaLabel:a}){let{t:r}=(0,o.useI18n)(),[n,l]=(0,s.useState)(!1),i=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),ed.toast.success(r("common.copied")),setTimeout(()=>l(!1),1500)}catch{ed.toast.error(r("common.copyFailed"))}};return(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/50 pl-3 pr-1 py-1.5",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:e,children:e}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":a,onClick:i,children:n?(0,t.jsx)(b.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(Q.Copy,{className:"h-3 w-3"})})}),(0,t.jsx)(D.TooltipContent,{children:n?r("common.copied"):r("common.copy")})]})]})}function eN({project:e,workspaceId:r}){let{t:n,locale:l}=(0,o.useI18n)(),i=(0,a.useRouter)(),[c,d]=(0,s.useState)(!0),[m,x]=(0,s.useState)(!0),[g,f]=(0,s.useState)(!1),[j,b]=(0,s.useState)(!1),[N,v]=(0,s.useState)(""),[k,y]=(0,s.useState)(!1),[w,C]=(0,s.useState)(!1),[S,I]=(0,s.useState)(!1),[E,L]=(0,s.useState)(e.name),[B,F]=(0,s.useState)(e.alias??""),[A,O]=(0,s.useState)(e.description??""),[M,$]=(0,s.useState)(e.localPath??""),[z,Q]=(0,s.useState)(e.projectType??"FRONTEND"),[ee,eh]=(0,s.useState)([]);(0,s.useEffect)(()=>{er(100).then(eh)},[]);let[ep,eg]=(0,s.useState)(!1),[ev,ek]=(0,s.useState)(""),[ey,ew]=(0,s.useState)(""),[eC,eS]=(0,s.useState)(""),[eT,eP]=(0,s.useState)(""),[eI,eE]=(0,s.useState)("FRONTEND"),[eD,eL]=(0,s.useState)(!1),[eB,eF]=(0,s.useState)(!1),[eR,eA]=(0,s.useState)(null),[eO,eM]=(0,s.useState)(!1),[e$,ez]=(0,s.useState)(!1),eU=e=>{ed.toast.info(e)},eG=(0,s.useCallback)(async()=>{if(e.localPath){eM(!0);try{let t=await fetch(`/api/git?path=${encodeURIComponent(e.localPath)}`);t.ok&&eA(await t.json())}catch{}finally{eM(!1)}}},[e.localPath]);(0,s.useEffect)(()=>{eG()},[eG]);let eW=async()=>{if(e.localPath){ez(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:e.localPath})})).ok?(eU(n("git.initSuccess")),await eG()):eU(n("git.initFailed"))}catch{eU(n("git.initFailed"))}finally{ez(!1)}}},eV=(e,t)=>{i.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1}),i.refresh()},e_=async()=>{if(ey.trim()){eL(!0);try{let e=await (0,es.createProject)({name:ey.trim(),alias:eC.trim()||void 0,description:eT.trim()||void 0,localPath:ev,projectType:eI,workspaceId:r});eg(!1),eV(r,e.id)}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}finally{eL(!1)}}},eH=async()=>{if(M&&!eB){eF(!0);try{let e=await (0,ec.analyzeProjectDirectory)(M.trim(),l);O(e)}catch{ed.toast.error(n("project.analyzeError"))}finally{eF(!1)}}},eK=async()=>{try{await et(e.id,{name:E.trim(),alias:B.trim()||void 0,description:A.trim()||void 0,localPath:M.trim()||void 0,projectType:z}),i.refresh(),f(!1)}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}};return(0,t.jsxs)("aside",{className:"relative w-72 flex-shrink-0 overflow-y-auto border-l border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"border-b border-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e.name}),e.alias&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.alias})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{L(e.name),F(e.alias??""),O(e.description??""),$(e.localPath??""),f(!0)},className:"text-muted-foreground",children:(0,t.jsx)(T.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{v(""),b(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"})})]})]}),e.description&&(0,t.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:e.description}),(0,t.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,t.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===e.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===e.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.GitBranch,{className:"h-3 w-3"}),n("sidebar.right.gitType")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.FileText,{className:"h-3 w-3"}),n("sidebar.right.normalType")]})})}),(e.localPath||e.gitUrl)&&(0,t.jsxs)("div",{className:"mt-3 space-y-1.5",children:[e.localPath&&(0,t.jsx)(eb,{value:e.localPath,ariaLabel:n("project.localPath")}),e.gitUrl&&(0,t.jsx)(eb,{value:e.gitUrl,ariaLabel:n("project.gitUrl")})]}),e.localPath&&(0,t.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,el.openInFileManager)(e.localPath)}catch(e){console.error("openInFileManager failed:",e),ed.toast.error(n("git.openInFileManagerFailed"))}},children:(0,t.jsx)(q.FolderSearch,{className:"h-4 w-4"})})}),(0,t.jsx)(D.TooltipContent,{children:n("git.openInFileManager")})]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ei.openInEditor)(e.localPath)}catch(e){console.error("openInEditor failed:",e),ed.toast.error(n("git.openInEditorFailed"))}},children:(0,t.jsx)(J.Code,{className:"h-4 w-4"})})}),(0,t.jsx)(D.TooltipContent,{children:n("git.openInEditor")})]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,eo.openInTerminal)(e.localPath)}catch(e){console.error("openInTerminal failed:",e),ed.toast.error(n("git.openInTerminalFailed"))}},children:(0,t.jsx)(X.Terminal,{className:"h-4 w-4"})})}),(0,t.jsx)(D.TooltipContent,{children:n("git.openInTerminal")})]})]}),(0,t.jsxs)(h.Button,{variant:"outline",className:"w-full h-9 gap-1.5 text-xs",disabled:w,onClick:async()=>{C(!0);try{let t=await en(e.id);i.push(`/workspaces/${r}/tasks/${t}`)}catch{ed.toast.error(n("git.openStudioFailed"))}finally{C(!1)}},children:[w?(0,t.jsx)(K.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(V.FolderOpen,{className:"h-3.5 w-3.5"}),n("git.openStudio")]})]})]}),(0,t.jsxs)("div",{className:"border-b border-border p-4",children:[(0,t.jsxs)(h.Button,{variant:"ghost",onClick:()=>d(!c),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("git.section")}),c?(0,t.jsx)(U.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(G.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),c&&(0,t.jsx)("div",{className:"mt-3",children:e.localPath?eO?(0,t.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,t.jsx)(K.Loader2,{className:"h-4 w-4 animate-spin"}),(0,t.jsx)("span",{className:"ml-2 text-xs",children:n("git.loading")})]}):eR&&!eR.isGit?(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(H.AlertCircle,{className:"h-3.5 w-3.5"}),(0,t.jsx)("p",{className:"text-xs",children:n("git.notInitialized")})]}),(0,t.jsxs)(h.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:eW,disabled:e$,children:[e$?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(_,{className:"h-3 w-3"}),n("git.initRepo")]})]}):eR?.isGit?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"overflow-hidden h-[560px] flex flex-col",children:(0,t.jsx)(ej.EditorGitPanel,{localPath:e.localPath,mode:"project"})}),(0,t.jsx)(eu,{commits:eR.commits??[]}),(0,t.jsx)(ef,{localPath:e.localPath,stashes:eR.stashes??[],hasChanges:(eR.changedFiles??[]).length>0,onRefresh:eG})]}):null:(0,t.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(H.AlertCircle,{className:"h-3.5 w-3.5"}),(0,t.jsx)("p",{className:"text-xs",children:n("git.noLocalPath")})]})})})]}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)(h.Button,{variant:"ghost",onClick:()=>x(!m),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("sidebar.right.browseRepo")}),m?(0,t.jsx)(U.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(G.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),m&&(0,t.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,t.jsxs)(h.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>I(!0),children:[(0,t.jsx)(V.FolderOpen,{className:"h-3.5 w-3.5"}),n("sidebar.right.browseRepo")]}),ee.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:n("sidebar.right.recent")}),(0,t.jsx)("div",{className:"space-y-0.5",children:ee.map(s=>(0,t.jsxs)("button",{onClick:()=>{s.id!==e.id&&eV(s.workspaceId,s.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${s.id===e.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===s.type?(0,t.jsx)(u.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,t.jsx)(V.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:s.name}),s.localPath&&(0,t.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:s.localPath})]})]},s.id))})]})]})]}),(0,t.jsx)(R.Dialog,{open:g,onOpenChange:f,children:(0,t.jsxs)(R.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsx)(R.DialogTitle,{children:n("project.edit")})}),(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:n("project.name")}),(0,t.jsx)(p.Input,{value:E,onChange:e=>L(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(ex.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:z,onChange:Q})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(p.Input,{value:B,onChange:e=>F(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(h.Button,{type:"button",variant:"ghost",onClick:eH,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!M||eB?"opacity-50":""}`,children:[eB?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(Y.Sparkles,{className:"h-3 w-3"}),eB?n("project.analyzing"):n("project.genDesc")]})]}),(0,t.jsx)(Z.Textarea,{value:A,onChange:e=>O(e.target.value),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 max-h-[200px] overflow-y-auto"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("div",{className:"mt-1.5 break-all rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:M||"—"})]})]}),(0,t.jsxs)(R.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>f(!1),children:n("common.cancel")}),(0,t.jsx)(h.Button,{onClick:eK,disabled:!E.trim()||eB,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("common.save")})]})]})}),(0,t.jsx)(em.FolderBrowserDialog,{open:S,onOpenChange:I,onSelect:e=>{g?$(e):(e=>{let t=ee.find(t=>t.localPath===e);if(t)return eV(t.workspaceId,t.id);let s=e.split("/").filter(Boolean).pop()??"";ek(e),ew(s),eS(""),eP(""),eg(!0)})(e)}}),(0,t.jsx)(R.Dialog,{open:ep,onOpenChange:eg,children:(0,t.jsxs)(R.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsx)(R.DialogTitle,{children:n("topbar.newProject")})}),(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:n("project.localPath")}),(0,t.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:ev})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(p.Input,{value:ey,onChange:e=>ew(e.target.value),placeholder:n("project.namePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(ex.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:eI,onChange:eE})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(p.Input,{value:eC,onChange:e=>eS(e.target.value),placeholder:n("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsx)(Z.Textarea,{value:eT,onChange:e=>eP(e.target.value),placeholder:n("project.descPlaceholder"),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)(R.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>eg(!1),children:n("common.cancel")}),(0,t.jsxs)(h.Button,{onClick:e_,disabled:!ey.trim()||eD,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[eD?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,n("common.create")]})]})]})}),(0,t.jsx)(R.Dialog,{open:j,onOpenChange:e=>{b(e),e||v("")},children:(0,t.jsxs)(R.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsx)(R.DialogTitle,{className:"text-rose-400",children:n("project.deleteTitle")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("project.deleteWarning",{name:e.name})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("project.deleteIrreversible")}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.deleteConfirmLabel")}),(0,t.jsx)(p.Input,{value:N,onChange:e=>v(e.target.value),placeholder:n("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,t.jsxs)(R.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>b(!1),children:n("common.cancel")}),(0,t.jsxs)(h.Button,{variant:"destructive",disabled:N!==n("project.deleteConfirmText")||k,onClick:async()=>{y(!0);try{await ea(e.id),ed.toast.success(n("project.deleteSuccess")),i.push(`/workspaces/${r}`)}catch{ed.toast.error(n("project.deleteFailed"))}finally{y(!1),b(!1)}},children:[k&&(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),n("project.deleteButton")]})]})]})})]})}var ev=e.i(475958),ek=e.i(313029),ey=e.i(301348),ew=e.i(259846),eC=e.i(975157);function eS({title:e,description:s,branch:a,baseBranch:r,version:n,hasConversation:l,updatedAt:i,openDir:c,onBack:d}){let{t:m}=(0,o.useI18n)();return(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Y.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-primary",children:m("taskDetail.title")})]}),(0,t.jsxs)(h.Button,{variant:"ghost",onClick:d,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,t.jsx)(ew.ArrowLeft,{className:"h-3.5 w-3.5"}),m("taskDetail.back")]})]}),(0,t.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:e}),s&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:s}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[r?(0,t.jsxs)(E.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,t.jsx)(u.GitBranch,{className:"mr-1 h-3 w-3"}),r," · worktree"]}):a?(0,t.jsx)(E.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:m("taskDetail.directMode")}):null,n&&(0,t.jsx)(B.TaskVersionTag,{number:n.number,name:n.name,showName:!0}),l&&(0,t.jsx)(E.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:m("taskDetail.hasConversation")}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[m("taskDetail.updatedAt")," ",(0,eC.formatRelativeTime)(i)]}),c&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,el.openInFileManager)(c)}catch(e){console.error("openInFileManager failed:",e),ed.toast.error(m("git.openInFileManagerFailed"))}},children:(0,t.jsx)(q.FolderSearch,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(D.TooltipContent,{side:"bottom",children:m("git.openInFileManager")})]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ei.openInEditor)(c)}catch(e){console.error("openInEditor failed:",e),ed.toast.error(m("git.openInEditorFailed"))}},children:(0,t.jsx)(J.Code,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(D.TooltipContent,{side:"bottom",children:m("git.openInEditor")})]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,eo.openInTerminal)(c)}catch(e){console.error("openInTerminal failed:",e),ed.toast.error(m("git.openInTerminalFailed"))}},children:(0,t.jsx)(X.Terminal,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(D.TooltipContent,{side:"bottom",children:m("git.openInTerminal")})]})]})]})]})}var eT=e.i(14842),eP=e.i(865514),eI=e.i(83434),eE=e.i(188013),eD=e.i(37170),eL=e.i(429210),eB=e.i(473221),eF=e.i(382216),eR=e.i(714039),eA=e.i(309955),eO=e.i(629777),eM=e.i(436325),e$=e.i(326883),ez=e.i(631675);let eU=(0,n.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var eG=e.i(657153),eW=e.i(867533),eV=e.i(563733);let e_=(0,ee.createServerReference)("4005f69c130644e6a8a2047e274defc0ceb38509d0",ee.callServer,void 0,ee.findSourceMapURL,"getTaskNotes");var eH=e.i(873753);let eK=(0,ee.createServerReference)("40c8eddee531b8553afe0724dfaffc11c2abe7b8ad",ee.callServer,void 0,ee.findSourceMapURL,"getTaskAssets");var eY=e.i(438304),eq=e.i(796299),eJ=e.i(235357),eX=e.i(144640),eQ=e.i(937304);let eZ=/\.(txt|md|json)$/i;function e0({taskId:e,projectId:a}){let{t:r}=(0,o.useI18n)(),n=(0,s.useRef)(null),[l,i]=(0,s.useState)([]),[c,d]=(0,s.useState)([]),[x,u]=(0,s.useState)(!1),[p,g]=(0,s.useState)(""),[f,j]=(0,s.useState)(""),[b,N]=(0,s.useState)(!1),[v,k]=(0,s.useState)(null);async function y(){p.trim()&&(await (0,eV.createNote)({title:p.trim(),content:f.trim(),projectId:a,taskId:e,category:"task"}),g(""),j(""),u(!1),e_(e).then(i))}async function w(e){await (0,eH.deleteNote)(e),i(t=>t.filter(t=>t.id!==e))}async function C(t){let s=t.target.files?.[0];if(s){N(!0);try{let t=new FormData;t.set("file",s),t.set("projectId",a),t.set("taskId",e),await (0,eY.uploadAsset)(t),eK(e).then(d)}finally{N(!1),n.current&&(n.current.value="")}}}async function S(e){await (0,eq.deleteAsset)(e),d(t=>t.filter(t=>t.id!==e))}function T(e){return(0,eQ.isImageAsset)(e.filename,e.mimeType)||eZ.test(e.filename)}function I(e){T(e)?k(e):ed.toast.info(r("assets.previewNotSupported"))}async function E(e){try{let t=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path})});if(!t.ok){let e=await t.json().catch(()=>({}));ed.toast.error(e.error||"Failed to reveal file")}}catch{ed.toast.error("Failed to reveal file")}}(0,s.useEffect)(()=>{e_(e).then(i),eK(e).then(d)},[e]);let D=v?(0,eQ.isImageAsset)(v.filename,v.mimeType)?"image":eZ.test(v.filename)?"text":null:null,L=c.filter(e=>(0,eQ.isImageAsset)(e.filename,e.mimeType)).map(e=>({id:e.id,url:(0,eQ.localPathToApiUrl)(e.path),filename:e.filename})),B=v?L.findIndex(e=>e.id===v.id):-1;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.ScrollArea,{className:"h-full",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,t.jsx)(W.FileText,{className:"h-3.5 w-3.5"}),r("taskPage.notes")]}),(0,t.jsxs)(h.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>u(!x),children:[x?(0,t.jsx)(eG.X,{className:"h-3 w-3"}):(0,t.jsx)(m.Plus,{className:"h-3 w-3"}),x?"":r("taskPage.addNote")]})]}),x&&(0,t.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:e=>g(e.target.value),placeholder:r("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,t.jsx)("textarea",{value:f,onChange:e=>j(e.target.value),placeholder:r("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,t.jsx)(h.Button,{className:"text-xs",onClick:y,disabled:!p.trim(),children:r("taskPage.addNote")})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[0===l.length&&!x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noNotes")}),l.map(e=>(0,t.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.title}),e.content&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:e.content}),(0,t.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>w(e.id),className:"shrink-0 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",title:r("taskPage.deleteNote"),children:(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"})})]})},e.id))]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,t.jsx)(eU,{className:"h-3.5 w-3.5"}),r("taskPage.attachments")]}),(0,t.jsxs)(h.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>n.current?.click(),disabled:b,children:[(0,t.jsx)(ez.Upload,{className:"h-3 w-3"}),r("taskPage.uploadFile")]}),(0,t.jsx)("input",{ref:n,type:"file",className:"hidden",onChange:C})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===c.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noAttachments")}),c.map(e=>{var s;let a=T(e);return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,t.jsx)(eU,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("button",{type:"button",onClick:()=>I(e),disabled:!a,className:`min-w-0 flex-1 truncate text-left text-sm ${a?"cursor-pointer hover:underline":"cursor-default"}`,title:a?r("assets.preview"):e.filename,children:e.filename}),(0,t.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(s=e.size)?s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`:""}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[a&&(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>I(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:r("assets.preview"),children:(0,t.jsx)(eW.Eye,{className:"h-3 w-3"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>E(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:r("assets.revealInFinder"),children:(0,t.jsx)(V.FolderOpen,{className:"h-3 w-3"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>S(e.id),className:"shrink-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:r("taskPage.deleteAttachment"),children:(0,t.jsx)(P.Trash2,{className:"h-3 w-3"})})]})]},e.id)})]})]})]})}),(0,t.jsx)(eJ.ImageLightbox,{imageUrl:"image"===D&&B>=0?L[B].url:null,filename:"image"===D&&B>=0?L[B].filename:"",open:"image"===D,onOpenChange:e=>{e||k(null)},assets:L.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:B>=0?B:void 0,onIndexChange:e=>{let t=L[e];if(!t)return;let s=c.find(e=>e.id===t.id);s&&k(s)}}),(0,t.jsx)(eX.TextPreviewDialog,{url:"text"===D&&v?(0,eQ.localPathToApiUrl)(v.path):null,filename:v?.filename??"",open:"text"===D,onOpenChange:e=>{e||k(null)}})]})}function e1({task:e,workspaceId:r,projectLocalPath:n,onClose:l}){let{t:i}=(0,o.useI18n)(),c=(0,a.useRouter)(),{removePortal:d}=(0,eI.useTerminalPortal)(),[m,x]=(0,s.useState)("terminal"),[u,p]=(0,s.useState)(null),[f,j]=(0,s.useState)(!1),[b,N]=(0,s.useState)(e.status);(0,s.useEffect)(()=>{N(e.status)},[e.status]);let[v,k]=(0,s.useState)(null),[y,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1),[T,P]=(0,s.useState)([]);(0,s.useEffect)(()=>{k(null),w(!1),S(!1),P([]),p(null),x("terminal")},[e.id]);let[I,E]=(0,s.useState)([]),[L,B]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=!1;return(0,eM.getPrompts)().then(t=>{if(e)return;E(t.map(e=>({id:e.id,name:e.name,isDefault:e.isDefault})));let s=t.find(e=>e.isDefault);s&&B(s.id)}),()=>{e=!0}},[]),(0,s.useEffect)(()=>{k(null),S(!1);let t=!1;return(0,eE.getTaskExecutions)(e.id).then(e=>{if(t)return;let s=e[0];if(s?.status==="RUNNING"){let e=s.worktreePath||n||null;e&&k(e)}P(e.filter(e=>"RUNNING"!==e.status)),S(!0)}),()=>{t=!0}},[e.id]),(0,s.useEffect)(()=>{if("changes"!==m||"TODO"===b||"CANCELLED"===b)return;let t=!1;return j(!0),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t||p(e?.files||e?.branchDeleted?e:null)}).catch(()=>{t||p(null)}).finally(()=>{t||j(!1)}),()=>{t=!0}},[m,b,e.id]);let F=(0,s.useCallback)(async()=>{if(!y){w(!0),d(e.id);try{let t=await (0,eD.startPtyExecutionSafe)(e.id,"",L);if(!t.ok){w(!1),ed.toast.error(t.error||i("terminal.startFailed"));return}k(t.worktreePath??null),N("IN_PROGRESS")}catch(e){w(!1),ed.toast.error(e instanceof Error&&e.message?e.message:i("terminal.startFailed"))}}},[e.id,y,L,i]),R=(0,s.useCallback)(t=>{w(!1),k(null),d(e.id),0===t&&N("IN_REVIEW"),(0,eE.getTaskExecutions)(e.id).then(e=>{P(e.filter(e=>"RUNNING"!==e.status))}),c.refresh()},[c,e.id]),O=(0,s.useCallback)(async()=>{await (0,eL.stopPtyExecution)(e.id),w(!1),d(e.id),k(null),N("IN_REVIEW"),(0,eE.getTaskExecutions)(e.id).then(e=>{P(e.filter(e=>"RUNNING"!==e.status))}),c.refresh()},[e.id,c]),M=(0,s.useCallback)(async t=>{w(!0),d(e.id),k(null);try{let{worktreePath:s}=await (0,eB.resumePtyExecution)(e.id,t);k(s),N("IN_PROGRESS")}catch{w(!1)}},[e.id,d]),$=(0,s.useCallback)(async()=>{w(!0),d(e.id),k(null);try{let{worktreePath:t}=await (0,eF.continueLatestPtyExecution)(e.id);k(t),N("IN_PROGRESS")}catch(e){w(!1),ed.toast.error(e instanceof Error?e.message:String(e))}},[e.id,d]),[z,U]=(0,s.useState)(!1),[G,V]=(0,s.useState)([]),_=(0,s.useCallback)(async()=>{try{let t=await (0,eA.checkWorktreeClean)(e.id);if(t.hasWorktree&&!t.clean)return void ed.toast.error(i("taskPage.uncommittedChanges",{count:String(t.files.length)}));if(t.hasWorktree&&t.clean&&!t.hasCommits)return void ed.toast.error(i("taskPage.noChangesToComplete"),{action:{label:i("taskPage.markAsCancelled"),onClick:()=>{(0,eR.updateTaskStatus)(e.id,"CANCELLED").then(()=>{N("CANCELLED"),ed.toast.success(i("taskPage.taskCancelled")),c.refresh()}).catch(()=>ed.toast.error("Failed to cancel task"))}}});if(t.hasWorktree&&t.hasCommits){V(t.commitLog),U(!0);return}await (0,eR.updateTaskStatus)(e.id,"DONE"),N("DONE"),ed.toast.success(i("taskPage.taskCompleted")),c.refresh()}catch{ed.toast.error("Failed to complete task")}},[e.id,c,i]),H=(0,s.useCallback)(()=>{N("DONE"),U(!1),ed.toast.success(i("taskPage.taskCompleted")),c.refresh()},[c,i]),Y=(0,s.useCallback)(async t=>{try{let{hash:s}=await (0,eO.commitWorktreeChanges)(e.id,t);ed.toast.success(i("diff.commitSuccess",{hash:s})),c.refresh();let a=await fetch(`/api/tasks/${e.id}/diff`);if(a.ok){let e=await a.json();p(e?.files?e:null)}}catch(e){ed.toast.error(e instanceof Error?e.message:"Commit failed")}},[e.id,c,i]);return(0,t.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,t.jsx)(eS,{title:e.title,description:i("taskDetail.panelDescription"),branch:`task/${e.id}`,baseBranch:e.baseBranch,version:e.version??null,hasConversation:!1,updatedAt:e.updatedAt,openDir:v??(n?e.subPath?`${n}/${e.subPath}`:n:null),onBack:l}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsxs)("button",{onClick:()=>x("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===m?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(X.Terminal,{className:"h-3 w-3"}),i("terminal.execute")]}),(0,t.jsx)("button",{onClick:()=>x("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===m?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:i("taskPage.changes")}),(0,t.jsxs)("button",{onClick:()=>x("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===m?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(W.FileText,{className:"h-3 w-3"}),i("taskPage.notes")]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===b&&(0,t.jsxs)(h.Button,{size:"sm",onClick:_,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,t.jsx)(ey.CheckCircle2,{className:"h-3 w-3"}),i("taskPage.completeTask")]}),"DONE"!==b&&"CANCELLED"!==b&&(0,t.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>c.push(`/workspaces/${r}/tasks/${e.id}`),className:"text-muted-foreground",children:[(0,t.jsx)(ev.ExternalLink,{className:"h-3 w-3"}),i("taskPage.viewDetails")]})]})]}),"terminal"===m?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:C?v?(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),i("execution.running")]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsxs)(D.TooltipTrigger,{onClick:O,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,t.jsx)(ek.Square,{className:"h-3 w-3"}),i("terminal.stopExecution")]}),(0,t.jsx)(D.TooltipContent,{side:"bottom",children:i("terminal.stopHint")})]})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:(0,t.jsx)(eI.TerminalOutlet,{taskId:e.id,worktreePath:v,onSessionEnd:R})})]}):"DONE"===b||"CANCELLED"===b?(0,t.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,t.jsx)(A.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)(e$.ExecutionTimeline,{executions:T})})}):(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[I.length>0&&(0,t.jsxs)(g.Select,{defaultValue:L??"none",onValueChange:e=>B("none"===e?null:e),children:[(0,t.jsx)(g.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,t.jsx)("span",{className:"text-left truncate",children:L?I.find(e=>e.id===L)?.name??i("terminal.noPrompt"):i("terminal.noPrompt")})}),(0,t.jsxs)(g.SelectContent,{className:"min-w-[200px]",children:[(0,t.jsx)(g.SelectItem,{value:"none",children:i("terminal.noPrompt")}),I.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.isDefault?" ★":""]},e.id))]})]},`prompt-${I.length}`),(0,t.jsxs)(h.Button,{onClick:F,disabled:y,size:"sm",className:"gap-2 px-4",children:[y?(0,t.jsx)(K.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(X.Terminal,{className:"h-3.5 w-3.5"}),y?i("terminal.executing"):i("terminal.launch")]})]}),(0,t.jsx)(A.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)(e$.ExecutionTimeline,{executions:T,onResume:M,onContinueLatest:$})})]}):(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,t.jsx)(K.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,t.jsx)("span",{className:"text-xs text-neutral-500",children:i("execution.loading")})]})}):"changes"===m?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:f?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.loadingDiff")})}):u?.branchDeleted?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.branchDeleted")})}):u?(0,t.jsx)(eT.TaskDiffView,{taskId:e.id,files:u.files,totalAdded:u.totalAdded,totalRemoved:u.totalRemoved,hasConflicts:u.hasConflicts,conflictFiles:u.conflictFiles,onCommit:Y,hasUncommitted:u.hasUncommitted}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.noChanges")})})}):"notes"===m?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,t.jsx)(e0,{taskId:e.id,projectId:e.projectId})}):null,(0,t.jsx)(eP.TaskMergeConfirmDialog,{open:z,onOpenChange:U,taskId:e.id,taskTitle:e.title,baseBranch:e.baseBranch??"main",fileCount:u?.files?.length??0,commitCount:u?.commitCount??0,commitLog:G,onMergeComplete:H})]})}var e5=e.i(157972),e3=e.i(517677);let e2=(0,ee.createServerReference)("4071f63fb5bd8ebb5c5ff83388414c0dde47707af0",ee.callServer,void 0,ee.findSourceMapURL,"deleteTask"),e4=(0,ee.createServerReference)("4041a7f15aceb3c8450797ad6507b966941cca7fd7",ee.callServer,void 0,ee.findSourceMapURL,"toggleTaskPinned");var e7=e.i(892734);let e8=(0,ee.createServerReference)("407d238968d5d2100907c40c5bcc103f3ce332d5e8",ee.callServer,void 0,ee.findSourceMapURL,"getVersionsForPicker");var e6=e.i(19671);function e9({projects:e,activeProjectId:a,onSelect:r}){let n=(0,s.useRef)(null),[l,i]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!1),d=()=>{let e=n.current;e&&(i(e.scrollLeft>0),c(e.scrollLeft<e.scrollWidth-e.clientWidth-1))};(0,s.useEffect)(()=>{d();let e=n.current;if(e){e.addEventListener("scroll",d);let t=new ResizeObserver(d);return t.observe(e),()=>{e.removeEventListener("scroll",d),t.disconnect()}}},[e]);let m=e=>{let t=n.current;t&&t.scrollBy({left:"left"===e?-150:150,behavior:"smooth"})};return(0,t.jsxs)("div",{className:"relative flex items-center",children:[l&&(0,t.jsx)("button",{onClick:()=>m("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,t.jsx)(e6.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{ref:n,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>{let s=a===e.id;return(0,t.jsxs)("button",{onClick:()=>{s||r(e.id)},className:`shrink-0 rounded-lg border-b-2 px-4 py-2 text-sm font-medium transition-colors ${s?"border-primary bg-primary/10 text-primary ring-1 ring-primary/20 cursor-default":"border-transparent text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer"}`,children:[(0,t.jsx)("span",{children:e.name}),e.alias&&(0,t.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:e.alias})]},e.id)})}),o&&(0,t.jsx)("button",{onClick:()=>m("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,t.jsx)(G.ChevronRight,{className:"h-4 w-4"})})]})}var te=e.i(759686);function tt({open:e,onOpenChange:s,taskTitle:a,uncommittedFiles:r,commitLog:n,onConfirm:l}){let{t:i}=(0,o.useI18n)(),c=r.length,d=n.length,m=0===c&&0===d;return(0,t.jsx)(R.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(R.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsxs)(R.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(te.AlertTriangle,{className:"h-4 w-4 text-amber-400"}),i("taskCancel.title")]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-3 space-y-1.5",children:[(0,t.jsx)("p",{className:"text-xs text-foreground",children:i("taskCancel.intro",{title:a})}),(0,t.jsx)("p",{className:"text-xs text-amber-300",children:i("taskCancel.irreversible")})]}),m?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("taskCancel.cleanNotice")}):(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:i("taskCancel.uncommittedFiles")}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:c})]}),(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:i("taskCancel.unmergedCommits")}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),c>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:i("taskCancel.filesList")}),(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:r.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),d>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:i("taskCancel.commitsList")}),(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:n.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1.5",children:i("taskCancel.reflogHint")})]})]}),(0,t.jsxs)(R.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>s(!1),children:i("taskCancel.keep")}),(0,t.jsxs)(h.Button,{variant:"destructive",onClick:l,className:"gap-2",children:[(0,t.jsx)(te.AlertTriangle,{className:"h-4 w-4"}),i("taskCancel.confirm")]})]})]})})}e.s(["BoardPageClient",0,function({workspaceId:e,projectId:r,project:n,projects:l,initialTasks:i,labels:d,openTaskId:m}){let x=(0,a.useRouter)(),{t:u}=(0,o.useI18n)(),[,h]=(0,s.useTransition)(),[p,g]=(0,s.useState)(""),[j,b]=(0,s.useState)("all"),[v,k]=(0,s.useState)(!1),[y,w]=(0,s.useState)("TODO"),[C,S]=(0,s.useState)(m??null),[T,P]=(0,s.useState)([]),I=C?i.find(e=>e.id===C)??null:null,[E,D]=(0,s.useState)(null),[L,B]=(0,s.useState)(null),[F,R]=(0,s.useState)(null);(0,s.useEffect)(()=>{e8(r).then(P).catch(()=>P([]))},[r]);let A=T.find(e=>e.isCurrent)?.id??null,O=(0,s.useCallback)(()=>{h(()=>{x.refresh()})},[x]);(0,s.useEffect)(()=>{if(v)return;let e=setInterval(()=>{h(()=>{x.refresh()})},5e3);return()=>clearInterval(e)},[x,v]);let M=(0,s.useCallback)(e=>{g(e)},[]),U=(0,s.useCallback)(async e=>{let t=i.find(t=>t.id===e);if(t)try{let s=await (0,eA.checkWorktreeClean)(e);if(s.hasWorktree&&!s.clean){ed.toast.error(u("taskPage.uncommittedChanges",{count:String(s.files.length)})),O();return}if(s.hasWorktree&&s.clean&&!s.hasCommits){ed.toast.error(u("taskPage.noChangesToComplete"),{action:{label:u("taskPage.markAsCancelled"),onClick:()=>{(0,eR.updateTaskStatus)(e,"CANCELLED").then(()=>{ed.toast.success(u("taskPage.taskCancelled")),O()}).catch(()=>ed.toast.error("Failed to cancel task"))}}}),O();return}if(s.hasWorktree&&s.hasCommits){B({task:t,commitLog:s.commitLog,commitCount:s.commitLog.length}),O();return}await (0,eR.updateTaskStatus)(e,"DONE"),ed.toast.success(u("taskPage.taskCompleted")),O()}catch{ed.toast.error("Failed to complete task"),O()}},[i,O,u]),G=(0,s.useCallback)(async e=>{let t=i.find(t=>t.id===e);if(t)try{let s=await (0,eA.checkWorktreeClean)(e);if(!s.hasWorktree){await (0,eR.updateTaskStatus)(e,"CANCELLED"),ed.toast.success(u("taskPage.taskCancelled")),O();return}R({task:t,files:s.files,commitLog:s.commitLog}),O()}catch{ed.toast.error("Failed to cancel task"),O()}},[i,O,u]),W=(0,s.useCallback)(async(e,t)=>{"DONE"===t?await U(e):"CANCELLED"===t?await G(e):(await (0,eR.updateTaskStatus)(e,t),O())},[O,U,G]),V=(0,s.useCallback)(async e=>{let t=await (0,e5.createTask)({title:e.title,description:e.description,projectId:r,priority:e.priority,status:e.status,labelIds:e.labelIds,baseBranch:e.baseBranch,subPath:e.subPath,versionId:e.versionId??void 0});if(e.autoStart&&t?.id)try{await (0,e7.startPtyExecution)(t.id,""),S(t.id)}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}O()},[r,O]),_=(0,s.useCallback)(async(e,t)=>{await (0,e3.updateTask)(e,{...t,labelIds:t.labelIds}),D(null),O()},[O]),H=(0,s.useCallback)(async e=>{await e2(e),C===e&&S(null),O()},[O,C]),K=(0,s.useCallback)(async e=>{await e4(e),O()},[O]),Y=(0,s.useCallback)(async t=>{try{await (0,e7.startPtyExecution)(t,"")}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}x.push(`/workspaces/${e}/tasks/${t}`)},[x,e]),q=(0,s.useCallback)(async(e,t)=>{"DONE"===t?await U(e):"CANCELLED"===t?await G(e):(await (0,eR.updateTaskStatus)(e,t),O())},[O,U,G]),J=(0,s.useCallback)(e=>{w(e),D(null),k(!0)},[]),X=(0,s.useCallback)(e=>{D(e),k(!0)},[]),Q=i.filter(e=>!e.labels?.some(e=>e.label.name===N.TOWER_LABEL_NAME&&e.label.isBuiltin)),Z=Q.filter(e=>{if("backlog"===j){if(e.versionId)return!1}else if("all"!==j&&e.versionId!==j)return!1;if(p.trim()){let t=p.toLowerCase();if(!e.title.toLowerCase().includes(t)&&!e.description?.toLowerCase().includes(t))return!1}return!0});return(0,t.jsxs)("div",{className:"flex h-full",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,t.jsx)(e9,{projects:l,activeProjectId:r,onSelect:t=>x.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1})})}),(0,t.jsx)(c,{totalTasks:Q.length,runningTasks:Q.filter(e=>"IN_PROGRESS"===e.status).length}),(0,t.jsx)(f,{searchQuery:p,onSearchChange:M,versions:T,versionFilter:j,onVersionFilterChange:b,versionsHref:`/workspaces/${e}/projects/${r}/versions`,onCreateTask:()=>{D(null),k(!0)}}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,t.jsx)($,{initialTasks:Z,onTaskMove:W,onTaskClick:e=>{S(e.id)},onEditTask:X,onAddTask:J,onDeleteTask:H,onTogglePin:K,workspaceId:e,onContextMenuStatusChange:q,onContextMenuLaunch:Y})}),(0,t.jsx)(z.CreateTaskDialog,{open:v,onOpenChange:e=>{k(e),e||D(null)},onSubmit:V,onUpdate:_,defaultStatus:y,editTask:E,editTaskLabelIds:E?.labels?E.labels.map(e=>e.labelId):[],labels:d.filter(e=>!(e.name===N.TOWER_LABEL_NAME&&e.isBuiltin)),projectType:n.type,projectLocalPath:n.localPath,versions:T,defaultVersionId:A})]}),I?(0,t.jsx)(e1,{task:I,workspaceId:e,projectLocalPath:n.localPath,onClose:()=>S(null)}):(0,t.jsx)(eN,{project:n,workspaceId:e}),L&&(0,t.jsx)(eP.TaskMergeConfirmDialog,{open:!0,onOpenChange:e=>{e||B(null)},taskId:L.task.id,taskTitle:L.task.title,baseBranch:L.task.baseBranch??"main",fileCount:0,commitCount:L.commitCount,commitLog:L.commitLog,onMergeComplete:()=>{B(null),ed.toast.success(u("taskPage.taskCompleted")),O()}}),F&&(0,t.jsx)(tt,{open:!0,onOpenChange:e=>{e||R(null)},taskTitle:F.task.title,uncommittedFiles:F.files,commitLog:F.commitLog,onConfirm:()=>{let e=F.task.id;R(null),(0,eR.updateTaskStatus)(e,"CANCELLED").then(()=>{ed.toast.success(u("taskPage.taskCancelled")),O()}).catch(()=>ed.toast.error("Failed to cancel task"))}})]})}],783426)}]);