tower-studio 0.2.43 → 0.2.44
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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +35 -35
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/adapters/test/route.js +2 -2
- package/.next/standalone/.next/server/app/api/adapters/test/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/attachments/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/backup/import/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/install/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/session/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js +1 -1
- package/.next/standalone/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/monaco/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/buffer/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/input/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/paste-image/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js +3 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/resume/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js +4 -5
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js +3 -4
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/stop/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/diff-patch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js +3 -2
- package/.next/standalone/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +72 -72
- package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +35 -35
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +35 -35
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +52 -52
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +103 -103
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +90 -90
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +69 -69
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +83 -83
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +35 -35
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +71 -71
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +91 -91
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +48 -48
- package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/{_0keginv._.js → 0se9_next_0cuhhky._.js} +3 -3
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_03qwlhl.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_09pca3o.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +3 -0
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0h5yr8p.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0m8aavq.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yp430z.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0yzw48x.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-z_a1d._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.zmhk-._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04--bs7._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04m2l8a._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04r193~._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06ndn7a._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__08yqoti._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09arklv._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_d.s7s._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0ajay8_._.js → [root-of-the-server]__0_zfnj0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0clptds._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g.k9o~._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gn0ubd._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gwztza._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i34gbs._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i~3dwq._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k-5ag7._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l1-djp._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0pl.c5.._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0r~9.7c._.js +4 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t31ba_._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t_weyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uptkzd._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xot7fu._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0y8w5di._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__075a0hk._.js → [root-of-the-server]__0zi3~a8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~g6-c~._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1189rd1._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0qk_esg._.js +2 -2
- package/.next/standalone/.next/server/chunks/_0t31z6q._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0fq3zjg._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0wlyw0g._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0~ey84y._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0se9_next_11h0sx_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0xr45lx._.js → [root-of-the-server]__01fmnse._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__01vm_46._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__025ol9g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__08k-xb7._.js → [root-of-the-server]__049n47u._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05xg05r._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07xkj1s._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12ko8p6._.js → [root-of-the-server]__081e5n~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ecd_1d._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0iln7n_._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lws68d._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0oamph.._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__00dh103._.js → [root-of-the-server]__0ugledi._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0stlq2_._.js → [root-of-the-server]__0vxlsec._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__065f3ii._.js → [root-of-the-server]__0w0.sdz._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xwzk2.._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0yby8pl._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0gkid_a._.js → _02vz78l._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_00odlgv._.js → _04~mjmb._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_05a2u03._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_07q06~v._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_08bq4g8._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0rrs.-d._.js → _0_nhdgs._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0_q41~z._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0dxbp89._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_047dh-f._.js → _0foto06._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_05k76ur._.js → _0i4xdso._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0uryq~z._.js → _0kojxno._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0oeih09._.js → _0r4_qn~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_00l85fp._.js → _0u3yt.5._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0wqcz3w._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0463zy~._.js → _0ye1-r-._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0syb503._.js → _0zr81mw._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0b7smy6._.js → _11osha9._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_notes_notes-page-client_tsx_10gyo3v._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_components_ui_select_tsx_0d2ra01._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_worktree_ts_06cucy3._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +290 -290
- package/.next/standalone/.next/static/chunks/{0~prx0ure_1i6.js → 0-tuek2jqf0el.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0evfu1ozaw5ak.js → 0.-.jc~0b~hy0.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0rnitheqdpd1..js → 0.~03w.uxge40.js} +1 -1
- package/.next/standalone/.next/static/chunks/01hdj_kw4z2zq.js +2 -0
- package/.next/standalone/.next/static/chunks/{08i9.47-_mxro.js → 0346xrw6i2bwo.js} +1 -1
- package/.next/standalone/.next/static/chunks/041o.dh2lc-k3.js +1 -0
- package/.next/standalone/.next/static/chunks/{070fs6rmafi.i.js → 08ooaq~-.8fzu.js} +1 -1
- package/.next/standalone/.next/static/chunks/{05v-c3ir3ik_1.js → 0bylodlncwfpb.js} +1 -1
- package/.next/standalone/.next/static/chunks/{00z.kuqsfrxq5.js → 0clewc5ifaruu.js} +2 -2
- package/.next/standalone/.next/static/chunks/0cpwtqzrjdgvs.js +1 -0
- package/.next/standalone/.next/static/chunks/0c~e1-nst-ze-.js +1 -0
- package/.next/standalone/.next/static/chunks/{0_yp-y9l0upp~.js → 0dv4anj-j523o.js} +1 -1
- package/.next/standalone/.next/static/chunks/{04op7bjge~n4l.js → 0gvfb.b8m_i8t.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0hk3lmsij2x1c.js → 0h77-u2vvr-a1.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0rfq8fy71hj7c.js → 0lqp~-dlfenad.js} +1 -1
- package/.next/standalone/.next/static/chunks/0qkr26yz3bocs.js +1 -0
- package/.next/standalone/.next/static/chunks/{0sr-m2t6vck14.js → 0rcuiuax31_uh.js} +1 -1
- package/.next/standalone/.next/static/chunks/0uf~7eqel0zra.js +1 -0
- package/.next/standalone/.next/static/chunks/{0ts___1ygewqp.js → 0uj-3ckujwaiy.js} +1 -1
- package/.next/standalone/.next/static/chunks/0w71r_sj_fibx.js +1 -0
- package/.next/standalone/.next/static/chunks/{0rjt_ddd~6t8r.js → 0xg6rcq6g4bbh.js} +1 -1
- package/.next/standalone/.next/static/chunks/0yff8rwmrl5m4.js +1 -0
- package/.next/standalone/.next/static/chunks/{0gq65t6au55oa.js → 0ymipmkk2uqby.js} +1 -1
- package/.next/standalone/.next/static/chunks/0znfclapbniaa.js +1 -0
- package/.next/standalone/.next/static/chunks/{0-vgfstmpuwnx.js → 11pe3kpxuj33f.js} +1 -1
- package/.next/standalone/.next/static/chunks/172s9cg35qt7i.js +1 -0
- package/.next/standalone/.next/static/chunks/{11p.r-9wyh7_2.js → 17m4o~gdsvuo3.js} +1 -1
- package/.next/standalone/.next/static/chunks/184-zu89wwa4u.js +1 -0
- package/.next/standalone/package.json +1 -1
- package/dist/mcp-server.cjs +21 -2
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__0m6hc.0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05abzth._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b25v3p._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h6bl6t._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q~uf3u._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wkjqrd._.js +0 -3
- package/.next/standalone/.next/static/chunks/0.lyp-cx3zt9..js +0 -2
- package/.next/standalone/.next/static/chunks/01rbl6a8z.tuw.js +0 -1
- package/.next/standalone/.next/static/chunks/0gz71w_~yw2iu.js +0 -1
- package/.next/standalone/.next/static/chunks/0j1hqwmeaqnn2.js +0 -1
- package/.next/standalone/.next/static/chunks/0prrt_bws8ml6.js +0 -1
- package/.next/standalone/.next/static/chunks/0qgqjy.9.-qpi.js +0 -1
- package/.next/standalone/.next/static/chunks/0vmy6tsqy.xf4.js +0 -1
- package/.next/standalone/.next/static/chunks/0wbq-_8jyxjxm.js +0 -1
- package/.next/standalone/.next/static/chunks/1107zshxaajt9.js +0 -1
- package/.next/standalone/.next/static/chunks/11x3_612u8w~9.js +0 -1
- package/.next/standalone/.next/static/chunks/14mk_a0k99wbg.js +0 -1
- /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{d-Uhp63kgWdPkhPt7Fzyb → dinNvsaC6aoPK_B7ZTeBv}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[473935,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(634910),f=a.i(774881),g=a.i(573242),h=a.i(577565),i=a.i(283857),j=a.i(699570),k=a.i(866718),l=a.i(580701),m=a.i(785259),n=a.i(951192);function o({searchQuery:a,onSearchChange:c,versions:d=[],versionFilter:p="all",onVersionFilterChange:q,versionsHref:r,onCreateTask:s}){let t,{t:u}=(0,n.useI18n)(),v="all"===p?u("board.allVersions"):"backlog"===p?u("board.backlogFilter"):(t=d.find(a=>a.id===p))?`${t.number} ${t.name}`:u("board.allVersions");return(0,b.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[q&&(0,b.jsxs)(l.Select,{value:p,onValueChange:a=>q(a||"all"),children:[(0,b.jsxs)(l.SelectTrigger,{className:"h-8 w-44 shrink-0 gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(h.GitBranch,{className:"h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:v})]}),(0,b.jsxs)(l.SelectContent,{children:[(0,b.jsx)(l.SelectItem,{value:"all",children:u("board.allVersions")}),(0,b.jsx)(l.SelectItem,{value:"backlog",children:u("board.backlogFilter")}),d.map(a=>(0,b.jsxs)(l.SelectItem,{value:a.id,children:[(0,b.jsx)("span",{className:"font-mono",children:a.number})," ",a.name]},a.id))]})]}),(0,b.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,b.jsx)(g.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(k.Input,{type:"text",value:a,onChange:a=>c(a.target.value),placeholder:u("board.searchPlaceholder"),className:"pl-8 pr-3 text-xs"})]}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",children:(0,b.jsx)(i.Lightbulb,{className:"h-4 w-4"})})}),(0,b.jsx)(m.TooltipContent,{side:"bottom",className:"max-w-xs",children:u("board.tipText")})]}),r&&(0,b.jsx)(e.default,{href:r,children:(0,b.jsxs)(j.Button,{variant:"outline",className:"h-8 gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(h.GitBranch,{className:"h-3.5 w-3.5"}),u("version.timeline")]})}),(0,b.jsxs)(j.Button,{"data-tour":"create-task",variant:"outline",className:"gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:s,children:[(0,b.jsx)(f.Plus,{className:"h-3.5 w-3.5"}),u("board.newTask")]})]})]})}var p=a.i(986099),q=a.i(668116),r=a.i(521007);function s({x:a,y:e,taskId:f,currentStatus:g,hasExecutions:h,workspaceId:i,onClose:j,onStatusChange:k,onLaunch:l}){let{t:m}=(0,n.useI18n)(),o=(0,d.useRouter)(),t=(0,c.useRef)(null);(0,c.useEffect)(()=>{let a=a=>{t.current&&!t.current.contains(a.target)&&j()},b=a=>{"Escape"===a.key&&j()};return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)}},[j]);let u="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",v=(0,b.jsxs)("div",{ref:t,style:{position:"fixed",top:e,left:a,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,b.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:m("board.contextMenu.changeStatus")}),r.BOARD_COLUMNS.map(a=>(0,b.jsxs)("button",{type:"button",className:u,onClick:()=>{k(f,a.id),j()},children:[g===a.id?(0,b.jsx)(q.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,b.jsx)("span",{className:"w-5 flex-shrink-0"}),a.label]},a.id)),(0,b.jsx)("hr",{className:"my-1 border-border"}),(0,b.jsx)("button",{type:"button",className:`${u} ${h?"opacity-50 cursor-not-allowed":""}`,disabled:h,onClick:()=>{h||(l(f),j())},children:m("board.contextMenu.launch")}),"DONE"!==g&&"CANCELLED"!==g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("hr",{className:"my-1 border-border"}),(0,b.jsx)("button",{type:"button",className:u,onClick:()=>{o.push(`/workspaces/${i}/tasks/${f}`),j()},children:m("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,p.createPortal)(v,document.body)}var t=a.i(643228),u=a.i(859103),v=a.i(651571),w=a.i(514126),x=a.i(336771),y=a.i(690251),z=a.i(975231),A=a.i(711796);let B=(0,A.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var C=a.i(786304),D=a.i(335732),E=a.i(551578);function F({task:a,onClick:c,onEdit:d,onDelete:e,onTogglePin:f,onContextMenu:g}){let{t:i}=(0,n.useI18n)(),{attributes:k,listeners:l,setNodeRef:o,transform:p,transition:q,isDragging:s}=(0,u.useSortable)({id:a.id,data:{type:"task",task:a}}),t={transform:w.CSS.Transform.toString(p),transition:q,opacity:s?.4:1},v=r.PRIORITY_CONFIG[a.priority],A=!!a.baseBranch;return(0,b.jsxs)("div",{ref:o,style:t,...k,...l,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:c,onContextMenu:b=>{b.preventDefault(),b.stopPropagation(),g?.(a,b.clientX,b.clientY)},"data-testid":"task-card",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsx)("h4",{className:"text-sm font-medium text-foreground",children:a.title}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${a.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:b=>{b.stopPropagation(),f?.(a.id)},"aria-label":i(a.pinned?"board.unpin":"board.pin"),children:(0,b.jsx)(B,{className:`h-3.5 w-3.5 ${a.pinned?"-rotate-45":""}`})}),(0,b.jsxs)(D.DropdownMenu,{children:[(0,b.jsx)(D.DropdownMenuTrigger,{render:(0,b.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:a=>a.stopPropagation()}),children:(0,b.jsx)(x.MoreHorizontal,{className:"h-4 w-4"})}),(0,b.jsxs)(D.DropdownMenuContent,{align:"end",children:[(0,b.jsxs)(D.DropdownMenuItem,{onClick:b=>{b.stopPropagation(),d?.(a)},children:[(0,b.jsx)(y.Pencil,{className:"mr-2 h-3.5 w-3.5"}),i("common.edit")]}),(0,b.jsxs)(D.DropdownMenuItem,{className:"text-rose-400",onClick:b=>{b.stopPropagation(),e?.(a.id)},children:[(0,b.jsx)(z.Trash2,{className:"mr-2 h-3.5 w-3.5"}),i("common.delete")]})]})]})]})]}),a.description&&(0,b.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:a.description}),(0,b.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)(C.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${v.color}`,children:v.label}),a.labels?.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:a.label.color+"20",color:a.label.color},children:a.label.name},a.label.id)),(A||a.version)&&(0,b.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[A&&(0,b.jsxs)(m.Tooltip,{disableHoverablePopup:!0,children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)("span",{className:"inline-flex cursor-default items-center rounded-md border border-border bg-muted px-1 py-0.5 text-muted-foreground",onPointerDown:a=>a.stopPropagation(),children:(0,b.jsx)(h.GitBranch,{className:"h-2.5 w-2.5 shrink-0"})})}),(0,b.jsx)(m.TooltipContent,{side:"top",children:i("board.card.worktree",{branch:a.baseBranch??""})})]}),a.version&&(0,b.jsxs)(m.Tooltip,{disableHoverablePopup:!0,children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)("span",{className:"cursor-default",onPointerDown:a=>a.stopPropagation(),children:(0,b.jsx)(E.TaskVersionTag,{number:a.version.number,title:""})})}),(0,b.jsx)(m.TooltipContent,{side:"top",children:i("board.card.version",{number:a.version.number,name:a.version.name})})]})]})]})]})}var G=a.i(814574),H=a.i(269876);function I({open:a,onOpenChange:c,columnLabel:d,columnColor:e,tasks:f,onTaskClick:g}){let{t:h}=(0,n.useI18n)();return(0,b.jsx)(G.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(G.DialogContent,{className:"sm:max-w-6xl max-h-[80vh]",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsxs)(G.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${e}`}),(0,b.jsx)("span",{children:d}),(0,b.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:f.length})]})}),(0,b.jsx)(H.ScrollArea,{className:"max-h-[680px]",children:(0,b.jsxs)("div",{className:"grid grid-cols-4 gap-3 pr-3",children:[f.map(a=>{let d=r.PRIORITY_CONFIG[a.priority];return(0,b.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{g?.(a),c(!1)},children:[(0,b.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:a.title}),a.description&&(0,b.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:a.description}),(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,b.jsx)(C.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${d.color}`,children:d.label}),a.labels?.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:a.label.color+"20",color:a.label.color},children:a.label.name},a.label.id))]})]},a.id)}),0===f.length&&(0,b.jsx)("div",{className:"col-span-4 py-8 text-center text-sm text-muted-foreground",children:h("board.noTasks")})]})})]})})}function J({id:a,label:d,color:e,tasks:g,onTaskClick:h,onEditTask:i,onAddTask:k,onDeleteTask:l,onTogglePin:m,onContextMenu:o}){let{setNodeRef:p,isOver:q}=(0,t.useDroppable)({id:a}),[r,s]=(0,c.useState)(!1),{t:w}=(0,n.useI18n)();return(0,b.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${q?"bg-primary/[0.06]":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`h-2 w-2 rounded-full ${e}`}),(0,b.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:d}),(0,b.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:g.length})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>s(!0),className:"text-muted-foreground","aria-label":w("board.viewAll"),children:(0,b.jsx)(v.LayoutGrid,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:k,className:"text-muted-foreground","aria-label":"add",children:(0,b.jsx)(f.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,b.jsx)(I,{open:r,onOpenChange:s,columnLabel:d,columnColor:e,tasks:g,onTaskClick:h}),(0,b.jsx)(H.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)("div",{ref:p,className:"flex flex-col gap-2 p-2",children:(0,b.jsx)(u.SortableContext,{items:g.map(a=>a.id),strategy:u.verticalListSortingStrategy,children:g.map(a=>(0,b.jsx)(F,{task:a,onClick:()=>h?.(a),onEdit:i,onDelete:l,onTogglePin:m,onContextMenu:o},a.id))})})})]})}function K({initialTasks:a,onTaskMove:d,onTaskClick:e,onEditTask:f,onAddTask:g,onDeleteTask:h,onTogglePin:i,onContextMenuStatusChange:j,onContextMenuLaunch:k,workspaceId:l}){let[m,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(null),[q,u]=(0,c.useState)(null);(0,c.useEffect)(()=>{n(a)},[a]);let v=(0,t.useSensors)((0,t.useSensor)(t.PointerSensor,{activationConstraint:{distance:8}})),w=(0,c.useCallback)((a,b,c)=>{u({task:a,x:b,y:c})},[]),x=(0,c.useCallback)(a=>{let b=m.find(b=>b.id===a.active.id);b&&p(b)},[m]),y=(0,c.useCallback)(a=>{let b,{active:c,over:e}=a;if(p(null),!e)return;let f=c.id,g=e.id;if(r.BOARD_COLUMNS.some(a=>a.id===g))b=g;else{let a=m.find(a=>a.id===g);b=a?.status}b&&(n(a=>a.map(a=>a.id===f?{...a,status:b}:a)),d?.(f,b))},[m,d]);return(0,b.jsxs)(t.DndContext,{id:"kanban-board",sensors:v,collisionDetection:t.closestCorners,onDragStart:x,onDragEnd:y,children:[(0,b.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:r.BOARD_COLUMNS.map(a=>(0,b.jsx)(J,{id:a.id,label:a.label,color:a.color,tasks:m.filter(b=>b.status===a.id),onTaskClick:e,onEditTask:f,onAddTask:()=>g?.(a.id),onDeleteTask:h,onTogglePin:i,onContextMenu:w},a.id))}),(0,b.jsx)(t.DragOverlay,{children:o?(0,b.jsx)("div",{className:"rotate-3 scale-105",children:(0,b.jsx)(F,{task:o})}):null}),q&&(0,b.jsx)(s,{x:q.x,y:q.y,taskId:q.task.id,currentStatus:q.task.status,hasExecutions:(q.task._count?.executions??0)>0,workspaceId:l??"",onClose:()=>u(null),onStatusChange:(a,b)=>{j?.(a,b),u(null)},onLaunch:a=>{k?.(a),u(null)}})]})}var L=a.i(445798);function M(a,b,c){return Math.min(Math.max(a,b),c)}var N=a.i(442620),O=a.i(10390),P=a.i(350739),Q=a.i(347165);let R=(0,A.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var S=a.i(616335),T=a.i(704494),U=a.i(394259),V=a.i(625892),W=a.i(939859),X=a.i(648512),Y=a.i(22761),Z=a.i(429246),$=a.i(780410);let _=(0,$.createServerReference)("60afc06d7056cfe1f2341b6cb7bc774def200b6e88",$.callServer,void 0,$.findSourceMapURL,"updateProject");var aa=a.i(423475);let ab=(0,$.createServerReference)("4025d13e67adcf768717d4db56ec8a3834a4427a53",$.callServer,void 0,$.findSourceMapURL,"deleteProject"),ac=(0,$.createServerReference)("40fe7b21373858c2795d873d54bc2d8bdacb1cfb56",$.callServer,void 0,$.findSourceMapURL,"getRecentLocalProjects"),ad=(0,$.createServerReference)("405b0f453e365f327c07a3ac1594d18f6ea74a8d24",$.callServer,void 0,$.findSourceMapURL,"getOrCreateTowerTaskId");var ae=a.i(67800),af=a.i(879499),ag=a.i(834888),ah=a.i(578942),ai=a.i(952313),aj=a.i(43775),ak=a.i(487410);function al({commits:a}){let{t:d}=(0,n.useI18n)(),[e,f]=(0,c.useState)(!1);return 0===a.length?null:(0,b.jsxs)("div",{className:"border-b border-border",children:[(0,b.jsxs)("button",{onClick:()=>f(!e),className:"flex w-full items-center gap-1 px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[e?(0,b.jsx)(N.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(O.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d("git.commitLog")," (",a.length,")"]})]}),e&&(0,b.jsx)("div",{className:"mt-0.5 mb-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:a.map(a=>(0,b.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,b.jsx)(R,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:a.message}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,b.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(a.shortHash),ai.toast.success(`Copied ${a.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[a.shortHash,(0,b.jsx)(Y.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:a.author}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m`;let c=Math.floor(b/60);if(c<24)return`${c}h`;let d=Math.floor(c/24);return d<30?`${d}d`:`${Math.floor(d/30)}mo`}(a.date)})]})]})]},a.hash))})]})}var am=a.i(607219),an=a.i(324263),ao=a.i(7285);function ap({localPath:a,stashes:d,hasChanges:e,onRefresh:f}){let{t:g}=(0,n.useI18n)(),[h,i]=(0,c.useState)(!1),[l,m]=(0,c.useState)(!1),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(null),s=async()=>{m(!0);try{await (0,ao.gitAction)(a,"stash-save",{message:o}),p(""),ai.toast.success(g("git.stashSaved")),await f()}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}finally{m(!1)}},t=async b=>{r(b);try{await (0,ao.gitAction)(a,"stash-pop",{index:b}),ai.toast.success(g("git.stashApplied")),await f()}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}finally{r(null)}},u=async b=>{r(b);try{await (0,ao.gitAction)(a,"stash-drop",{index:b}),ai.toast.success(g("git.stashDropped")),await f()}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}finally{r(null)}};return e||0!==d.length?(0,b.jsxs)("div",{className:"border-b border-border",children:[(0,b.jsxs)("button",{onClick:()=>i(!h),className:"flex w-full items-center gap-1 px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[h?(0,b.jsx)(N.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(O.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[g("git.stash")," ",d.length>0&&`(${d.length})`]})]}),h&&(0,b.jsxs)("div",{className:"mt-0.5 mb-1.5 space-y-2",children:[e&&(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)(k.Input,{value:o,onChange:a=>p(a.target.value),placeholder:g("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:a=>"Enter"===a.key&&s()}),(0,b.jsx)(j.Button,{variant:"outline",size:"icon-sm",onClick:s,disabled:l,className:"shrink-0",children:l?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(am.Archive,{className:"h-3 w-3"})})]}),d.length>0&&(0,b.jsx)("div",{className:"space-y-0.5",children:d.map(a=>(0,b.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,b.jsx)(am.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:a.message||`stash@{${a.index}}`}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>t(a.index),disabled:q===a.index,className:"text-muted-foreground","aria-label":g("git.stashApply"),children:q===a.index?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(an.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>u(a.index),disabled:q===a.index,className:"text-rose-400","aria-label":g("git.stashDrop"),children:(0,b.jsx)(z.Trash2,{className:"h-3 w-3"})})]})]},a.index))})]})]}):null}var aq=a.i(985716);function ar({value:a,ariaLabel:d}){let{t:e}=(0,n.useI18n)(),[f,g]=(0,c.useState)(!1),h=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(a);else{let b=document.createElement("textarea");b.value=a,document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b)}g(!0),ai.toast.success(e("common.copied")),setTimeout(()=>g(!1),1500)}catch{ai.toast.error(e("common.copyFailed"))}};return(0,b.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/50 pl-3 pr-1 py-1.5",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:a,children:a}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d,onClick:h,children:f?(0,b.jsx)(q.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(Y.Copy,{className:"h-3 w-3"})})}),(0,b.jsx)(m.TooltipContent,{children:f?e("common.copied"):e("common.copy")})]})]})}function as({project:a,workspaceId:e}){let{t:f,locale:g}=(0,n.useI18n)(),i=(0,d.useRouter)(),{width:l,isDragging:o,startResize:p}=function(a){let{storageKey:b,defaultWidth:d,minWidth:e,maxWidth:f,edge:g="left"}=a,[h,i]=(0,c.useState)(d),[j,k]=(0,c.useState)(!1),l=(0,c.useRef)(null);(0,c.useEffect)(()=>{try{let a=window.localStorage.getItem(b),c=null==a?NaN:Number(a);Number.isFinite(c)&&i(M(c,e,f))}catch{}},[b,e,f]);let m=(0,c.useCallback)(a=>{let b=l.current;b&&i(function(a,b,c,d,e,f="left"){return M(a+("left"===f?b-c:c-b),d,e)}(b.width,b.x,a.clientX,e,f,g))},[e,f,g]),n=(0,c.useCallback)(()=>{l.current&&(l.current=null,k(!1),window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",n),i(a=>{try{window.localStorage.setItem(b,String(a))}catch{}return a}))},[m,b]),o=(0,c.useCallback)(a=>{a.preventDefault(),l.current={x:a.clientX,width:h},k(!0),window.addEventListener("pointermove",m),window.addEventListener("pointerup",n)},[h,m,n]);return(0,c.useEffect)(()=>()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",n)},[m,n]),{width:h,isDragging:j,startResize:o}}({storageKey:"tower:repo-sidebar-width",defaultWidth:288,minWidth:240,maxWidth:560,edge:"left"}),[q,r]=(0,c.useState)(!0),[s,t]=(0,c.useState)(!0),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(!1),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(!1),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(a.name),[L,Y]=(0,c.useState)(a.alias??""),[$,am]=(0,c.useState)(a.description??""),[an,ao]=(0,c.useState)(a.localPath??""),[at,au]=(0,c.useState)(a.projectType??"FRONTEND"),[av,aw]=(0,c.useState)([]);(0,c.useEffect)(()=>{ac(100).then(aw)},[]);let[ax,ay]=(0,c.useState)(!1),[az,aA]=(0,c.useState)(""),[aB,aC]=(0,c.useState)(""),[aD,aE]=(0,c.useState)(""),[aF,aG]=(0,c.useState)(""),[aH,aI]=(0,c.useState)("FRONTEND"),[aJ,aK]=(0,c.useState)(!1),[aL,aM]=(0,c.useState)(!1),[aN,aO]=(0,c.useState)(null),[aP,aQ]=(0,c.useState)(!1),[aR,aS]=(0,c.useState)(!1),aT=a=>{ai.toast.info(a)},aU=(0,c.useCallback)(async()=>{if(a.localPath){aQ(!0);try{let b=await fetch(`/api/git?path=${encodeURIComponent(a.localPath)}`);b.ok&&aO(await b.json())}catch{}finally{aQ(!1)}}},[a.localPath]);(0,c.useEffect)(()=>{aU()},[aU]);let aV=async()=>{if(a.localPath){aS(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:a.localPath})})).ok?(aT(f("git.initSuccess")),await aU()):aT(f("git.initFailed"))}catch{aT(f("git.initFailed"))}finally{aS(!1)}}},aW=(a,b)=>{i.push(`/workspaces/${a}?projectId=${b}`,{scroll:!1}),i.refresh()},aX=async()=>{if(aB.trim()){aK(!0);try{let a=await (0,aa.createProject)({name:aB.trim(),alias:aD.trim()||void 0,description:aF.trim()||void 0,localPath:az,projectType:aH,workspaceId:e});ay(!1),aW(e,a.id)}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}finally{aK(!1)}}},aY=async()=>{if(an&&!aL){aM(!0);try{let a=await (0,ah.analyzeProjectDirectory)(an.trim(),g);am(a)}catch{ai.toast.error(f("project.analyzeError"))}finally{aM(!1)}}},aZ=async()=>{try{await _(a.id,{name:J.trim(),alias:L.trim()||void 0,description:$.trim()||void 0,localPath:an.trim()||void 0,projectType:at}),i.refresh(),v(!1)}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}};return(0,b.jsxs)("aside",{className:"relative flex-shrink-0 border-l border-border bg-sidebar",style:{width:l},children:[(0,b.jsx)("div",{onPointerDown:p,className:`absolute left-0 top-0 z-20 h-full w-1 -translate-x-1/2 cursor-col-resize transition-colors hover:bg-primary/20 ${o?"bg-primary/40":"bg-transparent"}`,role:"separator","aria-orientation":"vertical","aria-label":f("sidebar.right.resize")}),(0,b.jsxs)("div",{className:"h-full overflow-y-auto",children:[(0,b.jsxs)("div",{className:"border-b border-border p-4",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("h2",{className:"text-base font-semibold text-foreground",children:a.name}),a.alias&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.alias})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{K(a.name),Y(a.alias??""),am(a.description??""),ao(a.localPath??""),v(!0)},className:"text-muted-foreground",children:(0,b.jsx)(y.Pencil,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{B(""),x(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,b.jsx)(z.Trash2,{className:"h-3.5 w-3.5"})})]})]}),a.description&&(0,b.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:a.description}),(0,b.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,b.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===a.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===a.type?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.GitBranch,{className:"h-3 w-3"}),f("sidebar.right.gitType")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P.FileText,{className:"h-3 w-3"}),f("sidebar.right.normalType")]})})}),a.gitUrl&&(0,b.jsx)("div",{className:"mt-3 space-y-1.5",children:(0,b.jsx)(ar,{value:a.gitUrl,ariaLabel:f("project.gitUrl")})}),a.localPath&&(0,b.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ae.openInFileManager)(a.localPath)}catch(a){console.error("openInFileManager failed:",a),ai.toast.error(f("git.openInFileManagerFailed"))}},children:(0,b.jsx)(V.FolderSearch,{className:"h-4 w-4"})})}),(0,b.jsx)(m.TooltipContent,{children:f("git.openInFileManager")})]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,af.openInEditor)(a.localPath)}catch(a){console.error("openInEditor failed:",a),ai.toast.error(f("git.openInEditorFailed"))}},children:(0,b.jsx)(W.Code,{className:"h-4 w-4"})})}),(0,b.jsx)(m.TooltipContent,{children:f("git.openInEditor")})]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ag.openInTerminal)(a.localPath)}catch(a){console.error("openInTerminal failed:",a),ai.toast.error(f("git.openInTerminalFailed"))}},children:(0,b.jsx)(X.Terminal,{className:"h-4 w-4"})})}),(0,b.jsx)(m.TooltipContent,{children:f("git.openInTerminal")})]})]}),(0,b.jsxs)(j.Button,{variant:"outline",className:"w-full h-9 gap-1.5 text-xs",disabled:E,onClick:async()=>{F(!0);try{let b=await ad(a.id);i.push(`/workspaces/${e}/tasks/${b}`)}catch{ai.toast.error(f("git.openStudioFailed"))}finally{F(!1)}},children:[E?(0,b.jsx)(T.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(Q.FolderOpen,{className:"h-3.5 w-3.5"}),f("git.openStudio")]})]})]}),(0,b.jsxs)("div",{className:"border-b border-border p-4",children:[(0,b.jsxs)(j.Button,{variant:"ghost",onClick:()=>r(!q),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f("git.section")}),q?(0,b.jsx)(N.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,b.jsx)(O.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),q&&(0,b.jsx)("div",{className:"mt-3",children:a.localPath?aP?(0,b.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,b.jsx)(T.Loader2,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)("span",{className:"ml-2 text-xs",children:f("git.loading")})]}):aN&&!aN.isGit?(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,b.jsx)(S.AlertCircle,{className:"h-3.5 w-3.5"}),(0,b.jsx)("p",{className:"text-xs",children:f("git.notInitialized")})]}),(0,b.jsxs)(j.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:aV,disabled:aR,children:[aR?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(R,{className:"h-3 w-3"}),f("git.initRepo")]})]}):aN?.isGit?(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsx)(aq.EditorGitPanel,{localPath:a.localPath,mode:"project"})}),(0,b.jsx)(al,{commits:aN.commits??[]}),(0,b.jsx)(ap,{localPath:a.localPath,stashes:aN.stashes??[],hasChanges:(aN.changedFiles??[]).length>0,onRefresh:aU})]}):null:(0,b.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,b.jsx)(S.AlertCircle,{className:"h-3.5 w-3.5"}),(0,b.jsx)("p",{className:"text-xs",children:f("git.noLocalPath")})]})})})]}),(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsxs)(j.Button,{variant:"ghost",onClick:()=>t(!s),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f("sidebar.right.browseRepo")}),s?(0,b.jsx)(N.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,b.jsx)(O.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),s&&(0,b.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,b.jsxs)(j.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>I(!0),children:[(0,b.jsx)(Q.FolderOpen,{className:"h-3.5 w-3.5"}),f("sidebar.right.browseRepo")]}),av.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:f("sidebar.right.recent")}),(0,b.jsx)("div",{className:"space-y-0.5",children:av.map(c=>(0,b.jsxs)("button",{onClick:()=>{c.id!==a.id&&aW(c.workspaceId,c.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${c.id===a.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===c.type?(0,b.jsx)(h.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,b.jsx)(Q.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:c.name}),c.localPath&&(0,b.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:c.localPath})]})]},c.id))})]})]})]})]}),(0,b.jsx)(G.Dialog,{open:u,onOpenChange:v,children:(0,b.jsxs)(G.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{children:f("project.edit")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(k.Input,{value:J,onChange:a=>K(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(ak.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:at,onChange:au})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(k.Input,{value:L,onChange:a=>Y(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(j.Button,{type:"button",variant:"ghost",onClick:aY,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!an||aL?"opacity-50":""}`,children:[aL?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(U.Sparkles,{className:"h-3 w-3"}),aL?f("project.analyzing"):f("project.genDesc")]})]}),(0,b.jsx)(Z.Textarea,{value:$,onChange:a=>am(a.target.value),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("div",{className:"mt-1.5 break-all rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:an||"—"})]})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>v(!1),children:f("common.cancel")}),(0,b.jsx)(j.Button,{onClick:aZ,disabled:!J.trim()||aL,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:f("common.save")})]})]})}),(0,b.jsx)(aj.FolderBrowserDialog,{open:H,onOpenChange:I,onSelect:a=>{u?ao(a):(a=>{let b=av.find(b=>b.localPath===a);if(b)return aW(b.workspaceId,b.id);let c=a.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";aA(a),aC(c),aE(""),aG(""),ay(!0)})(a)}}),(0,b.jsx)(G.Dialog,{open:ax,onOpenChange:ay,children:(0,b.jsxs)(G.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{children:f("topbar.newProject")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:az})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(k.Input,{value:aB,onChange:a=>aC(a.target.value),placeholder:f("project.namePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(ak.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:aH,onChange:aI})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(k.Input,{value:aD,onChange:a=>aE(a.target.value),placeholder:f("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsx)(Z.Textarea,{value:aF,onChange:a=>aG(a.target.value),placeholder:f("project.descPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>ay(!1),children:f("common.cancel")}),(0,b.jsxs)(j.Button,{onClick:aX,disabled:!aB.trim()||aJ,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[aJ?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,f("common.create")]})]})]})}),(0,b.jsx)(G.Dialog,{open:w,onOpenChange:a=>{x(a),a||B("")},children:(0,b.jsxs)(G.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{className:"text-rose-400",children:f("project.deleteTitle")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f("project.deleteWarning",{name:a.name})}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f("project.deleteIrreversible")}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.deleteConfirmLabel")}),(0,b.jsx)(k.Input,{value:A,onChange:a=>B(a.target.value),placeholder:f("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>x(!1),children:f("common.cancel")}),(0,b.jsxs)(j.Button,{variant:"destructive",disabled:A!==f("project.deleteConfirmText")||C,onClick:async()=>{D(!0);try{await ab(a.id),ai.toast.success(f("project.deleteSuccess")),i.push(`/workspaces/${e}`)}catch{ai.toast.error(f("project.deleteFailed"))}finally{D(!1),x(!1)}},children:[C&&(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),f("project.deleteButton")]})]})]})})]})}var at=a.i(963326),au=a.i(300141),av=a.i(913284),aw=a.i(269280),ax=a.i(368114);function ay({title:a,description:c,branch:d,baseBranch:e,version:f,hasConversation:g,updatedAt:i,openDir:k,onBack:l}){let{t:o}=(0,n.useI18n)();return(0,b.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(U.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,b.jsx)("span",{className:"text-xs font-semibold text-primary",children:o("taskDetail.title")})]}),(0,b.jsxs)(j.Button,{variant:"ghost",onClick:l,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,b.jsx)(aw.ArrowLeft,{className:"h-3.5 w-3.5"}),o("taskDetail.back")]})]}),(0,b.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:a}),c&&(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:c}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e?(0,b.jsxs)(C.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,b.jsx)(h.GitBranch,{className:"mr-1 h-3 w-3"}),e," · worktree"]}):d?(0,b.jsx)(C.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:o("taskDetail.directMode")}):null,f&&(0,b.jsx)(E.TaskVersionTag,{number:f.number,name:f.name,showName:!0}),g&&(0,b.jsx)(C.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:o("taskDetail.hasConversation")}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[o("taskDetail.updatedAt")," ",(0,ax.formatRelativeTime)(i)]}),k&&(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ae.openInFileManager)(k)}catch(a){console.error("openInFileManager failed:",a),ai.toast.error(o("git.openInFileManagerFailed"))}},children:(0,b.jsx)(V.FolderSearch,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(m.TooltipContent,{side:"bottom",children:o("git.openInFileManager")})]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,af.openInEditor)(k)}catch(a){console.error("openInEditor failed:",a),ai.toast.error(o("git.openInEditorFailed"))}},children:(0,b.jsx)(W.Code,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(m.TooltipContent,{side:"bottom",children:o("git.openInEditor")})]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ag.openInTerminal)(k)}catch(a){console.error("openInTerminal failed:",a),ai.toast.error(o("git.openInTerminalFailed"))}},children:(0,b.jsx)(X.Terminal,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(m.TooltipContent,{side:"bottom",children:o("git.openInTerminal")})]})]})]})]})}var az=a.i(639138),aA=a.i(88757),aB=a.i(347872),aC=a.i(832610),aD=a.i(339895),aE=a.i(118908),aF=a.i(608812),aG=a.i(297169),aH=a.i(958830),aI=a.i(475124),aJ=a.i(990184),aK=a.i(470702),aL=a.i(715525),aM=a.i(324954),aN=a.i(87339),aO=a.i(54384),aP=a.i(509405),aQ=a.i(419464),aR=a.i(534551),aS=a.i(153567),aT=a.i(743205),aU=a.i(859111),aV=a.i(462285),aW=a.i(532615),aX=a.i(894148),aY=a.i(510650),aZ=a.i(161181);let a$=/\.(txt|md|json)$/i;function a_({taskId:a,projectId:d}){let{t:e}=(0,n.useI18n)(),g=(0,c.useRef)(null),[h,i]=(0,c.useState)([]),[k,l]=(0,c.useState)([]),[m,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(null);async function A(){p.trim()&&(await (0,aQ.createNote)({title:p.trim(),content:r.trim(),projectId:d,taskId:a,category:"task"}),q(""),s(""),o(!1),(0,aR.getTaskNotes)(a).then(i))}async function B(a){await (0,aS.deleteNote)(a),i(b=>b.filter(b=>b.id!==a))}async function C(b){let c=b.target.files?.[0];if(c){u(!0);try{let b=new FormData;b.set("file",c),b.set("projectId",d),b.set("taskId",a),await (0,aU.uploadAsset)(b),(0,aT.getTaskAssets)(a).then(l)}finally{u(!1),g.current&&(g.current.value="")}}}async function D(a){await (0,aV.deleteAsset)(a),l(b=>b.filter(b=>b.id!==a))}function E(a){return(0,aZ.isImageAsset)(a.filename,a.mimeType)||a$.test(a.filename)}function F(a){E(a)?w(a):ai.toast.info(e("assets.previewNotSupported"))}async function G(a){try{let b=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a.path})});if(!b.ok){let a=await b.json().catch(()=>({}));ai.toast.error(a.error||"Failed to reveal file")}}catch{ai.toast.error("Failed to reveal file")}}(0,c.useEffect)(()=>{(0,aR.getTaskNotes)(a).then(i),(0,aT.getTaskAssets)(a).then(l)},[a]);let I=v?(0,aZ.isImageAsset)(v.filename,v.mimeType)?"image":a$.test(v.filename)?"text":null:null,J=k.filter(a=>(0,aZ.isImageAsset)(a.filename,a.mimeType)).map(a=>({id:a.id,url:(0,aZ.localPathToApiUrl)(a.path),filename:a.filename})),K=v?J.findIndex(a=>a.id===v.id):-1;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(H.ScrollArea,{className:"h-full",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,b.jsx)(P.FileText,{className:"h-3.5 w-3.5"}),e("taskPage.notes")]}),(0,b.jsxs)(j.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>o(!m),children:[m?(0,b.jsx)(aO.X,{className:"h-3 w-3"}):(0,b.jsx)(f.Plus,{className:"h-3 w-3"}),m?"":e("taskPage.addNote")]})]}),m&&(0,b.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,b.jsx)("input",{type:"text",value:p,onChange:a=>q(a.target.value),placeholder:e("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,b.jsx)("textarea",{value:r,onChange:a=>s(a.target.value),placeholder:e("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,b.jsx)(j.Button,{className:"text-xs",onClick:A,disabled:!p.trim(),children:e("taskPage.addNote")})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-2",children:[0===h.length&&!m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:e("taskPage.noNotes")}),h.map(a=>(0,b.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>y(a),className:"min-w-0 flex-1 cursor-pointer text-left",title:e("taskPage.previewNote"),children:[(0,b.jsx)("h4",{className:"text-sm font-medium truncate hover:underline",children:a.title}),a.content&&(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:a.content}),(0,b.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(a.createdAt).toLocaleString()})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>y(a),className:"text-muted-foreground hover:bg-accent",title:e("taskPage.previewNote"),children:(0,b.jsx)(aP.Eye,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>B(a.id),className:"text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:e("taskPage.deleteNote"),children:(0,b.jsx)(z.Trash2,{className:"h-3.5 w-3.5"})})]})]})},a.id))]})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,b.jsx)(aN.Paperclip,{className:"h-3.5 w-3.5"}),e("taskPage.attachments")]}),(0,b.jsxs)(j.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>g.current?.click(),disabled:t,children:[(0,b.jsx)(aM.Upload,{className:"h-3 w-3"}),e("taskPage.uploadFile")]}),(0,b.jsx)("input",{ref:g,type:"file",className:"hidden",onChange:C})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===k.length&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:e("taskPage.noAttachments")}),k.map(a=>{var c;let d=E(a);return(0,b.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,b.jsx)(aN.Paperclip,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("button",{type:"button",onClick:()=>F(a),disabled:!d,className:`min-w-0 flex-1 truncate text-left text-sm ${d?"cursor-pointer hover:underline":"cursor-default"}`,title:d?e("assets.preview"):a.filename,children:a.filename}),(0,b.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(c=a.size)?c<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`:""}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[d&&(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>F(a),className:"shrink-0 text-muted-foreground hover:bg-accent",title:e("assets.preview"),children:(0,b.jsx)(aP.Eye,{className:"h-3 w-3"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>G(a),className:"shrink-0 text-muted-foreground hover:bg-accent",title:e("assets.revealInFinder"),children:(0,b.jsx)(Q.FolderOpen,{className:"h-3 w-3"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>D(a.id),className:"shrink-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:e("taskPage.deleteAttachment"),children:(0,b.jsx)(z.Trash2,{className:"h-3 w-3"})})]})]},a.id)})]})]})]})}),(0,b.jsx)(aW.ImageLightbox,{imageUrl:"image"===I&&K>=0?J[K].url:null,filename:"image"===I&&K>=0?J[K].filename:"",open:"image"===I,onOpenChange:a=>{a||w(null)},assets:J.map(({url:a,filename:b})=>({url:a,filename:b})),currentIndex:K>=0?K:void 0,onIndexChange:a=>{let b=J[a];if(!b)return;let c=k.find(a=>a.id===b.id);c&&w(c)}}),(0,b.jsx)(aX.TextPreviewDialog,{url:"text"===I&&v?(0,aZ.localPathToApiUrl)(v.path):null,filename:v?.filename??"",open:"text"===I,onOpenChange:a=>{a||w(null)}}),(0,b.jsx)(aY.NotePreviewDialog,{note:x,open:null!==x,onOpenChange:a=>{a||y(null)}})]})}function a0({task:a,workspaceId:e,projectLocalPath:f,onClose:g}){let{t:h}=(0,n.useI18n)(),i=(0,d.useRouter)(),{removePortal:k}=(0,aB.useTerminalPortal)(),[o,p]=(0,c.useState)("terminal"),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(a.status);(0,c.useEffect)(()=>{v(a.status)},[a.status]);let[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]);(0,c.useEffect)(()=>{x(null),z(!1),B(!1),D([]),r(null),p("terminal")},[a.id]);let[E,F]=(0,c.useState)([]),[G,I]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=!1;return(0,aK.getPrompts)().then(b=>{if(a)return;F(b.map(a=>({id:a.id,name:a.name,isDefault:a.isDefault})));let c=b.find(a=>a.isDefault);c&&I(c.id)}),()=>{a=!0}},[]),(0,c.useEffect)(()=>{x(null),B(!1);let b=!1;return(0,aC.getTaskExecutions)(a.id).then(a=>{if(b)return;let c=a[0];if(c?.status==="RUNNING"){let a=c.worktreePath||f||null;a&&x(a)}D(a.filter(a=>"RUNNING"!==a.status)),B(!0)}),()=>{b=!0}},[a.id]),(0,c.useEffect)(()=>{if("changes"!==o||"TODO"===u||"CANCELLED"===u)return;let b=!1;return t(!0),fetch(`/api/tasks/${a.id}/diff`).then(a=>{if(!a.ok)throw Error(`HTTP ${a.status}`);return a.json()}).then(a=>{b||r(a?.files||a?.branchDeleted?a:null)}).catch(()=>{b||r(null)}).finally(()=>{b||t(!1)}),()=>{b=!0}},[o,u,a.id]);let J=(0,c.useCallback)(async()=>{if(!y){z(!0),k(a.id);try{let b=await (0,aD.startPtyExecutionSafe)(a.id,"",G);if(!b.ok){z(!1),ai.toast.error(b.error||h("terminal.startFailed"));return}x(b.worktreePath??null),v("IN_PROGRESS")}catch(a){z(!1),ai.toast.error(a instanceof Error&&a.message?a.message:h("terminal.startFailed"))}}},[a.id,y,G,h]),K=(0,c.useCallback)(b=>{z(!1),x(null),k(a.id),0===b&&v("IN_REVIEW"),(0,aC.getTaskExecutions)(a.id).then(a=>{D(a.filter(a=>"RUNNING"!==a.status))}),i.refresh()},[i,a.id]),L=(0,c.useCallback)(async()=>{await (0,aE.stopPtyExecution)(a.id),z(!1),k(a.id),x(null),v("IN_REVIEW"),(0,aC.getTaskExecutions)(a.id).then(a=>{D(a.filter(a=>"RUNNING"!==a.status))}),i.refresh()},[a.id,i]),M=(0,c.useCallback)(async b=>{z(!0),k(a.id),x(null);try{let{worktreePath:c}=await (0,aF.resumePtyExecution)(a.id,b);x(c),v("IN_PROGRESS")}catch{z(!1)}},[a.id,k]),N=(0,c.useCallback)(async()=>{z(!0),k(a.id),x(null);try{let{worktreePath:b}=await (0,aG.continueLatestPtyExecution)(a.id);x(b),v("IN_PROGRESS")}catch(a){z(!1),ai.toast.error(a instanceof Error?a.message:String(a))}},[a.id,k]),[O,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)([]),U=(0,c.useCallback)(async()=>{try{let b=await (0,aI.checkWorktreeClean)(a.id);if(b.hasWorktree&&!b.clean)return void ai.toast.error(h("taskPage.uncommittedChanges",{count:String(b.files.length)}));if(b.hasWorktree&&b.clean&&!b.hasCommits)return void ai.toast.error(h("taskPage.noChangesToComplete"),{action:{label:h("taskPage.markAsCancelled"),onClick:()=>{(0,aH.updateTaskStatus)(a.id,"CANCELLED").then(()=>{v("CANCELLED"),ai.toast.success(h("taskPage.taskCancelled")),i.refresh()}).catch(()=>ai.toast.error("Failed to cancel task"))}}});if(b.hasWorktree&&b.hasCommits){S(b.commitLog),Q(!0);return}await (0,aH.updateTaskStatus)(a.id,"DONE"),v("DONE"),ai.toast.success(h("taskPage.taskCompleted")),i.refresh()}catch{ai.toast.error("Failed to complete task")}},[a.id,i,h]),V=(0,c.useCallback)(()=>{v("DONE"),Q(!1),ai.toast.success(h("taskPage.taskCompleted")),i.refresh()},[i,h]),W=(0,c.useCallback)(async b=>{try{let{hash:c}=await (0,aJ.commitWorktreeChanges)(a.id,b);ai.toast.success(h("diff.commitSuccess",{hash:c})),i.refresh();let d=await fetch(`/api/tasks/${a.id}/diff`);if(d.ok){let a=await d.json();r(a?.files?a:null)}}catch(a){ai.toast.error(a instanceof Error?a.message:"Commit failed")}},[a.id,i,h]);return(0,b.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,b.jsx)(ay,{title:a.title,description:h("taskDetail.panelDescription"),branch:`task/${a.id}`,baseBranch:a.baseBranch,version:a.version??null,hasConversation:!1,updatedAt:a.updatedAt,openDir:w??(f?a.subPath?`${f}/${a.subPath}`:f:null),onBack:g}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsxs)("button",{onClick:()=>p("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(X.Terminal,{className:"h-3 w-3"}),h("terminal.execute")]}),(0,b.jsx)("button",{onClick:()=>p("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:h("taskPage.changes")}),(0,b.jsxs)("button",{onClick:()=>p("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(P.FileText,{className:"h-3 w-3"}),h("taskPage.notes")]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===u&&(0,b.jsxs)(j.Button,{size:"sm",onClick:U,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,b.jsx)(av.CheckCircle2,{className:"h-3 w-3"}),h("taskPage.completeTask")]}),"DONE"!==u&&"CANCELLED"!==u&&(0,b.jsxs)(j.Button,{variant:"ghost",size:"sm",onClick:()=>i.push(`/workspaces/${e}/tasks/${a.id}`),className:"text-muted-foreground",children:[(0,b.jsx)(at.ExternalLink,{className:"h-3 w-3"}),h("taskPage.viewDetails")]})]})]}),"terminal"===o?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:A?w?(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,b.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),h("execution.running")]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsxs)(m.TooltipTrigger,{onClick:L,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,b.jsx)(au.Square,{className:"h-3 w-3"}),h("terminal.stopExecution")]}),(0,b.jsx)(m.TooltipContent,{side:"bottom",children:h("terminal.stopHint")})]})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0",children:(0,b.jsx)(aB.TerminalOutlet,{taskId:a.id,worktreePath:w,onSessionEnd:K})})]}):"DONE"===u||"CANCELLED"===u?(0,b.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,b.jsx)(H.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)(aL.ExecutionTimeline,{executions:C})})}):(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[E.length>0&&(0,b.jsxs)(l.Select,{defaultValue:G??"none",onValueChange:a=>I("none"===a?null:a),children:[(0,b.jsx)(l.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,b.jsx)("span",{className:"text-left truncate",children:G?E.find(a=>a.id===G)?.name??h("terminal.noPrompt"):h("terminal.noPrompt")})}),(0,b.jsxs)(l.SelectContent,{className:"min-w-[200px]",children:[(0,b.jsx)(l.SelectItem,{value:"none",children:h("terminal.noPrompt")}),E.map(a=>(0,b.jsxs)(l.SelectItem,{value:a.id,children:[a.name,a.isDefault?" ★":""]},a.id))]})]},`prompt-${E.length}`),(0,b.jsxs)(j.Button,{onClick:J,disabled:y,size:"sm",className:"gap-2 px-4",children:[y?(0,b.jsx)(T.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(X.Terminal,{className:"h-3.5 w-3.5"}),y?h("terminal.executing"):h("terminal.launch")]})]}),(0,b.jsx)(H.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)(aL.ExecutionTimeline,{executions:C,onResume:M,onContinueLatest:N})})]}):(0,b.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,b.jsx)(T.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,b.jsx)("span",{className:"text-xs text-neutral-500",children:h("execution.loading")})]})}):"changes"===o?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:s?(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.loadingDiff")})}):q?.branchDeleted?(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.branchDeleted")})}):q?(0,b.jsx)(az.TaskDiffView,{taskId:a.id,files:q.files,totalAdded:q.totalAdded,totalRemoved:q.totalRemoved,hasConflicts:q.hasConflicts,conflictFiles:q.conflictFiles,onCommit:W,hasUncommitted:q.hasUncommitted}):(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.noChanges")})})}):"notes"===o?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,b.jsx)(a_,{taskId:a.id,projectId:a.projectId})}):null,(0,b.jsx)(aA.TaskMergeConfirmDialog,{open:O,onOpenChange:Q,taskId:a.id,taskTitle:a.title,baseBranch:a.baseBranch??"main",fileCount:q?.files?.length??0,commitCount:q?.commitCount??0,commitLog:R,onMergeComplete:V})]})}var a1=a.i(112348),a2=a.i(160087);let a3=(0,$.createServerReference)("40f3ae25adfa0b6b2a8f0fb486c392b2077cc40b1e",$.callServer,void 0,$.findSourceMapURL,"deleteTask"),a4=(0,$.createServerReference)("40fa19b3b70f56f99dfcf7c747a9b904632dd8444e",$.callServer,void 0,$.findSourceMapURL,"toggleTaskPinned");var a5=a.i(422076);let a6=(0,$.createServerReference)("40eca0b77ac0e0d248f260235ee26006207f011e8d",$.callServer,void 0,$.findSourceMapURL,"getVersionsForPicker");var a7=a.i(258815),a8=a.i(912868);function a9({project:a,isActive:e,workspaceId:f,onSelect:g}){let{t:h}=(0,n.useI18n)(),i=(0,d.useRouter)(),k=a.totalTasks,l=a.runningTasks,o=k>0?Math.round(l/k*100):0,[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),t=async()=>{s(!0);try{let b=await ad(a.id);i.push(`/workspaces/${f}/tasks/${b}`)}catch{ai.toast.error(h("git.openStudioFailed"))}finally{s(!1)}},u=(0,b.jsxs)("button",{onClick:()=>{e||g(a.id)},className:`group flex w-[212px] shrink-0 items-center gap-2 rounded-lg border-b-2 px-3 py-1.5 text-left transition-colors ${e?"border-primary bg-primary/10 ring-1 ring-primary/20 cursor-default":`border-transparent cursor-pointer ${p?"bg-accent":"hover:bg-accent"}`}`,children:[(0,b.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,b.jsx)("span",{className:`w-full truncate text-sm font-medium leading-tight ${e?"text-primary":p?"text-foreground":"text-muted-foreground group-hover:text-foreground"}`,children:a.name}),a.alias&&(0,b.jsx)("span",{className:"w-full truncate text-[11px] font-normal leading-tight text-muted-foreground/70",children:a.alias})]}),(0,b.jsxs)("span",{className:"flex shrink-0 items-baseline rounded-md border border-border bg-card px-1.5 py-0.5 font-mono text-[11px] font-semibold leading-none",children:[(0,b.jsx)("span",{className:"text-amber-500 dark:text-amber-400",children:l}),(0,b.jsx)("span",{className:"mx-px text-muted-foreground/50",children:"/"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:k})]})]});return(0,b.jsxs)(m.Tooltip,{onOpenChange:q,children:[(0,b.jsx)(m.TooltipTrigger,{render:u}),(0,b.jsxs)(m.TooltipContent,{side:"bottom",hideArrow:!0,className:"flex w-[268px] max-w-none flex-col items-stretch gap-0 rounded-xl border border-border bg-card p-3.5 text-foreground shadow-lg",children:[(0,b.jsx)("div",{className:"text-[13px] font-bold leading-snug break-words",children:a.name}),a.alias&&(0,b.jsx)("div",{className:"mt-0.5 text-[11.5px] leading-relaxed text-muted-foreground break-words",children:a.alias}),(0,b.jsx)("div",{className:"my-2.5 h-px bg-border"}),(0,b.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-amber-500 dark:bg-amber-400"}),(0,b.jsx)("span",{className:"text-[13px] font-semibold",children:h("board.running")}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:h("board.runningDesc")}),(0,b.jsx)("span",{className:"ml-auto font-mono text-[15px] font-bold text-amber-500 dark:text-amber-400",children:l})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-sky-500 dark:bg-sky-400"}),(0,b.jsx)("span",{className:"text-[13px] font-semibold",children:h("board.overview")}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:h("board.totalDesc")}),(0,b.jsx)("span",{className:"ml-auto font-mono text-[15px] font-bold",children:k})]}),(0,b.jsx)("div",{className:"mt-2.5 h-[5px] overflow-hidden rounded-full bg-sky-500/15 dark:bg-sky-400/15",children:(0,b.jsx)("div",{className:"h-full rounded-full bg-amber-500 dark:bg-amber-400",style:{width:`${o}%`}})}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:h("board.badgeFormatHint")}),(0,b.jsxs)(j.Button,{variant:"outline",disabled:r,onClick:t,className:"h-6 shrink-0 gap-1 px-2 text-[11px]",children:[r?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(Q.FolderOpen,{className:"h-3 w-3"}),h("git.openStudio")]})]})]})]})}function ba({projects:a,activeProjectId:d,workspaceId:e,onSelect:f}){let g=(0,c.useRef)(null),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(!1),l=()=>{let a=g.current;a&&(i(a.scrollLeft>0),k(a.scrollLeft<a.scrollWidth-a.clientWidth-1))};(0,c.useEffect)(()=>{l();let a=g.current;if(a){a.addEventListener("scroll",l);let b=new ResizeObserver(l);return b.observe(a),()=>{a.removeEventListener("scroll",l),b.disconnect()}}},[a]);let m=a=>{let b=g.current;b&&b.scrollBy({left:"left"===a?-150:150,behavior:"smooth"})};return(0,b.jsxs)("div",{className:"relative flex items-center",children:[h&&(0,b.jsx)("button",{onClick:()=>m("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,b.jsx)(a8.ChevronLeft,{className:"h-4 w-4"})}),(0,b.jsx)("div",{ref:g,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:a.map(a=>(0,b.jsx)(a9,{project:a,isActive:d===a.id,workspaceId:e,onSelect:f},a.id))}),j&&(0,b.jsx)("button",{onClick:()=>m("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,b.jsx)(O.ChevronRight,{className:"h-4 w-4"})})]})}var bb=a.i(811344);function bc({open:a,onOpenChange:c,taskTitle:d,uncommittedFiles:e,commitLog:f,onConfirm:g}){let{t:h}=(0,n.useI18n)(),i=e.length,k=f.length,l=0===i&&0===k;return(0,b.jsx)(G.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(G.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsxs)(G.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(bb.AlertTriangle,{className:"h-4 w-4 text-amber-400"}),h("taskCancel.title")]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-3 space-y-1.5",children:[(0,b.jsx)("p",{className:"text-xs text-foreground",children:h("taskCancel.intro",{title:d})}),(0,b.jsx)("p",{className:"text-xs text-amber-300",children:h("taskCancel.irreversible")})]}),l?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h("taskCancel.cleanNotice")}):(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h("taskCancel.uncommittedFiles")}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h("taskCancel.unmergedCommits")}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:k})]})]}),i>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:h("taskCancel.filesList")}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:e.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),k>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:h("taskCancel.commitsList")}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:f.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1.5",children:h("taskCancel.reflogHint")})]})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>c(!1),children:h("taskCancel.keep")}),(0,b.jsxs)(j.Button,{variant:"destructive",onClick:g,className:"gap-2",children:[(0,b.jsx)(bb.AlertTriangle,{className:"h-4 w-4"}),h("taskCancel.confirm")]})]})]})})}a.s(["BoardPageClient",0,function({workspaceId:a,projectId:e,project:f,projects:g,initialTasks:h,labels:i,openTaskId:j}){let k=(0,d.useRouter)(),{t:l}=(0,n.useI18n)(),[,m]=(0,c.useTransition)(),[p,q]=(0,c.useState)(""),[s,t]=(0,c.useState)("all"),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)("TODO"),[y,z]=(0,c.useState)(j??null),[A,B]=(0,c.useState)([]),C=y?h.find(a=>a.id===y)??null:null,[D,E]=(0,c.useState)(null),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(null);(0,c.useEffect)(()=>{a6(e).then(B).catch(()=>B([]))},[e]),(0,c.useEffect)(()=>{(0,a7.setLastProjectId)(a,e)},[a,e]);let J=A.find(a=>a.isCurrent)?.id??null,M=(0,c.useCallback)(()=>{m(()=>{k.refresh()})},[k]);(0,c.useEffect)(()=>{if(u)return;let a=setInterval(()=>{m(()=>{k.refresh()})},5e3);return()=>clearInterval(a)},[k,u]);let N=(0,c.useCallback)(a=>{q(a)},[]),O=(0,c.useCallback)(async a=>{let b=h.find(b=>b.id===a);if(b)try{let c=await (0,aI.checkWorktreeClean)(a);if(c.hasWorktree&&!c.clean){ai.toast.error(l("taskPage.uncommittedChanges",{count:String(c.files.length)})),M();return}if(c.hasWorktree&&c.clean&&!c.hasCommits){ai.toast.error(l("taskPage.noChangesToComplete"),{action:{label:l("taskPage.markAsCancelled"),onClick:()=>{(0,aH.updateTaskStatus)(a,"CANCELLED").then(()=>{ai.toast.success(l("taskPage.taskCancelled")),M()}).catch(()=>ai.toast.error("Failed to cancel task"))}}}),M();return}if(c.hasWorktree&&c.hasCommits){G({task:b,commitLog:c.commitLog,commitCount:c.commitLog.length}),M();return}await (0,aH.updateTaskStatus)(a,"DONE"),ai.toast.success(l("taskPage.taskCompleted")),M()}catch{ai.toast.error("Failed to complete task"),M()}},[h,M,l]),P=(0,c.useCallback)(async a=>{let b=h.find(b=>b.id===a);if(b)try{let c=await (0,aI.checkWorktreeClean)(a);if(!c.hasWorktree){await (0,aH.updateTaskStatus)(a,"CANCELLED"),ai.toast.success(l("taskPage.taskCancelled")),M();return}I({task:b,files:c.files,commitLog:c.commitLog}),M()}catch{ai.toast.error("Failed to cancel task"),M()}},[h,M,l]),Q=(0,c.useCallback)(async(a,b)=>{"DONE"===b?await O(a):"CANCELLED"===b?await P(a):(await (0,aH.updateTaskStatus)(a,b),M())},[M,O,P]),R=(0,c.useCallback)(async a=>{let b=await (0,a1.createTask)({title:a.title,description:a.description,projectId:e,priority:a.priority,status:a.status,labelIds:a.labelIds,baseBranch:a.baseBranch,subPath:a.subPath,versionId:a.versionId??void 0});if(a.autoStart&&b?.id)try{await (0,a5.startPtyExecution)(b.id,""),z(b.id)}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}M()},[e,M]),S=(0,c.useCallback)(async(a,b)=>{await (0,a2.updateTask)(a,{...b,labelIds:b.labelIds}),E(null),M()},[M]),T=(0,c.useCallback)(async a=>{await a3(a),y===a&&z(null),M()},[M,y]),U=(0,c.useCallback)(async a=>{await a4(a),M()},[M]),V=(0,c.useCallback)(async b=>{try{await (0,a5.startPtyExecution)(b,"")}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}k.push(`/workspaces/${a}/tasks/${b}`)},[k,a]),W=(0,c.useCallback)(async(a,b)=>{"DONE"===b?await O(a):"CANCELLED"===b?await P(a):(await (0,aH.updateTaskStatus)(a,b),M())},[M,O,P]),X=(0,c.useCallback)(a=>{x(a),E(null),v(!0)},[]),Y=(0,c.useCallback)(a=>{E(a),v(!0)},[]),Z=h.filter(a=>!a.labels?.some(a=>a.label.name===r.TOWER_LABEL_NAME&&a.label.isBuiltin)).filter(a=>{if("backlog"===s){if(a.versionId)return!1}else if("all"!==s&&a.versionId!==s)return!1;if(p.trim()){let b=p.toLowerCase();if(!a.title.toLowerCase().includes(b)&&!a.description?.toLowerCase().includes(b))return!1}return!0});return(0,b.jsxs)("div",{className:"flex h-full",children:[(0,b.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,b.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,b.jsx)(ba,{projects:g,activeProjectId:e,workspaceId:a,onSelect:b=>k.push(`/workspaces/${a}?projectId=${b}`,{scroll:!1})})}),(0,b.jsx)(o,{searchQuery:p,onSearchChange:N,versions:A,versionFilter:s,onVersionFilterChange:t,versionsHref:`/workspaces/${a}/projects/${e}/versions`,onCreateTask:()=>{E(null),v(!0)}}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,b.jsx)(K,{initialTasks:Z,onTaskMove:Q,onTaskClick:a=>{z(a.id)},onEditTask:Y,onAddTask:X,onDeleteTask:T,onTogglePin:U,workspaceId:a,onContextMenuStatusChange:W,onContextMenuLaunch:V})}),(0,b.jsx)(L.CreateTaskDialog,{open:u,onOpenChange:a=>{v(a),a||E(null)},onSubmit:R,onUpdate:S,defaultStatus:w,editTask:D,editTaskLabelIds:D?.labels?D.labels.map(a=>a.labelId):[],labels:i.filter(a=>!(a.name===r.TOWER_LABEL_NAME&&a.isBuiltin)),projectType:f.type,projectLocalPath:f.localPath,versions:A,defaultVersionId:J})]}),C?(0,b.jsx)(a0,{task:C,workspaceId:a,projectLocalPath:f.localPath,onClose:()=>z(null)}):(0,b.jsx)(as,{project:f,workspaceId:a}),F&&(0,b.jsx)(aA.TaskMergeConfirmDialog,{open:!0,onOpenChange:a=>{a||G(null)},taskId:F.task.id,taskTitle:F.task.title,baseBranch:F.task.baseBranch??"main",fileCount:0,commitCount:F.commitCount,commitLog:F.commitLog,onMergeComplete:()=>{G(null),ai.toast.success(l("taskPage.taskCompleted")),M()}}),H&&(0,b.jsx)(bc,{open:!0,onOpenChange:a=>{a||I(null)},taskTitle:H.task.title,uncommittedFiles:H.files,commitLog:H.commitLog,onConfirm:()=>{let a=H.task.id;I(null),(0,aH.updateTaskStatus)(a,"CANCELLED").then(()=>{ai.toast.success(l("taskPage.taskCancelled")),M()}).catch(()=>ai.toast.error("Failed to cancel task"))}})]})}],473935)}];
|
|
1
|
+
module.exports=[473935,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(634910),f=a.i(774881),g=a.i(573242),h=a.i(577565),i=a.i(283857),j=a.i(699570),k=a.i(866718),l=a.i(580701),m=a.i(785259),n=a.i(951192);function o({searchQuery:a,onSearchChange:c,versions:d=[],versionFilter:p="all",onVersionFilterChange:q,versionsHref:r,onCreateTask:s}){let t,{t:u}=(0,n.useI18n)(),v="all"===p?u("board.allVersions"):"backlog"===p?u("board.backlogFilter"):(t=d.find(a=>a.id===p))?`${t.number} ${t.name}`:u("board.allVersions");return(0,b.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[q&&(0,b.jsxs)(l.Select,{value:p,onValueChange:a=>q(a||"all"),children:[(0,b.jsxs)(l.SelectTrigger,{className:"h-8 w-44 shrink-0 gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(h.GitBranch,{className:"h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:v})]}),(0,b.jsxs)(l.SelectContent,{children:[(0,b.jsx)(l.SelectItem,{value:"all",children:u("board.allVersions")}),(0,b.jsx)(l.SelectItem,{value:"backlog",children:u("board.backlogFilter")}),d.map(a=>(0,b.jsxs)(l.SelectItem,{value:a.id,children:[(0,b.jsx)("span",{className:"font-mono",children:a.number})," ",a.name]},a.id))]})]}),(0,b.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,b.jsx)(g.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)(k.Input,{type:"text",value:a,onChange:a=>c(a.target.value),placeholder:u("board.searchPlaceholder"),className:"pl-8 pr-3 text-xs"})]}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",children:(0,b.jsx)(i.Lightbulb,{className:"h-4 w-4"})})}),(0,b.jsx)(m.TooltipContent,{side:"bottom",className:"max-w-xs",children:u("board.tipText")})]}),r&&(0,b.jsx)(e.default,{href:r,children:(0,b.jsxs)(j.Button,{variant:"outline",className:"h-8 gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(h.GitBranch,{className:"h-3.5 w-3.5"}),u("version.timeline")]})}),(0,b.jsxs)(j.Button,{"data-tour":"create-task",variant:"outline",className:"gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:s,children:[(0,b.jsx)(f.Plus,{className:"h-3.5 w-3.5"}),u("board.newTask")]})]})]})}var p=a.i(986099),q=a.i(668116),r=a.i(521007);function s({x:a,y:e,taskId:f,currentStatus:g,hasExecutions:h,workspaceId:i,onClose:j,onStatusChange:k,onLaunch:l}){let{t:m}=(0,n.useI18n)(),o=(0,d.useRouter)(),t=(0,c.useRef)(null);(0,c.useEffect)(()=>{let a=a=>{t.current&&!t.current.contains(a.target)&&j()},b=a=>{"Escape"===a.key&&j()};return document.addEventListener("mousedown",a),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",b)}},[j]);let u="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",v=(0,b.jsxs)("div",{ref:t,style:{position:"fixed",top:e,left:a,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,b.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:m("board.contextMenu.changeStatus")}),r.BOARD_COLUMNS.map(a=>(0,b.jsxs)("button",{type:"button",className:u,onClick:()=>{k(f,a.id),j()},children:[g===a.id?(0,b.jsx)(q.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,b.jsx)("span",{className:"w-5 flex-shrink-0"}),a.label]},a.id)),(0,b.jsx)("hr",{className:"my-1 border-border"}),(0,b.jsx)("button",{type:"button",className:`${u} ${h?"opacity-50 cursor-not-allowed":""}`,disabled:h,onClick:()=>{h||(l(f),j())},children:m("board.contextMenu.launch")}),"DONE"!==g&&"CANCELLED"!==g&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("hr",{className:"my-1 border-border"}),(0,b.jsx)("button",{type:"button",className:u,onClick:()=>{o.push(`/workspaces/${i}/tasks/${f}`),j()},children:m("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,p.createPortal)(v,document.body)}var t=a.i(643228),u=a.i(859103),v=a.i(651571),w=a.i(514126),x=a.i(336771),y=a.i(690251),z=a.i(975231),A=a.i(711796);let B=(0,A.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var C=a.i(786304),D=a.i(335732),E=a.i(551578);function F({task:a,onClick:c,onEdit:d,onDelete:e,onTogglePin:f,onContextMenu:g}){let{t:i}=(0,n.useI18n)(),{attributes:k,listeners:l,setNodeRef:o,transform:p,transition:q,isDragging:s}=(0,u.useSortable)({id:a.id,data:{type:"task",task:a}}),t={transform:w.CSS.Transform.toString(p),transition:q,opacity:s?.4:1},v=r.PRIORITY_CONFIG[a.priority],A=!!a.baseBranch;return(0,b.jsxs)("div",{ref:o,style:t,...k,...l,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:c,onContextMenu:b=>{b.preventDefault(),b.stopPropagation(),g?.(a,b.clientX,b.clientY)},"data-testid":"task-card",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsx)("h4",{className:"text-sm font-medium text-foreground",children:a.title}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${a.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:b=>{b.stopPropagation(),f?.(a.id)},"aria-label":i(a.pinned?"board.unpin":"board.pin"),children:(0,b.jsx)(B,{className:`h-3.5 w-3.5 ${a.pinned?"-rotate-45":""}`})}),(0,b.jsxs)(D.DropdownMenu,{children:[(0,b.jsx)(D.DropdownMenuTrigger,{render:(0,b.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:a=>a.stopPropagation()}),children:(0,b.jsx)(x.MoreHorizontal,{className:"h-4 w-4"})}),(0,b.jsxs)(D.DropdownMenuContent,{align:"end",children:[(0,b.jsxs)(D.DropdownMenuItem,{onClick:b=>{b.stopPropagation(),d?.(a)},children:[(0,b.jsx)(y.Pencil,{className:"mr-2 h-3.5 w-3.5"}),i("common.edit")]}),(0,b.jsxs)(D.DropdownMenuItem,{className:"text-rose-400",onClick:b=>{b.stopPropagation(),e?.(a.id)},children:[(0,b.jsx)(z.Trash2,{className:"mr-2 h-3.5 w-3.5"}),i("common.delete")]})]})]})]})]}),a.description&&(0,b.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:a.description}),(0,b.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)(C.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${v.color}`,children:v.label}),a.labels?.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:a.label.color+"20",color:a.label.color},children:a.label.name},a.label.id)),(A||a.version)&&(0,b.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[A&&(0,b.jsxs)(m.Tooltip,{disableHoverablePopup:!0,children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)("span",{className:"inline-flex cursor-default items-center rounded-md border border-border bg-muted px-1 py-0.5 text-muted-foreground",onPointerDown:a=>a.stopPropagation(),children:(0,b.jsx)(h.GitBranch,{className:"h-2.5 w-2.5 shrink-0"})})}),(0,b.jsx)(m.TooltipContent,{side:"top",children:i("board.card.worktree",{branch:a.baseBranch??""})})]}),a.version&&(0,b.jsxs)(m.Tooltip,{disableHoverablePopup:!0,children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)("span",{className:"cursor-default",onPointerDown:a=>a.stopPropagation(),children:(0,b.jsx)(E.TaskVersionTag,{number:a.version.number,title:""})})}),(0,b.jsx)(m.TooltipContent,{side:"top",children:i("board.card.version",{number:a.version.number,name:a.version.name})})]})]})]})]})}var G=a.i(814574),H=a.i(269876);function I({open:a,onOpenChange:c,columnLabel:d,columnColor:e,tasks:f,onTaskClick:g}){let{t:h}=(0,n.useI18n)();return(0,b.jsx)(G.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(G.DialogContent,{className:"sm:max-w-6xl max-h-[80vh]",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsxs)(G.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${e}`}),(0,b.jsx)("span",{children:d}),(0,b.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:f.length})]})}),(0,b.jsx)(H.ScrollArea,{className:"max-h-[680px]",children:(0,b.jsxs)("div",{className:"grid grid-cols-4 gap-3 pr-3",children:[f.map(a=>{let d=r.PRIORITY_CONFIG[a.priority];return(0,b.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{g?.(a),c(!1)},children:[(0,b.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:a.title}),a.description&&(0,b.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:a.description}),(0,b.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,b.jsx)(C.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${d.color}`,children:d.label}),a.labels?.map(a=>(0,b.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:a.label.color+"20",color:a.label.color},children:a.label.name},a.label.id))]})]},a.id)}),0===f.length&&(0,b.jsx)("div",{className:"col-span-4 py-8 text-center text-sm text-muted-foreground",children:h("board.noTasks")})]})})]})})}function J({id:a,label:d,color:e,tasks:g,onTaskClick:h,onEditTask:i,onAddTask:k,onDeleteTask:l,onTogglePin:m,onContextMenu:o}){let{setNodeRef:p,isOver:q}=(0,t.useDroppable)({id:a}),[r,s]=(0,c.useState)(!1),{t:w}=(0,n.useI18n)();return(0,b.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${q?"bg-primary/[0.06]":""}`,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`h-2 w-2 rounded-full ${e}`}),(0,b.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:d}),(0,b.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:g.length})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>s(!0),className:"text-muted-foreground","aria-label":w("board.viewAll"),children:(0,b.jsx)(v.LayoutGrid,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:k,className:"text-muted-foreground","aria-label":"add",children:(0,b.jsx)(f.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,b.jsx)(I,{open:r,onOpenChange:s,columnLabel:d,columnColor:e,tasks:g,onTaskClick:h}),(0,b.jsx)(H.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)("div",{ref:p,className:"flex flex-col gap-2 p-2",children:(0,b.jsx)(u.SortableContext,{items:g.map(a=>a.id),strategy:u.verticalListSortingStrategy,children:g.map(a=>(0,b.jsx)(F,{task:a,onClick:()=>h?.(a),onEdit:i,onDelete:l,onTogglePin:m,onContextMenu:o},a.id))})})})]})}function K({initialTasks:a,onTaskMove:d,onTaskClick:e,onEditTask:f,onAddTask:g,onDeleteTask:h,onTogglePin:i,onContextMenuStatusChange:j,onContextMenuLaunch:k,workspaceId:l}){let[m,n]=(0,c.useState)(a),[o,p]=(0,c.useState)(null),[q,u]=(0,c.useState)(null);(0,c.useEffect)(()=>{n(a)},[a]);let v=(0,t.useSensors)((0,t.useSensor)(t.PointerSensor,{activationConstraint:{distance:8}})),w=(0,c.useCallback)((a,b,c)=>{u({task:a,x:b,y:c})},[]),x=(0,c.useCallback)(a=>{let b=m.find(b=>b.id===a.active.id);b&&p(b)},[m]),y=(0,c.useCallback)(a=>{let b,{active:c,over:e}=a;if(p(null),!e)return;let f=c.id,g=e.id;if(r.BOARD_COLUMNS.some(a=>a.id===g))b=g;else{let a=m.find(a=>a.id===g);b=a?.status}b&&(n(a=>a.map(a=>a.id===f?{...a,status:b}:a)),d?.(f,b))},[m,d]);return(0,b.jsxs)(t.DndContext,{id:"kanban-board",sensors:v,collisionDetection:t.closestCorners,onDragStart:x,onDragEnd:y,children:[(0,b.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:r.BOARD_COLUMNS.map(a=>(0,b.jsx)(J,{id:a.id,label:a.label,color:a.color,tasks:m.filter(b=>b.status===a.id),onTaskClick:e,onEditTask:f,onAddTask:()=>g?.(a.id),onDeleteTask:h,onTogglePin:i,onContextMenu:w},a.id))}),(0,b.jsx)(t.DragOverlay,{children:o?(0,b.jsx)("div",{className:"rotate-3 scale-105",children:(0,b.jsx)(F,{task:o})}):null}),q&&(0,b.jsx)(s,{x:q.x,y:q.y,taskId:q.task.id,currentStatus:q.task.status,hasExecutions:(q.task._count?.executions??0)>0,workspaceId:l??"",onClose:()=>u(null),onStatusChange:(a,b)=>{j?.(a,b),u(null)},onLaunch:a=>{k?.(a),u(null)}})]})}var L=a.i(445798);function M(a,b,c){return Math.min(Math.max(a,b),c)}var N=a.i(442620),O=a.i(10390),P=a.i(350739),Q=a.i(347165);let R=(0,A.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var S=a.i(616335),T=a.i(704494),U=a.i(394259),V=a.i(625892),W=a.i(939859),X=a.i(648512),Y=a.i(22761),Z=a.i(429246),$=a.i(780410);let _=(0,$.createServerReference)("60a7f1fea1269f6dc7e20f780bf809647e279ce915",$.callServer,void 0,$.findSourceMapURL,"updateProject");var aa=a.i(792439);let ab=(0,$.createServerReference)("4018cfb87b5cedda8d81d5a4585dd3bcd6af70d9f6",$.callServer,void 0,$.findSourceMapURL,"deleteProject"),ac=(0,$.createServerReference)("40c16ca3b6eafc693b7e8d7019f60d1cda33dffdad",$.callServer,void 0,$.findSourceMapURL,"getRecentLocalProjects"),ad=(0,$.createServerReference)("4025bb7670d06524b74b31713333451172e0113e2f",$.callServer,void 0,$.findSourceMapURL,"getOrCreateTowerTaskId");var ae=a.i(682092),af=a.i(71296),ag=a.i(545450),ah=a.i(380179),ai=a.i(952313),aj=a.i(43775),ak=a.i(487410);function al({commits:a}){let{t:d}=(0,n.useI18n)(),[e,f]=(0,c.useState)(!1);return 0===a.length?null:(0,b.jsxs)("div",{className:"border-b border-border",children:[(0,b.jsxs)("button",{onClick:()=>f(!e),className:"flex w-full items-center gap-1 px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[e?(0,b.jsx)(N.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(O.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[d("git.commitLog")," (",a.length,")"]})]}),e&&(0,b.jsx)("div",{className:"mt-0.5 mb-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:a.map(a=>(0,b.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,b.jsx)(R,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:a.message}),(0,b.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,b.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(a.shortHash),ai.toast.success(`Copied ${a.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[a.shortHash,(0,b.jsx)(Y.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:a.author}),(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(a){let b=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m`;let c=Math.floor(b/60);if(c<24)return`${c}h`;let d=Math.floor(c/24);return d<30?`${d}d`:`${Math.floor(d/30)}mo`}(a.date)})]})]})]},a.hash))})]})}var am=a.i(607219),an=a.i(324263),ao=a.i(7285);function ap({localPath:a,stashes:d,hasChanges:e,onRefresh:f}){let{t:g}=(0,n.useI18n)(),[h,i]=(0,c.useState)(!1),[l,m]=(0,c.useState)(!1),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(null),s=async()=>{m(!0);try{await (0,ao.gitAction)(a,"stash-save",{message:o}),p(""),ai.toast.success(g("git.stashSaved")),await f()}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}finally{m(!1)}},t=async b=>{r(b);try{await (0,ao.gitAction)(a,"stash-pop",{index:b}),ai.toast.success(g("git.stashApplied")),await f()}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}finally{r(null)}},u=async b=>{r(b);try{await (0,ao.gitAction)(a,"stash-drop",{index:b}),ai.toast.success(g("git.stashDropped")),await f()}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}finally{r(null)}};return e||0!==d.length?(0,b.jsxs)("div",{className:"border-b border-border",children:[(0,b.jsxs)("button",{onClick:()=>i(!h),className:"flex w-full items-center gap-1 px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[h?(0,b.jsx)(N.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,b.jsx)(O.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[g("git.stash")," ",d.length>0&&`(${d.length})`]})]}),h&&(0,b.jsxs)("div",{className:"mt-0.5 mb-1.5 space-y-2",children:[e&&(0,b.jsxs)("div",{className:"flex gap-1.5",children:[(0,b.jsx)(k.Input,{value:o,onChange:a=>p(a.target.value),placeholder:g("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:a=>"Enter"===a.key&&s()}),(0,b.jsx)(j.Button,{variant:"outline",size:"icon-sm",onClick:s,disabled:l,className:"shrink-0",children:l?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(am.Archive,{className:"h-3 w-3"})})]}),d.length>0&&(0,b.jsx)("div",{className:"space-y-0.5",children:d.map(a=>(0,b.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,b.jsx)(am.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,b.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:a.message||`stash@{${a.index}}`}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>t(a.index),disabled:q===a.index,className:"text-muted-foreground","aria-label":g("git.stashApply"),children:q===a.index?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(an.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>u(a.index),disabled:q===a.index,className:"text-rose-400","aria-label":g("git.stashDrop"),children:(0,b.jsx)(z.Trash2,{className:"h-3 w-3"})})]})]},a.index))})]})]}):null}var aq=a.i(985716);function ar({value:a,ariaLabel:d}){let{t:e}=(0,n.useI18n)(),[f,g]=(0,c.useState)(!1),h=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(a);else{let b=document.createElement("textarea");b.value=a,document.body.appendChild(b),b.select(),document.execCommand("copy"),document.body.removeChild(b)}g(!0),ai.toast.success(e("common.copied")),setTimeout(()=>g(!1),1500)}catch{ai.toast.error(e("common.copyFailed"))}};return(0,b.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/50 pl-3 pr-1 py-1.5",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:a,children:a}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d,onClick:h,children:f?(0,b.jsx)(q.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(Y.Copy,{className:"h-3 w-3"})})}),(0,b.jsx)(m.TooltipContent,{children:f?e("common.copied"):e("common.copy")})]})]})}function as({project:a,workspaceId:e}){let{t:f,locale:g}=(0,n.useI18n)(),i=(0,d.useRouter)(),{width:l,isDragging:o,startResize:p}=function(a){let{storageKey:b,defaultWidth:d,minWidth:e,maxWidth:f,edge:g="left"}=a,[h,i]=(0,c.useState)(d),[j,k]=(0,c.useState)(!1),l=(0,c.useRef)(null);(0,c.useEffect)(()=>{try{let a=window.localStorage.getItem(b),c=null==a?NaN:Number(a);Number.isFinite(c)&&i(M(c,e,f))}catch{}},[b,e,f]);let m=(0,c.useCallback)(a=>{let b=l.current;b&&i(function(a,b,c,d,e,f="left"){return M(a+("left"===f?b-c:c-b),d,e)}(b.width,b.x,a.clientX,e,f,g))},[e,f,g]),n=(0,c.useCallback)(()=>{l.current&&(l.current=null,k(!1),window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",n),i(a=>{try{window.localStorage.setItem(b,String(a))}catch{}return a}))},[m,b]),o=(0,c.useCallback)(a=>{a.preventDefault(),l.current={x:a.clientX,width:h},k(!0),window.addEventListener("pointermove",m),window.addEventListener("pointerup",n)},[h,m,n]);return(0,c.useEffect)(()=>()=>{window.removeEventListener("pointermove",m),window.removeEventListener("pointerup",n)},[m,n]),{width:h,isDragging:j,startResize:o}}({storageKey:"tower:repo-sidebar-width",defaultWidth:288,minWidth:240,maxWidth:560,edge:"left"}),[q,r]=(0,c.useState)(!0),[s,t]=(0,c.useState)(!0),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)(!1),[A,B]=(0,c.useState)(""),[C,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(!1),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(a.name),[L,Y]=(0,c.useState)(a.alias??""),[$,am]=(0,c.useState)(a.description??""),[an,ao]=(0,c.useState)(a.localPath??""),[at,au]=(0,c.useState)(a.projectType??"FRONTEND"),[av,aw]=(0,c.useState)([]);(0,c.useEffect)(()=>{ac(100).then(aw)},[]);let[ax,ay]=(0,c.useState)(!1),[az,aA]=(0,c.useState)(""),[aB,aC]=(0,c.useState)(""),[aD,aE]=(0,c.useState)(""),[aF,aG]=(0,c.useState)(""),[aH,aI]=(0,c.useState)("FRONTEND"),[aJ,aK]=(0,c.useState)(!1),[aL,aM]=(0,c.useState)(!1),[aN,aO]=(0,c.useState)(null),[aP,aQ]=(0,c.useState)(!1),[aR,aS]=(0,c.useState)(!1),aT=a=>{ai.toast.info(a)},aU=(0,c.useCallback)(async()=>{if(a.localPath){aQ(!0);try{let b=await fetch(`/api/git?path=${encodeURIComponent(a.localPath)}`);b.ok&&aO(await b.json())}catch{}finally{aQ(!1)}}},[a.localPath]);(0,c.useEffect)(()=>{aU()},[aU]);let aV=async()=>{if(a.localPath){aS(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:a.localPath})})).ok?(aT(f("git.initSuccess")),await aU()):aT(f("git.initFailed"))}catch{aT(f("git.initFailed"))}finally{aS(!1)}}},aW=(a,b)=>{i.push(`/workspaces/${a}?projectId=${b}`,{scroll:!1}),i.refresh()},aX=async()=>{if(aB.trim()){aK(!0);try{let a=await (0,aa.createProject)({name:aB.trim(),alias:aD.trim()||void 0,description:aF.trim()||void 0,localPath:az,projectType:aH,workspaceId:e});ay(!1),aW(e,a.id)}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}finally{aK(!1)}}},aY=async()=>{if(an&&!aL){aM(!0);try{let a=await (0,ah.analyzeProjectDirectory)(an.trim(),g);am(a)}catch{ai.toast.error(f("project.analyzeError"))}finally{aM(!1)}}},aZ=async()=>{try{await _(a.id,{name:J.trim(),alias:L.trim()||void 0,description:$.trim()||void 0,localPath:an.trim()||void 0,projectType:at}),i.refresh(),v(!1)}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}};return(0,b.jsxs)("aside",{className:"relative flex-shrink-0 border-l border-border bg-sidebar",style:{width:l},children:[(0,b.jsx)("div",{onPointerDown:p,className:`absolute left-0 top-0 z-20 h-full w-1 -translate-x-1/2 cursor-col-resize transition-colors hover:bg-primary/20 ${o?"bg-primary/40":"bg-transparent"}`,role:"separator","aria-orientation":"vertical","aria-label":f("sidebar.right.resize")}),(0,b.jsxs)("div",{className:"h-full overflow-y-auto",children:[(0,b.jsxs)("div",{className:"border-b border-border p-4",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("h2",{className:"text-base font-semibold text-foreground",children:a.name}),a.alias&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.alias})]}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{K(a.name),Y(a.alias??""),am(a.description??""),ao(a.localPath??""),v(!0)},className:"text-muted-foreground",children:(0,b.jsx)(y.Pencil,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{B(""),x(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,b.jsx)(z.Trash2,{className:"h-3.5 w-3.5"})})]})]}),a.description&&(0,b.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:a.description}),(0,b.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,b.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===a.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===a.type?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.GitBranch,{className:"h-3 w-3"}),f("sidebar.right.gitType")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(P.FileText,{className:"h-3 w-3"}),f("sidebar.right.normalType")]})})}),a.gitUrl&&(0,b.jsx)("div",{className:"mt-3 space-y-1.5",children:(0,b.jsx)(ar,{value:a.gitUrl,ariaLabel:f("project.gitUrl")})}),a.localPath&&(0,b.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ae.openInFileManager)(a.localPath)}catch(a){console.error("openInFileManager failed:",a),ai.toast.error(f("git.openInFileManagerFailed"))}},children:(0,b.jsx)(V.FolderSearch,{className:"h-4 w-4"})})}),(0,b.jsx)(m.TooltipContent,{children:f("git.openInFileManager")})]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,af.openInEditor)(a.localPath)}catch(a){console.error("openInEditor failed:",a),ai.toast.error(f("git.openInEditorFailed"))}},children:(0,b.jsx)(W.Code,{className:"h-4 w-4"})})}),(0,b.jsx)(m.TooltipContent,{children:f("git.openInEditor")})]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ag.openInTerminal)(a.localPath)}catch(a){console.error("openInTerminal failed:",a),ai.toast.error(f("git.openInTerminalFailed"))}},children:(0,b.jsx)(X.Terminal,{className:"h-4 w-4"})})}),(0,b.jsx)(m.TooltipContent,{children:f("git.openInTerminal")})]})]}),(0,b.jsxs)(j.Button,{variant:"outline",className:"w-full h-9 gap-1.5 text-xs",disabled:E,onClick:async()=>{F(!0);try{let b=await ad(a.id);i.push(`/workspaces/${e}/tasks/${b}`)}catch{ai.toast.error(f("git.openStudioFailed"))}finally{F(!1)}},children:[E?(0,b.jsx)(T.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(Q.FolderOpen,{className:"h-3.5 w-3.5"}),f("git.openStudio")]})]})]}),(0,b.jsxs)("div",{className:"border-b border-border p-4",children:[(0,b.jsxs)(j.Button,{variant:"ghost",onClick:()=>r(!q),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f("git.section")}),q?(0,b.jsx)(N.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,b.jsx)(O.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),q&&(0,b.jsx)("div",{className:"mt-3",children:a.localPath?aP?(0,b.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,b.jsx)(T.Loader2,{className:"h-4 w-4 animate-spin"}),(0,b.jsx)("span",{className:"ml-2 text-xs",children:f("git.loading")})]}):aN&&!aN.isGit?(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,b.jsx)(S.AlertCircle,{className:"h-3.5 w-3.5"}),(0,b.jsx)("p",{className:"text-xs",children:f("git.notInitialized")})]}),(0,b.jsxs)(j.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:aV,disabled:aR,children:[aR?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(R,{className:"h-3 w-3"}),f("git.initRepo")]})]}):aN?.isGit?(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"flex flex-col",children:(0,b.jsx)(aq.EditorGitPanel,{localPath:a.localPath,mode:"project"})}),(0,b.jsx)(al,{commits:aN.commits??[]}),(0,b.jsx)(ap,{localPath:a.localPath,stashes:aN.stashes??[],hasChanges:(aN.changedFiles??[]).length>0,onRefresh:aU})]}):null:(0,b.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,b.jsx)(S.AlertCircle,{className:"h-3.5 w-3.5"}),(0,b.jsx)("p",{className:"text-xs",children:f("git.noLocalPath")})]})})})]}),(0,b.jsxs)("div",{className:"p-4",children:[(0,b.jsxs)(j.Button,{variant:"ghost",onClick:()=>t(!s),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,b.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f("sidebar.right.browseRepo")}),s?(0,b.jsx)(N.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,b.jsx)(O.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),s&&(0,b.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,b.jsxs)(j.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>I(!0),children:[(0,b.jsx)(Q.FolderOpen,{className:"h-3.5 w-3.5"}),f("sidebar.right.browseRepo")]}),av.length>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:f("sidebar.right.recent")}),(0,b.jsx)("div",{className:"space-y-0.5",children:av.map(c=>(0,b.jsxs)("button",{onClick:()=>{c.id!==a.id&&aW(c.workspaceId,c.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${c.id===a.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===c.type?(0,b.jsx)(h.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,b.jsx)(Q.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:c.name}),c.localPath&&(0,b.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:c.localPath})]})]},c.id))})]})]})]})]}),(0,b.jsx)(G.Dialog,{open:u,onOpenChange:v,children:(0,b.jsxs)(G.DialogContent,{style:{maxWidth:"32rem"},children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{children:f("project.edit")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(k.Input,{value:J,onChange:a=>K(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(ak.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:at,onChange:au})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(k.Input,{value:L,onChange:a=>Y(a.target.value),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsxs)(j.Button,{type:"button",variant:"ghost",onClick:aY,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!an||aL?"opacity-50":""}`,children:[aL?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(U.Sparkles,{className:"h-3 w-3"}),aL?f("project.analyzing"):f("project.genDesc")]})]}),(0,b.jsx)(Z.Textarea,{value:$,onChange:a=>am(a.target.value),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("div",{className:"mt-1.5 break-all rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:an||"—"})]})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>v(!1),children:f("common.cancel")}),(0,b.jsx)(j.Button,{onClick:aZ,disabled:!J.trim()||aL,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:f("common.save")})]})]})}),(0,b.jsx)(aj.FolderBrowserDialog,{open:H,onOpenChange:I,onSelect:a=>{u?ao(a):(a=>{let b=av.find(b=>b.localPath===a);if(b)return aW(b.workspaceId,b.id);let c=a.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";aA(a),aC(c),aE(""),aG(""),ay(!0)})(a)}}),(0,b.jsx)(G.Dialog,{open:ax,onOpenChange:ay,children:(0,b.jsxs)(G.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{children:f("topbar.newProject")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.localPath")}),(0,b.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:az})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.name")}),(0,b.jsx)(k.Input,{value:aB,onChange:a=>aC(a.target.value),placeholder:f("project.namePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.type.label")}),(0,b.jsx)("div",{className:"mt-1.5",children:(0,b.jsx)(ak.SegmentedControl,{options:[{value:"FRONTEND",label:f("project.type.frontend")},{value:"BACKEND",label:f("project.type.backend")}],value:aH,onChange:aI})})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.alias")}),(0,b.jsx)(k.Input,{value:aD,onChange:a=>aE(a.target.value),placeholder:f("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.description")}),(0,b.jsx)(Z.Textarea,{value:aF,onChange:a=>aG(a.target.value),placeholder:f("project.descPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>ay(!1),children:f("common.cancel")}),(0,b.jsxs)(j.Button,{onClick:aX,disabled:!aB.trim()||aJ,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[aJ?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,f("common.create")]})]})]})}),(0,b.jsx)(G.Dialog,{open:w,onOpenChange:a=>{x(a),a||B("")},children:(0,b.jsxs)(G.DialogContent,{className:"sm:max-w-md",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsx)(G.DialogTitle,{className:"text-rose-400",children:f("project.deleteTitle")})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f("project.deleteWarning",{name:a.name})}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:f("project.deleteIrreversible")}),(0,b.jsxs)("div",{children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:f("project.deleteConfirmLabel")}),(0,b.jsx)(k.Input,{value:A,onChange:a=>B(a.target.value),placeholder:f("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>x(!1),children:f("common.cancel")}),(0,b.jsxs)(j.Button,{variant:"destructive",disabled:A!==f("project.deleteConfirmText")||C,onClick:async()=>{D(!0);try{await ab(a.id),ai.toast.success(f("project.deleteSuccess")),i.push(`/workspaces/${e}`)}catch{ai.toast.error(f("project.deleteFailed"))}finally{D(!1),x(!1)}},children:[C&&(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),f("project.deleteButton")]})]})]})})]})}var at=a.i(963326),au=a.i(300141),av=a.i(913284),aw=a.i(269280),ax=a.i(368114);function ay({title:a,description:c,branch:d,baseBranch:e,version:f,hasConversation:g,updatedAt:i,openDir:k,onBack:l}){let{t:o}=(0,n.useI18n)();return(0,b.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(U.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,b.jsx)("span",{className:"text-xs font-semibold text-primary",children:o("taskDetail.title")})]}),(0,b.jsxs)(j.Button,{variant:"ghost",onClick:l,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,b.jsx)(aw.ArrowLeft,{className:"h-3.5 w-3.5"}),o("taskDetail.back")]})]}),(0,b.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:a}),c&&(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:c}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e?(0,b.jsxs)(C.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,b.jsx)(h.GitBranch,{className:"mr-1 h-3 w-3"}),e," · worktree"]}):d?(0,b.jsx)(C.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:o("taskDetail.directMode")}):null,f&&(0,b.jsx)(E.TaskVersionTag,{number:f.number,name:f.name,showName:!0}),g&&(0,b.jsx)(C.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:o("taskDetail.hasConversation")}),(0,b.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[o("taskDetail.updatedAt")," ",(0,ax.formatRelativeTime)(i)]}),k&&(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ae.openInFileManager)(k)}catch(a){console.error("openInFileManager failed:",a),ai.toast.error(o("git.openInFileManagerFailed"))}},children:(0,b.jsx)(V.FolderSearch,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(m.TooltipContent,{side:"bottom",children:o("git.openInFileManager")})]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,af.openInEditor)(k)}catch(a){console.error("openInEditor failed:",a),ai.toast.error(o("git.openInEditorFailed"))}},children:(0,b.jsx)(W.Code,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(m.TooltipContent,{side:"bottom",children:o("git.openInEditor")})]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsx)(m.TooltipTrigger,{render:(0,b.jsx)(j.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ag.openInTerminal)(k)}catch(a){console.error("openInTerminal failed:",a),ai.toast.error(o("git.openInTerminalFailed"))}},children:(0,b.jsx)(X.Terminal,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(m.TooltipContent,{side:"bottom",children:o("git.openInTerminal")})]})]})]})]})}var az=a.i(639138),aA=a.i(88757),aB=a.i(347872),aC=a.i(65618),aD=a.i(946712),aE=a.i(471090),aF=a.i(944278),aG=a.i(101763),aH=a.i(806051),aI=a.i(201605),aJ=a.i(694067),aK=a.i(128483),aL=a.i(715525),aM=a.i(324954),aN=a.i(87339),aO=a.i(54384),aP=a.i(509405),aQ=a.i(523824),aR=a.i(505858),aS=a.i(656830),aT=a.i(417196),aU=a.i(8159),aV=a.i(507727),aW=a.i(532615),aX=a.i(894148),aY=a.i(510650),aZ=a.i(161181);let a$=/\.(txt|md|json)$/i;function a_({taskId:a,projectId:d}){let{t:e}=(0,n.useI18n)(),g=(0,c.useRef)(null),[h,i]=(0,c.useState)([]),[k,l]=(0,c.useState)([]),[m,o]=(0,c.useState)(!1),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null),[x,y]=(0,c.useState)(null);async function A(){p.trim()&&(await (0,aQ.createNote)({title:p.trim(),content:r.trim(),projectId:d,taskId:a,category:"task"}),q(""),s(""),o(!1),(0,aR.getTaskNotes)(a).then(i))}async function B(a){await (0,aS.deleteNote)(a),i(b=>b.filter(b=>b.id!==a))}async function C(b){let c=b.target.files?.[0];if(c){u(!0);try{let b=new FormData;b.set("file",c),b.set("projectId",d),b.set("taskId",a),await (0,aU.uploadAsset)(b),(0,aT.getTaskAssets)(a).then(l)}finally{u(!1),g.current&&(g.current.value="")}}}async function D(a){await (0,aV.deleteAsset)(a),l(b=>b.filter(b=>b.id!==a))}function E(a){return(0,aZ.isImageAsset)(a.filename,a.mimeType)||a$.test(a.filename)}function F(a){E(a)?w(a):ai.toast.info(e("assets.previewNotSupported"))}async function G(a){try{let b=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a.path})});if(!b.ok){let a=await b.json().catch(()=>({}));ai.toast.error(a.error||"Failed to reveal file")}}catch{ai.toast.error("Failed to reveal file")}}(0,c.useEffect)(()=>{(0,aR.getTaskNotes)(a).then(i),(0,aT.getTaskAssets)(a).then(l)},[a]);let I=v?(0,aZ.isImageAsset)(v.filename,v.mimeType)?"image":a$.test(v.filename)?"text":null:null,J=k.filter(a=>(0,aZ.isImageAsset)(a.filename,a.mimeType)).map(a=>({id:a.id,url:(0,aZ.localPathToApiUrl)(a.path),filename:a.filename})),K=v?J.findIndex(a=>a.id===v.id):-1;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(H.ScrollArea,{className:"h-full",children:(0,b.jsxs)("div",{className:"flex flex-col",children:[(0,b.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,b.jsx)(P.FileText,{className:"h-3.5 w-3.5"}),e("taskPage.notes")]}),(0,b.jsxs)(j.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>o(!m),children:[m?(0,b.jsx)(aO.X,{className:"h-3 w-3"}):(0,b.jsx)(f.Plus,{className:"h-3 w-3"}),m?"":e("taskPage.addNote")]})]}),m&&(0,b.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,b.jsx)("input",{type:"text",value:p,onChange:a=>q(a.target.value),placeholder:e("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,b.jsx)("textarea",{value:r,onChange:a=>s(a.target.value),placeholder:e("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,b.jsx)(j.Button,{className:"text-xs",onClick:A,disabled:!p.trim(),children:e("taskPage.addNote")})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-2",children:[0===h.length&&!m&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:e("taskPage.noNotes")}),h.map(a=>(0,b.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>y(a),className:"min-w-0 flex-1 cursor-pointer text-left",title:e("taskPage.previewNote"),children:[(0,b.jsx)("h4",{className:"text-sm font-medium truncate hover:underline",children:a.title}),a.content&&(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:a.content}),(0,b.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(a.createdAt).toLocaleString()})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>y(a),className:"text-muted-foreground hover:bg-accent",title:e("taskPage.previewNote"),children:(0,b.jsx)(aP.Eye,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>B(a.id),className:"text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:e("taskPage.deleteNote"),children:(0,b.jsx)(z.Trash2,{className:"h-3.5 w-3.5"})})]})]})},a.id))]})]}),(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,b.jsx)(aN.Paperclip,{className:"h-3.5 w-3.5"}),e("taskPage.attachments")]}),(0,b.jsxs)(j.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>g.current?.click(),disabled:t,children:[(0,b.jsx)(aM.Upload,{className:"h-3 w-3"}),e("taskPage.uploadFile")]}),(0,b.jsx)("input",{ref:g,type:"file",className:"hidden",onChange:C})]}),(0,b.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===k.length&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:e("taskPage.noAttachments")}),k.map(a=>{var c;let d=E(a);return(0,b.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,b.jsx)(aN.Paperclip,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,b.jsx)("button",{type:"button",onClick:()=>F(a),disabled:!d,className:`min-w-0 flex-1 truncate text-left text-sm ${d?"cursor-pointer hover:underline":"cursor-default"}`,title:d?e("assets.preview"):a.filename,children:a.filename}),(0,b.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(c=a.size)?c<1024?`${c} B`:c<1048576?`${(c/1024).toFixed(1)} KB`:`${(c/1024/1024).toFixed(1)} MB`:""}),(0,b.jsxs)("div",{className:"flex items-center gap-0.5",children:[d&&(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>F(a),className:"shrink-0 text-muted-foreground hover:bg-accent",title:e("assets.preview"),children:(0,b.jsx)(aP.Eye,{className:"h-3 w-3"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>G(a),className:"shrink-0 text-muted-foreground hover:bg-accent",title:e("assets.revealInFinder"),children:(0,b.jsx)(Q.FolderOpen,{className:"h-3 w-3"})}),(0,b.jsx)(j.Button,{variant:"ghost",size:"icon-xs",onClick:()=>D(a.id),className:"shrink-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:e("taskPage.deleteAttachment"),children:(0,b.jsx)(z.Trash2,{className:"h-3 w-3"})})]})]},a.id)})]})]})]})}),(0,b.jsx)(aW.ImageLightbox,{imageUrl:"image"===I&&K>=0?J[K].url:null,filename:"image"===I&&K>=0?J[K].filename:"",open:"image"===I,onOpenChange:a=>{a||w(null)},assets:J.map(({url:a,filename:b})=>({url:a,filename:b})),currentIndex:K>=0?K:void 0,onIndexChange:a=>{let b=J[a];if(!b)return;let c=k.find(a=>a.id===b.id);c&&w(c)}}),(0,b.jsx)(aX.TextPreviewDialog,{url:"text"===I&&v?(0,aZ.localPathToApiUrl)(v.path):null,filename:v?.filename??"",open:"text"===I,onOpenChange:a=>{a||w(null)}}),(0,b.jsx)(aY.NotePreviewDialog,{note:x,open:null!==x,onOpenChange:a=>{a||y(null)}})]})}function a0({task:a,workspaceId:e,projectLocalPath:f,onClose:g}){let{t:h}=(0,n.useI18n)(),i=(0,d.useRouter)(),{removePortal:k}=(0,aB.useTerminalPortal)(),[o,p]=(0,c.useState)("terminal"),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(a.status);(0,c.useEffect)(()=>{v(a.status)},[a.status]);let[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),[A,B]=(0,c.useState)(!1),[C,D]=(0,c.useState)([]);(0,c.useEffect)(()=>{x(null),z(!1),B(!1),D([]),r(null),p("terminal")},[a.id]);let[E,F]=(0,c.useState)([]),[G,I]=(0,c.useState)(null);(0,c.useEffect)(()=>{let a=!1;return(0,aK.getPrompts)().then(b=>{if(a)return;F(b.map(a=>({id:a.id,name:a.name,isDefault:a.isDefault})));let c=b.find(a=>a.isDefault);c&&I(c.id)}),()=>{a=!0}},[]),(0,c.useEffect)(()=>{x(null),B(!1);let b=!1;return(0,aC.getTaskExecutions)(a.id).then(a=>{if(b)return;let c=a[0];if(c?.status==="RUNNING"){let a=c.worktreePath||f||null;a&&x(a)}D(a.filter(a=>"RUNNING"!==a.status)),B(!0)}),()=>{b=!0}},[a.id]),(0,c.useEffect)(()=>{if("changes"!==o||"TODO"===u||"CANCELLED"===u)return;let b=!1;return t(!0),fetch(`/api/tasks/${a.id}/diff`).then(a=>{if(!a.ok)throw Error(`HTTP ${a.status}`);return a.json()}).then(a=>{b||r(a?.files||a?.branchDeleted?a:null)}).catch(()=>{b||r(null)}).finally(()=>{b||t(!1)}),()=>{b=!0}},[o,u,a.id]);let J=(0,c.useCallback)(async()=>{if(!y){z(!0),k(a.id);try{let b=await (0,aD.startPtyExecutionSafe)(a.id,"",G);if(!b.ok){z(!1),ai.toast.error(b.error||h("terminal.startFailed"));return}x(b.worktreePath??null),v("IN_PROGRESS")}catch(a){z(!1),ai.toast.error(a instanceof Error&&a.message?a.message:h("terminal.startFailed"))}}},[a.id,y,G,h]),K=(0,c.useCallback)(b=>{z(!1),x(null),k(a.id),0===b&&v("IN_REVIEW"),(0,aC.getTaskExecutions)(a.id).then(a=>{D(a.filter(a=>"RUNNING"!==a.status))}),i.refresh()},[i,a.id]),L=(0,c.useCallback)(async()=>{await (0,aE.stopPtyExecution)(a.id),z(!1),k(a.id),x(null),v("IN_REVIEW"),(0,aC.getTaskExecutions)(a.id).then(a=>{D(a.filter(a=>"RUNNING"!==a.status))}),i.refresh()},[a.id,i]),M=(0,c.useCallback)(async b=>{z(!0),k(a.id),x(null);try{let{worktreePath:c}=await (0,aF.resumePtyExecution)(a.id,b);x(c),v("IN_PROGRESS")}catch{z(!1)}},[a.id,k]),N=(0,c.useCallback)(async()=>{z(!0),k(a.id),x(null);try{let{worktreePath:b}=await (0,aG.continueLatestPtyExecution)(a.id);x(b),v("IN_PROGRESS")}catch(a){z(!1),ai.toast.error(a instanceof Error?a.message:String(a))}},[a.id,k]),[O,Q]=(0,c.useState)(!1),[R,S]=(0,c.useState)([]),U=(0,c.useCallback)(async()=>{try{let b=await (0,aI.checkWorktreeClean)(a.id);if(b.hasWorktree&&!b.clean)return void ai.toast.error(h("taskPage.uncommittedChanges",{count:String(b.files.length)}));if(b.hasWorktree&&b.clean&&!b.hasCommits)return void ai.toast.error(h("taskPage.noChangesToComplete"),{action:{label:h("taskPage.markAsCancelled"),onClick:()=>{(0,aH.updateTaskStatus)(a.id,"CANCELLED").then(()=>{v("CANCELLED"),ai.toast.success(h("taskPage.taskCancelled")),i.refresh()}).catch(()=>ai.toast.error("Failed to cancel task"))}}});if(b.hasWorktree&&b.hasCommits){S(b.commitLog),Q(!0);return}await (0,aH.updateTaskStatus)(a.id,"DONE"),v("DONE"),ai.toast.success(h("taskPage.taskCompleted")),i.refresh()}catch{ai.toast.error("Failed to complete task")}},[a.id,i,h]),V=(0,c.useCallback)(()=>{v("DONE"),Q(!1),ai.toast.success(h("taskPage.taskCompleted")),i.refresh()},[i,h]),W=(0,c.useCallback)(async b=>{try{let{hash:c}=await (0,aJ.commitWorktreeChanges)(a.id,b);ai.toast.success(h("diff.commitSuccess",{hash:c})),i.refresh();let d=await fetch(`/api/tasks/${a.id}/diff`);if(d.ok){let a=await d.json();r(a?.files?a:null)}}catch(a){ai.toast.error(a instanceof Error?a.message:"Commit failed")}},[a.id,i,h]);return(0,b.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,b.jsx)(ay,{title:a.title,description:h("taskDetail.panelDescription"),branch:`task/${a.id}`,baseBranch:a.baseBranch,version:a.version??null,hasConversation:!1,updatedAt:a.updatedAt,openDir:w??(f?a.subPath?`${f}/${a.subPath}`:f:null),onBack:g}),(0,b.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,b.jsxs)("div",{className:"flex gap-1",children:[(0,b.jsxs)("button",{onClick:()=>p("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(X.Terminal,{className:"h-3 w-3"}),h("terminal.execute")]}),(0,b.jsx)("button",{onClick:()=>p("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:h("taskPage.changes")}),(0,b.jsxs)("button",{onClick:()=>p("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===o?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,b.jsx)(P.FileText,{className:"h-3 w-3"}),h("taskPage.notes")]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===u&&(0,b.jsxs)(j.Button,{size:"sm",onClick:U,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,b.jsx)(av.CheckCircle2,{className:"h-3 w-3"}),h("taskPage.completeTask")]}),"DONE"!==u&&"CANCELLED"!==u&&(0,b.jsxs)(j.Button,{variant:"ghost",size:"sm",onClick:()=>i.push(`/workspaces/${e}/tasks/${a.id}`),className:"text-muted-foreground",children:[(0,b.jsx)(at.ExternalLink,{className:"h-3 w-3"}),h("taskPage.viewDetails")]})]})]}),"terminal"===o?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:A?w?(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,b.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,b.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),h("execution.running")]}),(0,b.jsxs)(m.Tooltip,{children:[(0,b.jsxs)(m.TooltipTrigger,{onClick:L,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,b.jsx)(au.Square,{className:"h-3 w-3"}),h("terminal.stopExecution")]}),(0,b.jsx)(m.TooltipContent,{side:"bottom",children:h("terminal.stopHint")})]})]}),(0,b.jsx)("div",{className:"flex-1 min-h-0",children:(0,b.jsx)(aB.TerminalOutlet,{taskId:a.id,worktreePath:w,onSessionEnd:K})})]}):"DONE"===u||"CANCELLED"===u?(0,b.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,b.jsx)(H.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)(aL.ExecutionTimeline,{executions:C})})}):(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[E.length>0&&(0,b.jsxs)(l.Select,{defaultValue:G??"none",onValueChange:a=>I("none"===a?null:a),children:[(0,b.jsx)(l.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,b.jsx)("span",{className:"text-left truncate",children:G?E.find(a=>a.id===G)?.name??h("terminal.noPrompt"):h("terminal.noPrompt")})}),(0,b.jsxs)(l.SelectContent,{className:"min-w-[200px]",children:[(0,b.jsx)(l.SelectItem,{value:"none",children:h("terminal.noPrompt")}),E.map(a=>(0,b.jsxs)(l.SelectItem,{value:a.id,children:[a.name,a.isDefault?" ★":""]},a.id))]})]},`prompt-${E.length}`),(0,b.jsxs)(j.Button,{onClick:J,disabled:y,size:"sm",className:"gap-2 px-4",children:[y?(0,b.jsx)(T.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(X.Terminal,{className:"h-3.5 w-3.5"}),y?h("terminal.executing"):h("terminal.launch")]})]}),(0,b.jsx)(H.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsx)(aL.ExecutionTimeline,{executions:C,onResume:M,onContinueLatest:N})})]}):(0,b.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,b.jsx)(T.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,b.jsx)("span",{className:"text-xs text-neutral-500",children:h("execution.loading")})]})}):"changes"===o?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:s?(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.loadingDiff")})}):q?.branchDeleted?(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.branchDeleted")})}):q?(0,b.jsx)(az.TaskDiffView,{taskId:a.id,files:q.files,totalAdded:q.totalAdded,totalRemoved:q.totalRemoved,hasConflicts:q.hasConflicts,conflictFiles:q.conflictFiles,onCommit:W,hasUncommitted:q.hasUncommitted}):(0,b.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:h("taskPage.noChanges")})})}):"notes"===o?(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,b.jsx)(a_,{taskId:a.id,projectId:a.projectId})}):null,(0,b.jsx)(aA.TaskMergeConfirmDialog,{open:O,onOpenChange:Q,taskId:a.id,taskTitle:a.title,baseBranch:a.baseBranch??"main",fileCount:q?.files?.length??0,commitCount:q?.commitCount??0,commitLog:R,onMergeComplete:V})]})}var a1=a.i(919314),a2=a.i(407860);let a3=(0,$.createServerReference)("40505ff06497cc2e4c160bdf7f87ac35e4cf142d23",$.callServer,void 0,$.findSourceMapURL,"deleteTask"),a4=(0,$.createServerReference)("402dcfe84e0d71699003d8cc37a07f1cbe7db1f2d4",$.callServer,void 0,$.findSourceMapURL,"toggleTaskPinned");var a5=a.i(567583);let a6=(0,$.createServerReference)("404e87563f6e23618c4c429e0caa081717d89036d1",$.callServer,void 0,$.findSourceMapURL,"getVersionsForPicker");var a7=a.i(258815),a8=a.i(912868);function a9({project:a,isActive:e,workspaceId:f,onSelect:g}){let{t:h}=(0,n.useI18n)(),i=(0,d.useRouter)(),k=a.totalTasks,l=a.runningTasks,o=k>0?Math.round(l/k*100):0,[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(!1),t=async()=>{s(!0);try{let b=await ad(a.id);i.push(`/workspaces/${f}/tasks/${b}`)}catch{ai.toast.error(h("git.openStudioFailed"))}finally{s(!1)}},u=(0,b.jsxs)("button",{onClick:()=>{e||g(a.id)},className:`group flex w-[212px] shrink-0 items-center gap-2 rounded-lg border-b-2 px-3 py-1.5 text-left transition-colors ${e?"border-primary bg-primary/10 ring-1 ring-primary/20 cursor-default":`border-transparent cursor-pointer ${p?"bg-accent":"hover:bg-accent"}`}`,children:[(0,b.jsxs)("span",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,b.jsx)("span",{className:`w-full truncate text-sm font-medium leading-tight ${e?"text-primary":p?"text-foreground":"text-muted-foreground group-hover:text-foreground"}`,children:a.name}),a.alias&&(0,b.jsx)("span",{className:"w-full truncate text-[11px] font-normal leading-tight text-muted-foreground/70",children:a.alias})]}),(0,b.jsxs)("span",{className:"flex shrink-0 items-baseline rounded-md border border-border bg-card px-1.5 py-0.5 font-mono text-[11px] font-semibold leading-none",children:[(0,b.jsx)("span",{className:"text-amber-500 dark:text-amber-400",children:l}),(0,b.jsx)("span",{className:"mx-px text-muted-foreground/50",children:"/"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:k})]})]});return(0,b.jsxs)(m.Tooltip,{onOpenChange:q,children:[(0,b.jsx)(m.TooltipTrigger,{render:u}),(0,b.jsxs)(m.TooltipContent,{side:"bottom",hideArrow:!0,className:"flex w-[268px] max-w-none flex-col items-stretch gap-0 rounded-xl border border-border bg-card p-3.5 text-foreground shadow-lg",children:[(0,b.jsx)("div",{className:"text-[13px] font-bold leading-snug break-words",children:a.name}),a.alias&&(0,b.jsx)("div",{className:"mt-0.5 text-[11.5px] leading-relaxed text-muted-foreground break-words",children:a.alias}),(0,b.jsx)("div",{className:"my-2.5 h-px bg-border"}),(0,b.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,b.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-amber-500 dark:bg-amber-400"}),(0,b.jsx)("span",{className:"text-[13px] font-semibold",children:h("board.running")}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:h("board.runningDesc")}),(0,b.jsx)("span",{className:"ml-auto font-mono text-[15px] font-bold text-amber-500 dark:text-amber-400",children:l})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"size-2 shrink-0 rounded-full bg-sky-500 dark:bg-sky-400"}),(0,b.jsx)("span",{className:"text-[13px] font-semibold",children:h("board.overview")}),(0,b.jsx)("span",{className:"text-[11px] text-muted-foreground",children:h("board.totalDesc")}),(0,b.jsx)("span",{className:"ml-auto font-mono text-[15px] font-bold",children:k})]}),(0,b.jsx)("div",{className:"mt-2.5 h-[5px] overflow-hidden rounded-full bg-sky-500/15 dark:bg-sky-400/15",children:(0,b.jsx)("div",{className:"h-full rounded-full bg-amber-500 dark:bg-amber-400",style:{width:`${o}%`}})}),(0,b.jsxs)("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[(0,b.jsx)("span",{className:"text-[10px] text-muted-foreground",children:h("board.badgeFormatHint")}),(0,b.jsxs)(j.Button,{variant:"outline",disabled:r,onClick:t,className:"h-6 shrink-0 gap-1 px-2 text-[11px]",children:[r?(0,b.jsx)(T.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(Q.FolderOpen,{className:"h-3 w-3"}),h("git.openStudio")]})]})]})]})}function ba({projects:a,activeProjectId:d,workspaceId:e,onSelect:f}){let g=(0,c.useRef)(null),[h,i]=(0,c.useState)(!1),[j,k]=(0,c.useState)(!1),l=()=>{let a=g.current;a&&(i(a.scrollLeft>0),k(a.scrollLeft<a.scrollWidth-a.clientWidth-1))};(0,c.useEffect)(()=>{l();let a=g.current;if(a){a.addEventListener("scroll",l);let b=new ResizeObserver(l);return b.observe(a),()=>{a.removeEventListener("scroll",l),b.disconnect()}}},[a]);let m=a=>{let b=g.current;b&&b.scrollBy({left:"left"===a?-150:150,behavior:"smooth"})};return(0,b.jsxs)("div",{className:"relative flex items-center",children:[h&&(0,b.jsx)("button",{onClick:()=>m("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,b.jsx)(a8.ChevronLeft,{className:"h-4 w-4"})}),(0,b.jsx)("div",{ref:g,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:a.map(a=>(0,b.jsx)(a9,{project:a,isActive:d===a.id,workspaceId:e,onSelect:f},a.id))}),j&&(0,b.jsx)("button",{onClick:()=>m("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,b.jsx)(O.ChevronRight,{className:"h-4 w-4"})})]})}var bb=a.i(811344);function bc({open:a,onOpenChange:c,taskTitle:d,uncommittedFiles:e,commitLog:f,onConfirm:g}){let{t:h}=(0,n.useI18n)(),i=e.length,k=f.length,l=0===i&&0===k;return(0,b.jsx)(G.Dialog,{open:a,onOpenChange:c,children:(0,b.jsxs)(G.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,b.jsx)(G.DialogHeader,{children:(0,b.jsxs)(G.DialogTitle,{className:"flex items-center gap-2",children:[(0,b.jsx)(bb.AlertTriangle,{className:"h-4 w-4 text-amber-400"}),h("taskCancel.title")]})}),(0,b.jsxs)("div",{className:"space-y-3 py-2",children:[(0,b.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-3 space-y-1.5",children:[(0,b.jsx)("p",{className:"text-xs text-foreground",children:h("taskCancel.intro",{title:d})}),(0,b.jsx)("p",{className:"text-xs text-amber-300",children:h("taskCancel.irreversible")})]}),l?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:h("taskCancel.cleanNotice")}):(0,b.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h("taskCancel.uncommittedFiles")}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:i})]}),(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:h("taskCancel.unmergedCommits")}),(0,b.jsx)("span",{className:"text-xs font-medium text-foreground",children:k})]})]}),i>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:h("taskCancel.filesList")}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:e.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))})]}),k>0&&(0,b.jsxs)("div",{children:[(0,b.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:h("taskCancel.commitsList")}),(0,b.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:f.map((a,c)=>(0,b.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:a},c))}),(0,b.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1.5",children:h("taskCancel.reflogHint")})]})]}),(0,b.jsxs)(G.DialogFooter,{children:[(0,b.jsx)(j.Button,{variant:"outline",onClick:()=>c(!1),children:h("taskCancel.keep")}),(0,b.jsxs)(j.Button,{variant:"destructive",onClick:g,className:"gap-2",children:[(0,b.jsx)(bb.AlertTriangle,{className:"h-4 w-4"}),h("taskCancel.confirm")]})]})]})})}a.s(["BoardPageClient",0,function({workspaceId:a,projectId:e,project:f,projects:g,initialTasks:h,labels:i,openTaskId:j}){let k=(0,d.useRouter)(),{t:l}=(0,n.useI18n)(),[,m]=(0,c.useTransition)(),[p,q]=(0,c.useState)(""),[s,t]=(0,c.useState)("all"),[u,v]=(0,c.useState)(!1),[w,x]=(0,c.useState)("TODO"),[y,z]=(0,c.useState)(j??null),[A,B]=(0,c.useState)([]),C=y?h.find(a=>a.id===y)??null:null,[D,E]=(0,c.useState)(null),[F,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(null);(0,c.useEffect)(()=>{a6(e).then(B).catch(()=>B([]))},[e]),(0,c.useEffect)(()=>{(0,a7.setLastProjectId)(a,e)},[a,e]);let J=A.find(a=>a.isCurrent)?.id??null,M=(0,c.useCallback)(()=>{m(()=>{k.refresh()})},[k]);(0,c.useEffect)(()=>{if(u)return;let a=setInterval(()=>{m(()=>{k.refresh()})},5e3);return()=>clearInterval(a)},[k,u]);let N=(0,c.useCallback)(a=>{q(a)},[]),O=(0,c.useCallback)(async a=>{let b=h.find(b=>b.id===a);if(b)try{let c=await (0,aI.checkWorktreeClean)(a);if(c.hasWorktree&&!c.clean){ai.toast.error(l("taskPage.uncommittedChanges",{count:String(c.files.length)})),M();return}if(c.hasWorktree&&c.clean&&!c.hasCommits){ai.toast.error(l("taskPage.noChangesToComplete"),{action:{label:l("taskPage.markAsCancelled"),onClick:()=>{(0,aH.updateTaskStatus)(a,"CANCELLED").then(()=>{ai.toast.success(l("taskPage.taskCancelled")),M()}).catch(()=>ai.toast.error("Failed to cancel task"))}}}),M();return}if(c.hasWorktree&&c.hasCommits){G({task:b,commitLog:c.commitLog,commitCount:c.commitLog.length}),M();return}await (0,aH.updateTaskStatus)(a,"DONE"),ai.toast.success(l("taskPage.taskCompleted")),M()}catch{ai.toast.error("Failed to complete task"),M()}},[h,M,l]),P=(0,c.useCallback)(async a=>{let b=h.find(b=>b.id===a);if(b)try{let c=await (0,aI.checkWorktreeClean)(a);if(!c.hasWorktree){await (0,aH.updateTaskStatus)(a,"CANCELLED"),ai.toast.success(l("taskPage.taskCancelled")),M();return}I({task:b,files:c.files,commitLog:c.commitLog}),M()}catch{ai.toast.error("Failed to cancel task"),M()}},[h,M,l]),Q=(0,c.useCallback)(async(a,b)=>{"DONE"===b?await O(a):"CANCELLED"===b?await P(a):(await (0,aH.updateTaskStatus)(a,b),M())},[M,O,P]),R=(0,c.useCallback)(async a=>{let b=await (0,a1.createTask)({title:a.title,description:a.description,projectId:e,priority:a.priority,status:a.status,labelIds:a.labelIds,baseBranch:a.baseBranch,subPath:a.subPath,versionId:a.versionId??void 0});if(a.autoStart&&b?.id)try{await (0,a5.startPtyExecution)(b.id,""),z(b.id)}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}M()},[e,M]),S=(0,c.useCallback)(async(a,b)=>{await (0,a2.updateTask)(a,{...b,labelIds:b.labelIds}),E(null),M()},[M]),T=(0,c.useCallback)(async a=>{await a3(a),y===a&&z(null),M()},[M,y]),U=(0,c.useCallback)(async a=>{await a4(a),M()},[M]),V=(0,c.useCallback)(async b=>{try{await (0,a5.startPtyExecution)(b,"")}catch(a){ai.toast.error(a instanceof Error?a.message:String(a))}k.push(`/workspaces/${a}/tasks/${b}`)},[k,a]),W=(0,c.useCallback)(async(a,b)=>{"DONE"===b?await O(a):"CANCELLED"===b?await P(a):(await (0,aH.updateTaskStatus)(a,b),M())},[M,O,P]),X=(0,c.useCallback)(a=>{x(a),E(null),v(!0)},[]),Y=(0,c.useCallback)(a=>{E(a),v(!0)},[]),Z=h.filter(a=>!a.labels?.some(a=>a.label.name===r.TOWER_LABEL_NAME&&a.label.isBuiltin)).filter(a=>{if("backlog"===s){if(a.versionId)return!1}else if("all"!==s&&a.versionId!==s)return!1;if(p.trim()){let b=p.toLowerCase();if(!a.title.toLowerCase().includes(b)&&!a.description?.toLowerCase().includes(b))return!1}return!0});return(0,b.jsxs)("div",{className:"flex h-full",children:[(0,b.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,b.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,b.jsx)(ba,{projects:g,activeProjectId:e,workspaceId:a,onSelect:b=>k.push(`/workspaces/${a}?projectId=${b}`,{scroll:!1})})}),(0,b.jsx)(o,{searchQuery:p,onSearchChange:N,versions:A,versionFilter:s,onVersionFilterChange:t,versionsHref:`/workspaces/${a}/projects/${e}/versions`,onCreateTask:()=>{E(null),v(!0)}}),(0,b.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,b.jsx)(K,{initialTasks:Z,onTaskMove:Q,onTaskClick:a=>{z(a.id)},onEditTask:Y,onAddTask:X,onDeleteTask:T,onTogglePin:U,workspaceId:a,onContextMenuStatusChange:W,onContextMenuLaunch:V})}),(0,b.jsx)(L.CreateTaskDialog,{open:u,onOpenChange:a=>{v(a),a||E(null)},onSubmit:R,onUpdate:S,defaultStatus:w,editTask:D,editTaskLabelIds:D?.labels?D.labels.map(a=>a.labelId):[],labels:i.filter(a=>!(a.name===r.TOWER_LABEL_NAME&&a.isBuiltin)),projectType:f.type,projectLocalPath:f.localPath,versions:A,defaultVersionId:J})]}),C?(0,b.jsx)(a0,{task:C,workspaceId:a,projectLocalPath:f.localPath,onClose:()=>z(null)}):(0,b.jsx)(as,{project:f,workspaceId:a}),F&&(0,b.jsx)(aA.TaskMergeConfirmDialog,{open:!0,onOpenChange:a=>{a||G(null)},taskId:F.task.id,taskTitle:F.task.title,baseBranch:F.task.baseBranch??"main",fileCount:0,commitCount:F.commitCount,commitLog:F.commitLog,onMergeComplete:()=>{G(null),ai.toast.success(l("taskPage.taskCompleted")),M()}}),H&&(0,b.jsx)(bc,{open:!0,onOpenChange:a=>{a||I(null)},taskTitle:H.task.title,uncommittedFiles:H.files,commitLog:H.commitLog,onConfirm:()=>{let a=H.task.id;I(null),(0,aH.updateTaskStatus)(a,"CANCELLED").then(()=>{ai.toast.success(l("taskPage.taskCancelled")),M()}).catch(()=>ai.toast.error("Failed to cancel task"))}})]})}],473935)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_app_workspaces_%5BworkspaceId%5D_board-page-client_tsx_0gips66._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[778772,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(774881),e=a.i(704494),f=a.i(573242),g=a.i(865011),h=a.i(951192),i=a.i(521007),j=a.i(419464),k=a.i(780410);let l=(0,k.createServerReference)("602608d9219b9318d9cae42357e9e8ea44838f96a6",k.callServer,void 0,k.findSourceMapURL,"updateNote");var m=a.i(153567);let n=(0,k.createServerReference)("6017816670ecbf8674b5831ee00cc9d48413742341",k.callServer,void 0,k.findSourceMapURL,"getProjectNotes");var o=a.i(368114);function p({active:a,onSelect:c}){let{t:d}=(0,h.useI18n)();return(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)("button",{onClick:()=>c("all"),className:(0,o.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===a?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:d("notes.allCategories")}),i.NOTE_CATEGORIES_PRESET.map(d=>(0,b.jsx)("button",{onClick:()=>c(d),className:(0,o.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",a===d?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:d},d))]})}var q=a.i(699570),r=a.i(580701),s=a.i(350739),t=a.i(579834),u=a.i(690251),v=a.i(975231);let w=(0,a.i(711796).default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);a.i(757942);var x=a.i(950314);function y({note:a,onEdit:c,onDelete:d,onPreview:e,onTaskClick:f}){let{t:g}=(0,h.useI18n)(),i=a.content.slice(0,300);return(0,b.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,b.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,b.jsx)(q.Button,{variant:"ghost",size:"icon-sm",onClick:()=>c(a),className:"text-muted-foreground","aria-label":g("notes.edit"),children:(0,b.jsx)(u.Pencil,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(q.Button,{variant:"ghost",size:"icon-sm",onClick:()=>d(a.id),className:"text-muted-foreground hover:text-rose-400","aria-label":g("notes.delete"),children:(0,b.jsx)(v.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("div",{className:"mb-2 pr-16",children:(0,b.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:a.title})}),(0,b.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)("span",{className:"inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:a.category}),a.taskId&&a.taskTitle&&(0,b.jsxs)("button",{type:"button",onClick:()=>a.taskId&&f?.(a.taskId),disabled:!f,className:`inline-flex max-w-[160px] items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary ${f?"cursor-pointer hover:bg-primary/15":"cursor-default"}`,title:a.taskTitle,children:[(0,b.jsx)(w,{className:"h-2.5 w-2.5 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:a.taskTitle})]})]}),(0,b.jsx)("button",{type:"button",onClick:()=>e?.(a),disabled:!e,className:`block w-full text-left ${e?"cursor-pointer":"cursor-default"}`,title:e?g("notes.previewNote"):void 0,children:(0,b.jsx)("div",{className:"max-h-24 overflow-hidden text-sm leading-relaxed text-muted-foreground",children:(0,b.jsx)(x.Streamdown,{children:i})})})]})}function z({notes:a,onEdit:c,onDelete:d,onPreview:e,onTaskClick:f}){let{t:g}=(0,h.useI18n)();return 0===a.length?(0,b.jsx)(t.EmptyState,{icon:s.FileText,title:g("notes.empty"),description:g("notes.emptyHint")}):(0,b.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:a.map(a=>(0,b.jsx)(y,{note:a,onEdit:c,onDelete:d,onPreview:e,onTaskClick:f},a.id))})}var A=a.i(429246);function B({value:a,onChange:c}){return(0,b.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,b.jsx)(A.Textarea,{value:a,onChange:a=>c(a.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,b.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,b.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border text-sm leading-relaxed",children:(0,b.jsx)(x.Streamdown,{children:a})})})]})}var C=a.i(510650),D=a.i(269876),E=a.i(972420);a.s(["NotesPageClient",0,function({allWorkspaces:a,initialWorkspaceId:k,initialProjectId:o,initialNotes:s}){let t,u,{t:v}=(0,h.useI18n)(),[w,x]=(0,c.useTransition)(),[y,A]=(0,c.useState)(k),[F,G]=(0,c.useState)(o),[H,I]=(0,c.useState)(s),[J,K]=(0,c.useState)("all"),[L,M]=(0,c.useState)(""),[N,O]=(0,c.useState)(null),[P,Q]=(0,c.useState)(null),[R,S]=(0,c.useState)(null),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(""),[X,Y]=(0,c.useState)(""),[Z,$]=(0,c.useState)(i.NOTE_CATEGORIES_PRESET[3]),[_,aa]=(0,c.useState)(k),[ab,ac]=(0,c.useState)(o),ad=a.find(a=>a.id===y),ae=ad?.projects??[],af=a.find(a=>a.id===_),ag=af?.projects??[],ah=(0,c.useCallback)(a=>{a?x(async()=>{I(await n(a))}):I([])},[x]),ai=async()=>{ab&&V.trim()&&(await (0,j.createNote)({title:V.trim(),content:X,category:Z,projectId:ab}),U(!1),ab===F&&ah(F))},aj=async()=>{R&&V.trim()&&(await l(R.id,{title:V.trim(),content:X,category:Z}),S(null),ah(F))},ak=async a=>{let b=H.find(b=>b.id===a);!b||confirm(v("notes.deleteConfirm",{title:b.title}))&&(await (0,m.deleteNote)(a),ah(F))},al=L.trim().toLowerCase(),am=H.filter(a=>"all"===J||a.category===J).filter(a=>!al||a.title.toLowerCase().includes(al)).map(a=>({id:a.id,title:a.title,content:a.content,category:a.category,updatedAt:new Date(a.updatedAt),taskId:a.taskId,taskTitle:a.task?.title??null})),an=T||null!==R;return(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsx)(g.SubPageNav,{workspaceId:y}),(0,b.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,b.jsxs)(r.Select,{value:y,onValueChange:b=>b&&(b=>{if(b===y)return;A(b);let c=a.find(a=>a.id===b),d=c?.projects[0]??null;G(d?.id??null),K("all"),ah(d?.id??null)})(b),children:[(0,b.jsx)(r.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,b.jsx)("span",{className:"truncate",children:a.find(a=>a.id===y)?.name??y})}),(0,b.jsx)(r.SelectContent,{children:a.map(a=>(0,b.jsx)(r.SelectItem,{value:a.id,children:a.name},a.id))})]}),ae.length>0&&(0,b.jsxs)(r.Select,{value:F??"",onValueChange:a=>a&&void(a!==F&&(G(a),K("all"),ah(a))),children:[(0,b.jsx)(r.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,b.jsx)("span",{className:"truncate",children:(t=ae.find(a=>a.id===F))?t.alias?`${t.name} (${t.alias})`:t.name:""})}),(0,b.jsx)(r.SelectContent,{children:ae.map(a=>(0,b.jsxs)(r.SelectItem,{value:a.id,children:[a.name,a.alias?` (${a.alias})`:""]},a.id))})]}),!an&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"relative ml-auto",children:[(0,b.jsx)(f.Search,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)("input",{type:"text",value:L,onChange:a=>M(a.target.value),placeholder:v("notes.searchPlaceholder"),className:"h-8 w-48 rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),(0,b.jsxs)(q.Button,{onClick:()=>{W(""),Y(""),$(i.NOTE_CATEGORIES_PRESET[3]),aa(y),ac(F),S(null),U(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(d.Plus,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:v("notes.newNote")})]})]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:an?(0,b.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!R&&(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.workspace")}),(0,b.jsxs)(r.Select,{value:_,onValueChange:b=>b&&(b=>{if(b===_)return;aa(b);let c=a.find(a=>a.id===b),d=c?.projects[0]??null;ac(d?.id??null)})(b),children:[(0,b.jsx)(r.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,b.jsx)("span",{className:"truncate",children:a.find(a=>a.id===_)?.name??_})}),(0,b.jsx)(r.SelectContent,{children:a.map(a=>(0,b.jsx)(r.SelectItem,{value:a.id,children:a.name},a.id))})]})]}),!R&&ag.length>0&&(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.project")}),(0,b.jsxs)(r.Select,{value:ab??"",onValueChange:a=>a&&ac(a),children:[(0,b.jsx)(r.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,b.jsx)("span",{className:"truncate",children:(u=ag.find(a=>a.id===ab))?u.alias?`${u.name} (${u.alias})`:u.name:""})}),(0,b.jsx)(r.SelectContent,{children:ag.map(a=>(0,b.jsxs)(r.SelectItem,{value:a.id,children:[a.name,a.alias?` (${a.alias})`:""]},a.id))})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.categoryLabel")}),(0,b.jsxs)(r.Select,{value:Z,onValueChange:a=>a&&$(a),children:[(0,b.jsx)(r.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,b.jsx)("span",{className:"truncate",children:Z})}),(0,b.jsx)(r.SelectContent,{children:i.NOTE_CATEGORIES_PRESET.map(a=>(0,b.jsx)(r.SelectItem,{value:a,children:a},a))})]})]})]}),(0,b.jsx)("input",{type:"text",value:V,onChange:a=>W(a.target.value),placeholder:v("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,b.jsx)(B,{value:X,onChange:Y}),(0,b.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,b.jsx)(q.Button,{variant:"outline",onClick:()=>{U(!1),S(null)},children:v("notes.cancel")}),(0,b.jsx)(q.Button,{onClick:R?aj:ai,disabled:!V.trim()||!R&&!ab,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:v("notes.save")})]})]}):(0,b.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 gap-4",children:[(0,b.jsx)(p,{active:J,onSelect:K}),(0,b.jsx)(D.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsxs)("div",{className:`relative ${w?"opacity-40 pointer-events-none":""} transition-opacity`,children:[w&&(0,b.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,b.jsx)(e.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===ae.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:v("notes.noProject")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:v("notes.noProjectHint")})]}):(0,b.jsx)(z,{notes:am,onEdit:a=>{W(a.title),Y(a.content),$(a.category),S(a),U(!1)},onDelete:ak,onPreview:O,onTaskClick:Q})]})})]})}),(0,b.jsx)(C.NotePreviewDialog,{note:N,open:null!==N,onOpenChange:a=>{a||O(null)}}),(0,b.jsx)(E.TaskOverviewDrawer,{open:null!==P,onOpenChange:a=>{a||Q(null)},taskId:P})]})}],778772)}];
|
|
1
|
+
module.exports=[778772,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(774881),e=a.i(704494),f=a.i(573242),g=a.i(865011),h=a.i(951192),i=a.i(521007),j=a.i(523824),k=a.i(780410);let l=(0,k.createServerReference)("60e201e8781176b046ce0e6a3c01656f887dd175a7",k.callServer,void 0,k.findSourceMapURL,"updateNote");var m=a.i(656830);let n=(0,k.createServerReference)("6012335170d1a5efb1eddec3143acad7e39a0d886c",k.callServer,void 0,k.findSourceMapURL,"getProjectNotes");var o=a.i(368114);function p({active:a,onSelect:c}){let{t:d}=(0,h.useI18n)();return(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)("button",{onClick:()=>c("all"),className:(0,o.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===a?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:d("notes.allCategories")}),i.NOTE_CATEGORIES_PRESET.map(d=>(0,b.jsx)("button",{onClick:()=>c(d),className:(0,o.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",a===d?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:d},d))]})}var q=a.i(699570),r=a.i(580701),s=a.i(350739),t=a.i(579834),u=a.i(690251),v=a.i(975231);let w=(0,a.i(711796).default)("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);a.i(757942);var x=a.i(950314);function y({note:a,onEdit:c,onDelete:d,onPreview:e,onTaskClick:f}){let{t:g}=(0,h.useI18n)(),i=a.content.slice(0,300);return(0,b.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,b.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,b.jsx)(q.Button,{variant:"ghost",size:"icon-sm",onClick:()=>c(a),className:"text-muted-foreground","aria-label":g("notes.edit"),children:(0,b.jsx)(u.Pencil,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(q.Button,{variant:"ghost",size:"icon-sm",onClick:()=>d(a.id),className:"text-muted-foreground hover:text-rose-400","aria-label":g("notes.delete"),children:(0,b.jsx)(v.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,b.jsx)("div",{className:"mb-2 pr-16",children:(0,b.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:a.title})}),(0,b.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)("span",{className:"inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:a.category}),a.taskId&&a.taskTitle&&(0,b.jsxs)("button",{type:"button",onClick:()=>a.taskId&&f?.(a.taskId),disabled:!f,className:`inline-flex max-w-[160px] items-center gap-1 rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary ${f?"cursor-pointer hover:bg-primary/15":"cursor-default"}`,title:a.taskTitle,children:[(0,b.jsx)(w,{className:"h-2.5 w-2.5 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:a.taskTitle})]})]}),(0,b.jsx)("button",{type:"button",onClick:()=>e?.(a),disabled:!e,className:`block w-full text-left ${e?"cursor-pointer":"cursor-default"}`,title:e?g("notes.previewNote"):void 0,children:(0,b.jsx)("div",{className:"max-h-24 overflow-hidden text-sm leading-relaxed text-muted-foreground",children:(0,b.jsx)(x.Streamdown,{children:i})})})]})}function z({notes:a,onEdit:c,onDelete:d,onPreview:e,onTaskClick:f}){let{t:g}=(0,h.useI18n)();return 0===a.length?(0,b.jsx)(t.EmptyState,{icon:s.FileText,title:g("notes.empty"),description:g("notes.emptyHint")}):(0,b.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:a.map(a=>(0,b.jsx)(y,{note:a,onEdit:c,onDelete:d,onPreview:e,onTaskClick:f},a.id))})}var A=a.i(429246);function B({value:a,onChange:c}){return(0,b.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,b.jsx)(A.Textarea,{value:a,onChange:a=>c(a.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,b.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,b.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border text-sm leading-relaxed",children:(0,b.jsx)(x.Streamdown,{children:a})})})]})}var C=a.i(510650),D=a.i(269876),E=a.i(972420);a.s(["NotesPageClient",0,function({allWorkspaces:a,initialWorkspaceId:k,initialProjectId:o,initialNotes:s}){let t,u,{t:v}=(0,h.useI18n)(),[w,x]=(0,c.useTransition)(),[y,A]=(0,c.useState)(k),[F,G]=(0,c.useState)(o),[H,I]=(0,c.useState)(s),[J,K]=(0,c.useState)("all"),[L,M]=(0,c.useState)(""),[N,O]=(0,c.useState)(null),[P,Q]=(0,c.useState)(null),[R,S]=(0,c.useState)(null),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(""),[X,Y]=(0,c.useState)(""),[Z,$]=(0,c.useState)(i.NOTE_CATEGORIES_PRESET[3]),[_,aa]=(0,c.useState)(k),[ab,ac]=(0,c.useState)(o),ad=a.find(a=>a.id===y),ae=ad?.projects??[],af=a.find(a=>a.id===_),ag=af?.projects??[],ah=(0,c.useCallback)(a=>{a?x(async()=>{I(await n(a))}):I([])},[x]),ai=async()=>{ab&&V.trim()&&(await (0,j.createNote)({title:V.trim(),content:X,category:Z,projectId:ab}),U(!1),ab===F&&ah(F))},aj=async()=>{R&&V.trim()&&(await l(R.id,{title:V.trim(),content:X,category:Z}),S(null),ah(F))},ak=async a=>{let b=H.find(b=>b.id===a);!b||confirm(v("notes.deleteConfirm",{title:b.title}))&&(await (0,m.deleteNote)(a),ah(F))},al=L.trim().toLowerCase(),am=H.filter(a=>"all"===J||a.category===J).filter(a=>!al||a.title.toLowerCase().includes(al)).map(a=>({id:a.id,title:a.title,content:a.content,category:a.category,updatedAt:new Date(a.updatedAt),taskId:a.taskId,taskTitle:a.task?.title??null})),an=T||null!==R;return(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsx)(g.SubPageNav,{workspaceId:y}),(0,b.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,b.jsxs)(r.Select,{value:y,onValueChange:b=>b&&(b=>{if(b===y)return;A(b);let c=a.find(a=>a.id===b),d=c?.projects[0]??null;G(d?.id??null),K("all"),ah(d?.id??null)})(b),children:[(0,b.jsx)(r.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,b.jsx)("span",{className:"truncate",children:a.find(a=>a.id===y)?.name??y})}),(0,b.jsx)(r.SelectContent,{children:a.map(a=>(0,b.jsx)(r.SelectItem,{value:a.id,children:a.name},a.id))})]}),ae.length>0&&(0,b.jsxs)(r.Select,{value:F??"",onValueChange:a=>a&&void(a!==F&&(G(a),K("all"),ah(a))),children:[(0,b.jsx)(r.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,b.jsx)("span",{className:"truncate",children:(t=ae.find(a=>a.id===F))?t.alias?`${t.name} (${t.alias})`:t.name:""})}),(0,b.jsx)(r.SelectContent,{children:ae.map(a=>(0,b.jsxs)(r.SelectItem,{value:a.id,children:[a.name,a.alias?` (${a.alias})`:""]},a.id))})]}),!an&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"relative ml-auto",children:[(0,b.jsx)(f.Search,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,b.jsx)("input",{type:"text",value:L,onChange:a=>M(a.target.value),placeholder:v("notes.searchPlaceholder"),className:"h-8 w-48 rounded-md border border-border bg-background pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),(0,b.jsxs)(q.Button,{onClick:()=>{W(""),Y(""),$(i.NOTE_CATEGORIES_PRESET[3]),aa(y),ac(F),S(null),U(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(d.Plus,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:v("notes.newNote")})]})]})]}),(0,b.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:an?(0,b.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!R&&(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.workspace")}),(0,b.jsxs)(r.Select,{value:_,onValueChange:b=>b&&(b=>{if(b===_)return;aa(b);let c=a.find(a=>a.id===b),d=c?.projects[0]??null;ac(d?.id??null)})(b),children:[(0,b.jsx)(r.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,b.jsx)("span",{className:"truncate",children:a.find(a=>a.id===_)?.name??_})}),(0,b.jsx)(r.SelectContent,{children:a.map(a=>(0,b.jsx)(r.SelectItem,{value:a.id,children:a.name},a.id))})]})]}),!R&&ag.length>0&&(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.project")}),(0,b.jsxs)(r.Select,{value:ab??"",onValueChange:a=>a&&ac(a),children:[(0,b.jsx)(r.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,b.jsx)("span",{className:"truncate",children:(u=ag.find(a=>a.id===ab))?u.alias?`${u.name} (${u.alias})`:u.name:""})}),(0,b.jsx)(r.SelectContent,{children:ag.map(a=>(0,b.jsxs)(r.SelectItem,{value:a.id,children:[a.name,a.alias?` (${a.alias})`:""]},a.id))})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.categoryLabel")}),(0,b.jsxs)(r.Select,{value:Z,onValueChange:a=>a&&$(a),children:[(0,b.jsx)(r.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,b.jsx)("span",{className:"truncate",children:Z})}),(0,b.jsx)(r.SelectContent,{children:i.NOTE_CATEGORIES_PRESET.map(a=>(0,b.jsx)(r.SelectItem,{value:a,children:a},a))})]})]})]}),(0,b.jsx)("input",{type:"text",value:V,onChange:a=>W(a.target.value),placeholder:v("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,b.jsx)(B,{value:X,onChange:Y}),(0,b.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,b.jsx)(q.Button,{variant:"outline",onClick:()=>{U(!1),S(null)},children:v("notes.cancel")}),(0,b.jsx)(q.Button,{onClick:R?aj:ai,disabled:!V.trim()||!R&&!ab,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:v("notes.save")})]})]}):(0,b.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 gap-4",children:[(0,b.jsx)(p,{active:J,onSelect:K}),(0,b.jsx)(D.ScrollArea,{className:"flex-1 min-h-0",children:(0,b.jsxs)("div",{className:`relative ${w?"opacity-40 pointer-events-none":""} transition-opacity`,children:[w&&(0,b.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,b.jsx)(e.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===ae.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,b.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:v("notes.noProject")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:v("notes.noProjectHint")})]}):(0,b.jsx)(z,{notes:am,onEdit:a=>{W(a.title),Y(a.content),$(a.category),S(a),U(!1)},onDelete:ak,onPreview:O,onTaskClick:Q})]})})]})}),(0,b.jsx)(C.NotePreviewDialog,{note:N,open:null!==N,onOpenChange:a=>{a||O(null)}}),(0,b.jsx)(E.TaskOverviewDrawer,{open:null!==P,onOpenChange:a=>{a||Q(null)},taskId:P})]})}],778772)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_app_workspaces_%5BworkspaceId%5D_notes_notes-page-client_tsx_10gyo3v._.js.map
|