tower-studio 0.2.18 → 0.2.19

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 (361) 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 -100
  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/next-font-manifest.json +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +40 -28
  14. package/.next/standalone/.next/server/app/_not-found/page.js +5 -4
  15. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/missions/page/next-font-manifest.json +1 -1
  39. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  40. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +87 -63
  41. package/.next/standalone/.next/server/app/missions/page.js +8 -6
  42. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/onboarding/page/next-font-manifest.json +1 -1
  45. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  46. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +40 -28
  47. package/.next/standalone/.next/server/app/onboarding/page.js +5 -4
  48. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/app/page/next-font-manifest.json +1 -1
  51. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  52. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +40 -28
  53. package/.next/standalone/.next/server/app/page.js +5 -4
  54. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/.next/standalone/.next/server/app/settings/page/next-font-manifest.json +1 -1
  57. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  58. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +56 -44
  59. package/.next/standalone/.next/server/app/settings/page.js +5 -4
  60. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/next-font-manifest.json +1 -1
  63. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +95 -83
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +7 -5
  66. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  68. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/next-font-manifest.json +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +89 -77
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +7 -5
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/next-font-manifest.json +1 -1
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +78 -66
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +5 -4
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/next-font-manifest.json +1 -1
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +87 -63
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +8 -6
  84. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  85. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  86. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/next-font-manifest.json +1 -1
  87. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +40 -28
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +6 -5
  90. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  92. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/next-font-manifest.json +1 -1
  93. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  94. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +81 -69
  95. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +7 -5
  96. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  98. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/next-font-manifest.json +1 -1
  99. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  100. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +100 -76
  101. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +8 -6
  102. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/app/workspaces/page/next-font-manifest.json +1 -1
  105. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  106. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +60 -48
  107. package/.next/standalone/.next/server/app/workspaces/page.js +5 -4
  108. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  109. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  110. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
  111. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-0gs-6._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +2 -2
  113. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/[root-of-the-server]__09p152b._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_6swdz._.js +2 -2
  117. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b-ib~7._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gmwjkc._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3ggen._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/[root-of-the-server]__12c9noi._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  123. package/.next/standalone/.next/server/chunks/src_lib_0aowbzy._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/ssr/[externals]_@vscode_ripgrep_0m7itqb._.js +3 -0
  126. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b~c--d._.js → [root-of-the-server]__01evhhc._.js} +1 -1
  127. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0p4-t7d._.js → [root-of-the-server]__0261~vp._.js} +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0313pct._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0eql-bn._.js → [root-of-the-server]__07ns1z8._.js} +2 -2
  130. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08xomvf._.js +47 -0
  131. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__01vzmbg._.js → [root-of-the-server]__09rts_e._.js} +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0b.ej5q._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0jg4u05._.js → [root-of-the-server]__0c7x0o9._.js} +2 -2
  134. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e82_jw._.js +3 -0
  135. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0p_3kgh._.js → [root-of-the-server]__0eea3ta._.js} +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_0box3._.js → [root-of-the-server]__0la1659._.js} +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0jvh8f3._.js → [root-of-the-server]__0m1tg3c._.js} +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0t46zla._.js → [root-of-the-server]__0oqhxfb._.js} +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0lxcgi4._.js → [root-of-the-server]__0qy0o3-._.js} +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0sc_a_d._.js +30 -0
  141. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__06lecy.._.js → [root-of-the-server]__0sdd0qu._.js} +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0sdt1y5._.js +3 -0
  143. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ad6qqx._.js → [root-of-the-server]__0sk.itb._.js} +2 -2
  144. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__10t-oa1._.js → [root-of-the-server]__0th0_fo._.js} +4 -4
  145. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0edxb4j._.js → [root-of-the-server]__0ty1ao1._.js} +2 -2
  146. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__11_h9vs._.js → [root-of-the-server]__0v7p~3.._.js} +2 -2
  147. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wjuu0z._.js +3 -0
  148. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wt83kv._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y.s5ax._.js +3 -0
  150. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y5wu~l._.js +3 -0
  151. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0y.2qv_._.js → [root-of-the-server]__0z7je5_._.js} +3 -3
  152. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zq.n2w._.js +30 -0
  153. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11zjs~k._.js +1 -1
  154. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0zhkbm~._.js → [root-of-the-server]__12ktvsa._.js} +1 -1
  155. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0fvk61p._.js → [root-of-the-server]__13374-3._.js} +1 -1
  156. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_xv.._.js +3 -0
  157. package/.next/standalone/.next/server/chunks/ssr/{_0-m6pij._.js → _0-ez10.._.js} +1 -1
  158. package/.next/standalone/.next/server/chunks/ssr/_01e47s2._.js +4 -0
  159. package/.next/standalone/.next/server/chunks/ssr/_01yg50d._.js +3 -0
  160. package/.next/standalone/.next/server/chunks/ssr/{_0r2el9k._.js → _0574rlr._.js} +1 -1
  161. package/.next/standalone/.next/server/chunks/ssr/_05l656y._.js +3 -0
  162. package/.next/standalone/.next/server/chunks/ssr/_06-jig2._.js +3 -0
  163. package/.next/standalone/.next/server/chunks/ssr/{_0wk5s-y._.js → _08z-g~5._.js} +4 -4
  164. package/.next/standalone/.next/server/chunks/ssr/_09qgmwg._.js +3 -0
  165. package/.next/standalone/.next/server/chunks/ssr/_0_7d5_7._.js +7 -0
  166. package/.next/standalone/.next/server/chunks/ssr/{_05qfznq._.js → _0_vjay8._.js} +4 -4
  167. package/.next/standalone/.next/server/chunks/ssr/_0_zfpwh._.js +3 -0
  168. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +2 -2
  169. package/.next/standalone/.next/server/chunks/ssr/_0djgo-u._.js +3 -0
  170. package/.next/standalone/.next/server/chunks/ssr/_0dvltcf._.js +3 -0
  171. package/.next/standalone/.next/server/chunks/ssr/_0gv9sv3._.js +3 -0
  172. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/_0jz8fv8._.js +3 -0
  174. package/.next/standalone/.next/server/chunks/ssr/{_0~dc49z._.js → _0kef0v6._.js} +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/_0n.xiu5._.js +7 -0
  176. package/.next/standalone/.next/server/chunks/ssr/{_0gy-1oc._.js → _0nbufo.._.js} +1 -1
  177. package/.next/standalone/.next/server/chunks/ssr/_0ng0eku._.js +1 -1
  178. package/.next/standalone/.next/server/chunks/ssr/{_0f2quba._.js → _0qkxdkn._.js} +1 -1
  179. package/.next/standalone/.next/server/chunks/ssr/{_00vtpb1._.js → _0r6gweb._.js} +4 -4
  180. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  181. package/.next/standalone/.next/server/chunks/ssr/{_0mg_44.._.js → _0rqf5w7._.js} +1 -1
  182. package/.next/standalone/.next/server/chunks/ssr/{_0lgx4c3._.js → _0rt8jf_._.js} +4 -4
  183. package/.next/standalone/.next/server/chunks/ssr/{_0s58zbp._.js → _0sbxdnc._.js} +1 -1
  184. package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +1 -1
  185. package/.next/standalone/.next/server/chunks/ssr/_0unw1fq._.js +2 -2
  186. package/.next/standalone/.next/server/chunks/ssr/{_0y3bnq6._.js → _0uuzh5m._.js} +4 -4
  187. package/.next/standalone/.next/server/chunks/ssr/{_0m2o_3.._.js → _0~aon4t._.js} +4 -4
  188. package/.next/standalone/.next/server/chunks/ssr/_10ogq8w._.js +3 -0
  189. package/.next/standalone/.next/server/chunks/ssr/_13esy08._.js +3 -0
  190. package/.next/standalone/.next/server/chunks/ssr/_13kwp85._.js +7 -0
  191. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0hhlpw6._.js +3 -0
  192. package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +3 -0
  193. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +3 -0
  194. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  195. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  196. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  197. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  198. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  199. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  200. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  201. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  202. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  203. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0.e1lk4._.js → src_lib_00tdjs9._.js} +1 -1
  204. package/.next/standalone/.next/server/chunks/ssr/{src_lib_08rw1cx._.js → src_lib_0153vha._.js} +1 -1
  205. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0a3sg-k._.js → src_lib_07bxr4y._.js} +1 -1
  206. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0hddinr._.js → src_lib_0dnn~ft._.js} +1 -1
  207. package/.next/standalone/.next/server/chunks/ssr/src_lib_0e.v07~._.js +3 -0
  208. package/.next/standalone/.next/server/chunks/ssr/src_lib_0haj7_-._.js +3 -0
  209. package/.next/standalone/.next/server/chunks/ssr/src_lib_0vp4mgz._.js +3 -0
  210. package/.next/standalone/.next/server/chunks/ssr/src_lib_0wd-1.k._.js +3 -0
  211. package/.next/standalone/.next/server/chunks/ssr/src_lib_0yvdojq._.js +3 -0
  212. package/.next/standalone/.next/server/chunks/ssr/src_lib_0zfjhu1._.js +3 -0
  213. package/.next/standalone/.next/server/chunks/ssr/src_lib_0~cwhiw._.js +3 -0
  214. package/.next/standalone/.next/server/chunks/ssr/src_lib_127qa83._.js +3 -0
  215. package/.next/standalone/.next/server/chunks/ssr/src_lib_12h5txa._.js +3 -0
  216. package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
  217. package/.next/standalone/.next/server/functions-config-manifest.json +10 -1
  218. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  219. package/.next/standalone/.next/server/next-font-manifest.js +1 -1
  220. package/.next/standalone/.next/server/next-font-manifest.json +13 -13
  221. package/.next/standalone/.next/server/pages/500.html +1 -1
  222. package/.next/standalone/.next/server/pages-manifest.json +0 -1
  223. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  224. package/.next/standalone/.next/server/server-reference-manifest.json +382 -274
  225. package/.next/standalone/.next/static/chunks/0._824vjqa-9k.js +5 -0
  226. package/.next/standalone/.next/static/chunks/03og02bu96n.e.js +1 -0
  227. package/.next/standalone/.next/static/chunks/{1634ulzz-40pw.js → 04wsku4m5~s1q.js} +1 -1
  228. package/.next/standalone/.next/static/chunks/{123doanyjnwwq.css → 066jf0nk75nic.css} +1 -1
  229. package/.next/standalone/.next/static/chunks/06qwj~g0qwhey.js +5 -0
  230. package/.next/standalone/.next/static/chunks/08rokhw7bg_zn.js +1 -0
  231. package/.next/standalone/.next/static/chunks/08~85j56saf6q.js +1 -0
  232. package/.next/standalone/.next/static/chunks/096ysbmoa9qsb.js +1 -0
  233. package/.next/standalone/.next/static/chunks/0b6zhezopdbs2.js +1 -0
  234. package/.next/standalone/.next/static/chunks/0c7b_.6i4jef8.js +1 -0
  235. package/.next/standalone/.next/static/chunks/0esvyij44lvt6.js +1 -0
  236. package/.next/standalone/.next/static/chunks/0hniqlgz6waea.js +2 -0
  237. package/.next/standalone/.next/static/chunks/0hseznii2u-4n.js +5 -0
  238. package/.next/standalone/.next/static/chunks/0izukvmui9f8m.js +1 -0
  239. package/.next/standalone/.next/static/chunks/0kycb80.t-7_-.js +1 -0
  240. package/.next/standalone/.next/static/chunks/0lv0zqg.f66eu.js +1 -0
  241. package/.next/standalone/.next/static/chunks/{0_we-0tskn.or.js → 0njf5husn6ovd.js} +1 -1
  242. package/.next/standalone/.next/static/chunks/0okjtk-a.5lz0.css +1 -0
  243. package/.next/standalone/.next/static/chunks/0p7hamd-yspky.js +2 -0
  244. package/.next/standalone/.next/static/chunks/0s6ygn-alcm2d.js +1 -0
  245. package/.next/standalone/.next/static/chunks/0v66~34w9t3gz.js +5 -0
  246. package/.next/standalone/.next/static/chunks/0v_nmghra_n2q.js +1 -0
  247. package/.next/standalone/.next/static/chunks/{0gs_-avkejs0n.js → 0vu_cifxk7vfu.js} +1 -1
  248. package/.next/standalone/.next/static/chunks/0zf35xwv.l3l7.js +1 -0
  249. package/.next/standalone/.next/static/chunks/{15ugy0vmnfdus.js → 10ght~j9wl9ab.js} +1 -1
  250. package/.next/standalone/.next/static/chunks/11.t9_o8cox8t.js +1 -0
  251. package/.next/standalone/.next/static/chunks/1124-9qfcr70v.js +1 -0
  252. package/.next/standalone/.next/static/chunks/116ssnh5k8ad9.js +1 -0
  253. package/.next/standalone/.next/static/chunks/162ec9.32dj73.js +1 -0
  254. package/.next/standalone/.next/static/media/4fa387ec64143e14-s.0wkzw~je483f-.woff2 +0 -0
  255. package/.next/standalone/.next/static/media/5ce348bf30bf5439-s.0zgw-jeven.3w.woff2 +0 -0
  256. package/.next/standalone/.next/static/media/6306c77e7c8268e4-s.0rhz0arwfsn~5.woff2 +0 -0
  257. package/.next/standalone/.next/static/media/797e433ab948586e-s.p.08e28id.o-okb.woff2 +0 -0
  258. package/.next/standalone/.next/static/media/7d817b4c03b0c5f1-s.0l76wvqk9d84w.woff2 +0 -0
  259. package/.next/standalone/.next/static/media/bbc41e54d2fcbd21-s.0k4k9394f2q-k.woff2 +0 -0
  260. package/.next/standalone/package.json +2 -1
  261. package/dist/mcp-server.cjs +80 -27
  262. package/package.json +2 -1
  263. package/prisma/schema.prisma +1 -0
  264. package/scripts/fix-native-permissions.js +7 -0
  265. package/skills/tower/SKILL.md +12 -5
  266. package/.next/standalone/.next/server/app/_not-found.html +0 -1
  267. package/.next/standalone/.next/server/app/_not-found.meta +0 -16
  268. package/.next/standalone/.next/server/app/_not-found.rsc +0 -25
  269. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +0 -25
  270. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
  271. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +0 -13
  272. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +0 -5
  273. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -5
  274. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +0 -4
  275. package/.next/standalone/.next/server/app/index.html +0 -1
  276. package/.next/standalone/.next/server/app/index.meta +0 -16
  277. package/.next/standalone/.next/server/app/index.rsc +0 -26
  278. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +0 -6
  279. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +0 -26
  280. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +0 -6
  281. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +0 -13
  282. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +0 -6
  283. package/.next/standalone/.next/server/app/onboarding.html +0 -1
  284. package/.next/standalone/.next/server/app/onboarding.meta +0 -15
  285. package/.next/standalone/.next/server/app/onboarding.rsc +0 -31
  286. package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +0 -31
  287. package/.next/standalone/.next/server/app/onboarding.segments/_head.segment.rsc +0 -6
  288. package/.next/standalone/.next/server/app/onboarding.segments/_index.segment.rsc +0 -13
  289. package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +0 -6
  290. package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +0 -9
  291. package/.next/standalone/.next/server/app/onboarding.segments/onboarding.segment.rsc +0 -5
  292. package/.next/standalone/.next/server/app/settings.html +0 -1
  293. package/.next/standalone/.next/server/app/settings.meta +0 -15
  294. package/.next/standalone/.next/server/app/settings.rsc +0 -31
  295. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +0 -31
  296. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +0 -6
  297. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +0 -13
  298. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +0 -6
  299. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +0 -9
  300. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +0 -5
  301. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06.muv_._.js +0 -3
  302. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__083ia54._.js +0 -3
  303. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cylhkc._.js +0 -3
  304. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hv-2bi._.js +0 -3
  305. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hvqdy.._.js +0 -47
  306. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k.hmw2._.js +0 -3
  307. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ugi0gk._.js +0 -3
  308. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z50.82._.js +0 -30
  309. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12so59v._.js +0 -30
  310. package/.next/standalone/.next/server/chunks/ssr/_0.3p35c._.js +0 -3
  311. package/.next/standalone/.next/server/chunks/ssr/_059-b~p._.js +0 -3
  312. package/.next/standalone/.next/server/chunks/ssr/_0_z.pz4._.js +0 -3
  313. package/.next/standalone/.next/server/chunks/ssr/_0acdkk1._.js +0 -4
  314. package/.next/standalone/.next/server/chunks/ssr/_0i8t39l._.js +0 -3
  315. package/.next/standalone/.next/server/chunks/ssr/_0j7t3m6._.js +0 -7
  316. package/.next/standalone/.next/server/chunks/ssr/_0lwcwkm._.js +0 -3
  317. package/.next/standalone/.next/server/chunks/ssr/_0rb.w9u._.js +0 -7
  318. package/.next/standalone/.next/server/chunks/ssr/_0tr1l6m._.js +0 -3
  319. package/.next/standalone/.next/server/chunks/ssr/_0uj61lm._.js +0 -3
  320. package/.next/standalone/.next/server/chunks/ssr/_0yt~8-p._.js +0 -7
  321. package/.next/standalone/.next/server/chunks/ssr/_112.xs5._.js +0 -3
  322. package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0lqfvhm._.js +0 -3
  323. package/.next/standalone/.next/server/chunks/ssr/src_lib_0hysyqq._.js +0 -3
  324. package/.next/standalone/.next/server/chunks/ssr/src_lib_0mre0hs._.js +0 -3
  325. package/.next/standalone/.next/server/chunks/ssr/src_lib_0nokg1l._.js +0 -3
  326. package/.next/standalone/.next/server/chunks/ssr/src_lib_0occbql._.js +0 -3
  327. package/.next/standalone/.next/server/chunks/ssr/src_lib_0q1is-3._.js +0 -3
  328. package/.next/standalone/.next/server/chunks/ssr/src_lib_0s.1_50._.js +0 -3
  329. package/.next/standalone/.next/server/chunks/ssr/src_lib_0uof9w0._.js +0 -3
  330. package/.next/standalone/.next/server/chunks/ssr/src_lib_0y99vkm._.js +0 -3
  331. package/.next/standalone/.next/server/chunks/ssr/src_lib_119inue._.js +0 -3
  332. package/.next/standalone/.next/server/pages/404.html +0 -1
  333. package/.next/standalone/.next/static/chunks/0-7jzlr9x_qsk.js +0 -5
  334. package/.next/standalone/.next/static/chunks/0.rmtqo0qf0kf.js +0 -1
  335. package/.next/standalone/.next/static/chunks/00nc85hwc2xj-.js +0 -1
  336. package/.next/standalone/.next/static/chunks/02rmsyvjctps8.js +0 -1
  337. package/.next/standalone/.next/static/chunks/03pleaq9wzi71.js +0 -1
  338. package/.next/standalone/.next/static/chunks/053~sxv8~uet5.js +0 -1
  339. package/.next/standalone/.next/static/chunks/0_._lea4kj-kf.js +0 -1
  340. package/.next/standalone/.next/static/chunks/0k65.io~ia9.a.js +0 -2
  341. package/.next/standalone/.next/static/chunks/0m-4oc7p23~5d.js +0 -5
  342. package/.next/standalone/.next/static/chunks/0o11wn9vopcqg.js +0 -1
  343. package/.next/standalone/.next/static/chunks/0qc~i8~pr2lr_.js +0 -2
  344. package/.next/standalone/.next/static/chunks/0v_-pz~6z5kwy.js +0 -1
  345. package/.next/standalone/.next/static/chunks/0y42pxoc9pqth.js +0 -1
  346. package/.next/standalone/.next/static/chunks/0y4t-yk9428ag.js +0 -1
  347. package/.next/standalone/.next/static/chunks/0z.p-s6d729o-.js +0 -1
  348. package/.next/standalone/.next/static/chunks/0~8mebeyo5uub.css +0 -1
  349. package/.next/standalone/.next/static/chunks/10_jn899omgp~.js +0 -1
  350. package/.next/standalone/.next/static/chunks/142u31.7x80ux.js +0 -5
  351. package/.next/standalone/.next/static/chunks/14ffa1fe.zktf.js +0 -5
  352. package/.next/standalone/.next/static/chunks/187ga_8mny0dq.js +0 -1
  353. package/.next/standalone/.next/static/media/4fa387ec64143e14-s.0.qu-9752pffj.woff2 +0 -0
  354. package/.next/standalone/.next/static/media/5ce348bf30bf5439-s.0ee55_hj9qcer.woff2 +0 -0
  355. package/.next/standalone/.next/static/media/6306c77e7c8268e4-s.0mao5jbfbduzp.woff2 +0 -0
  356. package/.next/standalone/.next/static/media/797e433ab948586e-s.p.09zddjkbdep5a.woff2 +0 -0
  357. package/.next/standalone/.next/static/media/7d817b4c03b0c5f1-s.0uzt.a6d44yda.woff2 +0 -0
  358. package/.next/standalone/.next/static/media/bbc41e54d2fcbd21-s.0mvwgmnhv29no.woff2 +0 -0
  359. /package/.next/standalone/.next/static/{dUfkElN2NF1kYx7TqxHtX → mLQP8o4ghKE2DGln7fL34}/_buildManifest.js +0 -0
  360. /package/.next/standalone/.next/static/{dUfkElN2NF1kYx7TqxHtX → mLQP8o4ghKE2DGln7fL34}/_clientMiddlewareManifest.js +0 -0
  361. /package/.next/standalone/.next/static/{dUfkElN2NF1kYx7TqxHtX → mLQP8o4ghKE2DGln7fL34}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),a=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:s,description:r,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,a.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:s}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},236967,e=>{"use strict";var t=e.i(289721),a=e.i(210702),s=e.i(538059),r=e.i(259846),l=e.i(645378),n=e.i(453889),i=e.i(487278),o=e.i(533499);let d=[{key:"notes",icon:l.FileText},{key:"assets",icon:n.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,o.useI18n)(),n=(0,s.usePathname)(),i=d.find(e=>n.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(a.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),d.map(s=>{let r=s.icon,n=i===s.key;return(0,t.jsxs)(a.default,{href:`/workspaces/${e}/${s.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${n?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${s.key}`)})]},s.key)})]})}])},487486,e=>{"use strict";var t=e.i(565455),a=e.i(581263),s=e.i(294237),r=e.i(975157);let l=(0,s.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:s="default",render:n,...i}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,r.cn)(l({variant:s}),e)},i),render:n,state:{slot:"badge",variant:s}},(0,a.useRenderElement)(o.defaultTagName??"div",o,o)}],487486)},797094,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40440adf3dd8ccc8e058a09ab80ef012fef1b3918c",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,a])},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},132422,77890,12659,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("405dfc43cd11ae435ef60de537636f1ad4e1b6d324",t.callServer,void 0,t.findSourceMapURL,"openInFileManager");e.s(["openInFileManager",0,a],132422);let s=(0,t.createServerReference)("405d38c1dfe222d25c80e82e946d93bfdbdf42de9d",t.callServer,void 0,t.findSourceMapURL,"openInEditor");e.s(["openInEditor",0,s],77890);let r=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,r],12659)},736061,460707,e=>{"use strict";var t=e.i(572989);let a=(0,t.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);e.s(["FolderSearch",0,a],736061);let s=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,s],460707)},875840,e=>{"use strict";let t=(0,e.i(572989).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],875840)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},685149,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},408101,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("4011f2b8a420d565b4e614611bf6c9b8c4bbcb956c",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,a])},110204,e=>{"use strict";var t=e.i(289721),a=e.i(975157);e.s(["Label",0,function({className:e,...s}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,a.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...s})}])},980376,477826,e=>{"use strict";var t=e.i(289721),a=e.i(225061),s=e.i(975157),r=e.i(519455),l=e.i(670123);function n({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function i({className:e,...r}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,s.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...r})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:o,side:d="right",showCloseButton:c=!0,...u}){return(0,t.jsxs)(n,{children:[(0,t.jsx)(i,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,s.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...u,children:[o,c&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(l.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,s.cn)("text-sm text-muted-foreground",e),...r})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,s.cn)("flex flex-col gap-0.5 p-4",e),...a})},"SheetTitle",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,s.cn)("font-heading text-base font-medium text-foreground",e),...r})}],980376);var o=e.i(514798);let d=(0,o.createServerReference)("40e4dfe6a3b899cdd4196ae7070a035d81655e1385",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,d],477826)},606393,e=>{"use strict";let t=(0,e.i(572989).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],606393)},605005,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(980376),r=e.i(759684),l=e.i(487486),n=e.i(519455),i=e.i(533499),o=e.i(392239),d=e.i(477826),c=e.i(805190),u=e.i(132422),x=e.i(77890),m=e.i(797094),h=e.i(744798),p=e.i(685149),f=e.i(606393),g=e.i(875840),b=e.i(245697),v=e.i(12659),j=e.i(736061),y=e.i(460707),k=e.i(567860);function w({added:e,removed:a}){let{t:s}=(0,i.useI18n)();return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,t.jsx)("span",{children:s("diff.filesChanged",{count:String(e+a)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),a>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",a]})]})}var N=e.i(360112);e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:C,taskId:S}){let{t:I}=(0,i.useI18n)(),[T,D]=(0,a.useState)(null),[P,E]=(0,a.useTransition)(),[M,R]=(0,a.useState)(!1),[O,L]=(0,a.useState)([]);(0,a.useEffect)(()=>{S&&e?E(async()=>{let e=await (0,d.getTaskOverview)(S);e&&(D(e),e.project?.workspaceId&&(0,c.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{L(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>L([])))}):D(null)},[S,e]);let $=T?p.BOARD_COLUMNS.find(e=>e.id===T.status):null,B=T?p.PRIORITY_CONFIG[T.priority]:null,F=T?.executions?.[0]??null,A=(()=>{if(F?.worktreePath)return F.worktreePath;let e=T?.project?.localPath;return e?T?.subPath?`${e}/${T.subPath}`:e:null})(),z=(()=>{let e=F?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),_=async e=>{if(T?.project)try{let{autoStart:t,...a}=e;await (0,o.createTask)({...a,projectId:T.project.id}),N.toast.success(I("taskDrawer.duplicateSuccess")),R(!1),C(!1)}catch{N.toast.error(I("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(s.Sheet,{open:e,onOpenChange:C,children:[(0,t.jsxs)(s.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(s.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(s.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:T?.title??""}),(0,t.jsx)(s.SheetDescription,{className:"sr-only",children:I("taskDrawer.title")}),T&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[$&&(0,t.jsxs)(l.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${$.color}`}),$.label]}),B&&(0,t.jsx)(l.Badge,{variant:"secondary",className:`text-xs ${B.color}`,children:B.label})]})]}),(0,t.jsx)(r.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:P&&!T?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:I("assets.loading")}):T?(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:I("taskDrawer.description")}),(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:T.description||I("taskDrawer.noDescription")})]}),T.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:I("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:T.labels.map(e=>(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(f.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:I("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(T.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(b.Package,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:I("taskDrawer.resources")}),(0,t.jsx)("span",{className:"text-foreground",children:T._count.assets})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:I("taskDrawer.fileChanges")}),z?(0,t.jsx)(w,{added:z.added,removed:z.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:I("taskDrawer.noFileChanges")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(v.PlayCircle,{className:"h-3.5 w-3.5"}),I("taskDrawer.lastExecution")]}),F?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:F.status}),F.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:F.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:I("taskDrawer.noExecution")})]}),A&&(0,t.jsxs)("section",{className:"flex flex-col",children:[(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,u.openInFileManager)(A)}catch(e){console.error("openInFileManager failed:",e),N.toast.error(I("git.openInFileManagerFailed"))}},children:[(0,t.jsx)(j.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),I("git.openInFileManager")]}),(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,x.openInEditor)(A)}catch(e){console.error("openInEditor failed:",e),N.toast.error(I("git.openInEditorFailed"))}},children:[(0,t.jsx)(y.Code,{className:"h-3.5 w-3.5 shrink-0"}),I("git.openInEditor")]}),(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,m.openInTerminal)(A)}catch(e){console.error("openInTerminal failed:",e),N.toast.error(I("git.openInTerminalFailed"))}},children:[(0,t.jsx)(k.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),I("git.openInTerminal")]})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(n.Button,{variant:"default",className:"w-full",onClick:()=>{T&&R(!0)},disabled:!T,children:[(0,t.jsx)(g.Copy,{className:"h-4 w-4"}),I("taskDrawer.duplicate")]})})]}):null})]}),T?.project&&(0,t.jsx)(h.CreateTaskDialog,{open:M,onOpenChange:R,onSubmit:_,labels:O,projectType:T.project.type,projectLocalPath:T.project.localPath,prefillFromTask:{title:T.title,description:T.description,priority:T.priority,subPath:T.subPath,labelIds:T.labels.map(e=>e.label.id),baseBranch:T.baseBranch}})]})}],605005)},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},159925,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40dbca40ce2c8dfb5933699083322e592b153ad2ee",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,a])},155959,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40f3b291bd8de49b5e12902c1584055fa6021588fd",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,a])},734525,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(400355),r=e.i(236967),l=e.i(533499),n=e.i(159925),i=e.i(514798);let o=(0,i.createServerReference)("409a8170a34961d341f2e7589f906d360dde704f51",i.callServer,void 0,i.findSourceMapURL,"getProjectAssets");var d=e.i(453889),c=e.i(912505),u=e.i(645378),x=e.i(867533),m=e.i(998626),h=e.i(519455);let p=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif","apng"]);function f(e,t){if(t?.startsWith("image/"))return!0;let a=e.split(".").pop()?.toLowerCase();return!!a&&p.has(a)}function g(e){let t=e.match(/(?:^|\/)(?:storage|data)\/assets\/([^/]+)\/([^/]+)$/);return t?`/api/files/assets/${t[1]}/${t[2]}`:e}function b({asset:e,onPreview:a,onReveal:s,onDelete:r,onTaskClick:n}){var i;let{t:o}=(0,l.useI18n)(),c=g(e.path),p=f(e.filename,e.mimeType);return(0,t.jsxs)("div",{className:"flex items-center gap-4 rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:bg-accent/20",children:[(0,t.jsx)(h.Button,{variant:"ghost",onClick:()=>a(e),className:"flex-shrink-0 cursor-pointer p-0 h-auto",children:p?(0,t.jsx)("img",{src:c,alt:e.filename,className:"h-12 w-12 rounded object-cover border border-border"}):(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded border border-border bg-muted",children:(0,t.jsx)(u.FileText,{className:"h-6 w-6 text-muted-foreground"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:e.filename}),e.taskTitle&&e.taskId&&(0,t.jsx)(h.Button,{variant:"ghost",onClick:t=>{t.stopPropagation(),n?.(e.taskId)},className:"flex-shrink-0 bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs px-1.5 py-0.5 rounded cursor-pointer hover:bg-blue-500/20 transition-colors h-auto",children:e.taskTitle.length>20?`[任务: ${e.taskTitle.slice(0,20)}...]`:`[任务: ${e.taskTitle}]`})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:null===(i=e.size)?"-":i<1024?`${i} B`:i<1048576?`${(i/1024).toFixed(1)} KB`:i<0x40000000?`${(i/1048576).toFixed(1)} MB`:`${(i/0x40000000).toFixed(1)} GB`}),(0,t.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>a(e),className:"text-muted-foreground","aria-label":o("assets.preview"),children:(0,t.jsx)(x.Eye,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>s(e),className:"text-muted-foreground","aria-label":o("assets.revealInFinder"),children:(0,t.jsx)(d.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>r(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":o("assets.delete"),children:(0,t.jsx)(m.Trash2,{className:"h-4 w-4"})})]})]})}function v({assets:e,onPreview:a,onReveal:s,onDelete:r,onTaskClick:n}){let{t:i}=(0,l.useI18n)();return 0===e.length?(0,t.jsx)(c.EmptyState,{icon:d.FolderOpen,title:i("assets.empty"),description:i("assets.emptyHint")}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsx)(b,{asset:e,onPreview:a,onReveal:s,onDelete:r,onTaskClick:n},e.id))})}var j=e.i(631675),y=e.i(657153),k=e.i(155959),w=e.i(624687),N=e.i(918385);function C({allWorkspaces:e,initialWsId:s,initialProjectId:r,onUploaded:n}){let i,{t:o}=(0,l.useI18n)(),d=(0,a.useRef)(null),[c,u]=(0,a.useState)(!1),[x,m]=(0,a.useState)(!1),[p,f]=(0,a.useState)(null),[g,b]=(0,a.useState)(s),[v,S]=(0,a.useState)(r),[I,T]=(0,a.useState)(""),D=e.find(e=>e.id===g),P=D?.projects??[],E=()=>{u(!1),f(null),d.current&&(d.current.value="")},M=async()=>{if(p&&v){m(!0);try{let e=new FormData;e.append("file",p),e.append("projectId",v),e.append("description",I.trim()),await (0,k.uploadAsset)(e),n(v),E()}finally{m(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(h.Button,{onClick:()=>{b(s),S(r),f(null),T(""),u(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(j.Upload,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:o("assets.upload")})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:E}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:E,className:"absolute right-3 top-3 text-muted-foreground",children:(0,t.jsx)(y.X,{className:"h-4 w-4"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-4",children:o("assets.uploadTitle")}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.workspace")}),(0,t.jsxs)(N.Select,{value:g,onValueChange:t=>{var a;let s;return b(a=t??""),s=e.find(e=>e.id===a),void S(s?.projects[0]?.id??null)},children:[(0,t.jsx)(N.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:D?.name??g})}),(0,t.jsx)(N.SelectContent,{children:e.map(e=>(0,t.jsx)(N.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.project")}),P.length>0?(0,t.jsxs)(N.Select,{value:v??"",onValueChange:e=>S(e??""),children:[(0,t.jsx)(N.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(i=P.find(e=>e.id===v))?i.alias?`${i.name} (${i.alias})`:i.name:v})}),(0,t.jsx)(N.SelectContent,{children:P.map(e=>{let a=e.alias?`${e.name} (${e.alias})`:e.name;return(0,t.jsx)(N.SelectItem,{value:e.id,children:a},e.id)})})]}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.noProject")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.file")}),(0,t.jsx)("input",{type:"file",ref:d,onChange:e=>{f(e.target.files?.[0]??null)},className:"hidden"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{d.current?.click()},className:"flex-1 border-dashed bg-background px-3 py-2 text-xs text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors text-left justify-start",children:p?p.name:o("assets.selectFile")})]}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0 pt-1.5",children:o("assets.description")}),(0,t.jsx)(w.Textarea,{value:I,onChange:e=>T(e.target.value),placeholder:o("assets.descriptionPlaceholder"),className:"flex-1 rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none h-20"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end mt-6",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:E,children:o("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:M,disabled:!p||!v||!I.trim()||x,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:o(x?"assets.uploading":"assets.upload")})]})]})]})]})}var S=e.i(585012),I=e.i(19671),T=e.i(368490),D=e.i(902539);let P=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var E=e.i(922541);function M({imageUrl:e,filename:s,open:r,onOpenChange:n,assets:i,currentIndex:o,onIndexChange:d}){let{t:c}=(0,l.useI18n)(),[u,x]=(0,a.useState)(1),[m,h]=(0,a.useState)({x:0,y:0}),[p,f]=(0,a.useState)(!1),g=(0,a.useRef)(null),[b,v]=(0,a.useState)(!1),j=!!i&&i.length>1&&"number"==typeof o&&!!d,k=j&&o>0,w=j&&o<i.length-1,N=j?i.length:0,C=N>0?Math.ceil(N/10):0,O=j?Math.floor(o/10):0,L=10*O,$=Math.min(L+10,N),B=C>1,F=j&&O>0,A=j&&O<C-1;(0,a.useEffect)(()=>{v(!0)},[]),(0,a.useEffect)(()=>{x(1),h({x:0,y:0})},[e]),(0,a.useEffect)(()=>{if(!r)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[r]);let z=(0,a.useCallback)(()=>n(!1),[n]),_=(0,a.useCallback)(()=>{j&&k&&d(o-1)},[j,k,d,o]),U=(0,a.useCallback)(()=>{j&&w&&d(o+1)},[j,w,d,o]),V=(0,a.useCallback)(()=>{j&&F&&d((O-1)*10)},[j,F,d,O]),H=(0,a.useCallback)(()=>{j&&A&&d(Math.min((O+1)*10,N-1))},[j,A,d,O,N]),G=(0,a.useCallback)(()=>{x(e=>Math.min(8,1.25*e))},[]),W=(0,a.useCallback)(()=>{x(e=>{let t=Math.max(.1,e/1.25);return t<=1&&h({x:0,y:0}),t})},[]),X=(0,a.useCallback)(()=>{x(1),h({x:0,y:0})},[]);(0,a.useEffect)(()=>{if(!r)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),z();break;case"ArrowLeft":j&&(e.preventDefault(),_());break;case"ArrowRight":j&&(e.preventDefault(),U());break;case"+":case"=":e.preventDefault(),G();break;case"-":case"_":e.preventDefault(),W();break;case"0":e.preventDefault(),X()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,j,z,_,U,G,W,X]);let Y=(0,a.useRef)(!1),q=()=>{p&&f(!1),g.current=null},J=p?"cursor-grabbing":"cursor-grab";if(!r||!b)return null;let K=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":c("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[s,j?` \xb7 ${o+1} / ${i.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${J}`,onClick:e=>{e.target===e.currentTarget&&z()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;x(e=>{let a=Math.min(8,Math.max(.1,e*t));return a<=1&&h({x:0,y:0}),a})},children:e&&(0,t.jsx)("img",{src:e,alt:s,onClick:e=>{e.stopPropagation(),Y.current&&(Y.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),Y.current=!1,e.target.setPointerCapture?.(e.pointerId),g.current={x:e.clientX,y:e.clientY,panX:m.x,panY:m.y},f(!0))},onPointerMove:e=>{if(!g.current)return;let t=e.clientX-g.current.x,a=e.clientY-g.current.y;Math.abs(t)+Math.abs(a)>5&&(Y.current=!0),p&&h({x:g.current.panX+t,y:g.current.panY+a})},onPointerUp:q,onPointerLeave:q,onPointerCancel:q,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${m.x}px, ${m.y}px, 0) scale(${u})`,transformOrigin:"center center",transition:p?"none":"transform 120ms ease-out",willChange:p?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[j&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[B&&(0,t.jsx)(R,{onClick:V,title:`${c("assets.lightbox.prev")} (-10)`,"aria-label":`${c("assets.lightbox.prev")} (-10)`,disabled:!F,children:(0,t.jsx)(D.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(R,{onClick:_,title:c("assets.lightbox.prev"),"aria-label":c("assets.lightbox.prev"),disabled:!k,children:(0,t.jsx)(I.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:i.slice(L,$).map((e,a)=>{let s=L+a,r=s===o;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||d(s)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${r?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+s)})}),(0,t.jsx)(R,{onClick:U,title:c("assets.lightbox.next"),"aria-label":c("assets.lightbox.next"),disabled:!w,children:(0,t.jsx)(T.ChevronRight,{className:"h-4 w-4"})}),B&&(0,t.jsx)(R,{onClick:H,title:`${c("assets.lightbox.next")} (+10)`,"aria-label":`${c("assets.lightbox.next")} (+10)`,disabled:!A,children:(0,t.jsx)(P,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*u),"%"]}),(0,t.jsx)(R,{onClick:X,title:c("assets.lightbox.reset"),"aria-label":c("assets.lightbox.reset"),disabled:1===u&&0===m.x&&0===m.y,children:(0,t.jsx)(E.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(R,{onClick:z,title:c("assets.lightbox.close"),"aria-label":c("assets.lightbox.close"),children:(0,t.jsx)(y.X,{className:"h-4 w-4"})})]})]})]});return(0,S.createPortal)(K,document.body)}function R({children:e,onClick:a,title:s,disabled:r,...l}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||a()},title:s,disabled:r,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...l,children:e})}e.i(254826);var O=e.i(309735),L=e.i(776639);function $({url:e,filename:r,open:n,onOpenChange:i}){let{t:o}=(0,l.useI18n)(),[d,c]=(0,a.useState)(null),[u,x]=(0,a.useState)(!1),[m,h]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!n||!e){c(null),h(null);return}let t=!1;return x(!0),h(null),c(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(c(e),x(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?h(o("assets.fileTooLarge")):h(o("assets.previewError")),x(!1))}),()=>{t=!0}},[n,e,o]);let p=r.split(".").pop()?.toLowerCase();return(0,t.jsx)(L.Dialog,{open:n,onOpenChange:i,children:(0,t.jsxs)(L.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:r}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(u)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(s.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.loadingPreview")})]});if(m)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:m});if(null===d)return null;if("md"===p)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(O.Streamdown,{children:d})});if("json"===p){let e;try{e=JSON.stringify(JSON.parse(d),null,2)}catch{e=d}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:d})})()})]})})}var B=e.i(605005),F=e.i(360112);e.s(["AssetsPageClient",0,function({allWorkspaces:e,initialWorkspaceId:i,initialProjectId:d,initialAssets:c}){let u,{t:x}=(0,l.useI18n)(),[m,h]=(0,a.useTransition)(),[p,b]=(0,a.useState)(i),[j,y]=(0,a.useState)(d),[k,w]=(0,a.useState)(c),[S,I]=(0,a.useState)(null),T=e.find(e=>e.id===p),D=T?.projects??[],P=(0,a.useCallback)(e=>{e?h(async()=>{w(await o(e))}):w([])},[h]),[E,R]=(0,a.useState)(null),O=E?f(E.filename,E.mimeType)?"image":/\.(txt|md|json)$/i.test(E.filename)?"text":null:null,L=k.filter(e=>f(e.filename,e.mimeType)).map(e=>({id:e.id,url:g(e.path),filename:e.filename})),A=E?L.findIndex(e=>e.id===E.id):-1,z=async 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(()=>({}));F.toast.error(e.error||"Failed to reveal file")}}catch{F.toast.error("Failed to reveal file")}},_=async e=>{let t=k.find(t=>t.id===e);confirm(x("assets.deleteConfirm",{filename:t?.filename??e}))&&(await (0,n.deleteAsset)(e),P(j))};return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(r.SubPageNav,{workspaceId:p}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(N.Select,{value:p,onValueChange:t=>t&&(t=>{if(t===p)return;b(t);let a=e.find(e=>e.id===t),s=a?.projects[0]??null;y(s?.id??null),P(s?.id??null)})(t),children:[(0,t.jsx)(N.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===p)?.name??p})}),(0,t.jsx)(N.SelectContent,{children:e.map(e=>(0,t.jsx)(N.SelectItem,{value:e.id,children:e.name},e.id))})]}),D.length>0&&(0,t.jsxs)(N.Select,{value:j??"",onValueChange:e=>e&&void(e!==j&&(y(e),P(e))),children:[(0,t.jsx)(N.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(u=D.find(e=>e.id===j))?u.alias?`${u.name} (${u.alias})`:u.name:""})}),(0,t.jsx)(N.SelectContent,{children:D.map(e=>(0,t.jsxs)(N.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(C,{allWorkspaces:e,initialWsId:p,initialProjectId:j,onUploaded:e=>{e===j&&P(j)}})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,t.jsxs)("div",{className:`relative ${m?"opacity-40 pointer-events-none":""} transition-opacity`,children:[m&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(s.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===D.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:x("assets.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:x("assets.noProjectHint")})]}):(0,t.jsx)(v,{assets:k.map(e=>({...e,taskId:e.task?.id??null,taskTitle:e.task?.title??null})),onPreview:e=>{let t=f(e.filename,e.mimeType),a=/\.(txt|md|json)$/i.test(e.filename);(t||a)&&R(e)},onReveal:z,onDelete:_,onTaskClick:I})]})}),(0,t.jsx)(M,{imageUrl:"image"===O&&A>=0?L[A].url:null,filename:"image"===O&&A>=0?L[A].filename:"",open:"image"===O,onOpenChange:e=>{e||R(null)},assets:L.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:A>=0?A:void 0,onIndexChange:e=>{let t=L[e];if(!t)return;let a=k.find(e=>e.id===t.id);a&&R({...a,taskId:a.task?.id??null,taskTitle:a.task?.title??null})}}),(0,t.jsx)($,{url:"text"===O&&E?g(E.path):null,filename:E?.filename??"",open:"text"===O,onOpenChange:e=>{e||R(null)}}),(0,t.jsx)(B.TaskOverviewDrawer,{open:!!S,onOpenChange:e=>{e||I(null)},taskId:S})]})}],734525)},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);
@@ -1,2 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,77597,485599,e=>{"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){var r,i;r=t,i=n[t],(r=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e){return function t(){for(var r=this,n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];return i.length>=e.length?e.apply(this,i):function(){for(var e=arguments.length,n=Array(e),s=0;s<e;s++)n[s]=arguments[s];return t.apply(r,[].concat(i,n))}}}function o(e){return({}).toString.call(e).includes("Object")}function c(e){return"function"==typeof e}var l,u,d=a(function(e,t){throw Error(e[t]||e.default)})({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),h=function(e,t){return o(t)||d("changeType"),Object.keys(t).some(function(t){return!Object.prototype.hasOwnProperty.call(e,t)})&&d("changeField"),t},f=function(e){c(e)||d("selectorType")},g=function(e){c(e)||o(e)||d("handlerType"),o(e)&&Object.values(e).some(function(e){return!c(e)})&&d("handlersType")},m=function(e){e||d("initialIsRequired"),o(e)||d("initialType"),Object.keys(e).length||d("initialContent")};function p(e,t){return c(t)?t(e.current):t}function x(e,t){return e.current=s(s({},e.current),t),t}function v(e,t,r){return c(t)?t(e.current):Object.keys(r).forEach(function(r){var n;return null==(n=t[r])?void 0:n.call(t,e.current[r])}),r}var y={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:"Deprecation warning!\n You are using deprecated way of configuration.\n\n Instead of using\n monaco.config({ urls: { monacoBase: '...' } })\n use\n monaco.config({ paths: { vs: '...' } })\n\n For more please check the link https://github.com/suren-atoyan/monaco-loader#config\n "},b=(l=function(e,t){throw Error(e[t]||e.default)},function e(){for(var t=this,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return n.length>=l.length?l.apply(this,n):function(){for(var r=arguments.length,i=Array(r),s=0;s<r;s++)i[s]=arguments[s];return e.apply(t,[].concat(n,i))}})(y),j=function(e){return(e||b("configIsRequired"),({}).toString.call(e).includes("Object")||b("configType"),e.urls)?(console.warn(y.deprecation),{paths:{vs:e.urls.monacoBase}}):e},w=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}},k={type:"cancelation",msg:"operation is manually canceled"};function C(e){var t=!1,r=new Promise(function(r,n){e.then(function(e){return t?n(k):r(e)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var S=["monaco"],M=function(e){if(Array.isArray(e))return e}(u=({create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};m(e),g(t);var r={current:e},n=a(v)(r,t),i=a(x)(r),s=a(h)(e),o=a(p)(r);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return f(e),e(r.current)},function(e){(function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return t(e)},e)}})(n,i,s,o)(e)}]}}).create({config:{paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}},isInitialized:!1,resolve:null,reject:null,monaco:null}))||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,n,i,s,a=[],o=!0,c=!1;try{i=(t=t.call(e)).next,!1;for(;!(o=(r=i.call(t)).done)&&(a.push(r.value),2!==a.length);o=!0);}catch(e){c=!0,n=e}finally{try{if(!o&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(c)throw n}}return a}}(u)||function(e){if(e){if("string"==typeof e)return t(e,2);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,2):void 0}}(u)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),A=M[0],N=M[1];function E(e){return document.body.appendChild(e)}function D(e){var t,r,n=A(function(e){return{config:e.config,reject:e.reject}}),i=(t="".concat(n.config.paths.vs,"/loader.js"),r=document.createElement("script"),t&&(r.src=t),r);return i.onload=function(){return e()},i.onerror=n.reject,i}function F(){var e=A(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(t){var r=t.m||t;B(r),e.resolve(r)},function(t){e.reject(t)})}function B(e){A().monaco||N({monaco:e})}var R=new Promise(function(e,t){return N({resolve:e,reject:t})}),L={config:function(e){var t=j(e),r=t.monaco,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,S);N(function(e){return{config:function e(t,r){return Object.keys(r).forEach(function(n){r[n]instanceof Object&&t[n]&&Object.assign(r[n],e(t[n],r[n]))}),n(n({},t),r)}(e.config,i),monaco:r}})},init:function(){var e=A(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(N({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),C(R);if(window.monaco&&window.monaco.editor)return B(window.monaco),e.resolve(window.monaco),C(R);w(E,D)(F)}return C(R)},__getMonacoInstance:function(){return A(function(e){return e.monaco})}};e.s(["default",0,L],485599);var I=e.i(965652),_={display:"flex",position:"relative",textAlign:"initial"},O={width:"100%"},$={display:"none"},P={display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"},T=function({children:e}){return I.default.createElement("div",{style:P},e)},z=(0,I.memo)(function({width:e,height:t,isEditorReady:r,loading:n,_ref:i,className:s,wrapperProps:a}){return I.default.createElement("section",{style:{..._,width:e,height:t},...a},!r&&I.default.createElement(T,null,n),I.default.createElement("div",{ref:i,style:{...O,...!r&&$},className:s}))}),U=function(e){(0,I.useEffect)(e,[])},W=function(e,t,r=!0){let n=(0,I.useRef)(!0);(0,I.useEffect)(n.current||!r?()=>{n.current=!1}:e,t)};function V(){}function q(e,t,r,n){var i,s,a,o,c,l;return i=e,s=n,i.editor.getModel(H(i,s))||(a=e,o=t,c=r,l=n,a.editor.createModel(o,c,l?H(a,l):void 0))}function H(e,t){return e.Uri.parse(t)}var G=(0,I.memo)(function({original:e,modified:t,language:r,originalLanguage:n,modifiedLanguage:i,originalModelPath:s,modifiedModelPath:a,keepCurrentOriginalModel:o=!1,keepCurrentModifiedModel:c=!1,theme:l="light",loading:u="Loading...",options:d={},height:h="100%",width:f="100%",className:g,wrapperProps:m={},beforeMount:p=V,onMount:x=V}){let[v,y]=(0,I.useState)(!1),[b,j]=(0,I.useState)(!0),w=(0,I.useRef)(null),k=(0,I.useRef)(null),C=(0,I.useRef)(null),S=(0,I.useRef)(x),M=(0,I.useRef)(p),A=(0,I.useRef)(!1);U(()=>{let e=L.init();return e.then(e=>(k.current=e)&&j(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>{let t;return w.current?(t=w.current?.getModel(),void(o||t?.original?.dispose(),c||t?.modified?.dispose(),w.current?.dispose())):e.cancel()}}),W(()=>{if(w.current&&k.current){let t=w.current.getOriginalEditor(),i=q(k.current,e||"",n||r||"text",s||"");i!==t.getModel()&&t.setModel(i)}},[s],v),W(()=>{if(w.current&&k.current){let e=w.current.getModifiedEditor(),n=q(k.current,t||"",i||r||"text",a||"");n!==e.getModel()&&e.setModel(n)}},[a],v),W(()=>{let e=w.current.getModifiedEditor();e.getOption(k.current.editor.EditorOption.readOnly)?e.setValue(t||""):t!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),W(()=>{w.current?.getModel()?.original.setValue(e||"")},[e],v),W(()=>{let{original:e,modified:t}=w.current.getModel();k.current.editor.setModelLanguage(e,n||r||"text"),k.current.editor.setModelLanguage(t,i||r||"text")},[r,n,i],v),W(()=>{k.current?.editor.setTheme(l)},[l],v),W(()=>{w.current?.updateOptions(d)},[d],v);let N=(0,I.useCallback)(()=>{if(!k.current)return;M.current(k.current);let o=q(k.current,e||"",n||r||"text",s||""),c=q(k.current,t||"",i||r||"text",a||"");w.current?.setModel({original:o,modified:c})},[r,t,i,e,n,s,a]),E=(0,I.useCallback)(()=>{!A.current&&C.current&&(w.current=k.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...d}),N(),k.current?.editor.setTheme(l),y(!0),A.current=!0)},[d,l,N]);return(0,I.useEffect)(()=>{v&&S.current(w.current,k.current)},[v]),(0,I.useEffect)(()=>{b||v||E()},[b,v,E]),I.default.createElement(z,{width:f,height:h,isEditorReady:v,loading:u,_ref:C,className:g,wrapperProps:m})}),K=function(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current},J=new Map,Q=(0,I.memo)(function({defaultValue:e,defaultLanguage:t,defaultPath:r,value:n,language:i,path:s,theme:a="light",line:o,loading:c="Loading...",options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:h=!1,width:f="100%",height:g="100%",className:m,wrapperProps:p={},beforeMount:x=V,onMount:v=V,onChange:y,onValidate:b=V}){let[j,w]=(0,I.useState)(!1),[k,C]=(0,I.useState)(!0),S=(0,I.useRef)(null),M=(0,I.useRef)(null),A=(0,I.useRef)(null),N=(0,I.useRef)(v),E=(0,I.useRef)(x),D=(0,I.useRef)(void 0),F=(0,I.useRef)(n),B=K(s),R=(0,I.useRef)(!1),_=(0,I.useRef)(!1);U(()=>{let e=L.init();return e.then(e=>(S.current=e)&&C(!1)).catch(e=>e?.type!=="cancelation"&&console.error("Monaco initialization: error:",e)),()=>M.current?void(D.current?.dispose(),h?d&&J.set(s,M.current.saveViewState()):M.current.getModel()?.dispose(),M.current.dispose(),M.current=null,R.current=!1,w(!1)):e.cancel()}),W(()=>{let a=q(S.current,e||n||"",t||i||"",s||r||"");a!==M.current?.getModel()&&(d&&J.set(B,M.current?.saveViewState()),M.current?.setModel(a),d&&M.current?.restoreViewState(J.get(s)))},[s],j),W(()=>{M.current?.updateOptions(l)},[l],j),W(()=>{M.current&&void 0!==n&&(M.current.getOption(S.current.editor.EditorOption.readOnly)?M.current.setValue(n):n!==M.current.getValue()&&(_.current=!0,M.current.executeEdits("",[{range:M.current.getModel().getFullModelRange(),text:n,forceMoveMarkers:!0}]),M.current.pushUndoStop(),_.current=!1))},[n],j),W(()=>{let e=M.current?.getModel();j&&e&&i&&S.current?.editor.setModelLanguage(e,i)},[i,j],j),W(()=>{void 0!==o&&M.current?.revealLine(o)},[o],j),W(()=>{S.current?.editor.setTheme(a)},[a],j);let O=(0,I.useCallback)(()=>{if(!(!A.current||!S.current)&&!R.current){E.current(S.current);let c=s||r,h=q(S.current,n||e||"",t||i||"",c||"");M.current=S.current?.editor.create(A.current,{model:h,automaticLayout:!0,...l},u),d&&M.current.restoreViewState(J.get(c)),S.current.editor.setTheme(a),void 0!==o&&M.current.revealLine(o),w(!0),R.current=!0}},[e,t,r,n,i,s,l,u,d,a,o]);return(0,I.useEffect)(()=>{j&&N.current(M.current,S.current)},[j]),(0,I.useEffect)(()=>{k||j||O()},[k,j,O]),F.current=n,(0,I.useEffect)(()=>{j&&y&&(D.current?.dispose(),D.current=M.current?.onDidChangeModelContent(e=>{_.current||y(M.current.getValue(),e)}))},[j,y]),(0,I.useEffect)(()=>{if(j){let e=S.current.editor.onDidChangeMarkers(e=>{let t=M.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=S.current.editor.getModelMarkers({resource:t});b?.(e)}});return()=>{e?.dispose()}}return()=>{}},[j,b]),I.default.createElement(z,{width:f,height:g,isEditorReady:j,loading:c,_ref:A,className:m,wrapperProps:p})});e.s(["DiffEditor",0,G,"Editor",0,Q,"default",0,Q,"useMonaco",0,function(){let[e,t]=(0,I.useState)(L.__getMonacoInstance());return U(()=>{let r;return e||(r=L.init()).then(e=>{t(e)}),()=>r?.cancel()}),e}],77597)},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},461526,e=>{"use strict";e.s(["PREVIEW_TASK_ID",0,"__preview__"])},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let r=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],181209)},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},351909,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40ffd9131a2b0bee3d54dc50b284c1f786f35cf26d",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},991838,e=>{"use strict";var t=e.i(965652),r=e.i(770303);e.s(["useExtension",0,function(e){let n=(0,t.useContext)(r.ExtensionContext);if(!n)throw Error("useExtension must be used inside <ExtensionProvider>");return{status:n.statusMap[e],loading:n.loading,isInstalling:n.installing.has(e),install:()=>n.install(e),uninstall:()=>n.uninstall(e),refresh:()=>n.refresh(e)}}])},635920,636614,162736,311415,379865,309642,372008,298791,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("609115122fc80f9cfa311aac68607ed75f9e200183",t.callServer,void 0,t.findSourceMapURL,"listDirectory");e.s(["listDirectory",0,r],635920);let n=(0,t.createServerReference)("70ccc35bd29cf530a0fe79bae4ed49330dbac8891a",t.callServer,void 0,t.findSourceMapURL,"getGitStatus");e.s(["getGitStatus",0,n],636614);let i=(0,t.createServerReference)("60867649df18e7137e73e018436049a8d98beeb210",t.callServer,void 0,t.findSourceMapURL,"createFile");e.s(["createFile",0,i],162736);let s=(0,t.createServerReference)("60d169213c2468edfef3afcf0970578225b197bfbd",t.callServer,void 0,t.findSourceMapURL,"createDirectory");e.s(["createDirectory",0,s],311415);let a=(0,t.createServerReference)("708e7d82ed5beeb64a1009e32441db06648e3cbe1c",t.callServer,void 0,t.findSourceMapURL,"renameEntry");e.s(["renameEntry",0,a],379865);let o=(0,t.createServerReference)("6079cb7c754adf0e463430f7e47d7d8375bb59a5f7",t.callServer,void 0,t.findSourceMapURL,"deleteEntry");e.s(["deleteEntry",0,o],309642);let c=(0,t.createServerReference)("40b9ec81ef4294cb7831fda668db8db39a9e5f940f",t.callServer,void 0,t.findSourceMapURL,"listAllFiles");e.s(["listAllFiles",0,c],372008);let l=(0,t.createServerReference)("60f6049ae3375aa9b605213448371fc9173e1e9e9b",t.callServer,void 0,t.findSourceMapURL,"readFileContent");e.s(["readFileContent",0,l],298791)},626886,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("70dd68d681bec6b61c38cc57892786beacb60d5655",t.callServer,void 0,t.findSourceMapURL,"writeFileContent");e.s(["writeFileContent",0,r])},266652,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("6000acffe05a8a6381bcba95805ac640fa64d3d9d9",t.callServer,void 0,t.findSourceMapURL,"readFileContentForce");e.s(["readFileContentForce",0,r])},487486,e=>{"use strict";var t=e.i(565455),r=e.i(581263),n=e.i(294237),i=e.i(975157);let s=(0,n.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:n="default",render:a,...o}){var c;return c={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(s({variant:n}),e)},o),render:a,state:{slot:"badge",variant:n}},(0,r.useRenderElement)(c.defaultTagName??"div",c,c)}],487486)},797094,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40440adf3dd8ccc8e058a09ab80ef012fef1b3918c",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,r])},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},736061,460707,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);e.s(["FolderSearch",0,r],736061);let n=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,n],460707)},132422,77890,12659,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("405dfc43cd11ae435ef60de537636f1ad4e1b6d324",t.callServer,void 0,t.findSourceMapURL,"openInFileManager");e.s(["openInFileManager",0,r],132422);let n=(0,t.createServerReference)("405d38c1dfe222d25c80e82e946d93bfdbdf42de9d",t.callServer,void 0,t.findSourceMapURL,"openInEditor");e.s(["openInEditor",0,n],77890);let i=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,i],12659)},960518,e=>{"use strict";let t=(0,e.i(572989).default)("git-compare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);e.s(["GitCompare",0,t],960518)},340873,e=>{"use strict";let t=(0,e.i(572989).default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);e.s(["GitCommitHorizontal",0,t],340873)},707631,(e,t,r)=>{t.exports=e=>{if(!e||"string"!=typeof e||e.match(/^\s+$/))return[];let t=e.split(`
2
- `);if(0===t.length)return[];let r=[],n=null,i=null,a=0,c=0,l=null,u=e=>{let[t,i]=s(e)??[];n={chunks:[],deletions:0,additions:0,from:t,to:i},r.push(n)},d=()=>{(!n||n.chunks.length)&&u()},h=e=>{if(!i)return;let[t]=i.changes.slice(-1);i.changes.push({type:t.type,[t.type]:!0,ln1:t.ln1,ln2:t.ln2,ln:t.ln,content:e})},f=[[/^diff\s/,u],[/^new file mode (\d+)$/,(e,t)=>{d(),n.new=!0,n.newMode=t[1],n.from="/dev/null"}],[/^deleted file mode (\d+)$/,(e,t)=>{d(),n.deleted=!0,n.oldMode=t[1],n.to="/dev/null"}],[/^old mode (\d+)$/,(e,t)=>{d(),n.oldMode=t[1]}],[/^new mode (\d+)$/,(e,t)=>{d(),n.newMode=t[1]}],[/^index\s[\da-zA-Z]+\.\.[\da-zA-Z]+(\s(\d+))?$/,(e,t)=>{d(),n.index=e.split(" ").slice(1),t[1]&&(n.oldMode=n.newMode=t[1].trim())}],[/^---\s/,e=>{d(),n.from=o(e)}],[/^\+\+\+\s/,e=>{d(),n.to=o(e)}],[/^@@\s+-(\d+),?(\d+)?\s+\+(\d+),?(\d+)?\s@@/,(e,t)=>{n||u(e);let[r,s,o,d]=t.slice(1);a=+r,c=+o,i={content:e,changes:[],oldStart:+r,oldLines:+(s||1),newStart:+o,newLines:+(d||1)},l={oldLines:+(s||1),newLines:+(d||1)},n.chunks.push(i)}],[/^\$/,h]],g=[[/^\$/,h],[/^-/,e=>{i&&(i.changes.push({type:"del",del:!0,ln:a++,content:e}),n.deletions++,l.oldLines--)}],[/^\+/,e=>{i&&(i.changes.push({type:"add",add:!0,ln:c++,content:e}),n.additions++,l.newLines--)}],[/^\s*/,e=>{i?.changes.push({type:"normal",normal:!0,ln1:a++,ln2:c++,content:e}),l.oldLines--,l.newLines--}]],m=e=>{l?(e=>{for(let[t,r]of g){let n=e.match(t);if(n){r(e,n);break}}0===l.oldLines&&0===l.newLines&&(l=null)})(e):(e=>{for(let[t,r]of f){let n=e.match(t);if(n){r(e,n);break}}})(e)};for(let e of t)m(e);return r};let n=/(a|i|w|c|o|1|2)\/.*(?=["']? ["']?(b|i|w|c|o|1|2)\/)|(b|i|w|c|o|1|2)\/.*$/g,i=/^(a|b|i|w|c|o|1|2)\//,s=e=>e?.match(n)?.map(e=>e.replace(i,"").replace(/("|')$/,"")),a=/^\\?['"]|\\?['"]$/g,o=e=>{let t=c(e,"-+").trim();return(t=u(t)).replace(a,"").replace(i,"")},c=(e,t)=>{if(e=h(e),!t&&String.prototype.trimLeft)return e.trimLeft();let r=d(t);return e.replace(RegExp(`^${r}+`),"")},l=/\t.*|\d{4}-\d\d-\d\d\s\d\d:\d\d:\d\d(.\d+)?\s(\+|-)\d\d\d\d/,u=e=>{let t=l.exec(e);return t&&(e=e.substring(0,t.index).trim()),e},d=e=>null==e?"\\s":e instanceof RegExp?e.source:`[${h(e).replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}]`,h=e=>`${e??""}`},196199,e=>{"use strict";var t=e.i(707631);function r(e){return e.replace(/\r\n/g,"\n")}e.s(["normalizeLF",0,r,"parseUnifiedDiff",0,function(e){return(0,t.default)(r(e))}])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:n,description:i,action:s,className:a}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",a),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:n}),i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:i}),s&&(0,t.jsx)("div",{className:"mt-2",children:s})]})}])},294980,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("7cced4d6bbbc0361ac95456e1084d9fbeac9dcf643",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,r])},3362,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40b7b8b2cbef88b304d3b9cfc4821bd8151139b07c",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,r])},429416,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60e5cfd3f1474bccccfb4d683c94275923cb38e8f0",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,r])},169751,e=>{"use strict";function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===c(e)}function r(e){return null==e?"":function(e){if("string"==typeof e)return e;if("bigint"==typeof e)return e.toString();let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}function n(e){return"string"==typeof e}function i(e){return"number"==typeof e}function s(e){return"object"==typeof e}function a(e){return null!=e}function o(e){return!e.trim().length}function c(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let l=Object.prototype.hasOwnProperty;class u{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let r=d(e);this._keys.push(r),this._keyMap[r.id]=r,t+=r.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function d(e){let r=null,i=null,s=null,a=1,o=null;if(n(e)||t(e))s=e,r=h(e),i=f(e);else{if(!l.call(e,"name"))throw Error("Missing name property in key");let t=e.name;if(s=t,l.call(e,"weight")&&(a=e.weight)<=0)throw Error(`Property 'weight' in key '${t}' must be a positive integer`);r=h(t),i=f(t),o=e.getFn}return{path:r,id:i,weight:a,src:s,getFn:o}}function h(e){return t(e)?e:e.split(".")}function f(e){return t(e)?e.join("."):e}let g=Object.freeze({isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,useExtendedSearch:!1,useTokenSearch:!1,getFn:function(e,o){let l=[],u=!1,d=(e,o,h,f)=>{if(a(e))if(o[h]){var g,m;let p=e[o[h]];if(!a(p))return;if(h===o.length-1&&(n(p)||i(p)||!0===(g=p)||!1===g||s(m=g)&&null!==m&&"[object Boolean]"==c(g)||"bigint"==typeof p))l.push(void 0!==f?{v:r(p),i:f}:r(p));else if(t(p)){u=!0;for(let e=0,t=p.length;e<t;e+=1)d(p[e],o,h+1,e)}else o.length&&d(p,o,h+1,f)}else l.push(void 0!==f?{v:e,i:f}:e)};return d(e,n(o)?o.split("."):o,0),u?l:l[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}),m=/[^ ]+/g;class p{constructor({getFn:e=g.getFn,fieldNormWeight:t=g.fieldNormWeight}={}){this.norm=function(e=1,t=3){let r=new Map,n=Math.pow(10,t);return{get(t){let i=t.match(m).length;if(r.has(i))return r.get(i);let s=parseFloat(Math.round(1/Math.pow(i,.5*e)*n)/n);return r.set(i,s),s},clear(){r.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,n(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();n(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}removeAll(e){for(let t=e.length-1;t>=0;t-=1)this.records.splice(e[t],1);for(let e=0,t=this.records.length;e<t;e+=1)this.records[e].i=e}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!a(e)||o(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,i){let s={i:i,$:{}};this.keys.forEach((i,c)=>{let l=i.getFn?i.getFn(e):this.getFn(e,i.path);if(a(l)){if(t(l)){let e=[];for(let t=0,i=l.length;t<i;t+=1){let i=l[t];if(a(i)){if(n(i)){if(!o(i)){let r={v:i,i:t,n:this.norm.get(i)};e.push(r)}}else if(a(i.v)){let t=n(i.v)?i.v:r(i.v);if(!o(t)){let r={v:t,i:i.i,n:this.norm.get(t)};e.push(r)}}}}s.$[c]=e}else if(n(l)&&!o(l)){let e={v:l,n:this.norm.get(l)};s.$[c]=e}}}),this.records.push(s)}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function x(e,t,{getFn:r=g.getFn,fieldNormWeight:n=g.fieldNormWeight}={}){let i=new p({getFn:r,fieldNormWeight:n});return i.setKeys(e.map(d)),i.setSources(t),i.create(),i}function v(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let r=1,n=e.length;r<n;r+=1){let n=t[t.length-1],i=e[r];i[0]<=n[1]+1?n[1]=Math.max(n[1],i[1]):t.push(i)}return t}let y={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},b=RegExp("["+Object.keys(y).join("")+"]","g"),j=String.prototype.normalize?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(b,e=>y[e]):e=>e;class w{constructor(e,{location:t=g.location,threshold:r=g.threshold,distance:n=g.distance,includeMatches:i=g.includeMatches,findAllMatches:s=g.findAllMatches,minMatchCharLength:a=g.minMatchCharLength,isCaseSensitive:o=g.isCaseSensitive,ignoreDiacritics:c=g.ignoreDiacritics,ignoreLocation:l=g.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:n,includeMatches:i,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:c,ignoreLocation:l},e=o?e:e.toLowerCase(),e=c?j(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const u=(e,t)=>{this.chunks.push({pattern:e,alphabet:function(e){let t={};for(let r=0,n=e.length;r<n;r+=1){let i=e.charAt(r);t[i]=(t[i]||0)|1<<n-r-1}return t}(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,r=d-t;for(;e<r;)u(this.pattern.substr(e,32),e),e+=32;if(t){const e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=r?j(e):e,this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:s,threshold:a,findAllMatches:o,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:r,startIndex:f})=>{let{isMatch:m,score:p,indices:x}=function(e,t,r,{location:n=g.location,distance:i=g.distance,threshold:s=g.threshold,findAllMatches:a=g.findAllMatches,minMatchCharLength:o=g.minMatchCharLength,includeMatches:c=g.includeMatches,ignoreLocation:l=g.ignoreLocation}={}){let u;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let d=t.length,h=e.length,f=Math.max(0,Math.min(n,h)),m=s,p=f,x=(e,t)=>{let r=e/d;if(l)return r;let n=Math.abs(f-t);return i?r+n/i:n?1:r},v=o>1||c,y=v?Array(h):[];for(;(u=e.indexOf(t,p))>-1;)if(m=Math.min(x(0,u),m),p=u+d,v){let e=0;for(;e<d;)y[u+e]=1,e+=1}p=-1;let b=[],j=1,w=d+h,k=1<<d-1;for(let t=0;t<d;t+=1){let n=0,i=w;for(;n<i;)x(t,f+i)<=m?n=i:w=i,i=Math.floor((w-n)/2+n);w=i;let s=Math.max(1,f-i+1),o=a?h:Math.min(f+i,h)+d,c=Array(o+2);c[o+1]=(1<<t)-1;for(let n=o;n>=s;n-=1){let i=n-1,a=r[e[i]];if(v&&(y[i]=+!!a),c[n]=(c[n+1]<<1|1)&a,t&&(c[n]|=(b[n+1]|b[n])<<1|1|b[n+1]),c[n]&k&&(j=x(t,i))<=m){if(m=j,(p=i)<=f)break;s=Math.max(1,2*f-p)}}if(x(t+1,f)>m)break;b=c}let C={isMatch:p>=0,score:Math.max(.001,j)};if(v){let e=function(e=[],t=g.minMatchCharLength){let r=[],n=-1,i=-1,s=0;for(let a=e.length;s<a;s+=1){let a=e[s];a&&-1===n?n=s:a||-1===n||((i=s-1)-n+1>=t&&r.push([n,i]),n=-1)}return e[s-1]&&s-n>=t&&r.push([n,s-1]),r}(y,o);e.length?c&&(C.indices=e):C.isMatch=!1}return C}(e,t,r,{location:i+f,distance:s,threshold:a,findAllMatches:o,minMatchCharLength:c,includeMatches:n,ignoreLocation:l});m&&(h=!0),d+=p,m&&x&&u.push(...x)});let f={isMatch:h,score:h?d/this.chunks.length:1};return h&&n&&(f.indices=v(u)),f}}class k{constructor(e){this.pattern=e}static isMultiMatch(e){return C(e,this.multiRegex)}static isSingleMatch(e){return C(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function C(e,t){let r=e.match(t);return r?r[1]:null}class S extends k{constructor(e,{location:t=g.location,threshold:r=g.threshold,distance:n=g.distance,includeMatches:i=g.includeMatches,findAllMatches:s=g.findAllMatches,minMatchCharLength:a=g.minMatchCharLength,isCaseSensitive:o=g.isCaseSensitive,ignoreDiacritics:c=g.ignoreDiacritics,ignoreLocation:l=g.ignoreLocation}={}){super(e),this._bitapSearch=new w(e,{location:t,threshold:r,distance:n,includeMatches:i,findAllMatches:s,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:c,ignoreLocation:l})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class M extends k{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,r=0,n=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,r))>-1;)r=t+i,n.push([t,r-1]);let s=!!n.length;return{isMatch:s,score:+!s,indices:n}}}let A=[class extends k{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},M,class extends k{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,this.pattern.length-1]}}},class extends k{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends k{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},class extends k{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:+!t,indices:[e.length-this.pattern.length,e.length-1]}}},class extends k{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=-1===e.indexOf(this.pattern);return{isMatch:t,score:+!t,indices:[0,e.length-1]}}},S],N=A.length,E=new Set([S.type,M.type]),D=[];function F(...e){D.push(...e)}function B(e,t){for(let r=0,n=D.length;r<n;r+=1){let n=D[r];if(n.condition(e,t))return new n(e,t)}return new w(e,t)}let R="$and",L="$path",I=e=>!!(e[R]||e.$or),_=e=>({[R]:Object.keys(e).map(t=>({[t]:e[t]}))});function O(e,r,{auto:i=!0}={}){let a=e=>{if(n(e)){let t={keyId:null,pattern:e};return i&&(t.searcher=B(e,r)),t}let o=Object.keys(e),c=!!e[L];if(!c&&o.length>1&&!I(e))return a(_(e));if(!t(e)&&s(e)&&!I(e)){let t=c?e[L]:o[0],s=c?e.$val:e[t];if(!n(s))throw Error(`Invalid value for key ${t}`);let a={keyId:f(t),pattern:s};return i&&(a.searcher=B(s,r)),a}let l={children:[],operator:o[0]};return o.forEach(r=>{let n=e[r];t(n)&&n.forEach(e=>{l.children.push(a(e))})}),l};return I(e)||(e=_(e)),a(e)}function $(e,{ignoreFieldNorm:t=g.ignoreFieldNorm}){let r=1;return e.forEach(({key:e,norm:n,score:i})=>{let s=e?e.weight:null;r*=Math.pow(0===i&&s?Number.EPSILON:i,(s||1)*(t?1:n))}),r}class P{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let r=e-1>>1;if(t[e].score<=t[r].score)break;let n=t[e];t[e]=t[r],t[r]=n,e=r}}_sinkDown(e){let t=this.heap,r=t.length,n=e;do{let i=2*(e=n)+1,s=2*e+2;if(i<r&&t[i].score>t[n].score&&(n=i),s<r&&t[s].score>t[n].score&&(n=s),n!==e){let r=t[e];t[e]=t[n],t[n]=r}}while(n!==e)}}function T(e,t){let r=e.matches;t.matches=[],a(r)&&r.forEach(e=>{if(!a(e.indices)||!e.indices.length)return;let{indices:r,value:n}=e,i={indices:r,value:n};e.key&&(i.key=e.key.src),e.idx>-1&&(i.refIndex=e.idx),t.matches.push(i)})}function z(e,t){t.score=e.score}let U=/\b\w+\b/g;function W({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize:r=>(e||(r=r.toLowerCase()),t&&(r=j(r)),r.match(U)||[])}}function V(e,t){for(let[r,n]of e.terms){let i=n.filter(e=>e.docIdx!==t),s=n.length-i.length;s>0&&(e.fieldCount-=s,e.df.set(r,(e.df.get(r)||0)-s),0===i.length?(e.terms.delete(r),e.df.delete(r)):e.terms.set(r,i))}}class q{constructor(e,t,r){this.options={...g,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new u(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=B(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof p))throw Error("Incorrect 'index' type");if(this._myIndex=t||x(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=W({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(e,t,r){let n=new Map,i=new Map,s=0;function a(e,t,a,o){let c=r.tokenize(e);if(!c.length)return;s++;let l=new Map;for(let e of c)l.set(e,(l.get(e)||0)+1);for(let[e,r]of l){let s={docIdx:t,keyIdx:a,subIdx:o,tf:r},c=n.get(e);c||(c=[],n.set(e,c)),c.push(s),i.set(e,(i.get(e)||0)+1)}}for(let r of e){let{i:e,v:n,$:i}=r;if(void 0!==n){a(n,e,-1,-1);continue}if(i)for(let r=0;r<t;r++){let t=i[r];if(t)if(Array.isArray(t))for(let n of t)a(n.v,e,r,n.i??-1);else a(t.v,e,r,-1)}}return{terms:n,fieldCount:s,df:i}}(this._myIndex.records,this._myIndex.keys.length,e)}}add(e){if(a(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){let e=this._myIndex.records[this._myIndex.records.length-1],t=W({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});!function(e,t,r,n){let{i:i,v:s,$:a}=t;function o(t,r,s){let a=n.tokenize(t);if(!a.length)return;e.fieldCount++;let o=new Map;for(let e of a)o.set(e,(o.get(e)||0)+1);for(let[t,n]of o){let a={docIdx:i,keyIdx:r,subIdx:s,tf:n},o=e.terms.get(t);o||(o=[],e.terms.set(t,o)),o.push(a),e.df.set(t,(e.df.get(t)||0)+1)}}if(void 0!==s)return o(s,-1,-1);if(a)for(let e=0;e<r;e++){let t=a[e];if(t)if(Array.isArray(t))for(let r of t)o(r.v,e,r.i??-1);else o(t.v,e,-1)}}(this._invertedIndex,e,this._myIndex.keys.length,t)}}remove(e=()=>!1){let t=[],r=[];for(let n=0,i=this._docs.length;n<i;n+=1)e(this._docs[n],n)&&(t.push(this._docs[n]),r.push(n));if(r.length){if(this._invertedIndex)for(let e of r)V(this._invertedIndex,e);for(let e=r.length-1;e>=0;e-=1)this._docs.splice(r[e],1);this._myIndex.removeAll(r)}return t}removeAt(e){this._invertedIndex&&V(this._invertedIndex,e);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),t}getIndex(){return this._myIndex}search(e,t){let r,{limit:s=-1}=t||{},{includeMatches:a,includeScore:o,shouldSort:c,sortFn:l,ignoreFieldNorm:u}=this.options;if(n(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return i(s)&&s>-1&&(e=e.slice(0,s)),e}if(i(s)&&s>0&&n(e)){let t=new P(s);n(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:u}),r=t.extractSorted(l)}else!function(e,{ignoreFieldNorm:t=g.ignoreFieldNorm}){e.forEach(e=>{e.score=$(e.matches,{ignoreFieldNorm:t})})}(r=n(e)?n(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:u}),c&&r.sort(l),i(s)&&s>-1&&(r=r.slice(0,s));return function(e,t,{includeMatches:r=g.includeMatches,includeScore:n=g.includeScore}={}){let i=[];return r&&i.push(T),n&&i.push(z),e.map(e=>{let{idx:r}=e,n={item:t[r],refIndex:r};return i.length&&i.forEach(t=>{t(e,n)}),n})}(r,this._docs,{includeMatches:a,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:r}={}){let n=this._getSearcher(e),{records:i}=this._myIndex,s=t?null:[];return i.forEach(({v:e,i:i,n:o})=>{if(!a(e))return;let{isMatch:c,score:l,indices:u}=n.searchIn(e);if(c){let n={item:e,idx:i,matches:[{score:l,value:e,norm:o,indices:u}]};t?(n.score=$(n.matches,{ignoreFieldNorm:r}),t.shouldInsert(n.score)&&t.insert(n)):s.push(n)}}),s}_searchLogical(e){let t=O(e,this.options),r=(e,t,n)=>{if(!("children"in e)){let r,{keyId:i,searcher:s}=e;return(null===i?(r=[],this._myIndex.keys.forEach((e,n)=>{r.push(...this._findMatches({key:e,value:t[n],searcher:s}))})):r=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:s}),r&&r.length)?[{idx:n,item:t,matches:r}]:[]}let{children:i,operator:s}=e,a=[];for(let e=0,o=i.length;e<o;e+=1){let o=r(i[e],t,n);if(o.length)a.push(...o);else if(s===R)return[]}return a},n=this._myIndex.records,i=new Map,s=[];return n.forEach(({$:e,i:n})=>{if(a(e)){let a=r(t,e,n);a.length&&(i.has(n)||(i.set(n,{idx:n,item:e,matches:[]}),s.push(i.get(n))),a.forEach(({matches:e})=>{i.get(n).matches.push(...e)}))}}),s}_searchObjectList(e,{heap:t,ignoreFieldNorm:r}={}){let n=this._getSearcher(e),{keys:i,records:s}=this._myIndex,o=t?null:[];return s.forEach(({$:e,i:s})=>{if(!a(e))return;let c=[],l=!1,u=!1;if(i.forEach((t,r)=>{let i=this._findMatches({key:t,value:e[r],searcher:n});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),(!u||!l)&&c.length){let n={idx:s,item:e,matches:c};t?(n.score=$(n.matches,{ignoreFieldNorm:r}),t.shouldInsert(n.score)&&t.insert(n)):o.push(n)}}),o}_findMatches({key:e,value:r,searcher:n}){if(!a(r))return[];let i=[];if(t(r))r.forEach(({v:t,i:r,n:s})=>{if(!a(t))return;let{isMatch:o,score:c,indices:l,hasInverse:u}=n.searchIn(t);o&&i.push({score:c,key:e,value:t,idx:r,norm:s,indices:l,hasInverse:u})});else{let{v:t,n:s}=r,{isMatch:a,score:o,indices:c,hasInverse:l}=n.searchIn(t);a&&i.push({score:o,key:e,value:t,norm:s,indices:c,hasInverse:l})}return i}}q.version="7.3.0",q.createIndex=x,q.parseIndex=function(e,{getFn:t=g.getFn,fieldNormWeight:r=g.fieldNormWeight}={}){let{keys:n,records:i}=e,s=new p({getFn:t,fieldNormWeight:r});return s.setKeys(n),s.setIndexRecords(i),s},q.config=g,q.match=function(e,t,r){return B(e,{...g,...r}).searchIn(t)},q.parseQuery=O,F(class{constructor(e,{isCaseSensitive:t=g.isCaseSensitive,ignoreDiacritics:r=g.ignoreDiacritics,includeMatches:n=g.includeMatches,minMatchCharLength:i=g.minMatchCharLength,ignoreLocation:s=g.ignoreLocation,findAllMatches:a=g.findAllMatches,location:o=g.location,threshold:c=g.threshold,distance:l=g.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n,minMatchCharLength:i,findAllMatches:a,ignoreLocation:s,location:o,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=r?j(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{let r=(function(e){let t=[],r=e.length,n=0;for(;n<r;){for(;n<r&&" "===e[n];)n++;if(n>=r)break;let i=n;for(;i<r&&" "!==e[i]&&'"'!==e[i];)i++;if(i<r&&'"'===e[i]){for(i++;i<r;){if('"'===e[i]){let t=i+1;if(t>=r||" "===e[t]){i++;break}if("$"===e[t]&&(t+1>=r||" "===e[t+1])){i+=2;break}}i++}t.push(e.substring(n,i)),n=i}else{for(;i<r&&" "!==e[i];)i++;t.push(e.substring(n,i)),n=i}}return t})(e.replace(/\u0000/g,"|").trim()).filter(e=>e&&!!e.trim()),n=[];for(let e=0,i=r.length;e<i;e+=1){let i=r[e],s=!1,a=-1;for(;!s&&++a<N;){let e=A[a],r=e.isMultiMatch(i);r&&(n.push(new e(r,t)),s=!0)}if(!s)for(a=-1;++a<N;){let e=A[a],r=e.isSingleMatch(i);if(r){n.push(new e(r,t));break}}}return n})}(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:r,isCaseSensitive:n,ignoreDiacritics:i}=this.options;e=n?e:e.toLowerCase(),e=i?j(e):e;let s=0,a=[],o=0,c=!1;for(let n=0,i=t.length;n<i;n+=1){let i=t[n];a.length=0,s=0,c=!1;for(let t=0,n=i.length;t<n;t+=1){let n=i[t],{isMatch:l,indices:u,score:d}=n.search(e);if(l){s+=1,o+=d;let e=n.constructor.type;e.startsWith("inverse")&&(c=!0),r&&(E.has(e)?a.push(...u):a.push(u))}else{o=0,s=0,a.length=0,c=!1;break}}if(s){let e={isMatch:!0,score:o/s};return c&&(e.hasInverse=!0),r&&(e.indices=v(a)),e}}return{isMatch:!1,score:1}}}),F(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=W({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics});const r=this.analyzer.tokenize(e),{df:n,fieldCount:i}=t._invertedIndex;for(const e of(this.termSearchers=[],this.idfWeights=[],r)){this.termSearchers.push(new w(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const r=n.get(e)||0,s=Math.log(1+(i-r+.5)/(r+.5));this.idfWeights.push(s)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],r=0,n=0,i=0;for(let s=0;s<this.termSearchers.length;s++){let a=this.termSearchers[s].searchIn(e),o=this.idfWeights[s];n+=o,a.isMatch&&(i++,r+=o*(1-a.score),a.indices&&t.push(...a.indices))}if(0===i)return{isMatch:!1,score:1};let s={isMatch:!0,score:Math.max(.001,n>0?1-r/n:0)};return this.options.includeMatches&&t.length&&(s.indices=v(t)),s}}),q.use=function(...e){e.forEach(e=>F(e))},e.s(["default",0,q])},313029,e=>{"use strict";let t=(0,e.i(572989).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",0,t],313029)},14842,865514,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(368490),i=e.i(232280),s=e.i(759686),a=e.i(960518),o=e.i(340873),c=e.i(400355),l=e.i(519455),u=e.i(912505),d=e.i(487486),h=e.i(776639),f=e.i(624687),g=e.i(533499);function m({patchState:e,isLargeFold:r,onLoad:n}){let{t:i}=(0,g.useI18n)();return r?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(l.Button,{variant:"link",onClick:n,className:"h-auto p-0 text-sm",children:i("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:i("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:i("diff.loadFailed")}),(0,t.jsx)(l.Button,{variant:"ghost",onClick:n,children:i("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:i("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:i("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(c.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:r}=(0,g.useI18n)(),n=e.split("\n"),i=n.length>500,s=i?n.slice(0,500):n;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:s.map((e,r)=>{let n=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:n,children:e||" "},r)})}),i&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:r("diff.patchTruncated",{n:String(500),total:String(n.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:c,totalAdded:p,totalRemoved:x,hasConflicts:v,conflictFiles:y,onCommit:b,hasUncommitted:j}){let{t:w}=(0,g.useI18n)(),[k,C]=(0,r.useState)(new Set),[S,M]=(0,r.useState)(new Map),[A,N]=(0,r.useState)(!1),[E,D]=(0,r.useState)(""),[F,B]=(0,r.useState)(!1),R=t=>{M(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{M(r=>{let n=new Map(r);return"binary"===e.kind?n.set(t,{kind:"binary"}):"empty"===e.kind?n.set(t,{kind:"empty"}):n.set(t,{kind:"ready",patch:e.patch??""}),n})}).catch(()=>{M(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[c.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",x]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:j&&b&&(0,t.jsxs)(l.Button,{variant:"outline",onClick:()=>N(!0),className:"gap-2",children:[(0,t.jsx)(o.GitCommitHorizontal,{className:"h-4 w-4"}),w("diff.commit")]})})]}),v&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(s.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",y.length," conflicting file",1!==y.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:y.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===c.length?(0,t.jsx)(u.EmptyState,{icon:a.GitCompare,title:w("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:c.map(e=>{let r=k.has(e.filename),s=S.get(e.filename),a=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(l.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=k.has(e.filename),void(C(t=>{let r=new Set(t);return r.has(e.filename)?r.delete(e.filename):r.add(e.filename),r}),t||e.isBinary||S.has(e.filename)||e.added+e.removed<=200&&R(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[r?(0,t.jsx)(i.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(n.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(d.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:w("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),r&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(m,{filename:e.filename,patchState:s,isLargeFold:!s&&a>200,onLoad:()=>R(e.filename)})})]},e.filename)})})}),(0,t.jsx)(h.Dialog,{open:A,onOpenChange:N,children:(0,t.jsxs)(h.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsx)(h.DialogTitle,{children:w("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(f.Textarea,{value:E,onChange:e=>D(e.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,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"ghost",onClick:()=>N(!1),children:w("common.cancel")}),(0,t.jsx)(l.Button,{onClick:async()=>{if(E.trim()&&b){B(!0);try{await b(E.trim()),D(""),N(!1)}finally{B(!1)}}},disabled:!E.trim()||F,children:F?"...":w("diff.commit")})]})]})})]})}],14842);var x=e.i(538059);let v=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:n,taskId:i,taskTitle:s,baseBranch:a,fileCount:o,commitCount:u,commitLog:d=[],onMergeComplete:f}){let g=(0,x.useRouter)(),[m,p]=(0,r.useState)(!1),[y,b]=(0,r.useState)(null),j=async()=>{p(!0),b(null);try{let e=await fetch(`/api/tasks/${i}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){n(!1),f(),g.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?b(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):b(t.error??"Merge failed")}catch{b("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(h.Dialog,{open:e,onOpenChange:n,children:(0,t.jsxs)(h.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsxs)(h.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(v,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:a})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:o})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:u})]})]}),d.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:d.map((e,r)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},r))})]}),y&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:y})})]}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>n(!1),disabled:m,children:"Cancel"}),(0,t.jsx)(l.Button,{onClick:j,disabled:m,className:"gap-2",children:m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},989383,769824,e=>{"use strict";var t=e.i(572989);let r=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,r],989383);let n=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,n],769824)},244354,e=>{"use strict";async function t(e,r,n={}){let i=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:r,path:e,...n})});if(!i.ok)throw Error((await i.json()).error||`${r} failed`);return i.json()}e.s(["gitAction",0,t])},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},711554,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(226145),i=e.i(232280),s=e.i(738690),a=e.i(597746),o=e.i(400355),c=e.i(776639),l=e.i(519455),u=e.i(793479),d=e.i(624687),h=e.i(533499);e.s(["CreateBranchDialog",0,function({open:e,onOpenChange:f,branches:g,currentBranch:m,localPath:p,onCreated:x,onError:v}){let{t:y}=(0,h.useI18n)(),[b,j]=(0,r.useState)(""),[w,k]=(0,r.useState)(m),[C,S]=(0,r.useState)(""),[M,A]=(0,r.useState)(!1),[N,E]=(0,r.useState)(""),[D,F]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e&&(j(""),k(m),S(""),E(""))},[e,m]);let B=[...new Set(g)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),R=async()=>{if(b.trim()){A(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:p,branch:b.trim(),baseBranch:w})});if(e.ok)f(!1),x();else{let t=await e.json();v(t.error||"Unknown error")}}catch{v("Network error")}finally{A(!1)}}};return(0,t.jsx)(c.Dialog,{open:e,onOpenChange:f,children:(0,t.jsxs)(c.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(c.DialogHeader,{children:(0,t.jsx)(c.DialogTitle,{children:y("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:y("git.branchName")}),(0,t.jsx)(u.Input,{value:b,onChange:e=>j(e.target.value),placeholder:y("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&R()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:y("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>F(!D),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(n.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:w,children:w})]}),(0,t.jsx)(i.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${D?"rotate-180":""}`})]}),D&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(s.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>E(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:B.map(e=>(0,t.jsxs)("button",{onClick:()=>{k(e),F(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===w?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(n.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===w&&(0,t.jsx)(a.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:y("git.branchDesc")}),(0,t.jsx)(d.Textarea,{value:C,onChange:e=>S(e.target.value),placeholder:y("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(c.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>f(!1),children:y("common.cancel")}),(0,t.jsxs)(l.Button,{onClick:R,disabled:!b.trim()||M,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[M?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,y("common.create")]})]})]})})}])},541212,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("60a974d42632a6c3d556e9d0dab58c3c3b649f3e08",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,r])},317248,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("407c04426c5f6a3262e498498881031dea0955108a",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r])},992238,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40099495f31a0f997a6f5e97887f14d51636007a97",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,r])},848466,150133,656985,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("601e34b8f82176c938bcff8f4b913460970f4b4046",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,r],848466);let n=(0,t.createServerReference)("404d3a5a18e7ff3ca13a4a749d576559e04d10ddb9",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,n],150133);let i=(0,t.createServerReference)("60ea0297c5a8dc01a84067cc562680bf647f4e3d27",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,i],656985)},486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},326883,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(232280),i=e.i(472074),s=e.i(301348),a=e.i(181209),o=e.i(400355),c=e.i(989383),l=e.i(12659),u=e.i(922541),d=e.i(486077),h=e.i(769824),f=e.i(519455),g=e.i(912505),m=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(s.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(a.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(o.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(c.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:s,onContinueLatest:a}){let{t:o,locale:c}=(0,m.useI18n)(),[x,v]=(0,r.useState)(null),[y,b]=(0,r.useState)(null);return 0===e.length?(0,t.jsx)(g.EmptyState,{icon:h.History,title:o("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o("execution.history")}),e.map(r=>{let h=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(r.gitStats??null),g=function(e,t){if(!e||!t)return"";let r=new Date(t).getTime()-new Date(e).getTime();if(r<0)return"";let n=Math.floor(r/1e3);if(n<60)return`${n}s`;let i=Math.floor(n/60);if(i<60)return`${i}m ${n%60}s`;let s=Math.floor(i/60);return`${s}h ${i%60}m`}(r.startedAt??null,r.endedAt??null),m=x===r.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:r.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(r.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(r.status,o)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let r=new Date(e),n=Math.floor((new Date().getTime()-r.getTime())/864e5),i="zh"===t?"zh-CN":"en-US",s=r.toLocaleTimeString(i,{hour:"2-digit",minute:"2-digit"});return 0===n?s:1===n?"zh"===t?`昨天 ${s}`:`Yesterday ${s}`:n<7?"zh"===t?`${n}天前 ${s}`:`${n}d ago ${s}`:r.toLocaleDateString(i,{month:"2-digit",day:"2-digit"})+" "+s}(r.startedAt??null,c)}),g&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",g,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:r.summary||o("execution.noSummary")}),h&&(h.commits||h.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[h.commits?(0,t.jsxs)("span",{children:[h.commits," ",o("execution.commits")]}):null,h.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[h.filesChanged," ",o("execution.files")]})]}):null,h.insertions||h.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),h.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",h.insertions]}):null,h.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",h.deletions]}):null]}):null]}),r.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>b(y===r.id?null:r.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(d.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[o("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:r.insightNote.title}),y===r.id?(0,t.jsx)(i.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(n.ChevronDown,{className:"h-3 w-3"})]}),y===r.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:r.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[r.sessionId&&s?(0,t.jsxs)(f.Button,{size:"sm",onClick:()=>s(r.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(l.PlayCircle,{className:"h-3.5 w-3.5"}),o("execution.resume")]}):!r.sessionId&&"FAILED"===r.status&&r.id===e[0]?.id&&a?(0,t.jsxs)(f.Button,{size:"sm",onClick:a,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(u.RotateCcw,{className:"h-3.5 w-3.5"}),o("execution.tryRecover")]}):null,(0,t.jsxs)(f.Button,{variant:"ghost",size:"sm",onClick:()=>v(m?null:r.id),className:"bg-muted text-muted-foreground",children:[m?(0,t.jsx)(i.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(n.ChevronDown,{className:"h-3.5 w-3.5"}),m?o("execution.collapse"):o("execution.details")]})]})]}),m&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[r.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:r.gitLog.split("\n").slice(0,3).join("\n")})]}),r.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:o("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:r.terminalLog})]}),"FAILED"===r.status&&null!=r.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",r.exitCode]})]})]},r.id)})]})}])},922088,e=>{e.v(t=>Promise.all(["static/chunks/10_jn899omgp~.js"].map(t=>e.l(t))).then(()=>t(69466)))},84973,e=>{e.v(t=>Promise.all(["static/chunks/06.0rr3vc.77j.js"].map(t=>e.l(t))).then(()=>t(609403)))},574372,e=>{e.v(t=>Promise.all(["static/chunks/167~e_c5qi8o2.js"].map(t=>e.l(t))).then(()=>t(318135)))},732137,e=>{e.v(t=>Promise.all(["static/chunks/0_we-0tskn.or.js","static/chunks/0ep-qrl_zzch8.js","static/chunks/17oc2l.ekcs8b.css"].map(t=>e.l(t))).then(()=>t(461834)))}]);
@@ -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(918385);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),P=e.i(464249),T=e.i(998626);let E=(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 D=e.i(487486),I=e.i(755146);function L({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:u,isDragging:p}=(0,y.useSortable)({id:e.id,data:{type:"task",task:e}}),g={transform:C.CSS.Transform.toString(x),transition:u,opacity:p?.4:1},f=N.PRIORITY_CONFIG[e.priority];return(0,t.jsxs)("div",{ref:m,style:g,...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)(E,{className:`h-3.5 w-3.5 ${e.pinned?"-rotate-45":""}`})}),(0,t.jsxs)(I.DropdownMenu,{children:[(0,t.jsx)(I.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)(I.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(I.DropdownMenuItem,{onClick:t=>{t.stopPropagation(),a?.(e)},children:[(0,t.jsx)(P.Pencil,{className:"mr-2 h-3.5 w-3.5"}),i("common.edit")]}),(0,t.jsxs)(I.DropdownMenuItem,{className:"text-rose-400",onClick:t=>{t.stopPropagation(),r?.(e.id)},children:[(0,t.jsx)(T.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.jsx)("div",{className:"mt-2.5",children:(0,t.jsx)(D.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${f.color}`,children:f.label})}),e.labels&&e.labels.length>0&&(0,t.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,t.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:e.label.color+"20",color:e.label.color},children:e.label.name},e.label.id))})]})}var B=e.i(776639),R=e.i(759684);function F({open:e,onOpenChange:s,columnLabel:a,columnColor:r,tasks:n,onTaskClick:l}){let{t:i}=(0,o.useI18n)();return(0,t.jsx)(B.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(B.DialogContent,{className:"sm:max-w-6xl max-h-[80vh]",children:[(0,t.jsx)(B.DialogHeader,{children:(0,t.jsxs)(B.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)(R.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)(D.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 O({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)(F,{open:f,onOpenChange:j,columnLabel:a,columnColor:r,tasks:n,onTaskClick:l}),(0,t.jsx)(R.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)(L,{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)(O,{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)(L,{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 A=e.i(744798),M=e.i(232280),z=e.i(368490),U=e.i(242941),G=e.i(645378),W=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 V=e.i(938499),H=e.i(400355),K=e.i(233274),J=e.i(194358),Y=e.i(736061),q=e.i(460707),X=e.i(567860),Q=e.i(624687),Z=e.i(514798);let ee=(0,Z.createServerReference)("60b872dfb3f2ccf6c78b0aa637c5ce1e35de4d89a0",Z.callServer,void 0,Z.findSourceMapURL,"updateProject");var et=e.i(198925);let es=(0,Z.createServerReference)("4056f09d41a4ad3141eea2d2f98dbb6d5c1e076221",Z.callServer,void 0,Z.findSourceMapURL,"deleteProject"),ea=(0,Z.createServerReference)("40cb90f43d42e2224910ee4d9d6efd15fce014e82a",Z.callServer,void 0,Z.findSourceMapURL,"getRecentLocalProjects"),er=(0,Z.createServerReference)("40475d77e4f50c3febca2b1b076b96b8741d82bc1b",Z.callServer,void 0,Z.findSourceMapURL,"getOrCreateTowerTaskId");var en=e.i(132422),el=e.i(77890),ei=e.i(797094),eo=e.i(262812),ec=e.i(360112),ed=e.i(224277),em=e.i(905455),ex=e.i(711554),eu=e.i(875840);function eh({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)(M.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,t.jsx)(z.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),ec.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)(eu.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 ep=e.i(487278),eg=e.i(375306),ef=e.i(244354);function ej({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,ef.gitAction)(e,"stash-save",{message:x}),u(""),ec.toast.success(l("git.stashSaved")),await n()}catch(e){ec.toast.error(e instanceof Error?e.message:String(e))}finally{m(!1)}},b=async t=>{f(t);try{await (0,ef.gitAction)(e,"stash-pop",{index:t}),ec.toast.success(l("git.stashApplied")),await n()}catch(e){ec.toast.error(e instanceof Error?e.message:String(e))}finally{f(null)}},N=async t=>{f(t);try{await (0,ef.gitAction)(e,"stash-drop",{index:t}),ec.toast.success(l("git.stashDropped")),await n()}catch(e){ec.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)(M.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,t.jsx)(z.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)(H.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(ep.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)(ep.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)(H.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eg.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)(T.Trash2,{className:"h-3 w-3"})})]})]},e.index))})]})]}):null}function eb({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,E]=(0,s.useState)(!1),[D,I]=(0,s.useState)(e.name),[L,R]=(0,s.useState)(e.alias??""),[F,O]=(0,s.useState)(e.description??""),[$,A]=(0,s.useState)(e.localPath??""),[J,Z]=(0,s.useState)(e.projectType??"FRONTEND"),[eu,ep]=(0,s.useState)([]);(0,s.useEffect)(()=>{ea(100).then(ep)},[]);let[eg,ef]=(0,s.useState)(!1),[ev,ek]=(0,s.useState)(""),[ey,ew]=(0,s.useState)(""),[eC,eS]=(0,s.useState)(""),[eP,eT]=(0,s.useState)(""),[eE,eD]=(0,s.useState)("FRONTEND"),[eI,eL]=(0,s.useState)(!1),[eB,eR]=(0,s.useState)(!1),[eF,eO]=(0,s.useState)(null),[e$,eA]=(0,s.useState)(!1),[eM,ez]=(0,s.useState)(!1),[eU,eG]=(0,s.useState)(!1),eW=e=>{ec.toast.info(e)},e_=(0,s.useCallback)(async()=>{if(e.localPath){eA(!0);try{let t=await fetch(`/api/git?path=${encodeURIComponent(e.localPath)}`);t.ok&&eO(await t.json())}catch{}finally{eA(!1)}}},[e.localPath]);(0,s.useEffect)(()=>{e_()},[e_]);let eV=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?(eW(n("git.initSuccess")),await e_()):eW(n("git.initFailed"))}catch{eW(n("git.initFailed"))}finally{ez(!1)}}},eH=async t=>{if(e.localPath)try{let s=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"checkout",path:e.localPath,branch:t})});if(s.ok)eW(`${n("git.switchSuccess")} ${t}`),await e_();else{let e=await s.json();eW(`${n("git.switchFailed")}: ${e.error}`)}}catch{eW(n("git.switchFailed"))}},eK=(e,t)=>{i.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1}),i.refresh()},eJ=async()=>{if(ey.trim()){eL(!0);try{let e=await (0,et.createProject)({name:ey.trim(),alias:eC.trim()||void 0,description:eP.trim()||void 0,localPath:ev,projectType:eE,workspaceId:r});ef(!1),eK(r,e.id)}catch(e){ec.toast.error(e instanceof Error?e.message:String(e))}finally{eL(!1)}}},eY=async()=>{if($&&!eB){eR(!0);try{let e=await (0,eo.analyzeProjectDirectory)($.trim(),l);O(e)}catch{ec.toast.error(n("project.analyzeError"))}finally{eR(!1)}}},eq=async()=>{try{await ee(e.id,{name:D.trim(),alias:L.trim()||void 0,description:F.trim()||void 0,localPath:$.trim()||void 0,projectType:J}),i.refresh(),f(!1)}catch(e){ec.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:()=>{I(e.name),R(e.alias??""),O(e.description??""),A(e.localPath??""),f(!0)},className:"text-muted-foreground",children:(0,t.jsx)(P.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)(T.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)(G.FileText,{className:"h-3 w-3"}),n("sidebar.right.normalType")]})})}),e.localPath&&(0,t.jsxs)("div",{className:"mt-3 flex items-start gap-2 rounded-md bg-muted/50 px-2.5 py-2 text-xs",children:[(0,t.jsx)(W.FolderOpen,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"break-all font-mono text-secondary-foreground",children:e.localPath})]}),e.gitUrl&&(0,t.jsxs)("div",{className:"mt-2 flex items-start gap-2 rounded-md bg-muted/50 px-2.5 py-2 text-xs",children:[(0,t.jsx)(U.Globe,{className:"mt-0.5 h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"break-all text-secondary-foreground",children:e.gitUrl})]}),e.localPath&&(0,t.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)(h.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,en.openInFileManager)(e.localPath)}catch(e){console.error("openInFileManager failed:",e),ec.toast.error(n("git.openInFileManagerFailed"))}},children:[(0,t.jsx)(Y.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),n("git.openInFileManager")]}),(0,t.jsxs)(h.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,el.openInEditor)(e.localPath)}catch(e){console.error("openInEditor failed:",e),ec.toast.error(n("git.openInEditorFailed"))}},children:[(0,t.jsx)(q.Code,{className:"h-3.5 w-3.5 shrink-0"}),n("git.openInEditor")]}),(0,t.jsxs)(h.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,ei.openInTerminal)(e.localPath)}catch(e){console.error("openInTerminal failed:",e),ec.toast.error(n("git.openInTerminalFailed"))}},children:[(0,t.jsx)(X.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),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 er(e.id);i.push(`/workspaces/${r}/tasks/${t}`)}catch{ec.toast.error(n("git.openStudioFailed"))}finally{C(!1)}},children:[w?(0,t.jsx)(H.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(W.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)(M.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(z.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),c&&(0,t.jsx)("div",{className:"mt-3",children:e.localPath?e$?(0,t.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,t.jsx)(H.Loader2,{className:"h-4 w-4 animate-spin"}),(0,t.jsx)("span",{className:"ml-2 text-xs",children:n("git.loading")})]}):eF&&!eF.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)(V.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:eV,disabled:eM,children:[eM?(0,t.jsx)(H.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(_,{className:"h-3 w-3"}),n("git.initRepo")]})]}):eF?.isGit?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)(eN,{localBranches:eF.branches??[],remoteBranches:(eF.remoteBranches??[]).filter(e=>!eF.branches?.includes(e)),currentBranch:eF.currentBranch??"",onSwitch:eH,onFetch:async()=>{e.localPath&&(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"fetch",path:e.localPath})}),await e_())},onCreateBranch:()=>eG(!0)}),(0,t.jsx)(eh,{commits:eF.commits??[]}),(0,t.jsx)(ej,{localPath:e.localPath,stashes:eF.stashes??[],hasChanges:(eF.changedFiles??[]).length>0,onRefresh:e_})]}):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)(V.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)(M.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(z.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:()=>E(!0),children:[(0,t.jsx)(W.FolderOpen,{className:"h-3.5 w-3.5"}),n("sidebar.right.browseRepo")]}),eu.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:eu.map(s=>(0,t.jsxs)("button",{onClick:()=>{s.id!==e.id&&eK(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)(W.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)(B.Dialog,{open:g,onOpenChange:f,children:(0,t.jsxs)(B.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(B.DialogHeader,{children:(0,t.jsx)(B.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:D,onChange:e=>I(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)(em.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:J,onChange:Z})})]}),(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:L,onChange:e=>R(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:eY,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!$||eB?"opacity-50":""}`,children:[eB?(0,t.jsx)(H.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(K.Sparkles,{className:"h-3 w-3"}),eB?n("project.analyzing"):n("project.genDesc")]})]}),(0,t.jsx)(Q.Textarea,{value:F,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.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(p.Input,{value:$,onChange:e=>A(e.target.value),placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>E(!0),className:"h-8 shrink-0",children:n("folder.browse")})]})]})]}),(0,t.jsxs)(B.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>f(!1),children:n("common.cancel")}),(0,t.jsx)(h.Button,{onClick:eq,disabled:!D.trim()||eB,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("common.save")})]})]})}),(0,t.jsx)(ed.FolderBrowserDialog,{open:S,onOpenChange:E,onSelect:e=>{g?A(e):(e=>{let t=eu.find(t=>t.localPath===e);if(t)return eK(t.workspaceId,t.id);let s=e.split("/").filter(Boolean).pop()??"";ek(e),ew(s),eS(""),eT(""),ef(!0)})(e)}}),(0,t.jsx)(B.Dialog,{open:eg,onOpenChange:ef,children:(0,t.jsxs)(B.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(B.DialogHeader,{children:(0,t.jsx)(B.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)(em.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:eE,onChange:eD})})]}),(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)(Q.Textarea,{value:eP,onChange:e=>eT(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)(B.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>ef(!1),children:n("common.cancel")}),(0,t.jsxs)(h.Button,{onClick:eJ,disabled:!ey.trim()||eI,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[eI?(0,t.jsx)(H.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,n("common.create")]})]})]})}),eF?.isGit&&(0,t.jsx)(ex.CreateBranchDialog,{open:eU,onOpenChange:eG,branches:eF.branches??[],currentBranch:eF.currentBranch??"",localPath:e.localPath,onCreated:async()=>{await e_(),eW(n("git.createSuccess"))},onError:e=>eW(`${n("git.createFailed")}: ${e}`)}),(0,t.jsx)(B.Dialog,{open:j,onOpenChange:e=>{b(e),e||v("")},children:(0,t.jsxs)(B.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(B.DialogHeader,{children:(0,t.jsx)(B.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)(B.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 es(e.id),ec.toast.success(n("project.deleteSuccess")),i.push(`/workspaces/${r}`)}catch{ec.toast.error(n("project.deleteFailed"))}finally{y(!1),b(!1)}},children:[k&&(0,t.jsx)(H.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),n("project.deleteButton")]})]})]})})]})}function eN({localBranches:e,remoteBranches:a,currentBranch:r,onSwitch:n,onFetch:l,onCreateBranch:i}){let{t:c}=(0,o.useI18n)(),[d,p]=(0,s.useState)(!1),[g,f]=(0,s.useState)(""),[j,N]=(0,s.useState)(!1),v=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(d)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){v.current&&!v.current.contains(e.target)&&p(!1)}},[d]);let k=g.toLowerCase(),y=e.filter(e=>e.toLowerCase().includes(k)),w=a.filter(e=>e.toLowerCase().includes(k)),C=y.length>0||w.length>0,S=async()=>{N(!0);try{await l()}finally{N(!1)}};return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:c("git.currentBranch")}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:S,disabled:j,className:"text-muted-foreground","aria-label":"Fetch",children:(0,t.jsx)(J.RefreshCw,{className:`h-3 w-3 ${j?"animate-spin":""}`})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground","aria-label":c("git.createBranch"),children:(0,t.jsx)(m.Plus,{className:"h-3 w-3"})})]})]}),(0,t.jsxs)("div",{className:"relative",ref:v,children:[(0,t.jsxs)("button",{onClick:()=>{p(!d),f("")},className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,t.jsx)(u.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:r||void 0,children:r||"—"})]}),(0,t.jsx)(M.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${d?"rotate-180":""}`})]}),d&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(x.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:g,onChange:e=>f(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-60 overflow-auto py-1",children:[!C&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"}),y.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"px-3 pt-1.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:c("git.localBranches")}),y.map(e=>{let s=e===r;return(0,t.jsxs)("button",{onClick:()=>{s||n(e),p(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(u.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(b.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)})]}),w.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"px-3 pt-2.5 pb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:c("git.remoteBranches")}),w.map(e=>(0,t.jsxs)("button",{onClick:()=>{n(e),p(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(U.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`))]})]})]})]})]})}var ev=e.i(475958),ek=e.i(313029),ey=e.i(301348),ew=e.i(746798),eC=e.i(259846),eS=e.i(975157);function eP({title:e,description:s,branch:a,baseBranch:r,hasConversation:n,updatedAt:l,onBack:i}){let{t:c}=(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)(K.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-primary",children:c("taskDetail.title")})]}),(0,t.jsxs)(h.Button,{variant:"ghost",onClick:i,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)(eC.ArrowLeft,{className:"h-3.5 w-3.5"}),c("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)(D.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)(D.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:c("taskDetail.directMode")}):null,n&&(0,t.jsx)(D.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:c("taskDetail.hasConversation")}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[c("taskDetail.updatedAt")," ",(0,eS.formatRelativeTime)(l)]})]})]})}var eT=e.i(14842),eE=e.i(865514),eD=e.i(83434),eI=e.i(992238),eL=e.i(294980),eB=e.i(3362),eR=e.i(429416),eF=e.i(317248),eO=e.i(848466),e$=e.i(150133),eA=e.i(656985),eM=e.i(351909),ez=e.i(326883),eU=e.i(631675);let eG=(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 eW=e.i(657153),e_=e.i(954777);let eV=(0,Z.createServerReference)("401596434c549b95410f2ab34f1bd9df4db714c92b",Z.callServer,void 0,Z.findSourceMapURL,"getTaskNotes");var eH=e.i(555989);let eK=(0,Z.createServerReference)("400bc8fbab7c5d6dd9cdee33d2c692993b9042a98d",Z.callServer,void 0,Z.findSourceMapURL,"getTaskAssets");var eJ=e.i(155959),eY=e.i(159925);function eq({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);async function v(){p.trim()&&(await (0,e_.createNote)({title:p.trim(),content:f.trim(),projectId:a,taskId:e,category:"task"}),g(""),j(""),u(!1),eV(e).then(i))}async function k(e){await (0,eH.deleteNote)(e),i(t=>t.filter(t=>t.id!==e))}async function y(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,eJ.uploadAsset)(t),eK(e).then(d)}finally{N(!1),n.current&&(n.current.value="")}}}async function w(e){await (0,eY.deleteAsset)(e),d(t=>t.filter(t=>t.id!==e))}return(0,s.useEffect)(()=>{eV(e).then(i),eK(e).then(d)},[e]),(0,t.jsx)(R.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)(G.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)(eW.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:v,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:()=>k(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)(T.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)(eG,{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)(eU.Upload,{className:"h-3 w-3"}),r("taskPage.uploadFile")]}),(0,t.jsx)("input",{ref:n,type:"file",className:"hidden",onChange:y})]}),(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;return(0,t.jsxs)("div",{className:"group flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,t.jsx)(eG,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm",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.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.deleteAttachment"),children:(0,t.jsx)(T.Trash2,{className:"h-3 w-3"})})]},e.id)})]})]})]})})}function eX({task:e,workspaceId:r,projectLocalPath:n,onClose:l}){let{t:i}=(0,o.useI18n)(),c=(0,a.useRouter)(),{removePortal:d}=(0,eD.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),[P,T]=(0,s.useState)([]);(0,s.useEffect)(()=>{k(null),w(!1),S(!1),T([]),p(null),x("terminal")},[e.id]);let[E,D]=(0,s.useState)([]),[I,L]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=!1;return(0,eM.getPrompts)().then(t=>{if(e)return;D(t.map(e=>({id:e.id,name:e.name,isDefault:e.isDefault})));let s=t.find(e=>e.isDefault);s&&L(s.id)}),()=>{e=!0}},[]),(0,s.useEffect)(()=>{k(null),S(!1);let t=!1;return(0,eI.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)}T(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 B=(0,s.useCallback)(async()=>{if(!y){w(!0),d(e.id);try{let{worktreePath:t}=await (0,eL.startPtyExecution)(e.id,"",I);k(t),N("IN_PROGRESS")}catch(e){w(!1),ec.toast.error(e instanceof Error?e.message:String(e))}}},[e.id,y,I]),F=(0,s.useCallback)(t=>{w(!1),k(null),d(e.id),0===t&&N("IN_REVIEW"),(0,eI.getTaskExecutions)(e.id).then(e=>{T(e.filter(e=>"RUNNING"!==e.status))}),c.refresh()},[c,e.id]),O=(0,s.useCallback)(async()=>{await (0,eB.stopPtyExecution)(e.id),w(!1),d(e.id),k(null),N("IN_REVIEW"),(0,eI.getTaskExecutions)(e.id).then(e=>{T(e.filter(e=>"RUNNING"!==e.status))}),c.refresh()},[e.id,c]),$=(0,s.useCallback)(async t=>{w(!0),d(e.id),k(null);try{let{worktreePath:s}=await (0,eR.resumePtyExecution)(e.id,t);k(s),N("IN_PROGRESS")}catch{w(!1)}},[e.id,d]),A=(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),ec.toast.error(e instanceof Error?e.message:String(e))}},[e.id,d]),[M,z]=(0,s.useState)(!1),[U,W]=(0,s.useState)([]),_=(0,s.useCallback)(async()=>{try{let t=await (0,e$.checkWorktreeClean)(e.id);if(t.hasWorktree&&!t.clean)return void ec.toast.error(i("taskPage.uncommittedChanges",{count:String(t.files.length)}));if(t.hasWorktree&&t.clean&&!t.hasCommits)return void ec.toast.error(i("taskPage.noChangesToComplete"),{action:{label:i("taskPage.markAsCancelled"),onClick:()=>{(0,eO.updateTaskStatus)(e.id,"CANCELLED").then(()=>{N("CANCELLED"),ec.toast.success(i("taskPage.taskCancelled")),c.refresh()}).catch(()=>ec.toast.error("Failed to cancel task"))}}});if(t.hasWorktree&&t.hasCommits){W(t.commitLog),z(!0);return}await (0,eO.updateTaskStatus)(e.id,"DONE"),N("DONE"),ec.toast.success(i("taskPage.taskCompleted")),c.refresh()}catch{ec.toast.error("Failed to complete task")}},[e.id,c,i]),V=(0,s.useCallback)(()=>{N("DONE"),z(!1),ec.toast.success(i("taskPage.taskCompleted")),c.refresh()},[c,i]),K=(0,s.useCallback)(async t=>{try{let{hash:s}=await (0,eA.commitWorktreeChanges)(e.id,t);ec.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){ec.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)(eP,{title:e.title,description:i("taskDetail.panelDescription"),branch:`task/${e.id}`,baseBranch:e.baseBranch,hasConversation:!1,updatedAt:e.updatedAt,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)(G.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)(ew.Tooltip,{children:[(0,t.jsxs)(ew.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)(ew.TooltipContent,{side:"bottom",children:i("terminal.stopHint")})]})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:(0,t.jsx)(eD.TerminalOutlet,{taskId:e.id,worktreePath:v,onSessionEnd:F})})]}):"DONE"===b||"CANCELLED"===b?(0,t.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,t.jsx)(R.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)(ez.ExecutionTimeline,{executions:P})})}):(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:[E.length>0&&(0,t.jsxs)(g.Select,{defaultValue:I??"none",onValueChange:e=>L("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:I?E.find(e=>e.id===I)?.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")}),E.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.isDefault?" ★":""]},e.id))]})]},`prompt-${E.length}`),(0,t.jsxs)(h.Button,{onClick:B,disabled:y,size:"sm",className:"gap-2 px-4",children:[y?(0,t.jsx)(H.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)(R.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)(ez.ExecutionTimeline,{executions:P,onResume:$,onContinueLatest:A})})]}):(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,t.jsx)(H.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:K,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)(eq,{taskId:e.id,projectId:e.projectId})}):null,(0,t.jsx)(eE.TaskMergeConfirmDialog,{open:M,onOpenChange:z,taskId:e.id,taskTitle:e.title,baseBranch:e.baseBranch??"main",fileCount:u?.files?.length??0,commitCount:u?.commitCount??0,commitLog:U,onMergeComplete:V})]})}var eQ=e.i(392239),eZ=e.i(541212);let e0=(0,Z.createServerReference)("40a176f62e3cd9394f472e0ba90da46e1f57b3828e",Z.callServer,void 0,Z.findSourceMapURL,"deleteTask"),e1=(0,Z.createServerReference)("40639b056920aaa0244d82b61a348fd8481650fba4",Z.callServer,void 0,Z.findSourceMapURL,"toggleTaskPinned"),e3=(0,Z.createServerReference)("4086ff4188ba5d2a2837028e868b13c62963d93529",Z.callServer,void 0,Z.findSourceMapURL,"getVersionsForPicker");var e5=e.i(19671);function e2({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)(e5.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)(z.ChevronRight,{className:"h-4 w-4"})})]})}var e4=e.i(759686);function e8({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)(B.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(B.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(B.DialogHeader,{children:(0,t.jsxs)(B.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(e4.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)(B.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)(e4.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),[P,T]=(0,s.useState)([]),E=C?i.find(e=>e.id===C)??null:null,[D,I]=(0,s.useState)(null),[L,B]=(0,s.useState)(null),[R,F]=(0,s.useState)(null);(0,s.useEffect)(()=>{e3(r).then(T).catch(()=>T([]))},[r]);let O=P.find(e=>e.isCurrent)?.id??null,M=(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 z=(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,e$.checkWorktreeClean)(e);if(s.hasWorktree&&!s.clean){ec.toast.error(u("taskPage.uncommittedChanges",{count:String(s.files.length)})),M();return}if(s.hasWorktree&&s.clean&&!s.hasCommits){ec.toast.error(u("taskPage.noChangesToComplete"),{action:{label:u("taskPage.markAsCancelled"),onClick:()=>{(0,eO.updateTaskStatus)(e,"CANCELLED").then(()=>{ec.toast.success(u("taskPage.taskCancelled")),M()}).catch(()=>ec.toast.error("Failed to cancel task"))}}}),M();return}if(s.hasWorktree&&s.hasCommits){B({task:t,commitLog:s.commitLog,commitCount:s.commitLog.length}),M();return}await (0,eO.updateTaskStatus)(e,"DONE"),ec.toast.success(u("taskPage.taskCompleted")),M()}catch{ec.toast.error("Failed to complete task"),M()}},[i,M,u]),G=(0,s.useCallback)(async e=>{let t=i.find(t=>t.id===e);if(t)try{let s=await (0,e$.checkWorktreeClean)(e);if(!s.hasWorktree){await (0,eO.updateTaskStatus)(e,"CANCELLED"),ec.toast.success(u("taskPage.taskCancelled")),M();return}F({task:t,files:s.files,commitLog:s.commitLog}),M()}catch{ec.toast.error("Failed to cancel task"),M()}},[i,M,u]),W=(0,s.useCallback)(async(e,t)=>{"DONE"===t?await U(e):"CANCELLED"===t?await G(e):(await (0,eO.updateTaskStatus)(e,t),M())},[M,U,G]),_=(0,s.useCallback)(async t=>{let s=await (0,eQ.createTask)({title:t.title,description:t.description,projectId:r,priority:t.priority,status:t.status,labelIds:t.labelIds,baseBranch:t.baseBranch,subPath:t.subPath,versionId:t.versionId??void 0});if(M(),t.autoStart&&s?.id)try{await (0,eL.startPtyExecution)(s.id,""),x.push(`/workspaces/${e}/tasks/${s.id}`)}catch(e){ec.toast.error(e instanceof Error?e.message:String(e))}},[r,M,x,e]),V=(0,s.useCallback)(async(e,t)=>{await (0,eZ.updateTask)(e,{...t,labelIds:t.labelIds}),I(null),M()},[M]),H=(0,s.useCallback)(async e=>{await e0(e),C===e&&S(null),M()},[M,C]),K=(0,s.useCallback)(async e=>{await e1(e),M()},[M]),J=(0,s.useCallback)(async t=>{try{await (0,eL.startPtyExecution)(t,"")}catch(e){ec.toast.error(e instanceof Error?e.message:String(e))}x.push(`/workspaces/${e}/tasks/${t}`)},[x,e]),Y=(0,s.useCallback)(async(e,t)=>{"DONE"===t?await U(e):"CANCELLED"===t?await G(e):(await (0,eO.updateTaskStatus)(e,t),M())},[M,U,G]),q=(0,s.useCallback)(e=>{w(e),I(null),k(!0)},[]),X=(0,s.useCallback)(e=>{I(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)(e2,{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:z,versions:P,versionFilter:j,onVersionFilterChange:b,versionsHref:`/workspaces/${e}/projects/${r}/versions`,onCreateTask:()=>{I(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:q,onDeleteTask:H,onTogglePin:K,workspaceId:e,onContextMenuStatusChange:Y,onContextMenuLaunch:J})}),(0,t.jsx)(A.CreateTaskDialog,{open:v,onOpenChange:e=>{k(e),e||I(null)},onSubmit:_,onUpdate:V,defaultStatus:y,editTask:D,editTaskLabelIds:D?.labels?D.labels.map(e=>e.labelId):[],labels:d.filter(e=>!(e.name===N.TOWER_LABEL_NAME&&e.isBuiltin)),projectType:n.type,projectLocalPath:n.localPath,versions:P,defaultVersionId:O})]}),E?(0,t.jsx)(eX,{task:E,workspaceId:e,projectLocalPath:n.localPath,onClose:()=>S(null)}):(0,t.jsx)(eb,{project:n,workspaceId:e}),L&&(0,t.jsx)(eE.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),ec.toast.success(u("taskPage.taskCompleted")),M()}}),R&&(0,t.jsx)(e8,{open:!0,onOpenChange:e=>{e||F(null)},taskTitle:R.task.title,uncommittedFiles:R.files,commitLog:R.commitLog,onConfirm:()=>{let e=R.task.id;F(null),(0,eO.updateTaskStatus)(e,"CANCELLED").then(()=>{ec.toast.success(u("taskPage.taskCancelled")),M()}).catch(()=>ec.toast.error("Failed to cancel task"))}})]})}],783426)}]);