tower-studio 0.2.39 → 0.2.41
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 +3 -3
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +31 -31
- package/.next/standalone/.next/server/app/_not-found/page.js +3 -3
- 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 +1 -1
- 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 +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.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js +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 +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 +2 -2
- 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 +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 +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 +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 +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 +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/stop/route.js +2 -2
- 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 +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 +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]/start/route.js +3 -3
- package/.next/standalone/.next/server/app/api/internal/terminal/[taskId]/start/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]/merge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +70 -70
- package/.next/standalone/.next/server/app/missions/page.js +6 -6
- 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 +3 -3
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +31 -31
- package/.next/standalone/.next/server/app/onboarding/page.js +3 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +31 -31
- package/.next/standalone/.next/server/app/page.js +3 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +48 -48
- package/.next/standalone/.next/server/app/settings/page.js +5 -5
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +106 -106
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +5 -5
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +87 -87
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +3 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +74 -74
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +3 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +79 -79
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +3 -3
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +31 -31
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +4 -4
- 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 +3 -3
- 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 +5 -5
- 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 +4 -4
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +82 -82
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +6 -6
- 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 +3 -3
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +49 -49
- package/.next/standalone/.next/server/app/workspaces/page.js +3 -3
- 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/07-d_@anthropic-ai_claude-agent-sdk_sdk_mjs_0.721uk._.js +16 -9
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +5 -5
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
- package/.next/standalone/.next/server/chunks/0zjb_server_app_api_internal_assets_[projectId]_[filename]_route_actions_08y.jen.js +1 -1
- package/.next/standalone/.next/server/chunks/[externals]__0izylsq._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0lioghc._.js → [root-of-the-server]__0-~q463._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.z8.oi._.js +4 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__00llstz._.js → [root-of-the-server]__02jy80j._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0dy~osn._.js → [root-of-the-server]__032d9pl._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__08u6wg.._.js → [root-of-the-server]__037x-0a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__08xus7y._.js → [root-of-the-server]__04jduyo._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__04u7b2g._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05nz.tg._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ai09na._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__00mjz~7._.js → [root-of-the-server]__0az764e._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__12ohpl.._.js → [root-of-the-server]__0b3m.jm._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_3ce_3._.js → [root-of-the-server]__0c7z.~a._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fp8qv9._.js +28 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0d2japj._.js → [root-of-the-server]__0giry~0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j05vlm._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__01n7exm._.js → [root-of-the-server]__0kexk71._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0qif839._.js → [root-of-the-server]__0kuo6q5._.js} +3 -3
- 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]__0~foo~5._.js → [root-of-the-server]__0np.553._.js} +3 -3
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0q8.khe._.js → [root-of-the-server]__0r-6wmj._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t_yyy8._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0omyrab._.js → [root-of-the-server]__0u_-4~7._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xswbi9._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0tys9pv._.js → [root-of-the-server]__0z20rmt._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11l3gud._.js +3 -0
- package/.next/standalone/.next/server/chunks/{_0lb0q5p._.js → _06.mxka._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{src_0bkvm8c._.js → src_02ruq-1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/src_0weytpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_02llcit._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_12xey8u._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_ai_0xx6y51._.js +1 -1
- 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/[root-of-the-server]__0.-z9ts._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0f88ua~._.js → [root-of-the-server]__0.2h0ux._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07_o.al._.js → [root-of-the-server]__0.infp2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__04rp1ck._.js → [root-of-the-server]__0.u-t.1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0k-mx8r._.js → [root-of-the-server]__02j1enz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0guqcva._.js → [root-of-the-server]__038u_kv._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_1zewr._.js → [root-of-the-server]__0391jsv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0_i7zpd._.js → [root-of-the-server]__03fujv7._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__04wbr9x._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0-tolks._.js → [root-of-the-server]__058rbx5._.js} +4 -4
- 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]__08w4.zf._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0lozqxc._.js → [root-of-the-server]__094t44p._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__02ur64h._.js → [root-of-the-server]__09t~p.u._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m7ydqb._.js → [root-of-the-server]__09z_ddd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0p0te97._.js → [root-of-the-server]__0ce3fpq._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__062b.yt._.js → [root-of-the-server]__0da~mv~._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dn90me._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0qqbb31._.js → [root-of-the-server]__0dux7x.._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gtqd5o._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0th-t1a._.js → [root-of-the-server]__0h589~0._.js} +4 -4
- 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]__00~jawi._.js → [root-of-the-server]__0l6bt9t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m80~su._.js → [root-of-the-server]__0mmypbn._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0mpjat-._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__09s~cme._.js → [root-of-the-server]__0mq0f94._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ni-_7_._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0nwisa8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0scj6ed._.js → [root-of-the-server]__0odeai5._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0siyg1p._.js → [root-of-the-server]__0oq-j16._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0na8eiv._.js → [root-of-the-server]__0pmjob9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0lz4wdp._.js → [root-of-the-server]__0pvaj~l._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0wofia_._.js → [root-of-the-server]__0rckee~._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0e-k-gl._.js → [root-of-the-server]__0w--i~y._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0y~ooou._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0k1ivnj._.js → [root-of-the-server]__0zkpwjj._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0t6f4lq._.js → [root-of-the-server]__10s67lq._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__093tt4a._.js → [root-of-the-server]__12w35bx._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{_0e-zyn2._.js → _0-_yznx._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_00t6138._.js → _03lt1_x._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/_03v~rg0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0l3l_d6._.js → _04bt0.3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_06nlsbw._.js → _04mn9go._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0cxhub8._.js → _04~zqvy._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0gb8a9_._.js → _0_6ss3p._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0_9i_x2._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0_z-t6g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0b.qjaj._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0t0oltj._.js → _0dzx554._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0mdqhxi._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_02encue._.js → _0mm~wxj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_07fnvnm._.js → _0n4bq0m._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0n54odq._.js → _0n5do.z._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0ng0eku._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0n1l7yo._.js → _0p6p_68._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{_0clhm~f._.js → _0py1s-f._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0r-flc_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0rkdyad._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0mzwe90._.js → _0rrzd20._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0k9b94s._.js → _0t863nl._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_00kwrmr._.js → _0tsu0gq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0_hnt09._.js → _0tvm5af._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0mpce0d._.js → _0u7c6bz._.js} +4 -4
- package/.next/standalone/.next/server/chunks/ssr/{_0hu0tyg._.js → _0u_uywm._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0v66l8c._.js → _0z6ji0d._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0muaopo._.js → _12ca88g._.js} +4 -4
- 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_01xtio2._.js → src_lib_02~3_5t._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_03p6skw._.js → src_lib_04d~c.c._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_05mu4f0._.js → src_lib_08wv1le._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_06nbc41._.js → src_lib_0_9avpk._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0a60u40._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fu5szn._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0gve57o._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0koe0p0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0qdh-v4._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ramp4w._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sms4xl._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sn1z-s._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_110am8v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_11w~.ge._.js +3 -0
- 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 +301 -301
- package/.next/standalone/.next/static/chunks/0-x5eie9u3i_2.js +1 -0
- package/.next/standalone/.next/static/chunks/00w9dd4fooyic.js +1 -0
- package/.next/standalone/.next/static/chunks/{112wpv9rqw4dp.js → 02o~o8tgt860j.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0h73q-9fyea0t.js → 03sdutmq6~3v-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0e9ykduz3_0e1.js → 04zy.uc7eru64.js} +1 -1
- package/.next/standalone/.next/static/chunks/{01ijm9dpmm34q.js → 05zm_-7x0fubq.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0t_3wwd~mmc.1.js → 05~2gwcex7hv0.js} +1 -1
- package/.next/standalone/.next/static/chunks/062.w.nsp3886.js +1 -0
- package/.next/standalone/.next/static/chunks/06lla3jtd~xb4.js +1 -0
- package/.next/standalone/.next/static/chunks/{0dha37i1oc6z~.js → 06s-d8my6b9t7.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0u.3xek3m2ud..js → 0ad0ou7l2.r6e.js} +1 -1
- package/.next/standalone/.next/static/chunks/{11.r6a56ss7qu.js → 0babmd83h6ejs.js} +1 -1
- package/.next/standalone/.next/static/chunks/0c8c6pcmlzgmi.js +1 -0
- package/.next/standalone/.next/static/chunks/0c~~56wny5m2u.js +1 -0
- package/.next/standalone/.next/static/chunks/{0h4k3cicu7g-w.js → 0ev98toavtr6..js} +1 -1
- package/.next/standalone/.next/static/chunks/{0u.b0t7fueh-x.js → 0fz47g1x5o2xj.js} +1 -1
- package/.next/standalone/.next/static/chunks/0i2soupf1735z.js +1 -0
- package/.next/standalone/.next/static/chunks/{050agjgyp545k.js → 0l25d0nc5ygyd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0_-2es-r~03mg.js → 0lnsj7fwkprxe.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0a._hcvzq4ko7.js → 0oz8sw6j078vm.js} +2 -2
- package/.next/standalone/.next/static/chunks/0tfmi08mzcieh.js +1 -0
- package/.next/standalone/.next/static/chunks/{023v9juzhzc~d.js → 0umi7ddtiv8sw.js} +1 -1
- package/.next/standalone/.next/static/chunks/0w33dj~dfamnr.css +1 -0
- package/.next/standalone/.next/static/chunks/0y3a2-c-i9t~t.js +1 -0
- package/.next/standalone/.next/static/chunks/10qltt-r5q91p.js +1 -0
- package/.next/standalone/.next/static/chunks/{0p5rare_o5zb1.js → 1195ux3t_r-rb.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0w14di5d0vw6-.js → 11sqt~58g35be.js} +1 -1
- package/.next/standalone/.next/static/chunks/12rj7-g8lxjew.js +1 -0
- package/.next/standalone/package.json +1 -1
- package/bin/tower.mjs +10 -1
- package/dist/mcp-server.cjs +266 -145
- package/package.json +1 -1
- package/scripts/migrations/0004-relocate-misplaced-assets.ts +172 -0
- package/.next/standalone/.next/server/chunks/[externals]__0k7u3dx._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.a1443._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00~-bvt._.js +0 -28
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01yu.gw._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0965p6t._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c513um._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qijr4h._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rc0ntp._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0.~z1-.._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05sv58d._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0gzafdq._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0i0o7w5._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kgd-1s._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qnzkj3._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0qp5cw1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xte.35._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0-qd2ss._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_05jv_cy._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_07c-9da._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0gxccup._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0m.34j8._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0w9~m7o._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_06okbb2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0741dos._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0cbuy0_._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0e27xy7._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0n5-vk5._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0rk2hla._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0t5xz2y._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0u5_gf2._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0v6s6se._.js +0 -3
- package/.next/standalone/.next/static/chunks/0.euy5rie4v3d.js +0 -1
- package/.next/standalone/.next/static/chunks/01.nidb8sf6bh.js +0 -1
- package/.next/standalone/.next/static/chunks/02jsekc779t5~.js +0 -1
- package/.next/standalone/.next/static/chunks/0fy6w5d_zyro0.js +0 -1
- package/.next/standalone/.next/static/chunks/0g-gbdkcssn.g.js +0 -1
- package/.next/standalone/.next/static/chunks/0h7~fn.p-fxz_.js +0 -1
- package/.next/standalone/.next/static/chunks/0j2n.h0~von8h.js +0 -1
- package/.next/standalone/.next/static/chunks/0k.hp06ufx4yp.js +0 -1
- package/.next/standalone/.next/static/chunks/0lk-i0jm2ubea.css +0 -1
- package/.next/standalone/.next/static/chunks/0q~4dhw.phxg3.js +0 -1
- package/.next/standalone/.next/static/chunks/0z2blg_osfipv.js +0 -1
- package/.next/standalone/.next/static/chunks/134c60acdsr_g.js +0 -1
- /package/.next/standalone/.next/static/{JutVIyokVf-YrN6j2WEwG → zSKVtiYaR_yWxx7AopTMR}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{JutVIyokVf-YrN6j2WEwG → zSKVtiYaR_yWxx7AopTMR}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{JutVIyokVf-YrN6j2WEwG → zSKVtiYaR_yWxx7AopTMR}/_ssgManifest.js +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[520788,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(940271),f=a.i(951192),g=a.i(699570),h=a.i(866718),i=a.i(429246),j=a.i(412783),k=a.i(786304),l=a.i(563658),m=a.i(814574),n=a.i(368114),o=a.i(369289),p=a.i(711796);let q=(0,p.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var r=a.i(350739);let s=(0,p.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var t=a.i(190076),u=a.i(705594),v=a.i(264589),w=a.i(567648),x=a.i(54384),y=a.i(774881);let z=(0,p.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var A=a.i(975231);let B=(0,p.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),C=(0,p.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var D=a.i(704494),E=a.i(913284),F=a.i(468862),G=a.i(347165),H=a.i(526385),I=a.i(202722),J=a.i(435393),K=a.i(780410);let L=(0,K.createServerReference)("00a9b88fdb6f5d2ed889612ced6fe0412b32143347",K.callServer,void 0,K.findSourceMapURL,"getAvailableTerminalApps"),M=(0,K.createServerReference)("00fc8b1d62e542629a0e6007ad82949d0c44f5f5d6",K.callServer,void 0,K.findSourceMapURL,"getAvailableEditors");var N=a.i(613);let O=(0,K.createServerReference)("407512b7b9b2f064d7744189e6d5d3e893af35cebf",K.callServer,void 0,K.findSourceMapURL,"createPrompt"),P=(0,K.createServerReference)("6094261d366daf128b98e674fd9f7bf43b702d2daa",K.callServer,void 0,K.findSourceMapURL,"updatePrompt"),Q=(0,K.createServerReference)("40ffc3766d89ade2c802caac13efac204022d0c813",K.callServer,void 0,K.findSourceMapURL,"deletePrompt"),R=(0,K.createServerReference)("601d52a42f6bd7ee64ffb5a742aa2282269d01aff8",K.callServer,void 0,K.findSourceMapURL,"setDefaultPrompt"),S=(0,K.createServerReference)("00da2a5f591929ca53bfa580ff25c0e6051ee14a49",K.callServer,void 0,K.findSourceMapURL,"getAvailableProviders");var T=a.i(785259),U=a.i(43775);let V=(0,p.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var W=a.i(324954);let X=(0,p.default)("folder-up",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var Y=a.i(747798),Z=a.i(811344),$=a.i(607219),_=a.i(952313);let aa=(0,K.createServerReference)("40f45f0e421d54fbeacc99f5c41bdc3c3966622260",K.callServer,void 0,K.findSourceMapURL,"createBackup"),ab=(0,K.createServerReference)("001a0afa4681640a1dc92fd15acc3aed9e487a8aed",K.callServer,void 0,K.findSourceMapURL,"listBackupFiles"),ac=(0,K.createServerReference)("4054cf72e76a90d5af2643826442bb2ca4ce7367bf",K.callServer,void 0,K.findSourceMapURL,"deleteBackupFile"),ad=(0,K.createServerReference)("40770d34aa9b30e902656aabe7e5366b8945a42fd1",K.callServer,void 0,K.findSourceMapURL,"restoreBackup"),ae=(0,K.createServerReference)("4050cd947db11039486171d7ea3ec48eaf68ac8ae6",K.callServer,void 0,K.findSourceMapURL,"resetSystem"),af=(0,K.createServerReference)("003b160010669afa4365f3111002c1d4402564e8de",K.callServer,void 0,K.findSourceMapURL,"getBackupDir"),ag=(0,K.createServerReference)("408ac88af370549bcc969afede2b331ca937b03c97",K.callServer,void 0,K.findSourceMapURL,"setBackupDir"),ah=(0,K.createServerReference)("00c565fb3ded56153b38eaa4ea6bbfcaab3795fd4f",K.callServer,void 0,K.findSourceMapURL,"getStorageLocation"),ai=(0,K.createServerReference)("400b71588b6e24c751248d0e7358a238f2ad19d2c6",K.callServer,void 0,K.findSourceMapURL,"setStorageLocation");function aj(){let{t:a,locale:e}=(0,f.useI18n)(),i=(0,d.useRouter)(),[j,k]=(0,c.useState)([]),[l,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(!0),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),[B,C]=(0,c.useState)(""),E=(0,c.useRef)(null),[F,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(""),J=(0,c.useCallback)(async()=>{v(!0);try{let[a,b,c]=await Promise.all([ab(),af(),ah()]);k(a),n(b),r(c)}finally{v(!1)}},[]);(0,c.useEffect)(()=>{J()},[J]);let K=async()=>{let b=B.trim()||void 0;z(!1),C(""),x("create");try{await aa(b),_.toast.success(a("settings.backup.createSuccess")),await J()}catch{_.toast.error(a("settings.backup.createError"))}finally{x(null)}},L=async b=>{if(confirm(a("settings.backup.restoreConfirm"))){x("restore");try{await ad(b),_.toast.success(a("settings.backup.restoreSuccess"),{action:{label:a("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await J()}catch{_.toast.error(a("settings.backup.restoreError"))}finally{x(null)}}},M=async b=>{if(confirm(a("settings.backup.deleteConfirm")))try{await ac(b),_.toast.success(a("settings.backup.deleteSuccess")),k(a=>a.filter(a=>a.filename!==b))}catch{_.toast.error(a("settings.backup.deleteError"))}},N=async b=>{p(!1);try{await ag(b),n(b),_.toast.success(a("settings.backup.dirSaved")),await J()}catch{_.toast.error(a("settings.backup.dirError"))}},O=async b=>{x("storage");try{let c=await ai({newPath:b});if(!c.ok)return void _.toast.error(c.error||a("settings.storage.moveError"));_.toast.success(a("settings.storage.moveSuccess",{count:String(c.moved??0)})),await J()}catch(b){_.toast.error(b instanceof Error?b.message:a("settings.storage.moveError"))}finally{x(null)}},P=async b=>{t(!1),confirm(a("settings.storage.moveConfirm"))&&await O(b)},Q=async()=>{!q||q.isDefault||confirm(a("settings.storage.resetConfirm"))&&await O(q.default)},R=async b=>{let c=b.target.files?.[0];if(c){b.target.value="",x("import");try{let b=new FormData;b.append("file",c);let d=await fetch("/api/internal/backup/import",{method:"POST",body:b});if(!d.ok){let b=await d.json();_.toast.error("Invalid backup archive"===b.error?a("settings.backup.importInvalid"):(b.error,a("settings.backup.importError")));return}_.toast.success(a("settings.backup.importSuccess")),await J()}catch{_.toast.error(a("settings.backup.importError"))}finally{x(null)}}},S=async()=>{if("RESET"===H){G(!1),I(""),x("reset");try{await ae("RESET"),_.toast.success(a("settings.backup.resetSuccess")),i.push("/")}catch{_.toast.error(a("settings.backup.resetError"))}finally{x(null)}}},aj=null!==w;return(0,b.jsxs)("div",{className:"space-y-6",children:[("restore"===w||"reset"===w)&&(0,b.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,b.jsx)(D.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===w?a("settings.backup.restoring"):a("settings.backup.resetting")})]})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-base font-semibold",children:a("settings.storage.sectionTitle")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.storage.hint")}),(0,b.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{children:[a("settings.storage.current"),":"]}),(0,b.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:q?.current??"…"}),q?.isDefault&&(0,b.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:a("settings.storage.defaultBadge")}),(0,b.jsx)(g.Button,{variant:"ghost",onClick:()=>t(!0),disabled:"storage"===w,className:"text-xs text-muted-foreground",children:"storage"===w?(0,b.jsx)(D.Loader2,{className:"h-3 w-3 animate-spin"}):a("settings.storage.change")}),q&&!q.isDefault&&(0,b.jsx)(g.Button,{variant:"ghost",onClick:Q,disabled:"storage"===w,className:"text-xs text-muted-foreground",children:a("settings.storage.reset")})]}),(0,b.jsx)(U.FolderBrowserDialog,{open:s,onOpenChange:t,onSelect:P})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-base font-semibold",children:a("settings.backup.sectionTitle")}),(0,b.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{children:[a("settings.backup.dir"),":"]}),(0,b.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:l}),(0,b.jsx)(g.Button,{variant:"ghost",onClick:()=>p(!0),className:"text-xs text-muted-foreground",children:a("settings.backup.dirChange")})]}),(0,b.jsx)(U.FolderBrowserDialog,{open:o,onOpenChange:p,onSelect:N})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.Button,{onClick:()=>{C(""),z(!0)},disabled:aj,className:"gap-2",children:"create"===w?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-4 w-4 animate-spin"})," ",a("settings.backup.creating")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(V,{className:"h-4 w-4"})," ",a("settings.backup.create")]})}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsxs)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",disabled:aj,onClick:()=>E.current?.click(),className:"gap-2"}),children:[(0,b.jsx)(X,{className:"h-4 w-4"}),a("settings.backup.import")]}),(0,b.jsx)(T.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.importHint")})]}),(0,b.jsx)("input",{ref:E,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:R})]}),(0,b.jsx)(m.Dialog,{open:y,onOpenChange:z,children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:a("settings.backup.create")})}),(0,b.jsxs)("div",{className:"py-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.backup.createLabel")}),(0,b.jsx)(h.Input,{value:B,onChange:a=>C(a.target.value),onKeyDown:a=>"Enter"===a.key&&K(),placeholder:a("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>z(!1),children:a("common.cancel")}),(0,b.jsx)(g.Button,{onClick:K,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:a("settings.backup.create")})]})]})}),u?(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(D.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===j.length?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,b.jsx)($.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("settings.backup.empty")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a("settings.backup.emptyDesc")})]}):(0,b.jsx)("div",{className:"space-y-3",children:j.map(c=>{var d,f;return(0,b.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[c.label?(0,b.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:c.label}):(0,b.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:c.filename}),c.autoBackup&&(0,b.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:a("settings.backup.autoLabel")})]}),c.label&&(0,b.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:c.filename}),(0,b.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(d=c.size)<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:`${(d/1048576).toFixed(1)} MB`," · ",(f=c.createdAt,new Date(f).toLocaleString("zh"===e?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),c.preview.length>0&&(0,b.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[c.preview.map((a,c)=>(0,b.jsxs)("span",{children:[c>0&&" ",a.workspace,"(",a.projects.join(", "),")"]},c)),c.stats.workspaces>c.preview.length&&(0,b.jsxs)("span",{children:[" ",a("settings.backup.workspaces",{count:String(c.stats.workspaces)})]})]}),(0,b.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[a("settings.backup.projects",{count:String(c.stats.projects)})," · ",a("settings.backup.tasks",{count:String(c.stats.tasks)})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>L(c.filename),disabled:aj,className:"text-muted-foreground hover:text-foreground"}),children:(0,b.jsx)(W.Upload,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(T.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.restore")})]}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>M(c.filename),disabled:aj,className:"text-muted-foreground hover:text-rose-400"}),children:(0,b.jsx)(A.Trash2,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(T.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.delete")})]})]})]})},c.filename)})}),(0,b.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,b.jsx)(Z.AlertTriangle,{className:"h-4 w-4"}),a("settings.backup.dangerZone")]}),(0,b.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:a("settings.backup.resetDesc")}),(0,b.jsxs)(g.Button,{variant:"outline",onClick:()=>{I(""),G(!0)},disabled:aj,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,b.jsx)(Y.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),a("settings.backup.reset")]})]}),(0,b.jsx)(m.Dialog,{open:F,onOpenChange:G,children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:a("settings.backup.resetConfirmTitle")}),(0,b.jsx)(m.DialogDescription,{children:a("settings.backup.resetConfirmDesc")})]}),(0,b.jsxs)("div",{className:"py-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.backup.resetConfirmInput")}),(0,b.jsx)(h.Input,{value:H,onChange:a=>I(a.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>G(!1),children:a("common.cancel")}),(0,b.jsx)(g.Button,{disabled:"RESET"!==H,onClick:S,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:a("settings.backup.reset")})]})]})})]})}var ak=a.i(953093),al=a.i(668116);let am=(0,p.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var an=a.i(22761),ao=a.i(963326),ap=a.i(192369),aq=a.i(599209),ar=a.i(627141);let as=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function at({cmd:a}){let{t:d}=(0,f.useI18n)(),[e,h]=(0,c.useState)(!1),i=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)}h(!0),_.toast.success(d("common.copied")),setTimeout(()=>h(!1),1500)}catch{_.toast.error(d("common.copyFailed"))}};return(0,b.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-background/60 pl-2 pr-1 py-1 ring-1 ring-border/60",children:[(0,b.jsx)("code",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-relaxed",children:a}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d("common.copy"),onClick:i,children:e?(0,b.jsx)(al.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(an.Copy,{className:"h-3 w-3"})})]})}function au({extension:a}){let{t:d}=(0,f.useI18n)(),{status:e,loading:h,isInstalling:i,install:j,uninstall:k,refresh:l}=(0,ar.useExtension)(a.id),[m,n]=(0,c.useState)(!1),o=a.icon,p=e.installed,q=async()=>{let b=await j();b.success?_.toast.success(d("settings.extensions.installSuccess").replace("{name}",a.name)):_.toast.error(d("settings.extensions.installFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},r=async()=>{let b=await k();b.success?_.toast.success(d("settings.extensions.uninstallSuccess").replace("{name}",a.name)):_.toast.error(d("settings.extensions.uninstallFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},s=async()=>{n(!0);try{await l()}finally{n(!1)}},t=()=>{window.open(a.homepageUrl,"_blank","noopener,noreferrer")};return(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,b.jsx)(o,{className:"h-5 w-5 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:a.name}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.description})]})]}),(0,b.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",a.sizeMB," MB"]})]}),(0,b.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:d("common.loading")})]}):p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(E.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,b.jsxs)("span",{className:"text-foreground",children:[d("settings.extensions.installed"),e.version?` v${e.version}`:""]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(am,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:d("settings.extensions.notInstalledShort")})]})}),(0,b.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Button,{variant:"default",onClick:q,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.reinstalling")]}):d("settings.extensions.reinstall")}),(0,b.jsx)(g.Button,{variant:"outline",onClick:r,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.uninstalling")]}):d("settings.extensions.uninstall")})]}):a.manualInstall?(0,b.jsxs)(aq.Popover,{children:[(0,b.jsx)(aq.PopoverTrigger,{render:a=>(0,b.jsxs)(g.Button,{variant:"default",...a,children:[(0,b.jsx)(V,{className:"h-3.5 w-3.5"}),d("settings.extensions.installViaHomepage")]})}),(0,b.jsxs)(aq.PopoverContent,{align:"start",className:"w-80 max-w-[90vw] gap-2 text-xs leading-relaxed",children:[(0,b.jsx)("p",{children:d("settings.extensions.manualInstallHintIntro")}),(0,b.jsx)("div",{className:"space-y-2",children:as.map(({os:a,cmd:c})=>(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:a}),(0,b.jsx)(at,{cmd:c})]},a))}),(0,b.jsx)("p",{className:"text-muted-foreground",children:d("settings.extensions.manualInstallHintAfter")}),(0,b.jsxs)("button",{type:"button",onClick:t,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,b.jsx)(ao.ExternalLink,{className:"h-3 w-3"}),d("settings.extensions.visitHomepage")]})]})]}):(0,b.jsx)(g.Button,{variant:"default",onClick:q,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.installing")]}):d("settings.extensions.install")}),(0,b.jsxs)(g.Button,{variant:"ghost",onClick:s,disabled:m,children:[(0,b.jsx)(ap.RefreshCw,{className:`h-3.5 w-3.5 ${m?"animate-spin":""}`}),d("settings.extensions.recheck")]}),(0,b.jsxs)(g.Button,{variant:"ghost",onClick:t,children:[(0,b.jsx)(ao.ExternalLink,{className:"h-3.5 w-3.5"}),d("settings.extensions.visitHomepage")]})]})]})}function av(){let{t:a}=(0,f.useI18n)(),c=(0,ak.listExtensionMetadata)();return(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("header",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:a("settings.extensions.title")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.extensions.desc")})]}),(0,b.jsx)("div",{className:"space-y-3",children:c.map(a=>(0,b.jsx)(au,{extension:a},a.id))})]})}a.i(423993);var aw=a.i(109603),ax=a.i(975787),ay=a.i(875846),az=a.i(718799);let aA=["global","panels","missions"],aB=new Set(["missions.cycleBack"]);function aC({keys:a}){return(0,b.jsx)(az.KeyCombo,{keys:a})}function aD(){let a,{t:d}=(0,f.useI18n)(),e=(0,ay.useKeymapStore)(a=>a.overrides),h=(0,ay.useKeymapStore)(a=>a.setBinding),i=(0,ay.useKeymapStore)(a=>a.resetBinding),j=(0,ay.useKeymapStore)(a=>a.resetAll),[l,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(null),q=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(l){let a=requestAnimationFrame(()=>q.current?.focus());return()=>cancelAnimationFrame(a)}},[l]);let r=(0,c.useMemo)(()=>{let a=new Map;for(let b of aw.SHORTCUT_ACTIONS)for(let c of e[b.id]??[...b.defaultKeys])a.has(c)||a.set(c,b.id);return a},[e]),s=(0,c.useMemo)(()=>aA.map(a=>({group:a,actions:aw.SHORTCUT_ACTIONS.filter(b=>b.group===a&&!aB.has(b.id))})).filter(a=>a.actions.length>0),[]),t=l?(0,aw.getAction)(l):null,u=o&&l&&(a=r.get(o))&&a!==l?a:null;function v(){n(null),p(null)}return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("header",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:d("settings.keyboardShortcuts")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("settings.keyboardShortcutsDesc")})]}),(0,b.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:function(){j(),_.toast.success(d("settings.shortcuts.resetAllDone"))},children:[(0,b.jsx)(Y.RotateCcw,{className:"h-3.5 w-3.5"}),d("settings.shortcuts.resetAll")]})]}),(0,b.jsx)("div",{className:"space-y-6",children:s.map(({group:a,actions:c})=>(0,b.jsxs)("section",{children:[(0,b.jsx)("h3",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d(`shortcuts.group.${a}`)}),(0,b.jsx)("ul",{className:"divide-y divide-border/50 rounded-xl border border-border bg-card",children:c.map(a=>{let c,f=a.id in e;return(0,b.jsxs)("li",{className:"flex items-center justify-between gap-4 px-5 py-3.5",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 text-sm",children:d(a.descriptionKey)}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,b.jsx)(aC,{keys:e[c=a.id]??[...(0,aw.getAction)(c).defaultKeys]}),a.configurable?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Button,{variant:"outline",size:"sm",onClick:()=>{var b;return b=a.id,void(p(null),n(b))},children:d("settings.shortcuts.rebind")}),f&&(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>i(a.id),children:(0,b.jsx)(Y.RotateCcw,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(T.TooltipContent,{children:d("settings.shortcuts.reset")})]})]}):(0,b.jsx)(k.Badge,{variant:"outline",className:"text-muted-foreground",children:d("settings.shortcuts.fixed")})]})]},a.id)})})]},a))}),(0,b.jsx)(m.Dialog,{open:null!==l,onOpenChange:a=>!a&&v(),children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:t?d(t.descriptionKey):d("settings.shortcuts.rebind")}),(0,b.jsx)(m.DialogDescription,{children:d("settings.shortcuts.pressKey")})]}),(0,b.jsx)("textarea",{ref:q,readOnly:!0,tabIndex:0,"aria-label":d("settings.shortcuts.pressKey"),onKeyDown:a=>{a.preventDefault(),a.stopPropagation();let b=(0,ax.serializeKeyEvent)(a.nativeEvent);b&&p(b)},className:"flex h-20 w-full cursor-pointer resize-none items-center justify-center rounded-lg border border-dashed border-border bg-muted/30 text-center text-sm outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,b.jsx)("div",{className:"flex min-h-8 items-center justify-center",children:o?(0,b.jsx)(aC,{keys:[o]}):(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:d("settings.shortcuts.pressKey")})}),u&&(0,b.jsx)("p",{className:"text-center text-xs text-amber-600 dark:text-amber-400",children:d("settings.shortcuts.conflict",{name:d((0,aw.getAction)(u).descriptionKey)})}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:v,children:d("settings.shortcuts.cancel")}),(0,b.jsx)(g.Button,{variant:"default",onClick:function(){l&&o&&(h(l,[o]),v(),_.toast.success(d("settings.shortcuts.saved")))},disabled:!o,children:d("settings.shortcuts.saveBtn")})]})]})})]})}function aE({options:a,value:c,onChange:d}){return(0,b.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:a.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>d(a.value),className:(0,n.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",c===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value))})}function aF({label:a,description:c,children:d,className:e}){return(0,b.jsxs)("div",{className:(0,n.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",e),children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:a}),c&&(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:c})]}),(0,b.jsx)("div",{className:"shrink-0",children:d})]})}let aG=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:o.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:q,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:r.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:s,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:v.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:t.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:u.HardDrive,accent:"cyan"},{id:"keyboard-shortcuts",labelKey:"settings.keyboardShortcuts",descKey:"settings.keyboardShortcutsDesc",icon:w.Keyboard,accent:"violet"}],aH={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},aI="ai-manager:default-cli-adapter",aJ={host:"",ownerMatch:"*",localPathTemplate:"",priority:0},aK=a=>a.replace(/\\/g,"/").replace(/\/+$/,"");function aL(){let a=(0,d.useRouter)(),{t:o}=(0,f.useI18n)(),{theme:p,setTheme:q}=(0,e.useTheme)(),{locale:r,setLocale:s}=(0,f.useI18n)(),[t,u]=(0,c.useState)("general"),v=(0,c.useRef)(null),[w,K]=(0,c.useState)({left:0,width:0}),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)("Terminal"),[Z,$]=(0,c.useState)([]),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)([]),[ad,ae]=(0,c.useState)(13),[af,ag]=(0,c.useState)("Menlo, Monaco, 'Courier New', monospace"),[ah,ai]=(0,c.useState)([]),[ak,al]=(0,c.useState)("claude"),[am,an]=(0,c.useState)(null),[ao,ap]=(0,c.useState)({}),[aq,ar]=(0,c.useState)([]),[as,at]=(0,c.useState)(!1),[au,aw]=(0,c.useState)(null),[ax,ay]=(0,c.useState)(null),[az,aA]=(0,c.useState)(""),[aB,aC]=(0,c.useState)(""),[aL,aM]=(0,c.useState)(""),[aN,aO]=(0,c.useState)([]),[aP,aQ]=(0,c.useState)(null),[aR,aS]=(0,c.useState)({...aJ}),[aT,aU]=(0,c.useState)(!1),[aV,aW]=(0,c.useState)({...aJ}),[aX,aY]=(0,c.useState)(!1),[aZ,a$]=(0,c.useState)(!1),[a_,a0]=(0,c.useState)(0),[a1,a2]=(0,c.useState)(null),[a3,a4]=(0,c.useState)(null),[a5,a6]=(0,c.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[a7,a8]=(0,c.useState)({timeoutSec:30}),[a9,ba]=(0,c.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[bb,bc]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[bd,be]=(0,c.useState)(null),[bf,bg]=(0,c.useState)(!1),[bh,bi]=(0,c.useState)(""),[bj,bk]=(0,c.useState)(!0);(0,c.useEffect)(()=>W(!0),[]),(0,c.useEffect)(()=>{(0,H.getConfigValue)("terminal.app","Terminal").then(Y),L().then($),(0,H.getConfigValue)("editor.command","").then(aa),M().then(ac),(0,H.getConfigValue)("terminal.fontSize",13).then(ae),(0,H.getConfigValue)("terminal.fontFamily","Menlo, Monaco, 'Courier New', monospace").then(ag)},[]),(0,c.useEffect)(()=>{if(0===Z.length||!X||Z.some(a=>a.value===X))return;let a=Z.find(a=>a.name===X);a&&(Y(a.value),(0,I.setConfigValue)("terminal.app",a.value))},[Z,X]),(0,c.useEffect)(()=>{if(0===ab.length||!_||ab.some(a=>a.command===_))return;let a=ab.find(a=>a.name===_);a&&(aa(a.command),(0,I.setConfigValue)("editor.command",a.command))},[ab,_]),(0,c.useEffect)(()=>{S().then(ai);let a=localStorage.getItem(aI);a&&al(a)},[]),(0,c.useEffect)(()=>{(0,N.getPrompts)().then(ar)},[]);let bl=async()=>{try{let a=await fetch("/api/internal/hooks/install");if(a.ok){let b=await a.json();be(b)}}catch{}};async function bm(a){if(!am){an(a),ap(b=>{let c={...b};return delete c[a],c});try{let b=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:a})}),c=await b.json();ap(b=>({...b,[a]:c}))}catch{ap(b=>({...b,[a]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{an(null)}}}(0,c.useEffect)(()=>{(0,H.getConfigValue)("git.pathMappingRules",[]).then(a=>{let b=new Set,c=!1,d=a.map(a=>{if(!a.id||b.has(a.id)){c=!0;let d={...a,id:crypto.randomUUID()};return b.add(d.id),d}return b.add(a.id),a});aO(d),c&&(0,I.setConfigValue)("git.pathMappingRules",d)}),(0,H.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(a=>{bi(a.join(", "))}),bl(),(0,J.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","board.archiveDelayDays","task.defaultUseWorktree","task.defaultAutoStart","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(a=>{let b=a["system.maxUploadBytes"]??0x3200000,c=a["system.maxReadableFileBytes"]??5242880;a6({maxUploadMb:Math.round(b/1024/1024),maxConcurrent:a["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(c/1024/1024),archiveDelayDays:a["board.archiveDelayDays"]??7,taskDefaultUseWorktree:"boolean"!=typeof a["task.defaultUseWorktree"]||a["task.defaultUseWorktree"],taskDefaultAutoStart:"boolean"==typeof a["task.defaultAutoStart"]&&a["task.defaultAutoStart"]}),a8({timeoutSec:a["git.timeoutSec"]??30}),ba({resultLimit:a["search.resultLimit"]??20,allModeCap:a["search.allModeCap"]??5,debounceMs:a["search.debounceMs"]??250,snippetLength:a["search.snippetLength"]??80,codeTimeoutSec:a["search.codeTimeoutSec"]??30}),bc({minCols:a["missions.grid.minCols"]??1,maxCols:a["missions.grid.maxCols"]??5,minRows:a["missions.grid.minRows"]??1,maxRows:a["missions.grid.maxRows"]??5})})},[]),(0,c.useEffect)(()=>{(0,H.getConfigValue)("notification.enabled",!0).then(bk)},[]);let bn=(0,c.useCallback)(()=>{aw(null),aA(""),aC(""),aM(""),at(!0)},[]),bo=(0,c.useCallback)(a=>{aw(a),aA(a.name),aC(a.description??""),aM(a.content),at(!0)},[]),bp=(0,c.useCallback)(async()=>{az.trim()&&aL.trim()&&(au?await P(au.id,{name:az.trim(),description:aB.trim()||void 0,content:aL.trim()}):await O({name:az.trim(),description:aB.trim()||void 0,content:aL.trim()}),at(!1),ar(await (0,N.getPrompts)()),a.refresh())},[az,aB,aL,au,a]),bq=(0,c.useCallback)(async()=>{ax&&(await Q(ax),ay(null),ar(await (0,N.getPrompts)()),a.refresh())},[ax,a]),br=(0,c.useCallback)(async b=>{await R(b),ar(await (0,N.getPrompts)()),a.refresh()},[a]),bs=async()=>{await (0,I.setConfigValue)("system.maxUploadBytes",1024*a5.maxUploadMb*1024),await (0,I.setConfigValue)("system.maxConcurrentExecutions",a5.maxConcurrent),await (0,I.setConfigValue)("system.maxReadableFileBytes",1024*a5.maxReadableMb*1024),await (0,I.setConfigValue)("board.archiveDelayDays",a5.archiveDelayDays)},bt=async()=>{await (0,I.setConfigValue)("task.defaultUseWorktree",a5.taskDefaultUseWorktree),await (0,I.setConfigValue)("task.defaultAutoStart",a5.taskDefaultAutoStart),await (0,I.setConfigValue)("task.mcpDefaultsConfigured",!0)},bu=async()=>{await (0,I.setConfigValue)("git.timeoutSec",a7.timeoutSec)},bv=async()=>{await (0,I.setConfigValue)("search.resultLimit",a9.resultLimit),await (0,I.setConfigValue)("search.allModeCap",a9.allModeCap),await (0,I.setConfigValue)("search.debounceMs",a9.debounceMs),await (0,I.setConfigValue)("search.snippetLength",a9.snippetLength),await (0,I.setConfigValue)("search.codeTimeoutSec",a9.codeTimeoutSec)},bw=async()=>{let a=Math.min(bb.minCols,bb.maxCols),b=Math.max(bb.minCols,bb.maxCols),c=Math.min(bb.minRows,bb.maxRows),d=Math.max(bb.minRows,bb.maxRows);bc({minCols:a,maxCols:b,minRows:c,maxRows:d}),await (0,I.setConfigValue)("missions.grid.minCols",a),await (0,I.setConfigValue)("missions.grid.maxCols",b),await (0,I.setConfigValue)("missions.grid.minRows",c),await (0,I.setConfigValue)("missions.grid.maxRows",d)},bx=async()=>{let a=bh.split(",").map(a=>a.trim()).filter(Boolean);await (0,I.setConfigValue)("hooks.autoUploadTypes",a)},by=async()=>{if(bd){bg(!0);try{let a=bd.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:a}),await bl()}finally{bg(!1)}}},bz=async()=>{if(!aV.host.trim()||!aV.localPathTemplate.trim())return;let a=aK(aV.localPathTemplate.trim()),b=aX?`${a}/{path}`:a,c=[...aN,{id:crypto.randomUUID(),host:aV.host.trim(),ownerMatch:aV.ownerMatch.trim()||"*",localPathTemplate:b,priority:aV.priority}];await (0,I.setConfigValue)("git.pathMappingRules",c),aO(c),aW({...aJ}),aY(!1),aU(!1)},bA=async a=>{if(!aR.host.trim()||!aR.localPathTemplate.trim())return;let b=aK(aR.localPathTemplate.trim()),c=aZ?`${b}/{path}`:b,d=aN.map(b=>b.id===a?{...b,host:aR.host.trim(),ownerMatch:aR.ownerMatch.trim()||"*",localPathTemplate:c,priority:aR.priority}:b);await (0,I.setConfigValue)("git.pathMappingRules",d),aO(d),aQ(null),a$(!1)},bB=async a=>{let b=aN.filter(b=>b.id!==a);await (0,I.setConfigValue)("git.pathMappingRules",b),aO(b),a2(null)};async function bC(){let a=!bj;bk(a),await (0,I.setConfigValue)("notification.enabled",a)}let bD=(0,c.useCallback)(()=>{a.back()},[a]);(0,c.useEffect)(()=>{let a=v.current;if(!a)return;let b=a.querySelector(`[data-section="${t}"]`);if(!b)return;let c=a.getBoundingClientRect(),d=b.getBoundingClientRect();K({left:d.left-c.left,width:d.width})},[t]);let bE=aG.find(a=>a.id===t),bF=bE?aH[bE.accent]:aH.blue;return(0,b.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,b.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,b.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:o("settings.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:o("settings.configDesc")})]}),(0,b.jsxs)(g.Button,{variant:"outline",onClick:bD,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,b.jsx)(x.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,b.jsxs)("div",{ref:v,className:"relative flex gap-1 overflow-x-auto",children:[aG.map(a=>{let c=a.icon,d=t===a.id,e=aH[a.accent];return(0,b.jsxs)("button",{"data-section":a.id,onClick:()=>u(a.id),className:(0,n.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",d?`${e.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,b.jsx)("span",{className:(0,n.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",d?e.bg:"bg-transparent"),children:(0,b.jsx)(c,{className:"h-3.5 w-3.5"})}),(0,b.jsx)("span",{children:o(a.labelKey)})]},a.id)}),(0,b.jsx)("div",{className:(0,n.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",bF.indicator),style:{left:w.left,width:w.width}})]})]})}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:(0,b.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[bE&&(0,b.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,b.jsx)("div",{className:(0,n.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",bF.bg,bF.text,bF.ring),children:(0,b.jsx)(bE.icon,{className:"h-5 w-5"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:o(bE.labelKey)}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:o(bE.descKey)})]})]}),(0,b.jsx)("div",{className:"mb-6 border-t"}),function(){switch(t){case"general":let a;return a=[{value:"light",label:o("settings.themeLight")},{value:"dark",label:o("settings.themeDark")},{value:"system",label:o("settings.themeSystem")}],(0,b.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,b.jsx)(aF,{label:o("settings.theme"),description:o("settings.themeDesc"),children:V?(0,b.jsx)(aE,{options:a,value:p??"system",onChange:a=>q(a)}):(0,b.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,b.jsx)(aF,{label:o("settings.language"),description:o("settings.languageDesc"),children:(0,b.jsx)(aE,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:r,onChange:a=>s(a)})}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.terminal.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.terminal.desc")})]}),Z.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:Z.map(a=>{let c=X===a.value,d=(0,n.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",a.installed?c?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),e=()=>{a.installed&&(Y(a.value),(0,I.setConfigValue)("terminal.app",a.value))};return a.installed?(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name},a.value):(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(T.TooltipContent,{side:"top",children:o("settings.app.notInstalled")})]},a.value)})})]}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.terminalFont.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.terminalFont.desc")})]}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-4",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o("settings.terminalFont.size"),(0,b.jsx)("input",{type:"number",min:8,max:40,value:ad,onChange:a=>{let b=Math.max(8,Math.min(40,Math.round(Number(a.target.value)||13)));ae(b),(0,I.setConfigValue)("terminal.fontSize",b)},className:"h-8 w-20 rounded-md border border-border bg-background px-2 text-sm text-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]}),(0,b.jsxs)("label",{className:"flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground",children:[o("settings.terminalFont.family"),(0,b.jsx)("input",{type:"text",value:af,placeholder:"Menlo, Monaco, 'Courier New', monospace",onChange:a=>ag(a.target.value),onBlur:a=>{let b=a.target.value.trim()||"Menlo, Monaco, 'Courier New', monospace";ag(b),(0,I.setConfigValue)("terminal.fontFamily",b)},className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 font-mono text-xs text-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,b.jsx)("div",{className:"mt-1.5 text-[11px] text-muted-foreground/70",children:o("settings.terminalFont.hint")})]}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.editor.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.editor.desc")})]}),ab.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ab.map(a=>{let c=_===a.command,d=(0,n.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",a.installed?c?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),e=()=>{a.installed&&(aa(a.command),(0,I.setConfigValue)("editor.command",a.command))};return a.installed?(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name},a.command):(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(T.TooltipContent,{side:"top",children:o("settings.app.notInstalled")})]},a.command)})})]})]});case"ai-tools":return(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ah.map(a=>{let c=ak===a.name,d=am===a.name,e=ao[a.name];return(0,b.jsx)("li",{children:(0,b.jsxs)("div",{className:"px-5 py-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium",children:a.displayName}),(0,b.jsx)(k.Badge,{variant:"outline",children:o("label.builtin")}),c&&(0,b.jsxs)(k.Badge,{variant:"secondary",className:"shrink-0",children:[(0,b.jsx)(z,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),o("settings.prompts.default")]}),e&&(0,b.jsx)(k.Badge,{variant:e.ok?"secondary":"destructive",className:(0,n.cn)("shrink-0",e.ok&&"bg-green-600 text-white hover:bg-green-700"),children:e.ok?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(E.CheckCircle2,{className:"h-3 w-3 mr-1"}),o("settings.aiTools.testPassed")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(F.XCircle,{className:"h-3 w-3 mr-1"}),o("settings.aiTools.testFailed")]})})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.cli.available&&a.cli.version?`${a.name} \xb7 ${a.cli.version}`:a.name})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!c&&(0,b.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:()=>{var b;al(b=a.name),localStorage.setItem(aI,b)},children:[(0,b.jsx)(z,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),o("settings.prompts.setDefault")]}),(0,b.jsx)(g.Button,{variant:"outline",size:"sm",onClick:()=>bm(a.name),disabled:d,children:d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),o("settings.aiTools.testing")]}):o("settings.aiTools.testConnection")})]})]}),e&&(0,b.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,b.jsx)("div",{className:"space-y-1.5",children:e.checks.map(c=>(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)("span",{className:(0,n.cn)("w-1.5 h-1.5 rounded-full shrink-0",c.passed?"bg-green-500":"bg-red-500")}),(0,b.jsx)("span",{className:(0,n.cn)(c.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:c.message})]},`${a.name}-${c.name}`))})})]})},a.name)})});case"prompts":return V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(g.Button,{onClick:bn,variant:"default",children:[(0,b.jsx)(y.Plus,{className:"h-4 w-4 mr-2"}),o("settings.prompts.newPrompt")]})}),0===aq.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,b.jsx)("p",{className:"text-muted-foreground",children:o("settings.prompts.empty")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:o("settings.prompts.emptyHint")})]}):(0,b.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:aq.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h4",{className:"text-sm font-medium truncate",children:a.name}),a.isDefault&&(0,b.jsxs)(k.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,b.jsx)(z,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),o("settings.prompts.default")]})]}),a.description&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:a.description})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>br(a.id),title:o("settings.prompts.setDefault"),children:(0,b.jsx)(z,{className:(0,n.cn)("h-4 w-4",a.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bo(a),title:o("settings.prompts.editPrompt"),children:(0,b.jsx)(B,{className:"h-4 w-4"})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ay(a.id),className:"text-destructive",title:o("settings.prompts.delete"),children:(0,b.jsx)(A.Trash2,{className:"h-4 w-4"})})]})]},a.id))}),(0,b.jsx)(m.Dialog,{open:as,onOpenChange:at,children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:au?o("settings.prompts.editPrompt"):o("settings.prompts.newPrompt")}),(0,b.jsx)(m.DialogDescription,{children:au?o("settings.prompts.editPrompt"):o("settings.prompts.newPrompt")})]}),(0,b.jsxs)("div",{className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-name",children:o("settings.prompts.promptName")}),(0,b.jsx)(h.Input,{id:"prompt-name",value:az,onChange:a=>aA(a.target.value),placeholder:o("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-description",children:o("settings.prompts.promptDescription")}),(0,b.jsx)(h.Input,{id:"prompt-description",value:aB,onChange:a=>aC(a.target.value),placeholder:o("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-content",children:o("settings.prompts.promptContent")}),(0,b.jsx)(i.Textarea,{id:"prompt-content",value:aL,onChange:a=>aM(a.target.value),placeholder:o("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>at(!1),children:o("settings.prompts.cancel")}),(0,b.jsx)(g.Button,{onClick:bp,disabled:!az.trim()||!aL.trim(),children:o("settings.prompts.save")})]})]})}),(0,b.jsx)(m.Dialog,{open:!!ax,onOpenChange:a=>!a&&ay(null),children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:o("settings.prompts.deleteConfirmTitle")}),(0,b.jsx)(m.DialogDescription,{children:o("settings.prompts.deleteConfirmMessage")})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>ay(null),children:o("settings.prompts.cancel")}),(0,b.jsx)(g.Button,{variant:"destructive",onClick:bq,children:o("settings.prompts.delete")})]})]})})]}):(0,b.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let c,d,e;return(0,b.jsxs)("div",{className:"space-y-8",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.git.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.git.desc")})]}),(0,b.jsxs)(g.Button,{onClick:()=>{aW({...aJ}),aU(!0)},children:[(0,b.jsx)(y.Plus,{className:"mr-2 h-4 w-4"}),o("settings.config.git.addRule")]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[0!==aN.length||aT?(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:aN.map(a=>aP===a.id?(0,b.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.host")}),(0,b.jsx)(h.Input,{value:aR.host,onChange:a=>aS(b=>({...b,host:a.target.value})),placeholder:o("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.ownerMatch")}),(0,b.jsx)(h.Input,{value:aR.ownerMatch,onChange:a=>aS(b=>({...b,ownerMatch:a.target.value})),placeholder:o("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,b.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{value:aR.localPathTemplate,onChange:a=>aS(b=>({...b,localPathTemplate:a.target.value})),placeholder:o("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:aZ?"default":"outline",size:"sm",type:"button",onClick:()=>a$(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(T.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:o("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:o("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>a4("edit"),children:(0,b.jsx)(G.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(T.TooltipContent,{children:o("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:aZ?o("onboarding.step3.pathHintFull"):o("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.priority")}),(0,b.jsx)(h.Input,{type:"number",value:aR.priority,onChange:a=>aS(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"sm",onClick:()=>{aQ(null),a$(!1)},children:o("settings.config.git.cancel")}),(0,b.jsx)(g.Button,{size:"sm",onClick:()=>bA(a.id),children:o("settings.config.git.save")})]})]},a.id):(0,b.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium text-sm",children:a.host}),"*"!==a.ownerMatch&&(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",a.ownerMatch]}),(0,b.jsxs)(k.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[o("settings.config.git.priority")," ",a.priority]})]}),(0,b.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:a.localPathTemplate})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let b,c,d;return b=a.localPathTemplate,d=(c=/\/\{path\}\/?$/.test(b))?b.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):b,void(aQ(a.id),aS({host:a.host,ownerMatch:a.ownerMatch,localPathTemplate:d,priority:a.priority}),a$(c))},title:o("settings.config.git.edit"),children:(0,b.jsx)(B,{className:"h-4 w-4"})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>a2(a.id),className:"text-destructive",title:o("settings.config.git.delete"),children:(0,b.jsx)(A.Trash2,{className:"h-4 w-4"})})]})]})},a.id))}):(0,b.jsxs)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:o("settings.config.git.noRules")}),(0,b.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground/80",children:o("settings.config.git.noRulesFallback")})]}),aT&&(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:o("settings.config.git.host")}),(0,b.jsx)(h.Input,{value:aV.host,onChange:a=>aW(b=>({...b,host:a.target.value})),placeholder:o("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:o("settings.config.git.ownerMatch")}),(0,b.jsx)(h.Input,{value:aV.ownerMatch,onChange:a=>aW(b=>({...b,ownerMatch:a.target.value})),placeholder:o("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:o("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{value:aV.localPathTemplate,onChange:a=>aW(b=>({...b,localPathTemplate:a.target.value})),placeholder:o("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:aX?"default":"outline",size:"sm",type:"button",onClick:()=>aY(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(T.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:o("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:o("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>a4("add"),children:(0,b.jsx)(G.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(T.TooltipContent,{children:o("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:aX?o("onboarding.step3.pathHintFull"):o("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:o("settings.config.git.priority")}),(0,b.jsx)(h.Input,{type:"number",value:aV.priority,onChange:a=>aW(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]}),aV.localPathTemplate&&(c=aV.localPathTemplate.trim().replace(/\/+$/,""),d=aX?`${c}/{path}`:c,e=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,b.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:o("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1",children:e.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>a0(c),className:(0,n.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",a_===c?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:a.label},c))})]}),(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:e[a_].url}),(0,b.jsxs)("p",{className:"font-mono text-sm",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,b.jsx)("span",{className:"text-foreground font-medium",children:function(a,b){if(!a||!b)return"";let c=b.trim(),d=[],e=c.match(/^git@[^:]+:(.+)$/);if(e)d=e[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let a=new URL(c);d=decodeURIComponent(a.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!d.length)return"";let f=d[0],g=d[d.length-1],h=d.join("/");if(a.includes("{path}"))return a.replace("{path}",h).replace("{owner}",f).replace("{repo}",g).replace(/\/+$/,"");let i=a.replace("{owner}",f).replace("{repo}","").replace(/\/+$/,"");return`${i}/${g}`}(d,e[a_].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"sm",onClick:()=>aU(!1),children:o("settings.config.git.cancel")}),(0,b.jsxs)(g.Button,{size:"sm",onClick:bz,disabled:!aV.host.trim()||!aV.localPathTemplate.trim(),children:[(0,b.jsx)(C,{className:"h-3.5 w-3.5 mr-1.5"}),o("settings.config.git.save")]})]})]})]})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.system.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.system.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxUpload")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxUploadHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:500,value:a5.maxUploadMb,onChange:a=>a6(b=>({...b,maxUploadMb:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxConcurrent")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxConcurrentHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.maxConcurrent,onChange:a=>a6(b=>({...b,maxConcurrent:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxReadable")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxReadableHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:50,value:a5.maxReadableMb,onChange:a=>a6(b=>({...b,maxReadableMb:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.archiveDelay")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.archiveDelayHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:365,value:a5.archiveDelayDays,onChange:a=>a6(b=>({...b,archiveDelayDays:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:o("settings.config.system.archiveDelayUnit")})]})]})]}),(0,b.jsx)(g.Button,{onClick:bs,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.task.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.task.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.taskDefaultWorktree")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.taskDefaultWorktreeHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>a6(a=>({...a,taskDefaultUseWorktree:!a.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a5.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a5.taskDefaultUseWorktree?o("task.worktreeYes"):o("task.worktreeNo")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.taskDefaultAutoStart")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.taskDefaultAutoStartHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>a6(a=>({...a,taskDefaultAutoStart:!a.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a5.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a5.taskDefaultAutoStart?o("task.autoStartYes"):o("task.autoStartNo")})]})]}),(0,b.jsx)(g.Button,{onClick:bt,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.gitParams.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.gitParams.desc")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.gitParams.timeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.gitParams.timeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:5,max:300,value:a7.timeoutSec,onChange:a=>a8(b=>({...b,timeoutSec:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,b.jsx)(g.Button,{onClick:bu,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.search.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.search.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.resultLimit")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.resultLimitHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:5,max:100,value:a9.resultLimit,onChange:a=>ba(b=>({...b,resultLimit:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.allModeCap")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.allModeCapHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:1,max:20,value:a9.allModeCap,onChange:a=>ba(b=>({...b,allModeCap:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.debounceMs")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.debounceMsHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:50,max:1e3,value:a9.debounceMs,onChange:a=>ba(b=>({...b,debounceMs:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.snippetLength")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.snippetLengthHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:20,max:500,value:a9.snippetLength,onChange:a=>ba(b=>({...b,snippetLength:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.codeTimeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.codeTimeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:5,max:300,step:5,value:a9.codeTimeoutSec,onChange:a=>ba(b=>({...b,codeTimeoutSec:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,b.jsx)(g.Button,{onClick:bv,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.missions.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.missions.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.minCols")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:bb.minCols,onChange:a=>bc(b=>({...b,minCols:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.maxCols")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:bb.maxCols,onChange:a=>bc(b=>({...b,maxCols:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.minRows")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:bb.minRows,onChange:a=>bc(b=>({...b,minRows:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.maxRows")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:bb.maxRows,onChange:a=>bc(b=>({...b,maxRows:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,b.jsx)(g.Button,{onClick:bw,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.hooks.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.hooks.desc")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.hooks.autoUploadTypes")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.hooks.autoUploadTypesHint")})]}),(0,b.jsx)(h.Input,{value:bh,onChange:a=>bi(a.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsx)(g.Button,{onClick:bx,className:"rounded-lg",children:o("common.save")}),(0,b.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:bd?.installed?o("settings.config.hooks.installed"):o("settings.config.hooks.notInstalled")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.hooks.installHint")})]}),(0,b.jsx)(g.Button,{variant:bd?.installed?"destructive":"default",onClick:by,disabled:bf||!bd,className:"rounded-lg",children:bd?.installed?o("settings.config.hooks.uninstall"):o("settings.config.hooks.install")})]})]}),(0,b.jsx)(m.Dialog,{open:!!a1,onOpenChange:a=>!a&&a2(null),children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:o("settings.config.git.deleteConfirm")}),(0,b.jsx)(m.DialogDescription,{children:o("settings.config.git.deleteConfirmMessage")})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>a2(null),children:o("settings.config.git.cancel")}),(0,b.jsx)(g.Button,{variant:"destructive",onClick:()=>a1&&bB(a1),children:o("settings.config.git.delete")})]})]})})]});case"notifications":return(0,b.jsx)("div",{className:"divide-y divide-border/50",children:(0,b.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.notifications.enable")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.notifications.enableDesc")})]}),(0,b.jsx)(l.Switch,{checked:bj,onCheckedChange:bC})]})});case"backup":return(0,b.jsx)(aj,{});case"extensions":return(0,b.jsx)(av,{});case"keyboard-shortcuts":return(0,b.jsx)(aD,{})}}()]})}),(0,b.jsx)(U.FolderBrowserDialog,{open:null!==a3,onOpenChange:a=>{a||a4(null)},onSelect:a=>{let b=aK(a);"add"===a3?aW(a=>({...a,localPathTemplate:b})):"edit"===a3&&aS(a=>({...a,localPathTemplate:b})),a4(null)}})]})}a.s(["default",0,function(){return(0,b.jsx)(aL,{})}],520788)}];
|
|
1
|
+
module.exports=[520788,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(553798),e=a.i(940271),f=a.i(951192),g=a.i(699570),h=a.i(866718),i=a.i(429246),j=a.i(412783),k=a.i(786304),l=a.i(563658),m=a.i(814574),n=a.i(368114),o=a.i(369289),p=a.i(711796);let q=(0,p.default)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]);var r=a.i(350739);let s=(0,p.default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var t=a.i(190076),u=a.i(705594),v=a.i(264589),w=a.i(567648),x=a.i(54384),y=a.i(774881);let z=(0,p.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var A=a.i(975231);let B=(0,p.default)("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),C=(0,p.default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var D=a.i(704494),E=a.i(913284),F=a.i(468862),G=a.i(347165),H=a.i(788106),I=a.i(115009),J=a.i(79e3),K=a.i(780410);let L=(0,K.createServerReference)("0074966922f5735a14f769bd5ec9503c4dc4f902b1",K.callServer,void 0,K.findSourceMapURL,"getAvailableTerminalApps"),M=(0,K.createServerReference)("004b5b491e1d59548b9bb8acb799c5aa8f56d9f9e5",K.callServer,void 0,K.findSourceMapURL,"getAvailableEditors");var N=a.i(613802);let O=(0,K.createServerReference)("40022e797260d204636e45e591a4c4bd133dc98577",K.callServer,void 0,K.findSourceMapURL,"createPrompt"),P=(0,K.createServerReference)("604815e5fa389b486b4b2065146bdada9d19f9166b",K.callServer,void 0,K.findSourceMapURL,"updatePrompt"),Q=(0,K.createServerReference)("4062018f469d9e917f83563a00175a0ba1cc1fa73a",K.callServer,void 0,K.findSourceMapURL,"deletePrompt"),R=(0,K.createServerReference)("60eeb0597f28aa03e3c04cdd93edd3ee192c760e14",K.callServer,void 0,K.findSourceMapURL,"setDefaultPrompt"),S=(0,K.createServerReference)("009e9c73dabe27469607224136537934b9407417e3",K.callServer,void 0,K.findSourceMapURL,"getAvailableProviders");var T=a.i(785259),U=a.i(43775);let V=(0,p.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);var W=a.i(324954);let X=(0,p.default)("folder-up",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m9 13 3-3 3 3",key:"1pxg3c"}]]);var Y=a.i(161664),Z=a.i(811344),$=a.i(607219),_=a.i(952313);let aa=(0,K.createServerReference)("40501bc0f7613a041df931b7601190931438b1a063",K.callServer,void 0,K.findSourceMapURL,"createBackup"),ab=(0,K.createServerReference)("008a55c3b021b17e6325b8db949963ec9e9f229b46",K.callServer,void 0,K.findSourceMapURL,"listBackupFiles"),ac=(0,K.createServerReference)("40442119c954ba8e67fc955c12f67b6514bbbb4b88",K.callServer,void 0,K.findSourceMapURL,"deleteBackupFile"),ad=(0,K.createServerReference)("40cd6bc441849d21df476eb497a1adcc3cf491add7",K.callServer,void 0,K.findSourceMapURL,"restoreBackup"),ae=(0,K.createServerReference)("401cc0300a68629f255adaef6d06933e5a6262bd54",K.callServer,void 0,K.findSourceMapURL,"resetSystem"),af=(0,K.createServerReference)("004740c06b2473e940f19bd6b9b9d5f781d9cb07ba",K.callServer,void 0,K.findSourceMapURL,"getBackupDir"),ag=(0,K.createServerReference)("40915d89df15a6bd7436ef2259b14617467be0223e",K.callServer,void 0,K.findSourceMapURL,"setBackupDir"),ah=(0,K.createServerReference)("002737acb9aa39918272fe24a0b4f0042a3d3cfdeb",K.callServer,void 0,K.findSourceMapURL,"getStorageLocation"),ai=(0,K.createServerReference)("40a69d46fce4f06c0059080309772b2ee3f530dffc",K.callServer,void 0,K.findSourceMapURL,"setStorageLocation");function aj(){let{t:a,locale:e}=(0,f.useI18n)(),i=(0,d.useRouter)(),[j,k]=(0,c.useState)([]),[l,n]=(0,c.useState)(""),[o,p]=(0,c.useState)(!1),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(!1),[u,v]=(0,c.useState)(!0),[w,x]=(0,c.useState)(null),[y,z]=(0,c.useState)(!1),[B,C]=(0,c.useState)(""),E=(0,c.useRef)(null),[F,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(""),J=(0,c.useCallback)(async()=>{v(!0);try{let[a,b,c]=await Promise.all([ab(),af(),ah()]);k(a),n(b),r(c)}finally{v(!1)}},[]);(0,c.useEffect)(()=>{J()},[J]);let K=async()=>{let b=B.trim()||void 0;z(!1),C(""),x("create");try{await aa(b),_.toast.success(a("settings.backup.createSuccess")),await J()}catch{_.toast.error(a("settings.backup.createError"))}finally{x(null)}},L=async b=>{if(confirm(a("settings.backup.restoreConfirm"))){x("restore");try{await ad(b),_.toast.success(a("settings.backup.restoreSuccess"),{action:{label:a("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await J()}catch{_.toast.error(a("settings.backup.restoreError"))}finally{x(null)}}},M=async b=>{if(confirm(a("settings.backup.deleteConfirm")))try{await ac(b),_.toast.success(a("settings.backup.deleteSuccess")),k(a=>a.filter(a=>a.filename!==b))}catch{_.toast.error(a("settings.backup.deleteError"))}},N=async b=>{p(!1);try{await ag(b),n(b),_.toast.success(a("settings.backup.dirSaved")),await J()}catch{_.toast.error(a("settings.backup.dirError"))}},O=async b=>{x("storage");try{let c=await ai({newPath:b});if(!c.ok)return void _.toast.error(c.error||a("settings.storage.moveError"));_.toast.success(a("settings.storage.moveSuccess",{count:String(c.moved??0)})),await J()}catch(b){_.toast.error(b instanceof Error?b.message:a("settings.storage.moveError"))}finally{x(null)}},P=async b=>{t(!1),confirm(a("settings.storage.moveConfirm"))&&await O(b)},Q=async()=>{!q||q.isDefault||confirm(a("settings.storage.resetConfirm"))&&await O(q.default)},R=async b=>{let c=b.target.files?.[0];if(c){b.target.value="",x("import");try{let b=new FormData;b.append("file",c);let d=await fetch("/api/internal/backup/import",{method:"POST",body:b});if(!d.ok){let b=await d.json();_.toast.error("Invalid backup archive"===b.error?a("settings.backup.importInvalid"):(b.error,a("settings.backup.importError")));return}_.toast.success(a("settings.backup.importSuccess")),await J()}catch{_.toast.error(a("settings.backup.importError"))}finally{x(null)}}},S=async()=>{if("RESET"===H){G(!1),I(""),x("reset");try{await ae("RESET"),_.toast.success(a("settings.backup.resetSuccess")),i.push("/")}catch{_.toast.error(a("settings.backup.resetError"))}finally{x(null)}}},aj=null!==w;return(0,b.jsxs)("div",{className:"space-y-6",children:[("restore"===w||"reset"===w)&&(0,b.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,b.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,b.jsx)(D.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===w?a("settings.backup.restoring"):a("settings.backup.resetting")})]})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-base font-semibold",children:a("settings.storage.sectionTitle")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.storage.hint")}),(0,b.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{children:[a("settings.storage.current"),":"]}),(0,b.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:q?.current??"…"}),q?.isDefault&&(0,b.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:a("settings.storage.defaultBadge")}),(0,b.jsx)(g.Button,{variant:"ghost",onClick:()=>t(!0),disabled:"storage"===w,className:"text-xs text-muted-foreground",children:"storage"===w?(0,b.jsx)(D.Loader2,{className:"h-3 w-3 animate-spin"}):a("settings.storage.change")}),q&&!q.isDefault&&(0,b.jsx)(g.Button,{variant:"ghost",onClick:Q,disabled:"storage"===w,className:"text-xs text-muted-foreground",children:a("settings.storage.reset")})]}),(0,b.jsx)(U.FolderBrowserDialog,{open:s,onOpenChange:t,onSelect:P})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-base font-semibold",children:a("settings.backup.sectionTitle")}),(0,b.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsxs)("span",{children:[a("settings.backup.dir"),":"]}),(0,b.jsx)("code",{className:"rounded bg-muted px-2 py-0.5 text-xs",children:l}),(0,b.jsx)(g.Button,{variant:"ghost",onClick:()=>p(!0),className:"text-xs text-muted-foreground",children:a("settings.backup.dirChange")})]}),(0,b.jsx)(U.FolderBrowserDialog,{open:o,onOpenChange:p,onSelect:N})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(g.Button,{onClick:()=>{C(""),z(!0)},disabled:aj,className:"gap-2",children:"create"===w?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-4 w-4 animate-spin"})," ",a("settings.backup.creating")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(V,{className:"h-4 w-4"})," ",a("settings.backup.create")]})}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsxs)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",disabled:aj,onClick:()=>E.current?.click(),className:"gap-2"}),children:[(0,b.jsx)(X,{className:"h-4 w-4"}),a("settings.backup.import")]}),(0,b.jsx)(T.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.importHint")})]}),(0,b.jsx)("input",{ref:E,type:"file",accept:".tar.gz,.gz",className:"hidden",onChange:R})]}),(0,b.jsx)(m.Dialog,{open:y,onOpenChange:z,children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(m.DialogHeader,{children:(0,b.jsx)(m.DialogTitle,{children:a("settings.backup.create")})}),(0,b.jsxs)("div",{className:"py-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.backup.createLabel")}),(0,b.jsx)(h.Input,{value:B,onChange:a=>C(a.target.value),onKeyDown:a=>"Enter"===a.key&&K(),placeholder:a("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>z(!1),children:a("common.cancel")}),(0,b.jsx)(g.Button,{onClick:K,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:a("settings.backup.create")})]})]})}),u?(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(D.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===j.length?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,b.jsx)($.Archive,{className:"h-10 w-10 text-muted-foreground/30"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("settings.backup.empty")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:a("settings.backup.emptyDesc")})]}):(0,b.jsx)("div",{className:"space-y-3",children:j.map(c=>{var d,f;return(0,b.jsx)("div",{className:"group rounded-lg border border-border bg-card p-4 transition-colors hover:bg-accent/30",children:(0,b.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[c.label?(0,b.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:c.label}):(0,b.jsx)("span",{className:"truncate text-sm font-medium font-mono text-foreground",children:c.filename}),c.autoBackup&&(0,b.jsx)("span",{className:"shrink-0 rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500 ring-1 ring-amber-500/20",children:a("settings.backup.autoLabel")})]}),c.label&&(0,b.jsx)("div",{className:"mt-0.5 text-[11px] font-mono text-muted-foreground/60",children:c.filename}),(0,b.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[(d=c.size)<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:`${(d/1048576).toFixed(1)} MB`," · ",(f=c.createdAt,new Date(f).toLocaleString("zh"===e?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}))]}),c.preview.length>0&&(0,b.jsxs)("div",{className:"mt-1.5 text-xs text-muted-foreground",children:[c.preview.map((a,c)=>(0,b.jsxs)("span",{children:[c>0&&" ",a.workspace,"(",a.projects.join(", "),")"]},c)),c.stats.workspaces>c.preview.length&&(0,b.jsxs)("span",{children:[" ",a("settings.backup.workspaces",{count:String(c.stats.workspaces)})]})]}),(0,b.jsxs)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:[a("settings.backup.projects",{count:String(c.stats.projects)})," · ",a("settings.backup.tasks",{count:String(c.stats.tasks)})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>L(c.filename),disabled:aj,className:"text-muted-foreground hover:text-foreground"}),children:(0,b.jsx)(W.Upload,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(T.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.restore")})]}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",onClick:()=>M(c.filename),disabled:aj,className:"text-muted-foreground hover:text-rose-400"}),children:(0,b.jsx)(A.Trash2,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(T.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.delete")})]})]})]})},c.filename)})}),(0,b.jsxs)("div",{className:"border-t border-border pt-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-rose-400",children:[(0,b.jsx)(Z.AlertTriangle,{className:"h-4 w-4"}),a("settings.backup.dangerZone")]}),(0,b.jsx)("p",{className:"mt-2 text-xs text-muted-foreground leading-relaxed",children:a("settings.backup.resetDesc")}),(0,b.jsxs)(g.Button,{variant:"outline",onClick:()=>{I(""),G(!0)},disabled:aj,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,b.jsx)(Y.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),a("settings.backup.reset")]})]}),(0,b.jsx)(m.Dialog,{open:F,onOpenChange:G,children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:a("settings.backup.resetConfirmTitle")}),(0,b.jsx)(m.DialogDescription,{children:a("settings.backup.resetConfirmDesc")})]}),(0,b.jsxs)("div",{className:"py-2",children:[(0,b.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:a("settings.backup.resetConfirmInput")}),(0,b.jsx)(h.Input,{value:H,onChange:a=>I(a.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>G(!1),children:a("common.cancel")}),(0,b.jsx)(g.Button,{disabled:"RESET"!==H,onClick:S,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:a("settings.backup.reset")})]})]})})]})}var ak=a.i(953093),al=a.i(668116);let am=(0,p.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var an=a.i(22761),ao=a.i(963326),ap=a.i(192369),aq=a.i(599209),ar=a.i(627141);let as=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function at({cmd:a}){let{t:d}=(0,f.useI18n)(),[e,h]=(0,c.useState)(!1),i=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)}h(!0),_.toast.success(d("common.copied")),setTimeout(()=>h(!1),1500)}catch{_.toast.error(d("common.copyFailed"))}};return(0,b.jsxs)("div",{className:"flex items-start gap-1 rounded-md bg-background/60 pl-2 pr-1 py-1 ring-1 ring-border/60",children:[(0,b.jsx)("code",{className:"min-w-0 flex-1 break-all font-mono text-[11px] leading-relaxed",children:a}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d("common.copy"),onClick:i,children:e?(0,b.jsx)(al.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(an.Copy,{className:"h-3 w-3"})})]})}function au({extension:a}){let{t:d}=(0,f.useI18n)(),{status:e,loading:h,isInstalling:i,install:j,uninstall:k,refresh:l}=(0,ar.useExtension)(a.id),[m,n]=(0,c.useState)(!1),o=a.icon,p=e.installed,q=async()=>{let b=await j();b.success?_.toast.success(d("settings.extensions.installSuccess").replace("{name}",a.name)):_.toast.error(d("settings.extensions.installFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},r=async()=>{let b=await k();b.success?_.toast.success(d("settings.extensions.uninstallSuccess").replace("{name}",a.name)):_.toast.error(d("settings.extensions.uninstallFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},s=async()=>{n(!0);try{await l()}finally{n(!1)}},t=()=>{window.open(a.homepageUrl,"_blank","noopener,noreferrer")};return(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-background ring-1 ring-border",children:(0,b.jsx)(o,{className:"h-5 w-5 text-muted-foreground"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:a.name}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a.description})]})]}),(0,b.jsxs)("span",{className:"shrink-0 rounded-md bg-background px-2 py-0.5 text-xs text-muted-foreground ring-1 ring-border",children:["~",a.sizeMB," MB"]})]}),(0,b.jsx)("div",{className:"mt-4 flex items-center gap-2 text-xs",children:h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin text-muted-foreground"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:d("common.loading")})]}):p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(E.CheckCircle2,{className:"h-3.5 w-3.5 text-emerald-500"}),(0,b.jsxs)("span",{className:"text-foreground",children:[d("settings.extensions.installed"),e.version?` v${e.version}`:""]})]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(am,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,b.jsx)("span",{className:"text-muted-foreground",children:d("settings.extensions.notInstalledShort")})]})}),(0,b.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[p?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Button,{variant:"default",onClick:q,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.reinstalling")]}):d("settings.extensions.reinstall")}),(0,b.jsx)(g.Button,{variant:"outline",onClick:r,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.uninstalling")]}):d("settings.extensions.uninstall")})]}):a.manualInstall?(0,b.jsxs)(aq.Popover,{children:[(0,b.jsx)(aq.PopoverTrigger,{render:a=>(0,b.jsxs)(g.Button,{variant:"default",...a,children:[(0,b.jsx)(V,{className:"h-3.5 w-3.5"}),d("settings.extensions.installViaHomepage")]})}),(0,b.jsxs)(aq.PopoverContent,{align:"start",className:"w-80 max-w-[90vw] gap-2 text-xs leading-relaxed",children:[(0,b.jsx)("p",{children:d("settings.extensions.manualInstallHintIntro")}),(0,b.jsx)("div",{className:"space-y-2",children:as.map(({os:a,cmd:c})=>(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:a}),(0,b.jsx)(at,{cmd:c})]},a))}),(0,b.jsx)("p",{className:"text-muted-foreground",children:d("settings.extensions.manualInstallHintAfter")}),(0,b.jsxs)("button",{type:"button",onClick:t,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,b.jsx)(ao.ExternalLink,{className:"h-3 w-3"}),d("settings.extensions.visitHomepage")]})]})]}):(0,b.jsx)(g.Button,{variant:"default",onClick:q,disabled:i,children:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.installing")]}):d("settings.extensions.install")}),(0,b.jsxs)(g.Button,{variant:"ghost",onClick:s,disabled:m,children:[(0,b.jsx)(ap.RefreshCw,{className:`h-3.5 w-3.5 ${m?"animate-spin":""}`}),d("settings.extensions.recheck")]}),(0,b.jsxs)(g.Button,{variant:"ghost",onClick:t,children:[(0,b.jsx)(ao.ExternalLink,{className:"h-3.5 w-3.5"}),d("settings.extensions.visitHomepage")]})]})]})}function av(){let{t:a}=(0,f.useI18n)(),c=(0,ak.listExtensionMetadata)();return(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("header",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:a("settings.extensions.title")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("settings.extensions.desc")})]}),(0,b.jsx)("div",{className:"space-y-3",children:c.map(a=>(0,b.jsx)(au,{extension:a},a.id))})]})}a.i(423993);var aw=a.i(109603),ax=a.i(975787),ay=a.i(875846),az=a.i(718799);let aA=["global","panels","missions"],aB=new Set(["missions.cycleBack"]);function aC({keys:a}){return(0,b.jsx)(az.KeyCombo,{keys:a})}function aD(){let a,{t:d}=(0,f.useI18n)(),e=(0,ay.useKeymapStore)(a=>a.overrides),h=(0,ay.useKeymapStore)(a=>a.setBinding),i=(0,ay.useKeymapStore)(a=>a.resetBinding),j=(0,ay.useKeymapStore)(a=>a.resetAll),[l,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(null),q=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(l){let a=requestAnimationFrame(()=>q.current?.focus());return()=>cancelAnimationFrame(a)}},[l]);let r=(0,c.useMemo)(()=>{let a=new Map;for(let b of aw.SHORTCUT_ACTIONS)for(let c of e[b.id]??[...b.defaultKeys])a.has(c)||a.set(c,b.id);return a},[e]),s=(0,c.useMemo)(()=>aA.map(a=>({group:a,actions:aw.SHORTCUT_ACTIONS.filter(b=>b.group===a&&!aB.has(b.id))})).filter(a=>a.actions.length>0),[]),t=l?(0,aw.getAction)(l):null,u=o&&l&&(a=r.get(o))&&a!==l?a:null;function v(){n(null),p(null)}return(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsxs)("header",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:d("settings.keyboardShortcuts")}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("settings.keyboardShortcutsDesc")})]}),(0,b.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:function(){j(),_.toast.success(d("settings.shortcuts.resetAllDone"))},children:[(0,b.jsx)(Y.RotateCcw,{className:"h-3.5 w-3.5"}),d("settings.shortcuts.resetAll")]})]}),(0,b.jsx)("div",{className:"space-y-6",children:s.map(({group:a,actions:c})=>(0,b.jsxs)("section",{children:[(0,b.jsx)("h3",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:d(`shortcuts.group.${a}`)}),(0,b.jsx)("ul",{className:"divide-y divide-border/50 rounded-xl border border-border bg-card",children:c.map(a=>{let c,f=a.id in e;return(0,b.jsxs)("li",{className:"flex items-center justify-between gap-4 px-5 py-3.5",children:[(0,b.jsx)("span",{className:"min-w-0 flex-1 text-sm",children:d(a.descriptionKey)}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,b.jsx)(aC,{keys:e[c=a.id]??[...(0,aw.getAction)(c).defaultKeys]}),a.configurable?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(g.Button,{variant:"outline",size:"sm",onClick:()=>{var b;return b=a.id,void(p(null),n(b))},children:d("settings.shortcuts.rebind")}),f&&(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>i(a.id),children:(0,b.jsx)(Y.RotateCcw,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(T.TooltipContent,{children:d("settings.shortcuts.reset")})]})]}):(0,b.jsx)(k.Badge,{variant:"outline",className:"text-muted-foreground",children:d("settings.shortcuts.fixed")})]})]},a.id)})})]},a))}),(0,b.jsx)(m.Dialog,{open:null!==l,onOpenChange:a=>!a&&v(),children:(0,b.jsxs)(m.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:t?d(t.descriptionKey):d("settings.shortcuts.rebind")}),(0,b.jsx)(m.DialogDescription,{children:d("settings.shortcuts.pressKey")})]}),(0,b.jsx)("textarea",{ref:q,readOnly:!0,tabIndex:0,"aria-label":d("settings.shortcuts.pressKey"),onKeyDown:a=>{a.preventDefault(),a.stopPropagation();let b=(0,ax.serializeKeyEvent)(a.nativeEvent);b&&p(b)},className:"flex h-20 w-full cursor-pointer resize-none items-center justify-center rounded-lg border border-dashed border-border bg-muted/30 text-center text-sm outline-none focus:border-ring focus:ring-1 focus:ring-ring"}),(0,b.jsx)("div",{className:"flex min-h-8 items-center justify-center",children:o?(0,b.jsx)(aC,{keys:[o]}):(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:d("settings.shortcuts.pressKey")})}),u&&(0,b.jsx)("p",{className:"text-center text-xs text-amber-600 dark:text-amber-400",children:d("settings.shortcuts.conflict",{name:d((0,aw.getAction)(u).descriptionKey)})}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:v,children:d("settings.shortcuts.cancel")}),(0,b.jsx)(g.Button,{variant:"default",onClick:function(){l&&o&&(h(l,[o]),v(),_.toast.success(d("settings.shortcuts.saved")))},disabled:!o,children:d("settings.shortcuts.saveBtn")})]})]})})]})}function aE({options:a,value:c,onChange:d}){return(0,b.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:a.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>d(a.value),className:(0,n.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",c===a.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:a.label},a.value))})}function aF({label:a,description:c,children:d,className:e}){return(0,b.jsxs)("div",{className:(0,n.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",e),children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:a}),c&&(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:c})]}),(0,b.jsx)("div",{className:"shrink-0",children:d})]})}let aG=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:o.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:q,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:r.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:s,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:v.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:t.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:u.HardDrive,accent:"cyan"},{id:"keyboard-shortcuts",labelKey:"settings.keyboardShortcuts",descKey:"settings.keyboardShortcutsDesc",icon:w.Keyboard,accent:"violet"}],aH={blue:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},emerald:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},violet:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},amber:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},cyan:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},rose:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"},indigo:{bg:"bg-accent",text:"text-foreground",ring:"ring-border",indicator:"bg-foreground"}},aI="ai-manager:default-cli-adapter",aJ={host:"",ownerMatch:"*",localPathTemplate:"",priority:0},aK=a=>a.replace(/\\/g,"/").replace(/\/+$/,"");function aL(){let a=(0,d.useRouter)(),{t:o}=(0,f.useI18n)(),{theme:p,setTheme:q}=(0,e.useTheme)(),{locale:r,setLocale:s}=(0,f.useI18n)(),[t,u]=(0,c.useState)("general"),v=(0,c.useRef)(null),[w,K]=(0,c.useState)({left:0,width:0}),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)("Terminal"),[Z,$]=(0,c.useState)([]),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)([]),[ad,ae]=(0,c.useState)(13),[af,ag]=(0,c.useState)("Menlo, Monaco, 'Courier New', monospace"),[ah,ai]=(0,c.useState)([]),[ak,al]=(0,c.useState)("claude"),[am,an]=(0,c.useState)(null),[ao,ap]=(0,c.useState)({}),[aq,ar]=(0,c.useState)([]),[as,at]=(0,c.useState)(!1),[au,aw]=(0,c.useState)(null),[ax,ay]=(0,c.useState)(null),[az,aA]=(0,c.useState)(""),[aB,aC]=(0,c.useState)(""),[aL,aM]=(0,c.useState)(""),[aN,aO]=(0,c.useState)([]),[aP,aQ]=(0,c.useState)(null),[aR,aS]=(0,c.useState)({...aJ}),[aT,aU]=(0,c.useState)(!1),[aV,aW]=(0,c.useState)({...aJ}),[aX,aY]=(0,c.useState)(!1),[aZ,a$]=(0,c.useState)(!1),[a_,a0]=(0,c.useState)(0),[a1,a2]=(0,c.useState)(null),[a3,a4]=(0,c.useState)(null),[a5,a6]=(0,c.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[a7,a8]=(0,c.useState)({timeoutSec:30}),[a9,ba]=(0,c.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[bb,bc]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[bd,be]=(0,c.useState)(null),[bf,bg]=(0,c.useState)(!1),[bh,bi]=(0,c.useState)(""),[bj,bk]=(0,c.useState)(!0);(0,c.useEffect)(()=>W(!0),[]),(0,c.useEffect)(()=>{(0,H.getConfigValue)("terminal.app","Terminal").then(Y),L().then($),(0,H.getConfigValue)("editor.command","").then(aa),M().then(ac),(0,H.getConfigValue)("terminal.fontSize",13).then(ae),(0,H.getConfigValue)("terminal.fontFamily","Menlo, Monaco, 'Courier New', monospace").then(ag)},[]),(0,c.useEffect)(()=>{if(0===Z.length||!X||Z.some(a=>a.value===X))return;let a=Z.find(a=>a.name===X);a&&(Y(a.value),(0,I.setConfigValue)("terminal.app",a.value))},[Z,X]),(0,c.useEffect)(()=>{if(0===ab.length||!_||ab.some(a=>a.command===_))return;let a=ab.find(a=>a.name===_);a&&(aa(a.command),(0,I.setConfigValue)("editor.command",a.command))},[ab,_]),(0,c.useEffect)(()=>{S().then(ai);let a=localStorage.getItem(aI);a&&al(a)},[]),(0,c.useEffect)(()=>{(0,N.getPrompts)().then(ar)},[]);let bl=async()=>{try{let a=await fetch("/api/internal/hooks/install");if(a.ok){let b=await a.json();be(b)}}catch{}};async function bm(a){if(!am){an(a),ap(b=>{let c={...b};return delete c[a],c});try{let b=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:a})}),c=await b.json();ap(b=>({...b,[a]:c}))}catch{ap(b=>({...b,[a]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{an(null)}}}(0,c.useEffect)(()=>{(0,H.getConfigValue)("git.pathMappingRules",[]).then(a=>{let b=new Set,c=!1,d=a.map(a=>{if(!a.id||b.has(a.id)){c=!0;let d={...a,id:crypto.randomUUID()};return b.add(d.id),d}return b.add(a.id),a});aO(d),c&&(0,I.setConfigValue)("git.pathMappingRules",d)}),(0,H.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(a=>{bi(a.join(", "))}),bl(),(0,J.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","system.maxReadableFileBytes","board.archiveDelayDays","task.defaultUseWorktree","task.defaultAutoStart","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","search.codeTimeoutSec","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(a=>{let b=a["system.maxUploadBytes"]??0x3200000,c=a["system.maxReadableFileBytes"]??5242880;a6({maxUploadMb:Math.round(b/1024/1024),maxConcurrent:a["system.maxConcurrentExecutions"]??3,maxReadableMb:Math.round(c/1024/1024),archiveDelayDays:a["board.archiveDelayDays"]??7,taskDefaultUseWorktree:"boolean"!=typeof a["task.defaultUseWorktree"]||a["task.defaultUseWorktree"],taskDefaultAutoStart:"boolean"==typeof a["task.defaultAutoStart"]&&a["task.defaultAutoStart"]}),a8({timeoutSec:a["git.timeoutSec"]??30}),ba({resultLimit:a["search.resultLimit"]??20,allModeCap:a["search.allModeCap"]??5,debounceMs:a["search.debounceMs"]??250,snippetLength:a["search.snippetLength"]??80,codeTimeoutSec:a["search.codeTimeoutSec"]??30}),bc({minCols:a["missions.grid.minCols"]??1,maxCols:a["missions.grid.maxCols"]??5,minRows:a["missions.grid.minRows"]??1,maxRows:a["missions.grid.maxRows"]??5})})},[]),(0,c.useEffect)(()=>{(0,H.getConfigValue)("notification.enabled",!0).then(bk)},[]);let bn=(0,c.useCallback)(()=>{aw(null),aA(""),aC(""),aM(""),at(!0)},[]),bo=(0,c.useCallback)(a=>{aw(a),aA(a.name),aC(a.description??""),aM(a.content),at(!0)},[]),bp=(0,c.useCallback)(async()=>{az.trim()&&aL.trim()&&(au?await P(au.id,{name:az.trim(),description:aB.trim()||void 0,content:aL.trim()}):await O({name:az.trim(),description:aB.trim()||void 0,content:aL.trim()}),at(!1),ar(await (0,N.getPrompts)()),a.refresh())},[az,aB,aL,au,a]),bq=(0,c.useCallback)(async()=>{ax&&(await Q(ax),ay(null),ar(await (0,N.getPrompts)()),a.refresh())},[ax,a]),br=(0,c.useCallback)(async b=>{await R(b),ar(await (0,N.getPrompts)()),a.refresh()},[a]),bs=async()=>{await (0,I.setConfigValue)("system.maxUploadBytes",1024*a5.maxUploadMb*1024),await (0,I.setConfigValue)("system.maxConcurrentExecutions",a5.maxConcurrent),await (0,I.setConfigValue)("system.maxReadableFileBytes",1024*a5.maxReadableMb*1024),await (0,I.setConfigValue)("board.archiveDelayDays",a5.archiveDelayDays)},bt=async()=>{await (0,I.setConfigValue)("task.defaultUseWorktree",a5.taskDefaultUseWorktree),await (0,I.setConfigValue)("task.defaultAutoStart",a5.taskDefaultAutoStart),await (0,I.setConfigValue)("task.mcpDefaultsConfigured",!0)},bu=async()=>{await (0,I.setConfigValue)("git.timeoutSec",a7.timeoutSec)},bv=async()=>{await (0,I.setConfigValue)("search.resultLimit",a9.resultLimit),await (0,I.setConfigValue)("search.allModeCap",a9.allModeCap),await (0,I.setConfigValue)("search.debounceMs",a9.debounceMs),await (0,I.setConfigValue)("search.snippetLength",a9.snippetLength),await (0,I.setConfigValue)("search.codeTimeoutSec",a9.codeTimeoutSec)},bw=async()=>{let a=Math.min(bb.minCols,bb.maxCols),b=Math.max(bb.minCols,bb.maxCols),c=Math.min(bb.minRows,bb.maxRows),d=Math.max(bb.minRows,bb.maxRows);bc({minCols:a,maxCols:b,minRows:c,maxRows:d}),await (0,I.setConfigValue)("missions.grid.minCols",a),await (0,I.setConfigValue)("missions.grid.maxCols",b),await (0,I.setConfigValue)("missions.grid.minRows",c),await (0,I.setConfigValue)("missions.grid.maxRows",d)},bx=async()=>{let a=bh.split(",").map(a=>a.trim()).filter(Boolean);await (0,I.setConfigValue)("hooks.autoUploadTypes",a)},by=async()=>{if(bd){bg(!0);try{let a=bd.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:a}),await bl()}finally{bg(!1)}}},bz=async()=>{if(!aV.host.trim()||!aV.localPathTemplate.trim())return;let a=aK(aV.localPathTemplate.trim()),b=aX?`${a}/{path}`:a,c=[...aN,{id:crypto.randomUUID(),host:aV.host.trim(),ownerMatch:aV.ownerMatch.trim()||"*",localPathTemplate:b,priority:aV.priority}];await (0,I.setConfigValue)("git.pathMappingRules",c),aO(c),aW({...aJ}),aY(!1),aU(!1)},bA=async a=>{if(!aR.host.trim()||!aR.localPathTemplate.trim())return;let b=aK(aR.localPathTemplate.trim()),c=aZ?`${b}/{path}`:b,d=aN.map(b=>b.id===a?{...b,host:aR.host.trim(),ownerMatch:aR.ownerMatch.trim()||"*",localPathTemplate:c,priority:aR.priority}:b);await (0,I.setConfigValue)("git.pathMappingRules",d),aO(d),aQ(null),a$(!1)},bB=async a=>{let b=aN.filter(b=>b.id!==a);await (0,I.setConfigValue)("git.pathMappingRules",b),aO(b),a2(null)};async function bC(){let a=!bj;bk(a),await (0,I.setConfigValue)("notification.enabled",a)}let bD=(0,c.useCallback)(()=>{a.back()},[a]);(0,c.useEffect)(()=>{let a=v.current;if(!a)return;let b=a.querySelector(`[data-section="${t}"]`);if(!b)return;let c=a.getBoundingClientRect(),d=b.getBoundingClientRect();K({left:d.left-c.left,width:d.width})},[t]);let bE=aG.find(a=>a.id===t),bF=bE?aH[bE.accent]:aH.blue;return(0,b.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,b.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,b.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:o("settings.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:o("settings.configDesc")})]}),(0,b.jsxs)(g.Button,{variant:"outline",onClick:bD,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,b.jsx)(x.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,b.jsxs)("div",{ref:v,className:"relative flex gap-1 overflow-x-auto",children:[aG.map(a=>{let c=a.icon,d=t===a.id,e=aH[a.accent];return(0,b.jsxs)("button",{"data-section":a.id,onClick:()=>u(a.id),className:(0,n.cn)("relative flex items-center gap-2 rounded-t-lg px-4 py-2.5","text-sm font-medium whitespace-nowrap cursor-pointer","transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",d?`${e.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,b.jsx)("span",{className:(0,n.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",d?e.bg:"bg-transparent"),children:(0,b.jsx)(c,{className:"h-3.5 w-3.5"})}),(0,b.jsx)("span",{children:o(a.labelKey)})]},a.id)}),(0,b.jsx)("div",{className:(0,n.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",bF.indicator),style:{left:w.left,width:w.width}})]})]})}),(0,b.jsx)("div",{className:"flex-1 overflow-auto",children:(0,b.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[bE&&(0,b.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,b.jsx)("div",{className:(0,n.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",bF.bg,bF.text,bF.ring),children:(0,b.jsx)(bE.icon,{className:"h-5 w-5"})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:o(bE.labelKey)}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:o(bE.descKey)})]})]}),(0,b.jsx)("div",{className:"mb-6 border-t"}),function(){switch(t){case"general":let a;return a=[{value:"light",label:o("settings.themeLight")},{value:"dark",label:o("settings.themeDark")},{value:"system",label:o("settings.themeSystem")}],(0,b.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,b.jsx)(aF,{label:o("settings.theme"),description:o("settings.themeDesc"),children:V?(0,b.jsx)(aE,{options:a,value:p??"system",onChange:a=>q(a)}):(0,b.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,b.jsx)(aF,{label:o("settings.language"),description:o("settings.languageDesc"),children:(0,b.jsx)(aE,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:r,onChange:a=>s(a)})}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.terminal.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.terminal.desc")})]}),Z.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:Z.map(a=>{let c=X===a.value,d=(0,n.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",a.installed?c?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),e=()=>{a.installed&&(Y(a.value),(0,I.setConfigValue)("terminal.app",a.value))};return a.installed?(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name},a.value):(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(T.TooltipContent,{side:"top",children:o("settings.app.notInstalled")})]},a.value)})})]}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.terminalFont.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.terminalFont.desc")})]}),(0,b.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-4",children:[(0,b.jsxs)("label",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o("settings.terminalFont.size"),(0,b.jsx)("input",{type:"number",min:8,max:40,value:ad,onChange:a=>{let b=Math.max(8,Math.min(40,Math.round(Number(a.target.value)||13)));ae(b),(0,I.setConfigValue)("terminal.fontSize",b)},className:"h-8 w-20 rounded-md border border-border bg-background px-2 text-sm text-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]}),(0,b.jsxs)("label",{className:"flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground",children:[o("settings.terminalFont.family"),(0,b.jsx)("input",{type:"text",value:af,placeholder:"Menlo, Monaco, 'Courier New', monospace",onChange:a=>ag(a.target.value),onBlur:a=>{let b=a.target.value.trim()||"Menlo, Monaco, 'Courier New', monospace";ag(b),(0,I.setConfigValue)("terminal.fontFamily",b)},className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 font-mono text-xs text-foreground outline-none focus:border-ring focus:ring-1 focus:ring-ring"})]})]}),(0,b.jsx)("div",{className:"mt-1.5 text-[11px] text-muted-foreground/70",children:o("settings.terminalFont.hint")})]}),(0,b.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.editor.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.editor.desc")})]}),ab.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ab.map(a=>{let c=_===a.command,d=(0,n.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200",a.installed?c?"border-foreground bg-accent text-foreground font-medium cursor-pointer":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground cursor-pointer":"cursor-not-allowed border-dashed border-border/60 text-muted-foreground/40"),e=()=>{a.installed&&(aa(a.command),(0,I.setConfigValue)("editor.command",a.command))};return a.installed?(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name},a.command):(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(T.TooltipContent,{side:"top",children:o("settings.app.notInstalled")})]},a.command)})})]})]});case"ai-tools":return(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ah.map(a=>{let c=ak===a.name,d=am===a.name,e=ao[a.name];return(0,b.jsx)("li",{children:(0,b.jsxs)("div",{className:"px-5 py-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium",children:a.displayName}),(0,b.jsx)(k.Badge,{variant:"outline",children:o("label.builtin")}),c&&(0,b.jsxs)(k.Badge,{variant:"secondary",className:"shrink-0",children:[(0,b.jsx)(z,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),o("settings.prompts.default")]}),e&&(0,b.jsx)(k.Badge,{variant:e.ok?"secondary":"destructive",className:(0,n.cn)("shrink-0",e.ok&&"bg-green-600 text-white hover:bg-green-700"),children:e.ok?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(E.CheckCircle2,{className:"h-3 w-3 mr-1"}),o("settings.aiTools.testPassed")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(F.XCircle,{className:"h-3 w-3 mr-1"}),o("settings.aiTools.testFailed")]})})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.cli.available&&a.cli.version?`${a.name} \xb7 ${a.cli.version}`:a.name})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!c&&(0,b.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:()=>{var b;al(b=a.name),localStorage.setItem(aI,b)},children:[(0,b.jsx)(z,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),o("settings.prompts.setDefault")]}),(0,b.jsx)(g.Button,{variant:"outline",size:"sm",onClick:()=>bm(a.name),disabled:d,children:d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),o("settings.aiTools.testing")]}):o("settings.aiTools.testConnection")})]})]}),e&&(0,b.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,b.jsx)("div",{className:"space-y-1.5",children:e.checks.map(c=>(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)("span",{className:(0,n.cn)("w-1.5 h-1.5 rounded-full shrink-0",c.passed?"bg-green-500":"bg-red-500")}),(0,b.jsx)("span",{className:(0,n.cn)(c.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:c.message})]},`${a.name}-${c.name}`))})})]})},a.name)})});case"prompts":return V?(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(g.Button,{onClick:bn,variant:"default",children:[(0,b.jsx)(y.Plus,{className:"h-4 w-4 mr-2"}),o("settings.prompts.newPrompt")]})}),0===aq.length?(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,b.jsx)("p",{className:"text-muted-foreground",children:o("settings.prompts.empty")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:o("settings.prompts.emptyHint")})]}):(0,b.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:aq.map(a=>(0,b.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("h4",{className:"text-sm font-medium truncate",children:a.name}),a.isDefault&&(0,b.jsxs)(k.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,b.jsx)(z,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),o("settings.prompts.default")]})]}),a.description&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:a.description})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>br(a.id),title:o("settings.prompts.setDefault"),children:(0,b.jsx)(z,{className:(0,n.cn)("h-4 w-4",a.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bo(a),title:o("settings.prompts.editPrompt"),children:(0,b.jsx)(B,{className:"h-4 w-4"})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ay(a.id),className:"text-destructive",title:o("settings.prompts.delete"),children:(0,b.jsx)(A.Trash2,{className:"h-4 w-4"})})]})]},a.id))}),(0,b.jsx)(m.Dialog,{open:as,onOpenChange:at,children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:au?o("settings.prompts.editPrompt"):o("settings.prompts.newPrompt")}),(0,b.jsx)(m.DialogDescription,{children:au?o("settings.prompts.editPrompt"):o("settings.prompts.newPrompt")})]}),(0,b.jsxs)("div",{className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-name",children:o("settings.prompts.promptName")}),(0,b.jsx)(h.Input,{id:"prompt-name",value:az,onChange:a=>aA(a.target.value),placeholder:o("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-description",children:o("settings.prompts.promptDescription")}),(0,b.jsx)(h.Input,{id:"prompt-description",value:aB,onChange:a=>aC(a.target.value),placeholder:o("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(j.Label,{htmlFor:"prompt-content",children:o("settings.prompts.promptContent")}),(0,b.jsx)(i.Textarea,{id:"prompt-content",value:aL,onChange:a=>aM(a.target.value),placeholder:o("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>at(!1),children:o("settings.prompts.cancel")}),(0,b.jsx)(g.Button,{onClick:bp,disabled:!az.trim()||!aL.trim(),children:o("settings.prompts.save")})]})]})}),(0,b.jsx)(m.Dialog,{open:!!ax,onOpenChange:a=>!a&&ay(null),children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:o("settings.prompts.deleteConfirmTitle")}),(0,b.jsx)(m.DialogDescription,{children:o("settings.prompts.deleteConfirmMessage")})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>ay(null),children:o("settings.prompts.cancel")}),(0,b.jsx)(g.Button,{variant:"destructive",onClick:bq,children:o("settings.prompts.delete")})]})]})})]}):(0,b.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let c,d,e;return(0,b.jsxs)("div",{className:"space-y-8",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.git.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.git.desc")})]}),(0,b.jsxs)(g.Button,{onClick:()=>{aW({...aJ}),aU(!0)},children:[(0,b.jsx)(y.Plus,{className:"mr-2 h-4 w-4"}),o("settings.config.git.addRule")]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[0!==aN.length||aT?(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:aN.map(a=>aP===a.id?(0,b.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.host")}),(0,b.jsx)(h.Input,{value:aR.host,onChange:a=>aS(b=>({...b,host:a.target.value})),placeholder:o("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.ownerMatch")}),(0,b.jsx)(h.Input,{value:aR.ownerMatch,onChange:a=>aS(b=>({...b,ownerMatch:a.target.value})),placeholder:o("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,b.jsxs)("div",{className:"space-y-1.5 col-span-2",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{value:aR.localPathTemplate,onChange:a=>aS(b=>({...b,localPathTemplate:a.target.value})),placeholder:o("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:aZ?"default":"outline",size:"sm",type:"button",onClick:()=>a$(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(T.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:o("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:o("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>a4("edit"),children:(0,b.jsx)(G.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(T.TooltipContent,{children:o("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:aZ?o("onboarding.step3.pathHintFull"):o("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs text-muted-foreground",children:o("settings.config.git.priority")}),(0,b.jsx)(h.Input,{type:"number",value:aR.priority,onChange:a=>aS(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]})]}),(0,b.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"sm",onClick:()=>{aQ(null),a$(!1)},children:o("settings.config.git.cancel")}),(0,b.jsx)(g.Button,{size:"sm",onClick:()=>bA(a.id),children:o("settings.config.git.save")})]})]},a.id):(0,b.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"font-medium text-sm",children:a.host}),"*"!==a.ownerMatch&&(0,b.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",a.ownerMatch]}),(0,b.jsxs)(k.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[o("settings.config.git.priority")," ",a.priority]})]}),(0,b.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:a.localPathTemplate})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{let b,c,d;return b=a.localPathTemplate,d=(c=/\/\{path\}\/?$/.test(b))?b.replace(/\/?\{path\}\/?$/,"").replace(/\/+$/,""):b,void(aQ(a.id),aS({host:a.host,ownerMatch:a.ownerMatch,localPathTemplate:d,priority:a.priority}),a$(c))},title:o("settings.config.git.edit"),children:(0,b.jsx)(B,{className:"h-4 w-4"})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",onClick:()=>a2(a.id),className:"text-destructive",title:o("settings.config.git.delete"),children:(0,b.jsx)(A.Trash2,{className:"h-4 w-4"})})]})]})},a.id))}):(0,b.jsxs)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:[(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:o("settings.config.git.noRules")}),(0,b.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground/80",children:o("settings.config.git.noRulesFallback")})]}),aT&&(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:o("settings.config.git.host")}),(0,b.jsx)(h.Input,{value:aV.host,onChange:a=>aW(b=>({...b,host:a.target.value})),placeholder:o("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"text-xs font-medium",children:o("settings.config.git.ownerMatch")}),(0,b.jsx)(h.Input,{value:aV.ownerMatch,onChange:a=>aW(b=>({...b,ownerMatch:a.target.value})),placeholder:o("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:o("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{value:aV.localPathTemplate,onChange:a=>aW(b=>({...b,localPathTemplate:a.target.value})),placeholder:o("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:aX?"default":"outline",size:"sm",type:"button",onClick:()=>aY(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(T.TooltipContent,{side:"top",className:"max-w-xs",children:(0,b.jsxs)("div",{className:"space-y-1 text-xs",children:[(0,b.jsx)("div",{className:"font-medium",children:o("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:o("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(T.Tooltip,{children:[(0,b.jsx)(T.TooltipTrigger,{render:(0,b.jsx)(g.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>a4("add"),children:(0,b.jsx)(G.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(T.TooltipContent,{children:o("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:aX?o("onboarding.step3.pathHintFull"):o("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:o("settings.config.git.priority")}),(0,b.jsx)(h.Input,{type:"number",value:aV.priority,onChange:a=>aW(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]}),aV.localPathTemplate&&(c=aV.localPathTemplate.trim().replace(/\/+$/,""),d=aX?`${c}/{path}`:c,e=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,b.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:o("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1",children:e.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>a0(c),className:(0,n.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",a_===c?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:a.label},c))})]}),(0,b.jsxs)("div",{className:"space-y-0.5",children:[(0,b.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:e[a_].url}),(0,b.jsxs)("p",{className:"font-mono text-sm",children:[(0,b.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,b.jsx)("span",{className:"text-foreground font-medium",children:function(a,b){if(!a||!b)return"";let c=b.trim(),d=[],e=c.match(/^git@[^:]+:(.+)$/);if(e)d=e[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let a=new URL(c);d=decodeURIComponent(a.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!d.length)return"";let f=d[0],g=d[d.length-1],h=d.join("/");if(a.includes("{path}"))return a.replace("{path}",h).replace("{owner}",f).replace("{repo}",g).replace(/\/+$/,"");let i=a.replace("{owner}",f).replace("{repo}","").replace(/\/+$/,"");return`${i}/${g}`}(d,e[a_].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(g.Button,{variant:"ghost",size:"sm",onClick:()=>aU(!1),children:o("settings.config.git.cancel")}),(0,b.jsxs)(g.Button,{size:"sm",onClick:bz,disabled:!aV.host.trim()||!aV.localPathTemplate.trim(),children:[(0,b.jsx)(C,{className:"h-3.5 w-3.5 mr-1.5"}),o("settings.config.git.save")]})]})]})]})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.system.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.system.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxUpload")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxUploadHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:500,value:a5.maxUploadMb,onChange:a=>a6(b=>({...b,maxUploadMb:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxConcurrent")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxConcurrentHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:a5.maxConcurrent,onChange:a=>a6(b=>({...b,maxConcurrent:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.maxReadable")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.maxReadableHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:50,value:a5.maxReadableMb,onChange:a=>a6(b=>({...b,maxReadableMb:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.archiveDelay")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.archiveDelayHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:1,max:365,value:a5.archiveDelayDays,onChange:a=>a6(b=>({...b,archiveDelayDays:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:o("settings.config.system.archiveDelayUnit")})]})]})]}),(0,b.jsx)(g.Button,{onClick:bs,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.task.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.task.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.taskDefaultWorktree")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.taskDefaultWorktreeHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>a6(a=>({...a,taskDefaultUseWorktree:!a.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a5.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a5.taskDefaultUseWorktree?o("task.worktreeYes"):o("task.worktreeNo")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.system.taskDefaultAutoStart")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.system.taskDefaultAutoStartHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>a6(a=>({...a,taskDefaultAutoStart:!a.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${a5.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:a5.taskDefaultAutoStart?o("task.autoStartYes"):o("task.autoStartNo")})]})]}),(0,b.jsx)(g.Button,{onClick:bt,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.gitParams.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.gitParams.desc")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.gitParams.timeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.gitParams.timeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:5,max:300,value:a7.timeoutSec,onChange:a=>a8(b=>({...b,timeoutSec:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,b.jsx)(g.Button,{onClick:bu,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.search.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.search.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.resultLimit")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.resultLimitHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:5,max:100,value:a9.resultLimit,onChange:a=>ba(b=>({...b,resultLimit:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.allModeCap")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.allModeCapHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:1,max:20,value:a9.allModeCap,onChange:a=>ba(b=>({...b,allModeCap:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.debounceMs")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.debounceMsHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:50,max:1e3,value:a9.debounceMs,onChange:a=>ba(b=>({...b,debounceMs:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.snippetLength")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.snippetLengthHint")})]}),(0,b.jsx)(h.Input,{type:"number",min:20,max:500,value:a9.snippetLength,onChange:a=>ba(b=>({...b,snippetLength:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.search.codeTimeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.search.codeTimeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Input,{type:"number",min:5,max:300,step:5,value:a9.codeTimeoutSec,onChange:a=>ba(b=>({...b,codeTimeoutSec:Number(a.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]})]}),(0,b.jsx)(g.Button,{onClick:bv,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.missions.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.missions.desc")})]}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.minCols")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:bb.minCols,onChange:a=>bc(b=>({...b,minCols:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.maxCols")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:bb.maxCols,onChange:a=>bc(b=>({...b,maxCols:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.minRows")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:bb.minRows,onChange:a=>bc(b=>({...b,minRows:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsx)("label",{className:"text-sm font-medium flex-1",children:o("settings.config.missions.maxRows")}),(0,b.jsx)(h.Input,{type:"number",min:1,max:10,value:bb.maxRows,onChange:a=>bc(b=>({...b,maxRows:Number(a.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,b.jsx)(g.Button,{onClick:bw,className:"rounded-lg",children:o("common.save")})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:o("settings.config.hooks.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:o("settings.config.hooks.desc")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-4",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:o("settings.config.hooks.autoUploadTypes")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.hooks.autoUploadTypesHint")})]}),(0,b.jsx)(h.Input,{value:bh,onChange:a=>bi(a.target.value),placeholder:"png, jpg, jpeg, gif, webp, svg, pdf",className:"w-80 rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,b.jsx)(g.Button,{onClick:bx,className:"rounded-lg",children:o("common.save")}),(0,b.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:bd?.installed?o("settings.config.hooks.installed"):o("settings.config.hooks.notInstalled")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:o("settings.config.hooks.installHint")})]}),(0,b.jsx)(g.Button,{variant:bd?.installed?"destructive":"default",onClick:by,disabled:bf||!bd,className:"rounded-lg",children:bd?.installed?o("settings.config.hooks.uninstall"):o("settings.config.hooks.install")})]})]}),(0,b.jsx)(m.Dialog,{open:!!a1,onOpenChange:a=>!a&&a2(null),children:(0,b.jsxs)(m.DialogContent,{children:[(0,b.jsxs)(m.DialogHeader,{children:[(0,b.jsx)(m.DialogTitle,{children:o("settings.config.git.deleteConfirm")}),(0,b.jsx)(m.DialogDescription,{children:o("settings.config.git.deleteConfirmMessage")})]}),(0,b.jsxs)(m.DialogFooter,{children:[(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>a2(null),children:o("settings.config.git.cancel")}),(0,b.jsx)(g.Button,{variant:"destructive",onClick:()=>a1&&bB(a1),children:o("settings.config.git.delete")})]})]})})]});case"notifications":return(0,b.jsx)("div",{className:"divide-y divide-border/50",children:(0,b.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:o("settings.notifications.enable")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:o("settings.notifications.enableDesc")})]}),(0,b.jsx)(l.Switch,{checked:bj,onCheckedChange:bC})]})});case"backup":return(0,b.jsx)(aj,{});case"extensions":return(0,b.jsx)(av,{});case"keyboard-shortcuts":return(0,b.jsx)(aD,{})}}()]})}),(0,b.jsx)(U.FolderBrowserDialog,{open:null!==a3,onOpenChange:a=>{a||a4(null)},onSelect:a=>{let b=aK(a);"add"===a3?aW(a=>({...a,localPathTemplate:b})):"edit"===a3&&aS(a=>({...a,localPathTemplate:b})),a4(null)}})]})}a.s(["default",0,function(){return(0,b.jsx)(aL,{})}],520788)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_app_settings_page_tsx_0h9v7dr._.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
module.exports=[919647,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(704494),e=a.i(573242),f=a.i(865011),g=a.i(951192),h=a.i(731333),i=a.i(780410);let j=(0,i.createServerReference)("4055b6e8b3734fde3298c09bbf70af5f92de4b6627",i.callServer,void 0,i.findSourceMapURL,"getProjectAssets");var k=a.i(347165),l=a.i(579834),m=a.i(350739),n=a.i(509405),o=a.i(975231),p=a.i(699570),q=a.i(161181);function r({asset:a,onPreview:c,onReveal:d,onDelete:e,onTaskClick:f}){var h;let{t:i}=(0,g.useI18n)(),j=(0,q.localPathToApiUrl)(a.path),l=(0,q.isImageAsset)(a.filename,a.mimeType);return(0,b.jsxs)("div",{className:"flex items-center gap-4 rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:bg-accent/20",children:[(0,b.jsx)(p.Button,{variant:"ghost",onClick:()=>c(a),className:"flex-shrink-0 cursor-pointer p-0 h-auto",children:l?(0,b.jsx)("img",{src:j,alt:a.filename,className:"h-12 w-12 rounded object-cover border border-border"}):(0,b.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded border border-border bg-muted",children:(0,b.jsx)(m.FileText,{className:"h-6 w-6 text-muted-foreground"})})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:a.filename}),a.taskTitle&&a.taskId&&(0,b.jsx)(p.Button,{variant:"ghost",onClick:b=>{b.stopPropagation(),f?.(a.taskId)},className:"flex-shrink-0 bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs px-1.5 py-0.5 rounded cursor-pointer hover:bg-blue-500/20 transition-colors h-auto",children:a.taskTitle.length>20?`[任务: ${a.taskTitle.slice(0,20)}...]`:`[任务: ${a.taskTitle}]`})]}),a.description&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:a.description}),(0,b.jsxs)("div",{className:"mt-0.5 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:null===(h=a.size)?"-":h<1024?`${h} B`:h<1048576?`${(h/1024).toFixed(1)} KB`:h<0x40000000?`${(h/1048576).toFixed(1)} MB`:`${(h/0x40000000).toFixed(1)} GB`}),(0,b.jsx)("span",{children:new Date(a.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,b.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>c(a),className:"text-muted-foreground","aria-label":i("assets.preview"),children:(0,b.jsx)(n.Eye,{className:"h-4 w-4"})}),(0,b.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>d(a),className:"text-muted-foreground","aria-label":i("assets.revealInFinder"),children:(0,b.jsx)(k.FolderOpen,{className:"h-4 w-4"})}),(0,b.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>e(a.id),className:"text-muted-foreground hover:text-rose-400","aria-label":i("assets.delete"),children:(0,b.jsx)(o.Trash2,{className:"h-4 w-4"})})]})]})}function s({assets:a,onPreview:c,onReveal:d,onDelete:e,onTaskClick:f}){let{t:h}=(0,g.useI18n)();return 0===a.length?(0,b.jsx)(l.EmptyState,{icon:k.FolderOpen,title:h("assets.empty"),description:h("assets.emptyHint")}):(0,b.jsx)("div",{className:"flex flex-col gap-3",children:a.map(a=>(0,b.jsx)(r,{asset:a,onPreview:c,onReveal:d,onDelete:e,onTaskClick:f},a.id))})}var t=a.i(324954),u=a.i(54384),v=a.i(931739),w=a.i(429246),x=a.i(580701);function y({allWorkspaces:a,initialWsId:d,initialProjectId:e,onUploaded:f}){let h,{t:i}=(0,g.useI18n)(),j=(0,c.useRef)(null),[k,l]=(0,c.useState)(!1),[m,n]=(0,c.useState)(!1),[o,q]=(0,c.useState)(null),[r,s]=(0,c.useState)(d),[z,A]=(0,c.useState)(e),[B,C]=(0,c.useState)(""),D=a.find(a=>a.id===r),E=D?.projects??[],F=()=>{l(!1),q(null),j.current&&(j.current.value="")},G=async()=>{if(o&&z){n(!0);try{let a=new FormData;a.append("file",o),a.append("projectId",z),a.append("description",B.trim()),await (0,v.uploadAsset)(a),f(z),F()}finally{n(!1)}}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(p.Button,{onClick:()=>{s(d),A(e),q(null),C(""),l(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(t.Upload,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:i("assets.upload")})]}),k&&(0,b.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,b.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:F}),(0,b.jsxs)("div",{className:"relative w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg",children:[(0,b.jsx)(p.Button,{variant:"ghost",size:"icon-xs",onClick:F,className:"absolute right-3 top-3 text-muted-foreground",children:(0,b.jsx)(u.X,{className:"h-4 w-4"})}),(0,b.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-4",children:i("assets.uploadTitle")}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:i("assets.workspace")}),(0,b.jsxs)(x.Select,{value:r,onValueChange:b=>{var c;let d;return s(c=b??""),d=a.find(a=>a.id===c),void A(d?.projects[0]?.id??null)},children:[(0,b.jsx)(x.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)("span",{className:"truncate",children:D?.name??r})}),(0,b.jsx)(x.SelectContent,{children:a.map(a=>(0,b.jsx)(x.SelectItem,{value:a.id,children:a.name},a.id))})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:i("assets.project")}),E.length>0?(0,b.jsxs)(x.Select,{value:z??"",onValueChange:a=>A(a??""),children:[(0,b.jsx)(x.SelectTrigger,{className:"flex-1 text-xs",children:(0,b.jsx)("span",{className:"truncate",children:(h=E.find(a=>a.id===z))?h.alias?`${h.name} (${h.alias})`:h.name:z})}),(0,b.jsx)(x.SelectContent,{children:E.map(a=>{let c=a.alias?`${a.name} (${a.alias})`:a.name;return(0,b.jsx)(x.SelectItem,{value:a.id,children:c},a.id)})})]}):(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:i("assets.noProject")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:i("assets.file")}),(0,b.jsx)("input",{type:"file",ref:j,onChange:a=>{q(a.target.files?.[0]??null)},className:"hidden"}),(0,b.jsx)(p.Button,{variant:"outline",onClick:()=>{j.current?.click()},className:"flex-1 border-dashed bg-background px-3 py-2 text-xs text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors text-left justify-start",children:o?o.name:i("assets.selectFile")})]}),(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0 pt-1.5",children:i("assets.description")}),(0,b.jsx)(w.Textarea,{value:B,onChange:a=>C(a.target.value),placeholder:i("assets.descriptionPlaceholder"),className:"flex-1 rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none h-20"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 justify-end mt-6",children:[(0,b.jsx)(p.Button,{variant:"outline",onClick:F,children:i("notes.cancel")}),(0,b.jsx)(p.Button,{onClick:G,disabled:!o||!z||!B.trim()||m,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:i(m?"assets.uploading":"assets.upload")})]})]})]})]})}var z=a.i(532615),A=a.i(894148),B=a.i(972420),C=a.i(952313);a.s(["AssetsPageClient",0,function({allWorkspaces:a,initialWorkspaceId:i,initialProjectId:k,initialAssets:l}){let m,{t:n}=(0,g.useI18n)(),[o,p]=(0,c.useTransition)(),[r,t]=(0,c.useState)(i),[u,v]=(0,c.useState)(k),[w,D]=(0,c.useState)(l),[E,F]=(0,c.useState)(""),[G,H]=(0,c.useState)(null),I=a.find(a=>a.id===r),J=I?.projects??[],K=(0,c.useCallback)(a=>{a?p(async()=>{D(await j(a))}):D([])},[p]),[L,M]=(0,c.useState)(null),N=L?(0,q.isImageAsset)(L.filename,L.mimeType)?"image":/\.(txt|md|json)$/i.test(L.filename)?"text":null:null,O=E.trim().toLowerCase(),P=O?w.filter(a=>a.filename.toLowerCase().includes(O)):w,Q=P.filter(a=>(0,q.isImageAsset)(a.filename,a.mimeType)).map(a=>({id:a.id,url:(0,q.localPathToApiUrl)(a.path),filename:a.filename})),R=L?Q.findIndex(a=>a.id===L.id):-1,S=async 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(()=>({}));C.toast.error(a.error||"Failed to reveal file")}}catch{C.toast.error("Failed to reveal file")}},T=async a=>{let b=w.find(b=>b.id===a);confirm(n("assets.deleteConfirm",{filename:b?.filename??a}))&&(await (0,h.deleteAsset)(a),K(u))};return(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsx)(f.SubPageNav,{workspaceId:r}),(0,b.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,b.jsxs)(x.Select,{value:r,onValueChange:b=>b&&(b=>{if(b===r)return;t(b);let c=a.find(a=>a.id===b),d=c?.projects[0]??null;v(d?.id??null),K(d?.id??null)})(b),children:[(0,b.jsx)(x.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,b.jsx)("span",{className:"truncate",children:a.find(a=>a.id===r)?.name??r})}),(0,b.jsx)(x.SelectContent,{children:a.map(a=>(0,b.jsx)(x.SelectItem,{value:a.id,children:a.name},a.id))})]}),J.length>0&&(0,b.jsxs)(x.Select,{value:u??"",onValueChange:a=>a&&void(a!==u&&(v(a),K(a))),children:[(0,b.jsx)(x.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,b.jsx)("span",{className:"truncate",children:(m=J.find(a=>a.id===u))?m.alias?`${m.name} (${m.alias})`:m.name:""})}),(0,b.jsx)(x.SelectContent,{children:J.map(a=>(0,b.jsxs)(x.SelectItem,{value:a.id,children:[a.name,a.alias?` (${a.alias})`:""]},a.id))})]}),(0,b.jsxs)("div",{className:"relative ml-auto",children:[(0,b.jsx)(e.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:E,onChange:a=>F(a.target.value),placeholder:n("assets.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.jsx)(y,{allWorkspaces:a,initialWsId:r,initialProjectId:u,onUploaded:a=>{a===u&&K(u)}})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,b.jsxs)("div",{className:`relative ${o?"opacity-40 pointer-events-none":""} transition-opacity`,children:[o&&(0,b.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===J.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:n("assets.noProject")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:n("assets.noProjectHint")})]}):(0,b.jsx)(s,{assets:P.map(a=>({...a,taskId:a.task?.id??null,taskTitle:a.task?.title??null})),onPreview:a=>{let b=(0,q.isImageAsset)(a.filename,a.mimeType),c=/\.(txt|md|json)$/i.test(a.filename);(b||c)&&M(a)},onReveal:S,onDelete:T,onTaskClick:H})]})}),(0,b.jsx)(z.ImageLightbox,{imageUrl:"image"===N&&R>=0?Q[R].url:null,filename:"image"===N&&R>=0?Q[R].filename:"",open:"image"===N,onOpenChange:a=>{a||M(null)},assets:Q.map(({url:a,filename:b})=>({url:a,filename:b})),currentIndex:R>=0?R:void 0,onIndexChange:a=>{let b=Q[a];if(!b)return;let c=w.find(a=>a.id===b.id);c&&M({...c,taskId:c.task?.id??null,taskTitle:c.task?.title??null})}}),(0,b.jsx)(A.TextPreviewDialog,{url:"text"===N&&L?(0,q.localPathToApiUrl)(L.path):null,filename:L?.filename??"",open:"text"===N,onOpenChange:a=>{a||M(null)}}),(0,b.jsx)(B.TaskOverviewDrawer,{open:!!G,onOpenChange:a=>{a||H(null)},taskId:G})]})}],919647)}];
|
|
1
|
+
module.exports=[919647,a=>{"use strict";var b=a.i(728778),c=a.i(374637),d=a.i(704494),e=a.i(573242),f=a.i(865011),g=a.i(951192),h=a.i(523079),i=a.i(780410);let j=(0,i.createServerReference)("4093bd48f7873d08d0ace0ad35c284d26ce036ab08",i.callServer,void 0,i.findSourceMapURL,"getProjectAssets");var k=a.i(347165),l=a.i(579834),m=a.i(350739),n=a.i(509405),o=a.i(975231),p=a.i(699570),q=a.i(161181);function r({asset:a,onPreview:c,onReveal:d,onDelete:e,onTaskClick:f}){var h;let{t:i}=(0,g.useI18n)(),j=(0,q.localPathToApiUrl)(a.path),l=(0,q.isImageAsset)(a.filename,a.mimeType);return(0,b.jsxs)("div",{className:"flex items-center gap-4 rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:bg-accent/20",children:[(0,b.jsx)(p.Button,{variant:"ghost",onClick:()=>c(a),className:"flex-shrink-0 cursor-pointer p-0 h-auto",children:l?(0,b.jsx)("img",{src:j,alt:a.filename,className:"h-12 w-12 rounded object-cover border border-border"}):(0,b.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded border border-border bg-muted",children:(0,b.jsx)(m.FileText,{className:"h-6 w-6 text-muted-foreground"})})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:a.filename}),a.taskTitle&&a.taskId&&(0,b.jsx)(p.Button,{variant:"ghost",onClick:b=>{b.stopPropagation(),f?.(a.taskId)},className:"flex-shrink-0 bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs px-1.5 py-0.5 rounded cursor-pointer hover:bg-blue-500/20 transition-colors h-auto",children:a.taskTitle.length>20?`[任务: ${a.taskTitle.slice(0,20)}...]`:`[任务: ${a.taskTitle}]`})]}),a.description&&(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:a.description}),(0,b.jsxs)("div",{className:"mt-0.5 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,b.jsx)("span",{children:null===(h=a.size)?"-":h<1024?`${h} B`:h<1048576?`${(h/1024).toFixed(1)} KB`:h<0x40000000?`${(h/1048576).toFixed(1)} MB`:`${(h/0x40000000).toFixed(1)} GB`}),(0,b.jsx)("span",{children:new Date(a.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,b.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>c(a),className:"text-muted-foreground","aria-label":i("assets.preview"),children:(0,b.jsx)(n.Eye,{className:"h-4 w-4"})}),(0,b.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>d(a),className:"text-muted-foreground","aria-label":i("assets.revealInFinder"),children:(0,b.jsx)(k.FolderOpen,{className:"h-4 w-4"})}),(0,b.jsx)(p.Button,{variant:"ghost",size:"icon",onClick:()=>e(a.id),className:"text-muted-foreground hover:text-rose-400","aria-label":i("assets.delete"),children:(0,b.jsx)(o.Trash2,{className:"h-4 w-4"})})]})]})}function s({assets:a,onPreview:c,onReveal:d,onDelete:e,onTaskClick:f}){let{t:h}=(0,g.useI18n)();return 0===a.length?(0,b.jsx)(l.EmptyState,{icon:k.FolderOpen,title:h("assets.empty"),description:h("assets.emptyHint")}):(0,b.jsx)("div",{className:"flex flex-col gap-3",children:a.map(a=>(0,b.jsx)(r,{asset:a,onPreview:c,onReveal:d,onDelete:e,onTaskClick:f},a.id))})}var t=a.i(324954),u=a.i(54384),v=a.i(660063),w=a.i(429246),x=a.i(580701);function y({allWorkspaces:a,initialWsId:d,initialProjectId:e,onUploaded:f}){let{t:h}=(0,g.useI18n)(),i=(0,c.useRef)(null),[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(null),[q,r]=(0,c.useState)(d),[s,z]=(0,c.useState)(e),[A,B]=(0,c.useState)(""),C=a.find(a=>a.id===q),D=C?.projects??[],E=D.find(a=>a.id===s),F=E?E.alias?`${E.name} (${E.alias})`:E.name:s??"",G=()=>{k(!1),o(null),i.current&&(i.current.value="")},H=async()=>{if(n&&s){m(!0);try{let a=new FormData;a.append("file",n),a.append("projectId",s),a.append("description",A.trim()),await (0,v.uploadAsset)(a),f(s),G()}finally{m(!1)}}};return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)(p.Button,{onClick:()=>{r(d),z(e),o(null),B(""),k(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,b.jsx)(t.Upload,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:h("assets.upload")})]}),j&&(0,b.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,b.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:G}),(0,b.jsxs)("div",{className:"relative w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg",children:[(0,b.jsx)(p.Button,{variant:"ghost",size:"icon-xs",onClick:G,className:"absolute right-3 top-3 text-muted-foreground",children:(0,b.jsx)(u.X,{className:"h-4 w-4"})}),(0,b.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-4",children:h("assets.uploadTitle")}),(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:h("assets.workspace")}),(0,b.jsxs)(x.Select,{value:q,onValueChange:b=>{var c;let d;return r(c=b??""),d=a.find(a=>a.id===c),void z(d?.projects[0]?.id??null)},children:[(0,b.jsx)(x.SelectTrigger,{className:"flex-1 min-w-0 text-xs",children:(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",title:C?.name??q,children:C?.name??q})}),(0,b.jsx)(x.SelectContent,{className:"max-w-[var(--anchor-width)]",children:a.map(a=>(0,b.jsx)(x.SelectItem,{value:a.id,title:a.name,children:(0,b.jsx)("span",{className:"block truncate",children:a.name})},a.id))})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:h("assets.project")}),D.length>0?(0,b.jsxs)(x.Select,{value:s??"",onValueChange:a=>z(a??""),children:[(0,b.jsx)(x.SelectTrigger,{className:"flex-1 min-w-0 text-xs",children:(0,b.jsx)("span",{className:"min-w-0 flex-1 truncate text-left",title:F,children:F})}),(0,b.jsx)(x.SelectContent,{className:"max-w-[var(--anchor-width)]",children:D.map(a=>{let c=a.alias?`${a.name} (${a.alias})`:a.name;return(0,b.jsx)(x.SelectItem,{value:a.id,title:c,children:(0,b.jsx)("span",{className:"block truncate",children:c})},a.id)})})]}):(0,b.jsx)("span",{className:"text-xs text-muted-foreground",children:h("assets.noProject")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:h("assets.file")}),(0,b.jsx)("input",{type:"file",ref:i,onChange:a=>{o(a.target.files?.[0]??null)},className:"hidden"}),(0,b.jsx)(p.Button,{variant:"outline",onClick:()=>{i.current?.click()},className:"flex-1 border-dashed bg-background px-3 py-2 text-xs text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors text-left justify-start",children:n?n.name:h("assets.selectFile")})]}),(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0 pt-1.5",children:h("assets.description")}),(0,b.jsx)(w.Textarea,{value:A,onChange:a=>B(a.target.value),placeholder:h("assets.descriptionPlaceholder"),className:"flex-1 rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none h-20"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 justify-end mt-6",children:[(0,b.jsx)(p.Button,{variant:"outline",onClick:G,children:h("notes.cancel")}),(0,b.jsx)(p.Button,{onClick:H,disabled:!n||!s||!A.trim()||l,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:h(l?"assets.uploading":"assets.upload")})]})]})]})]})}var z=a.i(532615),A=a.i(894148),B=a.i(972420),C=a.i(952313);a.s(["AssetsPageClient",0,function({allWorkspaces:a,initialWorkspaceId:i,initialProjectId:k,initialAssets:l}){let m,{t:n}=(0,g.useI18n)(),[o,p]=(0,c.useTransition)(),[r,t]=(0,c.useState)(i),[u,v]=(0,c.useState)(k),[w,D]=(0,c.useState)(l),[E,F]=(0,c.useState)(""),[G,H]=(0,c.useState)(null),I=a.find(a=>a.id===r),J=I?.projects??[],K=(0,c.useCallback)(a=>{a?p(async()=>{D(await j(a))}):D([])},[p]),[L,M]=(0,c.useState)(null),N=L?(0,q.isImageAsset)(L.filename,L.mimeType)?"image":/\.(txt|md|json)$/i.test(L.filename)?"text":null:null,O=E.trim().toLowerCase(),P=O?w.filter(a=>a.filename.toLowerCase().includes(O)):w,Q=P.filter(a=>(0,q.isImageAsset)(a.filename,a.mimeType)).map(a=>({id:a.id,url:(0,q.localPathToApiUrl)(a.path),filename:a.filename})),R=L?Q.findIndex(a=>a.id===L.id):-1,S=async 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(()=>({}));C.toast.error(a.error||"Failed to reveal file")}}catch{C.toast.error("Failed to reveal file")}},T=async a=>{let b=w.find(b=>b.id===a);confirm(n("assets.deleteConfirm",{filename:b?.filename??a}))&&(await (0,h.deleteAsset)(a),K(u))};return(0,b.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,b.jsx)(f.SubPageNav,{workspaceId:r}),(0,b.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,b.jsxs)(x.Select,{value:r,onValueChange:b=>b&&(b=>{if(b===r)return;t(b);let c=a.find(a=>a.id===b),d=c?.projects[0]??null;v(d?.id??null),K(d?.id??null)})(b),children:[(0,b.jsx)(x.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,b.jsx)("span",{className:"truncate",children:a.find(a=>a.id===r)?.name??r})}),(0,b.jsx)(x.SelectContent,{children:a.map(a=>(0,b.jsx)(x.SelectItem,{value:a.id,children:a.name},a.id))})]}),J.length>0&&(0,b.jsxs)(x.Select,{value:u??"",onValueChange:a=>a&&void(a!==u&&(v(a),K(a))),children:[(0,b.jsx)(x.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,b.jsx)("span",{className:"truncate",children:(m=J.find(a=>a.id===u))?m.alias?`${m.name} (${m.alias})`:m.name:""})}),(0,b.jsx)(x.SelectContent,{children:J.map(a=>(0,b.jsxs)(x.SelectItem,{value:a.id,children:[a.name,a.alias?` (${a.alias})`:""]},a.id))})]}),(0,b.jsxs)("div",{className:"relative ml-auto",children:[(0,b.jsx)(e.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:E,onChange:a=>F(a.target.value),placeholder:n("assets.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.jsx)(y,{allWorkspaces:a,initialWsId:r,initialProjectId:u,onUploaded:a=>{a===u&&K(u)}})]}),(0,b.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,b.jsxs)("div",{className:`relative ${o?"opacity-40 pointer-events-none":""} transition-opacity`,children:[o&&(0,b.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,b.jsx)(d.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===J.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:n("assets.noProject")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground/60",children:n("assets.noProjectHint")})]}):(0,b.jsx)(s,{assets:P.map(a=>({...a,taskId:a.task?.id??null,taskTitle:a.task?.title??null})),onPreview:a=>{let b=(0,q.isImageAsset)(a.filename,a.mimeType),c=/\.(txt|md|json)$/i.test(a.filename);(b||c)&&M(a)},onReveal:S,onDelete:T,onTaskClick:H})]})}),(0,b.jsx)(z.ImageLightbox,{imageUrl:"image"===N&&R>=0?Q[R].url:null,filename:"image"===N&&R>=0?Q[R].filename:"",open:"image"===N,onOpenChange:a=>{a||M(null)},assets:Q.map(({url:a,filename:b})=>({url:a,filename:b})),currentIndex:R>=0?R:void 0,onIndexChange:a=>{let b=Q[a];if(!b)return;let c=w.find(a=>a.id===b.id);c&&M({...c,taskId:c.task?.id??null,taskTitle:c.task?.title??null})}}),(0,b.jsx)(A.TextPreviewDialog,{url:"text"===N&&L?(0,q.localPathToApiUrl)(L.path):null,filename:L?.filename??"",open:"text"===N,onOpenChange:a=>{a||M(null)}}),(0,b.jsx)(B.TaskOverviewDrawer,{open:!!G,onOpenChange:a=>{a||H(null)},taskId:G})]})}],919647)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_app_workspaces_%5BworkspaceId%5D_assets_assets-page-client_tsx_0wyzpam._.js.map
|