@shepai/cli 1.169.1 → 1.170.0
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/apis/json-schema/Feature.yaml +10 -0
- package/apis/json-schema/SkillInjectionConfig.yaml +17 -0
- package/apis/json-schema/SkillSource.yaml +21 -0
- package/apis/json-schema/SkillSourceType.yaml +7 -0
- package/apis/json-schema/WorkflowConfig.yaml +3 -0
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +8 -0
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/index.d.ts +1 -0
- package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.d.ts +39 -0
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.js +8 -0
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.js +1 -0
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts +3 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.js +22 -3
- package/dist/packages/core/src/application/use-cases/features/create/types.d.ts +2 -0
- package/dist/packages/core/src/application/use-cases/features/create/types.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.js +23 -2
- package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
- package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +55 -1
- package/dist/packages/core/src/domain/generated/output.d.ts +50 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +5 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +2 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts +2 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.js +6 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +2 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +27 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.d.ts +15 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.js +23 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.d.ts +11 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.js +19 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.js +8 -4
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts +21 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.js +61 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts +16 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.js +47 -4
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +39 -20
- package/dist/packages/core/src/infrastructure/services/git/git-fork.service.d.ts +5 -0
- package/dist/packages/core/src/infrastructure/services/git/git-fork.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-fork.service.js +34 -0
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +8 -0
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.d.ts +26 -0
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.js +201 -0
- package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/new.command.js +3 -0
- package/dist/src/presentation/web/app/actions/add-injected-skill.d.ts +7 -0
- package/dist/src/presentation/web/app/actions/add-injected-skill.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/add-injected-skill.js +34 -0
- package/dist/src/presentation/web/app/actions/create-feature.d.ts +2 -0
- package/dist/src/presentation/web/app/actions/create-feature.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/create-feature.js +3 -1
- package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts +1 -0
- package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/get-workflow-defaults.js +1 -0
- package/dist/src/presentation/web/app/actions/remove-injected-skill.d.ts +6 -0
- package/dist/src/presentation/web/app/actions/remove-injected-skill.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/remove-injected-skill.js +35 -0
- package/dist/src/presentation/web/app/build-feature-node-data.d.ts.map +1 -1
- package/dist/src/presentation/web/app/build-feature-node-data.js +2 -0
- package/dist/src/presentation/web/app/skills/page.d.ts.map +1 -1
- package/dist/src/presentation/web/app/skills/page.js +6 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +2 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +6 -2
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +1 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +10 -4
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +2 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +12 -0
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +4 -0
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.d.ts +10 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.js +56 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.js +66 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.d.ts +8 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.js +42 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.js +69 -0
- package/dist/src/presentation/web/components/features/skills/skills-page-client.d.ts +3 -1
- package/dist/src/presentation/web/components/features/skills/skills-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/skills/skills-page-client.js +5 -3
- package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.d.ts +1 -0
- package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.js +27 -0
- package/dist/translations/ar/cli.json +2 -0
- package/dist/translations/ar/web.json +15 -11
- package/dist/translations/de/cli.json +2 -0
- package/dist/translations/de/web.json +35 -17
- package/dist/translations/en/cli.json +2 -0
- package/dist/translations/en/web.json +4 -0
- package/dist/translations/es/cli.json +2 -0
- package/dist/translations/es/web.json +16 -12
- package/dist/translations/fr/cli.json +2 -0
- package/dist/translations/fr/web.json +16 -12
- package/dist/translations/he/cli.json +2 -0
- package/dist/translations/he/web.json +16 -12
- package/dist/translations/pt/cli.json +2 -0
- package/dist/translations/pt/web.json +16 -12
- package/dist/translations/ru/cli.json +2 -0
- package/dist/translations/ru/web.json +16 -12
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +5 -5
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +2 -2
- package/web/.next/required-server-files.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/page.js +1 -1
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error/page/build-manifest.json +3 -3
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/build-manifest.json +3 -3
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/_not-found/page.js +1 -1
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
- package/web/.next/server/app/features/page/build-manifest.json +3 -3
- package/web/.next/server/app/features/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/features/page.js +1 -1
- package/web/.next/server/app/features/page.js.nft.json +1 -1
- package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/build-manifest.json +3 -3
- package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/settings/page.js +3 -3
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/build-manifest.json +3 -3
- package/web/.next/server/app/skills/page/server-reference-manifest.json +52 -22
- package/web/.next/server/app/skills/page.js +3 -2
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/build-manifest.json +3 -3
- package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/tools/page.js +1 -1
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/build-manifest.json +3 -3
- package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/version/page.js +1 -1
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_0727935d._.js → 403f9_next_8a33ddee._.js} +2 -2
- package/web/.next/server/chunks/ssr/403f9_next_8a33ddee._.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +3 -3
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__e88da4ee._.js → [root-of-the-server]__1cd4327c._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__7ffd3598._.js → [root-of-the-server]__92ffd5ee._.js} +3 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fa525872._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fa525872._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_02e01240._.js +1 -1
- package/web/.next/server/chunks/ssr/_02e01240._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_fe058119._.js → _0d7dd23b._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_fe058119._.js.map → _0d7dd23b._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_18886033._.js +1 -1
- package/web/.next/server/chunks/ssr/_18886033._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.js +3 -0
- package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js +1 -1
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_5119a3df._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6f35fb9a._.js +3 -0
- package/web/.next/server/chunks/ssr/_6f35fb9a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_a8b338ec._.js → _77ae079a._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_a8b338ec._.js.map → _77ae079a._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_a963dd3c._.js +3 -0
- package/web/.next/server/chunks/ssr/_a963dd3c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_ad09f271._.js +1 -1
- package/web/.next/server/chunks/ssr/_ad09f271._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_9b964adc._.js → _deabc145._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_9b964adc._.js.map → _deabc145._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_df737cce._.js +3 -0
- package/web/.next/server/chunks/ssr/_df737cce._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_e3f14907._.js +9 -0
- package/web/.next/server/chunks/ssr/_e3f14907._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_ea9e1556._.js +1 -1
- package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
- package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js +1 -1
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js.map +1 -1
- package/web/.next/server/middleware-build-manifest.js +3 -3
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +89 -59
- package/web/.next/static/chunks/06a86173379e6c51.js +1 -0
- package/web/.next/static/chunks/{ff9e33615f5c856c.js → 16ed73f9880b7d63.js} +1 -1
- package/web/.next/static/chunks/185e4f36cb6efb24.js +1 -0
- package/web/.next/static/chunks/2b2f3a70ebd6ac1c.js +1 -0
- package/web/.next/static/chunks/{04c874f52a7cd435.js → 3d1df5c349d855eb.js} +1 -1
- package/web/.next/static/chunks/4559a403ee40dd19.js +7 -0
- package/web/.next/static/chunks/74729cbad964be13.js +1 -0
- package/web/.next/static/chunks/{a052c19c18e9eced.js → 74e5b5c7950efbc1.js} +1 -1
- package/web/.next/static/chunks/{d6c39780c2f75ecd.js → 7a6854bb07182777.js} +1 -1
- package/web/.next/static/chunks/8e12deeabf6624e9.js +1 -0
- package/web/.next/static/chunks/9c6f8f49799efd3a.js +1 -0
- package/web/.next/static/chunks/{c5d89c12a73e0461.js → a3802d6f8677cd04.js} +2 -2
- package/web/.next/static/chunks/b0a6fce5425f8d3a.js +3 -0
- package/web/.next/static/chunks/b14085e99b88e7f7.css +1 -0
- package/web/.next/static/chunks/b65e555419a0c664.js +1 -0
- package/web/.next/static/chunks/{562c70303d910295.js → c5a0b452afc8fe47.js} +1 -1
- package/web/.next/static/chunks/ca23a8642f750548.js +5 -0
- package/web/.next/static/chunks/cc5fe8d1d9e1e519.js +5 -0
- package/web/.next/static/chunks/{021c9b0effb6d688.js → f29814a72404ea2b.js} +1 -1
- package/web/.next/static/chunks/{b0e2fb3d4eb42f3d.js → f51250616da82bd2.js} +1 -1
- package/web/.next/static/chunks/{caf7d7e1b439b29e.js → f9da308b3033c57a.js} +1 -1
- package/web/.next/static/chunks/{turbopack-57bb0674e2cd1d31.js → turbopack-b38a68b1b1c41a87.js} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__20a36a42._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__20a36a42._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7ffd3598._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e88da4ee._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0727935d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0dc06d07._.js +0 -3
- package/web/.next/server/chunks/ssr/_0dc06d07._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_682fc996._.js +0 -9
- package/web/.next/server/chunks/ssr/_682fc996._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_6892e3b9._.js +0 -3
- package/web/.next/server/chunks/ssr/_6892e3b9._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_a1068852._.js +0 -3
- package/web/.next/server/chunks/ssr/_a1068852._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_12a7ede0._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_12a7ede0._.js.map +0 -1
- package/web/.next/static/chunks/20f7cc98a013b11c.js +0 -1
- package/web/.next/static/chunks/4cec255f2754e5ec.js +0 -1
- package/web/.next/static/chunks/5b7275374d2696b3.css +0 -1
- package/web/.next/static/chunks/647140fe96a7c88a.js +0 -1
- package/web/.next/static/chunks/6d6f70ff5151b8cb.js +0 -7
- package/web/.next/static/chunks/84792d40edc4b027.js +0 -5
- package/web/.next/static/chunks/8800875bb3d56192.js +0 -3
- package/web/.next/static/chunks/8d581adafe8d1dd0.js +0 -1
- package/web/.next/static/chunks/982aef195c118996.js +0 -1
- package/web/.next/static/chunks/a6b5e739d2f89c6b.js +0 -1
- package/web/.next/static/chunks/c3ef3b892f7794ec.js +0 -1
- package/web/.next/static/chunks/dc134f3f58cdf850.js +0 -5
- /package/web/.next/static/{lFiCv3l4nIAIpZmj6eehh → 0KDwNT3AGQmFGIwjHx99r}/_buildManifest.js +0 -0
- /package/web/.next/static/{lFiCv3l4nIAIpZmj6eehh → 0KDwNT3AGQmFGIwjHx99r}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{lFiCv3l4nIAIpZmj6eehh → 0KDwNT3AGQmFGIwjHx99r}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,31406,(e,t,s)=>{t.exports=e.r(67013)},95230,e=>{"use strict";let t=(0,e.i(3645).default)("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"}]]);e.s(["default",()=>t])},43698,e=>{"use strict";let t=(0,e.i(3645).default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);e.s(["default",()=>t])},64764,80436,17087,e=>{"use strict";var t=e.i(15506);e.s(["Loader2Icon",()=>t.default],64764);var s=e.i(95230);e.s(["DownloadIcon",()=>s.default],80436);let r=(0,e.i(3645).default)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]]);e.s(["StickyNoteIcon",()=>r],17087)},48306,e=>{"use strict";var t=e.i(20314),s=e.i(31777);function r({className:e,...r}){return(0,t.jsx)("textarea",{"data-slot":"textarea",className:(0,s.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none 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",e),...r})}e.s(["Textarea",()=>r])},28267,57484,e=>{"use strict";var t=e.i(1693);e.s(["VisuallyHidden",0,t],28267);let s=(0,e.i(3645).default)("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);e.s(["FileIcon",()=>s],57484)},16298,e=>{"use strict";let t=(0,e.i(3645).default)("file-text",[["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:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["default",()=>t])},50032,86254,e=>{"use strict";var t=e.i(20314),s=e.i(60253),r=e.i(64764),i=e.i(80436),n=e.i(17087),a=e.i(31777),o=e.i(2287),l=e.i(48306),u=e.i(2828),c=e.i(28267),h=e.i(57484),d=e.i(16298),d=d;let p=(0,e.i(3645).default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);var f=e.i(93752),f=f;e.i(35364);let y=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),m=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function v(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function g(e,t){let s=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${s.toString()}`}function x({name:e,size:x,mimeType:w,path:S,onRemove:R,loading:T=!1,disabled:j=!1,notes:O,onNotesChange:C}){let k,I,E=(k=e.lastIndexOf("."))>=0?e.slice(k).toLowerCase():"",Q=y.has(E)?p:".pdf"===E?d.default:m.has(E)?f.default:h.FileIcon,F=".pdf"===E?"bg-red-50 text-red-600":y.has(E)?"bg-blue-50 text-blue-600":m.has(E)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",M=(I=e.lastIndexOf("."))>=0&&b.has(e.slice(I).toLowerCase());if(T)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(r.Loader2Icon,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(M){let r=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:g(S,w),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),O?(0,t.jsx)("span",{className:"ring-background absolute -right-1 -bottom-1 flex h-4 w-4 items-center justify-center rounded-full bg-amber-500 text-white shadow-sm ring-2",children:(0,t.jsx)(n.StickyNoteIcon,{className:"h-2.5 w-2.5"})}):null]});return(0,t.jsx)(u.TooltipProvider,{delayDuration:200,children:(0,t.jsxs)(o.Dialog,{children:[(0,t.jsxs)(u.Tooltip,{children:[(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(o.DialogTrigger,{asChild:!0,children:r})}),!j&&(0,t.jsx)("button",{type:"button",onClick:R,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]}),O?(0,t.jsx)(u.TooltipContent,{side:"bottom",className:"max-w-[220px] border border-amber-200 bg-amber-50 text-amber-950 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-100",children:(0,t.jsx)("p",{className:"line-clamp-3 text-xs leading-snug",children:O})}):null]}),(0,t.jsxs)(o.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(c.VisuallyHidden.Root,{children:(0,t.jsxs)(o.DialogTitle,{children:["Preview: ",e]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:g(S,w),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex flex-col gap-2 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:v(x)})]}),(0,t.jsx)("a",{href:g(S,w),download:e,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${e}`,children:(0,t.jsx)(i.DownloadIcon,{className:"h-4 w-4"})})]}),C?(0,t.jsx)(l.Textarea,{placeholder:"Add notes about this image…",value:O??"",onChange:e=>C(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):O?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:O}):null]})]})]})})}return(0,t.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 ps-2 pe-3",children:[(0,t.jsx)("div",{className:(0,a.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",F),children:(0,t.jsx)(Q,{className:"h-3 w-3"})}),(0,t.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:v(x)}),!j&&(0,t.jsx)("button",{type:"button",onClick:R,className:"absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex","aria-label":`Remove ${e}`,children:(0,t.jsx)(s.X,{className:"h-3 w-3"})})]})}e.s(["AttachmentChip",()=>x],86254),e.s([],50032)},99105,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],99105)},33548,e=>{"use strict";let t=(0,e.i(3645).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",()=>t],33548)},67669,e=>{"use strict";let t=(0,e.i(3645).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",()=>t],67669)},94365,e=>{"use strict";let t=(0,e.i(3645).default)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);e.s(["User",()=>t],94365)},4520,77501,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t],77501);var s=new class extends t{#e;#t;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>s],4520)},3,68911,e=>{"use strict";e.i(44172);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},s=new class{#r=t;#i=!1;setTimeoutProvider(e){this.#r=e}setTimeout(e,t){return this.#r.setTimeout(e,t)}clearTimeout(e){this.#r.clearTimeout(e)}setInterval(e,t){return this.#r.setInterval(e,t)}clearInterval(e){this.#r.clearInterval(e)}};function r(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>r,"timeoutManager",()=>s],68911);var i="u"<typeof window||"Deno"in globalThis;function n(){}function a(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:s="all",exact:r,fetchStatus:i,predicate:n,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==p(a,t.options))return!1}else if(!y(t.queryKey,a))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!i||i===t.state.fetchStatus)&&(!n||!!n(t))}function d(e,t){let{exact:s,status:r,predicate:i,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(s){if(f(t.options.mutationKey)!==f(n))return!1}else if(!y(t.options.mutationKey,n))return!1}return(!r||t.state.status===r)&&(!i||!!i(t))}function p(e,t){return(t?.queryKeyHashFn||f)(e)}function f(e){return JSON.stringify(e,(e,t)=>g(t)?Object.keys(t).sort().reduce((e,s)=>(e[s]=t[s],e),{}):t)}function y(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>y(e[s],t[s]))}var m=Object.prototype.hasOwnProperty;function v(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let s in e)if(e[s]!==t[s])return!1;return!0}function b(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function g(e){if(!x(e))return!1;let t=e.constructor;if(void 0===t)return!0;let s=t.prototype;return!!x(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function x(e){return"[object Object]"===Object.prototype.toString.call(e)}function w(e){return new Promise(t=>{s.setTimeout(t,e)})}function S(e,t,s){return"function"==typeof s.structuralSharing?s.structuralSharing(e,t):!1!==s.structuralSharing?function e(t,s,r=0){if(t===s)return t;if(r>500)return s;let i=b(t)&&b(s);if(!i&&!(g(t)&&g(s)))return s;let n=(i?t:Object.keys(t)).length,a=i?s:Object.keys(s),o=a.length,l=i?Array(o):{},u=0;for(let c=0;c<o;c++){let o=i?c:a[c],h=t[o],d=s[o];if(h===d){l[o]=h,(i?c<n:m.call(t,o))&&u++;continue}if(null===h||null===d||"object"!=typeof h||"object"!=typeof d){l[o]=d;continue}let p=e(h,d,r+1);l[o]=p,p===h&&u++}return n===o&&u===n?t:l}(e,t):t}function R(e,t,s=0){let r=[...e,t];return s&&r.length>s?r.slice(1):r}function T(e,t,s=0){let r=[t,...e];return s&&r.length>s?r.slice(0,-1):r}var j=Symbol();function O(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==j?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function C(e,t){return"function"==typeof e?e(...t):!!e}function k(e,t,s){let r,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(r??=t(),i||(i=!0,r.aborted?s():r.addEventListener("abort",s,{once:!0})),r)}),e}e.s(["addConsumeAwareSignal",()=>k,"addToEnd",()=>R,"addToStart",()=>T,"ensureQueryFn",()=>O,"functionalUpdate",()=>a,"hashKey",()=>f,"hashQueryKeyByOptions",()=>p,"isServer",()=>i,"isValidTimeout",()=>o,"matchMutation",()=>d,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>y,"replaceData",()=>S,"resolveEnabled",()=>c,"resolveStaleTime",()=>u,"shallowEqualObjects",()=>v,"shouldThrowError",()=>C,"skipToken",()=>j,"sleep",()=>w,"timeUntilStale",()=>l],3)},65617,e=>{"use strict";let t;var s=e.i(3),r=(t=()=>s.isServer,{isServer:()=>t(),setIsServer(e){t=e}});e.s(["environmentManager",()=>r])},6786,e=>{"use strict";let t,s,r,i,n,a;var o=e.i(68911).systemSetTimeoutZero,l=(t=[],s=0,r=e=>{e()},i=e=>{e()},n=o,{batch:e=>{let a;s++;try{a=e()}finally{let e;--s||(e=t,t=[],e.length&&n(()=>{i(()=>{e.forEach(e=>{r(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{s?t.push(e):n(()=>{r(e)})},setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>l])},13598,20820,e=>{"use strict";var t=e.i(77501),s=new class extends t.Subscribable{#n=!0;#t;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#s=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function r(){let e,t,s=new Promise((s,r)=>{e=s,t=r});function r(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=t=>{r({status:"fulfilled",value:t}),e(t)},s.reject=e=>{r({status:"rejected",reason:e}),t(e)},s}e.s(["onlineManager",()=>s],13598),e.i(3),e.s(["pendingThenable",()=>r],20820)},28574,20979,19644,34682,e=>{"use strict";e.i(44172);var t=e.i(3),s=e.i(6786),r=e.i(4520),i=e.i(13598),n=e.i(20820),a=e.i(65617);function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||i.onlineManager.isOnline()}var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let s,c=!1,h=0,d=(0,n.pendingThenable)(),p=()=>r.focusManager.isFocused()&&("always"===e.networkMode||i.onlineManager.isOnline())&&e.canRun(),f=()=>l(e.networkMode)&&e.canRun(),y=e=>{"pending"===d.status&&(s?.(),d.resolve(e))},m=e=>{"pending"===d.status&&(s?.(),d.reject(e))},v=()=>new Promise(t=>{s=e=>{("pending"!==d.status||p())&&t(e)},e.onPause?.()}).then(()=>{s=void 0,"pending"===d.status&&e.onContinue?.()}),b=()=>{let s;if("pending"!==d.status)return;let r=0===h?e.initialPromise:void 0;try{s=r??e.fn()}catch(e){s=Promise.reject(e)}Promise.resolve(s).then(y).catch(s=>{if("pending"!==d.status)return;let r=e.retry??3*!a.environmentManager.isServer(),i=e.retryDelay??o,n="function"==typeof i?i(h,s):i,l=!0===r||"number"==typeof r&&h<r||"function"==typeof r&&r(h,s);c||!l?m(s):(h++,e.onFail?.(h,s),(0,t.sleep)(n).then(()=>p()?void 0:v()).then(()=>{c?m(s):b()}))})};return{promise:d,status:()=>d.status,cancel:t=>{if("pending"===d.status){let s=new u(t);m(s),e.onCancel?.(s)}},continue:()=>(s?.(),d),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:f,start:()=>(f()?b():v().then(b),d)}}e.s(["CancelledError",()=>u,"canFetch",()=>l,"createRetryer",()=>c],20979);var h=e.i(68911),d=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#a=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a.environmentManager.isServer()?1/0:3e5))}clearGcTimeout(){this.#a&&(h.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",()=>d],19644);var p=class extends d{#o;#l;#u;#c;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=m(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=m(this.options);void 0!==e.data&&(this.setState(y(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,s){let r=(0,t.replaceData)(this.state.data,e,this.options);return this.#f({data:r,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),r}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){let s=this.#h?.promise;return this.#h?.cancel(e),s?s.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#o}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p||this.#y()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,s){let r;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let i=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,i.signal)})},a=()=>{let e,r=(0,t.ensureQueryFn)(this.options,s),i=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(r,i,this):r(i)},o=(n(r={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),r);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#f({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:s?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof u&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),i.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof u){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...f(t.data,this.options),fetchMeta:e.meta??null};case"success":let s={...t,...y(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?s:void 0,s;case"error":let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),s.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function f(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function y(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function m(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,r=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>p,"fetchState",()=>f],28574);var v=e.i(79054),b=e.i(20314),g=v.createContext(void 0),x=e=>{let t=v.useContext(g);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},w=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,b.jsx)(g.Provider,{value:e,children:t}));e.s(["QueryClientProvider",()=>w,"useQueryClient",()=>x],34682)},62885,e=>{"use strict";let t;var s=e.i(4520),r=e.i(65617),i=e.i(6786),n=e.i(28574),a=e.i(77501),o=e.i(20820),l=e.i(3),u=e.i(68911),c=class extends a.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#m=null,this.#v=(0,o.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#b=void 0;#g=void 0;#x=void 0;#w;#S;#v;#m;#R;#T;#j;#O;#C;#k;#I=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),h(this.#b,this.options)?this.#E():this.updateResult(),this.#Q())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return d(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return d(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#F(),this.#M(),this.#b.removeObserver(this)}setOptions(e){let t=this.options,s=this.#b;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,l.resolveEnabled)(this.options.enabled,this.#b))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#D(),this.#b.setOptions(this.options),t._defaulted&&!(0,l.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});let r=this.hasListeners();r&&p(this.#b,s,this.options,t)&&this.#E(),this.updateResult(),r&&(this.#b!==s||(0,l.resolveEnabled)(this.options.enabled,this.#b)!==(0,l.resolveEnabled)(t.enabled,this.#b)||(0,l.resolveStaleTime)(this.options.staleTime,this.#b)!==(0,l.resolveStaleTime)(t.staleTime,this.#b))&&this.#U();let i=this.#P();r&&(this.#b!==s||(0,l.resolveEnabled)(this.options.enabled,this.#b)!==(0,l.resolveEnabled)(t.enabled,this.#b)||i!==this.#k)&&this.#q(i)}getOptimisticResult(e){var t,s;let r=this.#c.getQueryCache().build(this.#c,e),i=this.createResult(r,e);return t=this,s=i,(0,l.shallowEqualObjects)(t.getCurrentResult(),s)||(this.#x=i,this.#S=this.options,this.#w=this.#b.state),i}getCurrentResult(){return this.#x}trackResult(e,t){return new Proxy(e,{get:(e,s)=>(this.trackProp(s),t?.(s),"promise"===s&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,s))})}trackProp(e){this.#I.add(e)}getCurrentQuery(){return this.#b}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),s=this.#c.getQueryCache().build(this.#c,t);return s.fetch().then(()=>this.createResult(s,t))}fetch(e){return this.#E({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#x))}#E(e){this.#D();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l.noop)),t}#U(){this.#F();let e=(0,l.resolveStaleTime)(this.options.staleTime,this.#b);if(r.environmentManager.isServer()||this.#x.isStale||!(0,l.isValidTimeout)(e))return;let t=(0,l.timeUntilStale)(this.#x.dataUpdatedAt,e);this.#O=u.timeoutManager.setTimeout(()=>{this.#x.isStale||this.updateResult()},t+1)}#P(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#q(e){this.#M(),this.#k=e,!r.environmentManager.isServer()&&!1!==(0,l.resolveEnabled)(this.options.enabled,this.#b)&&(0,l.isValidTimeout)(this.#k)&&0!==this.#k&&(this.#C=u.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||s.focusManager.isFocused())&&this.#E()},this.#k))}#Q(){this.#U(),this.#q(this.#P())}#F(){this.#O&&(u.timeoutManager.clearTimeout(this.#O),this.#O=void 0)}#M(){this.#C&&(u.timeoutManager.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){let s,r=this.#b,i=this.options,a=this.#x,u=this.#w,c=this.#S,d=e!==r?e.state:this.#g,{state:y}=e,m={...y},v=!1;if(t._optimisticResults){let s=this.hasListeners(),a=!s&&h(e,t),o=s&&p(e,r,t,i);(a||o)&&(m={...m,...(0,n.fetchState)(y.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:x}=m;s=m.data;let w=!1;if(void 0!==t.placeholderData&&void 0===s&&"pending"===x){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,w=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#j?.state.data,this.#j):t.placeholderData,void 0!==e&&(x="success",s=(0,l.replaceData)(a?.data,e,t),v=!0)}if(t.select&&void 0!==s&&!w)if(a&&s===u?.data&&t.select===this.#R)s=this.#T;else try{this.#R=t.select,s=t.select(s),s=(0,l.replaceData)(a?.data,s,t),this.#T=s,this.#m=null}catch(e){this.#m=e}this.#m&&(b=this.#m,s=this.#T,g=Date.now(),x="error");let S="fetching"===m.fetchStatus,R="pending"===x,T="error"===x,j=R&&S,O=void 0!==s,C={status:x,fetchStatus:m.fetchStatus,isPending:R,isSuccess:"success"===x,isError:T,isInitialLoading:j,isLoading:j,data:s,dataUpdatedAt:m.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:S,isRefetching:S&&!R,isLoadingError:T&&!O,isPaused:"paused"===m.fetchStatus,isPlaceholderData:v,isRefetchError:T&&O,isStale:f(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==(0,l.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==C.data,s="error"===C.status&&!t,i=e=>{s?e.reject(C.error):t&&e.resolve(C.data)},n=()=>{i(this.#v=C.promise=(0,o.pendingThenable)())},a=this.#v;switch(a.status){case"pending":e.queryHash===r.queryHash&&i(a);break;case"fulfilled":(s||C.data!==a.value)&&n();break;case"rejected":s&&C.error===a.reason||n()}}return C}updateResult(){let e=this.#x,t=this.createResult(this.#b,this.options);if(this.#w=this.#b.state,this.#S=this.options,void 0!==this.#w.data&&(this.#j=this.#b),(0,l.shallowEqualObjects)(t,e))return;this.#x=t;let s=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,s="function"==typeof t?t():t;if("all"===s||!s&&!this.#I.size)return!0;let r=new Set(s??this.#I);return this.options.throwOnError&&r.add("error"),Object.keys(this.#x).some(t=>this.#x[t]!==e[t]&&r.has(t))};this.#N({listeners:s()})}#D(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#b)return;let t=this.#b;this.#b=e,this.#g=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#Q()}#N(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#x)}),this.#c.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function h(e,t){return!1!==(0,l.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&d(e,t,t.refetchOnMount)}function d(e,t,s){if(!1!==(0,l.resolveEnabled)(t.enabled,e)&&"static"!==(0,l.resolveStaleTime)(t.staleTime,e)){let r="function"==typeof s?s(e):s;return"always"===r||!1!==r&&f(e,t)}return!1}function p(e,t,s,r){return(e!==t||!1===(0,l.resolveEnabled)(r.enabled,e))&&(!s.suspense||"error"!==e.state.status)&&f(e,s)}function f(e,t){return!1!==(0,l.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,l.resolveStaleTime)(t.staleTime,e))}e.i(44172);var y=e.i(79054),m=e.i(34682);e.i(20314);var v=y.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),b=y.createContext(!1);b.Provider;var g=(e,t,s)=>t.fetchOptimistic(e).catch(()=>{s.clearReset()});function x(e,t){return function(e,t,s){let n,a=y.useContext(b),o=y.useContext(v),u=(0,m.useQueryClient)(s),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let h=u.getQueryCache().get(c.queryHash);if(c._optimisticResults=a?"isRestoring":"optimistic",c.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=c.staleTime;c.staleTime="function"==typeof t?(...s)=>e(t(...s)):e(t),"number"==typeof c.gcTime&&(c.gcTime=Math.max(c.gcTime,1e3))}n=h?.state.error&&"function"==typeof c.throwOnError?(0,l.shouldThrowError)(c.throwOnError,[h.state.error,h]):c.throwOnError,(c.suspense||c.experimental_prefetchInRender||n)&&!o.isReset()&&(c.retryOnMount=!1),y.useEffect(()=>{o.clearReset()},[o]);let d=!u.getQueryCache().get(c.queryHash),[p]=y.useState(()=>new t(u,c)),f=p.getOptimisticResult(c),x=!a&&!1!==e.subscribed;if(y.useSyncExternalStore(y.useCallback(e=>{let t=x?p.subscribe(i.notifyManager.batchCalls(e)):l.noop;return p.updateResult(),t},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),y.useEffect(()=>{p.setOptions(c)},[c,p]),c?.suspense&&f.isPending)throw g(c,p,o);if((({result:e,errorResetBoundary:t,throwOnError:s,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&void 0===e.data||(0,l.shouldThrowError)(s,[e.error,r])))({result:f,errorResetBoundary:o,throwOnError:c.throwOnError,query:h,suspense:c.suspense}))throw f.error;if(u.getDefaultOptions().queries?._experimental_afterQuery?.(c,f),c.experimental_prefetchInRender&&!r.environmentManager.isServer()&&f.isLoading&&f.isFetching&&!a){let e=d?g(c,p,o):h?.promise;e?.catch(l.noop).finally(()=>{p.updateResult()})}return c.notifyOnChangeProps?f:p.trackResult(f)}(e,c,t)}e.s(["useQuery",()=>x],62885)}]);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,3214,e=>{"use strict";let t=(0,e.i(3645).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",()=>t],3214)},80986,e=>{"use strict";let t=(0,e.i(3645).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);e.s(["default",()=>t])},54277,30090,e=>{"use strict";let t=(0,e.i(3645).default)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s(["default",()=>t],30090),e.s(["CircleX",()=>t],54277)},34119,94819,e=>{"use strict";var t=e.i(80986);e.s(["CircleCheck",()=>t.default],34119);let r=(0,e.i(3645).default)("ban",[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Ban",()=>r],94819)},57779,80554,e=>{"use strict";var t=e.i(20314);function r({status:e,className:r=""}){return"idle"===e?null:(0,t.jsx)("span",{className:`absolute -top-0.5 -right-0.5 block rounded-full ${"awaiting_input"===e?"h-2.5 w-2.5 animate-pulse bg-amber-500":"processing"===e?"h-2.5 w-2.5 animate-pulse bg-blue-500":"h-2 w-2 bg-green-500"} ${r}`})}e.s(["ChatDotIndicator",()=>r],57779);var i=e.i(79054),n=e.i(62885);let a=(0,i.createContext)({getStatus:()=>"idle"});function s({children:e}){let r=function(){let{data:e}=(0,n.useQuery)({queryKey:["turn-statuses"],queryFn:async()=>{let e=await fetch("/api/interactive/chat/turn-statuses");return e.ok?e.json():{}},refetchInterval:2e3});return e??{}}(),s=(0,i.useMemo)(()=>({getStatus:e=>r[e]??"idle"}),[r]);return(0,t.jsx)(a.Provider,{value:s,children:e})}function l(e){return(0,i.useContext)(a).getStatus(e)}e.s(["TurnStatusesProvider",()=>s,"useTurnStatus",()=>l],80554)},79687,e=>{"use strict";var t=e.i(14748);e.s(["AlertCircle",()=>t.default])},39443,e=>{"use strict";var t=e.i(20314),r=e.i(79054);let i=(0,e.i(18354).createLogger)("[SSE]");function n(e,t,r,i){if("u"<typeof EventSource)return()=>{};let n=null,a=!1,s=1e3,l=null,o=null;return!function u(){a||(n=new EventSource(e?`/api/agent-events?runId=${encodeURIComponent(e)}`:"/api/agent-events"),i("connecting"),n.onopen=()=>{i("connected"),o=setTimeout(()=>{o=null,s=1e3},5e3)},n.onerror=()=>{n?.close(),n=null,i("disconnected"),null!==o&&(clearTimeout(o),o=null);let e=s;s=Math.min(2*e,3e4),l=setTimeout(()=>{l=null,u()},e)},n.addEventListener("notification",e=>{let i=JSON.parse(e.data);t(e=>{let t=[...e,i];return t.length>500?t.slice(-250):t}),r(i)}))}(),()=>{a=!0,null!==l&&(clearTimeout(l),l=null),null!==o&&(clearTimeout(o),o=null),n&&(n.close(),n=null)}}let a=(0,r.createContext)(null);function s({children:e,runId:s}){let{events:l,lastEvent:o,connectionStatus:u}=function(e){let[t,a]=(0,r.useState)([]),[s,l]=(0,r.useState)(null),[o,u]=(0,r.useState)("disconnected"),c=e?.runId,d=(0,r.useRef)(null),f=(0,r.useCallback)(e=>{let t=e.data;if(t&&"object"==typeof t)if("notification"===t.type){let e=t.data;i.debug("event received:",e.eventType,e),a(t=>{let r=[...t,e];return r.length>500?r.slice(-250):r}),l(e)}else"status"===t.type&&u(t.status)},[]);return(0,r.useEffect)(()=>{let e="u">typeof location&&new URLSearchParams(location.search).has("sse");if(!navigator.serviceWorker||e)return n(c,a,l,u);let t=!1,r={current:void 0};function i(e){t||(d.current=e,e.postMessage({type:"subscribe",runId:c}),u("connecting"))}function s(){if(t)return;let e=navigator.serviceWorker.controller;e&&(d.current=e,e.postMessage({type:"subscribe",runId:c}),u("connecting"))}return navigator.serviceWorker.addEventListener("message",f),navigator.serviceWorker.addEventListener("controllerchange",s),navigator.serviceWorker.register("/agent-events-sw.js",{scope:"/"}).then(e=>{if(t)return;let s=e.active??e.installing??e.waiting;if(!s){r.current=n(c,a,l,u);return}if("activated"===s.state)i(s);else{let e=()=>{"activated"===s.state&&(s.removeEventListener("statechange",e),i(s))};s.addEventListener("statechange",e)}}).catch(()=>{t||(r.current=n(c,a,l,u))}),()=>{t=!0,navigator.serviceWorker.removeEventListener("message",f),navigator.serviceWorker.removeEventListener("controllerchange",s),d.current?.postMessage({type:"unsubscribe"}),d.current=null,r.current?.()}},[c,f]),{events:t,lastEvent:s,connectionStatus:o}}({runId:s}),c=(0,r.useMemo)(()=>({events:l,lastEvent:o,connectionStatus:u}),[l,o,u]);return(0,t.jsx)(a.Provider,{value:c,children:e})}function l(){let e=(0,r.useContext)(a);if(!e)throw Error("useAgentEventsContext must be used within an <AgentEventsProvider>");return e}e.s(["AgentEventsProvider",()=>s,"useAgentEventsContext",()=>l],39443)},81846,e=>{"use strict";var t=e.i(20314),r=e.i(94237),i=e.i(31777);let n=(0,r.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function a({className:e,variant:r,...a}){return(0,t.jsx)("div",{className:(0,i.cn)(n({variant:r}),e),...a})}e.s(["Badge",()=>a])},19933,e=>{"use strict";let t=(0,e.i(3645).default)("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);e.s(["FolderOpen",()=>t],19933)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},53360,e=>{"use strict";let t=(0,e.i(3645).default)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);e.s(["Zap",()=>t],53360)},55016,e=>{"use strict";let t=(0,e.i(3645).default)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);e.s(["Clock",()=>t],55016)},71326,e=>{"use strict";var t=e.i(20314),r=e.i(79054),i=e.i(22528),n=e.i(5978),a=e.i(567),s=e.i(91967),l=e.i(86874),o="AlertDialog",[u,c]=(0,i.createContextScope)(o,[a.createDialogScope]),d=(0,a.createDialogScope)(),f=e=>{let{__scopeAlertDialog:r,...i}=e,n=d(r);return(0,t.jsx)(a.Root,{...n,...i,modal:!0})};f.displayName=o;var p=r.forwardRef((e,r)=>{let{__scopeAlertDialog:i,...n}=e,s=d(i);return(0,t.jsx)(a.Trigger,{...s,...n,ref:r})});p.displayName="AlertDialogTrigger";var g=e=>{let{__scopeAlertDialog:r,...i}=e,n=d(r);return(0,t.jsx)(a.Portal,{...n,...i})};g.displayName="AlertDialogPortal";var h=r.forwardRef((e,r)=>{let{__scopeAlertDialog:i,...n}=e,s=d(i);return(0,t.jsx)(a.Overlay,{...s,...n,ref:r})});h.displayName="AlertDialogOverlay";var v="AlertDialogContent",[m,y]=u(v),x=(0,l.createSlottable)("AlertDialogContent"),b=r.forwardRef((e,i)=>{let{__scopeAlertDialog:l,children:o,...u}=e,c=d(l),f=r.useRef(null),p=(0,n.useComposedRefs)(i,f),g=r.useRef(null);return(0,t.jsx)(a.WarningProvider,{contentName:v,titleName:w,docsSlug:"alert-dialog",children:(0,t.jsx)(m,{scope:l,cancelRef:g,children:(0,t.jsxs)(a.Content,{role:"alertdialog",...c,...u,ref:p,onOpenAutoFocus:(0,s.composeEventHandlers)(u.onOpenAutoFocus,e=>{e.preventDefault(),g.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,t.jsx)(x,{children:o}),(0,t.jsx)(T,{contentRef:f})]})})})});b.displayName=v;var w="AlertDialogTitle",C=r.forwardRef((e,r)=>{let{__scopeAlertDialog:i,...n}=e,s=d(i);return(0,t.jsx)(a.Title,{...s,...n,ref:r})});C.displayName=w;var k="AlertDialogDescription",A=r.forwardRef((e,r)=>{let{__scopeAlertDialog:i,...n}=e,s=d(i);return(0,t.jsx)(a.Description,{...s,...n,ref:r})});A.displayName=k;var D=r.forwardRef((e,r)=>{let{__scopeAlertDialog:i,...n}=e,s=d(i);return(0,t.jsx)(a.Close,{...s,...n,ref:r})});D.displayName="AlertDialogAction";var R="AlertDialogCancel",j=r.forwardRef((e,r)=>{let{__scopeAlertDialog:i,...s}=e,{cancelRef:l}=y(R,i),o=d(i),u=(0,n.useComposedRefs)(r,l);return(0,t.jsx)(a.Close,{...o,...s,ref:u})});j.displayName=R;var T=({contentRef:e})=>{let t=`\`${v}\` requires a description for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
You can add a description to the \`${v}\` by passing a \`${k}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
4
|
-
|
|
5
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${v}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
6
|
-
|
|
7
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return r.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null};e.s(["Action",()=>D,"AlertDialog",()=>f,"AlertDialogAction",()=>D,"AlertDialogCancel",()=>j,"AlertDialogContent",()=>b,"AlertDialogDescription",()=>A,"AlertDialogOverlay",()=>h,"AlertDialogPortal",()=>g,"AlertDialogTitle",()=>C,"AlertDialogTrigger",()=>p,"Cancel",()=>j,"Content",()=>b,"Description",()=>A,"Overlay",()=>h,"Portal",()=>g,"Root",()=>f,"Title",()=>C,"Trigger",()=>p,"createAlertDialogScope",()=>c],28883);var S=e.i(28883),S=S,E=e.i(31777),M=e.i(35364);function P({...e}){return(0,t.jsx)(S.Root,{"data-slot":"alert-dialog",...e})}function N({...e}){return(0,t.jsx)(S.Portal,{"data-slot":"alert-dialog-portal",...e})}function z({className:e,onClick:r,...i}){return(0,t.jsx)(S.Overlay,{"data-slot":"alert-dialog-overlay",className:(0,E.cn)("fixed inset-0 z-50 bg-black/50",e),onClick:e=>{e.stopPropagation(),r?.(e)},...i})}function I({className:e,size:r="default",...i}){return(0,t.jsxs)(N,{children:[(0,t.jsx)(z,{}),(0,t.jsx)(S.Content,{"data-slot":"alert-dialog-content","data-size":r,className:(0,E.cn)("bg-background 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 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",e),...i})]})}function F({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,E.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-start sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...r})}function O({className:e,...r}){return(0,t.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,E.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",e),...r})}function L({className:e,...r}){return(0,t.jsx)(S.Title,{"data-slot":"alert-dialog-title",className:(0,E.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",e),...r})}function H({className:e,...r}){return(0,t.jsx)(S.Description,{"data-slot":"alert-dialog-description",className:(0,E.cn)("text-muted-foreground text-sm",e),...r})}function _({className:e,variant:r="default",size:i="default",...n}){return(0,t.jsx)(M.Button,{variant:r,size:i,asChild:!0,children:(0,t.jsx)(S.Action,{"data-slot":"alert-dialog-action",className:(0,E.cn)(e),...n})})}function G({className:e,variant:r="outline",size:i="default",...n}){return(0,t.jsx)(M.Button,{variant:r,size:i,asChild:!0,children:(0,t.jsx)(S.Cancel,{"data-slot":"alert-dialog-cancel",className:(0,E.cn)(e),...n})})}e.s(["AlertDialog",()=>P,"AlertDialogAction",()=>_,"AlertDialogCancel",()=>G,"AlertDialogContent",()=>I,"AlertDialogDescription",()=>H,"AlertDialogFooter",()=>O,"AlertDialogHeader",()=>F,"AlertDialogTitle",()=>L],71326)},30153,e=>{"use strict";var t=e.i(20314),r=e.i(79054),i=e.i(71326);let n=(0,r.createContext)(null);function a({children:e}){let a=(0,r.useRef)(null),s=(0,r.useRef)(null),[l,o]=(0,r.useState)(!1),u=(0,r.useCallback)(e=>{a.current=e},[]),c=(0,r.useCallback)(e=>{if(a.current?.isDirty){s.current=e,o(!0);return}e()},[]),d=(0,r.useCallback)(()=>{o(!1),a.current?.onReset(),a.current=null,s.current?.(),s.current=null},[]),f=(0,r.useCallback)(()=>{o(!1),s.current=null},[]),p=(0,r.useCallback)(()=>a.current?.isDirty??!1,[]);return(0,t.jsxs)(n,{value:{setGuard:u,guardedNavigate:c,getIsDirty:p},children:[e,(0,t.jsx)(i.AlertDialog,{open:l,children:(0,t.jsxs)(i.AlertDialogContent,{children:[(0,t.jsxs)(i.AlertDialogHeader,{children:[(0,t.jsx)(i.AlertDialogTitle,{children:"Discard unsaved changes?"}),(0,t.jsx)(i.AlertDialogDescription,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),(0,t.jsxs)(i.AlertDialogFooter,{children:[(0,t.jsx)(i.AlertDialogAction,{variant:"destructive",onClick:d,children:"Discard"}),(0,t.jsx)(i.AlertDialogCancel,{onClick:f,children:"Keep editing"})]})]})})]})}function s(){let e=(0,r.useContext)(n);if(!e)throw Error("useDrawerCloseGuard must be used within DrawerCloseGuardProvider");return e}function l({open:e,isDirty:t,onClose:i,onReset:n}){let{setGuard:a,guardedNavigate:l}=s();return(0,r.useEffect)(()=>(e?a({isDirty:t,onReset:n}):a(null),()=>a(null)),[e,t,n,a]),{attemptClose:(0,r.useCallback)(()=>{l(()=>{n(),i()})},[l,i,n])}}e.s(["DrawerCloseGuardProvider",()=>a,"useDrawerCloseGuard",()=>s,"useGuardedDrawerClose",()=>l])},48109,e=>{"use strict";let t=(0,e.i(3645).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",()=>t],48109)},32494,e=>{"use strict";let t=(0,e.i(3645).default)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);e.s(["Globe",()=>t],32494)},26370,48829,e=>{"use strict";var t=e.i(3645);let r=(0,t.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);e.s(["Bot",()=>r],26370);let i=(0,t.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);e.s(["ChevronUp",()=>i],48829)},68304,e=>{"use strict";var t=e.i(20314),r=e.i(79054),i=e.i(91967),n=e.i(22528),a=e.i(51080),s=e.i(85995),l=e.i(87620),o=e.i(66033),u=e.i(36589),c=e.i(13123),d="Tabs",[f,p]=(0,n.createContextScope)(d,[a.createRovingFocusGroupScope]),g=(0,a.createRovingFocusGroupScope)(),[h,v]=f(d),m=r.forwardRef((e,r)=>{let{__scopeTabs:i,value:n,onValueChange:a,defaultValue:s,orientation:f="horizontal",dir:p,activationMode:g="automatic",...v}=e,m=(0,o.useDirection)(p),[y,x]=(0,u.useControllableState)({prop:n,onChange:a,defaultProp:s??"",caller:d});return(0,t.jsx)(h,{scope:i,baseId:(0,c.useId)(),value:y,onValueChange:x,orientation:f,dir:m,activationMode:g,children:(0,t.jsx)(l.Primitive.div,{dir:m,"data-orientation":f,...v,ref:r})})});m.displayName=d;var y="TabsList",x=r.forwardRef((e,r)=>{let{__scopeTabs:i,loop:n=!0,...s}=e,o=v(y,i),u=g(i);return(0,t.jsx)(a.Root,{asChild:!0,...u,orientation:o.orientation,dir:o.dir,loop:n,children:(0,t.jsx)(l.Primitive.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:r})})});x.displayName=y;var b="TabsTrigger",w=r.forwardRef((e,r)=>{let{__scopeTabs:n,value:s,disabled:o=!1,...u}=e,c=v(b,n),d=g(n),f=A(c.baseId,s),p=D(c.baseId,s),h=s===c.value;return(0,t.jsx)(a.Item,{asChild:!0,...d,focusable:!o,active:h,children:(0,t.jsx)(l.Primitive.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":p,"data-state":h?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...u,ref:r,onMouseDown:(0,i.composeEventHandlers)(e.onMouseDown,e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(s)}),onKeyDown:(0,i.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(s)}),onFocus:(0,i.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;h||o||!e||c.onValueChange(s)})})})});w.displayName=b;var C="TabsContent",k=r.forwardRef((e,i)=>{let{__scopeTabs:n,value:a,forceMount:o,children:u,...c}=e,d=v(C,n),f=A(d.baseId,a),p=D(d.baseId,a),g=a===d.value,h=r.useRef(g);return r.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(s.Presence,{present:o||g,children:({present:r})=>(0,t.jsx)(l.Primitive.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!r,id:p,tabIndex:0,...c,ref:i,style:{...e.style,animationDuration:h.current?"0s":void 0},children:r&&u})})});function A(e,t){return`${e}-trigger-${t}`}function D(e,t){return`${e}-content-${t}`}k.displayName=C,e.s(["Content",()=>k,"List",()=>x,"Root",()=>m,"Tabs",()=>m,"TabsContent",()=>k,"TabsList",()=>x,"TabsTrigger",()=>w,"Trigger",()=>w,"createTabsScope",()=>p],43133);var R=e.i(43133),R=R,j=e.i(31777);let T=R.Root,S=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(R.List,{ref:i,className:(0,j.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...r}));S.displayName=R.List.displayName;let E=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(R.Trigger,{ref:i,className:(0,j.cn)("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap transition-all focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow",e),...r}));E.displayName=R.Trigger.displayName;let M=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(R.Content,{ref:i,className:(0,j.cn)("ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",e),...r}));M.displayName=R.Content.displayName,e.s(["Tabs",()=>T,"TabsContent",()=>M,"TabsList",()=>S,"TabsTrigger",()=>E],68304)},51080,e=>{"use strict";var t=e.i(79054),r=e.i(91967),i=e.i(87342),n=e.i(5978),a=e.i(22528),s=e.i(13123),l=e.i(87620),o=e.i(29297),u=e.i(36589),c=e.i(66033),d=e.i(20314),f="rovingFocusGroup.onEntryFocus",p={bubbles:!1,cancelable:!0},g="RovingFocusGroup",[h,v,m]=(0,i.createCollection)(g),[y,x]=(0,a.createContextScope)(g,[m]),[b,w]=y(g),C=t.forwardRef((e,t)=>(0,d.jsx)(h.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(h.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(k,{...e,ref:t})})}));C.displayName=g;var k=t.forwardRef((e,i)=>{let{__scopeRovingFocusGroup:a,orientation:s,loop:h=!1,dir:m,currentTabStopId:y,defaultCurrentTabStopId:x,onCurrentTabStopIdChange:w,onEntryFocus:C,preventScrollOnEntryFocus:k=!1,...A}=e,D=t.useRef(null),R=(0,n.useComposedRefs)(i,D),T=(0,c.useDirection)(m),[S,E]=(0,u.useControllableState)({prop:y,defaultProp:x??null,onChange:w,caller:g}),[M,P]=t.useState(!1),N=(0,o.useCallbackRef)(C),z=v(a),I=t.useRef(!1),[F,O]=t.useState(0);return t.useEffect(()=>{let e=D.current;if(e)return e.addEventListener(f,N),()=>e.removeEventListener(f,N)},[N]),(0,d.jsx)(b,{scope:a,orientation:s,dir:T,loop:h,currentTabStopId:S,onItemFocus:t.useCallback(e=>E(e),[E]),onItemShiftTab:t.useCallback(()=>P(!0),[]),onFocusableItemAdd:t.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>O(e=>e-1),[]),children:(0,d.jsx)(l.Primitive.div,{tabIndex:M||0===F?-1:0,"data-orientation":s,...A,ref:R,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{I.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!I.current;if(e.target===e.currentTarget&&t&&!M){let t=new CustomEvent(f,p);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=z().filter(e=>e.focusable);j([e.find(e=>e.active),e.find(e=>e.id===S),...e].filter(Boolean).map(e=>e.ref.current),k)}}I.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>P(!1))})})}),A="RovingFocusGroupItem",D=t.forwardRef((e,i)=>{let{__scopeRovingFocusGroup:n,focusable:a=!0,active:o=!1,tabStopId:u,children:c,...f}=e,p=(0,s.useId)(),g=u||p,m=w(A,n),y=m.currentTabStopId===g,x=v(n),{onFocusableItemAdd:b,onFocusableItemRemove:C,currentTabStopId:k}=m;return t.useEffect(()=>{if(a)return b(),()=>C()},[a,b,C]),(0,d.jsx)(h.ItemSlot,{scope:n,id:g,focusable:a,active:o,children:(0,d.jsx)(l.Primitive.span,{tabIndex:y?0:-1,"data-orientation":m.orientation,...f,ref:i,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{a?m.onItemFocus(g):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>m.onItemFocus(g)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var i;let n=(i=e.key,"rtl"!==r?i:"ArrowLeft"===i?"ArrowRight":"ArrowRight"===i?"ArrowLeft":i);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return R[n]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=x().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){var r,i;"prev"===t&&n.reverse();let a=n.indexOf(e.currentTarget);n=m.loop?(r=n,i=a+1,r.map((e,t)=>r[(i+t)%r.length])):n.slice(a+1)}setTimeout(()=>j(n))}}),children:"function"==typeof c?c({isCurrentTabStop:y,hasTabStop:null!=k}):c})})});D.displayName=A;var R={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function j(e,t=!1){let r=document.activeElement;for(let i of e)if(i===r||(i.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",()=>D,"Root",()=>C,"createRovingFocusGroupScope",()=>x])},66033,e=>{"use strict";var t=e.i(79054),r=e.i(20314),i=t.createContext(void 0),n=e=>{let{dir:t,children:n}=e;return(0,r.jsx)(i.Provider,{value:t,children:n})};function a(e){let r=t.useContext(i);return e||r||"ltr"}e.s(["DirectionProvider",()=>n,"Provider",()=>n,"useDirection",()=>a])},80764,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return n}});let i=e.r(79054);function n(e,t){let r=(0,i.useRef)(null),n=(0,i.useRef)(null);return(0,i.useCallback)(i=>{if(null===i){let e=r.current;e&&(r.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(r.current=a(e,i)),t&&(n.current=a(t,i))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),i=e.i(5978),n=e.i(86874),a=e.i(20314);function s(e){let s=e+"CollectionProvider",[l,o]=(0,r.createContextScope)(s),[u,c]=l(s,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:i}=e,n=t.default.useRef(null),s=t.default.useRef(new Map).current;return(0,a.jsx)(u,{scope:r,itemMap:s,collectionRef:n,children:i})};d.displayName=s;let f=e+"CollectionSlot",p=(0,n.createSlot)(f),g=t.default.forwardRef((e,t)=>{let{scope:r,children:n}=e,s=c(f,r),l=(0,i.useComposedRefs)(t,s.collectionRef);return(0,a.jsx)(p,{ref:l,children:n})});g.displayName=f;let h=e+"CollectionItemSlot",v="data-radix-collection-item",m=(0,n.createSlot)(h),y=t.default.forwardRef((e,r)=>{let{scope:n,children:s,...l}=e,o=t.default.useRef(null),u=(0,i.useComposedRefs)(r,o),d=c(h,n);return t.default.useEffect(()=>(d.itemMap.set(o,{ref:o,...l}),()=>void d.itemMap.delete(o))),(0,a.jsx)(m,{...{[v]:""},ref:u,children:s})});return y.displayName=h,[{Provider:d,Slot:g,ItemSlot:y},function(r){let i=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=i.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(i.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[i.collectionRef,i.itemMap])},o]}var l=new WeakMap;function o(e,t){var r,i;let n,a,s;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let l=(r=e,i=t,n=r.length,(s=(a=u(i))>=0?a:n+a)<0||s>=n?-1:s);return -1===l?void 0:e[l]}function u(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],l.set(this,!0)}set(e,t){return l.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let i,n=this.has(t),a=this.#e.length,s=u(e),l=s>=0?s:a+s,o=l<0||l>=a?-1:l;if(o===this.size||n&&o===this.size-1||-1===o)return this.set(t,r),this;let c=this.size+ +!n;s<0&&l++;let d=[...this.#e],f=!1;for(let e=l;e<c;e++)if(l===e){let a=d[e];d[e]===t&&(a=d[e+1]),n&&this.delete(t),i=this.get(a),this.set(t,r)}else{f||d[e-1]!==t||(f=!0);let r=d[f?e:e-1],n=i;i=this.get(r),this.delete(r),this.set(r,n)}return this}with(t,r,i){let n=new e(this);return n.insert(t,r,i),n}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let i=this.#e.indexOf(e);return -1===i?this:this.insert(i,t,r)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,r){let i=this.#e.indexOf(e);return -1===i?this:this.insert(i+1,t,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=o(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=o(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return o(this.#e,e)}from(e,t){let r=this.indexOf(e);if(-1===r)return;let i=r+t;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.at(i)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let i=r+t;return i<0&&(i=0),i>=this.size&&(i=this.size-1),this.keyAt(i)}find(e,t){let r=0;for(let i of this){if(Reflect.apply(e,t,[i,r,this]))return i;r++}}findIndex(e,t){let r=0;for(let i of this){if(Reflect.apply(e,t,[i,r,this]))return r;r++}return -1}filter(t,r){let i=[],n=0;for(let e of this)Reflect.apply(t,r,[e,n,this])&&i.push(e),n++;return new e(i)}map(t,r){let i=[],n=0;for(let e of this)i.push([e[0],Reflect.apply(t,r,[e,n,this])]),n++;return new e(i)}reduce(...e){let[t,r]=e,i=0,n=r??this.at(0);for(let r of this)n=0===i&&1===e.length?r:Reflect.apply(t,this,[n,r,i,this]),i++;return n}reduceRight(...e){let[t,r]=e,i=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let n=this.at(r);i=r===this.size-1&&1===e.length?n:Reflect.apply(t,this,[i,n,r,this])}return i}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),i=this.get(r);t.set(r,i)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let i=new e,n=this.size-1;if(void 0===t)return i;t<0&&(t+=this.size),void 0!==r&&r>0&&(n=r-1);for(let e=t;e<=n;e++){let t=this.keyAt(e),r=this.get(t);i.set(t,r)}return i}every(e,t){let r=0;for(let i of this){if(!Reflect.apply(e,t,[i,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let i of this){if(Reflect.apply(e,t,[i,r,this]))return!0;r++}return!1}}),e.s(["createCollection",()=>s])},39200,e=>{"use strict";let t=(0,e.i(3645).default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Settings",()=>t],39200)}]);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,36986,e=>{"use strict";var t=e.i(20314),s=e.i(79054),a=e.i(31777);e.i(41001);var r=e.i(64780),n=e.i(31406),l=e.i(60112),i=e.i(83428),o=e.i(67669),d=e.i(24042),c=e.i(6910),u=e.i(33548),x=e.i(23925),m=e.i(37260),p=e.i(83299),h=e.i(21023);let f=(0,h.createServerReference)("601f8149b6a3cefafdb6a0fdf663945834e45c13b8",h.callServer,void 0,h.findSourceMapURL,"approveFeature");var g=e.i(10120),b=e.i(47347),j=e.i(61911);let v=(0,h.createServerReference)("705373258ab7ae5454cf4d012ed380b8f03e633e13",h.callServer,void 0,h.findSourceMapURL,"rejectFeature"),y=(0,h.createServerReference)("40cfd7a9e9835cdc067f1ef6a9ebabad4dd1474036",h.callServer,void 0,h.findSourceMapURL,"getFeatureArtifact"),N=(0,h.createServerReference)("40c1f2bc40f47326bf6026e4e06aef2f3fcae9d1f2",h.callServer,void 0,h.findSourceMapURL,"getResearchArtifact"),w=(0,h.createServerReference)("400043307add700a310caa62c59d8aa6d5711f1f1d",h.callServer,void 0,h.findSourceMapURL,"getMergeReviewData");var k=e.i(75921),C=e.i(8361),T=e.i(30153),S=e.i(8537),M=e.i(39443);e.i(1650);var R=e.i(11495);e.i(99348);var I=e.i(5259),P=e.i(2828);e.i(31566);var A=e.i(65104),z=e.i(8986),$=e.i(38573),E=e.i(19933),D=e.i(70471),L=e.i(51251);let F="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40";function q({loading:e,error:s,icon:a}){return e?(0,t.jsx)(i.Loader2,{className:"size-3.5 animate-spin"}):s?(0,t.jsx)(L.CircleAlert,{className:"text-destructive size-3.5"}):(0,t.jsx)(a,{className:"size-4"})}function O({actions:e,repositoryPath:a,worktreePath:r,showSpecs:n}){let[l,i]=(0,s.useState)(!1);return(0,t.jsx)(P.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:e.openInIde,disabled:e.ideLoading,"aria-label":"Open in IDE",children:(0,t.jsx)(q,{loading:e.ideLoading,error:e.ideError,icon:z.Code2})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:e.openInShell,disabled:e.shellLoading,"aria-label":"Open terminal",children:(0,t.jsx)(q,{loading:e.shellLoading,error:e.shellError,icon:$.Terminal})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:e.openFolder,disabled:e.folderLoading,"aria-label":"Open folder",children:(0,t.jsx)(q,{loading:e.folderLoading,error:e.folderError,icon:E.FolderOpen})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),n?(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:e.openSpecsFolder,disabled:e.specsLoading,"aria-label":"Open specs",children:(0,t.jsx)(q,{loading:e.specsLoading,error:e.specsError,icon:D.FileText})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:"Open specs"})]}):null,(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",className:F,onClick:()=>{navigator.clipboard.writeText(r??a),i(!0),setTimeout(()=>i(!1),2e3)},"aria-label":"Copy path",children:l?(0,t.jsx)(x.Check,{className:"size-3.5 text-green-500"}):(0,t.jsx)(u.Copy,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:l?"Copied!":"Copy path"})]})]})})}var B=e.i(79687),U=e.i(16489),V=e.i(74294),W=e.i(3645);let H=(0,W.default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),G=(0,W.default)("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),_=(0,W.default)("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"}]]);var K=e.i(18532),Z=e.i(93192);let Q=(0,W.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var J=e.i(48109),X=e.i(38227),Y=e.i(53360);let ee=(0,W.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);var et=e.i(68304);let es=(0,h.createServerReference)("408b12f5789c9143769c5c6eaeb9a0b828d63414cf",h.callServer,void 0,h.findSourceMapURL,"getFeaturePhaseTimings"),ea=(0,h.createServerReference)("40df7933f40495cf8b904fe5f04bd66e0e9924848d",h.callServer,void 0,h.findSourceMapURL,"getFeaturePlan");e.i(47506);var er=e.i(2929);let en=(0,e.i(94237).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),el=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function ei({className:e,size:s="md",duration:r=5,...n}){return(0,t.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,a.cn)(en({size:s}),e),...n,children:[(0,t.jsx)("defs",{children:(0,t.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,t.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,t.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,t.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${r}s`,repeatCount:"indefinite"}),el.map(e=>(0,t.jsxs)("g",{children:[(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:e.spline,dur:"1s",repeatCount:"indefinite"}),(0,t.jsx)("circle",{cx:"50",cy:"18",r:e.r,fill:"currentColor",opacity:e.opacity})]},e.r)),(0,t.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,t.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,t.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}var eo=e.i(11345),ed=e.i(76016),ec=e.i(35364),eu=e.i(81846),ex=e.i(16868);let em=(0,W.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var ep=e.i(58481),eh=e.i(48306);e.i(50032);var ef=e.i(86254),eg=e.i(42076);let eb=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function ej({onReject:e,onApprove:n,approveLabel:l,approveVariant:i="default",revisionPlaceholder:o,isProcessing:d=!1,isRejecting:c=!1,children:u,chatInput:m,onChatInputChange:p}){let{t:h}=(0,r.useTranslation)("web"),f="warning"===i,g=f?ep.AlertTriangle:x.Check,b=f?"bg-orange-500/85":"bg-blue-500/85",[j,v]=(0,s.useState)(""),y=m??j,N=p??v,w=(0,C.useSoundAction)("approve"),k=d||c,[T,S]=(0,s.useState)([]),[M,R]=(0,s.useState)(!1),[I,A]=(0,s.useState)(null),[z,$]=(0,s.useState)(!1),[E,D]=(0,s.useState)(!1),[L,F]=(0,s.useState)(!1),q=y.trim().length>0,O=q?z||E&&L:!z,B=(0,s.useRef)(0),U=(0,s.useRef)(crypto.randomUUID()),V=(0,s.useRef)(null);(0,s.useEffect)(()=>{function e(e){("Control"===e.key||"Meta"===e.key)&&D(!0),"Shift"===e.key&&F(!0)}function t(e){("Control"===e.key||"Meta"===e.key)&&D(!1),"Shift"===e.key&&F(!1)}function s(){D(!1),F(!1)}return window.addEventListener("keydown",e),window.addEventListener("keyup",t),window.addEventListener("blur",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",t),window.removeEventListener("blur",s)}},[]);let W=(0,s.useCallback)(async e=>{for(let t of(A(null),e)){if(t.size>0xa00000)return void A(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!eb.has(e))return void A(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();S(s=>[...s,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let s=new FormData;s.append("file",t),s.append("sessionId",U.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:s});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));S(t=>t.filter(t=>t.id!==e)),A(t.error??"Upload failed");return}let r=await a.json();S(t=>t.some(t=>t.id!==e&&t.path===r.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...r,id:e,loading:!1}:t))}catch{S(t=>t.filter(t=>t.id!==e)),A("Upload failed")}}},[]),H=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current+=1,1===B.current&&R(!0)},[]),G=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current-=1,0===B.current&&R(!1)},[]),_=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),K=(0,s.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),B.current=0,R(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&W(t)},[W]),Z=(0,s.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let s=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&s.push(t)}s.length>0&&(e.preventDefault(),W(s))},[W]),Q=(0,s.useCallback)(async()=>{try{let e=await (0,eg.pickFiles)();e&&S(t=>{let s=new Set(t.map(e=>e.path)),a=e.filter(e=>!s.has(e.path)).map(e=>({id:crypto.randomUUID(),name:e.name,size:e.size,mimeType:"application/octet-stream",path:e.path}));return a.length>0?[...t,...a]:t})}catch{}},[]),J=(0,s.useCallback)(e=>{S(t=>t.filter(t=>t.id!==e))},[]),X=(0,s.useCallback)((e,t)=>{S(s=>s.map(s=>s.id===e?{...s,notes:t}:s))},[]),Y=(0,s.useCallback)(()=>{N(""),S([]),A(null)},[N]),ee=(0,s.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),V.current?.requestSubmit())},[]),et="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,t.jsxs)("div",{className:"border-border shrink-0 border-t",children:[u,e?(0,t.jsx)(P.TooltipProvider,{delayDuration:400,children:(0,t.jsx)("form",{ref:V,onSubmit:function(t){t.preventDefault();let s=y.trim();if(O)w.play(),n(),Y();else{if(!s||!e)return;e(s,T.filter(e=>!e.loading)),Y()}},className:"p-3",children:(0,t.jsx)("div",{role:"region","aria-label":h("createDrawer.fileDropZone"),"data-drag-over":M?"true":"false",onDragEnter:H,onDragLeave:G,onDragOver:_,onDrop:K,className:(0,a.cn)("rounded-md border-2 border-transparent transition-colors",M&&"border-primary/50 bg-primary/5"),children:(0,t.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,t.jsx)(eh.Textarea,{placeholder:o??"Ask AI to revise...","aria-label":o??"Ask AI to revise...",disabled:k,value:y,onChange:e=>N(e.target.value),onKeyDown:ee,onPaste:Z,rows:1,className:"max-h-[35dvh] min-h-9 flex-1 resize-none overflow-y-auto rounded-none border-0 py-2 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),T.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:T.map(e=>(0,t.jsx)(ef.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>J(e.id),disabled:k,loading:e.loading,notes:e.notes,onNotesChange:t=>X(e.id,t)},e.id))}),I?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:I}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,t.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[et,"+Enter"]})," ",q?"reject":"approve"]}),(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:Q,disabled:k,"aria-label":h("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(ex.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"top",children:h("chat.attachFiles")})]}),(0,t.jsx)("div",{onMouseLeave:()=>$(!1),children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"submit",disabled:k,"data-testid":"drawer-action-submit",className:(0,a.cn)("relative flex h-9 min-w-[12rem] cursor-pointer items-center overflow-hidden rounded-md border ps-4 pe-10 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",O?`${f?"border-orange-400/60":"border-blue-400/60"} text-white`:q&&E&&!L?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,t.jsx)("div",{className:(0,a.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",b),style:{transform:O?"translateX(0)":"translateX(100%)"}}),(0,t.jsxs)("span",{className:(0,a.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 pe-8 transition-opacity duration-300",O?"opacity-0":"opacity-100"),children:[(0,t.jsx)(em,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,t.jsxs)("span",{className:(0,a.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 text-white transition-opacity duration-300",O?"opacity-100":"opacity-0"),children:[(0,t.jsx)(g,{className:"h-4 w-4 shrink-0"}),l]}),(0,t.jsx)("span",{className:(0,a.cn)(`border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-e-[5px] border-s ${b} transition-opacity duration-300`,!q&&!z&&"pointer-events-none opacity-0"),onMouseEnter:()=>$(!0),children:(0,t.jsx)(eo.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),f?null:(0,t.jsx)(P.TooltipContent,{side:"top",children:O?l:h("drawerActionBar.sendRevisionFeedback")})]})})]})]})})})}):(0,t.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,t.jsx)(ec.Button,{type:"button",className:"flex-1",disabled:k,onClick:()=>{w.play(),n()},children:l})})]})}function ev({data:e,selections:r,onSelect:n,onApprove:l,onReject:i,isProcessing:o=!1,isRejecting:d=!1,showHeader:c=!1,chatInput:u,onChatInputChange:x}){let{question:m,context:p,questions:h,finalAction:f}=e,[g,b]=(0,s.useState)(0),j=(0,C.useSoundAction)("select"),v=(0,C.useSoundAction)("navigate"),y=h.length,N=g===y-1,w=h[g],k=(0,s.useMemo)(()=>Object.keys(r).length,[r]),T=(0,s.useCallback)((e,t)=>{j.play(),n(e,t),N||setTimeout(()=>b(e=>e+1),250)},[n,N,j]);return 0===y?null:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[c?(0,t.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:m}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:p})]})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsxs)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:[g+1,". ",w.question]}),(0,t.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:h.map((e,s)=>(0,t.jsx)("button",{type:"button","aria-label":`Go to question ${s+1}`,className:(0,a.cn)("h-1.5 rounded-full transition-all duration-200",s===g?"bg-primary w-4":"w-1.5",s!==g&&r[e.id]?"bg-primary/50":"",s===g||r[e.id]?"":"bg-muted-foreground/25"),onClick:()=>{v.play(),b(s)}},e.id))})]}),(0,t.jsx)("div",{className:"space-y-2",children:w.options.map((e,s)=>{let n=r[w.id]===e.id,l=String.fromCharCode(65+s);return(0,t.jsx)("button",{type:"button",className:(0,a.cn)("border-border w-full overflow-hidden rounded-md border px-3 py-3 text-start text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",n&&"border-primary bg-primary/5",e.isNew&&"animate-option-highlight"),disabled:o,onClick:()=>T(w.id,e.id),children:(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[l,"."]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("div",{className:"text-foreground mb-0.5 text-xs font-semibold wrap-break-word",children:e.label}),(0,t.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:e.rationale})]}),e.recommended||e.isNew?(0,t.jsx)("div",{className:"shrink-0 pt-0.5",children:e.recommended?(0,t.jsx)(eu.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,t.jsx)(eu.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] whitespace-nowrap text-white hover:bg-emerald-600/80",children:"New"})}):null]})},e.id)})})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,t.jsxs)(ec.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===g||o,onClick:()=>{v.play(),b(e=>e-1)},children:[(0,t.jsx)(eo.ChevronLeft,{className:"me-1 h-4 w-4"}),"Previous"]}),N?null:(0,t.jsxs)(ec.Button,{type:"button",variant:"ghost",size:"sm",disabled:o,onClick:()=>{v.play(),b(e=>e+1)},children:[r[w.id]?"Next":"Skip",(0,t.jsx)(ed.ChevronRight,{className:"ms-1 h-4 w-4"})]})]})]}),(0,t.jsx)(ej,{onReject:i,onApprove:()=>l(f.id),approveLabel:f.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:o,isRejecting:d,chatInput:u,onChatInputChange:x,children:(0,t.jsx)("div",{className:(0,a.cn)("bg-muted h-1.5 overflow-hidden",k>0&&k<y||o?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:o?(0,t.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,t.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${y>0?k/y*100:0}%`},"data-testid":"progress-bar"})})})]})}var ey=e.i(427);let eN=(0,W.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),ew={p:({children:e})=>(0,t.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:e}),strong:({children:e})=>(0,t.jsx)("strong",{className:"text-foreground font-semibold",children:e}),em:({children:e})=>(0,t.jsx)("em",{className:"italic",children:e}),code:({children:e,className:s})=>s?(0,t.jsx)("code",{className:`${s} text-[11px]`,children:e}):(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:e}),pre:({children:e})=>(0,t.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:e}),ul:({children:e})=>(0,t.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 ps-4 text-xs",children:e}),ol:({children:e})=>(0,t.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 ps-4 text-xs",children:e}),li:({children:e})=>(0,t.jsx)("li",{className:"leading-relaxed",children:e}),a:({children:e,href:s})=>(0,t.jsx)("a",{href:s,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:e})};function ek({decision:e,index:a}){let[r,n]=(0,s.useState)(!1),l=(0,C.useSoundAction)("expand"),i=(0,C.useSoundAction)("collapse");return(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:a+1}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.title}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:e.chosen})]})]}),"decisionName"in e&&e.decisionName?(0,t.jsx)(eu.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:e.decisionName}):null]}),e.rationale?(0,t.jsx)(ey.default,{components:ew,children:e.rationale}):null]}),e.rejected.length>0?(0,t.jsxs)("div",{className:"border-border border-t",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>{r?i.play():l.play(),n(e=>!e)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,t.jsx)(ed.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${r?"rotate-90":""}`}),(0,t.jsx)(ee,{className:"h-3.5 w-3.5"}),"Other Options Considered (",e.rejected.length,")"]}),r?(0,t.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:e.rejected.map(e=>(0,t.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,t.jsx)("span",{className:"text-foreground text-xs",children:e})},e))}):null]}):null]})}function eC({data:e}){let{summary:s,decisions:a}=e;return 0===a.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),s?(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s}):null]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,t.jsx)(eN,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),a.map((e,s)=>(0,t.jsx)(ek,{decision:e,index:s},e.title))]})}var eT=e.i(41698);function eS({item:e,index:s}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,t.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,t.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:s+1}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:e.question}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-muted-foreground min-w-0 truncate text-xs",children:e.selectedOption}),e.wasRecommended?(0,t.jsx)(eu.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function eM({data:e}){let{questions:s}=e;return 0===s.length?null:(0,t.jsxs)("div",{className:"space-y-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(eT.ClipboardList,{className:"text-primary h-4 w-4"}),(0,t.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),s.map((e,s)=>(0,t.jsx)(eS,{item:e,index:s},e.question))]})}var eR=e.i(30702);let eI=(0,W.default)("file-diff",[["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:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var eP=e.i(48923),eA=e.i(49228);let ez=(0,W.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),e$=(0,W.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]),eE=(0,W.default)("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var eD=e.i(81181),eL=e.i(99105),eF=e.i(35e3),eq=e.i(30090),eq=eq,eO=e.i(17406);function eB({status:e}){switch(e){case eO.CiStatus.Success:return(0,t.jsxs)(eu.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)(eF.CheckCircle2,{className:"me-1 h-3.5 w-3.5"}),"Passing"]});case eO.CiStatus.Pending:return(0,t.jsxs)(eu.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,t.jsx)(i.Loader2,{className:"me-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case eO.CiStatus.Failure:return(0,t.jsxs)(eu.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,t.jsx)(eq.default,{className:"me-1 h-3.5 w-3.5"}),"Failing"]})}}var eU=e.i(12919);let eV=(0,W.default)("file-minus",[["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 15h6",key:"cctwl0"}]]);var eW=e.i(35749);let eH={added:{icon:eU.FilePlus,label:"A",className:"text-green-600"},modified:{icon:eW.FileEdit,label:"M",className:"text-amber-600"},deleted:{icon:eV,label:"D",className:"text-red-600"},renamed:{icon:eW.FileEdit,label:"R",className:"text-blue-600"}};function eG({status:e}){let s=eH[e],r=s.icon;return(0,t.jsx)(r,{className:(0,a.cn)("h-3.5 w-3.5 shrink-0",s.className)})}function e_({hunk:e}){return(0,t.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,t.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:e.header}),(0,t.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:e.lines.map(e=>(0,t.jsxs)("div",{className:(0,a.cn)("flex","added"===e.type&&"bg-green-50 dark:bg-green-950/30","removed"===e.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:e.oldNumber??""}),(0,t.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:e.newNumber??""}),(0,t.jsx)("span",{className:(0,a.cn)("w-4 shrink-0 text-center select-none","added"===e.type&&"text-green-700 dark:text-green-400","removed"===e.type&&"text-red-700 dark:text-red-400"),children:"added"===e.type?"+":"removed"===e.type?"-":" "}),(0,t.jsx)("span",{className:"min-w-0 flex-1 pe-2 break-all whitespace-pre-wrap",children:e.content})]},`${e.type}-${e.oldNumber??""}-${e.newNumber??""}`))})]})}function eK({file:e}){let[r,n]=(0,s.useState)(!1),l=e.path.split("/").pop()??e.path,i=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,t.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>n(!r),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-start",children:[(0,t.jsx)(ed.ChevronRight,{className:(0,a.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",r&&"rotate-90")}),(0,t.jsx)(eG,{status:e.status}),(0,t.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("span",{className:"text-muted-foreground",children:[i,"/"]}),l]}):l}),e.oldPath?(0,t.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",e.oldPath.split("/").pop()]}):null,(0,t.jsxs)("span",{className:"shrink-0 text-[10px]",children:[e.additions>0?(0,t.jsxs)("span",{className:"text-green-600",children:["+",e.additions]}):null,e.additions>0&&e.deletions>0?" ":null,e.deletions>0?(0,t.jsxs)("span",{className:"text-red-600",children:["-",e.deletions]}):null]})]}),r&&e.hunks.length>0?(0,t.jsx)("div",{className:"border-border overflow-x-auto border-t",children:e.hunks.map(e=>(0,t.jsx)(e_,{hunk:e},e.header))}):null]})}function eZ({fileDiffs:e}){return 0===e.length?null:(0,t.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,t.jsx)(D.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",e.length,")"]})]})}),(0,t.jsx)("div",{className:"border-border border-t",children:e.map(e=>(0,t.jsx)(eK,{file:e},`${e.status}-${e.path}`))})]})}let eQ={Screenshot:e$,Video:eE,TestOutput:D.FileText,TerminalRecording:$.Terminal},eJ=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),eX=new Set([".mp4",".webm",".mov"]);function eY({evidence:e}){var a,r;let n,[l,i]=(0,s.useState)(!0),o=eQ[e.type]??e$,d=(n=(a=e.relativePath).lastIndexOf("."))>=0?a.slice(n).toLowerCase():"",c=(r=e.relativePath,`/api/evidence?path=${encodeURIComponent(r)}`),u="Screenshot"===e.type||eJ.has(d),x="Video"===e.type||eX.has(d),m="TestOutput"===e.type||"TerminalRecording"===e.type;return(0,t.jsxs)("li",{className:"border-border rounded-md border",children:[(0,t.jsxs)("button",{type:"button",onClick:()=>i(!l),className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-start",children:[l?(0,t.jsx)(eL.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,t.jsx)(ed.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)(o,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:e.description}),e.taskRef?(0,t.jsxs)("span",{className:"text-muted-foreground ms-1.5 text-[10px]",children:["(",e.taskRef,")"]}):null]}),(0,t.jsx)("a",{href:c,download:!0,onClick:e=>e.stopPropagation(),className:"text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors","aria-label":"Download",children:(0,t.jsx)(eD.Download,{className:"h-3 w-3"})})]}),l&&c?(0,t.jsx)("div",{className:"border-border border-t px-3 py-2.5",children:u?(0,t.jsx)("img",{src:c,alt:e.description,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}):x?(0,t.jsx)("video",{src:c,controls:!0,className:"max-h-80 w-full rounded-md border",preload:"metadata",children:(0,t.jsx)("track",{kind:"captions"})}):m?(0,t.jsx)(e0,{url:c}):(0,t.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:e.relativePath})}):null,null]})}function e0({url:e}){let[a,r]=(0,s.useState)(null),[n,l]=(0,s.useState)(!1);return n?a?(0,t.jsx)("pre",{className:"bg-muted/50 max-h-60 overflow-auto rounded-md p-3 font-mono text-[11px] leading-relaxed",children:a}):(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Unable to load preview"}):(fetch(e).then(e=>e.ok?e.text():Promise.reject(Error("Failed"))).then(e=>{let t=e.split("\n");r(t.length>100?`${t.slice(0,100).join("\n")}
|
|
2
|
-
...`:e)}).catch(()=>r(null)).finally(()=>l(!0)),(0,t.jsx)("div",{className:"bg-muted/50 h-16 animate-pulse rounded-md"}))}function e1({evidence:e}){return(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(e$,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,t.jsx)(eu.Badge,{variant:"secondary",className:"text-[10px]",children:e.length})]}),(0,t.jsx)("ul",{className:"space-y-2",children:e.map(e=>(0,t.jsx)(eY,{evidence:e},`${e.type}-${e.relativePath}`))})]})})}function e2({data:e,readOnly:s=!1,onApprove:a,onReject:r,isProcessing:n=!1,isRejecting:l=!1,chatInput:i,onChatInputChange:o}){let{pr:d,diffSummary:c,fileDiffs:u,branch:x,warning:m,evidence:p,hideCiStatus:h}=e,f=d?.mergeable===!1,g=f&&r?()=>r("Resolve merge conflicts",[]):a;return(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("h2",{className:"text-foreground text-sm font-bold",children:s?"Merge History":"Merge Review"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:s?"This feature was merged. Review the pull request details and evidence below.":d?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),x?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(eA.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)(eu.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:x.source}),(0,t.jsx)(ez,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,t.jsx)(eu.Badge,{variant:"outline",className:"font-mono text-[11px]",children:x.target})]})}):null,d?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("a",{href:d.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",d.number,(0,t.jsx)(eR.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,t.jsx)(eu.Badge,{variant:"outline",className:"text-xs",children:d.status})]}),!1===d.mergeable?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,t.jsxs)(eu.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,t.jsx)(ep.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,d.ciStatus&&!0!==h?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,t.jsx)(eB,{status:d.ciStatus})]}):null,d.commitHash?(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(eP.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:d.commitHash.slice(0,7)})]})]}):null]})}):null,c?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,t.jsx)(eI,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,t.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.filesChanged}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",c.additions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",c.deletions]}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-foreground text-sm font-bold",children:c.commitCount}),(0,t.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):m?(0,t.jsx)("div",{className:"border-border rounded-lg border",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,t.jsx)(ep.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:m})]})}):null,p&&p.length>0?(0,t.jsx)(e1,{evidence:p}):null,u&&u.length>0?(0,t.jsx)(eZ,{fileDiffs:u}):null]}),!s&&(0,t.jsx)(ej,{onReject:r,onApprove:g,approveLabel:f?"Resolve Conflicts":"Approve Merge",approveVariant:f?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:n,isRejecting:l,chatInput:i,onChatInputChange:o})]})}var e5=e.i(55016);let e3=(0,W.default)("file-search",[["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"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]),e4=(0,W.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var e6=e.i(59311),e8=e.i(39200);let e9=(0,W.default)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var e7=e.i(60253),te=e.i(2287),tt=e.i(28267),ts=e.i(80436);let ta=(0,W.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),tr=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function tn(e){let t=e.lastIndexOf(".");return t>=0&&tr.has(e.slice(t).toLowerCase())}function tl(e){let t=e.lastIndexOf(".")>=0?e.slice(e.lastIndexOf(".")):"",s=tn(e)?`image/${t.slice(1).replace("jpg","jpeg")}`:"",a=new URLSearchParams({path:e,...s&&{mimeType:s}});return`/api/attachments/preview?${a.toString()}`}let ti=/(?:^|\s)@(\/[^\s]+)/g;function to({text:e,attachmentPaths:s}){let a=function(e){let t=[],s=0;for(let a of e.matchAll(ti)){let r=a.index,n=r+(a[0].length-a[0].trimStart().length);n>s&&t.push({type:"text",value:e.slice(s,n)}),t.push({type:"attachment",path:a[1]}),s=r+a[0].length}return s<e.length&&t.push({type:"text",value:e.slice(s)}),t}(e),r=a.some(e=>"attachment"===e.type),n=s?.filter(Boolean)??[];return r||0!==n.length?(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[a.map(e=>{if("text"===e.type){let s=e.value.trim();return s?(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:s},`text-${s.slice(0,40)}`):null}return(0,t.jsx)(td,{path:e.path},`att-${e.path}`)}),n.map(e=>(0,t.jsx)(td,{path:e},`extra-${e}`))]}):(0,t.jsx)("span",{className:"text-sm leading-relaxed",children:e})}function td({path:e}){let a=e.split("/").pop()??e,[r,n]=(0,s.useState)(!1);return tn(e)?r?(0,t.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,t.jsx)(ta,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:a})]}):(0,t.jsxs)(te.Dialog,{children:[(0,t.jsx)(te.DialogTrigger,{asChild:!0,children:(0,t.jsx)("img",{src:tl(e),alt:a,"data-testid":"inline-attachment-image",onError:()=>n(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,t.jsxs)(te.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,t.jsx)(tt.VisuallyHidden.Root,{children:(0,t.jsxs)(te.DialogTitle,{children:["Preview: ",a]})}),(0,t.jsx)("div",{className:"relative bg-black/90",children:(0,t.jsx)("img",{src:tl(e),alt:a,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,t.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,t.jsx)("span",{className:"truncate text-sm font-medium",children:a})}),(0,t.jsx)("a",{href:tl(e),download:a,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${a}`,children:(0,t.jsx)(ts.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,t.jsx)("a",{href:tl(e),download:a,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:a})}e.i(81803);var tc=e.i(72714),tu=e.i(41413),tx=e.i(86782),tm=e.i(29847);function tp(e){if(0===e)return"0s";let t=Math.floor(e/1e3);if(0===t)return"<1s";let s=Math.floor(t/3600),a=Math.floor(t%3600/60),r=t%60;return s>0?`${s}h ${a}m`:a>0?`${a}m ${r}s`:`${r}s`}let th=new Set(["pending","action-required","error"]);function tf(e){return e?.agentType?{agentType:e.agentType,modelId:e.modelId??""}:null}function tg({icon:e,title:s,children:a}){return(0,t.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,t.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,t.jsx)(e,{className:"size-4 opacity-50"}),s]}),a]})}function tb({children:e,className:s}){return(0,t.jsx)("div",{className:(0,a.cn)("bg-muted/60 rounded-md border border-transparent p-3",s),children:e})}function tj({label:e,children:s}){return(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:e}),(0,t.jsx)("span",{className:"text-sm leading-snug",children:s})]})}function tv({on:e,label:s}){return(0,t.jsxs)("span",{className:(0,a.cn)("inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium",e?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-foreground/[0.04] text-foreground/25"),children:[e?(0,t.jsx)(x.Check,{className:"size-3"}):(0,t.jsx)(e7.X,{className:"size-3"}),s]})}let ty={[eO.PrStatus.Open]:"text-blue-600 dark:text-blue-400",[eO.PrStatus.Merged]:"text-purple-600 dark:text-purple-400",[eO.PrStatus.Closed]:"text-red-600 dark:text-red-400"};function tN({data:e,pinnedConfig:r,syncStatus:n,syncLoading:l,syncError:i,onRefreshSync:o,onRebaseOnMain:d,rebaseLoading:c,rebaseError:u}){var x;let m,p,h,f,g,b,j="maintain"===e.lifecycle,v=function(e){let[t,a]=(0,s.useState)(null),r=(0,s.useRef)(null);return(0,s.useEffect)(()=>e?(a(tp(Math.max(0,Date.now()-e))),r.current=setInterval(()=>{a(tp(Math.max(0,Date.now()-e)))},1e3),()=>{r.current&&clearInterval(r.current)}):void a(null),[e]),t}("running"===e.state||"action-required"===e.state?e.startedAt:void 0),y=er.featureNodeStateConfig[e.state],N=!!e.summary&&!(e.userQuery&&e.summary?.trim()===e.userQuery.trim());return(0,t.jsxs)("div",{"data-testid":"feature-drawer-status",className:"pb-4",children:[!j&&e.progress>0?(0,t.jsx)("div",{"data-testid":"feature-drawer-progress",className:"px-3 pb-2",children:(0,t.jsx)("div",{className:"bg-foreground/[0.06] h-1.5 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:(0,a.cn)("h-full rounded-full transition-all",y.progressClass),style:{width:`${e.progress}%`}})})}):null,e.oneLiner||e.userQuery||N?(0,t.jsx)(tg,{icon:e4,title:"Description",children:(0,t.jsxs)(tb,{className:"flex flex-col gap-2",children:[e.oneLiner?(0,t.jsx)(tj,{label:"One-Liner",children:e.oneLiner}):null,e.userQuery?(0,t.jsx)(tj,{label:"Query",children:(0,t.jsx)(to,{text:e.userQuery})}):null,N?(0,t.jsx)(tj,{label:"Summary",children:(0,t.jsx)("span",{className:"leading-snug",children:e.summary})}):null]})}):null,e.pr?(0,t.jsx)(tg,{icon:eP.GitCommitHorizontal,title:"Pull Request",children:(0,t.jsx)(tb,{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("a",{href:e.pr.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1 text-sm font-semibold hover:underline",children:["#",e.pr.number," ",(0,t.jsx)(eR.ExternalLink,{className:"size-3"})]}),(0,t.jsx)("span",{className:(0,a.cn)("text-xs font-semibold",ty[e.pr.status]),children:e.pr.status}),!1===e.pr.mergeable?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-orange-600 dark:text-orange-400",children:[(0,t.jsx)(ep.AlertTriangle,{className:"size-3 shrink-0"})," Conflicts"]}):null,e.pr.ciStatus&&!0!==e.hideCiStatus?(0,t.jsx)(eB,{status:e.pr.ciStatus}):null,e.pr.commitHash?(0,t.jsx)("code",{className:"text-foreground/40 ml-auto font-mono text-[11px]",children:e.pr.commitHash.slice(0,7)}):null]})})}):null,(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pb-1",children:[e.branch?(0,t.jsx)(tb,{children:(0,t.jsxs)(tj,{label:"Branch",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)(eA.GitBranch,{className:"text-foreground/30 size-3 shrink-0"}),(0,t.jsx)("code",{className:"font-mono text-[11px]",children:e.branch})]}),e.baseBranch?(0,t.jsxs)("span",{className:"text-foreground/30 block text-[10px]",children:["from ",e.baseBranch]}):null]})}):null,e.agentType||e.modelId?(0,t.jsx)(tb,{children:(0,t.jsx)(tj,{label:"Agent",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[e.agentType?(m=(0,tx.getAgentTypeIcon)(e.agentType),(0,t.jsx)(m,{className:"size-3.5 shrink-0 opacity-50"})):null,e.agentType?(0,t.jsx)("span",{children:tx.agentTypeLabels[e.agentType]??e.agentType}):null,e.agentType&&e.modelId?(0,t.jsx)("span",{className:"text-foreground/20",children:"/"}):null,e.modelId?(0,t.jsx)("span",{className:"text-foreground/50 text-[12px]",children:(0,tm.getModelMeta)(e.modelId).displayName||e.modelId}):null]})})}):null,e.createdAt?(0,t.jsx)(tb,{children:(0,t.jsx)(tj,{label:"Created",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)(e5.Clock,{className:"text-foreground/30 size-3 shrink-0"}),(x=e.createdAt,p=Date.now(),(b=Math.floor((g=Math.floor((f=Math.floor((p-(h="string"==typeof x?new Date(x).getTime():x))/6e4))/60))/24))>30?new Date(h).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):b>0?`${b}d ago`:g>0?`${g}h ago`:f>0?`${f}m ago`:"just now")]})})}):null,e.fastMode?(0,t.jsx)(tb,{children:(0,t.jsx)(tj,{label:"Mode",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[(0,t.jsx)(Y.Zap,{className:"size-3.5"})," Fast"]})})}):null,e.runtime||v?(0,t.jsx)(tb,{children:(0,t.jsx)(tj,{label:e.runtime?"Runtime":"Elapsed",children:(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,t.jsx)(e5.Clock,{className:"text-foreground/30 size-3 shrink-0"}),e.runtime??v]})})}):null]}),e.blockedBy||e.errorMessage?(0,t.jsx)(tg,{icon:ep.AlertTriangle,title:"Issues",children:(0,t.jsxs)(tb,{className:"border-destructive/20 bg-destructive/5",children:[e.blockedBy?(0,t.jsx)(tj,{label:"Blocked By",children:e.blockedBy}):null,e.errorMessage?(0,t.jsx)(tj,{label:"Error",children:(0,t.jsx)("span",{className:"text-destructive",children:e.errorMessage})}):null]})}):null,d&&e.branch&&o?(0,t.jsx)(tg,{icon:e6.RefreshCw,title:"Branch Sync",children:(0,t.jsx)(tw,{syncStatus:n??null,syncLoading:l??!1,syncError:i??null,onRefreshSync:o,onRebaseOnMain:d,rebaseLoading:c??!1,rebaseError:u??null})}):null,(0,t.jsx)(tC,{data:e,pinnedConfig:r})]})}function tw({syncStatus:e,syncLoading:s,syncError:n,onRefreshSync:l,onRebaseOnMain:i,rebaseLoading:o,rebaseError:d}){let{t:c}=(0,r.useTranslation)("web"),u=null!=e&&e.behind>0,x=e?.behind===0,m=e?.baseBranch??"main";return(0,t.jsxs)(tb,{children:[(0,t.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex items-center justify-between",children:[(0,t.jsx)("div",{className:"flex items-center gap-1.5 text-[13px]",children:s&&!e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{size:"sm"}),(0,t.jsx)("span",{className:"text-foreground/40",children:"Checking..."})]}):n?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ep.AlertTriangle,{className:"size-3.5 text-red-500"}),(0,t.jsx)("span",{className:"text-destructive text-xs",children:n})]}):o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei,{size:"sm"}),(0,t.jsxs)("span",{children:["Rebasing on ",(0,t.jsx)("code",{className:"font-mono text-[11px]",children:m}),"..."]})]}):u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ep.AlertTriangle,{className:"size-3.5 text-orange-500"}),(0,t.jsxs)("span",{children:[e.behind," behind ",(0,t.jsx)("code",{className:"font-mono text-[11px]",children:m}),e.ahead>0?(0,t.jsxs)("span",{className:"text-foreground/30 ml-1 text-[11px]",children:["· ",e.ahead," ahead"]}):null]})]}):x?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eF.CheckCircle2,{className:"size-3.5 text-green-500"}),(0,t.jsxs)("span",{children:["Up to date · ",(0,t.jsx)("code",{className:"font-mono text-[11px]",children:m}),e.ahead>0?(0,t.jsxs)("span",{className:"text-foreground/30 ml-1 text-[11px]",children:["· ",e.ahead," ahead"]}):null]})]}):null}),(e||n)&&!o?(0,t.jsx)("button",{onClick:l,disabled:s,className:"text-foreground/30 hover:text-foreground/60 hover:bg-foreground/5 inline-flex size-6 items-center justify-center rounded-sm disabled:opacity-50","aria-label":c("branchSyncStatus.refreshSyncStatus"),children:(0,t.jsx)(e6.RefreshCw,{className:(0,a.cn)("size-3",s&&"animate-spin")})}):null]}),u&&!o?(0,t.jsx)("div",{className:"pt-2",children:(0,t.jsx)(tc.ActionButton,{label:c("branchSyncStatus.rebaseOnMain"),onClick:i,loading:!1,error:!!d,icon:Q,variant:"outline",size:"sm"})}):null,d?(0,t.jsx)("p",{className:"text-destructive pt-1 text-[11px]",children:d}):null]})}function tk({pinnedConfig:e}){let s=(0,tx.getAgentTypeIcon)(e.agentType),a=e.modelId?(0,tm.getModelMeta)(e.modelId).displayName||e.modelId:"No model selected";return(0,t.jsxs)(tb,{"data-testid":"feature-pinned-config-card",className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsxs)("div",{className:"text-foreground/40 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,t.jsx)(e8.Settings,{className:"size-3"})," Pinned Execution"]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)(s,{className:"size-4 shrink-0 opacity-60"}),(0,t.jsx)("span",{className:"font-medium",children:tx.agentTypeLabels[e.agentType]??e.agentType}),(0,t.jsx)("span",{className:"text-foreground/20",children:"/"}),(0,t.jsx)("span",{className:"text-foreground/60",children:a})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Change the pinned agent and model before the next start, approval, or retry."})]}),(0,t.jsx)(tu.AgentModelPicker,{initialAgentType:e.agentType,initialModel:e.modelId,agentType:e.agentType,model:e.modelId,onSave:e.onSave,saveError:e.error,saving:e.saving,disabled:e.saving,mode:"settings"})]})}function tC({data:e,pinnedConfig:s}){var a;let r=null!=e.approvalGates||null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.enableEvidence||null!=e.forkAndPr||null!=e.commitSpecs,n=null!=s&&(a=e.state,th.has(a));return r||n?(0,t.jsx)(tg,{icon:e8.Settings,title:"Settings",children:(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[n?(0,t.jsx)(tk,{pinnedConfig:s}):null,r?(0,t.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[e.approvalGates?(0,t.jsxs)(tb,{children:[(0,t.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,t.jsx)(e9,{className:"size-3"})," Approve"]}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(tv,{on:e.approvalGates.allowPrd,label:"PRD"}),(0,t.jsx)(tv,{on:e.approvalGates.allowPlan,label:"Plan"}),(0,t.jsx)(tv,{on:e.approvalGates.allowMerge,label:"Merge"})]})]}):null,null!=e.enableEvidence?(0,t.jsxs)(tb,{children:[(0,t.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,t.jsx)(e3,{className:"size-3"})," Evidence"]}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)(tv,{on:e.enableEvidence,label:"Collect"}),null!=e.commitEvidence?(0,t.jsx)(tv,{on:e.commitEvidence,label:"Add to PR"}):null]})]}):null,null!=e.push||null!=e.openPr||null!=e.ciWatchEnabled||null!=e.commitSpecs||null!=e.forkAndPr?(0,t.jsxs)(tb,{children:[(0,t.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,t.jsx)(eA.GitBranch,{className:"size-3"})," Git"]}),(0,t.jsxs)("div",{className:"flex flex-col gap-0.5",children:[null!=e.push?(0,t.jsx)(tv,{on:e.push,label:"Push"}):null,null!=e.openPr?(0,t.jsx)(tv,{on:e.openPr,label:"PR"}):null,null!=e.ciWatchEnabled?(0,t.jsx)(tv,{on:e.ciWatchEnabled,label:"Watch"}):null,null!=e.commitSpecs?(0,t.jsx)(tv,{on:e.commitSpecs,label:"Specs"}):null,null!=e.forkAndPr?(0,t.jsx)(tv,{on:e.forkAndPr,label:"Fork"}):null]})]}):null]}):null]})}):null}let tT=(0,W.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var eq=eq,tS=e.i(94819),tM=e.i(58860);let tR=(0,W.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),tI=(0,W.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);function tP(e,t){if(null!=e.durationMs&&e.durationMs>0)return e.durationMs;if(!e.completedAt&&e.startedAt){let s=new Date(e.startedAt).getTime();if(!Number.isNaN(s))return Math.max(0,t-s)}return 0}function tA(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function tz(e){let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function t$(e){return e>=1?`$${e.toFixed(2)}`:e>=.01?`$${e.toFixed(3)}`:`$${e.toFixed(4)}`}let tE={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},tD={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:d.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:X.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:eF.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:eq.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:c.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:eq.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:tS.Ban}};function tL(e){return e.startsWith("run:")}function tF({timings:e,loading:a,error:n,rejectionFeedback:l}){let{t:o}=(0,r.useTranslation)("web"),d=function(e){let[t,a]=(0,s.useState)(Date.now),r=(0,s.useRef)(null);return(0,s.useEffect)(()=>(e&&e.some(e=>!e.phase.startsWith("run:")&&!e.completedAt&&e.startedAt)&&(r.current=setInterval(()=>a(Date.now()),1e3)),()=>{r.current&&(clearInterval(r.current),r.current=null)}),[e]),t}(e);if(a)return(0,t.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(n)return(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-base text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n})]});if(!e||0===e.length)return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(e5.Clock,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-base",children:o("activityTab.noActivityRecorded")})]});let c=e.filter(e=>!tL(e.phase)),u=Math.max(...c.map(e=>tP(e,d)),...c.map(e=>e.approvalWaitMs??0),0),x=function(e,t){if(!e.length)return[];let s=e.filter(e=>"run:rejected"===e.phase).length,a=t?.length??0,r=e;if(a>s){r=[...e];let n=e[e.length-1].agentRunId;for(let e=s;e<a;e++){let a=t[e];e>s&&r.push({agentRunId:n,phase:"run:resumed",startedAt:a.timestamp??`synthetic-resumed-${e}`}),r.push({agentRunId:n,phase:"run:rejected",startedAt:a.timestamp??`synthetic-${e}`})}}let n=[],l=[],i=0;for(let e of r)if(l.push(e),"run:rejected"===e.phase){let e=t?.[i];n.push({number:n.length+1,timings:l,rejectionMessage:e?.message,rejectionAttachments:e?.attachments}),l=[],i++}return l.length>0&&n.push({number:n.length+1,timings:l}),n}(e,l),m=x.length>1,p=c.reduce((e,t)=>e+tP(t,d),0),h=c.reduce((e,t)=>e+(t.approvalWaitMs??0),0),f=c.reduce((e,t)=>e+(t.inputTokens??0),0),g=c.reduce((e,t)=>e+(t.outputTokens??0),0),b=c.reduce((e,t)=>e+(t.costUsd??0),0);return(0,t.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,t.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:x.map(e=>(0,t.jsx)(tq,{iteration:e,showHeader:m,maxDurationMs:u,now:d},e.number))}),p>0?(0,t.jsx)(tV,{totalExecMs:p,totalWaitMs:h,totalInputTokens:f,totalOutputTokens:g,totalCostUsd:b}):null]})}function tq({iteration:e,showHeader:s,maxDurationMs:a,now:r}){let n=function(e){let t=[...e.timings].reverse().find(e=>tL(e.phase));if(!t)return null;switch(t.phase){case"run:rejected":return{label:"Rejected",colorClass:"text-orange-600",dotClass:"bg-orange-500"};case"run:completed":return{label:"Completed",colorClass:"text-emerald-600",dotClass:"bg-emerald-500"};case"run:failed":return{label:"Failed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:crashed":return{label:"Crashed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:stopped":return{label:"Stopped",colorClass:"text-amber-600",dotClass:"bg-amber-500"};default:return null}}(e);return(0,t.jsxs)("div",{"data-testid":`iteration-${e.number}`,className:"border-border/50 bg-card/50 flex flex-col overflow-hidden rounded-lg border",children:[s?(0,t.jsxs)("div",{className:"bg-muted/30 border-border/50 flex items-center justify-between border-b px-3 py-1.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground text-sm font-semibold tracking-wide",children:["Iteration ",e.number]}),n?(0,t.jsxs)("span",{className:`flex items-center gap-1 text-xs font-medium ${n.colorClass}`,children:[(0,t.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${n.dotClass}`}),n.label]}):null]}):null,(0,t.jsxs)("div",{className:"relative flex flex-col",children:[(0,t.jsx)("div",{className:"bg-border/60 absolute top-4 bottom-4 left-[21.5px] w-px"}),e.timings.map((s,n)=>{if(tL(s.phase)){let a,r="run:rejected"===s.phase,l="run:failed"===s.phase||"run:crashed"===s.phase||"run:stopped"===s.phase;if(r)a=e.rejectionMessage;else if(l){let t=[...e.timings].reverse().find(e=>!tL(e.phase)&&e.errorMessage);a=t?.errorMessage??s.errorMessage}return(0,t.jsx)(tO,{timing:s,message:a,attachments:r?e.rejectionAttachments:void 0,isFirst:0===n,isLast:n===e.timings.length-1},`${s.agentRunId}-${s.phase}-${s.startedAt}`)}return(0,t.jsx)(tB,{timing:s,maxDurationMs:a,now:r},`${s.agentRunId}-${s.phase}-${s.startedAt}`)})]})]})}function tO({timing:e,message:s,attachments:a,isFirst:r,isLast:n}){let l,i=tD[e.phase];if(!i)return null;let o=a&&a.length>0,d=i.icon;return(0,t.jsxs)("div",{className:`relative flex flex-col gap-1 px-3 ${r?"pt-2":"pt-1"} ${n?"pb-2":"pb-1"}`,children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:`relative z-10 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${i.bgClass}`,children:(0,t.jsx)(d,{className:`h-3 w-3 ${i.colorClass}`})}),(0,t.jsx)("span",{className:`text-sm font-medium ${i.colorClass}`,children:i.label}),e.startedAt&&!("string"==typeof e.startedAt&&e.startedAt.startsWith("synthetic"))?(0,t.jsx)("span",{className:"text-muted-foreground/60 ml-auto text-xs tabular-nums",children:tz(String(e.startedAt))}):null]}),s?(l="run:failed"===e.phase||"run:crashed"===e.phase||"run:stopped"===e.phase,(0,t.jsxs)("div",{className:`ml-[26px] flex items-start gap-1.5 rounded-md px-2 py-1.5 ${l?"bg-red-50/50 dark:bg-red-950/20":"bg-orange-50/50 dark:bg-orange-950/20"}`,children:[l?(0,t.jsx)(B.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,t.jsx)(J.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-400"}),(0,t.jsxs)("span",{"data-testid":l?"error-message-text":"rejection-feedback-text",className:"text-muted-foreground text-xs leading-relaxed italic",children:["— ",s]})]})):null,o?(0,t.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"ml-[26px]",children:(0,t.jsx)(to,{text:"",attachmentPaths:a})}):null]})}function tB({timing:e,maxDurationMs:a,now:n}){let{t:l}=(0,r.useTranslation)("web"),i=e.phase.includes(":")?e.phase.split(":")[0]:e.phase,o=e.phase.includes(":")?e.phase.split(":")[1]:null,d=null!==o,c=o?.startsWith("phase-")??!1,m=tE[i]??i,p=c?`Phase ${o.replace("phase-","")}`:null!==o?`${m} #${o}`:m,h=tP(e,n),f=!e.completedAt&&!!e.startedAt,g=f?15:2,b=a>0?Math.max(g,h/a*100):g,j=e.completedAt?c?"bg-emerald-400":d?"bg-amber-500":"bg-emerald-500":"bg-blue-500",v=null!=e.inputTokens||null!=e.outputTokens?(e.inputTokens??0)+(e.outputTokens??0):null,[y,N]=(0,s.useState)(!1),w=(0,s.useCallback)(()=>{e.prompt&&navigator.clipboard.writeText(e.prompt).then(()=>{N(!0),setTimeout(()=>N(!1),1500)})},[e.prompt]);return(0,t.jsxs)("div",{className:`group/phase relative flex flex-col gap-0.5 px-3 py-1.5 ${d?"ms-4":""}`,children:[(0,t.jsxs)("div",{"data-testid":`timing-bar-${e.phase}`,className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"relative z-10 flex h-5 w-5 shrink-0 items-center justify-center",children:(0,t.jsx)("div",{className:`rounded-full ${f?"h-3 w-3 animate-pulse":"h-2.5 w-2.5"} ${f?"bg-blue-500":e.completedAt?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,t.jsx)("span",{className:`w-28 shrink-0 truncate text-sm font-medium ${d?"text-muted-foreground":"text-foreground/80"}`,children:p}),e.prompt?(0,t.jsx)("button",{type:"button",onClick:w,className:"text-muted-foreground/50 hover:text-foreground/70 -ms-1 shrink-0 opacity-0 transition-opacity group-hover/phase:opacity-100",title:l("activityTab.copyPromptToClipboard"),children:y?(0,t.jsx)(x.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,t.jsx)(u.Copy,{className:"h-3.5 w-3.5"})}):null,(0,t.jsx)("div",{className:`bg-muted relative min-w-0 flex-1 overflow-hidden rounded-full ${d?"h-1.5":"h-2"}`,children:f?(0,t.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/30",style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgb(59 130 246) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s ease-in-out infinite"}}):(0,t.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${j}`,style:{width:`${Math.min(b,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-sm font-medium tabular-nums",children:tp(h)})]}),(0,t.jsxs)("div",{className:"ml-[28px] flex items-center gap-3 text-xs",children:[e.startedAt?(0,t.jsx)("span",{className:"text-muted-foreground/60 tabular-nums",children:tz(e.startedAt)}):null,null!=v&&v>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(Y.Zap,{className:"h-3 w-3 opacity-50"}),tA(v)]}):null,null!=e.costUsd&&e.costUsd>0?(0,t.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,t.jsx)(tT,{className:"h-3 w-3 opacity-50"}),t$(e.costUsd)]}):null]}),null!=e.approvalWaitMs&&e.approvalWaitMs>0?(0,t.jsx)(tU,{timing:e,maxDurationMs:a}):null]})}function tU({timing:e,maxDurationMs:s}){let a=e.approvalWaitMs??0,r=s>0?Math.max(2,a/s*100):2;return(0,t.jsxs)("div",{"data-testid":`approval-wait-${e.phase}`,className:"ml-[26px] flex items-center gap-2 rounded-md bg-amber-50/50 px-1.5 py-1 dark:bg-amber-950/20",children:[(0,t.jsx)(tM.Timer,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs",children:"approval"}),(0,t.jsx)("div",{className:"bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full",children:(0,t.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(r,100)}%`}})}),(0,t.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-xs tabular-nums",children:tp(a)})]})}function tV({totalExecMs:e,totalWaitMs:s,totalInputTokens:a,totalOutputTokens:n,totalCostUsd:l}){let{t:i}=(0,r.useTranslation)("web"),o=a+n;return(0,t.jsxs)("div",{"data-testid":"activity-summary",className:"border-border bg-card/30 flex flex-col gap-2 rounded-lg border p-3",children:[(0,t.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-semibold tracking-wider uppercase",children:"Summary"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[(0,t.jsx)(tW,{icon:e5.Clock,label:i("activityTab.execution"),value:tp(e)}),(0,t.jsx)(tW,{icon:tM.Timer,label:i("activityTab.wait"),value:s>0?tp(s):"n/a"}),(0,t.jsx)(tW,{icon:e5.Clock,label:"Wall-clock",value:s>0?tp(e+s):tp(e)}),(0,t.jsx)(tW,{icon:tT,label:i("activityTab.cost"),value:l>0?t$(l):"n/a"}),(0,t.jsxs)("div",{className:"col-span-2 flex flex-col gap-0.5",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(Y.Zap,{className:"h-3 w-3 opacity-40"}),"Tokens"]}),o>0?(0,t.jsxs)("span",{className:"flex items-center gap-2.5 text-sm tabular-nums",children:[(0,t.jsx)("span",{children:tA(o)}),(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-3 text-xs",title:"Input tokens / Output tokens",children:[(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(tR,{className:"h-3 w-3 text-blue-500 opacity-60"}),tA(a)]}),(0,t.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(tI,{className:"h-3 w-3 text-emerald-500 opacity-60"}),tA(n)]})]})]}):(0,t.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function tW({icon:e,label:s,value:a,className:r=""}){let n="n/a"===a;return(0,t.jsxs)("div",{className:`flex flex-col gap-0.5 ${r}`,children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,t.jsx)(e,{className:"h-3 w-3 opacity-40"}),s]}),(0,t.jsx)("span",{className:`text-sm tabular-nums ${n?"text-muted-foreground/40 italic":""}`,children:a})]})}var tH=e.i(7311),tG=e.i(44229);let t_=(0,W.default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),tK=(0,W.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),tZ=(0,W.default)("file-code",[["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:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),tQ=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,tJ=/^\[(tool-result|tool|text|delta|result|tokens|cmd|file|turn|thread|error|event|raw|WORKER)\]\s*(.*)/;function tX(e){let t=e.match(tQ);if(!t)return{timestamp:null,phase:null,agent:null,model:null,tag:"raw",message:e,raw:e};let[,s,a,r,n,l]=t,i=null,o=null,d=null,c=l??"";if(null!=r&&null!=a)if(a.includes("|")){let[e,t]=a.split("|");o=e,d=t??null,c=`[${r}] ${l??""}`}else i=a,o=r,d=n??null;else if(null!=a)if(a.includes("|")){let[e,t]=a.split("|");o=e,d=t??null}else i=a;let u=c.match(tJ),x="info";return u&&(x=u[1].toLowerCase(),c=u[2]),{timestamp:s??null,phase:i,agent:o,model:d,tag:x,message:c.trim(),raw:e}}function tY({content:e}){let a=(0,s.useMemo)(()=>e?e.split("\n").filter(e=>e.trim().length>0).map(tX):[],[e]);return 0===a.length?null:(0,t.jsx)("div",{className:"flex flex-col",children:a.map((e,s)=>(0,t.jsx)(t0,{line:e},s))})}function t0({line:e}){switch(e.tag){case"tool":return(0,t.jsx)(t5,{line:e});case"tool-result":return(0,t.jsx)(t7,{line:e});case"text":case"delta":return(0,t.jsx)(t4,{line:e});case"result":return(0,t.jsx)(t6,{line:e});case"tokens":case"turn":return(0,t.jsx)(t8,{line:e});case"cmd":return(0,t.jsx)(se,{line:e});case"file":return(0,t.jsx)(st,{line:e});case"thread":case"event":case"info":return(0,t.jsx)(sa,{line:e});case"error":return(0,t.jsx)(ss,{line:e});case"worker":return(0,t.jsx)(t9,{line:e});default:return(0,t.jsx)(sr,{line:e})}}function t1({value:e}){if(!e)return null;let s=e.replace(/^.*T/,"").replace("Z",""),a=s.split(":"),r=a.length>=3?`${a[1]}:${a[2].split(".")[0]}`:s;return(0,t.jsx)("span",{className:"text-muted-foreground/60 w-11 shrink-0 font-mono text-[10px]",children:r})}function t2({phase:e}){return e?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground w-20 shrink-0 truncate rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",title:e,children:e}):(0,t.jsx)("span",{className:"w-20 shrink-0"})}function t5({line:e}){var s;let a,{toolName:r,args:n}=-1===(a=(s=e.message).indexOf(" "))?{toolName:s,args:""}:{toolName:s.slice(0,a),args:s.slice(a+1)},l=function(e,t){try{let s=JSON.parse(t);if("Read"===e&&s.file_path||"Write"===e&&s.file_path||"Edit"===e&&s.file_path)return s.file_path;if("Glob"===e&&s.pattern||"Grep"===e&&s.pattern)return s.pattern;if("Bash"===e&&s.command)return s.command;if("Task"===e&&s.description)return s.description}catch{if(t.length>0)return t}return null}(r,n);return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 border-b border-transparent px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(t3,{toolName:r}),(0,t.jsx)("span",{className:"text-xs font-semibold text-violet-600 dark:text-violet-400",children:r}),l?(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-xs break-all",children:l}):null]})]})}function t3({toolName:e}){let s=e.toLowerCase();return"bash"===s?(0,t.jsx)($.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===s||"glob"===s||"grep"===s?(0,t.jsx)(D.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===s||"edit"===s?(0,t.jsx)(tZ,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,t.jsx)($.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function t4({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(J.MessageSquare,{className:"mt-0.5 h-3 w-3 shrink-0 text-blue-500"}),(0,t.jsx)("span",{className:"text-foreground/80 min-w-0 text-xs leading-relaxed",children:e.message})]})]})}function t6({line:e}){var s;let a,r,{chars:n}=(a=(s=e.message).match(/^(\d+)\s+chars/),r=s.match(/session=(\S+)/),{chars:a?parseInt(a[1],10):0,sessionId:r?r[1]:null});return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(eF.CheckCircle2,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-500"}),(0,t.jsxs)("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:["Result: ",n.toLocaleString()," chars"]})]})]})}function t8({line:e}){let s,{inputTokens:a,outputTokens:r}=(s=e.message.match(/^(\d+)\s+in\s*\/\s*(\d+)\s+out/))?{inputTokens:parseInt(s[1],10),outputTokens:parseInt(s[2],10)}:{inputTokens:0,outputTokens:0};return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(t_,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:a.toLocaleString()})," in / ",(0,t.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:r.toLocaleString()})," out"]})]})]})}function t9({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-zinc-50 px-3 py-1.5 transition-colors dark:bg-zinc-900/50",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tK,{className:"mt-0.5 h-3 w-3 shrink-0 text-zinc-500"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium break-all",children:e.message})]})]})}function t7({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(ez,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-400"}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-[11px] break-all",children:e.message})]})]})}function se({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(d.Play,{className:"mt-0.5 h-3 w-3 shrink-0 text-cyan-500"}),(0,t.jsx)("span",{className:"min-w-0 font-mono text-xs break-all text-cyan-700 dark:text-cyan-400",children:e.message})]})]})}function st({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(tZ,{className:"mt-0.5 h-3 w-3 shrink-0 text-orange-500"}),(0,t.jsx)("span",{className:"min-w-0 text-xs break-all text-orange-700 dark:text-orange-400",children:e.message})]})]})}function ss({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-red-50 px-3 py-1.5 transition-colors dark:bg-red-950/30",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,t.jsx)(B.AlertCircle,{className:"mt-0.5 h-3 w-3 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"min-w-0 text-xs font-medium break-all text-red-700 dark:text-red-400",children:e.message})]})]})}function sa({line:e}){return(0,t.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,t.jsx)(t1,{value:e.timestamp}),(0,t.jsx)(t2,{phase:e.phase}),(0,t.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:e.message})]})}function sr({line:e}){return(0,t.jsx)("div",{className:"px-3 py-0.5",children:(0,t.jsx)("span",{className:"text-muted-foreground/70 font-mono text-[11px] break-all whitespace-pre-wrap",children:e.raw})})}function sn({content:e,isConnected:a,error:n}){let{t:l}=(0,r.useTranslation)("web"),i=(0,s.useRef)(null),[o,d]=(0,s.useState)(!0),[c,u]=(0,s.useState)("structured"),x=(0,s.useCallback)(()=>{let e=i.current;e&&d(e.scrollHeight-e.scrollTop-e.clientHeight<40)},[]),m=(0,s.useCallback)(()=>{let e=i.current;e&&(e.scrollTop=e.scrollHeight,d(!0))},[]);return((0,s.useEffect)(()=>{o&&i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e,o]),n)?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:n})]}):e?(0,t.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,t.jsx)("span",{className:`h-2 w-2 rounded-full ${a?"bg-emerald-500":"bg-zinc-400"}`}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:a?"Live":"Disconnected"}),(0,t.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,t.jsx)("button",{type:"button",onClick:()=>u("structured"),className:`rounded p-1 transition-colors ${"structured"===c?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:l("logTab.structuredView"),children:(0,t.jsx)(D.FileText,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{type:"button",onClick:()=>u("raw"),className:`rounded p-1 transition-colors ${"raw"===c?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:l("logTab.rawView"),children:(0,t.jsx)(tG.Code,{className:"h-3.5 w-3.5"})}),o?null:(0,t.jsxs)("button",{type:"button",onClick:m,className:"text-muted-foreground hover:text-foreground ms-1 flex items-center gap-1 text-xs",children:[(0,t.jsx)(tH.ArrowDown,{className:"h-3 w-3"}),"Jump to bottom"]})]})]}),(0,t.jsx)("div",{ref:i,onScroll:x,className:`flex-1 overflow-y-auto ${"raw"===c?"bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300":"bg-background"}`,children:"structured"===c?(0,t.jsx)(tY,{content:e}):e})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)($.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:l("logTab.noLogOutput")}),a?(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let sl=(0,W.default)("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 si=e.i(95812),so=e.i(87889);let sd=(0,W.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),sc={Todo:{icon:si.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:i.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:x.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:so.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},su={icon:si.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function sx({tasks:e}){let{t:s}=(0,r.useTranslation)("web");return 0===e.length?(0,t.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:s("taskProgress.noTasksDefined")})}):(0,t.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,t.jsx)(sm,{tasks:e}),(0,t.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:e.map((e,s)=>(0,t.jsx)(sh,{task:e,index:s},e.title||`task-${s}`))})]})}function sm({tasks:e}){let{t:a}=(0,r.useTranslation)("web"),n=(0,s.useMemo)(()=>{let t=e.filter(e=>"Done"===e.state).length,s=e.filter(e=>"Work in Progress"===e.state).length,a=e.filter(e=>"Review"===e.state).length,r=e.filter(e=>"Done"!==e.state&&"Work in Progress"!==e.state&&"Review"!==e.state).length,n=e.length,l=n>0?Math.round(t/n*100):0;return{done:t,wip:s,review:a,todo:r,total:n,percent:l}},[e]);return(0,t.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,t.jsxs)("span",{className:"text-muted-foreground text-xs",children:[n.done," of ",n.total," done"]})]}),(0,t.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,t.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${n.percent}%`}})}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-3",children:[n.done>0?(0,t.jsx)(sp,{icon:x.Check,label:a("taskProgress.done"),count:n.done,className:"text-emerald-600"}):null,n.wip>0?(0,t.jsx)(sp,{icon:i.Loader2,label:a("taskProgress.inProgress"),count:n.wip,className:"text-blue-600"}):null,n.review>0?(0,t.jsx)(sp,{icon:so.Eye,label:a("taskProgress.review"),count:n.review,className:"text-amber-600"}):null,n.todo>0?(0,t.jsx)(sp,{icon:si.Circle,label:a("taskProgress.todo"),count:n.todo,className:"text-muted-foreground"}):null]})]})}function sp({icon:e,label:s,count:r,className:n}){return(0,t.jsxs)("span",{className:(0,a.cn)("flex items-center gap-1 text-xs",n),children:[(0,t.jsx)(e,{className:"h-3 w-3"}),r," ",s]})}function sh({task:e,index:r}){let[n,l]=(0,s.useState)(!1),i=sc[e.state]??su,o=i.icon,d=e.actionItems.length>0,c=(0,s.useCallback)(()=>{d&&l(e=>!e)},[d]);return(0,t.jsxs)("div",{"data-testid":`task-card-${r}`,className:(0,a.cn)("rounded-lg border",i.borderClass),children:[(0,t.jsxs)("button",{type:"button",onClick:c,disabled:!d,className:(0,a.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-start",d&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,t.jsx)(o,{className:(0,a.cn)("mt-0.5 h-4 w-4 shrink-0",i.colorClass,i.spinning&&"animate-spin")}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:(0,a.cn)("text-sm font-medium",i.colorClass),children:e.title}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description}):null]}),d?(0,t.jsx)(ed.ChevronRight,{className:(0,a.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",n&&"rotate-90")}):null]}),n&&d?(0,t.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,t.jsx)("div",{className:"flex flex-col gap-2",children:e.actionItems.map((e,s)=>(0,t.jsx)(sf,{item:e},e.name||`ai-${s}`))})}):null]})}function sf({item:e}){let s=e.acceptanceCriteria.length,a=e.acceptanceCriteria.filter(e=>e.verified).length,r=s>0&&a===s;return(0,t.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[r?(0,t.jsx)(eF.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,t.jsx)(sd,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.name}),e.description?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:e.description}):null]}),s>0?(0,t.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[a,"/",s]}):null]}),s>0?(0,t.jsx)("div",{className:"ms-5.5 flex flex-col gap-1",children:e.acceptanceCriteria.map((e,s)=>(0,t.jsx)(sg,{criterion:e},e.description||`ac-${s}`))}):null]})}function sg({criterion:e}){return(0,t.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[e.verified?(0,t.jsx)(x.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,t.jsx)(si.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:(0,a.cn)("text-[11px]",e.verified?"text-muted-foreground line-through":"text-foreground"),children:e.description})]})}let sb={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function sj({plan:e,loading:s,error:a}){return s?(0,t.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):a?(0,t.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,t.jsx)(B.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:a})]}):e?(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,t.jsx)(eu.Badge,{className:sb[e.state]??"border-transparent bg-gray-50 text-gray-700",children:e.state})]}),e.overview?(0,t.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,t.jsx)("p",{className:"text-sm leading-relaxed",children:e.overview})]}):null,(0,t.jsx)(sx,{tasks:e.tasks})]}):(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,t.jsx)(sl,{className:"text-muted-foreground h-8 w-8"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}var sv=e.i(28112);function sy(){return{data:null,loading:!1,error:null}}let sN=[{key:"overview",label:"Overview",icon:U.LayoutDashboard},{key:"activity",label:"Activity",icon:V.Activity},{key:"log",label:"Log",icon:H},{key:"plan",label:"Plan",icon:G},{key:"prd-review",label:"PRD Review",icon:_},{key:"tech-decisions",label:"Tech Decisions",icon:K.Cpu},{key:"product-decisions",label:"Product",icon:Z.Package},{key:"merge-review",label:"Merge Review",icon:Q},{key:"chat",label:"Chat",icon:J.MessageSquare}],sw={activity:async function(e){let t=await es(e);if("error"in t)throw Error(t.error);return{timings:t.timings,rejectionFeedback:t.rejectionFeedback}},plan:async function(e){let t=await ea(e);if("error"in t)throw Error(t.error);return t.plan}};function sk({featureName:e,headerContent:r,featureNode:l,featureId:o,initialTab:u,urlTab:x,prdData:m,prdSelections:p,onPrdSelect:h,onPrdApprove:f,onPrdReject:g,isPrdLoading:b,techData:j,onTechApprove:v,onTechReject:y,isTechLoading:N,productData:w,mergeData:k,onMergeApprove:C,onMergeReject:T,isMergeLoading:S,syncStatus:M,syncLoading:R,syncError:I,onRefreshSync:A,onRebaseOnMain:z,rebaseLoading:$,rebaseError:E,isRejecting:D,chatInput:L,onChatInputChange:F,pinnedConfig:q,continuationActionsDisabled:O=!1,sseEvents:U,interactiveAgentEnabled:V=!0,onRetry:W,onStop:H,onStart:G}){let _,K=(0,n.usePathname)(),Z=(0,s.useMemo)(()=>(function(e,t=!0){let s=["overview","activity"];return e.hasAgentRun&&s.push("log"),e.hasPlan&&s.push("plan"),"requirements"===e.lifecycle&&"action-required"===e.state&&s.push("prd-review"),"implementation"===e.lifecycle&&"action-required"===e.state&&s.push("tech-decisions","product-decisions"),"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)&&s.push("merge-review"),"maintain"===e.lifecycle&&e.pr&&s.push("merge-review"),t&&s.push("chat"),s})(l,V),[l,V]),Q=(0,s.useMemo)(()=>sN.filter(e=>Z.includes(e.key)).map(e=>"merge-review"===e.key&&"maintain"===l.lifecycle?{...e,label:"Merge History"}:e),[Z,l.lifecycle]),J=(0,s.useMemo)(()=>{let e=K.match(/^(\/feature\/[^/]+)/);return e?e[1]:K},[K]),es=(0,s.useMemo)(()=>x&&Z.includes(x)?x:u&&Z.includes(u)?u:"overview",[]),[ea,en]=(0,s.useState)(es),el=function(e){let[t,a]=(0,s.useState)(""),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(null),o=(0,s.useRef)(null),d=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),n(!1)},[]);return(0,s.useEffect)(()=>{if(!e){a(""),n(!1),i(null);return}a(""),i(null);let t=new EventSource(`/api/feature-logs?featureId=${e}`);return o.current=t,t.onopen=()=>{n(!0)},t.addEventListener("initial",e=>{a(JSON.parse(e.data).content)}),t.addEventListener("log",e=>{let t=JSON.parse(e.data);a(e=>e+t.content)}),t.addEventListener("error",e=>{try{let t=JSON.parse(e.data);i(t.error)}catch{i(e.data?String(e.data):"Log stream unavailable")}}),t.onerror=()=>{n(!1)},()=>{t.close(),o.current=null}},[e,d]),{content:t,isConnected:r,error:l}}("log"===ea?o:null),{tabs:eo,fetchTab:ed,refreshTab:ec}=function(e,t){let a=Object.keys(t),[r,n]=(0,s.useState)(()=>{let e={};for(let t of a)e[t]=sy();return e}),l=(0,s.useRef)(t);l.current=t;let i=(0,s.useRef)(e);i.current=e;let o=(0,s.useRef)(!0);(0,s.useEffect)(()=>(o.current=!0,()=>{o.current=!1}),[]);let d=(0,s.useRef)(e);(0,s.useEffect)(()=>{d.current!==e&&(d.current=e,n(e=>{let t={};for(let s of Object.keys(e))t[s]=sy();return t}))},[e]);let c=(0,s.useCallback)(async e=>{let t=l.current[e],s=i.current;if(t){o.current&&n(t=>t[e]?.data!==null?t:{...t,[e]:{...t[e],loading:!0,error:null}});try{let a=await t(s);o.current&&n(t=>({...t,[e]:{data:a,loading:!1,error:null}}))}catch(t){o.current&&n(s=>{let a=t instanceof Error?t.message:"Failed to fetch tab data",r=s[e]?.data??null;return{...s,[e]:{data:r,loading:!1,error:r?null:a}}})}}},[]),u=(0,s.useCallback)(async e=>{let t=r[e];t&&null!==t.data||t&&t.loading||await c(e)},[r,c]);return{tabs:r,fetchTab:u,refreshTab:(0,s.useCallback)(async e=>{await c(e)},[c])}}(o,sw),eu=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!eu.current)return;eu.current=!1;let e="overview"===ea?J:`${J}/${ea}`;e!==K&&window.history.pushState(null,"",e)},[ea,J,K]);let ex=(0,s.useRef)(K);(0,s.useEffect)(()=>{if(ex.current===K||(ex.current=K,eu.current))return;let e=K.split("/"),t=e.length>=4?e[3]:void 0,s=t&&Z.includes(t)?t:"overview";s!==ea&&(en(s),("activity"===s||"plan"===s)&&ed(s))},[K]);let em=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!em.current&&(em.current=!0,!x&&"overview"!==es)){let e=`${J}/${es}`;e!==K&&window.history.replaceState(null,"",e)}},[]);let ep=(0,s.useRef)(!1);(0,s.useEffect)(()=>{ep.current||(ep.current=!0,("activity"===ea||"plan"===ea)&&ed(ea))},[ea,ed]);let eh=(0,s.useRef)(o);(0,s.useEffect)(()=>{eh.current!==o&&(eh.current=o,en("overview"))},[o]);let ef=(0,s.useRef)(u);(0,s.useEffect)(()=>{if(ef.current!==u&&u&&Z.includes(u)){ef.current=u,en(u),("activity"===u||"plan"===u)&&ed(u);let e="overview"===u?J:`${J}/${u}`;e!==window.location.pathname&&window.history.replaceState(null,"",e)}},[u,Z,J,ed]),(0,s.useEffect)(()=>{Z.includes(ea)||(en("overview"),window.location.pathname!==J&&window.history.replaceState(null,"",J))},[Z,ea,J]);let eg=(0,s.useRef)(ea);eg.current=ea;let eb=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(!U||0===U.length||(eb.current>U.length&&(eb.current=0),U.length<=eb.current))return;let e=U.slice(eb.current);if(eb.current=U.length,!e.some(e=>e.featureId===o))return;ec("activity");let t=eg.current;"plan"===t&&ec(t)},[U,o,ec]);let ej="running"===l.state||"creating"===l.state;(0,s.useEffect)(()=>{if(!ej)return;let e=setInterval(()=>{ec("activity")},5e3);return()=>clearInterval(e)},[ej,ec]);let ey=(0,s.useCallback)(e=>{eu.current=!0,en(e),("activity"===e||"plan"===e)&&ed(e)},[ed]);return(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,t.jsxs)(et.Tabs,{value:ea,onValueChange:ey,className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)(et.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:Q.map(e=>{let s=e.icon;return(0,t.jsxs)(et.TabsTrigger,{value:e.key,className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,t.jsx)(s,{className:"mr-1.5 size-4"}),e.label]},e.key)})}),(0,t.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[e?(0,t.jsxs)("div",{className:"flex h-12 items-stretch gap-2 pr-0 pl-4","data-testid":"feature-drawer-header",children:[(0,t.jsx)("div",{className:"flex items-center",children:l.fastMode?(0,t.jsx)(Y.Zap,{className:"size-4 shrink-0 text-amber-500"}):(0,t.jsx)(ee,{className:"text-muted-foreground/50 size-4 shrink-0"})}),(0,t.jsx)("h2",{className:"text-foreground flex min-w-0 items-center truncate text-base font-semibold tracking-tight",children:e}),l.repositoryName?(0,t.jsxs)("span",{className:"animate-in fade-in flex shrink-0 items-center gap-1.5 self-center duration-200",children:[(0,t.jsx)("span",{className:"text-muted-foreground/30 text-sm",children:"/"}),l.remoteUrl?(0,t.jsx)("a",{href:l.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground text-sm",children:l.repositoryName}):(0,t.jsx)("span",{className:"text-muted-foreground text-sm",children:l.repositoryName})]}):(0,t.jsxs)("span",{className:"flex items-center gap-1.5 self-center",children:[(0,t.jsx)("span",{className:"text-muted-foreground/30 text-sm",children:"/"}),(0,t.jsx)("span",{className:"bg-muted h-4 w-16 animate-pulse rounded"})]}),(0,t.jsx)(P.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex shrink-0 cursor-default items-center self-stretch text-xs font-medium",children:[(0,t.jsxs)("div",{className:(0,a.cn)("flex items-center gap-1.5 self-stretch px-3",er.featureNodeStateConfig[l.state].labelClass),children:["running"===l.state?(0,t.jsx)(ei,{size:"sm",className:"shrink-0"}):(_=er.featureNodeStateConfig[l.state].icon,(0,t.jsx)(_,{className:"size-3.5 shrink-0"})),er.featureNodeStateConfig[l.state].label]}),"pending"===l.state&&G?(0,t.jsxs)("button",{type:"button",onClick:()=>G(l.featureId),disabled:O,className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-green-500/10 hover:text-green-600 disabled:pointer-events-none disabled:opacity-50 dark:hover:text-green-400","data-testid":"feature-drawer-start-button",children:[(0,t.jsx)(d.Play,{className:"size-3.5"})," Start"]}):"error"===l.state&&W?(0,t.jsxs)("button",{type:"button",onClick:()=>W(l.featureId),disabled:O,className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-red-500/10 hover:text-red-500 disabled:pointer-events-none disabled:opacity-50 dark:hover:text-red-400","data-testid":"feature-drawer-retry-button",children:[(0,t.jsx)(X.RotateCcw,{className:"size-3.5"})," Retry"]}):"running"===l.state&&H?(0,t.jsxs)("button",{type:"button",onClick:()=>H(l.featureId),className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-red-500/10 hover:text-red-500 dark:hover:text-red-400","data-testid":"feature-drawer-stop-button",children:[(0,t.jsx)(c.Square,{className:"size-3.5"})," Stop"]}):null]})}),l.errorMessage?(0,t.jsxs)(P.TooltipContent,{side:"bottom",align:"end",sideOffset:4,className:"z-[100] max-w-xs cursor-pointer text-xs leading-relaxed select-text",onClick:()=>{navigator.clipboard.writeText(l.errorMessage)},children:[l.errorMessage,(0,t.jsx)("span",{className:"text-muted-foreground ml-1 text-[10px] italic",children:"(click to copy)"})]}):null]})})]}):null,r]}),(0,t.jsx)(et.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(tN,{data:l,pinnedConfig:q,syncStatus:M,syncLoading:R,syncError:I,onRefreshSync:A,onRebaseOnMain:z,rebaseLoading:$,rebaseError:E})}),(0,t.jsx)(et.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(tF,{timings:eo.activity.data?.timings??null,loading:eo.activity.loading,error:eo.activity.error,rejectionFeedback:eo.activity.data?.rejectionFeedback})}),(0,t.jsx)(et.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,t.jsx)(sn,{content:el.content,isConnected:el.isConnected,error:el.error})}),(0,t.jsx)(et.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,t.jsx)(sj,{plan:eo.plan.data,loading:eo.plan.loading,error:eo.plan.error})}),Z.includes("prd-review")?(0,t.jsx)(et.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:m?(0,t.jsx)(ev,{data:m,selections:p??{},onSelect:h??(()=>void 0),onApprove:f??(()=>void 0),onReject:g,isProcessing:!!(b||O),isRejecting:D,chatInput:L,onChatInputChange:F}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,Z.includes("tech-decisions")?(0,t.jsx)(et.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:j?(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsx)(eC,{data:j})}),(0,t.jsx)(sC,{onApprove:v??(()=>void 0),onReject:y,isProcessing:!!(N||O),isRejecting:D,chatInput:L,onChatInputChange:F})]}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,Z.includes("product-decisions")?(0,t.jsx)(et.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===w?(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):w?(0,t.jsx)(eM,{data:w}):(0,t.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,Z.includes("merge-review")?(0,t.jsx)(et.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:k?(0,t.jsx)(e2,{data:k,readOnly:"maintain"===l.lifecycle,onApprove:C??(()=>void 0),onReject:T,isProcessing:!!(S||O),isRejecting:D,chatInput:L,onChatInputChange:F}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8",children:S?(0,t.jsx)(i.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"}):(0,t.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center gap-2 text-sm",children:[(0,t.jsx)(B.AlertCircle,{className:"h-6 w-6"}),(0,t.jsx)("span",{children:"Merge review data unavailable"})]})})}):null,Z.includes("chat")?(0,t.jsx)(et.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,t.jsx)(sv.ChatTab,{featureId:o,worktreePath:l.worktreePath})}):null]})})}function sC({onApprove:e,onReject:s,isProcessing:a,isRejecting:n,chatInput:l,onChatInputChange:i}){let{t:o}=(0,r.useTranslation)("web");return(0,t.jsx)(ej,{onReject:s,onApprove:e,approveLabel:o("featureDrawer.approvePlan"),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:a,isRejecting:n,chatInput:l,onChatInputChange:i})}var sT=e.i(38896),sS=e.i(84167),sM=e.i(43673);let sR=(0,h.createServerReference)("4024f9637082272fb41877340eb6607d3fc5c35876",h.callServer,void 0,h.findSourceMapURL,"rebaseFeature");var sI=e.i(99045);function sP(e){return"requirements"===e.lifecycle&&"action-required"===e.state?"prd-review":"implementation"===e.lifecycle&&"action-required"===e.state?"tech-decisions":"review"===e.lifecycle&&("action-required"===e.state||"error"===e.state)?"merge-review":"overview"}function sA(e,t,a,r,n,i){let[o,d]=(0,s.useState)(!1),c=(0,s.useRef)(a),u=(0,s.useRef)(r);return c.current=a,u.current=r,(0,s.useEffect)(()=>{if(u.current(),!e)return;let s=!1;return d(!0),t(e).then(e=>{s||c.current(e)}).catch(()=>{!s&&n&&l.toast.error(n)}).finally(()=>{s||d(!1)}),()=>{s=!0}},[e,t,n,i]),o}let sz=(0,h.createServerReference)("40a4cfb781c486394a32c1d994816c0edf86487572",h.callServer,void 0,h.findSourceMapURL,"getFeatureDrawerData"),s$=(0,h.createServerReference)("4046ea64b007ae860c3800c3105495a3b6103b5457",h.callServer,void 0,h.findSourceMapURL,"getBranchSyncStatus"),sE=new Map,sD=(0,h.createServerReference)("70d37f0b66e42689b068eb85914f9a3de8f5e5bad8",h.callServer,void 0,h.findSourceMapURL,"updateFeaturePinnedConfig");function sL({view:e,urlTab:h,interactiveAgentEnabled:z=!0}){var $,E;let D,L,F,q,B,U,V=(0,k.useFeatureFlags)(),{t:W}=(0,r.useTranslation)("web"),H=(0,n.useRouter)(),G=(0,C.useSoundAction)("reject"),[_,K]=(0,s.useState)(e),[Z,Q]=(0,s.useState)(()=>"feature"===e.type?tf(e.node):null),[J,X]=(0,s.useState)(()=>"feature"===e.type?tf(e.node):null),[Y,ee]=(0,s.useState)(!1),[et,es]=(0,s.useState)(null),ea=(0,s.useRef)(null);(0,s.useEffect)(()=>{K(t=>"feature"===t.type&&"feature"===e.type&&t.node.featureId===e.node.featureId?{...e,node:{...t.node,...e.node}}:e)},[e]);let er="feature"===_.type?_.node:null,en=!!er&&($=er.state,th.has($));(0,s.useEffect)(()=>{if("feature"!==_.type||Y)return;let e=tf(_.node),t=e?`${_.node.featureId}:${e.agentType}:${e.modelId}`:`${_.node.featureId}:none`,s=ea.current!==t;ea.current=t,Q(e),X(e),s&&es(null)},[_,Y]);let{events:el}=(0,M.useAgentEventsContext)(),ei=(0,s.useRef)(0);(0,s.useEffect)(()=>{if(ei.current>el.length&&(ei.current=0),!er||el.length<=ei.current)return;let e=el.slice(ei.current);for(let t of(ei.current=el.length,(0,sI.resolveSseEventUpdates)(e)))t.featureId===er.featureId&&"deleting"!==er.state&&(void 0!==t.state||void 0!==t.lifecycle)&&K(e=>{if("feature"!==e.type)return e;let s={...e.node,...void 0!==t.state&&{state:t.state},...void 0!==t.lifecycle&&{lifecycle:t.lifecycle}};return{...e,node:s,initialTab:sP(s)}})},[el,er]);let eo=(0,n.usePathname)().startsWith("/feature/");E=er?.featureId??null,D=(0,s.useRef)(eo),L=(0,s.useRef)(!1),F=(0,s.useRef)(0),q=(0,s.useCallback)(async()=>{if(!E||L.current)return;L.current=!0;let e=F.current;try{let t=await sz(E);if(!t||e!==F.current)return;K(e=>(function(e,t){if("feature"!==e.type)return e;let s={...e.node,...t},a=s.state!==e.node.state||s.lifecycle!==e.node.lifecycle;return{...e,node:s,initialTab:a?sP(s):e.initialTab}})(e,t))}catch{}finally{L.current=!1}},[E,K]),B=(0,s.useRef)(!1),(0,s.useEffect)(()=>{!eo||D.current&&B.current||(B.current=!0,F.current+=1,L.current=!1,q()),D.current=eo},[eo,q]),(0,s.useEffect)(()=>{if(!eo||!E)return;let e=setInterval(()=>{q()},15e3);return()=>clearInterval(e)},[eo,E,q]);let ed=(0,s.useCallback)(()=>{H.push("/")},[H]),[ec,eu]=(0,s.useState)(""),[ex,em]=(0,s.useState)(null),[ep,eh]=(0,s.useState)({}),[ef,eg]=(0,s.useState)({}),[eb,ej]=(0,s.useState)(null),[ev,ey]=(0,s.useState)(void 0),[eN,ew]=(0,s.useState)(null),[ek,eC]=(0,s.useState)(!1),[eT,eS]=(0,s.useState)(!1),[eM,eR]=(0,s.useState)(!1),eI=`${er?.featureId}:${er?.state}`,eP=(0,s.useRef)(eI);(0,s.useEffect)(()=>{eI!==eP.current&&(eP.current=eI,eR(!1))},[eI]);let[eA,ez]=(0,s.useState)(!1),e$=(0,s.useRef)(!1),eE="feature"===_.type?_.initialTab:void 0;(0,s.useEffect)(()=>{eu("")},[eE]);let eD=(0,s.useRef)(0),eL=(0,s.useRef)(er?.state),eF=(0,s.useRef)(er?.lifecycle);(er?.state!==eL.current||er?.lifecycle!==eF.current)&&(eL.current=er?.state,eF.current=er?.lifecycle,eD.current+=1);let eq=eD.current,eO=sA(er?.lifecycle==="requirements"&&er?.state==="action-required"?er.featureId:null,y,e=>{if(e.error)return void l.toast.error(e.error);if(e.questionnaire){em(e.questionnaire);let t={};for(let s of e.questionnaire.questions){let e=s.options.find(e=>e.recommended);e&&(t[s.id]=e.id)}eh(t),eg(t)}},()=>{eh({}),eg({}),em(null)},"Failed to load questionnaire",eq),eB=er?.lifecycle==="implementation"&&er?.state==="action-required"?er.featureId:null,eU=sA(eB,N,e=>{e.error?l.toast.error(e.error):e.techDecisions&&ej(e.techDecisions)},()=>ej(null),"Failed to load tech decisions",eq),eV=sA(eB,y,e=>{e.productDecisions&&ey(e.productDecisions)},()=>ey(void 0),void 0,eq),eW=sA(er?.lifecycle==="review"&&(er?.state==="action-required"||er?.state==="error")||er?.lifecycle==="maintain"&&er?.pr?er.featureId:null,w,e=>{"error"in e?l.toast.error(e.error):ew(e)},()=>ew(null),"Failed to load merge review data",eq),eH=ec.trim().length>0,eG=er?.lifecycle==="requirements"&&er?.state==="action-required"&&Object.keys(ef).some(e=>ef[e]!==ep[e]),e_=(0,s.useCallback)(()=>{eu(""),eh({...ef})},[ef]),{attemptClose:eK}=(0,T.useGuardedDrawerClose)({open:eo,isDirty:eH||eG,onClose:ed,onReset:e_}),eZ=(0,s.useCallback)(async(e,t,s=[],a)=>{if(!Y&&er?.featureId){e$.current=!0,ez(!0);try{let r=s.map(e=>e.path).filter(Boolean),n=s.filter(e=>e.notes?.trim()),i=n.length>0?`${e}
|
|
3
|
-
|
|
4
|
-
Image notes:
|
|
5
|
-
${n.map(e=>`- @${e.path}: ${e.notes.trim()}`).join("\n")}`:e,o=await v(er.featureId,i,r);if(!o.rejected)return void l.toast.error(o.error??`Failed to reject ${t.toLowerCase()}`);G.play(),eu(""),l.toast.success(`${t} rejected — agent re-iterating (iteration ${o.iteration})`),o.iterationWarning&&l.toast.warning(`Iteration ${o.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:er.featureId}})),ed(),a?.()}finally{e$.current=!1,ez(!1)}}},[er,ed,Y,G]),eQ=(0,s.useCallback)((e,t)=>eZ(e,"Requirements",t,()=>eh({})),[eZ]),eJ=(0,s.useCallback)((e,t)=>eZ(e,"Plan",t),[eZ]),eX=(0,s.useCallback)((e,t)=>eZ(e,"Merge",t),[eZ]),eY=(0,s.useCallback)(async e=>{if(Y||!er?.featureId)return;let t=await f(er.featureId);t.approved?(eu(""),l.toast.success(`${e} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:er.featureId}})),ed()):l.toast.error(t.error??`Failed to approve ${e.toLowerCase()}`)},[er,ed,Y]),e0=(0,s.useCallback)(async e=>{let t;if(Y||"feature"!==_.type||!er)return;if(ex){let e=[];for(let[t,s]of Object.entries(ep)){let a=ex.questions.find(e=>e.id===t),r=a?.options.find(e=>e.id===s);a&&r&&e.push({questionId:a.question,selectedOption:r.label})}t={approved:!0,changedSelections:e}}let s=await f(er.featureId,t);s.approved?(eu(""),l.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:er.featureId}})),eh({}),ed()):l.toast.error(s.error??"Failed to approve requirements")},[_,er,Y,ex,ep,ed]),e1=(0,s.useCallback)(()=>eY("Plan"),[eY]),e2=(0,s.useCallback)(()=>eY("Merge"),[eY]),e5=(0,s.useCallback)(async(e,t,s,a)=>{eC(!0),eS(!1),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:e,cleanup:t,cascadeDelete:s,closePr:a}})),H.push("/")},[H]),e3=(0,s.useCallback)(e=>{eR(!0),window.dispatchEvent(new CustomEvent("shep:feature-archive-requested",{detail:{featureId:e}})),H.push("/")},[H]),e4=(0,s.useCallback)(e=>{eR(!0),window.dispatchEvent(new CustomEvent("shep:feature-unarchive-requested",{detail:{featureId:e}})),H.push("/")},[H]),e6=(0,s.useCallback)(async e=>{if(Y)return;let t=await (0,g.resumeFeature)(e);t.error?l.toast.error(t.error):(l.toast.success("Feature resumed — agent restarting"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:e}})),K(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"running"}}))},[Y]),e8=(0,s.useCallback)(async e=>{let t=await (0,j.stopFeature)(e);t.stopped?(l.toast.success("Agent stopped"),K(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"error"}})):l.toast.error(t.error??"Failed to stop")},[]),e9=(0,s.useCallback)(async e=>{if(Y)return;let t=await (0,b.startFeature)(e);t.error?l.toast.error(t.error):(l.toast.success("Feature started"),K(e=>"feature"!==e.type?e:{...e,node:{...e.node,state:"running"}}))},[Y]),e7=(0,s.useCallback)(async(e,t)=>{var s;if(!er)return{ok:!1,error:"Feature is not loaded"};if(s=er.state,!th.has(s))return{ok:!1,error:"Pinned execution can only be changed before start, approval, or retry"};let a=J??tf(er),r={agentType:e,modelId:t};Q(r),es(null),ee(!0);try{let s=await sD(er.featureId,e,t);if(!s.ok){let e=s.error??"Failed to save pinned config";return Q(a),es(e),l.toast.error(e),{ok:!1,error:e}}return X(r),K(e=>"feature"!==e.type||e.node.featureId!==er.featureId?e:{...e,node:{...e.node,agentType:r.agentType,modelId:t}}),{ok:!0}}catch(t){let e=t instanceof Error?t.message:"Failed to save pinned config";return Q(a),es(e),l.toast.error(e),{ok:!1,error:e}}finally{ee(!1)}},[er,J]),te=er?.repositoryPath&&er?.branch?{featureId:er.featureId,repositoryPath:er.repositoryPath,branch:er.branch,worktreePath:er.worktreePath,specPath:er.specPath}:null,tt=function(e){let[t,a]=(0,s.useState)(!1),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(!1),[o,d]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),[x,m]=(0,s.useState)(null),[p,h]=(0,s.useState)(null),[f,g]=(0,s.useState)(null),[b,j]=(0,s.useState)(null),[v,y]=(0,s.useState)(null),N=(0,s.useRef)(null),w=(0,s.useRef)(null),k=(0,s.useRef)(null),C=(0,s.useRef)(null),T=(0,s.useRef)(null);(0,s.useEffect)(()=>{let e=[N,w,k,C,T];return()=>{for(let t of e)t.current&&clearTimeout(t.current)}},[]);let S=(0,s.useCallback)(async(t,s,a,r,n)=>{if(e&&!n){r.current&&clearTimeout(r.current),s(!0),a(null);try{let s=await t({repositoryPath:e.repositoryPath,branch:e.branch});if(!s.success){let e=s.error??"An unexpected error occurred";a(e),r.current=setTimeout(()=>a(null),5e3)}}catch(e){a(e instanceof Error?e.message:"An unexpected error occurred"),r.current=setTimeout(()=>a(null),5e3)}finally{s(!1)}}},[e]);return{openInIde:(0,s.useCallback)(()=>S(sT.openIde,a,m,N,t),[S,t]),openInShell:(0,s.useCallback)(()=>S(sS.openShell,n,h,w,r),[S,r]),openFolder:(0,s.useCallback)(async()=>{if(e&&!l){k.current&&clearTimeout(k.current),i(!0),g(null);try{let t=e.worktreePath??e.repositoryPath,s=await (0,sM.openFolder)(t);if(!s.success){let e=s.error??"An unexpected error occurred";g(e),k.current=setTimeout(()=>g(null),5e3)}}catch(e){g(e instanceof Error?e.message:"An unexpected error occurred"),k.current=setTimeout(()=>g(null),5e3)}finally{i(!1)}}},[e,l]),openSpecsFolder:(0,s.useCallback)(async()=>{if(e?.specPath&&!o){C.current&&clearTimeout(C.current),d(!0),j(null);try{let t=await (0,sM.openFolder)(e.specPath);if(!t.success){let e=t.error??"An unexpected error occurred";j(e),C.current=setTimeout(()=>j(null),5e3)}}catch(e){j(e instanceof Error?e.message:"An unexpected error occurred"),C.current=setTimeout(()=>j(null),5e3)}finally{d(!1)}}},[e,o]),rebaseOnMain:(0,s.useCallback)(async()=>{if(e?.featureId&&!c){T.current&&clearTimeout(T.current),u(!0),y(null);try{let t=await sR(e.featureId);if(!t.success){let e=t.error??"An unexpected error occurred";y(e),T.current=setTimeout(()=>y(null),5e3)}}catch(e){y(e instanceof Error?e.message:"An unexpected error occurred"),T.current=setTimeout(()=>y(null),5e3)}finally{u(!1)}}},[e,c]),ideLoading:t,shellLoading:r,folderLoading:l,specsLoading:o,rebaseLoading:c,ideError:x,shellError:p,folderError:f,specsError:b,rebaseError:v}}(te),ts=V.gitRebaseSync&&er?.branch&&er?.remoteUrl?er.featureId:null,{data:ta,loading:tr,error:tn,refresh:tl}=function(e){let[t,a]=(0,s.useState)(()=>{if(!e)return null;let t=sE.get(e);return t?t.data:null}),[r,n]=(0,s.useState)(!1),[l,i]=(0,s.useState)(null),o=(0,s.useRef)(e);o.current=e;let d=(0,s.useCallback)(async e=>{n(!0),i(null);try{let t=await s$(e);if(o.current!==e)return;if(t.success&&t.data){let s=t.data;sE.set(e,{data:s,timestamp:Date.now()}),a(s)}else i(t.error??"Failed to check sync status")}catch{if(o.current!==e)return;i("Failed to check sync status")}finally{o.current===e&&n(!1)}},[]);return(0,s.useEffect)(()=>{if(!e){a(null),i(null);return}let t=sE.get(e);t&&(a(t.data),Date.now()-t.timestamp<3e4)||d(e)},[e,d]),{data:t,loading:r,error:l,refresh:(0,s.useCallback)(()=>{e&&d(e)},[e,d])}}(ts),ti=(0,s.useRef)(tt.rebaseLoading);(0,s.useEffect)(()=>{!ti.current||tt.rebaseLoading||tt.rebaseError||tl(),ti.current=tt.rebaseLoading},[tt.rebaseLoading,tt.rebaseError,tl]);let to=er?.repositoryPath&&er.branch?{targetId:er.featureId,targetType:"feature",repositoryPath:er.repositoryPath,branch:er.branch}:null,td=(0,S.useDeployAction)(to),tc="Booting"===td.status||"Ready"===td.status,[tu,tx]=(0,s.useState)(!1),tm=(0,s.useCallback)(()=>{er?.featureId&&(navigator.clipboard.writeText(er.featureId),tx(!0),setTimeout(()=>tx(!1),2e3))},[er?.featureId]);if(er){let e=er.featureId.slice(0,8),s="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",r="bg-border/60 mx-1.5 h-5 w-px shrink-0";U=(0,t.jsx)("div",{"data-testid":"feature-drawer-toolbar",children:(0,t.jsxs)("div",{className:"flex h-10 items-center px-2","data-testid":"feature-drawer-actions",children:[te&&er?.state!=="done"?(0,t.jsx)(O,{actions:tt,repositoryPath:te.repositoryPath,worktreePath:te.worktreePath,showSpecs:!!te.specPath}):null,te&&er?.state!=="done"&&V.envDeploy&&to?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:r}),(0,t.jsx)(P.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:td.deployLoading||td.stopLoading,onClick:tc?td.stop:td.deploy,className:(0,a.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",tc?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-600 hover:bg-green-500/10 dark:text-green-500"),"aria-label":W(tc?"featureDrawer.stopDevServer":"featureDrawer.startDevServer"),children:td.deployLoading||td.stopLoading?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):tc?(0,t.jsx)(c.Square,{className:"size-4"}):(0,t.jsx)(d.Play,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W(tc?"featureDrawer.stopDevServer":"featureDrawer.startDevServer")})]})}),tc?(0,t.jsx)(I.DeploymentStatusBadge,{status:td.status,url:td.url,targetId:to?.targetId}):null]}):null,(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("code",{className:"text-muted-foreground/70 font-mono text-[10px] tracking-wide select-none",children:e}),(0,t.jsx)(P.TooltipProvider,{delayDuration:300,children:(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:tm,className:s,"aria-label":W("featureDrawer.copyFeatureId"),"data-testid":"feature-drawer-copy-id",children:tu?(0,t.jsx)(x.Check,{className:"size-4 text-green-500"}):(0,t.jsx)(u.Copy,{className:"size-4"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W("featureDrawer.copyFeatureId")})]})}),er.featureId?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:r}),(0,t.jsxs)(P.TooltipProvider,{delayDuration:300,children:["archived"===er.state?(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:eM,className:s,"data-testid":"feature-drawer-unarchive",onClick:()=>e4(er.featureId),children:eM?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(p.ArchiveRestore,{className:"size-3"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W("featureDrawer.unarchiveFeature")})]}):"deleting"!==er.state?(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:eM,className:s,"data-testid":"feature-drawer-archive",onClick:()=>e3(er.featureId),children:eM?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(m.Archive,{className:"size-3"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W("featureDrawer.archiveFeature")})]}):null,(0,t.jsxs)(P.Tooltip,{children:[(0,t.jsx)(P.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",disabled:ek,className:(0,a.cn)(s,"hover:bg-destructive/10 hover:text-destructive"),"data-testid":"feature-drawer-delete",onClick:()=>eS(!0),children:ek?(0,t.jsx)(i.Loader2,{className:"size-4 animate-spin"}):(0,t.jsx)(o.Trash2,{className:"size-3"})})}),(0,t.jsx)(P.TooltipContent,{side:"bottom",className:"text-xs",children:W("featureDrawer.deleteFeature")})]})]}),(0,t.jsx)(A.DeleteFeatureDialog,{open:eT,onOpenChange:eS,onConfirm:(e,t,s)=>e5(er.featureId,e,t,s),isDeleting:ek,featureName:er.name,featureId:er.featureId,hasChildren:er.hasChildren,hasOpenPr:!!er.pr&&"Open"===er.pr.status})]}):null]})]})})}let tp=null;if("feature"===_.type&&er){let e={...er,..."error"===er.state&&{onRetry:e6},..."pending"===er.state&&{onStart:e9}};tp=(0,t.jsx)(sk,{featureName:er.name,headerContent:U,featureNode:e,featureId:er.featureId,initialTab:_.initialTab,urlTab:h,sseEvents:el,prdData:ex,prdSelections:ep,onPrdSelect:(e,t)=>eh(s=>({...s,[e]:t})),onPrdApprove:e0,onPrdReject:eQ,isPrdLoading:eO,techData:eb,onTechApprove:e1,onTechReject:eJ,isTechLoading:eU,productData:eV?null:ev,mergeData:eN,onMergeApprove:e2,onMergeReject:eX,isMergeLoading:eW,syncStatus:ts?ta:void 0,syncLoading:tr,syncError:tn,onRefreshSync:ts?tl:void 0,onRebaseOnMain:ts?tt.rebaseOnMain:void 0,rebaseLoading:tt.rebaseLoading,rebaseError:tt.rebaseError,isRejecting:eA,chatInput:ec,onChatInputChange:eu,pinnedConfig:en&&Z?{...Z,saving:Y,error:et,onSave:e7}:void 0,continuationActionsDisabled:Y,interactiveAgentEnabled:z,onRetry:e6,onStop:e8,onStart:e9})}return(0,t.jsx)(R.BaseDrawer,{open:eo,onClose:eK,size:"lg",modal:!1,"data-testid":"feature"===_.type?"feature-drawer":"repository-drawer",children:tp})}e.s(["FeatureDrawerClient",()=>sL],36986)}]);
|