commandmate 0.46.0 → 0.46.1
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 +259 -259
- package/.next/app-path-routes-manifest.json +14 -14
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +9 -9
- package/.next/react-loadable-manifest.json +2 -2
- 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/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/release-notes/route_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_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/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/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/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +9 -9
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/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/escalation/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/relays/[relayId]/cancel/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/pair/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/clone/[jobId]/route.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route.js +1 -1
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/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/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/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/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/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/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +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.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +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]/direct-input/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/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]/instances/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +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.js +9 -9
- 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_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +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]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +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]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +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.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +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]/verify/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/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/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_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/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/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 +7 -7
- 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 +14 -14
- package/.next/server/chunks/1501.js +2 -2
- package/.next/server/chunks/1559.js +1 -1
- package/.next/server/chunks/2460.js +1 -1
- package/.next/server/chunks/2908.js +1 -1
- package/.next/server/chunks/2984.js +25 -0
- package/.next/server/chunks/5209.js +1 -1
- package/.next/server/chunks/5292.js +2 -2
- package/.next/server/chunks/5845.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6401.js +1 -1
- package/.next/server/chunks/6722.js +1 -1
- package/.next/server/chunks/8581.js +4 -4
- package/.next/server/chunks/8728.js +2 -2
- package/.next/server/chunks/8791.js +1 -1
- package/.next/server/chunks/8918.js +5 -5
- package/.next/server/chunks/9390.js +1 -1
- package/.next/server/chunks/9627.js +2 -1
- package/.next/server/chunks/9731.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/{2407-acb644c5487e1720.js → 2407-9703c569370b8a9d.js} +1 -1
- package/.next/static/chunks/{2717.21abf5b6bbd45520.js → 2717.1583400c272dc1d9.js} +1 -1
- package/.next/static/chunks/5371-0dc947683e46e78c.js +1 -0
- package/.next/static/chunks/5794-4eee51ff1e878aa6.js +1 -0
- package/.next/static/chunks/{8407-9a72e6f07c5d5458.js → 8407-155f84e5ba05f1d5.js} +1 -1
- package/.next/static/chunks/app/{layout-ae30ce63569c22be.js → layout-3e357690446cd2da.js} +1 -1
- package/.next/static/chunks/app/worktrees/[id]/page-effbf0796881dd5a.js +1 -0
- package/.next/static/chunks/{webpack-c0b821f340afdebf.js → webpack-468b7b33030234b3.js} +1 -1
- package/.next/trace +13 -13
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +6 -1
- package/dist/cli/types/api-responses.d.ts +8 -6
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/lib/polling/auto-yes-suppression-reason.d.ts +13 -1
- package/dist/lib/polling/auto-yes-suppression-reason.d.ts.map +1 -1
- package/dist/lib/polling/auto-yes-suppression-reason.js +3 -0
- package/dist/server/src/lib/assistant-response-saver.js +13 -0
- package/dist/server/src/lib/auto-yes-poller.js +252 -54
- package/dist/server/src/lib/conversation-logger.js +14 -2
- package/dist/server/src/lib/db/chat-db.js +2 -1
- package/dist/server/src/lib/history/user-turn-recorder.js +14 -0
- package/dist/server/src/lib/hooks/sources/antigravity/history.js +28 -0
- package/dist/server/src/lib/hooks/sources/claude/history.js +7 -0
- package/dist/server/src/lib/hooks/sources/codex/history.js +7 -0
- package/dist/server/src/lib/hooks/sources/command-code/history.js +7 -0
- package/dist/server/src/lib/hooks/sources/transcript-history.js +34 -0
- package/dist/server/src/lib/log-manager.js +7 -2
- package/dist/server/src/lib/polling/auto-yes-enter-fallback-state.js +22 -3
- package/dist/server/src/lib/polling/auto-yes-poller-state.js +234 -0
- package/dist/server/src/lib/polling/auto-yes-suppression-reason.js +3 -0
- package/dist/server/src/lib/polling/pending-scraped-response.js +119 -3
- package/dist/server/src/lib/polling/poller-owner.js +110 -0
- package/dist/server/src/lib/polling/response-checker.js +202 -39
- package/dist/server/src/lib/polling/response-dedup.js +8 -0
- package/dist/server/src/lib/polling/response-poller-core.js +131 -12
- package/dist/server/src/lib/polling/structured-history-gate.js +20 -1
- package/dist/server/src/lib/prompt-answer-sender.js +59 -12
- package/dist/server/src/lib/realtime/terminal-broadcast.js +14 -0
- package/dist/server/src/lib/session/chat-turn-progress.js +57 -6
- package/dist/server/src/lib/session/current-output-builder.js +19 -0
- package/dist/server/src/lib/session/worktree-session-reconcile.js +83 -10
- package/dist/server/src/lib/timer-manager.js +7 -0
- package/dist/server/src/lib/tmux/tmux.js +24 -2
- package/dist/server/src/lib/verification/env-clean-gate.js +30 -2
- package/package.json +1 -1
- package/release-notes/0.46.1.json +40 -0
- package/.next/server/chunks/5625.js +0 -25
- package/.next/static/chunks/5371-a94ed618148287a0.js +0 -1
- package/.next/static/chunks/5794-947fb4934d8be193.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-2eb1d0fd0a077b7e.js +0 -1
- /package/.next/static/{zI2nQ6WKboSbFbMF4EtrJ → QxDf7lm-JJkWoj-TyWiSB}/_buildManifest.js +0 -0
- /package/.next/static/{zI2nQ6WKboSbFbMF4EtrJ → QxDf7lm-JJkWoj-TyWiSB}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8407],{3005:(e,t,a)=>{a.d(t,{y:()=>o});var r=a(95155);a(12115);var n=a(87531);let s={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},i={current:"",accent:"text-accent-600 dark:text-accent-400",muted:"text-muted-foreground"};function o(e){let{size:t="md",variant:a="current",className:o,...l}=e;return(0,r.jsxs)("svg",{className:(0,n.cn)("animate-spin",s[t],i[a],o),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",...l,children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},5590:(e,t,a)=>{a.d(t,{j:()=>o,p:()=>l});var r=a(95155),n=a(12115),s=a(83101),i=a(87531);let o=(0,s.F)("flex w-full rounded-md border border-input bg-surface dark:bg-surface-2 text-surface-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{inputSize:{sm:"h-8 px-2.5 py-1 text-sm",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-base"}},defaultVariants:{inputSize:"md"}}),l=n.forwardRef((e,t)=>{let{className:a,inputSize:n,type:s="text",...l}=e;return(0,r.jsx)("input",{ref:t,type:s,className:(0,i.cn)(o({inputSize:n}),a),...l})});l.displayName="Input"},9286:(e,t,a)=>{a.d(t,{O:()=>n});var r=a(12115);function n(e,t){let[a,n]=(0,r.useState)(e?"open":"closed");return e&&"open"!==a?n("open"):e||"open"!==a||n("exiting"),(0,r.useEffect)(()=>{if(e||"exiting"!==a)return;let r=setTimeout(()=>{n("closed")},t);return()=>clearTimeout(r)},[e,a,t]),{shouldRender:e||"closed"!==a,isExiting:!e&&"exiting"===a}}},9900:(e,t,a)=>{a.d(t,{$B:()=>d,I2:()=>s,LK:()=>o,Ys:()=>l,pX:()=>r,s7:()=>n,tX:()=>i});let r=2e3,n=1500,s=2e3,i=150,o=100,l=200,d=100},17848:(e,t,a)=>{a.d(t,{n:()=>n});var r=a(95155);function n(e){let{className:t="w-3.5 h-3.5",color:a}=e;return(0,r.jsx)("svg",{className:"".concat(t," flex-shrink-0"),viewBox:"0 0 24 24",fill:null!=a?a:"none",stroke:a?"none":"currentColor",strokeWidth:2*!a,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}},23838:(e,t,a)=>{a.d(t,{Xi:()=>c,av:()=>u,j7:()=>d,tU:()=>l});var r=a(95155),n=a(12115),s=a(25667),i=a(87531);let o=n.createContext("underline"),l=n.forwardRef((e,t)=>{let{variant:a="underline",...n}=e;return(0,r.jsx)(o.Provider,{value:a,children:(0,r.jsx)(s.bL,{ref:t,...n})})});l.displayName="Tabs";let d=n.forwardRef((e,t)=>{let{className:a,...l}=e,d=n.useContext(o);return(0,r.jsx)(s.B8,{ref:t,className:(0,i.cn)("inline-flex items-center","pill"===d?"gap-1 rounded-lg bg-muted p-1":"gap-4 border-b border-border",a),...l})});d.displayName="TabsList";let c=n.forwardRef((e,t)=>{let{className:a,...l}=e,d=n.useContext(o);return(0,r.jsx)(s.l9,{ref:t,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","pill"===d?"rounded-md px-3 py-1.5 text-muted-foreground data-[state=active]:bg-surface data-[state=active]:text-surface-foreground data-[state=active]:shadow-sm":"-mb-px border-b-2 border-transparent px-1 py-2 text-muted-foreground hover:text-foreground data-[state=active]:border-accent-500 data-[state=active]:text-accent-600",a),...l})});c.displayName="TabsTrigger";let u=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.UC,{ref:t,className:(0,i.cn)("mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",a),...n})});u.displayName="TabsContent"},25840:(e,t,a)=>{a.d(t,{T:()=>i});var r=a(95155),n=a(12115),s=a(87531);let i=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("textarea",{ref:t,className:(0,s.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-surface-foreground shadow-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring","disabled:cursor-not-allowed disabled:opacity-50",a),...n})});i.displayName="Textarea"},26232:(e,t,a)=>{a.d(t,{Hr:()=>b,Ht:()=>x,SQ:()=>f,_2:()=>m,lp:()=>g,mB:()=>p,rI:()=>c,ty:()=>u});var r=a(95155),n=a(12115),s=a(47971),i=a(5917),o=a(99051),l=a(59854),d=a(87531);let c=s.bL,u=s.l9;s.YJ;let f=n.forwardRef((e,t)=>{let{className:a,sideOffset:n=4,...i}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsx)(s.UC,{ref:t,sideOffset:n,style:{zIndex:l.M.POPOVER},className:(0,d.cn)("min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface p-1 text-surface-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...i})})});f.displayName="DropdownMenuContent";let m=n.forwardRef((e,t)=>{let{className:a,inset:n,...i}=e;return(0,r.jsx)(s.q7,{ref:t,className:(0,d.cn)("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",a),...i})});m.displayName="DropdownMenuItem",n.forwardRef((e,t)=>{let{className:a,children:n,checked:o,...l}=e;return(0,r.jsxs)(s.H_,{ref:t,checked:o,className:(0,d.cn)("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...l,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(i.A,{size:16,"aria-hidden":"true"})})}),n]})}).displayName="DropdownMenuCheckboxItem";let x=n.forwardRef((e,t)=>{let{className:a,children:n,...i}=e;return(0,r.jsxs)(s.hN,{ref:t,className:(0,d.cn)("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...i,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(o.A,{size:8,className:"fill-current","aria-hidden":"true"})})}),n]})});x.displayName="DropdownMenuRadioItem";let b=s.z6,g=n.forwardRef((e,t)=>{let{className:a,inset:n,...i}=e;return(0,r.jsx)(s.JU,{ref:t,className:(0,d.cn)("px-2 py-1.5 text-xs font-semibold text-muted-foreground",n&&"pl-8",a),...i})});g.displayName="DropdownMenuLabel";let p=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.wv,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-border",a),...n})});p.displayName="DropdownMenuSeparator"},31166:(e,t,a)=>{a.d(t,{$:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531),i=a(3005);let o=(0,n.F)("inline-flex items-center justify-center px-4 py-2 rounded-md font-medium transition-all duration-200 touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",{variants:{variant:{primary:"bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600",secondary:"bg-muted text-foreground hover:bg-muted/80",danger:"bg-danger text-white hover:bg-danger/90",ghost:"bg-transparent text-foreground hover:bg-muted"},size:{sm:"px-3 py-1.5 text-sm",md:"",lg:"px-6 py-3 text-lg"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}});function l(e){let{variant:t="primary",size:a="md",fullWidth:n=!1,loading:l=!1,disabled:d,className:c="",children:u,...f}=e,m=d||l,x=(0,s.cn)(o({variant:t,size:a,fullWidth:n}),!m&&"motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",m&&"opacity-50 cursor-not-allowed",c);return(0,r.jsxs)("button",{className:x,disabled:m,...f,children:[l&&(0,r.jsx)(i.y,{size:"sm",className:"-ml-1 mr-2"}),u]})}},32209:(e,t,a)=>{a.d(t,{S:()=>d});var r=a(95155),n=a(12115),s=a(38162),i=a(7125),o=a(5917),l=a(87531);let d=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.bL,{ref:t,className:(0,l.cn)("peer inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded-sm border border-input bg-surface text-surface-foreground shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-accent-600 data-[state=checked]:bg-accent-600 data-[state=checked]:text-white","data-[state=indeterminate]:border-accent-600 data-[state=indeterminate]:bg-accent-600 data-[state=indeterminate]:text-white",a),...n,children:(0,r.jsx)(s.C1,{className:"flex items-center justify-center text-current",children:"indeterminate"===n.checked?(0,r.jsx)(i.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"}):(0,r.jsx)(o.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"})})})});d.displayName="Checkbox"},36402:(e,t,a)=>{a.d(t,{SC:()=>f,TM:()=>l,aF:()=>c});var r=a(95155),n=a(12115),s=a(18955),i=a(94465),o=a(31166);function l(e){let{isOpen:t,title:a,description:n,confirmLabel:l,cancelLabel:d,variant:c="default",onConfirm:u,onCancel:f}=e,m=(0,s.c)("common"),x="danger"===c;return(0,r.jsx)(i.a,{isOpen:t,onClose:f,title:null!=a?a:m("confirmDialog.title"),size:"sm",showCloseButton:!1,children:(0,r.jsxs)("div",{className:"space-y-4","data-testid":"confirm-dialog",children:[(0,r.jsx)("p",{className:"text-sm text-foreground whitespace-pre-line",children:n}),(0,r.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,r.jsx)(o.$,{type:"button",variant:"secondary",size:"sm",autoFocus:x,onClick:f,"data-testid":"confirm-dialog-cancel",children:null!=d?d:m("cancel")}),(0,r.jsx)(o.$,{type:"button",variant:x?"danger":"primary",size:"sm",autoFocus:!x,onClick:u,"data-testid":"confirm-dialog-confirm",children:null!=l?l:m("confirmDialog.confirm")})]})]})})}let d=(0,n.createContext)(null);function c(e){var t,a;let{children:s}=e,[i,o]=(0,n.useState)(null),c=(0,n.useRef)(null),u=(0,n.useRef)(null);(0,n.useEffect)(()=>{i&&(u.current=i.options)},[i]);let f=null!=(t=null==i?void 0:i.options)?t:u.current,m=(0,n.useCallback)(e=>new Promise(t=>{c.current=document.activeElement instanceof HTMLElement?document.activeElement:null,o(a=>(null==a||a.resolve(!1),{options:e,resolve:t}))}),[]),x=(0,n.useCallback)(e=>{var t;o(t=>(null==t||t.resolve(e),null)),null==(t=c.current)||t.focus(),c.current=null},[]);return(0,r.jsxs)(d.Provider,{value:m,children:[s,(0,r.jsx)(l,{isOpen:null!==i,title:null==f?void 0:f.title,description:null!=(a=null==f?void 0:f.description)?a:"",confirmLabel:null==f?void 0:f.confirmLabel,cancelLabel:null==f?void 0:f.cancelLabel,variant:null==f?void 0:f.variant,onConfirm:()=>x(!0),onCancel:()=>x(!1)})]})}let u=async()=>!1;function f(){var e;return null!=(e=(0,n.useContext)(d))?e:u}},40051:(e,t,a)=>{a.d(t,{E:()=>s});var r=a(95155);a(12115);var n=a(87531);function s(e){let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,n.cn)("animate-pulse rounded-md bg-muted",t),"aria-hidden":"true",...a})}},47972:(e,t,a)=>{a.d(t,{Wu:()=>c,ZB:()=>d,Zp:()=>o,aR:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531);let i=(0,n.F)("bg-surface text-surface-foreground rounded-lg border border-border shadow-sm",{variants:{variant:{default:"",elevated:"bg-gradient-to-b from-surface to-surface-2 shadow-md",interactive:"cursor-pointer transition-all duration-200 hover:border-accent-500 hover:shadow-md motion-safe:hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-accent-500 focus-visible:shadow-md motion-safe:focus-visible:-translate-y-0.5"},hover:{true:"transition-shadow duration-200 hover:shadow-md",false:""},interactive:{true:"cursor-pointer transition-all duration-200 hover:shadow-lg active:shadow-md motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",false:""},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{variant:"default",hover:!1,interactive:!1,padding:"md"}});function o(e){let{variant:t="default",hover:a=!1,interactive:n=!1,padding:o="md",className:l="",children:d,...c}=e;return(0,r.jsx)("div",{className:(0,s.cn)(i({variant:t,hover:a,interactive:n,padding:o}),l),...c,children:d})}function l(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("div",{className:(0,s.cn)("mb-3",t),...n,children:a})}function d(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("h3",{className:(0,s.cn)("text-lg font-semibold text-surface-foreground",t),...n,children:a})}function c(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("div",{className:(0,s.cn)(t),...n,children:a})}},48407:(e,t,a)=>{a.d(t,{Ex:()=>s.E,$n:()=>r.$,Zp:()=>n.Zp,Wu:()=>n.Wu,aR:()=>n.aR,ZB:()=>n.ZB,Sc:()=>b.S,TM:()=>d.TM,nF:()=>i.n,pd:()=>c.p,Jh:()=>l.a,z6:()=>y,CU:()=>j,l6:()=>L,gC:()=>A,eb:()=>S,bq:()=>T,yv:()=>M,EA:()=>f.E,y$:()=>m.y,md:()=>o.m,dO:()=>x.d,tU:()=>N.tU,av:()=>N.av,j7:()=>N.j7,Xi:()=>N.Xi,k_:()=>u.T,j1:()=>c.j,SC:()=>d.SC});var r=a(31166),n=a(47972),s=a(52799),i=a(17848),o=a(48481),l=a(94465),d=a(36402),c=a(5590),u=a(25840),f=a(40051),m=a(3005),x=a(91758),b=a(32209),g=a(95155),p=a(12115),h=a(24058),v=a(99051),w=a(87531);let y=p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(h.bL,{ref:t,className:(0,w.cn)("grid gap-2",a),...r})});y.displayName="RadioGroup";let j=p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(h.q7,{ref:t,className:(0,w.cn)("aspect-square h-4 w-4 shrink-0 cursor-pointer rounded-full border border-input bg-surface text-accent-600 shadow-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-accent-600",a),...r,children:(0,g.jsx)(h.C1,{className:"flex items-center justify-center",children:(0,g.jsx)(v.A,{className:"h-2 w-2 fill-accent-600 text-accent-600","aria-hidden":"true"})})})});j.displayName="RadioGroupItem";var N=a(23838),k=a(55644),C=a(24033),R=a(12108),E=a(5917),z=a(59854);let L=k.bL;k.YJ;let M=k.WT,T=p.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,g.jsxs)(k.l9,{ref:t,className:(0,w.cn)("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-surface-foreground shadow-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:line-clamp-1",a),...n,children:[r,(0,g.jsx)(k.In,{asChild:!0,children:(0,g.jsx)(C.A,{size:16,className:"opacity-60","aria-hidden":"true"})})]})});T.displayName="SelectTrigger";let A=p.forwardRef((e,t)=>{let{className:a,children:r,position:n="popper",...s}=e;return(0,g.jsx)(k.ZL,{children:(0,g.jsxs)(k.UC,{ref:t,position:n,style:{zIndex:z.M.POPOVER},className:(0,w.cn)("relative max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface text-surface-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",a),...s,children:[(0,g.jsx)(k.PP,{className:"flex h-6 items-center justify-center",children:(0,g.jsx)(R.A,{size:16,"aria-hidden":"true"})}),(0,g.jsx)(k.LM,{className:(0,w.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,g.jsx)(k.wn,{className:"flex h-6 items-center justify-center",children:(0,g.jsx)(C.A,{size:16,"aria-hidden":"true"})})]})})});A.displayName="SelectContent",p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(k.JU,{ref:t,className:(0,w.cn)("px-2 py-1.5 text-xs font-semibold text-muted-foreground",a),...r})}).displayName="SelectLabel";let S=p.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,g.jsxs)(k.q7,{ref:t,className:(0,w.cn)("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,g.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,g.jsx)(k.VF,{children:(0,g.jsx)(E.A,{size:16,"aria-hidden":"true"})})}),(0,g.jsx)(k.p4,{children:r})]})});S.displayName="SelectItem",p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(k.wv,{ref:t,className:(0,w.cn)("-mx-1 my-1 h-px bg-border",a),...r})}).displayName="SelectSeparator";var O=a(47520);O.Kq,O.bL,O.l9,p.forwardRef((e,t)=>{let{className:a,sideOffset:r=4,children:n,...s}=e;return(0,g.jsx)(O.ZL,{children:(0,g.jsxs)(O.UC,{ref:t,sideOffset:r,style:{zIndex:z.M.POPOVER},className:(0,w.cn)("overflow-hidden rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...s,children:[n,(0,g.jsx)(O.i3,{className:"fill-foreground"})]})})}).displayName="TooltipContent",a(26232),a(79651)},48481:(e,t,a)=>{a.d(t,{m:()=>u});var r=a(95155);a(12115);var n=a(18955),s=a(87531);let i={idle:{colorClass:"bg-muted-foreground",labelKey:"status.idle"},ready:{colorClass:"bg-success",labelKey:"status.ready"},running:{colorClass:"bg-success text-success ring-2 ring-success/40",animationClass:"animate-status-glow",labelKey:"status.running"},generating:{colorClass:"bg-success text-success ring-2 ring-success/40",animationClass:"animate-status-glow",labelKey:"status.generating"},waiting:{colorClass:"bg-warning text-warning ring-4 ring-warning/50",animationClass:"animate-status-attention",labelKey:"status.waiting"},error:{colorClass:"bg-danger",labelKey:"status.error"}},o={colorClass:"bg-warning text-warning ring-2 ring-warning/40",animationClass:"animate-status-glow",labelKey:"status.waiting"},l=new Set(["menu","unclassified"]),d={colorClass:"bg-muted-foreground",labelKey:"status.unknown"},c={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"};function u(e){let{status:t,size:a="md",label:u,waitingKind:f,className:m,...x}=e,b=(0,n.c)("common"),g=function(e,t){var a;let r=null!=(a=i[e])?a:d;return"waiting"!==e?r:t&&l.has(t)?o:r}(t,f),p=null!=u?u:b(g.labelKey);return(0,r.jsx)("span",{className:(0,s.cn)("inline-block flex-shrink-0 rounded-full",c[a],g.colorClass,g.animationClass,m),title:p,"aria-label":p,...x})}},52799:(e,t,a)=>{a.d(t,{E:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531);let i=(0,n.F)("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{variants:{variant:{success:"bg-success-subtle text-success-foreground",warning:"bg-warning-subtle text-warning-foreground",error:"bg-danger-subtle text-danger-foreground",info:"bg-accent-100 dark:bg-accent-900 text-accent-800 dark:text-accent-300",gray:"bg-muted text-muted-foreground"}},defaultVariants:{variant:"gray"}}),o={success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",gray:"bg-muted-foreground"};function l(e){let{variant:t="gray",dot:a=!1,className:n="",children:l,...d}=e;return(0,r.jsxs)("span",{className:(0,s.cn)(i({variant:t}),n),...d,children:[a&&(0,r.jsx)("span",{className:(0,s.cn)("mr-1.5 inline-block h-2 w-2 rounded-full",o[t]),"aria-hidden":"true"}),l]})}},59854:(e,t,a)=>{a.d(t,{M:()=>r});let r={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,POPOVER:65,CONTEXT_MENU:70}},79651:(e,t,a)=>{a.d(t,{u:()=>s});var r=a(95155);a(12115);var n=a(87531);function s(e){let{className:t,children:a,...s}=e;return(0,r.jsx)("kbd",{className:(0,n.cn)("inline-flex h-5 min-w-[1.25rem] items-center justify-center rounded-sm border border-border bg-surface px-1","font-mono text-[10px] font-medium leading-none text-muted-foreground",t),...s,children:a})}},87531:(e,t,a)=>{a.d(t,{cn:()=>s});var r=a(2821),n=a(75889);function s(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}},91758:(e,t,a)=>{a.d(t,{d:()=>o});var r=a(95155),n=a(12115),s=a(27599),i=a(87531);let o=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.bL,{ref:t,className:(0,i.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-accent-600 data-[state=unchecked]:bg-muted",a),...n,children:(0,r.jsx)(s.zi,{className:(0,i.cn)("pointer-events-none block h-4 w-4 rounded-full bg-surface shadow-lg ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});o.displayName="Switch"},92539:(e,t,a)=>{a.d(t,{r:()=>n});var r=a(12115);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{active:t=!0,initialFocus:a=!0,restoreFocus:n=!0}=e,s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!t)return;let e=s.current;if(!e)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,i=null!==r&&e.contains(r);a&&!i&&(e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.focus());let o=t=>{if("Tab"!==t.key)return;let a=Array.from(e.querySelectorAll('a[href],area[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),iframe,audio[controls],video[controls],[contenteditable]:not([contenteditable="false"]),[tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("hidden")&&"true"!==e.getAttribute("aria-hidden"));if(0===a.length){t.preventDefault(),e.focus();return}let r=a[0],n=a[a.length-1],s=document.activeElement instanceof HTMLElement?document.activeElement:null,i=s===e;if(!s||!e.contains(s)){t.preventDefault(),(t.shiftKey?n:r).focus();return}t.shiftKey?(s===r||i)&&(t.preventDefault(),n.focus()):(s===n||i)&&(t.preventDefault(),r.focus())};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),n&&!i&&r&&document.contains(r)&&r.focus()}},[t,a,n]),s}},94465:(e,t,a)=>{a.d(t,{a:()=>x});var r=a(95155),n=a(12115),s=a(47650),i=a(18955),o=a(83101),l=a(59854),d=a(9900),c=a(9286),u=a(92539),f=a(87531);let m=(0,o.F)("",{variants:{size:{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}},defaultVariants:{size:"lg"}});function x(e){let{isOpen:t,onClose:a,title:o,children:x,size:b="lg",showCloseButton:g=!0,disableClose:p=!1}=e,h=(0,i.c)("common"),v=(0,n.useId)(),w=(0,u.r)({active:t}),{shouldRender:y,isExiting:j}=(0,c.O)(t,d.Ys),N=j?"closed":"open",k=(0,n.useRef)(!1),C=(0,n.useRef)(!1);return((0,n.useEffect)(()=>{if(p)return;let e=e=>{"Escape"===e.key&&t&&a()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,a,p]),(0,n.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[t]),y)?(0,s.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:l.M.MODAL},children:[(0,r.jsx)("div",{"data-state":N,"aria-hidden":"true",className:"fixed inset-0 bg-black/50 transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"}),(0,r.jsx)("div",{"data-testid":"modal-backdrop-surface",className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",onMouseDown:e=>{k.current=e.target===e.currentTarget},onMouseUp:e=>{C.current=e.target===e.currentTarget},onClick:e=>{let t=k.current,r=C.current;k.current=!1,C.current=!1,t&&r&&!p&&!j&&e.target===e.currentTarget&&a()},children:(0,r.jsxs)("div",{ref:w,"data-state":N,"data-testid":"modal-panel",role:"dialog","aria-modal":"true","aria-labelledby":o?v:void 0,tabIndex:-1,className:(0,f.cn)("relative w-full",m({size:b}),"max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-surface rounded-lg shadow-xl transform transition-all","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"),children:[(o||g)&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-border flex-shrink-0",children:[(0,r.jsx)("h3",{id:v,className:"text-base sm:text-lg font-semibold text-foreground truncate pr-2",children:o}),g&&(0,r.jsx)("button",{onClick:a,"aria-label":h("close"),className:"text-muted-foreground hover:text-foreground transition-colors flex-shrink-0 touch-manipulation",children:(0,r.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:x})]})})]}),document.body):null}}}]);
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8407],{3005:(e,t,a)=>{a.d(t,{y:()=>i});var r=a(95155);a(12115);var n=a(87531);let s={xs:"h-3 w-3",sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6",xl:"h-8 w-8"},o={current:"",accent:"text-accent-600 dark:text-accent-400",muted:"text-muted-foreground"};function i(e){let{size:t="md",variant:a="current",className:i,...l}=e;return(0,r.jsxs)("svg",{className:(0,n.cn)("animate-spin",s[t],o[a],i),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true",...l,children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}},5590:(e,t,a)=>{a.d(t,{j:()=>i,p:()=>l});var r=a(95155),n=a(12115),s=a(83101),o=a(87531);let i=(0,s.F)("flex w-full rounded-md border border-input bg-surface dark:bg-surface-2 text-surface-foreground shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring disabled:cursor-not-allowed disabled:opacity-50",{variants:{inputSize:{sm:"h-8 px-2.5 py-1 text-sm",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-base"}},defaultVariants:{inputSize:"md"}}),l=n.forwardRef((e,t)=>{let{className:a,inputSize:n,type:s="text",...l}=e;return(0,r.jsx)("input",{ref:t,type:s,className:(0,o.cn)(i({inputSize:n}),a),...l})});l.displayName="Input"},9286:(e,t,a)=>{a.d(t,{O:()=>n});var r=a(12115);function n(e,t){let[a,n]=(0,r.useState)(e?"open":"closed");return e&&"open"!==a?n("open"):e||"open"!==a||n("exiting"),(0,r.useEffect)(()=>{if(e||"exiting"!==a)return;let r=setTimeout(()=>{n("closed")},t);return()=>clearTimeout(r)},[e,a,t]),{shouldRender:e||"closed"!==a,isExiting:!e&&"exiting"===a}}},9900:(e,t,a)=>{a.d(t,{$B:()=>d,I2:()=>s,LK:()=>i,Ys:()=>l,pX:()=>r,s7:()=>n,tX:()=>o});let r=2e3,n=1500,s=2e3,o=150,i=100,l=200,d=100},17848:(e,t,a)=>{a.d(t,{n:()=>n});var r=a(95155);function n(e){let{className:t="w-3.5 h-3.5",color:a}=e;return(0,r.jsx)("svg",{className:"".concat(t," flex-shrink-0"),viewBox:"0 0 24 24",fill:null!=a?a:"none",stroke:a?"none":"currentColor",strokeWidth:2*!a,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})})}},23838:(e,t,a)=>{a.d(t,{Xi:()=>c,av:()=>u,j7:()=>d,tU:()=>l});var r=a(95155),n=a(12115),s=a(25667),o=a(87531);let i=n.createContext("underline"),l=n.forwardRef((e,t)=>{let{variant:a="underline",...n}=e;return(0,r.jsx)(i.Provider,{value:a,children:(0,r.jsx)(s.bL,{ref:t,...n})})});l.displayName="Tabs";let d=n.forwardRef((e,t)=>{let{className:a,...l}=e,d=n.useContext(i);return(0,r.jsx)(s.B8,{ref:t,className:(0,o.cn)("inline-flex items-center","pill"===d?"gap-1 rounded-lg bg-muted p-1":"gap-4 border-b border-border",a),...l})});d.displayName="TabsList";let c=n.forwardRef((e,t)=>{let{className:a,...l}=e,d=n.useContext(i);return(0,r.jsx)(s.l9,{ref:t,className:(0,o.cn)("inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50","pill"===d?"rounded-md px-3 py-1.5 text-muted-foreground data-[state=active]:bg-surface data-[state=active]:text-surface-foreground data-[state=active]:shadow-sm":"-mb-px border-b-2 border-transparent px-1 py-2 text-muted-foreground hover:text-foreground data-[state=active]:border-accent-500 data-[state=active]:text-accent-600",a),...l})});c.displayName="TabsTrigger";let u=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.UC,{ref:t,className:(0,o.cn)("mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",a),...n})});u.displayName="TabsContent"},25840:(e,t,a)=>{a.d(t,{T:()=>o});var r=a(95155),n=a(12115),s=a(87531);let o=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)("textarea",{ref:t,className:(0,s.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-surface-foreground shadow-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring","disabled:cursor-not-allowed disabled:opacity-50",a),...n})});o.displayName="Textarea"},26232:(e,t,a)=>{a.d(t,{Hr:()=>b,Ht:()=>x,SQ:()=>f,_2:()=>m,lp:()=>g,mB:()=>p,rI:()=>c,ty:()=>u});var r=a(95155),n=a(12115),s=a(47971),o=a(5917),i=a(99051),l=a(59854),d=a(87531);let c=s.bL,u=s.l9;s.YJ;let f=n.forwardRef((e,t)=>{let{className:a,sideOffset:n=4,...o}=e;return(0,r.jsx)(s.ZL,{children:(0,r.jsx)(s.UC,{ref:t,sideOffset:n,style:{zIndex:l.M.POPOVER},className:(0,d.cn)("min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface p-1 text-surface-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...o})})});f.displayName="DropdownMenuContent";let m=n.forwardRef((e,t)=>{let{className:a,inset:n,...o}=e;return(0,r.jsx)(s.q7,{ref:t,className:(0,d.cn)("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",a),...o})});m.displayName="DropdownMenuItem",n.forwardRef((e,t)=>{let{className:a,children:n,checked:i,...l}=e;return(0,r.jsxs)(s.H_,{ref:t,checked:i,className:(0,d.cn)("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...l,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(o.A,{size:16,"aria-hidden":"true"})})}),n]})}).displayName="DropdownMenuCheckboxItem";let x=n.forwardRef((e,t)=>{let{className:a,children:n,...o}=e;return(0,r.jsxs)(s.hN,{ref:t,className:(0,d.cn)("relative flex cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...o,children:[(0,r.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,r.jsx)(s.VF,{children:(0,r.jsx)(i.A,{size:8,className:"fill-current","aria-hidden":"true"})})}),n]})});x.displayName="DropdownMenuRadioItem";let b=s.z6,g=n.forwardRef((e,t)=>{let{className:a,inset:n,...o}=e;return(0,r.jsx)(s.JU,{ref:t,className:(0,d.cn)("px-2 py-1.5 text-xs font-semibold text-muted-foreground",n&&"pl-8",a),...o})});g.displayName="DropdownMenuLabel";let p=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.wv,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-border",a),...n})});p.displayName="DropdownMenuSeparator"},31166:(e,t,a)=>{a.d(t,{$:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531),o=a(3005);let i=(0,n.F)("inline-flex items-center justify-center px-4 py-2 rounded-md font-medium transition-all duration-200 touch-manipulation focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background",{variants:{variant:{primary:"bg-accent-600 dark:bg-accent-500 text-white hover:bg-accent-700 dark:hover:bg-accent-600",secondary:"bg-muted text-foreground hover:bg-muted/80",danger:"bg-danger text-white hover:bg-danger/90",ghost:"bg-transparent text-foreground hover:bg-muted"},size:{sm:"px-3 py-1.5 text-sm",md:"",lg:"px-6 py-3 text-lg"},fullWidth:{true:"w-full",false:""}},defaultVariants:{variant:"primary",size:"md",fullWidth:!1}});function l(e){let{variant:t="primary",size:a="md",fullWidth:n=!1,loading:l=!1,disabled:d,className:c="",children:u,...f}=e,m=d||l,x=(0,s.cn)(i({variant:t,size:a,fullWidth:n}),!m&&"motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",m&&"opacity-50 cursor-not-allowed",c);return(0,r.jsxs)("button",{className:x,disabled:m,...f,children:[l&&(0,r.jsx)(o.y,{size:"sm",className:"-ml-1 mr-2"}),u]})}},32209:(e,t,a)=>{a.d(t,{S:()=>d});var r=a(95155),n=a(12115),s=a(38162),o=a(7125),i=a(5917),l=a(87531);let d=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.bL,{ref:t,className:(0,l.cn)("peer inline-flex h-4 w-4 shrink-0 cursor-pointer items-center justify-center rounded-sm border border-input bg-surface text-surface-foreground shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-accent-600 data-[state=checked]:bg-accent-600 data-[state=checked]:text-white","data-[state=indeterminate]:border-accent-600 data-[state=indeterminate]:bg-accent-600 data-[state=indeterminate]:text-white",a),...n,children:(0,r.jsx)(s.C1,{className:"flex items-center justify-center text-current",children:"indeterminate"===n.checked?(0,r.jsx)(o.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"}):(0,r.jsx)(i.A,{className:"h-3 w-3",strokeWidth:3,"aria-hidden":"true"})})})});d.displayName="Checkbox"},36402:(e,t,a)=>{a.d(t,{SC:()=>f,TM:()=>l,aF:()=>c});var r=a(95155),n=a(12115),s=a(18955),o=a(94465),i=a(31166);function l(e){let{isOpen:t,title:a,description:n,confirmLabel:l,cancelLabel:d,variant:c="default",onConfirm:u,onCancel:f}=e,m=(0,s.c)("common"),x="danger"===c;return(0,r.jsx)(o.a,{isOpen:t,onClose:f,title:null!=a?a:m("confirmDialog.title"),size:"sm",showCloseButton:!1,children:(0,r.jsxs)("div",{className:"space-y-4","data-testid":"confirm-dialog",children:[(0,r.jsx)("p",{className:"text-sm text-foreground whitespace-pre-line",children:n}),(0,r.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,r.jsx)(i.$,{type:"button",variant:"secondary",size:"sm",autoFocus:x,onClick:f,"data-testid":"confirm-dialog-cancel",children:null!=d?d:m("cancel")}),(0,r.jsx)(i.$,{type:"button",variant:x?"danger":"primary",size:"sm",autoFocus:!x,onClick:u,"data-testid":"confirm-dialog-confirm",children:null!=l?l:m("confirmDialog.confirm")})]})]})})}let d=(0,n.createContext)(null);function c(e){var t,a;let{children:s}=e,[o,i]=(0,n.useState)(null),c=(0,n.useRef)(null),u=(0,n.useRef)(null);(0,n.useEffect)(()=>{o&&(u.current=o.options)},[o]);let f=null!=(t=null==o?void 0:o.options)?t:u.current,m=(0,n.useCallback)(e=>new Promise(t=>{c.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i(a=>(null==a||a.resolve(!1),{options:e,resolve:t}))}),[]),x=(0,n.useCallback)(e=>{var t;i(t=>(null==t||t.resolve(e),null)),null==(t=c.current)||t.focus(),c.current=null},[]);return(0,r.jsxs)(d.Provider,{value:m,children:[s,(0,r.jsx)(l,{isOpen:null!==o,title:null==f?void 0:f.title,description:null!=(a=null==f?void 0:f.description)?a:"",confirmLabel:null==f?void 0:f.confirmLabel,cancelLabel:null==f?void 0:f.cancelLabel,variant:null==f?void 0:f.variant,onConfirm:()=>x(!0),onCancel:()=>x(!1)})]})}let u=async()=>!1;function f(){var e;return null!=(e=(0,n.useContext)(d))?e:u}},40051:(e,t,a)=>{a.d(t,{E:()=>s});var r=a(95155);a(12115);var n=a(87531);function s(e){let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,n.cn)("animate-pulse rounded-md bg-muted",t),"aria-hidden":"true",...a})}},47972:(e,t,a)=>{a.d(t,{Wu:()=>c,ZB:()=>d,Zp:()=>i,aR:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531);let o=(0,n.F)("bg-surface text-surface-foreground rounded-lg border border-border shadow-sm",{variants:{variant:{default:"",elevated:"bg-gradient-to-b from-surface to-surface-2 shadow-md",interactive:"cursor-pointer transition-all duration-200 hover:border-accent-500 hover:shadow-md motion-safe:hover:-translate-y-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-accent-500 focus-visible:shadow-md motion-safe:focus-visible:-translate-y-0.5"},hover:{true:"transition-shadow duration-200 hover:shadow-md",false:""},interactive:{true:"cursor-pointer transition-all duration-200 hover:shadow-lg active:shadow-md motion-safe:hover:-translate-y-0.5 motion-safe:active:translate-y-0",false:""},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6"}},defaultVariants:{variant:"default",hover:!1,interactive:!1,padding:"md"}});function i(e){let{variant:t="default",hover:a=!1,interactive:n=!1,padding:i="md",className:l="",children:d,...c}=e;return(0,r.jsx)("div",{className:(0,s.cn)(o({variant:t,hover:a,interactive:n,padding:i}),l),...c,children:d})}function l(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("div",{className:(0,s.cn)("mb-3",t),...n,children:a})}function d(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("h3",{className:(0,s.cn)("text-lg font-semibold text-surface-foreground",t),...n,children:a})}function c(e){let{className:t="",children:a,...n}=e;return(0,r.jsx)("div",{className:(0,s.cn)(t),...n,children:a})}},48407:(e,t,a)=>{a.d(t,{Ex:()=>s.E,$n:()=>r.$,Zp:()=>n.Zp,Wu:()=>n.Wu,aR:()=>n.aR,ZB:()=>n.ZB,Sc:()=>b.S,TM:()=>d.TM,nF:()=>o.n,pd:()=>c.p,Jh:()=>l.a,z6:()=>y,CU:()=>j,l6:()=>L,gC:()=>T,eb:()=>O,bq:()=>S,yv:()=>M,EA:()=>f.E,y$:()=>m.y,md:()=>i.m,dO:()=>x.d,tU:()=>N.tU,av:()=>N.av,j7:()=>N.j7,Xi:()=>N.Xi,k_:()=>u.T,j1:()=>c.j,SC:()=>d.SC});var r=a(31166),n=a(47972),s=a(52799),o=a(17848),i=a(48481),l=a(94465),d=a(36402),c=a(5590),u=a(25840),f=a(40051),m=a(3005),x=a(91758),b=a(32209),g=a(95155),p=a(12115),h=a(24058),v=a(99051),w=a(87531);let y=p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(h.bL,{ref:t,className:(0,w.cn)("grid gap-2",a),...r})});y.displayName="RadioGroup";let j=p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(h.q7,{ref:t,className:(0,w.cn)("aspect-square h-4 w-4 shrink-0 cursor-pointer rounded-full border border-input bg-surface text-accent-600 shadow-sm","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:border-accent-600",a),...r,children:(0,g.jsx)(h.C1,{className:"flex items-center justify-center",children:(0,g.jsx)(v.A,{className:"h-2 w-2 fill-accent-600 text-accent-600","aria-hidden":"true"})})})});j.displayName="RadioGroupItem";var N=a(23838),k=a(55644),C=a(24033),E=a(12108),R=a(5917),z=a(59854);let L=k.bL;k.YJ;let M=k.WT,S=p.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,g.jsxs)(k.l9,{ref:t,className:(0,w.cn)("flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-surface dark:bg-surface-2 px-3 py-2 text-sm text-surface-foreground shadow-sm","placeholder:text-muted-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&>span]:line-clamp-1",a),...n,children:[r,(0,g.jsx)(k.In,{asChild:!0,children:(0,g.jsx)(C.A,{size:16,className:"opacity-60","aria-hidden":"true"})})]})});S.displayName="SelectTrigger";let T=p.forwardRef((e,t)=>{let{className:a,children:r,position:n="popper",...s}=e;return(0,g.jsx)(k.ZL,{children:(0,g.jsxs)(k.UC,{ref:t,position:n,style:{zIndex:z.M.POPOVER},className:(0,w.cn)("relative max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-surface text-surface-foreground shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",a),...s,children:[(0,g.jsx)(k.PP,{className:"flex h-6 items-center justify-center",children:(0,g.jsx)(E.A,{size:16,"aria-hidden":"true"})}),(0,g.jsx)(k.LM,{className:(0,w.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,g.jsx)(k.wn,{className:"flex h-6 items-center justify-center",children:(0,g.jsx)(C.A,{size:16,"aria-hidden":"true"})})]})})});T.displayName="SelectContent",p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(k.JU,{ref:t,className:(0,w.cn)("px-2 py-1.5 text-xs font-semibold text-muted-foreground",a),...r})}).displayName="SelectLabel";let O=p.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,g.jsxs)(k.q7,{ref:t,className:(0,w.cn)("relative flex w-full cursor-pointer select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none","focus:bg-muted focus:text-surface-foreground","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,g.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,g.jsx)(k.VF,{children:(0,g.jsx)(R.A,{size:16,"aria-hidden":"true"})})}),(0,g.jsx)(k.p4,{children:r})]})});O.displayName="SelectItem",p.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,g.jsx)(k.wv,{ref:t,className:(0,w.cn)("-mx-1 my-1 h-px bg-border",a),...r})}).displayName="SelectSeparator";var A=a(47520);A.Kq,A.bL,A.l9,p.forwardRef((e,t)=>{let{className:a,sideOffset:r=4,children:n,...s}=e;return(0,g.jsx)(A.ZL,{children:(0,g.jsxs)(A.UC,{ref:t,sideOffset:r,style:{zIndex:z.M.POPOVER},className:(0,w.cn)("overflow-hidden rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...s,children:[n,(0,g.jsx)(A.i3,{className:"fill-foreground"})]})})}).displayName="TooltipContent",a(26232),a(79651)},48481:(e,t,a)=>{a.d(t,{m:()=>u});var r=a(95155);a(12115);var n=a(18955),s=a(87531);let o={idle:{colorClass:"bg-muted-foreground",labelKey:"status.idle"},ready:{colorClass:"bg-success",labelKey:"status.ready"},running:{colorClass:"bg-success text-success ring-2 ring-success/40",animationClass:"animate-status-glow",labelKey:"status.running"},generating:{colorClass:"bg-success text-success ring-2 ring-success/40",animationClass:"animate-status-glow",labelKey:"status.generating"},waiting:{colorClass:"bg-warning text-warning ring-4 ring-warning/50",animationClass:"animate-status-attention",labelKey:"status.waiting"},error:{colorClass:"bg-danger",labelKey:"status.error"}},i={colorClass:"bg-warning text-warning ring-2 ring-warning/40",animationClass:"animate-status-glow",labelKey:"status.waiting"},l=new Set(["menu","unclassified"]),d={colorClass:"bg-muted-foreground",labelKey:"status.unknown"},c={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"};function u(e){let{status:t,size:a="md",label:u,waitingKind:f,className:m,...x}=e,b=(0,n.c)("common"),g=function(e,t){var a;let r=null!=(a=o[e])?a:d;return"waiting"!==e?r:t&&l.has(t)?i:r}(t,f),p=null!=u?u:b(g.labelKey);return(0,r.jsx)("span",{className:(0,s.cn)("inline-block flex-shrink-0 rounded-full",c[a],g.colorClass,g.animationClass,m),title:p,"aria-label":p,...x})}},52799:(e,t,a)=>{a.d(t,{E:()=>l});var r=a(95155);a(12115);var n=a(83101),s=a(87531);let o=(0,n.F)("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",{variants:{variant:{success:"bg-success-subtle text-success-foreground",warning:"bg-warning-subtle text-warning-foreground",error:"bg-danger-subtle text-danger-foreground",info:"bg-accent-100 dark:bg-accent-900 text-accent-800 dark:text-accent-300",gray:"bg-muted text-muted-foreground"}},defaultVariants:{variant:"gray"}}),i={success:"bg-success",warning:"bg-warning",error:"bg-danger",info:"bg-info",gray:"bg-muted-foreground"};function l(e){let{variant:t="gray",dot:a=!1,className:n="",children:l,...d}=e;return(0,r.jsxs)("span",{className:(0,s.cn)(o({variant:t}),n),...d,children:[a&&(0,r.jsx)("span",{className:(0,s.cn)("mr-1.5 inline-block h-2 w-2 rounded-full",i[t]),"aria-hidden":"true"}),l]})}},59854:(e,t,a)=>{a.d(t,{M:()=>r});let r={DROPDOWN:10,SIDEBAR:30,MODAL:50,MAXIMIZED_EDITOR:55,TOAST:60,POPOVER:65,CONTEXT_MENU:70}},77873:(e,t,a)=>{function r(e){return"Escape"===e.key&&!e.defaultPrevented}a.d(t,{DO:()=>d,SG:()=>u,V$:()=>r,Y9:()=>c,cE:()=>o,en:()=>i,sr:()=>s});let n=new WeakSet;function s(e){n.add(e)}function o(e){return r(e)&&!n.has(e)}let i="data-viewport-layer";function l(e){let t=Number.parseInt(getComputedStyle(e).zIndex,10);return Number.isNaN(t)?null:t}function d(e){let t=l(e);return null!==t&&Array.from(document.querySelectorAll("[".concat(i,"]"))).some(a=>{if(a.contains(e)||e.contains(a))return!1;let r=l(a);return null!==r&&(r>t||r===t&&(e.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_FOLLOWING)!=0)})}function c(e){let t=e.closest("[".concat(i,"]"));return!!t&&(!!d(t)||Array.from(t.querySelectorAll("[".concat(i,"]"))).some(t=>!t.contains(e)))}function u(e){if(e.closest("[".concat(i,"]")))return c(e);let t=e;for(;t.parentElement&&t.parentElement!==document.body;)t=t.parentElement;return null!==l(t)?d(t):null!==document.querySelector("[".concat(i,"]"))}},79651:(e,t,a)=>{a.d(t,{u:()=>s});var r=a(95155);a(12115);var n=a(87531);function s(e){let{className:t,children:a,...s}=e;return(0,r.jsx)("kbd",{className:(0,n.cn)("inline-flex h-5 min-w-[1.25rem] items-center justify-center rounded-sm border border-border bg-surface px-1","font-mono text-[10px] font-medium leading-none text-muted-foreground",t),...s,children:a})}},87531:(e,t,a)=>{a.d(t,{cn:()=>s});var r=a(2821),n=a(75889);function s(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,n.QP)((0,r.$)(t))}},91758:(e,t,a)=>{a.d(t,{d:()=>i});var r=a(95155),n=a(12115),s=a(27599),o=a(87531);let i=n.forwardRef((e,t)=>{let{className:a,...n}=e;return(0,r.jsx)(s.bL,{ref:t,className:(0,o.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50","data-[state=checked]:bg-accent-600 data-[state=unchecked]:bg-muted",a),...n,children:(0,r.jsx)(s.zi,{className:(0,o.cn)("pointer-events-none block h-4 w-4 rounded-full bg-surface shadow-lg ring-0 transition-transform","data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});i.displayName="Switch"},92539:(e,t,a)=>{a.d(t,{r:()=>n});var r=a(12115);function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{active:t=!0,initialFocus:a=!0,restoreFocus:n=!0}=e,s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{if(!t)return;let e=s.current;if(!e)return;let r=document.activeElement instanceof HTMLElement?document.activeElement:null,o=null!==r&&e.contains(r);a&&!o&&(e.hasAttribute("tabindex")||e.setAttribute("tabindex","-1"),e.focus());let i=t=>{if("Tab"!==t.key)return;let a=Array.from(e.querySelectorAll('a[href],area[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),iframe,audio[controls],video[controls],[contenteditable]:not([contenteditable="false"]),[tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("hidden")&&"true"!==e.getAttribute("aria-hidden"));if(0===a.length){t.preventDefault(),e.focus();return}let r=a[0],n=a[a.length-1],s=document.activeElement instanceof HTMLElement?document.activeElement:null,o=s===e;if(!s||!e.contains(s)){t.preventDefault(),(t.shiftKey?n:r).focus();return}t.shiftKey?(s===r||o)&&(t.preventDefault(),n.focus()):(s===n||o)&&(t.preventDefault(),r.focus())};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n&&!o&&r&&document.contains(r)&&r.focus()}},[t,a,n]),s}},94465:(e,t,a)=>{a.d(t,{a:()=>b});var r=a(95155),n=a(12115),s=a(47650),o=a(18955),i=a(83101),l=a(59854),d=a(9900),c=a(9286),u=a(92539),f=a(87531),m=a(77873);let x=(0,i.F)("",{variants:{size:{sm:"max-w-[calc(100vw-2rem)] sm:max-w-md",md:"max-w-[calc(100vw-2rem)] sm:max-w-2xl",lg:"max-w-[calc(100vw-2rem)] sm:max-w-4xl",xl:"max-w-[calc(100vw-2rem)] sm:max-w-6xl",full:"max-w-[calc(100vw-2rem)] sm:max-w-[95vw]"}},defaultVariants:{size:"lg"}});function b(e){let{isOpen:t,onClose:a,title:i,children:b,size:g="lg",showCloseButton:p=!0,disableClose:h=!1}=e,v=(0,o.c)("common"),w=(0,n.useId)(),y=(0,u.r)({active:t}),{shouldRender:j,isExiting:N}=(0,c.O)(t,d.Ys),k=N?"closed":"open",C=(0,n.useRef)(!1),E=(0,n.useRef)(!1);return((0,n.useEffect)(()=>{if(h)return;let e=e=>{(0,m.cE)(e)&&t&&a()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,a,h]),(0,n.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[t]),j)?(0,s.createPortal)((0,r.jsxs)("div",{className:"fixed inset-0 overflow-y-auto",style:{zIndex:l.M.MODAL},children:[(0,r.jsx)("div",{"data-state":k,"aria-hidden":"true",className:"fixed inset-0 bg-black/50 transition-opacity data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"}),(0,r.jsx)("div",{"data-testid":"modal-backdrop-surface",className:"relative flex min-h-full items-center justify-center p-2 sm:p-4",onMouseDown:e=>{C.current=e.target===e.currentTarget},onMouseUp:e=>{E.current=e.target===e.currentTarget},onClick:e=>{let t=C.current,r=E.current;C.current=!1,E.current=!1,t&&r&&!h&&!N&&e.target===e.currentTarget&&a()},children:(0,r.jsxs)("div",{ref:y,"data-state":k,"data-testid":"modal-panel",role:"dialog","aria-modal":"true","aria-labelledby":i?w:void 0,tabIndex:-1,className:(0,f.cn)("relative w-full",x({size:g}),"max-h-[calc(100vh-1rem)] sm:max-h-[calc(100vh-2rem)] flex flex-col bg-surface rounded-lg shadow-xl transform transition-all","data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:duration-200","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:duration-200 data-[state=closed]:fill-mode-forwards"),children:[(i||p)&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6 py-3 sm:py-4 border-b border-border flex-shrink-0",children:[(0,r.jsx)("h3",{id:w,className:"text-base sm:text-lg font-semibold text-foreground truncate pr-2",children:i}),p&&(0,r.jsx)("button",{onClick:a,"aria-label":v("close"),className:"text-muted-foreground hover:text-foreground transition-colors flex-shrink-0 touch-manipulation",children:(0,r.jsx)("svg",{className:"w-5 h-5 sm:w-6 sm:h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-4 sm:px-6 py-3 sm:py-4 overflow-y-auto flex-1 min-h-0",children:b})]})})]}),document.body):null}}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{13673:()=>{},23252:(e,t,n)=>{"use strict";n.d(t,{AppProviders:()=>M});var r=n(95155),s=n(20063);n(95704);let a=["/login","/api/auth/login","/api/auth/logout","/api/auth/status","/api/remote/pair","/manifest.webmanifest","/sw.js","/offline"];var i=n(3809),l=n(5379),o=n(32916),d=n(65380),c=n(22592),u=n(92614),m=n(70628),h=n(66966),x=n(89275),f=n(60199),p=n(36402),b=n(63470),g=n(40823),v=n(58165),w=n(94442),j=n(72604),y=n(95275),k=n(79832),N=n(12115),C=n(18955),S=n(89559),I=n(59854),T=n(77016);function A(){let e=(0,C.c)("pwa"),[t,n]=(0,N.useState)(null),s=(0,N.useRef)(!1),a=(0,T.W)();return((0,N.useEffect)(()=>{if("undefined"==typeof navigator||!("serviceWorker"in navigator))return;let e=!1,t=t=>{e||n(t)};navigator.serviceWorker.register("/sw.js").then(e=>{e.waiting&&navigator.serviceWorker.controller&&t(e.waiting),e.addEventListener("updatefound",()=>{let n=e.installing;n&&n.addEventListener("statechange",()=>{"installed"===n.state&&navigator.serviceWorker.controller&&t(n)})})}).catch(()=>{});let r=()=>{s.current||(s.current=!0,window.location.reload())};return navigator.serviceWorker.addEventListener("controllerchange",r),()=>{e=!0,navigator.serviceWorker.removeEventListener("controllerchange",r)}},[]),!t||a)?null:(0,r.jsx)("div",{"data-testid":"pwa-update-toast",role:"status","aria-live":"polite",className:"pointer-events-none fixed bottom-0 right-0 flex max-w-full justify-end px-4 pb-safe",style:{zIndex:I.M.TOAST},children:(0,r.jsxs)("div",{"data-testid":"pwa-update-toast-card",className:"pointer-events-auto mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:e("update.available")}),(0,r.jsxs)("button",{type:"button",onClick:()=>{t.postMessage({type:"SKIP_WAITING"})},className:"inline-flex items-center gap-1.5 rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background dark:bg-accent-500 dark:hover:bg-accent-600",children:[(0,r.jsx)(S.A,{className:"h-4 w-4"}),e("update.reload")]})]})})}function M(e){var t;let{children:n,locale:N,messages:C,timeZone:S,authEnabled:I=!1}=e,T=(t=(0,s.usePathname)(),!I||!a.includes(null!=t?t:""));return(0,r.jsx)(i.default,{locale:N,messages:C,timeZone:S,children:(0,r.jsx)(w.tE,{children:(0,r.jsx)(l.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,r.jsx)(d.O,{authEnabled:I,children:(0,r.jsx)(c.W5,{children:(0,r.jsx)(o.GB,{children:(0,r.jsx)(f.tS,{enabled:T,children:(0,r.jsxs)(h.g7,{enabled:T,children:[(0,r.jsx)(j.rM,{}),(0,r.jsx)(k.o,{}),(0,r.jsx)(y.H,{}),(0,r.jsx)(u.E,{children:(0,r.jsx)(m.S,{children:(0,r.jsx)(p.aF,{children:(0,r.jsx)(b.y2,{enabled:T,children:(0,r.jsxs)(g.NS,{children:[(0,r.jsx)(x.Bo,{children:n}),(0,r.jsx)(A,{}),(0,r.jsx)(v.gZ,{})]})})})})})]})})})})})})})})}},60322:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});let r=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function s(e){var t;if(!e||0===e.trim().length)return;let n=e.replace(r,"");if(null==(t=navigator.clipboard)?void 0:t.writeText)try{await navigator.clipboard.writeText(n);return}catch(e){}let s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.left="-9999px",s.style.top="-9999px",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy")}finally{document.body.removeChild(s)}}},65380:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,O:()=>i});var r=n(95155),s=n(12115);let a=(0,s.createContext)(!1);function i(e){let{children:t,authEnabled:n}=e;return(0,r.jsx)(a.Provider,{value:n,children:t})}function l(){return(0,s.useContext)(a)}},77016:(e,t,n)=>{"use strict";n.d(t,{W:()=>g,n:()=>v});var r=n(95155),s=n(12115),a=n(18955),i=n(52056),l=n(89559),o=n(65229),d=n(59854),c=n(60199),u=n(52703);let m=0,h=new Set;function x(){for(let e of h)e()}function f(e){return h.add(e),()=>{h.delete(e)}}function p(){return m>0}function b(){return!1}function g(){return(0,s.useSyncExternalStore)(f,p,b)}function v(){let e=(0,a.c)("common"),[t,n]=(0,s.useState)(null),[h,f]=(0,s.useState)(null),p=(0,s.useCallback)(e=>{if(e.type!==u.Oo)return;let{serverVersion:t,clientVersion:r}=e;"string"==typeof t&&"string"==typeof r&&t&&r&&t!==h&&n({serverVersion:t,clientVersion:r})},[h]);(0,c.T3)(p);let b=null!==t;(0,s.useEffect)(()=>{if(b)return m+=1,x(),()=>{m-=1,x()}},[b]);let g=(0,s.useCallback)(()=>{window.location.reload()},[]),v=(0,s.useCallback)(()=>{n(e=>(e&&f(e.serverVersion),null))},[]);return t?(0,r.jsxs)("div",{"data-testid":"version-mismatch-banner",role:"alert","aria-live":"assertive",className:"fixed top-3 left-1/2 -translate-x-1/2 flex items-start gap-3 max-w-[92vw] rounded-lg border border-warning-border bg-warning-subtle px-4 py-3 text-warning-foreground shadow-lg",style:{zIndex:d.M.TOAST},children:[(0,r.jsx)(i.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,r.jsx)("span",{className:"font-semibold",children:e("versionMismatch.title")}),(0,r.jsx)("span",{children:e("versionMismatch.description",{serverVersion:t.serverVersion,clientVersion:t.clientVersion})})]}),(0,r.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:g,className:"shrink-0 inline-flex items-center gap-1.5 rounded-md border border-warning-border px-3 py-1.5 text-sm font-medium hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-offset-2",children:[(0,r.jsx)(l.A,{className:"h-4 w-4","aria-hidden":"true"}),e("versionMismatch.reload")]}),(0,r.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:v,"aria-label":e("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,r.jsx)(o.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}},80903:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,22311,23)),Promise.resolve().then(n.t.bind(n,7183,23)),Promise.resolve().then(n.t.bind(n,13673,23)),Promise.resolve().then(n.bind(n,91476)),Promise.resolve().then(n.bind(n,23252))},91476:(e,t,n)=>{"use strict";n.d(t,{AppShellGate:()=>tD});var r=n(95155),s=n(20063),a=n(12115),i=n(32916),l=n(38218);let o={showSidebar:!0,showGlobalNav:!0,showLocalNav:!1,autoCollapseSidebar:!1},d=[{prefix:"/worktrees/",config:{showGlobalNav:!1,showLocalNav:!0}},{prefix:"/sessions",config:{autoCollapseSidebar:!0}}];var c=n(22592),u=n(52619),m=n.n(u),h=n(89275);let x=(0,a.forwardRef)(function(e,t){let{href:n,onClick:a,target:i,...l}=e,o=(0,s.usePathname)(),d=(0,h.Hq)();return(0,r.jsx)(m(),{ref:t,href:n,target:i,onClick:e=>{var t;null==a||a(e),e.defaultPrevented||0!==(t=e).button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||void 0!==i&&"_self"!==i||/^([a-z][a-z0-9+.-]*:)?\/\//i.test(n)||/^(mailto:|tel:)/i.test(n)||(e.preventDefault(),n!==o&&d.push(n))},...l})});var f=n(18955),p=n(66685),b=n(85710),g=n(61362),v=n(15870),w=n(17787),j=n(49027),y=n(27587),k=n(39649),N=n(46615),C=n(76471),S=n(70532),I=n(44308),T=n(38606);let A=(0,a.memo)(function(e){let{worktrees:t,visibleWorktreeIds:n,selectedWorktreeId:s,onSelect:a,onNavigate:i}=e,l=(0,f.c)("common"),o=t.length;if(0===o)return null;let d=t.slice(0,3),c=o-d.length;return(0,r.jsxs)("section",{"data-testid":"sidebar-needs-attention","aria-label":l("sidebar.needsAttention"),className:"flex-shrink-0 px-2 pt-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-2 pb-1 text-xs text-sidebar-muted",children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:l("sidebar.needsAttention")}),(0,r.jsx)("span",{"data-testid":"sidebar-needs-attention-count","aria-label":l("attention.badgeLabel",{count:o}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 font-semibold leading-5 tabular-nums text-warning-foreground",children:o>99?"99+":o})]}),(0,r.jsx)("ul",{className:"space-y-0.5",children:d.map(e=>{let t=(0,T.XK)(e),i=!n.has(e.id),o=e.id===s;return(0,r.jsx)("li",{children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-attention-item","data-hidden-repository":i?"true":void 0,onClick:()=>a(e.id),"aria-current":o?"true":void 0,title:"".concat(t.name," \xb7 ").concat(t.repositoryName),className:"flex h-[34px] w-full min-w-0 items-center gap-2 rounded-md px-2 text-left transition-colors hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-sidebar-hover":""),children:[(0,r.jsx)("span",{className:"flex w-4 flex-shrink-0 items-center justify-center",children:(0,r.jsx)(C.Ej,{status:"waiting",waitingKind:t.waitingKind})}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm text-sidebar-foreground",children:t.name}),(0,r.jsx)("span",{className:"min-w-0 max-w-[40%] flex-shrink truncate text-xs text-sidebar-muted",children:t.repositoryName}),i&&(0,r.jsx)(S.A,{"data-testid":"sidebar-attention-hidden-repository",className:"h-3.5 w-3.5 flex-shrink-0 text-sidebar-muted","aria-label":l("sidebar.hiddenRepository"),role:"img"})]})},e.id)})}),(0,r.jsx)(x,{href:I.ks,"data-testid":"sidebar-needs-attention-review-link",onClick:i,className:"mt-0.5 flex min-w-0 items-center rounded-md px-2 py-1 text-xs text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,r.jsx)("span",{className:"min-w-0 truncate",children:c>0?l("sidebar.attentionMoreInReview",{count:c}):l("sidebar.openInReview")})})]})}),M=(0,a.memo)(function(e){let{branches:t,selectedWorktreeId:n,onBranchClick:s,forceExpanded:i}=e,l=(0,f.c)("common"),[o,d]=(0,a.useState)(!1),c=i||o;return(0,r.jsxs)("div",{"data-testid":"branch-group-other",children:[(0,r.jsx)("div",{className:N.R8,children:(0,r.jsxs)("button",{type:"button","data-testid":"branch-group-other-toggle","aria-expanded":c,disabled:i,onClick:()=>d(e=>!e),className:"flex h-[30px] w-full min-w-0 items-center gap-2 rounded-[10px] px-3 text-left text-xs text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:cursor-default disabled:hover:bg-transparent",children:[(0,r.jsx)("svg",{className:"h-3 w-3 flex-shrink-0 transition-transform ".concat(c?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),(0,r.jsx)("span",{className:"min-w-0 truncate",children:l("sidebar.otherBranches",{count:t.length})})]})}),c&&t.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===n,onClick:()=>s(e.id),showRepositoryName:!1},e.id))]})});var E=n(48407),L=n(73464),P=n(26232),B=n(7636),K=n(87531);let R=[{mode:"grouped",labelKey:"sidebar.viewMode.grouped"},{mode:"flat",labelKey:"sidebar.viewMode.flat"},{mode:"sessions",labelKey:"sidebar.viewMode.sessions"}],O=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],D={updatedAt:"desc"},F={updatedAt:{asc:"sort.direction.oldestFirst",desc:"sort.direction.newestFirst"},repositoryName:{asc:"sort.direction.aToZ",desc:"sort.direction.zToA"},branchName:{asc:"sort.direction.aToZ",desc:"sort.direction.zToA"},status:{asc:"sort.direction.attentionFirst",desc:"sort.direction.attentionLast"}},W={asc:"sort.ascending",desc:"sort.descending"};function z(e){var t;return null!=(t=D[e])?t:"asc"}function _(e){e.preventDefault()}let H=(0,a.memo)(function(e){var t,n,s,l;let{viewMode:o,onViewModeChange:d}=e,c=(0,f.c)("common"),{sortKey:u,sortDirection:m,setSortKey:h,setSortDirection:x}=(0,i.VF)(),p=(0,a.useId)(),b=(0,a.useId)(),g=(0,a.useMemo)(()=>{var e;let t=null!=(e=F[u])?e:W;return e=>c(t[e])},[u,c]),v=c(null!=(s=null==(t=R.find(e=>e.mode===o))?void 0:t.labelKey)?s:"sidebar.viewMode.grouped"),w=c(null!=(l=null==(n=O.find(e=>e.key===u))?void 0:n.labelKey)?l:"sort.".concat(u)),j=c("sidebar.listOptionsSummary",{view:v,sort:w,direction:g(m)}),y=o===i.e8&&u===i.P0&&m===i.RA,k=z(u);return(0,r.jsxs)(P.rI,{children:[(0,r.jsx)(P.ty,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-list-options","data-view-mode":o,"data-sort-key":u,"data-sort-direction":m,"aria-label":c("sidebar.listOptionsLabel",{summary:j}),title:j,className:"relative flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-sidebar-hover data-[state=open]:text-sidebar-foreground",children:[(0,r.jsx)(L.A,{className:"h-4 w-4","aria-hidden":"true"}),!y&&(0,r.jsx)("span",{"data-testid":"sidebar-list-options-indicator","aria-hidden":"true",className:"absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-accent-500"})]})}),(0,r.jsxs)(P.SQ,{"data-testid":"sidebar-list-options-menu",align:"end",collisionPadding:8,className:(0,K.cn)("w-52 max-w-[calc(100vw-16px)]","max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto"),children:[(0,r.jsx)(P.lp,{id:p,children:c("sidebar.viewLabel")}),(0,r.jsx)(P.Hr,{"data-testid":"view-mode-options","aria-labelledby":p,value:o,onValueChange:e=>{(0,B.$m)(e)&&e!==o&&d(e)},children:R.map(e=>{let{mode:t,labelKey:n}=e;return(0,r.jsx)(P.Ht,{value:t,onSelect:_,children:c(n)},t)})}),(0,r.jsx)(P.mB,{}),(0,r.jsx)(P.lp,{id:b,children:c("sort.label")}),(0,r.jsx)(P.Hr,{"data-testid":"sort-key-options","aria-labelledby":b,value:u,onValueChange:e=>{let t=O.find(t=>t.key===e);t&&t.key!==u&&(h(t.key),x(z(t.key)))},children:O.map(e=>{let{key:t,labelKey:n}=e;return(0,r.jsx)(P.Ht,{value:t,onSelect:_,children:c(n)},t)})}),(0,r.jsx)(P.mB,{}),(0,r.jsx)(P.Hr,{"data-testid":"sort-direction-options","aria-label":c("sort.directionLabel"),value:m,onValueChange:e=>{("asc"===e||"desc"===e)&&x(e)},children:("asc"===k?["asc","desc"]:["desc","asc"]).map(e=>(0,r.jsx)(P.Ht,{value:e,onSelect:_,children:g(e)},e))})]})]})}),V=(0,a.memo)(function(e){let{searchQuery:t,onSearchChange:n,viewMode:s,onViewModeChange:a}=e,i=(0,f.c)("common");return(0,r.jsxs)("div",{"data-testid":"sidebar-list-toolbar",className:"flex flex-shrink-0 items-center gap-1 px-3 pt-2 pb-1.5",children:[(0,r.jsx)(E.pd,{type:"text",inputSize:"sm",placeholder:i("sidebar.searchBranches"),"aria-label":i("sidebar.searchBranches"),value:t,onChange:e=>n(e.target.value),className:"min-w-0 flex-1 border-sidebar-border bg-background shadow-none"}),(0,r.jsx)(H,{viewMode:s,onViewModeChange:a})]})});var Y=n(41898),U=n(30061),q=n(5379),G=n(65380),X=n(45195),J=n(40823),Z=n(68704),$=n(26020);async function Q(){try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch(e){window.location.href="/login"}}let ee=P.ty;function et(){let e=(0,f.c)("common"),{size:t,setSize:n}=(0,c.Ps)(),s=(0,i.pT)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P.mB,{}),(0,r.jsx)(P.lp,{children:e("displaySize.ariaLabel")}),(0,r.jsx)(P.Hr,{value:t,onValueChange:e=>{(0,Z.fM)(e)&&n(e)},children:Z.Uf.map(t=>(0,r.jsx)(P.Ht,{value:t,children:e("displaySize.".concat(t))},t))}),s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P.lp,{children:e("repoTabBar.settingLabel")}),(0,r.jsx)(P.Hr,{value:s.repoTabBarMode,onValueChange:e=>{(0,B.m3)(e)&&s.setRepoTabBarMode(e)},children:B.EN.map(t=>(0,r.jsx)(P.Ht,{value:t,children:e("repoTabBar.mode.".concat(t))},t))})]})]})}function en(e){let{children:t,testIdPrefix:n,side:s="top",align:i="end",showDisplayPreferences:o=!1,onNavigate:d}=e,c=(0,f.c)("worktree"),u=(0,h.Hq)(),{theme:m,setTheme:x}=(0,q.D)(),{currentLocale:p,switchLocale:b}=(0,X.g)(),g=(0,G.H)(),v=(0,l.a)(),{open:w}=(0,J.V0)(),j=(0,a.useRef)(!1),y=(0,a.useRef)(null),k="0.46.0",N=e=>{null==d||d(),u.push(e)};return(0,r.jsxs)(P.rI,{children:[t,(0,r.jsxs)(P.SQ,{side:s,align:i,collisionPadding:8,className:"w-56 max-w-[calc(100vw-16px)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto",onCloseAutoFocus:()=>{j.current&&(j.current=!1,queueMicrotask(w))},children:[(0,r.jsx)(P.lp,{"data-testid":"".concat(n,"-version"),children:c("activityBar.settingsMenu.version",{version:k?"v".concat(k):"-"})}),(0,r.jsx)(P._2,{asChild:!0,onSelect:()=>{let e=y.current;if(y.current=null,!(e&&(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))){if(null==e||e.preventDefault(),v)return void N("/more");j.current=!0}},children:(0,r.jsx)("a",{href:"/more","data-testid":"".concat(n,"-settings"),onClick:e=>{y.current=e},children:c("activityBar.settingsMenu.settings")})}),(0,r.jsx)(P._2,{onSelect:()=>N("/skills"),children:c("activityBar.settingsMenu.skills")}),(0,r.jsx)(P.mB,{}),(0,r.jsx)(P.lp,{children:c("activityBar.settingsMenu.theme")}),(0,r.jsxs)(P.Hr,{value:null!=m?m:"system",onValueChange:e=>x(e),children:[(0,r.jsx)(P.Ht,{value:"light",children:c("activityBar.settingsMenu.themeLight")}),(0,r.jsx)(P.Ht,{value:"dark",children:c("activityBar.settingsMenu.themeDark")}),(0,r.jsx)(P.Ht,{value:"system",children:c("activityBar.settingsMenu.themeSystem")})]}),(0,r.jsx)(P.lp,{children:c("activityBar.settingsMenu.language")}),(0,r.jsx)(P.Hr,{value:p,onValueChange:e=>b(e),children:$.dI.map(e=>(0,r.jsx)(P.Ht,{value:e,children:$.vK[e]},e))}),o&&!v&&(0,r.jsx)(et,{}),(0,r.jsx)(P.mB,{}),(0,r.jsx)(P._2,{asChild:!0,children:(0,r.jsx)("a",{href:"https://github.com/kewton/MyCodeBranchDesk",target:"_blank",rel:"noopener noreferrer",children:c("activityBar.settingsMenu.github")})}),g&&(0,r.jsx)(P._2,{onSelect:()=>{Q()},children:c("activityBar.settingsMenu.logout")})]})]})}var er=n(59847),es=n(11010),ea=n(86651),ei=n(79651),el=n(92614),eo=n(51743);let ed=["global","terminal","composer","editor"],ec=[{id:"commandPalette",keys:["MOD","K"],scope:"global"},{id:"toggleSidebar",keys:["MOD","B"],scope:"global"},{id:"keyboardHelp",keys:["?"],scope:"global"},{id:"closeOverlay",keys:["Esc"],scope:"global"},{id:"navigateList",keys:["↑","↓"],scope:"global"},{id:"terminalSearch",keys:["MOD","F"],scope:"terminal"},{id:"toggleSurfaceMode",keys:["MOD","Shift","M"],scope:"terminal"},{id:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"},{id:"editorIndent",keys:["Tab"],scope:"editor"},{id:"editorOutdent",keys:["Shift","Tab"],scope:"editor"},{id:"editorTabFocus",keys:["Ctrl","M"],scope:"editor"},{id:"editorSave",keys:["MOD","S"],scope:"editor"},{id:"editorFullscreen",keys:["MOD","Shift","F"],scope:"editor"}];function eu(){if("undefined"==typeof navigator)return!1;let e=navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)}function em(e,t){return"MOD"===e?t?"⌘":"Ctrl":e}var eh=n(26550),ex=n(78845),ef=n(65229);let ep="flex items-center justify-center rounded-md text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",eb={width:"".concat(B.KI,"px"),height:"".concat(B.KI,"px")};function eg(e){let{testId:t,onClose:n}=e,s=(0,f.c)("common"),{isOpen:a,toggle:l}=(0,i.VF)(),o=s(a?"sidebar.close":"sidebar.open"),d=a?eh.A:ex.A;return(0,r.jsx)("div",{"data-sidebar-toggle-cell":"",className:"flex flex-shrink-0",style:{padding:"".concat(B.df,"px")},children:n?(0,r.jsx)("button",{type:"button","data-testid":t,onClick:n,"aria-label":s("sidebar.close"),style:eb,className:ep,children:(0,r.jsx)(ef.A,{size:20,"aria-hidden":"true"})}):(0,r.jsx)(Y.m_,{content:o,placement:a?"bottom":"right",children:(0,r.jsx)("button",{type:"button","data-testid":t,onClick:l,"aria-label":o,"aria-expanded":a,style:eb,className:ep,children:(0,r.jsx)(d,{size:20,"aria-hidden":"true"})})})})}let ev="flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring";function ew(e){let{drawer:t=!1}=e,n=(0,f.c)("common"),s=(0,f.c)("commandPalette"),{setOpen:l}=(0,el.C)(),{openNewTask:o}=(0,eo.hX)(),{closeMobileDrawer:d}=(0,i.VF)(),c=function(){let[e,t]=a.useState(null);return a.useEffect(()=>{t(eu()?"⌘":"Ctrl")},[]),e}(),u=t?d:void 0;return(0,r.jsxs)("div",{"data-testid":t?"sidebar-drawer-top-controls":"sidebar-top-controls",className:"flex-shrink-0",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center",children:[t?(0,r.jsx)(eg,{testId:"sidebar-drawer-close",onClose:d}):(0,r.jsx)(eg,{testId:"sidebar-panel-toggle"}),(0,r.jsxs)(x,{href:"/",onClick:u,"data-testid":"sidebar-logo",className:"flex min-w-0 items-center gap-2 rounded-md px-1 py-1 transition-opacity hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,r.jsx)("span",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md bg-accent-600",children:(0,r.jsx)(er.A,{size:14,strokeWidth:2,className:"text-white","aria-hidden":"true"})}),(0,r.jsx)("span",{className:"truncate text-sm font-bold text-sidebar-foreground",children:"CommandMate"})]})]}),(0,r.jsxs)("div",{className:"space-y-0.5 px-2",children:[(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-new-task",onClick:()=>{null==u||u(),o()},"aria-haspopup":"dialog",className:ev,children:[(0,r.jsx)(es.A,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:n("newTask.title")})]}),(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-search",onClick:()=>{null==u||u(),l(!0)},"aria-label":s("mobileTrigger"),className:ev,children:[(0,r.jsx)(ea.A,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s("searchAction")}),!t&&null!==c&&(0,r.jsxs)("span",{className:"flex flex-shrink-0 items-center gap-0.5","aria-hidden":"true",children:[(0,r.jsx)(ei.u,{children:c}),(0,r.jsx)(ei.u,{children:"K"})]})]})]})]})}var ej=n(94442),ey=n(24373),ek=n(80344),eN=n(98873);let eC="mcbd-sidebar-group-collapsed",eS="mcbd-sidebar-scroll-top",eI=0,eT=(0,a.memo)(function(){var e,t,n;let o=(0,h.Hq)(),{worktrees:d,repositories:c,selectedWorktreeId:u,selectWorktree:m,refreshWorktrees:x,isLoading:v,error:y}=(0,k.$f)(),{closeMobileDrawer:C,sortKey:S,sortDirection:M,viewMode:L,setViewMode:P,repositoryOrder:K,setRepositoryOrder:R}=(0,i.VF)(),O=(0,f.c)("common"),D=null!=(e=(0,s.usePathname)())?e:"",F=(0,B.jn)(D,u),W=(0,l.a)(),{count:z}=(0,ey.Lv)(),[_,H]=(0,a.useState)(""),Y=(0,a.useRef)(null),[U,q]=(0,a.useState)(()=>{try{let e=localStorage.getItem(eC);return e?function(e){try{let t=JSON.parse(e);if("object"!=typeof t||null===t||Array.isArray(t))return{};let n={},r=0;for(let[e,s]of Object.entries(t))if(!eE.has(e)&&"boolean"==typeof s){if(++r>100)break;n[e]=s}return n}catch(e){return{}}}(e):{}}catch(e){return{}}}),G=(0,a.useRef)(!1);(0,a.useEffect)(()=>{G.current||(G.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&R(e.order)}).catch(()=>{}))},[R]);let X=(0,a.useMemo)(()=>(0,B.UZ)(c),[c]),J=(0,a.useMemo)(()=>(0,B.s6)(d,X),[d,X]),Z=(0,a.useMemo)(()=>(0,ey.Rc)(d),[d]),$=(0,a.useMemo)(()=>new Set(J.map(e=>e.id)),[J]),Q=(0,a.useMemo)(()=>J.map(T.XK),[J]),ee=(0,a.useMemo)(()=>new Map(Q.map(e=>[e.id,e])),[Q]),et=(0,a.useDeferredValue)(Q),en=(0,a.useRef)(null),er=(0,a.useRef)(null),es=(0,a.useRef)(null),ea=(0,a.useRef)(new Set),[ei,el]=(0,a.useState)(0);(0,a.useEffect)(()=>()=>{null!==er.current&&clearTimeout(er.current)},[]);let eo=(0,a.useCallback)(()=>{null!==er.current&&(clearTimeout(er.current),er.current=null),en.current=null,es.current=null},[]),ed=(0,a.useMemo)(()=>{let e=en.current;return!e||0===e.items.length||Date.now()>=e.expiresAt?et:e.items},[et,ei]),ec=(0,a.useRef)(ed),eu=es.current,em=new Set(ed.filter(e=>(null==eu?void 0:eu.has(e.id))===!0||(0,B.rL)(e,F,ee)).map(e=>e.id));(0,a.useLayoutEffect)(()=>{if(ec.current=ed,ea.current=em,es.current)for(let e of em)es.current.add(e);let e=en.current;e&&0===e.items.length&&et.length>0&&eo()});let eh=(0,a.useCallback)(()=>{if(0===ec.current.length)return;null!==er.current&&(clearTimeout(er.current),er.current=null);let e=en.current;if(e&&Date.now()<e.expiresAt){en.current={...e,expiresAt:1/0};return}en.current={items:ec.current,expiresAt:1/0},es.current=new Set(ea.current)},[]),ex=(0,a.useCallback)(()=>{en.current&&(en.current={...en.current,expiresAt:Date.now()+1e3},null!==er.current&&clearTimeout(er.current),er.current=setTimeout(()=>{eo(),el(e=>e+1)},1e3))},[eo]),{sortedItems:ef,groupedItems:ep}=(0,eN.D)({items:ed,sortKey:S,sortDirection:M,viewMode:L,filterText:_}),eb=(0,a.useMemo)(()=>"grouped"===L&&ep?_.trim()?ep:(0,B.Ew)(ep,K):null,[L,ep,K,_]),eg="grouped"===L?eb:null,ev=(0,a.useMemo)(()=>"sessions"===L?(0,B.EY)((0,B.UB)(ef),S,M):[],[L,ef,S,M]);(0,a.useEffect)(()=>{try{localStorage.setItem(eC,JSON.stringify(U))}catch(e){}},[U]);let ej=(0,a.useCallback)(e=>{q(t=>({...t,[e]:!t[e]}))},[]),ek=(0,a.useCallback)(()=>{var e,t,n=null!=(t=null==(e=Y.current)?void 0:e.scrollTop)?t:0;let r=Number.isFinite(n)&&n>0?n:0;eI=r;try{localStorage.setItem(eS,String(r))}catch(e){}},[]),eT=ef.length>0||(null!=(t=null==eg?void 0:eg.length)?t:0)>0||ev.length>0;(0,a.useEffect)(()=>{let e=Y.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(eS);if(!e)return eI=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(eI=t)}catch(e){}return eI}()});return()=>{window.cancelAnimationFrame(t)}},[eT,L]);let eL=(0,a.useCallback)(e=>{ek(),m(e),o.push("/worktrees/".concat(e)),C()},[ek,m,o,C]),eK=(0,a.useCallback)(e=>{ek(),m(e.worktreeId),o.push((0,B.Ii)(e)),C()},[ek,m,o,C]),eR=(0,w.FR)((0,w.MS)(w.AN,{activationConstraint:{distance:8}})),eO=(0,a.useCallback)(e=>{let{active:t,over:n}=e;if(!n||t.id===n.id||!eg)return;let r=eg.map(e=>e.repositoryName),s=r.indexOf(String(t.id)),a=r.indexOf(String(n.id));if(-1===s||-1===a)return;let i=(0,j.be)(r,s,a);R(i),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:i})}).catch(()=>{R(r)})},[eg,R]),eW="grouped"===L?(null!=(n=null==eg?void 0:eg.length)?n:0)===0:"sessions"===L?0===ev.length:0===ef.length,ez=v&&0===d.length,e_=!ez&&!!y&&0===d.length,eH=(0,a.useCallback)(()=>{x()},[x]),eV={sessions:(0,r.jsx)("li",{className:"flex min-w-0",children:(0,r.jsx)(eP,{href:"/sessions",icon:p.A,label:O("nav.sessions"),testId:"sidebar-nav-sessions",isActive:D.startsWith("/sessions"),onNavigate:C})}),repositories:(0,r.jsxs)("li",{className:"flex min-w-0 items-center gap-1",children:[(0,r.jsx)(eP,{href:"/repositories",icon:b.A,label:O("nav.repositories"),testId:"sidebar-nav-repositories",isActive:D.startsWith("/repositories"),onNavigate:C}),(0,r.jsx)(eD,{refreshWorktrees:x})]}),review:(0,r.jsx)("li",{className:"flex min-w-0",children:(0,r.jsx)(eP,{href:z>0?I.ks:"/review",icon:g.A,label:O("nav.review"),testId:"sidebar-nav-review",isActive:D.startsWith("/review"),onNavigate:C,trailing:z>0?(0,r.jsx)("span",{"data-testid":"sidebar-nav-review-count",role:"status","aria-label":O("attention.badgeLabel",{count:z}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-xs font-semibold leading-5 tabular-nums text-warning-foreground",children:z>99?"99+":z}):null})})};return(0,r.jsx)(N.Fy.Provider,{value:!W,children:(0,r.jsxs)("nav",{"data-testid":"sidebar","aria-label":O("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,r.jsx)(ew,{drawer:W}),(0,r.jsx)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 space-y-2 border-b border-sidebar-border px-2 py-2",children:(0,r.jsx)("ul",{"data-testid":"sidebar-nav",className:"space-y-0.5",children:B.go.map(e=>(0,r.jsx)(a.Fragment,{children:eV[e]},e))})}),(0,r.jsx)(A,{worktrees:Z,visibleWorktreeIds:$,selectedWorktreeId:F,onSelect:eL,onNavigate:C}),(0,r.jsx)(V,{searchQuery:_,onSearchChange:H,viewMode:L,onViewModeChange:P}),(0,r.jsx)("div",{ref:Y,"data-testid":"branch-list",onScroll:ek,onMouseEnter:eh,onMouseLeave:ex,className:"flex-1 overflow-y-auto overflow-x-hidden",children:ez?(0,r.jsx)(eA,{label:O("sidebar.loadingBranches")}):e_?(0,r.jsxs)("div",{"data-testid":"branch-list-error",role:"alert",className:"px-4 py-8 text-center text-sidebar-muted",children:[(0,r.jsx)("p",{className:"text-sm",children:O("sidebar.branchesLoadFailed")}),(0,r.jsx)(E.$n,{type:"button",variant:"secondary",size:"sm",className:"mt-3","data-testid":"branch-list-retry",onClick:eH,children:O("sidebar.retryLoadBranches")})]}):eW?(0,r.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:O(_?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"sessions"===L?ev.map(e=>(0,r.jsx)(eB,{row:e,isSelected:e.worktreeId===F,onClick:eK},e.key)):"grouped"===L&&eg?(0,r.jsx)(w.Mp,{sensors:eR,collisionDetection:w.fp,onDragEnd:eO,children:(0,r.jsx)(j.gB,{items:eg.map(e=>e.repositoryName),strategy:j._G,children:eg.map(e=>{let t=!U[e.repositoryName]||!!_.trim();return(0,r.jsx)(eM,{group:e,isExpanded:t,selectedWorktreeId:F,onToggle:()=>ej(e.repositoryName),onBranchClick:eL,isDragDisabled:!!_.trim(),isFiltering:!!_.trim(),liveBranchById:ee,stickyShownIds:eu},e.repositoryName)})})}):ef.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===F,onClick:()=>eL(e.id)},e.id))}),(0,r.jsx)("div",{"data-testid":"sidebar-footer",className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border",children:(0,r.jsx)(eF,{onNavigate:C})})]})})}),eA=(0,a.memo)(function(e){let{label:t}=e;return(0,r.jsxs)("div",{"data-testid":"branch-list-skeleton",role:"status","aria-live":"polite",className:"px-4 py-3 space-y-3",children:[(0,r.jsx)("span",{className:"sr-only",children:t}),[0,1,2,3,4].map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(E.EA,{className:"h-2 w-2 rounded-full"}),(0,r.jsx)(E.EA,{className:"h-3 flex-1"})]},e))]})});function eM(e){let{group:t,isExpanded:n,selectedWorktreeId:s,onToggle:a,onBranchClick:i,isDragDisabled:l,isFiltering:o,liveBranchById:d,stickyShownIds:c}=e,{attributes:u,listeners:m,setNodeRef:h,setActivatorNodeRef:x,transform:f,transition:p,isDragging:b}=(0,j.gl)({id:t.repositoryName,disabled:l}),g={transform:y.Ks.Transform.toString(f),transition:p,opacity:b?.5:1},{shown:v,other:w}=(0,B.FS)(t.branches,s,d,null!=c?c:void 0);return(0,r.jsxs)("div",{ref:h,style:g,className:"w-full min-w-0 pt-2",children:[(0,r.jsx)(eL,{repositoryName:t.repositoryName,branchCount:t.branches.length,isExpanded:n,onClick:a,dragHandleRef:x,dragHandleListeners:l?void 0:m,dragHandleAttributes:l?void 0:u}),n&&v.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===s,onClick:()=>i(e.id),showRepositoryName:!1},e.id)),n&&w.length>0&&(0,r.jsx)(M,{branches:w,selectedWorktreeId:s,onBranchClick:i,forceExpanded:o})]})}let eE=new Set(["__proto__","constructor","prototype"]);function eL(e){let{repositoryName:t,branchCount:n,isExpanded:s,onClick:a,dragHandleRef:i,dragHandleListeners:l,dragHandleAttributes:o}=e,d=(0,f.c)("common");return(0,r.jsxs)("div",{className:"group/header flex items-center w-full",children:[l&&(0,r.jsx)("div",{ref:i,...l,...o,"data-testid":"group-drag-handle","aria-label":d("sidebar.dragToReorderGroup"),className:" flex-shrink-0 flex items-center justify-center w-6 h-full pl-2 cursor-grab active:cursor-grabbing text-sidebar-muted hover:text-sidebar-foreground transition-[color,opacity] opacity-0 group-hover/header:opacity-100 group-focus-within/header:opacity-100 [@media(hover:none)]:opacity-100 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ",children:(0,r.jsx)(eR,{})}),(0,r.jsxs)("button",{"data-testid":"group-header",type:"button",onClick:a,"aria-expanded":s,className:" flex-1 min-w-0 flex items-center gap-2 px-2 py-1 text-xs font-normal text-sidebar-muted focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,r.jsx)(eK,{isExpanded:s}),(0,r.jsx)(E.nF,{color:(0,B.LV)(t)}),(0,r.jsx)(U.nR,{content:t,className:"flex-1 min-w-0 text-left truncate",children:t}),(0,r.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:n})]})]})}function eP(e){let{href:t,icon:n,label:s,testId:a,isActive:i,onNavigate:l,trailing:o}=e;return(0,r.jsxs)(x,{href:t,"data-testid":a,"aria-current":i?"page":void 0,onClick:l,className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(i?"bg-sidebar-hover font-medium text-sidebar-foreground":"text-sidebar-muted"),children:[(0,r.jsx)(n,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s}),o]})}let eB=(0,a.memo)(function(e){let{row:t,isSelected:n,onClick:s}=e,a=(0,f.c)("common"),i=(0,C.Mq)(t.status,t.unclassified),l=a(i?C.rH:"status.".concat(t.status));return(0,r.jsx)("div",{className:"w-full min-w-0 ".concat(N.R8),children:(0,r.jsxs)("button",{type:"button","data-testid":"session-list-item","data-session-key":t.key,onClick:()=>s(t),"aria-current":n?"true":void 0,className:"w-full min-w-0 min-h-[34px] px-3 py-1.5 flex items-center gap-2 text-left ".concat((0,N.Xd)(n)),children:[(0,r.jsx)(E.md,{status:t.status,size:"sm",label:t.exited?"".concat(l," (").concat(a("branchItem.agentExited"),")"):l,className:i?C.Jd:void 0}),(0,r.jsx)("span",{className:"flex-shrink-0 max-w-[45%] truncate text-sm font-semibold text-sidebar-foreground",children:t.label}),(0,r.jsxs)("span",{className:"min-w-0 flex-1 truncate text-xs text-sidebar-muted",children:[t.branchName," \xb7 ",t.repositoryName]})]})})});function eK(e){let{isExpanded:t}=e;return(0,r.jsx)("svg",{className:"w-3 h-3 flex-shrink-0 transition-transform ".concat(t?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function eR(){return(0,r.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,r.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,r.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function eO(e){let{className:t=""}=e;return(0,r.jsx)("svg",{className:"".concat("w-4 h-4"," ").concat(t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 014.51 15"})})}let eD=(0,a.memo)(function(e){let{refreshWorktrees:t}=e,[n,s]=(0,a.useState)(!1),i=(0,a.useRef)(!1),{showToast:l}=(0,ej.dj)(),o=(0,f.c)("common"),d=(0,a.useCallback)(async()=>{if(!i.current){i.current=!0,s(!0);try{let e=await ek.Rx.sync();await t(),l(o("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof ek.hD&&401===e.status?l(o("syncAuthError"),"error",5e3):l(o("syncError"),"error",5e3)}finally{i.current=!1,s(!1)}}},[t,l,o]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Y.m_,{content:o("tooltips.sync"),placement:"bottom",children:(0,r.jsx)("button",{type:"button",onClick:d,disabled:n,"aria-label":o("syncButtonLabel"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:(0,r.jsx)(eO,{className:n?"animate-spin":""})})})})});function eF(e){let{onNavigate:t}=e,n=(0,f.c)("common")("settings.title");return(0,r.jsx)(en,{testIdPrefix:"sidebar-settings-menu",side:"top",align:"start",showDisplayPreferences:!0,onNavigate:t,children:(0,r.jsx)(ee,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-settings-menu",className:"flex w-full items-center gap-2 px-2 py-1.5 rounded-md text-sm text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors",children:[(0,r.jsx)(v.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:n})]})})})}var eW=n(52407);function ez(){let{shouldSurface:e,isReconnecting:t}=(0,eW.Fx)(),n=(0,f.c)("common");if(!e)return null;let s=n(t?"connection.reconnecting":"connection.offline");return(0,r.jsxs)("span",{"data-testid":"connection-status-indicator","data-connection-state":t?"reconnecting":"offline",role:"status","aria-live":"polite",title:n(t?"connection.reconnectingTooltip":"connection.offlineTooltip"),className:"hidden sm:inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-2 py-0.5 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:["w-1.5 h-1.5 rounded-full",t?"bg-warning motion-safe:animate-pulse":"bg-muted-foreground"].join(" ")}),s]})}var e_=n(72137);let eH=[{prefix:"/sessions",labelKey:"nav.sessions"},{prefix:"/repositories",labelKey:"nav.repositories"},{prefix:"/review",labelKey:"nav.review"},{prefix:"/skills",labelKey:"nav.skills"},{prefix:"/more",labelKey:"nav.more"}];function eV(e){var t,n,a,i;let{title:l="CommandMate"}=e,o=null!==(n=null!=(t=(0,s.usePathname)())?t:"",null!=(i=null==(a=eH.find(e=>n.startsWith(e.prefix)))?void 0:a.labelKey)?i:null);return(0,r.jsxs)("header",{"data-testid":"screen-status-row",className:"flex flex-shrink-0 items-center justify-end gap-4 px-4 py-1.5 border-b border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md empty:hidden",children:[!o&&(0,r.jsx)("h1",{"data-testid":"header-screen-title",className:"mr-auto min-w-0 truncate text-lg font-bold text-foreground",children:l}),(0,r.jsx)(ez,{}),(0,r.jsx)(e_.H,{})]})}function eY(e){let{count:t}=e,n=(0,f.c)("common");return 0===t?null:(0,r.jsx)("span",{"data-testid":"attention-badge-bubble",role:"status","aria-label":n("attention.badgeLabel",{count:t}),className:"absolute -top-1.5 -right-2.5 min-w-[1.05rem] rounded-full bg-warning-foreground px-1 text-[0.625rem] font-bold leading-[1.05rem] text-warning-subtle tabular-nums text-center",children:t>99?"99+":t})}let eU="relative flex h-10 w-10 items-center justify-center rounded-md transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",eq="text-sidebar-muted hover:bg-sidebar-hover hover:text-sidebar-foreground";function eG(e){let{href:t,icon:n,label:s,testId:a,isActive:i,badge:l}=e;return(0,r.jsx)(Y.m_,{content:s,placement:"right",children:(0,r.jsx)(x,{href:t,"data-testid":a,"aria-label":s,"aria-current":i?"page":void 0,className:"".concat(eU," ").concat(i?"bg-sidebar-hover text-sidebar-foreground":eq),children:(0,r.jsxs)("span",{className:"relative flex",children:[(0,r.jsx)(n,{size:20,"aria-hidden":"true"}),l]})})})}function eX(e){let{icon:t,label:n,testId:s,onClick:a,hasPopup:i}=e;return(0,r.jsx)(Y.m_,{content:n,placement:"right",children:(0,r.jsx)("button",{type:"button","data-testid":s,"aria-label":n,"aria-haspopup":i,onClick:a,className:"".concat(eU," ").concat(eq),children:(0,r.jsx)(t,{size:20,"aria-hidden":"true"})})})}function eJ(){var e;let t=(0,f.c)("common"),n=(0,f.c)("commandPalette"),i=null!=(e=(0,s.usePathname)())?e:"",{setOpen:l}=(0,el.C)(),{openNewTask:o}=(0,eo.hX)(),{count:d}=(0,ey.Lv)(),c=t("settings.title"),u={sessions:(0,r.jsx)(eG,{href:"/sessions",icon:p.A,label:t("nav.sessions"),testId:"sidebar-rail-sessions",isActive:i.startsWith("/sessions")}),repositories:(0,r.jsx)(eG,{href:"/repositories",icon:b.A,label:t("nav.repositories"),testId:"sidebar-rail-repositories",isActive:i.startsWith("/repositories")}),review:(0,r.jsx)(eG,{href:d>0?I.ks:"/review",icon:g.A,label:t("nav.review"),testId:"sidebar-rail-review",isActive:i.startsWith("/review"),badge:(0,r.jsx)(eY,{count:d})})};return(0,r.jsxs)("nav",{"data-testid":"sidebar-rail","aria-label":t("sidebar.railLabel"),className:"flex h-full flex-col items-center gap-1 bg-sidebar pb-2 text-sidebar-foreground",style:{width:"".concat(B.BN,"px")},children:[(0,r.jsx)(eg,{testId:"sidebar-rail-toggle"}),(0,r.jsx)(eX,{icon:es.A,label:t("newTask.title"),testId:"sidebar-rail-new-task",onClick:()=>o(),hasPopup:"dialog"}),(0,r.jsx)(eX,{icon:ea.A,label:n("mobileTrigger"),testId:"sidebar-rail-search",onClick:()=>l(!0)}),(0,r.jsx)("div",{className:"my-1 w-8 border-b border-sidebar-border","aria-hidden":"true"}),B.go.map(e=>(0,r.jsx)(a.Fragment,{children:u[e]},e)),(0,r.jsx)("div",{className:"mt-auto",children:(0,r.jsx)(en,{testIdPrefix:"sidebar-rail-settings",side:"right",align:"end",showDisplayPreferences:!0,children:(0,r.jsx)(Y.m_,{content:c,placement:"right",children:(0,r.jsx)(ee,{asChild:!0,children:(0,r.jsx)("button",{type:"button","data-testid":"sidebar-rail-settings","aria-label":c,className:"".concat(eU," ").concat(eq),children:(0,r.jsx)(v.A,{size:20,"aria-hidden":"true"})})})})})})]})}var eZ=n(46365),e$=n(12906),eQ=n(37772),e0=n(9540),e1=n(55756);let e2=[{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions"),icon:(0,r.jsx)(p.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:e=>e.startsWith("/review"),icon:(0,r.jsx)(g.A,{size:20,"aria-hidden":"true"}),showsAttentionBadge:!0},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more"),icon:(0,r.jsx)(eQ.A,{size:20,"aria-hidden":"true"})}];function e5(){let e=(0,s.usePathname)(),{setOpen:t}=(0,el.C)(),n=(0,f.c)("commandPalette"),a=(0,f.c)("common"),{count:l}=(0,ey.Lv)(),o=(0,i.pT)();return(null==o?void 0:o.isMobileDrawerOpen)?null:(0,r.jsx)("nav",{"data-testid":"global-mobile-nav",className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md pb-safe",children:(0,r.jsxs)("div",{className:"flex items-center justify-around h-14",children:[o&&(0,r.jsxs)("button",{type:"button","data-testid":"mobile-nav-open-sidebar",...e1.cv,onClick:o.openMobileDrawer,className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,r.jsx)(e0.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a("sidebar.branches")})]}),e2.map(t=>{let n=t.isActive(e),s=!0===t.showsAttentionBadge&&l>0;return(0,r.jsxs)(x,{href:s?I.ks:t.href,className:"flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ".concat(n?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:[(0,r.jsxs)("span",{className:"relative inline-flex",children:[t.icon,!0===t.showsAttentionBadge&&(0,r.jsx)(eY,{count:l})]}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a(t.labelKey)})]},t.href)}),(0,r.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>t(!0),"aria-label":n("mobileTrigger"),className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,r.jsx)(ea.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:n("mobileLabel")})]})]})})}function e4(){let{shouldSurface:e,isReconnecting:t}=(0,eW.Fx)(),n=(0,f.c)("common");if(!e)return null;let s=n(t?"connection.reconnecting":"connection.offline"),a=n(t?"connection.reconnectingTooltip":"connection.offlineTooltip");return(0,r.jsx)("div",{"data-testid":"mobile-connection-banner","data-connection-state":t?"reconnecting":"offline",role:"status","aria-live":"polite",title:a,className:"shrink-0 pt-safe border-b ".concat(t?"bg-warning-subtle border-warning-border text-warning-foreground":"bg-danger-subtle border-danger-border text-danger-foreground"),children:(0,r.jsxs)("div",{className:"flex items-center justify-center gap-1.5 px-3 py-1 text-xs",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"w-1.5 h-1.5 rounded-full ".concat(t?"bg-warning motion-safe:animate-pulse":"bg-danger")}),s]})})}var e3=n(45573),e9=n(94465),e6=n(70628);function e7(e){return!0===e.isComposing||229===e.keyCode}let e8=[...ec,{id:"newTask",keys:["MOD","Shift","O"],scope:"global"},{id:"newTaskSend",keys:["MOD","↵"],scope:"global"}];function te(){let{open:e,setOpen:t}=(0,e6.K)(),{open:n}=(0,el.C)(),{isOpen:s}=(0,eo.hX)(),i=(0,f.c)("keyboardShortcuts"),[l,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>o(eu()),[]);let d=(0,a.useRef)(e);(0,a.useEffect)(()=>{d.current=e},[e]);let c=(0,a.useRef)(n);(0,a.useEffect)(()=>{c.current=n},[n]);let u=(0,a.useRef)(s);(0,a.useEffect)(()=>{u.current=s},[s]),(0,a.useEffect)(()=>{function e(e){"?"!==e.key||e.isComposing||229===e.keyCode||(0,e3.tJ)(e.target)||c.current||u.current||d.current||(e.preventDefault(),t(!0))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ec;return ed.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}(e8);return(0,r.jsx)(e9.a,{isOpen:e,onClose:()=>t(!1),title:i("title"),size:"md",children:(0,r.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:m.map(e=>{let{scope:t,shortcuts:n}=e;return(0,r.jsxs)("section",{"data-testid":"keyboard-shortcuts-scope-".concat(t),children:[(0,r.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("scopes.".concat(t))}),(0,r.jsx)("ul",{className:"divide-y divide-border",children:n.map(e=>(0,r.jsxs)("li",{"data-testid":"keyboard-shortcut-".concat(e.id),className:"flex items-center justify-between gap-4 py-2",children:[(0,r.jsx)("span",{className:"text-sm text-foreground",children:i("shortcuts.".concat(e.id))}),(0,r.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:e.keys.map((e,t)=>(0,r.jsx)(ei.u,{children:em(e,l)},t))})]},e.id))})]},t)})})})}var tt=n(77016),tn=n(36809),tr=n(31166);let ts=/^v?\d+\.\d+\.\d+$/;function ta(e){return e.replace(/^v/,"").split(".").map(Number)}let ti="commandmate.lastSeenAppVersion";function tl(e){try{window.localStorage.setItem(ti,e)}catch(e){}}let to=[{key:"added",labelKey:"whatsNew.added"},{key:"improved",labelKey:"whatsNew.improved"},{key:"fixed",labelKey:"whatsNew.fixed"}];function td(){let e=(0,f.c)("common"),t=(0,tn.Ym)(),[n,s]=(0,a.useState)(null),[i,l]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e,t="0.46.0";try{e=window.localStorage.getItem(ti)}catch(e){return}let n=function(e,t){if(!ts.test(t))return{kind:"none"};if(null===e||!ts.test(e))return{kind:"remember"};let n=function(e,t){let n=ta(e),r=ta(t),s=Math.max(n.length,r.length);for(let e=0;e<s;e++){let t=n[e]||0,s=r[e]||0;if(t>s)return 1;if(t<s)return -1}return 0}(t,e);return 0===n?{kind:"none"}:n<0?{kind:"remember"}:{kind:"show",from:e}}(e,t);if("none"===n.kind)return;if("remember"===n.kind)return void tl(t);let r=!1;return ek.GQ.getReleaseNotes(n.from,t).then(e=>{r||(s({from:n.from,to:t,notes:e.notes}),l(!0))},()=>{}),()=>{r=!0}},[]);let o=(0,a.useCallback)(()=>{n&&tl(n.to),l(!1)},[n]);if(!n)return null;let d="ja"===t?"ja":"en";return(0,r.jsx)(e9.a,{isOpen:i,onClose:o,title:e("whatsNew.title",{from:n.from,to:n.to}),size:"md",children:(0,r.jsxs)("div",{className:"space-y-4","data-testid":"whats-new-dialog",children:[0===n.notes.length?(0,r.jsx)("p",{className:"text-sm text-foreground","data-testid":"whats-new-empty",children:e("whatsNew.empty")}):n.notes.map(t=>(0,r.jsxs)("section",{className:"space-y-3","data-testid":"whats-new-version-".concat(t.version),children:[(0,r.jsxs)("h4",{className:"text-sm font-semibold text-foreground",children:["v",t.version,(0,r.jsx)("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:t.date})]}),t.highlight&&(0,r.jsxs)("div",{"data-testid":"whats-new-highlight",children:[(0,r.jsx)("h5",{className:"text-xs font-medium text-muted-foreground",children:e("whatsNew.highlight")}),(0,r.jsx)("p",{className:"mt-1 text-sm text-foreground",children:t.highlight[d]})]}),to.map(n=>{let{key:s,labelKey:a}=n;return t[s].length>0?(0,r.jsxs)("div",{"data-testid":"whats-new-".concat(s),children:[(0,r.jsx)("h5",{className:"text-xs font-medium text-muted-foreground",children:e(a)}),(0,r.jsx)("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-sm text-foreground",children:t[s].map((e,t)=>(0,r.jsx)("li",{children:e[d]},t))})]},s):null})]},t.version)),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-border pt-3",children:[(0,r.jsx)("a",{href:"".concat("https://github.com/Kewton/CommandMate/releases/tag/v").concat(n.to),target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-600 dark:text-accent-400 hover:underline","data-testid":"whats-new-release-link",children:e("whatsNew.releaseLink")}),(0,r.jsx)(tr.$,{type:"button",variant:"primary",size:"sm",onClick:o,"data-testid":"whats-new-close",children:e("whatsNew.close")})]})]})})}var tc=n(76351);let tu="commandmate.newTask.recentTargets";function tm(e){if(null===e||"object"!=typeof e)return!1;let{worktreeId:t,instanceId:n}=e;return"string"==typeof t&&""!==t&&"string"==typeof n&&""!==n}function th(e,t){return e.worktreeId===t.worktreeId&&e.instanceId===t.instanceId}function tx(){try{let e=window.localStorage.getItem(tu);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(tm).map(e=>{let{worktreeId:t,instanceId:n}=e;return{worktreeId:t,instanceId:n}}).slice(0,3)}catch(e){return[]}}var tf=n(54014);function tp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map;for(let r of e){let e=n.get(r.repositoryPath);if(!e){let s=t.find(e=>e.path===r.repositoryPath);e={path:r.repositoryPath,name:(null==s?void 0:s.displayName)||(null==s?void 0:s.name)||r.repositoryName,worktrees:[]},n.set(r.repositoryPath,e)}e.worktrees.push(r)}let r=Array.from(n.values());for(let e of r)e.worktrees.sort((e,t)=>e.name.localeCompare(t.name));return r.sort((e,t)=>e.name.localeCompare(t.name))}function tb(e){return e.agentInstances&&e.agentInstances.length>0?e.agentInstances.slice().sort((e,t)=>e.order-t.order):e.selectedAgents&&e.selectedAgents.length>0?(0,tf.lu)(e.selectedAgents):e.cliToolId?(0,tf.lu)([e.cliToolId]):[]}function tg(e,t){let n=e.find(e=>e.id===t.worktreeId);if(!n)return null;let r=tb(n).find(e=>e.id===t.instanceId);return r?{worktree:n,instance:r}:null}function tv(e,t){var n,r,s,a;let i=null!=(a=null==(n=e.sessionStatusByInstance)?void 0:n[t.id])?a:t.id===t.cliTool?null==(r=e.sessionStatusByCli)?void 0:r[t.cliTool]:void 0,l=null==i?void 0:i.startingSince,o=null==(s=e.autoYesByInstance)?void 0:s[t.id];return{instance:t,label:(0,tf.sw)(t),running:(null==i?void 0:i.isRunning)===!0,starting:"number"==typeof l,autoYes:(null==o?void 0:o.enabled)&&"number"==typeof o.expiresAt?o:null}}var tw=n(56936);let tj={promptWaiting:"PROMPT_WAITING",sessionStarting:"SESSION_STARTING",instanceToolConflict:"instance_tool_conflict"};async function ty(e){try{let t=await e.json(),n=t&&"object"==typeof t?t.expiresAt:null;if("number"==typeof n)return{enabled:!0,expiresAt:n}}catch(e){}return null}async function tk(e){try{let t=await e.json();if(t&&"object"==typeof t){let{error:e,code:n}=t;return{error:"string"==typeof e&&""!==e?e:null,code:"string"==typeof n?n:null}}}catch(e){}return{error:null,code:null}}async function tN(e,t){let{modelRequested:n}=t;if(e.ok&&!e.redirected)return{ok:!0};let{status:r}=e,{error:s,code:a}=await tk(e);return{ok:!1,kind:409===r?a===tj.promptWaiting?"prompt_waiting":"conflict":503===r?a===tj.sessionStarting?"starting":"start_failed":400===r?n&&a!==tj.instanceToolConflict?"model_rejected":"invalid":"failed",status:e.ok?0:r,detail:s}}function tC(e){return{ok:!1,kind:"failed",status:0,detail:e instanceof ek.hD||e instanceof Error?e.message:null}}function tS(e,t){return new Promise((n,r)=>{let s=setTimeout(()=>{r(new ek.hD("Request timed out after ".concat(t,"ms"),0,void 0,"timeout"))},t);e().then(e=>{clearTimeout(s),n(e)},e=>{clearTimeout(s),r(e)})})}async function tI(e){var t;let n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ek.E,{target:s,cliToolId:a}=e,i="/api/worktrees/".concat(encodeURIComponent(s.worktreeId)),l={"Content-Type":"application/json"},o=!1,d=e.autoYesDuration;if(null!==d){let e,t=!1;try{e=await tS(async()=>{var e;let c=await r("".concat(i,"/auto-yes"),{method:"POST",headers:l,body:JSON.stringify({enabled:!0,cliToolId:a,instanceId:s.instanceId,duration:d})});if(!c.ok){let{error:e}=await tk(c);return{ok:!1,kind:"auto_yes_failed",status:c.status,detail:e}}return t=!0,n=null!=(e=await ty(c))?e:void 0,o=void 0===n,null},(0,tw.Z3)("POST"))}catch(e){if(!t){let t=tC(e);return t.ok?t:{...t,kind:"auto_yes_failed"}}return{...tC(e),autoYesStateUnknown:!0}}if(e)return e}let c=e=>n?{...e,armedAutoYes:n}:o?{...e,autoYesStateUnknown:!0}:e,u=(null==(t=e.model)?void 0:t.trim())||void 0,m=(0,tw.SE)();try{return c(await tS(async()=>{let t=await r("".concat(i,"/send"),{method:"POST",headers:l,body:JSON.stringify({content:e.content,cliToolId:a,instanceId:s.instanceId,...u?{model:u}:{}}),timeoutMs:m});return tN(t,{modelRequested:void 0!==u})},m))}catch(e){return c(tC(e))}}let tT="w-full 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 disabled:opacity-60",tA="block text-xs font-medium text-muted-foreground mb-1";function tM(){var e,t,n,i,l,o,d,c,u,m;let{requestedTarget:h,screenTarget:x,closeNewTask:p,setCloseLocked:b}=(0,eo.hX)(),g=(0,s.useRouter)(),{showToast:v}=(0,ej.dj)(),w=(0,f.c)("common"),j=(0,f.c)("autoYes"),[y,k]=(0,a.useState)({status:"loading"}),[N,C]=(0,a.useState)(0),[S]=(0,a.useState)(()=>tx()),[I,T]=(0,a.useState)(""),[A,M]=(0,a.useState)(""),[E,L]=(0,a.useState)(""),[P,K]=(0,a.useState)(""),[R,O]=(0,a.useState)(null),[D,F]=(0,a.useState)(!1),[W,z]=(0,a.useState)(null),[_,H]=(0,a.useState)(!1),V=(0,a.useRef)(null),Y=(0,a.useRef)(!0),U=(0,a.useRef)(!1),[q,G]=(0,a.useState)({}),[X,J]=(0,a.useState)({});(0,a.useEffect)(()=>(Y.current=!0,H(eu()),()=>{Y.current=!1,b(!1)}),[b]);let Z=(0,a.useCallback)(()=>{U.current||p()},[p]),$=(0,a.useRef)([h,x,null!=(e=S[0])?e:null]),Q=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=!1;return k({status:"loading"}),ek.y.getAll().then(t=>{var n,r;if(e)return;let s=null!=(n=t.worktrees)?n:[],a=null!=(r=t.repositories)?r:[];if(k({status:"ready",worktrees:s,repositories:a}),Q.current)return;Q.current=!0;let i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let n of t){if(!n)continue;if(tg(e,n))return n;let t=e.find(e=>e.id===n.worktreeId),r=t?tb(t)[0]:void 0;if(t&&r)return{worktreeId:t.id,instanceId:r.id}}for(let t of tp(e,n))for(let e of t.worktrees){let t=tb(e)[0];if(t)return{worktreeId:e.id,instanceId:t.id}}return null}(s,$.current,a);i&&(T(i.worktreeId),M(i.instanceId))}).catch(()=>{e||k({status:"error"})}),()=>{e=!0}},[N]);let ee=(0,a.useMemo)(()=>"ready"===y.status?y.worktrees:[],[y]),et=(0,a.useMemo)(()=>"ready"===y.status?tp(y.worktrees,y.repositories):[],[y]),en=null!=(t=ee.find(e=>e.id===I))?t:null,er=(0,a.useMemo)(()=>en?tb(en):[],[en]),es=null!=(n=er.find(e=>e.id===A))?n:null,ea=en&&es?tv(en,es):null,el=en&&null!=(i=et.find(e=>e.path===en.repositoryPath))?i:null,ed=ea?(m=ea.instance.cliTool,"copilot"===m?{selectable:!0}:"claude"===m||"antigravity"===m?ea.running||ea.starting?{selectable:!1,reason:"running"}:{selectable:!0}:{selectable:!1,reason:"unsupported"}):null,ec=ea?null!=(l=X["".concat(I,":").concat(ea.instance.id)])?l:ea.autoYes:null,eh=!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return!!e&&e.enabled&&"number"==typeof e.expiresAt&&e.expiresAt-t>0}(ec)?null:ec,ex=!!ea&&!0===q["".concat(I,":").concat(ea.instance.id)],[,ef]=(0,a.useState)(0);(0,a.useEffect)(()=>{if(!eh)return;let e=setInterval(()=>ef(Date.now()),tc.$s);return()=>clearInterval(e)},[eh]),(0,a.useEffect)(()=>{var e;"ready"===y.status&&(null==(e=V.current)||e.focus())},[y.status]);let ep=(0,a.useMemo)(()=>S.flatMap(e=>{var t;let n=tg(ee,e);if(!n)return[];let r=et.find(e=>e.path===n.worktree.repositoryPath),s=tv(n.worktree,n.instance).label;return[{target:e,label:"".concat(null!=(t=null==r?void 0:r.name)?t:n.worktree.repositoryName," / ").concat(n.worktree.name," / ").concat(s)}]}),[S,ee,et]),eb=(0,a.useCallback)(e=>{T(e.worktreeId),M(e.instanceId),z(null)},[]),eg=(0,a.useCallback)(e=>{var t,n,r;let s=et.find(t=>t.path===e),a=null!=(n=null==s?void 0:s.worktrees.find(e=>tb(e).length>0))?n:null==s?void 0:s.worktrees[0];a&&eb({worktreeId:a.id,instanceId:null!=(r=null==(t=tb(a)[0])?void 0:t.id)?r:""})},[et,eb]),ev=(0,a.useCallback)(e=>{var t,n,r;let s=ee.find(t=>t.id===e);if(!s)return;let a=tb(s),i=a.find(e=>e.id===A);eb({worktreeId:s.id,instanceId:null!=(r=null!=(n=null==i?void 0:i.id)?n:null==(t=a[0])?void 0:t.id)?r:""})},[ee,A,eb]),ew=!!ea&&""!==E.trim()&&!D,ey=(0,a.useCallback)(async()=>{if(!ew||!en||!ea)return;let e={worktreeId:en.id,instanceId:ea.instance.id};U.current=!0,b(!0),F(!0),z(null);let t=await tI({target:e,cliToolId:ea.instance.cliTool,content:E.trim(),model:(null==ed?void 0:ed.selectable)?P:void 0,autoYesDuration:eh?null:R});if(U.current=!1,b(!1),!Y.current)return;let{armedAutoYes:n}=t,r="".concat(e.worktreeId,":").concat(e.instanceId);if(t.autoYesStateUnknown&&G(e=>({...e,[r]:!0})),n&&(G(e=>{let{[r]:t,...n}=e;return n}),J(e=>({...e,[r]:n})),O(null)),!t.ok){z(t),F(!1);return}var s=e;let a=[{worktreeId:s.worktreeId,instanceId:s.instanceId},...tx().filter(e=>!th(e,s))].slice(0,3);try{window.localStorage.setItem(tu,JSON.stringify(a))}catch(e){}let i="".concat(window.location.pathname).concat(window.location.search),l="".concat(en.name," / ").concat(ea.label);p(),g.push((0,B.Ii)(e)),v(w("newTask.sentToast",{target:l}),"success",6e3,{onClick:()=>g.push(i)})},[ew,en,ea,E,ed,P,eh,R,p,b,g,v,w]),eN=(0,a.useCallback)(e=>{var t;e7(t=e.nativeEvent)||"Enter"!==t.key||t.shiftKey||t.altKey||!t.metaKey&&!t.ctrlKey||(e.preventDefault(),ey())},[ey]),eC=null!=(o=null==ea?void 0:ea.label)?o:"",eS=ea?ea.starting?"starting":ea.running?"running":"stopped":null;return(0,r.jsx)(e9.a,{isOpen:!0,onClose:Z,title:w("newTask.title"),size:"md",disableClose:D,children:(0,r.jsxs)("div",{"data-testid":"new-task-dialog",className:"space-y-4",onKeyDown:eN,children:["loading"===y.status&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"new-task-loading",children:w("newTask.loading")}),"error"===y.status&&(0,r.jsxs)("div",{className:"space-y-2",role:"alert","data-testid":"new-task-load-error",children:[(0,r.jsx)("p",{className:"text-sm text-danger",children:w("newTask.loadError")}),(0,r.jsx)("button",{type:"button",onClick:()=>C(e=>e+1),className:"px-3 py-1.5 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg",children:w("retry")})]}),"ready"===y.status&&0===et.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"new-task-empty",children:w("newTask.noTargets")}),"ready"===y.status&&et.length>0&&(0,r.jsxs)(r.Fragment,{children:[ep.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:tA,children:w("newTask.recentLabel")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2","data-testid":"new-task-recents",children:ep.map(e=>{let{target:t,label:n}=e,s=!!ea&&th(t,{worktreeId:I,instanceId:ea.instance.id});return(0,r.jsx)("button",{type:"button","aria-pressed":s,"data-testid":"new-task-recent",onClick:()=>eb(t),className:"max-w-full truncate rounded-full border px-3 py-1 text-xs transition-colors ".concat(s?"border-accent-500 bg-accent-500/15 text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:n},"".concat(t.worktreeId,":").concat(t.instanceId))})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-repository",className:tA,children:w("newTask.repositoryLabel")}),(0,r.jsx)("select",{id:"new-task-repository","data-testid":"new-task-repository",value:null!=(d=null==el?void 0:el.path)?d:"",onChange:e=>eg(e.target.value),className:tT,children:et.map(e=>(0,r.jsx)("option",{value:e.path,children:e.name},e.path))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-branch",className:tA,children:w("newTask.branchLabel")}),(0,r.jsx)("select",{id:"new-task-branch","data-testid":"new-task-branch",value:I,onChange:e=>ev(e.target.value),className:tT,children:(null!=(c=null==el?void 0:el.worktrees)?c:[]).map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-agent",className:tA,children:w("newTask.agentLabel")}),(0,r.jsx)("select",{id:"new-task-agent","data-testid":"new-task-agent",value:null!=(u=null==es?void 0:es.id)?u:"",onChange:e=>eb({worktreeId:I,instanceId:e.target.value}),className:tT,disabled:0===er.length,children:er.map(e=>{var t;let n=en?tv(en,e):null,s=(null==n?void 0:n.starting)?"starting":(null==n?void 0:n.running)?"running":"stopped";return(0,r.jsx)("option",{value:e.id,children:"".concat(null!=(t=null==n?void 0:n.label)?t:e.id," — ").concat(w("newTask.agentStatus.".concat(s)))},e.id)})})]})]}),"stopped"===eS&&(0,r.jsx)("p",{className:"text-xs text-foreground","data-testid":"new-task-will-start",children:w("newTask.willStart",{agent:eC})}),"starting"===eS&&(0,r.jsx)("p",{className:"text-xs text-warning-foreground","data-testid":"new-task-starting",children:w("newTask.startingNotice",{agent:eC})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-message",className:tA,children:w("newTask.messageLabel")}),(0,r.jsx)("textarea",{ref:V,id:"new-task-message","data-testid":"new-task-message",value:E,onChange:e=>L(e.target.value),placeholder:w("newTask.messagePlaceholder"),rows:5,className:"".concat(tT," resize-y")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-model",className:tA,children:w("newTask.modelLabel")}),(0,r.jsx)("input",{id:"new-task-model","data-testid":"new-task-model",type:"text",value:(null==ed?void 0:ed.selectable)?P:"",onChange:e=>K(e.target.value),placeholder:w("newTask.modelPlaceholder"),disabled:!(null==ed?void 0:ed.selectable),className:tT}),ed&&(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":"new-task-model-note",children:ed.selectable?w((null==ea?void 0:ea.instance.cliTool)==="copilot"?"newTask.modelHintSwitch":"newTask.modelHintLaunch"):w("newTask.modelUnavailable.".concat(ed.reason),{agent:eC})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-auto-yes",className:tA,children:w("newTask.autoYesLabel")}),eh?(0,r.jsx)("p",{className:"text-sm text-foreground","data-testid":"new-task-auto-yes-active",children:w("newTask.autoYesActive",{remaining:(0,tc.$B)(eh.expiresAt)})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("select",{id:"new-task-auto-yes","data-testid":"new-task-auto-yes",value:null!=R?R:"",onChange:e=>{let t=Number(e.target.value);O(""!==e.target.value&&(0,tc.dR)(t)?t:null)},className:tT,children:[(0,r.jsx)("option",{value:"",children:w(ex?"newTask.autoYesKeepUnknown":"newTask.autoYesKeep")}),tc.z9.map(e=>(0,r.jsx)("option",{value:e,children:w("newTask.autoYesEnableFor",{duration:j(tc.Ni[e].replace("autoYes.",""))})},e))]}),ex&&(0,r.jsx)("p",{className:"mt-1 text-xs text-warning-foreground","data-testid":"new-task-auto-yes-unknown",children:w("newTask.autoYesUnknown")}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:w("newTask.autoYesScope")}),null!==R&&(0,r.jsx)("p",{className:"mt-1 text-xs text-warning-foreground","data-testid":"new-task-auto-yes-risk",children:j("riskWarning")})]})]})]})]}),W&&(0,r.jsxs)("div",{role:"alert","data-testid":"new-task-error","data-kind":W.kind,className:"rounded-lg border border-danger-border bg-danger-subtle px-3 py-2 text-sm text-danger-foreground",children:[(0,r.jsx)("p",{children:w("newTask.errors.".concat(W.kind),{agent:eC})}),W.detail&&(0,r.jsx)("p",{className:"mt-1 break-words text-xs text-muted-foreground","data-testid":"new-task-error-detail",children:W.detail})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,r.jsxs)("span",{className:"mr-auto hidden items-center gap-1 text-xs text-muted-foreground sm:flex",children:[(0,r.jsx)(ei.u,{children:em("MOD",_)}),(0,r.jsx)(ei.u,{children:"↵"}),(0,r.jsx)("span",{children:w("newTask.sendHint")})]}),(0,r.jsx)("button",{type:"button","data-testid":"new-task-cancel",onClick:Z,disabled:D,className:"px-4 py-2 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg transition-colors disabled:opacity-50",children:w("cancel")}),(0,r.jsx)("button",{type:"button","data-testid":"new-task-send",onClick:()=>void ey(),disabled:!ew,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:D?w("newTask.sending"):w("newTask.send")})]})]})})}function tE(){let{isOpen:e,openNewTask:t}=(0,eo.hX)(),{open:n}=(0,el.C)(),s=(0,a.useRef)(n);return(0,a.useEffect)(()=>{s.current=n},[n]),(0,a.useEffect)(()=>{function e(e){if(!e.defaultPrevented)!e7(e)&&e.shiftKey&&!e.altKey&&(e.metaKey||e.ctrlKey)&&("o"===e.key.toLowerCase()||"KeyO"===e.code)&&(s.current||(e.preventDefault(),t()))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]),e?(0,r.jsx)(tM,{}):null}var tL=n(59854);let tP="transform transition-transform duration-300 ease-out",tB=(0,a.memo)(function(e){let{children:t}=e,{isOpen:n,isMobileDrawerOpen:u,closeMobileDrawer:m,width:h,setWidth:x,repoTabBarMode:f,toggle:p}=(0,i.VF)(),b=(0,l.a)(),{showSidebar:g,showGlobalNav:v}=function(){var e=(0,s.usePathname)();for(let t of d)if(e.startsWith(t.prefix))return{...o,...t.config};return{...o}}();!function(e,t){let{open:n}=(0,el.C)(),r=(0,a.useRef)(n),s=(0,a.useRef)(t);(0,a.useEffect)(()=>{r.current=n,s.current=t},[n,t]),(0,a.useEffect)(()=>{if(e)return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){!(e.defaultPrevented||!(0,B.zg)(e)||r.current||(0,eZ.Sj)())&&((0,B.al)(e.target)||(e.preventDefault(),s.current()))}},[e])}(!b&&g,p);let{factor:w}=(0,c.Ps)(),j=Math.round(160*w),y=Math.round(480*w),k=Math.round(Math.min(y,Math.max(j,h*w))),N=(0,B.fs)(null!=f?f:B.PB,n),C=(0,a.useRef)(null),S=(0,a.useRef)(null),I=(0,a.useRef)(null),T=(0,a.useRef)(u);(0,a.useLayoutEffect)(()=>{var e;let t=T.current;if(T.current=u,!b||!t||u)return;let n=document.activeElement,r=n instanceof HTMLElement&&(null==(e=I.current)?void 0:e.contains(n))===!0;(r||null===n||n===document.body)&&!(0,e1.Bl)()&&r&&n.blur()},[b,u]);let A=(0,a.useCallback)(e=>{x(Math.round(e/w))},[x,w]);return b?(0,r.jsx)(eo.Zg,{children:(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,r.jsx)(e4,{}),u&&(0,r.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:m,"aria-hidden":"true"}),g&&(0,r.jsx)("aside",{ref:I,"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 max-w-[85vw] z-50 bg-sidebar pt-safe pb-safe\n ".concat(tP,"\n ").concat(u?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,r.jsx)(eT,{})}),(0,r.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden ".concat(v?"pb-nav-safe":""),role:"main","data-view-transition":"content",children:t}),v&&(0,r.jsx)(e5,{}),(0,r.jsx)(e3.xq,{}),(0,r.jsx)(te,{}),(0,r.jsx)(tt.n,{}),(0,r.jsx)(td,{}),(0,r.jsx)(tE,{})]})}):(0,r.jsx)(eo.Zg,{children:(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,r.jsxs)("div",{className:"flex flex-1 min-h-0",children:[g&&(0,r.jsxs)("aside",{ref:C,"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full\n border-r border-border\n ".concat(tP,"\n ").concat(n?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(k,"px"),zIndex:tL.M.SIDEBAR},role:"complementary","aria-hidden":!n,children:[(0,r.jsx)(eT,{}),(0,r.jsx)(tK,{currentWidth:k,minWidth:j,maxWidth:y,sidebarRef:C,mainRef:S,onWidthChange:A})]}),g&&!n&&(0,r.jsx)("aside",{"data-testid":"sidebar-rail-container",className:"\n fixed left-0 top-0 h-full\n border-r border-border\n ",style:{width:"".concat(B.BN,"px"),zIndex:tL.M.SIDEBAR},children:(0,r.jsx)(eJ,{})}),(0,r.jsxs)("main",{ref:S,className:"flex-1 min-w-0 h-full overflow-hidden flex flex-col transition-[padding] duration-300 ease-out",style:{paddingLeft:g?"".concat(n?k:B.BN,"px"):0},role:"main","data-view-transition":"content",children:[N&&(0,r.jsx)(e$.vP,{}),v&&(0,r.jsx)(eV,{}),(0,r.jsx)("div",{className:"flex-1 min-h-0",children:t})]})]}),(0,r.jsx)(e3.xq,{}),(0,r.jsx)(te,{}),(0,r.jsx)(tt.n,{}),(0,r.jsx)(td,{}),(0,r.jsx)(tE,{})]})})});function tK(e){let{currentWidth:t,minWidth:n,maxWidth:s,sidebarRef:a,mainRef:i,onWidthChange:l}=e;return(0,r.jsx)("div",{"data-testid":"sidebar-resize-handle","aria-hidden":"true",onMouseDown:e=>{e.preventDefault();let r=e.clientX,o=t;i.current&&(i.current.style.transition="none");let d=e=>{o=Math.max(n,Math.min(s,t+(e.clientX-r))),a.current&&(a.current.style.width="".concat(o,"px")),i.current&&(i.current.style.paddingLeft="".concat(o,"px"))},c=()=>{document.body.style.cursor="",document.body.style.userSelect="",i.current&&(i.current.style.transition=""),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),l(o)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",d),document.addEventListener("mouseup",c)},className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-accent-500/40 transition-colors"})}let tR=["/login","/offline","/proxy"],tO=/^\/worktrees\/[^/]+\/(terminal|files)(\/|$)/;function tD(e){var t;let{children:n}=e,a=(0,s.usePathname)();return(t=null!=a?a:"",tR.some(e=>t===e||t.startsWith("".concat(e,"/")))||tO.test(t)||0)?(0,r.jsx)(r.Fragment,{children:n}):(0,r.jsx)(tB,{children:n})}}},e=>{e.O(0,[5373,2978,6809,4909,2770,2619,6606,7730,5927,8407,2407,344,6654,8606,4768,8165,602,5794,8441,1255,7358],()=>e(e.s=80903)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{13673:()=>{},23252:(e,t,n)=>{"use strict";n.d(t,{AppProviders:()=>M});var r=n(95155),s=n(20063);n(95704);let a=["/login","/api/auth/login","/api/auth/logout","/api/auth/status","/api/remote/pair","/manifest.webmanifest","/sw.js","/offline"];var i=n(3809),l=n(5379),o=n(32916),d=n(65380),c=n(22592),u=n(92614),m=n(70628),h=n(66966),x=n(89275),f=n(60199),p=n(36402),b=n(63470),g=n(40823),v=n(58165),w=n(94442),j=n(72604),y=n(95275),k=n(79832),N=n(12115),C=n(18955),S=n(89559),I=n(59854),T=n(77016);function A(){let e=(0,C.c)("pwa"),[t,n]=(0,N.useState)(null),s=(0,N.useRef)(!1),a=(0,T.W)();return((0,N.useEffect)(()=>{if("undefined"==typeof navigator||!("serviceWorker"in navigator))return;let e=!1,t=t=>{e||n(t)};navigator.serviceWorker.register("/sw.js").then(e=>{e.waiting&&navigator.serviceWorker.controller&&t(e.waiting),e.addEventListener("updatefound",()=>{let n=e.installing;n&&n.addEventListener("statechange",()=>{"installed"===n.state&&navigator.serviceWorker.controller&&t(n)})})}).catch(()=>{});let r=()=>{s.current||(s.current=!0,window.location.reload())};return navigator.serviceWorker.addEventListener("controllerchange",r),()=>{e=!0,navigator.serviceWorker.removeEventListener("controllerchange",r)}},[]),!t||a)?null:(0,r.jsx)("div",{"data-testid":"pwa-update-toast",role:"status","aria-live":"polite",className:"pointer-events-none fixed bottom-0 right-0 flex max-w-full justify-end px-4 pb-safe",style:{zIndex:I.M.TOAST},children:(0,r.jsxs)("div",{"data-testid":"pwa-update-toast-card",className:"pointer-events-auto mb-4 flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3 shadow-lg",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:e("update.available")}),(0,r.jsxs)("button",{type:"button",onClick:()=>{t.postMessage({type:"SKIP_WAITING"})},className:"inline-flex items-center gap-1.5 rounded-md bg-accent-600 px-3 py-1.5 text-sm font-medium text-white transition-colors hover:bg-accent-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ring-offset-background dark:bg-accent-500 dark:hover:bg-accent-600",children:[(0,r.jsx)(S.A,{className:"h-4 w-4"}),e("update.reload")]})]})})}function M(e){var t;let{children:n,locale:N,messages:C,timeZone:S,authEnabled:I=!1}=e,T=(t=(0,s.usePathname)(),!I||!a.includes(null!=t?t:""));return(0,r.jsx)(i.default,{locale:N,messages:C,timeZone:S,children:(0,r.jsx)(w.tE,{children:(0,r.jsx)(l.N,{attribute:"class",defaultTheme:"system",enableSystem:!0,children:(0,r.jsx)(d.O,{authEnabled:I,children:(0,r.jsx)(c.W5,{children:(0,r.jsx)(o.GB,{children:(0,r.jsx)(f.tS,{enabled:T,children:(0,r.jsxs)(h.g7,{enabled:T,children:[(0,r.jsx)(j.rM,{}),(0,r.jsx)(k.o,{}),(0,r.jsx)(y.H,{}),(0,r.jsx)(u.E,{children:(0,r.jsx)(m.S,{children:(0,r.jsx)(p.aF,{children:(0,r.jsx)(b.y2,{enabled:T,children:(0,r.jsxs)(g.NS,{children:[(0,r.jsx)(x.Bo,{children:n}),(0,r.jsx)(A,{}),(0,r.jsx)(v.gZ,{})]})})})})})]})})})})})})})})}},60322:(e,t,n)=>{"use strict";n.d(t,{l:()=>s});let r=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function s(e){var t;if(!e||0===e.trim().length)return;let n=e.replace(r,"");if(null==(t=navigator.clipboard)?void 0:t.writeText)try{await navigator.clipboard.writeText(n);return}catch(e){}let s=document.createElement("textarea");s.value=n,s.style.position="fixed",s.style.left="-9999px",s.style.top="-9999px",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy")}finally{document.body.removeChild(s)}}},65380:(e,t,n)=>{"use strict";n.d(t,{H:()=>l,O:()=>i});var r=n(95155),s=n(12115);let a=(0,s.createContext)(!1);function i(e){let{children:t,authEnabled:n}=e;return(0,r.jsx)(a.Provider,{value:n,children:t})}function l(){return(0,s.useContext)(a)}},77016:(e,t,n)=>{"use strict";n.d(t,{W:()=>g,n:()=>v});var r=n(95155),s=n(12115),a=n(18955),i=n(52056),l=n(89559),o=n(65229),d=n(59854),c=n(60199),u=n(52703);let m=0,h=new Set;function x(){for(let e of h)e()}function f(e){return h.add(e),()=>{h.delete(e)}}function p(){return m>0}function b(){return!1}function g(){return(0,s.useSyncExternalStore)(f,p,b)}function v(){let e=(0,a.c)("common"),[t,n]=(0,s.useState)(null),[h,f]=(0,s.useState)(null),p=(0,s.useCallback)(e=>{if(e.type!==u.Oo)return;let{serverVersion:t,clientVersion:r}=e;"string"==typeof t&&"string"==typeof r&&t&&r&&t!==h&&n({serverVersion:t,clientVersion:r})},[h]);(0,c.T3)(p);let b=null!==t;(0,s.useEffect)(()=>{if(b)return m+=1,x(),()=>{m-=1,x()}},[b]);let g=(0,s.useCallback)(()=>{window.location.reload()},[]),v=(0,s.useCallback)(()=>{n(e=>(e&&f(e.serverVersion),null))},[]);return t?(0,r.jsxs)("div",{"data-testid":"version-mismatch-banner",role:"alert","aria-live":"assertive",className:"fixed top-3 left-1/2 -translate-x-1/2 flex items-start gap-3 max-w-[92vw] rounded-lg border border-warning-border bg-warning-subtle px-4 py-3 text-warning-foreground shadow-lg",style:{zIndex:d.M.TOAST},children:[(0,r.jsx)(i.A,{className:"h-5 w-5 shrink-0 mt-0.5","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5 text-sm",children:[(0,r.jsx)("span",{className:"font-semibold",children:e("versionMismatch.title")}),(0,r.jsx)("span",{children:e("versionMismatch.description",{serverVersion:t.serverVersion,clientVersion:t.clientVersion})})]}),(0,r.jsxs)("button",{type:"button","data-testid":"version-mismatch-reload",onClick:g,className:"shrink-0 inline-flex items-center gap-1.5 rounded-md border border-warning-border px-3 py-1.5 text-sm font-medium hover:opacity-80 focus:outline-none focus:ring-2 focus:ring-offset-2",children:[(0,r.jsx)(l.A,{className:"h-4 w-4","aria-hidden":"true"}),e("versionMismatch.reload")]}),(0,r.jsx)("button",{type:"button","data-testid":"version-mismatch-dismiss",onClick:v,"aria-label":e("versionMismatch.dismiss"),className:"shrink-0 hover:opacity-70 focus:outline-none focus:ring-2 focus:ring-offset-2",children:(0,r.jsx)(o.A,{className:"h-4 w-4","aria-hidden":"true"})})]}):null}},80903:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,22311,23)),Promise.resolve().then(n.t.bind(n,7183,23)),Promise.resolve().then(n.t.bind(n,13673,23)),Promise.resolve().then(n.bind(n,91476)),Promise.resolve().then(n.bind(n,23252))},91476:(e,t,n)=>{"use strict";n.d(t,{AppShellGate:()=>tD});var r=n(95155),s=n(20063),a=n(12115),i=n(32916),l=n(38218);let o={showSidebar:!0,showGlobalNav:!0,showLocalNav:!1,autoCollapseSidebar:!1},d=[{prefix:"/worktrees/",config:{showGlobalNav:!1,showLocalNav:!0}},{prefix:"/sessions",config:{autoCollapseSidebar:!0}}];var c=n(22592),u=n(52619),m=n.n(u),h=n(89275);let x=(0,a.forwardRef)(function(e,t){let{href:n,onClick:a,target:i,...l}=e,o=(0,s.usePathname)(),d=(0,h.Hq)();return(0,r.jsx)(m(),{ref:t,href:n,target:i,onClick:e=>{var t;null==a||a(e),e.defaultPrevented||0!==(t=e).button||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||void 0!==i&&"_self"!==i||/^([a-z][a-z0-9+.-]*:)?\/\//i.test(n)||/^(mailto:|tel:)/i.test(n)||(e.preventDefault(),n!==o&&d.push(n))},...l})});var f=n(18955),p=n(66685),b=n(85710),g=n(61362),v=n(15870),w=n(17787),j=n(49027),y=n(27587),k=n(39649),N=n(46615),C=n(76471),S=n(70532),I=n(44308),T=n(38606);let A=(0,a.memo)(function(e){let{worktrees:t,visibleWorktreeIds:n,selectedWorktreeId:s,onSelect:a,onNavigate:i}=e,l=(0,f.c)("common"),o=t.length;if(0===o)return null;let d=t.slice(0,3),c=o-d.length;return(0,r.jsxs)("section",{"data-testid":"sidebar-needs-attention","aria-label":l("sidebar.needsAttention"),className:"flex-shrink-0 px-2 pt-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-2 pb-1 text-xs text-sidebar-muted",children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:l("sidebar.needsAttention")}),(0,r.jsx)("span",{"data-testid":"sidebar-needs-attention-count","aria-label":l("attention.badgeLabel",{count:o}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 font-semibold leading-5 tabular-nums text-warning-foreground",children:o>99?"99+":o})]}),(0,r.jsx)("ul",{className:"space-y-0.5",children:d.map(e=>{let t=(0,T.XK)(e),i=!n.has(e.id),o=e.id===s;return(0,r.jsx)("li",{children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-attention-item","data-hidden-repository":i?"true":void 0,onClick:()=>a(e.id),"aria-current":o?"true":void 0,title:"".concat(t.name," \xb7 ").concat(t.repositoryName),className:"flex h-[34px] w-full min-w-0 items-center gap-2 rounded-md px-2 text-left transition-colors hover:bg-sidebar-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-sidebar-hover":""),children:[(0,r.jsx)("span",{className:"flex w-4 flex-shrink-0 items-center justify-center",children:(0,r.jsx)(C.Ej,{status:"waiting",waitingKind:t.waitingKind})}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm text-sidebar-foreground",children:t.name}),(0,r.jsx)("span",{className:"min-w-0 max-w-[40%] flex-shrink truncate text-xs text-sidebar-muted",children:t.repositoryName}),i&&(0,r.jsx)(S.A,{"data-testid":"sidebar-attention-hidden-repository",className:"h-3.5 w-3.5 flex-shrink-0 text-sidebar-muted","aria-label":l("sidebar.hiddenRepository"),role:"img"})]})},e.id)})}),(0,r.jsx)(x,{href:I.ks,"data-testid":"sidebar-needs-attention-review-link",onClick:i,className:"mt-0.5 flex min-w-0 items-center rounded-md px-2 py-1 text-xs text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,r.jsx)("span",{className:"min-w-0 truncate",children:c>0?l("sidebar.attentionMoreInReview",{count:c}):l("sidebar.openInReview")})})]})}),M=(0,a.memo)(function(e){let{branches:t,selectedWorktreeId:n,onBranchClick:s,forceExpanded:i}=e,l=(0,f.c)("common"),[o,d]=(0,a.useState)(!1),c=i||o;return(0,r.jsxs)("div",{"data-testid":"branch-group-other",children:[(0,r.jsx)("div",{className:N.R8,children:(0,r.jsxs)("button",{type:"button","data-testid":"branch-group-other-toggle","aria-expanded":c,disabled:i,onClick:()=>d(e=>!e),className:"flex h-[30px] w-full min-w-0 items-center gap-2 rounded-[10px] px-3 text-left text-xs text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring disabled:cursor-default disabled:hover:bg-transparent",children:[(0,r.jsx)("svg",{className:"h-3 w-3 flex-shrink-0 transition-transform ".concat(c?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,"aria-hidden":"true",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),(0,r.jsx)("span",{className:"min-w-0 truncate",children:l("sidebar.otherBranches",{count:t.length})})]})}),c&&t.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===n,onClick:()=>s(e.id),showRepositoryName:!1},e.id))]})});var E=n(48407),L=n(73464),P=n(26232),B=n(7636),K=n(87531);let R=[{mode:"grouped",labelKey:"sidebar.viewMode.grouped"},{mode:"flat",labelKey:"sidebar.viewMode.flat"},{mode:"sessions",labelKey:"sidebar.viewMode.sessions"}],O=[{key:"updatedAt",labelKey:"sort.updatedAt"},{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"branchName",labelKey:"sort.branchName"},{key:"status",labelKey:"sort.status"}],D={updatedAt:"desc"},F={updatedAt:{asc:"sort.direction.oldestFirst",desc:"sort.direction.newestFirst"},repositoryName:{asc:"sort.direction.aToZ",desc:"sort.direction.zToA"},branchName:{asc:"sort.direction.aToZ",desc:"sort.direction.zToA"},status:{asc:"sort.direction.attentionFirst",desc:"sort.direction.attentionLast"}},W={asc:"sort.ascending",desc:"sort.descending"};function z(e){var t;return null!=(t=D[e])?t:"asc"}function _(e){e.preventDefault()}let H=(0,a.memo)(function(e){var t,n,s,l;let{viewMode:o,onViewModeChange:d}=e,c=(0,f.c)("common"),{sortKey:u,sortDirection:m,setSortKey:h,setSortDirection:x}=(0,i.VF)(),p=(0,a.useId)(),b=(0,a.useId)(),g=(0,a.useMemo)(()=>{var e;let t=null!=(e=F[u])?e:W;return e=>c(t[e])},[u,c]),v=c(null!=(s=null==(t=R.find(e=>e.mode===o))?void 0:t.labelKey)?s:"sidebar.viewMode.grouped"),w=c(null!=(l=null==(n=O.find(e=>e.key===u))?void 0:n.labelKey)?l:"sort.".concat(u)),j=c("sidebar.listOptionsSummary",{view:v,sort:w,direction:g(m)}),y=o===i.e8&&u===i.P0&&m===i.RA,k=z(u);return(0,r.jsxs)(P.rI,{children:[(0,r.jsx)(P.ty,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-list-options","data-view-mode":o,"data-sort-key":u,"data-sort-direction":m,"aria-label":c("sidebar.listOptionsLabel",{summary:j}),title:j,className:"relative flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-sidebar-hover data-[state=open]:text-sidebar-foreground",children:[(0,r.jsx)(L.A,{className:"h-4 w-4","aria-hidden":"true"}),!y&&(0,r.jsx)("span",{"data-testid":"sidebar-list-options-indicator","aria-hidden":"true",className:"absolute right-1 top-1 h-1.5 w-1.5 rounded-full bg-accent-500"})]})}),(0,r.jsxs)(P.SQ,{"data-testid":"sidebar-list-options-menu",align:"end",collisionPadding:8,className:(0,K.cn)("w-52 max-w-[calc(100vw-16px)]","max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto"),children:[(0,r.jsx)(P.lp,{id:p,children:c("sidebar.viewLabel")}),(0,r.jsx)(P.Hr,{"data-testid":"view-mode-options","aria-labelledby":p,value:o,onValueChange:e=>{(0,B.$m)(e)&&e!==o&&d(e)},children:R.map(e=>{let{mode:t,labelKey:n}=e;return(0,r.jsx)(P.Ht,{value:t,onSelect:_,children:c(n)},t)})}),(0,r.jsx)(P.mB,{}),(0,r.jsx)(P.lp,{id:b,children:c("sort.label")}),(0,r.jsx)(P.Hr,{"data-testid":"sort-key-options","aria-labelledby":b,value:u,onValueChange:e=>{let t=O.find(t=>t.key===e);t&&t.key!==u&&(h(t.key),x(z(t.key)))},children:O.map(e=>{let{key:t,labelKey:n}=e;return(0,r.jsx)(P.Ht,{value:t,onSelect:_,children:c(n)},t)})}),(0,r.jsx)(P.mB,{}),(0,r.jsx)(P.Hr,{"data-testid":"sort-direction-options","aria-label":c("sort.directionLabel"),value:m,onValueChange:e=>{("asc"===e||"desc"===e)&&x(e)},children:("asc"===k?["asc","desc"]:["desc","asc"]).map(e=>(0,r.jsx)(P.Ht,{value:e,onSelect:_,children:g(e)},e))})]})]})}),V=(0,a.memo)(function(e){let{searchQuery:t,onSearchChange:n,viewMode:s,onViewModeChange:a}=e,i=(0,f.c)("common");return(0,r.jsxs)("div",{"data-testid":"sidebar-list-toolbar",className:"flex flex-shrink-0 items-center gap-1 px-3 pt-2 pb-1.5",children:[(0,r.jsx)(E.pd,{type:"text",inputSize:"sm",placeholder:i("sidebar.searchBranches"),"aria-label":i("sidebar.searchBranches"),value:t,onChange:e=>n(e.target.value),className:"min-w-0 flex-1 border-sidebar-border bg-background shadow-none"}),(0,r.jsx)(H,{viewMode:s,onViewModeChange:a})]})});var Y=n(41898),U=n(30061),q=n(5379),G=n(65380),X=n(45195),J=n(40823),Z=n(68704),$=n(26020);async function Q(){try{await fetch("/api/auth/logout",{method:"POST"}),window.location.href="/login"}catch(e){window.location.href="/login"}}let ee=P.ty;function et(){let e=(0,f.c)("common"),{size:t,setSize:n}=(0,c.Ps)(),s=(0,i.pT)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P.mB,{}),(0,r.jsx)(P.lp,{children:e("displaySize.ariaLabel")}),(0,r.jsx)(P.Hr,{value:t,onValueChange:e=>{(0,Z.fM)(e)&&n(e)},children:Z.Uf.map(t=>(0,r.jsx)(P.Ht,{value:t,children:e("displaySize.".concat(t))},t))}),s&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(P.lp,{children:e("repoTabBar.settingLabel")}),(0,r.jsx)(P.Hr,{value:s.repoTabBarMode,onValueChange:e=>{(0,B.m3)(e)&&s.setRepoTabBarMode(e)},children:B.EN.map(t=>(0,r.jsx)(P.Ht,{value:t,children:e("repoTabBar.mode.".concat(t))},t))})]})]})}function en(e){let{children:t,testIdPrefix:n,side:s="top",align:i="end",showDisplayPreferences:o=!1,onNavigate:d}=e,c=(0,f.c)("worktree"),u=(0,h.Hq)(),{theme:m,setTheme:x}=(0,q.D)(),{currentLocale:p,switchLocale:b}=(0,X.g)(),g=(0,G.H)(),v=(0,l.a)(),{open:w}=(0,J.V0)(),j=(0,a.useRef)(!1),y=(0,a.useRef)(null),k="0.46.1",N=e=>{null==d||d(),u.push(e)};return(0,r.jsxs)(P.rI,{children:[t,(0,r.jsxs)(P.SQ,{side:s,align:i,collisionPadding:8,className:"w-56 max-w-[calc(100vw-16px)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto",onCloseAutoFocus:()=>{j.current&&(j.current=!1,queueMicrotask(w))},children:[(0,r.jsx)(P.lp,{"data-testid":"".concat(n,"-version"),children:c("activityBar.settingsMenu.version",{version:k?"v".concat(k):"-"})}),(0,r.jsx)(P._2,{asChild:!0,onSelect:()=>{let e=y.current;if(y.current=null,!(e&&(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey))){if(null==e||e.preventDefault(),v)return void N("/more");j.current=!0}},children:(0,r.jsx)("a",{href:"/more","data-testid":"".concat(n,"-settings"),onClick:e=>{y.current=e},children:c("activityBar.settingsMenu.settings")})}),(0,r.jsx)(P._2,{onSelect:()=>N("/skills"),children:c("activityBar.settingsMenu.skills")}),(0,r.jsx)(P.mB,{}),(0,r.jsx)(P.lp,{children:c("activityBar.settingsMenu.theme")}),(0,r.jsxs)(P.Hr,{value:null!=m?m:"system",onValueChange:e=>x(e),children:[(0,r.jsx)(P.Ht,{value:"light",children:c("activityBar.settingsMenu.themeLight")}),(0,r.jsx)(P.Ht,{value:"dark",children:c("activityBar.settingsMenu.themeDark")}),(0,r.jsx)(P.Ht,{value:"system",children:c("activityBar.settingsMenu.themeSystem")})]}),(0,r.jsx)(P.lp,{children:c("activityBar.settingsMenu.language")}),(0,r.jsx)(P.Hr,{value:p,onValueChange:e=>b(e),children:$.dI.map(e=>(0,r.jsx)(P.Ht,{value:e,children:$.vK[e]},e))}),o&&!v&&(0,r.jsx)(et,{}),(0,r.jsx)(P.mB,{}),(0,r.jsx)(P._2,{asChild:!0,children:(0,r.jsx)("a",{href:"https://github.com/kewton/MyCodeBranchDesk",target:"_blank",rel:"noopener noreferrer",children:c("activityBar.settingsMenu.github")})}),g&&(0,r.jsx)(P._2,{onSelect:()=>{Q()},children:c("activityBar.settingsMenu.logout")})]})]})}var er=n(59847),es=n(11010),ea=n(86651),ei=n(79651),el=n(92614),eo=n(51743);let ed=["global","terminal","composer","editor"],ec=[{id:"commandPalette",keys:["MOD","K"],scope:"global"},{id:"toggleSidebar",keys:["MOD","B"],scope:"global"},{id:"keyboardHelp",keys:["?"],scope:"global"},{id:"closeOverlay",keys:["Esc"],scope:"global"},{id:"navigateList",keys:["↑","↓"],scope:"global"},{id:"terminalSearch",keys:["MOD","F"],scope:"terminal"},{id:"toggleSurfaceMode",keys:["MOD","Shift","M"],scope:"terminal"},{id:"sendMessage",keys:["↵"],scope:"composer"},{id:"composerNewline",keys:["Shift","↵"],scope:"composer"},{id:"editorIndent",keys:["Tab"],scope:"editor"},{id:"editorOutdent",keys:["Shift","Tab"],scope:"editor"},{id:"editorTabFocus",keys:["Ctrl","M"],scope:"editor"},{id:"editorSave",keys:["MOD","S"],scope:"editor"},{id:"editorFullscreen",keys:["MOD","Shift","F"],scope:"editor"}];function eu(){if("undefined"==typeof navigator)return!1;let e=navigator.platform||navigator.userAgent||"";return/Mac|iPhone|iPad|iPod/.test(e)}function em(e,t){return"MOD"===e?t?"⌘":"Ctrl":e}var eh=n(26550),ex=n(78845),ef=n(65229);let ep="flex items-center justify-center rounded-md text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",eb={width:"".concat(B.KI,"px"),height:"".concat(B.KI,"px")};function eg(e){let{testId:t,onClose:n}=e,s=(0,f.c)("common"),{isOpen:a,toggle:l}=(0,i.VF)(),o=s(a?"sidebar.close":"sidebar.open"),d=a?eh.A:ex.A;return(0,r.jsx)("div",{"data-sidebar-toggle-cell":"",className:"flex flex-shrink-0",style:{padding:"".concat(B.df,"px")},children:n?(0,r.jsx)("button",{type:"button","data-testid":t,onClick:n,"aria-label":s("sidebar.close"),style:eb,className:ep,children:(0,r.jsx)(ef.A,{size:20,"aria-hidden":"true"})}):(0,r.jsx)(Y.m_,{content:o,placement:a?"bottom":"right",children:(0,r.jsx)("button",{type:"button","data-testid":t,onClick:l,"aria-label":o,"aria-expanded":a,style:eb,className:ep,children:(0,r.jsx)(d,{size:20,"aria-hidden":"true"})})})})}let ev="flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-sidebar-muted transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring";function ew(e){let{drawer:t=!1}=e,n=(0,f.c)("common"),s=(0,f.c)("commandPalette"),{setOpen:l}=(0,el.C)(),{openNewTask:o}=(0,eo.hX)(),{closeMobileDrawer:d}=(0,i.VF)(),c=function(){let[e,t]=a.useState(null);return a.useEffect(()=>{t(eu()?"⌘":"Ctrl")},[]),e}(),u=t?d:void 0;return(0,r.jsxs)("div",{"data-testid":t?"sidebar-drawer-top-controls":"sidebar-top-controls",className:"flex-shrink-0",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center",children:[t?(0,r.jsx)(eg,{testId:"sidebar-drawer-close",onClose:d}):(0,r.jsx)(eg,{testId:"sidebar-panel-toggle"}),(0,r.jsxs)(x,{href:"/",onClick:u,"data-testid":"sidebar-logo",className:"flex min-w-0 items-center gap-2 rounded-md px-1 py-1 transition-opacity hover:opacity-80 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,r.jsx)("span",{className:"flex h-6 w-6 flex-shrink-0 items-center justify-center rounded-md bg-accent-600",children:(0,r.jsx)(er.A,{size:14,strokeWidth:2,className:"text-white","aria-hidden":"true"})}),(0,r.jsx)("span",{className:"truncate text-sm font-bold text-sidebar-foreground",children:"CommandMate"})]})]}),(0,r.jsxs)("div",{className:"space-y-0.5 px-2",children:[(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-new-task",onClick:()=>{null==u||u(),o()},"aria-haspopup":"dialog",className:ev,children:[(0,r.jsx)(es.A,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:n("newTask.title")})]}),(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-search",onClick:()=>{null==u||u(),l(!0)},"aria-label":s("mobileTrigger"),className:ev,children:[(0,r.jsx)(ea.A,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s("searchAction")}),!t&&null!==c&&(0,r.jsxs)("span",{className:"flex flex-shrink-0 items-center gap-0.5","aria-hidden":"true",children:[(0,r.jsx)(ei.u,{children:c}),(0,r.jsx)(ei.u,{children:"K"})]})]})]})]})}var ej=n(94442),ey=n(24373),ek=n(80344),eN=n(98873);let eC="mcbd-sidebar-group-collapsed",eS="mcbd-sidebar-scroll-top",eI=0,eT=(0,a.memo)(function(){var e,t,n;let o=(0,h.Hq)(),{worktrees:d,repositories:c,selectedWorktreeId:u,selectWorktree:m,refreshWorktrees:x,isLoading:v,error:y}=(0,k.$f)(),{closeMobileDrawer:C,sortKey:S,sortDirection:M,viewMode:L,setViewMode:P,repositoryOrder:K,setRepositoryOrder:R}=(0,i.VF)(),O=(0,f.c)("common"),D=null!=(e=(0,s.usePathname)())?e:"",F=(0,B.jn)(D,u),W=(0,l.a)(),{count:z}=(0,ey.Lv)(),[_,H]=(0,a.useState)(""),Y=(0,a.useRef)(null),[U,q]=(0,a.useState)(()=>{try{let e=localStorage.getItem(eC);return e?function(e){try{let t=JSON.parse(e);if("object"!=typeof t||null===t||Array.isArray(t))return{};let n={},r=0;for(let[e,s]of Object.entries(t))if(!eE.has(e)&&"boolean"==typeof s){if(++r>100)break;n[e]=s}return n}catch(e){return{}}}(e):{}}catch(e){return{}}}),G=(0,a.useRef)(!1);(0,a.useEffect)(()=>{G.current||(G.current=!0,fetch("/api/sidebar/group-order").then(e=>e.json()).then(e=>{e.success&&Array.isArray(e.order)&&R(e.order)}).catch(()=>{}))},[R]);let X=(0,a.useMemo)(()=>(0,B.UZ)(c),[c]),J=(0,a.useMemo)(()=>(0,B.s6)(d,X),[d,X]),Z=(0,a.useMemo)(()=>(0,ey.Rc)(d),[d]),$=(0,a.useMemo)(()=>new Set(J.map(e=>e.id)),[J]),Q=(0,a.useMemo)(()=>J.map(T.XK),[J]),ee=(0,a.useMemo)(()=>new Map(Q.map(e=>[e.id,e])),[Q]),et=(0,a.useDeferredValue)(Q),en=(0,a.useRef)(null),er=(0,a.useRef)(null),es=(0,a.useRef)(null),ea=(0,a.useRef)(new Set),[ei,el]=(0,a.useState)(0);(0,a.useEffect)(()=>()=>{null!==er.current&&clearTimeout(er.current)},[]);let eo=(0,a.useCallback)(()=>{null!==er.current&&(clearTimeout(er.current),er.current=null),en.current=null,es.current=null},[]),ed=(0,a.useMemo)(()=>{let e=en.current;return!e||0===e.items.length||Date.now()>=e.expiresAt?et:e.items},[et,ei]),ec=(0,a.useRef)(ed),eu=es.current,em=new Set(ed.filter(e=>(null==eu?void 0:eu.has(e.id))===!0||(0,B.rL)(e,F,ee)).map(e=>e.id));(0,a.useLayoutEffect)(()=>{if(ec.current=ed,ea.current=em,es.current)for(let e of em)es.current.add(e);let e=en.current;e&&0===e.items.length&&et.length>0&&eo()});let eh=(0,a.useCallback)(()=>{if(0===ec.current.length)return;null!==er.current&&(clearTimeout(er.current),er.current=null);let e=en.current;if(e&&Date.now()<e.expiresAt){en.current={...e,expiresAt:1/0};return}en.current={items:ec.current,expiresAt:1/0},es.current=new Set(ea.current)},[]),ex=(0,a.useCallback)(()=>{en.current&&(en.current={...en.current,expiresAt:Date.now()+1e3},null!==er.current&&clearTimeout(er.current),er.current=setTimeout(()=>{eo(),el(e=>e+1)},1e3))},[eo]),{sortedItems:ef,groupedItems:ep}=(0,eN.D)({items:ed,sortKey:S,sortDirection:M,viewMode:L,filterText:_}),eb=(0,a.useMemo)(()=>"grouped"===L&&ep?_.trim()?ep:(0,B.Ew)(ep,K):null,[L,ep,K,_]),eg="grouped"===L?eb:null,ev=(0,a.useMemo)(()=>"sessions"===L?(0,B.EY)((0,B.UB)(ef),S,M):[],[L,ef,S,M]);(0,a.useEffect)(()=>{try{localStorage.setItem(eC,JSON.stringify(U))}catch(e){}},[U]);let ej=(0,a.useCallback)(e=>{q(t=>({...t,[e]:!t[e]}))},[]),ek=(0,a.useCallback)(()=>{var e,t,n=null!=(t=null==(e=Y.current)?void 0:e.scrollTop)?t:0;let r=Number.isFinite(n)&&n>0?n:0;eI=r;try{localStorage.setItem(eS,String(r))}catch(e){}},[]),eT=ef.length>0||(null!=(t=null==eg?void 0:eg.length)?t:0)>0||ev.length>0;(0,a.useEffect)(()=>{let e=Y.current;if(!e)return;let t=window.requestAnimationFrame(()=>{e.scrollTop=function(){try{let e=localStorage.getItem(eS);if(!e)return eI=0,0;let t=Number(e);Number.isFinite(t)&&t>=0&&(eI=t)}catch(e){}return eI}()});return()=>{window.cancelAnimationFrame(t)}},[eT,L]);let eL=(0,a.useCallback)(e=>{ek(),m(e),o.push("/worktrees/".concat(e)),C()},[ek,m,o,C]),eK=(0,a.useCallback)(e=>{ek(),m(e.worktreeId),o.push((0,B.Ii)(e)),C()},[ek,m,o,C]),eR=(0,w.FR)((0,w.MS)(w.AN,{activationConstraint:{distance:8}})),eO=(0,a.useCallback)(e=>{let{active:t,over:n}=e;if(!n||t.id===n.id||!eg)return;let r=eg.map(e=>e.repositoryName),s=r.indexOf(String(t.id)),a=r.indexOf(String(n.id));if(-1===s||-1===a)return;let i=(0,j.be)(r,s,a);R(i),fetch("/api/sidebar/group-order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({order:i})}).catch(()=>{R(r)})},[eg,R]),eW="grouped"===L?(null!=(n=null==eg?void 0:eg.length)?n:0)===0:"sessions"===L?0===ev.length:0===ef.length,ez=v&&0===d.length,e_=!ez&&!!y&&0===d.length,eH=(0,a.useCallback)(()=>{x()},[x]),eV={sessions:(0,r.jsx)("li",{className:"flex min-w-0",children:(0,r.jsx)(eP,{href:"/sessions",icon:p.A,label:O("nav.sessions"),testId:"sidebar-nav-sessions",isActive:D.startsWith("/sessions"),onNavigate:C})}),repositories:(0,r.jsxs)("li",{className:"flex min-w-0 items-center gap-1",children:[(0,r.jsx)(eP,{href:"/repositories",icon:b.A,label:O("nav.repositories"),testId:"sidebar-nav-repositories",isActive:D.startsWith("/repositories"),onNavigate:C}),(0,r.jsx)(eD,{refreshWorktrees:x})]}),review:(0,r.jsx)("li",{className:"flex min-w-0",children:(0,r.jsx)(eP,{href:z>0?I.ks:"/review",icon:g.A,label:O("nav.review"),testId:"sidebar-nav-review",isActive:D.startsWith("/review"),onNavigate:C,trailing:z>0?(0,r.jsx)("span",{"data-testid":"sidebar-nav-review-count",role:"status","aria-label":O("attention.badgeLabel",{count:z}),className:"flex-shrink-0 rounded-full bg-warning-subtle px-1.5 text-xs font-semibold leading-5 tabular-nums text-warning-foreground",children:z>99?"99+":z}):null})})};return(0,r.jsx)(N.Fy.Provider,{value:!W,children:(0,r.jsxs)("nav",{"data-testid":"sidebar","aria-label":O("sidebar.branchNavigation"),className:"h-full flex flex-col bg-sidebar text-sidebar-foreground",role:"navigation",children:[(0,r.jsx)(ew,{drawer:W}),(0,r.jsx)("div",{"data-testid":"sidebar-header",className:"flex-shrink-0 space-y-2 border-b border-sidebar-border px-2 py-2",children:(0,r.jsx)("ul",{"data-testid":"sidebar-nav",className:"space-y-0.5",children:B.go.map(e=>(0,r.jsx)(a.Fragment,{children:eV[e]},e))})}),(0,r.jsx)(A,{worktrees:Z,visibleWorktreeIds:$,selectedWorktreeId:F,onSelect:eL,onNavigate:C}),(0,r.jsx)(V,{searchQuery:_,onSearchChange:H,viewMode:L,onViewModeChange:P}),(0,r.jsx)("div",{ref:Y,"data-testid":"branch-list",onScroll:ek,onMouseEnter:eh,onMouseLeave:ex,className:"flex-1 overflow-y-auto overflow-x-hidden",children:ez?(0,r.jsx)(eA,{label:O("sidebar.loadingBranches")}):e_?(0,r.jsxs)("div",{"data-testid":"branch-list-error",role:"alert",className:"px-4 py-8 text-center text-sidebar-muted",children:[(0,r.jsx)("p",{className:"text-sm",children:O("sidebar.branchesLoadFailed")}),(0,r.jsx)(E.$n,{type:"button",variant:"secondary",size:"sm",className:"mt-3","data-testid":"branch-list-retry",onClick:eH,children:O("sidebar.retryLoadBranches")})]}):eW?(0,r.jsx)("div",{className:"px-4 py-8 text-center text-sidebar-muted",children:O(_?"sidebar.noBranchesFound":"sidebar.noBranchesAvailable")}):"sessions"===L?ev.map(e=>(0,r.jsx)(eB,{row:e,isSelected:e.worktreeId===F,onClick:eK},e.key)):"grouped"===L&&eg?(0,r.jsx)(w.Mp,{sensors:eR,collisionDetection:w.fp,onDragEnd:eO,children:(0,r.jsx)(j.gB,{items:eg.map(e=>e.repositoryName),strategy:j._G,children:eg.map(e=>{let t=!U[e.repositoryName]||!!_.trim();return(0,r.jsx)(eM,{group:e,isExpanded:t,selectedWorktreeId:F,onToggle:()=>ej(e.repositoryName),onBranchClick:eL,isDragDisabled:!!_.trim(),isFiltering:!!_.trim(),liveBranchById:ee,stickyShownIds:eu},e.repositoryName)})})}):ef.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===F,onClick:()=>eL(e.id)},e.id))}),(0,r.jsx)("div",{"data-testid":"sidebar-footer",className:"flex-shrink-0 px-4 py-3 border-t border-sidebar-border",children:(0,r.jsx)(eF,{onNavigate:C})})]})})}),eA=(0,a.memo)(function(e){let{label:t}=e;return(0,r.jsxs)("div",{"data-testid":"branch-list-skeleton",role:"status","aria-live":"polite",className:"px-4 py-3 space-y-3",children:[(0,r.jsx)("span",{className:"sr-only",children:t}),[0,1,2,3,4].map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(E.EA,{className:"h-2 w-2 rounded-full"}),(0,r.jsx)(E.EA,{className:"h-3 flex-1"})]},e))]})});function eM(e){let{group:t,isExpanded:n,selectedWorktreeId:s,onToggle:a,onBranchClick:i,isDragDisabled:l,isFiltering:o,liveBranchById:d,stickyShownIds:c}=e,{attributes:u,listeners:m,setNodeRef:h,setActivatorNodeRef:x,transform:f,transition:p,isDragging:b}=(0,j.gl)({id:t.repositoryName,disabled:l}),g={transform:y.Ks.Transform.toString(f),transition:p,opacity:b?.5:1},{shown:v,other:w}=(0,B.FS)(t.branches,s,d,null!=c?c:void 0);return(0,r.jsxs)("div",{ref:h,style:g,className:"w-full min-w-0 pt-2",children:[(0,r.jsx)(eL,{repositoryName:t.repositoryName,branchCount:t.branches.length,isExpanded:n,onClick:a,dragHandleRef:x,dragHandleListeners:l?void 0:m,dragHandleAttributes:l?void 0:u}),n&&v.map(e=>(0,r.jsx)(N.yP,{branch:e,isSelected:e.id===s,onClick:()=>i(e.id),showRepositoryName:!1},e.id)),n&&w.length>0&&(0,r.jsx)(M,{branches:w,selectedWorktreeId:s,onBranchClick:i,forceExpanded:o})]})}let eE=new Set(["__proto__","constructor","prototype"]);function eL(e){let{repositoryName:t,branchCount:n,isExpanded:s,onClick:a,dragHandleRef:i,dragHandleListeners:l,dragHandleAttributes:o}=e,d=(0,f.c)("common");return(0,r.jsxs)("div",{className:"group/header flex items-center w-full",children:[l&&(0,r.jsx)("div",{ref:i,...l,...o,"data-testid":"group-drag-handle","aria-label":d("sidebar.dragToReorderGroup"),className:" flex-shrink-0 flex items-center justify-center w-6 h-full pl-2 cursor-grab active:cursor-grabbing text-sidebar-muted hover:text-sidebar-foreground transition-[color,opacity] opacity-0 group-hover/header:opacity-100 group-focus-within/header:opacity-100 [@media(hover:none)]:opacity-100 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ",children:(0,r.jsx)(eR,{})}),(0,r.jsxs)("button",{"data-testid":"group-header",type:"button",onClick:a,"aria-expanded":s,className:" flex-1 min-w-0 flex items-center gap-2 px-2 py-1 text-xs font-normal text-sidebar-muted focus:outline-none focus:ring-2 focus:ring-inset focus:ring-ring transition-colors ",children:[(0,r.jsx)(eK,{isExpanded:s}),(0,r.jsx)(E.nF,{color:(0,B.LV)(t)}),(0,r.jsx)(U.nR,{content:t,className:"flex-1 min-w-0 text-left truncate",children:t}),(0,r.jsx)("span",{className:"text-sidebar-muted font-normal tabular-nums pr-2",children:n})]})]})}function eP(e){let{href:t,icon:n,label:s,testId:a,isActive:i,onNavigate:l,trailing:o}=e;return(0,r.jsxs)(x,{href:t,"data-testid":a,"aria-current":i?"page":void 0,onClick:l,className:"flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-hover hover:text-sidebar-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(i?"bg-sidebar-hover font-medium text-sidebar-foreground":"text-sidebar-muted"),children:[(0,r.jsx)(n,{className:"h-4 w-4 flex-shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate",children:s}),o]})}let eB=(0,a.memo)(function(e){let{row:t,isSelected:n,onClick:s}=e,a=(0,f.c)("common"),i=(0,C.Mq)(t.status,t.unclassified),l=a(i?C.rH:"status.".concat(t.status));return(0,r.jsx)("div",{className:"w-full min-w-0 ".concat(N.R8),children:(0,r.jsxs)("button",{type:"button","data-testid":"session-list-item","data-session-key":t.key,onClick:()=>s(t),"aria-current":n?"true":void 0,className:"w-full min-w-0 min-h-[34px] px-3 py-1.5 flex items-center gap-2 text-left ".concat((0,N.Xd)(n)),children:[(0,r.jsx)(E.md,{status:t.status,size:"sm",label:t.exited?"".concat(l," (").concat(a("branchItem.agentExited"),")"):l,className:i?C.Jd:void 0}),(0,r.jsx)("span",{className:"flex-shrink-0 max-w-[45%] truncate text-sm font-semibold text-sidebar-foreground",children:t.label}),(0,r.jsxs)("span",{className:"min-w-0 flex-1 truncate text-xs text-sidebar-muted",children:[t.branchName," \xb7 ",t.repositoryName]})]})})});function eK(e){let{isExpanded:t}=e;return(0,r.jsx)("svg",{className:"w-3 h-3 flex-shrink-0 transition-transform ".concat(t?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})}function eR(){return(0,r.jsxs)("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("circle",{cx:"9",cy:"5",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"5",r:"1.5"}),(0,r.jsx)("circle",{cx:"9",cy:"12",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"12",r:"1.5"}),(0,r.jsx)("circle",{cx:"9",cy:"19",r:"1.5"}),(0,r.jsx)("circle",{cx:"15",cy:"19",r:"1.5"})]})}function eO(e){let{className:t=""}=e;return(0,r.jsx)("svg",{className:"".concat("w-4 h-4"," ").concat(t),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h5M20 20v-5h-5M20.49 9A9 9 0 005.64 5.64L4 4m16 16l-1.64-1.64A9 9 0 014.51 15"})})}let eD=(0,a.memo)(function(e){let{refreshWorktrees:t}=e,[n,s]=(0,a.useState)(!1),i=(0,a.useRef)(!1),{showToast:l}=(0,ej.dj)(),o=(0,f.c)("common"),d=(0,a.useCallback)(async()=>{if(!i.current){i.current=!0,s(!0);try{let e=await ek.Rx.sync();await t(),l(o("syncSuccess",{count:e.worktreeCount}),"success",3e3)}catch(e){e instanceof ek.hD&&401===e.status?l(o("syncAuthError"),"error",5e3):l(o("syncError"),"error",5e3)}finally{i.current=!1,s(!1)}}},[t,l,o]);return(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Y.m_,{content:o("tooltips.sync"),placement:"bottom",children:(0,r.jsx)("button",{type:"button",onClick:d,disabled:n,"aria-label":o("syncButtonLabel"),className:"p-1 rounded-md text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:(0,r.jsx)(eO,{className:n?"animate-spin":""})})})})});function eF(e){let{onNavigate:t}=e,n=(0,f.c)("common")("settings.title");return(0,r.jsx)(en,{testIdPrefix:"sidebar-settings-menu",side:"top",align:"start",showDisplayPreferences:!0,onNavigate:t,children:(0,r.jsx)(ee,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","data-testid":"sidebar-settings-menu",className:"flex w-full items-center gap-2 px-2 py-1.5 rounded-md text-sm text-sidebar-muted hover:text-sidebar-foreground hover:bg-sidebar-hover focus:outline-none focus:ring-2 focus:ring-ring transition-colors",children:[(0,r.jsx)(v.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"truncate",children:n})]})})})}var eW=n(52407);function ez(){let{shouldSurface:e,isReconnecting:t}=(0,eW.Fx)(),n=(0,f.c)("common");if(!e)return null;let s=n(t?"connection.reconnecting":"connection.offline");return(0,r.jsxs)("span",{"data-testid":"connection-status-indicator","data-connection-state":t?"reconnecting":"offline",role:"status","aria-live":"polite",title:n(t?"connection.reconnectingTooltip":"connection.offlineTooltip"),className:"hidden sm:inline-flex items-center gap-1.5 rounded-full border border-border bg-surface px-2 py-0.5 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:["w-1.5 h-1.5 rounded-full",t?"bg-warning motion-safe:animate-pulse":"bg-muted-foreground"].join(" ")}),s]})}var e_=n(72137);let eH=[{prefix:"/sessions",labelKey:"nav.sessions"},{prefix:"/repositories",labelKey:"nav.repositories"},{prefix:"/review",labelKey:"nav.review"},{prefix:"/skills",labelKey:"nav.skills"},{prefix:"/more",labelKey:"nav.more"}];function eV(e){var t,n,a,i;let{title:l="CommandMate"}=e,o=null!==(n=null!=(t=(0,s.usePathname)())?t:"",null!=(i=null==(a=eH.find(e=>n.startsWith(e.prefix)))?void 0:a.labelKey)?i:null);return(0,r.jsxs)("header",{"data-testid":"screen-status-row",className:"flex flex-shrink-0 items-center justify-end gap-4 px-4 py-1.5 border-b border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md empty:hidden",children:[!o&&(0,r.jsx)("h1",{"data-testid":"header-screen-title",className:"mr-auto min-w-0 truncate text-lg font-bold text-foreground",children:l}),(0,r.jsx)(ez,{}),(0,r.jsx)(e_.H,{})]})}function eY(e){let{count:t}=e,n=(0,f.c)("common");return 0===t?null:(0,r.jsx)("span",{"data-testid":"attention-badge-bubble",role:"status","aria-label":n("attention.badgeLabel",{count:t}),className:"absolute -top-1.5 -right-2.5 min-w-[1.05rem] rounded-full bg-warning-foreground px-1 text-[0.625rem] font-bold leading-[1.05rem] text-warning-subtle tabular-nums text-center",children:t>99?"99+":t})}let eU="relative flex h-10 w-10 items-center justify-center rounded-md transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",eq="text-sidebar-muted hover:bg-sidebar-hover hover:text-sidebar-foreground";function eG(e){let{href:t,icon:n,label:s,testId:a,isActive:i,badge:l}=e;return(0,r.jsx)(Y.m_,{content:s,placement:"right",children:(0,r.jsx)(x,{href:t,"data-testid":a,"aria-label":s,"aria-current":i?"page":void 0,className:"".concat(eU," ").concat(i?"bg-sidebar-hover text-sidebar-foreground":eq),children:(0,r.jsxs)("span",{className:"relative flex",children:[(0,r.jsx)(n,{size:20,"aria-hidden":"true"}),l]})})})}function eX(e){let{icon:t,label:n,testId:s,onClick:a,hasPopup:i}=e;return(0,r.jsx)(Y.m_,{content:n,placement:"right",children:(0,r.jsx)("button",{type:"button","data-testid":s,"aria-label":n,"aria-haspopup":i,onClick:a,className:"".concat(eU," ").concat(eq),children:(0,r.jsx)(t,{size:20,"aria-hidden":"true"})})})}function eJ(){var e;let t=(0,f.c)("common"),n=(0,f.c)("commandPalette"),i=null!=(e=(0,s.usePathname)())?e:"",{setOpen:l}=(0,el.C)(),{openNewTask:o}=(0,eo.hX)(),{count:d}=(0,ey.Lv)(),c=t("settings.title"),u={sessions:(0,r.jsx)(eG,{href:"/sessions",icon:p.A,label:t("nav.sessions"),testId:"sidebar-rail-sessions",isActive:i.startsWith("/sessions")}),repositories:(0,r.jsx)(eG,{href:"/repositories",icon:b.A,label:t("nav.repositories"),testId:"sidebar-rail-repositories",isActive:i.startsWith("/repositories")}),review:(0,r.jsx)(eG,{href:d>0?I.ks:"/review",icon:g.A,label:t("nav.review"),testId:"sidebar-rail-review",isActive:i.startsWith("/review"),badge:(0,r.jsx)(eY,{count:d})})};return(0,r.jsxs)("nav",{"data-testid":"sidebar-rail","aria-label":t("sidebar.railLabel"),className:"flex h-full flex-col items-center gap-1 bg-sidebar pb-2 text-sidebar-foreground",style:{width:"".concat(B.BN,"px")},children:[(0,r.jsx)(eg,{testId:"sidebar-rail-toggle"}),(0,r.jsx)(eX,{icon:es.A,label:t("newTask.title"),testId:"sidebar-rail-new-task",onClick:()=>o(),hasPopup:"dialog"}),(0,r.jsx)(eX,{icon:ea.A,label:n("mobileTrigger"),testId:"sidebar-rail-search",onClick:()=>l(!0)}),(0,r.jsx)("div",{className:"my-1 w-8 border-b border-sidebar-border","aria-hidden":"true"}),B.go.map(e=>(0,r.jsx)(a.Fragment,{children:u[e]},e)),(0,r.jsx)("div",{className:"mt-auto",children:(0,r.jsx)(en,{testIdPrefix:"sidebar-rail-settings",side:"right",align:"end",showDisplayPreferences:!0,children:(0,r.jsx)(Y.m_,{content:c,placement:"right",children:(0,r.jsx)(ee,{asChild:!0,children:(0,r.jsx)("button",{type:"button","data-testid":"sidebar-rail-settings","aria-label":c,className:"".concat(eU," ").concat(eq),children:(0,r.jsx)(v.A,{size:20,"aria-hidden":"true"})})})})})})]})}var eZ=n(46365),e$=n(12906),eQ=n(37772),e0=n(9540),e1=n(55756);let e2=[{labelKey:"nav.sessions",href:"/sessions",isActive:e=>e.startsWith("/sessions"),icon:(0,r.jsx)(p.A,{size:20,"aria-hidden":"true"})},{labelKey:"nav.review",href:"/review",isActive:e=>e.startsWith("/review"),icon:(0,r.jsx)(g.A,{size:20,"aria-hidden":"true"}),showsAttentionBadge:!0},{labelKey:"nav.more",href:"/more",isActive:e=>e.startsWith("/more"),icon:(0,r.jsx)(eQ.A,{size:20,"aria-hidden":"true"})}];function e5(){let e=(0,s.usePathname)(),{setOpen:t}=(0,el.C)(),n=(0,f.c)("commandPalette"),a=(0,f.c)("common"),{count:l}=(0,ey.Lv)(),o=(0,i.pT)();return(null==o?void 0:o.isMobileDrawerOpen)?null:(0,r.jsx)("nav",{"data-testid":"global-mobile-nav",className:"fixed bottom-0 left-0 right-0 z-50 border-t border-border bg-background supports-[backdrop-filter]:bg-background/80 backdrop-blur-md pb-safe",children:(0,r.jsxs)("div",{className:"flex items-center justify-around h-14",children:[o&&(0,r.jsxs)("button",{type:"button","data-testid":"mobile-nav-open-sidebar",...e1.cv,onClick:o.openMobileDrawer,className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,r.jsx)(e0.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a("sidebar.branches")})]}),e2.map(t=>{let n=t.isActive(e),s=!0===t.showsAttentionBadge&&l>0;return(0,r.jsxs)(x,{href:s?I.ks:t.href,className:"flex flex-col items-center justify-center flex-1 h-full text-xs transition-colors ".concat(n?"text-accent-600 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:[(0,r.jsxs)("span",{className:"relative inline-flex",children:[t.icon,!0===t.showsAttentionBadge&&(0,r.jsx)(eY,{count:l})]}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:a(t.labelKey)})]},t.href)}),(0,r.jsxs)("button",{type:"button","data-testid":"mobile-command-palette-trigger",onClick:()=>t(!0),"aria-label":n("mobileTrigger"),className:"flex flex-col items-center justify-center flex-1 h-full text-xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,r.jsx)(ea.A,{size:20,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mt-1 whitespace-nowrap",children:n("mobileLabel")})]})]})})}function e4(){let{shouldSurface:e,isReconnecting:t}=(0,eW.Fx)(),n=(0,f.c)("common");if(!e)return null;let s=n(t?"connection.reconnecting":"connection.offline"),a=n(t?"connection.reconnectingTooltip":"connection.offlineTooltip");return(0,r.jsx)("div",{"data-testid":"mobile-connection-banner","data-connection-state":t?"reconnecting":"offline",role:"status","aria-live":"polite",title:a,className:"shrink-0 pt-safe border-b ".concat(t?"bg-warning-subtle border-warning-border text-warning-foreground":"bg-danger-subtle border-danger-border text-danger-foreground"),children:(0,r.jsxs)("div",{className:"flex items-center justify-center gap-1.5 px-3 py-1 text-xs",children:[(0,r.jsx)("span",{"aria-hidden":"true",className:"w-1.5 h-1.5 rounded-full ".concat(t?"bg-warning motion-safe:animate-pulse":"bg-danger")}),s]})})}var e3=n(45573),e9=n(94465),e6=n(70628);function e7(e){return!0===e.isComposing||229===e.keyCode}let e8=[...ec,{id:"newTask",keys:["MOD","Shift","O"],scope:"global"},{id:"newTaskSend",keys:["MOD","↵"],scope:"global"}];function te(){let{open:e,setOpen:t}=(0,e6.K)(),{open:n}=(0,el.C)(),{isOpen:s}=(0,eo.hX)(),i=(0,f.c)("keyboardShortcuts"),[l,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>o(eu()),[]);let d=(0,a.useRef)(e);(0,a.useEffect)(()=>{d.current=e},[e]);let c=(0,a.useRef)(n);(0,a.useEffect)(()=>{c.current=n},[n]);let u=(0,a.useRef)(s);(0,a.useEffect)(()=>{u.current=s},[s]),(0,a.useEffect)(()=>{function e(e){"?"!==e.key||e.isComposing||229===e.keyCode||(0,e3.tJ)(e.target)||c.current||u.current||d.current||(e.preventDefault(),t(!0))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]);let m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ec;return ed.map(t=>({scope:t,shortcuts:e.filter(e=>e.scope===t)})).filter(e=>e.shortcuts.length>0)}(e8);return(0,r.jsx)(e9.a,{isOpen:e,onClose:()=>t(!1),title:i("title"),size:"md",children:(0,r.jsx)("div",{"data-testid":"keyboard-shortcuts-overlay",className:"space-y-6",children:m.map(e=>{let{scope:t,shortcuts:n}=e;return(0,r.jsxs)("section",{"data-testid":"keyboard-shortcuts-scope-".concat(t),children:[(0,r.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:i("scopes.".concat(t))}),(0,r.jsx)("ul",{className:"divide-y divide-border",children:n.map(e=>(0,r.jsxs)("li",{"data-testid":"keyboard-shortcut-".concat(e.id),className:"flex items-center justify-between gap-4 py-2",children:[(0,r.jsx)("span",{className:"text-sm text-foreground",children:i("shortcuts.".concat(e.id))}),(0,r.jsx)("span",{className:"flex flex-shrink-0 items-center gap-1",children:e.keys.map((e,t)=>(0,r.jsx)(ei.u,{children:em(e,l)},t))})]},e.id))})]},t)})})})}var tt=n(77016),tn=n(36809),tr=n(31166);let ts=/^v?\d+\.\d+\.\d+$/;function ta(e){return e.replace(/^v/,"").split(".").map(Number)}let ti="commandmate.lastSeenAppVersion";function tl(e){try{window.localStorage.setItem(ti,e)}catch(e){}}let to=[{key:"added",labelKey:"whatsNew.added"},{key:"improved",labelKey:"whatsNew.improved"},{key:"fixed",labelKey:"whatsNew.fixed"}];function td(){let e=(0,f.c)("common"),t=(0,tn.Ym)(),[n,s]=(0,a.useState)(null),[i,l]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e,t="0.46.1";try{e=window.localStorage.getItem(ti)}catch(e){return}let n=function(e,t){if(!ts.test(t))return{kind:"none"};if(null===e||!ts.test(e))return{kind:"remember"};let n=function(e,t){let n=ta(e),r=ta(t),s=Math.max(n.length,r.length);for(let e=0;e<s;e++){let t=n[e]||0,s=r[e]||0;if(t>s)return 1;if(t<s)return -1}return 0}(t,e);return 0===n?{kind:"none"}:n<0?{kind:"remember"}:{kind:"show",from:e}}(e,t);if("none"===n.kind)return;if("remember"===n.kind)return void tl(t);let r=!1;return ek.GQ.getReleaseNotes(n.from,t).then(e=>{r||(s({from:n.from,to:t,notes:e.notes}),l(!0))},()=>{}),()=>{r=!0}},[]);let o=(0,a.useCallback)(()=>{n&&tl(n.to),l(!1)},[n]);if(!n)return null;let d="ja"===t?"ja":"en";return(0,r.jsx)(e9.a,{isOpen:i,onClose:o,title:e("whatsNew.title",{from:n.from,to:n.to}),size:"md",children:(0,r.jsxs)("div",{className:"space-y-4","data-testid":"whats-new-dialog",children:[0===n.notes.length?(0,r.jsx)("p",{className:"text-sm text-foreground","data-testid":"whats-new-empty",children:e("whatsNew.empty")}):n.notes.map(t=>(0,r.jsxs)("section",{className:"space-y-3","data-testid":"whats-new-version-".concat(t.version),children:[(0,r.jsxs)("h4",{className:"text-sm font-semibold text-foreground",children:["v",t.version,(0,r.jsx)("span",{className:"ml-2 text-xs font-normal text-muted-foreground",children:t.date})]}),t.highlight&&(0,r.jsxs)("div",{"data-testid":"whats-new-highlight",children:[(0,r.jsx)("h5",{className:"text-xs font-medium text-muted-foreground",children:e("whatsNew.highlight")}),(0,r.jsx)("p",{className:"mt-1 text-sm text-foreground",children:t.highlight[d]})]}),to.map(n=>{let{key:s,labelKey:a}=n;return t[s].length>0?(0,r.jsxs)("div",{"data-testid":"whats-new-".concat(s),children:[(0,r.jsx)("h5",{className:"text-xs font-medium text-muted-foreground",children:e(a)}),(0,r.jsx)("ul",{className:"mt-1 list-disc space-y-1 pl-5 text-sm text-foreground",children:t[s].map((e,t)=>(0,r.jsx)("li",{children:e[d]},t))})]},s):null})]},t.version)),(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 border-t border-border pt-3",children:[(0,r.jsx)("a",{href:"".concat("https://github.com/Kewton/CommandMate/releases/tag/v").concat(n.to),target:"_blank",rel:"noopener noreferrer",className:"text-sm text-accent-600 dark:text-accent-400 hover:underline","data-testid":"whats-new-release-link",children:e("whatsNew.releaseLink")}),(0,r.jsx)(tr.$,{type:"button",variant:"primary",size:"sm",onClick:o,"data-testid":"whats-new-close",children:e("whatsNew.close")})]})]})})}var tc=n(76351);let tu="commandmate.newTask.recentTargets";function tm(e){if(null===e||"object"!=typeof e)return!1;let{worktreeId:t,instanceId:n}=e;return"string"==typeof t&&""!==t&&"string"==typeof n&&""!==n}function th(e,t){return e.worktreeId===t.worktreeId&&e.instanceId===t.instanceId}function tx(){try{let e=window.localStorage.getItem(tu);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(tm).map(e=>{let{worktreeId:t,instanceId:n}=e;return{worktreeId:t,instanceId:n}}).slice(0,3)}catch(e){return[]}}var tf=n(54014);function tp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=new Map;for(let r of e){let e=n.get(r.repositoryPath);if(!e){let s=t.find(e=>e.path===r.repositoryPath);e={path:r.repositoryPath,name:(null==s?void 0:s.displayName)||(null==s?void 0:s.name)||r.repositoryName,worktrees:[]},n.set(r.repositoryPath,e)}e.worktrees.push(r)}let r=Array.from(n.values());for(let e of r)e.worktrees.sort((e,t)=>e.name.localeCompare(t.name));return r.sort((e,t)=>e.name.localeCompare(t.name))}function tb(e){return e.agentInstances&&e.agentInstances.length>0?e.agentInstances.slice().sort((e,t)=>e.order-t.order):e.selectedAgents&&e.selectedAgents.length>0?(0,tf.lu)(e.selectedAgents):e.cliToolId?(0,tf.lu)([e.cliToolId]):[]}function tg(e,t){let n=e.find(e=>e.id===t.worktreeId);if(!n)return null;let r=tb(n).find(e=>e.id===t.instanceId);return r?{worktree:n,instance:r}:null}function tv(e,t){var n,r,s,a;let i=null!=(a=null==(n=e.sessionStatusByInstance)?void 0:n[t.id])?a:t.id===t.cliTool?null==(r=e.sessionStatusByCli)?void 0:r[t.cliTool]:void 0,l=null==i?void 0:i.startingSince,o=null==(s=e.autoYesByInstance)?void 0:s[t.id];return{instance:t,label:(0,tf.sw)(t),running:(null==i?void 0:i.isRunning)===!0,starting:"number"==typeof l,autoYes:(null==o?void 0:o.enabled)&&"number"==typeof o.expiresAt?o:null}}var tw=n(56936);let tj={promptWaiting:"PROMPT_WAITING",sessionStarting:"SESSION_STARTING",instanceToolConflict:"instance_tool_conflict"};async function ty(e){try{let t=await e.json(),n=t&&"object"==typeof t?t.expiresAt:null;if("number"==typeof n)return{enabled:!0,expiresAt:n}}catch(e){}return null}async function tk(e){try{let t=await e.json();if(t&&"object"==typeof t){let{error:e,code:n}=t;return{error:"string"==typeof e&&""!==e?e:null,code:"string"==typeof n?n:null}}}catch(e){}return{error:null,code:null}}async function tN(e,t){let{modelRequested:n}=t;if(e.ok&&!e.redirected)return{ok:!0};let{status:r}=e,{error:s,code:a}=await tk(e);return{ok:!1,kind:409===r?a===tj.promptWaiting?"prompt_waiting":"conflict":503===r?a===tj.sessionStarting?"starting":"start_failed":400===r?n&&a!==tj.instanceToolConflict?"model_rejected":"invalid":"failed",status:e.ok?0:r,detail:s}}function tC(e){return{ok:!1,kind:"failed",status:0,detail:e instanceof ek.hD||e instanceof Error?e.message:null}}function tS(e,t){return new Promise((n,r)=>{let s=setTimeout(()=>{r(new ek.hD("Request timed out after ".concat(t,"ms"),0,void 0,"timeout"))},t);e().then(e=>{clearTimeout(s),n(e)},e=>{clearTimeout(s),r(e)})})}async function tI(e){var t;let n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ek.E,{target:s,cliToolId:a}=e,i="/api/worktrees/".concat(encodeURIComponent(s.worktreeId)),l={"Content-Type":"application/json"},o=!1,d=e.autoYesDuration;if(null!==d){let e,t=!1;try{e=await tS(async()=>{var e;let c=await r("".concat(i,"/auto-yes"),{method:"POST",headers:l,body:JSON.stringify({enabled:!0,cliToolId:a,instanceId:s.instanceId,duration:d})});if(!c.ok){let{error:e}=await tk(c);return{ok:!1,kind:"auto_yes_failed",status:c.status,detail:e}}return t=!0,n=null!=(e=await ty(c))?e:void 0,o=void 0===n,null},(0,tw.Z3)("POST"))}catch(e){if(!t){let t=tC(e);return t.ok?t:{...t,kind:"auto_yes_failed"}}return{...tC(e),autoYesStateUnknown:!0}}if(e)return e}let c=e=>n?{...e,armedAutoYes:n}:o?{...e,autoYesStateUnknown:!0}:e,u=(null==(t=e.model)?void 0:t.trim())||void 0,m=(0,tw.SE)();try{return c(await tS(async()=>{let t=await r("".concat(i,"/send"),{method:"POST",headers:l,body:JSON.stringify({content:e.content,cliToolId:a,instanceId:s.instanceId,...u?{model:u}:{}}),timeoutMs:m});return tN(t,{modelRequested:void 0!==u})},m))}catch(e){return c(tC(e))}}let tT="w-full 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 disabled:opacity-60",tA="block text-xs font-medium text-muted-foreground mb-1";function tM(){var e,t,n,i,l,o,d,c,u,m;let{requestedTarget:h,screenTarget:x,closeNewTask:p,setCloseLocked:b}=(0,eo.hX)(),g=(0,s.useRouter)(),{showToast:v}=(0,ej.dj)(),w=(0,f.c)("common"),j=(0,f.c)("autoYes"),[y,k]=(0,a.useState)({status:"loading"}),[N,C]=(0,a.useState)(0),[S]=(0,a.useState)(()=>tx()),[I,T]=(0,a.useState)(""),[A,M]=(0,a.useState)(""),[E,L]=(0,a.useState)(""),[P,K]=(0,a.useState)(""),[R,O]=(0,a.useState)(null),[D,F]=(0,a.useState)(!1),[W,z]=(0,a.useState)(null),[_,H]=(0,a.useState)(!1),V=(0,a.useRef)(null),Y=(0,a.useRef)(!0),U=(0,a.useRef)(!1),[q,G]=(0,a.useState)({}),[X,J]=(0,a.useState)({});(0,a.useEffect)(()=>(Y.current=!0,H(eu()),()=>{Y.current=!1,b(!1)}),[b]);let Z=(0,a.useCallback)(()=>{U.current||p()},[p]),$=(0,a.useRef)([h,x,null!=(e=S[0])?e:null]),Q=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=!1;return k({status:"loading"}),ek.y.getAll().then(t=>{var n,r;if(e)return;let s=null!=(n=t.worktrees)?n:[],a=null!=(r=t.repositories)?r:[];if(k({status:"ready",worktrees:s,repositories:a}),Q.current)return;Q.current=!0;let i=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let n of t){if(!n)continue;if(tg(e,n))return n;let t=e.find(e=>e.id===n.worktreeId),r=t?tb(t)[0]:void 0;if(t&&r)return{worktreeId:t.id,instanceId:r.id}}for(let t of tp(e,n))for(let e of t.worktrees){let t=tb(e)[0];if(t)return{worktreeId:e.id,instanceId:t.id}}return null}(s,$.current,a);i&&(T(i.worktreeId),M(i.instanceId))}).catch(()=>{e||k({status:"error"})}),()=>{e=!0}},[N]);let ee=(0,a.useMemo)(()=>"ready"===y.status?y.worktrees:[],[y]),et=(0,a.useMemo)(()=>"ready"===y.status?tp(y.worktrees,y.repositories):[],[y]),en=null!=(t=ee.find(e=>e.id===I))?t:null,er=(0,a.useMemo)(()=>en?tb(en):[],[en]),es=null!=(n=er.find(e=>e.id===A))?n:null,ea=en&&es?tv(en,es):null,el=en&&null!=(i=et.find(e=>e.path===en.repositoryPath))?i:null,ed=ea?(m=ea.instance.cliTool,"copilot"===m?{selectable:!0}:"claude"===m||"antigravity"===m?ea.running||ea.starting?{selectable:!1,reason:"running"}:{selectable:!0}:{selectable:!1,reason:"unsupported"}):null,ec=ea?null!=(l=X["".concat(I,":").concat(ea.instance.id)])?l:ea.autoYes:null,eh=!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return!!e&&e.enabled&&"number"==typeof e.expiresAt&&e.expiresAt-t>0}(ec)?null:ec,ex=!!ea&&!0===q["".concat(I,":").concat(ea.instance.id)],[,ef]=(0,a.useState)(0);(0,a.useEffect)(()=>{if(!eh)return;let e=setInterval(()=>ef(Date.now()),tc.$s);return()=>clearInterval(e)},[eh]),(0,a.useEffect)(()=>{var e;"ready"===y.status&&(null==(e=V.current)||e.focus())},[y.status]);let ep=(0,a.useMemo)(()=>S.flatMap(e=>{var t;let n=tg(ee,e);if(!n)return[];let r=et.find(e=>e.path===n.worktree.repositoryPath),s=tv(n.worktree,n.instance).label;return[{target:e,label:"".concat(null!=(t=null==r?void 0:r.name)?t:n.worktree.repositoryName," / ").concat(n.worktree.name," / ").concat(s)}]}),[S,ee,et]),eb=(0,a.useCallback)(e=>{T(e.worktreeId),M(e.instanceId),z(null)},[]),eg=(0,a.useCallback)(e=>{var t,n,r;let s=et.find(t=>t.path===e),a=null!=(n=null==s?void 0:s.worktrees.find(e=>tb(e).length>0))?n:null==s?void 0:s.worktrees[0];a&&eb({worktreeId:a.id,instanceId:null!=(r=null==(t=tb(a)[0])?void 0:t.id)?r:""})},[et,eb]),ev=(0,a.useCallback)(e=>{var t,n,r;let s=ee.find(t=>t.id===e);if(!s)return;let a=tb(s),i=a.find(e=>e.id===A);eb({worktreeId:s.id,instanceId:null!=(r=null!=(n=null==i?void 0:i.id)?n:null==(t=a[0])?void 0:t.id)?r:""})},[ee,A,eb]),ew=!!ea&&""!==E.trim()&&!D,ey=(0,a.useCallback)(async()=>{if(!ew||!en||!ea)return;let e={worktreeId:en.id,instanceId:ea.instance.id};U.current=!0,b(!0),F(!0),z(null);let t=await tI({target:e,cliToolId:ea.instance.cliTool,content:E.trim(),model:(null==ed?void 0:ed.selectable)?P:void 0,autoYesDuration:eh?null:R});if(U.current=!1,b(!1),!Y.current)return;let{armedAutoYes:n}=t,r="".concat(e.worktreeId,":").concat(e.instanceId);if(t.autoYesStateUnknown&&G(e=>({...e,[r]:!0})),n&&(G(e=>{let{[r]:t,...n}=e;return n}),J(e=>({...e,[r]:n})),O(null)),!t.ok){z(t),F(!1);return}var s=e;let a=[{worktreeId:s.worktreeId,instanceId:s.instanceId},...tx().filter(e=>!th(e,s))].slice(0,3);try{window.localStorage.setItem(tu,JSON.stringify(a))}catch(e){}let i="".concat(window.location.pathname).concat(window.location.search),l="".concat(en.name," / ").concat(ea.label);p(),g.push((0,B.Ii)(e)),v(w("newTask.sentToast",{target:l}),"success",6e3,{onClick:()=>g.push(i)})},[ew,en,ea,E,ed,P,eh,R,p,b,g,v,w]),eN=(0,a.useCallback)(e=>{var t;e7(t=e.nativeEvent)||"Enter"!==t.key||t.shiftKey||t.altKey||!t.metaKey&&!t.ctrlKey||(e.preventDefault(),ey())},[ey]),eC=null!=(o=null==ea?void 0:ea.label)?o:"",eS=ea?ea.starting?"starting":ea.running?"running":"stopped":null;return(0,r.jsx)(e9.a,{isOpen:!0,onClose:Z,title:w("newTask.title"),size:"md",disableClose:D,children:(0,r.jsxs)("div",{"data-testid":"new-task-dialog",className:"space-y-4",onKeyDown:eN,children:["loading"===y.status&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"new-task-loading",children:w("newTask.loading")}),"error"===y.status&&(0,r.jsxs)("div",{className:"space-y-2",role:"alert","data-testid":"new-task-load-error",children:[(0,r.jsx)("p",{className:"text-sm text-danger",children:w("newTask.loadError")}),(0,r.jsx)("button",{type:"button",onClick:()=>C(e=>e+1),className:"px-3 py-1.5 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg",children:w("retry")})]}),"ready"===y.status&&0===et.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"new-task-empty",children:w("newTask.noTargets")}),"ready"===y.status&&et.length>0&&(0,r.jsxs)(r.Fragment,{children:[ep.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:tA,children:w("newTask.recentLabel")}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2","data-testid":"new-task-recents",children:ep.map(e=>{let{target:t,label:n}=e,s=!!ea&&th(t,{worktreeId:I,instanceId:ea.instance.id});return(0,r.jsx)("button",{type:"button","aria-pressed":s,"data-testid":"new-task-recent",onClick:()=>eb(t),className:"max-w-full truncate rounded-full border px-3 py-1 text-xs transition-colors ".concat(s?"border-accent-500 bg-accent-500/15 text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:n},"".concat(t.worktreeId,":").concat(t.instanceId))})})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-repository",className:tA,children:w("newTask.repositoryLabel")}),(0,r.jsx)("select",{id:"new-task-repository","data-testid":"new-task-repository",value:null!=(d=null==el?void 0:el.path)?d:"",onChange:e=>eg(e.target.value),className:tT,children:et.map(e=>(0,r.jsx)("option",{value:e.path,children:e.name},e.path))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-branch",className:tA,children:w("newTask.branchLabel")}),(0,r.jsx)("select",{id:"new-task-branch","data-testid":"new-task-branch",value:I,onChange:e=>ev(e.target.value),className:tT,children:(null!=(c=null==el?void 0:el.worktrees)?c:[]).map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-agent",className:tA,children:w("newTask.agentLabel")}),(0,r.jsx)("select",{id:"new-task-agent","data-testid":"new-task-agent",value:null!=(u=null==es?void 0:es.id)?u:"",onChange:e=>eb({worktreeId:I,instanceId:e.target.value}),className:tT,disabled:0===er.length,children:er.map(e=>{var t;let n=en?tv(en,e):null,s=(null==n?void 0:n.starting)?"starting":(null==n?void 0:n.running)?"running":"stopped";return(0,r.jsx)("option",{value:e.id,children:"".concat(null!=(t=null==n?void 0:n.label)?t:e.id," — ").concat(w("newTask.agentStatus.".concat(s)))},e.id)})})]})]}),"stopped"===eS&&(0,r.jsx)("p",{className:"text-xs text-foreground","data-testid":"new-task-will-start",children:w("newTask.willStart",{agent:eC})}),"starting"===eS&&(0,r.jsx)("p",{className:"text-xs text-warning-foreground","data-testid":"new-task-starting",children:w("newTask.startingNotice",{agent:eC})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-message",className:tA,children:w("newTask.messageLabel")}),(0,r.jsx)("textarea",{ref:V,id:"new-task-message","data-testid":"new-task-message",value:E,onChange:e=>L(e.target.value),placeholder:w("newTask.messagePlaceholder"),rows:5,className:"".concat(tT," resize-y")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-model",className:tA,children:w("newTask.modelLabel")}),(0,r.jsx)("input",{id:"new-task-model","data-testid":"new-task-model",type:"text",value:(null==ed?void 0:ed.selectable)?P:"",onChange:e=>K(e.target.value),placeholder:w("newTask.modelPlaceholder"),disabled:!(null==ed?void 0:ed.selectable),className:tT}),ed&&(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground","data-testid":"new-task-model-note",children:ed.selectable?w((null==ea?void 0:ea.instance.cliTool)==="copilot"?"newTask.modelHintSwitch":"newTask.modelHintLaunch"):w("newTask.modelUnavailable.".concat(ed.reason),{agent:eC})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{htmlFor:"new-task-auto-yes",className:tA,children:w("newTask.autoYesLabel")}),eh?(0,r.jsx)("p",{className:"text-sm text-foreground","data-testid":"new-task-auto-yes-active",children:w("newTask.autoYesActive",{remaining:(0,tc.$B)(eh.expiresAt)})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("select",{id:"new-task-auto-yes","data-testid":"new-task-auto-yes",value:null!=R?R:"",onChange:e=>{let t=Number(e.target.value);O(""!==e.target.value&&(0,tc.dR)(t)?t:null)},className:tT,children:[(0,r.jsx)("option",{value:"",children:w(ex?"newTask.autoYesKeepUnknown":"newTask.autoYesKeep")}),tc.z9.map(e=>(0,r.jsx)("option",{value:e,children:w("newTask.autoYesEnableFor",{duration:j(tc.Ni[e].replace("autoYes.",""))})},e))]}),ex&&(0,r.jsx)("p",{className:"mt-1 text-xs text-warning-foreground","data-testid":"new-task-auto-yes-unknown",children:w("newTask.autoYesUnknown")}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:w("newTask.autoYesScope")}),null!==R&&(0,r.jsx)("p",{className:"mt-1 text-xs text-warning-foreground","data-testid":"new-task-auto-yes-risk",children:j("riskWarning")})]})]})]})]}),W&&(0,r.jsxs)("div",{role:"alert","data-testid":"new-task-error","data-kind":W.kind,className:"rounded-lg border border-danger-border bg-danger-subtle px-3 py-2 text-sm text-danger-foreground",children:[(0,r.jsx)("p",{children:w("newTask.errors.".concat(W.kind),{agent:eC})}),W.detail&&(0,r.jsx)("p",{className:"mt-1 break-words text-xs text-muted-foreground","data-testid":"new-task-error-detail",children:W.detail})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,r.jsxs)("span",{className:"mr-auto hidden items-center gap-1 text-xs text-muted-foreground sm:flex",children:[(0,r.jsx)(ei.u,{children:em("MOD",_)}),(0,r.jsx)(ei.u,{children:"↵"}),(0,r.jsx)("span",{children:w("newTask.sendHint")})]}),(0,r.jsx)("button",{type:"button","data-testid":"new-task-cancel",onClick:Z,disabled:D,className:"px-4 py-2 text-sm font-medium text-foreground bg-muted hover:bg-muted/80 rounded-lg transition-colors disabled:opacity-50",children:w("cancel")}),(0,r.jsx)("button",{type:"button","data-testid":"new-task-send",onClick:()=>void ey(),disabled:!ew,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:D?w("newTask.sending"):w("newTask.send")})]})]})})}function tE(){let{isOpen:e,openNewTask:t}=(0,eo.hX)(),{open:n}=(0,el.C)(),s=(0,a.useRef)(n);return(0,a.useEffect)(()=>{s.current=n},[n]),(0,a.useEffect)(()=>{function e(e){if(!e.defaultPrevented)!e7(e)&&e.shiftKey&&!e.altKey&&(e.metaKey||e.ctrlKey)&&("o"===e.key.toLowerCase()||"KeyO"===e.code)&&(s.current||(e.preventDefault(),t()))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t]),e?(0,r.jsx)(tM,{}):null}var tL=n(59854);let tP="transform transition-transform duration-300 ease-out",tB=(0,a.memo)(function(e){let{children:t}=e,{isOpen:n,isMobileDrawerOpen:u,closeMobileDrawer:m,width:h,setWidth:x,repoTabBarMode:f,toggle:p}=(0,i.VF)(),b=(0,l.a)(),{showSidebar:g,showGlobalNav:v}=function(){var e=(0,s.usePathname)();for(let t of d)if(e.startsWith(t.prefix))return{...o,...t.config};return{...o}}();!function(e,t){let{open:n}=(0,el.C)(),r=(0,a.useRef)(n),s=(0,a.useRef)(t);(0,a.useEffect)(()=>{r.current=n,s.current=t},[n,t]),(0,a.useEffect)(()=>{if(e)return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t);function t(e){!(e.defaultPrevented||!(0,B.zg)(e)||r.current||(0,eZ.Sj)())&&((0,B.al)(e.target)||(e.preventDefault(),s.current()))}},[e])}(!b&&g,p);let{factor:w}=(0,c.Ps)(),j=Math.round(160*w),y=Math.round(480*w),k=Math.round(Math.min(y,Math.max(j,h*w))),N=(0,B.fs)(null!=f?f:B.PB,n),C=(0,a.useRef)(null),S=(0,a.useRef)(null),I=(0,a.useRef)(null),T=(0,a.useRef)(u);(0,a.useLayoutEffect)(()=>{var e;let t=T.current;if(T.current=u,!b||!t||u)return;let n=document.activeElement,r=n instanceof HTMLElement&&(null==(e=I.current)?void 0:e.contains(n))===!0;(r||null===n||n===document.body)&&!(0,e1.Bl)()&&r&&n.blur()},[b,u]);let A=(0,a.useCallback)(e=>{x(Math.round(e/w))},[x,w]);return b?(0,r.jsx)(eo.Zg,{children:(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,r.jsx)(e4,{}),u&&(0,r.jsx)("div",{"data-testid":"drawer-overlay",className:"fixed inset-0 bg-black/50 z-40",onClick:m,"aria-hidden":"true"}),g&&(0,r.jsx)("aside",{ref:I,"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full w-72 max-w-[85vw] z-50 bg-sidebar pt-safe pb-safe\n ".concat(tP,"\n ").concat(u?"translate-x-0":"-translate-x-full","\n "),role:"complementary",children:(0,r.jsx)(eT,{})}),(0,r.jsx)("main",{className:"flex-1 min-h-0 overflow-hidden ".concat(v?"pb-nav-safe":""),role:"main","data-view-transition":"content",children:t}),v&&(0,r.jsx)(e5,{}),(0,r.jsx)(e3.xq,{}),(0,r.jsx)(te,{}),(0,r.jsx)(tt.n,{}),(0,r.jsx)(td,{}),(0,r.jsx)(tE,{})]})}):(0,r.jsx)(eo.Zg,{children:(0,r.jsxs)("div",{"data-testid":"app-shell",className:"h-screen flex flex-col",children:[(0,r.jsxs)("div",{className:"flex flex-1 min-h-0",children:[g&&(0,r.jsxs)("aside",{ref:C,"data-testid":"sidebar-container",className:"\n fixed left-0 top-0 h-full\n border-r border-border\n ".concat(tP,"\n ").concat(n?"translate-x-0":"-translate-x-full","\n "),style:{width:"".concat(k,"px"),zIndex:tL.M.SIDEBAR},role:"complementary","aria-hidden":!n,children:[(0,r.jsx)(eT,{}),(0,r.jsx)(tK,{currentWidth:k,minWidth:j,maxWidth:y,sidebarRef:C,mainRef:S,onWidthChange:A})]}),g&&!n&&(0,r.jsx)("aside",{"data-testid":"sidebar-rail-container",className:"\n fixed left-0 top-0 h-full\n border-r border-border\n ",style:{width:"".concat(B.BN,"px"),zIndex:tL.M.SIDEBAR},children:(0,r.jsx)(eJ,{})}),(0,r.jsxs)("main",{ref:S,className:"flex-1 min-w-0 h-full overflow-hidden flex flex-col transition-[padding] duration-300 ease-out",style:{paddingLeft:g?"".concat(n?k:B.BN,"px"):0},role:"main","data-view-transition":"content",children:[N&&(0,r.jsx)(e$.vP,{}),v&&(0,r.jsx)(eV,{}),(0,r.jsx)("div",{className:"flex-1 min-h-0",children:t})]})]}),(0,r.jsx)(e3.xq,{}),(0,r.jsx)(te,{}),(0,r.jsx)(tt.n,{}),(0,r.jsx)(td,{}),(0,r.jsx)(tE,{})]})})});function tK(e){let{currentWidth:t,minWidth:n,maxWidth:s,sidebarRef:a,mainRef:i,onWidthChange:l}=e;return(0,r.jsx)("div",{"data-testid":"sidebar-resize-handle","aria-hidden":"true",onMouseDown:e=>{e.preventDefault();let r=e.clientX,o=t;i.current&&(i.current.style.transition="none");let d=e=>{o=Math.max(n,Math.min(s,t+(e.clientX-r))),a.current&&(a.current.style.width="".concat(o,"px")),i.current&&(i.current.style.paddingLeft="".concat(o,"px"))},c=()=>{document.body.style.cursor="",document.body.style.userSelect="",i.current&&(i.current.style.transition=""),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),l(o)};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",d),document.addEventListener("mouseup",c)},className:"absolute top-0 right-0 w-1 h-full cursor-col-resize hover:bg-accent-500/40 transition-colors"})}let tR=["/login","/offline","/proxy"],tO=/^\/worktrees\/[^/]+\/(terminal|files)(\/|$)/;function tD(e){var t;let{children:n}=e,a=(0,s.usePathname)();return(t=null!=a?a:"",tR.some(e=>t===e||t.startsWith("".concat(e,"/")))||tO.test(t)||0)?(0,r.jsx)(r.Fragment,{children:n}):(0,r.jsx)(tB,{children:n})}}},e=>{e.O(0,[5373,2978,6809,4909,2770,2619,6606,7730,5927,8407,2407,344,6654,8606,4768,8165,602,5794,8441,1255,7358],()=>e(e.s=80903)),_N_E=e.O()}]);
|