tower-studio 0.2.22 → 0.2.23
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/missions/page/react-loadable-manifest.json +1 -1
- package/.next/standalone/.next/server/app/missions/page/server-reference-manifest.json +59 -59
- 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 +43 -43
- 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 +86 -86
- 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 +78 -78
- 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 +61 -61
- 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 +72 -72
- 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_0hrprmi.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03j20vp._.js +1 -1
- 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]__0sy6lau._.js +1 -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]__0i~v.f0._.js → [root-of-the-server]__0-o.l41._.js} +2 -2
- 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]__03e009u._.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]__0x2jop0._.js → [root-of-the-server]__0jti4~k._.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]__0l1.bgv._.js → [root-of-the-server]__0s-a4ku._.js} +2 -2
- 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]__0vrp4wc._.js → [root-of-the-server]__12p2zz2._.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/{_07ca~8h._.js → _0-9.ea2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_02o-w3k._.js → _012.igw._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0385-.g._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/{_0zbuayb._.js → _04y89b3._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_04yogxq._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/_070t_mh._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_08z-g~5._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0_vjay8._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_0ncltnn._.js → _0bk06da._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0cc0gt8._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/_0cj9a7y._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_01xe7~b._.js → _0hzckhd._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0jg.s-g._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{_13dksil._.js → _0m.4akk._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_0oq26rv._.js +3 -0
- 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/_0uuzh5m._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/_0z-b00b._.js +7 -0
- package/.next/standalone/.next/server/chunks/ssr/_0~aon4t._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/{_075_.cb._.js → _0~v4z8z._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{_060_9cj._.js → _10-.n35._.js} +2 -2
- 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 +234 -234
- package/.next/standalone/.next/static/chunks/{0htnxzje.8d3f.js → 0-.9k92iyul5o.js} +2 -2
- package/.next/standalone/.next/static/chunks/{13z_8s26xa~p1.js → 0.qj9vorfgtnt.js} +1 -1
- package/.next/standalone/.next/static/chunks/00-6_m40h14vl.js +1 -0
- package/.next/standalone/.next/static/chunks/02.ihz-~spbi-.js +1 -0
- package/.next/standalone/.next/static/chunks/{0.onfoo7t4w-m.js → 04axhlp_leiii.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0t92fwd6kv5j_.js → 05a6uzgclxdsk.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0w1jry5z5w5~5.js → 099eecj285cbx.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0_t-j983f5f0p.js → 0c~0amyhws3l0.js} +1 -1
- package/.next/standalone/.next/static/chunks/0e8r37m0q.z0p.js +1 -0
- package/.next/standalone/.next/static/chunks/{11yv2zlsl_i7z.js → 0ik7-_3wrtspq.js} +1 -1
- package/.next/standalone/.next/static/chunks/0ima0i0p489ty.js +1 -0
- package/.next/standalone/.next/static/chunks/{0feyhaj64gfd~.js → 0p9zhbwmnn0j4.js} +1 -1
- package/.next/standalone/.next/static/chunks/{01vvdks5yzk7x.js → 0rec91xfsdv8r.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0y8ywrftfsnux.js → 0so-w5.m3jaxi.js} +1 -1
- package/.next/standalone/.next/static/chunks/{030g1-s.qdj2n.js → 0zfszxiw4cx9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{11jg-t_iw_8i6.js → 0ztty8z0obk5f.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0132~w09sg8ej.js → 1007_ur3fj.~m.js} +1 -1
- package/.next/standalone/.next/static/chunks/{08vuh22p.47~b.js → 10r4y1zzk24jy.js} +2 -2
- package/.next/standalone/.next/static/chunks/10vl5vq1_rh1..js +1 -0
- package/.next/standalone/.next/static/chunks/120x-nmim1wfz.js +1 -0
- package/.next/standalone/.next/static/chunks/{015m584n.xxu~.js → 12iivlft6u_tt.js} +1 -1
- package/.next/standalone/.next/static/chunks/134onqxk2foh5.js +5 -0
- package/.next/standalone/.next/static/chunks/{15.pdp8xgoni1.js → 16r-tz37aqyoa.js} +1 -1
- package/.next/standalone/.next/static/chunks/16ukg_cswejw4.js +5 -0
- package/.next/standalone/.next/static/chunks/{07ucj-4sybtq9.js → 17n~0msyl8bur.js} +1 -1
- package/.next/standalone/package.json +1 -1
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_00xgezz._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/_0564air._.js +0 -4
- package/.next/standalone/.next/server/chunks/ssr/_084ifnn._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_0qq3k6g._.js +0 -7
- package/.next/standalone/.next/server/chunks/ssr/_0z58pqh._.js +0 -7
- package/.next/standalone/.next/static/chunks/01fk6.8bw14.7.js +0 -1
- package/.next/standalone/.next/static/chunks/0cn44krrztr-n.js +0 -1
- package/.next/standalone/.next/static/chunks/0hf2igz3z1v.5.js +0 -1
- package/.next/standalone/.next/static/chunks/0lq9lfznfhl-6.js +0 -1
- package/.next/standalone/.next/static/chunks/0plqjpgas0ygu.js +0 -1
- package/.next/standalone/.next/static/chunks/0tfc~d_oxesgk.js +0 -5
- package/.next/standalone/.next/static/chunks/11x05y67gti4v.js +0 -5
- package/.next/standalone/.next/static/chunks/15vogvewouq8e.js +0 -1
- /package/.next/standalone/.next/static/{hA1HHDvQi_vSYi568JXho → l8InE32VLIGdUBVP3BJKt}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{hA1HHDvQi_vSYi568JXho → l8InE32VLIGdUBVP3BJKt}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{hA1HHDvQi_vSYi568JXho → l8InE32VLIGdUBVP3BJKt}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,783426,e=>{"use strict";var t=e.i(289721),s=e.i(965652),a=e.i(538059),r=e.i(340966),n=e.i(572989);let l=(0,n.default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);var i=e.i(486077),o=e.i(533499);function c({totalTasks:e,runningTasks:s}){let{t:a}=(0,o.useI18n)();return(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-3 px-6 py-4",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded-lg bg-sky-500/10 p-2 ring-1 ring-sky-500/20",children:(0,t.jsx)(r.ClipboardList,{className:"h-4 w-4 text-sky-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("board.overview")}),(0,t.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:e})]})]})}),(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded-lg bg-primary/10 p-2 ring-1 ring-primary/20",children:(0,t.jsx)(l,{className:"h-4 w-4 text-primary"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("board.running")}),(0,t.jsx)("p",{className:"text-2xl font-bold font-mono tracking-tight text-foreground",children:s})]})]})}),(0,t.jsx)("div",{className:"rounded-xl border border-border bg-card p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"rounded-lg bg-emerald-500/10 p-2 ring-1 ring-emerald-500/20",children:(0,t.jsx)(i.Lightbulb,{className:"h-4 w-4 text-emerald-400"})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("board.tip")}),(0,t.jsx)("p",{className:"text-xs font-medium text-foreground/80",children:a("board.tipText")})]})]})})]})}var d=e.i(210702),m=e.i(232545),x=e.i(738690),u=e.i(226145),h=e.i(519455),p=e.i(793479),g=e.i(280027);function f({searchQuery:e,onSearchChange:s,versions:a=[],versionFilter:r="all",onVersionFilterChange:n,versionsHref:l,onCreateTask:i}){let c,{t:j}=(0,o.useI18n)(),b="all"===r?j("board.allVersions"):"backlog"===r?j("board.backlogFilter"):(c=a.find(e=>e.id===r))?`${c.number} ${c.name}`:j("board.allVersions");return(0,t.jsxs)("div",{className:"flex items-center gap-2 px-6 py-2",children:[n&&(0,t.jsxs)(g.Select,{value:r,onValueChange:e=>n(e||"all"),children:[(0,t.jsxs)(g.SelectTrigger,{className:"h-8 w-44 shrink-0 gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.GitBranch,{className:"h-3.5 w-3.5 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:b})]}),(0,t.jsxs)(g.SelectContent,{children:[(0,t.jsx)(g.SelectItem,{value:"all",children:j("board.allVersions")}),(0,t.jsx)(g.SelectItem,{value:"backlog",children:j("board.backlogFilter")}),a.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[(0,t.jsx)("span",{className:"font-mono",children:e.number})," ",e.name]},e.id))]})]}),(0,t.jsxs)("div",{className:"relative flex-1 max-w-xs",children:[(0,t.jsx)(x.Search,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)(p.Input,{type:"text",value:e,onChange:e=>s(e.target.value),placeholder:j("board.searchPlaceholder"),className:"pl-8 pr-3 text-xs"})]}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[l&&(0,t.jsx)(d.default,{href:l,children:(0,t.jsxs)(h.Button,{variant:"outline",className:"h-8 gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.GitBranch,{className:"h-3.5 w-3.5"}),j("version.timeline")]})}),(0,t.jsxs)(h.Button,{"data-tour":"create-task",variant:"outline",className:"gap-1.5 border-border text-xs text-muted-foreground hover:border-primary/30 hover:text-primary",onClick:i,children:[(0,t.jsx)(m.Plus,{className:"h-3.5 w-3.5"}),j("board.newTask")]})]})]})}var j=e.i(585012),b=e.i(597746),N=e.i(685149);function v({x:e,y:r,taskId:n,currentStatus:l,hasExecutions:i,workspaceId:c,onClose:d,onStatusChange:m,onLaunch:x}){let{t:u}=(0,o.useI18n)(),h=(0,a.useRouter)(),p=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=e=>{p.current&&!p.current.contains(e.target)&&d()},t=e=>{"Escape"===e.key&&d()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[d]);let g="flex items-center px-3 py-1.5 text-xs cursor-pointer hover:bg-accent rounded-sm w-full text-left",f=(0,t.jsxs)("div",{ref:p,style:{position:"fixed",top:r,left:e,zIndex:9999},className:"bg-popover border border-border rounded-md shadow-md py-1 min-w-[180px]",children:[(0,t.jsx)("div",{className:"px-3 py-1 text-[10px] text-muted-foreground uppercase tracking-wider",children:u("board.contextMenu.changeStatus")}),N.BOARD_COLUMNS.map(e=>(0,t.jsxs)("button",{type:"button",className:g,onClick:()=>{m(n,e.id),d()},children:[l===e.id?(0,t.jsx)(b.Check,{className:"h-3 w-3 mr-2 flex-shrink-0"}):(0,t.jsx)("span",{className:"w-5 flex-shrink-0"}),e.label]},e.id)),(0,t.jsx)("hr",{className:"my-1 border-border"}),(0,t.jsx)("button",{type:"button",className:`${g} ${i?"opacity-50 cursor-not-allowed":""}`,disabled:i,onClick:()=>{i||(x(n),d())},children:u("board.contextMenu.launch")}),"DONE"!==l&&"CANCELLED"!==l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("hr",{className:"my-1 border-border"}),(0,t.jsx)("button",{type:"button",className:g,onClick:()=>{h.push(`/workspaces/${c}/tasks/${n}`),d()},children:u("board.contextMenu.goToDetail")})]})]});return"u"<typeof document?null:(0,j.createPortal)(f,document.body)}var k=e.i(720247),y=e.i(775712);let w=(0,n.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);var C=e.i(67013),S=e.i(49007),T=e.i(464249),P=e.i(998626);let I=(0,n.default)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var E=e.i(487486),D=e.i(746798),L=e.i(755146),B=e.i(35967);function F({task:e,onClick:s,onEdit:a,onDelete:r,onTogglePin:n,onContextMenu:l}){let{t:i}=(0,o.useI18n)(),{attributes:c,listeners:d,setNodeRef:m,transform:x,transition:p,isDragging:g}=(0,y.useSortable)({id:e.id,data:{type:"task",task:e}}),f={transform:C.CSS.Transform.toString(x),transition:p,opacity:g?.4:1},j=N.PRIORITY_CONFIG[e.priority],b=!!e.baseBranch;return(0,t.jsxs)("div",{ref:m,style:f,...c,...d,className:"group cursor-grab rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50 active:cursor-grabbing",onClick:s,onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),l?.(e,t.clientX,t.clientY)},"data-testid":"task-card",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-foreground",children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 shrink-0",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",className:`transition-all ${e.pinned?"text-primary opacity-100":"text-muted-foreground opacity-0 group-hover:opacity-100"}`,onClick:t=>{t.stopPropagation(),n?.(e.id)},"aria-label":i(e.pinned?"board.unpin":"board.pin"),children:(0,t.jsx)(I,{className:`h-3.5 w-3.5 ${e.pinned?"-rotate-45":""}`})}),(0,t.jsxs)(L.DropdownMenu,{children:[(0,t.jsx)(L.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"rounded-md p-0.5 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(S.MoreHorizontal,{className:"h-4 w-4"})}),(0,t.jsxs)(L.DropdownMenuContent,{align:"end",children:[(0,t.jsxs)(L.DropdownMenuItem,{onClick:t=>{t.stopPropagation(),a?.(e)},children:[(0,t.jsx)(T.Pencil,{className:"mr-2 h-3.5 w-3.5"}),i("common.edit")]}),(0,t.jsxs)(L.DropdownMenuItem,{className:"text-rose-400",onClick:t=>{t.stopPropagation(),r?.(e.id)},children:[(0,t.jsx)(P.Trash2,{className:"mr-2 h-3.5 w-3.5"}),i("common.delete")]})]})]})]})]}),e.description&&(0,t.jsx)("p",{className:"mt-1.5 line-clamp-3 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,t.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[(0,t.jsx)(E.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${j.color}`,children:j.label}),e.labels?.map(e=>(0,t.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:e.label.color+"20",color:e.label.color},children:e.label.name},e.label.id)),(b||e.version)&&(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[b&&(0,t.jsxs)(D.Tooltip,{disableHoverablePopup:!0,children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)("span",{className:"inline-flex cursor-default items-center rounded-md border border-border bg-muted px-1 py-0.5 text-muted-foreground",onPointerDown:e=>e.stopPropagation(),children:(0,t.jsx)(u.GitBranch,{className:"h-2.5 w-2.5 shrink-0"})})}),(0,t.jsx)(D.TooltipContent,{side:"top",children:i("board.card.worktree",{branch:e.baseBranch??""})})]}),e.version&&(0,t.jsxs)(D.Tooltip,{disableHoverablePopup:!0,children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)("span",{className:"cursor-default",onPointerDown:e=>e.stopPropagation(),children:(0,t.jsx)(B.TaskVersionTag,{number:e.version.number,title:""})})}),(0,t.jsx)(D.TooltipContent,{side:"top",children:i("board.card.version",{number:e.version.number,name:e.version.name})})]})]})]})]})}var R=e.i(776639),A=e.i(759684);function O({open:e,onOpenChange:s,columnLabel:a,columnColor:r,tasks:n,onTaskClick:l}){let{t:i}=(0,o.useI18n)();return(0,t.jsx)(R.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(R.DialogContent,{className:"sm:max-w-6xl max-h-[80vh]",children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsxs)(R.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`h-2.5 w-2.5 rounded-full ${r}`}),(0,t.jsx)("span",{children:a}),(0,t.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-xs font-mono font-medium text-muted-foreground",children:n.length})]})}),(0,t.jsx)(A.ScrollArea,{className:"max-h-[680px]",children:(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3 pr-3",children:[n.map(e=>{let a=N.PRIORITY_CONFIG[e.priority];return(0,t.jsxs)("div",{className:"cursor-pointer rounded-lg border border-border bg-card p-3 transition-all hover:border-primary/20 hover:bg-accent/50",onClick:()=>{l?.(e),s(!1)},children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-foreground line-clamp-2",children:e.title}),e.description&&(0,t.jsx)("p",{className:"mt-1.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 flex-wrap",children:[(0,t.jsx)(E.Badge,{variant:"secondary",className:`text-[10px] font-semibold ${a.color}`,children:a.label}),e.labels?.map(e=>(0,t.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[10px] font-medium",style:{backgroundColor:e.label.color+"20",color:e.label.color},children:e.label.name},e.label.id))]})]},e.id)}),0===n.length&&(0,t.jsx)("div",{className:"col-span-4 py-8 text-center text-sm text-muted-foreground",children:i("board.noTasks")})]})})]})})}function M({id:e,label:a,color:r,tasks:n,onTaskClick:l,onEditTask:i,onAddTask:c,onDeleteTask:d,onTogglePin:x,onContextMenu:u}){let{setNodeRef:p,isOver:g}=(0,k.useDroppable)({id:e}),[f,j]=(0,s.useState)(!1),{t:b}=(0,o.useI18n)();return(0,t.jsxs)("div",{className:`flex w-0 min-w-[220px] flex-1 flex-col min-h-0 border-r border-border/50 last:border-r-0 transition-colors ${g?"bg-primary/[0.06]":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-3 py-2.5 border-b border-border/30",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`h-2 w-2 rounded-full ${r}`}),(0,t.jsx)("span",{className:"text-xs font-semibold tracking-wide text-secondary-foreground",children:a}),(0,t.jsx)("span",{className:"rounded-md bg-muted px-1.5 py-0.5 text-[10px] font-mono font-medium text-muted-foreground",children:n.length})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>j(!0),className:"text-muted-foreground","aria-label":b("board.viewAll"),children:(0,t.jsx)(w,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:c,className:"text-muted-foreground","aria-label":"add",children:(0,t.jsx)(m.Plus,{className:"h-3.5 w-3.5"})})]})]}),(0,t.jsx)(O,{open:f,onOpenChange:j,columnLabel:a,columnColor:r,tasks:n,onTaskClick:l}),(0,t.jsx)(A.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)("div",{ref:p,className:"flex flex-col gap-2 p-2",children:(0,t.jsx)(y.SortableContext,{items:n.map(e=>e.id),strategy:y.verticalListSortingStrategy,children:n.map(e=>(0,t.jsx)(F,{task:e,onClick:()=>l?.(e),onEdit:i,onDelete:d,onTogglePin:x,onContextMenu:u},e.id))})})})]})}function $({initialTasks:e,onTaskMove:a,onTaskClick:r,onEditTask:n,onAddTask:l,onDeleteTask:i,onTogglePin:o,onContextMenuStatusChange:c,onContextMenuLaunch:d,workspaceId:m}){let[x,u]=(0,s.useState)(e),[h,p]=(0,s.useState)(null),[g,f]=(0,s.useState)(null);(0,s.useEffect)(()=>{u(e)},[e]);let j=(0,k.useSensors)((0,k.useSensor)(k.PointerSensor,{activationConstraint:{distance:8}})),b=(0,s.useCallback)((e,t,s)=>{f({task:e,x:t,y:s})},[]),y=(0,s.useCallback)(e=>{let t=x.find(t=>t.id===e.active.id);t&&p(t)},[x]),w=(0,s.useCallback)(e=>{let t,{active:s,over:r}=e;if(p(null),!r)return;let n=s.id,l=r.id;if(N.BOARD_COLUMNS.some(e=>e.id===l))t=l;else{let e=x.find(e=>e.id===l);t=e?.status}t&&(u(e=>e.map(e=>e.id===n?{...e,status:t}:e)),a?.(n,t))},[x,a]);return(0,t.jsxs)(k.DndContext,{id:"kanban-board",sensors:j,collisionDetection:k.closestCorners,onDragStart:y,onDragEnd:w,children:[(0,t.jsx)("div",{className:"mx-2 flex h-full overflow-x-auto rounded-xl border border-border bg-card/50",children:N.BOARD_COLUMNS.map(e=>(0,t.jsx)(M,{id:e.id,label:e.label,color:e.color,tasks:x.filter(t=>t.status===e.id),onTaskClick:r,onEditTask:n,onAddTask:()=>l?.(e.id),onDeleteTask:i,onTogglePin:o,onContextMenu:b},e.id))}),(0,t.jsx)(k.DragOverlay,{children:h?(0,t.jsx)("div",{className:"rotate-3 scale-105",children:(0,t.jsx)(F,{task:h})}):null}),g&&(0,t.jsx)(v,{x:g.x,y:g.y,taskId:g.task.id,currentStatus:g.task.status,hasExecutions:(g.task._count?.executions??0)>0,workspaceId:m??"",onClose:()=>f(null),onStatusChange:(e,t)=>{c?.(e,t),f(null)},onLaunch:e=>{d?.(e),f(null)}})]})}var z=e.i(744798),U=e.i(232280),G=e.i(368490),W=e.i(645378),V=e.i(453889);let _=(0,n.default)("git-commit-vertical",[["path",{d:"M12 3v6",key:"1holv5"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M12 15v6",key:"a9ows0"}]]);var H=e.i(938499),K=e.i(400355),Y=e.i(233274),q=e.i(736061),J=e.i(460707),X=e.i(567860),Q=e.i(875840),Z=e.i(624687),ee=e.i(514798);let et=(0,ee.createServerReference)("60c648a26aa2b8229bb4ae88cdbbda846b81043c5e",ee.callServer,void 0,ee.findSourceMapURL,"updateProject");var es=e.i(56723);let ea=(0,ee.createServerReference)("4084c3903d7122815963b01dc8dfc3ecb04884ff1b",ee.callServer,void 0,ee.findSourceMapURL,"deleteProject"),er=(0,ee.createServerReference)("403439caf1efa0ea0b2a37abb42bd25f39c9750bef",ee.callServer,void 0,ee.findSourceMapURL,"getRecentLocalProjects"),en=(0,ee.createServerReference)("4011171d3c571d5de229cd5885328a07bece5ac02a",ee.callServer,void 0,ee.findSourceMapURL,"getOrCreateTowerTaskId");var el=e.i(752631),ei=e.i(438199),eo=e.i(237901),ec=e.i(126916),ed=e.i(360112),em=e.i(224277),ex=e.i(905455);function eu({commits:e}){let{t:a}=(0,o.useI18n)(),[r,n]=(0,s.useState)(!1);return 0===e.length?null:(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>n(!r),className:"flex w-full items-center justify-between py-1",children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:a("git.commitLog")}),r?(0,t.jsx)(U.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,t.jsx)(G.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),r&&(0,t.jsx)("div",{className:"mt-1.5 space-y-0.5 max-h-64 overflow-y-auto",children:e.map(e=>(0,t.jsxs)("div",{className:"group flex items-start gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,t.jsx)(_,{className:"h-3 w-3 shrink-0 text-muted-foreground mt-0.5"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-xs text-foreground line-clamp-1",children:e.message}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,t.jsxs)("button",{onClick:()=>{navigator.clipboard.writeText(e.shortHash),ed.toast.success(`Copied ${e.shortHash}`)},className:"flex items-center gap-0.5 font-mono text-[10px] text-primary/70 hover:text-primary transition-colors",children:[e.shortHash,(0,t.jsx)(Q.Copy,{className:"h-2.5 w-2.5 opacity-0 group-hover:opacity-100 transition-opacity"})]}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.author}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m`;let s=Math.floor(t/60);if(s<24)return`${s}h`;let a=Math.floor(s/24);return a<30?`${a}d`:`${Math.floor(a/30)}mo`}(e.date)})]})]})]},e.hash))})]})}var eh=e.i(487278),ep=e.i(375306),eg=e.i(244354);function ef({localPath:e,stashes:a,hasChanges:r,onRefresh:n}){let{t:l}=(0,o.useI18n)(),[i,c]=(0,s.useState)(!1),[d,m]=(0,s.useState)(!1),[x,u]=(0,s.useState)(""),[g,f]=(0,s.useState)(null),j=async()=>{m(!0);try{await (0,eg.gitAction)(e,"stash-save",{message:x}),u(""),ed.toast.success(l("git.stashSaved")),await n()}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}finally{m(!1)}},b=async t=>{f(t);try{await (0,eg.gitAction)(e,"stash-pop",{index:t}),ed.toast.success(l("git.stashApplied")),await n()}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}finally{f(null)}},N=async t=>{f(t);try{await (0,eg.gitAction)(e,"stash-drop",{index:t}),ed.toast.success(l("git.stashDropped")),await n()}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}finally{f(null)}};return r||0!==a.length?(0,t.jsxs)("div",{children:[(0,t.jsxs)("button",{onClick:()=>c(!i),className:"flex w-full items-center justify-between py-1",children:[(0,t.jsxs)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:[l("git.stash")," ",a.length>0&&`(${a.length})`]}),i?(0,t.jsx)(U.ChevronDown,{className:"h-3 w-3 text-muted-foreground"}):(0,t.jsx)(G.ChevronRight,{className:"h-3 w-3 text-muted-foreground"})]}),i&&(0,t.jsxs)("div",{className:"mt-1.5 space-y-2",children:[r&&(0,t.jsxs)("div",{className:"flex gap-1.5",children:[(0,t.jsx)(p.Input,{value:x,onChange:e=>u(e.target.value),placeholder:l("git.stashMsgPlaceholder"),className:"h-7 text-xs flex-1",onKeyDown:e=>"Enter"===e.key&&j()}),(0,t.jsx)(h.Button,{variant:"outline",size:"icon-sm",onClick:j,disabled:d,className:"shrink-0",children:d?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eh.Archive,{className:"h-3 w-3"})})]}),a.length>0&&(0,t.jsx)("div",{className:"space-y-0.5",children:a.map(e=>(0,t.jsxs)("div",{className:"group flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-accent transition-colors",children:[(0,t.jsx)(eh.Archive,{className:"h-3 w-3 shrink-0 text-muted-foreground"}),(0,t.jsx)("span",{className:"flex-1 min-w-0 truncate text-xs text-foreground",children:e.message||`stash@{${e.index}}`}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>b(e.index),disabled:g===e.index,className:"text-muted-foreground","aria-label":l("git.stashApply"),children:g===e.index?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(ep.ArrowUpFromLine,{className:"h-3 w-3"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>N(e.index),disabled:g===e.index,className:"text-rose-400","aria-label":l("git.stashDrop"),children:(0,t.jsx)(P.Trash2,{className:"h-3 w-3"})})]})]},e.index))})]})]}):null}var ej=e.i(515135);function eb({value:e,ariaLabel:a}){let{t:r}=(0,o.useI18n)(),[n,l]=(0,s.useState)(!1),i=async()=>{try{if(navigator.clipboard)await navigator.clipboard.writeText(e);else{let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}l(!0),ed.toast.success(r("common.copied")),setTimeout(()=>l(!1),1500)}catch{ed.toast.error(r("common.copyFailed"))}};return(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/50 pl-3 pr-1 py-1.5",children:[(0,t.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:e,children:e}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",className:"shrink-0 text-muted-foreground","aria-label":a,onClick:i,children:n?(0,t.jsx)(b.Check,{className:"h-3 w-3 text-emerald-400"}):(0,t.jsx)(Q.Copy,{className:"h-3 w-3"})})}),(0,t.jsx)(D.TooltipContent,{children:n?r("common.copied"):r("common.copy")})]})]})}function eN({project:e,workspaceId:r}){let{t:n,locale:l}=(0,o.useI18n)(),i=(0,a.useRouter)(),[c,d]=(0,s.useState)(!0),[m,x]=(0,s.useState)(!0),[g,f]=(0,s.useState)(!1),[j,b]=(0,s.useState)(!1),[N,v]=(0,s.useState)(""),[k,y]=(0,s.useState)(!1),[w,C]=(0,s.useState)(!1),[S,I]=(0,s.useState)(!1),[E,L]=(0,s.useState)(e.name),[B,F]=(0,s.useState)(e.alias??""),[A,O]=(0,s.useState)(e.description??""),[M,$]=(0,s.useState)(e.localPath??""),[z,Q]=(0,s.useState)(e.projectType??"FRONTEND"),[ee,eh]=(0,s.useState)([]);(0,s.useEffect)(()=>{er(100).then(eh)},[]);let[ep,eg]=(0,s.useState)(!1),[ev,ek]=(0,s.useState)(""),[ey,ew]=(0,s.useState)(""),[eC,eS]=(0,s.useState)(""),[eT,eP]=(0,s.useState)(""),[eI,eE]=(0,s.useState)("FRONTEND"),[eD,eL]=(0,s.useState)(!1),[eB,eF]=(0,s.useState)(!1),[eR,eA]=(0,s.useState)(null),[eO,eM]=(0,s.useState)(!1),[e$,ez]=(0,s.useState)(!1),eU=e=>{ed.toast.info(e)},eG=(0,s.useCallback)(async()=>{if(e.localPath){eM(!0);try{let t=await fetch(`/api/git?path=${encodeURIComponent(e.localPath)}`);t.ok&&eA(await t.json())}catch{}finally{eM(!1)}}},[e.localPath]);(0,s.useEffect)(()=>{eG()},[eG]);let eW=async()=>{if(e.localPath){ez(!0);try{(await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"init",path:e.localPath})})).ok?(eU(n("git.initSuccess")),await eG()):eU(n("git.initFailed"))}catch{eU(n("git.initFailed"))}finally{ez(!1)}}},eV=(e,t)=>{i.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1}),i.refresh()},e_=async()=>{if(ey.trim()){eL(!0);try{let e=await (0,es.createProject)({name:ey.trim(),alias:eC.trim()||void 0,description:eT.trim()||void 0,localPath:ev,projectType:eI,workspaceId:r});eg(!1),eV(r,e.id)}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}finally{eL(!1)}}},eH=async()=>{if(M&&!eB){eF(!0);try{let e=await (0,ec.analyzeProjectDirectory)(M.trim(),l);O(e)}catch{ed.toast.error(n("project.analyzeError"))}finally{eF(!1)}}},eK=async()=>{try{await et(e.id,{name:E.trim(),alias:B.trim()||void 0,description:A.trim()||void 0,localPath:M.trim()||void 0,projectType:z}),i.refresh(),f(!1)}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}};return(0,t.jsxs)("aside",{className:"relative w-72 flex-shrink-0 overflow-y-auto border-l border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"border-b border-border p-4",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e.name}),e.alias&&(0,t.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e.alias})]}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{L(e.name),F(e.alias??""),O(e.description??""),$(e.localPath??""),f(!0)},className:"text-muted-foreground",children:(0,t.jsx)(T.Pencil,{className:"h-3.5 w-3.5"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-sm",onClick:()=>{v(""),b(!0)},className:"text-muted-foreground hover:text-rose-400",children:(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"})})]})]}),e.description&&(0,t.jsx)("p",{className:"mt-2 text-sm text-secondary-foreground leading-relaxed line-clamp-4",children:e.description}),(0,t.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,t.jsx)("span",{className:`inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium ${"GIT"===e.type?"bg-sky-500/15 text-sky-300 ring-1 ring-sky-500/20":"bg-muted text-muted-foreground ring-1 ring-border"}`,children:"GIT"===e.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u.GitBranch,{className:"h-3 w-3"}),n("sidebar.right.gitType")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.FileText,{className:"h-3 w-3"}),n("sidebar.right.normalType")]})})}),(e.localPath||e.gitUrl)&&(0,t.jsxs)("div",{className:"mt-3 space-y-1.5",children:[e.localPath&&(0,t.jsx)(eb,{value:e.localPath,ariaLabel:n("project.localPath")}),e.gitUrl&&(0,t.jsx)(eb,{value:e.gitUrl,ariaLabel:n("project.gitUrl")})]}),e.localPath&&(0,t.jsxs)("div",{className:"mt-3 space-y-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,el.openInFileManager)(e.localPath)}catch(e){console.error("openInFileManager failed:",e),ed.toast.error(n("git.openInFileManagerFailed"))}},children:(0,t.jsx)(q.FolderSearch,{className:"h-4 w-4"})})}),(0,t.jsx)(D.TooltipContent,{children:n("git.openInFileManager")})]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,ei.openInEditor)(e.localPath)}catch(e){console.error("openInEditor failed:",e),ed.toast.error(n("git.openInEditorFailed"))}},children:(0,t.jsx)(J.Code,{className:"h-4 w-4"})})}),(0,t.jsx)(D.TooltipContent,{children:n("git.openInEditor")})]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:async()=>{try{await (0,eo.openInTerminal)(e.localPath)}catch(e){console.error("openInTerminal failed:",e),ed.toast.error(n("git.openInTerminalFailed"))}},children:(0,t.jsx)(X.Terminal,{className:"h-4 w-4"})})}),(0,t.jsx)(D.TooltipContent,{children:n("git.openInTerminal")})]})]}),(0,t.jsxs)(h.Button,{variant:"outline",className:"w-full h-9 gap-1.5 text-xs",disabled:w,onClick:async()=>{C(!0);try{let t=await en(e.id);i.push(`/workspaces/${r}/tasks/${t}`)}catch{ed.toast.error(n("git.openStudioFailed"))}finally{C(!1)}},children:[w?(0,t.jsx)(K.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(V.FolderOpen,{className:"h-3.5 w-3.5"}),n("git.openStudio")]})]})]}),(0,t.jsxs)("div",{className:"border-b border-border p-4",children:[(0,t.jsxs)(h.Button,{variant:"ghost",onClick:()=>d(!c),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("git.section")}),c?(0,t.jsx)(U.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(G.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),c&&(0,t.jsx)("div",{className:"mt-3",children:e.localPath?eO?(0,t.jsxs)("div",{className:"flex items-center justify-center py-4 text-muted-foreground",children:[(0,t.jsx)(K.Loader2,{className:"h-4 w-4 animate-spin"}),(0,t.jsx)("span",{className:"ml-2 text-xs",children:n("git.loading")})]}):eR&&!eR.isGit?(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(H.AlertCircle,{className:"h-3.5 w-3.5"}),(0,t.jsx)("p",{className:"text-xs",children:n("git.notInitialized")})]}),(0,t.jsxs)(h.Button,{className:"mt-3 h-7 w-full gap-1.5 bg-primary/10 text-xs text-primary ring-1 ring-primary/20 hover:bg-primary/15",onClick:eW,disabled:e$,children:[e$?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(_,{className:"h-3 w-3"}),n("git.initRepo")]})]}):eR?.isGit?(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("div",{className:"flex flex-col",children:(0,t.jsx)(ej.EditorGitPanel,{localPath:e.localPath,mode:"project"})}),(0,t.jsx)(eu,{commits:eR.commits??[]}),(0,t.jsx)(ef,{localPath:e.localPath,stashes:eR.stashes??[],hasChanges:(eR.changedFiles??[]).length>0,onRefresh:eG})]}):null:(0,t.jsx)("div",{className:"rounded-lg border border-border bg-muted/50 p-3",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground",children:[(0,t.jsx)(H.AlertCircle,{className:"h-3.5 w-3.5"}),(0,t.jsx)("p",{className:"text-xs",children:n("git.noLocalPath")})]})})})]}),(0,t.jsxs)("div",{className:"p-4",children:[(0,t.jsxs)(h.Button,{variant:"ghost",onClick:()=>x(!m),className:"flex w-full cursor-pointer justify-between px-2 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:n("sidebar.right.browseRepo")}),m?(0,t.jsx)(U.ChevronDown,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,t.jsx)(G.ChevronRight,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),m&&(0,t.jsxs)("div",{className:"mt-3 space-y-3",children:[(0,t.jsxs)(h.Button,{variant:"outline",className:"w-full h-8 gap-1.5 text-xs",onClick:()=>I(!0),children:[(0,t.jsx)(V.FolderOpen,{className:"h-3.5 w-3.5"}),n("sidebar.right.browseRepo")]}),ee.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground mb-1.5 px-1",children:n("sidebar.right.recent")}),(0,t.jsx)("div",{className:"space-y-0.5",children:ee.map(s=>(0,t.jsxs)("button",{onClick:()=>{s.id!==e.id&&eV(s.workspaceId,s.id)},className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors ${s.id===e.id?"bg-primary/10 text-primary cursor-default":"hover:bg-accent cursor-pointer"}`,children:["GIT"===s.type?(0,t.jsx)(u.GitBranch,{className:"h-3 w-3 shrink-0 text-emerald-400"}):(0,t.jsx)(V.FolderOpen,{className:"h-3 w-3 shrink-0 text-primary/70"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("p",{className:"truncate text-xs font-medium text-foreground",children:s.name}),s.localPath&&(0,t.jsx)("p",{className:"truncate text-[10px] font-mono text-muted-foreground",children:s.localPath})]})]},s.id))})]})]})]}),(0,t.jsx)(R.Dialog,{open:g,onOpenChange:f,children:(0,t.jsxs)(R.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsx)(R.DialogTitle,{children:n("project.edit")})}),(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:n("project.name")}),(0,t.jsx)(p.Input,{value:E,onChange:e=>L(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(ex.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:z,onChange:Q})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(p.Input,{value:B,onChange:e=>F(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(h.Button,{type:"button",variant:"ghost",onClick:eH,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!M||eB?"opacity-50":""}`,children:[eB?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(Y.Sparkles,{className:"h-3 w-3"}),eB?n("project.analyzing"):n("project.genDesc")]})]}),(0,t.jsx)(Z.Textarea,{value:A,onChange:e=>O(e.target.value),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("div",{className:"mt-1.5 break-all rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:M||"—"})]})]}),(0,t.jsxs)(R.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>f(!1),children:n("common.cancel")}),(0,t.jsx)(h.Button,{onClick:eK,disabled:!E.trim()||eB,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("common.save")})]})]})}),(0,t.jsx)(em.FolderBrowserDialog,{open:S,onOpenChange:I,onSelect:e=>{g?$(e):(e=>{let t=ee.find(t=>t.localPath===e);if(t)return eV(t.workspaceId,t.id);let s=e.split("/").filter(Boolean).pop()??"";ek(e),ew(s),eS(""),eP(""),eg(!0)})(e)}}),(0,t.jsx)(R.Dialog,{open:ep,onOpenChange:eg,children:(0,t.jsxs)(R.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsx)(R.DialogTitle,{children:n("topbar.newProject")})}),(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:n("project.localPath")}),(0,t.jsx)("div",{className:"mt-1.5 rounded-md border border-border bg-muted/50 px-3 py-2 font-mono text-xs text-muted-foreground",children:ev})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(p.Input,{value:ey,onChange:e=>ew(e.target.value),placeholder:n("project.namePlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(ex.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:eI,onChange:eE})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(p.Input,{value:eC,onChange:e=>eS(e.target.value),placeholder:n("project.aliasPlaceholder"),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsx)(Z.Textarea,{value:eT,onChange:e=>eP(e.target.value),placeholder:n("project.descPlaceholder"),rows:2,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none"})]})]}),(0,t.jsxs)(R.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>eg(!1),children:n("common.cancel")}),(0,t.jsxs)(h.Button,{onClick:e_,disabled:!ey.trim()||eD,className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:[eD?(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin mr-1"}):null,n("common.create")]})]})]})}),(0,t.jsx)(R.Dialog,{open:j,onOpenChange:e=>{b(e),e||v("")},children:(0,t.jsxs)(R.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsx)(R.DialogTitle,{className:"text-rose-400",children:n("project.deleteTitle")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("project.deleteWarning",{name:e.name})}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:n("project.deleteIrreversible")}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.deleteConfirmLabel")}),(0,t.jsx)(p.Input,{value:N,onChange:e=>v(e.target.value),placeholder:n("project.deleteConfirmPlaceholder"),className:"mt-1.5",autoFocus:!0})]})]}),(0,t.jsxs)(R.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>b(!1),children:n("common.cancel")}),(0,t.jsxs)(h.Button,{variant:"destructive",disabled:N!==n("project.deleteConfirmText")||k,onClick:async()=>{y(!0);try{await ea(e.id),ed.toast.success(n("project.deleteSuccess")),i.push(`/workspaces/${r}`)}catch{ed.toast.error(n("project.deleteFailed"))}finally{y(!1),b(!1)}},children:[k&&(0,t.jsx)(K.Loader2,{className:"h-3 w-3 animate-spin mr-1"}),n("project.deleteButton")]})]})]})})]})}var ev=e.i(475958),ek=e.i(313029),ey=e.i(301348),ew=e.i(259846),eC=e.i(975157);function eS({title:e,description:s,branch:a,baseBranch:r,version:n,hasConversation:l,updatedAt:i,openDir:c,onBack:d}){let{t:m}=(0,o.useI18n)();return(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Y.Sparkles,{className:"h-3.5 w-3.5 text-primary"}),(0,t.jsx)("span",{className:"text-xs font-semibold text-primary",children:m("taskDetail.title")})]}),(0,t.jsxs)(h.Button,{variant:"ghost",onClick:d,className:"flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground h-auto px-2 py-1",children:[(0,t.jsx)(ew.ArrowLeft,{className:"h-3.5 w-3.5"}),m("taskDetail.back")]})]}),(0,t.jsx)("h2",{className:"mt-2.5 text-lg font-bold tracking-tight text-foreground",children:e}),s&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:s}),(0,t.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[r?(0,t.jsxs)(E.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:[(0,t.jsx)(u.GitBranch,{className:"mr-1 h-3 w-3"}),r," · worktree"]}):a?(0,t.jsx)(E.Badge,{variant:"secondary",className:"bg-muted text-muted-foreground text-[10px] font-mono border border-border",children:m("taskDetail.directMode")}):null,n&&(0,t.jsx)(B.TaskVersionTag,{number:n.number,name:n.name,showName:!0}),l&&(0,t.jsx)(E.Badge,{variant:"secondary",className:"bg-emerald-500/10 text-emerald-400 text-[10px] border border-emerald-500/20",children:m("taskDetail.hasConversation")}),(0,t.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[m("taskDetail.updatedAt")," ",(0,eC.formatRelativeTime)(i)]}),c&&(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-0.5",children:[(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,el.openInFileManager)(c)}catch(e){console.error("openInFileManager failed:",e),ed.toast.error(m("git.openInFileManagerFailed"))}},children:(0,t.jsx)(q.FolderSearch,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(D.TooltipContent,{side:"bottom",children:m("git.openInFileManager")})]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,ei.openInEditor)(c)}catch(e){console.error("openInEditor failed:",e),ed.toast.error(m("git.openInEditorFailed"))}},children:(0,t.jsx)(J.Code,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(D.TooltipContent,{side:"bottom",children:m("git.openInEditor")})]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsx)(D.TooltipTrigger,{render:(0,t.jsx)(h.Button,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:async()=>{try{await (0,eo.openInTerminal)(c)}catch(e){console.error("openInTerminal failed:",e),ed.toast.error(m("git.openInTerminalFailed"))}},children:(0,t.jsx)(X.Terminal,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(D.TooltipContent,{side:"bottom",children:m("git.openInTerminal")})]})]})]})]})}var eT=e.i(14842),eP=e.i(865514),eI=e.i(83434),eE=e.i(538928),eD=e.i(676766),eL=e.i(671014),eB=e.i(303294),eF=e.i(13956),eR=e.i(228302),eA=e.i(599350),eO=e.i(936243),eM=e.i(208459),e$=e.i(326883),ez=e.i(631675);let eU=(0,n.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var eG=e.i(657153),eW=e.i(867533),eV=e.i(616612);let e_=(0,ee.createServerReference)("402bb30091608b91e90ff4b76707b89487c3c490d8",ee.callServer,void 0,ee.findSourceMapURL,"getTaskNotes");var eH=e.i(777718);let eK=(0,ee.createServerReference)("402b1c4bc3b30ff4737429c58939a8486727c565ec",ee.callServer,void 0,ee.findSourceMapURL,"getTaskAssets");var eY=e.i(858085),eq=e.i(696489),eJ=e.i(235357),eX=e.i(144640),eQ=e.i(937304);let eZ=/\.(txt|md|json)$/i;function e0({taskId:e,projectId:a}){let{t:r}=(0,o.useI18n)(),n=(0,s.useRef)(null),[l,i]=(0,s.useState)([]),[c,d]=(0,s.useState)([]),[x,u]=(0,s.useState)(!1),[p,g]=(0,s.useState)(""),[f,j]=(0,s.useState)(""),[b,N]=(0,s.useState)(!1),[v,k]=(0,s.useState)(null);async function y(){p.trim()&&(await (0,eV.createNote)({title:p.trim(),content:f.trim(),projectId:a,taskId:e,category:"task"}),g(""),j(""),u(!1),e_(e).then(i))}async function w(e){await (0,eH.deleteNote)(e),i(t=>t.filter(t=>t.id!==e))}async function C(t){let s=t.target.files?.[0];if(s){N(!0);try{let t=new FormData;t.set("file",s),t.set("projectId",a),t.set("taskId",e),await (0,eY.uploadAsset)(t),eK(e).then(d)}finally{N(!1),n.current&&(n.current.value="")}}}async function S(e){await (0,eq.deleteAsset)(e),d(t=>t.filter(t=>t.id!==e))}function T(e){return(0,eQ.isImageAsset)(e.filename,e.mimeType)||eZ.test(e.filename)}function I(e){T(e)?k(e):ed.toast.info(r("assets.previewNotSupported"))}async function E(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(()=>({}));ed.toast.error(e.error||"Failed to reveal file")}}catch{ed.toast.error("Failed to reveal file")}}(0,s.useEffect)(()=>{e_(e).then(i),eK(e).then(d)},[e]);let D=v?(0,eQ.isImageAsset)(v.filename,v.mimeType)?"image":eZ.test(v.filename)?"text":null:null,L=c.filter(e=>(0,eQ.isImageAsset)(e.filename,e.mimeType)).map(e=>({id:e.id,url:(0,eQ.localPathToApiUrl)(e.path),filename:e.filename})),B=v?L.findIndex(e=>e.id===v.id):-1;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A.ScrollArea,{className:"h-full",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:"border-b border-border px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,t.jsx)(W.FileText,{className:"h-3.5 w-3.5"}),r("taskPage.notes")]}),(0,t.jsxs)(h.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>u(!x),children:[x?(0,t.jsx)(eG.X,{className:"h-3 w-3"}):(0,t.jsx)(m.Plus,{className:"h-3 w-3"}),x?"":r("taskPage.addNote")]})]}),x&&(0,t.jsxs)("div",{className:"mt-3 space-y-2",children:[(0,t.jsx)("input",{type:"text",value:p,onChange:e=>g(e.target.value),placeholder:r("taskPage.noteTitle"),className:"h-8 w-full rounded-md border border-border bg-background px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary",autoFocus:!0}),(0,t.jsx)("textarea",{value:f,onChange:e=>j(e.target.value),placeholder:r("taskPage.noteContent"),rows:3,className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-1 focus:ring-primary resize-none"}),(0,t.jsx)(h.Button,{className:"text-xs",onClick:y,disabled:!p.trim(),children:r("taskPage.addNote")})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[0===l.length&&!x&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noNotes")}),l.map(e=>(0,t.jsx)("div",{className:"group rounded-md border border-border bg-card p-3",children:(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h4",{className:"text-sm font-medium truncate",children:e.title}),e.content&&(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-3 whitespace-pre-wrap",children:e.content}),(0,t.jsx)("p",{className:"mt-1 text-[10px] text-muted-foreground",children:new Date(e.createdAt).toLocaleString()})]}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>w(e.id),className:"shrink-0 text-muted-foreground opacity-0 hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100",title:r("taskPage.deleteNote"),children:(0,t.jsx)(P.Trash2,{className:"h-3.5 w-3.5"})})]})},e.id))]})]}),(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("h3",{className:"flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:[(0,t.jsx)(eU,{className:"h-3.5 w-3.5"}),r("taskPage.attachments")]}),(0,t.jsxs)(h.Button,{variant:"ghost",className:"h-6 gap-1 px-2 text-xs",onClick:()=>n.current?.click(),disabled:b,children:[(0,t.jsx)(ez.Upload,{className:"h-3 w-3"}),r("taskPage.uploadFile")]}),(0,t.jsx)("input",{ref:n,type:"file",className:"hidden",onChange:C})]}),(0,t.jsxs)("div",{className:"mt-2 space-y-1.5",children:[0===c.length&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground py-2",children:r("taskPage.noAttachments")}),c.map(e=>{var s;let a=T(e);return(0,t.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-card px-3 py-2",children:[(0,t.jsx)(eU,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,t.jsx)("button",{type:"button",onClick:()=>I(e),disabled:!a,className:`min-w-0 flex-1 truncate text-left text-sm ${a?"cursor-pointer hover:underline":"cursor-default"}`,title:a?r("assets.preview"):e.filename,children:e.filename}),(0,t.jsx)("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:(s=e.size)?s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1024/1024).toFixed(1)} MB`:""}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[a&&(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>I(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:r("assets.preview"),children:(0,t.jsx)(eW.Eye,{className:"h-3 w-3"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>E(e),className:"shrink-0 text-muted-foreground hover:bg-accent",title:r("assets.revealInFinder"),children:(0,t.jsx)(V.FolderOpen,{className:"h-3 w-3"})}),(0,t.jsx)(h.Button,{variant:"ghost",size:"icon-xs",onClick:()=>S(e.id),className:"shrink-0 text-muted-foreground hover:bg-destructive/10 hover:text-destructive",title:r("taskPage.deleteAttachment"),children:(0,t.jsx)(P.Trash2,{className:"h-3 w-3"})})]})]},e.id)})]})]})]})}),(0,t.jsx)(eJ.ImageLightbox,{imageUrl:"image"===D&&B>=0?L[B].url:null,filename:"image"===D&&B>=0?L[B].filename:"",open:"image"===D,onOpenChange:e=>{e||k(null)},assets:L.map(({url:e,filename:t})=>({url:e,filename:t})),currentIndex:B>=0?B:void 0,onIndexChange:e=>{let t=L[e];if(!t)return;let s=c.find(e=>e.id===t.id);s&&k(s)}}),(0,t.jsx)(eX.TextPreviewDialog,{url:"text"===D&&v?(0,eQ.localPathToApiUrl)(v.path):null,filename:v?.filename??"",open:"text"===D,onOpenChange:e=>{e||k(null)}})]})}function e1({task:e,workspaceId:r,projectLocalPath:n,onClose:l}){let{t:i}=(0,o.useI18n)(),c=(0,a.useRouter)(),{removePortal:d}=(0,eI.useTerminalPortal)(),[m,x]=(0,s.useState)("terminal"),[u,p]=(0,s.useState)(null),[f,j]=(0,s.useState)(!1),[b,N]=(0,s.useState)(e.status);(0,s.useEffect)(()=>{N(e.status)},[e.status]);let[v,k]=(0,s.useState)(null),[y,w]=(0,s.useState)(!1),[C,S]=(0,s.useState)(!1),[T,P]=(0,s.useState)([]);(0,s.useEffect)(()=>{k(null),w(!1),S(!1),P([]),p(null),x("terminal")},[e.id]);let[I,E]=(0,s.useState)([]),[L,B]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=!1;return(0,eM.getPrompts)().then(t=>{if(e)return;E(t.map(e=>({id:e.id,name:e.name,isDefault:e.isDefault})));let s=t.find(e=>e.isDefault);s&&B(s.id)}),()=>{e=!0}},[]),(0,s.useEffect)(()=>{k(null),S(!1);let t=!1;return(0,eE.getTaskExecutions)(e.id).then(e=>{if(t)return;let s=e[0];if(s?.status==="RUNNING"){let e=s.worktreePath||n||null;e&&k(e)}P(e.filter(e=>"RUNNING"!==e.status)),S(!0)}),()=>{t=!0}},[e.id]),(0,s.useEffect)(()=>{if("changes"!==m||"TODO"===b||"CANCELLED"===b)return;let t=!1;return j(!0),fetch(`/api/tasks/${e.id}/diff`).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{t||p(e?.files||e?.branchDeleted?e:null)}).catch(()=>{t||p(null)}).finally(()=>{t||j(!1)}),()=>{t=!0}},[m,b,e.id]);let F=(0,s.useCallback)(async()=>{if(!y){w(!0),d(e.id);try{let t=await (0,eD.startPtyExecutionSafe)(e.id,"",L);if(!t.ok){w(!1),ed.toast.error(t.error||i("terminal.startFailed"));return}k(t.worktreePath??null),N("IN_PROGRESS")}catch(e){w(!1),ed.toast.error(e instanceof Error&&e.message?e.message:i("terminal.startFailed"))}}},[e.id,y,L,i]),R=(0,s.useCallback)(t=>{w(!1),k(null),d(e.id),0===t&&N("IN_REVIEW"),(0,eE.getTaskExecutions)(e.id).then(e=>{P(e.filter(e=>"RUNNING"!==e.status))}),c.refresh()},[c,e.id]),O=(0,s.useCallback)(async()=>{await (0,eL.stopPtyExecution)(e.id),w(!1),d(e.id),k(null),N("IN_REVIEW"),(0,eE.getTaskExecutions)(e.id).then(e=>{P(e.filter(e=>"RUNNING"!==e.status))}),c.refresh()},[e.id,c]),M=(0,s.useCallback)(async t=>{w(!0),d(e.id),k(null);try{let{worktreePath:s}=await (0,eB.resumePtyExecution)(e.id,t);k(s),N("IN_PROGRESS")}catch{w(!1)}},[e.id,d]),$=(0,s.useCallback)(async()=>{w(!0),d(e.id),k(null);try{let{worktreePath:t}=await (0,eF.continueLatestPtyExecution)(e.id);k(t),N("IN_PROGRESS")}catch(e){w(!1),ed.toast.error(e instanceof Error?e.message:String(e))}},[e.id,d]),[z,U]=(0,s.useState)(!1),[G,V]=(0,s.useState)([]),_=(0,s.useCallback)(async()=>{try{let t=await (0,eA.checkWorktreeClean)(e.id);if(t.hasWorktree&&!t.clean)return void ed.toast.error(i("taskPage.uncommittedChanges",{count:String(t.files.length)}));if(t.hasWorktree&&t.clean&&!t.hasCommits)return void ed.toast.error(i("taskPage.noChangesToComplete"),{action:{label:i("taskPage.markAsCancelled"),onClick:()=>{(0,eR.updateTaskStatus)(e.id,"CANCELLED").then(()=>{N("CANCELLED"),ed.toast.success(i("taskPage.taskCancelled")),c.refresh()}).catch(()=>ed.toast.error("Failed to cancel task"))}}});if(t.hasWorktree&&t.hasCommits){V(t.commitLog),U(!0);return}await (0,eR.updateTaskStatus)(e.id,"DONE"),N("DONE"),ed.toast.success(i("taskPage.taskCompleted")),c.refresh()}catch{ed.toast.error("Failed to complete task")}},[e.id,c,i]),H=(0,s.useCallback)(()=>{N("DONE"),U(!1),ed.toast.success(i("taskPage.taskCompleted")),c.refresh()},[c,i]),Y=(0,s.useCallback)(async t=>{try{let{hash:s}=await (0,eO.commitWorktreeChanges)(e.id,t);ed.toast.success(i("diff.commitSuccess",{hash:s})),c.refresh();let a=await fetch(`/api/tasks/${e.id}/diff`);if(a.ok){let e=await a.json();p(e?.files?e:null)}}catch(e){ed.toast.error(e instanceof Error?e.message:"Commit failed")}},[e.id,c,i]);return(0,t.jsxs)("div",{className:"flex h-full w-[600px] flex-shrink-0 flex-col border-l border-border bg-sidebar","data-testid":"task-detail-panel",children:[(0,t.jsx)(eS,{title:e.title,description:i("taskDetail.panelDescription"),branch:`task/${e.id}`,baseBranch:e.baseBranch,version:e.version??null,hasConversation:!1,updatedAt:e.updatedAt,openDir:v??(n?e.subPath?`${n}/${e.subPath}`:n:null),onBack:l}),(0,t.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2",children:[(0,t.jsxs)("div",{className:"flex gap-1",children:[(0,t.jsxs)("button",{onClick:()=>x("terminal"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"terminal"===m?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(X.Terminal,{className:"h-3 w-3"}),i("terminal.execute")]}),(0,t.jsx)("button",{onClick:()=>x("changes"),className:`px-3 py-1 text-xs font-medium rounded-md ${"changes"===m?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:i("taskPage.changes")}),(0,t.jsxs)("button",{onClick:()=>x("notes"),className:`flex items-center gap-1.5 px-3 py-1 text-xs font-medium rounded-md ${"notes"===m?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(W.FileText,{className:"h-3 w-3"}),i("taskPage.notes")]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:["IN_REVIEW"===b&&(0,t.jsxs)(h.Button,{size:"sm",onClick:_,className:"bg-emerald-500/15 text-emerald-400 ring-1 ring-emerald-500/20 hover:bg-emerald-500/25",children:[(0,t.jsx)(ey.CheckCircle2,{className:"h-3 w-3"}),i("taskPage.completeTask")]}),"DONE"!==b&&"CANCELLED"!==b&&(0,t.jsxs)(h.Button,{variant:"ghost",size:"sm",onClick:()=>c.push(`/workspaces/${r}/tasks/${e.id}`),className:"text-muted-foreground",children:[(0,t.jsx)(ev.ExternalLink,{className:"h-3 w-3"}),i("taskPage.viewDetails")]})]})]}),"terminal"===m?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:C?v?(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 flex items-center justify-between border-b border-neutral-800 px-3 py-2 bg-[#0f1419]",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,t.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),i("execution.running")]}),(0,t.jsxs)(D.Tooltip,{children:[(0,t.jsxs)(D.TooltipTrigger,{onClick:O,className:"flex items-center gap-1.5 rounded-md bg-red-500/15 px-3 py-1 text-xs font-medium text-red-400 hover:bg-red-500/25 transition-colors",children:[(0,t.jsx)(ek.Square,{className:"h-3 w-3"}),i("terminal.stopExecution")]}),(0,t.jsx)(D.TooltipContent,{side:"bottom",children:i("terminal.stopHint")})]})]}),(0,t.jsx)("div",{className:"flex-1 min-h-0",children:(0,t.jsx)(eI.TerminalOutlet,{taskId:e.id,worktreePath:v,onSessionEnd:R})})]}):"DONE"===b||"CANCELLED"===b?(0,t.jsx)("div",{className:"flex h-full flex-col overflow-hidden",children:(0,t.jsx)(A.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)(e$.ExecutionTimeline,{executions:T})})}):(0,t.jsxs)("div",{className:"flex h-full flex-col overflow-hidden",children:[(0,t.jsxs)("div",{className:"shrink-0 flex items-center gap-2 border-b border-border px-4 py-3",children:[I.length>0&&(0,t.jsxs)(g.Select,{defaultValue:L??"none",onValueChange:e=>B("none"===e?null:e),children:[(0,t.jsx)(g.SelectTrigger,{size:"sm",className:"min-w-[120px]",children:(0,t.jsx)("span",{className:"text-left truncate",children:L?I.find(e=>e.id===L)?.name??i("terminal.noPrompt"):i("terminal.noPrompt")})}),(0,t.jsxs)(g.SelectContent,{className:"min-w-[200px]",children:[(0,t.jsx)(g.SelectItem,{value:"none",children:i("terminal.noPrompt")}),I.map(e=>(0,t.jsxs)(g.SelectItem,{value:e.id,children:[e.name,e.isDefault?" ★":""]},e.id))]})]},`prompt-${I.length}`),(0,t.jsxs)(h.Button,{onClick:F,disabled:y,size:"sm",className:"gap-2 px-4",children:[y?(0,t.jsx)(K.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(X.Terminal,{className:"h-3.5 w-3.5"}),y?i("terminal.executing"):i("terminal.launch")]})]}),(0,t.jsx)(A.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsx)(e$.ExecutionTimeline,{executions:T,onResume:M,onContinueLatest:$})})]}):(0,t.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-[#0f1419]",children:[(0,t.jsx)(K.Loader2,{className:"size-5 animate-spin text-neutral-500"}),(0,t.jsx)("span",{className:"text-xs text-neutral-500",children:i("execution.loading")})]})}):"changes"===m?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:f?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.loadingDiff")})}):u?.branchDeleted?(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.branchDeleted")})}):u?(0,t.jsx)(eT.TaskDiffView,{taskId:e.id,files:u.files,totalAdded:u.totalAdded,totalRemoved:u.totalRemoved,hasConflicts:u.hasConflicts,conflictFiles:u.conflictFiles,onCommit:Y,hasUncommitted:u.hasUncommitted}):(0,t.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:i("taskPage.noChanges")})})}):"notes"===m?(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,t.jsx)(e0,{taskId:e.id,projectId:e.projectId})}):null,(0,t.jsx)(eP.TaskMergeConfirmDialog,{open:z,onOpenChange:U,taskId:e.id,taskTitle:e.title,baseBranch:e.baseBranch??"main",fileCount:u?.files?.length??0,commitCount:u?.commitCount??0,commitLog:G,onMergeComplete:H})]})}var e3=e.i(110996),e5=e.i(174050);let e2=(0,ee.createServerReference)("400f814f0a6ed1b06b26791fc295c31b044c6a7d51",ee.callServer,void 0,ee.findSourceMapURL,"deleteTask"),e4=(0,ee.createServerReference)("4059e8a38acae5fc4820089f4831048ae1c0e58931",ee.callServer,void 0,ee.findSourceMapURL,"toggleTaskPinned");var e8=e.i(964317);let e7=(0,ee.createServerReference)("406b72520cfe77d9ee1c81f79deb3678d6ed775324",ee.callServer,void 0,ee.findSourceMapURL,"getVersionsForPicker");var e6=e.i(19671);function e9({projects:e,activeProjectId:a,onSelect:r}){let n=(0,s.useRef)(null),[l,i]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!1),d=()=>{let e=n.current;e&&(i(e.scrollLeft>0),c(e.scrollLeft<e.scrollWidth-e.clientWidth-1))};(0,s.useEffect)(()=>{d();let e=n.current;if(e){e.addEventListener("scroll",d);let t=new ResizeObserver(d);return t.observe(e),()=>{e.removeEventListener("scroll",d),t.disconnect()}}},[e]);let m=e=>{let t=n.current;t&&t.scrollBy({left:"left"===e?-150:150,behavior:"smooth"})};return(0,t.jsxs)("div",{className:"relative flex items-center",children:[l&&(0,t.jsx)("button",{onClick:()=>m("left"),className:"absolute left-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,t.jsx)(e6.ChevronLeft,{className:"h-4 w-4"})}),(0,t.jsx)("div",{ref:n,className:"flex items-center gap-1.5 overflow-x-auto scrollbar-none px-1 py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e.map(e=>{let s=a===e.id;return(0,t.jsxs)("button",{onClick:()=>{s||r(e.id)},className:`shrink-0 rounded-lg border-b-2 px-4 py-2 text-sm font-medium transition-colors ${s?"border-primary bg-primary/10 text-primary ring-1 ring-primary/20 cursor-default":"border-transparent text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer"}`,children:[(0,t.jsx)("span",{children:e.name}),e.alias&&(0,t.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground font-normal",children:e.alias})]},e.id)})}),o&&(0,t.jsx)("button",{onClick:()=>m("right"),className:"absolute right-0 z-10 flex h-8 w-8 items-center justify-center rounded-md bg-background/90 text-muted-foreground shadow-sm ring-1 ring-border backdrop-blur-sm transition-colors hover:text-foreground",children:(0,t.jsx)(G.ChevronRight,{className:"h-4 w-4"})})]})}var te=e.i(759686);function tt({open:e,onOpenChange:s,taskTitle:a,uncommittedFiles:r,commitLog:n,onConfirm:l}){let{t:i}=(0,o.useI18n)(),c=r.length,d=n.length,m=0===c&&0===d;return(0,t.jsx)(R.Dialog,{open:e,onOpenChange:s,children:(0,t.jsxs)(R.DialogContent,{showCloseButton:!0,className:"sm:max-w-md",children:[(0,t.jsx)(R.DialogHeader,{children:(0,t.jsxs)(R.DialogTitle,{className:"flex items-center gap-2",children:[(0,t.jsx)(te.AlertTriangle,{className:"h-4 w-4 text-amber-400"}),i("taskCancel.title")]})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[(0,t.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/10 p-3 space-y-1.5",children:[(0,t.jsx)("p",{className:"text-xs text-foreground",children:i("taskCancel.intro",{title:a})}),(0,t.jsx)("p",{className:"text-xs text-amber-300",children:i("taskCancel.irreversible")})]}),m?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i("taskCancel.cleanNotice")}):(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:i("taskCancel.uncommittedFiles")}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:c})]}),(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:i("taskCancel.unmergedCommits")}),(0,t.jsx)("span",{className:"text-xs font-medium text-foreground",children:d})]})]}),c>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:i("taskCancel.filesList")}),(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:r.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))})]}),d>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs text-muted-foreground mb-1 block",children:i("taskCancel.commitsList")}),(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:n.map((e,s)=>(0,t.jsx)("div",{className:"text-xs font-mono text-foreground/80",children:e},s))}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-1.5",children:i("taskCancel.reflogHint")})]})]}),(0,t.jsxs)(R.DialogFooter,{children:[(0,t.jsx)(h.Button,{variant:"outline",onClick:()=>s(!1),children:i("taskCancel.keep")}),(0,t.jsxs)(h.Button,{variant:"destructive",onClick:l,className:"gap-2",children:[(0,t.jsx)(te.AlertTriangle,{className:"h-4 w-4"}),i("taskCancel.confirm")]})]})]})})}e.s(["BoardPageClient",0,function({workspaceId:e,projectId:r,project:n,projects:l,initialTasks:i,labels:d,openTaskId:m}){let x=(0,a.useRouter)(),{t:u}=(0,o.useI18n)(),[,h]=(0,s.useTransition)(),[p,g]=(0,s.useState)(""),[j,b]=(0,s.useState)("all"),[v,k]=(0,s.useState)(!1),[y,w]=(0,s.useState)("TODO"),[C,S]=(0,s.useState)(m??null),[T,P]=(0,s.useState)([]),I=C?i.find(e=>e.id===C)??null:null,[E,D]=(0,s.useState)(null),[L,B]=(0,s.useState)(null),[F,R]=(0,s.useState)(null);(0,s.useEffect)(()=>{e7(r).then(P).catch(()=>P([]))},[r]);let A=T.find(e=>e.isCurrent)?.id??null,O=(0,s.useCallback)(()=>{h(()=>{x.refresh()})},[x]);(0,s.useEffect)(()=>{if(v)return;let e=setInterval(()=>{h(()=>{x.refresh()})},5e3);return()=>clearInterval(e)},[x,v]);let M=(0,s.useCallback)(e=>{g(e)},[]),U=(0,s.useCallback)(async e=>{let t=i.find(t=>t.id===e);if(t)try{let s=await (0,eA.checkWorktreeClean)(e);if(s.hasWorktree&&!s.clean){ed.toast.error(u("taskPage.uncommittedChanges",{count:String(s.files.length)})),O();return}if(s.hasWorktree&&s.clean&&!s.hasCommits){ed.toast.error(u("taskPage.noChangesToComplete"),{action:{label:u("taskPage.markAsCancelled"),onClick:()=>{(0,eR.updateTaskStatus)(e,"CANCELLED").then(()=>{ed.toast.success(u("taskPage.taskCancelled")),O()}).catch(()=>ed.toast.error("Failed to cancel task"))}}}),O();return}if(s.hasWorktree&&s.hasCommits){B({task:t,commitLog:s.commitLog,commitCount:s.commitLog.length}),O();return}await (0,eR.updateTaskStatus)(e,"DONE"),ed.toast.success(u("taskPage.taskCompleted")),O()}catch{ed.toast.error("Failed to complete task"),O()}},[i,O,u]),G=(0,s.useCallback)(async e=>{let t=i.find(t=>t.id===e);if(t)try{let s=await (0,eA.checkWorktreeClean)(e);if(!s.hasWorktree){await (0,eR.updateTaskStatus)(e,"CANCELLED"),ed.toast.success(u("taskPage.taskCancelled")),O();return}R({task:t,files:s.files,commitLog:s.commitLog}),O()}catch{ed.toast.error("Failed to cancel task"),O()}},[i,O,u]),W=(0,s.useCallback)(async(e,t)=>{"DONE"===t?await U(e):"CANCELLED"===t?await G(e):(await (0,eR.updateTaskStatus)(e,t),O())},[O,U,G]),V=(0,s.useCallback)(async e=>{let t=await (0,e3.createTask)({title:e.title,description:e.description,projectId:r,priority:e.priority,status:e.status,labelIds:e.labelIds,baseBranch:e.baseBranch,subPath:e.subPath,versionId:e.versionId??void 0});if(e.autoStart&&t?.id)try{await (0,e8.startPtyExecution)(t.id,""),S(t.id)}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}O()},[r,O]),_=(0,s.useCallback)(async(e,t)=>{await (0,e5.updateTask)(e,{...t,labelIds:t.labelIds}),D(null),O()},[O]),H=(0,s.useCallback)(async e=>{await e2(e),C===e&&S(null),O()},[O,C]),K=(0,s.useCallback)(async e=>{await e4(e),O()},[O]),Y=(0,s.useCallback)(async t=>{try{await (0,e8.startPtyExecution)(t,"")}catch(e){ed.toast.error(e instanceof Error?e.message:String(e))}x.push(`/workspaces/${e}/tasks/${t}`)},[x,e]),q=(0,s.useCallback)(async(e,t)=>{"DONE"===t?await U(e):"CANCELLED"===t?await G(e):(await (0,eR.updateTaskStatus)(e,t),O())},[O,U,G]),J=(0,s.useCallback)(e=>{w(e),D(null),k(!0)},[]),X=(0,s.useCallback)(e=>{D(e),k(!0)},[]),Q=i.filter(e=>!e.labels?.some(e=>e.label.name===N.TOWER_LABEL_NAME&&e.label.isBuiltin)),Z=Q.filter(e=>{if("backlog"===j){if(e.versionId)return!1}else if("all"!==j&&e.versionId!==j)return!1;if(p.trim()){let t=p.toLowerCase();if(!e.title.toLowerCase().includes(t)&&!e.description?.toLowerCase().includes(t))return!1}return!0});return(0,t.jsxs)("div",{className:"flex h-full",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)("div",{className:"px-6 pt-3 pb-1",children:(0,t.jsx)(e9,{projects:l,activeProjectId:r,onSelect:t=>x.push(`/workspaces/${e}?projectId=${t}`,{scroll:!1})})}),(0,t.jsx)(c,{totalTasks:Q.length,runningTasks:Q.filter(e=>"IN_PROGRESS"===e.status).length}),(0,t.jsx)(f,{searchQuery:p,onSearchChange:M,versions:T,versionFilter:j,onVersionFilterChange:b,versionsHref:`/workspaces/${e}/projects/${r}/versions`,onCreateTask:()=>{D(null),k(!0)}}),(0,t.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden p-4",children:(0,t.jsx)($,{initialTasks:Z,onTaskMove:W,onTaskClick:e=>{S(e.id)},onEditTask:X,onAddTask:J,onDeleteTask:H,onTogglePin:K,workspaceId:e,onContextMenuStatusChange:q,onContextMenuLaunch:Y})}),(0,t.jsx)(z.CreateTaskDialog,{open:v,onOpenChange:e=>{k(e),e||D(null)},onSubmit:V,onUpdate:_,defaultStatus:y,editTask:E,editTaskLabelIds:E?.labels?E.labels.map(e=>e.labelId):[],labels:d.filter(e=>!(e.name===N.TOWER_LABEL_NAME&&e.isBuiltin)),projectType:n.type,projectLocalPath:n.localPath,versions:T,defaultVersionId:A})]}),I?(0,t.jsx)(e1,{task:I,workspaceId:e,projectLocalPath:n.localPath,onClose:()=>S(null)}):(0,t.jsx)(eN,{project:n,workspaceId:e}),L&&(0,t.jsx)(eP.TaskMergeConfirmDialog,{open:!0,onOpenChange:e=>{e||B(null)},taskId:L.task.id,taskTitle:L.task.title,baseBranch:L.task.baseBranch??"main",fileCount:0,commitCount:L.commitCount,commitLog:L.commitLog,onMergeComplete:()=>{B(null),ed.toast.success(u("taskPage.taskCompleted")),O()}}),F&&(0,t.jsx)(tt,{open:!0,onOpenChange:e=>{e||R(null)},taskTitle:F.task.title,uncommittedFiles:F.files,commitLog:F.commitLog,onConfirm:()=>{let e=F.task.id;R(null),(0,eR.updateTaskStatus)(e,"CANCELLED").then(()=>{ed.toast.success(u("taskPage.taskCancelled")),O()}).catch(()=>ed.toast.error("Failed to cancel task"))}})]})}],783426)}]);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,110996,e=>{"use strict";var t=e.i(514798);let r=(0,t.createServerReference)("40a0b52dfe6da9c6fbc005d69017ef1f28bffb3dd6",t.callServer,void 0,t.findSourceMapURL,"createTask");e.s(["createTask",0,r])},456346,317056,183286,157368,e=>{"use strict";let t,r,n,a=(0,e.i(572989).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,a],456346);var o,i,l,u,s,c,d,f,p,m=e.i(289721),v=/[\\\/_+.#"@\[\(\{&]/,h=/[\\\/_+.#"@\[\(\{&]/g,g=/[\s-]/,b=/[\s-]/g;function y(e){return e.toLowerCase().replace(b," ")}var x=e.i(965652);function E(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function w(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function C(...e){return t=>{let r=!1,n=e.map(e=>{let n=w(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():w(e[t],null)}}}}function k(...e){return x.useCallback(C(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var S=globalThis?.document?x.useLayoutEffect:()=>{},N=x[" useId ".trim().toString()]||(()=>void 0),j=0;function R(e){let[t,r]=x.useState(N());return S(()=>{e||r(e=>e??String(j++))},[e]),e||(t?`radix-${t}`:"")}x[" useEffectEvent ".trim().toString()],x[" useInsertionEffect ".trim().toString()];var I=x[" useInsertionEffect ".trim().toString()]||S;Symbol("RADIX:SYNC_STATE");var D=e.i(585012);function P(e){var t;let r,n=(t=e,(r=x.forwardRef((e,t)=>{let{children:r,...n}=e;if(x.isValidElement(r)){var a;let e,o,i=(a=r,(o=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(o=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),l=function(e,t){let r={...t};for(let n in t){let a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==x.Fragment&&(l.ref=t?C(t,i):i),x.cloneElement(r,l)}return x.Children.count(r)>1?x.Children.only(null):null})).displayName=`${t}.SlotClone`,r),a=x.forwardRef((e,t)=>{let{children:r,...a}=e,o=x.Children.toArray(r),i=o.find(A);if(i){let e=i.props.children,r=o.map(t=>t!==i?t:x.Children.count(e)>1?x.Children.only(null):x.isValidElement(e)?e.props.children:null);return(0,m.jsx)(n,{...a,ref:t,children:x.isValidElement(e)?x.cloneElement(e,void 0,r):null})}return(0,m.jsx)(n,{...a,ref:t,children:r})});return a.displayName=`${e}.Slot`,a}var M=Symbol("radix.slottable");function A(e){return x.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===M}var O=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let r=P(`Primitive.${t}`),n=x.forwardRef((e,n)=>{let{asChild:a,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,m.jsx)(a?r:t,{...o,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function L(e){let t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...e)=>t.current?.(...e),[])}var T="dismissableLayer.update",_=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$=x.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:i,onDismiss:l,...u}=e,s=x.useContext(_),[c,d]=x.useState(null),p=c?.ownerDocument??globalThis?.document,[,v]=x.useState({}),h=k(t,e=>d(e)),g=Array.from(s.layers),[b]=[...s.layersWithOutsidePointerEventsDisabled].slice(-1),y=g.indexOf(b),w=c?g.indexOf(c):-1,C=s.layersWithOutsidePointerEventsDisabled.size>0,S=w>=y,N=function(e,t=globalThis?.document){let r=L(e),n=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{let e=e=>{if(e.target&&!n.current){let n=function(){W("dismissableLayer.pointerDownOutside",r,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",a.current),a.current=n,t.addEventListener("click",a.current,{once:!0})):n()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{let t=e.target,r=[...s.branches].some(e=>e.contains(t));S&&!r&&(a?.(e),i?.(e),e.defaultPrevented||l?.())},p),j=function(e,t=globalThis?.document){let r=L(e),n=x.useRef(!1);return x.useEffect(()=>{let e=e=>{e.target&&!n.current&&W("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{let t=e.target;![...s.branches].some(e=>e.contains(t))&&(o?.(e),i?.(e),e.defaultPrevented||l?.())},p);return!function(e,t=globalThis?.document){let r=L(e);x.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{w===s.layers.size-1&&(n?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),x.useEffect(()=>{if(c)return r&&(0===s.layersWithOutsidePointerEventsDisabled.size&&(f=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),s.layersWithOutsidePointerEventsDisabled.add(c)),s.layers.add(c),F(),()=>{r&&1===s.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=f)}},[c,p,r,s]),x.useEffect(()=>()=>{c&&(s.layers.delete(c),s.layersWithOutsidePointerEventsDisabled.delete(c),F())},[c,s]),x.useEffect(()=>{let e=()=>v({});return document.addEventListener(T,e),()=>document.removeEventListener(T,e)},[]),(0,m.jsx)(O.div,{...u,ref:h,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:E(e.onFocusCapture,j.onFocusCapture),onBlurCapture:E(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:E(e.onPointerDownCapture,N.onPointerDownCapture)})});function F(){let e=new CustomEvent(T);document.dispatchEvent(e)}function W(e,t,r,{discrete:n}){let a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});if(t&&a.addEventListener(e,t,{once:!0}),n)a&&D.flushSync(()=>a.dispatchEvent(o));else a.dispatchEvent(o)}$.displayName="DismissableLayer",x.forwardRef((e,t)=>{let r=x.useContext(_),n=x.useRef(null),a=k(t,n);return x.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,m.jsx)(O.div,{...e,ref:a})}).displayName="DismissableLayerBranch";var B="focusScope.autoFocusOnMount",U="focusScope.autoFocusOnUnmount",z={bubbles:!1,cancelable:!0},K=x.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...i}=e,[l,u]=x.useState(null),s=L(a),c=L(o),d=x.useRef(null),f=k(t,e=>u(e)),p=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let e=function(e){if(p.paused||!l)return;let t=e.target;l.contains(t)?d.current=t:q(d.current,{select:!0})},t=function(e){if(p.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||q(d.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&q(l)});return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,l,p.paused]),x.useEffect(()=>{if(l){Y.add(p);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(B,z);l.addEventListener(B,s),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(q(n,{select:t}),document.activeElement!==r)return}(V(l).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&q(l))}return()=>{l.removeEventListener(B,s),setTimeout(()=>{let t=new CustomEvent(U,z);l.addEventListener(U,c),l.dispatchEvent(t),t.defaultPrevented||q(e??document.body,{select:!0}),l.removeEventListener(U,c),Y.remove(p)},0)}}},[l,s,c,p]);let v=x.useCallback(e=>{if(!r&&!n||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,a=document.activeElement;if(t&&a){var o;let t,n=e.currentTarget,[i,l]=[H(t=V(o=n),o),H(t.reverse(),o)];i&&l?e.shiftKey||a!==l?e.shiftKey&&a===i&&(e.preventDefault(),r&&q(l,{select:!0})):(e.preventDefault(),r&&q(i,{select:!0})):a===n&&e.preventDefault()}},[r,n,p.paused]);return(0,m.jsx)(O.div,{tabIndex:-1,...i,ref:f,onKeyDown:v})});function V(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function H(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function q(e,{select:t=!1}={}){if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}K.displayName="FocusScope";var Y=(n=[],{add(e){let t=n[0];e!==t&&t?.pause(),(n=G(n,e)).unshift(e)},remove(e){n=G(n,e),n[0]?.resume()}});function G(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var X=x.forwardRef((e,t)=>{let{container:r,...n}=e,[a,o]=x.useState(!1);S(()=>o(!0),[]);let i=r||a&&globalThis?.document?.body;return i?D.default.createPortal((0,m.jsx)(O.div,{...n,ref:t}),i):null});X.displayName="Portal";var Z=e=>{var t;let r,n,{present:a,children:o}=e,i=function(e){var t,r;let[n,a]=x.useState(),o=x.useRef(null),i=x.useRef(e),l=x.useRef("none"),[u,s]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},x.useReducer((e,t)=>r[e][t]??e,t));return x.useEffect(()=>{let e=J(o.current);l.current="mounted"===u?e:"none"},[u]),S(()=>{let t=o.current,r=i.current;if(r!==e){let n=l.current,a=J(t);e?s("MOUNT"):"none"===a||t?.display==="none"?s("UNMOUNT"):r&&n!==a?s("ANIMATION_OUT"):s("UNMOUNT"),i.current=e}},[e,s]),S(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let a=J(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(s("ANIMATION_END"),!i.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},a=e=>{e.target===n&&(l.current=J(o.current))};return n.addEventListener("animationstart",a),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}s("ANIMATION_END")},[n,s]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(e=>{o.current=e?getComputedStyle(e):null,a(e)},[])}}(a),l="function"==typeof o?o({present:i.isPresent}):x.Children.only(o),u=k(i.ref,(t=l,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof o||i.isPresent?x.cloneElement(l,{ref:u}):null};function J(e){return e?.animationName||"none"}Z.displayName="Presence";var Q=0;function ee(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var et=function(){return(et=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function er(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}var en=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),ea="width-before-scroll-bar";function eo(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var ei="u">typeof window?x.useLayoutEffect:x.useEffect,el=new WeakMap,eu=(void 0===o&&(o={}),(void 0===i&&(i=function(e){return e}),l=[],u=!1,s={read:function(){if(u)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:null},useMedium:function(e){var t=i(e,u);return l.push(t),function(){l=l.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(u=!0;l.length;){var t=l;l=[],t.forEach(e)}l={push:function(t){return e(t)},filter:function(){return l}}},assignMedium:function(e){u=!0;var t=[];if(l.length){var r=l;l=[],r.forEach(e),t=l}var n=function(){var r=t;t=[],r.forEach(e)},a=function(){return Promise.resolve().then(n)};a(),l={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),l}}}}).options=et({async:!0,ssr:!1},o),s),es=function(){},ec=x.forwardRef(function(e,t){var r,n,a,o,i=x.useRef(null),l=x.useState({onScrollCapture:es,onWheelCapture:es,onTouchMoveCapture:es}),u=l[0],s=l[1],c=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,v=e.shards,h=e.sideCar,g=e.noRelative,b=e.noIsolation,y=e.inert,E=e.allowPinchZoom,w=e.as,C=e.gapMode,k=er(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=(r=[i,t],n=function(e){return r.forEach(function(t){return eo(t,e)})},(a=(0,x.useState)(function(){return{value:null,callback:n,facade:{get current(){return a.value},set current(value){var e=a.value;e!==value&&(a.value=value,a.callback(value,e))}}}})[0]).callback=n,o=a.facade,ei(function(){var e=el.get(o);if(e){var t=new Set(e),n=new Set(r),a=o.current;t.forEach(function(e){n.has(e)||eo(e,null)}),n.forEach(function(e){t.has(e)||eo(e,a)})}el.set(o,r)},[r]),o),N=et(et({},k),u);return x.createElement(x.Fragment,null,m&&x.createElement(h,{sideCar:eu,removeScrollBar:p,shards:v,noRelative:g,noIsolation:b,inert:y,setCallbacks:s,allowPinchZoom:!!E,lockRef:i,gapMode:C}),c?x.cloneElement(x.Children.only(d),et(et({},N),{ref:S})):x.createElement(void 0===w?"div":w,et({},N,{className:f,ref:S}),d))});ec.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ec.classNames={fullWidth:ea,zeroRight:en};var ed=function(e){var t=e.sideCar,r=er(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return x.createElement(n,et({},r))};ed.isSideCarExport=!0;var ef=function(){var e=0,t=null;return{add:function(r){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=p||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var n,a;(n=t).styleSheet?n.styleSheet.cssText=r:n.appendChild(document.createTextNode(r)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ep=function(){var e=ef();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},em=function(){var e=ep();return function(t){return e(t.styles,t.dynamic),null}},ev={left:0,top:0,right:0,gap:0},eh=function(e){return parseInt(e||"",10)||0},eg=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[eh(r),eh(n),eh(a)]},eb=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return ev;var t=eg(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},ey=em(),ex="data-scroll-locked",eE=function(e,t,r,n){var a=e.left,o=e.top,i=e.right,l=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(l,"px ").concat(n,";\n }\n body[").concat(ex,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(en," {\n right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(ea," {\n margin-right: ").concat(l,"px ").concat(n,";\n }\n \n .").concat(en," .").concat(en," {\n right: 0 ").concat(n,";\n }\n \n .").concat(ea," .").concat(ea," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(ex,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},ew=function(){var e=parseInt(document.body.getAttribute(ex)||"0",10);return isFinite(e)?e:0},eC=function(){x.useEffect(function(){return document.body.setAttribute(ex,(ew()+1).toString()),function(){var e=ew()-1;e<=0?document.body.removeAttribute(ex):document.body.setAttribute(ex,e.toString())}},[])},ek=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=void 0===n?"margin":n;eC();var o=x.useMemo(function(){return eb(a)},[a]);return x.createElement(ey,{styles:eE(o,!t,a,r?"":"!important")})},eS=!1;if("u">typeof window)try{var eN=Object.defineProperty({},"passive",{get:function(){return eS=!0,!0}});window.addEventListener("test",eN,eN),window.removeEventListener("test",eN,eN)}catch(e){eS=!1}var ej=!!eS&&{passive:!1},eR=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&(r.overflowY!==r.overflowX||"TEXTAREA"===e.tagName||"visible"!==r[t])},eI=function(e,t){var r=t.ownerDocument,n=t;do{if("u">typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),eD(e,n)){var a=eP(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body)return!1},eD=function(e,t){return"v"===e?eR(t,"overflowY"):eR(t,"overflowX")},eP=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},eM=function(e,t,r,n,a){var o,i=(o=window.getComputedStyle(t).direction,"h"===e&&"rtl"===o?-1:1),l=i*n,u=r.target,s=t.contains(u),c=!1,d=l>0,f=0,p=0;do{if(!u)break;var m=eP(e,u),v=m[0],h=m[1]-m[2]-i*v;(v||h)&&eD(e,u)&&(f+=h,p+=v);var g=u.parentNode;u=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!s&&u!==document.body||s&&(t.contains(u)||t===u))return d&&(a&&1>Math.abs(f)||!a&&l>f)?c=!0:!d&&(a&&1>Math.abs(p)||!a&&-l>p)&&(c=!0),c},eA=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eO=function(e){return[e.deltaX,e.deltaY]},eL=function(e){return e&&"current"in e?e.current:e},eT=0,e_=[];let e$=(c=function(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),a=x.useState(eT++)[0],o=x.useState(em)[0],i=x.useRef(e);x.useEffect(function(){i.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,a=0,o=t.length;a<o;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(eL),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var a,o=eA(e),l=r.current,u="deltaX"in e?e.deltaX:l[0]-o[0],s="deltaY"in e?e.deltaY:l[1]-o[1],c=e.target,d=Math.abs(u)>Math.abs(s)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var m=eI(d,c);if(!m)return!0;if(m?a=d:(a="v"===d?"h":"v",m=eI(d,c)),!m)return!1;if(!n.current&&"changedTouches"in e&&(u||s)&&(n.current=a),!a)return!0;var v=n.current||a;return eM(v,t,e,"h"===v?u:s,!0)},[]),u=x.useCallback(function(e){if(e_.length&&e_[e_.length-1]===o){var r="deltaY"in e?eO(e):eA(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta,n[0]===r[0]&&n[1]===r[1])})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var a=(i.current.shards||[]).map(eL).filter(Boolean).filter(function(t){return t.contains(e.target)});(a.length>0?l(e,a[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),s=x.useCallback(function(e,r,n,a){var o={name:e,delta:r,target:n,should:a,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(o),setTimeout(function(){t.current=t.current.filter(function(e){return e!==o})},1)},[]),c=x.useCallback(function(e){r.current=eA(e),n.current=void 0},[]),d=x.useCallback(function(t){s(t.type,eO(t),t.target,l(t,e.lockRef.current))},[]),f=x.useCallback(function(t){s(t.type,eA(t),t.target,l(t,e.lockRef.current))},[]);x.useEffect(function(){return e_.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",u,ej),document.addEventListener("touchmove",u,ej),document.addEventListener("touchstart",c,ej),function(){e_=e_.filter(function(e){return e!==o}),document.removeEventListener("wheel",u,ej),document.removeEventListener("touchmove",u,ej),document.removeEventListener("touchstart",c,ej)}},[]);var p=e.removeScrollBar,m=e.inert;return x.createElement(x.Fragment,null,m?x.createElement(o,{styles:"\n .block-interactivity-".concat(a," {pointer-events: none;}\n .allow-interactivity-").concat(a," {pointer-events: all;}\n")}):null,p?x.createElement(ek,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},eu.useMedium(c),ed);var eF=x.forwardRef(function(e,t){return x.createElement(ec,et({},e,{ref:t,sideCar:e$}))});eF.classNames=ec.classNames;var eW=new WeakMap,eB=new WeakMap,eU={},ez=0,eK=function(e){return e&&(e.host||eK(e.parentNode))},eV=function(e,t,r,n){var a=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=eK(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});eU[r]||(eU[r]=new WeakMap);var o=eU[r],i=[],l=new Set,u=new Set(a),s=function(e){!e||l.has(e)||(l.add(e),s(e.parentNode))};a.forEach(s);var c=function(e){!e||u.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))c(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,u=(eW.get(e)||0)+1,s=(o.get(e)||0)+1;eW.set(e,u),o.set(e,s),i.push(e),1===u&&a&&eB.set(e,!0),1===s&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),l.clear(),ez++,function(){i.forEach(function(e){var t=eW.get(e)-1,a=o.get(e)-1;eW.set(e,t),o.set(e,a),t||(eB.has(e)||e.removeAttribute(n),eB.delete(e)),a||e.removeAttribute(r)}),--ez||(eW=new WeakMap,eW=new WeakMap,eB=new WeakMap,eU={})}},eH=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),eV(n,a,r,"aria-hidden")):function(){return null}},eq="Dialog",[eY,eG]=function(e,t=[]){let r=[],n=()=>{let t=r.map(e=>x.createContext(e));return function(r){let n=r?.[e]||t;return x.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let a=x.createContext(n),o=r.length;r=[...r,n];let i=t=>{let{scope:r,children:n,...i}=t,l=r?.[e]?.[o]||a,u=x.useMemo(()=>i,Object.values(i));return(0,m.jsx)(l.Provider,{value:u,children:n})};return i.displayName=t+"Provider",[i,function(r,i){let l=i?.[e]?.[o]||a,u=x.useContext(l);if(u)return u;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(n,...t)]}(eq),[eX,eZ]=eY(eq),eJ=e=>{let{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:i=!0}=e,l=x.useRef(null),u=x.useRef(null),[s,c]=function({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[a,o,i]=function({defaultProp:e,onChange:t}){let[r,n]=x.useState(e),a=x.useRef(r),o=x.useRef(t);return I(()=>{o.current=t},[t]),x.useEffect(()=>{a.current!==r&&(o.current?.(r),a.current=r)},[r,a]),[r,n,o]}({defaultProp:t,onChange:r}),l=void 0!==e,u=l?e:a;{let t=x.useRef(void 0!==e);x.useEffect(()=>{let e=t.current;if(e!==l){let t=l?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,n])}return[u,x.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&i.current?.(r)}else o(t)},[l,e,o,i])]}({prop:n,defaultProp:a??!1,onChange:o,caller:eq});return(0,m.jsx)(eX,{scope:t,triggerRef:l,contentRef:u,contentId:R(),titleId:R(),descriptionId:R(),open:s,onOpenChange:c,onOpenToggle:x.useCallback(()=>c(e=>!e),[c]),modal:i,children:r})};eJ.displayName=eq;var eQ="DialogTrigger";x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(eQ,r),o=k(t,a.triggerRef);return(0,m.jsx)(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":ti(a.open),...n,ref:o,onClick:E(e.onClick,a.onOpenToggle)})}).displayName=eQ;var e0="DialogPortal",[e1,e5]=eY(e0,{forceMount:void 0}),e2=e=>{let{__scopeDialog:t,forceMount:r,children:n,container:a}=e,o=eZ(e0,t);return(0,m.jsx)(e1,{scope:t,forceMount:r,children:x.Children.map(n,e=>(0,m.jsx)(Z,{present:r||o.open,children:(0,m.jsx)(X,{asChild:!0,container:a,children:e})}))})};e2.displayName=e0;var e3="DialogOverlay",e7=x.forwardRef((e,t)=>{let r=e5(e3,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=eZ(e3,e.__scopeDialog);return o.modal?(0,m.jsx)(Z,{present:n||o.open,children:(0,m.jsx)(e4,{...a,ref:t})}):null});e7.displayName=e3;var e9=P("DialogOverlay.RemoveScroll"),e4=x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(e3,r);return(0,m.jsx)(eF,{as:e9,allowPinchZoom:!0,shards:[a.contentRef],children:(0,m.jsx)(O.div,{"data-state":ti(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),e6="DialogContent",e8=x.forwardRef((e,t)=>{let r=e5(e6,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=eZ(e6,e.__scopeDialog);return(0,m.jsx)(Z,{present:n||o.open,children:o.modal?(0,m.jsx)(te,{...a,ref:t}):(0,m.jsx)(tt,{...a,ref:t})})});e8.displayName=e6;var te=x.forwardRef((e,t)=>{let r=eZ(e6,e.__scopeDialog),n=x.useRef(null),a=k(t,r.contentRef,n);return x.useEffect(()=>{let e=n.current;if(e)return eH(e)},[]),(0,m.jsx)(tr,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:E(e.onFocusOutside,e=>e.preventDefault())})}),tt=x.forwardRef((e,t)=>{let r=eZ(e6,e.__scopeDialog),n=x.useRef(!1),a=x.useRef(!1);return(0,m.jsx)(tr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(n.current||r.triggerRef.current?.focus(),t.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(n.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let o=t.target;r.triggerRef.current?.contains(o)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),tr=x.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...i}=e,l=eZ(e6,r),u=x.useRef(null),s=k(t,u);return x.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ee()),document.body.insertAdjacentElement("beforeend",e[1]??ee()),Q++,()=>{1===Q&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Q--}},[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(K,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,m.jsx)($,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":ti(l.open),...i,ref:s,onDismiss:()=>l.onOpenChange(!1)})}),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(tc,{titleId:l.titleId}),(0,m.jsx)(td,{contentRef:u,descriptionId:l.descriptionId})]})]})}),tn="DialogTitle";x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(tn,r);return(0,m.jsx)(O.h2,{id:a.titleId,...n,ref:t})}).displayName=tn;var ta="DialogDescription";x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(ta,r);return(0,m.jsx)(O.p,{id:a.descriptionId,...n,ref:t})}).displayName=ta;var to="DialogClose";function ti(e){return e?"open":"closed"}x.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,a=eZ(to,r);return(0,m.jsx)(O.button,{type:"button",...n,ref:t,onClick:E(e.onClick,()=>a.onOpenChange(!1))})}).displayName=to;var tl="DialogTitleWarning",[tu,ts]=(d={contentName:e6,titleName:tn,docsSlug:"dialog"},t=x.createContext(d),(r=e=>{let{children:r,...n}=e,a=x.useMemo(()=>n,Object.values(n));return(0,m.jsx)(t.Provider,{value:a,children:r})}).displayName=tl+"Provider",[r,function(e){let r=x.useContext(t);if(r)return r;if(void 0!==d)return d;throw Error(`\`${e}\` must be used within \`${tl}\``)}]),tc=({titleId:e})=>{let t=ts(tl),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
-
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},td=({contentRef:e,descriptionId:t})=>{let r=ts("DialogDescriptionWarning"),n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${r.contentName}}.`;return x.useEffect(()=>{let r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},tf=Symbol.for("react.lazy"),tp=x[" use ".trim().toString()];function tm(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===tf&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var tv=Symbol("radix.slottable");function th(e){return x.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tv}var tg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{var r,n;let a,o,i,l=(n=r=`Primitive.${t}`,(a=x.forwardRef((e,t)=>{let{children:r,...n}=e;if(tm(r)&&"function"==typeof tp&&(r=tp(r._payload)),x.isValidElement(r)){var a;let e,o,i=(a=r,(o=(e=Object.getOwnPropertyDescriptor(a.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.ref:(o=(e=Object.getOwnPropertyDescriptor(a,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?a.props.ref:a.props.ref||a.ref),l=function(e,t){let r={...t};for(let n in t){let a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==x.Fragment&&(l.ref=t?C(t,i):i),x.cloneElement(r,l)}return x.Children.count(r)>1?x.Children.only(null):null})).displayName=`${n}.SlotClone`,o=a,(i=x.forwardRef((e,t)=>{let{children:r,...n}=e;tm(r)&&"function"==typeof tp&&(r=tp(r._payload));let a=x.Children.toArray(r),i=a.find(th);if(i){let e=i.props.children,r=a.map(t=>t!==i?t:x.Children.count(e)>1?x.Children.only(null):x.isValidElement(e)?e.props.children:null);return(0,m.jsx)(o,{...n,ref:t,children:x.isValidElement(e)?x.cloneElement(e,void 0,r):null})}return(0,m.jsx)(o,{...n,ref:t,children:r})})).displayName=`${r}.Slot`,i),u=x.forwardRef((e,r)=>{let{asChild:n,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,m.jsx)(n?l:t,{...a,ref:r})});return u.displayName=`Primitive.${t}`,{...e,[t]:u}},{}),tb='[cmdk-group=""]',ty='[cmdk-group-items=""]',tx='[cmdk-item=""]',tE=`${tx}:not([aria-disabled="true"])`,tw="cmdk-item-select",tC="data-value",tk=(e,t,r)=>{var n;return n=e,function e(t,r,n,a,o,i,l){if(i===r.length)return o===t.length?1:.99;var u=`${o},${i}`;if(void 0!==l[u])return l[u];for(var s,c,d,f,p=a.charAt(i),m=n.indexOf(p,o),y=0;m>=0;)(s=e(t,r,n,a,m+1,i+1,l))>y&&(m===o?s*=1:v.test(t.charAt(m-1))?(s*=.8,(d=t.slice(o,m-1).match(h))&&o>0&&(s*=Math.pow(.999,d.length))):g.test(t.charAt(m-1))?(s*=.9,(f=t.slice(o,m-1).match(b))&&o>0&&(s*=Math.pow(.999,f.length))):(s*=.17,o>0&&(s*=Math.pow(.999,m-o))),t.charAt(m)!==r.charAt(i)&&(s*=.9999)),(s<.1&&n.charAt(m-1)===a.charAt(i+1)||a.charAt(i+1)===a.charAt(i)&&n.charAt(m-1)!==a.charAt(i))&&.1*(c=e(t,r,n,a,m+1,i+2,l))>s&&(s=.1*c),s>y&&(y=s),m=n.indexOf(p,m+1);return l[u]=y,y}(n=r&&r.length>0?`${n+" "+r.join(" ")}`:n,t,y(n),y(t),0,0,{})},tS=x.createContext(void 0),tN=x.createContext(void 0),tj=x.createContext(void 0),tR=x.forwardRef((e,t)=>{let r=t$(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=t$(()=>new Set),a=t$(()=>new Map),o=t$(()=>new Map),i=t$(()=>new Set),l=tT(e),{label:u,children:s,value:c,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:v=!1,vimBindings:h=!0,...g}=e,b=R(),y=R(),E=R(),w=x.useRef(null),C=tB();t_(()=>{if(void 0!==c){let e=c.trim();r.current.value=e,k.emit()}},[c]),t_(()=>{C(6,P)},[]);let k=x.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,o,i,u;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)D(),j(),C(1,I);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(E);e?e.focus():null==(a=document.getElementById(b))||a.focus()}if(C(7,()=>{var e;r.current.selectedItemId=null==(e=M())?void 0:e.id,k.emit()}),n||C(5,P),(null==(o=l.current)?void 0:o.value)!==void 0){null==(u=(i=l.current).onValueChange)||u.call(i,null!=t?t:"");return}}k.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),S=x.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=o.current.get(e))?void 0:a.value)&&(o.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,N(t,n)),C(2,()=>{j(),k.emit()}))},item:(e,t)=>(n.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),C(3,()=>{D(),j(),r.current.value||I(),k.emit()}),()=>{o.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=M();C(4,()=>{D(),(null==t?void 0:t.getAttribute("id"))===e&&I(),k.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{o.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:E,labelId:y,listInnerRef:w}),[]);function N(e,t){var n,a;let o=null!=(a=null==(n=l.current)?void 0:n.filter)?a:tk;return e?o(e,r.current.search,t):0}function j(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=a.current.get(r),o=0;n.forEach(t=>{o=Math.max(e.get(t),o)}),t.push([r,o])});let n=w.current;A().sort((t,r)=>{var n,a;let o=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(o))?a:0)}).forEach(e=>{let t=e.closest(ty);t?t.appendChild(e.parentElement===t?e:e.closest(`${ty} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ty} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=w.current)?void 0:t.querySelector(`${tb}[${tC}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function I(){let e=A().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(tC);k.setState("value",t||void 0)}function D(){var e,t,i,u;if(!r.current.search||!1===l.current.shouldFilter){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let s=0;for(let a of n.current){let n=N(null!=(t=null==(e=o.current.get(a))?void 0:e.value)?t:"",null!=(u=null==(i=o.current.get(a))?void 0:i.keywords)?u:[]);r.current.filtered.items.set(a,n),n>0&&s++}for(let[e,t]of a.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=s}function P(){var e,t,r;let n=M();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(tb))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function M(){var e;return null==(e=w.current)?void 0:e.querySelector(`${tx}[aria-selected="true"]`)}function A(){var e;return Array.from((null==(e=w.current)?void 0:e.querySelectorAll(tE))||[])}function O(e){let t=A()[e];t&&k.setState("value",t.getAttribute(tC))}function L(e){var t;let r=M(),n=A(),a=n.findIndex(e=>e===r),o=n[a+e];null!=(t=l.current)&&t.loop&&(o=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),o&&k.setState("value",o.getAttribute(tC))}function T(e){let t=M(),r=null==t?void 0:t.closest(tb),n;for(;r&&!n;)n=null==(r=e>0?function(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}(r,tb):function(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}(r,tb))?void 0:r.querySelector(tE);n?k.setState("value",n.getAttribute(tC)):L(e)}let _=()=>O(A().length-1),$=e=>{e.preventDefault(),e.metaKey?_():e.altKey?T(1):L(1)},F=e=>{e.preventDefault(),e.metaKey?O(0):e.altKey?T(-1):L(-1)};return x.createElement(tg.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=g.onKeyDown)||t.call(g,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||r))switch(e.key){case"n":case"j":h&&e.ctrlKey&&$(e);break;case"ArrowDown":$(e);break;case"p":case"k":h&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),O(0);break;case"End":e.preventDefault(),_();break;case"Enter":{e.preventDefault();let t=M();if(t){let e=new Event(tw);t.dispatchEvent(e)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:S.inputId,id:S.labelId,style:tz},u),tU(e,e=>x.createElement(tN.Provider,{value:k},x.createElement(tS.Provider,{value:S},e))))}),tI=x.forwardRef((e,t)=>{var r,n;let a=R(),o=x.useRef(null),i=x.useContext(tj),l=x.useContext(tS),u=tT(e),s=null!=(n=null==(r=u.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;t_(()=>{if(!s)return l.item(a,null==i?void 0:i.id)},[s]);let c=tW(a,o,[e.value,e.children,o],e.keywords),d=x.useContext(tN),f=tF(e=>e.value&&e.value===c.current),p=tF(e=>!!s||!1===l.filter()||!e.search||e.filtered.items.get(a)>0);function m(){var e,t;v(),null==(t=(e=u.current).onSelect)||t.call(e,c.current)}function v(){d.setState("value",c.current,!0)}if(x.useEffect(()=>{let t=o.current;if(!(!t||e.disabled))return t.addEventListener(tw,m),()=>t.removeEventListener(tw,m)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:h,value:g,onSelect:b,forceMount:y,keywords:E,...w}=e;return x.createElement(tg.div,{ref:C(o,t),...w,id:a,"cmdk-item":"",role:"option","aria-disabled":!!h,"aria-selected":!!f,"data-disabled":!!h,"data-selected":!!f,onPointerMove:h||l.getDisablePointerSelection()?void 0:v,onClick:h?void 0:m},e.children)}),tD=x.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...o}=e,i=R(),l=x.useRef(null),u=x.useRef(null),s=R(),c=x.useContext(tS),d=tF(e=>!!a||!1===c.filter()||!e.search||e.filtered.groups.has(i));t_(()=>c.group(i),[]),tW(i,l,[e.value,e.heading,u]);let f=x.useMemo(()=>({id:i,forceMount:a}),[a]);return x.createElement(tg.div,{ref:C(l,t),...o,"cmdk-group":"",role:"presentation",hidden:!d||void 0},r&&x.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:s},r),tU(e,e=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?s:void 0},x.createElement(tj.Provider,{value:f},e))))}),tP=x.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=x.useRef(null),o=tF(e=>!e.search);return r||o?x.createElement(tg.div,{ref:C(a,t),...n,"cmdk-separator":"",role:"separator"}):null}),tM=x.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=null!=e.value,o=x.useContext(tN),i=tF(e=>e.search),l=tF(e=>e.selectedItemId),u=x.useContext(tS);return x.useEffect(()=>{null!=e.value&&o.setState("search",e.value)},[e.value]),x.createElement(tg.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":l,id:u.inputId,type:"text",value:a?e.value:i,onChange:e=>{a||o.setState("search",e.target.value),null==r||r(e.target.value)}})}),tA=x.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,o=x.useRef(null),i=x.useRef(null),l=tF(e=>e.selectedItemId),u=x.useContext(tS);return x.useEffect(()=>{if(i.current&&o.current){let e=i.current,t=o.current,r,n=new ResizeObserver(()=>{r=requestAnimationFrame(()=>{let r=e.offsetHeight;t.style.setProperty("--cmdk-list-height",r.toFixed(1)+"px")})});return n.observe(e),()=>{cancelAnimationFrame(r),n.unobserve(e)}}},[]),x.createElement(tg.div,{ref:C(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:u.listId},tU(e,e=>x.createElement("div",{ref:C(i,u.listInnerRef),"cmdk-list-sizer":""},e)))}),tO=x.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:o,container:i,...l}=e;return x.createElement(eJ,{open:r,onOpenChange:n},x.createElement(e2,{container:i},x.createElement(e7,{"cmdk-overlay":"",className:a}),x.createElement(e8,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(tR,{ref:t,...l}))))}),tL=Object.assign(tR,{List:tA,Item:tI,Input:tM,Group:tD,Separator:tP,Dialog:tO,Empty:x.forwardRef((e,t)=>tF(e=>0===e.filtered.count)?x.createElement(tg.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:x.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...o}=e;return x.createElement(tg.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},tU(e,e=>x.createElement("div",{"aria-hidden":!0},e)))})});function tT(e){let t=x.useRef(e);return t_(()=>{t.current=e}),t}var t_="u"<typeof window?x.useEffect:x.useLayoutEffect;function t$(e){let t=x.useRef();return void 0===t.current&&(t.current=e()),t}function tF(e){let t=x.useContext(tN),r=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,r,r)}function tW(e,t,r,n=[]){let a=x.useRef(),o=x.useContext(tS);return t_(()=>{var i;let l=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),u=n.map(e=>e.trim());o.value(e,l,u),null==(i=t.current)||i.setAttribute(tC,l),a.current=l}),a}var tB=()=>{let[e,t]=x.useState(),r=t$(()=>new Map);return t_(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function tU({asChild:e,children:t},r){let n;return e&&x.isValidElement(t)?x.cloneElement("function"==typeof(n=t.type)?n(t.props):"render"in n?n.render(t.props):t,{ref:t.ref},r(t.props.children)):r(t)}var tz={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},tK=e.i(975157);e.i(776639);var tV=e.i(294237);function tH({className:e,...t}){return(0,m.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,tK.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}e.i(519455),e.i(793479),e.i(624687);let tq=(0,tV.cva)("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function tY({className:e,align:t="inline-start",...r}){return(0,m.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,tK.cn)(tq({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...r})}(0,tV.cva)("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});var tG=e.i(298751),tG=tG,tX=e.i(533133);e.s(["Command",0,function({className:e,...t}){return(0,m.jsx)(tL,{"data-slot":"command",className:(0,tK.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...t})},"CommandEmpty",0,function({className:e,...t}){return(0,m.jsx)(tL.Empty,{"data-slot":"command-empty",className:(0,tK.cn)("py-6 text-center text-sm",e),...t})},"CommandGroup",0,function({className:e,...t}){return(0,m.jsx)(tL.Group,{"data-slot":"command-group",className:(0,tK.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})},"CommandInput",0,function({className:e,...t}){return(0,m.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,m.jsxs)(tH,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,m.jsx)(tL.Input,{"data-slot":"command-input",className:(0,tK.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,m.jsx)(tY,{children:(0,m.jsx)(tG.default,{className:"size-4 shrink-0 opacity-50"})})]})})},"CommandItem",0,function({className:e,children:t,...r}){return(0,m.jsxs)(tL.Item,{"data-slot":"command-item",className:(0,tK.cn)("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...r,children:[t,(0,m.jsx)(tX.CheckIcon,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})},"CommandList",0,function({className:e,...t}){return(0,m.jsx)(tL.List,{"data-slot":"command-list",className:(0,tK.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}],317056);var tZ=e.i(514798);let tJ=(0,tZ.createServerReference)("4091d907e61355de143e8fcd34f6fda1415e03ead8",tZ.callServer,void 0,tZ.findSourceMapURL,"getProjectBranches");e.s(["getProjectBranches",0,tJ],183286);let tQ=(0,tZ.createServerReference)("40a473b9abdb5cc52d10ca153c5709cd5cdbe1bfb7",tZ.callServer,void 0,tZ.findSourceMapURL,"fetchRemoteBranches");e.s(["fetchRemoteBranches",0,tQ],157368)},744798,e=>{"use strict";var t=e.i(289721),r=e.i(965652),n=e.i(776639),a=e.i(519455),o=e.i(793479),i=e.i(624687),l=e.i(110204),u=e.i(226145),s=e.i(597746),c=e.i(456346),d=e.i(280027),f=e.i(337822),p=e.i(317056),m=e.i(533499),v=e.i(183286),h=e.i(157368),g=e.i(514798);let b=(0,g.createServerReference)("40248ec220a317e0eb87f596e43c37f8d5cafdc987",g.callServer,void 0,g.findSourceMapURL,"getCurrentBranch");var y=e.i(415575);e.s(["CreateTaskDialog",0,function({open:e,onOpenChange:g,onSubmit:x,onUpdate:E,defaultStatus:w="TODO",editTask:C,editTaskLabelIds:k,prefillFromTask:S,labels:N,projectType:j,projectLocalPath:R,versions:I,defaultVersionId:D}){let P,[M,A]=(0,r.useState)(""),[O,L]=(0,r.useState)(""),[T,_]=(0,r.useState)("MEDIUM"),[$,F]=(0,r.useState)(""),[W,B]=(0,r.useState)([]),[U,z]=(0,r.useState)([]),[K,V]=(0,r.useState)(!1),[H,q]=(0,r.useState)(""),[Y,G]=(0,r.useState)(!1),[X,Z]=(0,r.useState)(!0),[J,Q]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(null),{t:er}=(0,m.useI18n)();(0,r.useEffect)(()=>{if(!e||C)return;let t=!1;return(0,y.getConfigValues)(["task.defaultUseWorktree","task.defaultAutoStart"]).then(e=>{if(t)return;let r=e["task.defaultUseWorktree"],n=e["task.defaultAutoStart"];"boolean"==typeof r&&Z(r),"boolean"==typeof n&&Q(n)}).catch(()=>{}),()=>{t=!0}},[e,C]);let en=!!C,ea=!!R;return(0,r.useEffect)(()=>{C?(A(C.title),L(C.description??""),_(C.priority),F(C.subPath??""),B(k??[]),et(C.versionId??null)):(S?(A(S.title??""),L(S.description??""),_(S.priority??"MEDIUM"),F(S.subPath??""),B(S.labelIds??[])):(A(""),L(""),_("MEDIUM"),F(""),B([])),et(D??null))},[C,k,S,D]),(0,r.useEffect)(()=>{e||C||(A(""),L(""),_("MEDIUM"),F(""),B([]),z([]),q(""),G(!1),et(D??null))},[e,C,D]),(0,r.useEffect)(()=>{e&&ea&&!C&&(V(!0),Promise.all([(0,v.getProjectBranches)(R),b(R)]).then(([e,t])=>{z(e);let r=S?.baseBranch??null;r&&e.includes(r)?q(r):q(t&&e.includes(t)?t:e[0]??""),V(!1),(0,h.fetchRemoteBranches)(R).then(()=>{setTimeout(()=>{(0,v.getProjectBranches)(R).then(e=>{z(e),q(t=>e.includes(t)?t:e[0]??"")}).catch(()=>{})},3e3)})}).catch(()=>{z([]),q(""),V(!1)}))},[e,ea,R,C,S]),(0,t.jsx)(n.Dialog,{open:e,onOpenChange:g,disablePointerDismissal:!0,children:(0,t.jsxs)(n.DialogContent,{className:"sm:max-w-md",children:[(0,t.jsx)(n.DialogHeader,{children:(0,t.jsx)(n.DialogTitle,{children:en?er("task.edit"):er("task.create")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"title",children:er("task.title")}),(0,t.jsx)(o.Input,{id:"title","data-testid":"task-title",placeholder:er("task.titlePlaceholder"),value:M,onChange:e=>A(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault()})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"description",children:er("task.description")}),(0,t.jsx)(i.Textarea,{id:"description",placeholder:er("task.descPlaceholder"),rows:4,value:O,onChange:e=>L(e.target.value),className:"max-h-[200px] overflow-y-auto"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{htmlFor:"subPath",children:er("task.subPath")}),(0,t.jsx)(o.Input,{id:"subPath",placeholder:er("task.subPathPlaceholder"),value:$,onChange:e=>F(e.target.value)}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:er("task.subPathHint")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{children:er("task.priority")}),(0,t.jsx)("div",{className:"flex gap-1.5",children:["LOW","MEDIUM","HIGH","CRITICAL"].map(e=>{let r={LOW:{label:er("task.priorityLow"),style:"text-slate-300 border-slate-500/30 bg-slate-500/10"},MEDIUM:{label:er("task.priorityMedium"),style:"text-amber-300 border-amber-500/30 bg-amber-500/10"},HIGH:{label:er("task.priorityHigh"),style:"text-orange-300 border-orange-500/30 bg-orange-500/10"},CRITICAL:{label:er("task.priorityCritical"),style:"text-rose-300 border-rose-500/30 bg-rose-500/10"}}[e];return(0,t.jsx)("button",{type:"button",onClick:()=>_(e),className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition-all ${T===e?`${r.style} ring-1 ring-current/20`:"border-border text-muted-foreground hover:bg-accent"}`,children:r.label},e)})})]}),ea&&!en&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{children:er("task.baseBranch")}),K?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:er("task.branchLoading")}):U.length>0?(0,t.jsxs)(f.Popover,{open:Y,onOpenChange:G,children:[(0,t.jsxs)(f.PopoverTrigger,{className:"flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm font-mono transition-colors hover:bg-accent focus:outline-none focus:ring-1 focus:ring-ring","data-testid":"branch-selector",children:[(0,t.jsx)(u.GitBranch,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"flex-1 truncate text-left text-xs",title:H||void 0,children:H||er("task.branchNone")}),(0,t.jsx)(c.ChevronsUpDown,{className:"h-3.5 w-3.5 shrink-0 opacity-50"})]}),(0,t.jsx)(f.PopoverContent,{className:"w-[min(32rem,90vw)] p-0",align:"start",children:(0,t.jsxs)(p.Command,{children:[(0,t.jsx)(p.CommandInput,{placeholder:er("task.branchSearch")}),(0,t.jsxs)(p.CommandList,{children:[(0,t.jsx)(p.CommandEmpty,{children:er("task.branchNone")}),(0,t.jsx)(p.CommandGroup,{children:U.map(e=>(0,t.jsxs)(p.CommandItem,{value:e,onSelect:()=>{q(e),G(!1)},children:[(0,t.jsx)(u.GitBranch,{className:"h-3 w-3 text-muted-foreground shrink-0 mr-2"}),(0,t.jsx)("span",{className:"flex-1 truncate font-mono",title:e,children:e}),e===H&&(0,t.jsx)(s.Check,{className:"h-3 w-3 text-primary shrink-0 ml-auto"})]},e))})]})]})})]}):(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:er("task.branchNone")}),(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,t.jsx)(l.Label,{className:"text-xs text-muted-foreground",children:er("task.worktreeLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>Z(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${X===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?er("task.worktreeYes"):er("task.worktreeNo")},String(e)))})]}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsx)(l.Label,{className:"text-xs text-muted-foreground",children:er("task.autoStartLabel")}),(0,t.jsx)("div",{className:"flex gap-1",children:[!0,!1].map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>Q(e),className:`rounded-md px-3 py-1 text-xs font-medium transition-colors ${J===e?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:text-foreground"}`,children:e?er("task.autoStartYes"):er("task.autoStartNo")},String(e)))})]})]}),N.length>0&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{children:er("task.labels")}),(0,t.jsx)("div",{className:"flex flex-wrap gap-1.5",children:N.map(e=>{let r=W.includes(e.id);return(0,t.jsx)("button",{type:"button",onClick:()=>{B(t=>r?t.filter(t=>t!==e.id):[...t,e.id])},className:`rounded-full px-2.5 py-1 text-xs font-medium transition-all ${r?"ring-1 ring-current/30":"opacity-50 hover:opacity-80"}`,style:{backgroundColor:e.color+"20",color:e.color,borderColor:r?e.color+"40":"transparent",borderWidth:"1px"},children:e.name},e.id)})})]}),(!en||I&&I.length>0)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(l.Label,{children:er("version.picker.label")}),I&&I.length>0?(0,t.jsxs)(d.Select,{value:ee??"__none__",onValueChange:e=>et("__none__"===e?null:e),children:[(0,t.jsx)(d.SelectTrigger,{children:(0,t.jsx)("span",{className:"truncate text-sm",children:ee&&(P=I.find(e=>e.id===ee))?P.isCurrent?`${P.number} \xb7 ${P.name} \xb7 ${er("version.currentShort")}`:`${P.number} \xb7 ${P.name}`:er("version.picker.none")})}),(0,t.jsxs)(d.SelectContent,{children:[(0,t.jsx)(d.SelectItem,{value:"__none__",children:er("version.picker.none")}),I.map(e=>(0,t.jsx)(d.SelectItem,{value:e.id,children:e.isCurrent?`${e.number} \xb7 ${e.name} \xb7 ${er("version.currentShort")}`:`${e.number} \xb7 ${e.name}`},e.id))]})]}):(0,t.jsx)("p",{className:"rounded-md border border-dashed border-border px-3 py-2 text-xs text-muted-foreground",children:er("version.picker.empty")})]})]}),(0,t.jsxs)(n.DialogFooter,{children:[(0,t.jsx)(a.Button,{variant:"outline",onClick:()=>g(!1),children:er("common.cancel")}),(0,t.jsx)(a.Button,{onClick:()=>{M.trim()&&(en&&E?E(C.id,{title:M,description:O,priority:T,labelIds:W,subPath:$.trim()||"",versionId:ee}):x({title:M,description:O,priority:T,status:w,labelIds:W,...ea&&X&&H?{baseBranch:H}:{},...$.trim()?{subPath:$.trim()}:{},versionId:ee,autoStart:J}),A(""),L(""),_("MEDIUM"),F(""),B([]),z([]),q(""),Z(!0),et(null),g(!1))},className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:en?er("common.save"):er("common.create")})]})]})})}],744798)}]);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,465536,(e,t,r)=>{var s;"u">typeof __nccwpck_require__&&(__nccwpck_require__.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/os-browserify/"),(s={}).endianness=function(){return"LE"},s.hostname=function(){return"u">typeof location?location.hostname:""},s.loadavg=function(){return[]},s.uptime=function(){return 0},s.freemem=function(){return Number.MAX_VALUE},s.totalmem=function(){return Number.MAX_VALUE},s.cpus=function(){return[]},s.type=function(){return"Browser"},s.release=function(){return"u">typeof navigator?navigator.appVersion:""},s.networkInterfaces=s.getNetworkInterfaces=function(){return{}},s.arch=function(){return"javascript"},s.platform=function(){return"browser"},s.tmpdir=s.tmpDir=function(){return"/tmp"},s.EOL="\n",s.homedir=function(){return"/"},t.exports=s},930787,(e,t,r)=>{!function(){"use strict";var e={114:function(e){function t(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,s="",a=0,n=-1,o=0,i=0;i<=e.length;++i){if(i<e.length)r=e.charCodeAt(i);else if(47===r)break;else r=47;if(47===r){if(n===i-1||1===o);else if(n!==i-1&&2===o){if(s.length<2||2!==a||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2)){if(s.length>2){var l=s.lastIndexOf("/");if(l!==s.length-1){-1===l?(s="",a=0):a=(s=s.slice(0,l)).length-1-s.lastIndexOf("/"),n=i,o=0;continue}}else if(2===s.length||1===s.length){s="",a=0,n=i,o=0;continue}}t&&(s.length>0?s+="/..":s="..",a=2)}else s.length>0?s+="/"+e.slice(n+1,i):s=e.slice(n+1,i),a=i-n-1;n=i,o=0}else 46===r&&-1!==o?++o:o=-1}return s}var s={resolve:function(){for(var e,s,a="",n=!1,o=arguments.length-1;o>=-1&&!n;o--)o>=0?s=arguments[o]:(void 0===e&&(e=""),s=e),t(s),0!==s.length&&(a=s+"/"+a,n=47===s.charCodeAt(0));if(a=r(a,!n),n)if(a.length>0)return"/"+a;else return"/";return a.length>0?a:"."},normalize:function(e){if(t(e),0===e.length)return".";var s=47===e.charCodeAt(0),a=47===e.charCodeAt(e.length-1);return(0!==(e=r(e,!s)).length||s||(e="."),e.length>0&&a&&(e+="/"),s)?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0==arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var a=arguments[r];t(a),a.length>0&&(void 0===e?e=a:e+="/"+a)}return void 0===e?".":s.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=s.resolve(e))===(r=s.resolve(r)))return"";for(var a=1;a<e.length&&47===e.charCodeAt(a);++a);for(var n=e.length,o=n-a,i=1;i<r.length&&47===r.charCodeAt(i);++i);for(var l=r.length-i,c=o<l?o:l,d=-1,u=0;u<=c;++u){if(u===c){if(l>c){if(47===r.charCodeAt(i+u))return r.slice(i+u+1);else if(0===u)return r.slice(i+u)}else o>c&&(47===e.charCodeAt(a+u)?d=u:0===u&&(d=0));break}var m=e.charCodeAt(a+u);if(m!==r.charCodeAt(i+u))break;47===m&&(d=u)}var x="";for(u=a+d+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===x.length?x+="..":x+="/..");return x.length>0?x+r.slice(i+d):(i+=d,47===r.charCodeAt(i)&&++i,r.slice(i))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),s=47===r,a=-1,n=!0,o=e.length-1;o>=1;--o)if(47===(r=e.charCodeAt(o))){if(!n){a=o;break}}else n=!1;return -1===a?s?"/":".":s&&1===a?"//":e.slice(0,a)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw TypeError('"ext" argument must be a string');t(e);var s,a=0,n=-1,o=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var i=r.length-1,l=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(47===c){if(!o){a=s+1;break}}else -1===l&&(o=!1,l=s+1),i>=0&&(c===r.charCodeAt(i)?-1==--i&&(n=s):(i=-1,n=l))}return a===n?n=l:-1===n&&(n=e.length),e.slice(a,n)}for(s=e.length-1;s>=0;--s)if(47===e.charCodeAt(s)){if(!o){a=s+1;break}}else -1===n&&(o=!1,n=s+1);return -1===n?"":e.slice(a,n)},extname:function(e){t(e);for(var r=-1,s=0,a=-1,n=!0,o=0,i=e.length-1;i>=0;--i){var l=e.charCodeAt(i);if(47===l){if(!n){s=i+1;break}continue}-1===a&&(n=!1,a=i+1),46===l?-1===r?r=i:1!==o&&(o=1):-1!==r&&(o=-1)}return -1===r||-1===a||0===o||1===o&&r===a-1&&r===s+1?"":e.slice(r,a)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){t(e);var r,s={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return s;var a=e.charCodeAt(0),n=47===a;n?(s.root="/",r=1):r=0;for(var o=-1,i=0,l=-1,c=!0,d=e.length-1,u=0;d>=r;--d){if(47===(a=e.charCodeAt(d))){if(!c){i=d+1;break}continue}-1===l&&(c=!1,l=d+1),46===a?-1===o?o=d:1!==u&&(u=1):-1!==o&&(u=-1)}return -1===o||-1===l||0===u||1===u&&o===l-1&&o===i+1?-1!==l&&(0===i&&n?s.base=s.name=e.slice(1,l):s.base=s.name=e.slice(i,l)):(0===i&&n?(s.name=e.slice(1,o),s.base=e.slice(1,l)):(s.name=e.slice(i,o),s.base=e.slice(i,l)),s.ext=e.slice(o,l)),i>0?s.dir=e.slice(0,i-1):n&&(s.dir="/"),s},sep:"/",delimiter:":",win32:null,posix:null};s.posix=s,e.exports=s}},r={};function s(t){var a=r[t];if(void 0!==a)return a.exports;var n=r[t]={exports:{}},o=!0;try{e[t](n,n.exports,s),o=!1}finally{o&&delete r[t]}return n.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.2.1_@babel+core@7.29.0_@playwright+test@1.58.2_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/next/dist/compiled/path-browserify/",t.exports=s(114)}()},756502,e=>{"use strict";let t=(0,e.i(572989).default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);e.s(["default",0,t])},914935,e=>{"use strict";var t=e.i(289721),r=e.i(965652),s=e.i(538059),a=e.i(210702),n=e.i(487278),o=e.i(232545),i=e.i(464249),l=e.i(998626),c=e.i(49007),d=e.i(902539),u=e.i(263938),m=e.i(645378),x=e.i(453889),h=e.i(572989);let p=(0,h.default)("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var f=e.i(755146),g=e.i(759684),j=e.i(776639),b=e.i(746798),v=e.i(519455),w=e.i(793479),N=e.i(514798);let y=(0,N.createServerReference)("4033464c1a8362c7db9dd014f8c93d3e979236c53d",N.callServer,void 0,N.findSourceMapURL,"createWorkspace"),k=(0,N.createServerReference)("608cf48d18c93289d218b093162252b27156b7ac56",N.callServer,void 0,N.findSourceMapURL,"updateWorkspace"),C=(0,N.createServerReference)("4066785d24434c9678492eaca5b460a203cbe3b526",N.callServer,void 0,N.findSourceMapURL,"deleteWorkspace"),S=(0,N.createServerReference)("401cb3bbada2ef2e54db6083502e545081642b7fee",N.callServer,void 0,N.findSourceMapURL,"reorderWorkspaces");var T=e.i(85596);let D=(0,N.createServerReference)("4072f8e901ee4a3f198090daf9c2d105dd9b8cab5f",N.callServer,void 0,N.findSourceMapURL,"createLabel"),P=(0,N.createServerReference)("40b9cfdaf38d77af122159a675b67849a351750079",N.callServer,void 0,N.findSourceMapURL,"deleteLabel");var M=e.i(533499),R=e.i(360112),$=e.i(720247),L=e.i(775712),A=e.i(67013);let E=["📋","🚀","🎯","💡","🔧","📦","🎨","📊","🔬","🌟","📝","🏗️"];function O({workspaces:e}){let i,l=(0,s.useRouter)(),c=(0,s.usePathname)(),{t:u}=(0,M.useI18n)(),[h,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"true"===localStorage.getItem("sidebar-collapsed")&&f(!0)},[]);let[j,w]=(0,r.useState)(!1),[N,T]=(0,r.useState)(!1),[D,P]=(0,r.useState)(!1),[A,B]=(0,r.useState)(null),[_,W]=(0,r.useState)(""),[U,H]=(0,r.useState)(E[0]),[K,V]=(0,r.useState)(null),[q,X]=(0,r.useState)(e);(0,r.useEffect)(()=>{X(e)},[e]);let G=(0,$.useSensors)((0,$.useSensor)($.PointerSensor,{activationConstraint:{distance:8}})),J=(0,r.useCallback)(t=>{let{active:r,over:s}=t;if(!s||r.id===s.id)return;let a=q.findIndex(e=>e.id===r.id),n=q.findIndex(e=>e.id===s.id);if(-1===a||-1===n)return;let o=(0,L.arrayMove)(q,a,n);X(o),S(o.map(e=>e.id)).then(()=>l.refresh()).catch(()=>{X(e),R.toast.error(u("sidebar.reorderError"))})},[q,e,l,u]),Y=c.split("/workspaces/")[1]?.split("/")[0],Z=(0,r.useCallback)(()=>{f(e=>{let t=!e;return localStorage.setItem("sidebar-collapsed",String(t)),t})},[]),Q=(0,r.useCallback)(async()=>{if(!_.trim())return;let e=await y({name:_.trim(),description:U});W(""),H(E[0]),w(!1),l.refresh(),l.push(`/workspaces/${e.id}`)},[_,U,l]),ee=(0,r.useCallback)(async()=>{_.trim()&&K&&(await k(K,{name:_.trim(),description:U}),W(""),T(!1),V(null),l.refresh())},[_,U,K,l]),et=(0,r.useCallback)(e=>{V(e.id),W(e.name),H(e.description&&E.includes(e.description)?e.description:E[0]),T(!0)},[]),er=(0,r.useCallback)(async(t,r)=>{if(e.length<=1)return void R.toast.error(u("sidebar.lastWorkspaceError"));if(confirm(u("sidebar.deleteConfirm",{name:r})))try{await C(t),l.refresh(),Y===t&&l.push("/workspaces")}catch{R.toast.error(u("sidebar.lastWorkspaceError"))}},[Y,l,u,e.length]),es=(0,r.useCallback)(e=>{B(e),P(!0)},[]),ea=e=>e.description&&E.includes(e.description)?e.description:e.name.charAt(0).toUpperCase();if(h){let r;return(0,t.jsxs)("aside",{className:"flex h-screen w-14 flex-col items-center border-r border-border bg-sidebar py-3",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:Z,className:"mb-4 flex h-9 w-9 items-center justify-center rounded-lg bg-primary/10 ring-1 ring-primary/20 transition-transform hover:scale-105"}),children:(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-6 w-6 rounded"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.expand")})]}),(0,t.jsx)(g.ScrollArea,{className:"flex-1 min-h-0",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1 px-0.5 pt-1",children:[e.map(e=>{let r=Y===e.id,s=ea(e);return(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>{r||l.push(`/workspaces/${e.id}`)},className:`flex h-9 w-9 items-center justify-center rounded-lg transition-all ${r?"ring-1 ring-primary/20 text-foreground cursor-default":"text-muted-foreground hover:text-foreground cursor-pointer"}`}),children:(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:E.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold",children:s})})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:e.name})]},e.id)}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{"data-tour":"create-workspace",onClick:()=>w(!0),className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"}),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.newWorkspace")})]})]})}),(0,t.jsxs)("div",{className:"mt-2 flex flex-col items-center gap-1",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push("/missions"),className:`rounded-lg p-2 transition-colors ${"/missions"===c?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(p,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("missions.navLabel")})]}),(r=Y||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/notes`),className:`rounded-lg p-2 transition-colors ${c.includes("/notes")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(m.FileText,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.notes")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/assets`),className:`rounded-lg p-2 transition-colors ${c.includes("/assets")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(x.FolderOpen,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.assets")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)("button",{onClick:()=>l.push(`/workspaces/${r}/archive`),className:`rounded-lg p-2 transition-colors ${c.includes("/archive")?"text-foreground bg-accent":"text-muted-foreground hover:bg-accent hover:text-foreground"}`}),children:(0,t.jsx)(n.Archive,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{side:"right",sideOffset:8,children:u("sidebar.archive")})]})]}):null]}),(0,t.jsx)(I,{open:j,onOpenChange:w,title:u("workspace.create"),name:_,onNameChange:W,icon:U,onIconChange:H,onSubmit:Q,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")})]})}return(0,t.jsxs)("aside",{className:"noise relative flex h-screen w-56 flex-col border-r border-border bg-sidebar",children:[(0,t.jsxs)("div",{className:"relative z-10 flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("img",{src:"/logo.png",alt:"Tower",className:"h-9 w-9 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"text-sm font-semibold tracking-tight text-foreground",children:"Tower"}),(0,t.jsx)("div",{className:"text-[10px] font-medium uppercase tracking-widest text-muted-foreground",children:"Studio"})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-xs",onClick:Z,className:"text-muted-foreground",title:u("sidebar.collapse"),children:(0,t.jsx)(d.ChevronsLeft,{className:"h-4 w-4"})})]}),(0,t.jsxs)("div",{className:"relative z-10 flex items-center justify-between px-4 py-2",children:[(0,t.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:u("sidebar.workspace")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground","data-tour":"create-workspace",onClick:()=>{W(""),H(E[0]),w(!0)},title:u("sidebar.newWorkspace"),children:(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)(g.ScrollArea,{className:"relative z-10 mt-2 flex-1 min-h-0",children:(0,t.jsx)("div",{className:"px-2 py-1",children:(0,t.jsx)($.DndContext,{id:"workspace-sidebar",sensors:G,collisionDetection:$.closestCenter,onDragEnd:J,children:(0,t.jsx)(L.SortableContext,{items:q.map(e=>e.id),strategy:L.verticalListSortingStrategy,children:q.map(e=>(0,t.jsx)(z,{ws:e,isActive:Y===e.id,icon:ea(e),disableDelete:q.length<=1,t:u,onSelect:()=>{Y!==e.id&&l.push(`/workspaces/${e.id}`)},onEdit:()=>et(e),onManageLabels:()=>es(e.id),onDelete:()=>er(e.id,e.name)},e.id))})})})}),(0,t.jsxs)(a.default,{href:"/missions",className:`relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] cursor-pointer transition-colors ${"/missions"===c?"text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[(0,t.jsx)(p,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("missions.navLabel")})]}),(i=Y||e[0]?.id)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(a.default,{href:`/workspaces/${i}/notes`,className:"relative z-10 flex items-center gap-2 border-t border-border px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(m.FileText,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.notes")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/assets`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.assets")})]}),(0,t.jsxs)(a.default,{href:`/workspaces/${i}/archive`,className:"relative z-10 flex items-center gap-2 px-4 py-3 text-[11px] text-muted-foreground cursor-pointer hover:text-foreground transition-colors",children:[(0,t.jsx)(n.Archive,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:u("sidebar.archive")})]})]}):null,(0,t.jsx)(I,{open:j,onOpenChange:w,title:u("workspace.create"),name:_,onNameChange:W,icon:U,onIconChange:H,onSubmit:Q,submitLabel:u("common.create"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),(0,t.jsx)(I,{open:N,onOpenChange:e=>{T(e),e||V(null)},title:u("workspace.edit"),name:_,onNameChange:W,icon:U,onIconChange:H,onSubmit:ee,submitLabel:u("common.save"),nameLabel:u("workspace.name"),iconLabel:u("workspace.icon"),namePlaceholder:u("workspace.namePlaceholder"),cancelLabel:u("common.cancel")}),A&&(0,t.jsx)(F,{open:D,onOpenChange:e=>{P(e),e||B(null)},workspaceId:A})]})}function z({ws:e,isActive:r,icon:s,disableDelete:a,t:n,onSelect:o,onEdit:d,onManageLabels:m,onDelete:x}){var h;let p,g,j,{attributes:b,listeners:v,setNodeRef:w,transform:N,transition:y,isDragging:k}=(0,L.useSortable)({id:e.id}),C={transform:A.CSS.Transform.toString(N),transition:y,opacity:k?.4:1};return(0,t.jsxs)("div",{ref:w,style:C,...b,...v,className:`group relative flex touch-none items-center rounded-lg transition-all ${r?"bg-accent ring-1 ring-primary/15":"hover:bg-accent/60"}`,children:[(0,t.jsxs)("button",{onClick:o,className:`flex flex-1 items-center gap-2.5 px-3 py-2.5 text-left ${r?"cursor-default":"cursor-pointer"}`,children:[(0,t.jsx)("span",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-muted text-sm",children:E.includes(s)?s:(0,t.jsx)("span",{className:"text-xs font-semibold text-muted-foreground",children:s})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:`truncate text-sm font-medium ${r?"text-foreground":"text-secondary-foreground"}`,children:e.name}),(0,t.jsx)("div",{className:"text-[11px] text-muted-foreground",children:(h=e.updatedAt,g=Math.floor((p=Date.now()-new Date(h).getTime())/6e4),j=Math.floor(p/36e5),g<60?`${g}m ago`:j<24?`${j}h ago`:`${Math.floor(j/24)}d ago`)})]})]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsx)("button",{className:"mr-2 rounded-md p-1 text-muted-foreground opacity-0 transition-all hover:bg-background hover:text-foreground group-hover:opacity-100",onClick:e=>e.stopPropagation()}),children:(0,t.jsx)(c.MoreHorizontal,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)(f.DropdownMenuContent,{align:"start",side:"right",children:[(0,t.jsxs)(f.DropdownMenuItem,{onClick:d,children:[(0,t.jsx)(i.Pencil,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.rename")]}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:m,children:[(0,t.jsx)(u.Tag,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.manageLabels")]}),(0,t.jsxs)(f.DropdownMenuItem,{className:a?"text-muted-foreground opacity-50":"text-rose-400",disabled:a,onClick:x,children:[(0,t.jsx)(l.Trash2,{className:"mr-2 h-3.5 w-3.5"}),n("sidebar.delete")]})]})]})]})}function I({open:e,onOpenChange:r,title:s,name:a,onNameChange:n,icon:o,onIconChange:i,onSubmit:l,submitLabel:c,nameLabel:d,iconLabel:u,namePlaceholder:m,cancelLabel:x}){return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:r,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:s})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:d}),(0,t.jsx)(w.Input,{placeholder:m,value:a,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:u}),(0,t.jsx)("div",{className:"mt-1.5 grid grid-cols-6 gap-1.5",children:E.map(e=>(0,t.jsx)("button",{onClick:()=>i(e),className:`flex h-10 w-10 items-center justify-center rounded-lg text-lg transition-all ${o===e?"bg-primary/15 ring-2 ring-primary/30 scale-110":"bg-muted hover:bg-accent"}`,children:e},e))})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>r(!1),children:x}),(0,t.jsx)(v.Button,{onClick:l,disabled:!a.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:c})]})]})})}let B=["#3b82f6","#ef4444","#f59e0b","#10b981","#8b5cf6","#ec4899","#06b6d4","#f97316"];function F({open:e,onOpenChange:s,workspaceId:a}){let{t:n}=(0,M.useI18n)(),[o,i]=(0,r.useState)([]),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)(B[0]);(0,r.useEffect)(()=>{e&&(0,T.getLabelsForWorkspace)(a).then(i)},[e,a]);let m=async()=>{l.trim()&&(await D({name:l.trim(),color:d,workspaceId:a}),i(await (0,T.getLabelsForWorkspace)(a)),c(""))},x=async e=>{await P(e),i(t=>t.filter(t=>t.id!==e))};return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:s,disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-sm",children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("label.manage")})}),(0,t.jsxs)("div",{className:"space-y-3 py-2",children:[o.map(e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"h-3 w-3 rounded-full",style:{backgroundColor:e.color}}),(0,t.jsx)("span",{className:"flex-1 text-sm text-foreground",children:e.name}),e.isBuiltin?(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:n("label.builtin")}):(0,t.jsx)("button",{onClick:()=>x(e.id),className:"text-xs text-rose-400 hover:text-rose-300",children:n("common.delete")})]},e.id)),(0,t.jsxs)("div",{className:"border-t border-border pt-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("label.name"),value:l,onChange:e=>c(e.target.value),onKeyDown:e=>"Enter"===e.key&&e.preventDefault(),className:"flex-1 h-8"}),(0,t.jsx)(v.Button,{size:"sm",onClick:m,disabled:!l.trim(),className:"bg-primary/10 text-primary ring-1 ring-primary/20 hover:bg-primary/15",children:n("label.add")})]}),(0,t.jsx)("div",{className:"mt-2 flex gap-1.5",children:B.map(e=>(0,t.jsx)("button",{onClick:()=>u(e),className:`h-5 w-5 rounded-full transition-all ${d===e?"ring-2 ring-offset-2 ring-offset-background ring-foreground/30 scale-110":""}`,style:{backgroundColor:e}},e))})]})]})]})})}var _=e.i(821957),W=e.i(738690),U=e.i(386343);let H=(0,h.default)("command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);var K=e.i(242941),V=e.i(989548),q=e.i(387091),X=e.i(15299);e.s([],678787),e.i(678787),e.i(708878);var G=e.i(581263),J=e.i(462902);let Y=r.createContext(void 0);function Z(){let e=r.useContext(Y);if(void 0===e)throw Error((0,J.default)(13));return e}let Q={imageLoadingStatus:()=>null},ee=r.forwardRef(function(e,s){let{className:a,render:n,...o}=e,[i,l]=r.useState("idle"),c=r.useMemo(()=>({imageLoadingStatus:i,setImageLoadingStatus:l}),[i,l]),d=(0,G.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:s,props:o,stateAttributesMapping:Q});return(0,t.jsx)(Y.Provider,{value:c,children:d})});var et=e.i(887642),er=e.i(804849),es=e.i(504068),ea=e.i(809058),en=e.i(193214),eo=e.i(954588);let ei={...Q,...ea.transitionStatusMapping},el=r.forwardRef(function(e,t){let{className:s,render:a,onLoadingStatusChange:n,referrerPolicy:o,crossOrigin:i,...l}=e,c=Z(),d=function(e,{referrerPolicy:t,crossOrigin:s}){let[a,n]=r.useState("idle");return(0,er.useIsoLayoutEffect)(()=>{if(!e)return n("error"),eo.NOOP;let r=!0,a=new window.Image,o=e=>()=>{r&&n(e)};return n("loading"),a.onload=o("loaded"),a.onerror=o("error"),t&&(a.referrerPolicy=t),a.crossOrigin=s??null,a.src=e,()=>{r=!1}},[e,s,t]),a}(e.src,{referrerPolicy:o,crossOrigin:i}),u="loaded"===d,{mounted:m,transitionStatus:x,setMounted:h}=(0,en.useTransitionStatus)(u),p=r.useRef(null),f=(0,et.useStableCallback)(e=>{n?.(e),c.setImageLoadingStatus(e)});(0,er.useIsoLayoutEffect)(()=>{"idle"!==d&&f(d)},[d,f]),(0,es.useOpenChangeComplete)({open:u,ref:p,onComplete(){u||h(!1)}});let g=(0,G.useRenderElement)("img",e,{state:{imageLoadingStatus:d,transitionStatus:x},ref:[t,p],props:l,stateAttributesMapping:ei,enabled:m});return m?g:null});var ec=e.i(161476);let ed=r.forwardRef(function(e,t){let{className:s,render:a,delay:n,...o}=e,{imageLoadingStatus:i}=Z(),[l,c]=r.useState(void 0===n),d=(0,ec.useTimeout)();return r.useEffect(()=>(void 0!==n&&d.start(n,()=>c(!0)),d.clear),[d,n]),(0,G.useRenderElement)("span",e,{state:{imageLoadingStatus:i},ref:t,props:o,stateAttributesMapping:Q,enabled:"loaded"!==i&&l})});e.s(["Fallback",0,ed,"Image",0,el,"Root",0,ee],129448);var eu=e.i(129448),eu=eu,em=e.i(975157);function ex({className:e,size:r="default",...s}){return(0,t.jsx)(eu.Root,{"data-slot":"avatar","data-size":r,className:(0,em.cn)("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...s})}function eh({className:e,...r}){return(0,t.jsx)(eu.Fallback,{"data-slot":"avatar-fallback",className:(0,em.cn)("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...r})}let ep=(0,h.default)("folder-kanban",[["path",{d:"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z",key:"1fr9dc"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M12 10v2",key:"hh53o1"}],["path",{d:"M16 10v6",key:"1d6xys"}]]);var ef=e.i(226145);let eg=(0,h.default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]),ej=(0,h.default)("package-2",[["path",{d:"M12 3v6",key:"1holv5"}],["path",{d:"M16.76 3a2 2 0 0 1 1.8 1.1l2.23 4.479a2 2 0 0 1 .21.891V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9.472a2 2 0 0 1 .211-.894L5.45 4.1A2 2 0 0 1 7.24 3z",key:"187q7i"}],["path",{d:"M3.054 9.013h17.893",key:"grwhos"}]]);var eb=e.i(657153);let ev=(0,N.createServerReference)("609ebabc7dbb7165cc4452523d762dc3bf9158f58e",N.callServer,void 0,N.findSourceMapURL,"globalSearch");var ew=e.i(549233);let eN=[{id:"all",key:"search.all",icon:W.Search},{id:"task",key:"search.task",icon:m.FileText},{id:"project",key:"search.project",icon:ep},{id:"repository",key:"search.repository",icon:ef.GitBranch},{id:"note",key:"search.note",icon:eg},{id:"asset",key:"search.asset",icon:ej}],ey=["task","project","repository","note","asset"],ek={task:"search.task",project:"search.project",repository:"search.repository",note:"search.note",asset:"search.asset"};function eC({result:e,onSelect:r}){let s=eN.find(t=>t.id===e.type)?.icon??m.FileText;return(0,t.jsxs)("button",{onClick:()=>r(e),className:"flex w-full items-center gap-3 border-b border-border/30 px-4 py-3 text-left transition-colors hover:bg-accent last:border-b-0",children:[(0,t.jsx)("div",{className:"rounded-md bg-muted p-1.5",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.title}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.subtitle}),e.snippet&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground/70 truncate mt-0.5",children:e.snippet})]})]})}function eS({open:e,onOpenChange:a}){let n,{t:o}=(0,M.useI18n)(),i=(0,s.useRouter)(),[l,c]=(0,r.useState)(""),[d,u]=(0,r.useState)("all"),[m,x]=(0,r.useState)([]),[h,p]=(0,r.useState)(!1),[f,b]=(0,r.useState)(250),w=(0,r.useRef)(null),N=(0,r.useRef)(null);(0,r.useEffect)(()=>{e&&((0,ew.getConfigValue)("search.debounceMs",250).then(b),setTimeout(()=>w.current?.focus(),100),c(""),x([]))},[e]),(0,r.useEffect)(()=>{if(N.current&&clearTimeout(N.current),!l.trim()){x([]),p(!1);return}p(!0);let e=!1;return N.current=setTimeout(async()=>{let t=await ev(l,d);e||(x(t),p(!1))},f),()=>{N.current&&clearTimeout(N.current),e=!0}},[l,d,f]);let y=(0,r.useCallback)(e=>{i.push(e.navigateTo),a(!1)},[i,a]);return(0,t.jsx)(j.Dialog,{open:e,onOpenChange:a,children:(0,t.jsxs)(j.DialogContent,{className:"sm:max-w-lg p-0 gap-0 overflow-hidden !top-[10vh] !-translate-y-0",showCloseButton:!1,children:[(0,t.jsxs)("div",{className:"flex items-center border-b border-border px-4",children:[(0,t.jsx)(W.Search,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("input",{ref:w,value:l,onChange:e=>c(e.target.value),placeholder:o("search.placeholder"),className:"flex-1 bg-transparent px-3 py-3.5 text-sm text-foreground placeholder-muted-foreground outline-none"}),l&&(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>{c(""),x([])},className:"text-muted-foreground",children:(0,t.jsx)(eb.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsx)("div",{className:"flex items-center gap-1 border-b border-border px-4 py-2",children:eN.map(e=>{let r=e.icon;return(0,t.jsxs)("button",{onClick:()=>u(e.id),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs font-medium transition-all ${d===e.id?"bg-primary/10 text-primary ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent hover:text-foreground"}`,children:[(0,t.jsx)(r,{className:"h-3 w-3"}),o(e.key)]},e.id)})}),(0,t.jsxs)(g.ScrollArea,{className:"max-h-80",children:[!l.trim()&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.typeToSearch")}),l.trim()&&0===m.length&&!h&&(0,t.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:o("search.noResults")}),"all"===d&&m.length>0&&(n=m.reduce((e,t)=>((e[t.type]??=[]).push(t),e),{}),ey.filter(e=>n[e]?.length).map(e=>(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"px-4 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground bg-muted/50",children:o(ek[e])}),n[e].map(e=>(0,t.jsx)(eC,{result:e,onSelect:y},`${e.type}-${e.id}`))]},e))),"all"!==d&&m.map(e=>(0,t.jsx)(eC,{result:e,onSelect:y},`${e.type}-${e.id}`))]})]})})}var eT=e.i(338187),eD=e.i(400355),eP=e.i(597746),eM=e.i(938499),eR=e.i(233274),e$=e.i(905455),eL=e.i(624687);function eA(e){return e.replace(/\.git\/?$/,"")}e.i(465536),e.i(930787);let eE=(0,N.createServerReference)("408b97963602bfd4fb45fb1a73181042fb0c2bb6c5",N.callServer,void 0,N.findSourceMapURL,"resolveGitLocalPath");var eO=e.i(126916),ez=e.i(224277);function eI({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,M.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)("idle"),[D,P]=(0,r.useState)(""),[$,L]=(0,r.useState)(!1),[A,E]=(0,r.useState)(!1),O=()=>{l(""),d(""),m(""),p(""),g(""),y(!1),C("FRONTEND"),T("idle"),P(""),L(!1)},z=async()=>{if(f.trim()&&!$&&"success"===S){L(!0);try{let e=await (0,eO.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{L(!1)}}},I=async e=>{p(e),T("idle"),P("");let t=function(e){let t,r=e.match(/^git@([^:]+):(.+)$/);if(r)return{host:r[1],pathSegments:eA(r[2]).split("/").filter(Boolean)};try{t=new URL(e)}catch{return null}return{host:t.hostname,pathSegments:eA(decodeURIComponent(t.pathname)).split("/").filter(Boolean)}}(e);t&&t.pathSegments.length>0&&l(t.pathSegments[t.pathSegments.length-1]),N||g(await eE(e))},B=async()=>{if(h.trim()&&f.trim()){T("cloning"),P("");try{let e=function(e){let t=e.trim();if(!t)return"";if(t.startsWith("git@")||t.startsWith("ssh://")||t.endsWith(".git"))return t;try{let e=new URL(t),r=e.hostname,s=decodeURIComponent(e.pathname).split("/").filter(Boolean);if("code.iflytek.com"===r){let e=[...s];"osc"===e[0]&&"_source"===e[1]&&(e=e.slice(2));let a=e.indexOf("-");if(a>0&&(e=e.slice(0,a)),0===e.length)return t;return`https://${r}/${e.join("/")}.git`}return`${e.origin}${e.pathname.replace(/\/$/,"")}.git`}catch{return t}}(h.trim()),t=await fetch("/api/git",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clone",url:e,path:f.trim()})}),r=await t.json();if(!t.ok){T("error"),P(r.error||"Clone failed");return}T("success")}catch{T("error"),P("Network error")}}},F=async()=>{i.trim()&&(await a?.({name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:h.trim()||void 0,localPath:f.trim()||void 0,projectType:k}),O(),s(!1))};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||O()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.newProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.gitUrlHint")}),(0,t.jsx)(w.Input,{placeholder:n("project.gitPlaceholder"),value:h,onChange:e=>I(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.localPathHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{placeholder:n("project.localPathPlaceholder"),value:f,onChange:e=>{g(e.target.value),y(!0)},className:"flex-1 min-w-0 font-mono text-xs"}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"outline",onClick:()=>E(!0),className:"shrink-0 gap-1.5 px-2.5 text-xs text-muted-foreground"}),children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:n("folder.browse")})]}),(0,t.jsx)(b.TooltipContent,{children:n("folder.selectFolder")})]})]}),f.trim().startsWith("~")&&(0,t.jsxs)("p",{className:"mt-1 flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eM.AlertCircle,{className:"h-3 w-3"}),n("project.tildeWarning")]}),h.trim()&&f.trim()&&(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{type:"button",disabled:"cloning"===S||"success"===S,onClick:B,className:"gap-1.5 text-xs bg-emerald-500/15 text-emerald-300 ring-1 ring-emerald-500/25 hover:bg-emerald-500/25 disabled:opacity-50",children:["cloning"===S?(0,t.jsx)(eD.Loader2,{className:"h-3 w-3 animate-spin"}):"success"===S?(0,t.jsx)(eP.Check,{className:"h-3 w-3"}):(0,t.jsx)(ef.GitBranch,{className:"h-3 w-3"}),"cloning"===S?n("git.cloning"):"success"===S?n("git.cloned"):n("git.clone")]}),"error"===S&&(0,t.jsxs)("span",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eM.AlertCircle,{className:"h-3 w-3"}),D]}),"success"===S&&(0,t.jsx)("span",{className:"text-[11px] text-emerald-400",children:n("git.cloneSuccess")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(e$.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:z,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f.trim()||$?"opacity-50":""}`}),children:[$?(0,t.jsx)(eD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eR.Sparkles,{className:"h-3 w-3"}),$?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f.trim()?"success"!==S?n("project.genDescNotCloned"):n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eL.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),O()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:F,disabled:!i.trim()||$,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:n("common.create")})]})]})}),(0,t.jsx)(ez.FolderBrowserDialog,{open:A,onOpenChange:E,onSelect:e=>{if(g(e),y(!0),!i.trim()){let t=e.replace(/[\\/]+$/,"").split(/[\\/]/).filter(Boolean).pop()??"";t&&l(t)}}})]})}var eB=e.i(756502),eB=eB,eF=e.i(699375);let e_=(0,N.createServerReference)("60564c9b4ee0cf2ff864b69be6c8a8cbce8289e580",N.callServer,void 0,N.findSourceMapURL,"migrateProjectPath"),eW=(0,N.createServerReference)("402ba4719c8d33792130cdb032e3c45ab32e3a7d6e",N.callServer,void 0,N.findSourceMapURL,"checkMigrationSafety");function eU({open:e,onOpenChange:s,onCreateProject:a}){let{t:n,locale:o}=(0,M.useI18n)(),[i,l]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[u,m]=(0,r.useState)(""),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(""),[N,y]=(0,r.useState)(!1),[k,C]=(0,r.useState)("FRONTEND"),[S,T]=(0,r.useState)(!1),[D,P]=(0,r.useState)(!1),[$,L]=(0,r.useState)(""),[A,E]=(0,r.useState)(!1),[O,z]=(0,r.useState)(""),[I,B]=(0,r.useState)(""),[F,_]=(0,r.useState)(!1),[W,U]=(0,r.useState)(!1),H=()=>{l(""),d(""),m(""),p(""),g(""),C("FRONTEND"),T(!1),P(!1),L(""),E(!1),z(""),B(""),_(!1),U(!1)},K=async e=>{g(e),T(!1),P(!1),L(""),z(""),B(""),_(!1),l(e.split("/").filter(Boolean).pop()??"");try{let t=await fetch(`/api/git?path=${encodeURIComponent(e)}`);if(t.ok){let e=await t.json();if(e.isGit&&e.remoteUrl){p(e.remoteUrl),T(!0);let t=e.remoteUrl.match(/\/([^/]+?)(?:\.git)?$/);t&&l(t[1])}}}catch{}},V=(0,r.useCallback)(async e=>{if(P(e),z(""),B(""),_(!1),!e)return void L("");if(h)try{let e=await eE(h);e&&(L(e),e===f&&_(!0))}catch{}if(f)try{let e=await fetch(`/api/git?path=${encodeURIComponent(f)}&checkWorktrees=true`);e.ok&&(await e.json()).hasWorktrees&&B(n("project.worktreeWarning"))}catch{}},[h,f]),q=async()=>{if(f&&!W){U(!0);try{let e=await (0,eO.analyzeProjectDirectory)(f.trim(),o);m(e)}catch{R.toast.error(n("project.analyzeError"))}finally{U(!1)}}},X=async()=>{if(!i.trim())return;let e={name:i.trim(),alias:c.trim()||void 0,description:u.trim()||void 0,gitUrl:h.trim()||void 0,localPath:f.trim()||void 0,projectType:k},t=await a?.(e);if(D&&$&&$!==f&&t&&"id"in t){E(!0),z("");try{let e=await eW(t.id);if(!e.safe)return void z(e.reason);let r=await e_(t.id,$);if(!r.success)return void z(r.error??n("project.migrateError"));R.toast.success(n("project.migrateSuccess"))}catch(t){let e=t instanceof Error?t.message:String(t);z(`${n("project.migrateError")}:${e}`);return}finally{E(!1)}}H(),s(!1)},G=!i.trim()||!f.trim()||A||W||D&&!!I;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(j.Dialog,{open:e,onOpenChange:e=>{s(e),e||H()},disablePointerDismissal:!0,children:(0,t.jsxs)(j.DialogContent,{style:{maxWidth:"32rem"},children:[(0,t.jsx)(j.DialogHeader,{children:(0,t.jsx)(j.DialogTitle,{children:n("topbar.importProject")})}),(0,t.jsxs)("div",{className:"space-y-4 py-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.localPath")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.importHint")}),(0,t.jsxs)("div",{className:"mt-1.5 flex gap-2",children:[(0,t.jsx)(w.Input,{value:f,readOnly:!0,placeholder:n("project.localPathPlaceholder"),className:"flex-1 font-mono text-xs bg-muted/30"}),(0,t.jsxs)(v.Button,{type:"button",variant:"outline",onClick:()=>y(!0),className:"shrink-0 gap-1.5",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),n("folder.browse")]})]}),S&&(0,t.jsx)("p",{className:"mt-1.5 text-[11px] text-emerald-400",children:n("project.autoDetected")})]}),h&&(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.gitUrl")}),(0,t.jsx)(w.Input,{value:h,onChange:e=>p(e.target.value),className:"mt-1.5 font-mono text-xs"})]}),S&&f&&(0,t.jsxs)("div",{className:"rounded-md border border-border p-3 space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:n("project.migrate")}),(0,t.jsx)("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:n("project.migrateHint")})]}),(0,t.jsx)(eF.Switch,{checked:D,onCheckedChange:e=>V(e)})]}),D&&(0,t.jsxs)("div",{className:"space-y-2 pt-1",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-[10px] font-medium text-muted-foreground",children:n("project.targetPath")}),(0,t.jsx)(w.Input,{value:$,onChange:e=>{L(e.target.value),_(e.target.value===f)},placeholder:"/path/to/canonical/location",className:"mt-1 font-mono text-xs"})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-sky-400",children:[(0,t.jsx)(eB.default,{className:"h-3 w-3"}),n("project.samePathInfo")]}),I&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-amber-400",children:[(0,t.jsx)(eM.AlertCircle,{className:"h-3 w-3"}),I]}),O&&(0,t.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-rose-400",children:[(0,t.jsx)(eM.AlertCircle,{className:"h-3 w-3"}),O]})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.name")}),(0,t.jsx)(w.Input,{placeholder:n("project.namePlaceholder"),value:i,onChange:e=>l(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.type.label")}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(e$.SegmentedControl,{options:[{value:"FRONTEND",label:n("project.type.frontend")},{value:"BACKEND",label:n("project.type.backend")}],value:k,onChange:C})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.alias")}),(0,t.jsx)(w.Input,{placeholder:n("project.aliasPlaceholder"),value:c,onChange:e=>d(e.target.value),className:"mt-1.5"})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mt-0.5",children:[(0,t.jsx)("label",{className:"text-xs font-medium text-muted-foreground",children:n("project.description")}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{type:"button",variant:"ghost",onClick:q,className:`h-6 gap-1 px-2 text-[11px] text-muted-foreground hover:text-foreground ${!f||W?"opacity-50":""}`}),children:[W?(0,t.jsx)(eD.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(eR.Sparkles,{className:"h-3 w-3"}),W?n("project.analyzing"):n("project.genDesc")]}),(0,t.jsx)(b.TooltipContent,{children:f?n("project.genDescReady"):n("project.genDescNoPath")})]})]}),(0,t.jsx)(eL.Textarea,{placeholder:n("project.descPlaceholder"),value:u,onChange:e=>m(e.target.value),rows:3,className:"mt-1.5 w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground placeholder-muted-foreground outline-none transition-colors focus:border-ring focus:ring-1 focus:ring-ring resize-none max-h-[200px] overflow-y-auto"})]})]}),(0,t.jsxs)(j.DialogFooter,{children:[(0,t.jsx)(v.Button,{variant:"outline",onClick:()=>{s(!1),H()},children:n("common.cancel")}),(0,t.jsx)(v.Button,{onClick:X,disabled:G,className:"bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",children:A?n("project.migrating"):n("common.create")})]})]})}),(0,t.jsx)(ez.FolderBrowserDialog,{open:N,onOpenChange:y,onSelect:e=>K(e)})]})}function eH({className:e}){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:e,children:(0,t.jsx)("path",{d:"M12 .5C5.65.5.5 5.65.5 12.02c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56v-2c-3.2.7-3.87-1.36-3.87-1.36-.52-1.34-1.27-1.7-1.27-1.7-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.76 2.68 1.25 3.34.96.1-.74.4-1.25.72-1.54-2.56-.29-5.25-1.28-5.25-5.69 0-1.26.45-2.28 1.18-3.09-.12-.29-.51-1.46.11-3.04 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.79 0c2.2-1.49 3.18-1.18 3.18-1.18.62 1.58.23 2.75.11 3.04.74.81 1.18 1.83 1.18 3.09 0 4.42-2.69 5.4-5.25 5.69.41.36.78 1.05.78 2.12v3.14c0 .31.21.68.79.56A11.52 11.52 0 0 0 23.5 12.02C23.5 5.65 18.35.5 12 .5Z"})})}function eK({onCreateProject:e,username:a}){let{t:n,locale:i,setLocale:l}=(0,M.useI18n)(),{isOpen:c,toggleAssistant:d}=(0,eT.useAssistant)(),{resolvedTheme:u,toggleTheme:m,triggerRef:h}=function(){let{resolvedTheme:e,setTheme:t}=(0,_.useTheme)(),s=(0,r.useRef)(null),a=(0,r.useCallback)(r=>{let s="dark"===e?"light":"dark";if("u">typeof document&&"startViewTransition"in document&&!window.matchMedia("(prefers-reduced-motion: reduce)").matches){let e=r?.clientX??window.innerWidth/2,a=r?.clientY??0,n=Math.hypot(Math.max(e,window.innerWidth-e),Math.max(a,window.innerHeight-a));document.startViewTransition(()=>{t(s)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${e}px ${a}px)`,`circle(${n}px at ${e}px ${a}px)`]},{duration:400,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})}else t(s)},[e,t]);return{resolvedTheme:e,toggleTheme:a,triggerRef:s}}(),p=(0,s.useRouter)(),[g,j]=(0,r.useState)(!1),[w,N]=(0,r.useState)(!1),[y,k]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),j(!0))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("header",{className:"flex h-12 items-center justify-between border-b border-border bg-background/80 px-5 backdrop-blur-sm",children:[(0,t.jsx)("div",{className:"w-40"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)(v.Button,{variant:"outline",onClick:()=>j(!0),className:"h-8 w-[400px] justify-start gap-2 bg-muted/50 text-muted-foreground hover:bg-muted",children:[(0,t.jsx)(W.Search,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1 text-left",suppressHydrationWarning:!0,children:n("topbar.searchPlaceholder")}),(0,t.jsxs)("kbd",{className:"mr-1 flex items-center gap-0.5 rounded border border-border bg-background px-1.5 py-0.5 text-[10px] font-mono",children:[(0,t.jsx)(H,{className:"h-2.5 w-2.5"}),"K"]})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{delay:500,render:(0,t.jsx)("button",{"data-tour":"open-assistant",onClick:d,"aria-label":n("assistant.iconLabel"),className:["cursor-pointer rounded-lg p-2 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",c?"bg-accent text-foreground":""].join(" ")}),children:(0,t.jsx)(V.Bot,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("assistant.iconLabel")})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsxs)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",onClick:()=>l("zh"===i?"en":"zh"),className:"text-muted-foreground"}),children:[(0,t.jsx)(K.Globe,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[11px] font-semibold",children:"zh"===i?"EN":"中"})]}),(0,t.jsx)(b.TooltipContent,{children:n("settings.language")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{ref:h,variant:"ghost",size:"icon",onClick:m,className:"text-muted-foreground"}),children:"dark"===u?(0,t.jsx)(q.Sun,{className:"h-4 w-4"}):(0,t.jsx)(X.Moon,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("settings.theme")})]}),(0,t.jsxs)(b.Tooltip,{children:[(0,t.jsx)(b.TooltipTrigger,{render:(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",onClick:()=>window.open("https://github.com/jp-liu/tower","_blank","noopener,noreferrer"),className:"text-muted-foreground","aria-label":n("topbar.github")}),children:(0,t.jsx)(eH,{className:"h-4 w-4"})}),(0,t.jsx)(b.TooltipContent,{children:n("topbar.github")})]}),(0,t.jsx)("div",{className:"h-4 w-px bg-border"}),(0,t.jsxs)(v.Button,{variant:"outline",className:"gap-1.5 ring-1 ring-border hover:bg-accent",onClick:()=>k(!0),children:[(0,t.jsx)(x.FolderOpen,{className:"h-3.5 w-3.5"}),n("topbar.importProject")]}),(0,t.jsxs)(v.Button,{"data-tour":"create-project",className:"gap-1.5 bg-primary/10 text-primary ring-1 ring-primary/25 hover:bg-primary/20",onClick:()=>N(!0),children:[(0,t.jsx)(o.Plus,{className:"h-3.5 w-3.5"}),n("topbar.newProject")]}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsx)(f.DropdownMenuTrigger,{render:(0,t.jsxs)("button",{className:"ml-0.5 flex cursor-pointer items-center gap-1.5 rounded-lg px-2.5 py-1 transition-colors hover:bg-accent",children:[a&&(0,t.jsx)("span",{className:"max-w-[80px] truncate text-xs text-muted-foreground",children:a}),(0,t.jsx)(ex,{className:"h-7 w-7 ring-1 ring-border",children:(0,t.jsx)(eh,{className:"bg-emerald-500/20 text-emerald-400 text-[10px] font-semibold",children:a?a.trim().split(/\s+/).filter(e=>e.length>0).slice(0,2).map(e=>e[0].toUpperCase()).join(""):"U"})})]})}),(0,t.jsx)(f.DropdownMenuContent,{align:"end",sideOffset:8,className:"w-40",children:(0,t.jsxs)(f.DropdownMenuItem,{onClick:()=>p.push("/settings"),children:[(0,t.jsx)(U.Settings,{className:"mr-2 h-3.5 w-3.5"}),n("settings.title")]})})]})]})]}),(0,t.jsx)(eS,{open:g,onOpenChange:j}),(0,t.jsx)(eI,{open:w,onOpenChange:N,onCreateProject:e}),(0,t.jsx)(eU,{open:y,onOpenChange:k,onCreateProject:e})]})}var eV=e.i(83434),eq=e.i(966001),eX=e.i(56723),eG=e.i(19578),eJ=e.i(232280);let eY=(0,eG.default)(()=>e.A(427768).then(e=>({default:e.AssistantChat})),{loadableGenerated:{modules:[103363]},ssr:!1});function eZ({mode:e}){let{isOpen:r,closeAssistant:s,sessions:a,activeSessionId:n,createNewSession:i,switchSession:c,removeSession:d}=(0,eT.useAssistant)(),{t:u}=(0,M.useI18n)(),m=a.find(e=>e.id===n),x=m?.title??u("assistant.newSession");return(0,t.jsxs)("div",{className:"sidebar"===e?"min-w-[320px] max-w-[480px] w-[30vw] shrink-0 border-r border-border flex flex-col bg-sidebar overflow-hidden":"flex flex-col h-full overflow-hidden",children:[(0,t.jsxs)("div",{className:"header-sm flex items-center px-4 gap-2 bg-sidebar",children:[(0,t.jsx)(V.Bot,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground shrink-0",children:u("assistant.title")}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(f.DropdownMenu,{children:[(0,t.jsxs)(f.DropdownMenuTrigger,{className:"flex items-center gap-1 h-8 px-2 rounded-md text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground max-w-[120px] truncate","aria-label":u("assistant.sessionList"),children:[(0,t.jsx)("span",{className:"truncate",children:x}),(0,t.jsx)(eJ.ChevronDown,{className:"h-3 w-3 shrink-0"})]}),(0,t.jsxs)(f.DropdownMenuContent,{side:"bottom",align:"end",sideOffset:4,children:[0===a.length?(0,t.jsx)("div",{className:"px-2 py-4 text-xs text-muted-foreground text-center",children:u("assistant.noSessions")}):a.map(e=>(0,t.jsxs)(f.DropdownMenuItem,{className:"flex items-center justify-between gap-2 pr-1",onClick:()=>c(e.id),children:[(0,t.jsxs)("div",{className:"flex flex-col gap-0.5 min-w-0",children:[(0,t.jsx)("span",{className:"text-xs truncate max-w-[140px]",children:e.title}),(0,t.jsx)("span",{className:"text-[10px] text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return`${t}s ago`;let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);return`${a}d ago`}(e.updatedAt)})]}),(0,t.jsx)(v.Button,{variant:"ghost",className:"h-6 w-6 p-0 shrink-0 opacity-50 hover:opacity-100 hover:text-destructive",onClick:t=>{t.stopPropagation(),d(e.id)},"aria-label":u("assistant.deleteSession"),children:(0,t.jsx)(l.Trash2,{className:"h-3 w-3"})})]},e.id)),a.length>0&&(0,t.jsx)(f.DropdownMenuSeparator,{}),(0,t.jsxs)(f.DropdownMenuItem,{onClick:i,children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3 mr-1"}),(0,t.jsx)("span",{className:"text-xs",children:u("assistant.newSession")})]})]})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:i,"aria-label":u("assistant.newSession"),children:(0,t.jsx)(o.Plus,{className:"h-4 w-4"})})]}),(0,t.jsx)(v.Button,{variant:"ghost",size:"icon",className:"text-muted-foreground",onClick:s,"aria-label":u("assistant.closeLabel"),children:(0,t.jsx)(eb.X,{className:"h-4 w-4"})})]}),(0,t.jsx)("div",{className:"flex-1 overflow-hidden",children:r?(0,t.jsx)(eY,{}):null})]})}var eQ=e.i(125177);function e0({onDismiss:e}){let{t:s}=(0,M.useI18n)(),[a,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"Notification"in window&&"default"===window.Notification.permission&&n(!0)},[]);let o=async()=>{"default"!==await window.Notification.requestPermission()&&(n(!1),e?.())};return a?(0,t.jsxs)("div",{className:"fixed top-3 left-1/2 -translate-x-1/2 z-[9999] w-auto max-w-lg bg-card border rounded-lg shadow-lg px-4 py-2.5 flex items-center gap-3 animate-in fade-in slide-in-from-top-4 duration-500",children:[(0,t.jsx)(eQ.Bell,{className:"h-4 w-4 shrink-0 text-primary"}),(0,t.jsx)("span",{className:"flex-1 text-sm",children:s("notification.permissionPrompt")}),(0,t.jsx)(v.Button,{size:"default",onClick:o,children:s("notification.allow")}),(0,t.jsx)(v.Button,{variant:"ghost",size:"default",onClick:()=>{n(!1),e?.()},children:s("notification.dismiss")})]}):null}var e1=e.i(832884),e2=e.i(698246);let e5=[{target:"create-workspace",titleKey:"tour.step1.title",descKey:"tour.step1.desc",placement:"right"},{target:"create-project",titleKey:"tour.step2.title",descKey:"tour.step2.desc",placement:"bottom",waitForTarget:!0},{target:"open-assistant",titleKey:"tour.step3.title",descKey:"tour.step3.desc",placement:"bottom"}];function e4({onComplete:e}){let{t:s}=(0,M.useI18n)(),[a,n]=(0,r.useState)(0),[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1),d=(0,r.useRef)(null),u=e5[a],m=(0,r.useCallback)(async()=>{await (0,e2.setConfigValue)("onboarding.tourCompleted",!0),e()},[e]),x=(0,r.useCallback)(()=>u?document.querySelector(`[data-tour="${u.target}"]`):null,[u]),h=(0,r.useCallback)(()=>{let e=x();e?(i(e.getBoundingClientRect()),c(!0)):c(!1)},[x]);(0,r.useEffect)(()=>{h();let e=null;!l&&u?.waitForTarget&&(d.current=new MutationObserver(()=>{let t=x();t&&(i(t.getBoundingClientRect()),c(!0),d.current?.disconnect(),e&&clearTimeout(e))}),d.current.observe(document.body,{childList:!0,subtree:!0}),e=setTimeout(()=>{!x()&&(n(e=>{let t=e+1;return t<e5.length?t:e}),a>=e5.length-1&&m())},5e3));let t=()=>h();return window.addEventListener("resize",t),window.addEventListener("scroll",t,!0),()=>{d.current?.disconnect(),e&&clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("scroll",t,!0)}},[a,u,x,h,l,m]),(0,r.useEffect)(()=>{let e=setInterval(h,1e3);return()=>clearInterval(e)},[h]);let p=(0,r.useCallback)(()=>{a<e5.length-1?(n(e=>e+1),c(!1)):m()},[a]);return u?(0,t.jsx)(t.Fragment,{children:l&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 z-[10000]",style:{background:`radial-gradient(
|
|
2
|
-
ellipse at ${o.left+o.width/2}px ${o.top+o.height/2}px,
|
|
3
|
-
transparent ${Math.max(o.width,o.height)}px,
|
|
4
|
-
rgba(0,0,0,0.6) ${Math.max(o.width,o.height)+30}px
|
|
5
|
-
)`},onClick:p}),(0,t.jsx)("div",{className:"pointer-events-none fixed z-[10001] rounded-lg ring-2 ring-amber-400 ring-offset-2 ring-offset-background",style:{left:o.left-4,top:o.top-4,width:o.width+8,height:o.height+8}}),(0,t.jsxs)("div",{className:"fixed z-[10002] w-72 rounded-xl border border-border bg-card p-4 shadow-2xl",style:(()=>{if(!o)return{display:"none"};let e={position:"fixed",zIndex:10001};switch(u.placement){case"right":e.left=o.right+12,e.top=o.top+o.height/2,e.transform="translateY(-50%)";break;case"bottom":e.left=o.left+o.width/2,e.top=o.bottom+12,e.transform="translateX(-50%)";break;case"left":e.right=window.innerWidth-o.left+12,e.top=o.top+o.height/2,e.transform="translateY(-50%)";break;case"top":e.left=o.left+o.width/2,e.bottom=window.innerHeight-o.top+12,e.transform="translateX(-50%)"}return e})(),children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:s(u.titleKey)}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground leading-relaxed",children:s(u.descKey)})]}),(0,t.jsx)("button",{onClick:m,className:"shrink-0 rounded-md p-1 text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,t.jsx)(eb.X,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex gap-1",children:e5.map((e,r)=>(0,t.jsx)("div",{className:`h-1.5 w-1.5 rounded-full ${r===a?"bg-amber-400":r<a?"bg-amber-400/40":"bg-muted"}`},r))}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(v.Button,{variant:"ghost",className:"h-7 px-2 text-xs text-muted-foreground",onClick:m,children:s("tour.skip")}),(0,t.jsx)(v.Button,{className:"h-7 px-3 text-xs bg-amber-500/15 text-amber-300 ring-1 ring-amber-500/25 hover:bg-amber-500/25",onClick:p,children:s(a<e5.length-1?"tour.next":"tour.done")})]})]})]})]})}):null}function e3({workspaces:e,isFirstRun:a,username:n,children:o,handleCreateProject:i}){let l=(0,s.usePathname)(),c=(0,s.useRouter)(),{isOpen:d,displayMode:u,closeAssistant:m}=(0,eT.useAssistant)();(0,r.useEffect)(()=>{a&&!l.startsWith("/onboarding")&&c.replace("/onboarding")},[a,l,c]);let[x,h]=(0,r.useState)(!1),[p,f]=(0,r.useState)(!1);(0,r.useEffect)(()=>{a||l.startsWith("/onboarding")||(0,ew.getConfigValue)("onboarding.tourCompleted",!1).then(e=>{e?f(!0):h(!0)})},[a,l]);let g=()=>{h(!1),f(!0)},[b,v]=(0,r.useState)(!0);(0,r.useEffect)(()=>{(0,ew.getConfigValue)("notification.enabled",!0).then(v)},[]);let w=l.startsWith("/onboarding");if(!function(e){let t=(0,s.useRouter)(),a=(0,r.useRef)(t),n=(0,r.useRef)(e),{t:o}=(0,M.useI18n)(),i=(0,r.useRef)(o);a.current=t,n.current=e,i.current=o,(0,r.useEffect)(()=>{if(!e)return;let t=null,r=null,s=!1;async function o(){if(s)return;let e=await (0,e1.getActualWsPort)();s||((t=new WebSocket(`ws://localhost:${e}/terminal?taskId=__notifications__`)).onmessage=e=>{if(n.current)try{let t=JSON.parse(e.data);if("type"in t&&"stop"===t.type)R.toast.success(t.taskTitle,{description:i.current("notification.taskCompleted"),duration:8e3});else if("Notification"in window&&"granted"===window.Notification.permission){let e=new window.Notification("Tower",{body:t.taskTitle,icon:"/web-app-manifest-192x192.png"});e.onclick=()=>{window.focus(),a.current.push(`/workspaces/${t.workspaceId}/tasks/${t.taskId}`),e.close()}}else R.toast.info(t.taskTitle,{description:"COMPLETED"===t.status?i.current("notification.taskCompleted"):i.current("notification.taskFailed")})}catch{}},t.onclose=()=>{s||(r=setTimeout(o,5e3))},t.onerror=()=>{t?.close()})}return o(),()=>{s=!0,r&&clearTimeout(r),t?.close()}},[e])}(b&&!w),w)return(0,t.jsx)(t.Fragment,{children:o});let N=/\/workspaces\/[^/]+\/tasks\/[^/]+/.test(l),y=/\/workspaces\/[^/]+\/(notes|assets|archive)/.test(l),k=d&&"sidebar"===u?(0,t.jsx)(eZ,{mode:"sidebar"}):null,C="dialog"===u?(0,t.jsx)(j.Dialog,{open:d,onOpenChange:e=>{e||m()},children:(0,t.jsx)(j.DialogContent,{showCloseButton:!1,style:{width:"90vw",minWidth:"360px",maxWidth:"600px",height:"70vh",minHeight:"480px",maxHeight:"800px",padding:0},children:(0,t.jsx)(eZ,{mode:"dialog"})})}):null;return N||y?(0,t.jsxs)(t.Fragment,{children:[p&&(0,t.jsx)(e0,{onDismiss:()=>f(!1)}),(0,t.jsx)("div",{className:"flex h-screen overflow-hidden",children:(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(eK,{onCreateProject:i,username:n}),(0,t.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[k,(0,t.jsx)("main",{className:"flex-1 overflow-hidden bg-background",children:(0,t.jsx)(eq.ErrorBoundary,{children:o})})]})]})}),C,x&&(0,t.jsx)(e4,{onComplete:g})]}):(0,t.jsxs)(t.Fragment,{children:[p&&(0,t.jsx)(e0,{onDismiss:()=>f(!1)}),(0,t.jsxs)("div",{className:"flex h-screen overflow-hidden",children:[(0,t.jsx)(O,{workspaces:e}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col overflow-hidden",children:[(0,t.jsx)(eK,{onCreateProject:i,username:n}),(0,t.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[k,(0,t.jsx)("main",{className:"flex-1 overflow-auto bg-background",children:(0,t.jsx)(eq.ErrorBoundary,{children:o})})]})]})]}),C,x&&(0,t.jsx)(e4,{onComplete:g})]})}e.s(["LayoutClient",0,function({workspaces:e,isFirstRun:r,username:a,children:n}){let o=(0,s.useRouter)(),i=(0,s.usePathname)(),l=i.split("/workspaces/")[1]?.split("/")[0],c=async t=>{let r=l||(e.length>0?e[0].id:null);if(!r){let e=await y({name:"Default Workspace"}),r=await (0,eX.createProject)({...t,workspaceId:e.id});return o.refresh(),o.push(`/workspaces/${e.id}`),{id:r.id}}let s=await (0,eX.createProject)({...t,workspaceId:r});return o.refresh(),o.push(`/workspaces/${r}`),{id:s.id}};return(0,t.jsx)(eT.AssistantProvider,{children:(0,t.jsx)(eV.TerminalPortalProvider,{children:(0,t.jsx)(e3,{workspaces:e,isFirstRun:r,username:a,handleCreateProject:c,children:n})})})}],914935)},782406,e=>{"use strict";var t=e.i(289721),r=e.i(821957);e.s(["ThemeProvider",0,function({children:e,...s}){return(0,t.jsx)(r.ThemeProvider,{...s,children:e})}])},713354,e=>{"use strict";var t=e.i(289721),r=e.i(821957),s=e.i(360112),a=e.i(59737),a=a,n=e.i(756502),n=n,o=e.i(567098),o=o;let i=(0,e.i(572989).default)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var l=e.i(519587),l=l;e.s(["Toaster",0,({...e})=>{let{theme:c="system"}=(0,r.useTheme)();return(0,t.jsx)(s.Toaster,{theme:c,className:"toaster group",icons:{success:(0,t.jsx)(a.default,{className:"size-4"}),info:(0,t.jsx)(n.default,{className:"size-4"}),warning:(0,t.jsx)(o.default,{className:"size-4"}),error:(0,t.jsx)(i,{className:"size-4"}),loading:(0,t.jsx)(l.default,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},toastOptions:{classNames:{toast:"cn-toast"}},...e})}],713354)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69466,e=>{"use strict";e.s([],386333),e.i(386333),e.i(173438),e.i(195719),e.i(717846),e.i(199941),e.i(528152),e.i(757824),e.i(241607),e.i(966494),e.i(448911),e.i(102404);var i=e.i(514798);let r=(0,i.createServerReference)("604bab1d97be03c881acda381e226abd8cc348b74b",i.callServer,void 0,i.findSourceMapURL,"revealInFinder");e.s(["revealInFinder",0,r],69466)}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|