@shepai/cli 1.102.0 → 1.103.0-pr306.386dbd0
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/README.md +5 -4
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +2 -1
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/ci-watch-fix-loop.js +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +2 -2
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.js +1 -3
- package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts +19 -0
- package/dist/src/presentation/web/app/actions/check-agent-auth.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/check-agent-auth.js +178 -0
- package/dist/src/presentation/web/components/common/feature-node/feature-node.js +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.d.ts +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.js +46 -8
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +28 -5
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +0 -2
- package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.js +26 -148
- package/dist/src/presentation/web/components/features/features-canvas/features-canvas.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/features-canvas/features-canvas.js +29 -8
- package/dist/src/presentation/web/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/presentation/web/components/ui/dialog.js +2 -2
- package/dist/src/presentation/web/hooks/use-graph-state.d.ts.map +1 -1
- package/dist/src/presentation/web/hooks/use-graph-state.js +26 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- 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/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +48 -48
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +58 -58
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +58 -58
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +44 -44
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +48 -48
- package/web/.next/server/app/(dashboard)/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +58 -58
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +58 -58
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +44 -44
- package/web/.next/server/app/(dashboard)/page.js +1 -1
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +44 -44
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- 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 +6 -6
- 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 +6 -6
- 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 +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__f47bb8a5._.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_2eacac96.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_2eacac96.js.map +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_46d6bf1b.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_46d6bf1b.js.map +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_54b1e179.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_54b1e179.js.map +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_6c70ecca.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_6c70ecca.js.map +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_c29a2302.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_c29a2302.js.map +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_c9978986.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_c9978986.js.map +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_ce6dae5d.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_ce6dae5d.js.map +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_d1fd387b.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_d1fd387b.js.map +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_d82f78f0.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_esm_build_templates_app-page_d82f78f0.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js +3 -0
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_d0119342._.js.map +1 -0
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_rocket_1575cd4d.js +3 -0
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_rocket_1575cd4d.js.map +1 -0
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_0a7546ed.js +3 -0
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_0a7546ed.js.map +1 -0
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_978cbb4c.js +3 -0
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_978cbb4c.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0880ff0e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0880ff0e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__23b5ca2c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__23b5ca2c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__24dd0927._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__ec9a1550._.js → [root-of-the-server]__51fc98b0._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__0b6bb4ae._.js.map → [root-of-the-server]__51fc98b0._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__52485955._.js +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__f8932d55._.js → [root-of-the-server]__57f37786._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__ec9a1550._.js.map → [root-of-the-server]__57f37786._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5edfc56b._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5edfc56b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6eb2a2b0._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6eb2a2b0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__0b6bb4ae._.js → [root-of-the-server]__708dcad1._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__f8932d55._.js.map → [root-of-the-server]__708dcad1._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__845a9d2a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__89e8a5cc._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c88ef55._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c88ef55._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__6a82177d._.js → [root-of-the-server]__8e002910._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__6a82177d._.js.map → [root-of-the-server]__8e002910._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__94128fa9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__94128fa9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9bfb8e7c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9bfb8e7c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c9777776._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d91fdd51._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d91fdd51._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_d2a282c5._.js → _15b363de._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_d2a282c5._.js.map → _15b363de._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_16235e5e._.js +1 -1
- package/web/.next/server/chunks/ssr/_16235e5e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_273d4632._.js +3 -0
- package/web/.next/server/chunks/ssr/_273d4632._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_507aa36a._.js +3 -0
- package/web/.next/server/chunks/ssr/_507aa36a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_6887cba3._.js +1 -1
- package/web/.next/server/chunks/ssr/_6887cba3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_9d0908a8._.js → _86635d23._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_9d0908a8._.js.map → _86635d23._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8eeee4db._.js +1 -1
- package/web/.next/server/chunks/ssr/_8eeee4db._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_ed11dcd6._.js +1 -1
- package/web/.next/server/chunks/ssr/_ed11dcd6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f4d222d6._.js +1 -1
- package/web/.next/server/chunks/ssr/_f4d222d6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f5316e67._.js +3 -0
- package/web/.next/server/chunks/ssr/_f5316e67._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{src_presentation_web_3c53a23d._.js → src_presentation_web_7275ce5d._.js} +3 -3
- package/web/.next/server/chunks/ssr/{src_presentation_web_3c53a23d._.js.map → src_presentation_web_7275ce5d._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{src_presentation_web_ec8c7a4f._.js → src_presentation_web_758dfa10._.js} +3 -3
- package/web/.next/server/chunks/ssr/{src_presentation_web_ec8c7a4f._.js.map → src_presentation_web_758dfa10._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_84803221.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_84803221.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_3d0aa70c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_3d0aa70c._.js.map +1 -1
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +273 -273
- package/web/.next/static/chunks/07b853e29af1e5f2.js +1 -0
- package/web/.next/static/chunks/{bfee4f72255f4654.js → 1b64d539e3301b42.js} +2 -2
- package/web/.next/static/chunks/2a99432c60666d13.js +1 -0
- package/web/.next/static/chunks/3a806cf059241bc9.js +1 -0
- package/web/.next/static/chunks/561c934a22a57935.js +1 -0
- package/web/.next/static/chunks/{0ecdad7af8d93397.js → 56487ce1ff5fe4b9.js} +1 -1
- package/web/.next/static/chunks/{d3c337aa9acbfd96.js → 80648e7478cfaf5c.js} +2 -2
- package/web/.next/static/chunks/93058c22968e2fef.css +1 -0
- package/web/.next/static/chunks/{d994924b9107401b.js → b017804cd070a36b.js} +1 -1
- package/web/.next/static/chunks/b9baf0e3bc5777f0.js +1 -0
- package/web/.next/static/chunks/c1a9d9c698c60cd6.js +1 -0
- package/web/.next/static/chunks/da7d0e6baf7863fd.js +1 -0
- package/web/.next/static/chunks/f3138f795d0f0618.js +1 -0
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_6ba7eb21._.js +0 -3
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_6ba7eb21._.js.map +0 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_c757eb00.js +0 -3
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_c757eb00.js.map +0 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_7eb49631.js +0 -3
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_7eb49631.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7b49fcb3._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7b49fcb3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_60e203af._.js +0 -3
- package/web/.next/server/chunks/ssr/_60e203af._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_6a83bd29._.js +0 -3
- package/web/.next/server/chunks/ssr/_6a83bd29._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_7d954884._.js +0 -3
- package/web/.next/server/chunks/ssr/_7d954884._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_befd865a.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_befd865a.js.map +0 -1
- package/web/.next/static/chunks/0a370e5d6fd1bb24.js +0 -1
- package/web/.next/static/chunks/2d3dc372f05429dd.css +0 -1
- package/web/.next/static/chunks/3092c9611e2dc032.js +0 -1
- package/web/.next/static/chunks/30dc64780817371a.js +0 -1
- package/web/.next/static/chunks/ac12b8d2bd59675e.js +0 -1
- package/web/.next/static/chunks/b272ac93b52dceeb.js +0 -1
- package/web/.next/static/chunks/d61cbdfc00003e44.js +0 -1
- package/web/.next/static/chunks/e248c85913405af4.js +0 -1
- package/web/.next/static/chunks/e24a024affc634d9.js +0 -1
- /package/web/.next/static/{_-n7Ii9h0sTnlzE_aFMQI → f-A8sWnRla5g7MiKDP0IX}/_buildManifest.js +0 -0
- /package/web/.next/static/{_-n7Ii9h0sTnlzE_aFMQI → f-A8sWnRla5g7MiKDP0IX}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{_-n7Ii9h0sTnlzE_aFMQI → f-A8sWnRla5g7MiKDP0IX}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17840,e=>{"use strict";var t=e.i(79054),r=e.i(31406),n=e.i(60112),o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),a=o((e,t)=>{var r=Object.defineProperty,n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),o=(e,t,n)=>{let o;return(o="symbol"!=typeof t?t+"":t)in e?r(e,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[o]=n},a=n((e,t)=>{function r(e,t){e[t]?e[t]++:e[t]=1}function n(e,t){--e[t]||delete e[t]}function a(e,t,r,n){var o=""+t,a=""+r;if(!e&&o>a){var s=o;o=a,a=s}return o+"\x01"+a+"\x01"+(void 0===n?"\0":n)}function s(e,t){return a(e,t.v,t.w,t.name)}t.exports=class{constructor(e){o(this,"_isDirected",!0),o(this,"_isMultigraph",!1),o(this,"_isCompound",!1),o(this,"_label"),o(this,"_defaultNodeLabelFn",()=>{}),o(this,"_defaultEdgeLabelFn",()=>{}),o(this,"_nodes",{}),o(this,"_in",{}),o(this,"_preds",{}),o(this,"_out",{}),o(this,"_sucs",{}),o(this,"_edgeObjs",{}),o(this,"_edgeLabels",{}),o(this,"_nodeCount",0),o(this,"_edgeCount",0),o(this,"_parent"),o(this,"_children"),e&&(this._isDirected=!Object.hasOwn(e,"directed")||e.directed,this._isMultigraph=!!Object.hasOwn(e,"multigraph")&&e.multigraph,this._isCompound=!!Object.hasOwn(e,"compound")&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children["\0"]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=e,"function"!=typeof e&&(this._defaultNodeLabelFn=()=>e),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._in[t]).length)}sinks(){var e=this;return this.nodes().filter(t=>0===Object.keys(e._out[t]).length)}setNodes(e,t){var r=arguments,n=this;return e.forEach(function(e){r.length>1?n.setNode(e,t):n.setNode(e)}),this}setNode(e,t){return Object.hasOwn(this._nodes,e)?arguments.length>1&&(this._nodes[e]=t):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]="\0",this._children[e]={},this._children["\0"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount),this}node(e){return this._nodes[e]}hasNode(e){return Object.hasOwn(this._nodes,e)}removeNode(e){var t=this;if(Object.hasOwn(this._nodes,e)){var r=e=>t.removeEdge(t._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(function(e){t.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(r),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(r),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error("Cannot set parent in a non-compound graph");if(void 0===t)t="\0";else{t+="";for(var r=t;void 0!==r;r=this.parent(r))if(r===e)throw Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}parent(e){if(this._isCompound){var t=this._parent[e];if("\0"!==t)return t}}children(e="\0"){if(this._isCompound){var t=this._children[e];if(t)return Object.keys(t)}else{if("\0"===e)return this.nodes();if(this.hasNode(e))return[]}}predecessors(e){var t=this._preds[e];if(t)return Object.keys(t)}successors(e){var t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){var t=this.predecessors(e);if(t){let n=new Set(t);for(var r of this.successors(e))n.add(r);return Array.from(n.values())}}isLeaf(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length}filterNodes(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var r=this;Object.entries(this._nodes).forEach(function([r,n]){e(r)&&t.setNode(r,n)}),Object.values(this._edgeObjs).forEach(function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,r.edge(e))});var n={};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,function e(o){var a=r.parent(o);return void 0===a||t.hasNode(a)?(n[o]=a,a):a in n?n[a]:e(a)}(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=e,"function"!=typeof e&&(this._defaultEdgeLabelFn=()=>e),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){var r=this,n=arguments;return e.reduce(function(e,o){return n.length>1?r.setEdge(e,o,t):r.setEdge(e,o),o}),this}setEdge(){var e,t,n,o,s=!1,i=arguments[0];"object"==typeof i&&null!==i&&"v"in i?(e=i.v,t=i.w,n=i.name,2==arguments.length&&(o=arguments[1],s=!0)):(e=i,t=arguments[1],n=arguments[3],arguments.length>2&&(o=arguments[2],s=!0)),e=""+e,t=""+t,void 0!==n&&(n=""+n);var d=a(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,d))return s&&(this._edgeLabels[d]=o),this;if(void 0!==n&&!this._isMultigraph)throw Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[d]=s?o:this._defaultEdgeLabelFn(e,t,n);var l=function(e,t,r,n){var o=""+t,a=""+r;if(!e&&o>a){var s=o;o=a,a=s}var i={v:o,w:a};return n&&(i.name=n),i}(this._isDirected,e,t,n);return e=l.v,t=l.w,Object.freeze(l),this._edgeObjs[d]=l,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][d]=l,this._out[e][d]=l,this._edgeCount++,this}edge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return this._edgeLabels[n]}edgeAsObj(){let e=this.edge(...arguments);return"object"!=typeof e?{label:e}:e}hasEdge(e,t,r){var n=1==arguments.length?s(this._isDirected,arguments[0]):a(this._isDirected,e,t,r);return Object.hasOwn(this._edgeLabels,n)}removeEdge(e,t,r){var o=1==arguments.length?s(this._isDirected,arguments[0]):a(this._isDirected,e,t,r),i=this._edgeObjs[o];return i&&(e=i.v,t=i.w,delete this._edgeLabels[o],delete this._edgeObjs[o],n(this._preds[t],e),n(this._sucs[e],t),delete this._in[t][o],delete this._out[e][o],this._edgeCount--),this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}filterEdges(e,t,r){if(e){var n=Object.values(e);return r?n.filter(function(e){return e.v===t&&e.w===r||e.v===r&&e.w===t}):n}}}}),s=n((e,t)=>{t.exports="3.0.2"}),i=n((e,t)=>{t.exports={Graph:a(),version:s()}}),d=n((e,t)=>{var r=a();t.exports={write:function(e){var t,r,n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:(t=e).nodes().map(function(e){var r=t.node(e),n=t.parent(e),o={v:e};return void 0!==r&&(o.value=r),void 0!==n&&(o.parent=n),o}),edges:(r=e).edges().map(function(e){var t=r.edge(e),n={v:e.v,w:e.w};return void 0!==e.name&&(n.name=e.name),void 0!==t&&(n.value=t),n})};return void 0!==e.graph()&&(n.value=structuredClone(e.graph())),n},read:function(e){var t=new r(e.options).setGraph(e.value);return e.nodes.forEach(function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}}),l=n((e,t)=>{t.exports=function(e,t,n,o){return function(e,t,r,n){var o={},a=!0,s=0,i=e.nodes(),d=function(e){var t=r(e);o[e.v].distance+t<o[e.w].distance&&(o[e.w]={distance:o[e.v].distance+t,predecessor:e.v},a=!0)},l=function(){i.forEach(function(e){n(e).forEach(function(t){var r=t.v===e?t.v:t.w,n=r===t.v?t.w:t.v;d({v:r,w:n})})})};i.forEach(function(e){o[e]={distance:e===t?0:1/0}});for(var c=i.length,u=1;u<c&&(a=!1,s++,l(),a);u++);if(s===c-1&&(a=!1,l(),a))throw Error("The graph contains a negative weight cycle");return o}(e,String(t),n||r,o||function(t){return e.outEdges(t)})};var r=()=>1}),c=n((e,t)=>{t.exports=function(e){var t,r={},n=[];return e.nodes().forEach(function(o){t=[],function n(o){Object.hasOwn(r,o)||(r[o]=!0,t.push(o),e.successors(o).forEach(n),e.predecessors(o).forEach(n))}(o),t.length&&n.push(t)}),n}}),u=n((e,t)=>{t.exports=class{constructor(){o(this,"_arr",[]),o(this,"_keyIndices",{})}size(){return this._arr.length}keys(){return this._arr.map(function(e){return e.key})}has(e){return Object.hasOwn(this._keyIndices,e)}priority(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority}min(){if(0===this.size())throw Error("Queue underflow");return this._arr[0].key}add(e,t){var r=this._keyIndices;if(!Object.hasOwn(r,e=String(e))){var n=this._arr,o=n.length;return r[e]=o,n.push({key:e,priority:t}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){var r=this._keyIndices[e];if(t>this._arr[r].priority)throw Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[r].priority+" New: "+t);this._arr[r].priority=t,this._decrease(r)}_heapify(e){var t=this._arr,r=2*e,n=r+1,o=e;r<t.length&&(o=t[r].priority<t[o].priority?r:o,n<t.length&&(o=t[n].priority<t[o].priority?n:o),o!==e&&(this._swap(e,o),this._heapify(o)))}_decrease(e){for(var t,r=this._arr,n=r[e].priority;0!==e&&!(r[t=e>>1].priority<n);)this._swap(e,t),e=t}_swap(e,t){var r=this._arr,n=this._keyIndices,o=r[e],a=r[t];r[e]=a,r[t]=o,n[a.key]=e,n[o.key]=t}}}),h=n((e,t)=>{var r=u();t.exports=function(e,t,o,a){return function(e,t,n,o){var a,s,i={},d=new r,l=function(e){var t=e.v!==a?e.v:e.w,r=i[t],o=n(e),l=s.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);l<r.distance&&(r.distance=l,r.predecessor=a,d.decrease(t,l))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;i[e]={distance:r},d.add(e,r)});d.size()>0&&(s=i[a=d.removeMin()]).distance!==1/0;)o(a).forEach(l);return i}(e,String(t),o||n,a||function(t){return e.outEdges(t)})};var n=()=>1}),f=n((e,t)=>{var r=h();t.exports=function(e,t,n){return e.nodes().reduce(function(o,a){return o[a]=r(e,a,t,n),o},{})}}),p=n((e,t)=>{t.exports=function(e,t,r){if(void 0!==e[t].predecessor)throw Error("Invalid source vertex");if(void 0===e[r].predecessor&&r!==t)throw Error("Invalid destination vertex");return{weight:e[r].distance,path:function(e,t,r){for(var n=[],o=r;o!==t;)n.push(o),o=e[o].predecessor;return n.push(t),n.reverse()}(e,t,r)}}}),g=n((e,t)=>{t.exports=function(e){var t=0,r=[],n={},o=[];return e.nodes().forEach(function(a){Object.hasOwn(n,a)||function a(s){var i=n[s]={onStack:!0,lowlink:t,index:t++};if(r.push(s),e.successors(s).forEach(function(e){Object.hasOwn(n,e)?n[e].onStack&&(i.lowlink=Math.min(i.lowlink,n[e].index)):(a(e),i.lowlink=Math.min(i.lowlink,n[e].lowlink))}),i.lowlink===i.index){var d,l=[];do n[d=r.pop()].onStack=!1,l.push(d);while(s!==d)o.push(l)}}(a)}),o}}),m=n((e,t)=>{var r=g();t.exports=function(e){return r(e).filter(function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}}),v=n((e,t)=>{t.exports=function(e,t,n){var o,a,s,i,d;return o=e,a=t||r,s=n||function(t){return e.outEdges(t)},i={},(d=o.nodes()).forEach(function(e){i[e]={},i[e][e]={distance:0},d.forEach(function(t){e!==t&&(i[e][t]={distance:1/0})}),s(e).forEach(function(t){var r=t.v===e?t.w:t.v,n=a(t);i[e][r]={distance:n,predecessor:e}})}),d.forEach(function(e){var t=i[e];d.forEach(function(r){var n=i[r];d.forEach(function(r){var o=n[e],a=t[r],s=n[r],i=o.distance+a.distance;i<s.distance&&(s.distance=i,s.predecessor=a.predecessor)})})}),i};var r=()=>1}),x=n((e,t)=>{function r(e){var t={},r={},o=[];if(e.sinks().forEach(function a(s){if(Object.hasOwn(r,s))throw new n;Object.hasOwn(t,s)||(r[s]=!0,t[s]=!0,e.predecessors(s).forEach(a),delete r[s],o.push(s))}),Object.keys(t).length!==e.nodeCount())throw new n;return o}var n=class extends Error{constructor(){super(...arguments)}};t.exports=r,r.CycleException=n}),b=n((e,t)=>{var r=x();t.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}}),y=n((e,t)=>{t.exports=function(e,t,r,n,o){Array.isArray(t)||(t=[t]);var a=(e.isDirected()?e.successors:e.neighbors).bind(e),s={};return t.forEach(function(t){if(!e.hasNode(t))throw Error("Graph does not have node: "+t);o=function e(t,r,n,o,a,s,i){return Object.hasOwn(o,r)||(o[r]=!0,n||(i=s(i,r)),a(r).forEach(function(r){i=e(t,r,n,o,a,s,i)}),n&&(i=s(i,r))),i}(e,t,"post"===r,s,a,n,o)}),o}}),w=n((e,t)=>{var r=y();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),E=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"post")}}),k=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"pre")}}),j=n((e,t)=>{var r=a(),n=u();t.exports=function(e,t){var o,a=new r,s={},i=new n;function d(e){var r=e.v===o?e.w:e.v,n=i.priority(r);if(void 0!==n){var a=t(e);a<n&&(s[r]=o,i.decrease(r,a))}}if(0===e.nodeCount())return a;e.nodes().forEach(function(e){i.add(e,1/0),a.setNode(e)}),i.decrease(e.nodes()[0],0);for(var l=!1;i.size()>0;){if(Object.hasOwn(s,o=i.removeMin()))a.setEdge(o,s[o]);else{if(l)throw Error("Input graph is not connected: "+e);l=!0}e.nodeEdges(o).forEach(d)}return a}}),N=n((e,t)=>{var r=h(),n=l();t.exports=function(e,t,o,a){return function(e,t,o,a){if(void 0===o)return r(e,t,o,a);for(var s=!1,i=e.nodes(),d=0;d<i.length;d++){for(var l=a(i[d]),c=0;c<l.length;c++){var u=l[c],h=u.v===i[d]?u.v:u.w,f=h===u.v?u.w:u.v;0>o({v:h,w:f})&&(s=!0)}if(s)return n(e,t,o,a)}return r(e,t,o,a)}(e,t,o,a||function(t){return e.outEdges(t)})}}),C=n((e,t)=>{t.exports={bellmanFord:l(),components:c(),dijkstra:h(),dijkstraAll:f(),extractPath:p(),findCycles:m(),floydWarshall:v(),isAcyclic:b(),postorder:E(),preorder:k(),prim:j(),shortestPaths:N(),reduce:y(),tarjan:g(),topsort:x()}}),_=i();t.exports={Graph:_.Graph,json:d(),alg:C(),version:_.version}}),s=o((e,t)=>{function r(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function n(e,t){if("_next"!==e&&"_prev"!==e)return t}t.exports=class{constructor(){let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return r(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&r(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,r=t._prev;for(;r!==t;)e.push(JSON.stringify(r,n)),r=r._prev;return"["+e.join(", ")+"]"}}}),i=o((e,t)=>{var r=a().Graph,n=s();t.exports=function(e,t){var a,s;let l,c,u,h,f;if(1>=e.nodeCount())return[];let p=(a=e,s=t||o,l=new r,c=0,u=0,a.nodes().forEach(e=>{l.setNode(e,{v:e,in:0,out:0})}),a.edges().forEach(e=>{let t=l.edge(e.v,e.w)||0,r=s(e);l.setEdge(e.v,e.w,t+r),u=Math.max(u,l.node(e.v).out+=r),c=Math.max(c,l.node(e.w).in+=r)}),h=(function(e){let t=[];for(let r=0;r<e;r++)t.push(r);return t})(u+c+3).map(()=>new n),f=c+1,l.nodes().forEach(e=>{d(h,f,l.node(e))}),{graph:l,buckets:h,zeroIdx:f});return(function(e,t,r){let n=[],o=t[t.length-1],a=t[0],s;for(;e.nodeCount();){for(;s=a.dequeue();)i(e,t,r,s);for(;s=o.dequeue();)i(e,t,r,s);if(e.nodeCount()){for(let o=t.length-2;o>0;--o)if(s=t[o].dequeue()){n=n.concat(i(e,t,r,s,!0));break}}}return n})(p.graph,p.buckets,p.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w))};var o=()=>1;function i(e,t,r,n,o){let a=o?[]:void 0;return e.inEdges(n.v).forEach(n=>{let s=e.edge(n),i=e.node(n.v);o&&a.push({v:n.v,w:n.w}),i.out-=s,d(t,r,i)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),a=n.w,s=e.node(a);s.in-=o,d(t,r,s)}),e.removeNode(n.v),a}function d(e,t,r){r.out?r.in?e[r.out-r.in+t].enqueue(r):e[e.length-1].enqueue(r):e[0].enqueue(r)}}),d=o((e,t)=>{var r=a().Graph;function n(e,t,r,n){for(var o=n;e.hasNode(o);)o=d(n);return r.dummy=t,e.setNode(o,r),o}t.exports={addBorderNode:function(e,t,r,o){let a={width:0,height:0};return arguments.length>=4&&(a.rank=r,a.order=o),n(e,"border",a,t)},addDummyNode:n,applyWithChunking:o,asNonCompoundGraph:function(e){let t=new r({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(r=>{e.children(r).length||t.setNode(r,e.node(r))}),e.edges().forEach(r=>{t.setEdge(r,e.edge(r))}),t},buildLayerMatrix:function(e){let t=l(s(e)+1).map(()=>[]);return e.nodes().forEach(r=>{let n=e.node(r),o=n.rank;void 0!==o&&(t[o][n.order]=r)}),t},intersectRect:function(e,t){let r,n,o=e.x,a=e.y,s=t.x-o,i=t.y-a,d=e.width/2,l=e.height/2;if(!s&&!i)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(i)*d>Math.abs(s)*l?(i<0&&(l=-l),r=l*s/i,n=l):(s<0&&(d=-d),r=d,n=d*i/s),{x:o+r,y:a+n}},mapValues:function(e,t){let r=t;return"string"==typeof t&&(r=e=>e[t]),Object.entries(e).reduce((e,[t,n])=>(e[t]=r(n,t),e),{})},maxRank:s,normalizeRanks:function(e){let t=o(Math.min,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?Number.MAX_VALUE:r}));e.nodes().forEach(r=>{let n=e.node(r);Object.hasOwn(n,"rank")&&(n.rank-=t)})},notime:function(e,t){return t()},partition:function(e,t){let r={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?r.lhs.push(e):r.rhs.push(e)}),r},pick:function(e,t){let r={};for(let n of t)void 0!==e[n]&&(r[n]=e[n]);return r},predecessorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.inEdges(t).forEach(t=>{r[t.v]=(r[t.v]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},range:l,removeEmptyRanks:function(e){let t=o(Math.min,e.nodes().map(t=>e.node(t).rank).filter(e=>void 0!==e)),r=[];e.nodes().forEach(n=>{let o=e.node(n).rank-t;r[o]||(r[o]=[]),r[o].push(n)});let n=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,r)=>{void 0===t&&r%a!=0?--n:void 0!==t&&n&&t.forEach(t=>e.node(t).rank+=n)})},simplify:function(e){let t=new r().setGraph(e.graph());return e.nodes().forEach(r=>t.setNode(r,e.node(r))),e.edges().forEach(r=>{let n=t.edge(r.v,r.w)||{weight:0,minlen:1},o=e.edge(r);t.setEdge(r.v,r.w,{weight:n.weight+o.weight,minlen:Math.max(n.minlen,o.minlen)})}),t},successorWeights:function(e){let t=e.nodes().map(t=>{let r={};return e.outEdges(t).forEach(t=>{r[t.w]=(r[t.w]||0)+e.edge(t).weight}),r});return c(e.nodes(),t)},time:function(e,t){let r=Date.now();try{return t()}finally{console.log(e+" time: "+(Date.now()-r)+"ms")}},uniqueId:d,zipObject:c};function o(e,t){if(!(t.length>65535))return e.apply(null,t);{let r=function(e,t=65535){let r=[];for(let n=0;n<e.length;n+=t){let o=e.slice(n,n+t);r.push(o)}return r}(t);return e.apply(null,r.map(t=>e.apply(null,t)))}}function s(e){return o(Math.max,e.nodes().map(t=>{let r=e.node(t).rank;return void 0===r?5e-324:r}))}var i=0;function d(e){return e+""+ ++i}function l(e,t,r=1){null==t&&(t=e,e=0);let n=e=>e<t;r<0&&(n=e=>t<e);let o=[];for(let t=e;n(t);t+=r)o.push(t);return o}function c(e,t){return e.reduce((e,r,n)=>(e[r]=t[n],e),{})}}),l=o((e,t)=>{var r=i(),n=d().uniqueId;t.exports={run:function(e){var t,o;let a,s,i;("greedy"===e.graph().acyclicer?r(e,(t=e,e=>t.edge(e).weight)):(a=[],s={},i={},(o=e).nodes().forEach(function e(t){Object.hasOwn(i,t)||(i[t]=!0,s[t]=!0,o.outEdges(t).forEach(t=>{Object.hasOwn(s,t.w)?a.push(t):e(t.w)}),delete s[t])}),a)).forEach(t=>{let r=e.edge(t);e.removeEdge(t),r.forwardName=t.name,r.reversed=!0,e.setEdge(t.w,t.v,r,n("rev"))})},undo:function(e){e.edges().forEach(t=>{let r=e.edge(t);if(r.reversed){e.removeEdge(t);let n=r.forwardName;delete r.reversed,delete r.forwardName,e.setEdge(t.w,t.v,r,n)}})}}}),c=o((e,t)=>{var r=d();t.exports={run:function(e){e.graph().dummyChains=[],e.edges().forEach(t=>(function(e,t){let n,o,a,s=t.v,i=e.node(s).rank,d=t.w,l=e.node(d).rank,c=t.name,u=e.edge(t),h=u.labelRank;if(l!==i+1){for(e.removeEdge(t),a=0,++i;i<l;++a,++i)u.points=[],o={width:0,height:0,edgeLabel:u,edgeObj:t,rank:i},n=r.addDummyNode(e,"edge",o,"_d"),i===h&&(o.width=u.width,o.height=u.height,o.dummy="edge-label",o.labelpos=u.labelpos),e.setEdge(s,n,{weight:u.weight},c),0===a&&e.graph().dummyChains.push(n),s=n;e.setEdge(s,d,{weight:u.weight},c)}})(e,t))},undo:function(e){e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeLabel,o;for(e.setEdge(r.edgeObj,n);r.dummy;)o=e.successors(t)[0],e.removeNode(t),n.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(n.x=r.x,n.y=r.y,n.width=r.width,n.height=r.height),t=o,r=e.node(t)})}}}),u=o((e,t)=>{var{applyWithChunking:r}=d();t.exports={longestPath:function(e){var t={};e.sources().forEach(function n(o){var a=e.node(o);if(Object.hasOwn(t,o))return a.rank;t[o]=!0;var s=r(Math.min,e.outEdges(o).map(t=>null==t?1/0:n(t.w)-e.edge(t).minlen));return s===1/0&&(s=0),a.rank=s})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}}),h=o((e,t)=>{var r=a().Graph,n=u().slack;t.exports=function(e){var t,o,a,s,i=new r({directed:!1}),d=e.nodes()[0],l=e.nodeCount();for(i.setNode(d,{});t=i,o=e,t.nodes().forEach(function e(r){o.nodeEdges(r).forEach(a=>{var s=a.v,i=r===s?a.w:s;t.hasNode(i)||n(o,a)||(t.setNode(i,{}),t.setEdge(r,i,{}),e(i))})}),t.nodeCount()<l;)a=function(e,t){return t.edges().reduce((r,o)=>{let a=1/0;return e.hasNode(o.v)!==e.hasNode(o.w)&&(a=n(t,o)),a<r[0]?[a,o]:r},[1/0,null])[1]}(i,e),s=i.hasNode(a.v)?n(e,a):-n(e,a),function(e,t,r){e.nodes().forEach(e=>t.node(e).rank+=r)}(i,e,s);return i}}),f=o((e,t)=>{var r=h(),n=u().slack,o=u().longestPath,s=a().alg.preorder,i=a().alg.postorder,l=d().simplify;function c(e){o(e=l(e));var t,n,a=r(e);for(g(a),f(a,e);t=m(a);)n=v(a,e,t),x(a,e,t,n)}function f(e,t){var r=i(e,e.nodes());(r=r.slice(0,r.length-1)).forEach(r=>{var n,o,a,s;return n=e,o=t,a=r,s=n.node(a).parent,void(n.edge(a,s).cutvalue=p(n,o,a))})}function p(e,t,r){var n=e.node(r).parent,o=!0,a=t.edge(r,n),s=0;return a||(o=!1,a=t.edge(n,r)),s=a.weight,t.nodeEdges(r).forEach(a=>{var i=a.v===r,d=i?a.w:a.v;if(d!==n){var l,c,u,h=i===o,f=t.edge(a).weight;if(s+=h?f:-f,l=e,c=r,u=d,l.hasEdge(c,u)){var p=e.edge(r,d).cutvalue;s+=h?-p:p}}}),s}function g(e,t){arguments.length<2&&(t=e.nodes()[0]),function e(t,r,n,o,a){var s=n,i=t.node(o);return r[o]=!0,t.neighbors(o).forEach(a=>{Object.hasOwn(r,a)||(n=e(t,r,n,a,o))}),i.low=s,i.lim=n++,a?i.parent=a:delete i.parent,n}(e,{},1,t)}function m(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function v(e,t,r){var o=r.v,a=r.w;t.hasEdge(o,a)||(o=r.w,a=r.v);var s=e.node(o),i=e.node(a),d=s,l=!1;return s.lim>i.lim&&(d=i,l=!0),t.edges().filter(t=>l===b(e,e.node(t.v),d)&&l!==b(e,e.node(t.w),d)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function x(e,t,r,n){var o,a,i,d,l=r.v,c=r.w;e.removeEdge(l,c),e.setEdge(n.v,n.w,{}),g(e),f(e,t),o=e,a=t,i=o.nodes().find(e=>!a.node(e).parent),(d=(d=s(o,i)).slice(1)).forEach(e=>{var t=o.node(e).parent,r=a.edge(e,t),n=!1;r||(r=a.edge(t,e),n=!0),a.node(e).rank=a.node(t).rank+(n?r.minlen:-r.minlen)})}function b(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=f,c.calcCutValue=p,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=x}),p=o((e,t)=>{var r=u().longestPath,n=h(),o=f();t.exports=function(e){var t,s=e.graph().ranker;if(s instanceof Function)return s(e);switch(e.graph().ranker){case"network-simplex":default:o(e);break;case"tight-tree":r(t=e),n(t);break;case"longest-path":a(e);case"none":}};var a=r}),g=o((e,t)=>{t.exports=function(e){var t;let r,n,o=(r={},n=0,(t=e).children().forEach(function e(o){let a=n;t.children(o).forEach(e),r[o]={low:a,lim:n++}}),r);e.graph().dummyChains.forEach(t=>{let r=e.node(t),n=r.edgeObj,a=function(e,t,r,n){let o=[],a=[],s=Math.min(t[r].low,t[n].low),i=Math.max(t[r].lim,t[n].lim),d,l;d=r;do o.push(d=e.parent(d));while(d&&(t[d].low>s||i>t[d].lim))for(l=d,d=n;(d=e.parent(d))!==l;)a.push(d);return{path:o.concat(a.reverse()),lca:l}}(e,o,n.v,n.w),s=a.path,i=a.lca,d=0,l=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(l=s[d])!==i&&e.node(l).maxRank<r.rank;)d++;l===i&&(c=!1)}if(!c){for(;d<s.length-1&&e.node(l=s[d+1]).minRank<=r.rank;)d++;l=s[d]}e.setParent(t,l),t=e.successors(t)[0]}})}}),m=o((e,t)=>{var r=d();t.exports={run:function(e){var t,n,o;let a=r.addDummyNode(e,"root",{},"_root"),s=(n={},(t=e).children().forEach(e=>(function e(r,o){var a=t.children(r);a&&a.length&&a.forEach(t=>e(t,o+1)),n[r]=o})(e,1)),n),i=Object.values(s),d=r.applyWithChunking(Math.max,i)-1,l=2*d+1;e.graph().nestingRoot=a,e.edges().forEach(t=>e.edge(t).minlen*=l);let c=(o=e).edges().reduce((e,t)=>e+o.edge(t).weight,0)+1;e.children().forEach(t=>(function e(t,n,o,a,s,i,d){let l=t.children(d);if(!l.length){d!==n&&t.setEdge(n,d,{weight:0,minlen:o});return}let c=r.addBorderNode(t,"_bt"),u=r.addBorderNode(t,"_bb"),h=t.node(d);t.setParent(c,d),h.borderTop=c,t.setParent(u,d),h.borderBottom=u,l.forEach(r=>{e(t,n,o,a,s,i,r);let l=t.node(r),h=l.borderTop?l.borderTop:r,f=l.borderBottom?l.borderBottom:r,p=l.borderTop?a:2*a,g=h!==f?1:s-i[d]+1;t.setEdge(c,h,{weight:p,minlen:g,nestingEdge:!0}),t.setEdge(f,u,{weight:p,minlen:g,nestingEdge:!0})}),t.parent(d)||t.setEdge(n,c,{weight:0,minlen:s+i[d]})})(e,a,l,c,d,s,t)),e.graph().nodeRankFactor=l},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}}}),v=o((e,t)=>{var r=d();function n(e,t,n,o,a,s){let i=a[t][s-1],d=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);a[t][s]=d,e.setParent(d,o),i&&e.setEdge(i,d,{weight:1})}t.exports=function(e){e.children().forEach(function t(r){let o=e.children(r),a=e.node(r);if(o.length&&o.forEach(t),Object.hasOwn(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(let t=a.minRank,o=a.maxRank+1;t<o;++t)n(e,"borderLeft","_bl",r,a,t),n(e,"borderRight","_br",r,a,t)}})}}),x=o((e,t)=>{function r(e){e.nodes().forEach(t=>n(e.node(t))),e.edges().forEach(t=>n(e.edge(t)))}function n(e){let t=e.width;e.width=e.height,e.height=t}function o(e){e.y=-e.y}function a(e){let t=e.x;e.x=e.y,e.y=t}t.exports={adjust:function(e){let t=e.graph().rankdir.toLowerCase();("lr"===t||"rl"===t)&&r(e)},undo:function(e){var t,n;let s=e.graph().rankdir.toLowerCase();("bt"===s||"rl"===s)&&((t=e).nodes().forEach(e=>o(t.node(e))),t.edges().forEach(e=>{let r=t.edge(e);r.points.forEach(o),Object.hasOwn(r,"y")&&o(r)})),("lr"===s||"rl"===s)&&((n=e).nodes().forEach(e=>a(n.node(e))),n.edges().forEach(e=>{let t=n.edge(e);t.points.forEach(a),Object.hasOwn(t,"x")&&a(t)}),r(e))}}}),b=o((e,t)=>{var r=d();t.exports=function(e){let t={},n=e.nodes().filter(t=>!e.children(t).length),o=n.map(t=>e.node(t).rank),a=r.applyWithChunking(Math.max,o),s=r.range(a+1).map(()=>[]);return n.sort((t,r)=>e.node(t).rank-e.node(r).rank).forEach(function r(n){t[n]||(t[n]=!0,s[e.node(n).rank].push(n),e.successors(n).forEach(r))}),s}}),y=o((e,t)=>{var r=d().zipObject;t.exports=function(e,t){let n=0;for(let o=1;o<t.length;++o)n+=function(e,t,n){let o=r(n,n.map((e,t)=>t)),a=t.flatMap(t=>e.outEdges(t).map(t=>({pos:o[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos)),s=1;for(;s<n.length;)s<<=1;let i=2*s-1;s-=1;let d=Array(i).fill(0),l=0;return a.forEach(e=>{let t=e.pos+s;d[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=d[t+1]),t=t-1>>1,d[t]+=e.weight;l+=e.weight*r}),l}(e,t[o-1],t[o]);return n}}),w=o((e,t)=>{t.exports=function(e,t=[]){return t.map(t=>{let r=e.inEdges(t);if(!r.length)return{v:t};{let n=r.reduce((t,r)=>{let n=e.edge(r),o=e.node(r.v);return{sum:t.sum+n.weight*o.order,weight:t.weight+n.weight}},{sum:0,weight:0});return{v:t,barycenter:n.sum/n.weight,weight:n.weight}}})}}),E=o((e,t)=>{var r=d();t.exports=function(e,t){let n={};return e.forEach((e,t)=>{let r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};void 0!==e.barycenter&&(r.barycenter=e.barycenter,r.weight=e.weight)}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];void 0!==t&&void 0!==r&&(r.indegree++,t.out.push(n[e.w]))}),function(e){let t=[];for(;e.length;){let r=e.pop();t.push(r),r.in.reverse().forEach(function(e){return t=>{t.merged||(void 0===t.barycenter||void 0===e.barycenter||t.barycenter>=e.barycenter)&&function(e,t){let r=0,n=0;e.weight&&(r+=e.barycenter*e.weight,n+=e.weight),t.weight&&(r+=t.barycenter*t.weight,n+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=r/n,e.weight=n,e.i=Math.min(t.i,e.i),t.merged=!0}(e,t)}}(r)),r.out.forEach(function(t){return r=>{r.in.push(t),0==--r.indegree&&e.push(r)}}(r))}return t.filter(e=>!e.merged).map(e=>r.pick(e,["vs","i","barycenter","weight"]))}(Object.values(n).filter(e=>!e.indegree))}}),k=o((e,t)=>{var r=d();function n(e,t,r){let n;for(;t.length&&(n=t[t.length-1]).i<=r;)t.pop(),e.push(n.vs),r++;return r}t.exports=function(e,t){var o;let a=r.partition(e,e=>Object.hasOwn(e,"barycenter")),s=a.lhs,i=a.rhs.sort((e,t)=>t.i-e.i),d=[],l=0,c=0,u=0;s.sort((o=!!t,(e,t)=>e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:o?t.i-e.i:e.i-t.i)),u=n(d,i,u),s.forEach(e=>{u+=e.vs.length,d.push(e.vs),l+=e.barycenter*e.weight,c+=e.weight,u=n(d,i,u)});let h={vs:d.flat(!0)};return c&&(h.barycenter=l/c,h.weight=c),h}}),j=o((e,t)=>{var r=w(),n=E(),o=k();t.exports=function e(t,a,s,i){var d,l;let c=t.children(a),u=t.node(a),h=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};h&&(c=c.filter(e=>e!==h&&e!==f));let g=r(t,c);g.forEach(r=>{if(t.children(r.v).length){var n,o;let a=e(t,r.v,s,i);p[r.v]=a,Object.hasOwn(a,"barycenter")&&(n=r,o=a,void 0!==n.barycenter?(n.barycenter=(n.barycenter*n.weight+o.barycenter*o.weight)/(n.weight+o.weight),n.weight+=o.weight):(n.barycenter=o.barycenter,n.weight=o.weight))}});let m=n(g,s);d=m,l=p,d.forEach(e=>{e.vs=e.vs.flatMap(e=>l[e]?l[e].vs:e)});let v=o(m,i);if(h&&(v.vs=[h,v.vs,f].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),r=t.node(t.predecessors(f)[0]);Object.hasOwn(v,"barycenter")||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+e.order+r.order)/(v.weight+2),v.weight+=2}return v}}),N=o((e,t)=>{var r=a().Graph,n=d();t.exports=function(e,t,o,a){a||(a=e.nodes());let s=function(e){for(var t;e.hasNode(t=n.uniqueId("_root")););return t}(e),i=new r({compound:!0}).setGraph({root:s}).setDefaultNodeLabel(t=>e.node(t));return a.forEach(r=>{let n=e.node(r),a=e.parent(r);(n.rank===t||n.minRank<=t&&t<=n.maxRank)&&(i.setNode(r),i.setParent(r,a||s),e[o](r).forEach(t=>{let n=t.v===r?t.w:t.v,o=i.edge(n,r),a=void 0!==o?o.weight:0;i.setEdge(n,r,{weight:e.edge(t).weight+a})}),Object.hasOwn(n,"minRank")&&i.setNode(r,{borderLeft:n.borderLeft[t],borderRight:n.borderRight[t]}))}),i}}),C=o((e,t)=>{t.exports=function(e,t,r){let n={},o;r.forEach(r=>{let a=e.parent(r),s,i;for(;a;){if((s=e.parent(a))?(i=n[s],n[s]=a):(i=o,o=a),i&&i!==a)return void t.setEdge(i,a);a=s}})}}),_=o((e,t)=>{var r=b(),n=y(),o=j(),s=N(),i=C(),l=a().Graph,c=d();function u(e,t,r){let n=new Map,o=(e,t)=>{n.has(e)||n.set(e,[]),n.get(e).push(t)};for(let t of e.nodes()){let r=e.node(t);if("number"==typeof r.rank&&o(r.rank,t),"number"==typeof r.minRank&&"number"==typeof r.maxRank)for(let e=r.minRank;e<=r.maxRank;e++)e!==r.rank&&o(e,t)}return t.map(function(t){return s(e,t,r,n.get(t)||[])})}function h(e,t){Object.values(t).forEach(t=>t.forEach((t,r)=>e.node(t).order=r))}t.exports=function e(t,a={}){if("function"==typeof a.customOrder)return void a.customOrder(t,e);let s=c.maxRank(t),d=u(t,c.range(1,s+1),"inEdges"),f=u(t,c.range(s-1,-1,-1),"outEdges"),p=r(t);if(h(t,p),a.disableOptimalOrderHeuristic)return;let g=1/0,m,v=a.constraints||[];for(let e=0,r=0;r<4;++e,++r){(function(e,t,r){let n=new l;e.forEach(function(e){r.forEach(e=>n.setEdge(e.left,e.right));let a=e.graph().root,s=o(e,a,n,t);s.vs.forEach((t,r)=>e.node(t).order=r),i(e,n,s.vs)})})(e%2?d:f,e%4>=2,v),p=c.buildLayerMatrix(t);let a=n(t,p);a<g?(r=0,m=Object.assign({},p),g=a):a===g&&(m=structuredClone(p))}h(t,m)}}),O=o((e,t)=>{var r=a().Graph,n=d();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,a=0,s=t.length,d=n[n.length-1];return n.forEach((t,l)=>{let c=function(e,t){if(e.node(t).dummy)return e.predecessors(t).find(t=>e.node(t).dummy)}(e,t),u=c?e.node(c).order:s;(c||t===d)&&(n.slice(a,l+1).forEach(t=>{e.predecessors(t).forEach(n=>{let a=e.node(n),s=a.order;(s<o||u<s)&&!(a.dummy&&e.node(t).dummy)&&i(r,n,t)})}),a=l+1,o=u)}),n}),r}function s(e,t){let r={};function o(t,o,a,s,d){let l;n.range(o,a).forEach(n=>{l=t[n],e.node(l).dummy&&e.predecessors(l).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<s||n.order>d)&&i(r,t,l)})})}return t.length&&t.reduce(function(t,r){let n=-1,a,s=0;return r.forEach((i,d)=>{if("border"===e.node(i).dummy){let t=e.predecessors(i);t.length&&(a=e.node(t[0]).order,o(r,s,d,n,a),s=d,n=a)}o(r,s,r.length,a,t.length)}),r}),r}function i(e,t,r){if(t>r){let e=t;t=r,r=e}let n=e[t];n||(e[t]=n={}),n[r]=!0}function l(e,t,r){if(t>r){let e=t;t=r,r=e}return!!e[t]&&Object.hasOwn(e[t],r)}function c(e,t,r,n){let o={},a={},s={};return t.forEach(e=>{e.forEach((e,t)=>{o[e]=e,a[e]=e,s[e]=t})}),t.forEach(e=>{let t=-1;e.forEach(e=>{let i=n(e);if(i.length){let n=((i=i.sort((e,t)=>s[e]-s[t])).length-1)/2;for(let d=Math.floor(n),c=Math.ceil(n);d<=c;++d){let n=i[d];a[e]===e&&t<s[n]&&!l(r,e,n)&&(a[n]=e,a[e]=o[e]=o[n],t=s[n])}}})}),{root:o,align:a}}function u(e,t,n,o,a){var s,i,d,l,c,u,h;let f,p,g,m={},v=(s=e,i=t,d=n,l=a,f=new r,g=(c=(p=s.graph()).nodesep,u=p.edgesep,h=l,(e,t,r)=>{let n=e.node(t),o=e.node(r),a,s;if(a=0+n.width/2,Object.hasOwn(n,"labelpos"))switch(n.labelpos.toLowerCase()){case"l":s=-n.width/2;break;case"r":s=n.width/2}if(s&&(a+=h?s:-s),s=0,a+=(n.dummy?u:c)/2,a+=(o.dummy?u:c)/2,a+=o.width/2,Object.hasOwn(o,"labelpos"))switch(o.labelpos.toLowerCase()){case"l":s=o.width/2;break;case"r":s=-o.width/2}return s&&(a+=h?s:-s),s=0,a}),i.forEach(e=>{let t;e.forEach(e=>{let r=d[e];if(f.setNode(r),t){var n=d[t],o=f.edge(n,r);f.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),f),x=a?"borderLeft":"borderRight";function b(e,t){let r=v.nodes().slice(),n={},o=r.pop();for(;o;){if(n[o])e(o);else for(let e of(n[o]=!0,r.push(o),t(o)))r.push(e);o=r.pop()}}return b(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),b(function(t){let r=v.outEdges(t).reduce((e,t)=>Math.min(e,m[t.w]-v.edge(t)),1/0),n=e.node(t);r!==1/0&&n.borderType!==x&&(m[t]=Math.max(m[t],r))},v.successors.bind(v)),Object.keys(o).forEach(e=>m[e]=m[n[e]]),m}function h(e,t){return Object.values(t).reduce((t,r)=>{let n=-1/0,o=1/0;Object.entries(r).forEach(([t,r])=>{var a,s;let i=(a=e,s=t,a.node(s).width/2);n=Math.max(r+i,n),o=Math.min(r-i,o)});let a=n-o;return a<t[0]&&(t=[a,r]),t},[1/0,null])[1]}function f(e,t){let r=Object.values(t),o=n.applyWithChunking(Math.min,r),a=n.applyWithChunking(Math.max,r);["u","d"].forEach(r=>{["l","r"].forEach(s=>{let i=r+s,d=e[i];if(d===t)return;let l=Object.values(d),c=o-n.applyWithChunking(Math.min,l);"l"!==s&&(c=a-n.applyWithChunking(Math.max,l)),c&&(e[i]=n.mapValues(d,e=>e+c))})})}function p(e,t){return n.mapValues(e.ul,(r,n)=>{if(t)return e[t.toLowerCase()][n];{let t=Object.values(e).map(e=>e[n]).sort((e,t)=>e-t);return(t[1]+t[2])/2}})}t.exports={positionX:function(e){let t=n.buildLayerMatrix(e),r=Object.assign(o(e,t),s(e,t)),a={},i;["u","d"].forEach(o=>{i="u"===o?t:Object.values(t).reverse(),["l","r"].forEach(t=>{"r"===t&&(i=i.map(e=>Object.values(e).reverse()));let s=("u"===o?e.predecessors:e.successors).bind(e),d=c(e,i,r,s),l=u(e,i,d.root,d.align,"r"===t);"r"===t&&(l=n.mapValues(l,e=>-e)),a[o+t]=l})});let d=h(e,a);return f(a,d),p(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:s,addConflict:i,hasConflict:l,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:f,findSmallestWidthAlignment:h,balance:p}}),R=o((e,t)=>{var r=d(),n=O().positionX;t.exports=function(e){var t;let o,a,s,i;t=e=r.asNonCompoundGraph(e),o=r.buildLayerMatrix(t),a=t.graph().ranksep,s=t.graph().rankalign,i=0,o.forEach(e=>{let r=e.reduce((e,r)=>{let n=t.node(r).height;return e>n?e:n},0);e.forEach(e=>{let n=t.node(e);"top"===s?n.y=i+n.height/2:"bottom"===s?n.y=i+r-n.height/2:n.y=i+r/2}),i+=r+a}),Object.entries(n(e)).forEach(([t,r])=>e.node(t).x=r)}}),M=o((e,t)=>{var r=l(),n=c(),o=p(),s=d().normalizeRanks,i=g(),u=d().removeEmptyRanks,h=m(),f=v(),b=x(),y=_(),w=R(),E=d(),k=a().Graph;t.exports=function(e,t={}){let a=t.debugTiming?E.time:E.notime;return a("layout",()=>{let d=a(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new k({multigraph:!0,compound:!0}),n=D(t.graph()),r.setGraph(Object.assign({},N,L(n,j),E.pick(n,C))),t.nodes().forEach(e=>{let n=L(D(t.node(e)),O);Object.keys(M).forEach(e=>{void 0===n[e]&&(n[e]=M[e])}),r.setNode(e,n),r.setParent(e,t.parent(e))}),t.edges().forEach(e=>{let n=D(t.edge(e));r.setEdge(e,Object.assign({},P,L(n,S),E.pick(n,T)))}),r});return a(" runLayout",()=>{var e,l,c;return e=d,l=a,c=t,void(l(" makeSpaceForEdgeLabels",()=>{var t;let r;return r=(t=e).graph(),void(r.ranksep/=2,t.edges().forEach(e=>{let n=t.edge(e);n.minlen*=2,"c"!==n.labelpos.toLowerCase()&&("TB"===r.rankdir||"BT"===r.rankdir?n.width+=n.labeloffset:n.height+=n.labeloffset)}))}),l(" removeSelfEdges",()=>{var t;(t=e).edges().forEach(e=>{if(e.v===e.w){var r=t.node(e.v);r.selfEdges||(r.selfEdges=[]),r.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}})}),l(" acyclic",()=>r.run(e)),l(" nestingGraph.run",()=>h.run(e)),l(" rank",()=>o(E.asNonCompoundGraph(e))),l(" injectEdgeLabelProxies",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(r.width&&r.height){let r=t.node(e.v),n={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};E.addDummyNode(t,"edge-proxy",n,"_ep")}})}),l(" removeEmptyRanks",()=>u(e)),l(" nestingGraph.cleanup",()=>h.cleanup(e)),l(" normalizeRanks",()=>s(e)),l(" assignRankMinMax",()=>{var t;let r;return r=0,void((t=e).nodes().forEach(e=>{let n=t.node(e);n.borderTop&&(n.minRank=t.node(n.borderTop).rank,n.maxRank=t.node(n.borderBottom).rank,r=Math.max(r,n.maxRank))}),t.graph().maxRank=r)}),l(" removeEdgeLabelProxies",()=>{var t;(t=e).nodes().forEach(e=>{let r=t.node(e);"edge-proxy"===r.dummy&&(t.edge(r.e).labelRank=r.rank,t.removeNode(e))})}),l(" normalize.run",()=>n.run(e)),l(" parentDummyChains",()=>i(e)),l(" addBorderSegments",()=>f(e)),l(" order",()=>y(e,c)),l(" insertSelfEdges",()=>{var t;return t=e,void E.buildLayerMatrix(t).forEach(e=>{var r=0;e.forEach((e,n)=>{var o=t.node(e);o.order=n+r,(o.selfEdges||[]).forEach(e=>{E.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:n+ ++r,e:e.e,label:e.label},"_se")}),delete o.selfEdges})})}),l(" adjustCoordinateSystem",()=>b.adjust(e)),l(" position",()=>w(e)),l(" positionSelfEdges",()=>{var t;(t=e).nodes().forEach(e=>{var r=t.node(e);if("selfedge"===r.dummy){var n=t.node(r.e.v),o=n.x+n.width/2,a=n.y,s=r.x-o,i=n.height/2;t.setEdge(r.e,r.label),t.removeNode(e),r.label.points=[{x:o+2*s/3,y:a-i},{x:o+5*s/6,y:a-i},{x:o+s,y:a},{x:o+5*s/6,y:a+i},{x:o+2*s/3,y:a+i}],r.label.x=r.x,r.label.y=r.y}})}),l(" removeBorderNodes",()=>{var t;(t=e).nodes().forEach(e=>{if(t.children(e).length){let r=t.node(e),n=t.node(r.borderTop),o=t.node(r.borderBottom),a=t.node(r.borderLeft[r.borderLeft.length-1]),s=t.node(r.borderRight[r.borderRight.length-1]);r.width=Math.abs(s.x-a.x),r.height=Math.abs(o.y-n.y),r.x=a.x+r.width/2,r.y=n.y+r.height/2}}),t.nodes().forEach(e=>{"border"===t.node(e).dummy&&t.removeNode(e)})}),l(" normalize.undo",()=>n.undo(e)),l(" fixupEdgeLabelCoords",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);if(Object.hasOwn(r,"x"))switch(("l"===r.labelpos||"r"===r.labelpos)&&(r.width-=r.labeloffset),r.labelpos){case"l":r.x-=r.width/2+r.labeloffset;break;case"r":r.x+=r.width/2+r.labeloffset}})}),l(" undoCoordinateSystem",()=>b.undo(e)),l(" translateGraph",()=>(function(e){let t=1/0,r=0,n=1/0,o=0,a=e.graph(),s=a.marginx||0,i=a.marginy||0;function d(e){let a=e.x,s=e.y,i=e.width,d=e.height;t=Math.min(t,a-i/2),r=Math.max(r,a+i/2),n=Math.min(n,s-d/2),o=Math.max(o,s+d/2)}e.nodes().forEach(t=>d(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&d(r)}),t-=s,n-=i,e.nodes().forEach(r=>{let o=e.node(r);o.x-=t,o.y-=n}),e.edges().forEach(r=>{let o=e.edge(r);o.points.forEach(e=>{e.x-=t,e.y-=n}),Object.hasOwn(o,"x")&&(o.x-=t),Object.hasOwn(o,"y")&&(o.y-=n)}),a.width=r-t+s,a.height=o-n+i})(e)),l(" assignNodeIntersects",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e),n=t.node(e.v),o=t.node(e.w),a,s;r.points?(a=r.points[0],s=r.points[r.points.length-1]):(r.points=[],a=o,s=n),r.points.unshift(E.intersectRect(n,a)),r.points.push(E.intersectRect(o,s))})}),l(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),l(" acyclic.undo",()=>r.undo(e)))}),a(" updateInputGraph",()=>{var t,r;return t=e,r=d,void(t.nodes().forEach(e=>{let n=t.node(e),o=r.node(e);n&&(n.x=o.x,n.y=o.y,n.order=o.order,n.rank=o.rank,r.children(e).length&&(n.width=o.width,n.height=o.height))}),t.edges().forEach(e=>{let n=t.edge(e),o=r.edge(e);n.points=o.points,Object.hasOwn(o,"x")&&(n.x=o.x,n.y=o.y)}),t.graph().width=r.graph().width,t.graph().height=r.graph().height)}),d})};var j=["nodesep","edgesep","ranksep","marginx","marginy"],N={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],O=["width","height","rank"],M={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},T=["labelpos"];function L(e,t){return E.mapValues(E.pick(e,t),Number)}function D(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),S=o((e,t)=>{var r=d(),n=a().Graph;t.exports={debugOrdering:function(e){let t=r.buildLayerMatrix(e),o=new n({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{o.setNode(t,{label:t}),o.setParent(t,"layer"+e.node(t).rank)}),e.edges().forEach(e=>o.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{o.setNode("layer"+t,{rank:"same"}),e.reduce((e,t)=>(o.setEdge(e,t,{style:"invis"}),t))}),o}}}),P=o((e,t)=>{t.exports="2.0.4"});let T=o((e,t)=>{t.exports={graphlib:a(),layout:M(),debug:S(),util:{time:d().time,notime:d().notime},version:P()}})(),L={direction:"LR",ranksep:200,nodesep:15},D={featureNode:{width:288,height:140},repositoryNode:{width:328,height:50}};function A(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:D[e.type??""]??t}function I(e,t,r={}){let{direction:n="TB",nodeSize:o={width:172,height:36},ranksep:a=80,nodesep:s=30}=r;if(0===e.length)return{nodes:[],edges:[]};let i=new T.graphlib.Graph({multigraph:!0});i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:n,ranksep:a,nodesep:s});let d=new Set;for(let e of t)d.add(e.source),d.add(e.target);let l=e.filter(e=>d.has(e.id)),c=e.filter(e=>!d.has(e.id));for(let e of l){let t=A(e,o);i.setNode(e.id,{width:t.width,height:t.height})}for(let e of t)i.hasNode(e.source)&&i.hasNode(e.target)&&i.setEdge(e.source,e.target,{},e.id);T.layout(i);let{targetPosition:u,sourcePosition:h}=function(e){switch(e){case"LR":return{targetPosition:"left",sourcePosition:"right"};case"RL":return{targetPosition:"right",sourcePosition:"left"};case"BT":return{targetPosition:"bottom",sourcePosition:"top"};default:return{targetPosition:"top",sourcePosition:"bottom"}}}(n),f="LR"===n||"RL"===n,p=new Map;for(let e of l){let t=i.node(e.id),r=A(e,o);p.set(e.id,{cx:t.x,cy:t.y,w:r.width,h:r.height})}let g=0;for(let e of p.values()){g=f?e.cx:e.cy;break}for(let e of c){let t=A(e,o);p.set(e.id,{cx:f?g:0,cy:f?0:g,w:t.width,h:t.height})}let m=new Map;for(let e of t)p.has(e.source)&&p.has(e.target)&&(m.has(e.source)||m.set(e.source,[]),m.get(e.source).push(e.target));let v=new Map;for(let t=0;t<e.length;t++)v.set(e[t].id,t);for(let[,e]of m)e.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let x=new Set;for(let e of m.values())for(let t of e)x.add(t);let b=[...[...d].filter(e=>p.has(e)&&!x.has(e)),...c.map(e=>e.id)];b.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let y=new Map;for(let e of b)!function e(t){if(y.has(t))return y.get(t);let r=p.get(t),n=f?r.h:r.w,o=m.get(t);if(!o||0===o.length)return y.set(t,n),n;let a=0;for(let t of o)a+=e(t);let i=Math.max(n,a+=(o.length-1)*s);return y.set(t,i),i}(e);let w=0;for(let e of b){let t=y.get(e)??0;!function e(t,r){let n=p.get(t);f?n.cy=r:n.cx=r;let o=m.get(t);if(!o||0===o.length)return;let a=0;for(let e of o)a+=y.get(e)??0;let i=r-(a+=(o.length-1)*s)/2;for(let t of o){let r=y.get(t)??0;e(t,i+r/2),i+=r+s}}(e,w+t/2),w+=t+s}let E=[];for(let t of e){let e=p.get(t.id);e&&E.push({...t,targetPosition:u,sourcePosition:h,position:{x:e.cx-e.w/2,y:e.cy-e.h/2}})}return{nodes:E,edges:[...t]}}var F=e.i(40554),$=e.i(21023);let z=(0,$.createServerReference)("4027cc9d09e02deec349bd86ad3f4ba657e64e43da",$.callServer,void 0,$.findSourceMapURL,"addRepository"),B=(0,$.createServerReference)("403739b63d792396fd57375e33ec642b7f3ee2acf7",$.callServer,void 0,$.findSourceMapURL,"deleteRepository"),G=(0,$.createServerReference)("4042f708c65e365430d1b123a5926eea89bf7bb961",$.callServer,void 0,$.findSourceMapURL,"getFeatureMetadata"),q=(0,$.createServerReference)("0085c9b64aa4e28830155c65eea5c7a14f95b4bd56",$.callServer,void 0,$.findSourceMapURL,"fetchGraphData");var W=e.i(39443),V=e.i(8361),U=e.i(18354),H=e.i(99045);function X(e,t){let r=new Map;for(let e of t)"dependencyEdge"===e.type&&r.set(e.target,e.source);let n=new Map,o=new Map;for(let t of e)"featureNode"===t.type?n.set(t.id,{nodeId:t.id,data:t.data,parentNodeId:r.get(t.id)}):"repositoryNode"===t.type&&o.set(t.id,{nodeId:t.id,data:t.data});return{featureMap:n,repoMap:o}}function K(e,t){return(void 0===t.state||t.state===e.state)&&(void 0===t.lifecycle||t.lifecycle===e.lifecycle)&&(void 0===t.name||t.name===e.name)&&(void 0===t.description||t.description===e.description)}let Y=(0,U.createLogger)("[Polling]"),J=0,Q=0;function Z(e,o){let a=(0,r.useRouter)(),s=(0,V.useSoundAction)("delete"),i=(0,V.useSoundAction)("create"),{nodes:d,edges:l,reconcile:c,updateFeature:u,addPendingFeature:h,removeFeature:f,restoreFeature:p,addRepository:g,removeRepository:m,replaceRepository:v,getFeatureRepositoryPath:x,getRepositoryData:b,getRepoMapSize:y,setCallbacks:w}=function(e,r){let n=(0,t.useMemo)(()=>X(e,r),[]),[o,a]=(0,t.useState)(n.featureMap),[s,i]=(0,t.useState)(n.repoMap),[d,l]=(0,t.useState)(new Map),c=(0,t.useRef)(new Map),u=(0,t.useRef)(new Set),h=(0,t.useRef)(new Set),f=(0,t.useRef)({}),p=(0,t.useMemo)(()=>({onNodeAction:e=>f.current.onNodeAction?.(e),onNodeSettings:e=>f.current.onNodeSettings?.(e),onFeatureDelete:e=>f.current.onFeatureDelete?.(e),onRepositoryAdd:e=>f.current.onRepositoryAdd?.(e),onRepositoryClick:e=>f.current.onRepositoryClick?.(e),onRepositoryDelete:e=>f.current.onRepositoryDelete?.(e)}),[]),g=(0,t.useRef)(o);g.current=o;let m=(0,t.useRef)(s);m.current=s;let v=(0,t.useMemo)(()=>(function(e,t,r,n){let o=[],a=[],s=new Map;for(let[e,r]of t)r.data.repositoryPath&&s.set(r.data.repositoryPath,e);let i=new Map;for(let[e,r]of[...t.entries()].sort((e,t)=>(e[1].data.createdAt??0)-(t[1].data.createdAt??0))){let t={...r.data,...n?.onRepositoryAdd&&{onAdd:()=>n.onRepositoryAdd(e)},...n?.onRepositoryClick&&{onClick:()=>n.onRepositoryClick(e)},...n?.onRepositoryDelete&&{onDelete:n.onRepositoryDelete}};o.push({id:e,type:"repositoryNode",position:{x:0,y:0},data:t})}for(let[t,d,l]of[...[...e.entries()].map(([e,t])=>[e,t,!1]),...[...r.entries()].filter(([t])=>!e.has(t)).map(([e,t])=>[e,t,!0])]){let e="creating"===d.data.state||l,r={...d.data,...!e&&n?.onNodeAction&&{onAction:()=>n.onNodeAction(t)},...!e&&n?.onNodeSettings&&{onSettings:()=>n.onNodeSettings(t)},...!e&&n?.onFeatureDelete&&{onDelete:n.onFeatureDelete}};if(o.push({id:t,type:"featureNode",position:{x:0,y:0},data:r}),d.parentNodeId)a.push({id:`dep-${d.parentNodeId}-${t}`,source:d.parentNodeId,target:t,type:"dependencyEdge"});else{let e=d.data.repositoryPath,r=s.get(e)??function(e){if(i.has(e))return i.get(e);let t=`virtual-repo-${e}`,r=e.split("/").filter(Boolean).at(-1)??e;return o.push({id:t,type:"repositoryNode",position:{x:0,y:0},data:{name:r,repositoryPath:e}}),i.set(e,t),t}(e);a.push({id:`edge-${r}-${t}`,source:r,target:t,style:{strokeDasharray:"5 5"}})}}let d=a.length>0;for(let e of o)e.data.showHandles=d;return{nodes:o,edges:a}})(o,s,d,p),[o,s,d,p]),x=(0,t.useRef)({key:"",positions:new Map}),{nodes:b,edges:y}=(0,t.useMemo)(()=>{let e=v.nodes.map(e=>e.id).sort().join(","),t=v.edges.map(e=>`${e.source}-${e.target}`).sort().join(","),r=`${e}|${t}`;if(r!==x.current.key){let e=I(v.nodes,v.edges,L),t=new Map;for(let r of e.nodes)t.set(r.id,{position:r.position,targetPosition:r.targetPosition,sourcePosition:r.sourcePosition});let n=x.current.positions;if(n.size>0){let r=0,o=0;for(let[e,a]of t){let t=n.get(e);if(t){r=t.position.x-a.position.x,o=t.position.y-a.position.y;break}}if(0!==r||0!==o){for(let e of t.values())e.position={x:e.position.x+r,y:e.position.y+o};for(let t of e.nodes)t.position={x:t.position.x+r,y:t.position.y+o}}}return x.current={key:r,positions:t},e}let{positions:n}=x.current;return{nodes:v.nodes.map(e=>{let t=n.get(e.id);return t?{...e,...t}:e}),edges:v.edges}},[v]),w=(0,t.useCallback)((e,t)=>{let{featureMap:r,repoMap:n}=X(e,t),o=new Set([...r.values()].map(e=>`${e.data.name}\0${e.data.repositoryPath}`));a(e=>{let t=[...e.entries()].filter(([,e])=>"creating"===e.data.state),n=new Map(r);for(let[e,r]of t){let t=`${r.data.name}\0${r.data.repositoryPath}`;o.has(t)||n.set(e,r)}let a=new Set;for(let[t,r]of e)"deleting"===r.data.state&&(n.has(t)?n.set(t,{...n.get(t),data:{...n.get(t).data,state:"deleting"}}):h.current.has(t)||(n.set(t,r),a.add(t)));for(let[e,t]of(h.current=a,c.current)){let r=n.get(e);r&&(n.set(e,{...r,data:{...r.data,...t}}),c.current.delete(e))}return n}),l(e=>{if(0===e.size)return e;let t=!1,r=new Map(e);for(let[n,a]of e){let e=`${a.data.name}\0${a.data.repositoryPath}`;o.has(e)&&(r.delete(n),t=!0)}return t?r:e}),i(e=>{let t=new Map(n),r=new Set([...n.values()].map(e=>e.data.repositoryPath));for(let[n,o]of e){if(t.has(n)||r.has(o.data.repositoryPath)){u.current.delete(n);continue}(n.startsWith("repo-temp-")||u.current.has(n))&&t.set(n,o)}return t})},[]),E=(0,t.useCallback)((e,t)=>{a(r=>{let n=r.get(e);if(!n)return c.current.set(e,{...c.current.get(e),...t}),r;if(c.current.delete(e),K(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o}),l(r=>{let n=r.get(e);if(!n||K(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o})},[]),k=(0,t.useCallback)((e,t,r)=>{l(n=>{let o=new Map(n);return o.set(e,{nodeId:e,data:t,parentNodeId:r}),o})},[]),j=(0,t.useCallback)(e=>{l(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),N=(0,t.useCallback)(e=>{a(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),C=(0,t.useCallback)((e,t)=>{a(r=>{let n=new Map(r);return n.set(e,t),n})},[]),_=(0,t.useCallback)((e,t)=>{u.current.add(e),i(r=>{let n=new Map(r);return n.set(e,{nodeId:e,data:t}),n})},[]),O=(0,t.useCallback)(e=>{u.current.delete(e),i(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),R=(0,t.useCallback)((e,t,r)=>{u.current.delete(e),u.current.add(t),i(n=>{if(!n.has(e))return n;let o=new Map(n);return o.delete(e),o.set(t,{nodeId:t,data:r}),o})},[]),M=(0,t.useCallback)(e=>g.current.get(e)?.data.repositoryPath,[]),S=(0,t.useCallback)(e=>m.current.get(e)?.data,[]);return{nodes:b,edges:y,reconcile:w,updateFeature:E,addPendingFeature:k,removePendingFeature:j,removeFeature:N,restoreFeature:C,addRepository:_,removeRepository:O,replaceRepository:R,getFeatureRepositoryPath:M,getRepositoryData:S,getRepoMapSize:(0,t.useCallback)(()=>m.current.size,[]),setCallbacks:(0,t.useCallback)(e=>{f.current=e},[])}}(e,o),E=(0,t.useRef)(d),k=(0,t.useRef)(l);(0,t.useEffect)(()=>{E.current=d,k.current=l},[d,l]);let j=(0,t.useMemo)(()=>e.map(e=>e.id).sort().join(","),[e]),N=(0,t.useMemo)(()=>e.filter(e=>"featureNode"===e.type).map(e=>{let t=e.data;return`${e.id}:${t.state}:${t.lifecycle}`}).sort().join(","),[e]),C=(0,t.useRef)("");(0,t.useEffect)(()=>{let t=`${j}|${N}`;t!==C.current&&(C.current=t,c(e,o))},[j,N,e,o,c]);let _=(0,t.useRef)(new Map),{events:O}=(0,W.useAgentEventsContext)();(0,t.useEffect)(()=>{let t=_.current;for(let r of e){if("featureNode"!==r.type)continue;let e=r.data,o=t.get(r.id);void 0!==o&&o!==e.state&&(O.some(t=>t.featureId===e.featureId&&(0,H.mapEventTypeToState)(t.eventType)===e.state)||("done"===e.state?n.toast.success(e.name,{description:"Feature completed!"}):"action-required"===e.state?n.toast.warning(e.name,{description:"Waiting for your approval",action:{label:"Review",onClick:()=>a.push(`/feature/${e.featureId}`)}}):"error"===e.state&&n.toast.error(e.name,{description:e.errorMessage??"Agent failed"}))),t.set(r.id,e.state)}},[N,e,O,a]);let R=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(R.current>O.length&&(R.current=0),O.length<=R.current)return;let e=O.slice(R.current);for(let{featureId:t,state:r,lifecycle:n}of(R.current=O.length,(0,H.resolveSseEventUpdates)(e)))if(void 0!==r||void 0!==n){let e=`feat-${t}`,o=E.current.find(t=>t.id===e);if(o&&"deleting"===o.data.state)continue;u(e,{...void 0!==r&&{state:r},...void 0!==n&&{lifecycle:n}})}},[O,u]),(0,t.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;u(`feat-${t}`,{state:"running"})};return window.addEventListener("shep:feature-approved",e),()=>window.removeEventListener("shep:feature-approved",e)},[u]);let M=(0,t.useRef)(new Set),S=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(S.current>O.length&&(S.current=0),O.length<=S.current)return;let e=O.slice(S.current);for(let t of(S.current=O.length,e)){if("Feature metadata updated"!==t.message||M.current.has(t.featureId))continue;M.current.add(t.featureId);let e=`feat-${t.featureId}`;G(t.featureId).then(t=>{t&&u(e,{name:t.name,description:t.description})}).catch(()=>{})}},[O,u]),(0,t.useEffect)(()=>{Y.debug("polling enabled (3000ms interval)");let e=setInterval(async()=>{try{let{nodes:e,edges:t}=await q();c(e,t)}catch{Y.warn("poll fetch failed — will retry next interval")}},3e3);return()=>{Y.debug("polling disabled"),clearInterval(e)}},[c]);let P=(0,t.useCallback)(e=>{},[]),T=(0,t.useCallback)(e=>{},[]),D=(0,t.useCallback)((e,t,r)=>{let n=t?.featureId?`feat-${t.featureId}`:`feature-${Date.now()}-${J++}`,o={name:t?.name??"New Feature",description:t?.description??"Describe what this feature does",featureId:t?.featureId??`#${n.slice(-4)}`,lifecycle:"requirements",state:t?.state??"running",progress:0,repositoryPath:t?.repositoryPath??"",branch:t?.branch??""};return h(n,o,"dependencyEdge"===r&&e?e:void 0),n},[h]),A=(0,t.useCallback)((e,t)=>{let r=`feat-${e}`,o=[],i=[r];for(;i.length>0;){let e=i.shift();for(let t of k.current)"dependencyEdge"===t.type&&t.source===e&&(o.push(t.target),i.push(t.target))}let d=new Map;for(let e of[r,...o]){let t=E.current.find(t=>t.id===e);t&&d.set(e,t.data.state)}for(let e of(u(r,{state:"deleting"}),o))u(e,{state:"deleting"});s.play(),a.push("/"),(0,F.deleteFeature)(e,t).then(e=>{if(e.error){for(let[e,t]of d)t&&u(e,{state:t});n.toast.error(e.error)}else for(let e of(f(r),o))f(e)}).catch(()=>{for(let[e,t]of d)t&&u(e,{state:t});n.toast.error("Failed to delete feature")})},[a,s,u,f]),$=(0,t.useCallback)(async e=>{let t=`repo-${e}`,r=new Set(k.current.filter(e=>e.source===t).map(e=>e.target)),o=b(t),a=new Map;for(let e of r){let t=E.current.find(t=>t.id===e);t&&a.set(e,{nodeId:e,data:t.data})}let i=()=>{for(let[e,r]of(o&&g(t,o),a))p(e,r)};for(let e of(m(t),r))f(e);try{let t=await B(e);if(!t.success){n.toast.error(t.error??"Failed to remove repository"),i();return}s.play()}catch{n.toast.error("Failed to remove repository"),i()}},[s,m,f,g,p,b]),U=(0,t.useCallback)(e=>{let t=I(E.current,k.current,{...L,direction:e});c(t.nodes,t.edges)},[c]);return{nodes:d,edges:l,onNodesChange:P,handleConnect:T,handleAddRepository:(0,t.useCallback)(e=>{let t=0===y(),r=`repo-temp-${++Q}`,o=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e;return g(r,{name:o,repositoryPath:e,id:r,createdAt:Date.now()}),z({path:e,name:o}).then(e=>{if(e.error){m(r),n.toast.error(e.error);return}let t=e.repository;v(r,`repo-${t.id}`,{name:t.name,repositoryPath:t.path,id:t.id,createdAt:t.createdAt instanceof Date?t.createdAt.getTime():Number(t.createdAt)}),i.play()}).catch(()=>{m(r),n.toast.error("Failed to add repository")}),{wasEmpty:t,repoPath:e}},[g,m,v,i,y]),handleLayout:U,handleDeleteFeature:A,handleDeleteRepository:$,createFeatureNode:D,getFeatureRepositoryPath:x,getRepositoryData:b,setCallbacks:w}}e.s(["useControlCenterState",()=>Z],17840)},48246,e=>{"use strict";var t=e.i(20314),r=e.i(53271),n=e.i(79054),o=e.i(31406),a=e.i(3214),s=e.i(3645);let i=(0,s.default)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);var d=e.i(31777),l=e.i(35364);e.i(54793);var c=e.i(7729);e.i(47506);var u=e.i(89313),h=e.i(92002);let f=(0,s.default)("github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);var p=e.i(8986),g=e.i(38573),m=e.i(19933),v=e.i(67669),x=e.i(24042),b=e.i(64970);e.i(81803);var y=e.i(72714),w=e.i(2287),E=e.i(2828);e.i(99348);var k=e.i(17466),j=e.i(8537),N=e.i(75921),C=e.i(76852);function _({data:e}){let o=(0,N.useFeatureFlags)(),[s,i]=(0,n.useState)(!1),c=(0,C.useRepositoryActions)(e.repositoryPath?{repositoryPath:e.repositoryPath}:null),u=(0,j.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),_="Booting"===u.status||"Ready"===u.status;return(0,t.jsxs)("div",{className:(0,d.cn)("group relative",e.onDelete&&e.id&&"pl-10"),children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:h.Position.Left,isConnectable:!1,className:"opacity-0!"}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute top-1/2 left-0 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove repository","data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),i(!0)},className:"bg-card text-muted-foreground hover:border-destructive hover:text-destructive flex h-7 w-7 cursor-pointer items-center justify-center rounded-full border shadow-sm transition-colors",children:(0,t.jsx)(v.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(E.TooltipContent,{children:"Remove repository"})]})})}),(0,t.jsx)(w.Dialog,{open:s,onOpenChange:i,children:(0,t.jsxs)(w.DialogContent,{className:"max-w-xs",children:[(0,t.jsxs)(w.DialogHeader,{children:[(0,t.jsx)(w.DialogTitle,{children:"Remove repository?"}),(0,t.jsxs)(w.DialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," and all its features from your workspace. The repository files on disk won't be affected."]})]}),(0,t.jsxs)(w.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(w.DialogClose,{asChild:!0,children:(0,t.jsx)(l.Button,{variant:"outline",children:"Cancel"})}),(0,t.jsx)(l.Button,{variant:"destructive",onClick:()=>{i(!1),e.onDelete?.(e.id)},children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"repository-node-card","data-repo-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:"nodrag bg-card flex min-w-[18rem] cursor-pointer items-center gap-3 rounded-full border px-4 py-3 shadow-sm",children:[(0,t.jsx)(f,{className:"text-muted-foreground h-5 w-5 shrink-0"}),(0,t.jsx)("span",{"data-testid":"repository-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("div",{className:(0,d.cn)("flex shrink-0 items-center gap-2",(e.repositoryPath??e.onAdd)&&"ml-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(y.ActionButton,{label:"Open in IDE",onClick:c.openInIde,loading:c.ideLoading,error:!!c.ideError,icon:p.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open in IDE"})]})}),(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(y.ActionButton,{label:"Open in Shell",onClick:c.openInShell,loading:c.shellLoading,error:!!c.shellError,icon:g.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open in Shell"})]})}),(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(y.ActionButton,{label:"Open Folder",onClick:c.openFolder,loading:c.folderLoading,error:!!c.folderError,icon:m.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:"Open Folder"})]})}),o.envDeploy?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(y.ActionButton,{label:_?"Stop Dev Server":"Start Dev Server",onClick:_?u.stop:u.deploy,loading:u.deployLoading||u.stopLoading,error:!!u.deployError,icon:_?b.Square:x.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(E.TooltipContent,{children:_?"Stop Dev Server":"Start Dev Server"})]})}),_?(0,t.jsx)(k.DeploymentStatusBadge,{status:u.status,url:u.url,targetId:e.repositoryPath}):null]}):null]}):null,e.onAdd?(0,t.jsx)(E.TooltipProvider,{children:(0,t.jsxs)(E.Tooltip,{children:[(0,t.jsx)(E.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Add feature","data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:(0,d.cn)("text-muted-foreground hover:bg-accent dark:hover:bg-accent/50 flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full transition-colors hover:text-blue-500",e.pulseAdd&&"animate-pulse-cta bg-blue-100 text-blue-500 dark:bg-blue-900/40"),children:(0,t.jsx)(a.Plus,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(E.TooltipContent,{children:"Add feature"})]})}):null]})]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:h.Position.Right,isConnectable:!e.showHandles,className:"opacity-0!"}):null]})}function O(e){let[n]=(0,h.getBezierPath)({sourceX:e.sourceX,sourceY:e.sourceY,targetX:e.targetX,targetY:e.targetY,sourcePosition:e.sourcePosition,targetPosition:e.targetPosition});return(0,t.jsx)(r.BaseEdge,{id:e.id,path:n,style:{strokeDasharray:"5 5"}})}e.i(1650),e.i(45811),e.i(25235);let R={x:30,y:30,zoom:.85};function M({onResetViewport:e}){let{setViewport:o}=(0,r.useReactFlow)(),a=(0,n.useCallback)(()=>{o(e(),{duration:400})},[e,o]);return(0,t.jsx)(r.ControlButton,{onClick:a,title:"Reset view","aria-label":"Reset view",children:(0,t.jsx)(i,{style:{fill:"none"}})})}function S({nodes:e,edges:o,selectedFeatureId:s,defaultViewport:i,onNodesChange:h,onAddFeature:f,onConnect:p,onNodeClick:g,onPaneClick:m,onCanvasDrag:v,onMoveEnd:x,onResetViewport:b,toolbar:y,emptyState:w}){let E=(0,n.useMemo)(()=>({featureNode:u.FeatureNode,repositoryNode:_}),[]),k=(0,n.useMemo)(()=>({dependencyEdge:O}),[]),j=(0,n.useMemo)(()=>null==s?e:e.map(e=>"featureNode"===e.type&&e.data.featureId===s?{...e,selected:!0}:e),[e,s]),N=0===e.length,[C,S]=(0,n.useState)(N),[P,T]=(0,n.useState)(!1),L=(0,n.useRef)(N);(0,n.useEffect)(()=>{if(L.current&&!N){T(!0);let e=setTimeout(()=>{S(!1),T(!1)},300);return L.current=N,()=>clearTimeout(e)}!L.current&&N&&S(!0),L.current=N},[N]);let D=N&&!w?(0,t.jsx)(c.EmptyState,{title:"No features yet",description:"Get started by creating your first feature.",action:(0,t.jsxs)(l.Button,{onClick:f,children:[(0,t.jsx)(a.Plus,{className:"mr-2 h-4 w-4"}),"New Feature"]})}):null,A=w??D;return(0,t.jsxs)("div",{"data-testid":N?"features-canvas-empty":"features-canvas","data-no-drawer-close":!0,className:"dark:bg-background pointer-events-auto relative h-full w-full bg-[#f6f7f8]",children:[(0,t.jsxs)(r.ReactFlow,{nodes:j,edges:o,nodeTypes:E,edgeTypes:k,onConnect:p,onNodesChange:h,onNodeClick:g,onPaneClick:m,onMoveStart:v,onMoveEnd:x,defaultViewport:i??R,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},children:[(0,t.jsx)(r.Background,{variant:r.BackgroundVariant.Dots,gap:24,size:1,color:"#b8bcc4",className:"dark:[&_circle]:!fill-white/[0.1]"}),!N&&(0,t.jsx)(r.Controls,{showInteractive:!1,children:b?(0,t.jsx)(M,{onResetViewport:b}):null}),y]}),C&&A?(0,t.jsx)("div",{className:(0,d.cn)("pointer-events-none absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",P?"opacity-0":"animate-in fade-in opacity-100 duration-200"),children:(0,t.jsx)("div",{className:"pointer-events-auto",children:A})}):null]})}var P=e.i(5147),T=e.i(8361),L=e.i(30153);let D="shep-canvas-viewport",A={x:30,y:30,zoom:.85},I=(0,s.default)("square-terminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);var F=e.i(33548),$=e.i(23925),z=e.i(83428),B=e.i(35e3),G=e.i(79687),q=e.i(78521),W=e.i(21023);let V=(0,W.createServerReference)("0053b247e89b40036c80d2703a9b667106689ab7b5",W.callServer,void 0,W.findSourceMapURL,"isAgentSetupComplete"),U=(0,W.createServerReference)("0003cb7f645f6de466f17a2d98003916d3968b3f63",W.callServer,void 0,W.findSourceMapURL,"checkAgentAuth");var H=e.i(76016),X=e.i(11345),K=e.i(26370),Y=e.i(46421),J=e.i(17543),Q=e.i(86782),Z=e.i(29847);let ee=["select-agent","select-model"];function et({onComplete:e,className:r}){let o,[a,s]=(0,n.useState)([]),[i,l]=(0,n.useState)(!0),[c,u]=(0,n.useState)("select-agent"),[h,f]=(0,n.useState)(null),[p,g]=(0,n.useState)(!1),[m,v]=(0,n.useState)(!1),[x,b]=(0,n.useState)(!0),y=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{(0,Y.getAllAgentModels)().then(s).finally(()=>l(!1))},[]);let w=h?a.find(e=>e.agentType===h):null,E=(0,n.useCallback)((e,t)=>{v(!0),b(!1),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{t?.(),u(e),requestAnimationFrame(()=>{b(!0),v(!1)})},150)},[]);(0,n.useEffect)(()=>()=>{y.current&&clearTimeout(y.current)},[]);let k=(0,n.useCallback)(async(t,r)=>{g(!0);try{await (0,J.updateAgentAndModel)(t,r),e()}finally{g(!1)}},[e]),j=(0,n.useCallback)(e=>{let t=a.find(t=>t.agentType===e);t&&t.models.length>0?E("select-model",()=>{f(e)}):k(e,null)},[a,E,k]),N=(0,n.useCallback)(e=>{h&&k(h,e)},[h,k]),C=(0,n.useCallback)(()=>{"select-model"===c&&E("select-agent",()=>{f(null)})},[c,E]);if(i)return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,d.cn)("flex flex-col items-center justify-center gap-3",r),children:[(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-4 w-4 animate-spin"}),(0,t.jsx)("p",{className:"text-muted-foreground text-xs",children:"Loading agents…"})]});let _=ee.indexOf(c);return(0,t.jsxs)("div",{"data-testid":"welcome-agent-setup",className:(0,d.cn)("flex flex-col items-center gap-4","w-72",r),children:[(0,t.jsx)("div",{className:"flex flex-col items-center gap-1",children:(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:["select-agent"===c&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(K.Bot,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Choose your agent"})]}),"select-model"===c&&w?(o=(0,Q.getAgentTypeIcon)(w.agentType),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o,{className:"h-3.5 w-3.5"}),(0,t.jsxs)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:[w.label," — Pick a model"]})]})):null]})}),(0,t.jsx)("div",{className:"flex w-full items-center gap-1",children:ee.map((e,r)=>(0,t.jsx)("div",{className:(0,d.cn)("h-0.5 flex-1 rounded-full transition-colors duration-300",r<=_?"bg-foreground/60":"bg-muted")},e))}),(0,t.jsxs)("div",{className:(0,d.cn)("flex w-full flex-col items-center transition-opacity duration-150",x&&!m?"opacity-100":"opacity-0"),children:["select-agent"===c&&(0,t.jsx)("div",{"data-testid":"agent-list",className:"flex w-full flex-col gap-1.5",children:a.map(e=>{let r=(0,Q.getAgentTypeIcon)(e.agentType);return(0,t.jsxs)("button",{type:"button",disabled:p,"data-testid":`agent-option-${e.agentType}`,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 transition-colors disabled:opacity-50",onClick:()=>j(e.agentType),children:[(0,t.jsx)(r,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left text-xs font-medium",children:e.label}),(0,t.jsx)(H.ChevronRight,{className:"text-muted-foreground h-3 w-3"})]},e.agentType)})}),"select-model"===c&&w?(0,t.jsxs)("div",{"data-testid":"model-list",className:"flex w-full flex-col gap-1.5",children:[(0,t.jsxs)("button",{type:"button",disabled:p,className:"text-muted-foreground hover:text-foreground mb-0.5 flex cursor-pointer items-center gap-1 self-start text-[10px] font-medium transition-colors",onClick:C,children:[(0,t.jsx)(X.ChevronLeft,{className:"h-3 w-3"}),"Back"]}),(0,t.jsx)("div",{className:"flex max-h-48 w-full flex-col gap-1.5 overflow-y-auto",children:w.models.map(e=>{let r=(0,Z.getModelMeta)(e.id);return(0,t.jsxs)("button",{type:"button",disabled:p,"data-testid":`model-option-${e.id}`,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 text-left transition-colors disabled:opacity-50",onClick:()=>N(e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:r.displayName||e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px] leading-tight",children:r.description||e.description})]}),(0,t.jsx)(H.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"})]},e.id)})})]}):null]})]})}let er=["cd ~/my-repo",'shep feat new "sleek dashboard"'];function en({onRepositorySelect:e,className:r}){let[o,s]=(0,n.useState)(!1),[i,l]=(0,n.useState)(!1),[c,u]=(0,n.useState)(null),[h,p]=(0,n.useState)(null);async function g(){if(!i){l(!0);try{let t=await (0,q.pickFolder)();t&&e?.(t)}finally{l(!1)}}}(0,n.useEffect)(()=>{V().then(e=>{u(e)})},[]),(0,n.useEffect)(()=>{c&&U().then(p)},[c]);let m=(0,n.useCallback)(async()=>{await navigator.clipboard.writeText(er.join("\n")),s(!0),setTimeout(()=>s(!1),2e3)},[]),v=(0,n.useCallback)(()=>{u(!0)},[]),x=(0,n.useCallback)(()=>{p(null),U().then(p)},[]);return null===c?null:(0,t.jsx)("div",{"data-testid":"control-center-empty-state",className:(0,d.cn)("flex flex-col items-center justify-center",r),children:(0,t.jsx)("div",{className:"animate-in fade-in slide-in-from-bottom-2 w-96 rounded-2xl border border-white/30 bg-white/50 px-8 py-8 shadow-lg backdrop-blur-xl duration-300 dark:border-white/10 dark:bg-white/5",children:(0,t.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,t.jsxs)("div",{className:"mb-2 text-center",children:[(0,t.jsx)("h1",{className:"text-xl font-bold tracking-tight",children:"Features"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm font-light",children:"Control Center"})]}),c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eo,{status:h,onRetry:x}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)(f,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Repositories"})]}),(0,t.jsxs)("button",{type:"button","data-testid":"empty-state-add-repository",onClick:g,disabled:i,className:"border-border hover:border-foreground/40 flex w-full cursor-pointer items-center gap-2.5 rounded-md border border-dashed px-4 py-2.5 transition-colors disabled:cursor-wait disabled:opacity-50",children:[i?(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-4 w-4 animate-spin"}):(0,t.jsx)(a.Plus,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:i?"Opening…":"Add Repository"})]}),(0,t.jsxs)("div",{className:"text-muted-foreground flex items-center gap-2",children:[(0,t.jsx)("div",{className:"bg-border h-px w-10"}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(I,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"text-[10px] font-semibold tracking-widest uppercase",children:"Or via CLI"})]}),(0,t.jsx)("div",{className:"bg-border h-px w-10"})]}),(0,t.jsxs)("div",{"data-testid":"cli-code-block",className:"relative w-full rounded-md bg-zinc-900 px-3 py-2 font-mono text-[11px] text-zinc-300",children:[(0,t.jsx)("button",{type:"button","data-testid":"cli-code-block-copy",onClick:m,className:"absolute top-2 right-2 cursor-pointer rounded p-1 text-zinc-500 transition-colors hover:bg-zinc-800 hover:text-zinc-300","aria-label":"Copy commands",children:o?(0,t.jsx)($.Check,{className:"h-3 w-3"}):(0,t.jsx)(F.Copy,{className:"h-3 w-3"})}),(0,t.jsx)("div",{className:"space-y-0.5",children:er.map(e=>(0,t.jsxs)("div",{className:"whitespace-nowrap",children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),(0,t.jsx)("span",{children:e})]},e))})]}),(0,t.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Feature will appear on canvas once created"})]}):(0,t.jsx)(et,{onComplete:v,className:"w-full"})]})})})}function eo({status:e,onRetry:r}){return e?e.installed&&e.authenticated?(0,t.jsxs)("div",{className:"animate-in fade-in flex w-full items-center gap-2 rounded-md bg-emerald-500/10 px-3 py-1.5",children:[(0,t.jsx)(B.CheckCircle2,{className:"h-3 w-3 text-emerald-600 dark:text-emerald-400"}),(0,t.jsxs)("span",{className:"text-[10px] text-emerald-700 dark:text-emerald-300",children:[e.label," ready"]})]}):e.installed?(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 rounded-md bg-amber-500/10 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(G.AlertCircle,{className:"h-3 w-3 text-amber-600 dark:text-amber-400"}),(0,t.jsxs)("span",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:[e.label," needs authentication"]})]}),e.authCommand?(0,t.jsxs)("div",{className:"rounded bg-zinc-900 px-2 py-1 font-mono text-[10px] text-zinc-300",children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),e.authCommand]}):null,(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.binaryName?(0,t.jsxs)("button",{type:"button","data-testid":"auth-banner-open-terminal",onClick:async()=>{try{let t="claude-code"===e.agentType?"claude-code":e.agentType;await fetch(`/api/tools/${t}/launch`,{method:"POST"})}catch{}},className:"flex items-center gap-1 rounded border border-amber-600/30 px-2 py-0.5 text-[10px] font-medium text-amber-700 transition-colors hover:bg-amber-500/10 dark:text-amber-300",children:[(0,t.jsx)(g.Terminal,{className:"h-2.5 w-2.5"}),"Open ",e.label]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"text-[10px] font-medium text-amber-700 underline underline-offset-2 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",children:"Re-check"})]})]}):(0,t.jsxs)("div",{className:"flex w-full flex-col gap-2 rounded-md bg-amber-500/10 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(G.AlertCircle,{className:"h-3 w-3 text-amber-600 dark:text-amber-400"}),(0,t.jsxs)("span",{className:"text-[10px] font-medium text-amber-700 dark:text-amber-300",children:[e.label," not installed"]})]}),e.binaryName?(0,t.jsxs)("div",{className:"rounded bg-zinc-900 px-2 py-1 font-mono text-[10px] text-zinc-300",children:[(0,t.jsx)("span",{className:"text-zinc-500 select-none",children:"$ "}),"npm install -g ",e.binaryName]}):null,(0,t.jsx)("button",{type:"button",onClick:r,className:"self-start text-[10px] font-medium text-amber-700 underline underline-offset-2 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",children:"Re-check"})]}):(0,t.jsxs)("div",{className:"bg-muted/50 flex w-full items-center gap-2 rounded-md px-3 py-1.5",children:[(0,t.jsx)(z.Loader2,{className:"text-muted-foreground h-3 w-3 animate-spin"}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:"Checking agent setup…"})]})}var ea=e.i(17840);let es={maxZoom:1,padding:.5,duration:500};function ei({initialNodes:e,initialEdges:a}){let s,i,d,l=(0,o.useRouter)(),c=(0,o.usePathname)(),u=(s=(0,o.usePathname)().match(/^\/feature\/([^/]+)/),s?.[1]??null),h=(0,T.useSoundAction)("click"),{guardedNavigate:f}=(0,L.useDrawerCloseGuard)(),{fitView:p}=(0,r.useReactFlow)(),g=(0,n.useRef)(null),{defaultViewport:m,onMoveEnd:v,resetViewport:x}=(i=(0,n.useRef)(function(){try{let e=localStorage.getItem(D);if(null==e)return A;let t=JSON.parse(e);return!(null==t||"object"!=typeof t||Array.isArray(t))&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.zoom&&Number.isFinite(t.x)&&Number.isFinite(t.y)&&Number.isFinite(t.zoom)&&t.zoom>0?t:A}catch{return A}}()).current,d=(0,n.useRef)(null),(0,n.useEffect)(()=>()=>{null!=d.current&&clearTimeout(d.current)},[]),{defaultViewport:i,onMoveEnd:(0,n.useCallback)(e=>{null!=d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{try{localStorage.setItem(D,JSON.stringify(e))}catch{}},500)},[]),resetViewport:(0,n.useCallback)(()=>{try{localStorage.removeItem(D)}catch{}return A},[])}),{nodes:b,edges:y,onNodesChange:w,handleConnect:E,handleAddRepository:k,handleDeleteFeature:j,handleDeleteRepository:N,createFeatureNode:C,setCallbacks:_}=(0,ea.useControlCenterState)(e,a),{setFeatures:O}=(0,P.useSidebarFeaturesContext)(),R=(0,n.useMemo)(()=>b.filter(e=>"featureNode"===e.type),[b]),M=(0,n.useMemo)(()=>R.map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.name}`}).sort().join(","),[R]);(0,n.useEffect)(()=>{O(R.map(e=>{let t=e.data,r=(0,P.mapNodeStateToSidebarStatus)(t.state);return r?{featureId:t.featureId,name:t.name,status:r,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime},...t.agentType&&{agentType:t.agentType},...t.modelId&&{modelId:t.modelId}}:null}).filter(Boolean))},[M,R,O]);let I=(0,n.useCallback)((e,t)=>{if("featureNode"===t.type){let r=t.data;"creating"!==r.state&&"deleting"!==r.state&&e.target.closest('[data-testid="feature-node-card"]')&&f(()=>{h.play(),l.push(`/feature/${r.featureId}`)})}},[l,h,f]),F=(0,n.useCallback)(()=>{h.play(),l.push("/create")},[l,h]),$=(0,n.useCallback)(e=>{h.play();let t=b.find(t=>t.id===e),r=t?.data?.repositoryPath;r?l.push(`/create?repo=${encodeURIComponent(r)}`):l.push("/create")},[b,l,h]),z=(0,n.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=y.find(t=>t.target===e),n=r?b.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;h.play();let a=new URLSearchParams;o&&a.set("repo",o),a.set("parent",t),l.push(`/create?${a.toString()}`)},[b,y,l,h]),B=(0,n.useCallback)(e=>{let t=b.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&f(()=>l.push(`/repository/${e.id}`))}},[b,l,f]),G=(0,n.useCallback)(()=>{"/"!==c&&f(()=>l.push("/"))},[l,c,f]);(0,n.useEffect)(()=>{let e=e=>{let{wasEmpty:t,repoPath:r}=k(e.detail.path);t&&setTimeout(()=>{p(es),g.current=setTimeout(()=>{f(()=>l.push(`/create?repo=${encodeURIComponent(r)}`))},600)},0)};return window.addEventListener("shep:add-repository",e),()=>{window.removeEventListener("shep:add-repository",e),null!=g.current&&clearTimeout(g.current)}},[k,p,f,l]),(0,n.useEffect)(()=>{let e=e=>{let t=e.detail;if(t.parentId)return void C(`feat-${t.parentId}`,{state:"creating",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath},"dependencyEdge");let r=b.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);C(r?.id??null,{state:"running",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath})};return window.addEventListener("shep:feature-created",e),()=>window.removeEventListener("shep:feature-created",e)},[b,C]),(0,n.useEffect)(()=>{_({onNodeAction:z,onFeatureDelete:j,onRepositoryAdd:$,onRepositoryClick:B,onRepositoryDelete:N})},[_,z,j,$,B,N]);let q=(0,n.useCallback)((e,t)=>{v(t)},[v]),W=b.some(e=>"repositoryNode"===e.type),[V,U]=(0,n.useState)(W),H=(0,n.useRef)(null);(0,n.useEffect)(()=>(W?(H.current&&(clearTimeout(H.current),H.current=null),U(!0)):V&&(H.current=setTimeout(()=>{U(!1),H.current=null},500)),()=>{H.current&&clearTimeout(H.current)}),[W,V]);let X=c.startsWith("/create"),K=(0,n.useMemo)(()=>{let e=b.filter(e=>"repositoryNode"===e.type),t=b.some(e=>"featureNode"===e.type);return 1!==e.length||t||X?b:b.map(e=>"repositoryNode"===e.type?{...e,data:{...e.data,pulseAdd:!0}}:e)},[b,X]);return(0,t.jsx)(S,{nodes:V?K:[],edges:V?y:[],selectedFeatureId:u,defaultViewport:m,onNodesChange:w,onConnect:E,onAddFeature:F,onNodeClick:I,onPaneClick:G,onMoveEnd:q,onResetViewport:x,emptyState:(0,t.jsx)(en,{onRepositorySelect:k})})}function ed({initialNodes:e,initialEdges:n,drawer:o}){return(0,t.jsxs)("div",{"data-testid":"control-center",className:"h-full w-full",children:[(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsx)(ei,{initialNodes:e,initialEdges:n})}),(0,t.jsx)("div",{children:o},"drawer")]})}e.s(["ControlCenter",()=>ed],48246)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,24042,64970,e=>{"use strict";var t=e.i(3645);let n=(0,t.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);e.s(["Play",()=>n],24042);let r=(0,t.default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",()=>r],64970)},81803,72714,60253,2287,17466,99348,e=>{"use strict";var t=e.i(20314),n=e.i(83428),r=e.i(51251),a=e.i(31777),o=e.i(35364),l=e.i(8361);function i({label:e,onClick:i,loading:s,error:u,icon:d,iconOnly:c=!1,variant:f="outline",size:p="sm"}){let m=(0,l.useSoundAction)("click");return(0,t.jsxs)(o.Button,{variant:f,size:p,"aria-label":e,disabled:s,onClick:()=>{m.play(),i()},className:(0,a.cn)("gap-1.5",u&&"text-destructive hover:text-destructive",!u&&c&&"ghost"===f&&"text-muted-foreground cursor-pointer rounded-full transition-colors hover:text-blue-500"),children:[s?(0,t.jsx)(n.Loader2,{className:"size-4 animate-spin"}):u?(0,t.jsx)(r.CircleAlert,{className:"size-4"}):(0,t.jsx)(d,{className:"size-4"}),c?null:e]})}e.s(["ActionButton",()=>i],72714),e.s([],81803);var s=e.i(79054),u=e.i(30702),d=e.i(38573),c=e.i(17406),f=e.i(81846),p=e.i(90033),m=e.i(90537);e.s(["X",()=>m.default],60253);var m=m;let g=p.Dialog.Root,h=p.Dialog.Trigger,v=p.Dialog.Portal,w=p.Dialog.Close,y=s.forwardRef(({className:e,onClick:n,...r},o)=>(0,t.jsx)(p.Dialog.Overlay,{ref:o,className:(0,a.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(),n?.(e)},...r}));y.displayName=p.Dialog.Overlay.displayName;let b=s.forwardRef(({className:e,children:n,...r},o)=>(0,t.jsxs)(v,{children:[(0,t.jsx)(y,{}),(0,t.jsxs)(p.Dialog.Content,{ref:o,className:(0,a.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),...r,children:[n,(0,t.jsxs)(p.Dialog.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-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)(m.default,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));b.displayName=p.Dialog.Content.displayName;let x=({className:e,...n})=>(0,t.jsx)("div",{className:(0,a.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});x.displayName="DialogHeader";let D=({className:e,...n})=>(0,t.jsx)("div",{className:(0,a.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});D.displayName="DialogFooter";let j=s.forwardRef(({className:e,...n},r)=>(0,t.jsx)(p.Dialog.Title,{ref:r,className:(0,a.cn)("text-lg leading-none font-semibold tracking-tight",e),...n}));j.displayName=p.Dialog.Title.displayName;let R=s.forwardRef(({className:e,...n},r)=>(0,t.jsx)(p.Dialog.Description,{ref:r,className:(0,a.cn)("text-muted-foreground text-sm",e),...n}));R.displayName=p.Dialog.Description.displayName,e.s(["Dialog",()=>g,"DialogClose",()=>w,"DialogContent",()=>b,"DialogDescription",()=>R,"DialogFooter",()=>D,"DialogHeader",()=>x,"DialogTitle",()=>j,"DialogTrigger",()=>h],2287);var C=e.i(21023);let T=(0,C.createServerReference)("406ea9c9909f6b213d4bb5f29ca40cd45bfead9b78",C.callServer,void 0,C.findSourceMapURL,"getDeploymentLogs");function N({open:e,onOpenChange:n,targetId:r}){let{logs:a,isConnected:o}=function(e){let[t,n]=(0,s.useState)([]),[r,a]=(0,s.useState)(!1),o=(0,s.useRef)(null),l=(0,s.useCallback)(()=>{o.current&&(o.current.close(),o.current=null),a(!1)},[]);return(0,s.useEffect)(()=>{if(!e){n([]),a(!1);return}T(e).then(e=>{e&&n(e)}).catch(()=>{});let t=new EventSource(`/api/deployment-logs?targetId=${e}`);return o.current=t,t.onopen=()=>{a(!0)},t.addEventListener("log",e=>{let t=JSON.parse(e.data);n(e=>[...e,t])}),t.onerror=()=>{a(!1)},()=>{t.close(),o.current=null}},[e,l]),{logs:t,isConnected:r}}(e?r:null);return(0,t.jsx)(E,{open:e,onOpenChange:n,logs:a,isConnected:o})}function E({open:e,onOpenChange:n,logs:r,isConnected:a}){let o=(0,s.useRef)(null),l=(0,s.useRef)(!0),i=(0,s.useCallback)(()=>{let e=o.current;e&&(l.current=e.scrollTop+e.clientHeight>=e.scrollHeight-50)},[]);return(0,s.useEffect)(()=>{l.current&&o.current&&(o.current.scrollTop=o.current.scrollHeight)},[r]),(0,t.jsx)(g,{open:e,onOpenChange:n,children:(0,t.jsxs)(b,{className:"flex h-[calc(100vh-48px)] max-h-[calc(100vh-48px)] w-full max-w-[calc(100vw-48px)] flex-col gap-0 bg-zinc-950 p-0 text-zinc-100 sm:rounded-lg","aria-describedby":void 0,children:[(0,t.jsxs)(x,{className:"flex flex-row items-center justify-between border-b border-zinc-800 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Terminal,{className:"h-4 w-4 text-zinc-400"}),(0,t.jsx)(j,{className:"text-sm font-medium text-zinc-100",children:"Server Logs"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,t.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${a?"bg-green-500":"bg-zinc-500"}`}),(0,t.jsx)("span",{className:"text-xs text-zinc-400",children:a?"Connected":"Disconnected"})]})]}),(0,t.jsxs)("div",{ref:o,onScroll:i,className:"flex-1 overflow-auto p-4 font-mono text-sm leading-relaxed",children:[0===r.length?(0,t.jsx)("p",{className:"text-zinc-500",children:"Waiting for log output..."}):r.map(e=>(0,t.jsx)(S,{entry:e},`${e.timestamp}-${e.stream}-${e.line}`)),!a&&r.length>0&&(0,t.jsx)("div",{className:"mt-2 border-t border-zinc-800 pt-2 text-zinc-500",children:"[Server stopped]"})]})]})})}function S({entry:e}){return(0,t.jsx)("div",{"data-stream":e.stream,className:"stderr"===e.stream?"text-red-400":"text-zinc-200",children:(0,t.jsx)("span",{className:"break-all whitespace-pre-wrap",children:e.line})})}function $({status:e,url:r,targetId:a}){let[o,l]=(0,s.useState)(!1),i=a&&(e===c.DeploymentState.Booting||e===c.DeploymentState.Ready);switch(e){case c.DeploymentState.Booting:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.Badge,{className:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",children:[(0,t.jsx)(n.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Starting...",i?(0,t.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-blue-100",onClick:e=>{e.stopPropagation(),l(!0)},children:(0,t.jsx)(d.Terminal,{className:"h-3 w-3"})}):null]}),i?(0,t.jsx)(N,{open:o,onOpenChange:l,targetId:a}):null]});case c.DeploymentState.Ready:return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,t.jsx)("span",{className:"mr-1 inline-block h-2 w-2 rounded-full bg-green-500"}),r?(0,t.jsxs)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:underline",onClick:e=>e.stopPropagation(),children:[r,(0,t.jsx)(u.ExternalLink,{className:"h-3 w-3"})]}):"Ready",i?(0,t.jsx)("button",{type:"button","aria-label":"View server logs",className:"ml-1.5 inline-flex items-center rounded-sm p-0.5 hover:bg-green-100",onClick:e=>{e.stopPropagation(),l(!0)},children:(0,t.jsx)(d.Terminal,{className:"h-3 w-3"})}):null]}),i?(0,t.jsx)(N,{open:o,onOpenChange:l,targetId:a}):null]});default:return null}}e.s(["DeploymentStatusBadge",()=>$],17466),e.s([],99348)},8537,e=>{"use strict";var t=e.i(79054),n=e.i(18354),r=e.i(21023);let a=(0,r.createServerReference)("40fb25c333e48fda149969208f4e8e1a87fb0adadb",r.callServer,void 0,r.findSourceMapURL,"deployFeature"),o=(0,r.createServerReference)("40d0da8d1b691b6fd8749c3a2ac97be5ace862636d",r.callServer,void 0,r.findSourceMapURL,"deployRepository"),l=(0,r.createServerReference)("40f9d563cd5958ea3bc3c2fa8fe855dd0b499bf06b",r.callServer,void 0,r.findSourceMapURL,"stopDeployment"),i=(0,r.createServerReference)("406623321db85d87e2c51b25d11cc64a89c2d68f2c",r.callServer,void 0,r.findSourceMapURL,"getDeploymentStatus"),s=(0,n.createLogger)("[useDeployAction]");function u(e){let[n,r]=(0,t.useState)(!1),[u,d]=(0,t.useState)(!1),[c,f]=(0,t.useState)(null),[p,m]=(0,t.useState)(null),[g,h]=(0,t.useState)(null),v=(0,t.useRef)(null),w=(0,t.useRef)(null),y=(0,t.useRef)(!0),b=(0,t.useRef)(p);(0,t.useEffect)(()=>{b.current=p},[p]),(0,t.useEffect)(()=>(y.current=!0,()=>{y.current=!1}),[]),(0,t.useEffect)(()=>()=>{v.current&&clearTimeout(v.current),w.current&&clearInterval(w.current)},[]);let x=(0,t.useCallback)(()=>{w.current&&(s.debug("stopping polling"),clearInterval(w.current),w.current=null)},[]),D=(0,t.useCallback)(e=>{x(),s.debug(`starting polling for "${e}" every 3000ms`),w.current=setInterval(async()=>{if(!y.current)return void x();let t=await i(e);y.current&&(t&&"Stopped"!==t.state?(t.state!==b.current&&s.info(`poll state changed: ${b.current} → ${t.state}, url=${t.url}`),m(t.state),h(t.url)):(s.info(`poll result: ${t?`state=${t.state}`:"null (deployment gone)"} — stopping poll`),m(null),h(null),x()))},3e3)},[x]),j=(0,t.useCallback)(async()=>{if(!e)return void s.warn("deploy() called but input is null — no-op");if(n)return void s.warn("deploy() called but already loading — no-op");s.info(`deploy() — targetType="${e.targetType}", targetId="${e.targetId}", repositoryPath="${e.repositoryPath}"`),v.current&&clearTimeout(v.current),r(!0),f(null);try{let t="feature"===e.targetType?await a(e.targetId):await o(e.repositoryPath);if(s.info("server action result:",t),!y.current)return void s.warn("component unmounted after deploy — discarding result");if(t.success)s.info(`deploy succeeded — initial state=${t.state}, starting polling`),m(t.state??null),h(null),D(e.targetId);else{let e=t.error??"An unexpected error occurred";s.error(`deploy failed: ${e}`),f(e),v.current=setTimeout(()=>f(null),5e3)}}catch(t){if(!y.current)return;let e=t instanceof Error?t.message:"An unexpected error occurred";s.error(`deploy threw exception: ${e}`,t),f(e),v.current=setTimeout(()=>f(null),5e3)}finally{y.current&&r(!1)}},[e,n,D]),R=(0,t.useCallback)(async()=>{if(e&&!u){s.info(`stop() — targetId="${e.targetId}"`),d(!0);try{let t=await l(e.targetId);if(s.info("stop result:",t),!y.current)return;t.success&&(x(),m(null),h(null))}catch(e){s.warn("stop error (non-critical):",e)}finally{y.current&&d(!1)}}},[e,u,x]);return{deploy:j,stop:R,deployLoading:n,stopLoading:u,deployError:c,status:p,url:g}}e.s(["useDeployAction",()=>u],8537)},45811,e=>{"use strict";let t;var n=e.i(20314),r=e.i(48249),a=e.i(567),o=e.i(79054);let l=o.default.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),i=()=>{let e=o.default.useContext(l);if(!e)throw Error("useDrawerContext must be used within a Drawer.Root");return e};function s(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function u(){return d(/^iPhone/)||d(/^iPad/)||d(/^Mac/)&&navigator.maxTouchPoints>1}function d(e){return"u">typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"u"<typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");let c="u">typeof window?o.useLayoutEffect:o.useEffect;function f(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}let p="u">typeof document&&window.visualViewport;function m(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function g(e){for(m(e)&&(e=e.parentElement);e&&!m(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}let h=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),v=0;function w(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function y(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=g(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function b(e){return e instanceof HTMLInputElement&&!h.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function x(...e){return o.useCallback(function(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}(...e),e)}let D=new WeakMap;function j(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||D.set(e,r)}let R=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function C(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,a=r.match(/^matrix3d\((.+)\)$/);return a?parseFloat(a[1].split(", ")[R(t)?13:12]):(a=r.match(/^matrix\((.+)\)$/))?parseFloat(a[1].split(", ")[R(t)?5:4]):null}function T(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}let N=[.32,.72,0,1],E="vaul-dragging";function S(e){let t=o.default.useRef(e);return o.default.useEffect(()=>{t.current=e}),o.default.useMemo(()=>(...e)=>null==t.current?void 0:t.current.call(t,...e),[])}function $({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,a]=function({defaultProp:e,onChange:t}){let n=o.default.useState(e),[r]=n,a=o.default.useRef(r),l=S(t);return o.default.useEffect(()=>{a.current!==r&&(l(r),a.current=r)},[r,a,l]),n}({defaultProp:t,onChange:n}),l=void 0!==e,i=l?e:r,s=S(n);return[i,o.default.useCallback(t=>{if(l){let n="function"==typeof t?t(e):t;n!==e&&s(n)}else a(t)},[l,e,a,s])]}let k=()=>()=>{},P=null;function M({open:e,onOpenChange:n,children:r,onDrag:i,onRelease:d,snapPoints:m,shouldScaleBackground:h=!1,setBackgroundColorOnScale:x=!0,closeThreshold:T=.25,scrollLockTimeout:S=100,dismissible:k=!0,handleOnly:M=!1,fadeFromIndex:z=m&&m.length-1,activeSnapPoint:O,setActiveSnapPoint:L,fixed:B,modal:F=!0,onClose:A,nested:I,noBodyStyles:H=!1,direction:W="bottom",defaultOpen:q=!1,disablePreventScroll:Y=!0,snapToSequentialPoint:U=!1,preventScrollRestoration:X=!1,repositionInputs:V=!0,onAnimationEnd:K,container:J,autoFocus:_=!1}){var G,Q;let[Z=!1,ee]=$({defaultProp:q,prop:e,onChange:e=>{null==n||n(e),e||I||ek(),setTimeout(()=>{null==K||K(e)},500),e&&!F&&"u">typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[et,en]=o.default.useState(!1),[er,ea]=o.default.useState(!1),[eo,el]=o.default.useState(!1),ei=o.default.useRef(null),es=o.default.useRef(null),eu=o.default.useRef(null),ed=o.default.useRef(null),ec=o.default.useRef(null),ef=o.default.useRef(!1),ep=o.default.useRef(null),em=o.default.useRef(0),eg=o.default.useRef(!1),eh=o.default.useRef(!q),ev=o.default.useRef(0),ew=o.default.useRef(null),ey=o.default.useRef((null==(G=ew.current)?void 0:G.getBoundingClientRect().height)||0),eb=o.default.useRef((null==(Q=ew.current)?void 0:Q.getBoundingClientRect().width)||0),ex=o.default.useRef(0),eD=o.default.useCallback(e=>{m&&e===eN.length-1&&(es.current=new Date)},[]),{activeSnapPoint:ej,activeSnapPointIndex:eR,setActiveSnapPoint:eC,onRelease:eT,snapPointsOffset:eN,onDrag:eE,shouldFade:eS,getPercentageDragged:e$}=function({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:a,fadeFromIndex:l,onSnapPointChange:i,direction:s="bottom",container:u,snapToSequentialPoint:d}){let[c,f]=$({prop:e,defaultProp:null==n?void 0:n[0],onChange:t}),[p,m]=o.default.useState("u">typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);o.default.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);let g=o.default.useMemo(()=>c===(null==n?void 0:n[n.length-1])||null,[n,c]),h=o.default.useMemo(()=>{var e;return null!=(e=null==n?void 0:n.findIndex(e=>e===c))?e:null},[n,c]),v=n&&n.length>0&&(l||0===l)&&!Number.isNaN(l)&&n[l]===c||!n,w=o.default.useMemo(()=>{var e;let t=u?{width:u.getBoundingClientRect().width,height:u.getBoundingClientRect().height}:"u">typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return null!=(e=null==n?void 0:n.map(e=>{let n="string"==typeof e,r=0;if(n&&(r=parseInt(e,10)),R(s)){let a=n?r:p?e*t.height:0;return p?"bottom"===s?t.height-a:-t.height+a:a}let a=n?r:p?e*t.width:0;return p?"right"===s?t.width-a:-t.width+a:a}))?e:[]},[n,p,u]),y=o.default.useMemo(()=>null!==h?null==w?void 0:w[h]:null,[w,h]),b=o.default.useCallback(e=>{var t;let o=null!=(t=null==w?void 0:w.findIndex(t=>t===e))?t:null;i(o),j(r.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),w&&o!==w.length-1&&void 0!==l&&o!==l&&o<l?j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"0"}):j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"1"}),f(null==n?void 0:n[Math.max(o,0)])},[r.current,n,w,l,a,f]);return o.default.useEffect(()=>{if(c||e){var t;let r=null!=(t=null==n?void 0:n.findIndex(t=>t===e||t===c))?t:-1;w&&-1!==r&&"number"==typeof w[r]&&b(w[r])}},[c,e,n,w,b]),{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:function(e,t){if(!n||"number"!=typeof h||!w||void 0===l)return null;let r=h===l-1;if(h>=l&&t)return 0;if(r&&!t)return 1;if(!v&&!r)return null;let a=r?h+1:h-1,o=e/Math.abs(r?w[a]-w[a-1]:w[a+1]-w[a]);return r?1-o:o},setActiveSnapPoint:f,activeSnapPointIndex:h,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(void 0===l)return;let i="bottom"===s||"right"===s?(null!=y?y:0)-e:(null!=y?y:0)+e,u=h===l-1,c=0===h,f=e>0;if(u&&j(a.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`}),!d&&r>2&&!f)return void(o?t():b(w[0]));if(!d&&r>2&&f&&w&&n)return void b(w[n.length-1]);let p=null==w?void 0:w.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-i)<Math.abs(e-i)?t:e),m=R(s)?window.innerHeight:window.innerWidth;if(r>.4&&Math.abs(e)<.4*m){let e=f?1:-1;return e>0&&g&&n?void b(w[n.length-1]):void(c&&e<0&&o&&t(),null===h||b(w[h+e]))}b(p)},onDrag:function({draggedDistance:e}){if(null===y)return;let t="bottom"===s||"right"===s?y-e:y+e;("bottom"===s||"right"===s)&&t<w[w.length-1]||("top"===s||"left"===s)&&t>w[w.length-1]||j(r.current,{transform:R(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:w}}({snapPoints:m,activeSnapPointProp:O,setActiveSnapPointProp:L,drawerRef:ew,fadeFromIndex:z,overlayRef:ei,onSnapPointChange:eD,direction:W,container:J,snapToSequentialPoint:U});!function(e={}){let{isDisabled:n}=e;c(()=>{if(!n){var e,r,a;let n,o,l,i,s,d,c;return 1==++v&&u()&&(l=0,i=window.pageXOffset,s=window.pageYOffset,d=f((e=document.documentElement,r="paddingRight",a=`${window.innerWidth-document.documentElement.clientWidth}px`,n=e.style[r],e.style[r]=a,()=>{e.style[r]=n})),window.scrollTo(0,0),c=f(w(document,"touchstart",e=>{((o=g(e.target))!==document.documentElement||o!==document.body)&&(l=e.changedTouches[0].pageY)},{passive:!1,capture:!0}),w(document,"touchmove",e=>{if(!o||o===document.documentElement||o===document.body)return void e.preventDefault();let t=e.changedTouches[0].pageY,n=o.scrollTop,r=o.scrollHeight-o.clientHeight;0!==r&&((n<=0&&t>l||n>=r&&t<l)&&e.preventDefault(),l=t)},{passive:!1,capture:!0}),w(document,"touchend",e=>{let t=e.target;b(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},{passive:!1,capture:!0}),w(document,"focus",e=>{let t=e.target;b(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",p&&(p.height<window.innerHeight?requestAnimationFrame(()=>{y(t)}):p.addEventListener("resize",()=>y(t),{once:!0}))}))},!0),w(window,"scroll",()=>{window.scrollTo(0,0)})),t=()=>{d(),c(),window.scrollTo(i,s)}),()=>{0==--v&&(null==t||t())}}},[n])}({isDisabled:!Z||er||!F||eo||!et||!V||!Y});let{restorePositionSetting:ek}=function({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:a,noBodyStyles:l}){let[i,u]=o.default.useState(()=>"u">typeof window?window.location.href:""),d=o.default.useRef(0),c=o.default.useCallback(()=>{if(s()&&null===P&&e&&!l){P={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-d.current}px`,left:`${-e}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&d.current>=t&&(document.body.style.top=`${-(d.current+e)}px`)}),300)}},[e]),f=o.default.useCallback(()=>{if(s()&&null!==P&&!l){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,P),window.requestAnimationFrame(()=>{a&&i!==window.location.href?u(window.location.href):window.scrollTo(t,e)}),P=null}},[i]);return o.default.useEffect(()=>{function e(){d.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),o.default.useEffect(()=>{if(t)return()=>{"u"<typeof document||document.querySelector("[data-vaul-drawer]")||f()}},[t,f]),o.default.useEffect(()=>{!n&&r&&(e?(window.matchMedia("(display-mode: standalone)").matches||c(),t||window.setTimeout(()=>{f()},500)):f())},[e,r,i,t,n,c,f]),{restorePositionSetting:f}}({isOpen:Z,modal:F,nested:null!=I&&I,hasBeenOpened:et,preventScrollRestoration:X,noBodyStyles:H});function eP(){return(window.innerWidth-26)/window.innerWidth}function eM(e,t){var n;let r=e,a=null==(n=window.getSelection())?void 0:n.toString(),o=ew.current?C(ew.current,W):null,l=new Date;if("SELECT"===r.tagName||r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===W||"left"===W)return!0;if(es.current&&l.getTime()-es.current.getTime()<500)return!1;if(null!==o&&("bottom"===W?o>0:o<0))return!0;if(a&&a.length>0)return!1;if(ec.current&&l.getTime()-ec.current.getTime()<S&&0===o||t)return ec.current=l,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return ec.current=new Date,!1;if("dialog"===r.getAttribute("role"))break}r=r.parentNode}return!0}function ez(e){er&&ew.current&&(ew.current.classList.remove(E),ef.current=!1,ea(!1),ed.current=new Date),null==A||A(),e||ee(!1),setTimeout(()=>{m&&eC(m[0])},500)}function eO(){if(!ew.current)return;let e=document.querySelector("[data-vaul-drawer-wrapper]"),t=C(ew.current,W);j(ew.current,{transform:"translate3d(0, 0, 0)",transition:`transform 0.5s cubic-bezier(${N.join(",")})`}),j(ei.current,{transition:`opacity 0.5s cubic-bezier(${N.join(",")})`,opacity:"1"}),h&&t&&t>0&&Z&&j(e,{borderRadius:"8px",overflow:"hidden",...R(W)?{transform:`scale(${eP()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${eP()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${N.join(",")})`},!0)}return o.default.useEffect(()=>{window.requestAnimationFrame(()=>{eh.current=!0})},[]),o.default.useEffect(()=>{var e;function t(){if(ew.current&&V&&(b(document.activeElement)||eg.current)){var e;let t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight,r=n-t,a=ew.current.getBoundingClientRect().height||0;ex.current||(ex.current=a);let o=ew.current.getBoundingClientRect().top;if(Math.abs(ev.current-r)>60&&(eg.current=!eg.current),m&&m.length>0&&eN&&eR&&(r+=eN[eR]||0),ev.current=r,a>t||eg.current){let e=ew.current.getBoundingClientRect().height,l=e;e>t&&(l=t-(a>.8*n?o:26)),B?ew.current.style.height=`${e-Math.max(r,0)}px`:ew.current.style.height=`${Math.max(l,t-o)}px`}else{let e;e=navigator.userAgent,"u">typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))||(ew.current.style.height=`${ex.current}px`)}m&&m.length>0&&!eg.current?ew.current.style.bottom="0px":ew.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[eR,m,eN]),o.default.useEffect(()=>(Z&&(j(document.documentElement,{scrollBehavior:"auto"}),es.current=new Date),()=>{!function(e,t){if(!e||!(e instanceof HTMLElement))return;let n=D.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[Z]),o.default.useEffect(()=>{F||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[F]),o.default.createElement(a.Root,{defaultOpen:q,onOpenChange:e=>{(k||e)&&(e?en(!0):ez(!0),ee(e))},open:Z},o.default.createElement(l.Provider,{value:{activeSnapPoint:ej,snapPoints:m,setActiveSnapPoint:eC,drawerRef:ew,overlayRef:ei,onOpenChange:n,onPress:function(e){var t,n;!k&&!m||(!ew.current||ew.current.contains(e.target))&&(ey.current=(null==(t=ew.current)?void 0:t.getBoundingClientRect().height)||0,eb.current=(null==(n=ew.current)?void 0:n.getBoundingClientRect().width)||0,ea(!0),eu.current=new Date,u()&&window.addEventListener("touchend",()=>ef.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),em.current=R(W)?e.pageY:e.pageX)},onRelease:function(e){var t,n;if(!er||!ew.current)return;ew.current.classList.remove(E),ef.current=!1,ea(!1),ed.current=new Date;let r=C(ew.current,W);if(!e||!eM(e.target,!1)||!r||Number.isNaN(r)||null===eu.current)return;let a=ed.current.getTime()-eu.current.getTime(),o=em.current-(R(W)?e.pageY:e.pageX),l=Math.abs(o)/a;if(l>.05&&(el(!0),setTimeout(()=>{el(!1)},200)),m){eT({draggedDistance:o*("bottom"===W||"right"===W?1:-1),closeDrawer:ez,velocity:l,dismissible:k}),null==d||d(e,!0);return}if("bottom"===W||"right"===W?o>0:o<0){eO(),null==d||d(e,!0);return}if(l>.4){ez(),null==d||d(e,!1);return}let i=Math.min(null!=(t=ew.current.getBoundingClientRect().height)?t:0,window.innerHeight),s=Math.min(null!=(n=ew.current.getBoundingClientRect().width)?n:0,window.innerWidth);if(Math.abs(r)>=("left"===W||"right"===W?s:i)*T){ez(),null==d||d(e,!1);return}null==d||d(e,!0),eO()},onDrag:function(e){if(ew.current&&er){let t="bottom"===W||"right"===W?1:-1,n=(em.current-(R(W)?e.pageY:e.pageX))*t,r=n>0,a=m&&!k&&!r;if(a&&0===eR)return;let o=Math.abs(n),l=document.querySelector("[data-vaul-drawer-wrapper]"),s=o/("bottom"===W||"top"===W?ey.current:eb.current),u=e$(o,r);if(null!==u&&(s=u),a&&s>=1||!ef.current&&!eM(e.target,r))return;if(ew.current.classList.add(E),ef.current=!0,j(ew.current,{transition:"none"}),j(ei.current,{transition:"none"}),m&&eE({draggedDistance:n}),r&&!m){let e=Math.min(-(8*(Math.log(n+1)-2)*1),0)*t;j(ew.current,{transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`});return}let d=1-s;if((eS||z&&eR===z-1)&&(null==i||i(e,s),j(ei.current,{opacity:`${d}`,transition:"none"},!0)),l&&ei.current&&h){let e=Math.min(eP()+s*(1-eP()),1),t=8-8*s,n=Math.max(0,14-14*s);j(l,{borderRadius:`${t}px`,transform:R(W)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!m){let e=o*t;j(ew.current,{transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:k,shouldAnimate:eh,handleOnly:M,isOpen:Z,isDragging:er,shouldFade:eS,closeDrawer:ez,onNestedDrag:function(e,t){if(t<0)return;let n=(window.innerWidth-16)/window.innerWidth,r=n+t*(1-n),a=-16+16*t;j(ew.current,{transform:R(W)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){let t=e?(window.innerWidth-16)/window.innerWidth:1,n=e?-16:0;ep.current&&window.clearTimeout(ep.current),j(ew.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(W)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&ew.current&&(ep.current=setTimeout(()=>{let e=C(ew.current,W);j(ew.current,{transition:"none",transform:R(W)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){let n=R(W)?window.innerHeight:window.innerWidth,r=t?(n-16)/n:1,a=t?-16:0;t&&j(ew.current,{transition:`transform 0.5s cubic-bezier(${N.join(",")})`,transform:R(W)?`scale(${r}) translate3d(0, ${a}px, 0)`:`scale(${r}) translate3d(${a}px, 0, 0)`})},keyboardIsOpen:eg,modal:F,snapPointsOffset:eN,activeSnapPointIndex:eR,direction:W,shouldScaleBackground:h,setBackgroundColorOnScale:x,noBodyStyles:H,container:J,autoFocus:_}},r))}let z=o.default.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:l,shouldFade:s,isOpen:u,modal:d,shouldAnimate:c}=i(),f=x(t,n),p=r&&r.length>0;if(!d)return null;let m=o.default.useCallback(e=>l(e),[l]);return o.default.createElement(a.Overlay,{onMouseUp:m,ref:f,"data-vaul-overlay":"","data-vaul-snap-points":u&&p?"true":"false","data-vaul-snap-points-overlay":u&&s?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...e})});z.displayName="Drawer.Overlay";let O=o.default.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},l){let{drawerRef:s,onPress:u,onRelease:d,onDrag:c,keyboardIsOpen:f,snapPointsOffset:p,activeSnapPointIndex:m,modal:g,isOpen:h,direction:v,snapPoints:w,container:y,handleOnly:b,shouldAnimate:D,autoFocus:j}=i(),[C,E]=o.default.useState(!1),S=x(l,s),$=o.default.useRef(null),P=o.default.useRef(null),M=o.default.useRef(!1),z=w&&w.length>0;function O(e){$.current=null,M.current=!1,d(e)}return!function(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:a}=i(),l=o.default.useRef(null),s=(0,o.useMemo)(()=>document.body.style.backgroundColor,[]);function u(){return(window.innerWidth-26)/window.innerWidth}o.default.useEffect(()=>{if(t&&n){l.current&&clearTimeout(l.current);let t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;!function(...e){}(r&&!a?T(document.body,{background:"black"}):k,T(t,{transformOrigin:R(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:"0.5s",transitionTimingFunction:`cubic-bezier(${N.join(",")})`}));let n=T(t,{borderRadius:"8px",overflow:"hidden",...R(e)?{transform:`scale(${u()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${u()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),l.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},500)}}},[t,n,s])}(),o.default.useEffect(()=>{z&&window.requestAnimationFrame(()=>{E(!0)})},[]),o.default.createElement(a.Content,{"data-vaul-drawer-direction":v,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":h&&z?"true":"false","data-vaul-custom-container":y?"true":"false","data-vaul-animate":(null==D?void 0:D.current)?"true":"false",...r,ref:S,style:p&&p.length>0?{"--snap-point-height":`${p[null!=m?m:0]}px`,...t}:t,onPointerDown:e=>{b||(null==r.onPointerDown||r.onPointerDown.call(r,e),$.current={x:e.pageX,y:e.pageY},u(e))},onOpenAutoFocus:e=>{null==n||n(e),j||e.preventDefault()},onPointerDownOutside:t=>{(null==e||e(t),!g||t.defaultPrevented)?t.preventDefault():f.current&&(f.current=!1)},onFocusOutside:e=>{if(!g)return void e.preventDefault()},onPointerMove:e=>{if(P.current=e,b||(null==r.onPointerMove||r.onPointerMove.call(r,e),!$.current))return;let t=e.pageY-$.current.y,n=e.pageX-$.current.x,a="touch"===e.pointerType?10:2;((e,t,n=0)=>{if(M.current)return!0;let r=Math.abs(e.y),a=Math.abs(e.x),o=a>r,l=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*l<0)&&a>=0&&a<=n)return o}else if(!(e.y*l<0)&&r>=0&&r<=n)return!o;return M.current=!0,!0})({x:n,y:t},v,a)?c(e):(Math.abs(n)>a||Math.abs(t)>a)&&($.current=null)},onPointerUp:e=>{null==r.onPointerUp||r.onPointerUp.call(r,e),$.current=null,M.current=!1,d(e)},onPointerOut:e=>{null==r.onPointerOut||r.onPointerOut.call(r,e),O(P.current)},onContextMenu:e=>{null==r.onContextMenu||r.onContextMenu.call(r,e),P.current&&O(P.current)}})});O.displayName="Drawer.Content";let L=o.default.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:a,isDragging:l,snapPoints:s,activeSnapPoint:u,setActiveSnapPoint:d,dismissible:c,handleOnly:f,isOpen:p,onPress:m,onDrag:g}=i(),h=o.default.useRef(null),v=o.default.useRef(!1);function w(){h.current&&window.clearTimeout(h.current),v.current=!1}return o.default.createElement("div",{onClick:function(){v.current?w():window.setTimeout(()=>{!function(){if(l||e||v.current)return w();if(w(),!s||0===s.length){c||a();return}if(u===s[s.length-1]&&c)return a();let t=s.findIndex(e=>e===u);-1===t||d(s[t+1])}()},120)},onPointerCancel:w,onPointerDown:e=>{f&&m(e),h.current=window.setTimeout(()=>{v.current=!0},250)},onPointerMove:e=>{f&&g(e)},ref:r,"data-vaul-drawer-visible":p?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},o.default.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});L.displayName="Drawer.Handle";let B={Root:M,NestedRoot:function({onDrag:e,onOpenChange:t,open:n,...r}){let{onNestedDrag:a,onNestedOpenChange:l,onNestedRelease:s}=i();if(!a)throw Error("Drawer.NestedRoot must be placed in another drawer");return o.default.createElement(M,{nested:!0,open:n,onClose:()=>{l(!1)},onDrag:(t,n)=>{a(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&l(e),null==t||t(e)},onRelease:s,...r})},Content:O,Overlay:z,Trigger:a.Trigger,Portal:function(e){let t=i(),{container:n=t.container,...r}=e;return o.default.createElement(a.Portal,{container:n,...r})},Handle:L,Close:a.Close,Title:a.Title,Description:a.Description};var F=e.i(31777);function A({...e}){return(0,n.jsx)(B.Root,{"data-slot":"drawer",...e})}function I({...e}){return(0,n.jsx)(B.Portal,{"data-slot":"drawer-portal",...e})}function H({className:e,...t}){return(0,n.jsx)(B.Overlay,{"data-slot":"drawer-overlay",className:(0,F.cn)("fixed inset-0 z-50 bg-black/50",e),...t})}function W({className:e,children:t,direction:a="bottom",showCloseButton:o=!0,...l}){return(0,n.jsx)(I,{children:(0,n.jsxs)(B.Content,{"data-slot":"drawer-content",className:(0,F.cn)("bg-background fixed z-50 flex flex-col shadow-lg","bottom"===a&&"inset-x-0 bottom-0 mb-24 rounded-t-lg border-t","top"===a&&"inset-x-0 top-0 mt-24 rounded-b-lg border-b","right"===a&&"inset-y-0 right-0 h-full w-3/4 border-l","left"===a&&"inset-y-0 left-0 h-full w-3/4 border-r",e),style:{"--initial-transform":"right"===a?"calc(100% + 8px)":"left"===a||"top"===a?"calc(-100% - 8px)":"calc(100% + 8px)",userSelect:"text",...l.style??{}},...l,children:[t,o?(0,n.jsxs)(B.Close,{className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[(0,n.jsx)(r.XIcon,{className:"size-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]}):null]})})}function q({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-header",className:(0,F.cn)("flex flex-col gap-1.5 p-4",e),...t})}function Y({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"drawer-footer",className:(0,F.cn)("mt-auto flex flex-col gap-2 p-4",e),...t})}function U({className:e,...t}){return(0,n.jsx)(B.Title,{"data-slot":"drawer-title",className:(0,F.cn)("text-foreground font-semibold",e),...t})}function X({className:e,...t}){return(0,n.jsx)(B.Description,{"data-slot":"drawer-description",className:(0,F.cn)("text-muted-foreground text-sm",e),...t})}e.s(["Drawer",()=>A,"DrawerContent",()=>W,"DrawerDescription",()=>X,"DrawerFooter",()=>Y,"DrawerHeader",()=>q,"DrawerOverlay",()=>H,"DrawerTitle",()=>U],45811)},11495,e=>{"use strict";var t=e.i(20314),n=e.i(79054),r=e.i(48249),a=e.i(24042),o=e.i(64970),l=e.i(94237),i=e.i(31777);e.i(81803);var s=e.i(72714);e.i(99348);var u=e.i(17466),d=e.i(45811),c=e.i(25235),f=e.i(2828),p=e.i(8537),m=e.i(75921);let g=(0,l.cva)("",{variants:{size:{sm:"w-96",md:"w-xl"}},defaultVariants:{size:"sm"}});function h({open:e,onClose:a,modal:o=!1,dismissOnOutsideClick:l=!1,title:s="Drawer",size:u,header:f,children:p,footer:h,className:w,"data-testid":y,deployTarget:b}){let x=(0,m.useFeatureFlags)(),D=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!e||o)return;let t=e=>{let t=e.target;!document.body.contains(t)||D.current?.contains(t)||t.closest(l?'[role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]':'[data-no-drawer-close], [role="alertdialog"], [role="dialog"], [role="menu"], [role="listbox"], [data-radix-popper-content-wrapper]')||a()};return document.addEventListener("click",t),()=>document.removeEventListener("click",t)},[e,o,a,l]),(0,t.jsxs)(d.Drawer,{direction:"right",modal:o,handleOnly:!0,open:e,onOpenChange:e=>{e||a()},children:[o?(0,t.jsx)(d.DrawerOverlay,{}):null,(0,t.jsxs)(d.DrawerContent,{ref:D,direction:"right",showCloseButton:!1,className:(0,i.cn)(g({size:u}),w),"data-testid":y,onInteractOutside:o?void 0:e=>e.preventDefault(),children:[(0,t.jsx)(d.DrawerTitle,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsx)(d.DrawerDescription,{asChild:!0,children:(0,t.jsx)("span",{className:"sr-only",children:s})}),(0,t.jsxs)("button",{type:"button","aria-label":"Close",onClick:a,className:"ring-offset-background focus:ring-ring absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden","data-testid":y?`${y}-close-button`:void 0,children:[(0,t.jsx)(r.XIcon,{className:"size-4"}),(0,t.jsx)("span",{className:"sr-only",children:"Close"})]}),f?(0,t.jsx)(d.DrawerHeader,{className:"shrink-0",children:f}):null,f?(0,t.jsx)(c.Separator,{}):null,x.envDeploy&&b?(0,t.jsx)(v,{deployTarget:b}):null,(0,t.jsx)("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:p}),h?(0,t.jsx)(d.DrawerFooter,{className:"shrink-0",children:h}):null]})]})}function v({deployTarget:e}){let n=(0,p.useDeployAction)(e),r="Booting"===n.status||"Ready"===n.status;return(0,t.jsxs)("div",{"data-testid":"base-drawer-deploy-bar",className:"flex items-center gap-2 px-4 pb-3",children:[(0,t.jsx)(f.TooltipProvider,{children:(0,t.jsxs)(f.Tooltip,{children:[(0,t.jsx)(f.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{children:(0,t.jsx)(s.ActionButton,{label:r?"Stop Dev Server":"Start Dev Server",onClick:r?n.stop:n.deploy,loading:n.deployLoading||n.stopLoading,error:!!n.deployError,icon:r?o.Square:a.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,t.jsx)(f.TooltipContent,{children:r?"Stop Dev Server":"Start Dev Server"})]})}),r?(0,t.jsx)(u.DeploymentStatusBadge,{status:n.status,url:n.url,targetId:e.targetId}):null]})}e.s(["BaseDrawer",()=>h])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},95230,e=>{"use strict";let t=(0,e.i(3645).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["default",()=>t])},16868,48306,80436,28267,86254,50032,42076,e=>{"use strict";var t=e.i(3645);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(["PaperclipIcon",()=>r],16868);var a=e.i(20314),o=e.i(31777);function s({className:e,...t}){return(0,a.jsx)("textarea",{"data-slot":"textarea",className:(0,o.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...t})}e.s(["Textarea",()=>s],48306);var i=e.i(60253),n=e.i(15506),n=n,l=e.i(95230);e.s(["DownloadIcon",()=>l.default],80436);var l=l,d=e.i(2287),c=e.i(1693);e.s(["VisuallyHidden",0,c],28267);var c=c;let u=(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"}]]);var p=e.i(16298),p=p;let h=(0,t.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 m=e.i(93752),m=m;e.i(35364);let x=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),f=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function g(e){if(0===e)return"0 B";let t=Math.floor(Math.log(e)/Math.log(1024));return`${(e/Math.pow(1024,t)).toFixed(+(0!==t))} ${["B","KB","MB","GB"][t]}`}let b=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function v(e,t){let r=new URLSearchParams({path:e,mimeType:t});return`/api/attachments/preview?${r.toString()}`}function j({name:e,size:t,mimeType:r,path:s,onRemove:j,loading:w=!1,disabled:y=!1}){let C,k,N=(C=e.lastIndexOf("."))>=0?e.slice(C).toLowerCase():"",P=x.has(N)?h:".pdf"===N?p.default:f.has(N)?m.default:u,T=".pdf"===N?"bg-red-50 text-red-600":x.has(N)?"bg-blue-50 text-blue-600":f.has(N)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",S=(k=e.lastIndexOf("."))>=0&&b.has(e.slice(k).toLowerCase());return w?(0,a.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,a.jsx)(n.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):S?(0,a.jsxs)(d.Dialog,{children:[(0,a.jsxs)("div",{className:"group relative",children:[(0,a.jsx)(d.DialogTrigger,{asChild:!0,children:(0,a.jsx)("img",{src:v(s,r),alt:e,title:e,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,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,a.jsx)(i.X,{className:"h-3 w-3"})})]}),(0,a.jsxs)(d.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,a.jsx)(c.Root,{children:(0,a.jsxs)(d.DialogTitle,{children:["Preview: ",e]})}),(0,a.jsx)("div",{className:"relative bg-black/90",children:(0,a.jsx)("img",{src:v(s,r),alt:e,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,a.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,a.jsx)("span",{className:"truncate text-sm font-medium",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)})]}),(0,a.jsx)("a",{href:v(s,r),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,a.jsx)(l.default,{className:"h-4 w-4"})})]})]})]}):(0,a.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,a.jsx)("div",{className:(0,o.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",T),children:(0,a.jsx)(P,{className:"h-3 w-3"})}),(0,a.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:e}),(0,a.jsx)("span",{className:"text-muted-foreground text-xs",children:g(t)}),!y&&(0,a.jsx)("button",{type:"button",onClick:j,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,a.jsx)(i.X,{className:"h-3 w-3"})})]})}async function w(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["AttachmentChip",()=>j],86254),e.s([],50032),e.s(["pickFiles",()=>w],42076)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),o=e.i(5978),s=e.i(22528),i=e.i(53532),n=e.i(41687),l=e.i(56720),d=e.i(13123),c=e.i(52740),u=e.i(39979),p=e.i(85995),h=e.i(87620),m=e.i(86874),x=e.i(36589),f=e.i(73772),g=e.i(13044),b="Popover",[v,j]=(0,s.createContextScope)(b,[c.createPopperScope]),w=(0,c.createPopperScope)(),[y,C]=v(b),k=e=>{let{__scopePopover:a,children:o,open:s,defaultOpen:i,onOpenChange:n,modal:l=!1}=e,u=w(a),p=r.useRef(null),[h,m]=r.useState(!1),[f,g]=(0,x.useControllableState)({prop:s,defaultProp:i??!1,onChange:n,caller:b});return(0,t.jsx)(c.Root,{...u,children:(0,t.jsx)(y,{scope:a,contentId:(0,d.useId)(),triggerRef:p,open:f,onOpenChange:g,onOpenToggle:r.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>m(!0),[]),onCustomAnchorRemove:r.useCallback(()=>m(!1),[]),modal:l,children:o})})};k.displayName=b;var N="PopoverAnchor",P=r.forwardRef((e,a)=>{let{__scopePopover:o,...s}=e,i=C(N,o),n=w(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:d}=i;return r.useEffect(()=>(l(),()=>d()),[l,d]),(0,t.jsx)(c.Anchor,{...n,...s,ref:a})});P.displayName=N;var T="PopoverTrigger",S=r.forwardRef((e,r)=>{let{__scopePopover:s,...i}=e,n=C(T,s),l=w(s),d=(0,o.useComposedRefs)(r,n.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":q(n.open),...i,ref:d,onClick:(0,a.composeEventHandlers)(e.onClick,n.onOpenToggle)});return n.hasCustomAnchor?u:(0,t.jsx)(c.Anchor,{asChild:!0,...l,children:u})});S.displayName=T;var R="PopoverPortal",[A,D]=v(R,{forceMount:void 0}),E=e=>{let{__scopePopover:r,forceMount:a,children:o,container:s}=e,i=C(R,r);return(0,t.jsx)(A,{scope:r,forceMount:a,children:(0,t.jsx)(p.Presence,{present:a||i.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:s,children:o})})})};E.displayName=R;var F="PopoverContent",O=r.forwardRef((e,r)=>{let a=D(F,e.__scopePopover),{forceMount:o=a.forceMount,...s}=e,i=C(F,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||i.open,children:i.modal?(0,t.jsx)(I,{...s,ref:r}):(0,t.jsx)(M,{...s,ref:r})})});O.displayName=F;var z=(0,m.createSlot)("PopoverContent.RemoveScroll"),I=r.forwardRef((e,s)=>{let i=C(F,e.__scopePopover),n=r.useRef(null),l=(0,o.useComposedRefs)(s,n),d=r.useRef(!1);return r.useEffect(()=>{let e=n.current;if(e)return(0,f.hideOthers)(e)},[]),(0,t.jsx)(g.RemoveScroll,{as:z,allowPinchZoom:!0,children:(0,t.jsx)(L,{...e,ref:l,trapFocus:i.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),d.current||i.triggerRef.current?.focus()}),onPointerDownOutside:(0,a.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;d.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),M=r.forwardRef((e,a)=>{let o=C(F,e.__scopePopover),s=r.useRef(!1),i=r.useRef(!1);return(0,t.jsx)(L,{...e,ref:a,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(s.current||o.triggerRef.current?.focus(),t.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(s.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let r=t.target;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),L=r.forwardRef((e,r)=>{let{__scopePopover:a,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:d,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:x,...f}=e,g=C(F,a),b=w(a);return(0,n.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:d,children:(0,t.jsx)(i.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:x,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:m,onDismiss:()=>g.onOpenChange(!1),children:(0,t.jsx)(c.Content,{"data-state":q(g.open),role:"dialog",id:g.contentId,...b,...f,ref:r,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),U="PopoverClose",B=r.forwardRef((e,r)=>{let{__scopePopover:o,...s}=e,i=C(U,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...s,ref:r,onClick:(0,a.composeEventHandlers)(e.onClick,()=>i.onOpenChange(!1))})});B.displayName=U;var $=r.forwardRef((e,r)=>{let{__scopePopover:a,...o}=e,s=w(a);return(0,t.jsx)(c.Arrow,{...s,...o,ref:r})});function q(e){return e?"open":"closed"}$.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>$,"Close",()=>B,"Content",()=>O,"Popover",()=>k,"PopoverAnchor",()=>P,"PopoverArrow",()=>$,"PopoverClose",()=>B,"PopoverContent",()=>O,"PopoverPortal",()=>E,"PopoverTrigger",()=>S,"Portal",()=>E,"Root",()=>k,"Trigger",()=>S,"createPopoverScope",()=>j],89920);var H=e.i(89920),H=H,G=e.i(31777);let _=H.Root,K=H.Trigger;H.Anchor;let V=r.forwardRef(({className:e,align:r="center",sideOffset:a=4,...o},s)=>(0,t.jsx)(H.Portal,{children:(0,t.jsx)(H.Content,{ref:s,align:r,sideOffset:a,className:(0,G.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));V.displayName=H.Content.displayName,e.s(["Popover",()=>_,"PopoverContent",()=>V,"PopoverTrigger",()=>K],90382)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),o=e.i(5978),s=e.i(22528),i=e.i(36589),n=e.i(23405),l=e.i(77624),d=e.i(87620),c="Switch",[u,p]=(0,s.createContextScope)(c),[h,m]=u(c),x=r.forwardRef((e,s)=>{let{__scopeSwitch:n,name:l,checked:u,defaultChecked:p,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...w}=e,[y,C]=r.useState(null),k=(0,o.useComposedRefs)(s,e=>C(e)),N=r.useRef(!1),P=!y||j||!!y.closest("form"),[T,S]=(0,i.useControllableState)({prop:u,defaultProp:p??!1,onChange:g,caller:c});return(0,t.jsxs)(h,{scope:n,checked:T,disabled:x,children:[(0,t.jsx)(d.Primitive.button,{type:"button",role:"switch","aria-checked":T,"aria-required":m,"data-state":v(T),"data-disabled":x?"":void 0,disabled:x,value:f,...w,ref:k,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),P&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),P&&(0,t.jsx)(b,{control:y,bubbles:!N.current,name:l,value:f,checked:T,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=c;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...o}=e,s=m(f,a);return(0,t.jsx)(d.Primitive.span,{"data-state":v(s.checked),"data-disabled":s.disabled?"":void 0,...o,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:s,bubbles:i=!0,...d},c)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,c),h=(0,n.usePrevious)(s),m=(0,l.useSize)(a);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==s&&t){let r=new Event("click",{bubbles:i});t.call(e,s),e.dispatchEvent(r)}},[h,s,i]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s,...d,tabIndex:-1,ref:p,style:{...d.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function v(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>p],95291);var j=e.i(95291),j=j,w=e.i(31777);function y({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,w.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,w.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>y],51911)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(23925),o=e.i(11345),s=e.i(76016),i=e.i(46421),n=e.i(17543),l=e.i(86782),d=e.i(29847),c=e.i(35364),u=e.i(90382),p=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:m,disabled:x,className:f,mode:g}){let[b,v]=r.useState(!1),[j,w]=r.useState([]),[y,C]=r.useState(!0),[k,N]=r.useState(e),[P,T]=r.useState(h),[S,R]=r.useState(null),[A,D]=r.useState(0),[E,F]=r.useState(null);r.useEffect(()=>{(0,i.getAllAgentModels)().then(w).finally(()=>C(!1))},[]),r.useEffect(()=>{if(!b){let e=setTimeout(()=>{D(0),F(null)},150);return()=>clearTimeout(e)}},[b]);let O=async(e,t)=>{if(v(!1),e!==k||t!==P){if("override"===g){N(e),T(t),m?.(e,t);return}N(e),T(t),m?.(e,t),R(null);try{let r=await (0,n.updateAgentAndModel)(e,t||null);r.ok||(N(k),T(P),m?.(k,P),R(r.error??"Failed to save"))}catch{N(k),T(P),m?.(k,P),R("Failed to save")}}},z=(0,l.getAgentTypeIcon)(k),I=j.find(e=>e.agentType===k)?.label??k,M=P?(0,d.getModelMeta)(P).displayName||P:null,L=E?j.find(e=>e.agentType===E):null;return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-1",f),children:[(0,t.jsxs)(u.Popover,{open:b,onOpenChange:v,children:[(0,t.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"outline",role:"combobox","aria-expanded":b,disabled:(x??!1)||y,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(z,{className:"h-4 w-4 shrink-0"}),y?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:I}),M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:M})]}):null]})]})})}),(0,t.jsx)(u.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===A?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),j.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),o=k===e.agentType,i=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{i?(F(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>D(1))})):O(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!i?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,i?(0,t.jsx)(s.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:L?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{D(0),setTimeout(()=>F(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),L.label]}),L.models.map(e=>{let r=k===L.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>O(L.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(a.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!S&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:S})]})}e.s(["AgentModelPicker",()=>h])},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),o=e.i(60112),s=e.i(21023);let i=(0,s.createServerReference)("4088afd493b2607898ddd07ba9a679765298503063",s.callServer,void 0,s.findSourceMapURL,"createFeature");var n=e.i(16868);let l=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var d=e.i(97667),c=e.i(53360),u=e.i(31777),p=e.i(8361);e.i(1650);var h=e.i(11495),m=e.i(45811),x=e.i(35364),f=e.i(98127),g=e.i(48306),b=e.i(41957),v=e.i(81846),j=e.i(90382),w=e.i(51911),y=e.i(2828),C=e.i(30153);e.i(50032);var k=e.i(86254),N=e.i(41413),P=e.i(42076);let T=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"]),S=[{id:"allowPrd",label:"PRD",description:"Auto-approve requirements move to planning."},{id:"allowPlan",label:"Plan",description:"Auto-approve planning move to implementation."},{id:"allowMerge",label:"Merge",description:"Auto-approve merge move to Done."}],R={allowPrd:!1,allowPlan:!1,allowMerge:!1};function A({open:e,onClose:a,onSubmit:o,repositoryPath:s,isSubmitting:i=!1,workflowDefaults:l,features:d,initialParentId:f,currentAgentType:j,currentModel:A}){let E=(0,p.useSoundAction)("create"),F=l?.approvalGates??R,O=l?.push??!1,z=l?.openPr??!1,I=l?.enableEvidence??!1,M=l?.commitEvidence??!1,[L,U]=(0,r.useState)(""),[B,$]=(0,r.useState)([]),[q,H]=(0,r.useState)({...F}),[G,_]=(0,r.useState)(O),[K,V]=(0,r.useState)(z),[X,W]=(0,r.useState)(I),[Z,J]=(0,r.useState)(M),[Y,Q]=(0,r.useState)(void 0),[ee,et]=(0,r.useState)(!1),[er,ea]=(0,r.useState)(void 0),[eo,es]=(0,r.useState)(void 0),[ei,en]=(0,r.useState)(!1),[el,ed]=(0,r.useState)(null),[ec,eu]=(0,r.useState)(!1),ep=(0,r.useRef)(crypto.randomUUID()),eh=(0,r.useRef)(0),em=(0,r.useRef)(null);(0,r.useEffect)(()=>{l&&(H({...l.approvalGates}),_(l.push),V(l.openPr),W(l.enableEvidence),J(l.commitEvidence))},[l]),(0,r.useEffect)(()=>{e&&f&&Q(f)},[e,f]);let ex=(0,r.useCallback)(()=>{U(""),$([]),H({...F}),_(O),V(z),W(I),J(M),Q(void 0),et(!1),ea(void 0),es(void 0),ed(null),eh.current=0,en(!1)},[F,O,z,I,M]),ef=""!==L.trim()||B.length>0,{attemptClose:eg}=(0,C.useGuardedDrawerClose)({open:e,isDirty:ef,onClose:a,onReset:ex}),eb=(0,r.useCallback)(async e=>{for(let t of(ed(null),e)){if(t.size>0xa00000)return void ed(`"${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&&!T.has(e))return void ed(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();$(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",ep.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));$(t=>t.filter(t=>t.id!==e)),ed(t.error??"Upload failed");return}let o=await a.json();$(t=>t.some(t=>t.id!==e&&t.path===o.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...o,id:e,loading:!1}:t))}catch{$(t=>t.filter(t=>t.id!==e)),ed("Upload failed")}}},[]),ev=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eh.current+=1,1===eh.current&&en(!0)},[]),ej=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eh.current-=1,0===eh.current&&en(!1)},[]),ew=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),ey=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eh.current=0,en(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eb(t)},[eb]),eC=(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(),eb(r))},[eb]),ek=(0,r.useCallback)(e=>{e.preventDefault(),L.trim()&&(E.play(),o({description:L.trim(),attachments:B.filter(e=>!e.loading),repositoryPath:s,approvalGates:{allowPrd:q.allowPrd??!1,allowPlan:q.allowPlan??!1,allowMerge:q.allowMerge??!1},push:G||K,openPr:K,enableEvidence:X,commitEvidence:Z,fast:ee,...er?{agentType:er}:{},...eo?{model:eo}:{},...Y?{parentId:Y}:{},sessionId:ep.current}),ex())},[L,B,q,s,o,G,K,X,Z,ee,er,eo,Y,E,ex]),eN=(0,r.useCallback)(async()=>{try{let e=await (0,P.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();$(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:ep.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));$(t=>t.filter(t=>t.id!==e)),ed(t.error??"Upload failed");return}let a=await r.json();$(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{$(t=>t.filter(t=>t.id!==e)),ed("Upload failed")}}}catch{}},[]),eP=(0,r.useCallback)(e=>{$(t=>t.filter(t=>t.id!==e))},[]),eT=(0,r.useRef)(null),eS=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),eT.current?.requestSubmit())},[]),eR=(0,r.useCallback)(()=>{eu(!0)},[]),eA=(0,r.useCallback)(()=>{setTimeout(()=>{let e=em.current?.contains(document.activeElement),t=em.current?.querySelector('[aria-expanded="true"]')!==null;e||t||eu(!1)},0)},[]),eD=d&&d.length>0;return(0,t.jsx)(h.BaseDrawer,{open:e,onClose:eg,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)(m.DrawerTitle,{children:"NEW FEATURE"})]}),i?(0,t.jsx)(m.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(v.Badge,{variant:"secondary",children:"Creating..."})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(x.Button,{variant:"outline",onClick:eg,disabled:i,children:"Cancel"}),(0,t.jsx)(x.Button,{type:"submit",form:"create-feature-form",disabled:!L.trim()||i,children:i?"Creating...":"+ Create Feature"})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(y.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:eT,id:"create-feature-form",onSubmit:ek,className:"flex flex-col gap-4",children:[(0,t.jsxs)("div",{role:"region","aria-label":"File drop zone","data-drag-over":ei?"true":"false",onDragEnter:ev,onDragLeave:ej,onDragOver:ew,onDrop:ey,className:(0,u.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",ei&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(b.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"DESCRIBE YOUR FEATURE"}),(0,t.jsxs)("div",{ref:em,onFocus:eR,onBlur:eA,className:(0,u.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",ec&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(g.Textarea,{id:"feature-description",placeholder:"e.g. Add GitHub OAuth login with callback handling and token refresh...",value:L,onChange:e=>U(e.target.value),onKeyDown:eS,onPaste:eC,required:!0,disabled:i,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),B.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:B.map(e=>(0,t.jsx)(k.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>eP(e.id),disabled:i,loading:e.loading},e.id))}),el?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:el}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(N.AgentModelPicker,{initialAgentType:er??j??"claude-code",initialModel:eo??A??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{ea(e),es(t)},disabled:i,className:"w-55"}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(w.Switch,{id:"fast-mode",checked:ee,onCheckedChange:et,disabled:i}),(0,t.jsxs)(b.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(c.Zap,{className:"h-3.5 w-3.5"}),"Fast Mode"]})]})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:"Skip SDLC phases and implement directly from your prompt."})]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:eN,disabled:i,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:"Attach files"})]})]})]})]}),eD&&void 0!==f?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(b.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"PARENT FEATURE"}),(0,t.jsx)(D,{features:d,value:Y,onChange:Q,disabled:i})]}):null,(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)(y.Tooltip,{children:[(0,t.jsx)(y.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:"APPROVE"})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:"Auto-approve phase transitions without manual review."})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:S.map(e=>(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(w.Switch,{id:`approve-${e.id}`,size:"sm",checked:q[e.id]??!1,onCheckedChange:t=>H(r=>({...r,[e.id]:t})),disabled:i||ee&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(b.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:ee&&("allowPrd"===e.id||"allowPlan"===e.id)?"Skipped in Fast Mode":e.description})]},e.id))}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=S.every(e=>q[e.id]),t={};for(let r of S)t[r.id]=!e;H(t)},disabled:i,className:(0,u.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",S.every(e=>q[e.id])&&"text-primary"),children:"All"})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:"Toggle all approval gates"})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.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:"EVIDENCE"})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:"Collect and attach evidence after implementation."})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(w.Switch,{id:"enable-evidence",size:"sm",checked:X,onCheckedChange:e=>{W(e),e||J(!1)},disabled:i}),(0,t.jsx)(b.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:"Collect"})]})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:"Capture screenshots and artifacts after implementation."})]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(w.Switch,{id:"commit-evidence",size:"sm",checked:Z,onCheckedChange:J,disabled:i||!X||!K}),(0,t.jsx)(b.Label,{htmlFor:"commit-evidence",className:(0,u.cn)("cursor-pointer text-xs font-medium",(!X||!K)&&"opacity-50"),children:"Add to PR"})]})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:K?X?"Include evidence in the pull request body.":"Requires evidence collection to be enabled":"Requires PR to be enabled"})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs font-semibold tracking-wider",children:"GIT"}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(w.Switch,{id:"push",size:"sm",checked:G||K,onCheckedChange:e=>{_(e),!e&&K&&V(!1)},disabled:i}),(0,t.jsx)(b.Label,{htmlFor:"push",className:"cursor-pointer text-xs font-medium",children:"Push"})]})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:"Push branch to remote after implementation."})]}),(0,t.jsxs)(y.Tooltip,{children:[(0,t.jsx)(y.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(w.Switch,{id:"open-pr",size:"sm",checked:K,onCheckedChange:e=>{V(e),e||J(!1)},disabled:i}),(0,t.jsx)(b.Label,{htmlFor:"open-pr",className:"cursor-pointer text-xs font-medium",children:"PR"})]})}),(0,t.jsx)(y.TooltipContent,{side:"bottom",children:"Open a pull request after pushing."})]})]})]})]})]})})})})}function D({features:e,value:a,onChange:o,disabled:s}){let[i,n]=(0,r.useState)(!1),[c,p]=(0,r.useState)(""),h=(0,r.useRef)(null),m=e.find(e=>e.id===a),x=c.trim()?e.filter(e=>e.name.toLowerCase().includes(c.toLowerCase())||e.id.toLowerCase().includes(c.toLowerCase())):e,g=(0,r.useCallback)(e=>{o(e),n(!1),p("")},[o]);return(0,r.useEffect)(()=>{i?setTimeout(()=>h.current?.focus(),0):p("")},[i]),(0,t.jsxs)(j.Popover,{open:i,onOpenChange:n,children:[(0,t.jsx)(j.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":i,"aria-label":"Parent Feature",disabled:s,"data-testid":"parent-feature-combobox",className:(0,u.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",!m&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:m?`${m.name} (${m.id.slice(0,8)})`:"Select parent feature..."}),(0,t.jsx)(l,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(j.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)(f.Input,{ref:h,placeholder:"Search features...",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:()=>g(void 0),className:(0,u.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)(d.CheckIcon,{className:(0,u.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:"No parent"})]}),0===x.length&&c?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:"No features found."}):x.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>g(e.id),className:(0,u.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)(d.CheckIcon,{className:(0,u.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))]})]})})]})}function E({repositoryPath:e,initialParentId:s,features:n,workflowDefaults:l,currentAgentType:d,currentModel:c}){let u=(0,a.useRouter)(),[p,h]=(0,r.useState)(!1),m=(0,a.usePathname)().startsWith("/create"),x=!p&&m;(0,r.useEffect)(()=>{!m&&p&&h(!1)},[m,p]);let f=(0,r.useCallback)(()=>{u.push("/")},[u]),g=(0,r.useCallback)(e=>{h(!0),u.push("/"),i(e).then(t=>{t.error?o.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{o.toast.error("Failed to create feature"),h(!1)})},[u]);return(0,t.jsx)(A,{open:x,onClose:f,onSubmit:g,repositoryPath:e,features:n,workflowDefaults:l,initialParentId:s,isSubmitting:p,currentAgentType:d,currentModel:c})}e.s(["CreateDrawerClient",()=>E],15203)}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,93752,e=>{"use strict";let t=(0,e.i(3645).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);e.s(["default",()=>t])},38573,e=>{"use strict";let t=(0,e.i(3645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],38573)},30702,e=>{"use strict";let t=(0,e.i(3645).default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>t],30702)},23925,1012,e=>{"use strict";let t=(0,e.i(3645).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["default",()=>t],1012),e.s(["Check",()=>t],23925)},41957,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(87620),o=r.forwardRef((e,r)=>(0,t.jsx)(s.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));o.displayName="Label",e.s(["Label",()=>o,"Root",()=>o],27572);var i=e.i(27572),i=i,n=e.i(94237),a=e.i(31777);let l=(0,n.cva)("text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=r.forwardRef(({className:e,...r},s)=>(0,t.jsx)(i.Root,{ref:s,className:(0,a.cn)(l(),e),...r}));c.displayName=i.Root.displayName,e.s(["Label",()=>c],41957)},23405,e=>{"use strict";var t=e.i(79054);function r(e){let r=t.useRef({value:e,previous:e});return t.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}e.s(["usePrevious",()=>r])},11345,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);e.s(["ChevronLeft",()=>t],11345)},76016,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",()=>t],76016)},61569,e=>{"use strict";let t=(0,e.i(3645).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",()=>t])},87342,e=>{"use strict";var t=e.i(79054),r=e.i(22528),s=e.i(5978),o=e.i(86874),i=e.i(20314);function n(e){let n=e+"CollectionProvider",[a,l]=(0,r.createContextScope)(n),[c,d]=a(n,{collectionRef:{current:null},itemMap:new Map}),u=e=>{let{scope:r,children:s}=e,o=t.default.useRef(null),n=t.default.useRef(new Map).current;return(0,i.jsx)(c,{scope:r,itemMap:n,collectionRef:o,children:s})};u.displayName=n;let p=e+"CollectionSlot",h=(0,o.createSlot)(p),f=t.default.forwardRef((e,t)=>{let{scope:r,children:o}=e,n=d(p,r),a=(0,s.useComposedRefs)(t,n.collectionRef);return(0,i.jsx)(h,{ref:a,children:o})});f.displayName=p;let m=e+"CollectionItemSlot",v="data-radix-collection-item",x=(0,o.createSlot)(m),g=t.default.forwardRef((e,r)=>{let{scope:o,children:n,...a}=e,l=t.default.useRef(null),c=(0,s.useComposedRefs)(r,l),u=d(m,o);return t.default.useEffect(()=>(u.itemMap.set(l,{ref:l,...a}),()=>void u.itemMap.delete(l))),(0,i.jsx)(x,{...{[v]:""},ref:c,children:n})});return g.displayName=m,[{Provider:u,Slot:f,ItemSlot:g},function(r){let s=d(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]}var a=new WeakMap;function l(e,t){var r,s;let o,i,n;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let a=(r=e,s=t,o=r.length,(n=(i=c(s))>=0?i:o+i)<0||n>=o?-1:n);return -1===a?void 0:e[a]}function c(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,o=this.has(t),i=this.#e.length,n=c(e),a=n>=0?n:i+n,l=a<0||a>=i?-1:a;if(l===this.size||o&&l===this.size-1||-1===l)return this.set(t,r),this;let d=this.size+ +!o;n<0&&a++;let u=[...this.#e],p=!1;for(let e=a;e<d;e++)if(a===e){let i=u[e];u[e]===t&&(i=u[e+1]),o&&this.delete(t),s=this.get(i),this.set(t,r)}else{p||u[e-1]!==t||(p=!0);let r=u[p?e:e-1],o=s;s=this.get(r),this.delete(r),this.set(r,o)}return this}with(t,r,s){let o=new e(this);return o.insert(t,r,s),o}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=l(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=l(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return l(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=[],o=0;for(let e of this)Reflect.apply(t,r,[e,o,this])&&s.push(e),o++;return new e(s)}map(t,r){let s=[],o=0;for(let e of this)s.push([e[0],Reflect.apply(t,r,[e,o,this])]),o++;return new e(s)}reduce(...e){let[t,r]=e,s=0,o=r??this.at(0);for(let r of this)o=0===s&&1===e.length?r:Reflect.apply(t,this,[o,r,s,this]),s++;return o}reduceRight(...e){let[t,r]=e,s=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let o=this.at(r);s=r===this.size-1&&1===e.length?o:Reflect.apply(t,this,[s,o,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,o=this.size-1;if(void 0===t)return s;t<0&&(t+=this.size),void 0!==r&&r>0&&(o=r-1);for(let e=t;e<=o;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",()=>n])},49228,e=>{"use strict";let t=(0,e.i(3645).default)("git-branch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);e.s(["GitBranch",()=>t],49228)},87889,e=>{"use strict";let t=(0,e.i(3645).default)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);e.s(["Eye",()=>t],87889)},99105,e=>{"use strict";let t=(0,e.i(3645).default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);e.s(["ChevronDown",()=>t],99105)},83902,e=>{"use strict";let t=(0,e.i(3645).default)("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);e.s(["Rocket",()=>t],83902)},46421,17543,e=>{"use strict";var t=e.i(21023);let r=(0,t.createServerReference)("00dd1e38a1d19039c42d9a87272c36887be5ee301d",t.callServer,void 0,t.findSourceMapURL,"getAllAgentModels");e.s(["getAllAgentModels",()=>r],46421);let s=(0,t.createServerReference)("60d89860f1af70bff689d44270af89e6fd6a305426",t.callServer,void 0,t.findSourceMapURL,"updateAgentAndModel");e.s(["updateAgentAndModel",()=>s],17543)},26370,e=>{"use strict";let t=(0,e.i(3645).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",()=>t],26370)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(36589),a=e.i(23405),l=e.i(77624),c=e.i(87620),d="Switch",[u,p]=(0,i.createContextScope)(d),[h,f]=u(d),m=r.forwardRef((e,i)=>{let{__scopeSwitch:a,name:l,checked:u,defaultChecked:p,required:f,disabled:m,value:v="on",onCheckedChange:x,form:k,...b}=e,[w,R]=r.useState(null),C=(0,o.useComposedRefs)(i,e=>R(e)),j=r.useRef(!1),P=!w||k||!!w.closest("form"),[A,N]=(0,n.useControllableState)({prop:u,defaultProp:p??!1,onChange:x,caller:d});return(0,t.jsxs)(h,{scope:a,checked:A,disabled:m,children:[(0,t.jsx)(c.Primitive.button,{type:"button",role:"switch","aria-checked":A,"aria-required":f,"data-state":y(A),"data-disabled":m?"":void 0,disabled:m,value:v,...b,ref:C,onClick:(0,s.composeEventHandlers)(e.onClick,e=>{N(e=>!e),P&&(j.current=e.isPropagationStopped(),j.current||e.stopPropagation())})}),P&&(0,t.jsx)(g,{control:w,bubbles:!j.current,name:l,value:v,checked:A,required:f,disabled:m,form:k,style:{transform:"translateX(-100%)"}})]})});m.displayName=d;var v="SwitchThumb",x=r.forwardRef((e,r)=>{let{__scopeSwitch:s,...o}=e,i=f(v,s);return(0,t.jsx)(c.Primitive.span,{"data-state":y(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:r})});x.displayName=v;var g=r.forwardRef(({__scopeSwitch:e,control:s,checked:i,bubbles:n=!0,...c},d)=>{let u=r.useRef(null),p=(0,o.useComposedRefs)(u,d),h=(0,a.usePrevious)(i),f=(0,l.useSize)(s);return r.useEffect(()=>{let e=u.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==i&&t){let r=new Event("click",{bubbles:n});t.call(e,i),e.dispatchEvent(r)}},[h,i,n]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...c,tabIndex:-1,ref:p,style:{...c.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function y(e){return e?"checked":"unchecked"}g.displayName="SwitchBubbleInput",e.s(["Root",()=>m,"Switch",()=>m,"SwitchThumb",()=>x,"Thumb",()=>x,"createSwitchScope",()=>p],95291);var k=e.i(95291),k=k,b=e.i(31777);function w({className:e,size:r="default",...s}){return(0,t.jsx)(k.Root,{"data-slot":"switch","data-size":r,className:(0,b.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...s,children:(0,t.jsx)(k.Thumb,{"data-slot":"switch-thumb",className:(0,b.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}e.s(["Switch",()=>w],51911)},90382,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(91967),o=e.i(5978),i=e.i(22528),n=e.i(53532),a=e.i(41687),l=e.i(56720),c=e.i(13123),d=e.i(52740),u=e.i(39979),p=e.i(85995),h=e.i(87620),f=e.i(86874),m=e.i(36589),v=e.i(73772),x=e.i(13044),g="Popover",[y,k]=(0,i.createContextScope)(g,[d.createPopperScope]),b=(0,d.createPopperScope)(),[w,R]=y(g),C=e=>{let{__scopePopover:s,children:o,open:i,defaultOpen:n,onOpenChange:a,modal:l=!1}=e,u=b(s),p=r.useRef(null),[h,f]=r.useState(!1),[v,x]=(0,m.useControllableState)({prop:i,defaultProp:n??!1,onChange:a,caller:g});return(0,t.jsx)(d.Root,{...u,children:(0,t.jsx)(w,{scope:s,contentId:(0,c.useId)(),triggerRef:p,open:v,onOpenChange:x,onOpenToggle:r.useCallback(()=>x(e=>!e),[x]),hasCustomAnchor:h,onCustomAnchorAdd:r.useCallback(()=>f(!0),[]),onCustomAnchorRemove:r.useCallback(()=>f(!1),[]),modal:l,children:o})})};C.displayName=g;var j="PopoverAnchor",P=r.forwardRef((e,s)=>{let{__scopePopover:o,...i}=e,n=R(j,o),a=b(o),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=n;return r.useEffect(()=>(l(),()=>c()),[l,c]),(0,t.jsx)(d.Anchor,{...a,...i,ref:s})});P.displayName=j;var A="PopoverTrigger",N=r.forwardRef((e,r)=>{let{__scopePopover:i,...n}=e,a=R(A,i),l=b(i),c=(0,o.useComposedRefs)(r,a.triggerRef),u=(0,t.jsx)(h.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B(a.open),...n,ref:c,onClick:(0,s.composeEventHandlers)(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:(0,t.jsx)(d.Anchor,{asChild:!0,...l,children:u})});N.displayName=A;var S="PopoverPortal",[M,O]=y(S,{forceMount:void 0}),T=e=>{let{__scopePopover:r,forceMount:s,children:o,container:i}=e,n=R(S,r);return(0,t.jsx)(M,{scope:r,forceMount:s,children:(0,t.jsx)(p.Presence,{present:s||n.open,children:(0,t.jsx)(u.Portal,{asChild:!0,container:i,children:o})})})};T.displayName=S;var z="PopoverContent",E=r.forwardRef((e,r)=>{let s=O(z,e.__scopePopover),{forceMount:o=s.forceMount,...i}=e,n=R(z,e.__scopePopover);return(0,t.jsx)(p.Presence,{present:o||n.open,children:n.modal?(0,t.jsx)(D,{...i,ref:r}):(0,t.jsx)(q,{...i,ref:r})})});E.displayName=z;var F=(0,f.createSlot)("PopoverContent.RemoveScroll"),D=r.forwardRef((e,i)=>{let n=R(z,e.__scopePopover),a=r.useRef(null),l=(0,o.useComposedRefs)(i,a),c=r.useRef(!1);return r.useEffect(()=>{let e=a.current;if(e)return(0,v.hideOthers)(e)},[]),(0,t.jsx)(x.RemoveScroll,{as:F,allowPinchZoom:!0,children:(0,t.jsx)(I,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,s.composeEventHandlers)(e.onCloseAutoFocus,e=>{e.preventDefault(),c.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,s.composeEventHandlers)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;c.current=2===t.button||r},{checkForDefaultPrevented:!1}),onFocusOutside:(0,s.composeEventHandlers)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),q=r.forwardRef((e,s)=>{let o=R(z,e.__scopePopover),i=r.useRef(!1),n=r.useRef(!1);return(0,t.jsx)(I,{...e,ref:s,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||o.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;o.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&n.current&&t.preventDefault()}})}),I=r.forwardRef((e,r)=>{let{__scopePopover:s,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:c,disableOutsidePointerEvents:u,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,...v}=e,x=R(z,s),g=b(s);return(0,a.useFocusGuards)(),(0,t.jsx)(l.FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:c,children:(0,t.jsx)(n.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:u,onInteractOutside:m,onEscapeKeyDown:p,onPointerDownOutside:h,onFocusOutside:f,onDismiss:()=>x.onOpenChange(!1),children:(0,t.jsx)(d.Content,{"data-state":B(x.open),role:"dialog",id:x.contentId,...g,...v,ref:r,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),L="PopoverClose",H=r.forwardRef((e,r)=>{let{__scopePopover:o,...i}=e,n=R(L,o);return(0,t.jsx)(h.Primitive.button,{type:"button",...i,ref:r,onClick:(0,s.composeEventHandlers)(e.onClick,()=>n.onOpenChange(!1))})});H.displayName=L;var _=r.forwardRef((e,r)=>{let{__scopePopover:s,...o}=e,i=b(s);return(0,t.jsx)(d.Arrow,{...i,...o,ref:r})});function B(e){return e?"open":"closed"}_.displayName="PopoverArrow",e.s(["Anchor",()=>P,"Arrow",()=>_,"Close",()=>H,"Content",()=>E,"Popover",()=>C,"PopoverAnchor",()=>P,"PopoverArrow",()=>_,"PopoverClose",()=>H,"PopoverContent",()=>E,"PopoverPortal",()=>T,"PopoverTrigger",()=>N,"Portal",()=>T,"Root",()=>C,"Trigger",()=>N,"createPopoverScope",()=>k],89920);var U=e.i(89920),U=U,K=e.i(31777);let G=U.Root,V=U.Trigger;U.Anchor;let X=r.forwardRef(({className:e,align:r="center",sideOffset:s=4,...o},i)=>(0,t.jsx)(U.Portal,{children:(0,t.jsx)(U.Content,{ref:i,align:r,sideOffset:s,className:(0,K.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 rounded-md border p-4 shadow-md outline-none",e),...o})}));X.displayName=U.Content.displayName,e.s(["Popover",()=>G,"PopoverContent",()=>X,"PopoverTrigger",()=>V],90382)},41413,e=>{"use strict";var t=e.i(20314),r=e.i(79054),s=e.i(23925),o=e.i(11345),i=e.i(76016),n=e.i(46421),a=e.i(17543),l=e.i(86782),c=e.i(29847),d=e.i(35364),u=e.i(90382),p=e.i(31777);function h({initialAgentType:e,initialModel:h,onAgentModelChange:f,disabled:m,className:v,mode:x}){let[g,y]=r.useState(!1),[k,b]=r.useState([]),[w,R]=r.useState(!0),[C,j]=r.useState(e),[P,A]=r.useState(h),[N,S]=r.useState(null),[M,O]=r.useState(0),[T,z]=r.useState(null);r.useEffect(()=>{(0,n.getAllAgentModels)().then(b).finally(()=>R(!1))},[]),r.useEffect(()=>{if(!g){let e=setTimeout(()=>{O(0),z(null)},150);return()=>clearTimeout(e)}},[g]);let E=async(e,t)=>{if(y(!1),e!==C||t!==P){if("override"===x){j(e),A(t),f?.(e,t);return}j(e),A(t),f?.(e,t),S(null);try{let r=await (0,a.updateAgentAndModel)(e,t||null);r.ok||(j(C),A(P),f?.(C,P),S(r.error??"Failed to save"))}catch{j(C),A(P),f?.(C,P),S("Failed to save")}}},F=(0,l.getAgentTypeIcon)(C),D=k.find(e=>e.agentType===C)?.label??C,q=P?(0,c.getModelMeta)(P).displayName||P:null,I=T?k.find(e=>e.agentType===T):null;return(0,t.jsxs)("div",{className:(0,p.cn)("flex flex-col gap-1",v),children:[(0,t.jsxs)(u.Popover,{open:g,onOpenChange:y,children:[(0,t.jsx)(u.PopoverTrigger,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"outline",role:"combobox","aria-expanded":g,disabled:(m??!1)||w,className:"w-auto cursor-pointer justify-start font-normal hover:border-violet-300 hover:bg-violet-50/50 dark:hover:border-violet-700 dark:hover:bg-violet-950/30",children:(0,t.jsxs)("span",{className:"flex items-center gap-2 truncate",children:[(0,t.jsx)(F,{className:"h-4 w-4 shrink-0"}),w?"Loading…":(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:D}),q?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-muted-foreground/50 text-xs",children:"·"}),(0,t.jsx)("span",{className:"text-xs font-medium",children:q})]}):null]})]})})}),(0,t.jsx)(u.PopoverContent,{className:"w-(--radix-popover-trigger-width) overflow-hidden p-0",align:"start",children:(0,t.jsxs)("div",{className:"flex transition-transform duration-200 ease-in-out",style:{transform:`translateX(${1===M?"-50%":"0%"})`,width:"200%"},children:[(0,t.jsxs)("div",{className:"w-1/2 shrink-0",children:[(0,t.jsx)("div",{className:"text-muted-foreground border-b px-3 py-2 text-xs font-medium",children:"Select agent"}),k.map(e=>{let r=(0,l.getAgentTypeIcon)(e.agentType),o=C===e.agentType,n=e.models.length>0;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-2.5 px-3 py-2 text-xs transition-colors","hover:bg-accent hover:text-accent-foreground",o&&"bg-accent/50"),onClick:()=>{n?(z(e.agentType),requestAnimationFrame(()=>{requestAnimationFrame(()=>O(1))})):E(e.agentType,"")},children:[(0,t.jsx)(r,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{className:"flex-1 text-left",children:e.label}),o&&!n?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null,n?(0,t.jsx)(i.ChevronRight,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}):null]},e.agentType)})]}),(0,t.jsx)("div",{className:"w-1/2 shrink-0",children:I?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",className:"text-muted-foreground hover:text-foreground flex w-full cursor-pointer items-center gap-1.5 border-b px-3 py-2 text-xs font-medium transition-colors",onClick:()=>{O(0),setTimeout(()=>z(null),220)},children:[(0,t.jsx)(o.ChevronLeft,{className:"h-3.5 w-3.5"}),I.label]}),I.models.map(e=>{let r=C===I.agentType&&P===e.id;return(0,t.jsxs)("button",{type:"button",className:(0,p.cn)("flex w-full cursor-pointer items-center gap-3 px-3 py-2 text-left transition-colors","hover:bg-accent hover:text-accent-foreground",r&&"bg-accent/50"),onClick:()=>E(I.agentType,e.id),children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:e.displayName}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.description})]}),r?(0,t.jsx)(s.Check,{className:"text-primary h-3.5 w-3.5 shrink-0"}):null]},e.id)})]}):null})]})})]}),!!N&&(0,t.jsx)("p",{className:"text-destructive text-sm",children:N})]})}e.s(["AgentModelPicker",()=>h])}]);
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[40617,a=>{"use strict";let b=(0,a.i(25700).default)("code",[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]);a.s(["default",()=>b])},45242,79620,73998,26633,30931,307,39116,a=>{"use strict";var b=a.i(25700);let c=(0,b.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"}]]);a.s(["PaperclipIcon",()=>c],45242);var d=a.i(10973),e=a.i(85536);function f({className:a,...b}){return(0,d.jsx)("textarea",{"data-slot":"textarea",className:(0,e.cn)("placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",a),...b})}a.s(["Textarea",()=>f],79620);var g=a.i(2807),h=a.i(7052),h=h,i=a.i(76096);a.s(["DownloadIcon",()=>i.default],73998);var i=i,j=a.i(45670),k=a.i(50049);a.s(["VisuallyHidden",0,k],26633);var k=k;let l=(0,b.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"}]]);var m=a.i(42642),m=m;let n=(0,b.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 o=a.i(40617),o=o;a.i(18948);let p=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]),q=new Set([".ts",".tsx",".js",".jsx",".json",".yaml",".yml",".xml",".html",".css",".md"]);function r(a){if(0===a)return"0 B";let b=Math.floor(Math.log(a)/Math.log(1024));return`${(a/Math.pow(1024,b)).toFixed(+(0!==b))} ${["B","KB","MB","GB"][b]}`}let s=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function t(a,b){let c=new URLSearchParams({path:a,mimeType:b});return`/api/attachments/preview?${c.toString()}`}function u({name:a,size:b,mimeType:c,path:f,onRemove:u,loading:v=!1,disabled:w=!1}){let x,y,z=(x=a.lastIndexOf("."))>=0?a.slice(x).toLowerCase():"",A=p.has(z)?n:".pdf"===z?m.default:q.has(z)?o.default:l,B=".pdf"===z?"bg-red-50 text-red-600":p.has(z)?"bg-blue-50 text-blue-600":q.has(z)?"bg-emerald-50 text-emerald-600":"bg-gray-50 text-gray-600",C=(y=a.lastIndexOf("."))>=0&&s.has(a.slice(y).toLowerCase());return v?(0,d.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-md border",children:(0,d.jsx)(h.default,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):C?(0,d.jsxs)(j.Dialog,{children:[(0,d.jsxs)("div",{className:"group relative",children:[(0,d.jsx)(j.DialogTrigger,{asChild:!0,children:(0,d.jsx)("img",{src:t(f,c),alt:a,title:a,className:"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80"})}),!w&&(0,d.jsx)("button",{type:"button",onClick:u,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 ${a}`,children:(0,d.jsx)(g.X,{className:"h-3 w-3"})})]}),(0,d.jsxs)(j.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,d.jsx)(k.Root,{children:(0,d.jsxs)(j.DialogTitle,{children:["Preview: ",a]})}),(0,d.jsx)("div",{className:"relative bg-black/90",children:(0,d.jsx)("img",{src:t(f,c),alt:a,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,d.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,d.jsx)("span",{className:"truncate text-sm font-medium",children:a}),(0,d.jsx)("span",{className:"text-muted-foreground text-xs",children:r(b)})]}),(0,d.jsx)("a",{href:t(f,c),download:a,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${a}`,children:(0,d.jsx)(i.default,{className:"h-4 w-4"})})]})]})]}):(0,d.jsxs)("div",{className:"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2",children:[(0,d.jsx)("div",{className:(0,e.cn)("flex h-6 w-6 shrink-0 items-center justify-center rounded-full",B),children:(0,d.jsx)(A,{className:"h-3 w-3"})}),(0,d.jsx)("span",{className:"max-w-[120px] truncate text-sm",children:a}),(0,d.jsx)("span",{className:"text-muted-foreground text-xs",children:r(b)}),!w&&(0,d.jsx)("button",{type:"button",onClick:u,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 ${a}`,children:(0,d.jsx)(g.X,{className:"h-3 w-3"})})]})}async function v(){let a=await fetch("/api/dialog/pick-files",{method:"POST"});if(!a.ok)throw Error("Failed to open file dialog");let b=await a.json();return b.cancelled?null:b.files}a.s(["AttachmentChip",()=>u],30931),a.s([],307),a.s(["pickFiles",()=>v],39116)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=7f428_lucide-react_dist_esm_icons_6ba7eb21._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/code.ts","../../../../../../../src/presentation/web/components/common/attachment-chip/attachment-chip.tsx","../../../../../../../src/presentation/web/components/ui/textarea.tsx","../../../../../../../src/presentation/web/components/common/attachment-card/attachment-card.tsx","../../../../../../../src/presentation/web/components/common/feature-create-drawer/pick-files.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/image.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/file.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/paperclip.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'm16 18 6-6-6-6', key: 'eg8j8' }],\n ['path', { d: 'm8 6-6 6 6 6', key: 'ppft3o' }],\n];\n\n/**\n * @component @name Code\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/code\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Code = createLucideIcon('code', __iconNode);\n\nexport default Code;\n","/* eslint-disable @next/next/no-img-element -- Local file preview requires raw <img>, not next/image */\n'use client';\n\nimport { X, Loader2Icon, DownloadIcon } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { Dialog, DialogTrigger, DialogContent, DialogTitle } from '@/components/ui/dialog';\nimport { VisuallyHidden } from 'radix-ui';\nimport {\n formatFileSize,\n getFileIcon,\n getFileIconColor,\n} from '@/components/common/attachment-card/attachment-card';\n\nexport interface AttachmentChipProps {\n name: string;\n size: number;\n mimeType: string;\n path: string;\n onRemove: () => void;\n loading?: boolean;\n disabled?: boolean;\n}\n\nconst IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.bmp']);\n\nfunction isImage(name: string): boolean {\n const dot = name.lastIndexOf('.');\n return dot >= 0 && IMAGE_EXTS.has(name.slice(dot).toLowerCase());\n}\n\nfunction previewUrl(path: string, mimeType: string): string {\n const params = new URLSearchParams({ path, mimeType });\n return `/api/attachments/preview?${params.toString()}`;\n}\n\nfunction getExtension(filename: string): string {\n const dot = filename.lastIndexOf('.');\n return dot >= 0 ? filename.slice(dot).toLowerCase() : '';\n}\n\nexport function AttachmentChip({\n name,\n size,\n mimeType,\n path,\n onRemove,\n loading = false,\n disabled = false,\n}: AttachmentChipProps) {\n const ext = getExtension(name);\n const Icon = getFileIcon(ext);\n const iconColorClass = getFileIconColor(ext);\n const imageFile = isImage(name);\n\n if (loading) {\n return (\n <div className=\"flex h-12 w-12 items-center justify-center rounded-md border\">\n <Loader2Icon className=\"text-muted-foreground h-5 w-5 animate-spin\" />\n </div>\n );\n }\n\n if (imageFile) {\n return (\n <Dialog>\n <div className=\"group relative\">\n <DialogTrigger asChild>\n <img\n src={previewUrl(path, mimeType)}\n alt={name}\n title={name}\n className=\"h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80\"\n />\n </DialogTrigger>\n {!disabled && (\n <button\n type=\"button\"\n onClick={onRemove}\n 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\"\n aria-label={`Remove ${name}`}\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </div>\n <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\">\n <VisuallyHidden.Root>\n <DialogTitle>Preview: {name}</DialogTitle>\n </VisuallyHidden.Root>\n <div className=\"relative bg-black/90\">\n <img\n src={previewUrl(path, mimeType)}\n alt={name}\n className=\"h-auto max-h-[70vh] w-full object-contain\"\n />\n </div>\n <div className=\"bg-background flex items-center gap-3 px-4 py-3\">\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate text-sm font-medium\">{name}</span>\n <span className=\"text-muted-foreground text-xs\">{formatFileSize(size)}</span>\n </div>\n <a\n href={previewUrl(path, mimeType)}\n download={name}\n className=\"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors\"\n aria-label={`Download ${name}`}\n >\n <DownloadIcon className=\"h-4 w-4\" />\n </a>\n </div>\n </DialogContent>\n </Dialog>\n );\n }\n\n return (\n <div className=\"group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2\">\n <div\n className={cn(\n 'flex h-6 w-6 shrink-0 items-center justify-center rounded-full',\n iconColorClass\n )}\n >\n <Icon className=\"h-3 w-3\" />\n </div>\n <span className=\"max-w-[120px] truncate text-sm\">{name}</span>\n <span className=\"text-muted-foreground text-xs\">{formatFileSize(size)}</span>\n {!disabled && (\n <button\n type=\"button\"\n onClick={onRemove}\n 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\"\n aria-label={`Remove ${name}`}\n >\n <X className=\"h-3 w-3\" />\n </button>\n )}\n </div>\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\nfunction Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input field-sizing-content min-h-[80px] w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]',\n 'aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n","import type { LucideIcon } from 'lucide-react';\nimport { FileIcon, FileTextIcon, ImageIcon, CodeIcon, Trash2Icon, Loader2Icon } from 'lucide-react';\nimport { cn } from '@/lib/utils';\nimport { Button } from '@/components/ui/button';\n\nexport interface AttachmentCardProps {\n name: string;\n size: number;\n mimeType: string;\n onRemove: () => void;\n loading?: boolean;\n disabled?: boolean;\n /** Optional secondary text shown below the filename (e.g. file path). */\n subtitle?: string;\n}\n\nexport function AttachmentCard({\n name,\n size,\n mimeType: _mimeType,\n onRemove,\n loading = false,\n disabled = false,\n subtitle,\n}: AttachmentCardProps) {\n const ext = getExtension(name);\n const Icon = getFileIcon(ext);\n const iconColorClass = getFileIconColor(ext);\n\n return (\n <div className=\"flex items-center gap-3 rounded-md border p-2\">\n <div\n className={cn('flex h-8 w-8 shrink-0 items-center justify-center rounded', iconColorClass)}\n >\n <Icon className=\"h-4 w-4\" />\n </div>\n <div className=\"flex min-w-0 flex-1 flex-col\">\n <span className=\"truncate text-sm font-medium\">{name}</span>\n {subtitle ? (\n <span className=\"text-muted-foreground truncate text-xs\">{subtitle}</span>\n ) : null}\n <span className=\"text-muted-foreground text-xs\">\n {loading ? 'Uploading...' : formatFileSize(size)}\n </span>\n </div>\n {loading ? (\n <Loader2Icon className=\"text-muted-foreground h-4 w-4 animate-spin\" />\n ) : (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n onClick={onRemove}\n disabled={disabled}\n aria-label={`Remove ${name}`}\n >\n <Trash2Icon className=\"h-3 w-3\" />\n </Button>\n )}\n </div>\n );\n}\n\nfunction getExtension(filename: string): string {\n const dot = filename.lastIndexOf('.');\n return dot >= 0 ? filename.slice(dot).toLowerCase() : '';\n}\n\nconst IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.bmp']);\nconst CODE_EXTS = new Set([\n '.ts',\n '.tsx',\n '.js',\n '.jsx',\n '.json',\n '.yaml',\n '.yml',\n '.xml',\n '.html',\n '.css',\n '.md',\n]);\n\nexport function getFileIcon(ext: string): LucideIcon {\n if (IMAGE_EXTS.has(ext)) return ImageIcon;\n if (ext === '.pdf') return FileTextIcon;\n if (CODE_EXTS.has(ext)) return CodeIcon;\n return FileIcon;\n}\n\nexport function getFileIconColor(ext: string): string {\n if (ext === '.pdf') return 'bg-red-50 text-red-600';\n if (IMAGE_EXTS.has(ext)) return 'bg-blue-50 text-blue-600';\n if (CODE_EXTS.has(ext)) return 'bg-emerald-50 text-emerald-600';\n return 'bg-gray-50 text-gray-600';\n}\n\nexport function formatFileSize(bytes: number): string {\n if (bytes === 0) return '0 B';\n const units = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(1024));\n return `${(bytes / Math.pow(1024, i)).toFixed(i === 0 ? 0 : 1)} ${units[i]}`;\n}\n","import type { FileAttachment } from '@shepai/core/infrastructure/services/file-dialog.service';\n\n/**\n * Opens a native OS file picker dialog via API route.\n * Returns the selected files with metadata, or null if the user cancelled.\n */\nexport async function pickFiles(): Promise<FileAttachment[] | null> {\n const res = await fetch('/api/dialog/pick-files', { method: 'POST' });\n\n if (!res.ok) {\n throw new Error('Failed to open file dialog');\n }\n\n const data: { files: FileAttachment[] | null; cancelled: boolean } = await res.json();\n return data.cancelled ? null : data.files;\n}\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2', key: '1m3agn' }],\n ['circle', { cx: '9', cy: '9', r: '2', key: 'af1f0g' }],\n ['path', { d: 'm21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21', key: '1xmnt7' }],\n];\n\n/**\n * @component @name Image\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/image\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Image = createLucideIcon('image', __iconNode);\n\nexport default Image;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n 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',\n key: '1oefj6',\n },\n ],\n ['path', { d: 'M14 2v5a1 1 0 0 0 1 1h5', key: 'wfsgrz' }],\n];\n\n/**\n * @component @name File\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/file\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst File = createLucideIcon('file', __iconNode);\n\nexport default File;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n 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',\n key: '1miecu',\n },\n ],\n];\n\n/**\n * @component @name Paperclip\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/paperclip\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Paperclip = createLucideIcon('paperclip', __iconNode);\n\nexport default Paperclip;\n"],"names":[],"mappings":"uCAmBA,CAAA,CAAA,CAAA,CAAA,AAAM,CAAN,CAAM,CAAA,CAAA,CAAA,AAAO,CAAP,AAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAhBM,CAgBE,AAfpC,CAeoC,AAfnC,CAemC,AAfnC,CAemC,AAfnC,CAAA,AAemC,CAfnC,AAemC,CAAA,AAfnC,CAAA,AAemC,CAAA,AAfnC,AAAQ,CAAE,AAAF,AAe2B,CAAU,CAfhC,AAegC,CAfhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,AAAlB,CAAkB,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,AAAQ,CAAE,AAAF,EAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,AAAgB,CAAA,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAC/C,oGOkBA,IAAA,EAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,AAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAjBjD,AAiBiD,CDjBjD,ACAA,CAAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CAAA,ACAA,CAAA,ADAA,CAAA,ACAA,CDAA,ACAA,CAAA,ADAA,CCAA,ADAA,CAAA,ACAA,CAAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CAAA,ACAA,CAAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CAAA,ACAA,CAAA,ADAA,CAAA,ACAA,CAAA,ADAA,CCAA,ADAA,CCAA,ADAA,CAAA,ACAA,CDAA,ACAA,CAAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CAAA,ACAA,CAAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CAAA,ACAA,CDAA,ACAA,CAAA,ADAA,CCAA,ADAA,CCAA,ADAA,CCAA,ADAA,CAAA,ACAA,CAAA,ADAA,mIJLT,EAAA,EAAA,CAAA,CAAA,OAEA,SAAS,EAAS,WAAE,CAAS,CAAE,GAAG,EAAyC,EACzE,MACE,CAAA,EAAA,EAAA,GAAA,EAAC,WAAA,CACC,YAAU,WACV,UAAW,CAAA,EAAA,EAAA,EAAA,AAAE,EACX,oWACA,gFACA,yGACA,GAED,GAAG,CAAK,EAGf,+BDdA,IAAA,EAAA,EAAA,CAAA,CAAA,qFAEA,EAAA,EAAA,CAAA,CAAA,8DKoBA,CAAA,GAAM,EAAA,CAAA,CAAA,CAAA,AAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,AApBlC,CCAA,ADAA,AAoBkC,CCpBlC,ADAA,AAoBkC,CCpBlC,ADAA,AAoBkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,6HAjBrC,EAET,EACC,CAAA,CAAA,KAAQ,CAAA,AAAE,EAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2B,AAA3B,CAA2B,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,0CDS5C,EAAiB,CAAA,QAAS,CAhBrC,AAgBqC,CAAA,MAhB7B,CAAA,AAAE,MAAA,KAAa,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAA,CAAM,AAAN,CAAM,CAAG,CAAA,CAAA,CAAA,CAAK,AAAL,CAAK,CAAA,AAAG,CAAA,CAAA,EAAK,CAAA,CAAA,CAAA,AAAI,GAAA,CAAA,AAAK,CAAA,EAAI,CAAA,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,EACtF,SAAU,CAAA,AAAE,EAAA,CAAA,AAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,AAAI,GAAA,CAAA,AAAK,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,AAAK,GAAA,CAAA,AAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,EACrD,OAAQ,CAAA,AAAE,EAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,AAA6C,CAAA,CAAA,CAAA,CAAK,AAAL,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA,CAC5E,uBFJA,EAAA,CAAA,CAAA,OAiEA,IAAM,EAAa,IAAI,IAAI,CAAC,OAAQ,OAAQ,QAAS,OAAQ,OAAQ,QAAS,OAAQ,OAAO,EACvF,EAAY,IAAI,IAAI,CACxB,MACA,OACA,MACA,OACA,QACA,QACA,OACA,OACA,QACA,OACA,MACD,EAgBM,SAAS,EAAe,CAAa,EAC1C,GAAI,AAAU,MAAG,MAAO,MAExB,IAAM,EAAI,KAAK,KAAK,CAAC,KAAK,GAAG,CAAC,GAAS,KAAK,GAAG,CAAC,OAChD,MAAO,CAAA,EAAG,CAAC,EAAQ,KAAK,GAAG,CAAC,KAAM,EAAA,CAAE,CAAE,OAAO,OAAC,CAAM,GAAW,CAAC,AAAR,EAF1C,AAEoD,CAFnD,CAE6C,GAFxC,KAAM,KAAM,KAAK,AAEkC,CAAC,EAAE,CAAA,CAAE,AAC9E,CF/EA,IAAM,EAAa,IAAI,IAAI,CAAC,OAAQ,OAAQ,QAAS,OAAQ,OAAQ,QAAS,OAAQ,OAAO,EAO7F,SAAS,EAAW,CAAY,CAAE,CAAgB,EAChD,IAAM,EAAS,IAAI,gBAAgB,CAAE,gBAAM,CAAS,GACpD,MAAO,CAAC,yBAAyB,EAAE,EAAO,QAAQ,GAAA,CAAI,AACxD,CAOO,SAAS,EAAe,CAC7B,MAAI,MACJ,CAAI,UACJ,CAAQ,MACR,CAAI,UACJ,CAAQ,SACR,GAAU,CAAK,UACf,GAAW,CAAK,CACI,UACd,EAZC,CADD,EAAM,CAaA,CAbS,WAAW,CAAC,OACnB,EAAI,AAYO,EAZE,KAAK,CAAC,GAAK,WAAW,GAAK,GAahD,EEkCF,AAAJ,EAAe,GAAG,AFlCL,CEkCM,AFlCM,GEkCO,EAC5B,AAAQ,CADa,OACL,GAAO,EAAA,OAAY,CACnC,EAAU,GAAG,CAAC,GAAa,EAAA,CAAP,MAAe,CAChC,EFpCD,EEwCN,AAAI,AAAQ,QAAQ,CFxCoB,EEwCb,IFxCJ,qBEyCnB,EAAW,GAAG,CAAC,GAAa,GAAP,wBACrB,EAAU,GAAG,CAAC,GAAa,GAAP,8BACjB,2BF1CD,GA1BA,EAAM,AA0Bc,EA1BT,KA0BC,MA1BU,CAAC,OACf,GAAK,EAAW,GAAG,CAAC,EAAK,KAAK,CAAC,GAAK,WAAW,WA2B7D,AAAI,EAEA,CAAA,EAAA,EAAA,EAFS,CAET,EAAC,MAAA,CAAI,UAAU,wEACb,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAW,CAAA,CAAC,UAAU,iDAKzB,EAEA,CAAA,EAAA,EAAA,IAFW,AAEX,EAAC,EAAA,MAAM,CAAA,WACL,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,2BACb,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,aAAa,CAAA,CAAC,OAAO,CAAA,CAAA,WACpB,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CACC,IAAK,EAAW,EAAM,GACtB,IAAK,EACL,MAAO,EACP,UAAU,kGAGb,CAAC,GACA,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CACC,KAAK,SACL,QAAS,EACT,UAAU,8IACV,aAAY,CAAC,OAAO,EAAE,EAAA,CAAM,UAE5B,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAC,CAAA,CAAC,UAAU,iBAInB,CAAA,EAAA,EAAA,IAAA,EAAC,EAAA,aAAa,CAAA,CAAC,UAAU,0XACvB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAe,IAAI,CAAA,UAClB,CAAA,EAAA,EAAA,IAAA,EAAC,EAAA,WAAW,CAAA,WAAC,YAAU,OAEzB,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CAAI,UAAU,gCACb,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CACC,IAAK,EAAW,EAAM,GACtB,IAAK,EACL,UAAU,gDAGd,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,4DACb,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,yCACb,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,wCAAgC,IAChD,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,yCAAiC,EAAe,QAElE,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CACC,KAAM,EAAW,EAAM,GACvB,SAAU,EACV,UAAU,sGACV,aAAY,CAAC,SAAS,EAAE,EAAA,CAAM,UAE9B,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAY,CAAA,CAAC,UAAU,uBASlC,CAAA,EAAA,EAAA,IAAA,EAAC,MAAA,CAAI,UAAU,sFACb,CAAA,EAAA,EAAA,GAAA,EAAC,MAAA,CACC,UAAW,CAAA,EAAA,EAAA,EAAA,AAAE,EACX,iEACA,YAGF,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAK,UAAU,cAElB,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,0CAAkC,IAClD,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,yCAAiC,EAAe,KAC/D,CAAC,GACA,CAAA,EAAA,EAAA,GAAA,EAAC,SAAA,CACC,KAAK,SACL,QAAS,EACT,UAAU,8IACV,aAAY,CAAC,OAAO,EAAE,EAAA,CAAM,UAE5B,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAC,CAAA,CAAC,UAAU,gBAKvB,CGrIO,eAAe,IACpB,IAAM,EAAM,MAAM,MAAM,yBAA0B,CAAE,OAAQ,MAAO,GAEnE,GAAI,CAAC,EAAI,EAAE,CACT,CADW,KACL,AAAI,MAAM,8BAGlB,IAAM,EAA+D,MAAM,EAAI,IAAI,GACnF,OAAO,EAAK,SAAS,CAAG,KAAO,EAAK,KAAK,AAC3C","ignoreList":[5,6,7]}
|