@shipit-ai/cli 1.169.0 → 1.170.0-pr13.00cc956
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/ClaudeCodeProxyConfig.yaml +20 -0
- package/apis/json-schema/FeatureFlags.yaml +5 -0
- package/apis/json-schema/LiteLLMProxyConfig.yaml +17 -0
- package/apis/json-schema/LiteLLMProxyRoutingMode.yaml +8 -0
- package/apis/json-schema/Settings.yaml +3 -0
- 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/plugin-marketplace.interface.d.ts +46 -0
- package/dist/packages/core/src/application/ports/output/services/plugin-marketplace.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/plugin-marketplace.interface.js +12 -0
- package/dist/packages/core/src/application/use-cases/plugins/add-marketplace.use-case.d.ts +16 -0
- package/dist/packages/core/src/application/use-cases/plugins/add-marketplace.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/plugins/add-marketplace.use-case.js +34 -0
- package/dist/packages/core/src/application/use-cases/plugins/fetch-plugin-catalog.use-case.d.ts +24 -0
- package/dist/packages/core/src/application/use-cases/plugins/fetch-plugin-catalog.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/plugins/fetch-plugin-catalog.use-case.js +52 -0
- package/dist/packages/core/src/application/use-cases/plugins/install-plugin.use-case.d.ts +17 -0
- package/dist/packages/core/src/application/use-cases/plugins/install-plugin.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/plugins/install-plugin.use-case.js +33 -0
- package/dist/packages/core/src/application/use-cases/plugins/toggle-plugin.use-case.d.ts +17 -0
- package/dist/packages/core/src/application/use-cases/plugins/toggle-plugin.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/plugins/toggle-plugin.use-case.js +33 -0
- package/dist/packages/core/src/application/use-cases/plugins/uninstall-plugin.use-case.d.ts +16 -0
- package/dist/packages/core/src/application/use-cases/plugins/uninstall-plugin.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/plugins/uninstall-plugin.use-case.js +33 -0
- 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 +1 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +59 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +6 -0
- package/dist/packages/core/src/infrastructure/di/modules/services.module.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/modules/services.module.js +13 -0
- package/dist/packages/core/src/infrastructure/di/modules/use-cases.module.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/modules/use-cases.module.js +12 -0
- package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/modules/web-tokens.module.js +22 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +9 -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 +55 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-litellm-proxy.d.ts +14 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-litellm-proxy.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-litellm-proxy.js +28 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-litellm-proxy-agent-config.d.ts +15 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-litellm-proxy-agent-config.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-litellm-proxy-agent-config.js +32 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +36 -5
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-provider.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/agent-executor-provider.service.js +7 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts +4 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/claude-code-executor.service.js +53 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +5 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/index.d.ts +4 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/index.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/index.js +3 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.schema.d.ts +78 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.schema.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.schema.js +46 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.service.d.ts +29 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.service.js +147 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.validators.d.ts +11 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.validators.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/plugin-marketplace/plugin-marketplace.validators.js +47 -0
- package/dist/src/presentation/web/app/actions/add-marketplace.d.ts +5 -0
- package/dist/src/presentation/web/app/actions/add-marketplace.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/add-marketplace.js +11 -0
- package/dist/src/presentation/web/app/actions/fetch-plugin-catalog.d.ts +5 -0
- package/dist/src/presentation/web/app/actions/fetch-plugin-catalog.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/fetch-plugin-catalog.js +11 -0
- package/dist/src/presentation/web/app/actions/install-plugin.d.ts +5 -0
- package/dist/src/presentation/web/app/actions/install-plugin.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/install-plugin.js +11 -0
- package/dist/src/presentation/web/app/actions/toggle-plugin.d.ts +5 -0
- package/dist/src/presentation/web/app/actions/toggle-plugin.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/toggle-plugin.js +11 -0
- package/dist/src/presentation/web/app/actions/uninstall-plugin.d.ts +5 -0
- package/dist/src/presentation/web/app/actions/uninstall-plugin.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/uninstall-plugin.js +11 -0
- package/dist/src/presentation/web/app/plugins/page.d.ts +2 -0
- package/dist/src/presentation/web/app/plugins/page.d.ts.map +1 -0
- package/dist/src/presentation/web/app/plugins/page.js +23 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.stories.js +1 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-card.d.ts +9 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-card.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-card.js +15 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-card.stories.d.ts +17 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-card.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-card.stories.js +60 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-detail-drawer.d.ts +11 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-detail-drawer.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-detail-drawer.js +33 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-detail-drawer.stories.d.ts +18 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-detail-drawer.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/plugins/plugin-detail-drawer.stories.js +51 -0
- package/dist/src/presentation/web/components/features/plugins/plugins-page-client.d.ts +6 -0
- package/dist/src/presentation/web/components/features/plugins/plugins-page-client.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/plugins/plugins-page-client.js +124 -0
- package/dist/src/presentation/web/components/features/plugins/plugins-page-client.stories.d.ts +12 -0
- package/dist/src/presentation/web/components/features/plugins/plugins-page-client.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/plugins/plugins-page-client.stories.js +24 -0
- package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.js +7 -0
- package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.js +2 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.d.ts +6 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.js +69 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-routing-section.stories.js +64 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-settings-section.d.ts +6 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-settings-section.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-settings-section.js +73 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-settings-section.stories.d.ts +15 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-settings-section.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/litellm-proxy-settings-section.stories.js +29 -0
- package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.js +5 -2
- package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.js +1 -0
- 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 +6 -2
- package/dist/src/presentation/web/components/features/tools/tools-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/tools/tools-page-client.js +23 -4
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +2 -2
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.js +1 -0
- package/dist/src/presentation/web/hooks/feature-flags-context.d.ts.map +1 -1
- package/dist/src/presentation/web/hooks/feature-flags-context.js +1 -0
- package/dist/src/presentation/web/lib/feature-flags.d.ts +2 -0
- package/dist/src/presentation/web/lib/feature-flags.d.ts.map +1 -1
- package/dist/src/presentation/web/lib/feature-flags.js +6 -0
- package/dist/translations/ar/web.json +56 -2
- package/dist/translations/de/web.json +56 -2
- package/dist/translations/en/web.json +56 -2
- package/dist/translations/es/web.json +56 -2
- package/dist/translations/fr/web.json +56 -2
- package/dist/translations/he/web.json +56 -2
- package/dist/translations/pt/web.json +56 -2
- package/dist/translations/ru/web.json +56 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +1 -0
- package/web/.next/build-manifest.json +3 -3
- package/web/.next/fallback-build-manifest.json +3 -3
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/routes-manifest.json +6 -0
- 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.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/server-reference-manifest.json +27 -27
- 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/server-reference-manifest.json +31 -31
- 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/server-reference-manifest.json +37 -37
- 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/server-reference-manifest.json +37 -37
- 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/server-reference-manifest.json +28 -28
- 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/server-reference-manifest.json +28 -28
- 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/server-reference-manifest.json +27 -27
- 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/server-reference-manifest.json +31 -31
- 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/server-reference-manifest.json +37 -37
- 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/server-reference-manifest.json +37 -37
- 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/server-reference-manifest.json +27 -27
- 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/server-reference-manifest.json +28 -28
- 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/server-reference-manifest.json +28 -28
- 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.html +1 -1
- 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/server-reference-manifest.json +6 -6
- 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/dialog/pick-files/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 +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 +1 -1
- package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
- package/web/.next/server/app/api/sessions-batch/route.js +1 -1
- package/web/.next/server/app/api/sessions-batch/route.js.nft.json +1 -1
- package/web/.next/server/app/plugins/page/app-paths-manifest.json +3 -0
- package/web/.next/server/app/plugins/page/build-manifest.json +18 -0
- package/web/.next/server/app/plugins/page/next-font-manifest.json +10 -0
- package/web/.next/server/app/plugins/page/react-loadable-manifest.json +8 -0
- package/web/.next/server/app/plugins/page/server-reference-manifest.json +185 -0
- package/web/.next/server/app/plugins/page.js +17 -0
- package/web/.next/server/app/plugins/page.js.map +5 -0
- package/web/.next/server/app/plugins/page.js.nft.json +1 -0
- package/web/.next/server/app/plugins/page_client-reference-manifest.js +3 -0
- package/web/.next/server/app/settings/page/server-reference-manifest.json +34 -22
- package/web/.next/server/app/settings/page.js +1 -1
- 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/server-reference-manifest.json +11 -11
- 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/server-reference-manifest.json +11 -11
- 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/server-reference-manifest.json +6 -6
- 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/app-paths-manifest.json +1 -0
- package/web/.next/server/chunks/11es_next_dist_esm_build_templates_app-route_067cwst.js +1 -1
- package/web/.next/server/chunks/11es_next_dist_esm_build_templates_app-route_067cwst.js.map +1 -1
- package/web/.next/server/chunks/{[root-of-the-server]__0zu_byw._.js → [root-of-the-server]__07suer1._.js} +2 -2
- package/web/.next/server/chunks/{[root-of-the-server]__0u1jyv9._.js → [root-of-the-server]__0sgzo7y._.js} +2 -2
- package/web/.next/server/chunks/[root-of-the-server]__0tb~wwk._.js +1 -1
- package/web/.next/server/chunks/{[root-of-the-server]__08cpfre._.js → [root-of-the-server]__0uxlr84._.js} +2 -2
- package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js +1 -1
- package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_create-drawer-client_tsx_0g70fc5._.js.map +1 -1
- package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js +2 -2
- package/web/.next/server/chunks/ssr/0j.8_web_components_common_control-center-drawer_feature-drawer-client_tsx_104cna.._.js.map +1 -1
- package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js +1 -1
- package/web/.next/server/chunks/ssr/0ukq_presentation_web_components_features_settings_settings-page-client_tsx_0j1uius._.js.map +1 -1
- package/web/.next/server/chunks/ssr/11es_next_dist_esm_build_templates_app-page_0y6lfp8.js +4 -0
- package/web/.next/server/chunks/ssr/11es_next_dist_esm_build_templates_app-page_0y6lfp8.js.map +1 -0
- package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js +1 -1
- package/web/.next/server/chunks/ssr/11y9_components_common_control-center-drawer_repository-drawer-client_tsx_09z.znp._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_04s_q5r._.js → 12k._sonner_dist_index_mjs_0-vmpk5._.js} +2 -2
- package/web/.next/server/chunks/ssr/12k._sonner_dist_index_mjs_0-vmpk5._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__0rvrr1j._.js → [root-of-the-server]__0.5ojmt._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0.5ojmt._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__04h~gav._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__04h~gav._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__05_qc0n._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__05_qc0n._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0dec29w._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0dec29w._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0ge~xny._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0ge~xny._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0qda~yi._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0qda~yi._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0rv1gci._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0tq2syh._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0t~u8sd._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0t~u8sd._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__10tll_l._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__10tll_l._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__12j29w-._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__12j29w-._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_01sesw0._.js +1 -1
- package/web/.next/server/chunks/ssr/_01sesw0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_00u~.41._.js → _03x4h9e._.js} +2 -2
- package/web/.next/server/chunks/ssr/_03x4h9e._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_0~0jkp_._.js → _05fk0a4._.js} +2 -2
- package/web/.next/server/chunks/ssr/_05fk0a4._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_069y.js._.js +2 -2
- package/web/.next/server/chunks/ssr/_069y.js._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_083k45~._.js +3 -0
- package/web/.next/server/chunks/ssr/_083k45~._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0__4si~._.js +1 -1
- package/web/.next/server/chunks/ssr/_0__4si~._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0_m17kl._.js +1 -1
- package/web/.next/server/chunks/ssr/_0_m17kl._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0d4miu.._.js +1 -1
- package/web/.next/server/chunks/ssr/_0d4miu.._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0e8ern9._.js +1 -1
- package/web/.next/server/chunks/ssr/_0e8ern9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0i~-084._.js +3 -0
- package/web/.next/server/chunks/ssr/_0i~-084._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_0wor25i._.js → _0job75~._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_0wor25i._.js.map → _0job75~._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_0jtr2u0._.js +3 -0
- package/web/.next/server/chunks/ssr/_0jtr2u0._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0kaec~c._.js +3 -0
- package/web/.next/server/chunks/ssr/_0kaec~c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0o.xc6x._.js +3 -0
- package/web/.next/server/chunks/ssr/_0o.xc6x._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_0hw~zvl._.js → _0o_oaao._.js} +2 -2
- package/web/.next/server/chunks/ssr/_0o_oaao._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0p3~u8u._.js +2 -2
- package/web/.next/server/chunks/ssr/_0p3~u8u._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0r.3n~3._.js +1 -1
- package/web/.next/server/chunks/ssr/_0r.3n~3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0rcx2-c._.js +9 -0
- package/web/.next/server/chunks/ssr/_0rcx2-c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0t59q8r._.js +1 -1
- package/web/.next/server/chunks/ssr/_0t59q8r._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0tcccbb._.js +1 -1
- package/web/.next/server/chunks/ssr/_0tcccbb._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_0pa1dkv._.js → _0u3d8.n._.js} +2 -2
- package/web/.next/server/chunks/ssr/_0u3d8.n._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0vyfc4b._.js +1 -1
- package/web/.next/server/chunks/ssr/_0vyfc4b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0w-_hww._.js +1 -1
- package/web/.next/server/chunks/ssr/_0w-_hww._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_09r54oy._.js → _0ygafoy._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_09r54oy._.js.map → _0ygafoy._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_0zk-h5w._.js +1 -1
- package/web/.next/server/chunks/ssr/_0zk-h5w._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0~7lwu_._.js +1 -1
- package/web/.next/server/chunks/ssr/_0~7lwu_._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_01qdxy2._.js → _0~b~4sr._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_01qdxy2._.js.map → _0~b~4sr._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_10joy2y._.js +3 -0
- package/web/.next/server/chunks/ssr/_10joy2y._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_1161g9x._.js +1 -1
- package/web/.next/server/chunks/ssr/_1161g9x._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_plugins_page_actions_0rdndum.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_plugins_page_actions_0rdndum.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_05m2q~u.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_0.6zk.t.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_0pjb_re._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_0w2wqvu._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_0l3oxx9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_0aji.op._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_0aji.op._.js.map +1 -1
- package/web/.next/server/middleware-build-manifest.js +3 -3
- package/web/.next/server/next-font-manifest.js +1 -1
- package/web/.next/server/next-font-manifest.json +3 -0
- package/web/.next/server/pages/500.html +1 -1
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +187 -61
- package/web/.next/static/chunks/0.s8cxri-_s9l.js +1 -0
- package/web/.next/static/chunks/012cnd7koqv6d.js +7 -0
- package/web/.next/static/chunks/{0dq50gtgaj63f.js → 029s48ykt7mw9.js} +1 -1
- package/web/.next/static/chunks/{11vbir.u7_zf7.js → 03agfpdm4n_fn.js} +1 -1
- package/web/.next/static/chunks/05qti39qqsvzs.js +1 -0
- package/web/.next/static/chunks/{0fg~vc93spa9c.js → 07gal-~-zwagj.js} +1 -1
- package/web/.next/static/chunks/{0u_27fdqa2jeg.js → 0abfw8oib7e3t.js} +1 -1
- package/web/.next/static/chunks/{0in4l8mne5y~_.js → 0b2pi58fg3lt3.js} +1 -1
- package/web/.next/static/chunks/{121v1_d_dfk2k.js → 0boet02f0igne.js} +1 -1
- package/web/.next/static/chunks/0f80ru2bzs3v5.js +1 -0
- package/web/.next/static/chunks/{12axopx66pocj.js → 0ibyqd4oceukb.js} +2 -2
- package/web/.next/static/chunks/{0v~n9z6b639zm.js → 0jwq.mr-.ltps.js} +1 -1
- package/web/.next/static/chunks/0k8m.qcahm63g.js +1 -0
- package/web/.next/static/chunks/0kqqf5i.f1-nm.js +1 -0
- package/web/.next/static/chunks/0lc0x8kcu46ae.js +1 -0
- package/web/.next/static/chunks/{183ehj-b80a~o.js → 0nfd9bvcnbcgl.js} +1 -1
- package/web/.next/static/chunks/{1874_wt9rit96.js → 0o5siyl.hsy96.js} +1 -1
- package/web/.next/static/chunks/0s0432bko4hq9.js +1 -0
- package/web/.next/static/chunks/{0o33urrd3lk~u.js → 0skduwu0tu8qh.js} +1 -1
- package/web/.next/static/chunks/0ug478hm-8bog.js +5 -0
- package/web/.next/static/chunks/{0yibymrb2j05t.css → 0v7r7y~3e~oo6.css} +1 -1
- package/web/.next/static/chunks/{00m_fbc2z1gyi.js → 0~5~-wr7rq8b6.js} +3 -3
- package/web/.next/static/chunks/{09f2lesd_dd3~.js → 10gfhk-66cbtu.js} +1 -1
- package/web/.next/static/chunks/{0k0j7anrbg-of.js → 10lvozwidvzfo.js} +3 -3
- package/web/.next/static/chunks/10rtagfoabp3b.js +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0qxd563._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0qxd563._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0rvrr1j._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_00u~.41._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_04s_q5r._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0a_8rlj._.js +0 -3
- package/web/.next/server/chunks/ssr/_0a_8rlj._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0dy8.0k._.js +0 -3
- package/web/.next/server/chunks/ssr/_0dy8.0k._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0gdghcr._.js +0 -3
- package/web/.next/server/chunks/ssr/_0gdghcr._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0hw~zvl._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0l2~~pi._.js +0 -3
- package/web/.next/server/chunks/ssr/_0l2~~pi._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0n.magx._.js +0 -3
- package/web/.next/server/chunks/ssr/_0n.magx._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0pa1dkv._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0y8u4.e._.js +0 -9
- package/web/.next/server/chunks/ssr/_0y8u4.e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0~0jkp_._.js.map +0 -1
- package/web/.next/static/chunks/0-ud~1jj7chzu.js +0 -7
- package/web/.next/static/chunks/0c0dau5pmseko.js +0 -1
- package/web/.next/static/chunks/0n3kuj7t_-jzp.js +0 -1
- package/web/.next/static/chunks/0pt-d18f7zxvv.js +0 -1
- package/web/.next/static/chunks/0xwh.0u-dexsl.js +0 -1
- package/web/.next/static/chunks/103xnw203o9k1.js +0 -1
- package/web/.next/static/chunks/12pd180jp8zu..js +0 -5
- package/web/.next/static/chunks/13fcwhkw7dle2.js +0 -1
- package/web/.next/static/chunks/13q1peb_t9vj8.js +0 -1
- /package/web/.next/server/chunks/{[root-of-the-server]__0zu_byw._.js.map → [root-of-the-server]__07suer1._.js.map} +0 -0
- /package/web/.next/server/chunks/{[root-of-the-server]__0u1jyv9._.js.map → [root-of-the-server]__0sgzo7y._.js.map} +0 -0
- /package/web/.next/server/chunks/{[root-of-the-server]__08cpfre._.js.map → [root-of-the-server]__0uxlr84._.js.map} +0 -0
- /package/web/.next/static/{SNdaKJ9fpre8tUMRe1jlA → GeXKcODhEHBnDRVLMaAnW}/_buildManifest.js +0 -0
- /package/web/.next/static/{SNdaKJ9fpre8tUMRe1jlA → GeXKcODhEHBnDRVLMaAnW}/_clientMiddlewareManifest.js +0 -0
- /package/web/.next/static/{SNdaKJ9fpre8tUMRe1jlA → GeXKcODhEHBnDRVLMaAnW}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56060,e=>{"use strict";let a=(0,e.i(54864).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,a],56060)},36479,e=>{"use strict";var a=e.i(96871),t=e.i(16539),s=e.i(33109),r=e.i(60112),o=e.i(96976);let n=(0,o.createServerReference)("40d5c0f121621395326fd600c6541bc6b843d1eae6",o.callServer,void 0,o.findSourceMapURL,"adoptBranch"),l=(0,o.createServerReference)("40023cdcdad1109302b8a531627b0f86de2a4f6519",o.callServer,void 0,o.findSourceMapURL,"listBranches");var i=e.i(85149),c=e.i(91653),d=e.i(56060),p=e.i(60589),h=e.i(79561);e.i(1650);var u=e.i(11495),m=e.i(45811),x=e.i(35364),f=e.i(98127),b=e.i(41957),v=e.i(68787),g=e.i(31777);let j=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));j.displayName="Command";let w=t.forwardRef(({className:e,...t},s)=>(0,a.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,a.jsx)(v.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)("input",{ref:s,className:(0,g.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));w.displayName="CommandInput";let N=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));N.displayName="CommandList";let y=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-muted-foreground py-6 text-center text-sm",e),...t}));y.displayName="CommandEmpty";let C=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-foreground overflow-hidden p-1",e),...t}));C.displayName="CommandGroup";let S=t.forwardRef(({className:e,selected:t,...s},r)=>(0,a.jsx)("button",{ref:r,type:"button","data-selected":t,className:(0,g.cn)("relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none","hover:bg-accent hover:text-accent-foreground","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",e),...s}));S.displayName="CommandItem",t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-border -mx-1 h-px",e),...t})).displayName="CommandSeparator";var k=e.i(90382);function R({open:e,onClose:s,onSubmit:r,isSubmitting:o=!1,error:n,repositories:l=[],selectedRepositoryPath:v,onRepositoryChange:L,branches:B=[],branchesLoading:P=!1}){let[E,D]=(0,t.useState)(""),[T,I]=(0,t.useState)(!1),[U,A]=(0,t.useState)(""),O=(0,t.useRef)(null),[F,G]=(0,t.useState)(!1),[K,M]=(0,t.useState)(""),$=(0,t.useRef)(null),z=l.find(e=>e.path===v),W=!!v;(0,t.useEffect)(()=>{e||(D(""),A(""),I(!1),G(!1),M(""))},[e]),(0,t.useEffect)(()=>{D(""),A("")},[v]);let q=(0,t.useCallback)(e=>{e.preventDefault();let a=E.trim();a&&v&&!o&&r(a,v)},[E,v,o,r]),H=(0,t.useCallback)(()=>{D(""),A(""),s()},[s]),J=(0,t.useCallback)(e=>{D(e),A(e),I(!1)},[]),Q=(0,t.useCallback)(e=>{A(e.target.value),T||I(!0)},[T]),V=(0,t.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let a=U.trim();a&&(D(a),I(!1))}"Escape"===e.key&&(I(!1),A(E))},[U,E]),X=(0,t.useCallback)(e=>{L?.(e),G(!1),M("")},[L]),Y=B.filter(e=>e.toLowerCase().includes(U.toLowerCase())),Z=K.trim()?l.filter(e=>e.name.toLowerCase().includes(K.toLowerCase())||e.path.toLowerCase().includes(K.toLowerCase())):l;(0,t.useEffect)(()=>{F?setTimeout(()=>$.current?.focus(),0):M("")},[F]);let _=!E.trim()||!v||o,ee=(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.DrawerTitle,{className:"flex items-center gap-2",children:[(0,a.jsx)(p.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,a.jsx)(m.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into ShipIT's feature tracking"})]});return(0,a.jsx)(u.BaseDrawer,{open:e,onClose:H,size:"sm",modal:!1,header:ee,"data-testid":"adopt-branch-drawer",children:(0,a.jsxs)("form",{onSubmit:q,className:"flex flex-1 flex-col",children:[(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{children:"Repository"}),(0,a.jsxs)(k.Popover,{open:F,onOpenChange:G,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",role:"combobox","aria-expanded":F,"aria-label":"Repository",disabled:o,"data-testid":"adopt-repo-combobox",className:(0,g.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!z&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:"truncate",children:z?z.name:"Select repository..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-combobox-content",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"border-b p-2",children:(0,a.jsx)(f.Input,{ref:$,placeholder:"Search repositories...",value:K,onChange:e=>M(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===Z.length?(0,a.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):Z.map(e=>(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":v===e.path,onClick:()=>X(e.path),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",v===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,a.jsx)(c.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",v!==e.path&&"invisible")}),(0,a.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,a.jsxs)(k.Popover,{open:T,onOpenChange:I,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(x.Button,{variant:"outline",role:"combobox","aria-expanded":T,"aria-invalid":!!n,"aria-describedby":n?"adopt-branch-error-msg":void 0,disabled:o||!W,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,a.jsx)("span",{className:"truncate",children:W?P?"Loading branches...":E||"Select a branch...":"Select a repository first..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,a.jsxs)(j,{children:[(0,a.jsx)(w,{ref:O,placeholder:"Search branches...",value:U,onChange:Q,onKeyDown:V,"data-testid":"adopt-branch-search"}),(0,a.jsxs)(N,{children:[!P&&0===Y.length&&(0,a.jsx)(y,{children:0===B.length?"No branches found.":U?"No match — press Enter to use this value.":"No branches available."}),P?(0,a.jsx)(y,{children:(0,a.jsx)(h.LoaderCircle,{className:"mx-auto h-4 w-4 animate-spin"})}):null,Y.length>0&&(0,a.jsx)(C,{children:Y.map(e=>(0,a.jsxs)(S,{selected:e===E,onClick:()=>J(e),children:[(0,a.jsx)(i.Check,{className:(0,g.cn)("me-2 h-4 w-4",e===E?"opacity-100":"opacity-0")}),(0,a.jsx)(p.GitBranch,{className:"me-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:W?"Select a branch from the dropdown or type to search. Local and remote branches are shown.":"Please select a repository above to see available branches."})]}),n?(0,a.jsx)("p",{id:"adopt-branch-error-msg",className:"text-destructive text-sm",role:"alert","data-testid":"adopt-branch-error",children:n}):null]})}),(0,a.jsx)("div",{className:"border-t p-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Button,{type:"button",variant:"outline",onClick:H,disabled:o,className:"flex-1",children:"Cancel"}),(0,a.jsx)(x.Button,{type:"submit",disabled:_,className:"flex-1","data-testid":"adopt-branch-submit",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.LoaderCircle,{className:"me-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}e.s(["AdoptDrawerClient",0,function({repositoryPath:e,repositories:o}){let i=(0,s.useRouter)(),c=(0,s.usePathname)(),[d,p]=(0,t.useState)(!1),[h,u]=(0,t.useState)(),[m,x]=(0,t.useState)([]),[f,b]=(0,t.useState)(!1),[v,g]=(0,t.useState)(e),j=c.startsWith("/adopt"),w=!d&&j;(0,t.useEffect)(()=>{!j&&d&&p(!1)},[j,d]),(0,t.useEffect)(()=>{j&&(u(void 0),g(e))},[j,e]),(0,t.useEffect)(()=>{j&&v?(b(!0),x([]),l(v).then(x).catch(()=>x([])).finally(()=>b(!1))):x([])},[j,v]);let N=(0,t.useCallback)(()=>{i.push("/")},[i]),y=(0,t.useCallback)(e=>{g(e)},[]),C=(0,t.useCallback)((e,a)=>{u(void 0),p(!0),i.push("/"),n({branchName:e,repositoryPath:a}).then(e=>{e.error?r.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),r.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{r.toast.error("Failed to adopt branch"),p(!1)})},[i]);return(0,a.jsx)(R,{open:w,onClose:N,onSubmit:C,isSubmitting:d,error:h,repositories:o,selectedRepositoryPath:v,onRepositoryChange:y,branches:m,branchesLoading:f})}],36479)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,56060,e=>{"use strict";let a=(0,e.i(54864).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",0,a],56060)},36479,e=>{"use strict";var a=e.i(96871),t=e.i(16539),s=e.i(33109),r=e.i(60112),o=e.i(96976);let n=(0,o.createServerReference)("404ff9386f6ec8d26ecdb1699ae6265dd5b8379976",o.callServer,void 0,o.findSourceMapURL,"adoptBranch"),l=(0,o.createServerReference)("4096839a01fbc3f5f042d78eed2caceb50598f4400",o.callServer,void 0,o.findSourceMapURL,"listBranches");var i=e.i(85149),c=e.i(91653),d=e.i(56060),p=e.i(60589),h=e.i(79561);e.i(1650);var u=e.i(11495),m=e.i(45811),x=e.i(35364),f=e.i(98127),b=e.i(41957),v=e.i(68787),g=e.i(31777);let j=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t}));j.displayName="Command";let w=t.forwardRef(({className:e,...t},s)=>(0,a.jsxs)("div",{className:"flex items-center border-b px-3",children:[(0,a.jsx)(v.Search,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),(0,a.jsx)("input",{ref:s,className:(0,g.cn)("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));w.displayName="CommandInput";let N=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("max-h-[300px] overflow-x-hidden overflow-y-auto",e),...t}));N.displayName="CommandList";let y=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-muted-foreground py-6 text-center text-sm",e),...t}));y.displayName="CommandEmpty";let C=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("text-foreground overflow-hidden p-1",e),...t}));C.displayName="CommandGroup";let S=t.forwardRef(({className:e,selected:t,...s},r)=>(0,a.jsx)("button",{ref:r,type:"button","data-selected":t,className:(0,g.cn)("relative flex w-full cursor-default items-center rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none","hover:bg-accent hover:text-accent-foreground","data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50",e),...s}));S.displayName="CommandItem",t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("div",{ref:s,className:(0,g.cn)("bg-border -mx-1 h-px",e),...t})).displayName="CommandSeparator";var k=e.i(90382);function R({open:e,onClose:s,onSubmit:r,isSubmitting:o=!1,error:n,repositories:l=[],selectedRepositoryPath:v,onRepositoryChange:L,branches:B=[],branchesLoading:P=!1}){let[E,D]=(0,t.useState)(""),[T,I]=(0,t.useState)(!1),[U,A]=(0,t.useState)(""),O=(0,t.useRef)(null),[F,G]=(0,t.useState)(!1),[K,M]=(0,t.useState)(""),$=(0,t.useRef)(null),z=l.find(e=>e.path===v),W=!!v;(0,t.useEffect)(()=>{e||(D(""),A(""),I(!1),G(!1),M(""))},[e]),(0,t.useEffect)(()=>{D(""),A("")},[v]);let q=(0,t.useCallback)(e=>{e.preventDefault();let a=E.trim();a&&v&&!o&&r(a,v)},[E,v,o,r]),H=(0,t.useCallback)(()=>{D(""),A(""),s()},[s]),J=(0,t.useCallback)(e=>{D(e),A(e),I(!1)},[]),Q=(0,t.useCallback)(e=>{A(e.target.value),T||I(!0)},[T]),V=(0,t.useCallback)(e=>{if("Enter"===e.key){e.preventDefault();let a=U.trim();a&&(D(a),I(!1))}"Escape"===e.key&&(I(!1),A(E))},[U,E]),X=(0,t.useCallback)(e=>{L?.(e),G(!1),M("")},[L]),Y=B.filter(e=>e.toLowerCase().includes(U.toLowerCase())),Z=K.trim()?l.filter(e=>e.name.toLowerCase().includes(K.toLowerCase())||e.path.toLowerCase().includes(K.toLowerCase())):l;(0,t.useEffect)(()=>{F?setTimeout(()=>$.current?.focus(),0):M("")},[F]);let _=!E.trim()||!v||o,ee=(0,a.jsxs)("div",{children:[(0,a.jsxs)(m.DrawerTitle,{className:"flex items-center gap-2",children:[(0,a.jsx)(p.GitBranch,{className:"h-4 w-4"}),"Adopt Branch"]}),(0,a.jsx)(m.DrawerDescription,{className:"text-muted-foreground text-sm",children:"Import an existing git branch into ShipIT's feature tracking"})]});return(0,a.jsx)(u.BaseDrawer,{open:e,onClose:H,size:"sm",modal:!1,header:ee,"data-testid":"adopt-branch-drawer",children:(0,a.jsxs)("form",{onSubmit:q,className:"flex flex-1 flex-col",children:[(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{children:"Repository"}),(0,a.jsxs)(k.Popover,{open:F,onOpenChange:G,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",role:"combobox","aria-expanded":F,"aria-label":"Repository",disabled:o,"data-testid":"adopt-repo-combobox",className:(0,g.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!z&&"text-muted-foreground"),children:[(0,a.jsx)("span",{className:"truncate",children:z?z.name:"Select repository..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"adopt-repo-combobox-content",children:(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("div",{className:"border-b p-2",children:(0,a.jsx)(f.Input,{ref:$,placeholder:"Search repositories...",value:K,onChange:e=>M(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"adopt-repo-search"})}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===Z.length?(0,a.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No repositories found."}):Z.map(e=>(0,a.jsxs)("button",{type:"button",role:"option","aria-selected":v===e.path,onClick:()=>X(e.path),className:(0,g.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",v===e.path&&"bg-accent/50"),"data-testid":`adopt-repo-option-${e.id}`,children:[(0,a.jsx)(c.CheckIcon,{className:(0,g.cn)("h-4 w-4 shrink-0",v!==e.path&&"invisible")}),(0,a.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:"Select the repository that contains the branch you want to adopt."})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(b.Label,{htmlFor:"branch-name",children:"Branch name"}),(0,a.jsxs)(k.Popover,{open:T,onOpenChange:I,children:[(0,a.jsx)(k.PopoverTrigger,{asChild:!0,children:(0,a.jsxs)(x.Button,{variant:"outline",role:"combobox","aria-expanded":T,"aria-invalid":!!n,"aria-describedby":n?"adopt-branch-error-msg":void 0,disabled:o||!W,className:"w-full justify-between font-normal","data-testid":"adopt-branch-input",children:[(0,a.jsx)("span",{className:"truncate",children:W?P?"Loading branches...":E||"Select a branch...":"Select a repository first..."}),(0,a.jsx)(d.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,a.jsx)(k.PopoverContent,{className:"w-[var(--radix-popover-trigger-width)] p-0",align:"start",children:(0,a.jsxs)(j,{children:[(0,a.jsx)(w,{ref:O,placeholder:"Search branches...",value:U,onChange:Q,onKeyDown:V,"data-testid":"adopt-branch-search"}),(0,a.jsxs)(N,{children:[!P&&0===Y.length&&(0,a.jsx)(y,{children:0===B.length?"No branches found.":U?"No match — press Enter to use this value.":"No branches available."}),P?(0,a.jsx)(y,{children:(0,a.jsx)(h.LoaderCircle,{className:"mx-auto h-4 w-4 animate-spin"})}):null,Y.length>0&&(0,a.jsx)(C,{children:Y.map(e=>(0,a.jsxs)(S,{selected:e===E,onClick:()=>J(e),children:[(0,a.jsx)(i.Check,{className:(0,g.cn)("me-2 h-4 w-4",e===E?"opacity-100":"opacity-0")}),(0,a.jsx)(p.GitBranch,{className:"me-2 h-3 w-3 opacity-50"}),e]},e))})]})]})})]}),(0,a.jsx)("p",{className:"text-muted-foreground text-xs",children:W?"Select a branch from the dropdown or type to search. Local and remote branches are shown.":"Please select a repository above to see available branches."})]}),n?(0,a.jsx)("p",{id:"adopt-branch-error-msg",className:"text-destructive text-sm",role:"alert","data-testid":"adopt-branch-error",children:n}):null]})}),(0,a.jsx)("div",{className:"border-t p-4",children:(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(x.Button,{type:"button",variant:"outline",onClick:H,disabled:o,className:"flex-1",children:"Cancel"}),(0,a.jsx)(x.Button,{type:"submit",disabled:_,className:"flex-1","data-testid":"adopt-branch-submit",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.LoaderCircle,{className:"me-2 h-4 w-4 animate-spin"}),"Adopting..."]}):"Adopt Branch"})]})})]})})}e.s(["AdoptDrawerClient",0,function({repositoryPath:e,repositories:o}){let i=(0,s.useRouter)(),c=(0,s.usePathname)(),[d,p]=(0,t.useState)(!1),[h,u]=(0,t.useState)(),[m,x]=(0,t.useState)([]),[f,b]=(0,t.useState)(!1),[v,g]=(0,t.useState)(e),j=c.startsWith("/adopt"),w=!d&&j;(0,t.useEffect)(()=>{!j&&d&&p(!1)},[j,d]),(0,t.useEffect)(()=>{j&&(u(void 0),g(e))},[j,e]),(0,t.useEffect)(()=>{j&&v?(b(!0),x([]),l(v).then(x).catch(()=>x([])).finally(()=>b(!1))):x([])},[j,v]);let N=(0,t.useCallback)(()=>{i.push("/")},[i]),y=(0,t.useCallback)(e=>{g(e)},[]),C=(0,t.useCallback)((e,a)=>{u(void 0),p(!0),i.push("/"),n({branchName:e,repositoryPath:a}).then(e=>{e.error?r.toast.error(e.error):(window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:e.feature.id,name:e.feature.name,description:e.feature.description,repositoryPath:e.feature.repositoryPath}})),r.toast.success(`Branch adopted as "${e.feature.name}"`))}).catch(()=>{r.toast.error("Failed to adopt branch"),p(!1)})},[i]);return(0,a.jsx)(R,{open:w,onClose:N,onSubmit:C,isSubmitting:d,error:h,repositories:o,selectedRepositoryPath:v,onRepositoryChange:y,branches:m,branchesLoading:f})}],36479)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41952,e=>{"use strict";var t=e.i(96871),i=e.i(16539),n=e.i(51818),s=e.i(70727),a=e.i(60589),o=e.i(91060),l=e.i(54864);let r=(0,l.default)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),c=(0,l.default)("flag",[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]]),d=(0,l.default)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);var u=e.i(99413),g=e.i(85202);let h=(0,l.default)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),p=(0,l.default)("layout-list",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]]);var m=e.i(68316);e.i(26759);var f=e.i(97164),x=e.i(31777),v=e.i(9749),b=e.i(84812),b=b,w=e.i(68637),y=e.i(84735),j=e.i(81481),k=e.i(41957),S=e.i(51911),C=e.i(2828);function M({label:e,description:i,htmlFor:n,tooltip:s,children:a}){let o=s??i;return(0,t.jsxs)("div",{className:"flex items-center justify-between gap-4 border-b py-2.5 last:border-b-0",children:[(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(k.Label,{htmlFor:n,className:"cursor-pointer text-sm font-normal whitespace-nowrap",children:e}),o?(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(j.Info,{className:"text-muted-foreground/40 hover:text-muted-foreground h-3.5 w-3.5 shrink-0 cursor-help transition-colors"})}),(0,t.jsx)(C.TooltipContent,{side:"top",className:"max-w-64 text-[11px] leading-relaxed",children:(0,t.jsx)("span",{className:"text-muted-foreground",children:o})})]}):null]}),i?(0,t.jsx)("p",{className:"text-muted-foreground text-[11px] leading-tight",children:i}):null]}),(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2",children:a})]})}function I({label:e,description:i,id:n,testId:s,checked:a,onChange:o,disabled:l,tooltip:r}){return(0,t.jsx)(M,{label:e,description:i,htmlFor:n,tooltip:r,children:(0,t.jsx)(S.Switch,{id:n,"data-testid":s,checked:a,onCheckedChange:o,disabled:l,className:(0,x.cn)("cursor-pointer",l&&"cursor-not-allowed opacity-50")})})}function P({icon:e,title:i,description:n,badge:s,testId:a,tooltip:o,tooltipLinks:l,children:r}){return(0,t.jsxs)("div",{className:"bg-background rounded-lg border","data-testid":a,children:[(0,t.jsxs)("div",{className:"bg-muted/30 border-b px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("h2",{className:"text-sm font-semibold",children:i}),o?(0,t.jsxs)(C.Tooltip,{children:[(0,t.jsx)(C.TooltipTrigger,{asChild:!0,children:(0,t.jsx)(j.Info,{className:"text-muted-foreground/40 hover:text-muted-foreground h-3.5 w-3.5 shrink-0 cursor-help transition-colors"})}),(0,t.jsxs)(C.TooltipContent,{side:"bottom",className:"max-w-72 text-[11px] leading-relaxed",children:[(0,t.jsx)("p",{className:"text-muted-foreground",children:o}),null!=l&&l.length>0?(0,t.jsx)("div",{className:"border-border/50 mt-1.5 flex flex-col gap-0.5 border-t pt-1.5",children:l.map(e=>(0,t.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1.5 text-[10px] tracking-wide transition-colors",children:[(0,t.jsx)(y.ExternalLink,{className:"h-2.5 w-2.5 shrink-0 opacity-50"}),e.label]},e.href))}):null]})]}):null,s?(0,t.jsx)("span",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-[9px] font-medium tracking-wider uppercase",children:s}):null]}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 text-[11px]",children:n})]}),(0,t.jsx)("div",{className:"px-4",children:r})]})}function T({id:e,testId:i,value:n,onChange:s,onBlur:a,placeholder:o,min:l=1,max:r,step:c=1,suffix:d}){let{t:u}=(0,f.useTranslation)("web"),g=""===n?void 0:parseInt(n,10);return(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border",children:[(0,t.jsx)("button",{type:"button",onClick:()=>{s(String(Math.max(l,(g??parseInt(o,10))-c)))},onMouseUp:a,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-r transition-colors","aria-label":u("common.decrease"),children:(0,t.jsx)(b.default,{className:"h-3 w-3"})}),(0,t.jsx)("input",{id:e,"data-testid":i,type:"text",inputMode:"numeric",pattern:"[0-9]*",value:n,placeholder:o,onChange:e=>{s(e.target.value.replace(/[^0-9]/g,""))},onBlur:a,className:"h-8 w-14 bg-transparent text-center text-xs outline-none"}),(0,t.jsx)("button",{type:"button",onClick:()=>{let e;e=g??parseInt(o,10),s(String(null!=r?Math.min(r,e+c):e+c))},onMouseUp:a,className:"text-muted-foreground hover:bg-muted hover:text-foreground flex h-8 w-7 cursor-pointer items-center justify-center border-l transition-colors","aria-label":u("common.increase"),children:(0,t.jsx)(w.Plus,{className:"h-3 w-3"})})]}),d?(0,t.jsx)("span",{className:"text-muted-foreground text-[11px]",children:d}):null]})}function N({children:e}){return(0,t.jsx)("div",{className:"border-b pt-3 pb-1",children:(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] font-semibold tracking-wider uppercase",children:e})})}function A({settings:e}){let{t:s}=(0,f.useTranslation)("web"),[a,o]=(0,i.useState)(e.agent.type);return(0,t.jsx)(P,{icon:n.Bot,title:s("settings.agent.sectionTitle"),description:s("settings.agent.sectionDescription"),testId:"agent-settings-section",tooltip:s("settings.agent.hint"),tooltipLinks:[{label:s("settings.agent.links.agentSystem"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/agent-system.md"},{label:s("settings.agent.links.addingAgents"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/adding-agents.md"},{label:s("settings.agent.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/guides/configuration.md"}],children:(0,t.jsx)(M,{label:s("settings.agent.agentAndModel"),description:s("settings.agent.agentAndModelDescription"),tooltip:"Changing the agent switches which AI CLI tool runs your features. Each agent has different capabilities, speed, and cost tradeoffs.",htmlFor:"agent-model-picker",children:(0,t.jsx)(v.AgentModelPicker,{initialAgentType:a,initialModel:e.models.default,mode:"settings",onAgentModelChange:e=>o(e),className:"w-55"})})})}var D=e.i(60112),F=e.i(47373),R=e.i(81846),E=e.i(96976);let L=(0,E.createServerReference)("400d061d96961b7643636de42a59ed423422ab44aa",E.callServer,void 0,E.findSourceMapURL,"updateSettingsAction");var B=e.i(17406),z=e.i(30342),q=e.i(50579),H=e.i(89048);function K(e){return(0,t.jsx)(q.Code,{className:(0,x.cn)("h-4 w-4",e.className),...e})}function U({className:e}){return(0,t.jsx)(z.default,{src:"/icons/editors/vscode.svg",alt:"VS Code",width:24,height:24,className:(0,x.cn)("rounded-sm object-contain",e)})}function W({className:e}){return(0,t.jsx)(z.default,{src:"/icons/agents/cursor.jpeg",alt:"Cursor",width:24,height:24,className:(0,x.cn)("rounded-sm object-contain",e)})}function O({className:e}){return(0,t.jsx)(z.default,{src:"/icons/editors/windsurf.svg",alt:"Windsurf",width:24,height:24,className:(0,x.cn)("rounded-sm object-contain",e)})}function V({className:e}){return(0,t.jsx)(z.default,{src:"/icons/editors/zed.svg",alt:"Zed",width:24,height:24,className:(0,x.cn)("rounded-sm object-contain",e)})}function _({className:e,...i}){return(0,t.jsx)(H.Rocket,{className:(0,x.cn)("h-4 w-4",e),...i})}U.displayName="VsCodeIcon",W.displayName="CursorEditorIcon",O.displayName="WindsurfIcon",V.displayName="ZedIcon",_.displayName="AntigravityIcon";let G={vscode:U,cursor:W,windsurf:O,zed:V,antigravity:_},$=[{id:"vscode",name:"VS Code",available:!0},{id:"cursor",name:"Cursor",available:!0},{id:"windsurf",name:"Windsurf",available:!0},{id:"zed",name:"Zed",available:!0},{id:"antigravity",name:"Antigravity",available:!0}],Z=[{id:"bash",name:"Bash",available:!0},{id:"zsh",name:"Zsh",available:!0},{id:"fish",name:"Fish",available:!0}];function X({settings:e,availableEditors:n,availableShells:a,availableTerminals:o}){let{t:l}=(0,f.useTranslation)("web"),[,r]=(0,i.useTransition)(),[c,d]=(0,i.useState)(e.environment.defaultEditor),[u,g]=(0,i.useState)(e.environment.shellPreference),[h,p]=(0,i.useState)(e.environment.terminalPreference??B.TerminalType.System),m=o??[{id:B.TerminalType.System,name:l("settings.environment.systemTerminal"),available:!0}];function v(e){r(async()=>{let t=await L(e);t.success||D.toast.error(t.error??l("settings.failedToSave"))})}return(0,t.jsxs)(P,{icon:s.Terminal,title:l("settings.environment.sectionTitle"),description:l("settings.environment.sectionDescription"),testId:"environment-settings-section",tooltip:l("settings.environment.hint"),tooltipLinks:[{label:l("settings.environment.links.configurationGuide"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/guides/configuration.md"}],children:[(0,t.jsx)(M,{label:l("settings.environment.defaultEditor"),description:l("settings.environment.defaultEditorDescription"),tooltip:"The editor that opens when you click 'Launch' on a tool card or when ShipIT needs to open a file for review.",htmlFor:"default-editor",children:(0,t.jsxs)(F.Select,{value:c,onValueChange:e=>{d(e),v({environment:{defaultEditor:e,shellPreference:u,terminalPreference:h}})},children:[(0,t.jsx)(F.SelectTrigger,{id:"default-editor","data-testid":"editor-select",className:"w-64 cursor-pointer text-xs",children:(0,t.jsx)(F.SelectValue,{})}),(0,t.jsx)(F.SelectContent,{children:(n??$).map(e=>{var i;let n=(i=e.id)&&i in G?G[i]:K;return(0,t.jsx)(F.SelectItem,{value:e.id,disabled:!e.available,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(n,{className:"h-4 w-4 shrink-0"}),e.name,(0,t.jsx)(R.Badge,{variant:"outline",className:(0,x.cn)("ml-auto px-1.5 py-0 text-[10px] leading-4 font-normal",e.available?"border-emerald-500/30 text-emerald-500":"border-muted-foreground/30 text-muted-foreground"),children:e.available?"Installed":"Not Installed"})]})},e.id)})})]})}),(0,t.jsx)(M,{label:l("settings.environment.shell"),description:l("settings.environment.shellDescription"),tooltip:"Controls which shell runs generated scripts like install commands and git operations. Match this to your daily driver shell.",htmlFor:"shell-preference",children:(0,t.jsxs)(F.Select,{value:u,onValueChange:e=>{g(e),v({environment:{defaultEditor:c,shellPreference:e,terminalPreference:h}})},children:[(0,t.jsx)(F.SelectTrigger,{id:"shell-preference","data-testid":"shell-select",className:"w-64 cursor-pointer text-xs",children:(0,t.jsx)(F.SelectValue,{})}),(0,t.jsx)(F.SelectContent,{children:(a??Z).map(e=>(0,t.jsx)(F.SelectItem,{value:e.id,disabled:!e.available,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[e.name,(0,t.jsx)(R.Badge,{variant:"outline",className:(0,x.cn)("ml-auto px-1.5 py-0 text-[10px] leading-4 font-normal",e.available?"border-emerald-500/30 text-emerald-500":"border-muted-foreground/30 text-muted-foreground"),children:e.available?"Installed":"Not Installed"})]})},e.id))})]})}),(0,t.jsx)(M,{label:l("settings.environment.terminal"),description:l("settings.environment.terminalDescription"),tooltip:"The terminal emulator launched when opening shell sessions from the web UI. Only affects web-launched terminals, not CLI usage.",htmlFor:"terminal-preference",children:(0,t.jsxs)(F.Select,{value:h,onValueChange:e=>{p(e),v({environment:{defaultEditor:c,shellPreference:u,terminalPreference:e}})},children:[(0,t.jsx)(F.SelectTrigger,{id:"terminal-preference","data-testid":"terminal-select",className:"w-64 cursor-pointer text-xs",children:(0,t.jsx)(F.SelectValue,{})}),(0,t.jsx)(F.SelectContent,{children:m.map(e=>(0,t.jsx)(F.SelectItem,{value:e.id,disabled:!e.available,children:(0,t.jsxs)("span",{className:"flex items-center gap-2 text-xs",children:[e.name,(0,t.jsx)(R.Badge,{variant:"outline",className:(0,x.cn)("ml-auto px-1.5 py-0 text-[10px] leading-4 font-normal",e.available?"border-emerald-500/30 text-emerald-500":"border-muted-foreground/30 text-muted-foreground"),children:e.available?"Installed":"Not Installed"})]})},e.id))})]})})]})}function Y(e,t={}){let i=t.autoArchiveEnabled??e.autoArchiveEnabled,n=parseInt(t.autoArchiveDelay??e.autoArchiveDelay,10);return{workflow:{openPrOnImplementationComplete:t.openPr??e.openPr,approvalGateDefaults:{pushOnImplementationComplete:t.pushOnComplete??e.pushOnComplete,allowPrd:t.allowPrd??e.allowPrd,allowPlan:t.allowPlan??e.allowPlan,allowMerge:t.allowMerge??e.allowMerge},enableEvidence:t.enableEvidence??e.enableEvidence,commitEvidence:t.commitEvidence??e.commitEvidence,ciWatchEnabled:t.ciWatchEnabled??e.ciWatchEnabled,defaultFastMode:t.defaultFastMode??e.defaultFastMode,autoArchiveDelayMinutes:i?Number.isNaN(n)||n<1?10:n:0}}}function Q({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),[o,l]=(0,i.useState)(e.workflow.openPrOnImplementationComplete),[r,c]=(0,i.useState)(e.workflow.approvalGateDefaults.pushOnImplementationComplete),[d,u]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPrd),[g,h]=(0,i.useState)(e.workflow.approvalGateDefaults.allowPlan),[p,m]=(0,i.useState)(e.workflow.approvalGateDefaults.allowMerge),[x,v]=(0,i.useState)(e.workflow.enableEvidence),[b,w]=(0,i.useState)(e.workflow.commitEvidence),[y,j]=(0,i.useState)(!1!==e.workflow.ciWatchEnabled),[k,S]=(0,i.useState)(!1!==e.workflow.defaultFastMode),[C,A]=(0,i.useState)((e.workflow.autoArchiveDelayMinutes??10)>0),[F,R]=(0,i.useState)(String(e.workflow.autoArchiveDelayMinutes??10));function E(){return{openPr:o,pushOnComplete:r,allowPrd:d,allowPlan:g,allowMerge:p,enableEvidence:x,commitEvidence:b,ciWatchEnabled:y,defaultFastMode:k,autoArchiveEnabled:C,autoArchiveDelay:F}}function B(e){s(async()=>{let t=await L(e);t.success||D.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(P,{icon:a.GitBranch,title:n("settings.workflow.title"),description:n("settings.workflow.sectionDescription"),testId:"workflow-settings-section",tooltip:n("settings.workflow.hint"),tooltipLinks:[{label:n("settings.workflow.links.approvalGates"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/016-hitl-approval-gates/spec.yaml"},{label:n("settings.workflow.links.pushAndPrFlags"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/037-feature-pr-push-flags/spec.yaml"}],children:[(0,t.jsx)(I,{label:n("settings.workflow.defaultFastMode"),description:n("settings.workflow.defaultFastModeDescription"),tooltip:"When enabled, new features skip the PRD and Plan phases and go straight to implementation. Useful for quick fixes, risky for complex features.",id:"default-fast-mode",testId:"switch-default-fast-mode",checked:k,onChange:e=>{S(e),B(Y(E(),{defaultFastMode:e}))}}),(0,t.jsx)(N,{children:n("settings.workflow.subsections.approve")}),(0,t.jsx)(I,{label:n("settings.workflow.autoApprovePrd"),description:n("settings.workflow.autoApprovePrdDescription"),tooltip:"Automatically approves the requirements document without pausing for your review. Saves time but you lose the chance to refine requirements before planning.",id:"allow-prd",testId:"switch-allow-prd",checked:d,onChange:e=>{u(e),B(Y(E(),{allowPrd:e}))}}),(0,t.jsx)(I,{label:n("settings.workflow.autoApprovePlan"),description:n("settings.workflow.autoApprovePlanDescription"),tooltip:"Automatically approves the implementation plan. The agent proceeds to coding without waiting for your plan review.",id:"allow-plan",testId:"switch-allow-plan",checked:g,onChange:e=>{h(e),B(Y(E(),{allowPlan:e}))}}),(0,t.jsx)(I,{label:n("settings.workflow.autoApproveMerge"),description:n("settings.workflow.autoApproveMergeDescription"),tooltip:"Automatically merges the PR after implementation without requiring your final review. Use with caution on production branches.",id:"allow-merge",testId:"switch-allow-merge",checked:p,onChange:e=>{m(e),B(Y(E(),{allowMerge:e}))}}),(0,t.jsx)(N,{children:n("settings.workflow.subsections.evidence")}),(0,t.jsx)(I,{label:n("settings.workflow.collectEvidence"),description:n("settings.workflow.collectEvidenceDescription"),tooltip:"Captures screenshots and test outputs during implementation as proof of work. Useful for audit trails and PR documentation.",id:"enable-evidence",testId:"switch-enable-evidence",checked:x,onChange:e=>{v(e),e?B(Y(E(),{enableEvidence:e})):(w(!1),B(Y(E(),{enableEvidence:e,commitEvidence:!1})))}}),(0,t.jsx)(I,{label:n("settings.workflow.addEvidenceToPr"),description:n("settings.workflow.addEvidenceToPrDescription"),tooltip:"Attaches collected evidence artifacts (screenshots, logs) directly to the pull request description.",id:"commit-evidence",testId:"switch-commit-evidence",checked:b,disabled:!x||!o,onChange:e=>{w(e),B(Y(E(),{commitEvidence:e}))}}),(0,t.jsx)(N,{children:n("settings.workflow.subsections.git")}),(0,t.jsx)(I,{label:n("settings.workflow.pushOnComplete"),description:n("settings.workflow.pushOnCompleteDescription"),tooltip:"Automatically pushes the implementation branch to the remote repository when the agent finishes coding.",id:"push-on-complete",testId:"switch-push-on-complete",checked:r,onChange:e=>{c(e),B(Y(E(),{pushOnComplete:e}))}}),(0,t.jsx)(I,{label:n("settings.workflow.openPrOnComplete"),description:n("settings.workflow.openPrOnCompleteDescription"),tooltip:"Creates a pull request automatically after pushing. Combined with push-on-complete, this fully automates the delivery pipeline.",id:"open-pr",testId:"switch-open-pr",checked:o,onChange:e=>{l(e),e?B(Y(E(),{openPr:e})):(w(!1),B(Y(E(),{openPr:e,commitEvidence:!1})))}}),(0,t.jsx)(I,{label:n("settings.workflow.watchCiAfterPush"),description:n("settings.workflow.watchCiAfterPushDescription"),tooltip:"Monitors CI/CD pipeline status after pushing and can attempt fixes if tests fail. Disable if you prefer to handle CI failures manually.",id:"ci-watch-enabled",testId:"switch-ci-watch-enabled",checked:y,onChange:e=>{j(e),B(Y(E(),{ciWatchEnabled:e}))}}),(0,t.jsx)(N,{children:"Archive"}),(0,t.jsx)(I,{label:"Auto-archive completed",description:"Automatically archive features after they reach the completed state",tooltip:"Automatically archives features from the control center canvas after they reach the completed state, keeping the board clean.",id:"auto-archive-enabled",testId:"switch-auto-archive-enabled",checked:C,onChange:e=>{A(e),B(Y(E(),{autoArchiveEnabled:e}))}}),(0,t.jsx)(M,{label:"Archive delay",description:"Minutes to wait after completion before archiving (1-1440)",tooltip:"How long to wait after a feature completes before archiving it. Gives you time to review results before the feature moves off the board.",htmlFor:"auto-archive-delay",children:(0,t.jsx)(T,{id:"auto-archive-delay",testId:"input-auto-archive-delay",value:F,placeholder:"10",min:1,max:1440,suffix:"min",onChange:e=>{R(e)},onBlur:()=>{if(!C)return;let e=parseInt(F,10),t=Number.isNaN(e)?10:Math.min(1440,Math.max(1,e));R(String(t)),B(Y(E(),{autoArchiveDelay:String(t)}))}})})]})}function J(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}function ee({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),[a,l]=(0,i.useState)(null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):""),[r,c]=(0,i.useState)(null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):""),[d,u]=(0,i.useState)(null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):""),[g,h]=(0,i.useState)(null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):""),[p,m]=(0,i.useState)(!1!==e.workflow.hideCiStatus),x=null!=e.workflow.ciMaxFixAttempts?String(e.workflow.ciMaxFixAttempts):"",v=null!=e.workflow.ciWatchTimeoutMs?String(Math.round(e.workflow.ciWatchTimeoutMs/1e3)):"",b=null!=e.workflow.ciLogMaxChars?String(e.workflow.ciLogMaxChars):"",w=null!=e.workflow.ciWatchPollIntervalSeconds?String(e.workflow.ciWatchPollIntervalSeconds):"";function y(e){s(async()=>{let t=await L(e);t.success||D.toast.error(t.error??n("settings.failedToSave"))})}function j(e){let t=J(e.ciTimeout??r);return{workflow:{ciMaxFixAttempts:J(e.ciMaxFix??a),ciWatchTimeoutMs:null!=t?1e3*t:void 0,ciLogMaxChars:J(e.ciLogMax??d),ciWatchPollIntervalSeconds:J(e.ciPollInterval??g),hideCiStatus:e.hideCiStatus??p}}}return(0,t.jsxs)(P,{icon:o.Activity,title:n("settings.ci.title"),description:n("settings.ci.description"),testId:"ci-settings-section",tooltip:n("settings.ci.hint"),tooltipLinks:[{label:n("settings.ci.links.cicdPipeline"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/development/cicd.md"},{label:n("settings.ci.links.ciSecurityGates"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/003-cicd-security-gates/spec.md"}],children:[(0,t.jsx)(M,{label:n("settings.ci.maxFixAttempts"),description:n("settings.ci.maxFixAttemptsDescription"),tooltip:"How many times the agent will attempt to fix failing CI checks before giving up. Higher values increase the chance of auto-resolution but consume more agent time and API calls.",htmlFor:"ci-max-fix",children:(0,t.jsx)(T,{id:"ci-max-fix",testId:"ci-max-fix-input",placeholder:"3",value:a,onChange:l,onBlur:()=>{a!==x&&y(j({ciMaxFix:a}))},min:1,max:10})}),(0,t.jsx)(M,{label:n("settings.ci.watchTimeout"),description:n("settings.ci.watchTimeoutDescription"),tooltip:"Maximum time the agent will wait for CI to finish. If CI hasn't completed within this window, the agent stops watching. Increase for repos with slow CI pipelines.",htmlFor:"ci-timeout",children:(0,t.jsx)(T,{id:"ci-timeout",testId:"ci-timeout-input",placeholder:"300",value:r,onChange:c,onBlur:()=>{r!==v&&y(j({ciTimeout:r}))},min:30,step:30,suffix:"sec"})}),(0,t.jsx)(M,{label:n("settings.ci.maxLogSize"),description:n("settings.ci.maxLogSizeDescription"),tooltip:"CI logs beyond this character limit are truncated before being sent to the agent for analysis. Keeps agent context focused and avoids excessive token usage.",htmlFor:"ci-log-max",children:(0,t.jsx)(T,{id:"ci-log-max",testId:"ci-log-max-input",placeholder:"50000",value:d,onChange:u,onBlur:()=>{d!==b&&y(j({ciLogMax:d}))},min:1e3,step:5e3,suffix:"chars"})}),(0,t.jsx)(M,{label:n("settings.ci.pollInterval"),description:n("settings.ci.pollIntervalDescription"),tooltip:"How frequently the agent checks GitHub for CI status updates. Lower values give faster feedback but increase API call volume.",htmlFor:"ci-poll-interval",children:(0,t.jsx)(T,{id:"ci-poll-interval",testId:"ci-poll-interval-input",placeholder:"30",value:g,onChange:h,onBlur:()=>{g!==w&&y(j({ciPollInterval:g}))},min:5,step:5,suffix:"sec"})}),(0,t.jsx)(I,{label:n("settings.ci.hideCiStatus"),description:n("settings.ci.hideCiStatusDescription"),tooltip:"When enabled, CI status indicators are hidden from the feature drawer and merge review panels. Useful if you monitor CI through GitHub directly.",id:"hide-ci-status",testId:"switch-hide-ci-status",checked:p,onChange:e=>{m(e),y(j({hideCiStatus:e}))}})]})}var et=e.i(27069),ei=e.i(91967),en=e.i(22353),es=e.i(9413),ea=e.i(36567),eo=e.i(75649),el=e.i(9641),er=e.i(70391),ec=e.i(85565),ed=e.i(87099),eu=["PageUp","PageDown"],eg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],eh={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ep="Slider",[em,ef,ex]=(0,ed.createCollection)(ep),[ev,eb]=(0,es.createContextScope)(ep,[ex]),[ew,ey]=ev(ep),ej=i.forwardRef((e,n)=>{let{name:s,min:a=0,max:o=100,step:l=1,orientation:r="horizontal",disabled:c=!1,minStepsBetweenThumbs:d=0,defaultValue:u=[a],value:g,onValueChange:h=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:f,...x}=e,v=i.useRef(new Set),b=i.useRef(0),w="horizontal"===r,[y=[],j]=(0,ea.useControllableState)({prop:g,defaultProp:u,onChange:e=>{let t=[...v.current];t[b.current]?.focus(),h(e)}}),k=i.useRef(y);function S(e,t,{commit:i}={commit:!1}){let n,s=(String(l).split(".")[1]||"").length,r=Math.round((Math.round((e-a)/l)*l+a)*(n=Math.pow(10,s)))/n,c=(0,et.clamp)(r,[a,o]);j((e=[])=>{let n=function(e=[],t,i){let n=[...e];return n[i]=t,n.sort((e,t)=>e-t)}(e,c,t);if(!function(e,t){if(t>0)return Math.min(...e.slice(0,-1).map((t,i)=>e[i+1]-t))>=t;return!0}(n,d*l))return e;{b.current=n.indexOf(c);let t=String(n)!==String(e);return t&&i&&p(n),t?n:e}})}return(0,t.jsx)(ew,{scope:e.__scopeSlider,name:s,disabled:c,min:a,max:o,valueIndexToChangeRef:b,thumbs:v.current,values:y,orientation:r,form:f,children:(0,t.jsx)(em.Provider,{scope:e.__scopeSlider,children:(0,t.jsx)(em.Slot,{scope:e.__scopeSlider,children:(0,t.jsx)(w?eC:eM,{"aria-disabled":c,"data-disabled":c?"":void 0,...x,ref:n,onPointerDown:(0,ei.composeEventHandlers)(x.onPointerDown,()=>{c||(k.current=y)}),min:a,max:o,inverted:m,onSlideStart:c?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let i=e.map(e=>Math.abs(e-t)),n=Math.min(...i);return i.indexOf(n)}(y,e);S(e,t)},onSlideMove:c?void 0:function(e){S(e,b.current)},onSlideEnd:c?void 0:function(){let e=k.current[b.current];y[b.current]!==e&&p(y)},onHomeKeyDown:()=>!c&&S(a,0,{commit:!0}),onEndKeyDown:()=>!c&&S(o,y.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!c){let i=eu.includes(e.key)||e.shiftKey&&eg.includes(e.key),n=b.current;S(y[n]+l*(i?10:1)*t,n,{commit:!0})}}})})})})});ej.displayName=ep;var[ek,eS]=ev(ep,{startEdge:"left",endEdge:"right",size:"width",direction:1}),eC=i.forwardRef((e,n)=>{let{min:s,max:a,dir:o,inverted:l,onSlideStart:r,onSlideMove:c,onSlideEnd:d,onStepKeyDown:u,...g}=e,[h,p]=i.useState(null),m=(0,en.useComposedRefs)(n,e=>p(e)),f=i.useRef(void 0),x=(0,eo.useDirection)(o),v="ltr"===x,b=v&&!l||!v&&l;function w(e){let t=f.current||h.getBoundingClientRect(),i=eB([0,t.width],b?[s,a]:[a,s]);return f.current=t,i(e-t.left)}return(0,t.jsx)(ek,{scope:e.__scopeSlider,startEdge:b?"left":"right",endEdge:b?"right":"left",direction:b?1:-1,size:"width",children:(0,t.jsx)(eI,{dir:x,"data-orientation":"horizontal",...g,ref:m,style:{...g.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=w(e.clientX);r?.(t)},onSlideMove:e=>{let t=w(e.clientX);c?.(t)},onSlideEnd:()=>{f.current=void 0,d?.()},onStepKeyDown:e=>{let t=eh[b?"from-left":"from-right"].includes(e.key);u?.({event:e,direction:t?-1:1})}})})}),eM=i.forwardRef((e,n)=>{let{min:s,max:a,inverted:o,onSlideStart:l,onSlideMove:r,onSlideEnd:c,onStepKeyDown:d,...u}=e,g=i.useRef(null),h=(0,en.useComposedRefs)(n,g),p=i.useRef(void 0),m=!o;function f(e){let t=p.current||g.current.getBoundingClientRect(),i=eB([0,t.height],m?[a,s]:[s,a]);return p.current=t,i(e-t.top)}return(0,t.jsx)(ek,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:(0,t.jsx)(eI,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=f(e.clientY);l?.(t)},onSlideMove:e=>{let t=f(e.clientY);r?.(t)},onSlideEnd:()=>{p.current=void 0,c?.()},onStepKeyDown:e=>{let t=eh[m?"from-bottom":"from-top"].includes(e.key);d?.({event:e,direction:t?-1:1})}})})}),eI=i.forwardRef((e,i)=>{let{__scopeSlider:n,onSlideStart:s,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:r,onStepKeyDown:c,...d}=e,u=ey(ep,n);return(0,t.jsx)(ec.Primitive.span,{...d,ref:i,onKeyDown:(0,ei.composeEventHandlers)(e.onKeyDown,e=>{"Home"===e.key?(l(e),e.preventDefault()):"End"===e.key?(r(e),e.preventDefault()):eu.concat(eg).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:(0,ei.composeEventHandlers)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():s(e)}),onPointerMove:(0,ei.composeEventHandlers)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&a(e)}),onPointerUp:(0,ei.composeEventHandlers)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),o(e))})})}),eP="SliderTrack",eT=i.forwardRef((e,i)=>{let{__scopeSlider:n,...s}=e,a=ey(eP,n);return(0,t.jsx)(ec.Primitive.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...s,ref:i})});eT.displayName=eP;var eN="SliderRange",eA=i.forwardRef((e,n)=>{let{__scopeSlider:s,...a}=e,o=ey(eN,s),l=eS(eN,s),r=i.useRef(null),c=(0,en.useComposedRefs)(n,r),d=o.values.length,u=o.values.map(e=>eL(e,o.min,o.max)),g=d>1?Math.min(...u):0,h=100-Math.max(...u);return(0,t.jsx)(ec.Primitive.span,{"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,...a,ref:c,style:{...e.style,[l.startEdge]:g+"%",[l.endEdge]:h+"%"}})});eA.displayName=eN;var eD="SliderThumb",eF=i.forwardRef((e,n)=>{let s=ef(e.__scopeSlider),[a,o]=i.useState(null),l=(0,en.useComposedRefs)(n,e=>o(e)),r=i.useMemo(()=>a?s().findIndex(e=>e.ref.current===a):-1,[s,a]);return(0,t.jsx)(eR,{...e,ref:l,index:r})}),eR=i.forwardRef((e,n)=>{var s,a,o,l,r;let c,d,{__scopeSlider:u,index:g,name:h,...p}=e,m=ey(eD,u),f=eS(eD,u),[x,v]=i.useState(null),b=(0,en.useComposedRefs)(n,e=>v(e)),w=!x||m.form||!!x.closest("form"),y=(0,er.useSize)(x),j=m.values[g],k=void 0===j?0:eL(j,m.min,m.max),S=(s=g,(a=m.values.length)>2?`Value ${s+1} of ${a}`:2===a?["Minimum","Maximum"][s]:void 0),C=y?.[f.size],M=C?(o=C,l=k,r=f.direction,d=eB([0,50],[0,c=o/2]),(c-d(l)*r)*r):0;return i.useEffect(()=>{if(x)return m.thumbs.add(x),()=>{m.thumbs.delete(x)}},[x,m.thumbs]),(0,t.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${k}% + ${M}px)`},children:[(0,t.jsx)(em.ItemSlot,{scope:e.__scopeSlider,children:(0,t.jsx)(ec.Primitive.span,{role:"slider","aria-label":e["aria-label"]||S,"aria-valuemin":m.min,"aria-valuenow":j,"aria-valuemax":m.max,"aria-orientation":m.orientation,"data-orientation":m.orientation,"data-disabled":m.disabled?"":void 0,tabIndex:m.disabled?void 0:0,...p,ref:b,style:void 0===j?{display:"none"}:e.style,onFocus:(0,ei.composeEventHandlers)(e.onFocus,()=>{m.valueIndexToChangeRef.current=g})})}),w&&(0,t.jsx)(eE,{name:h??(m.name?m.name+(m.values.length>1?"[]":""):void 0),form:m.form,value:j},g)]})});eF.displayName=eD;var eE=i.forwardRef(({__scopeSlider:e,value:n,...s},a)=>{let o=i.useRef(null),l=(0,en.useComposedRefs)(o,a),r=(0,el.usePrevious)(n);return i.useEffect(()=>{let e=o.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(r!==n&&t){let i=new Event("input",{bubbles:!0});t.call(e,n),e.dispatchEvent(i)}},[r,n]),(0,t.jsx)(ec.Primitive.input,{style:{display:"none"},...s,ref:l,defaultValue:n})});function eL(e,t,i){return(0,et.clamp)(100/(i-t)*(e-t),[0,100])}function eB(e,t){return i=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(i-e[0])}}eE.displayName="RadioBubbleInput",e.s(["Range",0,eA,"Root",0,ej,"Slider",0,ej,"SliderRange",0,eA,"SliderThumb",0,eF,"SliderTrack",0,eT,"Thumb",0,eF,"Track",0,eT,"createSliderScope",0,eb],98207);var ez=e.i(98207),ez=ez;function eq({className:e,defaultValue:n,value:s,min:a=0,max:o=100,...l}){let r=i.useMemo(()=>Array.isArray(s)?s:Array.isArray(n)?n:[a,o],[s,n,a,o]);return(0,t.jsxs)(ez.Root,{"data-slot":"slider",defaultValue:n,value:s,min:a,max:o,className:(0,x.cn)("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...l,children:[(0,t.jsx)(ez.Track,{"data-slot":"slider-track",className:(0,x.cn)("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:(0,t.jsx)(ez.Range,{"data-slot":"slider-range",className:(0,x.cn)("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:r.length},(e,i)=>(0,t.jsx)(ez.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},i))]})}let eH=[60,120,300,600,900,1800,2700,3600,7200,10800,14400,21600,28800,43200,86400],eK=eH.length-1;function eU(e){let t=0,i=Math.abs(e-eH[0]);for(let n=1;n<eH.length;n++){let s=Math.abs(e-eH[n]);s<i&&(i=s,t=n)}return t}function eW({id:e,testId:n,value:s,onChange:a,onBlur:o,defaultSeconds:l=1800}){var r;let c,d,u=(""===s?l:parseInt(s,10))||l,[g,h]=(0,i.useState)(()=>eU(u)),p=eU(u);p!==g&&eH[g]!==u&&h(p);let m=(0,i.useCallback)(([e])=>{h(e),a(String(eH[e]))},[a]);return(0,t.jsxs)("div",{className:"flex w-55 items-center gap-2",children:[(0,t.jsx)(eq,{id:e,"data-testid":n,min:0,max:eK,step:1,value:[g],onValueChange:m,onValueCommit:()=>o(),className:"min-w-0 flex-1"}),(0,t.jsx)("span",{className:"text-muted-foreground shrink-0 text-end text-xs tabular-nums",children:(c=Math.floor((r=eH[g])/3600),d=Math.round(r%3600/60),0===c?`${d}m`:0===d?`${c}h`:`${c}h ${d}m`)})]})}function eO(e){if(void 0===e)return;let t=function(e){if(""===e)return;let t=parseInt(e,10);return Number.isNaN(t)||t<=0?void 0:t}(e);return null!=t?1e3*t:void 0}function eV({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.workflow.stageTimeouts,o=e.workflow.analyzeRepoTimeouts,[l,r]=(0,i.useState)(String(Math.round((a?.analyzeMs??18e5)/1e3))),[c,d]=(0,i.useState)(String(Math.round((a?.requirementsMs??18e5)/1e3))),[g,h]=(0,i.useState)(String(Math.round((a?.researchMs??18e5)/1e3))),[p,m]=(0,i.useState)(String(Math.round((a?.planMs??18e5)/1e3))),[x,v]=(0,i.useState)(String(Math.round((a?.implementMs??18e5)/1e3))),[b,w]=(0,i.useState)(String(Math.round((a?.mergeMs??18e5)/1e3))),[y,j]=(0,i.useState)(String(Math.round((o?.analyzeMs??6e5)/1e3))),k=a?.analyzeMs!=null?String(Math.round(a.analyzeMs/1e3)):"",S=a?.requirementsMs!=null?String(Math.round(a.requirementsMs/1e3)):"",C=a?.researchMs!=null?String(Math.round(a.researchMs/1e3)):"",I=a?.planMs!=null?String(Math.round(a.planMs/1e3)):"",T=a?.implementMs!=null?String(Math.round(a.implementMs/1e3)):"",A=a?.mergeMs!=null?String(Math.round(a.mergeMs/1e3)):"",F=o?.analyzeMs!=null?String(Math.round(o.analyzeMs/1e3)):"";function R(e){return{workflow:{stageTimeouts:{analyzeMs:eO(e.analyzeTimeout??l),requirementsMs:eO(e.requirementsTimeout??c),researchMs:eO(e.researchTimeout??g),planMs:eO(e.planTimeout??p),implementMs:eO(e.implementTimeout??x),mergeMs:eO(e.mergeTimeout??b)},analyzeRepoTimeouts:{analyzeMs:eO(e.analyzeRepoTimeout??y)}}}}function E(e){s(async()=>{let t=await L(e);t.success||D.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(P,{icon:u.Timer,title:n("settings.stageTimeouts.title"),description:n("settings.stageTimeouts.description"),testId:"stage-timeouts-settings-section",tooltip:n("settings.stageTimeouts.hint"),children:[(0,t.jsx)(N,{children:n("settings.stageTimeouts.subsections.featureAgent")}),(0,t.jsx)(M,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze",children:(0,t.jsx)(eW,{id:"timeout-analyze",testId:"timeout-analyze-input",value:l,onChange:r,onBlur:()=>{l!==k&&E(R({analyzeTimeout:l}))},defaultSeconds:1800})}),(0,t.jsx)(M,{label:n("settings.stageTimeouts.requirements"),description:n("settings.stageTimeouts.requirementsDescription"),htmlFor:"timeout-requirements",children:(0,t.jsx)(eW,{id:"timeout-requirements",testId:"timeout-requirements-input",value:c,onChange:d,onBlur:()=>{c!==S&&E(R({requirementsTimeout:c}))},defaultSeconds:1800})}),(0,t.jsx)(M,{label:n("settings.stageTimeouts.research"),description:n("settings.stageTimeouts.researchDescription"),htmlFor:"timeout-research",children:(0,t.jsx)(eW,{id:"timeout-research",testId:"timeout-research-input",value:g,onChange:h,onBlur:()=>{g!==C&&E(R({researchTimeout:g}))},defaultSeconds:1800})}),(0,t.jsx)(M,{label:n("settings.stageTimeouts.plan"),description:n("settings.stageTimeouts.planDescription"),htmlFor:"timeout-plan",children:(0,t.jsx)(eW,{id:"timeout-plan",testId:"timeout-plan-input",value:p,onChange:m,onBlur:()=>{p!==I&&E(R({planTimeout:p}))},defaultSeconds:1800})}),(0,t.jsx)(M,{label:n("settings.stageTimeouts.implement"),description:n("settings.stageTimeouts.implementDescription"),htmlFor:"timeout-implement",children:(0,t.jsx)(eW,{id:"timeout-implement",testId:"timeout-implement-input",value:x,onChange:v,onBlur:()=>{x!==T&&E(R({implementTimeout:x}))},defaultSeconds:1800})}),(0,t.jsx)(M,{label:n("settings.stageTimeouts.merge"),description:n("settings.stageTimeouts.mergeDescription"),htmlFor:"timeout-merge",children:(0,t.jsx)(eW,{id:"timeout-merge",testId:"timeout-merge-input",value:b,onChange:w,onBlur:()=>{b!==A&&E(R({mergeTimeout:b}))},defaultSeconds:1800})}),(0,t.jsx)(N,{children:n("settings.stageTimeouts.subsections.analyzeRepoAgent")}),(0,t.jsx)(M,{label:n("settings.stageTimeouts.analyze"),description:n("settings.stageTimeouts.analyzeDescription"),htmlFor:"timeout-analyze-repo",children:(0,t.jsx)(eW,{id:"timeout-analyze-repo",testId:"timeout-analyze-repo-input",value:y,onChange:j,onBlur:()=>{y!==F&&E(R({analyzeRepoTimeout:y}))},defaultSeconds:600})})]})}function e_({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),[a,o]=(0,i.useState)(e.notifications.inApp.enabled),[l,c]=(0,i.useState)({...e.notifications.events});function d(e){s(async()=>{let t=await L(e);t.success||D.toast.error(t.error??n("settings.failedToSave"))})}function u(e={}){return{notifications:{inApp:{enabled:e.inApp??a},events:e.events??l}}}return(0,t.jsxs)(P,{icon:r,title:n("settings.notifications.title"),description:n("settings.notifications.sectionDescription"),testId:"notification-settings-section",tooltip:n("settings.notifications.hint"),tooltipLinks:[{label:n("settings.notifications.links.notificationSystem"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/021-agent-notifications/spec.yaml"}],children:[(0,t.jsx)(N,{children:n("settings.notifications.channels")}),(0,t.jsx)(I,{label:n("settings.notifications.inAppLabel"),description:n("settings.notifications.inAppDescription"),tooltip:"Master toggle for in-app toast notifications. When disabled, no event toasts will appear regardless of individual event settings below.",id:"notif-in-app",testId:"switch-in-app",checked:a,onChange:e=>{o(e),d(u({inApp:e}))}}),(0,t.jsx)(N,{children:n("settings.notifications.subsections.agentEvents")}),(0,t.jsx)(I,{label:n("settings.notifications.events.agentStarted"),tooltip:"Controls whether you receive an in-app toast notification when an agent begins working on a feature.",id:"notif-event-agentStarted",testId:"switch-event-agentStarted",checked:l.agentStarted,onChange:e=>{let t={...l,agentStarted:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.phaseCompleted"),tooltip:"Controls whether you receive an in-app toast notification when an agent completes a workflow phase (e.g., requirements, planning, implementation).",id:"notif-event-phaseCompleted",testId:"switch-event-phaseCompleted",checked:l.phaseCompleted,onChange:e=>{let t={...l,phaseCompleted:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.waitingApproval"),tooltip:"Controls whether you receive an in-app toast notification when a feature is paused and waiting for your approval to continue.",id:"notif-event-waitingApproval",testId:"switch-event-waitingApproval",checked:l.waitingApproval,onChange:e=>{let t={...l,waitingApproval:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.agentCompleted"),tooltip:"Controls whether you receive an in-app toast notification when an agent finishes all work on a feature successfully.",id:"notif-event-agentCompleted",testId:"switch-event-agentCompleted",checked:l.agentCompleted,onChange:e=>{let t={...l,agentCompleted:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.agentFailed"),tooltip:"Controls whether you receive an in-app toast notification when an agent encounters an error and stops working on a feature.",id:"notif-event-agentFailed",testId:"switch-event-agentFailed",checked:l.agentFailed,onChange:e=>{let t={...l,agentFailed:e};c(t),d(u({events:t}))}}),(0,t.jsx)(N,{children:n("settings.notifications.subsections.pullRequestEvents")}),(0,t.jsx)(I,{label:n("settings.notifications.events.prMerged"),tooltip:"Controls whether you receive an in-app toast notification when a feature's pull request is merged into the target branch.",id:"notif-event-prMerged",testId:"switch-event-prMerged",checked:l.prMerged,onChange:e=>{let t={...l,prMerged:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.prClosed"),tooltip:"Controls whether you receive an in-app toast notification when a feature's pull request is closed without merging.",id:"notif-event-prClosed",testId:"switch-event-prClosed",checked:l.prClosed,onChange:e=>{let t={...l,prClosed:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.prChecksPassed"),tooltip:"Controls whether you receive an in-app toast notification when all CI checks pass on a feature's pull request.",id:"notif-event-prChecksPassed",testId:"switch-event-prChecksPassed",checked:l.prChecksPassed,onChange:e=>{let t={...l,prChecksPassed:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.prChecksFailed"),tooltip:"Controls whether you receive an in-app toast notification when CI checks fail on a feature's pull request.",id:"notif-event-prChecksFailed",testId:"switch-event-prChecksFailed",checked:l.prChecksFailed,onChange:e=>{let t={...l,prChecksFailed:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.prBlocked"),tooltip:"Controls whether you receive an in-app toast notification when a pull request is blocked by merge conflicts or branch protection rules.",id:"notif-event-prBlocked",testId:"switch-event-prBlocked",checked:l.prBlocked,onChange:e=>{let t={...l,prBlocked:e};c(t),d(u({events:t}))}}),(0,t.jsx)(I,{label:n("settings.notifications.events.mergeReviewReady"),tooltip:"Controls whether you receive an in-app toast notification when a feature's PR passes all checks and is ready for your merge review.",id:"notif-event-mergeReviewReady",testId:"switch-event-mergeReviewReady",checked:l.mergeReviewReady,onChange:e=>{let t={...l,mergeReviewReady:e};c(t),d(u({events:t}))}})]})}function eG({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.featureFlags??{skills:!1,envDeploy:!1,debug:!1,githubImport:!1,adoptBranch:!1,gitRebaseSync:!1,reactFileManager:!1,plugins:!1},[o,l]=(0,i.useState)({...a});function r(e){s(async()=>{let t=await L(e);t.success||D.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(P,{icon:c,title:n("settings.featureFlags.title"),description:n("settings.featureFlags.sectionDescription"),badge:n("settings.featureFlags.badge"),testId:"feature-flags-settings-section",tooltip:n("settings.featureFlags.hint"),children:[(0,t.jsx)(I,{label:n("settings.featureFlags.skills"),description:n("settings.featureFlags.skillsDescription"),tooltip:"Enables the Skills page in the sidebar for browsing and managing Claude Code skills.",id:"flag-skills",testId:"switch-flag-skills",checked:o.skills,onChange:e=>{let t={...o,skills:e};l(t),r({featureFlags:t})}}),(0,t.jsx)(I,{label:n("settings.featureFlags.deployments"),description:n("settings.featureFlags.deploymentsDescription"),tooltip:"Enables experimental deployment features for environment management.",id:"flag-envDeploy",testId:"switch-flag-envDeploy",checked:o.envDeploy,onChange:e=>{let t={...o,envDeploy:e};l(t),r({featureFlags:t})}}),(0,t.jsx)(I,{label:n("settings.featureFlags.debug"),description:n("settings.featureFlags.debugDescription"),tooltip:"Shows additional debugging information in the UI for troubleshooting.",id:"flag-debug",testId:"switch-flag-debug",checked:o.debug,onChange:e=>{let t={...o,debug:e};l(t),r({featureFlags:t})}}),(0,t.jsx)(I,{label:n("settings.featureFlags.githubImport"),description:n("settings.featureFlags.githubImportDescription"),tooltip:"Enables importing repositories directly from GitHub.",id:"flag-githubImport",testId:"switch-flag-githubImport",checked:o.githubImport,onChange:e=>{let t={...o,githubImport:e};l(t),r({featureFlags:t})}}),(0,t.jsx)(I,{label:n("settings.featureFlags.adoptBranch"),description:n("settings.featureFlags.adoptBranchDescription"),tooltip:"Enables adopting existing git branches as ShipIT features.",id:"flag-adoptBranch",testId:"switch-flag-adoptBranch",checked:o.adoptBranch,onChange:e=>{let t={...o,adoptBranch:e};l(t),r({featureFlags:t})}}),(0,t.jsx)(I,{label:n("settings.featureFlags.gitRebaseSync"),description:n("settings.featureFlags.gitRebaseSyncDescription"),tooltip:"Uses git rebase instead of merge when syncing feature branches with the upstream branch.",id:"flag-gitRebaseSync",testId:"switch-flag-gitRebaseSync",checked:o.gitRebaseSync,onChange:e=>{let t={...o,gitRebaseSync:e};l(t),r({featureFlags:t})}}),(0,t.jsx)(I,{label:n("settings.featureFlags.reactFileManager"),description:n("settings.featureFlags.reactFileManagerDescription"),tooltip:"Replaces the native file picker dialog with a React-based file browser for selecting project folders.",id:"flag-reactFileManager",testId:"switch-flag-reactFileManager",checked:o.reactFileManager,onChange:e=>{let t={...o,reactFileManager:e};l(t),r({featureFlags:t})}}),(0,t.jsx)(I,{label:n("settings.featureFlags.plugins"),description:e.litellmProxy?.baseUrl?n("settings.featureFlags.pluginsDescription"):`${n("settings.featureFlags.pluginsDescription")} — ${n("plugins.noProxy")}`,tooltip:"Enables the Plugins page for browsing and managing Claude Code plugins from a LiteLLM marketplace. Requires a LiteLLM proxy URL to be configured.",id:"flag-plugins",testId:"switch-flag-plugins",checked:o.plugins,disabled:!e.litellmProxy?.baseUrl,onChange:e=>{let t={...o,plugins:e};l(t),r({featureFlags:t})}})]})}function e$({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.interactiveAgent??{enabled:!0,autoTimeoutMinutes:15,maxConcurrentSessions:3},[o,l]=(0,i.useState)(a.enabled),[r,c]=(0,i.useState)(String(a.autoTimeoutMinutes)),[d,u]=(0,i.useState)(String(a.maxConcurrentSessions));function h(e){s(async()=>{let t=await L(e);t.success||D.toast.error(t.error??n("settings.failedToSave"))})}return(0,t.jsxs)(P,{icon:g.MessageSquare,title:n("settings.interactiveAgent.title"),description:n("settings.interactiveAgent.description"),testId:"interactive-agent-settings-section",tooltip:n("settings.interactiveAgent.hint"),children:[(0,t.jsx)(I,{label:n("settings.interactiveAgent.enableChatTab"),description:n("settings.interactiveAgent.enableChatTabDescription"),tooltip:"Shows or hides the Chat tab on feature detail pages. When enabled, you can have interactive conversations with the agent about a specific feature.",id:"interactive-agent-enabled",testId:"switch-interactive-agent-enabled",checked:o,onChange:e=>{l(e),h({interactiveAgent:{enabled:e,autoTimeoutMinutes:parseInt(r,10)||15,maxConcurrentSessions:parseInt(d,10)||3}})}}),(0,t.jsx)(M,{label:n("settings.interactiveAgent.autoTimeout"),description:n("settings.interactiveAgent.autoTimeoutDescription"),tooltip:"Minutes of inactivity before a chat agent session is automatically terminated. Prevents idle agent processes from consuming resources indefinitely.",htmlFor:"interactive-agent-timeout",children:(0,t.jsx)(T,{id:"interactive-agent-timeout",testId:"input-interactive-agent-timeout",value:r,placeholder:"15",min:1,max:120,suffix:"min",onChange:c,onBlur:()=>{let e=parseInt(r,10),t=Number.isNaN(e)?15:Math.min(120,Math.max(1,e));c(String(t)),h({interactiveAgent:{enabled:o,autoTimeoutMinutes:t,maxConcurrentSessions:parseInt(d,10)||3}})}})}),(0,t.jsx)(M,{label:n("settings.interactiveAgent.maxConcurrentSessions"),description:n("settings.interactiveAgent.maxConcurrentSessionsDescription"),tooltip:"Maximum number of interactive agent sessions that can run simultaneously. Each session spawns a separate agent process, so higher values use more CPU and memory.",htmlFor:"interactive-agent-sessions",children:(0,t.jsx)(T,{id:"interactive-agent-sessions",testId:"input-interactive-agent-sessions",value:d,placeholder:"3",min:1,max:10,onChange:u,onBlur:()=>{let e=parseInt(d,10),t=Number.isNaN(e)?3:Math.min(10,Math.max(1,e));u(String(t)),h({interactiveAgent:{enabled:o,autoTimeoutMinutes:parseInt(r,10)||15,maxConcurrentSessions:t}})}})})]})}function eZ({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.fabLayout??{swapPosition:!1},[o,l]=(0,i.useState)(a.swapPosition);return(0,t.jsx)(P,{icon:h,title:n("settings.fabLayout.title"),description:n("settings.fabLayout.description"),testId:"fab-layout-settings-section",tooltip:n("settings.fabLayout.hint"),children:(0,t.jsx)(I,{label:n("settings.fabLayout.swapPosition"),description:n("settings.fabLayout.swapPositionDescription"),tooltip:"Swaps the Create button (bottom-right) and Chat button (bottom-left) positions on the control center canvas.",id:"fab-swap-position",testId:"switch-fab-swap-position",checked:o,onChange:e=>{var t;l(e),t={fabLayout:{swapPosition:e}},s(async()=>{let e=await L(t);e.success||D.toast.error(e.error??n("settings.failedToSave"))})}})})}function eX({shipitAiHome:e,dbFileSize:i}){let{t:n}=(0,f.useTranslation)("web");return(0,t.jsxs)(P,{icon:d,title:n("settings.database.title"),description:n("settings.database.sectionDescription"),testId:"database-settings-section",tooltip:n("settings.database.hint"),tooltipLinks:[{label:n("settings.database.links.settingsService"),href:"https://github.com/jrmatherly/shipit/blob/main/docs/architecture/settings-service.md"},{label:n("settings.database.links.settingsSpec"),href:"https://github.com/jrmatherly/shipit/blob/main/specs/005-global-settings-service/spec.md"}],children:[(0,t.jsx)(M,{label:n("settings.database.location"),description:n("settings.database.locationDescription"),tooltip:"The directory where ShipIT stores its SQLite database, logs, and configuration files. Change this via the SHIPIT_AI_HOME environment variable.",children:(0,t.jsx)("span",{className:"text-muted-foreground max-w-50 truncate font-mono text-xs","data-testid":"shipit-ai-home-path",children:e})}),(0,t.jsx)(M,{label:n("settings.database.size"),tooltip:"Current size of the SQLite database file on disk. Large databases may slow down startup; consider archiving old features if this grows significantly.",children:(0,t.jsx)("span",{className:"text-muted-foreground text-xs","data-testid":"db-file-size",children:i})})]})}var eY=e.i(37628),eY=eY,eQ=e.i(81391),eQ=eQ;let eJ=(0,E.createServerReference)("4062847edea511a142509f3f602f5ed09f6fc170a1",E.callServer,void 0,E.findSourceMapURL,"addMarketplaceAction");var e0=e.i(98127),e1=e.i(35364);function e3({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),[a,o]=(0,i.useState)(e.litellmProxy?.baseUrl??""),[l,r]=(0,i.useState)(e.litellmProxy?.apiKey??""),[c,d]=(0,i.useState)("idle"),[u,g]=(0,i.useState)(!1),h=e.litellmProxy?.baseUrl??"",p=e.litellmProxy?.apiKey??"";function x(e){s(async()=>{let t=await L(e);t.success||D.toast.error(t.error??n("settings.failedToSave"))})}function v(e){let t=e?.baseUrl??a;return{litellmProxy:{baseUrl:t,apiKey:e?.apiKey??l,marketplaceEnabled:!!t}}}async function b(){if(a){g(!0),d("idle");try{let e=`${a.replace(/\/+$/,"")}/claude-code/marketplace.json`,t=await eJ(e);d(t.success?"success":"failed"),t.success?D.toast.success(n("settings.litellmProxy.testSuccess")):D.toast.error(n("settings.litellmProxy.testFailed"))}catch{d("failed"),D.toast.error(n("settings.litellmProxy.testFailed"))}finally{g(!1)}}}return(0,t.jsxs)(P,{icon:m.Server,title:n("settings.litellmProxy.title"),description:n("settings.litellmProxy.description"),testId:"litellm-proxy-settings-section",tooltip:n("settings.litellmProxy.hint"),children:[(0,t.jsx)(M,{label:n("settings.litellmProxy.baseUrl"),description:n("settings.litellmProxy.baseUrlDescription"),tooltip:"The base URL of your LiteLLM proxy server. This is used to fetch the plugin marketplace catalog and route model requests.",htmlFor:"litellm-proxy-url",children:(0,t.jsx)(e0.Input,{id:"litellm-proxy-url","data-testid":"litellm-proxy-url-input",type:"text",placeholder:"http://localhost:4000",value:a,onChange:e=>{o(e.target.value),d("idle")},onBlur:()=>{a!==h&&x(v({baseUrl:a}))},className:"w-64 text-xs"})}),(0,t.jsx)(M,{label:n("settings.litellmProxy.apiKey"),description:n("settings.litellmProxy.apiKeyDescription"),tooltip:"A virtual API key for authenticating with the LiteLLM proxy. Stored locally alongside other agent credentials.",htmlFor:"litellm-api-key",children:(0,t.jsx)(e0.Input,{id:"litellm-api-key","data-testid":"litellm-api-key-input",type:"password",placeholder:"sk-...",value:l,onChange:e=>r(e.target.value),onBlur:()=>{l!==p&&x(v({apiKey:l}))},className:"w-64 text-xs"})}),(0,t.jsx)(M,{label:n("settings.litellmProxy.testConnection"),tooltip:"Attempt to connect to the proxy and fetch the marketplace catalog to verify the configuration is correct.",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(e1.Button,{variant:"outline",size:"sm","data-testid":"litellm-test-connection-btn",disabled:!a||u,onClick:b,className:"cursor-pointer text-xs",children:u?n("settings.saving"):n("settings.litellmProxy.testConnection")}),"success"===c&&(0,t.jsx)(eY.default,{className:"h-4 w-4 text-emerald-500","data-testid":"litellm-test-success"}),"failed"===c&&(0,t.jsx)(eQ.default,{className:"text-destructive h-4 w-4","data-testid":"litellm-test-failed"})]})})]})}let e4=(0,l.default)("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);var e5=e.i(48306);function e2({settings:e}){let{t:n}=(0,f.useTranslation)("web"),[,s]=(0,i.useTransition)(),a=e.litellmProxy?.claudeCode,[o,l]=(0,i.useState)(a?.routingMode??B.LiteLLMProxyRoutingMode.direct),[r,c]=(0,i.useState)(a?.customHeaders??""),[d,u]=(0,i.useState)(a?.sonnetModel??""),[g,h]=(0,i.useState)(a?.haikuModel??""),[p,m]=(0,i.useState)(a?.opusModel??""),x=a?.customHeaders??"",v=a?.sonnetModel??"",b=a?.haikuModel??"",w=a?.opusModel??"",y=o!==B.LiteLLMProxyRoutingMode.direct;function j(e){s(async()=>{let t=await L(e);t.success||D.toast.error(t.error??n("settings.failedToSave"))})}function k(e){return{litellmProxy:{claudeCode:{routingMode:e?.routingMode??o,customHeaders:e?.customHeaders??r,sonnetModel:e?.sonnetModel??d,haikuModel:e?.haikuModel??g,opusModel:e?.opusModel??p}}}}return(0,t.jsxs)(P,{icon:e4,title:n("settings.litellmProxy.routing.title"),description:n("settings.litellmProxy.routing.description"),testId:"litellm-proxy-routing-section",tooltip:n("settings.litellmProxy.routing.hint"),children:[(0,t.jsx)(M,{label:n("settings.litellmProxy.routing.mode"),description:n("settings.litellmProxy.routing.modeDescription"),htmlFor:"litellm-routing-mode",children:(0,t.jsxs)(F.Select,{value:o,onValueChange:function(e){l(e),j(k({routingMode:e}))},children:[(0,t.jsx)(F.SelectTrigger,{id:"litellm-routing-mode","data-testid":"litellm-routing-mode-select",className:"w-48 text-xs",children:(0,t.jsx)(F.SelectValue,{})}),(0,t.jsxs)(F.SelectContent,{children:[(0,t.jsx)(F.SelectItem,{value:B.LiteLLMProxyRoutingMode.direct,children:n("settings.litellmProxy.routing.modeDirect")}),(0,t.jsx)(F.SelectItem,{value:B.LiteLLMProxyRoutingMode.proxy,children:n("settings.litellmProxy.routing.modeProxy")}),(0,t.jsx)(F.SelectItem,{value:B.LiteLLMProxyRoutingMode.passthrough,children:n("settings.litellmProxy.routing.modePassthrough")})]})]})}),o===B.LiteLLMProxyRoutingMode.passthrough&&(0,t.jsx)(M,{label:"",description:n("settings.litellmProxy.routing.passthroughHelp"),children:(0,t.jsx)("span",{})}),y?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(M,{label:n("settings.litellmProxy.routing.customHeaders"),description:n("settings.litellmProxy.routing.customHeadersDescription"),htmlFor:"litellm-custom-headers",children:(0,t.jsx)(e5.Textarea,{id:"litellm-custom-headers","data-testid":"litellm-custom-headers-input",placeholder:"x-litellm-customer-id: my-user\nx-litellm-tags: project:acme",value:r,onChange:e=>c(e.target.value),onBlur:()=>{r!==x&&j(k({customHeaders:r}))},rows:3,className:"w-64 text-xs"})}),(0,t.jsx)(M,{label:n("settings.litellmProxy.routing.sonnetModel"),description:n("settings.litellmProxy.routing.modelOverrideDescription"),htmlFor:"litellm-sonnet-model",children:(0,t.jsx)(e0.Input,{id:"litellm-sonnet-model","data-testid":"litellm-sonnet-model-input",type:"text",placeholder:"claude-sonnet-4-6",value:d,onChange:e=>u(e.target.value),onBlur:()=>{d!==v&&j(k({sonnetModel:d}))},className:"w-64 text-xs"})}),(0,t.jsx)(M,{label:n("settings.litellmProxy.routing.haikuModel"),htmlFor:"litellm-haiku-model",children:(0,t.jsx)(e0.Input,{id:"litellm-haiku-model","data-testid":"litellm-haiku-model-input",type:"text",placeholder:"claude-haiku-4-5",value:g,onChange:e=>h(e.target.value),onBlur:()=>{g!==b&&j(k({haikuModel:g}))},className:"w-64 text-xs"})}),(0,t.jsx)(M,{label:n("settings.litellmProxy.routing.opusModel"),htmlFor:"litellm-opus-model",children:(0,t.jsx)(e0.Input,{id:"litellm-opus-model","data-testid":"litellm-opus-model-input",type:"text",placeholder:"claude-opus-4-6",value:p,onChange:e=>m(e.target.value),onBlur:()=>{p!==w&&j(k({opusModel:p}))},className:"w-64 text-xs"})})]}):null]})}let e6=[{id:"agent",labelKey:"settings.sections.agent",icon:n.Bot},{id:"environment",labelKey:"settings.sections.environment",icon:s.Terminal},{id:"workflow",labelKey:"settings.sections.workflow",icon:a.GitBranch},{id:"ci",labelKey:"settings.sections.ci",icon:o.Activity},{id:"stage-timeouts",labelKey:"settings.sections.timeouts",icon:u.Timer},{id:"notifications",labelKey:"settings.sections.notifications",icon:r},{id:"feature-flags",labelKey:"settings.sections.flags",icon:c},{id:"interactive-agent",labelKey:"settings.sections.chat",icon:g.MessageSquare},{id:"fab-layout",labelKey:"settings.sections.layout",icon:h},{id:"database",labelKey:"settings.sections.database",icon:d},{id:"litellm-proxy",labelKey:"settings.sections.proxy",icon:m.Server}],e8=[{id:"all",labelKey:"settings.sections.all",icon:p},...e6];e.s(["SettingsPageClient",0,function({settings:e,shipitAiHome:n,dbFileSize:s,availableTerminals:a,availableEditors:o,availableShells:l}){let{t:r}=(0,f.useTranslation)("web"),[c,d]=(0,i.useState)("all"),[u,g]=(0,i.useState)("agent");return(0,i.useEffect)(()=>{if("all"!==c)return;let e=e6.map(e=>document.getElementById(`section-${e.id}`)).filter(Boolean);if(0===e.length)return;let t=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&g(t.target.id.replace("section-",""))},{rootMargin:"-65px 0px -60% 0px",threshold:0});for(let i of e)t.observe(i);return()=>t.disconnect()},[c]),(0,t.jsxs)("div",{"data-testid":"settings-page-client",className:"max-w-5xl px-8 pt-8",children:[(0,t.jsxs)("div",{className:"bg-background/95 supports-backdrop-filter:bg-background/80 sticky top-0 z-10 pb-4 backdrop-blur",children:[(0,t.jsxs)("div",{className:"mb-4 space-y-1.5",children:[(0,t.jsx)("span",{className:"text-[10px] font-bold tracking-[0.2em] text-slate-400 uppercase",children:"Developer Portal"}),(0,t.jsx)("div",{className:"flex items-baseline gap-3",children:(0,t.jsx)("h1",{className:"text-foreground text-3xl font-black tracking-tight",children:r("settings.title")})})]}),(0,t.jsx)("nav",{className:"bg-card editorial-shadow flex flex-wrap items-center gap-0.5 rounded-lg p-1",children:e8.map(e=>{let i=e.icon,n=c===e.id||"all"===c&&"all"!==e.id&&u===e.id;return(0,t.jsxs)("button",{type:"button",onClick:()=>d(e.id),className:(0,x.cn)("flex cursor-pointer items-center gap-1 rounded-md px-2 py-1.5 text-[11px] font-bold transition-all",n?"bg-muted text-primary shadow-sm ring-1 ring-slate-200/70 dark:ring-slate-700/50":"text-muted-foreground hover:text-foreground hover:bg-accent/50"),children:[(0,t.jsx)(i,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"hidden sm:inline",children:r(e.labelKey)})]},e.id)})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[("all"===c||"agent"===c)&&(0,t.jsx)("div",{id:"section-agent",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(A,{settings:e})}),("all"===c||"environment"===c)&&(0,t.jsx)("div",{id:"section-environment",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(X,{settings:e,availableEditors:o,availableShells:l,availableTerminals:a})}),("all"===c||"workflow"===c)&&(0,t.jsx)("div",{id:"section-workflow",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(Q,{settings:e})}),("all"===c||"ci"===c)&&(0,t.jsx)("div",{id:"section-ci",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(ee,{settings:e})}),("all"===c||"stage-timeouts"===c)&&(0,t.jsx)("div",{id:"section-stage-timeouts",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(eV,{settings:e})}),("all"===c||"notifications"===c)&&(0,t.jsx)("div",{id:"section-notifications",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(e_,{settings:e})}),("all"===c||"feature-flags"===c)&&(0,t.jsx)("div",{id:"section-feature-flags",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(eG,{settings:e})}),("all"===c||"interactive-agent"===c)&&(0,t.jsx)("div",{id:"section-interactive-agent",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(e$,{settings:e})}),("all"===c||"fab-layout"===c)&&(0,t.jsx)("div",{id:"section-fab-layout",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(eZ,{settings:e})}),("all"===c||"database"===c)&&(0,t.jsx)("div",{id:"section-database",className:"scroll-mt-18 rounded-lg",children:(0,t.jsx)(eX,{shipitAiHome:n,dbFileSize:s})}),("all"===c||"litellm-proxy"===c)&&(0,t.jsxs)("div",{id:"section-litellm-proxy",className:"scroll-mt-18 rounded-lg",children:[(0,t.jsx)(e3,{settings:e}),e.litellmProxy?.baseUrl?(0,t.jsx)(e2,{settings:e}):null]})]})]})}],41952)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(96871),r=e.i(16539),a=e.i(33109),s=e.i(60112),i=e.i(96976);let o=(0,i.createServerReference)("400a42af6e2cec3728e3145e88ffcf104a015ee09d",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(26759);var n=e.i(97164);e.i(1650);var l=e.i(11495),c=e.i(45811),d=e.i(35364),p=e.i(41957),u=e.i(81846),h=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("40c199af21f0c83c99e3185c1393d5ad435bbad637",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var g=e.i(42076);let b=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"]),j={allowPrd:!1,allowPlan:!1,allowMerge:!1};var v=e.i(82639),w=e.i(22570),C=e.i(45977),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var T=e.i(86254),k=e.i(9749);function P({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:c,onDragLeave:d,onDragOver:u,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:M,overrideModel:A,currentAgentType:I,currentModel:O,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),_=(0,r.useRef)(null);return(0,t.jsxs)("div",{role:"region","aria-label":B("createDrawer.fileDropZone"),"data-drag-over":f?"true":"false",onDragEnter:c,onDragLeave:d,onDragOver:u,onDrop:m,className:(0,y.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",f&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(p.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:B("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:_,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=_.current?.contains(document.activeElement),t=_.current?.querySelector('[aria-expanded="true"]')!==null;e||t||S()},0)},className:(0,y.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",b&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(D.Textarea,{id:"feature-description",placeholder:B("createDrawer.featurePlaceholder"),value:e,onChange:e=>a(e.target.value),onPaste:l,required:!0,disabled:U,"aria-invalid":!!g,"aria-describedby":g?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:s.map(e=>(0,t.jsx)(T.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>i(e.id),disabled:U,loading:e.loading,notes:e.notes,onNotesChange:t=>o(e.id,t)},e.id))}),g?(0,t.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(k.AgentModelPicker,{initialAgentType:M??I??"claude-code",initialModel:A??O??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"pending-mode",checked:R,onCheckedChange:L,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(C.Clock,{className:"h-3.5 w-3.5"}),B("createDrawer.pendingMode")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"fast-mode",checked:F,onCheckedChange:E,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(w.Zap,{className:"h-3.5 w-3.5"}),B("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:x,disabled:U,"aria-label":B("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(v.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(8791),F=e.i(13867),E=e.i(96612),R=e.i(27381),L=e.i(47373);let M=(0,i.createServerReference)("402644f329b8e414e2f2e4c562b866756eecd73e81",i.callServer,void 0,i.findSourceMapURL,"getAgentPermissionOptions"),A=["allowPrd","allowPlan","allowMerge"];function I({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:c,openPr:d,onOpenPrChange:u,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:T,computedOpenPr:k,isSubmitting:P,agentType:R,permissionMode:L,onPermissionModeChange:M}){let{t:z}=(0,n.useTranslation)("web"),U=[{id:"allowPrd",label:z("createDrawer.prd"),description:z("createDrawer.prdDescription")},{id:"allowPlan",label:z("createDrawer.plan"),description:z("createDrawer.planDescription")},{id:"allowMerge",label:z("createDrawer.merge"),description:z("createDrawer.mergeDescription")}];return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:z("createDrawer.approve")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:U.map(a=>(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:`approve-${a.id}`,size:"sm",checked:e[a.id]??!1,onCheckedChange:t=>r({...e,[a.id]:t}),disabled:P||D&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,t.jsx)(p.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?z("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=A.every(t=>e[t]),a={};for(let e of A)a[e]=!t;r(a)},disabled:P,className:(0,y.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",A.every(t=>e[t])&&"text-primary"),children:z("createDrawer.all")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:z("createDrawer.evidence")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"enable-evidence",size:"sm",checked:a,onCheckedChange:e=>{s(e),e||o(!1)},disabled:P}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.collect")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.collectDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-evidence",size:"sm",checked:i,onCheckedChange:o,disabled:P||!a||!d&&!v}),(0,t.jsx)(p.Label,{htmlFor:"commit-evidence",className:(0,y.cn)("cursor-pointer text-xs font-medium",(!a||!d&&!v)&&"opacity-50"),children:z("createDrawer.addToPr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:d||v?a?z("createDrawer.addToPrDescription"):z("createDrawer.requiresEvidence"):z("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:z("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"push",size:"sm",checked:T,onCheckedChange:e=>{c(e),!e&&d&&u(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.push")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.pushDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"open-pr",size:"sm",checked:k,onCheckedChange:e=>{u(e),e||o(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.pr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.prDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"ci-watch",size:"sm",checked:m,onCheckedChange:x,disabled:P}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.watch")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"rebase-before-branch",size:"sm",checked:f,onCheckedChange:g,disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(E.RefreshCw,{className:"h-3 w-3"}),z("createDrawer.sync")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.syncDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-specs",size:"sm",checked:b,onCheckedChange:j,disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(F.FileText,{className:"h-3 w-3"}),z("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"fork-and-pr",size:"sm",checked:v,onCheckedChange:e=>{w(e),e&&j(!1)},disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(S.GitFork,{className:"h-3 w-3"}),z("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.forkAndPrDescription")})]})]})]}),R&&M?(0,t.jsx)(O,{agentType:R,permissionMode:L,onPermissionModeChange:M,isSubmitting:P}):null]})}function O({agentType:e,permissionMode:a,onPermissionModeChange:s,isSubmitting:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)([]);return((0,r.useEffect)(()=>{let t=!1;return M(e).then(e=>{t||c(e)}),()=>{t=!0}},[e]),0===l.length)?null:(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-muted-foreground flex w-16 shrink-0 cursor-default items-center gap-1 text-xs font-semibold tracking-wider",children:[(0,t.jsx)(R.Shield,{className:"h-3 w-3"}),o("feature.create.permissionMode")]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:o("settings.agent.permissions.description",{agent:e})})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsxs)(L.Select,{value:a??"__default__",onValueChange:e=>s("__default__"===e?void 0:e),disabled:i,children:[(0,t.jsx)(L.SelectTrigger,{id:"permission-mode","data-testid":"permission-mode-select",className:"h-7 text-xs",children:(0,t.jsx)(L.SelectValue,{})}),(0,t.jsxs)(L.SelectContent,{children:[(0,t.jsx)(L.SelectItem,{value:"__default__",children:o("feature.create.permissionModeDefault")}),l.map(e=>(0,t.jsx)(L.SelectItem,{value:e.value,children:e.label},e.value))]})]})})]})}var z=e.i(56060),U=e.i(91653),B=e.i(98127),_=e.i(90382);function G({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,n.useTranslation)("web"),[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),m=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.id.toLowerCase().includes(d.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]);return(0,r.useEffect)(()=>{l?setTimeout(()=>u.current?.focus(),0):p("")},[l]),(0,t.jsxs)(_.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(_.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":l,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,y.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(B.Input,{ref:u,placeholder:o("createDrawer.searchFeatures"),value:d,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>x(void 0),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(U.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===m.length&&d?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(U.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}var W=e.i(47930),$=e.i(79561),q=e.i(25235),K=e.i(75921),V=e.i(59668),Z=e.i(78521);e.i(13322);var J=e.i(61201);function H({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,c]=(0,r.useState)(!1),[d,p]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,K.useFeatureFlags)(),{t:v}=(0,n.useTranslation)("web"),w=e.find(e=>e.path===a),C=d.trim()?e.filter(e=>e.name.toLowerCase().includes(d.toLowerCase())||e.path.toLowerCase().includes(d.toLowerCase())):e,D=(0,r.useCallback)(e=>{s(e),c(!1),p("")},[s]),N=(0,r.useCallback)(async e=>{let t=await (0,V.addRepository)({path:e});if(t.error){x(t.error),h(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),c(!1),p("")}},[i,s]),T=(0,r.useCallback)(async()=>{if(!u){if(j)return void g(!0);h(!0),x(null);try{let e=await (0,Z.pickFolder)();if(!e)return void h(!1);await N(e)}catch{g(!0)}finally{h(!1)}}},[u,j,N]),k=(0,r.useCallback)(async e=>{if(g(!1),e){h(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{h(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_.Popover,{open:l,onOpenChange:c,children:[(0,t.jsx)(_.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository","aria-invalid":!!m,"aria-describedby":m?"add-repository-error-msg":void 0,disabled:o,"data-testid":"repository-combobox",className:(0,y.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!w&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w?w.name:"Select repository..."}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(B.Input,{ref:b,placeholder:v("createDrawer.searchRepositories"),value:d,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===C.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):C.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>D(e.path),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(U.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(q.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:T,disabled:u,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[u?(0,t.jsx)($.LoaderCircle,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(W.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),m?(0,t.jsx)("p",{id:"add-repository-error-msg",className:"px-3 pb-2 text-xs text-red-500",role:"alert","data-testid":"add-repository-error",children:m}):null]})})]}),(0,t.jsx)(J.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:k})]})}function Q({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}){let{t:S}=(0,n.useTranslation)("web"),F=function({open:e,onClose:t,onSubmit:a,repositoryPath:s,workflowDefaults:i,repositories:o,initialParentId:n,currentAgentType:l,currentModel:c,initialDescription:d,canPushDirectly:p}){let u=(0,m.useSoundAction)("create"),h=s&&(!o||0===o.length||o.some(e=>e.path===s))?s:"",v=i?.approvalGates??j,w=i?.push??!1,C=i?.openPr??!1,y=i?.ciWatchEnabled!==!1,D=i?.enableEvidence??!1,N=i?.commitEvidence??!1,T=i?.fast!==!1,[k,P]=(0,r.useState)(d??"");(0,r.useEffect)(()=>{d&&P(d)},[d]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,M]=(0,r.useState)(w),[A,I]=(0,r.useState)(C),[O,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[_,G]=(0,r.useState)(N),[W,$]=(0,r.useState)(void 0),[q,K]=(0,r.useState)(T),[V,Z]=(0,r.useState)(!1),[J,H]=(0,r.useState)(!1),[Q,X]=(0,r.useState)(!0),[Y,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(void 0),[en,el]=(0,r.useState)(h||void 0),[ec,ed]=(0,r.useState)(o??[]),[ep,eu]=(0,r.useState)(!1),[eh,em]=(0,r.useState)(null),[ex,ef]=(0,r.useState)(!1),eg=(0,r.useRef)(crypto.randomUUID()),eb=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),M(i.push),I(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),G(i.commitEvidence),K(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{ed(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&$(n)},[e,n]);let[ej,ev]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{ev(p??!1)},[p]);let ew=(0,r.useRef)(en);(0,r.useEffect)(()=>{en&&en!==ew.current&&(ew.current=en,f(en).then(e=>ev(e.canPushDirectly)).catch(()=>ev(!1)))},[en]),(0,r.useEffect)(()=>{ej&&(H(!1),M(w),I(C),X(!0))},[ej,w,C]);let eC=(0,r.useCallback)(()=>{P(""),F([]),R({...v}),M(w),I(C),z(y),B(D),G(N),$(void 0),el(h||void 0),ed(o??[]),K(T),Z(!1),H(!1),X(!0),ee(!0),er(void 0),es(void 0),eo(void 0),em(null),eb.current=0,eu(!1)},[v,w,C,D,y,N,T,h,o]),ey=""!==k.trim()||S.length>0,{attemptClose:eD}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ey,onClose:t,onReset:eC}),eN=(0,r.useCallback)(async e=>{for(let t of(em(null),e)){if(t.size>0xa00000)return void em(`"${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&&!b.has(e))return void em(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eg.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(t.error??"Upload failed");return}let s=await a.json();F(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),em("Upload failed")}}},[]),eT=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current+=1,1===eb.current&&eu(!0)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current-=1,0===eb.current&&eu(!1)},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eS=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current=0,eu(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eN(t)},[eN]),eF=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),eN(r))},[eN]),eE=(0,r.useCallback)(e=>{if(e.preventDefault(),!k.trim())return;let t=en??h;t&&(u.play(),a({description:k.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!J||L||A,openPr:!!J||A,ciWatchEnabled:O,enableEvidence:U,commitEvidence:_,fast:q,forkAndPr:J,commitSpecs:Q,rebaseBeforeBranch:Y,...V?{pending:V}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...ei?{permissionMode:ei}:{},...W?{parentId:W}:{},sessionId:eg.current}),eC())},[k,S,E,en,h,a,L,A,U,O,_,q,J,Q,Y,V,et,ea,ei,W,u,eC]),eR=(0,r.useCallback)(async()=>{try{let e=await (0,g.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eg.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(t.error??"Upload failed");return}let a=await r.json();F(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),em("Upload failed")}}}catch{}},[]),eL=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eM=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:h,canPush:ej,isDirty:ey,computedPush:!!J||L||A,computedOpenPr:!!J||A,description:k,setDescription:P,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:M,openPr:A,setOpenPr:I,ciWatchEnabled:O,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:_,setCommitEvidence:G,parentId:W,setParentId:$,fast:q,setFast:K,pending:V,setPending:Z,forkAndPr:J,setForkAndPr:H,commitSpecs:Q,setCommitSpecs:X,rebaseBeforeBranch:Y,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,permissionMode:ei,setPermissionMode:eo,selectedRepoPath:en,setSelectedRepoPath:el,localRepos:ec,setLocalRepos:ed,isDragOver:ep,uploadError:eh,isPromptFocused:ex,setIsPromptFocused:ef,sessionIdRef:eg,currentAgentType:l,currentModel:c,attemptClose:eD,handleFiles:eN,handleDragEnter:eT,handleDragLeave:ek,handleDragOver:eP,handleDrop:eS,handlePaste:eF,handleSubmit:eE,handleAddFiles:eR,handleRemoveFile:eL,handleNotesChange:eM,resetForm:eC}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),L=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,A=!F.validRepoPath&&!F.selectedRepoPath;return(0,t.jsx)(l.BaseDrawer,{open:e,onClose:F.attemptClose,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(c.DrawerTitle,{children:S("createDrawer.title")})]}),o?(0,t.jsx)(c.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(u.Badge,{variant:"secondary",children:S("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(d.Button,{variant:"outline",onClick:F.attemptClose,disabled:o,children:S("createDrawer.cancel")}),(0,t.jsx)(d.Button,{type:"submit",form:"create-feature-form",disabled:!F.description.trim()||o||A,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(h.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:E,id:"create-feature-form",onSubmit:F.handleSubmit,onKeyDown:R,className:"flex flex-col gap-4",children:[M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)(H,{repositories:F.localRepos,value:F.selectedRepoPath,onChange:F.setSelectedRepoPath,onAddRepository:e=>{F.setLocalRepos(t=>[...t,e]),F.setSelectedRepoPath(e.path)},disabled:o})]}):F.validRepoPath?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:C?.find(e=>e.path===F.validRepoPath)?.name??F.validRepoPath.split("/").pop()})]}):null,(0,t.jsx)(P,{description:F.description,onDescriptionChange:F.setDescription,attachments:F.attachments,onRemoveFile:F.handleRemoveFile,onNotesChange:F.handleNotesChange,onPaste:F.handlePaste,onDragEnter:F.handleDragEnter,onDragLeave:F.handleDragLeave,onDragOver:F.handleDragOver,onDrop:F.handleDrop,onAddFiles:F.handleAddFiles,isDragOver:F.isDragOver,uploadError:F.uploadError,isPromptFocused:F.isPromptFocused,onPromptFocus:()=>F.setIsPromptFocused(!0),onPromptBlur:()=>F.setIsPromptFocused(!1),fast:F.fast,onFastChange:F.setFast,pending:F.pending,onPendingChange:F.setPending,overrideAgent:F.overrideAgent,overrideModel:F.overrideModel,currentAgentType:D,currentModel:N,onAgentModelChange:(e,t)=>{F.setOverrideAgent(e),F.setOverrideModel(t)},isSubmitting:o}),L&&void 0!==y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(p.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.parentFeature")}),(0,t.jsx)(G,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(I,{approvalGates:F.approvalGates,onApprovalGatesChange:F.setApprovalGates,enableEvidence:F.enableEvidence,onEnableEvidenceChange:F.setEnableEvidence,commitEvidence:F.commitEvidence,onCommitEvidenceChange:F.setCommitEvidence,push:F.push,onPushChange:F.setPush,openPr:F.openPr,onOpenPrChange:F.setOpenPr,ciWatchEnabled:F.ciWatchEnabled,onCiWatchChange:F.setCiWatchEnabled,rebaseBeforeBranch:F.rebaseBeforeBranch,onRebaseBeforeBranchChange:F.setRebaseBeforeBranch,commitSpecs:F.commitSpecs,onCommitSpecsChange:F.setCommitSpecs,forkAndPr:F.forkAndPr,onForkAndPrChange:F.setForkAndPr,canPush:F.canPush,fast:F.fast,computedPush:F.computedPush,computedOpenPr:F.computedOpenPr,isSubmitting:o,agentType:F.overrideAgent??D,permissionMode:F.permissionMode,onPermissionModeChange:F.setPermissionMode})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:u,canPushDirectly:h}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,r.useCallback)(()=>{m.push("/")},[m]),v=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),f(!1)})},[m]);return(0,t.jsx)(Q,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}],15203)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15203,e=>{"use strict";var t=e.i(96871),r=e.i(16539),a=e.i(33109),s=e.i(60112),i=e.i(96976);let o=(0,i.createServerReference)("40e9bc61cad7433679e3d2bd7ca2dacff27014d812",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(26759);var n=e.i(97164);e.i(1650);var l=e.i(11495),d=e.i(45811),c=e.i(35364),p=e.i(41957),u=e.i(81846),h=e.i(2828),m=e.i(8361),x=e.i(30153);let f=(0,i.createServerReference)("4031e48d6082e9c112deb1efd638289d67362dc082",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var g=e.i(42076);let b=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"]),j={allowPrd:!1,allowPlan:!1,allowMerge:!1};var v=e.i(82639),w=e.i(22570),C=e.i(45977),y=e.i(31777),D=e.i(48306),N=e.i(51911);e.i(50032);var T=e.i(86254),k=e.i(9749);function P({description:e,onDescriptionChange:a,attachments:s,onRemoveFile:i,onNotesChange:o,onPaste:l,onDragEnter:d,onDragLeave:c,onDragOver:u,onDrop:m,onAddFiles:x,isDragOver:f,uploadError:g,isPromptFocused:b,onPromptFocus:j,onPromptBlur:S,fast:F,onFastChange:E,pending:R,onPendingChange:L,overrideAgent:M,overrideModel:A,currentAgentType:I,currentModel:O,onAgentModelChange:z,isSubmitting:U}){let{t:B}=(0,n.useTranslation)("web"),_=(0,r.useRef)(null);return(0,t.jsxs)("div",{role:"region","aria-label":B("createDrawer.fileDropZone"),"data-drag-over":f?"true":"false",onDragEnter:d,onDragLeave:c,onDragOver:u,onDrop:m,className:(0,y.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",f&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(p.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:B("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:_,onFocus:j,onBlur:()=>{setTimeout(()=>{let e=_.current?.contains(document.activeElement),t=_.current?.querySelector('[aria-expanded="true"]')!==null;e||t||S()},0)},className:(0,y.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",b&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(D.Textarea,{id:"feature-description",placeholder:B("createDrawer.featurePlaceholder"),value:e,onChange:e=>a(e.target.value),onPaste:l,required:!0,disabled:U,"aria-invalid":!!g,"aria-describedby":g?"feature-upload-error":void 0,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),s.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:s.map(e=>(0,t.jsx)(T.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>i(e.id),disabled:U,loading:e.loading,notes:e.notes,onNotesChange:t=>o(e.id,t)},e.id))}),g?(0,t.jsx)("p",{id:"feature-upload-error",className:"text-destructive px-3 pb-2 text-xs",role:"alert",children:g}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(k.AgentModelPicker,{initialAgentType:M??I??"claude-code",initialModel:A??O??"claude-sonnet-4-6",mode:"override",onAgentModelChange:z,disabled:U,className:"w-55"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"pending-mode",checked:R,onCheckedChange:L,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(C.Clock,{className:"h-3.5 w-3.5"}),B("createDrawer.pendingMode")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(N.Switch,{id:"fast-mode",checked:F,onCheckedChange:E,disabled:U}),(0,t.jsxs)(p.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(w.Zap,{className:"h-3.5 w-3.5"}),B("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:x,disabled:U,"aria-label":B("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(v.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:B("chat.attachFiles")})]})]})]})]})}var S=e.i(8791),F=e.i(13867),E=e.i(96612),R=e.i(27381),L=e.i(47373);let M=(0,i.createServerReference)("400c610ec3a675d568dc7b9b32818797118ba08d49",i.callServer,void 0,i.findSourceMapURL,"getAgentPermissionOptions"),A=["allowPrd","allowPlan","allowMerge"];function I({approvalGates:e,onApprovalGatesChange:r,enableEvidence:a,onEnableEvidenceChange:s,commitEvidence:i,onCommitEvidenceChange:o,push:l,onPushChange:d,openPr:c,onOpenPrChange:u,ciWatchEnabled:m,onCiWatchChange:x,rebaseBeforeBranch:f,onRebaseBeforeBranchChange:g,commitSpecs:b,onCommitSpecsChange:j,forkAndPr:v,onForkAndPrChange:w,canPush:C,fast:D,computedPush:T,computedOpenPr:k,isSubmitting:P,agentType:R,permissionMode:L,onPermissionModeChange:M}){let{t:z}=(0,n.useTranslation)("web"),U=[{id:"allowPrd",label:z("createDrawer.prd"),description:z("createDrawer.prdDescription")},{id:"allowPlan",label:z("createDrawer.plan"),description:z("createDrawer.planDescription")},{id:"allowMerge",label:z("createDrawer.merge"),description:z("createDrawer.mergeDescription")}];return(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:z("createDrawer.approve")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:U.map(a=>(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:`approve-${a.id}`,size:"sm",checked:e[a.id]??!1,onCheckedChange:t=>r({...e,[a.id]:t}),disabled:P||D&&("allowPrd"===a.id||"allowPlan"===a.id)}),(0,t.jsx)(p.Label,{htmlFor:`approve-${a.id}`,className:"cursor-pointer text-xs font-medium",children:a.label})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:D&&("allowPrd"===a.id||"allowPlan"===a.id)?z("createDrawer.skippedInFastMode"):a.description})]},a.id))}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let t=A.every(t=>e[t]),a={};for(let e of A)a[e]=!t;r(a)},disabled:P,className:(0,y.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",A.every(t=>e[t])&&"text-primary"),children:z("createDrawer.all")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:z("createDrawer.evidence")})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"enable-evidence",size:"sm",checked:a,onCheckedChange:e=>{s(e),e||o(!1)},disabled:P}),(0,t.jsx)(p.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.collect")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.collectDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-evidence",size:"sm",checked:i,onCheckedChange:o,disabled:P||!a||!c&&!v}),(0,t.jsx)(p.Label,{htmlFor:"commit-evidence",className:(0,y.cn)("cursor-pointer text-xs font-medium",(!a||!c&&!v)&&"opacity-50"),children:z("createDrawer.addToPr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:c||v?a?z("createDrawer.addToPrDescription"):z("createDrawer.requiresEvidence"):z("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:z("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"push",size:"sm",checked:T,onCheckedChange:e=>{d(e),!e&&c&&u(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"push",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.push")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.pushDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"open-pr",size:"sm",checked:k,onCheckedChange:e=>{u(e),e||o(!1)},disabled:P||v}),(0,t.jsx)(p.Label,{htmlFor:"open-pr",className:(0,y.cn)("cursor-pointer text-xs font-medium",v&&"opacity-50"),children:z("createDrawer.pr")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:v?"Enabled — contributing to upstream":z("createDrawer.prDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"ci-watch",size:"sm",checked:m,onCheckedChange:x,disabled:P}),(0,t.jsx)(p.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:z("createDrawer.watch")})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"rebase-before-branch",size:"sm",checked:f,onCheckedChange:g,disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(E.RefreshCw,{className:"h-3 w-3"}),z("createDrawer.sync")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.syncDescription")})]}),(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"commit-specs",size:"sm",checked:b,onCheckedChange:j,disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(F.FileText,{className:"h-3 w-3"}),z("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.commitSpecsDescription")})]}),!C&&(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(N.Switch,{id:"fork-and-pr",size:"sm",checked:v,onCheckedChange:e=>{w(e),e&&j(!1)},disabled:P}),(0,t.jsxs)(p.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(S.GitFork,{className:"h-3 w-3"}),z("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:z("createDrawer.forkAndPrDescription")})]})]})]}),R&&M?(0,t.jsx)(O,{agentType:R,permissionMode:L,onPermissionModeChange:M,isSubmitting:P}):null]})}function O({agentType:e,permissionMode:a,onPermissionModeChange:s,isSubmitting:i}){let{t:o}=(0,n.useTranslation)("web"),[l,d]=(0,r.useState)([]);return((0,r.useEffect)(()=>{let t=!1;return M(e).then(e=>{t||d(e)}),()=>{t=!0}},[e]),0===l.length)?null:(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(h.Tooltip,{children:[(0,t.jsx)(h.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("span",{className:"text-muted-foreground flex w-16 shrink-0 cursor-default items-center gap-1 text-xs font-semibold tracking-wider",children:[(0,t.jsx)(R.Shield,{className:"h-3 w-3"}),o("feature.create.permissionMode")]})}),(0,t.jsx)(h.TooltipContent,{side:"bottom",children:o("settings.agent.permissions.description",{agent:e})})]}),(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsxs)(L.Select,{value:a??"__default__",onValueChange:e=>s("__default__"===e?void 0:e),disabled:i,children:[(0,t.jsx)(L.SelectTrigger,{id:"permission-mode","data-testid":"permission-mode-select",className:"h-7 text-xs",children:(0,t.jsx)(L.SelectValue,{})}),(0,t.jsxs)(L.SelectContent,{children:[(0,t.jsx)(L.SelectItem,{value:"__default__",children:o("feature.create.permissionModeDefault")}),l.map(e=>(0,t.jsx)(L.SelectItem,{value:e.value,children:e.label},e.value))]})]})})]})}var z=e.i(56060),U=e.i(91653),B=e.i(98127),_=e.i(90382);function G({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,n.useTranslation)("web"),[l,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),u=(0,r.useRef)(null),h=e.find(e=>e.id===a),m=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,x=(0,r.useCallback)(e=>{s(e),d(!1),p("")},[s]);return(0,r.useEffect)(()=>{l?setTimeout(()=>u.current?.focus(),0):p("")},[l]),(0,t.jsxs)(_.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(_.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":l,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,y.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!h&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:h?`${h.name} (${h.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(B.Input,{ref:u,placeholder:o("createDrawer.searchFeatures"),value:c,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>x(void 0),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(U.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===m.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):m.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>x(e.id),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(U.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}var W=e.i(47930),$=e.i(79561),q=e.i(25235),K=e.i(75921),V=e.i(71461),Z=e.i(78521);e.i(13322);var J=e.i(61201);function H({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[l,d]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),[u,h]=(0,r.useState)(!1),[m,x]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1),b=(0,r.useRef)(null),{reactFileManager:j}=(0,K.useFeatureFlags)(),{t:v}=(0,n.useTranslation)("web"),w=e.find(e=>e.path===a),C=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.path.toLowerCase().includes(c.toLowerCase())):e,D=(0,r.useCallback)(e=>{s(e),d(!1),p("")},[s]),N=(0,r.useCallback)(async e=>{let t=await (0,V.addRepository)({path:e});if(t.error){x(t.error),h(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),d(!1),p("")}},[i,s]),T=(0,r.useCallback)(async()=>{if(!u){if(j)return void g(!0);h(!0),x(null);try{let e=await (0,Z.pickFolder)();if(!e)return void h(!1);await N(e)}catch{g(!0)}finally{h(!1)}}},[u,j,N]),k=(0,r.useCallback)(async e=>{if(g(!1),e){h(!0),x(null);try{await N(e)}catch(e){x(e instanceof Error?e.message:"Failed to add repository")}finally{h(!1)}}},[N]);return(0,r.useEffect)(()=>{l?setTimeout(()=>b.current?.focus(),0):p("")},[l]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(_.Popover,{open:l,onOpenChange:d,children:[(0,t.jsx)(_.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":l,"aria-label":"Repository","aria-invalid":!!m,"aria-describedby":m?"add-repository-error-msg":void 0,disabled:o,"data-testid":"repository-combobox",className:(0,y.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!w&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:w?w.name:"Select repository..."}),(0,t.jsx)(z.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(_.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(B.Input,{ref:b,placeholder:v("createDrawer.searchRepositories"),value:c,onChange:e=>p(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===C.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):C.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>D(e.path),className:(0,y.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(U.CheckIcon,{className:(0,y.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(q.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:T,disabled:u,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[u?(0,t.jsx)($.LoaderCircle,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(W.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),m?(0,t.jsx)("p",{id:"add-repository-error-msg",className:"px-3 pb-2 text-xs text-red-500",role:"alert","data-testid":"add-repository-error",children:m}):null]})})]}),(0,t.jsx)(J.ReactFileManagerDialog,{open:f,onOpenChange:e=>{e||g(!1)},onSelect:k})]})}function Q({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:v,features:w,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}){let{t:S}=(0,n.useTranslation)("web"),F=function({open:e,onClose:t,onSubmit:a,repositoryPath:s,workflowDefaults:i,repositories:o,initialParentId:n,currentAgentType:l,currentModel:d,initialDescription:c,canPushDirectly:p}){let u=(0,m.useSoundAction)("create"),h=s&&(!o||0===o.length||o.some(e=>e.path===s))?s:"",v=i?.approvalGates??j,w=i?.push??!1,C=i?.openPr??!1,y=i?.ciWatchEnabled!==!1,D=i?.enableEvidence??!1,N=i?.commitEvidence??!1,T=i?.fast!==!1,[k,P]=(0,r.useState)(c??"");(0,r.useEffect)(()=>{c&&P(c)},[c]);let[S,F]=(0,r.useState)([]),[E,R]=(0,r.useState)({...v}),[L,M]=(0,r.useState)(w),[A,I]=(0,r.useState)(C),[O,z]=(0,r.useState)(i?.ciWatchEnabled!==!1),[U,B]=(0,r.useState)(D),[_,G]=(0,r.useState)(N),[W,$]=(0,r.useState)(void 0),[q,K]=(0,r.useState)(T),[V,Z]=(0,r.useState)(!1),[J,H]=(0,r.useState)(!1),[Q,X]=(0,r.useState)(!0),[Y,ee]=(0,r.useState)(!0),[et,er]=(0,r.useState)(void 0),[ea,es]=(0,r.useState)(void 0),[ei,eo]=(0,r.useState)(void 0),[en,el]=(0,r.useState)(h||void 0),[ed,ec]=(0,r.useState)(o??[]),[ep,eu]=(0,r.useState)(!1),[eh,em]=(0,r.useState)(null),[ex,ef]=(0,r.useState)(!1),eg=(0,r.useRef)(crypto.randomUUID()),eb=(0,r.useRef)(0);(0,r.useEffect)(()=>{i&&(R({...i.approvalGates}),M(i.push),I(i.openPr),z(!1!==i.ciWatchEnabled),B(i.enableEvidence),G(i.commitEvidence),K(!1!==i.fast))},[i]),(0,r.useEffect)(()=>{ec(o??[])},[o]),(0,r.useEffect)(()=>{e&&n&&$(n)},[e,n]);let[ej,ev]=(0,r.useState)(p??!1);(0,r.useEffect)(()=>{ev(p??!1)},[p]);let ew=(0,r.useRef)(en);(0,r.useEffect)(()=>{en&&en!==ew.current&&(ew.current=en,f(en).then(e=>ev(e.canPushDirectly)).catch(()=>ev(!1)))},[en]),(0,r.useEffect)(()=>{ej&&(H(!1),M(w),I(C),X(!0))},[ej,w,C]);let eC=(0,r.useCallback)(()=>{P(""),F([]),R({...v}),M(w),I(C),z(y),B(D),G(N),$(void 0),el(h||void 0),ec(o??[]),K(T),Z(!1),H(!1),X(!0),ee(!0),er(void 0),es(void 0),eo(void 0),em(null),eb.current=0,eu(!1)},[v,w,C,D,y,N,T,h,o]),ey=""!==k.trim()||S.length>0,{attemptClose:eD}=(0,x.useGuardedDrawerClose)({open:e,isDirty:ey,onClose:t,onReset:eC}),eN=(0,r.useCallback)(async e=>{for(let t of(em(null),e)){if(t.size>0xa00000)return void em(`"${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&&!b.has(e))return void em(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eg.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(t.error??"Upload failed");return}let s=await a.json();F(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),em("Upload failed")}}},[]),eT=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current+=1,1===eb.current&&eu(!0)},[]),ek=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current-=1,0===eb.current&&eu(!1)},[]),eP=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),eS=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eb.current=0,eu(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eN(t)},[eN]),eF=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),eN(r))},[eN]),eE=(0,r.useCallback)(e=>{if(e.preventDefault(),!k.trim())return;let t=en??h;t&&(u.play(),a({description:k.trim(),attachments:S.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:E.allowPrd??!1,allowPlan:E.allowPlan??!1,allowMerge:E.allowMerge??!1},push:!!J||L||A,openPr:!!J||A,ciWatchEnabled:O,enableEvidence:U,commitEvidence:_,fast:q,forkAndPr:J,commitSpecs:Q,rebaseBeforeBranch:Y,...V?{pending:V}:{},...et?{agentType:et}:{},...ea?{model:ea}:{},...ei?{permissionMode:ei}:{},...W?{parentId:W}:{},sessionId:eg.current}),eC())},[k,S,E,en,h,a,L,A,U,O,_,q,J,Q,Y,V,et,ea,ei,W,u,eC]),eR=(0,r.useCallback)(async()=>{try{let e=await (0,g.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();F(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eg.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));F(t=>t.filter(t=>t.id!==e)),em(t.error??"Upload failed");return}let a=await r.json();F(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{F(t=>t.filter(t=>t.id!==e)),em("Upload failed")}}}catch{}},[]),eL=(0,r.useCallback)(e=>{F(t=>t.filter(t=>t.id!==e))},[]),eM=(0,r.useCallback)((e,t)=>{F(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]);return{validRepoPath:h,canPush:ej,isDirty:ey,computedPush:!!J||L||A,computedOpenPr:!!J||A,description:k,setDescription:P,attachments:S,approvalGates:E,setApprovalGates:R,push:L,setPush:M,openPr:A,setOpenPr:I,ciWatchEnabled:O,setCiWatchEnabled:z,enableEvidence:U,setEnableEvidence:B,commitEvidence:_,setCommitEvidence:G,parentId:W,setParentId:$,fast:q,setFast:K,pending:V,setPending:Z,forkAndPr:J,setForkAndPr:H,commitSpecs:Q,setCommitSpecs:X,rebaseBeforeBranch:Y,setRebaseBeforeBranch:ee,overrideAgent:et,setOverrideAgent:er,overrideModel:ea,setOverrideModel:es,permissionMode:ei,setPermissionMode:eo,selectedRepoPath:en,setSelectedRepoPath:el,localRepos:ed,setLocalRepos:ec,isDragOver:ep,uploadError:eh,isPromptFocused:ex,setIsPromptFocused:ef,sessionIdRef:eg,currentAgentType:l,currentModel:d,attemptClose:eD,handleFiles:eN,handleDragEnter:eT,handleDragLeave:ek,handleDragOver:eP,handleDrop:eS,handlePaste:eF,handleSubmit:eE,handleAddFiles:eR,handleRemoveFile:eL,handleNotesChange:eM,resetForm:eC}}({open:e,onClose:a,onSubmit:s,repositoryPath:i,workflowDefaults:v,repositories:C,initialParentId:y,currentAgentType:D,currentModel:N,initialDescription:T,canPushDirectly:k}),E=(0,r.useRef)(null),R=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),E.current?.requestSubmit())},[]),L=w&&w.length>0,M=!F.validRepoPath&&void 0!==C,A=!F.validRepoPath&&!F.selectedRepoPath;return(0,t.jsx)(l.BaseDrawer,{open:e,onClose:F.attemptClose,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(d.DrawerTitle,{children:S("createDrawer.title")})]}),o?(0,t.jsx)(d.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(u.Badge,{variant:"secondary",children:S("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(c.Button,{variant:"outline",onClick:F.attemptClose,disabled:o,children:S("createDrawer.cancel")}),(0,t.jsx)(c.Button,{type:"submit",form:"create-feature-form",disabled:!F.description.trim()||o||A,children:S(o?"createDrawer.creating":"createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(h.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:E,id:"create-feature-form",onSubmit:F.handleSubmit,onKeyDown:R,className:"flex flex-col gap-4",children:[M?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)(H,{repositories:F.localRepos,value:F.selectedRepoPath,onChange:F.setSelectedRepoPath,onAddRepository:e=>{F.setLocalRepos(t=>[...t,e]),F.setSelectedRepoPath(e.path)},disabled:o})]}):F.validRepoPath?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(p.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:C?.find(e=>e.path===F.validRepoPath)?.name??F.validRepoPath.split("/").pop()})]}):null,(0,t.jsx)(P,{description:F.description,onDescriptionChange:F.setDescription,attachments:F.attachments,onRemoveFile:F.handleRemoveFile,onNotesChange:F.handleNotesChange,onPaste:F.handlePaste,onDragEnter:F.handleDragEnter,onDragLeave:F.handleDragLeave,onDragOver:F.handleDragOver,onDrop:F.handleDrop,onAddFiles:F.handleAddFiles,isDragOver:F.isDragOver,uploadError:F.uploadError,isPromptFocused:F.isPromptFocused,onPromptFocus:()=>F.setIsPromptFocused(!0),onPromptBlur:()=>F.setIsPromptFocused(!1),fast:F.fast,onFastChange:F.setFast,pending:F.pending,onPendingChange:F.setPending,overrideAgent:F.overrideAgent,overrideModel:F.overrideModel,currentAgentType:D,currentModel:N,onAgentModelChange:(e,t)=>{F.setOverrideAgent(e),F.setOverrideModel(t)},isSubmitting:o}),L&&void 0!==y?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(p.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:S("createDrawer.parentFeature")}),(0,t.jsx)(G,{features:w,value:F.parentId,onChange:F.setParentId,disabled:o})]}):null,(0,t.jsx)(I,{approvalGates:F.approvalGates,onApprovalGatesChange:F.setApprovalGates,enableEvidence:F.enableEvidence,onEnableEvidenceChange:F.setEnableEvidence,commitEvidence:F.commitEvidence,onCommitEvidenceChange:F.setCommitEvidence,push:F.push,onPushChange:F.setPush,openPr:F.openPr,onOpenPrChange:F.setOpenPr,ciWatchEnabled:F.ciWatchEnabled,onCiWatchChange:F.setCiWatchEnabled,rebaseBeforeBranch:F.rebaseBeforeBranch,onRebaseBeforeBranchChange:F.setRebaseBeforeBranch,commitSpecs:F.commitSpecs,onCommitSpecsChange:F.setCommitSpecs,forkAndPr:F.forkAndPr,onForkAndPrChange:F.setForkAndPr,canPush:F.canPush,fast:F.fast,computedPush:F.computedPush,computedOpenPr:F.computedOpenPr,isSubmitting:o,agentType:F.overrideAgent??D,permissionMode:F.permissionMode,onPermissionModeChange:F.setPermissionMode})]})})})})}e.s(["CreateDrawerClient",0,function({repositoryPath:e,initialParentId:i,initialDescription:n,features:l,repositories:d,workflowDefaults:c,currentAgentType:p,currentModel:u,canPushDirectly:h}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let j=(0,r.useCallback)(()=>{m.push("/")},[m]),v=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shipit-ai:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),f(!1)})},[m]);return(0,t.jsx)(Q,{open:b,onClose:j,onSubmit:v,repositoryPath:e,features:l,repositories:d,workflowDefaults:c,initialParentId:i,initialDescription:n,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}],15203)}]);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75649,e=>{"use strict";var t=e.i(16539),r=e.i(96871),s=t.createContext(void 0),i=e=>{let{dir:t,children:i}=e;return(0,r.jsx)(s.Provider,{value:t,children:i})};e.s(["DirectionProvider",0,i,"Provider",0,i,"useDirection",0,function(e){let r=t.useContext(s);return e||r||"ltr"}])},87099,e=>{"use strict";var t=e.i(16539),r=e.i(9413),s=e.i(22353),i=e.i(60310),n=e.i(96871),a=new WeakMap;function o(e,t){var r,s;let i,n,a;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let o=(r=e,s=t,i=r.length,(a=(n=l(s))>=0?n:i+n)<0||a>=i?-1:a);return -1===o?void 0:e[o]}function l(e){return e!=e||0===e?0:Math.trunc(e)}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],a.set(this,!0)}set(e,t){return a.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 s,i=this.has(t),n=this.#e.length,a=l(e),o=a>=0?a:n+a,u=o<0||o>=n?-1:o;if(u===this.size||i&&u===this.size-1||-1===u)return this.set(t,r),this;let c=this.size+ +!i;a<0&&o++;let d=[...this.#e],h=!1;for(let e=o;e<c;e++)if(o===e){let n=d[e];d[e]===t&&(n=d[e+1]),i&&this.delete(t),s=this.get(n),this.set(t,r)}else{h||d[e-1]!==t||(h=!0);let r=d[h?e:e-1],i=s;s=this.get(r),this.delete(r),this.set(r,i)}return this}with(t,r,s){let i=new e(this);return i.insert(t,r,s),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,r){let s=this.#e.indexOf(e);return -1===s?this:this.insert(s,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 s=this.#e.indexOf(e);return -1===s?this:this.insert(s+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 s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let s=r+t;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return s;r++}}findIndex(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return r;r++}return -1}filter(t,r){let s=[],i=0;for(let e of this)Reflect.apply(t,r,[e,i,this])&&s.push(e),i++;return new e(s)}map(t,r){let s=[],i=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,i,this])]),i++;return new e(s)}reduce(...e){let[t,r]=e,s=0,i=r??this.at(0);for(let r of this)i=0===s&&1===e.length?r:Reflect.apply(t,this,[i,r,s,this]),s++;return i}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let i=this.at(r);s=r===this.size-1&&1===e.length?i:Reflect.apply(t,this,[s,i,r,this])}return s}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),s=this.get(r);t.set(r,s)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let s=new e,i=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(i=r-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),r=this.get(t);s.set(t,r)}return s}every(e,t){let r=0;for(let s of this){if(!Reflect.apply(e,t,[s,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let s of this){if(Reflect.apply(e,t,[s,r,this]))return!0;r++}return!1}}),e.s(["createCollection",0,function(e){let a=e+"CollectionProvider",[o,l]=(0,r.createContextScope)(a),[u,c]=o(a,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:r,children:s}=e,i=t.default.useRef(null),a=t.default.useRef(new Map).current;return(0,n.jsx)(u,{scope:r,itemMap:a,collectionRef:i,children:s})};d.displayName=a;let h=e+"CollectionSlot",f=(0,i.createSlot)(h),p=t.default.forwardRef((e,t)=>{let{scope:r,children:i}=e,a=c(h,r),o=(0,s.useComposedRefs)(t,a.collectionRef);return(0,n.jsx)(f,{ref:o,children:i})});p.displayName=h;let m=e+"CollectionItemSlot",v="data-radix-collection-item",y=(0,i.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:i,children:a,...o}=e,l=t.default.useRef(null),u=(0,s.useComposedRefs)(r,l),d=c(m,i);return t.default.useEffect(()=>(d.itemMap.set(l,{ref:l,...o}),()=>void d.itemMap.delete(l))),(0,n.jsx)(y,{...{[v]:""},ref:u,children:a})});return g.displayName=m,[{Provider:d,Slot:p,ItemSlot:g},function(r){let s=c(e+"CollectionConsumer",r);return t.default.useCallback(()=>{let e=s.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${v}]`));return Array.from(s.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[s.collectionRef,s.itemMap])},l]}])},64794,e=>{"use strict";var t=e.i(16539),r=e.i(91967),s=e.i(87099),i=e.i(22353),n=e.i(9413),a=e.i(11207),o=e.i(85565),l=e.i(88248),u=e.i(36567),c=e.i(75649),d=e.i(96871),h="rovingFocusGroup.onEntryFocus",f={bubbles:!1,cancelable:!0},p="RovingFocusGroup",[m,v,y]=(0,s.createCollection)(p),[g,b]=(0,n.createContextScope)(p,[y]),[x,w]=g(p),R=t.forwardRef((e,t)=>(0,d.jsx)(m.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(m.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,d.jsx)(C,{...e,ref:t})})}));R.displayName=p;var C=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:n,orientation:a,loop:m=!1,dir:y,currentTabStopId:g,defaultCurrentTabStopId:b,onCurrentTabStopIdChange:w,onEntryFocus:R,preventScrollOnEntryFocus:C=!1,...S}=e,j=t.useRef(null),k=(0,i.useComposedRefs)(s,j),D=(0,c.useDirection)(y),[I,O]=(0,u.useControllableState)({prop:g,defaultProp:b??null,onChange:w,caller:p}),[E,F]=t.useState(!1),M=(0,l.useCallbackRef)(R),N=v(n),P=t.useRef(!1),[A,Q]=t.useState(0);return t.useEffect(()=>{let e=j.current;if(e)return e.addEventListener(h,M),()=>e.removeEventListener(h,M)},[M]),(0,d.jsx)(x,{scope:n,orientation:a,dir:D,loop:m,currentTabStopId:I,onItemFocus:t.useCallback(e=>O(e),[O]),onItemShiftTab:t.useCallback(()=>F(!0),[]),onFocusableItemAdd:t.useCallback(()=>Q(e=>e+1),[]),onFocusableItemRemove:t.useCallback(()=>Q(e=>e-1),[]),children:(0,d.jsx)(o.Primitive.div,{tabIndex:E||0===A?-1:0,"data-orientation":a,...S,ref:k,style:{outline:"none",...e.style},onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,()=>{P.current=!0}),onFocus:(0,r.composeEventHandlers)(e.onFocus,e=>{let t=!P.current;if(e.target===e.currentTarget&&t&&!E){let t=new CustomEvent(h,f);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=N().filter(e=>e.focusable);T([e.find(e=>e.active),e.find(e=>e.id===I),...e].filter(Boolean).map(e=>e.ref.current),C)}}P.current=!1}),onBlur:(0,r.composeEventHandlers)(e.onBlur,()=>F(!1))})})}),S="RovingFocusGroupItem",j=t.forwardRef((e,s)=>{let{__scopeRovingFocusGroup:i,focusable:n=!0,active:l=!1,tabStopId:u,children:c,...h}=e,f=(0,a.useId)(),p=u||f,y=w(S,i),g=y.currentTabStopId===p,b=v(i),{onFocusableItemAdd:x,onFocusableItemRemove:R,currentTabStopId:C}=y;return t.useEffect(()=>{if(n)return x(),()=>R()},[n,x,R]),(0,d.jsx)(m.ItemSlot,{scope:i,id:p,focusable:n,active:l,children:(0,d.jsx)(o.Primitive.span,{tabIndex:g?0:-1,"data-orientation":y.orientation,...h,ref:s,onMouseDown:(0,r.composeEventHandlers)(e.onMouseDown,e=>{n?y.onItemFocus(p):e.preventDefault()}),onFocus:(0,r.composeEventHandlers)(e.onFocus,()=>y.onItemFocus(p)),onKeyDown:(0,r.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void y.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,r){var s;let i=(s=e.key,"rtl"!==r?s:"ArrowLeft"===s?"ArrowRight":"ArrowRight"===s?"ArrowLeft":s);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(i))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(i)))return k[i]}(e,y.orientation,y.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=b().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)i.reverse();else if("prev"===t||"next"===t){var r,s;"prev"===t&&i.reverse();let n=i.indexOf(e.currentTarget);i=y.loop?(r=i,s=n+1,r.map((e,t)=>r[(s+t)%r.length])):i.slice(n+1)}setTimeout(()=>T(i))}}),children:"function"==typeof c?c({isCurrentTabStop:g,hasTabStop:null!=C}):c})})});j.displayName=S;var k={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function T(e,t=!1){let r=document.activeElement;for(let s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}e.s(["Item",0,j,"Root",0,R,"createRovingFocusGroupScope",0,b])},68304,e=>{"use strict";var t=e.i(96871),r=e.i(16539),s=e.i(91967),i=e.i(9413),n=e.i(64794),a=e.i(90816),o=e.i(85565),l=e.i(75649),u=e.i(36567),c=e.i(11207),d="Tabs",[h,f]=(0,i.createContextScope)(d,[n.createRovingFocusGroupScope]),p=(0,n.createRovingFocusGroupScope)(),[m,v]=h(d),y=r.forwardRef((e,r)=>{let{__scopeTabs:s,value:i,onValueChange:n,defaultValue:a,orientation:h="horizontal",dir:f,activationMode:p="automatic",...v}=e,y=(0,l.useDirection)(f),[g,b]=(0,u.useControllableState)({prop:i,onChange:n,defaultProp:a??"",caller:d});return(0,t.jsx)(m,{scope:s,baseId:(0,c.useId)(),value:g,onValueChange:b,orientation:h,dir:y,activationMode:p,children:(0,t.jsx)(o.Primitive.div,{dir:y,"data-orientation":h,...v,ref:r})})});y.displayName=d;var g="TabsList",b=r.forwardRef((e,r)=>{let{__scopeTabs:s,loop:i=!0,...a}=e,l=v(g,s),u=p(s);return(0,t.jsx)(n.Root,{asChild:!0,...u,orientation:l.orientation,dir:l.dir,loop:i,children:(0,t.jsx)(o.Primitive.div,{role:"tablist","aria-orientation":l.orientation,...a,ref:r})})});b.displayName=g;var x="TabsTrigger",w=r.forwardRef((e,r)=>{let{__scopeTabs:i,value:a,disabled:l=!1,...u}=e,c=v(x,i),d=p(i),h=S(c.baseId,a),f=j(c.baseId,a),m=a===c.value;return(0,t.jsx)(n.Item,{asChild:!0,...d,focusable:!l,active:m,children:(0,t.jsx)(o.Primitive.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":f,"data-state":m?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:h,...u,ref:r,onMouseDown:(0,s.composeEventHandlers)(e.onMouseDown,e=>{l||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(a)}),onKeyDown:(0,s.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(a)}),onFocus:(0,s.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==c.activationMode;m||l||!e||c.onValueChange(a)})})})});w.displayName=x;var R="TabsContent",C=r.forwardRef((e,s)=>{let{__scopeTabs:i,value:n,forceMount:l,children:u,...c}=e,d=v(R,i),h=S(d.baseId,n),f=j(d.baseId,n),p=n===d.value,m=r.useRef(p);return r.useEffect(()=>{let e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(a.Presence,{present:l||p,children:({present:r})=>(0,t.jsx)(o.Primitive.div,{"data-state":p?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":h,hidden:!r,id:f,tabIndex:0,...c,ref:s,style:{...e.style,animationDuration:m.current?"0s":void 0},children:r&&u})})});function S(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}C.displayName=R,e.s(["Content",0,C,"List",0,b,"Root",0,y,"Tabs",0,y,"TabsContent",0,C,"TabsList",0,b,"TabsTrigger",0,w,"Trigger",0,w,"createTabsScope",0,f],66751);var k=e.i(66751),k=k,T=e.i(31777);let D=k.Root,I=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(k.List,{ref:s,className:(0,T.cn)("bg-muted text-muted-foreground inline-flex h-9 items-center justify-center rounded-lg p-1",e),...r}));I.displayName=k.List.displayName;let O=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(k.Trigger,{ref:s,className:(0,T.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}));O.displayName=k.Trigger.displayName;let E=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(k.Content,{ref:s,className:(0,T.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}));E.displayName=k.Content.displayName,e.s(["Tabs",0,D,"TabsContent",0,E,"TabsList",0,I,"TabsTrigger",0,O],68304)},51818,e=>{"use strict";let t=(0,e.i(54864).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",0,t],51818)},25235,e=>{"use strict";var t=e.i(96871),r=e.i(16539),s=e.i(85565),i="horizontal",n=["horizontal","vertical"],a=r.forwardRef((e,r)=>{var a;let{decorative:o,orientation:l=i,...u}=e,c=(a=l,n.includes(a))?l:i;return(0,t.jsx)(s.Primitive.div,{"data-orientation":c,...o?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...u,ref:r})});a.displayName="Separator",e.s(["Root",0,a,"Separator",0,a],72826);var o=e.i(72826),o=o,l=e.i(31777);e.s(["Separator",0,function({className:e,orientation:r="horizontal",decorative:s=!0,...i}){return(0,t.jsx)(o.Root,{"data-slot":"separator",decorative:s,orientation:r,className:(0,l.cn)("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...i})}],25235)},93026,e=>{"use strict";let t=(0,e.i(54864).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["default",0,t])},8558,e=>{"use strict";var t=e.i(93026);e.s(["XIcon",()=>t.default])},94983,e=>{"use strict";var t=e.i(16539),r=e.i(91967),s=e.i(22353),i=e.i(9413),n=e.i(11207),a=e.i(36567),o=e.i(3659),l=e.i(62854),u=e.i(76903),c=e.i(90816),d=e.i(85565),h=e.i(87656),f=e.i(69759),p=e.i(73772),m=e.i(60310),v=e.i(96871),y="Dialog",[g,b]=(0,i.createContextScope)(y),[x,w]=g(y),R=e=>{let{__scopeDialog:r,children:s,open:i,defaultOpen:o,onOpenChange:l,modal:u=!0}=e,c=t.useRef(null),d=t.useRef(null),[h,f]=(0,a.useControllableState)({prop:i,defaultProp:o??!1,onChange:l,caller:y});return(0,v.jsx)(x,{scope:r,triggerRef:c,contentRef:d,contentId:(0,n.useId)(),titleId:(0,n.useId)(),descriptionId:(0,n.useId)(),open:h,onOpenChange:f,onOpenToggle:t.useCallback(()=>f(e=>!e),[f]),modal:u,children:s})};R.displayName=y;var C="DialogTrigger",S=t.forwardRef((e,t)=>{let{__scopeDialog:i,...n}=e,a=w(C,i),o=(0,s.useComposedRefs)(t,a.triggerRef);return(0,v.jsx)(d.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":K(a.open),...n,ref:o,onClick:(0,r.composeEventHandlers)(e.onClick,a.onOpenToggle)})});S.displayName=C;var j="DialogPortal",[k,T]=g(j,{forceMount:void 0}),D=e=>{let{__scopeDialog:r,forceMount:s,children:i,container:n}=e,a=w(j,r);return(0,v.jsx)(k,{scope:r,forceMount:s,children:t.Children.map(i,e=>(0,v.jsx)(c.Presence,{present:s||a.open,children:(0,v.jsx)(u.Portal,{asChild:!0,container:n,children:e})}))})};D.displayName=j;var I="DialogOverlay",O=t.forwardRef((e,t)=>{let r=T(I,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,n=w(I,e.__scopeDialog);return n.modal?(0,v.jsx)(c.Presence,{present:s||n.open,children:(0,v.jsx)(F,{...i,ref:t})}):null});O.displayName=I;var E=(0,m.createSlot)("DialogOverlay.RemoveScroll"),F=t.forwardRef((e,t)=>{let{__scopeDialog:r,...s}=e,i=w(I,r);return(0,v.jsx)(f.RemoveScroll,{as:E,allowPinchZoom:!0,shards:[i.contentRef],children:(0,v.jsx)(d.Primitive.div,{"data-state":K(i.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),M="DialogContent",N=t.forwardRef((e,t)=>{let r=T(M,e.__scopeDialog),{forceMount:s=r.forceMount,...i}=e,n=w(M,e.__scopeDialog);return(0,v.jsx)(c.Presence,{present:s||n.open,children:n.modal?(0,v.jsx)(P,{...i,ref:t}):(0,v.jsx)(A,{...i,ref:t})})});N.displayName=M;var P=t.forwardRef((e,i)=>{let n=w(M,e.__scopeDialog),a=t.useRef(null),o=(0,s.useComposedRefs)(i,n.contentRef,a);return t.useEffect(()=>{let e=a.current;if(e)return(0,p.hideOthers)(e)},[]),(0,v.jsx)(Q,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,r.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:(0,r.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,r.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault())})}),A=t.forwardRef((e,r)=>{let s=w(M,e.__scopeDialog),i=t.useRef(!1),n=t.useRef(!1);return(0,v.jsx)(Q,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||s.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(n.current=!0));let r=t.target;s.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),Q=t.forwardRef((e,r)=>{let{__scopeDialog:i,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:u,...c}=e,d=w(M,i),f=t.useRef(null),p=(0,s.useComposedRefs)(r,f);return(0,h.useFocusGuards)(),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:u,children:(0,v.jsx)(o.DismissableLayer,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":K(d.open),...c,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)($,{titleId:d.titleId}),(0,v.jsx)(W,{contentRef:f,descriptionId:d.descriptionId})]})]})}),U="DialogTitle",L=t.forwardRef((e,t)=>{let{__scopeDialog:r,...s}=e,i=w(U,r);return(0,v.jsx)(d.Primitive.h2,{id:i.titleId,...s,ref:t})});L.displayName=U;var q="DialogDescription",_=t.forwardRef((e,t)=>{let{__scopeDialog:r,...s}=e,i=w(q,r);return(0,v.jsx)(d.Primitive.p,{id:i.descriptionId,...s,ref:t})});_.displayName=q;var z="DialogClose",H=t.forwardRef((e,t)=>{let{__scopeDialog:s,...i}=e,n=w(z,s);return(0,v.jsx)(d.Primitive.button,{type:"button",...i,ref:t,onClick:(0,r.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});function K(e){return e?"open":"closed"}H.displayName=z;var B="DialogTitleWarning",[G,V]=(0,i.createContext)(B,{contentName:M,titleName:U,docsSlug:"dialog"}),$=({titleId:e})=>{let r=V(B),s=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
+
|
|
3
|
+
If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
+
|
|
5
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return t.useEffect(()=>{e&&(document.getElementById(e)||console.error(s))},[s,e]),null},W=({contentRef:e,descriptionId:r})=>{let s=V("DialogDescriptionWarning"),i=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${s.contentName}}.`;return t.useEffect(()=>{let t=e.current?.getAttribute("aria-describedby");r&&t&&(document.getElementById(r)||console.warn(i))},[i,e,r]),null};e.s(["Close",0,H,"Content",0,N,"Description",0,_,"Dialog",0,R,"DialogClose",0,H,"DialogContent",0,N,"DialogDescription",0,_,"DialogOverlay",0,O,"DialogPortal",0,D,"DialogTitle",0,L,"DialogTrigger",0,S,"Overlay",0,O,"Portal",0,D,"Root",0,R,"Title",0,L,"Trigger",0,S,"WarningProvider",0,G,"createDialogScope",0,b])},64541,e=>{"use strict";var t=e.i(94983);e.s(["Dialog",0,t])},23835,e=>{"use strict";let t=(0,e.i(54864).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",0,t])},73423,e=>{"use strict";var t=e.i(23835);e.s(["CircleAlert",()=>t.default])},79561,67299,e=>{"use strict";let t=(0,e.i(54864).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["default",0,t],67299),e.s(["LoaderCircle",0,t],79561)},2287,63352,e=>{"use strict";var t=e.i(96871),r=e.i(16539),s=e.i(64541),i=e.i(93026);e.s(["X",()=>i.default],63352);var i=i,n=e.i(31777);let a=s.Dialog.Root,o=s.Dialog.Trigger,l=s.Dialog.Portal,u=s.Dialog.Close,c=r.forwardRef(({className:e,onClick:r,...i},a)=>(0,t.jsx)(s.Dialog.Overlay,{ref:a,className:(0,n.cn)("data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 fixed inset-0 z-50 bg-black/80 duration-150",e),onClick:e=>{e.stopPropagation(),r?.(e)},...i}));c.displayName=s.Dialog.Overlay.displayName;let d=r.forwardRef(({className:e,children:r,...a},o)=>(0,t.jsxs)(l,{children:[(0,t.jsx)(c,{}),(0,t.jsxs)(s.Dialog.Content,{ref:o,className:(0,n.cn)("bg-background data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-150 sm:rounded-lg",e),...a,children:[r,(0,t.jsxs)(s.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 cursor-pointer rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[(0,t.jsx)(i.default,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));d.displayName=s.Dialog.Content.displayName;let h=({className:e,...r})=>(0,t.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-start",e),...r});h.displayName="DialogHeader";let f=({className:e,...r})=>(0,t.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});f.displayName="DialogFooter";let p=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(s.Dialog.Title,{ref:i,className:(0,n.cn)("text-lg leading-none font-semibold tracking-tight",e),...r}));p.displayName=s.Dialog.Title.displayName;let m=r.forwardRef(({className:e,...r},i)=>(0,t.jsx)(s.Dialog.Description,{ref:i,className:(0,n.cn)("text-muted-foreground text-sm",e),...r}));m.displayName=s.Dialog.Description.displayName,e.s(["Dialog",0,a,"DialogClose",0,u,"DialogContent",0,d,"DialogDescription",0,m,"DialogFooter",0,f,"DialogHeader",0,h,"DialogTitle",0,p,"DialogTrigger",0,o],2287)},8361,73709,18354,e=>{"use strict";var t=e.i(66305),r=e.i(16539);let s="shipit-ai-sound-enabled",i="shipit-ai:sound-toggle";function n(){let[e,t]=(0,r.useState)(!0);(0,r.useEffect)(()=>{"false"===localStorage.getItem(s)&&t(!1);let e=e=>{t(e.detail)};return window.addEventListener(i,e),()=>window.removeEventListener(i,e)},[]);let n=(0,r.useCallback)(()=>{let r=!e;localStorage.setItem(s,String(r)),t(r),window.dispatchEvent(new CustomEvent(i,{detail:r}))},[e]);return{enabled:e,toggle:n}}e.s(["useSoundEnabled",0,n],73709);let a=new Map,o={navigate:{sound:"tap_01",volume:.2},"menu-item":{sound:"tap_01",volume:.2},select:{sound:"select",volume:.3},"toggle-on":{sound:"toggle_on",volume:.3},"toggle-off":{sound:"toggle_off",volume:.3},click:{sound:"tap_01",volume:.3},cancel:{sound:"transition_down",volume:.3},expand:{sound:"tap_01",volume:.2},collapse:{sound:"tap_01",volume:.2},"menu-open":{sound:"select",volume:.3},copy:{sound:"select",volume:.3},"drawer-open":{sound:"transition_up",volume:.4},"drawer-close":{sound:"transition_down",volume:.4},submit:{sound:"button",volume:.4},approve:{sound:"celebration",volume:.5},reject:{sound:"caution",volume:.5},create:{sound:"transition_up",volume:.5},delete:{sound:"transition_down",volume:.5},"notification-success":{sound:"celebration",volume:.5},"notification-error":{sound:"caution",volume:.5},"notification-warning":{sound:"notification",volume:.5},"notification-info":{sound:"button",volume:.5}};e.s(["useSoundAction",0,function(e){let{sound:t,volume:s}=o[e];return function(e,t={}){let{volume:s=1,loop:i=!1}=t,{enabled:o}=n(),l=(0,r.useRef)(null),u=(0,r.useRef)(!1);return(0,r.useEffect)(()=>{let t,r=((t=a.get(e))||((t=new Audio(`/sounds/${e}.wav`)).preload="auto",a.set(e,t)),t);return r.loop=i,r.volume=Math.max(0,Math.min(1,s)),r.addEventListener("ended",()=>{u.current=!1}),l.current=r,()=>{r.pause(),l.current=null,u.current=!1}},[e,i,s]),{play:(0,r.useCallback)(()=>{if(!o)return;let e=l.current;e&&(e.currentTime=0,e.play()?.catch(e=>{}),u.current=!0)},[o,e]),stop:(0,r.useCallback)(()=>{let e=l.current;e&&(e.pause(),e.currentTime=0,u.current=!1)},[]),isPlaying:u.current}}(t,{volume:s})}],8361);let l=!!t.default.env.NEXT_PUBLIC_DEBUG,u=()=>void 0;e.s(["createLogger",0,function(e){return{info:l?(...t)=>console.info(e,...t):u,debug:l?(...t)=>console.debug(e,...t):u,warn:(...t)=>console.warn(e,...t),error:(...t)=>console.error(e,...t)}}],18354)},75921,e=>{"use strict";var t=e.i(96871),r=e.i(16539);let s=(0,r.createContext)({skills:!1,envDeploy:!0,debug:!1,githubImport:!1,adoptBranch:!1,gitRebaseSync:!1,reactFileManager:!1,plugins:!1});e.s(["FeatureFlagsProvider",0,function({children:e,flags:r}){return(0,t.jsx)(s.Provider,{value:r,children:e})},"useFeatureFlags",0,function(){return(0,r.useContext)(s)}])},85149,15786,e=>{"use strict";let t=(0,e.i(54864).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",0,t],15786),e.s(["Check",0,t],85149)},33109,(e,t,r)=>{t.exports=e.r(42758)},88641,e=>{"use strict";let t=(0,e.i(54864).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",0,t])},14771,87203,5756,69600,19807,98875,e=>{"use strict";var t=e.i(54864);let r=(0,t.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",0,r],14771);var s=e.i(67299);e.s(["LoaderCircleIcon",()=>s.default],87203);var i=e.i(88641);e.s(["DownloadIcon",()=>i.default],5756);let n=(0,t.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",0,n],69600);var a=e.i(87312);e.s(["VisuallyHidden",0,a],19807);let o=(0,t.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",0,o],98875)},99706,e=>{"use strict";let t=(0,e.i(54864).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",0,t])},50032,86254,e=>{"use strict";var t=e.i(96871),r=e.i(63352),s=e.i(87203),i=e.i(5756),n=e.i(69600),a=e.i(31777),o=e.i(2287),l=e.i(48306),u=e.i(2828),c=e.i(19807),d=e.i(98875),h=e.i(99706),h=h;let f=(0,e.i(54864).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 p=e.i(9063),p=p;e.i(35364);let m=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),v=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function y(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 g=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function b(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}e.s(["AttachmentChip",0,function({name:e,size:x,mimeType:w,path:R,onRemove:C,loading:S=!1,disabled:j=!1,notes:k,onNotesChange:T}){let D,I,O=(D=e.lastIndexOf("."))>=0?e.slice(D).toLowerCase():"",E=m.has(O)?f:".pdf"===O?h.default:v.has(O)?p.default:d.FileIcon,F=".pdf"===O?"bg-red-50 text-red-600":m.has(O)?"bg-blue-50 text-blue-600":v.has(O)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",M=(I=e.lastIndexOf("."))>=0&&g.has(e.slice(I).toLowerCase());if(S)return(0,t.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,t.jsx)(s.LoaderCircleIcon,{className:"text-muted-foreground h-5 w-5 animate-spin"})});if(M){let s=(0,t.jsxs)("button",{type:"button",className:"relative block cursor-pointer rounded-md",children:[(0,t.jsx)("img",{src:b(R,w),alt:e,title:e,className:"h-12 w-12 rounded-md border object-cover transition-opacity hover:opacity-80"}),k?(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:s})}),!j&&(0,t.jsx)("button",{type:"button",onClick:C,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)(r.X,{className:"h-3 w-3"})})]}),k?(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:k})}):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:b(R,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:y(x)})]}),(0,t.jsx)("a",{href:b(R,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"})})]}),T?(0,t.jsx)(l.Textarea,{placeholder:"Add notes about this image…",value:k??"",onChange:e=>T(e.target.value),rows:2,className:"resize-none text-sm","aria-label":"Image notes"}):k?(0,t.jsx)("p",{className:"text-muted-foreground text-sm",children:k}):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)(E,{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:y(x)}),!j&&(0,t.jsx)("button",{type:"button",onClick:C,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)(r.X,{className:"h-3 w-3"})})]})}],86254),e.s([],50032)},67088,e=>{"use strict";let t=(0,e.i(54864).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",0,t],67088)},95892,e=>{"use strict";let t=(0,e.i(54864).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",0,t],95892)},34383,e=>{"use strict";let t=(0,e.i(54864).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",0,t],34383)},31074,37655,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",0,t],37655);var r=new class extends t{#t;#r;#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.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#t?this.#t:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",0,r],31074)},86954,64683,e=>{"use strict";e.i(66305);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#i=t;#n=!1;setTimeoutProvider(e){this.#i=e}setTimeout(e,t){return this.#i.setTimeout(e,t)}clearTimeout(e){this.#i.clearTimeout(e)}setInterval(e,t){return this.#i.setInterval(e,t)}clearInterval(e){this.#i.clearInterval(e)}};e.s(["systemSetTimeoutZero",0,function(e){setTimeout(e,0)},"timeoutManager",0,r],64683);var s="u"<typeof window||"Deno"in globalThis;function i(e,t){return(t?.queryKeyHashFn||n)(e)}function n(e){return JSON.stringify(e,(e,t)=>u(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function a(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>a(e[r],t[r]))}var o=Object.prototype.hasOwnProperty;function l(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function u(e){if(!c(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!c(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function c(e){return"[object Object]"===Object.prototype.toString.call(e)}var d=Symbol();e.s(["addConsumeAwareSignal",0,function(e,t,r){let s,i=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),i||(i=!0,s.aborted?r():s.addEventListener("abort",r,{once:!0})),s)}),e},"addToEnd",0,function(e,t,r=0){let s=[...e,t];return r&&s.length>r?s.slice(1):s},"addToStart",0,function(e,t,r=0){let s=[t,...e];return r&&s.length>r?s.slice(0,-1):s},"ensureQueryFn",0,function(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==d?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))},"functionalUpdate",0,function(e,t){return"function"==typeof e?e(t):e},"hashKey",0,n,"hashQueryKeyByOptions",0,i,"isServer",0,s,"isValidTimeout",0,function(e){return"number"==typeof e&&e>=0&&e!==1/0},"matchMutation",0,function(e,t){let{exact:r,status:s,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(n(t.options.mutationKey)!==n(o))return!1}else if(!a(t.options.mutationKey,o))return!1}return(!s||t.state.status===s)&&(!i||!!i(t))},"matchQuery",0,function(e,t){let{type:r="all",exact:s,fetchStatus:n,predicate:o,queryKey:l,stale:u}=e;if(l){if(s){if(t.queryHash!==i(l,t.options))return!1}else if(!a(t.queryKey,l))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof u||t.isStale()===u)&&(!n||n===t.state.fetchStatus)&&(!o||!!o(t))},"noop",0,function(){},"partialMatchKey",0,a,"replaceData",0,function(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,s=0){if(t===r)return t;if(s>500)return r;let i=l(t)&&l(r);if(!i&&!(u(t)&&u(r)))return r;let n=(i?t:Object.keys(t)).length,a=i?r:Object.keys(r),c=a.length,d=i?Array(c):{},h=0;for(let l=0;l<c;l++){let u=i?l:a[l],c=t[u],f=r[u];if(c===f){d[u]=c,(i?l<n:o.call(t,u))&&h++;continue}if(null===c||null===f||"object"!=typeof c||"object"!=typeof f){d[u]=f;continue}let p=e(c,f,s+1);d[u]=p,p===c&&h++}return n===c&&h===n?t:d}(e,t):t},"resolveEnabled",0,function(e,t){return"function"==typeof e?e(t):e},"resolveStaleTime",0,function(e,t){return"function"==typeof e?e(t):e},"shallowEqualObjects",0,function(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0},"shouldThrowError",0,function(e,t){return"function"==typeof e?e(...t):!!e},"skipToken",0,d,"sleep",0,function(e){return new Promise(t=>{r.setTimeout(t,e)})},"timeUntilStale",0,function(e,t){return Math.max(e+(t||0)-Date.now(),0)}],86954)},49988,e=>{"use strict";let t;var r=e.i(86954),s=(t=()=>r.isServer,{isServer:()=>t(),setIsServer(e){t=e}});e.s(["environmentManager",0,s])},31541,e=>{"use strict";let t,r,s,i,n,a;var o=e.i(64683).systemSetTimeoutZero,l=(t=[],r=0,s=e=>{e()},i=e=>{e()},n=o,{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{i(()=>{e.forEach(e=>{s(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{s(e)})},setNotifyFunction:e=>{s=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{n=e}});e.s(["notifyManager",0,l])},27502,44398,e=>{"use strict";var t=e.i(37655),r=new class extends t.Subscribable{#a=!0;#r;#s;constructor(){super(),this.#s=e=>{if("u">typeof window&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#r||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#r?.(),this.#r=void 0)}setEventListener(e){this.#s=e,this.#r?.(),this.#r=e(this.setOnline.bind(this))}setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}};e.s(["onlineManager",0,r],27502),e.i(86954),e.s(["pendingThenable",0,function(){let e,t,r=new Promise((r,s)=>{e=r,t=s});function s(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},r.reject=e=>{s({status:"rejected",reason:e}),t(e)},r}],44398)},26799,28547,73066,95486,e=>{"use strict";e.i(66305);var t=e.i(86954),r=e.i(31541),s=e.i(31074),i=e.i(27502),n=e.i(44398),a=e.i(49988);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 r,c=!1,d=0,h=(0,n.pendingThenable)(),f=()=>s.focusManager.isFocused()&&("always"===e.networkMode||i.onlineManager.isOnline())&&e.canRun(),p=()=>l(e.networkMode)&&e.canRun(),m=e=>{"pending"===h.status&&(r?.(),h.resolve(e))},v=e=>{"pending"===h.status&&(r?.(),h.reject(e))},y=()=>new Promise(t=>{r=e=>{("pending"!==h.status||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===h.status&&e.onContinue?.()}),g=()=>{let r;if("pending"!==h.status)return;let s=0===d?e.initialPromise:void 0;try{r=s??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if("pending"!==h.status)return;let s=e.retry??3*!a.environmentManager.isServer(),i=e.retryDelay??o,n="function"==typeof i?i(d,r):i,l=!0===s||"number"==typeof s&&d<s||"function"==typeof s&&s(d,r);c||!l?v(r):(d++,e.onFail?.(d,r),(0,t.sleep)(n).then(()=>f()?void 0:y()).then(()=>{c?v(r):g()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let r=new u(t);v(r),e.onCancel?.(r)}},continue:()=>(r?.(),h),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:p,start:()=>(p()?g():y().then(g),h)}}e.s(["CancelledError",0,u,"canFetch",0,l,"createRetryer",0,c],28547);var d=e.i(64683),h=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#o=d.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(a.environmentManager.isServer()?1/0:3e5))}clearGcTimeout(){this.#o&&(d.timeoutManager.clearTimeout(this.#o),this.#o=void 0)}};e.s(["Removable",0,h],73066);var f=class extends h{#l;#u;#c;#d;#h;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#d=e.client,this.#c=this.#d.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#l=v(this.options),this.state=e.state??this.#l,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#f,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=v(this.options);void 0!==e.data&&(this.setState(m(e.data,e.dataUpdatedAt)),this.#l=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,r){let s=(0,t.replaceData)(this.state.data,e,this.options);return this.#m({data:s,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),s}setState(e,t){this.#m({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#h?.promise;return this.#h?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#l}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.#c.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.#v()?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#v(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,r){let s;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&r?.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,s=(0,t.ensureQueryFn)(this.options,r),i=(n(e={client:this.#d,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(s,i,this):s(i)},o=(n(s={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#d,state:this.state,fetchFn:a}),s);this.options.behavior?.onFetch(o,this),this.#u=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#m({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:r?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof u&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),i.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({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.#c.config.onSuccess?.(e,this),this.#c.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.#m({type:"error",error:e}),this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#m(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,...p(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...m(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?r:void 0,r;case"error":let s=e.error;return{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function p(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function m(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function v(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",0,f,"fetchState",0,p],26799);var y=e.i(16539),g=e.i(96871),b=y.createContext(void 0);e.s(["QueryClientProvider",0,({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,g.jsx)(b.Provider,{value:e,children:t})),"useQueryClient",0,e=>{let t=y.useContext(b);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t}],95486)},14260,e=>{"use strict";let t;var r=e.i(31074),s=e.i(49988),i=e.i(31541),n=e.i(26799),a=e.i(37655),o=e.i(44398),l=e.i(86954),u=e.i(64683),c=class extends a.Subscribable{constructor(e,t){super(),this.options=t,this.#d=e,this.#y=null,this.#g=(0,o.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#d;#b=void 0;#x=void 0;#w=void 0;#R;#C;#g;#y;#S;#j;#k;#T;#D;#I;#O=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),d(this.#b,this.options)?this.#E():this.updateResult(),this.#F())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return h(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return h(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#M(),this.#N(),this.#b.removeObserver(this)}setOptions(e){let t=this.options,r=this.#b;if(this.options=this.#d.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.#P(),this.#b.setOptions(this.options),t._defaulted&&!(0,l.shallowEqualObjects)(this.options,t)&&this.#d.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});let s=this.hasListeners();s&&f(this.#b,r,this.options,t)&&this.#E(),this.updateResult(),s&&(this.#b!==r||(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.#A();let i=this.#Q();s&&(this.#b!==r||(0,l.resolveEnabled)(this.options.enabled,this.#b)!==(0,l.resolveEnabled)(t.enabled,this.#b)||i!==this.#I)&&this.#U(i)}getOptimisticResult(e){var t,r;let s=this.#d.getQueryCache().build(this.#d,e),i=this.createResult(s,e);return t=this,r=i,(0,l.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#w=i,this.#C=this.options,this.#R=this.#b.state),i}getCurrentResult(){return this.#w}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#g.status||this.#g.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#O.add(e)}getCurrentQuery(){return this.#b}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#d.defaultQueryOptions(e),r=this.#d.getQueryCache().build(this.#d,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#E({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#w))}#E(e){this.#P();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(l.noop)),t}#A(){this.#M();let e=(0,l.resolveStaleTime)(this.options.staleTime,this.#b);if(s.environmentManager.isServer()||this.#w.isStale||!(0,l.isValidTimeout)(e))return;let t=(0,l.timeUntilStale)(this.#w.dataUpdatedAt,e);this.#T=u.timeoutManager.setTimeout(()=>{this.#w.isStale||this.updateResult()},t+1)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#U(e){this.#N(),this.#I=e,!s.environmentManager.isServer()&&!1!==(0,l.resolveEnabled)(this.options.enabled,this.#b)&&(0,l.isValidTimeout)(this.#I)&&0!==this.#I&&(this.#D=u.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||r.focusManager.isFocused())&&this.#E()},this.#I))}#F(){this.#A(),this.#U(this.#Q())}#M(){this.#T&&(u.timeoutManager.clearTimeout(this.#T),this.#T=void 0)}#N(){this.#D&&(u.timeoutManager.clearInterval(this.#D),this.#D=void 0)}createResult(e,t){let r,s=this.#b,i=this.options,a=this.#w,u=this.#R,c=this.#C,h=e!==s?e.state:this.#x,{state:m}=e,v={...m},y=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&d(e,t),o=r&&f(e,s,t,i);(a||o)&&(v={...v,...(0,n.fetchState)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(v.fetchStatus="idle")}let{error:g,errorUpdatedAt:b,status:x}=v;r=v.data;let w=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===x){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,w=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#k?.state.data,this.#k):t.placeholderData,void 0!==e&&(x="success",r=(0,l.replaceData)(a?.data,e,t),y=!0)}if(t.select&&void 0!==r&&!w)if(a&&r===u?.data&&t.select===this.#S)r=this.#j;else try{this.#S=t.select,r=t.select(r),r=(0,l.replaceData)(a?.data,r,t),this.#j=r,this.#y=null}catch(e){this.#y=e}this.#y&&(g=this.#y,r=this.#j,b=Date.now(),x="error");let R="fetching"===v.fetchStatus,C="pending"===x,S="error"===x,j=C&&R,k=void 0!==r,T={status:x,fetchStatus:v.fetchStatus,isPending:C,isSuccess:"success"===x,isError:S,isInitialLoading:j,isLoading:j,data:r,dataUpdatedAt:v.dataUpdatedAt,error:g,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:v.dataUpdateCount>h.dataUpdateCount||v.errorUpdateCount>h.errorUpdateCount,isFetching:R,isRefetching:R&&!C,isLoadingError:S&&!k,isPaused:"paused"===v.fetchStatus,isPlaceholderData:y,isRefetchError:S&&k,isStale:p(e,t),refetch:this.refetch,promise:this.#g,isEnabled:!1!==(0,l.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==T.data,r="error"===T.status&&!t,i=e=>{r?e.reject(T.error):t&&e.resolve(T.data)},n=()=>{i(this.#g=T.promise=(0,o.pendingThenable)())},a=this.#g;switch(a.status){case"pending":e.queryHash===s.queryHash&&i(a);break;case"fulfilled":(r||T.data!==a.value)&&n();break;case"rejected":r&&T.error===a.reason||n()}}return T}updateResult(){let e=this.#w,t=this.createResult(this.#b,this.options);if(this.#R=this.#b.state,this.#C=this.options,void 0!==this.#R.data&&(this.#k=this.#b),(0,l.shallowEqualObjects)(t,e))return;this.#w=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#O.size)return!0;let s=new Set(r??this.#O);return this.options.throwOnError&&s.add("error"),Object.keys(this.#w).some(t=>this.#w[t]!==e[t]&&s.has(t))};this.#L({listeners:r()})}#P(){let e=this.#d.getQueryCache().build(this.#d,this.options);if(e===this.#b)return;let t=this.#b;this.#b=e,this.#x=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#F()}#L(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#w)}),this.#d.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function d(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&&h(e,t,t.refetchOnMount)}function h(e,t,r){if(!1!==(0,l.resolveEnabled)(t.enabled,e)&&"static"!==(0,l.resolveStaleTime)(t.staleTime,e)){let s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&p(e,t)}return!1}function f(e,t,r,s){return(e!==t||!1===(0,l.resolveEnabled)(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&p(e,r)}function p(e,t){return!1!==(0,l.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,l.resolveStaleTime)(t.staleTime,e))}e.i(66305);var m=e.i(16539),v=e.i(95486);e.i(96871);var y=m.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),g=m.createContext(!1);g.Provider;var b=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});e.s(["useQuery",0,function(e,t){return function(e,t,r){let n,a=m.useContext(g),o=m.useContext(y),u=(0,v.useQueryClient)(r),c=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(c);let d=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?(...r)=>e(t(...r)):e(t),"number"==typeof c.gcTime&&(c.gcTime=Math.max(c.gcTime,1e3))}n=d?.state.error&&"function"==typeof c.throwOnError?(0,l.shouldThrowError)(c.throwOnError,[d.state.error,d]):c.throwOnError,(c.suspense||c.experimental_prefetchInRender||n)&&!o.isReset()&&(c.retryOnMount=!1),m.useEffect(()=>{o.clearReset()},[o]);let h=!u.getQueryCache().get(c.queryHash),[f]=m.useState(()=>new t(u,c)),p=f.getOptimisticResult(c),x=!a&&!1!==e.subscribed;if(m.useSyncExternalStore(m.useCallback(e=>{let t=x?f.subscribe(i.notifyManager.batchCalls(e)):l.noop;return f.updateResult(),t},[f,x]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),m.useEffect(()=>{f.setOptions(c)},[c,f]),c?.suspense&&p.isPending)throw b(c,f,o);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&void 0===e.data||(0,l.shouldThrowError)(r,[e.error,s])))({result:p,errorResetBoundary:o,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw p.error;if(u.getDefaultOptions().queries?._experimental_afterQuery?.(c,p),c.experimental_prefetchInRender&&!s.environmentManager.isServer()&&p.isLoading&&p.isFetching&&!a){let e=h?b(c,f,o):d?.promise;e?.catch(l.noop).finally(()=>{f.updateResult()})}return c.notifyOnChangeProps?p:f.trackResult(p)}(e,c,t)}],14260)},85202,e=>{"use strict";let t=(0,e.i(54864).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",0,t],85202)},23325,e=>{"use strict";let t=(0,e.i(54864).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",0,t],23325)}]);
|