tower-studio 0.2.16 → 0.2.18

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 (305) 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 +24 -24
  13. package/.next/standalone/.next/server/app/_not-found/page.js +5 -5
  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/adapters/test/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/browse-fs/route.js +1 -1
  26. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
  30. package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js +1 -1
  36. package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
  41. package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +1 -1
  47. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/index.html +1 -1
  49. package/.next/standalone/.next/server/app/index.rsc +14 -14
  50. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  51. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
  52. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  53. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
  54. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  55. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  56. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +61 -61
  57. package/.next/standalone/.next/server/app/missions/page.js +7 -7
  58. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  60. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  61. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +24 -24
  62. package/.next/standalone/.next/server/app/onboarding/page.js +5 -5
  63. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  64. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  65. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  66. package/.next/standalone/.next/server/app/onboarding.rsc +16 -16
  67. package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  68. package/.next/standalone/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  69. package/.next/standalone/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  70. package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  71. package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  72. package/.next/standalone/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  73. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  74. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +24 -24
  75. package/.next/standalone/.next/server/app/page.js +5 -5
  76. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  79. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +51 -39
  80. package/.next/standalone/.next/server/app/settings/page.js +6 -6
  81. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  82. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  83. package/.next/standalone/.next/server/app/settings.html +1 -1
  84. package/.next/standalone/.next/server/app/settings.rsc +16 -16
  85. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  86. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  87. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  88. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  89. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  90. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  92. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +166 -130
  93. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +6 -6
  94. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  96. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  97. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +162 -114
  98. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +6 -6
  99. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  100. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  101. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  102. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +54 -54
  103. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +5 -5
  104. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  106. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  107. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +144 -108
  108. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +6 -6
  109. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  110. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  111. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  112. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +24 -24
  113. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +6 -6
  114. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  115. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  117. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +130 -94
  118. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +6 -6
  119. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  120. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  121. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  122. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +100 -76
  123. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +8 -8
  124. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  125. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  126. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  127. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +40 -40
  128. package/.next/standalone/.next/server/app/workspaces/page.js +5 -5
  129. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  130. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  131. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
  132. package/.next/standalone/.next/server/chunks/[externals]__0m5smhl._.js +3 -0
  133. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-0gs-6._.js +3 -0
  134. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +2 -2
  135. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +4 -0
  137. package/.next/standalone/.next/server/chunks/[root-of-the-server]__09p152b._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_6swdz._.js +2 -2
  139. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b-ib~7._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gmwjkc._.js +3 -0
  141. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3ggen._.js +2 -2
  142. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0.0.jeg._.js → [root-of-the-server]__0sy6lau._.js} +2 -2
  143. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~rm9q.._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/[root-of-the-server]__12c9noi._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/src_lib_0aowbzy._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/{0ws9_lucide-react_dist_esm_icons_0dv2bel._.js → 0ws9_lucide-react_dist_esm_icons_0odx0ph._.js} +2 -2
  150. package/.next/standalone/.next/server/chunks/ssr/{_10.d8~a._.js → 0yzm_fuse_js_dist_fuse_mjs_0t4upxy._.js} +2 -2
  151. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__09n4g~p._.js → [root-of-the-server]__01vzmbg._.js} +1 -1
  152. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06.muv_._.js +3 -0
  153. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0-pzjth._.js → [root-of-the-server]__06lecy.._.js} +2 -2
  154. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__083ia54._.js +3 -0
  155. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0qy_98o._.js → [root-of-the-server]__0_0box3._.js} +2 -2
  156. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ad6qqx._.js +3 -0
  157. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vx7inx._.js → [root-of-the-server]__0b~c--d._.js} +2 -2
  158. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0cylhkc._.js +3 -0
  159. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0edxb4j._.js +3 -0
  160. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0o4yodb._.js → [root-of-the-server]__0eql-bn._.js} +2 -2
  161. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__13i_x1.._.js → [root-of-the-server]__0fvk61p._.js} +2 -2
  162. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0s9retv._.js → [root-of-the-server]__0hv-2bi._.js} +2 -2
  163. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hvqdy.._.js +47 -0
  164. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jg4u05._.js +3 -0
  165. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__08g-39i._.js → [root-of-the-server]__0jvh8f3._.js} +2 -2
  166. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0k.hmw2._.js +3 -0
  167. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0wabw~r._.js → [root-of-the-server]__0lxcgi4._.js} +2 -2
  168. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__063j5j2._.js → [root-of-the-server]__0p4-t7d._.js} +1 -1
  169. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0lhroxu._.js → [root-of-the-server]__0p_3kgh._.js} +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__057bwkf._.js → [root-of-the-server]__0t46zla._.js} +1 -1
  171. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07l.j.t._.js → [root-of-the-server]__0ugi0gk._.js} +2 -2
  172. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y.2qv_._.js +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z50.82._.js +30 -0
  174. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0zgzcl5._.js → [root-of-the-server]__0zhkbm~._.js} +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00l2th1._.js → [root-of-the-server]__10t-oa1._.js} +4 -4
  176. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vicp7s._.js → [root-of-the-server]__11_h9vs._.js} +2 -2
  177. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11zjs~k._.js +1 -1
  178. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12so59v._.js +30 -0
  179. package/.next/standalone/.next/server/chunks/ssr/{_0hj6ykf._.js → _0-m6pij._.js} +1 -1
  180. package/.next/standalone/.next/server/chunks/ssr/_0.3p35c._.js +3 -0
  181. package/.next/standalone/.next/server/chunks/ssr/{_0bijc0.._.js → _00vtpb1._.js} +4 -4
  182. package/.next/standalone/.next/server/chunks/ssr/{_00_enfv._.js → _059-b~p._.js} +2 -2
  183. package/.next/standalone/.next/server/chunks/ssr/{_0l0n0gc._.js → _05qfznq._.js} +4 -4
  184. package/.next/standalone/.next/server/chunks/ssr/_0_z.pz4._.js +3 -0
  185. package/.next/standalone/.next/server/chunks/ssr/_0acdkk1._.js +4 -0
  186. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +2 -2
  187. package/.next/standalone/.next/server/chunks/ssr/{_0~~v0og._.js → _0f2quba._.js} +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/{_0jis7fv._.js → _0gy-1oc._.js} +1 -1
  189. package/.next/standalone/.next/server/chunks/ssr/{_0p~.jo1._.js → _0j7t3m6._.js} +3 -3
  190. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  191. package/.next/standalone/.next/server/chunks/ssr/{_0st9b1_._.js → _0lgx4c3._.js} +4 -4
  192. package/.next/standalone/.next/server/chunks/ssr/{_0~fk6kp._.js → _0lwcwkm._.js} +2 -2
  193. package/.next/standalone/.next/server/chunks/ssr/{_11ixey~._.js → _0m2o_3.._.js} +4 -4
  194. package/.next/standalone/.next/server/chunks/ssr/{_0b9lr.2._.js → _0mg_44.._.js} +1 -1
  195. package/.next/standalone/.next/server/chunks/ssr/{_0_in9ut._.js → _0r2el9k._.js} +1 -1
  196. package/.next/standalone/.next/server/chunks/ssr/{_0x_nujv._.js → _0rb.w9u._.js} +3 -3
  197. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  198. package/.next/standalone/.next/server/chunks/ssr/{_0ds16oj._.js → _0s58zbp._.js} +1 -1
  199. package/.next/standalone/.next/server/chunks/ssr/_0tr1l6m._.js +3 -0
  200. package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +1 -1
  201. package/.next/standalone/.next/server/chunks/ssr/_0uj61lm._.js +3 -0
  202. package/.next/standalone/.next/server/chunks/ssr/_0unw1fq._.js +2 -2
  203. package/.next/standalone/.next/server/chunks/ssr/{_0u6n.gw._.js → _0wk5s-y._.js} +4 -4
  204. package/.next/standalone/.next/server/chunks/ssr/{_0i2m-0~._.js → _0y3bnq6._.js} +4 -4
  205. package/.next/standalone/.next/server/chunks/ssr/{_0gk9bhq._.js → _0yt~8-p._.js} +3 -3
  206. package/.next/standalone/.next/server/chunks/ssr/{_08j7--7._.js → _0~dc49z._.js} +1 -1
  207. package/.next/standalone/.next/server/chunks/ssr/{_06d.l~y._.js → _112.xs5._.js} +2 -2
  208. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  209. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  210. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  211. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  212. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  213. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  214. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  215. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  216. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  217. package/.next/standalone/.next/server/chunks/ssr/{src_lib_0f4q-6w._.js → src_lib_0.e1lk4._.js} +1 -1
  218. package/.next/standalone/.next/server/chunks/ssr/{src_lib_09ajdu_._.js → src_lib_08rw1cx._.js} +1 -1
  219. package/.next/standalone/.next/server/chunks/ssr/{src_lib_05wgz5w._.js → src_lib_0a3sg-k._.js} +1 -1
  220. package/.next/standalone/.next/server/chunks/ssr/{src_lib_078780e._.js → src_lib_0hddinr._.js} +1 -1
  221. package/.next/standalone/.next/server/chunks/ssr/src_lib_0hysyqq._.js +3 -0
  222. package/.next/standalone/.next/server/chunks/ssr/src_lib_0mre0hs._.js +3 -0
  223. package/.next/standalone/.next/server/chunks/ssr/src_lib_0nokg1l._.js +3 -0
  224. package/.next/standalone/.next/server/chunks/ssr/src_lib_0occbql._.js +3 -0
  225. package/.next/standalone/.next/server/chunks/ssr/src_lib_0q1is-3._.js +3 -0
  226. package/.next/standalone/.next/server/chunks/ssr/src_lib_0s.1_50._.js +3 -0
  227. package/.next/standalone/.next/server/chunks/ssr/src_lib_0uof9w0._.js +3 -0
  228. package/.next/standalone/.next/server/chunks/ssr/src_lib_0y99vkm._.js +3 -0
  229. package/.next/standalone/.next/server/chunks/ssr/src_lib_119inue._.js +3 -0
  230. package/.next/standalone/.next/server/chunks/ssr/src_lib_open-targets_ts_12a-_~u._.js +3 -0
  231. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  232. package/.next/standalone/.next/server/pages/404.html +1 -1
  233. package/.next/standalone/.next/server/pages/500.html +1 -1
  234. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  235. package/.next/standalone/.next/server/server-reference-manifest.json +524 -410
  236. package/.next/standalone/.next/static/chunks/{0mzr~d4ax.~nx.js → 0-7jzlr9x_qsk.js} +2 -2
  237. package/.next/standalone/.next/static/chunks/{0yrq3rjju-3um.js → 0.rmtqo0qf0kf.js} +1 -1
  238. package/.next/standalone/.next/static/chunks/00nc85hwc2xj-.js +1 -0
  239. package/.next/standalone/.next/static/chunks/02rmsyvjctps8.js +1 -0
  240. package/.next/standalone/.next/static/chunks/{0m_mrbcxwb.xb.js → 03pleaq9wzi71.js} +1 -1
  241. package/.next/standalone/.next/static/chunks/053~sxv8~uet5.js +1 -0
  242. package/.next/standalone/.next/static/chunks/0_._lea4kj-kf.js +1 -0
  243. package/.next/standalone/.next/static/chunks/0_we-0tskn.or.js +1 -0
  244. package/.next/standalone/.next/static/chunks/{0vyurjgr0u8aw.js → 0gs_-avkejs0n.js} +1 -1
  245. package/.next/standalone/.next/static/chunks/0k65.io~ia9.a.js +2 -0
  246. package/.next/standalone/.next/static/chunks/{0d.9mkqrf._kj.js → 0m-4oc7p23~5d.js} +2 -2
  247. package/.next/standalone/.next/static/chunks/0o11wn9vopcqg.js +1 -0
  248. package/.next/standalone/.next/static/chunks/0qc~i8~pr2lr_.js +2 -0
  249. package/.next/standalone/.next/static/chunks/0v_-pz~6z5kwy.js +1 -0
  250. package/.next/standalone/.next/static/chunks/0y42pxoc9pqth.js +1 -0
  251. package/.next/standalone/.next/static/chunks/0z.p-s6d729o-.js +1 -0
  252. package/.next/standalone/.next/static/chunks/10_jn899omgp~.js +1 -0
  253. package/.next/standalone/.next/static/chunks/{10~egz2-vj..3.js → 142u31.7x80ux.js} +2 -2
  254. package/.next/standalone/.next/static/chunks/{0c5ct~fi6oo0x.js → 14ffa1fe.zktf.js} +2 -2
  255. package/.next/standalone/.next/static/chunks/{0_t7890~b8s.q.js → 15ugy0vmnfdus.js} +1 -1
  256. package/.next/standalone/.next/static/chunks/{07idrdtj1o8zu.js → 1634ulzz-40pw.js} +1 -1
  257. package/.next/standalone/.next/static/chunks/187ga_8mny0dq.js +1 -0
  258. package/.next/standalone/package.json +1 -1
  259. package/dist/mcp-server.cjs +62 -7
  260. package/package.json +1 -1
  261. package/.next/standalone/.next/server/chunks/[externals]__12mj_bs._.js +0 -3
  262. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0hclpb.._.js +0 -3
  263. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0mizcpa._.js +0 -4
  264. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e215_h._.js +0 -3
  265. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hc2ab0._.js +0 -3
  266. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n9e~0j._.js +0 -3
  267. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0p_09im._.js +0 -3
  268. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qyxluw._.js +0 -3
  269. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0r54_2f._.js +0 -30
  270. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0vyqspt._.js +0 -30
  271. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__10xwsl4._.js +0 -3
  272. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12c826b._.js +0 -3
  273. package/.next/standalone/.next/server/chunks/ssr/_02yhivm._.js +0 -3
  274. package/.next/standalone/.next/server/chunks/ssr/_0_g2k44._.js +0 -3
  275. package/.next/standalone/.next/server/chunks/ssr/_0kdx-ix._.js +0 -3
  276. package/.next/standalone/.next/server/chunks/ssr/_0ny8sre._.js +0 -4
  277. package/.next/standalone/.next/server/chunks/ssr/_0tj4yhj._.js +0 -3
  278. package/.next/standalone/.next/server/chunks/ssr/_0wxgq36._.js +0 -3
  279. package/.next/standalone/.next/server/chunks/ssr/_0xlxdv6._.js +0 -3
  280. package/.next/standalone/.next/server/chunks/ssr/src_0r5zto-._.js +0 -47
  281. package/.next/standalone/.next/server/chunks/ssr/src_lib_0ffqwve._.js +0 -3
  282. package/.next/standalone/.next/server/chunks/ssr/src_lib_0i-k~x7._.js +0 -3
  283. package/.next/standalone/.next/server/chunks/ssr/src_lib_0jzfhds._.js +0 -3
  284. package/.next/standalone/.next/server/chunks/ssr/src_lib_0kjj12q._.js +0 -3
  285. package/.next/standalone/.next/server/chunks/ssr/src_lib_0lve.hi._.js +0 -3
  286. package/.next/standalone/.next/server/chunks/ssr/src_lib_0pywvqu._.js +0 -3
  287. package/.next/standalone/.next/server/chunks/ssr/src_lib_0tp-g~8._.js +0 -3
  288. package/.next/standalone/.next/server/chunks/ssr/src_lib_0vnqpwi._.js +0 -3
  289. package/.next/standalone/.next/server/chunks/ssr/src_lib_0w9nhfj._.js +0 -3
  290. package/.next/standalone/.next/static/chunks/0.oy-y0w05vbq.js +0 -1
  291. package/.next/standalone/.next/static/chunks/04a2asn0hyy9c.js +0 -1
  292. package/.next/standalone/.next/static/chunks/06uk3fb5mkz5c.js +0 -1
  293. package/.next/standalone/.next/static/chunks/0e8wfpfgivr6t.js +0 -1
  294. package/.next/standalone/.next/static/chunks/0eup3utxhd.9w.js +0 -2
  295. package/.next/standalone/.next/static/chunks/0fysbcldn.s~5.js +0 -1
  296. package/.next/standalone/.next/static/chunks/0husw1q436czh.js +0 -1
  297. package/.next/standalone/.next/static/chunks/0ibjmvk~1lgfl.js +0 -2
  298. package/.next/standalone/.next/static/chunks/0q4_3y9etuu46.js +0 -1
  299. package/.next/standalone/.next/static/chunks/0qxmfi3_hxoj8.js +0 -1
  300. package/.next/standalone/.next/static/chunks/0xbblu1dqxput.js +0 -1
  301. package/.next/standalone/.next/static/chunks/0xu8d3uoqrmjl.js +0 -1
  302. package/.next/standalone/.next/static/chunks/0xx_wtcnk0sf7.js +0 -1
  303. /package/.next/standalone/.next/static/{Kff31mi-mF0Jr_em-2NTJ → dUfkElN2NF1kYx7TqxHtX}/_buildManifest.js +0 -0
  304. /package/.next/standalone/.next/static/{Kff31mi-mF0Jr_em-2NTJ → dUfkElN2NF1kYx7TqxHtX}/_clientMiddlewareManifest.js +0 -0
  305. /package/.next/standalone/.next/static/{Kff31mi-mF0Jr_em-2NTJ → dUfkElN2NF1kYx7TqxHtX}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,113399,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),n=e.i(821957),i=e.i(360112);let r=["code","code-insiders","cursor","windsurf","subl","zed","idea","webstorm","pycharm","goland","rubymine","phpstorm","clion","rider"];var l=e.i(533499),o=e.i(519455),c=e.i(793479),d=e.i(624687),m=e.i(110204),u=e.i(487486),x=e.i(699375),g=e.i(776639),h=e.i(975157),p=e.i(386343),f=e.i(572989);let b=(0,f.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var j=e.i(645378);let v=(0,f.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var N=e.i(125177),y=e.i(256753),k=e.i(245697),w=e.i(657153),C=e.i(232545);let S=(0,f.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var T=e.i(998626);let M=(0,f.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),D=(0,f.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var B=e.i(400355),R=e.i(301348),P=e.i(181209),L=e.i(453889),U=e.i(440057),I=e.i(147606),F=e.i(408101),H=e.i(514798);let V=(0,H.createServerReference)("0069f5b2d346fcdd2ea23f5185718b53c7cb21052f",H.callServer,void 0,H.findSourceMapURL,"getAvailableTerminalApps"),E=(0,H.createServerReference)("0008624d1706a8b7d75c9c495d813ef5ed53c801be",H.callServer,void 0,H.findSourceMapURL,"getAvailableEditors");var z=e.i(351909);let $=(0,H.createServerReference)("40a0da886ecb472708cbd0c5d6fc1b002f25291dee",H.callServer,void 0,H.findSourceMapURL,"createPrompt"),A=(0,H.createServerReference)("60525d37caa36fe1040ff7b1695d91c0673e93a438",H.callServer,void 0,H.findSourceMapURL,"updatePrompt"),K=(0,H.createServerReference)("40f2716b3435778f5960bf7438fb97569cfb567ff4",H.callServer,void 0,H.findSourceMapURL,"deletePrompt"),O=(0,H.createServerReference)("604a70f97cf97e7bb56e3b3a0c95b0842fd210d706",H.callServer,void 0,H.findSourceMapURL,"setDefaultPrompt"),W=(0,H.createServerReference)("00fe2415d70aea9675a0ce38476d9129f505128b32",H.callServer,void 0,H.findSourceMapURL,"getAvailableProviders");var q=e.i(746798),G=e.i(224277);let X=(0,f.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var Y=e.i(631675);let Z=(0,f.default)("folder-up",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var _=e.i(922541),J=e.i(759686),Q=e.i(487278);let ee=(0,H.createServerReference)("401eb92d8c692466a41849ef7d22a78cec9c33d702",H.callServer,void 0,H.findSourceMapURL,"createBackup"),et=(0,H.createServerReference)("003b98c297b754addda71a930baf69043c5337c408",H.callServer,void 0,H.findSourceMapURL,"listBackupFiles"),es=(0,H.createServerReference)("40f70f02e81f3181c220eed4a7877159368d85f5fa",H.callServer,void 0,H.findSourceMapURL,"deleteBackupFile"),ea=(0,H.createServerReference)("402557819c555845ff2151dd61e825a615aaff65c6",H.callServer,void 0,H.findSourceMapURL,"restoreBackup"),en=(0,H.createServerReference)("40c027ee5d480f8183735089a3dda78444ebf0b606",H.callServer,void 0,H.findSourceMapURL,"resetSystem"),ei=(0,H.createServerReference)("0003688cd7ff60d06827685b77681ccf717c0f8e3c",H.callServer,void 0,H.findSourceMapURL,"getBackupDir"),er=(0,H.createServerReference)("40c2a4b565c27c3c67887c473ae9effa87ffb6b7cf",H.callServer,void 0,H.findSourceMapURL,"setBackupDir");function el(){let{t:e,locale:n}=(0,l.useI18n)(),r=(0,a.useRouter)(),[d,m]=(0,s.useState)([]),[u,x]=(0,s.useState)(""),[h,p]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!0),[j,v]=(0,s.useState)(null),[N,y]=(0,s.useState)(!1),[k,w]=(0,s.useState)(""),C=(0,s.useRef)(null),[S,M]=(0,s.useState)(!1),[D,R]=(0,s.useState)(""),P=(0,s.useCallback)(async()=>{b(!0);try{let[e,t]=await Promise.all([et(),ei()]);m(e),x(t)}finally{b(!1)}},[]);(0,s.useEffect)(()=>{P()},[P]);let L=async()=>{let t=k.trim()||void 0;y(!1),w(""),v("create");try{await ee(t),i.toast.success(e("settings.backup.createSuccess")),await P()}catch{i.toast.error(e("settings.backup.createError"))}finally{v(null)}},U=async t=>{if(confirm(e("settings.backup.restoreConfirm"))){v("restore");try{await ea(t),i.toast.success(e("settings.backup.restoreSuccess"),{action:{label:e("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await P()}catch{i.toast.error(e("settings.backup.restoreError"))}finally{v(null)}}},I=async t=>{if(confirm(e("settings.backup.deleteConfirm")))try{await es(t),i.toast.success(e("settings.backup.deleteSuccess")),m(e=>e.filter(e=>e.filename!==t))}catch{i.toast.error(e("settings.backup.deleteError"))}},F=async t=>{p(!1);try{await er(t),x(t),i.toast.success(e("settings.backup.dirSaved")),await P()}catch{i.toast.error(e("settings.backup.dirError"))}},H=async t=>{let s=t.target.files?.[0];if(s){t.target.value="",v("import");try{let t=new FormData;t.append("file",s);let a=await fetch("/api/internal/backup/import",{method:"POST",body:t});if(!a.ok){let t=await a.json();i.toast.error("Invalid backup archive"===t.error?e("settings.backup.importInvalid"):(t.error,e("settings.backup.importError")));return}i.toast.success(e("settings.backup.importSuccess")),await P()}catch{i.toast.error(e("settings.backup.importError"))}finally{v(null)}}},V=async()=>{if("RESET"===D){M(!1),R(""),v("reset");try{await en("RESET"),i.toast.success(e("settings.backup.resetSuccess")),r.push("/")}catch{i.toast.error(e("settings.backup.resetError"))}finally{v(null)}}},E=null!==j;return(0,t.jsxs)("div",{className:"space-y-6",children:[("restore"===j||"reset"===j)&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,t.jsx)(B.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===j?e("settings.backup.restoring"):e("settings.backup.resetting")})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold",children:e("settings.backup.sectionTitle")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{children:[e("settings.backup.dir"),":"]}),(0,t.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:u}),(0,t.jsx)(o.Button,{variant:"ghost",onClick:()=>p(!0),className:"text-xs text-muted-foreground",children:e("settings.backup.dirChange")})]}),(0,t.jsx)(G.FolderBrowserDialog,{open:h,onOpenChange:p,onSelect:F})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Button,{onClick:()=>{w(""),y(!0)},disabled:E,className:"gap-2",children:"create"===j?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Loader2,{className:"h-4 w-4 animate-spin"})," ",e("settings.backup.creating")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(X,{className:"h-4 w-4"})," ",e("settings.backup.create")]})}),(0,t.jsxs)(q.Tooltip,{children:[(0,t.jsxs)(q.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"outline",disabled:E,onClick:()=>C.current?.click(),className:"gap-2"}),children:[(0,t.jsx)(Z,{className:"h-4 w-4"}),e("settings.backup.import")]}),(0,t.jsx)(q.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.importHint")})]}),(0,t.jsx)("input",{ref:C,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:H})]}),(0,t.jsx)(g.Dialog,{open:N,onOpenChange:y,children:(0,t.jsxs)(g.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(g.DialogHeader,{children:(0,t.jsx)(g.DialogTitle,{children:e("settings.backup.create")})}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.createLabel")}),(0,t.jsx)(c.Input,{value:k,onChange:e=>w(e.target.value),onKeyDown:e=>"Enter"===e.key&&L(),placeholder:e("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>y(!1),children:e("common.cancel")}),(0,t.jsx)(o.Button,{onClick:L,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:e("settings.backup.create")})]})]})}),f?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(B.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===d.length?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,t.jsx)(Q.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.backup.empty")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:e("settings.backup.emptyDesc")})]}):(0,t.jsx)("div",{className:"space-y-3",children:d.map(s=>{var a,i;return(0,t.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[s.label?(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:s.label}):(0,t.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:s.filename}),s.autoBackup&&(0,t.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:e("settings.backup.autoLabel")})]}),s.label&&(0,t.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:s.filename}),(0,t.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(a=s.size)<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`," · ",(i=s.createdAt,new Date(i).toLocaleString("zh"===n?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),s.preview.length>0&&(0,t.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[s.preview.map((e,s)=>(0,t.jsxs)("span",{children:[s>0&&" ",e.workspace,"(",e.projects.join(", "),")"]},s)),s.stats.workspaces>s.preview.length&&(0,t.jsxs)("span",{children:[" ",e("settings.backup.workspaces",{count:String(s.stats.workspaces)})]})]}),(0,t.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[e("settings.backup.projects",{count:String(s.stats.projects)})," · ",e("settings.backup.tasks",{count:String(s.stats.tasks)})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsxs)(q.Tooltip,{children:[(0,t.jsx)(q.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>U(s.filename),disabled:E,className:"text-muted-foreground hover:text-foreground"}),children:(0,t.jsx)(Y.Upload,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(q.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.restore")})]}),(0,t.jsxs)(q.Tooltip,{children:[(0,t.jsx)(q.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-xs",onClick:()=>I(s.filename),disabled:E,className:"text-muted-foreground hover:text-rose-400"}),children:(0,t.jsx)(T.Trash2,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(q.TooltipContent,{side:"bottom",sideOffset:4,children:e("settings.backup.delete")})]})]})]})},s.filename)})}),(0,t.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,t.jsx)(J.AlertTriangle,{className:"h-4 w-4"}),e("settings.backup.dangerZone")]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:e("settings.backup.resetDesc")}),(0,t.jsxs)(o.Button,{variant:"outline",onClick:()=>{R(""),M(!0)},disabled:E,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,t.jsx)(_.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),e("settings.backup.reset")]})]}),(0,t.jsx)(g.Dialog,{open:S,onOpenChange:M,children:(0,t.jsxs)(g.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:e("settings.backup.resetConfirmTitle")}),(0,t.jsx)(g.DialogDescription,{children:e("settings.backup.resetConfirmDesc")})]}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:e("settings.backup.resetConfirmInput")}),(0,t.jsx)(c.Input,{value:D,onChange:e=>R(e.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>M(!1),children:e("common.cancel")}),(0,t.jsx)(o.Button,{disabled:"RESET"!==D,onClick:V,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:e("settings.backup.reset")})]})]})})]})}var eo=e.i(887911);let ec=(0,f.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var ed=e.i(475958),em=e.i(194358),eu=e.i(991838);function ex({extension:e}){let{t:a}=(0,l.useI18n)(),{status:n,loading:r,isInstalling:c,install:d,uninstall:m,refresh:u}=(0,eu.useExtension)(e.id),[x,g]=(0,s.useState)(!1),h=e.icon,p=n.installed,f=async()=>{let t=await d();t.success?i.toast.success(a("settings.extensions.installSuccess").replace("{name}",e.name)):i.toast.error(a("settings.extensions.installFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},b=async()=>{let t=await m();t.success?i.toast.success(a("settings.extensions.uninstallSuccess").replace("{name}",e.name)):i.toast.error(a("settings.extensions.uninstallFailed").replace("{name}",e.name)+(t.error?`: ${t.error.slice(0,200)}`:""))},j=async()=>{g(!0);try{await u()}finally{g(!1)}},v=()=>{window.open(e.homepageUrl,"_blank","noopener,noreferrer")};return(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,t.jsx)(h,{className:"h-5 w-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:e.name}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description})]})]}),(0,t.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",e.sizeMB," MB"]})]}),(0,t.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("common.loading")})]}):p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-foreground",children:[a("settings.extensions.installed"),n.version?` v${n.version}`:""]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ec,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{className:"text-muted-foreground",children:a("settings.extensions.notInstalledShort")})]})}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[p?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Button,{variant:"default",onClick:f,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.reinstalling")]}):a("settings.extensions.reinstall")}),(0,t.jsx)(o.Button,{variant:"outline",onClick:b,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.uninstalling")]}):a("settings.extensions.uninstall")})]}):e.manualInstall?(0,t.jsxs)(q.Tooltip,{children:[(0,t.jsx)(q.TooltipTrigger,{render:e=>(0,t.jsxs)(o.Button,{variant:"default",onClick:v,...e,children:[(0,t.jsx)(ed.ExternalLink,{className:"h-3.5 w-3.5"}),a("settings.extensions.installViaHomepage")]})}),(0,t.jsxs)(q.TooltipContent,{className:"w-80 max-w-[80vw] text-xs leading-relaxed",children:[(0,t.jsx)("p",{children:a("settings.extensions.manualInstallHintIntro")}),(0,t.jsxs)("ul",{className:"mt-2 space-y-1",children:[(0,t.jsxs)("li",{className:"flex gap-2",children:[(0,t.jsx)("span",{className:"w-12 shrink-0 text-muted-foreground",children:"macOS"}),(0,t.jsx)("code",{className:"rounded bg-background/60 px-1.5 py-0.5 font-mono text-[11px]",children:"brew install ripgrep"})]}),(0,t.jsxs)("li",{className:"flex gap-2",children:[(0,t.jsx)("span",{className:"w-12 shrink-0 text-muted-foreground",children:"Win"}),(0,t.jsx)("code",{className:"rounded bg-background/60 px-1.5 py-0.5 font-mono text-[11px]",children:"winget install BurntSushi.ripgrep"})]}),(0,t.jsxs)("li",{className:"flex gap-2",children:[(0,t.jsx)("span",{className:"w-12 shrink-0 text-muted-foreground",children:"Linux"}),(0,t.jsx)("code",{className:"rounded bg-background/60 px-1.5 py-0.5 font-mono text-[11px]",children:"apt/dnf/pacman install ripgrep"})]})]}),(0,t.jsx)("p",{className:"mt-2 text-muted-foreground",children:a("settings.extensions.manualInstallHintAfter")})]})]}):(0,t.jsx)(o.Button,{variant:"default",onClick:f,disabled:c,children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),a("settings.extensions.installing")]}):a("settings.extensions.install")}),(0,t.jsxs)(o.Button,{variant:"ghost",onClick:j,disabled:x,children:[(0,t.jsx)(em.RefreshCw,{className:`h-3.5 w-3.5 ${x?"animate-spin":""}`}),a("settings.extensions.recheck")]}),(0,t.jsxs)(o.Button,{variant:"ghost",onClick:v,children:[(0,t.jsx)(ed.ExternalLink,{className:"h-3.5 w-3.5"}),a("settings.extensions.visitHomepage")]})]})]})}function eg(){let{t:e}=(0,l.useI18n)(),s=(0,eo.listExtensionMetadata)();return(0,t.jsxs)("div",{className:"space-y-5",children:[(0,t.jsxs)("header",{children:[(0,t.jsx)("h2",{className:"text-base font-semibold",children:e("settings.extensions.title")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("settings.extensions.desc")})]}),(0,t.jsx)("div",{className:"space-y-3",children:s.map(e=>(0,t.jsx)(ex,{extension:e},e.id))})]})}function eh({options:e,value:s,onChange:a}){return(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.value),className:(0,h.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}function ep({label:e,description:s,children:a,className:n}){return(0,t.jsxs)("div",{className:(0,h.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",n),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e}),s&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:s})]}),(0,t.jsx)("div",{className:"shrink-0",children:a})]})}let ef=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:p.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:b,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:j.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:v,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:k.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:N.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:y.HardDrive,accent:"cyan"}],eb={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},ej="ai-manager:default-cli-adapter",ev={host:"",ownerMatch:"*",localPathTemplate:"",priority:0};function eN(){let e=(0,a.useRouter)(),{t:p}=(0,l.useI18n)(),{theme:f,setTheme:b}=(0,n.useTheme)(),{locale:j,setLocale:v}=(0,l.useI18n)(),[N,y]=(0,s.useState)("general"),k=(0,s.useRef)(null),[H,X]=(0,s.useState)({left:0,width:0}),[Y,Z]=(0,s.useState)(!1),[_,J]=(0,s.useState)("Terminal"),[Q,ee]=(0,s.useState)([]),[et,es]=(0,s.useState)(""),[ea,en]=(0,s.useState)([]),[ei,er]=(0,s.useState)(180),[eo,ec]=(0,s.useState)([]),[ed,em]=(0,s.useState)("claude"),[eu,ex]=(0,s.useState)(null),[eN,ey]=(0,s.useState)({}),[ek,ew]=(0,s.useState)([]),[eC,eS]=(0,s.useState)(!1),[eT,eM]=(0,s.useState)(null),[eD,eB]=(0,s.useState)(null),[eR,eP]=(0,s.useState)(""),[eL,eU]=(0,s.useState)(""),[eI,eF]=(0,s.useState)(""),[eH,eV]=(0,s.useState)([]),[eE,ez]=(0,s.useState)(null),[e$,eA]=(0,s.useState)({...ev}),[eK,eO]=(0,s.useState)(!1),[eW,eq]=(0,s.useState)({...ev}),[eG,eX]=(0,s.useState)(!1),[eY,eZ]=(0,s.useState)(!1),[e_,eJ]=(0,s.useState)(0),[eQ,e0]=(0,s.useState)(null),[e1,e2]=(0,s.useState)(null),[e5,e3]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[e4,e7]=(0,s.useState)({timeoutSec:30}),[e8,e6]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[e9,te]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[tt,ts]=(0,s.useState)(null),[ta,tn]=(0,s.useState)(!1),[ti,tr]=(0,s.useState)(""),[tl,to]=(0,s.useState)(!0);(0,s.useEffect)(()=>Z(!0),[]),(0,s.useEffect)(()=>{(0,U.getConfigValue)("terminal.app","Terminal").then(J),(0,U.getConfigValue)("terminal.idleTimeoutSec",180).then(er),V().then(ee),(0,U.getConfigValue)("editor.command","").then(es),E().then(en)},[]),(0,s.useEffect)(()=>{W().then(ec);let e=localStorage.getItem(ej);e&&em(e)},[]),(0,s.useEffect)(()=>{(0,z.getPrompts)().then(ew)},[]);let tc=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();ts(t)}}catch{}};async function td(){await (0,I.setConfigValue)("terminal.app",_)}async function tm(){let e=et.trim();e&&!r.includes(e)?i.toast.error(p("settings.editor.invalid",{cmd:e})):(e!==et&&es(e),await (0,I.setConfigValue)("editor.command",e))}async function tu(){let e=Math.max(180,ei);er(e),await (0,I.setConfigValue)("terminal.idleTimeoutSec",e)}async function tx(e){if(!eu){ex(e),ey(t=>{let s={...t};return delete s[e],s});try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e})}),s=await t.json();ey(t=>({...t,[e]:s}))}catch{ey(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{ex(null)}}}(0,s.useEffect)(()=>{(0,U.getConfigValue)("git.pathMappingRules",[]).then(e=>{let t=new Set,s=!1,a=e.map(e=>{if(!e.id||t.has(e.id)){s=!0;let a={...e,id:crypto.randomUUID()};return t.add(a.id),a}return t.add(e.id),e});eV(a),s&&(0,I.setConfigValue)("git.pathMappingRules",a)}),(0,U.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{tr(e.join(", "))}),tc(),(0,F.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","task.defaultUseWorktree","task.defaultAutoStart","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{let t=e["system.maxUploadBytes"]??0x3200000,s=e["system.maxReadableFileBytes"]??5242880;e3({maxUploadMb:Math.round(t/1024/1024),maxConcurrent:e["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(s/1024/1024),taskDefaultUseWorktree:"boolean"!=typeof e["task.defaultUseWorktree"]||e["task.defaultUseWorktree"],taskDefaultAutoStart:"boolean"==typeof e["task.defaultAutoStart"]&&e["task.defaultAutoStart"]}),e7({timeoutSec:e["git.timeoutSec"]??30}),e6({resultLimit:e["search.resultLimit"]??20,allModeCap:e["search.allModeCap"]??5,debounceMs:e["search.debounceMs"]??250,snippetLength:e["search.snippetLength"]??80,codeTimeoutSec:e["search.codeTimeoutSec"]??30}),te({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{(0,U.getConfigValue)("notification.enabled",!0).then(to)},[]);let tg=(0,s.useCallback)(()=>{eM(null),eP(""),eU(""),eF(""),eS(!0)},[]),th=(0,s.useCallback)(e=>{eM(e),eP(e.name),eU(e.description??""),eF(e.content),eS(!0)},[]),tp=(0,s.useCallback)(async()=>{eR.trim()&&eI.trim()&&(eT?await A(eT.id,{name:eR.trim(),description:eL.trim()||void 0,content:eI.trim()}):await $({name:eR.trim(),description:eL.trim()||void 0,content:eI.trim()}),eS(!1),ew(await (0,z.getPrompts)()),e.refresh())},[eR,eL,eI,eT,e]),tf=(0,s.useCallback)(async()=>{eD&&(await K(eD),eB(null),ew(await (0,z.getPrompts)()),e.refresh())},[eD,e]),tb=(0,s.useCallback)(async t=>{await O(t),ew(await (0,z.getPrompts)()),e.refresh()},[e]),tj=async()=>{await (0,I.setConfigValue)("system.maxUploadBytes",1024*e5.maxUploadMb*1024),await (0,I.setConfigValue)("system.maxConcurrentExecutions",e5.maxConcurrent),await (0,I.setConfigValue)("system.maxReadableFileBytes",1024*e5.maxReadableMb*1024),await (0,I.setConfigValue)("task.defaultUseWorktree",e5.taskDefaultUseWorktree),await (0,I.setConfigValue)("task.defaultAutoStart",e5.taskDefaultAutoStart)},tv=async()=>{await (0,I.setConfigValue)("git.timeoutSec",e4.timeoutSec)},tN=async()=>{await (0,I.setConfigValue)("search.resultLimit",e8.resultLimit),await (0,I.setConfigValue)("search.allModeCap",e8.allModeCap),await (0,I.setConfigValue)("search.debounceMs",e8.debounceMs),await (0,I.setConfigValue)("search.snippetLength",e8.snippetLength),await (0,I.setConfigValue)("search.codeTimeoutSec",e8.codeTimeoutSec)},ty=async()=>{let e=Math.min(e9.minCols,e9.maxCols),t=Math.max(e9.minCols,e9.maxCols),s=Math.min(e9.minRows,e9.maxRows),a=Math.max(e9.minRows,e9.maxRows);te({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,I.setConfigValue)("missions.grid.minCols",e),await (0,I.setConfigValue)("missions.grid.maxCols",t),await (0,I.setConfigValue)("missions.grid.minRows",s),await (0,I.setConfigValue)("missions.grid.maxRows",a)},tk=async()=>{let e=ti.split(",").map(e=>e.trim()).filter(Boolean);await (0,I.setConfigValue)("hooks.autoUploadTypes",e)},tw=async()=>{if(tt){tn(!0);try{let e=tt.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await tc()}finally{tn(!1)}}},tC=async()=>{if(!eW.host.trim()||!eW.localPathTemplate.trim())return;let e=eW.localPathTemplate.trim().replace(/\/+$/,""),t=eG?`${e}/{path}`:e,s=[...eH,{id:crypto.randomUUID(),host:eW.host.trim(),ownerMatch:eW.ownerMatch.trim()||"*",localPathTemplate:t,priority:eW.priority}];await (0,I.setConfigValue)("git.pathMappingRules",s),eV(s),eq({...ev}),eX(!1),eO(!1)},tS=async e=>{if(!e$.host.trim()||!e$.localPathTemplate.trim())return;let t=e$.localPathTemplate.trim().replace(/\/+$/,""),s=eY?`${t}/{path}`:t,a=eH.map(t=>t.id===e?{...t,host:e$.host.trim(),ownerMatch:e$.ownerMatch.trim()||"*",localPathTemplate:s,priority:e$.priority}:t);await (0,I.setConfigValue)("git.pathMappingRules",a),eV(a),ez(null),eZ(!1)},tT=async e=>{let t=eH.filter(t=>t.id!==e);await (0,I.setConfigValue)("git.pathMappingRules",t),eV(t),e0(null)};async function tM(){let e=!tl;to(e),await (0,I.setConfigValue)("notification.enabled",e)}let tD=(0,s.useCallback)(()=>{e.back()},[e]);(0,s.useEffect)(()=>{let e=k.current;if(!e)return;let t=e.querySelector(`[data-section="${N}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();X({left:a.left-s.left,width:a.width})},[N]);let tB=ef.find(e=>e.id===N),tR=tB?eb[tB.accent]:eb.blue;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:p("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:p("settings.configDesc")})]}),(0,t.jsxs)(o.Button,{variant:"outline",onClick:tD,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(w.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{ref:k,className:"relative flex gap-1 overflow-x-auto",children:[ef.map(e=>{let s=e.icon,a=N===e.id,n=eb[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>y(e.id),className:(0,h.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a?`${n.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:(0,h.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",a?n.bg:"bg-transparent"),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{children:p(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,h.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",tR.indicator),style:{left:H.left,width:H.width}})]})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[tB&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,h.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",tR.bg,tR.text,tR.ring),children:(0,t.jsx)(tB.icon,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:p(tB.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:p(tB.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(N){case"general":let e;return e=[{value:"light",label:p("settings.themeLight")},{value:"dark",label:p("settings.themeDark")},{value:"system",label:p("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(ep,{label:p("settings.theme"),description:p("settings.themeDesc"),children:Y?(0,t.jsx)(eh,{options:e,value:f??"system",onChange:e=>b(e)}):(0,t.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,t.jsx)(ep,{label:p("settings.language"),description:p("settings.languageDesc"),children:(0,t.jsx)(eh,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:j,onChange:e=>v(e)})}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:p("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.terminal.desc")})]})}),(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[Q.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Q.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{J(e.value),(0,I.setConfigValue)("terminal.app",e.value)},className:(0,h.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200 cursor-pointer",_===e.value?"border-foreground bg-accent text-foreground font-medium":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:e.name},e.value))}),(0,t.jsx)("input",{type:"text",value:_,onChange:e=>J(e.target.value),onBlur:td,placeholder:p("settings.terminal.placeholder"),className:"h-9 w-64 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/30"})]})]}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:p("settings.editor.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.editor.desc")})]})}),(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[ea.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:ea.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{es(e.command),(0,I.setConfigValue)("editor.command",e.command)},className:(0,h.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200 cursor-pointer",et===e.command?"border-foreground bg-accent text-foreground font-medium":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:e.name},e.command))}),(0,t.jsx)("input",{type:"text",value:et,onChange:e=>es(e.target.value),onBlur:tm,placeholder:p("settings.editor.placeholder"),className:"h-9 w-64 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/30"})]})]}),(0,t.jsx)(ep,{label:p("settings.terminal.idleTimeout"),description:p("settings.terminal.idleTimeoutDesc"),children:(0,t.jsx)("input",{type:"number",value:ei,onChange:e=>er(Number(e.target.value)),onBlur:tu,min:180,className:"h-9 w-28 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm text-right focus:outline-none focus:ring-2 focus:ring-blue-500/30"})})]});case"ai-tools":return(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eo.map(e=>{let s=ed===e.name,a=eu===e.name,n=eN[e.name];return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.displayName}),(0,t.jsx)(u.Badge,{variant:"outline",children:p("label.builtin")}),s&&(0,t.jsxs)(u.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(S,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),p("settings.prompts.default")]}),n&&(0,t.jsx)(u.Badge,{variant:n.ok?"secondary":"destructive",className:(0,h.cn)("shrink-0",n.ok&&"bg-green-600 text-white hover:bg-green-700"),children:n.ok?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.CheckCircle2,{className:"h-3 w-3 mr-1"}),p("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.XCircle,{className:"h-3 w-3 mr-1"}),p("settings.aiTools.testFailed")]})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.cli.available&&e.cli.version?`${e.name} \xb7 ${e.cli.version}`:e.name})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)(o.Button,{variant:"outline",size:"sm",onClick:()=>{var t;em(t=e.name),localStorage.setItem(ej,t)},children:[(0,t.jsx)(S,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),p("settings.prompts.setDefault")]}),(0,t.jsx)(o.Button,{variant:"outline",size:"sm",onClick:()=>tx(e.name),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(B.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),p("settings.aiTools.testing")]}):p("settings.aiTools.testConnection")})]})]}),n&&(0,t.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,t.jsx)("div",{className:"space-y-1.5",children:n.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:(0,h.cn)("w-1.5 h-1.5 rounded-full shrink-0",s.passed?"bg-green-500":"bg-red-500")}),(0,t.jsx)("span",{className:(0,h.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.name}-${s.name}`))})})]})},e.name)})});case"prompts":return Y?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(o.Button,{onClick:tg,variant:"default",children:[(0,t.jsx)(C.Plus,{className:"h-4 w-4 mr-2"}),p("settings.prompts.newPrompt")]})}),0===ek.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:p("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:p("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ek.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),e.isDefault&&(0,t.jsxs)(u.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,t.jsx)(S,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),p("settings.prompts.default")]})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>tb(e.id),title:p("settings.prompts.setDefault"),children:(0,t.jsx)(S,{className:(0,h.cn)("h-4 w-4",e.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>th(e),title:p("settings.prompts.editPrompt"),children:(0,t.jsx)(M,{className:"h-4 w-4"})}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>eB(e.id),className:"text-destructive",title:p("settings.prompts.delete"),children:(0,t.jsx)(T.Trash2,{className:"h-4 w-4"})})]})]},e.id))}),(0,t.jsx)(g.Dialog,{open:eC,onOpenChange:eS,children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:eT?p("settings.prompts.editPrompt"):p("settings.prompts.newPrompt")}),(0,t.jsx)(g.DialogDescription,{children:eT?p("settings.prompts.editPrompt"):p("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(m.Label,{htmlFor:"prompt-name",children:p("settings.prompts.promptName")}),(0,t.jsx)(c.Input,{id:"prompt-name",value:eR,onChange:e=>eP(e.target.value),placeholder:p("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(m.Label,{htmlFor:"prompt-description",children:p("settings.prompts.promptDescription")}),(0,t.jsx)(c.Input,{id:"prompt-description",value:eL,onChange:e=>eU(e.target.value),placeholder:p("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(m.Label,{htmlFor:"prompt-content",children:p("settings.prompts.promptContent")}),(0,t.jsx)(d.Textarea,{id:"prompt-content",value:eI,onChange:e=>eF(e.target.value),placeholder:p("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>eS(!1),children:p("settings.prompts.cancel")}),(0,t.jsx)(o.Button,{onClick:tp,disabled:!eR.trim()||!eI.trim(),children:p("settings.prompts.save")})]})]})}),(0,t.jsx)(g.Dialog,{open:!!eD,onOpenChange:e=>!e&&eB(null),children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:p("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(g.DialogDescription,{children:p("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>eB(null),children:p("settings.prompts.cancel")}),(0,t.jsx)(o.Button,{variant:"destructive",onClick:tf,children:p("settings.prompts.delete")})]})]})})]}):(0,t.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let s,a,n;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:p("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.config.git.desc")})]}),(0,t.jsxs)(o.Button,{onClick:()=>{eq({...ev}),eO(!0)},children:[(0,t.jsx)(C.Plus,{className:"mr-2 h-4 w-4"}),p("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==eH.length||eK?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:eH.map(e=>eE===e.id?(0,t.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:p("settings.config.git.host")}),(0,t.jsx)(c.Input,{value:e$.host,onChange:e=>eA(t=>({...t,host:e.target.value})),placeholder:p("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:p("settings.config.git.ownerMatch")}),(0,t.jsx)(c.Input,{value:e$.ownerMatch,onChange:e=>eA(t=>({...t,ownerMatch:e.target.value})),placeholder:p("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:p("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{value:e$.localPathTemplate,onChange:e=>eA(t=>({...t,localPathTemplate:e.target.value})),placeholder:p("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(q.Tooltip,{children:[(0,t.jsx)(q.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:eY?"default":"outline",size:"sm",type:"button",onClick:()=>eZ(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(q.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:p("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:p("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(q.Tooltip,{children:[(0,t.jsx)(q.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>e2("edit"),children:(0,t.jsx)(L.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(q.TooltipContent,{children:p("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eY?p("onboarding.step3.pathHintFull"):p("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs text-muted-foreground",children:p("settings.config.git.priority")}),(0,t.jsx)(c.Input,{type:"number",value:e$.priority,onChange:e=>eA(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)(o.Button,{variant:"ghost",size:"sm",onClick:()=>{ez(null),eZ(!1)},children:p("settings.config.git.cancel")}),(0,t.jsx)(o.Button,{size:"sm",onClick:()=>tS(e.id),children:p("settings.config.git.save")})]})]},e.id):(0,t.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.host}),"*"!==e.ownerMatch&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",e.ownerMatch]}),(0,t.jsxs)(u.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[p("settings.config.git.priority")," ",e.priority]})]}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:e.localPathTemplate})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let t,s,a;return t=e.localPathTemplate,a=(s=/\/\{path\}\/?$/.test(t))?t.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):t,void(ez(e.id),eA({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:a,priority:e.priority}),eZ(s))},title:p("settings.config.git.edit"),children:(0,t.jsx)(M,{className:"h-4 w-4"})}),(0,t.jsx)(o.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e0(e.id),className:"text-destructive",title:p("settings.config.git.delete"),children:(0,t.jsx)(T.Trash2,{className:"h-4 w-4"})})]})]})},e.id))}):(0,t.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:p("settings.config.git.noRules")})}),eK&&(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:p("settings.config.git.host")}),(0,t.jsx)(c.Input,{value:eW.host,onChange:e=>eq(t=>({...t,host:e.target.value})),placeholder:p("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:p("settings.config.git.ownerMatch")}),(0,t.jsx)(c.Input,{value:eW.ownerMatch,onChange:e=>eq(t=>({...t,ownerMatch:e.target.value})),placeholder:p("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:p("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{value:eW.localPathTemplate,onChange:e=>eq(t=>({...t,localPathTemplate:e.target.value})),placeholder:p("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsxs)(q.Tooltip,{children:[(0,t.jsx)(q.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:eG?"default":"outline",size:"sm",type:"button",onClick:()=>eX(e=>!e),className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(q.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:p("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:p("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(q.Tooltip,{children:[(0,t.jsx)(q.TooltipTrigger,{render:(0,t.jsx)(o.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>e2("add"),children:(0,t.jsx)(L.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(q.TooltipContent,{children:p("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eG?p("onboarding.step3.pathHintFull"):p("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:p("settings.config.git.priority")}),(0,t.jsx)(c.Input,{type:"number",value:eW.priority,onChange:e=>eq(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),eW.localPathTemplate&&(s=eW.localPathTemplate.trim().replace(/\/+$/,""),a=eG?`${s}/{path}`:s,n=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:p("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:n.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>eJ(s),className:(0,h.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",e_===s?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:e.label},s))})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:n[e_].url}),(0,t.jsxs)("p",{className:"font-mono text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-foreground font-medium",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],n=s.match(/^git@[^:]+:(.+)$/);if(n)a=n[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(s);a=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!a.length)return"";let i=a[0],r=a[a.length-1],l=a.join("/");if(e.includes("{path}"))return e.replace("{path}",l).replace("{owner}",i).replace("{repo}",r).replace(/\/+$/,"");let o=e.replace("{owner}",i).replace("{repo}","").replace(/\/+$/,"");return`${o}/${r}`}(a,n[e_].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(o.Button,{variant:"ghost",size:"sm",onClick:()=>eO(!1),children:p("settings.config.git.cancel")}),(0,t.jsxs)(o.Button,{size:"sm",onClick:tC,disabled:!eW.host.trim()||!eW.localPathTemplate.trim(),children:[(0,t.jsx)(D,{className:"h-3.5 w-3.5 mr-1.5"}),p("settings.config.git.save")]})]})]})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:p("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.config.system.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{type:"number",min:1,max:500,value:e5.maxUploadMb,onChange:e=>e3(t=>({...t,maxUploadMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(c.Input,{type:"number",min:1,max:10,value:e5.maxConcurrent,onChange:e=>e3(t=>({...t,maxConcurrent:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.system.maxReadable")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.maxReadableHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{type:"number",min:1,max:50,value:e5.maxReadableMb,onChange:e=>e3(t=>({...t,maxReadableMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.system.taskDefaultWorktree")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.taskDefaultWorktreeHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e3(e=>({...e,taskDefaultUseWorktree:!e.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${e5.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e5.taskDefaultUseWorktree?p("task.worktreeYes"):p("task.worktreeNo")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.system.taskDefaultAutoStart")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.system.taskDefaultAutoStartHint")})]}),(0,t.jsx)("button",{type:"button",onClick:()=>e3(e=>({...e,taskDefaultAutoStart:!e.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${e5.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e5.taskDefaultAutoStart?p("task.autoStartYes"):p("task.autoStartNo")})]})]}),(0,t.jsx)(o.Button,{onClick:tj,className:"rounded-lg",children:p("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:p("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.config.gitParams.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{type:"number",min:5,max:300,value:e4.timeoutSec,onChange:e=>e7(t=>({...t,timeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,t.jsx)(o.Button,{onClick:tv,className:"rounded-lg",children:p("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:p("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.config.search.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(c.Input,{type:"number",min:5,max:100,value:e8.resultLimit,onChange:e=>e6(t=>({...t,resultLimit:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(c.Input,{type:"number",min:1,max:20,value:e8.allModeCap,onChange:e=>e6(t=>({...t,allModeCap:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{type:"number",min:50,max:1e3,value:e8.debounceMs,onChange:e=>e6(t=>({...t,debounceMs:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(c.Input,{type:"number",min:20,max:500,value:e8.snippetLength,onChange:e=>e6(t=>({...t,snippetLength:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.search.codeTimeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.search.codeTimeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.Input,{type:"number",min:5,max:300,step:5,value:e8.codeTimeoutSec,onChange:e=>e6(t=>({...t,codeTimeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,t.jsx)(o.Button,{onClick:tN,className:"rounded-lg",children:p("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:p("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.config.missions.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:p("settings.config.missions.minCols")}),(0,t.jsx)(c.Input,{type:"number",min:1,max:10,value:e9.minCols,onChange:e=>te(t=>({...t,minCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:p("settings.config.missions.maxCols")}),(0,t.jsx)(c.Input,{type:"number",min:1,max:10,value:e9.maxCols,onChange:e=>te(t=>({...t,maxCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:p("settings.config.missions.minRows")}),(0,t.jsx)(c.Input,{type:"number",min:1,max:10,value:e9.minRows,onChange:e=>te(t=>({...t,minRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:p("settings.config.missions.maxRows")}),(0,t.jsx)(c.Input,{type:"number",min:1,max:10,value:e9.maxRows,onChange:e=>te(t=>({...t,maxRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(o.Button,{onClick:ty,className:"rounded-lg",children:p("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:p("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:p("settings.config.hooks.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:p("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(c.Input,{value:ti,onChange:e=>tr(e.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsx)(o.Button,{onClick:tk,className:"rounded-lg",children:p("common.save")}),(0,t.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:tt?.installed?p("settings.config.hooks.installed"):p("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:p("settings.config.hooks.installHint")})]}),(0,t.jsx)(o.Button,{variant:tt?.installed?"destructive":"default",onClick:tw,disabled:ta||!tt,className:"rounded-lg",children:tt?.installed?p("settings.config.hooks.uninstall"):p("settings.config.hooks.install")})]})]}),(0,t.jsx)(g.Dialog,{open:!!eQ,onOpenChange:e=>!e&&e0(null),children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:p("settings.config.git.deleteConfirm")}),(0,t.jsx)(g.DialogDescription,{children:p("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(o.Button,{variant:"outline",onClick:()=>e0(null),children:p("settings.config.git.cancel")}),(0,t.jsx)(o.Button,{variant:"destructive",onClick:()=>eQ&&tT(eQ),children:p("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsx)("div",{className:"divide-y divide-border/50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:p("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:p("settings.notifications.enableDesc")})]}),(0,t.jsx)(x.Switch,{checked:tl,onCheckedChange:tM})]})});case"backup":return(0,t.jsx)(el,{});case"extensions":return(0,t.jsx)(eg,{})}}()]})}),(0,t.jsx)(G.FolderBrowserDialog,{open:null!==e1,onOpenChange:e=>{e||e2(null)},onSelect:e=>{"add"===e1?eq(t=>({...t,localPathTemplate:e})):"edit"===e1&&eA(t=>({...t,localPathTemplate:e})),e2(null)}})]})}e.s(["default",0,function(){return(0,t.jsx)(eN,{})}],113399)}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,645119,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(538059),n=e.i(210702),a=e.i(232545),i=e.i(487278),o=e.i(368490),l=e.i(259846),d=e.i(572989);let c=(0,d.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var x=e.i(519455),m=e.i(759684),u=e.i(606393),p=e.i(226145),h=e.i(340873),f=e.i(263938),g=e.i(960518),b=e.i(453889),v=e.i(645378);let j=(0,d.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var N=e.i(464249);let y=(0,d.default)("package-check",[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]),w=(0,d.default)("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);var C=e.i(746798),S=e.i(685149),k=e.i(533499);let D=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function T(e){return D[function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;return t}(e)%D.length]}let E={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};function B({name:e}){let{t:s}=(0,k.useI18n)();return e?(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${T(e)}`,children:e}):(0,t.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:s("version.type.uncategorized")})}function I({status:e}){let{t:s}=(0,k.useI18n)();return(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${E[e]}`,children:s(`version.status.${e}`)})}function L(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${s}-${r}`}let R=Object.fromEntries(S.BOARD_COLUMNS.map(e=>[e.id,e.color]));function $({children:e,className:s}){return(0,t.jsx)("span",{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs text-muted-foreground ${s??""}`,children:e})}function _({task:e,onOpenDetail:r}){let{t:n}=(0,k.useI18n)(),[a,i]=(0,s.useState)(!1),l="CANCELLED"===e.status?"text-muted-foreground line-through decoration-muted-foreground/40":"DONE"===e.status?"text-muted-foreground":"text-foreground";return(0,t.jsxs)("div",{className:"rounded-[10px]",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center gap-2.5 rounded-[10px] px-2.5 py-2.5 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(o.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${a?"rotate-90":""}`}),(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${R[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:`text-[13.5px] font-medium ${l}`,children:e.title}),e.labels.map(({label:e})=>(0,t.jsx)("span",{className:"rounded-full border border-border px-1.5 py-px text-[10.5px] text-muted-foreground",style:e.color?{borderColor:e.color+"55",color:e.color}:void 0,children:e.name},e.id)),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("span",{className:"flex w-16 flex-none justify-center",children:(0,t.jsx)("span",{className:`rounded-[5px] px-1.5 py-px text-[10.5px] font-bold ${S.PRIORITY_CONFIG[e.priority]?.color??S.PRIORITY_CONFIG.LOW.color}`,children:e.priority})}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsxs)("span",{className:"flex w-[72px] flex-none items-center gap-1.5",children:[(0,t.jsx)("span",{className:`h-1.5 w-1.5 flex-none rounded-full ${R[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:"truncate text-[10.5px] text-muted-foreground",children:n(`version.taskStatus.${e.status}`)})]}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsx)("span",{className:"flex w-6 flex-none justify-center",children:r&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground",onClick:t=>{t.stopPropagation(),r(e.id)}}),children:(0,t.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:n("version.detail")})]})})]}),a&&(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 pb-3 pl-[30px] pr-3 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(b.FolderOpen,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.resources")})]}),0===e.assets.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.resources")}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.assets.map(e=>{var s;let r=e.mimeType?.startsWith("image/");return(0,t.jsxs)("span",{className:"inline-flex cursor-pointer items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground shadow-sm transition-colors hover:border-primary/50",children:[r?(0,t.jsx)(j,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(v.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{children:e.filename}),null!=e.size&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/60",children:(s=e.size)<1024?`${s} B`:s<1048576?`${Math.round(s/1024)} KB`:`${(s/1048576).toFixed(1)} MB`})]},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(v.FileText,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.notes")})]}),0===e.notes.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.notes")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:e.notes.map(e=>(0,t.jsx)("div",{className:"rounded-lg border border-border border-l-violet-500/50 bg-background px-2.5 py-2 shadow-sm [border-left-width:3px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[12.5px] font-semibold text-foreground",children:e.title}),e.category&&(0,t.jsx)("span",{className:"rounded-[5px] border border-violet-500/30 bg-violet-500/15 px-1.5 py-px text-[10px] font-bold text-violet-300",children:e.category})]})},e.id))})]})]})]})}function A({version:e,diffStat:r,onEdit:n,onRelease:a,onViewDiff:i,onOpenTaskDetail:l}){var d;let c,{t:m}=(0,k.useI18n)(),[b,v]=(0,s.useState)(e.isCurrent),j="RELEASED"===e.status,w="ACTIVE"===e.status,S=e.tasks.length,D=e.tasks.filter(e=>"DONE"===e.status).length,T=!!(e.releaseCommit||r),E=(c=`${S} ${m("version.tasksCount")}`,D>0&&D<S?`${c} \xb7 ${D} ${m("version.doneCount")}`:D>0&&D===S?`${c} \xb7 ${m("version.allDone")}`:c);return(0,t.jsxs)("div",{className:["overflow-hidden rounded-[14px] border bg-card shadow-sm transition-shadow duration-150 hover:shadow-md",e.isCurrent?"border-border border-l-2 border-l-primary ring-1 ring-primary/20":"border-border",j?"opacity-[.96]":""].filter(Boolean).join(" "),children:[(0,t.jsx)("button",{type:"button",onClick:()=>v(e=>!e),className:"w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsxs)("div",{className:"px-4 py-3.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(o.ChevronRight,{className:`h-4 w-4 flex-none text-muted-foreground/60 transition-transform duration-150 ${b?"rotate-90":""}`}),(0,t.jsx)("span",{className:"font-mono text-[14.5px] font-bold text-foreground",children:e.number}),(0,t.jsx)("span",{className:"text-[14.5px] font-semibold text-foreground",children:e.name}),(0,t.jsx)(B,{name:e.type?.name??null}),(0,t.jsx)(I,{status:e.status}),e.isCurrent&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/15 px-2.5 py-0.5 text-[11px] font-bold text-primary shadow-sm",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-primary opacity-90"}),m("version.current")]}),(0,t.jsx)("span",{className:"flex-1"}),S>0&&(0,t.jsx)("span",{className:"text-[11.5px] text-muted-foreground",children:E}),(0,t.jsxs)("span",{className:"flex items-center gap-1",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[n&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>n(e.id)}),children:(0,t.jsx)(N.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:m("version.edit")})]}),w&&a&&(0,t.jsxs)(x.Button,{variant:"outline",className:"h-7 px-2 text-xs font-semibold",onClick:()=>a(e.id),children:[(0,t.jsx)(y,{className:"h-3.5 w-3.5"}),m("version.release")]})]})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[j&&e.releasedAt?(0,t.jsxs)($,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),m("version.releasedAt"),(0,t.jsx)("strong",{className:"text-foreground",children:L(e.releasedAt)})]}):e.startDate||e.targetDate?(0,t.jsxs)($,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),e.startDate?L(e.startDate):"—"," → ",e.targetDate?(0,t.jsx)("strong",{className:"text-foreground",children:L(e.targetDate)}):"—"]}):null,e.baseBranch&&(0,t.jsxs)($,{children:[(0,t.jsx)(p.GitBranch,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.baseBranch})]}),e.baseCommit&&(0,t.jsxs)($,{children:[(0,t.jsx)(h.GitCommitHorizontal,{className:"h-3 w-3"}),m("version.field.baseCommit"),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:(d=e.baseCommit)?d.slice(0,7):""})]}),j&&(0,t.jsxs)($,{children:[(0,t.jsx)(f.Tag,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.number})]}),r&&(0,t.jsxs)($,{children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),!j&&(0,t.jsx)("span",{className:"text-muted-foreground",children:m("version.diff.live")}),(0,t.jsxs)("span",{className:"font-bold text-emerald-400",children:["+",r.additions.toLocaleString()]}),(0,t.jsxs)("span",{className:"font-bold text-rose-400",children:["−",r.deletions.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["· ",r.files," ",m("version.diff.files")]})]}),T&&i&&(0,t.jsxs)(x.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground",onClick:t=>{t.stopPropagation(),i(e.id)},children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),m("version.diff.view")," →"]})]}),e.description&&(0,t.jsx)("p",{className:"mt-2 text-[13px] text-muted-foreground",children:e.description})]})}),b&&S>0&&(0,t.jsx)("div",{className:"border-t border-dashed border-border bg-muted/40 px-2 pb-2 pt-1.5",children:e.tasks.map(e=>(0,t.jsx)(_,{task:e,onOpenDetail:l},e.id))})]})}var O=e.i(360112),P=e.i(597746),V=e.i(456346),z=e.i(776639),M=e.i(793479),F=e.i(110204),U=e.i(918385),H=e.i(337822),G=e.i(317056),K=e.i(699375),W=e.i(624687),Y=e.i(514798);let q=(0,Y.createServerReference)("407ca24cd140577fb8e86bffb01ac89c8376d9c19a",Y.callServer,void 0,Y.findSourceMapURL,"createVersion"),J=(0,Y.createServerReference)("600260a3145592fb0f2324508c768409c66b83d300",Y.callServer,void 0,Y.findSourceMapURL,"updateVersion"),Q=(0,Y.createServerReference)("4072042a6338e6b137524f7d8e2406a3d6a19954fd",Y.callServer,void 0,Y.findSourceMapURL,"getVersionTypes");var X=e.i(976426),Z=e.i(845603),ee=e.i(998626);let et=(0,Y.createServerReference)("40862f92835ce83ea470633693ae7974b2f4b66d23",Y.callServer,void 0,Y.findSourceMapURL,"createVersionType"),es=(0,Y.createServerReference)("60d44b5378518809123fbb789548ad673ef0f2a6d8",Y.callServer,void 0,Y.findSourceMapURL,"updateVersionType"),er=(0,Y.createServerReference)("40d739c00eb5a4a18227c30fbd255ca081aab72413",Y.callServer,void 0,Y.findSourceMapURL,"deleteVersionType");function en({open:e,onOpenChange:r,workspaceId:n,onChanged:a}){let{t:i}=(0,k.useI18n)(),[o,l]=(0,s.useState)([]),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)({}),[p,h]=(0,s.useTransition)(),f=async()=>{let e=await Q(n);l(e),u(t=>{let s={};return e.forEach(e=>{s[e.id]=e.id in t?t[e.id]:e.name}),s})};(0,s.useEffect)(()=>{e&&(f(),c(""))},[e,n]);let g=()=>{let e=d.trim();e&&h(async()=>{try{await et({workspaceId:n,name:e}),c(""),await f(),a?.(),O.toast.success(i("version.type.add"))}catch(e){O.toast.error(e instanceof Error?e.message:String(e))}})};return(0,t.jsx)(z.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsx)(z.DialogTitle,{children:i("version.manageTypes")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(M.Input,{value:d,onChange:e=>c(e.target.value),placeholder:i("version.type.namePlaceholder"),disabled:p,onKeyDown:e=>{"Enter"===e.key&&g()},className:"flex-1"}),(0,t.jsx)(x.Button,{onClick:g,disabled:p||!d.trim(),children:i("version.type.add")})]}),0===o.length?(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground py-4",children:i("version.type.empty")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsx)("span",{className:`inline-flex h-2.5 w-2.5 flex-none rounded-full ${T(m[e.id]??e.name).split(" ").filter(e=>e.startsWith("bg-"))[0]??"bg-muted"}`}),(0,t.jsx)(M.Input,{value:m[e.id]??e.name,onChange:t=>u(s=>({...s,[e.id]:t.target.value})),onBlur:()=>(e=>{let t=(m[e]??"").trim();if(!t)return;let s=o.find(t=>t.id===e);s?.name!==t&&h(async()=>{try{await es(e,{name:t}),await f(),a?.()}catch(t){O.toast.error(t instanceof Error?t.message:String(t)),u(t=>({...t,[e]:s?.name??""}))}})})(e.id),onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},disabled:p,className:"h-7 flex-1 border-transparent bg-transparent shadow-none focus-visible:border-input focus-visible:bg-background focus-visible:shadow-sm"}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-none text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void(window.confirm(i("version.type.deleteConfirm"))&&h(async()=>{try{await er(t),await f(),a?.()}catch(e){O.toast.error(e instanceof Error?e.message:String(e))}}))},disabled:p,children:(0,t.jsx)(ee.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))})]})]})})}function ea(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${r}-${n}`}function ei(e){if(!e)return;let t=new Date(e);return isNaN(t.getTime())?void 0:t}function eo({open:e,onOpenChange:r,projectId:n,workspaceId:a,editVersion:i,defaultBaseBranch:o,projectLocalPath:l,onSuccess:d}){let{t:c}=(0,k.useI18n)(),m=!!i,[u,h]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[b,v]=(0,s.useState)(""),[j,N]=(0,s.useState)([]),[y,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),[D,T]=(0,s.useState)(""),[E,B]=(0,s.useState)(""),[I,L]=(0,s.useState)(""),[R,$]=(0,s.useState)(!1),[_,A]=(0,s.useState)([]),[Y,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(!1),er=!!l,[el,ed]=(0,s.useTransition)();return(0,s.useEffect)(()=>{e&&(i?(h(i.number),g(i.name),v(i.typeId??""),S(i.baseBranch??""),T(ea(i.startDate)),B(ea(i.targetDate)),L(i.description??"")):(h(""),g(""),v(""),S(o??""),T(""),B(""),L("")),$(!1))},[e,i,o]),(0,s.useEffect)(()=>{e&&Q(a).then(N).catch(()=>N([]))},[e,a]),(0,s.useEffect)(()=>{e&&er?(ee(!0),(0,X.getProjectBranches)(l).then(A).catch(()=>A([])).finally(()=>ee(!1)),(0,Z.fetchRemoteBranches)(l).then(()=>(0,X.getProjectBranches)(l).then(A)).catch(()=>{})):A([])},[e,er,l]),(0,t.jsxs)(z.Dialog,{open:e,onOpenChange:r,children:[(0,t.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsx)(z.DialogTitle,{children:m?c("version.edit"):c("version.new")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(F.Label,{htmlFor:"version-number",children:[c("version.field.number"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(M.Input,{id:"version-number",value:u,onChange:e=>h(e.target.value),placeholder:c("version.placeholder.number"),disabled:el})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(F.Label,{htmlFor:"version-name",children:[c("version.field.name"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(M.Input,{id:"version-name",value:f,onChange:e=>g(e.target.value),placeholder:c("version.placeholder.name"),disabled:el})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{children:c("version.field.type")}),(0,t.jsxs)(U.Select,{value:b||"__none__",onValueChange:e=>{v(e&&"__none__"!==e?e:"")},children:[(0,t.jsx)(U.SelectTrigger,{className:"w-full",disabled:el,children:(0,t.jsx)("span",{className:"truncate",children:b?j.find(e=>e.id===b)?.name??c("version.type.uncategorized"):c("version.type.uncategorized")})}),(0,t.jsxs)(U.SelectContent,{children:[(0,t.jsx)(U.SelectItem,{value:"__none__",children:c("version.type.uncategorized")}),j.map(e=>(0,t.jsx)(U.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)(x.Button,{type:"button",variant:"ghost",size:"sm",className:"h-auto justify-start px-0 py-0.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>w(!0),disabled:el,children:["+ ",c("version.manageTypes")]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{children:c("version.field.baseBranch")}),Y?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:c("task.branchLoading")}):er&&_.length>0?(0,t.jsxs)(H.Popover,{open:et,onOpenChange:es,children:[(0,t.jsxs)(H.PopoverTrigger,{className:"flex h-8 w-full items-center gap-2 rounded-lg border border-input bg-transparent px-3 text-sm transition-colors hover:bg-accent focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",disabled:el,"data-testid":"version-branch-selector",children:[(0,t.jsx)(p.GitBranch,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:`flex-1 truncate text-left text-xs ${C?"font-mono":"text-muted-foreground"}`,title:C||void 0,children:C||c("version.field.noBranch")}),(0,t.jsx)(V.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(H.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(G.Command,{children:[(0,t.jsx)(G.CommandInput,{placeholder:c("task.branchSearch")}),(0,t.jsxs)(G.CommandList,{children:[(0,t.jsx)(G.CommandEmpty,{children:c("task.branchNone")}),(0,t.jsxs)(G.CommandGroup,{children:[(0,t.jsxs)(G.CommandItem,{value:"__none__",onSelect:()=>{S(""),es(!1)},children:[(0,t.jsx)("span",{className:"flex-1 truncate text-muted-foreground",children:c("version.field.noBranch")}),!C&&(0,t.jsx)(P.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]}),_.map(e=>(0,t.jsxs)(G.CommandItem,{value:e,onSelect:()=>{S(e),es(!1)},children:[(0,t.jsx)(p.GitBranch,{className:"mr-2 h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===C&&(0,t.jsx)(P.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]},e))]})]})]})})]}):(0,t.jsx)(M.Input,{id:"version-base-branch",value:C,onChange:e=>S(e.target.value),placeholder:"main",disabled:el})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{htmlFor:"version-start-date",children:c("version.field.startDate")}),(0,t.jsx)("input",{id:"version-start-date",type:"date",value:D,onChange:e=>T(e.target.value),disabled:el,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{htmlFor:"version-target-date",children:c("version.field.targetDate")}),(0,t.jsx)("input",{id:"version-target-date",type:"date",value:E,onChange:e=>B(e.target.value),disabled:el,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{htmlFor:"version-description",children:c("version.field.description")}),(0,t.jsx)(W.Textarea,{id:"version-description",value:I,onChange:e=>L(e.target.value),rows:3,disabled:el})]}),!m&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(K.Switch,{id:"version-set-current",checked:R,onCheckedChange:$,disabled:el}),(0,t.jsx)(F.Label,{htmlFor:"version-set-current",className:"cursor-pointer",children:c("version.field.setCurrent")})]})]}),(0,t.jsxs)(z.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:el,children:c("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{u.trim()&&f.trim()&&ed(async()=>{try{m&&i?await J(i.id,{number:u.trim(),name:f.trim(),typeId:b||null,baseBranch:C.trim()||null,startDate:ei(D)??null,targetDate:ei(E)??null,description:I.trim()||null}):await q({projectId:n,number:u.trim(),name:f.trim(),typeId:b||void 0,baseBranch:C.trim()||void 0,startDate:ei(D),targetDate:ei(E),description:I.trim()||void 0,setCurrent:R}),O.toast.success(m?c("version.edit"):c("version.new")),r(!1),d?.()}catch(e){O.toast.error(e instanceof Error?e.message:String(e))}})},disabled:el||!u.trim()||!f.trim(),children:m?c("common.save"):c("common.create")})]})]}),(0,t.jsx)(en,{open:y,onOpenChange:w,workspaceId:a,onChanged:()=>Q(a).then(N)})]})}let el=(0,Y.createServerReference)("607d43f807e4729ab016e3d8e2cbbcdbc8587e657a",Y.callServer,void 0,Y.findSourceMapURL,"releaseVersion");function ed({open:e,onOpenChange:r,version:n,candidates:a,onSuccess:i}){let{t:o}=(0,k.useI18n)(),[l,d]=(0,s.useState)(""),[c,m]=(0,s.useTransition)();(0,s.useEffect)(()=>{e&&d("")},[e,n]);let u=a.find(e=>e.id===l),p=a.length>0,h=p&&!!l&&!c;return(0,t.jsx)(z.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsx)(z.DialogTitle,{children:o("version.releaseAction")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[n&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[n.number," · ",n.name]}),(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{children:o("version.release.rolloverHint")}),n?.unfinishedCount!==void 0&&n.unfinishedCount>0&&(0,t.jsxs)("span",{className:"ml-1 font-medium text-foreground",children:["(",n.unfinishedCount,")"]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:o("version.release.nextVersion")}),p?(0,t.jsxs)(U.Select,{value:l,onValueChange:e=>{e&&d(e)},disabled:c,children:[(0,t.jsx)(U.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:u?`${u.number} \xb7 ${u.name}`:""})}),(0,t.jsx)(U.SelectContent,{children:a.map(e=>(0,t.jsxs)(U.SelectItem,{value:e.id,children:[e.number," · ",e.name]},e.id))})]}):(0,t.jsx)("p",{className:"text-xs text-destructive",children:o("version.release.noCandidates")})]})]}),(0,t.jsxs)(z.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:c,children:o("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{n&&l&&m(async()=>{try{await el(n.id,l),O.toast.success(o("version.release")),r(!1),i?.()}catch(e){O.toast.error(e instanceof Error?e.message:String(e))}})},disabled:!h,children:o("version.release")})]})]})})}var ec=e.i(400355);let ex=(0,Y.createServerReference)("40938a2b1707284760a38e1c2b00b901f558154a0b",Y.callServer,void 0,Y.findSourceMapURL,"getVersionDiff");var em=e.i(196199);function eu({file:e}){let{t:r}=(0,k.useI18n)(),[n,a]=(0,s.useState)(!0),i=e.to&&"/dev/null"!==e.to?e.to:e.from??"",l=e.additions??0,d=e.deletions??0,c=[];for(let t of e.chunks)for(let e of(c.push({type:"normal",content:t.content,chunkHeader:t.content}),t.changes))c.push({type:e.type,content:e.content});let x=c.length>500,m=x?c.slice(0,500):c;return(0,t.jsxs)("div",{className:"overflow-hidden rounded-[10px] border border-border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),className:"flex w-full items-center gap-2 bg-muted/40 px-3 py-2 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(o.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${n?"rotate-90":""}`}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono text-[12px] font-medium text-foreground",children:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-emerald-400",children:["+",l]}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-rose-400",children:["−",d]})]}),n&&(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsx)("pre",{className:"m-0 p-0",children:m.map((e,s)=>void 0!==e.chunkHeader?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground bg-muted/40",children:e.content},s):"add"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-emerald-300 bg-emerald-500/10",children:e.content},s):"del"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-rose-300 bg-rose-500/10",children:e.content},s):(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground",children:e.content},s))}),x&&(0,t.jsx)("p",{className:"border-t border-border px-3 py-2 text-[11px] text-muted-foreground/70 italic",children:r("version.diff.truncated")})]})]})}function ep({open:e,onOpenChange:r,versionId:n,versionLabel:a}){let{t:i}=(0,k.useI18n)(),[o,l]=(0,s.useTransition)(),[d,c]=(0,s.useState)(null),[x,m]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e&&n&&(c(null),m(!1),l(async()=>{let e=await ex(n);if(!e)return void m(!0);let t=(0,em.parseUnifiedDiff)(e.patch);0===t.length||""===e.patch?m(!0):c(t)}))},[e,n]),(0,t.jsx)(z.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(z.DialogContent,{className:"sm:max-w-3xl max-h-[80vh] overflow-auto",children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsxs)(z.DialogTitle,{children:[i("version.diff.title"),a?` — ${a}`:""]})}),o&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 text-muted-foreground",children:[(0,t.jsx)(ec.Loader2,{className:"h-5 w-5 animate-spin"}),(0,t.jsx)("span",{className:"text-sm",children:i("version.diff.loading")})]}),!o&&x&&(0,t.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:i("version.diff.empty")}),!o&&d&&d.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:d.map((e,s)=>(0,t.jsx)(eu,{file:e},s))})]})})}var eh=e.i(605005);function ef({version:e,isFirst:s,isLast:r,dashed:n=!1,diffStat:a,onEdit:i,onRelease:o,onViewDiff:l,onOpenTaskDetail:d}){return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:["w-px flex-none",s?"h-0":"h-6",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].filter(Boolean).join(" ")}),(0,t.jsx)("div",{className:["z-10 h-3.5 w-3.5 flex-none rounded-full border-2",e.isCurrent?"border-primary bg-primary ring-2 ring-primary/30":"ACTIVE"===e.status?"border-emerald-400 bg-emerald-400":"RELEASED"===e.status?"border-zinc-500 bg-zinc-500":"border-muted-foreground/40 bg-transparent border-dashed"].join(" ")}),!r&&(0,t.jsx)("div",{className:["w-px flex-1",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].join(" ")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsx)(A,{version:e,diffStat:a??null,onEdit:i,onRelease:o,onViewDiff:l,onOpenTaskDetail:d})})]})}e.s(["VersionTimelineClient",0,function({project:e,workspaceId:d,versions:u,diffStats:p,backlog:h}){let f,{t:g}=(0,k.useI18n)(),b=(0,r.useRouter)(),[v,j]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[S,D]=(0,s.useState)(!1),[T,E]=(0,s.useState)(null),[B,I]=(0,s.useState)(null),[L,R]=(0,s.useState)(null),[$,A]=(0,s.useState)(!1),O=[...[...u.filter(e=>"RELEASED"!==e.status)].sort((e,t)=>{if(!e.targetDate&&!t.targetDate)return 0;if(!e.targetDate)return 1;if(!t.targetDate)return -1;let s=new Date(t.targetDate).getTime()-new Date(e.targetDate).getTime();return 0!==s?s:new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}),...[...u.filter(e=>"RELEASED"===e.status)].sort((e,t)=>e.releasedAt||t.releasedAt?e.releasedAt?t.releasedAt?new Date(t.releasedAt).getTime()-new Date(e.releasedAt).getTime():-1:1:0)],P=e=>{let t=u.find(t=>t.id===e);t&&(y({id:t.id,number:t.number,name:t.name,typeId:t.typeId??null,baseBranch:t.baseBranch,startDate:t.startDate,targetDate:t.targetDate,description:t.description}),j(!0))},V=e=>{let t=u.find(t=>t.id===e);t&&(E(t),D(!0))},z=e=>{I(e)},M=()=>{y(null),j(!0)},F=()=>{b.refresh()},U=T?u.filter(e=>e.id!==T.id&&("PLANNED"===e.status||"ACTIVE"===e.status)).map(e=>({id:e.id,number:e.number,name:e.name})):[],H=T?T.tasks.filter(e=>"DONE"!==e.status&&"CANCELLED"!==e.status).length:void 0;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-xl flex shrink-0 items-center gap-4 border-b px-6",children:[(0,t.jsxs)(n.default,{href:`/workspaces/${d}`,className:"flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(l.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:g("archive.backToBoard")})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("span",{children:g("version.timeline")})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:()=>C(!0),children:[(0,t.jsx)(c,{className:"h-4 w-4"}),g("version.manageTypes")]}),(0,t.jsxs)(x.Button,{onClick:M,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),(0,t.jsx)(m.ScrollArea,{className:"min-h-0 flex-1",children:(0,t.jsx)("div",{className:"px-6 py-6",children:(0,t.jsxs)("div",{className:"mx-auto max-w-3xl",children:[0===u.length&&0===h.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 py-20 text-center text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:g("version.empty.list")}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:M,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),O.length>0&&(0,t.jsx)("div",{className:"relative",children:O.map((e,s)=>(0,t.jsx)(ef,{version:e,isFirst:0===s,isLast:s===O.length-1&&0===h.length,diffStat:p[e.id],onEdit:P,onRelease:V,onViewDiff:z,onOpenTaskDetail:R},e.id))}),h.length>0&&(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:"h-6 w-px bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]"}),(0,t.jsx)("div",{className:"z-10 h-3.5 w-3.5 flex-none rounded-full border-2 border-dashed border-muted-foreground/40 bg-transparent"})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-[14px] border border-dashed bg-muted/40 shadow-sm",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>A(e=>!e),className:"w-full px-4 py-3 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(o.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${$?"rotate-90":""}`}),(0,t.jsx)(i.Archive,{className:"h-4 w-4 flex-none text-muted-foreground/70"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:g("version.history")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:g("version.historySub")}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsxs)("span",{className:"text-[11.5px] text-muted-foreground",children:[h.length," ",g("version.tasksCount")]})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),$&&(0,t.jsx)("div",{className:"border-t border-dashed border-border px-2 pb-2 pt-1.5",children:h.map(e=>(0,t.jsx)(_,{task:e,onOpenDetail:R},e.id))})]})})]})]})})}),(0,t.jsx)(eo,{open:v,onOpenChange:e=>{j(e),e||y(null)},projectId:e.id,workspaceId:d,editVersion:N,defaultBaseBranch:null,projectLocalPath:e.localPath,onSuccess:F}),(0,t.jsx)(en,{open:w,onOpenChange:C,workspaceId:d,onChanged:()=>b.refresh()}),(0,t.jsx)(ed,{open:S,onOpenChange:e=>{D(e),e||E(null)},version:T?{id:T.id,number:T.number,name:T.name,unfinishedCount:H}:null,candidates:U,onSuccess:F}),(0,t.jsx)(ep,{open:!!B,onOpenChange:e=>{e||I(null)},versionId:B,versionLabel:B&&(f=u.find(e=>e.id===B))?`${f.number} ${f.name}`:void 0}),(0,t.jsx)(eh.TaskOverviewDrawer,{open:!!L,onOpenChange:e=>{e||R(null)},taskId:L})]})}],645119)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,645119,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(538059),n=e.i(210702),a=e.i(232545),i=e.i(487278),o=e.i(368490),l=e.i(259846),d=e.i(572989);let c=(0,d.default)("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);var x=e.i(519455),m=e.i(759684),u=e.i(606393),p=e.i(226145),h=e.i(340873),f=e.i(263938),g=e.i(960518),b=e.i(453889),v=e.i(645378);let j=(0,d.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var N=e.i(464249);let y=(0,d.default)("package-check",[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m16 17 2 2 4-4",key:"uh5qu3"}],["path",{d:"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753",key:"kpkbpo"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}]]),w=(0,d.default)("panel-right",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);var C=e.i(746798),S=e.i(685149),k=e.i(533499);let D=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function T(e){return D[function(e){let t=0;for(let s=0;s<e.length;s++)t=31*t+e.charCodeAt(s)>>>0;return t}(e)%D.length]}let E={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};function B({name:e}){let{t:s}=(0,k.useI18n)();return e?(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${T(e)}`,children:e}):(0,t.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:s("version.type.uncategorized")})}function I({status:e}){let{t:s}=(0,k.useI18n)();return(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${E[e]}`,children:s(`version.status.${e}`)})}function L(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${s}-${r}`}let R=Object.fromEntries(S.BOARD_COLUMNS.map(e=>[e.id,e.color]));function $({children:e,className:s}){return(0,t.jsx)("span",{className:`inline-flex items-center gap-1.5 rounded-md border border-border bg-muted/40 px-2 py-0.5 text-xs text-muted-foreground ${s??""}`,children:e})}function _({task:e,onOpenDetail:r}){let{t:n}=(0,k.useI18n)(),[a,i]=(0,s.useState)(!1),l="CANCELLED"===e.status?"text-muted-foreground line-through decoration-muted-foreground/40":"DONE"===e.status?"text-muted-foreground":"text-foreground";return(0,t.jsxs)("div",{className:"rounded-[10px]",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),className:"flex w-full items-center gap-2.5 rounded-[10px] px-2.5 py-2.5 text-left transition-colors hover:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(o.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${a?"rotate-90":""}`}),(0,t.jsx)("span",{className:`h-2 w-2 flex-none rounded-full ${R[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:`text-[13.5px] font-medium ${l}`,children:e.title}),e.labels.map(({label:e})=>(0,t.jsx)("span",{className:"rounded-full border border-border px-1.5 py-px text-[10.5px] text-muted-foreground",style:e.color?{borderColor:e.color+"55",color:e.color}:void 0,children:e.name},e.id)),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsx)("span",{className:"flex w-16 flex-none justify-center",children:(0,t.jsx)("span",{className:`rounded-[5px] px-1.5 py-px text-[10.5px] font-bold ${S.PRIORITY_CONFIG[e.priority]?.color??S.PRIORITY_CONFIG.LOW.color}`,children:e.priority})}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsxs)("span",{className:"flex w-[72px] flex-none items-center gap-1.5",children:[(0,t.jsx)("span",{className:`h-1.5 w-1.5 flex-none rounded-full ${R[e.status]??"bg-slate-400"}`}),(0,t.jsx)("span",{className:"truncate text-[10.5px] text-muted-foreground",children:n(`version.taskStatus.${e.status}`)})]}),(0,t.jsx)("span",{className:"h-3 w-px bg-border flex-none"}),(0,t.jsx)("span",{className:"flex w-6 flex-none justify-center",children:r&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground",onClick:t=>{t.stopPropagation(),r(e.id)}}),children:(0,t.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:n("version.detail")})]})})]}),a&&(0,t.jsxs)("div",{className:"flex flex-col gap-2.5 pb-3 pl-[30px] pr-3 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(b.FolderOpen,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.resources")})]}),0===e.assets.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.resources")}):(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:e.assets.map(e=>{var s;let r=e.mimeType?.startsWith("image/");return(0,t.jsxs)("span",{className:"inline-flex cursor-pointer items-center gap-1.5 rounded-lg border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground shadow-sm transition-colors hover:border-primary/50",children:[r?(0,t.jsx)(j,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(v.FileText,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("span",{children:e.filename}),null!=e.size&&(0,t.jsx)("span",{className:"text-[11px] text-muted-foreground/60",children:(s=e.size)<1024?`${s} B`:s<1048576?`${Math.round(s/1024)} KB`:`${(s/1048576).toFixed(1)} MB`})]},e.id)})})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(v.FileText,{className:"h-3 w-3 text-muted-foreground/60"}),(0,t.jsx)("span",{className:"text-[11px] font-bold uppercase tracking-wide text-muted-foreground/60",children:n("version.notes")})]}),0===e.notes.length?(0,t.jsx)("p",{className:"text-[12px] italic text-muted-foreground/60",children:n("version.empty.notes")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:e.notes.map(e=>(0,t.jsx)("div",{className:"rounded-lg border border-border border-l-violet-500/50 bg-background px-2.5 py-2 shadow-sm [border-left-width:3px]",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-[12.5px] font-semibold text-foreground",children:e.title}),e.category&&(0,t.jsx)("span",{className:"rounded-[5px] border border-violet-500/30 bg-violet-500/15 px-1.5 py-px text-[10px] font-bold text-violet-300",children:e.category})]})},e.id))})]})]})]})}function A({version:e,diffStat:r,onEdit:n,onRelease:a,onViewDiff:i,onOpenTaskDetail:l}){var d;let c,{t:m}=(0,k.useI18n)(),[b,v]=(0,s.useState)(e.isCurrent),j="RELEASED"===e.status,w="ACTIVE"===e.status,S=e.tasks.length,D=e.tasks.filter(e=>"DONE"===e.status).length,T=!!(e.releaseCommit||r),E=(c=`${S} ${m("version.tasksCount")}`,D>0&&D<S?`${c} \xb7 ${D} ${m("version.doneCount")}`:D>0&&D===S?`${c} \xb7 ${m("version.allDone")}`:c);return(0,t.jsxs)("div",{className:["overflow-hidden rounded-[14px] border bg-card shadow-sm transition-shadow duration-150 hover:shadow-md",e.isCurrent?"border-border border-l-2 border-l-primary ring-1 ring-primary/20":"border-border",j?"opacity-[.96]":""].filter(Boolean).join(" "),children:[(0,t.jsx)("button",{type:"button",onClick:()=>v(e=>!e),className:"w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,t.jsxs)("div",{className:"px-4 py-3.5",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(o.ChevronRight,{className:`h-4 w-4 flex-none text-muted-foreground/60 transition-transform duration-150 ${b?"rotate-90":""}`}),(0,t.jsx)("span",{className:"font-mono text-[14.5px] font-bold text-foreground",children:e.number}),(0,t.jsx)("span",{className:"text-[14.5px] font-semibold text-foreground",children:e.name}),(0,t.jsx)(B,{name:e.type?.name??null}),(0,t.jsx)(I,{status:e.status}),e.isCurrent&&(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/15 px-2.5 py-0.5 text-[11px] font-bold text-primary shadow-sm",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-primary opacity-90"}),m("version.current")]}),(0,t.jsx)("span",{className:"flex-1"}),S>0&&(0,t.jsx)("span",{className:"text-[11.5px] text-muted-foreground",children:E}),(0,t.jsxs)("span",{className:"flex items-center gap-1",onClick:e=>e.stopPropagation(),onKeyDown:e=>e.stopPropagation(),children:[n&&(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{render:(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>n(e.id)}),children:(0,t.jsx)(N.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(C.TooltipContent,{children:m("version.edit")})]}),w&&a&&(0,t.jsxs)(x.Button,{variant:"outline",className:"h-7 px-2 text-xs font-semibold",onClick:()=>a(e.id),children:[(0,t.jsx)(y,{className:"h-3.5 w-3.5"}),m("version.release")]})]})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[j&&e.releasedAt?(0,t.jsxs)($,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),m("version.releasedAt"),(0,t.jsx)("strong",{className:"text-foreground",children:L(e.releasedAt)})]}):e.startDate||e.targetDate?(0,t.jsxs)($,{children:[(0,t.jsx)(u.Calendar,{className:"h-3 w-3"}),e.startDate?L(e.startDate):"—"," → ",e.targetDate?(0,t.jsx)("strong",{className:"text-foreground",children:L(e.targetDate)}):"—"]}):null,e.baseBranch&&(0,t.jsxs)($,{children:[(0,t.jsx)(p.GitBranch,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.baseBranch})]}),e.baseCommit&&(0,t.jsxs)($,{children:[(0,t.jsx)(h.GitCommitHorizontal,{className:"h-3 w-3"}),m("version.field.baseCommit"),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:(d=e.baseCommit)?d.slice(0,7):""})]}),j&&(0,t.jsxs)($,{children:[(0,t.jsx)(f.Tag,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"font-mono text-[11px] text-foreground",children:e.number})]}),r&&(0,t.jsxs)($,{children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),!j&&(0,t.jsx)("span",{className:"text-muted-foreground",children:m("version.diff.live")}),(0,t.jsxs)("span",{className:"font-bold text-emerald-400",children:["+",r.additions.toLocaleString()]}),(0,t.jsxs)("span",{className:"font-bold text-rose-400",children:["−",r.deletions.toLocaleString()]}),(0,t.jsxs)("span",{className:"text-muted-foreground",children:["· ",r.files," ",m("version.diff.files")]})]}),T&&i&&(0,t.jsxs)(x.Button,{variant:"ghost",size:"sm",className:"h-6 gap-1 px-2 text-xs text-muted-foreground",onClick:t=>{t.stopPropagation(),i(e.id)},children:[(0,t.jsx)(g.GitCompare,{className:"h-3 w-3"}),m("version.diff.view")," →"]})]}),e.description&&(0,t.jsx)("p",{className:"mt-2 text-[13px] text-muted-foreground",children:e.description})]})}),b&&S>0&&(0,t.jsx)("div",{className:"border-t border-dashed border-border bg-muted/40 px-2 pb-2 pt-1.5",children:e.tasks.map(e=>(0,t.jsx)(_,{task:e,onOpenDetail:l},e.id))})]})}var O=e.i(360112),P=e.i(597746),V=e.i(456346),z=e.i(776639),M=e.i(793479),F=e.i(110204),U=e.i(918385),H=e.i(337822),G=e.i(317056),K=e.i(699375),W=e.i(624687),Y=e.i(514798);let q=(0,Y.createServerReference)("40b44e23b7976c6e055ad316ac3d412d84bf4fe23b",Y.callServer,void 0,Y.findSourceMapURL,"createVersion"),J=(0,Y.createServerReference)("605a3602b3b546fa7ea89dee88f68aa340c25d39d7",Y.callServer,void 0,Y.findSourceMapURL,"updateVersion"),Q=(0,Y.createServerReference)("40bf6543b3e4c86e9453e45a858a1e623476bcedd8",Y.callServer,void 0,Y.findSourceMapURL,"getVersionTypes");var X=e.i(200326),Z=e.i(660950),ee=e.i(998626);let et=(0,Y.createServerReference)("40717e538a65f3e5d8a4e6cd48d6844a24af3235a0",Y.callServer,void 0,Y.findSourceMapURL,"createVersionType"),es=(0,Y.createServerReference)("60f111a8b5094c1cae013c1c5611042a410d489365",Y.callServer,void 0,Y.findSourceMapURL,"updateVersionType"),er=(0,Y.createServerReference)("403f734762e2eec850ffd850b2e34da20895602a09",Y.callServer,void 0,Y.findSourceMapURL,"deleteVersionType");function en({open:e,onOpenChange:r,workspaceId:n,onChanged:a}){let{t:i}=(0,k.useI18n)(),[o,l]=(0,s.useState)([]),[d,c]=(0,s.useState)(""),[m,u]=(0,s.useState)({}),[p,h]=(0,s.useTransition)(),f=async()=>{let e=await Q(n);l(e),u(t=>{let s={};return e.forEach(e=>{s[e.id]=e.id in t?t[e.id]:e.name}),s})};(0,s.useEffect)(()=>{e&&(f(),c(""))},[e,n]);let g=()=>{let e=d.trim();e&&h(async()=>{try{await et({workspaceId:n,name:e}),c(""),await f(),a?.(),O.toast.success(i("version.type.add"))}catch(e){O.toast.error(e instanceof Error?e.message:String(e))}})};return(0,t.jsx)(z.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsx)(z.DialogTitle,{children:i("version.manageTypes")})}),(0,t.jsxs)("div",{className:"flex flex-col gap-4 py-2",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(M.Input,{value:d,onChange:e=>c(e.target.value),placeholder:i("version.type.namePlaceholder"),disabled:p,onKeyDown:e=>{"Enter"===e.key&&g()},className:"flex-1"}),(0,t.jsx)(x.Button,{onClick:g,disabled:p||!d.trim(),children:i("version.type.add")})]}),0===o.length?(0,t.jsx)("p",{className:"text-center text-sm text-muted-foreground py-4",children:i("version.type.empty")}):(0,t.jsx)("div",{className:"flex flex-col gap-1.5",children:o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsx)("span",{className:`inline-flex h-2.5 w-2.5 flex-none rounded-full ${T(m[e.id]??e.name).split(" ").filter(e=>e.startsWith("bg-"))[0]??"bg-muted"}`}),(0,t.jsx)(M.Input,{value:m[e.id]??e.name,onChange:t=>u(s=>({...s,[e.id]:t.target.value})),onBlur:()=>(e=>{let t=(m[e]??"").trim();if(!t)return;let s=o.find(t=>t.id===e);s?.name!==t&&h(async()=>{try{await es(e,{name:t}),await f(),a?.()}catch(t){O.toast.error(t instanceof Error?t.message:String(t)),u(t=>({...t,[e]:s?.name??""}))}})})(e.id),onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},disabled:p,className:"h-7 flex-1 border-transparent bg-transparent shadow-none focus-visible:border-input focus-visible:bg-background focus-visible:shadow-sm"}),(0,t.jsx)(x.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 flex-none text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void(window.confirm(i("version.type.deleteConfirm"))&&h(async()=>{try{await er(t),await f(),a?.()}catch(e){O.toast.error(e instanceof Error?e.message:String(e))}}))},disabled:p,children:(0,t.jsx)(ee.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))})]})]})})}function ea(e){if(!e)return"";let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let s=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${s}-${r}-${n}`}function ei(e){if(!e)return;let t=new Date(e);return isNaN(t.getTime())?void 0:t}function eo({open:e,onOpenChange:r,projectId:n,workspaceId:a,editVersion:i,defaultBaseBranch:o,projectLocalPath:l,onSuccess:d}){let{t:c}=(0,k.useI18n)(),m=!!i,[u,h]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[b,v]=(0,s.useState)(""),[j,N]=(0,s.useState)([]),[y,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(""),[D,T]=(0,s.useState)(""),[E,B]=(0,s.useState)(""),[I,L]=(0,s.useState)(""),[R,$]=(0,s.useState)(!1),[_,A]=(0,s.useState)([]),[Y,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(!1),er=!!l,[el,ed]=(0,s.useTransition)();return(0,s.useEffect)(()=>{e&&(i?(h(i.number),g(i.name),v(i.typeId??""),S(i.baseBranch??""),T(ea(i.startDate)),B(ea(i.targetDate)),L(i.description??"")):(h(""),g(""),v(""),S(o??""),T(""),B(""),L("")),$(!1))},[e,i,o]),(0,s.useEffect)(()=>{e&&Q(a).then(N).catch(()=>N([]))},[e,a]),(0,s.useEffect)(()=>{e&&er?(ee(!0),(0,X.getProjectBranches)(l).then(A).catch(()=>A([])).finally(()=>ee(!1)),(0,Z.fetchRemoteBranches)(l).then(()=>(0,X.getProjectBranches)(l).then(A)).catch(()=>{})):A([])},[e,er,l]),(0,t.jsxs)(z.Dialog,{open:e,onOpenChange:r,children:[(0,t.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsx)(z.DialogTitle,{children:m?c("version.edit"):c("version.new")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(F.Label,{htmlFor:"version-number",children:[c("version.field.number"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(M.Input,{id:"version-number",value:u,onChange:e=>h(e.target.value),placeholder:c("version.placeholder.number"),disabled:el})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsxs)(F.Label,{htmlFor:"version-name",children:[c("version.field.name"),(0,t.jsx)("span",{className:"text-destructive ml-0.5",children:"*"})]}),(0,t.jsx)(M.Input,{id:"version-name",value:f,onChange:e=>g(e.target.value),placeholder:c("version.placeholder.name"),disabled:el})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{children:c("version.field.type")}),(0,t.jsxs)(U.Select,{value:b||"__none__",onValueChange:e=>{v(e&&"__none__"!==e?e:"")},children:[(0,t.jsx)(U.SelectTrigger,{className:"w-full",disabled:el,children:(0,t.jsx)("span",{className:"truncate",children:b?j.find(e=>e.id===b)?.name??c("version.type.uncategorized"):c("version.type.uncategorized")})}),(0,t.jsxs)(U.SelectContent,{children:[(0,t.jsx)(U.SelectItem,{value:"__none__",children:c("version.type.uncategorized")}),j.map(e=>(0,t.jsx)(U.SelectItem,{value:e.id,children:e.name},e.id))]})]}),(0,t.jsxs)(x.Button,{type:"button",variant:"ghost",size:"sm",className:"h-auto justify-start px-0 py-0.5 text-xs text-muted-foreground hover:text-foreground",onClick:()=>w(!0),disabled:el,children:["+ ",c("version.manageTypes")]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{children:c("version.field.baseBranch")}),Y?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:c("task.branchLoading")}):er&&_.length>0?(0,t.jsxs)(H.Popover,{open:et,onOpenChange:es,children:[(0,t.jsxs)(H.PopoverTrigger,{className:"flex h-8 w-full items-center gap-2 rounded-lg border border-input bg-transparent px-3 text-sm transition-colors hover:bg-accent focus:outline-none focus-visible:ring-3 focus-visible:ring-ring/50 disabled:opacity-50",disabled:el,"data-testid":"version-branch-selector",children:[(0,t.jsx)(p.GitBranch,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:`flex-1 truncate text-left text-xs ${C?"font-mono":"text-muted-foreground"}`,title:C||void 0,children:C||c("version.field.noBranch")}),(0,t.jsx)(V.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(H.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(G.Command,{children:[(0,t.jsx)(G.CommandInput,{placeholder:c("task.branchSearch")}),(0,t.jsxs)(G.CommandList,{children:[(0,t.jsx)(G.CommandEmpty,{children:c("task.branchNone")}),(0,t.jsxs)(G.CommandGroup,{children:[(0,t.jsxs)(G.CommandItem,{value:"__none__",onSelect:()=>{S(""),es(!1)},children:[(0,t.jsx)("span",{className:"flex-1 truncate text-muted-foreground",children:c("version.field.noBranch")}),!C&&(0,t.jsx)(P.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]}),_.map(e=>(0,t.jsxs)(G.CommandItem,{value:e,onSelect:()=>{S(e),es(!1)},children:[(0,t.jsx)(p.GitBranch,{className:"mr-2 h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===C&&(0,t.jsx)(P.Check,{className:"ml-auto h-3 w-3 shrink-0 text-primary"})]},e))]})]})]})})]}):(0,t.jsx)(M.Input,{id:"version-base-branch",value:C,onChange:e=>S(e.target.value),placeholder:"main",disabled:el})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{htmlFor:"version-start-date",children:c("version.field.startDate")}),(0,t.jsx)("input",{id:"version-start-date",type:"date",value:D,onChange:e=>T(e.target.value),disabled:el,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{htmlFor:"version-target-date",children:c("version.field.targetDate")}),(0,t.jsx)("input",{id:"version-target-date",type:"date",value:E,onChange:e=>B(e.target.value),disabled:el,className:"h-8 w-full rounded-lg border border-input bg-transparent px-2.5 py-1 text-sm outline-none transition-colors focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50"})]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(F.Label,{htmlFor:"version-description",children:c("version.field.description")}),(0,t.jsx)(W.Textarea,{id:"version-description",value:I,onChange:e=>L(e.target.value),rows:3,disabled:el})]}),!m&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(K.Switch,{id:"version-set-current",checked:R,onCheckedChange:$,disabled:el}),(0,t.jsx)(F.Label,{htmlFor:"version-set-current",className:"cursor-pointer",children:c("version.field.setCurrent")})]})]}),(0,t.jsxs)(z.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:el,children:c("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{u.trim()&&f.trim()&&ed(async()=>{try{m&&i?await J(i.id,{number:u.trim(),name:f.trim(),typeId:b||null,baseBranch:C.trim()||null,startDate:ei(D)??null,targetDate:ei(E)??null,description:I.trim()||null}):await q({projectId:n,number:u.trim(),name:f.trim(),typeId:b||void 0,baseBranch:C.trim()||void 0,startDate:ei(D),targetDate:ei(E),description:I.trim()||void 0,setCurrent:R}),O.toast.success(m?c("version.edit"):c("version.new")),r(!1),d?.()}catch(e){O.toast.error(e instanceof Error?e.message:String(e))}})},disabled:el||!u.trim()||!f.trim(),children:m?c("common.save"):c("common.create")})]})]}),(0,t.jsx)(en,{open:y,onOpenChange:w,workspaceId:a,onChanged:()=>Q(a).then(N)})]})}let el=(0,Y.createServerReference)("60c9b2b22809c793bfbd725fb65bc547658da78d75",Y.callServer,void 0,Y.findSourceMapURL,"releaseVersion");function ed({open:e,onOpenChange:r,version:n,candidates:a,onSuccess:i}){let{t:o}=(0,k.useI18n)(),[l,d]=(0,s.useState)(""),[c,m]=(0,s.useTransition)();(0,s.useEffect)(()=>{e&&d("")},[e,n]);let u=a.find(e=>e.id===l),p=a.length>0,h=p&&!!l&&!c;return(0,t.jsx)(z.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(z.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsx)(z.DialogTitle,{children:o("version.releaseAction")})}),(0,t.jsxs)("div",{className:"grid gap-4 py-2",children:[n&&(0,t.jsxs)("p",{className:"text-sm text-muted-foreground",children:[n.number," · ",n.name]}),(0,t.jsxs)("div",{className:"text-sm",children:[(0,t.jsx)("span",{children:o("version.release.rolloverHint")}),n?.unfinishedCount!==void 0&&n.unfinishedCount>0&&(0,t.jsxs)("span",{className:"ml-1 font-medium text-foreground",children:["(",n.unfinishedCount,")"]})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:o("version.release.nextVersion")}),p?(0,t.jsxs)(U.Select,{value:l,onValueChange:e=>{e&&d(e)},disabled:c,children:[(0,t.jsx)(U.SelectTrigger,{className:"w-full",children:(0,t.jsx)("span",{className:"truncate",children:u?`${u.number} \xb7 ${u.name}`:""})}),(0,t.jsx)(U.SelectContent,{children:a.map(e=>(0,t.jsxs)(U.SelectItem,{value:e.id,children:[e.number," · ",e.name]},e.id))})]}):(0,t.jsx)("p",{className:"text-xs text-destructive",children:o("version.release.noCandidates")})]})]}),(0,t.jsxs)(z.DialogFooter,{children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:()=>r(!1),disabled:c,children:o("common.cancel")}),(0,t.jsx)(x.Button,{onClick:()=>{n&&l&&m(async()=>{try{await el(n.id,l),O.toast.success(o("version.release")),r(!1),i?.()}catch(e){O.toast.error(e instanceof Error?e.message:String(e))}})},disabled:!h,children:o("version.release")})]})]})})}var ec=e.i(400355);let ex=(0,Y.createServerReference)("40e06e60ebfe85c02e5e9ffce12c61be529657f243",Y.callServer,void 0,Y.findSourceMapURL,"getVersionDiff");var em=e.i(196199);function eu({file:e}){let{t:r}=(0,k.useI18n)(),[n,a]=(0,s.useState)(!0),i=e.to&&"/dev/null"!==e.to?e.to:e.from??"",l=e.additions??0,d=e.deletions??0,c=[];for(let t of e.chunks)for(let e of(c.push({type:"normal",content:t.content,chunkHeader:t.content}),t.changes))c.push({type:e.type,content:e.content});let x=c.length>500,m=x?c.slice(0,500):c;return(0,t.jsxs)("div",{className:"overflow-hidden rounded-[10px] border border-border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>a(e=>!e),className:"flex w-full items-center gap-2 bg-muted/40 px-3 py-2 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsx)(o.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${n?"rotate-90":""}`}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono text-[12px] font-medium text-foreground",children:i}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-emerald-400",children:["+",l]}),(0,t.jsxs)("span",{className:"shrink-0 font-mono text-[11px] font-bold text-rose-400",children:["−",d]})]}),n&&(0,t.jsxs)("div",{className:"overflow-x-auto",children:[(0,t.jsx)("pre",{className:"m-0 p-0",children:m.map((e,s)=>void 0!==e.chunkHeader?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground bg-muted/40",children:e.content},s):"add"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-emerald-300 bg-emerald-500/10",children:e.content},s):"del"===e.type?(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-rose-300 bg-rose-500/10",children:e.content},s):(0,t.jsx)("div",{className:"whitespace-pre px-3 py-px font-mono text-xs text-muted-foreground",children:e.content},s))}),x&&(0,t.jsx)("p",{className:"border-t border-border px-3 py-2 text-[11px] text-muted-foreground/70 italic",children:r("version.diff.truncated")})]})]})}function ep({open:e,onOpenChange:r,versionId:n,versionLabel:a}){let{t:i}=(0,k.useI18n)(),[o,l]=(0,s.useTransition)(),[d,c]=(0,s.useState)(null),[x,m]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{e&&n&&(c(null),m(!1),l(async()=>{let e=await ex(n);if(!e)return void m(!0);let t=(0,em.parseUnifiedDiff)(e.patch);0===t.length||""===e.patch?m(!0):c(t)}))},[e,n]),(0,t.jsx)(z.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(z.DialogContent,{className:"sm:max-w-3xl max-h-[80vh] overflow-auto",children:[(0,t.jsx)(z.DialogHeader,{children:(0,t.jsxs)(z.DialogTitle,{children:[i("version.diff.title"),a?` — ${a}`:""]})}),o&&(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 text-muted-foreground",children:[(0,t.jsx)(ec.Loader2,{className:"h-5 w-5 animate-spin"}),(0,t.jsx)("span",{className:"text-sm",children:i("version.diff.loading")})]}),!o&&x&&(0,t.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:i("version.diff.empty")}),!o&&d&&d.length>0&&(0,t.jsx)("div",{className:"flex flex-col gap-2",children:d.map((e,s)=>(0,t.jsx)(eu,{file:e},s))})]})})}var eh=e.i(605005);function ef({version:e,isFirst:s,isLast:r,dashed:n=!1,diffStat:a,onEdit:i,onRelease:o,onViewDiff:l,onOpenTaskDetail:d}){return(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:["w-px flex-none",s?"h-0":"h-6",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].filter(Boolean).join(" ")}),(0,t.jsx)("div",{className:["z-10 h-3.5 w-3.5 flex-none rounded-full border-2",e.isCurrent?"border-primary bg-primary ring-2 ring-primary/30":"ACTIVE"===e.status?"border-emerald-400 bg-emerald-400":"RELEASED"===e.status?"border-zinc-500 bg-zinc-500":"border-muted-foreground/40 bg-transparent border-dashed"].join(" ")}),!r&&(0,t.jsx)("div",{className:["w-px flex-1",n?"bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]":"bg-border"].join(" ")})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsx)(A,{version:e,diffStat:a??null,onEdit:i,onRelease:o,onViewDiff:l,onOpenTaskDetail:d})})]})}e.s(["VersionTimelineClient",0,function({project:e,workspaceId:d,versions:u,diffStats:p,backlog:h}){let f,{t:g}=(0,k.useI18n)(),b=(0,r.useRouter)(),[v,j]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null),[w,C]=(0,s.useState)(!1),[S,D]=(0,s.useState)(!1),[T,E]=(0,s.useState)(null),[B,I]=(0,s.useState)(null),[L,R]=(0,s.useState)(null),[$,A]=(0,s.useState)(!1),O=[...[...u.filter(e=>"RELEASED"!==e.status)].sort((e,t)=>{if(!e.targetDate&&!t.targetDate)return 0;if(!e.targetDate)return 1;if(!t.targetDate)return -1;let s=new Date(t.targetDate).getTime()-new Date(e.targetDate).getTime();return 0!==s?s:new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()}),...[...u.filter(e=>"RELEASED"===e.status)].sort((e,t)=>e.releasedAt||t.releasedAt?e.releasedAt?t.releasedAt?new Date(t.releasedAt).getTime()-new Date(e.releasedAt).getTime():-1:1:0)],P=e=>{let t=u.find(t=>t.id===e);t&&(y({id:t.id,number:t.number,name:t.name,typeId:t.typeId??null,baseBranch:t.baseBranch,startDate:t.startDate,targetDate:t.targetDate,description:t.description}),j(!0))},V=e=>{let t=u.find(t=>t.id===e);t&&(E(t),D(!0))},z=e=>{I(e)},M=()=>{y(null),j(!0)},F=()=>{b.refresh()},U=T?u.filter(e=>e.id!==T.id&&("PLANNED"===e.status||"ACTIVE"===e.status)).map(e=>({id:e.id,number:e.number,name:e.name})):[],H=T?T.tasks.filter(e=>"DONE"!==e.status&&"CANCELLED"!==e.status).length:void 0;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-xl flex shrink-0 items-center gap-4 border-b px-6",children:[(0,t.jsxs)(n.default,{href:`/workspaces/${d}`,className:"flex items-center gap-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[(0,t.jsx)(l.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:g("archive.backToBoard")})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{className:"truncate font-medium",children:e.name}),(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("span",{children:g("version.timeline")})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:()=>C(!0),children:[(0,t.jsx)(c,{className:"h-4 w-4"}),g("version.manageTypes")]}),(0,t.jsxs)(x.Button,{onClick:M,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),(0,t.jsx)(m.ScrollArea,{className:"min-h-0 flex-1",children:(0,t.jsx)("div",{className:"px-6 py-6",children:(0,t.jsxs)("div",{className:"mx-auto max-w-3xl",children:[0===u.length&&0===h.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4 py-20 text-center text-muted-foreground",children:[(0,t.jsx)("p",{className:"text-sm",children:g("version.empty.list")}),(0,t.jsxs)(x.Button,{variant:"outline",onClick:M,children:[(0,t.jsx)(a.Plus,{className:"h-4 w-4"}),g("version.new")]})]}),O.length>0&&(0,t.jsx)("div",{className:"relative",children:O.map((e,s)=>(0,t.jsx)(ef,{version:e,isFirst:0===s,isLast:s===O.length-1&&0===h.length,diffStat:p[e.id],onEdit:P,onRelease:V,onViewDiff:z,onOpenTaskDetail:R},e.id))}),h.length>0&&(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"relative flex w-5 flex-none flex-col items-center",children:[(0,t.jsx)("div",{className:"h-6 w-px bg-[repeating-linear-gradient(to_bottom,var(--border)_0_4px,transparent_4px_8px)]"}),(0,t.jsx)("div",{className:"z-10 h-3.5 w-3.5 flex-none rounded-full border-2 border-dashed border-muted-foreground/40 bg-transparent"})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1 pb-5",children:(0,t.jsxs)("div",{className:"overflow-hidden rounded-[14px] border border-dashed bg-muted/40 shadow-sm",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>A(e=>!e),className:"w-full px-4 py-3 text-left transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(o.ChevronRight,{className:`h-3.5 w-3.5 flex-none text-muted-foreground/60 transition-transform duration-150 ${$?"rotate-90":""}`}),(0,t.jsx)(i.Archive,{className:"h-4 w-4 flex-none text-muted-foreground/70"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:g("version.history")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:g("version.historySub")}),(0,t.jsx)("span",{className:"flex-1"}),(0,t.jsxs)("span",{className:"text-[11.5px] text-muted-foreground",children:[h.length," ",g("version.tasksCount")]})]}),(0,t.jsx)("p",{className:"mt-2 text-xs text-muted-foreground/70",children:g("version.historyHint")})]}),$&&(0,t.jsx)("div",{className:"border-t border-dashed border-border px-2 pb-2 pt-1.5",children:h.map(e=>(0,t.jsx)(_,{task:e,onOpenDetail:R},e.id))})]})})]})]})})}),(0,t.jsx)(eo,{open:v,onOpenChange:e=>{j(e),e||y(null)},projectId:e.id,workspaceId:d,editVersion:N,defaultBaseBranch:null,projectLocalPath:e.localPath,onSuccess:F}),(0,t.jsx)(en,{open:w,onOpenChange:C,workspaceId:d,onChanged:()=>b.refresh()}),(0,t.jsx)(ed,{open:S,onOpenChange:e=>{D(e),e||E(null)},version:T?{id:T.id,number:T.number,name:T.name,unfinishedCount:H}:null,candidates:U,onSuccess:F}),(0,t.jsx)(ep,{open:!!B,onOpenChange:e=>{e||I(null)},versionId:B,versionLabel:B&&(f=u.find(e=>e.id===B))?`${f.number} ${f.name}`:void 0}),(0,t.jsx)(eh.TaskOverviewDrawer,{open:!!L,onOpenChange:e=>{e||R(null)},taskId:L})]})}],645119)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,408101,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("4011f2b8a420d565b4e614611bf6c9b8c4bbcb956c",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,s])},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)},797094,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40440adf3dd8ccc8e058a09ab80ef012fef1b3918c",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,s])},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),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})]})}])},3362,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40b7b8b2cbef88b304d3b9cfc4821bd8151139b07c",t.callServer,void 0,t.findSourceMapURL,"stopPtyExecution");e.s(["stopPtyExecution",0,s])},294980,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7cced4d6bbbc0361ac95456e1084d9fbeac9dcf643",t.callServer,void 0,t.findSourceMapURL,"startPtyExecution");e.s(["startPtyExecution",0,s])},429416,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60e5cfd3f1474bccccfb4d683c94275923cb38e8f0",t.callServer,void 0,t.findSourceMapURL,"resumePtyExecution");e.s(["resumePtyExecution",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 $(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 L(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=L(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=L(r.matches,{ignoreFieldNorm:s}),t.shouldInsert(r.score)&&t.insert(r)):n.push(r)}}),n}_searchLogical(e){let t=$(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=L(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=$,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)("0037197d4d0b1a5b4b2309208f48b158f7e0b2094d",i.callServer,void 0,i.findSourceMapURL,"getActiveExecutionsAcrossWorkspaces");var a=e.i(3362);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(408101);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(797094),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(){let t=e.worktreePath??e.projectLocalPath;if(!t)return;let s=e.subPath?`${t}/${e.subPath}`:t;try{await (0,E.openInTerminal)(s)}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)("40f3e527405d2712c2a4ac24561fc473dca8c32f55",i.callServer,void 0,i.findSourceMapURL,"getWorkspacesWithRecentTasks"),F=(0,i.createServerReference)("40d22e576a810894635e6c9beb35c434e86f168035",i.callServer,void 0,i.findSourceMapURL,"getProjectTasks");var R=e.i(294980),T=e.i(429416),$=e.i(793479),L=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)(L.Dialog,{open:e,onOpenChange:i,children:(0,t.jsxs)(L.DialogContent,{className:"sm:max-w-2xl max-h-[80vh]",children:[(0,t.jsx)(L.DialogHeader,{children:(0,t.jsx)(L.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)($.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,$]=(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;$(`${Math.max(t,200)}px`)};t();let s=new ResizeObserver(t);return s.observe(e),()=>s.disconnect()},[F]);let L=(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:L}),(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)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let a=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,a],181209)},236967,e=>{"use strict";var t=e.i(289721),a=e.i(210702),r=e.i(538059),s=e.i(259846),i=e.i(645378),l=e.i(453889),n=e.i(487278),d=e.i(533499);let o=[{key:"notes",icon:i.FileText},{key:"assets",icon:l.FolderOpen},{key:"archive",icon:n.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:i}=(0,d.useI18n)(),l=(0,r.usePathname)(),n=o.find(e=>l.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(a.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(s.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),o.map(r=>{let s=r.icon,l=n===r.key;return(0,t.jsxs)(a.default,{href:`/workspaces/${e}/${r.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${l?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:i(`sidebar.${r.key}`)})]},r.key)})]})}])},245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},487486,e=>{"use strict";var t=e.i(565455),a=e.i(581263),r=e.i(294237),s=e.i(975157);let i=(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:l,...n}){var d;return d={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,s.cn)(i({variant:r}),e)},n),render:l,state:{slot:"badge",variant:r}},(0,a.useRenderElement)(d.defaultTagName??"div",d,d)}],487486)},797094,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40440adf3dd8ccc8e058a09ab80ef012fef1b3918c",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,a])},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},132422,77890,12659,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("405dfc43cd11ae435ef60de537636f1ad4e1b6d324",t.callServer,void 0,t.findSourceMapURL,"openInFileManager");e.s(["openInFileManager",0,a],132422);let r=(0,t.createServerReference)("405d38c1dfe222d25c80e82e946d93bfdbdf42de9d",t.callServer,void 0,t.findSourceMapURL,"openInEditor");e.s(["openInEditor",0,r],77890);let s=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,s],12659)},736061,460707,e=>{"use strict";var t=e.i(572989);let a=(0,t.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);e.s(["FolderSearch",0,a],736061);let r=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,r],460707)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},685149,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},875840,e=>{"use strict";let t=(0,e.i(572989).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,t],875840)},408101,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("4011f2b8a420d565b4e614611bf6c9b8c4bbcb956c",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,a])},110204,e=>{"use strict";var t=e.i(289721),a=e.i(975157);e.s(["Label",0,function({className:e,...r}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,a.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}])},980376,477826,e=>{"use strict";var t=e.i(289721),a=e.i(225061),r=e.i(975157),s=e.i(519455),i=e.i(670123);function l({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function n({className:e,...s}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,r.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...s})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:d,side:o="right",showCloseButton:c=!0,...u}){return(0,t.jsxs)(l,{children:[(0,t.jsx)(n,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":o,className:(0,r.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...u,children:[d,c&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(s.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(i.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...s})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,r.cn)("flex flex-col gap-0.5 p-4",e),...a})},"SheetTitle",0,function({className:e,...s}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,r.cn)("font-heading text-base font-medium text-foreground",e),...s})}],980376);var d=e.i(514798);let o=(0,d.createServerReference)("40e4dfe6a3b899cdd4196ae7070a035d81655e1385",d.callServer,void 0,d.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,o],477826)},606393,e=>{"use strict";let t=(0,e.i(572989).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],606393)},605005,e=>{"use strict";var t=e.i(289721),a=e.i(965652),r=e.i(980376),s=e.i(759684),i=e.i(487486),l=e.i(519455),n=e.i(533499),d=e.i(392239),o=e.i(477826),c=e.i(805190),u=e.i(132422),x=e.i(77890),m=e.i(797094),h=e.i(744798),p=e.i(685149),g=e.i(606393),f=e.i(875840),b=e.i(245697),v=e.i(12659),y=e.i(736061),j=e.i(460707),N=e.i(567860);function k({added:e,removed:a}){let{t:r}=(0,n.useI18n)();return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,t.jsx)("span",{children:r("diff.filesChanged",{count:String(e+a)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),a>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",a]})]})}var w=e.i(360112);e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:S,taskId:C}){let{t:I}=(0,n.useI18n)(),[T,D]=(0,a.useState)(null),[E,O]=(0,a.useTransition)(),[R,M]=(0,a.useState)(!1),[A,P]=(0,a.useState)([]);(0,a.useEffect)(()=>{C&&e?O(async()=>{let e=await (0,o.getTaskOverview)(C);e&&(D(e),e.project?.workspaceId&&(0,c.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{P(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>P([])))}):D(null)},[C,e]);let L=T?p.BOARD_COLUMNS.find(e=>e.id===T.status):null,B=T?p.PRIORITY_CONFIG[T.priority]:null,$=T?.executions?.[0]??null,F=(()=>{if($?.worktreePath)return $.worktreePath;let e=T?.project?.localPath;return e?T?.subPath?`${e}/${T.subPath}`:e:null})(),z=(()=>{let e=$?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),U=async e=>{if(T?.project)try{let{autoStart:t,...a}=e;await (0,d.createTask)({...a,projectId:T.project.id}),w.toast.success(I("taskDrawer.duplicateSuccess")),M(!1),S(!1)}catch{w.toast.error(I("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(r.Sheet,{open:e,onOpenChange:S,children:[(0,t.jsxs)(r.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(r.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(r.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:T?.title??""}),(0,t.jsx)(r.SheetDescription,{className:"sr-only",children:I("taskDrawer.title")}),T&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[L&&(0,t.jsxs)(i.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${L.color}`}),L.label]}),B&&(0,t.jsx)(i.Badge,{variant:"secondary",className:`text-xs ${B.color}`,children:B.label})]})]}),(0,t.jsx)(s.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:E&&!T?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:I("assets.loading")}):T?(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:I("taskDrawer.description")}),(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:T.description||I("taskDrawer.noDescription")})]}),T.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:I("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:T.labels.map(e=>(0,t.jsx)(i.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(g.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:I("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(T.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(b.Package,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:I("taskDrawer.resources")}),(0,t.jsx)("span",{className:"text-foreground",children:T._count.assets})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:I("taskDrawer.fileChanges")}),z?(0,t.jsx)(k,{added:z.added,removed:z.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:I("taskDrawer.noFileChanges")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(v.PlayCircle,{className:"h-3.5 w-3.5"}),I("taskDrawer.lastExecution")]}),$?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(i.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:$.status}),$.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:$.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:I("taskDrawer.noExecution")})]}),F&&(0,t.jsxs)("section",{className:"flex flex-col",children:[(0,t.jsxs)(l.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,u.openInFileManager)(F)}catch(e){console.error("openInFileManager failed:",e),w.toast.error(I("git.openInFileManagerFailed"))}},children:[(0,t.jsx)(y.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),I("git.openInFileManager")]}),(0,t.jsxs)(l.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,x.openInEditor)(F)}catch(e){console.error("openInEditor failed:",e),w.toast.error(I("git.openInEditorFailed"))}},children:[(0,t.jsx)(j.Code,{className:"h-3.5 w-3.5 shrink-0"}),I("git.openInEditor")]}),(0,t.jsxs)(l.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,m.openInTerminal)(F)}catch(e){console.error("openInTerminal failed:",e),w.toast.error(I("git.openInTerminalFailed"))}},children:[(0,t.jsx)(N.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),I("git.openInTerminal")]})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(l.Button,{variant:"default",className:"w-full",onClick:()=>{T&&M(!0)},disabled:!T,children:[(0,t.jsx)(f.Copy,{className:"h-4 w-4"}),I("taskDrawer.duplicate")]})})]}):null})]}),T?.project&&(0,t.jsx)(h.CreateTaskDialog,{open:R,onOpenChange:M,onSubmit:U,labels:A,projectType:T.project.type,projectLocalPath:T.project.localPath,prefillFromTask:{title:T.title,description:T.description,priority:T.priority,subPath:T.subPath,labelIds:T.labels.map(e=>e.label.id),baseBranch:T.baseBranch}})]})}],605005)},107830,e=>{"use strict";var t=e.i(289721),a=e.i(965652),r=e.i(487278),s=e.i(301348),i=e.i(181209),l=e.i(400355),n=e.i(918385),d=e.i(533499),o=e.i(236967),c=e.i(514798);let u=(0,c.createServerReference)("40391fa51cebfb924b0b26d0a3c045b58f9fbf1169",c.callServer,void 0,c.findSourceMapURL,"getArchivedTasks");var x=e.i(605005);function m(e){return new Date(e).toLocaleDateString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}function h({priority:e}){return(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${{LOW:"bg-slate-400",MEDIUM:"bg-amber-400",HIGH:"bg-orange-500",CRITICAL:"bg-rose-500"}[e]??"bg-slate-400"}`})}e.s(["ArchivePageClient",0,function({allWorkspaces:e,initialWorkspaceId:c,initialProjectId:p,initialTasks:g}){let f,{t:b}=(0,d.useI18n)(),[v,y]=(0,a.useTransition)(),[j,N]=(0,a.useState)(c),[k,w]=(0,a.useState)(p),[S,C]=(0,a.useState)(g),[I,T]=(0,a.useState)(null),D=e.find(e=>e.id===j),E=D?.projects??[],O=(0,a.useCallback)(e=>{e?y(async()=>{C(await u(e))}):C([])},[y]);return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(o.SubPageNav,{workspaceId:j}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(n.Select,{value:j,onValueChange:t=>t&&(t=>{if(t===j)return;N(t);let a=e.find(e=>e.id===t),r=a?.projects[0]??null;w(r?.id??null),O(r?.id??null)})(t),children:[(0,t.jsx)(n.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:D?.name??j})}),(0,t.jsx)(n.SelectContent,{children:e.map(e=>(0,t.jsx)(n.SelectItem,{value:e.id,children:e.name},e.id))})]}),E.length>0&&(0,t.jsxs)(n.Select,{value:k??"",onValueChange:e=>e&&void(e!==k&&(w(e),O(e))),children:[(0,t.jsx)(n.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(f=E.find(e=>e.id===k))?f.alias?`${f.name} (${f.alias})`:f.name:""})}),(0,t.jsx)(n.SelectContent,{children:E.map(e=>(0,t.jsxs)(n.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,t.jsxs)("span",{className:"ml-auto rounded-full bg-muted px-2.5 py-0.5 text-[11px] text-muted-foreground",children:[S.length," ",b("archive.tasksCount")]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,t.jsxs)("div",{className:`relative ${v?"opacity-40 pointer-events-none":""} transition-opacity`,children:[v&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(l.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===S.length?(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)(r.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:b("archive.noTasks")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:b("archive.noTasksDesc")})]}):(0,t.jsx)("div",{className:"space-y-2",children:S.map(e=>{let a="DONE"===e.status,r=e.executions[0];return(0,t.jsx)("div",{role:"button",tabIndex:0,onClick:()=>T(e.id),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),T(e.id))},className:"group cursor-pointer rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:border-border/80 hover:bg-accent/30 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-0.5 shrink-0",children:a?(0,t.jsx)(s.CheckCircle2,{className:"h-4 w-4 text-emerald-500"}):(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-rose-500"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(h,{priority:e.priority}),(0,t.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.title}),(0,t.jsx)("span",{className:`ml-1 shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium ${a?"bg-emerald-500/10 text-emerald-400 ring-1 ring-emerald-500/20":"bg-rose-500/10 text-rose-400 ring-1 ring-rose-500/20"}`,children:a?b("archive.status.done"):b("archive.status.cancelled")})]}),e.labels.length>0&&(0,t.jsx)("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.labels.map(e=>(0,t.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,outline:`1px solid ${e.label.color}40`},children:e.label.name},e.label.id))}),(0,t.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{children:[b("archive.createdAt"),": ",m(e.createdAt)]}),(0,t.jsxs)("span",{children:[a?b("archive.completedAt"):b("archive.cancelledAt"),": ",m(e.updatedAt)]}),r&&(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[b("archive.lastExecution"),":"," ",(0,t.jsx)("span",{className:`rounded px-1 py-0.5 font-mono text-[10px] ${"COMPLETED"===r.status?"bg-emerald-500/10 text-emerald-400":"FAILED"===r.status?"bg-rose-500/10 text-rose-400":"bg-amber-500/10 text-amber-400"}`,children:r.status})]})]})]})]})},e.id)})})]})}),(0,t.jsx)(x.TaskOverviewDrawer,{open:!!I,onOpenChange:e=>{e||T(null)},taskId:I})]})}],107830)}]);