tower-studio 0.2.46 → 0.2.47
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 +82 -70
- package/.next/standalone/.next/server/app/_not-found/page.js +2 -1
- 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/browse-fs/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/tasks/[taskId]/merge/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/harness/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/harness/page/server-reference-manifest.json +92 -80
- package/.next/standalone/.next/server/app/harness/page.js +2 -1
- package/.next/standalone/.next/server/app/harness/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/harness/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +150 -138
- package/.next/standalone/.next/server/app/missions/page.js +5 -4
- 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 +82 -70
- package/.next/standalone/.next/server/app/onboarding/page.js +2 -1
- 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 +82 -70
- package/.next/standalone/.next/server/app/page.js +2 -1
- 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 +128 -116
- package/.next/standalone/.next/server/app/settings/page.js +4 -3
- 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 +190 -178
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js +3 -2
- 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 +166 -154
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js +3 -2
- 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]/groups/page/react-loadable-manifest.json +3 -3
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page/server-reference-manifest.json +86 -74
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js +2 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/groups/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 +150 -138
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js +3 -2
- 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 +162 -162
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js +4 -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 +82 -70
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js +3 -2
- 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 +140 -140
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js +3 -2
- 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 +182 -170
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +6 -5
- 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 +108 -96
- package/.next/standalone/.next/server/app/workspaces/page.js +2 -1
- 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/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +7 -7
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0gr2wxq.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esywxf._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kkrbn-._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0_w835g._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_05balzk._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0gif-f5._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0pg9w-x._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0vp6.co._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_11k6i~l._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_actions_agent-actions_ts_10q9r5b._.js +3 -3
- 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]__00qdvw7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__07rk6ic._.js → [root-of-the-server]__0282989._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0hzwoy5._.js → [root-of-the-server]__03jikql._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0trmndk._.js → [root-of-the-server]__04dod9d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05tx27l._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0m8m7vc._.js → [root-of-the-server]__07ha-7q._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__07~giyb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0bx_h2u._.js → [root-of-the-server]__0872sqe._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__090y_.y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b6hugs._.js → [root-of-the-server]__09qoc8v._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.0m12b._.js → [root-of-the-server]__0bl842b._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0br5e7w._.js → [root-of-the-server]__0c81jqz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0dh0alq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0u3~-.g._.js → [root-of-the-server]__0fy8mj6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0kqp70x._.js → [root-of-the-server]__0gsk~9d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h4ltpn._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hx2p17._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ie8~g5._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n02kfa._.js → [root-of-the-server]__0j1w7ro._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0esg88l._.js → [root-of-the-server]__0jxfeb6._.js} +1 -1
- 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]__00qzvly._.js → [root-of-the-server]__0mi.v4q._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__06sew6r._.js → [root-of-the-server]__0nell0t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0odoa97._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__12viys4._.js → [root-of-the-server]__0q8o5us._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0b6fbjv._.js → [root-of-the-server]__0qjjy1r._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0rg73f.._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0t3q30a._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0tpho3f._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0dhq_gl._.js → [root-of-the-server]__0tusyj0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~edc3d._.js → [root-of-the-server]__0x6eyvj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0n3uc.v._.js → [root-of-the-server]__0xftcya._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0xiiocg._.js +30 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0x7br99._.js → [root-of-the-server]__0znl9us._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0zsnp~d._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~fdua7._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11fp64w._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0vyl8to._.js → [root-of-the-server]__1290yo~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12s3kky._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0s_q09t._.js → [root-of-the-server]__136sh9u._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0-~9em3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0.-.0zk._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0..h3hk._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0b660g4._.js → _0111pr2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0czsddm._.js → _029yl-g._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0q2pep_._.js → _02mcoex._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_02t7f2_._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0gomvsp._.js → _04brhyt._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_1118hto._.js → _08b3kyv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0-5.hgb._.js → _0a___34._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0ami9yt._.js → _0b4v~ls._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0bdyusg._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0hsuip_._.js → _0c8-9m9._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0j7m~u6._.js → _0gcox_6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0snv7nt._.js → _0gte_c4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0g~p9_x._.js → _0hyn4md._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0l6byg1._.js → _0lqjtwo._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0noar.v._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0os43sb._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0o_c3b2._.js → _0rilhs1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0ak77.u._.js → _0sbkase._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_00_h2nx._.js → _0t-0.1o._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0wbcp88._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0mmy~98._.js → _0w~~xn0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0awn2mm._.js → _0xexuoi._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0xu906p._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_0z-z415._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0zx1ubq._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0ty4xe6._.js → _0~2k74h._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_0hx2o_8._.js → _0~rpgs_._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_10a_vqn._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0p5ft59._.js → _10or.ne._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_11.knhq._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_12s8n8g._.js → _124j7aj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_13yv8at._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_11j0qlp._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_07_wts6._.js +47 -0
- 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_0rowjw~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0cld9rt._.js → src_lib_0-3zx.v._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0_px2pz._.js → src_lib_00ial55._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0a.zy31._.js → src_lib_01-0ix1._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0b73q0a._.js → src_lib_01d~ml9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_04nzvfd._.js → src_lib_0278czx._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_07o.0r6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_09jpiip._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0bmg7ix._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0cb~2g1._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fdsvpu._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fyrfen._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0dbf2qa._.js → src_lib_0gqe-g3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ixnmd0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0lpxsj~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0pgz5n6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{src_lib_0h2u7a0._.js → src_lib_0tq69ek._.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 +1146 -1068
- package/.next/standalone/.next/static/chunks/{0oyskd~8~j.j7.js → 00agq5_c-.llc.js} +1 -1
- package/.next/standalone/.next/static/chunks/015i97g3voot2.js +2 -0
- package/.next/standalone/.next/static/chunks/{02v-9v~885t9c.js → 01wvj~s3skc-5.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0.gedys.tq.~k.js → 031br6.h-zycv.js} +1 -1
- package/.next/standalone/.next/static/chunks/{07qijq9o5jccu.js → 054ztat09k8d8.js} +1 -1
- package/.next/standalone/.next/static/chunks/07f592yv~pptf.js +1 -0
- package/.next/standalone/.next/static/chunks/{06x7oq8_iu~9d.js → 08j4ettv1zbmn.js} +1 -1
- package/.next/standalone/.next/static/chunks/{03uix~1ru.ovv.js → 08kc0~d-bpqxd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0j5olwb~d3~3j.js → 08s_oyki61yjf.js} +1 -1
- package/.next/standalone/.next/static/chunks/09bc_~h466~tj.js +1 -0
- package/.next/standalone/.next/static/chunks/{0q1872yhybt55.js → 0_hj_1l73v-on.js} +1 -1
- package/.next/standalone/.next/static/chunks/{00o_eiv12t~.1.js → 0a54zbhpg7-ql.js} +1 -1
- package/.next/standalone/.next/static/chunks/0c2po53wqe-op.js +1 -0
- package/.next/standalone/.next/static/chunks/0clhvl~13pwv2.js +1 -0
- package/.next/standalone/.next/static/chunks/0fi1kdxrc9m~d.js +1 -0
- package/.next/standalone/.next/static/chunks/0j56_.0_wup.m.js +1 -0
- package/.next/standalone/.next/static/chunks/{17z9uivez~kp3.js → 0lokkque~1fox.js} +1 -1
- package/.next/standalone/.next/static/chunks/0m5k~sgt78d8a.js +1 -0
- package/.next/standalone/.next/static/chunks/{0d9u2xspag~4h.js → 0mzzaly9-cwhd.js} +1 -1
- package/.next/standalone/.next/static/chunks/0pg~fc3o64-u0.js +1 -0
- package/.next/standalone/.next/static/chunks/{0-kkc.ibted8y.js → 0pvc93qomwhkq.js} +1 -1
- package/.next/standalone/.next/static/chunks/0smoiulyzysrc.js +2 -0
- package/.next/standalone/.next/static/chunks/0ufatfbq87c84.js +1 -0
- package/.next/standalone/.next/static/chunks/{09om2gfwimh7k.js → 0ujznvfinjpzn.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0cf7e1scao3zk.js → 0ux~8zee88x-j.js} +1 -1
- package/.next/standalone/.next/static/chunks/0vy01_a6xhhrr.js +1 -0
- package/.next/standalone/.next/static/chunks/0xd_tk4asn0qj.js +1 -0
- package/.next/standalone/.next/static/chunks/{12-mlz2vukuga.js → 0~l470bpaoz9f.js} +1 -1
- package/.next/standalone/.next/static/chunks/118j.0w2pbdea.js +1 -0
- package/.next/standalone/.next/static/chunks/13yfli6~6o4z~.js +1 -0
- package/.next/standalone/.next/static/chunks/{0t1awv68pnn-e.js → 15rlbf5rw1dd..js} +1 -1
- package/.next/standalone/package.json +1 -1
- package/dist/mcp-server.cjs +6 -0
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0-geq20._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02~hdzx._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h_pt4a._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0idkp76._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0j4m.1s._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0kmonje._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0lh3mlq._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0muf4wq._.js +0 -49
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0o5ohqy._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ta_mpj._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ws0_c1._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0~mhv4m._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__1013v_g._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__123rmn-._.js +0 -30
- package/.next/standalone/.next/server/chunks/ssr/_05~lqg-._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_0771b4a._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0fmko25._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0hg~.4w._.js +0 -6
- package/.next/standalone/.next/server/chunks/ssr/_0nrxhfb._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0vkl7.h._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0x09t_o._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_0zn.4bi._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/_1086w4p._.js +0 -47
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0er7rzd._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0f0v8_~._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0fr6fzy._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0k04rl3._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0sq6aqm._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0ui-~7g._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_0z-gn78._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_lib_13c4a4g._.js +0 -3
- package/.next/standalone/.next/static/chunks/00g58.es_hxli.js +0 -1
- package/.next/standalone/.next/static/chunks/01qtgj0xv1fsm.js +0 -2
- package/.next/standalone/.next/static/chunks/024euw7po0d0w.js +0 -1
- package/.next/standalone/.next/static/chunks/03ct4d8znb7tp.js +0 -1
- package/.next/standalone/.next/static/chunks/0alhq.h4~iogi.js +0 -1
- package/.next/standalone/.next/static/chunks/0ck~sr0nkabl~.js +0 -1
- package/.next/standalone/.next/static/chunks/0d1ok-v-u-xe~.js +0 -1
- package/.next/standalone/.next/static/chunks/0ftptcpntzaux.js +0 -1
- package/.next/standalone/.next/static/chunks/0gk~m5bwgoafi.js +0 -1
- package/.next/standalone/.next/static/chunks/0in_7s8n4lmfr.js +0 -1
- package/.next/standalone/.next/static/chunks/0mtrtl-jl46in.js +0 -2
- package/.next/standalone/.next/static/chunks/0~2l3wz-gxs2j.js +0 -1
- package/.next/standalone/.next/static/chunks/0~7h_a_dofg-4.js +0 -1
- package/.next/standalone/.next/static/chunks/15gztq9f12uhe.js +0 -1
- package/.next/standalone/.next/static/chunks/15ue90qe1sh-9.js +0 -1
- /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{Pf_z-PYy0CJhvcyPEi-LM → dFewkdixeBoRBY6Fvw11J}/_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(952313),h=a.i(699570),i=a.i(866718),j=a.i(429246),k=a.i(412783),l=a.i(786304),m=a.i(563658),n=a.i(814574),o=a.i(368114),p=a.i(268317),q=a.i(369289),r=a.i(711796);let s=(0,r.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 t=a.i(350739);let u=(0,r.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 v=a.i(190076),w=a.i(705594),x=a.i(264589),y=a.i(567648),z=a.i(54384),A=a.i(774881);let B=(0,r.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 C=a.i(975231);let D=(0,r.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"}]]);var E=a.i(509405);let F=(0,r.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 G=a.i(704494),H=a.i(913284),I=a.i(468862),J=a.i(347165),K=a.i(912868),L=a.i(10390),M=a.i(295411),N=a.i(716457),O=a.i(111699),P=a.i(780410);let Q=(0,P.createServerReference)("00e0f4165c3e26131b17fe500b9750040c3067f2f6",P.callServer,void 0,P.findSourceMapURL,"getAvailableTerminalApps"),R=(0,P.createServerReference)("002440c9e28ab94cdd90b58bafb6f601dc41d8d108",P.callServer,void 0,P.findSourceMapURL,"getAvailableEditors");var S=a.i(836856);let T=(0,P.createServerReference)("40e19466379d9cfbf66fdbf7fcc53b5b163b8ff584",P.callServer,void 0,P.findSourceMapURL,"createPrompt"),U=(0,P.createServerReference)("609e6d93185ca81f068f317bfa22b1a7fe0845458e",P.callServer,void 0,P.findSourceMapURL,"updatePrompt"),V=(0,P.createServerReference)("40f8a1d8e3cecafa1c8b48ae6239f0bdcedae2a59f",P.callServer,void 0,P.findSourceMapURL,"deletePrompt"),W=(0,P.createServerReference)("00012b5880c4b1b33865bea388958a7000a857741d",P.callServer,void 0,P.findSourceMapURL,"getBuiltinPrompts"),X=(0,P.createServerReference)("403a4190ffbd80617b45fc61d8a8a67e4b4a3964f6",P.callServer,void 0,P.findSourceMapURL,"saveSystemDirective"),Y=(0,P.createServerReference)("008a8f1239f29f473c63c1473a711f5e37ebd37efc",P.callServer,void 0,P.findSourceMapURL,"resetSystemDirective"),Z=(0,P.createServerReference)("00f503ecee8173ce949d0761132e2a3a885d3bf37d",P.callServer,void 0,P.findSourceMapURL,"getAvailableProviders");var $=a.i(648512);let _=(0,r.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var aa=a.i(580701);let ab=(0,P.createServerReference)("00a34ff6f66d445bf99f60140f51595ec919dea805",P.callServer,void 0,P.findSourceMapURL,"getAiCapabilityConfigs"),ac=(0,P.createServerReference)("6093814f04e7639e043f113c26dad5ed3b42dcf4db",P.callServer,void 0,P.findSourceMapURL,"updateAiCapabilityConfig"),ad=(0,P.createServerReference)("009c9ba31d33414315e6ebce045ad942596592deeb",P.callServer,void 0,P.findSourceMapURL,"getConnectedProviders"),ae=[{slot:"summary",key:"settings.capabilitySlots.summary"},{slot:"dreaming",key:"settings.capabilitySlots.dreaming"},{slot:"analysis",key:"settings.capabilitySlots.analysis"},{slot:"assistant",key:"settings.capabilitySlots.assistant"}];function af(){let{t:a}=(0,f.useI18n)(),[d,e]=(0,c.useState)([]),[h,i]=(0,c.useState)([]),[j,k]=(0,c.useState)([]),[l,m]=(0,c.useState)(!0),[n,o]=(0,c.useTransition)();(0,c.useEffect)(()=>{let a=!0;return Promise.all([Z(),ad(),ab()]).then(([b,c,d])=>{a&&(e(b),i(c),k(d))}).catch(b=>{a&&g.toast.error(b instanceof Error?b.message:String(b))}).finally(()=>{a&&m(!1)}),()=>{a=!1}},[]);let p=j.find(a=>"terminal"===a.slot),q=p?.provider??(h.includes("claude")?"claude":h[0]??"claude"),r=a=>d.find(b=>b.name===a)?.displayName??a;return l?(0,b.jsx)("div",{className:"h-32 rounded-xl bg-muted animate-pulse"}):(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("h3",{className:"text-sm font-medium flex items-center gap-2",children:[(0,b.jsx)($.Terminal,{className:"h-4 w-4"}),a("settings.capabilitySlots.title")]}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a("settings.capabilitySlots.desc")})]}),(0,b.jsxs)("div",{className:`flex items-center justify-between gap-4 ${n?"opacity-40 pointer-events-none":""}`,children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:a("settings.capabilitySlots.terminal")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:a("settings.capabilitySlots.terminalDesc")})]}),0===h.length?(0,b.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:a("settings.capabilitySlots.noConnected")}):(0,b.jsxs)(aa.Select,{value:q,onValueChange:function(b){b&&o(async()=>{try{await ac("terminal",{provider:b,mode:"cli",model:null}),k(a=>{let c=a.filter(a=>"terminal"!==a.slot),d=p??{id:"",slot:"terminal",mode:"cli",model:null,createdAt:new Date,updatedAt:new Date};return[...c,{...d,slot:"terminal",provider:b,mode:"cli",model:null}]}),g.toast.success(a("settings.capabilitySlots.updated"))}catch(a){g.toast.error(a instanceof Error?a.message:String(a))}})},children:[(0,b.jsx)(aa.SelectTrigger,{className:"w-44 shrink-0",children:(0,b.jsx)("span",{className:"truncate",children:r(q)})}),(0,b.jsx)(aa.SelectContent,{children:h.map(a=>(0,b.jsx)(aa.SelectItem,{value:a,children:r(a)},a))})]})]}),(0,b.jsx)("div",{className:"space-y-2.5 border-t border-border/50 pt-3",children:ae.map(c=>(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4 opacity-60",children:[(0,b.jsxs)("div",{className:"text-sm font-medium flex items-center gap-1.5",children:[(0,b.jsx)(_,{className:"h-3 w-3"}),a(c.key)]}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:a("settings.capabilitySlots.claudeFixed")})]},c.slot))})]})}var ag=a.i(785259),ah=a.i(43775);let ai=(0,r.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 aj=a.i(324954);let ak=(0,r.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 al=a.i(161664),am=a.i(811344),an=a.i(607219);let ao=(0,P.createServerReference)("4091d1c52370bebd3e8d05e3278bd1ded41ec00821",P.callServer,void 0,P.findSourceMapURL,"createBackup"),ap=(0,P.createServerReference)("0095fe412d0e2677a5878a74f6a466ce8a44748d5d",P.callServer,void 0,P.findSourceMapURL,"listBackupFiles"),aq=(0,P.createServerReference)("406eb017fe97e1b8836c2d0ff73008ccb33b575bbd",P.callServer,void 0,P.findSourceMapURL,"deleteBackupFile"),ar=(0,P.createServerReference)("40833100ffb6bde731d9bc18b245a88d9bf2245ee4",P.callServer,void 0,P.findSourceMapURL,"restoreBackup"),as=(0,P.createServerReference)("40373451bfef2452a397c143599c7c33dda0f69565",P.callServer,void 0,P.findSourceMapURL,"resetSystem"),at=(0,P.createServerReference)("002b67095ad05477f1e9b1dc42e035b0013aa032cf",P.callServer,void 0,P.findSourceMapURL,"getBackupDir"),au=(0,P.createServerReference)("40fb517cffb715373e30718ed55eba58e6c3a0f041",P.callServer,void 0,P.findSourceMapURL,"setBackupDir"),av=(0,P.createServerReference)("00242e8c0e654809a46e6a5f57040da49ea7d1a25c",P.callServer,void 0,P.findSourceMapURL,"getStorageLocation"),aw=(0,P.createServerReference)("40f82f35215d57c64e195348a95941d90ac7e90cb1",P.callServer,void 0,P.findSourceMapURL,"setStorageLocation");function ax(){let{t:a,locale:e}=(0,f.useI18n)(),j=(0,d.useRouter)(),[k,l]=(0,c.useState)([]),[m,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!0),[x,y]=(0,c.useState)(null),[z,A]=(0,c.useState)(!1),[B,D]=(0,c.useState)(""),E=(0,c.useRef)(null),[F,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(""),K=(0,c.useCallback)(async()=>{w(!0);try{let[a,b,c]=await Promise.all([ap(),at(),av()]);l(a),o(b),s(c)}finally{w(!1)}},[]);(0,c.useEffect)(()=>{K()},[K]);let L=async()=>{let b=B.trim()||void 0;A(!1),D(""),y("create");try{await ao(b),g.toast.success(a("settings.backup.createSuccess")),await K()}catch{g.toast.error(a("settings.backup.createError"))}finally{y(null)}},M=async b=>{if(confirm(a("settings.backup.restoreConfirm"))){y("restore");try{await ar(b),g.toast.success(a("settings.backup.restoreSuccess"),{action:{label:a("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await K()}catch{g.toast.error(a("settings.backup.restoreError"))}finally{y(null)}}},N=async b=>{if(confirm(a("settings.backup.deleteConfirm")))try{await aq(b),g.toast.success(a("settings.backup.deleteSuccess")),l(a=>a.filter(a=>a.filename!==b))}catch{g.toast.error(a("settings.backup.deleteError"))}},O=async b=>{q(!1);try{await au(b),o(b),g.toast.success(a("settings.backup.dirSaved")),await K()}catch{g.toast.error(a("settings.backup.dirError"))}},P=async b=>{y("storage");try{let c=await aw({newPath:b});if(!c.ok)return void g.toast.error(c.error||a("settings.storage.moveError"));g.toast.success(a("settings.storage.moveSuccess",{count:String(c.moved??0)})),await K()}catch(b){g.toast.error(b instanceof Error?b.message:a("settings.storage.moveError"))}finally{y(null)}},Q=async b=>{u(!1),confirm(a("settings.storage.moveConfirm"))&&await P(b)},R=async()=>{!r||r.isDefault||confirm(a("settings.storage.resetConfirm"))&&await P(r.default)},S=async b=>{let c=b.target.files?.[0];if(c){b.target.value="",y("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();g.toast.error("Invalid backup archive"===b.error?a("settings.backup.importInvalid"):(b.error,a("settings.backup.importError")));return}g.toast.success(a("settings.backup.importSuccess")),await K()}catch{g.toast.error(a("settings.backup.importError"))}finally{y(null)}}},T=async()=>{if("RESET"===I){H(!1),J(""),y("reset");try{await as("RESET"),g.toast.success(a("settings.backup.resetSuccess")),j.push("/")}catch{g.toast.error(a("settings.backup.resetError"))}finally{y(null)}}},U=null!==x;return(0,b.jsxs)("div",{className:"space-y-6",children:[("restore"===x||"reset"===x)&&(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)(G.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===x?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:r?.current??"…"}),r?.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)(h.Button,{variant:"ghost",onClick:()=>u(!0),disabled:"storage"===x,className:"text-xs text-muted-foreground",children:"storage"===x?(0,b.jsx)(G.Loader2,{className:"h-3 w-3 animate-spin"}):a("settings.storage.change")}),r&&!r.isDefault&&(0,b.jsx)(h.Button,{variant:"ghost",onClick:R,disabled:"storage"===x,className:"text-xs text-muted-foreground",children:a("settings.storage.reset")})]}),(0,b.jsx)(ah.FolderBrowserDialog,{open:t,onOpenChange:u,onSelect:Q})]}),(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:m}),(0,b.jsx)(h.Button,{variant:"ghost",onClick:()=>q(!0),className:"text-xs text-muted-foreground",children:a("settings.backup.dirChange")})]}),(0,b.jsx)(ah.FolderBrowserDialog,{open:p,onOpenChange:q,onSelect:O})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Button,{onClick:()=>{D(""),A(!0)},disabled:U,className:"gap-2",children:"create"===x?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-4 w-4 animate-spin"})," ",a("settings.backup.creating")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ai,{className:"h-4 w-4"})," ",a("settings.backup.create")]})}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsxs)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",disabled:U,onClick:()=>E.current?.click(),className:"gap-2"}),children:[(0,b.jsx)(ak,{className:"h-4 w-4"}),a("settings.backup.import")]}),(0,b.jsx)(ag.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:S})]}),(0,b.jsx)(n.Dialog,{open:z,onOpenChange:A,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(n.DialogHeader,{children:(0,b.jsx)(n.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)(i.Input,{value:B,onChange:a=>D(a.target.value),onKeyDown:a=>"Enter"===a.key&&L(),placeholder:a("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>A(!1),children:a("common.cancel")}),(0,b.jsx)(h.Button,{onClick:L,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:a("settings.backup.create")})]})]})}),v?(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(G.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===k.length?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,b.jsx)(an.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:k.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)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>M(c.filename),disabled:U,className:"text-muted-foreground hover:text-foreground"}),children:(0,b.jsx)(aj.Upload,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(ag.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.restore")})]}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>N(c.filename),disabled:U,className:"text-muted-foreground hover:text-rose-400"}),children:(0,b.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(ag.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)(am.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)(h.Button,{variant:"outline",onClick:()=>{J(""),H(!0)},disabled:U,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,b.jsx)(al.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),a("settings.backup.reset")]})]}),(0,b.jsx)(n.Dialog,{open:F,onOpenChange:H,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:a("settings.backup.resetConfirmTitle")}),(0,b.jsx)(n.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)(i.Input,{value:I,onChange:a=>J(a.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>H(!1),children:a("common.cancel")}),(0,b.jsx)(h.Button,{disabled:"RESET"!==I,onClick:T,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:a("settings.backup.reset")})]})]})})]})}var ay=a.i(953093),az=a.i(668116);let aA=(0,r.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var aB=a.i(22761),aC=a.i(963326),aD=a.i(192369),aE=a.i(599209),aF=a.i(627141);let aG=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function aH({cmd:a}){let{t:d}=(0,f.useI18n)(),[e,i]=(0,c.useState)(!1),j=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)}i(!0),g.toast.success(d("common.copied")),setTimeout(()=>i(!1),1500)}catch{g.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)(h.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d("common.copy"),onClick:j,children:e?(0,b.jsx)(az.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(aB.Copy,{className:"h-3 w-3"})})]})}function aI({extension:a}){let{t:d}=(0,f.useI18n)(),{status:e,loading:i,isInstalling:j,install:k,uninstall:l,refresh:m}=(0,aF.useExtension)(a.id),[n,o]=(0,c.useState)(!1),p=a.icon,q=e.installed,r=async()=>{let b=await k();b.success?g.toast.success(d("settings.extensions.installSuccess").replace("{name}",a.name)):g.toast.error(d("settings.extensions.installFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},s=async()=>{let b=await l();b.success?g.toast.success(d("settings.extensions.uninstallSuccess").replace("{name}",a.name)):g.toast.error(d("settings.extensions.uninstallFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},t=async()=>{o(!0);try{await m()}finally{o(!1)}},u=()=>{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)(p,{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:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.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")})]}):q?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(H.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)(aA,{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:[q?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.Button,{variant:"default",onClick:r,disabled:j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.reinstalling")]}):d("settings.extensions.reinstall")}),(0,b.jsx)(h.Button,{variant:"outline",onClick:s,disabled:j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.uninstalling")]}):d("settings.extensions.uninstall")})]}):a.manualInstall?(0,b.jsxs)(aE.Popover,{children:[(0,b.jsx)(aE.PopoverTrigger,{render:a=>(0,b.jsxs)(h.Button,{variant:"default",...a,children:[(0,b.jsx)(ai,{className:"h-3.5 w-3.5"}),d("settings.extensions.installViaHomepage")]})}),(0,b.jsxs)(aE.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:aG.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)(aH,{cmd:c})]},a))}),(0,b.jsx)("p",{className:"text-muted-foreground",children:d("settings.extensions.manualInstallHintAfter")}),(0,b.jsxs)("button",{type:"button",onClick:u,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,b.jsx)(aC.ExternalLink,{className:"h-3 w-3"}),d("settings.extensions.visitHomepage")]})]})]}):(0,b.jsx)(h.Button,{variant:"default",onClick:r,disabled:j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.installing")]}):d("settings.extensions.install")}),(0,b.jsxs)(h.Button,{variant:"ghost",onClick:t,disabled:n,children:[(0,b.jsx)(aD.RefreshCw,{className:`h-3.5 w-3.5 ${n?"animate-spin":""}`}),d("settings.extensions.recheck")]}),(0,b.jsxs)(h.Button,{variant:"ghost",onClick:u,children:[(0,b.jsx)(aC.ExternalLink,{className:"h-3.5 w-3.5"}),d("settings.extensions.visitHomepage")]})]})]})}function aJ(){let{t:a}=(0,f.useI18n)(),c=(0,ay.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)(aI,{extension:a},a.id))})]})}a.i(423993);var aK=a.i(109603),aL=a.i(975787),aM=a.i(875846),aN=a.i(718799);let aO=["global","panels","missions"],aP=new Set(["missions.cycleBack"]);function aQ({keys:a}){return(0,b.jsx)(aN.KeyCombo,{keys:a})}function aR(){let a,{t:d}=(0,f.useI18n)(),e=(0,aM.useKeymapStore)(a=>a.overrides),i=(0,aM.useKeymapStore)(a=>a.setBinding),j=(0,aM.useKeymapStore)(a=>a.resetBinding),k=(0,aM.useKeymapStore)(a=>a.resetAll),[m,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(null),r=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(m){let a=requestAnimationFrame(()=>r.current?.focus());return()=>cancelAnimationFrame(a)}},[m]);let s=(0,c.useMemo)(()=>{let a=new Map;for(let b of aK.SHORTCUT_ACTIONS)for(let c of e[b.id]??[...b.defaultKeys])a.has(c)||a.set(c,b.id);return a},[e]),t=(0,c.useMemo)(()=>aO.map(a=>({group:a,actions:aK.SHORTCUT_ACTIONS.filter(b=>b.group===a&&!aP.has(b.id))})).filter(a=>a.actions.length>0),[]),u=m?(0,aK.getAction)(m):null,v=p&&m&&(a=s.get(p))&&a!==m?a:null;function w(){o(null),q(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)(h.Button,{variant:"outline",size:"sm",onClick:function(){k(),g.toast.success(d("settings.shortcuts.resetAllDone"))},children:[(0,b.jsx)(al.RotateCcw,{className:"h-3.5 w-3.5"}),d("settings.shortcuts.resetAll")]})]}),(0,b.jsx)("div",{className:"space-y-6",children:t.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)(aQ,{keys:e[c=a.id]??[...(0,aK.getAction)(c).defaultKeys]}),a.configurable?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>{var b;return b=a.id,void(q(null),o(b))},children:d("settings.shortcuts.rebind")}),f&&(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>j(a.id),children:(0,b.jsx)(al.RotateCcw,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(ag.TooltipContent,{children:d("settings.shortcuts.reset")})]})]}):(0,b.jsx)(l.Badge,{variant:"outline",className:"text-muted-foreground",children:d("settings.shortcuts.fixed")})]})]},a.id)})})]},a))}),(0,b.jsx)(n.Dialog,{open:null!==m,onOpenChange:a=>!a&&w(),children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:u?d(u.descriptionKey):d("settings.shortcuts.rebind")}),(0,b.jsx)(n.DialogDescription,{children:d("settings.shortcuts.pressKey")})]}),(0,b.jsx)("textarea",{ref:r,readOnly:!0,tabIndex:0,"aria-label":d("settings.shortcuts.pressKey"),onKeyDown:a=>{a.preventDefault(),a.stopPropagation();let b=(0,aL.serializeKeyEvent)(a.nativeEvent);b&&q(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:p?(0,b.jsx)(aQ,{keys:[p]}):(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:d("settings.shortcuts.pressKey")})}),v&&(0,b.jsx)("p",{className:"text-center text-xs text-amber-600 dark:text-amber-400",children:d("settings.shortcuts.conflict",{name:d((0,aK.getAction)(v).descriptionKey)})}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:w,children:d("settings.shortcuts.cancel")}),(0,b.jsx)(h.Button,{variant:"default",onClick:function(){m&&p&&(i(m,[p]),w(),g.toast.success(d("settings.shortcuts.saved")))},disabled:!p,children:d("settings.shortcuts.saveBtn")})]})]})})]})}var aS=a.i(690251),aT=a.i(506913),aU=a.i(344393),aV=a.i(884664),aV=aV,aW=a.i(761818),aW=aW;let aX=(0,r.default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),aY=(0,P.createServerReference)("40dc9fc2c9c0b69d14fc779a0bb51b34232d5f18d5",P.callServer,void 0,P.findSourceMapURL,"testHarnessTarget"),aZ=["feishu","openclaw","hermes"],a$={feishu:["feishu"],openclaw:["telegram","signal","whatsapp","discord","slack","imessage"],hermes:["telegram","discord","slack","whatsapp","signal","feishu","wechat","wecom","dingtalk","qq","matrix","email"]},a_=[...new Set(Object.values(a$).flat())],a0="__custom__",a1=a=>a$[a]??[],a2={feishu:"https://open.feishu.cn/",openclaw:"https://docs.openclaw.ai/",hermes:"https://hermes-agent.nousresearch.com/docs/"};function a3(){let{t:a}=(0,f.useI18n)(),[d,e]=(0,c.useState)([]),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(new Set),[n,o]=(0,c.useState)(!0),[p,q]=(0,c.useTransition)(),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null);(0,c.useEffect)(()=>{(0,M.getConfigValue)("harness.targets",[]).then(a=>{let b=(Array.isArray(a)?a:[]).map(a=>({id:a.id??crypto.randomUUID(),gateway:aZ.includes(a.gateway)?a.gateway:"feishu",downstream:a.downstream??"feishu",active:!!a.active}));b.length>0&&!b.some(a=>a.active)&&(b[0].active=!0),e(b),m(new Set(b.filter(a=>a.downstream&&!a_.includes(a.downstream)).map(a=>a.id)))}).finally(()=>o(!1))},[]);let x=(a,b)=>e(c=>c.map(c=>c.id===a?{...c,...b}:c)),y=a=>{e(b=>{let c=b.find(b=>b.id===a)?.active,d=b.filter(b=>b.id!==a);return c&&d.length>0&&!d.some(a=>a.active)&&(d[0].active=!0),d}),j===a&&k(null)},z=(a,b)=>m(c=>{let d=new Set(c);return b?d.add(a):d.delete(a),d}),B=async()=>{try{await navigator.clipboard.writeText("你有 Playwright(浏览器自动化)能力。帮我在飞书创建一个自建应用(机器人),用于 Tower 的无人值守通知与飞书助理。请一步步来;遇到需要我登录/扫码/人工确认的地方,停下来让我操作,我弄好再继续。\n\n平台地址:公网飞书 https://open.feishu.cn/ (公司/私有化飞书换成你们自己的内网开放平台地址)。用 Playwright 打开它,让我登录(企业管理员或开发者账号)。控制台页面可能有 WAF,但你是真实浏览器,正常访问即可。\n\n步骤:\n1. 创建企业自建应用:名字填「Tower 助理」,随便传个图标。\n2. 开启机器人能力:应用内「添加应用能力」→ 启用「机器人」。(不开这个,机器人进不了群、发不了消息。)\n3. 开通权限(「权限管理」逐个搜索并勾选,名称各版本略有差异,按含义找):\n 必需:im:message(读写单聊/群消息)、im:message.group_msg(读群里全部消息,机器人收到 @ 靠它)、im:chat(获取群信息)、im:chat.members:read(读群成员、识别「谁 @ 我」)。\n 可选:task:task、wiki:wiki:readonly / wiki:node:read / wiki:node:retrieve、docx:document:readonly、drive:drive:readonly(要建飞书待办、读飞书文档/知识库才需要)。\n4. 发布版本:改完权限必须「创建版本 → 申请发布 / 上线」,否则权限不生效(最容易忘的一步)。等发布成功。\n5. 取凭据:到「凭证与基础信息」,复制 App ID(cli_ 开头)和 App Secret;并取机器人自己的 open_id(botOpenId,拿不到就标「待补」)。\n6. 建议新建一个唯一名称的专属群(如「Tower 通知」),把机器人加进去,记下群 id —— 避免同名群/人导致发错。\n7. 把 appId / appSecret / domain 配到飞书 MCP,并在 Tower「设置 → 通知 → 无人值守发送渠道」加一条渠道,点「测试」验证能收到消息。\n\n避坑:① 域名别搞反 —— 公司飞书和公网飞书是两套、凭据不通用;② 只「建了应用」不等于能用,必须开机器人能力 + 发布版本 + 拉进群三样齐;③ 别用 curl 直接抓控制台页面(有 WAF 会 403),用浏览器(Playwright)操作。\n\n(换 OpenClaw / Hermes 等其它网关:参考各自文档 https://docs.openclaw.ai/ · https://hermes-agent.nousresearch.com/docs/ ,拿到 token / webhook 后同样在 Tower 加渠道并测试。)"),g.toast.success(a("settings.harness.copied"))}catch{g.toast.error("复制失败")}},D=async a=>{if(r.trim()){u(!0),w(null);try{let b=await aY({gateway:a.gateway,downstream:a.downstream,dest:r.trim()});w(b)}catch(a){w({ok:!1,output:a instanceof Error?a.message:String(a)})}finally{u(!1)}}},E=b=>a_.includes(b)?a(`settings.harness.ds.${b}`):b,F=({label:a,children:c})=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:a}),c]});return(0,b.jsxs)("div",{className:"rounded-xl border bg-card p-4 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:a("settings.harness.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a("settings.harness.desc")})]}),(0,b.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted/30 px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)(aT.Info,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{children:a("settings.harness.notice")})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 pl-5 text-xs",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[a("settings.harness.docsLabel"),":"]}),aZ.map(c=>a2[c]?(0,b.jsxs)("a",{href:a2[c],target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:[a(`settings.harness.gateway.${c}`),(0,b.jsx)(aC.ExternalLink,{className:"h-3 w-3"})]},c):null),(0,b.jsxs)("button",{type:"button",onClick:B,className:"inline-flex items-center gap-1 text-primary hover:underline",children:[(0,b.jsx)(aB.Copy,{className:"h-3 w-3"}),a("settings.harness.copyPrompt")]})]})]}),n&&(0,b.jsx)(G.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}),(0,b.jsx)("div",{className:"space-y-2",children:d.map(c=>{var d;let f,g=l.has(c.id);return j===c.id?(0,b.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-3 space-y-3",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsx)(F,{label:a("settings.harness.gatewayLabel"),children:(0,b.jsxs)(aa.Select,{value:c.gateway,onValueChange:a=>{let b=a??"feishu",d=a1(b);x(c.id,{gateway:b,downstream:d.includes(c.downstream)?c.downstream:d[0]??""}),z(c.id,!1)},children:[(0,b.jsx)(aa.SelectTrigger,{className:"w-full",children:(0,b.jsx)("span",{className:"truncate",children:a(`settings.harness.gateway.${c.gateway}`)})}),(0,b.jsx)(aa.SelectContent,{children:aZ.map(c=>(0,b.jsx)(aa.SelectItem,{value:c,children:a(`settings.harness.gateway.${c}`)},c))})]})}),(0,b.jsx)(F,{label:a("settings.harness.downstreamLabel"),children:(0,b.jsxs)(aa.Select,{value:g?a0:c.downstream,onValueChange:a=>{a===a0?(z(c.id,!0),x(c.id,{downstream:""})):(z(c.id,!1),x(c.id,{downstream:a??""}))},children:[(0,b.jsx)(aa.SelectTrigger,{className:"w-full",children:(0,b.jsx)("span",{className:"truncate",children:g?a("settings.harness.ds.custom"):c.downstream?E(c.downstream):a("settings.harness.downstreamPlaceholder")})}),(0,b.jsxs)(aa.SelectContent,{children:[a1(c.gateway).map(c=>(0,b.jsx)(aa.SelectItem,{value:c,children:a(`settings.harness.ds.${c}`)},c)),"feishu"!==c.gateway&&(0,b.jsx)(aa.SelectItem,{value:a0,children:a("settings.harness.ds.custom")})]})]})})]}),g&&(0,b.jsx)(F,{label:a("settings.harness.customLabel"),children:(0,b.jsx)(i.Input,{value:c.downstream,onChange:a=>x(c.id,{downstream:a.target.value}),placeholder:a("settings.harness.customPlaceholder")})}),(0,b.jsx)(F,{label:a("settings.harness.test"),children:(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{value:r,onChange:a=>s(a.target.value),placeholder:a("settings.harness.testDestPlaceholder"),className:"flex-1"}),(0,b.jsxs)(h.Button,{variant:"outline",onClick:()=>D(c),disabled:t||!r.trim(),children:[t?(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(aU.Send,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:t?a("settings.harness.testing"):a("settings.harness.testSend")})]})]}),v&&(0,b.jsxs)("div",{className:`flex items-start gap-1.5 rounded bg-muted/40 px-2 py-1 text-xs ${v.ok?"text-emerald-500":"text-rose-400"}`,children:[v.ok?(0,b.jsx)(aV.default,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}):(0,b.jsx)(aW.default,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{className:"whitespace-pre-wrap break-words",children:v.ok?a("settings.harness.testOk"):`${a("settings.harness.testFail")}:${v.output}`})]})]})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,b.jsxs)(h.Button,{onClick:()=>{k(null),w(null)},children:[(0,b.jsx)(az.Check,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:a("settings.harness.done")})]}),(0,b.jsxs)(h.Button,{variant:"ghost",className:"text-muted-foreground",onClick:()=>y(c.id),children:[(0,b.jsx)(C.Trash2,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:a("settings.harness.remove")})]})]})]},c.id):(0,b.jsxs)("div",{className:`flex items-center gap-2.5 rounded-lg border px-3 py-2 ${c.active?"border-primary/40 bg-primary/5":"bg-muted/20"}`,children:[(0,b.jsx)("button",{type:"button",onClick:()=>{let a;return a=c.id,e(b=>b.map(b=>({...b,active:b.id===a})))},title:a("settings.harness.setActive"),className:c.active?"text-primary":"text-muted-foreground hover:text-foreground",children:c.active?(0,b.jsx)(aX,{className:"h-4 w-4"}):(0,b.jsx)(aA,{className:"h-4 w-4"})}),(0,b.jsx)("span",{className:"truncate text-sm text-foreground",children:(d=c,f=a(`settings.harness.gateway.${d.gateway}`),d.downstream?`${f} \xb7 ${E(d.downstream)}`:f)}),c.active&&(0,b.jsx)("span",{className:"shrink-0 rounded-full bg-primary/15 px-2 py-0.5 text-[10px] font-medium text-primary ring-1 ring-primary/25",children:a("settings.harness.active")}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:()=>{k(c.id),w(null),s("")},title:a("settings.harness.edit"),children:(0,b.jsx)(aS.Pencil,{className:"h-4 w-4"})}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:()=>y(c.id),title:a("settings.harness.remove"),children:(0,b.jsx)(C.Trash2,{className:"h-4 w-4"})})]})]},c.id)})}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(h.Button,{variant:"outline",onClick:()=>{let a=crypto.randomUUID();e(b=>[...b,{id:a,gateway:"feishu",downstream:"feishu",active:0===b.length}]),k(a),w(null)},className:"text-muted-foreground",children:[(0,b.jsx)(A.Plus,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:a("settings.harness.addTarget")})]}),(0,b.jsx)(h.Button,{onClick:()=>q(async()=>{await (0,N.setConfigValue)("harness.targets",d),k(null),g.toast.success(a("settings.harness.saved"))}),disabled:p,className:"rounded-lg",children:a("common.save")})]})]})}function a4({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,o.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 a5({label:a,description:c,children:d,className:e}){return(0,b.jsxs)("div",{className:(0,o.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 a6=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:q.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:s,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:t.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:u,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:x.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:v.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:w.HardDrive,accent:"cyan"},{id:"keyboard-shortcuts",labelKey:"settings.keyboardShortcuts",descKey:"settings.keyboardShortcutsDesc",icon:y.Keyboard,accent:"violet"}],a7={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"}},a8="ai-manager:default-cli-adapter",a9={host:"",ownerMatch:"*",localPathTemplate:"",priority:0},ba=a=>a.replace(/\\/g,"/").replace(/\/+$/,"");function bb(){let a=(0,d.useRouter)(),{t:q}=(0,f.useI18n)(),{theme:r,setTheme:s}=(0,e.useTheme)(),{locale:t,setLocale:u}=(0,f.useI18n)(),[v,w]=(0,c.useState)("general"),x=(0,c.useRef)(null),[y,P]=(0,c.useState)({left:0,width:0}),[$,_]=(0,c.useState)(!1),[aa,ab]=(0,c.useState)("Terminal"),[ac,ad]=(0,c.useState)([]),[ae,ai]=(0,c.useState)(""),[aj,ak]=(0,c.useState)([]),[al,am]=(0,c.useState)(13),[an,ao]=(0,c.useState)("Menlo, Monaco, 'Courier New', monospace"),[ap,aq]=(0,c.useState)([]),[ar,as]=(0,c.useState)("claude"),[at,au]=(0,c.useState)(null),[av,aw]=(0,c.useState)({}),[ay,az]=(0,c.useState)([]),[aA,aB]=(0,c.useState)(!1),[aC,aD]=(0,c.useState)(null),[aE,aF]=(0,c.useState)(null),[aG,aH]=(0,c.useState)(""),[aI,aK]=(0,c.useState)(""),[aL,aM]=(0,c.useState)(""),[aN,aO]=(0,c.useState)(null),[aP,aQ]=(0,c.useState)(""),[aS,aT]=(0,c.useState)(!1),[aU,aV]=(0,c.useState)(!1),[aW,aX]=(0,c.useState)(!1),[aY,aZ]=(0,c.useState)([]),[a$,a_]=(0,c.useState)(null),[a0,a1]=(0,c.useState)({...a9}),[a2,bb]=(0,c.useState)(!1),[bc,bd]=(0,c.useState)({...a9}),[be,bf]=(0,c.useState)(!1),[bg,bh]=(0,c.useState)(!1),[bi,bj]=(0,c.useState)(0),[bk,bl]=(0,c.useState)(null),[bm,bn]=(0,c.useState)(null),[bo,bp]=(0,c.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[bq,br]=(0,c.useState)({timeoutSec:30}),[bs,bt]=(0,c.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[bu,bv]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[bw,bx]=(0,c.useState)(null),[by,bz]=(0,c.useState)(!1),[bA,bB]=(0,c.useState)(""),[bC,bD]=(0,c.useState)(!0);(0,c.useEffect)(()=>_(!0),[]),(0,c.useEffect)(()=>{(0,M.getConfigValue)("terminal.app","Terminal").then(ab),Q().then(ad),(0,M.getConfigValue)("editor.command","").then(ai),R().then(ak),(0,M.getConfigValue)("terminal.fontSize",13).then(am),(0,M.getConfigValue)("terminal.fontFamily","Menlo, Monaco, 'Courier New', monospace").then(ao)},[]),(0,c.useEffect)(()=>{if(0===ac.length||!aa||ac.some(a=>a.value===aa))return;let a=ac.find(a=>a.name===aa);a&&(ab(a.value),(0,N.setConfigValue)("terminal.app",a.value))},[ac,aa]),(0,c.useEffect)(()=>{if(0===aj.length||!ae||aj.some(a=>a.command===ae))return;let a=aj.find(a=>a.name===ae);a&&(ai(a.command),(0,N.setConfigValue)("editor.command",a.command))},[aj,ae]),(0,c.useEffect)(()=>{Z().then(aq);let a=localStorage.getItem(a8);a&&as(a)},[]),(0,c.useEffect)(()=>{(0,S.getPrompts)().then(az)},[]),(0,c.useEffect)(()=>{W().then(a=>{aO(a),aQ(a.systemDirective)})},[]);let bE=async()=>{try{let a=await fetch("/api/internal/hooks/install");if(a.ok){let b=await a.json();bx(b)}}catch{}};async function bF(a){if(!at){au(a),aw(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();aw(b=>({...b,[a]:c}))}catch{aw(b=>({...b,[a]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{au(null)}}}(0,c.useEffect)(()=>{(0,M.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});aZ(d),c&&(0,N.setConfigValue)("git.pathMappingRules",d)}),(0,M.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(a=>{bB(a.join(", "))}),bE(),(0,O.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;bp({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"]}),br({timeoutSec:a["git.timeoutSec"]??30}),bt({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}),bv({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,M.getConfigValue)("notification.enabled",!0).then(bD)},[]);let bG=(0,c.useCallback)(()=>{aD(null),aH(""),aK(""),aM(""),aB(!0)},[]),bH=(0,c.useCallback)(a=>{aD(a),aH(a.name),aK(a.description??""),aM(a.content),aB(!0)},[]),bI=(0,c.useCallback)(async()=>{aG.trim()&&aL.trim()&&(aC?await U(aC.id,{name:aG.trim(),description:aI.trim()||void 0,content:aL.trim()}):await T({name:aG.trim(),description:aI.trim()||void 0,content:aL.trim()}),aB(!1),az(await (0,S.getPrompts)()),a.refresh())},[aG,aI,aL,aC,a]),bJ=(0,c.useCallback)(async()=>{aE&&(await V(aE),aF(null),az(await (0,S.getPrompts)()),a.refresh())},[aE,a]),bK=(0,c.useCallback)(async()=>{aT(!0);try{await X(aP);let a=await W();aO(a),aQ(a.systemDirective),aV(!1),g.toast.success(q("settings.prompts.builtin.saved"))}finally{aT(!1)}},[aP,q]),bL=(0,c.useCallback)(async()=>{aT(!0);try{let a=await Y(),b=await W();aO(b),aQ(a),g.toast.info(q("settings.prompts.builtin.resetDone"))}finally{aT(!1)}},[q]),bM=async()=>{await (0,N.setConfigValue)("system.maxUploadBytes",1024*bo.maxUploadMb*1024),await (0,N.setConfigValue)("system.maxConcurrentExecutions",bo.maxConcurrent),await (0,N.setConfigValue)("system.maxReadableFileBytes",1024*bo.maxReadableMb*1024),await (0,N.setConfigValue)("board.archiveDelayDays",bo.archiveDelayDays)},bN=async()=>{await (0,N.setConfigValue)("task.defaultUseWorktree",bo.taskDefaultUseWorktree),await (0,N.setConfigValue)("task.defaultAutoStart",bo.taskDefaultAutoStart),await (0,N.setConfigValue)("task.mcpDefaultsConfigured",!0)},bO=async()=>{await (0,N.setConfigValue)("git.timeoutSec",bq.timeoutSec)},bP=async()=>{await (0,N.setConfigValue)("search.resultLimit",bs.resultLimit),await (0,N.setConfigValue)("search.allModeCap",bs.allModeCap),await (0,N.setConfigValue)("search.debounceMs",bs.debounceMs),await (0,N.setConfigValue)("search.snippetLength",bs.snippetLength),await (0,N.setConfigValue)("search.codeTimeoutSec",bs.codeTimeoutSec)},bQ=async()=>{let a=Math.min(bu.minCols,bu.maxCols),b=Math.max(bu.minCols,bu.maxCols),c=Math.min(bu.minRows,bu.maxRows),d=Math.max(bu.minRows,bu.maxRows);bv({minCols:a,maxCols:b,minRows:c,maxRows:d}),await (0,N.setConfigValue)("missions.grid.minCols",a),await (0,N.setConfigValue)("missions.grid.maxCols",b),await (0,N.setConfigValue)("missions.grid.minRows",c),await (0,N.setConfigValue)("missions.grid.maxRows",d)},bR=async()=>{let a=bA.split(",").map(a=>a.trim()).filter(Boolean);await (0,N.setConfigValue)("hooks.autoUploadTypes",a)},bS=async()=>{if(bw){bz(!0);try{let a=bw.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:a}),await bE()}finally{bz(!1)}}},bT=async()=>{if(!bc.host.trim()||!bc.localPathTemplate.trim())return;let a=ba(bc.localPathTemplate.trim()),b=be?`${a}/{path}`:a,c=[...aY,{id:crypto.randomUUID(),host:bc.host.trim(),ownerMatch:bc.ownerMatch.trim()||"*",localPathTemplate:b,priority:bc.priority}];await (0,N.setConfigValue)("git.pathMappingRules",c),aZ(c),bd({...a9}),bf(!1),bb(!1)},bU=async a=>{if(!a0.host.trim()||!a0.localPathTemplate.trim())return;let b=ba(a0.localPathTemplate.trim()),c=bg?`${b}/{path}`:b,d=aY.map(b=>b.id===a?{...b,host:a0.host.trim(),ownerMatch:a0.ownerMatch.trim()||"*",localPathTemplate:c,priority:a0.priority}:b);await (0,N.setConfigValue)("git.pathMappingRules",d),aZ(d),a_(null),bh(!1)},bV=async a=>{let b=aY.filter(b=>b.id!==a);await (0,N.setConfigValue)("git.pathMappingRules",b),aZ(b),bl(null)};async function bW(){let a=!bC;bD(a),await (0,N.setConfigValue)("notification.enabled",a)}let bX=(0,c.useCallback)(()=>{a.back()},[a]),bY=(0,c.useCallback)(a=>{let b=x.current;if(!b)return;let c=b.querySelector("[data-section]"),d=c?c.offsetWidth+4:140;b.scrollBy({left:"left"===a?-d:d,behavior:"smooth"})},[]);(0,c.useEffect)(()=>{let a=x.current;if(!a)return;let b=a.querySelector(`[data-section="${v}"]`);if(!b)return;let c=a.getBoundingClientRect(),d=b.getBoundingClientRect();P({left:d.left-c.left,width:d.width})},[v]);let{canScrollLeft:bZ,canScrollRight:b$}=(0,p.useScrollOverflow)(x,[t]),b_=a6.find(a=>a.id===v),b0=b_?a7[b_.accent]:a7.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:q("settings.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:q("settings.configDesc")})]}),(0,b.jsxs)(h.Button,{variant:"outline",onClick:bX,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,b.jsx)(z.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,b.jsxs)("div",{className:"relative flex items-center gap-1",children:[bZ&&(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bY("left"),className:"shrink-0","aria-label":"scroll tabs left",children:(0,b.jsx)(K.ChevronLeft,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{ref:x,className:"relative flex flex-1 gap-1 overflow-x-auto [&::-webkit-scrollbar]:hidden",children:[a6.map(a=>{let c=a.icon,d=v===a.id,e=a7[a.accent];return(0,b.jsxs)("button",{"data-section":a.id,onClick:()=>w(a.id),className:(0,o.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,o.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:q(a.labelKey)})]},a.id)}),(0,b.jsx)("div",{className:(0,o.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",b0.indicator),style:{left:y.left,width:y.width}})]}),b$&&(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bY("right"),className:"shrink-0","aria-label":"scroll tabs right",children:(0,b.jsx)(L.ChevronRight,{className:"h-4 w-4"})})]})]})}),(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:[b_&&(0,b.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,b.jsx)("div",{className:(0,o.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",b0.bg,b0.text,b0.ring),children:(0,b.jsx)(b_.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:q(b_.labelKey)}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:q(b_.descKey)})]})]}),(0,b.jsx)("div",{className:"mb-6 border-t"}),function(){switch(v){case"general":let a;return a=[{value:"light",label:q("settings.themeLight")},{value:"dark",label:q("settings.themeDark")},{value:"system",label:q("settings.themeSystem")}],(0,b.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,b.jsx)(a5,{label:q("settings.theme"),description:q("settings.themeDesc"),children:$?(0,b.jsx)(a4,{options:a,value:r??"system",onChange:a=>s(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)(a5,{label:q("settings.language"),description:q("settings.languageDesc"),children:(0,b.jsx)(a4,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:t,onChange:a=>u(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:q("settings.terminal.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:q("settings.terminal.desc")})]}),ac.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ac.map(a=>{let c=aa===a.value,d=(0,o.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&&(ab(a.value),(0,N.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)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(ag.TooltipContent,{side:"top",children:q("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:q("settings.terminalFont.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:q("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:[q("settings.terminalFont.size"),(0,b.jsx)("input",{type:"number",min:8,max:40,value:al,onChange:a=>{let b=Math.max(8,Math.min(40,Math.round(Number(a.target.value)||13)));am(b),(0,N.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:[q("settings.terminalFont.family"),(0,b.jsx)("input",{type:"text",value:an,placeholder:"Menlo, Monaco, 'Courier New', monospace",onChange:a=>ao(a.target.value),onBlur:a=>{let b=a.target.value.trim()||"Menlo, Monaco, 'Courier New', monospace";ao(b),(0,N.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:q("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:q("settings.editor.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:q("settings.editor.desc")})]}),aj.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:aj.map(a=>{let c=ae===a.command,d=(0,o.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&&(ai(a.command),(0,N.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)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(ag.TooltipContent,{side:"top",children:q("settings.app.notInstalled")})]},a.command)})})]})]});case"ai-tools":return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ap.map(a=>{let c=ar===a.name,d=at===a.name,e=av[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)(l.Badge,{variant:"outline",children:q("label.builtin")}),c&&(0,b.jsxs)(l.Badge,{variant:"secondary",className:"shrink-0",children:[(0,b.jsx)(B,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),q("settings.prompts.default")]}),e&&(0,b.jsx)(l.Badge,{variant:e.ok?"secondary":"destructive",className:(0,o.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)(H.CheckCircle2,{className:"h-3 w-3 mr-1"}),q("settings.aiTools.testPassed")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(I.XCircle,{className:"h-3 w-3 mr-1"}),q("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)(h.Button,{variant:"outline",size:"sm",onClick:()=>{var b;as(b=a.name),localStorage.setItem(a8,b)},children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),q("settings.prompts.setDefault")]}),(0,b.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>bF(a.name),disabled:d,children:d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),q("settings.aiTools.testing")]}):q("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,o.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,o.cn)(c.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:c.message})]},`${a.name}-${c.name}`))})})]})},a.name)})}),(0,b.jsx)(af,{})]});case"prompts":return $?(0,b.jsxs)("div",{className:"space-y-4",children:[aN&&(0,b.jsxs)("div",{className:"space-y-4 rounded-xl border border-border/50 bg-card p-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:q("settings.prompts.builtin.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("settings.prompts.builtin.desc")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.Label,{className:"text-sm",children:q("settings.prompts.builtin.systemTitle")}),aN.systemDirectiveIsCustom&&(0,b.jsx)(l.Badge,{variant:"secondary",className:"rounded-full text-xs",children:q("settings.prompts.builtin.modified")})]}),(0,b.jsxs)(h.Button,{variant:"outline",onClick:()=>{aQ(aN.systemDirective),aV(!0)},children:[(0,b.jsx)(D,{className:"h-4 w-4"}),q("settings.prompts.builtin.edit")]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.prompts.builtin.systemDesc")}),(0,b.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3",children:(0,b.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:aN.systemDirective})})]}),(0,b.jsxs)("div",{className:"space-y-2 border-t border-border/50 pt-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.Label,{className:"text-sm",children:q("settings.prompts.builtin.childTitle")}),(0,b.jsx)(l.Badge,{variant:"outline",className:"rounded-full text-xs",children:q("settings.prompts.builtin.readonly")})]}),(0,b.jsxs)(h.Button,{variant:"outline",onClick:()=>aX(!0),children:[(0,b.jsx)(E.Eye,{className:"h-4 w-4"}),q("settings.prompts.builtin.view")]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.prompts.builtin.childDesc")}),(0,b.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3",children:(0,b.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:aN.childReviewPrompt})})]})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:q("settings.prompts.custom.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("settings.prompts.custom.desc")})]}),(0,b.jsxs)(h.Button,{onClick:bG,variant:"default",className:"shrink-0",children:[(0,b.jsx)(A.Plus,{className:"h-4 w-4 mr-2"}),q("settings.prompts.newPrompt")]})]}),0===ay.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:q("settings.prompts.empty")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:q("settings.prompts.emptyHint")})]}):(0,b.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ay.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.jsx)("h4",{className:"text-sm font-medium truncate",children:a.name}),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)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bH(a),title:q("settings.prompts.editPrompt"),children:(0,b.jsx)(D,{className:"h-4 w-4"})}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>aF(a.id),className:"text-destructive",title:q("settings.prompts.delete"),children:(0,b.jsx)(C.Trash2,{className:"h-4 w-4"})})]})]},a.id))})]}),(0,b.jsx)(n.Dialog,{open:aU,onOpenChange:aV,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:q("settings.prompts.builtin.systemTitle")}),(0,b.jsx)(n.DialogDescription,{children:q("settings.prompts.builtin.systemDesc")})]}),(0,b.jsx)(j.Textarea,{value:aP,onChange:a=>aQ(a.target.value),className:"max-h-[60vh] min-h-[50vh] font-mono text-xs"}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:bL,disabled:aS||!aN?.systemDirectiveIsCustom,children:q("settings.prompts.builtin.resetDefault")}),(0,b.jsx)(h.Button,{variant:"default",onClick:bK,disabled:aS||aP===aN?.systemDirective,children:q("settings.prompts.save")})]})]})}),(0,b.jsx)(n.Dialog,{open:aW,onOpenChange:aX,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:q("settings.prompts.builtin.childTitle")}),(0,b.jsx)(n.DialogDescription,{children:q("settings.prompts.builtin.childDesc")})]}),(0,b.jsx)(j.Textarea,{value:aN?.childReviewPrompt??"",readOnly:!0,className:"max-h-[60vh] min-h-[50vh] font-mono text-xs bg-muted/40 cursor-default"}),(0,b.jsx)(n.DialogFooter,{children:(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>aX(!1),children:q("settings.prompts.close")})})]})}),(0,b.jsx)(n.Dialog,{open:aA,onOpenChange:aB,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:aC?q("settings.prompts.editPrompt"):q("settings.prompts.newPrompt")}),(0,b.jsx)(n.DialogDescription,{children:aC?q("settings.prompts.editPrompt"):q("settings.prompts.newPrompt")})]}),(0,b.jsxs)("div",{className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(k.Label,{htmlFor:"prompt-name",children:q("settings.prompts.promptName")}),(0,b.jsx)(i.Input,{id:"prompt-name",value:aG,onChange:a=>aH(a.target.value),placeholder:q("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(k.Label,{htmlFor:"prompt-description",children:q("settings.prompts.promptDescription")}),(0,b.jsx)(i.Input,{id:"prompt-description",value:aI,onChange:a=>aK(a.target.value),placeholder:q("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(k.Label,{htmlFor:"prompt-content",children:q("settings.prompts.promptContent")}),(0,b.jsx)(j.Textarea,{id:"prompt-content",value:aL,onChange:a=>aM(a.target.value),placeholder:q("settings.prompts.promptContentPlaceholder"),className:"mt-1.5 max-h-[55vh] min-h-[40vh] font-mono text-sm"})]})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>aB(!1),children:q("settings.prompts.cancel")}),(0,b.jsx)(h.Button,{onClick:bI,disabled:!aG.trim()||!aL.trim(),children:q("settings.prompts.save")})]})]})}),(0,b.jsx)(n.Dialog,{open:!!aE,onOpenChange:a=>!a&&aF(null),children:(0,b.jsxs)(n.DialogContent,{children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:q("settings.prompts.deleteConfirmTitle")}),(0,b.jsx)(n.DialogDescription,{children:q("settings.prompts.deleteConfirmMessage")})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>aF(null),children:q("settings.prompts.cancel")}),(0,b.jsx)(h.Button,{variant:"destructive",onClick:bJ,children:q("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:q("settings.config.git.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("settings.config.git.desc")})]}),(0,b.jsxs)(h.Button,{onClick:()=>{bd({...a9}),bb(!0)},children:[(0,b.jsx)(A.Plus,{className:"mr-2 h-4 w-4"}),q("settings.config.git.addRule")]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[0!==aY.length||a2?(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:aY.map(a=>a$===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:q("settings.config.git.host")}),(0,b.jsx)(i.Input,{value:a0.host,onChange:a=>a1(b=>({...b,host:a.target.value})),placeholder:q("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:q("settings.config.git.ownerMatch")}),(0,b.jsx)(i.Input,{value:a0.ownerMatch,onChange:a=>a1(b=>({...b,ownerMatch:a.target.value})),placeholder:q("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:q("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{value:a0.localPathTemplate,onChange:a=>a1(b=>({...b,localPathTemplate:a.target.value})),placeholder:q("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:bg?"default":"outline",size:"sm",type:"button",onClick:()=>bh(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(ag.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:q("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:q("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>bn("edit"),children:(0,b.jsx)(J.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(ag.TooltipContent,{children:q("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:bg?q("onboarding.step3.pathHintFull"):q("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:q("settings.config.git.priority")}),(0,b.jsx)(i.Input,{type:"number",value:a0.priority,onChange:a=>a1(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)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{a_(null),bh(!1)},children:q("settings.config.git.cancel")}),(0,b.jsx)(h.Button,{size:"sm",onClick:()=>bU(a.id),children:q("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)(l.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[q("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)(h.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(a_(a.id),a1({host:a.host,ownerMatch:a.ownerMatch,localPathTemplate:d,priority:a.priority}),bh(c))},title:q("settings.config.git.edit"),children:(0,b.jsx)(D,{className:"h-4 w-4"})}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bl(a.id),className:"text-destructive",title:q("settings.config.git.delete"),children:(0,b.jsx)(C.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:q("settings.config.git.noRules")}),(0,b.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground/80",children:q("settings.config.git.noRulesFallback")})]}),a2&&(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:q("settings.config.git.host")}),(0,b.jsx)(i.Input,{value:bc.host,onChange:a=>bd(b=>({...b,host:a.target.value})),placeholder:q("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:q("settings.config.git.ownerMatch")}),(0,b.jsx)(i.Input,{value:bc.ownerMatch,onChange:a=>bd(b=>({...b,ownerMatch:a.target.value})),placeholder:q("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:q("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{value:bc.localPathTemplate,onChange:a=>bd(b=>({...b,localPathTemplate:a.target.value})),placeholder:q("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:be?"default":"outline",size:"sm",type:"button",onClick:()=>bf(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(ag.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:q("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:q("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>bn("add"),children:(0,b.jsx)(J.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(ag.TooltipContent,{children:q("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:be?q("onboarding.step3.pathHintFull"):q("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:q("settings.config.git.priority")}),(0,b.jsx)(i.Input,{type:"number",value:bc.priority,onChange:a=>bd(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]}),bc.localPathTemplate&&(c=bc.localPathTemplate.trim().replace(/\/+$/,""),d=be?`${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:q("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1",children:e.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>bj(c),className:(0,o.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",bi===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[bi].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[bi].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>bb(!1),children:q("settings.config.git.cancel")}),(0,b.jsxs)(h.Button,{size:"sm",onClick:bT,disabled:!bc.host.trim()||!bc.localPathTemplate.trim(),children:[(0,b.jsx)(F,{className:"h-3.5 w-3.5 mr-1.5"}),q("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:q("settings.config.system.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.system.maxUpload")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.maxUploadHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:1,max:500,value:bo.maxUploadMb,onChange:a=>bp(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:q("settings.config.system.maxConcurrent")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.maxConcurrentHint")})]}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bo.maxConcurrent,onChange:a=>bp(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:q("settings.config.system.maxReadable")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.maxReadableHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:1,max:50,value:bo.maxReadableMb,onChange:a=>bp(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:q("settings.config.system.archiveDelay")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.archiveDelayHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:1,max:365,value:bo.archiveDelayDays,onChange:a=>bp(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:q("settings.config.system.archiveDelayUnit")})]})]})]}),(0,b.jsx)(h.Button,{onClick:bM,className:"rounded-lg",children:q("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:q("settings.config.task.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.system.taskDefaultWorktree")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.taskDefaultWorktreeHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>bp(a=>({...a,taskDefaultUseWorktree:!a.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${bo.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:bo.taskDefaultUseWorktree?q("task.worktreeYes"):q("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:q("settings.config.system.taskDefaultAutoStart")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.taskDefaultAutoStartHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>bp(a=>({...a,taskDefaultAutoStart:!a.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${bo.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:bo.taskDefaultAutoStart?q("task.autoStartYes"):q("task.autoStartNo")})]})]}),(0,b.jsx)(h.Button,{onClick:bN,className:"rounded-lg",children:q("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:q("settings.config.gitParams.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.gitParams.timeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.gitParams.timeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:5,max:300,value:bq.timeoutSec,onChange:a=>br(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)(h.Button,{onClick:bO,className:"rounded-lg",children:q("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:q("settings.config.search.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.search.resultLimit")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.resultLimitHint")})]}),(0,b.jsx)(i.Input,{type:"number",min:5,max:100,value:bs.resultLimit,onChange:a=>bt(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:q("settings.config.search.allModeCap")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.allModeCapHint")})]}),(0,b.jsx)(i.Input,{type:"number",min:1,max:20,value:bs.allModeCap,onChange:a=>bt(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:q("settings.config.search.debounceMs")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.debounceMsHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:50,max:1e3,value:bs.debounceMs,onChange:a=>bt(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:q("settings.config.search.snippetLength")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.snippetLengthHint")})]}),(0,b.jsx)(i.Input,{type:"number",min:20,max:500,value:bs.snippetLength,onChange:a=>bt(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:q("settings.config.search.codeTimeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.codeTimeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:5,max:300,step:5,value:bs.codeTimeoutSec,onChange:a=>bt(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)(h.Button,{onClick:bP,className:"rounded-lg",children:q("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:q("settings.config.missions.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.missions.minCols")}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bu.minCols,onChange:a=>bv(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:q("settings.config.missions.maxCols")}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bu.maxCols,onChange:a=>bv(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:q("settings.config.missions.minRows")}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bu.minRows,onChange:a=>bv(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:q("settings.config.missions.maxRows")}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bu.maxRows,onChange:a=>bv(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)(h.Button,{onClick:bQ,className:"rounded-lg",children:q("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:q("settings.config.hooks.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.hooks.autoUploadTypes")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.hooks.autoUploadTypesHint")})]}),(0,b.jsx)(i.Input,{value:bA,onChange:a=>bB(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)(h.Button,{onClick:bR,className:"rounded-lg",children:q("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:bw?.installed?q("settings.config.hooks.installed"):q("settings.config.hooks.notInstalled")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.hooks.installHint")})]}),(0,b.jsx)(h.Button,{variant:bw?.installed?"destructive":"default",onClick:bS,disabled:by||!bw,className:"rounded-lg",children:bw?.installed?q("settings.config.hooks.uninstall"):q("settings.config.hooks.install")})]})]}),(0,b.jsx)(n.Dialog,{open:!!bk,onOpenChange:a=>!a&&bl(null),children:(0,b.jsxs)(n.DialogContent,{children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:q("settings.config.git.deleteConfirm")}),(0,b.jsx)(n.DialogDescription,{children:q("settings.config.git.deleteConfirmMessage")})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>bl(null),children:q("settings.config.git.cancel")}),(0,b.jsx)(h.Button,{variant:"destructive",onClick:()=>bk&&bV(bk),children:q("settings.config.git.delete")})]})]})})]});case"notifications":return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"rounded-xl border bg-card p-4 space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:q("settings.notifications.systemCategory")}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:q("settings.notifications.enable")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:q("settings.notifications.enableDesc")})]}),(0,b.jsx)(m.Switch,{checked:bC,onCheckedChange:bW})]})]}),(0,b.jsx)(a3,{})]});case"backup":return(0,b.jsx)(ax,{});case"extensions":return(0,b.jsx)(aJ,{});case"keyboard-shortcuts":return(0,b.jsx)(aR,{})}}()]})}),(0,b.jsx)(ah.FolderBrowserDialog,{open:null!==bm,onOpenChange:a=>{a||bn(null)},onSelect:a=>{let b=ba(a);"add"===bm?bd(a=>({...a,localPathTemplate:b})):"edit"===bm&&a1(a=>({...a,localPathTemplate:b})),bn(null)}})]})}a.s(["default",0,function(){return(0,b.jsx)(bb,{})}],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(952313),h=a.i(699570),i=a.i(866718),j=a.i(429246),k=a.i(412783),l=a.i(786304),m=a.i(563658),n=a.i(814574),o=a.i(368114),p=a.i(268317),q=a.i(369289),r=a.i(711796);let s=(0,r.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 t=a.i(350739);let u=(0,r.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 v=a.i(190076),w=a.i(705594),x=a.i(264589),y=a.i(567648),z=a.i(54384),A=a.i(774881);let B=(0,r.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 C=a.i(975231);let D=(0,r.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"}]]);var E=a.i(509405);let F=(0,r.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 G=a.i(704494),H=a.i(913284),I=a.i(468862),J=a.i(347165),K=a.i(912868),L=a.i(10390),M=a.i(386127),N=a.i(422036),O=a.i(899896),P=a.i(780410);let Q=(0,P.createServerReference)("00778c274386fee10c6d07fa7208ebf73366110d21",P.callServer,void 0,P.findSourceMapURL,"getAvailableTerminalApps"),R=(0,P.createServerReference)("00aa596e8a642e9da3810152361d231b3773ba7ef1",P.callServer,void 0,P.findSourceMapURL,"getAvailableEditors");var S=a.i(336042);let T=(0,P.createServerReference)("4090c37dd20c2677b3504fe2b36ade239e1bed3a98",P.callServer,void 0,P.findSourceMapURL,"createPrompt"),U=(0,P.createServerReference)("60f2d33f3f63dff7c9c024b2dfa8449c54e7beeb7d",P.callServer,void 0,P.findSourceMapURL,"updatePrompt"),V=(0,P.createServerReference)("40201142c8434d2a9d8d0e9b1a740240cfb9586985",P.callServer,void 0,P.findSourceMapURL,"deletePrompt"),W=(0,P.createServerReference)("0017bb73a0a2aab62e73b999b48cf8ae58bebdade8",P.callServer,void 0,P.findSourceMapURL,"getBuiltinPrompts"),X=(0,P.createServerReference)("40400da8b2732c30eb841d6d056afb8d8f091348ff",P.callServer,void 0,P.findSourceMapURL,"saveSystemDirective"),Y=(0,P.createServerReference)("0005a8b52fd7ff55a3594b6dca6915bad94dc95210",P.callServer,void 0,P.findSourceMapURL,"resetSystemDirective"),Z=(0,P.createServerReference)("001f9294e9e0bb248e7878413b2cc8361234aeb91c",P.callServer,void 0,P.findSourceMapURL,"getAvailableProviders");var $=a.i(648512);let _=(0,r.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);var aa=a.i(580701);let ab=(0,P.createServerReference)("0028521a0b4fcf38aae6e0676543a7b380b2c86c14",P.callServer,void 0,P.findSourceMapURL,"getAiCapabilityConfigs"),ac=(0,P.createServerReference)("6064a8a5437a018ac0f0cdedd125941869938d1ea6",P.callServer,void 0,P.findSourceMapURL,"updateAiCapabilityConfig"),ad=(0,P.createServerReference)("0055c22bfa591cefc244c9861540576efd52b47373",P.callServer,void 0,P.findSourceMapURL,"getConnectedProviders"),ae=[{slot:"summary",key:"settings.capabilitySlots.summary"},{slot:"dreaming",key:"settings.capabilitySlots.dreaming"},{slot:"analysis",key:"settings.capabilitySlots.analysis"},{slot:"assistant",key:"settings.capabilitySlots.assistant"}];function af(){let{t:a}=(0,f.useI18n)(),[d,e]=(0,c.useState)([]),[h,i]=(0,c.useState)([]),[j,k]=(0,c.useState)([]),[l,m]=(0,c.useState)(!0),[n,o]=(0,c.useTransition)();(0,c.useEffect)(()=>{let a=!0;return Promise.all([Z(),ad(),ab()]).then(([b,c,d])=>{a&&(e(b),i(c),k(d))}).catch(b=>{a&&g.toast.error(b instanceof Error?b.message:String(b))}).finally(()=>{a&&m(!1)}),()=>{a=!1}},[]);let p=j.find(a=>"terminal"===a.slot),q=p?.provider??(h.includes("claude")?"claude":h[0]??"claude"),r=a=>d.find(b=>b.name===a)?.displayName??a;return l?(0,b.jsx)("div",{className:"h-32 rounded-xl bg-muted animate-pulse"}):(0,b.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("h3",{className:"text-sm font-medium flex items-center gap-2",children:[(0,b.jsx)($.Terminal,{className:"h-4 w-4"}),a("settings.capabilitySlots.title")]}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a("settings.capabilitySlots.desc")})]}),(0,b.jsxs)("div",{className:`flex items-center justify-between gap-4 ${n?"opacity-40 pointer-events-none":""}`,children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:a("settings.capabilitySlots.terminal")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:a("settings.capabilitySlots.terminalDesc")})]}),0===h.length?(0,b.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:a("settings.capabilitySlots.noConnected")}):(0,b.jsxs)(aa.Select,{value:q,onValueChange:function(b){b&&o(async()=>{try{await ac("terminal",{provider:b,mode:"cli",model:null}),k(a=>{let c=a.filter(a=>"terminal"!==a.slot),d=p??{id:"",slot:"terminal",mode:"cli",model:null,createdAt:new Date,updatedAt:new Date};return[...c,{...d,slot:"terminal",provider:b,mode:"cli",model:null}]}),g.toast.success(a("settings.capabilitySlots.updated"))}catch(a){g.toast.error(a instanceof Error?a.message:String(a))}})},children:[(0,b.jsx)(aa.SelectTrigger,{className:"w-44 shrink-0",children:(0,b.jsx)("span",{className:"truncate",children:r(q)})}),(0,b.jsx)(aa.SelectContent,{children:h.map(a=>(0,b.jsx)(aa.SelectItem,{value:a,children:r(a)},a))})]})]}),(0,b.jsx)("div",{className:"space-y-2.5 border-t border-border/50 pt-3",children:ae.map(c=>(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4 opacity-60",children:[(0,b.jsxs)("div",{className:"text-sm font-medium flex items-center gap-1.5",children:[(0,b.jsx)(_,{className:"h-3 w-3"}),a(c.key)]}),(0,b.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:a("settings.capabilitySlots.claudeFixed")})]},c.slot))})]})}var ag=a.i(785259),ah=a.i(43775);let ai=(0,r.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 aj=a.i(324954);let ak=(0,r.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 al=a.i(161664),am=a.i(811344),an=a.i(607219);let ao=(0,P.createServerReference)("4081190646dfd19e5905cd07949d52c1db0b9cd492",P.callServer,void 0,P.findSourceMapURL,"createBackup"),ap=(0,P.createServerReference)("00fb83e94a084a727104d92f4030891ffe21394ea2",P.callServer,void 0,P.findSourceMapURL,"listBackupFiles"),aq=(0,P.createServerReference)("405b7ce520badaa31ddeeeb003d8c7ecaa75ff8ceb",P.callServer,void 0,P.findSourceMapURL,"deleteBackupFile"),ar=(0,P.createServerReference)("405fb31348735d530b2fbd1bfa3bd32338c9c00fca",P.callServer,void 0,P.findSourceMapURL,"restoreBackup"),as=(0,P.createServerReference)("40b667c41c647e1a354912820b3477b34bfcc0ff05",P.callServer,void 0,P.findSourceMapURL,"resetSystem"),at=(0,P.createServerReference)("00a5aad9940317624b10224648af03f34420f2f827",P.callServer,void 0,P.findSourceMapURL,"getBackupDir"),au=(0,P.createServerReference)("4062e1805dec87d49081686a99971d70b7d081d1ba",P.callServer,void 0,P.findSourceMapURL,"setBackupDir"),av=(0,P.createServerReference)("00f566bdb4d932daa40b6e7d5a8600739be31e9666",P.callServer,void 0,P.findSourceMapURL,"getStorageLocation"),aw=(0,P.createServerReference)("408ec1c9fc327f6f8c68102f3d511371bcc13100e7",P.callServer,void 0,P.findSourceMapURL,"setStorageLocation");function ax(){let{t:a,locale:e}=(0,f.useI18n)(),j=(0,d.useRouter)(),[k,l]=(0,c.useState)([]),[m,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(!1),[r,s]=(0,c.useState)(null),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(!0),[x,y]=(0,c.useState)(null),[z,A]=(0,c.useState)(!1),[B,D]=(0,c.useState)(""),E=(0,c.useRef)(null),[F,H]=(0,c.useState)(!1),[I,J]=(0,c.useState)(""),K=(0,c.useCallback)(async()=>{w(!0);try{let[a,b,c]=await Promise.all([ap(),at(),av()]);l(a),o(b),s(c)}finally{w(!1)}},[]);(0,c.useEffect)(()=>{K()},[K]);let L=async()=>{let b=B.trim()||void 0;A(!1),D(""),y("create");try{await ao(b),g.toast.success(a("settings.backup.createSuccess")),await K()}catch{g.toast.error(a("settings.backup.createError"))}finally{y(null)}},M=async b=>{if(confirm(a("settings.backup.restoreConfirm"))){y("restore");try{await ar(b),g.toast.success(a("settings.backup.restoreSuccess"),{action:{label:a("settings.backup.reload"),onClick:()=>window.location.reload()},duration:15e3}),await K()}catch{g.toast.error(a("settings.backup.restoreError"))}finally{y(null)}}},N=async b=>{if(confirm(a("settings.backup.deleteConfirm")))try{await aq(b),g.toast.success(a("settings.backup.deleteSuccess")),l(a=>a.filter(a=>a.filename!==b))}catch{g.toast.error(a("settings.backup.deleteError"))}},O=async b=>{q(!1);try{await au(b),o(b),g.toast.success(a("settings.backup.dirSaved")),await K()}catch{g.toast.error(a("settings.backup.dirError"))}},P=async b=>{y("storage");try{let c=await aw({newPath:b});if(!c.ok)return void g.toast.error(c.error||a("settings.storage.moveError"));g.toast.success(a("settings.storage.moveSuccess",{count:String(c.moved??0)})),await K()}catch(b){g.toast.error(b instanceof Error?b.message:a("settings.storage.moveError"))}finally{y(null)}},Q=async b=>{u(!1),confirm(a("settings.storage.moveConfirm"))&&await P(b)},R=async()=>{!r||r.isDefault||confirm(a("settings.storage.resetConfirm"))&&await P(r.default)},S=async b=>{let c=b.target.files?.[0];if(c){b.target.value="",y("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();g.toast.error("Invalid backup archive"===b.error?a("settings.backup.importInvalid"):(b.error,a("settings.backup.importError")));return}g.toast.success(a("settings.backup.importSuccess")),await K()}catch{g.toast.error(a("settings.backup.importError"))}finally{y(null)}}},T=async()=>{if("RESET"===I){H(!1),J(""),y("reset");try{await as("RESET"),g.toast.success(a("settings.backup.resetSuccess")),j.push("/")}catch{g.toast.error(a("settings.backup.resetError"))}finally{y(null)}}},U=null!==x;return(0,b.jsxs)("div",{className:"space-y-6",children:[("restore"===x||"reset"===x)&&(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)(G.Loader2,{className:"h-8 w-8 animate-spin text-muted-foreground"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"restore"===x?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:r?.current??"…"}),r?.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)(h.Button,{variant:"ghost",onClick:()=>u(!0),disabled:"storage"===x,className:"text-xs text-muted-foreground",children:"storage"===x?(0,b.jsx)(G.Loader2,{className:"h-3 w-3 animate-spin"}):a("settings.storage.change")}),r&&!r.isDefault&&(0,b.jsx)(h.Button,{variant:"ghost",onClick:R,disabled:"storage"===x,className:"text-xs text-muted-foreground",children:a("settings.storage.reset")})]}),(0,b.jsx)(ah.FolderBrowserDialog,{open:t,onOpenChange:u,onSelect:Q})]}),(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:m}),(0,b.jsx)(h.Button,{variant:"ghost",onClick:()=>q(!0),className:"text-xs text-muted-foreground",children:a("settings.backup.dirChange")})]}),(0,b.jsx)(ah.FolderBrowserDialog,{open:p,onOpenChange:q,onSelect:O})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(h.Button,{onClick:()=>{D(""),A(!0)},disabled:U,className:"gap-2",children:"create"===x?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-4 w-4 animate-spin"})," ",a("settings.backup.creating")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ai,{className:"h-4 w-4"})," ",a("settings.backup.create")]})}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsxs)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",disabled:U,onClick:()=>E.current?.click(),className:"gap-2"}),children:[(0,b.jsx)(ak,{className:"h-4 w-4"}),a("settings.backup.import")]}),(0,b.jsx)(ag.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:S})]}),(0,b.jsx)(n.Dialog,{open:z,onOpenChange:A,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsx)(n.DialogHeader,{children:(0,b.jsx)(n.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)(i.Input,{value:B,onChange:a=>D(a.target.value),onKeyDown:a=>"Enter"===a.key&&L(),placeholder:a("settings.backup.createLabelPlaceholder"),className:"mt-1.5",autoFocus:!0})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>A(!1),children:a("common.cancel")}),(0,b.jsx)(h.Button,{onClick:L,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:a("settings.backup.create")})]})]})}),v?(0,b.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,b.jsx)(G.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):0===k.length?(0,b.jsxs)("div",{className:"flex flex-col items-center gap-2 py-12 text-center",children:[(0,b.jsx)(an.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:k.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)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>M(c.filename),disabled:U,className:"text-muted-foreground hover:text-foreground"}),children:(0,b.jsx)(aj.Upload,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(ag.TooltipContent,{side:"bottom",sideOffset:4,children:a("settings.backup.restore")})]}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>N(c.filename),disabled:U,className:"text-muted-foreground hover:text-rose-400"}),children:(0,b.jsx)(C.Trash2,{className:"h-3.5 w-3.5"})}),(0,b.jsx)(ag.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)(am.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)(h.Button,{variant:"outline",onClick:()=>{J(""),H(!0)},disabled:U,className:"mt-3 border-rose-500/30 text-rose-400 hover:bg-rose-500/10 hover:text-rose-400",children:[(0,b.jsx)(al.RotateCcw,{className:"mr-2 h-3.5 w-3.5"}),a("settings.backup.reset")]})]}),(0,b.jsx)(n.Dialog,{open:F,onOpenChange:H,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:a("settings.backup.resetConfirmTitle")}),(0,b.jsx)(n.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)(i.Input,{value:I,onChange:a=>J(a.target.value),placeholder:"RESET",className:"mt-1.5 font-mono"})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>H(!1),children:a("common.cancel")}),(0,b.jsx)(h.Button,{disabled:"RESET"!==I,onClick:T,className:"border-rose-500/30 bg-rose-500/10 text-rose-400 hover:bg-rose-500/20",children:a("settings.backup.reset")})]})]})})]})}var ay=a.i(953093),az=a.i(668116);let aA=(0,r.default)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var aB=a.i(22761),aC=a.i(963326),aD=a.i(192369),aE=a.i(599209),aF=a.i(627141);let aG=[{os:"macOS",cmd:"brew install ripgrep"},{os:"Windows",cmd:"winget install BurntSushi.ripgrep"},{os:"Linux",cmd:"sudo apt install ripgrep"}];function aH({cmd:a}){let{t:d}=(0,f.useI18n)(),[e,i]=(0,c.useState)(!1),j=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)}i(!0),g.toast.success(d("common.copied")),setTimeout(()=>i(!1),1500)}catch{g.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)(h.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":d("common.copy"),onClick:j,children:e?(0,b.jsx)(az.Check,{className:"h-3 w-3 text-emerald-400"}):(0,b.jsx)(aB.Copy,{className:"h-3 w-3"})})]})}function aI({extension:a}){let{t:d}=(0,f.useI18n)(),{status:e,loading:i,isInstalling:j,install:k,uninstall:l,refresh:m}=(0,aF.useExtension)(a.id),[n,o]=(0,c.useState)(!1),p=a.icon,q=e.installed,r=async()=>{let b=await k();b.success?g.toast.success(d("settings.extensions.installSuccess").replace("{name}",a.name)):g.toast.error(d("settings.extensions.installFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},s=async()=>{let b=await l();b.success?g.toast.success(d("settings.extensions.uninstallSuccess").replace("{name}",a.name)):g.toast.error(d("settings.extensions.uninstallFailed").replace("{name}",a.name)+(b.error?`: ${b.error.slice(0,200)}`:""))},t=async()=>{o(!0);try{await m()}finally{o(!1)}},u=()=>{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)(p,{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:i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.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")})]}):q?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(H.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)(aA,{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:[q?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.Button,{variant:"default",onClick:r,disabled:j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.reinstalling")]}):d("settings.extensions.reinstall")}),(0,b.jsx)(h.Button,{variant:"outline",onClick:s,disabled:j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.uninstalling")]}):d("settings.extensions.uninstall")})]}):a.manualInstall?(0,b.jsxs)(aE.Popover,{children:[(0,b.jsx)(aE.PopoverTrigger,{render:a=>(0,b.jsxs)(h.Button,{variant:"default",...a,children:[(0,b.jsx)(ai,{className:"h-3.5 w-3.5"}),d("settings.extensions.installViaHomepage")]})}),(0,b.jsxs)(aE.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:aG.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)(aH,{cmd:c})]},a))}),(0,b.jsx)("p",{className:"text-muted-foreground",children:d("settings.extensions.manualInstallHintAfter")}),(0,b.jsxs)("button",{type:"button",onClick:u,className:"flex items-center gap-1 self-start text-[11px] text-primary underline-offset-2 hover:underline",children:[(0,b.jsx)(aC.ExternalLink,{className:"h-3 w-3"}),d("settings.extensions.visitHomepage")]})]})]}):(0,b.jsx)(h.Button,{variant:"default",onClick:r,disabled:j,children:j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin"}),d("settings.extensions.installing")]}):d("settings.extensions.install")}),(0,b.jsxs)(h.Button,{variant:"ghost",onClick:t,disabled:n,children:[(0,b.jsx)(aD.RefreshCw,{className:`h-3.5 w-3.5 ${n?"animate-spin":""}`}),d("settings.extensions.recheck")]}),(0,b.jsxs)(h.Button,{variant:"ghost",onClick:u,children:[(0,b.jsx)(aC.ExternalLink,{className:"h-3.5 w-3.5"}),d("settings.extensions.visitHomepage")]})]})]})}function aJ(){let{t:a}=(0,f.useI18n)(),c=(0,ay.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)(aI,{extension:a},a.id))})]})}a.i(423993);var aK=a.i(109603),aL=a.i(975787),aM=a.i(875846),aN=a.i(718799);let aO=["global","panels","missions"],aP=new Set(["missions.cycleBack"]);function aQ({keys:a}){return(0,b.jsx)(aN.KeyCombo,{keys:a})}function aR(){let a,{t:d}=(0,f.useI18n)(),e=(0,aM.useKeymapStore)(a=>a.overrides),i=(0,aM.useKeymapStore)(a=>a.setBinding),j=(0,aM.useKeymapStore)(a=>a.resetBinding),k=(0,aM.useKeymapStore)(a=>a.resetAll),[m,o]=(0,c.useState)(null),[p,q]=(0,c.useState)(null),r=(0,c.useRef)(null);(0,c.useEffect)(()=>{if(m){let a=requestAnimationFrame(()=>r.current?.focus());return()=>cancelAnimationFrame(a)}},[m]);let s=(0,c.useMemo)(()=>{let a=new Map;for(let b of aK.SHORTCUT_ACTIONS)for(let c of e[b.id]??[...b.defaultKeys])a.has(c)||a.set(c,b.id);return a},[e]),t=(0,c.useMemo)(()=>aO.map(a=>({group:a,actions:aK.SHORTCUT_ACTIONS.filter(b=>b.group===a&&!aP.has(b.id))})).filter(a=>a.actions.length>0),[]),u=m?(0,aK.getAction)(m):null,v=p&&m&&(a=s.get(p))&&a!==m?a:null;function w(){o(null),q(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)(h.Button,{variant:"outline",size:"sm",onClick:function(){k(),g.toast.success(d("settings.shortcuts.resetAllDone"))},children:[(0,b.jsx)(al.RotateCcw,{className:"h-3.5 w-3.5"}),d("settings.shortcuts.resetAll")]})]}),(0,b.jsx)("div",{className:"space-y-6",children:t.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)(aQ,{keys:e[c=a.id]??[...(0,aK.getAction)(c).defaultKeys]}),a.configurable?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>{var b;return b=a.id,void(q(null),o(b))},children:d("settings.shortcuts.rebind")}),f&&(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>j(a.id),children:(0,b.jsx)(al.RotateCcw,{className:"h-3.5 w-3.5"})})}),(0,b.jsx)(ag.TooltipContent,{children:d("settings.shortcuts.reset")})]})]}):(0,b.jsx)(l.Badge,{variant:"outline",className:"text-muted-foreground",children:d("settings.shortcuts.fixed")})]})]},a.id)})})]},a))}),(0,b.jsx)(n.Dialog,{open:null!==m,onOpenChange:a=>!a&&w(),children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-sm",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:u?d(u.descriptionKey):d("settings.shortcuts.rebind")}),(0,b.jsx)(n.DialogDescription,{children:d("settings.shortcuts.pressKey")})]}),(0,b.jsx)("textarea",{ref:r,readOnly:!0,tabIndex:0,"aria-label":d("settings.shortcuts.pressKey"),onKeyDown:a=>{a.preventDefault(),a.stopPropagation();let b=(0,aL.serializeKeyEvent)(a.nativeEvent);b&&q(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:p?(0,b.jsx)(aQ,{keys:[p]}):(0,b.jsx)("span",{className:"text-sm text-muted-foreground",children:d("settings.shortcuts.pressKey")})}),v&&(0,b.jsx)("p",{className:"text-center text-xs text-amber-600 dark:text-amber-400",children:d("settings.shortcuts.conflict",{name:d((0,aK.getAction)(v).descriptionKey)})}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:w,children:d("settings.shortcuts.cancel")}),(0,b.jsx)(h.Button,{variant:"default",onClick:function(){m&&p&&(i(m,[p]),w(),g.toast.success(d("settings.shortcuts.saved")))},disabled:!p,children:d("settings.shortcuts.saveBtn")})]})]})})]})}var aS=a.i(690251),aT=a.i(506913),aU=a.i(344393),aV=a.i(884664),aV=aV,aW=a.i(761818),aW=aW;let aX=(0,r.default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),aY=(0,P.createServerReference)("40ce353f7ed8ef76ed1e60f66cb5d4a20fa8e9b47d",P.callServer,void 0,P.findSourceMapURL,"testHarnessTarget"),aZ=["feishu","openclaw","hermes"],a$={feishu:["feishu"],openclaw:["telegram","signal","whatsapp","discord","slack","imessage"],hermes:["telegram","discord","slack","whatsapp","signal","feishu","wechat","wecom","dingtalk","qq","matrix","email"]},a_=[...new Set(Object.values(a$).flat())],a0="__custom__",a1=a=>a$[a]??[],a2={feishu:"https://open.feishu.cn/",openclaw:"https://docs.openclaw.ai/",hermes:"https://hermes-agent.nousresearch.com/docs/"};function a3(){let{t:a}=(0,f.useI18n)(),[d,e]=(0,c.useState)([]),[j,k]=(0,c.useState)(null),[l,m]=(0,c.useState)(new Set),[n,o]=(0,c.useState)(!0),[p,q]=(0,c.useTransition)(),[r,s]=(0,c.useState)(""),[t,u]=(0,c.useState)(!1),[v,w]=(0,c.useState)(null);(0,c.useEffect)(()=>{(0,M.getConfigValue)("harness.targets",[]).then(a=>{let b=(Array.isArray(a)?a:[]).map(a=>({id:a.id??crypto.randomUUID(),gateway:aZ.includes(a.gateway)?a.gateway:"feishu",downstream:a.downstream??"feishu",active:!!a.active}));b.length>0&&!b.some(a=>a.active)&&(b[0].active=!0),e(b),m(new Set(b.filter(a=>a.downstream&&!a_.includes(a.downstream)).map(a=>a.id)))}).finally(()=>o(!1))},[]);let x=(a,b)=>e(c=>c.map(c=>c.id===a?{...c,...b}:c)),y=a=>{e(b=>{let c=b.find(b=>b.id===a)?.active,d=b.filter(b=>b.id!==a);return c&&d.length>0&&!d.some(a=>a.active)&&(d[0].active=!0),d}),j===a&&k(null)},z=(a,b)=>m(c=>{let d=new Set(c);return b?d.add(a):d.delete(a),d}),B=async()=>{try{await navigator.clipboard.writeText("你有 Playwright(浏览器自动化)能力。帮我在飞书创建一个自建应用(机器人),用于 Tower 的无人值守通知与飞书助理。请一步步来;遇到需要我登录/扫码/人工确认的地方,停下来让我操作,我弄好再继续。\n\n平台地址:公网飞书 https://open.feishu.cn/ (公司/私有化飞书换成你们自己的内网开放平台地址)。用 Playwright 打开它,让我登录(企业管理员或开发者账号)。控制台页面可能有 WAF,但你是真实浏览器,正常访问即可。\n\n步骤:\n1. 创建企业自建应用:名字填「Tower 助理」,随便传个图标。\n2. 开启机器人能力:应用内「添加应用能力」→ 启用「机器人」。(不开这个,机器人进不了群、发不了消息。)\n3. 开通权限(「权限管理」逐个搜索并勾选,名称各版本略有差异,按含义找):\n 必需:im:message(读写单聊/群消息)、im:message.group_msg(读群里全部消息,机器人收到 @ 靠它)、im:chat(获取群信息)、im:chat.members:read(读群成员、识别「谁 @ 我」)。\n 可选:task:task、wiki:wiki:readonly / wiki:node:read / wiki:node:retrieve、docx:document:readonly、drive:drive:readonly(要建飞书待办、读飞书文档/知识库才需要)。\n4. 发布版本:改完权限必须「创建版本 → 申请发布 / 上线」,否则权限不生效(最容易忘的一步)。等发布成功。\n5. 取凭据:到「凭证与基础信息」,复制 App ID(cli_ 开头)和 App Secret;并取机器人自己的 open_id(botOpenId,拿不到就标「待补」)。\n6. 建议新建一个唯一名称的专属群(如「Tower 通知」),把机器人加进去,记下群 id —— 避免同名群/人导致发错。\n7. 把 appId / appSecret / domain 配到飞书 MCP,并在 Tower「设置 → 通知 → 无人值守发送渠道」加一条渠道,点「测试」验证能收到消息。\n\n避坑:① 域名别搞反 —— 公司飞书和公网飞书是两套、凭据不通用;② 只「建了应用」不等于能用,必须开机器人能力 + 发布版本 + 拉进群三样齐;③ 别用 curl 直接抓控制台页面(有 WAF 会 403),用浏览器(Playwright)操作。\n\n(换 OpenClaw / Hermes 等其它网关:参考各自文档 https://docs.openclaw.ai/ · https://hermes-agent.nousresearch.com/docs/ ,拿到 token / webhook 后同样在 Tower 加渠道并测试。)"),g.toast.success(a("settings.harness.copied"))}catch{g.toast.error("复制失败")}},D=async a=>{if(r.trim()){u(!0),w(null);try{let b=await aY({gateway:a.gateway,downstream:a.downstream,dest:r.trim()});w(b)}catch(a){w({ok:!1,output:a instanceof Error?a.message:String(a)})}finally{u(!1)}}},E=b=>a_.includes(b)?a(`settings.harness.ds.${b}`):b,F=({label:a,children:c})=>(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("label",{className:"text-xs text-muted-foreground",children:a}),c]});return(0,b.jsxs)("div",{className:"rounded-xl border bg-card p-4 space-y-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:a("settings.harness.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:a("settings.harness.desc")})]}),(0,b.jsxs)("div",{className:"space-y-2 rounded-lg bg-muted/30 px-3 py-2",children:[(0,b.jsxs)("div",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[(0,b.jsx)(aT.Info,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{children:a("settings.harness.notice")})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 pl-5 text-xs",children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[a("settings.harness.docsLabel"),":"]}),aZ.map(c=>a2[c]?(0,b.jsxs)("a",{href:a2[c],target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-0.5 text-primary hover:underline",children:[a(`settings.harness.gateway.${c}`),(0,b.jsx)(aC.ExternalLink,{className:"h-3 w-3"})]},c):null),(0,b.jsxs)("button",{type:"button",onClick:B,className:"inline-flex items-center gap-1 text-primary hover:underline",children:[(0,b.jsx)(aB.Copy,{className:"h-3 w-3"}),a("settings.harness.copyPrompt")]})]})]}),n&&(0,b.jsx)(G.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"}),(0,b.jsx)("div",{className:"space-y-2",children:d.map(c=>{var d;let f,g=l.has(c.id);return j===c.id?(0,b.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-3 space-y-3",children:[(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,b.jsx)(F,{label:a("settings.harness.gatewayLabel"),children:(0,b.jsxs)(aa.Select,{value:c.gateway,onValueChange:a=>{let b=a??"feishu",d=a1(b);x(c.id,{gateway:b,downstream:d.includes(c.downstream)?c.downstream:d[0]??""}),z(c.id,!1)},children:[(0,b.jsx)(aa.SelectTrigger,{className:"w-full",children:(0,b.jsx)("span",{className:"truncate",children:a(`settings.harness.gateway.${c.gateway}`)})}),(0,b.jsx)(aa.SelectContent,{children:aZ.map(c=>(0,b.jsx)(aa.SelectItem,{value:c,children:a(`settings.harness.gateway.${c}`)},c))})]})}),(0,b.jsx)(F,{label:a("settings.harness.downstreamLabel"),children:(0,b.jsxs)(aa.Select,{value:g?a0:c.downstream,onValueChange:a=>{a===a0?(z(c.id,!0),x(c.id,{downstream:""})):(z(c.id,!1),x(c.id,{downstream:a??""}))},children:[(0,b.jsx)(aa.SelectTrigger,{className:"w-full",children:(0,b.jsx)("span",{className:"truncate",children:g?a("settings.harness.ds.custom"):c.downstream?E(c.downstream):a("settings.harness.downstreamPlaceholder")})}),(0,b.jsxs)(aa.SelectContent,{children:[a1(c.gateway).map(c=>(0,b.jsx)(aa.SelectItem,{value:c,children:a(`settings.harness.ds.${c}`)},c)),"feishu"!==c.gateway&&(0,b.jsx)(aa.SelectItem,{value:a0,children:a("settings.harness.ds.custom")})]})]})})]}),g&&(0,b.jsx)(F,{label:a("settings.harness.customLabel"),children:(0,b.jsx)(i.Input,{value:c.downstream,onChange:a=>x(c.id,{downstream:a.target.value}),placeholder:a("settings.harness.customPlaceholder")})}),(0,b.jsx)(F,{label:a("settings.harness.test"),children:(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{value:r,onChange:a=>s(a.target.value),placeholder:a("settings.harness.testDestPlaceholder"),className:"flex-1"}),(0,b.jsxs)(h.Button,{variant:"outline",onClick:()=>D(c),disabled:t||!r.trim(),children:[t?(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(aU.Send,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:t?a("settings.harness.testing"):a("settings.harness.testSend")})]})]}),v&&(0,b.jsxs)("div",{className:`flex items-start gap-1.5 rounded bg-muted/40 px-2 py-1 text-xs ${v.ok?"text-emerald-500":"text-rose-400"}`,children:[v.ok?(0,b.jsx)(aV.default,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}):(0,b.jsx)(aW.default,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("span",{className:"whitespace-pre-wrap break-words",children:v.ok?a("settings.harness.testOk"):`${a("settings.harness.testFail")}:${v.output}`})]})]})}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,b.jsxs)(h.Button,{onClick:()=>{k(null),w(null)},children:[(0,b.jsx)(az.Check,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:a("settings.harness.done")})]}),(0,b.jsxs)(h.Button,{variant:"ghost",className:"text-muted-foreground",onClick:()=>y(c.id),children:[(0,b.jsx)(C.Trash2,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:a("settings.harness.remove")})]})]})]},c.id):(0,b.jsxs)("div",{className:`flex items-center gap-2.5 rounded-lg border px-3 py-2 ${c.active?"border-primary/40 bg-primary/5":"bg-muted/20"}`,children:[(0,b.jsx)("button",{type:"button",onClick:()=>{let a;return a=c.id,e(b=>b.map(b=>({...b,active:b.id===a})))},title:a("settings.harness.setActive"),className:c.active?"text-primary":"text-muted-foreground hover:text-foreground",children:c.active?(0,b.jsx)(aX,{className:"h-4 w-4"}):(0,b.jsx)(aA,{className:"h-4 w-4"})}),(0,b.jsx)("span",{className:"truncate text-sm text-foreground",children:(d=c,f=a(`settings.harness.gateway.${d.gateway}`),d.downstream?`${f} \xb7 ${E(d.downstream)}`:f)}),c.active&&(0,b.jsx)("span",{className:"shrink-0 rounded-full bg-primary/15 px-2 py-0.5 text-[10px] font-medium text-primary ring-1 ring-primary/25",children:a("settings.harness.active")}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:()=>{k(c.id),w(null),s("")},title:a("settings.harness.edit"),children:(0,b.jsx)(aS.Pencil,{className:"h-4 w-4"})}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:()=>y(c.id),title:a("settings.harness.remove"),children:(0,b.jsx)(C.Trash2,{className:"h-4 w-4"})})]})]},c.id)})}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(h.Button,{variant:"outline",onClick:()=>{let a=crypto.randomUUID();e(b=>[...b,{id:a,gateway:"feishu",downstream:"feishu",active:0===b.length}]),k(a),w(null)},className:"text-muted-foreground",children:[(0,b.jsx)(A.Plus,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:a("settings.harness.addTarget")})]}),(0,b.jsx)(h.Button,{onClick:()=>q(async()=>{await (0,N.setConfigValue)("harness.targets",d),k(null),g.toast.success(a("settings.harness.saved"))}),disabled:p,className:"rounded-lg",children:a("common.save")})]})]})}function a4({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,o.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 a5({label:a,description:c,children:d,className:e}){return(0,b.jsxs)("div",{className:(0,o.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 a6=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:q.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:s,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:t.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:u,accent:"amber"},{id:"extensions",labelKey:"settings.extensions.title",descKey:"settings.extensions.navDesc",icon:x.Package,accent:"indigo"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:v.Bell,accent:"rose"},{id:"backup",labelKey:"settings.backup.title",descKey:"settings.backup.navDesc",icon:w.HardDrive,accent:"cyan"},{id:"keyboard-shortcuts",labelKey:"settings.keyboardShortcuts",descKey:"settings.keyboardShortcutsDesc",icon:y.Keyboard,accent:"violet"}],a7={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"}},a8="ai-manager:default-cli-adapter",a9={host:"",ownerMatch:"*",localPathTemplate:"",priority:0},ba=a=>a.replace(/\\/g,"/").replace(/\/+$/,"");function bb(){let a=(0,d.useRouter)(),{t:q}=(0,f.useI18n)(),{theme:r,setTheme:s}=(0,e.useTheme)(),{locale:t,setLocale:u}=(0,f.useI18n)(),[v,w]=(0,c.useState)("general"),x=(0,c.useRef)(null),[y,P]=(0,c.useState)({left:0,width:0}),[$,_]=(0,c.useState)(!1),[aa,ab]=(0,c.useState)("Terminal"),[ac,ad]=(0,c.useState)([]),[ae,ai]=(0,c.useState)(""),[aj,ak]=(0,c.useState)([]),[al,am]=(0,c.useState)(13),[an,ao]=(0,c.useState)("Menlo, Monaco, 'Courier New', monospace"),[ap,aq]=(0,c.useState)([]),[ar,as]=(0,c.useState)("claude"),[at,au]=(0,c.useState)(null),[av,aw]=(0,c.useState)({}),[ay,az]=(0,c.useState)([]),[aA,aB]=(0,c.useState)(!1),[aC,aD]=(0,c.useState)(null),[aE,aF]=(0,c.useState)(null),[aG,aH]=(0,c.useState)(""),[aI,aK]=(0,c.useState)(""),[aL,aM]=(0,c.useState)(""),[aN,aO]=(0,c.useState)(null),[aP,aQ]=(0,c.useState)(""),[aS,aT]=(0,c.useState)(!1),[aU,aV]=(0,c.useState)(!1),[aW,aX]=(0,c.useState)(!1),[aY,aZ]=(0,c.useState)([]),[a$,a_]=(0,c.useState)(null),[a0,a1]=(0,c.useState)({...a9}),[a2,bb]=(0,c.useState)(!1),[bc,bd]=(0,c.useState)({...a9}),[be,bf]=(0,c.useState)(!1),[bg,bh]=(0,c.useState)(!1),[bi,bj]=(0,c.useState)(0),[bk,bl]=(0,c.useState)(null),[bm,bn]=(0,c.useState)(null),[bo,bp]=(0,c.useState)({maxUploadMb:50,maxConcurrent:3,maxReadableMb:5,archiveDelayDays:7,taskDefaultUseWorktree:!0,taskDefaultAutoStart:!1}),[bq,br]=(0,c.useState)({timeoutSec:30}),[bs,bt]=(0,c.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80,codeTimeoutSec:30}),[bu,bv]=(0,c.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[bw,bx]=(0,c.useState)(null),[by,bz]=(0,c.useState)(!1),[bA,bB]=(0,c.useState)(""),[bC,bD]=(0,c.useState)(!0);(0,c.useEffect)(()=>_(!0),[]),(0,c.useEffect)(()=>{(0,M.getConfigValue)("terminal.app","Terminal").then(ab),Q().then(ad),(0,M.getConfigValue)("editor.command","").then(ai),R().then(ak),(0,M.getConfigValue)("terminal.fontSize",13).then(am),(0,M.getConfigValue)("terminal.fontFamily","Menlo, Monaco, 'Courier New', monospace").then(ao)},[]),(0,c.useEffect)(()=>{if(0===ac.length||!aa||ac.some(a=>a.value===aa))return;let a=ac.find(a=>a.name===aa);a&&(ab(a.value),(0,N.setConfigValue)("terminal.app",a.value))},[ac,aa]),(0,c.useEffect)(()=>{if(0===aj.length||!ae||aj.some(a=>a.command===ae))return;let a=aj.find(a=>a.name===ae);a&&(ai(a.command),(0,N.setConfigValue)("editor.command",a.command))},[aj,ae]),(0,c.useEffect)(()=>{Z().then(aq);let a=localStorage.getItem(a8);a&&as(a)},[]),(0,c.useEffect)(()=>{(0,S.getPrompts)().then(az)},[]),(0,c.useEffect)(()=>{W().then(a=>{aO(a),aQ(a.systemDirective)})},[]);let bE=async()=>{try{let a=await fetch("/api/internal/hooks/install");if(a.ok){let b=await a.json();bx(b)}}catch{}};async function bF(a){if(!at){au(a),aw(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();aw(b=>({...b,[a]:c}))}catch{aw(b=>({...b,[a]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{au(null)}}}(0,c.useEffect)(()=>{(0,M.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});aZ(d),c&&(0,N.setConfigValue)("git.pathMappingRules",d)}),(0,M.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(a=>{bB(a.join(", "))}),bE(),(0,O.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;bp({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"]}),br({timeoutSec:a["git.timeoutSec"]??30}),bt({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}),bv({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,M.getConfigValue)("notification.enabled",!0).then(bD)},[]);let bG=(0,c.useCallback)(()=>{aD(null),aH(""),aK(""),aM(""),aB(!0)},[]),bH=(0,c.useCallback)(a=>{aD(a),aH(a.name),aK(a.description??""),aM(a.content),aB(!0)},[]),bI=(0,c.useCallback)(async()=>{aG.trim()&&aL.trim()&&(aC?await U(aC.id,{name:aG.trim(),description:aI.trim()||void 0,content:aL.trim()}):await T({name:aG.trim(),description:aI.trim()||void 0,content:aL.trim()}),aB(!1),az(await (0,S.getPrompts)()),a.refresh())},[aG,aI,aL,aC,a]),bJ=(0,c.useCallback)(async()=>{aE&&(await V(aE),aF(null),az(await (0,S.getPrompts)()),a.refresh())},[aE,a]),bK=(0,c.useCallback)(async()=>{aT(!0);try{await X(aP);let a=await W();aO(a),aQ(a.systemDirective),aV(!1),g.toast.success(q("settings.prompts.builtin.saved"))}finally{aT(!1)}},[aP,q]),bL=(0,c.useCallback)(async()=>{aT(!0);try{let a=await Y(),b=await W();aO(b),aQ(a),g.toast.info(q("settings.prompts.builtin.resetDone"))}finally{aT(!1)}},[q]),bM=async()=>{await (0,N.setConfigValue)("system.maxUploadBytes",1024*bo.maxUploadMb*1024),await (0,N.setConfigValue)("system.maxConcurrentExecutions",bo.maxConcurrent),await (0,N.setConfigValue)("system.maxReadableFileBytes",1024*bo.maxReadableMb*1024),await (0,N.setConfigValue)("board.archiveDelayDays",bo.archiveDelayDays)},bN=async()=>{await (0,N.setConfigValue)("task.defaultUseWorktree",bo.taskDefaultUseWorktree),await (0,N.setConfigValue)("task.defaultAutoStart",bo.taskDefaultAutoStart),await (0,N.setConfigValue)("task.mcpDefaultsConfigured",!0)},bO=async()=>{await (0,N.setConfigValue)("git.timeoutSec",bq.timeoutSec)},bP=async()=>{await (0,N.setConfigValue)("search.resultLimit",bs.resultLimit),await (0,N.setConfigValue)("search.allModeCap",bs.allModeCap),await (0,N.setConfigValue)("search.debounceMs",bs.debounceMs),await (0,N.setConfigValue)("search.snippetLength",bs.snippetLength),await (0,N.setConfigValue)("search.codeTimeoutSec",bs.codeTimeoutSec)},bQ=async()=>{let a=Math.min(bu.minCols,bu.maxCols),b=Math.max(bu.minCols,bu.maxCols),c=Math.min(bu.minRows,bu.maxRows),d=Math.max(bu.minRows,bu.maxRows);bv({minCols:a,maxCols:b,minRows:c,maxRows:d}),await (0,N.setConfigValue)("missions.grid.minCols",a),await (0,N.setConfigValue)("missions.grid.maxCols",b),await (0,N.setConfigValue)("missions.grid.minRows",c),await (0,N.setConfigValue)("missions.grid.maxRows",d)},bR=async()=>{let a=bA.split(",").map(a=>a.trim()).filter(Boolean);await (0,N.setConfigValue)("hooks.autoUploadTypes",a)},bS=async()=>{if(bw){bz(!0);try{let a=bw.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:a}),await bE()}finally{bz(!1)}}},bT=async()=>{if(!bc.host.trim()||!bc.localPathTemplate.trim())return;let a=ba(bc.localPathTemplate.trim()),b=be?`${a}/{path}`:a,c=[...aY,{id:crypto.randomUUID(),host:bc.host.trim(),ownerMatch:bc.ownerMatch.trim()||"*",localPathTemplate:b,priority:bc.priority}];await (0,N.setConfigValue)("git.pathMappingRules",c),aZ(c),bd({...a9}),bf(!1),bb(!1)},bU=async a=>{if(!a0.host.trim()||!a0.localPathTemplate.trim())return;let b=ba(a0.localPathTemplate.trim()),c=bg?`${b}/{path}`:b,d=aY.map(b=>b.id===a?{...b,host:a0.host.trim(),ownerMatch:a0.ownerMatch.trim()||"*",localPathTemplate:c,priority:a0.priority}:b);await (0,N.setConfigValue)("git.pathMappingRules",d),aZ(d),a_(null),bh(!1)},bV=async a=>{let b=aY.filter(b=>b.id!==a);await (0,N.setConfigValue)("git.pathMappingRules",b),aZ(b),bl(null)};async function bW(){let a=!bC;bD(a),await (0,N.setConfigValue)("notification.enabled",a)}let bX=(0,c.useCallback)(()=>{a.back()},[a]),bY=(0,c.useCallback)(a=>{let b=x.current;if(!b)return;let c=b.querySelector("[data-section]"),d=c?c.offsetWidth+4:140;b.scrollBy({left:"left"===a?-d:d,behavior:"smooth"})},[]);(0,c.useEffect)(()=>{let a=x.current;if(!a)return;let b=a.querySelector(`[data-section="${v}"]`);if(!b)return;let c=a.getBoundingClientRect(),d=b.getBoundingClientRect();P({left:d.left-c.left,width:d.width})},[v]);let{canScrollLeft:bZ,canScrollRight:b$}=(0,p.useScrollOverflow)(x,[t]),b_=a6.find(a=>a.id===v),b0=b_?a7[b_.accent]:a7.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:q("settings.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:q("settings.configDesc")})]}),(0,b.jsxs)(h.Button,{variant:"outline",onClick:bX,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,b.jsx)(z.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,b.jsxs)("div",{className:"relative flex items-center gap-1",children:[bZ&&(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bY("left"),className:"shrink-0","aria-label":"scroll tabs left",children:(0,b.jsx)(K.ChevronLeft,{className:"h-4 w-4"})}),(0,b.jsxs)("div",{ref:x,className:"relative flex flex-1 gap-1 overflow-x-auto [&::-webkit-scrollbar]:hidden",children:[a6.map(a=>{let c=a.icon,d=v===a.id,e=a7[a.accent];return(0,b.jsxs)("button",{"data-section":a.id,onClick:()=>w(a.id),className:(0,o.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,o.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:q(a.labelKey)})]},a.id)}),(0,b.jsx)("div",{className:(0,o.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",b0.indicator),style:{left:y.left,width:y.width}})]}),b$&&(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bY("right"),className:"shrink-0","aria-label":"scroll tabs right",children:(0,b.jsx)(L.ChevronRight,{className:"h-4 w-4"})})]})]})}),(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:[b_&&(0,b.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,b.jsx)("div",{className:(0,o.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",b0.bg,b0.text,b0.ring),children:(0,b.jsx)(b_.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:q(b_.labelKey)}),(0,b.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:q(b_.descKey)})]})]}),(0,b.jsx)("div",{className:"mb-6 border-t"}),function(){switch(v){case"general":let a;return a=[{value:"light",label:q("settings.themeLight")},{value:"dark",label:q("settings.themeDark")},{value:"system",label:q("settings.themeSystem")}],(0,b.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,b.jsx)(a5,{label:q("settings.theme"),description:q("settings.themeDesc"),children:$?(0,b.jsx)(a4,{options:a,value:r??"system",onChange:a=>s(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)(a5,{label:q("settings.language"),description:q("settings.languageDesc"),children:(0,b.jsx)(a4,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:t,onChange:a=>u(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:q("settings.terminal.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:q("settings.terminal.desc")})]}),ac.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:ac.map(a=>{let c=aa===a.value,d=(0,o.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&&(ab(a.value),(0,N.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)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(ag.TooltipContent,{side:"top",children:q("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:q("settings.terminalFont.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:q("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:[q("settings.terminalFont.size"),(0,b.jsx)("input",{type:"number",min:8,max:40,value:al,onChange:a=>{let b=Math.max(8,Math.min(40,Math.round(Number(a.target.value)||13)));am(b),(0,N.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:[q("settings.terminalFont.family"),(0,b.jsx)("input",{type:"text",value:an,placeholder:"Menlo, Monaco, 'Courier New', monospace",onChange:a=>ao(a.target.value),onBlur:a=>{let b=a.target.value.trim()||"Menlo, Monaco, 'Courier New', monospace";ao(b),(0,N.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:q("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:q("settings.editor.label")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:q("settings.editor.desc")})]}),aj.length>0&&(0,b.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:aj.map(a=>{let c=ae===a.command,d=(0,o.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&&(ai(a.command),(0,N.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)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)("button",{type:"button",onClick:e,className:d,children:a.name})}),(0,b.jsx)(ag.TooltipContent,{side:"top",children:q("settings.app.notInstalled")})]},a.command)})})]})]});case"ai-tools":return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ap.map(a=>{let c=ar===a.name,d=at===a.name,e=av[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)(l.Badge,{variant:"outline",children:q("label.builtin")}),c&&(0,b.jsxs)(l.Badge,{variant:"secondary",className:"shrink-0",children:[(0,b.jsx)(B,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),q("settings.prompts.default")]}),e&&(0,b.jsx)(l.Badge,{variant:e.ok?"secondary":"destructive",className:(0,o.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)(H.CheckCircle2,{className:"h-3 w-3 mr-1"}),q("settings.aiTools.testPassed")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(I.XCircle,{className:"h-3 w-3 mr-1"}),q("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)(h.Button,{variant:"outline",size:"sm",onClick:()=>{var b;as(b=a.name),localStorage.setItem(a8,b)},children:[(0,b.jsx)(B,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),q("settings.prompts.setDefault")]}),(0,b.jsx)(h.Button,{variant:"outline",size:"sm",onClick:()=>bF(a.name),disabled:d,children:d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),q("settings.aiTools.testing")]}):q("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,o.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,o.cn)(c.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:c.message})]},`${a.name}-${c.name}`))})})]})},a.name)})}),(0,b.jsx)(af,{})]});case"prompts":return $?(0,b.jsxs)("div",{className:"space-y-4",children:[aN&&(0,b.jsxs)("div",{className:"space-y-4 rounded-xl border border-border/50 bg-card p-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:q("settings.prompts.builtin.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("settings.prompts.builtin.desc")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.Label,{className:"text-sm",children:q("settings.prompts.builtin.systemTitle")}),aN.systemDirectiveIsCustom&&(0,b.jsx)(l.Badge,{variant:"secondary",className:"rounded-full text-xs",children:q("settings.prompts.builtin.modified")})]}),(0,b.jsxs)(h.Button,{variant:"outline",onClick:()=>{aQ(aN.systemDirective),aV(!0)},children:[(0,b.jsx)(D,{className:"h-4 w-4"}),q("settings.prompts.builtin.edit")]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.prompts.builtin.systemDesc")}),(0,b.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3",children:(0,b.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:aN.systemDirective})})]}),(0,b.jsxs)("div",{className:"space-y-2 border-t border-border/50 pt-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(k.Label,{className:"text-sm",children:q("settings.prompts.builtin.childTitle")}),(0,b.jsx)(l.Badge,{variant:"outline",className:"rounded-full text-xs",children:q("settings.prompts.builtin.readonly")})]}),(0,b.jsxs)(h.Button,{variant:"outline",onClick:()=>aX(!0),children:[(0,b.jsx)(E.Eye,{className:"h-4 w-4"}),q("settings.prompts.builtin.view")]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.prompts.builtin.childDesc")}),(0,b.jsx)("div",{className:"rounded-lg border border-border/50 bg-muted/30 p-3",children:(0,b.jsx)("p",{className:"line-clamp-3 whitespace-pre-wrap break-words font-mono text-xs text-muted-foreground",children:aN.childReviewPrompt})})]})]}),(0,b.jsxs)("div",{className:"rounded-xl border border-border/50 bg-card p-4 space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"text-sm font-medium",children:q("settings.prompts.custom.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("settings.prompts.custom.desc")})]}),(0,b.jsxs)(h.Button,{onClick:bG,variant:"default",className:"shrink-0",children:[(0,b.jsx)(A.Plus,{className:"h-4 w-4 mr-2"}),q("settings.prompts.newPrompt")]})]}),0===ay.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:q("settings.prompts.empty")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:q("settings.prompts.emptyHint")})]}):(0,b.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ay.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.jsx)("h4",{className:"text-sm font-medium truncate",children:a.name}),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)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bH(a),title:q("settings.prompts.editPrompt"),children:(0,b.jsx)(D,{className:"h-4 w-4"})}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>aF(a.id),className:"text-destructive",title:q("settings.prompts.delete"),children:(0,b.jsx)(C.Trash2,{className:"h-4 w-4"})})]})]},a.id))})]}),(0,b.jsx)(n.Dialog,{open:aU,onOpenChange:aV,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:q("settings.prompts.builtin.systemTitle")}),(0,b.jsx)(n.DialogDescription,{children:q("settings.prompts.builtin.systemDesc")})]}),(0,b.jsx)(j.Textarea,{value:aP,onChange:a=>aQ(a.target.value),className:"max-h-[60vh] min-h-[50vh] font-mono text-xs"}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:bL,disabled:aS||!aN?.systemDirectiveIsCustom,children:q("settings.prompts.builtin.resetDefault")}),(0,b.jsx)(h.Button,{variant:"default",onClick:bK,disabled:aS||aP===aN?.systemDirective,children:q("settings.prompts.save")})]})]})}),(0,b.jsx)(n.Dialog,{open:aW,onOpenChange:aX,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:q("settings.prompts.builtin.childTitle")}),(0,b.jsx)(n.DialogDescription,{children:q("settings.prompts.builtin.childDesc")})]}),(0,b.jsx)(j.Textarea,{value:aN?.childReviewPrompt??"",readOnly:!0,className:"max-h-[60vh] min-h-[50vh] font-mono text-xs bg-muted/40 cursor-default"}),(0,b.jsx)(n.DialogFooter,{children:(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>aX(!1),children:q("settings.prompts.close")})})]})}),(0,b.jsx)(n.Dialog,{open:aA,onOpenChange:aB,children:(0,b.jsxs)(n.DialogContent,{className:"sm:max-w-3xl max-h-[90vh] overflow-y-auto",children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:aC?q("settings.prompts.editPrompt"):q("settings.prompts.newPrompt")}),(0,b.jsx)(n.DialogDescription,{children:aC?q("settings.prompts.editPrompt"):q("settings.prompts.newPrompt")})]}),(0,b.jsxs)("div",{className:"space-y-4 py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(k.Label,{htmlFor:"prompt-name",children:q("settings.prompts.promptName")}),(0,b.jsx)(i.Input,{id:"prompt-name",value:aG,onChange:a=>aH(a.target.value),placeholder:q("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(k.Label,{htmlFor:"prompt-description",children:q("settings.prompts.promptDescription")}),(0,b.jsx)(i.Input,{id:"prompt-description",value:aI,onChange:a=>aK(a.target.value),placeholder:q("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(k.Label,{htmlFor:"prompt-content",children:q("settings.prompts.promptContent")}),(0,b.jsx)(j.Textarea,{id:"prompt-content",value:aL,onChange:a=>aM(a.target.value),placeholder:q("settings.prompts.promptContentPlaceholder"),className:"mt-1.5 max-h-[55vh] min-h-[40vh] font-mono text-sm"})]})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>aB(!1),children:q("settings.prompts.cancel")}),(0,b.jsx)(h.Button,{onClick:bI,disabled:!aG.trim()||!aL.trim(),children:q("settings.prompts.save")})]})]})}),(0,b.jsx)(n.Dialog,{open:!!aE,onOpenChange:a=>!a&&aF(null),children:(0,b.jsxs)(n.DialogContent,{children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:q("settings.prompts.deleteConfirmTitle")}),(0,b.jsx)(n.DialogDescription,{children:q("settings.prompts.deleteConfirmMessage")})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>aF(null),children:q("settings.prompts.cancel")}),(0,b.jsx)(h.Button,{variant:"destructive",onClick:bJ,children:q("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:q("settings.config.git.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("settings.config.git.desc")})]}),(0,b.jsxs)(h.Button,{onClick:()=>{bd({...a9}),bb(!0)},children:[(0,b.jsx)(A.Plus,{className:"mr-2 h-4 w-4"}),q("settings.config.git.addRule")]})]}),(0,b.jsxs)("div",{className:"space-y-3",children:[0!==aY.length||a2?(0,b.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:aY.map(a=>a$===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:q("settings.config.git.host")}),(0,b.jsx)(i.Input,{value:a0.host,onChange:a=>a1(b=>({...b,host:a.target.value})),placeholder:q("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:q("settings.config.git.ownerMatch")}),(0,b.jsx)(i.Input,{value:a0.ownerMatch,onChange:a=>a1(b=>({...b,ownerMatch:a.target.value})),placeholder:q("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:q("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{value:a0.localPathTemplate,onChange:a=>a1(b=>({...b,localPathTemplate:a.target.value})),placeholder:q("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:bg?"default":"outline",size:"sm",type:"button",onClick:()=>bh(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(ag.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:q("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:q("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>bn("edit"),children:(0,b.jsx)(J.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(ag.TooltipContent,{children:q("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:bg?q("onboarding.step3.pathHintFull"):q("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:q("settings.config.git.priority")}),(0,b.jsx)(i.Input,{type:"number",value:a0.priority,onChange:a=>a1(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)(h.Button,{variant:"ghost",size:"sm",onClick:()=>{a_(null),bh(!1)},children:q("settings.config.git.cancel")}),(0,b.jsx)(h.Button,{size:"sm",onClick:()=>bU(a.id),children:q("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)(l.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[q("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)(h.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(a_(a.id),a1({host:a.host,ownerMatch:a.ownerMatch,localPathTemplate:d,priority:a.priority}),bh(c))},title:q("settings.config.git.edit"),children:(0,b.jsx)(D,{className:"h-4 w-4"})}),(0,b.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>bl(a.id),className:"text-destructive",title:q("settings.config.git.delete"),children:(0,b.jsx)(C.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:q("settings.config.git.noRules")}),(0,b.jsx)("p",{className:"mt-1.5 text-xs text-muted-foreground/80",children:q("settings.config.git.noRulesFallback")})]}),a2&&(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:q("settings.config.git.host")}),(0,b.jsx)(i.Input,{value:bc.host,onChange:a=>bd(b=>({...b,host:a.target.value})),placeholder:q("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:q("settings.config.git.ownerMatch")}),(0,b.jsx)(i.Input,{value:bc.ownerMatch,onChange:a=>bd(b=>({...b,ownerMatch:a.target.value})),placeholder:q("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:q("settings.config.git.localPathTemplate")}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{value:bc.localPathTemplate,onChange:a=>bd(b=>({...b,localPathTemplate:a.target.value})),placeholder:q("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:be?"default":"outline",size:"sm",type:"button",onClick:()=>bf(a=>!a),className:"shrink-0 font-mono",children:"{path}"})}),(0,b.jsx)(ag.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:q("settings.config.git.pathTooltipTitle")}),(0,b.jsx)("div",{className:"opacity-80",children:q("settings.config.git.pathTooltipDetail")})]})})]}),(0,b.jsxs)(ag.Tooltip,{children:[(0,b.jsx)(ag.TooltipTrigger,{render:(0,b.jsx)(h.Button,{variant:"outline",size:"icon",type:"button",onClick:()=>bn("add"),children:(0,b.jsx)(J.FolderOpen,{className:"h-4 w-4"})})}),(0,b.jsx)(ag.TooltipContent,{children:q("settings.config.git.pickFolder")})]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:be?q("onboarding.step3.pathHintFull"):q("onboarding.step3.pathHintRepo")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)("label",{className:"block text-xs font-medium",children:q("settings.config.git.priority")}),(0,b.jsx)(i.Input,{type:"number",value:bc.priority,onChange:a=>bd(b=>({...b,priority:Number(a.target.value)})),className:"text-sm w-24"})]}),bc.localPathTemplate&&(c=bc.localPathTemplate.trim().replace(/\/+$/,""),d=be?`${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:q("onboarding.step3.previewLabel")}),(0,b.jsx)("div",{className:"flex gap-1",children:e.map((a,c)=>(0,b.jsx)("button",{type:"button",onClick:()=>bj(c),className:(0,o.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",bi===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[bi].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[bi].url)})]})]})]})),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(h.Button,{variant:"ghost",size:"sm",onClick:()=>bb(!1),children:q("settings.config.git.cancel")}),(0,b.jsxs)(h.Button,{size:"sm",onClick:bT,disabled:!bc.host.trim()||!bc.localPathTemplate.trim(),children:[(0,b.jsx)(F,{className:"h-3.5 w-3.5 mr-1.5"}),q("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:q("settings.config.system.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.system.maxUpload")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.maxUploadHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:1,max:500,value:bo.maxUploadMb,onChange:a=>bp(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:q("settings.config.system.maxConcurrent")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.maxConcurrentHint")})]}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bo.maxConcurrent,onChange:a=>bp(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:q("settings.config.system.maxReadable")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.maxReadableHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:1,max:50,value:bo.maxReadableMb,onChange:a=>bp(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:q("settings.config.system.archiveDelay")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.archiveDelayHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:1,max:365,value:bo.archiveDelayDays,onChange:a=>bp(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:q("settings.config.system.archiveDelayUnit")})]})]})]}),(0,b.jsx)(h.Button,{onClick:bM,className:"rounded-lg",children:q("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:q("settings.config.task.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.system.taskDefaultWorktree")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.taskDefaultWorktreeHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>bp(a=>({...a,taskDefaultUseWorktree:!a.taskDefaultUseWorktree})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${bo.taskDefaultUseWorktree?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:bo.taskDefaultUseWorktree?q("task.worktreeYes"):q("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:q("settings.config.system.taskDefaultAutoStart")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.system.taskDefaultAutoStartHint")})]}),(0,b.jsx)("button",{type:"button",onClick:()=>bp(a=>({...a,taskDefaultAutoStart:!a.taskDefaultAutoStart})),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${bo.taskDefaultAutoStart?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:bo.taskDefaultAutoStart?q("task.autoStartYes"):q("task.autoStartNo")})]})]}),(0,b.jsx)(h.Button,{onClick:bN,className:"rounded-lg",children:q("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:q("settings.config.gitParams.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.gitParams.timeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.gitParams.timeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:5,max:300,value:bq.timeoutSec,onChange:a=>br(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)(h.Button,{onClick:bO,className:"rounded-lg",children:q("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:q("settings.config.search.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.search.resultLimit")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.resultLimitHint")})]}),(0,b.jsx)(i.Input,{type:"number",min:5,max:100,value:bs.resultLimit,onChange:a=>bt(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:q("settings.config.search.allModeCap")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.allModeCapHint")})]}),(0,b.jsx)(i.Input,{type:"number",min:1,max:20,value:bs.allModeCap,onChange:a=>bt(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:q("settings.config.search.debounceMs")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.debounceMsHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:50,max:1e3,value:bs.debounceMs,onChange:a=>bt(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:q("settings.config.search.snippetLength")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.snippetLengthHint")})]}),(0,b.jsx)(i.Input,{type:"number",min:20,max:500,value:bs.snippetLength,onChange:a=>bt(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:q("settings.config.search.codeTimeout")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.search.codeTimeoutHint")})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(i.Input,{type:"number",min:5,max:300,step:5,value:bs.codeTimeoutSec,onChange:a=>bt(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)(h.Button,{onClick:bP,className:"rounded-lg",children:q("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:q("settings.config.missions.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.missions.minCols")}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bu.minCols,onChange:a=>bv(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:q("settings.config.missions.maxCols")}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bu.maxCols,onChange:a=>bv(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:q("settings.config.missions.minRows")}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bu.minRows,onChange:a=>bv(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:q("settings.config.missions.maxRows")}),(0,b.jsx)(i.Input,{type:"number",min:1,max:10,value:bu.maxRows,onChange:a=>bv(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)(h.Button,{onClick:bQ,className:"rounded-lg",children:q("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:q("settings.config.hooks.title")}),(0,b.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:q("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:q("settings.config.hooks.autoUploadTypes")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.hooks.autoUploadTypesHint")})]}),(0,b.jsx)(i.Input,{value:bA,onChange:a=>bB(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)(h.Button,{onClick:bR,className:"rounded-lg",children:q("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:bw?.installed?q("settings.config.hooks.installed"):q("settings.config.hooks.notInstalled")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:q("settings.config.hooks.installHint")})]}),(0,b.jsx)(h.Button,{variant:bw?.installed?"destructive":"default",onClick:bS,disabled:by||!bw,className:"rounded-lg",children:bw?.installed?q("settings.config.hooks.uninstall"):q("settings.config.hooks.install")})]})]}),(0,b.jsx)(n.Dialog,{open:!!bk,onOpenChange:a=>!a&&bl(null),children:(0,b.jsxs)(n.DialogContent,{children:[(0,b.jsxs)(n.DialogHeader,{children:[(0,b.jsx)(n.DialogTitle,{children:q("settings.config.git.deleteConfirm")}),(0,b.jsx)(n.DialogDescription,{children:q("settings.config.git.deleteConfirmMessage")})]}),(0,b.jsxs)(n.DialogFooter,{children:[(0,b.jsx)(h.Button,{variant:"outline",onClick:()=>bl(null),children:q("settings.config.git.cancel")}),(0,b.jsx)(h.Button,{variant:"destructive",onClick:()=>bk&&bV(bk),children:q("settings.config.git.delete")})]})]})})]});case"notifications":return(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"rounded-xl border bg-card p-4 space-y-3",children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:q("settings.notifications.systemCategory")}),(0,b.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("div",{className:"text-sm font-medium",children:q("settings.notifications.enable")}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:q("settings.notifications.enableDesc")})]}),(0,b.jsx)(m.Switch,{checked:bC,onCheckedChange:bW})]})]}),(0,b.jsx)(a3,{})]});case"backup":return(0,b.jsx)(ax,{});case"extensions":return(0,b.jsx)(aJ,{});case"keyboard-shortcuts":return(0,b.jsx)(aR,{})}}()]})}),(0,b.jsx)(ah.FolderBrowserDialog,{open:null!==bm,onOpenChange:a=>{a||bn(null)},onSelect:a=>{let b=ba(a);"add"===bm?bd(a=>({...a,localPathTemplate:b})):"edit"===bm&&a1(a=>({...a,localPathTemplate:b})),bn(null)}})]})}a.s(["default",0,function(){return(0,b.jsx)(bb,{})}],520788)}];
|
|
2
2
|
|
|
3
3
|
//# sourceMappingURL=src_app_settings_page_tsx_0h9v7dr._.js.map
|