tower-studio 0.2.23 → 0.2.25

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 (197) 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 +29 -29
  13. package/.next/standalone/.next/server/app/_not-found/page.js +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  15. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/api/browse-fs/route.js +1 -1
  17. package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
  19. package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
  20. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +1 -1
  21. package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
  22. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +1 -1
  23. package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
  24. package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
  25. package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +69 -69
  26. package/.next/standalone/.next/server/app/missions/page.js +1 -1
  27. package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
  28. package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
  29. package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
  30. package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +29 -29
  31. package/.next/standalone/.next/server/app/onboarding/page.js +1 -1
  32. package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
  34. package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
  35. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +29 -29
  36. package/.next/standalone/.next/server/app/page.js +1 -1
  37. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  38. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  39. package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
  40. package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +47 -47
  41. package/.next/standalone/.next/server/app/settings/page.js +1 -1
  42. package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
  43. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  44. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
  45. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +86 -86
  46. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +1 -1
  47. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
  49. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
  50. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +78 -78
  51. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +1 -1
  52. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
  54. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
  55. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +65 -65
  56. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +1 -1
  57. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
  58. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
  59. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
  60. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +63 -63
  61. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +1 -1
  62. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
  64. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
  65. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +29 -29
  66. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +1 -1
  67. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
  68. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
  70. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +68 -68
  71. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +1 -1
  72. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
  74. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
  75. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +80 -80
  76. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +1 -1
  77. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
  78. package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
  79. package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
  80. package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +47 -47
  81. package/.next/standalone/.next/server/app/workspaces/page.js +1 -1
  82. package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
  84. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +1 -1
  85. package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +1 -1
  86. package/.next/standalone/.next/server/chunks/[externals]__12mj_bs._.js +3 -0
  87. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +2 -2
  88. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +1 -1
  89. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +1 -1
  90. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_6swdz._.js → [root-of-the-server]__0g788b3._.js} +3 -3
  91. package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0-0gs-6._.js → [root-of-the-server]__0j-4yc7._.js} +2 -2
  92. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3iihg._.js +1 -1
  93. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0v5.ht~._.js +3 -0
  94. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
  95. package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
  96. package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
  97. package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
  98. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02-6df-._.js +3 -3
  99. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__03e009u._.js +3 -3
  100. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12p2zz2._.js → [root-of-the-server]__084p3.0._.js} +1 -1
  101. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e_-mj-._.js +3 -3
  102. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fzkdjl._.js +3 -3
  103. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ty1ao1._.js → [root-of-the-server]__0f~m-8x._.js} +2 -2
  104. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0jti4~k._.js → [root-of-the-server]__0i7es1w._.js} +2 -2
  105. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
  106. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pu-v0l._.js +3 -3
  107. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0-o.l41._.js → [root-of-the-server]__0qkus8m._.js} +2 -2
  108. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0um1ugs._.js +3 -3
  109. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0s-a4ku._.js → [root-of-the-server]__0ygiyqr._.js} +2 -2
  110. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
  111. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_xv.._.js +1 -1
  112. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vgkq5._.js +3 -3
  113. package/.next/standalone/.next/server/chunks/ssr/{_0m.4akk._.js → _02acmsq._.js} +2 -2
  114. package/.next/standalone/.next/server/chunks/ssr/_03osyxp._.js +3 -0
  115. package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
  116. package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
  117. package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
  118. package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
  119. package/.next/standalone/.next/server/chunks/ssr/_0ecgaqt._.js +7 -0
  120. package/.next/standalone/.next/server/chunks/ssr/{_0-9.ea2._.js → _0eete9d._.js} +2 -2
  121. package/.next/standalone/.next/server/chunks/ssr/{_0hzckhd._.js → _0gk20rx._.js} +2 -2
  122. package/.next/standalone/.next/server/chunks/ssr/_0jeo~zr._.js +4 -0
  123. package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
  124. package/.next/standalone/.next/server/chunks/ssr/_0kynu6x._.js +7 -0
  125. package/.next/standalone/.next/server/chunks/ssr/{_04y89b3._.js → _0r1pb6u._.js} +2 -2
  126. package/.next/standalone/.next/server/chunks/ssr/_0r6gweb._.js +3 -3
  127. package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
  128. package/.next/standalone/.next/server/chunks/ssr/{_0bk06da._.js → _0rny90z._.js} +2 -2
  129. package/.next/standalone/.next/server/chunks/ssr/{_012.igw._.js → _0rr~oe~._.js} +2 -2
  130. package/.next/standalone/.next/server/chunks/ssr/_0rt8jf_._.js +3 -3
  131. package/.next/standalone/.next/server/chunks/ssr/_0ueyys5._.js +1 -1
  132. package/.next/standalone/.next/server/chunks/ssr/_0uuzh5m._.js +3 -3
  133. package/.next/standalone/.next/server/chunks/ssr/{_0~v4z8z._.js → _0vx81le._.js} +2 -2
  134. package/.next/standalone/.next/server/chunks/ssr/{_10-.n35._.js → _0yvg9ie._.js} +2 -2
  135. package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
  136. package/.next/standalone/.next/server/chunks/ssr/_11cv4uu._.js +7 -0
  137. package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
  138. package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
  139. package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
  140. package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
  141. package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
  142. package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
  143. package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
  144. package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
  145. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
  146. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
  147. package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
  148. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  149. package/.next/standalone/.next/server/pages/500.html +1 -1
  150. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  151. package/.next/standalone/.next/server/server-reference-manifest.json +286 -286
  152. package/.next/standalone/.next/static/chunks/{0.qj9vorfgtnt.js → 00fcxpwt-xz7b.js} +1 -1
  153. package/.next/standalone/.next/static/chunks/{0p9zhbwmnn0j4.js → 02.0.zsh_o-10.js} +1 -1
  154. package/.next/standalone/.next/static/chunks/05dryiv53wj6h.js +5 -0
  155. package/.next/standalone/.next/static/chunks/{1007_ur3fj.~m.js → 08ln6v6_fd4nf.js} +1 -1
  156. package/.next/standalone/.next/static/chunks/099fxtzvpw3be.js +1 -0
  157. package/.next/standalone/.next/static/chunks/{0c~0amyhws3l0.js → 0ce8gr~q3rs9k.js} +1 -1
  158. package/.next/standalone/.next/static/chunks/{0zfszxiw4cx9b.js → 0iyxegei1fjbp.js} +1 -1
  159. package/.next/standalone/.next/static/chunks/{17n~0msyl8bur.js → 0izvibcnunqx4.js} +1 -1
  160. package/.next/standalone/.next/static/chunks/{04axhlp_leiii.js → 0jmk1_g~_yd7-.js} +1 -1
  161. package/.next/standalone/.next/static/chunks/{0rec91xfsdv8r.js → 0mi29_2~1sr...js} +1 -1
  162. package/.next/standalone/.next/static/chunks/{0ztty8z0obk5f.js → 0n.isvqurxe72.js} +1 -1
  163. package/.next/standalone/.next/static/chunks/{120x-nmim1wfz.js → 0nl7~2pju.abl.js} +1 -1
  164. package/.next/standalone/.next/static/chunks/{12iivlft6u_tt.js → 0oopksfzoc0_k.js} +1 -1
  165. package/.next/standalone/.next/static/chunks/0p5wczoq4gvin.js +1 -0
  166. package/.next/standalone/.next/static/chunks/0pov66bj_qi58.js +1 -0
  167. package/.next/standalone/.next/static/chunks/{16r-tz37aqyoa.js → 0s2umk4hfyhqa.js} +1 -1
  168. package/.next/standalone/.next/static/chunks/0ur66aluu.t0b.js +1 -0
  169. package/.next/standalone/.next/static/chunks/0w7cz_z6p3-p_.js +1 -0
  170. package/.next/standalone/.next/static/chunks/{0so-w5.m3jaxi.js → 0wa8r89hd0y0b.js} +1 -1
  171. package/.next/standalone/.next/static/chunks/{0ik7-_3wrtspq.js → 0yjkfr0qay7z6.js} +1 -1
  172. package/.next/standalone/.next/static/chunks/{05a6uzgclxdsk.js → 131msw-pgcsxt.js} +2 -2
  173. package/.next/standalone/.next/static/chunks/{099eecj285cbx.js → 13upq83z~yuys.js} +1 -1
  174. package/.next/standalone/.next/static/chunks/{0-.9k92iyul5o.js → 141wmbqfx~lo8.js} +2 -2
  175. package/.next/standalone/.next/static/chunks/157pgx~-2_qo5.js +5 -0
  176. package/.next/standalone/.next/static/chunks/15_.l.-~mxr1v.js +1 -0
  177. package/.next/standalone/.next/static/chunks/{10r4y1zzk24jy.js → 16ndme6.~2w1x.js} +2 -2
  178. package/.next/standalone/package.json +1 -1
  179. package/package.json +1 -1
  180. package/.next/standalone/.next/server/chunks/[externals]__0m5smhl._.js +0 -3
  181. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sy6lau._.js +0 -3
  182. package/.next/standalone/.next/server/chunks/ssr/_0385-.g._.js +0 -4
  183. package/.next/standalone/.next/server/chunks/ssr/_04yogxq._.js +0 -7
  184. package/.next/standalone/.next/server/chunks/ssr/_0cc0gt8._.js +0 -7
  185. package/.next/standalone/.next/server/chunks/ssr/_0oq26rv._.js +0 -3
  186. package/.next/standalone/.next/server/chunks/ssr/_0z-b00b._.js +0 -7
  187. package/.next/standalone/.next/static/chunks/00-6_m40h14vl.js +0 -1
  188. package/.next/standalone/.next/static/chunks/02.ihz-~spbi-.js +0 -1
  189. package/.next/standalone/.next/static/chunks/0e8r37m0q.z0p.js +0 -1
  190. package/.next/standalone/.next/static/chunks/0ima0i0p489ty.js +0 -1
  191. package/.next/standalone/.next/static/chunks/0x3tiuoe.l18z.js +0 -1
  192. package/.next/standalone/.next/static/chunks/10vl5vq1_rh1..js +0 -1
  193. package/.next/standalone/.next/static/chunks/134onqxk2foh5.js +0 -5
  194. package/.next/standalone/.next/static/chunks/16ukg_cswejw4.js +0 -5
  195. /package/.next/standalone/.next/static/{l8InE32VLIGdUBVP3BJKt → biyHBSA-7nbhZk25VrdWY}/_buildManifest.js +0 -0
  196. /package/.next/standalone/.next/static/{l8InE32VLIGdUBVP3BJKt → biyHBSA-7nbhZk25VrdWY}/_clientMiddlewareManifest.js +0 -0
  197. /package/.next/standalone/.next/static/{l8InE32VLIGdUBVP3BJKt → biyHBSA-7nbhZk25VrdWY}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14842,865514,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),a=e.i(232280),n=e.i(759686),i=e.i(960518),l=e.i(340873),o=e.i(400355),c=e.i(519455),d=e.i(912505),h=e.i(487486),m=e.i(776639),u=e.i(624687),x=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:a}=(0,x.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:a("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:a("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:a("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,x.useI18n)(),r=e.split("\n"),a=r.length>500,n=a?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:n.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),a&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:o,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,x.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[M,D]=(0,s.useState)(!1),[L,A]=(0,s.useState)(""),[F,B]=(0,s.useState)(!1),T=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[o.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>D(!0),className:"gap-2",children:[(0,t.jsx)(l.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===o.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:o.map(e=>{let s=v.has(e.filename),n=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&T(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(h.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:n,isLargeFold:!n&&i>200,onLoad:()=>T(e.filename)})})]},e.filename)})})}),(0,t.jsx)(m.Dialog,{open:M,onOpenChange:D,children:(0,t.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsx)(m.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(u.Textarea,{value:L,onChange:e=>A(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>D(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(L.trim()&&w){B(!0);try{await w(L.trim()),A(""),D(!1)}finally{B(!1)}}},disabled:!L.trim()||F,children:F?"...":y("diff.commit")})]})]})})]})}],14842);var g=e.i(538059);let j=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:r,taskId:a,taskTitle:n,baseBranch:i,fileCount:l,commitCount:d,commitLog:h=[],onMergeComplete:u}){let x=(0,g.useRouter)(),[f,p]=(0,s.useState)(!1),[b,w]=(0,s.useState)(null),N=async()=>{p(!0),w(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){r(!1),u(),x.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?w(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):w(t.error??"Merge failed")}catch{w("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(m.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(j,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:i})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),h.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:h.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>r(!1),disabled:f,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:N,disabled:f,className:"gap-2",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},244354,e=>{"use strict";async function t(e,s,r={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!a.ok)throw Error((await a.json()).error||`${s} failed`);return a.json()}e.s(["gitAction",0,t])},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let a=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,a],755696);let n=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,n],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let l=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,l],719493);let o=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,o],436539)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),a=e.i(48019),n=e.i(782516),i=e.i(755696),l=e.i(886156),o=e.i(400355),c=e.i(586564),d=e.i(719493),h=e.i(597746),m=e.i(368490),u=e.i(232280),x=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),M=e.i(755146),D=e.i(759684),L=e.i(746798),A=e.i(776639),F=e.i(793479),B=e.i(624687),T=e.i(533499);function E({open:e,onOpenChange:r,branches:a,currentBranch:n,localPath:i,onCreated:l,onError:c}){let{t:d}=(0,T.useI18n)(),[m,x]=(0,s.useState)(""),[f,p]=(0,s.useState)(n),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,M]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(x(""),p(n),j(""),k(""))},[e,n]);let D=[...new Set(a)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),L=async()=>{if(m.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:m.trim(),baseBranch:f})});if(e.ok)r(!1),l();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(A.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(A.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(A.DialogHeader,{children:(0,t.jsx)(A.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(F.Input,{value:m,onChange:e=>x(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&L()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>M(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:D.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),M(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(B.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(A.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:L,disabled:!m.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var I=e.i(360112),$=e.i(244354);let R={modified:l.FileEdit,added:a.FilePlus,deleted:n.FileMinus,untracked:i.FileQuestion,renamed:l.FileEdit},z={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},P={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function U(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/").filter(Boolean);if(0===e.length)continue;let r=t;for(let t=0;t<e.length;t++){let a=e[t],n=t===e.length-1,i=e.slice(0,t+1).join("/");if(n)r.children.push({name:a,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function G({scroll:e,children:s}){return e?(0,t.jsx)(D.ScrollArea,{className:"flex-1 min-h-0",children:s}):(0,t.jsx)("div",{children:s})}function O({label:e,count:r,labelColor:a,tree:n,batchAction:i,batchLabel:l,batchIcon:o,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${a}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:n.map(e=>(0,t.jsx)(H,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function H({node:e,depth:a,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${a} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(x.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(H,{node:e,depth:a+1,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h},e.path))]});let j=e.file,b=R[j.status]||r.File,w=z[j.status]||"text-muted-foreground",N=P[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>n(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":h??"",children:d}),h&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:h})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":o??"",children:l}),o&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:o})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:a="project"}){let n="task"===a,{t:i}=(0,T.useI18n)(),[l,m]=(0,s.useState)(null),[x,D]=(0,s.useState)(!0),[A,F]=(0,s.useState)(""),[B,R]=(0,s.useState)(!1),[z,P]=(0,s.useState)(!1),[H,W]=(0,s.useState)(!1),[V,K]=(0,s.useState)(!1),[q,J]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(""),Y=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(q)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){Y.current&&!Y.current.contains(e.target)&&J(!1)}},[q]);let[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();m({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{D(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,$.gitAction)(e,"stage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,$.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(A.trim()){R(!0);try{await (0,$.gitAction)(e,"commit",{message:A}),F(""),I.toast.success(i("git.commitSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{R(!1)}}},ea=async t=>{P(!0);try{await (0,$.gitAction)(e,"pull",t?{branch:t}:{}),I.toast.success(i("git.pullSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{P(!1)}},en=async t=>{W(!0);try{await (0,$.gitAction)(e,"push",t?{branch:t}:{}),I.toast.success(i("git.pushSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{W(!1)}},ei=async()=>{K(!0);try{await (0,$.gitAction)(e,"fetch"),I.toast.success(i("git.fetchSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{K(!1)}},el=async t=>{try{await (0,$.gitAction)(e,"checkout",{branch:t}),J(!1),I.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eo=async()=>{try{await (0,$.gitAction)(e,"stash-save",{message:A||void 0}),F(""),I.toast.success(i("git.stashSaved")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,$.gitAction)(e,"stash-pop",{index:0}),I.toast.success(i("git.stashApplied")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,$.gitAction)(e,"discard-file",{file:t}),I.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eh=async()=>{try{await (0,$.gitAction)(e,"discard-all"),I.toast.success(i("git.discardSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},em=async t=>{if("deleted"===t.status)return;let s=l?.topLevel??e;try{let a=await (0,$.gitAction)(e,"show",{file:t.file});r?.(t.file,a.content??"",s)}catch{r?.(t.file,"",s)}},eu=l?.changedFiles.filter(e=>e.staged)??[],ex=l?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>U(eu),[eu]),ep=(0,s.useMemo)(()=>U(ex),[ex]);if(x)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!l)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...l?.branches??[],...(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e))],eb=Q?ej.filter(e=>e.toLowerCase().includes(Q.toLowerCase())):ej;return(0,t.jsxs)("div",{className:n?"flex flex-col h-full overflow-hidden":"flex flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[n?(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:l?.currentBranch||"—"})]})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:l?.currentBranch||"—"})]}):(0,t.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Y,children:[(0,t.jsxs)("button",{onClick:()=>{J(!q),X("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l?.currentBranch||void 0,children:l?.currentBranch||"—"})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${q?"rotate-180":""}`})]}),q&&(0,t.jsxs)("div",{className:"absolute left-0 top-full z-30 mt-1 min-w-full w-max max-w-[320px] rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:Q,onChange:e=>X(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>{let s=e===l?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?J(!1):el(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>el(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:ei,disabled:V,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${V?"animate-spin":""}`})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:()=>{J(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:A,onChange:e=>F(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:B||!A.trim()||0===eu.length,children:[B?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(h.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(M.DropdownMenu,{children:[(0,t.jsx)(M.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(M.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:er,disabled:!A.trim()||0===eu.length,children:[(0,t.jsx)(h.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===ex.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===eu.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eh,disabled:0===ex.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),disabled:z,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:z,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",l.behind]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",l.ahead]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ei,disabled:V,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${V?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eo,disabled:0===l.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),l.currentBranch]})]})]})]})]}),(0,t.jsxs)(G,{scroll:n,children:[(0,t.jsx)(O,{label:i("git.stagedChanges"),count:eu.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(O,{label:i("git.unstagedChanges"),count:ex.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===l.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(h.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...l?.branches??[],...l?.remoteBranches??[]],currentBranch:l?.currentBranch??"",localPath:e,onCreated:async()=>{I.toast.success(i("git.createSuccess")),await ee()},onError:e=>I.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},500193,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("605e1ec80951070111cde5b15d85b940f44f4773d6",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])},786076,578895,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c7cefd5999e63902bef97ef52fe33d2420a6837c8",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],786076);let r=(0,t.createServerReference)("40bbb3529100faaf0c6532ce0a4f4910bb0a210baf",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],578895)},52661,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("404d0b92b2e8f323321a855f30c76f03687aca3853",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},341975,40342,523185,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60ee8a767c1e6291672e39ed93ee850a3224816124",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,s],341975);let r=(0,t.createServerReference)("407fd4fefdf711d2a688cc0eff73951b1532a8eba4",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,r],40342);let a=(0,t.createServerReference)("606f98e043fcd3466d002d5347ad42f6ed5e067ad2",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],523185)},486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),a=e.i(472074),n=e.i(301348),i=e.i(181209),l=e.i(400355),o=e.i(989383),c=e.i(12659),d=e.i(922541),h=e.i(486077),m=e.i(769824),u=e.i(519455),x=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(n.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:n,onContinueLatest:i}){let{t:l,locale:o}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(x.EmptyState,{icon:m.History,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(s=>{let m=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),x=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let a=Math.floor(r/60);if(a<60)return`${a}m ${r%60}s`;let n=Math.floor(a/60);return`${n}h ${a%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",n=s.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===r?n:1===r?"zh"===t?`昨天 ${n}`:`Yesterday ${n}`:r<7?"zh"===t?`${r}天前 ${n}`:`${r}d ago ${n}`:s.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+n}(s.startedAt??null,o)}),x&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",x,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||l("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,t.jsxs)("span",{children:[m.commits," ",l("execution.commits")]}):null,m.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[m.filesChanged," ",l("execution.files")]})]}):null,m.insertions||m.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),m.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(h.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&n?(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>n(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(u.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(u.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14842,865514,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),a=e.i(232280),n=e.i(759686),i=e.i(960518),l=e.i(340873),o=e.i(400355),c=e.i(519455),d=e.i(912505),h=e.i(487486),m=e.i(776639),u=e.i(624687),x=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:a}=(0,x.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:a("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:a("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:a("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,x.useI18n)(),r=e.split("\n"),a=r.length>500,n=a?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:n.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),a&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:o,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,x.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[M,D]=(0,s.useState)(!1),[L,A]=(0,s.useState)(""),[F,B]=(0,s.useState)(!1),T=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[o.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>D(!0),className:"gap-2",children:[(0,t.jsx)(l.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===o.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:o.map(e=>{let s=v.has(e.filename),n=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&T(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(h.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:n,isLargeFold:!n&&i>200,onLoad:()=>T(e.filename)})})]},e.filename)})})}),(0,t.jsx)(m.Dialog,{open:M,onOpenChange:D,children:(0,t.jsxs)(m.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsx)(m.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(u.Textarea,{value:L,onChange:e=>A(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>D(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(L.trim()&&w){B(!0);try{await w(L.trim()),A(""),D(!1)}finally{B(!1)}}},disabled:!L.trim()||F,children:F?"...":y("diff.commit")})]})]})})]})}],14842);var g=e.i(538059);let j=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:r,taskId:a,taskTitle:n,baseBranch:i,fileCount:l,commitCount:d,commitLog:h=[],onMergeComplete:u}){let x=(0,g.useRouter)(),[f,p]=(0,s.useState)(!1),[b,w]=(0,s.useState)(null),N=async()=>{p(!0),w(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){r(!1),u(),x.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?w(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):w(t.error??"Merge failed")}catch{w("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(m.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(m.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(m.DialogHeader,{children:(0,t.jsxs)(m.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(j,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:i})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),h.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:h.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(m.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>r(!1),disabled:f,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:N,disabled:f,className:"gap-2",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},244354,e=>{"use strict";async function t(e,s,r={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!a.ok)throw Error((await a.json()).error||`${s} failed`);return a.json()}e.s(["gitAction",0,t])},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let a=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,a],755696);let n=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,n],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let l=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,l],719493);let o=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,o],436539)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),a=e.i(48019),n=e.i(782516),i=e.i(755696),l=e.i(886156),o=e.i(400355),c=e.i(586564),d=e.i(719493),h=e.i(597746),m=e.i(368490),u=e.i(232280),x=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),M=e.i(755146),D=e.i(759684),L=e.i(746798),A=e.i(776639),F=e.i(793479),B=e.i(624687),T=e.i(533499);function E({open:e,onOpenChange:r,branches:a,currentBranch:n,localPath:i,onCreated:l,onError:c}){let{t:d}=(0,T.useI18n)(),[m,x]=(0,s.useState)(""),[f,p]=(0,s.useState)(n),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,M]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(x(""),p(n),j(""),k(""))},[e,n]);let D=[...new Set(a)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),L=async()=>{if(m.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:m.trim(),baseBranch:f})});if(e.ok)r(!1),l();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(A.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(A.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(A.DialogHeader,{children:(0,t.jsx)(A.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(F.Input,{value:m,onChange:e=>x(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&L()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>M(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:D.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),M(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(B.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(A.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:L,disabled:!m.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var I=e.i(360112),$=e.i(244354);let R={modified:l.FileEdit,added:a.FilePlus,deleted:n.FileMinus,untracked:i.FileQuestion,renamed:l.FileEdit},z={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},P={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function U(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/").filter(Boolean);if(0===e.length)continue;let r=t;for(let t=0;t<e.length;t++){let a=e[t],n=t===e.length-1,i=e.slice(0,t+1).join("/");if(n)r.children.push({name:a,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function G({scroll:e,children:s}){return e?(0,t.jsx)(D.ScrollArea,{className:"flex-1 min-h-0",children:s}):(0,t.jsx)("div",{children:s})}function O({label:e,count:r,labelColor:a,tree:n,batchAction:i,batchLabel:l,batchIcon:o,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${a}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:n.map(e=>(0,t.jsx)(H,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:h,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function H({node:e,depth:a,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${a} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(m.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(x.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(H,{node:e,depth:a+1,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:h},e.path))]});let j=e.file,b=R[j.status]||r.File,w=z[j.status]||"text-muted-foreground",N=P[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>n(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":h??"",children:d}),h&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:h})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":o??"",children:l}),o&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:o})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:a="project"}){let n="task"===a,{t:i}=(0,T.useI18n)(),[l,m]=(0,s.useState)(null),[x,D]=(0,s.useState)(!0),[A,F]=(0,s.useState)(""),[B,R]=(0,s.useState)(!1),[z,P]=(0,s.useState)(!1),[H,W]=(0,s.useState)(!1),[V,K]=(0,s.useState)(!1),[q,J]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(""),Y=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(q)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){Y.current&&!Y.current.contains(e.target)&&J(!1)}},[q]);let[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();m({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{D(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,$.gitAction)(e,"stage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,$.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(A.trim()){R(!0);try{await (0,$.gitAction)(e,"commit",{message:A}),F(""),I.toast.success(i("git.commitSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{R(!1)}}},ea=async t=>{P(!0);try{await (0,$.gitAction)(e,"pull",t?{branch:t}:{}),I.toast.success(i("git.pullSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{P(!1)}},en=async t=>{W(!0);try{await (0,$.gitAction)(e,"push",t?{branch:t}:{}),I.toast.success(i("git.pushSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{W(!1)}},ei=async()=>{K(!0);try{await (0,$.gitAction)(e,"fetch"),I.toast.success(i("git.fetchSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{K(!1)}},el=async t=>{try{await (0,$.gitAction)(e,"checkout",{branch:t}),J(!1),I.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eo=async()=>{try{await (0,$.gitAction)(e,"stash-save",{message:A||void 0}),F(""),I.toast.success(i("git.stashSaved")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,$.gitAction)(e,"stash-pop",{index:0}),I.toast.success(i("git.stashApplied")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,$.gitAction)(e,"discard-file",{file:t}),I.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eh=async()=>{try{await (0,$.gitAction)(e,"discard-all"),I.toast.success(i("git.discardSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},em=async t=>{if("deleted"===t.status)return;let s=l?.topLevel??e;try{let a=await (0,$.gitAction)(e,"show",{file:t.file});r?.(t.file,a.content??"",s)}catch{r?.(t.file,"",s)}},eu=l?.changedFiles.filter(e=>e.staged)??[],ex=l?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>U(eu),[eu]),ep=(0,s.useMemo)(()=>U(ex),[ex]);if(x)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!l)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...l?.branches??[],...(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e))],eb=Q?ej.filter(e=>e.toLowerCase().includes(Q.toLowerCase())):ej;return(0,t.jsxs)("div",{className:n?"flex flex-col h-full overflow-hidden":"flex flex-col",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[n?(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:l?.currentBranch||"—"})]})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:l?.currentBranch||"—"})]}):(0,t.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Y,children:[(0,t.jsxs)("button",{onClick:()=>{J(!q),X("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l?.currentBranch||void 0,children:l?.currentBranch||"—"})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${q?"rotate-180":""}`})]}),q&&(0,t.jsxs)("div",{className:"absolute left-0 top-full z-30 mt-1 min-w-full w-max max-w-[320px] rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:Q,onChange:e=>X(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>{let s=e===l?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?J(!1):el(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(h.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>el(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:ei,disabled:V,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${V?"animate-spin":""}`})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:()=>{J(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:A,onChange:e=>F(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:B||!A.trim()||0===eu.length,children:[B?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(h.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(M.DropdownMenu,{children:[(0,t.jsx)(M.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(M.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:er,disabled:!A.trim()||0===eu.length,children:[(0,t.jsx)(h.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===ex.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===eu.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eh,disabled:0===ex.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),disabled:z,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:z,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",l.behind]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",l.ahead]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ei,disabled:V,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${V?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eo,disabled:0===l.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),l.currentBranch]})]})]})]})]}),(0,t.jsxs)(G,{scroll:n,children:[(0,t.jsx)(O,{label:i("git.stagedChanges"),count:eu.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(O,{label:i("git.unstagedChanges"),count:ex.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:em,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===l.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(h.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...l?.branches??[],...l?.remoteBranches??[]],currentBranch:l?.currentBranch??"",localPath:e,onCreated:async()=>{I.toast.success(i("git.createSuccess")),await ee()},onError:e=>I.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},269504,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("606d705506b8676fd47b192c2c9716ca91ef9f0e8b",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])},466520,764313,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7cdcc9374465625d96e749dd6cc269159534491e57",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],466520);let r=(0,t.createServerReference)("40f02b0f9565f80f33bbf1b464a0767ba121da533f",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],764313)},245816,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("4094a1985cc9f4aca1c58f3fe47160e96438a1e4fa",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},254675,114208,812100,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60e8a899bfb81e28750738ba5a60be28ea51fa27a6",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,s],254675);let r=(0,t.createServerReference)("404acb741a64c82eecb0cafc114ed1c3c774ded716",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,r],114208);let a=(0,t.createServerReference)("606d89b05b549976424158925b1b4d2d2895b2dbe2",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],812100)},486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),a=e.i(472074),n=e.i(301348),i=e.i(181209),l=e.i(400355),o=e.i(989383),c=e.i(12659),d=e.i(922541),h=e.i(486077),m=e.i(769824),u=e.i(519455),x=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(n.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:n,onContinueLatest:i}){let{t:l,locale:o}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(x.EmptyState,{icon:m.History,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(s=>{let m=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),x=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let a=Math.floor(r/60);if(a<60)return`${a}m ${r%60}s`;let n=Math.floor(a/60);return`${n}h ${a%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",n=s.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===r?n:1===r?"zh"===t?`昨天 ${n}`:`Yesterday ${n}`:r<7?"zh"===t?`${r}天前 ${n}`:`${r}d ago ${n}`:s.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+n}(s.startedAt??null,o)}),x&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",x,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||l("execution.noSummary")}),m&&(m.commits||m.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[m.commits?(0,t.jsxs)("span",{children:[m.commits," ",l("execution.commits")]}):null,m.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[m.filesChanged," ",l("execution.files")]})]}):null,m.insertions||m.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),m.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",m.insertions]}):null,m.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",m.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(h.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&n?(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>n(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(u.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(u.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])}]);
@@ -1 +1 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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)},993830,e=>{"use strict";var t=e.i(514798);let n=(0,t.createServerReference)("40a3c5f8cf9a7905fb65ed1bb0e2a62bca9a1aade4",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,n])},110204,337822,e=>{"use strict";var t,n=e.i(289721),o=e.i(975157);e.s(["Label",0,function({className:e,...t}){return(0,n.jsx)("label",{"data-slot":"label",className:(0,o.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),...t})}],110204),e.s([],707132),e.i(707132);var r=e.i(965652),i=e.i(620163),s=e.i(528796),a=e.i(594640),l=e.i(306296),u=e.i(344478),p=e.i(205995),c=e.i(611008);e.i(708878);var d=e.i(462902);let g=r.createContext(void 0);function f(e){let t=r.useContext(g);if(void 0===t&&!e)throw Error((0,d.default)(47));return t}var S=e.i(585012),v=e.i(370161),m=e.i(596290),h=e.i(161476),R=e.i(903224),E=e.i(774641),C=e.i(586622),b=e.i(771326),O=e.i(87396),x=e.i(693354);let T={...b.popupStoreSelectors,disabled:(0,m.createSelector)(e=>e.disabled),instantType:(0,m.createSelector)(e=>e.instantType),openMethod:(0,m.createSelector)(e=>e.openMethod),openChangeReason:(0,m.createSelector)(e=>e.openChangeReason),modal:(0,m.createSelector)(e=>e.modal),stickIfOpen:(0,m.createSelector)(e=>e.stickIfOpen),titleElementId:(0,m.createSelector)(e=>e.titleElementId),descriptionElementId:(0,m.createSelector)(e=>e.descriptionElementId),openOnHover:(0,m.createSelector)(e=>e.openOnHover),closeDelay:(0,m.createSelector)(e=>e.closeDelay),hasViewport:(0,m.createSelector)(e=>e.hasViewport)};class I extends v.ReactStore{constructor(e){const t={...(0,b.createInitialPopupStoreState)(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1,...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:r.createRef(),backdropRef:r.createRef(),internalBackdropRef:r.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:r.createRef(),beforeContentFocusGuardRef:r.createRef(),stickIfOpenTimeout:new h.Timeout,triggerElements:new O.PopupTriggerMap},T)}setOpen=(e,t)=>{let n=t.reason===C.REASONS.triggerHover,o=t.reason===C.REASONS.triggerPress&&0===t.event.detail,r=!e&&(t.reason===C.REASONS.escapeKey||null==t.reason);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let i={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger},s=this.state.floatingRootContext.context.events;s?.emit("openchange",i);let a=()=>{let n={open:e,openChangeReason:t.reason},o=t.trigger?.id??null;(o||e)&&(n.activeTriggerId=o,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(x.PATIENT_CLICK_THRESHOLD,()=>{this.set("stickIfOpen",!1)}),S.flushSync(a)):a(),o||r?this.set("instantType",o?"click":"dismiss"):t.reason===C.REASONS.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){let n=(0,R.useRefWithInit)(()=>new I(t)).current,o=e??n;return(0,E.useOnMount)(n.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}var y=e.i(67077),P=e.i(894621),A=e.i(892069);function M({props:e}){let{children:t,open:o,defaultOpen:d=!1,onOpenChange:f,onOpenChangeComplete:S,modal:v=!1,handle:m,triggerId:h,defaultTriggerId:R=null}=e,E=I.useStore(m?.store,{modal:v,open:d,openProp:o,activeTriggerId:R,triggerIdProp:h});(0,s.useOnFirstRender)(()=>{void 0===o&&!1===E.state.open&&!0===d&&E.update({open:!0,activeTriggerId:R})}),E.useControlledProp("openProp",o),E.useControlledProp("triggerIdProp",h);let b=E.useState("open"),O=E.useState("positionerElement"),x=E.useState("payload"),T=E.useState("openChangeReason");E.useContextCallback("onOpenChange",f),E.useContextCallback("onOpenChangeComplete",S);let{openMethod:k,triggerProps:w}=(0,A.useOpenInteractionType)(b);(0,P.useImplicitActiveTrigger)(E);let{forceUnmount:F}=(0,P.useOpenStateTransitions)(b,E,()=>{E.update({stickIfOpen:!0,openChangeReason:null})});(0,i.useScrollLock)(b&&!0===v&&T!==C.REASONS.triggerHover&&"touch"!==k,O),r.useEffect(()=>{b||E.context.stickIfOpenTimeout.clear()},[E,b]);let N=r.useCallback(e=>{let t=(0,y.createChangeEventDetails)(e);return t.preventUnmountOnClose=()=>{E.set("preventUnmountingOnClose",!0)},t},[E]),j=r.useCallback(()=>{E.setOpen(!1,N(C.REASONS.imperativeAction))},[E,N]);r.useImperativeHandle(e.actionsRef,()=>({unmount:F,close:j}),[F,j]);let D=(0,c.useSyncedFloatingRootContext)({popupStore:E,onOpenChange:E.setOpen}),H=(0,a.useDismiss)(D,{outsidePressEvent:{mouse:"trap-focus"===v?"sloppy":"intentional",touch:"sloppy"}}),B=(0,u.useRole)(D),{getReferenceProps:L,getFloatingProps:V,getTriggerProps:U}=(0,l.useInteractions)([H,B]),G=r.useMemo(()=>L(w),[L,w]),K=r.useMemo(()=>U(w),[U,w]),_=r.useMemo(()=>V(),[V]);E.useSyncedValues({modal:v,openMethod:k,activeTriggerProps:G,inactiveTriggerProps:K,popupProps:_,floatingRootContext:D,nested:null!=(0,p.useFloatingParentNodeId)()});let z=r.useMemo(()=>({store:E}),[E]);return(0,n.jsx)(g.Provider,{value:z,children:"function"==typeof t?t({payload:x}):t})}var k=e.i(887642),w=e.i(282109),F=e.i(845756),N=e.i(581263),j=e.i(660272),D=e.i(430557),H=e.i(411657),B=e.i(207516),L=e.i(221732),V=e.i(682354),U=e.i(870541);let G=r.forwardRef(function(e,t){let{render:o,className:i,disabled:s=!1,nativeButton:a=!0,handle:u,payload:p,openOnHover:c=!1,delay:g=300,closeDelay:v=0,id:m,...h}=e,R=f(!0),E=u?.store??R?.store;if(!E)throw Error((0,d.default)(74));let b=(0,B.useBaseUiId)(m),O=E.useState("isTriggerActive",b),T=E.useState("floatingRootContext"),I=E.useState("isOpenedByTrigger",b),A=r.useRef(null),{registerTrigger:M,isMountedByThisTrigger:G}=(0,P.useTriggerDataForwarding)(b,A,E,{payload:p,disabled:s,openOnHover:c,closeDelay:v}),K=E.useState("openChangeReason"),_=E.useState("stickIfOpen"),z=E.useState("openMethod"),W=(0,H.useHoverReferenceInteraction)(T,{enabled:null!=T&&c&&("touch"!==z||K!==C.REASONS.triggerPress),mouseOnly:!0,move:!1,handleClose:(0,j.safePolygon)(),restMs:g,delay:{close:v},triggerElementRef:A,isActiveTrigger:O}),Y=(0,D.useClick)(T,{enabled:null!=T,stickIfOpen:_}),q=(0,l.useInteractions)([Y]),J=E.useState("triggerProps",G),{getButtonProps:Q,buttonRef:X}=(0,w.useButton)({disabled:s,native:a}),Z=r.useMemo(()=>({open:e=>e&&K===C.REASONS.triggerPress?F.pressableTriggerOpenStateMapping.open(e):F.triggerOpenStateMapping.open(e)}),[K]),$=(0,N.useRenderElement)("button",e,{state:{disabled:s,open:I},ref:[X,t,M,A],props:[q.getReferenceProps(),W,J,{[x.CLICK_TRIGGER_IDENTIFIER]:"",id:b},h,Q],stateAttributesMapping:Z}),ee=r.useRef(null),et=(0,k.useStableCallback)(e=>{S.flushSync(()=>{E.setOpen(!1,(0,y.createChangeEventDetails)(C.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let t=(0,U.getTabbableBeforeElement)(ee.current);t?.focus()}),en=(0,k.useStableCallback)(e=>{let t=E.select("positionerElement");if(t&&(0,U.isOutsideEvent)(e,t))E.context.beforeContentFocusGuardRef.current?.focus();else{S.flushSync(()=>{E.setOpen(!1,(0,y.createChangeEventDetails)(C.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let n=(0,U.getTabbableAfterElement)(E.context.triggerFocusTargetRef.current||A.current);for(;null!==n&&(0,V.contains)(t,n);){let e=n;if((n=(0,U.getNextTabbable)(n))===e)break}n?.focus()}});return O?(0,n.jsxs)(r.Fragment,{children:[(0,n.jsx)(L.FocusGuard,{ref:ee,onFocus:et}),(0,n.jsx)(r.Fragment,{children:$},b),(0,n.jsx)(L.FocusGuard,{ref:E.context.triggerFocusTargetRef,onFocus:en})]}):(0,n.jsx)(r.Fragment,{children:$},b)});var K=e.i(888393);let _=r.createContext(void 0),z=r.forwardRef(function(e,t){let{keepMounted:o=!1,...r}=e,{store:i}=f();return i.useState("mounted")||o?(0,n.jsx)(_.Provider,{value:o,children:(0,n.jsx)(K.FloatingPortal,{ref:t,...r})}):null});var W=e.i(831766),Y=e.i(804849);let q=r.createContext(void 0);function J(){let e=r.useContext(q);if(!e)throw Error((0,d.default)(46));return e}var Q=e.i(887943),X=e.i(72287),Z=e.i(412522),$=e.i(431362),ee=e.i(808754);let et=r.forwardRef(function(e,t){let{render:o,className:i,anchor:s,positionMethod:a="absolute",side:l="bottom",align:u="center",sideOffset:c=0,alignOffset:g=0,collisionBoundary:S="clipping-ancestors",collisionPadding:v=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:R=!1,collisionAvoidance:E=x.POPUP_COLLISION_AVOIDANCE,...b}=e,{store:O}=f(),T=function(){let e=r.useContext(_);if(void 0===e)throw Error((0,d.default)(45));return e}(),I=(0,p.useFloatingNodeId)(),y=O.useState("floatingRootContext"),P=O.useState("mounted"),A=O.useState("open"),M=O.useState("openChangeReason"),k=O.useState("activeTriggerElement"),w=O.useState("modal"),j=O.useState("positionerElement"),D=O.useState("instantType"),H=O.useState("transitionStatus"),B=O.useState("hasViewport"),L=r.useRef(null),V=(0,Z.useAnimationsFinished)(j,!1,!1),U=(0,Q.useAnchorPositioning)({anchor:s,floatingRootContext:y,positionMethod:a,mounted:P,side:l,sideOffset:c,align:u,alignOffset:g,arrowPadding:m,collisionBoundary:S,collisionPadding:v,sticky:h,disableAnchorTracking:R,keepMounted:T,nodeId:I,collisionAvoidance:E,adaptiveOrigin:B?$.adaptiveOrigin:void 0}),G=r.useMemo(()=>{let e={};return A||(e.pointerEvents="none"),{role:"presentation",hidden:!P,style:{...U.positionerStyles,...e}}},[A,P,U.positionerStyles]),K=r.useMemo(()=>({props:G,...U}),[G,U]),z=y.useState("domReferenceElement");(0,Y.useIsoLayoutEffect)(()=>{let e=L.current;if(z&&(L.current=z),e&&z&&z!==e){O.set("instantType",void 0);let e=new AbortController;return V(()=>{O.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[z,V,O]);let J={open:A,side:K.side,align:K.align,anchorHidden:K.anchorHidden,instant:D},et=r.useCallback(e=>{O.set("positionerElement",e)},[O]),en=(0,N.useRenderElement)("div",e,{state:J,props:[K.props,(0,ee.getDisabledMountTransitionStyles)(H),b],ref:[t,et],stateAttributesMapping:F.popupStateMapping});return(0,n.jsxs)(q.Provider,{value:K,children:[P&&!0===w&&M!==C.REASONS.triggerHover&&(0,n.jsx)(X.InternalBackdrop,{ref:O.context.internalBackdropRef,inert:(0,W.inertValue)(!A),cutout:k}),(0,n.jsx)(p.FloatingNode,{id:I,children:en})]})});var en=e.i(92615),eo=e.i(11931),er=e.i(511980),ei=e.i(809058),es=e.i(504068),ea=e.i(197920),el=e.i(196368);let eu=r.createContext(void 0);function ep(e){let{value:t,children:o}=e;return(0,n.jsx)(eu.Provider,{value:t,children:o})}let ec={...F.popupStateMapping,...ei.transitionStatusMapping},ed=r.forwardRef(function(e,t){let{className:o,render:i,initialFocus:s,finalFocus:a,...l}=e,{store:u}=f(),p=J(),c=null!=(0,el.useToolbarRootContext)(!0),{context:d,hasClosePart:g}=function(){let[e,t]=r.useState(0),n=(0,k.useStableCallback)(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:r.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}(),S=u.useState("open"),v=u.useState("openMethod"),m=u.useState("instantType"),h=u.useState("transitionStatus"),R=u.useState("popupProps"),E=u.useState("titleElementId"),b=u.useState("descriptionElementId"),O=u.useState("modal"),x=u.useState("mounted"),T=u.useState("openChangeReason"),I=u.useState("activeTriggerElement"),y=u.useState("floatingRootContext");(0,es.useOpenChangeComplete)({open:S,ref:u.context.popupRef,onComplete(){S&&u.context.onOpenChangeComplete?.(!0)}});let P=u.useState("disabled"),A=u.useState("openOnHover"),M=u.useState("closeDelay");(0,er.useHoverFloatingInteraction)(y,{enabled:A&&!P,closeDelay:M});let w=void 0===s?function(e){return"touch"!==e||u.context.popupRef.current}:s,F={open:S,side:p.side,align:p.align,instant:m,transitionStatus:h},j=r.useCallback(e=>{u.set("popupElement",e)},[u]),D=(0,N.useRenderElement)("div",e,{state:F,ref:[t,u.context.popupRef,j],props:[R,{"aria-labelledby":E,"aria-describedby":b,onKeyDown(e){c&&ea.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,ee.getDisabledMountTransitionStyles)(h),l],stateAttributesMapping:ec});return(0,n.jsx)(eo.FloatingFocusManager,{context:y,openInteractionType:v,modal:!1!==O&&g,disabled:!x||T===C.REASONS.triggerHover,initialFocus:w,returnFocus:a,restoreFocus:"popup",previousFocusableElement:(0,en.isHTMLElement)(I)?I:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:(0,n.jsx)(ep,{value:d,children:D})})}),eg=r.forwardRef(function(e,t){let{className:n,render:o,...r}=e,{store:i}=f(),s=i.useState("open"),{arrowRef:a,side:l,align:u,arrowUncentered:p,arrowStyles:c}=J();return(0,N.useRenderElement)("div",e,{state:{open:s,side:l,align:u,uncentered:p},ref:[t,a],props:[{style:c,"aria-hidden":!0},r],stateAttributesMapping:F.popupStateMapping})}),ef={...F.popupStateMapping,...ei.transitionStatusMapping},eS=r.forwardRef(function(e,t){let{className:n,render:o,...r}=e,{store:i}=f(),s=i.useState("open"),a=i.useState("mounted"),l=i.useState("transitionStatus"),u=i.useState("openChangeReason");return(0,N.useRenderElement)("div",e,{state:{open:s,transitionStatus:l},ref:[i.context.backdropRef,t],props:[{role:"presentation",hidden:!a,style:{pointerEvents:u===C.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},r],stateAttributesMapping:ef})}),ev=r.forwardRef(function(e,t){let{render:n,className:o,...r}=e,{store:i}=f(),s=(0,B.useBaseUiId)(r.id);return(0,Y.useIsoLayoutEffect)(()=>(i.set("titleElementId",s),()=>{i.set("titleElementId",void 0)}),[i,s]),(0,N.useRenderElement)("h2",e,{ref:t,props:[{id:s},r]})}),em=r.forwardRef(function(e,t){let{render:n,className:o,...r}=e,{store:i}=f(),s=(0,B.useBaseUiId)(r.id);return(0,Y.useIsoLayoutEffect)(()=>(i.set("descriptionElementId",s),()=>{i.set("descriptionElementId",void 0)}),[i,s]),(0,N.useRenderElement)("p",e,{ref:t,props:[{id:s},r]})}),eh=r.forwardRef(function(e,t){let n,{render:o,className:i,disabled:s=!1,nativeButton:a=!0,...l}=e,{buttonRef:u,getButtonProps:p}=(0,w.useButton)({disabled:s,focusableWhenDisabled:!1,native:a}),{store:c}=f();return n=r.useContext(eu),(0,Y.useIsoLayoutEffect)(()=>n?.register(),[n]),(0,N.useRenderElement)("button",e,{ref:[t,u],props:[{onClick(e){c.setOpen(!1,(0,y.createChangeEventDetails)(C.REASONS.closePress,e.nativeEvent,e.currentTarget))}},l,p]})}),eR=((t={}).popupWidth="--popup-width",t.popupHeight="--popup-height",t);var eE=e.i(203667);let eC={activationDirection:e=>e?{"data-activation-direction":e}:null},eb=r.forwardRef(function(e,t){let{render:n,className:o,children:r,...i}=e,{store:s}=f(),{side:a}=J(),l=s.useState("instantType"),{children:u,state:p}=(0,eE.usePopupViewport)({store:s,side:a,cssVars:eR,children:r}),c={activationDirection:p.activationDirection,transitioning:p.transitioning,instant:l};return(0,N.useRenderElement)("div",e,{state:c,ref:t,props:[i,{children:u}],stateAttributesMapping:eC})});class eO{constructor(){this.store=new I}open(e){let t=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!t)throw Error((0,d.default)(80,e));this.store.setOpen(!0,(0,y.createChangeEventDetails)(C.REASONS.imperativeAction,void 0,t))}close(){this.store.setOpen(!1,(0,y.createChangeEventDetails)(C.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Arrow",0,eg,"Backdrop",0,eS,"Close",0,eh,"Description",0,em,"Handle",0,eO,"Popup",0,ed,"Portal",0,z,"Positioner",0,et,"Root",0,function(e){return f(!0)?(0,n.jsx)(M,{props:e}):(0,n.jsx)(p.FloatingTree,{children:(0,n.jsx)(M,{props:e})})},"Title",0,ev,"Trigger",0,G,"Viewport",0,eb,"createHandle",0,function(){return new eO}],107641);var ex=e.i(107641),ex=ex;e.s(["Popover",0,function({...e}){return(0,n.jsx)(ex.Root,{"data-slot":"popover",...e})},"PopoverContent",0,function({className:e,align:t="center",alignOffset:r=0,side:i="bottom",sideOffset:s=4,...a}){return(0,n.jsx)(ex.Portal,{children:(0,n.jsx)(ex.Positioner,{align:t,alignOffset:r,side:i,sideOffset:s,className:"isolate z-50",children:(0,n.jsx)(ex.Popup,{"data-slot":"popover-content",className:(0,o.cn)("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a})})})},"PopoverTrigger",0,function({...e}){return(0,n.jsx)(ex.Trigger,{"data-slot":"popover-trigger",...e})}],337822)}]);
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,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)},490865,e=>{"use strict";var t=e.i(514798);let n=(0,t.createServerReference)("40237e4dbff3868f964dd9913f9a4ca85f84822c10",t.callServer,void 0,t.findSourceMapURL,"getConfigValues");e.s(["getConfigValues",0,n])},110204,337822,e=>{"use strict";var t,n=e.i(289721),o=e.i(975157);e.s(["Label",0,function({className:e,...t}){return(0,n.jsx)("label",{"data-slot":"label",className:(0,o.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),...t})}],110204),e.s([],707132),e.i(707132);var r=e.i(965652),i=e.i(620163),s=e.i(528796),a=e.i(594640),l=e.i(306296),u=e.i(344478),p=e.i(205995),c=e.i(611008);e.i(708878);var d=e.i(462902);let g=r.createContext(void 0);function f(e){let t=r.useContext(g);if(void 0===t&&!e)throw Error((0,d.default)(47));return t}var S=e.i(585012),v=e.i(370161),m=e.i(596290),h=e.i(161476),R=e.i(903224),E=e.i(774641),C=e.i(586622),O=e.i(771326),b=e.i(87396),x=e.i(693354);let T={...O.popupStoreSelectors,disabled:(0,m.createSelector)(e=>e.disabled),instantType:(0,m.createSelector)(e=>e.instantType),openMethod:(0,m.createSelector)(e=>e.openMethod),openChangeReason:(0,m.createSelector)(e=>e.openChangeReason),modal:(0,m.createSelector)(e=>e.modal),stickIfOpen:(0,m.createSelector)(e=>e.stickIfOpen),titleElementId:(0,m.createSelector)(e=>e.titleElementId),descriptionElementId:(0,m.createSelector)(e=>e.descriptionElementId),openOnHover:(0,m.createSelector)(e=>e.openOnHover),closeDelay:(0,m.createSelector)(e=>e.closeDelay),hasViewport:(0,m.createSelector)(e=>e.hasViewport)};class I extends v.ReactStore{constructor(e){const t={...(0,O.createInitialPopupStoreState)(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0,hasViewport:!1,...e};t.open&&e?.mounted===void 0&&(t.mounted=!0),super(t,{popupRef:r.createRef(),backdropRef:r.createRef(),internalBackdropRef:r.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:r.createRef(),beforeContentFocusGuardRef:r.createRef(),stickIfOpenTimeout:new h.Timeout,triggerElements:new b.PopupTriggerMap},T)}setOpen=(e,t)=>{let n=t.reason===C.REASONS.triggerHover,o=t.reason===C.REASONS.triggerPress&&0===t.event.detail,r=!e&&(t.reason===C.REASONS.escapeKey||null==t.reason);if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let i={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested,triggerElement:t.trigger},s=this.state.floatingRootContext.context.events;s?.emit("openchange",i);let a=()=>{let n={open:e,openChangeReason:t.reason},o=t.trigger?.id??null;(o||e)&&(n.activeTriggerId=o,n.activeTriggerElement=t.trigger??null),this.update(n)};n?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(x.PATIENT_CLICK_THRESHOLD,()=>{this.set("stickIfOpen",!1)}),S.flushSync(a)):a(),o||r?this.set("instantType",o?"click":"dismiss"):t.reason===C.REASONS.focusOut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(e,t){let n=(0,R.useRefWithInit)(()=>new I(t)).current,o=e??n;return(0,E.useOnMount)(n.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}var y=e.i(67077),P=e.i(894621),A=e.i(892069);function M({props:e}){let{children:t,open:o,defaultOpen:d=!1,onOpenChange:f,onOpenChangeComplete:S,modal:v=!1,handle:m,triggerId:h,defaultTriggerId:R=null}=e,E=I.useStore(m?.store,{modal:v,open:d,openProp:o,activeTriggerId:R,triggerIdProp:h});(0,s.useOnFirstRender)(()=>{void 0===o&&!1===E.state.open&&!0===d&&E.update({open:!0,activeTriggerId:R})}),E.useControlledProp("openProp",o),E.useControlledProp("triggerIdProp",h);let O=E.useState("open"),b=E.useState("positionerElement"),x=E.useState("payload"),T=E.useState("openChangeReason");E.useContextCallback("onOpenChange",f),E.useContextCallback("onOpenChangeComplete",S);let{openMethod:k,triggerProps:w}=(0,A.useOpenInteractionType)(O);(0,P.useImplicitActiveTrigger)(E);let{forceUnmount:F}=(0,P.useOpenStateTransitions)(O,E,()=>{E.update({stickIfOpen:!0,openChangeReason:null})});(0,i.useScrollLock)(O&&!0===v&&T!==C.REASONS.triggerHover&&"touch"!==k,b),r.useEffect(()=>{O||E.context.stickIfOpenTimeout.clear()},[E,O]);let N=r.useCallback(e=>{let t=(0,y.createChangeEventDetails)(e);return t.preventUnmountOnClose=()=>{E.set("preventUnmountingOnClose",!0)},t},[E]),j=r.useCallback(()=>{E.setOpen(!1,N(C.REASONS.imperativeAction))},[E,N]);r.useImperativeHandle(e.actionsRef,()=>({unmount:F,close:j}),[F,j]);let D=(0,c.useSyncedFloatingRootContext)({popupStore:E,onOpenChange:E.setOpen}),H=(0,a.useDismiss)(D,{outsidePressEvent:{mouse:"trap-focus"===v?"sloppy":"intentional",touch:"sloppy"}}),B=(0,u.useRole)(D),{getReferenceProps:L,getFloatingProps:V,getTriggerProps:U}=(0,l.useInteractions)([H,B]),G=r.useMemo(()=>L(w),[L,w]),K=r.useMemo(()=>U(w),[U,w]),_=r.useMemo(()=>V(),[V]);E.useSyncedValues({modal:v,openMethod:k,activeTriggerProps:G,inactiveTriggerProps:K,popupProps:_,floatingRootContext:D,nested:null!=(0,p.useFloatingParentNodeId)()});let z=r.useMemo(()=>({store:E}),[E]);return(0,n.jsx)(g.Provider,{value:z,children:"function"==typeof t?t({payload:x}):t})}var k=e.i(887642),w=e.i(282109),F=e.i(845756),N=e.i(581263),j=e.i(660272),D=e.i(430557),H=e.i(411657),B=e.i(207516),L=e.i(221732),V=e.i(682354),U=e.i(870541);let G=r.forwardRef(function(e,t){let{render:o,className:i,disabled:s=!1,nativeButton:a=!0,handle:u,payload:p,openOnHover:c=!1,delay:g=300,closeDelay:v=0,id:m,...h}=e,R=f(!0),E=u?.store??R?.store;if(!E)throw Error((0,d.default)(74));let O=(0,B.useBaseUiId)(m),b=E.useState("isTriggerActive",O),T=E.useState("floatingRootContext"),I=E.useState("isOpenedByTrigger",O),A=r.useRef(null),{registerTrigger:M,isMountedByThisTrigger:G}=(0,P.useTriggerDataForwarding)(O,A,E,{payload:p,disabled:s,openOnHover:c,closeDelay:v}),K=E.useState("openChangeReason"),_=E.useState("stickIfOpen"),z=E.useState("openMethod"),W=(0,H.useHoverReferenceInteraction)(T,{enabled:null!=T&&c&&("touch"!==z||K!==C.REASONS.triggerPress),mouseOnly:!0,move:!1,handleClose:(0,j.safePolygon)(),restMs:g,delay:{close:v},triggerElementRef:A,isActiveTrigger:b}),Y=(0,D.useClick)(T,{enabled:null!=T,stickIfOpen:_}),q=(0,l.useInteractions)([Y]),J=E.useState("triggerProps",G),{getButtonProps:Q,buttonRef:X}=(0,w.useButton)({disabled:s,native:a}),Z=r.useMemo(()=>({open:e=>e&&K===C.REASONS.triggerPress?F.pressableTriggerOpenStateMapping.open(e):F.triggerOpenStateMapping.open(e)}),[K]),$=(0,N.useRenderElement)("button",e,{state:{disabled:s,open:I},ref:[X,t,M,A],props:[q.getReferenceProps(),W,J,{[x.CLICK_TRIGGER_IDENTIFIER]:"",id:O},h,Q],stateAttributesMapping:Z}),ee=r.useRef(null),et=(0,k.useStableCallback)(e=>{S.flushSync(()=>{E.setOpen(!1,(0,y.createChangeEventDetails)(C.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let t=(0,U.getTabbableBeforeElement)(ee.current);t?.focus()}),en=(0,k.useStableCallback)(e=>{let t=E.select("positionerElement");if(t&&(0,U.isOutsideEvent)(e,t))E.context.beforeContentFocusGuardRef.current?.focus();else{S.flushSync(()=>{E.setOpen(!1,(0,y.createChangeEventDetails)(C.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let n=(0,U.getTabbableAfterElement)(E.context.triggerFocusTargetRef.current||A.current);for(;null!==n&&(0,V.contains)(t,n);){let e=n;if((n=(0,U.getNextTabbable)(n))===e)break}n?.focus()}});return b?(0,n.jsxs)(r.Fragment,{children:[(0,n.jsx)(L.FocusGuard,{ref:ee,onFocus:et}),(0,n.jsx)(r.Fragment,{children:$},O),(0,n.jsx)(L.FocusGuard,{ref:E.context.triggerFocusTargetRef,onFocus:en})]}):(0,n.jsx)(r.Fragment,{children:$},O)});var K=e.i(888393);let _=r.createContext(void 0),z=r.forwardRef(function(e,t){let{keepMounted:o=!1,...r}=e,{store:i}=f();return i.useState("mounted")||o?(0,n.jsx)(_.Provider,{value:o,children:(0,n.jsx)(K.FloatingPortal,{ref:t,...r})}):null});var W=e.i(831766),Y=e.i(804849);let q=r.createContext(void 0);function J(){let e=r.useContext(q);if(!e)throw Error((0,d.default)(46));return e}var Q=e.i(887943),X=e.i(72287),Z=e.i(412522),$=e.i(431362),ee=e.i(808754);let et=r.forwardRef(function(e,t){let{render:o,className:i,anchor:s,positionMethod:a="absolute",side:l="bottom",align:u="center",sideOffset:c=0,alignOffset:g=0,collisionBoundary:S="clipping-ancestors",collisionPadding:v=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:R=!1,collisionAvoidance:E=x.POPUP_COLLISION_AVOIDANCE,...O}=e,{store:b}=f(),T=function(){let e=r.useContext(_);if(void 0===e)throw Error((0,d.default)(45));return e}(),I=(0,p.useFloatingNodeId)(),y=b.useState("floatingRootContext"),P=b.useState("mounted"),A=b.useState("open"),M=b.useState("openChangeReason"),k=b.useState("activeTriggerElement"),w=b.useState("modal"),j=b.useState("positionerElement"),D=b.useState("instantType"),H=b.useState("transitionStatus"),B=b.useState("hasViewport"),L=r.useRef(null),V=(0,Z.useAnimationsFinished)(j,!1,!1),U=(0,Q.useAnchorPositioning)({anchor:s,floatingRootContext:y,positionMethod:a,mounted:P,side:l,sideOffset:c,align:u,alignOffset:g,arrowPadding:m,collisionBoundary:S,collisionPadding:v,sticky:h,disableAnchorTracking:R,keepMounted:T,nodeId:I,collisionAvoidance:E,adaptiveOrigin:B?$.adaptiveOrigin:void 0}),G=r.useMemo(()=>{let e={};return A||(e.pointerEvents="none"),{role:"presentation",hidden:!P,style:{...U.positionerStyles,...e}}},[A,P,U.positionerStyles]),K=r.useMemo(()=>({props:G,...U}),[G,U]),z=y.useState("domReferenceElement");(0,Y.useIsoLayoutEffect)(()=>{let e=L.current;if(z&&(L.current=z),e&&z&&z!==e){b.set("instantType",void 0);let e=new AbortController;return V(()=>{b.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[z,V,b]);let J={open:A,side:K.side,align:K.align,anchorHidden:K.anchorHidden,instant:D},et=r.useCallback(e=>{b.set("positionerElement",e)},[b]),en=(0,N.useRenderElement)("div",e,{state:J,props:[K.props,(0,ee.getDisabledMountTransitionStyles)(H),O],ref:[t,et],stateAttributesMapping:F.popupStateMapping});return(0,n.jsxs)(q.Provider,{value:K,children:[P&&!0===w&&M!==C.REASONS.triggerHover&&(0,n.jsx)(X.InternalBackdrop,{ref:b.context.internalBackdropRef,inert:(0,W.inertValue)(!A),cutout:k}),(0,n.jsx)(p.FloatingNode,{id:I,children:en})]})});var en=e.i(92615),eo=e.i(11931),er=e.i(511980),ei=e.i(809058),es=e.i(504068),ea=e.i(197920),el=e.i(196368);let eu=r.createContext(void 0);function ep(e){let{value:t,children:o}=e;return(0,n.jsx)(eu.Provider,{value:t,children:o})}let ec={...F.popupStateMapping,...ei.transitionStatusMapping},ed=r.forwardRef(function(e,t){let{className:o,render:i,initialFocus:s,finalFocus:a,...l}=e,{store:u}=f(),p=J(),c=null!=(0,el.useToolbarRootContext)(!0),{context:d,hasClosePart:g}=function(){let[e,t]=r.useState(0),n=(0,k.useStableCallback)(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:r.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}(),S=u.useState("open"),v=u.useState("openMethod"),m=u.useState("instantType"),h=u.useState("transitionStatus"),R=u.useState("popupProps"),E=u.useState("titleElementId"),O=u.useState("descriptionElementId"),b=u.useState("modal"),x=u.useState("mounted"),T=u.useState("openChangeReason"),I=u.useState("activeTriggerElement"),y=u.useState("floatingRootContext");(0,es.useOpenChangeComplete)({open:S,ref:u.context.popupRef,onComplete(){S&&u.context.onOpenChangeComplete?.(!0)}});let P=u.useState("disabled"),A=u.useState("openOnHover"),M=u.useState("closeDelay");(0,er.useHoverFloatingInteraction)(y,{enabled:A&&!P,closeDelay:M});let w=void 0===s?function(e){return"touch"!==e||u.context.popupRef.current}:s,F={open:S,side:p.side,align:p.align,instant:m,transitionStatus:h},j=r.useCallback(e=>{u.set("popupElement",e)},[u]),D=(0,N.useRenderElement)("div",e,{state:F,ref:[t,u.context.popupRef,j],props:[R,{"aria-labelledby":E,"aria-describedby":O,onKeyDown(e){c&&ea.COMPOSITE_KEYS.has(e.key)&&e.stopPropagation()}},(0,ee.getDisabledMountTransitionStyles)(h),l],stateAttributesMapping:ec});return(0,n.jsx)(eo.FloatingFocusManager,{context:y,openInteractionType:v,modal:!1!==b&&g,disabled:!x||T===C.REASONS.triggerHover,initialFocus:w,returnFocus:a,restoreFocus:"popup",previousFocusableElement:(0,en.isHTMLElement)(I)?I:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:(0,n.jsx)(ep,{value:d,children:D})})}),eg=r.forwardRef(function(e,t){let{className:n,render:o,...r}=e,{store:i}=f(),s=i.useState("open"),{arrowRef:a,side:l,align:u,arrowUncentered:p,arrowStyles:c}=J();return(0,N.useRenderElement)("div",e,{state:{open:s,side:l,align:u,uncentered:p},ref:[t,a],props:[{style:c,"aria-hidden":!0},r],stateAttributesMapping:F.popupStateMapping})}),ef={...F.popupStateMapping,...ei.transitionStatusMapping},eS=r.forwardRef(function(e,t){let{className:n,render:o,...r}=e,{store:i}=f(),s=i.useState("open"),a=i.useState("mounted"),l=i.useState("transitionStatus"),u=i.useState("openChangeReason");return(0,N.useRenderElement)("div",e,{state:{open:s,transitionStatus:l},ref:[i.context.backdropRef,t],props:[{role:"presentation",hidden:!a,style:{pointerEvents:u===C.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},r],stateAttributesMapping:ef})}),ev=r.forwardRef(function(e,t){let{render:n,className:o,...r}=e,{store:i}=f(),s=(0,B.useBaseUiId)(r.id);return(0,Y.useIsoLayoutEffect)(()=>(i.set("titleElementId",s),()=>{i.set("titleElementId",void 0)}),[i,s]),(0,N.useRenderElement)("h2",e,{ref:t,props:[{id:s},r]})}),em=r.forwardRef(function(e,t){let{render:n,className:o,...r}=e,{store:i}=f(),s=(0,B.useBaseUiId)(r.id);return(0,Y.useIsoLayoutEffect)(()=>(i.set("descriptionElementId",s),()=>{i.set("descriptionElementId",void 0)}),[i,s]),(0,N.useRenderElement)("p",e,{ref:t,props:[{id:s},r]})}),eh=r.forwardRef(function(e,t){let n,{render:o,className:i,disabled:s=!1,nativeButton:a=!0,...l}=e,{buttonRef:u,getButtonProps:p}=(0,w.useButton)({disabled:s,focusableWhenDisabled:!1,native:a}),{store:c}=f();return n=r.useContext(eu),(0,Y.useIsoLayoutEffect)(()=>n?.register(),[n]),(0,N.useRenderElement)("button",e,{ref:[t,u],props:[{onClick(e){c.setOpen(!1,(0,y.createChangeEventDetails)(C.REASONS.closePress,e.nativeEvent,e.currentTarget))}},l,p]})}),eR=((t={}).popupWidth="--popup-width",t.popupHeight="--popup-height",t);var eE=e.i(203667);let eC={activationDirection:e=>e?{"data-activation-direction":e}:null},eO=r.forwardRef(function(e,t){let{render:n,className:o,children:r,...i}=e,{store:s}=f(),{side:a}=J(),l=s.useState("instantType"),{children:u,state:p}=(0,eE.usePopupViewport)({store:s,side:a,cssVars:eR,children:r}),c={activationDirection:p.activationDirection,transitioning:p.transitioning,instant:l};return(0,N.useRenderElement)("div",e,{state:c,ref:t,props:[i,{children:u}],stateAttributesMapping:eC})});class eb{constructor(){this.store=new I}open(e){let t=e?this.store.context.triggerElements.getById(e)??void 0:void 0;if(e&&!t)throw Error((0,d.default)(80,e));this.store.setOpen(!0,(0,y.createChangeEventDetails)(C.REASONS.imperativeAction,void 0,t))}close(){this.store.setOpen(!1,(0,y.createChangeEventDetails)(C.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.state.open}}e.s(["Arrow",0,eg,"Backdrop",0,eS,"Close",0,eh,"Description",0,em,"Handle",0,eb,"Popup",0,ed,"Portal",0,z,"Positioner",0,et,"Root",0,function(e){return f(!0)?(0,n.jsx)(M,{props:e}):(0,n.jsx)(p.FloatingTree,{children:(0,n.jsx)(M,{props:e})})},"Title",0,ev,"Trigger",0,G,"Viewport",0,eO,"createHandle",0,function(){return new eb}],107641);var ex=e.i(107641),ex=ex;e.s(["Popover",0,function({...e}){return(0,n.jsx)(ex.Root,{"data-slot":"popover",...e})},"PopoverContent",0,function({className:e,align:t="center",alignOffset:r=0,side:i="bottom",sideOffset:s=4,...a}){return(0,n.jsx)(ex.Portal,{children:(0,n.jsx)(ex.Positioner,{align:t,alignOffset:r,side:i,sideOffset:s,className:"isolate z-50",children:(0,n.jsx)(ex.Popup,{"data-slot":"popover-content",className:(0,o.cn)("z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a})})})},"PopoverTrigger",0,function({...e}){return(0,n.jsx)(ex.Trigger,{"data-slot":"popover-trigger",...e})}],337822)}]);