decocms 4.510.1 → 4.511.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/ActiveShapeUtils-mwv_2FNw.js +1 -0
- package/dist/client/assets/{AlertCircle-C_5mpJjv.js → AlertCircle-DtuasuLO.js} +1 -1
- package/dist/client/assets/AreaChart-DKO8O8iD.js +1 -0
- package/dist/client/assets/{ArrowLeft-DHCYX1pw.js → ArrowLeft-BFqCKFOZ.js} +1 -1
- package/dist/client/assets/{ArrowUp-DKJQ_RL3.js → ArrowUp-SYUTzwu8.js} +1 -1
- package/dist/client/assets/BarChart-aoGTWY1e.js +1 -0
- package/dist/client/assets/{Building02-IqnVnQlH.js → Building02-B0INzhOK.js} +1 -1
- package/dist/client/assets/CartesianChart-yJJthRct.js +1 -0
- package/dist/client/assets/{CategoricalChart-C66LowCp.js → CategoricalChart-aEjXOekE.js} +2 -2
- package/dist/client/assets/{CheckCircle-BXGWQUO5.js → CheckCircle-D0ZtvGmn.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-BgwBwcIG.js → ChevronSelectorVertical-DG_Q06kO.js} +1 -1
- package/dist/client/assets/{ChevronUp-eUjdLjUY.js → ChevronUp-D36ghv2t.js} +1 -1
- package/dist/client/assets/{Copy01-PY0JiShS.js → Copy01-1-iqu-6x.js} +1 -1
- package/dist/client/assets/{CreditCard01-DlWrANt0.js → CreditCard01-EDo1X5AA.js} +1 -1
- package/dist/client/assets/{DotsVertical-DMmDiPEd.js → DotsVertical-DM6Nc0dV.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-B-z9mpHZ.js → ErrorBarContext-zFVi_tqb.js} +1 -1
- package/dist/client/assets/{Globe04-lPlXx7ae.js → Globe04-tj-aFoQD.js} +1 -1
- package/dist/client/assets/{Image01-CtwwwWt4.js → Image01-BzaAsspf.js} +1 -1
- package/dist/client/assets/{Key01-BCEBdiYn.js → Key01-ClworSEq.js} +1 -1
- package/dist/client/assets/{Link01-D2rKPRqH.js → Link01-C_3I56NR.js} +1 -1
- package/dist/client/assets/{LinkBroken01-DmYIuqU_.js → LinkBroken01-C4TgOrEQ.js} +1 -1
- package/dist/client/assets/{Monitor01-hYg_Be5C.js → Monitor01-D2jcfkyJ.js} +1 -1
- package/dist/client/assets/{Play-9-eWzuhH.js → Play-DNXVmQiT.js} +1 -1
- package/dist/client/assets/{Plus-G2W3_cG_.js → Plus-uAWge3eB.js} +1 -1
- package/dist/client/assets/ReferenceLine-D5eT8BVA.js +1 -0
- package/dist/client/assets/{SearchMd-B4Oqfysk.js → SearchMd-CSh6S25i.js} +1 -1
- package/dist/client/assets/Sector-DgpevW5C.js +28 -0
- package/dist/client/assets/{ShoppingBag01-DLea9vlO.js → ShoppingBag01-Dl4PlAcT.js} +1 -1
- package/dist/client/assets/{Sun-DdjCciIh.js → Sun-CjCYzESp.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-DpCg42GD.js → SwitchHorizontal01-CvgScnq-.js} +1 -1
- package/dist/client/assets/{Tool01-Dqha0FcH.js → Tool01-DOvXbUMN.js} +1 -1
- package/dist/client/assets/{Trash01-BGnkoc5x.js → Trash01-B9Qm5BDb.js} +1 -1
- package/dist/client/assets/{Upload01-Ccm0_Yr0.js → Upload01-BUAYoGEA.js} +1 -1
- package/dist/client/assets/{User01-B08N507j.js → User01-Bz9s3Cms.js} +1 -1
- package/dist/client/assets/{UserSquare-CGjgJJpx.js → UserSquare-snlYTCQF.js} +1 -1
- package/dist/client/assets/{Users01-UYY73YZx.js → Users01-CB1Iep5-.js} +1 -1
- package/dist/client/assets/{XClose-BuC3W9yJ.js → XClose-CJyTVouT.js} +1 -1
- package/dist/client/assets/{ZoomOut-CGlQyhZZ.js → ZoomOut-DtGWKkcz.js} +1 -1
- package/dist/client/assets/{access-gate-DI1CHEOd.js → access-gate-CzqP49uU.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-DZOB9TFC.js → add-connection-dialog-m-NKaBEt.js} +1 -1
- package/dist/client/assets/agent-analytics-BZpFr_yN.js +2 -0
- package/dist/client/assets/agent-app-DFil4Bv_.js +1 -0
- package/dist/client/assets/agent-assets-BOHo4n1Q.js +1 -0
- package/dist/client/assets/agent-automation-CMrgL2sm.js +20 -0
- package/dist/client/assets/agent-automations-Nn4cw633.js +1 -0
- package/dist/client/assets/agent-connect-sources-DQy0LrZ3.js +1 -0
- package/dist/client/assets/agent-deck-Bxo_Q-ei.js +1 -0
- package/dist/client/assets/agent-e2e-BCqDkAAh.js +1 -0
- package/dist/client/assets/agent-experiments-CauXSjj6.js +1 -0
- package/dist/client/assets/agent-file-D8aDDj-3.js +1 -0
- package/dist/client/assets/agent-hosting-Becjke89.js +1 -0
- package/dist/client/assets/agent-icon-D3PXiOcC.js +1 -0
- package/dist/client/assets/agent-library-DPqg6u_A.js +1 -0
- package/dist/client/assets/agent-library-file-DbWlEgCo.js +1 -0
- package/dist/client/assets/agent-monitor-BiV7Y5fT.js +1 -0
- package/dist/client/assets/agent-overview-w8tJTrW2.js +1 -0
- package/dist/client/assets/agent-releases-DibyxNP8.js +2 -0
- package/dist/client/assets/agent-settings-DZXnoVvz.js +1 -0
- package/dist/client/assets/{agent-site-editor-UEj9ymdW.js → agent-site-editor-Ch8hsGkV.js} +2 -2
- package/dist/client/assets/agent-site-editor-code-w-62beeu.js +2 -0
- package/dist/client/assets/agent-site-editor-content-FmZpFCN6.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-DT1UPREe.js +1 -0
- package/dist/client/assets/agent-view-DT0g-b8T.js +1 -0
- package/dist/client/assets/{agent-view-guard-CIaDjkgO.js → agent-view-guard-DJzZhTXo.js} +1 -1
- package/dist/client/assets/{agents-list-Ipm949Gu.js → agents-list-CsxnQobw.js} +1 -1
- package/dist/client/assets/{ai-providers-CM6DAS1m.js → ai-providers-y5f2wWwF.js} +2 -2
- package/dist/client/assets/{alert-DlzPIsBG.js → alert-C3kKk-dL.js} +1 -1
- package/dist/client/assets/{alert-dialog-C78VlsS8.js → alert-dialog-CLddpsE0.js} +1 -1
- package/dist/client/assets/analytics-sections-D2oWLI_C.js +1 -0
- package/dist/client/assets/api-keys-BlYX4Voq.js +1 -0
- package/dist/client/assets/{api-keys-2xYpKoN4.js → api-keys-EnXXS_ac.js} +1 -1
- package/dist/client/assets/app-editor-CF9GVqxJ.js +1 -0
- package/dist/client/assets/{asset-utils-BLAfQTG9.js → asset-utils-Aj0AmEaW.js} +1 -1
- package/dist/client/assets/{auth-BflPQKZn.js → auth-JljWUhf4.js} +1 -1
- package/dist/client/assets/{auth-catchall-c1A8qI2L.js → auth-catchall-v-jB5eNi.js} +1 -1
- package/dist/client/assets/{auth-entry-BXhSNyRn.js → auth-entry-UyyVEUrs.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CNxJzuB1.js → auth-split-layout-CMnjpufv.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BzTDtnbZ.js → authenticate-and-persist-oauth-CFjCVa7x.js} +1 -1
- package/dist/client/assets/automation-list-row-C0OwIBYw.js +1 -0
- package/dist/client/assets/{automation-runs-DDwtI2d9.js → automation-runs-CkjINuyS.js} +1 -1
- package/dist/client/assets/{automations-BEqZF6wm.js → automations-B-DwQyrj.js} +1 -1
- package/dist/client/assets/{autosend-CRyjUv4T.js → autosend-P1G4Me3g.js} +1 -1
- package/dist/client/assets/{avatar-CyNf-6_F.js → avatar-C9lu-Y_y.js} +1 -1
- package/dist/client/assets/{badge-BcuZvLCv.js → badge-B6ke8DzO.js} +1 -1
- package/dist/client/assets/{block-document-hVh0X0QB.js → block-document-DfmmmU6v.js} +3 -3
- package/dist/client/assets/{blocks-preview-workspace-context-o15kYDJQ.js → blocks-preview-workspace-context-CjhNfj7F.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-BKwCm9lP.js → blocks-tab-states-BvyAXDNR.js} +3 -3
- package/dist/client/assets/{blog-schema-qHemK5B8.js → blog-schema-DpPR8Wd7.js} +1 -1
- package/dist/client/assets/{board-analytics-78XasW_6.js → board-analytics-DjqX1ptj.js} +1 -1
- package/dist/client/assets/{buckets-BsJikmLt.js → buckets-CN4IL1fI.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-Buqt8O8s.js → build-improve-prompt-doc-X_0TQrgR.js} +1 -1
- package/dist/client/assets/{calendar-CtrIZhAO.js → calendar-jnImf3-F.js} +1 -1
- package/dist/client/assets/{capability-load-error-nzOkcmq4.js → capability-load-error-BLBe8Obk.js} +1 -1
- package/dist/client/assets/category-editor-C00-hmeq.js +1 -0
- package/dist/client/assets/{chart-CMTEHEw6.js → chart-CgMhzJYr.js} +2 -2
- package/dist/client/assets/chat-context-C2q8Xzrd.js +39 -0
- package/dist/client/assets/{chat-draft-Cm_sd3zU.js → chat-draft-lSZv86cr.js} +1 -1
- package/dist/client/assets/{checkbox-CxruOoUP.js → checkbox-DgTWMoNQ.js} +1 -1
- package/dist/client/assets/{choose-editor-Du7XHIuK.js → choose-editor-BSily-0d.js} +1 -1
- package/dist/client/assets/{cli-auth-success-DlriM1Po.js → cli-auth-success-DHZ_qbbK.js} +1 -1
- package/dist/client/assets/{client-icons-HhL2TKMQ.js → client-icons-B81ULCGT.js} +1 -1
- package/dist/client/assets/cms-settings-editor-D6AJ5L86.js +1 -0
- package/dist/client/assets/{collapsible-D-dODAa4.js → collapsible-Bno2lzu1.js} +1 -1
- package/dist/client/assets/collection-detail-D4nkfIMH.js +1 -0
- package/dist/client/assets/{collection-display-button-DS_TxyYM.js → collection-display-button-DVurHTHt.js} +1 -1
- package/dist/client/assets/{collection-search-BDIwJ9FM.js → collection-search-B1Rwoo5a.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-CbaN9l-0.js → collection-table-wrapper-DNpc0ooH.js} +1 -1
- package/dist/client/assets/{collection-tabs-Bl4lAJm9.js → collection-tabs-D1DeyrYv.js} +1 -1
- package/dist/client/assets/{column-rules-JwowfVQW.js → column-rules-1RsdUJU-.js} +1 -1
- package/dist/client/assets/{combobox-Dllz7re1.js → combobox-SRY8n3hS.js} +1 -1
- package/dist/client/assets/coming-soon-page-DSuyjZsy.js +1 -0
- package/dist/client/assets/{command-B-QWvhA_.js → command-DaCaELsT.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-BjaHOfLs.js → companion-mcps-section-DOC7xMTc.js} +1 -1
- package/dist/client/assets/{config-1pQ5B4Tw.js → config-CuF5dSqc.js} +1 -1
- package/dist/client/assets/{connect-LpHRv3_b.js → connect-B9u1hpyT.js} +2 -2
- package/dist/client/assets/{connect-layout-B-fPcn_x.js → connect-layout-CMM8ifYM.js} +1 -1
- package/dist/client/assets/{connection-DOHxMDNz.js → connection-BwwtdGYY.js} +1 -1
- package/dist/client/assets/{connection-card-DS0hrjdI.js → connection-card-DkgQDzvl.js} +1 -1
- package/dist/client/assets/connection-detail-D0xBtKoa.js +1 -0
- package/dist/client/assets/{connection-form-helpers-CqklAfZ9.js → connection-form-helpers-Dz8qeNpg.js} +1 -1
- package/dist/client/assets/connections-Cl_dMG-8.js +1 -0
- package/dist/client/assets/{content-tab-DcT9_Y3z.js → content-tab-BURbscl-.js} +3 -3
- package/dist/client/assets/context-DeC8Ey1v.js +1 -0
- package/dist/client/assets/{context-menu-DbGA5HxE.js → context-menu-Z8VU03pb.js} +1 -1
- package/dist/client/assets/context-shell-BAsh_PAG.js +30 -0
- package/dist/client/assets/{core.esm-BwCr9_Tw.js → core.esm-DMFKsXUx.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-DLJWbaLa.js → create-organization-dialog-B8ZgAETV.js} +1 -1
- package/dist/client/assets/daily-pulse-9-6Bzywz.js +1 -0
- package/dist/client/assets/discover-dG6m04Wy.js +1 -0
- package/dist/client/assets/{domain-settings-CM8l2WnT.js → domain-settings-BBeXoAin.js} +1 -1
- package/dist/client/assets/{drawer-Cq3BAxls.js → drawer-DfQYw24p.js} +1 -1
- package/dist/client/assets/{editor-NuI0Xn_R.js → editor-D8dmglIK.js} +1 -1
- package/dist/client/assets/{editor-classes-BgXbqk9Z.js → editor-classes-AdVYLXkc.js} +1 -1
- package/dist/client/assets/{empty-state-ISs8x_rx.js → empty-state-BbPv5uNQ.js} +1 -1
- package/dist/client/assets/{empty-state-CIJntdCH.js → empty-state-Cfb0wost.js} +1 -1
- package/dist/client/assets/{extract-connection-data-CoB451kP.js → extract-connection-data-ZLWd2Kp9.js} +1 -1
- package/dist/client/assets/{feature-gate-CtaGJnoP.js → feature-gate-DAq4MBCR.js} +1 -1
- package/dist/client/assets/{feature-paywall-CyONcQL6.js → feature-paywall-DqoNTxTC.js} +1 -1
- package/dist/client/assets/file-explorer-DVjhptju.js +2 -0
- package/dist/client/assets/{file-preview-DvnfEKCF.js → file-preview-D1XAB3QG.js} +1 -1
- package/dist/client/assets/{file-share-button-BA5tUQu2.js → file-share-button-D2yC0Y8a.js} +1 -1
- package/dist/client/assets/{file-type-icon-BL46MEKN.js → file-type-icon-T0ZLi0KO.js} +1 -1
- package/dist/client/assets/flat-project-BjRG4lVt.js +1 -0
- package/dist/client/assets/{folder-icon-4xXHa81i.js → folder-icon-Dp1y9XKP.js} +1 -1
- package/dist/client/assets/{form-Bp7LaVT9.js → form-GDF7KhWe.js} +1 -1
- package/dist/client/assets/{format-time-CAj8AQXM.js → format-time-Cq80KKvY.js} +1 -1
- package/dist/client/assets/{general-Bh6E3V3Q.js → general-CJrsNBBC.js} +1 -1
- package/dist/client/assets/home-B_9-AMte.js +1 -0
- package/dist/client/assets/{hosted-publish-feedback-N9HMDmsT.js → hosted-publish-feedback-3XN_JywG.js} +1 -1
- package/dist/client/assets/{icon-button-C9KrLn0e.js → icon-button-Cs5D8NvB.js} +1 -1
- package/dist/client/assets/{index-bEJ4L1lm.js → index-B4hqDMWY.js} +1 -1
- package/dist/client/assets/index-BBLPdjCE.js +1 -0
- package/dist/client/assets/{index-DJSBq_Lh.js → index-BORmJcP3.js} +1 -1
- package/dist/client/assets/index-BhA3t_Il.js +1 -0
- package/dist/client/assets/{index-CSYc5qME.js → index-Bv2yj57U.js} +1 -1
- package/dist/client/assets/{index-D7iroYkh.js → index-C9vVnzPQ.js} +14 -14
- package/dist/client/assets/{index-BWTgolHq.js → index-CPbmduA8.js} +35 -35
- package/dist/client/assets/{index-BlUNN3Lk.js → index-CRDwdyGl.js} +3 -3
- package/dist/client/assets/{index-DINB6wYL.js → index-CVhWiD-1.js} +2 -2
- package/dist/client/assets/index-Cda4Byiw.js +1 -0
- package/dist/client/assets/{index-YyLm63l8.js → index-CmKtrUDs.js} +1 -1
- package/dist/client/assets/{index-DB390CpI.js → index-CnTMrZ6H.js} +1 -1
- package/dist/client/assets/{index-C6JtWcSk.js → index-CzlgxELX.js} +1 -1
- package/dist/client/assets/index-DOrMqENP.js +4 -0
- package/dist/client/assets/{index-COOrzuhW.js → index-Dc33YQY0.js} +1 -1
- package/dist/client/assets/index-JiORW7MK.css +1 -0
- package/dist/client/assets/{index-BikxvQw0.js → index-rIVg2V0k.js} +1 -1
- package/dist/client/assets/{index-redirect-DM9K3xx_.js → index-redirect-DUMxPg9t.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver--9_f8LYR.js → infiniteQueryObserver-Cxi7L9ot.js} +1 -1
- package/dist/client/assets/infra-billing-BSREAJnB.js +1 -0
- package/dist/client/assets/{input-C35o3KBd.js → input-3IxnpkQB.js} +1 -1
- package/dist/client/assets/{input-Baf6YXd-.js → input-BWWBSWMZ.js} +4 -4
- package/dist/client/assets/{integration-icon-D-o_SFdv.js → integration-icon-CTeTGAEP.js} +1 -1
- package/dist/client/assets/{jira-icon-EokGbkDG.js → jira-icon-Ceirp_Vf.js} +1 -1
- package/dist/client/assets/{label-CmiFUMkC.js → label-DBthaley.js} +1 -1
- package/dist/client/assets/{layout-BufVtMTm.js → layout-DENbqSMD.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-C-X9UOFa.js → legacy-agents-deep-rfUK2WZv.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BrjKHG_5.js → legacy-main-redirect-C2qoLS_-.js} +1 -1
- package/dist/client/assets/library-Cn3L9H-I.js +1 -0
- package/dist/client/assets/library-tab-CeLDWfOP.js +168 -0
- package/dist/client/assets/{login-ClW-PnuL.js → login-C0VXN3vm.js} +1 -1
- package/dist/client/assets/{markdown-x3uYFoCl.js → markdown-DEYGc24v.js} +1 -1
- package/dist/client/assets/match-site-slug-config-D3fUJ6vX.js +1 -0
- package/dist/client/assets/{mcp-app-renderer-8tc47xXg.js → mcp-app-renderer-CdXSQ5um.js} +1 -1
- package/dist/client/assets/{mcp-oauth-Cl83I81f.js → mcp-oauth-D0HIDgk0.js} +1 -1
- package/dist/client/assets/{mcp-oauth-CZg9EKL6.js → mcp-oauth-k6NAw0Ub.js} +1 -1
- package/dist/client/assets/{members-D3ALurU_.js → members-CVqCwj5f.js} +1 -1
- package/dist/client/assets/memory-CcGeGWHF.js +7 -0
- package/dist/client/assets/{mini-report-page-DB0BuC9H.js → mini-report-page-BPAZcaBj.js} +1 -1
- package/dist/client/assets/{mock-board-fodWPi_O.js → mock-board-Dc1E9hGc.js} +1 -1
- package/dist/client/assets/{monaco-editor-BuOntMxA.js → monaco-editor-NVjLW8Z7.js} +1 -1
- package/dist/client/assets/monitoring-Dkd5TrLP.js +1 -0
- package/dist/client/assets/monitoring-stats-row-BEPDzVh5.js +1 -0
- package/dist/client/assets/{multi-select-CSzkliWp.js → multi-select-BuQ3twUw.js} +1 -1
- package/dist/client/assets/{mustache-CzzEVjeM.js → mustache-B_aj_azb.js} +1 -1
- package/dist/client/assets/{new-project-dialog-CYT_10rE.js → new-project-dialog-OaqxveJn.js} +1 -1
- package/dist/client/assets/{oauth-callback-ClKC6YJz.js → oauth-callback-D-bz41RC.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DwrvoIJV.js → oauth-callback-ai-provider-nReh-xnQ.js} +1 -1
- package/dist/client/assets/{onboarding-xsUSMMdi.js → onboarding-D-jSN464.js} +1 -1
- package/dist/client/assets/openai-conversation-Ci049tt5.js +3 -0
- package/dist/client/assets/{optimistic-project-sidebar-views-D-nD1JgV.js → optimistic-project-sidebar-views-BKAlqzxT.js} +1 -1
- package/dist/client/assets/order-monitor-day--ohQi3gE.js +1 -0
- package/dist/client/assets/{organization-choice-NxknLolX.js → organization-choice-CjUXbtGe.js} +1 -1
- package/dist/client/assets/{orgs-C-epyXcl.js → orgs-DtrnJAw1.js} +1 -1
- package/dist/client/assets/{page-seo-form-C5K0Njid.js → page-seo-form-wzQECHi2.js} +1 -1
- package/dist/client/assets/{pair-tIjrf8XF.js → pair-CVodhGQi.js} +1 -1
- package/dist/client/assets/plan-O5S-elGn.js +1 -0
- package/dist/client/assets/{plan-ladder-zOFbRxYr.js → plan-ladder-DVGnZEOW.js} +1 -1
- package/dist/client/assets/{popover-BnVaucj1.js → popover-B_8XLqyZ.js} +1 -1
- package/dist/client/assets/post-calendar-DJVNjJr8.js +1 -0
- package/dist/client/assets/{post-editor-BsLPq9ID.js → post-editor-DZDjtbXP.js} +2 -2
- package/dist/client/assets/{preview-content-B9gKwcXg.js → preview-content-BM3-ZBSU.js} +1 -1
- package/dist/client/assets/{preview-dialog-BbTrjkeP.js → preview-dialog-CC7RAo1g.js} +1 -1
- package/dist/client/assets/{preview-panel-CHxFwJYx.js → preview-panel-dhadN98Y.js} +1 -1
- package/dist/client/assets/{preview-tab-BceXq1F5.js → preview-tab-PUNcBACq.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-CMLuqSB-.js → product-picker-dialog-Cl3cTuzV.js} +1 -1
- package/dist/client/assets/{profile-CFGsczgl.js → profile-Cn1YyigQ.js} +1 -1
- package/dist/client/assets/project-app-view-CtFhMgto.js +1 -0
- package/dist/client/assets/project-apps-Dlom1kkk.js +1 -0
- package/dist/client/assets/project-feed-D4s8id8Q.js +1 -0
- package/dist/client/assets/{project-icon-BjvkvrtX.js → project-icon-Dqc3FhU8.js} +1 -1
- package/dist/client/assets/project-reports-1QQqzweH.js +1 -0
- package/dist/client/assets/project-tasks-D8BzkUei.js +1 -0
- package/dist/client/assets/{projects-1AAh_BlA.js → projects-Cjezaj0U.js} +1 -1
- package/dist/client/assets/{projects-empty-state-zI3ZCNwE.js → projects-empty-state-DHm8LCZE.js} +1 -1
- package/dist/client/assets/{prompts-_ITR86Tr.js → prompts-DmX2JzbX.js} +1 -1
- package/dist/client/assets/record-editor-6Vzt1URt.js +1 -0
- package/dist/client/assets/redirect-editor-B2epC375.js +1 -0
- package/dist/client/assets/reports-BvAHEHPI.js +1 -0
- package/dist/client/assets/{reports-D8tSZcp6.js → reports-D-L_fSli.js} +1 -1
- package/dist/client/assets/{reports-onboarding-BjY7GizY.js → reports-onboarding-DlOzTlpN.js} +1 -1
- package/dist/client/assets/reports-tab-Bow8oNoA.js +2 -0
- package/dist/client/assets/repositories-ChaO6Hfw.js +1 -0
- package/dist/client/assets/repositories-DM5z_5_6.js +1 -0
- package/dist/client/assets/{repository-binding-Cqryn7FJ.js → repository-binding-CNQhpskC.js} +1 -1
- package/dist/client/assets/{repository-import-picker-BmFpmoLq.js → repository-import-picker-AF8p3kVM.js} +1 -1
- package/dist/client/assets/{repository-picker-CPWce3gZ.js → repository-picker-QcYWbpFV.js} +1 -1
- package/dist/client/assets/{require-capability-BCZS-RSh.js → require-capability-DbJTIKMh.js} +1 -1
- package/dist/client/assets/{required-auth-layout-DsBgIeQB.js → required-auth-layout-2_g05NTA.js} +1 -1
- package/dist/client/assets/{reset-password-LBLcdJ66.js → reset-password-BCwdw6Kl.js} +1 -1
- package/dist/client/assets/{resizable-BPpFVX_b.js → resizable-D69BOGKq.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-BTTEWfwO.js → resolve-tab-icon-CUlNWKnV.js} +1 -1
- package/dist/client/assets/{review-settings-DpQNPKev.js → review-settings-BzhjGZ6W.js} +1 -1
- package/dist/client/assets/{roles-CklezK0_.js → roles-CjTJrN7e.js} +1 -1
- package/dist/client/assets/route-C15564gj.js +1 -0
- package/dist/client/assets/route-DDy05B4y.js +1 -0
- package/dist/client/assets/route-DuC_v8ID.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-DDIPcJfQ.js → sandbox-lifecycle-context-DDOjP1WQ.js} +1 -1
- package/dist/client/assets/{schema-DeSxsAzw.js → schema-AZdD9rpA.js} +1 -1
- package/dist/client/assets/{schema-B-qtNfuo.js → schema-CNm9IoGA.js} +1 -1
- package/dist/client/assets/{scroll-area-CKZ1rYUh.js → scroll-area-BlGr7b6I.js} +1 -1
- package/dist/client/assets/{search-input-yB471vEF.js → search-input-lMAz-4j_.js} +1 -1
- package/dist/client/assets/{search-toggle-vlqdKhgZ.js → search-toggle-FwRkQKFa.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-D1Y2ncaV.js → secret-ciphertext-D5wBCSyp.js} +1 -1
- package/dist/client/assets/{secret-picker-B2fQMZP8.js → secret-picker-vnDe_RQu.js} +1 -1
- package/dist/client/assets/{secrets-B5tFkuGb.js → secrets-D2sc0L0u.js} +1 -1
- package/dist/client/assets/sections-Bm_wV70i.js +1 -0
- package/dist/client/assets/{sections-editor-OWiH9FAm.js → sections-editor-CABxgqBX.js} +2 -2
- package/dist/client/assets/{select-RYdFJcIt.js → select-CCHpsfFL.js} +1 -1
- package/dist/client/assets/{select-model-0SwiHcuC.js → select-model-O8Jn-r2H.js} +1 -1
- package/dist/client/assets/seo-editor-DcXVXpxs.js +1 -0
- package/dist/client/assets/{separator-BKWFQID9.js → separator-D-R0zZI4.js} +1 -1
- package/dist/client/assets/settings-tab-CmHoz9WV.js +1 -0
- package/dist/client/assets/{sheet-BYbOsi06.js → sheet-BuALHxIa.js} +1 -1
- package/dist/client/assets/shell-layout-a9HfPI7R.js +1 -0
- package/dist/client/assets/site-editor-BWVPE8cd.js +1 -0
- package/dist/client/assets/site-editor-toast-CInlYlum.js +1 -0
- package/dist/client/assets/skills-DD29WHfa.js +1 -0
- package/dist/client/assets/{slider-uZ4mVffl.js → slider-iRtu-smf.js} +1 -1
- package/dist/client/assets/{sortable.esm-3O1jIFmq.js → sortable.esm-C1c5FYmc.js} +1 -1
- package/dist/client/assets/{sso-DrReFzDa.js → sso-CXWd_Yo7.js} +1 -1
- package/dist/client/assets/{suggestion-I5ZwNhl_.js → suggestion-CC49ULUS.js} +1 -1
- package/dist/client/assets/{switch-fgRUjREt.js → switch-rDNRmZ0M.js} +1 -1
- package/dist/client/assets/{symbol-B2pDe2FQ.js → symbol-DGtdH9mf.js} +1 -1
- package/dist/client/assets/{synced-repos-D8bNraSV.js → synced-repos-DkHqVKs0.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-cpTUkhxS.js → tab-icon-glyph-Crx5IHnE.js} +1 -1
- package/dist/client/assets/{table-B9OEL7If.js → table-BkrN1ZSe.js} +1 -1
- package/dist/client/assets/{tabs-D9L3rug4.js → tabs-CAwhKbjd.js} +1 -1
- package/dist/client/assets/{task-board-Bjq5_jz3.js → task-board-DJFi0JXc.js} +1 -1
- package/dist/client/assets/{task-route-DZRvl21p.js → task-route-BfUEwhus.js} +1 -1
- package/dist/client/assets/{task-status-qNVoG3-9.js → task-status-ClS_ybJh.js} +1 -1
- package/dist/client/assets/taskboard-analytics-DZRpcr3V.js +1 -0
- package/dist/client/assets/tasks-APnV722h.js +1 -0
- package/dist/client/assets/{tasks-D4Py0tW9.js → tasks-CIRs6_Pe.js} +3 -3
- package/dist/client/assets/{textarea-Kr4aIi3A.js → textarea-BfUMZtIE.js} +1 -1
- package/dist/client/assets/thread-analytics-DV8tA3hf.js +1 -0
- package/dist/client/assets/{thread-intent-qJ1dqLJM.js → thread-intent-BOIQ3B53.js} +2 -2
- package/dist/client/assets/thread-route-DrcWuOm9.js +1 -0
- package/dist/client/assets/{thread-route-DC0mp3BO.js → thread-route-K6yJcJk5.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-5bC5OZfg.js → thread-sheet-body-Cp7nZJGR.js} +1 -1
- package/dist/client/assets/time-range-picker-CoA0ndtk.js +1 -0
- package/dist/client/assets/{toggle-group-DnaF1PQV.js → toggle-group-DLT9jdhU.js} +1 -1
- package/dist/client/assets/{tool-namespace-DegzbfIi.js → tool-namespace-Myhapgv_.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CjG7UFqX.js → toolbar-icon-button-Dmy4JfBj.js} +1 -1
- package/dist/client/assets/{tooltip-B0tBatFZ.js → tooltip-K3ljr4Cw.js} +1 -1
- package/dist/client/assets/{tooltipContext-B5ONSa-l.js → tooltipContext-CKpftZJ5.js} +1 -1
- package/dist/client/assets/{track-LRGDEOn5.js → track-BWBpVOcQ.js} +1 -1
- package/dist/client/assets/{types-A-yzlqDN.js → types-CpRdG9MN.js} +1 -1
- package/dist/client/assets/{url-slug-B7sbsR9H.js → url-slug-BogkV_jr.js} +1 -1
- package/dist/client/assets/{usage-stats-8eWtc14k.js → usage-stats-BgwDcuEm.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BMOLf5Wc.js → use-ai-providers-Dcpvu19a.js} +1 -1
- package/dist/client/assets/{use-automations-5u7y3Hek.js → use-automations-CW0iNjGh.js} +1 -1
- package/dist/client/assets/{use-autosave-CvTS6VPC.js → use-autosave-CtFSvvsc.js} +1 -1
- package/dist/client/assets/use-chat-layout-state-CUQiISez.js +1 -0
- package/dist/client/assets/{use-clock-tick-BbJsFu3S.js → use-clock-tick-D6Bkvbtv.js} +1 -1
- package/dist/client/assets/{use-connect-companion-Caioph4A.js → use-connect-companion-jozTDYFH.js} +1 -1
- package/dist/client/assets/{use-connection-bHRGa4D5.js → use-connection-Drdp4Oae.js} +1 -1
- package/dist/client/assets/{use-content-sync-BshptKwx.js → use-content-sync-Cf-G-HLy.js} +1 -1
- package/dist/client/assets/{use-copy-C9iHKqw8.js → use-copy-OcGQNTqc.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-D-Emba8T.js → use-create-virtual-mcp-DGKOxUnh.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Ca8zBjMd.js → use-date-fns-locale-Jp8EFehb.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-DYdm3TR4.js → use-debounced-autosave-YIvfP9wT.js} +1 -1
- package/dist/client/assets/{use-debounced-value-jBgiXQfM.js → use-debounced-value-Gwk4Ne2C.js} +1 -1
- package/dist/client/assets/use-deco-credits-Dikx1lUd.js +1 -0
- package/dist/client/assets/{use-decopilot-events-ysmV_SCO.js → use-decopilot-events-HXgpTe5E.js} +1 -1
- package/dist/client/assets/{use-delete-connection-DNqpXDgu.js → use-delete-connection-1akTigeP.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-Bd0XTutb.js → use-deployment-admin-Cdrp-Eoq.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-D2yC-JzE.js → use-ensure-project-folder-CjepmXm1.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CkUGrT_h.js → use-fast-preview-draft-url-zUUbbH36.js} +1 -1
- package/dist/client/assets/{use-file-configs-BCJkIjUG.js → use-file-configs-DAsYJwg1.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Dpw4RwvE.js → use-infinite-scroll-Cdv4OhOH.js} +1 -1
- package/dist/client/assets/{use-join-requests-DBLRrDyF.js → use-join-requests-ggWhDjmd.js} +1 -1
- package/dist/client/assets/use-main-panel-tabs-CuF1fqci.js +1 -0
- package/dist/client/assets/use-main-schema-v8-DIVJCCM7.js +1 -0
- package/dist/client/assets/{use-mcp-auth-status-DKUh8Z7y.js → use-mcp-auth-status-AM23Rfrd.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BTt1-Bfm.js → use-mcp-client-rcSUj48s.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D9cdv5uS.js → use-mcp-prompts-DVth4qgJ.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BJPex7_L.js → use-mcp-tools-C_oaQYVh.js} +1 -1
- package/dist/client/assets/{use-members-DBl1yLtB.js → use-members-D-3ReVz2.js} +1 -1
- package/dist/client/assets/{use-mobile-DI4rDMbJ.js → use-mobile-BsFKc79k.js} +1 -1
- package/dist/client/assets/use-navigate-to-agent-DM90tSAB.js +1 -0
- package/dist/client/assets/{use-open-billing-url-Cz3PKkrp.js → use-open-billing-url-DqAcEClU.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-CuzUG7PP.js → use-org-auth-client-D8DO5P0C.js} +1 -1
- package/dist/client/assets/{use-org-fs-CJ1tjqaY.js → use-org-fs-Dgh9z93n.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DGL3dBDQ.js → use-org-repo-syncs-B6HLHnEN.js} +1 -1
- package/dist/client/assets/{use-org-sso-MEPKdW59.js → use-org-sso-B3aedyMX.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DdhRLZ4J.js → use-organization-roles-CHvoZLEJ.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BHJG9JUa.js → use-organization-settings-Di06ldcM.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-D4pXDoq7.js → use-panel-navigate-BXUuA5Ec.js} +1 -1
- package/dist/client/assets/use-project-native-view-presence-CoRioR3P.js +1 -0
- package/dist/client/assets/{use-project-scope-BXg9r_gM.js → use-project-scope-CIQ_5yia.js} +1 -1
- package/dist/client/assets/use-recent-apps-B4IbQq7b.js +1 -0
- package/dist/client/assets/{use-releases-COVKfxrt.js → use-releases-BJH2Fcze.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-CUzSO-Ov.js → use-reports-diagnostic-czXQfQFD.js} +1 -1
- package/dist/client/assets/use-secrets-34xBxBrv.js +1 -0
- package/dist/client/assets/{use-section-preview-base-DtWueBQ4.js → use-section-preview-base-V3QjGUxY.js} +1 -1
- package/dist/client/assets/use-sidebar-collapsed-C-9VPIvl.js +1 -0
- package/dist/client/assets/{use-tags-CLep2MYM.js → use-tags-D8zxsmHq.js} +1 -1
- package/dist/client/assets/use-task-board-analytics-h4vz0RZN.js +1 -0
- package/dist/client/assets/{use-task-board-events-NONcWdI0.js → use-task-board-events-CJaU8iB9.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-BWE9V8VG.js → use-task-board-item-prs-Bbcz56Cy.js} +1 -1
- package/dist/client/assets/{use-task-board-items-C2mDupi6.js → use-task-board-items-Cjilb3vU.js} +1 -1
- package/dist/client/assets/{use-task-metadata-CZgAw_o9.js → use-task-metadata-5PYU2TV-.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-CArPM_JS.js → use-thread-analytics-Bge2dWCG.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-C7byoUOG.js → use-thread-outputs-dVUFY4Dm.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BE9sCIYq.js +1 -0
- package/dist/client/assets/{useQueries-BBEEmrg3.js → useQueries-9ywyN6qt.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-Dq-LBGK4.js +1 -0
- package/dist/client/assets/{users-D8QTitdA.js → users-RR5nObJH.js} +1 -1
- package/dist/client/assets/{utils-B1Tu2D-6.js → utils-BgIMGxAp.js} +1 -1
- package/dist/client/assets/variant-calendar-ClwCgPPC.js +1 -0
- package/dist/client/assets/{variant-draft-pointer-BuTJy5L-.js → variant-draft-pointer-miKgr3lt.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-ChNomyKu.js → view-mode-toggle-zk0YkHDW.js} +1 -1
- package/dist/client/assets/{virtual-mcp-k92bg8nG.js → virtual-mcp-DQTg0L_z.js} +1 -1
- package/dist/client/assets/{watch-sse-pool--mvXzQUp.js → watch-sse-pool-u85EAaSx.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/ActiveShapeUtils-D90uwixk.js +0 -1
- package/dist/client/assets/AreaChart-DQ8fSDWu.js +0 -1
- package/dist/client/assets/BarChart-Gg2B8Zys.js +0 -1
- package/dist/client/assets/Sector-B1SBgZlq.js +0 -28
- package/dist/client/assets/XAxis-B4VtMcW_.js +0 -1
- package/dist/client/assets/agent-analytics-B5TV-KZu.js +0 -2
- package/dist/client/assets/agent-app-BXzRctUC.js +0 -1
- package/dist/client/assets/agent-assets-ALBqHa_9.js +0 -1
- package/dist/client/assets/agent-automation-CJx7el9c.js +0 -20
- package/dist/client/assets/agent-automations-CBdbFfEA.js +0 -1
- package/dist/client/assets/agent-connect-sources-hl-1-yt3.js +0 -1
- package/dist/client/assets/agent-deck-B_aVburO.js +0 -1
- package/dist/client/assets/agent-e2e-DodSRZBG.js +0 -1
- package/dist/client/assets/agent-experiments-bHBZK30C.js +0 -1
- package/dist/client/assets/agent-file-ChawivAK.js +0 -1
- package/dist/client/assets/agent-hosting-_C9di64Q.js +0 -1
- package/dist/client/assets/agent-icon-BHy2guMB.js +0 -1
- package/dist/client/assets/agent-library-BIyQBYDz.js +0 -1
- package/dist/client/assets/agent-library-file-BeYRAO3O.js +0 -1
- package/dist/client/assets/agent-monitor-RRH0nOFj.js +0 -1
- package/dist/client/assets/agent-overview-DMAPlUkF.js +0 -1
- package/dist/client/assets/agent-releases-BbRXEf9D.js +0 -2
- package/dist/client/assets/agent-settings-DcUC0LZG.js +0 -1
- package/dist/client/assets/agent-site-editor-code-CaeN0nnV.js +0 -2
- package/dist/client/assets/agent-site-editor-content-_LB-LMtV.js +0 -1
- package/dist/client/assets/agent-site-editor-preview-CT1wC41M.js +0 -1
- package/dist/client/assets/agent-view-By-YFMZK.js +0 -1
- package/dist/client/assets/analytics-sections-BzODh-x_.js +0 -1
- package/dist/client/assets/api-keys-DiCCNJ4r.js +0 -1
- package/dist/client/assets/app-editor-DWOa-9BF.js +0 -1
- package/dist/client/assets/automation-list-row-JorhAYZ-.js +0 -1
- package/dist/client/assets/category-editor-BBGiih96.js +0 -1
- package/dist/client/assets/chat-context-Bmqpsy6W.js +0 -39
- package/dist/client/assets/cms-settings-editor-4TD7AqSx.js +0 -1
- package/dist/client/assets/collection-detail-CWNPmZ4y.js +0 -1
- package/dist/client/assets/connection-detail-yk8D2Ycp.js +0 -1
- package/dist/client/assets/connections-DZRME_wK.js +0 -1
- package/dist/client/assets/context-DuyQB36H.js +0 -1
- package/dist/client/assets/daily-pulse-C4KVb8yE.js +0 -1
- package/dist/client/assets/discover-CF0wv3hZ.js +0 -1
- package/dist/client/assets/file-explorer-CCTWbr-M.js +0 -2
- package/dist/client/assets/flat-project-Df6mlDsC.js +0 -1
- package/dist/client/assets/home-CwtQgYEu.js +0 -1
- package/dist/client/assets/index-B8G9G8Hy.js +0 -1
- package/dist/client/assets/index-CdItoagM.css +0 -1
- package/dist/client/assets/index-D3e5iYr8.js +0 -1
- package/dist/client/assets/index-VjHMgva3.js +0 -1
- package/dist/client/assets/infra-billing-D-dZHhrL.js +0 -1
- package/dist/client/assets/library-CrV5fO9b.js +0 -1
- package/dist/client/assets/library-tab-Dm4VUi0b.js +0 -168
- package/dist/client/assets/memory-Bmm18X0J.js +0 -7
- package/dist/client/assets/monitoring-stats-row-8jzTtKCw.js +0 -1
- package/dist/client/assets/openai-conversation-CUWYpCqT.js +0 -3
- package/dist/client/assets/order-monitor-day-CRPxfT1J.js +0 -1
- package/dist/client/assets/post-calendar-CklqBMe1.js +0 -1
- package/dist/client/assets/project-app-view-BlmwFdlj.js +0 -1
- package/dist/client/assets/project-feed-BZ5qEA--.js +0 -1
- package/dist/client/assets/project-reports-XALwLDF4.js +0 -1
- package/dist/client/assets/project-tasks-BfDeKIG_.js +0 -1
- package/dist/client/assets/record-editor-CZIkgsD6.js +0 -1
- package/dist/client/assets/redirect-editor-LEWMCbq4.js +0 -1
- package/dist/client/assets/reports-BW7Hu0gn.js +0 -1
- package/dist/client/assets/reports-tab-CMlaQyAw.js +0 -2
- package/dist/client/assets/repositories-3KkmiQg9.js +0 -1
- package/dist/client/assets/route-CgRduuSn.js +0 -1
- package/dist/client/assets/route-DUAG_rGK.js +0 -1
- package/dist/client/assets/route-I9sr7jYv.js +0 -1
- package/dist/client/assets/seo-editor-BXCK7xdF.js +0 -1
- package/dist/client/assets/settings-tab-lU5sKX0b.js +0 -4
- package/dist/client/assets/shell-layout-Dcul1J_F.js +0 -1
- package/dist/client/assets/site-editor-DrDmGuX8.js +0 -1
- package/dist/client/assets/site-editor-toast-BSfvx_3Z.js +0 -1
- package/dist/client/assets/skills-B4JMW-n4.js +0 -1
- package/dist/client/assets/taskboard-analytics-CTvMhPaL.js +0 -1
- package/dist/client/assets/tasks-COblaCD7.js +0 -1
- package/dist/client/assets/thread-analytics-D3YcXUrL.js +0 -1
- package/dist/client/assets/thread-route-WIP_d1e0.js +0 -1
- package/dist/client/assets/time-range-picker-Dw2gGPU4.js +0 -1
- package/dist/client/assets/use-app-takeover-DsMhIKmL.js +0 -1
- package/dist/client/assets/use-chat-navigation-B8uZT3IY.js +0 -1
- package/dist/client/assets/use-deco-credits-DOas_6vk.js +0 -1
- package/dist/client/assets/use-main-panel-tabs-CEvdjLCw.js +0 -1
- package/dist/client/assets/use-navigate-to-agent-dXBkiNwU.js +0 -1
- package/dist/client/assets/use-project-native-view-presence-IG7UX4r0.js +0 -1
- package/dist/client/assets/use-recent-apps-DEQ4fuNJ.js +0 -1
- package/dist/client/assets/use-secrets-BA4OirG9.js +0 -1
- package/dist/client/assets/use-task-board-analytics-B6tQFJXc.js +0 -1
- package/dist/client/assets/useInfiniteQuery-uo1MiygM.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-qJNKvmwf.js +0 -1
- package/dist/client/assets/variant-calendar-DuI_DA8j.js +0 -1
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{c as H,b as te,r as Q,j as t,B as ne,h as et,l as xe,X as fs,T as ps,V as hs,U as We,as as Ft,aq as Et,ar as zt,t as re,a2 as Ae,D as Ge,q as qe,s as tt,v as st,H as Le,a3 as xs,fC as tn,w as Nt,L as gs,I as Ce,ak as sn,z as nn,eq as Xe,au as Rt,aj as ln,ep as Fe,eo as Ue,a9 as Ct,m as vs,K as Mt,fD as an,fE as rn,fF as on,b9 as ve,fG as be,n as Re,P as cn,d as kt,u as dn,ah as nt,o as bs,e as un,aM as js,y as Me,b1 as mn,a as fn,fH as ys,fI as pn,aW as hn,af as xn,aE as gn,aD as vn,a5 as bn,fJ as jn,aL as yn}from"./index-BWTgolHq.js";import{g as wn}from"./extract-connection-data-CoB451kP.js";import{b as Sn}from"./chat-context-Bmqpsy6W.js";import{U as Nn,b as Cn}from"./build-improve-prompt-doc-Buqt8O8s.js";import{E as Mn}from"./empty-state-CIJntdCH.js";import{a as kn}from"./shell-layout-Dcul1J_F.js";import{g as ot,n as _n,a as Lt,e as Vn,u as Tn,f as Dn}from"./use-date-fns-locale-Ca8zBjMd.js";import{a as Pn}from"./mcp-oauth-CZg9EKL6.js";import{f as On,e as In,b as An,A as $n,a as Fn,d as En,c as zn,g as Rn}from"./alert-dialog-C78VlsS8.js";import{T as at}from"./textarea-Kr4aIi3A.js";import{c as we,T as Se,a as Ne}from"./tooltip-B0tBatFZ.js";import{a as _t,b as ws,u as Ln}from"./use-connection-bHRGa4D5.js";import{b as Un,a as Ss,g as Ns,f as Yn,k as Bn}from"./repository-binding-Cqryn7FJ.js";import{i as Ut}from"./mcp-oauth-Cl83I81f.js";import{bf as Wn,h as Kn,bg as Gn,bh as qn,aL as Hn,aC as Qn,aF as Xn,bi as Jn,bj as Cs,bk as Ms,bl as Zn,ao as ei,bm as ti,bn as ht,bo as Yt,A as Bt,K as si,bp as ni,bq as ii,g as ks,m as Wt,n as li,u as ai,r as ri,q as oi,f as _s,z as Kt,U as ci,B as di,aJ as ui,ac as mi,au as fi}from"./agent-icon-BHy2guMB.js";import{s as Te}from"./Plus-G2W3_cG_.js";import{t as lt,a as pi}from"./Tool01-Dqha0FcH.js";import{s as Vt}from"./Trash01-BGnkoc5x.js";import{u as Gt}from"./use-debounced-autosave-DYdm3TR4.js";import{A as hi}from"./add-connection-dialog-DZOB9TFC.js";import{i as jt}from"./SearchMd-B4Oqfysk.js";import{F as qt}from"./file-type-icon-BL46MEKN.js";import{i as xi,h as gi,n as vi,q as bi}from"./use-org-fs-CJ1tjqaY.js";import{I as He}from"./integration-icon-D-o_SFdv.js";import{C as Vs}from"./checkbox-CxruOoUP.js";import{S as ji}from"./search-input-yB471vEF.js";import{b as De,a as Pe,c as ye,d as Oe,S as Ie}from"./select-RYdFJcIt.js";import{s as Tt}from"./XClose-BuC3W9yJ.js";import{C as yi}from"./collection-tabs-Bl4lAJm9.js";import{T as Ts,u as Ds}from"./use-mcp-auth-status-DKUh8Z7y.js";import{u as ct}from"./use-mcp-client-BTt1-Bfm.js";import{a as Ps}from"./use-mcp-tools-BJPex7_L.js";import{u as wi}from"./use-mcp-prompts-D9cdv5uS.js";import{g as Si}from"./connection-slug-CITJ0kGN.js";import{t as yt}from"./utils-CVEq3hMx.js";import{S as dt}from"./switch-fgRUjREt.js";import{a as Os,b as Is,P as As}from"./popover-BnVaucj1.js";import{S as Ni}from"./scroll-area-CKZ1rYUh.js";import{i as Ci}from"./Upload01-Ccm0_Yr0.js";import{i as Mi}from"./DotsVertical-DMmDiPEd.js";import{a as ki}from"./Image01-CtwwwWt4.js";import{i as _i}from"./Monitor01-hYg_Be5C.js";import{g as Vi}from"./types-A-yzlqDN.js";import{u as Ti,e as wt,r as St,a as $s,p as Di,w as Pi,s as Oi,x as Ii,y as Ai,z as $i,c as Fi,k as Ei}from"./use-project-native-view-presence-IG7UX4r0.js";import{a as zi}from"./use-panel-navigate-D4pXDoq7.js";import{a as Fs,u as Ri,i as Li,o as Ui,r as Ht,p as Yi,w as Bi,b as Qt}from"./optimistic-project-sidebar-views-D-nD1JgV.js";import{i as Wi}from"./Link01-D2rKPRqH.js";import{i as Dt}from"./Key01-BCEBdiYn.js";import{a as Ki}from"./format-time-CAj8AQXM.js";import{a as ut}from"./Copy01-PY0JiShS.js";import{u as Gi}from"./use-copy-C9iHKqw8.js";import{L as je}from"./label-CmiFUMkC.js";import{s as Es,p as qi,f as Hi}from"./thread-intent-qJ1dqLJM.js";import{V as Qi,E as mt,r as zs,C as Xi,w as Ji}from"./virtual-mcp-k92bg8nG.js";import{s as Rs}from"./slugify-CEUa2lfQ.js";import{b as Zi,a as el,D as tl}from"./drawer-Cq3BAxls.js";import{u as sl}from"./use-mobile-DI4rDMbJ.js";import{d as ft}from"./delay-CnY5UFtP.js";import{b as nl}from"./sandbox-url-D3mC8qhT.js";import{S as il,a as ll,b as al}from"./secret-picker-B2fQMZP8.js";import{u as rl,a as ol}from"./use-secrets-BA4OirG9.js";import{o as Xt}from"./omit-sandbox-map-jj4lCB2U.js";import{G as cl}from"./repository-picker-CPWce3gZ.js";import{r as dl}from"./serial-task-queue-CGOeQgpr.js";import{t as _e,c as Ke,m as ul,a as Ls}from"./differenceInSeconds-C3x8sHUj.js";function Ze(l,e){const n=ot(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=_e(l,e?.in),a=i.getDay(),c=(a<s?7:0)+a-s;return i.setDate(i.getDate()-c),i.setHours(0,0,0,0),i}function rt(l,e){return Ze(l,{...e,weekStartsOn:1})}function Us(l,e){const n=_e(l,e?.in),s=n.getFullYear(),i=Ke(n,0);i.setFullYear(s+1,0,4),i.setHours(0,0,0,0);const a=rt(i),c=Ke(n,0);c.setFullYear(s,0,4),c.setHours(0,0,0,0);const r=rt(c);return n.getTime()>=a.getTime()?s+1:n.getTime()>=r.getTime()?s:s-1}function Jt(l,e){const n=_e(l,e?.in);return n.setHours(0,0,0,0),n}function ml(l,e,n){const[s,i]=_n(n?.in,l,e),a=Jt(s),c=Jt(i),r=+a-Lt(a),h=+c-Lt(c);return Math.round((r-h)/ul)}function fl(l,e){const n=Us(l,e),s=Ke(l,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),rt(s)}function pl(l){return l instanceof Date||typeof l=="object"&&Object.prototype.toString.call(l)==="[object Date]"}function hl(l){return!(!pl(l)&&typeof l!="number"||isNaN(+_e(l)))}function xl(l,e){const n=_e(l,e?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function gl(l,e){const n=_e(l,e?.in);return ml(n,xl(n))+1}function vl(l,e){const n=_e(l,e?.in),s=+rt(n)-+fl(n);return Math.round(s/Ls)+1}function Ys(l,e){const n=_e(l,e?.in),s=n.getFullYear(),i=ot(),a=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=Ke(e?.in||l,0);c.setFullYear(s+1,0,a),c.setHours(0,0,0,0);const r=Ze(c,e),h=Ke(e?.in||l,0);h.setFullYear(s,0,a),h.setHours(0,0,0,0);const o=Ze(h,e);return+n>=+r?s+1:+n>=+o?s:s-1}function bl(l,e){const n=ot(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=Ys(l,e),a=Ke(e?.in||l,0);return a.setFullYear(i,0,s),a.setHours(0,0,0,0),Ze(a,e)}function jl(l,e){const n=_e(l,e?.in),s=+Ze(n,e)-+bl(n,e);return Math.round(s/Ls)+1}function ae(l,e){const n=l<0?"-":"",s=Math.abs(l).toString().padStart(e,"0");return n+s}const $e={y(l,e){const n=l.getFullYear(),s=n>0?n:1-n;return ae(e==="yy"?s%100:s,e.length)},M(l,e){const n=l.getMonth();return e==="M"?String(n+1):ae(n+1,2)},d(l,e){return ae(l.getDate(),e.length)},a(l,e){const n=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(l,e){return ae(l.getHours()%12||12,e.length)},H(l,e){return ae(l.getHours(),e.length)},m(l,e){return ae(l.getMinutes(),e.length)},s(l,e){return ae(l.getSeconds(),e.length)},S(l,e){const n=e.length,s=l.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return ae(i,e.length)}},Be={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Zt={G:function(l,e,n){const s=l.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});default:return n.era(s,{width:"wide"})}},y:function(l,e,n){if(e==="yo"){const s=l.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return $e.y(l,e)},Y:function(l,e,n,s){const i=Ys(l,s),a=i>0?i:1-i;if(e==="YY"){const c=a%100;return ae(c,2)}return e==="Yo"?n.ordinalNumber(a,{unit:"year"}):ae(a,e.length)},R:function(l,e){const n=Us(l);return ae(n,e.length)},u:function(l,e){const n=l.getFullYear();return ae(n,e.length)},Q:function(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"Q":return String(s);case"QQ":return ae(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(l,e,n){const s=Math.ceil((l.getMonth()+1)/3);switch(e){case"q":return String(s);case"qq":return ae(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(l,e,n){const s=l.getMonth();switch(e){case"M":case"MM":return $e.M(l,e);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(l,e,n){const s=l.getMonth();switch(e){case"L":return String(s+1);case"LL":return ae(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(l,e,n,s){const i=jl(l,s);return e==="wo"?n.ordinalNumber(i,{unit:"week"}):ae(i,e.length)},I:function(l,e,n){const s=vl(l);return e==="Io"?n.ordinalNumber(s,{unit:"week"}):ae(s,e.length)},d:function(l,e,n){return e==="do"?n.ordinalNumber(l.getDate(),{unit:"date"}):$e.d(l,e)},D:function(l,e,n){const s=gl(l);return e==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):ae(s,e.length)},E:function(l,e,n){const s=l.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"e":return String(a);case"ee":return ae(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(l,e,n,s){const i=l.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(e){case"c":return String(a);case"cc":return ae(a,e.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(l,e,n){const s=l.getDay(),i=s===0?7:s;switch(e){case"i":return String(i);case"ii":return ae(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(l,e,n){const i=l.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(l,e,n){const s=l.getHours();let i;switch(s===12?i=Be.noon:s===0?i=Be.midnight:i=s/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(l,e,n){const s=l.getHours();let i;switch(s>=17?i=Be.evening:s>=12?i=Be.afternoon:s>=4?i=Be.morning:i=Be.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(l,e,n){if(e==="ho"){let s=l.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return $e.h(l,e)},H:function(l,e,n){return e==="Ho"?n.ordinalNumber(l.getHours(),{unit:"hour"}):$e.H(l,e)},K:function(l,e,n){const s=l.getHours()%12;return e==="Ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},k:function(l,e,n){let s=l.getHours();return s===0&&(s=24),e==="ko"?n.ordinalNumber(s,{unit:"hour"}):ae(s,e.length)},m:function(l,e,n){return e==="mo"?n.ordinalNumber(l.getMinutes(),{unit:"minute"}):$e.m(l,e)},s:function(l,e,n){return e==="so"?n.ordinalNumber(l.getSeconds(),{unit:"second"}):$e.s(l,e)},S:function(l,e){return $e.S(l,e)},X:function(l,e,n){const s=l.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return ts(s);case"XXXX":case"XX":return ze(s);default:return ze(s,":")}},x:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"x":return ts(s);case"xxxx":case"xx":return ze(s);default:return ze(s,":")}},O:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+es(s,":");default:return"GMT"+ze(s,":")}},z:function(l,e,n){const s=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+es(s,":");default:return"GMT"+ze(s,":")}},t:function(l,e,n){const s=Math.trunc(+l/1e3);return ae(s,e.length)},T:function(l,e,n){return ae(+l,e.length)}};function es(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=Math.trunc(s/60),a=s%60;return a===0?n+String(i):n+String(i)+e+ae(a,2)}function ts(l,e){return l%60===0?(l>0?"-":"+")+ae(Math.abs(l)/60,2):ze(l,e)}function ze(l,e=""){const n=l>0?"-":"+",s=Math.abs(l),i=ae(Math.trunc(s/60),2),a=ae(s%60,2);return n+i+e+a}const ss=(l,e)=>{switch(l){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Bs=(l,e)=>{switch(l){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},yl=(l,e)=>{const n=l.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return ss(l,e);let a;switch(s){case"P":a=e.dateTime({width:"short"});break;case"PP":a=e.dateTime({width:"medium"});break;case"PPP":a=e.dateTime({width:"long"});break;default:a=e.dateTime({width:"full"});break}return a.replace("{{date}}",ss(s,e)).replace("{{time}}",Bs(i,e))},wl={p:Bs,P:yl},Sl=/^D+$/,Nl=/^Y+$/,Cl=["D","DD","YY","YYYY"];function Ml(l){return Sl.test(l)}function kl(l){return Nl.test(l)}function _l(l,e,n){const s=Vl(l,e,n);if(console.warn(s),Cl.includes(l))throw new RangeError(s)}function Vl(l,e,n){const s=l[0]==="Y"?"years":"days of the month";return`Use \`${l.toLowerCase()}\` instead of \`${l}\` (in \`${e}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Tl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Dl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Pl=/^'([^]*?)'?$/,Ol=/''/g,Il=/[a-zA-Z]/;function Al(l,e,n){const s=ot(),i=n?.locale??s.locale??Vn,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,r=_e(l,n?.in);if(!hl(r))throw new RangeError("Invalid time value");let h=e.match(Dl).map(m=>{const f=m[0];if(f==="p"||f==="P"){const u=wl[f];return u(m,i.formatLong)}return m}).join("").match(Tl).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const f=m[0];if(f==="'")return{isToken:!1,value:$l(m)};if(Zt[f])return{isToken:!0,value:m};if(f.match(Il))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:m}});i.localize.preprocessor&&(h=i.localize.preprocessor(r,h));const o={firstWeekContainsDate:a,weekStartsOn:c,locale:i};return h.map(m=>{if(!m.isToken)return m.value;const f=m.value;(!n?.useAdditionalWeekYearTokens&&kl(f)||!n?.useAdditionalDayOfYearTokens&&Ml(f))&&_l(f,e,String(l));const u=Zt[f[0]];return u(r,f,i.localize,o)}).join("")}function $l(l){const e=l.match(Pl);return e?e[1].replace(Ol,"'"):l}const Ws=25*1024*1024,xt="home",gt="knowledge";function ns(l){return l==null?"":l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(0)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function Ee(l){return l.split("/").pop()??l}function Fl(l){const e=H.c(64),{form:n}=l,s=te(),{upload:i}=xi(xt),a=gi(),c=Q.useRef(null),[r,h]=Q.useState(!1),[o,m]=Q.useState(""),[f,u]=Q.useState(!1);let d;e[0]!==r?(d={enabled:r},e[0]=r,e[1]=d):d=e[1];const{data:p}=vi(60,d),x=p===void 0?[]:p;let g;e[2]!==r?(g={enabled:r},e[2]=r,e[3]=g):g=e[3];const{data:b}=bi(g),y=b===void 0?[]:b;let j;e[4]!==n?(j=()=>n.getValues("metadata.knowledge")??[],e[4]=n,e[5]=j):j=e[5];const[v,S]=Q.useState(j);let C;e[6]!==n?(C=D=>{S(D),n.setValue("metadata.knowledge",D,{shouldDirty:!0})},e[6]=n,e[7]=C):C=e[7];const M=C;let w;e[8]!==a||e[9]!==v||e[10]!==M||e[11]!==s||e[12]!==i?(w=async D=>{if(!D||D.length===0)return;const Z=Array.from(D),he=Z.filter(Bl),de=Z.filter(Yl);if(de.length>0&&re.warning(s("virtualMcp.filesSection.fileTooLargeTitle"),{description:s("virtualMcp.filesSection.fileTooLargeDescription",{names:de.map(Ul).join(", ")})}),he.length!==0){try{await i.mutateAsync({dir:gt,files:he})}catch(ge){const Ve=ge;re.error(Ve instanceof Error?Ve.message:s("virtualMcp.filesSection.failedUploadFile"));return}M([...v,...he.map(ge=>({id:crypto.randomUUID(),name:ge.name,volume:xt,path:`${gt}/${ge.name}`,url:a(xt,`${gt}/${ge.name}`),contentType:ge.type||null,size:ge.size,addedAt:new Date().toISOString()}))])}},e[8]=a,e[9]=v,e[10]=M,e[11]=s,e[12]=i,e[13]=w):w=e[13];const N=w;let _;e[14]!==a||e[15]!==v||e[16]!==M?(_=D=>{v.some(Z=>Z.volume===D.volume&&Z.path===D.path)||(M([...v,{id:crypto.randomUUID(),name:Ee(D.path),volume:D.volume,path:D.path,url:a(D.volume,D.path),contentType:null,size:D.size??null,addedAt:new Date().toISOString()}]),h(!1))},e[14]=a,e[15]=v,e[16]=M,e[17]=_):_=e[17];const T=_;let V;e[18]!==a||e[19]!==v||e[20]!==M?(V=D=>{v.some(Z=>Z.volume===D.volume&&Z.path===D.path)||(M([...v,{id:crypto.randomUUID(),name:Ee(D.path),kind:"skill",volume:D.volume,path:D.path,url:a(D.volume,D.path),contentType:null,size:null,addedAt:new Date().toISOString()}]),h(!1))},e[18]=a,e[19]=v,e[20]=M,e[21]=V):V=e[21];const I=V;let P;e[22]!==v||e[23]!==M?(P=D=>{M(v.filter(Z=>Z.id!==D))},e[22]=v,e[23]=M,e[24]=P):P=e[24];const F=P;let A;e[25]===Symbol.for("react.memo_cache_sentinel")?(A=D=>{h(D),D&&m("")},e[25]=A):A=e[25];const E=A;let L;e[26]!==v?(L=new Set(v.map(Ll)),e[26]=v,e[27]=L):L=e[27];const K=L,B=o.toLowerCase();let Y;e[28]!==K?(Y=D=>!K.has(`${D.volume}/${D.path}`),e[28]=K,e[29]=Y):Y=e[29];const U=x.filter(Rl).filter(Y).filter(D=>Ee(D.path).toLowerCase().includes(B)).slice(0,5);let k;e[30]!==K?(k=D=>!K.has(`${D.volume}/${D.path}`),e[30]=K,e[31]=k):k=e[31];const $=y.filter(k).filter(D=>Ee(D.path).toLowerCase().includes(B)).slice(0,5),G=D=>t.jsxs(fs,{open:r,onOpenChange:E,children:[t.jsx(ps,{asChild:!0,children:D}),t.jsxs(hs,{align:"end",className:"w-56",children:[t.jsxs(We,{onSelect:()=>{c.current?.click()},children:[t.jsx(Wn,{size:16}),s("virtualMcp.filesSection.uploadFile")]}),t.jsxs(Ft,{children:[t.jsxs(Et,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(Kn,{size:16}),s("virtualMcp.filesSection.selectFileOrFolder")]}),t.jsxs(zt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(jt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:Z=>m(Z.target.value),onKeyDown:zl,placeholder:s("virtualMcp.filesSection.searchFilesPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:U.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noFilesFound")}):U.map(Z=>t.jsxs(We,{onSelect:()=>T(Z),children:[t.jsx(qt,{filename:Ee(Z.path),className:"h-5 w-4 shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(Z.path)}),Z.size!=null&&t.jsx("span",{className:"text-xs text-muted-foreground",children:ns(Z.size)})]},`${Z.volume}/${Z.path}`))})]})]}),t.jsxs(Ft,{children:[t.jsxs(Et,{className:"gap-2 [&_svg:not([class*='text-'])]:text-muted-foreground",children:[t.jsx(lt,{size:16}),s("virtualMcp.filesSection.selectSkill")]}),t.jsxs(zt,{className:"w-72 p-0",children:[t.jsxs("div",{className:"flex items-center gap-2 border-b px-3",children:[t.jsx(jt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsx("input",{value:o,onChange:Z=>m(Z.target.value),onKeyDown:El,placeholder:s("virtualMcp.filesSection.searchSkillsPlaceholder"),className:"h-10 w-full bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]}),t.jsx("div",{className:"max-h-64 overflow-y-auto p-1",children:$.length===0?t.jsx("p",{className:"px-2 py-3 text-center text-sm text-muted-foreground",children:s("virtualMcp.filesSection.noSkillsFound")}):$.map(Z=>t.jsxs(We,{onSelect:()=>I(Z),children:[t.jsx(lt,{size:16,className:"shrink-0"}),t.jsx("span",{className:"flex-1 truncate",children:Ee(Z.path)})]},`${Z.volume}/${Z.path}`))})]})]})]})]}),R="flex flex-col gap-3";let z;e[32]!==s?(z=s("virtualMcp.filesSection.filesAndSkills"),e[32]=s,e[33]=z):z=e[33];let W;e[34]!==z?(W=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:z}),e[34]=z,e[35]=W):W=e[35];let X;e[36]!==s?(X=s("virtualMcp.filesSection.description"),e[36]=s,e[37]=X):X=e[37];let ie;e[38]!==X?(ie=t.jsx("p",{className:"text-sm text-muted-foreground",children:X}),e[38]=X,e[39]=ie):ie=e[39];let J;e[40]!==W||e[41]!==ie?(J=t.jsxs("div",{className:"flex flex-col gap-1",children:[W,ie]}),e[40]=W,e[41]=ie,e[42]=J):J=e[42];const oe=v.length>0&&G(t.jsxs(ne,{variant:"outline",size:"sm",disabled:i.isPending,children:[i.isPending?t.jsx(et,{size:"xs"}):t.jsx(Te,{size:14}),s("virtualMcp.filesSection.add")]}));let le;e[43]!==J||e[44]!==oe?(le=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[J,oe]}),e[43]=J,e[44]=oe,e[45]=le):le=e[45];let ce;e[46]!==N?(ce=t.jsx("input",{ref:c,type:"file",multiple:!0,className:"hidden",onChange:D=>{N(D.target.files),D.target.value=""}}),e[46]=N,e[47]=ce):ce=e[47];let ee,ue;e[48]===Symbol.for("react.memo_cache_sentinel")?(ee=D=>{D.preventDefault(),u(!0)},ue=()=>u(!1),e[48]=ee,e[49]=ue):(ee=e[48],ue=e[49]);let fe;e[50]!==N?(fe=D=>{D.preventDefault(),D.stopPropagation(),u(!1),N(D.dataTransfer.files)},e[50]=N,e[51]=fe):fe=e[51];const pe=f&&"outline outline-2 outline-dashed outline-primary";let me;e[52]!==pe?(me=xe("flex flex-col gap-2 rounded-lg",pe),e[52]=pe,e[53]=me):me=e[53];const O=v.length===0?G(t.jsxs("button",{type:"button",className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Te,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground flex-1",children:s("virtualMcp.filesSection.noFilesOrSkillsYet")})]})):v.map(D=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-card",children:[D.kind==="skill"?t.jsx("div",{className:"flex items-center justify-center h-8 w-6.5 shrink-0 rounded-md bg-muted text-muted-foreground",children:t.jsx(lt,{size:16})}):t.jsx(qt,{filename:D.name,className:"h-8 w-6.5 shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:D.name}),t.jsx("p",{className:"text-xs text-muted-foreground",children:D.kind==="skill"?s("virtualMcp.filesSection.kindSkill"):D.size!=null?ns(D.size):s("virtualMcp.filesSection.kindFile")})]}),t.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>F(D.id),"aria-label":s("virtualMcp.filesSection.removeAriaLabel",{name:D.name}),children:t.jsx(Vt,{size:16})})]},D.id));let se;e[54]!==ee||e[55]!==ue||e[56]!==fe||e[57]!==me||e[58]!==O?(se=t.jsx("div",{onDragOver:ee,onDragLeave:ue,onDrop:fe,className:me,children:O}),e[54]=ee,e[55]=ue,e[56]=fe,e[57]=me,e[58]=O,e[59]=se):se=e[59];let q;return e[60]!==le||e[61]!==ce||e[62]!==se?(q=t.jsxs("section",{className:R,children:[le,ce,se]}),e[60]=le,e[61]=ce,e[62]=se,e[63]=q):q=e[63],q}function El(l){return l.stopPropagation()}function zl(l){return l.stopPropagation()}function Rl(l){return l.kind!=="dir"}function Ll(l){return`${l.volume}/${l.path}`}function Ul(l){return l.name}function Yl(l){return l.size>Ws}function Bl(l){return l.size<=Ws}function Wl(l){return l==null?"all":l.length===0?"self":"selected"}function Kl(l){const e=H.c(88),{form:n,currentAgentId:s}=l,i=te(),{org:a}=Ae(),c=Un(),[r,h]=Q.useState(!1);let o;e[0]!==n?(o=n.getValues("metadata.subAgents")??null,e[0]=n,e[1]=o):o=e[1];const m=o;let f;e[2]!==m?(f=()=>Wl(m),e[2]=m,e[3]=f):f=e[3];const[u,d]=Q.useState(f);let p;e[4]!==m?(p=m??[],e[4]=m,e[5]=p):p=e[5];const[x,g]=Q.useState(p);let b,y,j,v,S,C;if(e[6]!==c||e[7]!==s||e[8]!==n||e[9]!==u||e[10]!==a||e[11]!==x||e[12]!==i){let _;e[19]!==s||e[20]!==a?(_=ee=>ee.id!==s&&ee.id!==a.id&&ee.status==="active",e[19]=s,e[20]=a,e[21]=_):_=e[21],b=c.filter(_);let T;e[22]!==x?(T=ee=>x.includes(ee.id),e[22]=x,e[23]=T):T=e[23];const V=b.filter(T);let I;e[24]!==n?(I=(ee,ue)=>n.setValue("metadata.subAgents",ee==="all"?null:ee==="self"?[]:ue,{shouldDirty:!0}),e[24]=n,e[25]=I):I=e[25];const P=I;let F;e[26]!==P||e[27]!==x?(F=ee=>{d(ee),P(ee,x)},e[26]=P,e[27]=x,e[28]=F):F=e[28];const A=F;let E;e[29]!==P||e[30]!==x?(E=ee=>{const ue=x.includes(ee)?x.filter(fe=>fe!==ee):[...x,ee];g(ue),P("selected",ue)},e[29]=P,e[30]=x,e[31]=E):E=e[31],y=E,S="flex flex-col gap-3";let L;e[32]!==i?(L=i("virtualMcp.subAgentsSection.title"),e[32]=i,e[33]=L):L=e[33];let K;e[34]!==L?(K=t.jsx("h2",{className:"text-sm font-medium text-foreground",children:L}),e[34]=L,e[35]=K):K=e[35];let B;e[36]!==u||e[37]!==i?(B=u==="all"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canDelegateToAnyAgent")}),e[36]=u,e[37]=i,e[38]=B):B=e[38];let Y;e[39]!==u||e[40]!==i?(Y=u==="self"&&t.jsx("p",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.canOnlyDelegateToItself")}),e[39]=u,e[40]=i,e[41]=Y):Y=e[41];let U;e[42]!==K||e[43]!==B||e[44]!==Y?(U=t.jsxs("div",{className:"flex flex-col gap-1",children:[K,B,Y]}),e[42]=K,e[43]=B,e[44]=Y,e[45]=U):U=e[45];const k=u==="selected"&&V.length>0&&t.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>h(!0),children:[t.jsx(Te,{size:14}),i("virtualMcp.subAgentsSection.addSubAgent")]});let $;e[46]!==A?($=ee=>A(ee),e[46]=A,e[47]=$):$=e[47];let G;e[48]===Symbol.for("react.memo_cache_sentinel")?(G=t.jsx(De,{size:"sm",className:"w-auto",children:t.jsx(Pe,{})}),e[48]=G):G=e[48];let R;e[49]!==i?(R=i("virtualMcp.subAgentsSection.anyAgent"),e[49]=i,e[50]=R):R=e[50];let z;e[51]!==R?(z=t.jsx(ye,{value:"all",children:R}),e[51]=R,e[52]=z):z=e[52];let W;e[53]!==i?(W=i("virtualMcp.subAgentsSection.specificAgents"),e[53]=i,e[54]=W):W=e[54];let X;e[55]!==W?(X=t.jsx(ye,{value:"selected",children:W}),e[55]=W,e[56]=X):X=e[56];let ie;e[57]!==i?(ie=i("virtualMcp.subAgentsSection.onlyItself"),e[57]=i,e[58]=ie):ie=e[58];let J;e[59]!==ie?(J=t.jsx(ye,{value:"self",children:ie}),e[59]=ie,e[60]=J):J=e[60];let oe;e[61]!==z||e[62]!==X||e[63]!==J?(oe=t.jsxs(Oe,{align:"end",children:[z,X,J]}),e[61]=z,e[62]=X,e[63]=J,e[64]=oe):oe=e[64];let le;e[65]!==u||e[66]!==$||e[67]!==oe?(le=t.jsxs(Ie,{value:u,onValueChange:$,children:[G,oe]}),e[65]=u,e[66]=$,e[67]=oe,e[68]=le):le=e[68];let ce;e[69]!==k||e[70]!==le?(ce=t.jsxs("div",{className:"flex items-center gap-2",children:[k,le]}),e[69]=k,e[70]=le,e[71]=ce):ce=e[71],e[72]!==U||e[73]!==ce?(C=t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[U,ce]}),e[72]=U,e[73]=ce,e[74]=C):C=e[74],j="flex flex-col gap-2",v=u==="selected"&&(V.length>0?V.map(ee=>t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border bg-background",children:[t.jsx(He,{icon:ee.icon,name:ee.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:ee.title}),ee.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:ee.description})]}),t.jsx(ne,{variant:"ghost",size:"icon",onClick:()=>y(ee.id),children:t.jsx(Tt,{size:16})})]},ee.id)):t.jsxs("button",{type:"button",onClick:()=>h(!0),className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Te,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:i("virtualMcp.subAgentsSection.emptyStateMessage")})]})),e[6]=c,e[7]=s,e[8]=n,e[9]=u,e[10]=a,e[11]=x,e[12]=i,e[13]=b,e[14]=y,e[15]=j,e[16]=v,e[17]=S,e[18]=C}else b=e[13],y=e[14],j=e[15],v=e[16],S=e[17],C=e[18];let M;e[75]!==j||e[76]!==v?(M=t.jsx("div",{className:j,children:v}),e[75]=j,e[76]=v,e[77]=M):M=e[77];let w;e[78]!==b||e[79]!==y||e[80]!==r||e[81]!==x?(w=t.jsx(Gl,{open:r,onOpenChange:h,candidates:b,selectedIds:x,onToggle:y}),e[78]=b,e[79]=y,e[80]=r,e[81]=x,e[82]=w):w=e[82];let N;return e[83]!==S||e[84]!==C||e[85]!==M||e[86]!==w?(N=t.jsxs("section",{className:S,children:[C,M,w]}),e[83]=S,e[84]=C,e[85]=M,e[86]=w,e[87]=N):N=e[87],N}function Gl(l){const e=H.c(39),{open:n,onOpenChange:s,candidates:i,selectedIds:a,onToggle:c}=l,r=te(),[h,o]=Q.useState("");let m,f,u,d,p,x,g,b,y;if(e[0]!==i||e[1]!==s||e[2]!==c||e[3]!==n||e[4]!==h||e[5]!==a||e[6]!==r){const C=h.toLowerCase(),M=i.filter(_=>_.title.toLowerCase().includes(C)||_.description?.toLowerCase().includes(C));f=Ge,b=n,y=s,m=qe,p="max-w-md";let w;e[16]!==r?(w=r("virtualMcp.subAgentsSection.title"),e[16]=r,e[17]=w):w=e[17],e[18]!==w?(x=t.jsx(tt,{children:t.jsx(st,{children:w})}),e[18]=w,e[19]=x):x=e[19];let N;e[20]!==r?(N=r("virtualMcp.subAgentsSection.searchPlaceholder"),e[20]=r,e[21]=N):N=e[21],e[22]!==h||e[23]!==N?(g=t.jsx(ji,{value:h,onChange:o,placeholder:N,className:"w-full"}),e[22]=h,e[23]=N,e[24]=g):g=e[24],u="flex flex-col gap-1 max-h-80 overflow-y-auto",d=M.length===0?t.jsx("p",{className:"text-sm text-muted-foreground px-1 py-4 text-center",children:r("virtualMcp.subAgentsSection.noAgentsFound")}):M.map(_=>t.jsxs("button",{type:"button",onClick:()=>c(_.id),className:"flex items-center gap-3 px-2 py-2 rounded-lg hover:bg-accent/50 transition-colors cursor-pointer w-full text-left",children:[t.jsx(Vs,{checked:a.includes(_.id),className:"pointer-events-none",tabIndex:-1}),t.jsx(He,{icon:_.icon,name:_.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:_.title}),_.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:_.description})]})]},_.id)),e[0]=i,e[1]=s,e[2]=c,e[3]=n,e[4]=h,e[5]=a,e[6]=r,e[7]=m,e[8]=f,e[9]=u,e[10]=d,e[11]=p,e[12]=x,e[13]=g,e[14]=b,e[15]=y}else m=e[7],f=e[8],u=e[9],d=e[10],p=e[11],x=e[12],g=e[13],b=e[14],y=e[15];let j;e[25]!==u||e[26]!==d?(j=t.jsx("div",{className:u,children:d}),e[25]=u,e[26]=d,e[27]=j):j=e[27];let v;e[28]!==m||e[29]!==p||e[30]!==x||e[31]!==g||e[32]!==j?(v=t.jsxs(m,{className:p,children:[x,g,j]}),e[28]=m,e[29]=p,e[30]=x,e[31]=g,e[32]=j,e[33]=v):v=e[33];let S;return e[34]!==f||e[35]!==b||e[36]!==y||e[37]!==v?(S=t.jsx(f,{open:b,onOpenChange:y,children:v}),e[34]=f,e[35]=b,e[36]=y,e[37]=v,e[38]=S):S=e[38],S}function Je(){const l=H.c(1);let e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"flex items-center justify-center h-32",children:t.jsx(et,{className:"size-6 text-muted-foreground"})}),l[0]=e):e=l[0],e}function it(l,e){return({error:n})=>n?.message?.includes("Method not found")||n?.code===-32601?t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:l})}):t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center h-full p-6 text-center space-y-4",children:[t.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:t.jsx(xs,{className:"h-6 w-6 text-destructive"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-medium",children:e("virtualMcp.dependencySelectionDialog.somethingWentWrong")}),t.jsx("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:n?.message?n.message.length>200?`${n.message.slice(0,200)}...`:n.message:e("virtualMcp.dependencySelectionDialog.unexpectedError")})]})]})}function Ks(l){const e=H.c(23),{item:n,isSelected:s,onToggle:i,disabled:a}=l,c=a?"cursor-not-allowed opacity-50":"cursor-pointer",r=s?"bg-accent/25":"hover:bg-muted/50";let h;e[0]!==c||e[1]!==r?(h=xe("flex items-start gap-3 p-4 rounded-lg transition-colors",c,r),e[0]=c,e[1]=r,e[2]=h):h=e[2];let o;e[3]!==n.name?(o=t.jsx("p",{className:"text-sm font-medium leading-none truncate",children:n.name}),e[3]=n.name,e[4]=o):o=e[4];let m;e[5]!==n.tags?(m=n.tags&&t.jsx("span",{className:"shrink-0",children:n.tags}),e[5]=n.tags,e[6]=m):m=e[6];let f;e[7]!==o||e[8]!==m?(f=t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o,m]}),e[7]=o,e[8]=m,e[9]=f):f=e[9];let u;e[10]!==n.description?(u=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:n.description}),e[10]=n.description,e[11]=u):u=e[11];let d;e[12]!==f||e[13]!==u?(d=t.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[f,u]}),e[12]=f,e[13]=u,e[14]=d):d=e[14];let p;e[15]!==a||e[16]!==s||e[17]!==i?(p=t.jsx(Vs,{checked:s,onCheckedChange:i,disabled:a,className:"mt-0.5"}),e[15]=a,e[16]=s,e[17]=i,e[18]=p):p=e[18];let x;return e[19]!==h||e[20]!==d||e[21]!==p?(x=t.jsxs("label",{className:h,children:[d,p]}),e[19]=h,e[20]=d,e[21]=p,e[22]=x):x=e[22],x}function ql(l){const e=H.c(35),{activeTab:n,onTabChange:s,showSelectAll:i,isAllSelected:a,handleSelectAll:c}=l,r=te();let h;e[0]!==r?(h=r("virtualMcp.dependencySelectionDialog.tabTools"),e[0]=r,e[1]=h):h=e[1];let o;e[2]!==h?(o={id:"tools",label:h},e[2]=h,e[3]=o):o=e[3];let m;e[4]!==r?(m=r("virtualMcp.dependencySelectionDialog.tabActive"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f={id:"active",label:m},e[6]=m,e[7]=f):f=e[7];let u;e[8]!==r?(u=r("virtualMcp.dependencySelectionDialog.tabResources"),e[8]=r,e[9]=u):u=e[9];let d;e[10]!==u?(d={id:"resources",label:u},e[10]=u,e[11]=d):d=e[11];let p;e[12]!==r?(p=r("virtualMcp.dependencySelectionDialog.tabPrompts"),e[12]=r,e[13]=p):p=e[13];let x;e[14]!==p?(x={id:"prompts",label:p},e[14]=p,e[15]=x):x=e[15];let g;e[16]!==o||e[17]!==f||e[18]!==d||e[19]!==x?(g=[o,f,d,x],e[16]=o,e[17]=f,e[18]=d,e[19]=x,e[20]=g):g=e[20];let b;e[21]!==s?(b=S=>s(S),e[21]=s,e[22]=b):b=e[22];let y;e[23]!==n||e[24]!==b||e[25]!==g?(y=t.jsx(yi,{tabs:g,activeTab:n,onTabChange:b}),e[23]=n,e[24]=b,e[25]=g,e[26]=y):y=e[26];let j;e[27]!==c||e[28]!==a||e[29]!==i||e[30]!==r?(j=i&&t.jsx("button",{type:"button",onClick:c,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:r(a?"virtualMcp.dependencySelectionDialog.deselectAll":"virtualMcp.dependencySelectionDialog.selectAll")}),e[27]=c,e[28]=a,e[29]=i,e[30]=r,e[31]=j):j=e[31];let v;return e[32]!==y||e[33]!==j?(v=t.jsxs("div",{className:"flex items-center justify-between px-6 py-3 border-t border-border shrink-0",children:[y,j]}),e[32]=y,e[33]=j,e[34]=v):v=e[34],v}function Pt(l){const e=H.c(13),{items:n,selections:s,onToggle:i,emptyMessage:a,disabled:c}=l;let r,h,o;if(e[0]!==c||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==s){o=Symbol.for("react.early_return_sentinel");e:{const f=n.map(Hl);if(n.length===0){let u;e[8]!==a?(u=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:a})}),e[8]=a,e[9]=u):u=e[9],o=u;break e}r="flex-1 overflow-auto px-4 py-3 space-y-1",h=n.map(u=>t.jsx(Ks,{item:u,isSelected:s===null||s?.includes(u.id),onToggle:()=>i(u.id,f),disabled:c},u.id))}e[0]=c,e[1]=a,e[2]=n,e[3]=i,e[4]=s,e[5]=r,e[6]=h,e[7]=o}else r=e[5],h=e[6],o=e[7];if(o!==Symbol.for("react.early_return_sentinel"))return o;let m;return e[10]!==r||e[11]!==h?(m=t.jsx("div",{className:r,children:h}),e[10]=r,e[11]=h,e[12]=m):m=e[12],m}function Hl(l){return l.id}function Ql(l){const e=H.c(22),{connectionId:n,toolSelections:s,onToggleTool:i}=l,a=te(),{org:c}=Ae();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=ct(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=Ps(o),f=m.tools;let u,d,p;if(e[6]!==m.tools||e[7]!==i||e[8]!==a||e[9]!==s){p=Symbol.for("react.early_return_sentinel");e:{const g=f.map(Jl);let b;e[13]!==s?(b=v=>s===null||s.includes(v.name),e[13]=s,e[14]=b):b=e[14];const j=m.tools.filter(b).map(Xl);if(j.length===0){let v;e[15]!==a?(v=a("virtualMcp.dependencySelectionDialog.noActiveToolsSelected"),e[15]=a,e[16]=v):v=e[16];let S;e[17]!==v?(S=t.jsx("div",{className:"flex-1 overflow-auto px-4 py-3 space-y-1",children:t.jsx("div",{className:"flex items-center justify-center h-32 text-sm text-muted-foreground",children:v})}),e[17]=v,e[18]=S):S=e[18],p=S;break e}u="flex-1 overflow-auto px-4 py-3 space-y-1",d=j.map(v=>t.jsx(Ks,{item:v,isSelected:!0,onToggle:()=>i(v.id,g)},v.id))}e[6]=m.tools,e[7]=i,e[8]=a,e[9]=s,e[10]=u,e[11]=d,e[12]=p}else u=e[10],d=e[11],p=e[12];if(p!==Symbol.for("react.early_return_sentinel"))return p;let x;return e[19]!==u||e[20]!==d?(x=t.jsx("div",{className:u,children:d}),e[19]=u,e[20]=d,e[21]=x):x=e[21],x}function Xl(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ts,{annotations:l.annotations,_meta:l._meta})}}function Jl(l){return l.name}function Zl(l){const e=H.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Ae();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=ct(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=Ps(o);let f;e[6]!==m.tools?(f=m.tools.map(ea),e[6]=m.tools,e[7]=f):f=e[7];const u=f,d=te();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noToolsAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function ea(l){return{id:l.name,name:l.name,description:l.description,tags:t.jsx(Ts,{annotations:l.annotations,_meta:l._meta})}}function ta(l){const e=H.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Ae();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=ct(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=tn(o);let f;e[6]!==m.resources?(f=m.resources.map(sa),e[6]=m.resources,e[7]=f):f=e[7];const u=f,d=te();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noResourcesAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function sa(l){return{id:l.name||l.uri,name:l.name||l.uri,description:l.description}}function na(l){const e=H.c(16),{connectionId:n,selections:s,onToggle:i,disabled:a}=l,{org:c}=Ae();let r;e[0]!==n||e[1]!==c.id||e[2]!==c.slug?(r={connectionId:n,orgId:c.id,orgSlug:c.slug},e[0]=n,e[1]=c.id,e[2]=c.slug,e[3]=r):r=e[3];const h=ct(r);let o;e[4]!==h?(o={client:h},e[4]=h,e[5]=o):o=e[5];const{data:m}=wi(o);let f;e[6]!==m.prompts?(f=m.prompts.map(ia),e[6]=m.prompts,e[7]=f):f=e[7];const u=f,d=te();let p;e[8]!==d?(p=d("virtualMcp.dependencySelectionDialog.noPromptsAvailable"),e[8]=d,e[9]=p):p=e[9];let x;return e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==s||e[14]!==p?(x=t.jsx(Pt,{items:u,selections:s,onToggle:i,emptyMessage:p,disabled:a}),e[10]=a,e[11]=u,e[12]=i,e[13]=s,e[14]=p,e[15]=x):x=e[15],x}function ia(l){return{id:l.name,name:l.name,description:l.description}}function la(l){const e=H.c(58),{currentConnection:n,activeTab:s,selectedId:i,formData:a,toggleTool:c,toggleResource:r,togglePrompt:h,toggleAllTools:o,toggleAllResources:m,toggleAllPrompts:f,onTabChange:u}=l,d=te(),p=a[i],x=s==="tools"?p?.tools===null:s==="resources"?p?.resources===null:s==="prompts"?p?.prompts===null:!1,g=s!=="active";let b;e[0]!==s||e[1]!==i||e[2]!==f||e[3]!==m||e[4]!==o?(b=()=>{s==="tools"?o(i):s==="resources"?m(i):s==="prompts"&&f(i)},e[0]=s,e[1]=i,e[2]=f,e[3]=m,e[4]=o,e[5]=b):b=e[5];const y=b;let j;e[6]!==n.icon||e[7]!==n.title?(j=t.jsx(He,{icon:n.icon,name:n.title,size:"sm",className:"shrink-0"}),e[6]=n.icon,e[7]=n.title,e[8]=j):j=e[8];let v;e[9]!==n.title?(v=t.jsx("h2",{className:"text-base font-semibold truncate",children:n.title}),e[9]=n.title,e[10]=v):v=e[10];let S;e[11]!==n.description?(S=n.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n.description}),e[11]=n.description,e[12]=S):S=e[12];let C;e[13]!==v||e[14]!==S?(C=t.jsxs("div",{className:"flex-1 min-w-0",children:[v,S]}),e[13]=v,e[14]=S,e[15]=C):C=e[15];let M;e[16]!==j||e[17]!==C?(M=t.jsx("div",{className:"px-6 pt-5 pb-4 shrink-0",children:t.jsxs("div",{className:"flex items-center gap-3",children:[j,C]})}),e[16]=j,e[17]=C,e[18]=M):M=e[18];let w;e[19]!==s||e[20]!==y||e[21]!==x||e[22]!==u||e[23]!==g?(w=t.jsx(ql,{activeTab:s,onTabChange:u,showSelectAll:g,isAllSelected:x,handleSelectAll:y}),e[19]=s,e[20]=y,e[21]=x,e[22]=u,e[23]=g,e[24]=w):w=e[24];let N;e[25]!==s||e[26]!==a||e[27]!==i||e[28]!==d||e[29]!==c?(N=s==="active"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.toolsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(Ql,{connectionId:i,toolSelections:a[i]?a[i].tools:[],onToggleTool:(F,A)=>c(i,F,A)})})}),e[25]=s,e[26]=a,e[27]=i,e[28]=d,e[29]=c,e[30]=N):N=e[30];let _;e[31]!==s||e[32]!==a||e[33]!==i||e[34]!==d||e[35]!==c?(_=s==="tools"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.toolsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(Zl,{connectionId:i,selections:a[i]?a[i].tools:[],onToggle:(F,A)=>c(i,F,A)})})}),e[31]=s,e[32]=a,e[33]=i,e[34]=d,e[35]=c,e[36]=_):_=e[36];let T;e[37]!==s||e[38]!==a||e[39]!==i||e[40]!==d||e[41]!==r?(T=s==="resources"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.resourcesNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(ta,{connectionId:i,selections:a[i]?a[i].resources:[],onToggle:(F,A)=>r(i,F,A)})})}),e[37]=s,e[38]=a,e[39]=i,e[40]=d,e[41]=r,e[42]=T):T=e[42];let V;e[43]!==s||e[44]!==a||e[45]!==i||e[46]!==d||e[47]!==h?(V=s==="prompts"&&t.jsx(Le,{fallback:it(d("virtualMcp.dependencySelectionDialog.promptsNotSupported"),d),children:t.jsx(Q.Suspense,{fallback:t.jsx(Je,{}),children:t.jsx(na,{connectionId:i,selections:a[i]?a[i].prompts:[],onToggle:(F,A)=>h(i,F,A)})})}),e[43]=s,e[44]=a,e[45]=i,e[46]=d,e[47]=h,e[48]=V):V=e[48];let I;e[49]!==T||e[50]!==V||e[51]!==N||e[52]!==_?(I=t.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[N,_,T,V]}),e[49]=T,e[50]=V,e[51]=N,e[52]=_,e[53]=I):I=e[53];let P;return e[54]!==I||e[55]!==M||e[56]!==w?(P=t.jsxs(t.Fragment,{children:[M,w,I]}),e[54]=I,e[55]=M,e[56]=w,e[57]=P):P=e[57],P}function aa(l){const e=H.c(7),{onClose:n}=l,s=te();let i;e[0]!==n?(i=()=>n(!1),e[0]=n,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.dependencySelectionDialog.done"),e[2]=s,e[3]=a):a=e[3];let c;return e[4]!==i||e[5]!==a?(c=t.jsx(Nt,{className:"px-6 py-4 border-t border-border shrink-0",children:t.jsx(ne,{variant:"outline",onClick:i,children:a})}),e[4]=i,e[5]=a,e[6]=c):c=e[6],c}function ra(l){const e=H.c(23),{connectionId:n,onAuthenticate:s,children:i}=l,a=te();let c;e[0]!==n?(c={connectionId:n},e[0]=n,e[1]=c):c=e[1];const r=Ds(c);if(r.supportsOAuth&&!r.isAuthenticated){let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx("div",{className:"flex items-center justify-center size-12 rounded-full bg-muted",children:t.jsx(Gn,{size:22,className:"text-muted-foreground"})}),e[2]=m):m=e[2];let f;e[3]!==a?(f=a("virtualMcp.dependencySelectionDialog.authorizationRequired"),e[3]=a,e[4]=f):f=e[4];let u;e[5]!==f?(u=t.jsx("p",{className:"text-sm font-medium",children:f}),e[5]=f,e[6]=u):u=e[6];let d;e[7]!==a?(d=a("virtualMcp.dependencySelectionDialog.authorizationDescription"),e[7]=a,e[8]=d):d=e[8];let p;e[9]!==d?(p=t.jsx("p",{className:"text-xs text-muted-foreground max-w-xs",children:d}),e[9]=d,e[10]=p):p=e[10];let x;e[11]!==u||e[12]!==p?(x=t.jsxs("div",{className:"space-y-1",children:[u,p]}),e[11]=u,e[12]=p,e[13]=x):x=e[13];let g;e[14]!==n||e[15]!==s||e[16]!==a?(g=s&&t.jsx(ne,{variant:"outline",size:"sm",onClick:()=>s(n),children:a("virtualMcp.dependencySelectionDialog.authorize")}),e[14]=n,e[15]=s,e[16]=a,e[17]=g):g=e[17];let b;return e[18]!==x||e[19]!==g?(b=t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-4 p-8 text-center",children:[m,x,g]}),e[18]=x,e[19]=g,e[20]=b):b=e[20],b}let o;return e[21]!==i?(o=t.jsx(t.Fragment,{children:i}),e[21]=i,e[22]=o):o=e[22],o}function oa(l){const e={};for(const n of l)e[n.connection_id]={tools:n.selected_tools,resources:n.selected_resources??null,prompts:n.selected_prompts??null};return e}function is(l){return Object.entries(l).map(([e,n])=>({connection_id:e,selected_tools:n.tools,selected_resources:n.resources,selected_prompts:n.prompts}))}function ls(l,e,n,s){const i=l[e]??{tools:null,resources:null,prompts:null};return{...l,[e]:{...i,[n]:s}}}function ca(l,e){return e.type==="SET_ACTIVE_TAB"?{...l,activeTab:e.payload}:l}function da(l){const e=H.c(49),{open:n,onOpenChange:s,selectedId:i,form:a,connections:c,onAuthenticate:r}=l;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={activeTab:"tools"},e[0]=h):h=e[0];const[o,m]=Q.useReducer(ca,h),f=_t(i??"");let u;e[1]!==c?(u=c??[],e[1]=c,e[2]=u):u=e[2];let d;e[3]!==u?(d=oa(u),e[3]=u,e[4]=d):d=e[4];const p=d;let x;e[5]!==a||e[6]!==p?(x=(U,k,$,G)=>{const R=p[U]?.[k];let z;R===null?z=G.filter(W=>W!==$):R?.includes($)?z=R.filter(W=>W!==$):(z=[...R??[],$],z.length===G.length&&(z=null)),a.setValue("connections",is(ls(p,U,k,z)),{shouldDirty:!0,shouldTouch:!0})},e[5]=a,e[6]=p,e[7]=x):x=e[7];const g=x;let b;e[8]!==a||e[9]!==p?(b=(U,k)=>{const G=p[U]?.[k]===null?[]:null;a.setValue("connections",is(ls(p,U,k,G)),{shouldDirty:!0,shouldTouch:!0})},e[8]=a,e[9]=p,e[10]=b):b=e[10];const y=b;let j;e[11]!==g?(j=(U,k,$)=>g(U,"tools",k,$),e[11]=g,e[12]=j):j=e[12];const v=j;let S;e[13]!==g?(S=(U,k,$)=>g(U,"resources",k,$),e[13]=g,e[14]=S):S=e[14];const C=S;let M;e[15]!==g?(M=(U,k,$)=>g(U,"prompts",k,$),e[15]=g,e[16]=M):M=e[16];const w=M;let N;e[17]!==y?(N=U=>y(U,"tools"),e[17]=y,e[18]=N):N=e[18];const _=N;let T;e[19]!==y?(T=U=>y(U,"resources"),e[19]=y,e[20]=T):T=e[20];const V=T;let I;e[21]!==y?(I=U=>y(U,"prompts"),e[21]=y,e[22]=I):I=e[22];const P=I;if(!i||!f)return null;let F;e[23]===Symbol.for("react.memo_cache_sentinel")?(F=t.jsx(Je,{}),e[23]=F):F=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=U=>m({type:"SET_ACTIVE_TAB",payload:U}),e[24]=A):A=e[24];let E;e[25]!==f||e[26]!==o.activeTab||e[27]!==p||e[28]!==i||e[29]!==P||e[30]!==V||e[31]!==_||e[32]!==w||e[33]!==C||e[34]!==v?(E=t.jsx(la,{currentConnection:f,activeTab:o.activeTab,selectedId:i,formData:p,toggleTool:v,toggleResource:C,togglePrompt:w,toggleAllTools:_,toggleAllResources:V,toggleAllPrompts:P,onTabChange:A},i),e[25]=f,e[26]=o.activeTab,e[27]=p,e[28]=i,e[29]=P,e[30]=V,e[31]=_,e[32]=w,e[33]=C,e[34]=v,e[35]=E):E=e[35];let L;e[36]!==r||e[37]!==i||e[38]!==E?(L=t.jsx(Q.Suspense,{fallback:F,children:t.jsx(ra,{connectionId:i,onAuthenticate:r,children:E})}),e[36]=r,e[37]=i,e[38]=E,e[39]=L):L=e[39];let K;e[40]!==s?(K=t.jsx(aa,{onClose:s}),e[40]=s,e[41]=K):K=e[41];let B;e[42]!==L||e[43]!==K?(B=t.jsxs(qe,{className:"sm:max-w-2xl h-[75vh] max-h-[75vh] flex flex-col p-0 gap-0 overflow-hidden w-[95vw]",children:[L,K]}),e[42]=L,e[43]=K,e[44]=B):B=e[44];let Y;return e[45]!==s||e[46]!==n||e[47]!==B?(Y=t.jsx(Ge,{open:n,onOpenChange:s,children:B}),e[45]=s,e[46]=n,e[47]=B,e[48]=Y):Y=e[48],Y}const as="__new_instance__";function ua(l){const e=H.c(25),{connection_id:n,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:h}=l,o=_t(n),{org:m}=Ae();if(!o){let g;return e[0]!==a?(g=t.jsx(ha,{onRemove:a}),e[0]=a,e[1]=g):g=e[1],g}let f;e[2]!==o?(f=Si(o),e[2]=o,e[3]=f):f=e[3];const u=f;let d;e[4]!==n?(d=t.jsx(pa,{connection_id:n}),e[4]=n,e[5]=d):d=e[5];let p;e[6]!==o.app_name||e[7]!==o.connection_type||e[8]!==o.description||e[9]!==o.icon||e[10]!==o.status||e[11]!==o.title||e[12]!==n||e[13]!==c||e[14]!==h||e[15]!==i||e[16]!==a||e[17]!==r||e[18]!==m.slug||e[19]!==u||e[20]!==s?(p=t.jsx(fa,{connection_id:n,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,connectionType:o.connection_type,connectionStatus:o.status,slug:u,orgSlug:m.slug,appName:o.app_name,usedConnectionIds:s,onOpenSettings:i,onRemove:a,onAuthenticate:c,onSwitchInstance:r,onNewInstance:h}),e[6]=o.app_name,e[7]=o.connection_type,e[8]=o.description,e[9]=o.icon,e[10]=o.status,e[11]=o.title,e[12]=n,e[13]=c,e[14]=h,e[15]=i,e[16]=a,e[17]=r,e[18]=m.slug,e[19]=u,e[20]=s,e[21]=p):p=e[21];let x;return e[22]!==d||e[23]!==p?(x=t.jsx(Q.Suspense,{fallback:d,children:p}),e[22]=d,e[23]=p,e[24]=x):x=e[24],x}function ma(l){const e=H.c(24),{appName:n,connectionId:s,usedConnectionIds:i,onSwitchInstance:a,onNewInstance:c}=l,r=te();let h;e[0]!==n?(h={filters:[{column:"app_name",value:n}]},e[0]=n,e[1]=h):h=e[1];const o=Ln(h);if(o.length<=1&&!c)return null;let m;e[2]!==s||e[3]!==c||e[4]!==a?(m=g=>{g===as?c?.():a(s,g)},e[2]=s,e[3]=c,e[4]=a,e[5]=m):m=e[5];let f;e[6]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(De,{size:"sm",className:"w-auto text-xs gap-1 px-2 shadow-none",children:t.jsx(Pe,{})}),e[6]=f):f=e[6];let u;if(e[7]!==s||e[8]!==o||e[9]!==i){let g;e[11]!==s||e[12]!==i?(g=b=>t.jsx(ye,{value:b.id,className:"text-xs",disabled:b.id!==s&&i.has(b.id),children:b.title},b.id),e[11]=s,e[12]=i,e[13]=g):g=e[13],u=o.map(g),e[7]=s,e[8]=o,e[9]=i,e[10]=u}else u=e[10];let d;e[14]!==c||e[15]!==r?(d=c&&t.jsxs(ye,{value:as,className:"text-xs text-muted-foreground",children:["+ ",r("virtualMcp.connectionItem.newInstance")]}),e[14]=c,e[15]=r,e[16]=d):d=e[16];let p;e[17]!==u||e[18]!==d?(p=t.jsxs(Oe,{children:[u,d]}),e[17]=u,e[18]=d,e[19]=p):p=e[19];let x;return e[20]!==s||e[21]!==m||e[22]!==p?(x=t.jsxs(Ie,{value:s,onValueChange:m,children:[f,p]}),e[20]=s,e[21]=m,e[22]=p,e[23]=x):x=e[23],x}function fa({connection_id:l,connectionTitle:e,connectionDescription:n,connectionIcon:s,connectionType:i,connectionStatus:a,slug:c,orgSlug:r,appName:h,usedConnectionIds:o,onOpenSettings:m,onRemove:f,onAuthenticate:u,onSwitchInstance:d,onNewInstance:p}){const x=Ds({connectionId:l}),g=ws(),y=!(i==="VIRTUAL")&&x.supportsOAuth&&!x.isAuthenticated,j=a!=="active",v=te(),S=async C=>{try{await g.update.mutateAsync({id:l,data:{status:C}}),re.success(v(C==="active"?"virtualMcp.connectionItem.connectionEnabled":"virtualMcp.connectionItem.connectionDisabled"))}catch{re.error(v("virtualMcp.connectionItem.failedToUpdateConnection"))}};return t.jsxs("div",{className:xe("rounded-xl border overflow-hidden transition-colors",y||j?"border-destructive/50 bg-destructive/5":"border-border bg-card"),children:[t.jsxs(gs,{to:"/$org/settings/connections/$appSlug",params:{org:r,appSlug:c},className:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors",children:[t.jsx(He,{icon:s,name:e,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:e}),y?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v("virtualMcp.connectionItem.needsAuthorization")}):j?t.jsx("span",{className:"text-xs text-destructive font-medium",children:v(a==="error"?"virtualMcp.connectionItem.disabledError":"virtualMcp.connectionItem.disabled")}):n&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:n})]}),y?t.jsx(ne,{variant:"outline",size:"sm",className:"h-7 text-xs shrink-0",onClick:C=>{C.preventDefault(),C.stopPropagation(),u(l)},children:v("virtualMcp.connectionItem.authorize")}):j?t.jsxs(ne,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5 shrink-0",onClick:C=>{C.preventDefault(),C.stopPropagation(),S("active")},children:[t.jsx(qn,{size:13}),v("virtualMcp.connectionItem.enable")]}):t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx("span",{className:"inline-flex items-center justify-center rounded-md h-7 w-7 hover:bg-accent text-muted-foreground shrink-0 transition-colors",children:t.jsx(pi,{size:16})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.connectionSettings")})]})]}),t.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 border-t border-border bg-muted/25",children:[h&&t.jsx(ma,{appName:h,connectionId:l,usedConnectionIds:o,onSwitchInstance:d,onNewInstance:p}),t.jsxs("div",{className:"flex items-center gap-0.5 ml-auto",children:[t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:m,"aria-label":v("virtualMcp.connectionItem.configureResources"),children:t.jsx(Hn,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.configureResources")})]}),!j&&t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>S("inactive"),"aria-label":v("virtualMcp.connectionItem.disableConnection"),children:t.jsx(Qn,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.disable")})]}),t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:f,"aria-label":v("virtualMcp.connectionItem.removeConnection"),children:t.jsx(Tt,{size:13})})}),t.jsx(Ne,{side:"bottom",children:v("virtualMcp.connectionItem.remove")})]})]})]})]})}function pa(l){const e=H.c(17),{connection_id:n}=l,s=_t(n);if(!s){let f;return e[0]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Gs,{}),e[0]=f):f=e[0],f}let i;e[1]!==s.icon||e[2]!==s.title?(i=t.jsx(He,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0"}),e[1]=s.icon,e[2]=s.title,e[3]=i):i=e[3];let a;e[4]!==s.title?(a=t.jsx("p",{className:"text-sm font-medium truncate",children:s.title}),e[4]=s.title,e[5]=a):a=e[5];let c;e[6]!==s.description?(c=s.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:s.description}),e[6]=s.description,e[7]=c):c=e[7];let r;e[8]!==a||e[9]!==c?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[a,c]}),e[8]=a,e[9]=c,e[10]=r):r=e[10];let h;e[11]!==i||e[12]!==r?(h=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[i,r]}),e[11]=i,e[12]=r,e[13]=h):h=e[13];let o;e[14]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})}),e[14]=o):o=e[14];let m;return e[15]!==h?(m=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[h,o]}),e[15]=h,e[16]=m):m=e[16],m}function ha(l){const e=H.c(20),{onRemove:n}=l,s=te();let i;e[0]!==s?(i=s("virtualMcp.connectionItem.connectionNotFound"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==i?(a=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm text-destructive font-medium truncate",children:i})}),e[2]=i,e[3]=a):a=e[3];let c;e[4]!==s?(c=s("virtualMcp.connectionItem.removeConnection"),e[4]=s,e[5]=c):c=e[5];let r;e[6]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(Tt,{size:13}),e[6]=r):r=e[6];let h;e[7]!==n||e[8]!==c?(h=t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:n,"aria-label":c,children:r})}),e[7]=n,e[8]=c,e[9]=h):h=e[9];let o;e[10]!==s?(o=s("virtualMcp.connectionItem.remove"),e[10]=s,e[11]=o):o=e[11];let m;e[12]!==o?(m=t.jsx(Ne,{side:"bottom",children:o}),e[12]=o,e[13]=m):m=e[13];let f;e[14]!==h||e[15]!==m?(f=t.jsxs(we,{delayDuration:0,children:[h,m]}),e[14]=h,e[15]=m,e[16]=f):f=e[16];let u;return e[17]!==a||e[18]!==f?(u=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 rounded-xl border border-destructive/50 bg-destructive/5",children:[a,f]}),e[17]=a,e[18]=f,e[19]=u):u=e[19],u}function Gs(){const l=H.c(3);let e;l[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx("div",{className:"size-8 rounded-md bg-muted animate-pulse shrink-0"}),l[0]=e):e=l[0];let n;l[1]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[e,t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-48 rounded bg-muted animate-pulse"})]})]}),l[1]=n):n=l[1];let s;return l[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsxs("div",{className:"rounded-xl border border-border overflow-hidden",children:[n,t.jsx("div",{className:"flex items-center px-4 py-2 border-t border-border bg-muted/25",children:t.jsx("div",{className:"h-5 w-20 rounded bg-muted animate-pulse"})})]}),l[2]=s):s=l[2],s}function qs(l){const e=H.c(85),{value:n,onChange:s,onColorChange:i,name:a,size:c,className:r,avatarClassName:h,showHoverOverlay:o,disabled:m}=l,f=c===void 0?"lg":c,u=o===void 0?!0:o,d=m===void 0?!1:m,p=te(),[x,g]=Q.useState(!1),[b,y]=Q.useState("icons"),[j,v]=Q.useState(""),[S,C]=Q.useState("blue");let M;e[0]!==n?(M=Xn(n),e[0]=n,e[1]=M):M=e[1];const w=M,N=w.type==="icon"||w.type==="url"&&w.color?w.color:S;let _;e[2]!==s||e[3]!==N?(_=de=>{s(ht(de,N))},e[2]=s,e[3]=N,e[4]=_):_=e[4];const T=_;let V;e[5]!==s||e[6]!==i||e[7]!==w.name||e[8]!==w.type||e[9]!==w.url?(V=de=>{C(de),i?.(de),w.type==="icon"?s(ht(w.name,de)):w.type==="url"&&s(Yt(w.url,de))},e[5]=s,e[6]=i,e[7]=w.name,e[8]=w.type,e[9]=w.url,e[10]=V):V=e[10];const I=V;let P;e[11]!==s||e[12]!==N?(P=de=>{s(Yt(de,N)),g(!1)},e[11]=s,e[12]=N,e[13]=P):P=e[13];const F=P;let A;e[14]!==s||e[15]!==N?(A=()=>{const de=Cs(),ge=de[Math.floor(Math.random()*de.length)];s(ht(ge,N))},e[14]=s,e[15]=N,e[16]=A):A=e[16];const E=A,L=d?!1:x;let K;e[17]!==p?(K=p("common.iconPicker.changeIcon"),e[17]=p,e[18]=K):K=e[18];const B=d?"cursor-default opacity-50":"cursor-pointer";let Y;e[19]!==r||e[20]!==f||e[21]!==B?(Y=xe("relative group overflow-hidden",B,Jn(f),r),e[19]=r,e[20]=f,e[21]=B,e[22]=Y):Y=e[22];let U;e[23]!==h||e[24]!==a||e[25]!==f||e[26]!==n?(U=t.jsx(Bt,{icon:n,name:a,size:f,className:h}),e[23]=h,e[24]=a,e[25]=f,e[26]=n,e[27]=U):U=e[27];let k;e[28]!==d||e[29]!==u?(k=u&&!d&&t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(si,{size:16,className:"text-white"})}),e[28]=d,e[29]=u,e[30]=k):k=e[30];let $;e[31]!==d||e[32]!==K||e[33]!==Y||e[34]!==U||e[35]!==k?($=t.jsx(Os,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":"icon-picker-trigger","aria-label":K,disabled:d,className:Y,children:[U,k]})}),e[31]=d,e[32]=K,e[33]=Y,e[34]=U,e[35]=k,e[36]=$):$=e[36];let G;e[37]!==a||e[38]!==n?(G=t.jsx("div",{className:"flex items-center justify-center py-4",children:t.jsx(Bt,{icon:n,name:a,size:"xl"})}),e[37]=a,e[38]=n,e[39]=G):G=e[39];let R;e[40]!==b?(R=de=>{if(de.key!=="ArrowLeft"&&de.key!=="ArrowRight")return;de.preventDefault();const ge=b==="icons"?"upload":"icons";y(ge),document.getElementById(`icon-picker-tab-${ge}`)?.focus()},e[40]=b,e[41]=R):R=e[41];const z=b==="icons",W=b==="icons"?0:-1;let X;e[42]===Symbol.for("react.memo_cache_sentinel")?(X=()=>y("icons"),e[42]=X):X=e[42];const ie=b==="icons"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let J;e[43]!==ie?(J=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",ie),e[43]=ie,e[44]=J):J=e[44];let oe;e[45]!==p?(oe=p("common.iconPicker.iconsTab"),e[45]=p,e[46]=oe):oe=e[46];let le;e[47]!==z||e[48]!==W||e[49]!==J||e[50]!==oe?(le=t.jsx("button",{id:"icon-picker-tab-icons",type:"button",role:"tab","aria-selected":z,"aria-controls":"icon-picker-panel-icons",tabIndex:W,onClick:X,className:J,children:oe}),e[47]=z,e[48]=W,e[49]=J,e[50]=oe,e[51]=le):le=e[51];const ce=b==="upload",ee=b==="upload"?0:-1;let ue;e[52]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>y("upload"),e[52]=ue):ue=e[52];const fe=b==="upload"?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground";let pe;e[53]!==fe?(pe=xe("px-3 py-2 text-sm font-medium border-b-2 -mb-px transition-colors",fe),e[53]=fe,e[54]=pe):pe=e[54];let me;e[55]!==p?(me=p("common.iconPicker.uploadTab"),e[55]=p,e[56]=me):me=e[56];let O;e[57]!==ce||e[58]!==ee||e[59]!==pe||e[60]!==me?(O=t.jsx("button",{id:"icon-picker-tab-upload",type:"button",role:"tab","aria-selected":ce,"aria-controls":"icon-picker-panel-upload",tabIndex:ee,onClick:ue,className:pe,children:me}),e[57]=ce,e[58]=ee,e[59]=pe,e[60]=me,e[61]=O):O=e[61];let se;e[62]===Symbol.for("react.memo_cache_sentinel")?(se=t.jsx("div",{className:"flex-1"}),e[62]=se):se=e[62];let q;e[63]!==R||e[64]!==le||e[65]!==O?(q=t.jsxs("div",{role:"tablist","aria-label":"Icon source",className:"flex items-center border-b border-border px-3",onKeyDown:R,children:[le,O,se]}),e[63]=R,e[64]=le,e[65]=O,e[66]=q):q=e[66];let D;e[67]!==I||e[68]!==E||e[69]!==T||e[70]!==F||e[71]!==w.name||e[72]!==w.type||e[73]!==j||e[74]!==N||e[75]!==b?(D=b==="icons"?t.jsx("div",{id:"icon-picker-panel-icons",role:"tabpanel","aria-labelledby":"icon-picker-tab-icons",children:t.jsx(ba,{search:j,onSearchChange:v,selectedColor:N,onColorChange:I,onSelectIcon:T,onRandom:E,currentIconName:w.type==="icon"?w.name:null})}):t.jsx("div",{id:"icon-picker-panel-upload",role:"tabpanel","aria-labelledby":"icon-picker-tab-upload",children:t.jsx(ja,{onUpload:F})}),e[67]=I,e[68]=E,e[69]=T,e[70]=F,e[71]=w.name,e[72]=w.type,e[73]=j,e[74]=N,e[75]=b,e[76]=D):D=e[76];let Z;e[77]!==G||e[78]!==q||e[79]!==D?(Z=t.jsx(Is,{align:"start",className:"w-80 p-0",onOpenAutoFocus:xa,children:t.jsxs("div",{className:"flex flex-col",children:[G,q,D]})}),e[77]=G,e[78]=q,e[79]=D,e[80]=Z):Z=e[80];let he;return e[81]!==$||e[82]!==Z||e[83]!==L?(he=t.jsxs(As,{open:L,onOpenChange:g,children:[$,Z]}),e[81]=$,e[82]=Z,e[83]=L,e[84]=he):he=e[84],he}function xa(l){return l.preventDefault()}function ga(l){const e=H.c(33),{selectedColor:n,onColorChange:s}=l,i=te(),[a,c]=Q.useState(!1);let r,h,o,m,f,u,d;if(e[0]!==a||e[1]!==n){const S=Ms(n);h=As,u=a,d=c,r=Os,f=!0,o="button",m=xe("h-6 w-6 rounded-full shrink-0 ring-2 ring-offset-2 ring-offset-background transition-all cursor-pointer hover:scale-110",S.dot,"ring-foreground/20"),e[0]=a,e[1]=n,e[2]=r,e[3]=h,e[4]=o,e[5]=m,e[6]=f,e[7]=u,e[8]=d}else r=e[2],h=e[3],o=e[4],m=e[5],f=e[6],u=e[7],d=e[8];let p;e[9]!==i?(p=i("common.iconPicker.changeColor"),e[9]=i,e[10]=p):p=e[10];let x;e[11]!==i?(x=i("common.iconPicker.changeColor"),e[11]=i,e[12]=x):x=e[12];let g;e[13]!==o||e[14]!==m||e[15]!==p||e[16]!==x?(g=t.jsx("button",{type:o,className:m,title:p,"aria-label":x}),e[13]=o,e[14]=m,e[15]=p,e[16]=x,e[17]=g):g=e[17];let b;e[18]!==r||e[19]!==f||e[20]!==g?(b=t.jsx(r,{asChild:f,children:g}),e[18]=r,e[19]=f,e[20]=g,e[21]=b):b=e[21];let y;e[22]!==s||e[23]!==n?(y=ii.map(S=>t.jsx("button",{type:"button",onClick:()=>{s(S.name),c(!1)},className:xe("h-5 w-5 rounded-full transition-all shrink-0 cursor-pointer",S.dot,n===S.name?"ring-2 ring-offset-1 ring-offset-background ring-foreground/30 scale-110":"hover:scale-110"),title:S.name,"aria-label":S.name},S.name)),e[22]=s,e[23]=n,e[24]=y):y=e[24];let j;e[25]!==y?(j=t.jsx(Is,{align:"start",side:"right",sideOffset:8,className:"w-auto p-2",onOpenAutoFocus:va,children:t.jsx("div",{className:"grid grid-cols-4 gap-1",children:y})}),e[25]=y,e[26]=j):j=e[26];let v;return e[27]!==h||e[28]!==j||e[29]!==u||e[30]!==d||e[31]!==b?(v=t.jsxs(h,{open:u,onOpenChange:d,children:[b,j]}),e[27]=h,e[28]=j,e[29]=u,e[30]=d,e[31]=b,e[32]=v):v=e[32],v}function va(l){return l.preventDefault()}function ba(l){const e=H.c(55),{search:n,onSearchChange:s,selectedColor:i,onColorChange:a,onSelectIcon:c,onRandom:r,currentIconName:h}=l,o=te();let m,f,u,d,p,x,g;if(e[0]!==h||e[1]!==a||e[2]!==r||e[3]!==s||e[4]!==c||e[5]!==n||e[6]!==i||e[7]!==o){const S=Cs(),C=Ms(i);f=Zn(S,n),x="flex flex-col";let M;e[15]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(jt,{size:14,className:"absolute left-2 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"}),e[15]=M):M=e[15];let w;e[16]!==s?(w=A=>s(A.target.value),e[16]=s,e[17]=w):w=e[17];let N;e[18]!==o?(N=o("common.iconPicker.filterPlaceholder"),e[18]=o,e[19]=N):N=e[19];let _;e[20]!==n||e[21]!==w||e[22]!==N?(_=t.jsxs("div",{className:"relative flex-1",children:[M,t.jsx(Ce,{value:n,onChange:w,placeholder:N,className:"h-8 text-xs pl-7"})]}),e[20]=n,e[21]=w,e[22]=N,e[23]=_):_=e[23];let T;e[24]!==o?(T=o("common.iconPicker.randomIcon"),e[24]=o,e[25]=T):T=e[25];let V;e[26]!==o?(V=o("common.iconPicker.randomIcon"),e[26]=o,e[27]=V):V=e[27];let I;e[28]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(ni,{size:14,className:"text-muted-foreground"}),e[28]=I):I=e[28];let P;e[29]!==r||e[30]!==T||e[31]!==V?(P=t.jsx("button",{type:"button",onClick:r,className:"h-8 w-8 flex items-center justify-center rounded-lg border border-border hover:bg-accent transition-colors shrink-0",title:T,"aria-label":V,children:I}),e[29]=r,e[30]=T,e[31]=V,e[32]=P):P=e[32];let F;e[33]!==a||e[34]!==i?(F=t.jsx(ga,{selectedColor:i,onColorChange:a}),e[33]=a,e[34]=i,e[35]=F):F=e[35],e[36]!==P||e[37]!==F||e[38]!==_?(g=t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[_,P,F]}),e[36]=P,e[37]=F,e[38]=_,e[39]=g):g=e[39],m=Ni,p="h-56",u="grid grid-cols-9 gap-0.5 px-2 pb-2",d=f.map(A=>{const E=ei(A);return E?t.jsx("button",{type:"button",onClick:()=>c(A),className:xe("h-8 w-8 flex items-center justify-center rounded-lg transition-colors cursor-pointer",h===A?xe(C.bg,C.text):xe(C.text,"hover:bg-accent")),title:A,"aria-label":ti(A),children:t.jsx(E,{size:18})},A):null}),e[0]=h,e[1]=a,e[2]=r,e[3]=s,e[4]=c,e[5]=n,e[6]=i,e[7]=o,e[8]=m,e[9]=f,e[10]=u,e[11]=d,e[12]=p,e[13]=x,e[14]=g}else m=e[8],f=e[9],u=e[10],d=e[11],p=e[12],x=e[13],g=e[14];let b;e[40]!==u||e[41]!==d?(b=t.jsx("div",{className:u,children:d}),e[40]=u,e[41]=d,e[42]=b):b=e[42];let y;e[43]!==f.length||e[44]!==o?(y=f.length===0&&t.jsx("div",{className:"flex items-center justify-center py-8 text-sm text-muted-foreground",children:o("common.iconPicker.noIconsFound")}),e[43]=f.length,e[44]=o,e[45]=y):y=e[45];let j;e[46]!==m||e[47]!==p||e[48]!==b||e[49]!==y?(j=t.jsxs(m,{className:p,children:[b,y]}),e[46]=m,e[47]=p,e[48]=b,e[49]=y,e[50]=j):j=e[50];let v;return e[51]!==x||e[52]!==g||e[53]!==j?(v=t.jsxs("div",{className:x,children:[g,j]}),e[51]=x,e[52]=g,e[53]=j,e[54]=v):v=e[54],v}function ja(l){const e=H.c(46),{onUpload:n}=l,s=te(),i=Q.useRef(null);let a;e[0]!==n||e[1]!==s?(a=P=>{const F=P.target.files?.[0];if(!F)return;if(F.size>2097152){re.error(s("common.iconPicker.imageTooLarge")),P.target.value="";return}const A=new FileReader;A.onerror=()=>{re.error(s("common.iconPicker.failedToReadImage")),i.current&&(i.current.value="")},A.onloadend=()=>{A.readyState===FileReader.DONE&&A.result&&n(A.result),i.current&&(i.current.value="")},A.readAsDataURL(F)},e[0]=n,e[1]=s,e[2]=a):a=e[2];const c=a,[r,h]=Q.useState("");let o;e[3]!==n||e[4]!==r?(o=()=>{const P=r.trim();P&&(n(P),h(""))},e[3]=n,e[4]=r,e[5]=o):o=e[5];const m=o;let f;e[6]!==c?(f=t.jsx("input",{type:"file",ref:i,className:"hidden",accept:"image/*",onChange:c}),e[6]=c,e[7]=f):f=e[7];let u;e[8]===Symbol.for("react.memo_cache_sentinel")?(u=()=>i.current?.click(),e[8]=u):u=e[8];let d;e[9]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ci,{size:20}),e[9]=d):d=e[9];let p;e[10]!==s?(p=s("common.iconPicker.uploadHint"),e[10]=s,e[11]=p):p=e[11];let x;e[12]!==p?(x=t.jsxs("button",{type:"button",onClick:u,className:"h-24 rounded-lg border-2 border-dashed border-border hover:border-foreground/50 hover:bg-accent/50 transition-colors flex flex-col items-center justify-center gap-2 text-muted-foreground hover:text-foreground",children:[d,t.jsx("span",{className:"text-xs",children:p})]}),e[12]=p,e[13]=x):x=e[13];let g;e[14]!==s?(g=s("common.iconPicker.or"),e[14]=s,e[15]=g):g=e[15];let b;e[16]!==g?(b=t.jsx("span",{className:"text-xs text-muted-foreground",children:g}),e[16]=g,e[17]=b):b=e[17];let y;e[18]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx("div",{className:"flex-1 h-px bg-border"}),e[18]=y):y=e[18];let j;e[19]!==b?(j=t.jsxs("div",{className:"flex items-center gap-2",children:[b,y]}),e[19]=b,e[20]=j):j=e[20];let v;e[21]===Symbol.for("react.memo_cache_sentinel")?(v=P=>h(P.target.value),e[21]=v):v=e[21];let S;e[22]!==s?(S=s("common.iconPicker.pasteUrlPlaceholder"),e[22]=s,e[23]=S):S=e[23];let C;e[24]!==m?(C=P=>{P.key==="Enter"&&(P.preventDefault(),m())},e[24]=m,e[25]=C):C=e[25];let M;e[26]!==r||e[27]!==S||e[28]!==C?(M=t.jsx(Ce,{value:r,onChange:v,placeholder:S,className:"h-8 text-xs flex-1",onKeyDown:C}),e[26]=r,e[27]=S,e[28]=C,e[29]=M):M=e[29];let w;e[30]!==r?(w=r.trim(),e[30]=r,e[31]=w):w=e[31];const N=!w;let _;e[32]!==s?(_=s("common.iconPicker.apply"),e[32]=s,e[33]=_):_=e[33];let T;e[34]!==m||e[35]!==N||e[36]!==_?(T=t.jsx(ne,{variant:"outline",size:"sm",className:"h-8 px-3 text-xs shrink-0",onClick:m,disabled:N,children:_}),e[34]=m,e[35]=N,e[36]=_,e[37]=T):T=e[37];let V;e[38]!==M||e[39]!==T?(V=t.jsxs("div",{className:"flex items-center gap-1.5",children:[M,T]}),e[38]=M,e[39]=T,e[40]=V):V=e[40];let I;return e[41]!==j||e[42]!==V||e[43]!==f||e[44]!==x?(I=t.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[f,x,j,V]}),e[41]=j,e[42]=V,e[43]=f,e[44]=x,e[45]=I):I=e[45],I}function ya(l){const e=H.c(11),{viewId:n}=l;if(n==="overview"){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ks,{size:16}),e[0]=i):i=e[0],i}if(n==="reports"){let i;return e[1]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{size:16}),e[1]=i):i=e[1],i}if(n==="board"){let i;return e[2]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(li,{size:16}),e[2]=i):i=e[2],i}if(n==="site-editor"){let i;return e[3]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(_i,{size:16}),e[3]=i):i=e[3],i}if(n==="assets"){let i;return e[4]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ki,{size:16}),e[4]=i):i=e[4],i}if(n==="releases"){let i;return e[5]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ai,{size:16}),e[5]=i):i=e[5],i}if(n==="hosting"){let i;return e[6]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(sn,{size:16}),e[6]=i):i=e[6],i}if(n==="e2e"){let i;return e[7]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(ri,{size:16}),e[7]=i):i=e[7],i}if(n==="analytics"){let i;return e[8]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(Wt,{size:16}),e[8]=i):i=e[8],i}if(n==="cdn"){let i;return e[9]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx(oi,{size:16}),e[9]=i):i=e[9],i}let s;return e[10]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(_s,{size:16}),e[10]=s):s=e[10],s}function rs(l){const e=H.c(51),{pinned:n,canSetMainView:s,onOpen:i,onTogglePin:a,onSetMainView:c}=l,r=te(),h=n?"text-foreground":"text-muted-foreground/40";let o;e[0]!==h?(o=xe("size-7",h),e[0]=h,e[1]=o):o=e[1];let m;e[2]!==n||e[3]!==r?(m=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[2]=n,e[3]=r,e[4]=m):m=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Kt,{size:16}),e[5]=f):f=e[5];let u;e[6]!==a||e[7]!==n||e[8]!==o||e[9]!==m?(u=t.jsx(Se,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:o,"aria-label":m,"aria-pressed":n,onClick:a,children:f})}),e[6]=a,e[7]=n,e[8]=o,e[9]=m,e[10]=u):u=e[10];let d;e[11]!==n||e[12]!==r?(d=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[11]=n,e[12]=r,e[13]=d):d=e[13];let p;e[14]!==d?(p=t.jsx(Ne,{side:"top",children:d}),e[14]=d,e[15]=p):p=e[15];let x;e[16]!==u||e[17]!==p?(x=t.jsxs(we,{delayDuration:0,children:[u,p]}),e[16]=u,e[17]=p,e[18]=x):x=e[18];let g;e[19]!==r?(g=r("virtualMcp.settings.views.rowActions"),e[19]=r,e[20]=g):g=e[20];let b;e[21]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(Mi,{size:16}),e[21]=b):b=e[21];let y;e[22]!==g?(y=t.jsx(ps,{asChild:!0,children:t.jsx(ne,{variant:"ghost",size:"icon",className:"size-7 text-muted-foreground","aria-label":g,children:b})}),e[22]=g,e[23]=y):y=e[23];let j;e[24]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(nn,{size:14}),e[24]=j):j=e[24];let v;e[25]!==r?(v=r("virtualMcp.settings.views.open"),e[25]=r,e[26]=v):v=e[26];let S;e[27]!==i||e[28]!==v?(S=t.jsxs(We,{onClick:i,children:[j,v]}),e[27]=i,e[28]=v,e[29]=S):S=e[29];let C;e[30]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(Kt,{size:14}),e[30]=C):C=e[30];let M;e[31]!==n||e[32]!==r?(M=r(n?"virtualMcp.settings.views.unpin":"virtualMcp.settings.views.pin"),e[31]=n,e[32]=r,e[33]=M):M=e[33];let w;e[34]!==a||e[35]!==M?(w=t.jsxs(We,{onClick:a,children:[C,M]}),e[34]=a,e[35]=M,e[36]=w):w=e[36];let N;e[37]!==s||e[38]!==c||e[39]!==r?(N=s&&t.jsxs(We,{onClick:c,children:[t.jsx(ks,{size:14}),r("virtualMcp.settings.views.setMainView")]}),e[37]=s,e[38]=c,e[39]=r,e[40]=N):N=e[40];let _;e[41]!==S||e[42]!==w||e[43]!==N?(_=t.jsxs(hs,{align:"end",children:[S,w,N]}),e[41]=S,e[42]=w,e[43]=N,e[44]=_):_=e[44];let T;e[45]!==y||e[46]!==_?(T=t.jsxs(fs,{children:[y,_]}),e[45]=y,e[46]=_,e[47]=T):T=e[47];let V;return e[48]!==T||e[49]!==x?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[x,T]}),e[48]=T,e[49]=x,e[50]=V):V=e[50],V}const os=l=>l.stopPropagation();function wa(l){const e=H.c(8),{icon:n,title:s}=l;let i;e[0]!==n||e[1]!==s?(i=t.jsx(He,{icon:n,name:s,size:"xs",className:"shrink-0"}),e[0]=n,e[1]=s,e[2]=i):i=e[2];let a;e[3]!==s?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:s}),e[3]=s,e[4]=a):a=e[4];let c;return e[5]!==i||e[6]!==a?(c=t.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-muted/30",children:[i,a]}),e[5]=i,e[6]=a,e[7]=c):c=e[7],c}function Sa(l){const e=H.c(70),{views:n}=l,s=te();let i;e[0]!==s?(i=s("virtualMcp.settings.views.defaults"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==s?(a=s("virtualMcp.layoutTabContent.mainView"),e[2]=s,e[3]=a):a=e[3];let c;e[4]!==s?(c=s("virtualMcp.layoutTabContent.mainViewDescription"),e[4]=s,e[5]=c):c=e[5];const r=n.defaultMainView,h=n.setMainView;let o;e[6]!==s?(o=s("virtualMcp.layoutTabContent.mainView"),e[6]=s,e[7]=o):o=e[7];let m;e[8]!==s?(m=s("virtualMcp.layoutTabContent.noMainView"),e[8]=s,e[9]=m):m=e[9];let f;e[10]!==m?(f=t.jsx(Pe,{placeholder:m}),e[10]=m,e[11]=f):f=e[11];let u;e[12]!==o||e[13]!==f?(u=t.jsx(De,{"aria-label":o,className:"w-36 h-8 text-sm shrink-0 @min-xl/project-settings:w-44",children:f}),e[12]=o,e[13]=f,e[14]=u):u=e[14];let d;e[15]!==n.defaultMainOptions?(d=n.defaultMainOptions.map(Na),e[15]=n.defaultMainOptions,e[16]=d):d=e[16];let p;e[17]!==d?(p=t.jsx(Oe,{children:d}),e[17]=d,e[18]=p):p=e[18];let x;e[19]!==p||e[20]!==u||e[21]!==n.defaultMainView||e[22]!==n.setMainView?(x=t.jsxs(Ie,{value:r,onValueChange:h,children:[u,p]}),e[19]=p,e[20]=u,e[21]=n.defaultMainView,e[22]=n.setMainView,e[23]=x):x=e[23];let g;e[24]!==x||e[25]!==a||e[26]!==c?(g=t.jsx(Xe,{title:a,description:c,action:x}),e[24]=x,e[25]=a,e[26]=c,e[27]=g):g=e[27];let b;e[28]!==s?(b=s("virtualMcp.layoutTabContent.showChat"),e[28]=s,e[29]=b):b=e[29];let y;e[30]!==s?(y=s("virtualMcp.layoutTabContent.showChatDescription"),e[30]=s,e[31]=y):y=e[31];let j;e[32]!==s?(j=s("virtualMcp.layoutTabContent.showChat"),e[32]=s,e[33]=j):j=e[33];const v=n.noMainView?!0:n.chatDefaultOpen;let S;e[34]!==j||e[35]!==v||e[36]!==n.noMainView||e[37]!==n.setChatDefaultOpen?(S=t.jsx(Se,{asChild:!0,children:t.jsx("span",{className:"shrink-0",children:t.jsx(dt,{"aria-label":j,checked:v,disabled:n.noMainView,onCheckedChange:n.setChatDefaultOpen})})}),e[34]=j,e[35]=v,e[36]=n.noMainView,e[37]=n.setChatDefaultOpen,e[38]=S):S=e[38];let C;e[39]!==s||e[40]!==n.noMainView?(C=n.noMainView&&t.jsx(Ne,{side:"top",children:s("virtualMcp.layoutTabContent.chatAlwaysShown")}),e[39]=s,e[40]=n.noMainView,e[41]=C):C=e[41];let M;e[42]!==S||e[43]!==C?(M=t.jsxs(we,{delayDuration:0,children:[S,C]}),e[42]=S,e[43]=C,e[44]=M):M=e[44];let w;e[45]!==b||e[46]!==y||e[47]!==M?(w=t.jsx(Xe,{title:b,description:y,action:M}),e[45]=b,e[46]=y,e[47]=M,e[48]=w):w=e[48];let N;e[49]!==g||e[50]!==w?(N=t.jsxs(Fe,{children:[g,w]}),e[49]=g,e[50]=w,e[51]=N):N=e[51];let _;e[52]!==i||e[53]!==N?(_=t.jsx(Ue,{title:i,children:N}),e[52]=i,e[53]=N,e[54]=_):_=e[54];let T;e[55]!==s?(T=s("virtualMcp.settings.views.sidebar"),e[55]=s,e[56]=T):T=e[56];let V;e[57]!==n?(V=n.projectViews.map(E=>{const L=n.pinned(E);return t.jsx(Xe,{icon:t.jsx(ya,{viewId:E}),title:n.labels[E],onClick:()=>n.openView(E),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(rs,{pinned:L,canSetMainView:L&&!n.isMainView(E),onOpen:()=>n.openView(E),onTogglePin:()=>n.togglePin(E,!L),onSetMainView:()=>n.setMainView(E)}),t.jsx("span",{onClick:()=>n.openView(E),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Rt,{size:16})})]})},E)}),e[57]=n,e[58]=V):V=e[58];let I;e[59]!==n?(I=n.connectionsData.flatMap(E=>[t.jsx(wa,{icon:E.icon,title:E.title},`${E.id}:header`),...E.uiTools.map(L=>{const K=n.pinnedAppViews.find(k=>k.connectionId===E.id&&k.toolName===L.name),B=!!K,Y=ln(E.id,L.name),U=`ext-apps:${E.id}:${L.name}`;return t.jsx(Xe,{onClick:()=>n.openView(Y),icon:B?t.jsx("span",{onClick:os,children:t.jsx(qs,{value:K.icon??null,name:K.label||L.name,size:"xs",showHoverOverlay:!1,onChange:k=>n.setAppViewIcon(E.id,L.name,k)})}):t.jsx(_s,{size:16}),title:B?t.jsx("span",{onClick:os,children:t.jsx(Ce,{value:K.label,onChange:k=>n.setAppViewLabel(E.id,L.name,k.target.value),onBlur:n.commitAppViewLabel,"aria-label":L.title??yt(L.name),className:"h-7 w-full max-w-52 text-sm"})}):L.title??yt(L.name),action:t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx(rs,{pinned:B,canSetMainView:B&&!n.isMainView(U),onOpen:()=>n.openView(Y),onTogglePin:()=>n.toggleAppViewPin(E.id,L.name),onSetMainView:()=>n.setMainView(U)}),t.jsx("span",{onClick:()=>n.openView(Y),className:"flex cursor-pointer items-center text-muted-foreground",children:t.jsx(Rt,{size:16})})]})},`${E.id}:${L.name}`)})]),e[59]=n,e[60]=I):I=e[60];let P;e[61]!==V||e[62]!==I?(P=t.jsxs(Fe,{children:[V,I]}),e[61]=V,e[62]=I,e[63]=P):P=e[63];let F;e[64]!==T||e[65]!==P?(F=t.jsx(Ue,{title:T,children:P}),e[64]=T,e[65]=P,e[66]=F):F=e[66];let A;return e[67]!==_||e[68]!==F?(A=t.jsxs(t.Fragment,{children:[_,F]}),e[67]=_,e[68]=F,e[69]=A):A=e[69],A}function Na(l){return t.jsx(ye,{value:l.value,children:l.label},l.value)}const Hs="site-editor",Ca=new Set([Hs,"content"]);function Ma({virtualMcpId:l,form:e,flushAndSave:n}){const s=te(),i=Ct(),{openPanel:a}=zi(),c=Ss(l),r=Ti(c),h=Fs(l),o=Ri(l),m=(c?.connections??[]).map(k=>k.connection_id).sort(),{data:f}=vs({queryKey:Mt.projectConnectionDetails(l,m),enabled:m.length>0,queryFn:async()=>await Promise.all(m.map(async $=>{try{const{item:G}=await i.call("COLLECTION_CONNECTIONS_GET",{id:$}),R=(G?.tools??[]).flatMap(z=>{const W=Vi(z._meta);return W?[{name:z.name,title:z.title,description:z.description,resourceUri:W}]:[]});return{fetchOk:!0,id:$,title:G?.title??$,icon:G?.icon??null,uiTools:R}}catch{return{fetchOk:!1,id:$,title:$,icon:null,uiTools:[]}}}))}),u=(f??[]).filter(k=>k.uiTools.length>0),d=new Set([...an,...rn]),p=e.watch("metadata.ui.pinnedViews")??[],x=e.watch("metadata.ui.layout")??null,g=x?.defaultMainView??null,b=x?.chatDefaultOpen??!1,y=wt(St({sidebarViews:e.watch("metadata.sidebarViews"),ui:{layout:x}}),e.watch("metadata.sidebarViewsVersion")),j=o??(c?wt(St(c.metadata),c.metadata.sidebarViewsVersion):y),v=(()=>{if(!g||g.type==="chat")return"";const k=on(g.type);return k==="instructions"||k==="connections"||k==="layout"?"settings":Ca.has(k)?Hs:d.has(k)?k:`${k}:${g.id??""}:${g.toolName??""}`})(),S=v==="",C=k=>{const[$,G,R]=k.split(":");return $?d.has($)?{type:$}:$==="ext-apps"&&G?{type:"ext-apps",id:G,toolName:R||void 0}:null:null},M=k=>{e.setValue("metadata.ui.pinnedViews",k,{shouldDirty:!0})},w=k=>{e.setValue("metadata.ui.layout",{...x,...k},{shouldDirty:!0})},N=Q.useRef(!1);if(f&&f.length>0&&!N.current){N.current=!0;const k=new Set((f??[]).filter(z=>z.fetchOk).map(z=>z.id)),$=new Set(u.flatMap(z=>z.uiTools.map(W=>`${z.id}:${W.name}`))),G=new Set(m),R=p.filter(z=>G.has(z.connectionId)&&(!k.has(z.connectionId)||$.has(`${z.connectionId}:${z.toolName}`)));R.length!==p.length&&(M(R),g?.type==="ext-apps"&&!R.some(z=>z.connectionId===g.id&&z.toolName===g.toolName)&&w({defaultMainView:{type:"settings"}}))}const _=(k,$)=>{if(p.some(R=>R.connectionId===k&&R.toolName===$)){const R=p.filter(W=>!(W.connectionId===k&&W.toolName===$));M(R);const z=`ext-apps:${k}:${$}`;v===z&&w({defaultMainView:{type:"settings"}})}else{const R=u.find(z=>z.id===k)?.uiTools.find(z=>z.name===$)?.title;M([...p,{connectionId:k,toolName:$,label:R??yt($),icon:null}])}n()},T=(k,$,G)=>{M(p.map(R=>R.connectionId===k&&R.toolName===$?{...R,label:G}:R))},V=()=>{n()},I=(k,$,G)=>{M(p.map(R=>R.connectionId===k&&R.toolName===$?{...R,icon:G}:R)),n()},P=k=>{w({defaultMainView:C(k)}),n()},F=(k,$)=>{const G=Ii(j,k,$,1);e.setValue("metadata.sidebarViews",G,{shouldDirty:!0}),e.setValue("metadata.sidebarViewsVersion",1,{shouldDirty:!0}),h.stage(G,j);const R=Ai(g,k,$);R!==g&&w({defaultMainView:R})},A=$s(c?.metadata),E=Di(A,r.presence),L=Pi(E),K=Oi(j,E,1),B={overview:s("sidebar.navDestinations.home"),reports:s("sidebar.navDestinations.reports"),board:s("sidebar.navDestinations.tasks"),"site-editor":s("virtualMcp.layoutTabContent.siteEditor"),assets:s("common.mainPanelTabs.assets"),releases:s("common.mainPanelTabs.releases"),hosting:s("common.mainPanelTabs.hosting"),e2e:s("common.mainPanelTabs.e2e"),analytics:s("common.mainPanelTabs.analytics"),cdn:s("common.mainPanelTabs.cdn"),automations:s("virtualMcp.layoutTabContent.automations"),experiments:s("experiments.title")},Y=[];for(const k of K)k!=="automations"&&Y.push({value:k,label:B[k]});for(const k of p)Y.push({value:`ext-apps:${k.connectionId}:${k.toolName}`,label:k.label||k.toolName});return K.includes("automations")&&Y.push({value:"automations",label:B.automations}),Y.push({value:"settings",label:s("virtualMcp.layoutTabContent.settings")}),{projectViews:L,labels:B,pinned:k=>j.includes(k),isMainView:k=>v===k,defaultMainView:v,defaultMainOptions:Y,noMainView:S,chatDefaultOpen:b,connectionsData:u,pinnedAppViews:p,openView:k=>a(k,{virtualmcpid:l}),togglePin:(k,$)=>F(k,$),setMainView:P,setChatDefaultOpen:k=>{w({chatDefaultOpen:k}),n()},toggleAppViewPin:_,setAppViewIcon:I,setAppViewLabel:T,commitAppViewLabel:V}}function ka(l){const e=H.c(55),{form:n,onCommit:s}=l,i=te(),a=Q.useId();let c;e[0]!==i?(c=i("virtualMcp.settings.identity.icon"),e[0]=i,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx("p",{className:"text-sm font-medium",children:c}),e[2]=c,e[3]=r):r=e[3];let h;e[4]!==i?(h=i("virtualMcp.settings.identity.iconDescription"),e[4]=i,e[5]=h):h=e[5];let o;e[6]!==h?(o=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:h}),e[6]=h,e[7]=o):o=e[7];let m;e[8]!==r||e[9]!==o?(m=t.jsxs("div",{children:[r,o]}),e[8]=r,e[9]=o,e[10]=m):m=e[10];let f;e[11]!==n||e[12]!==s||e[13]!==i?(f=T=>{const{field:V}=T;return t.jsx("div",{className:"justify-self-start",children:t.jsx(qs,{value:V.value??null,onChange:I=>{V.onChange(I),s()},onColorChange:I=>{n.setValue("metadata.ui.themeColor",I,{shouldDirty:!0}),s()},name:n.watch("title")||i("virtualMcp.virtualMcp.agentNameFallback"),size:"md",avatarClassName:"[&_svg]:w-1/2 [&_svg]:h-1/2"})})},e[11]=n,e[12]=s,e[13]=i,e[14]=f):f=e[14];let u;e[15]!==n.control||e[16]!==f?(u=t.jsx(ve,{name:"icon",control:n.control,render:f}),e[15]=n.control,e[16]=f,e[17]=u):u=e[17];let d;e[18]!==m||e[19]!==u?(d=t.jsxs(be,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[m,u]}),e[18]=m,e[19]=u,e[20]=d):d=e[20];const p=`${a}-name`;let x;e[21]!==i?(x=i("virtualMcp.settings.identity.name"),e[21]=i,e[22]=x):x=e[22];let g;e[23]!==x||e[24]!==p?(g=t.jsx("label",{htmlFor:p,className:"text-sm font-medium",children:x}),e[23]=x,e[24]=p,e[25]=g):g=e[25];let b;e[26]!==a||e[27]!==s||e[28]!==i?(b=T=>{const{field:V}=T;return t.jsx(Ce,{...V,id:`${a}-name`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.agentNamePlaceholder")})},e[26]=a,e[27]=s,e[28]=i,e[29]=b):b=e[29];let y;e[30]!==n.control||e[31]!==b?(y=t.jsx(ve,{name:"title",control:n.control,render:b}),e[30]=n.control,e[31]=b,e[32]=y):y=e[32];let j;e[33]!==g||e[34]!==y?(j=t.jsxs(be,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[g,y]}),e[33]=g,e[34]=y,e[35]=j):j=e[35];const v=`${a}-description`;let S;e[36]!==i?(S=i("virtualMcp.settings.identity.description"),e[36]=i,e[37]=S):S=e[37];let C;e[38]!==v||e[39]!==S?(C=t.jsx("label",{htmlFor:v,className:"text-sm font-medium",children:S}),e[38]=v,e[39]=S,e[40]=C):C=e[40];let M;e[41]!==a||e[42]!==s||e[43]!==i?(M=T=>{const{field:V}=T;return t.jsx(at,{...V,id:`${a}-description`,value:V.value??"",onBlur:()=>{V.onBlur(),s()},placeholder:i("virtualMcp.virtualMcp.descriptionPlaceholder"),className:"min-h-24 resize-y"})},e[41]=a,e[42]=s,e[43]=i,e[44]=M):M=e[44];let w;e[45]!==n.control||e[46]!==M?(w=t.jsx(ve,{name:"description",control:n.control,render:M}),e[45]=n.control,e[46]=M,e[47]=w):w=e[47];let N;e[48]!==C||e[49]!==w?(N=t.jsxs(be,{className:"grid gap-3 @min-xl/project-settings:grid-cols-[180px_minmax(0,1fr)] @min-xl/project-settings:gap-8",children:[C,w]}),e[48]=C,e[49]=w,e[50]=N):N=e[50];let _;return e[51]!==j||e[52]!==N||e[53]!==d?(_=t.jsxs(Fe,{children:[d,j,N]}),e[51]=j,e[52]=N,e[53]=d,e[54]=_):_=e[54],_}const Qs=["general","connections","site"],_a={general:{icon:di,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},connections:{icon:Wi,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},site:{icon:ci,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function Va(l){return!!l&&Qs.includes(l)}function Ta(l){const e=H.c(8),{section:n}=l,s=te();let i;e[0]!==s?(i=s("virtualMcp.settings.navigation"),e[0]=s,e[1]=i):i=e[1];let a;e[2]!==n||e[3]!==s?(a=Qs.map(r=>{const{titleKey:h}=_a[r];return t.jsx(Re.Tab,{active:n===r,asChild:!0,children:t.jsx(gs,{to:".",activeOptions:{exact:!0,explicitUndefined:!0},search:o=>({...o,section:r==="general"?void 0:r}),children:s(h)})},r)}),e[2]=n,e[3]=s,e[4]=a):a=e[4];let c;if(e[5]!==i||e[6]!==a){const r=t.jsx(Re.Tabs,{"aria-label":i,children:a});c=t.jsx(cn.Toolbar.Left.Portal,{fallback:r,children:r}),e[5]=i,e[6]=a,e[7]=c}else c=e[7];return c}function Da(){const l=H.c(8),e=kt();let n;l[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},l[0]=n):n=l[0];const{section:s}=dn(n);let i;l[1]!==s?(i=Va(s)?s:"general",l[1]=s,l[2]=i):i=l[2];let a;l[3]!==e?(a=r=>e({to:".",search:h=>({...h,section:r??void 0})}),l[3]=e,l[4]=a):a=l[4];let c;return l[5]!==i||l[6]!==a?(c={section:i,openSection:a},l[5]=i,l[6]=a,l[7]=c):c=l[7],c}function Xs(l){const e=H.c(20),{value:n,label:s,copiedLabel:i,variant:a,size:c,className:r,copiedClassName:h}=l,o=a===void 0?"ghost":a,m=c===void 0?"icon-sm":c,{handleCopy:f,copied:u}=Gi();let d;e[0]!==f||e[1]!==n?(d=()=>{f(n).catch(Pa)},e[0]=f,e[1]=n,e[2]=d):d=e[2];const p=u&&h;let x;e[3]!==r||e[4]!==p?(x=xe(r,p),e[3]=r,e[4]=p,e[5]=x):x=e[5];let g;e[6]!==u?(g=u?t.jsx(nt,{className:"text-success"}):t.jsx(ut,{}),e[6]=u,e[7]=g):g=e[7];let b;e[8]!==s||e[9]!==m||e[10]!==d||e[11]!==x||e[12]!==g||e[13]!==o?(b=t.jsx(ne,{type:"button",variant:o,size:m,"aria-label":s,onClick:d,className:x,children:g}),e[8]=s,e[9]=m,e[10]=d,e[11]=x,e[12]=g,e[13]=o,e[14]=b):b=e[14];const y=u?i:"";let j;e[15]!==y?(j=t.jsx("span",{className:"sr-only","aria-live":"polite",children:y}),e[15]=y,e[16]=j):j=e[16];let v;return e[17]!==b||e[18]!==j?(v=t.jsxs(t.Fragment,{children:[b,j]}),e[17]=b,e[18]=j,e[19]=v):v=e[19],v}function Pa(){}function Oa(l){const e=H.c(14),{id:n,value:s,copyLabel:i,copiedLabel:a,className:c}=l;let r;e[0]!==c?(r=xe("relative h-fit",c),e[0]=c,e[1]=r):r=e[1];let h;e[2]!==n||e[3]!==s?(h=t.jsx(Ce,{id:n,value:s,readOnly:!0,disabled:!0,className:"pr-10 font-mono"}),e[2]=n,e[3]=s,e[4]=h):h=e[4];let o;e[5]===Symbol.for("react.memo_cache_sentinel")?(o=xe("absolute top-1/2 right-1 -translate-y-1/2 transition-opacity","opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 focus-visible:opacity-100 pointer-coarse:opacity-100"),e[5]=o):o=e[5];let m;e[6]!==a||e[7]!==i||e[8]!==s?(m=t.jsx(Xs,{value:s,label:i,copiedLabel:a,className:o,copiedClassName:"opacity-100"}),e[6]=a,e[7]=i,e[8]=s,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==h||e[12]!==m?(f=t.jsxs("div",{className:r,children:[h,m]}),e[10]=r,e[11]=h,e[12]=m,e[13]=f):f=e[13],f}async function cs(l){const e=await l.json().catch(()=>({}));if(!l.ok)throw new Error(e.error??`HTTP ${l.status}`);return e}function Ia(l){const e=H.c(106),{orgSlug:n,virtualMcpId:s}=l,i=te(),a=bs(),c=`/api/${n}/hosted/${encodeURIComponent(s)}/site-tokens`;let r;e[0]!==n||e[1]!==s?(r=Mt.hostedSiteTokens(n,s),e[0]=n,e[1]=s,e[2]=r):r=e[2];const h=r,[o,m]=Q.useState(null),f=Q.useId();let u;e[3]!==c?(u=async()=>cs(await fetch(c)),e[3]=c,e[4]=u):u=e[4];let d;e[5]!==h||e[6]!==u?(d={queryKey:h,queryFn:u},e[5]=h,e[6]=u,e[7]=d):d=e[7];const p=vs(d);let x;e[8]!==c?(x=async()=>cs(await fetch(c,{method:"POST"})),e[8]=c,e[9]=x):x=e[9];let g;e[10]===Symbol.for("react.memo_cache_sentinel")?(g=q=>{const{token:D}=q;return m(D)},e[10]=g):g=e[10];let b;e[11]!==h||e[12]!==a?(b=()=>a.invalidateQueries({queryKey:h}),e[11]=h,e[12]=a,e[13]=b):b=e[13];let y;e[14]!==x||e[15]!==b?(y={mutationFn:x,onSuccess:g,onError:Aa,onSettled:b},e[14]=x,e[15]=b,e[16]=y):y=e[16];const j=un(y);let v;e[17]!==p.data?.tokens?(v=p.data?.tokens??[],e[17]=p.data?.tokens,e[18]=v):v=e[18];const S=v,C=p.data?.site;let M;e[19]!==i?(M=i("siteTokens.title"),e[19]=i,e[20]=M):M=e[20];let w;e[21]!==i?(w=i("siteTokens.description"),e[21]=i,e[22]=w):w=e[22];let N;e[23]!==i?(N=i("siteTokens.siteId"),e[23]=i,e[24]=N):N=e[24];let _;e[25]!==f||e[26]!==N?(_=t.jsx("label",{htmlFor:f,className:"text-sm font-medium",children:N}),e[25]=f,e[26]=N,e[27]=_):_=e[27];let T;e[28]!==i?(T=i("siteTokens.siteIdDescription"),e[28]=i,e[29]=T):T=e[29];let V;e[30]!==T?(V=t.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:T}),e[30]=T,e[31]=V):V=e[31];let I;e[32]!==C||e[33]!==f||e[34]!==i?(I=C?t.jsx(Oa,{id:f,value:C,copyLabel:i("siteTokens.copySiteId"),copiedLabel:i("siteTokens.siteIdCopied"),className:"min-w-0 flex-1"}):t.jsx("p",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:"—"}),e[32]=C,e[33]=f,e[34]=i,e[35]=I):I=e[35];const P=!p.data||j.isPending;let F;e[36]!==j?(F=()=>j.mutate(),e[36]=j,e[37]=F):F=e[37];let A;e[38]!==j.isPending?(A=j.isPending?t.jsx(et,{className:"size-3.5"}):t.jsx(Te,{size:14}),e[38]=j.isPending,e[39]=A):A=e[39];let E;e[40]!==i?(E=i("siteTokens.issue"),e[40]=i,e[41]=E):E=e[41];let L;e[42]!==P||e[43]!==F||e[44]!==A||e[45]!==E?(L=t.jsxs(ne,{type:"button",size:"sm",className:"shrink-0",disabled:P,onClick:F,children:[A,E]}),e[42]=P,e[43]=F,e[44]=A,e[45]=E,e[46]=L):L=e[46];let K;e[47]!==I||e[48]!==L?(K=t.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[I,L]}),e[47]=I,e[48]=L,e[49]=K):K=e[49];let B;e[50]!==_||e[51]!==V||e[52]!==K?(B=t.jsxs(be,{className:"group",children:[_,V,K]}),e[50]=_,e[51]=V,e[52]=K,e[53]=B):B=e[53];let Y;e[54]!==p.error||e[55]!==p.isError?(Y=p.isError?t.jsx(be,{children:t.jsx("p",{className:"text-xs text-destructive",children:p.error.message})}):null,e[54]=p.error,e[55]=p.isError,e[56]=Y):Y=e[56];let U;if(e[57]!==i||e[58]!==S){let q;e[60]!==i?(q=D=>t.jsx(be,{children:t.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[t.jsx(Dt,{size:16,className:"shrink-0 text-muted-foreground"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"truncate font-mono text-xs",children:D.kid}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("siteTokens.issuedAgo",{when:Ki(new Date(D.iat*1e3))})})]})]})},D.kid),e[60]=i,e[61]=q):q=e[61],U=S.map(q),e[57]=i,e[58]=S,e[59]=U}else U=e[59];let k;e[62]!==B||e[63]!==Y||e[64]!==U?(k=t.jsxs(Fe,{children:[B,Y,U]}),e[62]=B,e[63]=Y,e[64]=U,e[65]=k):k=e[65];const $=o!==null;let G;e[66]===Symbol.for("react.memo_cache_sentinel")?(G=q=>!q&&m(null),e[66]=G):G=e[66];let R;e[67]!==i?(R=i("siteTokens.createdTitle"),e[67]=i,e[68]=R):R=e[68];let z;e[69]!==R?(z=t.jsx(st,{children:R}),e[69]=R,e[70]=z):z=e[70];let W;e[71]!==i?(W=i("siteTokens.createdDescription"),e[71]=i,e[72]=W):W=e[72];let X;e[73]!==W?(X=t.jsx(js,{children:W}),e[73]=W,e[74]=X):X=e[74];let ie;e[75]!==z||e[76]!==X?(ie=t.jsxs(tt,{children:[z,X]}),e[75]=z,e[76]=X,e[77]=ie):ie=e[77];let J;e[78]!==i?(J=i("siteTokens.createdTitle"),e[78]=i,e[79]=J):J=e[79];const oe=o??"";let le;e[80]!==J||e[81]!==oe?(le=t.jsx(Ce,{readOnly:!0,"aria-label":J,value:oe,className:"font-mono text-xs"}),e[80]=J,e[81]=oe,e[82]=le):le=e[82];let ce;e[83]!==o||e[84]!==i?(ce=o?t.jsx(Xs,{value:o,label:i("siteTokens.copy"),copiedLabel:i("siteTokens.copied"),variant:"outline",size:"icon",className:"shrink-0"}):null,e[83]=o,e[84]=i,e[85]=ce):ce=e[85];let ee;e[86]!==le||e[87]!==ce?(ee=t.jsxs("div",{className:"flex items-center gap-2",children:[le,ce]}),e[86]=le,e[87]=ce,e[88]=ee):ee=e[88];let ue;e[89]===Symbol.for("react.memo_cache_sentinel")?(ue=()=>m(null),e[89]=ue):ue=e[89];let fe;e[90]!==i?(fe=i("siteTokens.done"),e[90]=i,e[91]=fe):fe=e[91];let pe;e[92]!==fe?(pe=t.jsx(Nt,{children:t.jsx(ne,{onClick:ue,children:fe})}),e[92]=fe,e[93]=pe):pe=e[93];let me;e[94]!==ie||e[95]!==ee||e[96]!==pe?(me=t.jsxs(qe,{className:"sm:max-w-lg",children:[ie,ee,pe]}),e[94]=ie,e[95]=ee,e[96]=pe,e[97]=me):me=e[97];let O;e[98]!==$||e[99]!==me?(O=t.jsx(Ge,{open:$,onOpenChange:G,children:me}),e[98]=$,e[99]=me,e[100]=O):O=e[100];let se;return e[101]!==w||e[102]!==k||e[103]!==O||e[104]!==M?(se=t.jsxs(Ue,{title:M,description:w,children:[k,O]}),e[101]=w,e[102]=k,e[103]=O,e[104]=M,e[105]=se):se=e[105],se}function Aa(l){return re.error(l.message)}function $a(l){const e=H.c(8),{control:n,previewServerUrl:s}=l,i=te();let a;e[0]!==s?(a=Es(s),e[0]=s,e[1]=a):a=e[1];const c=!!a;let r;e[2]!==c||e[3]!==i?(r=o=>{const{field:m}=o;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(je,{htmlFor:"fast-preview",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreview.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i(c?"sandbox.cmsSettings.fastPreview.description":"sandbox.cmsSettings.fastPreview.needsPreviewServerUrl")})]}),t.jsx(dt,{id:"fast-preview",className:"shrink-0",checked:!!m.value&&c,disabled:!c,onCheckedChange:f=>m.onChange(f)})]})},e[2]=c,e[3]=i,e[4]=r):r=e[4];let h;return e[5]!==n||e[6]!==r?(h=t.jsx(ve,{control:n,name:"metadata.fastPreview",render:r}),e[5]=n,e[6]=r,e[7]=h):h=e[7],h}function Fa(l){const e=H.c(5),{control:n,fastPreview:s}=l,i=te();if(!s)return null;let a;e[0]!==i?(a=r=>{const{field:h}=r;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(je,{htmlFor:"fast-preview-in-place",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.fastPreviewInPlace.description")})]}),t.jsx(dt,{id:"fast-preview-in-place",className:"shrink-0",checked:!!h.value,onCheckedChange:o=>h.onChange(o)})]})},e[0]=i,e[1]=a):a=e[1];let c;return e[2]!==n||e[3]!==a?(c=t.jsx(ve,{control:n,name:"metadata.fastPreviewInPlace",render:a}),e[2]=n,e[3]=a,e[4]=c):c=e[4],c}function Ea(l){const e=H.c(18),{control:n,isBlocksV8:s}=l,i=s===void 0?!1:s,a=te();let c;e[0]!==a?(c=a("sandbox.previewServerUrlField.label"),e[0]=a,e[1]=c):c=e[1];let r;e[2]!==c?(r=t.jsx(je,{htmlFor:"preview-server-url",children:c}),e[2]=c,e[3]=r):r=e[3];let h;e[4]!==a?(h=p=>{const{field:x}=p,g=x.value??"";return t.jsx(Ce,{id:"preview-server-url",type:"url",inputMode:"url",placeholder:a("sandbox.previewServerUrlField.placeholder"),value:g,onChange:b=>x.onChange(b.target.value===""?null:b.target.value),onBlur:()=>{x.onChange(qi(g)),x.onBlur()}})},e[4]=a,e[5]=h):h=e[5];let o;e[6]!==n||e[7]!==h?(o=t.jsx(ve,{control:n,name:"metadata.previewServerUrl",render:h}),e[6]=n,e[7]=h,e[8]=o):o=e[8];const m=i?"sandbox.previewServerUrlField.descriptionBlocksV8":"sandbox.previewServerUrlField.description";let f;e[9]!==a||e[10]!==m?(f=a(m),e[9]=a,e[10]=m,e[11]=f):f=e[11];let u;e[12]!==f?(u=t.jsx("p",{className:"text-xs text-muted-foreground",children:f}),e[12]=f,e[13]=u):u=e[13];let d;return e[14]!==r||e[15]!==o||e[16]!==u?(d=t.jsxs("div",{className:"space-y-2",children:[r,o,u]}),e[14]=r,e[15]=o,e[16]=u,e[17]=d):d=e[17],d}function za(l){const e=H.c(15),{control:n,isBlocksV8:s,previewServerUrl:i,fastPreview:a}=l,c=te(),r=s||!!a;let h;e[0]!==n||e[1]!==s?(h=t.jsx(be,{children:t.jsx(Ea,{control:n,isBlocksV8:s})}),e[0]=n,e[1]=s,e[2]=h):h=e[2];let o;e[3]!==n||e[4]!==s||e[5]!==i||e[6]!==c?(o=s?!Es(i)&&t.jsx(be,{children:t.jsx("p",{className:"text-xs text-muted-foreground",children:c("sandbox.cmsSettings.blocksV8.needsPreviewServerUrl")})}):t.jsx(be,{children:t.jsx($a,{control:n,previewServerUrl:i})}),e[3]=n,e[4]=s,e[5]=i,e[6]=c,e[7]=o):o=e[7];let m;e[8]!==n||e[9]!==r?(m=r&&t.jsx(be,{children:t.jsx(Fa,{control:n,fastPreview:r})}),e[8]=n,e[9]=r,e[10]=m):m=e[10];let f;return e[11]!==h||e[12]!==o||e[13]!==m?(f=t.jsxs(t.Fragment,{children:[h,o,m]}),e[11]=h,e[12]=o,e[13]=m,e[14]=f):f=e[14],f}const vt={tools:null,resources:null,prompts:null},Ra=Qi.pick({status:!0,title:!0,description:!0,icon:!0,metadata:!0,connections:!0});function La(l){const n=new TextEncoder().encode(l),s=Array.from(n,i=>String.fromCharCode(i)).join("");return btoa(s)}function Js(l){return{"x-studio-client":l,"x-mesh-client":l}}function Ua(l){const e=H.c(15),{url:n,agentId:s}=l,i=te(),[a,c]=Q.useState(!1);let r;e[0]!==s||e[1]!==i||e[2]!==n?(r=async()=>{Me("agent_connect_action",{agent_id:s,action:"copy_url"}),await navigator.clipboard.writeText(n),c(!0),re.success(i("virtualMcp.virtualMcpShareModal.agentUrlCopied")),await ft(2e3),c(!1)},e[0]=s,e[1]=i,e[2]=n,e[3]=r):r=e[3];const h=r;let o;e[4]!==a?(o=a?t.jsx(nt,{size:20,className:"text-success"}):t.jsx(ut,{size:20}),e[4]=a,e[5]=o):o=e[5];let m;e[6]!==a||e[7]!==i?(m=i(a?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.copyUrl"),e[6]=a,e[7]=i,e[8]=m):m=e[8];let f;e[9]!==m?(f=t.jsx("span",{className:"text-xs font-medium",children:m}),e[9]=m,e[10]=f):f=e[10];let u;return e[11]!==h||e[12]!==o||e[13]!==f?(u=t.jsxs(ne,{type:"button",variant:"outline",onClick:h,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[o,f]}),e[11]=h,e[12]=o,e[13]=f,e[14]=u):u=e[14],u}function Ya(l){const e=H.c(13),{url:n,serverName:s,agentId:i}=l,a=te();let c;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(c=()=>{Me("agent_connect_action",{agent_id:i,action:"install_cursor"});const u=Rs(s),d={type:"http",url:n,headers:Js("Cursor")},p=La(JSON.stringify(d,null,2)),x=`cursor://anysphere.cursor-deeplink/mcp/install?name=${encodeURIComponent(u)}&config=${encodeURIComponent(p)}`;window.open(x,"_blank"),re.success(a("virtualMcp.virtualMcpShareModal.openingCursor"))},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=c):c=e[4];const r=c;let h;e[5]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("img",{src:"/logos/cursor.svg",alt:"Cursor",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(11%) sepia(8%) saturate(785%) hue-rotate(1deg) brightness(95%) contrast(89%)"}}),e[5]=h):h=e[5];let o;e[6]!==a?(o=a("virtualMcp.virtualMcpShareModal.installOnCursor"),e[6]=a,e[7]=o):o=e[7];let m;e[8]!==o?(m=t.jsx("span",{className:"text-xs font-medium",children:o}),e[8]=o,e[9]=m):m=e[9];let f;return e[10]!==r||e[11]!==m?(f=t.jsxs(ne,{type:"button",variant:"outline",onClick:r,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[h,m]}),e[10]=r,e[11]=m,e[12]=f):f=e[12],f}function Ba(l){const e=H.c(16),{url:n,serverName:s,agentId:i}=l,a=te(),[c,r]=Q.useState(!1);let h;e[0]!==i||e[1]!==s||e[2]!==a||e[3]!==n?(h=async()=>{Me("agent_connect_action",{agent_id:i,action:"install_claude_code"});const p=Rs(s),x={type:"http",url:n,headers:Js("Claude Code")},g=JSON.stringify(x,null,2),b=`claude mcp add-json "${p}" '${g.replace(/'/g,"'\\''")}' --scope user`;await navigator.clipboard.writeText(b),r(!0),re.success(a("virtualMcp.virtualMcpShareModal.claudeCodeCommandCopied")),await ft(2e3),r(!1)},e[0]=i,e[1]=s,e[2]=a,e[3]=n,e[4]=h):h=e[4];const o=h;let m;e[5]!==c?(m=c?t.jsx(nt,{size:20,className:"text-success"}):t.jsx("img",{src:"/logos/Claude Code.svg",alt:"Claude Code",className:"h-5 w-5",style:{filter:"brightness(0) saturate(100%) invert(55%) sepia(31%) saturate(1264%) hue-rotate(331deg) brightness(92%) contrast(86%)"}}),e[5]=c,e[6]=m):m=e[6];let f;e[7]!==c||e[8]!==a?(f=a(c?"virtualMcp.virtualMcpShareModal.copied":"virtualMcp.virtualMcpShareModal.installOnClaudeCode"),e[7]=c,e[8]=a,e[9]=f):f=e[9];let u;e[10]!==f?(u=t.jsx("span",{className:"text-xs font-medium",children:f}),e[10]=f,e[11]=u):u=e[11];let d;return e[12]!==o||e[13]!==m||e[14]!==u?(d=t.jsxs(ne,{type:"button",variant:"outline",onClick:o,className:"h-auto py-3 px-4 flex flex-col items-center gap-2",children:[m,u]}),e[12]=o,e[13]=m,e[14]=u,e[15]=d):d=e[15],d}const Wa=720*60*60;function Ka({virtualMcp:l}){const e=te(),n=Ct(),[s,i]=Q.useState(null),[a,c]=Q.useState(!1),[r,h]=Q.useState(!1),o=l.id,m=l.title||`agent-${o.slice(0,8)}`,f=s?`bunx @decocms/typegen@latest --mcp ${o} --key ${s} --output client.ts`:`bunx @decocms/typegen@latest --mcp ${o} --key <api-key> --output client.ts`,u=async()=>{c(!0);try{const{key:p}=await n.call("API_KEY_CREATE",{name:`typegen-${m}`,permissions:{[o]:["*"]},expiresIn:Wa});if(!p)throw new Error("No key in response");i(p),Me("agent_typegen_key_generated",{agent_id:o})}catch{Me("agent_typegen_key_failed",{agent_id:o}),re.error(e("virtualMcp.virtualMcpShareModal.failedGenerateApiKey"))}finally{c(!1)}},d=async()=>{Me("agent_connect_action",{agent_id:o,action:"typegen_copy_command",has_api_key:!!s}),await navigator.clipboard.writeText(f),h(!0),re.success(e("virtualMcp.virtualMcpShareModal.commandCopied")),await ft(2e3),h(!1)};return t.jsxs("div",{className:"flex min-w-0 flex-col gap-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h4",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClient")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateTypedClientDescription")})]}),!s&&t.jsxs(ne,{type:"button",variant:"outline",size:"sm",className:"shrink-0 gap-1.5",onClick:u,disabled:a,children:[a?t.jsx(et,{className:"size-3.5"}):t.jsx(Dt,{size:14}),t.jsx("span",{children:e(a?"virtualMcp.virtualMcpShareModal.generating":"virtualMcp.virtualMcpShareModal.generateApiKey")})]})]}),s&&t.jsx("p",{className:"rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs text-warning",children:e("virtualMcp.virtualMcpShareModal.storeKeySecurely")}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.generateClientLabel")}),t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:f}),t.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:d,children:r?t.jsx(nt,{size:12,className:"text-success"}):t.jsx(ut,{size:12})})]})}),t.jsx("p",{className:"text-xs font-medium text-muted-foreground",children:e("virtualMcp.virtualMcpShareModal.runtimeVariables")}),t.jsx(Ga,{apiKey:s,agentId:o})]})}function Ga(l){const e=H.c(21),{apiKey:n,agentId:s}=l,[i,a]=Q.useState(!1),c=window.location.origin,r=n?`STUDIO_API_KEY=${n}`:"STUDIO_API_KEY=<api-key>",h=`STUDIO_BASE_URL=${c}`,o=`${r}
|
|
2
|
-
${h}`;let m;e[0]!==s||e[1]!==n||e[2]!==o?(m=async()=>{Me("agent_connect_action",{agent_id:s,action:"typegen_copy_env",has_api_key:!!n}),await navigator.clipboard.writeText(o),a(!0),await ft(2e3),a(!1)},e[0]=s,e[1]=n,e[2]=o,e[3]=m):m=e[3];const f=m,u=!n;let d;e[4]!==u?(d=xe({"opacity-50":u}),e[4]=u,e[5]=d):d=e[5];let p;e[6]!==r||e[7]!==d?(p=t.jsx("span",{className:d,children:r}),e[6]=r,e[7]=d,e[8]=p):p=e[8];let x,g;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("br",{}),g=t.jsx("span",{children:h}),e[9]=x,e[10]=g):(x=e[9],g=e[10]);let b;e[11]!==p?(b=t.jsxs("code",{className:"min-w-0 flex-1 font-mono text-xs text-muted-foreground",children:[p,x,g]}),e[11]=p,e[12]=b):b=e[12];let y;e[13]!==i?(y=i?t.jsx(nt,{size:12,className:"text-success"}):t.jsx(ut,{size:12}),e[13]=i,e[14]=y):y=e[14];let j;e[15]!==f||e[16]!==y?(j=t.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"size-6 shrink-0",onClick:f,children:y}),e[15]=f,e[16]=y,e[17]=j):j=e[17];let v;return e[18]!==b||e[19]!==j?(v=t.jsx("div",{className:"rounded-md border border-input bg-muted/50 px-3 py-2.5",children:t.jsxs("div",{className:"flex items-start gap-2",children:[b,j]})}),e[18]=b,e[19]=j,e[20]=v):v=e[20],v}function qa(l){const e=H.c(3),{virtualMcp:n}=l;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx("div",{className:"h-20 animate-pulse rounded-md bg-muted"}),e[0]=s):s=e[0];let i;return e[1]!==n?(i=t.jsx(Q.Suspense,{fallback:s,children:t.jsx(Ka,{virtualMcp:n})}),e[1]=n,e[2]=i):i=e[2],i}function Ha(l){const e=H.c(45),{open:n,onOpenChange:s,virtualMcp:i}=l,a=te(),{org:c}=Ae(),r=`/api/${c.slug}/mcp/virtual-mcp/${i.id}`;let h;e[0]!==r?(h=new URL(r,window.location.origin),e[0]=r,e[1]=h):h=e[1];const o=h;let m;e[2]!==i.id||e[3]!==i.title?(m=i.title||`agent-${i.id?.slice(0,8)??"default"}`,e[2]=i.id,e[3]=i.title,e[4]=m):m=e[4];const f=m,u=sl();let d;e[5]!==i.id||e[6]!==o.href?(d=t.jsx(Ua,{url:o.href,agentId:i.id}),e[5]=i.id,e[6]=o.href,e[7]=d):d=e[7];let p,x;e[8]!==f||e[9]!==i.id||e[10]!==o.href?(p=t.jsx(Ya,{url:o.href,serverName:f,agentId:i.id}),x=t.jsx(Ba,{url:o.href,serverName:f,agentId:i.id}),e[8]=f,e[9]=i.id,e[10]=o.href,e[11]=p,e[12]=x):(p=e[11],x=e[12]);let g;e[13]!==d||e[14]!==p||e[15]!==x?(g=t.jsx("div",{className:"flex flex-col gap-3 pt-2",children:t.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[d,p,x]})}),e[13]=d,e[14]=p,e[15]=x,e[16]=g):g=e[16];let b;e[17]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx("div",{className:"border-t border-border"}),e[17]=b):b=e[17];let y;e[18]!==i?(y=t.jsx(qa,{virtualMcp:i}),e[18]=i,e[19]=y):y=e[19];let j;e[20]!==g||e[21]!==y?(j=t.jsxs("div",{className:"flex flex-col gap-6",children:[g,b,y]}),e[20]=g,e[21]=y,e[22]=j):j=e[22];const v=j;if(u){let N;e[23]!==a?(N=a("virtualMcp.virtualMcpShareModal.connect"),e[23]=a,e[24]=N):N=e[24];let _;e[25]!==N?(_=t.jsx(Zi,{className:"mt-4 mb-4 text-base font-semibold",children:N}),e[25]=N,e[26]=_):_=e[26];let T;e[27]!==v||e[28]!==_?(T=t.jsx(el,{children:t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 pb-6 [touch-action:pan-y]",children:[_,v]})}),e[27]=v,e[28]=_,e[29]=T):T=e[29];let V;return e[30]!==s||e[31]!==n||e[32]!==T?(V=t.jsx(tl,{open:n,onOpenChange:s,children:T}),e[30]=s,e[31]=n,e[32]=T,e[33]=V):V=e[33],V}let S;e[34]!==a?(S=a("virtualMcp.virtualMcpShareModal.connect"),e[34]=a,e[35]=S):S=e[35];let C;e[36]!==S?(C=t.jsx(tt,{children:t.jsx(st,{children:S})}),e[36]=S,e[37]=C):C=e[37];let M;e[38]!==v||e[39]!==C?(M=t.jsxs(qe,{className:"max-h-[80vh] overflow-y-auto sm:max-w-2xl",children:[C,v]}),e[38]=v,e[39]=C,e[40]=M):M=e[40];let w;return e[41]!==s||e[42]!==n||e[43]!==M?(w=t.jsx(Ge,{open:n,onOpenChange:s,children:M}),e[41]=s,e[42]=n,e[43]=M,e[44]=w):w=e[44],w}const Qa=/^[A-Za-z_][A-Za-z0-9_]*$/;function Xa(l){const e={},n=l.split(/\r?\n/);for(let s=0;s<n.length;s++){let i=(n[s]??"").trim();if(!i||i.startsWith("#"))continue;i.startsWith("export ")&&(i=i.slice(7).trim());const a=i.indexOf("=");if(a<0)throw new Error(`Line ${s+1}: missing '='`);const c=i.slice(0,a).trim();if(!Qa.test(c))throw new Error(`Line ${s+1}: invalid key "${c}"`);let r=i.slice(a+1).trim();r.length>=2&&(r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'"))&&(r=r.slice(1,-1)),e[c]=r}return e}function Ja(l){const e=H.c(28),{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:c}=l,r=te();let h;e[0]!==r?(h=r("sandbox.envVarsField.title"),e[0]=r,e[1]=h):h=e[1];let o;e[2]!==h?(o=t.jsx("div",{className:"flex items-baseline justify-between gap-2",children:t.jsx(je,{className:"font-normal text-foreground",children:h})}),e[2]=h,e[3]=o):o=e[3];let m;e[4]!==r?(m=r("sandbox.envVarsField.description"),e[4]=r,e[5]=m):m=e[5];let f;e[6]!==m?(f=t.jsx("p",{className:"text-xs text-muted-foreground",children:m}),e[6]=m,e[7]=f):f=e[7];let u;e[8]!==n||e[9]!==s||e[10]!==a||e[11]!==c||e[12]!==i?(u=t.jsx(Za,{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:c}),e[8]=n,e[9]=s,e[10]=a,e[11]=c,e[12]=i,e[13]=u):u=e[13];let d;e[14]!==r?(d=y=>{const{error:j}=y;return t.jsx("div",{className:"rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-xs text-destructive",children:j?.message??r("sandbox.envVarsField.failedToLoadSecrets")})},e[14]=r,e[15]=d):d=e[15];let p;e[16]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(mn,{className:"h-9 w-full"}),e[16]=p):p=e[16];let x;e[17]!==n||e[18]!==s?(x=t.jsx(Q.Suspense,{fallback:p,children:t.jsx(tr,{control:n,form:s})}),e[17]=n,e[18]=s,e[19]=x):x=e[19];let g;e[20]!==d||e[21]!==x?(g=t.jsx(Le,{fallback:d,children:x}),e[20]=d,e[21]=x,e[22]=g):g=e[22];let b;return e[23]!==o||e[24]!==f||e[25]!==u||e[26]!==g?(b=t.jsxs("div",{className:"space-y-2",children:[o,f,u,g]}),e[23]=o,e[24]=f,e[25]=u,e[26]=g,e[27]=b):b=e[27],b}function Za(l){const e=H.c(33),{control:n,form:s,virtualMcpId:i,orgSlug:a,sandboxMap:c}=l,r=te(),o=fn.useSession().data?.user?.id,m="metadata.runtime.env";let f;e[0]!==s?(f=()=>JSON.stringify(ds(s.getValues(m))),e[0]=s,e[1]=f):f=e[1];const[u,d]=Q.useState(f);let p;e[2]!==n?(p={control:n,name:m},e[2]=n,e[3]=p):p=e[3];const x=ys(p);let g;e[4]!==x?(g=JSON.stringify(ds(x)),e[4]=x,e[5]=g):g=e[5];const b=g,y=b!==u;let j;e[6]!==c||e[7]!==o?(j=o?Object.keys(c?.[o]??{}):[],e[6]=c,e[7]=o,e[8]=j):j=e[8];const v=j,S=v.length>0,[C,M]=Q.useState(!1);if(!y||!S)return null;let w;e[9]!==b||e[10]!==a||e[11]!==r||e[12]!==v||e[13]!==i?(w=async()=>{M(!0);const E=await Promise.allSettled(v.map(async K=>{const B=nl({orgSlug:a,virtualMcpId:i,branch:K,threadId:null},"setup/start"),Y=await fetch(B,{method:"POST"});if(!Y.ok){const U=await Y.text().catch(()=>Y.statusText);throw new Error(U||Y.statusText)}}));M(!1);const L=E.filter(er).length;L===0?(d(b),re.success(v.length===1?r("sandbox.envVarsField.restartedSingle"):r("sandbox.envVarsField.restartedMultiple",{count:v.length}))):re.error(r("sandbox.envVarsField.restartFailed",{failed:L,total:v.length}))},e[9]=b,e[10]=a,e[11]=r,e[12]=v,e[13]=i,e[14]=w):w=e[14];const N=w;let _;e[15]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(xs,{className:"size-3.5 shrink-0"}),e[15]=_):_=e[15];let T;e[16]!==r?(T=r("sandbox.envVarsField.sandboxRunningNotice"),e[16]=r,e[17]=T):T=e[17];let V;e[18]!==T?(V=t.jsxs("div",{className:"flex min-w-0 items-center gap-2 text-warning",children:[_,t.jsx("span",{className:"truncate",children:T})]}),e[18]=T,e[19]=V):V=e[19];let I;e[20]!==C?(I=C?t.jsx(et,{className:"size-3.5"}):t.jsx(hn,{className:"size-3.5"}),e[20]=C,e[21]=I):I=e[21];let P;e[22]!==C||e[23]!==r?(P=r(C?"sandbox.envVarsField.restarting":"sandbox.envVarsField.restartDev"),e[22]=C,e[23]=r,e[24]=P):P=e[24];let F;e[25]!==N||e[26]!==C||e[27]!==P||e[28]!==I?(F=t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:N,disabled:C,className:"shrink-0",children:[I,P]}),e[25]=N,e[26]=C,e[27]=P,e[28]=I,e[29]=F):F=e[29];let A;return e[30]!==F||e[31]!==V?(A=t.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-warning/20 bg-warning/10 px-3 py-2 text-xs",children:[V,F]}),e[30]=F,e[31]=V,e[32]=A):A=e[32],A}function er(l){return l.status==="rejected"}function tr(l){const e=H.c(62),{control:n,form:s}=l,i=te(),a="metadata.runtime.env";let c;e[0]!==n?(c={control:n,name:a},e[0]=n,e[1]=c):c=e[1];const r=pn(c),{fields:h,append:o,remove:m}=r;let f;e[2]!==s?(f=(B,Y)=>{s.setValue(`${a}.${B}`,Y,{shouldDirty:!0,shouldTouch:!0})},e[2]=s,e[3]=f):f=e[3];const u=f,d=rl();let p;if(e[4]!==d){p=new Map;for(const B of d)p.set(B.id,B);e[4]=d,e[5]=p}else p=e[5];const[x,g]=Q.useState(null);let b;e[6]!==o?(b=()=>{o({key:"",kind:"literal",value:""})},e[6]=o,e[7]=b):b=e[7];const y=b;let j;e[8]!==o||e[9]!==s||e[10]!==i?(j=async()=>{let B;try{B=await navigator.clipboard.readText()}catch{re.error(i("sandbox.envVarsField.clipboardReadFailed"));return}if(!B.trim()){re.error(i("sandbox.envVarsField.clipboardEmpty"));return}let Y;try{Y=Xa(B)}catch(z){const W=z;re.error(W.message);return}const U=Object.entries(Y);if(U.length===0){re.error(i("sandbox.envVarsField.nothingToAdd"));return}const k=s.getValues(a)??[],$=new Set;for(const z of k){const W=(z.key??"").trim();W&&$.add(W)}let G=0,R=0;for(const[z,W]of U){if($.has(z)){R++;continue}o({key:z,kind:"literal",value:W}),$.add(z),G++}G===0&&R>0?re.message(i("sandbox.envVarsField.allKeysExist",{count:R})):re.success(R>0?i("sandbox.envVarsField.addedWithSkipped",{added:G,skipped:R}):i("sandbox.envVarsField.added",{added:G}))},e[8]=o,e[9]=s,e[10]=i,e[11]=j):j=e[11];const v=j;let S;if(e[12]!==n||e[13]!==h||e[14]!==s||e[15]!==m||e[16]!==p||e[17]!==d||e[18]!==u){let B;e[20]!==n||e[21]!==s||e[22]!==m||e[23]!==p||e[24]!==d||e[25]!==u?(B=(Y,U)=>t.jsx("li",{className:"rounded-md border border-border bg-background",children:t.jsx(sr,{index:U,control:n,form:s,onUpdateEntry:u,fieldPath:a,secrets:d,secretById:p,onSaveAsSecret:(k,$)=>g({kind:"save-literal",index:U,presetKey:k,presetValue:$}),onCreateNewSecret:k=>g({kind:"create-new",index:U,presetKey:k}),onRemove:()=>m(U)})},Y.id),e[20]=n,e[21]=s,e[22]=m,e[23]=p,e[24]=d,e[25]=u,e[26]=B):B=e[26],S=h.map(B),e[12]=n,e[13]=h,e[14]=s,e[15]=m,e[16]=p,e[17]=d,e[18]=u,e[19]=S}else S=e[19];let C;e[27]!==S?(C=t.jsx("ul",{className:"space-y-2",children:S}),e[27]=S,e[28]=C):C=e[28];let M;e[29]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(Te,{className:"size-3.5"}),e[29]=M):M=e[29];let w;e[30]!==i?(w=i("sandbox.envVarsField.addEnvVar"),e[30]=i,e[31]=w):w=e[31];let N;e[32]!==y||e[33]!==w?(N=t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:y,className:"flex-1",children:[M,w]}),e[32]=y,e[33]=w,e[34]=N):N=e[34];let _;e[35]!==i?(_=i("sandbox.envVarsField.pasteDotenvAriaLabel"),e[35]=i,e[36]=_):_=e[36];let T;e[37]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ui,{className:"size-3.5"}),e[37]=T):T=e[37];let V;e[38]!==i?(V=i("sandbox.envVarsField.pasteDotenv"),e[38]=i,e[39]=V):V=e[39];let I;e[40]!==v||e[41]!==_||e[42]!==V?(I=t.jsx(Se,{asChild:!0,children:t.jsxs(ne,{type:"button",variant:"outline",size:"sm",onClick:v,"aria-label":_,children:[T,V]})}),e[40]=v,e[41]=_,e[42]=V,e[43]=I):I=e[43];let P;e[44]!==i?(P=i("sandbox.envVarsField.pasteDotenvTooltip"),e[44]=i,e[45]=P):P=e[45];let F;e[46]!==P?(F=t.jsx(Ne,{children:P}),e[46]=P,e[47]=F):F=e[47];let A;e[48]!==I||e[49]!==F?(A=t.jsxs(we,{children:[I,F]}),e[48]=I,e[49]=F,e[50]=A):A=e[50];let E;e[51]!==A||e[52]!==N?(E=t.jsxs("div",{className:"flex items-center gap-2",children:[N,A]}),e[51]=A,e[52]=N,e[53]=E):E=e[53];let L;e[54]!==x||e[55]!==s||e[56]!==u?(L=x!==null?t.jsx(ir,{mode:x,onClose:()=>g(null),onSaved:B=>{const Y=s.getValues(`${a}.${x.index}.key`)?.trim()??"";u(x.index,{key:Y,kind:"secret",secretId:B}),g(null)}}):null,e[54]=x,e[55]=s,e[56]=u,e[57]=L):L=e[57];let K;return e[58]!==E||e[59]!==L||e[60]!==C?(K=t.jsxs("div",{className:"space-y-2",children:[C,E,L]}),e[58]=E,e[59]=L,e[60]=C,e[61]=K):K=e[61],K}function sr(l){const e=H.c(77),{index:n,control:s,form:i,onUpdateEntry:a,fieldPath:c,secrets:r,secretById:h,onSaveAsSecret:o,onCreateNewSecret:m,onRemove:f}=l,u=te(),d=`${c}.${n}.key`,p=`${c}.${n}.value`,x=`${c}.${n}.secretId`,g=`${c}.${n}.kind`;let b;e[0]!==s||e[1]!==g?(b={control:s,name:g},e[0]=s,e[1]=g,e[2]=b):b=e[2];const j=ys(b)==="secret"?"secret":"literal";let v;e[3]!==i||e[4]!==n||e[5]!==d||e[6]!==o||e[7]!==a||e[8]!==p?(v=W=>{const X=i.getValues(d)?.trim()??"";if(W==="literal"){a(n,{key:X,kind:"literal",value:""});return}const ie=i.getValues(p)??"";if(ie.length>0){o(X,ie);return}a(n,{key:X,kind:"secret",secretId:""})},e[3]=i,e[4]=n,e[5]=d,e[6]=o,e[7]=a,e[8]=p,e[9]=v):v=e[9];const S=v;let C;e[10]!==n||e[11]!==u?(C=W=>{const{field:X}=W,ie=(X.value??"").trim(),J=ie.length>0&&!mt.test(ie);return t.jsxs("div",{className:"space-y-1",children:[t.jsx(Ce,{...X,value:X.value??"",placeholder:u("sandbox.envVarsField.keyPlaceholder"),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",className:xe("font-mono",J&&"border-destructive focus-visible:ring-destructive"),"aria-invalid":J,"aria-label":u("sandbox.envVarsField.envVarKeyLabel",{index:n+1}),onBlur:oe=>{const le=oe.target.value.trim();X.onChange(le),X.onBlur()}}),J?t.jsx("p",{className:"text-[11px] text-destructive",children:u("sandbox.envVarsField.invalidKeyMessage")}):null]})},e[10]=n,e[11]=u,e[12]=C):C=e[12];let M;e[13]!==s||e[14]!==d||e[15]!==C?(M=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(ve,{control:s,name:d,render:C})}),e[13]=s,e[14]=d,e[15]=C,e[16]=M):M=e[16];let w;e[17]!==S?(w=W=>S(W),e[17]=S,e[18]=w):w=e[18];let N;e[19]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(De,{className:"h-9 w-[110px]",children:t.jsx(Pe,{})}),e[19]=N):N=e[19];let _;e[20]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Dt,{className:"size-3.5"}),e[20]=_):_=e[20];let T;e[21]!==u?(T=u("sandbox.envVarsField.literal"),e[21]=u,e[22]=T):T=e[22];let V;e[23]!==T?(V=t.jsx(ye,{value:"literal",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[_,T]})}),e[23]=T,e[24]=V):V=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xn,{className:"size-3.5"}),e[25]=I):I=e[25];let P;e[26]!==u?(P=u("sandbox.envVarsField.secret"),e[26]=u,e[27]=P):P=e[27];let F;e[28]!==P?(F=t.jsx(ye,{value:"secret",children:t.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[I,P]})}),e[28]=P,e[29]=F):F=e[29];let A;e[30]!==F||e[31]!==V?(A=t.jsxs(Oe,{children:[V,F]}),e[30]=F,e[31]=V,e[32]=A):A=e[32];let E;e[33]!==j||e[34]!==A||e[35]!==w?(E=t.jsx("div",{className:"shrink-0",children:t.jsxs(Ie,{value:j,onValueChange:w,children:[N,A]})}),e[33]=j,e[34]=A,e[35]=w,e[36]=E):E=e[36];let L;e[37]!==s||e[38]!==i||e[39]!==n||e[40]!==d||e[41]!==j||e[42]!==m||e[43]!==h||e[44]!==x||e[45]!==r||e[46]!==u||e[47]!==p?(L=t.jsx("div",{className:"flex flex-[2] min-w-0 items-center gap-1",children:j==="literal"?t.jsx(ve,{control:s,name:p,render:W=>{const{field:X}=W;return t.jsx(Ce,{...X,value:X.value??"",type:"password",placeholder:u("sandbox.envVarsField.valuePlaceholder"),spellCheck:!1,autoComplete:"off",className:"font-mono","aria-label":u("sandbox.envVarsField.envVarValueLabel",{index:n+1}),onBlur:ie=>{X.onChange(ie.target.value),X.onBlur()}})}}):t.jsxs(t.Fragment,{children:[t.jsx(ve,{control:s,name:x,render:W=>{const{field:X}=W;return t.jsxs(Ie,{value:X.value||"",onValueChange:ie=>X.onChange(ie),children:[t.jsx(De,{className:xe("h-9 w-full",!X.value&&"text-muted-foreground"),"aria-label":u("sandbox.envVarsField.secretAriaLabel",{index:n+1}),children:t.jsx(Pe,{placeholder:u("sandbox.envVarsField.pickSecretPlaceholder"),children:t.jsx(il,{field:X,secretById:h})})}),t.jsx(Oe,{children:r.length===0?t.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:u("sandbox.envVarsField.noSecretsYet")}):r.map(nr)})]})}}),t.jsxs(we,{children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.createNewSecretAriaLabel"),onClick:()=>{const W=i.getValues(d)?.trim()??"";m(W)},children:t.jsx(Te,{className:"size-3.5"})})}),t.jsx(Ne,{children:u("sandbox.envVarsField.createNewSecret")})]})]})}),e[37]=s,e[38]=i,e[39]=n,e[40]=d,e[41]=j,e[42]=m,e[43]=h,e[44]=x,e[45]=r,e[46]=u,e[47]=p,e[48]=L):L=e[48];let K;e[49]!==i||e[50]!==d||e[51]!==j||e[52]!==o||e[53]!==u||e[54]!==p?(K=j==="literal"?t.jsxs(we,{children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon","aria-label":u("sandbox.envVarsField.saveAsSecretAriaLabel"),onClick:()=>{const W=i.getValues(d)?.trim()??"",X=i.getValues(p)??"";o(W,X)},children:t.jsx(mi,{className:"size-3.5"})})}),t.jsx(Ne,{children:u("sandbox.envVarsField.saveAsSecret")})]}):null,e[49]=i,e[50]=d,e[51]=j,e[52]=o,e[53]=u,e[54]=p,e[55]=K):K=e[55];let B;e[56]!==u?(B=u("sandbox.envVarsField.removeEnvVarAriaLabel"),e[56]=u,e[57]=B):B=e[57];let Y;e[58]===Symbol.for("react.memo_cache_sentinel")?(Y=t.jsx(Vt,{className:"size-3.5"}),e[58]=Y):Y=e[58];let U;e[59]!==f||e[60]!==B?(U=t.jsx(Se,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon","aria-label":B,onClick:f,children:Y})}),e[59]=f,e[60]=B,e[61]=U):U=e[61];let k;e[62]!==u?(k=u("sandbox.envVarsField.remove"),e[62]=u,e[63]=k):k=e[63];let $;e[64]!==k?($=t.jsx(Ne,{children:k}),e[64]=k,e[65]=$):$=e[65];let G;e[66]!==U||e[67]!==$?(G=t.jsxs(we,{children:[U,$]}),e[66]=U,e[67]=$,e[68]=G):G=e[68];let R;e[69]!==K||e[70]!==G?(R=t.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[K,G]}),e[69]=K,e[70]=G,e[71]=R):R=e[71];let z;return e[72]!==E||e[73]!==L||e[74]!==R||e[75]!==M?(z=t.jsxs("div",{className:"flex flex-col gap-2 p-2 sm:flex-row sm:items-center",children:[M,E,L,R]}),e[72]=E,e[73]=L,e[74]=R,e[75]=M,e[76]=z):z=e[76],z}function nr(l){return t.jsx(ye,{value:l.id,children:t.jsxs("span",{className:"inline-flex items-center gap-2",children:[t.jsx(al,{scope:l.scope}),t.jsx("span",{className:"font-mono",children:l.name})]})},l.id)}function ir({mode:l,onClose:e,onSaved:n}){const s=te(),i=l.kind==="save-literal"?l.presetValue:"",a=l.presetKey,[c,r]=Q.useState(()=>lr(a)),[h,o]=Q.useState("organization"),[m,f]=Q.useState(i),[u,d]=Q.useState(""),p=ol(),x=c.trim(),g=m.length>0&&x.length>0&&ll.test(x),b=async v=>{if(v.preventDefault(),!!g)try{const S=await p.mutateAsync({scope:h,name:x,value:m,description:u.trim()||void 0});re.success(s("sandbox.envVarsField.secretSaved",{name:S.name})),n(S.id)}catch(S){re.error(S instanceof Error?S.message:s("sandbox.envVarsField.failedToSaveSecret"))}},y=l.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretTitle"):s("sandbox.envVarsField.createNewSecretTitle"),j=l.kind==="save-literal"?s("sandbox.envVarsField.saveValueAsSecretDescription"):s("sandbox.envVarsField.createNewSecretDescription");return t.jsx(Ge,{open:!0,onOpenChange:v=>{v||e()},children:t.jsxs(qe,{className:"sm:max-w-md",children:[t.jsxs(tt,{children:[t.jsx(st,{children:y}),t.jsx(js,{children:j})]}),t.jsxs("form",{onSubmit:b,className:"space-y-4",children:[t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(je,{htmlFor:"save-secret-scope",children:s("sandbox.envVarsField.scopeLabel")}),t.jsxs(Ie,{value:h,onValueChange:v=>o(v),children:[t.jsx(De,{id:"save-secret-scope",children:t.jsx(Pe,{})}),t.jsxs(Oe,{children:[t.jsx(ye,{value:"organization",children:s("sandbox.envVarsField.scopeOrganization")}),t.jsx(ye,{value:"user",children:s("sandbox.envVarsField.scopePrivate")})]})]})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(je,{htmlFor:"save-secret-name",children:s("sandbox.envVarsField.nameLabel")}),t.jsx(Ce,{id:"save-secret-name",value:c,onChange:v=>r(v.target.value),placeholder:s("sandbox.envVarsField.namePlaceholder"),autoComplete:"off",required:!0}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.envVarsField.nameHelperText")})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(je,{htmlFor:"save-secret-value",children:s("sandbox.envVarsField.valueLabel")}),t.jsx(Ce,{id:"save-secret-value",type:"password",value:m,onChange:v=>f(v.target.value),placeholder:s("sandbox.envVarsField.secretValuePlaceholder"),autoComplete:"new-password",required:!0})]}),t.jsxs("div",{className:"space-y-1.5",children:[t.jsx(je,{htmlFor:"save-secret-description",children:s("sandbox.envVarsField.descriptionLabel")}),t.jsx(at,{id:"save-secret-description",value:u,onChange:v=>d(v.target.value),rows:2,placeholder:s("sandbox.envVarsField.descriptionPlaceholder")})]}),t.jsxs(Nt,{children:[t.jsx(ne,{type:"button",variant:"outline",onClick:e,disabled:p.isPending,children:s("sandbox.envVarsField.cancel")}),t.jsx(ne,{type:"submit",disabled:!g||p.isPending,children:p.isPending?s("sandbox.envVarsField.saving"):s("sandbox.envVarsField.saveSecret")})]})]})]})})}function ds(l){if(!Array.isArray(l))return[];const e=[];for(const n of l){if(!n||typeof n!="object")continue;const s=n,i=(s.key??"").trim();if(!(!i||!mt.test(i))){if(s.kind==="literal"){e.push({key:i,kind:"literal",value:s.value??""});continue}s.kind==="secret"&&s.secretId&&e.push({key:i,kind:"secret",secretId:s.secretId})}}return e}function lr(l){const e=l.trim();return e&&mt.test(e)?e:""}function ar(l){const e=H.c(21),{repo:n,className:s}=l,i=te();let a;e[0]!==s?(a=xe("space-y-2",s),e[0]=s,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("sandbox.repoRow.label"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==c?(r=t.jsx(je,{children:c}),e[4]=c,e[5]=r):r=e[5];let h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx(cl,{size:20,className:"shrink-0 text-foreground/60"}),e[6]=h):h=e[6];let o;e[7]!==n||e[8]!==i?(o=t.jsx(Se,{asChild:!0,children:t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-background px-4 py-3",tabIndex:0,children:[h,t.jsx("div",{className:"min-w-0 flex-1",children:n?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"truncate text-sm font-medium",children:[n.owner,"/",n.name]}),t.jsx("div",{className:"truncate text-xs text-muted-foreground",children:n.url})]}):t.jsx("div",{className:"text-sm text-muted-foreground",children:i("sandbox.repoRow.noRepositoryConnected")})})]})}),e[7]=n,e[8]=i,e[9]=o):o=e[9];let m;e[10]!==i?(m=i("sandbox.repoRow.tooltipContent"),e[10]=i,e[11]=m):m=e[11];let f;e[12]!==m?(f=t.jsx(Ne,{children:m}),e[12]=m,e[13]=f):f=e[13];let u;e[14]!==o||e[15]!==f?(u=t.jsxs(we,{children:[o,f]}),e[14]=o,e[15]=f,e[16]=u):u=e[16];let d;return e[17]!==a||e[18]!==r||e[19]!==u?(d=t.jsxs("div",{className:a,children:[r,u]}),e[17]=a,e[18]=r,e[19]=u,e[20]=d):d=e[20],d}const rr={npm:{install:"npm install",run:l=>`npm run ${l}`,runtime:"node"},pnpm:{install:"pnpm install",run:l=>`pnpm run ${l}`,runtime:"node"},yarn:{install:"yarn install",run:l=>`yarn run ${l}`,runtime:"node"},bun:{install:"bun install",run:l=>`bun run ${l}`,runtime:"bun"},deno:{install:"deno install",run:l=>`deno task ${l}`,runtime:"deno"}};function or(l){const e=l.trim();if(e==="")return{ok:!0,value:null};if(!/^\d+$/.test(e))return{ok:!1};const n=Number(e);return n<1||n>65535?{ok:!1}:{ok:!0,value:String(n)}}const cr=Object.keys(rr),bt="__none__";function dr(l){const e=H.c(47),{control:n}=l,s=te(),i=Q.useRef(null);let a;e[0]!==s?(a=s("sandbox.runtimeFields.packageManager"),e[0]=s,e[1]=a):a=e[1];let c;e[2]!==a?(c=t.jsx(je,{htmlFor:"runtime-pm",children:a}),e[2]=a,e[3]=c):c=e[3];let r;e[4]!==s?(r=w=>{const{field:N}=w;return t.jsxs(Ie,{value:N.value??bt,onValueChange:_=>N.onChange(_===bt?null:_),children:[t.jsx(De,{id:"runtime-pm",children:t.jsx(Pe,{placeholder:s("sandbox.runtimeFields.autoDetect")})}),t.jsxs(Oe,{children:[t.jsx(ye,{value:bt,children:s("sandbox.runtimeFields.autoDetect")}),cr.map(mr)]})]})},e[4]=s,e[5]=r):r=e[5];let h;e[6]!==n||e[7]!==r?(h=t.jsx(ve,{control:n,name:"metadata.runtime.selected",render:r}),e[6]=n,e[7]=r,e[8]=h):h=e[8];let o;e[9]!==c||e[10]!==h?(o=t.jsxs("div",{className:"space-y-2",children:[c,h]}),e[9]=c,e[10]=h,e[11]=o):o=e[11];let m;e[12]!==s?(m=s("sandbox.runtimeFields.packagePath"),e[12]=s,e[13]=m):m=e[13];let f;e[14]!==m?(f=t.jsx(je,{htmlFor:"runtime-path",children:m}),e[14]=m,e[15]=f):f=e[15];let u;e[16]!==n?(u=t.jsx(ve,{control:n,name:"metadata.runtime.path",render:ur}),e[16]=n,e[17]=u):u=e[17];let d;e[18]!==s?(d=s("sandbox.runtimeFields.packagePathDescription"),e[18]=s,e[19]=d):d=e[19];let p;e[20]!==d?(p=t.jsx("p",{className:"text-xs text-muted-foreground",children:d}),e[20]=d,e[21]=p):p=e[21];let x;e[22]!==p||e[23]!==f||e[24]!==u?(x=t.jsxs("div",{className:"space-y-2",children:[f,u,p]}),e[22]=p,e[23]=f,e[24]=u,e[25]=x):x=e[25];let g;e[26]!==s?(g=s("sandbox.runtimeFields.devServerPort"),e[26]=s,e[27]=g):g=e[27];let b;e[28]!==g?(b=t.jsx(je,{htmlFor:"runtime-port",children:g}),e[28]=g,e[29]=b):b=e[29];let y;e[30]!==s?(y=w=>{const{field:N}=w;return t.jsx(Ce,{ref:i,id:"runtime-port",inputMode:"numeric",placeholder:s("sandbox.runtimeFields.auto"),defaultValue:N.value??"",onBlur:_=>{const T=or(_.target.value);T.ok?N.onChange(T.value):i.current&&(i.current.value=N.value??"")}})},e[30]=s,e[31]=y):y=e[31];let j;e[32]!==n||e[33]!==y?(j=t.jsx(ve,{control:n,name:"metadata.runtime.port",render:y}),e[32]=n,e[33]=y,e[34]=j):j=e[34];let v;e[35]!==s?(v=s("sandbox.runtimeFields.devServerPortDescription"),e[35]=s,e[36]=v):v=e[36];let S;e[37]!==v?(S=t.jsx("p",{className:"text-xs text-muted-foreground",children:v}),e[37]=v,e[38]=S):S=e[38];let C;e[39]!==b||e[40]!==j||e[41]!==S?(C=t.jsxs("div",{className:"space-y-2",children:[b,j,S]}),e[39]=b,e[40]=j,e[41]=S,e[42]=C):C=e[42];let M;return e[43]!==x||e[44]!==C||e[45]!==o?(M=t.jsxs("div",{className:"space-y-5",children:[o,x,C]}),e[43]=x,e[44]=C,e[45]=o,e[46]=M):M=e[46],M}function ur(l){const{field:e}=l;return t.jsx(Ce,{id:"runtime-path",placeholder:".",defaultValue:e.value??"",onBlur:n=>{const s=n.target.value.trim();e.onChange(s===""?null:s)}})}function mr(l){return t.jsx(ye,{value:l,children:l},l)}function fr(l){const e=H.c(5),{control:n}=l,s=te();let i;e[0]!==s?(i=c=>{const{field:r}=c;return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(je,{htmlFor:"field-description-tooltips",className:"font-normal text-foreground",children:s("sandbox.fieldDescriptionTooltipsField.label")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("sandbox.fieldDescriptionTooltipsField.description")})]}),t.jsx(dt,{id:"field-description-tooltips",className:"shrink-0",checked:r.value??!1,onCheckedChange:h=>r.onChange(h)})]})},e[0]=s,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=t.jsx(ve,{control:n,name:"metadata.fieldDescriptionTooltips",render:i}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function pr(l){const e=H.c(32),{control:n,onCommit:s}=l,i=te();let a;e[0]!==i?(a=i("virtualMcp.virtualMcp.publishPolicySmart"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("virtualMcp.virtualMcp.publishPolicySmartDescription"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==a||e[5]!==c?(r={value:"smart",label:a,description:c},e[4]=a,e[5]=c,e[6]=r):r=e[6];let h;e[7]!==i?(h=i("virtualMcp.virtualMcp.publishPolicyCodeReview"),e[7]=i,e[8]=h):h=e[8];let o;e[9]!==i?(o=i("virtualMcp.virtualMcp.publishPolicyCodeReviewDescription"),e[9]=i,e[10]=o):o=e[10];let m;e[11]!==h||e[12]!==o?(m={value:"code-review",label:h,description:o},e[11]=h,e[12]=o,e[13]=m):m=e[13];let f;e[14]!==i?(f=i("virtualMcp.virtualMcp.publishPolicyOpen"),e[14]=i,e[15]=f):f=e[15];let u;e[16]!==i?(u=i("virtualMcp.virtualMcp.publishPolicyOpenDescription"),e[16]=i,e[17]=u):u=e[17];let d;e[18]!==f||e[19]!==u?(d={value:"open",label:f,description:u},e[18]=f,e[19]=u,e[20]=d):d=e[20];let p;e[21]!==r||e[22]!==m||e[23]!==d?(p=[r,m,d],e[21]=r,e[22]=m,e[23]=d,e[24]=p):p=e[24];const x=p;let g;e[25]!==s||e[26]!==x||e[27]!==i?(g=y=>{const{field:j}=y,v=j.value??"smart";return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(je,{htmlFor:"publish-policy",className:"font-normal text-foreground",children:i("virtualMcp.virtualMcp.publishing")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("virtualMcp.virtualMcp.publishingDescription")})]}),t.jsxs(Ie,{value:v,onValueChange:S=>{j.onChange(S),s()},children:[t.jsx(De,{id:"publish-policy",className:"w-44 shrink-0 text-sm",children:t.jsx(Pe,{})}),t.jsx(Oe,{className:"max-w-80",children:x.map(hr)})]})]})},e[25]=s,e[26]=x,e[27]=i,e[28]=g):g=e[28];let b;return e[29]!==n||e[30]!==g?(b=t.jsx(ve,{name:"metadata.publishPolicy",control:n,render:g}),e[29]=n,e[30]=g,e[31]=b):b=e[31],b}function hr(l){return t.jsx(ye,{value:l.value,description:l.description,children:l.label},l.value)}function xr(l){const e=H.c(24),{control:n,onCommit:s}=l,i=te();let a;e[0]!==i?(a=i("sandbox.cmsSettings.contentEditing.off"),e[0]=i,e[1]=a):a=e[1];let c;e[2]!==i?(c=i("sandbox.cmsSettings.contentEditing.offDescription"),e[2]=i,e[3]=c):c=e[3];let r;e[4]!==a||e[5]!==c?(r={value:"off",label:a,description:c},e[4]=a,e[5]=c,e[6]=r):r=e[6];let h;e[7]!==i?(h=i("sandbox.cmsSettings.contentEditing.on"),e[7]=i,e[8]=h):h=e[8];let o;e[9]!==i?(o=i("sandbox.cmsSettings.contentEditing.onDescription"),e[9]=i,e[10]=o):o=e[10];let m;e[11]!==h||e[12]!==o?(m={value:"on",label:h,description:o},e[11]=h,e[12]=o,e[13]=m):m=e[13];let f;e[14]!==r||e[15]!==m?(f=[r,m],e[14]=r,e[15]=m,e[16]=f):f=e[16];const u=f;let d;e[17]!==s||e[18]!==u||e[19]!==i?(d=x=>{const{field:g}=x,b=g.value??null,y=zs(b);return t.jsxs("div",{className:"flex items-center justify-between gap-4",children:[t.jsxs("div",{className:"space-y-0.5 min-w-0",children:[t.jsx(je,{htmlFor:"content-editing-mode",className:"font-normal text-foreground",children:i("sandbox.cmsSettings.contentEditing.title")}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.cmsSettings.contentEditing.description")})]}),t.jsxs(Ie,{value:y,onValueChange:j=>{const v=Xi.safeParse(j);v.success&&(g.onChange(Ji(b,v.data)),s())},children:[t.jsx(De,{id:"content-editing-mode",className:"w-44 shrink-0 text-sm",children:t.jsx(Pe,{})}),t.jsx(Oe,{className:"max-w-80",children:u.map(gr)})]})]})},e[17]=s,e[18]=u,e[19]=i,e[20]=d):d=e[20];let p;return e[21]!==n||e[22]!==d?(p=t.jsx(ve,{name:"metadata.ui.layout",control:n,render:d}),e[21]=n,e[22]=d,e[23]=p):p=e[23],p}function gr(l){return t.jsx(ye,{value:l.value,description:l.description,children:l.label},l.value)}function us(l){const e=l.metadata?.sidebarViews,n=l.metadata?.sidebarViewsVersion;return{effectiveViews:[...wt(St(l.metadata),n)],rawViews:e===null?null:e?[...e]:void 0,version:n}}function vr(l,e){return l===e?!0:!l||!e||l.length!==e.length?!1:l.every((n,s)=>n===e[s])}function br(l,e){switch(e.type){case"SET_SHARE_DIALOG_OPEN":return{...l,shareDialogOpen:e.payload};case"SET_ADD_DIALOG_OPEN":return{...l,addDialogOpen:e.payload};case"OPEN_SETTINGS":return{...l,settingsDialogOpen:!0,settingsConnectionId:e.payload};case"CLOSE_SETTINGS":return{...l,settingsDialogOpen:!1,settingsConnectionId:null};default:return l}}function jr(l,e){switch(e.type){case"accumulate":{const n=l??{start:e.now,fields:new Set,saveCount:0,instructionsLength:null},s=new Set(n.fields);for(const i of e.fields)s.add(i);return{...n,fields:s,saveCount:n.saveCount+1,instructionsLength:e.instructionsLength??n.instructionsLength}}case"reset":return null}}function yr(l){const e=l.metadata?.runtime?.env;if(!e||e.length===0)return l;const n=e.filter(s=>{if(!s||typeof s!="object")return!1;const i=(s.key??"").trim();return!i||!mt.test(i)?!1:s.kind==="literal"?!0:s.kind==="secret"?!!s.secretId:!1});return n.length===e.length?l:{...l,metadata:{...l.metadata,runtime:{...l.metadata?.runtime??{},env:n}}}}async function wr(l,e){const n=l?.idToken??null;if(n){const i=ms(n);if(i)return i}const s=l?.userinfoEndpoint??null;if(s)try{const i=await fetch(s,{headers:{Authorization:`Bearer ${e}`}});if(i.ok){const a=await i.json(),c=typeof a.email=="string"?a.email:typeof a.upn=="string"?a.upn:typeof a.preferred_username=="string"?a.preferred_username:null;if(c)return c}}catch{}return ms(e)}function ms(l){try{const e=l.split(".");if(e.length===3&&e[1]){const n=JSON.parse(atob(e[1].replace(/-/g,"+").replace(/_/g,"/")));if(typeof n.email=="string")return n.email;if(typeof n.upn=="string")return n.upn;if(typeof n.preferred_username=="string")return n.preferred_username}}catch{}return null}function Sr({virtualMcp:l}){const e=te(),n=Tn(),{org:s}=Ae(),i=Yn(),{data:a}=Bn([l.id]),c=a?.get(l.id)?.last_used_at,r=ws(),h=bs(),o=Ct(),m=Fs(l.id),f=JSON.stringify([s.id,l.id]),u=Li(l.metadata,m.snapshot()),d=gn({resolver:vn(Ra),defaultValues:{...l,metadata:{...Xt(l.metadata),previewServerUrl:Hi(l.metadata),...u}}}),p=d.watch("connections"),x=$i(l),g=$s(l?.metadata),b=g&&zs(d.watch("metadata.ui.layout"))==="off",y=Ns(l),j=y?{owner:y.owner,name:y.name,url:y.url}:null,[v,S]=Q.useReducer(br,{shareDialogOpen:!1,addDialogOpen:!1,settingsDialogOpen:!1,settingsConnectionId:null}),[C,M]=Q.useState(!1),[w,N]=Q.useState(!1),{openSidePanel:_}=kn(),{sendMessage:T}=Sn(),V=async()=>{if(w)return;const O=d.getValues("metadata.instructions");if(O?.trim()){N(!0);try{E(),Me("agent_instructions_improve_clicked",{agent_id:l.id,instructions_length:O.length}),_();const se=yn(s.id);await T({tiptapDoc:Cn({managerAgentId:se.id,managerName:se.title,kind:"agent",id:l.id,instructions:O})})}finally{N(!1)}}},[I,P]=Q.useReducer(jr,null),F=()=>{I!==null&&(Me("agent_updated",{agent_id:l.id,fields:Array.from(I.fields),instructions_length:I.instructionsLength,save_count:I.saveCount,edit_duration_ms:Date.now()-I.start}),P({type:"reset"}))},{schedule:A,flush:E}=Gt({delayMs:3e4,save:async()=>F()}),L=async()=>{const O=m.snapshot(),se={predicate:ke=>Qt(ke.queryKey,s.id)},q=async()=>(await h.invalidateQueries({predicate:ke=>Qt(ke.queryKey,s.id),refetchType:"all"}),Ht(h,s.id,l.id)),D=(ke,Ye)=>{if(ke){vr(d.getValues("metadata.sidebarViews"),ke.rawViews)||d.setValue("metadata.sidebarViews",ke.rawViews,{shouldDirty:!1}),d.getValues("metadata.sidebarViewsVersion")!==ke.version&&d.setValue("metadata.sidebarViewsVersion",ke.version,{shouldDirty:!1});return}Ye!==null&&(d.setValue("metadata.sidebarViews",[...Ye],{shouldDirty:!1}),d.setValue("metadata.sidebarViewsVersion",Ei,{shouldDirty:!1}))},Z=Ui(O),he=Object.keys(d.control._formState.dirtyFields);if(he.length===0&&!Z){await m.settle({snapshot:O,saved:!0,authoritativeViews:O?.persistedViews});return}const de=he.length>0?he:["metadata"],ge=de.includes("metadata"),Ve=d.getValues();d.reset(Ve,{keepValues:!0});const Qe=yr(Ve),Zs=Ht(h,s.id,l.id),en=Yi({sidebarViews:Qe.metadata?.sidebarViews,sidebarViewsVersion:Qe.metadata?.sidebarViewsVersion},O,Zs?.metadata);Qe.metadata={...Xt(Qe.metadata),...en};let pt;try{pt=await i.update.mutateAsync({id:l.id,data:Qe})}catch(ke){let Ye=null;try{Ye=await q()}catch{}const At=Ye?us(Ye):null,$t=await m.settle({snapshot:O,saved:!1,authoritativeViews:At?.effectiveViews});throw $t.settledLatest&&D(At,$t.reconciledViews),ke}await h.cancelQueries(se),Bi(h,s.id,pt);const Ot=us(pt),It=await m.settle({snapshot:O,saved:!0,authoritativeViews:Ot.effectiveViews});It.settledLatest&&D(Ot,It.reconciledViews),P({type:"accumulate",now:Date.now(),fields:de,instructionsLength:ge?Ve.metadata?.instructions?.length??0:null}),A()},K=()=>dl(f,L),{schedule:B,flush:Y}=Gt({save:K});Q.useEffect(()=>{const O=d.watch(()=>B());return()=>O.unsubscribe()},[]);const U=()=>{Me("connections_dialog_opened",{source:"agent_settings",mode:"add"}),S({type:"SET_ADD_DIALOG_OPEN",payload:!0})},k=async O=>{const se=d.getValues("connections");if(se.some(Z=>Z.connection_id===O))return;d.setValue("connections",[...se,{connection_id:O,selected_tools:vt.tools,selected_resources:vt.resources,selected_prompts:vt.prompts}],{shouldDirty:!0}),S({type:"SET_ADD_DIALOG_OPEN",payload:!1});const q=new URL(`/api/${s.slug}/mcp/${O}`,window.location.origin),D=await Ut({url:q.href,token:null,orgId:s.id});D.supportsOAuth&&!D.isAuthenticated&&await W(O)},$=O=>{const q=d.getValues("connections").filter(D=>D.connection_id!==O);d.setValue("connections",q,{shouldDirty:!0})},G=(O,se)=>{const q=d.getValues("connections");if(q.some(D=>D.connection_id===se)){re.error(e("virtualMcp.virtualMcp.instanceAlreadyAdded"));return}d.setValue("connections",q.map(D=>D.connection_id===O?{...D,connection_id:se}:D),{shouldDirty:!0})},R=async O=>{if(d.getValues("connections").find(q=>q.connection_id===O))try{const{item:q}=await o.call("COLLECTION_CONNECTIONS_GET",{id:O});if(!q)return;const D=q.title.replace(/\s*\(.*?\)\s*$/,""),Z=wn("conn"),he=`${D} (${Date.now().toString(36).slice(-4)})`;await r.create.mutateAsync({id:Z,title:he,description:q.description??null,connection_type:q.connection_type,connection_url:q.connection_url??null,connection_token:null,icon:q.icon??null,app_name:q.app_name??null,app_id:q.app_id??null,connection_headers:q.connection_headers??null});const de=new URL(`/api/${s.slug}/mcp/${Z}`,window.location.origin),ge=await Ut({url:de.href,token:null,orgId:s.id});if(ge.supportsOAuth&&!ge.isAuthenticated){const Ve=await W(Z);if(!Ve){await r.delete.mutateAsync(Z);return}await r.update.mutateAsync({id:Z,data:{title:`${D} (${Ve})`}})}G(O,Z),re.success(e("virtualMcp.virtualMcp.newInstanceCreated"))}catch(q){console.error("Failed to create instance:",q),re.error(e("virtualMcp.virtualMcp.failedToCreateInstance"))}},z=O=>{S({type:"OPEN_SETTINGS",payload:O})},W=async O=>{const{token:se,tokenInfo:q,error:D}=await Pn({connectionId:O,orgSlug:s.slug,scope:"offline_access"});if(D||!se)return re.error(e("virtualMcp.virtualMcp.authenticationFailed",{error:D??""})),null;if(q)try{const he=await fetch(`/api/${s.slug}/connections/${O}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:q.accessToken,refreshToken:q.refreshToken,expiresIn:q.expiresIn,scope:q.scope,clientId:q.clientId,clientSecret:q.clientSecret,tokenEndpoint:q.tokenEndpoint})});if(!he.ok)console.error("Failed to save OAuth token:",await he.text()),await r.update.mutateAsync({id:O,data:{connection_token:se}});else try{await r.update.mutateAsync({id:O,data:{}})}catch(de){console.warn("Failed to refresh connection tools after OAuth:",de)}}catch(he){console.error("Error saving OAuth token:",he),await r.update.mutateAsync({id:O,data:{connection_token:se}})}else await r.update.mutateAsync({id:O,data:{connection_token:se}});const Z=new URL(`/api/${s.slug}/mcp/${O}`,window.location.origin);return await h.invalidateQueries({queryKey:Mt.isMCPAuthenticated(Z.href,null)}),re.success(e("virtualMcp.virtualMcp.authenticationSuccessful")),wr(q,se)},X=()=>{const O=d.getValues("metadata.instructions")??"",se=e("virtualMcp.virtualMcp.promptTemplateContent"),q=O.trim()?`${O}
|
|
3
|
-
|
|
4
|
-
${se}`:se;d.setValue("metadata.instructions",q,{shouldDirty:!0})},ie=new Set(p.map(O=>O.connection_id)),{section:J}=Da(),oe=Fi(l.id)==="v8",le=Ma({virtualMcpId:l.id,form:d,flushAndSave:Y}),ce=kt(),[ee,ue]=Q.useState(!1),fe=async()=>{E();try{await i.delete.mutateAsync(l.id),Me("agent_deleted",{agent_id:l.id,source:"agent_detail"}),re.success(e("virtualMcp.virtualMcp.agentDeleted",{title:l.title})),ce({to:"/$org",params:{org:s.slug}})}catch{}},pe=t.jsxs(ne,{variant:"outline",size:"sm",onClick:()=>{Me("agent_connect_modal_opened",{agent_id:l.id}),S({type:"SET_SHARE_DIALOG_OPEN",payload:!0})},children:[t.jsx(bn,{size:14}),e("virtualMcp.virtualMcp.connect")]}),me=t.jsxs("div",{className:"flex items-center gap-2",children:[!d.watch("metadata.instructions")?.trim()&&t.jsx(ne,{variant:"outline",size:"sm",onClick:X,children:e("virtualMcp.virtualMcp.promptTemplate")}),t.jsxs(ne,{variant:"outline",size:"sm",disabled:w||!d.watch("metadata.instructions")?.trim(),onClick:V,children:[t.jsx(lt,{size:13}),e("virtualMcp.virtualMcp.improve")]})]});return t.jsxs(Re,{children:[t.jsxs(t.Fragment,{children:[t.jsx(Re.Title,{children:e("virtualMcp.settings.title")}),t.jsx(Ta,{section:J??"general"}),t.jsx(Re.Actions,{secondary:J==="connections"?pe:void 0,children:J==="connections"?t.jsxs(ne,{size:"sm",onClick:U,children:[t.jsx(Te,{size:14}),e("virtualMcp.virtualMcp.addConnection")]}):pe}),t.jsx(Re.Content,{children:t.jsx(Re.Container,{width:"standard",className:"@container/project-settings",children:t.jsxs(jn,{children:[J==="general"&&t.jsx(Sa,{views:le}),J==="general"&&t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(ka,{form:d,onCommit:Y}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 text-xs text-muted-foreground",children:[t.jsx(Nn,{id:l.created_by,size:"2xs",className:"text-sm text-muted-foreground"}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsxs("span",{children:[e("virtualMcp.virtualMcp.created")," ",Al(new Date(l.created_at),"PP",{locale:n})]}),t.jsx("span",{className:"text-muted-foreground/50",children:"·"}),t.jsx("span",{children:c?e("virtualMcp.virtualMcp.lastUsed",{time:Dn(new Date(c),{addSuffix:!0,locale:n})}):e("virtualMcp.virtualMcp.neverUsed")})]})]}),J==="connections"&&t.jsx("section",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:p.length===0?t.jsxs("button",{type:"button",onClick:U,className:"flex items-center gap-3 px-3 py-2.5 rounded-lg border border-dashed border-border hover:bg-accent/50 transition-colors w-full text-left cursor-pointer",children:[t.jsx("div",{className:"flex items-center justify-center size-8 rounded-md text-muted-foreground/75 border border-dashed border-border shrink-0",children:t.jsx(Te,{size:16})}),t.jsx("span",{className:"text-sm text-muted-foreground",children:e("virtualMcp.virtualMcp.noConnectionsYet")})]}):p.map(O=>t.jsx(Le,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsx(Gs,{}),children:t.jsx(ua,{connection_id:O.connection_id,usedConnectionIds:ie,onOpenSettings:()=>z(O.connection_id),onRemove:()=>$(O.connection_id),onAuthenticate:W,onSwitchInstance:G,onNewInstance:()=>R(O.connection_id)})})},O.connection_id))})}),J==="general"&&t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcp.instructions")}),me]}),t.jsx(ve,{name:"metadata.instructions",control:d.control,render:({field:O})=>t.jsxs("div",{className:"relative rounded-xl card-shadow bg-card focus-within:ring-1 focus-within:ring-ring",children:[t.jsx(at,{...O,value:O.value??"",onChange:se=>{O.onChange(se)},onBlur:()=>{O.onBlur(),Y()},placeholder:e("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"min-h-[200px] max-h-[360px] overflow-auto resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed border-0 shadow-none px-4 py-3 pr-11 focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent",style:{boxShadow:"none"}}),t.jsxs(we,{delayDuration:0,children:[t.jsx(Se,{asChild:!0,children:t.jsx(ne,{type:"button",variant:"ghost",size:"icon",className:"absolute top-2 right-2 h-7 w-7 text-muted-foreground",onClick:()=>M(!0),"aria-label":e("virtualMcp.virtualMcp.openFullscreenEditor"),children:t.jsx(fi,{size:14})})}),t.jsx(Ne,{side:"left",children:e("virtualMcp.virtualMcp.fullscreen")})]})]})})]}),J==="general"&&t.jsx(Fl,{form:d}),J==="general"&&t.jsx(Le,{fallback:()=>null,children:t.jsx(Q.Suspense,{fallback:t.jsxs("section",{className:"flex flex-col gap-3",children:[t.jsx("h2",{className:"text-sm font-medium text-foreground",children:e("virtualMcp.virtualMcp.subAgents")}),t.jsx("div",{className:"h-16 rounded-lg border border-dashed border-border animate-pulse"})]}),children:t.jsx(Kl,{form:d,currentAgentId:l.id})})}),J==="site"&&g&&t.jsx(Ue,{title:e("sandbox.cmsSettings.title"),children:t.jsxs(Fe,{children:[t.jsx(be,{children:t.jsx(xr,{control:d.control,onCommit:Y})}),!b&&t.jsx(be,{children:t.jsx(fr,{control:d.control})}),!b&&x&&t.jsx(be,{children:t.jsx(pr,{control:d.control,onCommit:Y})})]})}),J==="site"&&!b&&t.jsx(Ue,{title:e("sandbox.cmsSettings.preview.title"),description:e("sandbox.cmsSettings.preview.description"),children:t.jsx(Fe,{children:t.jsx(za,{control:d.control,isBlocksV8:oe,previewServerUrl:d.watch("metadata.previewServerUrl"),fastPreview:d.watch("metadata.fastPreview")})})}),J==="site"&&oe&&x&&t.jsx(Ia,{orgSlug:s.slug,virtualMcpId:l.id}),J==="site"&&t.jsx(Ue,{title:e("virtualMcp.virtualMcp.sandbox"),children:t.jsxs(Fe,{children:[t.jsx(be,{children:t.jsx(ar,{repo:j})}),t.jsx(be,{children:t.jsx(dr,{control:d.control})}),t.jsx(be,{children:t.jsx(Ja,{control:d.control,form:d,virtualMcpId:l.id,orgSlug:s.slug,sandboxMap:l.metadata.sandboxMap})})]})}),J==="general"&&t.jsx(Ue,{title:e("virtualMcp.settings.groups.advanced"),children:t.jsx(Fe,{children:t.jsx(Xe,{title:e("virtualMcp.virtualMcp.deleteAgent"),description:e("virtualMcp.virtualMcp.deleteAgentDescription"),action:t.jsxs(ne,{variant:"outline",size:"sm",className:"text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:()=>ue(!0),children:[t.jsx(Vt,{size:14}),e("virtualMcp.virtualMcp.deleteAgent")]})})})})]})})},J)]}),t.jsx(On,{open:ee,onOpenChange:ue,children:t.jsxs(In,{children:[t.jsxs(An,{children:[t.jsx($n,{children:e("virtualMcp.virtualMcp.deleteAgentConfirm")}),t.jsx(Fn,{children:e("virtualMcp.virtualMcp.deleteAgentConfirmDescription",{title:l.title})})]}),t.jsxs(En,{children:[t.jsx(zn,{children:e("virtualMcp.virtualMcp.cancel")}),t.jsx(Rn,{onClick:fe,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:e("virtualMcp.virtualMcp.delete")})]})]})}),t.jsx(hi,{open:v.addDialogOpen,onOpenChange:O=>S({type:"SET_ADD_DIALOG_OPEN",payload:O}),agentId:l.id,addedConnectionIds:ie,onAdd:k}),t.jsx(da,{open:v.settingsDialogOpen,onOpenChange:O=>{O||S({type:"CLOSE_SETTINGS"})},selectedId:v.settingsConnectionId,form:d,connections:p,onAuthenticate:W}),t.jsx(Ha,{open:v.shareDialogOpen,onOpenChange:O=>S({type:"SET_SHARE_DIALOG_OPEN",payload:O}),virtualMcp:l}),t.jsx(Ge,{open:C,onOpenChange:M,children:t.jsxs(qe,{className:"w-[90vw] sm:max-w-6xl h-[85vh] flex flex-col p-0 gap-0",children:[t.jsx(tt,{className:"px-6 pt-6 pb-3 border-b border-border shrink-0",children:t.jsx(st,{children:e("virtualMcp.virtualMcp.instructions")})}),t.jsx("div",{className:"flex-1 min-h-0 p-6",children:t.jsx(ve,{name:"metadata.instructions",control:d.control,render:({field:O})=>t.jsx(at,{...O,value:O.value??"",onChange:se=>{O.onChange(se)},onBlur:()=>{O.onBlur(),Y()},placeholder:e("virtualMcp.virtualMcp.instructionsPlaceholder"),className:"w-full h-full resize-none text-base text-muted-foreground placeholder:text-muted-foreground/40 leading-relaxed rounded-xl card-shadow px-4 py-3 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0 bg-card border-0",style:{boxShadow:"none"}})})})]})})]})}function Nr(l){const e=H.c(21),{virtualMcpId:n}=l,s=te(),i=kt(),{org:a}=Ae(),c=Ss(n);if(!c){let m;e[0]!==s?(m=s("virtualMcp.virtualMcp.spaceNotFound"),e[0]=s,e[1]=m):m=e[1];let f;e[2]!==s?(f=s("virtualMcp.virtualMcp.spaceNotFoundDescription"),e[2]=s,e[3]=f):f=e[3];let u;e[4]!==i||e[5]!==a.slug?(u=()=>i({to:"/$org",params:{org:a.slug}}),e[4]=i,e[5]=a.slug,e[6]=u):u=e[6];let d;e[7]!==s?(d=s("virtualMcp.virtualMcp.backToSpaces"),e[7]=s,e[8]=d):d=e[8];let p;e[9]!==u||e[10]!==d?(p=t.jsx(ne,{variant:"outline",onClick:u,children:d}),e[9]=u,e[10]=d,e[11]=p):p=e[11];let x;return e[12]!==m||e[13]!==f||e[14]!==p?(x=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Mn,{title:m,description:f,actions:p})}),e[12]=m,e[13]=f,e[14]=p,e[15]=x):x=e[15],x}let r;e[16]!==c?(r=Ns(c)?.connectionId??"",e[16]=c,e[17]=r):r=e[17];const h=`${c.id}:${r}`;let o;return e[18]!==h||e[19]!==c?(o=t.jsx(Sr,{virtualMcp:c},h),e[18]=h,e[19]=c,e[20]=o):o=e[20],o}function Fo(l){const e=H.c(2),{virtualMcpId:n}=l;let s;return e[0]!==n?(s=t.jsx(Nr,{virtualMcpId:n}),e[0]=n,e[1]=s):s=e[1],s}export{Fo as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as R,b as J,e as st,j as n,B as F,t as We,bX as fe,af as Tt,a as Be,G as Vt,R as Nt,K as Ue,bY as Wt,bZ as Yt,av as Ke,l as ht,aZ as Qt,x as gt,r as se,ac as Xt,ae as re,s as _t,v as Pt,q as At,D as Ct,d as Et,a2 as mt,J as Ot,m as He,y as ct,aL as It,b_ as Zt,aR as en,aW as pt,F as tn,b$ as nn,aM as sn,w as on,c0 as an,c1 as rn,c2 as ln,c3 as cn,c4 as dn,a3 as un,u as mn,a4 as fn,c5 as hn,c6 as gn,k as $t,c7 as rt,c8 as pn,c9 as yn,O as bn,_ as xn}from"./index-BWTgolHq.js";import{A as it}from"./avatar-CyNf-6_F.js";import{t as Lt}from"./Building02-IqnVnQlH.js";import{i as Sn,s as ae}from"./UserSquare-CGjgJJpx.js";import{az as wn,M as vn,E as lt,a8 as jn,H as kn,aA as Tn,n as yt,g as Nn,m as _n,h as Pn,aB as An,j as Cn}from"./agent-icon-BHy2guMB.js";import{s as En}from"./XClose-BuC3W9yJ.js";import{a as On,u as In}from"./use-project-scope-BXg9r_gM.js";import{u as Dt,a as $n}from"./use-panel-navigate-D4pXDoq7.js";import{i as de}from"./CheckCircle-BXGWQUO5.js";import{i as bt}from"./Monitor01-hYg_Be5C.js";import{i as qe}from"./ZoomOut-CGlQyhZZ.js";import{u as Ln}from"./use-clock-tick-BbJsFu3S.js";import{s as xt}from"./Plus-G2W3_cG_.js";import{a as Dn}from"./Tool01-Dqha0FcH.js";import{b as le,a as Je,f as Rn,e as Fn,c as Mn,C as zn}from"./command-B-QWvhA_.js";import{I as qn}from"./integration-icon-D-o_SFdv.js";import{P as Kn}from"./project-icon-BjvkvrtX.js";import{a as Bn,m as Hn}from"./use-mcp-client-BTt1-Bfm.js";import{u as Un,a as Gn,n as Jn}from"./new-project-dialog-CYT_10rE.js";import{S as Vn,u as Wn}from"./thread-intent-qJ1dqLJM.js";import{R as Yn}from"./required-auth-layout-DsBgIeQB.js";import{A as Qn}from"./autosend-CRyjUv4T.js";import{u as Xn,a as Zn,b as es,c as ts}from"./thread-route-DC0mp3BO.js";import{u as ns}from"./use-org-sso-MEPKdW59.js";function ss(t){const e=R.c(49),{orgName:o,orgSlug:r,orgLogo:s,domain:a}=t,i=J();let c;e[0]!==r||e[1]!==i?(c=async()=>{const p=await fetch("/api/auth/custom/domain-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),A=await p.json();if(!p.ok||!A.success)throw new Error(A.error??i("common.autoDomainJoinScreen.joinError"));return A},e[0]=r,e[1]=i,e[2]=c):c=e[2];let m;e[3]!==r?(m=p=>{window.location.href=`/${p.slug??r}`},e[3]=r,e[4]=m):m=e[4];let h;e[5]!==i?(h=p=>{We.error(p instanceof Error?p.message:i("common.autoDomainJoinScreen.joinError"))},e[5]=i,e[6]=h):h=e[6];let w;e[7]!==c||e[8]!==m||e[9]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[7]=c,e[8]=m,e[9]=h,e[10]=w):w=e[10];const u=st(w),y=os;let l;e[11]!==s||e[12]!==o?(l=s?n.jsx(it,{url:s,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Lt,{className:"h-6 w-6 text-primary"})}),e[11]=s,e[12]=o,e[13]=l):l=e[13];let g;e[14]!==o||e[15]!==i?(g=i("common.autoDomainJoinScreen.joinPrompt",{orgName:o}),e[14]=o,e[15]=i,e[16]=g):g=e[16];let f;e[17]!==g?(f=n.jsx("h3",{className:"text-lg font-medium",children:g}),e[17]=g,e[18]=f):f=e[18];let d;e[19]!==a||e[20]!==i?(d=i("common.autoDomainJoinScreen.joinDescription",{domain:a}),e[19]=a,e[20]=i,e[21]=d):d=e[21];let x;e[22]!==d?(x=n.jsx("p",{className:"text-sm text-muted-foreground",children:d}),e[22]=d,e[23]=x):x=e[23];let b;e[24]!==f||e[25]!==x?(b=n.jsxs("div",{className:"space-y-2",children:[f,x]}),e[24]=f,e[25]=x,e[26]=b):b=e[26];let S;e[27]!==u?(S=()=>u.mutate(),e[27]=u,e[28]=S):S=e[28];let j;e[29]!==u.isPending||e[30]!==o||e[31]!==i?(j=u.isPending?i("common.autoDomainJoinScreen.joining"):i("common.autoDomainJoinScreen.enterOrg",{orgName:o}),e[29]=u.isPending,e[30]=o,e[31]=i,e[32]=j):j=e[32];let P;e[33]!==u.isPending||e[34]!==S||e[35]!==j?(P=n.jsx(F,{onClick:S,disabled:u.isPending,children:j}),e[33]=u.isPending,e[34]=S,e[35]=j,e[36]=P):P=e[36];const k=u.isPending;let v;e[37]!==i?(v=i("common.goHome"),e[37]=i,e[38]=v):v=e[38];let T;e[39]!==u.isPending||e[40]!==v?(T=n.jsx(F,{variant:"ghost",onClick:y,disabled:k,children:v}),e[39]=u.isPending,e[40]=v,e[41]=T):T=e[41];let N;e[42]!==P||e[43]!==T?(N=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[P,T]}),e[42]=P,e[43]=T,e[44]=N):N=e[44];let _;return e[45]!==b||e[46]!==N||e[47]!==l?(_=n.jsxs(fe,{children:[l,b,N]}),e[45]=b,e[46]=N,e[47]=l,e[48]=_):_=e[48],_}function os(){window.location.href="/"}function St(t){const e=R.c(25),{orgSlug:o,orgName:r,reason:s}=t,a=J(),i=is,c=s==="not-found",m=c?Sn:Tt;let h;e[0]!==c||e[1]!==a?(h=a(c?"common.noAccessScreen.organizationNotFound":"common.noAccessScreen.noAccess"),e[0]=c,e[1]=a,e[2]=h):h=e[2];const w=h;let u;e[3]!==c||e[4]!==r||e[5]!==o||e[6]!==a?(u=c?n.jsxs(n.Fragment,{children:[a("common.noAccessScreen.couldNotFind")," ",n.jsx("strong",{children:o}),"."]}):n.jsxs(n.Fragment,{children:[a("common.noAccessScreen.noAccessTo")," ",n.jsx("strong",{children:r??o}),".",n.jsx("br",{}),a("common.noAccessScreen.askAdminToInvite")]}),e[3]=c,e[4]=r,e[5]=o,e[6]=a,e[7]=u):u=e[7];const y=u;let l;e[8]!==m?(l=n.jsx("div",{className:"bg-muted p-3 rounded-full",children:n.jsx(m,{className:"h-6 w-6 text-muted-foreground"})}),e[8]=m,e[9]=l):l=e[9];let g;e[10]!==w?(g=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[10]=w,e[11]=g):g=e[11];let f;e[12]!==y?(f=n.jsx("p",{className:"text-sm text-muted-foreground",children:y}),e[12]=y,e[13]=f):f=e[13];let d;e[14]!==g||e[15]!==f?(d=n.jsxs("div",{className:"space-y-2",children:[g,f]}),e[14]=g,e[15]=f,e[16]=d):d=e[16];let x;e[17]!==a?(x=a("common.goHome"),e[17]=a,e[18]=x):x=e[18];let b;e[19]!==x?(b=n.jsx(F,{onClick:i,children:x}),e[19]=x,e[20]=b):b=e[20];let S;return e[21]!==l||e[22]!==d||e[23]!==b?(S=n.jsxs(fe,{children:[l,d,b]}),e[21]=l,e[22]=d,e[23]=b,e[24]=S):S=e[24],S}function is(){window.location.href="/"}function as(t){const e=R.c(59),{invitationId:o,orgName:r,orgSlug:s,orgLogo:a}=t,i=J();let c;e[0]!==o?(c=async()=>{const C=await Be.organization.acceptInvitation({invitationId:o});if(C.error)throw new Error(C.error.message);return C.data},e[0]=o,e[1]=c):c=e[1];let m;e[2]!==s?(m=()=>{Vt(),window.location.href=`/${s}`},e[2]=s,e[3]=m):m=e[3];let h;e[4]!==i?(h=C=>{We.error(C instanceof Error?C.message:i("common.pendingInviteScreen.failedToAccept"))},e[4]=i,e[5]=h):h=e[5];let w;e[6]!==c||e[7]!==m||e[8]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[6]=c,e[7]=m,e[8]=h,e[9]=w):w=e[9];const u=st(w);let y;e[10]!==o?(y=async()=>{const C=await Be.organization.rejectInvitation({invitationId:o});if(C.error)throw new Error(C.error.message);return C.data},e[10]=o,e[11]=y):y=e[11];let l,g;e[12]!==i?(l=()=>{We.success(i("common.pendingInviteScreen.invitationDeclined")),window.location.href="/"},g=C=>{We.error(C instanceof Error?C.message:i("common.pendingInviteScreen.failedToDecline"))},e[12]=i,e[13]=l,e[14]=g):(l=e[13],g=e[14]);let f;e[15]!==y||e[16]!==l||e[17]!==g?(f={mutationFn:y,onSuccess:l,onError:g},e[15]=y,e[16]=l,e[17]=g,e[18]=f):f=e[18];const d=st(f),x=u.isPending||d.isPending;let b;e[19]!==a||e[20]!==r?(b=a?n.jsx(it,{url:a,fallback:r.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(wn,{className:"h-6 w-6 text-primary"})}),e[19]=a,e[20]=r,e[21]=b):b=e[21];let S;e[22]!==r||e[23]!==i?(S=i("common.pendingInviteScreen.invitedTo",{orgName:r}),e[22]=r,e[23]=i,e[24]=S):S=e[24];let j;e[25]!==S?(j=n.jsx("h3",{className:"text-lg font-medium",children:S}),e[25]=S,e[26]=j):j=e[26];let P;e[27]!==i?(P=i("common.pendingInviteScreen.acceptDescription"),e[27]=i,e[28]=P):P=e[28];let k;e[29]!==P?(k=n.jsx("p",{className:"text-sm text-muted-foreground",children:P}),e[29]=P,e[30]=k):k=e[30];let v;e[31]!==j||e[32]!==k?(v=n.jsxs("div",{className:"space-y-2",children:[j,k]}),e[31]=j,e[32]=k,e[33]=v):v=e[33];let T;e[34]!==u?(T=()=>u.mutate(),e[34]=u,e[35]=T):T=e[35];let N;e[36]!==u.isPending||e[37]!==i?(N=u.isPending?i("common.pendingInviteScreen.acceptingButton"):i("common.pendingInviteScreen.acceptButton"),e[36]=u.isPending,e[37]=i,e[38]=N):N=e[38];let _;e[39]!==x||e[40]!==T||e[41]!==N?(_=n.jsx(F,{onClick:T,disabled:x,children:N}),e[39]=x,e[40]=T,e[41]=N,e[42]=_):_=e[42];let p;e[43]!==d?(p=()=>d.mutate(),e[43]=d,e[44]=p):p=e[44];let A;e[45]!==d.isPending||e[46]!==i?(A=d.isPending?i("common.pendingInviteScreen.decliningButton"):i("common.pendingInviteScreen.declineButton"),e[45]=d.isPending,e[46]=i,e[47]=A):A=e[47];let $;e[48]!==x||e[49]!==p||e[50]!==A?($=n.jsx(F,{variant:"ghost",onClick:p,disabled:x,children:A}),e[48]=x,e[49]=p,e[50]=A,e[51]=$):$=e[51];let I;e[52]!==_||e[53]!==$?(I=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[_,$]}),e[52]=_,e[53]=$,e[54]=I):I=e[54];let D;return e[55]!==v||e[56]!==I||e[57]!==b?(D=n.jsxs(fe,{children:[b,v,I]}),e[55]=v,e[56]=I,e[57]=b,e[58]=D):D=e[58],D}function rs(t){const e=R.c(23),{orgName:o,orgLogo:r}=t,s=J();let a;e[0]!==r||e[1]!==o?(a=r?n.jsx(it,{url:r,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:n.jsx(vn,{className:"h-6 w-6 text-primary"})}),e[0]=r,e[1]=o,e[2]=a):a=e[2];let i;e[3]!==s?(i=s("common.requestPendingScreen.title"),e[3]=s,e[4]=i):i=e[4];let c;e[5]!==i?(c=n.jsx("h3",{className:"text-lg font-medium",children:i}),e[5]=i,e[6]=c):c=e[6];let m;e[7]!==o||e[8]!==s?(m=s("common.requestPendingScreen.description",{orgName:o}),e[7]=o,e[8]=s,e[9]=m):m=e[9];let h;e[10]!==m?(h=n.jsx("p",{className:"text-sm text-muted-foreground",children:m}),e[10]=m,e[11]=h):h=e[11];let w;e[12]!==c||e[13]!==h?(w=n.jsxs("div",{className:"space-y-2",children:[c,h]}),e[12]=c,e[13]=h,e[14]=w):w=e[14];let u;e[15]!==s?(u=s("common.goHome"),e[15]=s,e[16]=u):u=e[16];let y;e[17]!==u?(y=n.jsx(F,{variant:"ghost",onClick:ls,children:u}),e[17]=u,e[18]=y):y=e[18];let l;return e[19]!==a||e[20]!==w||e[21]!==y?(l=n.jsxs(fe,{children:[a,w,y]}),e[19]=a,e[20]=w,e[21]=y,e[22]=l):l=e[22],l}function ls(){window.location.href="/"}function cs(t){const e=R.c(45),{orgName:o,orgSlug:r,orgLogo:s,domain:a}=t,i=J();let c;e[0]!==r?(c=async()=>{const _=await fetch("/api/auth/custom/domain-request-join",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationSlug:r})}),p=await _.json();if(!_.ok||!p.success)throw new Error(p.error??"Failed to request access");return p},e[0]=r,e[1]=c):c=e[1];let m;e[2]===Symbol.for("react.memo_cache_sentinel")?(m=us,e[2]=m):m=e[2];let h;e[3]!==i?(h=_=>{We.error(_ instanceof Error?_.message:i("common.requestToJoinScreen.failedToRequest"))},e[3]=i,e[4]=h):h=e[4];let w;e[5]!==c||e[6]!==h?(w={mutationFn:c,onSuccess:m,onError:h},e[5]=c,e[6]=h,e[7]=w):w=e[7];const u=st(w);let y;e[8]!==s||e[9]!==o?(y=s?n.jsx(it,{url:s,fallback:o.charAt(0).toUpperCase(),shape:"square",size:"base",className:"h-12 w-12"}):n.jsx("div",{className:"bg-primary/10 p-3 rounded-full",children:n.jsx(Lt,{className:"h-6 w-6 text-primary"})}),e[8]=s,e[9]=o,e[10]=y):y=e[10];let l;e[11]!==o||e[12]!==i?(l=i("common.requestToJoinScreen.title",{orgName:o}),e[11]=o,e[12]=i,e[13]=l):l=e[13];let g;e[14]!==l?(g=n.jsx("h3",{className:"text-lg font-medium",children:l}),e[14]=l,e[15]=g):g=e[15];let f;e[16]!==a||e[17]!==i?(f=i("common.requestToJoinScreen.description",{domain:a}),e[16]=a,e[17]=i,e[18]=f):f=e[18];let d;e[19]!==f?(d=n.jsx("p",{className:"text-sm text-muted-foreground",children:f}),e[19]=f,e[20]=d):d=e[20];let x;e[21]!==g||e[22]!==d?(x=n.jsxs("div",{className:"space-y-2",children:[g,d]}),e[21]=g,e[22]=d,e[23]=x):x=e[23];let b;e[24]!==u?(b=()=>u.mutate(),e[24]=u,e[25]=b):b=e[25];let S;e[26]!==u.isPending||e[27]!==i?(S=u.isPending?i("common.requestToJoinScreen.requesting"):i("common.requestToJoinScreen.requestButton"),e[26]=u.isPending,e[27]=i,e[28]=S):S=e[28];let j;e[29]!==u.isPending||e[30]!==b||e[31]!==S?(j=n.jsx(F,{onClick:b,disabled:u.isPending,children:S}),e[29]=u.isPending,e[30]=b,e[31]=S,e[32]=j):j=e[32];const P=u.isPending;let k;e[33]!==i?(k=i("common.goHome"),e[33]=i,e[34]=k):k=e[34];let v;e[35]!==u.isPending||e[36]!==k?(v=n.jsx(F,{variant:"ghost",onClick:ds,disabled:P,children:k}),e[35]=u.isPending,e[36]=k,e[37]=v):v=e[37];let T;e[38]!==j||e[39]!==v?(T=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[j,v]}),e[38]=j,e[39]=v,e[40]=T):T=e[40];let N;return e[41]!==x||e[42]!==T||e[43]!==y?(N=n.jsxs(fe,{children:[y,x,T]}),e[41]=x,e[42]=T,e[43]=y,e[44]=N):N=e[44],N}function ds(){window.location.href="/"}function us(t){if(t.alreadyMember&&t.slug){window.location.href=`/${t.slug}`;return}window.location.reload()}function ms(t){const e=R.c(7);let o;e[0]!==t?(o=Ue.orgAccessStatus(t),e[0]=t,e[1]=o):o=e[1];let r;e[2]!==t?(r=async()=>{const a=await fetch(`/api/auth/custom/org-access-status/${encodeURIComponent(t)}`,{credentials:"include"});if(!a.ok)throw new Error(`org-access-status failed (${a.status})`);return await a.json()},e[2]=t,e[3]=r):r=e[3];let s;return e[4]!==o||e[5]!==r?(s={queryKey:o,queryFn:r,refetchOnWindowFocus:!1},e[4]=o,e[5]=r,e[6]=s):s=e[6],Nt(s)}function fs({orgSlug:t}){const{data:e}=ms(t);if(e.status!=="member"){Wt()?.org===t&&Yt();const o=localStorage.getItem(Ke.lastOrgSlug())===t;if(o&&localStorage.removeItem(Ke.lastOrgSlug()),o&&(e.status==="not-found"||e.status==="no-access"))return window.location.href="/",null}return e.status==="not-found"?n.jsx(St,{orgSlug:t,reason:"not-found"}):e.status==="pending-invite"?n.jsx(as,{invitationId:e.invitation.id,orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo}):e.status==="auto-domain-join"?n.jsx(ss,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="can-request"?n.jsx(cs,{orgName:e.organization.name,orgSlug:e.organization.slug,orgLogo:e.organization.logo,domain:e.organization.domain??""}):e.status==="request-pending"?n.jsx(rs,{orgName:e.organization.name,orgLogo:e.organization.logo}):e.status==="member"?(window.location.reload(),null):n.jsx(St,{orgSlug:t,orgName:e.organization.name,reason:"no-access"})}function Rt(t){const e=R.c(42),{ariaLabel:o,dismissLabel:r,eyebrow:s,title:a,description:i,icon:c,children:m,footerLeading:h,actions:w,onDismiss:u,tone:y}=t,l=y===void 0?"neutral":y,g=h||w;let f;e[0]!==l?(f=l==="system"&&n.jsx("div",{className:"h-0.5 bg-special"}),e[0]=l,e[1]=f):f=e[1];let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=n.jsx(En,{size:14}),e[2]=d):d=e[2];let x;e[3]!==r||e[4]!==u?(x=n.jsx(F,{size:"icon-sm",variant:"ghost","aria-label":r,className:"absolute right-2 top-2 z-10 text-muted-foreground",onClick:u,children:d}),e[3]=r,e[4]=u,e[5]=x):x=e[5];const b=c&&"flex items-start gap-3",S=m&&"pb-3";let j;e[6]!==b||e[7]!==S?(j=ht("p-4 pr-11",b,S),e[6]=b,e[7]=S,e[8]=j):j=e[8];let P;e[9]!==c?(P=c&&n.jsx("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-lg bg-special/10 text-special",children:c}),e[9]=c,e[10]=P):P=e[10];let k;e[11]!==s?(k=s&&n.jsx("p",{className:"text-xs text-muted-foreground",children:s}),e[11]=s,e[12]=k):k=e[12];let v;e[13]!==a?(v=n.jsx("h3",{className:"text-base font-semibold text-foreground",children:a}),e[13]=a,e[14]=v):v=e[14];let T;e[15]!==i?(T=i&&n.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:i}),e[15]=i,e[16]=T):T=e[16];let N;e[17]!==v||e[18]!==T||e[19]!==k?(N=n.jsxs("div",{children:[k,v,T]}),e[17]=v,e[18]=T,e[19]=k,e[20]=N):N=e[20];let _;e[21]!==m?(_=m&&n.jsx("div",{className:"mt-3",children:m}),e[21]=m,e[22]=_):_=e[22];let p;e[23]!==N||e[24]!==_?(p=n.jsxs("div",{className:"min-w-0 flex-1",children:[N,_]}),e[23]=N,e[24]=_,e[25]=p):p=e[25];let A;e[26]!==p||e[27]!==j||e[28]!==P?(A=n.jsxs("div",{className:j,children:[P,p]}),e[26]=p,e[27]=j,e[28]=P,e[29]=A):A=e[29];let $;e[30]!==w||e[31]!==h||e[32]!==g||e[33]!==l?($=g&&n.jsxs("div",{className:ht("flex items-center justify-between gap-3 px-4 py-2.5",l==="system"?"border-t border-border bg-muted/50":"pt-0"),children:[n.jsx("div",{className:"min-w-0 text-xs text-muted-foreground",children:h}),n.jsx("div",{className:"flex shrink-0 items-center gap-2",children:w})]}),e[30]=w,e[31]=h,e[32]=g,e[33]=l,e[34]=$):$=e[34];let I;return e[35]!==o||e[36]!==A||e[37]!==$||e[38]!==f||e[39]!==x||e[40]!==l?(I=n.jsxs("div",{role:"dialog","aria-label":o,"data-slot":"announcement-card","data-tone":l,className:"relative w-full overflow-hidden rounded-lg border border-border bg-background shadow-lg animate-in fade-in slide-in-from-bottom-2 duration-300",children:[f,x,A,$]}),e[35]=o,e[36]=A,e[37]=$,e[38]=f,e[39]=x,e[40]=l,e[41]=I):I=e[41],I}const hs={switcher:"tour-layout-switcher",nav:"tour-layout-nav",tasks:"tour-layout-tasks",projects:"tour-layout-projects",account:"tour-layout-account",recentActivity:"tour-layout-recent-activity",siteEditor:"tour-layout-site-editor",surfaceTabs:"tour-layout-surface-tabs",branchPicker:"tour-layout-branch-picker",automations:"tour-layout-automations",settings:"tour-layout-settings"};function Ft(t){return`[data-tour="${hs[t]}"]`}const gs=[{scope:"shell",anchor:"switcher",titleKey:"layoutTour.switcher.title",descKey:"layoutTour.switcher.description",side:"right"},{scope:"shell",anchor:"nav",titleKey:"layoutTour.nav.title",descKey:"layoutTour.nav.description",side:"right"},{scope:"shell",anchor:"tasks",titleKey:"layoutTour.tasks.title",descKey:"layoutTour.tasks.description",side:"right"},{scope:"project",anchor:"siteEditor",titleKey:"layoutTour.siteEditor.title",descKey:"layoutTour.siteEditor.description",side:"right"},{scope:"project",anchor:"automations",titleKey:"layoutTour.automations.title",descKey:"layoutTour.automations.description",side:"right"},{scope:"shell",anchor:"settings",titleKey:"layoutTour.settings.title",descKey:"layoutTour.settings.description",side:"right"},{scope:"shell",anchor:"projects",titleKey:"layoutTour.projects.title",descKey:"layoutTour.projects.description",side:"right"},{scope:"shell",anchor:"account",titleKey:"layoutTour.account.title",descKey:"layoutTour.account.description",side:"right"},{scope:"siteEditor",anchor:"surfaceTabs",titleKey:"layoutTour.surfaceTabs.title",descKey:"layoutTour.surfaceTabs.description",side:"bottom"},{scope:"siteEditor",anchor:"branchPicker",titleKey:"layoutTour.branchPicker.title",descKey:"layoutTour.branchPicker.description",side:"bottom"},{scope:"orgHome",anchor:"recentActivity",titleKey:"layoutTour.recentActivity.title",descKey:"layoutTour.recentActivity.description",side:"top"}];function ps(t){return gs.filter(e=>e.scope==="shell"||e.scope==="orgHome"&&t.onOrgHome||e.scope==="project"&&t.inProject||e.scope==="siteEditor"&&t.onSiteEditor)}function ys(t,e){return ps(e).map(o=>({element:Ft(o.anchor),popover:{title:t(o.titleKey),description:t(o.descKey),side:o.side,align:"center"}}))}const bs=Ft("switcher"),xs=30;function Mt(t){const e=document.querySelector(t);return e instanceof HTMLElement&&e.offsetParent!==null}function Ss(t,e){return ys(t,e).filter(o=>typeof o.element=="string"&&Mt(o.element))}function ws(t,e){return{showProgress:!0,progressText:t("layoutTour.progress"),nextBtnText:t("layoutTour.next"),prevBtnText:t("layoutTour.prev"),doneBtnText:t("layoutTour.done"),showButtons:["next","previous"],smoothScroll:!0,allowClose:!0,disableActiveInteraction:!0,stagePadding:6,stageRadius:8,waitForElement:0,skipMissingElement:!0,popoverClass:"layout-tour-popover",onPopoverRender:(o,{driver:r})=>{if(o.footerButtons.querySelector(".layout-tour-skip"))return;const s=document.createElement("button");s.type="button",s.className="driver-popover-footer-btn layout-tour-skip",s.textContent=t("layoutTour.skip"),s.addEventListener("click",()=>r.destroy()),o.footerButtons.insertBefore(s,o.footerButtons.firstChild)},onDestroyed:()=>{Ve=!1},steps:e}}let Ve=!1;async function vs(){return(await Qt(()=>import("./driver.js-Dj4CfABu.js"),[])).driver}function js(t,e){if(Ve)return;Ve=!0;let o=0;const r=()=>{if(!Mt(bs)&&o++<xs){requestAnimationFrame(r);return}const s=Ss(t,e);if(s.length===0){Ve=!1;return}vs().then(a=>{a(ws(t,s)).drive()}).catch(()=>{Ve=!1})};r()}function ks(t){return t!=="off"}function si(t){if(!t.hasSource)return[];const e=["site-editor"];return ks(t.cmsMode)&&e.push("content"),t.runtime==="sandbox"&&e.push("code"),e}function zt(t){return t==="site-editor"||t==="content"||t==="code"||t.startsWith("code:")}function oi(t){return t.reportsOnly&&!t.onReportAgent&&zt(t.tabId)}const qt=[{id:"new-layout",date:"2026-09-22",eyebrow:"Now Available",title:"New Layout",bullets:[{icon:bt,title:"Unified page headers",body:"Every page now has a clear header with navigation breadcrumbs and actions, making it easy to orient yourself and move around."},{icon:lt,title:"Consistent navigation and controls",body:"Settings and project pages use a predictable sidebar instead of scattered tabs. Buttons, inputs and toolbars share one shape and one height, and the layout adapts to smaller screens."},{icon:jn,title:"Site editor redesigned",body:"Try the redesigned blocks editor from Profile & Preferences. Blocks share consistent actions, variants appear beside their block in the header, and section selection is searchable."}],cta:{label:"Take a tour",action:"start-tour"}},{id:"unified-workspace-layout",date:"2026-09-01",eyebrow:"Now Available",title:"A new way around Studio",bullets:[{icon:gt,title:"Unified org switcher",body:"Organizations and agents now share one control at the top of the sidebar. Search it to jump straight to any agent, including ones in your other organizations."},{icon:ae,title:"Your org at a glance",body:"The organization home now opens on the agents your team built and the tasks they are running — no empty board to fill in first."},{icon:bt,title:"Simplified CMS",body:"The CMS opens over the page you are previewing rather than somewhere else, so changing a section never costs you your place."}],cta:{label:"Take the tour",action:"start-tour"}},{id:"codex-gpt-5-6-defaults",date:"2026-07-13",eyebrow:"Now Available",title:"Codex defaults move to GPT-5.6",bullets:[{icon:ae,title:"Sol leads Thinking",body:"Codex Thinking now defaults to `gpt-5.6-sol` for deeper coding and reasoning work."},{icon:de,title:"Terra balances Smart",body:"The Smart tier now uses `gpt-5.6-terra`, replacing GPT-5.4 as the default balanced Codex model."},{icon:qe,title:"Luna speeds up Fast",body:"The Fast tier and lightweight Codex title generation now use `gpt-5.6-luna`. Existing threads that reference older GPT-5.4 or GPT-5.5 model IDs remain supported."}]},{id:"claude-sonnet-5",date:"2026-06-30",eyebrow:"Now Available",title:"Claude Sonnet 5 powers the Smart tier",bullets:[{icon:ae,title:"More agentic coding",body:"Sonnet 5 is Anthropic's strongest Sonnet model yet, with improved reasoning, tool use, coding, and knowledge work compared with Sonnet 4.6."},{icon:de,title:"Available in Claude Code",body:"The Claude Code harness now pins the Smart tier to the new `claude-sonnet-5` model id so new sessions use Sonnet 5 by default."},{icon:qe,title:"Nothing to change",body:"Existing Smart-tier chats and agents pick up Sonnet 5 automatically. Thinking remains on Opus 4.8 1M."}],learnMoreHref:"https://www.anthropic.com/news/claude-sonnet-5"},{id:"fable-5-suspension",date:"2026-06-13",eyebrow:"Important Update",title:"Fable 5 & Mythos 5 suspended — Opus 4.8 takes over",bullets:[{icon:de,title:"US government directive",body:"Anthropic received an export control directive requiring the suspension of Fable 5 and Mythos 5 access for all users, citing national security concerns. Anthropic is complying while it works to resolve the matter."},{icon:ae,title:"Opus 4.8 steps in as the Thinking tier",body:"The Thinking tier now runs on Claude Opus 4.8, which remains fully operational. Performance on most tasks is comparable, and Anthropic reports more than 95% of sessions were unaffected by the Fable 5 classifiers anyway."},{icon:qe,title:"Nothing to change",body:"The switch is automatic — any chat or agent already using the Thinking tier is now served by Opus 4.8. Anthropic will share further details within 24 hours."}],learnMoreHref:"https://www.anthropic.com/news/fable-mythos-access"},{id:"claude-fable-5",date:"2026-06-09",eyebrow:"Now Available",title:"Claude Fable 5 leads the Thinking tier",bullets:[{icon:ae,title:"State-of-the-art reasoning",body:"Fable 5 takes the Thinking tier, posting top scores across software engineering, knowledge work, and vision — and outperforming Opus 4.8 on nearly every benchmark Anthropic tested."},{icon:de,title:"Safety without the slowdown",body:"New classifiers route the small slice of high-risk requests (cybersecurity, bio/chem) back to Opus 4.8. Anthropic reports more than 95% of sessions never trigger a fallback."},{icon:qe,title:"Nothing to change",body:"Chats and agents pick up Fable 5 automatically wherever the Thinking tier is selected. Opus 4.8 stays available as the safety fallback."}],learnMoreHref:"https://www.anthropic.com/news/claude-fable-5-mythos-5"},{id:"claude-opus-4-8",date:"2026-05-28",eyebrow:"Now Available",title:"Claude Opus 4.8 is the new default",bullets:[{icon:ae,title:"Smarter thinking, same price",body:"Opus 4.8 now leads the Thinking and Smarter tiers, outperforming Opus 4.7 on coding, reasoning, and agent tasks at the same cost."},{icon:de,title:"More honest answers",body:"It's about 4× less likely to let a code flaw slip through unflagged, and surfaces uncertainty instead of making unsupported claims."},{icon:qe,title:"Nothing to change",body:"Chats and agents pick up Opus 4.8 automatically wherever the Thinking or Smarter tier is selected."}],learnMoreHref:"https://www.anthropic.com/news/claude-opus-4-8"},{id:"enhanced-sidebar",date:"2026-05-28",eyebrow:"Now Available",title:"Enhanced sidebar",bullets:[{icon:ae,title:"A clearer view of what's running",body:"See every task in your organization at a glance, with each agent and status group laid out so you can spot active work without hunting for it."},{icon:lt,title:"Browse one group at a time",body:"Expand the groups you care about and pull in more results on demand — no more endless scrolling to find an older conversation."},{icon:de,title:"Polished and steadier",body:"Several sidebar bugs are fixed, including empty agent groups showing the right action and status filters returning the right tasks."}]},{id:"smarter-task-delegation",date:"2026-05-27",eyebrow:"Now Available",title:"Smarter task delegation",bullets:[{icon:gt,title:"Real results from delegated agents",body:"When one agent hands work to another, you'll see the full report inline — no more empty replies hiding the work that was done."},{icon:qe,title:"Same powers, top to bottom",body:"Delegated agents now work with the same tools, context, and memory as the agent that called them, so complex multi-agent investigations finish on the first try."},{icon:de,title:"Clearer progress signals",body:"When a delegated task hits its limit or runs into a problem, you get a plain-language message instead of a silent stall."}]},{id:"sidebar-task-groups",date:"2026-05-27",eyebrow:"Now Available",title:"Redesigned sidebar",bullets:[{icon:ae,title:"Group by agent or status",body:"Switch the task list between grouping by agent or by status — pick whichever matches how you're working right now."},{icon:lt,title:"Sharper filters",body:"Narrow the list to your tasks, manual chats, or automations from a compact filter row above the groups."}]},{id:"release-channel",date:"2026-05-26",eyebrow:"Now Available",title:"Release announcements",bullets:[{icon:ae,title:"Heads-up when features ship",body:"New releases surface in a corner card the first time you see them, then stick around in your inbox."},{icon:kn,title:"Unified inbox",body:"Org invitations and product updates now share one chronological feed in the sidebar."}]}],ot="studio.release-feed.v1",dt=new Set;let ue="",me={},ut=!1;function Ts(){if(ut)return ue||"{}";try{return localStorage.getItem(ot)??"{}"}catch{return ue||"{}"}}function Kt(t){try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function wt(){const t=Ts();return t!==ue&&(ue=t,me=Kt(t)),me}function Ns(t){dt.add(t);const e=o=>{if(!(o.key!==ot&&o.key!==null)){try{const r=localStorage.getItem(ot)??"{}",a={...Kt(r),...me};me=a,ue=JSON.stringify(a)}catch{}t()}};return window.addEventListener("storage",e),()=>{dt.delete(t),window.removeEventListener("storage",e)}}function _s(t){me=t,ue=JSON.stringify(t);try{localStorage.setItem(ot,ue),ut=!1}catch{ut=!0}dt.forEach(e=>e())}function Ps(){const t=R.c(7),e=se.useSyncExternalStore(Ns,wt,wt);let o;t[0]!==e?(o=m=>!!e[m],t[0]=e,t[1]=o):o=t[1];const r=o,s=As;let a;t[2]!==e?(a=qt.reduce((m,h)=>e[h.id]?m:m+1,0),t[2]=e,t[3]=a):a=t[3];const i=a;let c;return t[4]!==r||t[5]!==i?(c={isSeen:r,markSeen:s,unseenCount:i},t[4]=r,t[5]=i,t[6]=c):c=t[6],c}function As(t){me[t]||_s({...me,[t]:{seenAt:new Date().toISOString()}})}const Cs=720*60*60*1e3,Es=10080*60*1e3;function Os(t){const[e,o,r]=t.split("-").map(Number);return!e||!o||!r?new Date(t).getTime():new Date(e,o-1,r).getTime()}function Is(t){const e=qt[0];if(!e)return null;const o=Os(e.date),r=t-o;return r<0||r>Cs?null:e}function $s(t){if(t instanceof Date)return t.getTime();if(typeof t=="string"||typeof t=="number"){const e=new Date(t).getTime();return Number.isFinite(e)?e:null}return null}function Ls(t,e){const o=$s(t);return o===null?!1:e-o>=Es}function Ds(){const t=R.c(46),e=J(),o=On(),r=Xt(),s=Dt(),a=!!o,i=r===re.home&&!o;let c;t[0]!==s||t[1]!==a?(c=a&&!!s&&zt(s),t[0]=s,t[1]=a,t[2]=c):c=t[2];const m=c,{data:h}=Be.useSession(),{isSeen:w,markSeen:u}=Ps(),y=Ln(6e4);let l,g,f;if(t[3]!==w||t[4]!==y||t[5]!==h?.user?.createdAt){f=Symbol.for("react.early_return_sentinel");e:{if(l=Is(y),!l){f=null;break e}if(!Ls(h?.user?.createdAt,y)){f=null;break e}g=w(l.id)}t[3]=w,t[4]=y,t[5]=h?.user?.createdAt,t[6]=l,t[7]=g,t[8]=f}else l=t[6],g=t[7],f=t[8];if(f!==Symbol.for("react.early_return_sentinel"))return f;if(g)return null;let d;t[9]!==l.id||t[10]!==a||t[11]!==u||t[12]!==i||t[13]!==m||t[14]!==e?(d=()=>{u(l.id),js(e,{onOrgHome:i,inProject:a,onSiteEditor:m})},t[9]=l.id,t[10]=a,t[11]=u,t[12]=i,t[13]=m,t[14]=e,t[15]=d):d=t[15];const x=d;let b;t[16]!==e?(b=e("announcements.release.ariaLabel"),t[16]=e,t[17]=b):b=t[17];let S;t[18]!==e?(S=e("announcements.release.dismiss"),t[18]=e,t[19]=S):S=t[19];const j=l.eyebrow,P=l.title;let k;t[20]!==l.id||t[21]!==u?(k=()=>u(l.id),t[20]=l.id,t[21]=u,t[22]=k):k=t[22];let v;t[23]!==l.id||t[24]!==l.learnMoreHref||t[25]!==u||t[26]!==e?(v=l.learnMoreHref?n.jsx("a",{href:l.learnMoreHref,target:"_blank",rel:"noreferrer",onClick:()=>u(l.id),className:"underline-offset-2 hover:text-foreground hover:underline",children:e("announcements.release.learnMore")}):null,t[23]=l.id,t[24]=l.learnMoreHref,t[25]=u,t[26]=e,t[27]=v):v=t[27];let T;t[28]!==l.cta||t[29]!==l.id||t[30]!==u||t[31]!==x?(T=l.cta?"href"in l.cta?n.jsx(F,{asChild:!0,size:"sm",onClick:()=>u(l.id),children:n.jsx("a",{href:l.cta.href,children:l.cta.label})}):n.jsx(F,{size:"sm",onClick:x,children:l.cta.label}):null,t[28]=l.cta,t[29]=l.id,t[30]=u,t[31]=x,t[32]=T):T=t[32];let N;t[33]!==l.bullets?(N=l.bullets.map(Rs),t[33]=l.bullets,t[34]=N):N=t[34];let _;t[35]!==N?(_=n.jsx("ul",{className:"flex flex-col gap-3",children:N}),t[35]=N,t[36]=_):_=t[36];let p;return t[37]!==l.eyebrow||t[38]!==l.title||t[39]!==T||t[40]!==_||t[41]!==b||t[42]!==S||t[43]!==k||t[44]!==v?(p=n.jsx(Rt,{ariaLabel:b,dismissLabel:S,eyebrow:j,title:P,onDismiss:k,footerLeading:v,actions:T,children:_}),t[37]=l.eyebrow,t[38]=l.title,t[39]=T,t[40]=_,t[41]=b,t[42]=S,t[43]=k,t[44]=v,t[45]=p):p=t[45],p}function Rs(t,e){return n.jsxs("li",{className:"flex items-start gap-3",children:[n.jsx(t.icon,{size:20,className:"mt-0.5 shrink-0 text-muted-foreground"}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("p",{className:"text-sm font-medium text-foreground",children:t.title}),n.jsx("p",{className:"text-xs text-muted-foreground",children:t.body})]})]},e)}const Bt=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform),ce=Bt?"⌘":"Ctrl",G={commandPalette:{keys:[ce,"K"],description:"Command palette"},keyboardShortcuts:{keys:["?"],description:"Keyboard shortcuts"},back:{keys:[ce,"["],description:"Back to previous"},focusChatInput:{keys:[ce,"L"],description:"Focus chat input"},saveAndFormat:{keys:[ce,"S"],description:"Save & format"},sendMessage:{keys:["Enter"],description:"Send message"},newLine:{keys:["Shift","Enter"],description:"New line"},selectOption:{keys:["1-9"],description:"Select option"},applyFilter:{keys:[ce,"Enter"],description:"Apply filter"},togglePlanMode:{keys:[ce,"Shift","L"],description:"Toggle plan mode"},newTask:{keys:["Shift",ce,"S"],description:"New task"},toggleDaemon:{keys:[ce,"D"],description:"Toggle daemon logs"}},Fs=[{label:"General",shortcuts:[G.commandPalette,G.keyboardShortcuts,G.back,G.newTask,G.toggleDaemon]},{label:"Editor",shortcuts:[G.saveAndFormat]},{label:"Chat",shortcuts:[G.focusChatInput,G.togglePlanMode,G.sendMessage,G.newLine]},{label:"Questions",shortcuts:[G.selectOption]},{label:"Monitoring",shortcuts:[G.applyFilter]}];function vt(t){return Bt?t.metaKey:t.ctrlKey}function Ms(t){if(!(t instanceof HTMLElement))return!1;if(t.isContentEditable)return!0;const e=t.tagName;return e==="INPUT"||e==="TEXTAREA"||e==="SELECT"}function zs(t){const e=R.c(11),{open:o,onOpenChange:r}=t,s=J();let a;e[0]!==s?(a=s("common.keyboardShortcutsDialog.title"),e[0]=s,e[1]=a):a=e[1];let i;e[2]!==a?(i=n.jsx(_t,{children:n.jsx(Pt,{children:a})}),e[2]=a,e[3]=i):i=e[3];let c;e[4]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsx("div",{className:"flex flex-col gap-4",children:Fs.map(qs)}),e[4]=c):c=e[4];let m;e[5]!==i?(m=n.jsxs(At,{className:"sm:max-w-md",children:[i,c]}),e[5]=i,e[6]=m):m=e[6];let h;return e[7]!==r||e[8]!==o||e[9]!==m?(h=n.jsx(Ct,{open:o,onOpenChange:r,children:m}),e[7]=r,e[8]=o,e[9]=m,e[10]=h):h=e[10],h}function qs(t){return n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide mb-2",children:t.label}),n.jsx("div",{className:"flex flex-col gap-1.5",children:t.shortcuts.map(Ks)})]},t.label)}function Ks(t){return n.jsxs("div",{className:"flex items-center justify-between py-1",children:[n.jsx("span",{className:"text-sm",children:t.description}),n.jsx("div",{className:"flex items-center gap-1",children:t.keys.map(Bs)})]},t.description)}function Bs(t){return n.jsx("kbd",{className:"inline-flex items-center justify-center min-w-6 h-6 px-1.5 rounded-sm border border-border bg-muted text-muted-foreground text-xs font-mono",children:t},t)}const jt=8;function Hs(t){const{org:e}=mt(),o=Bn({connectionId:Ot,orgId:e.id,orgSlug:e.slug}),{data:r}=He({queryKey:Ue.globalSearch(e.id,t,jt),enabled:!!o&&t.trim().length>=2,staleTime:15e3,retry:!1,queryFn:async()=>{if(!o)return[];try{return(await o.callTool({name:"GLOBAL_SEARCH",arguments:{query:t,limit:jt}})).structuredContent?.items??[]}catch{return[]}}});return r??[]}function Us(t){const e=R.c(195),{open:o,onOpenChange:r}=t,s=J(),a=Et(),{org:i}=mt(),{projects:c,hasProjects:m}=In(),[h,w]=se.useState(""),u=se.useDeferredValue(h),y=Hs(u);let l;e[0]!==r?(l=()=>{r(!1),w("")},e[0]=r,e[1]=l):l=e[1];const g=l;let f;e[2]!==g?(f=(q,W)=>{ct("command_palette_used",{kind:W}),q(),g()},e[2]=g,e[3]=f):f=e[3];const d=f;let x;e[4]!==a||e[5]!==i.id||e[6]!==i.slug?(x=q=>{if(q.type==="connection"){if(!q.slug){a({to:"/$org/settings/connections",params:{org:i.slug},search:{tab:"all"}});return}a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:q.slug}});return}if(q.type==="task"){a({to:re.tasks,params:{org:i.slug,taskKey:q.key??void 0}});return}const W=It(i.id).id;Zt(a,en({org:i.slug,agentId:q.virtual_mcp_id??W,superAgentId:W}),{search:()=>({thread:q.id}),replace:!1})},e[4]=a,e[5]=i.id,e[6]=i.slug,e[7]=x):x=e[7];const b=x;let S;e[8]!==h?(S=[h],e[8]=h,e[9]=S):S=e[9];const j=S;let P,k,v,T,N,_,p,A,$,I,D,C,M;if(e[10]!==g||e[11]!==d||e[12]!==m||e[13]!==y||e[14]!==a||e[15]!==r||e[16]!==o||e[17]!==b||e[18]!==i.slug||e[19]!==c||e[20]!==j||e[21]!==s||e[22]!==h){const q=y.filter(Js),W=y.filter(Gs);let Y;e[36]!==i.slug?(Y={org:i.slug},e[36]=i.slug,e[37]=Y):Y=e[37];const L=Y;let Q;e[38]!==s?(Q=s("sidebar.navDestinations.home"),e[38]=s,e[39]=Q):Q=e[39];let Ge;e[40]===Symbol.for("react.memo_cache_sentinel")?(Ge=n.jsx(Nn,{"aria-hidden":"true"}),e[40]=Ge):Ge=e[40];let oe;e[41]!==L||e[42]!==Q?(oe={key:"home",label:Q,icon:Ge,to:re.home,params:L},e[41]=L,e[42]=Q,e[43]=oe):oe=e[43];let B;e[44]!==s?(B=s("sidebar.navDestinations.reports"),e[44]=s,e[45]=B):B=e[45];let X;e[46]===Symbol.for("react.memo_cache_sentinel")?(X=n.jsx(_n,{"aria-hidden":"true"}),e[46]=X):X=e[46];let Z;e[47]!==L||e[48]!==B?(Z={key:"reports",label:B,icon:X,to:re.reports,params:L},e[47]=L,e[48]=B,e[49]=Z):Z=e[49];let ee;e[50]!==s?(ee=s("sidebar.navDestinations.tasks"),e[50]=s,e[51]=ee):ee=e[51];let te;e[52]===Symbol.for("react.memo_cache_sentinel")?(te=n.jsx(yt,{"aria-hidden":"true"}),e[52]=te):te=e[52];let H;e[53]!==i.slug?(H={org:i.slug,taskKey:void 0},e[53]=i.slug,e[54]=H):H=e[54];let U;e[55]!==ee||e[56]!==H?(U={key:"tasks",label:ee,icon:te,to:re.tasks,params:H},e[55]=ee,e[56]=H,e[57]=U):U=e[57];let ne;e[58]!==s?(ne=s("sidebar.navDestinations.library"),e[58]=s,e[59]=ne):ne=e[59];let ie;e[60]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(Pn,{"aria-hidden":"true"}),e[60]=ie):ie=e[60];let E;e[61]!==L||e[62]!==ne?(E={key:"library",label:ne,icon:ie,to:re.library,params:L},e[61]=L,e[62]=ne,e[63]=E):E=e[63];let z;e[64]!==s?(z=s("sidebar.navDestinations.discover"),e[64]=s,e[65]=z):z=e[65];let Qe;e[66]===Symbol.for("react.memo_cache_sentinel")?(Qe=n.jsx(An,{"aria-hidden":"true"}),e[66]=Qe):Qe=e[66];let he;e[67]!==L||e[68]!==z?(he={key:"discover",label:z,icon:Qe,to:re.discover,params:L},e[67]=L,e[68]=z,e[69]=he):he=e[69];let Xe;e[70]!==oe||e[71]!==Z||e[72]!==U||e[73]!==E||e[74]!==he?(Xe=[oe,Z,U,E,he],e[70]=oe,e[71]=Z,e[72]=U,e[73]=E,e[74]=he,e[75]=Xe):Xe=e[75];const at=Xe;k=Rn,T=o,e[76]!==g||e[77]!==r?(N=O=>O?r(!0):g(),e[76]=g,e[77]=r,e[78]=N):N=e[78],e[79]!==s?(_=s("commandPalette.title"),e[79]=s,e[80]=_):_=e[80],e[81]!==s?(p=s("commandPalette.description"),e[81]=s,e[82]=p):p=e[82];let ge;e[83]!==s?(ge=s("commandPalette.placeholder"),e[83]=s,e[84]=ge):ge=e[84];let pe;e[85]!==s?(pe=s("commandPalette.placeholder"),e[85]=s,e[86]=pe):pe=e[86],e[87]!==ge||e[88]!==pe||e[89]!==h?(A=n.jsx(Fn,{placeholder:ge,"aria-label":pe,value:h,onValueChange:w}),e[87]=ge,e[88]=pe,e[89]=h,e[90]=A):A=e[90],P=Mn;let ye;e[91]!==s?(ye=s("commandPalette.empty"),e[91]=s,e[92]=ye):ye=e[92],e[93]!==ye?($=n.jsx(zn,{children:ye}),e[93]=ye,e[94]=$):$=e[94];let be;e[95]!==s?(be=s("commandPalette.goTo"),e[95]=s,e[96]=be):be=e[96];let xe;e[97]!==at||e[98]!==d||e[99]!==a?(xe=at.map(O=>n.jsxs(le,{onSelect:()=>d(()=>a({to:O.to,params:O.params}),"destination"),children:[O.icon,n.jsx("span",{children:O.label})]},O.key)),e[97]=at,e[98]=d,e[99]=a,e[100]=xe):xe=e[100],e[101]!==be||e[102]!==xe?(I=n.jsx(Je,{heading:be,children:xe}),e[101]=be,e[102]=xe,e[103]=I):I=e[103],e[104]!==d||e[105]!==m||e[106]!==a||e[107]!==i.slug||e[108]!==c||e[109]!==s?(D=m&&n.jsx(Je,{heading:s("commandPalette.projects"),children:c.map(O=>n.jsxs(le,{value:`project ${O.title}`,onSelect:()=>d(()=>a({to:re.projects,params:{org:i.slug,agentId:O.id}}),"project"),children:[n.jsx(Kn,{icon:O.icon,name:O.title,"aria-hidden":"true"}),n.jsx("span",{children:O.title})]},O.id))}),e[104]=d,e[105]=m,e[106]=a,e[107]=i.slug,e[108]=c,e[109]=s,e[110]=D):D=e[110];let Se;e[111]!==s?(Se=s("commandPalette.actions"),e[111]=s,e[112]=Se):Se=e[112];let we;e[113]!==s?(we=s("commandPalette.newProject"),e[113]=s,e[114]=we):we=e[114];let ve;e[115]!==d||e[116]!==a||e[117]!==L?(ve=()=>d(()=>a({to:re.home,params:L}),"new_project"),e[115]=d,e[116]=a,e[117]=L,e[118]=ve):ve=e[118];let Ze;e[119]===Symbol.for("react.memo_cache_sentinel")?(Ze=n.jsx(xt,{"aria-hidden":"true"}),e[119]=Ze):Ze=e[119];let je;e[120]!==s?(je=s("commandPalette.newProject"),e[120]=s,e[121]=je):je=e[121];let ke;e[122]!==je?(ke=n.jsx("span",{children:je}),e[122]=je,e[123]=ke):ke=e[123];let Te;e[124]!==we||e[125]!==ve||e[126]!==ke?(Te=n.jsxs(le,{value:we,onSelect:ve,children:[Ze,ke]}),e[124]=we,e[125]=ve,e[126]=ke,e[127]=Te):Te=e[127];let Ne;e[128]!==s?(Ne=s("commandPalette.inviteTeammate"),e[128]=s,e[129]=Ne):Ne=e[129];let _e;e[130]!==d||e[131]!==a||e[132]!==L?(_e=()=>d(()=>a({to:"/$org/settings/members",params:L}),"invite"),e[130]=d,e[131]=a,e[132]=L,e[133]=_e):_e=e[133];let et;e[134]===Symbol.for("react.memo_cache_sentinel")?(et=n.jsx(Cn,{"aria-hidden":"true"}),e[134]=et):et=e[134];let Pe;e[135]!==s?(Pe=s("commandPalette.inviteTeammate"),e[135]=s,e[136]=Pe):Pe=e[136];let Ae;e[137]!==Pe?(Ae=n.jsx("span",{children:Pe}),e[137]=Pe,e[138]=Ae):Ae=e[138];let Ce;e[139]!==Ne||e[140]!==_e||e[141]!==Ae?(Ce=n.jsxs(le,{value:Ne,onSelect:_e,children:[et,Ae]}),e[139]=Ne,e[140]=_e,e[141]=Ae,e[142]=Ce):Ce=e[142];let Ee;e[143]!==s?(Ee=s("commandPalette.addConnection"),e[143]=s,e[144]=Ee):Ee=e[144];let Oe;e[145]!==d||e[146]!==a||e[147]!==L?(Oe=()=>d(()=>a({to:"/$org/settings/connections",params:L,search:{tab:"all"}}),"add_connection"),e[145]=d,e[146]=a,e[147]=L,e[148]=Oe):Oe=e[148];let tt;e[149]===Symbol.for("react.memo_cache_sentinel")?(tt=n.jsx(xt,{"aria-hidden":"true"}),e[149]=tt):tt=e[149];let Ie;e[150]!==s?(Ie=s("commandPalette.addConnection"),e[150]=s,e[151]=Ie):Ie=e[151];let $e;e[152]!==Ie?($e=n.jsx("span",{children:Ie}),e[152]=Ie,e[153]=$e):$e=e[153];let Le;e[154]!==Ee||e[155]!==Oe||e[156]!==$e?(Le=n.jsxs(le,{value:Ee,onSelect:Oe,children:[tt,$e]}),e[154]=Ee,e[155]=Oe,e[156]=$e,e[157]=Le):Le=e[157];let De;e[158]!==s?(De=s("commandPalette.settings"),e[158]=s,e[159]=De):De=e[159];let Re;e[160]!==d||e[161]!==a||e[162]!==L?(Re=()=>d(()=>a({to:"/$org/settings/general",params:L}),"settings"),e[160]=d,e[161]=a,e[162]=L,e[163]=Re):Re=e[163];let nt;e[164]===Symbol.for("react.memo_cache_sentinel")?(nt=n.jsx(Dn,{"aria-hidden":"true"}),e[164]=nt):nt=e[164];let Fe;e[165]!==s?(Fe=s("commandPalette.settings"),e[165]=s,e[166]=Fe):Fe=e[166];let Me;e[167]!==Fe?(Me=n.jsx("span",{children:Fe}),e[167]=Fe,e[168]=Me):Me=e[168];let ze;e[169]!==De||e[170]!==Re||e[171]!==Me?(ze=n.jsxs(le,{value:De,onSelect:Re,children:[nt,Me]}),e[169]=De,e[170]=Re,e[171]=Me,e[172]=ze):ze=e[172],e[173]!==Se||e[174]!==Te||e[175]!==Ce||e[176]!==Le||e[177]!==ze?(C=n.jsxs(Je,{heading:Se,children:[Te,Ce,Le,ze]}),e[173]=Se,e[174]=Te,e[175]=Ce,e[176]=Le,e[177]=ze,e[178]=C):C=e[178],M=q.length>0&&n.jsx(Je,{heading:s("commandPalette.connections"),children:q.map(O=>n.jsxs(le,{value:`${O.title} ${O.id}`,keywords:j,onSelect:()=>d(()=>b(O),"connection"),children:[n.jsx(qn,{icon:O.icon,name:O.title,size:"2xs","aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:O.title})]},`connection:${O.id}`))}),v=W.length>0&&n.jsx(Je,{heading:s("commandPalette.results"),children:W.map(O=>n.jsxs(le,{value:`${O.title} ${O.id}`,keywords:j,onSelect:()=>d(()=>b(O),O.type),children:[O.type==="thread"?n.jsx(Tn,{"aria-hidden":"true"}):n.jsx(yt,{"aria-hidden":"true"}),n.jsx("span",{className:"truncate",children:O.title}),O.type==="task"&&O.key&&n.jsx("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground",children:O.key})]},`${O.type}:${O.id}`))}),e[10]=g,e[11]=d,e[12]=m,e[13]=y,e[14]=a,e[15]=r,e[16]=o,e[17]=b,e[18]=i.slug,e[19]=c,e[20]=j,e[21]=s,e[22]=h,e[23]=P,e[24]=k,e[25]=v,e[26]=T,e[27]=N,e[28]=_,e[29]=p,e[30]=A,e[31]=$,e[32]=I,e[33]=D,e[34]=C,e[35]=M}else P=e[23],k=e[24],v=e[25],T=e[26],N=e[27],_=e[28],p=e[29],A=e[30],$=e[31],I=e[32],D=e[33],C=e[34],M=e[35];let K;e[179]!==P||e[180]!==v||e[181]!==$||e[182]!==I||e[183]!==D||e[184]!==C||e[185]!==M?(K=n.jsxs(P,{children:[$,I,D,C,M,v]}),e[179]=P,e[180]=v,e[181]=$,e[182]=I,e[183]=D,e[184]=C,e[185]=M,e[186]=K):K=e[186];let V;return e[187]!==k||e[188]!==T||e[189]!==N||e[190]!==_||e[191]!==p||e[192]!==A||e[193]!==K?(V=n.jsxs(k,{open:T,onOpenChange:N,title:_,description:p,children:[A,K]}),e[187]=k,e[188]=T,e[189]=N,e[190]=_,e[191]=p,e[192]=A,e[193]=K,e[194]=V):V=e[194],V}function Gs(t){return t.type!=="connection"}function Js(t){return t.type==="connection"}const Ye=new Vn(!1);function Vs(){Ye.set(!0)}function Ws(){Ye.set(!1)}function Ys(){const t=R.c(2),e=se.useSyncExternalStore(Ye.subscribe,Ye.get);let o;return t[0]!==e?(o=[e,Ye.set],t[0]=e,t[1]=o):o=t[1],o}const Qs=300*1e3,Xs=2;function Zs(t,e,o){return!e||e===o?{version:null,count:0}:t.version===e?{version:e,count:t.count+1}:{version:e,count:1}}function eo(t,e){return t.count>=Xs&&t.version!==null&&t.version!==e}function to(){const t=R.c(31),e=J();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={queryKey:Ue.appVersionCheck(),queryFn:so,refetchInterval:Qs,refetchIntervalInBackground:!0,staleTime:0},t[0]=o):o=t[0];const{data:r,dataUpdatedAt:s}=He(o),[a,i]=se.useState(0);let c;t[1]===Symbol.for("react.memo_cache_sentinel")?(c={version:null,count:0},t[1]=c):c=t[1];const[m,h]=se.useState(c);s!==a&&(i(s),h(T=>Zs(T,r,"4.510.1")));const[w,u]=se.useState(null);if(!eo(m,w))return null;let y;t[2]!==e?(y=e("announcements.version.ariaLabel"),t[2]=e,t[3]=y):y=t[3];let l;t[4]!==e?(l=e("announcements.version.dismiss"),t[4]=e,t[5]=l):l=t[5];let g;t[6]!==e?(g=e("announcements.version.eyebrow"),t[6]=e,t[7]=g):g=t[7];let f;t[8]!==e?(f=e("announcements.version.title"),t[8]=e,t[9]=f):f=t[9];let d;t[10]!==e?(d=e("announcements.version.description"),t[10]=e,t[11]=d):d=t[11];let x;t[12]===Symbol.for("react.memo_cache_sentinel")?(x=n.jsx(pt,{size:16}),t[12]=x):x=t[12];let b;t[13]!==m.version?(b=()=>u(m.version),t[13]=m.version,t[14]=b):b=t[14];let S;t[15]!==e?(S=e("announcements.version.currentSession",{version:"4.510.1"}),t[15]=e,t[16]=S):S=t[16];let j;t[17]!==e?(j=e("announcements.version.refresh"),t[17]=e,t[18]=j):j=t[18];let P;t[19]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx(pt,{size:14}),t[19]=P):P=t[19];let k;t[20]!==j?(k=n.jsxs(F,{size:"sm",onClick:no,children:[j,P]}),t[20]=j,t[21]=k):k=t[21];let v;return t[22]!==k||t[23]!==y||t[24]!==l||t[25]!==g||t[26]!==f||t[27]!==d||t[28]!==b||t[29]!==S?(v=n.jsx(Rt,{ariaLabel:y,dismissLabel:l,eyebrow:g,title:f,description:d,icon:x,tone:"system",onDismiss:b,footerLeading:S,actions:k}),t[22]=k,t[23]=y,t[24]=l,t[25]=g,t[26]=f,t[27]=d,t[28]=b,t[29]=S,t[30]=v):v=t[30],v}function no(){return window.location.reload()}async function so(){const t=await fetch("/api/config",{cache:"no-store"}),{config:e}=await t.json();return e.version}function oo(t){return{has(){try{return localStorage.getItem(t)==="1"}catch{return!1}},mark(){try{localStorage.setItem(t,"1")}catch{}}}}const io=Date.parse("2026-07-21T00:00:00Z"),kt=t=>oo(Ke.ptBrAnnouncementSeen(t));function ao(){const t=R.c(35),e=J(),[o,r]=tn(),{data:s,isPending:a}=Be.useSession(),i=s?.user,c=i?.id,m=i?.createdAt,h=m!=null&&new Date(m).getTime()<io,w=nn()==="pt-BR",u=!a&&!!c&&h&&w&&o.language==="en"&&!kt(c).has(),[y,l]=se.useState(!1),[g,f]=se.useState(!1);!y&&!a&&(l(!0),u&&c&&(kt(c).mark(),r(lo),f(!0),ct("pt_br_auto_switch_shown")));let d;t[0]===Symbol.for("react.memo_cache_sentinel")?(d=V=>{ct("pt_br_auto_switch_closed",{action:V}),f(!1)},t[0]=d):d=t[0];const x=d;let b;t[1]!==r?(b=()=>{r(ro),x("switch-back")},t[1]=r,t[2]=b):b=t[2];const S=b;let j;t[3]===Symbol.for("react.memo_cache_sentinel")?(j=V=>!V&&x("dismiss"),t[3]=j):j=t[3];let P;t[4]===Symbol.for("react.memo_cache_sentinel")?(P=n.jsx("div",{className:"text-4xl","aria-hidden":"true",children:"🇧🇷"}),t[4]=P):P=t[4];let k;t[5]!==e?(k=e("announcements.ptBr.title"),t[5]=e,t[6]=k):k=t[6];let v;t[7]!==k?(v=n.jsx(Pt,{children:k}),t[7]=k,t[8]=v):v=t[8];let T;t[9]!==e?(T=e("announcements.ptBr.description"),t[9]=e,t[10]=T):T=t[10];let N;t[11]!==T?(N=n.jsx(sn,{children:T}),t[11]=T,t[12]=N):N=t[12];let _;t[13]!==v||t[14]!==N?(_=n.jsxs(_t,{children:[v,N]}),t[13]=v,t[14]=N,t[15]=_):_=t[15];let p;t[16]!==e?(p=e("announcements.ptBr.switchBack"),t[16]=e,t[17]=p):p=t[17];let A;t[18]!==S||t[19]!==p?(A=n.jsx(F,{variant:"outline",onClick:S,children:p}),t[18]=S,t[19]=p,t[20]=A):A=t[20];let $;t[21]===Symbol.for("react.memo_cache_sentinel")?($=()=>x("ok"),t[21]=$):$=t[21];let I;t[22]!==e?(I=e("announcements.ptBr.ok"),t[22]=e,t[23]=I):I=t[23];let D;t[24]!==I?(D=n.jsx(F,{onClick:$,children:I}),t[24]=I,t[25]=D):D=t[25];let C;t[26]!==A||t[27]!==D?(C=n.jsxs(on,{children:[A,D]}),t[26]=A,t[27]=D,t[28]=C):C=t[28];let M;t[29]!==C||t[30]!==_?(M=n.jsxs(At,{className:"sm:max-w-md",children:[P,_,C]}),t[29]=C,t[30]=_,t[31]=M):M=t[31];let K;return t[32]!==g||t[33]!==M?(K=n.jsx(Ct,{open:g,onOpenChange:j,children:M}),t[32]=g,t[33]=M,t[34]=K):K=t[34],K}function ro(t){return{...t,language:"en"}}function lo(t){return{...t,language:"pt-BR"}}function co(t){const e=an(t);return typeof e=="string"?e:void 0}function uo(){return co("experiment-pipeline-check"),null}function mo(t){const e=R.c(1),{activeOrg:o}=t;if(!o)return null;rn(o.id,{name:o.name??void 0,slug:o.slug??void 0}),ln();let r;return e[0]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(uo,{}),e[0]=r):r=e[0],r}function fo(t){const{prev:e,virtualMcpId:o,decopilotId:r,savedLayout:s,opts:a,autosendValue:i}=t,c={mainpanel:void 0};o?c.virtualmcpid=o:e.virtualmcpid&&(c.virtualmcpid=e.virtualmcpid);const m=typeof e.virtualmcpid=="string"?e.virtualmcpid:r,w=(o??m)!==m;let u,y;return a?.panel?y=a.panel:a?.newThread&&!w&&cn(e.tabId)?(y=e.tabId,c.mainpanel=e.mainpanel,u=e.sidepanel):s?(y=s.tab,s.sidepanel!==void 0&&(u=s.sidepanel),s.mainpanel!==void 0&&(c.mainpanel=s.mainpanel)):!w&&e.tabId&&!dn(e.tabId)&&(y=e.tabId),u!==void 0&&(c.sidepanel=u),a?.autosend&&(c.autosend=i),{tabId:y,search:c}}const Ht="studio:thread-layout:v4",ho=50;function Ut(t){const e={};return t===null||typeof t!="object"||(typeof t.tab=="string"&&(e.tab=t.tab),typeof t.mainpanel=="boolean"&&(e.mainpanel=t.mainpanel),typeof t.sidepanel=="boolean"&&(e.sidepanel=t.sidepanel)),e}function go(t,e,o,r=ho){const s=t.filter(([a])=>a!==e);for(s.push([e,Ut(o)]);s.length>r;)s.shift();return s}function ft(){try{const t=sessionStorage.getItem(Ht);if(!t)return[];const e=JSON.parse(t);return Array.isArray(e)?e.filter(o=>Array.isArray(o)&&o.length===2&&typeof o[0]=="string"):[]}catch{return[]}}function Gt(t){try{sessionStorage.setItem(Ht,JSON.stringify(t))}catch{}}function po(t,e){t&&Gt(go(ft(),t,e))}function yo(t){if(!t)return null;const e=ft().find(([o])=>o===t);return e?Ut(e[1]):null}function ii(t){if(!t)return;const e=ft(),o=e.filter(([r])=>r!==t);o.length!==e.length&&Gt(o)}function Jt(t){return{queryKey:Ue.homeNextActions(t),queryFn:async()=>{const e=await fetch(`/api/${t}/home-next-actions`,{cache:"no-store"});if(!e.ok)throw new Error("Failed to load home next actions");return await e.json()},staleTime:0,refetchOnWindowFocus:"always"}}function ai(t){const e=R.c(10);let o;e[0]!==t?(o=Jt(t),e[0]=t,e[1]=o):o=e[1];const r=He(o);let s;e[2]!==r.data?.prompts?(s=r.data?.prompts??[],e[2]=r.data?.prompts,e[3]=s):s=e[3];let a;e[4]!==r.data?.tiles?(a=r.data?.tiles??[],e[4]=r.data?.tiles,e[5]=a):a=e[5];let i;return e[6]!==r.isLoading||e[7]!==s||e[8]!==a?(i={isLoading:r.isLoading,prompts:s,tiles:a},e[6]=r.isLoading,e[7]=s,e[8]=a,e[9]=i):i=e[9],i}function bo(t){const e=R.c(31),{orgSlug:o,orgName:r,domain:s}=t,a=J();let i;e[0]!==o?(i=()=>{window.location.href=`/api/${encodeURIComponent(o)}/sso/authorize`},e[0]=o,e[1]=i):i=e[1];const c=i,m=xo;let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx("div",{className:"bg-primary/10 p-3 rounded-full","aria-hidden":"true",children:n.jsx(Tt,{className:"h-6 w-6 text-primary"})}),e[2]=h):h=e[2];let w;e[3]!==a?(w=a("common.ssoRequiredScreen.title"),e[3]=a,e[4]=w):w=e[4];let u;e[5]!==w?(u=n.jsx("h3",{className:"text-lg font-medium",children:w}),e[5]=w,e[6]=u):u=e[6];let y;e[7]!==s||e[8]!==r||e[9]!==a?(y=r?n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:r})," ",a("common.ssoRequiredScreen.requiresSsoAuth"),s?` ${a("common.ssoRequiredScreen.via",{domain:s})}`:"","."]}):a("common.ssoRequiredScreen.orgRequiresSsoAuth"),e[7]=s,e[8]=r,e[9]=a,e[10]=y):y=e[10];let l;e[11]!==y?(l=n.jsx("p",{className:"text-sm text-muted-foreground",children:y}),e[11]=y,e[12]=l):l=e[12];let g;e[13]!==u||e[14]!==l?(g=n.jsxs("div",{className:"space-y-2",children:[u,l]}),e[13]=u,e[14]=l,e[15]=g):g=e[15];let f;e[16]!==a?(f=a("common.ssoRequiredScreen.signInWithSso"),e[16]=a,e[17]=f):f=e[17];let d;e[18]!==c||e[19]!==f?(d=n.jsx(F,{onClick:c,children:f}),e[18]=c,e[19]=f,e[20]=d):d=e[20];let x;e[21]!==a?(x=a("common.goBack"),e[21]=a,e[22]=x):x=e[22];let b;e[23]!==x?(b=n.jsx(F,{variant:"ghost",onClick:m,children:x}),e[23]=x,e[24]=b):b=e[24];let S;e[25]!==b||e[26]!==d?(S=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[d,b]}),e[25]=b,e[26]=d,e[27]=S):S=e[27];let j;return e[28]!==S||e[29]!==g?(j=n.jsxs(fe,{children:[h,g,S]}),e[28]=S,e[29]=g,e[30]=j):j=e[30],j}function xo(){window.location.href="/"}function So(t){const e=R.c(27),{notice:o,orgSlug:r}=t,s=J();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=n.jsx("div",{className:"bg-destructive/10 p-3 rounded-full",children:n.jsx(un,{className:"h-6 w-6 text-destructive"})}),e[0]=a):a=e[0];let i;e[1]!==o.title?(i=n.jsx("h3",{className:"text-lg font-medium",children:o.title}),e[1]=o.title,e[2]=i):i=e[2];let c;e[3]!==o.message?(c=n.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-line",children:o.message}),e[3]=o.message,e[4]=c):c=e[4];let m;e[5]!==i||e[6]!==c?(m=n.jsxs("div",{className:"space-y-2",children:[i,c]}),e[5]=i,e[6]=c,e[7]=m):m=e[7];let h;e[8]!==o.ctaLabel||e[9]!==o.ctaUrl?(h=o.ctaUrl&&o.ctaLabel?n.jsx(F,{asChild:!0,children:n.jsx("a",{href:o.ctaUrl,target:"_blank",rel:"noreferrer noopener",children:o.ctaLabel})}):null,e[8]=o.ctaLabel,e[9]=o.ctaUrl,e[10]=h):h=e[10];const w=`/${encodeURIComponent(r)}/settings/infra-billing`;let u;e[11]!==s?(u=s("common.blockedOrgScreen.goToBilling"),e[11]=s,e[12]=u):u=e[12];let y;e[13]!==w||e[14]!==u?(y=n.jsx(F,{variant:"outline",asChild:!0,children:n.jsx("a",{href:w,children:u})}),e[13]=w,e[14]=u,e[15]=y):y=e[15];let l;e[16]!==s?(l=s("common.blockedOrgScreen.switchOrg"),e[16]=s,e[17]=l):l=e[17];let g;e[18]!==l?(g=n.jsx(F,{variant:"ghost",asChild:!0,children:n.jsx("a",{href:"/",children:l})}),e[18]=l,e[19]=g):g=e[19];let f;e[20]!==g||e[21]!==h||e[22]!==y?(f=n.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[h,y,g]}),e[20]=g,e[21]=h,e[22]=y,e[23]=f):f=e[23];let d;return e[24]!==f||e[25]!==m?(d=n.jsxs(fe,{children:[a,m,f]}),e[24]=f,e[25]=m,e[26]=d):d=e[26],d}function wo(t){const e=R.c(8);let o;e[0]!==t?(o=Ue.orgNotice(t??""),e[0]=t,e[1]=o):o=e[1];let r;e[2]!==t?(r=async()=>{const i=await fetch(`/api/${t}/notice`,{credentials:"include"});return i.ok?(await i.json()).notice??null:null},e[2]=t,e[3]=r):r=e[3];const s=!!t;let a;return e[4]!==o||e[5]!==r||e[6]!==s?(a={queryKey:o,queryFn:r,enabled:s,staleTime:6e4},e[4]=o,e[5]=r,e[6]=s,e[7]=a):a=e[7],He(a)}const vo="/settings/infra-billing";function jo(t){return(t.endsWith("/")?t.slice(0,-1):t).endsWith(vo)}function ko(t){const e=R.c(7),{org:o,children:r}=t;let s;e[0]!==o.id||e[1]!==o.name?(s={id:o.id,organizationId:o.id,slug:"_org",name:o.name,ui:null},e[0]=o.id,e[1]=o.name,e[2]=s):s=e[2];const a=s;let i;return e[3]!==r||e[4]!==o||e[5]!==a?(i=n.jsx(xn,{org:o,project:a,children:r}),e[3]=r,e[4]=o,e[5]=a,e[6]=i):i=e[6],i}function To(){const t=Et(),e=Wn(),{org:o}=mt(),r=mn({strict:!1}),s=Dt(),{openPanel:a,closePanel:i}=$n(),c=Xn(),m=Zn(),h=es(),w=ts(),u=(f,d=!0)=>t({to:".",search:f,replace:d}),y=()=>u(f=>({...f,sidepanel:!0})),l=(f,d,x)=>{const b=!!m&&m===f;m&&!b&&po(m,{tab:s,mainpanel:r.mainpanel,sidepanel:r.sidepanel});const S=b?null:yo(f),j=It(o.id).id,P=fo({prev:{virtualmcpid:c,tabId:s,mainpanel:r.mainpanel,sidepanel:r.sidepanel},virtualMcpId:d,decopilotId:j,savedLayout:S,opts:x,autosendValue:Qn});return w(f,()=>P.search,{virtualMcpId:d,view:{tabId:P.tabId}})};return{openSidePanel:y,setTaskId:l,createNewTask:async(f,d,x)=>{const b=crypto.randomUUID(),S=f??h;try{await e?.create({id:b,virtual_mcp_id:S,...d?{branch:d}:{}})}catch{}l(b,S,{...x,newThread:!0})},openTab:a,closeTab:i}}const No=new Set(["/$org/","/$org/home"]);function _o(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e={select:Po},t[0]=e):e=t[0],$t(e)}function Po(t){const e=t.matches.at(-1)?.fullPath;return e!==void 0&&No.has(e)}function Ao(){const t=R.c(63);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/shell/$org",shouldThrow:!1},t[0]=e):e=t[0];const r=fn(e)?.params.org,[s,a]=se.useState(!1),[i,c]=Ys(),[m,h]=Un(),w=hn(),u=_o(),y=r??"";let l;t[1]!==y?(l=Jt(y),t[1]=y,t[2]=l):l=t[2];const g=!!r&&u;let f;t[3]!==l||t[4]!==g?(f={...l,enabled:g},t[3]=l,t[4]=g,t[5]=f):f=t[5],He(f);const{data:d}=Be.useSession(),x=d?.user?.id;let b;t[6]!==r||t[7]!==x?(b=r&&x?gn(x,r):null,t[6]=r,t[7]=x,t[8]=b):b=t[8];const S=b;let j,P;t[9]!==w?(j=()=>{const E=z=>{if(vt(z)&&z.code==="KeyK"){z.preventDefault(),Vs();return}if(z.key==="?"&&!Ms(z.target)){z.preventDefault(),a(!0);return}vt(z)&&z.code==="BracketLeft"&&w.history.canGoBack()&&(z.preventDefault(),w.history.back())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},P=[w],t[9]=w,t[10]=j,t[11]=P):(j=t[10],P=t[11]),se.useEffect(j,P);let k;t[12]!==r?(k=Ue.activeOrganization(r),t[12]=r,t[13]=k):k=t[13];let v;t[14]!==r||t[15]!==x?(v=async()=>{if(!r)return null;performance.mark("mesh:active-org-fetch:start");const{data:E}=await Be.organization.getFullOrganization({query:{organizationSlug:r}}).finally(Eo),z=rt(E);return E&&!z&&localStorage.setItem(Ke.lastOrgSlug(),r),x&&E&&yn(x,r,E),E},t[14]=r,t[15]=x,t[16]=v):v=t[16];const T=S?S.data:void 0,N=S?.updatedAt;let _;t[17]!==T||t[18]!==N||t[19]!==k||t[20]!==v?(_={queryKey:k,queryFn:v,initialData:T,initialDataUpdatedAt:N,gcTime:1/0,refetchOnWindowFocus:!1},t[17]=T,t[18]=N,t[19]=k,t[20]=v,t[21]=_):_=t[21];const{data:p}=Nt(_),A=p?.id,$=p?.slug,{data:I}=ns(A,$),D=!!I?.ssoRequired&&!I.authenticated,{data:C}=wo($);let M;t[22]===Symbol.for("react.memo_cache_sentinel")?(M={select:Co},t[22]=M):M=t[22];const K=$t(M),V=C?.severity==="block"&&!jo(K),q=A??"",W=$??"";let Y;t[23]!==q||t[24]!==W?(Y=Hn({connectionId:Ot,orgId:q,orgSlug:W}),t[23]=q,t[24]=W,t[25]=Y):Y=t[25];const L=!!A&&!!$;let Q;if(t[26]!==Y||t[27]!==L?(Q={...Y,enabled:L},t[26]=Y,t[27]=L,t[28]=Q):Q=t[28],He(Q),(!p||rt(p)||D||V)&&Ws(),!p){let E;return t[29]!==r?(E=n.jsx(fs,{orgSlug:r}),t[29]=r,t[30]=E):E=t[30],E}if(rt(p)){localStorage.getItem(Ke.lastOrgSlug())===r&&localStorage.removeItem(Ke.lastOrgSlug());let E;return t[31]!==p.name?(E=n.jsx(pn,{orgName:p.name}),t[31]=p.name,t[32]=E):E=t[32],E}if(V&&C){let E;return t[33]!==p.slug||t[34]!==C?(E=n.jsx(So,{notice:C,orgSlug:p.slug}),t[33]=p.slug,t[34]=C,t[35]=E):E=t[35],E}if(D){let E;return t[36]!==p.id||t[37]!==p.name||t[38]!==p.slug||t[39]!==I.domain?(E=n.jsx(bo,{orgId:p.id,orgSlug:p.slug,orgName:p.name,domain:I.domain}),t[36]=p.id,t[37]=p.name,t[38]=p.slug,t[39]=I.domain,t[40]=E):E=t[40],E}const oe=p.logo??null;let B;t[41]!==p||t[42]!==oe?(B={...p,logo:oe},t[41]=p,t[42]=oe,t[43]=B):B=t[43];let X;t[44]!==p?(X=n.jsx(mo,{activeOrg:p}),t[44]=p,t[45]=X):X=t[45];let Z;t[46]===Symbol.for("react.memo_cache_sentinel")?(Z=n.jsx(bn,{}),t[46]=Z):Z=t[46];let ee;t[47]===Symbol.for("react.memo_cache_sentinel")?(ee=n.jsxs("div",{className:"fixed bottom-6 right-6 z-50 flex w-[min(360px,calc(100vw-3rem))] flex-col gap-3",children:[n.jsx(Ds,{}),n.jsx(to,{})]}),t[47]=ee):ee=t[47];let te;t[48]!==i||t[49]!==c?(te=i&&n.jsx(Us,{open:i,onOpenChange:c}),t[48]=i,t[49]=c,t[50]=te):te=t[50];let H;t[51]!==m||t[52]!==h?(H=m&&n.jsx(Gn,{open:!0,onOpenChange:h,source:Jn()}),t[51]=m,t[52]=h,t[53]=H):H=t[53];let U;t[54]!==s?(U=n.jsx(zs,{open:s,onOpenChange:a}),t[54]=s,t[55]=U):U=t[55];let ne;t[56]===Symbol.for("react.memo_cache_sentinel")?(ne=n.jsx(ao,{}),t[56]=ne):ne=t[56];let ie;return t[57]!==B||t[58]!==X||t[59]!==te||t[60]!==H||t[61]!==U?(ie=n.jsxs(ko,{org:B,children:[X,Z,ee,te,H,U,ne]}),t[57]=B,t[58]=X,t[59]=te,t[60]=H,t[61]=U,t[62]=ie):ie=t[62],ie}function Co(t){return t.location.pathname}function Eo(){performance.mark("mesh:active-org-fetch:end"),performance.measure("mesh:active-org-fetch","mesh:active-org-fetch:start","mesh:active-org-fetch:end")}function Oo(){const t=R.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=n.jsx(Yn,{children:n.jsx(Ao,{})}),t[0]=e):e=t[0],e}const ri=Object.freeze(Object.defineProperty({__proto__:null,default:Oo,usePanelActions:To},Symbol.toStringTag,{value:"Module"}));export{G as K,hs as L,To as a,vt as b,ks as c,Ms as d,ai as e,ii as f,ri as g,zt as i,Vs as o,si as r,oi as s,wo as u};
|