tower-studio 0.2.10 β†’ 0.2.12

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 (274) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/prerender-manifest.json +3 -3
  4. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
  12. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +43 -43
  13. package/.next/standalone/.next/server/app/_not-found/page.js +4 -3
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
  18. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  19. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  20. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  22. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  23. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  24. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/index.html +1 -1
  27. package/.next/standalone/.next/server/app/index.rsc +14 -14
  28. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  29. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
  30. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  31. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
  32. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  33. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  34. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +77 -77
  35. package/.next/standalone/.next/server/app/missions/page.js +4 -3
  36. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  38. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  39. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +43 -43
  40. package/.next/standalone/.next/server/app/onboarding/page.js +4 -3
  41. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  44. package/.next/standalone/.next/server/app/onboarding.rsc +16 -16
  45. package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  46. package/.next/standalone/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  47. package/.next/standalone/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  48. package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  49. package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  50. package/.next/standalone/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  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 +43 -43
  53. package/.next/standalone/.next/server/app/page.js +4 -3
  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/react-loadable-manifest.json +1 -1
  57. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +56 -56
  58. package/.next/standalone/.next/server/app/settings/page.js +4 -3
  59. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  60. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  61. package/.next/standalone/.next/server/app/settings.html +1 -1
  62. package/.next/standalone/.next/server/app/settings.rsc +16 -16
  63. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  64. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  65. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  66. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  67. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  68. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +94 -94
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +4 -3
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +72 -72
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +4 -3
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +69 -69
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +4 -3
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  85. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +72 -72
  86. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +4 -3
  87. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  90. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +43 -43
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +5 -4
  92. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  94. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  95. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +80 -80
  96. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +4 -3
  97. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  98. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +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 +90 -90
  101. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +4 -3
  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/react-loadable-manifest.json +1 -1
  105. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +55 -55
  106. package/.next/standalone/.next/server/app/workspaces/page.js +4 -3
  107. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  108. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  109. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
  110. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
  111. package/.next/standalone/.next/server/chunks/[root-of-the-server]__028ucbo._.js +2 -2
  112. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03gi3ue._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07f7~6u._.js +2 -2
  114. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d~z6xs._.js +2 -2
  115. package/.next/standalone/.next/server/chunks/_0_w835g._.js +2 -2
  116. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  117. package/.next/standalone/.next/server/chunks/src_lib_0ba0ntr._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/src_lib_ai_0q-~me1._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  122. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-gtzf3._.js +30 -0
  123. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0047xda._.js +30 -0
  124. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03ebsif._.js +3 -3
  125. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03fx0ja._.js +30 -0
  126. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09vrijh._.js +3 -0
  127. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kzp4-y._.js β†’ [root-of-the-server]__0a6h8gd._.js} +2 -2
  128. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00qhe2l._.js β†’ [root-of-the-server]__0akzln5._.js} +2 -2
  129. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0bpfp11._.js +30 -0
  130. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0di.lno._.js +3 -0
  131. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e.z.70._.js +30 -0
  132. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0eu0ho5._.js +30 -0
  133. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h3qzpw._.js +30 -0
  134. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hi0yzd._.js +3 -0
  135. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__02px.0y._.js β†’ [root-of-the-server]__0hwl8ew._.js} +2 -2
  136. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0zbmoit._.js β†’ [root-of-the-server]__0i1yr6p._.js} +2 -2
  137. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0iy-id0._.js +4 -0
  138. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k9v1jm._.js +30 -0
  139. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__11t.nhs._.js β†’ [root-of-the-server]__0lipl.6._.js} +2 -2
  140. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0m1rkbb._.js +30 -0
  141. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kgp2xy._.js β†’ [root-of-the-server]__0myrdxo._.js} +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n78kqj._.js +30 -0
  143. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ps55l6._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ribsk4._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rifydx._.js +3 -0
  146. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0sb.sz3._.js +30 -0
  147. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tq_14j._.js +30 -0
  148. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wjg_.n._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wvyks.._.js +1 -1
  150. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zb9q4h._.js +3 -0
  151. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10.y4wq._.js +3 -0
  152. package/.next/standalone/.next/server/chunks/ssr/_0._ejth._.js +3 -0
  153. package/.next/standalone/.next/server/chunks/ssr/{_0niubv5._.js β†’ _0.obv1p._.js} +1 -1
  154. package/.next/standalone/.next/server/chunks/ssr/{_0am8~b4._.js β†’ _003qoge._.js} +2 -2
  155. package/.next/standalone/.next/server/chunks/ssr/{_0dvj0e.._.js β†’ _008q_0v._.js} +2 -2
  156. package/.next/standalone/.next/server/chunks/ssr/_05h.8a~._.js +1 -1
  157. package/.next/standalone/.next/server/chunks/ssr/{_13xqr7_._.js β†’ _07ax4.m._.js} +2 -2
  158. package/.next/standalone/.next/server/chunks/ssr/{_0zgu282._.js β†’ _0_f2g9z._.js} +1 -1
  159. package/.next/standalone/.next/server/chunks/ssr/_0_l8.dg._.js +1 -1
  160. package/.next/standalone/.next/server/chunks/ssr/{_0c-49y3._.js β†’ _0bowgha._.js} +1 -1
  161. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  162. package/.next/standalone/.next/server/chunks/ssr/{_03ae9ko._.js β†’ _0dig3de._.js} +3 -3
  163. package/.next/standalone/.next/server/chunks/ssr/_0f6qjbg._.js +3 -0
  164. package/.next/standalone/.next/server/chunks/ssr/{_028bxro._.js β†’ _0h8g7_g._.js} +2 -2
  165. package/.next/standalone/.next/server/chunks/ssr/_0i4__mf._.js +1 -1
  166. package/.next/standalone/.next/server/chunks/ssr/{_0dr-c0.._.js β†’ _0l4wi9q._.js} +3 -3
  167. package/.next/standalone/.next/server/chunks/ssr/{_0jymo4.._.js β†’ _0m5sihc._.js} +2 -2
  168. package/.next/standalone/.next/server/chunks/ssr/_0miyz-f._.js +3 -0
  169. package/.next/standalone/.next/server/chunks/ssr/{_0t9cbox._.js β†’ _0p0-eyg._.js} +2 -2
  170. package/.next/standalone/.next/server/chunks/ssr/{_0_q~7z7._.js β†’ _0qzkt..._.js} +1 -1
  171. package/.next/standalone/.next/server/chunks/ssr/{_0ik626t._.js β†’ _0t4lzoj._.js} +3 -3
  172. package/.next/standalone/.next/server/chunks/ssr/{_0quq3z2._.js β†’ _0td~e1-._.js} +2 -2
  173. package/.next/standalone/.next/server/chunks/ssr/{_0ssha_7._.js β†’ _0vcf0-e._.js} +2 -2
  174. package/.next/standalone/.next/server/chunks/ssr/_0vk31-9._.js +3 -0
  175. package/.next/standalone/.next/server/chunks/ssr/{_0y-7tle._.js β†’ _0wdm870._.js} +1 -1
  176. package/.next/standalone/.next/server/chunks/ssr/_0xtk7wi._.js +3 -0
  177. package/.next/standalone/.next/server/chunks/ssr/_0~80adm._.js +3 -3
  178. package/.next/standalone/.next/server/chunks/ssr/_0~a80th._.js +3 -0
  179. package/.next/standalone/.next/server/chunks/ssr/{_0rbai5c._.js β†’ _109h4z-._.js} +1 -1
  180. package/.next/standalone/.next/server/chunks/ssr/{_0zszi6-._.js β†’ _13duqz7._.js} +1 -1
  181. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  182. package/.next/standalone/.next/server/chunks/ssr/src_13jha60._.js +1 -1
  183. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  184. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  185. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  186. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  187. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  189. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  191. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0.qra8k._.js β†’ src_lib_0.8j.z6._.js} +1 -1
  192. package/.next/standalone/.next/server/chunks/ssr/{src_lib_05il5a6._.js β†’ src_lib_02v1~f3._.js} +1 -1
  193. package/.next/standalone/.next/server/chunks/ssr/{src_lib_06uhm3j._.js β†’ src_lib_05~z630._.js} +1 -1
  194. package/.next/standalone/.next/server/chunks/ssr/{src_lib_07rspg0._.js β†’ src_lib_061yy7e._.js} +1 -1
  195. package/.next/standalone/.next/server/chunks/ssr/src_lib_09uekh_._.js +3 -0
  196. package/.next/standalone/.next/server/chunks/ssr/src_lib_09y4fnl._.js +3 -0
  197. package/.next/standalone/.next/server/chunks/ssr/src_lib_0a7f32~._.js +3 -0
  198. package/.next/standalone/.next/server/chunks/ssr/src_lib_0aeqb5m._.js +3 -0
  199. package/.next/standalone/.next/server/chunks/ssr/src_lib_0p183eh._.js +3 -0
  200. package/.next/standalone/.next/server/chunks/ssr/src_lib_0uyb_-k._.js +3 -0
  201. package/.next/standalone/.next/server/chunks/ssr/src_lib_0vhhwfe._.js +3 -0
  202. package/.next/standalone/.next/server/chunks/ssr/src_lib_10i7f.9._.js +3 -0
  203. package/.next/standalone/.next/server/chunks/ssr/src_lib_137bst6._.js +3 -0
  204. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  205. package/.next/standalone/.next/server/pages/404.html +1 -1
  206. package/.next/standalone/.next/server/pages/500.html +1 -1
  207. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  208. package/.next/standalone/.next/server/server-reference-manifest.json +319 -319
  209. package/.next/standalone/.next/static/chunks/{08czwnyn-yb6h.js β†’ 010xl0lpp55xe.js} +1 -1
  210. package/.next/standalone/.next/static/chunks/{0v~wcz2xuu3p-.js β†’ 01e93lnruej42.js} +1 -1
  211. package/.next/standalone/.next/static/chunks/022_88ef~e93a.js +1 -0
  212. package/.next/standalone/.next/static/chunks/{057-vm1159y01.js β†’ 0azh0__hpbe-z.js} +1 -1
  213. package/.next/standalone/.next/static/chunks/{0.ofi_xek10ly.js β†’ 0cg0zjodapp79.js} +1 -1
  214. package/.next/standalone/.next/static/chunks/{0e01jd~5_f9y~.js β†’ 0eqr_08akp8xl.js} +1 -1
  215. package/.next/standalone/.next/static/chunks/{14-ne07fdt5gd.js β†’ 0f820g2c4omlb.js} +2 -2
  216. package/.next/standalone/.next/static/chunks/0h3-~sna4okq2.js +1 -0
  217. package/.next/standalone/.next/static/chunks/{0p2790ex-.bs1.js β†’ 0khynh_kl0aog.js} +1 -1
  218. package/.next/standalone/.next/static/chunks/{0e1rsaypb1c8g.js β†’ 0ns9v_d.3s~uo.js} +1 -1
  219. package/.next/standalone/.next/static/chunks/{0pn91v~~ax-2i.js β†’ 0q4az7r-d-n~g.js} +1 -1
  220. package/.next/standalone/.next/static/chunks/{0g5lbqhmhs1om.js β†’ 0rgyeuy~3vua-.js} +1 -1
  221. package/.next/standalone/.next/static/chunks/0s.g.dge529_6.js +1 -0
  222. package/.next/standalone/.next/static/chunks/{0xkogzb0hkmv2.js β†’ 0sgaa06_07.8u.js} +2 -2
  223. package/.next/standalone/.next/static/chunks/{0naw4k2t-iitk.js β†’ 0uepevftf8c0j.js} +2 -2
  224. package/.next/standalone/.next/static/chunks/{0esxrl_jbzhq0.js β†’ 0v-7eievh_rkh.js} +2 -2
  225. package/.next/standalone/.next/static/chunks/{0ffqq7c8_0euc.js β†’ 0w0vkomv~5a72.js} +1 -1
  226. package/.next/standalone/.next/static/chunks/{0dzfcafnnd9ar.js β†’ 0xk7u4vr-rwn8.js} +1 -1
  227. package/.next/standalone/.next/static/chunks/0xrh8~725gqdt.js +1 -0
  228. package/.next/standalone/.next/static/chunks/0zxdsce2j9r4a.js +2 -0
  229. package/.next/standalone/.next/static/chunks/14630b661zu3g.js +1 -0
  230. package/.next/standalone/package.json +1 -1
  231. package/dist/mcp-server.cjs +18 -6
  232. package/package.json +1 -1
  233. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.ukame._.js +0 -30
  234. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__006_qh0._.js +0 -3
  235. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01j8ix6._.js +0 -30
  236. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ca_ueb._.js +0 -30
  237. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dsdplu._.js +0 -30
  238. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l43.5g._.js +0 -4
  239. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n.cuy2._.js +0 -30
  240. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nbj.ml._.js +0 -30
  241. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ojv-d0._.js +0 -3
  242. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pm2~fu._.js +0 -30
  243. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rjue04._.js +0 -30
  244. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0souuv~._.js +0 -3
  245. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tc6uh2._.js +0 -30
  246. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0v2eslh._.js +0 -30
  247. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wlmzzq._.js +0 -30
  248. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~03tpv._.js +0 -3
  249. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~a-emb._.js +0 -30
  250. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vdw4w._.js +0 -3
  251. package/.next/standalone/.next/server/chunks/ssr/_04b71ua._.js +0 -3
  252. package/.next/standalone/.next/server/chunks/ssr/_0ds6nk2._.js +0 -3
  253. package/.next/standalone/.next/server/chunks/ssr/_0ihq._v._.js +0 -3
  254. package/.next/standalone/.next/server/chunks/ssr/_0r9w-k8._.js +0 -3
  255. package/.next/standalone/.next/server/chunks/ssr/_0rbctq7._.js +0 -3
  256. package/.next/standalone/.next/server/chunks/ssr/_0rt8hus._.js +0 -3
  257. package/.next/standalone/.next/server/chunks/ssr/src_lib_0_8frs_._.js +0 -3
  258. package/.next/standalone/.next/server/chunks/ssr/src_lib_0cwd~e-._.js +0 -3
  259. package/.next/standalone/.next/server/chunks/ssr/src_lib_0fjk3hr._.js +0 -3
  260. package/.next/standalone/.next/server/chunks/ssr/src_lib_0g-92s-._.js +0 -3
  261. package/.next/standalone/.next/server/chunks/ssr/src_lib_0ss_gux._.js +0 -3
  262. package/.next/standalone/.next/server/chunks/ssr/src_lib_0trkgq-._.js +0 -3
  263. package/.next/standalone/.next/server/chunks/ssr/src_lib_0yvo_x7._.js +0 -3
  264. package/.next/standalone/.next/server/chunks/ssr/src_lib_11c8k4w._.js +0 -3
  265. package/.next/standalone/.next/server/chunks/ssr/src_lib_12xkd9s._.js +0 -3
  266. package/.next/standalone/.next/static/chunks/0g1~.f9jqo3nd.js +0 -2
  267. package/.next/standalone/.next/static/chunks/0iv0ao0keotf6.js +0 -1
  268. package/.next/standalone/.next/static/chunks/0o__.a9lpdowg.js +0 -1
  269. package/.next/standalone/.next/static/chunks/0p2hpp_l5b.g3.js +0 -1
  270. package/.next/standalone/.next/static/chunks/0p3inhs_w7v5v.js +0 -1
  271. package/.next/standalone/.next/static/chunks/0tpzfueusr2~a.js +0 -1
  272. /package/.next/standalone/.next/static/{Y2nibY8eWLcXL1azqa_Q9 β†’ U-HwmuCE_TgwA_Rd4SjpZ}/_buildManifest.js +0 -0
  273. /package/.next/standalone/.next/static/{Y2nibY8eWLcXL1azqa_Q9 β†’ U-HwmuCE_TgwA_Rd4SjpZ}/_clientMiddlewareManifest.js +0 -0
  274. /package/.next/standalone/.next/static/{Y2nibY8eWLcXL1azqa_Q9 β†’ U-HwmuCE_TgwA_Rd4SjpZ}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,559340,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40dd7b0d3eb5d3ee6b528c5365e113944513147a8f",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,s])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:r,description:i,action:n,className:a}){return(0,t.jsxs)("div",{className:(0,s.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:r}),i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:i}),n&&(0,t.jsx)("div",{className:"mt-2",children:n})]})}])},487486,e=>{"use strict";var t=e.i(565455),s=e.i(581263),r=e.i(294237),i=e.i(975157);let n=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:a,...o}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(n({variant:r}),e)},o),render:a,state:{slot:"badge",variant:r}},(0,s.useRenderElement)(l.defaultTagName??"div",l,l)}],487486)},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)},448240,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("4020d8a1cc596687b55865e96796ae7cea4ed4a4e9",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,s])},462691,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c9341a3a3cf6165ee3bf3b385597af9647d530ff2",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,s])},875345,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60005e9e7d3726521e8eae7ec1df23df0995ae26a4",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,s])},704769,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("404eb9bea45eba613bbbd4379d33838f0f6c51db63",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,s])},169751,e=>{"use strict";function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}function s(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 r(e){return"string"==typeof e}function i(e){return"number"==typeof e}function n(e){return"object"==typeof e}function a(e){return null!=e}function o(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let c=Object.prototype.hasOwnProperty;class u{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let s=d(e);this._keys.push(s),this._keyMap[s.id]=s,t+=s.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 s=null,i=null,n=null,a=1,o=null;if(r(e)||t(e))n=e,s=h(e),i=m(e);else{if(!c.call(e,"name"))throw Error("Missing name property in key");let t=e.name;if(n=t,c.call(e,"weight")&&(a=e.weight)<=0)throw Error(`Property 'weight' in key '${t}' must be a positive integer`);s=h(t),i=m(t),o=e.getFn}return{path:s,id:i,weight:a,src:n,getFn:o}}function h(e){return t(e)?e:e.split(".")}function m(e){return t(e)?e.join("."):e}let f=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 c=[],u=!1,d=(e,o,h,m)=>{if(a(e))if(o[h]){var f,x;let g=e[o[h]];if(!a(g))return;if(h===o.length-1&&(r(g)||i(g)||!0===(f=g)||!1===f||n(x=f)&&null!==x&&"[object Boolean]"==l(f)||"bigint"==typeof g))c.push(void 0!==m?{v:s(g),i:m}:s(g));else if(t(g)){u=!0;for(let e=0,t=g.length;e<t;e+=1)d(g[e],o,h+1,e)}else o.length&&d(g,o,h+1,m)}else c.push(void 0!==m?{v:e,i:m}:e)};return d(e,r(o)?o.split("."):o,0),u?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}),x=/[^ ]+/g;class g{constructor({getFn:e=f.getFn,fieldNormWeight:t=f.fieldNormWeight}={}){this.norm=function(e=1,t=3){let s=new Map,r=Math.pow(10,t);return{get(t){let i=t.match(x).length;if(s.has(i))return s.get(i);let n=parseFloat(Math.round(1/Math.pow(i,.5*e)*r)/r);return s.set(i,n),n},clear(){s.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,r(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();r(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t<s;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 s={v:e,i:t,n:this.norm.get(e)};this.records.push(s)}_addObject(e,i){let n={i:i,$:{}};this.keys.forEach((i,l)=>{let c=i.getFn?i.getFn(e):this.getFn(e,i.path);if(a(c)){if(t(c)){let e=[];for(let t=0,i=c.length;t<i;t+=1){let i=c[t];if(a(i)){if(r(i)){if(!o(i)){let s={v:i,i:t,n:this.norm.get(i)};e.push(s)}}else if(a(i.v)){let t=r(i.v)?i.v:s(i.v);if(!o(t)){let s={v:t,i:i.i,n:this.norm.get(t)};e.push(s)}}}}n.$[l]=e}else if(r(c)&&!o(c)){let e={v:c,n:this.norm.get(c)};n.$[l]=e}}}),this.records.push(n)}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function p(e,t,{getFn:s=f.getFn,fieldNormWeight:r=f.fieldNormWeight}={}){let i=new g({getFn:s,fieldNormWeight:r});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 s=1,r=e.length;s<r;s+=1){let r=t[t.length-1],i=e[s];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}let b={Ε‚:"l",Ł:"L",Δ‘:"d",Đ:"D",ΓΈ:"o",Ø:"O",Δ§:"h",Δ¦:"H",Ε§:"t",Ε¦:"T",Δ±:"i",ß:"ss"},y=RegExp("["+Object.keys(b).join("")+"]","g"),C=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(y,e=>b[e]):e=>e;class k{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:c=f.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c},e=o?e:e.toLowerCase(),e=l?C(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 s=0,r=e.length;s<r;s+=1){let i=e.charAt(s);t[i]=(t[i]||0)|1<<r-s-1}return t}(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,s=d-t;for(;e<s;)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:s,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=s?C(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,ignoreLocation:c}=this.options,u=[],d=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:s,startIndex:m})=>{let{isMatch:x,score:g,indices:p}=function(e,t,s,{location:r=f.location,distance:i=f.distance,threshold:n=f.threshold,findAllMatches:a=f.findAllMatches,minMatchCharLength:o=f.minMatchCharLength,includeMatches:l=f.includeMatches,ignoreLocation:c=f.ignoreLocation}={}){let u;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let d=t.length,h=e.length,m=Math.max(0,Math.min(r,h)),x=n,g=m,p=(e,t)=>{let s=e/d;if(c)return s;let r=Math.abs(m-t);return i?s+r/i:r?1:s},v=o>1||l,b=v?Array(h):[];for(;(u=e.indexOf(t,g))>-1;)if(x=Math.min(p(0,u),x),g=u+d,v){let e=0;for(;e<d;)b[u+e]=1,e+=1}g=-1;let y=[],C=1,k=d+h,j=1<<d-1;for(let t=0;t<d;t+=1){let r=0,i=k;for(;r<i;)p(t,m+i)<=x?r=i:k=i,i=Math.floor((k-r)/2+r);k=i;let n=Math.max(1,m-i+1),o=a?h:Math.min(m+i,h)+d,l=Array(o+2);l[o+1]=(1<<t)-1;for(let r=o;r>=n;r-=1){let i=r-1,a=s[e[i]];if(v&&(b[i]=+!!a),l[r]=(l[r+1]<<1|1)&a,t&&(l[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),l[r]&j&&(C=p(t,i))<=x){if(x=C,(g=i)<=m)break;n=Math.max(1,2*m-g)}}if(p(t+1,m)>x)break;y=l}let w={isMatch:g>=0,score:Math.max(.001,C)};if(v){let e=function(e=[],t=f.minMatchCharLength){let s=[],r=-1,i=-1,n=0;for(let a=e.length;n<a;n+=1){let a=e[n];a&&-1===r?r=n:a||-1===r||((i=n-1)-r+1>=t&&s.push([r,i]),r=-1)}return e[n-1]&&n-r>=t&&s.push([r,n-1]),s}(b,o);e.length?l&&(w.indices=e):w.isMatch=!1}return w}(e,t,s,{location:i+m,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});x&&(h=!0),d+=g,x&&p&&u.push(...p)});let m={isMatch:h,score:h?d/this.chunks.length:1};return h&&r&&(m.indices=v(u)),m}}class j{constructor(e){this.pattern=e}static isMultiMatch(e){return w(e,this.multiRegex)}static isSingleMatch(e){return w(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function w(e,t){let s=e.match(t);return s?s[1]:null}class A extends j{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:c=f.ignoreLocation}={}){super(e),this._bitapSearch=new k(e,{location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class S extends j{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,s=0,r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,s))>-1;)s=t+i,r.push([t,s-1]);let n=!!r.length;return{isMatch:n,score:+!n,indices:r}}}let N=[class extends j{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]}}},S,class extends j{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 j{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 j{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 j{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 j{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]}}},A],E=N.length,I=new Set([A.type,S.type]),M=[];function D(...e){M.push(...e)}function B(e,t){for(let s=0,r=M.length;s<r;s+=1){let r=M[s];if(r.condition(e,t))return new r(e,t)}return new k(e,t)}let _="$and",F="$path",R=e=>!!(e[_]||e.$or),T=e=>({[_]:Object.keys(e).map(t=>({[t]:e[t]}))});function L(e,s,{auto:i=!0}={}){let a=e=>{if(r(e)){let t={keyId:null,pattern:e};return i&&(t.searcher=B(e,s)),t}let o=Object.keys(e),l=!!e[F];if(!l&&o.length>1&&!R(e))return a(T(e));if(!t(e)&&n(e)&&!R(e)){let t=l?e[F]:o[0],n=l?e.$val:e[t];if(!r(n))throw Error(`Invalid value for key ${t}`);let a={keyId:m(t),pattern:n};return i&&(a.searcher=B(n,s)),a}let c={children:[],operator:o[0]};return o.forEach(s=>{let r=e[s];t(r)&&r.forEach(e=>{c.children.push(a(e))})}),c};return R(e)||(e=T(e)),a(e)}function $(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){let s=1;return e.forEach(({key:e,norm:r,score:i})=>{let n=e?e.weight:null;s*=Math.pow(0===i&&n?Number.EPSILON:i,(n||1)*(t?1:r))}),s}class O{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 s=e-1>>1;if(t[e].score<=t[s].score)break;let r=t[e];t[e]=t[s],t[s]=r,e=s}}_sinkDown(e){let t=this.heap,s=t.length,r=e;do{let i=2*(e=r)+1,n=2*e+2;if(i<s&&t[i].score>t[r].score&&(r=i),n<s&&t[n].score>t[r].score&&(r=n),r!==e){let s=t[e];t[e]=t[r],t[r]=s}}while(r!==e)}}function P(e,t){let s=e.matches;t.matches=[],a(s)&&s.forEach(e=>{if(!a(e.indices)||!e.indices.length)return;let{indices:s,value:r}=e,i={indices:s,value:r};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 W=/\b\w+\b/g;function H({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize:s=>(e||(s=s.toLowerCase()),t&&(s=C(s)),s.match(W)||[])}}function V(e,t){for(let[s,r]of e.terms){let i=r.filter(e=>e.docIdx!==t),n=r.length-i.length;n>0&&(e.fieldCount-=n,e.df.set(s,(e.df.get(s)||0)-n),0===i.length?(e.terms.delete(s),e.df.delete(s)):e.terms.set(s,i))}}class U{constructor(e,t,s){this.options={...f,...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,s),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 g))throw Error("Incorrect 'index' type");if(this._myIndex=t||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(e,t,s){let r=new Map,i=new Map,n=0;function a(e,t,a,o){let l=s.tokenize(e);if(!l.length)return;n++;let c=new Map;for(let e of l)c.set(e,(c.get(e)||0)+1);for(let[e,s]of c){let n={docIdx:t,keyIdx:a,subIdx:o,tf:s},l=r.get(e);l||(l=[],r.set(e,l)),l.push(n),i.set(e,(i.get(e)||0)+1)}}for(let s of e){let{i:e,v:r,$:i}=s;if(void 0!==r){a(r,e,-1,-1);continue}if(i)for(let s=0;s<t;s++){let t=i[s];if(t)if(Array.isArray(t))for(let r of t)a(r.v,e,s,r.i??-1);else a(t.v,e,s,-1)}}return{terms:r,fieldCount:n,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=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});!function(e,t,s,r){let{i:i,v:n,$:a}=t;function o(t,s,n){let a=r.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,r]of o){let a={docIdx:i,keyIdx:s,subIdx:n,tf:r},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!==n)return o(n,-1,-1);if(a)for(let e=0;e<s;e++){let t=a[e];if(t)if(Array.isArray(t))for(let s of t)o(s.v,e,s.i??-1);else o(t.v,e,-1)}}(this._invertedIndex,e,this._myIndex.keys.length,t)}}remove(e=()=>!1){let t=[],s=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),s.push(r));if(s.length){if(this._invertedIndex)for(let e of s)V(this._invertedIndex,e);for(let e=s.length-1;e>=0;e-=1)this._docs.splice(s[e],1);this._myIndex.removeAll(s)}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 s,{limit:n=-1}=t||{},{includeMatches:a,includeScore:o,shouldSort:l,sortFn:c,ignoreFieldNorm:u}=this.options;if(r(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return i(n)&&n>-1&&(e=e.slice(0,n)),e}if(i(n)&&n>0&&r(e)){let t=new O(n);r(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:u}),s=t.extractSorted(c)}else!function(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){e.forEach(e=>{e.score=$(e.matches,{ignoreFieldNorm:t})})}(s=r(e)?r(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:u}),l&&s.sort(c),i(n)&&n>-1&&(s=s.slice(0,n));return function(e,t,{includeMatches:s=f.includeMatches,includeScore:r=f.includeScore}={}){let i=[];return s&&i.push(P),r&&i.push(z),e.map(e=>{let{idx:s}=e,r={item:t[s],refIndex:s};return i.length&&i.forEach(t=>{t(e,r)}),r})}(s,this._docs,{includeMatches:a,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{records:i}=this._myIndex,n=t?null:[];return i.forEach(({v:e,i:i,n:o})=>{if(!a(e))return;let{isMatch:l,score:c,indices:u}=r.searchIn(e);if(l){let r={item:e,idx:i,matches:[{score:c,value:e,norm:o,indices:u}]};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):n.push(r)}}),n}_searchLogical(e){let t=L(e,this.options),s=(e,t,r)=>{if(!("children"in e)){let s,{keyId:i,searcher:n}=e;return(null===i?(s=[],this._myIndex.keys.forEach((e,r)=>{s.push(...this._findMatches({key:e,value:t[r],searcher:n}))})):s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:n}),s&&s.length)?[{idx:r,item:t,matches:s}]:[]}let{children:i,operator:n}=e,a=[];for(let e=0,o=i.length;e<o;e+=1){let o=s(i[e],t,r);if(o.length)a.push(...o);else if(n===_)return[]}return a},r=this._myIndex.records,i=new Map,n=[];return r.forEach(({$:e,i:r})=>{if(a(e)){let a=s(t,e,r);a.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),n.push(i.get(r))),a.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),n}_searchObjectList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{keys:i,records:n}=this._myIndex,o=t?null:[];return n.forEach(({$:e,i:n})=>{if(!a(e))return;let l=[],c=!1,u=!1;if(i.forEach((t,s)=>{let i=this._findMatches({key:t,value:e[s],searcher:r});i.length?(l.push(...i),i[0].hasInverse&&(u=!0)):c=!0}),(!u||!c)&&l.length){let r={idx:n,item:e,matches:l};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}),o}_findMatches({key:e,value:s,searcher:r}){if(!a(s))return[];let i=[];if(t(s))s.forEach(({v:t,i:s,n:n})=>{if(!a(t))return;let{isMatch:o,score:l,indices:c,hasInverse:u}=r.searchIn(t);o&&i.push({score:l,key:e,value:t,idx:s,norm:n,indices:c,hasInverse:u})});else{let{v:t,n:n}=s,{isMatch:a,score:o,indices:l,hasInverse:c}=r.searchIn(t);a&&i.push({score:o,key:e,value:t,norm:n,indices:l,hasInverse:c})}return i}}U.version="7.3.0",U.createIndex=p,U.parseIndex=function(e,{getFn:t=f.getFn,fieldNormWeight:s=f.fieldNormWeight}={}){let{keys:r,records:i}=e,n=new g({getFn:t,fieldNormWeight:s});return n.setKeys(r),n.setIndexRecords(i),n},U.config=f,U.match=function(e,t,s){return B(e,{...f,...s}).searchIn(t)},U.parseQuery=L,D(class{constructor(e,{isCaseSensitive:t=f.isCaseSensitive,ignoreDiacritics:s=f.ignoreDiacritics,includeMatches:r=f.includeMatches,minMatchCharLength:i=f.minMatchCharLength,ignoreLocation:n=f.ignoreLocation,findAllMatches:a=f.findAllMatches,location:o=f.location,threshold:l=f.threshold,distance:c=f.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:i,findAllMatches:a,ignoreLocation:n,location:o,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=s?C(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{let s=(function(e){let t=[],s=e.length,r=0;for(;r<s;){for(;r<s&&" "===e[r];)r++;if(r>=s)break;let i=r;for(;i<s&&" "!==e[i]&&'"'!==e[i];)i++;if(i<s&&'"'===e[i]){for(i++;i<s;){if('"'===e[i]){let t=i+1;if(t>=s||" "===e[t]){i++;break}if("$"===e[t]&&(t+1>=s||" "===e[t+1])){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<s&&" "!==e[i];)i++;t.push(e.substring(r,i)),r=i}}return t})(e.replace(/\u0000/g,"|").trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=s.length;e<i;e+=1){let i=s[e],n=!1,a=-1;for(;!n&&++a<E;){let e=N[a],s=e.isMultiMatch(i);s&&(r.push(new e(s,t)),n=!0)}if(!n)for(a=-1;++a<E;){let e=N[a],s=e.isSingleMatch(i);if(s){r.push(new e(s,t));break}}}return r})}(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:s,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?C(e):e;let n=0,a=[],o=0,l=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];a.length=0,n=0,l=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:c,indices:u,score:d}=r.search(e);if(c){n+=1,o+=d;let e=r.constructor.type;e.startsWith("inverse")&&(l=!0),s&&(I.has(e)?a.push(...u):a.push(u))}else{o=0,n=0,a.length=0,l=!1;break}}if(n){let e={isMatch:!0,score:o/n};return l&&(e.hasInverse=!0),s&&(e.indices=v(a)),e}}return{isMatch:!1,score:1}}}),D(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=H({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics});const s=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;for(const e of(this.termSearchers=[],this.idfWeights=[],s)){this.termSearchers.push(new k(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 s=r.get(e)||0,n=Math.log(1+(i-s+.5)/(s+.5));this.idfWeights.push(n)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],s=0,r=0,i=0;for(let n=0;n<this.termSearchers.length;n++){let a=this.termSearchers[n].searchIn(e),o=this.idfWeights[n];r+=o,a.isMatch&&(i++,s+=o*(1-a.score),a.indices&&t.push(...a.indices))}if(0===i)return{isMatch:!1,score:1};let n={isMatch:!0,score:Math.max(.001,r>0?1-s/r:0)};return this.options.includeMatches&&t.length&&(n.indices=v(t)),n}}),U.use=function(...e){e.forEach(e=>D(e))},e.s(["default",0,U])},449636,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(533499),i=e.i(514798);let n=(0,i.createServerReference)("002a44def715b0e27cf128236c395ccb0073db5cec",i.callServer,void 0,i.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var a=e.i(448240);let o=[{id:"1x1",label:"1Γ—1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2Γ—1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3Γ—2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2Γ—2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4Γ—2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3Γ—3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var l=e.i(918385),c=e.i(519455),u=e.i(912505),d=e.i(572989);let h=(0,d.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var m=e.i(559340);function f({cols:e,rows:s,active:r}){let i=Array.from({length:e*s});return(0,t.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${r?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${e}, 1fr)`,gridTemplateRows:`repeat(${s}, 1fr)`},children:i.map((e,s)=>(0,t.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${r?"bg-primary":"bg-muted-foreground/40"}`},s))})}let x="custom";function g({value:e,customValue:i,onChange:n}){let{t:a}=(0,r.useI18n)(),[l,u]=(0,s.useState)(!1),d=(0,s.useRef)(null),h=e===x,p=h?null:o.find(t=>t.id===e)??o[2],[v,b]=(0,s.useState)(i?.cols??2),[y,C]=(0,s.useState)(i?.rows??2),[k,j]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,s.useEffect)(()=>{(0,m.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{j({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{i&&(b(i.cols),C(i.rows))},[i?.cols,i?.rows]),(0,s.useEffect)(()=>{if(l)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){d.current&&!d.current.contains(e.target)&&u(!1)}},[l]);let w=(e,t,s)=>Math.max(t,Math.min(s,e)),A=h?v:p?.cols??2,S=h?y:p?.rows??2,N=h?`${v}\xd7${y}`:p?.label??"";return(0,t.jsxs)("div",{ref:d,className:"relative",children:[(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>u(e=>!e),className:"gap-2",children:[(0,t.jsx)(f,{cols:A,rows:S,active:!1}),(0,t.jsx)("span",{children:N}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"β–Ό"})]}),l&&(0,t.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,t.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:a("missions.gridPreset")}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[o.map(s=>{let r=s.id===e;return(0,t.jsxs)("button",{onClick:()=>{n(s.id),u(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${r?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:s.cols,rows:s.rows,active:r}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${r?"text-primary":"text-foreground"}`,children:s.label}),(0,t.jsx)("span",{className:`text-xs ${r?"text-primary/60":"text-muted-foreground"}`,children:s.desc})]},s.id)}),(0,t.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,t.jsxs)("button",{onClick:()=>{h||n(x,{cols:v,rows:y})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${h?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:v,rows:y,active:h}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${h?"text-primary":"text-foreground"}`,children:a("missions.gridCustom")}),(0,t.jsxs)("span",{className:`text-xs ${h?"text-primary/60":"text-muted-foreground"}`,children:[v,"Γ—",y]})]}),h&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:a("missions.gridCols")}),(0,t.jsx)("input",{type:"number",min:k.minCols,max:k.maxCols,value:v,onChange:e=>{let t;b(t=w(Number(e.target.value),k.minCols,k.maxCols)),n(x,{cols:t,rows:y})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Γ—"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:a("missions.gridRows")}),(0,t.jsx)("input",{type:"number",min:k.minRows,max:k.maxRows,value:y,onChange:e=>{let t;C(t=w(Number(e.target.value),k.minRows,k.maxRows)),n(x,{cols:v,rows:t})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var p=e.i(720247),v=e.i(775712),b=e.i(19578),y=e.i(538059),C=e.i(67013);let k=(0,d.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),j=(0,d.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var w=e.i(657153);let A=(0,d.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var S=e.i(746798),N=e.i(487486),E=e.i(704769),I=e.i(360112);let M=(0,b.default)(()=>e.A(243288).then(e=>e.TaskTerminal),{loadableGenerated:{modules:[346069]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function D({execution:e,isRemoving:i,removeReason:n,onStop:a,onSessionEnd:o}){let{t:l}=(0,r.useI18n)(),u=(0,y.useRouter)(),{attributes:d,listeners:h,setNodeRef:m,transform:f,transition:x}=(0,v.useSortable)({id:e.executionId}),g={transform:C.CSS.Transform.toString(f),transition:x,opacity:+!i},[p,b]=(0,s.useState)(()=>e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0);(0,s.useEffect)(()=>{if(i)return;let t=setInterval(()=>{b(e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(t)},[e.startedAt,i]);let B=Math.floor(p/60),_=`${B}m ${p%60}s`;async function F(){if(e.projectLocalPath)try{await (0,E.openInTerminal)(e.projectLocalPath)}catch{I.toast.error(l("preview.terminalError"))}}return(0,t.jsxs)("div",{ref:m,style:g,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...d,children:[(0,t.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,t.jsx)("button",{...h,"aria-label":l("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,t.jsx)(k,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[e.workspaceName," β€Ί"," ",e.projectAlias||e.projectName," β€Ί"," ",(0,t.jsx)("span",{className:"text-foreground font-semibold",children:e.taskTitle})]}),i?(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===n?l("missions.statusStopped"):l("missions.statusCompleted")}):(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:l("missions.statusRunning")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:_}),e.projectLocalPath&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:F}),children:(0,t.jsx)(A,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.openInTerminal")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>u.push(`/workspaces/${e.workspaceId}/tasks/${e.taskId}`)}),children:(0,t.jsx)(j,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.openFullView")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>a(e.taskId),disabled:i}),children:(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.stopTask")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,t.jsx)(M,{taskId:e.taskId,worktreePath:e.worktreePath??e.projectLocalPath,onSessionEnd:t=>o?.(e.taskId,t),useCanvasRenderer:!0})})]})}var B=e.i(169751);let _=(0,i.createServerReference)("40d97c90f81fbebe00de966b190312ad7a2de2d144",i.callServer,void 0,i.findSourceMapURL,"getWorkspacesWithRecentTasks"),F=(0,i.createServerReference)("407508cba43677aa8fdab094efa109d1d901a4fa94",i.callServer,void 0,i.findSourceMapURL,"getProjectTasks");var R=e.i(462691),T=e.i(875345),L=e.i(793479),$=e.i(776639),O=e.i(368490);let P=(0,d.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var z=e.i(922541),W=e.i(738690),H=e.i(759684);let V={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},U={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function K({status:e}){return(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[e]??"bg-slate-100 text-slate-600"}`,children:V[e]??e})}function q({task:e,isRunning:s,launchingId:r,onLaunchNew:i,onResume:n,t:a}){let o=e.executions?.[0]?.sessionId,l=r===e.id;return(0,t.jsxs)("div",{className:"group/task grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:`text-sm truncate ${s?"italic text-muted-foreground":""}`,children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)(K,{status:e.status}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:U[e.priority]??e.priority})]})]}),s?(0,t.jsx)("span",{className:"text-[10px] italic text-muted-foreground",children:a("missions.alreadyMonitored")}):(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity",children:[o&&(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>n(e.id,o),disabled:l,title:a("missions.continueSession"),children:[(0,t.jsx)(z.RotateCcw,{className:"h-3 w-3 mr-1"}),a("missions.continueLabel")]}),(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>i(e.id),disabled:l,title:a("missions.launchNew"),children:[(0,t.jsx)(P,{className:"h-3 w-3 mr-1"}),l?"...":a("missions.launchNewLabel")]})]})]})}function G({open:e,onOpenChange:i,onLaunchNew:n,onResume:a,runningTaskIds:o,launchingId:u}){let{t:d}=(0,r.useI18n)(),[h,m]=(0,s.useState)([]),[f,x]=(0,s.useState)(""),[g,p]=(0,s.useState)(""),[v,b]=(0,s.useState)([]),[y,C]=(0,s.useState)("");(0,s.useEffect)(()=>{e&&(x(""),p(""),b([]),C(""),_(100).then(m).catch(()=>I.toast.error(d("missions.error.launchFailed"))))},[e,d]),(0,s.useEffect)(()=>{g?F(g).then(e=>{b(e.filter(e=>"TODO"===e.status||"IN_PROGRESS"===e.status||"IN_REVIEW"===e.status))}).catch(()=>I.toast.error(d("missions.error.launchFailed"))):b([])},[g,d]);let k=(0,s.useMemo)(()=>{let e=[];for(let t of h)for(let s of t.projects)for(let r of s.tasks)("TODO"===r.status||"IN_PROGRESS"===r.status||"IN_REVIEW"===r.status)&&e.push({task:r,workspaceName:t.name,projectName:s.alias??s.name});return e},[h]),j=(0,s.useMemo)(()=>new B.default(k,{keys:["task.title"],threshold:.4,distance:200}),[k]),A=(0,s.useMemo)(()=>{let e=y.trim();return e?j.search(e,{limit:30}).map(e=>e.item):[]},[j,y]),S=y.trim().length>0,N=h.find(e=>e.id===f),E=N?.projects??[];return(0,t.jsx)($.Dialog,{open:e,onOpenChange:i,children:(0,t.jsxs)($.DialogContent,{className:"sm:max-w-2xl max-h-[80vh]",children:[(0,t.jsx)($.DialogHeader,{children:(0,t.jsx)($.DialogTitle,{children:d("missions.fullPickerTitle")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(W.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(L.Input,{value:y,onChange:e=>C(e.target.value),placeholder:d("missions.fullPicker.searchPlaceholder"),className:"pl-8 pr-8 h-8"}),y&&(0,t.jsx)(c.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6",onClick:()=>C(""),"aria-label":d("missions.fullPicker.clearSearch"),children:(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"})})]}),!S&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(l.Select,{value:f,onValueChange:e=>{x(e??""),p("")},children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:h.find(e=>e.id===f)?.name??d("missions.launcher.selectWorkspace")})}),(0,t.jsx)(l.SelectContent,{children:h.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)(l.Select,{value:g,onValueChange:e=>p(e??""),disabled:!f,children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:E.find(e=>e.id===g)?.name??d("missions.launcher.selectProject")})}),(0,t.jsx)(l.SelectContent,{children:E.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.alias??e.name},e.id))})]})]})]}),(0,t.jsx)(H.ScrollArea,{className:"max-h-[60vh] -mx-2",children:S?0===A.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPicker.noSearchResults")}):A.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"px-3 pt-2 pb-0.5 text-[11px] text-muted-foreground",children:[e.workspaceName," Β· ",e.projectName]}),(0,t.jsx)(q,{task:e.task,isRunning:o.has(e.task.id),launchingId:u,onLaunchNew:n,onResume:a,t:d})]},e.task.id)):0===v.length&&g?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.launcher.noTasks")}):0===v.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPickerHint")}):v.map(e=>(0,t.jsx)(q,{task:e,isRunning:o.has(e.id),launchingId:u,onLaunchNew:n,onResume:a,t:d},e.id))})]})})}function J({open:e,onOpenChange:i,onLaunched:n,runningTaskIds:a=new Set,anchorRef:o}){let{t:l}=(0,r.useI18n)(),u=(0,s.useRef)(null),[d,h]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),[p,v]=(0,s.useState)(!1),[b,y]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{e&&(f(!0),_(5).then(h).catch(()=>I.toast.error(l("missions.error.launchFailed"))).finally(()=>f(!1)))},[e,l]);let C=(0,s.useMemo)(()=>d.filter(e=>e.projects.some(e=>e._count.tasks>0)),[d]),k=(0,s.useCallback)(e=>{y(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);(0,s.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){let t=e.target;if(u.current&&!u.current.contains(t)){if(o?.current&&o.current.contains(t))return;i(!1)}}},[e,i,o]);let j=(0,s.useCallback)(async e=>{try{g(e),await (0,R.startPtyExecution)(e,""),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),w=(0,s.useCallback)(async(e,t)=>{try{g(e),await (0,T.resumePtyExecution)(e,t),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),A=(0,s.useCallback)(()=>{i(!1),v(!0)},[i]);return e||p?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{ref:u,className:"absolute right-0 z-50 mt-1 grid max-h-[480px] w-[28rem] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-border",children:(0,t.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:l("missions.pickerTitle")})}),(0,t.jsx)(H.ScrollArea,{children:m?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===C.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:l("missions.noAvailableTasks")}):C.map(e=>{let s=b.has(e.id),r=e.projects.filter(e=>e._count.tasks>0);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",onClick:()=>k(e.id),className:"flex h-auto w-full justify-start gap-1.5 rounded-none border-b border-border/50 px-3 py-1.5 hover:bg-accent",children:[(0,t.jsx)(O.ChevronRight,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${s?"":"rotate-90"}`}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:e.name})]}),!s&&(0,t.jsx)("div",{className:"ml-[19px] mt-0.5 border-l border-border/50",children:r.map(e=>(0,t.jsxs)("div",{className:"py-0.5",children:[(0,t.jsx)("div",{className:"pl-3 pt-1.5 pb-1",children:(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:e.alias??e.name})}),(0,t.jsx)("div",{className:"pl-3",children:e.tasks.map(e=>(0,t.jsx)(q,{task:e,isRunning:a.has(e.id),launchingId:x,onLaunchNew:j,onResume:w,t:l},e.id))})]},e.id))})]},e.id)})}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsx)(c.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:A,children:l("missions.showMoreTasks")})})]}),(0,t.jsx)(G,{open:p,onOpenChange:v,onLaunchNew:j,onResume:w,runningTaskIds:a,launchingId:x})]}):null}e.s(["MissionsClient",0,function({initialExecutions:e}){let{t:i}=(0,r.useI18n)(),[d,m]=(0,s.useState)(e),[f,x]=(0,s.useState)(()=>localStorage.getItem("missions-grid-preset")??"3x2"),[b,y]=(0,s.useState)(()=>{try{let e=localStorage.getItem("missions-grid-custom");if(e){let t=JSON.parse(e);if("number"==typeof t?.cols&&"number"==typeof t?.rows)return{cols:Math.max(1,Math.min(10,t.cols)),rows:Math.max(1,Math.min(10,t.rows))}}}catch{}return{cols:2,rows:2}}),[C,k]=(0,s.useState)(!1),[j,w]=(0,s.useState)(""),A=(0,s.useRef)(null),[S,N]=(0,s.useState)(new Map),E=(0,s.useRef)(S);(0,s.useEffect)(()=>{E.current=S},[S]);let M=(0,s.useRef)(new Map),B=o.find(e=>e.id===f)??o[2],_="custom"===f?b.cols:B.cols,F="custom"===f?b.rows:B.rows,R=(0,s.useRef)(null),[T,L]=(0,s.useState)("480px");(0,s.useEffect)(()=>{let e=R.current;if(!e)return;let t=()=>{let t=(e.clientHeight-32-16*(F-1))/F;L(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[F]);let $=(0,s.useCallback)((e,t)=>{e&&(x(e),localStorage.setItem("missions-grid-preset",e),"custom"===e&&t&&(y(t),localStorage.setItem("missions-grid-custom",JSON.stringify(t))))},[]),O=(0,p.useSensors)((0,p.useSensor)(p.PointerSensor,{activationConstraint:{distance:8}})),P=(0,s.useCallback)(e=>{let{active:t,over:s}=e;s&&t.id!==s.id&&m(e=>{let r=e.findIndex(e=>e.executionId===t.id),i=e.findIndex(e=>e.executionId===s.id);return(0,v.arrayMove)(e,r,i)})},[]),z=(0,s.useCallback)((e,t)=>{if(E.current.has(e))return;N(s=>new Map([...s,[e,t]]));let s=setTimeout(()=>{m(t=>t.filter(t=>t.executionId!==e)),N(t=>{let s=new Map(t);return s.delete(e),s}),M.current.delete(e)},500);M.current.set(e,s)},[]);(0,s.useEffect)(()=>{let e=setInterval(async()=>{try{let e=await n();m(t=>{let s=E.current,{merged:r,goneIds:i}=function({prev:e,fresh:t,removingIds:s}){let r=new Set(t.map(e=>e.executionId)),i=[];e.forEach(e=>{r.has(e.executionId)||s.has(e.executionId)||i.push(e.executionId)});let n=e.filter(e=>r.has(e.executionId)||s.has(e.executionId)),a=new Set(e.map(e=>e.executionId));return{merged:[...n,...t.filter(e=>!a.has(e.executionId))],goneIds:i}}({prev:t,fresh:e,removingIds:new Set(s.keys())});return i.forEach(e=>z(e,"completed")),r})}catch{}},4e3);return()=>clearInterval(e)},[z]),(0,s.useEffect)(()=>{let e=M.current;return()=>{e.forEach(e=>clearTimeout(e))}},[]);let W=(0,s.useCallback)(async e=>{try{await (0,a.stopPtyExecution)(e),m(t=>{let s=t.find(t=>t.taskId===e);return s&&z(s.executionId,"stopped"),t})}catch{I.toast.error(i("missions.error.stopFailed"))}},[z,i]),H=(0,s.useCallback)((e,t)=>{m(t=>{let s=t.find(t=>t.taskId===e);return s&&z(s.executionId,"completed"),t})},[z]),V=(0,s.useCallback)(e=>{n().then(e=>{m(t=>{let s=new Set(t.map(e=>e.executionId));return[...t,...e.filter(e=>!s.has(e.executionId))]})}).catch(()=>{})},[]),U=Array.from(new Map(d.map(e=>[e.workspaceId,e.workspaceName])).entries()).map(([e,t])=>({id:e,name:t})),K=j?d.filter(e=>e.workspaceId===j):d,q=new Set(d.map(e=>e.taskId));return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,t.jsx)("h1",{className:"text-base font-semibold",children:i("missions.pageTitle")}),(0,t.jsxs)(l.Select,{value:j,onValueChange:e=>w(e??""),children:[(0,t.jsx)(l.SelectTrigger,{className:"w-36 h-8",children:(0,t.jsx)("span",{className:"truncate",children:j?U.find(e=>e.id===j)?.name??i("missions.filterAll"):i("missions.filterAll")})}),(0,t.jsxs)(l.SelectContent,{children:[(0,t.jsx)(l.SelectItem,{value:"",children:i("missions.filterAll")}),U.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(g,{value:f,customValue:b,onChange:$}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Button,{ref:A,onClick:()=>k(e=>!e),children:i("missions.launchTask")}),(0,t.jsx)(J,{open:C,onOpenChange:k,onLaunched:V,runningTaskIds:q,anchorRef:A})]})]}),(0,t.jsx)("div",{ref:R,className:"flex-1 overflow-auto min-h-0 p-4",children:0===K.length&&0===S.size?(0,t.jsx)(u.EmptyState,{icon:h,title:i("missions.emptyTitle"),description:i("missions.emptyDesc"),className:"h-full",action:(0,t.jsx)(c.Button,{onClick:()=>k(!0),children:i("missions.launchTask")})}):(0,t.jsx)(p.DndContext,{id:"missions-dnd",sensors:O,collisionDetection:p.closestCenter,onDragEnd:P,children:(0,t.jsx)(v.SortableContext,{items:K.map(e=>e.executionId),strategy:v.rectSortingStrategy,children:(0,t.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${_}, 1fr)`,gridAutoRows:T},children:K.map(e=>(0,t.jsx)(D,{execution:e,isRemoving:S.has(e.executionId),removeReason:S.get(e.executionId),onStop:W,onSessionEnd:H},e.executionId))})})})})]})}],449636)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,129858,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("405e4a70c0b72700ed4c009ba1fd1c9b173d7e5f60",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,s])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:r,description:i,action:n,className:a}){return(0,t.jsxs)("div",{className:(0,s.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:r}),i&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:i}),n&&(0,t.jsx)("div",{className:"mt-2",children:n})]})}])},487486,e=>{"use strict";var t=e.i(565455),s=e.i(581263),r=e.i(294237),i=e.i(975157);let n=(0,r.cva)("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r="default",render:a,...o}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(n({variant:r}),e)},o),render:a,state:{slot:"badge",variant:r}},(0,s.useRenderElement)(l.defaultTagName??"div",l,l)}],487486)},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)},732360,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("4037b4917ac41e034cd749f30891348da8136d901c",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,s])},213686,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c3d3e128c7ede8a1daf9a82c04a8feb7d2080ba3c",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,s])},211576,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("6007aaf2a1c10b6cd0c420b925dcce2adf9f50fb0d",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",0,s])},796320,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40ebb307fc9b74c1214dceefe192d80f30bede297e",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,s])},169751,e=>{"use strict";function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===l(e)}function s(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 r(e){return"string"==typeof e}function i(e){return"number"==typeof e}function n(e){return"object"==typeof e}function a(e){return null!=e}function o(e){return!e.trim().length}function l(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let c=Object.prototype.hasOwnProperty;class u{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let s=d(e);this._keys.push(s),this._keyMap[s.id]=s,t+=s.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 s=null,i=null,n=null,a=1,o=null;if(r(e)||t(e))n=e,s=h(e),i=m(e);else{if(!c.call(e,"name"))throw Error("Missing name property in key");let t=e.name;if(n=t,c.call(e,"weight")&&(a=e.weight)<=0)throw Error(`Property 'weight' in key '${t}' must be a positive integer`);s=h(t),i=m(t),o=e.getFn}return{path:s,id:i,weight:a,src:n,getFn:o}}function h(e){return t(e)?e:e.split(".")}function m(e){return t(e)?e.join("."):e}let f=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 c=[],u=!1,d=(e,o,h,m)=>{if(a(e))if(o[h]){var f,x;let g=e[o[h]];if(!a(g))return;if(h===o.length-1&&(r(g)||i(g)||!0===(f=g)||!1===f||n(x=f)&&null!==x&&"[object Boolean]"==l(f)||"bigint"==typeof g))c.push(void 0!==m?{v:s(g),i:m}:s(g));else if(t(g)){u=!0;for(let e=0,t=g.length;e<t;e+=1)d(g[e],o,h+1,e)}else o.length&&d(g,o,h+1,m)}else c.push(void 0!==m?{v:e,i:m}:e)};return d(e,r(o)?o.split("."):o,0),u?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}),x=/[^ ]+/g;class g{constructor({getFn:e=f.getFn,fieldNormWeight:t=f.fieldNormWeight}={}){this.norm=function(e=1,t=3){let s=new Map,r=Math.pow(10,t);return{get(t){let i=t.match(x).length;if(s.has(i))return s.get(i);let n=parseFloat(Math.round(1/Math.pow(i,.5*e)*r)/r);return s.set(i,n),n},clear(){s.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,r(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();r(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,s=this.size();t<s;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 s={v:e,i:t,n:this.norm.get(e)};this.records.push(s)}_addObject(e,i){let n={i:i,$:{}};this.keys.forEach((i,l)=>{let c=i.getFn?i.getFn(e):this.getFn(e,i.path);if(a(c)){if(t(c)){let e=[];for(let t=0,i=c.length;t<i;t+=1){let i=c[t];if(a(i)){if(r(i)){if(!o(i)){let s={v:i,i:t,n:this.norm.get(i)};e.push(s)}}else if(a(i.v)){let t=r(i.v)?i.v:s(i.v);if(!o(t)){let s={v:t,i:i.i,n:this.norm.get(t)};e.push(s)}}}}n.$[l]=e}else if(r(c)&&!o(c)){let e={v:c,n:this.norm.get(c)};n.$[l]=e}}}),this.records.push(n)}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}}function p(e,t,{getFn:s=f.getFn,fieldNormWeight:r=f.fieldNormWeight}={}){let i=new g({getFn:s,fieldNormWeight:r});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 s=1,r=e.length;s<r;s+=1){let r=t[t.length-1],i=e[s];i[0]<=r[1]+1?r[1]=Math.max(r[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"),C=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 k{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:c=f.ignoreLocation}={}){if(this.options={location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c},e=o?e:e.toLowerCase(),e=l?C(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 s=0,r=e.length;s<r;s+=1){let i=e.charAt(s);t[i]=(t[i]||0)|1<<r-s-1}return t}(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0;const t=d%32,s=d-t;for(;e<s;)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:s,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=s?C(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,ignoreLocation:c}=this.options,u=[],d=0,h=!1;this.chunks.forEach(({pattern:t,alphabet:s,startIndex:m})=>{let{isMatch:x,score:g,indices:p}=function(e,t,s,{location:r=f.location,distance:i=f.distance,threshold:n=f.threshold,findAllMatches:a=f.findAllMatches,minMatchCharLength:o=f.minMatchCharLength,includeMatches:l=f.includeMatches,ignoreLocation:c=f.ignoreLocation}={}){let u;if(t.length>32)throw Error("Pattern length exceeds max of 32.");let d=t.length,h=e.length,m=Math.max(0,Math.min(r,h)),x=n,g=m,p=(e,t)=>{let s=e/d;if(c)return s;let r=Math.abs(m-t);return i?s+r/i:r?1:s},v=o>1||l,y=v?Array(h):[];for(;(u=e.indexOf(t,g))>-1;)if(x=Math.min(p(0,u),x),g=u+d,v){let e=0;for(;e<d;)y[u+e]=1,e+=1}g=-1;let b=[],C=1,k=d+h,j=1<<d-1;for(let t=0;t<d;t+=1){let r=0,i=k;for(;r<i;)p(t,m+i)<=x?r=i:k=i,i=Math.floor((k-r)/2+r);k=i;let n=Math.max(1,m-i+1),o=a?h:Math.min(m+i,h)+d,l=Array(o+2);l[o+1]=(1<<t)-1;for(let r=o;r>=n;r-=1){let i=r-1,a=s[e[i]];if(v&&(y[i]=+!!a),l[r]=(l[r+1]<<1|1)&a,t&&(l[r]|=(b[r+1]|b[r])<<1|1|b[r+1]),l[r]&j&&(C=p(t,i))<=x){if(x=C,(g=i)<=m)break;n=Math.max(1,2*m-g)}}if(p(t+1,m)>x)break;b=l}let w={isMatch:g>=0,score:Math.max(.001,C)};if(v){let e=function(e=[],t=f.minMatchCharLength){let s=[],r=-1,i=-1,n=0;for(let a=e.length;n<a;n+=1){let a=e[n];a&&-1===r?r=n:a||-1===r||((i=n-1)-r+1>=t&&s.push([r,i]),r=-1)}return e[n-1]&&n-r>=t&&s.push([r,n-1]),s}(y,o);e.length?l&&(w.indices=e):w.isMatch=!1}return w}(e,t,s,{location:i+m,distance:n,threshold:a,findAllMatches:o,minMatchCharLength:l,includeMatches:r,ignoreLocation:c});x&&(h=!0),d+=g,x&&p&&u.push(...p)});let m={isMatch:h,score:h?d/this.chunks.length:1};return h&&r&&(m.indices=v(u)),m}}class j{constructor(e){this.pattern=e}static isMultiMatch(e){return w(e,this.multiRegex)}static isSingleMatch(e){return w(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function w(e,t){let s=e.match(t);return s?s[1]:null}class A extends j{constructor(e,{location:t=f.location,threshold:s=f.threshold,distance:r=f.distance,includeMatches:i=f.includeMatches,findAllMatches:n=f.findAllMatches,minMatchCharLength:a=f.minMatchCharLength,isCaseSensitive:o=f.isCaseSensitive,ignoreDiacritics:l=f.ignoreDiacritics,ignoreLocation:c=f.ignoreLocation}={}){super(e),this._bitapSearch=new k(e,{location:t,threshold:s,distance:r,includeMatches:i,findAllMatches:n,minMatchCharLength:a,isCaseSensitive:o,ignoreDiacritics:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class S extends j{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,s=0,r=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,s))>-1;)s=t+i,r.push([t,s-1]);let n=!!r.length;return{isMatch:n,score:+!n,indices:r}}}let N=[class extends j{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]}}},S,class extends j{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 j{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 j{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 j{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 j{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]}}},A],E=N.length,I=new Set([A.type,S.type]),M=[];function D(...e){M.push(...e)}function B(e,t){for(let s=0,r=M.length;s<r;s+=1){let r=M[s];if(r.condition(e,t))return new r(e,t)}return new k(e,t)}let _="$and",F="$path",R=e=>!!(e[_]||e.$or),T=e=>({[_]:Object.keys(e).map(t=>({[t]:e[t]}))});function L(e,s,{auto:i=!0}={}){let a=e=>{if(r(e)){let t={keyId:null,pattern:e};return i&&(t.searcher=B(e,s)),t}let o=Object.keys(e),l=!!e[F];if(!l&&o.length>1&&!R(e))return a(T(e));if(!t(e)&&n(e)&&!R(e)){let t=l?e[F]:o[0],n=l?e.$val:e[t];if(!r(n))throw Error(`Invalid value for key ${t}`);let a={keyId:m(t),pattern:n};return i&&(a.searcher=B(n,s)),a}let c={children:[],operator:o[0]};return o.forEach(s=>{let r=e[s];t(r)&&r.forEach(e=>{c.children.push(a(e))})}),c};return R(e)||(e=T(e)),a(e)}function $(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){let s=1;return e.forEach(({key:e,norm:r,score:i})=>{let n=e?e.weight:null;s*=Math.pow(0===i&&n?Number.EPSILON:i,(n||1)*(t?1:r))}),s}class O{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 s=e-1>>1;if(t[e].score<=t[s].score)break;let r=t[e];t[e]=t[s],t[s]=r,e=s}}_sinkDown(e){let t=this.heap,s=t.length,r=e;do{let i=2*(e=r)+1,n=2*e+2;if(i<s&&t[i].score>t[r].score&&(r=i),n<s&&t[n].score>t[r].score&&(r=n),r!==e){let s=t[e];t[e]=t[r],t[r]=s}}while(r!==e)}}function P(e,t){let s=e.matches;t.matches=[],a(s)&&s.forEach(e=>{if(!a(e.indices)||!e.indices.length)return;let{indices:s,value:r}=e,i={indices:s,value:r};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 W=/\b\w+\b/g;function H({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize:s=>(e||(s=s.toLowerCase()),t&&(s=C(s)),s.match(W)||[])}}function V(e,t){for(let[s,r]of e.terms){let i=r.filter(e=>e.docIdx!==t),n=r.length-i.length;n>0&&(e.fieldCount-=n,e.df.set(s,(e.df.get(s)||0)-n),0===i.length?(e.terms.delete(s),e.df.delete(s)):e.terms.set(s,i))}}class U{constructor(e,t,s){this.options={...f,...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,s),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 g))throw Error("Incorrect 'index' type");if(this._myIndex=t||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=function(e,t,s){let r=new Map,i=new Map,n=0;function a(e,t,a,o){let l=s.tokenize(e);if(!l.length)return;n++;let c=new Map;for(let e of l)c.set(e,(c.get(e)||0)+1);for(let[e,s]of c){let n={docIdx:t,keyIdx:a,subIdx:o,tf:s},l=r.get(e);l||(l=[],r.set(e,l)),l.push(n),i.set(e,(i.get(e)||0)+1)}}for(let s of e){let{i:e,v:r,$:i}=s;if(void 0!==r){a(r,e,-1,-1);continue}if(i)for(let s=0;s<t;s++){let t=i[s];if(t)if(Array.isArray(t))for(let r of t)a(r.v,e,s,r.i??-1);else a(t.v,e,s,-1)}}return{terms:r,fieldCount:n,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=H({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});!function(e,t,s,r){let{i:i,v:n,$:a}=t;function o(t,s,n){let a=r.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,r]of o){let a={docIdx:i,keyIdx:s,subIdx:n,tf:r},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!==n)return o(n,-1,-1);if(a)for(let e=0;e<s;e++){let t=a[e];if(t)if(Array.isArray(t))for(let s of t)o(s.v,e,s.i??-1);else o(t.v,e,-1)}}(this._invertedIndex,e,this._myIndex.keys.length,t)}}remove(e=()=>!1){let t=[],s=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),s.push(r));if(s.length){if(this._invertedIndex)for(let e of s)V(this._invertedIndex,e);for(let e=s.length-1;e>=0;e-=1)this._docs.splice(s[e],1);this._myIndex.removeAll(s)}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 s,{limit:n=-1}=t||{},{includeMatches:a,includeScore:o,shouldSort:l,sortFn:c,ignoreFieldNorm:u}=this.options;if(r(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return i(n)&&n>-1&&(e=e.slice(0,n)),e}if(i(n)&&n>0&&r(e)){let t=new O(n);r(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:u}),s=t.extractSorted(c)}else!function(e,{ignoreFieldNorm:t=f.ignoreFieldNorm}){e.forEach(e=>{e.score=$(e.matches,{ignoreFieldNorm:t})})}(s=r(e)?r(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),{ignoreFieldNorm:u}),l&&s.sort(c),i(n)&&n>-1&&(s=s.slice(0,n));return function(e,t,{includeMatches:s=f.includeMatches,includeScore:r=f.includeScore}={}){let i=[];return s&&i.push(P),r&&i.push(z),e.map(e=>{let{idx:s}=e,r={item:t[s],refIndex:s};return i.length&&i.forEach(t=>{t(e,r)}),r})}(s,this._docs,{includeMatches:a,includeScore:o})}_searchStringList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{records:i}=this._myIndex,n=t?null:[];return i.forEach(({v:e,i:i,n:o})=>{if(!a(e))return;let{isMatch:l,score:c,indices:u}=r.searchIn(e);if(l){let r={item:e,idx:i,matches:[{score:c,value:e,norm:o,indices:u}]};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):n.push(r)}}),n}_searchLogical(e){let t=L(e,this.options),s=(e,t,r)=>{if(!("children"in e)){let s,{keyId:i,searcher:n}=e;return(null===i?(s=[],this._myIndex.keys.forEach((e,r)=>{s.push(...this._findMatches({key:e,value:t[r],searcher:n}))})):s=this._findMatches({key:this._keyStore.get(i),value:this._myIndex.getValueForItemAtKeyId(t,i),searcher:n}),s&&s.length)?[{idx:r,item:t,matches:s}]:[]}let{children:i,operator:n}=e,a=[];for(let e=0,o=i.length;e<o;e+=1){let o=s(i[e],t,r);if(o.length)a.push(...o);else if(n===_)return[]}return a},r=this._myIndex.records,i=new Map,n=[];return r.forEach(({$:e,i:r})=>{if(a(e)){let a=s(t,e,r);a.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),n.push(i.get(r))),a.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),n}_searchObjectList(e,{heap:t,ignoreFieldNorm:s}={}){let r=this._getSearcher(e),{keys:i,records:n}=this._myIndex,o=t?null:[];return n.forEach(({$:e,i:n})=>{if(!a(e))return;let l=[],c=!1,u=!1;if(i.forEach((t,s)=>{let i=this._findMatches({key:t,value:e[s],searcher:r});i.length?(l.push(...i),i[0].hasInverse&&(u=!0)):c=!0}),(!u||!c)&&l.length){let r={idx:n,item:e,matches:l};t?(r.score=$(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}),o}_findMatches({key:e,value:s,searcher:r}){if(!a(s))return[];let i=[];if(t(s))s.forEach(({v:t,i:s,n:n})=>{if(!a(t))return;let{isMatch:o,score:l,indices:c,hasInverse:u}=r.searchIn(t);o&&i.push({score:l,key:e,value:t,idx:s,norm:n,indices:c,hasInverse:u})});else{let{v:t,n:n}=s,{isMatch:a,score:o,indices:l,hasInverse:c}=r.searchIn(t);a&&i.push({score:o,key:e,value:t,norm:n,indices:l,hasInverse:c})}return i}}U.version="7.3.0",U.createIndex=p,U.parseIndex=function(e,{getFn:t=f.getFn,fieldNormWeight:s=f.fieldNormWeight}={}){let{keys:r,records:i}=e,n=new g({getFn:t,fieldNormWeight:s});return n.setKeys(r),n.setIndexRecords(i),n},U.config=f,U.match=function(e,t,s){return B(e,{...f,...s}).searchIn(t)},U.parseQuery=L,D(class{constructor(e,{isCaseSensitive:t=f.isCaseSensitive,ignoreDiacritics:s=f.ignoreDiacritics,includeMatches:r=f.includeMatches,minMatchCharLength:i=f.minMatchCharLength,ignoreLocation:n=f.ignoreLocation,findAllMatches:a=f.findAllMatches,location:o=f.location,threshold:l=f.threshold,distance:c=f.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:s,includeMatches:r,minMatchCharLength:i,findAllMatches:a,ignoreLocation:n,location:o,threshold:l,distance:c},e=t?e:e.toLowerCase(),e=s?C(e):e,this.pattern=e,this.query=function(e,t={}){return e.replace(/\\\|/g,"\0").split("|").map(e=>{let s=(function(e){let t=[],s=e.length,r=0;for(;r<s;){for(;r<s&&" "===e[r];)r++;if(r>=s)break;let i=r;for(;i<s&&" "!==e[i]&&'"'!==e[i];)i++;if(i<s&&'"'===e[i]){for(i++;i<s;){if('"'===e[i]){let t=i+1;if(t>=s||" "===e[t]){i++;break}if("$"===e[t]&&(t+1>=s||" "===e[t+1])){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<s&&" "!==e[i];)i++;t.push(e.substring(r,i)),r=i}}return t})(e.replace(/\u0000/g,"|").trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=s.length;e<i;e+=1){let i=s[e],n=!1,a=-1;for(;!n&&++a<E;){let e=N[a],s=e.isMultiMatch(i);s&&(r.push(new e(s,t)),n=!0)}if(!n)for(a=-1;++a<E;){let e=N[a],s=e.isSingleMatch(i);if(s){r.push(new e(s,t));break}}}return r})}(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:s,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?C(e):e;let n=0,a=[],o=0,l=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];a.length=0,n=0,l=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:c,indices:u,score:d}=r.search(e);if(c){n+=1,o+=d;let e=r.constructor.type;e.startsWith("inverse")&&(l=!0),s&&(I.has(e)?a.push(...u):a.push(u))}else{o=0,n=0,a.length=0,l=!1;break}}if(n){let e={isMatch:!0,score:o/n};return l&&(e.hasInverse=!0),s&&(e.indices=v(a)),e}}return{isMatch:!1,score:1}}}),D(class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=H({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics});const s=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;for(const e of(this.termSearchers=[],this.idfWeights=[],s)){this.termSearchers.push(new k(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 s=r.get(e)||0,n=Math.log(1+(i-s+.5)/(s+.5));this.idfWeights.push(n)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],s=0,r=0,i=0;for(let n=0;n<this.termSearchers.length;n++){let a=this.termSearchers[n].searchIn(e),o=this.idfWeights[n];r+=o,a.isMatch&&(i++,s+=o*(1-a.score),a.indices&&t.push(...a.indices))}if(0===i)return{isMatch:!1,score:1};let n={isMatch:!0,score:Math.max(.001,r>0?1-s/r:0)};return this.options.includeMatches&&t.length&&(n.indices=v(t)),n}}),U.use=function(...e){e.forEach(e=>D(e))},e.s(["default",0,U])},449636,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(533499),i=e.i(514798);let n=(0,i.createServerReference)("00345e126058c2ddca2edd4cd73b11f588cdec2f45",i.callServer,void 0,i.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var a=e.i(732360);let o=[{id:"1x1",label:"1Γ—1",cols:1,rows:1,minHeight:"480px",desc:"Focus mode"},{id:"2x1",label:"2Γ—1",cols:2,rows:1,minHeight:"480px",desc:"Side by side"},{id:"3x2",label:"3Γ—2",cols:3,rows:2,minHeight:"300px",desc:"Default"},{id:"2x2",label:"2Γ—2",cols:2,rows:2,minHeight:"300px",desc:"Balanced"},{id:"4x2",label:"4Γ—2",cols:4,rows:2,minHeight:"240px",desc:"Wide monitor"},{id:"3x3",label:"3Γ—3",cols:3,rows:3,minHeight:"240px",desc:"Max overview"}];var l=e.i(918385),c=e.i(519455),u=e.i(912505),d=e.i(572989);let h=(0,d.default)("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]);var m=e.i(129858);function f({cols:e,rows:s,active:r}){let i=Array.from({length:e*s});return(0,t.jsx)("div",{className:`grid gap-[1px] w-7 h-5 p-[3px] rounded-sm border shrink-0 ${r?"border-primary bg-primary/10":"border-border bg-muted"}`,style:{gridTemplateColumns:`repeat(${e}, 1fr)`,gridTemplateRows:`repeat(${s}, 1fr)`},children:i.map((e,s)=>(0,t.jsx)("div",{className:`rounded-[1px] min-w-0 min-h-0 ${r?"bg-primary":"bg-muted-foreground/40"}`},s))})}let x="custom";function g({value:e,customValue:i,onChange:n}){let{t:a}=(0,r.useI18n)(),[l,u]=(0,s.useState)(!1),d=(0,s.useRef)(null),h=e===x,p=h?null:o.find(t=>t.id===e)??o[2],[v,y]=(0,s.useState)(i?.cols??2),[b,C]=(0,s.useState)(i?.rows??2),[k,j]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5});(0,s.useEffect)(()=>{(0,m.getConfigValues)(["missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{j({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{i&&(y(i.cols),C(i.rows))},[i?.cols,i?.rows]),(0,s.useEffect)(()=>{if(l)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){d.current&&!d.current.contains(e.target)&&u(!1)}},[l]);let w=(e,t,s)=>Math.max(t,Math.min(s,e)),A=h?v:p?.cols??2,S=h?b:p?.rows??2,N=h?`${v}\xd7${b}`:p?.label??"";return(0,t.jsxs)("div",{ref:d,className:"relative",children:[(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>u(e=>!e),className:"gap-2",children:[(0,t.jsx)(f,{cols:A,rows:S,active:!1}),(0,t.jsx)("span",{children:N}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:"β–Ό"})]}),l&&(0,t.jsxs)("div",{className:"absolute right-0 z-50 mt-1 w-72 rounded-lg border border-border bg-popover shadow-xl p-3",children:[(0,t.jsx)("h5",{className:"text-sm font-semibold text-foreground mb-3",children:a("missions.gridPreset")}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[o.map(s=>{let r=s.id===e;return(0,t.jsxs)("button",{onClick:()=>{n(s.id),u(!1)},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${r?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:s.cols,rows:s.rows,active:r}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${r?"text-primary":"text-foreground"}`,children:s.label}),(0,t.jsx)("span",{className:`text-xs ${r?"text-primary/60":"text-muted-foreground"}`,children:s.desc})]},s.id)}),(0,t.jsxs)("div",{className:"mt-1 border-t border-border pt-2",children:[(0,t.jsxs)("button",{onClick:()=>{h||n(x,{cols:v,rows:b})},className:`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors w-full ${h?"bg-primary/10":"hover:bg-accent"}`,children:[(0,t.jsx)(f,{cols:v,rows:b,active:h}),(0,t.jsx)("span",{className:`text-sm font-medium flex-1 text-left ${h?"text-primary":"text-foreground"}`,children:a("missions.gridCustom")}),(0,t.jsxs)("span",{className:`text-xs ${h?"text-primary/60":"text-muted-foreground"}`,children:[v,"Γ—",b]})]}),h&&(0,t.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:a("missions.gridCols")}),(0,t.jsx)("input",{type:"number",min:k.minCols,max:k.maxCols,value:v,onChange:e=>{let t;y(t=w(Number(e.target.value),k.minCols,k.maxCols)),n(x,{cols:t,rows:b})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]}),(0,t.jsx)("span",{className:"text-muted-foreground",children:"Γ—"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:a("missions.gridRows")}),(0,t.jsx)("input",{type:"number",min:k.minRows,max:k.maxRows,value:b,onChange:e=>{let t;C(t=w(Number(e.target.value),k.minRows,k.maxRows)),n(x,{cols:v,rows:t})},className:"h-7 w-14 rounded-md border border-border bg-background px-2 text-sm text-center"})]})]})]})]})]})]})}var p=e.i(720247),v=e.i(775712),y=e.i(19578),b=e.i(538059),C=e.i(67013);let k=(0,d.default)("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),j=(0,d.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var w=e.i(657153);let A=(0,d.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var S=e.i(746798),N=e.i(487486),E=e.i(796320),I=e.i(360112);let M=(0,y.default)(()=>e.A(243288).then(e=>e.TaskTerminal),{loadableGenerated:{modules:[346069]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"h-full w-full bg-[#0a0a0a] animate-pulse"})});function D({execution:e,isRemoving:i,removeReason:n,onStop:a,onSessionEnd:o}){let{t:l}=(0,r.useI18n)(),u=(0,b.useRouter)(),{attributes:d,listeners:h,setNodeRef:m,transform:f,transition:x}=(0,v.useSortable)({id:e.executionId}),g={transform:C.CSS.Transform.toString(f),transition:x,opacity:+!i},[p,y]=(0,s.useState)(()=>e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0);(0,s.useEffect)(()=>{if(i)return;let t=setInterval(()=>{y(e.startedAt?Math.floor((Date.now()-new Date(e.startedAt).getTime())/1e3):0)},1e3);return()=>clearInterval(t)},[e.startedAt,i]);let B=Math.floor(p/60),_=`${B}m ${p%60}s`;async function F(){if(e.projectLocalPath)try{await (0,E.openInTerminal)(e.projectLocalPath)}catch{I.toast.error(l("preview.terminalError"))}}return(0,t.jsxs)("div",{ref:m,style:g,className:"border border-border rounded-lg overflow-hidden flex flex-col transition-opacity duration-300",...d,children:[(0,t.jsxs)("div",{className:"h-10 px-3 flex items-center gap-1 border-b border-border bg-card shrink-0",children:[(0,t.jsx)("button",{...h,"aria-label":l("missions.dragHandle"),"aria-roledescription":"sortable",className:"cursor-grab text-muted-foreground hover:text-foreground mr-1",children:(0,t.jsx)(k,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground truncate flex-1",children:[e.workspaceName," β€Ί"," ",e.projectAlias||e.projectName," β€Ί"," ",(0,t.jsx)("span",{className:"text-foreground font-semibold",children:e.taskTitle})]}),i?(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-muted-foreground bg-muted ml-1 shrink-0",children:"stopped"===n?l("missions.statusStopped"):l("missions.statusCompleted")}):(0,t.jsx)(N.Badge,{variant:"outline",className:"text-[11px] text-primary border-primary/30 bg-primary/10 ml-1 shrink-0",children:l("missions.statusRunning")}),(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground ml-1 shrink-0",children:_}),e.projectLocalPath&&(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:F}),children:(0,t.jsx)(A,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.openInTerminal")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"ghost",size:"icon",className:"ml-1 shrink-0 text-muted-foreground",onClick:()=>u.push(`/workspaces/${e.workspaceId}/tasks/${e.taskId}`)}),children:(0,t.jsx)(j,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.openFullView")})]}),(0,t.jsxs)(S.Tooltip,{children:[(0,t.jsx)(S.TooltipTrigger,{render:(0,t.jsx)(c.Button,{variant:"destructive",size:"icon",className:"ml-1 shrink-0",onClick:()=>a(e.taskId),disabled:i}),children:(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(S.TooltipContent,{children:l("missions.stopTask")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,t.jsx)(M,{taskId:e.taskId,worktreePath:e.worktreePath??e.projectLocalPath,onSessionEnd:t=>o?.(e.taskId,t),useCanvasRenderer:!0})})]})}var B=e.i(169751);let _=(0,i.createServerReference)("40751310b9350100344fa26aa52c50f0a574d2119d",i.callServer,void 0,i.findSourceMapURL,"getWorkspacesWithRecentTasks"),F=(0,i.createServerReference)("40511a7eb587330f02b0e505c3b4034130179358f2",i.callServer,void 0,i.findSourceMapURL,"getProjectTasks");var R=e.i(213686),T=e.i(211576),L=e.i(793479),$=e.i(776639),O=e.i(368490);let P=(0,d.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);var z=e.i(922541),W=e.i(738690),H=e.i(759684);let V={TODO:"TODO",IN_PROGRESS:"Running",IN_REVIEW:"Review"},U={LOW:"Low",MEDIUM:"Med",HIGH:"High",CRITICAL:"Crit"};function K({status:e}){return(0,t.jsx)("span",{className:`text-[10px] px-1.5 py-0.5 rounded font-medium ${{TODO:"bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400",IN_PROGRESS:"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",IN_REVIEW:"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400"}[e]??"bg-slate-100 text-slate-600"}`,children:V[e]??e})}function q({task:e,isRunning:s,launchingId:r,onLaunchNew:i,onResume:n,t:a}){let o=e.executions?.[0]?.sessionId,l=r===e.id;return(0,t.jsxs)("div",{className:"group/task grid grid-cols-[minmax(0,1fr)_auto] items-center gap-2 px-3 py-1.5 hover:bg-accent/50 cursor-default",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("p",{className:`text-sm truncate ${s?"italic text-muted-foreground":""}`,children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mt-0.5",children:[(0,t.jsx)(K,{status:e.status}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:U[e.priority]??e.priority})]})]}),s?(0,t.jsx)("span",{className:"text-[10px] italic text-muted-foreground",children:a("missions.alreadyMonitored")}):(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover/task:opacity-100 transition-opacity",children:[o&&(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>n(e.id,o),disabled:l,title:a("missions.continueSession"),children:[(0,t.jsx)(z.RotateCcw,{className:"h-3 w-3 mr-1"}),a("missions.continueLabel")]}),(0,t.jsxs)(c.Button,{variant:"outline",className:"h-6 px-2 text-xs",onClick:()=>i(e.id),disabled:l,title:a("missions.launchNew"),children:[(0,t.jsx)(P,{className:"h-3 w-3 mr-1"}),l?"...":a("missions.launchNewLabel")]})]})]})}function G({open:e,onOpenChange:i,onLaunchNew:n,onResume:a,runningTaskIds:o,launchingId:u}){let{t:d}=(0,r.useI18n)(),[h,m]=(0,s.useState)([]),[f,x]=(0,s.useState)(""),[g,p]=(0,s.useState)(""),[v,y]=(0,s.useState)([]),[b,C]=(0,s.useState)("");(0,s.useEffect)(()=>{e&&(x(""),p(""),y([]),C(""),_(100).then(m).catch(()=>I.toast.error(d("missions.error.launchFailed"))))},[e,d]),(0,s.useEffect)(()=>{g?F(g).then(e=>{y(e.filter(e=>"TODO"===e.status||"IN_PROGRESS"===e.status||"IN_REVIEW"===e.status))}).catch(()=>I.toast.error(d("missions.error.launchFailed"))):y([])},[g,d]);let k=(0,s.useMemo)(()=>{let e=[];for(let t of h)for(let s of t.projects)for(let r of s.tasks)("TODO"===r.status||"IN_PROGRESS"===r.status||"IN_REVIEW"===r.status)&&e.push({task:r,workspaceName:t.name,projectName:s.alias??s.name});return e},[h]),j=(0,s.useMemo)(()=>new B.default(k,{keys:["task.title"],threshold:.4,distance:200}),[k]),A=(0,s.useMemo)(()=>{let e=b.trim();return e?j.search(e,{limit:30}).map(e=>e.item):[]},[j,b]),S=b.trim().length>0,N=h.find(e=>e.id===f),E=N?.projects??[];return(0,t.jsx)($.Dialog,{open:e,onOpenChange:i,children:(0,t.jsxs)($.DialogContent,{className:"sm:max-w-2xl max-h-[80vh]",children:[(0,t.jsx)($.DialogHeader,{children:(0,t.jsx)($.DialogTitle,{children:d("missions.fullPickerTitle")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 shrink-0",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(W.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,t.jsx)(L.Input,{value:b,onChange:e=>C(e.target.value),placeholder:d("missions.fullPicker.searchPlaceholder"),className:"pl-8 pr-8 h-8"}),b&&(0,t.jsx)(c.Button,{type:"button",variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6",onClick:()=>C(""),"aria-label":d("missions.fullPicker.clearSearch"),children:(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"})})]}),!S&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(l.Select,{value:f,onValueChange:e=>{x(e??""),p("")},children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-ws",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:h.find(e=>e.id===f)?.name??d("missions.launcher.selectWorkspace")})}),(0,t.jsx)(l.SelectContent,{children:h.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))})]}),(0,t.jsxs)(l.Select,{value:g,onValueChange:e=>p(e??""),disabled:!f,children:[(0,t.jsx)(l.SelectTrigger,{id:"full-picker-proj",className:"w-48 h-8",children:(0,t.jsx)("span",{className:"truncate",children:E.find(e=>e.id===g)?.name??d("missions.launcher.selectProject")})}),(0,t.jsx)(l.SelectContent,{children:E.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.alias??e.name},e.id))})]})]})]}),(0,t.jsx)(H.ScrollArea,{className:"max-h-[60vh] -mx-2",children:S?0===A.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPicker.noSearchResults")}):A.map(e=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"px-3 pt-2 pb-0.5 text-[11px] text-muted-foreground",children:[e.workspaceName," Β· ",e.projectName]}),(0,t.jsx)(q,{task:e.task,isRunning:o.has(e.task.id),launchingId:u,onLaunchNew:n,onResume:a,t:d})]},e.task.id)):0===v.length&&g?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.launcher.noTasks")}):0===v.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:d("missions.fullPickerHint")}):v.map(e=>(0,t.jsx)(q,{task:e,isRunning:o.has(e.id),launchingId:u,onLaunchNew:n,onResume:a,t:d},e.id))})]})})}function J({open:e,onOpenChange:i,onLaunched:n,runningTaskIds:a=new Set,anchorRef:o}){let{t:l}=(0,r.useI18n)(),u=(0,s.useRef)(null),[d,h]=(0,s.useState)([]),[m,f]=(0,s.useState)(!1),[x,g]=(0,s.useState)(null),[p,v]=(0,s.useState)(!1),[y,b]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{e&&(f(!0),_(5).then(h).catch(()=>I.toast.error(l("missions.error.launchFailed"))).finally(()=>f(!1)))},[e,l]);let C=(0,s.useMemo)(()=>d.filter(e=>e.projects.some(e=>e._count.tasks>0)),[d]),k=(0,s.useCallback)(e=>{b(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);(0,s.useEffect)(()=>{if(e)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t);function t(e){let t=e.target;if(u.current&&!u.current.contains(t)){if(o?.current&&o.current.contains(t))return;i(!1)}}},[e,i,o]);let j=(0,s.useCallback)(async e=>{try{g(e),await (0,R.startPtyExecution)(e,""),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),w=(0,s.useCallback)(async(e,t)=>{try{g(e),await (0,T.resumePtyExecution)(e,t),n(e),i(!1),v(!1)}catch{I.toast.error(l("missions.error.launchFailed"))}finally{g(null)}},[n,i,l]),A=(0,s.useCallback)(()=>{i(!1),v(!0)},[i]);return e||p?(0,t.jsxs)(t.Fragment,{children:[e&&(0,t.jsxs)("div",{ref:u,className:"absolute right-0 z-50 mt-1 grid max-h-[480px] w-[28rem] grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"px-3 py-2 border-b border-border",children:(0,t.jsx)("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wide",children:l("missions.pickerTitle")})}),(0,t.jsx)(H.ScrollArea,{children:m?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:"Loading..."}):0===C.length?(0,t.jsx)("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:l("missions.noAvailableTasks")}):C.map(e=>{let s=y.has(e.id),r=e.projects.filter(e=>e._count.tasks>0);return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",onClick:()=>k(e.id),className:"flex h-auto w-full justify-start gap-1.5 rounded-none border-b border-border/50 px-3 py-1.5 hover:bg-accent",children:[(0,t.jsx)(O.ChevronRight,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform ${s?"":"rotate-90"}`}),(0,t.jsx)("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:e.name})]}),!s&&(0,t.jsx)("div",{className:"ml-[19px] mt-0.5 border-l border-border/50",children:r.map(e=>(0,t.jsxs)("div",{className:"py-0.5",children:[(0,t.jsx)("div",{className:"pl-3 pt-1.5 pb-1",children:(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:e.alias??e.name})}),(0,t.jsx)("div",{className:"pl-3",children:e.tasks.map(e=>(0,t.jsx)(q,{task:e,isRunning:a.has(e.id),launchingId:x,onLaunchNew:j,onResume:w,t:l},e.id))})]},e.id))})]},e.id)})}),(0,t.jsx)("div",{className:"border-t border-border",children:(0,t.jsx)(c.Button,{variant:"ghost",className:"w-full rounded-none text-xs text-primary font-medium",onClick:A,children:l("missions.showMoreTasks")})})]}),(0,t.jsx)(G,{open:p,onOpenChange:v,onLaunchNew:j,onResume:w,runningTaskIds:a,launchingId:x})]}):null}e.s(["MissionsClient",0,function({initialExecutions:e}){let{t:i}=(0,r.useI18n)(),[d,m]=(0,s.useState)(e),[f,x]=(0,s.useState)(()=>localStorage.getItem("missions-grid-preset")??"3x2"),[y,b]=(0,s.useState)(()=>{try{let e=localStorage.getItem("missions-grid-custom");if(e){let t=JSON.parse(e);if("number"==typeof t?.cols&&"number"==typeof t?.rows)return{cols:Math.max(1,Math.min(10,t.cols)),rows:Math.max(1,Math.min(10,t.rows))}}}catch{}return{cols:2,rows:2}}),[C,k]=(0,s.useState)(!1),[j,w]=(0,s.useState)(""),A=(0,s.useRef)(null),[S,N]=(0,s.useState)(new Map),E=(0,s.useRef)(S);(0,s.useEffect)(()=>{E.current=S},[S]);let M=(0,s.useRef)(new Map),B=o.find(e=>e.id===f)??o[2],_="custom"===f?y.cols:B.cols,F="custom"===f?y.rows:B.rows,R=(0,s.useRef)(null),[T,L]=(0,s.useState)("480px");(0,s.useEffect)(()=>{let e=R.current;if(!e)return;let t=()=>{let t=(e.clientHeight-32-16*(F-1))/F;L(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[F]);let $=(0,s.useCallback)((e,t)=>{e&&(x(e),localStorage.setItem("missions-grid-preset",e),"custom"===e&&t&&(b(t),localStorage.setItem("missions-grid-custom",JSON.stringify(t))))},[]),O=(0,p.useSensors)((0,p.useSensor)(p.PointerSensor,{activationConstraint:{distance:8}})),P=(0,s.useCallback)(e=>{let{active:t,over:s}=e;s&&t.id!==s.id&&m(e=>{let r=e.findIndex(e=>e.executionId===t.id),i=e.findIndex(e=>e.executionId===s.id);return(0,v.arrayMove)(e,r,i)})},[]),z=(0,s.useCallback)((e,t)=>{if(E.current.has(e))return;N(s=>new Map([...s,[e,t]]));let s=setTimeout(()=>{m(t=>t.filter(t=>t.executionId!==e)),N(t=>{let s=new Map(t);return s.delete(e),s}),M.current.delete(e)},500);M.current.set(e,s)},[]);(0,s.useEffect)(()=>{let e=setInterval(async()=>{try{let e=await n();m(t=>{let s=E.current,{merged:r,goneIds:i}=function({prev:e,fresh:t,removingIds:s}){let r=new Set(t.map(e=>e.executionId)),i=[];e.forEach(e=>{r.has(e.executionId)||s.has(e.executionId)||i.push(e.executionId)});let n=e.filter(e=>r.has(e.executionId)||s.has(e.executionId)),a=new Set(e.map(e=>e.executionId));return{merged:[...n,...t.filter(e=>!a.has(e.executionId))],goneIds:i}}({prev:t,fresh:e,removingIds:new Set(s.keys())});return i.forEach(e=>z(e,"completed")),r})}catch{}},4e3);return()=>clearInterval(e)},[z]),(0,s.useEffect)(()=>{let e=M.current;return()=>{e.forEach(e=>clearTimeout(e))}},[]);let W=(0,s.useCallback)(async e=>{try{await (0,a.stopPtyExecution)(e),m(t=>{let s=t.find(t=>t.taskId===e);return s&&z(s.executionId,"stopped"),t})}catch{I.toast.error(i("missions.error.stopFailed"))}},[z,i]),H=(0,s.useCallback)((e,t)=>{m(t=>{let s=t.find(t=>t.taskId===e);return s&&z(s.executionId,"completed"),t})},[z]),V=(0,s.useCallback)(e=>{n().then(e=>{m(t=>{let s=new Set(t.map(e=>e.executionId));return[...t,...e.filter(e=>!s.has(e.executionId))]})}).catch(()=>{})},[]),U=Array.from(new Map(d.map(e=>[e.workspaceId,e.workspaceName])).entries()).map(([e,t])=>({id:e,name:t})),K=j?d.filter(e=>e.workspaceId===j):d,q=new Set(d.map(e=>e.taskId));return(0,t.jsxs)("div",{className:"flex h-full flex-col",children:[(0,t.jsxs)("div",{className:"header-sm shrink-0 px-4 flex items-center gap-3",children:[(0,t.jsx)("h1",{className:"text-base font-semibold",children:i("missions.pageTitle")}),(0,t.jsxs)(l.Select,{value:j,onValueChange:e=>w(e??""),children:[(0,t.jsx)(l.SelectTrigger,{className:"w-36 h-8",children:(0,t.jsx)("span",{className:"truncate",children:j?U.find(e=>e.id===j)?.name??i("missions.filterAll"):i("missions.filterAll")})}),(0,t.jsxs)(l.SelectContent,{children:[(0,t.jsx)(l.SelectItem,{value:"",children:i("missions.filterAll")}),U.map(e=>(0,t.jsx)(l.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsx)(g,{value:f,customValue:y,onChange:$}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(c.Button,{ref:A,onClick:()=>k(e=>!e),children:i("missions.launchTask")}),(0,t.jsx)(J,{open:C,onOpenChange:k,onLaunched:V,runningTaskIds:q,anchorRef:A})]})]}),(0,t.jsx)("div",{ref:R,className:"flex-1 overflow-auto min-h-0 p-4",children:0===K.length&&0===S.size?(0,t.jsx)(u.EmptyState,{icon:h,title:i("missions.emptyTitle"),description:i("missions.emptyDesc"),className:"h-full",action:(0,t.jsx)(c.Button,{onClick:()=>k(!0),children:i("missions.launchTask")})}):(0,t.jsx)(p.DndContext,{id:"missions-dnd",sensors:O,collisionDetection:p.closestCenter,onDragEnd:P,children:(0,t.jsx)(v.SortableContext,{items:K.map(e=>e.executionId),strategy:v.rectSortingStrategy,children:(0,t.jsx)("div",{className:"grid gap-4",style:{gridTemplateColumns:`repeat(${_}, 1fr)`,gridAutoRows:T},children:K.map(e=>(0,t.jsx)(D,{execution:e,isRemoving:S.has(e.executionId),removeReason:S.get(e.executionId),onStop:W,onSessionEnd:H},e.executionId))})})})})]})}],449636)}]);
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,465536,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},930787,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var x="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===x.length?x+="..":x+="/..");return x.length>0?x+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},756502,e=>{"use strict";let t=(0,e.i(572989).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},914935,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(210702),n=e.i(487278),o=e.i(232545),i=e.i(464249),l=e.i(998626),c=e.i(49007),d=e.i(902539),u=e.i(263938),m=e.i(645378),x=e.i(453889),h=e.i(572989);let p=(0,h.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(755146),g=e.i(759684),j=e.i(776639),b=e.i(746798),v=e.i(519455),w=e.i(793479),N=e.i(514798);let y=(0,N.createServerReference)("407cea86bcf79899c6b9ddf2859de4b028adc74d9a",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("605a871303674e0eaf175cb61d233ad574bfe8524c",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("40ee1cdf4e6e9870944d24e557cd3ad748f1815a19",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace");var S=e.i(146518);let T=(0,N.createServerReference)("408c4b068a101ff26430fd9a2eab8da4205b17a155",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("40490ad5bcebd5783c04ddcaea990f816adcf3d62e",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var P=e.i(533499),M=e.i(360112);let R=["πŸ“‹","πŸš€","🎯","πŸ’‘","πŸ”§","πŸ“¦","🎨","πŸ“Š","πŸ”¬","🌟","πŸ“","πŸ—οΈ"];function $({workspaces:e}){let h,j=(0,s.useRouter)(),w=(0,s.usePathname)(),{t:N}=(0,P.useI18n)(),[S,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&T(!0)},[]);let[D,A]=(0,r.useState)(!1),[z,E]=(0,r.useState)(!1),[I,B]=(0,r.useState)(!1),[F,_]=(0,r.useState)(null),[W,U]=(0,r.useState)(""),[H,K]=(0,r.useState)(R[0]),[V,q]=(0,r.useState)(null),X=w.split("/workspaces/")[1]?.split("/")[0],G=(0,r.useCallback)(()=>{T(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),J=(0,r.useCallback)(async()=>{if(!W.trim())return;let e=await y({name:W.trim(),description:H});U(""),K(R[0]),A(!1),j.refresh(),j.push(`/workspaces/${e.id}`)},[W,H,j]),Y=(0,r.useCallback)(async()=>{W.trim()&&V&&(await k(V,{name:W.trim(),description:H}),U(""),E(!1),q(null),j.refresh())},[W,H,V,j]),Z=(0,r.useCallback)(e=>{q(e.id),U(e.name),K(e.description&&R.includes(e.description)?e.description:R[0]),E(!0)},[]),Q=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void M.toast.error(N("sidebar.lastWorkspaceError"));if(confirm(N("sidebar.deleteConfirm",{name:r})))try{await C(t),j.refresh(),X===t&&j.push("/workspaces")}catch{M.toast.error(N("sidebar.lastWorkspaceError"))}},[X,j,N,e.length]),ee=(0,r.useCallback)(e=>{_(e),B(!0)},[]),et=e=>e.description&&R.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(S){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:G,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.expand")})]}),(0,t.jsx)(g.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=X===e.id,s=et(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>{r||j.push(`/workspaces/${e.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>A(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===w?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("missions.navLabel")})]}),(r=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${w.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(m.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${w.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(x.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${w.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.archive")})]})]}):null]}),(0,t.jsx)(O,{open:D,onOpenChange:A,title:N("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:G,className:"text-muted-foreground",title:N("sidebar.collapse"),children:(0,t.jsx)(d.ChevronsLeft,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:N("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{U(""),K(R[0]),A(!0)},title:N("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(g.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:e.map(r=>{var s;let a,n,o,d=X===r.id,m=et(r);return(0,t.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${d?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:()=>{d||j.push(`/workspaces/${r.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${d?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(m)?m:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:m})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${d?"text-foreground":"text-secondary-foreground"}`,children:r.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(s=r.updatedAt,n=Math.floor((a=Date.now()-new Date(s).getTime())/6e4),o=Math.floor(a/36e5),n<60?`${n}m ago`:o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`)})]})]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"mr-2 rounded-md p-1 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)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(f.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>Z(r),children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.rename")]}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>ee(r.id),children:[(0,t.jsx)(u.Tag,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.manageLabels")]}),(0,t.jsxs)(f.DropdownMenuItem,{className:e.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:e.length<=1,onClick:()=>Q(r.id,r.name),children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.delete")]})]})]})]},r.id)})})}),(0,t.jsxs)(a.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===w?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("missions.navLabel")})]}),(h=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${h}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(m.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${h}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${h}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.archive")})]})]}):null,(0,t.jsx)(O,{open:D,onOpenChange:A,title:N("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),(0,t.jsx)(O,{open:z,onOpenChange:e=>{E(e),e||q(null)},title:N("workspace.edit"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:Y,submitLabel:N("common.save"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),F&&(0,t.jsx)(L,{open:I,onOpenChange:e=>{B(e),e||_(null)},workspaceId:F})]})}function O({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:x}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:R.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:x}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let A=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function L({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,P.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(A[0]);(0,r.useEffect)(()=>{e&&(0,S.getLabelsForWorkspace)(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await T({name:l.trim(),color:d,workspaceId:a}),i(await (0,S.getLabelsForWorkspace)(a)),c(""))},x=async e=>{await D(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>x(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:A.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}var z=e.i(821957),E=e.i(738690),I=e.i(386343);let B=(0,h.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var F=e.i(242941),_=e.i(989548),W=e.i(387091),U=e.i(15299);e.s([],678787),e.i(678787),e.i(708878);var H=e.i(581263),K=e.i(462902);let V=r.createContext(void 0);function q(){let e=r.useContext(V);if(void 0===e)throw Error((0,K.default)(13));return e}let X={imageLoadingStatus:()=>null},G=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:X});return(0,t.jsx)(V.Provider,{value:c,children:d})});var J=e.i(887642),Y=e.i(804849),Z=e.i(504068),Q=e.i(809058),ee=e.i(193214),et=e.i(954588);let er={...X,...Q.transitionStatusMapping},es=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=q(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,Y.useIsoLayoutEffect)(()=>{if(!e)return n("error"),et.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:x,setMounted:h}=(0,ee.useTransitionStatus)(u),p=r.useRef(null),f=(0,J.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,Y.useIsoLayoutEffect)(()=>{"idle"!==d&&f(d)},[d,f]),(0,Z.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||h(!1)}});let g=(0,H.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:x},ref:[t,p],props:l,stateAttributesMapping:er,enabled:m});return m?g:null});var ea=e.i(161476);let en=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=q(),[l,c]=r.useState(void 0===n),d=(0,ea.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:X,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,en,"Image",0,es,"Root",0,G],129448);var eo=e.i(129448),eo=eo,ei=e.i(975157);function el({className:e,size:r="default",...s}){return(0,t.jsx)(eo.Root,{"data-slot":"avatar","data-size":r,className:(0,ei.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...s})}function ec({className:e,...r}){return(0,t.jsx)(eo.Fallback,{"data-slot":"avatar-fallback",className:(0,ei.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let ed=(0,h.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var eu=e.i(226145);let em=(0,h.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),ex=(0,h.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var eh=e.i(657153);let ep=(0,N.createServerReference)("604d188e861acf619c5baf2856feff3fe637de7bdc",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var ef=e.i(153421);let eg=[{id:"all",key:"search.all",icon:E.Search},{id:"task",key:"search.task",icon:m.FileText},{id:"project",key:"search.project",icon:ed},{id:"repository",key:"search.repository",icon:eu.GitBranch},{id:"note",key:"search.note",icon:em},{id:"asset",key:"search.asset",icon:ex}],ej=["task","project","repository","note","asset"],eb={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function ev({result:e,onSelect:r}){let s=eg.find(t=>t.id===e.type)?.icon??m.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function ew({open:e,onOpenChange:a}){let n,{t:o}=(0,P.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,x]=(0,r.useState)([]),[h,p]=(0,r.useState)(!1),[f,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,ef.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),x([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){x([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ep(l,d);e||(x(t),p(!1))},f),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,f]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(E.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),x([])},className:"text-muted-foreground",children:(0,t.jsx)(eh.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eg.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(g.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!h&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),ej.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(eb[e])}),n[e].map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eN=e.i(338187),ey=e.i(400355),ek=e.i(597746),eC=e.i(938499),eS=e.i(233274),eT=e.i(905455),eD=e.i(624687);function eP(e){return e.replace(/\.git\/?$/,"")}e.i(465536),e.i(930787);let eM=(0,N.createServerReference)("40622ab6a12749e686c5f41a4069429783a2b1679e",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eR=e.i(435134),e$=e.i(224277);function eO({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)("idle"),[D,R]=(0,r.useState)(""),[$,O]=(0,r.useState)(!1),[A,L]=(0,r.useState)(!1),z=()=>{l(""),d(""),m(""),p(""),g(""),y(!1),C("FRONTEND"),T("idle"),R(""),O(!1)},E=async()=>{if(f.trim()&&!$&&"success"===S){O(!0);try{let e=await (0,eR.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{M.toast.error(n("project.analyzeError"))}finally{O(!1)}}},I=async e=>{p(e),T("idle"),R("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eP(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eP(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),N||g(await eM(e))},B=async()=>{if(h.trim()&&f.trim()){T("cloning"),R("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(h.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:f.trim()})}),r=await t.json();if(!t.ok){T("error"),R(r.error||"Clone failed");return}T("success")}catch{T("error"),R("Network error")}}},F=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:h.trim()||void 0,localPath:f.trim()||void 0,projectType:k}),z(),s(!1))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||z()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:h,onChange:e=>I(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:f,onChange:e=>{g(e.target.value),y(!0)},className:"flex-1 min-w-0 font-mono text-xs"}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"outline",onClick:()=>L(!0),className:"shrink-0 gap-1.5 px-2.5 text-xs text-muted-foreground"}),children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("folder.browse")})]}),(0,t.jsx)(b.TooltipContent,{children:n("folder.selectFolder")})]})]}),f.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),h.trim()&&f.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===S||"success"===S,onClick:B,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===S?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===S?(0,t.jsx)(ek.Check,{className:"h-3 w-3"}):(0,t.jsx)(eu.GitBranch,{className:"h-3 w-3"}),"cloning"===S?n("git.cloning"):"success"===S?n("git.cloned"):n("git.clone")]}),"error"===S&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),D]}),"success"===S&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:E,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f.trim()||$?"opacity-50":""}`}),children:[$?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),$?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f.trim()?"success"!==S?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,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)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),z()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:F,disabled:!i.trim()||$,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})}),(0,t.jsx)(e$.FolderBrowserDialog,{open:A,onOpenChange:L,onSelect:e=>{if(g(e),y(!0),!i.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";t&&l(t)}}})]})}var eA=e.i(756502),eA=eA,eL=e.i(699375);let ez=(0,N.createServerReference)("60d9158dfaa5ddb9b12e8aaea8df1752690d3f2ad9",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eE=(0,N.createServerReference)("4066b5ea9c89d1e11b63c06866a5e44403fc00735b",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eI({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[D,R]=(0,r.useState)(!1),[$,O]=(0,r.useState)(""),[A,L]=(0,r.useState)(!1),[z,E]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[W,U]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),g(""),C("FRONTEND"),T(!1),R(!1),O(""),L(!1),E(""),B(""),_(!1),U(!1)},K=async e=>{g(e),T(!1),R(!1),O(""),E(""),B(""),_(!1),l(e.split("/").filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(R(e),E(""),B(""),_(!1),!e)return void O("");if(h)try{let e=await eM(h);e&&(O(e),e===f&&_(!0))}catch{}if(f)try{let e=await fetch(`/api/git?path=${encodeURIComponent(f)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[h,f]),q=async()=>{if(f&&!W){U(!0);try{let e=await (0,eR.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{M.toast.error(n("project.analyzeError"))}finally{U(!1)}}},X=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:h.trim()||void 0,localPath:f.trim()||void 0,projectType:k},t=await a?.(e);if(D&&$&&$!==f&&t&&"id"in t){L(!0),E("");try{let e=await eE(t.id);if(!e.safe)return void E(e.reason);let r=await ez(t.id,$);if(!r.success)return void E(r.error??n("project.migrateError"));M.toast.success(n("project.migrateSuccess"))}catch(t){let e=t instanceof Error?t.message:String(t);E(`${n("project.migrateError")}:${e}`);return}finally{L(!1)}}H(),s(!1)},G=!i.trim()||!f.trim()||A||W||D&&!!I;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 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)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:f,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),h&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:h,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&f&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eL.Switch,{checked:D,onCheckedChange:e=>V(e)})]}),D&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:$,onChange:e=>{O(e.target.value),_(e.target.value===f)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(eA.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),I&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),I]}),z&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),z]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:q,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f||W?"opacity-50":""}`}),children:[W?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),W?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,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)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:X,disabled:G,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:A?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(e$.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eB({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,P.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eN.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:h}=function(){let{resolvedTheme:e,setTheme:t}=(0,z.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[g,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),j(!0))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(E.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,t.jsx)(B,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(_.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(F.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"δΈ­"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:h,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(W.Sun,{className:"h-4 w-4"}):(0,t.jsx)(U.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(el,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ec,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(f.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(I.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(ew,{open:g,onOpenChange:j}),(0,t.jsx)(eO,{open:w,onOpenChange:N,onCreateProject:e}),(0,t.jsx)(eI,{open:y,onOpenChange:k,onCreateProject:e})]})}var eF=e.i(83434),e_=e.i(966001),eW=e.i(874456),eU=e.i(19578),eH=e.i(232280);let eK=(0,eU.default)(()=>e.A(427768).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[103363]},ssr:!1});function eV({mode:e}){let{isOpen:r,closeAssistant:s,sessions:a,activeSessionId:n,createNewSession:i,switchSession:c,removeSession:d}=(0,eN.useAssistant)(),{t:u}=(0,P.useI18n)(),m=a.find(e=>e.id===n),x=m?.title??u("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(_.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:u("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsxs)(f.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":u("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:x}),(0,t.jsx)(eH.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(f.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===a.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:u("assistant.noSessions")}):a.map(e=>(0,t.jsxs)(f.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>c(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),d(e.id)},"aria-label":u("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id)),a.length>0&&(0,t.jsx)(f.DropdownMenuSeparator,{}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:i,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:u("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:i,"aria-label":u("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:s,"aria-label":u("assistant.closeLabel"),children:(0,t.jsx)(eh.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:r?(0,t.jsx)(eK,{}):null})]})}var eq=e.i(125177);function eX({onDismiss:e}){let{t:s}=(0,P.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,t.jsx)(eq.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var eG=e.i(701800),eJ=e.i(127245);let eY=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function eZ({onComplete:e}){let{t:s}=(0,P.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=eY[a],m=(0,r.useCallback)(async()=>{await (0,eJ.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),x=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),h=(0,r.useCallback)(()=>{let e=x();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[x]);(0,r.useEffect)(()=>{h();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=x();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!x()&&(n(e=>{let t=e+1;return t<eY.length?t:e}),a>=eY.length-1&&m())},5e3));let t=()=>h();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,x,h,l,m]),(0,r.useEffect)(()=>{let e=setInterval(h,1e3);return()=>clearInterval(e)},[h]);let p=(0,r.useCallback)(()=>{a<eY.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,465536,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},930787,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var x="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===x.length?x+="..":x+="/..");return x.length>0?x+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},756502,e=>{"use strict";let t=(0,e.i(572989).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},914935,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(210702),n=e.i(487278),o=e.i(232545),i=e.i(464249),l=e.i(998626),c=e.i(49007),d=e.i(902539),u=e.i(263938),m=e.i(645378),x=e.i(453889),h=e.i(572989);let p=(0,h.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(755146),g=e.i(759684),j=e.i(776639),b=e.i(746798),v=e.i(519455),w=e.i(793479),N=e.i(514798);let y=(0,N.createServerReference)("4000b86f5bfe093c8d9ceb2b479cff29bed251c59b",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("608a99d9a2669ed96943c43726a58d3ce856ed7dfe",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("408951e5f625fa28f50984317bfc30a553ec34a316",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace");var S=e.i(497062);let T=(0,N.createServerReference)("4017c55bf87cb8154bf0a881c604e56c85b9d85362",N.callServer,void 0,N.findSourceMapURL,"createLabel"),D=(0,N.createServerReference)("40cfc10d2b13f3e5d43ec7aba8d830e732aa4dff27",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var P=e.i(533499),M=e.i(360112);let R=["πŸ“‹","πŸš€","🎯","πŸ’‘","πŸ”§","πŸ“¦","🎨","πŸ“Š","πŸ”¬","🌟","πŸ“","πŸ—οΈ"];function $({workspaces:e}){let h,j=(0,s.useRouter)(),w=(0,s.usePathname)(),{t:N}=(0,P.useI18n)(),[S,T]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&T(!0)},[]);let[D,A]=(0,r.useState)(!1),[z,E]=(0,r.useState)(!1),[I,B]=(0,r.useState)(!1),[F,_]=(0,r.useState)(null),[W,U]=(0,r.useState)(""),[H,K]=(0,r.useState)(R[0]),[V,q]=(0,r.useState)(null),X=w.split("/workspaces/")[1]?.split("/")[0],G=(0,r.useCallback)(()=>{T(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),J=(0,r.useCallback)(async()=>{if(!W.trim())return;let e=await y({name:W.trim(),description:H});U(""),K(R[0]),A(!1),j.refresh(),j.push(`/workspaces/${e.id}`)},[W,H,j]),Y=(0,r.useCallback)(async()=>{W.trim()&&V&&(await k(V,{name:W.trim(),description:H}),U(""),E(!1),q(null),j.refresh())},[W,H,V,j]),Z=(0,r.useCallback)(e=>{q(e.id),U(e.name),K(e.description&&R.includes(e.description)?e.description:R[0]),E(!0)},[]),Q=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void M.toast.error(N("sidebar.lastWorkspaceError"));if(confirm(N("sidebar.deleteConfirm",{name:r})))try{await C(t),j.refresh(),X===t&&j.push("/workspaces")}catch{M.toast.error(N("sidebar.lastWorkspaceError"))}},[X,j,N,e.length]),ee=(0,r.useCallback)(e=>{_(e),B(!0)},[]),et=e=>e.description&&R.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(S){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:G,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.expand")})]}),(0,t.jsx)(g.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=X===e.id,s=et(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>{r||j.push(`/workspaces/${e.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>A(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===w?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("missions.navLabel")})]}),(r=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${w.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(m.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${w.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(x.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>j.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${w.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:N("sidebar.archive")})]})]}):null]}),(0,t.jsx)(O,{open:D,onOpenChange:A,title:N("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:G,className:"text-muted-foreground",title:N("sidebar.collapse"),children:(0,t.jsx)(d.ChevronsLeft,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:N("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{U(""),K(R[0]),A(!0)},title:N("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(g.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:e.map(r=>{var s;let a,n,o,d=X===r.id,m=et(r);return(0,t.jsxs)("div",{className:`group relative flex items-center rounded-lg transition-all ${d?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:()=>{d||j.push(`/workspaces/${r.id}`)},className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${d?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:R.includes(m)?m:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:m})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${d?"text-foreground":"text-secondary-foreground"}`,children:r.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(s=r.updatedAt,n=Math.floor((a=Date.now()-new Date(s).getTime())/6e4),o=Math.floor(a/36e5),n<60?`${n}m ago`:o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`)})]})]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"mr-2 rounded-md p-1 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)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(f.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>Z(r),children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.rename")]}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>ee(r.id),children:[(0,t.jsx)(u.Tag,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.manageLabels")]}),(0,t.jsxs)(f.DropdownMenuItem,{className:e.length<=1?"text-muted-foreground opacity-50":"text-rose-400",disabled:e.length<=1,onClick:()=>Q(r.id,r.name),children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),N("sidebar.delete")]})]})]})]},r.id)})})}),(0,t.jsxs)(a.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===w?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("missions.navLabel")})]}),(h=X||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${h}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(m.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${h}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${h}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:N("sidebar.archive")})]})]}):null,(0,t.jsx)(O,{open:D,onOpenChange:A,title:N("workspace.create"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:J,submitLabel:N("common.create"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),(0,t.jsx)(O,{open:z,onOpenChange:e=>{E(e),e||q(null)},title:N("workspace.edit"),name:W,onNameChange:U,icon:H,onIconChange:K,onSubmit:Y,submitLabel:N("common.save"),nameLabel:N("workspace.name"),iconLabel:N("workspace.icon"),namePlaceholder:N("workspace.namePlaceholder"),cancelLabel:N("common.cancel")}),F&&(0,t.jsx)(L,{open:I,onOpenChange:e=>{B(e),e||_(null)},workspaceId:F})]})}function O({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:x}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:R.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:x}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let A=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function L({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,P.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(A[0]);(0,r.useEffect)(()=>{e&&(0,S.getLabelsForWorkspace)(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await T({name:l.trim(),color:d,workspaceId:a}),i(await (0,S.getLabelsForWorkspace)(a)),c(""))},x=async e=>{await D(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>x(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:A.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}var z=e.i(821957),E=e.i(738690),I=e.i(386343);let B=(0,h.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var F=e.i(242941),_=e.i(989548),W=e.i(387091),U=e.i(15299);e.s([],678787),e.i(678787),e.i(708878);var H=e.i(581263),K=e.i(462902);let V=r.createContext(void 0);function q(){let e=r.useContext(V);if(void 0===e)throw Error((0,K.default)(13));return e}let X={imageLoadingStatus:()=>null},G=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:X});return(0,t.jsx)(V.Provider,{value:c,children:d})});var J=e.i(887642),Y=e.i(804849),Z=e.i(504068),Q=e.i(809058),ee=e.i(193214),et=e.i(954588);let er={...X,...Q.transitionStatusMapping},es=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=q(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,Y.useIsoLayoutEffect)(()=>{if(!e)return n("error"),et.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:x,setMounted:h}=(0,ee.useTransitionStatus)(u),p=r.useRef(null),f=(0,J.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,Y.useIsoLayoutEffect)(()=>{"idle"!==d&&f(d)},[d,f]),(0,Z.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||h(!1)}});let g=(0,H.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:x},ref:[t,p],props:l,stateAttributesMapping:er,enabled:m});return m?g:null});var ea=e.i(161476);let en=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=q(),[l,c]=r.useState(void 0===n),d=(0,ea.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,H.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:X,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,en,"Image",0,es,"Root",0,G],129448);var eo=e.i(129448),eo=eo,ei=e.i(975157);function el({className:e,size:r="default",...s}){return(0,t.jsx)(eo.Root,{"data-slot":"avatar","data-size":r,className:(0,ei.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...s})}function ec({className:e,...r}){return(0,t.jsx)(eo.Fallback,{"data-slot":"avatar-fallback",className:(0,ei.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let ed=(0,h.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var eu=e.i(226145);let em=(0,h.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),ex=(0,h.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var eh=e.i(657153);let ep=(0,N.createServerReference)("603738f3d819572368901747e3c7b7c7ceba2d5528",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var ef=e.i(909995);let eg=[{id:"all",key:"search.all",icon:E.Search},{id:"task",key:"search.task",icon:m.FileText},{id:"project",key:"search.project",icon:ed},{id:"repository",key:"search.repository",icon:eu.GitBranch},{id:"note",key:"search.note",icon:em},{id:"asset",key:"search.asset",icon:ex}],ej=["task","project","repository","note","asset"],eb={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function ev({result:e,onSelect:r}){let s=eg.find(t=>t.id===e.type)?.icon??m.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function ew({open:e,onOpenChange:a}){let n,{t:o}=(0,P.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,x]=(0,r.useState)([]),[h,p]=(0,r.useState)(!1),[f,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,ef.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),x([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){x([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ep(l,d);e||(x(t),p(!1))},f),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,f]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(E.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),x([])},className:"text-muted-foreground",children:(0,t.jsx)(eh.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eg.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(g.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!h&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),ej.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(eb[e])}),n[e].map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(ev,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eN=e.i(338187),ey=e.i(400355),ek=e.i(597746),eC=e.i(938499),eS=e.i(233274),eT=e.i(905455),eD=e.i(624687);function eP(e){return e.replace(/\.git\/?$/,"")}e.i(465536),e.i(930787);let eM=(0,N.createServerReference)("40997f72aea4165609c047d5163d5606e1d46bda40",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eR=e.i(787237),e$=e.i(224277);function eO({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)("idle"),[D,R]=(0,r.useState)(""),[$,O]=(0,r.useState)(!1),[A,L]=(0,r.useState)(!1),z=()=>{l(""),d(""),m(""),p(""),g(""),y(!1),C("FRONTEND"),T("idle"),R(""),O(!1)},E=async()=>{if(f.trim()&&!$&&"success"===S){O(!0);try{let e=await (0,eR.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{M.toast.error(n("project.analyzeError"))}finally{O(!1)}}},I=async e=>{p(e),T("idle"),R("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eP(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eP(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),N||g(await eM(e))},B=async()=>{if(h.trim()&&f.trim()){T("cloning"),R("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(h.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:f.trim()})}),r=await t.json();if(!t.ok){T("error"),R(r.error||"Clone failed");return}T("success")}catch{T("error"),R("Network error")}}},F=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:h.trim()||void 0,localPath:f.trim()||void 0,projectType:k}),z(),s(!1))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||z()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:h,onChange:e=>I(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:f,onChange:e=>{g(e.target.value),y(!0)},className:"flex-1 min-w-0 font-mono text-xs"}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"outline",onClick:()=>L(!0),className:"shrink-0 gap-1.5 px-2.5 text-xs text-muted-foreground"}),children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("folder.browse")})]}),(0,t.jsx)(b.TooltipContent,{children:n("folder.selectFolder")})]})]}),f.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),h.trim()&&f.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===S||"success"===S,onClick:B,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===S?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===S?(0,t.jsx)(ek.Check,{className:"h-3 w-3"}):(0,t.jsx)(eu.GitBranch,{className:"h-3 w-3"}),"cloning"===S?n("git.cloning"):"success"===S?n("git.cloned"):n("git.clone")]}),"error"===S&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),D]}),"success"===S&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:E,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f.trim()||$?"opacity-50":""}`}),children:[$?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),$?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f.trim()?"success"!==S?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,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)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),z()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:F,disabled:!i.trim()||$,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})}),(0,t.jsx)(e$.FolderBrowserDialog,{open:A,onOpenChange:L,onSelect:e=>{if(g(e),y(!0),!i.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";t&&l(t)}}})]})}var eA=e.i(756502),eA=eA,eL=e.i(699375);let ez=(0,N.createServerReference)("609c44c07549141a1d3aa685e217e105d01deb136b",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eE=(0,N.createServerReference)("4086d4fac67eb51074663ecda67e6d5c91db6a39f0",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eI({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,P.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[D,R]=(0,r.useState)(!1),[$,O]=(0,r.useState)(""),[A,L]=(0,r.useState)(!1),[z,E]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[W,U]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),g(""),C("FRONTEND"),T(!1),R(!1),O(""),L(!1),E(""),B(""),_(!1),U(!1)},K=async e=>{g(e),T(!1),R(!1),O(""),E(""),B(""),_(!1),l(e.split("/").filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(R(e),E(""),B(""),_(!1),!e)return void O("");if(h)try{let e=await eM(h);e&&(O(e),e===f&&_(!0))}catch{}if(f)try{let e=await fetch(`/api/git?path=${encodeURIComponent(f)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[h,f]),q=async()=>{if(f&&!W){U(!0);try{let e=await (0,eR.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{M.toast.error(n("project.analyzeError"))}finally{U(!1)}}},X=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:h.trim()||void 0,localPath:f.trim()||void 0,projectType:k},t=await a?.(e);if(D&&$&&$!==f&&t&&"id"in t){L(!0),E("");try{let e=await eE(t.id);if(!e.safe)return void E(e.reason);let r=await ez(t.id,$);if(!r.success)return void E(r.error??n("project.migrateError"));M.toast.success(n("project.migrateSuccess"))}catch(t){let e=t instanceof Error?t.message:String(t);E(`${n("project.migrateError")}:${e}`);return}finally{L(!1)}}H(),s(!1)},G=!i.trim()||!f.trim()||A||W||D&&!!I;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 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)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:f,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),h&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:h,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&f&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eL.Switch,{checked:D,onCheckedChange:e=>V(e)})]}),D&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:$,onChange:e=>{O(e.target.value),_(e.target.value===f)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(eA.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),I&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),I]}),z&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eC.AlertCircle,{className:"h-3 w-3"}),z]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(eT.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:q,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f||W?"opacity-50":""}`}),children:[W?(0,t.jsx)(ey.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eS.Sparkles,{className:"h-3 w-3"}),W?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eD.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,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)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:X,disabled:G,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:A?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(e$.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eB({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,P.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eN.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:h}=function(){let{resolvedTheme:e,setTheme:t}=(0,z.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[g,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),j(!0))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(E.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,t.jsx)(B,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(_.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(F.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"δΈ­"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:h,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(W.Sun,{className:"h-4 w-4"}):(0,t.jsx)(U.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(el,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(ec,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(f.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(I.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(ew,{open:g,onOpenChange:j}),(0,t.jsx)(eO,{open:w,onOpenChange:N,onCreateProject:e}),(0,t.jsx)(eI,{open:y,onOpenChange:k,onCreateProject:e})]})}var eF=e.i(83434),e_=e.i(966001),eW=e.i(665884),eU=e.i(19578),eH=e.i(232280);let eK=(0,eU.default)(()=>e.A(427768).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[103363]},ssr:!1});function eV({mode:e}){let{isOpen:r,closeAssistant:s,sessions:a,activeSessionId:n,createNewSession:i,switchSession:c,removeSession:d}=(0,eN.useAssistant)(),{t:u}=(0,P.useI18n)(),m=a.find(e=>e.id===n),x=m?.title??u("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(_.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:u("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsxs)(f.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":u("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:x}),(0,t.jsx)(eH.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(f.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===a.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:u("assistant.noSessions")}):a.map(e=>(0,t.jsxs)(f.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>c(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),d(e.id)},"aria-label":u("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id)),a.length>0&&(0,t.jsx)(f.DropdownMenuSeparator,{}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:i,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:u("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:i,"aria-label":u("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:s,"aria-label":u("assistant.closeLabel"),children:(0,t.jsx)(eh.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:r?(0,t.jsx)(eK,{}):null})]})}var eq=e.i(125177);function eX({onDismiss:e}){let{t:s}=(0,P.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,t.jsx)(eq.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var eG=e.i(740979),eJ=e.i(478578);let eY=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function eZ({onComplete:e}){let{t:s}=(0,P.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=eY[a],m=(0,r.useCallback)(async()=>{await (0,eJ.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),x=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),h=(0,r.useCallback)(()=>{let e=x();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[x]);(0,r.useEffect)(()=>{h();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=x();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!x()&&(n(e=>{let t=e+1;return t<eY.length?t:e}),a>=eY.length-1&&m())},5e3));let t=()=>h();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,x,h,l,m]),(0,r.useEffect)(()=>{let e=setInterval(h,1e3);return()=>clearInterval(e)},[h]);let p=(0,r.useCallback)(()=>{a<eY.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
2
2
  ellipse at ${o.left+o.width/2}px ${o.top+o.height/2}px,
3
3
  transparent ${Math.max(o.width,o.height)}px,
4
4
  rgba(0,0,0,0.6) ${Math.max(o.width,o.height)+30}px