tower-studio 0.1.18 → 0.1.20
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/BUILD_ID +1 -1
- package/.next/build-manifest.json +3 -3
- package/.next/cache/.previewinfo +1 -1
- package/.next/cache/.rscinfo +1 -1
- package/.next/cache/.tsbuildinfo +1 -1
- package/.next/diagnostics/route-bundle-stats.json +37 -37
- package/.next/fallback-build-manifest.json +3 -3
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/_not-found/page/server-reference-manifest.json +25 -25
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +13 -13
- package/.next/server/app/_not-found.segments/_full.segment.rsc +13 -13
- package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/server/app/_not-found.segments/_index.segment.rsc +8 -8
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/api/files/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assets/[projectId]/[filename]/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assets/reveal/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assistant/images/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/assistant/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/cache/[...segments]/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/hooks/upload/route.js.nft.json +1 -1
- package/.next/server/app/api/internal/terminal/[taskId]/start/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/[taskId]/merge/route.js.nft.json +1 -1
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +13 -13
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +13 -13
- package/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/server/app/index.segments/_index.segment.rsc +8 -8
- package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/missions/page/server-reference-manifest.json +47 -47
- package/.next/server/app/missions/page.js +2 -2
- package/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/onboarding/page/server-reference-manifest.json +25 -25
- package/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/server/app/onboarding.html +1 -1
- package/.next/server/app/onboarding.rsc +15 -15
- package/.next/server/app/onboarding.segments/_full.segment.rsc +15 -15
- package/.next/server/app/onboarding.segments/_head.segment.rsc +4 -4
- package/.next/server/app/onboarding.segments/_index.segment.rsc +8 -8
- package/.next/server/app/onboarding.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/onboarding.segments/onboarding/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/onboarding.segments/onboarding.segment.rsc +3 -3
- package/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/page/server-reference-manifest.json +25 -25
- package/.next/server/app/page.js.nft.json +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/settings/page/server-reference-manifest.json +32 -32
- package/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +15 -15
- package/.next/server/app/settings.segments/_full.segment.rsc +15 -15
- package/.next/server/app/settings.segments/_head.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_index.segment.rsc +8 -8
- package/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +4 -4
- package/.next/server/app/settings.segments/settings.segment.rsc +3 -3
- package/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +71 -71
- package/.next/server/app/workspaces/[workspaceId]/archive/page.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +68 -68
- package/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +61 -61
- package/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +53 -53
- package/.next/server/app/workspaces/[workspaceId]/page.js +2 -2
- package/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +58 -58
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
- package/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
- package/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/server/chunks/0uz~_next_dist_esm_build_templates_app-route_05yec2y.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__00~8_qz._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__05mc_xk._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0bvqbq0._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0p5iuez._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0rb-ear._.js +2 -2
- package/.next/server/chunks/[root-of-the-server]__0u4~z7h._.js +1 -1
- package/.next/server/chunks/[root-of-the-server]__0ze75mm._.js +1 -1
- package/.next/server/chunks/project_f_tower_0n1s3ym._.js +1 -1
- package/.next/server/chunks/project_f_tower_src_11e.cv5._.js +1 -1
- package/.next/server/chunks/project_f_tower_src_lib_10p8sue._.js +1 -1
- package/.next/server/chunks/ssr/04uy_src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_01.s1p0._.js +1 -1
- package/.next/server/chunks/ssr/0y0r_f_tower_src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0n4g3bn._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__06qzctf._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0_47k-j._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0aidehy._.js +1 -1
- package/.next/server/chunks/ssr/{[root-of-the-server]__00_.ri0._.js → [root-of-the-server]__0e6iflg._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0ffdrwp._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0hiekzn._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0i4rk9v._.js +3 -3
- package/.next/server/chunks/ssr/[root-of-the-server]__0o7o7z_._.js +3 -0
- package/.next/server/chunks/ssr/{[root-of-the-server]__0jpbiq_._.js → [root-of-the-server]__0uu_6~5._.js} +2 -2
- package/.next/server/chunks/ssr/[root-of-the-server]__0w7gbe7._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__0zaw-fl._.js +1 -1
- package/.next/server/chunks/ssr/[root-of-the-server]__13eo85g._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0.txwd8._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_09re1~6._.js → project_f_tower_07-hbsx._.js} +2 -2
- package/.next/server/chunks/ssr/{project_f_tower_13hdtgf._.js → project_f_tower_0866f0-._.js} +2 -2
- package/.next/server/chunks/ssr/{project_f_tower_006ysi2._.js → project_f_tower_0ad9933._.js} +2 -2
- package/.next/server/chunks/ssr/{project_f_tower_0m76uwh._.js → project_f_tower_0bd-exe._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_0cxt-u.._.js +3 -0
- package/.next/server/chunks/ssr/project_f_tower_0f0-wva._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0hgtev9._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0ivvjwd._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0jy~1uf._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0l6ssf8._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0o5.y1e._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0w01kgd._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_0ym-aea._.js +1 -1
- package/.next/server/chunks/ssr/{project_f_tower_0vfw8sn._.js → project_f_tower_0~41x_-._.js} +2 -2
- package/.next/server/chunks/ssr/{project_f_tower_src_13jw2_q._.js → project_f_tower_src_0p8gi_2._.js} +2 -2
- package/.next/server/chunks/ssr/project_f_tower_src_actions_agent-actions_ts_0.s4~m-._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_actions_file-actions_ts_02i742t._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_missions_missions-client_tsx_0ums4qx._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_onboarding_page_tsx_0_9_yoq._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_settings_page_tsx_0oo06~d._.js +1 -1
- package/.next/server/chunks/ssr/project_f_tower_src_app_workspaces_[workspaceId]_board-page-client_tsx_0jmj1xz._.js +1 -1
- package/.next/server/instrumentation.js.nft.json +1 -1
- package/.next/server/middleware-build-manifest.js +3 -3
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.js +1 -1
- package/.next/server/server-reference-manifest.json +198 -198
- package/.next/static/chunks/06kg_505w0jw1.js +1 -0
- package/.next/static/chunks/09byywt6bkrfa.js +1 -0
- package/.next/static/chunks/{0~wu849la7jq2.js → 09hk_t9sy5wux.js} +1 -1
- package/.next/static/chunks/{0j3ixh~tlr2~~.js → 0b-_zu1k~lyul.js} +2 -2
- package/.next/static/chunks/{0ejd72g7tekop.js → 0ci9m8jp27a9c.js} +1 -1
- package/.next/static/chunks/{163-h-672vjtc.js → 0dspkfgz.dhn1.js} +1 -1
- package/.next/static/chunks/{1068kwso1r._u.js → 0f1jt_izz4dt-.js} +1 -1
- package/.next/static/chunks/{0kjm.xm_~nzz0.js → 0i-71pxd663r9.js} +1 -1
- package/.next/static/chunks/{0jm.d2tvttdcy.js → 0l.3myaonfg1h.js} +1 -1
- package/.next/static/chunks/{0x2z0sza~9erw.js → 0llbf__idgh~l.js} +1 -1
- package/.next/static/chunks/{0a93fdjk-37r7.js → 0o0a2vel7_xs4.js} +1 -1
- package/.next/static/chunks/0r2hhrhsollsz.js +1 -0
- package/.next/static/chunks/{14ul.txcdkz4n.js → 0s6xs0.kd4j1c.js} +1 -1
- package/.next/static/chunks/{0x9x7bxnrbi1..js → 105b3mtl5gt1l.js} +1 -1
- package/.next/static/chunks/{0vhwphmq69i0d.js → 12rg2xcias_84.js} +1 -1
- package/.next/trace +2 -2
- package/.next/trace-build +1 -1
- package/package.json +3 -2
- package/scripts/fix-native-permissions.js +39 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0.yn90z._.js +0 -3
- package/.next/server/chunks/ssr/project_f_tower_0d9_kxc._.js +0 -3
- package/.next/static/chunks/09mbyvk8z.wx2.js +0 -1
- package/.next/static/chunks/0mf6fqi52ca~q.js +0 -1
- package/.next/static/chunks/17b4edxd7wg5~.js +0 -1
- /package/.next/static/{EMk0oZpCVYuq8amkRB5za → uPbfev-r-deeE_PmqOX1E}/_buildManifest.js +0 -0
- /package/.next/static/{EMk0oZpCVYuq8amkRB5za → uPbfev-r-deeE_PmqOX1E}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{EMk0oZpCVYuq8amkRB5za → uPbfev-r-deeE_PmqOX1E}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,255779,e=>{"use strict";var t=e.i(432377),s=e.i(85212),a=e.i(309542),i=e.i(275283),n=e.i(625054),l=e.i(711296),r=e.i(831349),o=e.i(540032),c=e.i(9433),d=e.i(203529),m=e.i(330521),g=e.i(718837),u=e.i(937756),x=e.i(103295),h=e.i(863961);let p=(0,h.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 f=e.i(555159);let b=(0,h.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 j=e.i(316403),v=e.i(996032),N=e.i(780156);let y=(0,h.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 w=e.i(909260);let C=(0,h.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"}]]),k=(0,h.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 M=e.i(946960),S=e.i(750986),T=e.i(1156),P=e.i(730489),B=e.i(312687),R=e.i(330092),D=e.i(543485);let L=(0,D.createServerReference)("004f1a77e55d8bdf466af93a84f85dd6153e1efab6",D.callServer,void 0,D.findSourceMapURL,"getAvailableTerminalApps");var I=e.i(646917);let V=(0,D.createServerReference)("40bfb3cb79883e2768cea9b1a18d89a01e7b1f8d67",D.callServer,void 0,D.findSourceMapURL,"createPrompt"),H=(0,D.createServerReference)("6025a527a57d3023dac08fb0af1aa2c5520ddf6df5",D.callServer,void 0,D.findSourceMapURL,"updatePrompt"),U=(0,D.createServerReference)("406ebc5ada1c7d97d94766f447fdccc90b49179f6b",D.callServer,void 0,D.findSourceMapURL,"deletePrompt"),z=(0,D.createServerReference)("60535812c2ccdabf1dd33129c66bec4c80008c59d8",D.callServer,void 0,D.findSourceMapURL,"setDefaultPrompt");function E({options:e,value:s,onChange:a}){return(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.value),className:(0,u.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}function K({label:e,description:s,children:a,className:i}){return(0,t.jsxs)("div",{className:(0,u.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",i),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e}),s&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:s})]}),(0,t.jsx)("div",{className:"shrink-0",children:a})]})}let $=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:x.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:p,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:f.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:b,accent:"amber"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:j.Bell,accent:"rose"}],F={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"}},q="ai-manager:default-cli-adapter",O=[{type:"claude_local",label:"Claude Code",source:"builtin"}],A={host:"",ownerMatch:"*",localPathTemplate:"",priority:0};function G(){let e=(0,a.useRouter)(),{t:x}=(0,n.useI18n)(),{theme:h,setTheme:p}=(0,i.useTheme)(),{locale:f,setLocale:b}=(0,n.useI18n)(),[j,D]=(0,s.useState)("general"),G=(0,s.useRef)(null),[_,X]=(0,s.useState)({left:0,width:0}),[J,Q]=(0,s.useState)(!1),[W,Y]=(0,s.useState)("Terminal"),[Z,ee]=(0,s.useState)([]),[et,es]=(0,s.useState)(180),[ea,ei]=(0,s.useState)("claude_local"),[en,el]=(0,s.useState)(null),[er,eo]=(0,s.useState)({}),[ec,ed]=(0,s.useState)([]),[em,eg]=(0,s.useState)(!1),[eu,ex]=(0,s.useState)(null),[eh,ep]=(0,s.useState)(null),[ef,eb]=(0,s.useState)(""),[ej,ev]=(0,s.useState)(""),[eN,ey]=(0,s.useState)(""),[ew,eC]=(0,s.useState)([]),[ek,eM]=(0,s.useState)(null),[eS,eT]=(0,s.useState)({...A}),[eP,eB]=(0,s.useState)(!1),[eR,eD]=(0,s.useState)({...A}),[eL,eI]=(0,s.useState)(!1),[eV,eH]=(0,s.useState)(0),[eU,ez]=(0,s.useState)(null),[eE,eK]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3}),[e$,eF]=(0,s.useState)({timeoutSec:30}),[eq,eO]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80}),[eA,eG]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[e_,eX]=(0,s.useState)(null),[eJ,eQ]=(0,s.useState)(!1),[eW,eY]=(0,s.useState)(""),[eZ,e0]=(0,s.useState)(!0);(0,s.useEffect)(()=>Q(!0),[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("terminal.app","Terminal").then(Y),(0,P.getConfigValue)("terminal.idleTimeoutSec",180).then(es),L().then(ee)},[]),(0,s.useEffect)(()=>{let e=localStorage.getItem(q);e&&ei(e)},[]),(0,s.useEffect)(()=>{(0,I.getPrompts)().then(ed)},[]);let e1=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();eX(t)}}catch{}};async function e2(){await (0,B.setConfigValue)("terminal.app",W)}async function e5(){let e=Math.max(180,et);es(e),await (0,B.setConfigValue)("terminal.idleTimeoutSec",e)}async function e3(e){if(!en){el(e),eo(t=>{let s={...t};return delete s[e],s});try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:e})}),s=await t.json();eo(t=>({...t,[e]:s}))}catch{eo(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{el(null)}}}(0,s.useEffect)(()=>{(0,P.getConfigValue)("git.pathMappingRules",[]).then(eC),(0,P.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{eY(e.join(", "))}),e1(),(0,R.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{eK({maxUploadMb:Math.round((e["system.maxUploadBytes"]??0x3200000)/1024/1024),maxConcurrent:e["system.maxConcurrentExecutions"]??3}),eF({timeoutSec:e["git.timeoutSec"]??30}),eO({resultLimit:e["search.resultLimit"]??20,allModeCap:e["search.allModeCap"]??5,debounceMs:e["search.debounceMs"]??250,snippetLength:e["search.snippetLength"]??80}),eG({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("notification.enabled",!0).then(e0)},[]);let e4=(0,s.useCallback)(()=>{ex(null),eb(""),ev(""),ey(""),eg(!0)},[]),e8=(0,s.useCallback)(e=>{ex(e),eb(e.name),ev(e.description??""),ey(e.content),eg(!0)},[]),e7=(0,s.useCallback)(async()=>{ef.trim()&&eN.trim()&&(eu?await H(eu.id,{name:ef.trim(),description:ej.trim()||void 0,content:eN.trim()}):await V({name:ef.trim(),description:ej.trim()||void 0,content:eN.trim()}),eg(!1),ed(await (0,I.getPrompts)()),e.refresh())},[ef,ej,eN,eu,e]),e6=(0,s.useCallback)(async()=>{eh&&(await U(eh),ep(null),ed(await (0,I.getPrompts)()),e.refresh())},[eh,e]),e9=(0,s.useCallback)(async t=>{await z(t),ed(await (0,I.getPrompts)()),e.refresh()},[e]),te=async()=>{await (0,B.setConfigValue)("system.maxUploadBytes",1024*eE.maxUploadMb*1024),await (0,B.setConfigValue)("system.maxConcurrentExecutions",eE.maxConcurrent)},tt=async()=>{await (0,B.setConfigValue)("git.timeoutSec",e$.timeoutSec)},ts=async()=>{await (0,B.setConfigValue)("search.resultLimit",eq.resultLimit),await (0,B.setConfigValue)("search.allModeCap",eq.allModeCap),await (0,B.setConfigValue)("search.debounceMs",eq.debounceMs),await (0,B.setConfigValue)("search.snippetLength",eq.snippetLength)},ta=async()=>{let e=Math.min(eA.minCols,eA.maxCols),t=Math.max(eA.minCols,eA.maxCols),s=Math.min(eA.minRows,eA.maxRows),a=Math.max(eA.minRows,eA.maxRows);eG({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,B.setConfigValue)("missions.grid.minCols",e),await (0,B.setConfigValue)("missions.grid.maxCols",t),await (0,B.setConfigValue)("missions.grid.minRows",s),await (0,B.setConfigValue)("missions.grid.maxRows",a)},ti=async()=>{let e=eW.split(",").map(e=>e.trim()).filter(Boolean);await (0,B.setConfigValue)("hooks.autoUploadTypes",e)},tn=async()=>{if(e_){eQ(!0);try{let e=e_.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await e1()}finally{eQ(!1)}}},tl=async()=>{if(!eR.host.trim()||!eR.localPathTemplate.trim())return;let e=eR.localPathTemplate.trim().replace(/\/+$/,""),t=eL?`${e}/{path}`:e,s=[...ew,{id:crypto.randomUUID(),host:eR.host.trim(),ownerMatch:eR.ownerMatch.trim()||"*",localPathTemplate:t,priority:eR.priority}];await (0,B.setConfigValue)("git.pathMappingRules",s),eC(s),eD({...A}),eI(!1),eB(!1)},tr=async e=>{if(!eS.host.trim()||!eS.localPathTemplate.trim())return;let t=ew.map(t=>t.id===e?{...t,host:eS.host.trim(),ownerMatch:eS.ownerMatch.trim()||"*",localPathTemplate:eS.localPathTemplate.trim(),priority:eS.priority}:t);await (0,B.setConfigValue)("git.pathMappingRules",t),eC(t),eM(null)},to=async e=>{let t=ew.filter(t=>t.id!==e);await (0,B.setConfigValue)("git.pathMappingRules",t),eC(t),ez(null)};async function tc(){let e=!eZ;e0(e),await (0,B.setConfigValue)("notification.enabled",e)}let td=(0,s.useCallback)(()=>{e.back()},[e]);(0,s.useEffect)(()=>{let e=G.current;if(!e)return;let t=e.querySelector(`[data-section="${j}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();X({left:a.left-s.left,width:a.width})},[j]);let tm=$.find(e=>e.id===j),tg=tm?F[tm.accent]:F.blue;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:x("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:x("settings.configDesc")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:td,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(v.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{ref:G,className:"relative flex gap-1 overflow-x-auto",children:[$.map(e=>{let s=e.icon,a=j===e.id,i=F[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>D(e.id),className:(0,u.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",a?`${i.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:(0,u.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",a?i.bg:"bg-transparent"),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{children:x(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,u.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",tg.indicator),style:{left:_.left,width:_.width}})]})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[tm&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,u.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",tg.bg,tg.text,tg.ring),children:(0,t.jsx)(tm.icon,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:x(tm.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:x(tm.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(j){case"general":let e;return e=[{value:"light",label:x("settings.themeLight")},{value:"dark",label:x("settings.themeDark")},{value:"system",label:x("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(K,{label:x("settings.theme"),description:x("settings.themeDesc"),children:J?(0,t.jsx)(E,{options:e,value:h??"system",onChange:e=>p(e)}):(0,t.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,t.jsx)(K,{label:x("settings.language"),description:x("settings.languageDesc"),children:(0,t.jsx)(E,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:f,onChange:e=>b(e)})}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:x("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:x("settings.terminal.desc")})]})}),(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[Z.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Z.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{Y(e.value),(0,B.setConfigValue)("terminal.app",e.value)},className:(0,u.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200 cursor-pointer",W===e.value?"border-foreground bg-accent text-foreground font-medium":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:e.name},e.value))}),(0,t.jsx)("input",{type:"text",value:W,onChange:e=>Y(e.target.value),onBlur:e2,placeholder:x("settings.terminal.placeholder"),className:"h-9 w-64 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/30"})]})]}),(0,t.jsx)(K,{label:x("settings.terminal.idleTimeout"),description:x("settings.terminal.idleTimeoutDesc"),children:(0,t.jsx)("input",{type:"number",value:et,onChange:e=>es(Number(e.target.value)),onBlur:e5,min:180,className:"h-9 w-28 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm text-right focus:outline-none focus:ring-2 focus:ring-blue-500/30"})})]});case"ai-tools":return(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:O.map(e=>{let s=ea===e.type,a=en===e.type,i=er[e.type];return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.label}),(0,t.jsx)(d.Badge,{variant:"outline",children:x("label.builtin")}),s&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),x("settings.prompts.default")]}),i&&(0,t.jsx)(d.Badge,{variant:i.ok?"secondary":"destructive",className:(0,u.cn)("shrink-0",i.ok&&"bg-green-600 text-white hover:bg-green-700"),children:i.ok?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.CheckCircle2,{className:"h-3 w-3 mr-1"}),x("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(T.XCircle,{className:"h-3 w-3 mr-1"}),x("settings.aiTools.testFailed")]})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.type})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",onClick:()=>{var t;ei(t=e.type),localStorage.setItem(q,t)},children:[(0,t.jsx)(y,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),x("settings.prompts.setDefault")]}),(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>e3(e.type),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),x("settings.aiTools.testing")]}):x("settings.aiTools.testConnection")}),"external"===e.source&&(0,t.jsx)(l.Button,{variant:"outline",size:"icon-sm",className:"h-8 w-8 text-destructive hover:text-destructive",title:x("common.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]}),i&&(0,t.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,t.jsx)("div",{className:"space-y-1.5",children:i.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:(0,u.cn)("w-1.5 h-1.5 rounded-full shrink-0",s.passed?"bg-green-500":"bg-red-500")}),(0,t.jsx)("span",{className:(0,u.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.type}-${s.name}`))})})]})},e.type)})});case"prompts":return J?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(l.Button,{onClick:e4,variant:"default",children:[(0,t.jsx)(N.Plus,{className:"h-4 w-4 mr-2"}),x("settings.prompts.newPrompt")]})}),0===ec.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:x("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:x("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ec.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),e.isDefault&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,t.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),x("settings.prompts.default")]})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e9(e.id),title:x("settings.prompts.setDefault"),children:(0,t.jsx)(y,{className:(0,u.cn)("h-4 w-4",e.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e8(e),title:x("settings.prompts.editPrompt"),children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ep(e.id),className:"text-destructive",title:x("settings.prompts.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]},e.id))}),(0,t.jsx)(g.Dialog,{open:em,onOpenChange:eg,children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:eu?x("settings.prompts.editPrompt"):x("settings.prompts.newPrompt")}),(0,t.jsx)(g.DialogDescription,{children:eu?x("settings.prompts.editPrompt"):x("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-name",children:x("settings.prompts.promptName")}),(0,t.jsx)(r.Input,{id:"prompt-name",value:ef,onChange:e=>eb(e.target.value),placeholder:x("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-description",children:x("settings.prompts.promptDescription")}),(0,t.jsx)(r.Input,{id:"prompt-description",value:ej,onChange:e=>ev(e.target.value),placeholder:x("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-content",children:x("settings.prompts.promptContent")}),(0,t.jsx)(o.Textarea,{id:"prompt-content",value:eN,onChange:e=>ey(e.target.value),placeholder:x("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eg(!1),children:x("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{onClick:e7,disabled:!ef.trim()||!eN.trim(),children:x("settings.prompts.save")})]})]})}),(0,t.jsx)(g.Dialog,{open:!!eh,onOpenChange:e=>!e&&ep(null),children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:x("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(g.DialogDescription,{children:x("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>ep(null),children:x("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:e6,children:x("settings.prompts.delete")})]})]})})]}):(0,t.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let s,a,i;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.git.desc")})]}),(0,t.jsxs)(l.Button,{onClick:()=>{eD({...A}),eB(!0)},children:[(0,t.jsx)(N.Plus,{className:"mr-2 h-4 w-4"}),x("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==ew.length||eP?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ew.map(e=>ek===e.id?(0,t.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.host")}),(0,t.jsx)(r.Input,{value:eS.host,onChange:e=>eT(t=>({...t,host:e.target.value})),placeholder:x("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.ownerMatch")}),(0,t.jsx)(r.Input,{value:eS.ownerMatch,onChange:e=>eT(t=>({...t,ownerMatch:e.target.value})),placeholder:x("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1 col-span-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.localPathTemplate")}),(0,t.jsx)(r.Input,{value:eS.localPathTemplate,onChange:e=>eT(t=>({...t,localPathTemplate:e.target.value})),placeholder:x("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.priority")}),(0,t.jsx)(r.Input,{type:"number",value:eS.priority,onChange:e=>eT(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>eM(null),children:x("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{size:"sm",onClick:()=>tr(e.id),children:x("settings.config.git.save")})]})]},e.id):(0,t.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.host}),"*"!==e.ownerMatch&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",e.ownerMatch]}),(0,t.jsxs)(d.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[x("settings.config.git.priority")," ",e.priority]})]}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:e.localPathTemplate})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{eM(e.id),eT({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:e.localPathTemplate,priority:e.priority})},title:x("settings.config.git.edit"),children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ez(e.id),className:"text-destructive",title:x("settings.config.git.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]})},e.id))}):(0,t.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:x("settings.config.git.noRules")})}),eP&&(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.host")}),(0,t.jsx)(r.Input,{value:eR.host,onChange:e=>eD(t=>({...t,host:e.target.value})),placeholder:x("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.ownerMatch")}),(0,t.jsx)(r.Input,{value:eR.ownerMatch,onChange:e=>eD(t=>({...t,ownerMatch:e.target.value})),placeholder:x("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{value:eR.localPathTemplate,onChange:e=>eD(t=>({...t,localPathTemplate:e.target.value})),placeholder:x("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsx)("button",{type:"button",onClick:()=>eI(e=>!e),className:(0,u.cn)("shrink-0 rounded-full px-2.5 py-1 text-[11px] font-mono font-medium transition-colors cursor-pointer",eL?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:"{path}"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eL?x("onboarding.step3.pathHintFull"):x("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.priority")}),(0,t.jsx)(r.Input,{type:"number",value:eR.priority,onChange:e=>eD(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),eR.localPathTemplate&&(s=eR.localPathTemplate.trim().replace(/\/+$/,""),a=eL?`${s}/{path}`:s,i=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:x("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:i.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>eH(s),className:(0,u.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",eV===s?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:e.label},s))})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:i[eV].url}),(0,t.jsxs)("p",{className:"font-mono text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-foreground font-medium",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],i=s.match(/^git@[^:]+:(.+)$/);if(i)a=i[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(s);a=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!a.length)return"";let n=a[0],l=a[a.length-1],r=a.join("/");if(e.includes("{path}"))return e.replace("{path}",r).replace("{owner}",n).replace("{repo}",l).replace(/\/+$/,"");let o=e.replace("{owner}",n).replace("{repo}","").replace(/\/+$/,"");return`${o}/${l}`}(a,i[eV].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>eB(!1),children:x("settings.config.git.cancel")}),(0,t.jsxs)(l.Button,{size:"sm",onClick:tl,disabled:!eR.host.trim()||!eR.localPathTemplate.trim(),children:[(0,t.jsx)(k,{className:"h-3.5 w-3.5 mr-1.5"}),x("settings.config.git.save")]})]})]})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.system.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:1,max:500,value:eE.maxUploadMb,onChange:e=>eK(t=>({...t,maxUploadMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eE.maxConcurrent,onChange:e=>eK(t=>({...t,maxConcurrent:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:te,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.gitParams.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:5,max:300,value:e$.timeoutSec,onChange:e=>eF(t=>({...t,timeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,t.jsx)(l.Button,{onClick:tt,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.search.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:5,max:100,value:eq.resultLimit,onChange:e=>eO(t=>({...t,resultLimit:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:1,max:20,value:eq.allModeCap,onChange:e=>eO(t=>({...t,allModeCap:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:50,max:1e3,value:eq.debounceMs,onChange:e=>eO(t=>({...t,debounceMs:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:20,max:500,value:eq.snippetLength,onChange:e=>eO(t=>({...t,snippetLength:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:ts,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.missions.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.minCols")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.minCols,onChange:e=>eG(t=>({...t,minCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.maxCols")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.maxCols,onChange:e=>eG(t=>({...t,maxCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.minRows")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.minRows,onChange:e=>eG(t=>({...t,minRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.maxRows")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.maxRows,onChange:e=>eG(t=>({...t,maxRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:ta,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.hooks.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(r.Input,{value:eW,onChange:e=>eY(e.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,t.jsx)(l.Button,{onClick:ti,className:"rounded-lg",children:x("common.save")}),(0,t.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:e_?.installed?x("settings.config.hooks.installed"):x("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.hooks.installHint")})]}),(0,t.jsx)(l.Button,{variant:e_?.installed?"destructive":"default",onClick:tn,disabled:eJ||!e_,className:"rounded-lg",children:e_?.installed?x("settings.config.hooks.uninstall"):x("settings.config.hooks.install")})]})]}),(0,t.jsx)(g.Dialog,{open:!!eU,onOpenChange:e=>!e&&ez(null),children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:x("settings.config.git.deleteConfirm")}),(0,t.jsx)(g.DialogDescription,{children:x("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>ez(null),children:x("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:()=>eU&&to(eU),children:x("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsx)("div",{className:"divide-y divide-border/50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:x("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:x("settings.notifications.enableDesc")})]}),(0,t.jsx)(m.Switch,{checked:eZ,onCheckedChange:tc})]})})}}()]})})]})}e.s(["default",0,function(){return(0,t.jsx)(G,{})}],255779)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,255779,e=>{"use strict";var t=e.i(432377),s=e.i(85212),a=e.i(309542),i=e.i(275283),n=e.i(625054),l=e.i(711296),r=e.i(831349),o=e.i(540032),c=e.i(9433),d=e.i(203529),m=e.i(330521),g=e.i(718837),u=e.i(937756),x=e.i(103295),h=e.i(863961);let p=(0,h.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 f=e.i(555159);let b=(0,h.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 j=e.i(316403),v=e.i(996032),N=e.i(780156);let y=(0,h.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 w=e.i(909260);let C=(0,h.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"}]]),k=(0,h.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 M=e.i(946960),S=e.i(750986),T=e.i(1156),P=e.i(104032),B=e.i(878748),R=e.i(252116),D=e.i(543485);let L=(0,D.createServerReference)("00e401a2e066dc0a2fdd558f645b0ae5cde6ee1b74",D.callServer,void 0,D.findSourceMapURL,"getAvailableTerminalApps");var I=e.i(537049);let V=(0,D.createServerReference)("405b97e0c368e83d708d193cd7c08d345d16c53379",D.callServer,void 0,D.findSourceMapURL,"createPrompt"),H=(0,D.createServerReference)("60c4f6293ed8680b936e6712d7ecf7f2ef5f2a85e7",D.callServer,void 0,D.findSourceMapURL,"updatePrompt"),U=(0,D.createServerReference)("4084f75558fbb37fb63f7c0f70da4aecd0b2c6deaf",D.callServer,void 0,D.findSourceMapURL,"deletePrompt"),z=(0,D.createServerReference)("60d4125ce6a8d3394971bc7e45c12f70a786467ca4",D.callServer,void 0,D.findSourceMapURL,"setDefaultPrompt");function E({options:e,value:s,onChange:a}){return(0,t.jsx)("div",{className:"inline-flex rounded-lg border border-border/50 bg-muted/30 p-1 gap-0.5",children:e.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.value),className:(0,u.cn)("rounded-md px-3.5 py-1.5 text-sm font-medium transition-all duration-200 cursor-pointer",s===e.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))})}function K({label:e,description:s,children:a,className:i}){return(0,t.jsxs)("div",{className:(0,u.cn)("flex items-center justify-between py-4 border-b border-border/50 last:border-0",i),children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:e}),s&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:s})]}),(0,t.jsx)("div",{className:"shrink-0",children:a})]})}let $=[{id:"general",labelKey:"settings.general",descKey:"settings.generalDesc",icon:x.Settings,accent:"blue"},{id:"ai-tools",labelKey:"settings.aiTools.title",descKey:"settings.aiTools.cliVerificationDesc",icon:p,accent:"emerald"},{id:"prompts",labelKey:"settings.prompts",descKey:"settings.promptsDesc",icon:f.FileText,accent:"violet"},{id:"config",labelKey:"settings.config",descKey:"settings.configDesc",icon:b,accent:"amber"},{id:"notifications",labelKey:"settings.notifications.title",descKey:"settings.notifications.navDesc",icon:j.Bell,accent:"rose"}],F={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"}},q="ai-manager:default-cli-adapter",O=[{type:"claude_local",label:"Claude Code",source:"builtin"}],A={host:"",ownerMatch:"*",localPathTemplate:"",priority:0};function G(){let e=(0,a.useRouter)(),{t:x}=(0,n.useI18n)(),{theme:h,setTheme:p}=(0,i.useTheme)(),{locale:f,setLocale:b}=(0,n.useI18n)(),[j,D]=(0,s.useState)("general"),G=(0,s.useRef)(null),[_,X]=(0,s.useState)({left:0,width:0}),[J,Q]=(0,s.useState)(!1),[W,Y]=(0,s.useState)("Terminal"),[Z,ee]=(0,s.useState)([]),[et,es]=(0,s.useState)(180),[ea,ei]=(0,s.useState)("claude_local"),[en,el]=(0,s.useState)(null),[er,eo]=(0,s.useState)({}),[ec,ed]=(0,s.useState)([]),[em,eg]=(0,s.useState)(!1),[eu,ex]=(0,s.useState)(null),[eh,ep]=(0,s.useState)(null),[ef,eb]=(0,s.useState)(""),[ej,ev]=(0,s.useState)(""),[eN,ey]=(0,s.useState)(""),[ew,eC]=(0,s.useState)([]),[ek,eM]=(0,s.useState)(null),[eS,eT]=(0,s.useState)({...A}),[eP,eB]=(0,s.useState)(!1),[eR,eD]=(0,s.useState)({...A}),[eL,eI]=(0,s.useState)(!1),[eV,eH]=(0,s.useState)(0),[eU,ez]=(0,s.useState)(null),[eE,eK]=(0,s.useState)({maxUploadMb:50,maxConcurrent:3}),[e$,eF]=(0,s.useState)({timeoutSec:30}),[eq,eO]=(0,s.useState)({resultLimit:20,allModeCap:5,debounceMs:250,snippetLength:80}),[eA,eG]=(0,s.useState)({minCols:1,maxCols:5,minRows:1,maxRows:5}),[e_,eX]=(0,s.useState)(null),[eJ,eQ]=(0,s.useState)(!1),[eW,eY]=(0,s.useState)(""),[eZ,e0]=(0,s.useState)(!0);(0,s.useEffect)(()=>Q(!0),[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("terminal.app","Terminal").then(Y),(0,P.getConfigValue)("terminal.idleTimeoutSec",180).then(es),L().then(ee)},[]),(0,s.useEffect)(()=>{let e=localStorage.getItem(q);e&&ei(e)},[]),(0,s.useEffect)(()=>{(0,I.getPrompts)().then(ed)},[]);let e1=async()=>{try{let e=await fetch("/api/internal/hooks/install");if(e.ok){let t=await e.json();eX(t)}}catch{}};async function e2(){await (0,B.setConfigValue)("terminal.app",W)}async function e5(){let e=Math.max(180,et);es(e),await (0,B.setConfigValue)("terminal.idleTimeoutSec",e)}async function e3(e){if(!en){el(e),eo(t=>{let s={...t};return delete s[e],s});try{let t=await fetch("/api/adapters/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({adapterType:e})}),s=await t.json();eo(t=>({...t,[e]:s}))}catch{eo(t=>({...t,[e]:{ok:!1,checks:[{name:"network_error",passed:!1,message:"Network request failed"}]}}))}finally{el(null)}}}(0,s.useEffect)(()=>{(0,P.getConfigValue)("git.pathMappingRules",[]).then(eC),(0,P.getConfigValue)("hooks.autoUploadTypes",["png","jpg","jpeg","gif","webp","svg","pdf","md","txt","json"]).then(e=>{eY(e.join(", "))}),e1(),(0,R.getConfigValues)(["system.maxUploadBytes","system.maxConcurrentExecutions","git.timeoutSec","search.resultLimit","search.allModeCap","search.debounceMs","search.snippetLength","missions.grid.minCols","missions.grid.maxCols","missions.grid.minRows","missions.grid.maxRows"]).then(e=>{eK({maxUploadMb:Math.round((e["system.maxUploadBytes"]??0x3200000)/1024/1024),maxConcurrent:e["system.maxConcurrentExecutions"]??3}),eF({timeoutSec:e["git.timeoutSec"]??30}),eO({resultLimit:e["search.resultLimit"]??20,allModeCap:e["search.allModeCap"]??5,debounceMs:e["search.debounceMs"]??250,snippetLength:e["search.snippetLength"]??80}),eG({minCols:e["missions.grid.minCols"]??1,maxCols:e["missions.grid.maxCols"]??5,minRows:e["missions.grid.minRows"]??1,maxRows:e["missions.grid.maxRows"]??5})})},[]),(0,s.useEffect)(()=>{(0,P.getConfigValue)("notification.enabled",!0).then(e0)},[]);let e4=(0,s.useCallback)(()=>{ex(null),eb(""),ev(""),ey(""),eg(!0)},[]),e7=(0,s.useCallback)(e=>{ex(e),eb(e.name),ev(e.description??""),ey(e.content),eg(!0)},[]),e8=(0,s.useCallback)(async()=>{ef.trim()&&eN.trim()&&(eu?await H(eu.id,{name:ef.trim(),description:ej.trim()||void 0,content:eN.trim()}):await V({name:ef.trim(),description:ej.trim()||void 0,content:eN.trim()}),eg(!1),ed(await (0,I.getPrompts)()),e.refresh())},[ef,ej,eN,eu,e]),e6=(0,s.useCallback)(async()=>{eh&&(await U(eh),ep(null),ed(await (0,I.getPrompts)()),e.refresh())},[eh,e]),e9=(0,s.useCallback)(async t=>{await z(t),ed(await (0,I.getPrompts)()),e.refresh()},[e]),te=async()=>{await (0,B.setConfigValue)("system.maxUploadBytes",1024*eE.maxUploadMb*1024),await (0,B.setConfigValue)("system.maxConcurrentExecutions",eE.maxConcurrent)},tt=async()=>{await (0,B.setConfigValue)("git.timeoutSec",e$.timeoutSec)},ts=async()=>{await (0,B.setConfigValue)("search.resultLimit",eq.resultLimit),await (0,B.setConfigValue)("search.allModeCap",eq.allModeCap),await (0,B.setConfigValue)("search.debounceMs",eq.debounceMs),await (0,B.setConfigValue)("search.snippetLength",eq.snippetLength)},ta=async()=>{let e=Math.min(eA.minCols,eA.maxCols),t=Math.max(eA.minCols,eA.maxCols),s=Math.min(eA.minRows,eA.maxRows),a=Math.max(eA.minRows,eA.maxRows);eG({minCols:e,maxCols:t,minRows:s,maxRows:a}),await (0,B.setConfigValue)("missions.grid.minCols",e),await (0,B.setConfigValue)("missions.grid.maxCols",t),await (0,B.setConfigValue)("missions.grid.minRows",s),await (0,B.setConfigValue)("missions.grid.maxRows",a)},ti=async()=>{let e=eW.split(",").map(e=>e.trim()).filter(Boolean);await (0,B.setConfigValue)("hooks.autoUploadTypes",e)},tn=async()=>{if(e_){eQ(!0);try{let e=e_.installed?"DELETE":"POST";await fetch("/api/internal/hooks/install",{method:e}),await e1()}finally{eQ(!1)}}},tl=async()=>{if(!eR.host.trim()||!eR.localPathTemplate.trim())return;let e=eR.localPathTemplate.trim().replace(/\/+$/,""),t=eL?`${e}/{path}`:e,s=[...ew,{id:crypto.randomUUID(),host:eR.host.trim(),ownerMatch:eR.ownerMatch.trim()||"*",localPathTemplate:t,priority:eR.priority}];await (0,B.setConfigValue)("git.pathMappingRules",s),eC(s),eD({...A}),eI(!1),eB(!1)},tr=async e=>{if(!eS.host.trim()||!eS.localPathTemplate.trim())return;let t=ew.map(t=>t.id===e?{...t,host:eS.host.trim(),ownerMatch:eS.ownerMatch.trim()||"*",localPathTemplate:eS.localPathTemplate.trim(),priority:eS.priority}:t);await (0,B.setConfigValue)("git.pathMappingRules",t),eC(t),eM(null)},to=async e=>{let t=ew.filter(t=>t.id!==e);await (0,B.setConfigValue)("git.pathMappingRules",t),eC(t),ez(null)};async function tc(){let e=!eZ;e0(e),await (0,B.setConfigValue)("notification.enabled",e)}let td=(0,s.useCallback)(()=>{e.back()},[e]);(0,s.useEffect)(()=>{let e=G.current;if(!e)return;let t=e.querySelector(`[data-section="${j}"]`);if(!t)return;let s=e.getBoundingClientRect(),a=t.getBoundingClientRect();X({left:a.left-s.left,width:a.width})},[j]);let tm=$.find(e=>e.id===j),tg=tm?F[tm.accent]:F.blue;return(0,t.jsxs)("div",{className:"flex h-full flex-col bg-background",children:[(0,t.jsx)("div",{className:"flex-shrink-0 border-b bg-card/50 backdrop-blur-sm",children:(0,t.jsxs)("div",{className:"mx-auto max-w-5xl px-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between pb-3 pt-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:x("settings.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:x("settings.configDesc")})]}),(0,t.jsxs)(l.Button,{variant:"outline",onClick:td,className:"gap-1.5 bg-card shadow-sm cursor-pointer",children:[(0,t.jsx)(v.X,{className:"h-3.5 w-3.5"}),"ESC"]})]}),(0,t.jsxs)("div",{ref:G,className:"relative flex gap-1 overflow-x-auto",children:[$.map(e=>{let s=e.icon,a=j===e.id,i=F[e.accent];return(0,t.jsxs)("button",{"data-section":e.id,onClick:()=>D(e.id),className:(0,u.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",a?`${i.text} bg-background`:"text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,t.jsx)("span",{className:(0,u.cn)("flex h-6 w-6 items-center justify-center rounded-md","transition-colors duration-200",a?i.bg:"bg-transparent"),children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("span",{children:x(e.labelKey)})]},e.id)}),(0,t.jsx)("div",{className:(0,u.cn)("absolute bottom-0 h-0.5 rounded-full","transition-all duration-250 ease-out",tg.indicator),style:{left:_.left,width:_.width}})]})]})}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:(0,t.jsxs)("div",{className:"mx-auto max-w-4xl px-6 py-8",children:[tm&&(0,t.jsxs)("div",{className:"mb-6 flex items-start gap-4",children:[(0,t.jsx)("div",{className:(0,u.cn)("flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl","ring-1",tg.bg,tg.text,tg.ring),children:(0,t.jsx)(tm.icon,{className:"h-5 w-5"})}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:x(tm.labelKey)}),(0,t.jsx)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:x(tm.descKey)})]})]}),(0,t.jsx)("div",{className:"mb-6 border-t"}),function(){switch(j){case"general":let e;return e=[{value:"light",label:x("settings.themeLight")},{value:"dark",label:x("settings.themeDark")},{value:"system",label:x("settings.themeSystem")}],(0,t.jsxs)("div",{className:"divide-y divide-border/50",children:[(0,t.jsx)(K,{label:x("settings.theme"),description:x("settings.themeDesc"),children:J?(0,t.jsx)(E,{options:e,value:h??"system",onChange:e=>p(e)}):(0,t.jsx)("div",{className:"inline-flex h-9 rounded-lg border border-border/50 bg-muted/30 p-1 w-[200px]"})}),(0,t.jsx)(K,{label:x("settings.language"),description:x("settings.languageDesc"),children:(0,t.jsx)(E,{options:[{value:"zh",label:"中文"},{value:"en",label:"English"}],value:f,onChange:e=>b(e)})}),(0,t.jsxs)("div",{className:"py-4 border-b border-border/50",children:[(0,t.jsx)("div",{className:"flex items-center justify-between",children:(0,t.jsxs)("div",{className:"min-w-0 flex-1 pr-4",children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:x("settings.terminal.label")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:x("settings.terminal.desc")})]})}),(0,t.jsxs)("div",{className:"mt-3 flex flex-col gap-2",children:[Z.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:Z.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>{Y(e.value),(0,B.setConfigValue)("terminal.app",e.value)},className:(0,u.cn)("rounded-lg border px-3.5 py-1.5 text-xs font-medium transition-all duration-200 cursor-pointer",W===e.value?"border-foreground bg-accent text-foreground font-medium":"border-border text-muted-foreground hover:bg-accent/50 hover:text-foreground"),children:e.name},e.value))}),(0,t.jsx)("input",{type:"text",value:W,onChange:e=>Y(e.target.value),onBlur:e2,placeholder:x("settings.terminal.placeholder"),className:"h-9 w-64 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500/30"})]})]}),(0,t.jsx)(K,{label:x("settings.terminal.idleTimeout"),description:x("settings.terminal.idleTimeoutDesc"),children:(0,t.jsx)("input",{type:"number",value:et,onChange:e=>es(Number(e.target.value)),onBlur:e5,min:180,className:"h-9 w-28 rounded-lg border border-border/50 bg-muted/30 px-3 text-sm text-right focus:outline-none focus:ring-2 focus:ring-blue-500/30"})})]});case"ai-tools":return(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:O.map(e=>{let s=ea===e.type,a=en===e.type,i=er[e.type];return(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"px-5 py-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium",children:e.label}),(0,t.jsx)(d.Badge,{variant:"outline",children:x("label.builtin")}),s&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0",children:[(0,t.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),x("settings.prompts.default")]}),i&&(0,t.jsx)(d.Badge,{variant:i.ok?"secondary":"destructive",className:(0,u.cn)("shrink-0",i.ok&&"bg-green-600 text-white hover:bg-green-700"),children:i.ok?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(S.CheckCircle2,{className:"h-3 w-3 mr-1"}),x("settings.aiTools.testPassed")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(T.XCircle,{className:"h-3 w-3 mr-1"}),x("settings.aiTools.testFailed")]})})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.type})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[!s&&(0,t.jsxs)(l.Button,{variant:"outline",size:"sm",onClick:()=>{var t;ei(t=e.type),localStorage.setItem(q,t)},children:[(0,t.jsx)(y,{className:"h-3.5 w-3.5 mr-1.5 text-muted-foreground"}),x("settings.prompts.setDefault")]}),(0,t.jsx)(l.Button,{variant:"outline",size:"sm",onClick:()=>e3(e.type),disabled:a,children:a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.Loader2,{className:"h-3.5 w-3.5 animate-spin mr-1.5"}),x("settings.aiTools.testing")]}):x("settings.aiTools.testConnection")}),"external"===e.source&&(0,t.jsx)(l.Button,{variant:"outline",size:"icon-sm",className:"h-8 w-8 text-destructive hover:text-destructive",title:x("common.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]}),i&&(0,t.jsx)("div",{className:"mt-3 rounded-md border border-border bg-muted/30 px-4 py-3",children:(0,t.jsx)("div",{className:"space-y-1.5",children:i.checks.map(s=>(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:(0,u.cn)("w-1.5 h-1.5 rounded-full shrink-0",s.passed?"bg-green-500":"bg-red-500")}),(0,t.jsx)("span",{className:(0,u.cn)(s.passed?"text-foreground":"text-red-700 dark:text-red-300"),children:s.message})]},`${e.type}-${s.name}`))})})]})},e.type)})});case"prompts":return J?(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(l.Button,{onClick:e4,variant:"default",children:[(0,t.jsx)(N.Plus,{className:"h-4 w-4 mr-2"}),x("settings.prompts.newPrompt")]})}),0===ec.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center rounded-lg border border-dashed border-border/50",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:x("settings.prompts.empty")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:x("settings.prompts.emptyHint")})]}):(0,t.jsx)("div",{className:"rounded-xl border border-border/50 divide-y divide-border/50",children:ec.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3.5 hover:bg-muted/30 transition-colors",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.name}),e.isDefault&&(0,t.jsxs)(d.Badge,{variant:"secondary",className:"shrink-0 rounded-full text-xs",children:[(0,t.jsx)(y,{className:"h-3 w-3 mr-1 fill-yellow-400 text-yellow-400"}),x("settings.prompts.default")]})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-4",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e9(e.id),title:x("settings.prompts.setDefault"),children:(0,t.jsx)(y,{className:(0,u.cn)("h-4 w-4",e.isDefault?"fill-yellow-400 text-yellow-400":"text-muted-foreground")})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>e7(e),title:x("settings.prompts.editPrompt"),children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ep(e.id),className:"text-destructive",title:x("settings.prompts.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]},e.id))}),(0,t.jsx)(g.Dialog,{open:em,onOpenChange:eg,children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:eu?x("settings.prompts.editPrompt"):x("settings.prompts.newPrompt")}),(0,t.jsx)(g.DialogDescription,{children:eu?x("settings.prompts.editPrompt"):x("settings.prompts.newPrompt")})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-name",children:x("settings.prompts.promptName")}),(0,t.jsx)(r.Input,{id:"prompt-name",value:ef,onChange:e=>eb(e.target.value),placeholder:x("settings.prompts.promptNamePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-description",children:x("settings.prompts.promptDescription")}),(0,t.jsx)(r.Input,{id:"prompt-description",value:ej,onChange:e=>ev(e.target.value),placeholder:x("settings.prompts.promptDescriptionPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(c.Label,{htmlFor:"prompt-content",children:x("settings.prompts.promptContent")}),(0,t.jsx)(o.Textarea,{id:"prompt-content",value:eN,onChange:e=>ey(e.target.value),placeholder:x("settings.prompts.promptContentPlaceholder"),rows:8,className:"mt-1.5 font-mono text-sm"})]})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>eg(!1),children:x("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{onClick:e8,disabled:!ef.trim()||!eN.trim(),children:x("settings.prompts.save")})]})]})}),(0,t.jsx)(g.Dialog,{open:!!eh,onOpenChange:e=>!e&&ep(null),children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:x("settings.prompts.deleteConfirmTitle")}),(0,t.jsx)(g.DialogDescription,{children:x("settings.prompts.deleteConfirmMessage")})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>ep(null),children:x("settings.prompts.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:e6,children:x("settings.prompts.delete")})]})]})})]}):(0,t.jsx)("div",{className:"h-32 rounded-lg bg-muted animate-pulse"});case"config":let s,a,i;return(0,t.jsxs)("div",{className:"space-y-8",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.git.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.git.desc")})]}),(0,t.jsxs)(l.Button,{onClick:()=>{eD({...A}),eB(!0)},children:[(0,t.jsx)(N.Plus,{className:"mr-2 h-4 w-4"}),x("settings.config.git.addRule")]})]}),(0,t.jsxs)("div",{className:"space-y-3",children:[0!==ew.length||eP?(0,t.jsx)("ul",{className:"divide-y rounded-xl border border-border bg-card",children:ew.map(e=>ek===e.id?(0,t.jsxs)("li",{className:"px-5 py-4 bg-muted/20",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.host")}),(0,t.jsx)(r.Input,{value:eS.host,onChange:e=>eT(t=>({...t,host:e.target.value})),placeholder:x("settings.config.git.hostPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.ownerMatch")}),(0,t.jsx)(r.Input,{value:eS.ownerMatch,onChange:e=>eT(t=>({...t,ownerMatch:e.target.value})),placeholder:x("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]}),(0,t.jsxs)("div",{className:"space-y-1 col-span-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.localPathTemplate")}),(0,t.jsx)(r.Input,{value:eS.localPathTemplate,onChange:e=>eT(t=>({...t,localPathTemplate:e.target.value})),placeholder:x("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono"})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:x("settings.config.git.priority")}),(0,t.jsx)(r.Input,{type:"number",value:eS.priority,onChange:e=>eT(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]})]}),(0,t.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>eM(null),children:x("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{size:"sm",onClick:()=>tr(e.id),children:x("settings.config.git.save")})]})]},e.id):(0,t.jsx)("li",{className:"group px-5 py-4 hover:bg-muted/20 transition-colors",children:(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"font-medium text-sm",children:e.host}),"*"!==e.ownerMatch&&(0,t.jsxs)("span",{className:"text-xs text-muted-foreground",children:["/ ",e.ownerMatch]}),(0,t.jsxs)(d.Badge,{variant:"outline",className:"text-[10px] px-1.5 py-0",children:[x("settings.config.git.priority")," ",e.priority]})]}),(0,t.jsx)("p",{className:"mt-0.5 font-mono text-xs text-muted-foreground truncate",children:e.localPathTemplate})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{eM(e.id),eT({host:e.host,ownerMatch:e.ownerMatch,localPathTemplate:e.localPathTemplate,priority:e.priority})},title:x("settings.config.git.edit"),children:(0,t.jsx)(C,{className:"h-4 w-4"})}),(0,t.jsx)(l.Button,{variant:"ghost",size:"icon-sm",onClick:()=>ez(e.id),className:"text-destructive",title:x("settings.config.git.delete"),children:(0,t.jsx)(w.Trash2,{className:"h-4 w-4"})})]})]})},e.id))}):(0,t.jsx)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:x("settings.config.git.noRules")})}),eP&&(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/20 p-5 space-y-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.host")}),(0,t.jsx)(r.Input,{value:eR.host,onChange:e=>eD(t=>({...t,host:e.target.value})),placeholder:x("settings.config.git.hostPlaceholder"),className:"text-sm",autoFocus:!0})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.ownerMatch")}),(0,t.jsx)(r.Input,{value:eR.ownerMatch,onChange:e=>eD(t=>({...t,ownerMatch:e.target.value})),placeholder:x("settings.config.git.ownerMatchPlaceholder"),className:"text-sm"})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.localPathTemplate")}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{value:eR.localPathTemplate,onChange:e=>eD(t=>({...t,localPathTemplate:e.target.value})),placeholder:x("settings.config.git.localPathTemplatePlaceholder"),className:"text-sm font-mono flex-1"}),(0,t.jsx)("button",{type:"button",onClick:()=>eI(e=>!e),className:(0,u.cn)("shrink-0 rounded-full px-2.5 py-1 text-[11px] font-mono font-medium transition-colors cursor-pointer",eL?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:"{path}"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:eL?x("onboarding.step3.pathHintFull"):x("onboarding.step3.pathHintRepo")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium",children:x("settings.config.git.priority")}),(0,t.jsx)(r.Input,{type:"number",value:eR.priority,onChange:e=>eD(t=>({...t,priority:Number(e.target.value)})),className:"text-sm w-24"})]}),eR.localPathTemplate&&(s=eR.localPathTemplate.trim().replace(/\/+$/,""),a=eL?`${s}/{path}`:s,i=[{label:"GitHub SSH",url:"git@github.com:user/my-app.git"},{label:"GitHub HTTPS",url:"https://github.com/user/my-app.git"},{label:"GitLab Subgroup",url:"https://gitlab.com/org/team/sub/my-api.git"}],(0,t.jsxs)("div",{className:"rounded-lg bg-muted/40 border border-border px-4 py-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:x("onboarding.step3.previewLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:i.map((e,s)=>(0,t.jsx)("button",{type:"button",onClick:()=>eH(s),className:(0,u.cn)("rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors cursor-pointer",eV===s?"bg-foreground text-background":"bg-muted text-muted-foreground hover:text-foreground"),children:e.label},s))})]}),(0,t.jsxs)("div",{className:"space-y-0.5",children:[(0,t.jsx)("p",{className:"font-mono text-[11px] text-muted-foreground truncate",children:i[eV].url}),(0,t.jsxs)("p",{className:"font-mono text-sm",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"→ "}),(0,t.jsx)("span",{className:"text-foreground font-medium",children:function(e,t){if(!e||!t)return"";let s=t.trim(),a=[],i=s.match(/^git@[^:]+:(.+)$/);if(i)a=i[1].replace(/\.git\/?$/,"").split("/").filter(Boolean);else try{let e=new URL(s);a=decodeURIComponent(e.pathname).replace(/\.git\/?$/,"").split("/").filter(Boolean)}catch{return""}if(!a.length)return"";let n=a[0],l=a[a.length-1],r=a.join("/");if(e.includes("{path}"))return e.replace("{path}",r).replace("{owner}",n).replace("{repo}",l).replace(/\/+$/,"");let o=e.replace("{owner}",n).replace("{repo}","").replace(/\/+$/,"");return`${o}/${l}`}(a,i[eV].url)})]})]})]})),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(l.Button,{variant:"ghost",size:"sm",onClick:()=>eB(!1),children:x("settings.config.git.cancel")}),(0,t.jsxs)(l.Button,{size:"sm",onClick:tl,disabled:!eR.host.trim()||!eR.localPathTemplate.trim(),children:[(0,t.jsx)(k,{className:"h-3.5 w-3.5 mr-1.5"}),x("settings.config.git.save")]})]})]})]})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.system.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.system.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.system.maxUpload")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.system.maxUploadHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:1,max:500,value:eE.maxUploadMb,onChange:e=>eK(t=>({...t,maxUploadMb:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"MB"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.system.maxConcurrent")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.system.maxConcurrentHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eE.maxConcurrent,onChange:e=>eK(t=>({...t,maxConcurrent:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:te,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.gitParams.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.gitParams.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.gitParams.timeout")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.gitParams.timeoutHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:5,max:300,value:e$.timeoutSec,onChange:e=>eF(t=>({...t,timeoutSec:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"s"})]})]}),(0,t.jsx)(l.Button,{onClick:tt,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.search.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.search.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.resultLimit")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.resultLimitHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:5,max:100,value:eq.resultLimit,onChange:e=>eO(t=>({...t,resultLimit:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.allModeCap")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.allModeCapHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:1,max:20,value:eq.allModeCap,onChange:e=>eO(t=>({...t,allModeCap:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.debounceMs")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.debounceMsHint")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.Input,{type:"number",min:50,max:1e3,value:eq.debounceMs,onChange:e=>eO(t=>({...t,debounceMs:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"ms"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.search.snippetLength")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.search.snippetLengthHint")})]}),(0,t.jsx)(r.Input,{type:"number",min:20,max:500,value:eq.snippetLength,onChange:e=>eO(t=>({...t,snippetLength:Number(e.target.value)})),className:"w-24 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:ts,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.missions.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.missions.desc")})]}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.minCols")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.minCols,onChange:e=>eG(t=>({...t,minCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.maxCols")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.maxCols,onChange:e=>eG(t=>({...t,maxCols:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.minRows")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.minRows,onChange:e=>eG(t=>({...t,minRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)("label",{className:"text-sm font-medium flex-1",children:x("settings.config.missions.maxRows")}),(0,t.jsx)(r.Input,{type:"number",min:1,max:10,value:eA.maxRows,onChange:e=>eG(t=>({...t,maxRows:Number(e.target.value)})),className:"w-20 text-right rounded-lg border-border/50 bg-muted/30 focus:ring-2 focus:ring-amber-500/30"})]})]}),(0,t.jsx)(l.Button,{onClick:ta,className:"rounded-lg",children:x("common.save")})]}),(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-muted/50 p-5 space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold",children:x("settings.config.hooks.title")}),(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:x("settings.config.hooks.desc")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:x("settings.config.hooks.autoUploadTypes")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.hooks.autoUploadTypesHint")})]}),(0,t.jsx)(r.Input,{value:eW,onChange:e=>eY(e.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,t.jsx)(l.Button,{onClick:ti,className:"rounded-lg",children:x("common.save")}),(0,t.jsxs)("div",{className:"flex items-center gap-4 pt-4 border-t border-border/50",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:e_?.installed?x("settings.config.hooks.installed"):x("settings.config.hooks.notInstalled")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:x("settings.config.hooks.installHint")})]}),(0,t.jsx)(l.Button,{variant:e_?.installed?"destructive":"default",onClick:tn,disabled:eJ||!e_,className:"rounded-lg",children:e_?.installed?x("settings.config.hooks.uninstall"):x("settings.config.hooks.install")})]})]}),(0,t.jsx)(g.Dialog,{open:!!eU,onOpenChange:e=>!e&&ez(null),children:(0,t.jsxs)(g.DialogContent,{children:[(0,t.jsxs)(g.DialogHeader,{children:[(0,t.jsx)(g.DialogTitle,{children:x("settings.config.git.deleteConfirm")}),(0,t.jsx)(g.DialogDescription,{children:x("settings.config.git.deleteConfirmMessage")})]}),(0,t.jsxs)(g.DialogFooter,{children:[(0,t.jsx)(l.Button,{variant:"outline",onClick:()=>ez(null),children:x("settings.config.git.cancel")}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:()=>eU&&to(eU),children:x("settings.config.git.delete")})]})]})})]});case"notifications":return(0,t.jsx)("div",{className:"divide-y divide-border/50",children:(0,t.jsxs)("div",{className:"flex items-center justify-between py-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm font-medium",children:x("settings.notifications.enable")}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:x("settings.notifications.enableDesc")})]}),(0,t.jsx)(m.Switch,{checked:eZ,onCheckedChange:tc})]})})}}()]})})]})}e.s(["default",0,function(){return(0,t.jsx)(G,{})}],255779)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,593835,e=>{"use strict";var t=e.i(432377),r=e.i(631325),a=e.i(309542),s=e.i(265826),l=e.i(555159),n=e.i(478430),i=e.i(565037),o=e.i(625054);let c=[{key:"notes",icon:l.FileText},{key:"assets",icon:n.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,o.useI18n)(),n=(0,a.usePathname)(),i=c.find(e=>n.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4 py-2",children:[(0,t.jsxs)(r.default,{href:`/workspaces/${e}`,className:"mr-2 flex items-center gap-1.5 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(s.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),c.map(a=>{let s=a.icon,n=i===a.key;return(0,t.jsxs)(r.default,{href:`/workspaces/${e}/${a.key}`,className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${n?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.key)})]})}])},265826,e=>{"use strict";let t=(0,e.i(863961).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],265826)},726111,e=>{"use strict";var t=e.i(432377),r=e.i(937756);e.s(["EmptyState",0,function({icon:e,title:a,description:s,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:s}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},787207,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},414588,671705,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("402017afc57d09f77c586036e5a209c6440b02e3ea",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],414588);let a=(0,t.createServerReference)("40a6c78693aa8ed7d908abda7866e675fa23c4120d",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,a],671705)},950354,e=>{"use strict";var t=e.i(432377),r=e.i(85212),a=e.i(780156),s=e.i(946960),l=e.i(593835),n=e.i(625054),i=e.i(787207),o=e.i(414588),c=e.i(543485);let d=(0,c.createServerReference)("608bf387e36d9578316455ead1e0d39f46de1e8bd3",c.callServer,void 0,c.findSourceMapURL,"updateNote");var x=e.i(671705);let m=(0,c.createServerReference)("608d975ebb45d4bc41ace948b2e88321248d58373e",c.callServer,void 0,c.findSourceMapURL,"getProjectNotes");var u=e.i(937756);function p({active:e,onSelect:r}){let{t:a}=(0,n.useI18n)();return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>r("all"),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===e?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a("notes.allCategories")}),i.NOTE_CATEGORIES_PRESET.map(a=>(0,t.jsx)("button",{onClick:()=>r(a),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",e===a?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a},a))]})}var h=e.i(711296),g=e.i(610874),f=e.i(555159),j=e.i(726111),b=e.i(923344),v=e.i(909260),N=e.i(788475),y=e.i(67006);function S({note:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)(),l=e.content.slice(0,300);return(0,t.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,t.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>r(e),className:"text-muted-foreground","aria-label":s("notes.edit"),children:(0,t.jsx)(b.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>a(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":s("notes.delete"),children:(0,t.jsx)(v.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"mb-2 pr-16",children:(0,t.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:e.title})}),(0,t.jsx)("span",{className:"mb-3 inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:e.category}),(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-h-24 overflow-hidden text-muted-foreground",children:(0,t.jsx)(N.default,{remarkPlugins:[y.default],children:l})})]})}function w({notes:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)();return 0===e.length?(0,t.jsx)(j.EmptyState,{icon:f.FileText,title:s("notes.empty"),description:s("notes.emptyHint")}):(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,t.jsx)(S,{note:e,onEdit:r,onDelete:a},e.id))})}var E=e.i(540032);function C({value:e,onChange:r}){return(0,t.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,t.jsx)(E.Textarea,{value:e,onChange:e=>r(e.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,t.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,t.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border prose prose-sm dark:prose-invert max-w-none",children:(0,t.jsx)(N.default,{remarkPlugins:[y.default],children:e})})})]})}e.s(["NotesPageClient",0,function({allWorkspaces:e,initialWorkspaceId:c,initialProjectId:u,initialNotes:f}){let j,b,{t:v}=(0,n.useI18n)(),[N,y]=(0,r.useTransition)(),[S,E]=(0,r.useState)(c),[T,k]=(0,r.useState)(u),[I,R]=(0,r.useState)(f),[O,P]=(0,r.useState)("all"),[A,_]=(0,r.useState)(null),[L,$]=(0,r.useState)(!1),[D,B]=(0,r.useState)(""),[M,G]=(0,r.useState)(""),[U,z]=(0,r.useState)(i.NOTE_CATEGORIES_PRESET[3]),[V,H]=(0,r.useState)(c),[F,W]=(0,r.useState)(u),K=e.find(e=>e.id===S),Y=K?.projects??[],q=e.find(e=>e.id===V),J=q?.projects??[],Q=(0,r.useCallback)(e=>{e?y(async()=>{R(await m(e))}):R([])},[y]),X=async()=>{F&&D.trim()&&(await (0,o.createNote)({title:D.trim(),content:M,category:U,projectId:F}),$(!1),F===T&&Q(T))},Z=async()=>{A&&D.trim()&&(await d(A.id,{title:D.trim(),content:M,category:U}),_(null),Q(T))},ee=async e=>{let t=I.find(t=>t.id===e);!t||confirm(v("notes.deleteConfirm",{title:t.title}))&&(await (0,x.deleteNote)(e),Q(T))},et="all"===O?I.map(e=>({...e,updatedAt:new Date(e.updatedAt)})):I.filter(e=>e.category===O).map(e=>({...e,updatedAt:new Date(e.updatedAt)})),er=L||null!==A;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(l.SubPageNav,{workspaceId:S}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(g.Select,{value:S,onValueChange:t=>t&&(t=>{if(t===S)return;E(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;k(a?.id??null),P("all"),Q(a?.id??null)})(t),children:[(0,t.jsx)(g.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===S)?.name??S})}),(0,t.jsx)(g.SelectContent,{children:e.map(e=>(0,t.jsx)(g.SelectItem,{value:e.id,children:e.name},e.id))})]}),Y.length>0&&(0,t.jsxs)(g.Select,{value:T??"",onValueChange:e=>e&&void(e!==T&&(k(e),P("all"),Q(e))),children:[(0,t.jsx)(g.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(j=Y.find(e=>e.id===T))?j.alias?`${j.name} (${j.alias})`:j.name:""})}),(0,t.jsx)(g.SelectContent,{children:Y.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),!er&&(0,t.jsxs)(h.Button,{onClick:()=>{B(""),G(""),z(i.NOTE_CATEGORIES_PRESET[3]),H(S),W(T),_(null),$(!0)},className:"ml-auto bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:v("notes.newNote")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:er?(0,t.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!A&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.workspace")}),(0,t.jsxs)(g.Select,{value:V,onValueChange:t=>t&&(t=>{if(t===V)return;H(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;W(a?.id??null)})(t),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===V)?.name??V})}),(0,t.jsx)(g.SelectContent,{children:e.map(e=>(0,t.jsx)(g.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),!A&&J.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.project")}),(0,t.jsxs)(g.Select,{value:F??"",onValueChange:e=>e&&W(e),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(b=J.find(e=>e.id===F))?b.alias?`${b.name} (${b.alias})`:b.name:""})}),(0,t.jsx)(g.SelectContent,{children:J.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.categoryLabel")}),(0,t.jsxs)(g.Select,{value:U,onValueChange:e=>e&&z(e),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:U})}),(0,t.jsx)(g.SelectContent,{children:i.NOTE_CATEGORIES_PRESET.map(e=>(0,t.jsx)(g.SelectItem,{value:e,children:e},e))})]})]})]}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>B(e.target.value),placeholder:v("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,t.jsx)(C,{value:M,onChange:G}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{$(!1),_(null)},children:v("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:A?Z:X,disabled:!D.trim()||!A&&!F,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:v("notes.save")})]})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(p,{active:O,onSelect:P}),(0,t.jsxs)("div",{className:`relative ${N?"opacity-40 pointer-events-none":""} transition-opacity`,children:[N&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(s.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===Y.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:v("notes.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:v("notes.noProjectHint")})]}):(0,t.jsx)(w,{notes:et,onEdit:e=>{B(e.title),G(e.content),z(e.category),_(e),$(!1)},onDelete:ee})]})]})})]})}],950354)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,593835,e=>{"use strict";var t=e.i(432377),r=e.i(631325),a=e.i(309542),s=e.i(265826),l=e.i(555159),n=e.i(478430),i=e.i(565037),o=e.i(625054);let c=[{key:"notes",icon:l.FileText},{key:"assets",icon:n.FolderOpen},{key:"archive",icon:i.Archive}];e.s(["SubPageNav",0,function({workspaceId:e}){let{t:l}=(0,o.useI18n)(),n=(0,a.usePathname)(),i=c.find(e=>n.includes(`/${e.key}`))?.key;return(0,t.jsxs)("div",{className:"header-sm flex items-center gap-1 px-4 py-2",children:[(0,t.jsxs)(r.default,{href:`/workspaces/${e}`,className:"mr-2 flex items-center gap-1.5 rounded-md px-2 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(s.ArrowLeft,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l("archive.backToBoard")})]}),(0,t.jsx)("span",{className:"mr-2 h-4 w-px bg-border"}),c.map(a=>{let s=a.icon,n=i===a.key;return(0,t.jsxs)(r.default,{href:`/workspaces/${e}/${a.key}`,className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${n?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`,children:[(0,t.jsx)(s,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${a.key}`)})]},a.key)})]})}])},265826,e=>{"use strict";let t=(0,e.i(863961).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],265826)},726111,e=>{"use strict";var t=e.i(432377),r=e.i(937756);e.s(["EmptyState",0,function({icon:e,title:a,description:s,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex h-48 flex-col items-center justify-center gap-2 text-center",n),children:[e&&(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/40"}),(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:a}),s&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:s}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},787207,e=>{"use strict";e.s(["BOARD_COLUMNS",0,[{id:"TODO",label:"To Do",color:"bg-slate-400"},{id:"IN_PROGRESS",label:"In Progress",color:"bg-amber-400"},{id:"IN_REVIEW",label:"In Review",color:"bg-sky-400"},{id:"DONE",label:"Done",color:"bg-emerald-400"},{id:"CANCELLED",label:"Cancelled",color:"bg-rose-400"}],"NOTE_CATEGORIES_PRESET",0,["账号","环境","需求","备忘"],"PRIORITY_CONFIG",0,{LOW:{label:"低",color:"bg-slate-500/20 text-slate-300 border border-slate-500/30"},MEDIUM:{label:"中",color:"bg-amber-500/20 text-amber-300 border border-amber-500/30"},HIGH:{label:"高",color:"bg-orange-500/20 text-orange-300 border border-orange-500/30"},CRITICAL:{label:"紧急",color:"bg-rose-500/20 text-rose-300 border border-rose-500/30"}},"TOWER_LABEL_NAME",0,"Tower"])},155707,139753,e=>{"use strict";var t=e.i(543485);let r=(0,t.createServerReference)("404cc46297cf006109589a7469e910dfa8e96ab050",t.callServer,void 0,t.findSourceMapURL,"createNote");e.s(["createNote",0,r],155707);let a=(0,t.createServerReference)("4025bb6daa00d465d9b11ae56d8faea7ce07999c31",t.callServer,void 0,t.findSourceMapURL,"deleteNote");e.s(["deleteNote",0,a],139753)},950354,e=>{"use strict";var t=e.i(432377),r=e.i(85212),a=e.i(780156),s=e.i(946960),l=e.i(593835),n=e.i(625054),i=e.i(787207),o=e.i(155707),c=e.i(543485);let d=(0,c.createServerReference)("60d070437a80a97253d1873f6ca0e131794631978b",c.callServer,void 0,c.findSourceMapURL,"updateNote");var x=e.i(139753);let m=(0,c.createServerReference)("60adc81288027db17f2450dd40e919091789247255",c.callServer,void 0,c.findSourceMapURL,"getProjectNotes");var u=e.i(937756);function p({active:e,onSelect:r}){let{t:a}=(0,n.useI18n)();return(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)("button",{onClick:()=>r("all"),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors","all"===e?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a("notes.allCategories")}),i.NOTE_CATEGORIES_PRESET.map(a=>(0,t.jsx)("button",{onClick:()=>r(a),className:(0,u.cn)("rounded-lg px-3 py-1 text-xs font-medium transition-colors",e===a?"bg-primary/15 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent"),children:a},a))]})}var h=e.i(711296),g=e.i(610874),f=e.i(555159),j=e.i(726111),b=e.i(923344),v=e.i(909260),N=e.i(788475),y=e.i(67006);function S({note:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)(),l=e.content.slice(0,300);return(0,t.jsxs)("div",{className:"group relative rounded-lg border border-border bg-card p-4 transition-colors hover:border-border/80 hover:bg-accent/20",children:[(0,t.jsxs)("div",{className:"absolute right-3 top-3 flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>r(e),className:"text-muted-foreground","aria-label":s("notes.edit"),children:(0,t.jsx)(b.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>a(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":s("notes.delete"),children:(0,t.jsx)(v.Trash2,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"mb-2 pr-16",children:(0,t.jsx)("h3",{className:"truncate text-sm font-semibold text-foreground",children:e.title})}),(0,t.jsx)("span",{className:"mb-3 inline-block rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground",children:e.category}),(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert max-h-24 overflow-hidden text-muted-foreground",children:(0,t.jsx)(N.default,{remarkPlugins:[y.default],children:l})})]})}function w({notes:e,onEdit:r,onDelete:a}){let{t:s}=(0,n.useI18n)();return 0===e.length?(0,t.jsx)(j.EmptyState,{icon:f.FileText,title:s("notes.empty"),description:s("notes.emptyHint")}):(0,t.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:e.map(e=>(0,t.jsx)(S,{note:e,onEdit:r,onDelete:a},e.id))})}var E=e.i(540032);function C({value:e,onChange:r}){return(0,t.jsxs)("div",{className:"relative grid grid-cols-2 gap-4 flex-1 min-h-64",children:[(0,t.jsx)(E.Textarea,{value:e,onChange:e=>r(e.target.value),className:"absolute inset-0 w-1/2 pr-2 resize-none font-mono text-sm border rounded-md p-3 bg-background text-foreground border-border focus:outline-none focus:ring-1 focus:ring-ring",placeholder:"Write Markdown here..."}),(0,t.jsx)("div",{className:"absolute inset-0 left-1/2 pl-2",children:(0,t.jsx)("div",{className:"h-full overflow-y-auto border rounded-md p-3 border-border prose prose-sm dark:prose-invert max-w-none",children:(0,t.jsx)(N.default,{remarkPlugins:[y.default],children:e})})})]})}e.s(["NotesPageClient",0,function({allWorkspaces:e,initialWorkspaceId:c,initialProjectId:u,initialNotes:f}){let j,b,{t:v}=(0,n.useI18n)(),[N,y]=(0,r.useTransition)(),[S,E]=(0,r.useState)(c),[T,k]=(0,r.useState)(u),[I,R]=(0,r.useState)(f),[O,P]=(0,r.useState)("all"),[A,_]=(0,r.useState)(null),[L,$]=(0,r.useState)(!1),[D,B]=(0,r.useState)(""),[M,G]=(0,r.useState)(""),[U,z]=(0,r.useState)(i.NOTE_CATEGORIES_PRESET[3]),[V,H]=(0,r.useState)(c),[F,W]=(0,r.useState)(u),K=e.find(e=>e.id===S),Y=K?.projects??[],q=e.find(e=>e.id===V),J=q?.projects??[],Q=(0,r.useCallback)(e=>{e?y(async()=>{R(await m(e))}):R([])},[y]),X=async()=>{F&&D.trim()&&(await (0,o.createNote)({title:D.trim(),content:M,category:U,projectId:F}),$(!1),F===T&&Q(T))},Z=async()=>{A&&D.trim()&&(await d(A.id,{title:D.trim(),content:M,category:U}),_(null),Q(T))},ee=async e=>{let t=I.find(t=>t.id===e);!t||confirm(v("notes.deleteConfirm",{title:t.title}))&&(await (0,x.deleteNote)(e),Q(T))},et="all"===O?I.map(e=>({...e,updatedAt:new Date(e.updatedAt)})):I.filter(e=>e.category===O).map(e=>({...e,updatedAt:new Date(e.updatedAt)})),er=L||null!==A;return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(l.SubPageNav,{workspaceId:S}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(g.Select,{value:S,onValueChange:t=>t&&(t=>{if(t===S)return;E(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;k(a?.id??null),P("all"),Q(a?.id??null)})(t),children:[(0,t.jsx)(g.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===S)?.name??S})}),(0,t.jsx)(g.SelectContent,{children:e.map(e=>(0,t.jsx)(g.SelectItem,{value:e.id,children:e.name},e.id))})]}),Y.length>0&&(0,t.jsxs)(g.Select,{value:T??"",onValueChange:e=>e&&void(e!==T&&(k(e),P("all"),Q(e))),children:[(0,t.jsx)(g.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(j=Y.find(e=>e.id===T))?j.alias?`${j.name} (${j.alias})`:j.name:""})}),(0,t.jsx)(g.SelectContent,{children:Y.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),!er&&(0,t.jsxs)(h.Button,{onClick:()=>{B(""),G(""),z(i.NOTE_CATEGORIES_PRESET[3]),H(S),W(T),_(null),$(!0)},className:"ml-auto bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:v("notes.newNote")})]})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden px-6 py-4 flex flex-col",children:er?(0,t.jsxs)("div",{className:"flex flex-col gap-4 flex-1 min-h-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[!A&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.workspace")}),(0,t.jsxs)(g.Select,{value:V,onValueChange:t=>t&&(t=>{if(t===V)return;H(t);let r=e.find(e=>e.id===t),a=r?.projects[0]??null;W(a?.id??null)})(t),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[140px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===V)?.name??V})}),(0,t.jsx)(g.SelectContent,{children:e.map(e=>(0,t.jsx)(g.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),!A&&J.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.project")}),(0,t.jsxs)(g.Select,{value:F??"",onValueChange:e=>e&&W(e),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[160px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(b=J.find(e=>e.id===F))?b.alias?`${b.name} (${b.alias})`:b.name:""})}),(0,t.jsx)(g.SelectContent,{children:J.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground whitespace-nowrap",children:v("notes.categoryLabel")}),(0,t.jsxs)(g.Select,{value:U,onValueChange:e=>e&&z(e),children:[(0,t.jsx)(g.SelectTrigger,{className:"min-w-[120px] text-xs",children:(0,t.jsx)("span",{className:"truncate",children:U})}),(0,t.jsx)(g.SelectContent,{children:i.NOTE_CATEGORIES_PRESET.map(e=>(0,t.jsx)(g.SelectItem,{value:e,children:e},e))})]})]})]}),(0,t.jsx)("input",{type:"text",value:D,onChange:e=>B(e.target.value),placeholder:v("notes.titlePlaceholder"),className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,t.jsx)(C,{value:M,onChange:G}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{$(!1),_(null)},children:v("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:A?Z:X,disabled:!D.trim()||!A&&!F,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:v("notes.save")})]})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)(p,{active:O,onSelect:P}),(0,t.jsxs)("div",{className:`relative ${N?"opacity-40 pointer-events-none":""} transition-opacity`,children:[N&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)(s.Loader2,{className:"size-5 animate-spin text-muted-foreground"})}),0===Y.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-16 text-center",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-muted-foreground",children:v("notes.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:v("notes.noProjectHint")})]}):(0,t.jsx)(w,{notes:et,onEdit:e=>{B(e.title),G(e.content),z(e.category),_(e),$(!1)},onDelete:ee})]})]})})]})}],950354)}]);
|