@chorus-aidlc/chorus 0.21.0 → 0.21.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/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-build-manifest.json +213 -213
- package/.next/standalone/.next/app-path-routes-manifest.json +38 -38
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/prerender-manifest.json +42 -42
- package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/project-groups/[uuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/activity/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/[ideaUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/dashboard/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/documents/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/graph/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/proposals/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/[uuid]/tasks/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/page.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/settings/page.js +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/companies/[uuid]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/admin/companies/new/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/admin/companies/new.html +2 -2
- package/.next/standalone/.next/server/app/admin/companies/new.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/companies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/admin/companies.html +2 -2
- package/.next/standalone/.next/server/app/admin/companies.rsc +1 -1
- package/.next/standalone/.next/server/app/admin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/admin.html +2 -2
- package/.next/standalone/.next/server/app/admin.rsc +1 -1
- package/.next/standalone/.next/server/app/api/admin/companies/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/companies/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/login/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/admin/session/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agent-connections/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agents/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agents/[uuid]/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/api-keys/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/api-keys/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/callback/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/check-default/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/company-oidc/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/default-login/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/identify/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/me/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/auth/sync-token/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/comments/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/connection-heartbeat/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/control/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/directory-request/report/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/execution-state/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/executions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/pending-turns/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/report-interrupt/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/resume/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/transcript/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon/turn-advance/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon-directory-requests/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon-directory-requests/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/instruction/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/repoint/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon-sessions/[sessionUuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon-sessions/ad-hoc/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/daemon-sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/documents/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/entities/[type]/[uuid]/root-idea/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/events/notifications/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/events/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/claim/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/preview/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/move/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/parent/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/release/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/[uuid]/wake-preview/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/ideas/conversational/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/mcp/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/me/assignments/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/mentionables/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/[uuid]/archive/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/[uuid]/read/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/preferences/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/read-all/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/notifications/unread-count/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/[uuid]/access-preview/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/[uuid]/dashboard/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/[uuid]/members/[userUuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/[uuid]/members/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-groups/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-visits/pin/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-visits/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/project-visits/visit/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/access-preview/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/activity/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/agent-cwds/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/available/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/documents/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/group/preview/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/group/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/ideas/tracker/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/members/[userUuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/members/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/[proposalUuid]/validate/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/proposals/summary/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/resource-graph/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/stats/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/dependencies/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/[uuid]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/agent-cwd-options/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/approve/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/close/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/reject/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/revoke/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/proposals/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/references/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/references/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/session/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/sessions/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/claim/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/[dependsOnUuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/dependencies/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/release/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/tasks/[uuid]/sessions/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +2 -2
- package/.next/standalone/.next/server/app/index.rsc +1 -1
- package/.next/standalone/.next/server/app/login/admin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/admin.html +2 -2
- package/.next/standalone/.next/server/app/login/admin.rsc +1 -1
- package/.next/standalone/.next/server/app/login/callback/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/callback.html +2 -2
- package/.next/standalone/.next/server/app/login/callback.rsc +1 -1
- package/.next/standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/pick-workspace/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/login/pick-workspace.html +2 -2
- package/.next/standalone/.next/server/app/login/pick-workspace.rsc +1 -1
- package/.next/standalone/.next/server/app/login.html +2 -2
- package/.next/standalone/.next/server/app/login.rsc +1 -1
- package/.next/standalone/.next/server/app/onboarding/page.js +2 -2
- package/.next/standalone/.next/server/app/onboarding/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/onboarding/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/onboarding.html +2 -2
- package/.next/standalone/.next/server/app/onboarding.rsc +2 -2
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects.html +2 -2
- package/.next/standalone/.next/server/app/projects.rsc +2 -2
- package/.next/standalone/.next/server/app/settings.html +2 -2
- package/.next/standalone/.next/server/app/settings.rsc +3 -3
- package/.next/standalone/.next/server/app-paths-manifest.json +38 -38
- package/.next/standalone/.next/server/chunks/1855.js +2 -2
- package/.next/standalone/.next/server/chunks/2689.js +2 -2
- package/.next/standalone/.next/server/chunks/5212.js +1 -1
- package/.next/standalone/.next/server/chunks/5281.js +2 -2
- package/.next/standalone/.next/server/chunks/5647.js +1 -1
- package/.next/standalone/.next/server/chunks/5764.js +2 -2
- package/.next/standalone/.next/server/chunks/6493.js +1 -1
- package/.next/standalone/.next/server/chunks/6991.js +2 -2
- package/.next/standalone/.next/server/chunks/{9894.js → 7138.js} +1 -1
- package/.next/standalone/.next/server/chunks/{9583.js → 7169.js} +3 -3
- package/.next/standalone/.next/server/chunks/7425.js +1 -0
- package/.next/standalone/.next/server/chunks/7839.js +1 -1
- package/.next/standalone/.next/server/chunks/8692.js +1 -0
- package/.next/standalone/.next/server/chunks/87.js +1 -0
- package/.next/standalone/.next/server/chunks/8849.js +2 -2
- package/.next/standalone/.next/server/chunks/911.js +1 -0
- package/.next/standalone/.next/server/chunks/9295.js +1 -1
- package/.next/standalone/.next/server/middleware-manifest.json +5 -5
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/pages-manifest.json +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/15638-e8566f8551988a0b.js +1 -0
- package/.next/standalone/.next/static/chunks/30187-8406d0b0e7582b4e.js +1 -0
- package/.next/standalone/.next/static/chunks/59480-03e05915e0f0f1e4.js +1 -0
- package/.next/standalone/.next/static/chunks/65833-d0a8d9023febc1ce.js +1 -0
- package/.next/standalone/.next/static/chunks/75844-ab7e24827a4875a0.js +1 -0
- package/.next/standalone/.next/static/chunks/88277-9563bd5857edfb08.js +1 -0
- package/.next/standalone/.next/static/chunks/91202-a6809360a6c58c9a.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-9a0a7266bbc1498f.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/dashboard/{page-670eeb1a8007a20c.js → page-26aef423473209b6.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-deb0615a19598fe6.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-cb20e73952b1d4ee.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/graph/{page-ed5fbcae30e875d1.js → page-c8af650e39ff3eac.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-6bc33e1fb5e252dc.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-e622257cf6a2fe0c.js +1 -0
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/{page-49b02e795c5b279c.js → page-2085f55b6cbd4d82.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/[taskUuid]/{page-f26cad3e8406ac07.js → page-2b9e6239037f79d5.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/tasks/{page-04a3fbabc7542960.js → page-7afc11846cb7aefc.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/settings/{page-d0c217c1e9a18433.js → page-406dbd7ae784ec2b.js} +1 -1
- package/.next/standalone/.next/static/chunks/app/onboarding/page-bb641e258e90d08b.js +1 -0
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/public/chorus-plugin/.claude-plugin/plugin.json +1 -1
- package/.next/standalone/public/chorus-plugin/bin/chorus-api.sh +1 -1
- package/.next/standalone/public/chorus-plugin/skills/brainstorm/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/chorus/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/chorus-cli/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/develop/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/docs/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/idea/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/openspec-aware/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/orchestrate/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/proposal/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/quick-dev/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/research/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/review/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/spec-lite/SKILL.md +1 -1
- package/.next/standalone/public/chorus-plugin/skills/yolo/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-brainstorm/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-cli/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-develop/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-docs/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-idea/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-openspec-aware/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-orchestrate/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-proposal/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-quick-dev/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-research/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-review/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-spec-lite/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/.kiro/skills/chorus-yolo/SKILL.md +1 -1
- package/.next/standalone/public/kiro-plugin/bin/chorus-api.sh +1 -1
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/cli/init/contracts.mjs +3 -0
- package/cli/init/install-methods.mjs +24 -113
- package/cli/init/pi-compatibility.mjs +5 -0
- package/cli/init/pi-mcp-backend.mjs +160 -0
- package/cli/init/pi-mcp-config.mjs +48 -64
- package/cli/init/registry.mjs +3 -2
- package/cli/init/run-command.mjs +3 -1
- package/cli/init/steps/codex-restart.mjs +95 -0
- package/cli/init/steps/credential-seed.mjs +18 -17
- package/cli/init.mjs +2 -2
- package/cli/upgrade-plugins.mjs +10 -45
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/1443.js +0 -1
- package/.next/standalone/.next/server/chunks/2701.js +0 -1
- package/.next/standalone/.next/server/chunks/6666.js +0 -1
- package/.next/standalone/.next/server/chunks/7329.js +0 -1
- package/.next/standalone/.next/static/chunks/14891-8a7485231cdaf105.js +0 -1
- package/.next/standalone/.next/static/chunks/30187-12e26e880f7b6da7.js +0 -1
- package/.next/standalone/.next/static/chunks/36244-82317cfd58345146.js +0 -1
- package/.next/standalone/.next/static/chunks/40309-bedb6f19876265b4.js +0 -1
- package/.next/standalone/.next/static/chunks/56161-5d2f255f25dba375.js +0 -1
- package/.next/standalone/.next/static/chunks/6497-36958930c3e35070.js +0 -1
- package/.next/standalone/.next/static/chunks/70762-18006a86c770d908.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/layout-2f843ed9eb3944e4.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/[documentUuid]/page-ed4d5692eac763c4.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/documents/page-48b79f200d9f086c.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/[proposalUuid]/page-91e61264f483701b.js +0 -1
- package/.next/standalone/.next/static/chunks/app/(dashboard)/projects/[uuid]/proposals/new/page-cf90d562352224ec.js +0 -1
- package/.next/standalone/.next/static/chunks/app/onboarding/page-87d43a00d0a7b209.js +0 -1
- /package/.next/standalone/.next/static/{q_ngNQiWgbMewMxZKkQzM → -QBMDLYHMUleR_Nbp3gXV}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{q_ngNQiWgbMewMxZKkQzM → -QBMDLYHMUleR_Nbp3gXV}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[30187],{30187:(e,s,t)=>{Promise.resolve().then(t.bind(t,94596))},30782:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(73326).A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},88749:(e,s,t)=>{"use strict";t.d(s,{a:()=>r});var a=t(81476);function r(){let[e,s]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=window.matchMedia("(max-width: 767px)");s(e.matches);let t=e=>s(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),e}},94596:(e,s,t)=>{"use strict";t.d(s,{TaskViewToggle:()=>em});var a=t(60200),r=t(81476),n=t(45719),d=t(25588),i=t(86461),l=t(30782),o=t(34382),c=t(26657),u=t(40058),x=t(75507),m=t(16272),p=t(88749),g=t(74315),h=t(32022),f=t(80513),b=t(57080),j=t(71507),k=t(5535),v=t(49417),y=t(2137),N=t(91069);function w(e){let{projectUuid:s}=e,t=(0,d.c)("tasks"),i=(0,h.r)(),l=(0,n.usePathname)(),o=(0,n.useSearchParams)(),[c,m]=(0,r.useState)(!1),[p,g]=(0,r.useState)([]),[w,F]=(0,r.useState)(new Set);(0,r.useEffect)(()=>{let e=o.get("proposalUuids");e?F(new Set(e.split(",").filter(Boolean))):F(new Set)},[o]),(0,r.useEffect)(()=>{let e=!1;return async function(){try{let t=await fetch("/api/projects/".concat(s,"/proposals/summary"));if(!t.ok)return;let a=await t.json();!e&&a.success&&g(a.data)}catch(e){}}(),()=>{e=!0}},[s]);let C=(0,r.useCallback)(e=>{let s=new URLSearchParams(o.toString());e.size>0?s.set("proposalUuids",Array.from(e).join(",")):s.delete("proposalUuids");let t=s.toString();i.replace("".concat(l).concat(t?"?".concat(t):""),{scroll:!1})},[i,l,o]),A=(0,r.useCallback)(e=>{F(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),C(t),t})},[C]),E=(0,r.useCallback)(()=>{F(new Set),C(new Set)},[C]),S=w.size>0;return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-sm text-muted-foreground shrink-0",children:[(0,a.jsx)(f.A,{className:"size-4"}),(0,a.jsxs)("span",{children:[t("proposalFilter.label"),":"]})]}),(0,a.jsxs)(y.AM,{open:c,onOpenChange:m,children:[(0,a.jsx)(y.Wv,{asChild:!0,children:(0,a.jsxs)(u.$,{variant:"outline",size:"sm",role:"combobox","aria-expanded":c,className:(0,v.cn)("justify-between gap-1 min-w-[120px] max-w-[200px] md:min-w-[160px] md:max-w-none",S&&"border-primary bg-[#FFF8F4] dark:bg-[#2a2016]"),children:[(0,a.jsx)("span",{className:"truncate",children:S?t("proposalFilter.filtered",{filtered:w.size,total:p.length}):t("proposalFilter.allProposals")}),(0,a.jsx)(b.A,{className:"size-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(y.hl,{className:"w-[300px] p-0",align:"start",children:(0,a.jsxs)(N.uB,{children:[(0,a.jsx)(N.G7,{placeholder:t("proposalFilter.search")}),(0,a.jsxs)(N.oI,{children:[(0,a.jsx)(N.xL,{children:t("proposalFilter.noResults")}),(0,a.jsx)(N.L$,{children:p.map(e=>{let s=w.has(e.uuid);return(0,a.jsxs)(N.h_,{value:e.title,onSelect:()=>A(e.uuid),className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:(0,v.cn)("flex size-4 shrink-0 items-center justify-center rounded-sm border",s?"border-primary bg-primary text-white":"border-muted-foreground/30"),children:s&&(0,a.jsx)(j.A,{className:"size-3"})}),(0,a.jsx)("span",{className:"truncate",children:e.title})]}),(0,a.jsx)(x.E,{variant:"secondary",className:"ml-2 shrink-0",children:t("proposalFilter.taskCount",{count:e.taskCount})})]},e.uuid)})})]})]})})]}),S&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex flex-wrap gap-1 max-w-full",children:p.filter(e=>w.has(e.uuid)).map(e=>(0,a.jsxs)(x.E,{variant:"outline",className:"gap-1 border-primary bg-[#FFF8F4] dark:bg-[#2a2016] text-primary",children:[e.title,(0,a.jsx)("button",{type:"button",className:"ml-0.5 rounded-full hover:bg-primary/20",onClick:()=>A(e.uuid),children:(0,a.jsx)(k.A,{className:"size-3"})})]},e.uuid))}),(0,a.jsx)(u.$,{variant:"ghost",size:"xs",onClick:E,className:"text-muted-foreground",children:t("proposalFilter.clear")})]})]})}var F=t(9827),C=t(7685),A=t(95726),E=t(32814),S=t(6565),U=t(16198),D=t(26185),_=t(83564),P=t(57054);let B=(0,r.createContext)(null);var L=t(7029),z=t(93894);let M=e=>!e.isLayoutDirty&&e.willUpdate(!1),T=e=>{let{children:s,id:t,inherit:n=!0}=e,d=(0,r.useContext)(P.L),i=(0,r.useContext)(B),[l,o]=function(){let e=function(){let e=(0,r.useRef)(!1);return(0,z.E)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}(),[s,t]=(0,r.useState)(0),a=(0,r.useCallback)(()=>{e.current&&t(s+1)},[s]);return[(0,r.useCallback)(()=>L.Gt.postRender(a),[a]),s]}(),c=(0,r.useRef)(null),u=d.id||i;null===c.current&&((e=>!0==(!0===e)||"id"===e)(n)&&u&&(t=t?u+"-"+t:u),c.current={id:t,group:!0===n&&d.group||function(){let e=new Set,s=new WeakMap,t=()=>e.forEach(M);return{add:a=>{e.add(a),s.set(a,a.addEventListener("willUpdate",t))},remove:a=>{e.delete(a);let r=s.get(a);r&&(r(),s.delete(a)),t()},dirty:t}}()});let x=(0,r.useMemo)(()=>({...c.current,forceRender:l}),[o]);return(0,a.jsx)(P.L.Provider,{value:x,children:s})};var R=t(25452),K=t(8330),O=t(67566),V=t(42885);let $=(0,V.createServerReference)("4002638a0507504a217252d0d6d5fbf1d7e96f29ee",V.callServer,void 0,V.findSourceMapURL,"fetchTasksAction"),q=(0,V.createServerReference)("70f6cb2625492fda59f79bc2d7e05636c724c720e0",V.callServer,void 0,V.findSourceMapURL,"moveTaskToColumnAction"),I=(0,V.createServerReference)("60cd05f031dfb509b500319e484eeaf1c24f585a59",V.callServer,void 0,V.findSourceMapURL,"forceMoveTaskToColumnAction");var W=t(43664),G=t(61169),H=t(88839),Z=t(38060),Y=t(69189);let J={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]"},Q={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},X={in_progress:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#2E7D32] dark:text-[#5FD07E]",open:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground",to_verify:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1565C0] dark:text-[#5AA9F0]"},ee=[{id:"todo",labelKey:"todo",statuses:["open","assigned"]},{id:"in_progress",labelKey:"inProgress",statuses:["in_progress"]},{id:"to_verify",labelKey:"toVerify",statuses:["to_verify"]},{id:"done",labelKey:"done",statuses:["done","closed"]}];function es(e){let{projectUuid:s,initialTasks:t,currentUserUuid:n,selectedTaskUuid:i,onTaskSelect:l,onPanelClose:o,proposalUuidFilter:c}=e,p=(0,d.c)(),g=(0,Y.F7)(),[h,f]=(0,r.useState)(t),[b,j]=(0,r.useState)({}),[k,v]=(0,r.useState)(!1),[y,N]=(0,r.useState)(null),[w,P]=(0,r.useState)([]),[B,L]=(0,r.useState)(!1),[z,M]=(0,r.useState)([]),[V,es]=(0,r.useState)(!1),[et,ea]=(0,r.useState)(!1),er=(0,r.useCallback)(async()=>{let e=await $(s);if(e.success){let s=c?e.data.filter(e=>e.proposalUuid&&c.has(e.proposalUuid)):e.data;f(s);let t=await (0,H.h)(s.map(e=>e.uuid));t.success&&t.data&&j(t.data)}},[s,c]);(0,Z.eV)("task",er);let en=(0,r.useRef)(c);(0,r.useEffect)(()=>{en.current!==c&&(en.current=c,er())},[c,er]),(0,r.useEffect)(()=>{0!==t.length&&(0,H.h)(t.map(e=>e.uuid)).then(e=>{e.success&&e.data&&j(e.data)})},[t]);let ed=(0,r.useMemo)(()=>{var e;return i&&null!=(e=h.find(e=>e.uuid===i))?e:null},[i,h]),ei=e=>h.filter(s=>e.includes(s.status)),el=e=>ei(e).reduce((e,s)=>e+(s.storyPoints||0),0),eo=async e=>{let t;ea(!1);let{destination:a,source:r,draggableId:n}=e;if(!a||a.droppableId===r.droppableId&&a.index===r.index)return;let d=a.droppableId;r.droppableId;let i=h.find(e=>e.uuid===n);if(!i)return;if(ee.find(e=>e.id===d),"todo"===d)t="assigned"===i.status?"assigned":"open";else if("in_progress"===d)t="in_progress";else if("to_verify"===d)t="to_verify";else{if("done"!==d)return;t="to_verify"===i.status?"done":"to_verify"}f(e=>e.map(e=>e.uuid===n?{...e,status:t}:e));let l=await q(n,d,s);if(l.success)er();else{if("blocked"in l&&l.blocked&&"blockers"in l){f(e=>e.map(e=>e.uuid===n?{...e,status:i.status}:e)),N(i),P(l.blockers),v(!0);return}f(e=>e.map(e=>e.uuid===n?{...e,status:i.status}:e)),"gateBlocked"in l&&l.gateBlocked&&(M("unresolvedCriteria"in l&&Array.isArray(l.unresolvedCriteria)?l.unresolvedCriteria:[]),L(!0))}},ec=async()=>{if(y){es(!0);try{let e=await I(y.uuid,"in_progress");e.success?(v(!1),N(null),P([]),er()):W.q.error("Failed to force move task:",e.error)}finally{es(!1)}}},eu=()=>{v(!1),N(null),P([])};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(F.JY,{onDragStart:()=>{ea(!0)},onDragEnd:eo,children:(0,a.jsx)(T,{children:(0,a.jsx)("div",{className:"flex flex-1 gap-4 overflow-x-auto pb-4",children:ee.map(e=>{let s=ei(e.statuses);return(0,a.jsxs)("div",{className:"flex w-[300px] flex-shrink-0 flex-col rounded-xl bg-secondary p-4",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-foreground",children:p("status.".concat(e.labelKey))}),(0,a.jsx)("span",{className:"rounded-full bg-card px-2 py-0.5 text-xs font-medium text-muted-foreground",children:s.length})]}),el(e.statuses)>0&&(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs text-[#9A9A9A]",children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("polyline",{points:"12 6 12 12 16 14"})]}),el(e.statuses),"h"]})]}),(0,a.jsx)(F.gL,{droppableId:e.id,children:(e,t)=>(0,a.jsxs)("div",{ref:e.innerRef,...e.droppableProps,className:"flex-1 space-y-3 overflow-y-auto min-h-[100px] rounded-lg pt-3 pr-3 transition-colors ".concat(t.isDraggingOver?"bg-border":""),children:[0!==s.length||t.isDraggingOver?s.map((e,s)=>{let t=!!e.dependsOn&&0!==e.dependsOn.length&&e.dependsOn.some(e=>"done"!==e.status&&"closed"!==e.status),r=(t?!e.dependsOn?[]:e.dependsOn.filter(e=>"done"!==e.status&&"closed"!==e.status):[]).map(e=>e.title).join(", ");return(0,a.jsx)(F.sx,{draggableId:e.uuid,index:s,isDragDisabled:!g,children:(s,n)=>(0,a.jsx)("div",{ref:s.innerRef,...s.draggableProps,...s.dragHandleProps,onClick:()=>{n.isDragging||l(e.uuid)},style:s.draggableProps.style,children:(0,a.jsxs)(R.P.div,{className:"relative",layoutId:et?void 0:"task-card-".concat(e.uuid),transition:K.Yv.spring,children:[b[e.uuid]>0&&(0,a.jsx)("div",{className:"absolute -top-3 -right-3 z-10 flex h-11 w-11 items-center justify-center rounded-full border-2 border-green-400 bg-card shadow-sm",children:(0,a.jsx)("img",{src:"/typing-animation.gif",alt:"",className:"h-8 w-8"})}),(0,a.jsx)(C.D,{entityType:"task",entityUuid:e.uuid,children:(0,a.jsxs)(m.Zp,{className:"cursor-pointer p-4 transition-all ".concat(t?"border-dashed border-[#D1D1D1] dark:border-[#3a3a40] opacity-60":"border-border hover:border-primary"," bg-card hover:shadow-sm ").concat(n.isDragging?"shadow-lg rotate-2":""),children:[(0,a.jsxs)("div",{className:"mb-2 flex items-start justify-between",children:[(0,a.jsx)(x.E,{className:J[e.status]||"",children:p("status.".concat(Q[e.status]||e.status))}),(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:e.storyPoints&&(0,a.jsxs)("span",{className:"flex items-center gap-1 rounded bg-[#FFF3E0] dark:bg-[#3a2a12] px-2 py-0.5 text-xs font-medium text-[#E65100] dark:text-[#F0A050]",children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("polyline",{points:"12 6 12 12 16 14"})]}),e.storyPoints,"h"]})})]}),(0,a.jsx)("h4",{className:"mb-1 font-medium text-foreground",children:e.title}),e.description&&(0,a.jsx)("p",{className:"mb-2 line-clamp-2 text-sm text-muted-foreground",children:e.description}),t&&(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 rounded-md bg-[#FFF3E0] dark:bg-[#3a2a12] px-2 py-1",children:[(0,a.jsx)(A.A,{className:"h-3 w-3 shrink-0 text-[#E65100] dark:text-[#F0A050]"}),(0,a.jsx)("span",{className:"text-[9px] font-medium leading-tight text-[#E65100] dark:text-[#F0A050] line-clamp-1",children:p("tasks.blockedBy",{tasks:r})})]}),(0,a.jsxs)("div",{className:"flex items-start justify-between gap-2 text-xs text-[#9A9A9A]",children:[e.assignee?(0,a.jsxs)("span",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,_.bB)(e.assignee)?(0,a.jsx)(D.AgentAvatar,{name:e.assignee.name,size:16,className:"shrink-0 rounded-full"}):(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-3 w-3 shrink-0",children:[(0,a.jsx)("path",{d:"M12 8V4H8"}),(0,a.jsx)("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"})]}),(0,a.jsx)("span",{className:"truncate",children:e.assignee.name})]}),"agent_instance"===e.assignee.type&&e.assignee.instance&&(0,a.jsx)(U.jQ,{cwd:e.assignee.instance.cwd,host:e.assignee.instance.host,showHost:!1,className:"pl-4"})]}):"open"===e.status&&g?(0,a.jsx)("span",{className:"text-primary",children:p("common.assign")}):(0,a.jsx)("span",{children:p("common.unassigned")}),(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[b[e.uuid]>0&&(0,a.jsxs)(x.E,{variant:"outline",className:"h-4 gap-1 border-green-300 dark:border-[#2a4a34] px-1.5 text-[10px] text-green-700 dark:text-[#6FD19A]",children:[(0,a.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-green-500"}),p("sessions.workerCount",{count:b[e.uuid]})]}),e.acceptanceSummary&&e.acceptanceSummary.total>0&&(()=>{let s=e.acceptanceSummary,t="to_verify"===e.status,r=s.requiredPassed===s.required&&s.required>0,n=s.requiredFailed>0,d="bg-secondary text-muted-foreground";return t&&(d=r?"bg-green-50 text-green-700 dark:bg-[#14281a] dark:text-[#6FD19A]":n?"bg-red-50 text-[#C4574C] dark:bg-[#331619] dark:text-[#F0897E]":"bg-amber-50 text-[#D97706] dark:bg-[#332a12] dark:text-[#E0B44E]"),(0,a.jsxs)(x.E,{className:"h-4 gap-1 border-0 px-1.5 text-[9px] ".concat(d),children:[(0,a.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-2.5 w-2.5",children:[(0,a.jsx)("path",{d:"M9 11l3 3L22 4"}),(0,a.jsx)("path",{d:"M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11"})]}),s.passed,"/",s.total]})})()]})]})]})})]})})},e.uuid)}):(0,a.jsx)("div",{className:"flex h-24 items-center justify-center rounded-lg border-2 border-dashed border-border text-sm text-[#9A9A9A]",children:p("tasks.noTasks")}),e.placeholder]})})]},e.id)})})})}),ed&&(0,a.jsx)(G.v,{task:ed,projectUuid:s,currentUserUuid:n,onClose:o}),(0,a.jsx)(O.lG,{open:k,onOpenChange:e=>{e||eu()},children:(0,a.jsxs)(O.Cf,{className:"max-w-md rounded-2xl",children:[(0,a.jsxs)(O.c7,{children:[(0,a.jsxs)(O.L3,{className:"flex items-center gap-2",children:[(0,a.jsx)(E.A,{className:"h-5 w-5 text-[#E65100] dark:text-[#F0A050]"}),p("tasks.dependencyBlocked")]}),(0,a.jsx)(O.rr,{children:p("tasks.dependencyBlockedDescription")})]}),(0,a.jsxs)("div",{className:"rounded-lg bg-background p-3",children:[(0,a.jsx)("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:p("tasks.blockerList")}),(0,a.jsx)("div",{className:"space-y-2",children:w.map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border bg-card p-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"truncate text-sm font-medium text-foreground",children:e.title}),(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[e.assignee&&(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,_.bB)(e.assignee)&&(0,a.jsx)(D.AgentAvatar,{name:e.assignee.name,size:16,className:"shrink-0 rounded-full"}),e.assignee.name]}),e.sessionCheckin&&(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,a.jsx)(S.A,{className:"h-3 w-3"}),e.sessionCheckin.sessionName]})]})]}),(0,a.jsx)(x.E,{className:"shrink-0 ".concat(X[e.status]||"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground"),children:p("status.".concat(Q[e.status]||e.status))})]},e.uuid))})]}),(0,a.jsxs)(O.Es,{className:"gap-2 sm:gap-0",children:[(0,a.jsx)(u.$,{variant:"outline",onClick:eu,children:p("common.cancel")}),(0,a.jsx)(u.$,{className:"bg-[#E65100] hover:bg-[#BF4400] text-white",onClick:ec,disabled:V,children:V?p("common.processing"):p("tasks.forceMove")})]})]})}),(0,a.jsx)(O.lG,{open:B,onOpenChange:L,children:(0,a.jsxs)(O.Cf,{className:"max-w-[520px] rounded-2xl p-0 gap-0",children:[(0,a.jsxs)(O.c7,{className:"px-6 pt-6 pb-4",children:[(0,a.jsxs)(O.L3,{className:"flex items-center gap-2.5",children:[(0,a.jsx)(E.A,{className:"h-5 w-5 text-[#C4574C] dark:text-[#F0897E]"}),p("acceptanceCriteria.title")]}),(0,a.jsx)(O.rr,{className:"text-[13px] leading-relaxed text-muted-foreground",children:p("acceptanceCriteria.gateBlocked",{count:z.filter(e=>e.required&&"passed"!==e.status).length})})]}),(0,a.jsxs)("div",{className:"px-6 pb-4 space-y-3",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold text-[#9A9A9A] uppercase tracking-wide",children:p("acceptanceCriteria.title")}),z.map(e=>(0,a.jsxs)("div",{className:"rounded-lg border p-3 space-y-2 ".concat("failed"===e.status?"border-red-200 dark:border-[#5a2a2e] bg-card":"border-border bg-card"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"h-2 w-2 rounded-full shrink-0 ".concat("failed"===e.status?"bg-[#C4574C]":"bg-[#F59E0B]")}),(0,a.jsx)("span",{className:"text-xs font-semibold text-foreground",children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 pl-4",children:[(0,a.jsx)(x.E,{className:"text-[10px] border-0 ".concat("failed"===e.status?"bg-red-50 text-[#C4574C] dark:bg-[#331619] dark:text-[#F0897E]":"bg-amber-50 text-[#D97706] dark:bg-[#332a12] dark:text-[#E0B44E]"),children:p("acceptanceCriteria.status.".concat(e.status))}),(0,a.jsx)(x.E,{className:"text-[10px] border-0 bg-background text-muted-foreground",children:e.required?p("acceptanceCriteria.required"):p("acceptanceCriteria.optional")}),!e.evidence&&(0,a.jsx)("span",{className:"text-[10px] italic text-muted-foreground",children:p("acceptanceCriteria.noEvidence")})]}),e.evidence&&(0,a.jsxs)("div",{className:"rounded-md bg-red-50 dark:bg-[#331619] p-2 ml-4",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground",children:p("acceptanceCriteria.verifyEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:e.evidence})]})]},e.uuid))]}),(0,a.jsx)(O.Es,{className:"border-t border-[#E5E2DC] dark:border-[#2a2a2e] px-6 py-4",children:(0,a.jsx)(u.$,{className:"rounded-lg bg-[#C4574C] hover:bg-[#A3433A] text-white",onClick:()=>L(!1),children:p("acceptanceCriteria.dismiss")})})]})})]})}var et=t(24546);t(19768);var ea=t(28201),er=t(9258),en=t(55033);let ed=(0,V.createServerReference)("409ed7f5b6e43834d243cedd826e99ac3e2cbf1fae",V.callServer,void 0,V.findSourceMapURL,"getProjectDependenciesAction");var ei=t(64211);function el(e){let{projectUuid:s,onTaskSelect:t,refreshKey:i}=e,l=(0,d.c)(),o=(0,er.W)(),c=(0,n.useSearchParams)(),[x,m,p]=(0,et.ck)([]),[g,h,f]=(0,et.fM)([]),[b,j]=(0,r.useState)(!0),[v,y]=(0,r.useState)(null),N=(0,Y.F7)(),w=(0,r.useMemo)(()=>{let e=c.get("proposalUuids");if(!e)return null;let s=e.split(",").filter(Boolean);return s.length>0?new Set(s):null},[c]),F=(0,r.useCallback)(async()=>{j(!0);let e=await ed(s),t=e.nodes,a=e.edges;if(w){let s=new Set((t=e.nodes.filter(e=>null!==e.proposalUuid&&w.has(e.proposalUuid))).map(e=>e.uuid));a=e.edges.filter(e=>s.has(e.from)&&s.has(e.to))}let r=t.map(e=>({id:e.uuid,type:"taskNode",position:{x:0,y:0},data:{title:e.title,status:e.status,priority:e.priority,proposalUuid:e.proposalUuid}})),n=a.map((e,s)=>({id:"e-".concat(s),source:e.to,target:e.from,...en.qK})),{nodes:d,edges:i}=(0,en.nF)(r,n);m(d),h(i),j(!1)},[s,w,m,h]);(0,r.useEffect)(()=>{F()},[F,i]);let C=(0,r.useCallback)(async e=>{if(!e.source||!e.target)return;y(null);let s=e.target,t=e.source,a=await (0,ei.w)(s,t);if(!a.success)return void y(a.error||l("tasks.failedToAddDep"));await F()},[F]),A=(0,r.useCallback)((e,s)=>{t(s.id)},[t]);return b?(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,a.jsx)(ea.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):0===x.length?(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center text-sm text-muted-foreground",children:l("tasks.noTasksToDisplay")}):(0,a.jsxs)("div",{className:"flex-1 rounded-xl border border-border bg-[#FAFAF8] dark:bg-[#1e1e1c] relative",children:[v&&(0,a.jsxs)("div",{className:"absolute top-3 left-1/2 -translate-x-1/2 z-10 rounded-lg bg-red-50 dark:bg-[#331619] border border-red-200 dark:border-[#5a2a2e] px-4 py-2 text-xs text-red-700 dark:text-[#F08078] shadow-sm",children:[v,(0,a.jsx)(u.$,{variant:"ghost",size:"icon",className:"ml-2 h-5 w-5 font-medium hover:text-red-900 dark:hover:text-[#F0A0A0]",onClick:()=>y(null),children:(0,a.jsx)(k.A,{className:"h-3 w-3"})})]}),(0,a.jsxs)(et.Gc,{colorMode:o?"dark":"light",nodes:x,edges:g,onNodesChange:p,onEdgesChange:f,onConnect:N?C:void 0,nodesConnectable:N,deleteKeyCode:N?void 0:null,onNodeClick:A,nodeTypes:en.c_,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},zoomOnScroll:!0,zoomOnPinch:!0,panOnDrag:!0,children:[(0,a.jsx)(et.VS,{color:o?"#40392f":"#E5E0D8",gap:20}),(0,a.jsx)(et.H2,{className:"[&>button]:border-border [&>button]:bg-card [&>button]:text-foreground [&>button:hover]:bg-background"})]})]})}let eo={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]"},ec={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},eu=[{id:"all",labelKey:"allStatuses",statuses:[]},{id:"todo",labelKey:"todo",statuses:["open","assigned"]},{id:"in_progress",labelKey:"inProgress",statuses:["in_progress"]},{id:"to_verify",labelKey:"toVerify",statuses:["to_verify"]},{id:"done",labelKey:"done",statuses:["done","closed"]}],ex={high:"bg-red-100 text-red-700",medium:"bg-yellow-100 text-yellow-700",low:"bg-blue-100 text-blue-700"};function em(e){let{projectUuid:s,initialTasks:t,currentUserUuid:h,initialSelectedTaskUuid:f}=e,b=(0,d.c)(),j=(0,Y.F7)(),k=(0,p.a)(),v=(0,n.useSearchParams)(),[y,N]=(0,r.useState)("kanban"),F="/projects/".concat(s,"/tasks"),{selectedId:C,openPanel:A,closePanel:E}=(0,g.T)(F,f),S=(0,r.useMemo)(()=>{let e=v.get("proposalUuids");if(!e)return null;let s=e.split(",").filter(Boolean);return s.length>0?new Set(s):null},[v]);(0,r.useEffect)(()=>{k&&"kanban"===y&&N("list")},[k]);let[U,P]=(0,r.useState)(!1),[B,L]=(0,r.useState)(0),[z,M]=(0,r.useState)("all"),T=(0,r.useMemo)(()=>{var e;return C&&null!=(e=t.find(e=>e.uuid===C))?e:null},[C,t]),K=(0,r.useCallback)(()=>{L(e=>e+1)},[]),O=(0,r.useMemo)(()=>S?t.filter(e=>e.proposalUuid&&S.has(e.proposalUuid)):t,[t,S]),V=(0,r.useMemo)(()=>{let e=eu.find(e=>e.id===z);return e&&0!==e.statuses.length?O.filter(s=>e.statuses.includes(s.status)):O},[O,z]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 overflow-x-auto",children:(0,a.jsx)(w,{projectUuid:s})}),(0,a.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1 rounded-lg bg-secondary p-1 w-fit",children:[k&&(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 rounded-md px-3 text-xs ".concat("list"===y?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>N("list"),children:[(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"}),b("tasks.listView")]}),!k&&(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 rounded-md px-3 text-xs ".concat("kanban"===y?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>N("kanban"),children:[(0,a.jsx)(l.A,{className:"h-3.5 w-3.5"}),b("tasks.kanbanView")]}),(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"h-8 gap-1.5 rounded-md px-3 text-xs ".concat("dag"===y?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>N("dag"),children:[(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),b("tasks.dagView")]})]}),j&&(0,a.jsxs)(u.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:()=>{E(),P(!0)},children:[(0,a.jsx)(c.A,{className:"mr-2 h-4 w-4"}),b("tasks.newTask")]})]}),"list"===y?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mb-4 flex gap-1 overflow-x-auto border-b border-border pb-2",children:eu.map(e=>{let s=0===e.statuses.length?O.length:O.filter(s=>e.statuses.includes(s.status)).length;return(0,a.jsxs)(u.$,{variant:"ghost",size:"sm",className:"h-8 shrink-0 rounded-md px-3 text-xs ".concat(z===e.id?"bg-secondary text-foreground font-medium":"text-muted-foreground hover:text-foreground"),onClick:()=>M(e.id),children:["all"===e.id?b("tasks.".concat(e.labelKey)):b("status.".concat(e.labelKey)),(0,a.jsx)("span",{className:"ml-1.5 rounded-full bg-card px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:s})]},e.id)})}),(0,a.jsx)("div",{className:"flex-1 space-y-2 overflow-y-auto",children:0===V.length?(0,a.jsx)(R.P.div,{initial:{opacity:0,scale:.98},animate:{opacity:1,scale:1},transition:{duration:.2,ease:[0,0,.2,1]},className:"flex h-24 items-center justify-center rounded-lg border-2 border-dashed border-border text-sm text-[#9A9A9A]",children:b("tasks.noTasks")}):V.map(e=>(0,a.jsxs)(m.Zp,{className:"cursor-pointer border-border bg-card p-4 transition-all hover:border-primary hover:shadow-sm",onClick:()=>A(e.uuid),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("h4",{className:"font-medium text-foreground truncate",children:e.title}),e.description&&(0,a.jsx)("p",{className:"mt-1 line-clamp-1 text-sm text-muted-foreground",children:e.description})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[null!=e.storyPoints&&e.storyPoints>0&&(0,a.jsxs)("span",{className:"rounded bg-[#FFF3E0] dark:bg-[#3a2a12] px-2 py-0.5 text-xs font-medium text-[#E65100] dark:text-[#F0A050]",children:[e.storyPoints,"h"]}),(0,a.jsx)(x.E,{className:ex[e.priority]||"",children:b("priority.".concat(e.priority))}),(0,a.jsx)(x.E,{className:eo[e.status]||"",children:b("status.".concat(ec[e.status]||e.status))})]})]}),e.assignee&&(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-[#9A9A9A]",children:[(0,_.bB)(e.assignee)&&(0,a.jsx)(D.AgentAvatar,{name:e.assignee.name,size:16,className:"shrink-0 rounded-full"}),(0,a.jsx)("span",{className:"truncate",children:e.assignee.name})]})]},e.uuid))}),T&&(0,a.jsx)(G.v,{task:T,projectUuid:s,currentUserUuid:h,onClose:E,onDependencyChange:K})]}):"kanban"===y?(0,a.jsx)(es,{projectUuid:s,initialTasks:O,currentUserUuid:h,selectedTaskUuid:C,onTaskSelect:A,onPanelClose:E,proposalUuidFilter:S}):(0,a.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,a.jsx)(el,{projectUuid:s,onTaskSelect:e=>A(e),refreshKey:B}),T&&(0,a.jsx)(G.v,{task:T,projectUuid:s,currentUserUuid:h,onClose:E,onDependencyChange:K})]}),U&&!T&&(0,a.jsx)(G.v,{task:null,projectUuid:s,currentUserUuid:h,onClose:()=>P(!1),onCreated:()=>P(!1)})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[36244],{3562:(e,t,n)=>{function r(e){let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let n=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),l=String(t.getMinutes()).padStart(2,"0");return"".concat(n,"-").concat(r,"-").concat(a," ").concat(o,":").concat(l)}function a(e,t){let n="string"==typeof e?new Date(e):e;return isNaN(n.getTime())?"":n.toLocaleDateString(t,{month:"short",day:"numeric"})}n.d(t,{r:()=>r,s:()=>a})},7685:(e,t,n)=>{n.d(t,{D:()=>i});var r=n(60200),a=n(48186),o=n(69351),l=n(26185);function i(e){let{entityType:t,entityUuid:n,subEntityType:l,subEntityUuid:i,children:c,badgeInside:u}=e,{getPresence:d}=(0,a.xQ)(),m=d(t,n,l,i),p=m.length>0,f=p&&m.some(e=>"mutate"===e.action),h=p?f?m.find(e=>"mutate"===e.action):m[m.length-1]:null,x=h?(0,o.j)(h.agentName):"transparent";return(0,r.jsxs)("div",{className:"relative",style:p?{outline:"2px ".concat(f?"solid":"dashed"," ").concat(x),outlineOffset:"-2px",borderRadius:"var(--radius)"}:void 0,children:[p&&(0,r.jsxs)("div",{className:"absolute flex gap-1 z-10 justify-end ".concat(u?"top-0.5 right-1.5 max-w-[70%]":"-top-2.5 right-2 max-w-[80%]"),children:[m.slice(0,3).map(e=>(0,r.jsx)(s,{entry:e},e.agentUuid)),m.length>3&&(0,r.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-medium text-white bg-gray-500 whitespace-nowrap",children:["+",m.length-3]})]}),c]})}function s(e){let{entry:t}=e,n=(0,o.j)(t.agentName);return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[10px] font-medium text-white whitespace-nowrap animate-in fade-in duration-300 ease-out sm:text-[11px] sm:px-2",style:{backgroundColor:n},children:[(0,r.jsx)(l.AgentAvatar,{name:t.agentName,size:14,className:"rounded-full"}),t.agentName]})}},36244:(e,t,n)=>{n.d(t,{$m:()=>eo});var r=n(60200),a=n(81476),o=n(25588),l=n(43322),i=n(28201),s=n(20699),c=n(99226),u=n(29402),d=n(15291),m=n(14006),p=n(40058),f=n(62925),h=n(26185),x=n(73057),g=n(36974),v=n(74308),w=n(49417),y=n(43664),b=n(76753);function C(e){var t;if(!e)return{pinnedHost:null,pinnedCwd:null};let n=new URLSearchParams(e),r=n.has("cwd"),a=n.has("host");if(!r&&!a)return{pinnedHost:null,pinnedCwd:null};let o=null!=(t=n.get("cwd"))?t:"",l=n.get("host"),i={pinnedCwd:r&&""!==o?o:null,pinnedHost:a?null!=l?l:"":null};return"1"===n.get("runtime")&&(i.runtimeCwd=!0),i}function j(e,t,n,r,a){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];return"@[".concat(e,"](").concat(t,":").concat(n).concat(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null==e&&null==t)return"";let r=e=>encodeURIComponent(e).replace(/\(/g,"%28").replace(/\)/g,"%29"),a=[];return a.push("cwd=".concat(null==t?"":r(t))),null!=e&&a.push("host=".concat(r(e))),n&&a.push("runtime=1"),"?".concat(a.join("&"))}(r,a,o),")")}var N=n(63123),E=n(67566);let k=v.A.extend({addAttributes(){var e;return{...null==(e=this.parent)?void 0:e.call(this),mentionType:{default:"user",parseHTML:e=>e.getAttribute("data-mention-type")||"user",renderHTML:e=>({"data-mention-type":e.mentionType||"user"})},pinnedHost:{default:null,parseHTML:e=>e.getAttribute("data-pinned-host"),renderHTML:e=>null==e.pinnedHost?{}:{"data-pinned-host":String(e.pinnedHost)}},pinnedCwd:{default:null,parseHTML:e=>e.getAttribute("data-pinned-cwd"),renderHTML:e=>null==e.pinnedCwd?{}:{"data-pinned-cwd":String(e.pinnedCwd)}},runtimeCwd:{default:!1,parseHTML:e=>"true"===e.getAttribute("data-runtime-cwd"),renderHTML:e=>e.runtimeCwd?{"data-runtime-cwd":"true"}:{}}}}});function A(e){let t=e.getJSON();return t.content?t.content.map(e=>(function e(t){if("mention"===t.type){let e=t.attrs;if(e){var n,r;return j(e.label||e.id,e.mentionType||"user",e.id,null!=(n=e.pinnedHost)?n:null,null!=(r=e.pinnedCwd)?r:null,!0===e.runtimeCwd)}return""}if("text"===t.type)return t.text||"";if("hardBreak"===t.type)return"\n";let a=t.content;return a?a.map(e).join(""):""})(e)).join("\n"):""}function R(e){if(!e)return{type:"doc",content:[{type:"paragraph"}]};let t=/@\[([^\]]+)\]\((user|agent):([a-f0-9-]+)(?:\?([^)]*))?\)/g;return{type:"doc",content:e.split("\n").map(e=>{let n,r=[],a=0,o=RegExp(t.source,"g");for(;null!==(n=o.exec(e));){n.index>a&&r.push({type:"text",text:e.slice(a,n.index)});let{pinnedHost:t,pinnedCwd:o,runtimeCwd:l}=C(n[4]);r.push({type:"mention",attrs:{id:n[3],label:n[1],mentionType:n[2],pinnedHost:t,pinnedCwd:o,runtimeCwd:!0===l}}),a=n.index+n[0].length}return a<e.length&&r.push({type:"text",text:e.slice(a)}),{type:"paragraph",content:r.length>0?r:void 0}})}}function S(e,t,n,r,a,o,l){if(a.innerHTML="",t){let e=document.createElement("div");e.className="flex items-center justify-center py-3 px-4",e.innerHTML='<div class="h-4 w-4 animate-spin rounded-full border-2 border-[#9A9A9A] border-t-transparent"></div>',a.appendChild(e);return}if(0===e.length){let e=document.createElement("div");e.className="py-2 px-3 text-xs text-muted-foreground",e.textContent="No results",a.appendChild(e);return}let i=document.createElement("div");i.className="py-1";let s=0,c=e=>{if(l)return void l(e,n);n({id:e.uuid,label:e.name,mentionType:e.type})},u=()=>{i.innerHTML="",e.forEach((e,t)=>{let n=document.createElement("button");n.type="button",n.className="flex w-full items-center gap-2.5 px-3 py-1.5 text-left text-sm transition-colors ".concat(t===s?"bg-background text-foreground":"text-muted-foreground hover:bg-background"),n.onclick=()=>c(e);let r=document.createElement("div");if(r.className="relative shrink-0","agent"===e.type){let t="function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,n=(0,h.Pf)(e.name,t?"static":"animated");if(n){let t=document.createElement("div");t.className="h-6 w-6 overflow-hidden rounded-full bg-muted";let a=document.createElement("img");a.src=n,a.alt=e.name,a.draggable=!1,a.className="h-full w-full origin-top scale-[1.5] -translate-y-[10%]",t.appendChild(a),r.appendChild(t)}else{let e=document.createElement("div");e.className="flex h-6 w-6 items-center justify-center rounded-full bg-primary text-white",e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2"/><path d="M20 14h2"/><path d="M15 13v2"/><path d="M9 13v2"/></svg>',r.appendChild(e)}}else{let e=document.createElement("div");e.className="flex h-6 w-6 items-center justify-center rounded-full bg-border text-muted-foreground",e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/></svg>',r.appendChild(e)}if("agent"===e.type&&e.online){let e=document.createElement("span");e.className="absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full bg-[#22C55E] ring-2 ring-white",e.title=o.online,r.appendChild(e)}let a=document.createElement("div");a.className="min-w-0 flex-1";let l=document.createElement("div");if(l.className="truncate text-xs font-medium",l.textContent=e.name,a.appendChild(l),e.email){let t=document.createElement("div");t.className="truncate text-[10px] text-muted-foreground",t.textContent=e.email,a.appendChild(t)}if("agent"===e.type&&e.online){var u;let t=null!=(u=e.activeCount)?u:0,n=document.createElement("div");t>0?(n.className="mt-0.5 truncate text-[10px] font-medium text-[#15803D] dark:text-[#4FD07A]",n.textContent="▶ ".concat(o.activeCount(t))):(n.className="mt-0.5 truncate text-[10px] text-muted-foreground",n.textContent=o.idle),a.appendChild(n)}n.appendChild(r),n.appendChild(a),i.appendChild(n)})};u(),a.appendChild(i),r.current={onKeyDown:t=>{let{event:n}=t;return!(0,b.P)(n)&&("ArrowUp"===n.key?(s=s<=0?e.length-1:s-1,u(),!0):"ArrowDown"===n.key?(s=s>=e.length-1?0:s+1,u(),!0):"Enter"===n.key?(e[s]&&c(e[s]),!0):"Escape"===n.key)}}}function M(e){var t;let{open:n,agentName:l,instances:i,onConfirm:s,onCancel:c}=e,u=(0,o.c)("mentionInstance"),[d,m]=(0,a.useState)(null);(0,a.useEffect)(()=>{var e;n&&m(null!=(e=i[0])?e:null)},[n,i]);let f=new Set(i.map(e=>e.host)).size;return(0,r.jsx)(E.lG,{open:n,onOpenChange:e=>{e||c()},children:(0,r.jsxs)(E.Cf,{className:"z-[110] flex max-h-[85svh] flex-col gap-0 sm:max-w-md",overlayClassName:"z-[110]",children:[(0,r.jsxs)(E.c7,{className:"shrink-0",children:[(0,r.jsx)(E.L3,{children:u("title")}),(0,r.jsx)(E.rr,{children:u("subtitle",{name:l,count:i.length,hosts:f})})]}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto py-3",onKeyDown:e=>{!("Enter"!==e.key||(0,b.P)(e))&&d&&(e.preventDefault(),s(d))},children:(0,r.jsx)(N.O,{instances:i,selectedConnectionUuid:null!=(t=null==d?void 0:d.connectionUuid)?t:null,onSelect:m,ariaLabel:u("title")})}),(0,r.jsxs)(E.Es,{className:"shrink-0",children:[(0,r.jsx)(p.$,{variant:"ghost",onClick:c,children:u("cancel")}),(0,r.jsx)(p.$,{disabled:!d,onClick:()=>{d&&s(d)},children:u("confirm")})]})]})})}let T=(0,a.forwardRef)((e,t)=>{var n,l;let{value:i,onChange:s,placeholder:c,className:u,disabled:d,onSubmit:m,entityType:p,entityUuid:f}=e,h=(0,a.useRef)([]),v=(0,a.useRef)(!1),C=(0,a.useRef)(null),N=(0,a.useRef)(null),E=(0,a.useRef)(null),T=(0,a.useRef)(null),[,D]=(0,a.useState)(0),_=(0,a.useRef)(!1),U=(0,o.c)("mention"),H=(0,a.useRef)({online:"",offline:"",idle:"",activeCount:()=>""});H.current={online:U("online"),offline:U("offline"),idle:U("idle"),activeCount:e=>U("activeCount",{count:e})};let F=(0,a.useCallback)((e,t)=>{let n="/api/mentionables?q=".concat(encodeURIComponent(e),"&limit=").concat(t,"&withInstances=1");return p&&f&&(n+="&entityType=".concat(encodeURIComponent(p),"&entityUuid=").concat(encodeURIComponent(f))),n},[p,f]),L=function(e,t){let n=(0,a.useRef)(null),r=(0,a.useRef)(e);r.current=e;let o=(0,a.useCallback)(e=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>r.current(e),250)},[250]);return(0,a.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),o}((0,a.useCallback)(async e=>{v.current=!0,D(e=>e+1);try{let t=await fetch(F(e,10));if(t.ok){let e=await t.json();e.success&&(h.current=e.data)}}catch(e){h.current=[]}finally{v.current=!1,D(e=>e+1)}},[F]),250),[z,I]=(0,a.useState)(null),O=(0,a.useCallback)((e,t,n)=>{t({id:e.uuid,label:e.name,mentionType:e.type,pinnedHost:n?n.host:null,pinnedCwd:n?n.cwd:null,runtimeCwd:(null==n?void 0:n.runtimeCwd)===!0})},[]),$=(0,a.useRef)(()=>{});$.current=(e,t)=>{var n;let r=function(e){var t;if("agent"===e.type&&e.projectFixedCwd)return{kind:"insert",pin:{host:e.projectFixedCwd.host,cwd:e.projectFixedCwd.cwd,runtimeCwd:!0}};if(e.isIdeaAssignee&&e.ideaPin)return{kind:"insert",pin:{host:e.ideaPin.host,cwd:e.ideaPin.cwd}};let n="agent"===e.type?(null!=(t=e.instances)?t:[]).filter(e=>"online"===e.effectiveStatus):[];return n.length>=2?{kind:"pick",onlineInstances:n}:1===n.length?{kind:"insert",pin:n[0]}:{kind:"insert",pin:null}}(e);if("pick"===r.kind)return void I({item:e,onlineInstances:r.onlineInstances,command:t});O(e,t,null!=(n=r.pin)?n:void 0)};let P=(0,a.useCallback)((e,t)=>$.current(e,t),[]);(0,a.useEffect)(()=>{E.current&&T.current&&S(h.current,v.current,T.current,C,E.current,H.current,P)});let B=(0,x.hG)({immediatelyRender:!1,extensions:[g.A.configure({heading:!1,blockquote:!1,codeBlock:!1,bulletList:!1,orderedList:!1,listItem:!1,horizontalRule:!1}),k.configure({HTMLAttributes:{class:"text-blue-600 font-medium"},renderText(e){var t;let{node:n}=e;return"@".concat(null!=(t=n.attrs.label)?t:n.attrs.id)},suggestion:{char:"@",allowSpaces:!0,items:e=>{let{query:t}=e;return L(t),h.current},render:()=>({onStart:e=>{var t;let n=document.createElement("div");if(n.className="z-[100] rounded-md border border-border bg-card shadow-md min-w-[200px] max-w-[300px] overflow-hidden",E.current=n,T.current=e.command,e.clientRect){let t="function"==typeof e.clientRect?e.clientRect():e.clientRect;t&&(n.style.position="fixed",n.style.left="".concat(t.left,"px"),window.innerHeight-t.bottom<220?n.style.bottom="".concat(window.innerHeight-t.top+4,"px"):n.style.top="".concat(t.bottom+4,"px"))}(null!=(t=N.current)?t:document.body).appendChild(n),S(h.current,v.current,e.command,C,n,H.current,P)},onUpdate:e=>{if(T.current=e.command,E.current&&e.clientRect){let t="function"==typeof e.clientRect?e.clientRect():e.clientRect;t&&(E.current.style.left="".concat(t.left,"px"),window.innerHeight-t.bottom<220?(E.current.style.top="",E.current.style.bottom="".concat(window.innerHeight-t.top+4,"px")):(E.current.style.bottom="",E.current.style.top="".concat(t.bottom+4,"px")))}E.current&&S(h.current,v.current,e.command,C,E.current,H.current,P)},onKeyDown:e=>!!C.current&&C.current.onKeyDown(e),onExit:()=>{var e;null==(e=E.current)||e.remove(),E.current=null,T.current=null,h.current=[],v.current=!1}})}})],content:R(i),editable:!d,editorProps:{attributes:{class:(0,w.cn)("mobile-input-text","min-h-[36px] max-h-[120px] overflow-y-auto px-3 py-2 text-sm outline-none","prose prose-sm max-w-none [&_p]:my-0"),"data-placeholder":c||""},handleKeyDown:(e,t)=>!(0,b.P)(t)&&"Enter"===t.key&&!t.shiftKey&&!E.current&&!!m&&(t.preventDefault(),m(),!0)},onUpdate:e=>{let{editor:t}=e;_.current=!0,s(A(t))}});(0,a.useEffect)(()=>{if(!B||_.current){_.current=!1;return}A(B)!==i&&B.commands.setContent(R(i))},[i,B]),(0,a.useEffect)(()=>{B&&B.setEditable(!d)},[d,B]);let q=(0,a.useCallback)(e=>{var t;if(!B)return;let n=null!==e.pinnedHost||null!==e.pinnedCwd?{host:null!=(t=e.pinnedHost)?t:"",cwd:e.pinnedCwd,runtimeCwd:!0===e.runtimeCwd}:null,r=function(e,t){var n,r;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=t.type.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=t.uuid.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(RegExp("@\\[[^\\]]+\\]\\(".concat(o,":").concat(l,"(?:\\?[^)]*)?\\)\\s*$"),"i").test(e))return{value:e,appended:!1};let i=j(t.name,t.type,t.uuid,null!=(n=null==a?void 0:a.host)?n:null,null!=(r=null==a?void 0:a.cwd)?r:null,(null==a?void 0:a.runtimeCwd)===!0),s=e.length>0&&!/\s$/.test(e)?" ":"";return{value:"".concat(e).concat(s).concat(i," "),appended:!0}}(A(B),{type:e.mentionType,uuid:e.id,name:e.label},n);r.appended&&B.commands.setContent(R(r.value)),B.commands.focus("end")},[B]),G=(0,a.useCallback)(async e=>{let t=e;if("agent"===e.type){let n=await fetch(F(e.name,50));if(!n.ok)throw Error("Failed to load Agent mention routing");let r=await n.json();if(!r.success||!Array.isArray(r.data))throw Error("Invalid Agent mention routing response");t=function(e,t){let n=t.find(t=>t.type===e.type&&t.uuid===e.uuid);if(!n)throw Error("Reply author is unavailable for mention routing");return n}(e,r.data)}$.current(t,e=>{q(e)})},[F,q]);return(0,a.useImperativeHandle)(t,()=>({focus:()=>null==B?void 0:B.commands.focus(),clear:()=>{null==B||B.commands.clearContent(),s("")},replyToAuthor:G}),[B,s,G]),(0,r.jsxs)("div",{ref:N,className:(0,w.cn)("relative rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow]","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]",d&&"cursor-not-allowed opacity-50",u),children:[(0,r.jsx)(x.$Z,{editor:B}),(0,r.jsx)(M,{open:null!==z,agentName:null!=(n=null==z?void 0:z.item.name)?n:"",instances:null!=(l=null==z?void 0:z.onlineInstances)?l:[],onConfirm:e=>{!function(e,t,n){n.close(),e&&n.defer(()=>{try{n.focusEditor(),n.insert(e,t)}catch(e){n.onError(e)}})}(z,e,{close:()=>I(null),insert:(e,t)=>O(e.item,e.command,t),defer:e=>requestAnimationFrame(e),focusEditor:()=>null==B?void 0:B.commands.focus(),onError:e=>y.q.error("MentionEditor: cwd-pinned mention insert failed",e)})},onCancel:()=>I(null)}),(0,r.jsx)("style",{children:"\n .tiptap p.is-editor-empty:first-child::before {\n content: attr(data-placeholder);\n color: #9A9A9A;\n float: left;\n height: 0;\n pointer-events: none;\n }\n .tiptap .mention {\n color: #2563eb;\n font-weight: 500;\n }\n "})]})});T.displayName="MentionEditor";var D=n(75773),_=n(42885);let U=(0,_.createServerReference)("704cbe83a589f3d87cbd4e773e72cec60487dc9c2d",_.callServer,void 0,_.findSourceMapURL,"createCommentAction"),H=(0,_.createServerReference)("40080661c8dc0adb35502f407b7a9b46cd4bd72398",_.callServer,void 0,_.findSourceMapURL,"deleteCommentAction");var F=n(64035);let L=/@\[([^\]]+)\]\((user|agent):([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\?([^)]*))?\)/gi,z=/\u200B\u200BMENTION_(\d+)\u200B\u200B/g,I="chorus-mention";function O(e){let{children:t,renderMention:n}=e;if(!t||"string"!=typeof t)return null;if(!new RegExp(L.source,L.flags.replace("g","")).test(t))return(0,r.jsx)("div",{className:"overflow-hidden [&_pre]:overflow-x-auto",children:(0,r.jsx)(F.MarkdownContent,{children:t})});if(n)return(0,r.jsx)($,{renderMention:n,children:t});let{processed:a,mentions:o}=function(e){let t=[],n=new RegExp(L.source,L.flags);return{processed:e.replace(n,(e,n,r,a,o)=>{let l=t.length,{pinnedHost:i,pinnedCwd:s,runtimeCwd:c}=C(o),u={displayName:n,type:r,uuid:a};return(null!==i||null!==s)&&(u.pinnedHost=i,u.pinnedCwd=s,c&&(u.runtimeCwd=!0)),t.push(u),"".concat("MENTION_").concat(l).concat("")}),mentions:t}}(t);return(0,r.jsx)(P,{mentions:o,children:(0,r.jsx)(F.MarkdownContent,{children:a})})}function $(e){let{children:t,renderMention:n}=e,{processed:o,mentions:l}=a.useMemo(()=>(function(e){let t=[],n=new RegExp(L.source,L.flags);return{processed:e.replace(n,(e,n,r,a,o)=>{let l=t.length,{pinnedHost:i,pinnedCwd:s,runtimeCwd:c}=C(o),u={type:r.toLowerCase(),uuid:a.toLowerCase(),displayName:n};(null!==i||null!==s)&&(u.pinnedHost=i,u.pinnedCwd=s,c&&(u.runtimeCwd=!0)),t.push(u);let d="@".concat(n).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");return"<".concat(I," ").concat("idx",'="').concat(l,'">').concat(d,"</").concat(I,">")}),mentions:t}})(t),[t]),i=a.useMemo(()=>({[I]:e=>{let{idx:t}=e,a=void 0===t?NaN:parseInt(t,10),o=Number.isInteger(a)?l[a]:void 0;return o?(0,r.jsx)(r.Fragment,{children:n({...o,index:a})}):null}}),[l,n]);return(0,r.jsx)("div",{className:"overflow-hidden [&_pre]:overflow-x-auto",children:(0,r.jsx)(F.MarkdownContent,{components:i,allowedTags:{[I]:["idx"]},literalTagContent:[I],children:o})})}function P(e){let{children:t,mentions:n}=e,o=a.useRef(null);return a.useEffect(()=>{let e;if(!o.current||0===n.length)return;let t=document.createTreeWalker(o.current,NodeFilter.SHOW_TEXT,null),r=[];for(;e=t.nextNode();)z.test(e.textContent||"")&&r.push(e),z.lastIndex=0;for(let e of r){var a;let t,r=e.textContent||"",o=document.createDocumentFragment(),l=0,i=RegExp(z.source,"g");for(;null!==(t=i.exec(r));){t.index>l&&o.appendChild(document.createTextNode(r.slice(l,t.index)));let e=n[parseInt(t[1],10)];if(e){let t=document.createElement("span");t.className="text-blue-600 font-medium",t.title="".concat(e.type,": ").concat(e.uuid),t.textContent="@".concat(e.displayName),o.appendChild(t)}else o.appendChild(document.createTextNode(t[0]));l=t.index+t[0].length}l<r.length&&o.appendChild(document.createTextNode(r.slice(l))),null==(a=e.parentNode)||a.replaceChild(o,e)}},[n]),(0,r.jsx)("div",{ref:o,className:"overflow-hidden [&_pre]:overflow-x-auto",children:t})}var B=n(16198),q=n(38060),G=n(69189),K=n(7685),Q=n(69351),W=n(3562),J=n(99736),V=n(56791),Z=n(42731),X=n(2745);let Y="(max-width: 639px)";function ee(e){var t;if(!window.matchMedia)return()=>{};let n=window.matchMedia(Y);return null==(t=n.addEventListener)||t.call(n,"change",e),()=>{var t;return null==(t=n.removeEventListener)?void 0:t.call(n,"change",e)}}function et(){var e,t;return!!(null==(e=(t=window).matchMedia)?void 0:e.call(t,Y).matches)}function en(e){return"agent"===e.type?(0,r.jsx)(B.Gm,{mention:e,displayName:e.displayName},e.index):(0,r.jsxs)("span",{className:"text-blue-600 font-medium",title:"".concat(e.type,": ").concat(e.uuid),children:["@",e.displayName]},e.index)}function er(e,t){let n=new Map;for(let t of e)n.set(t.uuid,t);for(let e of t)n.set(e.uuid,e);return[...n.values()].sort((e,t)=>e.createdAt!==t.createdAt?e.createdAt<t.createdAt?1:-1:e.uuid<t.uuid?1:-1)}async function ea(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=new Set(e.map(e=>e.uuid)),a=[],o=null,l=!1,i=0,s=!1,c=null,u=!1;for(let e=0;e<n;e++){let e=await t(o);if(!e)break;if(u=!0,i=e.total,a.push(...e.comments),s=e.hasMore,c=e.nextCursor,e.comments.some(e=>r.has(e.uuid))||!e.hasMore){l=!0;break}o=e.nextCursor}return u?l?{comments:er(e,a),total:i,contiguous:!0,resetOldestCursor:null,resetHasMore:!1}:{comments:er([],a),total:i,contiguous:!1,resetOldestCursor:c,resetHasMore:s}:null}function eo(e){let{targetType:t,targetUuid:n,currentUserUuid:u,onCountChange:d,compact:m=!1}=e,h=(0,o.c)(),x=(0,G.F7)(),[g,v]=(0,a.useState)(""),[w,y]=(0,a.useState)([]),[b,C]=(0,a.useState)(!0),[j,N]=(0,a.useState)(null),[E,k]=(0,a.useState)(!1),[A,R]=(0,a.useState)(!1),[S,M]=(0,a.useState)(null),[_,F]=(0,a.useState)(!1),[L,z]=(0,a.useState)(0),I=(0,a.useRef)(null),O=(0,a.useRef)(null),$=(0,a.useRef)(new Set),P=(0,a.useRef)(new Set),B=(0,a.useRef)(w);B.current=w;let Q=(0,a.useRef)(S);Q.current=S;let W=(0,a.useRef)(_);W.current=_;let V=(0,a.useRef)(E);V.current=E;let Z=(0,a.useRef)(b);Z.current=b;let X=m?"h-6 w-6":"h-[30px] w-[30px]",Y=m?"gap-2":"gap-2.5";(0,a.useEffect)(()=>{null==d||d(L)},[L,d]);let ee=(0,a.useCallback)(async()=>{C(!0),N(null);let e=await (0,D.d)(t,n,{limit:10});e.success?(y(e.comments),M(e.nextCursor),F(e.hasMore),z(e.total)):N(e.error),C(!1)},[t,n]);(0,a.useEffect)(()=>{ee()},[ee]);let et=(0,a.useCallback)(async()=>{if(V.current||Z.current||!W.current||!Q.current)return;k(!0);let e=await (0,D.d)(t,n,{cursor:Q.current,limit:10});e.success&&(y(t=>er(t,e.comments)),M(e.nextCursor),F(e.hasMore),z(e.total)),k(!1)},[t,n]);(0,a.useEffect)(()=>{let e=O.current;if(!e)return;let t=new IntersectionObserver(e=>{var t;(null==(t=e[0])?void 0:t.isIntersecting)&&et()},{rootMargin:"120px"});return t.observe(e),()=>t.disconnect()},[et,b]),(0,q.w0)(t,n,e=>{u&&e.actorUuid===u||ea(B.current,async e=>{let r=await (0,D.d)(t,n,{cursor:e,limit:10});return r.success?r:null}).then(e=>{e&&(y(e.comments),z(e.total),e.contiguous||(M(e.resetOldestCursor),F(e.resetHasMore)))})});let en=async()=>{if(!g.trim()||A)return;R(!0);let e=await U(t,n,g);if(R(!1),e.success){var r;let t=!B.current.some(t=>t.uuid===e.comment.uuid);y(t=>er(t,[e.comment])),t&&z(e=>e+1),v(""),null==(r=I.current)||r.clear()}else J.oR.error(e.error)},eo=(0,a.useCallback)(e=>{var t;null==(t=I.current)||t.replyToAuthor(e).catch(()=>{J.oR.error(h("comments.replyFailed"))})},[h]),el=(0,a.useCallback)(async e=>{if(P.current.has(e))return!0;if($.current.has(e))return!1;$.current.add(e);try{if(!(await H(e)).success)return J.oR.error(h("comments.deleteFailed")),!1;if(P.current.add(e),B.current.some(t=>t.uuid===e)){let t=B.current.filter(t=>t.uuid!==e);B.current=t,y(t),z(e=>Math.max(0,e-1))}return!0}finally{$.current.delete(e)}},[h]);return(0,r.jsx)(K.D,{entityType:t,entityUuid:n,subEntityType:"comment",children:(0,r.jsxs)("div",{className:"flex flex-col gap-0",children:[x?(0,r.jsxs)("div",{className:"flex items-center ".concat(Y," pb-3 border-b border-[#F0EDE8] dark:border-[#26241f]"),children:[(0,r.jsx)(f.eu,{className:"".concat(m?"h-6 w-6":"h-7 w-7"," shrink-0"),children:(0,r.jsx)(f.q5,{className:"bg-border text-muted-foreground",children:(0,r.jsx)(l.A,{className:"".concat(m?"h-3 w-3":"h-3.5 w-3.5")})})}),(0,r.jsx)("div",{className:"flex-1 min-w-0",children:(0,r.jsx)(T,{ref:I,value:g,onChange:v,onSubmit:en,placeholder:h("comments.addComment"),className:"border border-border bg-card text-sm rounded-lg",disabled:A,entityType:t,entityUuid:n})}),(0,r.jsx)(p.$,{size:"sm",className:"shrink-0 gap-1 bg-[#E07A5F] text-white hover:bg-[#D06A4F]",disabled:!g.trim()||A,onClick:en,children:A?(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(s.A,{className:"h-3.5 w-3.5"})})]}):(0,r.jsx)("p",{"data-testid":"comments-read-only",className:"pb-3 text-xs text-muted-foreground border-b border-[#F0EDE8] dark:border-[#26241f]",children:h("projectAccess.commentsReadOnly")}),b?(0,r.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,r.jsx)(i.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):j?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 text-sm text-muted-foreground",children:[(0,r.jsx)(c.A,{className:"h-4 w-4"}),(0,r.jsx)("p",{children:h("comments.loadError")}),(0,r.jsx)(p.$,{variant:"outline",size:"sm",onClick:ee,children:h("comments.retry")})]}):0===w.length?(0,r.jsx)("p",{className:"py-8 text-center text-sm text-muted-foreground italic",children:h("comments.noComments")}):(0,r.jsxs)("div",{children:[w.map(e=>(0,r.jsx)(ei,{comment:e,compact:m,avatarSize:X,gap:Y,t:h,currentUserUuid:u,canComment:x,onReply:eo,onDelete:el},e.uuid)),(0,r.jsx)("div",{ref:O,"aria-hidden":"true"}),E?(0,r.jsxs)("div",{className:"flex items-center justify-center py-4",children:[(0,r.jsx)(i.A,{className:"h-4 w-4 animate-spin text-muted-foreground"}),(0,r.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:h("comments.loadingMore")})]}):!_&&(0,r.jsx)("p",{className:"py-4 text-center text-xs text-muted-foreground italic",children:h("comments.noMoreComments")})]})]})})}function el(e){let{author:t,canDelete:n,t:o,onReply:l,onDelete:s}=e,c=(0,a.useSyncExternalStore)(ee,et,()=>!1),[f,h]=(0,a.useState)(!1),[x,g]=(0,a.useState)(!1),[v,w]=(0,a.useState)(!1),y=(0,a.useRef)(null),b=(0,a.useRef)(!1),C=e=>{if(e.preventDefault(),!b.current){var t;null==(t=y.current)||t.focus()}b.current=!1},j=e=>{b.current=!0,h(!1);let t=()=>e();"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(t):window.setTimeout(t,0)},N=(0,r.jsx)(p.$,{ref:y,type:"button",variant:"ghost",size:"icon",className:"relative -my-1 size-6 shrink-0 rounded-md text-muted-foreground hover:bg-accent hover:text-foreground before:absolute before:-inset-2.5 before:content-[''] sm:before:hidden","aria-label":o("comments.actionsLabel",{name:t.name}),children:(0,r.jsx)(u.A,{className:"size-4","aria-hidden":!0})}),E=()=>j(l),k=()=>j(()=>g(!0));return(0,r.jsxs)(r.Fragment,{children:[c?(0,r.jsxs)(Z.cj,{open:f,onOpenChange:h,children:[(0,r.jsx)(Z.CG,{asChild:!0,children:N}),(0,r.jsxs)(Z.h,{side:"bottom","data-comment-actions-variant":"mobile",className:"max-h-[min(82svh,32rem)] gap-0 overflow-hidden rounded-t-2xl pb-[max(1rem,env(safe-area-inset-bottom))]",onCloseAutoFocus:C,children:[(0,r.jsx)("div",{className:"mx-auto mt-2 h-1 w-10 shrink-0 rounded-full bg-muted-foreground/25","aria-hidden":!0}),(0,r.jsxs)(Z.Fm,{className:"border-b px-4 pt-3 pb-3 text-left",children:[(0,r.jsx)(Z.qp,{children:o("comments.actionsTitle")}),(0,r.jsx)(Z.Qs,{children:o("comments.actionsDescription",{name:t.name})})]}),(0,r.jsxs)("div",{className:"overflow-y-auto overscroll-contain px-2 py-2",children:[(0,r.jsxs)(p.$,{type:"button",variant:"ghost",className:"min-h-11 w-full justify-start gap-3 rounded-lg px-3 text-sm",onClick:E,children:[(0,r.jsx)(d.A,{className:"size-5","aria-hidden":!0}),o("comments.reply")]}),n&&(0,r.jsx)("div",{className:"mt-1 border-t pt-1",children:(0,r.jsxs)(p.$,{type:"button",variant:"ghost",className:"min-h-11 w-full justify-start gap-3 rounded-lg px-3 text-sm text-destructive hover:bg-destructive/10 hover:text-destructive focus-visible:text-destructive",onClick:k,children:[(0,r.jsx)(m.A,{className:"size-5","aria-hidden":!0}),o("comments.delete")]})})]})]})]}):(0,r.jsxs)(V.rI,{open:f,onOpenChange:h,children:[(0,r.jsx)(V.ty,{asChild:!0,children:N}),(0,r.jsxs)(V.SQ,{align:"end","data-comment-actions-variant":"desktop",className:"z-[100] w-44",onCloseAutoFocus:C,children:[(0,r.jsxs)(V._2,{onSelect:E,children:[(0,r.jsx)(d.A,{"aria-hidden":!0}),o("comments.reply")]}),n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(V.mB,{}),(0,r.jsxs)(V._2,{variant:"destructive",onSelect:k,children:[(0,r.jsx)(m.A,{"aria-hidden":!0}),o("comments.delete")]})]})]})]}),(0,r.jsx)(X.Lt,{open:x,onOpenChange:e=>{v||g(e)},children:(0,r.jsxs)(X.EO,{className:"z-[120]",overlayClassName:"z-[120]",onCloseAutoFocus:e=>{var t;e.preventDefault(),null==(t=y.current)||t.focus()},children:[(0,r.jsxs)(X.wd,{children:[(0,r.jsx)(X.r7,{children:o("comments.deleteTitle")}),(0,r.jsx)(X.$v,{children:o("comments.deleteDescription")})]}),(0,r.jsxs)(X.ck,{children:[(0,r.jsx)(X.Zr,{disabled:v,children:o("common.cancel")}),(0,r.jsxs)(X.Rx,{variant:"destructive",disabled:v,onClick:async e=>{e.preventDefault(),w(!0);let t=await s();w(!1),t&&g(!1)},children:[v&&(0,r.jsx)(i.A,{className:"animate-spin","aria-hidden":!0}),o("comments.deleteConfirm")]})]})]})})]})}function ei(e){var t;let{comment:n,compact:o,avatarSize:l,gap:i,t:s,currentUserUuid:c,canComment:u=!0,onReply:d,onDelete:m}=e,[x,g]=(0,a.useState)(!1),v="agent"===n.author.type,w=!!c&&("user"===n.author.type&&n.author.uuid===c||"agent"===n.author.type&&(null==(t=n.author.owner)?void 0:t.uuid)===c),y=v?(0,Q.j)(n.author.name):null,b=n.content.length>200,C=y?"".concat(y,"18"):void 0;return(0,r.jsxs)("div",{className:"flex ".concat(i," py-3 border-b border-[#F0EDE8] dark:border-[#26241f] last:border-b-0"),children:[v?(0,r.jsx)(h.AgentAvatar,{name:n.author.name,size:o?24:30,className:"shrink-0 rounded-full"}):(0,r.jsx)(f.eu,{className:"".concat(l," shrink-0"),children:(0,r.jsx)(f.q5,{className:"bg-border text-muted-foreground text-[11px] font-medium",children:n.author.name.charAt(0).toUpperCase()})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-1.5",children:[(0,r.jsx)("span",{className:"".concat(o?"text-xs":"text-[13px]"," font-semibold text-[#1A1A1A] dark:text-[#CFCFCF]"),children:n.author.name}),(0,r.jsx)("span",{style:v?{backgroundColor:C,color:null!=y?y:void 0}:void 0,className:"inline-flex items-center rounded px-1.5 py-px text-[9px] font-medium ".concat(v?"":"bg-[#F0EDE8] dark:bg-[#1f1e1c] text-muted-foreground"),children:s(v?"comments.roleAgent":"comments.roleHuman")}),(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground",children:function(e,t){let n=new Date(e),r=new Date().getTime()-n.getTime(),a=Math.floor(r/6e4),o=Math.floor(r/36e5),l=Math.floor(r/864e5);return a<1?t("time.justNow"):a<60?t("time.minutesAgo",{minutes:a}):o<24?t("time.hoursAgo",{hours:o}):l<7?t("time.daysAgo",{days:l}):(0,W.r)(n)}(n.createdAt,s)})]}),u&&(0,r.jsx)(el,{author:{type:v?"agent":"user",uuid:n.author.uuid,name:n.author.name},canDelete:w,t:s,onReply:()=>d({type:v?"agent":"user",uuid:n.author.uuid,name:n.author.name}),onDelete:()=>m(n.uuid)})]}),v&&n.author.owner&&(0,r.jsx)("div",{className:"flex items-center gap-1 mt-0.5",children:(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground italic",children:s("comments.onBehalfOf",{name:n.author.owner.name})})}),(0,r.jsx)("div",{className:"mt-1 ".concat(o?"text-xs":"text-[13px]"," leading-relaxed text-[#3D3D3D] dark:text-[#d8d2ca] max-w-none [&_h1]:text-sm [&_h1]:font-semibold [&_h1]:mt-2 [&_h1]:mb-1 [&_h2]:text-[13px] [&_h2]:font-semibold [&_h2]:mt-2 [&_h2]:mb-1 [&_h3]:text-[13px] [&_h3]:font-semibold [&_h3]:mt-1.5 [&_h3]:mb-0.5 [&_p]:my-1 [&_ul]:my-1 [&_ol]:my-1 [&_li]:my-0.5 [&_code]:bg-secondary [&_code]:text-foreground [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_a]:text-primary [&_pre]:bg-secondary [&_pre]:text-foreground"),children:b&&!x?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O,{renderMention:en,children:n.content.slice(0,200)+"..."}),(0,r.jsx)(p.$,{variant:"link",size:"sm",onClick:()=>g(!0),className:"h-auto p-0 text-[#E07A5F] dark:text-[#F0A088] text-xs font-medium mt-1",children:s("comments.showMore")})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(O,{renderMention:en,children:n.content}),b&&(0,r.jsx)(p.$,{variant:"link",size:"sm",onClick:()=>g(!1),className:"h-auto p-0 text-[#E07A5F] dark:text-[#F0A088] text-xs font-medium mt-1",children:s("comments.showLess")})]})})]})]})}},38060:(e,t,n)=>{n.d(t,{S2:()=>u,eV:()=>c,l9:()=>s,tS:()=>i,w0:()=>d});var r=n(60200),a=n(81476);n(32022);var o=n(42790);let l=(0,a.createContext)(null);function i(e){let{projectUuid:t,children:n}=e,i=(0,o.jj)(),s=null==i?void 0:i.subscribe,c=null==i?void 0:i.openGeneration,u=(0,a.useRef)(new Set),d=(0,a.useRef)(new Set),m=(0,a.useRef)(new Set),p=(0,a.useRef)(new Set),f=(0,a.useCallback)(()=>{u.current.forEach(e=>e())},[]),h=(0,a.useCallback)(e=>{d.current.forEach(t=>t(e))},[]),x=(0,a.useCallback)(()=>{for(let e of(f(),["task","idea","proposal","document","project","project_group"]))h({companyUuid:"",projectUuid:"",entityType:e,entityUuid:"",action:"updated"})},[f,h]);(0,a.useEffect)(()=>{let e,n,r=null,a=!1,o=0,l={};function i(n){if("presence"===n.type){if(t&&n.projectUuid!==t)return;m.current.forEach(e=>e(n));return}if("execution"===n.type)return void p.current.forEach(e=>e(n));if("string"!=typeof n.entityType||"string"!=typeof n.entityUuid||"string"!=typeof n.action||t&&n.projectUuid!==t)return;clearTimeout(e);let r=Date.now(),a=r-o;a>=3e3?(o=r,f()):e=setTimeout(()=>{o=Date.now(),f()},Math.max(1e3,3e3-a));let i=n.entityType;clearTimeout(l[i]),l[i]=setTimeout(()=>{h(n)},300)}function c(){u(),(r=new EventSource(t?"/api/events?projectUuid=".concat(encodeURIComponent(t)):"/api/events")).onopen=()=>{a&&x(),a=!0},r.onmessage=e=>{let t=null;try{t=JSON.parse(e.data)}catch(e){return}t&&i(t)},r.onerror=()=>{}}function u(){r&&(r.close(),r=null)}function d(){"visible"===document.visibilityState&&(r&&r.readyState!==EventSource.CLOSED||c())}return s?n=s(i):(c(),document.addEventListener("visibilitychange",d)),()=>{for(let t in null==n||n(),u(),clearTimeout(e),l)clearTimeout(l[t]);document.removeEventListener("visibilitychange",d)}},[t,s,f,h,x]);let g=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(s&&c){if(null===g.current){g.current=c;return}c>g.current&&(g.current=c,x())}},[s,c,x]);let v=(0,a.useCallback)(e=>(u.current.add(e),()=>{u.current.delete(e)}),[]),w=(0,a.useCallback)(e=>(d.current.add(e),()=>{d.current.delete(e)}),[]),y=(0,a.useCallback)(e=>(m.current.add(e),()=>{m.current.delete(e)}),[]),b=(0,a.useCallback)(e=>(p.current.add(e),()=>{p.current.delete(e)}),[]),C=(0,a.useMemo)(()=>({subscribe:v,subscribeEntity:w,subscribePresence:y,subscribeExecution:b}),[v,w,y,b]);return(0,r.jsx)(l.Provider,{value:C,children:n})}function s(e){let t=(0,a.useContext)(l),n=(0,a.useRef)(e);n.current=e,(0,a.useEffect)(()=>{if(!t)return;let e=()=>n.current();return e(),t.subscribe(e)},[t])}function c(e,t){let n=(0,a.useContext)(l),r=(0,a.useRef)(t);r.current=t;let o=(0,a.useRef)(e);o.current=e,(0,a.useEffect)(()=>{if(n)return n.subscribeEntity(e=>{let t=o.current;(Array.isArray(t)?t.includes(e.entityType):e.entityType===t)&&r.current(e)})},[n])}function u(e){let t=(0,a.useContext)(l),n=(0,a.useRef)(e);n.current=e,(0,a.useEffect)(()=>{if(t)return t.subscribePresence(e=>n.current(e))},[t])}function d(e,t,n){let r=(0,a.useContext)(l),o=(0,a.useRef)(n);o.current=n,(0,a.useEffect)(()=>{if(r)return r.subscribeEntity(n=>{n.entityType===e&&n.entityUuid===t&&o.current(n)})},[r,e,t])}},48186:(e,t,n)=>{n.d(t,{fv:()=>h,xQ:()=>x});var r=n(81476),a=n(38060);let o=new Map,l=new Map,i=new Map,s=new Set,c=0;function u(e,t,n,r){return n?r?"".concat(e,":").concat(t,":").concat(n,":").concat(r):"".concat(e,":").concat(t,":").concat(n):"".concat(e,":").concat(t)}function d(){c++,s.forEach(e=>e())}function m(e){var t;let n=e.subEntityType,r=e.subEntityUuid,a=u(e.entityType,e.entityUuid,n,r),s=function(e,t,n,r,a){let o=u(e,t,r,a);return"".concat(o,":").concat(n)}(e.entityType,e.entityUuid,e.agentUuid,n,r),c=l.get(s);if(c&&Date.now()-c<3e3)return;l.set(s,Date.now());let m={agentUuid:e.agentUuid,agentName:e.agentName,action:e.action,timestamp:Date.now()},p=(null!=(t=o.get(a))?t:[]).filter(t=>t.agentUuid!==e.agentUuid);p.push(m),o.set(a,p);let f=i.get(s);f&&clearTimeout(f);let h=setTimeout(()=>{let t=o.get(a);if(t){let n=t.filter(t=>t.agentUuid!==e.agentUuid);0===n.length?o.delete(a):o.set(a,n)}l.delete(s),i.delete(s),d()},3e3);i.set(s,h),d()}function p(){return c}function f(e){return s.add(e),()=>{s.delete(e)}}function h(e){m({type:"presence",companyUuid:"",projectUuid:"",...e,timestamp:Date.now()})}function x(){return(0,r.useSyncExternalStore)(f,p,p),(0,a.S2)(m),{getPresence:(e,t,n,r)=>{if(n){var a;return null!=(a=o.get(u(e,t,n,r)))?a:[]}let l="".concat(e,":").concat(t),i=new Map;for(let[e,t]of o)if(e===l||e.startsWith(l+":"))for(let e of t){let t=i.get(e.agentUuid);(!t||e.timestamp>t.timestamp)&&i.set(e.agentUuid,e)}return[...i.values()]}}}},56791:(e,t,n)=>{n.d(t,{Hr:()=>f,Ht:()=>d,SQ:()=>c,_2:()=>u,lp:()=>m,mB:()=>p,rI:()=>i,ty:()=>s});var r=n(60200);n(81476);var a=n(76637),o=n(8575),l=n(49417);function i(e){let{...t}=e;return(0,r.jsx)(o.Root,{"data-slot":"dropdown-menu",...t})}function s(e){let{...t}=e;return(0,r.jsx)(o.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function c(e){let{className:t,sideOffset:n=4,...a}=e;return(0,r.jsx)(o.Portal,{children:(0,r.jsx)(o.Content,{"data-slot":"dropdown-menu-content",sideOffset:n,className:(0,l.cn)("bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md","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",t),...a})})}function u(e){let{className:t,inset:n,variant:a="default",...i}=e;return(0,r.jsx)(o.Item,{"data-slot":"dropdown-menu-item","data-inset":n,"data-variant":a,className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive","data-[inset]:pl-8 [&_svg]:size-4",t),...i})}function d(e){let{className:t,children:n,...i}=e;return(0,r.jsxs)(o.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",t),...i,children:[(0,r.jsx)("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:(0,r.jsx)(o.ItemIndicator,{children:(0,r.jsx)(a.A,{className:"size-2 fill-current"})})}),n]})}function m(e){let{className:t,inset:n,...a}=e;return(0,r.jsx)(o.Label,{"data-slot":"dropdown-menu-label","data-inset":n,className:(0,l.cn)("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...a})}function p(e){let{className:t,...n}=e;return(0,r.jsx)(o.Separator,{"data-slot":"dropdown-menu-separator",className:(0,l.cn)("bg-border -mx-1 my-1 h-px",t),...n})}function f(e){let{...t}=e;return(0,r.jsx)(o.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}},69189:(e,t,n)=>{n.d(t,{F7:()=>s,P6:()=>i,ProjectAccessProvider:()=>l});var r=n(60200),a=n(81476);let o=(0,a.createContext)("editor");function l(e){let{accessLevel:t,children:n}=e;return(0,r.jsx)(o.Provider,{value:t,children:n})}function i(){return(0,a.useContext)(o)}function s(){return"viewer"!==i()}},69351:(e,t,n)=>{n.d(t,{j:()=>a});let r=["#E06C75","#E5C07B","#98C379","#56B6C2","#61AFEF","#C678DD","#D19A66","#BE5046","#7EC8E3","#C3E88D","#F78C6C","#A9DC76"];function a(e){let t=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)|0;return Math.abs(t)}(e)%r.length;return r[t]}},75773:(e,t,n)=>{n.d(t,{d:()=>a});var r=n(42885);let a=(0,r.createServerReference)("70edfd503cbb867ed00e399c15238c26c853965a2f",r.callServer,void 0,r.findSourceMapURL,"getCommentsAction")}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[40309],{55033:(e,s,t)=>{t.d(s,{_u:()=>A,c_:()=>f,nF:()=>k,qK:()=>j});var a=t(60200),r=t(81476),i=t(24546),n=t(59055);t(19768);var c=t(62116),l=t.n(c),d=t(25588),o=t(75507),u=t(9258);let m={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground"},x={open:"#E65100",assigned:"#1976D2",in_progress:"#5A9E6F",to_verify:"#7B1FA2",done:"#00796B",closed:"#9A9A9A"},p={low:"priority.low",medium:"priority.medium",high:"priority.high",critical:"priority.critical"},h={open:"status.open",assigned:"status.assigned",in_progress:"status.inProgress",to_verify:"status.toVerify",done:"status.done",closed:"status.closed"},g={low:"bg-[#9A9A9A]",medium:"bg-[#E65100]",high:"bg-[#D32F2F]",critical:"bg-[#B71C1C]"},f={taskNode:function(e){let{data:s}=e,t=(0,d.c)();return(0,a.jsxs)("div",{className:"rounded-lg border-2 border-[#E5E2DC] dark:border-[#2a2a2e] bg-card px-4 py-3 shadow-sm min-w-[200px] max-w-[260px] cursor-pointer hover:border-primary transition-colors",children:[(0,a.jsx)(i.h7,{type:"target",position:n.yX.Top,className:"!bg-primary !w-2 !h-2"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1.5",children:[(0,a.jsx)(o.E,{className:"text-[10px] ".concat(m[s.status]||""),children:t(h[s.status]||s.status)}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)("div",{className:"h-1.5 w-1.5 rounded-full ".concat(g[s.priority]||"")}),(0,a.jsx)("span",{className:"text-[10px] text-muted-foreground",children:t(p[s.priority]||s.priority)})]})]}),(0,a.jsx)("p",{className:"text-xs font-medium text-foreground leading-snug line-clamp-2",children:s.title}),(0,a.jsx)(i.h7,{type:"source",position:n.yX.Bottom,className:"!bg-primary !w-2 !h-2"})]})}},v={taskNode:function(e){let{data:s}=e,t=x[s.status]||"#E5E0D8";return(0,a.jsxs)("div",{className:"rounded-md border-[1.5px] bg-card px-2.5 py-1.5 shadow-sm",style:{borderColor:t,width:b},children:[(0,a.jsx)(i.h7,{type:"target",position:n.yX.Top,className:"!bg-primary !w-1.5 !h-1.5"}),(0,a.jsx)("p",{className:"text-[10px] font-medium text-foreground leading-tight line-clamp-2",children:s.title}),(0,a.jsx)(i.h7,{type:"source",position:n.yX.Bottom,className:"!bg-primary !w-1.5 !h-1.5"})]})}},b=150,j={animated:!0,style:{stroke:"#C67A52",strokeWidth:2},markerEnd:{type:"arrowclosed",color:"#C67A52"}},N={animated:!0,style:{stroke:"#C67A52",strokeWidth:1.5},markerEnd:{type:"arrowclosed",color:"#C67A52"}};function k(e,s,t){var a,r,i,n;let c=null!=(a=null==t?void 0:t.nodeWidth)?a:240,d=null!=(r=null==t?void 0:t.nodeHeight)?r:80,o=new(l()).graphlib.Graph;return o.setDefaultEdgeLabel(()=>({})),o.setGraph({rankdir:"TB",nodesep:null!=(i=null==t?void 0:t.nodesep)?i:50,ranksep:null!=(n=null==t?void 0:t.ranksep)?n:80}),e.forEach(e=>{o.setNode(e.id,{width:c,height:d})}),s.forEach(e=>{o.setEdge(e.source,e.target)}),l().layout(o),{nodes:e.map(e=>{let s=o.node(e.id);return{...e,position:{x:s.x-c/2,y:s.y-d/2}}}),edges:s}}function A(e){let{tasks:s,edges:t,readonly:n=!1,compact:c=!1,height:l,onNodeClick:o,className:m}=e,x=(0,d.c)(),p=(0,u.W)(),{layoutedNodes:h,layoutedEdges:g}=(0,r.useMemo)(()=>{let e=s.map(e=>{var s;return{id:e.uuid,type:"taskNode",position:{x:0,y:0},data:{title:e.title,status:e.status,priority:e.priority,proposalUuid:null!=(s=e.proposalUuid)?s:null}}}),a=k(e,t.map((e,s)=>({id:"e-".concat(s),source:e.to,target:e.from,...c?N:j})),c?{nodeWidth:b,nodeHeight:50,nodesep:20,ranksep:40}:void 0);return{layoutedNodes:a.nodes,layoutedEdges:a.edges}},[s,t,c]);return 0===s.length?(0,a.jsx)("div",{className:"flex items-center justify-center text-sm text-muted-foreground ".concat(m||""),style:l?{height:l}:void 0,children:x("tasks.noTasksToDisplay")}):(0,a.jsx)("div",{className:"rounded-[10px] border border-border bg-[#F7F6F3] dark:bg-[#1e1d1b] ".concat(m||""),style:l?{height:l}:void 0,children:(0,a.jsxs)(i.Gc,{colorMode:p?"dark":"light",nodes:h,edges:g,nodeTypes:c?v:f,onNodeClick:o?(e,s)=>o(s.id):void 0,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},nodesDraggable:!n,nodesConnectable:!n,elementsSelectable:!n,panOnDrag:!0,zoomOnScroll:!0,children:[(0,a.jsx)(i.VS,{color:p?"#40392f":"#E5E0D8",gap:20}),!n&&(0,a.jsx)(i.H2,{className:"[&>button]:border-border [&>button]:bg-card [&>button]:text-foreground [&>button:hover]:bg-background"})]})})}},58294:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(73326).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},60516:(e,s,t)=>{t.d(s,{A:()=>a});let a=(0,t(73326).A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},61169:(e,s,t)=>{t.d(s,{v:()=>eF});var a=t(60200),r=t(81476),i=t(32022),n=t(25588),c=t(34382),l=t(5535),d=t(26657),o=t(60516),u=t(91560),m=t(80513),x=t(28201),p=t(56109),h=t(16832),g=t(28812),f=t(73326);let v=(0,f.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var b=t(32814),j=t(71507),N=t(43322),k=t(53511),A=t(58294);let y=(0,f.A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var w=t(14006),F=t(75507),C=t(16272),S=t(40058),E=t(30474),D=t(16852),_=t(45200),R=t(90993),T=t(21558),U=t(2745),q=t(62925),M=t(26185),B=t(16198),L=t(83564),P=t(42885);let z=(0,P.createServerReference)("60772839a2e4c130cdff3e3ec5a9ec161147666f56",P.callServer,void 0,P.findSourceMapURL,"updateTaskStatusAction"),I=(0,P.createServerReference)("40b2877c6525540963cbd0be1eec39ce0ac5871a2a",P.callServer,void 0,P.findSourceMapURL,"createTaskAction"),$=(0,P.createServerReference)("402fcd28536fa5150c2a089ccb3c7e3cc214dd25c9",P.callServer,void 0,P.findSourceMapURL,"updateTaskFieldsAction"),V=(0,P.createServerReference)("6084e1d894da5fd7b1a1b683f6ace3264c0e9a0084",P.callServer,void 0,P.findSourceMapURL,"deleteTaskAction"),W=(0,P.createServerReference)("6000593efdc00696ee4b4c682c4f502f14a580e7a4",P.callServer,void 0,P.findSourceMapURL,"markCriteriaAction"),J=(0,P.createServerReference)("60932d3794ed073b0b0b33d32a5bf6adb791342c83",P.callServer,void 0,P.findSourceMapURL,"resetCriterionAction");var O=t(36244),H=t(39968);let G=(0,P.createServerReference)("404547a52dd3ef77aad5a9261ed6871c86c85bf47f",P.callServer,void 0,P.findSourceMapURL,"getTaskActivitiesAction"),X=(0,P.createServerReference)("40ed98042590103f5fc2640efef38c91a54fac5ea7",P.callServer,void 0,P.findSourceMapURL,"getTaskSourceAction");var Z=t(64035),K=t(13796),Q=t(6153),Y=t(70250),ee=t(58105),es=t(63123),et=t(60404),ea=t(57378);let er=(0,P.createServerReference)("008f3444815064c8b10dfe2c987c7c2ab534f334ce",P.callServer,void 0,P.findSourceMapURL,"getDeveloperAgentsAction"),ei=(0,P.createServerReference)("60e5600d8c42e49c6b80fe4d8e9f0e752a19c7d40a",P.callServer,void 0,P.findSourceMapURL,"getAgentInstancesAction"),en=(0,P.createServerReference)("409e01ab735682a5b4af7f1c54927e25bf9c77de96",P.callServer,void 0,P.findSourceMapURL,"claimTaskAction"),ec=(0,P.createServerReference)("709ba9af877ad1beea19fd24de9585a6d5081fc3ff",P.callServer,void 0,P.findSourceMapURL,"claimTaskToAgentAction"),el=(0,P.createServerReference)("60db6c4134198deea1fbd17bdce0b448d6df90fe1d",P.callServer,void 0,P.findSourceMapURL,"claimTaskToUserAction"),ed=(0,P.createServerReference)("40cdf5e73f0b633fc35742bf456fe21bf835c08a1f",P.callServer,void 0,P.findSourceMapURL,"releaseTaskAction");function eo(e){var s,t;let{task:c,projectUuid:l,currentUserUuid:d,onClose:o}=e,u=(0,n.c)(),m=(0,i.r)(),[p,h]=(0,r.useState)(!1),[g,f]=(0,r.useState)("self"),[v,b]=(0,r.useState)(""),[j,k]=(0,r.useState)(""),[A,y]=(0,r.useState)([]),[w,F]=(0,r.useState)([]),[C,E]=(0,r.useState)(!0),[D,R]=(0,r.useState)(null),[U,q]=(0,r.useState)([]),[B,L]=(0,r.useState)(!1),[P,z]=(0,r.useState)(null),[I,$]=(0,r.useState)(null),V=!!c.assignee;(0,r.useEffect)(()=>{!async function(){E(!0);let e=await er();y(e.agents||[]),F((e.users||[]).filter(e=>e.uuid!==d)),E(!1)}()},[d]),(0,r.useEffect)(()=>{if("agent"!==g||!v){q([]),$(null),z(null);return}let e=!1;return L(!0),$(null),ei(v,l).then(s=>{e||(q((0,es.C)(s.instances)),z(s.resolvedTarget))}).finally(()=>{e||L(!1)}),()=>{e=!0}},[l,g,v]);let W=null!=(t=U.find(e=>e.connectionUuid===I))?t:null,J=new Set(U.map(e=>e.host)).size>1,O=async()=>{let e;if(h(!0),R(null),"self"===g)e=await en(c.uuid);else if("agent"===g&&v){var s;e=await ec(c.uuid,v,null!=(s=null==W?void 0:W.agentInstanceUuid)?s:void 0)}else if("user"===g&&j)e=await el(c.uuid,j);else{if("release"!==g)return void h(!1);e=await ed(c.uuid)}h(!1),(null==e?void 0:e.success)?(o(),m.refresh()):(null==e?void 0:e.error)&&R(e.error)},H="self"===g||"agent"===g&&v||"user"===g&&j||"release"===g&&V;return(0,a.jsxs)(Y._8,{open:!0,onOpenChange:e=>{e||o()},className:"bg-card sm:max-w-[400px]",header:(0,a.jsx)(Y.AI,{className:"text-base font-semibold text-foreground",children:u("tasks.assignTask")}),footer:(0,a.jsxs)("div",{className:"flex w-full items-center justify-end gap-4",children:[(0,a.jsx)(S.$,{variant:"outline",onClick:o,disabled:p,className:"border-border",children:u("common.cancel")}),(0,a.jsx)(S.$,{onClick:O,disabled:p||!H,className:"bg-primary hover:bg-[#B56A42] text-white",children:p?(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin"}):"release"===g?u("common.release"):function(){if("agent"!==g||!W)return u("common.assign");let e=(0,et.kn)(W.cwd),s=e.isUnknown?u(e.label):e.label,t=(0,et.g9)(W.host),a=t.isUnknown?u(t.label):t.label;return J?u("assignInstance.assignToWithHost",{path:s,host:a}):u("assignInstance.assignTo",{path:s})}()})]}),bodyClassName:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-lg bg-background p-3",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-foreground",children:c.title}),c.description&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground line-clamp-2",children:c.description})]}),V&&(0,a.jsx)("div",{className:"rounded-lg bg-[#E3F2FD] dark:bg-[#13253a] p-3",children:(0,a.jsxs)("p",{className:"text-xs text-[#1976D2] dark:text-[#5AA9F0]",children:[u("common.currentAssignee"),": ",(0,a.jsx)("span",{className:"font-medium",children:null==(s=c.assignee)?void 0:s.name})]})}),D&&(0,a.jsx)("div",{className:"rounded-lg bg-[#FEE2E2] dark:bg-[#331619] p-3",children:(0,a.jsx)("p",{className:"text-xs text-[#D32F2F] dark:text-[#F08078]",children:D})}),(0,a.jsx)("p",{className:"text-[13px] text-muted-foreground",children:u("assign.selectAssignee")}),C?(0,a.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,a.jsx)(x.A,{className:"h-6 w-6 animate-spin text-[#9A9A9A]"})}):(0,a.jsxs)(ee.z,{value:g,onValueChange:e=>f(e),className:"space-y-3",children:[(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("self"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"),onClick:()=>f("self"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(ee.C,{value:"self",id:"self",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"self",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.assignToMyself")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("assign.assignToMyselfDesc")})]}),(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("agent"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>f("agent"),children:[(0,a.jsx)(ee.C,{value:"agent",id:"agent",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"agent",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.orAssignToAgent")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("tasks.onlySelectedAgentCanWork")}),"agent"===g&&(0,a.jsxs)("div",{className:"mt-3 ml-6 space-y-3",children:[(0,a.jsxs)(T.l6,{value:v,onValueChange:b,children:[(0,a.jsx)(T.bq,{className:"w-full border-border",children:(0,a.jsx)(T.yv,{placeholder:u("tasks.selectAgent")})}),(0,a.jsx)(T.gC,{className:"z-[120]",children:A.length>0?A.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(M.AgentAvatar,{name:e.name,size:16,className:"rounded-full"}),(0,a.jsx)("span",{children:e.name})]})},e.uuid)):(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:u("tasks.noAgentsAvailable")})})]}),v&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("span",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:u("assignInstance.workingDirectory")}),B?(0,a.jsxs)("div",{className:"flex items-center gap-2 py-2 text-xs text-[#9A9A9A]",children:[(0,a.jsx)(x.A,{className:"h-3.5 w-3.5 animate-spin"}),u("assignInstance.loadingInstances")]}):(null==P?void 0:P.source)==="project_fixed"?(0,a.jsx)(ea.Y,{target:P}):0===U.length?(0,a.jsx)("p",{className:"rounded-lg bg-background p-2.5 text-[11px] leading-relaxed text-muted-foreground",children:u("assignInstance.noInstances")}):(0,a.jsx)(es.O,{instances:U,selectedConnectionUuid:I,onSelect:e=>$(e.connectionUuid),ariaLabel:u("assignInstance.workingDirectory")}),(null==P?void 0:P.source)!=="project_fixed"&&(0,a.jsxs)("div",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-[#9A8C7E]",children:[(0,a.jsx)(Q.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0","aria-hidden":!0}),(0,a.jsx)("span",{children:u("assignInstance.pinNote")})]})]})]})]}),(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors ".concat("user"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 cursor-pointer",onClick:()=>f("user"),children:[(0,a.jsx)(ee.C,{value:"user",id:"user",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"user",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.orAssignToUser")})]}),"user"===g&&(0,a.jsx)("div",{className:"mt-3 ml-6",children:(0,a.jsxs)(T.l6,{value:j,onValueChange:k,children:[(0,a.jsx)(T.bq,{className:"w-full border-border",children:(0,a.jsx)(T.yv,{placeholder:u("tasks.selectUser")})}),(0,a.jsx)(T.gC,{className:"z-[120]",children:w.length>0?w.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(N.A,{className:"h-4 w-4 text-muted-foreground"}),(0,a.jsx)("span",{children:e.name||e.email})]})},e.uuid)):(0,a.jsx)("div",{className:"px-3 py-2 text-xs text-[#9A9A9A]",children:u("tasks.noUsersAvailable")})})]})})]}),V&&(0,a.jsxs)("div",{className:"rounded-[10px] p-4 transition-colors cursor-pointer ".concat("release"===g?"bg-[#FDF8F6] dark:bg-[#201d1b] border-2 border-primary":"bg-card border border-border hover:border-primary/50"),onClick:()=>f("release"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)(ee.C,{value:"release",id:"release",className:"border-primary text-primary"}),(0,a.jsx)(_.J,{htmlFor:"release",className:"text-sm font-medium text-foreground cursor-pointer",children:u("assign.releaseAssignee")})]}),(0,a.jsx)("p",{className:"mt-2 ml-6 text-xs text-muted-foreground leading-relaxed",children:u("assign.releaseAssigneeDesc")})]})]})]})}let eu=(0,P.createServerReference)("40ade6f5ab89763243787c8b34cd0f09961cbe632d",P.callServer,void 0,P.findSourceMapURL,"getTaskDependenciesAction"),em=(0,P.createServerReference)("4073ee18f64c5c586b64ac1442db8d48979ddc0ce4",P.callServer,void 0,P.findSourceMapURL,"getProjectTasksForDependencyAction");var ex=t(64211);let ep=(0,P.createServerReference)("6001bd20b9cad6dc1f8d60f05f82eb42a88491a90a",P.callServer,void 0,P.findSourceMapURL,"removeTaskDependencyAction"),eh=(0,P.createServerReference)("40857efed382aaa63252998a089437a301f7f444e4",P.callServer,void 0,P.findSourceMapURL,"getTaskSessionsAction");var eg=t(3562),ef=t(69189),ev=t(25452),eb=t(8330),ej=t(79099);let eN={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",assigned:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",in_progress:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",to_verify:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]"},ek={open:"open",assigned:"assigned",in_progress:"inProgress",to_verify:"toVerify",done:"done",closed:"closed"},eA={low:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]",medium:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",high:"bg-[#FEE2E2] dark:bg-[#331619] text-[#D32F2F] dark:text-[#F08078]",critical:"bg-[#FFCDD2] dark:bg-[#3a181c] text-[#B71C1C] dark:text-[#F08078]"},ey={low:"lowPriority",medium:"mediumPriority",high:"highPriority",critical:"criticalPriority"};function ew(e,s){let t=new Date(e),a=new Date().getTime()-t.getTime(),r=Math.floor(a/6e4),i=Math.floor(a/36e5),n=Math.floor(a/864e5);return r<1?s("time.justNow"):r<60?s("time.minutesAgo",{minutes:r}):i<24?s("time.hoursAgo",{hours:i}):n<7?s("time.daysAgo",{days:n}):(0,eg.r)(t)}function eF(e){var s,t;let{task:f,projectUuid:P,currentUserUuid:Q,mode:Y="overlay",onClose:ee,onCreated:es,onDependencyChange:et,onBack:ea}=e,er=(0,n.c)(),ei=(0,i.r)(),en=(0,ef.F7)(),[ec,el]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=setTimeout(()=>el(!0),300);return()=>clearTimeout(e)},[]);let[ed,eF]=(0,r.useState)(!1),[eC,eS]=(0,r.useState)([]),[eE,eD]=(0,r.useState)(!0),[e_,eR]=(0,r.useState)(null),[eT,eU]=(0,r.useState)(!1),[eq,eM]=(0,r.useState)([]),[eB,eL]=(0,r.useState)([]),[eP,ez]=(0,r.useState)(!1),[eI,e$]=(0,r.useState)([]),[eV,eW]=(0,r.useState)(null),[eJ,eO]=(0,r.useState)([]),[eH,eG]=(0,r.useState)([]),eX=null===f,[eZ,eK]=(0,r.useState)(eX),[eQ,eY]=(0,r.useState)((null==f?void 0:f.title)||""),[e0,e1]=(0,r.useState)((null==f?void 0:f.description)||""),[e2,e5]=(0,r.useState)((null==f?void 0:f.priority)||"medium"),[e9,e3]=(0,r.useState)((null==f?void 0:f.storyPoints)!=null?String(f.storyPoints):""),[e4,e6]=(0,r.useState)((null!=(s=null==f?void 0:f.acceptanceCriteriaItems)?s:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),[e8,e7]=(0,r.useState)(!1),[se,ss]=(0,r.useState)(null),[st,sa]=(0,r.useState)(!1),sr=(0,L.RU)(null!=(t=null==f?void 0:f.assignee)?t:null,{type:"user",uuid:Q}),si=sr&&(null==f?void 0:f.status)==="assigned",sn=sr&&(null==f?void 0:f.status)==="in_progress",sc=(null==f?void 0:f.status)==="to_verify";(0,r.useEffect)(()=>{async function e(){eD(!0),eS((await G(f.uuid)).activities),eD(!1)}async function s(){f.proposalUuid&&eR(await X(f.proposalUuid))}async function t(){ez(!0);let[e,s]=await Promise.all([eu(f.uuid),em(P)]);eM(e.dependsOn),eL(e.dependedBy),e$(s.tasks),ez(!1)}async function a(){let e=await eh(f.uuid);e.success&&e.data&&eO(e.data)}f&&(e(),s(),t(),a())},[null==f?void 0:f.uuid,null==f?void 0:f.proposalUuid,P]),(0,r.useEffect)(()=>{eX&&e();async function e(){e$((await em(P)).tasks)}},[eX,P]),(0,r.useEffect)(()=>{if(f){var e;eK(!1),eY(f.title),e1(f.description||""),e5(f.priority),e3(null!=f.storyPoints?String(f.storyPoints):""),e6((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),ss(null)}},[null==f?void 0:f.uuid,null==f?void 0:f.title,null==f?void 0:f.description,null==f?void 0:f.priority,null==f?void 0:f.storyPoints,null==f?void 0:f.acceptanceCriteriaItems]);let sl=async e=>{if(!f)return;eF(!0);let s=await z(f.uuid,e);eF(!1),s.success&&(ee(),ei.refresh())},sd=()=>{if(eX)return void ee();if(eK(!1),f){var e;eY(f.title),e1(f.description||""),e5(f.priority),e3(null!=f.storyPoints?String(f.storyPoints):""),e6((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}))}ss(null)},so=async()=>{if(!eQ.trim())return void ss(er("tasks.titleRequired"));e7(!0),ss(null);let e=e9.trim()?parseFloat(e9):null;if(eX){let s=await I({projectUuid:P,title:eQ.trim(),description:e0.trim()||void 0,priority:e2,storyPoints:e,acceptanceCriteria:null});e7(!1),s.success?(eH.length>0&&s.taskUuid&&(await Promise.all(eH.map(e=>(0,ex.w)(s.taskUuid,e.uuid))),null==et||et()),null==es||es(),ee(),ei.refresh()):ss(s.error||er("tasks.createFailed"))}else{var s;let t=(null!=(s=f.acceptanceCriteriaItems)?s:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}),a=e4.filter(e=>e.description.trim().length>0),r=(0,K.K)(t,a);if(r&&0===a.length){e7(!1),ss(er("acceptanceCriteria.atLeastOneRequired"));return}let i=await $({taskUuid:f.uuid,projectUuid:P,title:eQ.trim(),description:e0.trim()||null,priority:e2,storyPoints:e,...r?{acceptanceCriteriaItems:a.map(e=>({description:e.description.trim(),required:e.required}))}:{}});e7(!1),i.success?(eK(!1),ei.refresh()):ss(i.error||er("tasks.updateFailed"))}},su=async()=>{if(!f)return;sa(!0);let e=await V(f.uuid,P);sa(!1),e.success&&(ee(),ei.refresh())},sm=async e=>{if(!f)return;eW(null);let s=await (0,ex.w)(f.uuid,e);if(s.success){let s=eI.find(s=>s.uuid===e);s&&eM(e=>[...e,s]),null==et||et()}else eW(s.error||er("tasks.failedToAddDep"))},sx=async e=>{if(!f)return;eW(null);let s=await ep(f.uuid,e);s.success?(eM(s=>s.filter(s=>s.uuid!==e)),null==et||et()):eW(s.error||er("tasks.failedToRemoveDep"))},sp=async e=>{if(!f)return;eW(null);let s=await ep(e,f.uuid);s.success?(eL(s=>s.filter(s=>s.uuid!==e)),null==et||et()):eW(s.error||er("tasks.failedToRemoveDep"))},sh=eI.filter(e=>e.uuid!==(null==f?void 0:f.uuid)&&!eq.some(s=>s.uuid===e.uuid)),sg=eI.filter(e=>!eH.some(s=>s.uuid===e.uuid)),sf="sidebyside"===Y;return(0,a.jsxs)(a.Fragment,{children:[!sf&&(0,a.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:ee}),(0,a.jsxs)("div",{className:"fixed top-14 md:top-0 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-card shadow-xl border-l border-border ".concat(sf?"z-40 ".concat(ec?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(ec?"":"animate-in slide-in-from-right duration-300")),style:sf?{right:"".concat(ej.L8,"px")}:void 0,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[ea&&(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:ea,children:(0,a.jsx)(o.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,a.jsx)("div",{className:"flex-1 min-w-0",children:eZ?(0,a.jsx)("h2",{className:"text-base font-semibold text-foreground",children:eX?er("tasks.createTaskTitle"):er("tasks.editTask")}):f?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:f.title}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,a.jsx)(F.E,{className:eN[f.status]||"",children:er("status.".concat(ek[f.status]||f.status))}),(0,a.jsx)(F.E,{className:eA[f.priority]||"",children:er("priority.".concat(ey[f.priority]||f.priority))}),f.storyPoints&&(0,a.jsxs)("span",{className:"rounded bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[f.storyPoints,"h"]})]})]}):null}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[f&&!eZ&&en&&(0,a.jsxs)(S.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border text-foreground",onClick:()=>{var e;f&&(eY(f.title),e1(f.description||""),e5(f.priority),e3(null!=f.storyPoints?String(f.storyPoints):""),e6((null!=(e=f.acceptanceCriteriaItems)?e:[]).map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}})),ss(null),eK(!0))},children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-xs",children:er("common.edit")})]}),(0,a.jsx)(S.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:eZ&&!eX?sd:ee,children:(0,a.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,a.jsx)(R.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,a.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:eZ?(0,a.jsxs)("div",{className:"space-y-5",children:[se&&(0,a.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:se}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:er("tasks.titleLabel")}),(0,a.jsx)(E.p,{id:"edit-title",value:eQ,onChange:e=>eY(e.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-description",className:"text-[13px] font-medium text-foreground",children:er("tasks.descriptionLabel")}),(0,a.jsx)(D.T,{id:"edit-description",value:e0,onChange:e=>e1(e.target.value),rows:4,className:"border-border text-sm resize-none focus-visible:ring-primary"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-priority",className:"text-[13px] font-medium text-foreground",children:er("tasks.priorityLabel")}),(0,a.jsxs)(T.l6,{value:e2,onValueChange:e5,children:[(0,a.jsx)(T.bq,{className:"border-border text-sm focus:ring-primary",children:(0,a.jsx)(T.yv,{})}),(0,a.jsxs)(T.gC,{children:[(0,a.jsx)(T.eb,{value:"low",children:er("priority.low")}),(0,a.jsx)(T.eb,{value:"medium",children:er("priority.medium")}),(0,a.jsx)(T.eb,{value:"high",children:er("priority.high")})]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{htmlFor:"edit-story-points",className:"text-[13px] font-medium text-foreground",children:er("tasks.storyPointsLabel")}),(0,a.jsx)(E.p,{id:"edit-story-points",type:"number",min:"0",step:"0.5",value:e9,onChange:e=>e3(e.target.value),className:"border-border text-sm focus-visible:ring-primary"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{className:"text-[13px] font-medium text-foreground",children:er("acceptanceCriteria.title")}),(0,a.jsx)(K.C,{items:e4,onChange:e6})]}),eX&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(_.J,{className:"text-[13px] font-medium text-foreground",children:er("tasks.dependencies")}),eH.length>0&&(0,a.jsx)("div",{className:"space-y-1.5",children:eH.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-2.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(eN[e.status]||""),children:er("status.".concat(ek[e.status]||e.status))})]}),(0,a.jsx)(S.$,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>eG(s=>s.filter(s=>s.uuid!==e.uuid)),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))}),sg.length>0&&(0,a.jsxs)(T.l6,{onValueChange:e=>{let s=eI.find(s=>s.uuid===e);s&&eG(e=>[...e,s])},children:[(0,a.jsx)(T.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"}),(0,a.jsx)(T.yv,{placeholder:er("tasks.addDependency")})]})}),(0,a.jsx)(T.gC,{children:sg.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},eH.length)]})]}):f?(0,a.jsxs)(ev.P.div,{variants:eb.qG,initial:"initial",animate:"animate",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.assignee")}),(0,a.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3",children:f.assignee?(0,a.jsxs)(a.Fragment,{children:[(0,L.bB)(f.assignee)?(0,a.jsx)(M.AgentAvatar,{name:f.assignee.name,size:28,className:"rounded-full"}):(0,a.jsx)(q.eu,{className:"h-7 w-7",children:(0,a.jsx)(q.q5,{className:"bg-border text-muted-foreground",children:f.assignee.name.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:f.assignee.name}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,L.bB)(f.assignee)?"".concat(er("common.agent")," • ").concat(f.assignee.assignedAt?(0,eg.r)(f.assignee.assignedAt):""):er("common.user")}),"agent_instance"===f.assignee.type&&f.assignee.instance&&(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)(B.jQ,{cwd:f.assignee.instance.cwd,host:f.assignee.instance.host})})]})]}):(0,a.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:er("common.unassigned")})})]}),eJ.length>0&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("sessions.activeWorkers")}),(0,a.jsx)("div",{className:"mt-2 space-y-1.5",children:eJ.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg bg-background p-2.5",children:[(0,a.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,a.jsx)(M.AgentAvatar,{name:e.agentName,size:28,className:"rounded-full"}),(0,a.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 h-2 w-2 rounded-full bg-green-500 ring-2 ring-background"})]}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"text-xs font-medium text-foreground truncate",children:e.sessionName}),(0,a.jsxs)("div",{className:"text-[10px] text-[#9A9A9A]",children:[e.agentName," \xb7 ",ew(e.checkinAt,er)]})]})]},e.sessionUuid))})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.description")}),(0,a.jsx)("div",{className:"mt-2",children:f.description?(0,a.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,a.jsx)(Z.MarkdownContent,{children:f.description})}):(0,a.jsx)("p",{className:"text-sm italic text-[#9A9A9A]",children:er("common.noDescription")})})]}),f.acceptanceCriteria&&!(f.acceptanceCriteriaItems&&f.acceptanceCriteriaItems.length>0)&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.acceptanceCriteria")}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,a.jsx)(Z.MarkdownContent,{children:f.acceptanceCriteria})})})]}),e_&&(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.source")}),(0,a.jsx)("a",{href:"/projects/".concat(P,"/proposals/").concat(e_.uuid),className:"mt-2 flex items-center justify-between rounded-lg bg-background p-3 hover:bg-[#F0EDE5] dark:hover:bg-[#26241f] transition-colors",children:(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.A,{className:"h-3.5 w-3.5 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground",children:e_.title})]})})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.dependencies")}),eV&&(0,a.jsx)("div",{className:"mt-2 rounded-lg bg-destructive/10 p-2.5 text-xs text-destructive",children:eV}),eP?(0,a.jsx)("div",{className:"mt-2 flex items-center justify-center py-4",children:(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):(0,a.jsxs)(a.Fragment,{children:[eq.length>0&&(0,a.jsxs)("div",{className:"mt-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.dependsOn")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:eq.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(eN[e.status]||""),children:er("status.".concat(ek[e.status]||e.status))})]}),en&&(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>sx(e.uuid),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))})]}),eB.length>0&&(0,a.jsxs)("div",{className:"mt-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5",children:[(0,a.jsx)(p.A,{className:"h-3 w-3 rotate-180 text-[#9A9A9A]"}),(0,a.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("tasks.blockedByThis")})]}),(0,a.jsx)("div",{className:"space-y-1.5",children:eB.map(e=>(0,a.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title}),(0,a.jsx)(F.E,{className:"shrink-0 text-[10px] ".concat(eN[e.status]||""),children:er("status.".concat(ek[e.status]||e.status))})]}),en&&(0,a.jsx)(S.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>sp(e.uuid),children:(0,a.jsx)(l.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))})]}),0===eq.length&&0===eB.length&&(0,a.jsx)("p",{className:"mt-2 text-sm italic text-[#9A9A9A]",children:er("tasks.noDependencies")}),en&&sh.length>0&&(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(T.l6,{onValueChange:e=>sm(e),children:[(0,a.jsx)(T.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)(d.A,{className:"h-3 w-3"}),(0,a.jsx)(T.yv,{placeholder:er("tasks.addDependency")})]})}),(0,a.jsx)(T.gC,{children:sh.map(e=>(0,a.jsx)(T.eb,{value:e.uuid,children:(0,a.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},eq.length)})]})]}),f&&f.acceptanceCriteriaItems&&f.acceptanceCriteriaItems.length>0&&(()=>{let e=f.acceptanceCriteriaItems,s=f.acceptanceSummary,t=e=>"passed"===e?(0,a.jsx)(h.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A]"}):"failed"===e?(0,a.jsx)(g.A,{className:"h-4 w-4 text-red-600 dark:text-[#F08078]"}):(0,a.jsx)(v,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E]"}),r=e=>"passed"===e?"bg-green-50 text-green-700 dark:bg-[#14281a] dark:text-[#6FD19A]":"failed"===e?"bg-red-50 text-red-700 dark:bg-[#331619] dark:text-[#F08078]":"bg-yellow-50 text-yellow-700 dark:bg-[#332a12] dark:text-[#E0B44E]",i=async(e,s)=>{(await W(f.uuid,[{uuid:e,status:s}])).success&&ei.refresh()};return(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("acceptanceCriteria.title")}),s&&(0,a.jsx)(F.E,{className:r(f.acceptanceStatus||"pending"),variant:"secondary",children:er("acceptanceCriteria.progress",{passed:s.passed,total:s.total})})]}),(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[e.map(e=>(0,a.jsx)(C.Zp,{className:"p-3",children:(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsx)("div",{className:"mt-0.5 shrink-0",children:t(e.status)}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"text-xs text-foreground",children:e.description}),(0,a.jsx)(F.E,{variant:"outline",className:"text-[10px] shrink-0",children:e.required?er("acceptanceCriteria.required"):er("acceptanceCriteria.optional")})]}),(0,a.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,a.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:er("acceptanceCriteria.devSelfCheck")}),(0,a.jsxs)(F.E,{className:"text-[10px] ".concat(r(e.devStatus)),variant:"secondary",children:[t(e.devStatus),(0,a.jsx)("span",{className:"ml-1",children:er("acceptanceCriteria.status.".concat(e.devStatus))})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[10px]",children:[(0,a.jsx)("span",{className:"text-[#9A9A9A] w-20 shrink-0",children:er("acceptanceCriteria.verification")}),(0,a.jsxs)(F.E,{className:"text-[10px] ".concat(r(e.status)),variant:"secondary",children:[t(e.status),(0,a.jsx)("span",{className:"ml-1",children:er("acceptanceCriteria.status.".concat(e.status))})]})]})]}),e.devEvidence&&(0,a.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:er("acceptanceCriteria.devEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:e.devEvidence})]}),e.evidence&&(0,a.jsxs)("div",{className:"mt-2 rounded bg-background p-2",children:[(0,a.jsx)("span",{className:"text-[10px] font-medium text-[#9A9A9A]",children:er("acceptanceCriteria.verifyEvidence")}),(0,a.jsx)("p",{className:"text-[11px] text-foreground mt-0.5",children:e.evidence})]}),en?"pending"===e.status?(0,a.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,a.jsxs)(S.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-green-700 dark:text-[#6FD19A] border-green-200 dark:border-[#2a4a34] hover:bg-green-50 dark:hover:bg-[#14281a]",onClick:()=>i(e.uuid,"passed"),children:[(0,a.jsx)(h.A,{className:"h-3.5 w-3.5 mr-1"}),er("acceptanceCriteria.pass")]}),(0,a.jsxs)(S.$,{size:"sm",variant:"outline",className:"h-8 min-h-[44px] sm:min-h-0 flex-1 sm:flex-none text-xs text-red-700 dark:text-[#F08078] border-red-200 dark:border-[#5a2a2e] hover:bg-red-50 dark:hover:bg-[#331619]",onClick:()=>i(e.uuid,"failed"),children:[(0,a.jsx)(g.A,{className:"h-3.5 w-3.5 mr-1"}),er("acceptanceCriteria.fail")]})]}):(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(S.$,{size:"sm",variant:"ghost",className:"h-7 min-h-[44px] sm:min-h-0 text-xs text-[#9A9A9A] hover:text-foreground",onClick:async()=>{(await J(f.uuid,e.uuid)).success&&ei.refresh()},children:er("acceptanceCriteria.undoVerification")})}):null]})]})},e.uuid)),s&&(s.requiredPending>0||s.requiredFailed>0)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-yellow-50 dark:bg-[#332a12] p-3 mt-2",children:[(0,a.jsx)(b.A,{className:"h-4 w-4 text-yellow-600 dark:text-[#E0B44E] shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-yellow-700 dark:text-[#E0B44E]",children:er("acceptanceCriteria.gateBlocked",{count:s.requiredPending+s.requiredFailed})})]}),s&&0===s.requiredPending&&0===s.requiredFailed&&s.required>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-lg bg-green-50 dark:bg-[#14281a] p-3 mt-2",children:[(0,a.jsx)(h.A,{className:"h-4 w-4 text-green-600 dark:text-[#6FD19A] shrink-0"}),(0,a.jsx)("span",{className:"text-xs text-green-700 dark:text-[#6FD19A]",children:er("acceptanceCriteria.gateReady")})]})]})]})})(),(0,a.jsxs)("div",{className:"mt-5 flex-1",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("common.activity")}),(0,a.jsx)("div",{className:"mt-2 space-y-3",children:eE?(0,a.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,a.jsx)(x.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===eC.length?(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:er("common.noActivity")}):eC.map(e=>(0,a.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,a.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-secondary",children:(0,a.jsx)("div",{className:"h-2 w-2 rounded-full ".concat(function(e){switch(e){case"task_created":return"bg-primary";case"task_assigned":case"task_claimed":return"bg-[#1976D2]";case"task_started":return"bg-[#5A9E6F]";case"task_submitted":return"bg-[#7B1FA2]";case"task_completed":case"task_verified":return"bg-[#00796B]";case"task_released":return"bg-[#E65100]";default:return"bg-muted-foreground"}}(e.action))})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-xs text-foreground",children:function(e,s){let t=e.sessionName?"".concat(e.actorName," / ").concat(e.sessionName):e.actorName,{action:a}=e;switch(a){case"task_created":return s("activity.taskCreated",{actor:t});case"task_assigned":return s("activity.taskAssigned",{actor:t});case"task_claimed":return s("activity.taskClaimed",{actor:t});case"task_started":return s("activity.taskStarted",{actor:t});case"task_submitted":return s("activity.taskSubmitted",{actor:t});case"task_completed":case"task_verified":return s("activity.taskCompleted",{actor:t});case"task_released":return s("activity.taskReleased",{actor:t});case"task_status_changed":return s("activity.taskStatusChanged",{actor:t});default:return"".concat(t,": ").concat(a)}}(e,er)}),(0,a.jsx)("p",{className:"text-[10px] text-[#9A9A9A]",children:ew(e.createdAt,er)})]})]},e.uuid))})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("references.title")}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(H.ReferencesSection,{targetType:"task",targetUuid:f.uuid,canWrite:!0,compact:!0})})]}),(0,a.jsxs)("div",{className:"mt-5",children:[(0,a.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:er("comments.title")}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(O.$m,{targetType:"task",targetUuid:f.uuid,currentUserUuid:Q,compact:!0})})]})]}):null})}),(0,a.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:(0,a.jsx)("div",{className:"flex items-center gap-3",children:eZ?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(S.$,{variant:"outline",className:"border-border",onClick:sd,disabled:e8,children:er("common.cancel")}),(0,a.jsx)(S.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:so,disabled:e8||!eQ.trim(),children:e8?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4 animate-spin"}),er("common.saving")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j.A,{className:"mr-2 h-4 w-4"}),eX?er("common.create"):er("tasks.saveChanges")]})})]}):f&&en?(0,a.jsxs)(a.Fragment,{children:["done"!==f.status&&"closed"!==f.status&&(0,a.jsxs)(S.$,{variant:"outline",className:"border-border",onClick:()=>eU(!0),disabled:ed,children:[(0,a.jsx)(N.A,{className:"mr-2 h-4 w-4"}),er("common.assign")]}),si&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#1976D2] hover:bg-[#1565C0] text-white",onClick:()=>sl("in_progress"),disabled:ed,children:[(0,a.jsx)(k.A,{className:"mr-2 h-4 w-4"}),er("tasks.startWork")]}),sn&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#7B1FA2] hover:bg-[#6A1B9A] text-white",onClick:()=>sl("to_verify"),disabled:ed,children:[(0,a.jsx)(A.A,{className:"mr-2 h-4 w-4"}),er("tasks.submitForReview")]}),sc&&(0,a.jsxs)(S.$,{className:"flex-1 bg-[#22C55E] hover:bg-[#16A34A] text-white",onClick:()=>sl("done"),disabled:ed,children:[(0,a.jsx)(y,{className:"mr-2 h-4 w-4"}),er("tasks.markAsVerified")]}),("done"===f.status||"closed"===f.status)&&(0,a.jsx)("div",{className:"text-sm text-[#9A9A9A] text-center w-full",children:er("tasks.taskCompleted")}),(0,a.jsx)("div",{className:"ml-auto",children:(0,a.jsxs)(U.Lt,{children:[(0,a.jsx)(U.tv,{asChild:!0,children:(0,a.jsx)(S.$,{variant:"outline",size:"icon",className:"h-9 w-9 border-border text-[#D32F2F] dark:text-[#F08078] hover:bg-[#FFEBEE] dark:hover:bg-[#331619] hover:text-[#D32F2F] hover:border-[#D32F2F]",children:(0,a.jsx)(w.A,{className:"h-4 w-4"})})}),(0,a.jsxs)(U.EO,{children:[(0,a.jsxs)(U.wd,{children:[(0,a.jsx)(U.r7,{children:er("tasks.deleteTask")}),(0,a.jsx)(U.$v,{children:er("tasks.deleteTaskConfirm",{title:f.title})})]}),(0,a.jsxs)(U.ck,{children:[(0,a.jsx)(U.Zr,{children:er("common.cancel")}),(0,a.jsx)(U.Rx,{variant:"destructive",onClick:su,disabled:st,children:st?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.A,{className:"mr-2 h-4 w-4 animate-spin"}),er("common.delete")]}):er("common.delete")})]})]})]})})]}):null})})]}),f&&eT&&(0,a.jsx)(eo,{task:f,projectUuid:P,currentUserUuid:Q,onClose:()=>eU(!1)})]})}},64211:(e,s,t)=>{t.d(s,{w:()=>r});var a=t(42885);let r=(0,a.createServerReference)("60a806c9ced5a52f90e35822e755ffff40d72c9d7e",a.callServer,void 0,a.findSourceMapURL,"addTaskDependencyAction")},74315:(e,s,t)=>{t.d(s,{T:()=>i});var a=t(81476),r=t(45719);function i(e,s){var t;let i=(0,r.useSearchParams)(),n=(0,a.useRef)(!1),c=!n.current;n.current=!0;let l=null!=(t=i.get("panel"))?t:c&&null!=s?s:null,d=i.get("tab"),o=(0,a.useCallback)((s,t)=>{let a=new URLSearchParams(window.location.search);s?a.set("panel",s):a.delete("panel"),t?a.set("tab",t):a.delete("tab");let r=a.toString();return r?"".concat(e,"?").concat(r):e},[e]),u=(0,a.useCallback)((e,s)=>{window.history.replaceState(null,"",o(e,s))},[o]),m=(0,a.useCallback)(()=>{window.history.replaceState(null,"",o(null))},[o]),x=(0,a.useCallback)(e=>{l&&window.history.replaceState(null,"",o(l,e))},[o,l]);return{selectedId:l,selectedTab:d,openPanel:u,closePanel:m,switchTab:x}}},79099:(e,s,t)=>{t.d(s,{Bj:()=>l,L8:()=>r,Wl:()=>d,_5:()=>c,eT:()=>i,fw:()=>n});var a=t(3562);let r=480;function i(e){switch(e){case"done":return"bg-[#00796B]";case"in_progress":return"bg-[#1976D2]";case"to_verify":return"bg-[#7B1FA2]";case"open":case"assigned":return"bg-[#E65100]";case"closed":return"bg-[#9A9A9A]";default:return"bg-[#D9D9D9]"}}function n(e,s){let t=new Date(e),r=new Date().getTime()-t.getTime(),i=Math.floor(r/6e4),n=Math.floor(r/36e5),c=Math.floor(r/864e5);return i<1?s("time.justNow"):i<60?s("time.minutesAgo",{minutes:i}):n<24?s("time.hoursAgo",{hours:n}):c<7?s("time.daysAgo",{days:c}):(0,a.r)(t)}let c={todo:"bg-[#FFF3E0] text-[#E65100] dark:bg-[#3a2a12] dark:text-[#F0A050]",in_progress:"bg-[#E3F2FD] text-[#1976D2] dark:bg-[#13253a] dark:text-[#5AA9F0]",human_conduct_required:"bg-[#F3E5F5] text-[#7B1FA2] dark:bg-[#281630] dark:text-[#C98FE0]",done:"bg-[#E0F2F1] text-[#00796B] dark:bg-[#12292a] dark:text-[#4FD1C0]"},l={todo:"todo",in_progress:"inProgress",human_conduct_required:"humanConductRequired",done:"done"},d={open:"open",researching:"researching",answer_questions:"answerQuestions",planning:"planning",review_proposal:"reviewProposal",building:"building",verify_work:"verifyWork",done:"done"}},88839:(e,s,t)=>{t.d(s,{h:()=>r});var a=t(42885);let r=(0,a.createServerReference)("405c38da9f4a2879adf7c57d9dd4aed5254d204d6f",a.callServer,void 0,a.findSourceMapURL,"getBatchWorkerCountsAction")}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56161],{9882:(e,t,a)=>{a.d(t,{K:()=>p});var s=a(60200),n=a(81476),r=a(25588),i=a(60516),l=a(5535),o=a(40058),d=a(75507),c=a(90993),u=a(64035),x=a(21195),m=a(79099);function p(e){let{title:t,type:a,content:p,mode:h="overlay",onClose:f,onBack:g}=e,b=(0,r.c)("documents"),[v,j]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=setTimeout(()=>j(!0),300);return()=>clearTimeout(e)},[]),(0,n.useEffect)(()=>{let e=e=>{"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),f())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f]);let y="sidebyside"===h;return(0,s.jsxs)(s.Fragment,{children:[!y&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:f}),(0,s.jsxs)("div",{className:"fixed top-14 md:top-0 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col bg-card shadow-xl border-l border-border ".concat(y?"z-40 ".concat(v?"":"animate-in slide-in-from-right duration-300"):"z-50 right-0 ".concat(v?"":"animate-in slide-in-from-right duration-300")),style:y?{right:"".concat(m.L8,"px")}:void 0,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[g&&(0,s.jsx)(o.$,{variant:"ghost",size:"icon",className:"mr-2 h-8 w-8 shrink-0",onClick:g,children:(0,s.jsx)(i.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:t}),(0,s.jsx)("div",{className:"mt-1.5",children:(0,s.jsx)(d.E,{variant:"outline",className:"text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:b(x.y[a]||"typeOther")})})]}),(0,s.jsx)(o.$,{variant:"outline",size:"icon",className:"ml-4 h-8 w-8 shrink-0 border-border",onClick:f,children:(0,s.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground"})})]}),(0,s.jsx)(c.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,s.jsx)("div",{className:"px-6 py-5 text-[13px] leading-relaxed text-foreground prose prose-sm max-w-none [&_h1]:text-lg [&_h1]:font-semibold [&_h1]:mt-4 [&_h1]:mb-2 [&_h2]:text-base [&_h2]:font-semibold [&_h2]:mt-3 [&_h2]:mb-1.5 [&_h3]:text-sm [&_h3]:font-medium [&_h3]:mt-2 [&_h3]:mb-1 [&_p]:text-[13px] [&_p]:text-foreground/80 [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-foreground/80 [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-foreground [&_code]:text-[12px] [&_code]:bg-secondary [&_code]:text-foreground [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_pre]:bg-secondary [&_pre]:text-foreground [&_pre]:p-3 [&_pre]:rounded-lg [&_pre]:my-2 [&_a]:text-primary",children:(0,s.jsx)(u.MarkdownContent,{children:(0,x.j)(p)})})})]})]})}},11064:(e,t,a)=>{a.d(t,{D:()=>tu});var s=a(60200),n=a(81476),r=a(25588),i=a(32022),l=a(99736),o=a(5535),d=a(28201),c=a(51250),u=a(73326);let x=(0,u.A)("corner-left-up",[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]);var m=a(32288),p=a(47297),h=a(40058),f=a(90993),g=a(75507),b=a(30474),v=a(16852),j=a(45200),y=a(50402),k=a(2745),N=a(38060),w=a(69189),C=a(81106),S=a(48135),A=a(28188),F=a(64035),E=a(25452),_=a(8330),D=a(62925),R=a(26185),U=a(58851),T=a(16198),P=a(83564);function I(e){let{assignee:t,onReassign:a,editable:n}=e,i=(0,r.c)("common"),l=!0===n&&"function"==typeof a,o=i(t?"reassign":"assign"),d=t?(0,s.jsxs)(s.Fragment,{children:[(0,P.bB)(t)?(0,s.jsx)(R.AgentAvatar,{name:t.name,size:28,className:"rounded-full"}):(0,s.jsx)(D.eu,{className:"h-7 w-7",children:(0,s.jsx)(D.q5,{className:"bg-border text-muted-foreground",children:t.name.charAt(0).toUpperCase()})}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground",children:t.name}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground",children:i((0,P.bB)(t)?"agent":"user")}),"agent_instance"===t.type&&t.instance&&(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsx)(T.jQ,{cwd:t.instance.cwd,host:t.instance.host})})]})]}):(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:i("unassigned")}),c="mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3";return(0,s.jsxs)("div",{children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:i("assignee")}),l?(0,s.jsx)(U.Bc,{delayDuration:300,children:(0,s.jsxs)(U.m_,{children:[(0,s.jsx)(U.k$,{asChild:!0,children:(0,s.jsx)("button",{type:"button",onClick:a,"aria-label":o,className:"".concat(c," w-full cursor-pointer text-left"),children:d})}),(0,s.jsx)(U.ZI,{children:o})]})}):(0,s.jsx)("div",{className:c,children:d})]})}function M(e){let{idea:t,elaboration:a,isLoading:n,onRefresh:i,onReassign:l,canReassign:o}=e,c=(0,r.c)("ideaTracker"),u=(0,r.c)("common");return n?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-primary"})}):(0,s.jsxs)(E.P.div,{variants:_.qG,initial:"initial",animate:"animate",children:[(0,s.jsx)(I,{assignee:t.assignee,onReassign:l,editable:o}),(0,s.jsx)(S.Separator,{className:"my-5 bg-secondary"}),a&&a.rounds.length>0?(0,s.jsx)("div",{children:(0,s.jsx)(A.R,{ideaUuid:t.uuid,elaboration:a,onRefresh:i})}):"open"===t.status?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#FFF3E0] dark:bg-[#3a2a12]",children:(0,s.jsx)(C.A,{className:"h-5 w-5 text-[#E65100] dark:text-[#F0A050]"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:c("panel.elaborationNotStarted")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:c("panel.elaborationNotStartedDesc")})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-8 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#E3F2FD] dark:bg-[#13253a]",children:(0,s.jsx)(C.A,{className:"h-5 w-5 text-[#1976D2] dark:text-[#5AA9F0]"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:c("panel.elaborationWaiting")}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:c("panel.elaborationWaitingDesc")})]})]}),t.content&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(S.Separator,{className:"my-5 bg-secondary"}),(0,s.jsxs)("div",{children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:u("content")}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,s.jsx)(F.MarkdownContent,{children:t.content})})})]})]})]})}var B=a(25554),L=a.n(B),z=a(30244),O=a(82167),V=a(17230),q=a(50759),$=a(48733),H=a(7685),K=a(48186),G=a(55033),J=a(21195),Q=a(58404),W=a(87054),X=a(43664);function Z(e){let{idea:t,projectUuid:a,onTaskClick:i,onDocClick:l,initialProposals:o}=e,c=(0,r.c)("ideaTracker"),[u,x]=(0,n.useState)(null!=o?o:[]),[m,p]=(0,n.useState)(!o),h=(0,n.useCallback)(async()=>{try{let e=await (0,Q.U)(a,t.uuid);if(e.success)return x(e.data),e.data}catch(e){X.q.error("Failed to fetch proposals:",e)}finally{p(!1)}return[]},[a,t.uuid]);(0,n.useEffect)(()=>{o||h()},[h,o]);let f=(0,n.useRef)(u);f.current=u;let{getPresence:g}=(0,K.xQ)();return((0,N.eV)("proposal",async()=>{let e=f.current;for(let r of(await h())){var t,a,s,n;let i=e.find(e=>e.uuid===r.uuid);if(!i)continue;let l=new Set((null!=(t=i.documentDrafts)?t:[]).map(e=>e.uuid)),o=new Set((null!=(a=i.taskDrafts)?a:[]).map(e=>e.uuid)),d=(null!=(s=r.documentDrafts)?s:[]).filter(e=>e.uuid&&!l.has(e.uuid)),c=(null!=(n=r.taskDrafts)?n:[]).filter(e=>e.uuid&&!o.has(e.uuid)),u=[...d.map(e=>e.uuid),...c.map(e=>e.uuid)];if(u.length>0){let e=g("proposal",r.uuid)[0];if(e)for(let t of u)(0,K.fv)({entityType:"proposal",entityUuid:r.uuid,subEntityType:"draft",subEntityUuid:t,agentUuid:e.agentUuid,agentName:e.agentName,action:"mutate"})}}}),m)?(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-primary"})}):0===u.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-[#F3E5F5] dark:bg-[#281630]",children:(0,s.jsx)(z.A,{className:"h-5 w-5 text-[#7B1FA2] dark:text-[#C98FE0]"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:c("panel.noProposals")})]}):(0,s.jsx)("div",{className:"space-y-5",children:u.map(e=>(0,s.jsx)(ee,{proposal:e,projectUuid:a,onTaskClick:i,onDocClick:l},e.uuid))})}let Y={draft:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground",pending:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",approved:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",rejected:"bg-[#FFEBEE] dark:bg-[#331619] text-[#C4574C] dark:text-[#F0897E]",revised:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground"};function ee(e){let{proposal:t,projectUuid:a,onTaskClick:i,onDocClick:l}=e,o=(0,r.c)("ideaTracker"),d=(0,r.c)(),c=(0,r.c)("proposals"),u=(0,r.c)("tasks"),x=(0,r.c)("documents"),m=t.documentDrafts||[],p=t.taskDrafts||[],[f,b]=(0,n.useState)(new Set),[v,j]=(0,n.useState)("cards"),[y,k]=(0,n.useState)([]),N="approved"===t.status;(0,n.useEffect)(()=>{N&&(0,W.c)(a,t.uuid).then(e=>{e.success&&k(e.data||[])}).catch(e=>X.q.error("Failed to fetch materialized tasks:",e))},[N,a,t.uuid]);let w=(0,n.useMemo)(()=>{let e=new Map;for(let t of y)e.set(t.title,t);return e},[y]),{dagTasks:C,dagEdges:S,dagHeight:A}=(0,n.useMemo)(()=>{let e=p.map(e=>{let t=w.get(e.title);return{uuid:(null==t?void 0:t.uuid)||e.uuid,title:e.title,status:(null==t?void 0:t.status)||"open",priority:e.priority||"medium"}}),t=[],a=new Map(p.map(e=>[e.uuid,e]));for(let e of p)if(e.dependsOnDraftUuids)for(let s of e.dependsOnDraftUuids){let n=w.get(e.title),r=a.get(s),i=r?w.get(r.title):void 0;t.push({from:(null==n?void 0:n.uuid)||e.uuid,to:(null==i?void 0:i.uuid)||s})}return{dagTasks:e,dagEdges:t,dagHeight:Math.max(350,90*e.length)}},[p,w]),E=N?y.filter(e=>"done"===e.status||"closed"===e.status).length:0;return(0,s.jsxs)("div",{className:"space-y-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"text-[14px] font-semibold text-foreground truncate flex-1",children:t.title}),(0,s.jsx)(g.E,{className:"text-[11px] font-semibold border-0 shrink-0 ".concat(Y[t.status]||""),children:d("status.".concat(t.status))})]}),t.description&&(0,s.jsx)("div",{className:"max-h-[120px] overflow-y-auto text-[13px] leading-relaxed text-foreground/80 prose prose-sm max-w-none [&_h1]:text-sm [&_h2]:text-[13px] [&_h3]:text-xs [&_p]:text-[13px] [&_p]:text-foreground/80 [&_p]:my-1.5 [&_li]:text-[13px] [&_li]:text-foreground/80 [&_ul]:my-1 [&_ol]:my-1 [&_strong]:text-foreground [&_code]:bg-secondary [&_code]:text-foreground [&_code]:px-1 [&_code]:py-0.5 [&_code]:rounded [&_a]:text-primary",children:(0,s.jsx)(F.MarkdownContent,{children:(0,J.j)(t.description)})}),(0,s.jsxs)(L(),{href:"/projects/".concat(a,"/proposals/").concat(t.uuid),className:"flex items-center gap-1 text-[13px] font-medium text-primary hover:underline",children:[o("panel.viewProposal"),(0,s.jsx)(O.A,{className:"h-3.5 w-3.5"})]}),m.length>0&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:c(N?"documents":"documentDrafts")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:m.length})]}),(0,s.jsx)("div",{className:"space-y-0",children:m.map((e,a)=>(0,s.jsx)(H.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid||"draft-".concat(a),badgeInside:!0,children:(0,s.jsxs)(h.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-background transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>e.content&&(null==l?void 0:l({title:e.title,type:e.type,content:e.content})),children:[(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)(g.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:x(J.y[e.type]||"typeOther")}),(0,s.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:e.title})]})},e.uuid||a))})]}),(p.length>0||y.length>0)&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between pb-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:c(N?"tasks":"taskDrafts")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:N&&y.length>0?y.length:p.length})]}),(0,s.jsxs)("span",{className:"text-[12px] text-muted-foreground",children:[E,"/",N&&y.length>0?y.length:p.length]})]}),(0,s.jsx)("div",{className:"-mx-6 border-t border-border"}),S.length>0&&(0,s.jsxs)("div",{className:"flex gap-0.5 rounded-lg border border-border bg-[#F7F6F3] dark:bg-[#1e1d1b] p-0.5 mt-3 w-fit",children:[(0,s.jsx)(h.$,{variant:"ghost",size:"sm",onClick:()=>j("cards"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("cards"===v?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:c("cardsView")}),(0,s.jsx)(h.$,{variant:"ghost",size:"sm",onClick:()=>j("dag"),className:"rounded-md px-2.5 py-1 h-auto text-[11px] font-medium transition-colors ".concat("dag"===v?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:u("dagView")})]}),"cards"===v&&(0,s.jsx)("div",{className:"space-y-0",children:N&&y.length>0?y.map(e=>(0,s.jsx)(H.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,s.jsx)(es,{task:{uuid:e.uuid,title:e.title},expanded:!1,onToggle:()=>{},onNavigate:i?()=>i(e.uuid):void 0,taskStatus:e.status})},e.uuid)):p.map((e,a)=>(0,s.jsx)(H.D,{entityType:"proposal",entityUuid:t.uuid,subEntityType:"draft",subEntityUuid:e.uuid,badgeInside:!0,children:(0,s.jsx)(es,{task:e,expanded:f.has(a),onToggle:()=>{b(e=>{let t=new Set(e);return t.has(a)?t.delete(a):t.add(a),t})}})},e.uuid))}),"dag"===v&&(0,s.jsx)("div",{className:"mt-3",children:(0,s.jsx)(G._u,{tasks:C,edges:S,readonly:!0,height:A,onNodeClick:i})})]}),0===m.length&&0===p.length&&0===y.length&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground italic",children:c("emptyContainer")})]})}let et={open:"border-[#D9D9D9] dark:border-[#3a3a40] bg-card",assigned:"border-[#1976D2] bg-[#1976D2]",in_progress:"border-[#5A9E6F] bg-[#5A9E6F]",to_verify:"border-[#7B1FA2] bg-[#7B1FA2]",done:"border-[#00796B] bg-[#00796B]",closed:"border-[#9A9A9A] bg-[#9A9A9A] dark:border-[#6b6862] dark:bg-[#6b6862]"},ea={open:null,assigned:null,in_progress:{className:"bg-[#E8F5E9] dark:bg-[#14281a] text-[#5A9E6F] dark:text-[#6FD19A]",key:"inProgress"},to_verify:{className:"bg-[#F3E5F5] dark:bg-[#281630] text-[#7B1FA2] dark:text-[#C98FE0]",key:"toVerify"},done:{className:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]",key:"done"},closed:{className:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-muted-foreground",key:"done"}};function es(e){let{task:t,expanded:a,onToggle:n,onNavigate:i,taskStatus:l}=e,o=(0,r.c)("proposals"),d=(0,r.c)("acceptanceCriteria"),c=(0,r.c)("status"),u=t.acceptanceCriteriaItems||[],x=!!(t.description||u.length>0),m=l?et[l]||et.open:"border-[#D9D9D9] dark:border-[#3a3a40] bg-card",p=l?ea[l]:null,f=(0,s.jsx)("span",{className:"shrink-0 h-2 w-2 rounded-full border-[1.5px] ".concat(m," transition-colors")}),g=(0,s.jsx)("span",{className:"flex-1 min-w-0 text-[13px] leading-snug truncate text-muted-foreground",children:t.title}),b=p?(0,s.jsx)("span",{className:"shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ".concat(p.className),children:c(p.key)}):null;return i?(0,s.jsxs)(h.$,{variant:"ghost",onClick:i,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 cursor-pointer hover:bg-background -mx-1 px-1 rounded-lg transition-colors",children:[(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),f,g,b]}):(0,s.jsxs)("div",{children:[(0,s.jsxs)(h.$,{variant:"ghost",onClick:x?n:void 0,className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-4 ".concat(x?"cursor-pointer hover:bg-background -mx-1 px-1 rounded-lg":""," transition-colors"),children:[a?(0,s.jsx)(q.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}):(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),f,g,b]}),a&&x&&(0,s.jsxs)("div",{className:"pb-3 pl-5 space-y-3",children:[t.description&&(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:t.description}),u.length>0&&(0,s.jsxs)("div",{className:"rounded-lg bg-background p-3 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)($.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("span",{className:"text-[11px] font-semibold text-foreground",children:o("taskAcceptanceCriteria")})]}),(0,s.jsx)("div",{className:"space-y-1.5",children:u.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsx)("p",{className:"text-[11px] leading-snug text-foreground/80 flex-1",children:e.description}),!1!==e.required&&(0,s.jsx)("span",{className:"shrink-0 text-[10px] font-medium text-[#E65100] dark:text-[#F0A050]",children:d("required")})]},t))})]})]})]})}var en=a(44072);let er=(0,u.A)("message-square-text",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]]);var ei=a(80513),el=a(71507),eo=a(76637),ed=a(42885);let ec=(0,ed.createServerReference)("4003480689be798cab3e5122ccf833731d47db2e3f",ed.callServer,void 0,ed.findSourceMapURL,"getElaborationAction");var eu=a(79099);function ex(e){let{idea:t,proposals:a,tasks:i,onSelectTask:l}=e,o=(0,r.c)("ideaTracker"),d=(0,r.c)(),[c,u]=(0,n.useState)(null),[x,m]=(0,n.useState)(new Set);(0,n.useEffect)(()=>{"open"!==t.status&&ec(t.uuid).then(e=>{e.success&&e.data&&u(e.data)})},[t.uuid,t.status]);let p=(0,n.useMemo)(()=>"open"===t.status?"idea_created":"elaborating"===t.status||0===a.length?"elaboration":a.some(e=>"approved"===e.status)&&i.length>0?"tasks":"proposal",[t.status,a,i]),h=(0,n.useMemo)(()=>{let e=["idea_created","elaboration","proposal","tasks"],t=e.indexOf(p);return e.map((e,a)=>({id:e,labelKey:({idea_created:"panel.timeline.ideaCreated",elaboration:"panel.timeline.elaboration",proposal:"panel.timeline.proposal",tasks:"panel.timeline.tasksProgress"})[e],status:a<t?"completed":a===t?"active":"upcoming",icon:({idea_created:(0,s.jsx)(en.A,{className:"h-3.5 w-3.5"}),elaboration:(0,s.jsx)(er,{className:"h-3.5 w-3.5"}),proposal:(0,s.jsx)(z.A,{className:"h-3.5 w-3.5"}),tasks:(0,s.jsx)($.A,{className:"h-3.5 w-3.5"})})[e]}))},[p]);(0,n.useEffect)(()=>{let e=h.find(e=>"active"===e.status);e&&m(new Set([e.id]))},[p]);let f=(0,n.useCallback)(e=>{m(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},[]),g=(0,n.useMemo)(()=>"open"===t.status?o("panel.timeline.noElaboration"):"skipped"===t.elaborationStatus?o("panel.timeline.elaborationSkipped"):"resolved"===t.elaborationStatus&&c?o("panel.timeline.elaborationComplete",{count:c.summary.totalQuestions}):"elaborating"===t.status?o("panel.timeline.elaborationInProgress"):c&&c.summary.totalQuestions>0?o("panel.timeline.elaborationComplete",{count:c.summary.totalQuestions}):o("panel.timeline.noElaboration"),[t.status,t.elaborationStatus,c,o]),b=(0,n.useMemo)(()=>{if(0===a.length)return o("panel.timeline.noProposal");let e=a.filter(e=>"approved"===e.status).length,t=a.filter(e=>"pending"===e.status).length;if(e>0&&1===a.length)return o("panel.timeline.proposalApproved");if(e>0)return o("panel.timeline.proposalsApproved",{count:e,total:a.length});if(t>0)return o("panel.timeline.proposalPending");switch(a[0].status){case"draft":default:return o("panel.timeline.proposalDraft");case"rejected":return o("panel.timeline.proposalRejected")}},[a,o]),v=(0,n.useMemo)(()=>{let e=0,t=0;for(let l of a){var s,n,r,i;e+=null!=(r=null==(s=l.documentDrafts)?void 0:s.length)?r:0,t+=null!=(i=null==(n=l.taskDrafts)?void 0:n.length)?i:0}return{docCount:e,taskDraftCount:t}},[a]),j=(0,n.useMemo)(()=>{let e=i.filter(e=>"done"===e.status||"closed"===e.status).length,t=i.filter(e=>"in_progress"===e.status).length;return{done:e,inProgress:t,toVerify:i.filter(e=>"to_verify"===e.status).length,open:i.filter(e=>"open"===e.status||"assigned"===e.status).length,total:i.length}},[i]);return(0,s.jsx)("div",{className:"space-y-0",children:h.map((e,n)=>{let r=x.has(e.id),u=n===h.length-1;return(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center w-5 shrink-0",children:[(0,s.jsx)("div",{className:"mt-1",children:"completed"===e.status?(0,s.jsx)("div",{className:"h-5 w-5 rounded-full bg-[#E0F2F1] dark:bg-[#12292a] flex items-center justify-center",children:(0,s.jsx)(el.A,{className:"h-3 w-3 text-[#00796B] dark:text-[#4FD1C0]"})}):"active"===e.status?(0,s.jsx)("div",{className:"h-5 w-5 rounded-full bg-primary flex items-center justify-center",children:(0,s.jsx)(eo.A,{className:"h-2 w-2 fill-white text-white"})}):(0,s.jsx)("div",{className:"h-5 w-5 rounded-full border-2 border-dashed border-[#D9D9D9] dark:border-[#3a3a40] flex items-center justify-center",children:(0,s.jsx)(eo.A,{className:"h-2 w-2 text-muted-foreground"})})}),!u&&(0,s.jsx)("div",{className:"flex-1 w-px bg-border mt-1 min-h-[8px]"})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 ".concat(u?"pb-0":"pb-4"),children:[(0,s.jsxs)("button",{onClick:()=>f(e.id),className:"flex items-center gap-1.5 w-full text-left group cursor-pointer",children:[r?(0,s.jsx)(q.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"text-[13px] font-medium ".concat("active"===e.status?"text-primary":"completed"===e.status?"text-foreground":"text-muted-foreground"),children:o(e.labelKey)}),!r&&(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground truncate ml-1",children:(e=>{switch(e.id){case"idea_created":return t.createdBy?t.createdBy.name:"";case"elaboration":return g;case"proposal":return b;case"tasks":return i.length>0?o("panel.timeline.tasksComplete",{done:j.done,total:j.total}):o("panel.timeline.noTasks");default:return""}})(e)})]}),(e=>{let n=x.has(e.id);switch(e.id){case"idea_created":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[t.createdBy&&(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.createdBy",{name:t.createdBy.name})}),(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:(0,eu.fw)(t.createdAt,d)}),t.content&&(0,s.jsxs)("p",{className:"text-[12px] text-muted-foreground line-clamp-2",children:[t.content.slice(0,120),t.content.length>120?"...":""]})]}):null;case"elaboration":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:g}),c&&c.rounds.length>0&&(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.rounds",{count:c.rounds.length})})]}):null;case"proposal":return n?(0,s.jsxs)("div",{className:"mt-2 space-y-1.5",children:[(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:b}),a.length>0&&(0,s.jsxs)("div",{className:"space-y-1",children:[v.docCount>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,s.jsx)(ei.A,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:o("panel.timeline.documents",{count:v.docCount})})]}),v.taskDraftCount>0&&(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",children:[(0,s.jsx)($.A,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:o("panel.timeline.tasks",{count:v.taskDraftCount})})]})]})]}):null;case"tasks":return n?(0,s.jsx)("div",{className:"mt-2 space-y-2",children:0===i.length?(0,s.jsx)("p",{className:"text-[12px] text-muted-foreground",children:o("panel.timeline.noTasks")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex-1 h-1.5 rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] overflow-hidden flex",children:[j.done>0&&(0,s.jsx)("div",{className:"h-full bg-[#00796B]",style:{width:"".concat(j.done/j.total*100,"%")}}),j.inProgress>0&&(0,s.jsx)("div",{className:"h-full bg-[#1976D2]",style:{width:"".concat(j.inProgress/j.total*100,"%")}}),j.toVerify>0&&(0,s.jsx)("div",{className:"h-full bg-[#7B1FA2]",style:{width:"".concat(j.toVerify/j.total*100,"%")}})]}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground shrink-0",children:o("panel.timeline.tasksComplete",{done:j.done,total:j.total})})]}),(0,s.jsxs)("div",{className:"space-y-1",children:[i.slice(0,5).map(e=>(0,s.jsxs)("button",{onClick:()=>l(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2 py-1.5 hover:bg-secondary transition-colors group cursor-pointer",children:[(0,s.jsx)(V.A,{className:"h-3 w-3 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,s.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,eu.eT)(e.status))}),(0,s.jsx)("span",{className:"flex-1 text-[12px] text-foreground truncate group-hover:text-primary",children:e.title})]},e.uuid)),i.length>5&&(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground px-2",children:o("panel.timeline.moreItems",{count:i.length-5})})]})]})}):null;default:return null}})(e)]})]},e.id)})})}let em=(0,ed.createServerReference)("601f22d9d4637a9dd8d2270bc2f046f85fbe373254",ed.callServer,void 0,ed.findSourceMapURL,"getReportsForIdeaAction");function ep(e){let{projectUuid:t,ideaUuid:a,proposals:i,onDocClick:l}=e,o=(0,r.c)("idea"),c=(0,r.c)("documents"),[u,x]=(0,n.useState)([]),[m,p]=(0,n.useState)(!0),f=i.some(e=>"approved"===e.status),b=(0,n.useCallback)(async()=>{if(!f){x([]),p(!1);return}try{let e=await em(t,a);if(e.success){let t=[...e.data].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime());x(t.map(e=>{var t;return{uuid:e.uuid,title:e.title,type:e.type,content:null!=(t=e.content)?t:null,createdAt:e.createdAt}}))}}catch(e){X.q.error("Failed to fetch reports for idea:",e)}finally{p(!1)}},[t,a,f]);return((0,n.useEffect)(()=>{p(!0),b()},[b]),(0,N.eV)("document",b),m)?f?(0,s.jsx)("div",{className:"flex items-center justify-center py-3",children:(0,s.jsx)(d.A,{className:"h-4 w-4 animate-spin text-primary"})}):null:0===u.length?null:(0,s.jsxs)("div",{className:"mt-6 space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-[1px] text-muted-foreground",children:o("reportsList")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:u.length}),(0,s.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:["\xb7 ",o("reportsAcrossProposals")]})]}),(0,s.jsx)("div",{className:"space-y-0",children:u.map(e=>(0,s.jsxs)(h.$,{variant:"ghost",className:"w-full justify-start h-auto text-left flex items-center gap-2.5 py-3.5 hover:bg-background transition-colors cursor-pointer -mx-1 px-1 rounded-lg",onClick:()=>{var t;return l({title:e.title,type:"report",content:null!=(t=e.content)?t:""})},children:[(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)(g.E,{variant:"outline",className:"shrink-0 text-[10px] font-medium border-border text-muted-foreground bg-secondary px-2 py-0.5 font-mono",children:c(J.y[e.type]||"typeOther")}),(0,s.jsx)("span",{className:"flex-1 min-w-0 text-left text-[13px] text-foreground truncate",children:e.title})]},e.uuid))})]})}var eh=a(43322),ef=a(88839);let eg=["in_progress","to_verify","open","assigned","done","closed"];function eb(e){let{tasks:t,projectUuid:a,proposalUuids:i,onSelectTask:l}=e,o=(0,r.c)("ideaTracker"),[d,c]=(0,n.useState)({}),u=(0,n.useMemo)(()=>t.map(e=>e.uuid),[t]),x=(0,n.useCallback)(async()=>{if(0===u.length)return;let e=await (0,ef.h)(u);e.success&&e.data&&c(e.data)},[u]);(0,n.useEffect)(()=>{x()},[x]),(0,N.eV)("task",x);let m=(0,n.useMemo)(()=>{let e=[];for(let a of eg){let s=t.filter(e=>e.status===a);s.length>0&&e.push({status:a,tasks:s})}let a=new Set(eg),s=t.filter(e=>!a.has(e.status));return s.length>0&&e.push({status:"other",tasks:s}),e},[t]),[p,h]=(0,n.useState)(new Set),f=(0,n.useMemo)(()=>{let e=t.length,a=t.filter(e=>"done"===e.status||"closed"===e.status).length,s=0,n=0,r=0,i=0;for(let e of t)e.acceptanceSummary&&(s+=e.acceptanceSummary.total,n+=e.acceptanceSummary.passed,r+=e.acceptanceSummary.required,i+=e.acceptanceSummary.requiredPassed);return{total:e,done:a,acTotal:s,acPassed:n,acRequired:r,acRequiredPassed:i}},[t]);return 0===t.length?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 py-12 text-center",children:[(0,s.jsx)($.A,{className:"h-8 w-8 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:o("panel.taskList.noTasks")})]}):(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-lg bg-[#FAFAF7] dark:bg-[#1e1e1c] px-3 py-2",children:[(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:o("panel.taskList.summary",{done:f.done,total:f.total})}),f.acTotal>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:"\xb7"}),(0,s.jsx)("span",{className:"text-[12px] text-muted-foreground",children:o("panel.taskList.acSummary",{passed:f.acRequiredPassed,total:f.acRequired})})]}),i.length>0&&(0,s.jsxs)(L(),{href:"/projects/".concat(a,"/tasks?proposalUuids=").concat(i.join(",")),className:"ml-auto flex items-center gap-1 text-[13px] font-medium text-primary shrink-0",children:[o("panel.taskList.viewKanban"),(0,s.jsx)(O.A,{className:"h-3.5 w-3.5"})]})]}),m.map(e=>{let t=p.has(e.status);return(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{onClick:()=>{var t;return t=e.status,void h(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},className:"flex items-center gap-2 w-full text-left py-1.5 group cursor-pointer",children:[t?(0,s.jsx)(O.A,{className:"h-3.5 w-3.5 text-muted-foreground"}):(0,s.jsx)(q.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,s.jsx)("span",{className:"h-2 w-2 rounded-full shrink-0 ".concat((0,eu.eT)(e.status))}),(0,s.jsx)("span",{className:"text-[13px] font-medium text-foreground",children:function(e,t){switch(e){case"in_progress":return t("panel.taskList.inProgress");case"to_verify":return t("panel.taskList.toVerify");case"open":return t("panel.taskList.open");case"assigned":return t("panel.taskList.assigned");case"done":return t("panel.taskList.done");case"closed":return t("panel.taskList.closed");default:return e}}(e.status,o)}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground ml-auto",children:e.tasks.length})]}),!t&&(0,s.jsx)("div",{className:"ml-3 space-y-0.5",children:e.tasks.map(e=>{let t=d[e.uuid]||0,a=e.acceptanceSummary;return(0,s.jsx)(H.D,{entityType:"task",entityUuid:e.uuid,badgeInside:!0,children:(0,s.jsxs)("button",{onClick:()=>l(e.uuid),className:"flex items-center gap-2 w-full text-left rounded-md px-2.5 py-2 hover:bg-secondary transition-colors group cursor-pointer",children:[(0,s.jsx)(V.A,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0 group-hover:text-primary"}),(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0 ".concat((0,eu.eT)(e.status))}),(0,s.jsx)("span",{className:"flex-1 text-[13px] text-foreground truncate group-hover:text-primary",children:e.title}),a&&a.total>0&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-0.5 shrink-0 rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] px-1.5 py-0.5 text-[10px] text-muted-foreground",children:[(0,s.jsx)(el.A,{className:"h-2.5 w-2.5"}),a.requiredPassed,"/",a.required]}),e.assignee&&(0,s.jsxs)("span",{className:"shrink-0 inline-flex items-center gap-1 text-[10px] text-muted-foreground max-w-[72px] truncate",title:e.assignee.name,children:[(0,P.bB)(e.assignee)?(0,s.jsx)(R.AgentAvatar,{name:e.assignee.name,size:14,className:"shrink-0 rounded-full"}):(0,s.jsx)(eh.A,{className:"h-2.5 w-2.5 shrink-0"}),e.assignee.name.split(/[@\s]/)[0]]}),t>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center h-4 min-w-[16px] rounded-full bg-[#E8F5E9] dark:bg-[#14281a] text-[#2E7D32] dark:text-[#5FD07E] text-[9px] font-semibold shrink-0",title:o("panel.taskList.workersActive",{count:t}),children:t})]})},e.uuid)})})]},e.status)})]})}var ev=a(4548);function ej(e){let{ideaUuid:t}=e,a=(0,r.c)(),[i,l]=(0,n.useState)([]),[o,c]=(0,n.useState)(!0),u=(0,n.useCallback)(async()=>{c(!0),l((await (0,ev.x)(t)).activities),c(!1)},[t]);return(0,n.useEffect)(()=>{u()},[u]),(0,s.jsxs)("div",{className:"mt-5",children:[(0,s.jsx)(j.J,{className:"text-[11px] font-medium uppercase tracking-wider text-muted-foreground",children:a("common.activity")}),(0,s.jsx)("div",{className:"mt-2",children:o?(0,s.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,s.jsx)(d.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):0===i.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground italic",children:a("common.noActivity")}):i.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-stretch gap-2.5",children:[(0,s.jsxs)("div",{className:"flex flex-col items-center w-2 shrink-0",children:[(0,s.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full border-[1.5px] border-[#D9D9D9] dark:border-[#3a3a40] bg-card"}),t<i.length-1&&(0,s.jsx)("div",{className:"flex-1 w-px bg-border mt-1"})]}),(0,s.jsxs)("div",{className:"flex-1 pb-3",children:[(0,s.jsx)("p",{className:"text-[13px] text-foreground",children:function(e,t){let{action:a,actorName:s}=e;switch(a){case"created":case"idea_created":return t("activity.ideaCreated",{actor:s});case"assigned":case"idea_assigned":return t("activity.ideaAssigned",{actor:s});case"claimed":case"idea_claimed":return t("activity.ideaClaimed",{actor:s});case"released":case"idea_released":return t("activity.ideaReleased",{actor:s});case"status_changed":case"idea_status_changed":return t("activity.ideaStatusChanged",{actor:s});case"edited":case"idea_edited":return t("activity.ideaEdited",{actor:s});case"reparented":case"idea_reparented":return t("activity.ideaReparented",{actor:s});case"elaboration_started":return t("activity.elaborationStarted",{actor:s});case"elaboration_answered":return t("activity.elaborationAnswered",{actor:s});case"elaboration_skipped":return t("activity.elaborationSkipped",{actor:s});case"elaboration_resolved":return t("activity.elaborationResolved",{actor:s});case"elaboration_followup":return t("activity.elaborationFollowup",{actor:s});default:return t("activity.genericAction",{actor:s,action:a})}}(e,a)}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:(0,eu.fw)(e.createdAt,a)})]})]},e.uuid))})]})}var ey=a(36244);function ek(e){let{ideaUuid:t,currentUserUuid:a,commentCount:i,onCommentCountChange:l}=e,o=(0,r.c)("ideaTracker"),[d,c]=(0,n.useState)("comments");return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex gap-1 rounded-lg bg-secondary p-0.5",children:[(0,s.jsxs)("button",{onClick:()=>c("comments"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors flex items-center justify-center gap-1.5 cursor-pointer ".concat("comments"===d?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:[o("panel.activityTab.comments"),i>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-secondary text-muted-foreground text-[10px] font-semibold leading-none",children:i})]}),(0,s.jsx)("button",{onClick:()=>c("activity"),className:"flex-1 rounded-md px-3 py-1.5 text-[13px] font-medium transition-colors cursor-pointer ".concat("activity"===d?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-muted-foreground"),children:o("panel.activityTab.activity")})]}),(0,s.jsx)("div",{children:"activity"===d?(0,s.jsx)(ej,{ideaUuid:t}):(0,s.jsx)(ey.$m,{targetType:"idea",targetUuid:t,currentUserUuid:a,onCountChange:l,compact:!0})})]})}var eN=a(61169),ew=a(9882),eC=a(26226);let eS=(0,u.A)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var eA=a(6153),eF=a(67566),eE=a(91069),e_=a(49417);let eD=(0,ed.createServerReference)("40c065f13e2788512e8d7141512ea0bcdd460c03fe",ed.callServer,void 0,ed.findSourceMapURL,"getProjectIdeasForPickerAction"),eR=(0,ed.createServerReference)("60f59b614b1d69ec3e2bff105f3b184b3a0c4bdf5b",ed.callServer,void 0,ed.findSourceMapURL,"setIdeaParentAction");function eU(e){let{open:t,onOpenChange:a,ideaUuid:o,ideaTitle:c,projectUuid:u,currentParentUuid:x,descendantUuids:m,onChanged:p,onCloseAutoFocus:f}=e,g=(0,r.c)("ideaTracker.lineage"),b=(0,r.c)("common"),v=(0,i.r)(),[j,y]=(0,n.useState)([]),[k,N]=(0,n.useState)(!1),[w,C]=(0,n.useState)(!1),[S,A]=(0,n.useState)(!1),[F,E]=(0,n.useState)(null),_=new Set([o,...m]),D=(0,n.useCallback)(async()=>{C(!0),E(null);try{let e=await eD(u);e.success?(y(e.data),N(e.hasMore)):E(e.error)}catch(e){X.q.error("Failed to load parent candidates:",e),E(g("saveFailed"))}C(!1)},[u,g]);(0,n.useEffect)(()=>{t&&D()},[t,D]);let R=async e=>{if(!S){A(!0),E(null);try{let t=await eR(o,e);t.success?(l.oR.success(e?g("save"):g("detach")),a(!1),v.refresh(),p()):E(t.error||g("saveFailed"))}catch(e){E(e instanceof Error?e.message:g("saveFailed"))}A(!1)}};return(0,s.jsx)(eF.lG,{open:t,onOpenChange:a,children:(0,s.jsxs)(eF.Cf,{onCloseAutoFocus:f,children:[(0,s.jsxs)(eF.c7,{children:[(0,s.jsx)(eF.L3,{children:g("setParentTitle")}),(0,s.jsx)(eF.rr,{children:g("setParentDescription",{title:c})})]}),(0,s.jsxs)("div",{className:"min-w-0 space-y-3 pt-1",children:[w?(0,s.jsx)("div",{className:"flex h-40 items-center justify-center",children:(0,s.jsx)(d.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):(0,s.jsx)("div",{className:"rounded-md border border-border",children:(0,s.jsxs)(eE.uB,{children:[(0,s.jsx)(eE.G7,{placeholder:g("searchPlaceholder")}),(0,s.jsxs)(eE.oI,{children:[(0,s.jsx)(eE.xL,{children:g("noCandidates")}),(0,s.jsx)(eE.L$,{children:j.map(e=>{let t=_.has(e.uuid),a=e.uuid===x;return(0,s.jsxs)(eE.h_,{value:e.title,disabled:t,onSelect:()=>{t||R(e.uuid)},className:(0,e_.cn)("flex min-w-0 items-center justify-between gap-2",t&&"opacity-55",a&&"bg-primary/10"),children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-[13px] text-foreground",children:e.title}),t&&(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-[11px] font-medium text-[#B0654A] dark:text-[#EBA890]",children:[(0,s.jsx)(eS,{className:"h-3 w-3"}),g("cycleBlocked")]})]},e.uuid)})})]})]})}),(0,s.jsxs)("div",{className:"flex items-start gap-2 rounded-md bg-[#FBF0EB] dark:bg-[#221e1b] px-3 py-2.5",children:[(0,s.jsx)(eA.A,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-[#B0654A] dark:text-[#EBA890]"}),(0,s.jsx)("p",{className:"text-[12px] leading-relaxed text-[#9A5238] dark:text-[#E9A088]",children:g("cycleWarning")})]}),k&&(0,s.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",role:"status",children:g("pickerTruncated")}),F&&(0,s.jsx)("p",{className:"text-xs text-destructive",role:"alert",children:F})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 pt-2",children:[x?(0,s.jsx)(h.$,{variant:"outline",className:"border-border",onClick:()=>R(null),disabled:S,children:g("detach")}):(0,s.jsx)("span",{}),(0,s.jsx)(h.$,{variant:"outline",className:"border-border",onClick:()=>a(!1),disabled:S,children:b("cancel")})]})]})})}var eT=a(25531),eP=a(26552),eI=a(71386);let eM=(0,ed.createServerReference)("4036f9aca9363fd7a0f11c8b3697324dfe256815bc",ed.callServer,void 0,ed.findSourceMapURL,"getIdeaAction");var eB=a(86579),eL=a(20344),ez=a(82078),eO=a(30117),eV=a(91598),eq=a(27477),e$=a(16832),eH=a(53511),eK=a(78837),eG=a(81145),eJ=a(91560),eQ=a(77392),eW=a(14006),eX=a(56791),eZ=a(42731),eY=a(35170),e0=a(17036);let e1=(0,ed.createServerReference)("4086e75f0a570191f6aa43d2e6d2ae1eb3625fee82",ed.callServer,void 0,ed.findSourceMapURL,"researchEligibilityAction"),e2=(0,ed.createServerReference)("7066101d4a51f8c0a7b92b053e4fbcbb1657c06f44",ed.callServer,void 0,ed.findSourceMapURL,"researchIdeaAction");var e5=a(63145),e3=a(65484),e4=a(55544);function e6(e){var t,a;let{ideaUuid:i,assignee:o,disabledReason:d,refreshKey:c,onStarted:u,renderAction:x,onCloseAutoFocus:m}=e,p=(0,r.c)("research"),h=(0,e4.kz)(),f=(0,e0.Q9)(o),g=null!==f&&(null!=(t=null==h?void 0:h.connections)?t:[]).some(e=>e.agentUuid===f&&"online"===e.effectiveStatus),[b,v]=(0,n.useState)("loading"),[j,y]=(0,n.useState)(!1),k=(0,n.useRef)(!1),[N,w]=(0,n.useState)(0),C=(0,n.useRef)(void 0),S=(0,n.useCallback)(async(e,t,a)=>(C.current={agentUuid:t,instanceUuid:a},{success:!0}),[]),{start:A,pickerState:F,confirmPick:E,confirmTemporary:_,cancelPick:D,isResolving:R}=(0,e5.E)({reassignNoWake:S,previewIdeaUuid:i});(0,n.useEffect)(()=>{let e=!0;v("loading");let t=()=>{e1(i).then(t=>{e&&v(t.eligible?void 0:t.reason)}).catch(()=>{e&&v("unknown")})};t(),window.addEventListener("focus",t);let a=setInterval(t,15e3);return()=>{e=!1,clearInterval(a),window.removeEventListener("focus",t)}},[i,null==o?void 0:o.uuid,f,c,N]);let U=d||(j||R?p("dispatching"):f?g?b?p(b):void 0:p("offlineHint"):p("assignmentHint")),T=async function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(!k.current){k.current=!0,y(!0);try{let a=e||C.current?await e2(i,e,C.current):await e2(i);a.success?(v(void 0),l.oR.success(p("dispatched")),C.current=void 0,u()):(t&&"assignment_required"===a.errorCode&&(0,e0.Q9)(o)?(k.current=!1,A({ideaUuid:i,wake:e=>T(e,!1)})):l.oR.error(p(a.errorCode)),w(e=>e+1))}catch(e){l.oR.error(p("unknown"))}finally{k.current=!1,y(!1)}}};return(0,s.jsxs)(s.Fragment,{children:[x({label:p("button"),busy:j||R,disabledReason:U,onSelect:()=>{U||k.current||(C.current=void 0,T())}}),(0,s.jsx)(e3.V,{open:null!==F,onCloseAutoFocus:m,agentName:"",instances:null!=(a=null==F?void 0:F.instances)?a:[],agentUuid:null==F?void 0:F.agentUuid,onConfirm:E,onTemporaryConfirm:_,onCancel:D})]})}var e8=a(97948),e7=a(76753);let e9={default:"",research:"text-[#9A6700] focus:text-[#7A5100] focus:bg-[#FFF4CE] dark:text-[#F2C45D] dark:focus:text-[#F7D990] dark:focus:bg-[#3B2D12]",verify:"text-[#1976D2] focus:text-[#155FA0] focus:bg-[#E3F2FD] dark:text-[#64B5F6] dark:focus:text-[#90CAF9] dark:focus:bg-[#102A43]",develop:"text-[#2E7D32] focus:text-[#256628] focus:bg-[#E8F5E9] dark:text-[#72D572] dark:focus:text-[#9AE69A] dark:focus:bg-[#17351D]",yolo:"text-[#6A4FB6] focus:text-[#584098] focus:bg-[#F1ECFA] dark:text-[#B39DDB] dark:focus:text-[#D1C4E9] dark:focus:bg-[#2A2040]",destructive:"text-destructive focus:text-destructive focus:bg-destructive/10"},te="(max-width: 639px)";function tt(e){var t;if(!window.matchMedia)return()=>{};let a=window.matchMedia(te);return null==(t=a.addEventListener)||t.call(a,"change",e),()=>{var t;return null==(t=a.removeEventListener)?void 0:t.call(a,"change",e)}}function ta(){var e,t;return!!(null==(e=(t=window).matchMedia)?void 0:e.call(t,te).matches)}function ts(e){let{label:t,icon:a,reason:r,onSelect:i,onTooltipEscape:l,tone:o="default"}=e,d=(0,n.useId)(),c=(0,s.jsxs)(eX._2,{"aria-label":t,"aria-disabled":!!r,"aria-describedby":r?d:void 0,variant:"destructive"===o?"destructive":"default",className:(0,e_.cn)(e9[o],r&&"cursor-default text-muted-foreground focus:bg-accent focus:text-muted-foreground dark:focus:bg-accent dark:text-muted-foreground dark:focus:text-muted-foreground"),onKeyDown:e=>{"Enter"===e.key&&(0,e7.P)(e)&&e.preventDefault()},onSelect:e=>{r?e.preventDefault():i()},children:[a,(0,s.jsx)("span",{children:t}),r&&(0,s.jsx)("span",{id:d,className:"sr-only",children:r})]});return r?(0,s.jsxs)(U.m_,{children:[(0,s.jsx)(U.k$,{asChild:!0,children:c}),(0,s.jsx)(U.ZI,{side:"left",className:"z-[120] max-w-64",onEscapeKeyDown:l,children:r})]}):c}function tn(e){let{label:t,icon:a,reason:r,onSelect:i,tone:l="default"}=e,o=(0,n.useId)();return(0,s.jsxs)(h.$,{type:"button",variant:"ghost","aria-label":t,"aria-disabled":!!r,"aria-describedby":r?o:void 0,className:(0,e_.cn)("focus-visible:ring-ring flex h-auto min-h-12 w-full items-center gap-3 whitespace-normal rounded-lg px-3 py-2 text-left text-sm outline-none transition-colors","hover:bg-accent focus-visible:ring-2 [&_svg]:size-5 [&_svg]:shrink-0",e9[l],r&&"cursor-default text-muted-foreground hover:bg-transparent focus:bg-accent focus:text-muted-foreground dark:focus:bg-accent dark:text-muted-foreground dark:focus:text-muted-foreground"),onKeyDown:e=>{"Enter"===e.key&&(0,e7.P)(e)&&e.preventDefault()},onClick:()=>{r||i()},children:[a,(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block font-medium",children:t}),r&&(0,s.jsx)("span",{id:o,className:"mt-0.5 block break-words whitespace-normal text-xs leading-4 text-muted-foreground",children:r})]})]})}function tr(e){let t=(0,r.c)(),a=(0,r.c)("ideaTracker.panel.actions"),[i,o]=(0,n.useState)(!1),d=(0,n.useSyncExternalStore)(tt,ta,()=>!1),u=e.busy?a("busy"):void 0,m=u||e.stageReason||e.stageDataReason,f=async t=>{try{let s=t?new URL("/projects/".concat(e.projectUuid,"/dashboard?panel=").concat(e.ideaUuid),window.location.origin).href:e.ideaUuid;await navigator.clipboard.writeText(s),l.oR.success(a(t?"linkCopied":"uuidCopied"))}catch(e){l.oR.error(a("copyFailed"))}},g={ideaUuid:e.ideaUuid,assignee:e.assignee,assigneeName:e.assigneeName,proposals:e.proposals,tasks:e.tasks,onStarted:e.onStarted,disabledReason:m,onCloseAutoFocus:e.onCloseAutoFocus};return(0,s.jsx)(e6,{ideaUuid:e.ideaUuid,assignee:e.assignee,disabledReason:u,onCloseAutoFocus:e.onCloseAutoFocus,refreshKey:JSON.stringify([e.proposals,e.tasks]),onStarted:e.onStarted,renderAction:r=>(0,s.jsx)(eY.w,{...g,disabledReason:m||(r.busy?a("busy"):void 0),renderAction:l=>(0,s.jsx)(e8.s,{...g,disabledReason:m||(l.busy?a("busy"):void 0),renderAction:m=>{let g=u||(l.busy||m.busy||r.busy?a("busy"):void 0),b=[[{label:r.label,icon:(0,s.jsx)(eq.A,{}),reason:g||r.disabledReason,onSelect:r.onSelect,tone:"research"},{label:t("elaboration.verifyButton"),icon:(0,s.jsx)(e$.A,{}),reason:g||e.stageReason||e.verifyReason,onSelect:e.onVerify,tone:"verify"},{label:l.label,icon:(0,s.jsx)(eH.A,{}),reason:g||l.disabledReason,onSelect:l.onSelect,tone:"develop"},{label:m.label,icon:(0,s.jsx)(eK.A,{}),reason:g||m.disabledReason,onSelect:m.onSelect,tone:"yolo"}],[{label:t("ideaTracker.lineage.deriveIdea"),icon:(0,s.jsx)(c.A,{}),reason:g,onSelect:e.onDerive,tone:"default"},{label:t("ideaTracker.lineage.setParentTitle"),icon:(0,s.jsx)(x,{}),reason:g,onSelect:e.onSetParent,tone:"default"},{label:t("ideas.actions.move"),icon:(0,s.jsx)(eG.A,{}),reason:g,onSelect:e.onMove,tone:"default"},{label:t("ideas.editIdea"),icon:(0,s.jsx)(eJ.A,{}),reason:g||e.editReason,onSelect:e.onEdit,tone:"default"}],[{label:a("copyLink"),icon:(0,s.jsx)(p.A,{}),onSelect:()=>{f(!0)},tone:"default"},{label:a("copyUuid"),icon:(0,s.jsx)(eQ.A,{}),onSelect:()=>{f(!1)},tone:"default"}],[{label:t("ideas.deleteIdea"),icon:(0,s.jsx)(eW.A,{}),reason:g,onSelect:e.onDelete,tone:"destructive"}]];return d?(0,s.jsxs)(eZ.cj,{open:i,onOpenChange:o,children:[(0,s.jsx)(eZ.CG,{asChild:!0,children:(0,s.jsxs)(h.$,{ref:e.triggerRef,variant:"outline",size:"sm",className:"h-11 gap-1.5 border-border px-3",children:[t("common.actions"),(0,s.jsx)(q.A,{className:"size-4","aria-hidden":!0})]})}),(0,s.jsxs)(eZ.h,{side:"bottom",className:"max-h-[min(82svh,44rem)] gap-0 overflow-hidden rounded-t-2xl pb-[max(1rem,env(safe-area-inset-bottom))]",onCloseAutoFocus:e.onCloseAutoFocus,children:[(0,s.jsx)("div",{className:"mx-auto mt-2 h-1 w-10 shrink-0 rounded-full bg-muted-foreground/25","aria-hidden":!0}),(0,s.jsxs)(eZ.Fm,{className:"border-b px-4 pt-3 pb-3 text-left",children:[(0,s.jsx)(eZ.qp,{children:t("common.actions")}),(0,s.jsx)(eZ.Qs,{className:"sr-only",children:t("common.actions")})]}),(0,s.jsx)("div",{className:"overflow-y-auto overscroll-contain px-2 py-2",children:b.map((e,t)=>(0,s.jsx)("div",{className:(0,e_.cn)(t>0&&"mt-1 border-t pt-1"),children:e.map(e=>(0,s.jsx)(tn,{...e,onSelect:()=>{o(!1),e.onSelect()}},e.label))},t))})]})]}):(0,s.jsx)(U.Bc,{delayDuration:300,children:(0,s.jsxs)(eX.rI,{open:i,onOpenChange:o,children:[(0,s.jsx)(eX.ty,{asChild:!0,children:(0,s.jsxs)(h.$,{ref:e.triggerRef,variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border px-2.5",children:[t("common.actions"),(0,s.jsx)(q.A,{className:"h-3.5 w-3.5","aria-hidden":!0})]})}),(0,s.jsx)(eX.SQ,{align:"end",className:"z-[100] w-64 max-w-[calc(100vw-1rem)] max-h-[var(--radix-dropdown-menu-content-available-height)] overflow-y-auto",children:b.map((e,t)=>(0,s.jsxs)(n.Fragment,{children:[t>0&&(0,s.jsx)(eX.mB,{}),e.map(e=>(0,s.jsx)(ts,{...e,onTooltipEscape:()=>o(!1)},e.label))]},t))})]})})}})})})}var ti=a(39968),tl=a(48612),to=a(78622),td=a(3562),tc=a(74046);function tu(e){return(0,s.jsx)(tx,{...e},e.ideaUuid)}function tx(e){var t,a,u,C,S,A,F;let{ideaUuid:E,projectUuid:_,currentUserUuid:D,onClose:R,onNavigate:U}=e,T=(0,r.c)(),P=(0,w.F7)(),I=(0,r.c)("ideaTracker"),B=(0,r.c)("status"),L=(0,r.c)("ideaTracker.lineage"),z=(0,i.r)(),O=(0,e4.kz)(),V=null!=(u=null==O?void 0:O.activeSessionsByIdea.get(E))?u:[],[q,$]=(0,n.useState)(null),[H,K]=(0,n.useState)(!0),[G,J]=(0,n.useState)(null),[Y,ee]=(0,n.useState)([]),[et,ea]=(0,n.useState)([]),[es,en]=(0,n.useState)(null),[er,ei]=(0,n.useState)(null),el=(0,n.useRef)(0),eo=(0,n.useRef)(0),[ed,ec]=(0,n.useState)("overview"),[em,eh]=(0,n.useState)(new Set(["overview"])),[ef,eg]=(0,n.useState)(!1),[ev,ej]=(0,n.useState)(0),[ey,eS]=(0,n.useState)(!1),[eA,eF]=(0,n.useState)(!1),[eE,e_]=(0,n.useState)(!1),eD=(0,n.useRef)(null),eR=(0,n.useCallback)(e=>{var t;e.preventDefault(),null==(t=eD.current)||t.focus()},[]),[eq,e$]=(0,n.useState)(null),[eH,eK]=(0,n.useState)(!0),[eG,eJ]=(0,n.useState)(!1),[eQ,eW]=(0,n.useState)(null),[eX,eZ]=(0,n.useState)(!1),{start:eY,pickerState:e0,confirmPick:e1,cancelPick:e2,isResolving:e6}=(0,e5.E)({reassignNoWake:to.U,previewIdeaUuid:null==q?void 0:q.uuid}),[e8,e7]=(0,n.useState)(!1),[e9,te]=(0,n.useState)(""),[tt,ta]=(0,n.useState)(""),[ts,tn]=(0,n.useState)(!1),[tu,tx]=(0,n.useState)(null),[tm,tp]=(0,n.useState)(!1),[th,tf]=(0,n.useState)(!1),[tg,tb]=(0,n.useState)(!1),[tv,tj]=(0,n.useState)(!1),[ty,tk]=(0,n.useState)(null),[tN,tw]=(0,n.useState)(null),[tC,tS]=(0,n.useState)(null),tA=(0,n.useCallback)(e=>{tS(null),tk(e)},[]),tF=(0,n.useCallback)(e=>{tk(null),tw(null),tS(e)},[]),[tE,t_]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=window.matchMedia("(min-width: 960px)");t_(e.matches);let t=e=>t_(e.matches);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]);let[tD,tR]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=setTimeout(()=>tR(!0),300);return()=>clearTimeout(e)},[]);let tU=(0,n.useCallback)(e=>{let t=new URLSearchParams(window.location.search);t.set("tab",e),window.history.replaceState(null,"","".concat(window.location.pathname,"?").concat(t.toString()))},[]),tT=(0,n.useCallback)(async()=>{try{let e=await eM(E);e.success?($(e.data),J(null)):J(I("Not found"===e.error?"panel.notFound":"panel.loadFailed"))}catch(e){J(I("panel.loadFailed"))}finally{K(!1)}},[E,I]);(0,n.useEffect)(()=>{K(!0),tT()},[tT]),(0,N.eV)("idea",tT),(0,N.eV)("proposal",tT),(0,N.eV)("task",tT);let tP=null==q?void 0:q.uuid,tI=null==q?void 0:q.status,tM="".concat(tP,":").concat(tI),tB=(0,n.useCallback)(async()=>{let e=++el.current;if(en(null),tP){if("open"===tI){ee([]),en(tM);return}try{let t=await (0,Q.U)(_,tP);e===el.current&&t.success&&(ee(t.data),en(tM))}catch(e){X.q.error("Failed to fetch proposals:",e)}}},[_,tP,tI,tM]);(0,n.useEffect)(()=>{tB()},[tB]),(0,N.eV)("proposal",tB);let tL=(0,n.useCallback)(async()=>{let e=++eo.current;ei(null);let t=Y.filter(e=>"approved"===e.status);if(0===t.length){ea([]),ei(Y);return}try{let a=await Promise.all(t.map(e=>(0,W.c)(_,e.uuid)));if(e!==eo.current||a.some(e=>!e.success))return;let s=a.flatMap(e=>e.success&&e.data?e.data.map(e=>{var t,a,s;return{uuid:e.uuid,title:e.title,status:e.status,commentCount:null!=(t=e.commentCount)?t:0,assignee:null!=(a=e.assignee)?a:null,acceptanceSummary:null!=(s=e.acceptanceSummary)?s:null}}):[]);ea(s),ei(Y)}catch(e){X.q.error("Failed to fetch tasks:",e)}},[_,Y]);(0,n.useEffect)(()=>{tL()},[tL]),(0,N.eV)("task",tL);let tz=(0,n.useCallback)(async()=>{if(!tP)return;let e=await (0,eL.z)(tP);e.success&&e.data&&e$(e.data),eK(!1)},[tP]);(0,n.useEffect)(()=>{tz()},[tz]),(0,N.eV)("idea",tz);let tO=(0,n.useMemo)(()=>q?function(e,t,a){let s=["overview"];return s.push("elaboration"),t.length>0&&s.push("proposal"),a.length>0&&s.push("tasks"),s.push("activity"),s}(0,Y,et):["overview","activity"],[q,Y,et]),tV=(0,n.useRef)(new URLSearchParams(window.location.search).get("tab")),tq=q?function(e){switch(e){case"open":case"researching":case"answer_questions":return"elaboration";case"planning":case"review_proposal":return"proposal";case"building":case"verify_work":return"tasks";default:return"overview"}}(q.badgeHint):"overview";(0,n.useEffect)(()=>{let e;if(!q||ef)return;let t=tV.current;if(t)if(!tO.includes(t))return;else e=t,tV.current=null,eg(!0);else if(tO.includes(tq))e=tq;else{if("overview"!==tq)return;e="overview"}ec(e),eh(t=>new Set([...t,e])),tU(e)},[null==q?void 0:q.uuid,tq,tO]),(0,n.useEffect)(()=>{eg(!1)},[E]),(0,n.useEffect)(()=>{tO.includes(ed)||ec("overview")},[tO,ed]);let t$=(0,n.useMemo)(()=>et.filter(e=>"in_progress"===e.status||"assigned"===e.status||"to_verify"===e.status).length,[et]),tH=(0,n.useCallback)(()=>{if(!ty)return void tw(null);(0,eB.Q)(ty).then(e=>{e.success&&tw(e.data)}).catch(e=>X.q.error("Failed to load task details:",e))},[ty]);(0,n.useEffect)(()=>{tH()},[tH]),(0,N.eV)("task",tH),(0,n.useEffect)(()=>{e7(!1),te((null==q?void 0:q.title)||""),ta((null==q?void 0:q.content)||""),tx(null)},[null==q?void 0:q.uuid,null==q?void 0:q.title,null==q?void 0:q.content]);let tK=()=>{e7(!1),te((null==q?void 0:q.title)||""),ta((null==q?void 0:q.content)||""),tx(null)},tG=async()=>{if(!q||!e9.trim())return void tx(T("ideas.titleRequired"));tn(!0),tx(null);let e=await (0,eP.J)({ideaUuid:q.uuid,projectUuid:_,title:e9.trim(),content:tt.trim()||null});tn(!1),e.success?(e7(!1),await tT(),z.refresh()):tx(e.error||T("ideas.updateFailed"))},tJ=async()=>{if(!q||eA)return;eF(!0);let e=await (0,eI.Z)(q.uuid,_);eF(!1),e.success&&(R(),z.refresh())},tQ=async()=>{if(!q)return;eJ(!0),eW(null);let e=await (0,ez.e)(q.uuid);eJ(!1),e.success?(eZ(!0),await tT(),z.refresh()):eW(e.error||T("elaboration.verifyFailed"))},tW=async e=>{var t;if(!q)return;tp(!0),$({...q,isContainer:e});let a=await (0,eP.J)({ideaUuid:q.uuid,projectUuid:_,title:q.title,content:null!=(t=q.content)?t:null,isContainer:e});tp(!1),a.success?(await tT(),z.refresh()):($({...q,isContainer:!e}),l.oR.error(a.error||T("ideas.updateFailed")))},tX=(null==q?void 0:q.derivedStatus)||"todo",tZ=(null==q?void 0:q.isContainer)===!0,tY=null!==q&&P,t0=(0,eV.o)({ideaStatus:null==q?void 0:q.status,elaborationStatus:null==q?void 0:q.elaborationStatus,elaboration:eq});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:R}),(0,s.jsxs)("div",{className:"fixed right-0 top-14 md:top-0 z-50 flex h-[calc(100%-3.5rem)] md:h-full w-full md:w-[480px] flex-col border-l border-border bg-card shadow-xl ".concat(tD?"":"animate-in slide-in-from-right duration-300"),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[(0,s.jsx)("div",{className:"flex-1 min-w-0",children:H?(0,s.jsx)("div",{className:"h-5 w-40 animate-pulse rounded bg-secondary"}):q?e8?(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:T("ideas.editIdea")}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider ".concat(tZ?"text-primary":"text-muted-foreground"),children:tZ?L("typeTheme"):L("typeIdea")}),(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:q.title}),(0,s.jsxs)("div",{className:"mt-1.5 flex min-w-0 items-center gap-2",children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2 overflow-hidden",children:[(0,s.jsx)(g.E,{className:eu._5[tX]||eu._5.todo,children:q.badgeHint?I("badge.".concat(eu.Wl[q.badgeHint]||"open")):B(eu.Bj[tX]||"todo")}),tZ&&q.childProgress&&q.childProgress.total>0&&(0,s.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-xs font-medium text-primary",title:L("childrenDone",{done:q.childProgress.done,total:q.childProgress.total}),children:[(0,s.jsx)(tc.C,{done:q.childProgress.done,total:q.childProgress.total,size:13,stroke:2}),q.childProgress.done,"/",q.childProgress.total]}),(0,s.jsx)("span",{className:"min-w-0 truncate whitespace-nowrap text-xs text-muted-foreground",title:(0,td.r)(q.createdAt),children:(0,td.r)(q.createdAt)})]}),V.length>0&&O&&(0,s.jsx)(tl.U,{sessions:V,onSelect:O.openChatForActiveSession,surface:"sidebar",className:"shrink-0"})]})]}):(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:I("panel.notFound")})}),(0,s.jsxs)("div",{className:"flex shrink-0 items-center gap-2 ml-3",children:[q&&!H&&!e8&&P&&(0,s.jsx)(tr,{ideaUuid:q.uuid,projectUuid:_,assignee:q.assignee,assigneeName:null==(t=q.assignee)?void 0:t.name,proposals:Y,tasks:et,triggerRef:eD,busy:eA||eG||e6||ts||tm||null!==e0,stageReason:tZ?L("containerHint"):void 0,stageDataReason:es!==tM||er!==Y?I("panel.actions.loadingStage"):void 0,verifyReason:eH?I("loading"):eX?T("elaboration.verifiedQueuedHint"):t0?void 0:I("panel.actions.verifyUnavailable"),editReason:"elaborated"===q.status?I("panel.actions.editUnavailable"):void 0,onVerify:()=>{!q||q.isContainer||!t0||eX||eH||eG||e6||tm||eY({ideaUuid:q.uuid,wake:tQ})},onDerive:()=>tj(!0),onSetParent:()=>tb(!0),onMove:()=>tf(!0),onEdit:()=>{q&&"elaborated"!==q.status&&(te(q.title),ta(q.content||""),tx(null),e7(!0))},onDelete:()=>e_(!0),onStarted:tT,onCloseAutoFocus:eR},q.uuid),(0,s.jsx)(h.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:e8?tK:R,"aria-label":T("common.close"),children:(0,s.jsx)(o.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),q&&!H&&!e8&&(0,s.jsx)("div",{className:"border-b border-secondary px-6",children:(0,s.jsx)("div",{className:"flex gap-0 -mb-px",children:tO.map(e=>(0,s.jsxs)("button",{onClick:()=>{ec(e),eg(!0),eh(t=>new Set([...t,e])),tU(e)},className:"relative flex items-center gap-1.5 px-3 py-2.5 text-[13px] font-medium transition-colors cursor-pointer ".concat(ed===e?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-muted-foreground"),children:[I("panel.tabs.".concat(e)),"tasks"===e&&t$>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0] text-[10px] font-semibold leading-none",children:t$}),"activity"===e&&ev>0&&(0,s.jsx)("span",{className:"inline-flex items-center justify-center min-w-[18px] h-[18px] px-1 rounded-full bg-secondary text-muted-foreground text-[10px] font-semibold leading-none",children:ev})]},e))})}),(0,s.jsx)(f.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,s.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:H?(0,s.jsxs)("div",{className:"flex flex-1 items-center justify-center py-12",children:[(0,s.jsx)(d.A,{className:"h-6 w-6 animate-spin text-primary"}),(0,s.jsx)("span",{className:"ml-2 text-sm text-muted-foreground",children:I("loading")})]}):G?(0,s.jsx)("div",{className:"flex flex-1 items-center justify-center py-12",children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:G})}):q?e8?(0,s.jsxs)("div",{className:"space-y-5",children:[tu&&(0,s.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:tu}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(j.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:T("ideas.titleLabel")}),(0,s.jsx)(b.p,{id:"edit-title",value:e9,onChange:e=>te(e.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(j.J,{htmlFor:"edit-content",className:"text-[13px] font-medium text-foreground",children:T("common.content")}),(0,s.jsx)(v.T,{id:"edit-content",value:tt,onChange:e=>ta(e.target.value),rows:8,className:"border-border text-sm resize-none focus-visible:ring-primary"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-3",children:[(0,s.jsx)(h.$,{variant:"outline",onClick:tK,disabled:ts,children:T("common.cancel")}),(0,s.jsxs)(h.$,{onClick:tG,disabled:ts||!e9.trim(),children:[ts&&(0,s.jsx)(d.A,{className:"mr-2 h-4 w-4 animate-spin"}),T("common.save")]})]})]}):(0,s.jsxs)(s.Fragment,{children:[eX&&(0,s.jsx)("p",{role:"status",className:"mb-4 text-xs text-muted-foreground",children:T("elaboration.verifiedQueuedHint")}),eQ&&(0,s.jsx)("p",{role:"alert",className:"mb-4 text-xs text-destructive",children:eQ}),tZ&&(0,s.jsx)("p",{className:"mb-4 text-xs text-muted-foreground",children:L("containerHint")}),em.has("overview")&&(0,s.jsxs)("div",{style:{display:"overview"===ed?"block":"none"},children:[(0,s.jsxs)("div",{className:"mb-5 flex items-start justify-between gap-3 rounded-lg border border-[#EFEBE3] dark:border-[#2a2a2e] bg-background px-3.5 py-3",children:[(0,s.jsxs)("div",{className:"min-w-0 space-y-0.5",children:[(0,s.jsxs)(j.J,{htmlFor:"container-toggle",className:"flex items-center gap-1.5 text-[13px] font-medium text-foreground",children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5 text-primary","aria-hidden":!0}),L("container")]}),(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground",children:L("containerDescription")})]}),(0,s.jsx)(y.d,{id:"container-toggle",checked:tZ,disabled:tm||!P,onCheckedChange:tW,"aria-label":L("makeContainer")})]}),(0,s.jsx)(ex,{idea:q,proposals:Y,tasks:et,onSelectTask:tA}),(0,s.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(c.A,{className:"h-3.5 w-3.5 text-primary"}),(0,s.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:L("title")})]})}),q.parent?(0,s.jsxs)("button",{type:"button",onClick:()=>null==U?void 0:U(q.parent.uuid),className:"flex w-full items-center gap-2 rounded-lg bg-background px-3 py-2.5 text-left transition-colors hover:bg-secondary",children:[(0,s.jsx)(x,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:L("derivedFrom")}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] font-medium text-foreground/80",children:q.parent.title})]}):(0,s.jsx)("p",{className:"px-1 text-[12px] text-muted-foreground",children:L("noParent")}),q.children&&q.children.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-1 pt-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-[12px] font-medium text-foreground/80",children:L("derivedIdeas")}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:q.children.length})]}),(()=>{let e=q.children.filter(e=>"done"===e.derivedStatus).length,t=q.children.length;return(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-[12px] text-muted-foreground",title:L("childrenDone",{done:e,total:t}),children:[(0,s.jsx)(tc.C,{done:e,total:t,size:14,stroke:2}),e,"/",t]})})()]}),(0,s.jsx)("div",{className:"overflow-hidden rounded-lg border border-[#EFEBE3] dark:border-[#2a2a2e]",children:q.children.map((e,t)=>(0,s.jsxs)("div",{children:[t>0&&(0,s.jsx)("div",{className:"h-px bg-[#F0EEEA] dark:bg-[#1f1e1c]"}),(0,s.jsxs)("button",{type:"button",onClick:()=>null==U?void 0:U(e.uuid),className:"flex w-full items-center justify-between gap-2 px-3 py-2.5 text-left transition-colors hover:bg-background",children:[(0,s.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[(0,s.jsx)(m.A,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,s.jsx)("span",{className:"truncate text-[12px] text-foreground",children:e.title})]}),(0,s.jsx)(g.E,{className:"shrink-0 border-0 text-[10px] ".concat(eu._5[e.derivedStatus]||eu._5.todo),children:B(eu.Bj[e.derivedStatus]||"todo")})]})]},e.uuid))})]})]}),(0,s.jsx)(ep,{projectUuid:_,ideaUuid:q.uuid,proposals:Y,onDocClick:tF}),(0,s.jsxs)("div",{className:"mt-5 space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)(p.A,{className:"h-3.5 w-3.5 text-primary"}),(0,s.jsx)("span",{className:"text-[12px] font-semibold text-foreground/80",children:T("references.title")})]}),(0,s.jsx)(ti.ReferencesSection,{targetType:"idea",targetUuid:q.uuid,canWrite:!0,compact:!0})]})]}),tO.includes("elaboration")&&em.has("elaboration")&&(0,s.jsx)("div",{style:{display:"elaboration"===ed?"block":"none"},children:(0,s.jsx)(M,{idea:q,elaboration:eq,isLoading:eH,onRefresh:async()=>{await tz(),await tT()},onReassign:()=>eS(!0),canReassign:tY})}),tO.includes("proposal")&&em.has("proposal")&&(0,s.jsx)("div",{style:{display:"proposal"===ed?"block":"none"},children:(0,s.jsx)(Z,{idea:q,projectUuid:_,onTaskClick:tA,onDocClick:tF,initialProposals:Y})}),tO.includes("tasks")&&em.has("tasks")&&(0,s.jsx)("div",{style:{display:"tasks"===ed?"block":"none"},children:(0,s.jsx)(eb,{tasks:et,projectUuid:_,proposalUuids:Y.filter(e=>"approved"===e.status).map(e=>e.uuid),onSelectTask:tA})}),em.has("activity")&&(0,s.jsx)("div",{style:{display:"activity"===ed?"block":"none"},children:(0,s.jsx)(ek,{ideaUuid:q.uuid,currentUserUuid:D,commentCount:ev,onCommentCountChange:ej})})]}):null})}),q&&(0,s.jsx)(k.Lt,{open:eE,onOpenChange:e_,children:(0,s.jsxs)(k.EO,{onCloseAutoFocus:eR,children:[(0,s.jsxs)(k.wd,{children:[(0,s.jsx)(k.r7,{children:T("ideas.deleteIdea")}),(0,s.jsx)(k.$v,{children:T("ideas.deleteIdeaConfirm",{title:q.title})})]}),(0,s.jsxs)(k.ck,{children:[(0,s.jsx)(k.Zr,{children:T("common.cancel")}),(0,s.jsx)(k.Rx,{variant:"destructive",onClick:tJ,disabled:eA,children:T("common.delete")})]})]})})]}),(0,s.jsx)(eC.h,{open:th,onOpenChange:tf,onCloseAutoFocus:eR,ideaUuid:E,projectUuid:_,onMoved:()=>R()}),q&&(0,s.jsx)(eU,{open:tg,onOpenChange:tb,ideaUuid:q.uuid,ideaTitle:q.title,projectUuid:_,currentParentUuid:null!=(C=q.parentUuid)?C:null,descendantUuids:null!=(S=q.descendantUuids)?S:[],onChanged:tT,onCloseAutoFocus:eR}),q&&(0,s.jsx)(eT.i,{open:tv,onOpenChange:tj,onCloseAutoFocus:eR,projectUuid:_,parentUuid:q.uuid,parentTitle:q.title,onCreated:e=>{l.oR.success(L("deriveIdea")),z.refresh(),null==U||U(e)}}),ey&&q&&(0,s.jsx)(eO.i,{idea:{uuid:q.uuid,title:q.title,content:q.content,status:q.status,assignee:q.assignee?{type:q.assignee.type,uuid:q.assignee.uuid,name:q.assignee.name}:null},projectUuid:_,currentUserUuid:D,onClose:()=>{eS(!1),tT()}}),(0,s.jsx)(e3.V,{open:null!==e0,onCloseAutoFocus:eR,agentName:null!=(A=null==q||null==(a=q.assignee)?void 0:a.name)?A:"",instances:null!=(F=null==e0?void 0:e0.instances)?F:[],onConfirm:e1,onCancel:e2}),ty&&tN&&(0,s.jsx)(eN.v,{task:tN,projectUuid:_,currentUserUuid:D,mode:tE?"sidebyside":"overlay",onClose:()=>{tk(null),tw(null)},onBack:()=>{tk(null),tw(null)}}),tC&&(0,s.jsx)(ew.K,{title:tC.title,type:tC.type,content:tC.content,mode:tE?"sidebyside":"overlay",onClose:()=>tS(null),onBack:()=>tS(null)})]})}},21195:(e,t,a)=>{function s(e){return e.replace(/\\n/g,"\n")}a.d(t,{j:()=>s,y:()=>n});let n={prd:"typePrd",tech_design:"typeTechDesign",adr:"typeAdr",spec:"typeSpec",guide:"typeGuide",design:"typeDesign",note:"typeNote",report:"typeReport",other:"typeOther"}},25531:(e,t,a)=>{a.d(t,{i:()=>v});var s=a(60200),n=a(81476),r=a(25588),i=a(28201),l=a(99736),o=a(40058),d=a(67566),c=a(30474),u=a(16852),x=a(45200),m=a(75861),p=a(65642),h=a(76753),f=a(96222),g=a(55544),b=a(16198);function v(e){var t;let{open:a,onOpenChange:v,onCloseAutoFocus:j,projectUuid:y,onCreated:k,parentUuid:N,parentTitle:w}=e,C=(0,r.c)("ideaTracker"),S=(0,r.c)("ideaTracker.lineage"),A=!!N,F=(0,r.c)("common"),[E,_]=(0,n.useState)(""),[D,R]=(0,n.useState)(""),[U,T]=(0,n.useState)(!1),[P,I]=(0,n.useState)(!1),[M,B]=(0,n.useState)(null),[L,z]=(0,n.useState)(!1),[O,V]=(0,n.useState)(!1),[q,$]=(0,n.useState)(!1);(0,n.useEffect)(()=>{V(!1)},[a,y]);let[H,K]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!a||A)return;let e=!1;return(0,f.tm)("/api/projects/".concat(encodeURIComponent(y),"/agent-cwds")).then(async t=>{if(!t.ok)return;let a=await t.json();if(!e){var s,n;K((null!=(n=null==a||null==(s=a.data)?void 0:s.agents)?n:[]).some(e=>e.preference))}}).catch(()=>{e||K(!1)}),()=>{e=!0}},[A,a,y]);let G=(0,g.kz)(),J=(null!=(t=null==G?void 0:G.connections)?t:[]).some(e=>"online"===e.effectiveStatus),[Q,W]=(0,n.useState)("form"),X=!A,Z=A?"form":Q,Y=async()=>{let e=E.trim();if(e){I(!0),B(null);try{var t;let a=await fetch("/api/projects/".concat(y,"/ideas"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,content:D.trim()||void 0,...N?{parentUuid:N}:{},...U?{isContainer:!0}:{}})}),s=await a.json();s.success&&(null==(t=s.data)?void 0:t.uuid)?(_(""),R(""),T(!1),v(!1),null==k||k(s.data.uuid)):B(s.error||C("error.createFailed"))}catch(e){B(C("error.createFailed"))}finally{I(!1)}}},ee=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4 py-2",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(x.J,{htmlFor:"idea-title",children:C("newIdea.ideaTitle")}),(0,s.jsx)(c.p,{id:"idea-title",value:E,onChange:e=>_(e.target.value),placeholder:C("newIdea.titlePlaceholder"),autoFocus:!0,onKeyDown:e=>{!(0,h.P)(e)&&"Enter"===e.key&&!e.shiftKey&&E.trim()&&(e.preventDefault(),Y())}})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(x.J,{htmlFor:"idea-content",children:[C("newIdea.description"),(0,s.jsxs)("span",{className:"ml-1 text-xs font-normal text-muted-foreground",children:["(",F("optional"),")"]})]}),(0,s.jsx)(u.T,{id:"idea-content",value:D,onChange:e=>R(e.target.value),placeholder:C("newIdea.descriptionPlaceholder"),rows:4,className:"resize-none"})]}),(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(m.S,{id:"idea-is-container",checked:U,onCheckedChange:e=>T(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,s.jsx)(x.J,{htmlFor:"idea-is-container",className:"cursor-pointer",children:S("makeContainer")}),(0,s.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:S("containerHint")})]})]}),M&&(0,s.jsx)("div",{className:"rounded-lg bg-destructive/10 px-3 py-2 text-[12px] text-destructive",children:M})]}),(0,s.jsxs)(d.Es,{children:[(0,s.jsx)(o.$,{variant:"outline",onClick:()=>v(!1),disabled:P,children:F("cancel")}),(0,s.jsxs)(o.$,{onClick:Y,disabled:P||!E.trim(),className:"bg-primary hover:bg-[#B56A42] text-white",children:[P?(0,s.jsx)(i.A,{className:"mr-2 h-4 w-4 animate-spin"}):null,F("create")]})]})]}),et=async e=>{$(!0);try{let a=await (0,f.tm)("/api/ideas/conversational",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectUuid:y,agentUuid:e.agentUuid,connectionUuid:e.connectionUuid,descriptionText:e.userText,researchFirst:O,...L?{decompose:!0}:{}})});if(!a.ok){let e=null;try{let t=await a.json();"string"==typeof(null==t?void 0:t.error)&&t.error&&(e=t.error)}catch(e){}throw new b.fF(a.status,e)}let s=null;try{var t;let e=await a.json();(null==e?void 0:e.success)&&(null==(t=e.data)?void 0:t.session)&&(s=e.data.session)}catch(e){}if(!s)throw new b.fF(a.status,null);return s}finally{$(!1)}},ea=(0,s.jsxs)("div",{className:"space-y-3 py-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(m.S,{id:"idea-research-first",checked:O,onCheckedChange:e=>V(!0===e),disabled:q,"aria-describedby":"idea-research-first-hint",className:"mt-0.5"}),(0,s.jsxs)("div",{className:"grid gap-1",children:[(0,s.jsx)(x.J,{htmlFor:"idea-research-first",className:"cursor-pointer",children:C("newIdea.researchFirst")}),(0,s.jsx)("p",{id:"idea-research-first-hint",className:"text-xs leading-4 text-muted-foreground",children:C("newIdea.researchFirstHint")})]})]}),(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(m.S,{id:"idea-decompose",checked:L,disabled:q,onCheckedChange:e=>z(!0===e),className:"mt-0.5"}),(0,s.jsxs)("div",{className:"grid gap-1 leading-none",children:[(0,s.jsx)(x.J,{htmlFor:"idea-decompose",className:"cursor-pointer",children:C("newIdea.decompose")}),(0,s.jsx)("p",{className:"text-xs font-normal text-muted-foreground",children:C("newIdea.decomposeHint")})]})]}),(0,s.jsx)(b.jH,{projectUuid:y,dispatch:et,onStarted:()=>{v(!1),l.oR.success(C("newIdea.submitted"))}})]});return(0,s.jsx)(d.lG,{open:a,onOpenChange:v,children:(0,s.jsxs)(d.Cf,{className:"sm:max-w-[480px]",onCloseAutoFocus:j,children:[(0,s.jsxs)(d.c7,{children:[(0,s.jsx)(d.L3,{children:A?S("deriveIdea"):C("newIdea.title")}),A&&w&&(0,s.jsxs)("p",{className:"text-[13px] text-muted-foreground",children:[S("derivedFrom")," \xb7 ",w]})]}),X&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p.tU,{value:Z,onValueChange:e=>W(e),children:(0,s.jsxs)(p.j7,{className:"grid w-full grid-cols-2",children:[(0,s.jsx)(p.Xi,{value:"form",children:C("newIdea.modeForm")}),(0,s.jsx)(p.Xi,{value:"conversation",disabled:!J&&!H,children:C("newIdea.modeConversation")})]})}),!J&&(0,s.jsxs)("div",{className:"rounded-xl border border-[#EFEBE4] dark:border-[#2a2a2e] bg-[#FCFBF8] dark:bg-[#1e1d1b] px-3 py-2",children:[(0,s.jsx)("p",{className:"px-1 pt-1 text-[12px] font-medium text-muted-foreground",children:C("newIdea.modeConversationOfflineHint")}),(0,s.jsx)(b.Bs,{variant:"compact"})]})]}),"form"===Z?ee:ea]})})}},30244:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(73326).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},32288:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(73326).A)("corner-down-right",[["path",{d:"m15 10 5 5-5 5",key:"qqa56n"}],["path",{d:"M4 4v7a4 4 0 0 0 4 4h12",key:"z08zvw"}]])},44188:(e,t,a)=>{a.r(t),a.d(t,{Content:()=>D,List:()=>E,Root:()=>F,Tabs:()=>v,TabsContent:()=>C,TabsList:()=>y,TabsTrigger:()=>N,Trigger:()=>_,createTabsScope:()=>h});var s=a(81476),n=a(56472),r=a(83559),i=a(52567),l=a(95777),o=a(45904),d=a(93868),c=a(47972),u=a(44480),x=a(60200),m="Tabs",[p,h]=(0,r.A)(m,[i.RG]),f=(0,i.RG)(),[g,b]=p(m),v=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:s,onValueChange:n,defaultValue:r,orientation:i="horizontal",dir:l,activationMode:p="automatic",...h}=e,f=(0,d.jH)(l),[b,v]=(0,c.i)({prop:s,onChange:n,defaultProp:null!=r?r:"",caller:m});return(0,x.jsx)(g,{scope:a,baseId:(0,u.B)(),value:b,onValueChange:v,orientation:i,dir:f,activationMode:p,children:(0,x.jsx)(o.sG.div,{dir:f,"data-orientation":i,...h,ref:t})})});v.displayName=m;var j="TabsList",y=s.forwardRef((e,t)=>{let{__scopeTabs:a,loop:s=!0,...n}=e,r=b(j,a),l=f(a);return(0,x.jsx)(i.bL,{asChild:!0,...l,orientation:r.orientation,dir:r.dir,loop:s,children:(0,x.jsx)(o.sG.div,{role:"tablist","aria-orientation":r.orientation,...n,ref:t})})});y.displayName=j;var k="TabsTrigger",N=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:s,disabled:r=!1,...l}=e,d=b(k,a),c=f(a),u=S(d.baseId,s),m=A(d.baseId,s),p=s===d.value;return(0,x.jsx)(i.q7,{asChild:!0,...c,focusable:!r,active:p,children:(0,x.jsx)(o.sG.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":m,"data-state":p?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:u,...l,ref:t,onMouseDown:(0,n.mK)(e.onMouseDown,e=>{r||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(s)}),onKeyDown:(0,n.mK)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&d.onValueChange(s)}),onFocus:(0,n.mK)(e.onFocus,()=>{let e="manual"!==d.activationMode;p||r||!e||d.onValueChange(s)})})})});N.displayName=k;var w="TabsContent",C=s.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,forceMount:r,children:i,...d}=e,c=b(w,a),u=S(c.baseId,n),m=A(c.baseId,n),p=n===c.value,h=s.useRef(p);return s.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,x.jsx)(l.C,{present:r||p,children:a=>{let{present:s}=a;return(0,x.jsx)(o.sG.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!s,id:m,tabIndex:0,...d,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:s&&i})}})});function S(e,t){return"".concat(e,"-trigger-").concat(t)}function A(e,t){return"".concat(e,"-content-").concat(t)}C.displayName=w;var F=v,E=y,_=N,D=C},48612:(e,t,a)=>{a.d(t,{U:()=>u});var s=a(60200),n=a(81476),r=a(25588),i=a(26185),l=a(40058),o=a(2137),d=a(49417);function c(e){var t;return null!=(t=e.agentName)?t:e.agentUuid}function u(e){let{sessions:t,onSelect:a,surface:u,className:x}=e,m=(0,r.c)("activeSessions"),[p,h]=(0,n.useState)(!1),f=(0,n.useRef)(null);if((0,n.useEffect)(()=>()=>{null!==f.current&&clearTimeout(f.current)},[]),0===t.length)return null;let g=t.some(e=>e.canOpen),b=1===t.length&&t[0].canOpen,v=t[0],j=()=>{null!==f.current&&(clearTimeout(f.current),f.current=null)},y=()=>{j(),f.current=setTimeout(()=>h(!1),120)},k=e=>{e.canOpen&&(h(!1),a(e))},N=(0,s.jsxs)(l.$,{type:"button",variant:"outline",size:"tracker"===u?"xs":"icon-sm","data-testid":"".concat(u,"-active-session-indicator"),"aria-label":m(g?"indicatorLabel":"statusOnlyIndicatorLabel",{count:t.length}),"aria-disabled":!g,"aria-haspopup":t.length>1?"dialog":void 0,onPointerDown:e=>e.stopPropagation(),onPointerEnter:b?void 0:e=>{"touch"!==e.pointerType&&(j(),h(!0))},onPointerLeave:b?void 0:e=>{"touch"!==e.pointerType&&y()},onFocus:b?void 0:()=>h(!0),onClick:e=>{if(e.stopPropagation(),j(),b)return void k(v);p&&e.preventDefault()},onKeyDown:e=>e.stopPropagation(),className:(0,d.cn)("group/active relative gap-1.5 overflow-visible border-emerald-500/35 bg-emerald-500/10 font-semibold text-emerald-700 shadow-none transition-[background-color,border-color,box-shadow] hover:border-emerald-500/60 hover:bg-emerald-500/15 hover:text-emerald-700 hover:shadow-[0_3px_10px_-5px_rgba(16,185,129,0.8)] focus-visible:border-emerald-500 focus-visible:ring-emerald-500/50 dark:border-emerald-500/35 dark:bg-emerald-500/10 dark:text-emerald-300 dark:hover:border-emerald-500/60 dark:hover:bg-emerald-500/15 dark:hover:text-emerald-300","tracker"===u?"h-7 min-w-7 px-1 text-[11px]":"sidebar"===u?"h-8 min-w-8 px-1 text-[11px]":"h-9 min-w-9 px-1 text-[11px] shadow-sm",x),children:[(0,s.jsxs)("span",{className:"relative shrink-0","aria-hidden":!0,children:[(0,s.jsx)(i.AgentAvatar,{name:c(v),size:"graph"===u?22:20,className:"rounded-full ring-1 ring-emerald-600/25"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2 rounded-full border-2 border-card bg-emerald-500"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2 rounded-full bg-emerald-400/75 motion-safe:animate-ping motion-reduce:animate-none"})]}),t.length>1&&(0,s.jsx)("span",{children:t.length})]});return b?N:(0,s.jsxs)(o.AM,{open:p,onOpenChange:h,children:[(0,s.jsx)(o.Wv,{asChild:!0,children:N}),(0,s.jsxs)(o.hl,{align:"start",sideOffset:6,onCloseAutoFocus:e=>e.preventDefault(),onPointerDown:e=>e.stopPropagation(),onPointerEnter:j,onPointerLeave:y,onClick:e=>e.stopPropagation(),className:"w-[min(22rem,calc(100vw-2rem))] p-1.5","aria-label":m("chooserLabel"),children:[(0,s.jsx)("p",{className:"px-2 pb-1.5 pt-1 text-xs font-medium text-muted-foreground",children:m("runningCount",{count:t.length})}),(0,s.jsx)("div",{className:"max-h-64 overflow-y-auto",children:t.map(e=>{var t,a;return(0,s.jsxs)(l.$,{type:"button",variant:"ghost",disabled:!e.canOpen,"aria-label":e.canOpen?c(e):m("statusOnlyEntry",{agent:c(e)}),onClick:()=>k(e),className:"group/session h-auto w-full min-w-0 items-start justify-start gap-2.5 whitespace-normal px-2 py-2 text-left disabled:cursor-not-allowed disabled:opacity-65",children:[(0,s.jsxs)("span",{className:"relative mt-0.5 shrink-0","aria-hidden":!0,children:[(0,s.jsx)(i.AgentAvatar,{name:c(e),size:30,className:"rounded-lg ring-1 ring-border transition-shadow group-hover/session:ring-emerald-500/45"}),(0,s.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 size-2.5 rounded-full border-2 border-card bg-emerald-500"})]}),(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block truncate text-xs font-medium text-foreground",children:c(e)}),(0,s.jsx)("span",{className:"block truncate text-[11px] text-muted-foreground",children:e.connectionAvailable?m("location",{host:null!=(t=e.host)?t:m("unknownHost"),cwd:null!=(a=e.cwd)?a:m("unknownCwd")}):m("agentFallback")}),!e.canOpen&&(0,s.jsx)("span",{className:"block text-[11px] font-medium text-muted-foreground",children:m("statusOnly")})]})]},e.sessionUuid)})})]})]})}},51250:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(73326).A)("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]])},65642:(e,t,a)=>{a.d(t,{Xi:()=>o,av:()=>d,j7:()=>l,tU:()=>i});var s=a(60200);a(81476);var n=a(44188),r=a(49417);function i(e){let{className:t,...a}=e;return(0,s.jsx)(n.Root,{"data-slot":"tabs",className:(0,r.cn)("flex flex-col gap-2",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)(n.List,{"data-slot":"tabs-list",className:(0,r.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)(n.Trigger,{"data-slot":"tabs-trigger",className:(0,r.cn)("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring inline-flex items-center justify-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)(n.Content,{"data-slot":"tabs-content",className:(0,r.cn)("flex-1 outline-none",t),...a})}},74046:(e,t,a)=>{a.d(t,{C:()=>r});var s=a(60200),n=a(49417);function r(e){let{done:t,total:a,size:r=14,stroke:i=2,className:l,color:o="#B26B3D",trackColor:d="#EAD9C8"}=e,c=(r-i)/2,u=2*Math.PI*c,x=a>0?Math.min(1,Math.max(0,t/a)):0,m=a>0&&t>=a;return(0,s.jsxs)("svg",{width:r,height:r,viewBox:"0 0 ".concat(r," ").concat(r),className:(0,n.cn)("shrink-0",l),role:"img","aria-label":"".concat(t,"/").concat(a),children:[(0,s.jsx)("circle",{cx:r/2,cy:r/2,r:c,fill:"none",stroke:d,strokeWidth:i}),x>0&&(0,s.jsx)("circle",{cx:r/2,cy:r/2,r:c,fill:"none",stroke:m?"#1D9E75":o,strokeWidth:i,strokeDasharray:u,strokeDashoffset:u*(1-x),strokeLinecap:"round",transform:"rotate(-90 ".concat(r/2," ").concat(r/2,")")})]})}},75861:(e,t,a)=>{a.d(t,{S:()=>l});var s=a(60200);a(81476);var n=a(71507),r=a(95957),i=a(49417);function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"checkbox",className:(0,i.cn)("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:(0,s.jsx)(n.A,{className:"size-3.5"})})})}},80688:(e,t,a)=>{a.d(t,{b:()=>d});var s=a(81476),n=a(45904),r=a(60200),i="horizontal",l=["horizontal","vertical"],o=s.forwardRef((e,t)=>{var a;let{decorative:s,orientation:o=i,...d}=e,c=(a=o,l.includes(a))?o:i;return(0,r.jsx)(n.sG.div,{"data-orientation":c,...s?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...d,ref:t})});o.displayName="Separator";var d=o},86579:(e,t,a)=>{a.d(t,{Q:()=>n});var s=a(42885);let n=(0,s.createServerReference)("40759544812c7977b84b12ad0677eb3b19604e4ca8",s.callServer,void 0,s.findSourceMapURL,"getTaskAction")},95957:(e,t,a)=>{a.r(t),a.d(t,{Checkbox:()=>y,CheckboxIndicator:()=>N,Indicator:()=>N,Root:()=>y,createCheckboxScope:()=>h,unstable_BubbleInput:()=>C,unstable_CheckboxBubbleInput:()=>C,unstable_CheckboxProvider:()=>b,unstable_CheckboxTrigger:()=>j,unstable_Provider:()=>b,unstable_Trigger:()=>j});var s=a(81476),n=a(12061),r=a(83559),i=a(56472),l=a(47972),o=a(16),d=a(20048),c=a(95777),u=a(45904),x=a(60200),m="Checkbox",[p,h]=(0,r.A)(m),[f,g]=p(m);function b(e){let{__scopeCheckbox:t,checked:a,children:n,defaultChecked:r,disabled:i,form:o,name:d,onCheckedChange:c,required:u,value:p="on",internal_do_not_use_render:h}=e,[g,b]=(0,l.i)({prop:a,defaultProp:null!=r&&r,onChange:c,caller:m}),[v,j]=s.useState(null),[y,k]=s.useState(null),N=s.useRef(!1),w=!v||!!o||!!v.closest("form"),C={checked:g,disabled:i,setChecked:b,control:v,setControl:j,name:d,form:o,value:p,hasConsumerStoppedPropagationRef:N,required:u,defaultChecked:!S(r)&&r,isFormControl:w,bubbleInput:y,setBubbleInput:k};return(0,x.jsx)(f,{scope:t,...C,children:"function"==typeof h?h(C):n})}var v="CheckboxTrigger",j=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,onKeyDown:r,onClick:l,...o}=e,{control:d,value:c,disabled:m,checked:p,required:h,setControl:f,setChecked:b,hasConsumerStoppedPropagationRef:j,isFormControl:y,bubbleInput:k}=g(v,a),N=(0,n.s)(t,f),w=s.useRef(p);return s.useEffect(()=>{let e=null==d?void 0:d.form;if(e){let t=()=>b(w.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[d,b]),(0,x.jsx)(u.sG.button,{type:"button",role:"checkbox","aria-checked":S(p)?"mixed":p,"aria-required":h,"data-state":A(p),"data-disabled":m?"":void 0,disabled:m,value:c,...o,ref:N,onKeyDown:(0,i.mK)(r,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:(0,i.mK)(l,e=>{b(e=>!!S(e)||!e),k&&y&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})})});j.displayName=v;var y=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,name:s,checked:n,defaultChecked:r,required:i,disabled:l,value:o,onCheckedChange:d,form:c,...u}=e;return(0,x.jsx)(b,{__scopeCheckbox:a,checked:n,defaultChecked:r,disabled:l,required:i,onCheckedChange:d,name:s,form:c,value:o,internal_do_not_use_render:e=>{let{isFormControl:s}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(j,{...u,ref:t,__scopeCheckbox:a}),s&&(0,x.jsx)(C,{__scopeCheckbox:a})]})}})});y.displayName=m;var k="CheckboxIndicator",N=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,forceMount:s,...n}=e,r=g(k,a);return(0,x.jsx)(c.C,{present:s||S(r.checked)||!0===r.checked,children:(0,x.jsx)(u.sG.span,{"data-state":A(r.checked),"data-disabled":r.disabled?"":void 0,...n,ref:t,style:{pointerEvents:"none",...e.style}})})});N.displayName=k;var w="CheckboxBubbleInput",C=s.forwardRef((e,t)=>{let{__scopeCheckbox:a,...r}=e,{control:i,hasConsumerStoppedPropagationRef:l,checked:c,defaultChecked:m,required:p,disabled:h,name:f,value:b,form:v,bubbleInput:j,setBubbleInput:y}=g(w,a),k=(0,n.s)(t,y),N=(0,o.Z)(c),C=(0,d.X)(i);s.useEffect(()=>{if(!j)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=!l.current;if(N!==c&&e){let a=new Event("click",{bubbles:t});j.indeterminate=S(c),e.call(j,!S(c)&&c),j.dispatchEvent(a)}},[j,N,c,l]);let A=s.useRef(!S(c)&&c);return(0,x.jsx)(u.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:null!=m?m:A.current,required:p,disabled:h,name:f,value:b,form:v,...r,tabIndex:-1,ref:k,style:{...r.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function S(e){return"indeterminate"===e}function A(e){return S(e)?"indeterminate":e?"checked":"unchecked"}C.displayName=w}}]);
|