commandmate 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +103 -103
- package/.next/app-path-routes-manifest.json +19 -19
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +12 -12
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route.js +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/conversation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/start/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/assistant/tools/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/start-polling/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/chat/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +2 -2
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +19 -19
- package/.next/server/chunks/3753.js +5 -5
- package/.next/server/chunks/5959.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{6488-d6b669a092a9aeb5.js → 6488-8819e6905355caea.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/{page-c6d64057df3a13d8.js → page-6105a3470b279527.js} +1 -1
- package/.next/trace +10 -10
- package/dist/server/src/lib/db/chat-db.js +50 -23
- package/package.json +1 -1
- /package/.next/static/{Xv8eF6ls3LFny16ZGj4Ij → i8mdUwheg9j9sU_lI_ZSf}/_buildManifest.js +0 -0
- /package/.next/static/{Xv8eF6ls3LFny16ZGj4Ij → i8mdUwheg9j9sU_lI_ZSf}/_ssgManifest.js +0 -0
|
@@ -27,7 +27,7 @@ document.addEventListener('click', function(e) {
|
|
|
27
27
|
${a("git.aiPrompts.stashCleanupCurrent")}
|
|
28
28
|
${d}`}(s,a))}),(0,e.jsx)("button",{type:"button",onClick:j,className:"p-1 text-muted-foreground hover:text-foreground rounded","aria-label":s("git.stash.refresh"),children:(0,e.jsx)(d5,{})})]})]}),u&&(0,e.jsxs)("div",{className:"px-3 pb-3 space-y-2",children:[c&&(0,e.jsx)("div",{className:"text-xs text-danger-foreground",role:"alert","data-testid":"git-stash-error",children:c}),f&&(0,e.jsx)("div",{className:"text-xs text-danger-foreground",role:"alert","data-testid":"git-stash-action-error",children:f}),g&&(0,e.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,e.jsx)("div",{className:"text-xs text-warning-foreground",role:"status","data-testid":"git-stash-conflict",children:g}),r&&(0,e.jsx)(d6,{className:"shrink-0",testId:"stash-conflict-ask-ai",onClick:()=>r(function(a,b){let c=a("git.aiPrompts.stashConflict");return b&&b.trim().length>0?`${c}
|
|
29
29
|
|
|
30
|
-
${b.trim()}`:c}(s,g))})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:s("git.stash.messagePlaceholder"),className:"w-full px-2 py-1 text-xs border border-input rounded bg-surface dark:bg-surface-2 text-foreground","data-testid":"git-stash-push-message"}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,e.jsx)(n.Sc,{checked:y,onCheckedChange:a=>z(!0===a),"data-testid":"git-stash-include-untracked"}),s("git.stash.includeUntracked")]}),(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>{l(w,y),x(""),z(!1)},className:"px-2 py-1 text-xs rounded bg-accent-600 hover:bg-accent-700 text-white disabled:opacity-50","data-testid":"stash-push-button",children:s("git.stash.push")})]})]}),b?(0,e.jsx)("div",{className:"py-3 text-center text-xs text-muted-foreground",role:"status",children:s("git.stash.loading")}):0===a.length?(0,e.jsx)("div",{className:"py-3 text-center text-xs text-muted-foreground",children:s("git.stash.empty")}):(0,e.jsx)("ul",{className:"divide-y divide-border",children:a.map(a=>(0,e.jsx)("li",{className:"py-1.5","data-testid":"git-stash-row",children:(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("span",{className:"font-mono text-xs text-accent-600 dark:text-accent-400",children:["stash@","{",a.index,"}"]}),(0,e.jsx)("span",{className:"ml-2 text-xs text-foreground truncate",children:a.message})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>o(a.index),className:"px-1.5 py-0.5 text-xs rounded border border-input hover:bg-muted disabled:opacity-50","data-testid":"stash-apply-button",children:s("git.stash.apply")}),(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>m(a.index),className:"px-1.5 py-0.5 text-xs rounded border border-input hover:bg-muted disabled:opacity-50","data-testid":"stash-pop-button",children:s("git.stash.pop")}),(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>B(a.index),className:"px-1.5 py-0.5 text-xs rounded border border-danger-border text-danger-foreground hover:bg-danger-subtle disabled:opacity-50","data-testid":"stash-drop-button",children:s("git.stash.drop")})]})]})},a.index))})]}),null!==A&&(0,e.jsxs)("div",{className:"px-3 py-3 border-t border-danger-border bg-danger-subtle","data-testid":"git-stash-drop-confirm",role:"dialog",children:[(0,e.jsxs)("p",{className:"text-xs text-danger-foreground",children:["stash@","{",A,"}",s("git.stash.dropConfirmSuffix")]}),i&&(0,e.jsx)("p",{className:"mt-1 text-xs text-danger-foreground","data-testid":"git-stash-drop-session-warning",children:s("git.danger.runningSessionWarning")}),(0,e.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>{p(A),B(null)},className:"px-2 py-1 text-xs rounded bg-danger hover:bg-danger/90 text-white disabled:opacity-50","data-testid":"git-stash-drop-confirm-button",children:s("git.stash.drop")}),(0,e.jsx)("button",{type:"button",onClick:()=>B(null),className:"px-2 py-1 text-xs rounded border border-input hover:bg-muted",children:t("cancel")})]})]})]})}),ei={soft:"git.danger.modeSoft",mixed:"git.danger.modeMixed",hard:"git.danger.modeHard"},ej=(0,h.memo)(function({selectedCommit:a,busy:b,actionError:c,conflictNotice:d,currentBranch:f,aheadCount:g,hasRunningSession:i,onReset:j,onRevert:l,onForcePush:m}){let{isMobile:o,onInsertToMessage:p}=d$(),q=(0,k.c)("worktree"),r=(0,k.c)("common"),[s,t]=(0,h.useState)(!1),[u,v]=(0,h.useState)("mixed"),[w,x]=(0,h.useState)(!0),[y,z]=(0,h.useState)(""),[A,B]=(0,h.useState)(!1),[C,D]=(0,h.useState)(!1),[E,F]=(0,h.useState)(!1),[G,H]=(0,h.useState)(!1),[I,J]=(0,h.useState)(!0),K=w?"HEAD":a,L=!w&&!a;return(0,e.jsxs)("div",{className:"border-t-2 border-danger-border","data-testid":"git-danger-zone-section",children:[(0,e.jsxs)("button",{type:"button",onClick:()=>t(a=>!a),className:"w-full flex items-center gap-1 px-3 py-2 text-sm font-medium text-danger-foreground bg-danger-subtle cursor-pointer hover:bg-danger-subtle","data-testid":"git-danger-zone-toggle",children:[(0,e.jsx)("span",{className:"text-xs w-4 text-center",children:s?"▼":"▶"}),q("git.danger.title")]}),s&&(0,e.jsxs)("div",{className:"px-3 py-3 space-y-2 bg-danger-subtle",children:[c&&(0,e.jsx)("div",{className:"text-xs text-danger-foreground",role:"alert","data-testid":"git-danger-zone-error",children:c}),d&&(0,e.jsx)("div",{className:"text-xs text-warning-foreground",role:"status","data-testid":"git-danger-zone-conflict",children:d}),(0,e.jsxs)("div",{className:`flex ${o?"flex-col":"flex-row"} gap-2`,children:[(0,e.jsx)("button",{type:"button",onClick:()=>B(!0),className:"px-2 py-1 text-xs rounded border border-danger-border text-danger-foreground hover:bg-danger-subtle","data-testid":"git-danger-zone-reset-open",children:q("git.danger.resetOpen")}),(0,e.jsx)("button",{type:"button",disabled:!a,onClick:()=>D(!0),className:"px-2 py-1 text-xs rounded border border-danger-border text-danger-foreground hover:bg-danger-subtle disabled:opacity-50","data-testid":"git-danger-zone-revert-open",children:q("git.danger.revertOpen")}),m&&(0,e.jsx)("button",{type:"button",disabled:b,onClick:()=>H(!0),className:"px-2 py-1 text-xs rounded border border-danger-border text-danger-foreground hover:bg-danger-subtle disabled:opacity-50","data-testid":"git-force-push-open",children:q("git.danger.forcePushOpen")})]}),!a&&(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:q("git.danger.selectCommitHint")})]}),A&&(0,e.jsxs)("div",{className:"px-3 py-3 border-t border-danger-border bg-danger-subtle","data-testid":"reset-confirm",role:"dialog",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-danger-foreground mb-2",children:q("git.danger.resetTitle")}),(0,e.jsxs)(n.z6,{value:w?"head":"commit",onValueChange:a=>x("head"===a),name:"reset-target",className:"flex flex-col gap-1 mb-2",children:[(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground",children:[(0,e.jsx)(n.CU,{value:"head","data-testid":"reset-target-head"}),q("git.danger.resetTargetHead")]}),(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground",children:[(0,e.jsx)(n.CU,{value:"commit",disabled:!a,"data-testid":"reset-target-commit"}),q("git.danger.resetTargetSelectedPrefix"),a?q("git.danger.resetTargetSelectedHash",{hash:a.slice(0,7)}):q("git.danger.resetTargetNoneSelected")]})]}),(0,e.jsx)(n.z6,{value:u,onValueChange:a=>v(a),name:"reset-mode",className:"flex flex-col gap-1 mb-2",children:["soft","mixed","hard"].map(a=>(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground",children:[(0,e.jsx)(n.CU,{value:a,"data-testid":`reset-mode-${a}`}),q(ei[a])]},a))}),"hard"===u&&(0,e.jsxs)("div",{className:"mb-2 space-y-1",children:[(0,e.jsx)("p",{className:"text-xs text-danger-foreground","data-testid":"reset-hard-history-loss-warning",children:q("git.danger.resetHardWarning")}),i&&(0,e.jsx)("p",{className:"text-xs text-danger-foreground","data-testid":"reset-hard-session-warning",children:q("git.danger.runningSessionWarning")}),(0,e.jsx)("input",{type:"text",value:y,onChange:a=>z(a.target.value),placeholder:q("git.danger.confirmPlaceholder",{branch:f??""}),className:"w-full px-2 py-1 text-xs border border-danger-border rounded bg-surface dark:bg-surface-2 text-foreground","data-testid":"reset-hard-branch-input"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[p&&(0,e.jsx)(d6,{className:"mr-auto",testId:"reset-ask-ai",disabled:L,onClick:()=>{K&&(p("hard"===u?q("git.aiPrompts.resetHard",{target:ee(K)}):q("git.aiPrompts.reset",{target:ee(K),mode:u})),B(!1),z(""))}}),(0,e.jsx)("button",{type:"button",disabled:b||L||"hard"===u&&y!==(f??""),onClick:()=>{K&&(j(K,u,"hard"===u?y:void 0),B(!1),z(""))},className:"px-2 py-1 text-xs rounded bg-danger hover:bg-danger/90 text-white disabled:opacity-50","data-testid":"reset-confirm-button",children:q("git.danger.reset")}),(0,e.jsx)("button",{type:"button",onClick:()=>{B(!1),z("")},className:"px-2 py-1 text-xs rounded border border-border hover:bg-muted",children:r("cancel")})]})]}),C&&a&&(0,e.jsxs)("div",{className:"px-3 py-3 border-t border-danger-border bg-danger-subtle","data-testid":"revert-confirm",role:"dialog",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-danger-foreground mb-2",children:q("git.danger.revertTitle")}),(0,e.jsxs)("p",{className:"text-xs text-foreground mb-2",children:[q("git.danger.revertBodyPrefix"),(0,e.jsx)("span",{className:"font-mono",children:a.slice(0,7)})]}),i&&(0,e.jsx)("p",{className:"mb-2 text-xs text-danger-foreground","data-testid":"revert-session-warning",children:q("git.danger.runningSessionWarning")}),(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground mb-2",children:[(0,e.jsx)(n.Sc,{checked:E,onCheckedChange:a=>F(!0===a),"data-testid":"revert-no-commit"}),q("git.danger.revertNoCommit")]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[p&&(0,e.jsx)(d6,{className:"mr-auto",testId:"revert-ask-ai",onClick:()=>{p(q("git.aiPrompts.revert",{commit:ee(a.slice(0,7))})),D(!1),F(!1)}}),(0,e.jsx)("button",{type:"button",disabled:b,onClick:()=>{l(a,E),D(!1),F(!1)},className:"px-2 py-1 text-xs rounded bg-danger hover:bg-danger/90 text-white disabled:opacity-50","data-testid":"revert-confirm-button",children:q("git.danger.revert")}),(0,e.jsx)("button",{type:"button",onClick:()=>{D(!1),F(!1)},className:"px-2 py-1 text-xs rounded border border-border hover:bg-muted",children:r("cancel")})]})]}),G&&m&&(0,e.jsxs)("div",{className:"px-3 py-3 border-t border-danger-border bg-danger-subtle","data-testid":"force-push-confirm",role:"dialog",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-danger-foreground mb-2",children:q("git.danger.forcePushTitle")}),(0,e.jsx)("p",{className:"mb-2 text-xs text-danger-foreground","data-testid":"force-push-protected-branch-warning",children:q("git.danger.protectedBranchWarning")}),i&&(0,e.jsx)("p",{className:"mb-2 text-xs text-danger-foreground","data-testid":"force-push-session-warning",children:q("git.danger.runningSessionWarning")}),(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground mb-2",children:[(0,e.jsx)(n.Sc,{checked:I,onCheckedChange:a=>J(!0===a),"data-testid":"force-push-with-lease"}),q("git.danger.forceWithLease")]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[p&&(0,e.jsx)(d6,{className:"mr-auto",testId:"force-push-ask-ai",onClick:()=>{p(function(a,{branch:b,ahead:c}){let d=b?ee(b):a("git.aiPrompts.forcePushCurrentBranch");return a("number"==typeof c&&c>0?"git.aiPrompts.forcePushAhead":"git.aiPrompts.forcePush",{branchRef:d,upstream:ee(`origin/${b??"<branch>"}`),ahead:c??0})}(q,{branch:f,ahead:g??null})),H(!1)}}),(0,e.jsx)("button",{type:"button",disabled:b,onClick:()=>{m(I),H(!1)},className:"px-2 py-1 text-xs rounded bg-danger hover:bg-danger/90 text-white disabled:opacity-50","data-testid":"force-push-confirm-button",children:q("git.danger.forcePush")}),(0,e.jsx)("button",{type:"button",onClick:()=>H(!1),className:"px-2 py-1 text-xs rounded border border-border hover:bg-muted",children:r("cancel")})]})]})]})}),ek=(0,h.memo)(function({worktreeId:a,onDiffSelect:b,isMobile:c=!1,worktree:d,onInsertToMessage:f,className:g=""}){let i=(0,k.c)("worktree"),{activeTab:j,setActiveTab:l,historyOpen:m,toggleHistory:o,advancedOpen:p,toggleAdvanced:q}=function(){let{value:a,setValue:b,isAvailable:c}=(0,dP.V)({key:dS.activeTab,defaultValue:"status",validate:dT}),{value:d,setValue:e}=(0,dP.V)({key:dS.historyOpen,defaultValue:!0,validate:dU}),{value:f,setValue:g}=(0,dP.V)({key:dS.advancedOpen,defaultValue:!1,validate:dU}),i=(0,h.useCallback)(a=>b(a),[b]);return{activeTab:a,setActiveTab:i,historyOpen:d,toggleHistory:(0,h.useCallback)(()=>e(a=>!a),[e]),advancedOpen:f,toggleAdvanced:(0,h.useCallback)(()=>g(a=>!a),[g]),isPersistent:c}}(),r=Object.values(d?.sessionStatusByCli??{}).some(a=>a?.isRunning===!0),{gitStatus:s,statusLoading:t,statusError:u,fetchStatus:v}=function(a){let[b,c]=(0,h.useState)(null),[d,e]=(0,h.useState)(!0),[f,g]=(0,h.useState)(null);return{gitStatus:b,statusLoading:d,statusError:f,fetchStatus:(0,h.useCallback)(async()=>{g(null);try{let b=await fetch(`/api/worktrees/${a}/git/status`);if(!b.ok){let a=await b.json().catch(()=>({}));g(a.error||"Failed to fetch git status");return}let d=await b.json();c(d)}catch{g("Failed to fetch git status")}finally{e(!1)}},[a])}}(a),{commits:w,selectedCommit:x,changedFiles:y,inlineDiffCommit:z,inlineFiles:A,inlineFilesLoading:B,inlineFilesError:C,selectedFile:D,diffContent:E,isLoading:F,isLoadingFiles:G,isLoadingDiff:H,commitError:I,detailError:J,setDiffContent:K,fetchCommits:L,handleCommitSelect:M,handleFileSelect:N,handleToggleInlineDiff:O,handleInlineDiffFile:P,handleRefresh:Q}=function(a,b){let[c,d]=(0,h.useState)([]),[e,f]=(0,h.useState)(null),[g,i]=(0,h.useState)([]),[j,k]=(0,h.useState)(null),[l,m]=(0,h.useState)([]),[n,o]=(0,h.useState)(!1),[p,q]=(0,h.useState)(null),[r,s]=(0,h.useState)(null),[t,u]=(0,h.useState)(null),[v,w]=(0,h.useState)(!0),[x,y]=(0,h.useState)(!1),[z,A]=(0,h.useState)(!1),[B,C]=(0,h.useState)(null),[D,E]=(0,h.useState)(null),F=(0,h.useCallback)(async()=>{w(!0),C(null);try{let b=await fetch(`/api/worktrees/${a}/git/log`);if(!b.ok){let a=await b.json();C(a.error||"Failed to fetch commit history");return}let c=await b.json();d(c.commits)}catch{C("Failed to fetch commit history")}finally{w(!1)}},[a]),G=(0,h.useCallback)(async b=>{y(!0),i([]),s(null),u(null),E(null);try{let c=await fetch(`/api/worktrees/${a}/git/show/${b}`);if(!c.ok){let a=await c.json();E(a.error||"Failed to fetch commit details");return}let d=await c.json();i(d.files)}catch{E("Failed to fetch commit details")}finally{y(!1)}},[a]),H=(0,h.useCallback)(async(c,d)=>{A(!0),u(null),E(null);try{let e=await fetch(`/api/worktrees/${a}/git/diff?commit=${c}&file=${encodeURIComponent(d)}`);if(!e.ok){let a=await e.json();E(a.error||"Failed to fetch diff");return}let f=await e.json();u(f.diff),b(f.diff,d)}catch{E("Failed to fetch diff")}finally{A(!1)}},[a,b]),I=(0,h.useCallback)(a=>{f(a),G(a)},[G]),J=(0,h.useCallback)(a=>{e&&(s(a),H(e,a))},[e,H]),K=(0,h.useCallback)(async b=>{if(j===b){k(null),m([]),q(null);return}k(b),m([]),q(null),o(!0);try{let c=await fetch(`/api/worktrees/${a}/git/show/${b}`);if(!c.ok){let a=await c.json().catch(()=>({}));q(a.error||"Failed to fetch commit details");return}let d=await c.json();m(Array.isArray(d.files)?d.files:[])}catch{q("Failed to fetch commit details")}finally{o(!1)}},[a,j]),L=(0,h.useCallback)((a,b)=>{f(a),s(b),i(l),H(a,b)},[l,H]),M=(0,h.useCallback)(()=>{f(null),i([]),s(null),u(null),E(null),F()},[F]);return{commits:c,selectedCommit:e,changedFiles:g,inlineDiffCommit:j,inlineFiles:l,inlineFilesLoading:n,inlineFilesError:p,selectedFile:r,diffContent:t,isLoading:v,isLoadingFiles:x,isLoadingDiff:z,commitError:B,detailError:D,setDiffContent:u,fetchCommits:F,handleCommitSelect:I,handleFileSelect:J,handleToggleInlineDiff:K,handleInlineDiffFile:L,handleRefresh:M}}(a,b),R=(0,h.useCallback)(async()=>{await L(),await v()},[L,v]),{staged:S,stagedLoading:T,stagedError:U,opBusy:V,commitMessage:W,setCommitMessage:X,amend:Y,setAmend:Z,committing:$,changesCommitError:_,fetchStaged:aa,handleStage:ab,handleUnstage:ac,handleChangesDiff:ad,fetchWorkingDiffText:ae,commit:af,commitAndPush:ag}=function(a,b){let{onWorkingDiff:c,onCommitted:d}=b,[e,f]=(0,h.useState)(null),[g,i]=(0,h.useState)(!0),[j,k]=(0,h.useState)(null),[l,m]=(0,h.useState)(!1),[n,o]=(0,h.useState)(""),[p,q]=(0,h.useState)(!1),[r,s]=(0,h.useState)(!1),[t,u]=(0,h.useState)(null),v=(0,h.useCallback)(async()=>{k(null);try{let b=await fetch(`/api/worktrees/${a}/git/staged`);if(!b.ok){let a=await b.json().catch(()=>({}));k(a.error||"Failed to fetch changes");return}let c=await b.json();f(c)}catch{k("Failed to fetch changes")}finally{i(!1)}},[a]),w=(0,h.useCallback)(async b=>{m(!0),k(null);try{let c=await fetch(`/api/worktrees/${a}/git/stage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:[b]})});if(!c.ok){let a=await c.json().catch(()=>({}));k(a.error||"Failed to stage file");return}await v()}catch{k("Failed to stage file")}finally{m(!1)}},[a,v]),x=(0,h.useCallback)(async b=>{m(!0),k(null);try{let c=await fetch(`/api/worktrees/${a}/git/unstage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:[b]})});if(!c.ok){let a=await c.json().catch(()=>({}));k(a.error||"Failed to unstage file");return}await v()}catch{k("Failed to unstage file")}finally{m(!1)}},[a,v]),y=(0,h.useCallback)(async()=>{u(null);try{let b=await fetch(`/api/worktrees/${a}/git/commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n,amend:p})});if(!b.ok){let a=await b.json().catch(()=>({}));return u(a.error||"Failed to commit"),!1}return o(""),q(!1),await v(),await d(),!0}catch{return u("Failed to commit"),!1}},[a,n,p,v,d]),z=(0,h.useCallback)(async()=>{s(!0);try{await y()}finally{s(!1)}},[y]),A=(0,h.useCallback)(async a=>{s(!0);try{await y()&&await a()}finally{s(!1)}},[y]);return{staged:e,stagedLoading:g,stagedError:j,opBusy:l,commitMessage:n,setCommitMessage:o,amend:p,setAmend:q,committing:r,changesCommitError:t,fetchStaged:v,handleStage:w,handleUnstage:x,handleChangesDiff:(0,h.useCallback)(async(b,d)=>{try{let e=await fetch(`/api/worktrees/${a}/git/working-diff?file=${encodeURIComponent(b)}&mode=${d}`);if(!e.ok)return;let f=await e.json();"string"==typeof f.diff&&c(f.diff,b)}catch{}},[a,c]),fetchWorkingDiffText:(0,h.useCallback)(async(b,c)=>{try{let d=await fetch(`/api/worktrees/${a}/git/working-diff?file=${encodeURIComponent(b)}&mode=${c}`);if(!d.ok)return null;let e=await d.json();return"string"==typeof e.diff?e.diff:null}catch{return null}},[a]),commit:z,commitAndPush:A}}(a,{onWorkingDiff:(0,h.useCallback)((a,c)=>{K(a),b(a,c)},[K,b]),onCommitted:R}),{branches:ah,branchInclude:ai,branchesLoading:aj,branchesError:ak,branchBusy:al,branchActionError:am,fetchBranches:an,handleBranchIncludeChange:ao,handleBranchesRefresh:ap,handleCheckout:aq,handleBranchCreate:ar,handleBranchDelete:as}=function(a,b){let{onCheckoutCascade:c}=b,[d,e]=(0,h.useState)([]),[f,g]=(0,h.useState)("local"),[i,j]=(0,h.useState)(!0),[k,l]=(0,h.useState)(null),[m,n]=(0,h.useState)(!1),[o,p]=(0,h.useState)(null),q=(0,h.useCallback)(async b=>{l(null);try{let c=await fetch(`/api/worktrees/${a}/git/branches?include=${b}`);if(!c.ok){let a=await c.json().catch(()=>({}));l(a.error||"Failed to fetch branches");return}let d=await c.json();e(Array.isArray(d.branches)?d.branches:[])}catch{l("Failed to fetch branches")}finally{j(!1)}},[a]),r=(0,h.useCallback)(a=>{g(a)},[]),s=(0,h.useCallback)(()=>{q(f)},[q,f]),t=(0,h.useCallback)(async(b,d)=>{n(!0),p(null);try{let e=await fetch(`/api/worktrees/${a}/git/checkout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:b.name,force:d})});if(!e.ok){let a=await e.json().catch(()=>({}));p(a.error||"Failed to checkout branch");return}await Promise.all([c(),q(f)])}catch{p("Failed to checkout branch")}finally{n(!1)}},[a,f,c,q]),u=(0,h.useCallback)(async(b,c)=>{n(!0),p(null);try{let d=await fetch(`/api/worktrees/${a}/git/branch/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b,from:c})});if(!d.ok){let a=await d.json().catch(()=>({}));p(a.error||"Failed to create branch");return}await q(f)}catch{p("Failed to create branch")}finally{n(!1)}},[a,f,q]),v=(0,h.useCallback)(async(b,c)=>{n(!0),p(null);try{let d=await fetch(`/api/worktrees/${a}/git/branch/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b,force:c})});if(!d.ok){let a=await d.json().catch(()=>({}));p(a.error||"Failed to delete branch");return}await q(f)}catch{p("Failed to delete branch")}finally{n(!1)}},[a,f,q]);return{branches:d,branchInclude:f,branchesLoading:i,branchesError:k,branchBusy:m,branchActionError:o,fetchBranches:q,handleBranchIncludeChange:r,handleBranchesRefresh:s,handleCheckout:t,handleBranchCreate:u,handleBranchDelete:v}}(a,{onCheckoutCascade:(0,h.useCallback)(async()=>{await Promise.all([v(),aa(),L()])},[v,aa,L])}),{stashes:at,stashLoading:au,stashError:av,stashBusy:aw,stashActionError:ax,stashConflictNotice:ay,fetchStash:az,handleStashPush:aA,handleStashPop:aB,handleStashApply:aC,handleStashDrop:aD}=function(a,b){let{onStashMutated:c}=b,[d,e]=(0,h.useState)([]),[f,g]=(0,h.useState)(!0),[i,j]=(0,h.useState)(null),[k,l]=(0,h.useState)(!1),[m,n]=(0,h.useState)(null),[o,p]=(0,h.useState)(null),q=(0,h.useCallback)(async()=>{j(null);try{let b=await fetch(`/api/worktrees/${a}/git/stash`);if(!b.ok){let a=await b.json().catch(()=>({}));j(a.error||"Failed to fetch stashes");return}let c=await b.json();e(Array.isArray(c.stashes)?c.stashes:[])}catch{j("Failed to fetch stashes")}finally{g(!1)}},[a]),r=(0,h.useCallback)(async()=>{await Promise.all([q(),c()])},[q,c]),s=(0,h.useCallback)(async(a,b,c)=>{l(!0),n(null),p(null);try{let d=await fetch(a,b),e=await d.json().catch(()=>({}));if(!d.ok)return void n(e.error||c);if(e.conflict){let a=Array.isArray(e.conflictFiles)?e.conflictFiles.join(", "):"",b=e.stashRetained?" (stash retained)":"";p(`Stash operation produced conflicts: ${a}${b}`)}await r()}catch{n(c)}finally{l(!1)}},[r]),t=(0,h.useCallback)((b,c)=>{s(`/api/worktrees/${a}/git/stash/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:b||void 0,includeUntracked:c})},"Failed to stash changes")},[a,s]),u=(0,h.useCallback)(b=>{s(`/api/worktrees/${a}/git/stash/pop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:b})},"Failed to pop stash")},[a,s]);return{stashes:d,stashLoading:f,stashError:i,stashBusy:k,stashActionError:m,stashConflictNotice:o,fetchStash:q,handleStashPush:t,handleStashPop:u,handleStashApply:(0,h.useCallback)(b=>{s(`/api/worktrees/${a}/git/stash/apply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:b})},"Failed to apply stash")},[a,s]),handleStashDrop:(0,h.useCallback)(b=>{s(`/api/worktrees/${a}/git/stash/${b}`,{method:"DELETE"},"Failed to drop stash")},[a,s])}}(a,{onStashMutated:(0,h.useCallback)(async()=>{await Promise.all([v(),aa()])},[v,aa])}),{dangerBusy:aE,dangerActionError:aF,dangerConflictNotice:aG,handleReset:aH,handleRevert:aI}=function(a,b){let{onHeadMoved:c}=b,[d,e]=(0,h.useState)(!1),[f,g]=(0,h.useState)(null),[i,j]=(0,h.useState)(null);return{dangerBusy:d,dangerActionError:f,dangerConflictNotice:i,handleReset:(0,h.useCallback)(async(b,d,f)=>{e(!0),g(null),j(null);try{let e=await fetch(`/api/worktrees/${a}/git/reset`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:b,mode:d,confirmBranch:f})});if(!e.ok){let a=await e.json().catch(()=>({}));g(a.error||"Failed to reset");return}await c()}catch{g("Failed to reset")}finally{e(!1)}},[a,c]),handleRevert:(0,h.useCallback)(async(b,d)=>{e(!0),g(null),j(null);try{let e=await fetch(`/api/worktrees/${a}/git/revert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitHash:b,noCommit:d})});if(!e.ok){let a=await e.json().catch(()=>({}));g(a.error||"Failed to revert");return}let f=await e.json().catch(()=>({}));if(f.conflict){let a=Array.isArray(f.conflictFiles)?f.conflictFiles.join(", "):"";j(`Revert produced conflicts: ${a}`)}await c()}catch{g("Failed to revert")}finally{e(!1)}},[a,c])}}(a,{onHeadMoved:(0,h.useCallback)(async()=>{await Promise.all([v(),aa(),an(ai),L()])},[v,aa,an,ai,L])}),{operation:aJ,progressState:aK,error:aL,errorReason:aM,conflict:aN,conflictFiles:aO,runFetch:aP,runPull:aQ,runPush:aR,abort:aS}=function(a,b={}){let{onCascade:c}=b,[d,e]=(0,h.useState)(null),[f,g]=(0,h.useState)("idle"),[i,j]=(0,h.useState)(null),[k,l]=(0,h.useState)(null),[m,n]=(0,h.useState)(!1),[o,p]=(0,h.useState)([]),q=(0,h.useRef)(null),r=(0,h.useRef)(c),s=(0,h.useCallback)(async(b,c,d)=>{j(null),l(null),n(!1),p([]),e(b),g("running");let f=new AbortController;q.current=f;try{let e=await fetch(`/api/worktrees/${a}/git/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d),signal:f.signal});if(!e.ok){var h,i;let a=await e.json().catch(()=>({}));l((h=a?.reason,"auth_failed"===h?"auth_failed":"protected_branch"===h?"protected_branch":null)),j((i=a?.error,"string"==typeof i&&i.length>0?i:null)),g("error");return}let k=await e.json().catch(()=>({success:!0}));"pull"===b&&k?.conflict&&(n(!0),p(Array.isArray(k.conflictFiles)?k.conflictFiles:[])),g("idle")}catch(a){a instanceof Error&&"AbortError"===a.name?g("idle"):(j(null),l(null),g("error"))}finally{e(null),q.current=null,r.current?.(b)}},[a]),t=(0,h.useCallback)(a=>{let b={prune:!0===a.prune};return void 0!==a.remote&&(b.remote=a.remote),s("fetch","fetch",b)},[s]),u=(0,h.useCallback)(a=>{let b={rebase:!0===a.rebase,ffOnly:!0===a.ffOnly};return void 0!==a.remote&&(b.remote=a.remote),void 0!==a.branch&&(b.branch=a.branch),s("pull","pull",b)},[s]);return{operation:d,progressState:f,error:i,errorReason:k,conflict:m,conflictFiles:o,runFetch:t,runPull:u,runPush:(0,h.useCallback)(a=>{let b={force:!0===a.force,forceWithLease:!0===a.forceWithLease,setUpstream:!0===a.setUpstream};return void 0!==a.remote&&(b.remote=a.remote),void 0!==a.branch&&(b.branch=a.branch),s("push","push",b)},[s]),abort:(0,h.useCallback)(()=>{q.current?.abort()},[])}}(a,{onCascade:(0,h.useCallback)(a=>{v(),an(ai),"pull"===a&&(aa(),L())},[v,an,ai,aa,L])}),aT="auth_failed"===aM?i("git.network.authFailedGuidance"):"protected_branch"===aM?i("git.danger.protectedBranchWarning"):aL,aU="running"===aK&&("push"===aJ||"pull"===aJ),aV=s?.aheadBehind!=null,aW=(0,h.useCallback)(()=>ag(()=>aR({setUpstream:!aV})),[ag,aR,aV]);cM({intervalMs:5e3,enabled:"running"!==aK,onPoll:v});let aX=(0,h.useMemo)(()=>({isMobile:c,onDiffSelect:b,onInsertToMessage:f}),[c,b,f]),aY=(0,e.jsx)(d9,{gitStatus:s,statusLoading:t,statusError:u,onRefresh:v}),aZ=(0,e.jsx)(ea,{progressState:aK,operation:aJ,error:aT,conflict:aN,conflictFiles:aO,hasUpstream:aV,onPull:()=>aQ({}),onPush:()=>aR({setUpstream:!aV}),onAbort:aS,extraActions:(0,e.jsx)(dW,{branches:ah,busy:al||aU,actionError:am,hasRunningSession:r,isMobile:c,onCheckout:aq})}),a$=(0,e.jsx)(ec,{staged:S,loading:T,error:U,busy:V||aU,commitMessage:W,amend:Y,committing:$,commitError:_,onRefresh:aa,onDiff:ad,onPreview:ae,onStage:ab,onUnstage:ac,onCommitMessageChange:X,onAmendChange:Z,onCommit:af,onCommitAndPush:aW}),a_=(0,e.jsx)(ed,{commits:w,isLoading:F,commitError:I,commitListOpen:m,onToggleCommitList:o,onRefresh:Q,selectedCommit:x,onCommitSelect:M,inlineDiffCommit:z,inlineFiles:A,inlineFilesLoading:B,inlineFilesError:C,onToggleInlineDiff:O,onInlineDiffFile:P,changedFiles:y,isLoadingFiles:G,detailError:J,selectedFile:D,onFileSelect:N,diffContent:E,isLoadingDiff:H}),a0=(0,e.jsxs)(dX,{open:p,onToggle:q,children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 px-3 py-2 border-b border-border","data-testid":"git-advanced-fetch",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("git.remote")}),(0,e.jsx)("div",{children:(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:()=>aP({}),disabled:"running"===aK,className:"px-2 py-1 text-xs rounded border border-input text-foreground hover:bg-muted disabled:opacity-50","data-testid":"git-fetch-button",children:i("git.network.fetch")})})]}),(0,e.jsx)(eg,{branches:ah,include:ai,loading:aj,error:ak,busy:al||aU,actionError:am,onIncludeChange:ao,onRefresh:ap,onCreate:ar,onDelete:as}),(0,e.jsx)(eh,{stashes:at,loading:au,error:av,busy:aw||aU,actionError:ax,conflictNotice:ay,hasRunningSession:r,onRefresh:az,onPush:aA,onPop:aB,onApply:aC,onDrop:aD}),(0,e.jsx)(ej,{selectedCommit:x,busy:aE||aU,actionError:aF,conflictNotice:aG,currentBranch:s?.currentBranch??null,aheadCount:s?.aheadBehind?.ahead??null,hasRunningSession:r,onReset:aH,onRevert:aI,onForcePush:a=>aR(a?{forceWithLease:!0}:{force:!0})})]});return(0,e.jsx)(dZ,{value:aX,children:(0,e.jsx)(d3,{activeTab:j,onTabChange:l,className:g,statusSection:aY,quickActionsSection:aZ,changesSection:a$,historySection:a_,advancedSection:a0})})}),el=(0,h.memo)(function({worktreeId:a,worktree:b,onWorktreeUpdate:c}){let[d,f]=(0,h.useState)(!1),g=(0,k.c)("worktree"),i=(0,h.useRef)(b?.id),j=(0,h.useRef)(!1),l=ep(b,c,b?.id,()=>{let a=b?.id!==i.current;return i.current=b?.id,a&&!j.current});return(j.current=l.isEditing,b)?(0,e.jsx)("div",{className:"p-4 space-y-4 overflow-y-auto h-full",children:(0,e.jsx)(eq,{worktreeId:a,worktree:b,cardClassName:"bg-surface rounded-lg border border-border p-4",descriptionEditor:l,showLogs:d,onToggleLogs:()=>f(!d),onWorktreeUpdate:c})}):(0,e.jsx)("div",{className:"text-muted-foreground text-center py-8",children:g("detail.loadingInfo")})}),em=(0,h.memo)(function({worktreeId:a,cliToolId:b,instanceId:c,disableAutoFollow:d}){let{terminal:f,setAutoScroll:g}=bq({worktreeId:a,cliToolId:b,instanceId:c});return(0,e.jsx)(bo,{output:f.output,isActive:f.isRunning,isThinking:f.isThinking,autoScroll:f.autoScroll,onScrollChange:g,disableAutoFollow:d,compactTuiLayoutPadding:"claude"===b||"codex"===b,className:"h-full"})}),en=(0,h.memo)(function({activeTab:a,worktreeId:b,worktree:c,messages:d,cliToolId:f,instanceId:g,onFilePathClick:h,onFileSelect:i,onWorktreeUpdate:j,onNewFile:l,onNewDirectory:m,onRename:n,onDelete:o,onUpload:p,onMove:q,onFileTreeReset:r,refreshTrigger:s,fileSearch:t,showToast:u,selectedAgents:v,onSelectedAgentsChange:w,availableAgents:x,maxAgents:y,persistToServer:z,vibeLocalModel:A,onVibeLocalModelChange:B,vibeLocalContextWindow:C,onVibeLocalContextWindowChange:D,disableAutoFollow:E,historySubTab:G,onHistorySubTabChange:H,onDiffSelect:I,onInsertToMessage:J,showArchived:K,onShowArchivedChange:L,historyDisplayLimit:M,onHistoryDisplayLimitChange:N,historyUserOnly:O,onHistoryUserOnlyChange:P,useInstanceManagement:Q,instances:R,onInstancesChange:S,visibleInstanceIds:T,onToggleInstanceVisible:U}){let V=(0,k.c)("worktree");switch(a){case"terminal":return(0,e.jsx)(F,{componentName:"TerminalDisplay",children:(0,e.jsx)(em,{worktreeId:b,cliToolId:f,instanceId:g,disableAutoFollow:E})});case"history":return(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsxs)("div",{className:"flex border-b border-border shrink-0",children:[(0,e.jsx)("button",{type:"button",onClick:()=>H("message"),className:`flex-1 min-h-[44px] px-3 py-1.5 text-xs font-medium transition-colors touch-manipulation ${"message"===G?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400 bg-accent-50 dark:bg-accent-900/30":"text-muted-foreground hover:text-foreground"}`,children:V("detail.subTabMessage")}),(0,e.jsx)("button",{type:"button",onClick:()=>H("git"),className:`flex-1 min-h-[44px] px-3 py-1.5 text-xs font-medium transition-colors touch-manipulation ${"git"===G?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400 bg-accent-50 dark:bg-accent-900/30":"text-muted-foreground hover:text-foreground"}`,children:V("detail.subTabGit")})]}),"message"===G?(0,e.jsx)(F,{componentName:"HistoryPane",children:(0,e.jsx)(cq,{messages:d,worktreeId:b,onFilePathClick:h,className:"flex-1 min-h-0",showToast:u,onInsertToMessage:J,showArchived:K,onShowArchivedChange:L,historyDisplayLimit:M,onHistoryDisplayLimitChange:N,historyUserOnly:O,onHistoryUserOnlyChange:P})}):(0,e.jsx)(F,{componentName:"GitPane",children:(0,e.jsx)(ek,{worktreeId:b,onDiffSelect:I,isMobile:!0,worktree:c??void 0,onInsertToMessage:J,className:"flex-1 min-h-0"})})]});case"files":return(0,e.jsx)(F,{componentName:"FileTreeView",children:(0,e.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[(0,e.jsx)(cS,{query:t.query,mode:t.mode,isSearching:t.isSearching,error:t.error,onQueryChange:t.setQuery,onModeChange:t.setMode,onClear:t.clearSearch}),(0,e.jsx)(cO,{worktreeId:b,onFileSelect:i,onNewFile:l,onNewDirectory:m,onRename:n,onDelete:o,onUpload:p,onMove:q,onResetView:r,refreshTrigger:s,pollingEnabled:"files"===a,searchQuery:t.query,searchMode:t.mode,searchResults:t.results?.results,className:"flex-1 min-h-0"})]})});case"memo":return(0,e.jsx)(F,{componentName:"NotesAndLogsPane",children:(0,e.jsx)(dO,{worktreeId:b,className:"h-full",selectedAgents:v,onSelectedAgentsChange:w,availableAgents:x,maxAgents:y,persistToServer:z,vibeLocalModel:A,onVibeLocalModelChange:B,vibeLocalContextWindow:C,onVibeLocalContextWindowChange:D,onInsertToMessage:J,useInstanceManagement:Q,instances:R,onInstancesChange:S,visibleInstanceIds:T,onToggleInstanceVisible:U})});case"info":return(0,e.jsx)(el,{worktreeId:b,worktree:c,onWorktreeUpdate:j});default:return null}}),eo=[{value:null,labelKey:"worktreeStatus.notSet"},{value:"ready",labelKey:"worktreeStatus.ready"},{value:"in_progress",labelKey:"worktreeStatus.inProgress"},{value:"in_review",labelKey:"worktreeStatus.inReview"},{value:"done",labelKey:"worktreeStatus.done"}];function ep(a,b,c,d){let[e,f]=(0,h.useState)(!1),[g,i]=(0,h.useState)(""),[j,k]=(0,h.useState)(!1),l=(0,h.useCallback)(async()=>{if(a){k(!0);try{let c=await T.y.updateDescription(a.id,g);b(c),f(!1)}catch(a){console.error("Failed to save description:",a)}finally{k(!1)}}},[a,g,b]),m=(0,h.useCallback)(()=>{i(a?.description||""),f(!1)},[a]);return{isEditing:e,text:g,setText:i,isSaving:j,handleSave:l,handleCancel:m,startEditing:(0,h.useCallback)(()=>{f(!0)},[])}}let eq=(0,h.memo)(function({worktreeId:a,worktree:b,cardClassName:c,descriptionEditor:d,showLogs:f,onToggleLogs:g,onWorktreeUpdate:i}){let{isEditing:j,text:l,setText:m,isSaving:o,handleSave:p,handleCancel:q,startEditing:r}=d,s=(0,k.c)("worktree"),t=(0,k.c)("common"),[u,v]=(0,h.useState)(!1),[w,x]=(0,h.useState)(!1),y=(0,h.useRef)(void 0),z=(0,h.useRef)(void 0);(0,h.useEffect)(()=>()=>{y.current&&clearTimeout(y.current),z.current&&clearTimeout(z.current)},[]);let A=(0,h.useCallback)(async()=>{try{await (0,ar.l)(b.path),v(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>v(!1),ah.pX)}catch{}},[b.path]),B=(0,h.useCallback)(async()=>{try{await (0,ar.l)(b.repositoryPath),x(!0),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>x(!1),ah.pX)}catch{}},[b.repositoryPath]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.worktree")}),(0,e.jsx)("p",{className:"text-lg font-semibold text-foreground",children:b.name})]}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.repository")}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:B,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":s("detail.copyRepositoryPath"),title:w?s("detail.copied"):s("detail.copyRepositoryPath"),children:w?(0,e.jsx)(au.A,{className:"w-3.5 h-3.5 text-success"}):(0,e.jsx)(av,{className:"w-3.5 h-3.5"})})]}),(0,e.jsx)("p",{className:"text-base text-foreground",children:b.repositoryDisplayName??b.repositoryName}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:b.repositoryPath})]}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.path")}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:A,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":s("detail.copyWorktreePath"),title:u?s("detail.copied"):s("detail.copyPath"),children:u?(0,e.jsx)(au.A,{className:"w-3.5 h-3.5 text-success"}):(0,e.jsx)(av,{className:"w-3.5 h-3.5"})})]}),(0,e.jsx)("p",{className:"text-sm text-foreground break-all font-mono",children:b.path})]}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.status")}),(0,e.jsx)("select",{value:b.status??"",onChange:async a=>{let c=a.target.value;try{let a=await fetch(`/api/worktrees/${b.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:""===c?null:c})});if(a.ok&&i){let b=await a.json();i(b)}}catch{}},className:"text-sm px-3 py-1.5 rounded-lg border border-input bg-surface text-foreground focus:ring-2 focus:ring-ring focus:border-transparent w-full","data-testid":"mobile-status-dropdown","aria-label":s("detail.worktreeStatusLabel"),children:eo.map(a=>(0,e.jsx)("option",{value:a.value??"",children:s(a.labelKey)},a.labelKey))})]}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.description")}),!j&&(0,e.jsx)("button",{type:"button",onClick:r,className:"text-sm text-accent-600 hover:text-accent-800 dark:text-accent-400 dark:hover:text-accent-300",children:s("actions.edit")})]}),j?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("textarea",{value:l,onChange:a=>m(a.target.value),placeholder:s("detail.addNotesPlaceholder"),className:"w-full min-h-[150px] p-3 border border-input dark:bg-surface dark:text-foreground rounded-lg resize-y focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",autoFocus:!0}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:p,disabled:o,className:"px-4 py-2 bg-accent-600 text-white rounded-lg hover:bg-accent-700 disabled:opacity-50 text-sm font-medium",children:o?s("actions.saving"):s("actions.save")}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:q,disabled:o,className:"px-4 py-2 bg-muted text-foreground rounded-lg hover:bg-border disabled:opacity-50 text-sm font-medium",children:t("cancel")})]})]}):(0,e.jsx)("div",{className:"min-h-[50px]",children:b.description?(0,e.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:b.description}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground italic",children:s("detail.noDescription")})})]}),b.link&&(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.link")}),(0,e.jsx)("a",{href:b.link,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-600 hover:underline break-all",children:b.link})]}),b.updatedAt&&(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.lastUpdated")}),(0,e.jsx)("p",{className:"text-sm text-foreground",children:new Date(b.updatedAt).toLocaleString()})]}),(0,e.jsx)(aZ,{version:"v0.11.2",className:c}),(0,e.jsx)(a4,{className:c}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.logs")}),(0,e.jsx)("button",{type:"button",onClick:g,className:"text-sm text-accent-600 hover:text-accent-800",children:f?s("detail.hide"):s("detail.show")})]}),f&&(0,e.jsx)(aV,{worktreeId:a})]})]})}),er=(0,h.memo)(function({worktreeName:a,repositoryName:b,description:c,status:d,gitStatus:f,onBackClick:g,onInfoClick:i,hasUpdate:j,worktreeStatus:l,onWorktreeStatusChange:m,sessionStatusByCli:p,sessionStatusByInstance:q,instances:s,activeInstanceId:t,onActiveInstanceChange:u,onAgentDragStart:v,onAgentDragEnd:w,onKillSession:x}){let y=(0,k.c)("worktree"),z=(0,k.c)("common"),A=aQ.sb[d],B=A?y(A):void 0,[D,E]=(0,h.useState)(null),F=s?.find(a=>a.id===t),G=!!t&&(q?.[t]?.isRunning??(F?p?.[F.cliTool]?.isRunning:void 0)??!1),H=(0,h.useCallback)((a,b)=>{a.dataTransfer.setData(a9,b),a.dataTransfer.effectAllowed="move",E(b),v?.(b)},[v]),I=(0,h.useCallback)(()=>{E(null),w?.()},[w]),J=c?r(c,50):null;return(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsxs)("button",{type:"button",onClick:g,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":y("detail.goBack"),"data-testid":"worktree-back-button",children:[(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-4 0a1 1 0 01-1-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 01-1 1h-2z"})}),(0,e.jsx)("span",{className:"text-sm font-medium",children:y("detail.home")})]}),(0,e.jsx)("div",{className:"w-px h-6 bg-border","aria-hidden":"true"}),(0,e.jsx)(o.m,{"data-testid":"desktop-status-indicator",status:d,size:"lg",label:B}),(0,e.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold text-foreground truncate max-w-[200px] leading-tight",children:a}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"truncate max-w-[200px]",children:b}),f&&"(unknown)"!==f.currentBranch&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:"/"}),(0,e.jsx)("span",{className:"truncate max-w-[150px] font-mono",title:f.currentBranch,"data-testid":"desktop-branch-name",children:r(f.currentBranch,30)}),f.isDirty&&(0,e.jsx)("span",{className:"text-warning",title:y("git.uncommittedChanges"),children:"*"})]}),J&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:"—"}),(0,e.jsx)("span",{className:"truncate max-w-[300px] text-muted-foreground",title:c,children:J})]})]})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[s&&s.length>0&&(()=>{let a=(0,aT.Uw)(s.map(a=>({item:a,status:(0,a6.kA)(q?.[a.id]??p?.[a.cliTool]),isActive:a.id===t})),4),b=a.filter(a=>"overflow"===a.slot),c=b.find(a=>"running"===a.status||"generating"===a.status)?.status??b.find(a=>"waiting"===a.status)?.status??null;return(0,e.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0","data-testid":"desktop-agent-status-row",children:[a.map(a=>{if("overflow"===a.slot)return null;let b=a.item,c=y("detail.statusPill",{label:(0,a7.sw)(b),status:z(`status.${a.status}`)}),d=a.isActive,f={draggable:!0,onDragStart:a=>H(a,b.id),onDragEnd:I},g=D===b.id?" opacity-50 cursor-grabbing":"";return"pill"===a.slot?(0,e.jsxs)("button",{type:"button","data-testid":`desktop-agent-status-${b.id}`,onClick:()=>u?.(b.id),...f,"aria-label":c,"aria-pressed":d,className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors ${d?"bg-accent-100 dark:bg-accent-900/30 text-accent-900 dark:text-accent-100":"hover:bg-muted text-foreground"}${g}`,children:[(0,e.jsx)(o.m,{status:a.status,size:"sm","aria-hidden":!0,title:void 0}),(0,e.jsx)("span",{className:"whitespace-nowrap",children:c})]},b.id):(0,e.jsx)(aR.m_,{content:c,placement:"bottom",children:(0,e.jsx)("button",{type:"button","data-testid":`desktop-agent-status-${b.id}`,onClick:()=>u?.(b.id),...f,"aria-label":c,"aria-pressed":d,className:`flex items-center justify-center w-6 h-6 rounded-full transition-colors ${d?"bg-accent-100 dark:bg-accent-900/30":"hover:bg-muted"}${g}`,children:(0,e.jsx)(o.m,{status:a.status,size:"sm","aria-hidden":!0,title:void 0})})},b.id)}),b.length>0&&(0,e.jsxs)(aS.rI,{children:[(0,e.jsx)(aS.ty,{asChild:!0,children:(0,e.jsxs)("button",{type:"button","data-testid":"desktop-agent-status-overflow","aria-label":y("agentStatus.moreAgents",{count:b.length}),className:"flex items-center gap-1 px-2 py-1 rounded text-xs tabular-nums text-muted-foreground hover:bg-muted transition-colors",children:[c&&(0,e.jsx)(o.m,{status:c,size:"sm","aria-hidden":!0,title:void 0}),"+",b.length]})}),(0,e.jsx)(aS.SQ,{align:"end",children:b.map(a=>{let b=a.item,c=y("detail.statusPill",{label:(0,a7.sw)(b),status:z(`status.${a.status}`)});return(0,e.jsxs)(aS._2,{"data-testid":`desktop-agent-overflow-${b.id}`,onSelect:()=>u?.(b.id),children:[(0,e.jsx)(o.m,{status:a.status,size:"sm","aria-hidden":!0,title:void 0}),(0,e.jsx)("span",{className:"whitespace-nowrap",children:c})]},b.id)})})]})]})})(),x&&G&&(0,e.jsxs)(n.$n,{variant:"ghost",type:"button",onClick:x,className:"flex items-center gap-1 px-2 py-1.5 text-xs font-medium rounded-lg text-danger-foreground hover:bg-danger-subtle transition-colors flex-shrink-0","aria-label":y("terminal.endSession"),"data-testid":"desktop-kill-session",children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"✕"}),z("end")]}),m&&(0,e.jsx)("select",{value:l??"",onChange:a=>{let b=a.target.value;m(""===b?null:b)},onClick:a=>a.stopPropagation(),className:"text-xs px-2 py-1.5 rounded-lg border border-input bg-surface text-foreground focus:ring-2 focus:ring-ring focus:border-transparent cursor-pointer","data-testid":"desktop-status-dropdown","aria-label":y("detail.worktreeStatusLabel"),children:eo.map(a=>(0,e.jsx)("option",{value:a.value??"",children:y(a.labelKey)},a.labelKey))}),(0,e.jsx)(bb.g,{}),(0,e.jsxs)(n.$n,{variant:"ghost",type:"button",onClick:i,className:"relative flex items-center gap-1.5 px-3 py-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded-lg transition-colors","aria-label":y("detail.viewInfo"),children:[(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,e.jsx)("span",{className:"text-sm font-medium",children:y("detail.info")}),j&&(0,e.jsx)(C,{"data-testid":"info-update-indicator",className:"absolute top-0 right-0","aria-label":y("tabs.updateAvailable")})]})]})]})}),es=(0,h.memo)(function({worktreeId:a,worktree:b,isOpen:c,onClose:d,onWorktreeUpdate:f}){let[g,i]=(0,h.useState)(!1),j=(0,k.c)("worktree"),l=(0,h.useRef)(c),m=ep(b,f,c,()=>{let a=c&&!l.current;return l.current=c,a});return b?(0,e.jsx)(a5.a,{isOpen:c,onClose:d,title:j("detail.infoModalTitle"),size:"md",children:(0,e.jsx)("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto","data-testid":"worktree-info-modal",children:(0,e.jsx)(eq,{worktreeId:a,worktree:b,cardClassName:"bg-muted rounded-lg p-4",descriptionEditor:m,showLogs:g,onToggleLogs:()=>i(!g),onWorktreeUpdate:f})})}):null}),et=(0,h.memo)(function(){let a=(0,k.c)("worktree");return(0,e.jsx)("div",{className:"flex items-center justify-center h-full min-h-[200px]",role:"status","aria-live":"polite",children:(0,e.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,e.jsx)(n.y$,{size:"xl",variant:"accent"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:a("detail.loading")})]})})}),eu=(0,h.memo)(function({message:a,onRetry:b}){let c=(0,k.c)("worktree"),d=(0,k.c)("common");return(0,e.jsx)("div",{className:"flex items-center justify-center h-full min-h-[200px]",role:"alert","aria-live":"assertive",children:(0,e.jsxs)("div",{className:"text-center p-6 bg-danger-subtle rounded-lg border border-danger-border max-w-md",children:[(0,e.jsx)("svg",{className:"mx-auto h-12 w-12 text-danger-foreground/70 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,e.jsx)("p",{className:"text-danger-foreground font-medium",children:c("detail.errorLoading")}),(0,e.jsx)("p",{className:"text-danger-foreground/80 text-sm mt-2",children:a}),b&&(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:b,className:"mt-4 px-4 py-2 bg-danger-foreground text-danger-subtle rounded-lg hover:opacity-90 transition-opacity focus:outline-none focus:ring-2 focus:ring-danger focus:ring-offset-2 ring-offset-background",children:d("retry")})]})})}),ev=(0,h.memo)(function({activityPane:a,rightPane:b,activityPaneWidth:c=18,minPaneWidth:d=10,maxPaneWidth:f=60,onActivityPaneResize:g,className:i=""}){let j=(0,h.useRef)(null),l=(0,k.c)("worktree"),[m,n]=(0,h.useState)(c),o=g?c:m,p=(0,h.useCallback)(a=>{let b=j.current;if(!b)return;let e=b.offsetWidth;if(0===e)return;let h=Math.min(f,Math.max(d,(g?c:m)+a/e*100));g?g(h):n(h)},[c,m,d,f,g]),q=(0,h.useMemo)(()=>`flex h-full min-h-0 ${i}`.trim(),[i]);return(0,e.jsx)("div",{ref:j,className:"h-full",children:(0,e.jsxs)("div",{"data-testid":"desktop-layout",role:"main",className:q,children:[null!==a&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{id:"worktree-activity-pane","data-testid":"activity-pane-slot","aria-label":l("desktopLayout.activityPane"),style:{width:`${o}%`},className:"flex-shrink-0 overflow-hidden transition-[width] duration-200 ease-in-out",children:(0,e.jsx)(F,{componentName:"ActivityPane",children:a})}),(0,e.jsx)(ch,{onResize:p,orientation:"horizontal",ariaValueNow:o})]}),(0,e.jsx)("div",{id:"worktree-right-pane","data-testid":"right-pane-slot","aria-label":l("desktopLayout.terminalPane"),className:"flex-grow overflow-hidden min-w-0",children:(0,e.jsx)(F,{componentName:"TerminalPane",children:b})})]})})}),ew=(0,x.A)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]),ex=(0,x.A)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var ey=c(57898);let ez=(0,x.A)("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"}]]),eA=(0,x.A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);var eB=c(55056);let eC=(0,x.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),eD=(0,x.A)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]),eE=[{id:"files",labelKey:"activityBar.files",icon:ex},{id:"git",labelKey:"activityBar.git",icon:ey.A},{id:"notes",labelKey:"activityBar.notes",icon:ez},{id:"schedules",labelKey:"activityBar.schedules",icon:eA},{id:"agent",labelKey:"activityBar.agent",icon:eB.A},{id:"timer",labelKey:"activityBar.timer",icon:eC},{id:"todo",labelKey:"activityBar.todo",icon:eD}];eE.map(a=>a.id);var eF=c(81092);let eG=(0,h.memo)(function({active:a,onToggle:b,className:c=""}){let d=(0,k.c)("worktree"),f=(0,h.useRef)([]),{isOpen:g,toggle:i}=(0,eF.VF)(),j=(0,h.useCallback)((a,c,d)=>{if("Enter"===a.key||" "===a.key){a.preventDefault(),b(d);return}if("ArrowDown"===a.key){a.preventDefault();let b=(c+1)%eE.length;f.current[b]?.focus();return}if("ArrowUp"===a.key){a.preventDefault();let b=(c-1+eE.length)%eE.length;f.current[b]?.focus();return}if("Home"===a.key){a.preventDefault(),f.current[0]?.focus();return}if("End"===a.key){a.preventDefault(),f.current[eE.length-1]?.focus();return}},[b]);return(0,e.jsxs)("div",{"data-testid":"activity-bar",className:`flex flex-col items-stretch w-12 flex-shrink-0 bg-muted border-r border-border ${c}`.trim(),children:[(0,e.jsx)(aR.m_,{content:d("activityBar.toggleSidebar"),placement:"right",children:(0,e.jsx)("button",{type:"button","data-testid":"activity-bar-toggle-sidebar",onClick:i,"aria-label":d("activityBar.toggleSidebar"),"aria-expanded":g,className:"flex items-center justify-center h-12 w-12 text-muted-foreground transition-colors hover:text-surface-foreground hover:bg-muted-foreground/10 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-inset",children:(0,e.jsx)(ew,{size:20,"aria-hidden":"true"})})}),(0,e.jsx)("div",{className:"mx-2 my-1 border-b border-border","aria-hidden":"true"}),(0,e.jsx)("div",{id:"worktree-activity-bar",role:"tablist","aria-orientation":"vertical","aria-label":d("activityBar.label"),className:"flex flex-col items-stretch",children:eE.map((c,g)=>{let h=c.icon,i=a===c.id,k=d(c.labelKey);return(0,e.jsx)(aR.m_,{content:k,placement:"right",children:(0,e.jsx)("button",{ref:a=>{f.current[g]=a},type:"button",role:"tab","aria-selected":i,"aria-label":k,"aria-controls":"worktree-activity-pane",tabIndex:i||null===a&&0===g?0:-1,onClick:()=>b(c.id),onKeyDown:a=>j(a,g,c.id),"data-testid":`activity-bar-button-${c.id}`,className:"group flex items-center justify-center h-12 w-12 transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-inset",children:(0,e.jsx)("span",{"aria-hidden":"true",className:`flex items-center justify-center h-9 w-9 rounded-md transition-colors ${i?"bg-accent-500/10 text-accent-600 dark:text-accent-400":"text-muted-foreground group-hover:text-surface-foreground group-hover:bg-muted-foreground/10"}`,children:(0,e.jsx)(h,{size:20,"aria-hidden":"true"})})})},c.id)})})]})}),eH="worktree-activity-pane",eI={files:"FileTreeView",git:"GitPane",notes:"MemoPane",schedules:"ExecutionLogPane",agent:"AgentSettingsPane",timer:"TimerPane",todo:"TodoPane"},eJ=(0,h.memo)(function({active:a,activities:b,className:c=""}){if(null===a)return(0,e.jsx)("div",{id:eH,"data-testid":"activity-pane","data-active":"none",className:`h-full flex flex-col ${c}`.trim()});let d=b[a],f=eI[a];return(0,e.jsx)("div",{id:eH,"data-testid":"activity-pane","data-active":a,role:"tabpanel","aria-labelledby":`activity-bar-button-${a}`,className:`h-full flex flex-col min-h-0 ${c}`.trim(),children:(0,e.jsx)(F,{componentName:f,children:d??null})})}),eK=(0,h.memo)(function({inputRef:a,searchQuery:b,onQueryChange:c,matchCount:d,currentIdx:f,onNextMatch:g,onPrevMatch:h,onClose:i}){let j=(0,k.c)("worktree");return(0,e.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted border-b border-input flex-shrink-0",children:[(0,e.jsx)("input",{ref:a,type:"text",value:b,onChange:a=>c(a.target.value),onKeyDown:a=>{"Escape"===a.key&&i(),"Enter"===a.key&&(a.shiftKey?h():g())},placeholder:j("fileSearch.placeholder"),className:"flex-1 min-w-0 px-2 py-0.5 text-sm bg-surface dark:text-foreground border border-input rounded outline-none focus:ring-1 focus:ring-ring",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground min-w-[3rem] text-right",children:d>0?`${f+1}/${d}`:"0/0"}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:h,disabled:0===d,className:"min-w-[32px] min-h-[32px] flex items-center justify-center text-muted-foreground hover:text-foreground dark:hover:text-white disabled:text-muted-foreground/50","aria-label":j("fileSearch.prevMatch"),children:"▲"}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:g,disabled:0===d,className:"min-w-[32px] min-h-[32px] flex items-center justify-center text-muted-foreground hover:text-foreground dark:hover:text-white disabled:text-muted-foreground/50","aria-label":j("fileSearch.nextMatch"),children:"▼"}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:i,className:"min-w-[32px] min-h-[32px] flex items-center justify-center text-muted-foreground hover:text-foreground dark:hover:text-white","aria-label":j("fileSearch.close"),children:(0,e.jsx)(as.A,{className:"w-4 h-4"})})]})}),eL=[{extension:".png",maxFileSize:0x1400000,allowedMimeTypes:["image/png"],magicBytes:[{bytes:[137,80,78,71,13,10,26,10]}]},{extension:".jpg",maxFileSize:0x1400000,allowedMimeTypes:["image/jpeg"],magicBytes:[{bytes:[255,216,255]}]},{extension:".jpeg",maxFileSize:0x1400000,allowedMimeTypes:["image/jpeg"],magicBytes:[{bytes:[255,216,255]}]},{extension:".gif",maxFileSize:0x1400000,allowedMimeTypes:["image/gif"],magicBytes:[{bytes:[71,73,70,56,55,97]},{bytes:[71,73,70,56,57,97]}]},{extension:".webp",maxFileSize:0x1400000,allowedMimeTypes:["image/webp"],magicBytes:[{bytes:[82,73,70,70],offset:0}]},{extension:".mp4",maxFileSize:0x6400000,allowedMimeTypes:["video/mp4"],magicBytes:[{bytes:[102,116,121,112],offset:4}]},{extension:".txt",maxFileSize:0x1400000,allowedMimeTypes:["text/plain"]},{extension:".log",maxFileSize:0x1400000,allowedMimeTypes:["text/plain"]},{extension:".md",maxFileSize:0x1400000,allowedMimeTypes:["text/markdown","text/plain"]},{extension:".csv",maxFileSize:0x1400000,allowedMimeTypes:["text/csv"]},{extension:".json",maxFileSize:0x1400000,allowedMimeTypes:["application/json"]},{extension:".yaml",maxFileSize:0x1400000,allowedMimeTypes:["text/yaml","application/x-yaml"]},{extension:".yml",maxFileSize:0x1400000,allowedMimeTypes:["text/yaml","application/x-yaml"]}],eM=eL.map(a=>a.extension),eN=[".md",".html",".htm",".yaml",".yml"];var eO=c(79689);function eP(){return(0,e.jsx)("div",{className:"flex items-center justify-center py-12 bg-surface",children:(0,e.jsx)(m.y,{size:"xl",variant:"accent"})})}let eQ=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/FilePanelContent.tsx -> @/components/worktree/HtmlPreview"]},ssr:!1,loading:()=>(0,e.jsx)(eP,{})}),eR=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/FilePanelContent.tsx -> @/components/worktree/PdfPreview"]},ssr:!1,loading:()=>(0,e.jsx)(eP,{})}),eS=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/FilePanelContent.tsx -> @/components/worktree/MarkdownEditor"]},ssr:!1,loading:()=>(0,e.jsx)(eP,{})}),eT=/^---\s*\nmarp:\s*true/;function eU(){let a=(0,k.c)("worktree");return(0,e.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,e.jsx)(m.y,{size:"xl",variant:"accent"}),(0,e.jsx)("p",{className:"ml-3 text-muted-foreground",children:a("fileViewer.loading")})]})}function eV({error:a}){return(0,e.jsx)("div",{className:"bg-danger-subtle border border-danger-border rounded-lg p-4 m-4",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("svg",{className:"w-5 h-5 text-danger-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,e.jsx)("p",{className:"text-sm text-danger-foreground",children:a})]})})}function eW({filePath:a,isMaximized:b,onToggleMaximize:c,copyableContent:d,onSearch:f}){let g=(0,k.c)("worktree"),[i,j]=(0,h.useState)(!1),[l,m]=(0,h.useState)(!1),n=(0,h.useRef)(null),o=(0,h.useRef)(null),p=async()=>{try{await (0,ar.l)(a),j(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>j(!1),ah.pX)}catch{}},q=async()=>{if(d)try{await (0,ar.l)(d),m(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>m(!1),ah.pX)}catch{}};return(0,e.jsxs)("div",{className:"flex items-center justify-between p-1 border-b border-border gap-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 min-w-0",children:[(0,e.jsx)("button",{type:"button",onClick:p,className:"flex-shrink-0 p-1 rounded-md hover:bg-muted text-muted-foreground transition-colors","aria-label":g("actions.copyFilePath"),title:g("actions.copyPath"),children:i?(0,e.jsx)(au.A,{className:"w-3.5 h-3.5 text-success"}):(0,e.jsx)(av,{className:"w-3.5 h-3.5"})}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground font-mono truncate",title:a,children:a})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[f&&(0,e.jsx)("button",{type:"button",onClick:f,className:"flex-shrink-0 p-1 rounded-md hover:bg-muted text-muted-foreground transition-colors","aria-label":g("actions.searchInFile"),title:g("actions.search"),children:(0,e.jsx)(Q.A,{className:"w-3.5 h-3.5"})}),d&&(0,e.jsx)("button",{type:"button",onClick:q,className:"flex-shrink-0 p-1 rounded-md hover:bg-muted text-muted-foreground transition-colors","aria-label":g("actions.copyFileContent"),title:g("actions.copyContent"),children:l?(0,e.jsx)(au.A,{className:"w-3.5 h-3.5 text-success"}):(0,e.jsx)(ax,{className:"w-3.5 h-3.5"})}),(0,e.jsx)("button",{type:"button",onClick:c,className:"flex-shrink-0 p-1.5 rounded-md hover:bg-muted text-muted-foreground transition-colors","aria-label":g(b?"actions.minimize":"actions.maximize"),title:g(b?"actions.minimize":"actions.maximize"),children:b?(0,e.jsx)(ay,{className:"w-4 h-4"}):(0,e.jsx)(az,{className:"w-4 h-4"})})]})]})}function eX({content:a,extension:b,searchMatches:c,searchCurrentIdx:d,totalLines:f,rangeStart:g,worktreeId:i,filePath:j,onLineRangeFetched:k}){let l=(0,h.useRef)(null),m=(0,h.useMemo)(()=>a.split("\n"),[a]),n=Math.max(1,g??1),o=m.length,p=Math.max(f??o,o),q=(0,h.useRef)(new Map),r=(0,h.useCallback)(a=>{let c=Math.floor(a/500),d=q.current,e=d.get(c);if(!e){let a=500*c,f=Math.min(a+500,m.length),g=m.slice(a,f).join("\n"),h="";try{h=aK.highlight(g,{language:b,ignoreIllegals:!0}).value}catch{h=aK.highlightAuto(g).value}e=h.split("\n"),d.set(c,e)}return e[a-500*c]??""},[m,b]),s=(0,h.useMemo)(()=>new Set(c??[]),[c]),t=(c?.length??0)>0?c[d??0]:-1,u=bI({count:p,getScrollElement:()=>l.current,estimateSize:()=>24,overscan:100}),v=u.getVirtualItems();return!function({virtualItems:a,worktreeId:b,filePath:c,onLineRangeFetched:d,loadedStart:e,loadedLineCount:f}){(0,h.useRef)(new Set)}({virtualItems:v,worktreeId:i,filePath:j,onLineRangeFetched:k,loadedStart:n,loadedLineCount:o}),(0,e.jsx)("div",{className:"overflow-auto h-full",ref:l,"data-testid":"file-content-code",children:(0,e.jsx)("div",{style:{height:u.getTotalSize(),width:"100%",position:"relative"},children:v.map(a=>{let b=a.index+1,c=b-n,d=c>=0&&c<o,f=b===t,g=s.has(b),h=d?r(c):"";return(0,e.jsxs)("div",{"data-line":b,"data-index":a.index,ref:u.measureElement,className:`absolute left-0 right-0 flex font-mono text-sm ${f?"bg-warning/30":g?"bg-warning/15":""}`,style:{top:0,transform:`translateY(${a.start}px)`,height:"24px",lineHeight:"24px"},children:[(0,e.jsx)("div",{className:`px-3 text-right select-none border-r border-border bg-muted dark:bg-muted/50 whitespace-nowrap ${f||g?"text-warning-foreground":"text-muted-foreground"}`,style:{minWidth:"4rem"},children:b}),(0,e.jsx)("div",{className:"px-4 text-foreground flex-1 min-w-0 overflow-hidden",children:d?(0,e.jsx)("code",{className:"hljs",style:{padding:0,background:"transparent",whiteSpace:"pre"},dangerouslySetInnerHTML:{__html:h}}):(0,e.jsx)(eO.E,{className:"h-4 w-3/4"})})]},a.key)})})})}function eY({slides:a,fileName:b}){let c=(0,k.c)("worktree"),[d,f]=(0,h.useState)(0);return 0===a.length?(0,e.jsx)("div",{className:"p-4 text-muted-foreground",children:c("fileViewer.noSlides",{fileName:b})}):(0,e.jsxs)("div",{className:"h-full flex flex-col","data-testid":"marp-preview",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border bg-muted",children:[(0,e.jsx)("button",{type:"button",onClick:()=>{f(a=>Math.max(0,a-1))},disabled:0===d,className:"px-3 py-1 text-sm rounded-md bg-muted disabled:opacity-50 hover:bg-muted/80 transition-colors",children:c("actions.prev")}),(0,e.jsxs)("span",{className:"text-sm text-muted-foreground",children:[d+1," / ",a.length]}),(0,e.jsx)("button",{type:"button",onClick:()=>{f(b=>Math.min(a.length-1,b+1))},disabled:d===a.length-1,className:"px-3 py-1 text-sm rounded-md bg-muted disabled:opacity-50 hover:bg-muted/80 transition-colors",children:c("actions.next")})]}),(0,e.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,e.jsx)("iframe",{srcDoc:a[d],sandbox:"",title:c("fileViewer.slideTitle",{name:b,number:d+1}),className:"w-full h-full border-0"})})]})}function eZ({marpSlides:a,fileName:b,worktreeId:c,filePath:d,contentText:f,onFileSaved:g,isMaximized:i,onToggleMaximize:j,onDirtyChange:l,onOpenFile:m}){let n=(0,k.c)("worktree"),[o,p]=(0,h.useState)("slides");return(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between p-1 border-b border-border bg-muted",children:[(0,e.jsxs)("div",{className:"flex gap-1",children:[(0,e.jsx)("button",{type:"button",onClick:()=>p("slides"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${"slides"===o?"bg-accent-100 dark:bg-accent-900/50 text-accent-700 dark:text-accent-300":"text-muted-foreground hover:bg-muted"}`,children:n("fileViewer.slides")}),(0,e.jsx)("button",{type:"button",onClick:()=>p("editor"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${"editor"===o?"bg-accent-100 dark:bg-accent-900/50 text-accent-700 dark:text-accent-300":"text-muted-foreground hover:bg-muted"}`,children:n("fileViewer.editor")})]}),(0,e.jsx)(eW,{filePath:d,isMaximized:i,onToggleMaximize:j,copyableContent:f})]}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:"slides"===o?(0,e.jsx)(eY,{slides:a,fileName:b}):(0,e.jsx)(eS,{worktreeId:c,filePath:d,onSave:g,initialViewMode:"split",onDirtyChange:l,onOpenFile:m})})]})}function e$({children:a,isMaximized:b,onToggle:c,filePath:d}){return b?(0,e.jsxs)("div",{className:"fixed inset-0 bg-surface flex flex-col",style:{zIndex:aA.M.MAXIMIZED_EDITOR},children:[(0,e.jsx)(eW,{filePath:d,isMaximized:b,onToggleMaximize:c}),(0,e.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:a})]}):(0,e.jsx)(e.Fragment,{children:a})}function e_({tab:a,content:b,worktreeId:c,isMaximized:d,onToggleMaximize:f,onFileSaved:g,onDirtyChange:h,onOpenFile:i}){let j=aJ(b.content);return(0,e.jsxs)(e.Fragment,{children:[!d&&(0,e.jsx)(eW,{filePath:a.path,isMaximized:d,onToggleMaximize:f,copyableContent:b.content,onSearch:j.openSearch}),j.searchOpen&&(0,e.jsx)(eK,{inputRef:j.searchInputRef,searchQuery:j.searchQuery,onQueryChange:j.setSearchQuery,matchCount:j.searchMatches.length,currentIdx:j.searchCurrentIdx,onNextMatch:j.nextMatch,onPrevMatch:j.prevMatch,onClose:j.closeSearch}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:j.searchOpen&&j.searchQuery.length>=2?(0,e.jsx)(eX,{content:b.content,extension:"md",searchMatches:j.searchMatches,searchCurrentIdx:j.searchCurrentIdx}):(0,e.jsx)(eS,{worktreeId:c,filePath:a.path,onSave:g,initialViewMode:"preview",onDirtyChange:h,onOpenFile:i})})]})}function e0({tab:a,content:b,worktreeId:c,isMaximized:d,onToggleMaximize:f,onLoadContent:g}){let i=aJ(b.content),j=(0,h.useCallback)(c=>{g&&g(a.path,{...b,content:c.content,totalLines:c.totalLines,totalBytes:c.totalBytes??b.totalBytes,range:c.range})},[g,a.path,b]),k=void 0!==b.range&&(b.totalLines??0)>b.range.end-b.range.start+1;return(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:d,onToggleMaximize:f,copyableContent:b.content,onSearch:i.openSearch}),i.searchOpen&&(0,e.jsx)(eK,{inputRef:i.searchInputRef,searchQuery:i.searchQuery,onQueryChange:i.setSearchQuery,matchCount:i.searchMatches.length,currentIdx:i.searchCurrentIdx,onNextMatch:i.nextMatch,onPrevMatch:i.prevMatch,onClose:i.closeSearch}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:(0,e.jsx)(eX,{content:b.content,extension:b.extension,searchMatches:i.searchOpen?i.searchMatches:void 0,searchCurrentIdx:i.searchOpen?i.searchCurrentIdx:void 0,totalLines:b.totalLines,rangeStart:b.range?.start,worktreeId:k?c:void 0,filePath:k?a.path:void 0,onLineRangeFetched:k?j:void 0})})]})}let e1=(0,h.memo)(function({tab:a,worktreeId:b,onLoadContent:c,onLoadError:d,onSetLoading:f,onFileSaved:g,onDirtyChange:i,onOpenFile:j}){let l=(0,k.c)("worktree"),m=(0,h.useRef)(l);m.current=l;let n=(0,h.useRef)(!1),[o,p]=(0,h.useState)(null),[q,r]=(0,h.useState)(!1);!function({tab:a,worktreeId:b,onLoadContent:c}){let d=(0,h.useRef)(null),e=(0,h.useRef)(c);e.current=c;let f=(0,h.useRef)(a.path);f.current=a.path,cM({intervalMs:5e3,enabled:function(a){if(null===a.content||a.loading||a.isDirty||a.content.isPdf)return!1;let{totalBytes:b}=a.content;return void 0===b||!(b>=1048576)}(a),onPoll:async()=>{let a=`/api/worktrees/${b}/files/${aB(f.current)}`,c={};d.current&&(c["If-Modified-Since"]=d.current);try{let b=await fetch(a,{headers:c});if(304===b.status||!b.ok)return;d.current=b.headers.get("Last-Modified");let g=await b.json();e.current(f.current,g)}catch{}}})}({tab:a,worktreeId:b,onLoadContent:c});let s=(0,h.useMemo)(()=>i?b=>i(a.path,b):void 0,[i,a.path]),t=(0,h.useCallback)(()=>{r(a=>!a)},[]);(0,h.useEffect)(()=>{if(!q)return;let a=a=>{"Escape"===a.key&&r(!1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[q]),(0,h.useEffect)(()=>{null!==a.content||a.loading||null!==a.error||n.current||(n.current=!0,f(a.path,!0),(async()=>{try{let e=await fetch(`/api/worktrees/${b}/files/${aB(a.path)}`);if(304===e.status)return;if(!e.ok){let b=await e.json(),c="string"==typeof b.error?b.error:b.error?.message||m.current("fileViewer.loadError");d(a.path,c);return}let f=await e.json();c(a.path,f)}catch(b){d(a.path,b instanceof Error?b.message:m.current("fileViewer.loadError"))}finally{n.current=!1}})())},[a.content,a.loading,a.error,a.path,b,c,d,f]);let u=a.content?.content??null,v=a.content?.extension??null;if((0,h.useEffect)(()=>{if(!u||"md"!==v||!eT.test(u)||u.length>1e6)return void p(null);let a=!1;return(async()=>{try{let c=await fetch(`/api/worktrees/${b}/marp-render`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({markdownContent:u})});if(c.ok){let b=await c.json();a||p(Array.isArray(b.slides)?b.slides:null)}}catch{}})(),()=>{a=!0}},[u,v,b]),a.loading)return(0,e.jsx)(eU,{});if(a.error)return(0,e.jsx)(eV,{error:a.error});if(!a.content)return null;let{content:w}=a;return w.isImage?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:q,onToggleMaximize:t}),(0,e.jsx)("div",{className:"flex-1 overflow-auto",children:(0,e.jsx)(an.a,{src:w.content,alt:w.path,mimeType:w.mimeType})})]})}):w.isVideo?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:q,onToggleMaximize:t}),(0,e.jsx)("div",{className:"flex-1 overflow-auto",children:(0,e.jsx)(ao.u,{src:w.content,mimeType:w.mimeType})})]})}):w.isPdf?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:q,onToggleMaximize:t}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:(0,e.jsx)(eR,{dataUri:w.content,filePath:a.path})})]})}):w.isHtml?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:q,onToggleMaximize:t,copyableContent:w.content}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:(0,e.jsx)(eQ,{worktreeId:b,filePath:a.path,htmlContent:w.content,onFileSaved:g,onOpenFile:j})})]})}):"md"===w.extension?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsx)("div",{className:"h-full flex flex-col",children:o?(0,e.jsx)(eZ,{marpSlides:o,fileName:a.name,worktreeId:b,filePath:a.path,contentText:w.content,onFileSaved:g,isMaximized:q,onToggleMaximize:t,onDirtyChange:s,onOpenFile:j}):(0,e.jsx)(e_,{tab:a,content:w,worktreeId:b,isMaximized:q,onToggleMaximize:t,onFileSaved:g,onDirtyChange:s,onOpenFile:j})})}):!function(a){if(!a)return!1;let b=a.toLowerCase();return eN.includes(b)}("."+w.extension)?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsx)(e0,{tab:a,content:w,worktreeId:b,isMaximized:q,onToggleMaximize:t,onLoadContent:c})}):(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsx)("div",{className:"h-full flex flex-col",children:(0,e.jsx)(e_,{tab:a,content:w,worktreeId:b,isMaximized:q,onToggleMaximize:t,onFileSaved:g,onDirtyChange:s,onOpenFile:j})})})});function e2(a,b,c){if(b<=0||c<=0)return 0;let d=a+b+8-c;return d>0?-Math.min(d,Math.max(0,a-8)):a<8?8-a:0}let e3=(0,h.memo)(function({tab:a,isActive:b,onActivate:c,onClose:d}){let f=(0,k.c)("worktree"),g=(0,h.useCallback)(()=>{b||c(a.path)},[b,c,a.path]),i=(0,h.useCallback)(b=>{b.stopPropagation(),d(a.path)},[d,a.path]),j=b?"border-accent-500 text-accent-600 dark:text-accent-400 bg-surface":"border-transparent text-muted-foreground hover:text-foreground";return(0,e.jsxs)("div",{"data-testid":`file-tab-${a.path}`,"data-active":b,onClick:g,className:`flex items-center gap-1 px-3 py-2 text-sm font-medium border-b-2 cursor-pointer flex-shrink-0 ${j}`,children:[(0,e.jsx)("span",{className:"truncate max-w-[120px]",title:a.path,children:a.name}),a.isDirty&&(0,e.jsx)("span",{"data-testid":`file-tab-dirty-${a.path}`,className:"w-2 h-2 rounded-full bg-warning flex-shrink-0",title:f("fileTabs.unsavedChanges")}),(0,e.jsx)("button",{type:"button",onClick:i,className:"ml-1 p-0.5 rounded-sm hover:bg-muted transition-colors","aria-label":f("fileTabs.closeTab",{name:a.name}),children:(0,e.jsx)(as.A,{className:"w-3 h-3"})})]})}),e4=(0,h.memo)(function({tabs:a,activeIndex:b,worktreeId:c,onClose:d,onActivate:f,onLoadContent:g,onLoadError:i,onSetLoading:j,onFileSaved:k,onDirtyChange:l,onMoveToFront:m,onOpenFile:n}){let[o,p]=(0,h.useState)(!1),q=(0,h.useRef)(null),r=(0,h.useRef)(null),s=(0,h.useRef)({x:0,y:0}),[t,u]=(0,h.useState)({x:0,y:0}),v=null!==b&&b>=0&&b<a.length?a[b]:null,w=a.length>5?a.slice(0,5):a,x=a.length>5?a.slice(5):[];(0,h.useEffect)(()=>{if(!o)return;let a=a=>{q.current&&!q.current.contains(a.target)&&p(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[o]),(0,h.useLayoutEffect)(()=>{let a=a=>{s.current=a,u(b=>b.x===a.x&&b.y===a.y?b:a)};if(!o)return void a({x:0,y:0});let b=r.current;if(!b)return;let c=b.getBoundingClientRect();a({x:e2(c.left-s.current.x,c.width,window.innerWidth),y:e2(c.top-s.current.y,c.height,window.innerHeight)})},[o]);let y=(0,h.useCallback)(a=>{p(!1),m?.(a)},[m]),z=(0,h.useCallback)(()=>{p(a=>!a)},[]);return(0,e.jsxs)("div",{className:"flex flex-col h-full",children:[(0,e.jsxs)("div",{className:"flex border-b border-border bg-surface dark:bg-surface-2 min-w-0",children:[(0,e.jsx)("div",{className:"flex min-w-0 overflow-hidden flex-1",children:w.map((a,c)=>(0,e.jsx)(e3,{tab:a,isActive:c===b,onActivate:f,onClose:d},a.path))}),x.length>0&&(0,e.jsxs)("div",{className:"relative flex-shrink-0",ref:q,children:[(0,e.jsxs)("button",{type:"button","data-testid":"tab-dropdown-button",onClick:z,className:"flex items-center gap-0.5 px-2 py-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-muted border-b-2 border-transparent transition-colors",children:[(0,e.jsx)(a8.A,{className:`w-3 h-3 transition-transform ${o?"rotate-180":""}`}),(0,e.jsxs)("span",{children:["+",x.length]})]}),o&&(0,e.jsx)("div",{ref:r,"data-testid":"tab-dropdown-menu",className:"absolute right-0 top-full mt-1 bg-surface border border-border rounded-md shadow-lg z-50 min-w-[200px] max-h-[300px] overflow-y-auto",style:0!==t.x||0!==t.y?{transform:`translate(${t.x}px, ${t.y}px)`}:void 0,children:x.map(a=>(0,e.jsxs)("button",{type:"button","data-testid":`tab-dropdown-item-${a.path}`,onClick:()=>y(a.path),className:"w-full text-left px-3 py-2 text-sm text-foreground hover:bg-muted truncate",title:a.path,children:[a.name,a.isDirty&&(0,e.jsx)("span",{className:"ml-1 w-2 h-2 inline-block rounded-full bg-warning"})]},a.path))})]})]}),(0,e.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:v&&(0,e.jsx)(e1,{tab:v,worktreeId:c,onLoadContent:g,onLoadError:i,onSetLoading:j,onFileSaved:k,onDirtyChange:l,onOpenFile:n},v.path)})]})}),e5=(0,h.memo)(function({line:a}){let b="whitespace-pre font-mono text-xs leading-5";return a.startsWith("+")&&!a.startsWith("+++")?b+=" text-success-foreground bg-success-subtle":a.startsWith("-")&&!a.startsWith("---")?b+=" text-danger-foreground bg-danger-subtle":a.startsWith("@@")?b+=" text-info bg-info/10":a.startsWith("diff --git")||a.startsWith("index ")||a.startsWith("---")||a.startsWith("+++")?b+=" text-muted-foreground":b+=" text-foreground",(0,e.jsx)("div",{className:b,children:a})}),e6=(0,h.memo)(function({diff:a,filePath:b,onClose:c}){let d=(0,k.c)("worktree");return(0,e.jsxs)("div",{className:"h-full flex flex-col bg-surface",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border bg-muted shrink-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-accent-600 dark:text-accent-400 shrink-0",children:d("diffViewer.badge")}),(0,e.jsx)("span",{className:"text-xs font-mono text-muted-foreground truncate",children:b})]}),(0,e.jsx)("button",{type:"button",onClick:c,className:"p-1 text-muted-foreground hover:text-foreground rounded shrink-0","aria-label":d("diffViewer.close"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("div",{className:"flex-1 overflow-auto p-2",children:(0,e.jsx)("pre",{className:"text-xs",children:(0,e.jsx)("code",{children:a.split("\n").map((a,b)=>(0,e.jsx)(e5,{line:a},b))})})})]})});function e7(){let[a,b]=(0,h.useState)(!1),c=(0,h.useRef)(a);c.current=a;let d=(0,h.useCallback)(a=>{b(a)},[]);return{collapsed:a,toggle:(0,h.useCallback)(()=>{d(!c.current)},[d]),setCollapsed:d}}let e8=(0,h.memo)(function({terminal:a,terminalHeader:b,fileTabs:c,worktreeId:d,onCloseTab:f,onActivateTab:g,onLoadContent:i,onLoadError:j,onSetLoading:l,onFileSaved:m,diffContent:n,diffFilePath:o,onCloseDiff:p,onDirtyChange:q,onMoveToFront:r,onOpenFile:s}){let t=(0,k.c)("worktree"),u=(0,h.useRef)(null),[v,w]=(0,h.useState)(50),{collapsed:x,toggle:y}=e7(),z=(0,h.useCallback)(a=>{let b=u.current;if(!b)return;let c=b.offsetWidth;if(0===c)return;let d=a/c*100;w(a=>Math.min(80,Math.max(20,a+d)))},[]),A=(0,h.useMemo)(()=>({width:`${v}%`}),[v]),B=(0,h.useMemo)(()=>({width:`${100-v}%`}),[v]),C=(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[b,(0,e.jsx)("div",{className:"flex-1 min-h-0",children:a})]});return c.tabs.length>0||n&&o?x?(0,e.jsxs)("div",{ref:u,className:"flex h-full min-h-0",children:[(0,e.jsx)("div",{"data-testid":"terminal-pane",style:{width:"calc(100% - 36px)"},className:"flex-shrink-0 overflow-hidden",children:C}),(0,e.jsx)("div",{"data-testid":"file-panel-expand-bar",style:{width:"36px"},className:"flex-shrink-0 flex items-start justify-center bg-muted border-l border-border",children:(0,e.jsxs)("button",{type:"button","aria-label":t("terminal.showFiles"),title:t("terminal.showFiles"),onClick:y,className:"flex flex-col items-center gap-2 w-full pt-2 text-muted-foreground hover:text-accent-600 dark:hover:text-accent-400 focus:outline-none focus:ring-2 focus:ring-ring",children:[(0,e.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),(0,e.jsx)("span",{className:"text-xs font-medium tracking-wide select-none",style:{writingMode:"vertical-rl"},"aria-hidden":"true",children:t("terminal.filesLabel")})]})})]}):(0,e.jsxs)("div",{ref:u,className:"flex h-full min-h-0",children:[(0,e.jsx)("div",{"data-testid":"terminal-pane",style:A,className:"flex-shrink-0 overflow-hidden",children:C}),(0,e.jsx)(ch,{onResize:z,orientation:"horizontal",ariaValueNow:v}),(0,e.jsxs)("div",{"data-testid":"file-panel-pane",style:B,className:"flex-grow overflow-hidden flex",children:[(0,e.jsx)("button",{type:"button","aria-label":t("terminal.hideFiles"),title:t("terminal.hideFiles"),onClick:y,className:"flex-shrink-0 flex items-center justify-center w-5 h-full bg-muted border-r border-border text-muted-foreground hover:text-accent-600 dark:hover:text-accent-400 focus:outline-none focus:ring-2 focus:ring-ring",children:(0,e.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),(0,e.jsx)("div",{className:"flex-1 min-w-0 overflow-hidden",children:n&&o&&p?(0,e.jsx)(e6,{diff:n,filePath:o,onClose:p}):(0,e.jsx)(e4,{tabs:c.tabs,activeIndex:c.activeIndex,worktreeId:d,onClose:f,onActivate:g,onLoadContent:i,onLoadError:j,onSetLoading:l,onFileSaved:m,onDirtyChange:q,onMoveToFront:r,onOpenFile:s})})]})]}):(0,e.jsx)("div",{className:"h-full",children:C})});var e9=c(51881);let fa=(0,x.A)("align-horizontal-distribute-center",[["rect",{width:"6",height:"14",x:"4",y:"5",rx:"2",key:"1wwnby"}],["rect",{width:"6",height:"10",x:"14",y:"7",rx:"2",key:"1fe6j6"}],["path",{d:"M17 22v-5",key:"4b6g73"}],["path",{d:"M17 7V2",key:"hnrr36"}],["path",{d:"M7 22v-3",key:"1r4jpn"}],["path",{d:"M7 5V2",key:"liy1u9"}]]),fb=(0,x.A)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),fc=(0,x.A)("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),fd={splits:[{cliToolId:"claude",instanceId:"claude"}],widths:[1]};a7.XH;function fe(a){let b=a.reduce((a,b)=>a+b,0);return b>0?a.map(a=>a/b):a.map(()=>1/a.length)}let ff=(0,h.memo)(function({worktreeId:a,instances:b,rosterReady:c=!0,renderPane:d,onFocusedSplitChange:f,showToast:g,onActiveInstanceChange:j,headerInstanceSelection:l}){let{splits:m,widths:n,addSplit:o,removeSplit:p,setSplitInstance:q,setSplitWidth:r,resetWidths:s,availableInstanceIds:t,focusedSplitIndex:u,setFocusedSplitIndex:v}=function(a,b,c=!0){let[d,e]=(0,h.useState)(()=>(function(a,b,c){let d=function(a,b){let c=b[0];return c?{splits:[{cliToolId:c.cliTool,instanceId:c.id}],widths:[1]}:{splits:fd.splits.map(a=>({...a})),widths:[...fd.widths]}}(0,b);return c?function(a,b){let c;if(0===b.length)return a;let d=new Map(b.map(a=>[a.id,a.cliTool])),e=new Set,f=Math.min(Math.max(a.splits.length,1),b.length,3),g=[];for(let b of a.splits){if(g.length>=f)break;let a=d.get(b.instanceId);a&&!e.has(b.instanceId)&&(e.add(b.instanceId),g.push({cliToolId:a,instanceId:b.instanceId}))}for(let a of b){if(g.length>=f)break;e.has(a.id)||(e.add(a.id),g.push({cliToolId:a.cliTool,instanceId:a.id}))}return(0===g.length&&g.push({cliToolId:b[0].cliTool,instanceId:b[0].id}),g.length===a.splits.length&&g.every((b,c)=>b.instanceId===a.splits[c].instanceId&&b.cliToolId===a.splits[c].cliToolId))?a:(c=g.length===a.widths.length?fe(a.widths):g.length<a.widths.length?fe(a.widths.slice(0,g.length)):Array.from({length:g.length},()=>1/g.length),{splits:g,widths:c})}(d,b):d})(0,b,c)),[f,g]=(0,h.useState)(0),i=(0,h.useRef)(d);i.current=d;let j=(0,h.useRef)(b);j.current=b,(0,h.useRef)(c).current=c,(0,h.useRef)(a),(0,h.useMemo)(()=>b.map(a=>`${a.id}:${a.cliTool}`).join("|"),[b]),(0,h.useRef)(a);let k=(0,h.useCallback)(()=>{e(a=>{if(a.splits.length>=3)return a;let b=new Set(a.splits.map(a=>a.instanceId)),c=function(a,b){for(let c of a)if(!b.has(c.id))return c;return null}(j.current,b);if(!c)return a;let d=a.widths.length-1,e=a.widths[d]/2,f=[...a.widths];return f[d]=e,f.push(e),{splits:[...a.splits,{cliToolId:c.cliTool,instanceId:c.id}],widths:f}})},[]),l=(0,h.useCallback)(()=>{e(a=>a.splits.length<=1?a:{splits:a.splits.slice(0,-1),widths:fe(a.widths.slice(0,-1))})},[]),m=(0,h.useCallback)((a,b)=>{let c=i.current,d=j.current;if(a<0||a>=c.splits.length)return!1;let f=d.find(a=>a.id===b);if(!f||c.splits[a].instanceId===b)return!1;for(let d=0;d<c.splits.length;d++)if(d!==a&&c.splits[d].instanceId===b)return!1;return e(c=>{if(a<0||a>=c.splits.length||c.splits[a].instanceId===b)return c;for(let d=0;d<c.splits.length;d++)if(d!==a&&c.splits[d].instanceId===b)return c;let d=c.splits.map((c,d)=>d===a?{cliToolId:f.cliTool,instanceId:b}:c);return{...c,splits:d}}),!0},[]),n=(0,h.useCallback)(a=>{e(b=>a.length!==b.widths.length||!function(a){if(!Array.isArray(a))return!1;for(let b of a)if("number"!=typeof b||!Number.isFinite(b)||b<=0)return!1;return!0}(a)?b:{...b,widths:[...a]})},[]),o=(0,h.useCallback)(()=>{e(a=>{let b=a.splits.length;return 0===b?a:{...a,widths:Array.from({length:b},()=>1/b)}})},[]),p=(0,h.useCallback)(a=>{let c=new Set;for(let b=0;b<d.splits.length;b++)b!==a&&c.add(d.splits[b].instanceId);return b.filter(a=>!c.has(a.id)).map(a=>a.id)},[d.splits,b]),q=(0,h.useCallback)(a=>{g(a)},[]);return{splits:d.splits,widths:d.widths,addSplit:k,removeSplit:l,setSplitInstance:m,setSplitWidth:n,resetWidths:o,availableInstanceIds:p,focusedSplitIndex:f,setFocusedSplitIndex:q}}(a,b,c),w=(0,h.useMemo)(()=>{let a=new Map;for(let c of b)a.set(c.id,c);return a},[b]),x=(0,k.c)("worktree"),{visible:y,toggle:z,setWidth:A}=cc(),{collapsed:B,toggle:C}=e7(),D=!B,E=(0,h.useRef)(null),[F,G]=(0,h.useState)(!1),H=(0,h.useRef)(m.length),[I,J]=(0,h.useState)(null);(0,h.useEffect)(()=>{m.length>H.current&&J(m.length-1),H.current=m.length},[m.length]),(0,h.useEffect)(()=>{f?.(u)},[u,f]);let K=(0,h.useRef)(0),L=(0,h.useRef)(m);L.current=m,(0,h.useEffect)(()=>{if(!l||l.token===K.current)return;K.current=l.token;let{instanceId:a}=l,b=L.current.findIndex(b=>b.instanceId===a);if(0!==b){if(b>0)return void v(b);q(0,a)&&v(0)}},[l,q,v]),(0,h.useEffect)(()=>{if(null===I)return;let a=E.current;if(!a)return;let b=a.querySelector(`[data-split-index="${I}"]`);if(!b)return;let c=b.querySelector("textarea");c?.focus(),v(I),J(null)},[I,v]);let M=(0,h.useCallback)((a,b)=>{let c=E.current;if(!c)return;let d=c.offsetWidth;if(0===d)return;let e=n.reduce((a,b)=>a+b,0),f=b/d*e,g=[...n],h=g[a]+f,i=g[a+1]-f,j=.05*e;h<j||i<j||(g[a]=h,g[a+1]=i,r(g))},[n,r]),N=(0,h.useCallback)(()=>G(!0),[]),O=(0,h.useCallback)(()=>G(!1),[]),P=(0,h.useCallback)(()=>{s(),A(40)},[s,A]),Q=m.length<3&&!F,R=m.length>1&&!F,S=m.length>1||y,T=(0,h.useMemo)(()=>m.map((a,b)=>()=>v(b)),[m,v]),U=(0,h.useMemo)(()=>m.map((a,b)=>a=>q(b,a)),[m,q]),V=(0,h.useMemo)(()=>m.map((a,b)=>a=>{let c=(0,a7.sw)(w.get(a)??{cliTool:"claude",alias:a});if(m[b]?.instanceId===a)return;let d=m.findIndex((c,d)=>d!==b&&c.instanceId===a);if(-1!==d)return void g?.(`${c} is already in use by split ${d+1}`,"warning");q(b,a)&&(j?.(a),g?.(`Moved ${c} to Split ${b+1}`,"success"))}),[m,q,g,j,w]);return(0,e.jsxs)("div",{role:"group","aria-label":"Terminal splits","data-testid":"terminal-split-container",className:"flex flex-col h-full min-h-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 bg-surface border-b border-border flex-shrink-0",children:[(0,e.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums mr-1",children:[m.length," / ",3," splits"]}),(0,e.jsx)("button",{type:"button",onClick:o,disabled:!Q,"aria-disabled":!Q,"aria-label":x("terminal.addSplit"),title:x("terminal.addSplit"),"data-testid":"add-terminal-split",className:"flex items-center justify-center h-7 w-7 rounded text-muted-foreground hover:text-surface-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",children:(0,e.jsx)(dA,{className:"w-4 h-4","aria-hidden":"true"})}),(0,e.jsx)("button",{type:"button",onClick:p,disabled:!R,"aria-disabled":!R,"aria-label":x("terminal.removeSplit"),title:x("terminal.removeSplit"),"data-testid":"remove-terminal-split",className:"flex items-center justify-center h-7 w-7 rounded text-muted-foreground hover:text-surface-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",children:(0,e.jsx)(e9.A,{className:"w-4 h-4","aria-hidden":"true"})}),(0,e.jsx)("button",{type:"button",onClick:P,disabled:!S,"aria-disabled":!S,"aria-label":x("terminal.equalizeWidthsHint"),title:x("terminal.equalizeWidthsHint"),"data-testid":"equalize-split-widths",className:"flex items-center justify-center h-7 w-7 rounded text-muted-foreground hover:text-surface-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",children:(0,e.jsx)(fa,{className:"w-4 h-4 flex-shrink-0","aria-hidden":"true"})}),(0,e.jsx)("div",{className:"ml-auto h-4 w-px bg-border","aria-hidden":"true"}),(0,e.jsxs)("button",{type:"button",onClick:z,"aria-pressed":y,"aria-label":x(y?"terminal.hideHistory":"terminal.showHistory"),title:x(y?"terminal.hideHistory":"terminal.showHistory"),"data-testid":"toggle-history-pane",className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded border transition-colors ${y?"border-accent-300 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300":"border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[(0,e.jsx)(fb,{className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true"}),(0,e.jsx)("span",{children:x("terminal.historyLabel")})]}),(0,e.jsxs)("button",{type:"button",onClick:C,"aria-pressed":D,"aria-label":x(D?"terminal.hideFiles":"terminal.showFiles"),title:x(D?"terminal.hideFiles":"terminal.showFiles"),"data-testid":"toggle-file-panel",className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded border transition-colors ${D?"border-accent-300 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300":"border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[(0,e.jsx)(fc,{className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true"}),(0,e.jsx)("span",{children:x("terminal.filesLabel")})]})]}),(0,e.jsx)("div",{ref:E,className:"flex flex-1 min-h-0 w-full",children:m.map((a,b)=>{let c=b===m.length-1;return(0,e.jsxs)(i().Fragment,{children:[(0,e.jsx)("div",{style:{flexGrow:n[b]??1,flexShrink:1,flexBasis:0,minWidth:0},className:"h-full",children:d({splitIndex:b,cliToolId:a.cliToolId,instanceId:a.instanceId,instance:w.get(a.instanceId),availableInstances:t(b).map(a=>w.get(a)).filter(a=>void 0!==a),onInstanceChange:U[b],onFocus:T[b],isFocused:u===b,onDropInstance:V[b]})}),c?null:(0,e.jsx)(fg,{resizerIdx:b,ariaValueNow:n.length?n[b]/n.reduce((a,b)=>a+b,0)*100:50,onResize:M,onStart:N,onEnd:O,onDoubleClick:s})]},`split-${b}`)})})]})});function fg({resizerIdx:a,ariaValueNow:b,onResize:c,onStart:d,onEnd:f,onDoubleClick:g}){let i=(0,h.useCallback)(b=>c(a,b),[a,c]);return(0,e.jsx)("div",{"data-testid":`split-resizer-${a}`,onMouseDownCapture:d,onTouchStartCapture:d,onMouseUpCapture:f,onTouchEndCapture:f,children:(0,e.jsx)(ch,{onResize:i,orientation:"horizontal",ariaValueNow:b,onDoubleClick:g})})}let fh={key:"Escape",label:"Esc",ariaLabel:"Send Escape"},fi=[fh,{key:"q",label:"q",ariaLabel:"Send q (quit)"}];function fj({worktreeId:a,cliToolId:b,instanceId:c,onKeysSent:d}){let[f,g]=(0,h.useState)(null),i=ai(a,b,c,d),j="codex"===b?fi:[fh],k=(0,h.useCallback)(a=>{g(a),setTimeout(()=>g(null),ah.tX),i([a])},[i]);return(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 py-1.5 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800/50 rounded-lg",role:"toolbar","aria-label":"Terminal escape keys",children:[(0,e.jsx)("span",{className:"text-xs text-amber-700 dark:text-amber-400 mx-2",title:"Send an escape key when the terminal is stuck in a TUI mode",children:"Escape"}),j.map(({key:a,label:b,ariaLabel:c})=>(0,e.jsx)("button",{type:"button",className:`min-w-[44px] min-h-[44px] px-3 py-2 text-sm font-medium rounded-md
|
|
30
|
+
${b.trim()}`:c}(s,g))})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:s("git.stash.messagePlaceholder"),className:"w-full px-2 py-1 text-xs border border-input rounded bg-surface dark:bg-surface-2 text-foreground","data-testid":"git-stash-push-message"}),(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,e.jsx)(n.Sc,{checked:y,onCheckedChange:a=>z(!0===a),"data-testid":"git-stash-include-untracked"}),s("git.stash.includeUntracked")]}),(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>{l(w,y),x(""),z(!1)},className:"px-2 py-1 text-xs rounded bg-accent-600 hover:bg-accent-700 text-white disabled:opacity-50","data-testid":"stash-push-button",children:s("git.stash.push")})]})]}),b?(0,e.jsx)("div",{className:"py-3 text-center text-xs text-muted-foreground",role:"status",children:s("git.stash.loading")}):0===a.length?(0,e.jsx)("div",{className:"py-3 text-center text-xs text-muted-foreground",children:s("git.stash.empty")}):(0,e.jsx)("ul",{className:"divide-y divide-border",children:a.map(a=>(0,e.jsx)("li",{className:"py-1.5","data-testid":"git-stash-row",children:(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("span",{className:"font-mono text-xs text-accent-600 dark:text-accent-400",children:["stash@","{",a.index,"}"]}),(0,e.jsx)("span",{className:"ml-2 text-xs text-foreground truncate",children:a.message})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>o(a.index),className:"px-1.5 py-0.5 text-xs rounded border border-input hover:bg-muted disabled:opacity-50","data-testid":"stash-apply-button",children:s("git.stash.apply")}),(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>m(a.index),className:"px-1.5 py-0.5 text-xs rounded border border-input hover:bg-muted disabled:opacity-50","data-testid":"stash-pop-button",children:s("git.stash.pop")}),(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>B(a.index),className:"px-1.5 py-0.5 text-xs rounded border border-danger-border text-danger-foreground hover:bg-danger-subtle disabled:opacity-50","data-testid":"stash-drop-button",children:s("git.stash.drop")})]})]})},a.index))})]}),null!==A&&(0,e.jsxs)("div",{className:"px-3 py-3 border-t border-danger-border bg-danger-subtle","data-testid":"git-stash-drop-confirm",role:"dialog",children:[(0,e.jsxs)("p",{className:"text-xs text-danger-foreground",children:["stash@","{",A,"}",s("git.stash.dropConfirmSuffix")]}),i&&(0,e.jsx)("p",{className:"mt-1 text-xs text-danger-foreground","data-testid":"git-stash-drop-session-warning",children:s("git.danger.runningSessionWarning")}),(0,e.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,e.jsx)("button",{type:"button",disabled:d,onClick:()=>{p(A),B(null)},className:"px-2 py-1 text-xs rounded bg-danger hover:bg-danger/90 text-white disabled:opacity-50","data-testid":"git-stash-drop-confirm-button",children:s("git.stash.drop")}),(0,e.jsx)("button",{type:"button",onClick:()=>B(null),className:"px-2 py-1 text-xs rounded border border-input hover:bg-muted",children:t("cancel")})]})]})]})}),ei={soft:"git.danger.modeSoft",mixed:"git.danger.modeMixed",hard:"git.danger.modeHard"},ej=(0,h.memo)(function({selectedCommit:a,busy:b,actionError:c,conflictNotice:d,currentBranch:f,aheadCount:g,hasRunningSession:i,onReset:j,onRevert:l,onForcePush:m}){let{isMobile:o,onInsertToMessage:p}=d$(),q=(0,k.c)("worktree"),r=(0,k.c)("common"),[s,t]=(0,h.useState)(!1),[u,v]=(0,h.useState)("mixed"),[w,x]=(0,h.useState)(!0),[y,z]=(0,h.useState)(""),[A,B]=(0,h.useState)(!1),[C,D]=(0,h.useState)(!1),[E,F]=(0,h.useState)(!1),[G,H]=(0,h.useState)(!1),[I,J]=(0,h.useState)(!0),K=w?"HEAD":a,L=!w&&!a;return(0,e.jsxs)("div",{className:"border-t-2 border-danger-border","data-testid":"git-danger-zone-section",children:[(0,e.jsxs)("button",{type:"button",onClick:()=>t(a=>!a),className:"w-full flex items-center gap-1 px-3 py-2 text-sm font-medium text-danger-foreground bg-danger-subtle cursor-pointer hover:bg-danger-subtle","data-testid":"git-danger-zone-toggle",children:[(0,e.jsx)("span",{className:"text-xs w-4 text-center",children:s?"▼":"▶"}),q("git.danger.title")]}),s&&(0,e.jsxs)("div",{className:"px-3 py-3 space-y-2 bg-danger-subtle",children:[c&&(0,e.jsx)("div",{className:"text-xs text-danger-foreground",role:"alert","data-testid":"git-danger-zone-error",children:c}),d&&(0,e.jsx)("div",{className:"text-xs text-warning-foreground",role:"status","data-testid":"git-danger-zone-conflict",children:d}),(0,e.jsxs)("div",{className:`flex ${o?"flex-col":"flex-row"} gap-2`,children:[(0,e.jsx)("button",{type:"button",onClick:()=>B(!0),className:"px-2 py-1 text-xs rounded border border-danger-border text-danger-foreground hover:bg-danger-subtle","data-testid":"git-danger-zone-reset-open",children:q("git.danger.resetOpen")}),(0,e.jsx)("button",{type:"button",disabled:!a,onClick:()=>D(!0),className:"px-2 py-1 text-xs rounded border border-danger-border text-danger-foreground hover:bg-danger-subtle disabled:opacity-50","data-testid":"git-danger-zone-revert-open",children:q("git.danger.revertOpen")}),m&&(0,e.jsx)("button",{type:"button",disabled:b,onClick:()=>H(!0),className:"px-2 py-1 text-xs rounded border border-danger-border text-danger-foreground hover:bg-danger-subtle disabled:opacity-50","data-testid":"git-force-push-open",children:q("git.danger.forcePushOpen")})]}),!a&&(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:q("git.danger.selectCommitHint")})]}),A&&(0,e.jsxs)("div",{className:"px-3 py-3 border-t border-danger-border bg-danger-subtle","data-testid":"reset-confirm",role:"dialog",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-danger-foreground mb-2",children:q("git.danger.resetTitle")}),(0,e.jsxs)(n.z6,{value:w?"head":"commit",onValueChange:a=>x("head"===a),name:"reset-target",className:"flex flex-col gap-1 mb-2",children:[(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground",children:[(0,e.jsx)(n.CU,{value:"head","data-testid":"reset-target-head"}),q("git.danger.resetTargetHead")]}),(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground",children:[(0,e.jsx)(n.CU,{value:"commit",disabled:!a,"data-testid":"reset-target-commit"}),q("git.danger.resetTargetSelectedPrefix"),a?q("git.danger.resetTargetSelectedHash",{hash:a.slice(0,7)}):q("git.danger.resetTargetNoneSelected")]})]}),(0,e.jsx)(n.z6,{value:u,onValueChange:a=>v(a),name:"reset-mode",className:"flex flex-col gap-1 mb-2",children:["soft","mixed","hard"].map(a=>(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground",children:[(0,e.jsx)(n.CU,{value:a,"data-testid":`reset-mode-${a}`}),q(ei[a])]},a))}),"hard"===u&&(0,e.jsxs)("div",{className:"mb-2 space-y-1",children:[(0,e.jsx)("p",{className:"text-xs text-danger-foreground","data-testid":"reset-hard-history-loss-warning",children:q("git.danger.resetHardWarning")}),i&&(0,e.jsx)("p",{className:"text-xs text-danger-foreground","data-testid":"reset-hard-session-warning",children:q("git.danger.runningSessionWarning")}),(0,e.jsx)("input",{type:"text",value:y,onChange:a=>z(a.target.value),placeholder:q("git.danger.confirmPlaceholder",{branch:f??""}),className:"w-full px-2 py-1 text-xs border border-danger-border rounded bg-surface dark:bg-surface-2 text-foreground","data-testid":"reset-hard-branch-input"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[p&&(0,e.jsx)(d6,{className:"mr-auto",testId:"reset-ask-ai",disabled:L,onClick:()=>{K&&(p("hard"===u?q("git.aiPrompts.resetHard",{target:ee(K)}):q("git.aiPrompts.reset",{target:ee(K),mode:u})),B(!1),z(""))}}),(0,e.jsx)("button",{type:"button",disabled:b||L||"hard"===u&&y!==(f??""),onClick:()=>{K&&(j(K,u,"hard"===u?y:void 0),B(!1),z(""))},className:"px-2 py-1 text-xs rounded bg-danger hover:bg-danger/90 text-white disabled:opacity-50","data-testid":"reset-confirm-button",children:q("git.danger.reset")}),(0,e.jsx)("button",{type:"button",onClick:()=>{B(!1),z("")},className:"px-2 py-1 text-xs rounded border border-border hover:bg-muted",children:r("cancel")})]})]}),C&&a&&(0,e.jsxs)("div",{className:"px-3 py-3 border-t border-danger-border bg-danger-subtle","data-testid":"revert-confirm",role:"dialog",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-danger-foreground mb-2",children:q("git.danger.revertTitle")}),(0,e.jsxs)("p",{className:"text-xs text-foreground mb-2",children:[q("git.danger.revertBodyPrefix"),(0,e.jsx)("span",{className:"font-mono",children:a.slice(0,7)})]}),i&&(0,e.jsx)("p",{className:"mb-2 text-xs text-danger-foreground","data-testid":"revert-session-warning",children:q("git.danger.runningSessionWarning")}),(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground mb-2",children:[(0,e.jsx)(n.Sc,{checked:E,onCheckedChange:a=>F(!0===a),"data-testid":"revert-no-commit"}),q("git.danger.revertNoCommit")]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[p&&(0,e.jsx)(d6,{className:"mr-auto",testId:"revert-ask-ai",onClick:()=>{p(q("git.aiPrompts.revert",{commit:ee(a.slice(0,7))})),D(!1),F(!1)}}),(0,e.jsx)("button",{type:"button",disabled:b,onClick:()=>{l(a,E),D(!1),F(!1)},className:"px-2 py-1 text-xs rounded bg-danger hover:bg-danger/90 text-white disabled:opacity-50","data-testid":"revert-confirm-button",children:q("git.danger.revert")}),(0,e.jsx)("button",{type:"button",onClick:()=>{D(!1),F(!1)},className:"px-2 py-1 text-xs rounded border border-border hover:bg-muted",children:r("cancel")})]})]}),G&&m&&(0,e.jsxs)("div",{className:"px-3 py-3 border-t border-danger-border bg-danger-subtle","data-testid":"force-push-confirm",role:"dialog",children:[(0,e.jsx)("p",{className:"text-sm font-medium text-danger-foreground mb-2",children:q("git.danger.forcePushTitle")}),(0,e.jsx)("p",{className:"mb-2 text-xs text-danger-foreground","data-testid":"force-push-protected-branch-warning",children:q("git.danger.protectedBranchWarning")}),i&&(0,e.jsx)("p",{className:"mb-2 text-xs text-danger-foreground","data-testid":"force-push-session-warning",children:q("git.danger.runningSessionWarning")}),(0,e.jsxs)("label",{className:"flex items-center gap-1 text-xs text-foreground mb-2",children:[(0,e.jsx)(n.Sc,{checked:I,onCheckedChange:a=>J(!0===a),"data-testid":"force-push-with-lease"}),q("git.danger.forceWithLease")]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[p&&(0,e.jsx)(d6,{className:"mr-auto",testId:"force-push-ask-ai",onClick:()=>{p(function(a,{branch:b,ahead:c}){let d=b?ee(b):a("git.aiPrompts.forcePushCurrentBranch");return a("number"==typeof c&&c>0?"git.aiPrompts.forcePushAhead":"git.aiPrompts.forcePush",{branchRef:d,upstream:ee(`origin/${b??"<branch>"}`),ahead:c??0})}(q,{branch:f,ahead:g??null})),H(!1)}}),(0,e.jsx)("button",{type:"button",disabled:b,onClick:()=>{m(I),H(!1)},className:"px-2 py-1 text-xs rounded bg-danger hover:bg-danger/90 text-white disabled:opacity-50","data-testid":"force-push-confirm-button",children:q("git.danger.forcePush")}),(0,e.jsx)("button",{type:"button",onClick:()=>H(!1),className:"px-2 py-1 text-xs rounded border border-border hover:bg-muted",children:r("cancel")})]})]})]})}),ek=(0,h.memo)(function({worktreeId:a,onDiffSelect:b,isMobile:c=!1,worktree:d,onInsertToMessage:f,className:g=""}){let i=(0,k.c)("worktree"),{activeTab:j,setActiveTab:l,historyOpen:m,toggleHistory:o,advancedOpen:p,toggleAdvanced:q}=function(){let{value:a,setValue:b,isAvailable:c}=(0,dP.V)({key:dS.activeTab,defaultValue:"status",validate:dT}),{value:d,setValue:e}=(0,dP.V)({key:dS.historyOpen,defaultValue:!0,validate:dU}),{value:f,setValue:g}=(0,dP.V)({key:dS.advancedOpen,defaultValue:!1,validate:dU}),i=(0,h.useCallback)(a=>b(a),[b]);return{activeTab:a,setActiveTab:i,historyOpen:d,toggleHistory:(0,h.useCallback)(()=>e(a=>!a),[e]),advancedOpen:f,toggleAdvanced:(0,h.useCallback)(()=>g(a=>!a),[g]),isPersistent:c}}(),r=Object.values(d?.sessionStatusByCli??{}).some(a=>a?.isRunning===!0),{gitStatus:s,statusLoading:t,statusError:u,fetchStatus:v}=function(a){let[b,c]=(0,h.useState)(null),[d,e]=(0,h.useState)(!0),[f,g]=(0,h.useState)(null);return{gitStatus:b,statusLoading:d,statusError:f,fetchStatus:(0,h.useCallback)(async()=>{g(null);try{let b=await fetch(`/api/worktrees/${a}/git/status`);if(!b.ok){let a=await b.json().catch(()=>({}));g(a.error||"Failed to fetch git status");return}let d=await b.json();c(d)}catch{g("Failed to fetch git status")}finally{e(!1)}},[a])}}(a),{commits:w,selectedCommit:x,changedFiles:y,inlineDiffCommit:z,inlineFiles:A,inlineFilesLoading:B,inlineFilesError:C,selectedFile:D,diffContent:E,isLoading:F,isLoadingFiles:G,isLoadingDiff:H,commitError:I,detailError:J,setDiffContent:K,fetchCommits:L,handleCommitSelect:M,handleFileSelect:N,handleToggleInlineDiff:O,handleInlineDiffFile:P,handleRefresh:Q}=function(a,b){let[c,d]=(0,h.useState)([]),[e,f]=(0,h.useState)(null),[g,i]=(0,h.useState)([]),[j,k]=(0,h.useState)(null),[l,m]=(0,h.useState)([]),[n,o]=(0,h.useState)(!1),[p,q]=(0,h.useState)(null),[r,s]=(0,h.useState)(null),[t,u]=(0,h.useState)(null),[v,w]=(0,h.useState)(!0),[x,y]=(0,h.useState)(!1),[z,A]=(0,h.useState)(!1),[B,C]=(0,h.useState)(null),[D,E]=(0,h.useState)(null),F=(0,h.useCallback)(async()=>{w(!0),C(null);try{let b=await fetch(`/api/worktrees/${a}/git/log`);if(!b.ok){let a=await b.json();C(a.error||"Failed to fetch commit history");return}let c=await b.json();d(c.commits)}catch{C("Failed to fetch commit history")}finally{w(!1)}},[a]),G=(0,h.useCallback)(async b=>{y(!0),i([]),s(null),u(null),E(null);try{let c=await fetch(`/api/worktrees/${a}/git/show/${b}`);if(!c.ok){let a=await c.json();E(a.error||"Failed to fetch commit details");return}let d=await c.json();i(d.files)}catch{E("Failed to fetch commit details")}finally{y(!1)}},[a]),H=(0,h.useCallback)(async(c,d)=>{A(!0),u(null),E(null);try{let e=await fetch(`/api/worktrees/${a}/git/diff?commit=${c}&file=${encodeURIComponent(d)}`);if(!e.ok){let a=await e.json();E(a.error||"Failed to fetch diff");return}let f=await e.json();u(f.diff),b(f.diff,d)}catch{E("Failed to fetch diff")}finally{A(!1)}},[a,b]),I=(0,h.useCallback)(a=>{f(a),G(a)},[G]),J=(0,h.useCallback)(a=>{e&&(s(a),H(e,a))},[e,H]),K=(0,h.useCallback)(async b=>{if(j===b){k(null),m([]),q(null);return}k(b),m([]),q(null),o(!0);try{let c=await fetch(`/api/worktrees/${a}/git/show/${b}`);if(!c.ok){let a=await c.json().catch(()=>({}));q(a.error||"Failed to fetch commit details");return}let d=await c.json();m(Array.isArray(d.files)?d.files:[])}catch{q("Failed to fetch commit details")}finally{o(!1)}},[a,j]),L=(0,h.useCallback)((a,b)=>{f(a),s(b),i(l),H(a,b)},[l,H]),M=(0,h.useCallback)(()=>{f(null),i([]),s(null),u(null),E(null),F()},[F]);return{commits:c,selectedCommit:e,changedFiles:g,inlineDiffCommit:j,inlineFiles:l,inlineFilesLoading:n,inlineFilesError:p,selectedFile:r,diffContent:t,isLoading:v,isLoadingFiles:x,isLoadingDiff:z,commitError:B,detailError:D,setDiffContent:u,fetchCommits:F,handleCommitSelect:I,handleFileSelect:J,handleToggleInlineDiff:K,handleInlineDiffFile:L,handleRefresh:M}}(a,b),R=(0,h.useCallback)(async()=>{await L(),await v()},[L,v]),{staged:S,stagedLoading:T,stagedError:U,opBusy:V,commitMessage:W,setCommitMessage:X,amend:Y,setAmend:Z,committing:$,changesCommitError:_,fetchStaged:aa,handleStage:ab,handleUnstage:ac,handleChangesDiff:ad,fetchWorkingDiffText:ae,commit:af,commitAndPush:ag}=function(a,b){let{onWorkingDiff:c,onCommitted:d}=b,[e,f]=(0,h.useState)(null),[g,i]=(0,h.useState)(!0),[j,k]=(0,h.useState)(null),[l,m]=(0,h.useState)(!1),[n,o]=(0,h.useState)(""),[p,q]=(0,h.useState)(!1),[r,s]=(0,h.useState)(!1),[t,u]=(0,h.useState)(null),v=(0,h.useCallback)(async()=>{k(null);try{let b=await fetch(`/api/worktrees/${a}/git/staged`);if(!b.ok){let a=await b.json().catch(()=>({}));k(a.error||"Failed to fetch changes");return}let c=await b.json();f(c)}catch{k("Failed to fetch changes")}finally{i(!1)}},[a]),w=(0,h.useCallback)(async b=>{m(!0),k(null);try{let c=await fetch(`/api/worktrees/${a}/git/stage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:[b]})});if(!c.ok){let a=await c.json().catch(()=>({}));k(a.error||"Failed to stage file");return}await v()}catch{k("Failed to stage file")}finally{m(!1)}},[a,v]),x=(0,h.useCallback)(async b=>{m(!0),k(null);try{let c=await fetch(`/api/worktrees/${a}/git/unstage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:[b]})});if(!c.ok){let a=await c.json().catch(()=>({}));k(a.error||"Failed to unstage file");return}await v()}catch{k("Failed to unstage file")}finally{m(!1)}},[a,v]),y=(0,h.useCallback)(async()=>{u(null);try{let b=await fetch(`/api/worktrees/${a}/git/commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:n,amend:p})});if(!b.ok){let a=await b.json().catch(()=>({}));return u(a.error||"Failed to commit"),!1}return o(""),q(!1),await v(),await d(),!0}catch{return u("Failed to commit"),!1}},[a,n,p,v,d]),z=(0,h.useCallback)(async()=>{s(!0);try{await y()}finally{s(!1)}},[y]),A=(0,h.useCallback)(async a=>{s(!0);try{await y()&&await a()}finally{s(!1)}},[y]);return{staged:e,stagedLoading:g,stagedError:j,opBusy:l,commitMessage:n,setCommitMessage:o,amend:p,setAmend:q,committing:r,changesCommitError:t,fetchStaged:v,handleStage:w,handleUnstage:x,handleChangesDiff:(0,h.useCallback)(async(b,d)=>{try{let e=await fetch(`/api/worktrees/${a}/git/working-diff?file=${encodeURIComponent(b)}&mode=${d}`);if(!e.ok)return;let f=await e.json();"string"==typeof f.diff&&c(f.diff,b)}catch{}},[a,c]),fetchWorkingDiffText:(0,h.useCallback)(async(b,c)=>{try{let d=await fetch(`/api/worktrees/${a}/git/working-diff?file=${encodeURIComponent(b)}&mode=${c}`);if(!d.ok)return null;let e=await d.json();return"string"==typeof e.diff?e.diff:null}catch{return null}},[a]),commit:z,commitAndPush:A}}(a,{onWorkingDiff:(0,h.useCallback)((a,c)=>{K(a),b(a,c)},[K,b]),onCommitted:R}),{branches:ah,branchInclude:ai,branchesLoading:aj,branchesError:ak,branchBusy:al,branchActionError:am,fetchBranches:an,handleBranchIncludeChange:ao,handleBranchesRefresh:ap,handleCheckout:aq,handleBranchCreate:ar,handleBranchDelete:as}=function(a,b){let{onCheckoutCascade:c}=b,[d,e]=(0,h.useState)([]),[f,g]=(0,h.useState)("local"),[i,j]=(0,h.useState)(!0),[k,l]=(0,h.useState)(null),[m,n]=(0,h.useState)(!1),[o,p]=(0,h.useState)(null),q=(0,h.useCallback)(async b=>{l(null);try{let c=await fetch(`/api/worktrees/${a}/git/branches?include=${b}`);if(!c.ok){let a=await c.json().catch(()=>({}));l(a.error||"Failed to fetch branches");return}let d=await c.json();e(Array.isArray(d.branches)?d.branches:[])}catch{l("Failed to fetch branches")}finally{j(!1)}},[a]),r=(0,h.useCallback)(a=>{g(a)},[]),s=(0,h.useCallback)(()=>{q(f)},[q,f]),t=(0,h.useCallback)(async(b,d)=>{n(!0),p(null);try{let e=await fetch(`/api/worktrees/${a}/git/checkout`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({branch:b.name,force:d})});if(!e.ok){let a=await e.json().catch(()=>({}));p(a.error||"Failed to checkout branch");return}await Promise.all([c(),q(f)])}catch{p("Failed to checkout branch")}finally{n(!1)}},[a,f,c,q]),u=(0,h.useCallback)(async(b,c)=>{n(!0),p(null);try{let d=await fetch(`/api/worktrees/${a}/git/branch/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b,from:c})});if(!d.ok){let a=await d.json().catch(()=>({}));p(a.error||"Failed to create branch");return}await q(f)}catch{p("Failed to create branch")}finally{n(!1)}},[a,f,q]),v=(0,h.useCallback)(async(b,c)=>{n(!0),p(null);try{let d=await fetch(`/api/worktrees/${a}/git/branch/delete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b,force:c})});if(!d.ok){let a=await d.json().catch(()=>({}));p(a.error||"Failed to delete branch");return}await q(f)}catch{p("Failed to delete branch")}finally{n(!1)}},[a,f,q]);return{branches:d,branchInclude:f,branchesLoading:i,branchesError:k,branchBusy:m,branchActionError:o,fetchBranches:q,handleBranchIncludeChange:r,handleBranchesRefresh:s,handleCheckout:t,handleBranchCreate:u,handleBranchDelete:v}}(a,{onCheckoutCascade:(0,h.useCallback)(async()=>{await Promise.all([v(),aa(),L()])},[v,aa,L])}),{stashes:at,stashLoading:au,stashError:av,stashBusy:aw,stashActionError:ax,stashConflictNotice:ay,fetchStash:az,handleStashPush:aA,handleStashPop:aB,handleStashApply:aC,handleStashDrop:aD}=function(a,b){let{onStashMutated:c}=b,[d,e]=(0,h.useState)([]),[f,g]=(0,h.useState)(!0),[i,j]=(0,h.useState)(null),[k,l]=(0,h.useState)(!1),[m,n]=(0,h.useState)(null),[o,p]=(0,h.useState)(null),q=(0,h.useCallback)(async()=>{j(null);try{let b=await fetch(`/api/worktrees/${a}/git/stash`);if(!b.ok){let a=await b.json().catch(()=>({}));j(a.error||"Failed to fetch stashes");return}let c=await b.json();e(Array.isArray(c.stashes)?c.stashes:[])}catch{j("Failed to fetch stashes")}finally{g(!1)}},[a]),r=(0,h.useCallback)(async()=>{await Promise.all([q(),c()])},[q,c]),s=(0,h.useCallback)(async(a,b,c)=>{l(!0),n(null),p(null);try{let d=await fetch(a,b),e=await d.json().catch(()=>({}));if(!d.ok)return void n(e.error||c);if(e.conflict){let a=Array.isArray(e.conflictFiles)?e.conflictFiles.join(", "):"",b=e.stashRetained?" (stash retained)":"";p(`Stash operation produced conflicts: ${a}${b}`)}await r()}catch{n(c)}finally{l(!1)}},[r]),t=(0,h.useCallback)((b,c)=>{s(`/api/worktrees/${a}/git/stash/push`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:b||void 0,includeUntracked:c})},"Failed to stash changes")},[a,s]),u=(0,h.useCallback)(b=>{s(`/api/worktrees/${a}/git/stash/pop`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:b})},"Failed to pop stash")},[a,s]);return{stashes:d,stashLoading:f,stashError:i,stashBusy:k,stashActionError:m,stashConflictNotice:o,fetchStash:q,handleStashPush:t,handleStashPop:u,handleStashApply:(0,h.useCallback)(b=>{s(`/api/worktrees/${a}/git/stash/apply`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({index:b})},"Failed to apply stash")},[a,s]),handleStashDrop:(0,h.useCallback)(b=>{s(`/api/worktrees/${a}/git/stash/${b}`,{method:"DELETE"},"Failed to drop stash")},[a,s])}}(a,{onStashMutated:(0,h.useCallback)(async()=>{await Promise.all([v(),aa()])},[v,aa])}),{dangerBusy:aE,dangerActionError:aF,dangerConflictNotice:aG,handleReset:aH,handleRevert:aI}=function(a,b){let{onHeadMoved:c}=b,[d,e]=(0,h.useState)(!1),[f,g]=(0,h.useState)(null),[i,j]=(0,h.useState)(null);return{dangerBusy:d,dangerActionError:f,dangerConflictNotice:i,handleReset:(0,h.useCallback)(async(b,d,f)=>{e(!0),g(null),j(null);try{let e=await fetch(`/api/worktrees/${a}/git/reset`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:b,mode:d,confirmBranch:f})});if(!e.ok){let a=await e.json().catch(()=>({}));g(a.error||"Failed to reset");return}await c()}catch{g("Failed to reset")}finally{e(!1)}},[a,c]),handleRevert:(0,h.useCallback)(async(b,d)=>{e(!0),g(null),j(null);try{let e=await fetch(`/api/worktrees/${a}/git/revert`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({commitHash:b,noCommit:d})});if(!e.ok){let a=await e.json().catch(()=>({}));g(a.error||"Failed to revert");return}let f=await e.json().catch(()=>({}));if(f.conflict){let a=Array.isArray(f.conflictFiles)?f.conflictFiles.join(", "):"";j(`Revert produced conflicts: ${a}`)}await c()}catch{g("Failed to revert")}finally{e(!1)}},[a,c])}}(a,{onHeadMoved:(0,h.useCallback)(async()=>{await Promise.all([v(),aa(),an(ai),L()])},[v,aa,an,ai,L])}),{operation:aJ,progressState:aK,error:aL,errorReason:aM,conflict:aN,conflictFiles:aO,runFetch:aP,runPull:aQ,runPush:aR,abort:aS}=function(a,b={}){let{onCascade:c}=b,[d,e]=(0,h.useState)(null),[f,g]=(0,h.useState)("idle"),[i,j]=(0,h.useState)(null),[k,l]=(0,h.useState)(null),[m,n]=(0,h.useState)(!1),[o,p]=(0,h.useState)([]),q=(0,h.useRef)(null),r=(0,h.useRef)(c),s=(0,h.useCallback)(async(b,c,d)=>{j(null),l(null),n(!1),p([]),e(b),g("running");let f=new AbortController;q.current=f;try{let e=await fetch(`/api/worktrees/${a}/git/${c}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d),signal:f.signal});if(!e.ok){var h,i;let a=await e.json().catch(()=>({}));l((h=a?.reason,"auth_failed"===h?"auth_failed":"protected_branch"===h?"protected_branch":null)),j((i=a?.error,"string"==typeof i&&i.length>0?i:null)),g("error");return}let k=await e.json().catch(()=>({success:!0}));"pull"===b&&k?.conflict&&(n(!0),p(Array.isArray(k.conflictFiles)?k.conflictFiles:[])),g("idle")}catch(a){a instanceof Error&&"AbortError"===a.name?g("idle"):(j(null),l(null),g("error"))}finally{e(null),q.current=null,r.current?.(b)}},[a]),t=(0,h.useCallback)(a=>{let b={prune:!0===a.prune};return void 0!==a.remote&&(b.remote=a.remote),s("fetch","fetch",b)},[s]),u=(0,h.useCallback)(a=>{let b={rebase:!0===a.rebase,ffOnly:!0===a.ffOnly};return void 0!==a.remote&&(b.remote=a.remote),void 0!==a.branch&&(b.branch=a.branch),s("pull","pull",b)},[s]);return{operation:d,progressState:f,error:i,errorReason:k,conflict:m,conflictFiles:o,runFetch:t,runPull:u,runPush:(0,h.useCallback)(a=>{let b={force:!0===a.force,forceWithLease:!0===a.forceWithLease,setUpstream:!0===a.setUpstream};return void 0!==a.remote&&(b.remote=a.remote),void 0!==a.branch&&(b.branch=a.branch),s("push","push",b)},[s]),abort:(0,h.useCallback)(()=>{q.current?.abort()},[])}}(a,{onCascade:(0,h.useCallback)(a=>{v(),an(ai),"pull"===a&&(aa(),L())},[v,an,ai,aa,L])}),aT="auth_failed"===aM?i("git.network.authFailedGuidance"):"protected_branch"===aM?i("git.danger.protectedBranchWarning"):aL,aU="running"===aK&&("push"===aJ||"pull"===aJ),aV=s?.aheadBehind!=null,aW=(0,h.useCallback)(()=>ag(()=>aR({setUpstream:!aV})),[ag,aR,aV]);cM({intervalMs:5e3,enabled:"running"!==aK,onPoll:v});let aX=(0,h.useMemo)(()=>({isMobile:c,onDiffSelect:b,onInsertToMessage:f}),[c,b,f]),aY=(0,e.jsx)(d9,{gitStatus:s,statusLoading:t,statusError:u,onRefresh:v}),aZ=(0,e.jsx)(ea,{progressState:aK,operation:aJ,error:aT,conflict:aN,conflictFiles:aO,hasUpstream:aV,onPull:()=>aQ({}),onPush:()=>aR({setUpstream:!aV}),onAbort:aS,extraActions:(0,e.jsx)(dW,{branches:ah,busy:al||aU,actionError:am,hasRunningSession:r,isMobile:c,onCheckout:aq})}),a$=(0,e.jsx)(ec,{staged:S,loading:T,error:U,busy:V||aU,commitMessage:W,amend:Y,committing:$,commitError:_,onRefresh:aa,onDiff:ad,onPreview:ae,onStage:ab,onUnstage:ac,onCommitMessageChange:X,onAmendChange:Z,onCommit:af,onCommitAndPush:aW}),a_=(0,e.jsx)(ed,{commits:w,isLoading:F,commitError:I,commitListOpen:m,onToggleCommitList:o,onRefresh:Q,selectedCommit:x,onCommitSelect:M,inlineDiffCommit:z,inlineFiles:A,inlineFilesLoading:B,inlineFilesError:C,onToggleInlineDiff:O,onInlineDiffFile:P,changedFiles:y,isLoadingFiles:G,detailError:J,selectedFile:D,onFileSelect:N,diffContent:E,isLoadingDiff:H}),a0=(0,e.jsxs)(dX,{open:p,onToggle:q,children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1.5 px-3 py-2 border-b border-border","data-testid":"git-advanced-fetch",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:i("git.remote")}),(0,e.jsx)("div",{children:(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:()=>aP({}),disabled:"running"===aK,className:"px-2 py-1 text-xs rounded border border-input text-foreground hover:bg-muted disabled:opacity-50","data-testid":"git-fetch-button",children:i("git.network.fetch")})})]}),(0,e.jsx)(eg,{branches:ah,include:ai,loading:aj,error:ak,busy:al||aU,actionError:am,onIncludeChange:ao,onRefresh:ap,onCreate:ar,onDelete:as}),(0,e.jsx)(eh,{stashes:at,loading:au,error:av,busy:aw||aU,actionError:ax,conflictNotice:ay,hasRunningSession:r,onRefresh:az,onPush:aA,onPop:aB,onApply:aC,onDrop:aD}),(0,e.jsx)(ej,{selectedCommit:x,busy:aE||aU,actionError:aF,conflictNotice:aG,currentBranch:s?.currentBranch??null,aheadCount:s?.aheadBehind?.ahead??null,hasRunningSession:r,onReset:aH,onRevert:aI,onForcePush:a=>aR(a?{forceWithLease:!0}:{force:!0})})]});return(0,e.jsx)(dZ,{value:aX,children:(0,e.jsx)(d3,{activeTab:j,onTabChange:l,className:g,statusSection:aY,quickActionsSection:aZ,changesSection:a$,historySection:a_,advancedSection:a0})})}),el=(0,h.memo)(function({worktreeId:a,worktree:b,onWorktreeUpdate:c}){let[d,f]=(0,h.useState)(!1),g=(0,k.c)("worktree"),i=(0,h.useRef)(b?.id),j=(0,h.useRef)(!1),l=ep(b,c,b?.id,()=>{let a=b?.id!==i.current;return i.current=b?.id,a&&!j.current});return(j.current=l.isEditing,b)?(0,e.jsx)("div",{className:"p-4 space-y-4 overflow-y-auto h-full",children:(0,e.jsx)(eq,{worktreeId:a,worktree:b,cardClassName:"bg-surface rounded-lg border border-border p-4",descriptionEditor:l,showLogs:d,onToggleLogs:()=>f(!d),onWorktreeUpdate:c})}):(0,e.jsx)("div",{className:"text-muted-foreground text-center py-8",children:g("detail.loadingInfo")})}),em=(0,h.memo)(function({worktreeId:a,cliToolId:b,instanceId:c,disableAutoFollow:d}){let{terminal:f,setAutoScroll:g}=bq({worktreeId:a,cliToolId:b,instanceId:c});return(0,e.jsx)(bo,{output:f.output,isActive:f.isRunning,isThinking:f.isThinking,autoScroll:f.autoScroll,onScrollChange:g,disableAutoFollow:d,compactTuiLayoutPadding:"claude"===b||"codex"===b,className:"h-full"})}),en=(0,h.memo)(function({activeTab:a,worktreeId:b,worktree:c,messages:d,cliToolId:f,instanceId:g,onFilePathClick:h,onFileSelect:i,onWorktreeUpdate:j,onNewFile:l,onNewDirectory:m,onRename:n,onDelete:o,onUpload:p,onMove:q,onFileTreeReset:r,refreshTrigger:s,fileSearch:t,showToast:u,selectedAgents:v,onSelectedAgentsChange:w,availableAgents:x,maxAgents:y,persistToServer:z,vibeLocalModel:A,onVibeLocalModelChange:B,vibeLocalContextWindow:C,onVibeLocalContextWindowChange:D,disableAutoFollow:E,historySubTab:G,onHistorySubTabChange:H,onDiffSelect:I,onInsertToMessage:J,showArchived:K,onShowArchivedChange:L,historyDisplayLimit:M,onHistoryDisplayLimitChange:N,historyUserOnly:O,onHistoryUserOnlyChange:P,useInstanceManagement:Q,instances:R,onInstancesChange:S,visibleInstanceIds:T,onToggleInstanceVisible:U}){let V=(0,k.c)("worktree");switch(a){case"terminal":return(0,e.jsx)(F,{componentName:"TerminalDisplay",children:(0,e.jsx)(em,{worktreeId:b,cliToolId:f,instanceId:g,disableAutoFollow:E})});case"history":return(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsxs)("div",{className:"flex border-b border-border shrink-0",children:[(0,e.jsx)("button",{type:"button",onClick:()=>H("message"),className:`flex-1 min-h-[44px] px-3 py-1.5 text-xs font-medium transition-colors touch-manipulation ${"message"===G?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400 bg-accent-50 dark:bg-accent-900/30":"text-muted-foreground hover:text-foreground"}`,children:V("detail.subTabMessage")}),(0,e.jsx)("button",{type:"button",onClick:()=>H("git"),className:`flex-1 min-h-[44px] px-3 py-1.5 text-xs font-medium transition-colors touch-manipulation ${"git"===G?"text-accent-600 dark:text-accent-400 border-b-2 border-accent-600 dark:border-accent-400 bg-accent-50 dark:bg-accent-900/30":"text-muted-foreground hover:text-foreground"}`,children:V("detail.subTabGit")})]}),"message"===G?(0,e.jsx)(F,{componentName:"HistoryPane",children:(0,e.jsx)(cq,{messages:d,worktreeId:b,onFilePathClick:h,className:"flex-1 min-h-0",showToast:u,onInsertToMessage:J,showArchived:K,onShowArchivedChange:L,historyDisplayLimit:M,onHistoryDisplayLimitChange:N,historyUserOnly:O,onHistoryUserOnlyChange:P})}):(0,e.jsx)(F,{componentName:"GitPane",children:(0,e.jsx)(ek,{worktreeId:b,onDiffSelect:I,isMobile:!0,worktree:c??void 0,onInsertToMessage:J,className:"flex-1 min-h-0"})})]});case"files":return(0,e.jsx)(F,{componentName:"FileTreeView",children:(0,e.jsxs)("div",{className:"h-full flex flex-col overflow-hidden",children:[(0,e.jsx)(cS,{query:t.query,mode:t.mode,isSearching:t.isSearching,error:t.error,onQueryChange:t.setQuery,onModeChange:t.setMode,onClear:t.clearSearch}),(0,e.jsx)(cO,{worktreeId:b,onFileSelect:i,onNewFile:l,onNewDirectory:m,onRename:n,onDelete:o,onUpload:p,onMove:q,onResetView:r,refreshTrigger:s,pollingEnabled:"files"===a,searchQuery:t.query,searchMode:t.mode,searchResults:t.results?.results,className:"flex-1 min-h-0"})]})});case"memo":return(0,e.jsx)(F,{componentName:"NotesAndLogsPane",children:(0,e.jsx)(dO,{worktreeId:b,className:"h-full",selectedAgents:v,onSelectedAgentsChange:w,availableAgents:x,maxAgents:y,persistToServer:z,vibeLocalModel:A,onVibeLocalModelChange:B,vibeLocalContextWindow:C,onVibeLocalContextWindowChange:D,onInsertToMessage:J,useInstanceManagement:Q,instances:R,onInstancesChange:S,visibleInstanceIds:T,onToggleInstanceVisible:U})});case"info":return(0,e.jsx)(el,{worktreeId:b,worktree:c,onWorktreeUpdate:j});default:return null}}),eo=[{value:null,labelKey:"worktreeStatus.notSet"},{value:"ready",labelKey:"worktreeStatus.ready"},{value:"in_progress",labelKey:"worktreeStatus.inProgress"},{value:"in_review",labelKey:"worktreeStatus.inReview"},{value:"done",labelKey:"worktreeStatus.done"}];function ep(a,b,c,d){let[e,f]=(0,h.useState)(!1),[g,i]=(0,h.useState)(""),[j,k]=(0,h.useState)(!1),l=(0,h.useCallback)(async()=>{if(a){k(!0);try{let c=await T.y.updateDescription(a.id,g);b(c),f(!1)}catch(a){console.error("Failed to save description:",a)}finally{k(!1)}}},[a,g,b]),m=(0,h.useCallback)(()=>{i(a?.description||""),f(!1)},[a]);return{isEditing:e,text:g,setText:i,isSaving:j,handleSave:l,handleCancel:m,startEditing:(0,h.useCallback)(()=>{f(!0)},[])}}let eq=(0,h.memo)(function({worktreeId:a,worktree:b,cardClassName:c,descriptionEditor:d,showLogs:f,onToggleLogs:g,onWorktreeUpdate:i}){let{isEditing:j,text:l,setText:m,isSaving:o,handleSave:p,handleCancel:q,startEditing:r}=d,s=(0,k.c)("worktree"),t=(0,k.c)("common"),[u,v]=(0,h.useState)(!1),[w,x]=(0,h.useState)(!1),y=(0,h.useRef)(void 0),z=(0,h.useRef)(void 0);(0,h.useEffect)(()=>()=>{y.current&&clearTimeout(y.current),z.current&&clearTimeout(z.current)},[]);let A=(0,h.useCallback)(async()=>{try{await (0,ar.l)(b.path),v(!0),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>v(!1),ah.pX)}catch{}},[b.path]),B=(0,h.useCallback)(async()=>{try{await (0,ar.l)(b.repositoryPath),x(!0),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>x(!1),ah.pX)}catch{}},[b.repositoryPath]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.worktree")}),(0,e.jsx)("p",{className:"text-lg font-semibold text-foreground",children:b.name})]}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.repository")}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:B,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":s("detail.copyRepositoryPath"),title:w?s("detail.copied"):s("detail.copyRepositoryPath"),children:w?(0,e.jsx)(au.A,{className:"w-3.5 h-3.5 text-success"}):(0,e.jsx)(av,{className:"w-3.5 h-3.5"})})]}),(0,e.jsx)("p",{className:"text-base text-foreground",children:b.repositoryDisplayName??b.repositoryName}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:b.repositoryPath})]}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.path")}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:A,className:"flex-shrink-0 p-1 rounded hover:bg-muted transition-colors text-muted-foreground hover:text-foreground","aria-label":s("detail.copyWorktreePath"),title:u?s("detail.copied"):s("detail.copyPath"),children:u?(0,e.jsx)(au.A,{className:"w-3.5 h-3.5 text-success"}):(0,e.jsx)(av,{className:"w-3.5 h-3.5"})})]}),(0,e.jsx)("p",{className:"text-sm text-foreground break-all font-mono",children:b.path})]}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.status")}),(0,e.jsx)("select",{value:b.status??"",onChange:async a=>{let c=a.target.value;try{let a=await fetch(`/api/worktrees/${b.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:""===c?null:c})});if(a.ok&&i){let b=await a.json();i(b)}}catch{}},className:"text-sm px-3 py-1.5 rounded-lg border border-input bg-surface text-foreground focus:ring-2 focus:ring-ring focus:border-transparent w-full","data-testid":"mobile-status-dropdown","aria-label":s("detail.worktreeStatusLabel"),children:eo.map(a=>(0,e.jsx)("option",{value:a.value??"",children:s(a.labelKey)},a.labelKey))})]}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.description")}),!j&&(0,e.jsx)("button",{type:"button",onClick:r,className:"text-sm text-accent-600 hover:text-accent-800 dark:text-accent-400 dark:hover:text-accent-300",children:s("actions.edit")})]}),j?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("textarea",{value:l,onChange:a=>m(a.target.value),placeholder:s("detail.addNotesPlaceholder"),className:"w-full min-h-[150px] p-3 border border-input dark:bg-surface dark:text-foreground rounded-lg resize-y focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",autoFocus:!0}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:p,disabled:o,className:"px-4 py-2 bg-accent-600 text-white rounded-lg hover:bg-accent-700 disabled:opacity-50 text-sm font-medium",children:o?s("actions.saving"):s("actions.save")}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:q,disabled:o,className:"px-4 py-2 bg-muted text-foreground rounded-lg hover:bg-border disabled:opacity-50 text-sm font-medium",children:t("cancel")})]})]}):(0,e.jsx)("div",{className:"min-h-[50px]",children:b.description?(0,e.jsx)("p",{className:"text-sm text-foreground whitespace-pre-wrap",children:b.description}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground italic",children:s("detail.noDescription")})})]}),b.link&&(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.link")}),(0,e.jsx)("a",{href:b.link,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-600 hover:underline break-all",children:b.link})]}),b.updatedAt&&(0,e.jsxs)("div",{className:c,children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground mb-1",children:s("detail.lastUpdated")}),(0,e.jsx)("p",{className:"text-sm text-foreground",children:new Date(b.updatedAt).toLocaleString()})]}),(0,e.jsx)(aZ,{version:"v0.11.3",className:c}),(0,e.jsx)(a4,{className:c}),(0,e.jsxs)("div",{className:c,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,e.jsx)("h2",{className:"text-sm font-medium text-muted-foreground",children:s("detail.logs")}),(0,e.jsx)("button",{type:"button",onClick:g,className:"text-sm text-accent-600 hover:text-accent-800",children:f?s("detail.hide"):s("detail.show")})]}),f&&(0,e.jsx)(aV,{worktreeId:a})]})]})}),er=(0,h.memo)(function({worktreeName:a,repositoryName:b,description:c,status:d,gitStatus:f,onBackClick:g,onInfoClick:i,hasUpdate:j,worktreeStatus:l,onWorktreeStatusChange:m,sessionStatusByCli:p,sessionStatusByInstance:q,instances:s,activeInstanceId:t,onActiveInstanceChange:u,onAgentDragStart:v,onAgentDragEnd:w,onKillSession:x}){let y=(0,k.c)("worktree"),z=(0,k.c)("common"),A=aQ.sb[d],B=A?y(A):void 0,[D,E]=(0,h.useState)(null),F=s?.find(a=>a.id===t),G=!!t&&(q?.[t]?.isRunning??(F?p?.[F.cliTool]?.isRunning:void 0)??!1),H=(0,h.useCallback)((a,b)=>{a.dataTransfer.setData(a9,b),a.dataTransfer.effectAllowed="move",E(b),v?.(b)},[v]),I=(0,h.useCallback)(()=>{E(null),w?.()},[w]),J=c?r(c,50):null;return(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-surface border-b border-border",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsxs)("button",{type:"button",onClick:g,className:"flex items-center gap-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":y("detail.goBack"),"data-testid":"worktree-back-button",children:[(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-4 0a1 1 0 01-1-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 01-1 1h-2z"})}),(0,e.jsx)("span",{className:"text-sm font-medium",children:y("detail.home")})]}),(0,e.jsx)("div",{className:"w-px h-6 bg-border","aria-hidden":"true"}),(0,e.jsx)(o.m,{"data-testid":"desktop-status-indicator",status:d,size:"lg",label:B}),(0,e.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,e.jsx)("h1",{className:"text-lg font-semibold text-foreground truncate max-w-[200px] leading-tight",children:a}),(0,e.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"truncate max-w-[200px]",children:b}),f&&"(unknown)"!==f.currentBranch&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:"/"}),(0,e.jsx)("span",{className:"truncate max-w-[150px] font-mono",title:f.currentBranch,"data-testid":"desktop-branch-name",children:r(f.currentBranch,30)}),f.isDirty&&(0,e.jsx)("span",{className:"text-warning",title:y("git.uncommittedChanges"),children:"*"})]}),J&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:"—"}),(0,e.jsx)("span",{className:"truncate max-w-[300px] text-muted-foreground",title:c,children:J})]})]})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[s&&s.length>0&&(()=>{let a=(0,aT.Uw)(s.map(a=>({item:a,status:(0,a6.kA)(q?.[a.id]??p?.[a.cliTool]),isActive:a.id===t})),4),b=a.filter(a=>"overflow"===a.slot),c=b.find(a=>"running"===a.status||"generating"===a.status)?.status??b.find(a=>"waiting"===a.status)?.status??null;return(0,e.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0","data-testid":"desktop-agent-status-row",children:[a.map(a=>{if("overflow"===a.slot)return null;let b=a.item,c=y("detail.statusPill",{label:(0,a7.sw)(b),status:z(`status.${a.status}`)}),d=a.isActive,f={draggable:!0,onDragStart:a=>H(a,b.id),onDragEnd:I},g=D===b.id?" opacity-50 cursor-grabbing":"";return"pill"===a.slot?(0,e.jsxs)("button",{type:"button","data-testid":`desktop-agent-status-${b.id}`,onClick:()=>u?.(b.id),...f,"aria-label":c,"aria-pressed":d,className:`flex items-center gap-1.5 px-2 py-1 rounded text-xs transition-colors ${d?"bg-accent-100 dark:bg-accent-900/30 text-accent-900 dark:text-accent-100":"hover:bg-muted text-foreground"}${g}`,children:[(0,e.jsx)(o.m,{status:a.status,size:"sm","aria-hidden":!0,title:void 0}),(0,e.jsx)("span",{className:"whitespace-nowrap",children:c})]},b.id):(0,e.jsx)(aR.m_,{content:c,placement:"bottom",children:(0,e.jsx)("button",{type:"button","data-testid":`desktop-agent-status-${b.id}`,onClick:()=>u?.(b.id),...f,"aria-label":c,"aria-pressed":d,className:`flex items-center justify-center w-6 h-6 rounded-full transition-colors ${d?"bg-accent-100 dark:bg-accent-900/30":"hover:bg-muted"}${g}`,children:(0,e.jsx)(o.m,{status:a.status,size:"sm","aria-hidden":!0,title:void 0})})},b.id)}),b.length>0&&(0,e.jsxs)(aS.rI,{children:[(0,e.jsx)(aS.ty,{asChild:!0,children:(0,e.jsxs)("button",{type:"button","data-testid":"desktop-agent-status-overflow","aria-label":y("agentStatus.moreAgents",{count:b.length}),className:"flex items-center gap-1 px-2 py-1 rounded text-xs tabular-nums text-muted-foreground hover:bg-muted transition-colors",children:[c&&(0,e.jsx)(o.m,{status:c,size:"sm","aria-hidden":!0,title:void 0}),"+",b.length]})}),(0,e.jsx)(aS.SQ,{align:"end",children:b.map(a=>{let b=a.item,c=y("detail.statusPill",{label:(0,a7.sw)(b),status:z(`status.${a.status}`)});return(0,e.jsxs)(aS._2,{"data-testid":`desktop-agent-overflow-${b.id}`,onSelect:()=>u?.(b.id),children:[(0,e.jsx)(o.m,{status:a.status,size:"sm","aria-hidden":!0,title:void 0}),(0,e.jsx)("span",{className:"whitespace-nowrap",children:c})]},b.id)})})]})]})})(),x&&G&&(0,e.jsxs)(n.$n,{variant:"ghost",type:"button",onClick:x,className:"flex items-center gap-1 px-2 py-1.5 text-xs font-medium rounded-lg text-danger-foreground hover:bg-danger-subtle transition-colors flex-shrink-0","aria-label":y("terminal.endSession"),"data-testid":"desktop-kill-session",children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"✕"}),z("end")]}),m&&(0,e.jsx)("select",{value:l??"",onChange:a=>{let b=a.target.value;m(""===b?null:b)},onClick:a=>a.stopPropagation(),className:"text-xs px-2 py-1.5 rounded-lg border border-input bg-surface text-foreground focus:ring-2 focus:ring-ring focus:border-transparent cursor-pointer","data-testid":"desktop-status-dropdown","aria-label":y("detail.worktreeStatusLabel"),children:eo.map(a=>(0,e.jsx)("option",{value:a.value??"",children:y(a.labelKey)},a.labelKey))}),(0,e.jsx)(bb.g,{}),(0,e.jsxs)(n.$n,{variant:"ghost",type:"button",onClick:i,className:"relative flex items-center gap-1.5 px-3 py-1.5 text-muted-foreground hover:text-foreground hover:bg-muted rounded-lg transition-colors","aria-label":y("detail.viewInfo"),children:[(0,e.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,e.jsx)("span",{className:"text-sm font-medium",children:y("detail.info")}),j&&(0,e.jsx)(C,{"data-testid":"info-update-indicator",className:"absolute top-0 right-0","aria-label":y("tabs.updateAvailable")})]})]})]})}),es=(0,h.memo)(function({worktreeId:a,worktree:b,isOpen:c,onClose:d,onWorktreeUpdate:f}){let[g,i]=(0,h.useState)(!1),j=(0,k.c)("worktree"),l=(0,h.useRef)(c),m=ep(b,f,c,()=>{let a=c&&!l.current;return l.current=c,a});return b?(0,e.jsx)(a5.a,{isOpen:c,onClose:d,title:j("detail.infoModalTitle"),size:"md",children:(0,e.jsx)("div",{className:"space-y-4 max-h-[70vh] overflow-y-auto","data-testid":"worktree-info-modal",children:(0,e.jsx)(eq,{worktreeId:a,worktree:b,cardClassName:"bg-muted rounded-lg p-4",descriptionEditor:m,showLogs:g,onToggleLogs:()=>i(!g),onWorktreeUpdate:f})})}):null}),et=(0,h.memo)(function(){let a=(0,k.c)("worktree");return(0,e.jsx)("div",{className:"flex items-center justify-center h-full min-h-[200px]",role:"status","aria-live":"polite",children:(0,e.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,e.jsx)(n.y$,{size:"xl",variant:"accent"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:a("detail.loading")})]})})}),eu=(0,h.memo)(function({message:a,onRetry:b}){let c=(0,k.c)("worktree"),d=(0,k.c)("common");return(0,e.jsx)("div",{className:"flex items-center justify-center h-full min-h-[200px]",role:"alert","aria-live":"assertive",children:(0,e.jsxs)("div",{className:"text-center p-6 bg-danger-subtle rounded-lg border border-danger-border max-w-md",children:[(0,e.jsx)("svg",{className:"mx-auto h-12 w-12 text-danger-foreground/70 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,e.jsx)("p",{className:"text-danger-foreground font-medium",children:c("detail.errorLoading")}),(0,e.jsx)("p",{className:"text-danger-foreground/80 text-sm mt-2",children:a}),b&&(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:b,className:"mt-4 px-4 py-2 bg-danger-foreground text-danger-subtle rounded-lg hover:opacity-90 transition-opacity focus:outline-none focus:ring-2 focus:ring-danger focus:ring-offset-2 ring-offset-background",children:d("retry")})]})})}),ev=(0,h.memo)(function({activityPane:a,rightPane:b,activityPaneWidth:c=18,minPaneWidth:d=10,maxPaneWidth:f=60,onActivityPaneResize:g,className:i=""}){let j=(0,h.useRef)(null),l=(0,k.c)("worktree"),[m,n]=(0,h.useState)(c),o=g?c:m,p=(0,h.useCallback)(a=>{let b=j.current;if(!b)return;let e=b.offsetWidth;if(0===e)return;let h=Math.min(f,Math.max(d,(g?c:m)+a/e*100));g?g(h):n(h)},[c,m,d,f,g]),q=(0,h.useMemo)(()=>`flex h-full min-h-0 ${i}`.trim(),[i]);return(0,e.jsx)("div",{ref:j,className:"h-full",children:(0,e.jsxs)("div",{"data-testid":"desktop-layout",role:"main",className:q,children:[null!==a&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{id:"worktree-activity-pane","data-testid":"activity-pane-slot","aria-label":l("desktopLayout.activityPane"),style:{width:`${o}%`},className:"flex-shrink-0 overflow-hidden transition-[width] duration-200 ease-in-out",children:(0,e.jsx)(F,{componentName:"ActivityPane",children:a})}),(0,e.jsx)(ch,{onResize:p,orientation:"horizontal",ariaValueNow:o})]}),(0,e.jsx)("div",{id:"worktree-right-pane","data-testid":"right-pane-slot","aria-label":l("desktopLayout.terminalPane"),className:"flex-grow overflow-hidden min-w-0",children:(0,e.jsx)(F,{componentName:"TerminalPane",children:b})})]})})}),ew=(0,x.A)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]),ex=(0,x.A)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);var ey=c(57898);let ez=(0,x.A)("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"}]]),eA=(0,x.A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);var eB=c(55056);let eC=(0,x.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),eD=(0,x.A)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]),eE=[{id:"files",labelKey:"activityBar.files",icon:ex},{id:"git",labelKey:"activityBar.git",icon:ey.A},{id:"notes",labelKey:"activityBar.notes",icon:ez},{id:"schedules",labelKey:"activityBar.schedules",icon:eA},{id:"agent",labelKey:"activityBar.agent",icon:eB.A},{id:"timer",labelKey:"activityBar.timer",icon:eC},{id:"todo",labelKey:"activityBar.todo",icon:eD}];eE.map(a=>a.id);var eF=c(81092);let eG=(0,h.memo)(function({active:a,onToggle:b,className:c=""}){let d=(0,k.c)("worktree"),f=(0,h.useRef)([]),{isOpen:g,toggle:i}=(0,eF.VF)(),j=(0,h.useCallback)((a,c,d)=>{if("Enter"===a.key||" "===a.key){a.preventDefault(),b(d);return}if("ArrowDown"===a.key){a.preventDefault();let b=(c+1)%eE.length;f.current[b]?.focus();return}if("ArrowUp"===a.key){a.preventDefault();let b=(c-1+eE.length)%eE.length;f.current[b]?.focus();return}if("Home"===a.key){a.preventDefault(),f.current[0]?.focus();return}if("End"===a.key){a.preventDefault(),f.current[eE.length-1]?.focus();return}},[b]);return(0,e.jsxs)("div",{"data-testid":"activity-bar",className:`flex flex-col items-stretch w-12 flex-shrink-0 bg-muted border-r border-border ${c}`.trim(),children:[(0,e.jsx)(aR.m_,{content:d("activityBar.toggleSidebar"),placement:"right",children:(0,e.jsx)("button",{type:"button","data-testid":"activity-bar-toggle-sidebar",onClick:i,"aria-label":d("activityBar.toggleSidebar"),"aria-expanded":g,className:"flex items-center justify-center h-12 w-12 text-muted-foreground transition-colors hover:text-surface-foreground hover:bg-muted-foreground/10 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-inset",children:(0,e.jsx)(ew,{size:20,"aria-hidden":"true"})})}),(0,e.jsx)("div",{className:"mx-2 my-1 border-b border-border","aria-hidden":"true"}),(0,e.jsx)("div",{id:"worktree-activity-bar",role:"tablist","aria-orientation":"vertical","aria-label":d("activityBar.label"),className:"flex flex-col items-stretch",children:eE.map((c,g)=>{let h=c.icon,i=a===c.id,k=d(c.labelKey);return(0,e.jsx)(aR.m_,{content:k,placement:"right",children:(0,e.jsx)("button",{ref:a=>{f.current[g]=a},type:"button",role:"tab","aria-selected":i,"aria-label":k,"aria-controls":"worktree-activity-pane",tabIndex:i||null===a&&0===g?0:-1,onClick:()=>b(c.id),onKeyDown:a=>j(a,g,c.id),"data-testid":`activity-bar-button-${c.id}`,className:"group flex items-center justify-center h-12 w-12 transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-inset",children:(0,e.jsx)("span",{"aria-hidden":"true",className:`flex items-center justify-center h-9 w-9 rounded-md transition-colors ${i?"bg-accent-500/10 text-accent-600 dark:text-accent-400":"text-muted-foreground group-hover:text-surface-foreground group-hover:bg-muted-foreground/10"}`,children:(0,e.jsx)(h,{size:20,"aria-hidden":"true"})})})},c.id)})})]})}),eH="worktree-activity-pane",eI={files:"FileTreeView",git:"GitPane",notes:"MemoPane",schedules:"ExecutionLogPane",agent:"AgentSettingsPane",timer:"TimerPane",todo:"TodoPane"},eJ=(0,h.memo)(function({active:a,activities:b,className:c=""}){if(null===a)return(0,e.jsx)("div",{id:eH,"data-testid":"activity-pane","data-active":"none",className:`h-full flex flex-col ${c}`.trim()});let d=b[a],f=eI[a];return(0,e.jsx)("div",{id:eH,"data-testid":"activity-pane","data-active":a,role:"tabpanel","aria-labelledby":`activity-bar-button-${a}`,className:`h-full flex flex-col min-h-0 ${c}`.trim(),children:(0,e.jsx)(F,{componentName:f,children:d??null})})}),eK=(0,h.memo)(function({inputRef:a,searchQuery:b,onQueryChange:c,matchCount:d,currentIdx:f,onNextMatch:g,onPrevMatch:h,onClose:i}){let j=(0,k.c)("worktree");return(0,e.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 bg-muted border-b border-input flex-shrink-0",children:[(0,e.jsx)("input",{ref:a,type:"text",value:b,onChange:a=>c(a.target.value),onKeyDown:a=>{"Escape"===a.key&&i(),"Enter"===a.key&&(a.shiftKey?h():g())},placeholder:j("fileSearch.placeholder"),className:"flex-1 min-w-0 px-2 py-0.5 text-sm bg-surface dark:text-foreground border border-input rounded outline-none focus:ring-1 focus:ring-ring",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground min-w-[3rem] text-right",children:d>0?`${f+1}/${d}`:"0/0"}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:h,disabled:0===d,className:"min-w-[32px] min-h-[32px] flex items-center justify-center text-muted-foreground hover:text-foreground dark:hover:text-white disabled:text-muted-foreground/50","aria-label":j("fileSearch.prevMatch"),children:"▲"}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:g,disabled:0===d,className:"min-w-[32px] min-h-[32px] flex items-center justify-center text-muted-foreground hover:text-foreground dark:hover:text-white disabled:text-muted-foreground/50","aria-label":j("fileSearch.nextMatch"),children:"▼"}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:i,className:"min-w-[32px] min-h-[32px] flex items-center justify-center text-muted-foreground hover:text-foreground dark:hover:text-white","aria-label":j("fileSearch.close"),children:(0,e.jsx)(as.A,{className:"w-4 h-4"})})]})}),eL=[{extension:".png",maxFileSize:0x1400000,allowedMimeTypes:["image/png"],magicBytes:[{bytes:[137,80,78,71,13,10,26,10]}]},{extension:".jpg",maxFileSize:0x1400000,allowedMimeTypes:["image/jpeg"],magicBytes:[{bytes:[255,216,255]}]},{extension:".jpeg",maxFileSize:0x1400000,allowedMimeTypes:["image/jpeg"],magicBytes:[{bytes:[255,216,255]}]},{extension:".gif",maxFileSize:0x1400000,allowedMimeTypes:["image/gif"],magicBytes:[{bytes:[71,73,70,56,55,97]},{bytes:[71,73,70,56,57,97]}]},{extension:".webp",maxFileSize:0x1400000,allowedMimeTypes:["image/webp"],magicBytes:[{bytes:[82,73,70,70],offset:0}]},{extension:".mp4",maxFileSize:0x6400000,allowedMimeTypes:["video/mp4"],magicBytes:[{bytes:[102,116,121,112],offset:4}]},{extension:".txt",maxFileSize:0x1400000,allowedMimeTypes:["text/plain"]},{extension:".log",maxFileSize:0x1400000,allowedMimeTypes:["text/plain"]},{extension:".md",maxFileSize:0x1400000,allowedMimeTypes:["text/markdown","text/plain"]},{extension:".csv",maxFileSize:0x1400000,allowedMimeTypes:["text/csv"]},{extension:".json",maxFileSize:0x1400000,allowedMimeTypes:["application/json"]},{extension:".yaml",maxFileSize:0x1400000,allowedMimeTypes:["text/yaml","application/x-yaml"]},{extension:".yml",maxFileSize:0x1400000,allowedMimeTypes:["text/yaml","application/x-yaml"]}],eM=eL.map(a=>a.extension),eN=[".md",".html",".htm",".yaml",".yml"];var eO=c(79689);function eP(){return(0,e.jsx)("div",{className:"flex items-center justify-center py-12 bg-surface",children:(0,e.jsx)(m.y,{size:"xl",variant:"accent"})})}let eQ=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/FilePanelContent.tsx -> @/components/worktree/HtmlPreview"]},ssr:!1,loading:()=>(0,e.jsx)(eP,{})}),eR=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/FilePanelContent.tsx -> @/components/worktree/PdfPreview"]},ssr:!1,loading:()=>(0,e.jsx)(eP,{})}),eS=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/FilePanelContent.tsx -> @/components/worktree/MarkdownEditor"]},ssr:!1,loading:()=>(0,e.jsx)(eP,{})}),eT=/^---\s*\nmarp:\s*true/;function eU(){let a=(0,k.c)("worktree");return(0,e.jsxs)("div",{className:"flex items-center justify-center py-12",children:[(0,e.jsx)(m.y,{size:"xl",variant:"accent"}),(0,e.jsx)("p",{className:"ml-3 text-muted-foreground",children:a("fileViewer.loading")})]})}function eV({error:a}){return(0,e.jsx)("div",{className:"bg-danger-subtle border border-danger-border rounded-lg p-4 m-4",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("svg",{className:"w-5 h-5 text-danger-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,e.jsx)("p",{className:"text-sm text-danger-foreground",children:a})]})})}function eW({filePath:a,isMaximized:b,onToggleMaximize:c,copyableContent:d,onSearch:f}){let g=(0,k.c)("worktree"),[i,j]=(0,h.useState)(!1),[l,m]=(0,h.useState)(!1),n=(0,h.useRef)(null),o=(0,h.useRef)(null),p=async()=>{try{await (0,ar.l)(a),j(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(()=>j(!1),ah.pX)}catch{}},q=async()=>{if(d)try{await (0,ar.l)(d),m(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>m(!1),ah.pX)}catch{}};return(0,e.jsxs)("div",{className:"flex items-center justify-between p-1 border-b border-border gap-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 min-w-0",children:[(0,e.jsx)("button",{type:"button",onClick:p,className:"flex-shrink-0 p-1 rounded-md hover:bg-muted text-muted-foreground transition-colors","aria-label":g("actions.copyFilePath"),title:g("actions.copyPath"),children:i?(0,e.jsx)(au.A,{className:"w-3.5 h-3.5 text-success"}):(0,e.jsx)(av,{className:"w-3.5 h-3.5"})}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground font-mono truncate",title:a,children:a})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[f&&(0,e.jsx)("button",{type:"button",onClick:f,className:"flex-shrink-0 p-1 rounded-md hover:bg-muted text-muted-foreground transition-colors","aria-label":g("actions.searchInFile"),title:g("actions.search"),children:(0,e.jsx)(Q.A,{className:"w-3.5 h-3.5"})}),d&&(0,e.jsx)("button",{type:"button",onClick:q,className:"flex-shrink-0 p-1 rounded-md hover:bg-muted text-muted-foreground transition-colors","aria-label":g("actions.copyFileContent"),title:g("actions.copyContent"),children:l?(0,e.jsx)(au.A,{className:"w-3.5 h-3.5 text-success"}):(0,e.jsx)(ax,{className:"w-3.5 h-3.5"})}),(0,e.jsx)("button",{type:"button",onClick:c,className:"flex-shrink-0 p-1.5 rounded-md hover:bg-muted text-muted-foreground transition-colors","aria-label":g(b?"actions.minimize":"actions.maximize"),title:g(b?"actions.minimize":"actions.maximize"),children:b?(0,e.jsx)(ay,{className:"w-4 h-4"}):(0,e.jsx)(az,{className:"w-4 h-4"})})]})]})}function eX({content:a,extension:b,searchMatches:c,searchCurrentIdx:d,totalLines:f,rangeStart:g,worktreeId:i,filePath:j,onLineRangeFetched:k}){let l=(0,h.useRef)(null),m=(0,h.useMemo)(()=>a.split("\n"),[a]),n=Math.max(1,g??1),o=m.length,p=Math.max(f??o,o),q=(0,h.useRef)(new Map),r=(0,h.useCallback)(a=>{let c=Math.floor(a/500),d=q.current,e=d.get(c);if(!e){let a=500*c,f=Math.min(a+500,m.length),g=m.slice(a,f).join("\n"),h="";try{h=aK.highlight(g,{language:b,ignoreIllegals:!0}).value}catch{h=aK.highlightAuto(g).value}e=h.split("\n"),d.set(c,e)}return e[a-500*c]??""},[m,b]),s=(0,h.useMemo)(()=>new Set(c??[]),[c]),t=(c?.length??0)>0?c[d??0]:-1,u=bI({count:p,getScrollElement:()=>l.current,estimateSize:()=>24,overscan:100}),v=u.getVirtualItems();return!function({virtualItems:a,worktreeId:b,filePath:c,onLineRangeFetched:d,loadedStart:e,loadedLineCount:f}){(0,h.useRef)(new Set)}({virtualItems:v,worktreeId:i,filePath:j,onLineRangeFetched:k,loadedStart:n,loadedLineCount:o}),(0,e.jsx)("div",{className:"overflow-auto h-full",ref:l,"data-testid":"file-content-code",children:(0,e.jsx)("div",{style:{height:u.getTotalSize(),width:"100%",position:"relative"},children:v.map(a=>{let b=a.index+1,c=b-n,d=c>=0&&c<o,f=b===t,g=s.has(b),h=d?r(c):"";return(0,e.jsxs)("div",{"data-line":b,"data-index":a.index,ref:u.measureElement,className:`absolute left-0 right-0 flex font-mono text-sm ${f?"bg-warning/30":g?"bg-warning/15":""}`,style:{top:0,transform:`translateY(${a.start}px)`,height:"24px",lineHeight:"24px"},children:[(0,e.jsx)("div",{className:`px-3 text-right select-none border-r border-border bg-muted dark:bg-muted/50 whitespace-nowrap ${f||g?"text-warning-foreground":"text-muted-foreground"}`,style:{minWidth:"4rem"},children:b}),(0,e.jsx)("div",{className:"px-4 text-foreground flex-1 min-w-0 overflow-hidden",children:d?(0,e.jsx)("code",{className:"hljs",style:{padding:0,background:"transparent",whiteSpace:"pre"},dangerouslySetInnerHTML:{__html:h}}):(0,e.jsx)(eO.E,{className:"h-4 w-3/4"})})]},a.key)})})})}function eY({slides:a,fileName:b}){let c=(0,k.c)("worktree"),[d,f]=(0,h.useState)(0);return 0===a.length?(0,e.jsx)("div",{className:"p-4 text-muted-foreground",children:c("fileViewer.noSlides",{fileName:b})}):(0,e.jsxs)("div",{className:"h-full flex flex-col","data-testid":"marp-preview",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between p-2 border-b border-border bg-muted",children:[(0,e.jsx)("button",{type:"button",onClick:()=>{f(a=>Math.max(0,a-1))},disabled:0===d,className:"px-3 py-1 text-sm rounded-md bg-muted disabled:opacity-50 hover:bg-muted/80 transition-colors",children:c("actions.prev")}),(0,e.jsxs)("span",{className:"text-sm text-muted-foreground",children:[d+1," / ",a.length]}),(0,e.jsx)("button",{type:"button",onClick:()=>{f(b=>Math.min(a.length-1,b+1))},disabled:d===a.length-1,className:"px-3 py-1 text-sm rounded-md bg-muted disabled:opacity-50 hover:bg-muted/80 transition-colors",children:c("actions.next")})]}),(0,e.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,e.jsx)("iframe",{srcDoc:a[d],sandbox:"",title:c("fileViewer.slideTitle",{name:b,number:d+1}),className:"w-full h-full border-0"})})]})}function eZ({marpSlides:a,fileName:b,worktreeId:c,filePath:d,contentText:f,onFileSaved:g,isMaximized:i,onToggleMaximize:j,onDirtyChange:l,onOpenFile:m}){let n=(0,k.c)("worktree"),[o,p]=(0,h.useState)("slides");return(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between p-1 border-b border-border bg-muted",children:[(0,e.jsxs)("div",{className:"flex gap-1",children:[(0,e.jsx)("button",{type:"button",onClick:()=>p("slides"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${"slides"===o?"bg-accent-100 dark:bg-accent-900/50 text-accent-700 dark:text-accent-300":"text-muted-foreground hover:bg-muted"}`,children:n("fileViewer.slides")}),(0,e.jsx)("button",{type:"button",onClick:()=>p("editor"),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${"editor"===o?"bg-accent-100 dark:bg-accent-900/50 text-accent-700 dark:text-accent-300":"text-muted-foreground hover:bg-muted"}`,children:n("fileViewer.editor")})]}),(0,e.jsx)(eW,{filePath:d,isMaximized:i,onToggleMaximize:j,copyableContent:f})]}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:"slides"===o?(0,e.jsx)(eY,{slides:a,fileName:b}):(0,e.jsx)(eS,{worktreeId:c,filePath:d,onSave:g,initialViewMode:"split",onDirtyChange:l,onOpenFile:m})})]})}function e$({children:a,isMaximized:b,onToggle:c,filePath:d}){return b?(0,e.jsxs)("div",{className:"fixed inset-0 bg-surface flex flex-col",style:{zIndex:aA.M.MAXIMIZED_EDITOR},children:[(0,e.jsx)(eW,{filePath:d,isMaximized:b,onToggleMaximize:c}),(0,e.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:a})]}):(0,e.jsx)(e.Fragment,{children:a})}function e_({tab:a,content:b,worktreeId:c,isMaximized:d,onToggleMaximize:f,onFileSaved:g,onDirtyChange:h,onOpenFile:i}){let j=aJ(b.content);return(0,e.jsxs)(e.Fragment,{children:[!d&&(0,e.jsx)(eW,{filePath:a.path,isMaximized:d,onToggleMaximize:f,copyableContent:b.content,onSearch:j.openSearch}),j.searchOpen&&(0,e.jsx)(eK,{inputRef:j.searchInputRef,searchQuery:j.searchQuery,onQueryChange:j.setSearchQuery,matchCount:j.searchMatches.length,currentIdx:j.searchCurrentIdx,onNextMatch:j.nextMatch,onPrevMatch:j.prevMatch,onClose:j.closeSearch}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:j.searchOpen&&j.searchQuery.length>=2?(0,e.jsx)(eX,{content:b.content,extension:"md",searchMatches:j.searchMatches,searchCurrentIdx:j.searchCurrentIdx}):(0,e.jsx)(eS,{worktreeId:c,filePath:a.path,onSave:g,initialViewMode:"preview",onDirtyChange:h,onOpenFile:i})})]})}function e0({tab:a,content:b,worktreeId:c,isMaximized:d,onToggleMaximize:f,onLoadContent:g}){let i=aJ(b.content),j=(0,h.useCallback)(c=>{g&&g(a.path,{...b,content:c.content,totalLines:c.totalLines,totalBytes:c.totalBytes??b.totalBytes,range:c.range})},[g,a.path,b]),k=void 0!==b.range&&(b.totalLines??0)>b.range.end-b.range.start+1;return(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:d,onToggleMaximize:f,copyableContent:b.content,onSearch:i.openSearch}),i.searchOpen&&(0,e.jsx)(eK,{inputRef:i.searchInputRef,searchQuery:i.searchQuery,onQueryChange:i.setSearchQuery,matchCount:i.searchMatches.length,currentIdx:i.searchCurrentIdx,onNextMatch:i.nextMatch,onPrevMatch:i.prevMatch,onClose:i.closeSearch}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:(0,e.jsx)(eX,{content:b.content,extension:b.extension,searchMatches:i.searchOpen?i.searchMatches:void 0,searchCurrentIdx:i.searchOpen?i.searchCurrentIdx:void 0,totalLines:b.totalLines,rangeStart:b.range?.start,worktreeId:k?c:void 0,filePath:k?a.path:void 0,onLineRangeFetched:k?j:void 0})})]})}let e1=(0,h.memo)(function({tab:a,worktreeId:b,onLoadContent:c,onLoadError:d,onSetLoading:f,onFileSaved:g,onDirtyChange:i,onOpenFile:j}){let l=(0,k.c)("worktree"),m=(0,h.useRef)(l);m.current=l;let n=(0,h.useRef)(!1),[o,p]=(0,h.useState)(null),[q,r]=(0,h.useState)(!1);!function({tab:a,worktreeId:b,onLoadContent:c}){let d=(0,h.useRef)(null),e=(0,h.useRef)(c);e.current=c;let f=(0,h.useRef)(a.path);f.current=a.path,cM({intervalMs:5e3,enabled:function(a){if(null===a.content||a.loading||a.isDirty||a.content.isPdf)return!1;let{totalBytes:b}=a.content;return void 0===b||!(b>=1048576)}(a),onPoll:async()=>{let a=`/api/worktrees/${b}/files/${aB(f.current)}`,c={};d.current&&(c["If-Modified-Since"]=d.current);try{let b=await fetch(a,{headers:c});if(304===b.status||!b.ok)return;d.current=b.headers.get("Last-Modified");let g=await b.json();e.current(f.current,g)}catch{}}})}({tab:a,worktreeId:b,onLoadContent:c});let s=(0,h.useMemo)(()=>i?b=>i(a.path,b):void 0,[i,a.path]),t=(0,h.useCallback)(()=>{r(a=>!a)},[]);(0,h.useEffect)(()=>{if(!q)return;let a=a=>{"Escape"===a.key&&r(!1)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[q]),(0,h.useEffect)(()=>{null!==a.content||a.loading||null!==a.error||n.current||(n.current=!0,f(a.path,!0),(async()=>{try{let e=await fetch(`/api/worktrees/${b}/files/${aB(a.path)}`);if(304===e.status)return;if(!e.ok){let b=await e.json(),c="string"==typeof b.error?b.error:b.error?.message||m.current("fileViewer.loadError");d(a.path,c);return}let f=await e.json();c(a.path,f)}catch(b){d(a.path,b instanceof Error?b.message:m.current("fileViewer.loadError"))}finally{n.current=!1}})())},[a.content,a.loading,a.error,a.path,b,c,d,f]);let u=a.content?.content??null,v=a.content?.extension??null;if((0,h.useEffect)(()=>{if(!u||"md"!==v||!eT.test(u)||u.length>1e6)return void p(null);let a=!1;return(async()=>{try{let c=await fetch(`/api/worktrees/${b}/marp-render`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({markdownContent:u})});if(c.ok){let b=await c.json();a||p(Array.isArray(b.slides)?b.slides:null)}}catch{}})(),()=>{a=!0}},[u,v,b]),a.loading)return(0,e.jsx)(eU,{});if(a.error)return(0,e.jsx)(eV,{error:a.error});if(!a.content)return null;let{content:w}=a;return w.isImage?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:q,onToggleMaximize:t}),(0,e.jsx)("div",{className:"flex-1 overflow-auto",children:(0,e.jsx)(an.a,{src:w.content,alt:w.path,mimeType:w.mimeType})})]})}):w.isVideo?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:q,onToggleMaximize:t}),(0,e.jsx)("div",{className:"flex-1 overflow-auto",children:(0,e.jsx)(ao.u,{src:w.content,mimeType:w.mimeType})})]})}):w.isPdf?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:q,onToggleMaximize:t}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:(0,e.jsx)(eR,{dataUri:w.content,filePath:a.path})})]})}):w.isHtml?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(eW,{filePath:a.path,isMaximized:q,onToggleMaximize:t,copyableContent:w.content}),(0,e.jsx)("div",{className:"flex-1 min-h-0",children:(0,e.jsx)(eQ,{worktreeId:b,filePath:a.path,htmlContent:w.content,onFileSaved:g,onOpenFile:j})})]})}):"md"===w.extension?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsx)("div",{className:"h-full flex flex-col",children:o?(0,e.jsx)(eZ,{marpSlides:o,fileName:a.name,worktreeId:b,filePath:a.path,contentText:w.content,onFileSaved:g,isMaximized:q,onToggleMaximize:t,onDirtyChange:s,onOpenFile:j}):(0,e.jsx)(e_,{tab:a,content:w,worktreeId:b,isMaximized:q,onToggleMaximize:t,onFileSaved:g,onDirtyChange:s,onOpenFile:j})})}):!function(a){if(!a)return!1;let b=a.toLowerCase();return eN.includes(b)}("."+w.extension)?(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsx)(e0,{tab:a,content:w,worktreeId:b,isMaximized:q,onToggleMaximize:t,onLoadContent:c})}):(0,e.jsx)(e$,{isMaximized:q,onToggle:t,filePath:a.path,children:(0,e.jsx)("div",{className:"h-full flex flex-col",children:(0,e.jsx)(e_,{tab:a,content:w,worktreeId:b,isMaximized:q,onToggleMaximize:t,onFileSaved:g,onDirtyChange:s,onOpenFile:j})})})});function e2(a,b,c){if(b<=0||c<=0)return 0;let d=a+b+8-c;return d>0?-Math.min(d,Math.max(0,a-8)):a<8?8-a:0}let e3=(0,h.memo)(function({tab:a,isActive:b,onActivate:c,onClose:d}){let f=(0,k.c)("worktree"),g=(0,h.useCallback)(()=>{b||c(a.path)},[b,c,a.path]),i=(0,h.useCallback)(b=>{b.stopPropagation(),d(a.path)},[d,a.path]),j=b?"border-accent-500 text-accent-600 dark:text-accent-400 bg-surface":"border-transparent text-muted-foreground hover:text-foreground";return(0,e.jsxs)("div",{"data-testid":`file-tab-${a.path}`,"data-active":b,onClick:g,className:`flex items-center gap-1 px-3 py-2 text-sm font-medium border-b-2 cursor-pointer flex-shrink-0 ${j}`,children:[(0,e.jsx)("span",{className:"truncate max-w-[120px]",title:a.path,children:a.name}),a.isDirty&&(0,e.jsx)("span",{"data-testid":`file-tab-dirty-${a.path}`,className:"w-2 h-2 rounded-full bg-warning flex-shrink-0",title:f("fileTabs.unsavedChanges")}),(0,e.jsx)("button",{type:"button",onClick:i,className:"ml-1 p-0.5 rounded-sm hover:bg-muted transition-colors","aria-label":f("fileTabs.closeTab",{name:a.name}),children:(0,e.jsx)(as.A,{className:"w-3 h-3"})})]})}),e4=(0,h.memo)(function({tabs:a,activeIndex:b,worktreeId:c,onClose:d,onActivate:f,onLoadContent:g,onLoadError:i,onSetLoading:j,onFileSaved:k,onDirtyChange:l,onMoveToFront:m,onOpenFile:n}){let[o,p]=(0,h.useState)(!1),q=(0,h.useRef)(null),r=(0,h.useRef)(null),s=(0,h.useRef)({x:0,y:0}),[t,u]=(0,h.useState)({x:0,y:0}),v=null!==b&&b>=0&&b<a.length?a[b]:null,w=a.length>5?a.slice(0,5):a,x=a.length>5?a.slice(5):[];(0,h.useEffect)(()=>{if(!o)return;let a=a=>{q.current&&!q.current.contains(a.target)&&p(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[o]),(0,h.useLayoutEffect)(()=>{let a=a=>{s.current=a,u(b=>b.x===a.x&&b.y===a.y?b:a)};if(!o)return void a({x:0,y:0});let b=r.current;if(!b)return;let c=b.getBoundingClientRect();a({x:e2(c.left-s.current.x,c.width,window.innerWidth),y:e2(c.top-s.current.y,c.height,window.innerHeight)})},[o]);let y=(0,h.useCallback)(a=>{p(!1),m?.(a)},[m]),z=(0,h.useCallback)(()=>{p(a=>!a)},[]);return(0,e.jsxs)("div",{className:"flex flex-col h-full",children:[(0,e.jsxs)("div",{className:"flex border-b border-border bg-surface dark:bg-surface-2 min-w-0",children:[(0,e.jsx)("div",{className:"flex min-w-0 overflow-hidden flex-1",children:w.map((a,c)=>(0,e.jsx)(e3,{tab:a,isActive:c===b,onActivate:f,onClose:d},a.path))}),x.length>0&&(0,e.jsxs)("div",{className:"relative flex-shrink-0",ref:q,children:[(0,e.jsxs)("button",{type:"button","data-testid":"tab-dropdown-button",onClick:z,className:"flex items-center gap-0.5 px-2 py-2 text-sm font-medium text-muted-foreground hover:text-foreground hover:bg-muted border-b-2 border-transparent transition-colors",children:[(0,e.jsx)(a8.A,{className:`w-3 h-3 transition-transform ${o?"rotate-180":""}`}),(0,e.jsxs)("span",{children:["+",x.length]})]}),o&&(0,e.jsx)("div",{ref:r,"data-testid":"tab-dropdown-menu",className:"absolute right-0 top-full mt-1 bg-surface border border-border rounded-md shadow-lg z-50 min-w-[200px] max-h-[300px] overflow-y-auto",style:0!==t.x||0!==t.y?{transform:`translate(${t.x}px, ${t.y}px)`}:void 0,children:x.map(a=>(0,e.jsxs)("button",{type:"button","data-testid":`tab-dropdown-item-${a.path}`,onClick:()=>y(a.path),className:"w-full text-left px-3 py-2 text-sm text-foreground hover:bg-muted truncate",title:a.path,children:[a.name,a.isDirty&&(0,e.jsx)("span",{className:"ml-1 w-2 h-2 inline-block rounded-full bg-warning"})]},a.path))})]})]}),(0,e.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:v&&(0,e.jsx)(e1,{tab:v,worktreeId:c,onLoadContent:g,onLoadError:i,onSetLoading:j,onFileSaved:k,onDirtyChange:l,onOpenFile:n},v.path)})]})}),e5=(0,h.memo)(function({line:a}){let b="whitespace-pre font-mono text-xs leading-5";return a.startsWith("+")&&!a.startsWith("+++")?b+=" text-success-foreground bg-success-subtle":a.startsWith("-")&&!a.startsWith("---")?b+=" text-danger-foreground bg-danger-subtle":a.startsWith("@@")?b+=" text-info bg-info/10":a.startsWith("diff --git")||a.startsWith("index ")||a.startsWith("---")||a.startsWith("+++")?b+=" text-muted-foreground":b+=" text-foreground",(0,e.jsx)("div",{className:b,children:a})}),e6=(0,h.memo)(function({diff:a,filePath:b,onClose:c}){let d=(0,k.c)("worktree");return(0,e.jsxs)("div",{className:"h-full flex flex-col bg-surface",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border bg-muted shrink-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-accent-600 dark:text-accent-400 shrink-0",children:d("diffViewer.badge")}),(0,e.jsx)("span",{className:"text-xs font-mono text-muted-foreground truncate",children:b})]}),(0,e.jsx)("button",{type:"button",onClick:c,className:"p-1 text-muted-foreground hover:text-foreground rounded shrink-0","aria-label":d("diffViewer.close"),children:(0,e.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,e.jsx)("div",{className:"flex-1 overflow-auto p-2",children:(0,e.jsx)("pre",{className:"text-xs",children:(0,e.jsx)("code",{children:a.split("\n").map((a,b)=>(0,e.jsx)(e5,{line:a},b))})})})]})});function e7(){let[a,b]=(0,h.useState)(!1),c=(0,h.useRef)(a);c.current=a;let d=(0,h.useCallback)(a=>{b(a)},[]);return{collapsed:a,toggle:(0,h.useCallback)(()=>{d(!c.current)},[d]),setCollapsed:d}}let e8=(0,h.memo)(function({terminal:a,terminalHeader:b,fileTabs:c,worktreeId:d,onCloseTab:f,onActivateTab:g,onLoadContent:i,onLoadError:j,onSetLoading:l,onFileSaved:m,diffContent:n,diffFilePath:o,onCloseDiff:p,onDirtyChange:q,onMoveToFront:r,onOpenFile:s}){let t=(0,k.c)("worktree"),u=(0,h.useRef)(null),[v,w]=(0,h.useState)(50),{collapsed:x,toggle:y}=e7(),z=(0,h.useCallback)(a=>{let b=u.current;if(!b)return;let c=b.offsetWidth;if(0===c)return;let d=a/c*100;w(a=>Math.min(80,Math.max(20,a+d)))},[]),A=(0,h.useMemo)(()=>({width:`${v}%`}),[v]),B=(0,h.useMemo)(()=>({width:`${100-v}%`}),[v]),C=(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[b,(0,e.jsx)("div",{className:"flex-1 min-h-0",children:a})]});return c.tabs.length>0||n&&o?x?(0,e.jsxs)("div",{ref:u,className:"flex h-full min-h-0",children:[(0,e.jsx)("div",{"data-testid":"terminal-pane",style:{width:"calc(100% - 36px)"},className:"flex-shrink-0 overflow-hidden",children:C}),(0,e.jsx)("div",{"data-testid":"file-panel-expand-bar",style:{width:"36px"},className:"flex-shrink-0 flex items-start justify-center bg-muted border-l border-border",children:(0,e.jsxs)("button",{type:"button","aria-label":t("terminal.showFiles"),title:t("terminal.showFiles"),onClick:y,className:"flex flex-col items-center gap-2 w-full pt-2 text-muted-foreground hover:text-accent-600 dark:hover:text-accent-400 focus:outline-none focus:ring-2 focus:ring-ring",children:[(0,e.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),(0,e.jsx)("span",{className:"text-xs font-medium tracking-wide select-none",style:{writingMode:"vertical-rl"},"aria-hidden":"true",children:t("terminal.filesLabel")})]})})]}):(0,e.jsxs)("div",{ref:u,className:"flex h-full min-h-0",children:[(0,e.jsx)("div",{"data-testid":"terminal-pane",style:A,className:"flex-shrink-0 overflow-hidden",children:C}),(0,e.jsx)(ch,{onResize:z,orientation:"horizontal",ariaValueNow:v}),(0,e.jsxs)("div",{"data-testid":"file-panel-pane",style:B,className:"flex-grow overflow-hidden flex",children:[(0,e.jsx)("button",{type:"button","aria-label":t("terminal.hideFiles"),title:t("terminal.hideFiles"),onClick:y,className:"flex-shrink-0 flex items-center justify-center w-5 h-full bg-muted border-r border-border text-muted-foreground hover:text-accent-600 dark:hover:text-accent-400 focus:outline-none focus:ring-2 focus:ring-ring",children:(0,e.jsx)("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),(0,e.jsx)("div",{className:"flex-1 min-w-0 overflow-hidden",children:n&&o&&p?(0,e.jsx)(e6,{diff:n,filePath:o,onClose:p}):(0,e.jsx)(e4,{tabs:c.tabs,activeIndex:c.activeIndex,worktreeId:d,onClose:f,onActivate:g,onLoadContent:i,onLoadError:j,onSetLoading:l,onFileSaved:m,onDirtyChange:q,onMoveToFront:r,onOpenFile:s})})]})]}):(0,e.jsx)("div",{className:"h-full",children:C})});var e9=c(51881);let fa=(0,x.A)("align-horizontal-distribute-center",[["rect",{width:"6",height:"14",x:"4",y:"5",rx:"2",key:"1wwnby"}],["rect",{width:"6",height:"10",x:"14",y:"7",rx:"2",key:"1fe6j6"}],["path",{d:"M17 22v-5",key:"4b6g73"}],["path",{d:"M17 7V2",key:"hnrr36"}],["path",{d:"M7 22v-3",key:"1r4jpn"}],["path",{d:"M7 5V2",key:"liy1u9"}]]),fb=(0,x.A)("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),fc=(0,x.A)("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]),fd={splits:[{cliToolId:"claude",instanceId:"claude"}],widths:[1]};a7.XH;function fe(a){let b=a.reduce((a,b)=>a+b,0);return b>0?a.map(a=>a/b):a.map(()=>1/a.length)}let ff=(0,h.memo)(function({worktreeId:a,instances:b,rosterReady:c=!0,renderPane:d,onFocusedSplitChange:f,showToast:g,onActiveInstanceChange:j,headerInstanceSelection:l}){let{splits:m,widths:n,addSplit:o,removeSplit:p,setSplitInstance:q,setSplitWidth:r,resetWidths:s,availableInstanceIds:t,focusedSplitIndex:u,setFocusedSplitIndex:v}=function(a,b,c=!0){let[d,e]=(0,h.useState)(()=>(function(a,b,c){let d=function(a,b){let c=b[0];return c?{splits:[{cliToolId:c.cliTool,instanceId:c.id}],widths:[1]}:{splits:fd.splits.map(a=>({...a})),widths:[...fd.widths]}}(0,b);return c?function(a,b){let c;if(0===b.length)return a;let d=new Map(b.map(a=>[a.id,a.cliTool])),e=new Set,f=Math.min(Math.max(a.splits.length,1),b.length,3),g=[];for(let b of a.splits){if(g.length>=f)break;let a=d.get(b.instanceId);a&&!e.has(b.instanceId)&&(e.add(b.instanceId),g.push({cliToolId:a,instanceId:b.instanceId}))}for(let a of b){if(g.length>=f)break;e.has(a.id)||(e.add(a.id),g.push({cliToolId:a.cliTool,instanceId:a.id}))}return(0===g.length&&g.push({cliToolId:b[0].cliTool,instanceId:b[0].id}),g.length===a.splits.length&&g.every((b,c)=>b.instanceId===a.splits[c].instanceId&&b.cliToolId===a.splits[c].cliToolId))?a:(c=g.length===a.widths.length?fe(a.widths):g.length<a.widths.length?fe(a.widths.slice(0,g.length)):Array.from({length:g.length},()=>1/g.length),{splits:g,widths:c})}(d,b):d})(0,b,c)),[f,g]=(0,h.useState)(0),i=(0,h.useRef)(d);i.current=d;let j=(0,h.useRef)(b);j.current=b,(0,h.useRef)(c).current=c,(0,h.useRef)(a),(0,h.useMemo)(()=>b.map(a=>`${a.id}:${a.cliTool}`).join("|"),[b]),(0,h.useRef)(a);let k=(0,h.useCallback)(()=>{e(a=>{if(a.splits.length>=3)return a;let b=new Set(a.splits.map(a=>a.instanceId)),c=function(a,b){for(let c of a)if(!b.has(c.id))return c;return null}(j.current,b);if(!c)return a;let d=a.widths.length-1,e=a.widths[d]/2,f=[...a.widths];return f[d]=e,f.push(e),{splits:[...a.splits,{cliToolId:c.cliTool,instanceId:c.id}],widths:f}})},[]),l=(0,h.useCallback)(()=>{e(a=>a.splits.length<=1?a:{splits:a.splits.slice(0,-1),widths:fe(a.widths.slice(0,-1))})},[]),m=(0,h.useCallback)((a,b)=>{let c=i.current,d=j.current;if(a<0||a>=c.splits.length)return!1;let f=d.find(a=>a.id===b);if(!f||c.splits[a].instanceId===b)return!1;for(let d=0;d<c.splits.length;d++)if(d!==a&&c.splits[d].instanceId===b)return!1;return e(c=>{if(a<0||a>=c.splits.length||c.splits[a].instanceId===b)return c;for(let d=0;d<c.splits.length;d++)if(d!==a&&c.splits[d].instanceId===b)return c;let d=c.splits.map((c,d)=>d===a?{cliToolId:f.cliTool,instanceId:b}:c);return{...c,splits:d}}),!0},[]),n=(0,h.useCallback)(a=>{e(b=>a.length!==b.widths.length||!function(a){if(!Array.isArray(a))return!1;for(let b of a)if("number"!=typeof b||!Number.isFinite(b)||b<=0)return!1;return!0}(a)?b:{...b,widths:[...a]})},[]),o=(0,h.useCallback)(()=>{e(a=>{let b=a.splits.length;return 0===b?a:{...a,widths:Array.from({length:b},()=>1/b)}})},[]),p=(0,h.useCallback)(a=>{let c=new Set;for(let b=0;b<d.splits.length;b++)b!==a&&c.add(d.splits[b].instanceId);return b.filter(a=>!c.has(a.id)).map(a=>a.id)},[d.splits,b]),q=(0,h.useCallback)(a=>{g(a)},[]);return{splits:d.splits,widths:d.widths,addSplit:k,removeSplit:l,setSplitInstance:m,setSplitWidth:n,resetWidths:o,availableInstanceIds:p,focusedSplitIndex:f,setFocusedSplitIndex:q}}(a,b,c),w=(0,h.useMemo)(()=>{let a=new Map;for(let c of b)a.set(c.id,c);return a},[b]),x=(0,k.c)("worktree"),{visible:y,toggle:z,setWidth:A}=cc(),{collapsed:B,toggle:C}=e7(),D=!B,E=(0,h.useRef)(null),[F,G]=(0,h.useState)(!1),H=(0,h.useRef)(m.length),[I,J]=(0,h.useState)(null);(0,h.useEffect)(()=>{m.length>H.current&&J(m.length-1),H.current=m.length},[m.length]),(0,h.useEffect)(()=>{f?.(u)},[u,f]);let K=(0,h.useRef)(0),L=(0,h.useRef)(m);L.current=m,(0,h.useEffect)(()=>{if(!l||l.token===K.current)return;K.current=l.token;let{instanceId:a}=l,b=L.current.findIndex(b=>b.instanceId===a);if(0!==b){if(b>0)return void v(b);q(0,a)&&v(0)}},[l,q,v]),(0,h.useEffect)(()=>{if(null===I)return;let a=E.current;if(!a)return;let b=a.querySelector(`[data-split-index="${I}"]`);if(!b)return;let c=b.querySelector("textarea");c?.focus(),v(I),J(null)},[I,v]);let M=(0,h.useCallback)((a,b)=>{let c=E.current;if(!c)return;let d=c.offsetWidth;if(0===d)return;let e=n.reduce((a,b)=>a+b,0),f=b/d*e,g=[...n],h=g[a]+f,i=g[a+1]-f,j=.05*e;h<j||i<j||(g[a]=h,g[a+1]=i,r(g))},[n,r]),N=(0,h.useCallback)(()=>G(!0),[]),O=(0,h.useCallback)(()=>G(!1),[]),P=(0,h.useCallback)(()=>{s(),A(40)},[s,A]),Q=m.length<3&&!F,R=m.length>1&&!F,S=m.length>1||y,T=(0,h.useMemo)(()=>m.map((a,b)=>()=>v(b)),[m,v]),U=(0,h.useMemo)(()=>m.map((a,b)=>a=>q(b,a)),[m,q]),V=(0,h.useMemo)(()=>m.map((a,b)=>a=>{let c=(0,a7.sw)(w.get(a)??{cliTool:"claude",alias:a});if(m[b]?.instanceId===a)return;let d=m.findIndex((c,d)=>d!==b&&c.instanceId===a);if(-1!==d)return void g?.(`${c} is already in use by split ${d+1}`,"warning");q(b,a)&&(j?.(a),g?.(`Moved ${c} to Split ${b+1}`,"success"))}),[m,q,g,j,w]);return(0,e.jsxs)("div",{role:"group","aria-label":"Terminal splits","data-testid":"terminal-split-container",className:"flex flex-col h-full min-h-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 bg-surface border-b border-border flex-shrink-0",children:[(0,e.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums mr-1",children:[m.length," / ",3," splits"]}),(0,e.jsx)("button",{type:"button",onClick:o,disabled:!Q,"aria-disabled":!Q,"aria-label":x("terminal.addSplit"),title:x("terminal.addSplit"),"data-testid":"add-terminal-split",className:"flex items-center justify-center h-7 w-7 rounded text-muted-foreground hover:text-surface-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",children:(0,e.jsx)(dA,{className:"w-4 h-4","aria-hidden":"true"})}),(0,e.jsx)("button",{type:"button",onClick:p,disabled:!R,"aria-disabled":!R,"aria-label":x("terminal.removeSplit"),title:x("terminal.removeSplit"),"data-testid":"remove-terminal-split",className:"flex items-center justify-center h-7 w-7 rounded text-muted-foreground hover:text-surface-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",children:(0,e.jsx)(e9.A,{className:"w-4 h-4","aria-hidden":"true"})}),(0,e.jsx)("button",{type:"button",onClick:P,disabled:!S,"aria-disabled":!S,"aria-label":x("terminal.equalizeWidthsHint"),title:x("terminal.equalizeWidthsHint"),"data-testid":"equalize-split-widths",className:"flex items-center justify-center h-7 w-7 rounded text-muted-foreground hover:text-surface-foreground hover:bg-muted disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors",children:(0,e.jsx)(fa,{className:"w-4 h-4 flex-shrink-0","aria-hidden":"true"})}),(0,e.jsx)("div",{className:"ml-auto h-4 w-px bg-border","aria-hidden":"true"}),(0,e.jsxs)("button",{type:"button",onClick:z,"aria-pressed":y,"aria-label":x(y?"terminal.hideHistory":"terminal.showHistory"),title:x(y?"terminal.hideHistory":"terminal.showHistory"),"data-testid":"toggle-history-pane",className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded border transition-colors ${y?"border-accent-300 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300":"border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[(0,e.jsx)(fb,{className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true"}),(0,e.jsx)("span",{children:x("terminal.historyLabel")})]}),(0,e.jsxs)("button",{type:"button",onClick:C,"aria-pressed":D,"aria-label":x(D?"terminal.hideFiles":"terminal.showFiles"),title:x(D?"terminal.hideFiles":"terminal.showFiles"),"data-testid":"toggle-file-panel",className:`flex items-center gap-1 text-xs px-2 py-0.5 rounded border transition-colors ${D?"border-accent-300 dark:border-accent-700 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-300":"border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[(0,e.jsx)(fc,{className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true"}),(0,e.jsx)("span",{children:x("terminal.filesLabel")})]})]}),(0,e.jsx)("div",{ref:E,className:"flex flex-1 min-h-0 w-full",children:m.map((a,b)=>{let c=b===m.length-1;return(0,e.jsxs)(i().Fragment,{children:[(0,e.jsx)("div",{style:{flexGrow:n[b]??1,flexShrink:1,flexBasis:0,minWidth:0},className:"h-full",children:d({splitIndex:b,cliToolId:a.cliToolId,instanceId:a.instanceId,instance:w.get(a.instanceId),availableInstances:t(b).map(a=>w.get(a)).filter(a=>void 0!==a),onInstanceChange:U[b],onFocus:T[b],isFocused:u===b,onDropInstance:V[b]})}),c?null:(0,e.jsx)(fg,{resizerIdx:b,ariaValueNow:n.length?n[b]/n.reduce((a,b)=>a+b,0)*100:50,onResize:M,onStart:N,onEnd:O,onDoubleClick:s})]},`split-${b}`)})})]})});function fg({resizerIdx:a,ariaValueNow:b,onResize:c,onStart:d,onEnd:f,onDoubleClick:g}){let i=(0,h.useCallback)(b=>c(a,b),[a,c]);return(0,e.jsx)("div",{"data-testid":`split-resizer-${a}`,onMouseDownCapture:d,onTouchStartCapture:d,onMouseUpCapture:f,onTouchEndCapture:f,children:(0,e.jsx)(ch,{onResize:i,orientation:"horizontal",ariaValueNow:b,onDoubleClick:g})})}let fh={key:"Escape",label:"Esc",ariaLabel:"Send Escape"},fi=[fh,{key:"q",label:"q",ariaLabel:"Send q (quit)"}];function fj({worktreeId:a,cliToolId:b,instanceId:c,onKeysSent:d}){let[f,g]=(0,h.useState)(null),i=ai(a,b,c,d),j="codex"===b?fi:[fh],k=(0,h.useCallback)(a=>{g(a),setTimeout(()=>g(null),ah.tX),i([a])},[i]);return(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 py-1.5 bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800/50 rounded-lg",role:"toolbar","aria-label":"Terminal escape keys",children:[(0,e.jsx)("span",{className:"text-xs text-amber-700 dark:text-amber-400 mx-2",title:"Send an escape key when the terminal is stuck in a TUI mode",children:"Escape"}),j.map(({key:a,label:b,ariaLabel:c})=>(0,e.jsx)("button",{type:"button",className:`min-w-[44px] min-h-[44px] px-3 py-2 text-sm font-medium rounded-md
|
|
31
31
|
border border-amber-300 dark:border-amber-700
|
|
32
32
|
focus:outline-none focus:ring-2 focus:ring-amber-500
|
|
33
33
|
transition-colors duration-75
|
|
@@ -35,4 +35,4 @@ ${b.trim()}`:c}(s,g))})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",c
|
|
|
35
35
|
px-6 py-2 rounded-lg font-medium transition-all
|
|
36
36
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
37
37
|
focus:outline-none focus:ring-2 focus:ring-offset-2
|
|
38
|
-
`.trim(),fl="bg-accent-600 text-white hover:bg-accent-700 focus:ring-ring";function fm({promptData:a,answering:b,onRespond:c,onDismiss:d,labelId:f,cliToolName:g}){let i=(0,k.c)("prompt"),[j,l]=(0,h.useState)(()=>{if("multiple_choice"===a.type){let b=a.options.find(a=>a.isDefault);return b?.number??null}return null}),[m,o]=(0,h.useState)(""),[p,q]=(0,h.useState)(!1),r=(0,h.useMemo)(()=>"multiple_choice"!==a.type?null:a.options.find(a=>a.number===j)??null,[a,j]),s=r?.requiresTextInput===!0,t=b||p,u=(0,h.useCallback)(async a=>{if(!t){q(!0);try{await c(a)}catch(a){}finally{q(!1)}}},[t,c]),v=(0,h.useCallback)(async()=>{if(!t&&null!==j){q(!0);try{let a=s&&m.trim()?m.trim():j.toString();await c(a)}catch(a){}finally{q(!1)}}},[t,c,j,s,m]);return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("h3",{id:f,className:"text-lg font-semibold text-warning-foreground flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xl","aria-hidden":"true",children:"?"}),g?i("confirmationFrom",{toolName:g}):i("confirmationFromClaude")]}),d&&(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:d,"aria-label":"close",className:"p-1 rounded hover:bg-warning-border/50 transition-colors",children:(0,e.jsx)("svg",{className:"w-5 h-5 text-warning-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),a.instructionText&&(0,e.jsx)("div",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap text-sm text-muted-foreground bg-muted rounded p-2 border border-border",children:a.instructionText}),(0,e.jsx)("p",{className:"text-foreground leading-relaxed",children:a.question}),t&&(0,e.jsxs)("div",{"data-testid":"answering-indicator",className:"flex items-center gap-2 text-sm text-muted-foreground",role:"status","aria-live":"polite",children:[(0,e.jsx)(n.y$,{size:"sm",variant:"accent"}),(0,e.jsx)("span",{children:i("sending")})]}),"yes_no"===a.type&&(0,e.jsx)(fn,{promptData:a,disabled:t,onYes:()=>u("yes"),onNo:()=>u("no")}),"multiple_choice"===a.type&&(0,e.jsx)(fo,{promptData:a,disabled:t,selectedOption:j,onSelectOption:l,textInputValue:m,onTextInputChange:o,showTextInput:s,onSubmit:v})]})}function fn({promptData:a,disabled:b,onYes:c,onNo:d}){let f=(0,k.c)("prompt"),g="yes"===a.defaultOption,h="no"===a.defaultOption,i=`${fk} ${fl} ${g?"primary default highlighted":""}`,j=`${fk} ${h?"bg-foreground text-background hover:bg-foreground/90 primary default highlighted":"bg-surface border-2 border-input hover:bg-muted text-foreground focus:ring-ring"}`;return(0,e.jsxs)("div",{className:"flex items-center gap-3",role:"group","aria-label":f("yesNoGroupLabel"),children:[(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:c,disabled:b,className:i,children:f("yes")}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:d,disabled:b,className:j,children:f("no")})]})}function fo({promptData:a,disabled:b,selectedOption:c,onSelectOption:d,textInputValue:f,onTextInputChange:g,showTextInput:i,onSubmit:j}){let l=(0,h.useId)(),m=(0,k.c)("prompt"),o=(0,h.useCallback)(a=>{let d=c===a,e=b?"opacity-50 cursor-not-allowed":"";return`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all ${d?"bg-accent-50 dark:bg-accent-900/30 border-2 border-accent-500":"bg-surface border-2 border-border hover:border-input"} ${e}`},[c,b]);return(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("fieldset",{children:[(0,e.jsx)("legend",{className:"sr-only",children:m("selectAnOption")}),(0,e.jsx)(n.z6,{name:l,value:null!=c?String(c):"",onValueChange:a=>d(Number(a)),disabled:b,className:"flex flex-col gap-2",children:a.options.map(a=>(0,e.jsxs)("label",{className:o(a.number),children:[(0,e.jsx)(n.CU,{value:String(a.number),className:"mt-1","aria-describedby":a.isDefault?`default-${a.number}`:void 0}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsxs)("span",{className:"font-medium",children:[a.number,". ",a.label]}),a.isDefault&&(0,e.jsx)("span",{id:`default-${a.number}`,className:"ml-2 text-xs text-accent-600 dark:text-accent-400 bg-accent-100 dark:bg-accent-900/30 px-2 py-0.5 rounded",children:m("default")})]})]},a.number))})]}),i&&(0,e.jsxs)("div",{className:"mt-3",children:[(0,e.jsx)("label",{htmlFor:`text-input-${l}`,className:"sr-only",children:m("customValueInput")}),(0,e.jsx)("input",{id:`text-input-${l}`,type:"text",value:f,onChange:a=>g(a.target.value),disabled:b,placeholder:m("enterValuePlaceholder"),className:"w-full px-4 py-2 border-2 border-input dark:bg-muted dark:text-foreground rounded-lg focus:outline-none focus:border-accent-500 disabled:opacity-50"})]}),(0,e.jsx)("button",{type:"button",onClick:j,disabled:b||null===c,className:`w-full ${fk} ${fl}`,children:m("submit")})]})}let fp=(0,h.memo)(function({promptData:a,messageId:b,visible:c,answering:d,onRespond:f,onDismiss:g,cliToolName:i}){let j,{shouldRender:k,animationClass:l}=I({visible:c&&null!==a,duration:200}),m=(0,h.useId)();if(!k||!a)return null;let n=(j="opacity-100","animate-fade-in"===l?j="opacity-100 transform translate-y-0":"animate-fade-out"===l&&(j="opacity-0 transform translate-y-2"),`bg-warning-subtle border-2 border-warning-border rounded-lg p-4 shadow-lg transition-all duration-200 ease-in-out ${l} ${j}`);return(0,e.jsx)(F,{componentName:"PromptPanel",children:(0,e.jsx)("div",{"data-testid":"prompt-panel",role:"dialog","aria-labelledby":m,"aria-modal":"true",className:n,children:(0,e.jsx)(fm,{promptData:a,answering:d,onRespond:f,onDismiss:g,labelId:m,cliToolName:i})})})});var fq=c(74892);function fr({isOpen:a,onConfirm:b,onCancel:c,cliToolName:d}){let f=(0,k.c)("autoYes"),g=(0,k.c)("common"),[i,j]=(0,h.useState)(36e5),[l,m]=(0,h.useState)(""),[n,o]=(0,h.useState)(null),[p,q]=(0,h.useState)(!1),r=(0,h.useRef)(null),s=a=>f(dF[a].replace("autoYes.",""));return(0,e.jsx)(a5.a,{isOpen:a,onClose:c,title:d?f("enableTitleWithTool",{toolName:d}):f("enableTitle"),size:"sm",showCloseButton:!0,children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"text-sm text-foreground",children:[(0,e.jsx)("p",{className:"font-medium mb-2",children:f("featureDescription")}),(0,e.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,e.jsx)("li",{children:f("yesNoAutoResponse")}),(0,e.jsx)("li",{children:f("multipleChoiceAutoSelect")})]}),(0,e.jsx)("p",{className:"mt-1",children:f("autoDisableAfter",{duration:s(i)})}),d&&(0,e.jsx)("p",{className:"mt-2 text-muted-foreground",children:f("appliesOnlyToCurrent",{toolName:d})})]}),(0,e.jsxs)("div",{className:"text-sm text-foreground",children:[(0,e.jsx)("p",{className:"font-medium mb-2",children:f("duration")}),(0,e.jsx)("div",{className:"flex gap-2",children:dE.map(a=>(0,e.jsx)("button",{type:"button",onClick:()=>j(a),className:`flex-1 py-2 px-3 text-sm font-medium rounded-md border-2 transition-colors ${i===a?"border-accent-600 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-400":"border-border bg-surface dark:bg-surface-2 text-foreground hover:border-muted-foreground"}`,style:{minHeight:"44px"},children:s(a)},a))})]}),(0,e.jsxs)("div",{className:"text-sm text-foreground",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("label",{htmlFor:"stop-pattern-input",className:"font-medium",children:f("stopPatternLabel")}),(0,e.jsxs)("div",{className:"relative",ref:r,children:[(0,e.jsx)("button",{type:"button",onClick:()=>q(!p),className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-muted text-muted-foreground text-[10px] font-bold hover:bg-muted/80 focus:outline-none","aria-label":f("regexTipsLabel"),"data-testid":"regex-tips-button",children:"?"}),p&&(0,e.jsxs)("div",{className:"absolute left-0 top-6 z-50 w-72 rounded-md border border-border bg-surface p-3 shadow-lg text-xs text-foreground","data-testid":"regex-tips-tooltip",children:[(0,e.jsx)("p",{className:"font-medium mb-1.5",children:f("regexTipsTitle")}),(0,e.jsxs)("ul",{className:"space-y-1",children:[(0,e.jsxs)("li",{children:[(0,e.jsx)("code",{className:"bg-muted px-1 rounded",children:"\\bcat\\b"})," ",f("regexTipWordBoundary")]}),(0,e.jsxs)("li",{children:[(0,e.jsx)("code",{className:"bg-muted px-1 rounded",children:"error|fatal"})," ",f("regexTipOr")]}),(0,e.jsxs)("li",{children:[(0,e.jsx)("code",{className:"bg-muted px-1 rounded",children:"(?i)error"})," ",f("regexTipCaseNote")]})]})]})]})]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:f("stopPatternDescription")}),(0,e.jsx)("input",{id:"stop-pattern-input",type:"text",value:l,onChange:a=>m(a.target.value),placeholder:f("stopPatternPlaceholder"),className:`w-full px-3 py-2 border rounded-md text-sm font-mono bg-surface dark:bg-surface-2 text-foreground ${n?"border-danger focus:ring-danger focus:border-danger":"border-input focus:ring-ring focus:border-accent-500"} focus:outline-none focus:ring-1`,"data-testid":"stop-pattern-input"}),n&&(0,e.jsx)("p",{className:"mt-1 text-xs text-danger","data-testid":"stop-pattern-error",children:n})]}),(0,e.jsxs)("div",{className:"text-sm text-foreground",children:[(0,e.jsx)("p",{className:"font-medium mb-2",children:f("aboutRisks")}),(0,e.jsx)("p",{children:f("riskWarning")})]}),(0,e.jsx)("div",{className:"bg-warning-subtle border-l-4 border-warning p-3",children:(0,e.jsxs)("p",{className:"text-sm text-warning-foreground",children:[(0,e.jsx)("span",{className:"font-medium",children:f("disclaimer")}),f("disclaimerText")]})}),(0,e.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,e.jsx)("button",{type:"button",onClick:c,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:g("cancel")}),(0,e.jsx)("button",{type:"button",onClick:()=>{b(i,l.trim()||void 0)},disabled:!!n,className:`px-4 py-2 text-sm font-medium rounded-md text-white ${n?"bg-muted-foreground cursor-not-allowed":"bg-warning hover:bg-warning/90"}`,"data-testid":"confirm-button",children:f("agreeAndEnable")})]})]})})}let fs=(0,h.memo)(function({enabled:a,expiresAt:b,onToggle:c,lastAutoResponse:d,cliToolName:f,inline:g=!1,showToolName:i=!0,onExpire:j}){let l=(0,k.c)("autoYes"),[m,n]=(0,h.useState)(""),[o,p]=(0,h.useState)(null),[q,r]=(0,h.useState)(!1),[s,t]=(0,h.useState)(!1),[u,v]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(!a||!b){n(""),v(!1);return}v(!1);let c=!1,d=()=>(n(dG(b)),b-Date.now()<=0&&!c&&(c=!0,v(!0),j?.(),!0));if(d())return;let e=setInterval(()=>{d()&&clearInterval(e)},1e3);return()=>clearInterval(e)},[a,b,j]),(0,h.useEffect)(()=>{if(!d)return;p(`Auto responded: "${d}"`);let a=setTimeout(()=>p(null),ah.I2);return()=>clearTimeout(a)},[d]);let w=a&&!u,x=(0,h.useCallback)(()=>{w?(r(!0),c({enabled:!1}).finally(()=>r(!1))):t(!0)},[w,c]),y=(0,h.useCallback)((a,b)=>{t(!1),r(!0),c({enabled:!0,duration:a,stopPattern:b}).finally(()=>r(!1))},[c]),z=(0,h.useCallback)(()=>{t(!1)},[]);return(0,e.jsxs)("div",{className:g?"flex items-center gap-2":"flex items-center gap-3 px-4 py-2 bg-surface-2 border-b border-border",children:[(0,e.jsx)(fq.d,{checked:w,onCheckedChange:x,disabled:q,"aria-label":l("toggleLabel")}),(0,e.jsx)("span",{className:"text-sm font-medium text-foreground",children:l("label")}),i&&f&&(0,e.jsxs)("span",{className:"text-xs text-accent-600 dark:text-accent-400 font-medium","aria-label":l("targetLabel"),children:["(",(0,a7.f_)(f,""),")"]}),w&&m&&(0,e.jsx)("span",{className:"text-sm text-muted-foreground","aria-label":l("timeRemaining"),children:m}),o&&(0,e.jsx)("span",{className:"text-sm text-success animate-pulse",children:o}),(0,e.jsx)(fr,{isOpen:s,onConfirm:y,onCancel:z,cliToolName:(0,a7.f_)(f,"")})]})});function ft(a){let b=new Set;for(let c of a)"user"===c.role&&b.add(c.id);return b}function fu(a,b,c,d){let e={answer:a,cliTool:b};if(d&&d!==b&&(e.instanceId=d),c&&(e.promptType=c.type,"multiple_choice"===c.type)){let a=c.options.find(a=>a.isDefault);a&&(e.defaultOptionNumber=a.number),c.submitMode&&(e.submitMode=c.submitMode)}return e}let fv=(0,h.memo)(function({worktreeId:a,splitIndex:b,cliToolId:c,instanceId:d,instance:f,availableInstances:g,onInstanceChange:j,onFocus:l,disabled:m=!1,pendingInsertText:n,onInsertConsumed:o,onMessageSent:p,cliStatus:q="idle",autoYes:r,history:s,onDropInstance:t,draggedInstanceId:u,onRequestSessionEnd:v}){let w=d??c,x=r.enabled??!1,y=r.expiresAt??null,z=r.lastAutoResponse??null,A=r.onToggle,B=s?.showArchived??!1,C=s?.onShowArchivedChange,D=s?.historyDisplayLimit,E=s?.onHistoryDisplayLimitChange,F=s?.historyUserOnly??!1,G=s?.onHistoryUserOnlyChange,H=s?.onInsertToMessage,I=s?.onFilePathClick,J=s?.showToast,K=(0,k.c)("worktree"),{terminal:L,prompt:M,setAutoScroll:N,setPromptAnswering:O,clearPrompt:P,refresh:Q}=bq({worktreeId:a,cliToolId:c,instanceId:w,enabled:!m}),{messages:R,isLoading:S,refresh:U}=function({worktreeId:a,cliToolId:b,instanceId:c,limit:d,includeArchived:e=!1,enabled:f=!0}){let[g,i]=(0,h.useState)([]),[j,k]=(0,h.useState)(!0),{subscribe:l,unsubscribe:m,addListener:n}=(0,bp.xM)(),o=c??b,p=(0,h.useRef)(0),q=(0,h.useRef)(b);q.current=b;let r=(0,h.useRef)(o);r.current=o;let s=(0,h.useCallback)(async()=>{let c=++p.current;try{let f=new URLSearchParams({cliTool:b,instance:o});void 0!==d&&f.set("limit",String(d)),e&&f.set("includeArchived","true");let g=await fetch(`/api/worktrees/${a}/messages?${f.toString()}`);if(!g.ok)return;let h=await g.json();if(p.current!==c||q.current!==b||r.current!==o)return;i(h.map(a=>({...a,timestamp:new Date(a.timestamp)}))),k(!1)}catch(a){if(p.current!==c||q.current!==b||r.current!==o)return;console.error("[useSplitMessages] fetch error:",a),k(!1)}},[a,b,o,d,e]),t=`${a}::${b}::${o}`;return(0,h.useRef)(t),{messages:g,isLoading:j,refresh:(0,h.useCallback)(()=>s(),[s])}}({worktreeId:a,cliToolId:c,instanceId:w,limit:D,includeArchived:B,enabled:!m}),V=(0,h.useCallback)((b,c)=>T.y.sendMessage(a,b,c),[a]),{messages:W,sendOptimistic:X,retry:Y,discard:Z}=function({worktreeId:a,serverMessages:b,sendFn:c,onSent:d,timeoutMs:e=3e4}){let[f,g]=(0,h.useState)([]),i=(0,h.useRef)(b);i.current=b;let j=(0,h.useRef)(f);j.current=f;let k=(0,h.useRef)(d);k.current=d;let l=(0,h.useRef)(c);l.current=c;let m=(0,h.useRef)(0),n=(0,h.useRef)(new Map),o=(0,h.useRef)(new Set),p=(0,h.useCallback)(a=>{let b=n.current.get(a);void 0!==b&&(clearTimeout(b),n.current.delete(a))},[]),q=(0,h.useCallback)(a=>{p(a);let b=setTimeout(()=>{n.current.delete(a),g(b=>b.map(b=>b.tempId===a&&"sending"===b.status?{...b,status:"error"}:b))},e);n.current.set(a,b)},[p,e]),r=(0,h.useCallback)(async a=>{q(a.tempId);try{await l.current(a.content,a.options),k.current?.()}catch{p(a.tempId),g(b=>b.map(b=>b.tempId===a.tempId?{...b,status:"error"}:b))}},[q,p]),s=(0,h.useCallback)((a,b)=>{let c={tempId:`pending-${m.current++}`,content:a,options:b,timestamp:new Date,status:"sending",baselineUserIds:ft(i.current)};g(a=>[...a,c]),r(c)},[r]),t=(0,h.useCallback)(a=>{let b=j.current.find(b=>b.tempId===a);if(!b)return;let c={...b,status:"sending",timestamp:new Date,baselineUserIds:ft(i.current)};g(b=>b.map(b=>b.tempId===a?c:b)),r(c)},[r]),u=(0,h.useCallback)(a=>{let b=j.current.find(b=>b.tempId===a);return p(a),g(b=>b.filter(b=>b.tempId!==a)),b?.content},[p]);return{messages:(0,h.useMemo)(()=>{if(0===f.length)return b;let{reconciledTempIds:c}=function(a,b,c){let d=new Set,e=new Set,f=a.filter(a=>"sending"===a.status);if(0===f.length)return{reconciledTempIds:d,consumedServerIds:e};let g=b.filter(a=>"user"===a.role&&!c.has(a.id)).sort((a,b)=>a.timestamp.getTime()-b.timestamp.getTime()),h=new Set;for(let a of[...f].sort((a,b)=>a.timestamp.getTime()-b.timestamp.getTime())){let b=g.find(b=>!h.has(b.id)&&!a.baselineUserIds.has(b.id)&&b.content===a.content);b&&(h.add(b.id),d.add(a.tempId),e.add(b.id))}return{reconciledTempIds:d,consumedServerIds:e}}(f,b,o.current),d=f.filter(a=>!c.has(a.tempId)).map(b=>({id:b.tempId,worktreeId:a,role:"user",content:b.content,timestamp:b.timestamp,messageType:"normal",archived:!1,cliToolId:b.options.cliToolId,instanceId:b.options.instanceId,optimisticState:b.status}));return 0===d.length?b:[...b,...d]},[b,f,a]),pending:f,sendOptimistic:s,retry:t,discard:u}}({worktreeId:a,serverMessages:R,sendFn:V,onSent:U}),{visible:$,width:_,toggle:aa,setWidth:ab}=cc(),ac=i().useRef(null),ad=(0,h.useCallback)(a=>{let b=ac.current;if(!b)return;let c=b.offsetWidth;0!==c&&ab(_+a/c*100)},[_,ab]),ae="opencode"===c||"copilot"===c,af="claude"===c||"codex"===c,ah=(0,h.useCallback)(a=>N(a),[N]),ai=(0,h.useCallback)(a=>{Q(),U(),p?.(a)},[Q,U,p]),aj=(0,h.useCallback)(a=>{let b=Z(a);b&&H?.(b)},[Z,H]),ak=(0,h.useCallback)(async b=>{O(!0);try{let d=fu(b,c,M.data,w),e=await fetch(`/api/worktrees/${a}/prompt-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(!e.ok)throw Error(`Failed to send prompt response: ${e.status}`);P(),await Q()}catch(a){console.error("[TerminalSplitPaneContent] prompt response error:",a)}finally{O(!1)}},[a,c,w,M.data,O,P,Q]),am=(0,h.useCallback)(()=>{P()},[P]),an=L.isSelectionListActive,ao=M.visible&&!x,ap=L.isUnclassifiedActive&&!an&&!M.visible,aq=(0,h.useMemo)(()=>(0,e.jsx)(cq,{messages:W,worktreeId:a,onFilePathClick:I??(()=>{}),isLoading:S,className:"h-full",showToast:J,onInsertToMessage:H,onRetryPending:Y,onDiscardPending:aj,showArchived:B,onShowArchivedChange:C,historyDisplayLimit:D,onHistoryDisplayLimitChange:E,historyUserOnly:F,onHistoryUserOnlyChange:G,onCollapse:aa,splitIndex:b,cliToolId:c}),[W,Y,aj,a,I,S,J,H,B,C,D,E,F,G,aa,b,c]),ar=(0,h.useMemo)(()=>(0,e.jsx)(bo,{output:L.output,isActive:L.isRunning,attaching:L.attaching,isThinking:L.isThinking,autoScroll:L.autoScroll,onScrollChange:ah,disableAutoFollow:ae,compactTuiLayoutPadding:af}),[L.output,L.isRunning,L.attaching,L.isThinking,L.autoScroll,ah,ae,af]),at=(0,h.useMemo)(()=>(0,e.jsxs)("div",{ref:ac,className:"flex h-full min-h-0 w-full",children:[$?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{id:cm(b),"data-testid":`split-history-slot-${b}`,"aria-label":"History pane",style:{width:`${_}%`},className:"flex-shrink-0 overflow-hidden min-h-0",children:aq}),(0,e.jsx)(ch,{onResize:ad,orientation:"horizontal",ariaValueNow:_})]}):(0,e.jsx)("div",{"data-testid":`split-history-expand-bar-${b}`,className:"flex-shrink-0 flex items-start justify-center w-9 bg-gray-50 dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:(0,e.jsxs)("button",{type:"button","data-testid":`split-history-expand-${b}`,"aria-label":K("terminal.showHistory"),title:K("terminal.showHistory"),"aria-expanded":"false",onClick:aa,className:"flex flex-col items-center gap-2 w-full pt-2 text-gray-500 dark:text-gray-400 hover:text-accent-600 dark:hover:text-accent-400 focus:outline-none focus:ring-2 focus:ring-ring",children:[(0,e.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,e.jsx)("span",{className:"text-xs font-medium tracking-wide select-none",style:{writingMode:"vertical-rl"},"aria-hidden":"true",children:K("terminal.historyLabel")})]})}),(0,e.jsx)("div",{className:"flex-grow overflow-hidden min-w-0 min-h-0 relative",children:ar})]}),[$,_,aq,ad,aa,ar,b,K]),au=(0,h.useMemo)(()=>(0,e.jsxs)("div",{className:"space-y-2",children:[an?(0,e.jsx)(al,{worktreeId:a,cliToolId:c,instanceId:w,onKeysSent:Q,showPagerKeys:L.isPagerActive}):null,ap?(0,e.jsx)(fj,{worktreeId:a,cliToolId:c,instanceId:w,onKeysSent:Q}):null,ao?(0,e.jsx)(fp,{promptData:M.data,messageId:M.messageId,visible:M.visible,answering:M.answering,onRespond:ak,onDismiss:am,cliToolName:(0,a7.oo)(c)}):null,(0,e.jsx)(ag,{worktreeId:a,onMessageSent:ai,onOptimisticSend:X,cliToolId:c,instanceId:w,isSessionRunning:L.isRunning,pendingInsertText:n??null,onInsertConsumed:o,splitIndex:b,onFocus:l,isProcessing:L.isRunning,showToast:J,autoYesSlot:(0,e.jsx)(fs,{enabled:x,expiresAt:y??null,onToggle:A,lastAutoResponse:z??null,cliToolName:c,inline:!0})})]}),[an,ao,ap,L.isPagerActive,a,c,w,Q,M.data,M.messageId,M.visible,M.answering,ak,am,ai,X,L.isRunning,n,o,b,l,x,y,z,A,J]),av=(0,a7.sw)(f??{cliTool:c}),aw=(0,h.useCallback)(()=>{v?.({cliToolId:c,instanceId:w,label:av})},[v,c,w,av]),ax=(0,h.useMemo)(()=>{if(!v||!L.isRunning)return null;let a=K("terminal.endSessionFor",{name:av});return(0,e.jsx)("button",{type:"button",onClick:aw,"aria-label":a,title:a,"data-testid":`terminal-end-session-button-${b}`,className:"flex items-center justify-center p-0.5 rounded text-muted-foreground hover:text-danger focus:text-danger hover:bg-danger/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-danger/50 transition-colors",children:(0,e.jsx)(as.A,{size:14,"aria-hidden":"true"})})},[v,L.isRunning,K,av,aw,b]);return(0,e.jsx)(ba,{worktreeId:a,splitIndex:b,cliToolId:c,instanceId:w,instance:f,availableInstances:g,onInstanceChange:j,headerExtras:ax,status:q,onFocus:l,attaching:L.attaching,terminal:at,footer:au,onDropInstance:t,draggedInstanceId:u})});var fw=c(16945);let fx=(0,h.memo)(function({isBranchMismatch:a,currentBranch:b,initialBranch:c}){let d=(0,k.c)("worktree"),[f,g]=(0,h.useState)(!1);return((0,h.useEffect)(()=>{g(!1)},[b]),!a||f||null===c)?null:(0,e.jsxs)("div",{"data-testid":"branch-mismatch-alert",role:"alert",className:"flex items-center gap-3 px-4 py-2 bg-warning-subtle border border-warning-border text-warning-foreground rounded-lg",children:[(0,e.jsx)(fw.A,{className:"w-5 h-5 text-warning flex-shrink-0"}),(0,e.jsx)("div",{className:"flex-1 min-w-0",children:(0,e.jsxs)("span",{className:"text-sm",children:[d("branchMismatch.changedFrom")," ",(0,e.jsx)("span",{className:"font-medium",children:c})," ",d("branchMismatch.to")," ",(0,e.jsx)("span",{className:"font-medium",children:b})]})}),(0,e.jsx)("button",{type:"button",onClick:()=>g(!0),className:"p-1 rounded hover:bg-warning-subtle transition-colors","aria-label":d("branchMismatch.dismiss"),children:(0,e.jsx)(as.A,{className:"w-4 h-4"})})]})}),fy=(0,x.A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),fz=(0,h.memo)(function({isOpen:a,onClose:b,onConfirm:c,worktreeId:d,sourcePath:f,sourceType:g}){let i=(0,k.c)("worktree"),j=(0,k.c)("common"),[l,m]=(0,h.useState)(""),[o,p]=(0,h.useState)(new Set([""])),[q,r]=(0,h.useState)([]),[s,t]=(0,h.useState)(!1),[u,v]=(0,h.useState)(new Set),w=f.includes("/")?f.substring(0,f.lastIndexOf("/")):"";(0,h.useEffect)(()=>{a&&(m(w),p(new Set([""])),r([]),x())},[a,d]);let x=(0,h.useCallback)(async()=>{t(!0);try{let a=await fetch(`/api/worktrees/${d}/tree`);if(!a.ok)return;let b=(await a.json()).items.filter(a=>"directory"===a.type).map(a=>({name:a.name,path:a.name,loaded:!1}));r(b)}catch{}finally{t(!1)}},[d]),y=(0,h.useCallback)(async a=>{v(b=>new Set(b).add(a));try{let b=await fetch(`/api/worktrees/${d}/tree/${a}`);if(!b.ok)return;let c=(await b.json()).items.filter(a=>"directory"===a.type).map(b=>({name:b.name,path:`${a}/${b.name}`,loaded:!1}));r(b=>(function a(b,c,d){return b.map(b=>b.path===c?{...b,children:d,loaded:!0}:b.children?{...b,children:a(b.children,c,d)}:b)})(b,a,c))}catch{}finally{v(b=>{let c=new Set(b);return c.delete(a),c})}},[d]),A=(0,h.useCallback)(async a=>{p(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c});let b=function a(b,c){for(let d of b){if(d.path===c)return d;if(d.children){let b=a(d.children,c);if(b)return b}}return null}(q,a);b&&!b.loaded&&await y(a)},[q,y]),B=(0,h.useCallback)(a=>!(a===w||"directory"===g&&(a===f||a.startsWith(f+"/")))&&!0,[w,f,g]),C=(a,b=0)=>{let c=o.has(a.path),d=l===a.path,f=u.has(a.path),g=B(a.path);return(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:`flex items-center gap-1 py-1.5 px-2 cursor-pointer rounded text-sm transition-colors ${d?"bg-accent-100 text-accent-800":"hover:bg-muted text-foreground"} ${!g?"opacity-40 cursor-not-allowed":""}`,style:{paddingLeft:`${.5+1.25*b}rem`},onClick:()=>{g&&m(a.path)},children:[(0,e.jsx)("button",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",onClick:b=>{b.stopPropagation(),A(a.path)},children:f?(0,e.jsx)(n.y$,{size:"xs",variant:"muted"}):(0,e.jsx)(bL,{className:`w-3 h-3 text-muted-foreground transition-transform ${c?"rotate-90":""}`})}),c?(0,e.jsx)(fy,{className:"w-4 h-4 text-warning flex-shrink-0"}):(0,e.jsx)(z.A,{className:"w-4 h-4 text-warning flex-shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:a.name})]}),c&&a.children&&(0,e.jsx)("div",{children:a.children.map(a=>C(a,b+1))})]},a.path)},D=B(l);return(0,e.jsx)(a5.a,{isOpen:a,onClose:b,title:i("fileTree.moveDialogTitle"),size:"md",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"text-sm text-muted-foreground",children:[i("fileTree.moveTo"),": ",(0,e.jsx)("span",{className:"font-mono text-foreground",children:f})]}),(0,e.jsxs)("div",{className:"border border-border rounded-lg max-h-64 overflow-y-auto p-2",children:[(0,e.jsxs)("div",{className:`flex items-center gap-1 py-1.5 px-2 cursor-pointer rounded text-sm transition-colors ${""===l?"bg-accent-100 text-accent-800":"hover:bg-muted text-foreground"} ${!B("")?"opacity-40 cursor-not-allowed":""}`,onClick:()=>{B("")&&m("")},children:[(0,e.jsx)("span",{className:"w-4 h-4"}),(0,e.jsx)(z.A,{className:"w-4 h-4 text-warning flex-shrink-0"}),(0,e.jsx)("span",{children:i("fileTree.rootDirectory")})]}),s?(0,e.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,e.jsx)(n.y$,{size:"md",variant:"muted"})}):q.map(a=>C(a,1))]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)(n.$n,{variant:"ghost",onClick:b,className:"px-4 py-2 text-sm text-foreground bg-white border border-border rounded-md hover:bg-muted transition-colors",children:j("cancel")}),(0,e.jsx)(n.$n,{variant:"ghost",onClick:()=>c(l),disabled:!D,className:"px-4 py-2 text-sm text-white bg-accent-600 rounded-md hover:bg-accent-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:i("fileTree.moveConfirm")})]})]})})});function fA(a,b){let c=a.trim();return c?0>=c.lastIndexOf(".")?c+b:c:""}let fB=(0,h.memo)(function({isOpen:a,parentPath:b,onConfirm:c,onCancel:d}){let f=(0,k.c)("worktree"),g=(0,k.c)("common"),[i,j]=(0,h.useState)(""),[l,m]=(0,h.useState)(".md"),n=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(a){j(""),m(".md");let a=setTimeout(()=>{n.current?.focus()},100);return()=>clearTimeout(a)}},[a]);let o=(0,h.useCallback)(()=>{let a=fA(i,l);a&&c(a)},[i,l,c]),p=(0,h.useCallback)(a=>{"Enter"===a.key&&(a.preventDefault(),o())},[o]),q=fA(i,l),r=b?`${b}/${q}`:q;return(0,e.jsx)(a5.a,{isOpen:a,onClose:d,title:f("newFileDialog.title"),size:"sm",children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{htmlFor:"new-file-name",className:"block text-sm font-medium text-foreground mb-1",children:f("newFileDialog.fileNameLabel")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("input",{ref:n,id:"new-file-name","data-testid":"new-file-name-input",type:"text",value:i,onChange:a=>j(a.target.value),onKeyDown:p,placeholder:f("newFileDialog.placeholder"),className:"flex-1 px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),(0,e.jsx)("select",{"data-testid":"new-file-ext-select",value:l,onChange:a=>m(a.target.value),className:"px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",children:eN.map(a=>(0,e.jsx)("option",{value:a,children:a},a))})]})]}),q&&(0,e.jsx)("div",{className:"text-xs text-muted-foreground font-mono bg-muted rounded px-2 py-1",children:r}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:d,className:"px-4 py-2 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg transition-colors",children:g("cancel")}),(0,e.jsx)("button",{type:"button","data-testid":"new-file-confirm-button",onClick:o,disabled:!q,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-lg transition-colors",children:f("newFileDialog.create")})]})]})})}),fC=(0,h.memo)(function({worktreeId:a,worktree:b,worktreeName:c,worktreeStatus:d,instances:f,rosterReady:g,activeInstanceId:j,setActiveInstanceId:l,hasUpdate:m,lastAutoResponse:n,activeActivity:o,onActivityToggle:p,onBackClick:q,onInfoClick:r,onWorktreeStatusChange:s,pendingInsertTextMap:t,setFocusedSplitIndex:u,handleInsertToSplit:v,handleInsertConsumed:w,handleInsertToMessage:x,autoYesStateMap:y,makeAutoYesToggleHandler:z,showArchived:A,onShowArchivedChange:B,historyDisplayLimit:C,onHistoryDisplayLimitChange:D,historyUserOnly:E,onHistoryUserOnlyChange:G,onMessageSent:H,onFilePathClick:I,showToast:J,tabsState:K,tabsActions:L,onLoadContent:M,onLoadError:N,onSetLoading:O,onFilePanelSave:P,onDirtyChange:Q,onOpenFile:R,diffContent:S,diffFilePath:T,onCloseDiff:U,fileSearch:V,fileTreeRefresh:W,onFileSelect:X,onNewFile:Y,onNewDirectory:Z,onRename:$,onDelete:_,onUpload:aa,onMove:ab,onFileTreeReset:ac,onDiffSelect:ad,onAgentInstancesChange:ae,vibeLocalModel:af,onVibeLocalModelChange:ag,vibeLocalContextWindow:ah,onVibeLocalContextWindowChange:ai,isInfoModalOpen:aj,onInfoModalClose:ak,onWorktreeUpdate:al,fileInputRef:am,onFileInputChange:an,onKillSession:ao,onRequestSessionEnd:ap,killTarget:aq,isKillPending:ar,onKillCancel:as,onKillConfirm:at,moveTarget:au,isMoveDialogOpen:av,onMoveCancel:aw,onMoveConfirm:ax,showNewFileDialog:ay,newFileParentPath:az,onNewFileConfirm:aA,onNewFileCancel:aB,killDialogTitle:aC,killDialogWarning:aD,cancelLabel:aE,endLabel:aF}){let aG=(0,k.c)("worktree"),[aH,aI]=i().useState(null),aJ=(0,h.useCallback)(a=>aI(a),[]),aK=(0,h.useCallback)(()=>aI(null),[]),[aL,aM]=i().useState(null),aN=i().useRef(0),aO=(0,h.useCallback)(a=>{l(a),aN.current+=1,aM({instanceId:a,token:aN.current})},[l]),aP=(0,h.useCallback)(({splitIndex:c,cliToolId:d,instanceId:f,instance:g,availableInstances:h,onInstanceChange:i,onFocus:j,onDropInstance:k})=>{let m=t.get(c)??null,o=y.get(f),p=o?.enabled??!1,q=o?.expiresAt??null,r=(0,a6.kA)(b?.sessionStatusByInstance?.[f]??b?.sessionStatusByCli?.[d]);return(0,e.jsx)(fv,{worktreeId:a,splitIndex:c,cliToolId:d,instanceId:f,instance:g,availableInstances:h,onInstanceChange:a=>{i(a),0===c&&l(a)},onFocus:j,pendingInsertText:m,onInsertConsumed:()=>w(c),onMessageSent:H,cliStatus:r,autoYes:{enabled:p,expiresAt:q,lastAutoResponse:n,onToggle:z(d,f)},history:{showArchived:A,onShowArchivedChange:B,historyDisplayLimit:C,onHistoryDisplayLimitChange:D,historyUserOnly:E,onHistoryUserOnlyChange:G,onInsertToMessage:a=>v(c,a),onFilePathClick:I,showToast:J},onDropInstance:k,draggedInstanceId:aH,onRequestSessionEnd:ap})},[a,t,y,w,H,l,n,z,b?.sessionStatusByCli,b?.sessionStatusByInstance,I,J,v,A,B,C,D,E,G,aH,ap]),aQ=(0,h.useMemo)(()=>(0,e.jsx)(ff,{worktreeId:a,instances:f,rosterReady:g,renderPane:aP,onFocusedSplitChange:u,showToast:J,onActiveInstanceChange:l,headerInstanceSelection:aL}),[a,f,g,aP,u,J,l,aL]),aR=(0,h.useMemo)(()=>(0,e.jsx)(e8,{terminal:aQ,terminalHeader:null,fileTabs:K,worktreeId:a,onCloseTab:L.closeTab,onActivateTab:L.activateTab,onLoadContent:M,onLoadError:N,onSetLoading:O,onFileSaved:P,diffContent:S,diffFilePath:T,onCloseDiff:U,onDirtyChange:Q,onMoveToFront:L.moveToFront,onOpenFile:R}),[aQ,K,a,L.closeTab,L.activateTab,M,N,O,P,S,T,U,Q,L.moveToFront,R]),aS=(0,h.useMemo)(()=>(0,e.jsx)(eG,{active:o,onToggle:p}),[o,p]),aT=(0,h.useMemo)(()=>({files:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(cS,{query:V.query,mode:V.mode,isSearching:V.isSearching,error:V.error,onQueryChange:V.setQuery,onModeChange:V.setMode,onClear:V.clearSearch}),(0,e.jsx)(cO,{worktreeId:a,onFileSelect:X,onNewFile:Y,onNewDirectory:Z,onRename:$,onDelete:_,onUpload:aa,onMove:ab,onResetView:ac,refreshTrigger:W,pollingEnabled:"files"===o,searchQuery:V.query,searchMode:V.mode,searchResults:V.results?.results,className:"flex-1 min-h-0"})]}),git:(0,e.jsx)(ek,{worktreeId:a,onDiffSelect:ad,isMobile:!1,worktree:b??void 0,onInsertToMessage:x,className:"h-full"}),notes:(0,e.jsx)(cY,{worktreeId:a,className:"h-full",onInsertToMessage:x}),schedules:(0,e.jsx)(du,{worktreeId:a,className:"h-full",onInsertToMessage:x,instances:f}),agent:(0,e.jsx)(dB,{worktreeId:a,instances:f,onInstancesChange:ae,vibeLocalModel:af,onVibeLocalModelChange:ag,vibeLocalContextWindow:ah,onVibeLocalContextWindowChange:ai}),timer:(0,e.jsx)(dM,{worktreeId:a,instances:f}),todo:(0,e.jsx)(c1,{worktreeId:a,className:"h-full"})}),[a,b,o,V.query,V.mode,V.isSearching,V.error,V.setQuery,V.setMode,V.clearSearch,V.results?.results,X,Y,Z,$,_,aa,ab,ac,W,ad,x,f,ae,af,ag,ah,ai]),aU=(0,h.useMemo)(()=>null===o?null:(0,e.jsx)(eJ,{active:o,activities:aT}),[o,aT]);return(0,e.jsx)(F,{componentName:"WorktreeDetailRefactored",children:(0,e.jsxs)("div",{className:"flex h-full overflow-hidden relative",children:[aS,(0,e.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 min-w-0",children:[(0,e.jsx)(er,{worktreeName:c,repositoryName:b?.repositoryDisplayName??b?.repositoryName??aG("detail.unknownRepository"),description:b?.description,status:d,gitStatus:b?.gitStatus,onBackClick:q,onInfoClick:r,hasUpdate:m,worktreeStatus:b?.status??null,onWorktreeStatusChange:s,sessionStatusByCli:b?.sessionStatusByCli,sessionStatusByInstance:b?.sessionStatusByInstance,instances:f,activeInstanceId:j,onActiveInstanceChange:aO,onAgentDragStart:aJ,onAgentDragEnd:aK,onKillSession:ao}),b?.gitStatus&&(0,e.jsx)(fx,{isBranchMismatch:b.gitStatus.isBranchMismatch,currentBranch:b.gitStatus.currentBranch,initialBranch:b.gitStatus.initialBranch}),(0,e.jsx)("div",{className:"flex-1 min-h-0 min-w-0",children:(0,e.jsx)(ev,{activityPane:aU,rightPane:(0,e.jsx)(ck,{terminal:aR})})})]}),(0,e.jsx)(es,{worktreeId:a,worktree:b,isOpen:aj,onClose:ak,onWorktreeUpdate:al}),(0,e.jsx)("input",{ref:am,type:"file",accept:eM.join(","),onChange:an,className:"hidden","aria-label":aG("detail.uploadFile")}),(0,e.jsx)(a5.a,{isOpen:null!==aq,onClose:as,title:aC,size:"sm",showCloseButton:!0,children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("p",{className:"text-sm text-foreground",children:aD}),(0,e.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,e.jsx)("button",{type:"button",onClick:as,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:aE}),(0,e.jsx)("button",{type:"button",onClick:at,disabled:ar,"data-testid":"kill-session-confirm-button",className:"px-4 py-2 text-sm font-medium rounded-md bg-danger hover:bg-danger/90 text-white disabled:opacity-60 disabled:cursor-not-allowed",children:aF})]})]})}),au&&(0,e.jsx)(fz,{isOpen:av,onClose:aw,onConfirm:ax,worktreeId:a,sourcePath:au.path,sourceType:au.type}),(0,e.jsx)(fB,{isOpen:ay,parentPath:az,onConfirm:aA,onCancel:aB})]})})});a7.oo;let fD={data:null,messageId:null,visible:!1,answering:!1},fE={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},fF={type:null,message:null,retryable:!1,retryCount:0};function fG(){return{phase:"idle",prompt:{...fD},layout:{...fE},error:{...fF},messages:[],wsConnected:!1}}function fH(a,b){switch(b.type){case"SET_PHASE":return{...a,phase:b.phase};case"SHOW_PROMPT":return{...a,phase:"prompt",prompt:{data:b.data,messageId:b.messageId,visible:!0,answering:!1}};case"CLEAR_PROMPT":return{...a,prompt:{...fD}};case"SET_PROMPT_ANSWERING":return{...a,prompt:{...a.prompt,answering:b.answering}};case"SET_LAYOUT_MODE":return{...a,layout:{...a.layout,mode:b.mode}};case"SET_MOBILE_ACTIVE_PANE":return{...a,layout:{...a.layout,mobileActivePane:b.pane}};case"SET_SPLIT_RATIO":return{...a,layout:{...a.layout,splitRatio:b.ratio}};case"SET_LEFT_PANE_TAB":return{...a,layout:{...a.layout,leftPaneTab:b.tab}};case"TOGGLE_LEFT_PANE":return{...a,layout:{...a.layout,leftPaneCollapsed:!a.layout.leftPaneCollapsed}};case"SET_LEFT_PANE_COLLAPSED":return{...a,layout:{...a.layout,leftPaneCollapsed:b.collapsed}};case"SET_ACTIVE_ACTIVITY":return{...a,layout:{...a.layout,activityBar:{...a.layout.activityBar,active:b.activity}}};case"TOGGLE_ACTIVITY":{let c=a.layout.activityBar.active===b.activity?null:b.activity;return{...a,layout:{...a.layout,activityBar:{...a.layout.activityBar,active:c}}}}case"TOGGLE_HISTORY_PANE":{let b=!a.layout.historyPane.visible;return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,visible:b,collapsed:!b}}}}case"SET_HISTORY_PANE_VISIBLE":return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,visible:b.visible,collapsed:!b.visible}}};case"SET_HISTORY_WIDTH":return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,width:b.width}}};case"SET_ERROR":return{...a,error:b.error};case"CLEAR_ERROR":return{...a,error:{...fF}};case"INCREMENT_RETRY_COUNT":return{...a,error:{...a.error,retryCount:a.error.retryCount+1}};case"SET_MESSAGES":return{...a,messages:b.messages};case"ADD_MESSAGE":return{...a,messages:[...a.messages,b.message]};case"UPDATE_MESSAGE":return{...a,messages:a.messages.map(a=>a.id===b.id?{...a,...b.updates}:a)};case"CLEAR_MESSAGES":return{...a,messages:[]};case"SET_WS_CONNECTED":return{...a,wsConnected:b.connected};default:return a}}var fI=c(63157);function fJ(a){let b=a.split("/");return b[b.length-1]||a}function fK(a,b,c){let d=a.findIndex(a=>a.path===b);if(-1===d)return null;let e=[...a];return e[d]=c(e[d]),e}let fL={tabs:[],activeIndex:null};var fM=c(4267);let fN="activeCliTab-",fO="activeInstanceId-";function fP(){let a=(0,k.c)("worktree");return(0,e.jsxs)("div",{className:"flex items-center justify-center h-full bg-surface text-muted-foreground",children:[(0,e.jsx)(m.y,{size:"lg",className:"mr-2"}),(0,e.jsx)("span",{children:a("detail.loadingEditor")})]})}let fQ=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/WorktreeDetailRefactored.tsx -> @/components/worktree/MarkdownEditor"]},ssr:!1,loading:()=>(0,e.jsx)(fP,{})}),fR=()=>{},fS=["terminal","history","files","memo","info"],fT=(0,h.memo)(function({worktreeId:a}){let{activeActivity:b,activeCliTab:c,activeInstanceId:d,activeTab:g,agentInstances:i,autoYesEnabled:j,autoYesExpiresAt:m,autoYesStateMap:n,diffContent:p,diffFilePath:r,disableAutoFollow:s,displayedInstances:t,editorFilePath:u,error:w,fetchCurrentOutput:x,fileInputRef:y,fileSearch:z,fileTreeRefresh:A,handleActivityToggle:B,handleAgentInstancesChange:C,handleAutoYesToggle:D,handleBackClick:G,handleCloseDiff:H,handleDelete:I,handleDiffSelect:J,handleDirtyChange:L,handleEditorClose:N,handleEditorSave:O,handleFileInputChange:P,handleFilePanelSave:Q,handleFilePathClick:R,handleFileSelect:U,handleHistoryDisplayLimitChange:V,handleHistoryUserOnlyChange:W,handleInfoClick:X,handleInfoModalClose:Y,handleInsertConsumed:Z,handleInsertConsumedSingle:$,handleInsertToMessage:_,handleInsertToSplit:aa,handleKillCancel:ac,handleKillConfirm:ad,openKillConfirm:ae,openActiveKillConfirm:af,killTarget:ah,isKillPending:ai,handleLoadContent:aj,handleLoadError:ak,handleMessageSent:an,handleMobileFileViewerClose:ao,handleMobileTabChange:ap,handleMove:aq,handleMoveCancel:ar,handleMoveConfirm:as,handleNewDirectory:at,handleNewFile:au,handleNewFileCancel:av,handleNewFileConfirm:aw,handleOpenFile:ax,handlePromptDismiss:ay,handlePromptRespond:az,handleRename:aA,handleRetry:aC,handleSetLoading:aD,handleShowArchivedChange:aE,handleUpload:aF,handleVibeLocalContextWindowChange:aG,handleVibeLocalModelChange:aH,handleWorktreeStatusChange:aI,hasUpdate:aJ,historyDisplayLimit:aK,historySubTab:aL,historyUserOnly:aM,isEditorMaximized:aN,isInfoModalOpen:aO,isMobile:aQ,isMoveDialogOpen:aR,isSelectionListActive:aS,isPagerActive:aT,lastAutoResponse:aV,loading:aX,makeAutoYesToggleHandler:aY,mobileFileViewerPath:aZ,mobileSelectedAgents:a$,moveTarget:a_,newFileParentPath:a0,openMobileDrawer:a1,pendingInsertText:a2,pendingInsertTextMap:a3,rosterReady:a4,setActiveInstanceId:a8,setEditorFilePath:a9,setFocusedSplitIndex:ba,setHistorySubTab:bb,setIsEditorMaximized:bc,setWorktree:bd,showArchived:be,showNewFileDialog:bf,showToast:bg,state:bh,tCommon:bi,tWorktree:bj,tabsActions:bk,tabsState:bl,resetFileTreeView:bm,toggleInstanceVisible:bn,vibeLocalContextWindow:bo,vibeLocalModel:bq,visibleInstanceIds:br,worktree:bs,worktreeName:bt,worktreeStatus:bu}=function({worktreeId:a}){let b=(0,f.useRouter)(),c=(0,ab.a)(),d=(0,h.useRef)(c);d.current=c;let{openMobileDrawer:e}=(0,eF.VF)(),{state:g,actions:i}=function(){let[a,b]=(0,h.useReducer)(fH,void 0,fG),{value:c,setValue:d}=(0,dP.V)({key:"commandmate.worktree.leftPaneCollapsed",defaultValue:!1,validate:a=>"boolean"==typeof a}),e=(0,h.useRef)(a.layout.leftPaneCollapsed);e.current=a.layout.leftPaneCollapsed,(0,h.useRef)(!1);let f=(0,h.useMemo)(()=>({setPhase:a=>b({type:"SET_PHASE",phase:a}),showPrompt:(a,c)=>b({type:"SHOW_PROMPT",data:a,messageId:c}),clearPrompt:()=>b({type:"CLEAR_PROMPT"}),setPromptAnswering:a=>b({type:"SET_PROMPT_ANSWERING",answering:a}),setError:a=>b({type:"SET_ERROR",error:a}),clearError:()=>b({type:"CLEAR_ERROR"}),setMessages:a=>b({type:"SET_MESSAGES",messages:a}),addMessage:a=>b({type:"ADD_MESSAGE",message:a}),updateMessage:(a,c)=>b({type:"UPDATE_MESSAGE",id:a,updates:c}),clearMessages:()=>b({type:"CLEAR_MESSAGES"}),setMobileActivePane:a=>b({type:"SET_MOBILE_ACTIVE_PANE",pane:a}),setLeftPaneTab:a=>b({type:"SET_LEFT_PANE_TAB",tab:a}),setLayoutMode:a=>b({type:"SET_LAYOUT_MODE",mode:a}),setSplitRatio:a=>b({type:"SET_SPLIT_RATIO",ratio:a}),setWsConnected:a=>b({type:"SET_WS_CONNECTED",connected:a}),toggleLeftPane:()=>{let a=!e.current;b({type:"SET_LEFT_PANE_COLLAPSED",collapsed:a}),d(a)},setActiveActivity:a=>b({type:"SET_ACTIVE_ACTIVITY",activity:a}),toggleActivity:a=>b({type:"TOGGLE_ACTIVITY",activity:a}),toggleHistoryPane:()=>b({type:"TOGGLE_HISTORY_PANE"}),setHistoryPaneVisible:a=>b({type:"SET_HISTORY_PANE_VISIBLE",visible:a}),setHistoryWidth:a=>b({type:"SET_HISTORY_WIDTH",width:a})}),[d]);return{state:a,dispatch:b,actions:f}}(),j=(0,k.c)("worktree"),l=(0,k.c)("error"),m=(0,k.c)("common");(0,k.c)("autoYes");let n=(0,am.SC)(),o=(0,fI.rC)(),p=o?.worktrees.find(b=>b.id===a)??null,[r,s]=(0,h.useState)(p),[t,u]=(0,h.useState)(null===p),[v,w]=(0,h.useState)(null);(0,h.useRef)(null!==p);let[x,y]=(0,h.useState)(!1),[z,A]=function(a){let[b,c]=(0,h.useReducer)(function a(b,c){switch(c.type){case"OPEN_FILE":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1!==a){if(b.activeIndex===a)return b;return{...b,activeIndex:a}}if(b.tabs.length>=30)return b;let d={path:c.path,name:fJ(c.path),content:null,loading:!1,error:null,isDirty:!1},e=[...b.tabs,d];return{tabs:e,activeIndex:e.length-1}}case"CLOSE_TAB":{var d,e;let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a)return b;let f=b.tabs.filter((b,c)=>c!==a),g=(d=b.activeIndex,0===(e=f.length)||null===d?null:a<d?d-1:a===d?Math.min(a,e-1):d);return{tabs:f,activeIndex:g}}case"ACTIVATE_TAB":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a||b.activeIndex===a)return b;return{...b,activeIndex:a}}case"SET_CONTENT":{let a=fK(b.tabs,c.path,a=>({...a,content:c.content,loading:!1,error:null,isDirty:!1}));if(!a)return b;return{...b,tabs:a}}case"SET_LOADING":{let a=fK(b.tabs,c.path,a=>({...a,loading:c.loading}));if(!a)return b;return{...b,tabs:a}}case"SET_ERROR":{let a=fK(b.tabs,c.path,a=>({...a,error:c.error,loading:!1}));if(!a)return b;return{...b,tabs:a}}case"RENAME_FILE":{let a=b.tabs.findIndex(a=>a.path===c.oldPath);if(-1===a)return b;let d=[...b.tabs];return d[a]={...d[a],path:c.newPath,name:fJ(c.newPath)},{...b,tabs:d}}case"DELETE_FILE":return a(b,{type:"CLOSE_TAB",path:c.path});case"RESTORE":{let a=c.paths.slice(0,30).map(a=>({path:a,name:fJ(a),content:null,loading:!1,error:null,isDirty:!1}));if(0===a.length)return fL;let b=c.activePath?Math.max(0,a.findIndex(a=>a.path===c.activePath)):0;return{tabs:a,activeIndex:b}}case"SET_DIRTY":{let a=b.tabs.find(a=>a.path===c.path);if(a&&a.isDirty===c.isDirty)return b;let d=fK(b.tabs,c.path,a=>({...a,isDirty:c.isDirty}));if(!d)return b;return{...b,tabs:d}}case"MOVE_TO_FRONT":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a||0===a)return b;return{tabs:[b.tabs[a],...b.tabs.filter((b,c)=>c!==a)],activeIndex:0}}case"CLOSE_ALL":if(0===b.tabs.length)return b;return fL;default:return b}},fL);(0,h.useRef)(!1),(0,h.useRef)(a);let d=(0,h.useRef)(b);d.current=b;let e=(0,h.useCallback)(a=>{let b=d.current.tabs;return -1!==b.findIndex(b=>b.path===a)?(c({type:"OPEN_FILE",path:a}),"activated"):b.length>=30?"limit_reached":(c({type:"OPEN_FILE",path:a}),"opened")},[]),f=(0,h.useCallback)(a=>{c({type:"CLOSE_TAB",path:a})},[]),g=(0,h.useCallback)(a=>{c({type:"ACTIVATE_TAB",path:a})},[]),i=(0,h.useCallback)((a,b)=>{c({type:"RENAME_FILE",oldPath:a,newPath:b})},[]),j=(0,h.useCallback)(a=>{c({type:"DELETE_FILE",path:a})},[]),k=(0,h.useCallback)(a=>{c({type:"MOVE_TO_FRONT",path:a})},[]),l=(0,h.useCallback)(()=>{c({type:"CLOSE_ALL"})},[]),m=(0,h.useMemo)(()=>({dispatch:c,openFile:e,closeTab:f,activateTab:g,onFileRenamed:i,onFileDeleted:j,moveToFront:k,closeAllTabs:l}),[c,e,f,g,i,j,k,l]);return[b,m]}(a),[B,C]=(0,h.useState)(null),[D,E]=(0,h.useState)(null),[F,G]=(0,h.useState)(!1),[H,I]=(0,h.useState)(new Map),[J,K]=(0,h.useState)(null),[L,M]=(0,h.useState)(!1),[N,O]=(0,h.useState)(!1),[P,Q]=(0,h.useState)(!1),R=(0,h.useRef)(!1),[S,U]=(0,h.useState)(null),[V,W]=(0,h.useState)(fM.fJ),X=(0,h.useRef)(V);X.current=V;let[Y,Z]=(0,h.useState)(()=>(0,a7.lu)(fM.fJ)),$=(0,h.useRef)(Y);$.current=Y;let[_,aa]=(0,h.useState)(null),ac=_===a,[ad,ae]=(0,h.useState)(null),[af,ag]=(0,h.useState)(null),[ah,ai]=(0,h.useState)(()=>{try{let b=window.localStorage.getItem(fN+a);if(b&&(0,a7.hR)(b))return b}catch{}return fM.fJ[0]}),aj=(0,h.useCallback)(b=>{ai(b);try{window.localStorage.setItem(fN+a,b)}catch{}},[a]),ak=(0,h.useRef)(ah);ak.current=ah;let[al,an]=(0,h.useState)(()=>{try{let b=window.localStorage.getItem(fO+a);if(b&&(0,a7.n6)(b))return b;let c=window.localStorage.getItem(fN+a);if(c&&(0,a7.hR)(c))return c}catch{}return fM.fJ[0]}),ao=(0,h.useCallback)(b=>{an(b);try{window.localStorage.setItem(fO+a,b)}catch{}let c=$.current.find(a=>a.id===b);c&&aj(c.cliTool)},[a,aj]),ap=(0,h.useRef)(al);ap.current=al;let aq=(0,h.useRef)(0),ar=(0,h.useRef)(0),as=(0,h.useRef)(0),at=H.get(al)?.enabled??!1,au=H.get(al)?.expiresAt??null,[av,aw]=(0,h.useState)(0),[ax,ay]=(0,h.useState)(!1),[az,aA]=(0,h.useState)(""),{active:aC,toggle:aD}=function(a){let[b,c]=(0,h.useState)("files"),d=(0,h.useRef)(b);d.current=b;let e=(0,h.useRef)(a);return e.current=a,{active:b,setActive:(0,h.useCallback)(a=>{c(a),e.current},[]),toggle:(0,h.useCallback)(a=>{if(d.current===a){c(null),e.current;return}c(a),e.current},[])}}(a),{historySubTab:aE,setHistorySubTab:aF,showArchived:aG,handleShowArchivedChange:aH,historyUserOnly:aI,handleHistoryUserOnlyChange:aJ,historyDisplayLimit:aK,handleHistoryDisplayLimitChange:aL}=function(){let[a,b]=(0,h.useState)("message"),[c,d]=(0,h.useState)(()=>!1),e=(0,h.useCallback)(a=>{d(a),localStorage.setItem("commandmate:showArchived",String(a))},[]),[f,g]=(0,h.useState)(()=>!1),i=(0,h.useCallback)(a=>{g(a);try{localStorage.setItem("commandmate:historyUserOnly",String(a))}catch{}},[]),[j,k]=(0,h.useState)(()=>50);return{historySubTab:a,setHistorySubTab:b,showArchived:c,handleShowArchivedChange:e,historyUserOnly:f,handleHistoryUserOnlyChange:i,historyDisplayLimit:j,handleHistoryDisplayLimitChange:(0,h.useCallback)(a=>{k(a);try{localStorage.setItem("commandmate:historyDisplayLimit",String(a))}catch{}},[])}}(),aM=(0,h.useRef)(aG),aN=(0,h.useRef)(aK),{pendingInsertTextMap:aO,pendingInsertText:aP,setFocusedSplitIndex:aQ,handleInsertToMessage:aR,handleInsertToSplit:aS,handleInsertConsumed:aT,handleInsertConsumedSingle:aV}=function(){let[a,b]=(0,h.useState)(()=>new Map),[c,d]=(0,h.useState)(0),e=(0,h.useCallback)(a=>{b(b=>{let d=new Map(b);return d.set(c,a),d})},[c]),f=(0,h.useCallback)((a,c)=>{b(b=>{let d=new Map(b);return d.set(a,c),d})},[]),g=(0,h.useCallback)(a=>{b(b=>{if(!b.has(a))return b;let c=new Map(b);return c.delete(a),c})},[]),i=a.get(0)??null,j=(0,h.useCallback)(()=>g(0),[g]);return{pendingInsertTextMap:a,pendingInsertText:i,focusedSplitIndex:c,setFocusedSplitIndex:d,handleInsertToMessage:e,handleInsertToSplit:f,handleInsertConsumed:g,handleInsertConsumedSingle:j}}(),{diffContent:aX,diffFilePath:aY,handleDiffSelect:aZ,handleCloseDiff:a$}=function(a){let[b,c]=(0,h.useState)(null),[d,e]=(0,h.useState)(null);return{diffContent:b,diffFilePath:d,handleDiffSelect:(0,h.useCallback)((b,d)=>{a||(c(b),e(d))},[a]),handleCloseDiff:(0,h.useCallback)(()=>{c(null),e(null)},[])}}(c),a_=function(a){let{worktreeId:b,initialMode:c="name",debounceMs:d=300}=a,[e,f]=(0,h.useState)(""),[g,i]=(0,h.useState)(""),[j,k]=(0,h.useState)(c),[l,m]=(0,h.useState)(!1),[n,o]=(0,h.useState)(null),[p,r]=(0,h.useState)(null),s=(0,h.useRef)(null),t=(0,h.useMemo)(()=>{var a;let b;return a=a=>{i(a)},b=null,(...c)=>{b&&clearTimeout(b),b=setTimeout(()=>{a(...c),b=null},d)}},[d]),u=(0,h.useCallback)(a=>{f(a),t(a),r(null)},[t]),v=(0,h.useCallback)(()=>{f(""),i(""),o(null),r(null),m(!1),s.current&&(s.current.abort(),s.current=null)},[]),w=(0,h.useCallback)(a=>{if(!g.trim())return a;let b=g.toLowerCase();return a.filter(a=>a.name.toLowerCase().includes(b))},[g]),x=(0,h.useCallback)(()=>n&&0!==n.results.length?q(n.results.map(a=>a.filePath)):new Set,[n]);return{query:e,mode:j,isSearching:l,results:n,error:p,setQuery:u,setMode:k,clearSearch:v,filterByName:w,getMatchedPaths:x}}({worktreeId:a});(0,h.useRef)(!1),(0,h.useRef)(a);let a0=(0,h.useCallback)(async()=>{try{let b=await fetch(`/api/worktrees/${a}`);if(!b.ok)throw Error(`Failed to fetch worktree: ${b.status}`);let c=await b.json();if(s(c),c.selectedAgents){let a=X.current;c.selectedAgents.length===a.length&&c.selectedAgents.every((b,c)=>b===a[c])||W(c.selectedAgents)}if(c.agentInstances){let b=$.current,d=c.agentInstances;d.length===b.length&&d.every((a,c)=>a.id===b[c].id&&a.cliTool===b[c].cliTool&&a.alias===b[c].alias)||Z(d),aa(a)}return"vibeLocalModel"in c&&ae(c.vibeLocalModel??null),"vibeLocalContextWindow"in c&&ag(c.vibeLocalContextWindow??null),c}catch(a){return w(a instanceof Error?a.message:"Unknown error"),null}},[a]),a1=(0,h.useCallback)(async()=>{let b=ak.current,c=d.current,e=ap.current,f=++aq.current;try{let d=new URLSearchParams({cliTool:b});c&&d.set("instance",e),aM.current&&d.set("includeArchived","true"),d.set("limit",String(aN.current));let g=await fetch(`/api/worktrees/${a}/messages?${d.toString()}`);if(!g.ok)throw Error(`Failed to fetch messages: ${g.status}`);let h=await g.json();if(aq.current!==f||ak.current!==b||c&&ap.current!==e)return;i.setMessages(h.map(a=>({...a,timestamp:new Date(a.timestamp)})))}catch(a){if(aq.current!==f||ak.current!==b||c&&ap.current!==e)return;console.error("[WorktreeDetailRefactored] Error fetching messages:",a)}},[a,i]),a2=(0,h.useCallback)(async()=>{let b=ak.current,c=d.current,e=ap.current,f=++ar.current;try{let d=c?`/api/worktrees/${a}/current-output?cliTool=${b}&instance=${encodeURIComponent(e)}`:`/api/worktrees/${a}/current-output?cliTool=${b}`,h=await fetch(d);if(!h.ok)return;let j=await h.json();if(ar.current!==f||ak.current!==b||c&&ap.current!==e||j.cliToolId&&j.cliToolId!==b)return;if(j.isPromptWaiting&&j.promptData?i.showPrompt(j.promptData,`prompt-${Date.now()}`):!j.isPromptWaiting&&g.prompt.visible&&i.clearPrompt(),O(j.isSelectionListActive??!1),Q(j.isPagerActive??!1),K(j.lastServerResponseTimestamp??null),M(j.serverPollerActive??!1),j.autoYes){let a=R.current,d=j.autoYes,f=c?e:b;I(a=>{let b=new Map(a);return b.set(f,{enabled:d.enabled,expiresAt:d.expiresAt}),b}),R.current=d.enabled,a&&!j.autoYes.enabled&&("stop_pattern_matched"===j.autoYes.stopReason||"consecutive_errors"===j.autoYes.stopReason)&&U(j.autoYes.stopReason)}}catch(a){if(ar.current!==f||ak.current!==b||c&&ap.current!==e)return;console.error("[WorktreeDetailRefactored] Error fetching current output:",a)}},[a,i,g.prompt.visible]);(0,h.useCallback)(async()=>{let b=++as.current;try{let c=await fetch(`/api/worktrees/${a}/auto-yes`);if(!c.ok)return;let d=await c.json();if(as.current!==b)return;let e=d?.instances;if(!e||"object"!=typeof e)return;let f=new Map;for(let[a,b]of Object.entries(e))b&&"object"==typeof b&&f.set(a,{enabled:b.enabled??!1,expiresAt:b.expiresAt??null});I(f)}catch(a){if(as.current!==b)return;console.error("[WorktreeDetailRefactored] Error fetching auto-yes states:",a)}},[a]);let{visibleInstances:a3,visibleInstanceIds:a4,toggleInstanceVisible:a5}=function({worktreeId:a,roster:b}){let[c,d]=(0,h.useState)(null),e=(0,h.useMemo)(()=>dx(c,b),[c,b]),f=(0,h.useMemo)(()=>e.map(a=>a.id),[e]),g=(0,h.useMemo)(()=>null!==c&&b.some(a=>c.includes(a.id)),[c,b]),i=(0,h.useCallback)(a=>{let c=new Set(a),e=b.filter(a=>c.has(a.id)).map(a=>a.id);!(e.length<1)&&d(e)},[b,a]),j=(0,h.useCallback)(a=>i(a),[i]);return{visibleInstances:e,visibleInstanceIds:f,hasStoredPreference:g,toggleInstanceVisible:(0,h.useCallback)(a=>{let d=dx(c,b).map(a=>a.id);if(d.includes(a)){if(d.length<=1)return;i(d.filter(b=>b!==a))}else i([...d,a])},[c,b,i]),setVisibleInstanceIds:j,showInstances:(0,h.useCallback)(a=>{null!==c&&i([...dx(c,b).map(a=>a.id),...a])},[c,b,i])}}({worktreeId:a,roster:Y}),a6=c?a3:Y,a8=(0,h.useMemo)(()=>Array.from(new Set(a3.map(a=>a.cliTool))),[a3]),a9=c?a8:V,ba="opencode"===ah||"copilot"===ah,bb=(0,h.useCallback)(a=>{W(a)},[]),bc=(0,h.useCallback)(b=>{Z(b),aa(a)},[a]),bd=(0,h.useCallback)(a=>{ae(a)},[]),be=(0,h.useCallback)(a=>{ag(a)},[]);(0,h.useRef)(ah);let{showToast:bf}=(0,aU.dj)(),bg=(0,h.useCallback)(()=>{bf("Maximum 30 file tabs. Close a tab first.","info")},[bf]),bh=(0,h.useCallback)(a=>{c?C(a):"limit_reached"===A.openFile(a)&&bg()},[c,A,bg]),bi=(0,h.useCallback)(a=>{c?C(a):"limit_reached"===A.openFile(a)&&bg()},[c,A,bg]),bj=(0,h.useCallback)(a=>{"limit_reached"===A.openFile(a)&&bg()},[A,bg]),bk=(0,h.useCallback)(()=>{C(null)},[]),bl=(0,h.useCallback)(a=>{aw(a=>a+1)},[]),bm=(0,h.useCallback)(()=>{E(null)},[]),bn=(0,h.useCallback)(()=>{a_.clearSearch(),A.closeAllTabs(),C(null),E(null)},[a_,A]),bo=(0,h.useCallback)(a=>{aw(a=>a+1)},[]),bp=(0,h.useCallback)(a=>{aD(a)},[aD]),bq=(0,h.useCallback)(()=>{b.push("/")},[b]),br=(0,h.useCallback)(async b=>{try{let c=await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:b})});if(c.ok){let a=await c.json();s(a)}}catch{}},[a]),bs=(0,h.useCallback)(()=>{y(!0)},[]),bt=(0,h.useCallback)(()=>{y(!1)},[]),bu=(0,h.useCallback)(async b=>{i.setPromptAnswering(!0);try{let c=fu(b,ah,g.prompt.data,d.current?ap.current:void 0),e=await fetch(`/api/worktrees/${a}/prompt-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!e.ok)throw Error(`Failed to send prompt response: ${e.status}`);i.clearPrompt(),await a2()}catch(a){console.error("[WorktreeDetailRefactored] Error sending prompt response:",a)}finally{i.setPromptAnswering(!1)}},[a,i,a2,ah,g.prompt.data]),bv=(0,h.useCallback)(()=>{i.clearPrompt()},[i]),bw=(0,h.useCallback)(a=>{i.setMobileActivePane(a)},[i]),bx=(0,h.useCallback)(()=>{a1(),a2()},[a1,a2]),by=(0,h.useCallback)((b,c)=>async d=>{let e=c??b;try{let c=await fetch(`/api/worktrees/${a}/auto-yes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:d.enabled,cliToolId:b,instanceId:e,duration:d.duration,stopPattern:d.stopPattern})});if(c.ok){let a=await c.json();I(b=>{let c=new Map(b);return c.set(e,{enabled:a.enabled,expiresAt:a.expiresAt}),c}),e===ap.current&&(R.current=a.enabled)}}catch(a){console.error("[WorktreeDetailRefactored] Error toggling auto-yes:",a)}},[a]),bz=(0,h.useCallback)(a=>by(ah,al)(a),[by,ah,al]),[bA,bB]=(0,h.useState)(null),[bC,bD]=(0,h.useState)(!1),bE=(0,h.useRef)(!1),bF=(0,h.useCallback)(a=>{bB(a)},[]),bG=(0,h.useCallback)(()=>{let a=ap.current,b=ak.current,c=(0,a7.O6)($.current,a,b);bB({cliToolId:b,instanceId:a,label:c})},[]),bH=(0,h.useCallback)(async()=>{if(!bA||bE.current)return;bE.current=!0,bD(!0);let b=()=>{bA.instanceId===ap.current&&(i.clearMessages(),i.clearPrompt())};try{await T.y.killSession(a,bA.cliToolId,bA.instanceId),b(),await a0(),bB(null)}catch(a){a instanceof T.hD&&404===a.status?(b(),await a0(),bB(null)):bf(j("session.failedToKill"),"error")}finally{bE.current=!1,bD(!1)}},[bA,a,i,a0,bf,j]),bI=(0,h.useCallback)(()=>{bE.current||bB(null)},[]),bJ=(0,h.useCallback)(a=>{aA(a),ay(!0)},[]),bK=(0,h.useCallback)(async b=>{ay(!1);let c=az?`${az}/${b}`:b;try{if(!(await fetch(`/api/worktrees/${a}/files/${aB(c)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"file",content:""})})).ok)throw Error("Failed to create file");aw(a=>a+1)}catch{window.alert(l("fileOps.failedToCreateFile"))}},[a,az,l]),bL=(0,h.useCallback)(()=>{ay(!1)},[]),bM=(0,h.useCallback)(async b=>{let c=window.prompt("Enter directory name:");if(!c)return;let d=b?`${b}/${c}`:c;try{if(!(await fetch(`/api/worktrees/${a}/files/${aB(d)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"directory"})})).ok)throw Error("Failed to create directory");aw(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to create directory:",a),window.alert(l("fileOps.failedToCreateDirectory"))}},[a,l]),bN=(0,h.useCallback)(async b=>{let c=b.split("/").pop()||"",d=window.prompt("Enter new name:",c);if(d&&d!==c)try{if(!(await fetch(`/api/worktrees/${a}/files/${aB(b)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",newName:d})})).ok)throw Error("Failed to rename");let c=b.includes("/")?b.substring(0,b.lastIndexOf("/")+1):"";A.onFileRenamed(b,`${c}${d}`),aw(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to rename:",a),window.alert(l("fileOps.failedToRename"))}},[a,A,l]),bO=(0,h.useCallback)(async b=>{let c=b.split("/").pop()||b;if(await n({description:m("confirmDelete",{name:c}),variant:"danger"}))try{if(!(await fetch(`/api/worktrees/${a}/files/${aB(b)}?recursive=true`,{method:"DELETE"})).ok)throw Error("Failed to delete");(D===b||D?.startsWith(`${b}/`))&&E(null),A.onFileDeleted(b),aw(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to delete:",a),window.alert(l("fileOps.failedToDelete"))}},[a,D,A,m,l,n]),{moveTarget:bP,isMoveDialogOpen:bQ,handleMove:bR,handleMoveConfirm:bS,handleMoveCancel:bT}=function(a,b,c,d){let[e,f]=(0,h.useState)(null),[g,i]=(0,h.useState)(!1),j=(0,h.useCallback)((a,b)=>{f({path:a,type:b}),i(!0)},[]),k=(0,h.useCallback)(async g=>{if(e)try{let f=await fetch(`/api/worktrees/${a}/files/${e.path}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"move",destination:g})}),h=await f.json();if(!f.ok||!h.success){let a=h.error?.message||"Failed to move";d?.(a);return}c?.("Moved successfully"),b()}catch{d?.("Failed to move")}finally{f(null),i(!1)}},[e,a,b,c,d]);return{moveTarget:e,isMoveDialogOpen:g,handleMove:j,handleMoveConfirm:k,handleMoveCancel:(0,h.useCallback)(()=>{f(null),i(!1)},[])}}(a,()=>aw(a=>a+1),a=>bf(a,"success"),a=>bf(a,"error")),bU=(0,h.useRef)(null),bV=(0,h.useRef)(""),bW=(0,h.useCallback)(a=>{bV.current=a,bU.current?.click()},[]),bX=(0,h.useCallback)(async b=>{let c=b.target.files?.[0];if(!c)return;b.target.value="";let d=bV.current,e=`.${c.name.split(".").pop()?.toLowerCase()}`;if(!function(a){if(!a)return!1;let b=a.toLowerCase();return eM.includes(b)}(e))return void bf(`Unsupported file type: ${e}. Allowed: ${eM.join(", ")}`,"error");let f=function(a){let b=function(a){let b=a.toLowerCase();return eL.find(a=>a.extension===b)}(a);return b?.maxFileSize??0x1400000}(e);if(c.size>f)return void bf(`File too large. Maximum size: ${(f/1024/1024).toFixed(1)}MB`,"error");let g=new FormData;g.append("file",c);try{let b=await fetch(`/api/worktrees/${a}/upload/${aB(d||".")}`,{method:"POST",body:g});if(!b.ok){let a=await b.json().catch(()=>({})),c=a?.error?.message||"Failed to upload file";bf(c,"error");return}let c=await b.json();bf(`Uploaded: ${c.filename}`,"success"),aw(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to upload:",a),bf("Upload failed. Please try again.","error")}},[a,bf]),{data:bY}=aW(),bZ=bY?.hasUpdate??!1,{lastAutoResponse:b$}=function({worktreeId:a,cliTool:b,isPromptWaiting:c,promptData:d,autoYesEnabled:e,lastServerResponseTimestamp:f,serverPollerActive:g}){(0,h.useRef)(null);let[i,j]=(0,h.useState)(null);return{lastAutoResponse:i}}({worktreeId:a,cliTool:ah,isPromptWaiting:g.prompt.visible,promptData:g.prompt.data,autoYesEnabled:at,lastServerResponseTimestamp:J,serverPollerActive:L}),b_=(0,h.useCallback)(async()=>{w(null),u(!0),await a0()&&await Promise.all([a1(),a2()]),u(!1)},[a0,a1,a2]);!function({error:a,handleRetry:b,fetchWorktree:c,fetchMessages:d,fetchCurrentOutput:e,setError:f}){let g=(0,h.useRef)(0);(0,h.useCallback)(async()=>{if("visible"!==document.visibilityState)return;let h=Date.now();if(!(h-g.current<5e3)){if(g.current=h,a)return void b();try{await Promise.all([c(),d(),e()])}finally{f(null)}}},[a,b,c,d,e,f])}({error:v,handleRetry:b_,fetchWorktree:a0,fetchMessages:a1,fetchCurrentOutput:a2,setError:w}),r?.sessionStatusByCli?.[ah]?.isRunning;let b0=(0,h.useMemo)(()=>(function(a,b,c="claude"){if(b)return"error";if(!a)return"idle";let d=a.sessionStatusByCli?.[c];if(d){if(d.isWaitingForResponse)return"waiting";if(d.isProcessing)return"running";if(d.isRunning)return"ready"}if("claude"===c){if(a.isWaitingForResponse)return"waiting";if(a.isProcessing)return"running";if(a.isSessionRunning)return"ready"}return"idle"})(r,null!==g.error.type,ah),[r,g.error.type,ah]),b1=(0,h.useMemo)(()=>g.layout.mobileActivePane,[g.layout.mobileActivePane]),b2=r?.name??"Unknown",b3=(0,h.useCallback)((a,b)=>{A.dispatch({type:"SET_CONTENT",path:a,content:b})},[A]),b4=(0,h.useCallback)((a,b)=>{A.dispatch({type:"SET_ERROR",path:a,error:b})},[A]),b5=(0,h.useCallback)((a,b)=>{A.dispatch({type:"SET_LOADING",path:a,loading:b})},[A]);return{activeActivity:aC,activeCliTab:ah,activeInstanceId:al,activeTab:b1,agentInstances:Y,autoYesEnabled:at,autoYesExpiresAt:au,autoYesStateMap:H,diffContent:aX,diffFilePath:aY,disableAutoFollow:ba,displayedAgents:a9,displayedInstances:a6,editorFilePath:D,error:v,fetchCurrentOutput:a2,fileInputRef:bU,fileSearch:a_,fileTreeRefresh:av,handleActivityToggle:bp,handleAgentInstancesChange:bc,handleAutoYesToggle:bz,handleBackClick:bq,handleCloseDiff:a$,handleDelete:bO,handleDiffSelect:aZ,handleDirtyChange:(0,h.useCallback)((a,b)=>{A.dispatch({type:"SET_DIRTY",path:a,isDirty:b})},[A]),handleEditorClose:bm,handleEditorSave:bo,handleFileInputChange:bX,handleFilePanelSave:bl,handleFilePathClick:bh,handleFileSelect:bi,handleHistoryDisplayLimitChange:aL,handleHistoryUserOnlyChange:aJ,handleInfoClick:bs,handleInfoModalClose:bt,handleInsertConsumed:aT,handleInsertConsumedSingle:aV,handleInsertToMessage:aR,handleInsertToSplit:aS,handleKillCancel:bI,handleKillConfirm:bH,openKillConfirm:bF,openActiveKillConfirm:bG,killTarget:bA,isKillPending:bC,handleLoadContent:b3,handleLoadError:b4,handleMessageSent:bx,handleMobileFileViewerClose:bk,handleMobileTabChange:bw,handleMove:bR,resetFileTreeView:bn,handleMoveCancel:bT,handleMoveConfirm:bS,handleNewDirectory:bM,handleNewFile:bJ,handleNewFileCancel:bL,handleNewFileConfirm:bK,handleOpenFile:bj,handlePromptDismiss:bv,handlePromptRespond:bu,handleRename:bN,handleRetry:b_,handleSelectedAgentsChange:bb,handleSetLoading:b5,handleShowArchivedChange:aH,handleUpload:bW,handleVibeLocalContextWindowChange:be,rosterReady:ac,handleVibeLocalModelChange:bd,handleWorktreeStatusChange:br,hasUpdate:bZ,historyDisplayLimit:aK,historySubTab:aE,historyUserOnly:aI,isEditorMaximized:F,isInfoModalOpen:x,isMobile:c,isMoveDialogOpen:bQ,isSelectionListActive:N,isPagerActive:P,lastAutoResponse:b$,loading:t,makeAutoYesToggleHandler:by,mobileFileViewerPath:B,mobileSelectedAgents:a8,moveTarget:bP,newFileParentPath:az,openMobileDrawer:e,pendingInsertText:aP,pendingInsertTextMap:aO,selectedAgents:V,setActiveCliTab:aj,setActiveInstanceId:ao,setEditorFilePath:E,setFocusedSplitIndex:aQ,setHistorySubTab:aF,setIsEditorMaximized:G,setWorktree:s,showArchived:aG,showNewFileDialog:ax,showToast:bf,state:g,tCommon:m,tWorktree:j,tabsActions:A,tabsState:z,toggleInstanceVisible:a5,vibeLocalContextWindow:af,vibeLocalModel:ad,visibleInstanceIds:a4,worktree:r,worktreeName:b2,worktreeStatus:b0}}({worktreeId:a}),[bv,bw]=(0,h.useState)(!1),bx=function({worktreeId:a,active:b}){let{addListener:c}=(0,bp.xM)(),[d,e]=(0,h.useState)(!1);return(0,h.useRef)(b).current=b,!b&&d}({worktreeId:a,active:"terminal"===g}),{viewportHeight:by}=function(){let[a,b]=(0,h.useState)(!1),[c,d]=(0,h.useState)(0),[e,f]=(0,h.useState)(null);return(0,h.useCallback)(()=>{},[]),{isKeyboardVisible:a,keyboardHeight:c,viewportHeight:e}}(),bz=(0,h.useCallback)(a=>{let b=fS.indexOf(g);if(-1===b)return;let c=b+a;c<0||c>=fS.length||ap(fS[c])},[g,ap]),{ref:bA}=K({axis:"horizontal",threshold:60,edgeStartZone:32*("terminal"===g),onSwipeLeft:()=>bz(1),onSwipeRight:()=>bz(-1)});if(aX)return(0,e.jsx)(et,{});if(w)return(0,e.jsx)(eu,{message:w,onRetry:aC});let bB=(0,a7.O6)(i,d,c),bC=ah?.label??bB,bD=(bs?.sessionStatusByInstance?.[d]??bs?.sessionStatusByCli?.[c])?.isRunning??!1;return aQ?(0,e.jsx)(F,{componentName:"WorktreeDetailRefactored",children:(0,e.jsxs)("div",{className:"flex flex-col overflow-hidden",style:{height:null!=by?`${by}px`:"100%"},"data-testid":"mobile-worktree-shell",children:[(0,e.jsx)("div",{className:"flex-shrink-0",children:(0,e.jsx)(v,{worktreeName:bt,repositoryName:bs?.repositoryName,status:bu,gitStatus:bs?.gitStatus,onBackClick:G,onMenuClick:a1})}),bs?.gitStatus&&bs.gitStatus.isBranchMismatch&&(0,e.jsx)("div",{className:"z-35 flex-shrink-0",children:(0,e.jsx)(fx,{isBranchMismatch:bs.gitStatus.isBranchMismatch,currentBranch:bs.gitStatus.currentBranch,initialBranch:bs.gitStatus.initialBranch})}),(0,e.jsxs)("div",{className:"flex-shrink-0 z-30 flex items-center gap-2 px-3 py-1.5 bg-surface-2 border-b border-border",children:[(0,e.jsx)("nav",{className:"flex gap-1 flex-1 min-w-0 overflow-x-auto scrollbar-hide","aria-label":bj("detail.agentInstanceSelection"),children:t.map(a=>{let b=(0,a6.kA)(bs?.sessionStatusByInstance?.[a.id]??bs?.sessionStatusByCli?.[a.cliTool]),c=bi(`status.${b}`),f=d===a.id;return(0,e.jsxs)("button",{onClick:()=>a8(a.id),className:`flex-shrink-0 whitespace-nowrap min-h-[44px] px-1.5 py-1 font-medium text-xs transition-colors flex items-center gap-1 border-b-2 touch-manipulation ${f?"text-accent-600 dark:text-accent-400 border-accent-500":"text-muted-foreground hover:text-foreground border-transparent"}`,"aria-current":f?"page":void 0,children:[(0,e.jsx)(o.m,{status:b,size:"sm",label:bj("detail.statusPill",{label:(0,a7.sw)(a),status:c})}),(0,a7.sw)(a)]},a.id)})}),(0,e.jsx)("button",{type:"button",onClick:()=>bw(!0),className:"flex-shrink-0 flex items-center justify-center min-h-[44px] min-w-[44px] rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors touch-manipulation","aria-label":bj("terminal.moreActions"),"data-testid":"mobile-more-actions-button",children:(0,e.jsx)(l.A,{size:18,"aria-hidden":"true"})})]}),(0,e.jsx)("main",{className:"flex-1 min-h-0 overflow-y-auto",ref:bA,children:(0,e.jsx)(en,{activeTab:g,worktreeId:a,worktree:bs,messages:bh.messages,cliToolId:c,instanceId:d,onFilePathClick:R,onFileSelect:U,onWorktreeUpdate:bd,onNewFile:au,onNewDirectory:at,onRename:aA,onDelete:I,onUpload:aF,onMove:aq,onFileTreeReset:bm,refreshTrigger:A,fileSearch:z,showToast:bg,selectedAgents:a$,onSelectedAgentsChange:fR,useInstanceManagement:!0,instances:i,onInstancesChange:C,visibleInstanceIds:br,onToggleInstanceVisible:bn,vibeLocalModel:bq,onVibeLocalModelChange:aH,vibeLocalContextWindow:bo,onVibeLocalContextWindowChange:aG,disableAutoFollow:s,historySubTab:aL,onHistorySubTabChange:bb,onDiffSelect:J,onInsertToMessage:_,showArchived:be,onShowArchivedChange:aE,historyDisplayLimit:aK,onHistoryDisplayLimitChange:V,historyUserOnly:aM,onHistoryUserOnlyChange:W})}),(0,e.jsxs)("div",{className:"flex-shrink-0 border-t border-border bg-surface z-30",children:[aS&&(0,e.jsx)("div",{className:"px-2 pt-1 border-b border-border",children:(0,e.jsx)(al,{worktreeId:a,cliToolId:c,instanceId:d,onKeysSent:x,showPagerKeys:aT})}),(0,e.jsx)("div",{className:"p-2",children:(0,e.jsx)(ag,{worktreeId:a,onMessageSent:an,cliToolId:c,instanceId:d,isSessionRunning:bD,pendingInsertText:a2,onInsertConsumed:$,autoYesSlot:(0,e.jsx)(fs,{enabled:j,expiresAt:m,onToggle:D,lastAutoResponse:aV,cliToolName:c,inline:!0,showToolName:!1})})})]}),(0,e.jsx)(E,{activeTab:g,onTabChange:ap,hasNewOutput:bx,hasPrompt:bh.prompt.visible,hasUpdate:aJ,inFlow:!0}),!j&&(0,e.jsx)(M,{promptData:bh.prompt.data,visible:bh.prompt.visible,answering:bh.prompt.answering,onRespond:az,onDismiss:ay,cliToolName:(0,a7.oo)(c)}),(0,e.jsx)(S,{open:bv,onClose:()=>bw(!1),onSearch:()=>window.dispatchEvent(new CustomEvent("terminal-search-open")),onEnd:af,endDisabled:!bD}),(0,e.jsx)(aP,{isOpen:null!==aZ,onClose:ao,worktreeId:a,filePath:aZ??"",onEditMarkdown:a9}),u&&(0,e.jsx)(a5.a,{isOpen:!0,onClose:N,title:u.split("/").pop()||bj("fileViewer.editor"),size:"full",disableClose:aN,children:(0,e.jsx)("div",{className:"h-[80vh]",children:(0,e.jsx)(fQ,{worktreeId:a,filePath:u,onClose:N,onSave:O,onMaximizedChange:bc,initialViewMode:"split"})})}),(0,e.jsx)("input",{ref:y,type:"file",accept:eM.join(","),onChange:P,className:"hidden","aria-label":bj("detail.uploadFile")}),(0,e.jsx)(a5.a,{isOpen:null!==ah,onClose:ac,title:bj("session.confirmEnd",{tool:bC}),size:"sm",showCloseButton:!0,children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("p",{className:"text-sm text-foreground",children:bj("session.endWarning")}),(0,e.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,e.jsx)("button",{type:"button",onClick:ac,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:bi("cancel")}),(0,e.jsx)("button",{type:"button",onClick:ad,disabled:ai,className:"px-4 py-2 text-sm font-medium rounded-md bg-danger hover:bg-danger/90 text-white disabled:opacity-60 disabled:cursor-not-allowed",children:bi("end")})]})]})}),a_&&(0,e.jsx)(fz,{isOpen:aR,onClose:ar,onConfirm:as,worktreeId:a,sourcePath:a_.path,sourceType:a_.type}),(0,e.jsx)(fB,{isOpen:bf,parentPath:a0,onConfirm:aw,onCancel:av})]})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(fC,{worktreeId:a,worktree:bs,worktreeName:bt,worktreeStatus:bu,instances:i,rosterReady:a4,activeInstanceId:d,setActiveInstanceId:a8,hasUpdate:aJ,lastAutoResponse:aV,activeActivity:b,onActivityToggle:B,onBackClick:G,onInfoClick:X,onWorktreeStatusChange:aI,pendingInsertTextMap:a3,setFocusedSplitIndex:ba,handleInsertToSplit:aa,handleInsertConsumed:Z,handleInsertToMessage:_,autoYesStateMap:n,makeAutoYesToggleHandler:aY,showArchived:be,onShowArchivedChange:aE,historyDisplayLimit:aK,onHistoryDisplayLimitChange:V,historyUserOnly:aM,onHistoryUserOnlyChange:W,onMessageSent:an,onFilePathClick:R,showToast:bg,tabsState:bl,tabsActions:bk,onLoadContent:aj,onLoadError:ak,onSetLoading:aD,onFilePanelSave:Q,onDirtyChange:L,onOpenFile:ax,diffContent:p,diffFilePath:r,onCloseDiff:H,fileSearch:z,fileTreeRefresh:A,onFileSelect:U,onNewFile:au,onNewDirectory:at,onRename:aA,onDelete:I,onUpload:aF,onMove:aq,onFileTreeReset:bm,onDiffSelect:J,onAgentInstancesChange:C,vibeLocalModel:bq,onVibeLocalModelChange:aH,vibeLocalContextWindow:bo,onVibeLocalContextWindowChange:aG,isInfoModalOpen:aO,onInfoModalClose:Y,onWorktreeUpdate:bd,fileInputRef:y,onFileInputChange:P,onKillSession:af,onRequestSessionEnd:ae,killTarget:ah,isKillPending:ai,onKillCancel:ac,onKillConfirm:ad,moveTarget:a_,isMoveDialogOpen:aR,onMoveCancel:ar,onMoveConfirm:as,showNewFileDialog:bf,newFileParentPath:a0,onNewFileConfirm:aw,onNewFileCancel:av,killDialogTitle:bj("session.confirmEnd",{tool:bC}),killDialogWarning:bj("session.endWarning"),cancelLabel:bi("cancel"),endLabel:bi("end")}),u&&(0,e.jsx)(a5.a,{isOpen:!0,onClose:N,title:u.split("/").pop()||bj("fileViewer.editor"),size:"full",disableClose:aN,children:(0,e.jsx)("div",{className:"h-[80vh]",children:(0,e.jsx)(fQ,{worktreeId:a,filePath:u,onClose:N,onSave:O,onMaximizedChange:bc})})})]})});function fU(){let a=(0,f.useParams)().id;return(0,e.jsx)(g.GV,{children:(0,e.jsx)(fT,{worktreeId:a})})}},97369:a=>{a.exports=function(a){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.COMMENT("/\\*\\*!","\\*/"),a.C_NUMBER_MODE,a.inherit(a.APOS_STRING_MODE,{illegal:null}),a.inherit(a.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}},97467:a=>{a.exports=function(a){return{name:"DNS Zone",aliases:["bind","zone"],keywords:["IN","A","AAAA","AFSDB","APL","CAA","CDNSKEY","CDS","CERT","CNAME","DHCID","DLV","DNAME","DNSKEY","DS","HIP","IPSECKEY","KEY","KX","LOC","MX","NAPTR","NS","NSEC","NSEC3","NSEC3PARAM","PTR","RRSIG","RP","SIG","SOA","SRV","SSHFP","TA","TKEY","TLSA","TSIG","TXT"],contains:[a.COMMENT(";","$",{relevance:0}),{className:"meta",begin:/^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/},{className:"number",begin:"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b"},{className:"number",begin:"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b"},a.inherit(a.NUMBER_MODE,{begin:/\b\d+[dhwm]?/})]}}},97694:a=>{a.exports=function(a){let b=a.regex,c={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},d=a.COMMENT();d.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let e={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},f={className:"literal",begin:/\bon|off|true|false|yes|no\b/},g={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},h=b.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[d,{className:"section",begin:/\[+/,end:/\]+/},{begin:b.concat(h,"(\\s*\\.\\s*",h,")*",b.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[d,{begin:/\[/,end:/\]/,contains:[d,f,e,g,c,"self"],relevance:0},f,e,g,c]}}]}}},98758:a=>{a.exports=function(a){return{name:"Inform 7",aliases:["i7"],case_insensitive:!0,keywords:{keyword:"thing room person man woman animal container supporter backdrop door scenery open closed locked inside gender is are say understand kind of rule"},contains:[{className:"string",begin:'"',end:'"',relevance:0,contains:[{className:"subst",begin:"\\[",end:"\\]"}]},{className:"section",begin:/^(Volume|Book|Part|Chapter|Section|Table)\b/,end:"$"},{begin:/^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,end:":",contains:[{begin:"\\(This",end:"\\)"}]},{className:"comment",begin:"\\[",end:"\\]",contains:["self"]}]}}},98803:a=>{a.exports=function(a){let b=a.regex,c=/[a-zA-Z_][a-zA-Z0-9_]*/,d={className:"number",variants:[a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[a.COMMENT(";[ \\t]*#","$"),a.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:b.concat(/\$/,b.optional(/::/),c,"(::",c,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[d]}]},{className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[a.inherit(a.QUOTE_STRING_MODE,{illegal:null})]},d]}}},99134:a=>{a.exports=function(a){let b=a.regex,c=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,d=b.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),e=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,f=b.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:c,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[a.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:b.lookahead(b.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:c},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),a.HASH_COMMENT_MODE,{scope:"string",contains:[a.BACKSLASH_ESCAPE],variants:[a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[e,d]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,d]},{scope:{1:"punctuation",2:"number"},match:[f,d]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,d]}]},{scope:{3:"operator"},match:[c,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:e},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:f},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}},99626:a=>{"use strict";a.exports=JSON.parse('{"Aacute":"\xc1","aacute":"\xe1","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"\xc2","acirc":"\xe2","acute":"\xb4","Acy":"А","acy":"а","AElig":"\xc6","aelig":"\xe6","af":"","Afr":"\uD835\uDD04","afr":"\uD835\uDD1E","Agrave":"\xc0","agrave":"\xe0","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"\xc5","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"\uD835\uDD38","aopf":"\uD835\uDD52","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"\xc5","aring":"\xe5","Ascr":"\uD835\uDC9C","ascr":"\uD835\uDCB6","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"\xc3","atilde":"\xe3","Auml":"\xc4","auml":"\xe4","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"\uD835\uDD05","bfr":"\uD835\uDD1F","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"\uD835\uDD39","bopf":"\uD835\uDD53","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"\xa6","bscr":"\uD835\uDCB7","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"\xc7","ccedil":"\xe7","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"\xb8","Cedilla":"\xb8","cemptyv":"⦲","cent":"\xa2","centerdot":"\xb7","CenterDot":"\xb7","cfr":"\uD835\uDD20","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"\xae","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"\uD835\uDD54","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"\xa9","COPY":"\xa9","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"\uD835\uDC9E","cscr":"\uD835\uDCB8","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"\xa4","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"\xb0","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"\uD835\uDD07","dfr":"\uD835\uDD21","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"\xb4","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"\xa8","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"\xf7","divide":"\xf7","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"\uD835\uDD3B","dopf":"\uD835\uDD55","Dot":"\xa8","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"\xa8","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"\uD835\uDC9F","dscr":"\uD835\uDCB9","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"\xc9","eacute":"\xe9","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"\xca","ecirc":"\xea","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"\uD835\uDD08","efr":"\uD835\uDD22","eg":"⪚","Egrave":"\xc8","egrave":"\xe8","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"\uD835\uDD3C","eopf":"\uD835\uDD56","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"\xd0","eth":"\xf0","Euml":"\xcb","euml":"\xeb","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"\uD835\uDD09","ffr":"\uD835\uDD23","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"\uD835\uDD3D","fopf":"\uD835\uDD57","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"\xbd","frac13":"⅓","frac14":"\xbc","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"\xbe","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"\uD835\uDCBB","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"\uD835\uDD0A","gfr":"\uD835\uDD24","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"\uD835\uDD3E","gopf":"\uD835\uDD58","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"\uD835\uDCA2","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"\xbd","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"\uD835\uDD25","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"\uD835\uDD59","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"\uD835\uDCBD","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"\xcd","iacute":"\xed","ic":"","Icirc":"\xce","icirc":"\xee","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"\xa1","iff":"⇔","ifr":"\uD835\uDD26","Ifr":"ℑ","Igrave":"\xcc","igrave":"\xec","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"\uD835\uDD40","iopf":"\uD835\uDD5A","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"\xbf","iscr":"\uD835\uDCBE","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"\xcf","iuml":"\xef","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"\uD835\uDD0D","jfr":"\uD835\uDD27","jmath":"ȷ","Jopf":"\uD835\uDD41","jopf":"\uD835\uDD5B","Jscr":"\uD835\uDCA5","jscr":"\uD835\uDCBF","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"\uD835\uDD0E","kfr":"\uD835\uDD28","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"\uD835\uDD42","kopf":"\uD835\uDD5C","Kscr":"\uD835\uDCA6","kscr":"\uD835\uDCC0","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"\xab","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"\uD835\uDD0F","lfr":"\uD835\uDD29","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"\uD835\uDD43","lopf":"\uD835\uDD5D","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"‹","lscr":"\uD835\uDCC1","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"\xaf","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"\uD835\uDD10","mfr":"\uD835\uDD2A","mho":"℧","micro":"\xb5","midast":"*","midcir":"⫰","mid":"∣","middot":"\xb7","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"\uD835\uDD44","mopf":"\uD835\uDD5E","mp":"∓","mscr":"\uD835\uDCC2","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":"\xa0","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"\uD835\uDD11","nfr":"\uD835\uDD2B","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":"\xa0","nopf":"\uD835\uDD5F","Nopf":"ℕ","Not":"⫬","not":"\xac","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"\uD835\uDCA9","nscr":"\uD835\uDCC3","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"\xd1","ntilde":"\xf1","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"\xd3","oacute":"\xf3","oast":"⊛","Ocirc":"\xd4","ocirc":"\xf4","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"\uD835\uDD12","ofr":"\uD835\uDD2C","ogon":"˛","Ograve":"\xd2","ograve":"\xf2","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"\uD835\uDD46","oopf":"\uD835\uDD60","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"\xaa","ordm":"\xba","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"\uD835\uDCAA","oscr":"ℴ","Oslash":"\xd8","oslash":"\xf8","osol":"⊘","Otilde":"\xd5","otilde":"\xf5","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"\xd6","ouml":"\xf6","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"\xb6","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"\uD835\uDD13","pfr":"\uD835\uDD2D","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"\xb1","plusmn":"\xb1","plussim":"⨦","plustwo":"⨧","pm":"\xb1","Poincareplane":"ℌ","pointint":"⨕","popf":"\uD835\uDD61","Popf":"ℙ","pound":"\xa3","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"\uD835\uDCAB","pscr":"\uD835\uDCC5","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"\uD835\uDD14","qfr":"\uD835\uDD2E","qint":"⨌","qopf":"\uD835\uDD62","Qopf":"ℚ","qprime":"⁗","Qscr":"\uD835\uDCAC","qscr":"\uD835\uDCC6","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"\xbb","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"\xae","REG":"\xae","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"\uD835\uDD2F","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"\uD835\uDD63","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"\uD835\uDCC7","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"\xa7","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"\uD835\uDD16","sfr":"\uD835\uDD30","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"\xad","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"\uD835\uDD4A","sopf":"\uD835\uDD64","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"\uD835\uDCAE","sscr":"\uD835\uDCC8","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"\xaf","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"\xb9","sup2":"\xb2","sup3":"\xb3","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"\xdf","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"\uD835\uDD17","tfr":"\uD835\uDD31","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"\xde","thorn":"\xfe","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"\xd7","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"\uD835\uDD4B","topf":"\uD835\uDD65","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"\uD835\uDCAF","tscr":"\uD835\uDCC9","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"\xda","uacute":"\xfa","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"\xdb","ucirc":"\xfb","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"\uD835\uDD18","ufr":"\uD835\uDD32","Ugrave":"\xd9","ugrave":"\xf9","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"\xa8","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"\uD835\uDD4C","uopf":"\uD835\uDD66","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"\uD835\uDCB0","uscr":"\uD835\uDCCA","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"\xdc","uuml":"\xfc","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"\uD835\uDD19","vfr":"\uD835\uDD33","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"\uD835\uDD4D","vopf":"\uD835\uDD67","vprop":"∝","vrtri":"⊳","Vscr":"\uD835\uDCB1","vscr":"\uD835\uDCCB","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"\uD835\uDD1A","wfr":"\uD835\uDD34","Wopf":"\uD835\uDD4E","wopf":"\uD835\uDD68","wp":"℘","wr":"≀","wreath":"≀","Wscr":"\uD835\uDCB2","wscr":"\uD835\uDCCC","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"\uD835\uDD1B","xfr":"\uD835\uDD35","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"\uD835\uDD4F","xopf":"\uD835\uDD69","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"\uD835\uDCB3","xscr":"\uD835\uDCCD","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"\xdd","yacute":"\xfd","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"\xa5","Yfr":"\uD835\uDD1C","yfr":"\uD835\uDD36","YIcy":"Ї","yicy":"ї","Yopf":"\uD835\uDD50","yopf":"\uD835\uDD6A","Yscr":"\uD835\uDCB4","yscr":"\uD835\uDCCE","YUcy":"Ю","yucy":"ю","yuml":"\xff","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"\uD835\uDD37","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"\uD835\uDD6B","Zopf":"ℤ","Zscr":"\uD835\uDCB5","zscr":"\uD835\uDCCF","zwj":"","zwnj":""}')},99896:a=>{a.exports=function(a){return{name:"JBoss CLI",aliases:["wildfly-cli"],keywords:{$pattern:"[a-z-]+",keyword:"alias batch cd clear command connect connection-factory connection-info data-source deploy deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias undeploy unset version xa-data-source",literal:"true false"},contains:[a.HASH_COMMENT_MODE,a.QUOTE_STRING_MODE,{className:"params",begin:/--[\w\-=\/]+/},{className:"function",begin:/:[\w\-.]+/,relevance:0},{className:"string",begin:/\B([\/.])[\w\-.\/=]+/},{className:"params",begin:/\(/,end:/\)/,contains:[{begin:/[\w-]+ *=/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/[\w-]+/}]}],relevance:0}]}}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[1331,1366,6015,129,9968,180,7013,9123,3451,646],()=>b(b.s=31975));module.exports=c})();
|
|
38
|
+
`.trim(),fl="bg-accent-600 text-white hover:bg-accent-700 focus:ring-ring";function fm({promptData:a,answering:b,onRespond:c,onDismiss:d,labelId:f,cliToolName:g}){let i=(0,k.c)("prompt"),[j,l]=(0,h.useState)(()=>{if("multiple_choice"===a.type){let b=a.options.find(a=>a.isDefault);return b?.number??null}return null}),[m,o]=(0,h.useState)(""),[p,q]=(0,h.useState)(!1),r=(0,h.useMemo)(()=>"multiple_choice"!==a.type?null:a.options.find(a=>a.number===j)??null,[a,j]),s=r?.requiresTextInput===!0,t=b||p,u=(0,h.useCallback)(async a=>{if(!t){q(!0);try{await c(a)}catch(a){}finally{q(!1)}}},[t,c]),v=(0,h.useCallback)(async()=>{if(!t&&null!==j){q(!0);try{let a=s&&m.trim()?m.trim():j.toString();await c(a)}catch(a){}finally{q(!1)}}},[t,c,j,s,m]);return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("h3",{id:f,className:"text-lg font-semibold text-warning-foreground flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xl","aria-hidden":"true",children:"?"}),g?i("confirmationFrom",{toolName:g}):i("confirmationFromClaude")]}),d&&(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:d,"aria-label":"close",className:"p-1 rounded hover:bg-warning-border/50 transition-colors",children:(0,e.jsx)("svg",{className:"w-5 h-5 text-warning-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),a.instructionText&&(0,e.jsx)("div",{className:"max-h-40 overflow-y-auto whitespace-pre-wrap text-sm text-muted-foreground bg-muted rounded p-2 border border-border",children:a.instructionText}),(0,e.jsx)("p",{className:"text-foreground leading-relaxed",children:a.question}),t&&(0,e.jsxs)("div",{"data-testid":"answering-indicator",className:"flex items-center gap-2 text-sm text-muted-foreground",role:"status","aria-live":"polite",children:[(0,e.jsx)(n.y$,{size:"sm",variant:"accent"}),(0,e.jsx)("span",{children:i("sending")})]}),"yes_no"===a.type&&(0,e.jsx)(fn,{promptData:a,disabled:t,onYes:()=>u("yes"),onNo:()=>u("no")}),"multiple_choice"===a.type&&(0,e.jsx)(fo,{promptData:a,disabled:t,selectedOption:j,onSelectOption:l,textInputValue:m,onTextInputChange:o,showTextInput:s,onSubmit:v})]})}function fn({promptData:a,disabled:b,onYes:c,onNo:d}){let f=(0,k.c)("prompt"),g="yes"===a.defaultOption,h="no"===a.defaultOption,i=`${fk} ${fl} ${g?"primary default highlighted":""}`,j=`${fk} ${h?"bg-foreground text-background hover:bg-foreground/90 primary default highlighted":"bg-surface border-2 border-input hover:bg-muted text-foreground focus:ring-ring"}`;return(0,e.jsxs)("div",{className:"flex items-center gap-3",role:"group","aria-label":f("yesNoGroupLabel"),children:[(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:c,disabled:b,className:i,children:f("yes")}),(0,e.jsx)(n.$n,{variant:"ghost",type:"button",onClick:d,disabled:b,className:j,children:f("no")})]})}function fo({promptData:a,disabled:b,selectedOption:c,onSelectOption:d,textInputValue:f,onTextInputChange:g,showTextInput:i,onSubmit:j}){let l=(0,h.useId)(),m=(0,k.c)("prompt"),o=(0,h.useCallback)(a=>{let d=c===a,e=b?"opacity-50 cursor-not-allowed":"";return`flex items-start gap-3 p-3 rounded-lg cursor-pointer transition-all ${d?"bg-accent-50 dark:bg-accent-900/30 border-2 border-accent-500":"bg-surface border-2 border-border hover:border-input"} ${e}`},[c,b]);return(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("fieldset",{children:[(0,e.jsx)("legend",{className:"sr-only",children:m("selectAnOption")}),(0,e.jsx)(n.z6,{name:l,value:null!=c?String(c):"",onValueChange:a=>d(Number(a)),disabled:b,className:"flex flex-col gap-2",children:a.options.map(a=>(0,e.jsxs)("label",{className:o(a.number),children:[(0,e.jsx)(n.CU,{value:String(a.number),className:"mt-1","aria-describedby":a.isDefault?`default-${a.number}`:void 0}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsxs)("span",{className:"font-medium",children:[a.number,". ",a.label]}),a.isDefault&&(0,e.jsx)("span",{id:`default-${a.number}`,className:"ml-2 text-xs text-accent-600 dark:text-accent-400 bg-accent-100 dark:bg-accent-900/30 px-2 py-0.5 rounded",children:m("default")})]})]},a.number))})]}),i&&(0,e.jsxs)("div",{className:"mt-3",children:[(0,e.jsx)("label",{htmlFor:`text-input-${l}`,className:"sr-only",children:m("customValueInput")}),(0,e.jsx)("input",{id:`text-input-${l}`,type:"text",value:f,onChange:a=>g(a.target.value),disabled:b,placeholder:m("enterValuePlaceholder"),className:"w-full px-4 py-2 border-2 border-input dark:bg-muted dark:text-foreground rounded-lg focus:outline-none focus:border-accent-500 disabled:opacity-50"})]}),(0,e.jsx)("button",{type:"button",onClick:j,disabled:b||null===c,className:`w-full ${fk} ${fl}`,children:m("submit")})]})}let fp=(0,h.memo)(function({promptData:a,messageId:b,visible:c,answering:d,onRespond:f,onDismiss:g,cliToolName:i}){let j,{shouldRender:k,animationClass:l}=I({visible:c&&null!==a,duration:200}),m=(0,h.useId)();if(!k||!a)return null;let n=(j="opacity-100","animate-fade-in"===l?j="opacity-100 transform translate-y-0":"animate-fade-out"===l&&(j="opacity-0 transform translate-y-2"),`bg-warning-subtle border-2 border-warning-border rounded-lg p-4 shadow-lg transition-all duration-200 ease-in-out ${l} ${j}`);return(0,e.jsx)(F,{componentName:"PromptPanel",children:(0,e.jsx)("div",{"data-testid":"prompt-panel",role:"dialog","aria-labelledby":m,"aria-modal":"true",className:n,children:(0,e.jsx)(fm,{promptData:a,answering:d,onRespond:f,onDismiss:g,labelId:m,cliToolName:i})})})});var fq=c(74892);function fr({isOpen:a,onConfirm:b,onCancel:c,cliToolName:d}){let f=(0,k.c)("autoYes"),g=(0,k.c)("common"),[i,j]=(0,h.useState)(36e5),[l,m]=(0,h.useState)(""),[n,o]=(0,h.useState)(null),[p,q]=(0,h.useState)(!1),r=(0,h.useRef)(null),s=a=>f(dF[a].replace("autoYes.",""));return(0,e.jsx)(a5.a,{isOpen:a,onClose:c,title:d?f("enableTitleWithTool",{toolName:d}):f("enableTitle"),size:"sm",showCloseButton:!0,children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"text-sm text-foreground",children:[(0,e.jsx)("p",{className:"font-medium mb-2",children:f("featureDescription")}),(0,e.jsxs)("ul",{className:"list-disc list-inside space-y-1",children:[(0,e.jsx)("li",{children:f("yesNoAutoResponse")}),(0,e.jsx)("li",{children:f("multipleChoiceAutoSelect")})]}),(0,e.jsx)("p",{className:"mt-1",children:f("autoDisableAfter",{duration:s(i)})}),d&&(0,e.jsx)("p",{className:"mt-2 text-muted-foreground",children:f("appliesOnlyToCurrent",{toolName:d})})]}),(0,e.jsxs)("div",{className:"text-sm text-foreground",children:[(0,e.jsx)("p",{className:"font-medium mb-2",children:f("duration")}),(0,e.jsx)("div",{className:"flex gap-2",children:dE.map(a=>(0,e.jsx)("button",{type:"button",onClick:()=>j(a),className:`flex-1 py-2 px-3 text-sm font-medium rounded-md border-2 transition-colors ${i===a?"border-accent-600 bg-accent-50 dark:bg-accent-900/30 text-accent-700 dark:text-accent-400":"border-border bg-surface dark:bg-surface-2 text-foreground hover:border-muted-foreground"}`,style:{minHeight:"44px"},children:s(a)},a))})]}),(0,e.jsxs)("div",{className:"text-sm text-foreground",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,e.jsx)("label",{htmlFor:"stop-pattern-input",className:"font-medium",children:f("stopPatternLabel")}),(0,e.jsxs)("div",{className:"relative",ref:r,children:[(0,e.jsx)("button",{type:"button",onClick:()=>q(!p),className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-muted text-muted-foreground text-[10px] font-bold hover:bg-muted/80 focus:outline-none","aria-label":f("regexTipsLabel"),"data-testid":"regex-tips-button",children:"?"}),p&&(0,e.jsxs)("div",{className:"absolute left-0 top-6 z-50 w-72 rounded-md border border-border bg-surface p-3 shadow-lg text-xs text-foreground","data-testid":"regex-tips-tooltip",children:[(0,e.jsx)("p",{className:"font-medium mb-1.5",children:f("regexTipsTitle")}),(0,e.jsxs)("ul",{className:"space-y-1",children:[(0,e.jsxs)("li",{children:[(0,e.jsx)("code",{className:"bg-muted px-1 rounded",children:"\\bcat\\b"})," ",f("regexTipWordBoundary")]}),(0,e.jsxs)("li",{children:[(0,e.jsx)("code",{className:"bg-muted px-1 rounded",children:"error|fatal"})," ",f("regexTipOr")]}),(0,e.jsxs)("li",{children:[(0,e.jsx)("code",{className:"bg-muted px-1 rounded",children:"(?i)error"})," ",f("regexTipCaseNote")]})]})]})]})]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground mb-2",children:f("stopPatternDescription")}),(0,e.jsx)("input",{id:"stop-pattern-input",type:"text",value:l,onChange:a=>m(a.target.value),placeholder:f("stopPatternPlaceholder"),className:`w-full px-3 py-2 border rounded-md text-sm font-mono bg-surface dark:bg-surface-2 text-foreground ${n?"border-danger focus:ring-danger focus:border-danger":"border-input focus:ring-ring focus:border-accent-500"} focus:outline-none focus:ring-1`,"data-testid":"stop-pattern-input"}),n&&(0,e.jsx)("p",{className:"mt-1 text-xs text-danger","data-testid":"stop-pattern-error",children:n})]}),(0,e.jsxs)("div",{className:"text-sm text-foreground",children:[(0,e.jsx)("p",{className:"font-medium mb-2",children:f("aboutRisks")}),(0,e.jsx)("p",{children:f("riskWarning")})]}),(0,e.jsx)("div",{className:"bg-warning-subtle border-l-4 border-warning p-3",children:(0,e.jsxs)("p",{className:"text-sm text-warning-foreground",children:[(0,e.jsx)("span",{className:"font-medium",children:f("disclaimer")}),f("disclaimerText")]})}),(0,e.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,e.jsx)("button",{type:"button",onClick:c,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:g("cancel")}),(0,e.jsx)("button",{type:"button",onClick:()=>{b(i,l.trim()||void 0)},disabled:!!n,className:`px-4 py-2 text-sm font-medium rounded-md text-white ${n?"bg-muted-foreground cursor-not-allowed":"bg-warning hover:bg-warning/90"}`,"data-testid":"confirm-button",children:f("agreeAndEnable")})]})]})})}let fs=(0,h.memo)(function({enabled:a,expiresAt:b,onToggle:c,lastAutoResponse:d,cliToolName:f,inline:g=!1,showToolName:i=!0,onExpire:j}){let l=(0,k.c)("autoYes"),[m,n]=(0,h.useState)(""),[o,p]=(0,h.useState)(null),[q,r]=(0,h.useState)(!1),[s,t]=(0,h.useState)(!1),[u,v]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(!a||!b){n(""),v(!1);return}v(!1);let c=!1,d=()=>(n(dG(b)),b-Date.now()<=0&&!c&&(c=!0,v(!0),j?.(),!0));if(d())return;let e=setInterval(()=>{d()&&clearInterval(e)},1e3);return()=>clearInterval(e)},[a,b,j]),(0,h.useEffect)(()=>{if(!d)return;p(`Auto responded: "${d}"`);let a=setTimeout(()=>p(null),ah.I2);return()=>clearTimeout(a)},[d]);let w=a&&!u,x=(0,h.useCallback)(()=>{w?(r(!0),c({enabled:!1}).finally(()=>r(!1))):t(!0)},[w,c]),y=(0,h.useCallback)((a,b)=>{t(!1),r(!0),c({enabled:!0,duration:a,stopPattern:b}).finally(()=>r(!1))},[c]),z=(0,h.useCallback)(()=>{t(!1)},[]);return(0,e.jsxs)("div",{className:g?"flex items-center gap-2":"flex items-center gap-3 px-4 py-2 bg-surface-2 border-b border-border",children:[(0,e.jsx)(fq.d,{checked:w,onCheckedChange:x,disabled:q,"aria-label":l("toggleLabel")}),(0,e.jsx)("span",{className:"text-sm font-medium text-foreground",children:l("label")}),i&&f&&(0,e.jsxs)("span",{className:"text-xs text-accent-600 dark:text-accent-400 font-medium","aria-label":l("targetLabel"),children:["(",(0,a7.f_)(f,""),")"]}),w&&m&&(0,e.jsx)("span",{className:"text-sm text-muted-foreground","aria-label":l("timeRemaining"),children:m}),o&&(0,e.jsx)("span",{className:"text-sm text-success animate-pulse",children:o}),(0,e.jsx)(fr,{isOpen:s,onConfirm:y,onCancel:z,cliToolName:(0,a7.f_)(f,"")})]})});function ft(a){let b=new Set;for(let c of a)"user"===c.role&&b.add(c.id);return b}function fu(a,b,c,d){let e={answer:a,cliTool:b};if(d&&d!==b&&(e.instanceId=d),c&&(e.promptType=c.type,"multiple_choice"===c.type)){let a=c.options.find(a=>a.isDefault);a&&(e.defaultOptionNumber=a.number),c.submitMode&&(e.submitMode=c.submitMode)}return e}let fv=(0,h.memo)(function({worktreeId:a,splitIndex:b,cliToolId:c,instanceId:d,instance:f,availableInstances:g,onInstanceChange:j,onFocus:l,disabled:m=!1,pendingInsertText:n,onInsertConsumed:o,onMessageSent:p,cliStatus:q="idle",autoYes:r,history:s,onDropInstance:t,draggedInstanceId:u,onRequestSessionEnd:v}){let w=d??c,x=r.enabled??!1,y=r.expiresAt??null,z=r.lastAutoResponse??null,A=r.onToggle,B=s?.showArchived??!1,C=s?.onShowArchivedChange,D=s?.historyDisplayLimit,E=s?.onHistoryDisplayLimitChange,F=s?.historyUserOnly??!1,G=s?.onHistoryUserOnlyChange,H=s?.onInsertToMessage,I=s?.onFilePathClick,J=s?.showToast,K=(0,k.c)("worktree"),{terminal:L,prompt:M,setAutoScroll:N,setPromptAnswering:O,clearPrompt:P,refresh:Q}=bq({worktreeId:a,cliToolId:c,instanceId:w,enabled:!m}),{messages:R,isLoading:S,refresh:U}=function({worktreeId:a,cliToolId:b,instanceId:c,limit:d,includeArchived:e=!1,enabled:f=!0}){let[g,i]=(0,h.useState)([]),[j,k]=(0,h.useState)(!0),{subscribe:l,unsubscribe:m,addListener:n}=(0,bp.xM)(),o=c??b,p=(0,h.useRef)(0),q=(0,h.useRef)(b);q.current=b;let r=(0,h.useRef)(o);r.current=o;let s=(0,h.useCallback)(async()=>{let c=++p.current;try{let f=new URLSearchParams({cliTool:b,instance:o,unit:"pairs"});void 0!==d&&f.set("limit",String(d)),e&&f.set("includeArchived","true");let g=await fetch(`/api/worktrees/${a}/messages?${f.toString()}`);if(!g.ok)return;let h=await g.json();if(p.current!==c||q.current!==b||r.current!==o)return;i(h.map(a=>({...a,timestamp:new Date(a.timestamp)}))),k(!1)}catch(a){if(p.current!==c||q.current!==b||r.current!==o)return;console.error("[useSplitMessages] fetch error:",a),k(!1)}},[a,b,o,d,e]),t=`${a}::${b}::${o}`;return(0,h.useRef)(t),{messages:g,isLoading:j,refresh:(0,h.useCallback)(()=>s(),[s])}}({worktreeId:a,cliToolId:c,instanceId:w,limit:D,includeArchived:B,enabled:!m}),V=(0,h.useCallback)((b,c)=>T.y.sendMessage(a,b,c),[a]),{messages:W,sendOptimistic:X,retry:Y,discard:Z}=function({worktreeId:a,serverMessages:b,sendFn:c,onSent:d,timeoutMs:e=3e4}){let[f,g]=(0,h.useState)([]),i=(0,h.useRef)(b);i.current=b;let j=(0,h.useRef)(f);j.current=f;let k=(0,h.useRef)(d);k.current=d;let l=(0,h.useRef)(c);l.current=c;let m=(0,h.useRef)(0),n=(0,h.useRef)(new Map),o=(0,h.useRef)(new Set),p=(0,h.useCallback)(a=>{let b=n.current.get(a);void 0!==b&&(clearTimeout(b),n.current.delete(a))},[]),q=(0,h.useCallback)(a=>{p(a);let b=setTimeout(()=>{n.current.delete(a),g(b=>b.map(b=>b.tempId===a&&"sending"===b.status?{...b,status:"error"}:b))},e);n.current.set(a,b)},[p,e]),r=(0,h.useCallback)(async a=>{q(a.tempId);try{await l.current(a.content,a.options),k.current?.()}catch{p(a.tempId),g(b=>b.map(b=>b.tempId===a.tempId?{...b,status:"error"}:b))}},[q,p]),s=(0,h.useCallback)((a,b)=>{let c={tempId:`pending-${m.current++}`,content:a,options:b,timestamp:new Date,status:"sending",baselineUserIds:ft(i.current)};g(a=>[...a,c]),r(c)},[r]),t=(0,h.useCallback)(a=>{let b=j.current.find(b=>b.tempId===a);if(!b)return;let c={...b,status:"sending",timestamp:new Date,baselineUserIds:ft(i.current)};g(b=>b.map(b=>b.tempId===a?c:b)),r(c)},[r]),u=(0,h.useCallback)(a=>{let b=j.current.find(b=>b.tempId===a);return p(a),g(b=>b.filter(b=>b.tempId!==a)),b?.content},[p]);return{messages:(0,h.useMemo)(()=>{if(0===f.length)return b;let{reconciledTempIds:c}=function(a,b,c){let d=new Set,e=new Set,f=a.filter(a=>"sending"===a.status);if(0===f.length)return{reconciledTempIds:d,consumedServerIds:e};let g=b.filter(a=>"user"===a.role&&!c.has(a.id)).sort((a,b)=>a.timestamp.getTime()-b.timestamp.getTime()),h=new Set;for(let a of[...f].sort((a,b)=>a.timestamp.getTime()-b.timestamp.getTime())){let b=g.find(b=>!h.has(b.id)&&!a.baselineUserIds.has(b.id)&&b.content===a.content);b&&(h.add(b.id),d.add(a.tempId),e.add(b.id))}return{reconciledTempIds:d,consumedServerIds:e}}(f,b,o.current),d=f.filter(a=>!c.has(a.tempId)).map(b=>({id:b.tempId,worktreeId:a,role:"user",content:b.content,timestamp:b.timestamp,messageType:"normal",archived:!1,cliToolId:b.options.cliToolId,instanceId:b.options.instanceId,optimisticState:b.status}));return 0===d.length?b:[...b,...d]},[b,f,a]),pending:f,sendOptimistic:s,retry:t,discard:u}}({worktreeId:a,serverMessages:R,sendFn:V,onSent:U}),{visible:$,width:_,toggle:aa,setWidth:ab}=cc(),ac=i().useRef(null),ad=(0,h.useCallback)(a=>{let b=ac.current;if(!b)return;let c=b.offsetWidth;0!==c&&ab(_+a/c*100)},[_,ab]),ae="opencode"===c||"copilot"===c,af="claude"===c||"codex"===c,ah=(0,h.useCallback)(a=>N(a),[N]),ai=(0,h.useCallback)(a=>{Q(),U(),p?.(a)},[Q,U,p]),aj=(0,h.useCallback)(a=>{let b=Z(a);b&&H?.(b)},[Z,H]),ak=(0,h.useCallback)(async b=>{O(!0);try{let d=fu(b,c,M.data,w),e=await fetch(`/api/worktrees/${a}/prompt-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(d)});if(!e.ok)throw Error(`Failed to send prompt response: ${e.status}`);P(),await Q()}catch(a){console.error("[TerminalSplitPaneContent] prompt response error:",a)}finally{O(!1)}},[a,c,w,M.data,O,P,Q]),am=(0,h.useCallback)(()=>{P()},[P]),an=L.isSelectionListActive,ao=M.visible&&!x,ap=L.isUnclassifiedActive&&!an&&!M.visible,aq=(0,h.useMemo)(()=>(0,e.jsx)(cq,{messages:W,worktreeId:a,onFilePathClick:I??(()=>{}),isLoading:S,className:"h-full",showToast:J,onInsertToMessage:H,onRetryPending:Y,onDiscardPending:aj,showArchived:B,onShowArchivedChange:C,historyDisplayLimit:D,onHistoryDisplayLimitChange:E,historyUserOnly:F,onHistoryUserOnlyChange:G,onCollapse:aa,splitIndex:b,cliToolId:c}),[W,Y,aj,a,I,S,J,H,B,C,D,E,F,G,aa,b,c]),ar=(0,h.useMemo)(()=>(0,e.jsx)(bo,{output:L.output,isActive:L.isRunning,attaching:L.attaching,isThinking:L.isThinking,autoScroll:L.autoScroll,onScrollChange:ah,disableAutoFollow:ae,compactTuiLayoutPadding:af}),[L.output,L.isRunning,L.attaching,L.isThinking,L.autoScroll,ah,ae,af]),at=(0,h.useMemo)(()=>(0,e.jsxs)("div",{ref:ac,className:"flex h-full min-h-0 w-full",children:[$?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{id:cm(b),"data-testid":`split-history-slot-${b}`,"aria-label":"History pane",style:{width:`${_}%`},className:"flex-shrink-0 overflow-hidden min-h-0",children:aq}),(0,e.jsx)(ch,{onResize:ad,orientation:"horizontal",ariaValueNow:_})]}):(0,e.jsx)("div",{"data-testid":`split-history-expand-bar-${b}`,className:"flex-shrink-0 flex items-start justify-center w-9 bg-gray-50 dark:bg-gray-800 border-r border-gray-200 dark:border-gray-700",children:(0,e.jsxs)("button",{type:"button","data-testid":`split-history-expand-${b}`,"aria-label":K("terminal.showHistory"),title:K("terminal.showHistory"),"aria-expanded":"false",onClick:aa,className:"flex flex-col items-center gap-2 w-full pt-2 text-gray-500 dark:text-gray-400 hover:text-accent-600 dark:hover:text-accent-400 focus:outline-none focus:ring-2 focus:ring-ring",children:[(0,e.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,e.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})}),(0,e.jsx)("span",{className:"text-xs font-medium tracking-wide select-none",style:{writingMode:"vertical-rl"},"aria-hidden":"true",children:K("terminal.historyLabel")})]})}),(0,e.jsx)("div",{className:"flex-grow overflow-hidden min-w-0 min-h-0 relative",children:ar})]}),[$,_,aq,ad,aa,ar,b,K]),au=(0,h.useMemo)(()=>(0,e.jsxs)("div",{className:"space-y-2",children:[an?(0,e.jsx)(al,{worktreeId:a,cliToolId:c,instanceId:w,onKeysSent:Q,showPagerKeys:L.isPagerActive}):null,ap?(0,e.jsx)(fj,{worktreeId:a,cliToolId:c,instanceId:w,onKeysSent:Q}):null,ao?(0,e.jsx)(fp,{promptData:M.data,messageId:M.messageId,visible:M.visible,answering:M.answering,onRespond:ak,onDismiss:am,cliToolName:(0,a7.oo)(c)}):null,(0,e.jsx)(ag,{worktreeId:a,onMessageSent:ai,onOptimisticSend:X,cliToolId:c,instanceId:w,isSessionRunning:L.isRunning,pendingInsertText:n??null,onInsertConsumed:o,splitIndex:b,onFocus:l,isProcessing:L.isRunning,showToast:J,autoYesSlot:(0,e.jsx)(fs,{enabled:x,expiresAt:y??null,onToggle:A,lastAutoResponse:z??null,cliToolName:c,inline:!0})})]}),[an,ao,ap,L.isPagerActive,a,c,w,Q,M.data,M.messageId,M.visible,M.answering,ak,am,ai,X,L.isRunning,n,o,b,l,x,y,z,A,J]),av=(0,a7.sw)(f??{cliTool:c}),aw=(0,h.useCallback)(()=>{v?.({cliToolId:c,instanceId:w,label:av})},[v,c,w,av]),ax=(0,h.useMemo)(()=>{if(!v||!L.isRunning)return null;let a=K("terminal.endSessionFor",{name:av});return(0,e.jsx)("button",{type:"button",onClick:aw,"aria-label":a,title:a,"data-testid":`terminal-end-session-button-${b}`,className:"flex items-center justify-center p-0.5 rounded text-muted-foreground hover:text-danger focus:text-danger hover:bg-danger/10 focus:outline-none focus-visible:ring-2 focus-visible:ring-danger/50 transition-colors",children:(0,e.jsx)(as.A,{size:14,"aria-hidden":"true"})})},[v,L.isRunning,K,av,aw,b]);return(0,e.jsx)(ba,{worktreeId:a,splitIndex:b,cliToolId:c,instanceId:w,instance:f,availableInstances:g,onInstanceChange:j,headerExtras:ax,status:q,onFocus:l,attaching:L.attaching,terminal:at,footer:au,onDropInstance:t,draggedInstanceId:u})});var fw=c(16945);let fx=(0,h.memo)(function({isBranchMismatch:a,currentBranch:b,initialBranch:c}){let d=(0,k.c)("worktree"),[f,g]=(0,h.useState)(!1);return((0,h.useEffect)(()=>{g(!1)},[b]),!a||f||null===c)?null:(0,e.jsxs)("div",{"data-testid":"branch-mismatch-alert",role:"alert",className:"flex items-center gap-3 px-4 py-2 bg-warning-subtle border border-warning-border text-warning-foreground rounded-lg",children:[(0,e.jsx)(fw.A,{className:"w-5 h-5 text-warning flex-shrink-0"}),(0,e.jsx)("div",{className:"flex-1 min-w-0",children:(0,e.jsxs)("span",{className:"text-sm",children:[d("branchMismatch.changedFrom")," ",(0,e.jsx)("span",{className:"font-medium",children:c})," ",d("branchMismatch.to")," ",(0,e.jsx)("span",{className:"font-medium",children:b})]})}),(0,e.jsx)("button",{type:"button",onClick:()=>g(!0),className:"p-1 rounded hover:bg-warning-subtle transition-colors","aria-label":d("branchMismatch.dismiss"),children:(0,e.jsx)(as.A,{className:"w-4 h-4"})})]})}),fy=(0,x.A)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),fz=(0,h.memo)(function({isOpen:a,onClose:b,onConfirm:c,worktreeId:d,sourcePath:f,sourceType:g}){let i=(0,k.c)("worktree"),j=(0,k.c)("common"),[l,m]=(0,h.useState)(""),[o,p]=(0,h.useState)(new Set([""])),[q,r]=(0,h.useState)([]),[s,t]=(0,h.useState)(!1),[u,v]=(0,h.useState)(new Set),w=f.includes("/")?f.substring(0,f.lastIndexOf("/")):"";(0,h.useEffect)(()=>{a&&(m(w),p(new Set([""])),r([]),x())},[a,d]);let x=(0,h.useCallback)(async()=>{t(!0);try{let a=await fetch(`/api/worktrees/${d}/tree`);if(!a.ok)return;let b=(await a.json()).items.filter(a=>"directory"===a.type).map(a=>({name:a.name,path:a.name,loaded:!1}));r(b)}catch{}finally{t(!1)}},[d]),y=(0,h.useCallback)(async a=>{v(b=>new Set(b).add(a));try{let b=await fetch(`/api/worktrees/${d}/tree/${a}`);if(!b.ok)return;let c=(await b.json()).items.filter(a=>"directory"===a.type).map(b=>({name:b.name,path:`${a}/${b.name}`,loaded:!1}));r(b=>(function a(b,c,d){return b.map(b=>b.path===c?{...b,children:d,loaded:!0}:b.children?{...b,children:a(b.children,c,d)}:b)})(b,a,c))}catch{}finally{v(b=>{let c=new Set(b);return c.delete(a),c})}},[d]),A=(0,h.useCallback)(async a=>{p(b=>{let c=new Set(b);return c.has(a)?c.delete(a):c.add(a),c});let b=function a(b,c){for(let d of b){if(d.path===c)return d;if(d.children){let b=a(d.children,c);if(b)return b}}return null}(q,a);b&&!b.loaded&&await y(a)},[q,y]),B=(0,h.useCallback)(a=>!(a===w||"directory"===g&&(a===f||a.startsWith(f+"/")))&&!0,[w,f,g]),C=(a,b=0)=>{let c=o.has(a.path),d=l===a.path,f=u.has(a.path),g=B(a.path);return(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:`flex items-center gap-1 py-1.5 px-2 cursor-pointer rounded text-sm transition-colors ${d?"bg-accent-100 text-accent-800":"hover:bg-muted text-foreground"} ${!g?"opacity-40 cursor-not-allowed":""}`,style:{paddingLeft:`${.5+1.25*b}rem`},onClick:()=>{g&&m(a.path)},children:[(0,e.jsx)("button",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",onClick:b=>{b.stopPropagation(),A(a.path)},children:f?(0,e.jsx)(n.y$,{size:"xs",variant:"muted"}):(0,e.jsx)(bL,{className:`w-3 h-3 text-muted-foreground transition-transform ${c?"rotate-90":""}`})}),c?(0,e.jsx)(fy,{className:"w-4 h-4 text-warning flex-shrink-0"}):(0,e.jsx)(z.A,{className:"w-4 h-4 text-warning flex-shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:a.name})]}),c&&a.children&&(0,e.jsx)("div",{children:a.children.map(a=>C(a,b+1))})]},a.path)},D=B(l);return(0,e.jsx)(a5.a,{isOpen:a,onClose:b,title:i("fileTree.moveDialogTitle"),size:"md",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"text-sm text-muted-foreground",children:[i("fileTree.moveTo"),": ",(0,e.jsx)("span",{className:"font-mono text-foreground",children:f})]}),(0,e.jsxs)("div",{className:"border border-border rounded-lg max-h-64 overflow-y-auto p-2",children:[(0,e.jsxs)("div",{className:`flex items-center gap-1 py-1.5 px-2 cursor-pointer rounded text-sm transition-colors ${""===l?"bg-accent-100 text-accent-800":"hover:bg-muted text-foreground"} ${!B("")?"opacity-40 cursor-not-allowed":""}`,onClick:()=>{B("")&&m("")},children:[(0,e.jsx)("span",{className:"w-4 h-4"}),(0,e.jsx)(z.A,{className:"w-4 h-4 text-warning flex-shrink-0"}),(0,e.jsx)("span",{children:i("fileTree.rootDirectory")})]}),s?(0,e.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,e.jsx)(n.y$,{size:"md",variant:"muted"})}):q.map(a=>C(a,1))]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)(n.$n,{variant:"ghost",onClick:b,className:"px-4 py-2 text-sm text-foreground bg-white border border-border rounded-md hover:bg-muted transition-colors",children:j("cancel")}),(0,e.jsx)(n.$n,{variant:"ghost",onClick:()=>c(l),disabled:!D,className:"px-4 py-2 text-sm text-white bg-accent-600 rounded-md hover:bg-accent-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:i("fileTree.moveConfirm")})]})]})})});function fA(a,b){let c=a.trim();return c?0>=c.lastIndexOf(".")?c+b:c:""}let fB=(0,h.memo)(function({isOpen:a,parentPath:b,onConfirm:c,onCancel:d}){let f=(0,k.c)("worktree"),g=(0,k.c)("common"),[i,j]=(0,h.useState)(""),[l,m]=(0,h.useState)(".md"),n=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(a){j(""),m(".md");let a=setTimeout(()=>{n.current?.focus()},100);return()=>clearTimeout(a)}},[a]);let o=(0,h.useCallback)(()=>{let a=fA(i,l);a&&c(a)},[i,l,c]),p=(0,h.useCallback)(a=>{"Enter"===a.key&&(a.preventDefault(),o())},[o]),q=fA(i,l),r=b?`${b}/${q}`:q;return(0,e.jsx)(a5.a,{isOpen:a,onClose:d,title:f("newFileDialog.title"),size:"sm",children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{htmlFor:"new-file-name",className:"block text-sm font-medium text-foreground mb-1",children:f("newFileDialog.fileNameLabel")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)("input",{ref:n,id:"new-file-name","data-testid":"new-file-name-input",type:"text",value:i,onChange:a=>j(a.target.value),onKeyDown:p,placeholder:f("newFileDialog.placeholder"),className:"flex-1 px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent"}),(0,e.jsx)("select",{"data-testid":"new-file-ext-select",value:l,onChange:a=>m(a.target.value),className:"px-3 py-2 border border-input rounded-lg bg-surface text-foreground text-sm focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent",children:eN.map(a=>(0,e.jsx)("option",{value:a,children:a},a))})]})]}),q&&(0,e.jsx)("div",{className:"text-xs text-muted-foreground font-mono bg-muted rounded px-2 py-1",children:r}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)("button",{type:"button",onClick:d,className:"px-4 py-2 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg transition-colors",children:g("cancel")}),(0,e.jsx)("button",{type:"button","data-testid":"new-file-confirm-button",onClick:o,disabled:!q,className:"px-4 py-2 text-sm font-medium text-white bg-accent-600 hover:bg-accent-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-lg transition-colors",children:f("newFileDialog.create")})]})]})})}),fC=(0,h.memo)(function({worktreeId:a,worktree:b,worktreeName:c,worktreeStatus:d,instances:f,rosterReady:g,activeInstanceId:j,setActiveInstanceId:l,hasUpdate:m,lastAutoResponse:n,activeActivity:o,onActivityToggle:p,onBackClick:q,onInfoClick:r,onWorktreeStatusChange:s,pendingInsertTextMap:t,setFocusedSplitIndex:u,handleInsertToSplit:v,handleInsertConsumed:w,handleInsertToMessage:x,autoYesStateMap:y,makeAutoYesToggleHandler:z,showArchived:A,onShowArchivedChange:B,historyDisplayLimit:C,onHistoryDisplayLimitChange:D,historyUserOnly:E,onHistoryUserOnlyChange:G,onMessageSent:H,onFilePathClick:I,showToast:J,tabsState:K,tabsActions:L,onLoadContent:M,onLoadError:N,onSetLoading:O,onFilePanelSave:P,onDirtyChange:Q,onOpenFile:R,diffContent:S,diffFilePath:T,onCloseDiff:U,fileSearch:V,fileTreeRefresh:W,onFileSelect:X,onNewFile:Y,onNewDirectory:Z,onRename:$,onDelete:_,onUpload:aa,onMove:ab,onFileTreeReset:ac,onDiffSelect:ad,onAgentInstancesChange:ae,vibeLocalModel:af,onVibeLocalModelChange:ag,vibeLocalContextWindow:ah,onVibeLocalContextWindowChange:ai,isInfoModalOpen:aj,onInfoModalClose:ak,onWorktreeUpdate:al,fileInputRef:am,onFileInputChange:an,onKillSession:ao,onRequestSessionEnd:ap,killTarget:aq,isKillPending:ar,onKillCancel:as,onKillConfirm:at,moveTarget:au,isMoveDialogOpen:av,onMoveCancel:aw,onMoveConfirm:ax,showNewFileDialog:ay,newFileParentPath:az,onNewFileConfirm:aA,onNewFileCancel:aB,killDialogTitle:aC,killDialogWarning:aD,cancelLabel:aE,endLabel:aF}){let aG=(0,k.c)("worktree"),[aH,aI]=i().useState(null),aJ=(0,h.useCallback)(a=>aI(a),[]),aK=(0,h.useCallback)(()=>aI(null),[]),[aL,aM]=i().useState(null),aN=i().useRef(0),aO=(0,h.useCallback)(a=>{l(a),aN.current+=1,aM({instanceId:a,token:aN.current})},[l]),aP=(0,h.useCallback)(({splitIndex:c,cliToolId:d,instanceId:f,instance:g,availableInstances:h,onInstanceChange:i,onFocus:j,onDropInstance:k})=>{let m=t.get(c)??null,o=y.get(f),p=o?.enabled??!1,q=o?.expiresAt??null,r=(0,a6.kA)(b?.sessionStatusByInstance?.[f]??b?.sessionStatusByCli?.[d]);return(0,e.jsx)(fv,{worktreeId:a,splitIndex:c,cliToolId:d,instanceId:f,instance:g,availableInstances:h,onInstanceChange:a=>{i(a),0===c&&l(a)},onFocus:j,pendingInsertText:m,onInsertConsumed:()=>w(c),onMessageSent:H,cliStatus:r,autoYes:{enabled:p,expiresAt:q,lastAutoResponse:n,onToggle:z(d,f)},history:{showArchived:A,onShowArchivedChange:B,historyDisplayLimit:C,onHistoryDisplayLimitChange:D,historyUserOnly:E,onHistoryUserOnlyChange:G,onInsertToMessage:a=>v(c,a),onFilePathClick:I,showToast:J},onDropInstance:k,draggedInstanceId:aH,onRequestSessionEnd:ap})},[a,t,y,w,H,l,n,z,b?.sessionStatusByCli,b?.sessionStatusByInstance,I,J,v,A,B,C,D,E,G,aH,ap]),aQ=(0,h.useMemo)(()=>(0,e.jsx)(ff,{worktreeId:a,instances:f,rosterReady:g,renderPane:aP,onFocusedSplitChange:u,showToast:J,onActiveInstanceChange:l,headerInstanceSelection:aL}),[a,f,g,aP,u,J,l,aL]),aR=(0,h.useMemo)(()=>(0,e.jsx)(e8,{terminal:aQ,terminalHeader:null,fileTabs:K,worktreeId:a,onCloseTab:L.closeTab,onActivateTab:L.activateTab,onLoadContent:M,onLoadError:N,onSetLoading:O,onFileSaved:P,diffContent:S,diffFilePath:T,onCloseDiff:U,onDirtyChange:Q,onMoveToFront:L.moveToFront,onOpenFile:R}),[aQ,K,a,L.closeTab,L.activateTab,M,N,O,P,S,T,U,Q,L.moveToFront,R]),aS=(0,h.useMemo)(()=>(0,e.jsx)(eG,{active:o,onToggle:p}),[o,p]),aT=(0,h.useMemo)(()=>({files:(0,e.jsxs)("div",{className:"h-full flex flex-col",children:[(0,e.jsx)(cS,{query:V.query,mode:V.mode,isSearching:V.isSearching,error:V.error,onQueryChange:V.setQuery,onModeChange:V.setMode,onClear:V.clearSearch}),(0,e.jsx)(cO,{worktreeId:a,onFileSelect:X,onNewFile:Y,onNewDirectory:Z,onRename:$,onDelete:_,onUpload:aa,onMove:ab,onResetView:ac,refreshTrigger:W,pollingEnabled:"files"===o,searchQuery:V.query,searchMode:V.mode,searchResults:V.results?.results,className:"flex-1 min-h-0"})]}),git:(0,e.jsx)(ek,{worktreeId:a,onDiffSelect:ad,isMobile:!1,worktree:b??void 0,onInsertToMessage:x,className:"h-full"}),notes:(0,e.jsx)(cY,{worktreeId:a,className:"h-full",onInsertToMessage:x}),schedules:(0,e.jsx)(du,{worktreeId:a,className:"h-full",onInsertToMessage:x,instances:f}),agent:(0,e.jsx)(dB,{worktreeId:a,instances:f,onInstancesChange:ae,vibeLocalModel:af,onVibeLocalModelChange:ag,vibeLocalContextWindow:ah,onVibeLocalContextWindowChange:ai}),timer:(0,e.jsx)(dM,{worktreeId:a,instances:f}),todo:(0,e.jsx)(c1,{worktreeId:a,className:"h-full"})}),[a,b,o,V.query,V.mode,V.isSearching,V.error,V.setQuery,V.setMode,V.clearSearch,V.results?.results,X,Y,Z,$,_,aa,ab,ac,W,ad,x,f,ae,af,ag,ah,ai]),aU=(0,h.useMemo)(()=>null===o?null:(0,e.jsx)(eJ,{active:o,activities:aT}),[o,aT]);return(0,e.jsx)(F,{componentName:"WorktreeDetailRefactored",children:(0,e.jsxs)("div",{className:"flex h-full overflow-hidden relative",children:[aS,(0,e.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 min-w-0",children:[(0,e.jsx)(er,{worktreeName:c,repositoryName:b?.repositoryDisplayName??b?.repositoryName??aG("detail.unknownRepository"),description:b?.description,status:d,gitStatus:b?.gitStatus,onBackClick:q,onInfoClick:r,hasUpdate:m,worktreeStatus:b?.status??null,onWorktreeStatusChange:s,sessionStatusByCli:b?.sessionStatusByCli,sessionStatusByInstance:b?.sessionStatusByInstance,instances:f,activeInstanceId:j,onActiveInstanceChange:aO,onAgentDragStart:aJ,onAgentDragEnd:aK,onKillSession:ao}),b?.gitStatus&&(0,e.jsx)(fx,{isBranchMismatch:b.gitStatus.isBranchMismatch,currentBranch:b.gitStatus.currentBranch,initialBranch:b.gitStatus.initialBranch}),(0,e.jsx)("div",{className:"flex-1 min-h-0 min-w-0",children:(0,e.jsx)(ev,{activityPane:aU,rightPane:(0,e.jsx)(ck,{terminal:aR})})})]}),(0,e.jsx)(es,{worktreeId:a,worktree:b,isOpen:aj,onClose:ak,onWorktreeUpdate:al}),(0,e.jsx)("input",{ref:am,type:"file",accept:eM.join(","),onChange:an,className:"hidden","aria-label":aG("detail.uploadFile")}),(0,e.jsx)(a5.a,{isOpen:null!==aq,onClose:as,title:aC,size:"sm",showCloseButton:!0,children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("p",{className:"text-sm text-foreground",children:aD}),(0,e.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,e.jsx)("button",{type:"button",onClick:as,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:aE}),(0,e.jsx)("button",{type:"button",onClick:at,disabled:ar,"data-testid":"kill-session-confirm-button",className:"px-4 py-2 text-sm font-medium rounded-md bg-danger hover:bg-danger/90 text-white disabled:opacity-60 disabled:cursor-not-allowed",children:aF})]})]})}),au&&(0,e.jsx)(fz,{isOpen:av,onClose:aw,onConfirm:ax,worktreeId:a,sourcePath:au.path,sourceType:au.type}),(0,e.jsx)(fB,{isOpen:ay,parentPath:az,onConfirm:aA,onCancel:aB})]})})});a7.oo;let fD={data:null,messageId:null,visible:!1,answering:!1},fE={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},fF={type:null,message:null,retryable:!1,retryCount:0};function fG(){return{phase:"idle",prompt:{...fD},layout:{...fE},error:{...fF},messages:[],wsConnected:!1}}function fH(a,b){switch(b.type){case"SET_PHASE":return{...a,phase:b.phase};case"SHOW_PROMPT":return{...a,phase:"prompt",prompt:{data:b.data,messageId:b.messageId,visible:!0,answering:!1}};case"CLEAR_PROMPT":return{...a,prompt:{...fD}};case"SET_PROMPT_ANSWERING":return{...a,prompt:{...a.prompt,answering:b.answering}};case"SET_LAYOUT_MODE":return{...a,layout:{...a.layout,mode:b.mode}};case"SET_MOBILE_ACTIVE_PANE":return{...a,layout:{...a.layout,mobileActivePane:b.pane}};case"SET_SPLIT_RATIO":return{...a,layout:{...a.layout,splitRatio:b.ratio}};case"SET_LEFT_PANE_TAB":return{...a,layout:{...a.layout,leftPaneTab:b.tab}};case"TOGGLE_LEFT_PANE":return{...a,layout:{...a.layout,leftPaneCollapsed:!a.layout.leftPaneCollapsed}};case"SET_LEFT_PANE_COLLAPSED":return{...a,layout:{...a.layout,leftPaneCollapsed:b.collapsed}};case"SET_ACTIVE_ACTIVITY":return{...a,layout:{...a.layout,activityBar:{...a.layout.activityBar,active:b.activity}}};case"TOGGLE_ACTIVITY":{let c=a.layout.activityBar.active===b.activity?null:b.activity;return{...a,layout:{...a.layout,activityBar:{...a.layout.activityBar,active:c}}}}case"TOGGLE_HISTORY_PANE":{let b=!a.layout.historyPane.visible;return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,visible:b,collapsed:!b}}}}case"SET_HISTORY_PANE_VISIBLE":return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,visible:b.visible,collapsed:!b.visible}}};case"SET_HISTORY_WIDTH":return{...a,layout:{...a.layout,historyPane:{...a.layout.historyPane,width:b.width}}};case"SET_ERROR":return{...a,error:b.error};case"CLEAR_ERROR":return{...a,error:{...fF}};case"INCREMENT_RETRY_COUNT":return{...a,error:{...a.error,retryCount:a.error.retryCount+1}};case"SET_MESSAGES":return{...a,messages:b.messages};case"ADD_MESSAGE":return{...a,messages:[...a.messages,b.message]};case"UPDATE_MESSAGE":return{...a,messages:a.messages.map(a=>a.id===b.id?{...a,...b.updates}:a)};case"CLEAR_MESSAGES":return{...a,messages:[]};case"SET_WS_CONNECTED":return{...a,wsConnected:b.connected};default:return a}}var fI=c(63157);function fJ(a){let b=a.split("/");return b[b.length-1]||a}function fK(a,b,c){let d=a.findIndex(a=>a.path===b);if(-1===d)return null;let e=[...a];return e[d]=c(e[d]),e}let fL={tabs:[],activeIndex:null};var fM=c(4267);let fN="activeCliTab-",fO="activeInstanceId-";function fP(){let a=(0,k.c)("worktree");return(0,e.jsxs)("div",{className:"flex items-center justify-center h-full bg-surface text-muted-foreground",children:[(0,e.jsx)(m.y,{size:"lg",className:"mr-2"}),(0,e.jsx)("span",{children:a("detail.loadingEditor")})]})}let fQ=(0,j.default)(async()=>{},{loadableGenerated:{modules:["components/worktree/WorktreeDetailRefactored.tsx -> @/components/worktree/MarkdownEditor"]},ssr:!1,loading:()=>(0,e.jsx)(fP,{})}),fR=()=>{},fS=["terminal","history","files","memo","info"],fT=(0,h.memo)(function({worktreeId:a}){let{activeActivity:b,activeCliTab:c,activeInstanceId:d,activeTab:g,agentInstances:i,autoYesEnabled:j,autoYesExpiresAt:m,autoYesStateMap:n,diffContent:p,diffFilePath:r,disableAutoFollow:s,displayedInstances:t,editorFilePath:u,error:w,fetchCurrentOutput:x,fileInputRef:y,fileSearch:z,fileTreeRefresh:A,handleActivityToggle:B,handleAgentInstancesChange:C,handleAutoYesToggle:D,handleBackClick:G,handleCloseDiff:H,handleDelete:I,handleDiffSelect:J,handleDirtyChange:L,handleEditorClose:N,handleEditorSave:O,handleFileInputChange:P,handleFilePanelSave:Q,handleFilePathClick:R,handleFileSelect:U,handleHistoryDisplayLimitChange:V,handleHistoryUserOnlyChange:W,handleInfoClick:X,handleInfoModalClose:Y,handleInsertConsumed:Z,handleInsertConsumedSingle:$,handleInsertToMessage:_,handleInsertToSplit:aa,handleKillCancel:ac,handleKillConfirm:ad,openKillConfirm:ae,openActiveKillConfirm:af,killTarget:ah,isKillPending:ai,handleLoadContent:aj,handleLoadError:ak,handleMessageSent:an,handleMobileFileViewerClose:ao,handleMobileTabChange:ap,handleMove:aq,handleMoveCancel:ar,handleMoveConfirm:as,handleNewDirectory:at,handleNewFile:au,handleNewFileCancel:av,handleNewFileConfirm:aw,handleOpenFile:ax,handlePromptDismiss:ay,handlePromptRespond:az,handleRename:aA,handleRetry:aC,handleSetLoading:aD,handleShowArchivedChange:aE,handleUpload:aF,handleVibeLocalContextWindowChange:aG,handleVibeLocalModelChange:aH,handleWorktreeStatusChange:aI,hasUpdate:aJ,historyDisplayLimit:aK,historySubTab:aL,historyUserOnly:aM,isEditorMaximized:aN,isInfoModalOpen:aO,isMobile:aQ,isMoveDialogOpen:aR,isSelectionListActive:aS,isPagerActive:aT,lastAutoResponse:aV,loading:aX,makeAutoYesToggleHandler:aY,mobileFileViewerPath:aZ,mobileSelectedAgents:a$,moveTarget:a_,newFileParentPath:a0,openMobileDrawer:a1,pendingInsertText:a2,pendingInsertTextMap:a3,rosterReady:a4,setActiveInstanceId:a8,setEditorFilePath:a9,setFocusedSplitIndex:ba,setHistorySubTab:bb,setIsEditorMaximized:bc,setWorktree:bd,showArchived:be,showNewFileDialog:bf,showToast:bg,state:bh,tCommon:bi,tWorktree:bj,tabsActions:bk,tabsState:bl,resetFileTreeView:bm,toggleInstanceVisible:bn,vibeLocalContextWindow:bo,vibeLocalModel:bq,visibleInstanceIds:br,worktree:bs,worktreeName:bt,worktreeStatus:bu}=function({worktreeId:a}){let b=(0,f.useRouter)(),c=(0,ab.a)(),d=(0,h.useRef)(c);d.current=c;let{openMobileDrawer:e}=(0,eF.VF)(),{state:g,actions:i}=function(){let[a,b]=(0,h.useReducer)(fH,void 0,fG),{value:c,setValue:d}=(0,dP.V)({key:"commandmate.worktree.leftPaneCollapsed",defaultValue:!1,validate:a=>"boolean"==typeof a}),e=(0,h.useRef)(a.layout.leftPaneCollapsed);e.current=a.layout.leftPaneCollapsed,(0,h.useRef)(!1);let f=(0,h.useMemo)(()=>({setPhase:a=>b({type:"SET_PHASE",phase:a}),showPrompt:(a,c)=>b({type:"SHOW_PROMPT",data:a,messageId:c}),clearPrompt:()=>b({type:"CLEAR_PROMPT"}),setPromptAnswering:a=>b({type:"SET_PROMPT_ANSWERING",answering:a}),setError:a=>b({type:"SET_ERROR",error:a}),clearError:()=>b({type:"CLEAR_ERROR"}),setMessages:a=>b({type:"SET_MESSAGES",messages:a}),addMessage:a=>b({type:"ADD_MESSAGE",message:a}),updateMessage:(a,c)=>b({type:"UPDATE_MESSAGE",id:a,updates:c}),clearMessages:()=>b({type:"CLEAR_MESSAGES"}),setMobileActivePane:a=>b({type:"SET_MOBILE_ACTIVE_PANE",pane:a}),setLeftPaneTab:a=>b({type:"SET_LEFT_PANE_TAB",tab:a}),setLayoutMode:a=>b({type:"SET_LAYOUT_MODE",mode:a}),setSplitRatio:a=>b({type:"SET_SPLIT_RATIO",ratio:a}),setWsConnected:a=>b({type:"SET_WS_CONNECTED",connected:a}),toggleLeftPane:()=>{let a=!e.current;b({type:"SET_LEFT_PANE_COLLAPSED",collapsed:a}),d(a)},setActiveActivity:a=>b({type:"SET_ACTIVE_ACTIVITY",activity:a}),toggleActivity:a=>b({type:"TOGGLE_ACTIVITY",activity:a}),toggleHistoryPane:()=>b({type:"TOGGLE_HISTORY_PANE"}),setHistoryPaneVisible:a=>b({type:"SET_HISTORY_PANE_VISIBLE",visible:a}),setHistoryWidth:a=>b({type:"SET_HISTORY_WIDTH",width:a})}),[d]);return{state:a,dispatch:b,actions:f}}(),j=(0,k.c)("worktree"),l=(0,k.c)("error"),m=(0,k.c)("common");(0,k.c)("autoYes");let n=(0,am.SC)(),o=(0,fI.rC)(),p=o?.worktrees.find(b=>b.id===a)??null,[r,s]=(0,h.useState)(p),[t,u]=(0,h.useState)(null===p),[v,w]=(0,h.useState)(null);(0,h.useRef)(null!==p);let[x,y]=(0,h.useState)(!1),[z,A]=function(a){let[b,c]=(0,h.useReducer)(function a(b,c){switch(c.type){case"OPEN_FILE":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1!==a){if(b.activeIndex===a)return b;return{...b,activeIndex:a}}if(b.tabs.length>=30)return b;let d={path:c.path,name:fJ(c.path),content:null,loading:!1,error:null,isDirty:!1},e=[...b.tabs,d];return{tabs:e,activeIndex:e.length-1}}case"CLOSE_TAB":{var d,e;let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a)return b;let f=b.tabs.filter((b,c)=>c!==a),g=(d=b.activeIndex,0===(e=f.length)||null===d?null:a<d?d-1:a===d?Math.min(a,e-1):d);return{tabs:f,activeIndex:g}}case"ACTIVATE_TAB":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a||b.activeIndex===a)return b;return{...b,activeIndex:a}}case"SET_CONTENT":{let a=fK(b.tabs,c.path,a=>({...a,content:c.content,loading:!1,error:null,isDirty:!1}));if(!a)return b;return{...b,tabs:a}}case"SET_LOADING":{let a=fK(b.tabs,c.path,a=>({...a,loading:c.loading}));if(!a)return b;return{...b,tabs:a}}case"SET_ERROR":{let a=fK(b.tabs,c.path,a=>({...a,error:c.error,loading:!1}));if(!a)return b;return{...b,tabs:a}}case"RENAME_FILE":{let a=b.tabs.findIndex(a=>a.path===c.oldPath);if(-1===a)return b;let d=[...b.tabs];return d[a]={...d[a],path:c.newPath,name:fJ(c.newPath)},{...b,tabs:d}}case"DELETE_FILE":return a(b,{type:"CLOSE_TAB",path:c.path});case"RESTORE":{let a=c.paths.slice(0,30).map(a=>({path:a,name:fJ(a),content:null,loading:!1,error:null,isDirty:!1}));if(0===a.length)return fL;let b=c.activePath?Math.max(0,a.findIndex(a=>a.path===c.activePath)):0;return{tabs:a,activeIndex:b}}case"SET_DIRTY":{let a=b.tabs.find(a=>a.path===c.path);if(a&&a.isDirty===c.isDirty)return b;let d=fK(b.tabs,c.path,a=>({...a,isDirty:c.isDirty}));if(!d)return b;return{...b,tabs:d}}case"MOVE_TO_FRONT":{let a=b.tabs.findIndex(a=>a.path===c.path);if(-1===a||0===a)return b;return{tabs:[b.tabs[a],...b.tabs.filter((b,c)=>c!==a)],activeIndex:0}}case"CLOSE_ALL":if(0===b.tabs.length)return b;return fL;default:return b}},fL);(0,h.useRef)(!1),(0,h.useRef)(a);let d=(0,h.useRef)(b);d.current=b;let e=(0,h.useCallback)(a=>{let b=d.current.tabs;return -1!==b.findIndex(b=>b.path===a)?(c({type:"OPEN_FILE",path:a}),"activated"):b.length>=30?"limit_reached":(c({type:"OPEN_FILE",path:a}),"opened")},[]),f=(0,h.useCallback)(a=>{c({type:"CLOSE_TAB",path:a})},[]),g=(0,h.useCallback)(a=>{c({type:"ACTIVATE_TAB",path:a})},[]),i=(0,h.useCallback)((a,b)=>{c({type:"RENAME_FILE",oldPath:a,newPath:b})},[]),j=(0,h.useCallback)(a=>{c({type:"DELETE_FILE",path:a})},[]),k=(0,h.useCallback)(a=>{c({type:"MOVE_TO_FRONT",path:a})},[]),l=(0,h.useCallback)(()=>{c({type:"CLOSE_ALL"})},[]),m=(0,h.useMemo)(()=>({dispatch:c,openFile:e,closeTab:f,activateTab:g,onFileRenamed:i,onFileDeleted:j,moveToFront:k,closeAllTabs:l}),[c,e,f,g,i,j,k,l]);return[b,m]}(a),[B,C]=(0,h.useState)(null),[D,E]=(0,h.useState)(null),[F,G]=(0,h.useState)(!1),[H,I]=(0,h.useState)(new Map),[J,K]=(0,h.useState)(null),[L,M]=(0,h.useState)(!1),[N,O]=(0,h.useState)(!1),[P,Q]=(0,h.useState)(!1),R=(0,h.useRef)(!1),[S,U]=(0,h.useState)(null),[V,W]=(0,h.useState)(fM.fJ),X=(0,h.useRef)(V);X.current=V;let[Y,Z]=(0,h.useState)(()=>(0,a7.lu)(fM.fJ)),$=(0,h.useRef)(Y);$.current=Y;let[_,aa]=(0,h.useState)(null),ac=_===a,[ad,ae]=(0,h.useState)(null),[af,ag]=(0,h.useState)(null),[ah,ai]=(0,h.useState)(()=>{try{let b=window.localStorage.getItem(fN+a);if(b&&(0,a7.hR)(b))return b}catch{}return fM.fJ[0]}),aj=(0,h.useCallback)(b=>{ai(b);try{window.localStorage.setItem(fN+a,b)}catch{}},[a]),ak=(0,h.useRef)(ah);ak.current=ah;let[al,an]=(0,h.useState)(()=>{try{let b=window.localStorage.getItem(fO+a);if(b&&(0,a7.n6)(b))return b;let c=window.localStorage.getItem(fN+a);if(c&&(0,a7.hR)(c))return c}catch{}return fM.fJ[0]}),ao=(0,h.useCallback)(b=>{an(b);try{window.localStorage.setItem(fO+a,b)}catch{}let c=$.current.find(a=>a.id===b);c&&aj(c.cliTool)},[a,aj]),ap=(0,h.useRef)(al);ap.current=al;let aq=(0,h.useRef)(0),ar=(0,h.useRef)(0),as=(0,h.useRef)(0),at=H.get(al)?.enabled??!1,au=H.get(al)?.expiresAt??null,[av,aw]=(0,h.useState)(0),[ax,ay]=(0,h.useState)(!1),[az,aA]=(0,h.useState)(""),{active:aC,toggle:aD}=function(a){let[b,c]=(0,h.useState)("files"),d=(0,h.useRef)(b);d.current=b;let e=(0,h.useRef)(a);return e.current=a,{active:b,setActive:(0,h.useCallback)(a=>{c(a),e.current},[]),toggle:(0,h.useCallback)(a=>{if(d.current===a){c(null),e.current;return}c(a),e.current},[])}}(a),{historySubTab:aE,setHistorySubTab:aF,showArchived:aG,handleShowArchivedChange:aH,historyUserOnly:aI,handleHistoryUserOnlyChange:aJ,historyDisplayLimit:aK,handleHistoryDisplayLimitChange:aL}=function(){let[a,b]=(0,h.useState)("message"),[c,d]=(0,h.useState)(()=>!1),e=(0,h.useCallback)(a=>{d(a),localStorage.setItem("commandmate:showArchived",String(a))},[]),[f,g]=(0,h.useState)(()=>!1),i=(0,h.useCallback)(a=>{g(a);try{localStorage.setItem("commandmate:historyUserOnly",String(a))}catch{}},[]),[j,k]=(0,h.useState)(()=>50);return{historySubTab:a,setHistorySubTab:b,showArchived:c,handleShowArchivedChange:e,historyUserOnly:f,handleHistoryUserOnlyChange:i,historyDisplayLimit:j,handleHistoryDisplayLimitChange:(0,h.useCallback)(a=>{k(a);try{localStorage.setItem("commandmate:historyDisplayLimit",String(a))}catch{}},[])}}(),aM=(0,h.useRef)(aG),aN=(0,h.useRef)(aK),{pendingInsertTextMap:aO,pendingInsertText:aP,setFocusedSplitIndex:aQ,handleInsertToMessage:aR,handleInsertToSplit:aS,handleInsertConsumed:aT,handleInsertConsumedSingle:aV}=function(){let[a,b]=(0,h.useState)(()=>new Map),[c,d]=(0,h.useState)(0),e=(0,h.useCallback)(a=>{b(b=>{let d=new Map(b);return d.set(c,a),d})},[c]),f=(0,h.useCallback)((a,c)=>{b(b=>{let d=new Map(b);return d.set(a,c),d})},[]),g=(0,h.useCallback)(a=>{b(b=>{if(!b.has(a))return b;let c=new Map(b);return c.delete(a),c})},[]),i=a.get(0)??null,j=(0,h.useCallback)(()=>g(0),[g]);return{pendingInsertTextMap:a,pendingInsertText:i,focusedSplitIndex:c,setFocusedSplitIndex:d,handleInsertToMessage:e,handleInsertToSplit:f,handleInsertConsumed:g,handleInsertConsumedSingle:j}}(),{diffContent:aX,diffFilePath:aY,handleDiffSelect:aZ,handleCloseDiff:a$}=function(a){let[b,c]=(0,h.useState)(null),[d,e]=(0,h.useState)(null);return{diffContent:b,diffFilePath:d,handleDiffSelect:(0,h.useCallback)((b,d)=>{a||(c(b),e(d))},[a]),handleCloseDiff:(0,h.useCallback)(()=>{c(null),e(null)},[])}}(c),a_=function(a){let{worktreeId:b,initialMode:c="name",debounceMs:d=300}=a,[e,f]=(0,h.useState)(""),[g,i]=(0,h.useState)(""),[j,k]=(0,h.useState)(c),[l,m]=(0,h.useState)(!1),[n,o]=(0,h.useState)(null),[p,r]=(0,h.useState)(null),s=(0,h.useRef)(null),t=(0,h.useMemo)(()=>{var a;let b;return a=a=>{i(a)},b=null,(...c)=>{b&&clearTimeout(b),b=setTimeout(()=>{a(...c),b=null},d)}},[d]),u=(0,h.useCallback)(a=>{f(a),t(a),r(null)},[t]),v=(0,h.useCallback)(()=>{f(""),i(""),o(null),r(null),m(!1),s.current&&(s.current.abort(),s.current=null)},[]),w=(0,h.useCallback)(a=>{if(!g.trim())return a;let b=g.toLowerCase();return a.filter(a=>a.name.toLowerCase().includes(b))},[g]),x=(0,h.useCallback)(()=>n&&0!==n.results.length?q(n.results.map(a=>a.filePath)):new Set,[n]);return{query:e,mode:j,isSearching:l,results:n,error:p,setQuery:u,setMode:k,clearSearch:v,filterByName:w,getMatchedPaths:x}}({worktreeId:a});(0,h.useRef)(!1),(0,h.useRef)(a);let a0=(0,h.useCallback)(async()=>{try{let b=await fetch(`/api/worktrees/${a}`);if(!b.ok)throw Error(`Failed to fetch worktree: ${b.status}`);let c=await b.json();if(s(c),c.selectedAgents){let a=X.current;c.selectedAgents.length===a.length&&c.selectedAgents.every((b,c)=>b===a[c])||W(c.selectedAgents)}if(c.agentInstances){let b=$.current,d=c.agentInstances;d.length===b.length&&d.every((a,c)=>a.id===b[c].id&&a.cliTool===b[c].cliTool&&a.alias===b[c].alias)||Z(d),aa(a)}return"vibeLocalModel"in c&&ae(c.vibeLocalModel??null),"vibeLocalContextWindow"in c&&ag(c.vibeLocalContextWindow??null),c}catch(a){return w(a instanceof Error?a.message:"Unknown error"),null}},[a]),a1=(0,h.useCallback)(async()=>{let b=ak.current,c=d.current,e=ap.current,f=++aq.current;try{let d=new URLSearchParams({cliTool:b,unit:"pairs"});c&&d.set("instance",e),aM.current&&d.set("includeArchived","true"),d.set("limit",String(aN.current));let g=await fetch(`/api/worktrees/${a}/messages?${d.toString()}`);if(!g.ok)throw Error(`Failed to fetch messages: ${g.status}`);let h=await g.json();if(aq.current!==f||ak.current!==b||c&&ap.current!==e)return;i.setMessages(h.map(a=>({...a,timestamp:new Date(a.timestamp)})))}catch(a){if(aq.current!==f||ak.current!==b||c&&ap.current!==e)return;console.error("[WorktreeDetailRefactored] Error fetching messages:",a)}},[a,i]),a2=(0,h.useCallback)(async()=>{let b=ak.current,c=d.current,e=ap.current,f=++ar.current;try{let d=c?`/api/worktrees/${a}/current-output?cliTool=${b}&instance=${encodeURIComponent(e)}`:`/api/worktrees/${a}/current-output?cliTool=${b}`,h=await fetch(d);if(!h.ok)return;let j=await h.json();if(ar.current!==f||ak.current!==b||c&&ap.current!==e||j.cliToolId&&j.cliToolId!==b)return;if(j.isPromptWaiting&&j.promptData?i.showPrompt(j.promptData,`prompt-${Date.now()}`):!j.isPromptWaiting&&g.prompt.visible&&i.clearPrompt(),O(j.isSelectionListActive??!1),Q(j.isPagerActive??!1),K(j.lastServerResponseTimestamp??null),M(j.serverPollerActive??!1),j.autoYes){let a=R.current,d=j.autoYes,f=c?e:b;I(a=>{let b=new Map(a);return b.set(f,{enabled:d.enabled,expiresAt:d.expiresAt}),b}),R.current=d.enabled,a&&!j.autoYes.enabled&&("stop_pattern_matched"===j.autoYes.stopReason||"consecutive_errors"===j.autoYes.stopReason)&&U(j.autoYes.stopReason)}}catch(a){if(ar.current!==f||ak.current!==b||c&&ap.current!==e)return;console.error("[WorktreeDetailRefactored] Error fetching current output:",a)}},[a,i,g.prompt.visible]);(0,h.useCallback)(async()=>{let b=++as.current;try{let c=await fetch(`/api/worktrees/${a}/auto-yes`);if(!c.ok)return;let d=await c.json();if(as.current!==b)return;let e=d?.instances;if(!e||"object"!=typeof e)return;let f=new Map;for(let[a,b]of Object.entries(e))b&&"object"==typeof b&&f.set(a,{enabled:b.enabled??!1,expiresAt:b.expiresAt??null});I(f)}catch(a){if(as.current!==b)return;console.error("[WorktreeDetailRefactored] Error fetching auto-yes states:",a)}},[a]);let{visibleInstances:a3,visibleInstanceIds:a4,toggleInstanceVisible:a5}=function({worktreeId:a,roster:b}){let[c,d]=(0,h.useState)(null),e=(0,h.useMemo)(()=>dx(c,b),[c,b]),f=(0,h.useMemo)(()=>e.map(a=>a.id),[e]),g=(0,h.useMemo)(()=>null!==c&&b.some(a=>c.includes(a.id)),[c,b]),i=(0,h.useCallback)(a=>{let c=new Set(a),e=b.filter(a=>c.has(a.id)).map(a=>a.id);!(e.length<1)&&d(e)},[b,a]),j=(0,h.useCallback)(a=>i(a),[i]);return{visibleInstances:e,visibleInstanceIds:f,hasStoredPreference:g,toggleInstanceVisible:(0,h.useCallback)(a=>{let d=dx(c,b).map(a=>a.id);if(d.includes(a)){if(d.length<=1)return;i(d.filter(b=>b!==a))}else i([...d,a])},[c,b,i]),setVisibleInstanceIds:j,showInstances:(0,h.useCallback)(a=>{null!==c&&i([...dx(c,b).map(a=>a.id),...a])},[c,b,i])}}({worktreeId:a,roster:Y}),a6=c?a3:Y,a8=(0,h.useMemo)(()=>Array.from(new Set(a3.map(a=>a.cliTool))),[a3]),a9=c?a8:V,ba="opencode"===ah||"copilot"===ah,bb=(0,h.useCallback)(a=>{W(a)},[]),bc=(0,h.useCallback)(b=>{Z(b),aa(a)},[a]),bd=(0,h.useCallback)(a=>{ae(a)},[]),be=(0,h.useCallback)(a=>{ag(a)},[]);(0,h.useRef)(ah);let{showToast:bf}=(0,aU.dj)(),bg=(0,h.useCallback)(()=>{bf("Maximum 30 file tabs. Close a tab first.","info")},[bf]),bh=(0,h.useCallback)(a=>{c?C(a):"limit_reached"===A.openFile(a)&&bg()},[c,A,bg]),bi=(0,h.useCallback)(a=>{c?C(a):"limit_reached"===A.openFile(a)&&bg()},[c,A,bg]),bj=(0,h.useCallback)(a=>{"limit_reached"===A.openFile(a)&&bg()},[A,bg]),bk=(0,h.useCallback)(()=>{C(null)},[]),bl=(0,h.useCallback)(a=>{aw(a=>a+1)},[]),bm=(0,h.useCallback)(()=>{E(null)},[]),bn=(0,h.useCallback)(()=>{a_.clearSearch(),A.closeAllTabs(),C(null),E(null)},[a_,A]),bo=(0,h.useCallback)(a=>{aw(a=>a+1)},[]),bp=(0,h.useCallback)(a=>{aD(a)},[aD]),bq=(0,h.useCallback)(()=>{b.push("/")},[b]),br=(0,h.useCallback)(async b=>{try{let c=await fetch(`/api/worktrees/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:b})});if(c.ok){let a=await c.json();s(a)}}catch{}},[a]),bs=(0,h.useCallback)(()=>{y(!0)},[]),bt=(0,h.useCallback)(()=>{y(!1)},[]),bu=(0,h.useCallback)(async b=>{i.setPromptAnswering(!0);try{let c=fu(b,ah,g.prompt.data,d.current?ap.current:void 0),e=await fetch(`/api/worktrees/${a}/prompt-response`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!e.ok)throw Error(`Failed to send prompt response: ${e.status}`);i.clearPrompt(),await a2()}catch(a){console.error("[WorktreeDetailRefactored] Error sending prompt response:",a)}finally{i.setPromptAnswering(!1)}},[a,i,a2,ah,g.prompt.data]),bv=(0,h.useCallback)(()=>{i.clearPrompt()},[i]),bw=(0,h.useCallback)(a=>{i.setMobileActivePane(a)},[i]),bx=(0,h.useCallback)(()=>{a1(),a2()},[a1,a2]),by=(0,h.useCallback)((b,c)=>async d=>{let e=c??b;try{let c=await fetch(`/api/worktrees/${a}/auto-yes`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:d.enabled,cliToolId:b,instanceId:e,duration:d.duration,stopPattern:d.stopPattern})});if(c.ok){let a=await c.json();I(b=>{let c=new Map(b);return c.set(e,{enabled:a.enabled,expiresAt:a.expiresAt}),c}),e===ap.current&&(R.current=a.enabled)}}catch(a){console.error("[WorktreeDetailRefactored] Error toggling auto-yes:",a)}},[a]),bz=(0,h.useCallback)(a=>by(ah,al)(a),[by,ah,al]),[bA,bB]=(0,h.useState)(null),[bC,bD]=(0,h.useState)(!1),bE=(0,h.useRef)(!1),bF=(0,h.useCallback)(a=>{bB(a)},[]),bG=(0,h.useCallback)(()=>{let a=ap.current,b=ak.current,c=(0,a7.O6)($.current,a,b);bB({cliToolId:b,instanceId:a,label:c})},[]),bH=(0,h.useCallback)(async()=>{if(!bA||bE.current)return;bE.current=!0,bD(!0);let b=()=>{bA.instanceId===ap.current&&(i.clearMessages(),i.clearPrompt())};try{await T.y.killSession(a,bA.cliToolId,bA.instanceId),b(),await a0(),bB(null)}catch(a){a instanceof T.hD&&404===a.status?(b(),await a0(),bB(null)):bf(j("session.failedToKill"),"error")}finally{bE.current=!1,bD(!1)}},[bA,a,i,a0,bf,j]),bI=(0,h.useCallback)(()=>{bE.current||bB(null)},[]),bJ=(0,h.useCallback)(a=>{aA(a),ay(!0)},[]),bK=(0,h.useCallback)(async b=>{ay(!1);let c=az?`${az}/${b}`:b;try{if(!(await fetch(`/api/worktrees/${a}/files/${aB(c)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"file",content:""})})).ok)throw Error("Failed to create file");aw(a=>a+1)}catch{window.alert(l("fileOps.failedToCreateFile"))}},[a,az,l]),bL=(0,h.useCallback)(()=>{ay(!1)},[]),bM=(0,h.useCallback)(async b=>{let c=window.prompt("Enter directory name:");if(!c)return;let d=b?`${b}/${c}`:c;try{if(!(await fetch(`/api/worktrees/${a}/files/${aB(d)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"directory"})})).ok)throw Error("Failed to create directory");aw(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to create directory:",a),window.alert(l("fileOps.failedToCreateDirectory"))}},[a,l]),bN=(0,h.useCallback)(async b=>{let c=b.split("/").pop()||"",d=window.prompt("Enter new name:",c);if(d&&d!==c)try{if(!(await fetch(`/api/worktrees/${a}/files/${aB(b)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"rename",newName:d})})).ok)throw Error("Failed to rename");let c=b.includes("/")?b.substring(0,b.lastIndexOf("/")+1):"";A.onFileRenamed(b,`${c}${d}`),aw(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to rename:",a),window.alert(l("fileOps.failedToRename"))}},[a,A,l]),bO=(0,h.useCallback)(async b=>{let c=b.split("/").pop()||b;if(await n({description:m("confirmDelete",{name:c}),variant:"danger"}))try{if(!(await fetch(`/api/worktrees/${a}/files/${aB(b)}?recursive=true`,{method:"DELETE"})).ok)throw Error("Failed to delete");(D===b||D?.startsWith(`${b}/`))&&E(null),A.onFileDeleted(b),aw(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to delete:",a),window.alert(l("fileOps.failedToDelete"))}},[a,D,A,m,l,n]),{moveTarget:bP,isMoveDialogOpen:bQ,handleMove:bR,handleMoveConfirm:bS,handleMoveCancel:bT}=function(a,b,c,d){let[e,f]=(0,h.useState)(null),[g,i]=(0,h.useState)(!1),j=(0,h.useCallback)((a,b)=>{f({path:a,type:b}),i(!0)},[]),k=(0,h.useCallback)(async g=>{if(e)try{let f=await fetch(`/api/worktrees/${a}/files/${e.path}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"move",destination:g})}),h=await f.json();if(!f.ok||!h.success){let a=h.error?.message||"Failed to move";d?.(a);return}c?.("Moved successfully"),b()}catch{d?.("Failed to move")}finally{f(null),i(!1)}},[e,a,b,c,d]);return{moveTarget:e,isMoveDialogOpen:g,handleMove:j,handleMoveConfirm:k,handleMoveCancel:(0,h.useCallback)(()=>{f(null),i(!1)},[])}}(a,()=>aw(a=>a+1),a=>bf(a,"success"),a=>bf(a,"error")),bU=(0,h.useRef)(null),bV=(0,h.useRef)(""),bW=(0,h.useCallback)(a=>{bV.current=a,bU.current?.click()},[]),bX=(0,h.useCallback)(async b=>{let c=b.target.files?.[0];if(!c)return;b.target.value="";let d=bV.current,e=`.${c.name.split(".").pop()?.toLowerCase()}`;if(!function(a){if(!a)return!1;let b=a.toLowerCase();return eM.includes(b)}(e))return void bf(`Unsupported file type: ${e}. Allowed: ${eM.join(", ")}`,"error");let f=function(a){let b=function(a){let b=a.toLowerCase();return eL.find(a=>a.extension===b)}(a);return b?.maxFileSize??0x1400000}(e);if(c.size>f)return void bf(`File too large. Maximum size: ${(f/1024/1024).toFixed(1)}MB`,"error");let g=new FormData;g.append("file",c);try{let b=await fetch(`/api/worktrees/${a}/upload/${aB(d||".")}`,{method:"POST",body:g});if(!b.ok){let a=await b.json().catch(()=>({})),c=a?.error?.message||"Failed to upload file";bf(c,"error");return}let c=await b.json();bf(`Uploaded: ${c.filename}`,"success"),aw(a=>a+1)}catch(a){console.error("[WorktreeDetailRefactored] Failed to upload:",a),bf("Upload failed. Please try again.","error")}},[a,bf]),{data:bY}=aW(),bZ=bY?.hasUpdate??!1,{lastAutoResponse:b$}=function({worktreeId:a,cliTool:b,isPromptWaiting:c,promptData:d,autoYesEnabled:e,lastServerResponseTimestamp:f,serverPollerActive:g}){(0,h.useRef)(null);let[i,j]=(0,h.useState)(null);return{lastAutoResponse:i}}({worktreeId:a,cliTool:ah,isPromptWaiting:g.prompt.visible,promptData:g.prompt.data,autoYesEnabled:at,lastServerResponseTimestamp:J,serverPollerActive:L}),b_=(0,h.useCallback)(async()=>{w(null),u(!0),await a0()&&await Promise.all([a1(),a2()]),u(!1)},[a0,a1,a2]);!function({error:a,handleRetry:b,fetchWorktree:c,fetchMessages:d,fetchCurrentOutput:e,setError:f}){let g=(0,h.useRef)(0);(0,h.useCallback)(async()=>{if("visible"!==document.visibilityState)return;let h=Date.now();if(!(h-g.current<5e3)){if(g.current=h,a)return void b();try{await Promise.all([c(),d(),e()])}finally{f(null)}}},[a,b,c,d,e,f])}({error:v,handleRetry:b_,fetchWorktree:a0,fetchMessages:a1,fetchCurrentOutput:a2,setError:w}),r?.sessionStatusByCli?.[ah]?.isRunning;let b0=(0,h.useMemo)(()=>(function(a,b,c="claude"){if(b)return"error";if(!a)return"idle";let d=a.sessionStatusByCli?.[c];if(d){if(d.isWaitingForResponse)return"waiting";if(d.isProcessing)return"running";if(d.isRunning)return"ready"}if("claude"===c){if(a.isWaitingForResponse)return"waiting";if(a.isProcessing)return"running";if(a.isSessionRunning)return"ready"}return"idle"})(r,null!==g.error.type,ah),[r,g.error.type,ah]),b1=(0,h.useMemo)(()=>g.layout.mobileActivePane,[g.layout.mobileActivePane]),b2=r?.name??"Unknown",b3=(0,h.useCallback)((a,b)=>{A.dispatch({type:"SET_CONTENT",path:a,content:b})},[A]),b4=(0,h.useCallback)((a,b)=>{A.dispatch({type:"SET_ERROR",path:a,error:b})},[A]),b5=(0,h.useCallback)((a,b)=>{A.dispatch({type:"SET_LOADING",path:a,loading:b})},[A]);return{activeActivity:aC,activeCliTab:ah,activeInstanceId:al,activeTab:b1,agentInstances:Y,autoYesEnabled:at,autoYesExpiresAt:au,autoYesStateMap:H,diffContent:aX,diffFilePath:aY,disableAutoFollow:ba,displayedAgents:a9,displayedInstances:a6,editorFilePath:D,error:v,fetchCurrentOutput:a2,fileInputRef:bU,fileSearch:a_,fileTreeRefresh:av,handleActivityToggle:bp,handleAgentInstancesChange:bc,handleAutoYesToggle:bz,handleBackClick:bq,handleCloseDiff:a$,handleDelete:bO,handleDiffSelect:aZ,handleDirtyChange:(0,h.useCallback)((a,b)=>{A.dispatch({type:"SET_DIRTY",path:a,isDirty:b})},[A]),handleEditorClose:bm,handleEditorSave:bo,handleFileInputChange:bX,handleFilePanelSave:bl,handleFilePathClick:bh,handleFileSelect:bi,handleHistoryDisplayLimitChange:aL,handleHistoryUserOnlyChange:aJ,handleInfoClick:bs,handleInfoModalClose:bt,handleInsertConsumed:aT,handleInsertConsumedSingle:aV,handleInsertToMessage:aR,handleInsertToSplit:aS,handleKillCancel:bI,handleKillConfirm:bH,openKillConfirm:bF,openActiveKillConfirm:bG,killTarget:bA,isKillPending:bC,handleLoadContent:b3,handleLoadError:b4,handleMessageSent:bx,handleMobileFileViewerClose:bk,handleMobileTabChange:bw,handleMove:bR,resetFileTreeView:bn,handleMoveCancel:bT,handleMoveConfirm:bS,handleNewDirectory:bM,handleNewFile:bJ,handleNewFileCancel:bL,handleNewFileConfirm:bK,handleOpenFile:bj,handlePromptDismiss:bv,handlePromptRespond:bu,handleRename:bN,handleRetry:b_,handleSelectedAgentsChange:bb,handleSetLoading:b5,handleShowArchivedChange:aH,handleUpload:bW,handleVibeLocalContextWindowChange:be,rosterReady:ac,handleVibeLocalModelChange:bd,handleWorktreeStatusChange:br,hasUpdate:bZ,historyDisplayLimit:aK,historySubTab:aE,historyUserOnly:aI,isEditorMaximized:F,isInfoModalOpen:x,isMobile:c,isMoveDialogOpen:bQ,isSelectionListActive:N,isPagerActive:P,lastAutoResponse:b$,loading:t,makeAutoYesToggleHandler:by,mobileFileViewerPath:B,mobileSelectedAgents:a8,moveTarget:bP,newFileParentPath:az,openMobileDrawer:e,pendingInsertText:aP,pendingInsertTextMap:aO,selectedAgents:V,setActiveCliTab:aj,setActiveInstanceId:ao,setEditorFilePath:E,setFocusedSplitIndex:aQ,setHistorySubTab:aF,setIsEditorMaximized:G,setWorktree:s,showArchived:aG,showNewFileDialog:ax,showToast:bf,state:g,tCommon:m,tWorktree:j,tabsActions:A,tabsState:z,toggleInstanceVisible:a5,vibeLocalContextWindow:af,vibeLocalModel:ad,visibleInstanceIds:a4,worktree:r,worktreeName:b2,worktreeStatus:b0}}({worktreeId:a}),[bv,bw]=(0,h.useState)(!1),bx=function({worktreeId:a,active:b}){let{addListener:c}=(0,bp.xM)(),[d,e]=(0,h.useState)(!1);return(0,h.useRef)(b).current=b,!b&&d}({worktreeId:a,active:"terminal"===g}),{viewportHeight:by}=function(){let[a,b]=(0,h.useState)(!1),[c,d]=(0,h.useState)(0),[e,f]=(0,h.useState)(null);return(0,h.useCallback)(()=>{},[]),{isKeyboardVisible:a,keyboardHeight:c,viewportHeight:e}}(),bz=(0,h.useCallback)(a=>{let b=fS.indexOf(g);if(-1===b)return;let c=b+a;c<0||c>=fS.length||ap(fS[c])},[g,ap]),{ref:bA}=K({axis:"horizontal",threshold:60,edgeStartZone:32*("terminal"===g),onSwipeLeft:()=>bz(1),onSwipeRight:()=>bz(-1)});if(aX)return(0,e.jsx)(et,{});if(w)return(0,e.jsx)(eu,{message:w,onRetry:aC});let bB=(0,a7.O6)(i,d,c),bC=ah?.label??bB,bD=(bs?.sessionStatusByInstance?.[d]??bs?.sessionStatusByCli?.[c])?.isRunning??!1;return aQ?(0,e.jsx)(F,{componentName:"WorktreeDetailRefactored",children:(0,e.jsxs)("div",{className:"flex flex-col overflow-hidden",style:{height:null!=by?`${by}px`:"100%"},"data-testid":"mobile-worktree-shell",children:[(0,e.jsx)("div",{className:"flex-shrink-0",children:(0,e.jsx)(v,{worktreeName:bt,repositoryName:bs?.repositoryName,status:bu,gitStatus:bs?.gitStatus,onBackClick:G,onMenuClick:a1})}),bs?.gitStatus&&bs.gitStatus.isBranchMismatch&&(0,e.jsx)("div",{className:"z-35 flex-shrink-0",children:(0,e.jsx)(fx,{isBranchMismatch:bs.gitStatus.isBranchMismatch,currentBranch:bs.gitStatus.currentBranch,initialBranch:bs.gitStatus.initialBranch})}),(0,e.jsxs)("div",{className:"flex-shrink-0 z-30 flex items-center gap-2 px-3 py-1.5 bg-surface-2 border-b border-border",children:[(0,e.jsx)("nav",{className:"flex gap-1 flex-1 min-w-0 overflow-x-auto scrollbar-hide","aria-label":bj("detail.agentInstanceSelection"),children:t.map(a=>{let b=(0,a6.kA)(bs?.sessionStatusByInstance?.[a.id]??bs?.sessionStatusByCli?.[a.cliTool]),c=bi(`status.${b}`),f=d===a.id;return(0,e.jsxs)("button",{onClick:()=>a8(a.id),className:`flex-shrink-0 whitespace-nowrap min-h-[44px] px-1.5 py-1 font-medium text-xs transition-colors flex items-center gap-1 border-b-2 touch-manipulation ${f?"text-accent-600 dark:text-accent-400 border-accent-500":"text-muted-foreground hover:text-foreground border-transparent"}`,"aria-current":f?"page":void 0,children:[(0,e.jsx)(o.m,{status:b,size:"sm",label:bj("detail.statusPill",{label:(0,a7.sw)(a),status:c})}),(0,a7.sw)(a)]},a.id)})}),(0,e.jsx)("button",{type:"button",onClick:()=>bw(!0),className:"flex-shrink-0 flex items-center justify-center min-h-[44px] min-w-[44px] rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors touch-manipulation","aria-label":bj("terminal.moreActions"),"data-testid":"mobile-more-actions-button",children:(0,e.jsx)(l.A,{size:18,"aria-hidden":"true"})})]}),(0,e.jsx)("main",{className:"flex-1 min-h-0 overflow-y-auto",ref:bA,children:(0,e.jsx)(en,{activeTab:g,worktreeId:a,worktree:bs,messages:bh.messages,cliToolId:c,instanceId:d,onFilePathClick:R,onFileSelect:U,onWorktreeUpdate:bd,onNewFile:au,onNewDirectory:at,onRename:aA,onDelete:I,onUpload:aF,onMove:aq,onFileTreeReset:bm,refreshTrigger:A,fileSearch:z,showToast:bg,selectedAgents:a$,onSelectedAgentsChange:fR,useInstanceManagement:!0,instances:i,onInstancesChange:C,visibleInstanceIds:br,onToggleInstanceVisible:bn,vibeLocalModel:bq,onVibeLocalModelChange:aH,vibeLocalContextWindow:bo,onVibeLocalContextWindowChange:aG,disableAutoFollow:s,historySubTab:aL,onHistorySubTabChange:bb,onDiffSelect:J,onInsertToMessage:_,showArchived:be,onShowArchivedChange:aE,historyDisplayLimit:aK,onHistoryDisplayLimitChange:V,historyUserOnly:aM,onHistoryUserOnlyChange:W})}),(0,e.jsxs)("div",{className:"flex-shrink-0 border-t border-border bg-surface z-30",children:[aS&&(0,e.jsx)("div",{className:"px-2 pt-1 border-b border-border",children:(0,e.jsx)(al,{worktreeId:a,cliToolId:c,instanceId:d,onKeysSent:x,showPagerKeys:aT})}),(0,e.jsx)("div",{className:"p-2",children:(0,e.jsx)(ag,{worktreeId:a,onMessageSent:an,cliToolId:c,instanceId:d,isSessionRunning:bD,pendingInsertText:a2,onInsertConsumed:$,autoYesSlot:(0,e.jsx)(fs,{enabled:j,expiresAt:m,onToggle:D,lastAutoResponse:aV,cliToolName:c,inline:!0,showToolName:!1})})})]}),(0,e.jsx)(E,{activeTab:g,onTabChange:ap,hasNewOutput:bx,hasPrompt:bh.prompt.visible,hasUpdate:aJ,inFlow:!0}),!j&&(0,e.jsx)(M,{promptData:bh.prompt.data,visible:bh.prompt.visible,answering:bh.prompt.answering,onRespond:az,onDismiss:ay,cliToolName:(0,a7.oo)(c)}),(0,e.jsx)(S,{open:bv,onClose:()=>bw(!1),onSearch:()=>window.dispatchEvent(new CustomEvent("terminal-search-open")),onEnd:af,endDisabled:!bD}),(0,e.jsx)(aP,{isOpen:null!==aZ,onClose:ao,worktreeId:a,filePath:aZ??"",onEditMarkdown:a9}),u&&(0,e.jsx)(a5.a,{isOpen:!0,onClose:N,title:u.split("/").pop()||bj("fileViewer.editor"),size:"full",disableClose:aN,children:(0,e.jsx)("div",{className:"h-[80vh]",children:(0,e.jsx)(fQ,{worktreeId:a,filePath:u,onClose:N,onSave:O,onMaximizedChange:bc,initialViewMode:"split"})})}),(0,e.jsx)("input",{ref:y,type:"file",accept:eM.join(","),onChange:P,className:"hidden","aria-label":bj("detail.uploadFile")}),(0,e.jsx)(a5.a,{isOpen:null!==ah,onClose:ac,title:bj("session.confirmEnd",{tool:bC}),size:"sm",showCloseButton:!0,children:(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("p",{className:"text-sm text-foreground",children:bj("session.endWarning")}),(0,e.jsxs)("div",{className:"flex justify-end gap-3 pt-2",children:[(0,e.jsx)("button",{type:"button",onClick:ac,className:"px-4 py-2 text-sm font-medium rounded-md bg-muted hover:bg-muted/80 text-foreground",children:bi("cancel")}),(0,e.jsx)("button",{type:"button",onClick:ad,disabled:ai,className:"px-4 py-2 text-sm font-medium rounded-md bg-danger hover:bg-danger/90 text-white disabled:opacity-60 disabled:cursor-not-allowed",children:bi("end")})]})]})}),a_&&(0,e.jsx)(fz,{isOpen:aR,onClose:ar,onConfirm:as,worktreeId:a,sourcePath:a_.path,sourceType:a_.type}),(0,e.jsx)(fB,{isOpen:bf,parentPath:a0,onConfirm:aw,onCancel:av})]})}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(fC,{worktreeId:a,worktree:bs,worktreeName:bt,worktreeStatus:bu,instances:i,rosterReady:a4,activeInstanceId:d,setActiveInstanceId:a8,hasUpdate:aJ,lastAutoResponse:aV,activeActivity:b,onActivityToggle:B,onBackClick:G,onInfoClick:X,onWorktreeStatusChange:aI,pendingInsertTextMap:a3,setFocusedSplitIndex:ba,handleInsertToSplit:aa,handleInsertConsumed:Z,handleInsertToMessage:_,autoYesStateMap:n,makeAutoYesToggleHandler:aY,showArchived:be,onShowArchivedChange:aE,historyDisplayLimit:aK,onHistoryDisplayLimitChange:V,historyUserOnly:aM,onHistoryUserOnlyChange:W,onMessageSent:an,onFilePathClick:R,showToast:bg,tabsState:bl,tabsActions:bk,onLoadContent:aj,onLoadError:ak,onSetLoading:aD,onFilePanelSave:Q,onDirtyChange:L,onOpenFile:ax,diffContent:p,diffFilePath:r,onCloseDiff:H,fileSearch:z,fileTreeRefresh:A,onFileSelect:U,onNewFile:au,onNewDirectory:at,onRename:aA,onDelete:I,onUpload:aF,onMove:aq,onFileTreeReset:bm,onDiffSelect:J,onAgentInstancesChange:C,vibeLocalModel:bq,onVibeLocalModelChange:aH,vibeLocalContextWindow:bo,onVibeLocalContextWindowChange:aG,isInfoModalOpen:aO,onInfoModalClose:Y,onWorktreeUpdate:bd,fileInputRef:y,onFileInputChange:P,onKillSession:af,onRequestSessionEnd:ae,killTarget:ah,isKillPending:ai,onKillCancel:ac,onKillConfirm:ad,moveTarget:a_,isMoveDialogOpen:aR,onMoveCancel:ar,onMoveConfirm:as,showNewFileDialog:bf,newFileParentPath:a0,onNewFileConfirm:aw,onNewFileCancel:av,killDialogTitle:bj("session.confirmEnd",{tool:bC}),killDialogWarning:bj("session.endWarning"),cancelLabel:bi("cancel"),endLabel:bi("end")}),u&&(0,e.jsx)(a5.a,{isOpen:!0,onClose:N,title:u.split("/").pop()||bj("fileViewer.editor"),size:"full",disableClose:aN,children:(0,e.jsx)("div",{className:"h-[80vh]",children:(0,e.jsx)(fQ,{worktreeId:a,filePath:u,onClose:N,onSave:O,onMaximizedChange:bc})})})]})});function fU(){let a=(0,f.useParams)().id;return(0,e.jsx)(g.GV,{children:(0,e.jsx)(fT,{worktreeId:a})})}},97369:a=>{a.exports=function(a){return{name:"STEP Part 21",aliases:["p21","step","stp"],case_insensitive:!0,keywords:{$pattern:"[A-Z_][A-Z0-9_.]*",keyword:["HEADER","ENDSEC","DATA"]},contains:[{className:"meta",begin:"ISO-10303-21;",relevance:10},{className:"meta",begin:"END-ISO-10303-21;",relevance:10},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.COMMENT("/\\*\\*!","\\*/"),a.C_NUMBER_MODE,a.inherit(a.APOS_STRING_MODE,{illegal:null}),a.inherit(a.QUOTE_STRING_MODE,{illegal:null}),{className:"string",begin:"'",end:"'"},{className:"symbol",variants:[{begin:"#",end:"\\d+",illegal:"\\W"}]}]}}},97467:a=>{a.exports=function(a){return{name:"DNS Zone",aliases:["bind","zone"],keywords:["IN","A","AAAA","AFSDB","APL","CAA","CDNSKEY","CDS","CERT","CNAME","DHCID","DLV","DNAME","DNSKEY","DS","HIP","IPSECKEY","KEY","KX","LOC","MX","NAPTR","NS","NSEC","NSEC3","NSEC3PARAM","PTR","RRSIG","RP","SIG","SOA","SRV","SSHFP","TA","TKEY","TLSA","TSIG","TXT"],contains:[a.COMMENT(";","$",{relevance:0}),{className:"meta",begin:/^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/},{className:"number",begin:"((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b"},{className:"number",begin:"((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b"},a.inherit(a.NUMBER_MODE,{begin:/\b\d+[dhwm]?/})]}}},97694:a=>{a.exports=function(a){let b=a.regex,c={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},d=a.COMMENT();d.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let e={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},f={className:"literal",begin:/\bon|off|true|false|yes|no\b/},g={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},h=b.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[d,{className:"section",begin:/\[+/,end:/\]+/},{begin:b.concat(h,"(\\s*\\.\\s*",h,")*",b.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[d,{begin:/\[/,end:/\]/,contains:[d,f,e,g,c,"self"],relevance:0},f,e,g,c]}}]}}},98758:a=>{a.exports=function(a){return{name:"Inform 7",aliases:["i7"],case_insensitive:!0,keywords:{keyword:"thing room person man woman animal container supporter backdrop door scenery open closed locked inside gender is are say understand kind of rule"},contains:[{className:"string",begin:'"',end:'"',relevance:0,contains:[{className:"subst",begin:"\\[",end:"\\]"}]},{className:"section",begin:/^(Volume|Book|Part|Chapter|Section|Table)\b/,end:"$"},{begin:/^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,end:":",contains:[{begin:"\\(This",end:"\\)"}]},{className:"comment",begin:"\\[",end:"\\]",contains:["self"]}]}}},98803:a=>{a.exports=function(a){let b=a.regex,c=/[a-zA-Z_][a-zA-Z0-9_]*/,d={className:"number",variants:[a.BINARY_NUMBER_MODE,a.C_NUMBER_MODE]};return{name:"Tcl",aliases:["tk"],keywords:["after","append","apply","array","auto_execok","auto_import","auto_load","auto_mkindex","auto_mkindex_old","auto_qualify","auto_reset","bgerror","binary","break","catch","cd","chan","clock","close","concat","continue","dde","dict","encoding","eof","error","eval","exec","exit","expr","fblocked","fconfigure","fcopy","file","fileevent","filename","flush","for","foreach","format","gets","glob","global","history","http","if","incr","info","interp","join","lappend|10","lassign|10","lindex|10","linsert|10","list","llength|10","load","lrange|10","lrepeat|10","lreplace|10","lreverse|10","lsearch|10","lset|10","lsort|10","mathfunc","mathop","memory","msgcat","namespace","open","package","parray","pid","pkg::create","pkg_mkIndex","platform","platform::shell","proc","puts","pwd","read","refchan","regexp","registry","regsub|10","rename","return","safe","scan","seek","set","socket","source","split","string","subst","switch","tcl_endOfWord","tcl_findLibrary","tcl_startOfNextWord","tcl_startOfPreviousWord","tcl_wordBreakAfter","tcl_wordBreakBefore","tcltest","tclvars","tell","time","tm","trace","unknown","unload","unset","update","uplevel","upvar","variable","vwait","while"],contains:[a.COMMENT(";[ \\t]*#","$"),a.COMMENT("^[ \\t]*#","$"),{beginKeywords:"proc",end:"[\\{]",excludeEnd:!0,contains:[{className:"title",begin:"[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"[ \\t\\n\\r]",endsWithParent:!0,excludeEnd:!0}]},{className:"variable",variants:[{begin:b.concat(/\$/,b.optional(/::/),c,"(::",c,")*")},{begin:"\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",end:"\\}",contains:[d]}]},{className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[a.inherit(a.QUOTE_STRING_MODE,{illegal:null})]},d]}}},99134:a=>{a.exports=function(a){let b=a.regex,c=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,d=b.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),e=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,f=b.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:c,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[a.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:b.lookahead(b.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:c},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),a.HASH_COMMENT_MODE,{scope:"string",contains:[a.BACKSLASH_ESCAPE],variants:[a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),a.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[e,d]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,d]},{scope:{1:"punctuation",2:"number"},match:[f,d]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,d]}]},{scope:{3:"operator"},match:[c,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:e},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:f},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}},99626:a=>{"use strict";a.exports=JSON.parse('{"Aacute":"\xc1","aacute":"\xe1","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"\xc2","acirc":"\xe2","acute":"\xb4","Acy":"А","acy":"а","AElig":"\xc6","aelig":"\xe6","af":"","Afr":"\uD835\uDD04","afr":"\uD835\uDD1E","Agrave":"\xc0","agrave":"\xe0","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"\xc5","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"\uD835\uDD38","aopf":"\uD835\uDD52","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"\'","ApplyFunction":"","approx":"≈","approxeq":"≊","Aring":"\xc5","aring":"\xe5","Ascr":"\uD835\uDC9C","ascr":"\uD835\uDCB6","Assign":"≔","ast":"*","asymp":"≈","asympeq":"≍","Atilde":"\xc3","atilde":"\xe3","Auml":"\xc4","auml":"\xe4","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"\uD835\uDD05","bfr":"\uD835\uDD1F","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"\uD835\uDD39","bopf":"\uD835\uDD53","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"\xa6","bscr":"\uD835\uDCB7","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"\xc7","ccedil":"\xe7","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"\xb8","Cedilla":"\xb8","cemptyv":"⦲","cent":"\xa2","centerdot":"\xb7","CenterDot":"\xb7","cfr":"\uD835\uDD20","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"\xae","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"\uD835\uDD54","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"\xa9","COPY":"\xa9","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"\uD835\uDC9E","cscr":"\uD835\uDCB8","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"\xa4","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"\xb0","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"\uD835\uDD07","dfr":"\uD835\uDD21","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"\xb4","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"\xa8","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"\xf7","divide":"\xf7","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"\uD835\uDD3B","dopf":"\uD835\uDD55","Dot":"\xa8","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"\xa8","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"\uD835\uDC9F","dscr":"\uD835\uDCB9","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"\xc9","eacute":"\xe9","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"\xca","ecirc":"\xea","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"\uD835\uDD08","efr":"\uD835\uDD22","eg":"⪚","Egrave":"\xc8","egrave":"\xe8","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"\uD835\uDD3C","eopf":"\uD835\uDD56","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"\xd0","eth":"\xf0","Euml":"\xcb","euml":"\xeb","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"\uD835\uDD09","ffr":"\uD835\uDD23","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"\uD835\uDD3D","fopf":"\uD835\uDD57","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"\xbd","frac13":"⅓","frac14":"\xbc","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"\xbe","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"\uD835\uDCBB","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"\uD835\uDD0A","gfr":"\uD835\uDD24","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"\uD835\uDD3E","gopf":"\uD835\uDD58","grave":"`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"\uD835\uDCA2","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"\xbd","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"\uD835\uDD25","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"\uD835\uDD59","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"\uD835\uDCBD","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"\xcd","iacute":"\xed","ic":"","Icirc":"\xce","icirc":"\xee","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"\xa1","iff":"⇔","ifr":"\uD835\uDD26","Ifr":"ℑ","Igrave":"\xcc","igrave":"\xec","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"","InvisibleTimes":"","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"\uD835\uDD40","iopf":"\uD835\uDD5A","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"\xbf","iscr":"\uD835\uDCBE","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"\xcf","iuml":"\xef","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"\uD835\uDD0D","jfr":"\uD835\uDD27","jmath":"ȷ","Jopf":"\uD835\uDD41","jopf":"\uD835\uDD5B","Jscr":"\uD835\uDCA5","jscr":"\uD835\uDCBF","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"\uD835\uDD0E","kfr":"\uD835\uDD28","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"\uD835\uDD42","kopf":"\uD835\uDD5C","Kscr":"\uD835\uDCA6","kscr":"\uD835\uDCC0","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"\xab","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"\uD835\uDD0F","lfr":"\uD835\uDD29","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"\uD835\uDD43","lopf":"\uD835\uDD5D","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"","lrtri":"⊿","lsaquo":"‹","lscr":"\uD835\uDCC1","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"\xaf","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"\uD835\uDD10","mfr":"\uD835\uDD2A","mho":"℧","micro":"\xb5","midast":"*","midcir":"⫰","mid":"∣","middot":"\xb7","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"\uD835\uDD44","mopf":"\uD835\uDD5E","mp":"∓","mscr":"\uD835\uDCC2","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":"\xa0","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"","NegativeThickSpace":"","NegativeThinSpace":"","NegativeVeryThinSpace":"","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"\uD835\uDD11","nfr":"\uD835\uDD2B","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"","NonBreakingSpace":"\xa0","nopf":"\uD835\uDD5F","Nopf":"ℕ","Not":"⫬","not":"\xac","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"\uD835\uDCA9","nscr":"\uD835\uDCC3","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"\xd1","ntilde":"\xf1","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"\xd3","oacute":"\xf3","oast":"⊛","Ocirc":"\xd4","ocirc":"\xf4","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"\uD835\uDD12","ofr":"\uD835\uDD2C","ogon":"˛","Ograve":"\xd2","ograve":"\xf2","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"\uD835\uDD46","oopf":"\uD835\uDD60","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"\xaa","ordm":"\xba","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"\uD835\uDCAA","oscr":"ℴ","Oslash":"\xd8","oslash":"\xf8","osol":"⊘","Otilde":"\xd5","otilde":"\xf5","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"\xd6","ouml":"\xf6","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"\xb6","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"\uD835\uDD13","pfr":"\uD835\uDD2D","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"\xb1","plusmn":"\xb1","plussim":"⨦","plustwo":"⨧","pm":"\xb1","Poincareplane":"ℌ","pointint":"⨕","popf":"\uD835\uDD61","Popf":"ℙ","pound":"\xa3","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"\uD835\uDCAB","pscr":"\uD835\uDCC5","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"\uD835\uDD14","qfr":"\uD835\uDD2E","qint":"⨌","qopf":"\uD835\uDD62","Qopf":"ℚ","qprime":"⁗","Qscr":"\uD835\uDCAC","qscr":"\uD835\uDCC6","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"\xbb","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"\xae","REG":"\xae","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"\uD835\uDD2F","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"\uD835\uDD63","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"\uD835\uDCC7","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"\xa7","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"\uD835\uDD16","sfr":"\uD835\uDD30","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"\xad","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"\uD835\uDD4A","sopf":"\uD835\uDD64","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"\uD835\uDCAE","sscr":"\uD835\uDCC8","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"\xaf","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"\xb9","sup2":"\xb2","sup3":"\xb3","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"\xdf","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"\uD835\uDD17","tfr":"\uD835\uDD31","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":" ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"\xde","thorn":"\xfe","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"\xd7","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"\uD835\uDD4B","topf":"\uD835\uDD65","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"\uD835\uDCAF","tscr":"\uD835\uDCC9","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"\xda","uacute":"\xfa","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"\xdb","ucirc":"\xfb","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"\uD835\uDD18","ufr":"\uD835\uDD32","Ugrave":"\xd9","ugrave":"\xf9","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"\xa8","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"\uD835\uDD4C","uopf":"\uD835\uDD66","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"\uD835\uDCB0","uscr":"\uD835\uDCCA","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"\xdc","uuml":"\xfc","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"\uD835\uDD19","vfr":"\uD835\uDD33","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"\uD835\uDD4D","vopf":"\uD835\uDD67","vprop":"∝","vrtri":"⊳","Vscr":"\uD835\uDCB1","vscr":"\uD835\uDCCB","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"\uD835\uDD1A","wfr":"\uD835\uDD34","Wopf":"\uD835\uDD4E","wopf":"\uD835\uDD68","wp":"℘","wr":"≀","wreath":"≀","Wscr":"\uD835\uDCB2","wscr":"\uD835\uDCCC","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"\uD835\uDD1B","xfr":"\uD835\uDD35","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"\uD835\uDD4F","xopf":"\uD835\uDD69","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"\uD835\uDCB3","xscr":"\uD835\uDCCD","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"\xdd","yacute":"\xfd","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"\xa5","Yfr":"\uD835\uDD1C","yfr":"\uD835\uDD36","YIcy":"Ї","yicy":"ї","Yopf":"\uD835\uDD50","yopf":"\uD835\uDD6A","Yscr":"\uD835\uDCB4","yscr":"\uD835\uDCCE","YUcy":"Ю","yucy":"ю","yuml":"\xff","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"","Zeta":"Ζ","zeta":"ζ","zfr":"\uD835\uDD37","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"\uD835\uDD6B","Zopf":"ℤ","Zscr":"\uD835\uDCB5","zscr":"\uD835\uDCCF","zwj":"","zwnj":""}')},99896:a=>{a.exports=function(a){return{name:"JBoss CLI",aliases:["wildfly-cli"],keywords:{$pattern:"[a-z-]+",keyword:"alias batch cd clear command connect connection-factory connection-info data-source deploy deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias undeploy unset version xa-data-source",literal:"true false"},contains:[a.HASH_COMMENT_MODE,a.QUOTE_STRING_MODE,{className:"params",begin:/--[\w\-=\/]+/},{className:"function",begin:/:[\w\-.]+/,relevance:0},{className:"string",begin:/\B([\/.])[\w\-.\/=]+/},{className:"params",begin:/\(/,end:/\)/,contains:[{begin:/[\w-]+ *=/,returnBegin:!0,relevance:0,contains:[{className:"attr",begin:/[\w-]+/}]}],relevance:0}]}}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[1331,1366,6015,129,9968,180,7013,9123,3451,646],()=>b(b.s=31975));module.exports=c})();
|