tower-studio 0.2.7 → 0.2.8

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 (236) 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 +41 -41
  13. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.rsc +14 -14
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +14 -14
  18. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  19. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +9 -9
  20. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  22. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/standalone/.next/server/app/api/adapters/test/route.js +3 -2
  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.nft.json +1 -1
  26. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js +1 -1
  28. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +1 -1
  29. package/.next/standalone/.next/server/app/index.html +1 -1
  30. package/.next/standalone/.next/server/app/index.rsc +14 -14
  31. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  32. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +14 -14
  33. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  34. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +9 -9
  35. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  36. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  37. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +71 -71
  38. package/.next/standalone/.next/server/app/missions/page.js +5 -5
  39. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  41. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  42. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +41 -41
  43. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  45. package/.next/standalone/.next/server/app/onboarding.html +1 -1
  46. package/.next/standalone/.next/server/app/onboarding.rsc +16 -16
  47. package/.next/standalone/.next/server/app/onboarding.segments/_full.segment.rsc +16 -16
  48. package/.next/standalone/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
  49. package/.next/standalone/.next/server/app/onboarding.segments/_index.segment.rsc +9 -9
  50. package/.next/standalone/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
  51. package/.next/standalone/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
  52. package/.next/standalone/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
  53. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  54. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +41 -41
  55. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  56. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  57. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  58. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +54 -54
  59. package/.next/standalone/.next/server/app/settings/page.js +3 -3
  60. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  62. package/.next/standalone/.next/server/app/settings.html +1 -1
  63. package/.next/standalone/.next/server/app/settings.rsc +16 -16
  64. package/.next/standalone/.next/server/app/settings.segments/_full.segment.rsc +16 -16
  65. package/.next/standalone/.next/server/app/settings.segments/_head.segment.rsc +4 -4
  66. package/.next/standalone/.next/server/app/settings.segments/_index.segment.rsc +9 -9
  67. package/.next/standalone/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  68. package/.next/standalone/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
  69. package/.next/standalone/.next/server/app/settings.segments/settings.segment.rsc +3 -3
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +98 -98
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +82 -82
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +71 -71
  80. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  82. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +70 -70
  84. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +3 -3
  85. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  86. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  87. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  88. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +41 -41
  89. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  90. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  91. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  92. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +74 -74
  93. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  94. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  95. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  96. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +80 -80
  97. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +5 -5
  98. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  100. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  101. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +59 -59
  102. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  104. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
  105. package/.next/standalone/.next/server/chunks/[root-of-the-server]__028ucbo._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03gi3ue._.js +1 -1
  107. package/.next/standalone/.next/server/chunks/[root-of-the-server]__07f7~6u._.js +1 -1
  108. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_90467._.js +3 -0
  109. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d~z6xs._.js +1 -1
  110. package/.next/standalone/.next/server/chunks/_0_w835g._.js +4 -0
  111. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/src_lib_0ba0ntr._.js +1 -1
  113. package/.next/standalone/.next/server/chunks/src_lib_ai_0q-~me1._.js +1 -1
  114. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  115. package/.next/standalone/.next/server/chunks/src_lib_ai_providers_index_ts_0.y.3vp._.js +1 -1
  116. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  117. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.ukame._.js +1 -1
  118. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__006_qh0._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01j8ix6._.js +1 -1
  120. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02px.0y._.js +1 -1
  121. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03ebsif._.js +3 -3
  122. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0o8k4pc._.js → [root-of-the-server]__08901f9._.js} +2 -2
  123. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ca_ueb._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dsdplu._.js +1 -1
  125. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0l43.5g._.js +1 -1
  126. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0zujp5l._.js → [root-of-the-server]__0miur_1._.js} +2 -2
  127. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0n.cuy2._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nbj.ml._.js +1 -1
  129. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ojv-d0._.js +3 -0
  130. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pm2~fu._.js +1 -1
  131. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ps55l6._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ribsk4._.js +1 -1
  133. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rjue04._.js +1 -1
  134. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0souuv~._.js +3 -0
  135. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tc6uh2._.js +1 -1
  136. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0v2eslh._.js +1 -1
  137. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wjg_.n._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wlmzzq._.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0wvyks.._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zbmoit._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~03tpv._.js +3 -0
  142. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~a-emb._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0u4gc4b._.js → [root-of-the-server]__121lss.._.js} +2 -2
  144. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vdw4w._.js +3 -0
  145. package/.next/standalone/.next/server/chunks/ssr/{_0ysyq9g._.js → _0.knmg-._.js} +2 -2
  146. package/.next/standalone/.next/server/chunks/ssr/{_0f6u19w._.js → _0.oe3b8._.js} +2 -2
  147. package/.next/standalone/.next/server/chunks/ssr/_04b71ua._.js +1 -1
  148. package/.next/standalone/.next/server/chunks/ssr/_05h.8a~._.js +1 -1
  149. package/.next/standalone/.next/server/chunks/ssr/{_02v3fjp._.js → _05unqgy._.js} +3 -3
  150. package/.next/standalone/.next/server/chunks/ssr/_0_l8.dg._.js +1 -1
  151. package/.next/standalone/.next/server/chunks/ssr/{_07~0_w6._.js → _0a2m~cj._.js} +3 -3
  152. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  153. package/.next/standalone/.next/server/chunks/ssr/{_0b0.-sj._.js → _0d2cdox._.js} +2 -2
  154. package/.next/standalone/.next/server/chunks/ssr/_0ds6nk2._.js +1 -1
  155. package/.next/standalone/.next/server/chunks/ssr/{_0pd0.8f._.js → _0fq4yrr._.js} +2 -2
  156. package/.next/standalone/.next/server/chunks/ssr/_0i4__mf._.js +1 -1
  157. package/.next/standalone/.next/server/chunks/ssr/{_0ysygps._.js → _0icu6m~._.js} +2 -2
  158. package/.next/standalone/.next/server/chunks/ssr/_0ihq._v._.js +1 -1
  159. package/.next/standalone/.next/server/chunks/ssr/{_0bw-tx8._.js → _0kx.c-s._.js} +2 -2
  160. package/.next/standalone/.next/server/chunks/ssr/{_0c-jnbs._.js → _0pu8x.f._.js} +2 -2
  161. package/.next/standalone/.next/server/chunks/ssr/_0r9w-k8._.js +1 -1
  162. package/.next/standalone/.next/server/chunks/ssr/_0rbctq7._.js +1 -1
  163. package/.next/standalone/.next/server/chunks/ssr/_0rt8hus._.js +1 -1
  164. package/.next/standalone/.next/server/chunks/ssr/{_08w-r6e._.js → _0vnfnib._.js} +3 -3
  165. package/.next/standalone/.next/server/chunks/ssr/{_0fob8fc._.js → _0xvsyc0._.js} +2 -2
  166. package/.next/standalone/.next/server/chunks/ssr/_0~80adm._.js +3 -3
  167. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +3 -0
  168. package/.next/standalone/.next/server/chunks/ssr/src_13jha60._.js +1 -1
  169. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  171. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  172. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  173. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  176. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  177. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  178. package/.next/standalone/.next/server/pages/404.html +1 -1
  179. package/.next/standalone/.next/server/pages/500.html +1 -1
  180. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  181. package/.next/standalone/.next/server/server-reference-manifest.json +286 -286
  182. package/.next/standalone/.next/static/chunks/{0fxm-wv..y_a_.js → 000k30wpair3e.js} +2 -2
  183. package/.next/standalone/.next/static/chunks/005169or2nxlh.js +1 -0
  184. package/.next/standalone/.next/static/chunks/{142w-q8.7m3kl.js → 04uepvk5f~_a-.js} +1 -1
  185. package/.next/standalone/.next/static/chunks/{02edbrlq~2uyx.js → 07vas3ezrfrjg.js} +1 -1
  186. package/.next/standalone/.next/static/chunks/{0ft77ybyq903..js → 087l367c1psb6.js} +1 -1
  187. package/.next/standalone/.next/static/chunks/{0v~pz9e87t99b.js → 09m-rcwwlggjy.js} +1 -1
  188. package/.next/standalone/.next/static/chunks/{0r1mkt5qs~s6m.js → 0h1-tehkx05kz.js} +1 -1
  189. package/.next/standalone/.next/static/chunks/{05-ui_o~3irq_.js → 0hueiuk3kjujl.js} +2 -2
  190. package/.next/standalone/.next/static/chunks/{05hls.3r4bz.0.js → 0ikej72py2xo3.js} +1 -1
  191. package/.next/standalone/.next/static/chunks/{0l3mmc866npw4.js → 0lx08u-wp-gt6.js} +2 -2
  192. package/.next/standalone/.next/static/chunks/0mu8uzvw4gvpf.js +1 -0
  193. package/.next/standalone/.next/static/chunks/0ow7ynd7g7ptv.js +1 -0
  194. package/.next/standalone/.next/static/chunks/{0i55dediewjp5.js → 0szduy0e92e5g.js} +1 -1
  195. package/.next/standalone/.next/static/chunks/{0w3jww1m3k77x.js → 0szie_5oyakv1.js} +1 -1
  196. package/.next/standalone/.next/static/chunks/{0bw4ahlj4~l~g.js → 0ur-499l_2jrc.js} +1 -1
  197. package/.next/standalone/.next/static/chunks/{00.52653v5c~c.js → 0xs0yzxjkoeas.js} +1 -1
  198. package/.next/standalone/.next/static/chunks/{08~e63d2q~cam.js → 0ynbql~9oq0av.js} +1 -1
  199. package/.next/standalone/.next/static/chunks/{117qu902jput3.js → 0~88n47ys3due.js} +1 -1
  200. package/.next/standalone/.next/static/chunks/10nil20v3q7~..js +1 -0
  201. package/.next/standalone/.next/static/chunks/{0q-u-hhre1uyw.js → 12rh72_2o79jv.js} +1 -1
  202. package/.next/standalone/.next/static/chunks/{0~27mkhc9s5k2.js → 156si6w7d-_ct.js} +2 -2
  203. package/.next/standalone/package.json +1 -2
  204. package/dist/mcp-server.cjs +34 -28
  205. package/package.json +1 -2
  206. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wbndoc._.js +0 -4
  207. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04pq37d._.js +0 -3
  208. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07_b6c.._.js +0 -3
  209. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09kc.q_._.js +0 -3
  210. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jo1r7k._.js +0 -3
  211. package/.next/standalone/.next/server/chunks/ssr/src_095o8x6._.js +0 -3
  212. package/.next/standalone/.next/static/chunks/00j0mdc41wa44.js +0 -1
  213. package/.next/standalone/.next/static/chunks/0nno5if2x1mvs.js +0 -1
  214. package/.next/standalone/.next/static/chunks/0qazzw-pr_sv7.js +0 -1
  215. package/.next/standalone/.next/static/chunks/0z01g02xstbqe.js +0 -1
  216. package/src/mcp/db.ts +0 -11
  217. package/src/mcp/index.ts +0 -15
  218. package/src/mcp/server.ts +0 -52
  219. package/src/mcp/tools/__tests__/label-tools.test.ts +0 -140
  220. package/src/mcp/tools/__tests__/project-tools.test.ts +0 -182
  221. package/src/mcp/tools/__tests__/report-tools.test.ts +0 -212
  222. package/src/mcp/tools/__tests__/task-tools.test.ts +0 -418
  223. package/src/mcp/tools/__tests__/terminal-tools.test.ts +0 -318
  224. package/src/mcp/tools/__tests__/workspace-tools.test.ts +0 -146
  225. package/src/mcp/tools/knowledge-tools.ts +0 -100
  226. package/src/mcp/tools/label-tools.ts +0 -70
  227. package/src/mcp/tools/note-asset-tools.ts +0 -271
  228. package/src/mcp/tools/project-tools.ts +0 -79
  229. package/src/mcp/tools/report-tools.ts +0 -220
  230. package/src/mcp/tools/search-tools.ts +0 -32
  231. package/src/mcp/tools/task-tools.ts +0 -272
  232. package/src/mcp/tools/terminal-tools.ts +0 -154
  233. package/src/mcp/tools/workspace-tools.ts +0 -73
  234. /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7DBkEq_6oXffs_C5TFLBR}/_buildManifest.js +0 -0
  235. /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7DBkEq_6oXffs_C5TFLBR}/_clientMiddlewareManifest.js +0 -0
  236. /package/.next/standalone/.next/static/{om3SyUw4eAwMA0KLhpSGh → 7DBkEq_6oXffs_C5TFLBR}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:a,description:r,action:l,className:i}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",i),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},236967,e=>{"use strict";var t=e.i(289721),s=e.i(210702),a=e.i(538059),r=e.i(259846),l=e.i(645378),i=e.i(453889),n=e.i(487278),o=e.i(533499);let d=[{key:"notes",icon:l.FileText},{key:"assets",icon:i.FolderOpen},{key:"archive",icon:n.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,o.useI18n)(),i=(0,a.usePathname)(),n=d.find(e=>i.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(s.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),d.map(a=>{let r=a.icon,i=n===a.key;return(0,t.jsxs)(s.default,{href:`/workspaces/${e}/${a.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${i?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.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),s=e.i(581263),a=e.i(294237),r=e.i(975157);let l=(0,a.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:a="default",render:i,...n}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,r.cn)(l({variant:a}),e)},n),render:i,state:{slot:"badge",variant:a}},(0,s.useRenderElement)(o.defaultTagName??"div",o,o)}],487486)},110204,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["Label",0,function({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.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),...a})}])},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)},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)},12659,e=>{"use strict";let t=(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,t],12659)},980376,727402,e=>{"use strict";var t=e.i(289721),s=e.i(225061),a=e.i(975157),r=e.i(519455),l=e.i(670123);function i({...e}){return(0,t.jsx)(s.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function n({className:e,...r}){return(0,t.jsx)(s.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,a.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...r})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(s.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:o,side:d="right",showCloseButton:c=!0,...u}){return(0,t.jsxs)(i,{children:[(0,t.jsx)(n,{}),(0,t.jsxs)(s.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,a.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...u,children:[o,c&&(0,t.jsxs)(s.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(l.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...r}){return(0,t.jsx)(s.Dialog.Description,{"data-slot":"sheet-description",className:(0,a.cn)("text-sm text-muted-foreground",e),...r})},"SheetHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,a.cn)("flex flex-col gap-0.5 p-4",e),...s})},"SheetTitle",0,function({className:e,...r}){return(0,t.jsx)(s.Dialog.Title,{"data-slot":"sheet-title",className:(0,a.cn)("font-heading text-base font-medium text-foreground",e),...r})}],980376);var o=e.i(514798);let d=(0,o.createServerReference)("40b36c864d4d23ff0d7f5c0345462b73016d89624e",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,d],727402)},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),s=e.i(965652),a=e.i(980376),r=e.i(759684),l=e.i(487486),i=e.i(519455),n=e.i(533499),o=e.i(436092),d=e.i(727402),c=e.i(814112),u=e.i(744798),x=e.i(685149),m=e.i(606393),h=e.i(875840),p=e.i(245697),f=e.i(12659);function g({added:e,removed:s}){let{t:a}=(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:a("diff.filesChanged",{count:String(e+s)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),s>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",s]})]})}var b=e.i(360112);e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:v,taskId:j}){let{t:y}=(0,n.useI18n)(),[k,w]=(0,s.useState)(null),[N,C]=(0,s.useTransition)(),[S,T]=(0,s.useState)(!1),[D,I]=(0,s.useState)([]);(0,s.useEffect)(()=>{j&&e?C(async()=>{let e=await (0,d.getTaskOverview)(j);e&&(w(e),e.project?.workspaceId&&(0,c.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{I(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>I([])))}):w(null)},[j,e]);let P=k?x.BOARD_COLUMNS.find(e=>e.id===k.status):null,O=k?x.PRIORITY_CONFIG[k.priority]:null,E=k?.executions?.[0]??null,$=(()=>{let e=E?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),R=async e=>{if(k?.project)try{await (0,o.createTask)({...e,projectId:k.project.id}),b.toast.success(y("taskDrawer.duplicateSuccess")),T(!1),v(!1)}catch{b.toast.error(y("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(a.Sheet,{open:e,onOpenChange:v,children:[(0,t.jsxs)(a.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(a.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(a.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:k?.title??""}),(0,t.jsx)(a.SheetDescription,{className:"sr-only",children:y("taskDrawer.title")}),k&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[P&&(0,t.jsxs)(l.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${P.color}`}),P.label]}),O&&(0,t.jsx)(l.Badge,{variant:"secondary",className:`text-xs ${O.color}`,children:O.label})]})]}),(0,t.jsx)(r.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:N&&!k?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:y("assets.loading")}):k?(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:y("taskDrawer.description")}),(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:k.description||y("taskDrawer.noDescription")})]}),k.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:y("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:k.labels.map(e=>(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(m.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:y("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(k.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(p.Package,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:y("taskDrawer.resources")}),(0,t.jsx)("span",{className:"text-foreground",children:k._count.assets})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:y("taskDrawer.fileChanges")}),$?(0,t.jsx)(g,{added:$.added,removed:$.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y("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)(f.PlayCircle,{className:"h-3.5 w-3.5"}),y("taskDrawer.lastExecution")]}),E?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:E.status}),E.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:E.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y("taskDrawer.noExecution")})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(i.Button,{variant:"default",className:"w-full",onClick:()=>{k&&T(!0)},disabled:!k,children:[(0,t.jsx)(h.Copy,{className:"h-4 w-4"}),y("taskDrawer.duplicate")]})})]}):null})]}),k?.project&&(0,t.jsx)(u.CreateTaskDialog,{open:S,onOpenChange:T,onSubmit:R,labels:D,projectType:k.project.type,projectLocalPath:k.project.localPath,prefillFromTask:{title:k.title,description:k.description,priority:k.priority,subPath:k.subPath,labelIds:k.labels.map(e=>e.label.id),baseBranch:k.baseBranch}})]})}],605005)},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},720722,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40eb9f91cf4e1a06bca572463ec6f297e5d8f9a617",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,s])},854989,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("4001ee3cc32025ec9051ad43275df76081f5bb30fb",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,s])},734525,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(400355),r=e.i(236967),l=e.i(533499),i=e.i(720722),n=e.i(514798);let o=(0,n.createServerReference)("402259e92e45ddef6a50cfee1d5396053bd7d2fd47",n.callServer,void 0,n.findSourceMapURL,"getProjectAssets");var d=e.i(453889),c=e.i(912505),u=e.i(645378),x=e.i(867533),m=e.i(998626),h=e.i(519455);function p(e){let t=e.match(/(?:^|\/)(?:storage|data)\/assets\/([^/]+)\/([^/]+)$/);return t?`/api/files/assets/${t[1]}/${t[2]}`:e}function f({asset:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i}){var n;let{t:o}=(0,l.useI18n)(),c=p(e.path),g=e.mimeType?.startsWith("image/");return(0,t.jsxs)("div",{className:"flex items-center gap-4 rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:bg-accent/20",children:[(0,t.jsx)(h.Button,{variant:"ghost",onClick:()=>s(e),className:"flex-shrink-0 cursor-pointer p-0 h-auto",children:g?(0,t.jsx)("img",{src:c,alt:e.filename,className:"h-12 w-12 rounded object-cover border border-border"}):(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded border border-border bg-muted",children:(0,t.jsx)(u.FileText,{className:"h-6 w-6 text-muted-foreground"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:e.filename}),e.taskTitle&&e.taskId&&(0,t.jsx)(h.Button,{variant:"ghost",onClick:t=>{t.stopPropagation(),i?.(e.taskId)},className:"flex-shrink-0 bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs px-1.5 py-0.5 rounded cursor-pointer hover:bg-blue-500/20 transition-colors h-auto",children:e.taskTitle.length>20?`[任务: ${e.taskTitle.slice(0,20)}...]`:`[任务: ${e.taskTitle}]`})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:null===(n=e.size)?"-":n<1024?`${n} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:n<0x40000000?`${(n/1048576).toFixed(1)} MB`:`${(n/0x40000000).toFixed(1)} GB`}),(0,t.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>s(e),className:"text-muted-foreground","aria-label":o("assets.preview"),children:(0,t.jsx)(x.Eye,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>a(e),className:"text-muted-foreground","aria-label":o("assets.revealInFinder"),children:(0,t.jsx)(d.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>r(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":o("assets.delete"),children:(0,t.jsx)(m.Trash2,{className:"h-4 w-4"})})]})]})}function g({assets:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i}){let{t:n}=(0,l.useI18n)();return 0===e.length?(0,t.jsx)(c.EmptyState,{icon:d.FolderOpen,title:n("assets.empty"),description:n("assets.emptyHint")}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsx)(f,{asset:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i},e.id))})}var b=e.i(631675),v=e.i(657153),j=e.i(854989),y=e.i(624687),k=e.i(918385);function w({allWorkspaces:e,initialWsId:a,initialProjectId:r,onUploaded:i}){let n,{t:o}=(0,l.useI18n)(),d=(0,s.useRef)(null),[c,u]=(0,s.useState)(!1),[x,m]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null),[g,N]=(0,s.useState)(a),[C,S]=(0,s.useState)(r),[T,D]=(0,s.useState)(""),I=e.find(e=>e.id===g),P=I?.projects??[],O=()=>{u(!1),f(null),d.current&&(d.current.value="")},E=async()=>{if(p&&C){m(!0);try{let e=new FormData;e.append("file",p),e.append("projectId",C),e.append("description",T.trim()),await (0,j.uploadAsset)(e),i(C),O()}finally{m(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(h.Button,{onClick:()=>{N(a),S(r),f(null),D(""),u(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(b.Upload,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:o("assets.upload")})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:O}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:O,className:"absolute right-3 top-3 text-muted-foreground",children:(0,t.jsx)(v.X,{className:"h-4 w-4"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-4",children:o("assets.uploadTitle")}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.workspace")}),(0,t.jsxs)(k.Select,{value:g,onValueChange:t=>{var s;let a;return N(s=t??""),a=e.find(e=>e.id===s),void S(a?.projects[0]?.id??null)},children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:I?.name??g})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.project")}),P.length>0?(0,t.jsxs)(k.Select,{value:C??"",onValueChange:e=>S(e??""),children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(n=P.find(e=>e.id===C))?n.alias?`${n.name} (${n.alias})`:n.name:C})}),(0,t.jsx)(k.SelectContent,{children:P.map(e=>{let s=e.alias?`${e.name} (${e.alias})`:e.name;return(0,t.jsx)(k.SelectItem,{value:e.id,children:s},e.id)})})]}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.noProject")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.file")}),(0,t.jsx)("input",{type:"file",ref:d,onChange:e=>{f(e.target.files?.[0]??null)},className:"hidden"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{d.current?.click()},className:"flex-1 border-dashed bg-background px-3 py-2 text-xs text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors text-left justify-start",children:p?p.name:o("assets.selectFile")})]}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0 pt-1.5",children:o("assets.description")}),(0,t.jsx)(y.Textarea,{value:T,onChange:e=>D(e.target.value),placeholder:o("assets.descriptionPlaceholder"),className:"flex-1 rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none h-20"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end mt-6",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:O,children:o("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:E,disabled:!p||!C||!T.trim()||x,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:o(x?"assets.uploading":"assets.upload")})]})]})]})]})}var N=e.i(585012),C=e.i(19671),S=e.i(368490),T=e.i(902539);let D=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var I=e.i(922541);function P({imageUrl:e,filename:a,open:r,onOpenChange:i,assets:n,currentIndex:o,onIndexChange:d}){let{t:c}=(0,l.useI18n)(),[u,x]=(0,s.useState)(1),[m,h]=(0,s.useState)({x:0,y:0}),[p,f]=(0,s.useState)(!1),g=(0,s.useRef)(null),[b,j]=(0,s.useState)(!1),y=!!n&&n.length>1&&"number"==typeof o&&!!d,k=y&&o>0,w=y&&o<n.length-1,E=y?n.length:0,$=E>0?Math.ceil(E/10):0,R=y?Math.floor(o/10):0,L=10*R,M=Math.min(L+10,E),A=$>1,B=y&&R>0,z=y&&R<$-1;(0,s.useEffect)(()=>{j(!0)},[]),(0,s.useEffect)(()=>{x(1),h({x:0,y:0})},[e]),(0,s.useEffect)(()=>{if(!r)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[r]);let F=(0,s.useCallback)(()=>i(!1),[i]),_=(0,s.useCallback)(()=>{y&&k&&d(o-1)},[y,k,d,o]),U=(0,s.useCallback)(()=>{y&&w&&d(o+1)},[y,w,d,o]),W=(0,s.useCallback)(()=>{y&&B&&d((R-1)*10)},[y,B,d,R]),G=(0,s.useCallback)(()=>{y&&z&&d(Math.min((R+1)*10,E-1))},[y,z,d,R,E]),V=(0,s.useCallback)(()=>{x(e=>Math.min(8,1.25*e))},[]),H=(0,s.useCallback)(()=>{x(e=>{let t=Math.max(.1,e/1.25);return t<=1&&h({x:0,y:0}),t})},[]),X=(0,s.useCallback)(()=>{x(1),h({x:0,y:0})},[]);(0,s.useEffect)(()=>{if(!r)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),F();break;case"ArrowLeft":y&&(e.preventDefault(),_());break;case"ArrowRight":y&&(e.preventDefault(),U());break;case"+":case"=":e.preventDefault(),V();break;case"-":case"_":e.preventDefault(),H();break;case"0":e.preventDefault(),X()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,y,F,_,U,V,H,X]);let Y=(0,s.useRef)(!1),q=()=>{p&&f(!1),g.current=null},J=p?"cursor-grabbing":"cursor-grab";if(!r||!b)return null;let K=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":c("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[a,y?` \xb7 ${o+1} / ${n.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${J}`,onClick:e=>{e.target===e.currentTarget&&F()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;x(e=>{let s=Math.min(8,Math.max(.1,e*t));return s<=1&&h({x:0,y:0}),s})},children:e&&(0,t.jsx)("img",{src:e,alt:a,onClick:e=>{e.stopPropagation(),Y.current&&(Y.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),Y.current=!1,e.target.setPointerCapture?.(e.pointerId),g.current={x:e.clientX,y:e.clientY,panX:m.x,panY:m.y},f(!0))},onPointerMove:e=>{if(!g.current)return;let t=e.clientX-g.current.x,s=e.clientY-g.current.y;Math.abs(t)+Math.abs(s)>5&&(Y.current=!0),p&&h({x:g.current.panX+t,y:g.current.panY+s})},onPointerUp:q,onPointerLeave:q,onPointerCancel:q,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${m.x}px, ${m.y}px, 0) scale(${u})`,transformOrigin:"center center",transition:p?"none":"transform 120ms ease-out",willChange:p?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[y&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[A&&(0,t.jsx)(O,{onClick:W,title:`${c("assets.lightbox.prev")} (-10)`,"aria-label":`${c("assets.lightbox.prev")} (-10)`,disabled:!B,children:(0,t.jsx)(T.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(O,{onClick:_,title:c("assets.lightbox.prev"),"aria-label":c("assets.lightbox.prev"),disabled:!k,children:(0,t.jsx)(C.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:n.slice(L,M).map((e,s)=>{let a=L+s,r=a===o;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||d(a)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${r?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+a)})}),(0,t.jsx)(O,{onClick:U,title:c("assets.lightbox.next"),"aria-label":c("assets.lightbox.next"),disabled:!w,children:(0,t.jsx)(S.ChevronRight,{className:"h-4 w-4"})}),A&&(0,t.jsx)(O,{onClick:G,title:`${c("assets.lightbox.next")} (+10)`,"aria-label":`${c("assets.lightbox.next")} (+10)`,disabled:!z,children:(0,t.jsx)(D,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*u),"%"]}),(0,t.jsx)(O,{onClick:X,title:c("assets.lightbox.reset"),"aria-label":c("assets.lightbox.reset"),disabled:1===u&&0===m.x&&0===m.y,children:(0,t.jsx)(I.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(O,{onClick:F,title:c("assets.lightbox.close"),"aria-label":c("assets.lightbox.close"),children:(0,t.jsx)(v.X,{className:"h-4 w-4"})})]})]})]});return(0,N.createPortal)(K,document.body)}function O({children:e,onClick:s,title:a,disabled:r,...l}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||s()},title:a,disabled:r,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...l,children:e})}e.i(254826);var E=e.i(309735),$=e.i(776639);function R({url:e,filename:r,open:i,onOpenChange:n}){let{t:o}=(0,l.useI18n)(),[d,c]=(0,s.useState)(null),[u,x]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!i||!e){c(null),h(null);return}let t=!1;return x(!0),h(null),c(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(c(e),x(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?h(o("assets.fileTooLarge")):h(o("assets.previewError")),x(!1))}),()=>{t=!0}},[i,e,o]);let p=r.split(".").pop()?.toLowerCase();return(0,t.jsx)($.Dialog,{open:i,onOpenChange:n,children:(0,t.jsxs)($.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:r}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(u)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(a.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.loadingPreview")})]});if(m)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:m});if(null===d)return null;if("md"===p)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(E.Streamdown,{children:d})});if("json"===p){let e;try{e=JSON.stringify(JSON.parse(d),null,2)}catch{e=d}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:d})})()})]})})}var L=e.i(605005),M=e.i(360112);e.s(["AssetsPageClient",0,function({allWorkspaces:e,initialWorkspaceId:n,initialProjectId:d,initialAssets:c}){let u,{t:x}=(0,l.useI18n)(),[m,h]=(0,s.useTransition)(),[f,b]=(0,s.useState)(n),[v,j]=(0,s.useState)(d),[y,N]=(0,s.useState)(c),[C,S]=(0,s.useState)(null),T=e.find(e=>e.id===f),D=T?.projects??[],I=(0,s.useCallback)(e=>{e?h(async()=>{N(await o(e))}):N([])},[h]),[O,E]=(0,s.useState)(null),$=O?O.mimeType?.startsWith("image/")?"image":/\.(txt|md|json)$/i.test(O.filename)?"text":null:null,A=y.filter(e=>e.mimeType?.startsWith("image/")).map(e=>({id:e.id,url:p(e.path),filename:e.filename})),B=O?A.findIndex(e=>e.id===O.id):-1,z=async e=>{try{let t=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path})});if(!t.ok){let e=await t.json().catch(()=>({}));M.toast.error(e.error||"Failed to reveal file")}}catch{M.toast.error("Failed to reveal file")}},F=async e=>{let t=y.find(t=>t.id===e);confirm(x("assets.deleteConfirm",{filename:t?.filename??e}))&&(await (0,i.deleteAsset)(e),I(v))};return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(r.SubPageNav,{workspaceId:f}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(k.Select,{value:f,onValueChange:t=>t&&(t=>{if(t===f)return;b(t);let s=e.find(e=>e.id===t),a=s?.projects[0]??null;j(a?.id??null),I(a?.id??null)})(t),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===f)?.name??f})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]}),D.length>0&&(0,t.jsxs)(k.Select,{value:v??"",onValueChange:e=>e&&void(e!==v&&(j(e),I(e))),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(u=D.find(e=>e.id===v))?u.alias?`${u.name} (${u.alias})`:u.name:""})}),(0,t.jsx)(k.SelectContent,{children:D.map(e=>(0,t.jsxs)(k.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(w,{allWorkspaces:e,initialWsId:f,initialProjectId:v,onUploaded:e=>{e===v&&I(v)}})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,t.jsxs)("div",{className:`relative ${m?"opacity-40 pointer-events-none":""} transition-opacity`,children:[m&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(a.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===D.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:x("assets.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:x("assets.noProjectHint")})]}):(0,t.jsx)(g,{assets:y.map(e=>({...e,taskId:e.task?.id??null,taskTitle:e.task?.title??null})),onPreview:e=>{let t=e.mimeType?.startsWith("image/"),s=/\.(txt|md|json)$/i.test(e.filename);(t||s)&&E(e)},onReveal:z,onDelete:F,onTaskClick:S})]})}),(0,t.jsx)(P,{imageUrl:"image"===$&&B>=0?A[B].url:null,filename:"image"===$&&B>=0?A[B].filename:"",open:"image"===$,onOpenChange:e=>{e||E(null)},assets:A.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:B>=0?B:void 0,onIndexChange:e=>{let t=A[e];if(!t)return;let s=y.find(e=>e.id===t.id);s&&E({...s,taskId:s.task?.id??null,taskTitle:s.task?.title??null})}}),(0,t.jsx)(R,{url:"text"===$&&O?p(O.path):null,filename:O?.filename??"",open:"text"===$,onOpenChange:e=>{e||E(null)}}),(0,t.jsx)(L.TaskOverviewDrawer,{open:!!C,onOpenChange:e=>{e||S(null)},taskId:C})]})}],734525)},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:a,description:r,action:l,className:i}){return(0,t.jsxs)("div",{className:(0,s.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",i),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},236967,e=>{"use strict";var t=e.i(289721),s=e.i(210702),a=e.i(538059),r=e.i(259846),l=e.i(645378),i=e.i(453889),n=e.i(487278),o=e.i(533499);let d=[{key:"notes",icon:l.FileText},{key:"assets",icon:i.FolderOpen},{key:"archive",icon:n.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,o.useI18n)(),i=(0,a.usePathname)(),n=d.find(e=>i.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4",children:[(0,t.jsxs)(s.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(r.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),d.map(a=>{let r=a.icon,i=n===a.key;return(0,t.jsxs)(s.default,{href:`/workspaces/${e}/${a.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs font-medium transition-colors ${i?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.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),s=e.i(581263),a=e.i(294237),r=e.i(975157);let l=(0,a.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:a="default",render:i,...n}){var o;return o={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,r.cn)(l({variant:a}),e)},n),render:i,state:{slot:"badge",variant:a}},(0,s.useRenderElement)(o.defaultTagName??"div",o,o)}],487486)},110204,e=>{"use strict";var t=e.i(289721),s=e.i(975157);e.s(["Label",0,function({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,s.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),...a})}])},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)},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)},12659,e=>{"use strict";let t=(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,t],12659)},980376,408176,e=>{"use strict";var t=e.i(289721),s=e.i(225061),a=e.i(975157),r=e.i(519455),l=e.i(670123);function i({...e}){return(0,t.jsx)(s.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function n({className:e,...r}){return(0,t.jsx)(s.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,a.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...r})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(s.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:o,side:d="right",showCloseButton:c=!0,...u}){return(0,t.jsxs)(i,{children:[(0,t.jsx)(n,{}),(0,t.jsxs)(s.Dialog.Popup,{"data-slot":"sheet-content","data-side":d,className:(0,a.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...u,children:[o,c&&(0,t.jsxs)(s.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(l.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...r}){return(0,t.jsx)(s.Dialog.Description,{"data-slot":"sheet-description",className:(0,a.cn)("text-sm text-muted-foreground",e),...r})},"SheetHeader",0,function({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,a.cn)("flex flex-col gap-0.5 p-4",e),...s})},"SheetTitle",0,function({className:e,...r}){return(0,t.jsx)(s.Dialog.Title,{"data-slot":"sheet-title",className:(0,a.cn)("font-heading text-base font-medium text-foreground",e),...r})}],980376);var o=e.i(514798);let d=(0,o.createServerReference)("40e0578b279cd459ae8bc436015ce10208195f4c81",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,d],408176)},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),s=e.i(965652),a=e.i(980376),r=e.i(759684),l=e.i(487486),i=e.i(519455),n=e.i(533499),o=e.i(545319),d=e.i(408176),c=e.i(837312),u=e.i(744798),x=e.i(685149),m=e.i(606393),h=e.i(875840),p=e.i(245697),f=e.i(12659);function g({added:e,removed:s}){let{t:a}=(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:a("diff.filesChanged",{count:String(e+s)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),s>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",s]})]})}var b=e.i(360112);e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:v,taskId:j}){let{t:y}=(0,n.useI18n)(),[k,w]=(0,s.useState)(null),[N,C]=(0,s.useTransition)(),[S,T]=(0,s.useState)(!1),[D,I]=(0,s.useState)([]);(0,s.useEffect)(()=>{j&&e?C(async()=>{let e=await (0,d.getTaskOverview)(j);e&&(w(e),e.project?.workspaceId&&(0,c.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{I(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>I([])))}):w(null)},[j,e]);let P=k?x.BOARD_COLUMNS.find(e=>e.id===k.status):null,O=k?x.PRIORITY_CONFIG[k.priority]:null,E=k?.executions?.[0]??null,$=(()=>{let e=E?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),R=async e=>{if(k?.project)try{await (0,o.createTask)({...e,projectId:k.project.id}),b.toast.success(y("taskDrawer.duplicateSuccess")),T(!1),v(!1)}catch{b.toast.error(y("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(a.Sheet,{open:e,onOpenChange:v,children:[(0,t.jsxs)(a.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(a.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(a.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:k?.title??""}),(0,t.jsx)(a.SheetDescription,{className:"sr-only",children:y("taskDrawer.title")}),k&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[P&&(0,t.jsxs)(l.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${P.color}`}),P.label]}),O&&(0,t.jsx)(l.Badge,{variant:"secondary",className:`text-xs ${O.color}`,children:O.label})]})]}),(0,t.jsx)(r.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:N&&!k?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:y("assets.loading")}):k?(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:y("taskDrawer.description")}),(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:k.description||y("taskDrawer.noDescription")})]}),k.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:y("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:k.labels.map(e=>(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(m.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:y("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(k.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(p.Package,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:y("taskDrawer.resources")}),(0,t.jsx)("span",{className:"text-foreground",children:k._count.assets})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:y("taskDrawer.fileChanges")}),$?(0,t.jsx)(g,{added:$.added,removed:$.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y("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)(f.PlayCircle,{className:"h-3.5 w-3.5"}),y("taskDrawer.lastExecution")]}),E?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:E.status}),E.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:E.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:y("taskDrawer.noExecution")})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(i.Button,{variant:"default",className:"w-full",onClick:()=>{k&&T(!0)},disabled:!k,children:[(0,t.jsx)(h.Copy,{className:"h-4 w-4"}),y("taskDrawer.duplicate")]})})]}):null})]}),k?.project&&(0,t.jsx)(u.CreateTaskDialog,{open:S,onOpenChange:T,onSubmit:R,labels:D,projectType:k.project.type,projectLocalPath:k.project.localPath,prefillFromTask:{title:k.title,description:k.description,priority:k.priority,subPath:k.subPath,labelIds:k.labels.map(e=>e.label.id),baseBranch:k.baseBranch}})]})}],605005)},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},797274,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("40b79724e4ea0b628719ec60cb95e0d6d49b127721",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,s])},889458,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("405a19c1ff319e664bbb71d4530de9ef8d6f2cd16b",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,s])},734525,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(400355),r=e.i(236967),l=e.i(533499),i=e.i(797274),n=e.i(514798);let o=(0,n.createServerReference)("4041f8ca2ecff8fdc0c0a839eef17195e65f8e7722",n.callServer,void 0,n.findSourceMapURL,"getProjectAssets");var d=e.i(453889),c=e.i(912505),u=e.i(645378),x=e.i(867533),m=e.i(998626),h=e.i(519455);function p(e){let t=e.match(/(?:^|\/)(?:storage|data)\/assets\/([^/]+)\/([^/]+)$/);return t?`/api/files/assets/${t[1]}/${t[2]}`:e}function f({asset:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i}){var n;let{t:o}=(0,l.useI18n)(),c=p(e.path),g=e.mimeType?.startsWith("image/");return(0,t.jsxs)("div",{className:"flex items-center gap-4 rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:bg-accent/20",children:[(0,t.jsx)(h.Button,{variant:"ghost",onClick:()=>s(e),className:"flex-shrink-0 cursor-pointer p-0 h-auto",children:g?(0,t.jsx)("img",{src:c,alt:e.filename,className:"h-12 w-12 rounded object-cover border border-border"}):(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded border border-border bg-muted",children:(0,t.jsx)(u.FileText,{className:"h-6 w-6 text-muted-foreground"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:e.filename}),e.taskTitle&&e.taskId&&(0,t.jsx)(h.Button,{variant:"ghost",onClick:t=>{t.stopPropagation(),i?.(e.taskId)},className:"flex-shrink-0 bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs px-1.5 py-0.5 rounded cursor-pointer hover:bg-blue-500/20 transition-colors h-auto",children:e.taskTitle.length>20?`[任务: ${e.taskTitle.slice(0,20)}...]`:`[任务: ${e.taskTitle}]`})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:null===(n=e.size)?"-":n<1024?`${n} B`:n<1048576?`${(n/1024).toFixed(1)} KB`:n<0x40000000?`${(n/1048576).toFixed(1)} MB`:`${(n/0x40000000).toFixed(1)} GB`}),(0,t.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>s(e),className:"text-muted-foreground","aria-label":o("assets.preview"),children:(0,t.jsx)(x.Eye,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>a(e),className:"text-muted-foreground","aria-label":o("assets.revealInFinder"),children:(0,t.jsx)(d.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>r(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":o("assets.delete"),children:(0,t.jsx)(m.Trash2,{className:"h-4 w-4"})})]})]})}function g({assets:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i}){let{t:n}=(0,l.useI18n)();return 0===e.length?(0,t.jsx)(c.EmptyState,{icon:d.FolderOpen,title:n("assets.empty"),description:n("assets.emptyHint")}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsx)(f,{asset:e,onPreview:s,onReveal:a,onDelete:r,onTaskClick:i},e.id))})}var b=e.i(631675),v=e.i(657153),j=e.i(889458),y=e.i(624687),k=e.i(918385);function w({allWorkspaces:e,initialWsId:a,initialProjectId:r,onUploaded:i}){let n,{t:o}=(0,l.useI18n)(),d=(0,s.useRef)(null),[c,u]=(0,s.useState)(!1),[x,m]=(0,s.useState)(!1),[p,f]=(0,s.useState)(null),[g,N]=(0,s.useState)(a),[C,S]=(0,s.useState)(r),[T,D]=(0,s.useState)(""),I=e.find(e=>e.id===g),P=I?.projects??[],O=()=>{u(!1),f(null),d.current&&(d.current.value="")},E=async()=>{if(p&&C){m(!0);try{let e=new FormData;e.append("file",p),e.append("projectId",C),e.append("description",T.trim()),await (0,j.uploadAsset)(e),i(C),O()}finally{m(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(h.Button,{onClick:()=>{N(a),S(r),f(null),D(""),u(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(b.Upload,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:o("assets.upload")})]}),c&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:O}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:O,className:"absolute right-3 top-3 text-muted-foreground",children:(0,t.jsx)(v.X,{className:"h-4 w-4"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-4",children:o("assets.uploadTitle")}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.workspace")}),(0,t.jsxs)(k.Select,{value:g,onValueChange:t=>{var s;let a;return N(s=t??""),a=e.find(e=>e.id===s),void S(a?.projects[0]?.id??null)},children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:I?.name??g})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.project")}),P.length>0?(0,t.jsxs)(k.Select,{value:C??"",onValueChange:e=>S(e??""),children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(n=P.find(e=>e.id===C))?n.alias?`${n.name} (${n.alias})`:n.name:C})}),(0,t.jsx)(k.SelectContent,{children:P.map(e=>{let s=e.alias?`${e.name} (${e.alias})`:e.name;return(0,t.jsx)(k.SelectItem,{value:e.id,children:s},e.id)})})]}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.noProject")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.file")}),(0,t.jsx)("input",{type:"file",ref:d,onChange:e=>{f(e.target.files?.[0]??null)},className:"hidden"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{d.current?.click()},className:"flex-1 border-dashed bg-background px-3 py-2 text-xs text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors text-left justify-start",children:p?p.name:o("assets.selectFile")})]}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0 pt-1.5",children:o("assets.description")}),(0,t.jsx)(y.Textarea,{value:T,onChange:e=>D(e.target.value),placeholder:o("assets.descriptionPlaceholder"),className:"flex-1 rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none h-20"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end mt-6",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:O,children:o("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:E,disabled:!p||!C||!T.trim()||x,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:o(x?"assets.uploading":"assets.upload")})]})]})]})]})}var N=e.i(585012),C=e.i(19671),S=e.i(368490),T=e.i(902539);let D=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var I=e.i(922541);function P({imageUrl:e,filename:a,open:r,onOpenChange:i,assets:n,currentIndex:o,onIndexChange:d}){let{t:c}=(0,l.useI18n)(),[u,x]=(0,s.useState)(1),[m,h]=(0,s.useState)({x:0,y:0}),[p,f]=(0,s.useState)(!1),g=(0,s.useRef)(null),[b,j]=(0,s.useState)(!1),y=!!n&&n.length>1&&"number"==typeof o&&!!d,k=y&&o>0,w=y&&o<n.length-1,E=y?n.length:0,$=E>0?Math.ceil(E/10):0,R=y?Math.floor(o/10):0,L=10*R,M=Math.min(L+10,E),A=$>1,B=y&&R>0,z=y&&R<$-1;(0,s.useEffect)(()=>{j(!0)},[]),(0,s.useEffect)(()=>{x(1),h({x:0,y:0})},[e]),(0,s.useEffect)(()=>{if(!r)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[r]);let F=(0,s.useCallback)(()=>i(!1),[i]),_=(0,s.useCallback)(()=>{y&&k&&d(o-1)},[y,k,d,o]),U=(0,s.useCallback)(()=>{y&&w&&d(o+1)},[y,w,d,o]),W=(0,s.useCallback)(()=>{y&&B&&d((R-1)*10)},[y,B,d,R]),G=(0,s.useCallback)(()=>{y&&z&&d(Math.min((R+1)*10,E-1))},[y,z,d,R,E]),V=(0,s.useCallback)(()=>{x(e=>Math.min(8,1.25*e))},[]),H=(0,s.useCallback)(()=>{x(e=>{let t=Math.max(.1,e/1.25);return t<=1&&h({x:0,y:0}),t})},[]),X=(0,s.useCallback)(()=>{x(1),h({x:0,y:0})},[]);(0,s.useEffect)(()=>{if(!r)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),F();break;case"ArrowLeft":y&&(e.preventDefault(),_());break;case"ArrowRight":y&&(e.preventDefault(),U());break;case"+":case"=":e.preventDefault(),V();break;case"-":case"_":e.preventDefault(),H();break;case"0":e.preventDefault(),X()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,y,F,_,U,V,H,X]);let Y=(0,s.useRef)(!1),q=()=>{p&&f(!1),g.current=null},J=p?"cursor-grabbing":"cursor-grab";if(!r||!b)return null;let K=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":c("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[a,y?` \xb7 ${o+1} / ${n.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${J}`,onClick:e=>{e.target===e.currentTarget&&F()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;x(e=>{let s=Math.min(8,Math.max(.1,e*t));return s<=1&&h({x:0,y:0}),s})},children:e&&(0,t.jsx)("img",{src:e,alt:a,onClick:e=>{e.stopPropagation(),Y.current&&(Y.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),Y.current=!1,e.target.setPointerCapture?.(e.pointerId),g.current={x:e.clientX,y:e.clientY,panX:m.x,panY:m.y},f(!0))},onPointerMove:e=>{if(!g.current)return;let t=e.clientX-g.current.x,s=e.clientY-g.current.y;Math.abs(t)+Math.abs(s)>5&&(Y.current=!0),p&&h({x:g.current.panX+t,y:g.current.panY+s})},onPointerUp:q,onPointerLeave:q,onPointerCancel:q,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${m.x}px, ${m.y}px, 0) scale(${u})`,transformOrigin:"center center",transition:p?"none":"transform 120ms ease-out",willChange:p?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[y&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[A&&(0,t.jsx)(O,{onClick:W,title:`${c("assets.lightbox.prev")} (-10)`,"aria-label":`${c("assets.lightbox.prev")} (-10)`,disabled:!B,children:(0,t.jsx)(T.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(O,{onClick:_,title:c("assets.lightbox.prev"),"aria-label":c("assets.lightbox.prev"),disabled:!k,children:(0,t.jsx)(C.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:n.slice(L,M).map((e,s)=>{let a=L+s,r=a===o;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||d(a)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${r?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+a)})}),(0,t.jsx)(O,{onClick:U,title:c("assets.lightbox.next"),"aria-label":c("assets.lightbox.next"),disabled:!w,children:(0,t.jsx)(S.ChevronRight,{className:"h-4 w-4"})}),A&&(0,t.jsx)(O,{onClick:G,title:`${c("assets.lightbox.next")} (+10)`,"aria-label":`${c("assets.lightbox.next")} (+10)`,disabled:!z,children:(0,t.jsx)(D,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*u),"%"]}),(0,t.jsx)(O,{onClick:X,title:c("assets.lightbox.reset"),"aria-label":c("assets.lightbox.reset"),disabled:1===u&&0===m.x&&0===m.y,children:(0,t.jsx)(I.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(O,{onClick:F,title:c("assets.lightbox.close"),"aria-label":c("assets.lightbox.close"),children:(0,t.jsx)(v.X,{className:"h-4 w-4"})})]})]})]});return(0,N.createPortal)(K,document.body)}function O({children:e,onClick:s,title:a,disabled:r,...l}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||s()},title:a,disabled:r,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...l,children:e})}e.i(254826);var E=e.i(309735),$=e.i(776639);function R({url:e,filename:r,open:i,onOpenChange:n}){let{t:o}=(0,l.useI18n)(),[d,c]=(0,s.useState)(null),[u,x]=(0,s.useState)(!1),[m,h]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!i||!e){c(null),h(null);return}let t=!1;return x(!0),h(null),c(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(c(e),x(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?h(o("assets.fileTooLarge")):h(o("assets.previewError")),x(!1))}),()=>{t=!0}},[i,e,o]);let p=r.split(".").pop()?.toLowerCase();return(0,t.jsx)($.Dialog,{open:i,onOpenChange:n,children:(0,t.jsxs)($.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:r}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(u)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(a.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.loadingPreview")})]});if(m)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:m});if(null===d)return null;if("md"===p)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(E.Streamdown,{children:d})});if("json"===p){let e;try{e=JSON.stringify(JSON.parse(d),null,2)}catch{e=d}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:d})})()})]})})}var L=e.i(605005),M=e.i(360112);e.s(["AssetsPageClient",0,function({allWorkspaces:e,initialWorkspaceId:n,initialProjectId:d,initialAssets:c}){let u,{t:x}=(0,l.useI18n)(),[m,h]=(0,s.useTransition)(),[f,b]=(0,s.useState)(n),[v,j]=(0,s.useState)(d),[y,N]=(0,s.useState)(c),[C,S]=(0,s.useState)(null),T=e.find(e=>e.id===f),D=T?.projects??[],I=(0,s.useCallback)(e=>{e?h(async()=>{N(await o(e))}):N([])},[h]),[O,E]=(0,s.useState)(null),$=O?O.mimeType?.startsWith("image/")?"image":/\.(txt|md|json)$/i.test(O.filename)?"text":null:null,A=y.filter(e=>e.mimeType?.startsWith("image/")).map(e=>({id:e.id,url:p(e.path),filename:e.filename})),B=O?A.findIndex(e=>e.id===O.id):-1,z=async e=>{try{let t=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path})});if(!t.ok){let e=await t.json().catch(()=>({}));M.toast.error(e.error||"Failed to reveal file")}}catch{M.toast.error("Failed to reveal file")}},F=async e=>{let t=y.find(t=>t.id===e);confirm(x("assets.deleteConfirm",{filename:t?.filename??e}))&&(await (0,i.deleteAsset)(e),I(v))};return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(r.SubPageNav,{workspaceId:f}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(k.Select,{value:f,onValueChange:t=>t&&(t=>{if(t===f)return;b(t);let s=e.find(e=>e.id===t),a=s?.projects[0]??null;j(a?.id??null),I(a?.id??null)})(t),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===f)?.name??f})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]}),D.length>0&&(0,t.jsxs)(k.Select,{value:v??"",onValueChange:e=>e&&void(e!==v&&(j(e),I(e))),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(u=D.find(e=>e.id===v))?u.alias?`${u.name} (${u.alias})`:u.name:""})}),(0,t.jsx)(k.SelectContent,{children:D.map(e=>(0,t.jsxs)(k.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(w,{allWorkspaces:e,initialWsId:f,initialProjectId:v,onUploaded:e=>{e===v&&I(v)}})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,t.jsxs)("div",{className:`relative ${m?"opacity-40 pointer-events-none":""} transition-opacity`,children:[m&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(a.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===D.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:x("assets.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:x("assets.noProjectHint")})]}):(0,t.jsx)(g,{assets:y.map(e=>({...e,taskId:e.task?.id??null,taskTitle:e.task?.title??null})),onPreview:e=>{let t=e.mimeType?.startsWith("image/"),s=/\.(txt|md|json)$/i.test(e.filename);(t||s)&&E(e)},onReveal:z,onDelete:F,onTaskClick:S})]})}),(0,t.jsx)(P,{imageUrl:"image"===$&&B>=0?A[B].url:null,filename:"image"===$&&B>=0?A[B].filename:"",open:"image"===$,onOpenChange:e=>{e||E(null)},assets:A.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:B>=0?B:void 0,onIndexChange:e=>{let t=A[e];if(!t)return;let s=y.find(e=>e.id===t.id);s&&E({...s,taskId:s.task?.id??null,taskTitle:s.task?.title??null})}}),(0,t.jsx)(R,{url:"text"===$&&O?p(O.path):null,filename:O?.filename??"",open:"text"===$,onOpenChange:e=>{e||E(null)}}),(0,t.jsx)(L.TaskOverviewDrawer,{open:!!C,onOpenChange:e=>{e||S(null)},taskId:C})]})}],734525)},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},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)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let s=(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,s],181209)},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)},673984,e=>{"use strict";let t=(0,e.i(572989).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],673984)},566606,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),l=e.i(821957),i=e.i(519455),n=e.i(793479),r=e.i(905455),o=e.i(746798),d=e.i(224277),c=e.i(975157);function m({className:e,size:s="default",...a}){return(0,t.jsx)("div",{"data-slot":"card","data-size":s,className:(0,c.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...a})}function x({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,c.cn)("px-4 group-data-[size=sm]/card:px-3",e),...s})}var h=e.i(400355),u=e.i(597746),p=e.i(657153),g=e.i(567860),f=e.i(301348),b=e.i(181209),j=e.i(533499);function v({adapterType:e,adapterLabel:a,provider:l,hideHeader:n,onResult:r}){let[o,d]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null),{t:k}=(0,j.useI18n)();async function w(){if(!o){d(!0),y(null);try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:e,provider:l})}),s=await t.json();y(s),r?.(s)}catch{let e={ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]};y(e),r?.(e)}finally{d(!1)}}}return(0,t.jsxs)("div",{className:"space-y-4",children:[!n&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded-lg bg-emerald-100 dark:bg-emerald-900/30 p-2",children:(0,t.jsx)(g.Terminal,{className:"h-5 w-5 text-emerald-600 dark:text-emerald-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold",children:k("settings.aiTools.cliVerification")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:k("settings.aiTools.cliVerificationDesc")})]})]}),(0,t.jsx)(m,{children:(0,t.jsxs)(x,{className:"p-6 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{children:a&&(0,t.jsx)("p",{className:"font-medium",children:a})}),(0,t.jsx)(i.Button,{onClick:w,disabled:o,variant:"outline",children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),k("settings.aiTools.testing")]}):k("settings.aiTools.testConnection")})]}),N&&(0,t.jsxs)("div",{className:(0,c.cn)("rounded-lg border p-4 space-y-3",N.ok?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-red-50 border-red-200 dark:bg-red-950/20 dark:border-red-800"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[N.ok?(0,t.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):(0,t.jsx)(b.XCircle,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,t.jsx)("span",{className:(0,c.cn)("text-sm font-medium",N.ok?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:k(N.ok?"settings.aiTools.testPassed":"settings.aiTools.testFailed")})]}),(0,t.jsx)("div",{className:"space-y-2",children:N.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[s.passed?(0,t.jsx)(u.Check,{className:"h-4 w-4 text-green-500 mt-0.5 shrink-0"}):(0,t.jsx)(p.X,{className:"h-4 w-4 text-red-500 mt-0.5 shrink-0"}),(0,t.jsx)("span",{className:(0,c.cn)(s.passed?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:s.message})]},`${e}-${s.name}`))})]})]})})]})}var N=e.i(464202),y=e.i(673984),k=e.i(226145),w=e.i(245697),C=e.i(19671),T=e.i(368490),S=e.i(387091),L=e.i(15299),M=e.i(572989);let P=(0,M.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),B=(0,M.default)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);var R=e.i(232545),$=e.i(998626),z=e.i(453889),I=e.i(475958),U=e.i(887911),H=e.i(107378),F=e.i(514798);let O=(0,F.createServerReference)("6090b9072de227a79fc49dc75310ab3287833a57ad",F.callServer,void 0,F.findSourceMapURL,"completeOnboarding"),E=(0,F.createServerReference)("60cca945638d621516131c1789cc32678882a18731",F.callServer,void 0,F.findSourceMapURL,"setOnboardingExtensions");function q({username:e,onComplete:a}){let{t:l}=(0,j.useI18n)(),n=(0,U.listExtensionMetadata)(),[r,o]=(0,s.useState)(()=>new Set(n.map(e=>e.id))),[d,c]=(0,s.useState)(!1),m=n.length,x=r.size;async function u(){c(!0);let t=Array.from(r),s=[];if(t.length>0)for(let e of(await Promise.all(t.map(async e=>{try{let t=await (0,H.installExtension)(e);return{id:e,success:t.success}}catch{return{id:e,success:!1}}}))))e.success&&s.push(e.id);await E(t,s),await O(e),c(!1),a()}return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold",children:l("onboarding.step4.title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:l("onboarding.step4.desc")})]}),(0,t.jsx)("div",{className:"space-y-2",children:n.map(e=>{let s=e.icon,a=r.has(e.id);return(0,t.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border border-border bg-background p-3 cursor-pointer hover:bg-accent/50 transition-colors",children:[(0,t.jsx)("input",{type:"checkbox",checked:a,onChange:()=>{var t;return t=e.id,void o(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},disabled:d,className:"mt-0.5 h-4 w-4 cursor-pointer accent-primary"}),(0,t.jsxs)("div",{className:"flex flex-1 items-start gap-3 min-w-0",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:(0,t.jsx)(s,{className:"h-4 w-4 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["~",e.sizeMB," MB"]})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description}),(0,t.jsxs)("a",{href:e.homepageUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[(0,t.jsx)(I.ExternalLink,{className:"h-3 w-3"}),l("settings.extensions.visitHomepage")]})]})]})]},e.id)})}),x<m&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground italic",children:l("onboarding.step4.skipHint")}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(i.Button,{onClick:u,disabled:d,children:d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),l("onboarding.step4.installing")]}):0===x?l("onboarding.step4.continueWithoutInstall"):l("onboarding.step4.continue")})})]})}function D({step:e}){let s=[y.User,g.Terminal,k.GitBranch,w.Package][e-1]??y.User,a=["Profile","Connect","Configure","Extensions"][e-1]??"";return(0,t.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute inset-0 opacity-[0.07] text-white",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{width:"380px",height:"380px",background:"radial-gradient(circle, oklch(0.80 0.14 75 / 0.25) 0%, oklch(0.80 0.14 75 / 0.08) 45%, transparent 70%)",animation:"ob-pulse 6s ease-in-out infinite"}}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/25",style:{width:"260px",height:"260px",animation:"ob-spin 20s linear infinite"},children:(0,t.jsx)("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 h-3 w-3 rounded-full bg-amber-400",style:{boxShadow:"0 0 16px oklch(0.80 0.14 75 / 0.7)"}})}),(0,t.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/15",style:{width:"380px",height:"380px",animation:"ob-spin 30s linear infinite reverse"},children:[(0,t.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 h-2 w-2 rounded-full bg-amber-400/70"}),(0,t.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 h-1.5 w-1.5 rounded-full bg-amber-400/50"})]}),(0,t.jsx)("svg",{className:"absolute",style:{top:"18%",right:"22%",animation:"ob-float 8s ease-in-out infinite"},width:"44",height:"50",viewBox:"0 0 40 46",fill:"none",children:(0,t.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.4)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.06)"})}),(0,t.jsx)("svg",{className:"absolute",style:{bottom:"22%",left:"18%",animation:"ob-float 10s ease-in-out 2s infinite"},width:"32",height:"36",viewBox:"0 0 40 46",fill:"none",children:(0,t.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.3)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.05)"})}),(0,t.jsx)("div",{className:"absolute h-3.5 w-3.5 rounded-full bg-amber-400/40",style:{top:"30%",left:"28%",animation:"ob-float 7s ease-in-out 1s infinite"}}),(0,t.jsx)("div",{className:"absolute h-2.5 w-2.5 rounded-full bg-amber-400/30",style:{top:"65%",right:"30%",animation:"ob-float 9s ease-in-out 3s infinite"}}),(0,t.jsx)("div",{className:"absolute h-2 w-2 rounded-full bg-amber-400/20",style:{top:"45%",right:"15%",animation:"ob-float 6s ease-in-out 0.5s infinite"}}),(0,t.jsxs)("svg",{className:"absolute inset-0 h-full w-full text-white opacity-[0.12]",children:[(0,t.jsx)("line",{x1:"30%",y1:"25%",x2:"70%",y2:"45%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 12s linear infinite"}}),(0,t.jsx)("line",{x1:"65%",y1:"30%",x2:"35%",y2:"70%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 15s linear infinite reverse"}})]}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,t.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-400/35 bg-amber-500/10 backdrop-blur-sm transition-all duration-700",style:{boxShadow:"0 0 50px oklch(0.80 0.14 75 / 0.2)"},children:(0,t.jsx)(s,{className:"h-7 w-7 text-amber-400"})})}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 translate-y-12 text-center",children:(0,t.jsx)("p",{className:"text-[11px] font-medium tracking-widest uppercase text-amber-400/60",children:a})})]})}let V={host:"",ownerMatch:"*",localPathTemplate:""};e.s(["default",0,function(){let e,c,m,x=(0,a.useRouter)(),{t:h,locale:p,setLocale:f}=(0,j.useI18n)(),{theme:b,setTheme:M}=(0,l.useTheme)(),[I,U]=(0,s.useState)(!1),[H,F]=(0,s.useState)(1),[O,E]=(0,s.useState)(""),[_,A]=(0,s.useState)({}),G=Object.values(_).some(e=>e.ok),[W,X]=(0,s.useState)([]),[K,Z]=(0,s.useState)({...V}),[J,Q]=(0,s.useState)(!0),[Y,ee]=(0,s.useState)(0),[et,es]=(0,s.useState)(!1),[ea,el]=(0,s.useState)(!1);(0,s.useEffect)(()=>U(!0),[]);let ei=[{value:"light",label:(0,t.jsx)(S.Sun,{className:"h-4 w-4"})},{value:"dark",label:(0,t.jsx)(L.Moon,{className:"h-4 w-4"})},{value:"system",label:(0,t.jsx)(P,{className:"h-4 w-4"})}];function en(){F(e=>e+1)}function er(){F(e=>Math.max(1,e-1))}let eo=[{icon:y.User,label:h("onboarding.step1.title")},{icon:g.Terminal,label:h("onboarding.step2.title")},{icon:k.GitBranch,label:h("onboarding.step3.title")},{icon:w.Package,label:h("onboarding.step4.title")}];return(0,t.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,t.jsx)("div",{className:"hidden xl:block xl:w-3/5 border-r border-border/50 bg-[oklch(0.13_0.006_260)]",children:(0,t.jsx)(D,{step:H})}),(0,t.jsx)("div",{className:"flex w-full flex-col items-center px-8 pt-[10vh] pb-10 xl:w-2/5 xl:px-16 overflow-y-auto",children:(0,t.jsxs)("div",{className:"w-full max-w-lg space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-8 w-8 rounded-lg"}),(0,t.jsx)("span",{className:"text-lg font-semibold tracking-tight",children:"Tower"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:eo.map((e,s)=>{let a=s+1,l=a===H,i=a<H,n=e.icon;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[s>0&&(0,t.jsx)("div",{className:`h-px w-4 transition-colors duration-500 ${i?"bg-primary":"bg-border"}`}),(0,t.jsxs)("div",{className:`flex items-center gap-1 shrink-0 rounded-full px-2 py-1 text-[11px] font-medium whitespace-nowrap transition-all duration-500 ${l?"bg-primary text-primary-foreground shadow-sm":i?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:[i?(0,t.jsx)(u.Check,{className:"h-3 w-3 shrink-0"}):(0,t.jsx)(n,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{children:e.label})]})]},s)})})]}),(0,t.jsxs)("div",{children:[1===H&&(0,t.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:h("onboarding.step1.title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h("onboarding.step1.desc")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"onboarding-username",className:"text-sm font-medium",children:h("onboarding.step1.usernameLabel")}),(0,t.jsx)("input",{id:"onboarding-username",type:"text",value:O,onChange:e=>E(e.target.value),placeholder:h("onboarding.step1.usernamePlaceholder"),className:"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",maxLength:64,autoFocus:!0,autoComplete:"username"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("label",{className:"text-sm font-medium",children:h("settings.language")})]}),(0,t.jsx)(r.SegmentedControl,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}].map(e=>({value:e.value,label:e.label})),value:p,onChange:e=>f(e)})]}),(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(S.Sun,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("label",{className:"text-sm font-medium",children:h("settings.theme")})]}),I?(0,t.jsx)(r.SegmentedControl,{options:ei.map(e=>({value:e.value,label:e.label})),value:b??"system",onChange:e=>M(e)}):(0,t.jsx)("div",{className:"inline-flex h-8 rounded-md border border-border bg-muted p-1 gap-1 w-[120px]"})]})]}),(0,t.jsx)("div",{className:"flex justify-end pt-3",children:(0,t.jsxs)(i.Button,{onClick:en,disabled:0===O.trim().length,className:"px-5",children:[h("onboarding.step1.next"),(0,t.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})})]}),2===H&&(0,t.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:h("onboarding.step2.title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h("onboarding.step2.desc")})]}),(0,t.jsx)(v,{adapterType:"claude_code",adapterLabel:"Claude CLI",provider:"claude",onResult:e=>A(t=>({...t,claude:e}))}),(0,t.jsx)(v,{adapterType:"codex_cli",adapterLabel:"Codex CLI",provider:"codex",hideHeader:!0,onResult:e=>A(t=>({...t,codex:e}))}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,t.jsxs)(i.Button,{variant:"ghost",className:"text-muted-foreground",onClick:er,children:[(0,t.jsx)(C.ChevronLeft,{className:"h-4 w-4 mr-1"}),h("onboarding.back")]}),(0,t.jsxs)(i.Button,{onClick:en,disabled:!G,className:"px-5",children:[h("onboarding.step1.next"),(0,t.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),3===H&&(0,t.jsxs)("div",{className:"space-y-5 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:h("onboarding.step3.title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h("onboarding.step3.desc")})]}),W.length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:h("onboarding.step3.added").replace("{count}",String(W.length))}),W.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"text-sm font-medium truncate",children:[e.host,(0,t.jsx)("span",{className:"text-muted-foreground",children:"*"!==e.ownerMatch?` / ${e.ownerMatch}`:""})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:e.localPathTemplate})]}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void X(e=>e.filter(e=>e.id!==t))},children:(0,t.jsx)($.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))]}),J?(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:h("onboarding.step3.hostLabel")}),(0,t.jsx)(n.Input,{value:K.host,onChange:e=>Z(t=>({...t,host:e.target.value})),placeholder:h("onboarding.step3.hostPlaceholder"),className:"h-9",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:h("onboarding.step3.ownerLabel")}),(0,t.jsx)(n.Input,{value:K.ownerMatch,onChange:e=>Z(t=>({...t,ownerMatch:e.target.value})),placeholder:h("onboarding.step3.ownerPlaceholder"),className:"h-9"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:h("onboarding.step3.pathLabel")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.Input,{value:K.localPathTemplate,onChange:e=>Z(t=>({...t,localPathTemplate:e.target.value})),placeholder:h("onboarding.step3.pathPlaceholder"),className:"h-9 font-mono text-xs flex-1"}),(0,t.jsxs)(o.Tooltip,{children:[(0,t.jsx)(o.TooltipTrigger,{render:(0,t.jsx)(i.Button,{variant:et?"default":"outline",size:"sm",type:"button",onClick:()=>{es(e=>(e||ee(2),!e))},className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(o.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:h("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:h("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(o.Tooltip,{children:[(0,t.jsx)(o.TooltipTrigger,{render:(0,t.jsx)(i.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>el(!0),children:(0,t.jsx)(z.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(o.TooltipContent,{children:h("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:h(et?"onboarding.step3.pathHintFull":"onboarding.step3.pathHintRepo")})]}),K.localPathTemplate&&(e=K.localPathTemplate.trim().replace(/\/+$/,""),c=et?`${e}/{path}`:e,m=[{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:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:h("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1 flex-wrap",children:m.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>ee(s),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${Y===s?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e.label},s))}),(0,t.jsxs)("div",{className:"rounded-md bg-muted/50 px-3 py-2 space-y-1",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:m[Y].url}),(0,t.jsxs)("p",{className:"font-mono text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-primary",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],l=s.match(/^git@[^:]+:(.+)$/);if(l)a=l[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],n=a[a.length-1],r=a.join("/");if(e.includes("{path}"))return e.replace("{path}",r).replace("{owner}",i).replace("{repo}",n).replace(/\/+$/,"");let o=e.replace("{owner}",i).replace("{repo}","").replace(/\/+$/,"");return`${o}/${n}`}(c,m[Y].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[W.length>0&&(0,t.jsx)(i.Button,{variant:"ghost",onClick:()=>Q(!1),children:h("settings.config.git.cancel")}),(0,t.jsxs)(i.Button,{onClick:function(){if(!K.host.trim()||!K.localPathTemplate.trim())return;let e=K.localPathTemplate.trim().replace(/\/+$/,""),t=et?`${e}/{path}`:e,s={id:crypto.randomUUID(),host:K.host.trim(),ownerMatch:K.ownerMatch.trim()||"*",localPathTemplate:t,priority:W.length};X(e=>[...e,s]),Z({...V}),es(!1),Q(!1)},disabled:!K.host.trim()||!K.localPathTemplate.trim(),children:[(0,t.jsx)(u.Check,{className:"h-4 w-4 mr-1"}),h("settings.config.git.save")]})]})]}):(0,t.jsxs)(i.Button,{variant:"outline",onClick:()=>{Z({...V}),Q(!0)},children:[(0,t.jsx)(R.Plus,{className:"h-4 w-4 mr-1"}),h("settings.config.git.addRule")]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,t.jsxs)(i.Button,{variant:"ghost",className:"text-muted-foreground",onClick:er,children:[(0,t.jsx)(C.ChevronLeft,{className:"h-4 w-4 mr-1"}),h("onboarding.back")]}),(0,t.jsxs)(i.Button,{onClick:async()=>{W.length>0&&await (0,N.setConfigValue)("git.pathMappingRules",W),F(e=>e+1)},className:"px-5",children:[h("onboarding.step1.next"),(0,t.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),4===H&&(0,t.jsx)(q,{username:O,onComplete:()=>x.replace("/workspaces")})]}),(0,t.jsx)("div",{className:"pt-6 text-xs text-muted-foreground",children:h("onboarding.stepIndicator").replace("{current}",String(H)).replace("{total}",String(4))})]})}),(0,t.jsx)(d.FolderBrowserDialog,{open:ea,onOpenChange:el,onSelect:e=>{Z(t=>({...t,localPathTemplate:e})),el(!1)}})]})}],566606)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},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)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let s=(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,s],181209)},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)},673984,e=>{"use strict";let t=(0,e.i(572989).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",0,t],673984)},566606,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),l=e.i(821957),i=e.i(519455),n=e.i(793479),r=e.i(905455),o=e.i(746798),d=e.i(224277),c=e.i(975157);function m({className:e,size:s="default",...a}){return(0,t.jsx)("div",{"data-slot":"card","data-size":s,className:(0,c.cn)("group/card flex flex-col gap-4 overflow-hidden rounded-xl bg-card py-4 text-sm text-card-foreground ring-1 ring-foreground/10 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...a})}function x({className:e,...s}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,c.cn)("px-4 group-data-[size=sm]/card:px-3",e),...s})}var h=e.i(400355),u=e.i(597746),p=e.i(657153),g=e.i(567860),f=e.i(301348),b=e.i(181209),j=e.i(533499);function v({adapterType:e,adapterLabel:a,provider:l,hideHeader:n,onResult:r}){let[o,d]=(0,s.useState)(!1),[N,y]=(0,s.useState)(null),{t:k}=(0,j.useI18n)();async function w(){if(!o){d(!0),y(null);try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:e,provider:l})}),s=await t.json();y(s),r?.(s)}catch{let e={ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]};y(e),r?.(e)}finally{d(!1)}}}return(0,t.jsxs)("div",{className:"space-y-4",children:[!n&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded-lg bg-emerald-100 dark:bg-emerald-900/30 p-2",children:(0,t.jsx)(g.Terminal,{className:"h-5 w-5 text-emerald-600 dark:text-emerald-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-semibold",children:k("settings.aiTools.cliVerification")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:k("settings.aiTools.cliVerificationDesc")})]})]}),(0,t.jsx)(m,{children:(0,t.jsxs)(x,{className:"p-6 space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("div",{children:a&&(0,t.jsx)("p",{className:"font-medium",children:a})}),(0,t.jsx)(i.Button,{onClick:w,disabled:o,variant:"outline",children:o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),k("settings.aiTools.testing")]}):k("settings.aiTools.testConnection")})]}),N&&(0,t.jsxs)("div",{className:(0,c.cn)("rounded-lg border p-4 space-y-3",N.ok?"bg-green-50 border-green-200 dark:bg-green-950/20 dark:border-green-800":"bg-red-50 border-red-200 dark:bg-red-950/20 dark:border-red-800"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[N.ok?(0,t.jsx)(f.CheckCircle2,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):(0,t.jsx)(b.XCircle,{className:"h-4 w-4 text-red-600 dark:text-red-400"}),(0,t.jsx)("span",{className:(0,c.cn)("text-sm font-medium",N.ok?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:k(N.ok?"settings.aiTools.testPassed":"settings.aiTools.testFailed")})]}),(0,t.jsx)("div",{className:"space-y-2",children:N.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[s.passed?(0,t.jsx)(u.Check,{className:"h-4 w-4 text-green-500 mt-0.5 shrink-0"}):(0,t.jsx)(p.X,{className:"h-4 w-4 text-red-500 mt-0.5 shrink-0"}),(0,t.jsx)("span",{className:(0,c.cn)(s.passed?"text-green-700 dark:text-green-300":"text-red-700 dark:text-red-300"),children:s.message})]},`${e}-${s.name}`))})]})]})})]})}var N=e.i(706938),y=e.i(673984),k=e.i(226145),w=e.i(245697),C=e.i(19671),T=e.i(368490),S=e.i(387091),L=e.i(15299),M=e.i(572989);let P=(0,M.default)("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),B=(0,M.default)("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);var R=e.i(232545),$=e.i(998626),z=e.i(453889),I=e.i(475958),U=e.i(887911),H=e.i(640547),F=e.i(514798);let O=(0,F.createServerReference)("60aabb434f869421795d9ed3df58a16a0646d7e953",F.callServer,void 0,F.findSourceMapURL,"completeOnboarding"),E=(0,F.createServerReference)("608fd90109e88278b7b9e1e4c071a4d9ed0cc479f6",F.callServer,void 0,F.findSourceMapURL,"setOnboardingExtensions");function q({username:e,onComplete:a}){let{t:l}=(0,j.useI18n)(),n=(0,U.listExtensionMetadata)(),[r,o]=(0,s.useState)(()=>new Set(n.map(e=>e.id))),[d,c]=(0,s.useState)(!1),m=n.length,x=r.size;async function u(){c(!0);let t=Array.from(r),s=[];if(t.length>0)for(let e of(await Promise.all(t.map(async e=>{try{let t=await (0,H.installExtension)(e);return{id:e,success:t.success}}catch{return{id:e,success:!1}}}))))e.success&&s.push(e.id);await E(t,s),await O(e),c(!1),a()}return(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h2",{className:"text-xl font-semibold",children:l("onboarding.step4.title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:l("onboarding.step4.desc")})]}),(0,t.jsx)("div",{className:"space-y-2",children:n.map(e=>{let s=e.icon,a=r.has(e.id);return(0,t.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border border-border bg-background p-3 cursor-pointer hover:bg-accent/50 transition-colors",children:[(0,t.jsx)("input",{type:"checkbox",checked:a,onChange:()=>{var t;return t=e.id,void o(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},disabled:d,className:"mt-0.5 h-4 w-4 cursor-pointer accent-primary"}),(0,t.jsxs)("div",{className:"flex flex-1 items-start gap-3 min-w-0",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted",children:(0,t.jsx)(s,{className:"h-4 w-4 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"shrink-0 text-xs text-muted-foreground",children:["~",e.sizeMB," MB"]})]}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.description}),(0,t.jsxs)("a",{href:e.homepageUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),className:"mt-1 inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[(0,t.jsx)(I.ExternalLink,{className:"h-3 w-3"}),l("settings.extensions.visitHomepage")]})]})]})]},e.id)})}),x<m&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground italic",children:l("onboarding.step4.skipHint")}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsx)(i.Button,{onClick:u,disabled:d,children:d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),l("onboarding.step4.installing")]}):0===x?l("onboarding.step4.continueWithoutInstall"):l("onboarding.step4.continue")})})]})}function D({step:e}){let s=[y.User,g.Terminal,k.GitBranch,w.Package][e-1]??y.User,a=["Profile","Connect","Configure","Extensions"][e-1]??"";return(0,t.jsxs)("div",{className:"relative h-full w-full overflow-hidden",children:[(0,t.jsx)("div",{className:"absolute inset-0 opacity-[0.07] text-white",style:{backgroundImage:"radial-gradient(circle, currentColor 1px, transparent 1px)",backgroundSize:"24px 24px"}}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",style:{width:"380px",height:"380px",background:"radial-gradient(circle, oklch(0.80 0.14 75 / 0.25) 0%, oklch(0.80 0.14 75 / 0.08) 45%, transparent 70%)",animation:"ob-pulse 6s ease-in-out infinite"}}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/25",style:{width:"260px",height:"260px",animation:"ob-spin 20s linear infinite"},children:(0,t.jsx)("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 h-3 w-3 rounded-full bg-amber-400",style:{boxShadow:"0 0 16px oklch(0.80 0.14 75 / 0.7)"}})}),(0,t.jsxs)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full border border-amber-400/15",style:{width:"380px",height:"380px",animation:"ob-spin 30s linear infinite reverse"},children:[(0,t.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 h-2 w-2 rounded-full bg-amber-400/70"}),(0,t.jsx)("div",{className:"absolute -bottom-1 left-1/2 -translate-x-1/2 h-1.5 w-1.5 rounded-full bg-amber-400/50"})]}),(0,t.jsx)("svg",{className:"absolute",style:{top:"18%",right:"22%",animation:"ob-float 8s ease-in-out infinite"},width:"44",height:"50",viewBox:"0 0 40 46",fill:"none",children:(0,t.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.4)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.06)"})}),(0,t.jsx)("svg",{className:"absolute",style:{bottom:"22%",left:"18%",animation:"ob-float 10s ease-in-out 2s infinite"},width:"32",height:"36",viewBox:"0 0 40 46",fill:"none",children:(0,t.jsx)("path",{d:"M20 1 L38 12 L38 34 L20 45 L2 34 L2 12 Z",stroke:"oklch(0.80 0.14 75 / 0.3)",strokeWidth:"1.5",fill:"oklch(0.80 0.14 75 / 0.05)"})}),(0,t.jsx)("div",{className:"absolute h-3.5 w-3.5 rounded-full bg-amber-400/40",style:{top:"30%",left:"28%",animation:"ob-float 7s ease-in-out 1s infinite"}}),(0,t.jsx)("div",{className:"absolute h-2.5 w-2.5 rounded-full bg-amber-400/30",style:{top:"65%",right:"30%",animation:"ob-float 9s ease-in-out 3s infinite"}}),(0,t.jsx)("div",{className:"absolute h-2 w-2 rounded-full bg-amber-400/20",style:{top:"45%",right:"15%",animation:"ob-float 6s ease-in-out 0.5s infinite"}}),(0,t.jsxs)("svg",{className:"absolute inset-0 h-full w-full text-white opacity-[0.12]",children:[(0,t.jsx)("line",{x1:"30%",y1:"25%",x2:"70%",y2:"45%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 12s linear infinite"}}),(0,t.jsx)("line",{x1:"65%",y1:"30%",x2:"35%",y2:"70%",stroke:"currentColor",strokeWidth:"1",strokeDasharray:"4 6",style:{animation:"ob-dash 15s linear infinite reverse"}})]}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 flex items-center justify-center",children:(0,t.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl border border-amber-400/35 bg-amber-500/10 backdrop-blur-sm transition-all duration-700",style:{boxShadow:"0 0 50px oklch(0.80 0.14 75 / 0.2)"},children:(0,t.jsx)(s,{className:"h-7 w-7 text-amber-400"})})}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 translate-y-12 text-center",children:(0,t.jsx)("p",{className:"text-[11px] font-medium tracking-widest uppercase text-amber-400/60",children:a})})]})}let V={host:"",ownerMatch:"*",localPathTemplate:""};e.s(["default",0,function(){let e,c,m,x=(0,a.useRouter)(),{t:h,locale:p,setLocale:f}=(0,j.useI18n)(),{theme:b,setTheme:M}=(0,l.useTheme)(),[I,U]=(0,s.useState)(!1),[H,F]=(0,s.useState)(1),[O,E]=(0,s.useState)(""),[_,A]=(0,s.useState)({}),G=Object.values(_).some(e=>e.ok),[W,X]=(0,s.useState)([]),[K,Z]=(0,s.useState)({...V}),[J,Q]=(0,s.useState)(!0),[Y,ee]=(0,s.useState)(0),[et,es]=(0,s.useState)(!1),[ea,el]=(0,s.useState)(!1);(0,s.useEffect)(()=>U(!0),[]);let ei=[{value:"light",label:(0,t.jsx)(S.Sun,{className:"h-4 w-4"})},{value:"dark",label:(0,t.jsx)(L.Moon,{className:"h-4 w-4"})},{value:"system",label:(0,t.jsx)(P,{className:"h-4 w-4"})}];function en(){F(e=>e+1)}function er(){F(e=>Math.max(1,e-1))}let eo=[{icon:y.User,label:h("onboarding.step1.title")},{icon:g.Terminal,label:h("onboarding.step2.title")},{icon:k.GitBranch,label:h("onboarding.step3.title")},{icon:w.Package,label:h("onboarding.step4.title")}];return(0,t.jsxs)("div",{className:"flex h-screen bg-background",children:[(0,t.jsx)("div",{className:"hidden xl:block xl:w-3/5 border-r border-border/50 bg-[oklch(0.13_0.006_260)]",children:(0,t.jsx)(D,{step:H})}),(0,t.jsx)("div",{className:"flex w-full flex-col items-center px-8 pt-[10vh] pb-10 xl:w-2/5 xl:px-16 overflow-y-auto",children:(0,t.jsxs)("div",{className:"w-full max-w-lg space-y-6",children:[(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-8 w-8 rounded-lg"}),(0,t.jsx)("span",{className:"text-lg font-semibold tracking-tight",children:"Tower"})]}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:eo.map((e,s)=>{let a=s+1,l=a===H,i=a<H,n=e.icon;return(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[s>0&&(0,t.jsx)("div",{className:`h-px w-4 transition-colors duration-500 ${i?"bg-primary":"bg-border"}`}),(0,t.jsxs)("div",{className:`flex items-center gap-1 shrink-0 rounded-full px-2 py-1 text-[11px] font-medium whitespace-nowrap transition-all duration-500 ${l?"bg-primary text-primary-foreground shadow-sm":i?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:[i?(0,t.jsx)(u.Check,{className:"h-3 w-3 shrink-0"}):(0,t.jsx)(n,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{children:e.label})]})]},s)})})]}),(0,t.jsxs)("div",{children:[1===H&&(0,t.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:h("onboarding.step1.title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h("onboarding.step1.desc")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("label",{htmlFor:"onboarding-username",className:"text-sm font-medium",children:h("onboarding.step1.usernameLabel")}),(0,t.jsx)("input",{id:"onboarding-username",type:"text",value:O,onChange:e=>E(e.target.value),placeholder:h("onboarding.step1.usernamePlaceholder"),className:"flex h-10 w-full rounded-lg border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50",maxLength:64,autoFocus:!0,autoComplete:"username"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-6",children:[(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(B,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("label",{className:"text-sm font-medium",children:h("settings.language")})]}),(0,t.jsx)(r.SegmentedControl,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}].map(e=>({value:e.value,label:e.label})),value:p,onChange:e=>f(e)})]}),(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(S.Sun,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,t.jsx)("label",{className:"text-sm font-medium",children:h("settings.theme")})]}),I?(0,t.jsx)(r.SegmentedControl,{options:ei.map(e=>({value:e.value,label:e.label})),value:b??"system",onChange:e=>M(e)}):(0,t.jsx)("div",{className:"inline-flex h-8 rounded-md border border-border bg-muted p-1 gap-1 w-[120px]"})]})]}),(0,t.jsx)("div",{className:"flex justify-end pt-3",children:(0,t.jsxs)(i.Button,{onClick:en,disabled:0===O.trim().length,className:"px-5",children:[h("onboarding.step1.next"),(0,t.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})})]}),2===H&&(0,t.jsxs)("div",{className:"space-y-7 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:h("onboarding.step2.title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h("onboarding.step2.desc")})]}),(0,t.jsx)(v,{adapterType:"claude_code",adapterLabel:"Claude CLI",provider:"claude",onResult:e=>A(t=>({...t,claude:e}))}),(0,t.jsx)(v,{adapterType:"codex_cli",adapterLabel:"Codex CLI",provider:"codex",hideHeader:!0,onResult:e=>A(t=>({...t,codex:e}))}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,t.jsxs)(i.Button,{variant:"ghost",className:"text-muted-foreground",onClick:er,children:[(0,t.jsx)(C.ChevronLeft,{className:"h-4 w-4 mr-1"}),h("onboarding.back")]}),(0,t.jsxs)(i.Button,{onClick:en,disabled:!G,className:"px-5",children:[h("onboarding.step1.next"),(0,t.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),3===H&&(0,t.jsxs)("div",{className:"space-y-5 animate-in fade-in slide-in-from-left-4 duration-500",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:h("onboarding.step3.title")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground leading-relaxed",children:h("onboarding.step3.desc")})]}),W.length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:h("onboarding.step3.added").replace("{count}",String(W.length))}),W.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("p",{className:"text-sm font-medium truncate",children:[e.host,(0,t.jsx)("span",{className:"text-muted-foreground",children:"*"!==e.ownerMatch?` / ${e.ownerMatch}`:""})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground font-mono truncate",children:e.localPathTemplate})]}),(0,t.jsx)(i.Button,{variant:"ghost",size:"icon",className:"shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>{var t;return t=e.id,void X(e=>e.filter(e=>e.id!==t))},children:(0,t.jsx)($.Trash2,{className:"h-3.5 w-3.5"})})]},e.id))]}),J?(0,t.jsxs)("div",{className:"space-y-3 rounded-lg border border-border p-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:h("onboarding.step3.hostLabel")}),(0,t.jsx)(n.Input,{value:K.host,onChange:e=>Z(t=>({...t,host:e.target.value})),placeholder:h("onboarding.step3.hostPlaceholder"),className:"h-9",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:h("onboarding.step3.ownerLabel")}),(0,t.jsx)(n.Input,{value:K.ownerMatch,onChange:e=>Z(t=>({...t,ownerMatch:e.target.value})),placeholder:h("onboarding.step3.ownerPlaceholder"),className:"h-9"})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"block text-xs font-medium",children:h("onboarding.step3.pathLabel")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.Input,{value:K.localPathTemplate,onChange:e=>Z(t=>({...t,localPathTemplate:e.target.value})),placeholder:h("onboarding.step3.pathPlaceholder"),className:"h-9 font-mono text-xs flex-1"}),(0,t.jsxs)(o.Tooltip,{children:[(0,t.jsx)(o.TooltipTrigger,{render:(0,t.jsx)(i.Button,{variant:et?"default":"outline",size:"sm",type:"button",onClick:()=>{es(e=>(e||ee(2),!e))},className:"shrink-0 font-mono",children:"{path}"})}),(0,t.jsx)(o.TooltipContent,{side:"top",className:"max-w-xs",children:(0,t.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,t.jsx)("div",{className:"font-medium",children:h("settings.config.git.pathTooltipTitle")}),(0,t.jsx)("div",{className:"opacity-80",children:h("settings.config.git.pathTooltipDetail")})]})})]}),(0,t.jsxs)(o.Tooltip,{children:[(0,t.jsx)(o.TooltipTrigger,{render:(0,t.jsx)(i.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>el(!0),children:(0,t.jsx)(z.FolderOpen,{className:"h-4 w-4"})})}),(0,t.jsx)(o.TooltipContent,{children:h("settings.config.git.pickFolder")})]})]}),(0,t.jsx)("p",{className:"text-[11px] text-muted-foreground",children:h(et?"onboarding.step3.pathHintFull":"onboarding.step3.pathHintRepo")})]}),K.localPathTemplate&&(e=K.localPathTemplate.trim().replace(/\/+$/,""),c=et?`${e}/{path}`:e,m=[{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:"space-y-2",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:h("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1 flex-wrap",children:m.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>ee(s),className:`rounded-md px-2 py-1 text-[11px] font-medium transition-colors ${Y===s?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e.label},s))}),(0,t.jsxs)("div",{className:"rounded-md bg-muted/50 px-3 py-2 space-y-1",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:m[Y].url}),(0,t.jsxs)("p",{className:"font-mono text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-primary",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],l=s.match(/^git@[^:]+:(.+)$/);if(l)a=l[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],n=a[a.length-1],r=a.join("/");if(e.includes("{path}"))return e.replace("{path}",r).replace("{owner}",i).replace("{repo}",n).replace(/\/+$/,"");let o=e.replace("{owner}",i).replace("{repo}","").replace(/\/+$/,"");return`${o}/${n}`}(c,m[Y].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2 pt-1",children:[W.length>0&&(0,t.jsx)(i.Button,{variant:"ghost",onClick:()=>Q(!1),children:h("settings.config.git.cancel")}),(0,t.jsxs)(i.Button,{onClick:function(){if(!K.host.trim()||!K.localPathTemplate.trim())return;let e=K.localPathTemplate.trim().replace(/\/+$/,""),t=et?`${e}/{path}`:e,s={id:crypto.randomUUID(),host:K.host.trim(),ownerMatch:K.ownerMatch.trim()||"*",localPathTemplate:t,priority:W.length};X(e=>[...e,s]),Z({...V}),es(!1),Q(!1)},disabled:!K.host.trim()||!K.localPathTemplate.trim(),children:[(0,t.jsx)(u.Check,{className:"h-4 w-4 mr-1"}),h("settings.config.git.save")]})]})]}):(0,t.jsxs)(i.Button,{variant:"outline",onClick:()=>{Z({...V}),Q(!0)},children:[(0,t.jsx)(R.Plus,{className:"h-4 w-4 mr-1"}),h("settings.config.git.addRule")]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-3",children:[(0,t.jsxs)(i.Button,{variant:"ghost",className:"text-muted-foreground",onClick:er,children:[(0,t.jsx)(C.ChevronLeft,{className:"h-4 w-4 mr-1"}),h("onboarding.back")]}),(0,t.jsxs)(i.Button,{onClick:async()=>{W.length>0&&await (0,N.setConfigValue)("git.pathMappingRules",W),F(e=>e+1)},className:"px-5",children:[h("onboarding.step1.next"),(0,t.jsx)(T.ChevronRight,{className:"h-4 w-4 ml-1"})]})]})]}),4===H&&(0,t.jsx)(q,{username:O,onComplete:()=>x.replace("/workspaces")})]}),(0,t.jsx)("div",{className:"pt-6 text-xs text-muted-foreground",children:h("onboarding.stepIndicator").replace("{current}",String(H)).replace("{total}",String(4))})]})}),(0,t.jsx)(d.FolderBrowserDialog,{open:ea,onOpenChange:el,onSelect:e=>{Z(t=>({...t,localPathTemplate:e})),el(!1)}})]})}],566606)}]);
@@ -63,4 +63,4 @@ out vec4 outColor;
63
63
 
64
64
  void main() {
65
65
  outColor = v_color;
66
- }`,tu=8*Float32Array.BYTES_PER_ELEMENT,t_=class{constructor(){this.attributes=new Float32Array(160),this.count=0}},tf=0,tg=0,tv=0,tp=0,tm=0,tx=0,tw=0,tC=class extends R{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new t_,this._verticesCursor=new t_;let r=this._gl;this._program=ee(e7(r,tc,td)),this._register(S(()=>r.deleteProgram(this._program))),this._projectionLocation=ee(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(S(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(S(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=ee(r.createBuffer()),this._register(S(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,tu,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,tu,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,tu,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,e6),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,h,l,c,d,u,_,f;for(r=0;r<t.rows;r++){for(o=-1,a=0,h=0,l=!1,n=0;n<t.cols;n++)c=(r*t.cols+n)*4,d=e.cells[c+1],_=!!(0x4000000&(u=e.cells[c+2])),(d!==a||u!==h&&(l||_))&&((0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,n,r)),o=n,a=d,h=u,l=_);(0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||"block"===i.style){t.count=0;return}let s,r=0;("bar"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,"bar"===i.style?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),("underline"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),"outline"===i.style&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=8*r++,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(0x4000000&i)switch(0x3000000&i){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&i].rgba;break;case 0x3000000:tf=(0xffffff&i)<<8;break;default:tf=this._themeService.colors.foreground.rgba}else switch(0x3000000&s){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&s].rgba;break;case 0x3000000:tf=(0xffffff&s)<<8;break;default:tf=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=function(e,t){let i=new Float32Array(Math.min(2*e.length,t));for(let t=0;t<e.length;t++)i[t]=e[t];return i}(e.attributes,this._terminal.rows*this._terminal.cols*8)),tg=r*this._dimensions.device.cell.width,tv=o*this._dimensions.device.cell.height,tp=(tf>>24&255)/255,tm=(tf>>16&255)/255,tx=(tf>>8&255)/255,tw=1,this._addRectangle(e.attributes,t,tg,tv,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,tp,tm,tx,tw)}_addRectangle(e,t,i,s,r,n,o,a,h,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=h,e[t+7]=l}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}},tL=class extends R{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(S(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ee(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=e1(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=ep,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},tb=class extends tL{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(s.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){var t;if(257===e.fg?this._ctx.fillStyle=this._themeService.colors.background.css:void 0!==e.fg&&((0x3000000&(t=e.fg))==0x1000000||(0x3000000&t)==0x2000000)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},ty="object"==typeof window?window:globalThis,tM=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new eV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new eV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(i,e),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToFullScreen.set(i,e),this._onDidChangeFullscreen.fire(i)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};tM.INSTANCE=new tM,tM.INSTANCE.onDidChangeZoomLevel,tM.INSTANCE.onDidChangeFullscreen;var tS="object"==typeof navigator?navigator.userAgent:"";tS.indexOf("Firefox"),tS.indexOf("AppleWebKit"),tS.indexOf("Chrome")>=0||tS.indexOf("Safari"),tS.indexOf("Electron/"),tS.indexOf("Android");var tA=!1;if("function"==typeof ty.matchMedia){let e=ty.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ty.matchMedia("(display-mode: fullscreen)");tA=e.matches,tR=e,"string"==typeof tR&&(tR=ty.matchMedia(tR)),tR.addEventListener("change",({matches:e})=>{tA&&t.matches||(tA=e)})}var tR,tT,tk,tE=!1,tB=!1,tP="en",t$=globalThis;"u">typeof t$.vscode&&"u">typeof t$.vscode.process?tk=t$.vscode.process:"u">typeof _.default&&"string"==typeof _.default?.versions?.node&&(tk=_.default);var tD="string"==typeof tk?.versions?.electron&&tk?.type==="renderer";if("object"==typeof tk){tk.platform,tk.platform,"linux"===tk.platform&&tk.env.SNAP&&tk.env.SNAP_REVISION,tk.env.CI||tk.env.BUILD_ARTIFACTSTAGINGDIRECTORY,tP="en";let e=tk.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,tP=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}tE=!0}else"object"!=typeof navigator||tD?console.error("Unable to resolve platform."):((tT=navigator.userAgent).indexOf("Windows"),tT.indexOf("Macintosh"),(tT.indexOf("Macintosh")>=0||tT.indexOf("iPad")>=0||tT.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,tT.indexOf("Linux"),tT?.indexOf("Mobi"),tB=!0,tP=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());var tF=tE;tB&&"function"==typeof t$.importScripts&&t$.origin;var tW,tI=tT,tO=tP;(tY=tW||={}).value=function(){return tO},tY.isDefaultVariant=function(){return 2===tO.length?"en"===tO:tO.length>=3&&"e"===tO[0]&&"n"===tO[1]&&"-"===tO[2]},tY.isDefault=function(){return"en"===tO};var tz="function"==typeof t$.postMessage&&!t$.importScripts,tU=(()=>{if(tz){let e=[];t$.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),t$.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),tN=!!(tI&&tI.indexOf("Chrome")>=0);tI&&tI.indexOf("Firefox"),!tN&&tI&&tI.indexOf("Safari"),tI&&tI.indexOf("Edg/"),tI&&tI.indexOf("Android");var tq="object"==typeof navigator?navigator:{};tF||document.queryCommandSupported&&document.queryCommandSupported("copy")||tq&&tq.clipboard&&tq.clipboard.writeText,tF||tq&&tq.clipboard&&tq.clipboard.readText,tF||tA||tq.keyboard,"ontouchstart"in ty||tq.maxTouchPoints,ty.PointerEvent&&("ontouchstart"in ty||navigator.maxTouchPoints);var tG=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},tH=new tG,tj=new tG,tV=new tG;(tX=tZ||={}).toString=function(e){return tH.keyCodeToStr(e)},tX.fromString=function(e){return tH.strToKeyCode(e)},tX.toUserSettingsUS=function(e){return tj.keyCodeToStr(e)},tX.toUserSettingsGeneral=function(e){return tV.keyCodeToStr(e)},tX.fromUserSettings=function(e){return tj.strToKeyCode(e)||tV.strToKeyCode(e)},tX.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return tH.keyCodeToStr(e)};var tY,tX,tZ,tQ,tK=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(o=tQ||={}).isCancellationToken=function(e){return e===o.None||e===o.Cancelled||e instanceof tJ||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eO.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tK});var tJ=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tK:(this._emitter||(this._emitter=new eV),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};Symbol("MicrotaskDelay"),(a=h||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},a.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var t0=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new eV,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await eO.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};t0.EMPTY=t0.fromArray([]);function t5(e,t){return(t<<5)-t+e|0}function t1(e,t){t=t5(149417,t);for(let i=0,s=e.length;i<s;i++)t=t5(e.charCodeAt(i),t);return t}new DataView(new ArrayBuffer(320));var{registerWindow:t2,getWindow:t3,getDocument:t4,getWindows:t8,getWindowsCount:t6,getWindowId:t7,getWindowById:t9,hasWindow:ie,onDidRegisterWindow:it,onWillUnregisterWindow:ii,onDidUnregisterWindow:is}=(t=new Map,i={window:ty,disposables:new A},t.set(ty.vscodeWindowId,i),s=new eV,r=new eV,n=new eV,{onDidRegisterWindow:s.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:r.event,registerWindow(e){var i,o;if(t.has(e.vscodeWindowId))return R.None;let a=new A,h={window:e,disposables:a.add(new A)};return t.set(e.vscodeWindowId,h),a.add(S(()=>{t.delete(e.vscodeWindowId),r.fire(e)})),a.add((i=e,o=ia.BEFORE_UNLOAD,new ir(i,o,()=>{n.fire(e)},void 0))),s.fire(h),a},getWindows:()=>t.values(),getWindowsCount:()=>t.size,getWindowId:e=>e.vscodeWindowId,hasWindow:e=>t.has(e),getWindowById:function(e,s){return("number"==typeof e?t.get(e):void 0)??(s?i:void 0)},getWindow:e=>e?.ownerDocument?.defaultView?e.ownerDocument.defaultView.window:e?.view?e.view.window:ty,getDocument:e=>t3(e).document}),ir=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}},io=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new e(t,i):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t||!!e&&!!t&&e.width===t.width&&e.height===t.height}};io.None=new io(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=function e(t,i){switch(typeof t){case"object":var s,r,n,o;return null===t?t5(349,i):Array.isArray(t)?(s=t,r=t5(104579,r=i),s.reduce((t,i)=>e(i,t),r)):(n=t,o=t5(181387,o=i),Object.keys(n).sort().reduce((t,i)=>(t=t1(i,t),e(n[i],t)),o));case"string":return t1(t,i);case"boolean":return t5(t?433:863,i);case"number":return t5(t,i);case"undefined":return t5(937,i);default:return t5(617,i)}}(i,0),n=s.get(r);if(n)n.users+=1;else{let o=new eV,a=new MutationObserver(e=>o.fire(e));a.observe(e,i);let h=n={users:1,observer:a,onDidMutate:o.event};t.add(S(()=>{h.users-=1,0===h.users&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}};var ia={BEFORE_UNLOAD:"beforeunload"},ih=class extends R{constructor(e,t,i,s,r,n,o,a,h){if(super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new T,this._charAtlasDisposable=this._register(new T),this._observerDisposable=this._register(new T),this._model=new tl,this._workCell=new e8,this._workCell2=new e8,this._rectangleRenderer=this._register(new T),this._glyphRenderer=this._register(new T),this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new eV),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._gl=this._canvas.getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:h}),!this._gl)throw Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ev(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new tb(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions={css:{canvas:es(),cell:es()},device:{canvas:es(),cell:es(),char:{width:0,height:0,left:0,top:0}}},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextlost",e=>{console.log("webglcontextlost event received"),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(e)},3e3)})),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextrestored",e=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,e2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=e4(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=e4(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(S(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),e2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){for(let e of(this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows),this._renderLayers))e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new tC(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new ta(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=e1(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=M(eO.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),eO.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){for(let e of(this._clearModel(!0),this._renderLayers))e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(!this._core.screenElement?.isConnected||!this._charSizeService.width||!this._charSizeService.height)return;else this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new e3(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,h,l,c=0,d=!0,u,_,f,g,v,p,m,x,w;e=ic(e,i.rows-1,0),t=ic(t,i.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,b=L-i.buffer.ydisp,y=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),M=-1,S=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let A=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,f=L===o,c=0,h=this._characterJoinerService.getJoinedCharacters(o),x=0;x<i.cols;x++){if(r=this._cellColorResolver.result.bg,a.loadCell(x,s),0===x&&(r=this._cellColorResolver.result.bg),l=!1,d=x>=c,u=x,h.length>0&&x===h[0][0]&&d){_=h.shift();let e=this._model.selection.isCellSelected(this._terminal,_[0],o);for(m=_[0]+1;m<_[1];m++)d&&=e===this._model.selection.isCellSelected(this._terminal,m,o);(d&&=!f||y<_[0]||y>=_[1])?(l=!0,s=new il(s,a.translateToString(!0,_[0],_[1]),_[1]-_[0]),u=_[1]-1):c=_[1]}if(g=s.getChars(),v=s.getCode(),m=(n*i.cols+x)*4,this._cellColorResolver.resolve(s,x,o,this.dimensions.device.cell.width),S&&o===L&&(x===y&&(this._model.cursor={x:y,y:b,width:s.getWidth(),style:this._coreBrowserService.isFocused?C:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},M=y+s.getWidth()-1),x>=y&&x<=M&&(this._coreBrowserService.isFocused&&"block"===C||!1===this._coreBrowserService.isFocused&&"block"===i.options.cursorInactiveStyle)&&(this._cellColorResolver.result.fg=0x3000000|this._themeService.colors.cursorAccent.rgba>>8&0xffffff,this._cellColorResolver.result.bg=0x3000000|this._themeService.colors.cursor.rgba>>8&0xffffff)),0!==v&&(this._model.lineLengths[n]=x+1),(this._model.cells[m]!==v||this._model.cells[m+1]!==this._cellColorResolver.result.bg||this._model.cells[m+2]!==this._cellColorResolver.result.fg||this._model.cells[m+3]!==this._cellColorResolver.result.ext)&&(A=!0,g.length>1&&(v|=0x80000000),this._model.cells[m]=v,this._model.cells[m+1]=this._cellColorResolver.result.bg,this._model.cells[m+2]=this._cellColorResolver.result.fg,this._model.cells[m+3]=this._cellColorResolver.result.ext,p=s.getWidth(),this._glyphRenderer.value.updateCell(x,n,v,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,g,p,r),l)){for(s=this._workCell,x++;x<=u;x++)w=(n*i.cols+x)*4,this._glyphRenderer.value.updateCell(x,n,0,0,0,0,"",0,0),this._model.cells[w]=0,this._model.cells[w+1]=this._cellColorResolver.result.bg,this._model.cells[w+2]=this._cellColorResolver.result.fg,this._model.cells[w+3]=this._cellColorResolver.result.ext;x--}}A&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},il=class extends eB{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function ic(e,t,i=0){return Math.max(Math.min(e,t),i)}var id="di$target",iu="di$dependencies",i_=new Map;function ig(e){if(i_.has(e))return i_.get(e);let t=function(e,i,s){var r,n,o;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");r=t,n=e,o=s,n[id]===n?n[iu].push({id:r,index:o}):(n[iu]=[{id:r,index:o}],n[id]=n)};return t._id=e,i_.set(e,t),t}ig("BufferService"),ig("CoreMouseService"),ig("CoreService"),ig("CharsetService"),ig("InstantiationService"),ig("LogService");var iv=ig("OptionsService");ig("OscLinkService"),ig("UnicodeService"),ig("DecorationService");var ip={trace:0,debug:1,info:2,warn:3,error:4,off:5},im=class extends R{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ip[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};im=((e,t,i,s)=>{for(var r,n=s>1?void 0:s?g(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&f(t,i,n),n})([(e,t)=>iv(e,t,0)],im);var ix=class extends R{constructor(e){if(D&&16>function(){if(!D)return 0;let e=E.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])}()&&!document.createElement("canvas").getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element)return void this._register(t.onWillOpen(()=>this.activate(e)));this._terminal=e;let i=t.coreService,s=t.optionsService,r=t._renderService,n=t._characterJoinerService,o=t._charSizeService,a=t._coreBrowserService,h=t._decorationService,l=t._logService,c=t._themeService;this._renderer=this._register(new ih(e,n,o,a,i,h,s,c,this._preserveDrawingBuffer)),this._register(eO.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(eO.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(eO.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(eO.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this._register(S(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},iw=e.i(821957),iC=e.i(533499),iL=e.i(446947);e.s(["TaskTerminal",0,function({taskId:e,worktreePath:t,onSessionEnd:i,useCanvasRenderer:s=!1}){let{t:r}=(0,iC.useI18n)(),{resolvedTheme:n}=(0,iw.useTheme)(),o=(0,c.useRef)(null),a=(0,c.useRef)(null),h=(0,c.useRef)(null),_=(0,c.useRef)(null),f=(0,c.useRef)(i);f.current=i;let[g,v]=(0,c.useState)("connecting"),[p,m]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{if(!t||!o.current)return;let i="light"!==n,r=new d.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:13,scrollback:2e3,cursorBlink:!0,allowTransparency:!1,rescaleOverlappingGlyphs:!0,theme:i?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),l=new u.FitAddon;r.loadAddon(l),r.open(o.current);let c=o.current.querySelector(".xterm-helper-textarea");c&&(c.style.opacity="0");let g=null;if(!s)try{(g=new ix).onContextLoss(()=>{g?.dispose(),g=null}),r.loadAddon(g)}catch{}l.fit(),r.focus();let p=null,x=null,w=!1,C=null,L=!1;return(0,iL.getActualWsPort)().then(t=>{w||function t(i){if(w||L)return;v("connecting");let s=new WebSocket(`ws://localhost:${i}/terminal?taskId=${encodeURIComponent(e)}`);p=s,s.addEventListener("open",()=>{s.send(JSON.stringify({type:"resize",cols:r.cols,rows:r.rows})),r.focus(),v("connected"),m(!0),setTimeout(()=>m(!1),2e3)}),s.addEventListener("message",e=>{let t=e.data;"string"==typeof t?r.write(t):t instanceof Blob?t.text().then(e=>r.write(e)):t instanceof ArrayBuffer&&r.write(new Uint8Array(t))}),x?.dispose(),x=r.onData(e=>{s.readyState===WebSocket.OPEN&&s.send(e)}),s.addEventListener("close",e=>{if(e.code>=4e3){L=!0,v("disconnected"),f.current?.(e.code-4e3);return}v("disconnected"),w||L||(C=setTimeout(()=>t(i),3e3))}),s.addEventListener("error",()=>{}),h.current=s}(t)}),a.current=r,_.current=l,()=>{w=!0,C&&clearTimeout(C),x?.dispose(),g?.dispose(),l.dispose(),r.dispose(),p?.close(),a.current=null,h.current=null,_.current=null}},[e,t]),(0,c.useEffect)(()=>{if(!t||!o.current)return;let e=_.current,i=h.current,s=a.current;e&&s&&requestAnimationFrame(()=>{e.fit(),i?.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"resize",cols:s.cols,rows:s.rows}))});let r=null,n=o.current,l=new ResizeObserver(()=>{r&&clearTimeout(r),r=setTimeout(()=>{let e=_.current,t=h.current,i=a.current;e&&i&&(e.fit(),t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"resize",cols:i.cols,rows:i.rows})))},100)});return l.observe(n),()=>{r&&clearTimeout(r),l.disconnect()}},[e,t]),(0,c.useEffect)(()=>{let e=a.current;if(!e)return;let t="light"!==n;e.options.theme=t?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}},[n]),!t)return(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center bg-[#fafafa] dark:bg-[#0a0a0a] text-center",children:[(0,l.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:r("terminal.noWorktree")}),(0,l.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-600 mt-1",children:r("terminal.noWorktreeDesc")})]});let x=r("connected"===g?"terminal.connected":"connecting"===g?"terminal.connecting":"terminal.disconnected");return(0,l.jsxs)("div",{className:"relative h-full w-full bg-[#fafafa] dark:bg-[#0a0a0a]",children:[(0,l.jsxs)("div",{className:["absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded px-2 py-0.5 text-xs transition-opacity duration-500","connected"===g&&!p?"opacity-0 pointer-events-none":"opacity-100","bg-white/60 dark:bg-black/40 backdrop-blur-sm"].join(" "),title:x,children:[(0,l.jsx)("span",{className:`h-2 w-2 rounded-full ${"connected"===g?"bg-green-500":"connecting"===g?"bg-yellow-500":"bg-red-500"}`}),(0,l.jsx)("span",{className:"text-neutral-600 dark:text-neutral-300",children:x})]}),(0,l.jsx)("div",{ref:o,className:"h-full w-full overflow-hidden"})]})}],85890)},346069,e=>{e.n(e.i(85890))}]);
66
+ }`,tu=8*Float32Array.BYTES_PER_ELEMENT,t_=class{constructor(){this.attributes=new Float32Array(160),this.count=0}},tf=0,tg=0,tv=0,tp=0,tm=0,tx=0,tw=0,tC=class extends R{constructor(e,t,i,s){super(),this._terminal=e,this._gl=t,this._dimensions=i,this._themeService=s,this._vertices=new t_,this._verticesCursor=new t_;let r=this._gl;this._program=ee(e7(r,tc,td)),this._register(S(()=>r.deleteProgram(this._program))),this._projectionLocation=ee(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(S(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let a=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(S(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,a,r.STATIC_DRAW),this._attributesBuffer=ee(r.createBuffer()),this._register(S(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,tu,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,tu,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,tu,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,e6),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,i=this._vertices,s=1,r,n,o,a,h,l,c,d,u,_,f;for(r=0;r<t.rows;r++){for(o=-1,a=0,h=0,l=!1,n=0;n<t.cols;n++)c=(r*t.cols+n)*4,d=e.cells[c+1],_=!!(0x4000000&(u=e.cells[c+2])),(d!==a||u!==h&&(l||_))&&((0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,n,r)),o=n,a=d,h=u,l=_);(0!==a||l&&0!==h)&&(f=8*s++,this._updateRectangle(i,f,h,a,o,t.cols,r))}i.count=s}updateCursor(e){let t=this._verticesCursor,i=e.cursor;if(!i||"block"===i.style){t.count=0;return}let s,r=0;("bar"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,"bar"===i.style?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),("underline"===i.style||"outline"===i.style)&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),"outline"===i.style&&(s=8*r++,this._addRectangleFloat(t.attributes,s,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),s=8*r++,this._addRectangleFloat(t.attributes,s,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),t.count=r}_updateRectangle(e,t,i,s,r,n,o){if(0x4000000&i)switch(0x3000000&i){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&i].rgba;break;case 0x3000000:tf=(0xffffff&i)<<8;break;default:tf=this._themeService.colors.foreground.rgba}else switch(0x3000000&s){case 0x1000000:case 0x2000000:tf=this._themeService.colors.ansi[255&s].rgba;break;case 0x3000000:tf=(0xffffff&s)<<8;break;default:tf=this._themeService.colors.background.rgba}e.attributes.length<t+4&&(e.attributes=function(e,t){let i=new Float32Array(Math.min(2*e.length,t));for(let t=0;t<e.length;t++)i[t]=e[t];return i}(e.attributes,this._terminal.rows*this._terminal.cols*8)),tg=r*this._dimensions.device.cell.width,tv=o*this._dimensions.device.cell.height,tp=(tf>>24&255)/255,tm=(tf>>16&255)/255,tx=(tf>>8&255)/255,tw=1,this._addRectangle(e.attributes,t,tg,tv,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,tp,tm,tx,tw)}_addRectangle(e,t,i,s,r,n,o,a,h,l){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=a,e[t+6]=h,e[t+7]=l}_addRectangleFloat(e,t,i,s,r,n,o){e[t]=i/this._dimensions.device.canvas.width,e[t+1]=s/this._dimensions.device.canvas.height,e[t+2]=r/this._dimensions.device.canvas.width,e[t+3]=n/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(255&e.rgba)/255])}},tL=class extends R{constructor(e,t,i,s,r,n,o,a){super(),this._container=t,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=a,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(S(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ee(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,i){}handleSelectionChanged(e,t,i,s=!1){}_setTransparency(e,t){if(t===this._alpha)return;let i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=e1(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,i=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,i,s){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(e,t,i,s){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=ep,this._clipCell(i,s,t.getWidth()),this._ctx.fillText(t.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,i){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,i){let s=t?e.options.fontWeightBold:e.options.fontWeight;return`${i?"italic":""} ${s} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},tb=class extends tL{constructor(e,t,i,s,r,n,o){super(i,e,"link",t,!0,r,n,o),this._register(s.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(s.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){var t;if(257===e.fg?this._ctx.fillStyle=this._themeService.colors.background.css:void 0!==e.fg&&((0x3000000&(t=e.fg))==0x1000000||(0x3000000&t)==0x2000000)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},ty="object"==typeof window?window:globalThis,tM=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new eV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new eV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(i,e),this._onDidChangeZoomLevel.fire(i)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let i=this.getWindowId(t);this.mapWindowIdToFullScreen.set(i,e),this._onDidChangeFullscreen.fire(i)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};tM.INSTANCE=new tM,tM.INSTANCE.onDidChangeZoomLevel,tM.INSTANCE.onDidChangeFullscreen;var tS="object"==typeof navigator?navigator.userAgent:"";tS.indexOf("Firefox"),tS.indexOf("AppleWebKit"),tS.indexOf("Chrome")>=0||tS.indexOf("Safari"),tS.indexOf("Electron/"),tS.indexOf("Android");var tA=!1;if("function"==typeof ty.matchMedia){let e=ty.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=ty.matchMedia("(display-mode: fullscreen)");tA=e.matches,tR=e,"string"==typeof tR&&(tR=ty.matchMedia(tR)),tR.addEventListener("change",({matches:e})=>{tA&&t.matches||(tA=e)})}var tR,tT,tk,tE=!1,tB=!1,tP="en",t$=globalThis;"u">typeof t$.vscode&&"u">typeof t$.vscode.process?tk=t$.vscode.process:"u">typeof _.default&&"string"==typeof _.default?.versions?.node&&(tk=_.default);var tD="string"==typeof tk?.versions?.electron&&tk?.type==="renderer";if("object"==typeof tk){tk.platform,tk.platform,"linux"===tk.platform&&tk.env.SNAP&&tk.env.SNAP_REVISION,tk.env.CI||tk.env.BUILD_ARTIFACTSTAGINGDIRECTORY,tP="en";let e=tk.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,tP=t.resolvedLanguage||"en",t.languagePack?.translationsConfigFile}catch{}tE=!0}else"object"!=typeof navigator||tD?console.error("Unable to resolve platform."):((tT=navigator.userAgent).indexOf("Windows"),tT.indexOf("Macintosh"),(tT.indexOf("Macintosh")>=0||tT.indexOf("iPad")>=0||tT.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,tT.indexOf("Linux"),tT?.indexOf("Mobi"),tB=!0,tP=globalThis._VSCODE_NLS_LANGUAGE||"en",navigator.language.toLowerCase());var tF=tE;tB&&"function"==typeof t$.importScripts&&t$.origin;var tW,tI=tT,tO=tP;(tY=tW||={}).value=function(){return tO},tY.isDefaultVariant=function(){return 2===tO.length?"en"===tO:tO.length>=3&&"e"===tO[0]&&"n"===tO[1]&&"-"===tO[2]},tY.isDefault=function(){return"en"===tO};var tz="function"==typeof t$.postMessage&&!t$.importScripts,tU=(()=>{if(tz){let e=[];t$.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let s=e[i];if(s.id===t.data.vscodeScheduleAsyncWork){e.splice(i,1),s.callback();return}}});let t=0;return i=>{let s=++t;e.push({id:s,callback:i}),t$.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})(),tN=!!(tI&&tI.indexOf("Chrome")>=0);tI&&tI.indexOf("Firefox"),!tN&&tI&&tI.indexOf("Safari"),tI&&tI.indexOf("Edg/"),tI&&tI.indexOf("Android");var tq="object"==typeof navigator?navigator:{};tF||document.queryCommandSupported&&document.queryCommandSupported("copy")||tq&&tq.clipboard&&tq.clipboard.writeText,tF||tq&&tq.clipboard&&tq.clipboard.readText,tF||tA||tq.keyboard,"ontouchstart"in ty||tq.maxTouchPoints,ty.PointerEvent&&("ontouchstart"in ty||navigator.maxTouchPoints);var tG=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},tH=new tG,tj=new tG,tV=new tG;(tX=tZ||={}).toString=function(e){return tH.keyCodeToStr(e)},tX.fromString=function(e){return tH.strToKeyCode(e)},tX.toUserSettingsUS=function(e){return tj.keyCodeToStr(e)},tX.toUserSettingsGeneral=function(e){return tV.keyCodeToStr(e)},tX.fromUserSettings=function(e){return tj.strToKeyCode(e)||tV.strToKeyCode(e)},tX.toElectronAccelerator=function(e){if(e>=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return tH.keyCodeToStr(e)};var tY,tX,tZ,tQ,tK=Object.freeze(function(e,t){let i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}});(o=tQ||={}).isCancellationToken=function(e){return e===o.None||e===o.Cancelled||e instanceof tJ||!!e&&"object"==typeof e&&"boolean"==typeof e.isCancellationRequested&&"function"==typeof e.onCancellationRequested},o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:eO.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:tK});var tJ=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?tK:(this._emitter||(this._emitter=new eV),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}};Symbol("MicrotaskDelay"),(a=h||={}).settled=async function(e){let t,i=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||(t=e)})));if("u">typeof t)throw t;return i},a.withAsyncBody=function(e){return new Promise(async(t,i)=>{try{await e(t,i)}catch(e){i(e)}})};var t0=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let i of t)e.emitOne(i)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new eV,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{for(;;){if(2===this._state)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(1===this._state)return{done:!0,value:void 0};await eO.toPromise(this._onStateChanged.event)}},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new e(async e=>{for await(let s of t)e.emitOne(i(s))})}map(t){return e.map(this,t)}static filter(t,i){return new e(async e=>{for await(let s of t)i(s)&&e.emitOne(s)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let i of e)t.push(i);return t}toPromise(){return e.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}};t0.EMPTY=t0.fromArray([]);function t5(e,t){return(t<<5)-t+e|0}function t1(e,t){t=t5(149417,t);for(let i=0,s=e.length;i<s;i++)t=t5(e.charCodeAt(i),t);return t}new DataView(new ArrayBuffer(320));var{registerWindow:t2,getWindow:t3,getDocument:t4,getWindows:t8,getWindowsCount:t6,getWindowId:t7,getWindowById:t9,hasWindow:ie,onDidRegisterWindow:it,onWillUnregisterWindow:ii,onDidUnregisterWindow:is}=(t=new Map,i={window:ty,disposables:new A},t.set(ty.vscodeWindowId,i),s=new eV,r=new eV,n=new eV,{onDidRegisterWindow:s.event,onWillUnregisterWindow:n.event,onDidUnregisterWindow:r.event,registerWindow(e){var i,o;if(t.has(e.vscodeWindowId))return R.None;let a=new A,h={window:e,disposables:a.add(new A)};return t.set(e.vscodeWindowId,h),a.add(S(()=>{t.delete(e.vscodeWindowId),r.fire(e)})),a.add((i=e,o=ia.BEFORE_UNLOAD,new ir(i,o,()=>{n.fire(e)},void 0))),s.fire(h),a},getWindows:()=>t.values(),getWindowsCount:()=>t.size,getWindowId:e=>e.vscodeWindowId,hasWindow:e=>t.has(e),getWindowById:function(e,s){return("number"==typeof e?t.get(e):void 0)??(s?i:void 0)},getWindow:e=>e?.ownerDocument?.defaultView?e.ownerDocument.defaultView.window:e?.view?e.view.window:ty,getDocument:e=>t3(e).document}),ir=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}},io=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,i=this.height){return t!==this.width||i!==this.height?new e(t,i):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t||!!e&&!!t&&e.width===t.width&&e.height===t.height}};io.None=new io(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,i){let s=this.mutationObservers.get(e);s||(s=new Map,this.mutationObservers.set(e,s));let r=function e(t,i){switch(typeof t){case"object":var s,r,n,o;return null===t?t5(349,i):Array.isArray(t)?(s=t,r=t5(104579,r=i),s.reduce((t,i)=>e(i,t),r)):(n=t,o=t5(181387,o=i),Object.keys(n).sort().reduce((t,i)=>(t=t1(i,t),e(n[i],t)),o));case"string":return t1(t,i);case"boolean":return t5(t?433:863,i);case"number":return t5(t,i);case"undefined":return t5(937,i);default:return t5(617,i)}}(i,0),n=s.get(r);if(n)n.users+=1;else{let o=new eV,a=new MutationObserver(e=>o.fire(e));a.observe(e,i);let h=n={users:1,observer:a,onDidMutate:o.event};t.add(S(()=>{h.users-=1,0===h.users&&(o.dispose(),a.disconnect(),s?.delete(r),s?.size===0&&this.mutationObservers.delete(e))})),s.set(r,n)}return n.onDidMutate}};var ia={BEFORE_UNLOAD:"beforeunload"},ih=class extends R{constructor(e,t,i,s,r,n,o,a,h){if(super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=a,this._cursorBlinkStateManager=new T,this._charAtlasDisposable=this._register(new T),this._observerDisposable=this._register(new T),this._model=new tl,this._workCell=new e8,this._workCell2=new e8,this._rectangleRenderer=this._register(new T),this._glyphRenderer=this._register(new T),this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new eV),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._gl=this._canvas.getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:h}),!this._gl)throw Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new ev(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new tb(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions={css:{canvas:es(),cell:es()},device:{canvas:es(),cell:es(),char:{width:0,height:0,left:0,top:0}}},this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextlost",e=>{console.log("webglcontextlost event received"),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(e)},3e3)})),this._register(function(e,t,i){return new ir(e,t,i,void 0)}(this._canvas,"webglcontextrestored",e=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,e2(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=e4(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=e4(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(S(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),e2(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){for(let e of(this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows),this._renderLayers))e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,e,t,i);this._model.selection.update(this._core,e,t,i),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new tC(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new ta(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=e1(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=M(eO.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),eO.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){for(let e of(this._clearModel(!0),this._renderLayers))e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(!this._core.screenElement?.isConnected||!this._charSizeService.width||!this._charSizeService.height)return;else this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,e,t);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new e3(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let i=this._core,s=this._workCell,r,n,o,a,h,l,c=0,d=!0,u,_,f,g,v,p,m,x,w;e=ic(e,i.rows-1,0),t=ic(t,i.rows-1,0);let C=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,b=L-i.buffer.ydisp,y=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),M=-1,S=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let A=!1;for(n=e;n<=t;n++)for(o=n+i.buffer.ydisp,a=i.buffer.lines.get(o),this._model.lineLengths[n]=0,f=L===o,c=0,h=this._characterJoinerService.getJoinedCharacters(o),x=0;x<i.cols;x++){if(r=this._cellColorResolver.result.bg,a.loadCell(x,s),0===x&&(r=this._cellColorResolver.result.bg),l=!1,d=x>=c,u=x,h.length>0&&x===h[0][0]&&d){_=h.shift();let e=this._model.selection.isCellSelected(this._terminal,_[0],o);for(m=_[0]+1;m<_[1];m++)d&&=e===this._model.selection.isCellSelected(this._terminal,m,o);(d&&=!f||y<_[0]||y>=_[1])?(l=!0,s=new il(s,a.translateToString(!0,_[0],_[1]),_[1]-_[0]),u=_[1]-1):c=_[1]}if(g=s.getChars(),v=s.getCode(),m=(n*i.cols+x)*4,this._cellColorResolver.resolve(s,x,o,this.dimensions.device.cell.width),S&&o===L&&(x===y&&(this._model.cursor={x:y,y:b,width:s.getWidth(),style:this._coreBrowserService.isFocused?C:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},M=y+s.getWidth()-1),x>=y&&x<=M&&(this._coreBrowserService.isFocused&&"block"===C||!1===this._coreBrowserService.isFocused&&"block"===i.options.cursorInactiveStyle)&&(this._cellColorResolver.result.fg=0x3000000|this._themeService.colors.cursorAccent.rgba>>8&0xffffff,this._cellColorResolver.result.bg=0x3000000|this._themeService.colors.cursor.rgba>>8&0xffffff)),0!==v&&(this._model.lineLengths[n]=x+1),(this._model.cells[m]!==v||this._model.cells[m+1]!==this._cellColorResolver.result.bg||this._model.cells[m+2]!==this._cellColorResolver.result.fg||this._model.cells[m+3]!==this._cellColorResolver.result.ext)&&(A=!0,g.length>1&&(v|=0x80000000),this._model.cells[m]=v,this._model.cells[m+1]=this._cellColorResolver.result.bg,this._model.cells[m+2]=this._cellColorResolver.result.fg,this._model.cells[m+3]=this._cellColorResolver.result.ext,p=s.getWidth(),this._glyphRenderer.value.updateCell(x,n,v,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,g,p,r),l)){for(s=this._workCell,x++;x<=u;x++)w=(n*i.cols+x)*4,this._glyphRenderer.value.updateCell(x,n,0,0,0,0,"",0,0),this._model.cells[w]=0,this._model.cells[w+1]=this._cellColorResolver.result.bg,this._model.cells[w+2]=this._cellColorResolver.result.fg,this._model.cells[w+3]=this._cellColorResolver.result.ext;x--}}A&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=1===this._optionsService.rawOptions.lineHeight?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},il=class extends eB{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function ic(e,t,i=0){return Math.max(Math.min(e,t),i)}var id="di$target",iu="di$dependencies",i_=new Map;function ig(e){if(i_.has(e))return i_.get(e);let t=function(e,i,s){var r,n,o;if(3!=arguments.length)throw Error("@IServiceName-decorator can only be used to decorate a parameter");r=t,n=e,o=s,n[id]===n?n[iu].push({id:r,index:o}):(n[iu]=[{id:r,index:o}],n[id]=n)};return t._id=e,i_.set(e,t),t}ig("BufferService"),ig("CoreMouseService"),ig("CoreService"),ig("CharsetService"),ig("InstantiationService"),ig("LogService");var iv=ig("OptionsService");ig("OscLinkService"),ig("UnicodeService"),ig("DecorationService");var ip={trace:0,debug:1,info:2,warn:3,error:4,off:5},im=class extends R{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=ip[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())}_log(e,t,i){this._evalLazyOptionalParams(i),e.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+t,...i)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};im=((e,t,i,s)=>{for(var r,n=s>1?void 0:s?g(t,i):t,o=e.length-1;o>=0;o--)(r=e[o])&&(n=(s?r(t,i,n):r(n))||n);return s&&n&&f(t,i,n),n})([(e,t)=>iv(e,t,0)],im);var ix=class extends R{constructor(e){if(D&&16>function(){if(!D)return 0;let e=E.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])}()&&!document.createElement("canvas").getContext("webgl2",{antialias:!1,depth:!1,preserveDrawingBuffer:!0}))throw Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new eV),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new eV),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new eV),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new eV),this.onContextLoss=this._onContextLoss.event}activate(e){let t=e._core;if(!e.element)return void this._register(t.onWillOpen(()=>this.activate(e)));this._terminal=e;let i=t.coreService,s=t.optionsService,r=t._renderService,n=t._characterJoinerService,o=t._charSizeService,a=t._coreBrowserService,h=t._decorationService,l=t._logService,c=t._themeService;this._renderer=this._register(new ih(e,n,o,a,i,h,s,c,this._preserveDrawingBuffer)),this._register(eO.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(eO.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(eO.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(eO.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this._register(S(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},iw=e.i(821957),iC=e.i(533499),iL=e.i(113217);e.s(["TaskTerminal",0,function({taskId:e,worktreePath:t,onSessionEnd:i,useCanvasRenderer:s=!1}){let{t:r}=(0,iC.useI18n)(),{resolvedTheme:n}=(0,iw.useTheme)(),o=(0,c.useRef)(null),a=(0,c.useRef)(null),h=(0,c.useRef)(null),_=(0,c.useRef)(null),f=(0,c.useRef)(i);f.current=i;let[g,v]=(0,c.useState)("connecting"),[p,m]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{if(!t||!o.current)return;let i="light"!==n,r=new d.Terminal({fontFamily:"Menlo, Monaco, 'Courier New', monospace",fontSize:13,scrollback:2e3,cursorBlink:!0,allowTransparency:!1,rescaleOverlappingGlyphs:!0,theme:i?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}}),l=new u.FitAddon;r.loadAddon(l),r.open(o.current);let c=o.current.querySelector(".xterm-helper-textarea");c&&(c.style.opacity="0");let g=null;if(!s)try{(g=new ix).onContextLoss(()=>{g?.dispose(),g=null}),r.loadAddon(g)}catch{}l.fit(),r.focus();let p=null,x=null,w=!1,C=null,L=!1;return(0,iL.getActualWsPort)().then(t=>{w||function t(i){if(w||L)return;v("connecting");let s=new WebSocket(`ws://localhost:${i}/terminal?taskId=${encodeURIComponent(e)}`);p=s,s.addEventListener("open",()=>{s.send(JSON.stringify({type:"resize",cols:r.cols,rows:r.rows})),r.focus(),v("connected"),m(!0),setTimeout(()=>m(!1),2e3)}),s.addEventListener("message",e=>{let t=e.data;"string"==typeof t?r.write(t):t instanceof Blob?t.text().then(e=>r.write(e)):t instanceof ArrayBuffer&&r.write(new Uint8Array(t))}),x?.dispose(),x=r.onData(e=>{s.readyState===WebSocket.OPEN&&s.send(e)}),s.addEventListener("close",e=>{if(e.code>=4e3){L=!0,v("disconnected"),f.current?.(e.code-4e3);return}v("disconnected"),w||L||(C=setTimeout(()=>t(i),3e3))}),s.addEventListener("error",()=>{}),h.current=s}(t)}),a.current=r,_.current=l,()=>{w=!0,C&&clearTimeout(C),x?.dispose(),g?.dispose(),l.dispose(),r.dispose(),p?.close(),a.current=null,h.current=null,_.current=null}},[e,t]),(0,c.useEffect)(()=>{if(!t||!o.current)return;let e=_.current,i=h.current,s=a.current;e&&s&&requestAnimationFrame(()=>{e.fit(),i?.readyState===WebSocket.OPEN&&i.send(JSON.stringify({type:"resize",cols:s.cols,rows:s.rows}))});let r=null,n=o.current,l=new ResizeObserver(()=>{r&&clearTimeout(r),r=setTimeout(()=>{let e=_.current,t=h.current,i=a.current;e&&i&&(e.fit(),t?.readyState===WebSocket.OPEN&&t.send(JSON.stringify({type:"resize",cols:i.cols,rows:i.rows})))},100)});return l.observe(n),()=>{r&&clearTimeout(r),l.disconnect()}},[e,t]),(0,c.useEffect)(()=>{let e=a.current;if(!e)return;let t="light"!==n;e.options.theme=t?{background:"#0a0a0a",foreground:"#e5e5e5"}:{background:"#fafafa",foreground:"#171717"}},[n]),!t)return(0,l.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-center bg-[#fafafa] dark:bg-[#0a0a0a] text-center",children:[(0,l.jsx)("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:r("terminal.noWorktree")}),(0,l.jsx)("p",{className:"text-xs text-neutral-400 dark:text-neutral-600 mt-1",children:r("terminal.noWorktreeDesc")})]});let x=r("connected"===g?"terminal.connected":"connecting"===g?"terminal.connecting":"terminal.disconnected");return(0,l.jsxs)("div",{className:"relative h-full w-full bg-[#fafafa] dark:bg-[#0a0a0a]",children:[(0,l.jsxs)("div",{className:["absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded px-2 py-0.5 text-xs transition-opacity duration-500","connected"===g&&!p?"opacity-0 pointer-events-none":"opacity-100","bg-white/60 dark:bg-black/40 backdrop-blur-sm"].join(" "),title:x,children:[(0,l.jsx)("span",{className:`h-2 w-2 rounded-full ${"connected"===g?"bg-green-500":"connecting"===g?"bg-yellow-500":"bg-red-500"}`}),(0,l.jsx)("span",{className:"text-neutral-600 dark:text-neutral-300",children:x})]}),(0,l.jsx)("div",{ref:o,className:"h-full w-full overflow-hidden"})]})}],85890)},346069,e=>{e.n(e.i(85890))}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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)},110204,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["Label",0,function({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.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),...a})}])},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let r=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],181209)},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},487486,e=>{"use strict";var t=e.i(565455),r=e.i(581263),a=e.i(294237),i=e.i(975157);let s=(0,a.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:a="default",render:n,...d}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(s({variant:a}),e)},d),render:n,state:{slot:"badge",variant:a}},(0,r.useRenderElement)(l.defaultTagName??"div",l,l)}],487486)},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},884409,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("403d34b6c07f1211d62ffcf8957d4e12c5cd30d6cb",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,r])},645703,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("407392ec926020c29f780329b99fbe7f2e09384a4d",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},991838,e=>{"use strict";var t=e.i(965652),r=e.i(770303);e.s(["useExtension",0,function(e){let a=(0,t.useContext)(r.ExtensionContext);if(!a)throw Error("useExtension must be used inside <ExtensionProvider>");return{status:a.statusMap[e],loading:a.loading,isInstalling:a.installing.has(e),install:()=>a.install(e),uninstall:()=>a.uninstall(e),refresh:()=>a.refresh(e)}}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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)},110204,e=>{"use strict";var t=e.i(289721),r=e.i(975157);e.s(["Label",0,function({className:e,...a}){return(0,t.jsx)("label",{"data-slot":"label",className:(0,r.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),...a})}])},301348,181209,e=>{"use strict";var t=e.i(59737);e.s(["CheckCircle2",()=>t.default],301348);let r=(0,e.i(572989).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["XCircle",0,r],181209)},475958,e=>{"use strict";let t=(0,e.i(572989).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",0,t],475958)},487486,e=>{"use strict";var t=e.i(565455),r=e.i(581263),a=e.i(294237),i=e.i(975157);let s=(0,a.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:a="default",render:n,...d}){var l;return l={defaultTagName:"span",props:(0,t.mergeProps)({className:(0,i.cn)(s({variant:a}),e)},d),render:n,state:{slot:"badge",variant:a}},(0,r.useRenderElement)(l.defaultTagName??"div",l,l)}],487486)},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},776344,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40ee3f0c57e06e44cef70d40dc98cfe8de7c0041ea",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,r])},866787,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("4026976d005c8694a756631171364c4e4375b086da",t.callServer,void 0,t.findSourceMapURL,"getPrompts");e.s(["getPrompts",0,r])},759686,e=>{"use strict";var t=e.i(567098);e.s(["AlertTriangle",()=>t.default])},991838,e=>{"use strict";var t=e.i(965652),r=e.i(770303);e.s(["useExtension",0,function(e){let a=(0,t.useContext)(r.ExtensionContext);if(!a)throw Error("useExtension must be used inside <ExtensionProvider>");return{status:a.statusMap[e],loading:a.loading,isInstalling:a.installing.has(e),install:()=>a.install(e),uninstall:()=>a.uninstall(e),refresh:()=>a.refresh(e)}}])}]);