@shepai/cli 1.183.0-pr555.262baa8 → 1.183.0-pr555.e53ab0e
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/package.json +1 -1
- 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 +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +32 -32
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +33 -33
- 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 +41 -41
- 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 +41 -41
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +31 -31
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +31 -31
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +33 -33
- 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 +41 -41
- 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 +41 -41
- 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 +30 -30
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +31 -31
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +31 -31
- 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 +7 -7
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/application/[id]/page/server-reference-manifest.json +16 -16
- package/web/.next/server/app/application/[id]/page.js.nft.json +1 -1
- package/web/.next/server/app/application/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/applications/page/server-reference-manifest.json +15 -15
- package/web/.next/server/app/applications/page.js.nft.json +1 -1
- package/web/.next/server/app/applications/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/features/page/server-reference-manifest.json +7 -7
- package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/plugins/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/plugins/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +10 -10
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +15 -15
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +13 -13
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +7 -7
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__10e976f3._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4f9eef62.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4f9eef62.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_ffa16a22.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_ffa16a22.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_a1a998f9.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_a1a998f9.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/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_features_applications_applications-page-client_tsx_d0db9938._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__269765de._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__269765de._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__288ffaa6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__288ffaa6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4101a4a8._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4101a4a8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__538580df._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__538580df._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5c5de261._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5c5de261._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__638955bc._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ac9ab3c5._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ac9ab3c5._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c3d233f3._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c3d233f3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c6dba2b8._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__eacd32e9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ef0b8905._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ef0b8905._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f94e4165._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f94e4165._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ff5a5243._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ff5a5243._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_33a243dd._.js +1 -1
- package/web/.next/server/chunks/ssr/_519d77a9._.js +1 -1
- package/web/.next/server/chunks/ssr/_519d77a9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6a252f90._.js +1 -1
- package/web/.next/server/chunks/ssr/_6a252f90._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6b254164._.js +1 -1
- package/web/.next/server/chunks/ssr/_6b254164._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_5e3a19c7._.js → _6cc2c4f7._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_5e3a19c7._.js.map → _6cc2c4f7._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_f924ab0d._.js → _6fd324a3._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_f924ab0d._.js.map → _6fd324a3._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_802cae50._.js → _828a0b9c._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_802cae50._.js.map → _828a0b9c._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_8e101e0b._.js +2 -2
- package/web/.next/server/chunks/ssr/_8e101e0b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_9f191a54._.js +3 -0
- package/web/.next/server/chunks/ssr/{_91c89c19._.js.map → _9f191a54._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_87a6bfa4._.js → _e28c6144._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_87a6bfa4._.js.map → _e28c6144._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_e65abbd1._.js +1 -1
- package/web/.next/server/chunks/ssr/_e65abbd1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_d96d2188._.js → _f39276bf._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_d96d2188._.js.map → _f39276bf._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_f86fc1bf._.js +1 -1
- package/web/.next/server/chunks/ssr/_f86fc1bf._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_47181610._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_47181610._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_5d3f4199._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_5d3f4199._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6159fef8._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6159fef8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_61d96ba8._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_61d96ba8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6994959a._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_6994959a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_77dadf68._.js +3 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_77dadf68._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_9a543843._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_9a543843._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_c3f6f57e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_c3f6f57e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ad42cc73._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ad42cc73._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_8514dfcd._.js +3 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_b95ed206._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b95ed206._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c543cf3e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c543cf3e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_common_base-drawer_base-drawer_tsx_97dfbbc8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.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 +58 -58
- package/web/.next/static/chunks/{0975a823e36631a6.js → 08fd591b02975483.js} +2 -2
- package/web/.next/static/chunks/{17a3ab737bf99e9c.js → 0b974caf7e3c6fea.js} +1 -1
- package/web/.next/static/chunks/{a70f6767d597c9b6.js → 116e8d2a69619e48.js} +1 -1
- package/web/.next/static/chunks/{54ab223f19226d6b.js → 1b72915af68bd327.js} +1 -1
- package/web/.next/static/chunks/{91b3902dc51fc986.js → 1f2f77dd2f63f257.js} +1 -1
- package/web/.next/static/chunks/{3b188a6124a40b66.js → 3031618bf02ecd26.js} +1 -1
- package/web/.next/static/chunks/{4ad976507effac9d.js → 3caa2489e09df522.js} +1 -1
- package/web/.next/static/chunks/463c8dd86ed296c9.js +1 -0
- package/web/.next/static/chunks/{54ff8da8b9e34462.js → 534c414bd5e096af.js} +1 -1
- package/web/.next/static/chunks/{ee5c373067d8f695.js → 6aa8cfb9a0673778.js} +3 -3
- package/web/.next/static/chunks/854d1bb6e05cadeb.js +1 -0
- package/web/.next/static/chunks/{cd887d0f2743aa2c.js → 86ce4c6dcb228907.js} +1 -1
- package/web/.next/static/chunks/{f5a8a8478745988e.js → a3ea2afcbac5ac67.js} +1 -1
- package/web/.next/static/chunks/{6b140304b0e12b56.js → b58faaa9802033ff.js} +1 -1
- package/web/.next/static/chunks/{965c463fbd7d1301.js → b944b65ad181b84d.js} +1 -1
- package/web/.next/static/chunks/{cff6a861856f8e23.js → c77489661f071f47.js} +1 -1
- package/web/.next/static/chunks/{f26ba6cde93f3dc3.js → d51b987a73d58809.js} +1 -1
- package/web/.next/static/chunks/{a1c576612297f08e.js → e99459f76df95a70.js} +1 -1
- package/web/.next/static/chunks/{9196a0cee202a08c.js → f76f1155e5d0d296.js} +1 -1
- package/web/.next/server/chunks/ssr/_91c89c19._.js +0 -3
- package/web/.next/static/chunks/81cada75205ea9ad.js +0 -1
- package/web/.next/static/chunks/9f72ca085d2427e7.js +0 -1
- /package/web/.next/static/{rDCSfspG1D66StEgE31Em → H1ozIesERGbwQQ6nOO8UC}/_buildManifest.js +0 -0
- /package/web/.next/static/{rDCSfspG1D66StEgE31Em → H1ozIesERGbwQQ6nOO8UC}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{rDCSfspG1D66StEgE31Em → H1ozIesERGbwQQ6nOO8UC}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,224011,e=>{"use strict";var t=e.i(508893);let a=(0,t.createServerReference)("4042f7afd08974b7d8e77c1d87f679e63485c1d6c8",t.callServer,void 0,t.findSourceMapURL,"deleteApplication");e.s(["deleteApplication",()=>a])},370002,657365,e=>{"use strict";var t=e.i(215131);function a(e,t,a,r){return"processing"===t?{label:"In Progress",dotClass:"bg-violet-500",borderClass:"",pulse:!0,previewDisabled:!0}:"awaiting_input"===t?{label:"Action Required",dotClass:"bg-amber-500",borderClass:"border-amber-500/60",pulse:!0,previewDisabled:!0}:"interrupted"===r?{label:"Interrupted",dotClass:"bg-amber-500",borderClass:"border-amber-500/60",pulse:!1,previewDisabled:!0}:"failed"===r?{label:"Failed",dotClass:"bg-red-500",borderClass:"border-red-500/60",pulse:!1,previewDisabled:!0}:"building"===r?{label:"In Progress",dotClass:"bg-violet-500",borderClass:"",pulse:!0,previewDisabled:!0}:a?{label:"Live",dotClass:"bg-emerald-500",borderClass:"",pulse:!0,previewDisabled:!1}:"Error"===e?{label:"Error",dotClass:"bg-red-500",borderClass:"border-red-500/60",pulse:!1,previewDisabled:!0}:{label:"Ready",dotClass:"bg-sky-500",borderClass:"",pulse:!1,previewDisabled:!1}}e.s(["TriangleAlert",()=>t.default],370002),e.s(["deriveAppLiveStatus",()=>a],657365)},440106,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(711719),s=e.i(935946),i=e.i(83428),n=e.i(542049),o=e.i(453360),l=e.i(941698),d=e.i(99105),c=e.i(723925),p=e.i(860253);e.i(541001);var u=e.i(64780),m=e.i(131777),h=e.i(508893);let x=(0,h.createServerReference)("40d176da178e45af59822102e0d80a18f21a8f0b6c",h.callServer,void 0,h.findSourceMapURL,"createProjectAndFeature"),g=(0,h.createServerReference)("4085beb536f5fc534bfcb61f7ab3fe8bc708ed412a",h.callServer,void 0,h.findSourceMapURL,"createApplication");var b=e.i(41413);e.i(650032);var f=e.i(486254);e.i(692233);var v=e.i(210025),j=e.i(102828),w=e.i(470646),y=e.i(731151);let N=["application","fast","spec"],k={application:{icon:n.LayoutGrid,label:"Application",placeholder:"Build a modern e-commerce storefront with product catalog...",suggestions:["A landing page with hero, features, and pricing sections","Full-stack SaaS app with auth, billing, and dashboard","Mobile-first social media app with real-time chat","Personal portfolio with blog and project showcase"]},fast:{icon:o.Zap,label:"Fast",placeholder:"Add a dark mode toggle to the settings page...",suggestions:["Add pagination to the users list endpoint","Fix the broken logout redirect","Add input validation to the signup form","Refactor the API error handling middleware"]},spec:{icon:l.ClipboardList,label:"Spec Driven",placeholder:"Implement a role-based access control system with audit logging...",suggestions:["OAuth2 authentication with SSO and MFA support","Event-driven notification system with email and push","REST API with versioning, rate limiting, and OpenAPI docs","Data pipeline with ETL, validation, and monitoring"]}};function C({onRepositorySelect:e,onApplicationCreated:n,onClose:o,className:l}){let{t:h}=(0,u.useTranslation)("web"),[C,D]=(0,a.useState)(""),[S,A]=(0,a.useState)(void 0),[P,T]=(0,a.useState)(void 0),[L,_]=(0,a.useState)("application"),[E,O]=(0,a.useState)(!1),[R,z]=(0,a.useState)(null),[F,M]=(0,a.useState)(!1),B=(0,a.useRef)(null),I=(0,y.useAttachments)(),K=(0,a.useCallback)(()=>{_(e=>{let t=N.indexOf(e);return N[(t+1)%N.length]})},[]);(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&o&&o(),"Tab"===e.key&&e.shiftKey&&(e.preventDefault(),K())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o,K]);let $=(0,a.useCallback)(async()=>{if(C.trim()&&!E){O(!0),z(null);try{if("application"===L){let e=await g({description:C.trim(),agentType:S,modelOverride:P,initialPrompt:C.trim()});if(e.error){z(e.error),O(!1);return}e.application&&n?.(e.application.id)}else{let t=await x({description:C.trim(),attachments:I.completedAttachments.map(e=>({path:e.path,name:e.name,notes:e.notes})),agentType:S,model:P,fast:"fast"===L});if(t.error){z(t.error),O(!1);return}t.repositoryPath&&e?.(t.repositoryPath),t.feature&&t.repositoryPath&&window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.repositoryPath}}))}}catch{z("Something went wrong. Please try again."),O(!1)}}},[C,E,L,I.completedAttachments,S,P,e,n]),q=(0,a.useCallback)(e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),$())},[$]),G=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/dialog/pick-files");if(!e.ok)return;let t=await e.json();if(!t.paths?.length)return;for(let e of t.paths){let t=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,sessionId:"onboarding"})});if(!t.ok)continue;let a=await t.json();I.addAttachment(a)}}catch{}},[I.addAttachment]),U=(0,a.useCallback)(e=>{D(e),B.current?.focus()},[]),H=k[L],Q=H.icon;return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,m.cn)("relative flex h-full w-full flex-col items-center justify-center overflow-hidden px-8",l),children:[(0,t.jsx)("div",{className:"onboard-bg pointer-events-none absolute inset-0 animate-[onboard-fade-in_1.2s_ease-out_both]"}),o?(0,t.jsx)("button",{type:"button",onClick:o,"aria-label":"Close",className:"text-muted-foreground hover:text-foreground hover:bg-accent/50 absolute top-4 right-4 z-10 cursor-pointer rounded p-1.5 transition-colors",children:(0,t.jsx)(p.X,{className:"h-5 w-5"})}):null,(0,t.jsxs)("div",{className:"relative flex w-full max-w-2xl flex-col items-center",children:[(0,t.jsx)("div",{className:"mb-6 animate-[onboard-logo_0.8s_cubic-bezier(0.16,1,0.3,1)_both]",style:{animationDelay:"0ms"},children:(0,t.jsx)(v.ShepLogo,{size:72,className:"text-foreground"})}),(0,t.jsx)("h1",{className:"text-foreground animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both] text-center text-5xl font-extralight tracking-tight",style:{animationDelay:"120ms"},children:"What do you want to build?"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-3 animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both] text-center text-lg leading-relaxed font-light",style:{animationDelay:"220ms"},children:"Describe your idea and Shep creates the project for you."}),(0,t.jsxs)("div",{className:"mt-10 w-full animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both]",style:{animationDelay:"350ms"},children:[(0,t.jsxs)("div",{onFocus:()=>M(!0),onBlur:()=>M(!1),onDragEnter:I.handleDragEnter,onDragLeave:I.handleDragLeave,onDragOver:I.handleDragOver,onDrop:I.handleDrop,className:(0,m.cn)("flex flex-col rounded-xl border transition-all duration-200","border-border/60 bg-background shadow-sm dark:border-white/10 dark:bg-white/[0.04]",F&&"ring-ring/50 border-ring shadow-md ring-[3px] dark:border-orange-500/40 dark:ring-orange-500/25",I.isDragOver&&"border-primary/50 bg-primary/5",E&&"opacity-70"),children:[(0,t.jsx)("textarea",{ref:B,rows:2,autoFocus:!0,value:C,onChange:e=>D(e.target.value),onKeyDown:q,onPaste:I.handlePaste,placeholder:H.placeholder,disabled:E,className:"text-foreground placeholder:text-muted-foreground/60 max-h-[10rem] min-h-[4.5rem] w-full resize-none border-0 bg-transparent px-4 py-3.5 text-sm leading-relaxed focus:outline-none disabled:cursor-not-allowed"}),I.attachments.length>0?(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2.5 overflow-x-auto overflow-y-visible px-5 pt-2 pb-2",children:I.attachments.map(e=>(0,t.jsx)(f.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>I.removeAttachment(e.id),loading:e.loading,notes:e.notes,onNotesChange:t=>I.updateNotes(e.id,t)},e.id))}):null,I.uploadError?(0,t.jsx)("p",{className:"text-destructive px-4 pb-2 text-xs",children:I.uploadError}):null,(0,t.jsxs)("div",{className:"border-border/60 flex shrink-0 items-center gap-3 border-t px-3 py-2 dark:border-white/10",children:[(0,t.jsx)(b.AgentModelPicker,{initialAgentType:S??"claude-code",initialModel:P??"claude-sonnet-4-6",mode:"override",showInstallStatus:!0,onAgentModelChange:(e,t)=>{A(e),T(t)},className:"w-55"}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(w.DropdownMenu,{children:[(0,t.jsx)(w.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button","data-testid":"build-mode-selector",className:"text-muted-foreground hover:text-foreground hover:bg-accent/50 flex cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 text-xs transition-colors",children:[(0,t.jsxs)("span",{className:"flex animate-[onboard-fade-up_0.25s_ease-out_both] items-center gap-1.5",children:[(0,t.jsx)(Q,{className:"h-3.5 w-3.5"}),H.label]},L),(0,t.jsx)(d.ChevronDown,{className:"h-3 w-3 opacity-50"})]})}),(0,t.jsx)(w.DropdownMenuContent,{align:"end",className:"min-w-[160px]",children:N.map(e=>{let a=k[e],r=a.icon,s=L===e;return(0,t.jsxs)(w.DropdownMenuItem,{onClick:()=>_(e),"data-testid":`build-mode-${e}`,className:"flex items-center gap-2",children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1",children:a.label}),s?(0,t.jsx)(c.Check,{className:"text-foreground h-3.5 w-3.5"}):null]},e)})})]}),(0,t.jsxs)(j.Tooltip,{children:[(0,t.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:G,disabled:E,"aria-label":h("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors disabled:opacity-50",children:(0,t.jsx)(s.Paperclip,{className:"h-4 w-4"})})}),(0,t.jsx)(j.TooltipContent,{side:"top",children:h("chat.attachFiles")})]}),(0,t.jsx)("button",{type:"button",onClick:$,disabled:!C.trim()||E,className:(0,m.cn)("bg-foreground text-background inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg","hover:bg-foreground/90 disabled:pointer-events-none disabled:opacity-30","transition-all duration-150"),children:E?(0,t.jsx)(i.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(r.SendHorizontal,{className:"h-3.5 w-3.5"})})]})]}),R?(0,t.jsx)("p",{className:"text-destructive mt-2 text-center text-sm",children:R}):null]}),(0,t.jsx)("div",{className:"mt-6 flex animate-[onboard-fade-up_0.4s_ease-out_both] flex-wrap justify-center gap-2",children:H.suggestions.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>U(e),disabled:E,className:"text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-accent/50 cursor-pointer rounded-full border px-3.5 py-1.5 text-xs transition-all duration-150 disabled:opacity-50 dark:border-white/10 dark:hover:border-white/20 dark:hover:bg-white/[0.06]",children:e},e))},L)]})]})}e.s(["ControlCenterEmptyState",()=>C],440106)},453721,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(711434),s=e.i(962885),i=e.i(542049),n=e.i(83428),o=e.i(3214),l=e.i(131777),d=e.i(873504),c=e.i(440106),p=e.i(958481),u=e.i(730702);let m=(0,e.i(903645).default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);var h=e.i(32494),x=e.i(724042),g=e.i(64970),b=e.i(267669),f=e.i(370002),v=e.i(434682),j=e.i(360112),w=e.i(735364),y=e.i(602287),N=e.i(224011),k=e.i(657365),C=e.i(680554),D=e.i(8537),S=e.i(317406);function A({application:e,className:s}){let o=(0,r.useRouter)(),d=(0,v.useQueryClient)(),[c,p]=(0,a.useState)(!1),h=(0,C.useTurnStatus)(`app-${e.id}`),f=(0,D.useDeployAction)({targetId:e.id,targetType:"application",repositoryPath:e.repositoryPath}),A=f.url,T=(0,k.deriveAppLiveStatus)(e.status,h,!!A,e.effectiveStatus),L=1+(e.additionalPaths?.length??0),_=e.repositoryPath.split("/").pop()??e.repositoryPath;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"application-card",onClick:()=>o.push(`/application/${e.id}`),className:(0,l.cn)("bg-card group relative cursor-pointer overflow-hidden rounded-xl border shadow-sm transition-[border-color,box-shadow] duration-200 hover:shadow-lg dark:bg-neutral-800/80",T.borderClass,s),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 pt-4 pb-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-indigo-500 to-violet-500",children:(0,t.jsx)(i.LayoutGrid,{className:"h-4 w-4 text-white"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{"data-testid":"application-card-name",className:"truncate text-sm font-medium",children:e.name}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 truncate text-[11px]",children:e.description})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:(0,l.cn)("relative flex h-2 w-2 items-center justify-center rounded-full",T.dotClass),children:T.pulse?(0,t.jsx)("span",{className:(0,l.cn)("absolute inline-flex h-full w-full animate-ping rounded-full opacity-60",T.dotClass)}):null}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:T.label})]})]}),(0,t.jsx)("div",{className:"px-4",children:(0,t.jsxs)("div",{className:"bg-muted group/preview relative overflow-hidden rounded-lg",style:{height:140},children:[A?(0,t.jsx)("iframe",{src:A,title:`${e.name} live preview`,className:"pointer-events-none absolute top-0 left-0 origin-top-left border-0 bg-white",style:{width:"250%",height:"250%",transform:"scale(0.4)"},sandbox:"allow-same-origin allow-scripts",loading:"lazy"}):(0,t.jsx)(P,{effectiveStatus:e.effectiveStatus}),f.status===S.DeploymentState.Ready&&A?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-neutral-900/75 opacity-0 transition-opacity duration-150 group-hover/preview:pointer-events-auto group-hover/preview:opacity-100 dark:bg-neutral-950/80",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),f.stop()},disabled:f.stopLoading,className:"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md border border-neutral-300 bg-white px-3 text-[11px] font-semibold text-neutral-900 shadow-md transition-colors hover:border-red-500 hover:bg-red-50 hover:text-red-600 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:hover:border-red-500 dark:hover:bg-red-950 dark:hover:text-red-400",children:[f.stopLoading?(0,t.jsx)(n.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(g.Square,{className:"h-3 w-3 fill-current"}),"Stop"]}),(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),A&&window.open(A,"_blank","noopener,noreferrer")},className:"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md border border-neutral-300 bg-white px-3 text-[11px] font-semibold text-neutral-900 shadow-md transition-colors hover:bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:hover:bg-neutral-800",children:[(0,t.jsx)(u.ExternalLink,{className:"h-3 w-3"}),"Open"]})]}):null,f.status===S.DeploymentState.Booting||f.deployLoading?(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-neutral-100 dark:bg-neutral-900",children:[(0,t.jsx)(n.Loader2,{className:"h-6 w-6 animate-spin text-amber-500"}),(0,t.jsx)("span",{className:"text-foreground text-[11px] font-medium",children:"Starting…"})]}):null,!T.previewDisabled&&!A&&!f.deployLoading&&f.status!==S.DeploymentState.Booting&&!f.deployError&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-neutral-900/75 opacity-0 transition-opacity duration-150 group-hover/preview:pointer-events-auto group-hover/preview:opacity-100 dark:bg-neutral-950/80",children:(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),f.deploy()},className:"inline-flex h-8 cursor-pointer items-center gap-2 rounded-md border border-violet-400 bg-gradient-to-br from-indigo-500 to-violet-600 px-4 text-[11px] font-semibold text-white shadow-md transition-[filter] hover:brightness-110",children:[(0,t.jsx)(x.Play,{className:"h-3 w-3 fill-current"}),"Start Preview"]})}),"interrupted"===e.effectiveStatus&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-amber-950/60 opacity-0 transition-opacity duration-150 group-hover/preview:pointer-events-auto group-hover/preview:opacity-100",children:(0,t.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),fetch(`/api/applications/${e.id}/resume`,{method:"POST"})},className:"inline-flex h-8 cursor-pointer items-center gap-2 rounded-md border border-amber-400 bg-gradient-to-br from-amber-500 to-orange-500 px-4 text-[11px] font-semibold text-white shadow-md transition-[filter] hover:brightness-110",children:[(0,t.jsx)(x.Play,{className:"h-3 w-3 fill-current"}),"Continue Build"]})}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),p(!0)},className:"absolute top-1.5 right-1.5 z-20 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md bg-white/80 text-neutral-500 opacity-0 shadow-sm backdrop-blur-sm transition-all group-hover:opacity-100 hover:!bg-red-500 hover:!text-white dark:bg-neutral-800/80 dark:text-neutral-400","aria-label":`Delete ${e.name}`,title:"Delete application",children:(0,t.jsx)(b.Trash2,{className:"h-3 w-3"})})]})}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 pt-3 pb-4",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1.5 text-[11px]",children:[(0,t.jsx)(m,{className:"h-3 w-3"}),_,L>1&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["+",L-1]})]}),(0,t.jsx)("span",{className:"text-muted-foreground/60 text-[10px]",children:new Date(e.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]})]}),(0,t.jsx)(y.Dialog,{open:c,onOpenChange:p,children:(0,t.jsxs)(y.DialogContent,{className:"max-w-xs",children:[(0,t.jsxs)(y.DialogHeader,{children:[(0,t.jsx)(y.DialogTitle,{children:"Delete application?"}),(0,t.jsxs)(y.DialogDescription,{children:["This will permanently remove ",(0,t.jsx)("strong",{children:e.name}),"."]})]}),(0,t.jsxs)(y.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(y.DialogClose,{asChild:!0,children:(0,t.jsx)(w.Button,{variant:"outline",children:"Cancel"})}),(0,t.jsx)(w.Button,{variant:"destructive",onClick:async()=>{p(!1);let t=await (0,N.deleteApplication)(e.id);t.error?j.toast.error("Failed to delete",{description:t.error}):(j.toast.success("Application deleted"),d.invalidateQueries({queryKey:["applications"]}))},children:"Delete"})]})]})})]})}function P({effectiveStatus:e}){return"failed"===e?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2 bg-red-50 dark:bg-red-950/30",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/50",children:(0,t.jsx)(f.TriangleAlert,{className:"h-5 w-5 text-red-500"})}),(0,t.jsx)("span",{className:"text-[11px] font-medium text-red-600 dark:text-red-400",children:"Build failed"}),(0,t.jsx)("span",{className:"text-muted-foreground/60 text-[10px]",children:"Open app to retry"})]}):"interrupted"===e?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2 bg-amber-50 dark:bg-amber-950/20",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/40",children:(0,t.jsx)(p.AlertTriangle,{className:"h-5 w-5 text-amber-500"})}),(0,t.jsx)("span",{className:"text-[11px] font-medium text-amber-600 dark:text-amber-400",children:"Build interrupted"}),(0,t.jsx)("span",{className:"text-muted-foreground/60 text-[10px]",children:"Open app to continue"})]}):"building"===e?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2",children:[(0,t.jsx)(n.Loader2,{className:"h-6 w-6 animate-spin text-violet-500"}),(0,t.jsx)("span",{className:"text-[11px] font-medium text-violet-600 dark:text-violet-400",children:"Building…"})]}):(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-indigo-500/10 to-violet-500/10",children:(0,t.jsx)(h.Globe,{className:"text-muted-foreground/30 h-5 w-5"})}),(0,t.jsxs)("div",{className:"absolute inset-0 opacity-30",children:[(0,t.jsxs)("div",{className:"flex h-5 items-center gap-1.5 px-2",style:{background:"var(--muted)"},children:[(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-1.5 w-1.5 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-1.5 w-1.5 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-1.5 w-1.5 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 ms-1.5 h-1.5 w-12 rounded"})]}),(0,t.jsxs)("div",{className:"flex h-[calc(100%-1.25rem)]",children:[(0,t.jsxs)("div",{className:"border-muted-foreground/5 flex w-[40px] flex-col gap-1.5 border-e p-1.5",children:[(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-full rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-3/4 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-full rounded"})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1.5 p-2.5",children:[(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-2 w-2/3 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-full rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-5/6 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-3/4 rounded"})]})]})]})]})}function T({className:e}){let p=(0,r.useRouter)(),[u,m]=(0,a.useState)(!1),{data:h=[],isLoading:x}=(0,s.useQuery)({queryKey:["applications"],queryFn:async()=>{let e=await fetch("/api/applications");if(!e.ok)throw Error("Failed to fetch applications");return e.json()},staleTime:3e4}),g=(0,a.useMemo)(()=>[...h].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()),[h]);return(0,t.jsx)(d.DeploymentStatusProvider,{initialDeployments:[],children:(0,t.jsxs)("div",{"data-testid":"applications-page-client",className:(0,l.cn)("relative space-y-4",e),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.LayoutGrid,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Applications"}),x?null:(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:[h.length," ",1===h.length?"app":"apps"]})]}),x?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(n.Loader2,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):0===h.length?(0,t.jsxs)("div",{"data-testid":"applications-page-empty",className:"text-muted-foreground flex flex-col items-center justify-center py-12 text-center",children:[(0,t.jsx)(i.LayoutGrid,{className:"mb-2 h-6 w-6 opacity-20"}),(0,t.jsx)("p",{className:"text-xs",children:"No applications yet."}),(0,t.jsxs)("button",{type:"button",onClick:()=>m(!0),className:"mt-3 inline-flex items-center gap-1.5 rounded-md bg-indigo-500 px-3 py-1.5 text-[11px] font-semibold text-white shadow-sm transition-colors hover:bg-indigo-400",children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3"}),"New application"]})]}):(0,t.jsx)("div",{"data-testid":"applications-page-grid",className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:g.map(e=>(0,t.jsx)(A,{application:e},e.id))}),(0,t.jsx)("button",{type:"button","data-testid":"applications-fab-new","aria-label":"New application",onClick:()=>m(!0),className:"fixed right-6 bottom-6 z-40 flex h-14 w-14 cursor-pointer items-center justify-center rounded-full bg-indigo-500 text-white shadow-lg transition-all duration-200 hover:scale-105 hover:bg-indigo-400 hover:shadow-xl active:scale-95",children:(0,t.jsx)(o.Plus,{className:"h-7 w-7 stroke-[2.5]"})}),u?(0,t.jsx)("div",{className:"fixed inset-0 z-50",children:(0,t.jsx)(c.ControlCenterEmptyState,{onApplicationCreated:e=>{p.push(`/application/${e}`)},onClose:()=>m(!1),className:"bg-background"})}):null]})})}e.s(["ApplicationsPageClient",()=>T],453721)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,729288,e=>{"use strict";var t=e.i(508893);let a=(0,t.createServerReference)("40f071462c1f272b773937160004afa67c7eebc4f4",t.callServer,void 0,t.findSourceMapURL,"deleteApplication");e.s(["deleteApplication",()=>a])},370002,657365,e=>{"use strict";var t=e.i(215131);function a(e,t,a,r){return"processing"===t?{label:"In Progress",dotClass:"bg-violet-500",borderClass:"",pulse:!0,previewDisabled:!0}:"awaiting_input"===t?{label:"Action Required",dotClass:"bg-amber-500",borderClass:"border-amber-500/60",pulse:!0,previewDisabled:!0}:"interrupted"===r?{label:"Interrupted",dotClass:"bg-amber-500",borderClass:"border-amber-500/60",pulse:!1,previewDisabled:!0}:"failed"===r?{label:"Failed",dotClass:"bg-red-500",borderClass:"border-red-500/60",pulse:!1,previewDisabled:!0}:"building"===r?{label:"In Progress",dotClass:"bg-violet-500",borderClass:"",pulse:!0,previewDisabled:!0}:a?{label:"Live",dotClass:"bg-emerald-500",borderClass:"",pulse:!0,previewDisabled:!1}:"Error"===e?{label:"Error",dotClass:"bg-red-500",borderClass:"border-red-500/60",pulse:!1,previewDisabled:!0}:{label:"Ready",dotClass:"bg-sky-500",borderClass:"",pulse:!1,previewDisabled:!1}}e.s(["TriangleAlert",()=>t.default],370002),e.s(["deriveAppLiveStatus",()=>a],657365)},440106,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(711719),s=e.i(935946),i=e.i(83428),n=e.i(542049),o=e.i(453360),l=e.i(941698),d=e.i(99105),c=e.i(723925),p=e.i(860253);e.i(541001);var u=e.i(64780),m=e.i(131777),h=e.i(508893);let x=(0,h.createServerReference)("40cd2327774da4281c3bc9ec254c5afd33df989a47",h.callServer,void 0,h.findSourceMapURL,"createProjectAndFeature"),g=(0,h.createServerReference)("40630a38df580440120c7d9746bf2041ac6b44ef6e",h.callServer,void 0,h.findSourceMapURL,"createApplication");var b=e.i(41413);e.i(650032);var f=e.i(486254);e.i(692233);var v=e.i(210025),j=e.i(102828),w=e.i(470646),y=e.i(731151);let N=["application","fast","spec"],k={application:{icon:n.LayoutGrid,label:"Application",placeholder:"Build a modern e-commerce storefront with product catalog...",suggestions:["A landing page with hero, features, and pricing sections","Full-stack SaaS app with auth, billing, and dashboard","Mobile-first social media app with real-time chat","Personal portfolio with blog and project showcase"]},fast:{icon:o.Zap,label:"Fast",placeholder:"Add a dark mode toggle to the settings page...",suggestions:["Add pagination to the users list endpoint","Fix the broken logout redirect","Add input validation to the signup form","Refactor the API error handling middleware"]},spec:{icon:l.ClipboardList,label:"Spec Driven",placeholder:"Implement a role-based access control system with audit logging...",suggestions:["OAuth2 authentication with SSO and MFA support","Event-driven notification system with email and push","REST API with versioning, rate limiting, and OpenAPI docs","Data pipeline with ETL, validation, and monitoring"]}};function C({onRepositorySelect:e,onApplicationCreated:n,onClose:o,className:l}){let{t:h}=(0,u.useTranslation)("web"),[C,D]=(0,a.useState)(""),[S,A]=(0,a.useState)(void 0),[P,T]=(0,a.useState)(void 0),[L,_]=(0,a.useState)("application"),[E,O]=(0,a.useState)(!1),[R,z]=(0,a.useState)(null),[F,M]=(0,a.useState)(!1),B=(0,a.useRef)(null),I=(0,y.useAttachments)(),K=(0,a.useCallback)(()=>{_(e=>{let t=N.indexOf(e);return N[(t+1)%N.length]})},[]);(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&o&&o(),"Tab"===e.key&&e.shiftKey&&(e.preventDefault(),K())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[o,K]);let $=(0,a.useCallback)(async()=>{if(C.trim()&&!E){O(!0),z(null);try{if("application"===L){let e=await g({description:C.trim(),agentType:S,modelOverride:P,initialPrompt:C.trim()});if(e.error){z(e.error),O(!1);return}e.application&&n?.(e.application.id)}else{let t=await x({description:C.trim(),attachments:I.completedAttachments.map(e=>({path:e.path,name:e.name,notes:e.notes})),agentType:S,model:P,fast:"fast"===L});if(t.error){z(t.error),O(!1);return}t.repositoryPath&&e?.(t.repositoryPath),t.feature&&t.repositoryPath&&window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.repositoryPath}}))}}catch{z("Something went wrong. Please try again."),O(!1)}}},[C,E,L,I.completedAttachments,S,P,e,n]),q=(0,a.useCallback)(e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),$())},[$]),G=(0,a.useCallback)(async()=>{try{let e=await fetch("/api/dialog/pick-files");if(!e.ok)return;let t=await e.json();if(!t.paths?.length)return;for(let e of t.paths){let t=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,sessionId:"onboarding"})});if(!t.ok)continue;let a=await t.json();I.addAttachment(a)}}catch{}},[I.addAttachment]),U=(0,a.useCallback)(e=>{D(e),B.current?.focus()},[]),H=k[L],Q=H.icon;return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,m.cn)("relative flex h-full w-full flex-col items-center justify-center overflow-hidden px-8",l),children:[(0,t.jsx)("div",{className:"onboard-bg pointer-events-none absolute inset-0 animate-[onboard-fade-in_1.2s_ease-out_both]"}),o?(0,t.jsx)("button",{type:"button",onClick:o,"aria-label":"Close",className:"text-muted-foreground hover:text-foreground hover:bg-accent/50 absolute top-4 right-4 z-10 cursor-pointer rounded p-1.5 transition-colors",children:(0,t.jsx)(p.X,{className:"h-5 w-5"})}):null,(0,t.jsxs)("div",{className:"relative flex w-full max-w-2xl flex-col items-center",children:[(0,t.jsx)("div",{className:"mb-6 animate-[onboard-logo_0.8s_cubic-bezier(0.16,1,0.3,1)_both]",style:{animationDelay:"0ms"},children:(0,t.jsx)(v.ShepLogo,{size:72,className:"text-foreground"})}),(0,t.jsx)("h1",{className:"text-foreground animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both] text-center text-5xl font-extralight tracking-tight",style:{animationDelay:"120ms"},children:"What do you want to build?"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-3 animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both] text-center text-lg leading-relaxed font-light",style:{animationDelay:"220ms"},children:"Describe your idea and Shep creates the project for you."}),(0,t.jsxs)("div",{className:"mt-10 w-full animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both]",style:{animationDelay:"350ms"},children:[(0,t.jsxs)("div",{onFocus:()=>M(!0),onBlur:()=>M(!1),onDragEnter:I.handleDragEnter,onDragLeave:I.handleDragLeave,onDragOver:I.handleDragOver,onDrop:I.handleDrop,className:(0,m.cn)("flex flex-col rounded-xl border transition-all duration-200","border-border/60 bg-background shadow-sm dark:border-white/10 dark:bg-white/[0.04]",F&&"ring-ring/50 border-ring shadow-md ring-[3px] dark:border-orange-500/40 dark:ring-orange-500/25",I.isDragOver&&"border-primary/50 bg-primary/5",E&&"opacity-70"),children:[(0,t.jsx)("textarea",{ref:B,rows:2,autoFocus:!0,value:C,onChange:e=>D(e.target.value),onKeyDown:q,onPaste:I.handlePaste,placeholder:H.placeholder,disabled:E,className:"text-foreground placeholder:text-muted-foreground/60 max-h-[10rem] min-h-[4.5rem] w-full resize-none border-0 bg-transparent px-4 py-3.5 text-sm leading-relaxed focus:outline-none disabled:cursor-not-allowed"}),I.attachments.length>0?(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2.5 overflow-x-auto overflow-y-visible px-5 pt-2 pb-2",children:I.attachments.map(e=>(0,t.jsx)(f.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>I.removeAttachment(e.id),loading:e.loading,notes:e.notes,onNotesChange:t=>I.updateNotes(e.id,t)},e.id))}):null,I.uploadError?(0,t.jsx)("p",{className:"text-destructive px-4 pb-2 text-xs",children:I.uploadError}):null,(0,t.jsxs)("div",{className:"border-border/60 flex shrink-0 items-center gap-3 border-t px-3 py-2 dark:border-white/10",children:[(0,t.jsx)(b.AgentModelPicker,{initialAgentType:S??"claude-code",initialModel:P??"claude-sonnet-4-6",mode:"override",showInstallStatus:!0,onAgentModelChange:(e,t)=>{A(e),T(t)},className:"w-55"}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(w.DropdownMenu,{children:[(0,t.jsx)(w.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button","data-testid":"build-mode-selector",className:"text-muted-foreground hover:text-foreground hover:bg-accent/50 flex cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 text-xs transition-colors",children:[(0,t.jsxs)("span",{className:"flex animate-[onboard-fade-up_0.25s_ease-out_both] items-center gap-1.5",children:[(0,t.jsx)(Q,{className:"h-3.5 w-3.5"}),H.label]},L),(0,t.jsx)(d.ChevronDown,{className:"h-3 w-3 opacity-50"})]})}),(0,t.jsx)(w.DropdownMenuContent,{align:"end",className:"min-w-[160px]",children:N.map(e=>{let a=k[e],r=a.icon,s=L===e;return(0,t.jsxs)(w.DropdownMenuItem,{onClick:()=>_(e),"data-testid":`build-mode-${e}`,className:"flex items-center gap-2",children:[(0,t.jsx)(r,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1",children:a.label}),s?(0,t.jsx)(c.Check,{className:"text-foreground h-3.5 w-3.5"}):null]},e)})})]}),(0,t.jsxs)(j.Tooltip,{children:[(0,t.jsx)(j.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:G,disabled:E,"aria-label":h("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors disabled:opacity-50",children:(0,t.jsx)(s.Paperclip,{className:"h-4 w-4"})})}),(0,t.jsx)(j.TooltipContent,{side:"top",children:h("chat.attachFiles")})]}),(0,t.jsx)("button",{type:"button",onClick:$,disabled:!C.trim()||E,className:(0,m.cn)("bg-foreground text-background inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg","hover:bg-foreground/90 disabled:pointer-events-none disabled:opacity-30","transition-all duration-150"),children:E?(0,t.jsx)(i.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(r.SendHorizontal,{className:"h-3.5 w-3.5"})})]})]}),R?(0,t.jsx)("p",{className:"text-destructive mt-2 text-center text-sm",children:R}):null]}),(0,t.jsx)("div",{className:"mt-6 flex animate-[onboard-fade-up_0.4s_ease-out_both] flex-wrap justify-center gap-2",children:H.suggestions.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>U(e),disabled:E,className:"text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-accent/50 cursor-pointer rounded-full border px-3.5 py-1.5 text-xs transition-all duration-150 disabled:opacity-50 dark:border-white/10 dark:hover:border-white/20 dark:hover:bg-white/[0.06]",children:e},e))},L)]})]})}e.s(["ControlCenterEmptyState",()=>C],440106)},453721,e=>{"use strict";var t=e.i(679606),a=e.i(152155),r=e.i(711434),s=e.i(962885),i=e.i(542049),n=e.i(83428),o=e.i(3214),l=e.i(131777),d=e.i(873504),c=e.i(440106),p=e.i(958481),u=e.i(730702);let m=(0,e.i(903645).default)("folder-git-2",[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);var h=e.i(32494),x=e.i(724042),g=e.i(64970),b=e.i(267669),f=e.i(370002),v=e.i(434682),j=e.i(360112),w=e.i(735364),y=e.i(602287),N=e.i(729288),k=e.i(657365),C=e.i(680554),D=e.i(8537),S=e.i(317406);function A({application:e,className:s}){let o=(0,r.useRouter)(),d=(0,v.useQueryClient)(),[c,p]=(0,a.useState)(!1),h=(0,C.useTurnStatus)(`app-${e.id}`),f=(0,D.useDeployAction)({targetId:e.id,targetType:"application",repositoryPath:e.repositoryPath}),A=f.url,T=(0,k.deriveAppLiveStatus)(e.status,h,!!A,e.effectiveStatus),L=1+(e.additionalPaths?.length??0),_=e.repositoryPath.split("/").pop()??e.repositoryPath;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{"data-testid":"application-card",onClick:()=>o.push(`/application/${e.id}`),className:(0,l.cn)("bg-card group relative cursor-pointer overflow-hidden rounded-xl border shadow-sm transition-[border-color,box-shadow] duration-200 hover:shadow-lg dark:bg-neutral-800/80",T.borderClass,s),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 pt-4 pb-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-indigo-500 to-violet-500",children:(0,t.jsx)(i.LayoutGrid,{className:"h-4 w-4 text-white"})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{"data-testid":"application-card-name",className:"truncate text-sm font-medium",children:e.name}),(0,t.jsx)("p",{className:"text-muted-foreground mt-0.5 truncate text-[11px]",children:e.description})]}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)("span",{className:(0,l.cn)("relative flex h-2 w-2 items-center justify-center rounded-full",T.dotClass),children:T.pulse?(0,t.jsx)("span",{className:(0,l.cn)("absolute inline-flex h-full w-full animate-ping rounded-full opacity-60",T.dotClass)}):null}),(0,t.jsx)("span",{className:"text-muted-foreground text-[10px]",children:T.label})]})]}),(0,t.jsx)("div",{className:"px-4",children:(0,t.jsxs)("div",{className:"bg-muted group/preview relative overflow-hidden rounded-lg",style:{height:140},children:[A?(0,t.jsx)("iframe",{src:A,title:`${e.name} live preview`,className:"pointer-events-none absolute top-0 left-0 origin-top-left border-0 bg-white",style:{width:"250%",height:"250%",transform:"scale(0.4)"},sandbox:"allow-same-origin allow-scripts",loading:"lazy"}):(0,t.jsx)(P,{effectiveStatus:e.effectiveStatus}),f.status===S.DeploymentState.Ready&&A?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-neutral-900/75 opacity-0 transition-opacity duration-150 group-hover/preview:pointer-events-auto group-hover/preview:opacity-100 dark:bg-neutral-950/80",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),f.stop()},disabled:f.stopLoading,className:"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md border border-neutral-300 bg-white px-3 text-[11px] font-semibold text-neutral-900 shadow-md transition-colors hover:border-red-500 hover:bg-red-50 hover:text-red-600 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:hover:border-red-500 dark:hover:bg-red-950 dark:hover:text-red-400",children:[f.stopLoading?(0,t.jsx)(n.Loader2,{className:"h-3 w-3 animate-spin"}):(0,t.jsx)(g.Square,{className:"h-3 w-3 fill-current"}),"Stop"]}),(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),A&&window.open(A,"_blank","noopener,noreferrer")},className:"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-md border border-neutral-300 bg-white px-3 text-[11px] font-semibold text-neutral-900 shadow-md transition-colors hover:bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:hover:bg-neutral-800",children:[(0,t.jsx)(u.ExternalLink,{className:"h-3 w-3"}),"Open"]})]}):null,f.status===S.DeploymentState.Booting||f.deployLoading?(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-neutral-100 dark:bg-neutral-900",children:[(0,t.jsx)(n.Loader2,{className:"h-6 w-6 animate-spin text-amber-500"}),(0,t.jsx)("span",{className:"text-foreground text-[11px] font-medium",children:"Starting…"})]}):null,!T.previewDisabled&&!A&&!f.deployLoading&&f.status!==S.DeploymentState.Booting&&!f.deployError&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-neutral-900/75 opacity-0 transition-opacity duration-150 group-hover/preview:pointer-events-auto group-hover/preview:opacity-100 dark:bg-neutral-950/80",children:(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),f.deploy()},className:"inline-flex h-8 cursor-pointer items-center gap-2 rounded-md border border-violet-400 bg-gradient-to-br from-indigo-500 to-violet-600 px-4 text-[11px] font-semibold text-white shadow-md transition-[filter] hover:brightness-110",children:[(0,t.jsx)(x.Play,{className:"h-3 w-3 fill-current"}),"Start Preview"]})}),"interrupted"===e.effectiveStatus&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-amber-950/60 opacity-0 transition-opacity duration-150 group-hover/preview:pointer-events-auto group-hover/preview:opacity-100",children:(0,t.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),fetch(`/api/applications/${e.id}/resume`,{method:"POST"})},className:"inline-flex h-8 cursor-pointer items-center gap-2 rounded-md border border-amber-400 bg-gradient-to-br from-amber-500 to-orange-500 px-4 text-[11px] font-semibold text-white shadow-md transition-[filter] hover:brightness-110",children:[(0,t.jsx)(x.Play,{className:"h-3 w-3 fill-current"}),"Continue Build"]})}),(0,t.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),p(!0)},className:"absolute top-1.5 right-1.5 z-20 flex h-6 w-6 cursor-pointer items-center justify-center rounded-md bg-white/80 text-neutral-500 opacity-0 shadow-sm backdrop-blur-sm transition-all group-hover:opacity-100 hover:!bg-red-500 hover:!text-white dark:bg-neutral-800/80 dark:text-neutral-400","aria-label":`Delete ${e.name}`,title:"Delete application",children:(0,t.jsx)(b.Trash2,{className:"h-3 w-3"})})]})}),(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 pt-3 pb-4",children:[(0,t.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1.5 text-[11px]",children:[(0,t.jsx)(m,{className:"h-3 w-3"}),_,L>1&&(0,t.jsxs)("span",{className:"text-muted-foreground/60",children:["+",L-1]})]}),(0,t.jsx)("span",{className:"text-muted-foreground/60 text-[10px]",children:new Date(e.createdAt).toLocaleDateString(void 0,{month:"short",day:"numeric"})})]})]}),(0,t.jsx)(y.Dialog,{open:c,onOpenChange:p,children:(0,t.jsxs)(y.DialogContent,{className:"max-w-xs",children:[(0,t.jsxs)(y.DialogHeader,{children:[(0,t.jsx)(y.DialogTitle,{children:"Delete application?"}),(0,t.jsxs)(y.DialogDescription,{children:["This will permanently remove ",(0,t.jsx)("strong",{children:e.name}),"."]})]}),(0,t.jsxs)(y.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(y.DialogClose,{asChild:!0,children:(0,t.jsx)(w.Button,{variant:"outline",children:"Cancel"})}),(0,t.jsx)(w.Button,{variant:"destructive",onClick:async()=>{p(!1);let t=await (0,N.deleteApplication)(e.id);t.error?j.toast.error("Failed to delete",{description:t.error}):(j.toast.success("Application deleted"),d.invalidateQueries({queryKey:["applications"]}))},children:"Delete"})]})]})})]})}function P({effectiveStatus:e}){return"failed"===e?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2 bg-red-50 dark:bg-red-950/30",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/50",children:(0,t.jsx)(f.TriangleAlert,{className:"h-5 w-5 text-red-500"})}),(0,t.jsx)("span",{className:"text-[11px] font-medium text-red-600 dark:text-red-400",children:"Build failed"}),(0,t.jsx)("span",{className:"text-muted-foreground/60 text-[10px]",children:"Open app to retry"})]}):"interrupted"===e?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2 bg-amber-50 dark:bg-amber-950/20",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/40",children:(0,t.jsx)(p.AlertTriangle,{className:"h-5 w-5 text-amber-500"})}),(0,t.jsx)("span",{className:"text-[11px] font-medium text-amber-600 dark:text-amber-400",children:"Build interrupted"}),(0,t.jsx)("span",{className:"text-muted-foreground/60 text-[10px]",children:"Open app to continue"})]}):"building"===e?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2",children:[(0,t.jsx)(n.Loader2,{className:"h-6 w-6 animate-spin text-violet-500"}),(0,t.jsx)("span",{className:"text-[11px] font-medium text-violet-600 dark:text-violet-400",children:"Building…"})]}):(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center gap-2",children:[(0,t.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-indigo-500/10 to-violet-500/10",children:(0,t.jsx)(h.Globe,{className:"text-muted-foreground/30 h-5 w-5"})}),(0,t.jsxs)("div",{className:"absolute inset-0 opacity-30",children:[(0,t.jsxs)("div",{className:"flex h-5 items-center gap-1.5 px-2",style:{background:"var(--muted)"},children:[(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-1.5 w-1.5 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-1.5 w-1.5 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-1.5 w-1.5 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 ms-1.5 h-1.5 w-12 rounded"})]}),(0,t.jsxs)("div",{className:"flex h-[calc(100%-1.25rem)]",children:[(0,t.jsxs)("div",{className:"border-muted-foreground/5 flex w-[40px] flex-col gap-1.5 border-e p-1.5",children:[(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-full rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-3/4 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-full rounded"})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1.5 p-2.5",children:[(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-2 w-2/3 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-full rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-5/6 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/8 h-1.5 w-3/4 rounded"})]})]})]})]})}function T({className:e}){let p=(0,r.useRouter)(),[u,m]=(0,a.useState)(!1),{data:h=[],isLoading:x}=(0,s.useQuery)({queryKey:["applications"],queryFn:async()=>{let e=await fetch("/api/applications");if(!e.ok)throw Error("Failed to fetch applications");return e.json()},staleTime:3e4}),g=(0,a.useMemo)(()=>[...h].sort((e,t)=>new Date(t.createdAt).getTime()-new Date(e.createdAt).getTime()),[h]);return(0,t.jsx)(d.DeploymentStatusProvider,{initialDeployments:[],children:(0,t.jsxs)("div",{"data-testid":"applications-page-client",className:(0,l.cn)("relative space-y-4",e),children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.LayoutGrid,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("h1",{className:"text-sm font-bold tracking-tight",children:"Applications"}),x?null:(0,t.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:[h.length," ",1===h.length?"app":"apps"]})]}),x?(0,t.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,t.jsx)(n.Loader2,{className:"text-muted-foreground h-5 w-5 animate-spin"})}):0===h.length?(0,t.jsxs)("div",{"data-testid":"applications-page-empty",className:"text-muted-foreground flex flex-col items-center justify-center py-12 text-center",children:[(0,t.jsx)(i.LayoutGrid,{className:"mb-2 h-6 w-6 opacity-20"}),(0,t.jsx)("p",{className:"text-xs",children:"No applications yet."}),(0,t.jsxs)("button",{type:"button",onClick:()=>m(!0),className:"mt-3 inline-flex items-center gap-1.5 rounded-md bg-indigo-500 px-3 py-1.5 text-[11px] font-semibold text-white shadow-sm transition-colors hover:bg-indigo-400",children:[(0,t.jsx)(o.Plus,{className:"h-3 w-3"}),"New application"]})]}):(0,t.jsx)("div",{"data-testid":"applications-page-grid",className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:g.map(e=>(0,t.jsx)(A,{application:e},e.id))}),(0,t.jsx)("button",{type:"button","data-testid":"applications-fab-new","aria-label":"New application",onClick:()=>m(!0),className:"fixed right-6 bottom-6 z-40 flex h-14 w-14 cursor-pointer items-center justify-center rounded-full bg-indigo-500 text-white shadow-lg transition-all duration-200 hover:scale-105 hover:bg-indigo-400 hover:shadow-xl active:scale-95",children:(0,t.jsx)(o.Plus,{className:"h-7 w-7 stroke-[2.5]"})}),u?(0,t.jsx)("div",{className:"fixed inset-0 z-50",children:(0,t.jsx)(c.ControlCenterEmptyState,{onApplicationCreated:e=>{p.push(`/application/${e}`)},onClose:()=>m(!1),className:"bg-background"})}):null]})})}e.s(["ApplicationsPageClient",()=>T],453721)}]);
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[110606,a=>{"use strict";var b=a.i(151969);a.s(["CheckIcon",()=>b.default])},738702,516223,a=>{"use strict";var b=a.i(556365),c=a.i(385536);function d({icon:a,title:d,description:e,action:f,className:g,...h}){return(0,b.jsxs)("div",{className:(0,c.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",g),...h,children:[a?(0,b.jsx)("div",{className:"text-muted-foreground",children:a}):null,(0,b.jsx)("h3",{className:"text-lg font-semibold",children:d}),e?(0,b.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:e}):null,f?(0,b.jsx)("div",{className:"mt-2",children:f}):null]})}a.s(["EmptyState",()=>d],516223),a.s([],738702)},218615,a=>{"use strict";let b=(0,a.i(225700).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"}]]);a.s(["RotateCcw",()=>b],218615)},69428,a=>{"use strict";let b=(0,a.i(225700).default)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);a.s(["ClipboardList",()=>b],69428)},483886,a=>{"use strict";let b=(0,a.i(225700).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"}]]);a.s(["Eye",()=>b],483886)},696853,a=>{"use strict";let b=(0,a.i(225700).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);a.s(["default",()=>b])},755628,a=>{"use strict";var b=a.i(944592),c=a.i(300513),d=a.i(173147),e=a.i(35758),f=a.i(289111);let g=(0,f.createServerReference)("409c36a7101750afbada42a943afe3cdf2f0eb9525",f.callServer,void 0,f.findSourceMapURL,"syncRepository");function h(a){let[f,h]=(0,b.useState)(!1),[i,j]=(0,b.useState)(!1),[k,l]=(0,b.useState)(!1),[m,n]=(0,b.useState)(!1),[o,p]=(0,b.useState)(null),[q,r]=(0,b.useState)(null),[s,t]=(0,b.useState)(null),[u,v]=(0,b.useState)(null),w=(0,b.useRef)(null),x=(0,b.useRef)(null),y=(0,b.useRef)(null),z=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{w.current&&clearTimeout(w.current),x.current&&clearTimeout(x.current),y.current&&clearTimeout(y.current),z.current&&clearTimeout(z.current)},[]);let A=(0,b.useCallback)(async(b,c,d,e,f)=>{if(a&&!f){e.current&&clearTimeout(e.current),c(!0),d(null);try{let a=await b();if(!a.success){let b=a.error??"An unexpected error occurred";d(b),e.current=setTimeout(()=>d(null),5e3)}}catch(a){d(a instanceof Error?a.message:"An unexpected error occurred"),e.current=setTimeout(()=>d(null),5e3)}finally{c(!1)}}},[a]);return{openInIde:(0,b.useCallback)(()=>A(()=>(0,c.openIde)({repositoryPath:a.repositoryPath}),h,p,w,f),[A,f,a]),openInShell:(0,b.useCallback)(()=>A(()=>(0,d.openShell)({repositoryPath:a.repositoryPath}),j,r,x,i),[A,i,a]),openFolder:(0,b.useCallback)(()=>A(()=>(0,e.openFolder)(a.repositoryPath),l,t,y,k),[A,k,a]),syncMain:(0,b.useCallback)(()=>A(()=>g(a.repositoryId??""),n,v,z,m),[A,m,a]),ideLoading:f,shellLoading:i,folderLoading:k,syncLoading:m,ideError:o,shellError:q,folderError:s,syncError:u}}a.s(["useRepositoryActions",()=>h],755628)},341274,a=>{"use strict";let b=(0,a.i(225700).default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);a.s(["EyeOff",()=>b],341274)},479794,a=>{"use strict";let b=(0,a.i(225700).default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);a.s(["SlidersHorizontal",()=>b],479794)},142527,a=>{"use strict";let b=(0,a.i(225700).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);a.s(["FolderPlus",()=>b],142527)},912065,a=>{"use strict";var b=a.i(289111);let c=(0,b.createServerReference)("40464623f38ddc23029bb09ddfd29627947c767ecc",b.callServer,void 0,b.findSourceMapURL,"addRepository");a.s(["addRepository",()=>c])},793193,261189,a=>{"use strict";var b=a.i(991857);function c(a,b,c,d){return"processing"===b?{label:"In Progress",dotClass:"bg-violet-500",borderClass:"",pulse:!0,previewDisabled:!0}:"awaiting_input"===b?{label:"Action Required",dotClass:"bg-amber-500",borderClass:"border-amber-500/60",pulse:!0,previewDisabled:!0}:"interrupted"===d?{label:"Interrupted",dotClass:"bg-amber-500",borderClass:"border-amber-500/60",pulse:!1,previewDisabled:!0}:"failed"===d?{label:"Failed",dotClass:"bg-red-500",borderClass:"border-red-500/60",pulse:!1,previewDisabled:!0}:"building"===d?{label:"In Progress",dotClass:"bg-violet-500",borderClass:"",pulse:!0,previewDisabled:!0}:c?{label:"Live",dotClass:"bg-emerald-500",borderClass:"",pulse:!0,previewDisabled:!1}:"Error"===a?{label:"Error",dotClass:"bg-red-500",borderClass:"border-red-500/60",pulse:!1,previewDisabled:!0}:{label:"Ready",dotClass:"bg-sky-500",borderClass:"",pulse:!1,previewDisabled:!1}}a.s(["TriangleAlert",()=>b.default],793193),a.s(["deriveAppLiveStatus",()=>c],261189)},912894,a=>{"use strict";var b=a.i(289111);let c=(0,b.createServerReference)("4042f7afd08974b7d8e77c1d87f679e63485c1d6c8",b.callServer,void 0,b.findSourceMapURL,"deleteApplication");a.s(["deleteApplication",()=>c])},857411,a=>{"use strict";var b=a.i(556365),c=a.i(944592),d=a.i(193967),e=a.i(232791),f=a.i(488064),g=a.i(882014),h=a.i(103942),i=a.i(69428),j=a.i(771716),k=a.i(872016),l=a.i(302807);a.i(490370);var m=a.i(224640),n=a.i(385536),o=a.i(289111);let p=(0,o.createServerReference)("40d176da178e45af59822102e0d80a18f21a8f0b6c",o.callServer,void 0,o.findSourceMapURL,"createProjectAndFeature"),q=(0,o.createServerReference)("4085beb536f5fc534bfcb61f7ab3fe8bc708ed412a",o.callServer,void 0,o.findSourceMapURL,"createApplication");var r=a.i(961781);a.i(200307);var s=a.i(730931);a.i(548822);var t=a.i(85655),u=a.i(182934),v=a.i(675192),w=a.i(409260);let x=["application","fast","spec"],y={application:{icon:g.LayoutGrid,label:"Application",placeholder:"Build a modern e-commerce storefront with product catalog...",suggestions:["A landing page with hero, features, and pricing sections","Full-stack SaaS app with auth, billing, and dashboard","Mobile-first social media app with real-time chat","Personal portfolio with blog and project showcase"]},fast:{icon:h.Zap,label:"Fast",placeholder:"Add a dark mode toggle to the settings page...",suggestions:["Add pagination to the users list endpoint","Fix the broken logout redirect","Add input validation to the signup form","Refactor the API error handling middleware"]},spec:{icon:i.ClipboardList,label:"Spec Driven",placeholder:"Implement a role-based access control system with audit logging...",suggestions:["OAuth2 authentication with SSO and MFA support","Event-driven notification system with email and push","REST API with versioning, rate limiting, and OpenAPI docs","Data pipeline with ETL, validation, and monitoring"]}};function z({onRepositorySelect:a,onApplicationCreated:g,onClose:h,className:i}){let{t:o}=(0,m.useTranslation)("web"),[z,A]=(0,c.useState)(""),[B,C]=(0,c.useState)(void 0),[D,E]=(0,c.useState)(void 0),[F,G]=(0,c.useState)("application"),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(null),[L,M]=(0,c.useState)(!1),N=(0,c.useRef)(null),O=(0,w.useAttachments)(),P=(0,c.useCallback)(()=>{G(a=>{let b=x.indexOf(a);return x[(b+1)%x.length]})},[]);(0,c.useEffect)(()=>{let a=a=>{"Escape"===a.key&&h&&h(),"Tab"===a.key&&a.shiftKey&&(a.preventDefault(),P())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[h,P]);let Q=(0,c.useCallback)(async()=>{if(z.trim()&&!H){I(!0),K(null);try{if("application"===F){let a=await q({description:z.trim(),agentType:B,modelOverride:D,initialPrompt:z.trim()});if(a.error){K(a.error),I(!1);return}a.application&&g?.(a.application.id)}else{let b=await p({description:z.trim(),attachments:O.completedAttachments.map(a=>({path:a.path,name:a.name,notes:a.notes})),agentType:B,model:D,fast:"fast"===F});if(b.error){K(b.error),I(!1);return}b.repositoryPath&&a?.(b.repositoryPath),b.feature&&b.repositoryPath&&window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:b.feature.id,name:b.feature.name,description:b.feature.description,repositoryPath:b.repositoryPath}}))}}catch{K("Something went wrong. Please try again."),I(!1)}}},[z,H,F,O.completedAttachments,B,D,a,g]),R=(0,c.useCallback)(a=>{"Enter"===a.key&&(a.ctrlKey||a.metaKey)&&(a.preventDefault(),Q())},[Q]),S=(0,c.useCallback)(async()=>{try{let a=await fetch("/api/dialog/pick-files");if(!a.ok)return;let b=await a.json();if(!b.paths?.length)return;for(let a of b.paths){let b=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:a,sessionId:"onboarding"})});if(!b.ok)continue;let c=await b.json();O.addAttachment(c)}}catch{}},[O.addAttachment]),T=(0,c.useCallback)(a=>{A(a),N.current?.focus()},[]),U=y[F],V=U.icon;return(0,b.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,n.cn)("relative flex h-full w-full flex-col items-center justify-center overflow-hidden px-8",i),children:[(0,b.jsx)("div",{className:"onboard-bg pointer-events-none absolute inset-0 animate-[onboard-fade-in_1.2s_ease-out_both]"}),h?(0,b.jsx)("button",{type:"button",onClick:h,"aria-label":"Close",className:"text-muted-foreground hover:text-foreground hover:bg-accent/50 absolute top-4 right-4 z-10 cursor-pointer rounded p-1.5 transition-colors",children:(0,b.jsx)(l.X,{className:"h-5 w-5"})}):null,(0,b.jsxs)("div",{className:"relative flex w-full max-w-2xl flex-col items-center",children:[(0,b.jsx)("div",{className:"mb-6 animate-[onboard-logo_0.8s_cubic-bezier(0.16,1,0.3,1)_both]",style:{animationDelay:"0ms"},children:(0,b.jsx)(t.ShepLogo,{size:72,className:"text-foreground"})}),(0,b.jsx)("h1",{className:"text-foreground animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both] text-center text-5xl font-extralight tracking-tight",style:{animationDelay:"120ms"},children:"What do you want to build?"}),(0,b.jsx)("p",{className:"text-muted-foreground mt-3 animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both] text-center text-lg leading-relaxed font-light",style:{animationDelay:"220ms"},children:"Describe your idea and Shep creates the project for you."}),(0,b.jsxs)("div",{className:"mt-10 w-full animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both]",style:{animationDelay:"350ms"},children:[(0,b.jsxs)("div",{onFocus:()=>M(!0),onBlur:()=>M(!1),onDragEnter:O.handleDragEnter,onDragLeave:O.handleDragLeave,onDragOver:O.handleDragOver,onDrop:O.handleDrop,className:(0,n.cn)("flex flex-col rounded-xl border transition-all duration-200","border-border/60 bg-background shadow-sm dark:border-white/10 dark:bg-white/[0.04]",L&&"ring-ring/50 border-ring shadow-md ring-[3px] dark:border-orange-500/40 dark:ring-orange-500/25",O.isDragOver&&"border-primary/50 bg-primary/5",H&&"opacity-70"),children:[(0,b.jsx)("textarea",{ref:N,rows:2,autoFocus:!0,value:z,onChange:a=>A(a.target.value),onKeyDown:R,onPaste:O.handlePaste,placeholder:U.placeholder,disabled:H,className:"text-foreground placeholder:text-muted-foreground/60 max-h-[10rem] min-h-[4.5rem] w-full resize-none border-0 bg-transparent px-4 py-3.5 text-sm leading-relaxed focus:outline-none disabled:cursor-not-allowed"}),O.attachments.length>0?(0,b.jsx)("div",{className:"flex shrink-0 items-center gap-2.5 overflow-x-auto overflow-y-visible px-5 pt-2 pb-2",children:O.attachments.map(a=>(0,b.jsx)(s.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>O.removeAttachment(a.id),loading:a.loading,notes:a.notes,onNotesChange:b=>O.updateNotes(a.id,b)},a.id))}):null,O.uploadError?(0,b.jsx)("p",{className:"text-destructive px-4 pb-2 text-xs",children:O.uploadError}):null,(0,b.jsxs)("div",{className:"border-border/60 flex shrink-0 items-center gap-3 border-t px-3 py-2 dark:border-white/10",children:[(0,b.jsx)(r.AgentModelPicker,{initialAgentType:B??"claude-code",initialModel:D??"claude-sonnet-4-6",mode:"override",showInstallStatus:!0,onAgentModelChange:(a,b)=>{C(a),E(b)},className:"w-55"}),(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsxs)(v.DropdownMenu,{children:[(0,b.jsx)(v.DropdownMenuTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"button","data-testid":"build-mode-selector",className:"text-muted-foreground hover:text-foreground hover:bg-accent/50 flex cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 text-xs transition-colors",children:[(0,b.jsxs)("span",{className:"flex animate-[onboard-fade-up_0.25s_ease-out_both] items-center gap-1.5",children:[(0,b.jsx)(V,{className:"h-3.5 w-3.5"}),U.label]},F),(0,b.jsx)(j.ChevronDown,{className:"h-3 w-3 opacity-50"})]})}),(0,b.jsx)(v.DropdownMenuContent,{align:"end",className:"min-w-[160px]",children:x.map(a=>{let c=y[a],d=c.icon,e=F===a;return(0,b.jsxs)(v.DropdownMenuItem,{onClick:()=>G(a),"data-testid":`build-mode-${a}`,className:"flex items-center gap-2",children:[(0,b.jsx)(d,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{className:"flex-1",children:c.label}),e?(0,b.jsx)(k.Check,{className:"text-foreground h-3.5 w-3.5"}):null]},a)})})]}),(0,b.jsxs)(u.Tooltip,{children:[(0,b.jsx)(u.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:S,disabled:H,"aria-label":o("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors disabled:opacity-50",children:(0,b.jsx)(e.Paperclip,{className:"h-4 w-4"})})}),(0,b.jsx)(u.TooltipContent,{side:"top",children:o("chat.attachFiles")})]}),(0,b.jsx)("button",{type:"button",onClick:Q,disabled:!z.trim()||H,className:(0,n.cn)("bg-foreground text-background inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg","hover:bg-foreground/90 disabled:pointer-events-none disabled:opacity-30","transition-all duration-150"),children:H?(0,b.jsx)(f.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(d.SendHorizontal,{className:"h-3.5 w-3.5"})})]})]}),J?(0,b.jsx)("p",{className:"text-destructive mt-2 text-center text-sm",children:J}):null]}),(0,b.jsx)("div",{className:"mt-6 flex animate-[onboard-fade-up_0.4s_ease-out_both] flex-wrap justify-center gap-2",children:U.suggestions.map(a=>(0,b.jsx)("button",{type:"button",onClick:()=>T(a),disabled:H,className:"text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-accent/50 cursor-pointer rounded-full border px-3.5 py-1.5 text-xs transition-all duration-150 disabled:opacity-50 dark:border-white/10 dark:hover:border-white/20 dark:hover:bg-white/[0.06]",children:a},a))},F)]})]})}a.s(["ControlCenterEmptyState",()=>z],857411)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=_91c89c19._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,454793,207729,e=>{"use strict";var t=e.i(679606),r=e.i(131777);function a({icon:e,title:a,description:s,action:l,className:o,...n}){return(0,t.jsxs)("div",{className:(0,r.cn)("flex flex-col items-center gap-4 px-4 py-12 text-center",o),...n,children:[e?(0,t.jsx)("div",{className:"text-muted-foreground",children:e}):null,(0,t.jsx)("h3",{className:"text-lg font-semibold",children:a}),s?(0,t.jsx)("p",{className:"text-muted-foreground max-w-md text-sm",children:s}):null,l?(0,t.jsx)("div",{className:"mt-2",children:l}):null]})}e.s(["EmptyState",()=>a],207729),e.s([],454793)},208986,565530,327877,44436,e=>{"use strict";var t=e.i(903645);let r=(0,t.default)("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);e.s(["Code2",()=>r],208986);let a=(0,t.default)("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);e.s(["GitCommitHorizontal",()=>a],565530);var s=e.i(508893);let l=(0,s.createServerReference)("408d5d55bc107f49400579c4b6921c8ee23f6d9e36",s.callServer,void 0,s.findSourceMapURL,"openIde");e.s(["openIde",()=>l],327877);let o=(0,s.createServerReference)("404b743f15d221eb422ce8271016e9eaf0f156046b",s.callServer,void 0,s.findSourceMapURL,"openShell");e.s(["openShell",()=>o],44436)},949228,e=>{"use strict";let t=(0,e.i(903645).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],949228)},730702,e=>{"use strict";let t=(0,e.i(903645).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],730702)},724042,e=>{"use strict";let t=(0,e.i(903645).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",()=>t],724042)},64970,e=>{"use strict";let t=(0,e.i(903645).default)("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);e.s(["Square",()=>t],64970)},873504,481605,e=>{"use strict";var t=e.i(679606),r=e.i(152155),a=e.i(508893);let s=(0,a.createServerReference)("405a9e8271a04e0983a5a736995503a40856aab7e8",a.callServer,void 0,a.findSourceMapURL,"deployFeature"),l=(0,a.createServerReference)("40581856a6b26db6443c6a45ffe9ff71b8cc878e86",a.callServer,void 0,a.findSourceMapURL,"deployRepository"),o=(0,a.createServerReference)("40fa91447c88988fe00535f1532a1490d9ebdcdea0",a.callServer,void 0,a.findSourceMapURL,"deployApplication"),n=(0,a.createServerReference)("403d1d570a000dc23aa3d1c2757816e4140e3a29a8",a.callServer,void 0,a.findSourceMapURL,"stopDeployment"),i=(0,a.createServerReference)("40665c576cd4fb197f40a42ea434a82a5c98634f99",a.callServer,void 0,a.findSourceMapURL,"getDeploymentStatus");var d=e.i(118354);let c={status:null,url:null,targetType:null,hydrated:!1,deployLoading:!1,stopLoading:!1,deployError:null};class u{entries=new Map;listeners=new Map;globalListeners=new Set;hydrate(e){let t=new Set;for(let r of e)t.add(r.targetId),this.update(r.targetId,{status:r.state,url:r.url,targetType:r.targetType,hydrated:!0});for(let[e,r]of this.entries)!t.has(e)&&r.hydrated&&null!==r.status?this.update(e,{status:null,url:null}):t.has(e)||r.hydrated||this.update(e,{hydrated:!0})}getEntry(e){return this.entries.get(e)??c}update(e,t){let r={...this.entries.get(e)??c,...t};this.entries.set(e,r),this.notify(e)}setStatus(e,t){null===t?this.update(e,{status:null,url:null,hydrated:!0}):this.update(e,{status:t.state,url:t.url,hydrated:!0})}subscribe(e,t){let r=this.listeners.get(e);return r||(r=new Set,this.listeners.set(e,r)),r.add(t),()=>{r?.delete(t),r?.size===0&&this.listeners.delete(e)}}subscribeAll(e){return this.globalListeners.add(e),()=>{this.globalListeners.delete(e)}}notify(e){let t=this.listeners.get(e);if(t)for(let e of t)e();for(let e of this.globalListeners)e()}}e.s(["DeploymentStatusStore",()=>u,"EMPTY_ENTRY",0,c],481605);let p=(0,d.createLogger)("[DeploymentStatusProvider]"),h=new Set(["Booting","Ready"]),f=(0,r.createContext)(null);function y({initialDeployments:e,children:a}){let d=(0,r.useRef)(null);d.current||(d.current=new u,d.current.hydrate(e));let c=d.current;(0,r.useEffect)(()=>{c.hydrate(e)},[e,c]);let y=(0,r.useRef)(new Map),b=(0,r.useCallback)(e=>{let t=y.current.get(e);t&&(clearInterval(t),y.current.delete(e))},[]),m=(0,r.useCallback)(e=>{if(y.current.has(e))return;let t=setInterval(async()=>{let t;try{t=await i(e)}catch(t){p.warn(`poll failed for "${e}"`,t),c.setStatus(e,null),b(e);return}if(!t||"Stopped"===t.state){c.setStatus(e,null),b(e);return}c.setStatus(e,t)},3e3);y.current.set(e,t)},[c,b]);(0,r.useEffect)(()=>{let e=y.current,t=c.subscribeAll(()=>{for(let[t]of e){let e=c.getEntry(t);e.status&&h.has(e.status)||b(t)}});return()=>{for(let[,r]of(t(),e))clearInterval(r);e.clear()}},[c,b]);let g=(0,r.useCallback)(e=>{!e||c.getEntry(e).hydrated||(c.update(e,{hydrated:!0}),(async()=>{try{let t=await i(e);c.setStatus(e,t),t&&h.has(t.state)&&m(e)}catch(t){p.warn(`ensureHydrated failed for "${e}"`,t)}})())},[c,m]),x=(0,r.useCallback)(async e=>{c.update(e.targetId,{deployLoading:!0,deployError:null});try{let t="feature"===e.targetType?await s(e.targetId):"application"===e.targetType?await o(e.targetId):await l(e.repositoryPath);if(!t.success)return void c.update(e.targetId,{deployLoading:!1,deployError:t.error??"An unexpected error occurred"});c.update(e.targetId,{deployLoading:!1,status:t.state??null,url:null,hydrated:!0,targetType:e.targetType}),m(e.targetId)}catch(r){let t=r instanceof Error?r.message:"An unexpected error occurred";c.update(e.targetId,{deployLoading:!1,deployError:t})}},[c,m]),v=(0,r.useCallback)(async e=>{if(e){c.update(e,{stopLoading:!0});try{(await n(e)).success?(b(e),c.update(e,{stopLoading:!1,status:null,url:null})):c.update(e,{stopLoading:!1})}catch(t){p.warn("stop error (non-critical)",t),c.update(e,{stopLoading:!1})}}},[c,b]),w=(0,r.useMemo)(()=>({store:c,deploy:x,stop:v,ensureHydrated:g}),[c,x,v,g]);return(0,t.jsx)(f.Provider,{value:w,children:a})}function b(){let e=(0,r.useContext)(f);if(!e)throw Error("useDeploymentStatusContext must be used within a <DeploymentStatusProvider>");return e}function m(){let e=(0,r.useContext)(f);return e||g}let g={store:new u,deploy:async()=>{},stop:async()=>{},ensureHydrated:()=>{}};e.s(["DeploymentStatusProvider",()=>y,"useDeploymentStatusContext",()=>b,"useDeploymentStatusContextOptional",()=>m],873504)},8537,e=>{"use strict";var t=e.i(152155),r=e.i(873504);function a(){}function s(e){let{store:s,deploy:l,stop:o,ensureHydrated:n}=(0,r.useDeploymentStatusContextOptional)(),i=e?.targetId??"",d=(0,t.useCallback)(e=>i?s.subscribe(i,e):a,[s,i]),c=(0,t.useCallback)(()=>i?s.getEntry(i):s.getEntry(""),[s,i]),u=(0,t.useSyncExternalStore)(d,c,c);return(0,t.useEffect)(()=>{i&&n(i)},[i,n]),{deploy:(0,t.useCallback)(async()=>{e&&await l(e)},[l,e]),stop:(0,t.useCallback)(async()=>{i&&await o(i)},[o,i]),deployLoading:u.deployLoading,stopLoading:u.stopLoading,deployError:u.deployError,status:u.status,url:u.url}}e.s(["useDeployAction",()=>s])},338573,e=>{"use strict";let t=(0,e.i(903645).default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]);e.s(["Terminal",()=>t],338573)},1650,e=>{"use strict";e.i(511495),e.s([])},629578,e=>{"use strict";var t=e.i(508893);let r=(0,t.createServerReference)("407ee5ddfec59b1c1ef6a64ce9451d07f24800b716",t.callServer,void 0,t.findSourceMapURL,"openFolder");e.s(["openFolder",()=>r])},237260,e=>{"use strict";let t=(0,e.i(903645).default)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);e.s(["Archive",()=>t],237260)},676852,e=>{"use strict";var t=e.i(152155),r=e.i(327877),a=e.i(44436),s=e.i(629578),l=e.i(508893);let o=(0,l.createServerReference)("409c36a7101750afbada42a943afe3cdf2f0eb9525",l.callServer,void 0,l.findSourceMapURL,"syncRepository");function n(e){let[l,n]=(0,t.useState)(!1),[i,d]=(0,t.useState)(!1),[c,u]=(0,t.useState)(!1),[p,h]=(0,t.useState)(!1),[f,y]=(0,t.useState)(null),[b,m]=(0,t.useState)(null),[g,x]=(0,t.useState)(null),[v,w]=(0,t.useState)(null),S=(0,t.useRef)(null),k=(0,t.useRef)(null),C=(0,t.useRef)(null),j=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{S.current&&clearTimeout(S.current),k.current&&clearTimeout(k.current),C.current&&clearTimeout(C.current),j.current&&clearTimeout(j.current)},[]);let M=(0,t.useCallback)(async(t,r,a,s,l)=>{if(e&&!l){s.current&&clearTimeout(s.current),r(!0),a(null);try{let e=await t();if(!e.success){let t=e.error??"An unexpected error occurred";a(t),s.current=setTimeout(()=>a(null),5e3)}}catch(e){a(e instanceof Error?e.message:"An unexpected error occurred"),s.current=setTimeout(()=>a(null),5e3)}finally{r(!1)}}},[e]);return{openInIde:(0,t.useCallback)(()=>M(()=>(0,r.openIde)({repositoryPath:e.repositoryPath}),n,y,S,l),[M,l,e]),openInShell:(0,t.useCallback)(()=>M(()=>(0,a.openShell)({repositoryPath:e.repositoryPath}),d,m,k,i),[M,i,e]),openFolder:(0,t.useCallback)(()=>M(()=>(0,s.openFolder)(e.repositoryPath),u,x,C,c),[M,c,e]),syncMain:(0,t.useCallback)(()=>M(()=>o(e.repositoryId??""),h,w,j,p),[M,p,e]),ideLoading:l,shellLoading:i,folderLoading:c,syncLoading:p,ideError:f,shellError:b,folderError:g,syncError:v}}e.s(["useRepositoryActions",()=>n],676852)},713005,e=>{"use strict";let t=(0,e.i(903645).default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);e.s(["SlidersHorizontal",()=>t],713005)},806288,e=>{"use strict";let t=(0,e.i(903645).default)("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);e.s(["EyeOff",()=>t],806288)},591925,e=>{"use strict";let t=(0,e.i(903645).default)("folder-plus",[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["FolderPlus",()=>t],591925)},104814,e=>{"use strict";var t=e.i(508893);let r=(0,t.createServerReference)("40464623f38ddc23029bb09ddfd29627947c767ecc",t.callServer,void 0,t.findSourceMapURL,"addRepository");e.s(["addRepository",()=>r])},370002,657365,e=>{"use strict";var t=e.i(215131);function r(e,t,r,a){return"processing"===t?{label:"In Progress",dotClass:"bg-violet-500",borderClass:"",pulse:!0,previewDisabled:!0}:"awaiting_input"===t?{label:"Action Required",dotClass:"bg-amber-500",borderClass:"border-amber-500/60",pulse:!0,previewDisabled:!0}:"interrupted"===a?{label:"Interrupted",dotClass:"bg-amber-500",borderClass:"border-amber-500/60",pulse:!1,previewDisabled:!0}:"failed"===a?{label:"Failed",dotClass:"bg-red-500",borderClass:"border-red-500/60",pulse:!1,previewDisabled:!0}:"building"===a?{label:"In Progress",dotClass:"bg-violet-500",borderClass:"",pulse:!0,previewDisabled:!0}:r?{label:"Live",dotClass:"bg-emerald-500",borderClass:"",pulse:!0,previewDisabled:!1}:"Error"===e?{label:"Error",dotClass:"bg-red-500",borderClass:"border-red-500/60",pulse:!1,previewDisabled:!0}:{label:"Ready",dotClass:"bg-sky-500",borderClass:"",pulse:!1,previewDisabled:!1}}e.s(["TriangleAlert",()=>t.default],370002),e.s(["deriveAppLiveStatus",()=>r],657365)},224011,e=>{"use strict";var t=e.i(508893);let r=(0,t.createServerReference)("4042f7afd08974b7d8e77c1d87f679e63485c1d6c8",t.callServer,void 0,t.findSourceMapURL,"deleteApplication");e.s(["deleteApplication",()=>r])},440106,e=>{"use strict";var t=e.i(679606),r=e.i(152155),a=e.i(711719),s=e.i(935946),l=e.i(83428),o=e.i(542049),n=e.i(453360),i=e.i(941698),d=e.i(99105),c=e.i(723925),u=e.i(860253);e.i(541001);var p=e.i(64780),h=e.i(131777),f=e.i(508893);let y=(0,f.createServerReference)("40d176da178e45af59822102e0d80a18f21a8f0b6c",f.callServer,void 0,f.findSourceMapURL,"createProjectAndFeature"),b=(0,f.createServerReference)("4085beb536f5fc534bfcb61f7ab3fe8bc708ed412a",f.callServer,void 0,f.findSourceMapURL,"createApplication");var m=e.i(41413);e.i(650032);var g=e.i(486254);e.i(692233);var x=e.i(210025),v=e.i(102828),w=e.i(470646),S=e.i(731151);let k=["application","fast","spec"],C={application:{icon:o.LayoutGrid,label:"Application",placeholder:"Build a modern e-commerce storefront with product catalog...",suggestions:["A landing page with hero, features, and pricing sections","Full-stack SaaS app with auth, billing, and dashboard","Mobile-first social media app with real-time chat","Personal portfolio with blog and project showcase"]},fast:{icon:n.Zap,label:"Fast",placeholder:"Add a dark mode toggle to the settings page...",suggestions:["Add pagination to the users list endpoint","Fix the broken logout redirect","Add input validation to the signup form","Refactor the API error handling middleware"]},spec:{icon:i.ClipboardList,label:"Spec Driven",placeholder:"Implement a role-based access control system with audit logging...",suggestions:["OAuth2 authentication with SSO and MFA support","Event-driven notification system with email and push","REST API with versioning, rate limiting, and OpenAPI docs","Data pipeline with ETL, validation, and monitoring"]}};function j({onRepositorySelect:e,onApplicationCreated:o,onClose:n,className:i}){let{t:f}=(0,p.useTranslation)("web"),[j,M]=(0,r.useState)(""),[R,L]=(0,r.useState)(void 0),[D,N]=(0,r.useState)(void 0),[A,E]=(0,r.useState)("application"),[T,P]=(0,r.useState)(!1),[I,_]=(0,r.useState)(null),[z,F]=(0,r.useState)(!1),q=(0,r.useRef)(null),O=(0,S.useAttachments)(),U=(0,r.useCallback)(()=>{E(e=>{let t=k.indexOf(e);return k[(t+1)%k.length]})},[]);(0,r.useEffect)(()=>{let e=e=>{"Escape"===e.key&&n&&n(),"Tab"===e.key&&e.shiftKey&&(e.preventDefault(),U())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n,U]);let H=(0,r.useCallback)(async()=>{if(j.trim()&&!T){P(!0),_(null);try{if("application"===A){let e=await b({description:j.trim(),agentType:R,modelOverride:D,initialPrompt:j.trim()});if(e.error){_(e.error),P(!1);return}e.application&&o?.(e.application.id)}else{let t=await y({description:j.trim(),attachments:O.completedAttachments.map(e=>({path:e.path,name:e.name,notes:e.notes})),agentType:R,model:D,fast:"fast"===A});if(t.error){_(t.error),P(!1);return}t.repositoryPath&&e?.(t.repositoryPath),t.feature&&t.repositoryPath&&window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.repositoryPath}}))}}catch{_("Something went wrong. Please try again."),P(!1)}}},[j,T,A,O.completedAttachments,R,D,e,o]),B=(0,r.useCallback)(e=>{"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),H())},[H]),K=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/dialog/pick-files");if(!e.ok)return;let t=await e.json();if(!t.paths?.length)return;for(let e of t.paths){let t=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,sessionId:"onboarding"})});if(!t.ok)continue;let r=await t.json();O.addAttachment(r)}}catch{}},[O.addAttachment]),G=(0,r.useCallback)(e=>{M(e),q.current?.focus()},[]),V=C[A],$=V.icon;return(0,t.jsxs)("div",{"data-testid":"control-center-empty-state",className:(0,h.cn)("relative flex h-full w-full flex-col items-center justify-center overflow-hidden px-8",i),children:[(0,t.jsx)("div",{className:"onboard-bg pointer-events-none absolute inset-0 animate-[onboard-fade-in_1.2s_ease-out_both]"}),n?(0,t.jsx)("button",{type:"button",onClick:n,"aria-label":"Close",className:"text-muted-foreground hover:text-foreground hover:bg-accent/50 absolute top-4 right-4 z-10 cursor-pointer rounded p-1.5 transition-colors",children:(0,t.jsx)(u.X,{className:"h-5 w-5"})}):null,(0,t.jsxs)("div",{className:"relative flex w-full max-w-2xl flex-col items-center",children:[(0,t.jsx)("div",{className:"mb-6 animate-[onboard-logo_0.8s_cubic-bezier(0.16,1,0.3,1)_both]",style:{animationDelay:"0ms"},children:(0,t.jsx)(x.ShepLogo,{size:72,className:"text-foreground"})}),(0,t.jsx)("h1",{className:"text-foreground animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both] text-center text-5xl font-extralight tracking-tight",style:{animationDelay:"120ms"},children:"What do you want to build?"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-3 animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both] text-center text-lg leading-relaxed font-light",style:{animationDelay:"220ms"},children:"Describe your idea and Shep creates the project for you."}),(0,t.jsxs)("div",{className:"mt-10 w-full animate-[onboard-fade-up_0.7s_cubic-bezier(0.16,1,0.3,1)_both]",style:{animationDelay:"350ms"},children:[(0,t.jsxs)("div",{onFocus:()=>F(!0),onBlur:()=>F(!1),onDragEnter:O.handleDragEnter,onDragLeave:O.handleDragLeave,onDragOver:O.handleDragOver,onDrop:O.handleDrop,className:(0,h.cn)("flex flex-col rounded-xl border transition-all duration-200","border-border/60 bg-background shadow-sm dark:border-white/10 dark:bg-white/[0.04]",z&&"ring-ring/50 border-ring shadow-md ring-[3px] dark:border-orange-500/40 dark:ring-orange-500/25",O.isDragOver&&"border-primary/50 bg-primary/5",T&&"opacity-70"),children:[(0,t.jsx)("textarea",{ref:q,rows:2,autoFocus:!0,value:j,onChange:e=>M(e.target.value),onKeyDown:B,onPaste:O.handlePaste,placeholder:V.placeholder,disabled:T,className:"text-foreground placeholder:text-muted-foreground/60 max-h-[10rem] min-h-[4.5rem] w-full resize-none border-0 bg-transparent px-4 py-3.5 text-sm leading-relaxed focus:outline-none disabled:cursor-not-allowed"}),O.attachments.length>0?(0,t.jsx)("div",{className:"flex shrink-0 items-center gap-2.5 overflow-x-auto overflow-y-visible px-5 pt-2 pb-2",children:O.attachments.map(e=>(0,t.jsx)(g.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>O.removeAttachment(e.id),loading:e.loading,notes:e.notes,onNotesChange:t=>O.updateNotes(e.id,t)},e.id))}):null,O.uploadError?(0,t.jsx)("p",{className:"text-destructive px-4 pb-2 text-xs",children:O.uploadError}):null,(0,t.jsxs)("div",{className:"border-border/60 flex shrink-0 items-center gap-3 border-t px-3 py-2 dark:border-white/10",children:[(0,t.jsx)(m.AgentModelPicker,{initialAgentType:R??"claude-code",initialModel:D??"claude-sonnet-4-6",mode:"override",showInstallStatus:!0,onAgentModelChange:(e,t)=>{L(e),N(t)},className:"w-55"}),(0,t.jsx)("div",{className:"flex-1"}),(0,t.jsxs)(w.DropdownMenu,{children:[(0,t.jsx)(w.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button","data-testid":"build-mode-selector",className:"text-muted-foreground hover:text-foreground hover:bg-accent/50 flex cursor-pointer items-center gap-1.5 rounded-md px-2 py-1 text-xs transition-colors",children:[(0,t.jsxs)("span",{className:"flex animate-[onboard-fade-up_0.25s_ease-out_both] items-center gap-1.5",children:[(0,t.jsx)($,{className:"h-3.5 w-3.5"}),V.label]},A),(0,t.jsx)(d.ChevronDown,{className:"h-3 w-3 opacity-50"})]})}),(0,t.jsx)(w.DropdownMenuContent,{align:"end",className:"min-w-[160px]",children:k.map(e=>{let r=C[e],a=r.icon,s=A===e;return(0,t.jsxs)(w.DropdownMenuItem,{onClick:()=>E(e),"data-testid":`build-mode-${e}`,className:"flex items-center gap-2",children:[(0,t.jsx)(a,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"flex-1",children:r.label}),s?(0,t.jsx)(c.Check,{className:"text-foreground h-3.5 w-3.5"}):null]},e)})})]}),(0,t.jsxs)(v.Tooltip,{children:[(0,t.jsx)(v.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:K,disabled:T,"aria-label":f("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors disabled:opacity-50",children:(0,t.jsx)(s.Paperclip,{className:"h-4 w-4"})})}),(0,t.jsx)(v.TooltipContent,{side:"top",children:f("chat.attachFiles")})]}),(0,t.jsx)("button",{type:"button",onClick:H,disabled:!j.trim()||T,className:(0,h.cn)("bg-foreground text-background inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg","hover:bg-foreground/90 disabled:pointer-events-none disabled:opacity-30","transition-all duration-150"),children:T?(0,t.jsx)(l.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(a.SendHorizontal,{className:"h-3.5 w-3.5"})})]})]}),I?(0,t.jsx)("p",{className:"text-destructive mt-2 text-center text-sm",children:I}):null]}),(0,t.jsx)("div",{className:"mt-6 flex animate-[onboard-fade-up_0.4s_ease-out_both] flex-wrap justify-center gap-2",children:V.suggestions.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>G(e),disabled:T,className:"text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-accent/50 cursor-pointer rounded-full border px-3.5 py-1.5 text-xs transition-all duration-150 disabled:opacity-50 dark:border-white/10 dark:hover:border-white/20 dark:hover:bg-white/[0.06]",children:e},e))},A)]})]})}e.s(["ControlCenterEmptyState",()=>j],440106)}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,917840,e=>{"use strict";var t=e.i(152155),r=e.i(711434),n=e.i(360112),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 l=a(this._isDirected,e,t,n);if(Object.hasOwn(this._edgeLabels,l))return s&&(this._edgeLabels[l]=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[l]=s?o:this._defaultEdgeLabelFn(e,t,n);var d=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=d.v,t=d.w,Object.freeze(d),this._edgeObjs[l]=d,r(this._preds[t],e),r(this._sucs[e],t),this._in[t][l]=d,this._out[e][l]=d,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()}}),l=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}}}),d=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(),l=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)},d=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;l({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++,d(),a);u++);if(s===c-1&&(a=!1,d(),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={},l=new r,d=function(e){var t=e.v!==a?e.v:e.w,r=i[t],o=n(e),d=s.distance+o;if(o<0)throw Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+o);d<r.distance&&(r.distance=d,r.predecessor=a,l.decrease(t,d))};for(e.nodes().forEach(function(e){var r=e===t?0:1/0;i[e]={distance:r},l.add(e,r)});l.size()>0&&(s=i[a=l.removeMin()]).distance!==1/0;)o(a).forEach(d);return i}(e,String(t),o||n,a||function(t){return e.outEdges(t)})};var n=()=>1}),p=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},{})}}),f=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 l,d=[];do n[l=r.pop()].onStack=!1,d.push(l);while(s!==l)o.push(d)}}(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,l;return o=e,a=t||r,s=n||function(t){return e.outEdges(t)},i={},(l=o.nodes()).forEach(function(e){i[e]={},i[e][e]={distance:0},l.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}})}),l.forEach(function(e){var t=i[e];l.forEach(function(r){var n=i[r];l.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}),y=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}}),b=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=b();t.exports=function(e,t,n){return r(e,t,n,function(e,t){return e.push(t),e},[])}}),k=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"post")}}),j=n((e,t)=>{var r=w();t.exports=function(e,t){return r(e,t,"pre")}}),N=n((e,t)=>{var r=a(),n=u();t.exports=function(e,t){var o,a=new r,s={},i=new n;function l(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 d=!1;i.size()>0;){if(Object.hasOwn(s,o=i.removeMin()))a.setEdge(o,s[o]);else{if(d)throw Error("Input graph is not connected: "+e);d=!0}e.nodeEdges(o).forEach(l)}return a}}),E=n((e,t)=>{var r=h(),n=d();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(),l=0;l<i.length;l++){for(var d=a(i[l]),c=0;c<d.length;c++){var u=d[c],h=u.v===i[l]?u.v:u.w,p=h===u.v?u.w:u.v;0>o({v:h,w:p})&&(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:d(),components:c(),dijkstra:h(),dijkstraAll:p(),extractPath:f(),findCycles:m(),floydWarshall:v(),isAcyclic:y(),postorder:k(),preorder:j(),prim:N(),shortestPaths:E(),reduce:b(),tarjan:g(),topsort:x()}}),S=i();t.exports={Graph:S.Graph,json:l(),alg:C(),version:S.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 d,c,u,h,p;if(1>=e.nodeCount())return[];let f=(a=e,s=t||o,d=new r,c=0,u=0,a.nodes().forEach(e=>{d.setNode(e,{v:e,in:0,out:0})}),a.edges().forEach(e=>{let t=d.edge(e.v,e.w)||0,r=s(e);d.setEdge(e.v,e.w,t+r),u=Math.max(u,d.node(e.v).out+=r),c=Math.max(c,d.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),p=c+1,d.nodes().forEach(e=>{l(h,p,d.node(e))}),{graph:d,buckets:h,zeroIdx:p});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})(f.graph,f.buckets,f.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,l(t,r,i)}),e.outEdges(n.v).forEach(n=>{let o=e.edge(n),a=n.w,s=e.node(a);s.in-=o,l(t,r,s)}),e.removeNode(n.v),a}function l(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)}}),l=o((e,t)=>{var r=a().Graph;function n(e,t,r,n){for(var o=n;e.hasNode(o);)o=l(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=d(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,l=e.width/2,d=e.height/2;if(!s&&!i)throw Error("Not possible to find intersection inside of the rectangle");return Math.abs(i)*l>Math.abs(s)*d?(i<0&&(d=-d),r=d*s/i,n=d):(s<0&&(l=-l),r=l,n=l*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:d,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:l,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 l(e){return e+""+ ++i}function d(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),{})}}),d=o((e,t)=>{var r=i(),n=l().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=l();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,l=t.w,d=e.node(l).rank,c=t.name,u=e.edge(t),h=u.labelRank;if(d!==i+1){for(e.removeEdge(t),a=0,++i;i<d;++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,l,{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}=l();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}),l=e.nodes()[0],d=e.nodeCount();for(i.setNode(l,{});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()<d;)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}}),p=o((e,t)=>{var r=h(),n=u().slack,o=u().longestPath,s=a().alg.preorder,i=a().alg.postorder,d=l().simplify;function c(e){o(e=d(e));var t,n,a=r(e);for(g(a),p(a,e);t=m(a);)n=v(a,e,t),x(a,e,t,n)}function p(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=f(n,o,a))})}function f(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,l=i?a.w:a.v;if(l!==n){var d,c,u,h=i===o,p=t.edge(a).weight;if(s+=h?p:-p,d=e,c=r,u=l,d.hasEdge(c,u)){var f=e.edge(r,l).cutvalue;s+=h?-f:f}}}),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),l=s,d=!1;return s.lim>i.lim&&(l=i,d=!0),t.edges().filter(t=>d===y(e,e.node(t.v),l)&&d!==y(e,e.node(t.w),l)).reduce((e,r)=>n(t,r)<n(t,e)?r:e)}function x(e,t,r,n){var o,a,i,l,d=r.v,c=r.w;e.removeEdge(d,c),e.setEdge(n.v,n.w,{}),g(e),p(e,t),o=e,a=t,i=o.nodes().find(e=>!a.node(e).parent),(l=(l=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 y(e,t,r){return r.low<=t.lim&&t.lim<=r.lim}t.exports=c,c.initLowLimValues=g,c.initCutValues=p,c.calcCutValue=f,c.leaveEdge=m,c.enterEdge=v,c.exchangeEdges=x}),f=o((e,t)=>{var r=u().longestPath,n=h(),o=p();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),l,d;l=r;do o.push(l=e.parent(l));while(l&&(t[l].low>s||i>t[l].lim))for(d=l,l=n;(l=e.parent(l))!==d;)a.push(l);return{path:o.concat(a.reverse()),lca:d}}(e,o,n.v,n.w),s=a.path,i=a.lca,l=0,d=s[0],c=!0;for(;t!==n.w;){if(r=e.node(t),c){for(;(d=s[l])!==i&&e.node(d).maxRank<r.rank;)l++;d===i&&(c=!1)}if(!c){for(;l<s.length-1&&e.node(d=s[l+1]).minRank<=r.rank;)l++;d=s[l]}e.setParent(t,d),t=e.successors(t)[0]}})}}),m=o((e,t)=>{var r=l();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),l=r.applyWithChunking(Math.max,i)-1,d=2*l+1;e.graph().nestingRoot=a,e.edges().forEach(t=>e.edge(t).minlen*=d);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,l){let d=t.children(l);if(!d.length){l!==n&&t.setEdge(n,l,{weight:0,minlen:o});return}let c=r.addBorderNode(t,"_bt"),u=r.addBorderNode(t,"_bb"),h=t.node(l);t.setParent(c,l),h.borderTop=c,t.setParent(u,l),h.borderBottom=u,d.forEach(r=>{e(t,n,o,a,s,i,r);let d=t.node(r),h=d.borderTop?d.borderTop:r,p=d.borderBottom?d.borderBottom:r,f=d.borderTop?a:2*a,g=h!==p?1:s-i[l]+1;t.setEdge(c,h,{weight:f,minlen:g,nestingEdge:!0}),t.setEdge(p,u,{weight:f,minlen:g,nestingEdge:!0})}),t.parent(l)||t.setEdge(n,c,{weight:0,minlen:s+i[l]})})(e,a,d,c,l,s,t)),e.graph().nodeRankFactor=d},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=l();function n(e,t,n,o,a,s){let i=a[t][s-1],l=r.addDummyNode(e,"border",{width:0,height:0,rank:s,borderType:t},n);a[t][s]=l,e.setParent(l,o),i&&e.setEdge(i,l,{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))}}}),y=o((e,t)=>{var r=l();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}}),b=o((e,t)=>{var r=l().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 l=Array(i).fill(0),d=0;return a.forEach(e=>{let t=e.pos+s;l[t]+=e.weight;let r=0;for(;t>0;)t%2&&(r+=l[t+1]),t=t-1>>1,l[t]+=e.weight;d+=e.weight*r}),d}(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}}})}}),k=o((e,t)=>{var r=l();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))}}),j=o((e,t)=>{var r=l();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),l=[],d=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(l,i,u),s.forEach(e=>{u+=e.vs.length,l.push(e.vs),d+=e.barycenter*e.weight,c+=e.weight,u=n(l,i,u)});let h={vs:l.flat(!0)};return c&&(h.barycenter=d/c,h.weight=c),h}}),N=o((e,t)=>{var r=w(),n=k(),o=j();t.exports=function e(t,a,s,i){var l,d;let c=t.children(a),u=t.node(a),h=u?u.borderLeft:void 0,p=u?u.borderRight:void 0,f={};h&&(c=c.filter(e=>e!==h&&e!==p));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);f[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);l=m,d=f,l.forEach(e=>{e.vs=e.vs.flatMap(e=>d[e]?d[e].vs:e)});let v=o(m,i);if(h&&(v.vs=[h,v.vs,p].flat(!0),t.predecessors(h).length)){let e=t.node(t.predecessors(h)[0]),r=t.node(t.predecessors(p)[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}}),E=o((e,t)=>{var r=a().Graph,n=l();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}})}}),S=o((e,t)=>{var r=y(),n=b(),o=N(),s=E(),i=C(),d=a().Graph,c=l();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),l=u(t,c.range(1,s+1),"inEdges"),p=u(t,c.range(s-1,-1,-1),"outEdges"),f=r(t);if(h(t,f),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 d;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?l:p,e%4>=2,v),f=c.buildLayerMatrix(t);let a=n(t,f);a<g?(r=0,m=Object.assign({},f),g=a):a===g&&(m=structuredClone(f))}h(t,m)}}),_=o((e,t)=>{var r=a().Graph,n=l();function o(e,t){let r={};return t.length&&t.reduce(function(t,n){let o=0,a=0,s=t.length,l=n[n.length-1];return n.forEach((t,d)=>{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===l)&&(n.slice(a,d+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=d+1,o=u)}),n}),r}function s(e,t){let r={};function o(t,o,a,s,l){let d;n.range(o,a).forEach(n=>{d=t[n],e.node(d).dummy&&e.predecessors(d).forEach(t=>{let n=e.node(t);n.dummy&&(n.order<s||n.order>l)&&i(r,t,d)})})}return t.length&&t.reduce(function(t,r){let n=-1,a,s=0;return r.forEach((i,l)=>{if("border"===e.node(i).dummy){let t=e.predecessors(i);t.length&&(a=e.node(t[0]).order,o(r,s,l,n,a),s=l,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 d(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 l=Math.floor(n),c=Math.ceil(n);l<=c;++l){let n=i[l];a[e]===e&&t<s[n]&&!d(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,l,d,c,u,h;let p,f,g,m={},v=(s=e,i=t,l=n,d=a,p=new r,g=(c=(f=s.graph()).nodesep,u=f.edgesep,h=d,(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=l[e];if(p.setNode(r),t){var n=l[t],o=p.edge(n,r);p.setEdge(n,r,Math.max(g(s,e,t),o||0))}t=e})}),p),x=a?"borderLeft":"borderRight";function y(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 y(function(e){m[e]=v.inEdges(e).reduce((e,t)=>Math.max(e,m[t.v]+v.edge(t)),0)},v.predecessors.bind(v)),y(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 p(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,l=e[i];if(l===t)return;let d=Object.values(l),c=o-n.applyWithChunking(Math.min,d);"l"!==s&&(c=a-n.applyWithChunking(Math.max,d)),c&&(e[i]=n.mapValues(l,e=>e+c))})})}function f(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),l=c(e,i,r,s),d=u(e,i,l.root,l.align,"r"===t);"r"===t&&(d=n.mapValues(d,e=>-e)),a[o+t]=d})});let l=h(e,a);return p(a,l),f(a,e.graph().align)},findType1Conflicts:o,findType2Conflicts:s,addConflict:i,hasConflict:d,verticalAlignment:c,horizontalCompaction:u,alignCoordinates:p,findSmallestWidthAlignment:h,balance:f}}),D=o((e,t)=>{var r=l(),n=_().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=d(),n=c(),o=f(),s=l().normalizeRanks,i=g(),u=l().removeEmptyRanks,h=m(),p=v(),y=x(),b=S(),w=D(),k=l(),j=a().Graph;t.exports=function(e,t={}){let a=t.debugTiming?k.time:k.notime;return a("layout",()=>{let l=a(" buildLayoutGraph",()=>{var t;let r,n;return t=e,r=new j({multigraph:!0,compound:!0}),n=F(t.graph()),r.setGraph(Object.assign({},E,I(n,N),k.pick(n,C))),t.nodes().forEach(e=>{let n=I(F(t.node(e)),_);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=F(t.edge(e));r.setEdge(e,Object.assign({},P,I(n,O),k.pick(n,R)))}),r});return a(" runLayout",()=>{var e,d,c;return e=l,d=a,c=t,void(d(" 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)}))}),d(" 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)}})}),d(" acyclic",()=>r.run(e)),d(" nestingGraph.run",()=>h.run(e)),d(" rank",()=>o(k.asNonCompoundGraph(e))),d(" 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};k.addDummyNode(t,"edge-proxy",n,"_ep")}})}),d(" removeEmptyRanks",()=>u(e)),d(" nestingGraph.cleanup",()=>h.cleanup(e)),d(" normalizeRanks",()=>s(e)),d(" 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)}),d(" 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))})}),d(" normalize.run",()=>n.run(e)),d(" parentDummyChains",()=>i(e)),d(" addBorderSegments",()=>p(e)),d(" order",()=>b(e,c)),d(" insertSelfEdges",()=>{var t;return t=e,void k.buildLayerMatrix(t).forEach(e=>{var r=0;e.forEach((e,n)=>{var o=t.node(e);o.order=n+r,(o.selfEdges||[]).forEach(e=>{k.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})})}),d(" adjustCoordinateSystem",()=>y.adjust(e)),d(" position",()=>w(e)),d(" 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}})}),d(" 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)})}),d(" normalize.undo",()=>n.undo(e)),d(" 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}})}),d(" undoCoordinateSystem",()=>y.undo(e)),d(" 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 l(e){let a=e.x,s=e.y,i=e.width,l=e.height;t=Math.min(t,a-i/2),r=Math.max(r,a+i/2),n=Math.min(n,s-l/2),o=Math.max(o,s+l/2)}e.nodes().forEach(t=>l(e.node(t))),e.edges().forEach(t=>{let r=e.edge(t);Object.hasOwn(r,"x")&&l(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)),d(" 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(k.intersectRect(n,a)),r.points.push(k.intersectRect(o,s))})}),d(" reversePoints",()=>{var t;(t=e).edges().forEach(e=>{let r=t.edge(e);r.reversed&&r.points.reverse()})}),d(" acyclic.undo",()=>r.undo(e)))}),a(" updateInputGraph",()=>{var t,r;return t=e,r=l,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)}),l})};var N=["nodesep","edgesep","ranksep","marginx","marginy"],E={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb",rankalign:"center"},C=["acyclicer","ranker","rankdir","align","rankalign"],_=["width","height","rank"],M={width:0,height:0},O=["minlen","weight","width","height","labeloffset"],P={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},R=["labelpos"];function I(e,t){return k.mapValues(k.pick(e,t),Number)}function F(e){var t={};return e&&Object.entries(e).forEach(([e,r])=>{"string"==typeof e&&(e=e.toLowerCase()),t[e]=r}),t}}),O=o((e,t)=>{var r=l(),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 R=o((e,t)=>{t.exports={graphlib:a(),layout:M(),debug:O(),util:{time:l().time,notime:l().notime},version:P()}})(),I={direction:"LR",ranksep:200,nodesep:48};function F(e="ltr"){return{...I,direction:"rtl"===e?"RL":"LR"}}let L={featureNode:{width:388,height:140},repositoryNode:{width:400,height:140},applicationNode:{width:416,height:300}};function T(e,t){let r=e.data;return r&&"number"==typeof r.width&&"number"==typeof r.height?{width:r.width,height:r.height}:L[e.type??""]??t}function A(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 R.graphlib.Graph({multigraph:!0});i.setDefaultEdgeLabel(()=>({})),i.setGraph({rankdir:n,ranksep:a,nodesep:s});let l=new Set;for(let e of t)l.add(e.source),l.add(e.target);let d=e.filter(e=>l.has(e.id)),c=e.filter(e=>!l.has(e.id));for(let e of d){let t=T(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);R.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),p="LR"===n||"RL"===n,f=new Map;for(let e of d){let t=i.node(e.id),r=T(e,o);f.set(e.id,{cx:t.x,cy:t.y,w:r.width,h:r.height})}let g=0;for(let e of f.values()){g=p?e.cx:e.cy;break}for(let e of c){let t=T(e,o);f.set(e.id,{cx:p?g:0,cy:p?0:g,w:t.width,h:t.height})}let m=new Map;for(let e of t)f.has(e.source)&&f.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 y=[...[...l].filter(e=>f.has(e)&&!x.has(e)),...c.map(e=>e.id)];y.sort((e,t)=>(v.get(e)??0)-(v.get(t)??0));let b=new Map;for(let e of y)!function e(t){if(b.has(t))return b.get(t);let r=f.get(t),n=p?r.h:r.w,o=m.get(t);if(!o||0===o.length)return b.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 b.set(t,i),i}(e);let w=0;for(let e of y){let t=b.get(e)??0;!function e(t,r){let n=f.get(t);p?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+=b.get(e)??0;let i=r-(a+=(o.length-1)*s)/2;for(let t of o){let r=b.get(t)??0;e(t,i+r/2),i+=r+s}}(e,w+t/2),w+=t+s}let k=[];for(let t of e){let e=f.get(t.id);e&&k.push({...t,targetPosition:u,sourcePosition:h,position:{x:e.cx-e.w/2,y:e.cy-e.h/2}})}return{nodes:k,edges:[...t]}}var $=e.i(508893);let B=(0,$.createServerReference)("40bd757ea34e83384ab7ad62dd5066e8c072264c40",$.callServer,void 0,$.findSourceMapURL,"archiveFeature"),z=(0,$.createServerReference)("78ef86e52a970b963f189327663a634e4c1d5e8d4d",$.callServer,void 0,$.findSourceMapURL,"deleteFeature");var G=e.i(172907),W=e.i(452042),q=e.i(830681);let U=(0,$.createServerReference)("405d52d3670ea3016656431c5460f31c0977fe3914",$.callServer,void 0,$.findSourceMapURL,"unarchiveFeature");var H=e.i(104814);let V=(0,$.createServerReference)("60954c620a5067e223fabeb6049ec6d4018f4322f1",$.callServer,void 0,$.findSourceMapURL,"deleteRepository");var X=e.i(224011);let Y=(0,$.createServerReference)("40d09f6bc720e2e0b641708cc3497c427ff3a9eb08",$.callServer,void 0,$.findSourceMapURL,"getFeatureMetadata");var J=e.i(648034),K=e.i(873504),Z=e.i(808361),Q=e.i(118354),ee=e.i(799045);e.i(541001);var et=e.i(64780);function er(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,a=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}):"applicationNode"===t.type&&a.set(t.id,{nodeId:t.id,data:t.data});return{featureMap:n,repoMap:o,applicationMap:a}}function en(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)}function eo(e,t){if(e.size!==t.size)return!1;for(let[r,n]of e){let e=t.get(r);if(!e||n.parentNodeId!==e.parentNodeId||n.data!==e.data&&JSON.stringify(n.data)!==JSON.stringify(e.data))return!1}return!0}let ea=(0,Q.createLogger)("[Polling]"),es=0,ei=0;function el(e,o){let a=(0,r.useRouter)(),s=(0,Z.useSoundAction)("delete"),i=(0,Z.useSoundAction)("create"),[l,d]=(0,t.useState)(!1),{nodes:c,edges:u,reconcile:h,updateFeature:p,addPendingFeature:f,removeFeature:g,restoreFeature:m,addRepository:v,removeRepository:x,replaceRepository:y,getFeatureRepositoryPath:b,getRepositoryData:w,getRepoMapSize:k,addApplication:j,removeApplication:N,setCallbacks:E,beginMutation:C,endMutation:S,isMutating:_}=function(e,r,n=!1){let{i18n:o}=(0,et.useTranslation)(),a=(0,t.useMemo)(()=>F(o.dir()),[o]),s=(0,t.useMemo)(()=>er(e,r),[]),[i,l]=(0,t.useState)(s.featureMap),[d,c]=(0,t.useState)(s.repoMap),[u,h]=(0,t.useState)(s.applicationMap),[p,f]=(0,t.useState)(new Map),g=(0,t.useRef)(new Map),m=(0,t.useRef)(new Set),v=(0,t.useRef)(0),x=(0,t.useRef)(new Set),y=(0,t.useRef)(new Set),b=(0,t.useRef)(new Set),w=(0,t.useRef)({}),k=(0,t.useMemo)(()=>({onNodeAction:e=>w.current.onNodeAction?.(e),onNodeSettings:e=>w.current.onNodeSettings?.(e),onFeatureDelete:(e,t,r,n)=>w.current.onFeatureDelete?.(e,t,r,n),onRepositoryAdd:e=>w.current.onRepositoryAdd?.(e),onRepositoryClick:e=>w.current.onRepositoryClick?.(e),onRepositoryDelete:e=>w.current.onRepositoryDelete?.(e),onRetryFeature:e=>w.current.onRetryFeature?.(e),onStartFeature:e=>w.current.onStartFeature?.(e),onArchiveFeature:e=>w.current.onArchiveFeature?.(e),onUnarchiveFeature:e=>w.current.onUnarchiveFeature?.(e),onApplicationClick:e=>w.current.onApplicationClick?.(e),onApplicationDelete:e=>w.current.onApplicationDelete?.(e)}),[]),j=(0,t.useRef)(i);j.current=i;let N=(0,t.useRef)(d);N.current=d;let E=(0,t.useMemo)(()=>{if(n)return i;let e=new Map;for(let[t,r]of i)"archived"!==r.data.state&&e.set(t,r);return e.size===i.size?i:e},[i,n]),C=(0,t.useMemo)(()=>(function(e,t,r,n,o){let a=[],s=[],i=e=>e.replace(/\\/g,"/"),l=new Map;for(let[e,r]of t)r.data.repositoryPath&&l.set(i(r.data.repositoryPath),e);let d=new Map;for(let[e,r]of[...t.entries()].sort((e,t)=>{let r=e[1].data.createdAt,n=t[1].data.createdAt;return("number"!=typeof r||Number.isNaN(r)?1/0:r)-("number"!=typeof n||Number.isNaN(n)?1/0:n)})){let t={...r.data,...n?.onRepositoryAdd&&{onAdd:()=>n.onRepositoryAdd(e)},...n?.onRepositoryClick&&{onClick:()=>n.onRepositoryClick(e)},...n?.onRepositoryDelete&&{onDelete:n.onRepositoryDelete}};a.push({id:e,type:"repositoryNode",position:{x:0,y:0},data:t})}for(let[t,o,c]of[...[...e.entries()].map(([e,t])=>[e,t,!1]),...[...r.entries()].filter(([t])=>!e.has(t)).map(([e,t])=>[e,t,!0])]){let u="creating"===o.data.state||c,h={...o.data,...!u&&n?.onNodeAction&&{onAction:()=>n.onNodeAction(t)},...!u&&n?.onNodeSettings&&{onSettings:()=>n.onNodeSettings(t)},...!u&&n?.onFeatureDelete&&{onDelete:n.onFeatureDelete},...!u&&"error"===o.data.state&&n?.onRetryFeature&&{onRetry:n.onRetryFeature},...!u&&"pending"===o.data.state&&n?.onStartFeature&&{onStart:n.onStartFeature},...!u&&("running"===o.data.state||"action-required"===o.data.state)&&n?.onStopFeature&&{onStop:n.onStopFeature},...!u&&"archived"!==o.data.state&&"deleting"!==o.data.state&&n?.onArchiveFeature&&{onArchive:n.onArchiveFeature},...!u&&"archived"===o.data.state&&n?.onUnarchiveFeature&&{onUnarchive:n.onUnarchiveFeature}};if(a.push({id:t,type:"featureNode",position:{x:0,y:0},data:h}),o.parentNodeId&&(e.has(o.parentNodeId)||r.has(o.parentNodeId)))s.push({id:`dep-${o.parentNodeId}-${t}`,source:o.parentNodeId,target:t,type:"dependencyEdge"});else{let e=i(o.data.repositoryPath),r=l.get(e)??function(e){if(d.has(e))return d.get(e);let t=`virtual-repo-${e}`,r=e.split("/").filter(Boolean).at(-1)??e;return a.push({id:t,type:"repositoryNode",position:{x:0,y:0},data:{name:r,repositoryPath:e}}),d.set(e,t),t}(e);s.push({id:`edge-${r}-${t}`,source:r,target:t,style:{strokeDasharray:"5 5"}})}}if(o)for(let[e,t]of o){let r={...t.data,...n?.onApplicationClick&&{onClick:()=>n.onApplicationClick(t.data.id)},...n?.onApplicationDelete&&{onDelete:n.onApplicationDelete}};if(a.push({id:e,type:"applicationNode",position:{x:0,y:0},data:r}),t.data.repositoryPath){let r=t.data.repositoryPath.replace(/\\/g,"/"),n=l.get(r);n&&s.push({id:`edge-${e}-${n}`,source:e,target:n,style:{strokeDasharray:"5 5"}})}}let c=new Set;for(let e of s)"dependencyEdge"===e.type&&c.add(e.source);let u=s.length>0;for(let e of a){let t=e.data;t.showHandles=u,"featureNode"===e.type&&(t.hasChildren=c.has(e.id))}return{nodes:a,edges:s}})(E,d,p,k,u),[E,d,p,k,u]),S=(0,t.useRef)({key:"",positions:new Map}),{nodes:_,edges:D}=(0,t.useMemo)(()=>{let e=C.nodes.map(e=>e.id).sort().join(","),t=C.edges.map(e=>`${e.source}-${e.target}`).sort().join(","),r=`${e}|${t}|${a.direction}`;if(r!==S.current.key){let e=A(C.nodes,C.edges,a),t=new Map;for(let r of e.nodes)t.set(r.id,{position:r.position,targetPosition:r.targetPosition,sourcePosition:r.sourcePosition});let n=S.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 S.current={key:r,positions:t},e}let{positions:n}=S.current;return{nodes:C.nodes.map(e=>{let t=n.get(e.id);return t?{...e,...t}:e}),edges:C.edges}},[C,a]),M=(0,t.useCallback)((e,t)=>{if(v.current>0)return;let{featureMap:r,repoMap:n}=er(e,t),o=new Set([...r.values()].map(e=>`${e.data.name}\0${e.data.repositoryPath}`));l(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"}}):y.current.has(t)||(n.set(t,r),a.add(t)));for(let[e,t]of(y.current=a,g.current)){let r=n.get(e);r&&(n.set(e,{...r,data:{...r.data,...t}}),g.current.delete(e))}return eo(e,n)?e:n}),f(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}),c(e=>{let t=new Map(n);for(let e of b.current)t.has(e)?t.delete(e):b.current.delete(e);let 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)){m.current.delete(n);continue}(n.startsWith("repo-temp-")||m.current.has(n))&&t.set(n,o)}return eo(e,t)?e:t});let{applicationMap:a}=er(e,t);h(e=>eo(e,a)?e:a)},[]),O=(0,t.useCallback)((e,t)=>{l(r=>{let n=r.get(e);if(!n)return g.current.set(e,{...g.current.get(e),...t}),r;if(g.current.delete(e),en(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o}),f(r=>{let n=r.get(e);if(!n||en(n.data,t))return r;let o=new Map(r);return o.set(e,{...n,data:{...n.data,...t}}),o})},[]),P=(0,t.useCallback)((e,t,r)=>{f(n=>{let o=new Map(n);return o.set(e,{nodeId:e,data:t,parentNodeId:r}),o})},[]),R=(0,t.useCallback)(e=>{f(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),I=(0,t.useCallback)(e=>{l(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),L=(0,t.useCallback)((e,t)=>{l(r=>{let n=new Map(r);return n.set(e,t),n})},[]),T=(0,t.useCallback)((e,t)=>{m.current.add(e),b.current.delete(e),c(r=>{let n=new Map(r);return n.set(e,{nodeId:e,data:t}),n})},[]),$=(0,t.useCallback)(e=>{m.current.delete(e),b.current.add(e),c(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),B=(0,t.useCallback)((e,t,r)=>{m.current.delete(e),m.current.add(t),c(n=>{if(!n.has(e))return n;let o=new Map(n);return o.delete(e),o.set(t,{nodeId:t,data:r}),o})},[]),z=(0,t.useCallback)((e,t)=>{h(r=>{let n=new Map(r);return n.set(e,{nodeId:e,data:t}),n})},[]),G=(0,t.useCallback)(e=>{h(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),W=(0,t.useCallback)(e=>j.current.get(e)?.data.repositoryPath,[]),q=(0,t.useCallback)(e=>N.current.get(e)?.data,[]),U=(0,t.useCallback)(()=>N.current.size,[]),H=(0,t.useCallback)(e=>{w.current=e},[]),V=(0,t.useCallback)(()=>{v.current++},[]),X=(0,t.useCallback)((e=3e3)=>{let t=setTimeout(()=>{v.current=Math.max(0,v.current-1),x.current.delete(t)},e);x.current.add(t)},[]),Y=(0,t.useCallback)(()=>v.current>0,[]);return(0,t.useEffect)(()=>{let e=x.current;return()=>{for(let t of e)clearTimeout(t);e.clear()}},[]),{nodes:_,edges:D,reconcile:M,updateFeature:O,addPendingFeature:P,removePendingFeature:R,removeFeature:I,restoreFeature:L,addRepository:T,removeRepository:$,replaceRepository:B,getFeatureRepositoryPath:W,getRepositoryData:q,getRepoMapSize:U,addApplication:z,removeApplication:G,setCallbacks:H,beginMutation:V,endMutation:X,isMutating:Y}}(e,o,l),D=(0,t.useRef)(c),M=(0,t.useRef)(u);(0,t.useEffect)(()=>{D.current=c,M.current=u},[c,u]);let O=(0,t.useMemo)(()=>e.map(e=>e.id).sort().join(","),[e]),P=(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]),R=(0,t.useRef)("");(0,t.useEffect)(()=>{let t=`${O}|${P}`;t!==R.current&&(R.current=t,h(e,o))},[O,P,e,o,h]);let I=(0,t.useRef)(new Map),{events:L}=(0,J.useAgentEventsContext)(),{store:T}=(0,K.useDeploymentStatusContext)();(0,t.useEffect)(()=>{let t=I.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&&(L.some(t=>t.featureId===e.featureId&&(0,ee.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)}},[P,e,L,a]);let $=(0,t.useRef)(0);(0,t.useEffect)(()=>{if($.current>L.length&&($.current=0),L.length<=$.current)return;let e=L.slice($.current);for(let{featureId:t,state:r,lifecycle:n}of($.current=L.length,(0,ee.resolveSseEventUpdates)(e)))if(void 0!==r||void 0!==n){let e=`feat-${t}`,o=D.current.find(t=>t.id===e),a=o?o.data.state:void 0;if("deleting"===a||"error"===r&&_()&&"running"===a)continue;p(e,{...void 0!==r&&{state:r},...void 0!==n&&{lifecycle:n}})}},[L,p,_]),(0,t.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;C(),p(`feat-${t}`,{state:"running"}),S()};return window.addEventListener("shep:feature-approved",e),()=>window.removeEventListener("shep:feature-approved",e)},[p,C,S]);let Q=(0,t.useRef)(new Set),el=(0,t.useRef)(0);(0,t.useEffect)(()=>{if(el.current>L.length&&(el.current=0),L.length<=el.current)return;let e=L.slice(el.current);for(let t of(el.current=L.length,e)){if("Feature metadata updated"!==t.message||Q.current.has(t.featureId))continue;Q.current.add(t.featureId);let e=`feat-${t.featureId}`;Y(t.featureId).then(t=>{t&&p(e,{name:t.name,description:t.description})}).catch(()=>{})}},[L,p]),(0,t.useEffect)(()=>{ea.debug("polling enabled (15000ms interval)");let e=setInterval(async()=>{if(!document.hidden&&!_())try{let e=await fetch("/api/graph-data");if(!e.ok)throw Error(`status ${e.status}`);let{nodes:t,edges:r,deployments:n}=await e.json();h(t,r),Array.isArray(n)&&T.hydrate(n)}catch{ea.warn("poll fetch failed — will retry next interval")}},15e3);return()=>{ea.debug("polling disabled"),clearInterval(e)}},[h,_,T]);let ed=(0,t.useCallback)(e=>{},[]),ec=(0,t.useCallback)(e=>{},[]),eu=(0,t.useCallback)((e,t,r)=>{let n=t?.featureId?`feat-${t.featureId}`:`feature-${Date.now()}-${es++}`,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 f(n,o,"dependencyEdge"===r&&e?e:void 0),n},[f]),eh=(0,t.useCallback)(e=>{let t=`feat-${e}`;C(),p(t,{state:"running"}),(0,G.resumeFeature)(e).then(e=>{e.error?(p(t,{state:"error"}),n.toast.error(e.error)):n.toast.success("Feature resumed")}).catch(()=>{p(t,{state:"error"}),n.toast.error("Failed to resume feature")}).finally(()=>S())},[p,C,S]),ep=(0,t.useCallback)(e=>{let t=`feat-${e}`;C(),p(t,{state:"running"}),(0,W.startFeature)(e).then(e=>{e.error?(p(t,{state:"pending"}),n.toast.error(e.error)):n.toast.success("Feature started")}).catch(()=>{p(t,{state:"pending"}),n.toast.error("Failed to start feature")}).finally(()=>S())},[p,C,S]),ef=(0,t.useCallback)(e=>{C(),(0,q.stopFeature)(e).then(e=>{e.error?n.toast.error(e.error):n.toast.success("Agent stopped")}).catch(()=>{n.toast.error("Failed to stop agent")}).finally(()=>S())},[C,S]),eg=(0,t.useCallback)(e=>{let t=`feat-${e}`;C(),p(t,{state:"archived"}),B(e).then(e=>{e.error?(p(t,{state:"done"}),n.toast.error(e.error)):n.toast.success("Feature archived")}).catch(()=>{p(t,{state:"done"}),n.toast.error("Failed to archive feature")}).finally(()=>S())},[p,C,S]),em=(0,t.useCallback)(e=>{let t=`feat-${e}`;C(),p(t,{state:"done"}),U(e).then(e=>{e.error?(p(t,{state:"archived"}),n.toast.error(e.error)):n.toast.success("Feature unarchived")}).catch(()=>{p(t,{state:"archived"}),n.toast.error("Failed to unarchive feature")}).finally(()=>S())},[p,C,S]),ev=(0,t.useCallback)((e,t,r,o)=>{let i=`feat-${e}`,l=[];if(!0===r){let e=[i];for(;e.length>0;){let t=e.shift();for(let r of M.current)"dependencyEdge"===r.type&&r.source===t&&(l.push(r.target),e.push(r.target))}}let d=new Map;for(let e of[i,...l]){let t=D.current.find(t=>t.id===e);t&&d.set(e,t.data.state)}for(let e of(C(),p(i,{state:"deleting"}),l))p(e,{state:"deleting"});s.play(),a.push("/"),z(e,t,r,o).then(e=>{if(e.error){for(let[e,t]of d)t&&p(e,{state:t});n.toast.error(e.error)}else for(let e of(g(i),l))g(e)}).catch(()=>{for(let[e,t]of d)t&&p(e,{state:t});n.toast.error("Failed to delete feature")}).finally(()=>S())},[a,s,p,g,C,S]),ex=(0,t.useCallback)(async(e,t)=>{let r=`repo-${e}`,o=new Set(M.current.filter(e=>e.source===r).map(e=>e.target)),a=w(r),i=new Map;for(let e of o){let t=D.current.find(t=>t.id===e);t&&i.set(e,{nodeId:e,data:t.data})}let l=()=>{for(let[e,t]of(a&&v(r,a),i))m(e,t)};for(let e of(C(),x(r),o))g(e);try{let r=await V(e,{deleteFromDisk:t?.deleteFromDisk===!0});if(!r.success){n.toast.error(r.error??"Failed to remove repository"),l();return}s.play()}catch{n.toast.error("Failed to remove repository"),l()}finally{S()}},[s,x,g,v,m,w,C,S]),ey=(0,t.useCallback)(async e=>{let t=`app-${e}`;C(),N(t),s.play();try{let t=await (0,X.deleteApplication)(e);t.error&&n.toast.error(t.error)}catch{n.toast.error("Failed to delete application")}finally{S()}},[s,N,C,S]),eb=(0,t.useCallback)(e=>{let t=A(D.current,M.current,{...F(),direction:e});h(t.nodes,t.edges)},[h]);return{nodes:c,edges:u,onNodesChange:ed,handleConnect:ec,handleAddRepository:(0,t.useCallback)(e=>{let t=0===k(),r=`repo-temp-${++ei}`,o=e.replace(/[\\/]+$/,"").split(/[\\/]/).pop()??e;return C(),v(r,{name:o,repositoryPath:e,id:r,createdAt:Date.now(),gitInfoStatus:"loading"}),(0,H.addRepository)({path:e,name:o}).then(e=>{if(e.error){x(r),n.toast.error(e.error);return}let t=e.repository;y(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(()=>{x(r),n.toast.error("Failed to add repository")}).finally(()=>S()),{wasEmpty:t,repoPath:e,tempNodeId:r}},[v,x,y,i,k,C,S]),handleArchiveFeature:eg,handleLayout:eb,handleDeleteFeature:ev,handleRetryFeature:eh,handleStartFeature:ep,handleStopFeature:ef,handleUnarchiveFeature:em,handleDeleteRepository:ex,handleDeleteApplication:ey,createFeatureNode:eu,addApplication:j,showArchived:l,setShowArchived:d,getFeatureRepositoryPath:b,getRepositoryData:w,setCallbacks:E}}e.s(["useControlCenterState",()=>el],917840)},948246,e=>{"use strict";var t=e.i(679606),r=e.i(53271),n=e.i(992786),o=e.i(152155),a=e.i(711434),s=e.i(591925),i=e.i(3214);e.i(541001);var l=e.i(64780),d=e.i(131777),c=e.i(735364);e.i(454793);var u=e.i(207729);e.i(547506);var h=e.i(189313),p=e.i(292002),f=e.i(903645);let g=(0,f.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 m=e.i(208986),v=e.i(338573),x=e.i(619933),y=e.i(267669),b=e.i(724042),w=e.i(64970),k=e.i(949228),j=e.i(565530),N=e.i(907311),E=e.i(194365),C=e.i(438227),S=e.i(248109),_=e.i(626960);e.i(81803);var D=e.i(872714),M=e.i(602287),O=e.i(474363),P=e.i(141957),R=e.i(102828),I=e.i(8537),F=e.i(175921),L=e.i(676852),T=e.i(457779),A=e.i(680554),$=e.i(780519);function B({data:e,selected:n}){let{t:s,i18n:u}=(0,l.useTranslation)("web"),h=(0,a.useRouter)(),f="rtl"===u.dir(),B=f?p.Position.Right:p.Position.Left,z=f?p.Position.Left:p.Position.Right,G=(0,F.useFeatureFlags)(),[W,q]=(0,o.useState)(!1),[U,H]=(0,o.useState)(!1);(0,o.useEffect)(()=>{W&&H(!1)},[W]);let V=e.id?`repo-${e.id}`:`repo-${e.name}`,X=(0,A.useTurnStatus)(V),Y=(0,L.useRepositoryActions)(e.repositoryPath?{repositoryId:e.id,repositoryPath:e.repositoryPath}:null),J=(0,I.useDeployAction)(e.repositoryPath?{targetId:e.repositoryPath,targetType:"repository",repositoryPath:e.repositoryPath}:null),K="Booting"===J.status||"Ready"===J.status,Z=(0,o.useCallback)((t,r)=>{if(!e.repositoryPath)return;let n=t.preview?t.preview.slice(0,200):"Unknown conversation",o=["Continue work from a previous agent session.","","## Session Context",`- Session ID: ${t.id}`,`- Messages: ${t.messageCount}`,t.lastMessageAt?`- Last active: ${t.lastMessageAt}`:"",`- Conversation file: ${r}`,"","## Session Preview",`> ${n}`,"","## Instructions","1. Read the full conversation history from the file above",`2. Analyze the current state of the repository — what was done, what remains`,"3. Create or update spec files to accurately reflect the current state and remaining work","4. Continue implementing any unfinished work from the conversation"].filter(Boolean).join("\n"),a=new URLSearchParams({repo:e.repositoryPath,prompt:o});h.push(`/create?${a.toString()}`)},[e.repositoryPath,h]);return(0,t.jsxs)("div",{className:(0,d.cn)("group relative",e.onDelete&&e.id&&"ps-10"),style:{direction:f?"rtl":"ltr"},children:[e.showHandles?(0,t.jsx)(r.Handle,{type:"target",position:B,isConnectable:!1,className:"opacity-0!",style:{top:70}}):null,e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute -start-3 top-1/2 -translate-y-1/2 opacity-0 transition-opacity group-hover:opacity-100",children:(0,t.jsx)(R.TooltipProvider,{children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":s("repositoryNode.removeRepository"),"data-testid":"repository-node-delete-button",onClick:e=>{e.stopPropagation(),q(!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)(y.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(R.TooltipContent,{children:s("repositoryNode.removeRepository")})]})})}),(0,t.jsx)(M.Dialog,{open:W,onOpenChange:q,children:(0,t.jsxs)(M.DialogContent,{className:"max-w-sm",children:[(0,t.jsxs)(M.DialogHeader,{children:[(0,t.jsx)(M.DialogTitle,{children:s("repositoryNode.removeConfirmTitle")}),(0,t.jsxs)(M.DialogDescription,{children:[(0,t.jsx)(_.Trans,{t:s,i18nKey:"repositoryNode.removeConfirmDescription",values:{name:e.name},components:{strong:(0,t.jsx)("strong",{})}})," ",s(U?"repositoryNode.removeConfirmDescriptionDeleteFiles":"repositoryNode.removeConfirmDescriptionKeepFiles")]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(O.Checkbox,{id:"repository-delete-from-disk",checked:U,onCheckedChange:e=>H(!0===e),"data-testid":"repository-node-delete-from-disk-checkbox","aria-label":s("repositoryNode.deleteFromDiskLabel")}),(0,t.jsx)(P.Label,{htmlFor:"repository-delete-from-disk",className:"cursor-pointer text-sm font-normal",children:s("repositoryNode.deleteFromDiskLabel")})]}),(0,t.jsxs)(M.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(M.DialogClose,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"outline",children:s("repositoryNode.cancel")})}),(0,t.jsx)(c.Button,{variant:"destructive","data-testid":"repository-node-delete-confirm-button",onClick:()=>{q(!1),e.onDelete?.(e.id,{deleteFromDisk:U})},children:s("repositoryNode.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:(0,d.cn)("nodrag bg-card flex w-[26rem] cursor-pointer flex-col overflow-hidden rounded-xl border shadow-sm transition-[border-color,box-shadow] duration-200 dark:bg-neutral-800/80",n&&"border-blue-400 dark:border-amber-500/60"),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3",children:[(0,t.jsx)(g,{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)&&"ms-auto"),onClick:e=>e.stopPropagation(),children:[e.repositoryPath?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.TooltipProvider,{children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(D.ActionButton,{label:s("repositoryNode.openInIde"),onClick:Y.openInIde,loading:Y.ideLoading,error:!!Y.ideError,icon:m.Code2,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(R.TooltipContent,{children:s("repositoryNode.openInIde")})]})}),(0,t.jsx)(R.TooltipProvider,{children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(D.ActionButton,{label:s("repositoryNode.openInShell"),onClick:Y.openInShell,loading:Y.shellLoading,error:!!Y.shellError,icon:v.Terminal,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(R.TooltipContent,{children:s("repositoryNode.openInShell")})]})}),(0,t.jsx)(R.TooltipProvider,{children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"flex items-center",children:(0,t.jsx)(D.ActionButton,{label:s("repositoryNode.openFolder"),onClick:Y.openFolder,loading:Y.folderLoading,error:!!Y.folderError,icon:x.FolderOpen,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(R.TooltipContent,{children:s("repositoryNode.openFolder")})]})}),(0,t.jsx)(R.TooltipProvider,{children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)(c.Button,{variant:"ghost",size:"icon-xs","aria-label":s("repositoryNode.chatWithAgent"),onClick:t=>{t.stopPropagation(),e.id&&h.push(`/repository/${e.id}/chat`)},className:"nodrag relative cursor-pointer text-violet-500 hover:text-violet-600 dark:text-violet-400 dark:hover:text-violet-300",children:[(0,t.jsx)(S.MessageSquare,{className:"h-3 w-3"}),(0,t.jsx)(T.ChatDotIndicator,{status:X})]})}),(0,t.jsx)(R.TooltipContent,{children:s("repositoryNode.chatWithAgent")})]})}),(0,t.jsx)($.FeatureSessionsDropdown,{repositoryPath:e.repositoryPath,includeWorktrees:!0,onCreateFromSession:Z})]}):null,e.onAdd?(0,t.jsx)("div",{className:"ms-1.5"}):null,e.onAdd?(0,t.jsx)(R.TooltipProvider,{children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("button",{"aria-label":s("repositoryNode.newFeature"),"data-testid":"repository-node-add-button",onClick:t=>{t.stopPropagation(),e.onAdd?.()},className:(0,d.cn)("flex h-6 shrink-0 cursor-pointer items-center gap-0.5 rounded bg-blue-500 px-1.5 text-[11px] font-bold text-white transition-colors hover:bg-blue-600 dark:bg-amber-500 dark:hover:bg-amber-400",e.pulseAdd&&"animate-pulse-cta"),children:[(0,t.jsx)(i.Plus,{className:"h-3 w-3"}),(0,t.jsx)("span",{className:"translate-y-px",children:s("repositoryNode.new")})]})}),(0,t.jsx)(R.TooltipContent,{side:"top",children:s("repositoryNode.newFeature")})]})}):null]})]}),e.branch?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-testid":"repository-node-git-info",className:"text-muted-foreground border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-3 text-xs",children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 truncate","data-testid":"repository-node-branch",children:[(0,t.jsx)(k.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"truncate",children:e.branch})]}),null!=e.behindCount&&e.behindCount>0?(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1 whitespace-nowrap text-amber-500","data-testid":"repository-node-behind",children:[(0,t.jsx)(N.ArrowDown,{className:"h-3 w-3 shrink-0"}),s("repositoryNode.behind",{count:e.behindCount})]}):null]})}),e.commitMessage?(0,t.jsx)("div",{"data-testid":"repository-node-commit-info",className:"text-muted-foreground border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(j.GitCommitHorizontal,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate","data-testid":"repository-node-commit-message",children:e.commitMessage}),e.committer?(0,t.jsxs)("span",{className:"text-muted-foreground/70 ms-auto flex shrink-0 items-center gap-1","data-testid":"repository-node-committer",children:[(0,t.jsx)(E.User,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{children:e.committer})]}):null]})}):null]}):"not-a-repo"===e.gitInfoStatus?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-testid":"repository-node-not-repo",className:"text-muted-foreground border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[(0,t.jsx)(x.FolderOpen,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"min-w-0 truncate opacity-60",children:e.repositoryPath??"Unknown path"})]})}),(0,t.jsx)("div",{className:"text-muted-foreground border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs opacity-40",children:[(0,t.jsx)(k.GitBranch,{className:"h-3 w-3 shrink-0"}),(0,t.jsx)("span",{children:s("repositoryNode.notAGitRepository")})]})})]}):"ready"!==e.gitInfoStatus?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-testid":"repository-node-git-loading",className:"border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex h-4 items-center gap-2 text-xs",children:[(0,t.jsx)(k.GitBranch,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"bg-muted h-3 w-20 animate-pulse rounded"})]})}),(0,t.jsx)("div",{className:"border-border/50 border-t px-4 py-2",children:(0,t.jsxs)("div",{className:"flex h-4 items-center gap-2 text-xs",children:[(0,t.jsx)(j.GitCommitHorizontal,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,t.jsx)("span",{className:"bg-muted h-3 w-36 animate-pulse rounded"})]})})]}):null,G.envDeploy&&e.repositoryPath?(0,t.jsx)("div",{"data-testid":"repository-node-dev-preview",className:"border-border/50 border-t px-4 py-2",onClick:e=>e.stopPropagation(),children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs",children:[J.deployError?(0,t.jsx)("span",{className:"truncate text-xs text-red-500",children:J.deployError}):K?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"me-0.5 inline-block h-2 w-2 shrink-0 rounded-full bg-green-500"}),J.url?(0,t.jsx)("a",{href:J.url,target:"_blank",rel:"noopener noreferrer",className:"truncate text-green-700 hover:underline dark:text-green-400",children:J.url}):(0,t.jsx)("span",{className:"text-muted-foreground",children:s("repositoryNode.starting")})]}):(0,t.jsxs)("span",{className:"text-muted-foreground inline-flex items-baseline gap-2",children:[(0,t.jsx)("span",{children:s("repositoryNode.run")}),(0,t.jsx)("span",{className:"text-muted-foreground/50 text-[10px]",children:s("repositoryNode.startLocalEnvironment")})]}),(0,t.jsx)(R.TooltipProvider,{children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:(0,d.cn)("ms-auto flex items-center",!K&&!J.deployError&&"[&_button]:text-green-600 [&_button]:hover:text-green-700 dark:[&_button]:text-green-400 dark:[&_button]:hover:text-green-300"),children:(0,t.jsx)(D.ActionButton,{label:s(J.deployError?"repositoryNode.retry":K?"repositoryNode.stopDevServer":"repositoryNode.startDevServer"),onClick:K?J.stop:J.deploy,loading:J.deployLoading||J.stopLoading,error:!1,icon:J.deployError?C.RotateCcw:K?w.Square:b.Play,iconOnly:!0,variant:"ghost",size:"icon-xs"})})}),(0,t.jsx)(R.TooltipContent,{children:s(K?"repositoryNode.stopDevServer":"repositoryNode.startDevServer")})]})})]})}):null]}),e.onAdd||e.showHandles?(0,t.jsx)(r.Handle,{type:"source",position:z,isConnectable:!e.showHandles,className:"opacity-0!",style:{top:70}}):null]})}e.i(1650),e.i(845811),e.i(425235);var z=e.i(730702),G=e.i(542049),W=e.i(83428),q=e.i(370002),U=e.i(317406),H=e.i(657365);function V({data:e,selected:n}){let{i18n:a}=(0,l.useTranslation)("web"),s="rtl"===a.dir(),i=s?p.Position.Right:p.Position.Left,u=s?p.Position.Left:p.Position.Right,[h,f]=(0,o.useState)(!1),g=1+e.additionalPathCount,m=1===g?"1 repository":`${g} repositories`,v=(0,A.useTurnStatus)(`app-${e.id}`),x=(0,I.useDeployAction)({targetId:e.id,targetType:"application",repositoryPath:e.repositoryPath}),k=x.url,j=(0,H.deriveAppLiveStatus)(e.status,v,!!k),N=(0,o.useCallback)(e=>{e.stopPropagation()},[]),E=(0,o.useCallback)(e=>{e.stopPropagation(),k&&window.open(k,"_blank","noopener,noreferrer")},[k]);return(0,t.jsxs)("div",{className:"group relative",style:{direction:s?"rtl":"ltr"},children:[(0,t.jsx)(r.Handle,{type:"target",position:i,isConnectable:!1,className:"opacity-0!",style:{top:70}}),e.onDelete&&e.id?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute -start-14 top-0 bottom-0 flex items-center justify-center ps-4 pe-3 opacity-0 transition-opacity group-hover:opacity-100",onPointerDown:e=>e.stopPropagation(),children:(0,t.jsx)(R.TooltipProvider,{children:(0,t.jsxs)(R.Tooltip,{children:[(0,t.jsx)(R.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{"aria-label":"Remove application","data-testid":"application-node-delete-button",onClick:e=>{e.stopPropagation(),f(!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)(y.Trash2,{className:"h-3.5 w-3.5"})})}),(0,t.jsx)(R.TooltipContent,{children:"Remove application"})]})})}),(0,t.jsx)(M.Dialog,{open:h,onOpenChange:f,children:(0,t.jsxs)(M.DialogContent,{className:"max-w-xs",children:[(0,t.jsxs)(M.DialogHeader,{children:[(0,t.jsx)(M.DialogTitle,{children:"Remove application?"}),(0,t.jsxs)(M.DialogDescription,{children:["This will remove ",(0,t.jsx)("strong",{children:e.name})," from your workspace."]})]}),(0,t.jsxs)(M.DialogFooter,{className:"grid grid-cols-2 gap-2 sm:flex-none",children:[(0,t.jsx)(M.DialogClose,{asChild:!0,children:(0,t.jsx)(c.Button,{variant:"outline",children:"Cancel"})}),(0,t.jsx)(c.Button,{variant:"destructive",onClick:()=>{f(!1),e.onDelete?.(e.id)},children:"Remove"})]})]})})]}):null,(0,t.jsxs)("div",{role:"button",tabIndex:0,"data-testid":"application-node-card","data-app-name":e.name,onClick:t=>{t.stopPropagation(),e.onClick?.()},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),t.stopPropagation(),e.onClick?.())},className:(0,d.cn)("nodrag bg-card flex w-[26rem] cursor-pointer flex-col overflow-hidden rounded-xl border shadow-sm transition-[border-color,box-shadow] duration-200 dark:bg-neutral-800/80",n&&"border-blue-400 dark:border-amber-500/60",!n&&j.borderClass),children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 px-4 py-4",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-indigo-500 to-violet-500",children:(0,t.jsx)(G.LayoutGrid,{className:"h-4 w-4 text-white"})}),(0,t.jsx)("span",{"data-testid":"application-node-name",className:"min-w-0 truncate text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"ms-auto flex shrink-0 items-center gap-1.5",children:[(0,t.jsx)("span",{"data-testid":"application-node-status-dot",className:(0,d.cn)("relative flex h-2 w-2 items-center justify-center rounded-full",j.dotClass),children:j.pulse?(0,t.jsx)("span",{className:(0,d.cn)("absolute inline-flex h-full w-full animate-ping rounded-full opacity-60",j.dotClass)}):null}),(0,t.jsx)("span",{"data-testid":"application-node-status-text",className:"text-muted-foreground text-xs",children:j.label})]})]}),(0,t.jsx)("div",{className:"px-4 pb-4",children:(0,t.jsxs)("div",{className:"bg-muted group/preview relative overflow-hidden rounded-lg",style:{height:180},children:[k?(0,t.jsx)("iframe",{src:k,title:`${e.name} live preview`,className:"pointer-events-none absolute top-0 left-0 origin-top-left border-0 bg-white",style:{width:"250%",height:"250%",transform:"scale(0.4)"},sandbox:"allow-same-origin allow-scripts",loading:"lazy"}):(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 opacity-50 grayscale",children:[(0,t.jsxs)("div",{className:"flex h-6 items-center gap-2 px-2",style:{background:"var(--muted)"},children:[(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-2 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-2 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-2 rounded-full"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 ms-2 h-2 w-16 rounded"})]}),(0,t.jsxs)("div",{className:"flex h-[calc(100%-1.5rem)]",children:[(0,t.jsxs)("div",{className:"border-muted-foreground/5 flex w-[50px] flex-col gap-2 border-e p-2",children:[(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-full rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-3/4 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-full rounded"})]}),(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-2 p-3",children:[(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2.5 w-2/3 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-full rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-5/6 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-3/4 rounded"}),(0,t.jsx)("div",{className:"bg-muted-foreground/10 h-2 w-2/3 rounded"})]})]})]}),x.status===U.DeploymentState.Ready&&k?(0,t.jsxs)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center gap-2 bg-neutral-900/75 opacity-0 transition-opacity duration-150 group-hover/preview:pointer-events-auto group-hover/preview:opacity-100 dark:bg-neutral-950/80",onPointerDown:N,onClick:N,children:[(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),x.stop()},disabled:x.stopLoading,"aria-label":"Stop dev server",title:"Stop dev server",className:"inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-md border border-neutral-300 bg-white px-3 text-xs font-semibold text-neutral-900 shadow-md transition-colors hover:border-red-500 hover:bg-red-50 hover:text-red-600 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:hover:border-red-500 dark:hover:bg-red-950 dark:hover:text-red-400",children:[x.stopLoading?(0,t.jsx)(W.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,t.jsx)(w.Square,{className:"h-3.5 w-3.5 fill-current"}),(0,t.jsx)("span",{children:"Stop"})]}),(0,t.jsxs)("button",{type:"button",onClick:E,"aria-label":`Open ${e.name} in a new tab`,title:k,className:"inline-flex h-9 cursor-pointer items-center gap-1.5 rounded-md border border-neutral-300 bg-white px-3 text-xs font-semibold text-neutral-900 shadow-md transition-colors hover:bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-900 dark:text-neutral-100 dark:hover:bg-neutral-800",children:[(0,t.jsx)(z.ExternalLink,{className:"h-3.5 w-3.5"}),(0,t.jsx)("span",{children:"Open"})]})]}):null,x.status===U.DeploymentState.Booting||x.deployLoading?(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-neutral-100 dark:bg-neutral-900",children:[(0,t.jsx)(W.Loader2,{className:"h-8 w-8 animate-spin text-amber-500"}),(0,t.jsx)("span",{className:"text-foreground text-xs font-medium",children:"Starting…"})]}):null,x.stopLoading&&x.status===U.DeploymentState.Ready?(0,t.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-neutral-900/75 dark:bg-neutral-950/80",children:[(0,t.jsx)(W.Loader2,{className:"h-8 w-8 animate-spin text-neutral-100"}),(0,t.jsx)("span",{className:"text-xs font-medium text-neutral-100",children:"Stopping…"})]}):null,x.deployLoading||x.stopLoading||x.status===U.DeploymentState.Booting||x.status===U.DeploymentState.Ready||!x.deployError?null:(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),x.deploy()},onPointerDown:N,className:"absolute inset-0 flex flex-col items-center justify-center gap-2 bg-neutral-100 transition-colors hover:bg-neutral-200 dark:bg-neutral-900 dark:hover:bg-neutral-800",children:[(0,t.jsx)(q.TriangleAlert,{className:"h-8 w-8 text-red-500"}),(0,t.jsx)("span",{className:"text-xs font-medium text-red-600 dark:text-red-400",children:"Failed — click to retry"})]}),!k&&!x.deployLoading&&x.status!==U.DeploymentState.Booting&&!x.deployError&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center bg-neutral-900/75 opacity-0 transition-opacity duration-150 group-hover/preview:pointer-events-auto group-hover/preview:opacity-100 dark:bg-neutral-950/80",children:(0,t.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),x.deploy()},onPointerDown:N,className:"inline-flex h-9 items-center gap-2 rounded-md border border-violet-400 bg-gradient-to-br from-indigo-500 to-violet-600 px-4 text-xs font-semibold text-white shadow-md transition-[filter] hover:brightness-110","aria-label":"Start dev server preview",children:[(0,t.jsx)(b.Play,{className:"h-3.5 w-3.5 fill-current"}),(0,t.jsx)("span",{children:"Start Preview"})]})})]})}),(0,t.jsx)("div",{className:"px-4 pb-4",children:(0,t.jsx)("span",{"data-testid":"application-node-repo-count",className:"text-muted-foreground text-xs",children:m})})]}),(0,t.jsx)(r.Handle,{type:"source",position:u,isConnectable:!1,className:"opacity-0!",style:{top:70}})]})}function X(e){let[n]=(0,p.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"}})}let Y={x:30,y:30,zoom:.85};function J({nodes:e,edges:n,selectedFeatureId:a,selectedRepository:s,defaultViewport:p,onNodesChange:f,onAddFeature:g,onConnect:m,onNodeClick:v,onPaneClick:x,onCanvasDrag:y,onMoveEnd:b,toolbar:w,showToolbarOnEmpty:k=!0,emptyState:j}){let{t:N}=(0,l.useTranslation)("web"),E=(0,o.useMemo)(()=>({featureNode:h.FeatureNode,repositoryNode:B,applicationNode:V}),[]),C=(0,o.useMemo)(()=>({dependencyEdge:X}),[]),S=(0,o.useMemo)(()=>{let t=null!=a,r=null!=s&&(null!=s.id||null!=s.path);return t||r?e.map(e=>{if(t&&"featureNode"===e.type&&e.data.featureId===a)return{...e,selected:!0};if(r&&"repositoryNode"===e.type){let t=e.data,r=null!=s.id&&(e.id===s.id||t.id===s.id),n=null!=s.path&&t.repositoryPath===s.path;if(r||n)return{...e,selected:!0}}return e}):e},[e,a,s]),_=0===e.length,[D,M]=(0,o.useState)(_),[O,P]=(0,o.useState)(!1),R=(0,o.useRef)(_);(0,o.useEffect)(()=>{if(R.current&&!_){P(!0);let e=setTimeout(()=>{M(!1),P(!1)},300);return R.current=_,()=>clearTimeout(e)}!R.current&&_&&M(!0),R.current=_},[_]);let I=_&&!j?(0,t.jsx)(u.EmptyState,{title:N("canvas.noFeatures"),description:N("canvas.noFeaturesDescription"),action:(0,t.jsxs)(c.Button,{onClick:g,children:[(0,t.jsx)(i.Plus,{className:"me-2 h-4 w-4"}),N("canvas.newFeature")]})}):null,F=j??I;return(0,t.jsxs)("div",{"data-testid":_?"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:S,edges:n,nodeTypes:E,edgeTypes:C,onConnect:m,onNodesChange:f,onNodeClick:v,onPaneClick:x,onMoveStart:y,onMoveEnd:b,defaultViewport:p??Y,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,proOptions:{hideAttribution:!0},className:"[&_.react-flow__pane]:!cursor-default",children:[(0,t.jsx)(r.Background,{variant:r.BackgroundVariant.Dots,gap:24,size:1,color:"#b8bcc4",className:"dark:[&_circle]:!fill-white/[0.1]"}),w&&!_?(0,t.jsx)(r.Panel,{position:"top-right",className:"!me-3 !mt-3",children:w}):null]}),D&&F?(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",O?"opacity-0":"animate-in fade-in opacity-100 duration-200"),children:(0,t.jsx)("div",{className:"pointer-events-auto h-full w-full",children:F})}):null,w&&_&&k?(0,t.jsx)("div",{className:"pointer-events-auto absolute end-3 top-3 z-20",children:w}):null]})}var K=e.i(987889),Z=e.i(806288);let Q=(0,f.default)("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),ee=(0,f.default)("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),et=(0,f.default)("maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);function er({showArchived:e,onToggleArchived:n,onResetViewport:a,startSlot:s}){let{t:i}=(0,l.useTranslation)("web"),{zoomIn:d,zoomOut:c,fitView:u,setViewport:h}=(0,r.useReactFlow)(),p=(0,o.useCallback)(()=>{d({duration:200})},[d]),f=(0,o.useCallback)(()=>{c({duration:200})},[c]),g=(0,o.useCallback)(()=>{u({duration:400,padding:.3})},[u]),m=(0,o.useCallback)(()=>{a&&h(a(),{duration:400})},[a,h]);return(0,t.jsxs)("div",{className:"bg-background flex items-center gap-1 rounded-xl border px-2 py-1.5 shadow-md dark:bg-neutral-900",children:[s?(0,t.jsxs)(t.Fragment,{children:[s,(0,t.jsx)("div",{className:"bg-border mx-1 h-5 w-px"})]}):null,(0,t.jsx)(en,{onClick:n,title:i(e?"canvas.hideArchived":"canvas.showArchived"),active:e,label:i(e?"canvas.hideArchivedLabel":"canvas.showArchivedLabel"),children:e?(0,t.jsx)(K.Eye,{className:"h-4 w-4"}):(0,t.jsx)(Z.EyeOff,{className:"h-4 w-4"})}),(0,t.jsx)("div",{className:"bg-border mx-1 h-5 w-px"}),(0,t.jsx)(en,{onClick:f,title:i("canvas.zoomOut"),children:(0,t.jsx)(ee,{className:"h-4 w-4"})}),(0,t.jsx)(en,{onClick:p,title:i("canvas.zoomIn"),children:(0,t.jsx)(Q,{className:"h-4 w-4"})}),(0,t.jsx)(en,{onClick:g,title:i("canvas.fitView"),children:(0,t.jsx)(et,{className:"h-4 w-4"})}),a?(0,t.jsx)(en,{onClick:m,title:i("canvas.resetView"),children:(0,t.jsx)(C.RotateCcw,{className:"h-4 w-4"})}):null]})}function en({children:e,onClick:r,title:n,label:o,active:a}){return(0,t.jsxs)("button",{type:"button",onClick:r,title:n,className:(0,d.cn)("inline-flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium transition-colors","hover:bg-accent hover:text-accent-foreground",a?"text-primary bg-primary/10":"text-muted-foreground"),children:[e,o?(0,t.jsx)("span",{children:o}):null]})}var eo=e.i(976874),ea=e.i(723925),es=e.i(998798),ei=e.i(713005),el=e.i(470646);let ed="shep:workspaces:v1",ec="default",eu={workspaces:[{id:ec,name:"Default",repoIds:[],featureIds:[]}],activeWorkspaceId:ec};function eh({workspaces:e,activeWorkspace:r,onSelect:n,onRequestCreate:a,onRequestRename:s,onRequestDelete:l,onManage:c}){let[u,h]=(0,o.useState)(!1),p=r.id===ec;return(0,t.jsxs)(el.DropdownMenu,{open:u,onOpenChange:h,children:[(0,t.jsx)(el.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button","data-testid":"workspace-selector-trigger",className:(0,d.cn)("inline-flex items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium transition-colors","hover:bg-accent hover:text-accent-foreground",p?"text-muted-foreground":"text-primary bg-primary/10"),title:"Workspace",children:[(0,t.jsx)(eo.Layers,{className:"h-4 w-4"}),(0,t.jsx)("span",{className:"max-w-[120px] truncate",children:r.name})]})}),(0,t.jsxs)(el.DropdownMenuContent,{align:"start",className:"min-w-[220px]",children:[(0,t.jsx)(el.DropdownMenuLabel,{children:"Workspaces"}),(0,t.jsx)(el.DropdownMenuSeparator,{}),e.map(e=>{let o=e.id===r.id,a=e.id!==ec;return(0,t.jsxs)(el.DropdownMenuItem,{onSelect:()=>n(e.id),className:"group/ws-row flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[o?(0,t.jsx)(ea.Check,{className:"h-3.5 w-3.5"}):null,a?(0,t.jsx)("button",{type:"button","aria-label":`Delete workspace ${e.name}`,title:`Delete workspace ${e.name}`,onClick:t=>{t.preventDefault(),t.stopPropagation(),h(!1),l(e.id)},className:"text-muted-foreground hover:bg-destructive/10 hover:text-destructive rounded p-0.5 opacity-0 transition-opacity group-hover/ws-row:opacity-100 focus-visible:opacity-100",children:(0,t.jsx)(y.Trash2,{className:"h-3.5 w-3.5"})}):null]})]},e.id)}),(0,t.jsx)(el.DropdownMenuSeparator,{}),(0,t.jsxs)(el.DropdownMenuItem,{onSelect:a,children:[(0,t.jsx)(i.Plus,{className:"mr-2 h-3.5 w-3.5"}),"New workspace…"]}),(0,t.jsxs)(el.DropdownMenuItem,{onSelect:c,disabled:p,children:[(0,t.jsx)(ei.SlidersHorizontal,{className:"mr-2 h-3.5 w-3.5"}),"Manage items…"]}),(0,t.jsxs)(el.DropdownMenuItem,{onSelect:s,disabled:p,children:[(0,t.jsx)(es.Pencil,{className:"mr-2 h-3.5 w-3.5"}),"Rename"]})]})]})}var ep=e.i(853756);function ef({open:e,onOpenChange:r,workspace:n,allNodes:a,onSave:s}){let[i,l]=(0,o.useState)(new Set),[d,u]=(0,o.useState)(new Set);(0,o.useEffect)(()=>{e&&(l(new Set(n.repoIds)),u(new Set(n.featureIds)))},[e,n]);let h=(0,o.useMemo)(()=>{let e=[],t=new Map;for(let r of a){if("repositoryNode"!==r.type)continue;let n=r.data,o=n.repositoryPath??"",a={nodeId:r.id,name:n.name??o.split("/").filter(Boolean).pop()??o,features:[]};e.push(a),t.set(o,a)}for(let e of a){if("featureNode"!==e.type)continue;let r=e.data,n=t.get(r.repositoryPath??"");n&&n.features.push({nodeId:e.id,name:r.name})}return e},[a]);return(0,t.jsx)(M.Dialog,{open:e,onOpenChange:r,children:(0,t.jsxs)(M.DialogContent,{className:"max-h-[80vh] max-w-lg overflow-hidden",children:[(0,t.jsxs)(M.DialogHeader,{children:[(0,t.jsxs)(M.DialogTitle,{children:["Manage workspace: ",n.name]}),(0,t.jsx)(M.DialogDescription,{children:"Select the repositories and features that should appear on this workspace's canvas."})]}),(0,t.jsx)("div",{className:"-mx-6 max-h-[50vh] overflow-y-auto px-6",children:0===h.length?(0,t.jsx)("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"No repositories on the canvas yet."}):(0,t.jsx)("ul",{className:"space-y-3 py-2",children:h.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsxs)("label",{className:"hover:bg-accent/30 flex cursor-pointer items-center gap-2 rounded-md px-2 py-1.5",children:[(0,t.jsx)(O.Checkbox,{checked:i.has(e.nodeId),onCheckedChange:()=>{var t;return t=e.nodeId,void l(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})}}),(0,t.jsx)(k.GitBranch,{className:"text-muted-foreground h-4 w-4"}),(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name})]}),e.features.length>0?(0,t.jsx)("ul",{className:"mt-1 ml-7 space-y-0.5",children:e.features.map(e=>(0,t.jsx)("li",{children:(0,t.jsxs)("label",{className:"hover:bg-accent/30 flex cursor-pointer items-center gap-2 rounded-md px-2 py-1",children:[(0,t.jsx)(O.Checkbox,{checked:d.has(e.nodeId),onCheckedChange:()=>{var t;return t=e.nodeId,void u(e=>{let r=new Set(e);return r.has(t)?r.delete(t):r.add(t),r})}}),(0,t.jsx)(ep.Sparkles,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,t.jsx)("span",{className:"text-muted-foreground text-xs",children:e.name})]})},e.nodeId))}):null]},e.nodeId))})}),(0,t.jsxs)(M.DialogFooter,{children:[(0,t.jsx)(c.Button,{variant:"ghost",onClick:()=>r(!1),children:"Cancel"}),(0,t.jsx)(c.Button,{onClick:()=>{s({repoIds:Array.from(i),featureIds:Array.from(d)}),r(!1)},children:"Save"})]})]})})}var eg=e.i(698127);function em({open:e,onOpenChange:r,title:n,description:a,initialValue:s="",confirmLabel:i,onConfirm:l}){let[d,u]=(0,o.useState)(s);return(0,o.useEffect)(()=>{e&&u(s)},[e,s]),(0,t.jsx)(M.Dialog,{open:e,onOpenChange:r,children:(0,t.jsx)(M.DialogContent,{className:"max-w-sm",children:(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=d.trim();t&&(l(t),r(!1))},children:[(0,t.jsxs)(M.DialogHeader,{children:[(0,t.jsx)(M.DialogTitle,{children:n}),a?(0,t.jsx)(M.DialogDescription,{children:a}):null]}),(0,t.jsx)("div",{className:"py-4",children:(0,t.jsx)(eg.Input,{autoFocus:!0,value:d,onChange:e=>u(e.target.value),placeholder:"Workspace name","data-testid":"workspace-name-input"})}),(0,t.jsxs)(M.DialogFooter,{children:[(0,t.jsx)(c.Button,{type:"button",variant:"ghost",onClick:()=>r(!1),children:"Cancel"}),(0,t.jsx)(c.Button,{type:"submit",disabled:!d.trim(),children:i})]})]})})})}var ev=e.i(271326),ex=e.i(860253);function ey({actions:e,className:r,style:n}){let{t:a}=(0,l.useTranslation)("web"),[s,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{if(s)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e);function e(e){"Escape"===e.key&&u(!1)}},[s]),(0,t.jsxs)(t.Fragment,{children:[s?(0,t.jsx)("div",{"data-testid":"fab-overlay",className:"fixed inset-0 z-40",onClick:()=>u(!1),"aria-hidden":"true"}):null,(0,t.jsxs)("div",{"data-testid":"floating-action-button",className:(0,d.cn)("relative z-50",r),style:n,children:[(0,t.jsx)("div",{className:(0,d.cn)("absolute start-0 bottom-[calc(100%+24px)] flex flex-col items-start gap-2",!s&&"pointer-events-none"),"data-testid":"fab-actions",children:e.map((r,n)=>{let o=(e.length-1-n)*50;return(0,t.jsxs)("button",{"data-testid":`fab-action-${r.id}`,"aria-label":r.label,disabled:r.disabled??r.loading,className:(0,d.cn)("flex h-10 items-center gap-2.5 rounded-full px-4","bg-background text-foreground shadow-md","border-border border","hover:bg-accent hover:text-accent-foreground","disabled:pointer-events-none disabled:opacity-50","text-sm font-medium whitespace-nowrap",s?"translate-y-0 opacity-100":"pointer-events-none translate-y-0 opacity-0"),style:{transition:`opacity ${s?250:120}ms ease-out ${s?o:0}ms, transform ${s?250:120}ms ease-out ${s?o:0}ms`},onClick:()=>{r.onClick(),u(!1)},children:[(0,t.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center",children:r.loading?(0,t.jsx)(W.Loader2,{className:"h-4 w-4 animate-spin"}):r.icon}),(0,t.jsx)("span",{children:r.label})]},r.id)})}),(0,t.jsxs)(c.Button,{size:"icon","data-testid":"fab-trigger","aria-label":a(s?"fab.closeActions":"fab.createNew"),className:(0,d.cn)("relative h-14 w-14 rounded-full shadow-lg","bg-indigo-500 text-white hover:bg-indigo-400 dark:bg-indigo-500 dark:hover:bg-indigo-400","transition-all duration-200 hover:scale-105 hover:shadow-xl active:scale-95"),onClick:()=>u(e=>!e),children:[(0,t.jsx)(i.Plus,{className:(0,d.cn)("absolute h-7 w-7 stroke-[2.5] transition-all",s?"scale-0 rotate-90 opacity-0":"scale-100 rotate-0 opacity-100"),style:{transitionDuration:"250ms"}}),(0,t.jsx)(ex.X,{className:(0,d.cn)("absolute h-6 w-6 stroke-[2.5] transition-all",s?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-90 opacity-0"),style:{transitionDuration:"250ms"}})]})]})]})}var eb=e.i(805147),ew=e.i(808361),ek=e.i(930153);let ej="shep-canvas-viewport",eN={x:30,y:30,zoom:.85};var eE=e.i(957638),eC=e.i(655827),eS=e.i(440106),e_=e.i(508893);let eD=(0,e_.createServerReference)("404dbbb95e73f5876a4b63bf82eadeb1928da259ca",e_.callServer,void 0,e_.findSourceMapURL,"createProjectFolder");function eM({open:e,onOpenChange:r,onCreated:n}){let[a,s]=(0,o.useState)(""),[i,l]=(0,o.useState)(!1),[d,u]=(0,o.useState)(null);(0,o.useEffect)(()=>{e&&(s(""),l(!1),u(null))},[e]);let h=async e=>{e.preventDefault();let t=a.trim();if(!t||i)return;l(!0),u(null);let o=await eD(t);if(!o.ok||!o.path){u(o.error??"Failed to create project."),l(!1);return}n(o.path),r(!1)};return(0,t.jsx)(M.Dialog,{open:e,onOpenChange:r,children:(0,t.jsx)(M.DialogContent,{className:"max-w-sm",children:(0,t.jsxs)("form",{onSubmit:h,children:[(0,t.jsxs)(M.DialogHeader,{children:[(0,t.jsx)(M.DialogTitle,{children:"New project"}),(0,t.jsx)(M.DialogDescription,{children:"Create an empty project folder inside your Shep home directory. Git will be initialised automatically when the project is added."})]}),(0,t.jsxs)("div",{className:"py-4",children:[(0,t.jsx)(eg.Input,{autoFocus:!0,value:a,onChange:e=>{s(e.target.value),d&&u(null)},placeholder:"my-prototype",disabled:i,"data-testid":"new-project-name-input"}),d?(0,t.jsx)("p",{className:"text-destructive mt-2 text-xs",role:"alert",children:d}):null]}),(0,t.jsxs)(M.DialogFooter,{children:[(0,t.jsx)(c.Button,{type:"button",variant:"ghost",onClick:()=>r(!1),disabled:i,children:"Cancel"}),(0,t.jsx)(c.Button,{type:"submit",disabled:!a.trim()||i,children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(W.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating…"]}):"Create project"})]})]})})})}var eO=e.i(917840);let eP={maxZoom:1,padding:.5,duration:500},eR={maxZoom:1,padding:.5,duration:500};function eI({initialNodes:e,initialEdges:n}){let d,u,h,p,f,m,v=(0,a.useRouter)(),y=(0,a.usePathname)(),b=(d=(0,a.usePathname)().match(/^\/feature\/([^/]+)/),d?.[1]??null),w=(u=(0,a.usePathname)(),h=(0,a.useSearchParams)(),p=u.match(/^\/repository\/([^/]+)/),{id:p?.[1]??null,path:u.startsWith("/create")?h.get("repo"):null}),j=(0,ew.useSoundAction)("click"),{guardedNavigate:N}=(0,ek.useDrawerCloseGuard)(),{fitView:E}=(0,r.useReactFlow)(),C=(0,o.useRef)(null),{defaultViewport:S,onMoveEnd:_,resetViewport:D}=(f=(0,o.useRef)(function(){try{let e=localStorage.getItem(ej);if(null==e)return eN;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:eN}catch{return eN}}()).current,m=(0,o.useRef)(null),(0,o.useEffect)(()=>()=>{null!=m.current&&clearTimeout(m.current)},[]),{defaultViewport:f,onMoveEnd:(0,o.useCallback)(e=>{null!=m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{try{localStorage.setItem(ej,JSON.stringify(e))}catch{}},500)},[]),resetViewport:(0,o.useCallback)(()=>{try{localStorage.removeItem(ej)}catch{}return eN},[])}),{nodes:M,edges:O,onNodesChange:P,handleConnect:R,handleAddRepository:I,handleArchiveFeature:L,handleDeleteFeature:T,handleRetryFeature:A,handleStartFeature:$,handleStopFeature:B,handleUnarchiveFeature:z,handleDeleteRepository:W,handleDeleteApplication:q,createFeatureNode:U,showArchived:H,setShowArchived:V,setCallbacks:X}=(0,eO.useControlCenterState)(e,n),{workspaces:Y,activeWorkspace:K,isDefaultActive:Z,setActiveWorkspace:Q,createWorkspace:ee,renameWorkspace:et,deleteWorkspace:en,setWorkspaceMembers:ea,addToActiveWorkspace:es}=function(){let[e,t]=(0,o.useState)(eu);(0,o.useEffect)(()=>{t(function(){try{let e=window.localStorage.getItem(ed);if(!e)return eu;let t=JSON.parse(e);if(!t.workspaces||!Array.isArray(t.workspaces))return eu;return{workspaces:t.workspaces.some(e=>e.id===ec)?t.workspaces:[eu.workspaces[0],...t.workspaces],activeWorkspaceId:t.activeWorkspaceId??ec}}catch{return eu}}())},[]),(0,o.useEffect)(()=>{try{window.localStorage.setItem(ed,JSON.stringify(e))}catch{}},[e]);let r=(0,o.useCallback)(e=>{t(t=>t.workspaces.some(t=>t.id===e)?{...t,activeWorkspaceId:e}:t)},[]),n=(0,o.useCallback)(e=>{let r=e.trim()||"Untitled workspace",n={id:`ws-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,name:r,repoIds:[],featureIds:[]};return t(e=>({workspaces:[...e.workspaces,n],activeWorkspaceId:n.id})),n},[]),a=(0,o.useCallback)((e,r)=>{if(e===ec)return;let n=r.trim();n&&t(t=>({...t,workspaces:t.workspaces.map(t=>t.id===e?{...t,name:n}:t)}))},[]),s=(0,o.useCallback)(e=>{e!==ec&&t(t=>({workspaces:t.workspaces.filter(t=>t.id!==e),activeWorkspaceId:t.activeWorkspaceId===e?ec:t.activeWorkspaceId}))},[]),i=(0,o.useCallback)((e,r)=>{e!==ec&&t(t=>({...t,workspaces:t.workspaces.map(t=>t.id===e?{...t,repoIds:[...r.repoIds],featureIds:[...r.featureIds]}:t)}))},[]),l=(0,o.useCallback)((e,r)=>{t(t=>t.activeWorkspaceId===ec?t:{...t,workspaces:t.workspaces.map(n=>{if(n.id!==t.activeWorkspaceId)return n;let o="repo"===e?n.repoIds:n.featureIds,a=o.includes(r)?o.filter(e=>e!==r):[...o,r];return"repo"===e?{...n,repoIds:a}:{...n,featureIds:a}})})},[]),d=(0,o.useCallback)(e=>l("repo",e),[l]),c=(0,o.useCallback)(e=>l("feature",e),[l]),u=(0,o.useCallback)(e=>{let r=e.repoIds??[],n=e.featureIds??[];(0!==r.length||0!==n.length)&&t(e=>e.activeWorkspaceId===ec?e:{...e,workspaces:e.workspaces.map(t=>{if(t.id!==e.activeWorkspaceId)return t;let o=new Set(t.repoIds);for(let e of r)o.add(e);let a=new Set(t.featureIds);for(let e of n)a.add(e);return o.size===t.repoIds.length&&a.size===t.featureIds.length?t:{...t,repoIds:Array.from(o),featureIds:Array.from(a)}})})},[]),h=e.workspaces.find(t=>t.id===e.activeWorkspaceId)??e.workspaces[0];return{workspaces:e.workspaces,activeWorkspace:h,activeWorkspaceId:e.activeWorkspaceId,isDefaultActive:e.activeWorkspaceId===ec,setActiveWorkspace:r,createWorkspace:n,renameWorkspace:a,deleteWorkspace:s,setWorkspaceMembers:i,toggleRepoInActive:d,toggleFeatureInActive:c,addToActiveWorkspace:u}}(),ei=(0,o.useRef)(new Set),[el,eg]=(0,o.useState)(!1),[ex,ey]=(0,o.useState)(!1),[eE,eC]=(0,o.useState)(!1),[e_,eD]=(0,o.useState)(!1),[eI,eL]=(0,o.useState)(null),[eT,eA]=(0,o.useState)(!1),{setFeatures:e$,setHasRepositories:eB}=(0,eb.useSidebarFeaturesContext)(),ez=(0,o.useMemo)(()=>M.filter(e=>"featureNode"===e.type),[M]),eG=(0,o.useMemo)(()=>ez.map(e=>{let t=e.data;return`${t.featureId}:${t.state}:${t.name}:${t.repositoryPath}`}).sort().join(","),[ez]);(0,o.useEffect)(()=>{e$(ez.map(e=>{let t=e.data,r=(0,eb.mapNodeStateToSidebarStatus)(t.state);if(!r)return null;let n=t.repositoryPath??"";return{featureId:t.featureId,name:t.name,status:r,repositoryPath:n,repositoryName:t.repositoryName??n.split("/").filter(Boolean).pop()??n,...null!=t.startedAt&&{startedAt:t.startedAt},...null!=t.runtime&&{duration:t.runtime},...t.agentType&&{agentType:t.agentType},...t.modelId&&{modelId:t.modelId}}}).filter(Boolean))},[eG,ez,e$]);let eW=(0,o.useCallback)(e=>{N(()=>v.push(`/application/${e}`))},[v,N]),eq=(0,o.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"]')&&N(()=>{j.play(),v.push(`/feature/${r.featureId}`)})}},[v,j,N]),eU=(0,o.useCallback)(()=>{j.play(),v.push("/create")},[v,j]),eH=(0,o.useCallback)(e=>{j.play();let t=M.find(t=>t.id===e),r=t?.data?.repositoryPath;r?v.push(`/create?repo=${encodeURIComponent(r)}`):v.push("/create")},[M,v,j]),eV=(0,o.useCallback)(e=>{let t=e.startsWith("feat-")?e.slice(5):e,r=O.find(t=>t.target===e),n=r?M.find(e=>e.id===r.source):null,o=n?.data?.repositoryPath;j.play();let a=new URLSearchParams;o&&a.set("repo",o),a.set("parent",t),v.push(`/create?${a.toString()}`)},[M,O,v,j]),eX=(0,o.useCallback)(e=>{let t=M.find(t=>t.id===e);if(t?.type==="repositoryNode"){let e=t.data;e.id&&N(()=>v.push(`/repository/${e.id}`))}},[M,v,N]),eY=(0,o.useCallback)(()=>{"/"!==y&&N(()=>v.push("/"))},[v,y,N]),eJ=(0,o.useCallback)(e=>{setTimeout(()=>{E(eR),C.current=setTimeout(()=>{N(()=>v.push(`/create?repo=${encodeURIComponent(e)}`))},600)},0)},[E,N,v]),eK=(0,o.useCallback)(e=>{setTimeout(()=>{E({nodes:[{id:e}],maxZoom:1,padding:.4,duration:600})},0)},[E]),eZ=(0,o.useCallback)(e=>{let{wasEmpty:t,repoPath:r,tempNodeId:n}=I(e);t?eJ(r):eK(n)},[I,eJ,eK]);!function(e){let{addRepoAndFocus:t,createFeatureNode:r,nodes:n,handleDeleteFeature:a,handleArchiveFeature:s,handleUnarchiveFeature:i}=e;(0,o.useEffect)(()=>{let e=e=>{t(e.detail.path)};return window.addEventListener("shep:add-repository",e),()=>window.removeEventListener("shep:add-repository",e)},[t]),(0,o.useEffect)(()=>{let e=e=>{let t=e.detail;if(t.parentId)return void r(`feat-${t.parentId}`,{state:"creating",featureId:t.featureId,name:t.name,description:t.description,repositoryPath:t.repositoryPath},"dependencyEdge");let o=n.find(e=>"repositoryNode"===e.type&&e.data.repositoryPath===t.repositoryPath);r(o?.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)},[n,r]),(0,o.useEffect)(()=>{let e=e=>{let{featureId:t,cleanup:r,cascadeDelete:n,closePr:o}=e.detail;a(t,r,n,o)};return window.addEventListener("shep:feature-delete-requested",e),()=>window.removeEventListener("shep:feature-delete-requested",e)},[a]),(0,o.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;s(t)};return window.addEventListener("shep:feature-archive-requested",e),()=>window.removeEventListener("shep:feature-archive-requested",e)},[s]),(0,o.useEffect)(()=>{let e=e=>{let{featureId:t}=e.detail;i(t)};return window.addEventListener("shep:feature-unarchive-requested",e),()=>window.removeEventListener("shep:feature-unarchive-requested",e)},[i])}({addRepoAndFocus:eZ,createFeatureNode:U,nodes:M,handleDeleteFeature:T,handleArchiveFeature:L,handleUnarchiveFeature:z}),(0,o.useEffect)(()=>()=>{null!=C.current&&clearTimeout(C.current)},[]),(0,o.useEffect)(()=>{X({onNodeAction:eV,onFeatureDelete:T,onRetryFeature:A,onStartFeature:$,onStopFeature:B,onArchiveFeature:L,onUnarchiveFeature:z,onRepositoryAdd:eH,onRepositoryClick:eX,onRepositoryDelete:W,onApplicationClick:eW,onApplicationDelete:q})},[X,eV,L,T,A,$,B,z,eH,eX,W,eW,q]);let eQ=(0,o.useCallback)((e,t)=>{_(t)},[_]),e0=M.some(e=>"repositoryNode"===e.type),e1=e0||M.some(e=>"applicationNode"===e.type);(0,o.useEffect)(()=>{eB(e0)},[e0,eB]);let[e2,e5]=(0,o.useState)(e1),e3=(0,o.useRef)(null);(0,o.useEffect)(()=>(e1?(e3.current&&(clearTimeout(e3.current),e3.current=null),e5(!0)):e2&&(D(),e3.current=setTimeout(()=>{e5(!1),e3.current=null},500)),()=>{e3.current&&clearTimeout(e3.current)}),[e1,e2,D]),(0,o.useEffect)(()=>{let e=ei.current,t=[],r=[];for(let n of M)e.has(n.id)||(e.add(n.id),"repositoryNode"===n.type?t.push(n.id):"featureNode"===n.type&&r.push(n.id));Z||(0!==t.length||0!==r.length)&&es({repoIds:t,featureIds:r})},[M,Z,es]);let e4=(0,o.useMemo)(()=>{if(Z)return M;let e=new Set(K.repoIds),t=new Set(K.featureIds);return M.filter(r=>"repositoryNode"===r.type?e.has(r.id):"featureNode"!==r.type||t.has(r.id))},[M,Z,K]),e6=(0,o.useMemo)(()=>{if(Z)return O;let e=new Set(e4.map(e=>e.id));return O.filter(t=>e.has(t.source)&&e.has(t.target))},[O,Z,e4]),e8=y.startsWith("/create"),e7=(0,o.useMemo)(()=>{let e=e4.filter(e=>"repositoryNode"===e.type),t=e4.some(e=>"featureNode"===e.type);return 1!==e.length||t||e8?e4:e4.map(e=>"repositoryNode"===e.type?{...e,data:{...e.data,pulseAdd:!0}}:e)},[e4,e8]),e9=(0,o.useCallback)(()=>{window.dispatchEvent(new CustomEvent("shep:pick-folder"))},[]);!function(e){let{activeWorkspace:t,isDefaultActive:r,workspaceFilteredNodes:n,fitView:a}=e,s=(0,o.useMemo)(()=>{if(r)return"default";let e=n.map(e=>e.id).sort().join(",");return`${t.id}:${e}`},[r,t.id,n]),i=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=i.current;if(i.current=s,null===e||e===s||r||0===n.length)return;let t=setTimeout(()=>{a(eP)},0);return()=>clearTimeout(t)},[s,r,n.length,a])}({activeWorkspace:K,isDefaultActive:Z,workspaceFilteredNodes:e4,fitView:E});let te=e1&&!Z&&0===e4.length,tt=te?(0,t.jsxs)("div",{className:"pointer-events-auto flex h-full w-full flex-col items-center justify-center px-8",children:[(0,t.jsx)("div",{className:"bg-primary/10 text-primary mb-5 flex h-12 w-12 items-center justify-center rounded-2xl",children:(0,t.jsx)(eo.Layers,{className:"h-6 w-6"})}),(0,t.jsx)("h2",{className:"text-foreground/90 text-center text-2xl font-light tracking-tight",children:"This workspace is empty"}),(0,t.jsx)("p",{className:"text-muted-foreground mt-2 max-w-sm text-center text-sm leading-relaxed",children:"Add repositories or features from the canvas, or switch back to the default workspace to see everything."}),(0,t.jsxs)("div",{className:"mt-6 flex items-center gap-2",children:[(0,t.jsxs)(c.Button,{size:"sm",onClick:()=>eA(!0),className:"bg-blue-500 text-white hover:bg-blue-600",children:[(0,t.jsx)(s.FolderPlus,{className:"me-1.5 h-3.5 w-3.5"}),"New project"]}),(0,t.jsxs)(c.Button,{variant:"outline",size:"sm",onClick:()=>eg(!0),children:[(0,t.jsx)(i.Plus,{className:"me-1.5 h-3.5 w-3.5"}),"Manage items"]}),(0,t.jsx)(c.Button,{variant:"ghost",size:"sm",onClick:()=>Q(ec),children:"Switch to Default"})]})]}):(0,t.jsx)(eS.ControlCenterEmptyState,{onRepositorySelect:eZ,onApplicationCreated:e=>{v.push(`/application/${e}`)}}),[tr,tn]=(0,o.useState)(!1),to=function({router:e,clickSound:r,guardedNavigate:n,handlePickFolder:a,onNewProject:i,onNewApplication:d,featureFlags:c}){let{t:u}=(0,l.useTranslation)("web");return(0,o.useMemo)(()=>{let o=[{id:"new-project",label:"New project",icon:(0,t.jsx)(s.FolderPlus,{className:"h-4 w-4"}),onClick:()=>{r.play(),i()}},{id:"new-feature",label:u("fab.newFeature"),icon:(0,t.jsx)(ep.Sparkles,{className:"h-4 w-4"}),onClick:()=>{r.play(),n(()=>e.push("/create"))}},{id:"add-local-repo",label:u("fab.localFolder"),icon:(0,t.jsx)(x.FolderOpen,{className:"h-4 w-4"}),onClick:a},{id:"new-application",label:u("fab.newApplication"),icon:(0,t.jsx)(G.LayoutGrid,{className:"h-4 w-4"}),onClick:d}];return c.adoptBranch&&o.push({id:"adopt-branch",label:u("fab.adoptBranch"),icon:(0,t.jsx)(k.GitBranch,{className:"h-4 w-4"}),onClick:()=>{n(()=>e.push("/adopt"))}}),c.githubImport&&o.push({id:"add-github-repo",label:u("fab.fromGithub"),icon:(0,t.jsx)(g,{className:"h-4 w-4"}),onClick:()=>{window.dispatchEvent(new CustomEvent("shep:open-github-import"))}}),o},[u,r,n,e,a,i,d,c.adoptBranch,c.githubImport])}({router:v,clickSound:j,guardedNavigate:N,handlePickFolder:e9,onNewProject:()=>eA(!0),onNewApplication:()=>tn(!0),featureFlags:(0,F.useFeatureFlags)()}),ta=(0,t.jsx)(er,{showArchived:H,onToggleArchived:()=>V(!H),onResetViewport:D,startSlot:(0,t.jsx)(eh,{workspaces:Y,activeWorkspace:K,onSelect:Q,onRequestCreate:()=>ey(!0),onRequestRename:()=>eC(!0),onRequestDelete:e=>{eL(e),eD(!0)},onManage:()=>eg(!0)})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(J,{nodes:e2?e7:[],edges:e2?e6:[],selectedFeatureId:b,selectedRepository:w,defaultViewport:S,onNodesChange:P,onConnect:R,onAddFeature:eU,onNodeClick:eq,onPaneClick:eY,onMoveEnd:eQ,toolbar:ta,showToolbarOnEmpty:te,emptyState:tt}),e2?(0,t.jsx)(eF,{actions:to}):null,(0,t.jsx)(eM,{open:eT,onOpenChange:eA,onCreated:e=>eZ(e)}),(0,t.jsx)(ef,{open:el,onOpenChange:eg,workspace:K,allNodes:M,onSave:e=>ea(K.id,e)}),(0,t.jsx)(em,{open:ex,onOpenChange:ey,title:"New workspace",description:"Create a workspace to filter the canvas to a specific set of repositories and features.",confirmLabel:"Create",onConfirm:e=>{ee(e),eg(!0)}}),(0,t.jsx)(em,{open:eE,onOpenChange:eC,title:"Rename workspace",initialValue:K.name,confirmLabel:"Rename",onConfirm:e=>et(K.id,e)}),(0,t.jsx)(ev.AlertDialog,{open:e_,onOpenChange:e=>{eD(e),e||eL(null)},children:(0,t.jsxs)(ev.AlertDialogContent,{children:[(0,t.jsxs)(ev.AlertDialogHeader,{children:[(0,t.jsx)(ev.AlertDialogTitle,{children:"Delete workspace?"}),(0,t.jsxs)(ev.AlertDialogDescription,{children:["This will permanently remove the workspace “",Y.find(e=>e.id===eI)?.name??K.name,"”. The repositories and features themselves are not affected."]})]}),(0,t.jsxs)(ev.AlertDialogFooter,{children:[(0,t.jsx)(ev.AlertDialogCancel,{children:"Cancel"}),(0,t.jsx)(ev.AlertDialogAction,{variant:"destructive",onClick:()=>{eI&&(en(eI),eL(null))},children:"Delete"})]})]})}),tr?(0,t.jsx)("div",{className:"absolute inset-0 z-50",children:(0,t.jsx)(eS.ControlCenterEmptyState,{onRepositorySelect:e=>{tn(!1),eZ(e)},onApplicationCreated:e=>{v.push(`/application/${e}`)},onClose:()=>tn(!1),className:"bg-background"})}):null]})}function eF({actions:e}){let{state:r}=(0,eE.useSidebar)(),{i18n:n}=(0,l.useTranslation)("web"),{swapPosition:o}=(0,eC.useFabLayout)(),a="rtl"===n.dir();if(o)return(0,t.jsx)(ey,{actions:e,className:"!fixed bottom-6",style:a?{left:"calc(var(--sidebar-width-icon) + 32px)",transition:"left 200ms ease-in-out"}:{right:"32px",transition:"right 200ms ease-in-out"}});let s="expanded"===r?"calc(var(--sidebar-width) + 32px)":"calc(var(--sidebar-width-icon) + 32px)";return(0,t.jsx)(ey,{actions:e,className:"!fixed bottom-6",style:a?{right:s,transition:"right 200ms ease-in-out"}:{left:s,transition:"left 200ms ease-in-out"}})}function eL({initialNodes:e,initialEdges:o,drawer:a}){return(0,t.jsxs)("div",{"data-testid":"control-center",className:"h-full w-full",children:[(0,t.jsx)(n.SessionsProvider,{children:(0,t.jsx)(r.ReactFlowProvider,{children:(0,t.jsx)(eI,{initialNodes:e,initialEdges:o})})}),(0,t.jsx)("div",{children:a},"drawer")]})}e.s(["ControlCenter",()=>eL],948246)},22173,e=>{"use strict";var t=e.i(873504),r=e.i(481605);e.s(["DeploymentStatusProvider",()=>t.DeploymentStatusProvider,"EMPTY_ENTRY",()=>r.EMPTY_ENTRY,"useDeploymentStatusContext",()=>t.useDeploymentStatusContext,"useDeploymentStatusContextOptional",()=>t.useDeploymentStatusContextOptional])}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|