@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[19835],{2138:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(73326).A)("file-type",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M11 18h2",key:"12mj7e"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"M9 13v-.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 .5.5v.5",key:"qbrxap"}]])},5602:(e,s,t)=>{"use strict";t.d(s,{DiscussionDrawer:()=>p});var r=t(60200),a=t(81476),n=t(25588);let i=(0,t(73326).A)("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);var l=t(40058),d=t(75507),o=t(42731),c=t(7685),m=t(38060),x=t(75844),u=t(48869);function p(e){let{proposalUuid:s,currentUserUuid:t,commentCount:p}=e,h=(0,n.c)(),[f,g]=(0,a.useState)(p),b=(0,a.useCallback)(async()=>{try{let e=await (0,u.d)("proposal",s);if(!e.success)return;g(e.total)}catch(e){}},[s]);return(0,m.w0)("proposal",s,b),(0,r.jsx)(c.D,{entityType:"proposal",entityUuid:s,subEntityType:"comment",children:(0,r.jsxs)(o.cj,{children:[(0,r.jsx)(o.CG,{asChild:!0,children:(0,r.jsxs)(l.$,{variant:"outline",size:"sm",className:"gap-1.5 border-border text-foreground",children:[(0,r.jsx)(i,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:h("proposals.discussion")}),f>0&&(0,r.jsx)(d.E,{className:"ml-0.5 h-5 min-w-5 justify-center rounded-full border-0 bg-[#E07A5F] px-1.5 text-[10px] font-semibold text-white",children:f})]})}),(0,r.jsxs)(o.h,{side:"right",className:"w-full sm:w-[420px] sm:max-w-[420px] p-0 flex flex-col",children:[(0,r.jsx)(o.Fm,{className:"border-b border-[#F0EDE8] dark:border-[#26241f] px-6 py-4",children:(0,r.jsxs)(o.qp,{className:"flex items-center gap-2 text-base",children:[(0,r.jsx)(i,{className:"h-[18px] w-[18px]"}),h("proposals.discussion"),f>0&&(0,r.jsx)("span",{className:"rounded-full bg-[#F0EDE8] dark:bg-[#1f1e1c] px-2 py-0.5 text-xs font-medium text-muted-foreground",children:f})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto p-6",children:(0,r.jsx)(x.$m,{targetType:"proposal",targetUuid:s,currentUserUuid:t,onCountChange:g})})]})]})})}},8568:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(73326).A)("file-spreadsheet",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]])},10666:(e,s,t)=>{"use strict";t.d(s,{E:()=>h});var r=t(60200),a=t(81476),n=t(99736),i=t(80513),l=t(2138),d=t(8568),o=t(28201),c=t(31577),m=t(25588),x=t(56791),u=t(40058),p=t(43664);function h(e){let{document:s,documentUuid:h,variant:f="default"}=e,g=(0,m.c)(),{exportDocument:b,isExporting:j,exportError:v}=function(){let[e,s]=(0,a.useState)(!1),[r,n]=(0,a.useState)(null);return{exportDocument:(0,a.useCallback)(async(e,r)=>{s(!0),n(null);try{let s,n,l=function(e){let s=e.replace(/[\\/:*?"<>|]/g,"").replace(/\s+/g," ").trim().replace(/\s/g,"-");return s.length>0?s:"document"}(e.title);if("md"===r){let{exportAsMarkdownBlob:r}=await t.e(76169).then(t.bind(t,76169));s=r(e),n="md"}else if("pdf"===r){let{exportAsPdf:r}=await t.e(1094).then(t.bind(t,1094));s=await r(e),n="pdf"}else if("docx"===r){let{exportAsDocx:r}=await t.e(85074).then(t.bind(t,85074));s=await r(e),n="docx"}else throw Error("Unsupported export format: ".concat(String(r)));var a=s,i="".concat(l,".").concat(n);let d=URL.createObjectURL(a),o=document.createElement("a");o.href=d,o.download=i,o.rel="noopener",o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o),setTimeout(()=>URL.revokeObjectURL(d),1e3)}catch(e){n(e instanceof Error?e.message:String(e)),p.q.error("useDocumentExport export failed",e)}finally{s(!1)}},[]),isExporting:e,exportError:r}}(),[N,y]=(0,a.useState)(null);async function k(e){y(e);try{let d=s;if(!d&&h){var t,r,a,i,l;let e=await fetch("/api/documents/".concat(h)),s=await e.json();if(!s.success||!s.data)return void n.oR.error(g("export.exportError"));let o=s.data;d={title:o.title,content:null!=(a=o.content)?a:"",type:o.type,version:o.version,createdAt:o.createdAt,updatedAt:o.updatedAt,createdByName:null!=(i=null==(t=o.createdBy)?void 0:t.name)?i:"",projectName:null!=(l=null==(r=o.project)?void 0:r.name)?l:""}}d&&await b(d,e)}finally{y(null),v&&n.oR.error(v)}}let w=[{format:"md",labelKey:"export.formatMd",icon:i.A},{format:"pdf",labelKey:"export.formatPdf",icon:l.A},{format:"docx",labelKey:"export.formatDocx",icon:d.A}],A="compact"===f;return(0,r.jsxs)(x.rI,{children:[(0,r.jsx)(x.ty,{asChild:!0,children:(0,r.jsxs)(u.$,{variant:"ghost"===f?"ghost":"outline",size:A?"sm":"default",className:A?"h-6 text-[11px] text-muted-foreground hover:text-foreground":"border-border text-muted-foreground gap-1.5",disabled:j,children:[j?(0,r.jsx)(o.A,{className:"".concat(A?"h-3 w-3":"h-4 w-4"," animate-spin")}):(0,r.jsx)(c.A,{className:A?"h-3 w-3":"h-4 w-4"}),!A&&g("export.exportDocument")]})}),(0,r.jsx)(x.SQ,{align:"end",className:"w-48",children:w.map(e=>{let{format:s,labelKey:t,icon:a}=e;return(0,r.jsxs)(x._2,{onClick:e=>{e.stopPropagation(),e.preventDefault(),k(s)},disabled:j,children:[N===s?(0,r.jsx)(o.A,{className:"h-4 w-4 animate-spin"}):(0,r.jsx)(a,{className:"h-4 w-4"}),g(t)]},s)})})]})}},31577:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(73326).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},34554:(e,s,t)=>{"use strict";t.d(s,{ProposalValidationChecklist:()=>b});var r=t(60200),a=t(81476),n=t(25588),i=t(28812),l=t(32814),d=t(6153),o=t(91744),c=t(16832),m=t(29438),x=t(50759),u=t(16272),p=t(75507),h=t(34775);let f={error:i.A,warning:l.A,info:d.A},g={error:{icon:"text-red-500",bg:"bg-red-50",badge:"bg-red-100 text-red-700"},warning:{icon:"text-amber-500",bg:"bg-amber-50",badge:"bg-amber-100 text-amber-700"},info:{icon:"text-blue-500",bg:"bg-blue-50",badge:"bg-blue-100 text-blue-700"}};function b(e){let{projectUuid:s,proposalUuid:t,status:d}=e,b=(0,n.c)("proposalValidation"),[j,v]=(0,a.useState)(null),[N,y]=(0,a.useState)(!0),[k,w]=(0,a.useState)(null),[A,C]=(0,a.useState)(!1);if((0,a.useEffect)(()=>{if("draft"!==d)return;let e=!1;return async function(){try{y(!0),w(null);let r=await fetch("/api/projects/".concat(s,"/proposals/").concat(t,"/validate"));if(!r.ok)throw Error("HTTP ".concat(r.status));let a=await r.json();e||v(a.data)}catch(s){e||w(s instanceof Error?s.message:"Unknown error")}finally{e||y(!1)}}(),()=>{e=!0}},[s,t,d]),"draft"!==d)return null;if(N)return(0,r.jsx)(u.Zp,{className:"border-[#E5E2DC] dark:border-[#2a2a2e] shadow-none rounded-2xl gap-0 py-0",children:(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)(o.A,{className:"h-4 w-4 text-primary"}),(0,r.jsx)("span",{className:"text-[13px] font-semibold text-foreground",children:b("title")})]}),(0,r.jsx)(h.E,{className:"h-5 w-20"})]})});if(k)return(0,r.jsx)(u.Zp,{className:"border-red-200 shadow-none rounded-2xl gap-0 py-0",children:(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)(o.A,{className:"h-4 w-4 text-primary"}),(0,r.jsx)("span",{className:"text-[13px] font-semibold text-foreground",children:b("title")})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs text-red-600",children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:k})]})]})});if(!j)return null;let F={error:[],warning:[],info:[]};for(let e of j.issues)F[e.level].push(e);let E=[...F.error,...F.warning,...F.info],S=F.error.length,D=F.warning.length,P=(0,r.jsxs)("button",{type:"button",onClick:()=>C(!A),className:"flex w-full items-center justify-between px-5 py-3.5 cursor-pointer hover:bg-background transition-colors rounded-2xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)(o.A,{className:"h-4 w-4 text-primary"}),(0,r.jsx)("span",{className:"text-[13px] font-semibold text-foreground",children:b("title")})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[j.valid?(0,r.jsxs)(p.E,{className:"border-0 bg-green-100 text-green-700 text-[11px] font-medium",children:[(0,r.jsx)(c.A,{className:"mr-1 h-3 w-3"}),b("passed")]}):(0,r.jsxs)(r.Fragment,{children:[S>0&&(0,r.jsxs)(p.E,{className:"border-0 bg-red-100 text-red-700 text-[11px] font-medium",children:[(0,r.jsx)(i.A,{className:"mr-1 h-3 w-3"}),b("errorCount",{count:S})]}),D>0&&(0,r.jsxs)(p.E,{className:"border-0 bg-amber-100 text-amber-700 text-[11px] font-medium",children:[(0,r.jsx)(l.A,{className:"mr-1 h-3 w-3"}),b("warningCount",{count:D})]})]}),A?(0,r.jsx)(m.A,{className:"h-4 w-4 text-muted-foreground"}):(0,r.jsx)(x.A,{className:"h-4 w-4 text-muted-foreground"})]})]});return(0,r.jsxs)(u.Zp,{className:"border-[#E5E2DC] dark:border-[#2a2a2e] shadow-none rounded-2xl gap-0 py-0 overflow-hidden",children:[P,A&&(0,r.jsx)(u.Wu,{className:"px-4 pb-4 pt-0",children:0===E.length?(0,r.jsxs)("div",{className:"flex items-center gap-2 text-xs text-green-600 px-1 py-2",children:[(0,r.jsx)(c.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:b("passed")})]}):(0,r.jsx)("div",{className:"space-y-2",children:E.map((e,s)=>{let t=f[e.level],a=g[e.level];return(0,r.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg px-3 py-2.5 ".concat(a.bg),children:[(0,r.jsx)(t,{className:"h-3.5 w-3.5 shrink-0 ".concat(a.icon)}),(0,r.jsx)("span",{className:"flex-1 min-w-0 text-xs text-foreground",children:e.field?b(e.id,{title:e.field}):b(e.id)}),(0,r.jsx)(p.E,{className:"shrink-0 border-0 text-[10px] font-medium ".concat(a.badge),children:b(e.level)})]},"".concat(e.id,"-").concat(s))})})})]})}},36007:(e,s,t)=>{"use strict";t.d(s,{SourceIdeasCard:()=>el});var r=t(60200),a=t(81476),n=t(25588),i=t(44072);let l=(0,t(73326).A)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var d=t(16272),o=t(32022),c=t(81145),m=t(91560),x=t(5535),u=t(28201),p=t(71507),h=t(43322),f=t(16832),g=t(14006),b=t(75507),j=t(40058),v=t(30474),N=t(16852),y=t(45200),k=t(90993),w=t(2745),A=t(62925),C=t(26185),F=t(58851),E=t(16198),S=t(83564),D=t(75844),P=t(17523),U=t(73386),T=t(14954),R=t(64035),M=t(25268),$=t(37352),z=t(97322),B=t(31012),O=t(1445),_=t(42885);let L=(0,_.createServerReference)("607e8e982d712dd0c15d9ca0c9ba03557586db5af8",_.callServer,void 0,_.findSourceMapURL,"skipElaborationAction");var q=t(22977),V=t(94696),I=t(43664),G=t(60596),Z=t(49858),J=t(3609),H=t(63145),K=t(65484),W=t(57378),Q=t(84607),X=t(38060),Y=t(69189),ee=t(91598),es=t(25452),et=t(8330),er=t(3562);let ea={open:"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]",elaborating:"bg-[#E3F2FD] dark:bg-[#13253a] text-[#1976D2] dark:text-[#5AA9F0]",elaborated:"bg-[#E0F2F1] dark:bg-[#12292a] text-[#00796B] dark:text-[#4FD1C0]"},en={open:"open",elaborating:"elaborating",elaborated:"elaborated"};function ei(e){var s,t,i,l,d,_;let{idea:ei,projectUuid:el,currentUserUuid:ed,isUsedInProposal:eo,onClose:ec,onDeleted:em}=e,ex=(0,n.c)(),eu=(0,o.r)(),ep=(0,Y.F7)(),[eh,ef]=(0,a.useState)([]),[eg,eb]=(0,a.useState)(!0),[ej,ev]=(0,a.useState)(!1),[eN,ey]=(0,a.useState)(null),ek=(0,a.useCallback)(async()=>{let e=await (0,B.z)(ei.uuid);e.success&&e.data&&ey(e.data)},[ei.uuid]);(0,a.useEffect)(()=>{ek()},[ek]),(0,X.eV)("idea",ek);let[ew,eA]=(0,a.useState)([]),[eC,eF]=(0,a.useState)([]),eE=(0,a.useCallback)(async()=>{if("elaborated"!==ei.status){eA([]),eF([]);return}try{let e=await (0,q.U)(el,ei.uuid);if(!e.success||!e.data)return;eA(e.data.map(e=>({status:e.status})));let s=e.data.filter(e=>"approved"===e.status),t=await Promise.all(s.map(e=>(0,V.c)(el,e.uuid)));eF(t.flatMap(e=>e.success&&e.data?e.data.map(e=>({status:e.status})):[]))}catch(e){I.q.error("Failed to load start-development gating data:",e)}},[ei.uuid,ei.status,el]);(0,a.useEffect)(()=>{eE()},[eE]),(0,X.eV)("proposal",eE),(0,X.eV)("task",eE);let[eS,eD]=(0,a.useState)(!1),[eP,eU]=(0,a.useState)(""),[eT,eR]=(0,a.useState)(!1),[eM,e$]=(0,a.useState)(null),[ez,eB]=(0,a.useState)(!1),[eO,e_]=(0,a.useState)(null),[eL,eq]=(0,a.useState)(!1),{start:eV,pickerState:eI,confirmPick:eG,cancelPick:eZ,isResolving:eJ,fixedTarget:eH}=(0,H.E)({reassignNoWake:Q.U,previewIdeaUuid:ei.uuid}),[eK,eW]=(0,a.useState)(!1),[eQ,eX]=(0,a.useState)(ei.title),[eY,e0]=(0,a.useState)(ei.content||""),[e1,e2]=(0,a.useState)(!1),[e5,e3]=(0,a.useState)(null),[e4,e8]=(0,a.useState)(!1),[e6,e7]=(0,a.useState)(!1),[e9,se]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=setTimeout(()=>se(!0),300);return()=>clearTimeout(e)},[]);let ss=(0,ee.o)({ideaStatus:ei.status,elaborationStatus:ei.elaborationStatus,elaboration:eN}),st="elaborating"===ei.status&&(!ei.elaborationStatus||"resolved"!==ei.elaborationStatus)&&(0,S.RU)(null!=(l=ei.assignee)?l:null,{type:"user",uuid:ed}),sr=ep&&"elaborated"!==ei.status;(0,a.useEffect)(()=>{!async function(){eb(!0),ef((await (0,P.x)(ei.uuid)).activities),eb(!1)}()},[ei.uuid]),(0,a.useEffect)(()=>{eW(!1),eX(ei.title),e0(ei.content||""),e3(null)},[ei.uuid,ei.title,ei.content]);let sa=()=>{eW(!1),eX(ei.title),e0(ei.content||""),e3(null)},sn=async()=>{if(!eQ.trim())return void e3(ex("ideas.titleRequired"));e2(!0),e3(null);let e=await (0,U.J)({ideaUuid:ei.uuid,projectUuid:el,title:eQ.trim(),content:eY.trim()||null});e2(!1),e.success?(eW(!1),eu.refresh()):e3(e.error||ex("ideas.updateFailed"))},si=async()=>{e8(!0);let e=await (0,T.Z)(ei.uuid,el);e8(!1),e.success&&(null==em||em(),ec(),eu.refresh())},sl=async()=>{eB(!0),e_(null);let e=await (0,O.e)(ei.uuid);eB(!1),e.success?(eq(!0),eu.refresh()):e_(e.error||ex("elaboration.verifyFailed"))},sd=async()=>{if(!eP.trim())return void e$(ex("elaboration.skipReasonRequired"));eR(!0),e$(null);let e=await L(ei.uuid,eP.trim());eR(!1),e.success?(eD(!1),eU(""),eu.refresh()):e$(e.error||ex("common.genericError"))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:ec}),(0,r.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 bg-card shadow-xl border-l border-border ".concat(e9?"":"animate-in slide-in-from-right duration-300"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:eK?(0,r.jsx)("h2",{className:"text-base font-semibold text-foreground",children:ex("ideas.editIdea")}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:ei.title}),(0,r.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[(0,r.jsx)(b.E,{className:ea[ei.status]||"",children:ex("status.".concat(en[ei.status]||ei.status))}),(0,r.jsx)("span",{className:"text-xs text-[#9A9A9A]",children:(0,er.r)(ei.createdAt)})]})]})}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[ep&&!eK&&(0,r.jsx)(j.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:()=>e7(!0),title:ex("ideas.actions.move"),"aria-label":ex("ideas.actions.move"),children:(0,r.jsx)(c.A,{className:"h-4 w-4 text-muted-foreground"})}),sr&&!eK&&(0,r.jsx)(j.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:()=>{eX(ei.title),e0(ei.content||""),e3(null),eW(!0)},children:(0,r.jsx)(m.A,{className:"h-4 w-4 text-muted-foreground"})}),(0,r.jsx)(j.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:eK?sa:ec,children:(0,r.jsx)(x.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,r.jsx)(k.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,r.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:eK?(0,r.jsxs)("div",{className:"space-y-5",children:[e5&&(0,r.jsx)("div",{className:"rounded-lg bg-destructive/10 p-3 text-sm text-destructive",children:e5}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(y.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:ex("ideas.titleLabel")}),(0,r.jsx)(v.p,{id:"edit-title",value:eQ,onChange:e=>eX(e.target.value),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(y.J,{htmlFor:"edit-content",className:"text-[13px] font-medium text-foreground",children:ex("common.content")}),(0,r.jsx)(N.T,{id:"edit-content",value:eY,onChange:e=>e0(e.target.value),rows:8,className:"border-border text-sm resize-none focus-visible:ring-primary"})]})]}):(0,r.jsxs)(es.P.div,{variants:et.qG,initial:"initial",animate:"animate",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wider text-[#9A9A9A]",children:ex("common.assignee")}),(0,r.jsx)("div",{className:"mt-2 flex items-center gap-2.5 rounded-lg bg-background p-3",children:ei.assignee?(0,r.jsxs)(r.Fragment,{children:[(0,S.bB)(ei.assignee)?(0,r.jsx)(C.AgentAvatar,{name:ei.assignee.name,size:28,className:"rounded-full"}):(0,r.jsx)(A.eu,{className:"h-7 w-7",children:(0,r.jsx)(A.q5,{className:"bg-border text-muted-foreground",children:ei.assignee.name.charAt(0).toUpperCase()})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-foreground",children:ei.assignee.name}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,S.bB)(ei.assignee)?"".concat(ex("common.agent")," • ").concat(ei.assignee.assignedAt?(0,er.r)(ei.assignee.assignedAt):""):ex("common.user")}),"agent_instance"===ei.assignee.type&&ei.assignee.instance&&(0,r.jsx)("div",{className:"mt-1",children:(0,r.jsx)(E.jQ,{cwd:ei.assignee.instance.cwd,host:ei.assignee.instance.host})})]})]}):(0,r.jsx)("span",{className:"text-sm text-[#9A9A9A]",children:ex("common.unassigned")})})]}),eN&&eN.rounds.length>0&&(0,r.jsx)("div",{className:"mt-5",children:(0,r.jsx)(z.R,{ideaUuid:ei.uuid,elaboration:eN,onRefresh:async()=>{let e=await (0,B.z)(ei.uuid);e.success&&e.data&&ey(e.data)}})}),(0,r.jsxs)("div",{className:"mt-5",children:[(0,r.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wider text-[#9A9A9A]",children:ex("common.content")}),(0,r.jsx)("div",{className:"mt-2",children:ei.content?(0,r.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,r.jsx)(R.MarkdownContent,{children:ei.content})}):(0,r.jsx)("p",{className:"text-sm italic text-[#9A9A9A]",children:ex("common.noContent")})})]}),(0,r.jsxs)("div",{className:"mt-5 flex-1",children:[(0,r.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wider text-[#9A9A9A]",children:ex("common.activity")}),(0,r.jsx)("div",{className:"mt-2 space-y-3",children:eg?(0,r.jsx)("div",{className:"flex items-center justify-center py-4",children:(0,r.jsx)(u.A,{className:"h-4 w-4 animate-spin text-[#9A9A9A]"})}):0===eh.length?(0,r.jsx)("p",{className:"text-sm text-[#9A9A9A] italic",children:ex("common.noActivity")}):eh.map(e=>(0,r.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,r.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-[#9A9A9A]"}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-[13px] text-foreground",children:function(e,s){let{action:t,actorName:r}=e;switch(t){case"created":case"idea_created":return s("activity.ideaCreated",{actor:r});case"assigned":case"idea_assigned":return s("activity.ideaAssigned",{actor:r});case"claimed":case"idea_claimed":return s("activity.ideaClaimed",{actor:r});case"released":case"idea_released":return s("activity.ideaReleased",{actor:r});case"status_changed":case"idea_status_changed":return s("activity.ideaStatusChanged",{actor:r});case"edited":case"idea_edited":return s("activity.ideaEdited",{actor:r});case"reparented":case"idea_reparented":return s("activity.ideaReparented",{actor:r});case"elaboration_started":return s("activity.elaborationStarted",{actor:r});case"elaboration_answered":return s("activity.elaborationAnswered",{actor:r});case"elaboration_skipped":return s("activity.elaborationSkipped",{actor:r});case"elaboration_resolved":return s("activity.elaborationResolved",{actor:r});case"elaboration_followup":return s("activity.elaborationFollowup",{actor:r});default:return"".concat(r,": ").concat(t)}}(e,ex)}),(0,r.jsx)("p",{className:"text-[11px] text-[#9A9A9A]",children:function(e,s){let t=new Date(e),r=new Date().getTime()-t.getTime(),a=Math.floor(r/6e4),n=Math.floor(r/36e5),i=Math.floor(r/864e5);return a<1?s("time.justNow"):a<60?s("time.minutesAgo",{minutes:a}):n<24?s("time.hoursAgo",{hours:n}):i<7?s("time.daysAgo",{days:i}):(0,er.r)(t)}(e.createdAt,ex)})]})]},e.uuid))})]}),(0,r.jsxs)("div",{className:"mt-5",children:[(0,r.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wider text-[#9A9A9A]",children:ex("references.title")}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(J.ReferencesSection,{targetType:"idea",targetUuid:ei.uuid,canWrite:!0,compact:!0})})]}),(0,r.jsxs)("div",{className:"mt-5",children:[(0,r.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wider text-[#9A9A9A]",children:ex("comments.title")}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(D.$m,{targetType:"idea",targetUuid:ei.uuid,currentUserUuid:ed,compact:!0})})]})]})})}),(0,r.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:(0,r.jsx)("div",{className:"flex items-center justify-between gap-3",children:eK?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.$,{variant:"outline",className:"border-border",onClick:sa,disabled:e1,children:ex("common.cancel")}),(0,r.jsx)(j.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:sn,disabled:e1||!eQ.trim(),children:e1?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.A,{className:"mr-2 h-4 w-4 animate-spin"}),ex("common.saving")]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.A,{className:"mr-2 h-4 w-4"}),ex("ideas.saveChanges")]})})]}):ep?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(F.Bc,{delayDuration:300,children:(0,r.jsxs)(F.m_,{children:[(0,r.jsx)(F.k$,{asChild:!0,children:(0,r.jsx)(j.$,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8 border-border",onClick:()=>ev(!0),"aria-label":ei.assignee?ex("common.reassign"):ex("common.assign"),children:(0,r.jsx)(h.A,{className:"h-4 w-4"})})}),(0,r.jsx)(F.ZI,{children:ei.assignee?ex("common.reassign"):ex("common.assign")})]})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-2",children:[st&&(0,r.jsx)(j.$,{variant:"outline",size:"sm",className:"border-border",onClick:()=>{eU(""),e$(null),eD(!0)},children:ex("elaboration.skipButton")}),eH&&(0,r.jsx)(W.Y,{target:eH}),ss&&!eL&&(0,r.jsx)(j.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:()=>{eV({ideaUuid:ei.uuid,wake:sl})},disabled:ez||eJ,children:ez?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.A,{className:"mr-2 h-4 w-4 animate-spin"}),ex("elaboration.verifying")]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.A,{className:"mr-2 h-4 w-4"}),ex("elaboration.verifyButton")]})}),eL&&(0,r.jsx)("span",{className:"text-[11px] text-[#00796B] dark:text-[#4FD1C0]",children:ex("elaboration.verifiedQueuedHint")}),eO&&(0,r.jsx)("span",{className:"text-[11px] text-destructive",children:eO}),(0,r.jsx)(G.w,{ideaUuid:ei.uuid,assignee:ei.assignee,assigneeName:null==(s=ei.assignee)?void 0:s.name,proposals:ew,tasks:eC,onStarted:()=>{eu.refresh()}}),(0,r.jsx)(Z.s,{ideaUuid:ei.uuid,assignee:ei.assignee,assigneeName:null==(t=ei.assignee)?void 0:t.name,proposals:ew,tasks:eC,onStarted:()=>{eu.refresh()}})]}),(0,r.jsxs)(w.Lt,{children:[(0,r.jsx)(w.tv,{asChild:!0,children:(0,r.jsx)(j.$,{variant:"outline",size:"icon",className:"shrink-0 h-8 w-8 border-border text-[#EF4444] dark:text-[#F0897E] hover:bg-[#FFEBEE] dark:hover:bg-[#331619] hover:text-[#EF4444] hover:border-[#EF4444]",children:(0,r.jsx)(g.A,{className:"h-4 w-4"})})}),(0,r.jsxs)(w.EO,{children:[(0,r.jsxs)(w.wd,{children:[(0,r.jsx)(w.r7,{children:ex("ideas.deleteIdea")}),(0,r.jsx)(w.$v,{children:ex("ideas.deleteIdeaConfirm",{title:ei.title})})]}),(0,r.jsxs)(w.ck,{children:[(0,r.jsx)(w.Zr,{children:ex("common.cancel")}),(0,r.jsx)(w.Rx,{variant:"destructive",onClick:si,disabled:e4,children:e4?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.A,{className:"mr-2 h-4 w-4 animate-spin"}),ex("common.delete")]}):ex("common.delete")})]})]})]})]}):null})})]}),(0,r.jsx)(w.Lt,{open:eS,onOpenChange:eD,children:(0,r.jsxs)(w.EO,{children:[(0,r.jsxs)(w.wd,{children:[(0,r.jsx)(w.r7,{children:ex("elaboration.skipConfirmTitle")}),(0,r.jsx)(w.$v,{children:ex("elaboration.skipConfirmDescription")})]}),(0,r.jsxs)("div",{className:"space-y-2 py-2",children:[(0,r.jsx)(y.J,{htmlFor:"skip-reason",className:"text-[13px] font-medium text-foreground",children:ex("elaboration.skipReasonLabel")}),(0,r.jsx)(v.p,{id:"skip-reason",value:eP,onChange:e=>{eU(e.target.value),eM&&e$(null)},placeholder:ex("elaboration.skipReasonPlaceholder"),className:"border-border text-sm focus-visible:ring-primary",autoFocus:!0}),eM&&(0,r.jsx)("p",{className:"text-xs text-destructive",children:eM})]}),(0,r.jsxs)(w.ck,{children:[(0,r.jsx)(w.Zr,{disabled:eT,children:ex("common.cancel")}),(0,r.jsx)(w.Rx,{onClick:e=>{e.preventDefault(),sd()},disabled:eT||!eP.trim(),className:"bg-primary hover:bg-[#B56A42] text-white",children:eT?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.A,{className:"mr-2 h-4 w-4 animate-spin"}),ex("common.processing")]}):ex("elaboration.skipButton")})]})]})}),(0,r.jsx)($.h,{open:e6,onOpenChange:e7,ideaUuid:ei.uuid,projectUuid:el,onMoved:()=>{ec()}}),ej&&(0,r.jsx)(M.i,{idea:{uuid:ei.uuid,title:ei.title,content:ei.content,status:ei.status,assignee:ei.assignee?{type:ei.assignee.type,uuid:ei.assignee.uuid,name:ei.assignee.name}:null},projectUuid:el,currentUserUuid:ed,onClose:()=>{ev(!1),ec()}}),(0,r.jsx)(K.V,{open:null!==eI,agentName:null!=(d=null==(i=ei.assignee)?void 0:i.name)?d:"",instances:null!=(_=null==eI?void 0:eI.instances)?_:[],onConfirm:eG,onCancel:eZ})]})}function el(e){let{ideas:s,projectUuid:t,currentUserUuid:o}=e,c=(0,n.c)("proposals"),[m,x]=(0,a.useState)(null);return 0===s.length?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(d.Zp,{className:"border-[#E5E2DC] dark:border-[#2a2a2e] shadow-none rounded-2xl gap-0 py-0 overflow-hidden",children:[(0,r.jsx)(d.aR,{className:"border-b border-secondary px-5 py-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(i.A,{className:"h-4 w-4 text-primary"}),(0,r.jsx)(d.ZB,{className:"text-[13px] font-semibold text-foreground",children:c("sourceIdeas")})]})}),(0,r.jsx)(d.Wu,{className:"space-y-2 px-5 py-3",children:s.map(e=>(0,r.jsxs)("button",{onClick:()=>x(e),className:"flex w-full items-center gap-2 rounded-lg bg-secondary px-3 py-2 text-left transition-colors hover:bg-[#EDE9E3] dark:hover:bg-[#2a2a2e]",children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,r.jsx)("span",{className:"flex-1 truncate text-xs font-medium text-primary",children:e.title}),(0,r.jsx)(l,{className:"h-3 w-3 shrink-0 text-[#9A9A9A]"})]},e.uuid))})]}),m&&(0,r.jsx)(ei,{idea:m,projectUuid:t,currentUserUuid:o,isUsedInProposal:!0,onClose:()=>x(null)})]})}},38395:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(73326).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},38918:(e,s,t)=>{"use strict";t.d(s,{ProposalActions:()=>E});var r=t(60200),a=t(32022),n=t(81476),i=t(25588),l=t(29402),d=t(20699),o=t(71507),c=t(5535),m=t(73326);let x=(0,m.A)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),u=(0,m.A)("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);var p=t(14006),h=t(48733),f=t(80513),g=t(40058),b=t(56791),j=t(67566),v=t(16852),N=t(42885);let y=(0,N.createServerReference)("40c2e4b896d4fb380eea14364d0abf839c199ffd54",N.callServer,void 0,N.findSourceMapURL,"submitProposalAction"),k=(0,N.createServerReference)("60e67d5f5e6f19e3a0aad75c8cf67c9b5bd2df8ba4",N.callServer,void 0,N.findSourceMapURL,"approveProposalAction"),w=(0,N.createServerReference)("60dcb88f6b8f11265cd53a462242727ecdbf55f472",N.callServer,void 0,N.findSourceMapURL,"rejectProposalAction"),A=(0,N.createServerReference)("604ce82bad33721af284f1c6caa80b9ac8509064f5",N.callServer,void 0,N.findSourceMapURL,"closeProposalAction"),C=(0,N.createServerReference)("6021426083eb0ea5ea41de5e9794dce39cceead63f",N.callServer,void 0,N.findSourceMapURL,"revokeProposalAction"),F=(0,N.createServerReference)("60e54c5f5712bb21338e12b3232e526dda05cde35f",N.callServer,void 0,N.findSourceMapURL,"deleteProposalAction");function E(e){let{proposalUuid:s,projectUuid:t,status:m,materializedEntities:N}=e,E=(0,i.c)(),S=(0,a.r)(),[D,P]=(0,n.useTransition)(),[U,T]=(0,n.useState)(!1),[R,M]=(0,n.useState)(""),[$,z]=(0,n.useState)(!1),[B,O]=(0,n.useState)(""),[_,L]=(0,n.useState)(!1),[q,V]=(0,n.useState)(""),[I,G]=(0,n.useState)(!1),[Z,J]=(0,n.useState)(""),[H,K]=(0,n.useState)(!1),[W,Q]=(0,n.useState)(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(b.rI,{children:[(0,r.jsx)(b.ty,{asChild:!0,children:(0,r.jsxs)(g.$,{variant:"outline",className:"border-border text-foreground gap-1.5",disabled:D,children:[(0,r.jsx)(l.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:E("common.actions")})]})}),(0,r.jsxs)(b.SQ,{align:"end",className:"w-48",children:["draft"===m&&(0,r.jsxs)(b._2,{onClick:()=>K(!0),children:[(0,r.jsx)(d.A,{className:"h-4 w-4"}),E("proposals.submitForReview")]}),"pending"===m&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(b._2,{onClick:()=>T(!0),children:[(0,r.jsx)(o.A,{className:"h-4 w-4 text-[#5A9E6F] dark:text-[#6FD19A]"}),E("common.approve")]}),(0,r.jsxs)(b._2,{onClick:()=>z(!0),children:[(0,r.jsx)(c.A,{className:"h-4 w-4 text-[#D32F2F] dark:text-[#F08078]"}),E("common.reject")]}),(0,r.jsxs)(b._2,{onClick:()=>L(!0),children:[(0,r.jsx)(x,{className:"h-4 w-4"}),E("proposals.closeProposal")]})]}),"approved"===m&&(0,r.jsxs)(b._2,{onClick:()=>G(!0),children:[(0,r.jsx)(u,{className:"h-4 w-4"}),E("proposals.revokeProposal")]}),("draft"===m||"pending"===m||"approved"===m)&&(0,r.jsx)(b.mB,{}),(0,r.jsxs)(b._2,{variant:"destructive",onClick:()=>Q(!0),children:[(0,r.jsx)(p.A,{className:"h-4 w-4"}),E("proposals.deleteProposal")]})]})]}),(0,r.jsx)(j.lG,{open:H,onOpenChange:K,children:(0,r.jsxs)(j.Cf,{className:"sm:max-w-md",children:[(0,r.jsxs)(j.c7,{children:[(0,r.jsx)(j.L3,{children:E("proposals.confirmSubmit")}),(0,r.jsx)(j.rr,{children:E("proposals.confirmSubmitDesc")})]}),(0,r.jsxs)(j.Es,{className:"gap-2",children:[(0,r.jsx)(g.$,{variant:"outline",onClick:()=>K(!1),className:"border-border text-muted-foreground",children:E("common.cancel")}),(0,r.jsx)(g.$,{onClick:()=>{P(async()=>{(await y(s)).success&&(K(!1),S.refresh())})},disabled:D,className:"bg-primary hover:bg-[#B56A42] text-white",children:E(D?"common.processing":"proposals.submitForReview")})]})]})}),(0,r.jsx)(j.lG,{open:U,onOpenChange:T,children:(0,r.jsxs)(j.Cf,{className:"sm:max-w-md",children:[(0,r.jsxs)(j.c7,{children:[(0,r.jsx)(j.L3,{children:E("proposals.approveProposal")}),(0,r.jsx)(j.rr,{children:E("proposals.approveProposalDesc")})]}),(0,r.jsx)(v.T,{value:R,onChange:e=>M(e.target.value),placeholder:E("proposals.approveNotePlaceholder"),className:"min-h-[100px] border-border"}),(0,r.jsxs)(j.Es,{className:"gap-2",children:[(0,r.jsx)(g.$,{variant:"outline",onClick:()=>T(!1),className:"border-border text-muted-foreground",children:E("common.cancel")}),(0,r.jsx)(g.$,{onClick:()=>{var e;e=R.trim()||void 0,P(async()=>{(await k(s,e)).success&&(T(!1),M(""),S.refresh())})},disabled:D,className:"bg-[#5A9E6F] hover:bg-[#4A8E5F] text-white",children:E(D?"common.processing":"common.approve")})]})]})}),(0,r.jsx)(j.lG,{open:$,onOpenChange:z,children:(0,r.jsxs)(j.Cf,{className:"sm:max-w-md",children:[(0,r.jsxs)(j.c7,{children:[(0,r.jsx)(j.L3,{children:E("proposals.rejectProposal")}),(0,r.jsx)(j.rr,{children:E("proposals.rejectProposalDesc")})]}),(0,r.jsx)(v.T,{value:B,onChange:e=>O(e.target.value),placeholder:E("proposals.rejectReasonPlaceholder"),className:"min-h-[100px] border-border"}),(0,r.jsxs)(j.Es,{className:"gap-2",children:[(0,r.jsx)(g.$,{variant:"outline",onClick:()=>z(!1),className:"border-border text-muted-foreground",children:E("common.cancel")}),(0,r.jsx)(g.$,{onClick:()=>{P(async()=>{(await w(s,B)).success&&(z(!1),O(""),S.refresh())})},disabled:D||!B.trim(),className:"bg-[#D32F2F] hover:bg-[#B71C1C] text-white",children:E(D?"common.processing":"common.reject")})]})]})}),(0,r.jsx)(j.lG,{open:_,onOpenChange:L,children:(0,r.jsxs)(j.Cf,{className:"sm:max-w-md",children:[(0,r.jsxs)(j.c7,{children:[(0,r.jsx)(j.L3,{children:E("proposals.closeProposal")}),(0,r.jsx)(j.rr,{children:E("proposals.closeProposalDesc")})]}),(0,r.jsx)(v.T,{value:q,onChange:e=>V(e.target.value),placeholder:E("proposals.closeReasonPlaceholder"),className:"min-h-[100px] border-border"}),(0,r.jsxs)(j.Es,{className:"gap-2",children:[(0,r.jsx)(g.$,{variant:"outline",onClick:()=>L(!1),className:"border-border text-muted-foreground",children:E("common.cancel")}),(0,r.jsx)(g.$,{onClick:()=>{P(async()=>{(await A(s,q)).success&&(L(!1),V(""),S.refresh())})},disabled:D||!q.trim(),className:"bg-muted-foreground hover:bg-[#555555] text-white",children:E(D?"common.processing":"proposals.closeProposal")})]})]})}),(0,r.jsx)(j.lG,{open:I,onOpenChange:G,children:(0,r.jsxs)(j.Cf,{className:"sm:max-w-lg",children:[(0,r.jsxs)(j.c7,{children:[(0,r.jsx)(j.L3,{children:E("proposals.revokeProposal")}),(0,r.jsx)(j.rr,{children:E("proposals.revokeProposalDesc")})]}),N&&(N.tasks.length>0||N.documents.length>0)&&(0,r.jsxs)("div",{className:"space-y-3 rounded-lg border border-[#FFCDD2] dark:border-[#3a181c] bg-[#FFF5F5] dark:bg-[#33191b] p-3",children:[N.tasks.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-[#D32F2F] dark:text-[#F08078] mb-1.5",children:[(0,r.jsx)(h.A,{className:"h-3.5 w-3.5"}),E("proposals.revokeTasksToClose",{count:N.tasks.length})]}),(0,r.jsx)("ul",{className:"space-y-1 pl-5",children:N.tasks.map(e=>(0,r.jsxs)("li",{className:"text-xs text-muted-foreground",children:[e.title,(0,r.jsxs)("span",{className:"ml-1.5 text-[10px] text-muted-foreground",children:["(",e.status,")"]})]},e.uuid))})]}),N.documents.length>0&&(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-[#D32F2F] dark:text-[#F08078] mb-1.5",children:[(0,r.jsx)(f.A,{className:"h-3.5 w-3.5"}),E("proposals.revokeDocsToDelete",{count:N.documents.length})]}),(0,r.jsx)("ul",{className:"space-y-1 pl-5",children:N.documents.map(e=>(0,r.jsx)("li",{className:"text-xs text-muted-foreground",children:e.title},e.uuid))})]})]}),(0,r.jsx)(v.T,{value:Z,onChange:e=>J(e.target.value),placeholder:E("proposals.revokeReasonPlaceholder"),className:"min-h-[100px] border-border"}),(0,r.jsxs)(j.Es,{className:"gap-2",children:[(0,r.jsx)(g.$,{variant:"outline",onClick:()=>G(!1),className:"border-border text-muted-foreground",children:E("common.cancel")}),(0,r.jsx)(g.$,{onClick:()=>{P(async()=>{(await C(s,Z.trim()||void 0)).success&&(G(!1),J(""),S.refresh())})},disabled:D,className:"bg-[#D32F2F] hover:bg-[#B71C1C] text-white",children:E(D?"common.processing":"proposals.revokeProposal")})]})]})}),(0,r.jsx)(j.lG,{open:W,onOpenChange:Q,children:(0,r.jsxs)(j.Cf,{className:"sm:max-w-md",children:[(0,r.jsxs)(j.c7,{children:[(0,r.jsx)(j.L3,{children:E("proposals.deleteProposal")}),(0,r.jsx)(j.rr,{children:E("proposals.deleteProposalDesc")})]}),(0,r.jsxs)(j.Es,{className:"gap-2",children:[(0,r.jsx)(g.$,{variant:"outline",onClick:()=>Q(!1),className:"border-border text-muted-foreground",children:E("common.cancel")}),(0,r.jsx)(g.$,{onClick:()=>{P(async()=>{(await F(s,t)).success&&(Q(!1),S.push("/projects/".concat(t,"/proposals")),S.refresh())})},disabled:D,className:"bg-[#D32F2F] hover:bg-[#B71C1C] text-white",children:E(D?"common.processing":"common.delete")})]})]})})]})}},58701:(e,s,t)=>{Promise.resolve().then(t.bind(t,30932)),Promise.resolve().then(t.bind(t,25986)),Promise.resolve().then(t.bind(t,5751)),Promise.resolve().then(t.bind(t,95957)),Promise.resolve().then(t.bind(t,2236)),Promise.resolve().then(t.bind(t,32655)),Promise.resolve().then(t.bind(t,35877)),Promise.resolve().then(t.bind(t,8575)),Promise.resolve().then(t.bind(t,73012)),Promise.resolve().then(t.bind(t,14863)),Promise.resolve().then(t.bind(t,14122)),Promise.resolve().then(t.bind(t,94690)),Promise.resolve().then(t.bind(t,27797)),Promise.resolve().then(t.bind(t,33218)),Promise.resolve().then(t.bind(t,82288)),Promise.resolve().then(t.bind(t,48364)),Promise.resolve().then(t.bind(t,58930)),Promise.resolve().then(t.bind(t,74294)),Promise.resolve().then(t.bind(t,2735)),Promise.resolve().then(t.bind(t,23831)),Promise.resolve().then(t.bind(t,60475)),Promise.resolve().then(t.bind(t,44954)),Promise.resolve().then(t.bind(t,91462)),Promise.resolve().then(t.bind(t,44188)),Promise.resolve().then(t.bind(t,69228)),Promise.resolve().then(t.bind(t,44154)),Promise.resolve().then(t.bind(t,55794)),Promise.resolve().then(t.bind(t,87712)),Promise.resolve().then(t.bind(t,36102)),Promise.resolve().then(t.t.bind(t,25554,23)),Promise.resolve().then(t.bind(t,5602)),Promise.resolve().then(t.bind(t,38918)),Promise.resolve().then(t.bind(t,96877)),Promise.resolve().then(t.bind(t,34554)),Promise.resolve().then(t.bind(t,36007)),Promise.resolve().then(t.bind(t,98290)),Promise.resolve().then(t.bind(t,64035)),Promise.resolve().then(t.bind(t,3609)),Promise.resolve().then(t.bind(t,26185)),Promise.resolve().then(t.bind(t,48135))},91744:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(73326).A)("clipboard-check",[["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:"m9 14 2 2 4-4",key:"df797q"}]])},96877:(e,s,t)=>{"use strict";t.d(s,{ProposalEditor:()=>ex});var r=t(60200),a=t(81476),n=t(32022),i=t(25588),l=t(24546),d=t(59055);t(19768);var o=t(62116),c=t.n(o),m=t(80513),x=t(73326);let u=(0,x.A)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);var p=t(38395);let h=(0,x.A)("file-check",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]]),f=(0,x.A)("book-marked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);var g=t(26657),b=t(50759),j=t(82167);let v=(0,x.A)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var N=t(32192),y=t(91744),k=t(34382),w=t(48186),A=t(9258),C=t(7685),F=t(38060);function E(e,s){let t=new Set(e.map(e=>e.uuid));return s.filter(e=>!t.has(e.uuid)).map(e=>e.uuid)}function S(e,s){let t=new Set(s.map(e=>e.uuid));return e.filter(e=>!t.has(e.uuid)).map(e=>e.uuid)}var D=t(10666),P=t(42885);let U=(0,P.createServerReference)("40118682e50145500deda164402e0ff525b61a7e76",P.callServer,void 0,P.findSourceMapURL,"getProposalDraftsAction");var T=t(16272),R=t(40058),M=t(75507),$=t(30474),z=t(16852),B=t(45200),O=t(67566),_=t(21558),L=t(64035);let q=(0,P.createServerReference)("7043cbde6aeab76b4edc2ac5bfb92b2d01ca2006c8",P.callServer,void 0,P.findSourceMapURL,"updateTaskDraftAction"),V=(0,P.createServerReference)("7046a4fdc5202235375a774666ec80f2095c1ce3ac",P.callServer,void 0,P.findSourceMapURL,"updateDocumentDraftAction"),I=(0,P.createServerReference)("60facdd1db21f9336755d8a57f833abac3cc379e3e",P.callServer,void 0,P.findSourceMapURL,"addDocumentDraftAction"),G=(0,P.createServerReference)("6035c4a45bf855505482ff613988f3546c0cade973",P.callServer,void 0,P.findSourceMapURL,"removeDocumentDraftAction");var Z=t(5535),J=t(91560),H=t(28201),K=t(71507),W=t(14006),Q=t(90993),X=t(13796),Y=t(2745),ee=t(25452),es=t(8330);let et=(0,P.createServerReference)("60d57ea1d2362b1daea9ed3e37fc0ff53d84345dc0",P.callServer,void 0,P.findSourceMapURL,"addTaskDraftAction"),er=(0,P.createServerReference)("6082ac3a09e0181227343f980daae806b332068f3a",P.callServer,void 0,P.findSourceMapURL,"removeTaskDraftAction"),ea={high:{bg:"bg-[#FFEBEE] dark:bg-[#331619]",text:"text-[#C4574C] dark:text-[#F0897E]"},medium:{bg:"bg-[#FFF3E0] dark:bg-[#3a2a12]",text:"text-[#E65100] dark:text-[#F0A050]"},low:{bg:"bg-secondary",text:"text-muted-foreground"}};function en(e){var s,t;let{taskDraft:l,allTaskDrafts:d,proposalUuid:o,canEdit:c,onClose:m,onSaved:x,onDeleted:u}=e,p=(0,i.c)(),h=(0,n.r)(),[f,b]=(0,a.useTransition)(),[j,v]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=setTimeout(()=>v(!0),300);return()=>clearTimeout(e)},[]);let w=null===l,[A,C]=(0,a.useState)(w),[F,E]=(0,a.useState)((null==l?void 0:l.title)||""),[S,D]=(0,a.useState)((null==l?void 0:l.description)||""),[P,U]=(0,a.useState)((null==l?void 0:l.priority)||"medium"),[T,O]=(0,a.useState)((null==l||null==(s=l.storyPoints)?void 0:s.toString())||""),[V,I]=(0,a.useState)((null==l||null==(t=l.acceptanceCriteriaItems)?void 0:t.map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}))||[]),[G,en]=(0,a.useState)([]),[ei,el]=(0,a.useState)(null),ed=w?G:(null==l?void 0:l.dependsOnDraftUuids)||[],eo=(0,a.useMemo)(()=>ed.map(e=>d.find(s=>s.uuid===e)).filter(Boolean),[ed,d]),ec=(0,a.useMemo)(()=>{let e=new Set(ed);return d.filter(s=>s.uuid!==(null==l?void 0:l.uuid)&&!e.has(s.uuid))},[null==l?void 0:l.uuid,ed,d]),em=()=>{var e,s;l&&(E(l.title),D(l.description||""),U(l.priority||"medium"),O((null==(e=l.storyPoints)?void 0:e.toString())||""),I((null==(s=l.acceptanceCriteriaItems)?void 0:s.map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}))||[]),el(null),C(!0))},ex=()=>{if(w)return void m();if(C(!1),l){var e,s;E(l.title),D(l.description||""),U(l.priority||"medium"),O((null==(e=l.storyPoints)?void 0:e.toString())||""),I((null==(s=l.acceptanceCriteriaItems)?void 0:s.map(e=>{var s;return{description:e.description,required:null==(s=e.required)||s}}))||[])}el(null)},eu=ea[(null==l?void 0:l.priority)||"medium"]||ea.medium,ep=()=>(0,r.jsxs)("div",{className:"mt-5",children:[(0,r.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:p("proposals.dependsOn")}),eo.length>0?(0,r.jsx)("div",{className:"mt-2 space-y-1.5",children:eo.map(e=>(0,r.jsxs)("div",{className:"group flex items-center justify-between rounded-lg bg-background p-2.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(k.A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(0,r.jsx)("span",{className:"text-xs text-foreground truncate",children:e.title})]}),c&&(0,r.jsx)(R.$,{variant:"ghost",size:"icon",className:"h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity ml-2 shrink-0",onClick:()=>(e=>{if(w)return void en(s=>s.filter(s=>s!==e));if(!l)return;let s=(l.dependsOnDraftUuids||[]).filter(s=>s!==e);b(async()=>{let e=await q(o,l.uuid,{dependsOnDraftUuids:s});e.success?(h.refresh(),x()):el(e.error||p("proposals.failedToAddDependency"))})})(e.uuid),disabled:f,children:(0,r.jsx)(Z.A,{className:"h-3.5 w-3.5 text-[#9A9A9A] hover:text-[#D32F2F]"})})]},e.uuid))}):(0,r.jsx)("p",{className:"mt-2 text-sm italic text-[#9A9A9A]",children:p("proposals.noDependencies")}),c&&ec.length>0&&(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsxs)(_.l6,{onValueChange:e=>(e=>{if(w)return void en(s=>[...s,e]);if(!l)return;if(((e,s)=>{let t=new Set,r=[e];for(;r.length>0;){let e=r.shift();if(e===s)return!0;if(t.has(e))continue;t.add(e);let a=d.find(s=>s.uuid===e);(null==a?void 0:a.dependsOnDraftUuids)&&r.push(...a.dependsOnDraftUuids)}return!1})(e,l.uuid))return void el(p("proposals.cyclicDependency"));el(null);let s=[...l.dependsOnDraftUuids||[],e];b(async()=>{let e=await q(o,l.uuid,{dependsOnDraftUuids:s});e.success?(h.refresh(),x()):el(e.error||p("proposals.failedToAddDependency"))})})(e),children:[(0,r.jsx)(_.bq,{className:"h-8 border-border text-xs text-muted-foreground focus:ring-primary",children:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)(g.A,{className:"h-3 w-3"}),(0,r.jsx)(_.yv,{placeholder:p("proposals.selectDependency")})]})}),(0,r.jsx)(_.gC,{children:ec.map(e=>(0,r.jsx)(_.eb,{value:e.uuid,children:(0,r.jsx)("span",{className:"truncate",children:e.title})},e.uuid))})]},eo.length)})]});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20",onClick:m}),(0,r.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 bg-card shadow-xl border-l border-border ".concat(j?"":"animate-in slide-in-from-right duration-300"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-secondary px-6 py-5",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:A?(0,r.jsx)("h2",{className:"text-base font-semibold text-foreground",children:w?p("proposals.newTaskDraft"):p("proposals.editTaskDraft")}):l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-foreground truncate",children:l.title}),(0,r.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",children:[l.priority&&(0,r.jsx)(M.E,{className:"text-[10px] font-medium border-0 ".concat(eu.bg," ").concat(eu.text),children:p("priority.".concat(l.priority))}),null!=l.storyPoints&&l.storyPoints>0&&(0,r.jsxs)("span",{className:"flex items-center gap-1 rounded bg-secondary px-2 py-0.5 text-xs font-medium text-muted-foreground",children:[(0,r.jsx)(N.A,{className:"h-2.5 w-2.5 text-primary"}),l.storyPoints," SP"]})]})]}):null}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[l&&!A&&c&&(0,r.jsxs)(R.$,{variant:"outline",size:"sm",className:"h-8 gap-1.5 border-border text-foreground",onClick:em,children:[(0,r.jsx)(J.A,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-xs",children:p("common.edit")})]}),(0,r.jsx)(R.$,{variant:"outline",size:"icon",className:"h-8 w-8 border-border",onClick:A&&!w?ex:m,children:(0,r.jsx)(Z.A,{className:"h-4 w-4 text-muted-foreground"})})]})]}),(0,r.jsx)(Q.F,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:(0,r.jsx)("div",{className:"flex min-h-full flex-col px-6 py-5",children:A?(0,r.jsxs)("div",{className:"space-y-5",children:[ei&&(0,r.jsx)("div",{className:"rounded-lg bg-[#FFEBEE] dark:bg-[#331619] p-3 text-sm text-[#C4574C] dark:text-[#F0897E]",children:ei}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)(B.J,{htmlFor:"edit-title",className:"text-[13px] font-medium text-foreground",children:[p("proposals.taskTitle")," *"]}),(0,r.jsx)($.p,{id:"edit-title",value:F,onChange:e=>E(e.target.value),placeholder:p("proposals.titlePlaceholder"),className:"border-[#E5E2DC] dark:border-[#2a2a2e] text-sm focus-visible:ring-primary",autoFocus:!0})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(B.J,{htmlFor:"edit-description",className:"text-[13px] font-medium text-foreground",children:p("proposals.taskDescription")}),(0,r.jsx)(z.T,{id:"edit-description",value:S,onChange:e=>D(e.target.value),rows:4,className:"border-[#E5E2DC] dark:border-[#2a2a2e] text-sm resize-none focus-visible:ring-primary",placeholder:p("proposals.descriptionPlaceholder")})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(B.J,{htmlFor:"edit-priority",className:"text-[13px] font-medium text-foreground",children:p("proposals.taskPriority")}),(0,r.jsxs)(_.l6,{value:P,onValueChange:U,children:[(0,r.jsx)(_.bq,{className:"border-[#E5E2DC] dark:border-[#2a2a2e] text-sm focus:ring-primary",children:(0,r.jsx)(_.yv,{})}),(0,r.jsxs)(_.gC,{children:[(0,r.jsx)(_.eb,{value:"low",children:p("priority.low")}),(0,r.jsx)(_.eb,{value:"medium",children:p("priority.medium")}),(0,r.jsx)(_.eb,{value:"high",children:p("priority.high")})]})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(B.J,{htmlFor:"edit-story-points",className:"text-[13px] font-medium text-foreground",children:p("proposals.taskStoryPoints")}),(0,r.jsx)($.p,{id:"edit-story-points",type:"number",min:"0",step:"0.5",value:T,onChange:e=>O(e.target.value),placeholder:p("proposals.storyPointsPlaceholder"),className:"border-[#E5E2DC] dark:border-[#2a2a2e] text-sm focus-visible:ring-primary"})]})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)(B.J,{className:"text-[13px] font-medium text-foreground flex items-center gap-1.5",children:[(0,r.jsx)(y.A,{className:"h-3.5 w-3.5 text-primary"}),p("acceptanceCriteria.title")]}),(0,r.jsx)(X.C,{items:V,onChange:I})]}),ep()]}):l?(0,r.jsxs)(ee.P.div,{variants:es.qG,initial:"initial",animate:"animate",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:p("common.description")}),(0,r.jsx)("div",{className:"mt-2",children:l.description?(0,r.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,r.jsx)(L.MarkdownContent,{children:l.description})}):(0,r.jsx)("p",{className:"text-sm italic text-[#9A9A9A]",children:p("common.noDescription")})})]}),l.acceptanceCriteria&&(0,r.jsxs)("div",{className:"mt-5",children:[(0,r.jsx)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A]",children:p("tasks.acceptanceCriteria")}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)("div",{className:"prose prose-sm max-w-none text-[13px] leading-relaxed text-foreground",children:(0,r.jsx)(L.MarkdownContent,{children:l.acceptanceCriteria})})})]}),l.acceptanceCriteriaItems&&l.acceptanceCriteriaItems.length>0&&(0,r.jsxs)("div",{className:"mt-5",children:[(0,r.jsxs)("label",{className:"text-[11px] font-medium uppercase tracking-wide text-[#9A9A9A] flex items-center gap-1.5",children:[(0,r.jsx)(y.A,{className:"h-3 w-3"}),p("acceptanceCriteria.title")]}),(0,r.jsx)("div",{className:"mt-2 space-y-1.5",children:l.acceptanceCriteriaItems.map((e,s)=>{var t,a;return(0,r.jsxs)("div",{className:"flex items-center gap-2.5 rounded-lg bg-background p-2.5",children:[(0,r.jsx)("span",{className:"flex-1 text-[13px] text-foreground",children:e.description}),(0,r.jsx)(M.E,{className:"text-[10px] font-medium border-0 shrink-0 ".concat(null==(t=e.required)||t?"bg-[#FFF3E0] dark:bg-[#3a2a12] text-[#E65100] dark:text-[#F0A050]":"bg-secondary text-muted-foreground"),children:null==(a=e.required)||a?p("acceptanceCriteria.required"):p("acceptanceCriteria.optional")})]},s)})})]}),ei&&(0,r.jsx)("div",{className:"mt-5 rounded-lg bg-[#FFEBEE] dark:bg-[#331619] p-2.5 text-xs text-[#C4574C] dark:text-[#F0897E]",children:ei}),ep()]}):null})}),(0,r.jsx)("div",{className:"border-t border-secondary px-6 py-4",children:(0,r.jsx)("div",{className:"flex items-center gap-3",children:A?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R.$,{variant:"outline",className:"border-border",onClick:ex,disabled:f,children:p("common.cancel")}),(0,r.jsx)(R.$,{className:"bg-primary hover:bg-[#B56A42] text-white",onClick:()=>{if(!F.trim())return void el(p("proposals.titleRequired"));el(null),b(async()=>{let e,s=V.filter(e=>e.description.trim().length>0),t={title:F.trim(),description:S.trim()||void 0,priority:P,storyPoints:T?parseFloat(T):void 0,acceptanceCriteriaItems:s.length>0?s.map(e=>{var s;return{description:e.description.trim(),required:null==(s=e.required)||s}}):void 0,...w&&G.length>0?{dependsOnDraftUuids:G}:{}};(e=w?await et(o,t):await q(o,l.uuid,t)).success?(C(!1),h.refresh(),x()):el(e.error||p("proposals.failedToSaveTaskDraft"))})},disabled:f||!F.trim(),children:f?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H.A,{className:"mr-2 h-4 w-4 animate-spin"}),p("common.saving")]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(K.A,{className:"mr-2 h-4 w-4"}),w?p("common.create"):p("common.save")]})})]}):l?(0,r.jsxs)(r.Fragment,{children:[c&&(0,r.jsxs)(R.$,{variant:"outline",className:"border-border",onClick:em,children:[(0,r.jsx)(J.A,{className:"mr-2 h-4 w-4"}),p("common.edit")]}),c&&(0,r.jsx)("div",{className:"ml-auto",children:(0,r.jsxs)(Y.Lt,{children:[(0,r.jsx)(Y.tv,{asChild:!0,children:(0,r.jsx)(R.$,{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,r.jsx)(W.A,{className:"h-4 w-4"})})}),(0,r.jsxs)(Y.EO,{children:[(0,r.jsxs)(Y.wd,{children:[(0,r.jsx)(Y.r7,{children:p("proposals.deleteTaskDraft")}),(0,r.jsx)(Y.$v,{children:p("proposals.deleteTaskDraftConfirm")})]}),(0,r.jsxs)(Y.ck,{children:[(0,r.jsx)(Y.Zr,{children:p("common.cancel")}),(0,r.jsx)(Y.Rx,{onClick:()=>{l&&b(async()=>{(await er(o,l.uuid)).success&&(h.refresh(),null==u||u())})},disabled:f,className:"bg-[#D32F2F] hover:bg-[#B71C1C] text-white",children:f?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(H.A,{className:"mr-2 h-4 w-4 animate-spin"}),p("common.delete")]}):p("common.delete")})]})]})]})})]}):null})})]})]})}var ei=t(43664),el=t(69189);let ed={high:{bg:"bg-[#FFEBEE] dark:bg-[#331619]",text:"text-[#C4574C] dark:text-[#F0897E]"},medium:{bg:"bg-[#FFF3E0] dark:bg-[#3a2a12]",text:"text-[#E65100] dark:text-[#F0A050]"},low:{bg:"bg-secondary",text:"text-muted-foreground"}},eo={prd:{icon:m.A,bg:"bg-[#FFF3E0] dark:bg-[#3a2a12]",fg:"text-[#E07A5F] dark:text-[#F0A088]",subtitleKey:"proposals.docSubtitlePrd"},tech_design:{icon:u,bg:"bg-[#E8F0FE] dark:bg-[#152438]",fg:"text-[#4285F4] dark:text-[#7AB0F8]",subtitleKey:"proposals.docSubtitleTechDesign"},adr:{icon:p.A,bg:"bg-[#E8F5E9] dark:bg-[#14281a]",fg:"text-[#4CAF50] dark:text-[#6FD18A]",subtitleKey:"proposals.docSubtitleAdr"},spec:{icon:h,bg:"bg-[#F3E8FD] dark:bg-[#261636]",fg:"text-[#7C3AED] dark:text-[#B79AF0]",subtitleKey:"proposals.docSubtitleSpec"},guide:{icon:f,bg:"bg-[#FFF8E1] dark:bg-[#33270f]",fg:"text-[#F9A825]",subtitleKey:"proposals.docSubtitleGuide"}},ec={taskDraftNode:function(e){let{data:s}=e,t=(0,i.c)(),a=ed[s.priority||"medium"]||ed.medium;return(0,r.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,r.jsx)(l.h7,{type:"target",position:d.yX.Top,className:"!bg-primary !w-2 !h-2"}),(0,r.jsx)("div",{className:"flex items-center gap-2 mb-1.5",children:s.priority&&(0,r.jsx)(M.E,{className:"text-[10px] border-0 ".concat(a.bg," ").concat(a.text),children:t("priority.".concat(s.priority))})}),(0,r.jsx)("p",{className:"text-xs font-medium text-foreground leading-snug line-clamp-2",children:s.title}),(0,r.jsx)(l.h7,{type:"source",position:d.yX.Bottom,className:"!bg-primary !w-2 !h-2"})]})}},em={animated:!0,style:{stroke:"#C67A52",strokeWidth:2},markerEnd:{type:"arrowclosed",color:"#C67A52"}};function ex(e){let{proposalUuid:s,status:t,documentDrafts:d,taskDrafts:o,onStatusChange:x}=e,u=(0,i.c)(),p=(0,n.r)(),h=(0,A.W)(),[f,P]=(0,a.useTransition)(),{getPresence:Z}=(0,w.xQ)();Z("proposal",s);let[J,H]=(0,a.useState)(d),[K,W]=(0,a.useState)(o),[Q,X]=(0,a.useState)(new Set),Y=(0,a.useRef)(J);Y.current=J;let ee=(0,a.useRef)(K);ee.current=K;let es=(0,a.useRef)(null),et=(0,a.useRef)(null),[er,ea]=(0,a.useState)("cards"),[ex,eu]=(0,a.useState)(new Set),[ep,eh]=(0,a.useState)(!1),[ef,eg]=(0,a.useState)(null),[eb,ej]=(0,a.useState)("prd"),[ev,eN]=(0,a.useState)(""),[ey,ek]=(0,a.useState)(""),[ew,eA]=(0,a.useState)(null),[eC,eF]=(0,a.useState)(!1),[eE,eS]=(0,a.useState)(null),[eD,eP]=(0,a.useState)(null),eU=(0,el.F7)()&&"draft"===t;(0,F.w0)("proposal",s,async e=>{if(["created","updated","deleted"].includes(e.action)&&!ep&&!ew&&!eC)try{var r,a,n,i,l,d,o,c,m,u;let e=await U(s),h=null!=(r=Y.current)?r:[],f=null!=(a=ee.current)?a:[],g=null!=(n=e.documentDrafts)?n:[],b=null!=(i=e.taskDrafts)?i:[],j=[...E(h,g),...E(f,b)];if(j.length>0){let e=Z("proposal",s)[0];if(e)for(let t of j)(0,w.fv)({entityType:"proposal",entityUuid:s,subEntityType:"draft",subEntityUuid:t,agentUuid:e.agentUuid,agentName:e.agentName,action:"mutate"})}let v=[...S(h,g),...S(f,b)];v.length>0?(es.current=g,et.current=b,X(new Set(v)),setTimeout(()=>{var e,s;H(null!=(e=es.current)?e:g),W(null!=(s=et.current)?s:b),es.current=null,et.current=null,X(new Set)},500)):(es.current=g,et.current=b,H(g),W(b)),d=e.status,o=h.length,c=g.length,m=f.length,u=b.length,(null!=d&&d!==t||"draft"===t&&(c!==o||u!==m))&&p.refresh(),null==x||x(null!=(l=e.status)?l:t)}catch(e){ei.q.warn("[ProposalEditor] Failed to refresh drafts:",e)}});let eT=(0,a.useMemo)(()=>ew&&K&&K.find(e=>e.uuid===ew)||null,[ew,K]),[eR,eM,e$]=(0,l.ck)([]),[ez,eB,eO]=(0,l.fM)([]);(0,a.useEffect)(()=>{if(!K||0===K.length){eM([]),eB([]);return}let e=K.map(e=>({id:e.uuid,type:"taskDraftNode",position:{x:0,y:0},data:{title:e.title,priority:e.priority||"medium"}})),s=[];K.forEach(e=>{e.dependsOnDraftUuids&&e.dependsOnDraftUuids.forEach((t,r)=>{s.push({id:"e-".concat(e.uuid,"-").concat(r),source:t,target:e.uuid,...em})})});let{nodes:t,edges:r}=function(e,s){let t=new(c()).graphlib.Graph;return t.setDefaultEdgeLabel(()=>({})),t.setGraph({rankdir:"TB",nodesep:50,ranksep:80}),e.forEach(e=>{t.setNode(e.id,{width:240,height:80})}),s.forEach(e=>{t.setEdge(e.source,e.target)}),c().layout(t),{nodes:e.map(e=>{let s=t.node(e.id);return{...e,position:{x:s.x-120,y:s.y-40}}}),edges:s}}(e,s);eM(t),eB(r)},[K,eM,eB]);let e_=(0,a.useCallback)(async e=>{if(!e.source||!e.target||!eU||e.source===e.target)return;eP(null);let t=e.target,r=e.source,a=null==K?void 0:K.find(e=>e.uuid===t);if(!a)return;let n=a.dependsOnDraftUuids||[];if(n.includes(r))return void eP(u("proposals.dependencyExists"));if(((e,s)=>{let t=new Set,r=[e];for(;r.length>0;){let e=r.shift();if(e===s)return!0;if(t.has(e))continue;t.add(e);let a=null==K?void 0:K.find(s=>s.uuid===e);(null==a?void 0:a.dependsOnDraftUuids)&&r.push(...a.dependsOnDraftUuids)}return!1})(r,t))return void eP(u("proposals.cyclicDependency"));let i=[...n,r];P(async()=>{let e=await q(s,t,{dependsOnDraftUuids:i});e.success?p.refresh():eP(e.error||u("proposals.failedToAddDependency"))})},[eU,K,s,p,P,u]),eL=(0,a.useCallback)((e,s)=>{eF(!1),eA(s.id)},[]),eq=J&&J.length>0,eV=K&&K.length>0,eI=null!==ew||eC;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(T.Zp,{className:"border-[#E5E2DC] dark:border-[#2a2a2e] shadow-none rounded-2xl gap-0 py-0 overflow-hidden",children:[(0,r.jsxs)(T.aR,{className:"flex-row items-center justify-between border-b border-secondary px-6 py-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)(m.A,{className:"h-[18px] w-[18px] text-primary"}),(0,r.jsx)(T.ZB,{className:"text-sm font-semibold text-foreground",children:u("proposals.documentDrafts")}),(0,r.jsx)(M.E,{variant:"secondary",className:"border-0 bg-secondary text-[11px] font-medium text-muted-foreground",children:(null==J?void 0:J.length)||0})]}),eU&&(0,r.jsxs)(R.$,{variant:"ghost",size:"sm",onClick:()=>{eg(null),ej("prd"),eN(""),ek(""),eh(!0)},className:"h-7 gap-1 text-xs font-medium text-primary hover:bg-[#FFFBF8] dark:hover:bg-[#1e1d1b] hover:text-primary",children:[(0,r.jsx)(g.A,{className:"h-3.5 w-3.5"}),u("proposals.addDocumentDraft")]})]}),(0,r.jsx)(T.Wu,{className:"p-0",children:eq?(0,r.jsx)("div",{className:"space-y-0 divide-y divide-secondary",children:J.map(e=>{var t;let a=ex.has(e.uuid),n=eo[e.type]||eo.guide,i=n.icon;return(0,r.jsx)(C.D,{entityType:"proposal",entityUuid:s,subEntityType:"draft",subEntityUuid:e.uuid,badgeInside:!0,children:(0,r.jsxs)("div",{className:"px-5 py-4 transition-all duration-500 ".concat(Q.has(e.uuid)?"opacity-0":""),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("button",{onClick:()=>{var s;return s=e.uuid,void eu(e=>{let t=new Set(e);return t.has(s)?t.delete(s):t.add(s),t})},className:"flex items-center gap-3 text-left cursor-pointer hover:opacity-80 transition-opacity min-w-0",children:[(0,r.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-[10px] ".concat(n.bg),children:(0,r.jsx)(i,{className:"h-[18px] w-[18px] ".concat(n.fg)})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-[13px] font-medium text-foreground truncate",children:e.title}),(0,r.jsx)("div",{className:"text-[11px] text-muted-foreground",children:u(n.subtitleKey)})]}),(0,r.jsx)("span",{className:"text-muted-foreground shrink-0",children:a?(0,r.jsx)(b.A,{className:"h-4 w-4"}):(0,r.jsx)(j.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"flex gap-1 shrink-0",children:[(0,r.jsx)(D.E,{document:{title:e.title,content:null!=(t=e.content)?t:"",type:e.type,version:"Draft"},variant:"compact"}),eU&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(R.$,{variant:"ghost",size:"sm",onClick:()=>{eg(e),ej(e.type),eN(e.title),ek(e.content),eh(!0)},className:"h-6 text-[11px] text-muted-foreground hover:text-foreground",children:u("proposals.editDraft")}),(0,r.jsx)(R.$,{variant:"ghost",size:"sm",onClick:()=>{confirm(u("common.confirmDelete"))&&P(async()=>{(await G(s,e.uuid)).success&&p.refresh()})},disabled:f,className:"h-6 text-[11px] text-[#C4574C] dark:text-[#F0897E] hover:bg-[#FFEBEE] dark:hover:bg-[#331619] hover:text-[#C4574C]",children:u("proposals.deleteDraft")})]})]})]}),a&&e.content&&(0,r.jsx)("div",{className:"mt-3 border-t border-secondary pt-4",children:(0,r.jsx)("div",{className:"prose prose-sm max-w-none text-foreground",children:(0,r.jsx)(L.MarkdownContent,{children:e.content})})})]})},e.uuid)})}):(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 px-6 py-8",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-[10px] bg-secondary",children:(0,r.jsx)(m.A,{className:"h-[18px] w-[18px] text-[#D0CCC4]"})}),(0,r.jsx)("p",{className:"text-[13px] text-muted-foreground",children:u("proposals.emptyContainer")})]})})]}),(0,r.jsxs)(T.Zp,{className:"border-[#E5E2DC] dark:border-[#2a2a2e] shadow-none rounded-2xl gap-0 py-0 overflow-hidden",children:[(0,r.jsxs)(T.aR,{className:"flex-row items-center justify-between border-b border-secondary px-6 py-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)(v,{className:"h-[18px] w-[18px] text-primary"}),(0,r.jsx)(T.ZB,{className:"text-sm font-semibold text-foreground",children:u("proposals.taskDrafts")}),(0,r.jsx)(M.E,{className:"border-0 bg-primary/[0.13] text-[11px] font-semibold text-primary",children:(null==K?void 0:K.length)||0})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[eV&&(0,r.jsxs)("div",{className:"flex rounded-lg bg-secondary p-0.5",children:[(0,r.jsx)("button",{onClick:()=>ea("cards"),className:"rounded-md px-3 py-1 text-[11px] font-medium transition-colors ".concat("cards"===er?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:u("proposals.cardsView")}),(0,r.jsx)("button",{onClick:()=>ea("dag"),className:"rounded-md px-3 py-1 text-[11px] font-medium transition-colors ".concat("dag"===er?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"DAG"})]}),eU&&(0,r.jsxs)(R.$,{variant:"ghost",size:"sm",onClick:()=>{eA(null),eF(!0)},className:"h-7 gap-1 text-xs font-medium text-primary hover:bg-[#FFFBF8] dark:hover:bg-[#1e1d1b] hover:text-primary",children:[(0,r.jsx)(g.A,{className:"h-3.5 w-3.5"}),u("proposals.addTaskDraft")]})]})]}),(0,r.jsx)(T.Wu,{className:"p-0",children:eV?"cards"===er?(0,r.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 p-5",children:K.map(e=>{var t,a;let n=ed[e.priority||"medium"]||ed.medium,i=(null==(t=e.dependsOnDraftUuids)?void 0:t.length)||0,l=(null==(a=e.acceptanceCriteriaItems)?void 0:a.length)||0,d=ew===e.uuid;return(0,r.jsx)(C.D,{entityType:"proposal",entityUuid:s,subEntityType:"draft",subEntityUuid:e.uuid,children:(0,r.jsxs)("div",{onClick:()=>{eF(!1),eA(e.uuid)},className:"cursor-pointer rounded-[10px] bg-card p-4 transition-all duration-500 flex flex-col gap-2.5 h-full ".concat(Q.has(e.uuid)?"opacity-0":""," ").concat(d?"border-primary shadow-sm border":"border-[#E5E2DC] dark:border-[#2a2a2e] hover:border-primary/50 border"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[e.priority&&(0,r.jsx)(M.E,{className:"text-[10px] font-semibold border-0 ".concat(n.bg," ").concat(n.text),children:u("priority.".concat(e.priority))}),null!=e.storyPoints&&e.storyPoints>0&&(0,r.jsxs)("span",{className:"flex items-center gap-1 text-[10px] font-medium text-muted-foreground font-mono",children:[(0,r.jsx)(N.A,{className:"h-3 w-3 text-muted-foreground"}),e.storyPoints," SP"]})]}),(0,r.jsx)("span",{className:"text-[13px] font-semibold leading-snug text-foreground line-clamp-2",children:e.title}),e.description&&(0,r.jsx)("p",{className:"text-[11px] leading-relaxed text-muted-foreground line-clamp-2",children:e.description}),(0,r.jsxs)("div",{className:"flex items-center gap-3 pt-0.5",children:[l>0&&(0,r.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[(0,r.jsx)(y.A,{className:"h-3 w-3 text-[#4CAF50] dark:text-[#6FD18A]"}),u("proposals.acCount",{count:l})]}),i>0&&(0,r.jsxs)("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[(0,r.jsx)(k.A,{className:"h-3 w-3"}),u("proposals.depCount",{count:i})]})]})]})},e.uuid)})}):(0,r.jsxs)("div",{className:"h-[400px] relative",children:[eD&&(0,r.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:[eD,(0,r.jsx)("button",{className:"ml-2 font-medium hover:text-red-900 dark:hover:text-[#F0A0A0]",onClick:()=>eP(null),children:"x"})]}),(0,r.jsxs)(l.Gc,{colorMode:h?"dark":"light",nodes:eR,edges:ez,onNodesChange:e$,onEdgesChange:eO,onConnect:e_,onNodeClick:eL,nodeTypes:ec,fitView:!0,fitViewOptions:{padding:.3},minZoom:.3,maxZoom:1.5,proOptions:{hideAttribution:!0},zoomOnScroll:!0,zoomOnPinch:!0,panOnDrag:!0,children:[(0,r.jsx)(l.VS,{color:h?"#40392f":"#E5E0D8",gap:20}),(0,r.jsx)(l.H2,{className:"[&>button]:border-border [&>button]:bg-card [&>button]:text-foreground [&>button:hover]:bg-background"})]})]}):(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 px-6 py-8",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-[10px] bg-secondary",children:(0,r.jsx)(v,{className:"h-[18px] w-[18px] text-[#D0CCC4]"})}),(0,r.jsx)("p",{className:"text-[13px] text-muted-foreground",children:u("proposals.emptyContainer")})]})})]}),(0,r.jsx)(O.lG,{open:ep,onOpenChange:eh,children:(0,r.jsxs)(O.Cf,{className:"max-w-2xl",children:[(0,r.jsx)(O.c7,{children:(0,r.jsx)(O.L3,{children:ef?u("proposals.editDraft"):u("proposals.addDocumentDraft")})}),(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{className:"mb-2 block text-muted-foreground",children:u("proposals.documentType")}),(0,r.jsxs)(_.l6,{value:eb,onValueChange:ej,children:[(0,r.jsx)(_.bq,{className:"border-[#E5E2DC] dark:border-[#2a2a2e]",children:(0,r.jsx)(_.yv,{})}),(0,r.jsxs)(_.gC,{children:[(0,r.jsx)(_.eb,{value:"prd",children:u("proposals.docTypePrd")}),(0,r.jsx)(_.eb,{value:"tech_design",children:u("proposals.docTypeTechDesign")}),(0,r.jsx)(_.eb,{value:"adr",children:u("proposals.docTypeAdr")}),(0,r.jsx)(_.eb,{value:"spec",children:u("proposals.docTypeSpec")}),(0,r.jsx)(_.eb,{value:"guide",children:u("proposals.docTypeGuide")})]})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)(B.J,{className:"mb-2 block text-muted-foreground",children:[u("proposals.documentTitle")," *"]}),(0,r.jsx)($.p,{value:ev,onChange:e=>eN(e.target.value),placeholder:u("proposals.titlePlaceholder"),className:"border-[#E5E2DC] dark:border-[#2a2a2e]"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(B.J,{className:"mb-2 block text-muted-foreground",children:u("proposals.documentContent")}),(0,r.jsx)(z.T,{value:ey,onChange:e=>ek(e.target.value),className:"h-64 resize-none border-[#E5E2DC] dark:border-[#2a2a2e] font-mono",placeholder:"# Document Title Write your content in Markdown..."})]}),eE&&(0,r.jsx)("div",{className:"rounded-lg bg-[#FFEBEE] dark:bg-[#331619] p-3 text-sm text-[#C4574C] dark:text-[#F0897E]",children:eE}),(0,r.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,r.jsx)(R.$,{variant:"outline",onClick:()=>eh(!1),disabled:f,className:"border-[#E5E2DC] dark:border-[#2a2a2e]",children:u("common.cancel")}),(0,r.jsx)(R.$,{onClick:()=>{if(!ev.trim())return void eS(u("proposals.titleRequired"));eS(null),P(async()=>{let e;(e=ef?await V(s,ef.uuid,{type:eb,title:ev.trim(),content:ey}):await I(s,{type:eb,title:ev.trim(),content:ey})).success?(eh(!1),p.refresh()):eS(e.error||u("proposals.failedToSaveDocDraft"))})},disabled:f,className:"bg-primary text-white hover:bg-[#B56A42]",children:f?u("common.saving"):u("common.save")})]})]})]})}),eI&&(0,r.jsx)(en,{taskDraft:eC?null:eT,allTaskDrafts:K||[],proposalUuid:s,canEdit:eU,onClose:()=>{eA(null),eF(!1)},onSaved:()=>{eC&&eF(!1)},onDeleted:()=>{eA(null),eF(!1)}})]})}},98290:(e,s,t)=>{"use strict";t.d(s,{FormattedDateTime:()=>n});var r=t(60200),a=t(3562);function n(e){let{date:s}=e;return(0,r.jsx)(r.Fragment,{children:(0,a.r)(s)})}}},e=>{e.O(0,[32271,87326,93151,41752,30996,57084,68381,71444,92037,41677,25554,6893,74414,34216,7659,76404,25452,33218,10201,38803,23593,10006,26441,73632,63472,65208,8575,5899,86791,80395,21495,75556,16198,75844,15638,88277,73849,46608,77358],()=>e(e.s=58701)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14730],{14122:(e,r,t)=>{"use strict";t.r(r),t.d(r,{Label:()=>n,Root:()=>o});var a=t(81476),s=t(45904),i=t(60200),n=a.forwardRef((e,r)=>(0,i.jsx)(s.sG.label,{...e,ref:r,onMouseDown:r=>{var t;r.target.closest("button, input, select, textarea")||(null==(t=e.onMouseDown)||t.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));n.displayName="Label";var o=n},16272:(e,r,t)=>{"use strict";t.d(r,{BT:()=>d,Wu:()=>l,ZB:()=>o,Zp:()=>i,aR:()=>n});var a=t(60200);t(81476);var s=t(49417);function i(e){let{className:r,...t}=e;return(0,a.jsx)("div",{"data-slot":"card",className:(0,s.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",r),...t})}function n(e){let{className:r,...t}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,s.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",r),...t})}function o(e){let{className:r,...t}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,s.cn)("leading-none font-semibold",r),...t})}function d(e){let{className:r,...t}=e;return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,s.cn)("text-muted-foreground text-sm",r),...t})}function l(e){let{className:r,...t}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-6",r),...t})}},16852:(e,r,t)=>{"use strict";t.d(r,{T:()=>i});var a=t(60200);t(81476);var s=t(49417);function i(e){let{className:r,...t}=e;return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("mobile-input-text","border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),...t})}},30474:(e,r,t)=>{"use strict";t.d(r,{p:()=>i});var a=t(60200);t(81476);var s=t(49417);function i(e){let{className:r,type:t,...i}=e;return(0,a.jsx)("input",{type:t,"data-slot":"input",className:(0,s.cn)("mobile-input-text","file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",r),...i})}},32022:(e,r,t)=>{"use strict";t.d(r,{r:()=>i});var a=t(41677),s=t(81476);function i(){let e=(0,a.r)({delay:120});return(0,s.useMemo)(()=>({...e,refresh:()=>e.refresh({showProgress:!1})}),[e])}},40058:(e,r,t)=>{"use strict";t.d(r,{$:()=>d});var a=t(60200);t(81476);var s=t(53859),i=t(45911),n=t(49417);let o=(0,s.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function d(e){let{className:r,variant:t="default",size:s="default",asChild:d=!1,...l}=e,c=d?i.bL:"button";return(0,a.jsx)(c,{"data-slot":"button","data-variant":t,"data-size":s,className:(0,n.cn)(o({variant:t,size:s,className:r})),...l})}},42885:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),!function(e,r){for(var t in r)Object.defineProperty(e,t,{enumerable:!0,get:r[t]})}(r,{callServer:function(){return a.callServer},createServerReference:function(){return i.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}});let a=t(11206),s=t(4466),i=t(27150)},45200:(e,r,t)=>{"use strict";t.d(r,{J:()=>n});var a=t(60200);t(81476);var s=t(14122),i=t(49417);function n(e){let{className:r,...t}=e;return(0,a.jsx)(s.Root,{"data-slot":"label",className:(0,i.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",r),...t})}},45904:(e,r,t)=>{"use strict";t.d(r,{bL:()=>l,hO:()=>d,sG:()=>o});var a=t(81476),s=t(42917),i=t(45911),n=t(60200),o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let t=(0,i.TL)(`Primitive.${r}`),s=a.forwardRef((e,a)=>{let{asChild:s,...i}=e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,n.jsx)(s?t:r,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{});function d(e,r){e&&s.flushSync(()=>e.dispatchEvent(r))}var l=o},49417:(e,r,t)=>{"use strict";t.d(r,{cn:()=>i});var a=t(71019),s=t(2105);function i(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,s.QP)((0,a.$)(r))}},71507:(e,r,t)=>{"use strict";t.d(r,{A:()=>a});let a=(0,t(73326).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},72881:(e,r,t)=>{"use strict";t.d(r,{CreateProposalForm:()=>f});var a=t(60200),s=t(81476),i=t(32022),n=t(25588),o=t(71507),d=t(16272),l=t(40058),c=t(30474),u=t(75507),v=t(16852),p=t(45200),b=t(42885);let g=(0,b.createServerReference)("60367511cf1eee56e9b9abc0cbc503168934470433",b.callServer,void 0,b.findSourceMapURL,"createProposalAction");function f(e){let{projectUuid:r,availableIdeas:t,preselectedIdeaUuid:b}=e,f=(0,n.c)(),x=(0,i.r)(),[m,h]=(0,s.useTransition)(),[y,w]=(0,s.useState)(""),[j,k]=(0,s.useState)(""),[N,z]=(0,s.useState)(b?[b]:[]),[S,_]=(0,s.useState)(null);return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)(d.Zp,{className:"border-border p-6",children:[(0,a.jsx)("h2",{className:"mb-4 text-lg font-medium text-foreground",children:f("proposals.basicInfo")}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)(p.J,{className:"mb-2 block text-muted-foreground",children:[f("proposals.title")," *"]}),(0,a.jsx)(c.p,{value:y,onChange:e=>w(e.target.value),placeholder:f("proposals.titlePlaceholder"),className:"border-border"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(p.J,{className:"mb-2 block text-muted-foreground",children:f("common.description")}),(0,a.jsx)(v.T,{value:j,onChange:e=>k(e.target.value),placeholder:f("proposals.descriptionPlaceholder"),className:"h-24 resize-none border-border"})]})]})]}),(0,a.jsxs)(d.Zp,{className:"border-border p-6",children:[(0,a.jsxs)("h2",{className:"mb-4 text-lg font-medium text-foreground",children:[f("proposals.selectSourceIdeas")," *"]}),0===t.length?(0,a.jsx)("p",{className:"text-sm text-[#9A9A9A]",children:f("proposals.noAvailableIdeas")}):(0,a.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,a.jsxs)("div",{onClick:()=>{var r;return r=e.uuid,void z(e=>e.includes(r)?e.filter(e=>e!==r):[...e,r])},className:"flex cursor-pointer items-center justify-between rounded-lg border p-3 transition-colors ".concat(N.includes(e.uuid)?"border-primary bg-[#FFFBF8] dark:bg-[#241d17]":"border-border hover:border-primary"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex h-5 w-5 items-center justify-center rounded border ".concat(N.includes(e.uuid)?"border-primary bg-primary text-white":"border-border"),children:N.includes(e.uuid)&&(0,a.jsx)(o.A,{className:"h-3 w-3",strokeWidth:3})}),(0,a.jsx)("span",{className:"font-medium text-foreground",children:e.title})]}),(0,a.jsx)(u.E,{variant:"outline",className:"text-xs",children:e.status})]},e.uuid))})]}),S&&(0,a.jsx)("div",{className:"rounded-lg bg-[#FFEBEE] dark:bg-[#331619] p-3 text-sm text-[#D32F2F] dark:text-[#F08078]",children:S}),(0,a.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,a.jsx)(l.$,{variant:"outline",onClick:()=>x.back(),disabled:m,className:"border-border",children:f("common.cancel")}),(0,a.jsx)(l.$,{onClick:()=>y.trim()?0===N.length?void _(f("proposals.selectAtLeastOneIdea")):void(_(null),h(async()=>{let e=await g(r,{title:y.trim(),description:j.trim()||void 0,inputType:"idea",inputUuids:N});e.success&&e.proposal?x.push("/projects/".concat(r,"/proposals/").concat(e.proposal.uuid)):_(e.error||f("proposals.createFailed"))})):void _(f("proposals.titleRequired")),disabled:m,className:"bg-primary hover:bg-[#B56A42] text-white",children:m?f("common.creating"):f("proposals.createAndEdit")})]})]})}},75507:(e,r,t)=>{"use strict";t.d(r,{E:()=>d});var a=t(60200);t(81476);var s=t(53859),i=t(45911),n=t(49417);let o=(0,s.F)("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"}},defaultVariants:{variant:"default"}});function d(e){let{className:r,variant:t="default",asChild:s=!1,...d}=e,l=s?i.bL:"span";return(0,a.jsx)(l,{"data-slot":"badge","data-variant":t,className:(0,n.cn)(o({variant:t}),r),...d})}},90251:(e,r,t)=>{Promise.resolve().then(t.bind(t,72881))}},e=>{e.O(0,[71444,92037,41677,73849,46608,77358],()=>e(e.s=90251)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91143],{672:(e,t,r)=>{Promise.resolve().then(r.bind(r,30932)),Promise.resolve().then(r.bind(r,25986)),Promise.resolve().then(r.bind(r,5751)),Promise.resolve().then(r.bind(r,95957)),Promise.resolve().then(r.bind(r,2236)),Promise.resolve().then(r.bind(r,32655)),Promise.resolve().then(r.bind(r,35877)),Promise.resolve().then(r.bind(r,8575)),Promise.resolve().then(r.bind(r,73012)),Promise.resolve().then(r.bind(r,14863)),Promise.resolve().then(r.bind(r,14122)),Promise.resolve().then(r.bind(r,94690)),Promise.resolve().then(r.bind(r,27797)),Promise.resolve().then(r.bind(r,33218)),Promise.resolve().then(r.bind(r,82288)),Promise.resolve().then(r.bind(r,48364)),Promise.resolve().then(r.bind(r,58930)),Promise.resolve().then(r.bind(r,74294)),Promise.resolve().then(r.bind(r,2735)),Promise.resolve().then(r.bind(r,23831)),Promise.resolve().then(r.bind(r,60475)),Promise.resolve().then(r.bind(r,44954)),Promise.resolve().then(r.bind(r,91462)),Promise.resolve().then(r.bind(r,44188)),Promise.resolve().then(r.bind(r,69228)),Promise.resolve().then(r.bind(r,44154)),Promise.resolve().then(r.bind(r,55794)),Promise.resolve().then(r.bind(r,87712)),Promise.resolve().then(r.bind(r,36102)),Promise.resolve().then(r.t.bind(r,25554,23)),Promise.resolve().then(r.bind(r,84007))},7685:(e,t,r)=>{"use strict";r.d(t,{D:()=>o});var n=r(60200),a=r(48186),s=r(69351),i=r(26185);function o(e){let{entityType:t,entityUuid:r,subEntityType:i,subEntityUuid:o,children:d,badgeInside:c}=e,{getPresence:u}=(0,a.xQ)(),f=u(t,r,i,o),m=f.length>0,p=m&&f.some(e=>"mutate"===e.action),x=m?p?f.find(e=>"mutate"===e.action):f[f.length-1]:null,v=x?(0,s.j)(x.agentName):"transparent";return(0,n.jsxs)("div",{className:"relative",style:m?{outline:"2px ".concat(p?"solid":"dashed"," ").concat(v),outlineOffset:"-2px",borderRadius:"var(--radius)"}:void 0,children:[m&&(0,n.jsxs)("div",{className:"absolute flex gap-1 z-10 justify-end ".concat(c?"top-0.5 right-1.5 max-w-[70%]":"-top-2.5 right-2 max-w-[80%]"),children:[f.slice(0,3).map(e=>(0,n.jsx)(l,{entry:e},e.agentUuid)),f.length>3&&(0,n.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:["+",f.length-3]})]}),d]})}function l(e){let{entry:t}=e,r=(0,s.j)(t.agentName);return(0,n.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:r},children:[(0,n.jsx)(i.AgentAvatar,{name:t.agentName,size:14,className:"rounded-full"}),t.agentName]})}},16272:(e,t,r)=>{"use strict";r.d(t,{BT:()=>l,Wu:()=>d,ZB:()=>o,Zp:()=>s,aR:()=>i});var n=r(60200);r(81476);var a=r(49417);function s(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...r})}function i(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...r})}function o(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",t),...r})}function l(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",t),...r})}function d(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",t),...r})}},26185:(e,t,r)=>{"use strict";r.d(t,{AgentAvatar:()=>x,Pf:()=>m});var n=r(60200),a=r(81476),s=r(81106),i=r(72677),o=r(63211),l=r(14518),d=r(62925),c=r(49417);let u=new i.O(l),f=new Map;function m(e,t){let r,n="".concat(t,"\0").concat(e),a=f.get(n);if(void 0!==a)return a;try{let n="animated"===t?{seed:e,tags:["animation"]}:{seed:e,tags:["!animation"]};r=new o.e(u,n).toDataUri()}catch(e){r=null}return f.set(n,r),r}let p={xs:20,sm:24,md:32,lg:40};function x(e){let{name:t,size:r="md",animate:i=!0,className:o}=e,[l,u]=a.useState(!1);a.useEffect(()=>{var e;if("function"!=typeof window.matchMedia)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)");u(t.matches);let r=e=>u(e.matches);return null==(e=t.addEventListener)||e.call(t,"change",r),()=>{var e;return null==(e=t.removeEventListener)?void 0:e.call(t,"change",r)}},[]);let f=i&&!l?"animated":"static",x=a.useMemo(()=>m(t,f),[t,f]),v="number"==typeof r?r:p[r],g=t.trim().charAt(0).toUpperCase();return(0,n.jsxs)(d.eu,{"data-slot":"agent-avatar","data-motion":f,className:(0,c.cn)("shrink-0 rounded-md bg-muted",o),style:{width:v,height:v},children:[x?(0,n.jsx)(d.BK,{src:x,alt:t,className:(0,c.cn)("rounded-md","origin-top scale-[1.5] -translate-y-[10%]"),draggable:!1}):null,(0,n.jsx)(d.q5,{className:"rounded-md","aria-label":t,children:g?(0,n.jsx)("span",{className:"text-[0.7em] font-medium",children:g}):(0,n.jsx)(s.A,{className:"size-1/2","aria-hidden":!0})})]})}},32022:(e,t,r)=>{"use strict";r.d(t,{r:()=>s});var n=r(41677),a=r(81476);function s(){let e=(0,n.r)({delay:120});return(0,a.useMemo)(()=>({...e,refresh:()=>e.refresh({showProgress:!1})}),[e])}},38060:(e,t,r)=>{"use strict";r.d(t,{S2:()=>c,eV:()=>d,l9:()=>l,tS:()=>o,w0:()=>u});var n=r(60200),a=r(81476);r(32022);var s=r(42790);let i=(0,a.createContext)(null);function o(e){let{projectUuid:t,children:r}=e,o=(0,s.jj)(),l=null==o?void 0:o.subscribe,d=null==o?void 0:o.openGeneration,c=(0,a.useRef)(new Set),u=(0,a.useRef)(new Set),f=(0,a.useRef)(new Set),m=(0,a.useRef)(new Set),p=(0,a.useCallback)(()=>{c.current.forEach(e=>e())},[]),x=(0,a.useCallback)(e=>{u.current.forEach(t=>t(e))},[]),v=(0,a.useCallback)(()=>{for(let e of(p(),["task","idea","proposal","document","project","project_group"]))x({companyUuid:"",projectUuid:"",entityType:e,entityUuid:"",action:"updated"})},[p,x]);(0,a.useEffect)(()=>{let e,r,n=null,a=!1,s=0,i={};function o(r){if("presence"===r.type){if(t&&r.projectUuid!==t)return;f.current.forEach(e=>e(r));return}if("execution"===r.type)return void m.current.forEach(e=>e(r));if("string"!=typeof r.entityType||"string"!=typeof r.entityUuid||"string"!=typeof r.action||t&&r.projectUuid!==t)return;clearTimeout(e);let n=Date.now(),a=n-s;a>=3e3?(s=n,p()):e=setTimeout(()=>{s=Date.now(),p()},Math.max(1e3,3e3-a));let o=r.entityType;clearTimeout(i[o]),i[o]=setTimeout(()=>{x(r)},300)}function d(){c(),(n=new EventSource(t?"/api/events?projectUuid=".concat(encodeURIComponent(t)):"/api/events")).onopen=()=>{a&&v(),a=!0},n.onmessage=e=>{let t=null;try{t=JSON.parse(e.data)}catch(e){return}t&&o(t)},n.onerror=()=>{}}function c(){n&&(n.close(),n=null)}function u(){"visible"===document.visibilityState&&(n&&n.readyState!==EventSource.CLOSED||d())}return l?r=l(o):(d(),document.addEventListener("visibilitychange",u)),()=>{for(let t in null==r||r(),c(),clearTimeout(e),i)clearTimeout(i[t]);document.removeEventListener("visibilitychange",u)}},[t,l,p,x,v]);let g=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(l&&d){if(null===g.current){g.current=d;return}d>g.current&&(g.current=d,v())}},[l,d,v]);let h=(0,a.useCallback)(e=>(c.current.add(e),()=>{c.current.delete(e)}),[]),b=(0,a.useCallback)(e=>(u.current.add(e),()=>{u.current.delete(e)}),[]),y=(0,a.useCallback)(e=>(f.current.add(e),()=>{f.current.delete(e)}),[]),j=(0,a.useCallback)(e=>(m.current.add(e),()=>{m.current.delete(e)}),[]),w=(0,a.useMemo)(()=>({subscribe:h,subscribeEntity:b,subscribePresence:y,subscribeExecution:j}),[h,b,y,j]);return(0,n.jsx)(i.Provider,{value:w,children:r})}function l(e){let t=(0,a.useContext)(i),r=(0,a.useRef)(e);r.current=e,(0,a.useEffect)(()=>{if(!t)return;let e=()=>r.current();return e(),t.subscribe(e)},[t])}function d(e,t){let r=(0,a.useContext)(i),n=(0,a.useRef)(t);n.current=t;let s=(0,a.useRef)(e);s.current=e,(0,a.useEffect)(()=>{if(r)return r.subscribeEntity(e=>{let t=s.current;(Array.isArray(t)?t.includes(e.entityType):e.entityType===t)&&n.current(e)})},[r])}function c(e){let t=(0,a.useContext)(i),r=(0,a.useRef)(e);r.current=e,(0,a.useEffect)(()=>{if(t)return t.subscribePresence(e=>r.current(e))},[t])}function u(e,t,r){let n=(0,a.useContext)(i),s=(0,a.useRef)(r);s.current=r,(0,a.useEffect)(()=>{if(n)return n.subscribeEntity(r=>{r.entityType===e&&r.entityUuid===t&&s.current(r)})},[n,e,t])}},42790:(e,t,r)=>{"use strict";r.d(t,{D1:()=>l,Qb:()=>o,a7:()=>s,jj:()=>d});var n=r(60200),a=r(81476);let s="stream_reset",i=(0,a.createContext)(null);function o(e){let{children:t}=e,r=(0,a.useRef)(new Set),[o,l]=(0,a.useState)(0),[d,c]=(0,a.useState)(null),u=(0,a.useCallback)(e=>(r.current.add(e),()=>{r.current.delete(e)}),[]);(0,a.useEffect)(()=>{let e=null,t=()=>{e&&(e.close(),e=null)},n=()=>{t(),(e=new EventSource(!d?"/api/events":"/api/events?sessionUuid=".concat(encodeURIComponent(d)))).onopen=()=>{for(let e of(l(e=>e+1),r.current))e({type:s})},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch(e){return}for(let e of r.current)e(t)},e.onerror=()=>{}},a=()=>{"visible"===document.visibilityState&&(null==e||e.readyState!==EventSource.OPEN)&&n()};return n(),document.addEventListener("visibilitychange",a),()=>{t(),document.removeEventListener("visibilitychange",a)}},[d]),(0,a.useEffect)(()=>()=>{r.current.clear()},[]);let f=(0,a.useMemo)(()=>({subscribe:u,openGeneration:o,sessionUuid:d,setSessionUuid:c}),[u,o,d]);return(0,n.jsx)(i.Provider,{value:f,children:t})}function l(){let e=(0,a.useContext)(i);if(!e)throw Error("useDashboardEvents must be used within DashboardEventProvider");return e}function d(){return(0,a.useContext)(i)}},48186:(e,t,r)=>{"use strict";r.d(t,{fv:()=>x,xQ:()=>v});var n=r(81476),a=r(38060);let s=new Map,i=new Map,o=new Map,l=new Set,d=0;function c(e,t,r,n){return r?n?"".concat(e,":").concat(t,":").concat(r,":").concat(n):"".concat(e,":").concat(t,":").concat(r):"".concat(e,":").concat(t)}function u(){d++,l.forEach(e=>e())}function f(e){var t;let r=e.subEntityType,n=e.subEntityUuid,a=c(e.entityType,e.entityUuid,r,n),l=function(e,t,r,n,a){let s=c(e,t,n,a);return"".concat(s,":").concat(r)}(e.entityType,e.entityUuid,e.agentUuid,r,n),d=i.get(l);if(d&&Date.now()-d<3e3)return;i.set(l,Date.now());let f={agentUuid:e.agentUuid,agentName:e.agentName,action:e.action,timestamp:Date.now()},m=(null!=(t=s.get(a))?t:[]).filter(t=>t.agentUuid!==e.agentUuid);m.push(f),s.set(a,m);let p=o.get(l);p&&clearTimeout(p);let x=setTimeout(()=>{let t=s.get(a);if(t){let r=t.filter(t=>t.agentUuid!==e.agentUuid);0===r.length?s.delete(a):s.set(a,r)}i.delete(l),o.delete(l),u()},3e3);o.set(l,x),u()}function m(){return d}function p(e){return l.add(e),()=>{l.delete(e)}}function x(e){f({type:"presence",companyUuid:"",projectUuid:"",...e,timestamp:Date.now()})}function v(){return(0,n.useSyncExternalStore)(p,m,m),(0,a.S2)(f),{getPresence:(e,t,r,n)=>{if(r){var a;return null!=(a=s.get(c(e,t,r,n)))?a:[]}let i="".concat(e,":").concat(t),o=new Map;for(let[e,t]of s)if(e===i||e.startsWith(i+":"))for(let e of t){let t=o.get(e.agentUuid);(!t||e.timestamp>t.timestamp)&&o.set(e.agentUuid,e)}return[...o.values()]}}}},49417:(e,t,r)=>{"use strict";r.d(t,{cn:()=>s});var n=r(71019),a=r(2105);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.QP)((0,n.$)(t))}},58851:(e,t,r)=>{"use strict";r.d(t,{Bc:()=>i,ZI:()=>d,k$:()=>l,m_:()=>o});var n=r(60200);r(81476);var a=r(36102),s=r(49417);function i(e){let{delayDuration:t=0,...r}=e;return(0,n.jsx)(a.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function o(e){let{...t}=e;return(0,n.jsx)(a.Root,{"data-slot":"tooltip",...t})}function l(e){let{...t}=e;return(0,n.jsx)(a.Trigger,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:r=0,children:i,...o}=e;return(0,n.jsx)(a.Portal,{children:(0,n.jsxs)(a.Content,{"data-slot":"tooltip-content",sideOffset:r,className:(0,s.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...o,children:[i,(0,n.jsx)(a.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},62925:(e,t,r)=>{"use strict";r.d(t,{BK:()=>o,eu:()=>i,q5:()=>l});var n=r(60200);r(81476);var a=r(5751),s=r(49417);function i(e){let{className:t,size:r="default",...i}=e;return(0,n.jsx)(a.Root,{"data-slot":"avatar","data-size":r,className:(0,s.cn)("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...i})}function o(e){let{className:t,...r}=e;return(0,n.jsx)(a.Image,{"data-slot":"avatar-image",className:(0,s.cn)("aspect-square size-full",t),...r})}function l(e){let{className:t,...r}=e;return(0,n.jsx)(a.Fallback,{"data-slot":"avatar-fallback",className:(0,s.cn)("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...r})}},69351:(e,t,r)=>{"use strict";r.d(t,{j:()=>a});let n=["#E06C75","#E5C07B","#98C379","#56B6C2","#61AFEF","#C678DD","#D19A66","#BE5046","#7EC8E3","#C3E88D","#F78C6C","#A9DC76"];function a(e){let t=function(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return Math.abs(t)}(e)%n.length;return n[t]}},75507:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var n=r(60200);r(81476);var a=r(53859),s=r(45911),i=r(49417);let o=(0,a.F)("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:r="default",asChild:a=!1,...l}=e,d=a?s.bL:"span";return(0,n.jsx)(d,{"data-slot":"badge","data-variant":r,className:(0,i.cn)(o({variant:r}),t),...l})}},84007:(e,t,r)=>{"use strict";r.d(t,{ProposalKanban:()=>N});var n=r(60200),a=r(81476),s=r(25554),i=r.n(s),o=r(25588),l=r(16272),d=r(75507),c=r(43322),u=r(26185),f=r(64035),m=r(38060),p=r(88749),x=r(7685),v=r(25452),g=r(42885);let h=(0,g.createServerReference)("40142b795229eb7fb1b2f9c61a5ff54391db9077e9",g.callServer,void 0,g.findSourceMapURL,"fetchProposalsAction"),b=[{id:"draft",labelKey:"status.draft",statuses:["draft"]},{id:"pending",labelKey:"status.pendingReview",statuses:["pending"]},{id:"completed",labelKey:"proposals.completed",statuses:["approved","closed"]}],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-[#2E7D32] dark:text-[#5FD07E]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]"},j={draft:"draft",pending:"pendingReview",approved:"approved",closed:"closed"},w=[{id:"all",labelKey:"proposals.all",statuses:[]},...b];function E(e){let{proposal:t,projectUuid:r,t:a}=e,s=function(e){var t,r;let n=(null==(t=e.documentDrafts)?void 0:t.length)||0,a=(null==(r=e.taskDrafts)?void 0:r.length)||0;return n>0&&a>0?"proposals.typeDocumentAndTasks":n>0?1===n?"proposals.typeNewDocument":"proposals.typeDocumentUpdate":a>0?"proposals.typeTaskBreakdown":null}(t);return(0,n.jsx)(i(),{href:"/projects/".concat(r,"/proposals/").concat(t.uuid),className:"block",children:(0,n.jsx)(x.D,{entityType:"proposal",entityUuid:t.uuid,children:(0,n.jsxs)(l.Zp,{className:"cursor-pointer border-border bg-card p-4 transition-all hover:border-primary hover:shadow-sm",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-start justify-between",children:[(0,n.jsx)(d.E,{className:y[t.status]||y.draft,children:a("status.".concat(j[t.status]||t.status))}),s&&(0,n.jsx)("span",{className:"rounded bg-[#FFF3E0] dark:bg-[#3a2a12] px-2 py-0.5 text-xs font-medium text-[#E65100] dark:text-[#F0A050]",children:a(s)})]}),(0,n.jsx)("h4",{className:"mb-1 font-medium text-foreground",children:t.title}),t.description&&(0,n.jsx)("div",{className:"prose prose-sm max-w-none mb-2 line-clamp-2 text-sm text-muted-foreground",children:(0,n.jsx)(f.MarkdownContent,{children:t.description})}),(0,n.jsx)("div",{className:"flex items-center justify-between text-xs text-[#9A9A9A]",children:t.createdBy&&(0,n.jsxs)("span",{className:"flex items-center gap-1",children:["agent"===t.createdByType?(0,n.jsx)(u.AgentAvatar,{name:t.createdBy.name,size:16,className:"rounded-full"}):(0,n.jsx)(c.A,{className:"h-3 w-3"}),t.createdBy.name]})})]})})})}function N(e){let{projectUuid:t,proposals:r}=e,s=(0,o.c)(),i=(0,p.a)(),[l,d]=(0,a.useState)("all"),[c,u]=(0,a.useState)(r);(0,a.useEffect)(()=>{u(r)},[r]);let f=(0,a.useCallback)(async()=>{let e=await h(t);e.success&&u(e.data)},[t]);(0,m.eV)("proposal",f);let x=e=>c.filter(t=>e.includes(t.status));if(i){let e=w.find(e=>e.id===l)||w[0],r="all"===l?c:x(e.statuses);return(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-3 mb-4",children:w.map(e=>{let t="all"===e.id?c.length:x(e.statuses).length,r=l===e.id;return(0,n.jsxs)("button",{onClick:()=>d(e.id),className:"flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ".concat(r?"bg-primary text-white":"bg-secondary text-muted-foreground hover:bg-[#EDE9E1] dark:hover:bg-[#2a2a2e]"),children:[s(e.labelKey),(0,n.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-xs ".concat(r?"bg-card/20 text-white":"bg-card text-muted-foreground"),children:t})]},e.id)})}),(0,n.jsx)("div",{className:"flex-1 space-y-3",children:0===r.length?(0,n.jsx)(v.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:s("proposals.noProposals")}):r.map(e=>(0,n.jsx)(E,{proposal:e,projectUuid:t,t:s},e.uuid))})]})}return(0,n.jsx)("div",{className:"flex flex-1 gap-4 overflow-x-auto pb-4",children:b.map(e=>{let r=x(e.statuses);return(0,n.jsxs)("div",{className:"flex w-[300px] flex-shrink-0 flex-col rounded-xl bg-secondary p-4",children:[(0,n.jsx)("div",{className:"mb-4 flex items-center justify-between",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h3",{className:"font-medium text-foreground",children:s(e.labelKey)}),(0,n.jsx)("span",{className:"rounded-full bg-card px-2 py-0.5 text-xs font-medium text-muted-foreground",children:r.length})]})}),(0,n.jsx)("div",{className:"flex-1 space-y-4 overflow-y-auto pt-3",children:0===r.length?(0,n.jsx)(v.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:s("proposals.noProposals")}):r.map(e=>(0,n.jsx)(E,{proposal:e,projectUuid:t,t:s},e.uuid))})]},e.id)})})}},88749:(e,t,r)=>{"use strict";r.d(t,{a:()=>a});var n=r(81476);function a(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=window.matchMedia("(max-width: 767px)");t(e.matches);let r=e=>t(e.matches);return e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e}}},e=>{e.O(0,[87326,93151,41752,71444,92037,41677,25554,6893,74414,7659,76404,25452,33218,10201,38803,23593,10006,26441,73632,63472,8575,21495,78909,64035,73849,46608,77358],()=>e(e.s=672)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[91143],{672:(e,t,r)=>{Promise.resolve().then(r.bind(r,30932)),Promise.resolve().then(r.bind(r,25986)),Promise.resolve().then(r.bind(r,5751)),Promise.resolve().then(r.bind(r,95957)),Promise.resolve().then(r.bind(r,2236)),Promise.resolve().then(r.bind(r,32655)),Promise.resolve().then(r.bind(r,35877)),Promise.resolve().then(r.bind(r,8575)),Promise.resolve().then(r.bind(r,73012)),Promise.resolve().then(r.bind(r,14863)),Promise.resolve().then(r.bind(r,14122)),Promise.resolve().then(r.bind(r,94690)),Promise.resolve().then(r.bind(r,27797)),Promise.resolve().then(r.bind(r,33218)),Promise.resolve().then(r.bind(r,82288)),Promise.resolve().then(r.bind(r,48364)),Promise.resolve().then(r.bind(r,58930)),Promise.resolve().then(r.bind(r,74294)),Promise.resolve().then(r.bind(r,2735)),Promise.resolve().then(r.bind(r,23831)),Promise.resolve().then(r.bind(r,60475)),Promise.resolve().then(r.bind(r,44954)),Promise.resolve().then(r.bind(r,91462)),Promise.resolve().then(r.bind(r,44188)),Promise.resolve().then(r.bind(r,69228)),Promise.resolve().then(r.bind(r,44154)),Promise.resolve().then(r.bind(r,55794)),Promise.resolve().then(r.bind(r,87712)),Promise.resolve().then(r.bind(r,36102)),Promise.resolve().then(r.t.bind(r,25554,23)),Promise.resolve().then(r.bind(r,56162))},7685:(e,t,r)=>{"use strict";r.d(t,{D:()=>o});var n=r(60200),a=r(48186),s=r(69351),i=r(26185);function o(e){let{entityType:t,entityUuid:r,subEntityType:i,subEntityUuid:o,children:d,badgeInside:c}=e,{getPresence:u}=(0,a.xQ)(),f=u(t,r,i,o),m=f.length>0,p=m&&f.some(e=>"mutate"===e.action),x=m?p?f.find(e=>"mutate"===e.action):f[f.length-1]:null,v=x?(0,s.j)(x.agentName):"transparent";return(0,n.jsxs)("div",{className:"relative",style:m?{outline:"2px ".concat(p?"solid":"dashed"," ").concat(v),outlineOffset:"-2px",borderRadius:"var(--radius)"}:void 0,children:[m&&(0,n.jsxs)("div",{className:"absolute flex gap-1 z-10 justify-end ".concat(c?"top-0.5 right-1.5 max-w-[70%]":"-top-2.5 right-2 max-w-[80%]"),children:[f.slice(0,3).map(e=>(0,n.jsx)(l,{entry:e},e.agentUuid)),f.length>3&&(0,n.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:["+",f.length-3]})]}),d]})}function l(e){let{entry:t}=e,r=(0,s.j)(t.agentName);return(0,n.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:r},children:[(0,n.jsx)(i.AgentAvatar,{name:t.agentName,size:14,className:"rounded-full"}),t.agentName]})}},16272:(e,t,r)=>{"use strict";r.d(t,{BT:()=>l,Wu:()=>d,ZB:()=>o,Zp:()=>s,aR:()=>i});var n=r(60200);r(81476);var a=r(49417);function s(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...r})}function i(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...r})}function o(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card-title",className:(0,a.cn)("leading-none font-semibold",t),...r})}function l(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card-description",className:(0,a.cn)("text-muted-foreground text-sm",t),...r})}function d(e){let{className:t,...r}=e;return(0,n.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",t),...r})}},26185:(e,t,r)=>{"use strict";r.d(t,{AgentAvatar:()=>x,Pf:()=>m});var n=r(60200),a=r(81476),s=r(81106),i=r(72677),o=r(63211),l=r(14518),d=r(62925),c=r(49417);let u=new i.O(l),f=new Map;function m(e,t){let r,n="".concat(t,"\0").concat(e),a=f.get(n);if(void 0!==a)return a;try{let n="animated"===t?{seed:e,tags:["animation"]}:{seed:e,tags:["!animation"]};r=new o.e(u,n).toDataUri()}catch(e){r=null}return f.set(n,r),r}let p={xs:20,sm:24,md:32,lg:40};function x(e){let{name:t,size:r="md",animate:i=!0,className:o}=e,[l,u]=a.useState(!1);a.useEffect(()=>{var e;if("function"!=typeof window.matchMedia)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)");u(t.matches);let r=e=>u(e.matches);return null==(e=t.addEventListener)||e.call(t,"change",r),()=>{var e;return null==(e=t.removeEventListener)?void 0:e.call(t,"change",r)}},[]);let f=i&&!l?"animated":"static",x=a.useMemo(()=>m(t,f),[t,f]),v="number"==typeof r?r:p[r],g=t.trim().charAt(0).toUpperCase();return(0,n.jsxs)(d.eu,{"data-slot":"agent-avatar","data-motion":f,className:(0,c.cn)("shrink-0 rounded-md bg-muted",o),style:{width:v,height:v},children:[x?(0,n.jsx)(d.BK,{src:x,alt:t,className:(0,c.cn)("rounded-md","origin-top scale-[1.5] -translate-y-[10%]"),draggable:!1}):null,(0,n.jsx)(d.q5,{className:"rounded-md","aria-label":t,children:g?(0,n.jsx)("span",{className:"text-[0.7em] font-medium",children:g}):(0,n.jsx)(s.A,{className:"size-1/2","aria-hidden":!0})})]})}},32022:(e,t,r)=>{"use strict";r.d(t,{r:()=>s});var n=r(41677),a=r(81476);function s(){let e=(0,n.r)({delay:120});return(0,a.useMemo)(()=>({...e,refresh:()=>e.refresh({showProgress:!1})}),[e])}},38060:(e,t,r)=>{"use strict";r.d(t,{S2:()=>c,eV:()=>d,l9:()=>l,tS:()=>o,w0:()=>u});var n=r(60200),a=r(81476);r(32022);var s=r(42790);let i=(0,a.createContext)(null);function o(e){let{projectUuid:t,children:r}=e,o=(0,s.jj)(),l=null==o?void 0:o.subscribe,d=null==o?void 0:o.openGeneration,c=(0,a.useRef)(new Set),u=(0,a.useRef)(new Set),f=(0,a.useRef)(new Set),m=(0,a.useRef)(new Set),p=(0,a.useCallback)(()=>{c.current.forEach(e=>e())},[]),x=(0,a.useCallback)(e=>{u.current.forEach(t=>t(e))},[]),v=(0,a.useCallback)(()=>{for(let e of(p(),["task","idea","proposal","document","project","project_group"]))x({companyUuid:"",projectUuid:"",entityType:e,entityUuid:"",action:"updated"})},[p,x]);(0,a.useEffect)(()=>{let e,r,n=null,a=!1,s=0,i={};function o(r){if("presence"===r.type){if(t&&r.projectUuid!==t)return;f.current.forEach(e=>e(r));return}if("execution"===r.type)return void m.current.forEach(e=>e(r));if("string"!=typeof r.entityType||"string"!=typeof r.entityUuid||"string"!=typeof r.action||t&&r.projectUuid!==t)return;clearTimeout(e);let n=Date.now(),a=n-s;a>=3e3?(s=n,p()):e=setTimeout(()=>{s=Date.now(),p()},Math.max(1e3,3e3-a));let o=r.entityType;clearTimeout(i[o]),i[o]=setTimeout(()=>{x(r)},300)}function d(){c(),(n=new EventSource(t?"/api/events?projectUuid=".concat(encodeURIComponent(t)):"/api/events")).onopen=()=>{a&&v(),a=!0},n.onmessage=e=>{let t=null;try{t=JSON.parse(e.data)}catch(e){return}t&&o(t)},n.onerror=()=>{}}function c(){n&&(n.close(),n=null)}function u(){"visible"===document.visibilityState&&(n&&n.readyState!==EventSource.CLOSED||d())}return l?r=l(o):(d(),document.addEventListener("visibilitychange",u)),()=>{for(let t in null==r||r(),c(),clearTimeout(e),i)clearTimeout(i[t]);document.removeEventListener("visibilitychange",u)}},[t,l,p,x,v]);let g=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(l&&d){if(null===g.current){g.current=d;return}d>g.current&&(g.current=d,v())}},[l,d,v]);let h=(0,a.useCallback)(e=>(c.current.add(e),()=>{c.current.delete(e)}),[]),b=(0,a.useCallback)(e=>(u.current.add(e),()=>{u.current.delete(e)}),[]),y=(0,a.useCallback)(e=>(f.current.add(e),()=>{f.current.delete(e)}),[]),j=(0,a.useCallback)(e=>(m.current.add(e),()=>{m.current.delete(e)}),[]),w=(0,a.useMemo)(()=>({subscribe:h,subscribeEntity:b,subscribePresence:y,subscribeExecution:j}),[h,b,y,j]);return(0,n.jsx)(i.Provider,{value:w,children:r})}function l(e){let t=(0,a.useContext)(i),r=(0,a.useRef)(e);r.current=e,(0,a.useEffect)(()=>{if(!t)return;let e=()=>r.current();return e(),t.subscribe(e)},[t])}function d(e,t){let r=(0,a.useContext)(i),n=(0,a.useRef)(t);n.current=t;let s=(0,a.useRef)(e);s.current=e,(0,a.useEffect)(()=>{if(r)return r.subscribeEntity(e=>{let t=s.current;(Array.isArray(t)?t.includes(e.entityType):e.entityType===t)&&n.current(e)})},[r])}function c(e){let t=(0,a.useContext)(i),r=(0,a.useRef)(e);r.current=e,(0,a.useEffect)(()=>{if(t)return t.subscribePresence(e=>r.current(e))},[t])}function u(e,t,r){let n=(0,a.useContext)(i),s=(0,a.useRef)(r);s.current=r,(0,a.useEffect)(()=>{if(n)return n.subscribeEntity(r=>{r.entityType===e&&r.entityUuid===t&&s.current(r)})},[n,e,t])}},42790:(e,t,r)=>{"use strict";r.d(t,{D1:()=>l,Qb:()=>o,a7:()=>s,jj:()=>d});var n=r(60200),a=r(81476);let s="stream_reset",i=(0,a.createContext)(null);function o(e){let{children:t}=e,r=(0,a.useRef)(new Set),[o,l]=(0,a.useState)(0),[d,c]=(0,a.useState)(null),u=(0,a.useCallback)(e=>(r.current.add(e),()=>{r.current.delete(e)}),[]);(0,a.useEffect)(()=>{let e=null,t=()=>{e&&(e.close(),e=null)},n=()=>{t(),(e=new EventSource(!d?"/api/events":"/api/events?sessionUuid=".concat(encodeURIComponent(d)))).onopen=()=>{for(let e of(l(e=>e+1),r.current))e({type:s})},e.onmessage=e=>{let t;try{t=JSON.parse(e.data)}catch(e){return}for(let e of r.current)e(t)},e.onerror=()=>{}},a=()=>{"visible"===document.visibilityState&&(null==e||e.readyState!==EventSource.OPEN)&&n()};return n(),document.addEventListener("visibilitychange",a),()=>{t(),document.removeEventListener("visibilitychange",a)}},[d]),(0,a.useEffect)(()=>()=>{r.current.clear()},[]);let f=(0,a.useMemo)(()=>({subscribe:u,openGeneration:o,sessionUuid:d,setSessionUuid:c}),[u,o,d]);return(0,n.jsx)(i.Provider,{value:f,children:t})}function l(){let e=(0,a.useContext)(i);if(!e)throw Error("useDashboardEvents must be used within DashboardEventProvider");return e}function d(){return(0,a.useContext)(i)}},48186:(e,t,r)=>{"use strict";r.d(t,{fv:()=>x,xQ:()=>v});var n=r(81476),a=r(38060);let s=new Map,i=new Map,o=new Map,l=new Set,d=0;function c(e,t,r,n){return r?n?"".concat(e,":").concat(t,":").concat(r,":").concat(n):"".concat(e,":").concat(t,":").concat(r):"".concat(e,":").concat(t)}function u(){d++,l.forEach(e=>e())}function f(e){var t;let r=e.subEntityType,n=e.subEntityUuid,a=c(e.entityType,e.entityUuid,r,n),l=function(e,t,r,n,a){let s=c(e,t,n,a);return"".concat(s,":").concat(r)}(e.entityType,e.entityUuid,e.agentUuid,r,n),d=i.get(l);if(d&&Date.now()-d<3e3)return;i.set(l,Date.now());let f={agentUuid:e.agentUuid,agentName:e.agentName,action:e.action,timestamp:Date.now()},m=(null!=(t=s.get(a))?t:[]).filter(t=>t.agentUuid!==e.agentUuid);m.push(f),s.set(a,m);let p=o.get(l);p&&clearTimeout(p);let x=setTimeout(()=>{let t=s.get(a);if(t){let r=t.filter(t=>t.agentUuid!==e.agentUuid);0===r.length?s.delete(a):s.set(a,r)}i.delete(l),o.delete(l),u()},3e3);o.set(l,x),u()}function m(){return d}function p(e){return l.add(e),()=>{l.delete(e)}}function x(e){f({type:"presence",companyUuid:"",projectUuid:"",...e,timestamp:Date.now()})}function v(){return(0,n.useSyncExternalStore)(p,m,m),(0,a.S2)(f),{getPresence:(e,t,r,n)=>{if(r){var a;return null!=(a=s.get(c(e,t,r,n)))?a:[]}let i="".concat(e,":").concat(t),o=new Map;for(let[e,t]of s)if(e===i||e.startsWith(i+":"))for(let e of t){let t=o.get(e.agentUuid);(!t||e.timestamp>t.timestamp)&&o.set(e.agentUuid,e)}return[...o.values()]}}}},49417:(e,t,r)=>{"use strict";r.d(t,{cn:()=>s});var n=r(71019),a=r(2105);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.QP)((0,n.$)(t))}},56162:(e,t,r)=>{"use strict";r.d(t,{ProposalKanban:()=>N});var n=r(60200),a=r(81476),s=r(25554),i=r.n(s),o=r(25588),l=r(16272),d=r(75507),c=r(43322),u=r(26185),f=r(64035),m=r(38060),p=r(88749),x=r(7685),v=r(25452),g=r(42885);let h=(0,g.createServerReference)("40a7db3bf301d10d36aff76ae12437445edb8879ca",g.callServer,void 0,g.findSourceMapURL,"fetchProposalsAction"),b=[{id:"draft",labelKey:"status.draft",statuses:["draft"]},{id:"pending",labelKey:"status.pendingReview",statuses:["pending"]},{id:"completed",labelKey:"proposals.completed",statuses:["approved","closed"]}],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-[#2E7D32] dark:text-[#5FD07E]",closed:"bg-[#F5F5F5] dark:bg-[#1e1e20] text-[#9A9A9A]"},j={draft:"draft",pending:"pendingReview",approved:"approved",closed:"closed"},w=[{id:"all",labelKey:"proposals.all",statuses:[]},...b];function E(e){let{proposal:t,projectUuid:r,t:a}=e,s=function(e){var t,r;let n=(null==(t=e.documentDrafts)?void 0:t.length)||0,a=(null==(r=e.taskDrafts)?void 0:r.length)||0;return n>0&&a>0?"proposals.typeDocumentAndTasks":n>0?1===n?"proposals.typeNewDocument":"proposals.typeDocumentUpdate":a>0?"proposals.typeTaskBreakdown":null}(t);return(0,n.jsx)(i(),{href:"/projects/".concat(r,"/proposals/").concat(t.uuid),className:"block",children:(0,n.jsx)(x.D,{entityType:"proposal",entityUuid:t.uuid,children:(0,n.jsxs)(l.Zp,{className:"cursor-pointer border-border bg-card p-4 transition-all hover:border-primary hover:shadow-sm",children:[(0,n.jsxs)("div",{className:"mb-2 flex items-start justify-between",children:[(0,n.jsx)(d.E,{className:y[t.status]||y.draft,children:a("status.".concat(j[t.status]||t.status))}),s&&(0,n.jsx)("span",{className:"rounded bg-[#FFF3E0] dark:bg-[#3a2a12] px-2 py-0.5 text-xs font-medium text-[#E65100] dark:text-[#F0A050]",children:a(s)})]}),(0,n.jsx)("h4",{className:"mb-1 font-medium text-foreground",children:t.title}),t.description&&(0,n.jsx)("div",{className:"prose prose-sm max-w-none mb-2 line-clamp-2 text-sm text-muted-foreground",children:(0,n.jsx)(f.MarkdownContent,{children:t.description})}),(0,n.jsx)("div",{className:"flex items-center justify-between text-xs text-[#9A9A9A]",children:t.createdBy&&(0,n.jsxs)("span",{className:"flex items-center gap-1",children:["agent"===t.createdByType?(0,n.jsx)(u.AgentAvatar,{name:t.createdBy.name,size:16,className:"rounded-full"}):(0,n.jsx)(c.A,{className:"h-3 w-3"}),t.createdBy.name]})})]})})})}function N(e){let{projectUuid:t,proposals:r}=e,s=(0,o.c)(),i=(0,p.a)(),[l,d]=(0,a.useState)("all"),[c,u]=(0,a.useState)(r);(0,a.useEffect)(()=>{u(r)},[r]);let f=(0,a.useCallback)(async()=>{let e=await h(t);e.success&&u(e.data)},[t]);(0,m.eV)("proposal",f);let x=e=>c.filter(t=>e.includes(t.status));if(i){let e=w.find(e=>e.id===l)||w[0],r="all"===l?c:x(e.statuses);return(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-3 mb-4",children:w.map(e=>{let t="all"===e.id?c.length:x(e.statuses).length,r=l===e.id;return(0,n.jsxs)("button",{onClick:()=>d(e.id),className:"flex shrink-0 items-center gap-1.5 rounded-full px-3 py-1.5 text-sm font-medium transition-colors ".concat(r?"bg-primary text-white":"bg-secondary text-muted-foreground hover:bg-[#EDE9E1] dark:hover:bg-[#2a2a2e]"),children:[s(e.labelKey),(0,n.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-xs ".concat(r?"bg-card/20 text-white":"bg-card text-muted-foreground"),children:t})]},e.id)})}),(0,n.jsx)("div",{className:"flex-1 space-y-3",children:0===r.length?(0,n.jsx)(v.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:s("proposals.noProposals")}):r.map(e=>(0,n.jsx)(E,{proposal:e,projectUuid:t,t:s},e.uuid))})]})}return(0,n.jsx)("div",{className:"flex flex-1 gap-4 overflow-x-auto pb-4",children:b.map(e=>{let r=x(e.statuses);return(0,n.jsxs)("div",{className:"flex w-[300px] flex-shrink-0 flex-col rounded-xl bg-secondary p-4",children:[(0,n.jsx)("div",{className:"mb-4 flex items-center justify-between",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("h3",{className:"font-medium text-foreground",children:s(e.labelKey)}),(0,n.jsx)("span",{className:"rounded-full bg-card px-2 py-0.5 text-xs font-medium text-muted-foreground",children:r.length})]})}),(0,n.jsx)("div",{className:"flex-1 space-y-4 overflow-y-auto pt-3",children:0===r.length?(0,n.jsx)(v.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:s("proposals.noProposals")}):r.map(e=>(0,n.jsx)(E,{proposal:e,projectUuid:t,t:s},e.uuid))})]},e.id)})})}},58851:(e,t,r)=>{"use strict";r.d(t,{Bc:()=>i,ZI:()=>d,k$:()=>l,m_:()=>o});var n=r(60200);r(81476);var a=r(36102),s=r(49417);function i(e){let{delayDuration:t=0,...r}=e;return(0,n.jsx)(a.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function o(e){let{...t}=e;return(0,n.jsx)(a.Root,{"data-slot":"tooltip",...t})}function l(e){let{...t}=e;return(0,n.jsx)(a.Trigger,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:r=0,children:i,...o}=e;return(0,n.jsx)(a.Portal,{children:(0,n.jsxs)(a.Content,{"data-slot":"tooltip-content",sideOffset:r,className:(0,s.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...o,children:[i,(0,n.jsx)(a.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},62925:(e,t,r)=>{"use strict";r.d(t,{BK:()=>o,eu:()=>i,q5:()=>l});var n=r(60200);r(81476);var a=r(5751),s=r(49417);function i(e){let{className:t,size:r="default",...i}=e;return(0,n.jsx)(a.Root,{"data-slot":"avatar","data-size":r,className:(0,s.cn)("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...i})}function o(e){let{className:t,...r}=e;return(0,n.jsx)(a.Image,{"data-slot":"avatar-image",className:(0,s.cn)("aspect-square size-full",t),...r})}function l(e){let{className:t,...r}=e;return(0,n.jsx)(a.Fallback,{"data-slot":"avatar-fallback",className:(0,s.cn)("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...r})}},69351:(e,t,r)=>{"use strict";r.d(t,{j:()=>a});let n=["#E06C75","#E5C07B","#98C379","#56B6C2","#61AFEF","#C678DD","#D19A66","#BE5046","#7EC8E3","#C3E88D","#F78C6C","#A9DC76"];function a(e){let t=function(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0;return Math.abs(t)}(e)%n.length;return n[t]}},75507:(e,t,r)=>{"use strict";r.d(t,{E:()=>l});var n=r(60200);r(81476);var a=r(53859),s=r(45911),i=r(49417);let o=(0,a.F)("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:r="default",asChild:a=!1,...l}=e,d=a?s.bL:"span";return(0,n.jsx)(d,{"data-slot":"badge","data-variant":r,className:(0,i.cn)(o({variant:r}),t),...l})}},88749:(e,t,r)=>{"use strict";r.d(t,{a:()=>a});var n=r(81476);function a(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=window.matchMedia("(max-width: 767px)");t(e.matches);let r=e=>t(e.matches);return e.addEventListener("change",r),()=>e.removeEventListener("change",r)},[]),e}}},e=>{e.O(0,[87326,93151,41752,71444,92037,41677,25554,6893,74414,7659,76404,25452,33218,10201,38803,23593,10006,26441,73632,63472,8575,21495,78909,64035,73849,46608,77358],()=>e(e.s=672)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6725],{},_=>{_.O(0,[32271,87326,93151,41752,30996,57084,68381,84558,71444,92037,41677,25554,6893,74414,34216,7659,76404,25452,33218,10201,38803,23593,10006,26441,73632,63472,65208,8575,5899,86791,80395,58558,75556,16198,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6725],{},_=>{_.O(0,[32271,87326,93151,41752,30996,57084,68381,84558,71444,92037,41677,25554,6893,74414,34216,7659,76404,25452,33218,10201,38803,23593,10006,26441,73632,63472,65208,8575,5899,86791,80395,58558,75556,16198,75844,15638,59480,30187,73849,46608,77358],()=>_(_.s=30187)),_N_E=_.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87674],{},_=>{_.O(0,[32271,87326,93151,41752,30996,57084,68381,84558,71444,92037,41677,25554,6893,74414,34216,7659,76404,25452,33218,10201,38803,23593,10006,26441,73632,63472,65208,8575,5899,86791,80395,58558,75556,16198,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87674],{},_=>{_.O(0,[32271,87326,93151,41752,30996,57084,68381,84558,71444,92037,41677,25554,6893,74414,34216,7659,76404,25452,33218,10201,38803,23593,10006,26441,73632,63472,65208,8575,5899,86791,80395,58558,75556,16198,75844,15638,59480,30187,73849,46608,77358],()=>_(_.s=30187)),_N_E=_.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51670],{2745:(e,t,a)=>{"use strict";a.d(t,{$v:()=>f,EO:()=>u,Lt:()=>o,Rx:()=>p,Zr:()=>v,ck:()=>g,r7:()=>x,tv:()=>l,wd:()=>m});var s=a(60200);a(81476);var r=a(25986),n=a(49417),i=a(40058);function o(e){let{...t}=e;return(0,s.jsx)(r.Root,{"data-slot":"alert-dialog",...t})}function l(e){let{...t}=e;return(0,s.jsx)(r.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function d(e){let{...t}=e;return(0,s.jsx)(r.Portal,{"data-slot":"alert-dialog-portal",...t})}function c(e){let{className:t,...a}=e;return(0,s.jsx)(r.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,overlayClassName:a,size:i="default",...o}=e;return(0,s.jsxs)(d,{children:[(0,s.jsx)(c,{className:a}),(0,s.jsx)(r.Content,{"data-slot":"alert-dialog-content","data-size":i,className:(0,n.cn)("bg-background 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 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",t),...o})]})}function m(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,n.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function g(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(r.Title,{"data-slot":"alert-dialog-title",className:(0,n.cn)("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(r.Description,{"data-slot":"alert-dialog-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...a})}function p(e){let{className:t,variant:a="default",size:o="default",...l}=e;return(0,s.jsx)(i.$,{variant:a,size:o,asChild:!0,children:(0,s.jsx)(r.Action,{"data-slot":"alert-dialog-action",className:(0,n.cn)(t),...l})})}function v(e){let{className:t,variant:a="outline",size:o="default",...l}=e;return(0,s.jsx)(i.$,{variant:a,size:o,asChild:!0,children:(0,s.jsx)(r.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,n.cn)(t),...l})})}},3562:(e,t,a)=>{"use strict";function s(e){let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let a=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0");return"".concat(a,"-").concat(s,"-").concat(r," ").concat(n,":").concat(i)}function r(e,t){let a="string"==typeof e?new Date(e):e;return isNaN(a.getTime())?"":a.toLocaleDateString(t,{month:"short",day:"numeric"})}a.d(t,{r:()=>s,s:()=>r})},16272:(e,t,a)=>{"use strict";a.d(t,{BT:()=>l,Wu:()=>d,ZB:()=>o,Zp:()=>n,aR:()=>i});var s=a(60200);a(81476);var r=a(49417);function n(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function i(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",t),...a})}},16852:(e,t,a)=>{"use strict";a.d(t,{T:()=>n});var s=a(60200);a(81476);var r=a(49417);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("mobile-input-text","border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},19253:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>Z});var s=a(60200),r=a(81476),n=a(25588),i=a(40058),o=a(2745),l=a(25866),d=a(78837),c=a(26657),u=a(51128),m=a(91560),g=a(50759),x=a(82167),f=a(72336),p=a(91448),v=a(5535),h=a(25554),b=a.n(h),j=a(73190),y=a(26185),w=a(68433),N=a(81408),k=a(75507),z=a(48933),A=a(42885);let S=(0,A.createServerReference)("00d6e56c193ce9cd088791040d1c0aa8a39f70b8df",A.callServer,void 0,A.findSourceMapURL,"getApiKeysAction"),C=(0,A.createServerReference)("4003194df0a954bc2d10402cd120eea5ef4a7e87db",A.callServer,void 0,A.findSourceMapURL,"deleteApiKeyAction"),_=(0,A.createServerReference)("4030a21d7d53b433d4beeef8c5c33bce643ac75b4a",A.callServer,void 0,A.findSourceMapURL,"getAgentSessionsAction"),R=(0,A.createServerReference)("40b855a1d5dd4917b390ea73867f931c42b49a8288",A.callServer,void 0,A.findSourceMapURL,"closeSessionAction"),K=(0,A.createServerReference)("405fa9f0930093ff0e96d497703c2f2cf3e996b04c",A.callServer,void 0,A.findSourceMapURL,"reopenSessionAction"),U=(0,A.createServerReference)("40da0e36f6c639450a596b06703719b0a567da42de",A.callServer,void 0,A.findSourceMapURL,"updateAgentAction");var E=a(2580),L=a(76031),T=a(16272),I=a(50402),P=a(45200),$=a(43664);let q={taskAssigned:!0,taskStatusChanged:!0,taskVerified:!0,taskReopened:!0,proposalSubmitted:!0,proposalApproved:!0,proposalRejected:!0,ideaClaimed:!0,commentAdded:!0,elaborationRequested:!0,elaborationAnswered:!0,mentioned:!0},D=[{labelKey:"taskEvents",items:[{key:"taskAssigned",labelKey:"taskAssigned"},{key:"taskStatusChanged",labelKey:"taskStatusChanged"},{key:"taskVerified",labelKey:"taskVerified"},{key:"taskReopened",labelKey:"taskReopened"}]},{labelKey:"proposalEvents",items:[{key:"proposalSubmitted",labelKey:"proposalSubmitted"},{key:"proposalApproved",labelKey:"proposalApproved"},{key:"proposalRejected",labelKey:"proposalRejected"}]},{labelKey:"ideaEvents",items:[{key:"ideaClaimed",labelKey:"ideaClaimed"}]},{labelKey:"elaborationEvents",items:[{key:"elaborationRequested",labelKey:"elaborationRequested"},{key:"elaborationAnswered",labelKey:"elaborationAnswered"}]},{labelKey:"commentEvents",items:[{key:"commentAdded",labelKey:"commentAdded"}]},{labelKey:"mentionEvents",items:[{key:"mentioned",labelKey:"mentioned"}]}];function B(){let e=(0,n.c)("notifications.preferences"),[t,a]=(0,r.useState)(q),[i,o]=(0,r.useState)(!0),l=(0,r.useRef)(null);(0,r.useEffect)(()=>{!async function(){try{let e=await fetch("/api/notifications/preferences");if(e.ok){let t=await e.json();if(t.success&&t.data){let{taskAssigned:e,taskStatusChanged:s,taskVerified:r,taskReopened:n,proposalSubmitted:i,proposalApproved:o,proposalRejected:l,ideaClaimed:d,commentAdded:c,elaborationRequested:u,elaborationAnswered:m,mentioned:g}=t.data;a({taskAssigned:e,taskStatusChanged:s,taskVerified:r,taskReopened:n,proposalSubmitted:i,proposalApproved:o,proposalRejected:l,ideaClaimed:d,commentAdded:c,elaborationRequested:null==u||u,elaborationAnswered:null==m||m,mentioned:null==g||g})}}}catch(e){$.q.error("Failed to fetch notification preferences:",e)}finally{o(!1)}}()},[]);let d=(0,r.useCallback)(e=>{l.current&&clearTimeout(l.current),l.current=setTimeout(async()=>{try{await fetch("/api/notifications/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){$.q.error("Failed to save notification preferences:",e)}},500)},[]);return i?null:(0,s.jsx)("div",{className:"space-y-6",children:D.map(r=>(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-foreground",children:e(r.labelKey)}),(0,s.jsx)("div",{className:"space-y-3",children:r.items.map(r=>(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(P.J,{htmlFor:r.key,className:"text-sm text-muted-foreground cursor-pointer",children:e(r.labelKey)}),(0,s.jsx)(I.d,{id:r.key,checked:t[r.key],onCheckedChange:e=>((e,s)=>{let r={...t,[e]:s};a(r),d(r)})(r.key,e)})]},r.key))})]},r.labelKey))})}var F=a(3562),M=a(35191);let O=new Set(a(72450).lp);function Z(){let e=(0,n.c)(),{locale:t,setLocale:a}=(0,z.Y)(),[h,A]=(0,r.useState)([]),[I,P]=(0,r.useState)(!0),[q,D]=(0,r.useState)(!1),[Z,V]=(0,r.useState)(!1),[G,W]=(0,r.useState)(null),[Y,J]=(0,r.useState)({}),[H,Q]=(0,r.useState)({}),[X,ee]=(0,r.useState)({}),[et,ea]=(0,r.useState)(!1),[es,er]=(0,r.useState)(null),[en,ei]=(0,r.useState)(""),[eo,el]=(0,r.useState)("custom"),[ed,ec]=(0,r.useState)([]),[eu,em]=(0,r.useState)(""),[eg,ex]=(0,r.useState)(!1);(0,r.useEffect)(()=>{ef()},[]);let ef=async()=>{try{let e=await S();e.success&&e.data&&A(e.data)}catch(e){$.q.error("Failed to fetch API keys:",e)}finally{P(!1)}},ep=async()=>{if(G)try{let e=await C(G);e.success?A(h.filter(e=>e.uuid!==G)):$.q.error("Failed to delete API key:",e.error)}catch(e){$.q.error("Failed to delete API key:",e)}finally{V(!1),W(null)}},ev=async e=>{let t=Y[e];if(J(a=>({...a,[e]:!t})),!t&&!H[e]){ee(t=>({...t,[e]:!0}));let t=await _(e);t.success&&t.data&&Q(a=>({...a,[e]:t.data})),ee(t=>({...t,[e]:!1}))}},eh=async(e,t)=>{(await R(e)).success&&Q(a=>({...a,[t]:(a[t]||[]).map(t=>t.uuid===e?{...t,status:"closed"}:t)}))},eb=async(e,t)=>{(await K(e)).success&&Q(a=>({...a,[t]:(a[t]||[]).map(t=>t.uuid===e?{...t,status:"active",lastActiveAt:new Date().toISOString()}:t)}))},ej=()=>{ea(!1),er(null),ei(""),el("custom"),ec([]),em("")},ey=async e=>{if(e.preventDefault(),!es||!en)return;let t="custom"===eo?[]:[eo],a="custom"===eo?ed:[];ex(!0);try{let e=await U({agentUuid:es.agentUuid,name:en,roles:t,permissions:a,persona:eu||null});if(e.success){let e=Array.from(function(e,t){let a=new Set;if(e)for(let t of e){let e=t.endsWith("_agent")?t:"".concat(t,"_agent"),s=M.o[e];if(s)for(let e of s)a.add(e)}if(t)for(let e of t)O.has(e)&&a.add(e);return a}(t,a));A(s=>s.map(s=>s.agentUuid===es.agentUuid?{...s,name:en,roles:t,permissions:a,effectivePermissions:e,persona:eu||null}:s)),ej()}else $.q.error("Failed to update agent:",e.error)}catch(e){$.q.error("Failed to update agent:",e)}finally{ex(!1)}};return I?(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("div",{className:"text-muted-foreground",children:e("common.loading")})}):(0,s.jsxs)("div",{className:"p-4 md:p-8",children:[(0,s.jsx)("div",{className:"mb-6 text-xs text-[#9A9A9A]",children:e("settings.breadcrumb")}),(0,s.jsxs)("div",{className:"mb-8 flex flex-wrap items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:e("settings.title")}),(0,s.jsx)("p",{className:"mt-1 text-[13px] text-muted-foreground",children:e("settings.subtitle")})]}),(0,s.jsx)(w.m,{variant:"inline"})]}),(0,s.jsxs)("div",{className:"mb-8 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"h-5 w-5 text-muted-foreground"}),(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e("settings.language")})]}),(0,s.jsx)("p",{className:"text-[13px] text-muted-foreground",children:e("settings.languageDesc")}),(0,s.jsx)("div",{className:"flex gap-3",children:L.IB.map(e=>(0,s.jsx)(i.$,{variant:t===e?"default":"outline",size:"sm",onClick:()=>a(e),className:"min-w-[100px]",children:L.L$[e]},e))})]}),(0,s.jsxs)(T.Zp,{className:"mb-8",children:[(0,s.jsxs)(T.aR,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.A,{className:"h-5 w-5 text-muted-foreground"}),(0,s.jsx)(T.ZB,{children:e("settings.setupGuide")})]}),(0,s.jsx)(T.BT,{children:e("settings.setupGuideDesc")})]}),(0,s.jsx)(T.Wu,{children:(0,s.jsx)(b(),{href:"/onboarding",children:(0,s.jsx)(i.$,{variant:"outline",children:e("settings.openSetupGuide")})})})]}),(0,s.jsx)("div",{className:"mb-8 border-t border-border"}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e("settings.agents")}),(0,s.jsxs)(i.$,{onClick:()=>D(!0),children:[(0,s.jsx)(c.A,{className:"mr-2 h-4 w-4"}),e("settings.createApiKey")]})]}),(0,s.jsx)("p",{className:"text-[13px] text-muted-foreground",children:e("settings.agentsDesc")}),0===h.length?(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-12 text-center",children:[(0,s.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-secondary",children:(0,s.jsx)(u.A,{className:"h-6 w-6 text-muted-foreground"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.noApiKeys")})]}):(0,s.jsx)("div",{className:"space-y-3",children:h.map(t=>{var a;return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[t.name?(0,s.jsx)(y.AgentAvatar,{name:t.name,size:36,className:"rounded-lg"}):(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg ".concat(t.roles.includes("developer_agent")?"bg-green-100":"bg-primary/10"),children:(0,s.jsx)(u.A,{className:"h-[18px] w-[18px] ".concat(t.roles.includes("developer_agent")?"text-green-600":"text-primary")})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground",children:t.name||t.keyPrefix+"..."}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:[t.keyPrefix,"... \xb7 ",e("settings.created")," ",(0,F.r)(t.createdAt)]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>(e=>{var t,a;let s=(t=e.roles,a=e.permissions,1===t.length&&t[0]in M.o&&0===a.length?t[0]:"custom"),r=e.effectivePermissions;er(e),ei(e.name||""),el(s),ec("custom"===s?r:[]),em(e.persona||""),ea(!0)})(t),children:[(0,s.jsx)(m.A,{className:"mr-1.5 h-3.5 w-3.5"}),e("settings.editAgent")]}),(0,s.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>{W(t.uuid),V(!0)},className:"text-destructive hover:text-destructive",children:e("common.delete")})]})]}),(0,s.jsxs)("div",{className:"mt-4 border-t border-border pt-3",children:[(0,s.jsxs)("button",{onClick:()=>ev(t.agentUuid),className:"flex w-full items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[Y[t.agentUuid]?(0,s.jsx)(g.A,{className:"h-3.5 w-3.5"}):(0,s.jsx)(x.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)(f.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:e("sessions.title")}),H[t.agentUuid]&&(0,s.jsx)(k.E,{variant:"secondary",className:"ml-1 h-4 px-1.5 text-[10px]",children:H[t.agentUuid].length})]}),Y[t.agentUuid]&&(0,s.jsx)("div",{className:"mt-2 space-y-2",children:X[t.agentUuid]?(0,s.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:e("common.loading")}):(null==(a=H[t.agentUuid])?void 0:a.length)?H[t.agentUuid].map(a=>(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg p-2.5 text-xs ".concat("closed"===a.status?"bg-muted/50 text-muted-foreground":"bg-secondary"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("div",{className:"h-2 w-2 rounded-full flex-shrink-0 ".concat("active"===a.status?"bg-green-500":"bg-gray-400")}),(0,s.jsx)("span",{className:"font-medium truncate",children:a.name}),(0,s.jsx)(k.E,{variant:"outline",className:"text-[10px] h-4 px-1 ".concat("active"===a.status?"border-green-300 text-green-700":"border-gray-300 text-gray-500"),children:e("sessions.status".concat(a.status.charAt(0).toUpperCase()+a.status.slice(1)))}),(0,s.jsx)("span",{className:"text-muted-foreground",children:e("sessions.checkins",{count:a.checkins.length})})]}),"closed"===a.status?(0,s.jsx)(i.$,{variant:"ghost",size:"sm",className:"h-6 px-2 text-[10px] text-green-600 hover:text-green-700",onClick:()=>eb(a.uuid,t.agentUuid),children:e("sessions.reopen")}):(0,s.jsx)(i.$,{variant:"ghost",size:"sm",className:"h-6 px-2 text-[10px] text-destructive hover:text-destructive",onClick:()=>eh(a.uuid,t.agentUuid),children:e("sessions.close")})]},a.uuid)):(0,s.jsx)("div",{className:"text-xs text-muted-foreground py-2 italic",children:e("sessions.noSessions")})})]})]},t.uuid)})})]}),(0,s.jsx)("div",{className:"mb-8 border-t border-border"}),(0,s.jsxs)(T.Zp,{children:[(0,s.jsxs)(T.aR,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.A,{className:"h-5 w-5 text-muted-foreground"}),(0,s.jsx)(T.ZB,{children:e("notifications.preferences.title")})]}),(0,s.jsx)(T.BT,{children:e("notifications.preferences.description")})]}),(0,s.jsx)(T.Wu,{children:(0,s.jsx)(B,{})})]}),q&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/25",children:(0,s.jsx)("div",{className:"max-h-[90vh] w-full max-w-2xl overflow-y-auto rounded-2xl bg-card shadow-xl",children:(0,s.jsx)(j.Y,{createAgentAndKey:E.I,onAgentCreated:()=>{ef()},onClose:()=>{D(!1)}})})}),et&&es&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/25",children:(0,s.jsx)("div",{className:"max-h-[90vh] w-full max-w-[520px] overflow-y-auto rounded-2xl bg-card shadow-xl",children:(0,s.jsxs)("form",{onSubmit:ey,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-6 py-5",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:e("settings.editAgent")}),(0,s.jsx)(i.$,{type:"button",variant:"ghost",size:"icon",onClick:ej,className:"h-8 w-8",children:(0,s.jsx)(v.A,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{className:"p-6",children:(0,s.jsx)(N.L,{name:en,onNameChange:ei,preset:eo,permissions:ed,onPermissionsChange:e=>{el(e.preset),ec(e.permissions)},persona:eu,onPersonaChange:em,nameInputId:"editName",personaInputId:"edit-agent-persona"})}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 border-t border-border px-6 py-4",children:[(0,s.jsx)(i.$,{type:"button",variant:"outline",onClick:ej,children:e("common.cancel")}),(0,s.jsx)(i.$,{type:"submit",disabled:!en||"custom"===eo&&0===ed.length||eg,children:eg?e("settings.saving"):e("settings.saveChanges")})]})]})})}),(0,s.jsx)(o.Lt,{open:Z,onOpenChange:V,children:(0,s.jsxs)(o.EO,{children:[(0,s.jsxs)(o.wd,{children:[(0,s.jsx)(o.r7,{children:e("settings.confirmDeleteTitle")}),(0,s.jsx)(o.$v,{children:e("settings.confirmDeleteDesc")})]}),(0,s.jsxs)(o.ck,{children:[(0,s.jsx)(o.Zr,{children:e("common.cancel")}),(0,s.jsx)(o.Rx,{onClick:ep,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:e("common.delete")})]})]})})]})}},21558:(e,t,a)=>{"use strict";a.d(t,{bq:()=>u,eb:()=>g,gC:()=>m,l6:()=>d,yv:()=>c});var s=a(60200);a(81476);var r=a(50759),n=a(71507),i=a(29438),o=a(60475),l=a(49417);function d(e){let{...t}=e;return(0,s.jsx)(o.Root,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,s.jsx)(o.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...i}=e;return(0,s.jsxs)(o.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,l.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[n,(0,s.jsx)(o.Icon,{asChild:!0,children:(0,s.jsx)(r.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:a,position:r="item-aligned",align:n="center",...i}=e;return(0,s.jsx)(o.Portal,{children:(0,s.jsxs)(o.Content,{"data-slot":"select-content",className:(0,l.cn)("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...i,children:[(0,s.jsx)(x,{}),(0,s.jsx)(o.Viewport,{className:(0,l.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(f,{})]})})}function g(e){let{className:t,children:a,...r}=e;return(0,s.jsxs)(o.Item,{"data-slot":"select-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,s.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(o.ItemIndicator,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(o.ItemText,{children:a})]})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(o.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(i.A,{className:"size-4"})})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(o.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(r.A,{className:"size-4"})})}},26185:(e,t,a)=>{"use strict";a.d(t,{AgentAvatar:()=>f,Pf:()=>g});var s=a(60200),r=a(81476),n=a(81106),i=a(72677),o=a(63211),l=a(14518),d=a(62925),c=a(49417);let u=new i.O(l),m=new Map;function g(e,t){let a,s="".concat(t,"\0").concat(e),r=m.get(s);if(void 0!==r)return r;try{let s="animated"===t?{seed:e,tags:["animation"]}:{seed:e,tags:["!animation"]};a=new o.e(u,s).toDataUri()}catch(e){a=null}return m.set(s,a),a}let x={xs:20,sm:24,md:32,lg:40};function f(e){let{name:t,size:a="md",animate:i=!0,className:o}=e,[l,u]=r.useState(!1);r.useEffect(()=>{var e;if("function"!=typeof window.matchMedia)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)");u(t.matches);let a=e=>u(e.matches);return null==(e=t.addEventListener)||e.call(t,"change",a),()=>{var e;return null==(e=t.removeEventListener)?void 0:e.call(t,"change",a)}},[]);let m=i&&!l?"animated":"static",f=r.useMemo(()=>g(t,m),[t,m]),p="number"==typeof a?a:x[a],v=t.trim().charAt(0).toUpperCase();return(0,s.jsxs)(d.eu,{"data-slot":"agent-avatar","data-motion":m,className:(0,c.cn)("shrink-0 rounded-md bg-muted",o),style:{width:p,height:p},children:[f?(0,s.jsx)(d.BK,{src:f,alt:t,className:(0,c.cn)("rounded-md","origin-top scale-[1.5] -translate-y-[10%]"),draggable:!1}):null,(0,s.jsx)(d.q5,{className:"rounded-md","aria-label":t,children:v?(0,s.jsx)("span",{className:"text-[0.7em] font-medium",children:v}):(0,s.jsx)(n.A,{className:"size-1/2","aria-hidden":!0})})]})}},30474:(e,t,a)=>{"use strict";a.d(t,{p:()=>n});var s=a(60200);a(81476);var r=a(49417);function n(e){let{className:t,type:a,...n}=e;return(0,s.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("mobile-input-text","file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},40058:(e,t,a)=>{"use strict";a.d(t,{$:()=>l});var s=a(60200);a(81476);var r=a(53859),n=a(45911),i=a(49417);let o=(0,r.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:a="default",size:r="default",asChild:l=!1,...d}=e,c=l?n.bL:"button";return(0,s.jsx)(c,{"data-slot":"button","data-variant":a,"data-size":r,className:(0,i.cn)(o({variant:a,size:r,className:t})),...d})}},43664:(e,t,a)=>{"use strict";a.d(t,{q:()=>o});var s=a(55036);let r={debug:0,info:1,warn:2,error:3},n=s.env.NEXT_PUBLIC_LOG_LEVEL||"warn";function i(e){return r[e]>=r[n]}let o={debug:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("debug")&&console.debug("[Chorus] ".concat(e),...a)},info:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("info")&&console.info("[Chorus] ".concat(e),...a)},warn:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("warn")&&console.warn("[Chorus] ".concat(e),...a)},error:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("error")&&console.error("[Chorus] ".concat(e),...a)}}},49417:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var s=a(71019),r=a(2105);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.QP)((0,s.$)(t))}},50402:(e,t,a)=>{"use strict";a.d(t,{d:()=>i});var s=a(60200);a(81476);var r=a(91462),n=a(49417);function i(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"switch",className:(0,n.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:ring-ring/50 inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.Thumb,{"data-slot":"switch-thumb",className:(0,n.cn)("bg-background pointer-events-none block size-4 rounded-full ring-0 shadow-lg transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})}},58700:(e,t,a)=>{Promise.resolve().then(a.bind(a,19253))},58851:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>i,ZI:()=>d,k$:()=>l,m_:()=>o});var s=a(60200);a(81476);var r=a(36102),n=a(49417);function i(e){let{delayDuration:t=0,...a}=e;return(0,s.jsx)(r.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function o(e){let{...t}=e;return(0,s.jsx)(r.Root,{"data-slot":"tooltip",...t})}function l(e){let{...t}=e;return(0,s.jsx)(r.Trigger,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:a=0,children:i,...o}=e;return(0,s.jsx)(r.Portal,{children:(0,s.jsxs)(r.Content,{"data-slot":"tooltip-content",sideOffset:a,className:(0,n.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...o,children:[i,(0,s.jsx)(r.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},62925:(e,t,a)=>{"use strict";a.d(t,{BK:()=>o,eu:()=>i,q5:()=>l});var s=a(60200);a(81476);var r=a(5751),n=a(49417);function i(e){let{className:t,size:a="default",...i}=e;return(0,s.jsx)(r.Root,{"data-slot":"avatar","data-size":a,className:(0,n.cn)("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...i})}function o(e){let{className:t,...a}=e;return(0,s.jsx)(r.Image,{"data-slot":"avatar-image",className:(0,n.cn)("aspect-square size-full",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.Fallback,{"data-slot":"avatar-fallback",className:(0,n.cn)("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...a})}},70246:(e,t,a)=>{"use strict";a.d(t,{Ke:()=>l,Nt:()=>i,R6:()=>o});var s=a(60200),r=a(2236),n=a(49417);function i(e){let{...t}=e;return(0,s.jsx)(r.Root,{"data-slot":"collapsible",...t})}function o(e){let{...t}=e;return(0,s.jsx)(r.Trigger,{"data-slot":"collapsible-trigger",...t})}function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.Content,{"data-slot":"collapsible-content",className:(0,n.cn)("overflow-hidden data-[state=open]:animate-[collapsible-down_250ms_ease-in-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-in-out]",t),...a})}},75507:(e,t,a)=>{"use strict";a.d(t,{E:()=>l});var s=a(60200);a(81476);var r=a(53859),n=a(45911),i=a(49417);let o=(0,r.F)("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:a="default",asChild:r=!1,...l}=e,d=r?n.bL:"span";return(0,s.jsx)(d,{"data-slot":"badge","data-variant":a,className:(0,i.cn)(o({variant:a}),t),...l})}}},e=>{e.O(0,[87326,93151,41752,71444,92037,25554,6893,74414,7659,76404,33218,10201,38803,23593,10006,26441,73632,63472,58917,14891,64035,73849,46608,77358],()=>e(e.s=58700)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51670],{2745:(e,t,a)=>{"use strict";a.d(t,{$v:()=>f,EO:()=>u,Lt:()=>o,Rx:()=>p,Zr:()=>v,ck:()=>g,r7:()=>x,tv:()=>l,wd:()=>m});var s=a(60200);a(81476);var r=a(25986),n=a(49417),i=a(40058);function o(e){let{...t}=e;return(0,s.jsx)(r.Root,{"data-slot":"alert-dialog",...t})}function l(e){let{...t}=e;return(0,s.jsx)(r.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function d(e){let{...t}=e;return(0,s.jsx)(r.Portal,{"data-slot":"alert-dialog-portal",...t})}function c(e){let{className:t,...a}=e;return(0,s.jsx)(r.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,n.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function u(e){let{className:t,overlayClassName:a,size:i="default",...o}=e;return(0,s.jsxs)(d,{children:[(0,s.jsx)(c,{className:a}),(0,s.jsx)(r.Content,{"data-slot":"alert-dialog-content","data-size":i,className:(0,n.cn)("bg-background 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 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",t),...o})]})}function m(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,n.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function g(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,n.cn)("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(r.Title,{"data-slot":"alert-dialog-title",className:(0,n.cn)("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(r.Description,{"data-slot":"alert-dialog-description",className:(0,n.cn)("text-muted-foreground text-sm",t),...a})}function p(e){let{className:t,variant:a="default",size:o="default",...l}=e;return(0,s.jsx)(i.$,{variant:a,size:o,asChild:!0,children:(0,s.jsx)(r.Action,{"data-slot":"alert-dialog-action",className:(0,n.cn)(t),...l})})}function v(e){let{className:t,variant:a="outline",size:o="default",...l}=e;return(0,s.jsx)(i.$,{variant:a,size:o,asChild:!0,children:(0,s.jsx)(r.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,n.cn)(t),...l})})}},3562:(e,t,a)=>{"use strict";function s(e){let t="string"==typeof e?new Date(e):e;if(isNaN(t.getTime()))return"";let a=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0");return"".concat(a,"-").concat(s,"-").concat(r," ").concat(n,":").concat(i)}function r(e,t){let a="string"==typeof e?new Date(e):e;return isNaN(a.getTime())?"":a.toLocaleDateString(t,{month:"short",day:"numeric"})}a.d(t,{r:()=>s,s:()=>r})},16272:(e,t,a)=>{"use strict";a.d(t,{BT:()=>l,Wu:()=>d,ZB:()=>o,Zp:()=>n,aR:()=>i});var s=a(60200);a(81476);var r=a(49417);function n(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card",className:(0,r.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function i(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function o(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",t),...a})}function d(e){let{className:t,...a}=e;return(0,s.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",t),...a})}},16852:(e,t,a)=>{"use strict";a.d(t,{T:()=>n});var s=a(60200);a(81476);var r=a(49417);function n(e){let{className:t,...a}=e;return(0,s.jsx)("textarea",{"data-slot":"textarea",className:(0,r.cn)("mobile-input-text","border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}},21558:(e,t,a)=>{"use strict";a.d(t,{bq:()=>u,eb:()=>g,gC:()=>m,l6:()=>d,yv:()=>c});var s=a(60200);a(81476);var r=a(50759),n=a(71507),i=a(29438),o=a(60475),l=a(49417);function d(e){let{...t}=e;return(0,s.jsx)(o.Root,{"data-slot":"select",...t})}function c(e){let{...t}=e;return(0,s.jsx)(o.Value,{"data-slot":"select-value",...t})}function u(e){let{className:t,size:a="default",children:n,...i}=e;return(0,s.jsxs)(o.Trigger,{"data-slot":"select-trigger","data-size":a,className:(0,l.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[n,(0,s.jsx)(o.Icon,{asChild:!0,children:(0,s.jsx)(r.A,{className:"size-4 opacity-50"})})]})}function m(e){let{className:t,children:a,position:r="item-aligned",align:n="center",...i}=e;return(0,s.jsx)(o.Portal,{children:(0,s.jsxs)(o.Content,{"data-slot":"select-content",className:(0,l.cn)("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...i,children:[(0,s.jsx)(x,{}),(0,s.jsx)(o.Viewport,{className:(0,l.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(f,{})]})})}function g(e){let{className:t,children:a,...r}=e;return(0,s.jsxs)(o.Item,{"data-slot":"select-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,s.jsx)("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(o.ItemIndicator,{children:(0,s.jsx)(n.A,{className:"size-4"})})}),(0,s.jsx)(o.ItemText,{children:a})]})}function x(e){let{className:t,...a}=e;return(0,s.jsx)(o.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(i.A,{className:"size-4"})})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(o.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(r.A,{className:"size-4"})})}},26185:(e,t,a)=>{"use strict";a.d(t,{AgentAvatar:()=>f,Pf:()=>g});var s=a(60200),r=a(81476),n=a(81106),i=a(72677),o=a(63211),l=a(14518),d=a(62925),c=a(49417);let u=new i.O(l),m=new Map;function g(e,t){let a,s="".concat(t,"\0").concat(e),r=m.get(s);if(void 0!==r)return r;try{let s="animated"===t?{seed:e,tags:["animation"]}:{seed:e,tags:["!animation"]};a=new o.e(u,s).toDataUri()}catch(e){a=null}return m.set(s,a),a}let x={xs:20,sm:24,md:32,lg:40};function f(e){let{name:t,size:a="md",animate:i=!0,className:o}=e,[l,u]=r.useState(!1);r.useEffect(()=>{var e;if("function"!=typeof window.matchMedia)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)");u(t.matches);let a=e=>u(e.matches);return null==(e=t.addEventListener)||e.call(t,"change",a),()=>{var e;return null==(e=t.removeEventListener)?void 0:e.call(t,"change",a)}},[]);let m=i&&!l?"animated":"static",f=r.useMemo(()=>g(t,m),[t,m]),p="number"==typeof a?a:x[a],v=t.trim().charAt(0).toUpperCase();return(0,s.jsxs)(d.eu,{"data-slot":"agent-avatar","data-motion":m,className:(0,c.cn)("shrink-0 rounded-md bg-muted",o),style:{width:p,height:p},children:[f?(0,s.jsx)(d.BK,{src:f,alt:t,className:(0,c.cn)("rounded-md","origin-top scale-[1.5] -translate-y-[10%]"),draggable:!1}):null,(0,s.jsx)(d.q5,{className:"rounded-md","aria-label":t,children:v?(0,s.jsx)("span",{className:"text-[0.7em] font-medium",children:v}):(0,s.jsx)(n.A,{className:"size-1/2","aria-hidden":!0})})]})}},30474:(e,t,a)=>{"use strict";a.d(t,{p:()=>n});var s=a(60200);a(81476);var r=a(49417);function n(e){let{className:t,type:a,...n}=e;return(0,s.jsx)("input",{type:a,"data-slot":"input",className:(0,r.cn)("mobile-input-text","file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},40058:(e,t,a)=>{"use strict";a.d(t,{$:()=>l});var s=a(60200);a(81476);var r=a(53859),n=a(45911),i=a(49417);let o=(0,r.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:a="default",size:r="default",asChild:l=!1,...d}=e,c=l?n.bL:"button";return(0,s.jsx)(c,{"data-slot":"button","data-variant":a,"data-size":r,className:(0,i.cn)(o({variant:a,size:r,className:t})),...d})}},43664:(e,t,a)=>{"use strict";a.d(t,{q:()=>o});var s=a(55036);let r={debug:0,info:1,warn:2,error:3},n=s.env.NEXT_PUBLIC_LOG_LEVEL||"warn";function i(e){return r[e]>=r[n]}let o={debug:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("debug")&&console.debug("[Chorus] ".concat(e),...a)},info:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("info")&&console.info("[Chorus] ".concat(e),...a)},warn:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("warn")&&console.warn("[Chorus] ".concat(e),...a)},error:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),s=1;s<t;s++)a[s-1]=arguments[s];i("error")&&console.error("[Chorus] ".concat(e),...a)}}},49417:(e,t,a)=>{"use strict";a.d(t,{cn:()=>n});var s=a(71019),r=a(2105);function n(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,r.QP)((0,s.$)(t))}},50402:(e,t,a)=>{"use strict";a.d(t,{d:()=>i});var s=a(60200);a(81476);var r=a(91462),n=a(49417);function i(e){let{className:t,...a}=e;return(0,s.jsx)(r.Root,{"data-slot":"switch",className:(0,n.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:ring-ring/50 inline-flex h-5 w-9 shrink-0 items-center rounded-full border-2 border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:(0,s.jsx)(r.Thumb,{"data-slot":"switch-thumb",className:(0,n.cn)("bg-background pointer-events-none block size-4 rounded-full ring-0 shadow-lg transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})}},58700:(e,t,a)=>{Promise.resolve().then(a.bind(a,85098))},58851:(e,t,a)=>{"use strict";a.d(t,{Bc:()=>i,ZI:()=>d,k$:()=>l,m_:()=>o});var s=a(60200);a(81476);var r=a(36102),n=a(49417);function i(e){let{delayDuration:t=0,...a}=e;return(0,s.jsx)(r.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function o(e){let{...t}=e;return(0,s.jsx)(r.Root,{"data-slot":"tooltip",...t})}function l(e){let{...t}=e;return(0,s.jsx)(r.Trigger,{"data-slot":"tooltip-trigger",...t})}function d(e){let{className:t,sideOffset:a=0,children:i,...o}=e;return(0,s.jsx)(r.Portal,{children:(0,s.jsxs)(r.Content,{"data-slot":"tooltip-content",sideOffset:a,className:(0,n.cn)("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...o,children:[i,(0,s.jsx)(r.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},62925:(e,t,a)=>{"use strict";a.d(t,{BK:()=>o,eu:()=>i,q5:()=>l});var s=a(60200);a(81476);var r=a(5751),n=a(49417);function i(e){let{className:t,size:a="default",...i}=e;return(0,s.jsx)(r.Root,{"data-slot":"avatar","data-size":a,className:(0,n.cn)("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...i})}function o(e){let{className:t,...a}=e;return(0,s.jsx)(r.Image,{"data-slot":"avatar-image",className:(0,n.cn)("aspect-square size-full",t),...a})}function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.Fallback,{"data-slot":"avatar-fallback",className:(0,n.cn)("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...a})}},70246:(e,t,a)=>{"use strict";a.d(t,{Ke:()=>l,Nt:()=>i,R6:()=>o});var s=a(60200),r=a(2236),n=a(49417);function i(e){let{...t}=e;return(0,s.jsx)(r.Root,{"data-slot":"collapsible",...t})}function o(e){let{...t}=e;return(0,s.jsx)(r.Trigger,{"data-slot":"collapsible-trigger",...t})}function l(e){let{className:t,...a}=e;return(0,s.jsx)(r.Content,{"data-slot":"collapsible-content",className:(0,n.cn)("overflow-hidden data-[state=open]:animate-[collapsible-down_250ms_ease-in-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-in-out]",t),...a})}},75507:(e,t,a)=>{"use strict";a.d(t,{E:()=>l});var s=a(60200);a(81476);var r=a(53859),n=a(45911),i=a(49417);let o=(0,r.F)("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline",success:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100",warning:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-100"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:a="default",asChild:r=!1,...l}=e,d=r?n.bL:"span";return(0,s.jsx)(d,{"data-slot":"badge","data-variant":a,className:(0,i.cn)(o({variant:a}),t),...l})}},85098:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>Z});var s=a(60200),r=a(81476),n=a(25588),i=a(40058),o=a(2745),l=a(25866),d=a(78837),c=a(26657),u=a(51128),m=a(91560),g=a(50759),x=a(82167),f=a(72336),p=a(91448),v=a(5535),h=a(25554),b=a.n(h),j=a(73190),y=a(26185),w=a(68433),N=a(81408),k=a(75507),z=a(48933),A=a(42885);let S=(0,A.createServerReference)("00e31c20262b888f0918fd4a74124a869d7cdd8053",A.callServer,void 0,A.findSourceMapURL,"getApiKeysAction"),C=(0,A.createServerReference)("4025c220b053a45135ae42e6884065f2d0d7d083a6",A.callServer,void 0,A.findSourceMapURL,"deleteApiKeyAction"),_=(0,A.createServerReference)("40a30431cfe280f127d190c6bc0a93abea16eee62e",A.callServer,void 0,A.findSourceMapURL,"getAgentSessionsAction"),R=(0,A.createServerReference)("4019b28a9c4d9f54bdb13095b69930deb9781c05bb",A.callServer,void 0,A.findSourceMapURL,"closeSessionAction"),K=(0,A.createServerReference)("40080fce4b48c7fe4df82ce94ca71260d6bbcadf3e",A.callServer,void 0,A.findSourceMapURL,"reopenSessionAction"),U=(0,A.createServerReference)("402ebb493b72843359f2c3012d2ecd27a49a37134c",A.callServer,void 0,A.findSourceMapURL,"updateAgentAction");var E=a(48658),L=a(76031),T=a(16272),I=a(50402),P=a(45200),$=a(43664);let q={taskAssigned:!0,taskStatusChanged:!0,taskVerified:!0,taskReopened:!0,proposalSubmitted:!0,proposalApproved:!0,proposalRejected:!0,ideaClaimed:!0,commentAdded:!0,elaborationRequested:!0,elaborationAnswered:!0,mentioned:!0},D=[{labelKey:"taskEvents",items:[{key:"taskAssigned",labelKey:"taskAssigned"},{key:"taskStatusChanged",labelKey:"taskStatusChanged"},{key:"taskVerified",labelKey:"taskVerified"},{key:"taskReopened",labelKey:"taskReopened"}]},{labelKey:"proposalEvents",items:[{key:"proposalSubmitted",labelKey:"proposalSubmitted"},{key:"proposalApproved",labelKey:"proposalApproved"},{key:"proposalRejected",labelKey:"proposalRejected"}]},{labelKey:"ideaEvents",items:[{key:"ideaClaimed",labelKey:"ideaClaimed"}]},{labelKey:"elaborationEvents",items:[{key:"elaborationRequested",labelKey:"elaborationRequested"},{key:"elaborationAnswered",labelKey:"elaborationAnswered"}]},{labelKey:"commentEvents",items:[{key:"commentAdded",labelKey:"commentAdded"}]},{labelKey:"mentionEvents",items:[{key:"mentioned",labelKey:"mentioned"}]}];function B(){let e=(0,n.c)("notifications.preferences"),[t,a]=(0,r.useState)(q),[i,o]=(0,r.useState)(!0),l=(0,r.useRef)(null);(0,r.useEffect)(()=>{!async function(){try{let e=await fetch("/api/notifications/preferences");if(e.ok){let t=await e.json();if(t.success&&t.data){let{taskAssigned:e,taskStatusChanged:s,taskVerified:r,taskReopened:n,proposalSubmitted:i,proposalApproved:o,proposalRejected:l,ideaClaimed:d,commentAdded:c,elaborationRequested:u,elaborationAnswered:m,mentioned:g}=t.data;a({taskAssigned:e,taskStatusChanged:s,taskVerified:r,taskReopened:n,proposalSubmitted:i,proposalApproved:o,proposalRejected:l,ideaClaimed:d,commentAdded:c,elaborationRequested:null==u||u,elaborationAnswered:null==m||m,mentioned:null==g||g})}}}catch(e){$.q.error("Failed to fetch notification preferences:",e)}finally{o(!1)}}()},[]);let d=(0,r.useCallback)(e=>{l.current&&clearTimeout(l.current),l.current=setTimeout(async()=>{try{await fetch("/api/notifications/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){$.q.error("Failed to save notification preferences:",e)}},500)},[]);return i?null:(0,s.jsx)("div",{className:"space-y-6",children:D.map(r=>(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-foreground",children:e(r.labelKey)}),(0,s.jsx)("div",{className:"space-y-3",children:r.items.map(r=>(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)(P.J,{htmlFor:r.key,className:"text-sm text-muted-foreground cursor-pointer",children:e(r.labelKey)}),(0,s.jsx)(I.d,{id:r.key,checked:t[r.key],onCheckedChange:e=>((e,s)=>{let r={...t,[e]:s};a(r),d(r)})(r.key,e)})]},r.key))})]},r.labelKey))})}var F=a(3562),M=a(35191);let O=new Set(a(72450).lp);function Z(){let e=(0,n.c)(),{locale:t,setLocale:a}=(0,z.Y)(),[h,A]=(0,r.useState)([]),[I,P]=(0,r.useState)(!0),[q,D]=(0,r.useState)(!1),[Z,V]=(0,r.useState)(!1),[G,W]=(0,r.useState)(null),[Y,J]=(0,r.useState)({}),[H,Q]=(0,r.useState)({}),[X,ee]=(0,r.useState)({}),[et,ea]=(0,r.useState)(!1),[es,er]=(0,r.useState)(null),[en,ei]=(0,r.useState)(""),[eo,el]=(0,r.useState)("custom"),[ed,ec]=(0,r.useState)([]),[eu,em]=(0,r.useState)(""),[eg,ex]=(0,r.useState)(!1);(0,r.useEffect)(()=>{ef()},[]);let ef=async()=>{try{let e=await S();e.success&&e.data&&A(e.data)}catch(e){$.q.error("Failed to fetch API keys:",e)}finally{P(!1)}},ep=async()=>{if(G)try{let e=await C(G);e.success?A(h.filter(e=>e.uuid!==G)):$.q.error("Failed to delete API key:",e.error)}catch(e){$.q.error("Failed to delete API key:",e)}finally{V(!1),W(null)}},ev=async e=>{let t=Y[e];if(J(a=>({...a,[e]:!t})),!t&&!H[e]){ee(t=>({...t,[e]:!0}));let t=await _(e);t.success&&t.data&&Q(a=>({...a,[e]:t.data})),ee(t=>({...t,[e]:!1}))}},eh=async(e,t)=>{(await R(e)).success&&Q(a=>({...a,[t]:(a[t]||[]).map(t=>t.uuid===e?{...t,status:"closed"}:t)}))},eb=async(e,t)=>{(await K(e)).success&&Q(a=>({...a,[t]:(a[t]||[]).map(t=>t.uuid===e?{...t,status:"active",lastActiveAt:new Date().toISOString()}:t)}))},ej=()=>{ea(!1),er(null),ei(""),el("custom"),ec([]),em("")},ey=async e=>{if(e.preventDefault(),!es||!en)return;let t="custom"===eo?[]:[eo],a="custom"===eo?ed:[];ex(!0);try{let e=await U({agentUuid:es.agentUuid,name:en,roles:t,permissions:a,persona:eu||null});if(e.success){let e=Array.from(function(e,t){let a=new Set;if(e)for(let t of e){let e=t.endsWith("_agent")?t:"".concat(t,"_agent"),s=M.o[e];if(s)for(let e of s)a.add(e)}if(t)for(let e of t)O.has(e)&&a.add(e);return a}(t,a));A(s=>s.map(s=>s.agentUuid===es.agentUuid?{...s,name:en,roles:t,permissions:a,effectivePermissions:e,persona:eu||null}:s)),ej()}else $.q.error("Failed to update agent:",e.error)}catch(e){$.q.error("Failed to update agent:",e)}finally{ex(!1)}};return I?(0,s.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,s.jsx)("div",{className:"text-muted-foreground",children:e("common.loading")})}):(0,s.jsxs)("div",{className:"p-4 md:p-8",children:[(0,s.jsx)("div",{className:"mb-6 text-xs text-[#9A9A9A]",children:e("settings.breadcrumb")}),(0,s.jsxs)("div",{className:"mb-8 flex flex-wrap items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:e("settings.title")}),(0,s.jsx)("p",{className:"mt-1 text-[13px] text-muted-foreground",children:e("settings.subtitle")})]}),(0,s.jsx)(w.m,{variant:"inline"})]}),(0,s.jsxs)("div",{className:"mb-8 space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.A,{className:"h-5 w-5 text-muted-foreground"}),(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e("settings.language")})]}),(0,s.jsx)("p",{className:"text-[13px] text-muted-foreground",children:e("settings.languageDesc")}),(0,s.jsx)("div",{className:"flex gap-3",children:L.IB.map(e=>(0,s.jsx)(i.$,{variant:t===e?"default":"outline",size:"sm",onClick:()=>a(e),className:"min-w-[100px]",children:L.L$[e]},e))})]}),(0,s.jsxs)(T.Zp,{className:"mb-8",children:[(0,s.jsxs)(T.aR,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(d.A,{className:"h-5 w-5 text-muted-foreground"}),(0,s.jsx)(T.ZB,{children:e("settings.setupGuide")})]}),(0,s.jsx)(T.BT,{children:e("settings.setupGuideDesc")})]}),(0,s.jsx)(T.Wu,{children:(0,s.jsx)(b(),{href:"/onboarding",children:(0,s.jsx)(i.$,{variant:"outline",children:e("settings.openSetupGuide")})})})]}),(0,s.jsx)("div",{className:"mb-8 border-t border-border"}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e("settings.agents")}),(0,s.jsxs)(i.$,{onClick:()=>D(!0),children:[(0,s.jsx)(c.A,{className:"mr-2 h-4 w-4"}),e("settings.createApiKey")]})]}),(0,s.jsx)("p",{className:"text-[13px] text-muted-foreground",children:e("settings.agentsDesc")}),0===h.length?(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-12 text-center",children:[(0,s.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-secondary",children:(0,s.jsx)(u.A,{className:"h-6 w-6 text-muted-foreground"})}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:e("settings.noApiKeys")})]}):(0,s.jsx)("div",{className:"space-y-3",children:h.map(t=>{var a;return(0,s.jsxs)("div",{className:"rounded-xl border border-border bg-card p-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[t.name?(0,s.jsx)(y.AgentAvatar,{name:t.name,size:36,className:"rounded-lg"}):(0,s.jsx)("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg ".concat(t.roles.includes("developer_agent")?"bg-green-100":"bg-primary/10"),children:(0,s.jsx)(u.A,{className:"h-[18px] w-[18px] ".concat(t.roles.includes("developer_agent")?"text-green-600":"text-primary")})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-foreground",children:t.name||t.keyPrefix+"..."}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:[t.keyPrefix,"... \xb7 ",e("settings.created")," ",(0,F.r)(t.createdAt)]})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(i.$,{variant:"outline",size:"sm",onClick:()=>(e=>{var t,a;let s=(t=e.roles,a=e.permissions,1===t.length&&t[0]in M.o&&0===a.length?t[0]:"custom"),r=e.effectivePermissions;er(e),ei(e.name||""),el(s),ec("custom"===s?r:[]),em(e.persona||""),ea(!0)})(t),children:[(0,s.jsx)(m.A,{className:"mr-1.5 h-3.5 w-3.5"}),e("settings.editAgent")]}),(0,s.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>{W(t.uuid),V(!0)},className:"text-destructive hover:text-destructive",children:e("common.delete")})]})]}),(0,s.jsxs)("div",{className:"mt-4 border-t border-border pt-3",children:[(0,s.jsxs)("button",{onClick:()=>ev(t.agentUuid),className:"flex w-full items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[Y[t.agentUuid]?(0,s.jsx)(g.A,{className:"h-3.5 w-3.5"}):(0,s.jsx)(x.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)(f.A,{className:"h-3.5 w-3.5"}),(0,s.jsx)("span",{children:e("sessions.title")}),H[t.agentUuid]&&(0,s.jsx)(k.E,{variant:"secondary",className:"ml-1 h-4 px-1.5 text-[10px]",children:H[t.agentUuid].length})]}),Y[t.agentUuid]&&(0,s.jsx)("div",{className:"mt-2 space-y-2",children:X[t.agentUuid]?(0,s.jsx)("div",{className:"text-xs text-muted-foreground py-2",children:e("common.loading")}):(null==(a=H[t.agentUuid])?void 0:a.length)?H[t.agentUuid].map(a=>(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg p-2.5 text-xs ".concat("closed"===a.status?"bg-muted/50 text-muted-foreground":"bg-secondary"),children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("div",{className:"h-2 w-2 rounded-full flex-shrink-0 ".concat("active"===a.status?"bg-green-500":"bg-gray-400")}),(0,s.jsx)("span",{className:"font-medium truncate",children:a.name}),(0,s.jsx)(k.E,{variant:"outline",className:"text-[10px] h-4 px-1 ".concat("active"===a.status?"border-green-300 text-green-700":"border-gray-300 text-gray-500"),children:e("sessions.status".concat(a.status.charAt(0).toUpperCase()+a.status.slice(1)))}),(0,s.jsx)("span",{className:"text-muted-foreground",children:e("sessions.checkins",{count:a.checkins.length})})]}),"closed"===a.status?(0,s.jsx)(i.$,{variant:"ghost",size:"sm",className:"h-6 px-2 text-[10px] text-green-600 hover:text-green-700",onClick:()=>eb(a.uuid,t.agentUuid),children:e("sessions.reopen")}):(0,s.jsx)(i.$,{variant:"ghost",size:"sm",className:"h-6 px-2 text-[10px] text-destructive hover:text-destructive",onClick:()=>eh(a.uuid,t.agentUuid),children:e("sessions.close")})]},a.uuid)):(0,s.jsx)("div",{className:"text-xs text-muted-foreground py-2 italic",children:e("sessions.noSessions")})})]})]},t.uuid)})})]}),(0,s.jsx)("div",{className:"mb-8 border-t border-border"}),(0,s.jsxs)(T.Zp,{children:[(0,s.jsxs)(T.aR,{children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(p.A,{className:"h-5 w-5 text-muted-foreground"}),(0,s.jsx)(T.ZB,{children:e("notifications.preferences.title")})]}),(0,s.jsx)(T.BT,{children:e("notifications.preferences.description")})]}),(0,s.jsx)(T.Wu,{children:(0,s.jsx)(B,{})})]}),q&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/25",children:(0,s.jsx)("div",{className:"max-h-[90vh] w-full max-w-2xl overflow-y-auto rounded-2xl bg-card shadow-xl",children:(0,s.jsx)(j.Y,{createAgentAndKey:E.I,onAgentCreated:()=>{ef()},onClose:()=>{D(!1)}})})}),et&&es&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/25",children:(0,s.jsx)("div",{className:"max-h-[90vh] w-full max-w-[520px] overflow-y-auto rounded-2xl bg-card shadow-xl",children:(0,s.jsxs)("form",{onSubmit:ey,children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-6 py-5",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-foreground",children:e("settings.editAgent")}),(0,s.jsx)(i.$,{type:"button",variant:"ghost",size:"icon",onClick:ej,className:"h-8 w-8",children:(0,s.jsx)(v.A,{className:"h-4 w-4"})})]}),(0,s.jsx)("div",{className:"p-6",children:(0,s.jsx)(N.L,{name:en,onNameChange:ei,preset:eo,permissions:ed,onPermissionsChange:e=>{el(e.preset),ec(e.permissions)},persona:eu,onPersonaChange:em,nameInputId:"editName",personaInputId:"edit-agent-persona"})}),(0,s.jsxs)("div",{className:"flex justify-end gap-3 border-t border-border px-6 py-4",children:[(0,s.jsx)(i.$,{type:"button",variant:"outline",onClick:ej,children:e("common.cancel")}),(0,s.jsx)(i.$,{type:"submit",disabled:!en||"custom"===eo&&0===ed.length||eg,children:eg?e("settings.saving"):e("settings.saveChanges")})]})]})})}),(0,s.jsx)(o.Lt,{open:Z,onOpenChange:V,children:(0,s.jsxs)(o.EO,{children:[(0,s.jsxs)(o.wd,{children:[(0,s.jsx)(o.r7,{children:e("settings.confirmDeleteTitle")}),(0,s.jsx)(o.$v,{children:e("settings.confirmDeleteDesc")})]}),(0,s.jsxs)(o.ck,{children:[(0,s.jsx)(o.Zr,{children:e("common.cancel")}),(0,s.jsx)(o.Rx,{onClick:ep,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:e("common.delete")})]})]})})]})}}},e=>{e.O(0,[87326,93151,41752,71444,92037,25554,6893,74414,7659,76404,33218,10201,38803,23593,10006,26441,73632,63472,58917,65833,64035,73849,46608,77358],()=>e(e.s=58700)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[69566],{3101:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>q});var n=s(60200),a=s(81476),i=s(32022),l=s(25588),r=s(40058),c=s(18211),o=s(68433),d=s(71507);let x=["welcome","createAgent","copyKey","installGuide","testConnection","completion"];function m(e){let{currentStep:t,totalSteps:s}=e,a=(0,l.c)("onboarding");return(0,n.jsx)("div",{className:"flex items-start",children:Array.from({length:s},(e,i)=>{let l=i<t,r=i===t;return(0,n.jsxs)("div",{className:"flex flex-col items-center",style:{minWidth:56},children:[(0,n.jsxs)("div",{className:"flex w-full items-center",children:[(0,n.jsx)("div",{className:"h-px flex-1 ".concat(0===i?"bg-transparent":l?"bg-primary":"bg-border")}),(0,n.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-xs font-medium transition-colors ".concat(l?"bg-primary text-primary-foreground":r?"border-2 border-primary bg-background text-primary":"border border-border bg-background text-muted-foreground"),children:l?(0,n.jsx)(d.A,{className:"h-4 w-4"}):i+1}),(0,n.jsx)("div",{className:"h-px flex-1 ".concat(i===s-1?"bg-transparent":i<t?"bg-primary":"bg-border")})]}),(0,n.jsx)("span",{className:"mt-1.5 hidden text-[10px] sm:block ".concat(r?"font-medium text-foreground":"text-muted-foreground"),children:a("steps.".concat(x[i]))})]},i)})})}var u=s(16272),f=s(44072),p=s(80513),g=s(53804),h=s(53511),j=s(51177),N=s(83172),y=s(56109),w=s(25452),b=s(8330);let v=[{icon:f.A,key:"idea"},{icon:p.A,key:"proposal"},{icon:g.A,key:"task"},{icon:h.A,key:"execute"},{icon:j.A,key:"verify"},{icon:N.A,key:"done"}];function k(e){let{onNext:t}=e,s=(0,l.c)("onboarding");return(0,n.jsxs)(w.P.div,{variants:b.tE,initial:"initial",animate:"animate",exit:"exit",className:"flex w-full max-w-lg flex-col items-center gap-8",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,n.jsx)("img",{src:"/chorus-icon.png",alt:"Chorus",className:"h-16 w-16"}),(0,n.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:s("welcome.title")}),(0,n.jsx)("p",{className:"max-w-md text-sm text-muted-foreground",children:s("welcome.description")})]}),(0,n.jsx)(u.Zp,{className:"w-full",children:(0,n.jsxs)(u.Wu,{className:"p-6",children:[(0,n.jsx)("p",{className:"mb-4 text-center text-xs font-medium uppercase tracking-wider text-muted-foreground",children:s("welcome.pipelineTitle")}),(0,n.jsx)(w.P.div,{variants:b.bK,initial:"initial",animate:"animate",className:"flex flex-wrap items-center justify-center gap-2",children:v.map((e,t)=>{let a=e.icon;return(0,n.jsxs)(w.P.div,{variants:b.Rf,className:"flex items-center gap-2",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,n.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-secondary",children:(0,n.jsx)(a,{className:"h-5 w-5 text-primary"})}),(0,n.jsx)("span",{className:"text-[10px] font-medium text-muted-foreground",children:s("welcome.pipeline.".concat(e.key))})]}),t<v.length-1&&(0,n.jsx)(y.A,{className:"h-3 w-3 text-muted-foreground"})]},e.key)})})]})}),(0,n.jsx)(r.$,{size:"lg",onClick:t,className:"w-full max-w-xs",children:s("welcome.getStarted")})]})}var C=s(73190),A=s(48658);function E(e){let{onNext:t,onAgentCreated:s}=e,a=(0,l.c)("onboarding.createAgent");return(0,n.jsx)(w.P.div,{variants:b.tE,initial:"initial",animate:"animate",exit:"exit",className:"flex w-full max-w-2xl flex-col items-center gap-6",children:(0,n.jsxs)(u.Zp,{className:"w-full",children:[(0,n.jsxs)(u.aR,{className:"text-center",children:[(0,n.jsx)(u.ZB,{children:a("title")}),(0,n.jsx)(u.BT,{children:a("description")})]}),(0,n.jsx)(u.Wu,{children:(0,n.jsx)(C.Y,{embedded:!0,createAgentAndKey:A.I,submitLabel:a("submit"),submittingLabel:a("creating"),onAgentCreated:(e,n)=>{s(e,n),t()}})})]})})}var P=s(77392),S=s(32814),_=s(43664);function K(e){let{onNext:t,apiKey:s}=e,i=(0,l.c)("onboarding"),[c,o]=(0,a.useState)(!1),x=(0,a.useCallback)(e=>{e.preventDefault()},[]);(0,a.useEffect)(()=>(window.addEventListener("beforeunload",x),()=>{window.removeEventListener("beforeunload",x)}),[x]);let m=async()=>{if(s)try{await navigator.clipboard.writeText(s),o(!0),setTimeout(()=>o(!1),2e3)}catch(e){_.q.error("Failed to copy to clipboard:",e)}};return(0,n.jsx)(w.P.div,{variants:b.tE,initial:"initial",animate:"animate",exit:"exit",className:"flex w-full max-w-lg flex-col items-center gap-8",children:(0,n.jsxs)(u.Zp,{className:"w-full",children:[(0,n.jsxs)(u.aR,{className:"text-center",children:[(0,n.jsx)(u.ZB,{children:i("copyKey.title")}),(0,n.jsx)(u.BT,{children:i("copyKey.description")})]}),(0,n.jsxs)(u.Wu,{className:"flex flex-col gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("code",{className:"flex-1 overflow-x-auto rounded bg-foreground px-3 py-2 font-mono text-sm text-background",children:null!=s?s:""}),(0,n.jsx)(r.$,{variant:"outline",size:"sm",onClick:m,className:"flex-shrink-0",children:c?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.A,{className:"mr-1 h-4 w-4 text-green-500"}),i("copyKey.copied")]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P.A,{className:"mr-1 h-4 w-4"}),i("copyKey.copy")]})})]}),(0,n.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-yellow-300 bg-yellow-50 p-3 dark:border-yellow-800 dark:bg-yellow-950",children:[(0,n.jsx)(S.A,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-yellow-600 dark:text-yellow-400"}),(0,n.jsx)("p",{className:"text-sm font-medium text-yellow-700 dark:text-yellow-300",children:i("copyKey.warning")})]}),(0,n.jsx)(r.$,{onClick:t,className:"w-full",children:i("next")})]})]})})}var O=s(5184);function $(e){let{apiKey:t,onNext:s,onBack:a}=e,i=(0,l.c)("onboarding");return(0,n.jsxs)(w.P.div,{variants:b.tE,initial:"initial",animate:"animate",exit:"exit",className:"flex w-full max-w-2xl flex-col items-center gap-6",children:[(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:i("steps.installGuide")}),(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:i("install.description")})]}),(0,n.jsx)(O.Z,{apiKey:t}),(0,n.jsxs)("div",{className:"flex gap-2",children:[a&&(0,n.jsx)(r.$,{variant:"outline",onClick:a,children:i("back")}),(0,n.jsx)(r.$,{onClick:s,children:i("next")})]})]})}var Z=s(28201),z=s(16832),B=s(26185),T=s(29638);function W(e){let{onNext:t,onBack:s,agentUuid:i,agentName:c,onConnectionVerified:o}=e,d=(0,l.c)("onboarding"),[x,m]=(0,a.useState)("waiting"),f=(0,a.useRef)(null),p=(0,a.useCallback)(()=>{f.current&&(f.current.close(),f.current=null)},[]),g=(0,a.useCallback)(()=>{p(),m("waiting");let e=new EventSource("/api/events/notifications");f.current=e,e.onmessage=e=>{try{let t=JSON.parse(e.data);"new_notification"===t.type&&"agent_checkin"===t.action&&t.entityUuid===i&&(m("connected"),p(),o())}catch(e){}},e.onerror=()=>{}},[i,p,o]);return(0,a.useEffect)(()=>(g(),p),[g,p]),(0,n.jsx)(w.P.div,{variants:b.tE,initial:"initial",animate:"animate",exit:"exit",className:"flex w-full max-w-lg flex-col items-center gap-8",children:(0,n.jsx)(u.Zp,{className:"w-full",children:(0,n.jsxs)(u.Wu,{className:"flex flex-col items-center gap-6 p-8",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:d("testConnection.title")}),"waiting"===x&&(0,n.jsxs)("div",{className:"flex w-full flex-col items-center gap-4",children:[(0,n.jsxs)("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute h-16 w-16 animate-ping rounded-full bg-primary/20"}),c?(0,n.jsx)(B.AgentAvatar,{name:c,size:48,className:"rounded-full"}):(0,n.jsx)(Z.A,{className:"h-8 w-8 animate-spin text-primary"})]}),(0,n.jsx)("p",{className:"text-center text-sm text-muted-foreground",children:d("testConnection.waiting")}),c&&(0,n.jsx)("p",{className:"text-center text-xs text-muted-foreground",children:d("testConnection.waitingFor",{name:c})}),(0,n.jsxs)("div",{className:"w-full",children:[(0,n.jsx)("p",{className:"mb-2 text-center text-xs text-muted-foreground",children:d("testConnection.checkinHint")}),(0,n.jsx)(T.N,{code:d("testConnection.checkinPrompt")})]}),s&&(0,n.jsx)(r.$,{variant:"outline",onClick:s,children:d("back")})]}),"connected"===x&&(0,n.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,n.jsx)(w.P.div,{initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:300,damping:20},children:(0,n.jsx)(z.A,{className:"h-16 w-16 text-green-500"})}),(0,n.jsx)("p",{className:"text-center text-sm font-medium text-green-600",children:d("testConnection.connected")}),(0,n.jsx)(r.$,{onClick:t,children:d("next")})]})]})})})}var F=s(59987),R=s(38028),G=s(16198);function I(e){let{createdAgent:t}=e,s=(0,i.r)(),c=(0,l.c)("onboarding"),o=(0,l.c)("agent.permissions");(0,a.useEffect)(()=>{localStorage.setItem("chorus_onboarding_completed","done")},[]);let d=t?o(t.roles.includes("admin_agent")?"presetAdmin":t.roles.includes("pm_agent")?"presetPm":t.roles.includes("developer_agent")?"presetDev":"presetCustom"):null;return(0,n.jsxs)(w.P.div,{variants:b.tE,initial:"initial",animate:"animate",exit:"exit",className:"flex w-full max-w-lg flex-col items-center gap-8",children:[(0,n.jsxs)("div",{className:"flex flex-col items-center gap-3 text-center",children:[(0,n.jsx)("div",{className:"flex h-16 w-16 items-center justify-center rounded-full bg-primary/10",children:(0,n.jsx)(z.A,{className:"h-10 w-10 text-primary"})}),(0,n.jsx)("h1",{className:"text-2xl font-semibold text-foreground",children:c("completion.title")}),(0,n.jsx)("p",{className:"max-w-md text-sm text-muted-foreground",children:c("completion.description")})]}),t&&(0,n.jsx)(u.Zp,{className:"w-full",children:(0,n.jsxs)(u.Wu,{className:"p-6",children:[(0,n.jsx)("div",{className:"mb-4 flex justify-center",children:(0,n.jsx)(B.AgentAvatar,{name:t.name,size:48,className:"rounded-2xl"})}),(0,n.jsx)("h3",{className:"mb-3 text-sm font-medium text-foreground",children:c("completion.summary")}),(0,n.jsxs)("div",{className:"space-y-2 text-sm text-muted-foreground",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:c("completion.agentName")}),(0,n.jsx)("span",{className:"font-medium text-foreground",children:t.name})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:c("completion.agentPreset")}),(0,n.jsx)("span",{className:"font-medium text-foreground",children:d})]}),0===t.roles.length&&t.permissions.length>0&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{children:c("completion.agentPermissions")}),(0,n.jsx)("span",{className:"font-medium text-foreground",children:c("completion.permissionsCount",{count:t.permissions.length})})]})]})]})}),(0,n.jsx)(G.Bs,{variant:"prominent"}),(0,n.jsxs)("div",{className:"flex w-full max-w-xs flex-col gap-3",children:[(0,n.jsxs)(r.$,{size:"lg",onClick:()=>s.push("/projects"),className:"w-full gap-2",children:[(0,n.jsx)(F.A,{className:"h-4 w-4"}),c("completion.goToProjects")]}),(0,n.jsxs)(r.$,{variant:"outline",size:"lg",onClick:()=>s.push("/settings"),className:"w-full gap-2",children:[(0,n.jsx)(R.A,{className:"h-4 w-4"}),c("completion.goToSettings")]})]})]})}function L(){var e,t;let s=(0,i.r)(),d=(0,l.c)("onboarding"),[x,u]=(0,a.useState)(0),[f,p]=(0,a.useState)(null),[g,h]=(0,a.useState)(null),[j,N]=(0,a.useState)(null),[y,w]=(0,a.useState)(!1),b=(0,a.useCallback)(()=>{u(e=>Math.min(e+1,5))},[]),v=(0,a.useCallback)(()=>{u(e=>Math.max(e-1,0))},[]),C=(0,a.useCallback)(()=>{localStorage.setItem("chorus_onboarding_completed","skipped"),s.push("/projects")},[s]),A=(0,a.useCallback)((e,t)=>{p(e),h(t)},[]),P=(0,a.useCallback)(()=>{w(!0),u(5)},[]),S=5===x;return(0,n.jsxs)("div",{className:"flex w-full max-w-2xl flex-col items-center gap-8",children:[(0,n.jsx)(m,{currentStep:x,totalSteps:6}),(0,n.jsxs)(c.N,{mode:"wait",children:[0===x&&(0,n.jsx)(k,{onNext:b},"welcome"),1===x&&(0,n.jsx)(E,{onNext:b,onAgentCreated:A},"createAgent"),2===x&&(0,n.jsx)(K,{onNext:b,apiKey:g},"copyKey"),3===x&&(0,n.jsx)($,{apiKey:g,onNext:b,onBack:v},"installGuide"),4===x&&(0,n.jsx)(W,{onNext:b,onBack:v,agentUuid:null!=(e=null==f?void 0:f.uuid)?e:null,agentName:null!=(t=null==f?void 0:f.name)?t:null,onConnectionVerified:P},"testConnection"),5===x&&(0,n.jsx)(I,{createdAgent:f},"completion")]}),!S&&(0,n.jsx)(r.$,{variant:"link",size:"sm",onClick:C,className:"text-muted-foreground",children:d("skip")}),(0,n.jsx)(o.m,{variant:"footer"})]})}function q(){return(0,n.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:(0,n.jsx)(L,{})})}},8330:(e,t,s)=>{"use strict";s.d(t,{K5:()=>c,Rf:()=>r,Yv:()=>n,bK:()=>l,qG:()=>i,tE:()=>a});let n={fast:.15,normal:.2,slow:.3,easeOut:[0,0,.2,1],easeInOut:[.4,0,.2,1],stagger:.04,staggerFast:.03,spring:{type:"spring",stiffness:500,damping:30},tween:{type:"tween",duration:.2,ease:[0,0,.2,1]}},a={initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:n.normal,ease:n.easeOut}},exit:{opacity:0,y:-4,transition:{duration:n.fast,ease:n.easeOut}}},i={initial:{opacity:0},animate:{opacity:1,transition:{duration:n.normal,ease:n.easeOut}},exit:{opacity:0,transition:{duration:n.fast,ease:n.easeOut}}};n.normal,n.easeOut,n.fast,n.easeOut;let l={initial:{},animate:{transition:{staggerChildren:n.stagger}}},r={initial:{opacity:0,y:8},animate:{opacity:1,y:0,transition:{duration:n.normal,ease:n.easeOut}}},c={initial:{opacity:0,scale:.95,y:-4},animate:{opacity:1,scale:1,y:0,transition:{duration:n.fast,ease:n.easeOut}},exit:{opacity:0,scale:.95,y:-4,transition:{duration:n.fast,ease:n.easeOut}}}},34830:(e,t,s)=>{Promise.resolve().then(s.bind(s,3101))}},e=>{e.O(0,[87326,93151,41752,71444,92037,41677,25554,6893,74414,34216,7659,76404,25452,33218,10201,38803,23593,10006,26441,73632,63472,65208,5899,52253,75556,16198,65833,73849,46608,77358],()=>e(e.s=34830)),_N_E=e.O()}]);
|