tower-studio 0.2.20 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +25 -25
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/browse-fs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js +3 -2
- package/.next/standalone/.next/server/app/api/internal/assistant/chat/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +61 -61
- package/.next/standalone/.next/server/app/missions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/missions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page/server-reference-manifest.json +25 -25
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +25 -25
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/settings/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/settings/page/server-reference-manifest.json +41 -41
- package/.next/standalone/.next/server/app/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page/server-reference-manifest.json +76 -76
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/archive/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page/server-reference-manifest.json +80 -80
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/assets/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page/server-reference-manifest.json +57 -57
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/notes/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page/server-reference-manifest.json +59 -59
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page/server-reference-manifest.json +25 -25
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page/server-reference-manifest.json +68 -68
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/projects/[projectId]/versions/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page/server-reference-manifest.json +68 -68
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/[workspaceId]/tasks/[taskId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page/server-reference-manifest.json +43 -43
- package/.next/standalone/.next/server/app/workspaces/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/workspaces/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0eh8dj_.js +12 -0
- package/.next/standalone/.next/server/chunks/0se9_next_dist_esm_build_templates_app-route_0hrprmi.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05se6yk._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06m1r8x._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_6swdz._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0iyp~.k._.js +10 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3iihg._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ogh_qu._.js +10 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q.piu~._.js +9 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wuzc5o._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_0bkvm8c._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0iu._[workspaceId]_projects_[projectId]_versions_version-timeline-client_tsx_07o_kyi._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__02-6df-._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0e_-mj-._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0fzkdjl._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0f72pl_._.js → [root-of-the-server]__0hy3~f.._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0jymb~t._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0pu-v0l._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q-abig._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0q~lxnz._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0th0_fo._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ty1ao1._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0um1ugs._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z7je5_._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0.hrt0s._.js → [root-of-the-server]__10ol5vl._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_xv.._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__13vgkq5._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_00jadm8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0es22_y._.js → _03.a~r1._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_053zyvm._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0tua.9p._.js → _08x3jaa._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0-zk1xq._.js → _09j4imi._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_09r0_z9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0a554d8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0z-mopi._.js → _0aw2qq6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_0fhds8v._.js → _0bmywa6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0ghovf3._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_10sx3n7._.js → _0jyj~t3._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0r6gweb._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0rdyrfd._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0rt8jf_._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0unw1fq._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0uuzh5m._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0ln8vj0._.js → _0yakvlq._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0nzwk2y._.js → _13r9dxk._.js} +3 -3
- package/.next/standalone/.next/server/chunks/ssr/src_075s.rk._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_0djxlqx._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_0eufeyj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_agent-actions_ts_0~wc.sy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_actions_file-actions_ts_0gcvqwm._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_missions_missions-client_tsx_11429lj._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_onboarding_page_tsx_0xf7hpz._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_settings_page_tsx_0h9v7dr._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_assets_assets-page-client_tsx_0wyzpam._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_board-page-client_tsx_0gips66._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_workspaces_[workspaceId]_tasks_[taskId]_task-page-client_tsx_02t7blt._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +233 -233
- package/.next/standalone/.next/static/chunks/{0~7zlta-boej_.js → 00fv~h4rni5hv.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0m2o51rtidmxh.js → 00p3.tda-56.l.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0mqdumoz_frlg.js → 01tnwkggn5.s-.js} +1 -1
- package/.next/standalone/.next/static/chunks/02bobmiee9ss8.js +1 -0
- package/.next/standalone/.next/static/chunks/039ntokp82-em.js +1 -0
- package/.next/standalone/.next/static/chunks/{0j157xr-bax~d.js → 04yrp-8ps3q_-.js} +1 -1
- package/.next/standalone/.next/static/chunks/05.wfh773dxo9.js +1 -0
- package/.next/standalone/.next/static/chunks/06~1n6of8ll__.js +5 -0
- package/.next/standalone/.next/static/chunks/0_n2l3jehwcsq.js +1 -0
- package/.next/standalone/.next/static/chunks/{0m90vde-l0h1a.js → 0aq7ksckxr-8-.js} +2 -2
- package/.next/standalone/.next/static/chunks/0d4~4k4hv01ah.js +1 -0
- package/.next/standalone/.next/static/chunks/{08q54xdtb58sp.js → 0f1gk0.5slqqh.js} +1 -1
- package/.next/standalone/.next/static/chunks/0ip_37zz4f080.js +1 -0
- package/.next/standalone/.next/static/chunks/{15nh9t21_9u6i.js → 0j16~sj50uq_m.js} +1 -1
- package/.next/standalone/.next/static/chunks/0o8jf4a30e_ri.js +5 -0
- package/.next/standalone/.next/static/chunks/0ol16355~utic.js +5 -0
- package/.next/standalone/.next/static/chunks/{0wzn4nbo56gf3.js → 0pg_rf2cch5pv.js} +1 -1
- package/.next/standalone/.next/static/chunks/0pwe0m3i1rro1.js +1 -0
- package/.next/standalone/.next/static/chunks/{163o-5kdc6me5.js → 0rwca.wrfl3b9.js} +1 -1
- package/.next/standalone/.next/static/chunks/0srx~7bncp64q.js +5 -0
- package/.next/standalone/.next/static/chunks/{0bxz4rml4iaob.js → 0vyvdsh1mkl5d.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0vykez3mijj6f.js → 10h~50kdsu5fx.js} +1 -1
- package/.next/standalone/.next/static/chunks/{18aqm8uawnpl3.js → 15esfko8asvh7.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0yje2relcvr6r.js → 16sn2ij01qrfz.js} +1 -1
- package/.next/standalone/.next/static/chunks/{1157qwl1lq-uv.js → 17oxpxjm7_smn.js} +1 -1
- package/.next/standalone/package.json +1 -1
- package/package.json +1 -1
- package/skills/tower/SKILL.md +9 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o3ggen._.js +0 -12
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__08mkpqd._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0ntdmyn._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_07~q7qs._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_09b8zgw._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_0_2c7e0._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0mqxe~e._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_12e_1hd._.js +0 -3
- package/.next/standalone/.next/static/chunks/0-93a_ovah-e0.js +0 -5
- package/.next/standalone/.next/static/chunks/0.rw..0v.8a1-.js +0 -5
- package/.next/standalone/.next/static/chunks/0gh2r0ji~m34y.js +0 -1
- package/.next/standalone/.next/static/chunks/0odb2p6e7-8n8.js +0 -1
- package/.next/standalone/.next/static/chunks/0t0.k0pugrmxt.js +0 -1
- package/.next/standalone/.next/static/chunks/0xrhj92idqx72.js +0 -5
- package/.next/standalone/.next/static/chunks/0yj4qfp~pk5na.js +0 -1
- package/.next/standalone/.next/static/chunks/0zk-aoc.g8t8h.js +0 -1
- package/.next/standalone/.next/static/chunks/11~-fm76bj3r4.js +0 -1
- package/.next/standalone/.next/static/chunks/13wlh1lxhudv~.js +0 -1
- package/.next/standalone/.next/static/chunks/16pnb9m-vqs75.js +0 -5
- /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → zosKR5i2aA392qu0Ka1j9}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → zosKR5i2aA392qu0Ka1j9}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{QK0JGDY3UZSvD1SQgyL-w → zosKR5i2aA392qu0Ka1j9}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,254826,309735,e=>{"use strict";var t=e.i(990216);e.s([],254826),e.s(["Streamdown",()=>t.C],309735)},236967,e=>{"use strict";var t=e.i(289721),a=e.i(210702),s=e.i(538059),r=e.i(259846),l=e.i(645378),n=e.i(453889),i=e.i(487278),o=e.i(533499);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,s.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",children:[(0,t.jsxs)(a.default,{href:`/workspaces/${e}`,className:"mr-2 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:[(0,t.jsx)(r.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(s=>{let r=s.icon,n=i===s.key;return(0,t.jsxs)(a.default,{href:`/workspaces/${e}/${s.key}`,className:`inline-flex h-8 items-center gap-1.5 rounded-md px-3 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)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:l(`sidebar.${s.key}`)})]},s.key)})]})}])},245697,e=>{"use strict";let t=(0,e.i(572989).default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);e.s(["Package",0,t],245697)},259846,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],259846)},685149,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"])},567860,e=>{"use strict";let t=(0,e.i(572989).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",0,t],567860)},583329,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40761db40351e40c001ff439284f4ab6a350d93b1b",t.callServer,void 0,t.findSourceMapURL,"openInTerminal");e.s(["openInTerminal",0,a])},197550,852494,12659,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("4072804d823a8f55231ec0829fb98a68bc38646216",t.callServer,void 0,t.findSourceMapURL,"openInFileManager");e.s(["openInFileManager",0,a],197550);let s=(0,t.createServerReference)("40a7283207727ed21a6ecaca85b390988b3687e1dd",t.callServer,void 0,t.findSourceMapURL,"openInEditor");e.s(["openInEditor",0,s],852494);let r=(0,e.i(572989).default)("circle-play",[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["PlayCircle",0,r],12659)},736061,460707,e=>{"use strict";var t=e.i(572989);let a=(0,t.default)("folder-search",[["path",{d:"M10.7 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v4.1",key:"1bw5m7"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}]]);e.s(["FolderSearch",0,a],736061);let s=(0,t.default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["Code",0,s],460707)},35967,e=>{"use strict";var t=e.i(289721);let a=(0,e.i(572989).default)("milestone",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M12 3v3",key:"1n5kay"}],["path",{d:"M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",key:"8gz4t4"}]]);var s=e.i(533499);let r=["bg-sky-500/20 text-sky-300 border border-sky-500/30","bg-amber-500/20 text-amber-300 border border-amber-500/30","bg-violet-500/20 text-violet-300 border border-violet-500/30","bg-emerald-500/20 text-emerald-300 border border-emerald-500/30","bg-rose-500/20 text-rose-300 border border-rose-500/30","bg-cyan-500/20 text-cyan-300 border border-cyan-500/30","bg-indigo-500/20 text-indigo-300 border border-indigo-500/30"];function l(e){return r[function(e){let t=0;for(let a=0;a<e.length;a++)t=31*t+e.charCodeAt(a)>>>0;return t}(e)%r.length]}let n={PLANNED:"bg-slate-500/20 text-slate-300 border border-slate-500/30",ACTIVE:"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30",RELEASED:"bg-zinc-500/20 text-zinc-400 border border-zinc-500/30"};e.s(["TaskVersionTag",0,function({number:e,name:s,showName:r=!1,className:l="",title:n}){return(0,t.jsxs)("span",{className:`inline-flex items-center gap-1 rounded-md border border-border bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground ${l}`,title:n??(s?`${e} \xb7 ${s}`:e),children:[(0,t.jsx)(a,{className:"h-2.5 w-2.5 shrink-0"}),(0,t.jsx)("span",{className:"font-mono",children:e}),r&&s?(0,t.jsx)("span",{className:"max-w-[140px] truncate",children:s}):null]})},"VersionStatusBadge",0,function({status:e}){let{t:a}=(0,s.useI18n)();return(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${n[e]}`,children:a(`version.status.${e}`)})},"VersionTypeBadge",0,function({name:e}){let{t:a}=(0,s.useI18n)();return e?(0,t.jsx)("span",{className:`inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium ${l(e)}`,children:e}):(0,t.jsx)("span",{className:"inline-flex items-center rounded-full border border-border bg-muted/40 px-2 py-0.5 text-xs font-medium text-muted-foreground",children:a("version.type.uncategorized")})},"typeBadgeColor",0,l],35967)},980376,661149,e=>{"use strict";var t=e.i(289721),a=e.i(225061),s=e.i(975157),r=e.i(519455),l=e.i(670123);function n({...e}){return(0,t.jsx)(a.Dialog.Portal,{"data-slot":"sheet-portal",...e})}function i({className:e,...r}){return(0,t.jsx)(a.Dialog.Backdrop,{"data-slot":"sheet-overlay",className:(0,s.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...r})}e.s(["Sheet",0,function({...e}){return(0,t.jsx)(a.Dialog.Root,{"data-slot":"sheet",...e})},"SheetContent",0,function({className:e,children:o,side:c="right",showCloseButton:d=!0,...x}){return(0,t.jsxs)(n,{children:[(0,t.jsx)(i,{}),(0,t.jsxs)(a.Dialog.Popup,{"data-slot":"sheet-content","data-side":c,className:(0,s.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...x,children:[o,d&&(0,t.jsxs)(a.Dialog.Close,{"data-slot":"sheet-close",render:(0,t.jsx)(r.Button,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,t.jsx)(l.XIcon,{}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})},"SheetDescription",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Description,{"data-slot":"sheet-description",className:(0,s.cn)("text-sm text-muted-foreground",e),...r})},"SheetHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"sheet-header",className:(0,s.cn)("flex flex-col gap-0.5 p-4",e),...a})},"SheetTitle",0,function({className:e,...r}){return(0,t.jsx)(a.Dialog.Title,{"data-slot":"sheet-title",className:(0,s.cn)("font-heading text-base font-medium text-foreground",e),...r})}],980376);var o=e.i(514798);let c=(0,o.createServerReference)("403b726cc7d9cff0549ec73b0b63b5550d931ba5bc",o.callServer,void 0,o.findSourceMapURL,"getTaskOverview");e.s(["getTaskOverview",0,c],661149)},606393,e=>{"use strict";let t=(0,e.i(572989).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",0,t],606393)},605005,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(980376),r=e.i(759684),l=e.i(487486),n=e.i(519455),i=e.i(533499),o=e.i(157972),c=e.i(661149),d=e.i(339733),x=e.i(197550),u=e.i(852494),m=e.i(583329),h=e.i(744798),p=e.i(685149),f=e.i(606393),g=e.i(875840),b=e.i(245697),j=e.i(12659),v=e.i(736061),y=e.i(460707),k=e.i(567860);function w({added:e,removed:a}){let{t:s}=(0,i.useI18n)();return(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-xs text-gray-500",children:[(0,t.jsx)("span",{children:s("diff.filesChanged",{count:String(e+a)})}),e>0&&(0,t.jsxs)("span",{className:"text-green-500",children:["+",e]}),a>0&&(0,t.jsxs)("span",{className:"text-red-500",children:["-",a]})]})}var N=e.i(35967),C=e.i(360112);e.s(["TaskOverviewDrawer",0,function({open:e,onOpenChange:S,taskId:I}){let{t:T}=(0,i.useI18n)(),[P,D]=(0,a.useState)(null),[E,M]=(0,a.useTransition)(),[$,A]=(0,a.useState)(!1),[R,L]=(0,a.useState)([]);(0,a.useEffect)(()=>{I&&e?M(async()=>{let e=await (0,c.getTaskOverview)(I);e&&(D(e),e.project?.workspaceId&&(0,d.getLabelsForWorkspace)(e.project.workspaceId).then(e=>{L(e.map(e=>({id:e.id,name:e.name,color:e.color,isBuiltin:e.isBuiltin})))}).catch(()=>L([])))}):D(null)},[I,e]);let O=P?p.BOARD_COLUMNS.find(e=>e.id===P.status):null,B=P?p.PRIORITY_CONFIG[P.priority]:null,F=P?.executions?.[0]??null,z=(()=>{if(F?.worktreePath)return F.worktreePath;let e=P?.project?.localPath;return e?P?.subPath?`${e}/${P.subPath}`:e:null})(),U=(()=>{let e=F?.gitStats;if(!e)return null;try{let t=JSON.parse(e);return{added:t.insertions??0,removed:t.deletions??0}}catch{return null}})(),_=async e=>{if(P?.project)try{let{autoStart:t,...a}=e;await (0,o.createTask)({...a,projectId:P.project.id}),C.toast.success(T("taskDrawer.duplicateSuccess")),A(!1),S(!1)}catch{C.toast.error(T("taskDrawer.duplicateFailed"))}};return(0,t.jsxs)(s.Sheet,{open:e,onOpenChange:S,children:[(0,t.jsxs)(s.SheetContent,{side:"right",className:"w-[380px] sm:max-w-[380px] p-0",children:[(0,t.jsxs)(s.SheetHeader,{className:"px-4 pt-4 pb-3 border-b border-border",children:[(0,t.jsx)(s.SheetTitle,{className:"text-base font-semibold leading-tight pr-8",children:P?.title??""}),(0,t.jsx)(s.SheetDescription,{className:"sr-only",children:T("taskDrawer.title")}),P&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[O&&(0,t.jsxs)(l.Badge,{variant:"secondary",className:"text-xs",children:[(0,t.jsx)("span",{className:`inline-block w-2 h-2 rounded-full mr-1.5 ${O.color}`}),O.label]}),B&&(0,t.jsx)(l.Badge,{variant:"secondary",className:`text-xs ${B.color}`,children:B.label}),P.version&&(0,t.jsx)(N.TaskVersionTag,{number:P.version.number,name:P.version.name,showName:!0})]})]}),(0,t.jsx)(r.ScrollArea,{className:"flex-1 h-[calc(100%-80px)]",children:E&&!P?(0,t.jsx)("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:T("assets.loading")}):P?(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1",children:T("taskDrawer.description")}),(0,t.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:P.description||T("taskDrawer.noDescription")})]}),P.labels.length>0&&(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:T("taskDrawer.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:P.labels.map(e=>(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs",style:{backgroundColor:`${e.label.color}20`,color:e.label.color,borderColor:`${e.label.color}40`},children:e.label.name},e.label.id))})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(f.Calendar,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:T("taskDrawer.createdAt")}),(0,t.jsx)("span",{className:"text-foreground",children:new Date(P.createdAt).toLocaleDateString()})]}),(0,t.jsxs)("section",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(b.Package,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:T("taskDrawer.resources")}),(0,t.jsx)("span",{className:"text-foreground",children:P._count.assets})]}),(0,t.jsxs)("section",{children:[(0,t.jsx)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:T("taskDrawer.fileChanges")}),U?(0,t.jsx)(w,{added:U.added,removed:U.removed}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:T("taskDrawer.noFileChanges")})]}),(0,t.jsxs)("section",{children:[(0,t.jsxs)("h4",{className:"text-xs font-medium text-muted-foreground mb-1.5 flex items-center gap-1.5",children:[(0,t.jsx)(j.PlayCircle,{className:"h-3.5 w-3.5"}),T("taskDrawer.lastExecution")]}),F?(0,t.jsxs)("div",{className:"rounded-md border border-border p-2.5 text-sm",children:[(0,t.jsx)(l.Badge,{variant:"secondary",className:"text-xs mb-1.5",children:F.status}),F.summary&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-4",children:F.summary.slice(0,200)})]}):(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:T("taskDrawer.noExecution")})]}),z&&(0,t.jsxs)("section",{className:"flex flex-col",children:[(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,x.openInFileManager)(z)}catch(e){console.error("openInFileManager failed:",e),C.toast.error(T("git.openInFileManagerFailed"))}},children:[(0,t.jsx)(v.FolderSearch,{className:"h-3.5 w-3.5 shrink-0"}),T("git.openInFileManager")]}),(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,u.openInEditor)(z)}catch(e){console.error("openInEditor failed:",e),C.toast.error(T("git.openInEditorFailed"))}},children:[(0,t.jsx)(y.Code,{className:"h-3.5 w-3.5 shrink-0"}),T("git.openInEditor")]}),(0,t.jsxs)(n.Button,{variant:"ghost",className:"w-full h-8 justify-start gap-2 px-2 text-xs text-muted-foreground",onClick:async()=>{try{await (0,m.openInTerminal)(z)}catch(e){console.error("openInTerminal failed:",e),C.toast.error(T("git.openInTerminalFailed"))}},children:[(0,t.jsx)(k.Terminal,{className:"h-3.5 w-3.5 shrink-0"}),T("git.openInTerminal")]})]}),(0,t.jsx)("section",{children:(0,t.jsxs)(n.Button,{variant:"default",className:"w-full",onClick:()=>{P&&A(!0)},disabled:!P,children:[(0,t.jsx)(g.Copy,{className:"h-4 w-4"}),T("taskDrawer.duplicate")]})})]}):null})]}),P?.project&&(0,t.jsx)(h.CreateTaskDialog,{open:$,onOpenChange:A,onSubmit:_,labels:R,projectType:P.project.type,projectLocalPath:P.project.localPath,prefillFromTask:{title:P.title,description:P.description,priority:P.priority,subPath:P.subPath,labelIds:P.labels.map(e=>e.label.id),baseBranch:P.baseBranch}})]})}],605005)},368490,e=>{"use strict";var t=e.i(776405);e.s(["ChevronRight",()=>t.default])},922541,e=>{"use strict";let t=(0,e.i(572989).default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);e.s(["RotateCcw",0,t],922541)},912505,e=>{"use strict";var t=e.i(289721),a=e.i(975157);e.s(["EmptyState",0,function({icon:e,title:s,description:r,action:l,className:n}){return(0,t.jsxs)("div",{className:(0,a.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:s}),r&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:r}),l&&(0,t.jsx)("div",{className:"mt-2",children:l})]})}])},867533,e=>{"use strict";let t=(0,e.i(572989).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",0,t],867533)},631675,e=>{"use strict";let t=(0,e.i(572989).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,t],631675)},19671,e=>{"use strict";let t=(0,e.i(572989).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",0,t],19671)},796299,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("40a687436d6cfb65f9c73a1833051c6880315d0db5",t.callServer,void 0,t.findSourceMapURL,"deleteAsset");e.s(["deleteAsset",0,a])},937304,e=>{"use strict";let t=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif","apng"]);e.s(["isImageAsset",0,function(e,a){if(a?.startsWith("image/"))return!0;let s=e.split(".").pop()?.toLowerCase();return!!s&&t.has(s)},"localPathToApiUrl",0,function(e){let t=e.match(/(?:^|\/)(?:storage|data)\/assets\/([^/]+)\/([^/]+)$/);return t?`/api/files/assets/${t[1]}/${t[2]}`:e}])},438304,e=>{"use strict";var t=e.i(514798);let a=(0,t.createServerReference)("404c7c8c8659fa543c75c036f8ab21e65ffe609add",t.callServer,void 0,t.findSourceMapURL,"uploadAsset");e.s(["uploadAsset",0,a])},235357,144640,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(585012),r=e.i(657153),l=e.i(19671),n=e.i(368490),i=e.i(902539);let o=(0,e.i(572989).default)("chevrons-right",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var c=e.i(922541),d=e.i(533499);function x({children:e,onClick:a,title:s,disabled:r,...l}){return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||a()},title:s,disabled:r,className:"inline-flex h-8 w-8 items-center justify-center rounded-md text-white/80 hover:bg-white/15 hover:text-white disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-white/80 transition-colors",...l,children:e})}e.s(["ImageLightbox",0,function({imageUrl:e,filename:u,open:m,onOpenChange:h,assets:p,currentIndex:f,onIndexChange:g}){let{t:b}=(0,d.useI18n)(),[j,v]=(0,a.useState)(1),[y,k]=(0,a.useState)({x:0,y:0}),[w,N]=(0,a.useState)(!1),C=(0,a.useRef)(null),[S,I]=(0,a.useState)(!1),T=!!p&&p.length>1&&"number"==typeof f&&!!g,P=T&&f>0,D=T&&f<p.length-1,E=T?p.length:0,M=E>0?Math.ceil(E/10):0,$=T?Math.floor(f/10):0,A=10*$,R=Math.min(A+10,E),L=M>1,O=T&&$>0,B=T&&$<M-1;(0,a.useEffect)(()=>{I(!0)},[]),(0,a.useEffect)(()=>{v(1),k({x:0,y:0})},[e]),(0,a.useEffect)(()=>{if(!m)return;let e=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=e}},[m]);let F=(0,a.useCallback)(()=>h(!1),[h]),z=(0,a.useCallback)(()=>{T&&P&&g(f-1)},[T,P,g,f]),U=(0,a.useCallback)(()=>{T&&D&&g(f+1)},[T,D,g,f]),_=(0,a.useCallback)(()=>{T&&O&&g(($-1)*10)},[T,O,g,$]),V=(0,a.useCallback)(()=>{T&&B&&g(Math.min(($+1)*10,E-1))},[T,B,g,$,E]),H=(0,a.useCallback)(()=>{v(e=>Math.min(8,1.25*e))},[]),G=(0,a.useCallback)(()=>{v(e=>{let t=Math.max(.1,e/1.25);return t<=1&&k({x:0,y:0}),t})},[]),W=(0,a.useCallback)(()=>{v(1),k({x:0,y:0})},[]);(0,a.useEffect)(()=>{if(!m)return;let e=e=>{switch(e.key){case"Escape":e.preventDefault(),F();break;case"ArrowLeft":T&&(e.preventDefault(),z());break;case"ArrowRight":T&&(e.preventDefault(),U());break;case"+":case"=":e.preventDefault(),H();break;case"-":case"_":e.preventDefault(),G();break;case"0":e.preventDefault(),W()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[m,T,F,z,U,H,G,W]);let X=(0,a.useRef)(!1),Y=()=>{w&&N(!1),C.current=null},q=w?"cursor-grabbing":"cursor-grab";if(!m||!S)return null;let J=(0,t.jsxs)("div",{className:"fixed inset-0 z-[100] bg-black/70 dark:bg-black/40 backdrop-blur-md",role:"dialog","aria-modal":"true","aria-label":b("assets.lightbox.zoomFit"),children:[(0,t.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 max-w-[80vw] truncate rounded-md bg-black/40 px-3 py-1 text-xs text-white/80 backdrop-blur-sm pointer-events-none",children:[u,T?` \xb7 ${f+1} / ${p.length}`:""]}),(0,t.jsx)("div",{className:`absolute inset-0 flex items-center justify-center overflow-hidden select-none ${q}`,onClick:e=>{e.target===e.currentTarget&&F()},onWheel:e=>{e.preventDefault();let t=-e.deltaY>0?1.25:.8;v(e=>{let a=Math.min(8,Math.max(.1,e*t));return a<=1&&k({x:0,y:0}),a})},children:e&&(0,t.jsx)("img",{src:e,alt:u,onClick:e=>{e.stopPropagation(),X.current&&(X.current=!1)},onPointerDown:e=>{0===e.button&&(e.stopPropagation(),X.current=!1,e.target.setPointerCapture?.(e.pointerId),C.current={x:e.clientX,y:e.clientY,panX:y.x,panY:y.y},N(!0))},onPointerMove:e=>{if(!C.current)return;let t=e.clientX-C.current.x,a=e.clientY-C.current.y;Math.abs(t)+Math.abs(a)>5&&(X.current=!0),w&&k({x:C.current.panX+t,y:C.current.panY+a})},onPointerUp:Y,onPointerLeave:Y,onPointerCancel:Y,className:"max-h-[88vh] max-w-[92vw] object-contain pointer-events-auto",style:{transform:`translate3d(${y.x}px, ${y.y}px, 0) scale(${j})`,transformOrigin:"center center",transition:w?"none":"transform 120ms ease-out",willChange:w?"transform":"auto"},draggable:!1})}),(0,t.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-10 flex flex-col items-center gap-2 max-w-[92vw]",onClick:e=>e.stopPropagation(),children:[T&&(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-1.5 py-1.5 backdrop-blur-md ring-1 ring-white/10 max-w-[92vw]",children:[L&&(0,t.jsx)(x,{onClick:_,title:`${b("assets.lightbox.prev")} (-10)`,"aria-label":`${b("assets.lightbox.prev")} (-10)`,disabled:!O,children:(0,t.jsx)(i.ChevronsLeft,{className:"h-4 w-4"})}),(0,t.jsx)(x,{onClick:z,title:b("assets.lightbox.prev"),"aria-label":b("assets.lightbox.prev"),disabled:!P,children:(0,t.jsx)(l.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"flex items-center gap-1.5",children:p.slice(A,R).map((e,a)=>{let s=A+a,r=s===f;return(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r||g(s)},title:e.filename,className:`shrink-0 h-12 w-12 overflow-hidden rounded-md transition-all ${r?"ring-2 ring-white opacity-100 scale-105":"opacity-60 hover:opacity-100 ring-1 ring-white/20"}`,children:(0,t.jsx)("img",{src:e.url,alt:e.filename,className:"h-full w-full object-cover",loading:"lazy",draggable:!1})},e.url+s)})}),(0,t.jsx)(x,{onClick:U,title:b("assets.lightbox.next"),"aria-label":b("assets.lightbox.next"),disabled:!D,children:(0,t.jsx)(n.ChevronRight,{className:"h-4 w-4"})}),L&&(0,t.jsx)(x,{onClick:V,title:`${b("assets.lightbox.next")} (+10)`,"aria-label":`${b("assets.lightbox.next")} (+10)`,disabled:!B,children:(0,t.jsx)(o,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-black/50 px-2 py-1.5 backdrop-blur-md ring-1 ring-white/10",children:[(0,t.jsxs)("span",{className:"px-2 text-xs text-white/80 tabular-nums select-none min-w-12 text-center",children:[Math.round(100*j),"%"]}),(0,t.jsx)(x,{onClick:W,title:b("assets.lightbox.reset"),"aria-label":b("assets.lightbox.reset"),disabled:1===j&&0===y.x&&0===y.y,children:(0,t.jsx)(c.RotateCcw,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"mx-1 h-5 w-px bg-white/20"}),(0,t.jsx)(x,{onClick:F,title:b("assets.lightbox.close"),"aria-label":b("assets.lightbox.close"),children:(0,t.jsx)(r.X,{className:"h-4 w-4"})})]})]})]});return(0,s.createPortal)(J,document.body)}],235357);var u=e.i(400355);e.i(254826);var m=e.i(309735),h=e.i(776639);e.s(["TextPreviewDialog",0,function({url:e,filename:s,open:r,onOpenChange:l}){let{t:n}=(0,d.useI18n)(),[i,o]=(0,a.useState)(null),[c,x]=(0,a.useState)(!1),[p,f]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!r||!e){o(null),f(null);return}let t=!1;return x(!0),f(null),o(null),fetch(e).then(e=>{let t=e.headers.get("content-length");if(t&&parseInt(t,10)>1048576)throw Error("FILE_TOO_LARGE");return e.text()}).then(e=>{if(e.length>1048576)throw Error("FILE_TOO_LARGE");t||(o(e),x(!1))}).catch(e=>{t||(e instanceof Error&&"FILE_TOO_LARGE"===e.message?f(n("assets.fileTooLarge")):f(n("assets.previewError")),x(!1))}),()=>{t=!0}},[r,e,n]);let g=s.split(".").pop()?.toLowerCase();return(0,t.jsx)(h.Dialog,{open:r,onOpenChange:l,children:(0,t.jsxs)(h.DialogContent,{className:"w-[min(960px,92vw)] max-w-none sm:max-w-none h-[85vh] max-h-[85vh] flex flex-col p-0 gap-0",children:[(0,t.jsx)("h3",{className:"text-sm font-medium truncate px-5 py-3 border-b border-border/50",children:s}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-5 py-4",children:(()=>{if(c)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 gap-2",children:[(0,t.jsx)(u.Loader2,{className:"size-5 animate-spin text-muted-foreground"}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:n("assets.loadingPreview")})]});if(p)return(0,t.jsx)("p",{className:"text-sm text-destructive",children:p});if(null===i)return null;if("md"===g)return(0,t.jsx)("div",{className:"text-sm leading-relaxed",children:(0,t.jsx)(m.Streamdown,{children:i})});if("json"===g){let e;try{e=JSON.stringify(JSON.parse(i),null,2)}catch{e=i}return(0,t.jsx)("pre",{className:"font-mono text-xs whitespace-pre-wrap text-foreground",children:e})}return(0,t.jsx)("pre",{className:"font-mono text-sm whitespace-pre-wrap text-foreground",children:i})})()})]})})}],144640)},734525,e=>{"use strict";var t=e.i(289721),a=e.i(965652),s=e.i(400355),r=e.i(236967),l=e.i(533499),n=e.i(796299),i=e.i(514798);let o=(0,i.createServerReference)("40353e50ff574937a46cf91c50afd922cfababa585",i.callServer,void 0,i.findSourceMapURL,"getProjectAssets");var c=e.i(453889),d=e.i(912505),x=e.i(645378),u=e.i(867533),m=e.i(998626),h=e.i(519455),p=e.i(937304);function f({asset:e,onPreview:a,onReveal:s,onDelete:r,onTaskClick:n}){var i;let{t:o}=(0,l.useI18n)(),d=(0,p.localPathToApiUrl)(e.path),g=(0,p.isImageAsset)(e.filename,e.mimeType);return(0,t.jsxs)("div",{className:"flex items-center gap-4 rounded-lg border border-border bg-card px-4 py-3 transition-colors hover:bg-accent/20",children:[(0,t.jsx)(h.Button,{variant:"ghost",onClick:()=>a(e),className:"flex-shrink-0 cursor-pointer p-0 h-auto",children:g?(0,t.jsx)("img",{src:d,alt:e.filename,className:"h-12 w-12 rounded object-cover border border-border"}):(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded border border-border bg-muted",children:(0,t.jsx)(x.FileText,{className:"h-6 w-6 text-muted-foreground"})})}),(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)("p",{className:"truncate text-sm font-medium text-foreground",children:e.filename}),e.taskTitle&&e.taskId&&(0,t.jsx)(h.Button,{variant:"ghost",onClick:t=>{t.stopPropagation(),n?.(e.taskId)},className:"flex-shrink-0 bg-blue-500/10 text-blue-600 dark:text-blue-400 text-xs px-1.5 py-0.5 rounded cursor-pointer hover:bg-blue-500/20 transition-colors h-auto",children:e.taskTitle.length>20?`[任务: ${e.taskTitle.slice(0,20)}...]`:`[任务: ${e.taskTitle}]`})]}),e.description&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground truncate",children:e.description}),(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-3 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:null===(i=e.size)?"-":i<1024?`${i} B`:i<1048576?`${(i/1024).toFixed(1)} KB`:i<0x40000000?`${(i/1048576).toFixed(1)} MB`:`${(i/0x40000000).toFixed(1)} GB`}),(0,t.jsx)("span",{children:new Date(e.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>a(e),className:"text-muted-foreground","aria-label":o("assets.preview"),children:(0,t.jsx)(u.Eye,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>s(e),className:"text-muted-foreground","aria-label":o("assets.revealInFinder"),children:(0,t.jsx)(c.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",onClick:()=>r(e.id),className:"text-muted-foreground hover:text-rose-400","aria-label":o("assets.delete"),children:(0,t.jsx)(m.Trash2,{className:"h-4 w-4"})})]})]})}function g({assets:e,onPreview:a,onReveal:s,onDelete:r,onTaskClick:n}){let{t:i}=(0,l.useI18n)();return 0===e.length?(0,t.jsx)(d.EmptyState,{icon:c.FolderOpen,title:i("assets.empty"),description:i("assets.emptyHint")}):(0,t.jsx)("div",{className:"flex flex-col gap-3",children:e.map(e=>(0,t.jsx)(f,{asset:e,onPreview:a,onReveal:s,onDelete:r,onTaskClick:n},e.id))})}var b=e.i(631675),j=e.i(657153),v=e.i(438304),y=e.i(624687),k=e.i(280027);function w({allWorkspaces:e,initialWsId:s,initialProjectId:r,onUploaded:n}){let i,{t:o}=(0,l.useI18n)(),c=(0,a.useRef)(null),[d,x]=(0,a.useState)(!1),[u,m]=(0,a.useState)(!1),[p,f]=(0,a.useState)(null),[g,N]=(0,a.useState)(s),[C,S]=(0,a.useState)(r),[I,T]=(0,a.useState)(""),P=e.find(e=>e.id===g),D=P?.projects??[],E=()=>{x(!1),f(null),c.current&&(c.current.value="")},M=async()=>{if(p&&C){m(!0);try{let e=new FormData;e.append("file",p),e.append("projectId",C),e.append("description",I.trim()),await (0,v.uploadAsset)(e),n(C),E()}finally{m(!1)}}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(h.Button,{onClick:()=>{N(s),S(r),f(null),T(""),x(!0)},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(b.Upload,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:o("assets.upload")})]}),d&&(0,t.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,t.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:E}),(0,t.jsxs)("div",{className:"relative w-full max-w-md rounded-lg border border-border bg-card p-6 shadow-lg",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:E,className:"absolute right-3 top-3 text-muted-foreground",children:(0,t.jsx)(j.X,{className:"h-4 w-4"})}),(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-4",children:o("assets.uploadTitle")}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.workspace")}),(0,t.jsxs)(k.Select,{value:g,onValueChange:t=>{var a;let s;return N(a=t??""),s=e.find(e=>e.id===a),void S(s?.projects[0]?.id??null)},children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:P?.name??g})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.project")}),D.length>0?(0,t.jsxs)(k.Select,{value:C??"",onValueChange:e=>S(e??""),children:[(0,t.jsx)(k.SelectTrigger,{className:"flex-1 text-xs",children:(0,t.jsx)("span",{className:"truncate",children:(i=D.find(e=>e.id===C))?i.alias?`${i.name} (${i.alias})`:i.name:C})}),(0,t.jsx)(k.SelectContent,{children:D.map(e=>{let a=e.alias?`${e.name} (${e.alias})`:e.name;return(0,t.jsx)(k.SelectItem,{value:e.id,children:a},e.id)})})]}):(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:o("assets.noProject")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0",children:o("assets.file")}),(0,t.jsx)("input",{type:"file",ref:c,onChange:e=>{f(e.target.files?.[0]??null)},className:"hidden"}),(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>{c.current?.click()},className:"flex-1 border-dashed bg-background px-3 py-2 text-xs text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors text-left justify-start",children:p?p.name:o("assets.selectFile")})]}),(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground w-16 shrink-0 pt-1.5",children:o("assets.description")}),(0,t.jsx)(y.Textarea,{value:I,onChange:e=>T(e.target.value),placeholder:o("assets.descriptionPlaceholder"),className:"flex-1 rounded-md border border-border bg-background px-3 py-2 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring resize-none h-20"})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 justify-end mt-6",children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:E,children:o("notes.cancel")}),(0,t.jsx)(h.Button,{onClick:M,disabled:!p||!C||!I.trim()||u,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:o(u?"assets.uploading":"assets.upload")})]})]})]})]})}var N=e.i(235357),C=e.i(144640),S=e.i(605005),I=e.i(360112);e.s(["AssetsPageClient",0,function({allWorkspaces:e,initialWorkspaceId:i,initialProjectId:c,initialAssets:d}){let x,{t:u}=(0,l.useI18n)(),[m,h]=(0,a.useTransition)(),[f,b]=(0,a.useState)(i),[j,v]=(0,a.useState)(c),[y,T]=(0,a.useState)(d),[P,D]=(0,a.useState)(null),E=e.find(e=>e.id===f),M=E?.projects??[],$=(0,a.useCallback)(e=>{e?h(async()=>{T(await o(e))}):T([])},[h]),[A,R]=(0,a.useState)(null),L=A?(0,p.isImageAsset)(A.filename,A.mimeType)?"image":/\.(txt|md|json)$/i.test(A.filename)?"text":null:null,O=y.filter(e=>(0,p.isImageAsset)(e.filename,e.mimeType)).map(e=>({id:e.id,url:(0,p.localPathToApiUrl)(e.path),filename:e.filename})),B=A?O.findIndex(e=>e.id===A.id):-1,F=async e=>{try{let t=await fetch("/api/internal/assets/reveal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e.path})});if(!t.ok){let e=await t.json().catch(()=>({}));I.toast.error(e.error||"Failed to reveal file")}}catch{I.toast.error("Failed to reveal file")}},z=async e=>{let t=y.find(t=>t.id===e);confirm(u("assets.deleteConfirm",{filename:t?.filename??e}))&&(await (0,n.deleteAsset)(e),$(j))};return(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsx)(r.SubPageNav,{workspaceId:f}),(0,t.jsxs)("div",{className:"header-sm flex items-center gap-3 px-6 py-2",children:[(0,t.jsxs)(k.Select,{value:f,onValueChange:t=>t&&(t=>{if(t===f)return;b(t);let a=e.find(e=>e.id===t),s=a?.projects[0]??null;v(s?.id??null),$(s?.id??null)})(t),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[120px]",children:(0,t.jsx)("span",{className:"truncate",children:e.find(e=>e.id===f)?.name??f})}),(0,t.jsx)(k.SelectContent,{children:e.map(e=>(0,t.jsx)(k.SelectItem,{value:e.id,children:e.name},e.id))})]}),M.length>0&&(0,t.jsxs)(k.Select,{value:j??"",onValueChange:e=>e&&void(e!==j&&(v(e),$(e))),children:[(0,t.jsx)(k.SelectTrigger,{className:"h-8 w-auto min-w-[140px]",children:(0,t.jsx)("span",{className:"truncate",children:(x=M.find(e=>e.id===j))?x.alias?`${x.name} (${x.alias})`:x.name:""})}),(0,t.jsx)(k.SelectContent,{children:M.map(e=>(0,t.jsxs)(k.SelectItem,{value:e.id,children:[e.name,e.alias?` (${e.alias})`:""]},e.id))})]}),(0,t.jsx)("div",{className:"ml-auto",children:(0,t.jsx)(w,{allWorkspaces:e,initialWsId:f,initialProjectId:j,onUploaded:e=>{e===j&&$(j)}})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto px-6 py-4",children:(0,t.jsxs)("div",{className:`relative ${m?"opacity-40 pointer-events-none":""} transition-opacity`,children:[m&&(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===M.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:u("assets.noProject")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground/60",children:u("assets.noProjectHint")})]}):(0,t.jsx)(g,{assets:y.map(e=>({...e,taskId:e.task?.id??null,taskTitle:e.task?.title??null})),onPreview:e=>{let t=(0,p.isImageAsset)(e.filename,e.mimeType),a=/\.(txt|md|json)$/i.test(e.filename);(t||a)&&R(e)},onReveal:F,onDelete:z,onTaskClick:D})]})}),(0,t.jsx)(N.ImageLightbox,{imageUrl:"image"===L&&B>=0?O[B].url:null,filename:"image"===L&&B>=0?O[B].filename:"",open:"image"===L,onOpenChange:e=>{e||R(null)},assets:O.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:B>=0?B:void 0,onIndexChange:e=>{let t=O[e];if(!t)return;let a=y.find(e=>e.id===t.id);a&&R({...a,taskId:a.task?.id??null,taskTitle:a.task?.title??null})}}),(0,t.jsx)(C.TextPreviewDialog,{url:"text"===L&&A?(0,p.localPathToApiUrl)(A.path):null,filename:A?.filename??"",open:"text"===L,onOpenChange:e=>{e||R(null)}}),(0,t.jsx)(S.TaskOverviewDrawer,{open:!!P,onOpenChange:e=>{e||D(null)},taskId:P})]})}],734525)},244455,e=>{e.v(t=>Promise.all(["static/chunks/075e-zs_kgc_g.js"].map(t=>e.l(t))).then(()=>t(629495)))},800307,e=>{e.v(t=>Promise.all(["static/chunks/0zm4fvu.lntrp.js"].map(t=>e.l(t))).then(()=>t(267483)))}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},244354,e=>{"use strict";async function t(e,s,r={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!a.ok)throw Error((await a.json()).error||`${s} failed`);return a.json()}e.s(["gitAction",0,t])},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let a=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,a],755696);let n=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,n],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let l=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,l],719493);let o=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,o],436539)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),a=e.i(48019),n=e.i(782516),i=e.i(755696),l=e.i(886156),o=e.i(400355),c=e.i(586564),d=e.i(719493),m=e.i(597746),h=e.i(368490),u=e.i(232280),x=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),M=e.i(755146),D=e.i(759684),L=e.i(746798),A=e.i(776639),F=e.i(793479),T=e.i(624687),B=e.i(533499);function E({open:e,onOpenChange:r,branches:a,currentBranch:n,localPath:i,onCreated:l,onError:c}){let{t:d}=(0,B.useI18n)(),[h,x]=(0,s.useState)(""),[f,p]=(0,s.useState)(n),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,M]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(x(""),p(n),j(""),k(""))},[e,n]);let D=[...new Set(a)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),L=async()=>{if(h.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:h.trim(),baseBranch:f})});if(e.ok)r(!1),l();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(A.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(A.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(A.DialogHeader,{children:(0,t.jsx)(A.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(F.Input,{value:h,onChange:e=>x(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&L()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>M(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:D.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),M(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(m.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(T.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(A.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:L,disabled:!h.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var I=e.i(360112),$=e.i(244354);let R={modified:l.FileEdit,added:a.FilePlus,deleted:n.FileMinus,untracked:i.FileQuestion,renamed:l.FileEdit},z={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},P={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function U(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/"),r=t;for(let t=0;t<e.length;t++){let a=e[t],n=t===e.length-1,i=e.slice(0,t+1).join("/");if(n)r.children.push({name:a,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function G({label:e,count:r,labelColor:a,tree:n,batchAction:i,batchLabel:l,batchIcon:o,onFileClick:c,onFileAction:d,fileActionIcon:m,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(h.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${a}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:n.map(e=>(0,t.jsx)(O,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:m,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function O({node:e,depth:a,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:m}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${a} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(h.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(x.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(O,{node:e,depth:a+1,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:m},e.path))]});let j=e.file,b=R[j.status]||r.File,w=z[j.status]||"text-muted-foreground",N=P[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>n(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":m??"",children:d}),m&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:m})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":o??"",children:l}),o&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:o})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:a="project"}){let n="task"===a,{t:i}=(0,B.useI18n)(),[l,h]=(0,s.useState)(null),[x,A]=(0,s.useState)(!0),[F,T]=(0,s.useState)(""),[R,z]=(0,s.useState)(!1),[P,O]=(0,s.useState)(!1),[H,W]=(0,s.useState)(!1),[V,K]=(0,s.useState)(!1),[q,J]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(""),Y=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(q)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){Y.current&&!Y.current.contains(e.target)&&J(!1)}},[q]);let[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();h({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{A(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,$.gitAction)(e,"stage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,$.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(F.trim()){z(!0);try{await (0,$.gitAction)(e,"commit",{message:F}),T(""),I.toast.success(i("git.commitSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{z(!1)}}},ea=async t=>{O(!0);try{await (0,$.gitAction)(e,"pull",t?{branch:t}:{}),I.toast.success(i("git.pullSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{O(!1)}},en=async t=>{W(!0);try{await (0,$.gitAction)(e,"push",t?{branch:t}:{}),I.toast.success(i("git.pushSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{W(!1)}},ei=async()=>{K(!0);try{await (0,$.gitAction)(e,"fetch"),I.toast.success(i("git.fetchSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{K(!1)}},el=async t=>{try{await (0,$.gitAction)(e,"checkout",{branch:t}),J(!1),I.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eo=async()=>{try{await (0,$.gitAction)(e,"stash-save",{message:F||void 0}),T(""),I.toast.success(i("git.stashSaved")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,$.gitAction)(e,"stash-pop",{index:0}),I.toast.success(i("git.stashApplied")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,$.gitAction)(e,"discard-file",{file:t}),I.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},em=async()=>{try{await (0,$.gitAction)(e,"discard-all"),I.toast.success(i("git.discardSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eh=async t=>{if("deleted"===t.status)return;let s=l?.topLevel??e;try{let a=await (0,$.gitAction)(e,"show",{file:t.file});r?.(t.file,a.content??"",s)}catch{r?.(t.file,"",s)}},eu=l?.changedFiles.filter(e=>e.staged)??[],ex=l?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>U(eu),[eu]),ep=(0,s.useMemo)(()=>U(ex),[ex]);if(x)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!l)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...l?.branches??[],...(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e))],eb=Q?ej.filter(e=>e.toLowerCase().includes(Q.toLowerCase())):ej;return(0,t.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[n?(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:l?.currentBranch||"—"})]})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:l?.currentBranch||"—"})]}):(0,t.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Y,children:[(0,t.jsxs)("button",{onClick:()=>{J(!q),X("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l?.currentBranch||void 0,children:l?.currentBranch||"—"})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${q?"rotate-180":""}`})]}),q&&(0,t.jsxs)("div",{className:"absolute left-0 top-full z-30 mt-1 min-w-full w-max max-w-[320px] rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:Q,onChange:e=>X(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>{let s=e===l?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?J(!1):el(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(m.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>el(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:ei,disabled:V,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${V?"animate-spin":""}`})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:()=>{J(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:F,onChange:e=>T(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:R||!F.trim()||0===eu.length,children:[R?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(m.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(M.DropdownMenu,{children:[(0,t.jsx)(M.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(M.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:er,disabled:!F.trim()||0===eu.length,children:[(0,t.jsx)(m.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===ex.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===eu.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:em,disabled:0===ex.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),disabled:P,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:P,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",l.behind]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",l.ahead]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ei,disabled:V,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${V?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eo,disabled:0===l.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),l.currentBranch]})]})]})]})]}),(0,t.jsxs)(D.ScrollArea,{className:"flex-1 min-h-0",children:[(0,t.jsx)(G,{label:i("git.stagedChanges"),count:eu.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:eh,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(G,{label:i("git.unstagedChanges"),count:ex.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:eh,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===l.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(m.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...l?.branches??[],...l?.remoteBranches??[]],currentBranch:l?.currentBranch??"",localPath:e,onCreated:async()=>{I.toast.success(i("git.createSuccess")),await ee()},onError:e=>I.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},14842,865514,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),a=e.i(232280),n=e.i(759686),i=e.i(960518),l=e.i(340873),o=e.i(400355),c=e.i(519455),d=e.i(912505),m=e.i(487486),h=e.i(776639),u=e.i(624687),x=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:a}=(0,x.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:a("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:a("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:a("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,x.useI18n)(),r=e.split("\n"),a=r.length>500,n=a?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:n.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),a&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:o,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,x.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[M,D]=(0,s.useState)(!1),[L,A]=(0,s.useState)(""),[F,T]=(0,s.useState)(!1),B=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[o.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>D(!0),className:"gap-2",children:[(0,t.jsx)(l.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===o.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:o.map(e=>{let s=v.has(e.filename),n=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&B(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(m.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:n,isLargeFold:!n&&i>200,onLoad:()=>B(e.filename)})})]},e.filename)})})}),(0,t.jsx)(h.Dialog,{open:M,onOpenChange:D,children:(0,t.jsxs)(h.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsx)(h.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(u.Textarea,{value:L,onChange:e=>A(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>D(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(L.trim()&&w){T(!0);try{await w(L.trim()),A(""),D(!1)}finally{T(!1)}}},disabled:!L.trim()||F,children:F?"...":y("diff.commit")})]})]})})]})}],14842);var g=e.i(538059);let j=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:r,taskId:a,taskTitle:n,baseBranch:i,fileCount:l,commitCount:d,commitLog:m=[],onMergeComplete:u}){let x=(0,g.useRouter)(),[f,p]=(0,s.useState)(!1),[b,w]=(0,s.useState)(null),N=async()=>{p(!0),w(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){r(!1),u(),x.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?w(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):w(t.error??"Merge failed")}catch{w("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(h.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(h.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsxs)(h.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(j,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:i})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),m.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:m.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>r(!1),disabled:f,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:N,disabled:f,className:"gap-2",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},849021,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("407261dd77a1aed555bfefb9fa4175dab402f0fc86",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},752299,753073,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c8e64a7609183658c499a723fb9ddc268c4b93828",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],752299);let r=(0,t.createServerReference)("40dbd9d9ece00eafcf38ec3c043d66e6df7a649cc3",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],753073)},974507,905523,619658,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("605e1a419b1d57c71f50b31c285b559cc200822a7a",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,s],974507);let r=(0,t.createServerReference)("4080b66c619f2654a2fee839c95fd37ce187381c88",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,r],905523);let a=(0,t.createServerReference)("603f511232cbef05181f32fde7b4bedb5dedee225f",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],619658)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),a=e.i(472074),n=e.i(301348),i=e.i(181209),l=e.i(400355),o=e.i(989383),c=e.i(12659),d=e.i(922541),m=e.i(486077),h=e.i(769824),u=e.i(519455),x=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(n.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:n,onContinueLatest:i}){let{t:l,locale:o}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(x.EmptyState,{icon:h.History,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(s=>{let h=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),x=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let a=Math.floor(r/60);if(a<60)return`${a}m ${r%60}s`;let n=Math.floor(a/60);return`${n}h ${a%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",n=s.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===r?n:1===r?"zh"===t?`昨天 ${n}`:`Yesterday ${n}`:r<7?"zh"===t?`${r}天前 ${n}`:`${r}d ago ${n}`:s.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+n}(s.startedAt??null,o)}),x&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",x,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||l("execution.noSummary")}),h&&(h.commits||h.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[h.commits?(0,t.jsxs)("span",{children:[h.commits," ",l("execution.commits")]}):null,h.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[h.filesChanged," ",l("execution.files")]})]}):null,h.insertions||h.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),h.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",h.insertions]}):null,h.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",h.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(m.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&n?(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>n(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(u.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(u.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])},852932,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("605021ab2307e226d867a3f69b8bb639a7acd99981",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,486077,e=>{"use strict";let t=(0,e.i(572989).default)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);e.s(["Lightbulb",0,t],486077)},375306,e=>{"use strict";let t=(0,e.i(572989).default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);e.s(["ArrowUpFromLine",0,t],375306)},244354,e=>{"use strict";async function t(e,s,r={}){let a=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s,path:e,...r})});if(!a.ok)throw Error((await a.json()).error||`${s} failed`);return a.json()}e.s(["gitAction",0,t])},491911,314411,e=>{"use strict";let t=(0,e.i(572989).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["default",0,t],314411),e.s(["File",0,t],491911)},48019,782516,755696,886156,586564,719493,436539,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);e.s(["FilePlus",0,s],48019);let r=(0,t.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]);e.s(["FileMinus",0,r],782516);let a=(0,t.default)("file-question-mark",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);e.s(["FileQuestion",0,a],755696);let n=(0,t.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]);e.s(["FileEdit",0,n],886156);let i=(0,t.default)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);e.s(["ArrowDown",0,i],586564);let l=(0,t.default)("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);e.s(["ArrowUp",0,l],719493);let o=(0,t.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["Minus",0,o],436539)},515135,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(491911),a=e.i(48019),n=e.i(782516),i=e.i(755696),l=e.i(886156),o=e.i(400355),c=e.i(586564),d=e.i(719493),m=e.i(597746),h=e.i(368490),u=e.i(232280),x=e.i(977982),f=e.i(436539),p=e.i(232545),g=e.i(49007),j=e.i(194358),b=e.i(487278),w=e.i(375306);let N=(0,e.i(572989).default)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var y=e.i(226145),v=e.i(738690),k=e.i(242941),C=e.i(998626),S=e.i(519455),M=e.i(755146),D=e.i(759684),L=e.i(746798),A=e.i(776639),F=e.i(793479),T=e.i(624687),B=e.i(533499);function E({open:e,onOpenChange:r,branches:a,currentBranch:n,localPath:i,onCreated:l,onError:c}){let{t:d}=(0,B.useI18n)(),[h,x]=(0,s.useState)(""),[f,p]=(0,s.useState)(n),[g,j]=(0,s.useState)(""),[b,w]=(0,s.useState)(!1),[N,k]=(0,s.useState)(""),[C,M]=(0,s.useState)(!1);(0,s.useEffect)(()=>{e&&(x(""),p(n),j(""),k(""))},[e,n]);let D=[...new Set(a)].filter(e=>e.toLowerCase().includes(N.toLowerCase())),L=async()=>{if(h.trim()){w(!0);try{let e=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"create-branch",path:i,branch:h.trim(),baseBranch:f})});if(e.ok)r(!1),l();else{let t=await e.json();c(t.error||"Unknown error")}}catch{c("Network error")}finally{w(!1)}}};return(0,t.jsx)(A.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(A.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(A.DialogHeader,{children:(0,t.jsx)(A.DialogTitle,{children:d("git.createBranch")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchName")}),(0,t.jsx)(F.Input,{value:h,onChange:e=>x(e.target.value),placeholder:d("git.branchNamePlaceholder"),className:"mt-1.5 font-mono text-xs",onKeyDown:e=>"Enter"===e.key&&L()})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.baseBranch")}),(0,t.jsxs)("div",{className:"relative mt-1.5",children:[(0,t.jsxs)("button",{onClick:()=>M(!C),className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:f,children:f})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 text-muted-foreground transition-transform ${C?"rotate-180":""}`})]}),C&&(0,t.jsxs)("div",{className:"absolute left-0 right-0 top-full z-20 mt-1 rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:N,onChange:e=>k(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsx)("div",{className:"max-h-40 overflow-auto py-1",children:D.map(e=>(0,t.jsxs)("button",{onClick:()=>{p(e),M(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left transition-colors ${e===f?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),e===f&&(0,t.jsx)(m.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},e))})]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d("git.branchDesc")}),(0,t.jsx)(T.Textarea,{value:g,onChange:e=>j(e.target.value),placeholder:d("git.branchDescPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(A.DialogFooter,{children:[(0,t.jsx)(S.Button,{variant:"outline",onClick:()=>r(!1),children:d("common.cancel")}),(0,t.jsxs)(S.Button,{onClick:L,disabled:!h.trim()||b,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[b?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,d("common.create")]})]})]})})}var I=e.i(360112),$=e.i(244354);let R={modified:l.FileEdit,added:a.FilePlus,deleted:n.FileMinus,untracked:i.FileQuestion,renamed:l.FileEdit},z={modified:"text-amber-400",added:"text-emerald-400",deleted:"text-rose-400",untracked:"text-muted-foreground",renamed:"text-sky-400"},P={modified:"M",added:"A",deleted:"D",untracked:"U",renamed:"R"};function U(e){let t={name:"",path:"",isDir:!0,children:[]};for(let s of e){let e=s.file.split("/"),r=t;for(let t=0;t<e.length;t++){let a=e[t],n=t===e.length-1,i=e.slice(0,t+1).join("/");if(n)r.children.push({name:a,path:i,isDir:!1,children:[],file:s});else{let e=r.children.find(e=>e.isDir&&e.name===a);e||(e={name:a,path:i,isDir:!0,children:[]},r.children.push(e)),r=e}}}return(function e(t){if(t.isDir&&(t.children=t.children.map(e),1===t.children.length&&t.children[0].isDir&&""!==t.name)){let e=t.children[0];return{...e,name:`${t.name}/${e.name}`}}return t})(t).children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name))}function G({label:e,count:r,labelColor:a,tree:n,batchAction:i,batchLabel:l,batchIcon:o,onFileClick:c,onFileAction:d,fileActionIcon:m,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g}){let[j,b]=(0,s.useState)(!0);return 0===r?null:(0,t.jsxs)("div",{className:"border-b border-border",children:[(0,t.jsxs)("div",{className:"group flex items-center justify-between px-2 py-1.5 hover:bg-accent/50 transition-colors",children:[(0,t.jsxs)("button",{onClick:()=>b(!j),className:"flex items-center gap-1 flex-1 min-w-0",children:[j?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(h.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsxs)("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${a}`,children:[e," (",r,")"]})]}),(0,t.jsx)(S.Button,{variant:"ghost",size:"icon-xs",onClick:i,className:"text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity","aria-label":l,children:o})]}),j&&(0,t.jsx)("div",{className:"pb-1",children:n.map(e=>(0,t.jsx)(O,{node:e,depth:0,onFileClick:c,onFileAction:d,fileActionIcon:m,fileActionLabel:x,onFileSecondaryAction:f,fileSecondaryIcon:p,fileSecondaryLabel:g},e.path))})]})}function O({node:e,depth:a,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:m}){let[f,p]=(0,s.useState)(!0),g={paddingLeft:`calc(${a} * 8px + 4px)`};if(e.isDir)return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{onClick:()=>p(!f),className:"flex w-full items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors text-left",style:g,children:[f?(0,t.jsx)(u.ChevronDown,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,t.jsx)(h.ChevronRight,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)(x.Folder,{className:"h-3.5 w-3.5 shrink-0 text-amber-400"}),(0,t.jsx)("span",{className:"text-[13px] text-muted-foreground truncate",children:e.name})]}),f&&e.children.sort((e,t)=>e.isDir!==t.isDir?e.isDir?-1:1:e.name.localeCompare(t.name)).map(e=>(0,t.jsx)(O,{node:e,depth:a+1,onFileClick:n,onFileAction:i,fileActionIcon:l,fileActionLabel:o,onFileSecondaryAction:c,fileSecondaryIcon:d,fileSecondaryLabel:m},e.path))]});let j=e.file,b=R[j.status]||r.File,w=z[j.status]||"text-muted-foreground",N=P[j.status]||"?";return(0,t.jsxs)("div",{className:"group flex items-center gap-1 py-0.5 px-1 rounded-sm min-h-[28px] hover:bg-accent hover:text-accent-foreground transition-colors cursor-pointer",style:g,onClick:()=>n(j),children:[(0,t.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,t.jsx)(b,{className:`h-3.5 w-3.5 shrink-0 ${w}`}),(0,t.jsx)("span",{className:"text-[13px] text-foreground truncate flex-1",children:e.name}),(0,t.jsx)("span",{className:`text-[11px] font-mono font-bold shrink-0 mr-1 ${w}`,children:N}),c&&(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),c(j.file)},className:"shrink-0 rounded p-0.5 text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-destructive/20 hover:text-destructive transition-all","aria-label":m??"",children:d}),m&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:m})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:e=>{e.stopPropagation(),i(j.file)},className:"shrink-0 rounded px-1 text-xs font-mono text-muted-foreground opacity-0 group-hover:opacity-100 hover:bg-background hover:text-foreground transition-all mr-1","aria-label":o??"",children:l}),o&&(0,t.jsx)(L.TooltipContent,{side:"bottom",children:o})]})]})}e.s(["EditorGitPanel",0,function({localPath:e,onFileSelect:r,mode:a="project"}){let n="task"===a,{t:i}=(0,B.useI18n)(),[l,h]=(0,s.useState)(null),[x,A]=(0,s.useState)(!0),[F,T]=(0,s.useState)(""),[R,z]=(0,s.useState)(!1),[P,O]=(0,s.useState)(!1),[H,W]=(0,s.useState)(!1),[V,K]=(0,s.useState)(!1),[q,J]=(0,s.useState)(!1),[Q,X]=(0,s.useState)(""),Y=(0,s.useRef)(null);(0,s.useEffect)(()=>{if(q)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){Y.current&&!Y.current.contains(e.target)&&J(!1)}},[q]);let[Z,_]=(0,s.useState)(!1),ee=(0,s.useCallback)(async()=>{try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let s=await t.json();h({changedFiles:s.changedFiles??[],ahead:s.ahead??0,behind:s.behind??0,remoteUrl:s.remoteUrl??"",currentBranch:s.currentBranch??"",branches:s.branches??[],remoteBranches:s.remoteBranches??[],topLevel:s.topLevel??e})}}catch{}finally{A(!1)}},[e]);(0,s.useEffect)(()=>{ee();let e=setInterval(ee,5e3);return()=>clearInterval(e)},[ee]);let et=async t=>{try{await (0,$.gitAction)(e,"stage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},es=async t=>{try{await (0,$.gitAction)(e,"unstage",{files:t}),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},er=async()=>{if(F.trim()){z(!0);try{await (0,$.gitAction)(e,"commit",{message:F}),T(""),I.toast.success(i("git.commitSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{z(!1)}}},ea=async t=>{O(!0);try{await (0,$.gitAction)(e,"pull",t?{branch:t}:{}),I.toast.success(i("git.pullSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{O(!1)}},en=async t=>{W(!0);try{await (0,$.gitAction)(e,"push",t?{branch:t}:{}),I.toast.success(i("git.pushSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{W(!1)}},ei=async()=>{K(!0);try{await (0,$.gitAction)(e,"fetch"),I.toast.success(i("git.fetchSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}finally{K(!1)}},el=async t=>{try{await (0,$.gitAction)(e,"checkout",{branch:t}),J(!1),I.toast.success(`${i("git.switchSuccess")} ${t}`),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eo=async()=>{try{await (0,$.gitAction)(e,"stash-save",{message:F||void 0}),T(""),I.toast.success(i("git.stashSaved")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ec=async()=>{try{await (0,$.gitAction)(e,"stash-pop",{index:0}),I.toast.success(i("git.stashApplied")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},ed=async t=>{try{await (0,$.gitAction)(e,"discard-file",{file:t}),I.toast.success(i("git.discardFileSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},em=async()=>{try{await (0,$.gitAction)(e,"discard-all"),I.toast.success(i("git.discardSuccess")),await ee()}catch(e){I.toast.error(e instanceof Error?e.message:String(e))}},eh=async t=>{if("deleted"===t.status)return;let s=l?.topLevel??e;try{let a=await (0,$.gitAction)(e,"show",{file:t.file});r?.(t.file,a.content??"",s)}catch{r?.(t.file,"",s)}},eu=l?.changedFiles.filter(e=>e.staged)??[],ex=l?.changedFiles.filter(e=>!e.staged)??[],ef=(0,s.useMemo)(()=>U(eu),[eu]),ep=(0,s.useMemo)(()=>U(ex),[ex]);if(x)return(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin text-muted-foreground"})});if(!l)return null;function eg(e){let t=[];for(let s of e)s.isDir?t.push(...eg(s.children)):s.file&&t.push(s.file.file);return t}let ej=[...l?.branches??[],...(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e))],eb=Q?ej.filter(e=>e.toLowerCase().includes(Q.toLowerCase())):ej;return(0,t.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 px-2 pt-2 pb-1 flex items-center gap-1",children:[n?(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{render:(0,t.jsxs)("div",{className:"flex flex-1 min-w-0 items-center gap-1.5 rounded-md border border-border bg-muted/30 px-2 py-1.5",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:l?.currentBranch||"—"})]})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",className:"font-mono text-xs",children:l?.currentBranch||"—"})]}):(0,t.jsxs)("div",{className:"relative flex-1 min-w-0",ref:Y,children:[(0,t.jsxs)("button",{onClick:()=>{J(!q),X("")},className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/50 px-2 py-1.5 text-left transition-colors hover:bg-accent",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs text-foreground",title:l?.currentBranch||void 0,children:l?.currentBranch||"—"})]}),(0,t.jsx)(u.ChevronDown,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform ${q?"rotate-180":""}`})]}),q&&(0,t.jsxs)("div",{className:"absolute left-0 top-full z-30 mt-1 min-w-full w-max max-w-[320px] rounded-lg border border-border bg-popover shadow-xl",children:[(0,t.jsx)("div",{className:"border-b border-border p-1.5",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(v.Search,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-muted-foreground"}),(0,t.jsx)("input",{value:Q,onChange:e=>X(e.target.value),placeholder:"Filter...",autoFocus:!0,className:"h-7 w-full rounded-md bg-muted/50 pl-7 pr-2 text-xs text-foreground placeholder-muted-foreground outline-none focus:ring-1 focus:ring-ring"})]})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-auto py-1",children:[(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-1 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.localBranches")}),(l?.branches??[]).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>{let s=e===l?.currentBranch;return(0,t.jsxs)("button",{onClick:()=>{s?J(!1):el(e)},className:`flex w-full items-center gap-2 px-3 py-1 text-left transition-colors ${s?"bg-emerald-500/10 text-emerald-400":"text-secondary-foreground hover:bg-accent"}`,children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e}),s&&(0,t.jsx)(m.Check,{className:"h-3 w-3 ml-auto shrink-0"})]},`local-${e}`)}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).length>0&&(0,t.jsx)("p",{className:"px-3 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:i("git.remoteBranches")}),(l?.remoteBranches??[]).filter(e=>!l?.branches?.includes(e)).filter(e=>e.toLowerCase().includes(Q.toLowerCase())).map(e=>(0,t.jsxs)("button",{onClick:()=>el(e),className:"flex w-full items-center gap-2 px-3 py-1 text-left text-secondary-foreground transition-colors hover:bg-accent",children:[(0,t.jsx)(k.Globe,{className:"h-3 w-3 shrink-0 text-sky-400"}),(0,t.jsx)("span",{className:"truncate font-mono text-xs",title:e,children:e})]},`remote-${e}`)),0===eb.length&&(0,t.jsx)("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:"No branches found"})]})]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:ei,disabled:V,className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Fetch",children:(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 ${V?"animate-spin":""}`})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:"Fetch"})]}),(0,t.jsxs)(L.Tooltip,{children:[(0,t.jsx)(L.TooltipTrigger,{onClick:()=>{J(!1),_(!0)},className:"shrink-0 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground transition-colors","aria-label":i("git.createBranch"),children:(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(L.TooltipContent,{side:"bottom",children:i("git.createBranch")})]})]})]}),(0,t.jsxs)("div",{className:"shrink-0 px-2 pb-2 space-y-1.5 border-b border-border",children:[(0,t.jsx)("textarea",{value:F,onChange:e=>T(e.target.value),placeholder:i("git.commitMsgPlaceholder"),rows:3,className:"w-full rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none",onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&er()}}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{variant:"default",className:"flex-1 h-7 gap-1.5 text-xs",onClick:er,disabled:R||!F.trim()||0===eu.length,children:[R?(0,t.jsx)(o.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(m.Check,{className:"h-3 w-3"}),i("git.commit")]}),(0,t.jsxs)(M.DropdownMenu,{children:[(0,t.jsx)(M.DropdownMenuTrigger,{render:(0,t.jsx)(S.Button,{variant:"outline",size:"icon-xs",className:"h-7 w-7 shrink-0"}),children:(0,t.jsx)(g.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(M.DropdownMenuContent,{align:"end",side:"bottom",className:"w-52",children:[(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.commit")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:er,disabled:!F.trim()||0===eu.length,children:[(0,t.jsx)(m.Check,{className:"h-3.5 w-3.5 mr-2"}),i("git.commit")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.changes")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>et(eg(ep)),disabled:0===ex.length,children:[(0,t.jsx)(p.Plus,{className:"h-3.5 w-3.5 mr-2"}),i("git.stageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>es(eg(ef)),disabled:0===eu.length,children:[(0,t.jsx)(f.Minus,{className:"h-3.5 w-3.5 mr-2"}),i("git.unstageAll")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:em,disabled:0===ex.length,children:[(0,t.jsx)(N,{className:"h-3.5 w-3.5 mr-2"}),i("git.discardAll")]})]}),!n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.sync")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),disabled:P,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pull")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.push")]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:P,children:[(0,t.jsx)(c.ArrowDown,{className:"h-3.5 w-3.5 mr-2"}),i("git.pullFrom"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.behind>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↓",l.behind]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>ea(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuSub,{children:[(0,t.jsxs)(M.DropdownMenuSubTrigger,{disabled:H,children:[(0,t.jsx)(d.ArrowUp,{className:"h-3.5 w-3.5 mr-2"}),i("git.pushTo"),"..."]}),(0,t.jsxs)(M.DropdownMenuSubContent,{className:"max-h-60 overflow-y-auto",children:[(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-emerald-400"}),l.currentBranch,l.ahead>0&&(0,t.jsxs)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["↑",l.ahead]})]}),l.remoteBranches.filter(e=>e!==l.currentBranch).map(e=>(0,t.jsxs)(M.DropdownMenuItem,{onClick:()=>en(e),children:[(0,t.jsx)(y.GitBranch,{className:"h-3 w-3 mr-2 text-sky-400"}),e]},e))]})]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ei,disabled:V,children:[(0,t.jsx)(j.RefreshCw,{className:`h-3.5 w-3.5 mr-2 ${V?"animate-spin":""}`}),i("git.fetchAll")]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuGroup,{children:[(0,t.jsx)(M.DropdownMenuLabel,{children:i("git.stash")}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:eo,disabled:0===l.changedFiles.length,children:[(0,t.jsx)(b.Archive,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashSave")]}),(0,t.jsxs)(M.DropdownMenuItem,{onClick:ec,children:[(0,t.jsx)(w.ArrowUpFromLine,{className:"h-3.5 w-3.5 mr-2"}),i("git.stashPopLatest")]})]})]}),(0,t.jsx)(M.DropdownMenuSeparator,{}),(0,t.jsxs)(M.DropdownMenuItem,{disabled:!0,className:"text-muted-foreground",children:[(0,t.jsx)(y.GitBranch,{className:"h-3.5 w-3.5 mr-2"}),l.currentBranch]})]})]})]})]}),(0,t.jsxs)(D.ScrollArea,{className:"flex-1 min-h-0",children:[(0,t.jsx)(G,{label:i("git.stagedChanges"),count:eu.length,labelColor:"text-emerald-400",tree:ef,batchAction:()=>es(eg(ef)),batchLabel:i("git.unstageAll"),batchIcon:(0,t.jsx)(f.Minus,{className:"h-3 w-3"}),onFileClick:eh,onFileAction:e=>es([e]),fileActionIcon:"−",fileActionLabel:i("git.unstageFile")}),(0,t.jsx)(G,{label:i("git.unstagedChanges"),count:ex.length,labelColor:"text-muted-foreground",tree:ep,batchAction:()=>et(eg(ep)),batchLabel:i("git.stageAll"),batchIcon:(0,t.jsx)(p.Plus,{className:"h-3 w-3"}),onFileClick:eh,onFileAction:e=>et([e]),fileActionIcon:"+",fileActionLabel:i("git.stageFile"),onFileSecondaryAction:e=>ed(e),fileSecondaryIcon:(0,t.jsx)(C.Trash2,{className:"h-2.5 w-2.5"}),fileSecondaryLabel:i("git.discardFile")}),0===l.changedFiles.length&&(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,t.jsx)(m.Check,{className:"h-5 w-5 text-emerald-400 mb-2"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("git.noChanges")})]})]}),(0,t.jsx)(E,{open:Z,onOpenChange:_,branches:[...l?.branches??[],...l?.remoteBranches??[]],currentBranch:l?.currentBranch??"",localPath:e,onCreated:async()=>{I.toast.success(i("git.createSuccess")),await ee()},onError:e=>I.toast.error(`${i("git.createFailed")}: ${e}`)})]})}],515135)},14842,865514,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(368490),a=e.i(232280),n=e.i(759686),i=e.i(960518),l=e.i(340873),o=e.i(400355),c=e.i(519455),d=e.i(912505),m=e.i(487486),h=e.i(776639),u=e.i(624687),x=e.i(533499);function f({patchState:e,isLargeFold:s,onLoad:r}){let{t:a}=(0,x.useI18n)();return s?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-1 py-6",children:[(0,t.jsx)(c.Button,{variant:"link",onClick:r,className:"h-auto p-0 text-sm",children:a("diff.loadDiff")}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:a("diff.foldedLarge")})]}):e&&"loading"!==e.kind?"error"===e.kind?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[(0,t.jsx)("span",{children:a("diff.loadFailed")}),(0,t.jsx)(c.Button,{variant:"ghost",onClick:r,children:a("diff.retry")})]}):"binary"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.binaryNotShown")}):"empty"===e.kind?(0,t.jsx)("div",{className:"flex items-center justify-center py-6 text-sm text-muted-foreground",children:a("diff.noChanges")}):(0,t.jsx)(p,{patch:e.patch??""}):(0,t.jsx)("div",{className:"flex items-center justify-center py-6",children:(0,t.jsx)(o.Loader2,{className:"h-5 w-5 animate-spin text-muted-foreground"})})}function p({patch:e}){let{t:s}=(0,x.useI18n)(),r=e.split("\n"),a=r.length>500,n=a?r.slice(0,500):r;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("pre",{className:"overflow-x-auto p-0 text-xs font-mono leading-5",children:n.map((e,s)=>{let r=e.startsWith("+++")||e.startsWith("---")?"px-4 block text-muted-foreground":e.startsWith("+")?"px-4 block bg-green-500/10 text-green-400":e.startsWith("-")?"px-4 block bg-red-500/10 text-red-400":e.startsWith("@@")?"px-4 block bg-blue-500/10 text-blue-300":"px-4 block text-muted-foreground";return(0,t.jsx)("span",{className:r,children:e||" "},s)})}),a&&(0,t.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground border-t border-border",children:s("diff.patchTruncated",{n:String(500),total:String(r.length)})})]})}e.s(["TaskDiffView",0,function({taskId:e,files:o,totalAdded:p,totalRemoved:g,hasConflicts:j,conflictFiles:b,onCommit:w,hasUncommitted:N}){let{t:y}=(0,x.useI18n)(),[v,k]=(0,s.useState)(new Set),[C,S]=(0,s.useState)(new Map),[M,D]=(0,s.useState)(!1),[L,A]=(0,s.useState)(""),[F,T]=(0,s.useState)(!1),B=t=>{S(e=>new Map(e).set(t,{kind:"loading"})),fetch(`/api/tasks/${e}/diff-patch?file=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>{S(s=>{let r=new Map(s);return"binary"===e.kind?r.set(t,{kind:"binary"}):"empty"===e.kind?r.set(t,{kind:"empty"}):r.set(t,{kind:"ready",patch:e.patch??""}),r})}).catch(()=>{S(e=>new Map(e).set(t,{kind:"error"}))})};return(0,t.jsxs)("div",{className:"flex flex-col h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[(0,t.jsxs)("span",{className:"font-medium text-foreground",children:[o.length," files changed"]}),(0,t.jsxs)("span",{className:"text-green-400 font-mono text-xs",children:["+",p]}),(0,t.jsxs)("span",{className:"text-red-400 font-mono text-xs",children:["-",g]})]}),(0,t.jsx)("div",{className:"flex items-center gap-2",children:N&&w&&(0,t.jsxs)(c.Button,{variant:"outline",onClick:()=>D(!0),className:"gap-2",children:[(0,t.jsx)(l.GitCommitHorizontal,{className:"h-4 w-4"}),y("diff.commit")]})})]}),j&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border bg-amber-500/5 px-4 py-3 flex-shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-amber-400",children:[(0,t.jsx)(n.AlertTriangle,{className:"h-4 w-4 flex-shrink-0"}),(0,t.jsxs)("span",{className:"text-sm font-medium",children:["Merge blocked: ",b.length," conflicting file",1!==b.length?"s":""]})]}),(0,t.jsx)("ul",{className:"ml-6 space-y-1",children:b.map(e=>(0,t.jsx)("li",{className:"text-xs font-mono text-amber-300/80",children:e},e))})]}),(0,t.jsx)("div",{className:"flex-1 overflow-auto",children:0===o.length?(0,t.jsx)(d.EmptyState,{icon:i.GitCompare,title:y("diff.noChanges"),className:"h-full"}):(0,t.jsx)("div",{className:"divide-y divide-border",children:o.map(e=>{let s=v.has(e.filename),n=C.get(e.filename),i=e.added+e.removed;return(0,t.jsxs)("div",{children:[(0,t.jsxs)(c.Button,{variant:"ghost",type:"button",onClick:()=>{let t;return t=v.has(e.filename),void(k(t=>{let s=new Set(t);return s.has(e.filename)?s.delete(e.filename):s.add(e.filename),s}),t||e.isBinary||C.has(e.filename)||e.added+e.removed<=200&&B(e.filename))},className:"flex w-full items-center gap-2 px-4 py-2.5 text-left hover:bg-accent/50 transition-colors rounded-none h-auto",children:[s?(0,t.jsx)(a.ChevronDown,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}):(0,t.jsx)(r.ChevronRight,{className:"h-3.5 w-3.5 flex-shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 truncate text-sm font-mono text-foreground",children:e.filename}),e.isBinary?(0,t.jsx)(m.Badge,{variant:"secondary",className:"text-[10px] bg-muted text-muted-foreground border border-border",children:y("diff.binary")}):(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("span",{className:"text-xs font-mono text-green-400",children:["+",e.added]}),(0,t.jsxs)("span",{className:"text-xs font-mono text-red-400",children:["-",e.removed]})]})]}),s&&!e.isBinary&&(0,t.jsx)("div",{className:"border-t border-border bg-background",children:(0,t.jsx)(f,{filename:e.filename,patchState:n,isLargeFold:!n&&i>200,onLoad:()=>B(e.filename)})})]},e.filename)})})}),(0,t.jsx)(h.Dialog,{open:M,onOpenChange:D,children:(0,t.jsxs)(h.DialogContent,{className:"max-w-md",children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsx)(h.DialogTitle,{children:y("diff.commitChanges")})}),(0,t.jsx)("div",{className:"flex flex-col gap-3",children:(0,t.jsx)(u.Textarea,{value:L,onChange:e=>A(e.target.value),placeholder:y("diff.commitMessagePlaceholder"),rows:5,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none resize-y min-h-[80px]"})}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>D(!1),children:y("common.cancel")}),(0,t.jsx)(c.Button,{onClick:async()=>{if(L.trim()&&w){T(!0);try{await w(L.trim()),A(""),D(!1)}finally{T(!1)}}},disabled:!L.trim()||F,children:F?"...":y("diff.commit")})]})]})})]})}],14842);var g=e.i(538059);let j=(0,e.i(572989).default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["TaskMergeConfirmDialog",0,function({open:e,onOpenChange:r,taskId:a,taskTitle:n,baseBranch:i,fileCount:l,commitCount:d,commitLog:m=[],onMergeComplete:u}){let x=(0,g.useRouter)(),[f,p]=(0,s.useState)(!1),[b,w]=(0,s.useState)(null),N=async()=>{p(!0),w(null);try{let e=await fetch(`/api/tasks/${a}/merge`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(e.ok){r(!1),u(),x.refresh();return}let t=await e.json().catch(()=>({error:"Merge failed"}));409===e.status?w(`Merge conflicts detected: ${Array.isArray(t.conflictFiles)?t.conflictFiles.join(", "):"unknown files"}`):w(t.error??"Merge failed")}catch{w("Network error — merge failed")}finally{p(!1)}};return(0,t.jsx)(h.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(h.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(h.DialogHeader,{children:(0,t.jsxs)(h.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(j,{className:"h-4 w-4 text-emerald-400"}),"Confirm Merge"]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 p-3 space-y-2.5",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Target branch"}),(0,t.jsx)("code",{className:"text-xs font-mono bg-muted px-2 py-0.5 rounded text-foreground",children:i})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Changed files"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:l})]}),(0,t.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:"Commits"}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),m.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:"Commits"}),(0,t.jsx)("div",{className:"rounded-md border border-border bg-muted/30 p-2 space-y-1 max-h-32 overflow-y-auto",children:m.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),b&&(0,t.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/10 px-3 py-2",children:(0,t.jsx)("p",{className:"text-xs text-red-400",children:b})})]}),(0,t.jsxs)(h.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:()=>r(!1),disabled:f,children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:N,disabled:f,className:"gap-2",children:f?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.Loader2,{className:"h-4 w-4 animate-spin"}),"Merging..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j,{className:"h-4 w-4"}),"Confirm Merge"]})})]})]})})}],865514)},188013,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("400329c68fcd02edea883a2bcaf2651767b169dfd3",t.callServer,void 0,t.findSourceMapURL,"getTaskExecutions");e.s(["getTaskExecutions",0,s])},37170,382216,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("7c5e3b54118977428104afc6d77720611257ac522a",t.callServer,void 0,t.findSourceMapURL,"startPtyExecutionSafe");e.s(["startPtyExecutionSafe",0,s],37170);let r=(0,t.createServerReference)("40d0c8238b487e664660cb962acdf111f015db29da",t.callServer,void 0,t.findSourceMapURL,"continueLatestPtyExecution");e.s(["continueLatestPtyExecution",0,r],382216)},714039,309955,629777,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60f81021da1a9765ca9d3ef0fdcc96463310df9374",t.callServer,void 0,t.findSourceMapURL,"updateTaskStatus");e.s(["updateTaskStatus",0,s],714039);let r=(0,t.createServerReference)("40b0c9a5c3b37cdf74d8565ce067e8917e63c79c45",t.callServer,void 0,t.findSourceMapURL,"checkWorktreeClean");e.s(["checkWorktreeClean",0,r],309955);let a=(0,t.createServerReference)("6017cfb7c1ea9098673c3fb41bf5fb4209494d7dd7",t.callServer,void 0,t.findSourceMapURL,"commitWorktreeChanges");e.s(["commitWorktreeChanges",0,a],629777)},989383,769824,e=>{"use strict";var t=e.i(572989);let s=(0,t.default)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);e.s(["Clock",0,s],989383);let r=(0,t.default)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);e.s(["History",0,r],769824)},326883,e=>{"use strict";var t=e.i(289721),s=e.i(965652),r=e.i(232280),a=e.i(472074),n=e.i(301348),i=e.i(181209),l=e.i(400355),o=e.i(989383),c=e.i(12659),d=e.i(922541),m=e.i(486077),h=e.i(769824),u=e.i(519455),x=e.i(912505),f=e.i(533499);function p({status:e}){switch(e){case"COMPLETED":return(0,t.jsx)(n.CheckCircle2,{className:"h-4 w-4 text-emerald-400"});case"FAILED":return(0,t.jsx)(i.XCircle,{className:"h-4 w-4 text-red-400"});case"RUNNING":return(0,t.jsx)(l.Loader2,{className:"h-4 w-4 text-blue-400 animate-spin"});default:return(0,t.jsx)(o.Clock,{className:"h-4 w-4 text-neutral-500"})}}e.s(["ExecutionTimeline",0,function({executions:e,onResume:n,onContinueLatest:i}){let{t:l,locale:o}=(0,f.useI18n)(),[g,j]=(0,s.useState)(null),[b,w]=(0,s.useState)(null);return 0===e.length?(0,t.jsx)(x.EmptyState,{icon:h.History,title:l("execution.noHistory")}):(0,t.jsxs)("div",{className:"space-y-2 p-3",children:[(0,t.jsx)("p",{className:"px-1 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:l("execution.history")}),e.map(s=>{let h=function(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}(s.gitStats??null),x=function(e,t){if(!e||!t)return"";let s=new Date(t).getTime()-new Date(e).getTime();if(s<0)return"";let r=Math.floor(s/1e3);if(r<60)return`${r}s`;let a=Math.floor(r/60);if(a<60)return`${a}m ${r%60}s`;let n=Math.floor(a/60);return`${n}h ${a%60}m`}(s.startedAt??null,s.endedAt??null),f=g===s.id;return(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-background/50 overflow-hidden",children:[(0,t.jsxs)("div",{className:"p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(p,{status:s.status}),(0,t.jsx)("span",{className:`font-medium ${function(e){switch(e){case"COMPLETED":return"text-emerald-400";case"FAILED":return"text-red-400";case"RUNNING":return"text-blue-400";default:return"text-neutral-400"}}(s.status)}`,children:function(e,t){switch(e){case"COMPLETED":return t("execution.success");case"FAILED":return t("execution.failed");case"RUNNING":return t("execution.running");default:return e}}(s.status,l)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:function(e,t="zh"){if(!e)return"";let s=new Date(e),r=Math.floor((new Date().getTime()-s.getTime())/864e5),a="zh"===t?"zh-CN":"en-US",n=s.toLocaleTimeString(a,{hour:"2-digit",minute:"2-digit"});return 0===r?n:1===r?"zh"===t?`昨天 ${n}`:`Yesterday ${n}`:r<7?"zh"===t?`${r}天前 ${n}`:`${r}d ago ${n}`:s.toLocaleDateString(a,{month:"2-digit",day:"2-digit"})+" "+n}(s.startedAt??null,o)}),x&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["(",x,")"]})]}),(0,t.jsx)("p",{className:"mt-1.5 text-sm text-foreground/80 line-clamp-2",children:s.summary||l("execution.noSummary")}),h&&(h.commits||h.filesChanged)&&(0,t.jsxs)("div",{className:"mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground font-mono",children:[h.commits?(0,t.jsxs)("span",{children:[h.commits," ",l("execution.commits")]}):null,h.filesChanged?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),(0,t.jsxs)("span",{children:[h.filesChanged," ",l("execution.files")]})]}):null,h.insertions||h.deletions?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"·"}),h.insertions?(0,t.jsxs)("span",{className:"text-emerald-500",children:["+",h.insertions]}):null,h.deletions?(0,t.jsxs)("span",{className:"text-red-400",children:["-",h.deletions]}):null]}):null]}),s.insightNote&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsxs)("button",{onClick:()=>w(b===s.id?null:s.id),className:"flex items-center gap-1.5 text-xs text-primary/90 hover:text-primary transition-colors",children:[(0,t.jsx)(m.Lightbulb,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"font-medium",children:[l("execution.insight"),":"]}),(0,t.jsx)("span",{className:"text-foreground/70 truncate max-w-[200px]",children:s.insightNote.title}),b===s.id?(0,t.jsx)(a.ChevronUp,{className:"h-3 w-3"}):(0,t.jsx)(r.ChevronDown,{className:"h-3 w-3"})]}),b===s.id&&(0,t.jsx)("div",{className:"mt-2 rounded-md bg-primary/[0.06] border border-primary/10 p-3 text-xs text-foreground/80 whitespace-pre-wrap",children:s.insightNote.content})]}),(0,t.jsxs)("div",{className:"mt-2.5 flex items-center gap-2",children:[s.sessionId&&n?(0,t.jsxs)(u.Button,{size:"sm",onClick:()=>n(s.sessionId),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[(0,t.jsx)(c.PlayCircle,{className:"h-3.5 w-3.5"}),l("execution.resume")]}):!s.sessionId&&"FAILED"===s.status&&s.id===e[0]?.id&&i?(0,t.jsxs)(u.Button,{size:"sm",onClick:i,className:"bg-blue-500/15 text-blue-300 ring-1 ring-blue-500/20 hover:bg-blue-500/25",children:[(0,t.jsx)(d.RotateCcw,{className:"h-3.5 w-3.5"}),l("execution.tryRecover")]}):null,(0,t.jsxs)(u.Button,{variant:"ghost",size:"sm",onClick:()=>j(f?null:s.id),className:"bg-muted text-muted-foreground",children:[f?(0,t.jsx)(a.ChevronUp,{className:"h-3.5 w-3.5"}):(0,t.jsx)(r.ChevronDown,{className:"h-3.5 w-3.5"}),f?l("execution.collapse"):l("execution.details")]})]})]}),f&&(0,t.jsxs)("div",{className:"border-t border-border px-3 pb-3 space-y-3",children:[s.gitLog&&(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.gitLog")}),(0,t.jsx)("pre",{className:"rounded-md bg-muted/50 p-2.5 text-xs font-mono text-foreground/70 overflow-x-auto whitespace-pre-wrap",children:s.gitLog.split("\n").slice(0,3).join("\n")})]}),s.terminalLog&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5",children:l("execution.terminalOutput")}),(0,t.jsx)("pre",{className:"rounded-md bg-[#0f1419] p-2.5 text-xs font-mono text-neutral-300 overflow-x-auto max-h-48 overflow-y-auto whitespace-pre-wrap",children:s.terminalLog})]}),"FAILED"===s.status&&null!=s.exitCode&&(0,t.jsxs)("p",{className:"text-xs text-red-400/70",children:["Exit code: ",s.exitCode]})]})]},s.id)})]})}])},517677,e=>{"use strict";var t=e.i(514798);let s=(0,t.createServerReference)("60e903d81016ad087f0673954b19123d6402d9ea4d",t.callServer,void 0,t.findSourceMapURL,"updateTask");e.s(["updateTask",0,s])}]);
|