decocms 4.395.0 → 4.397.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/{AlertCircle-BdjDX5mC.js → AlertCircle-B3LJiQhZ.js} +1 -1
- package/dist/client/assets/{AreaChart-D6iwCYdt.js → AreaChart-C3D5EayI.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Ca7fFz_9.js → ArrowLeft-DmWma6hW.js} +1 -1
- package/dist/client/assets/{ArrowRight-DfmVU-dl.js → ArrowRight-540iMVH3.js} +1 -1
- package/dist/client/assets/{ArrowUp-X767TF31.js → ArrowUp-BB5V3348.js} +1 -1
- package/dist/client/assets/{CartesianChart-D-jfHYej.js → CartesianChart-CYHbwjBR.js} +1 -1
- package/dist/client/assets/{Check-DIS6xK2s.js → Check-CGKF06bT.js} +1 -1
- package/dist/client/assets/{CheckCircle-rF1SRlKX.js → CheckCircle-tvGC17Dy.js} +1 -1
- package/dist/client/assets/{ChevronUp-8z69W8eb.js → ChevronUp-Du4AWZmG.js} +1 -1
- package/dist/client/assets/{Copy01-Cm_m4tgz.js → Copy01-CYbqJpFZ.js} +1 -1
- package/dist/client/assets/{CreditCard01-Bi5ugsTs.js → CreditCard01-CK4yyvJY.js} +1 -1
- package/dist/client/assets/{DotsVertical-DggqHyjg.js → DotsVertical-BQfY36BV.js} +1 -1
- package/dist/client/assets/{Download01-Dyb6in04.js → Download01-C8jubU2p.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-BTM-SQ-v.js → ErrorBarContext-DIzox7VI.js} +1 -1
- package/dist/client/assets/{Eye-4BNGMJWQ.js → Eye-CpLoEsen.js} +1 -1
- package/dist/client/assets/{Globe04-DZrkUoha.js → Globe04-DnURSsdQ.js} +1 -1
- package/dist/client/assets/{Image01-gmtSq_nr.js → Image01-DPZCMheY.js} +1 -1
- package/dist/client/assets/{Key01-tM2flTMh.js → Key01-CSyDklFV.js} +1 -1
- package/dist/client/assets/{LayoutLeft-Dig9JdlG.js → LayoutLeft-DgiG6wiH.js} +1 -1
- package/dist/client/assets/{Line-xkZzTMMm.js → Line-BzHEfJpl.js} +1 -1
- package/dist/client/assets/{Link01-DufQBiKF.js → Link01-CYG0Mr8Q.js} +1 -1
- package/dist/client/assets/{LinkExternal01-lG9r7Gkl.js → LinkExternal01-Div0d_z3.js} +1 -1
- package/dist/client/assets/{Monitor01-eFZQRlH8.js → Monitor01-BrSZ6zzu.js} +1 -1
- package/dist/client/assets/{Package-CVhtCyRO.js → Package-C5JGfmw5.js} +1 -1
- package/dist/client/assets/{Palette-C73414wl.js → Palette-Bm4HMPv2.js} +1 -1
- package/dist/client/assets/{Plus-Co8GDnQt.js → Plus-Do5Wkomw.js} +1 -1
- package/dist/client/assets/{SearchLg-Br_brFUE.js → SearchLg-gOfrWgIs.js} +1 -1
- package/dist/client/assets/{SearchMd-SvEyKWwE.js → SearchMd-B9ModJFt.js} +1 -1
- package/dist/client/assets/{Sector-CeHvW4BL.js → Sector-83Vf-xGJ.js} +1 -1
- package/dist/client/assets/{Share07-7GntLJL7.js → Share07-DpckpNEB.js} +1 -1
- package/dist/client/assets/{Stars01-Liu978-k.js → Stars01-B6IfixlN.js} +1 -1
- package/dist/client/assets/{Sun-CMsy_g5c.js → Sun-CzonSHrU.js} +1 -1
- package/dist/client/assets/{Tool01-CSJpNNvq.js → Tool01-DK_vv6qf.js} +1 -1
- package/dist/client/assets/{Trash01-Bh9q8r0u.js → Trash01-Dw6PLr8l.js} +1 -1
- package/dist/client/assets/{Upload01-COnIPKVQ.js → Upload01-BsQDz7U2.js} +1 -1
- package/dist/client/assets/{User01-Dh6W_JxD.js → User01-Bla6DkK3.js} +1 -1
- package/dist/client/assets/{UserSquare-DguX5tfN.js → UserSquare-CHvWRyuq.js} +1 -1
- package/dist/client/assets/{Users01-dzGvo-nO.js → Users01-fXdkObFe.js} +1 -1
- package/dist/client/assets/{X-Cwz8fCAP.js → X-CLqvixem.js} +1 -1
- package/dist/client/assets/{XCircle-l7a_k5g_.js → XCircle-xC8IFHez.js} +1 -1
- package/dist/client/assets/{XClose-DEtOBh9K.js → XClose-1APsw2yP.js} +1 -1
- package/dist/client/assets/{Zap-COngYniA.js → Zap-SzxRRv0w.js} +1 -1
- package/dist/client/assets/{ZoomOut-DLYNtop8.js → ZoomOut-DD-ULjJm.js} +1 -1
- package/dist/client/assets/{access-gate-C5b-wrOm.js → access-gate-DuyMJbDj.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-ZInt2lep.js → add-connection-dialog-D9j0h-SU.js} +1 -1
- package/dist/client/assets/{agent-analytics-DncZsIEv.js → agent-analytics-BYTMzPFg.js} +1 -1
- package/dist/client/assets/agent-app-WxppwwfV.js +1 -0
- package/dist/client/assets/{agent-assets-DYceKJb1.js → agent-assets-BvxD5BYD.js} +1 -1
- package/dist/client/assets/{agent-automation-BHnPm_6C.js → agent-automation-Ba85XZXF.js} +1 -1
- package/dist/client/assets/{agent-automations-BthF9afb.js → agent-automations-C3Rb_m0i.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-B6XL-_B3.js → agent-connect-sources-BAkxw0dJ.js} +1 -1
- package/dist/client/assets/agent-deck-B70vaH0w.js +1 -0
- package/dist/client/assets/{agent-e2e-8YELoQOD.js → agent-e2e-DfSc6gB-.js} +1 -1
- package/dist/client/assets/{agent-experiments-BI_7fU7O.js → agent-experiments-DYALFaiE.js} +1 -1
- package/dist/client/assets/agent-file-D2-O8b6i.js +1 -0
- package/dist/client/assets/{agent-git-Co_C51qe.js → agent-git-Cx-YU73R.js} +1 -1
- package/dist/client/assets/{agent-hosting-BCaZsIfU.js → agent-hosting-BCPfQ2PT.js} +1 -1
- package/dist/client/assets/{agent-icon-DNkk7_dP.js → agent-icon-CVsOY5Om.js} +1 -1
- package/dist/client/assets/agent-library-file-Dfir9Jjz.js +1 -0
- package/dist/client/assets/{agent-monitor-CfmhoEL5.js → agent-monitor-B-yEUTbW.js} +1 -1
- package/dist/client/assets/{agent-overview-CszHXUdJ.js → agent-overview-Cfajc4T9.js} +1 -1
- package/dist/client/assets/agent-settings-DgXye6uc.js +1 -0
- package/dist/client/assets/{agent-site-editor-CMlzhIYv.js → agent-site-editor-CkmomzNE.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DjOBYRBJ.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-BOZM5sYv.js → agent-site-editor-content-CmJpSlh2.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-DFvB02vG.js → agent-site-editor-preview-DDrBOF0Z.js} +3 -3
- package/dist/client/assets/agent-view-BgER_VJ8.js +1 -0
- package/dist/client/assets/{agent-view-guard-Dj-902EK.js → agent-view-guard-B7Mzpeja.js} +1 -1
- package/dist/client/assets/{agents-list-D-XEeTtr.js → agents-list-IOt-xE6T.js} +1 -1
- package/dist/client/assets/{ai-providers-ClcBNHZh.js → ai-providers-tko4xsdH.js} +1 -1
- package/dist/client/assets/{alert-BE-fWCeh.js → alert-CQx6yLHp.js} +1 -1
- package/dist/client/assets/{alert-dialog-Cq1hg0UR.js → alert-dialog-m7PHs13d.js} +1 -1
- package/dist/client/assets/{analytics-sections-NK5_rjep.js → analytics-sections-DsjRpqe8.js} +1 -1
- package/dist/client/assets/{api-keys-CjqrGCu0.js → api-keys-BprG_h9e.js} +1 -1
- package/dist/client/assets/api-keys-kPU0tPrf.js +1 -0
- package/dist/client/assets/app-editor-rJdo4lSU.js +1 -0
- package/dist/client/assets/{asset-utils-gjxAyArs.js → asset-utils-DvBCIwrI.js} +1 -1
- package/dist/client/assets/{auth-catchall-yla3rZri.js → auth-catchall-C7UKh7ij.js} +1 -1
- package/dist/client/assets/{auth-entry-DlZr_xF5.js → auth-entry-C6RqohRy.js} +1 -1
- package/dist/client/assets/{auth-rtbjEyyO.js → auth-k9t16OOb.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DRXGYe20.js → auth-split-layout-BHZF4vyi.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-6OnIpH1X.js → authenticate-and-persist-oauth-8HHvB0nM.js} +1 -1
- package/dist/client/assets/{automation-list-row-WNYEbjOX.js → automation-list-row-C44HdDvH.js} +1 -1
- package/dist/client/assets/{automation-runs-UUwdw33G.js → automation-runs-BCo5l857.js} +1 -1
- package/dist/client/assets/{automations-CWjOdWdj.js → automations-CYGQmasI.js} +1 -1
- package/dist/client/assets/{autosend-Bg1D9vFr.js → autosend-BKkKn8iq.js} +1 -1
- package/dist/client/assets/{avatar-DFg4s8mk.js → avatar-B9CWtHB4.js} +1 -1
- package/dist/client/assets/{badge-CBUlIbWu.js → badge-DS7xysUQ.js} +1 -1
- package/dist/client/assets/{block-document-BD5YFnvJ.js → block-document-C4eQcnX0.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-Gh9urzvZ.js → blocks-preview-workspace-context-sjVUFVpv.js} +1 -1
- package/dist/client/assets/{breadcrumb-B4FUuyx4.js → breadcrumb-DgDOitTK.js} +1 -1
- package/dist/client/assets/{buckets-Y69D6led.js → buckets-B9kHwSwC.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CY_N9D9r.js → build-improve-prompt-doc-lqIM7ao_.js} +1 -1
- package/dist/client/assets/{calendar-N4I3G7vL.js → calendar-v9y9PDp2.js} +1 -1
- package/dist/client/assets/{capability-load-error-CXaKscn3.js → capability-load-error-BByCTECw.js} +1 -1
- package/dist/client/assets/{category-editor-Dq0yGmDh.js → category-editor-BreOyR0b.js} +1 -1
- package/dist/client/assets/{chart-Dz7DbxHe.js → chart-BCxri3_D.js} +1 -1
- package/dist/client/assets/{chat-context-B6KASvlp.js → chat-context-CIrojUbL.js} +1 -1
- package/dist/client/assets/{chat-draft-IOcP140Y.js → chat-draft-CsL23XeE.js} +1 -1
- package/dist/client/assets/{checkbox-B-yppOY9.js → checkbox-DXebLGmO.js} +1 -1
- package/dist/client/assets/{choose-editor-ClzQSnAI.js → choose-editor-DTKQtlb0.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-BTHgUMYM.js → claim-phase-copy-Oexgf5gh.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Dju-5rXt.js → cli-auth-success-BnGCv2Bd.js} +1 -1
- package/dist/client/assets/{client-icons-r1sEjBfW.js → client-icons-D2WOCZv4.js} +1 -1
- package/dist/client/assets/{collapsible-BCDa82h2.js → collapsible-Ckib1khq.js} +1 -1
- package/dist/client/assets/{collection-detail-D55aLiaD.js → collection-detail-DnoTme22.js} +1 -1
- package/dist/client/assets/{collection-display-button-CHeHVSja.js → collection-display-button-CJrP29Qc.js} +1 -1
- package/dist/client/assets/{collection-search-yAl_7ba8.js → collection-search-B2Rze4Ue.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-zvXpI7Jt.js → collection-table-wrapper-C4p-UNKT.js} +1 -1
- package/dist/client/assets/{collection-tabs-_I4H5-8Z.js → collection-tabs-CrAcGqu0.js} +1 -1
- package/dist/client/assets/{combobox-DvmFvcK2.js → combobox-lelWCr2H.js} +1 -1
- package/dist/client/assets/{command-kb1NS2qW.js → command-DZRWMxD5.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-CGOg8jm0.js → companion-mcps-section-Di0GvwiM.js} +1 -1
- package/dist/client/assets/{connect-DE3OgN_B.js → connect-DQoon_ei.js} +1 -1
- package/dist/client/assets/{connect-layout-DcE9fs2U.js → connect-layout-DxnvLjPI.js} +1 -1
- package/dist/client/assets/{connection-DecG214K.js → connection-BtvJKuLN.js} +1 -1
- package/dist/client/assets/{connection-card-D2nj7hv2.js → connection-card-CEFIrJY3.js} +1 -1
- package/dist/client/assets/{connection-detail-pZuOyr7v.js → connection-detail-B-1EXZEm.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Dr6wsDFY.js → connection-form-helpers-DFcBYAWG.js} +1 -1
- package/dist/client/assets/{connections-HzHRp4Qk.js → connections-BDHqljAv.js} +1 -1
- package/dist/client/assets/{context-O0maf2i4.js → context-DWKz0IRn.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-B6alwQmm.js → create-organization-dialog-VdEJZP_b.js} +1 -1
- package/dist/client/assets/{decofile-api-ceTtKCRb.js → decofile-api-DrtvihiV.js} +1 -1
- package/dist/client/assets/{decopilot-DOOIVfNc.js → decopilot-CaIWBpB6.js} +1 -1
- package/dist/client/assets/{dialog-CHah4AEz.js → dialog-DiUlVwD1.js} +1 -1
- package/dist/client/assets/{discover-BuRqbP3I.js → discover-S8lOKkYU.js} +1 -1
- package/dist/client/assets/{domain-settings-D8btTkG9.js → domain-settings-BSPXcrvG.js} +1 -1
- package/dist/client/assets/{download-app-dialog-CoVFAI99.js → download-app-dialog-CwgA8Jar.js} +1 -1
- package/dist/client/assets/{drawer-CylcVBKD.js → drawer-BT08Xqaa.js} +1 -1
- package/dist/client/assets/{editor-DJd0mDZ_.js → editor-S8HMRfnV.js} +1 -1
- package/dist/client/assets/{empty-state-2ZNlIC3u.js → empty-state-AwoelJY5.js} +1 -1
- package/dist/client/assets/{empty-state-CxZ0dZ2w.js → empty-state-YhHJ1PAR.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B8MpEMZr.js → extract-connection-data-ak1yxd15.js} +1 -1
- package/dist/client/assets/{feature-gate-STTTyVOW.js → feature-gate-DpWu04P_.js} +1 -1
- package/dist/client/assets/{feature-paywall-zby53-l0.js → feature-paywall-O1oksi-z.js} +1 -1
- package/dist/client/assets/{file-explorer-CwC9u_y8.js → file-explorer-Cml3GhPa.js} +1 -1
- package/dist/client/assets/{file-preview-Boefj4rt.js → file-preview-DMCP6_DD.js} +1 -1
- package/dist/client/assets/{file-share-button-C3O0DKDn.js → file-share-button-DkoS4iJK.js} +1 -1
- package/dist/client/assets/{file-type-icon-CABO90Hi.js → file-type-icon-DyGflp6T.js} +1 -1
- package/dist/client/assets/{folder-icon-DLpjx21O.js → folder-icon-BDD2uWKR.js} +1 -1
- package/dist/client/assets/{form-Dh_ChFcx.js → form-DDtq3Oeg.js} +1 -1
- package/dist/client/assets/{gateway-client-BdNDD3Fv.js → gateway-client-BrPXiQqR.js} +1 -1
- package/dist/client/assets/{general-tRWTyUnl.js → general-DfP98aec.js} +1 -1
- package/dist/client/assets/{github-icon-CxwT_h4x.js → github-icon-C3M97Kp1.js} +1 -1
- package/dist/client/assets/{home-dx8JjYQR.js → home-xKrXsUuw.js} +1 -1
- package/dist/client/assets/{hooks-DHlcNU4W.js → hooks-Dpw_cJTM.js} +1 -1
- package/dist/client/assets/{icon-button-auG0C68h.js → icon-button-BA96KFLT.js} +1 -1
- package/dist/client/assets/{index-C3jGUiGY.js → index-4NmZWgdA.js} +1 -1
- package/dist/client/assets/{index-CDLmzjyB.js → index-B37137hI.js} +1 -1
- package/dist/client/assets/{index-B_XDGFkp.js → index-B3naBK-e.js} +1 -1
- package/dist/client/assets/{index-DYnCIW_H.js → index-BBOB34ZQ.js} +1 -1
- package/dist/client/assets/{index-CogiDqB9.js → index-Bh23iZvW.js} +1 -1
- package/dist/client/assets/{index-B0c-pV5f.js → index-C9PI5TjH.js} +1 -1
- package/dist/client/assets/{index-DsvZw1eS.js → index-CTQuScgI.js} +1 -1
- package/dist/client/assets/{index-DxnsQB3q.js → index-CgGEL4tk.js} +1 -1
- package/dist/client/assets/{index-DlYjAdRD.js → index-ChjHAm_X.js} +1 -1
- package/dist/client/assets/{index-XG0G_X0C.js → index-DV_mVnUZ.js} +1 -1
- package/dist/client/assets/{index-iqM8bGWC.js → index-Tjbom_M5.js} +1 -1
- package/dist/client/assets/{index-DhSkTLGL.js → index-cT94sQUH.js} +4 -4
- package/dist/client/assets/{index-B-X_B0-u.js → index-eJ0UMn-u.js} +1 -1
- package/dist/client/assets/{index-CFH90pUu.js → index-pU5iRqYT.js} +1 -1
- package/dist/client/assets/{index-redirect-px3p5jgZ.js → index-redirect-D4SSam4Y.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-SQin_Yvd.js → infiniteQueryObserver-Dj3x0ul-.js} +1 -1
- package/dist/client/assets/{infra-billing-Cyovk9MY.js → infra-billing-D24Nnoas.js} +1 -1
- package/dist/client/assets/{input-B16pDAaF.js → input-CSdHjp7L.js} +1 -1
- package/dist/client/assets/{input-DOGfocYU.js → input-DbR0YCVu.js} +1 -1
- package/dist/client/assets/{input-BgyxSXDx.js → input-q5pG06UZ.js} +1 -1
- package/dist/client/assets/{integration-icon-CWhWFKSI.js → integration-icon-CBv4y2ld.js} +1 -1
- package/dist/client/assets/{label-DoUZvMsM.js → label-C6sMx1BY.js} +1 -1
- package/dist/client/assets/{last-preview-page-DoFyu8gS.js → last-preview-page-CcpwTOWp.js} +1 -1
- package/dist/client/assets/{layout-DCn7MbpA.js → layout-E2cSDTGe.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-Cg9seGHp.js → legacy-agents-deep-BMTlTde1.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-D_JoGkGg.js → legacy-main-redirect-B68-Adnw.js} +1 -1
- package/dist/client/assets/{library-BXEDhmp6.js → library-DI55mv6l.js} +1 -1
- package/dist/client/assets/{login-_MnmOwHx.js → login-DwlqHc1T.js} +1 -1
- package/dist/client/assets/{markdown-jldr0Pt-.js → markdown-rYdPNaGa.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DWFpsVLg.js → mcp-app-renderer-DQd4z-tw.js} +1 -1
- package/dist/client/assets/{mcp-oauth-DCiCc1Ys.js → mcp-oauth-CtDqQIpT.js} +1 -1
- package/dist/client/assets/{members--1NnzpLe.js → members-CnWBKrrf.js} +1 -1
- package/dist/client/assets/{message-templates-C6SYOwU4.js → message-templates-wovwT2FV.js} +1 -1
- package/dist/client/assets/{mini-report-page-BbUrfefO.js → mini-report-page-C71ATA2q.js} +1 -1
- package/dist/client/assets/{mock-board-BsRvcHLL.js → mock-board-vXXuZ9OB.js} +3 -3
- package/dist/client/assets/{monaco-editor-C3hw-Knq.js → monaco-editor-BYvrmVl8.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-IHYADWAH.js → monitoring-stats-row-IkwiQHjH.js} +1 -1
- package/dist/client/assets/{multi-select-BxIqSwKn.js → multi-select-CDQWJfyp.js} +1 -1
- package/dist/client/assets/{mustache-BQAdeH_e.js → mustache-g0W1c9Pz.js} +1 -1
- package/dist/client/assets/{oauth-callback-Drez0Mjv.js → oauth-callback-7N1qrOP1.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BTLGGlKL.js → oauth-callback-ai-provider-D330wyq5.js} +1 -1
- package/dist/client/assets/{onboarding-CNkHyBJK.js → onboarding-DsJ-aRc9.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-DeZTX9C3.js → optimistic-project-sidebar-views-KtCnoFH8.js} +1 -1
- package/dist/client/assets/{org-file-open-context-DpgPN-dz.js → org-file-open-context-DjmvTwmC.js} +1 -1
- package/dist/client/assets/{organization-choice-O9oI4IDB.js → organization-choice-CZOzYUte.js} +1 -1
- package/dist/client/assets/{orgs-CIss9nAE.js → orgs-CRAWDAbw.js} +1 -1
- package/dist/client/assets/{page-seo-form-CuS-PiQd.js → page-seo-form-DUgQn0jT.js} +1 -1
- package/dist/client/assets/{pair-DMcPh_z8.js → pair-knW_lHO5.js} +1 -1
- package/dist/client/assets/{plan-ladder-B-Brd23w.js → plan-ladder-CcvRWQzg.js} +1 -1
- package/dist/client/assets/{popover-DxSiDTcL.js → popover-DuPXzrgi.js} +1 -1
- package/dist/client/assets/{post-calendar-C7nmJLva.js → post-calendar-Dm2FZlVO.js} +1 -1
- package/dist/client/assets/post-editor-BkQnPDqK.js +2 -0
- package/dist/client/assets/{preview-content-UQ4RH9cD.js → preview-content-nqp1cQig.js} +1 -1
- package/dist/client/assets/{preview-dialog-CydqVuFv.js → preview-dialog-DGkB30uu.js} +1 -1
- package/dist/client/assets/{profile-tOdQJbRB.js → profile-B2S2gmBW.js} +1 -1
- package/dist/client/assets/{project-app-view-D2XTjQYu.js → project-app-view-CJHRV6yL.js} +1 -1
- package/dist/client/assets/{project-feed-CSjxmMjK.js → project-feed-8Cez5QU8.js} +1 -1
- package/dist/client/assets/{project-icon-CUwlDXv8.js → project-icon-DW-tv9X7.js} +1 -1
- package/dist/client/assets/project-reports-kefrM59s.js +1 -0
- package/dist/client/assets/project-tasks-B7o9qjzH.js +1 -0
- package/dist/client/assets/{prompts-Qwbe-qfw.js → prompts-B2tfrrMA.js} +1 -1
- package/dist/client/assets/record-editor-C887zwF7.js +1 -0
- package/dist/client/assets/{redirect-editor-XAD_NfpX.js → redirect-editor-BbBd0UrL.js} +1 -1
- package/dist/client/assets/{reports-CsPYB217.js → reports-2V5MZWdY.js} +1 -1
- package/dist/client/assets/reports-N7SlvZN1.js +1 -0
- package/dist/client/assets/{reports-onboarding-hvZbPhGa.js → reports-onboarding-DA-l-ocL.js} +1 -1
- package/dist/client/assets/{reports-tab-DXTJaWxE.js → reports-tab-B6VauTwc.js} +2 -2
- package/dist/client/assets/{repositories-CQrW6dNK.js → repositories-CeQWa7JA.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DdNa4G2v.js → repository-import-picker-DgpEdzVj.js} +1 -1
- package/dist/client/assets/{repository-picker-7Is3ByDn.js → repository-picker-B-RVPafI.js} +1 -1
- package/dist/client/assets/{require-capability-pjqeE7R0.js → require-capability-A2qKaV-G.js} +1 -1
- package/dist/client/assets/{required-auth-layout-1k3qqAZq.js → required-auth-layout-fSuiMVRc.js} +1 -1
- package/dist/client/assets/{reset-password-DrNySG4F.js → reset-password-B9ys5_ef.js} +1 -1
- package/dist/client/assets/{resizable-B8LDsjNH.js → resizable-CyPCDk7u.js} +1 -1
- package/dist/client/assets/{review-settings-B1E8MJFM.js → review-settings-CiSbDHmD.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-CW8aj_xK.js → rich-text-link-control-CEAa82WB.js} +1 -1
- package/dist/client/assets/{roles-_8cW5GsB.js → roles-slcMFBOI.js} +1 -1
- package/dist/client/assets/{route-BhvAz9y0.js → route-Be_JrbZa.js} +1 -1
- package/dist/client/assets/{route-i0aIvPzP.js → route-CBjQKRPM.js} +1 -1
- package/dist/client/assets/{route-BpWhExk3.js → route-D6QVa62m.js} +1 -1
- package/dist/client/assets/{route-page-header-BG6upA7o.js → route-page-header-CQ5gYErc.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-BvZTuY4a.js → runnable-block-editor-s0ZqFhOI.js} +2 -2
- package/dist/client/assets/{sandbox-lifecycle-context-DTvzLfwh.js → sandbox-lifecycle-context-Bt6dDo65.js} +1 -1
- package/dist/client/assets/{schema-u3jtmVba.js → schema-BwpPocS5.js} +1 -1
- package/dist/client/assets/{scroll-area-CkGiRKwx.js → scroll-area-C_IMBr_-.js} +1 -1
- package/dist/client/assets/{search-input-BxTX9M-m.js → search-input-B12ZEo-u.js} +1 -1
- package/dist/client/assets/{search-toggle-Ch6k99zS.js → search-toggle-DN5GZHXp.js} +1 -1
- package/dist/client/assets/{secret-picker-Duqj9RB7.js → secret-picker-yI9Rfw9t.js} +1 -1
- package/dist/client/assets/{secrets-CecYOql5.js → secrets-Dwbmj7Nu.js} +1 -1
- package/dist/client/assets/{sections-editor-DzM5HpSh.js → sections-editor-DWq3wSNS.js} +1 -1
- package/dist/client/assets/{select-BxXffwm8.js → select-B3V6AARR.js} +1 -1
- package/dist/client/assets/{select-model-TXhTT5MC.js → select-model-Dgg0QqmD.js} +1 -1
- package/dist/client/assets/{seo-editor-BZXIMgOA.js → seo-editor-DVhSkr87.js} +1 -1
- package/dist/client/assets/{separator-CRZkVmom.js → separator-B-YTOKXU.js} +1 -1
- package/dist/client/assets/{settings-tab-Csz3OcWl.js → settings-tab-Bqa114IE.js} +1 -1
- package/dist/client/assets/{sheet-DHPOBCIH.js → sheet-908igmnH.js} +1 -1
- package/dist/client/assets/{shell-layout-Cz11op_j.js → shell-layout-CkG1W_88.js} +1 -1
- package/dist/client/assets/{sidebar-CYvFgCRx.js → sidebar-BFWjj-3T.js} +1 -1
- package/dist/client/assets/{skill-preview-L9yueXhL.js → skill-preview-DCEvyr6I.js} +1 -1
- package/dist/client/assets/{skills-USLx6pJU.js → skills-Kroh8R0z.js} +1 -1
- package/dist/client/assets/{sso-ggH4sVNF.js → sso-CI5lCnpA.js} +1 -1
- package/dist/client/assets/{suggestion-SRJue54Z.js → suggestion-DWARFIlS.js} +1 -1
- package/dist/client/assets/{switch-ChouNlvE.js → switch-BhJ3AZWs.js} +1 -1
- package/dist/client/assets/{synced-repos-Cg02azaV.js → synced-repos-Dk3VsHpp.js} +1 -1
- package/dist/client/assets/{table-CjZ6bpyv.js → table-niYnsTKc.js} +1 -1
- package/dist/client/assets/{tabs-BwNG0eCd.js → tabs-BcaB_WSA.js} +1 -1
- package/dist/client/assets/{task-board-BTFceDsr.js → task-board-BKlDz2nG.js} +1 -1
- package/dist/client/assets/{task-route-9rq2LH_u.js → task-route-CUZautp3.js} +1 -1
- package/dist/client/assets/{task-status-CAZlANY5.js → task-status-VdIk_CP0.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-Cs_7dhRu.js → taskboard-analytics-CRqfD7UI.js} +1 -1
- package/dist/client/assets/tasks-CLicx8Qy.js +1 -0
- package/dist/client/assets/{tasks-BzpOkAS5.js → tasks-d4yimVTu.js} +1 -1
- package/dist/client/assets/{textarea-B3g9AiNh.js → textarea-lt2TXyPT.js} +1 -1
- package/dist/client/assets/thread-analytics-DHF3uWYQ.js +1 -0
- package/dist/client/assets/{thread-button-BkDG4mJc.js → thread-button-BVgcb5x6.js} +1 -1
- package/dist/client/assets/{thread-intent-DQQX4ez-.js → thread-intent-CHlBhQ4g.js} +1 -1
- package/dist/client/assets/{thread-route-CHPCSMp1.js → thread-route-C05Rrd8B.js} +1 -1
- package/dist/client/assets/{thread-route-CodswIQO.js → thread-route-fx8YTsf_.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-rCdTbpje.js → thread-sheet-body-Do5I-YMq.js} +1 -1
- package/dist/client/assets/{toggle-group-OgPDqRCx.js → toggle-group-D0Pzc72Y.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-BFuTt641.js → toolbar-icon-button-BXZ727Lv.js} +1 -1
- package/dist/client/assets/{tooltip-CdMRXeRO.js → tooltip-BGTnGCWW.js} +1 -1
- package/dist/client/assets/{track-BY_-fgjR.js → track-Cl2p3Vuk.js} +1 -1
- package/dist/client/assets/{types-BC21t2qu.js → types-C2ulVtYx.js} +1 -1
- package/dist/client/assets/{usage-stats-1ckQxn0v.js → usage-stats-D4BBDmdo.js} +1 -1
- package/dist/client/assets/{use-ai-providers-DA6CHYVa.js → use-ai-providers-Cc_CzBZr.js} +1 -1
- package/dist/client/assets/{use-automations-CWqcc9kt.js → use-automations-Bjnctu1x.js} +1 -1
- package/dist/client/assets/{use-autosave-CEAIQxhk.js → use-autosave-C6qsU6pa.js} +1 -1
- package/dist/client/assets/{use-connect-companion-ClEjNUxm.js → use-connect-companion-YiSxQfB7.js} +1 -1
- package/dist/client/assets/{use-connection-Dd_jV-yJ.js → use-connection-BUnGMpfY.js} +1 -1
- package/dist/client/assets/{use-copy-CY0uX_8k.js → use-copy-Cg8pzMCn.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-DmDNtDNL.js → use-create-virtual-mcp-DfoENq1A.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-DNaUShhq.js → use-date-fns-locale-BxNb5mu8.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-6GCVLZBS.js → use-debounced-autosave-Ds1nUcal.js} +1 -1
- package/dist/client/assets/{use-debounced-value-Do_J7hEj.js → use-debounced-value-CylTsY1l.js} +1 -1
- package/dist/client/assets/{use-deco-credits-C39l2lac.js → use-deco-credits-BqxUGiz2.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DIlh7dSh.js → use-decopilot-events-BT_W0lJl.js} +1 -1
- package/dist/client/assets/{use-delete-connection-j_pMA3IS.js → use-delete-connection-PzbXJAFK.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-CU52_xCA.js → use-deployment-admin-B1rWnD8o.js} +1 -1
- package/dist/client/assets/{use-entitlements-257_wTWG.js → use-entitlements-Dbhso4ZI.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-DXjkuVUA.js → use-fast-preview-draft-url-zcMUpMeA.js} +1 -1
- package/dist/client/assets/{use-file-configs-8taBP8k9.js → use-file-configs-Du_BOfea.js} +1 -1
- package/dist/client/assets/{use-in-settings-DYsEHzaT.js → use-in-settings-3zEronlT.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-CkOuA_lt.js → use-infinite-scroll-DASshMJA.js} +1 -1
- package/dist/client/assets/{use-join-requests-CsXh6lvN.js → use-join-requests-DBEizFwN.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DT1BpDsC.js → use-main-panel-tabs-CSiN5F_0.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-DmWTzlg5.js → use-mcp-auth-status-JThWl3bk.js} +1 -1
- package/dist/client/assets/{use-mcp-client-b7DTGvtL.js → use-mcp-client-GBv4syMd.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-B2Ma26mi.js → use-mcp-prompts-CrOqkZmO.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CmqrJP5L.js → use-mcp-tools-BZqzi-qU.js} +1 -1
- package/dist/client/assets/{use-members-aktnQw4R.js → use-members-hKKM8H8F.js} +1 -1
- package/dist/client/assets/{use-mobile-DzqR2cHs.js → use-mobile-Dv7BcXr5.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-D9fIIA21.js → use-navigate-to-agent-Cp353ZuE.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-BEVnxZA4.js → use-open-billing-url-DzWGWKyA.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-3bpUx3aw.js → use-org-auth-client-DzE4u5oy.js} +1 -1
- package/dist/client/assets/{use-org-fs-BArN8ZcH.js → use-org-fs-CGr2NA9d.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-OnoZdcOv.js → use-org-repo-syncs-6F5S6E3X.js} +1 -1
- package/dist/client/assets/{use-org-sso-DPNIlT2S.js → use-org-sso-BziwA5dH.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DooOcmAg.js → use-organization-roles-BpECo09m.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BSYRjL39.js → use-organization-settings-C55vewZa.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-DcD1PfAj.js → use-panel-navigate-BvpNAJeL.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-DxnNUDZU.js → use-project-native-view-presence-DYD4cRxj.js} +1 -1
- package/dist/client/assets/{use-project-scope-DcWiPsZj.js → use-project-scope-CYpIGnJg.js} +1 -1
- package/dist/client/assets/{use-releases-DHZTL6P_.js → use-releases-w4OvCw5M.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-zyoRuXWI.js → use-reports-diagnostic-DvPUM_ji.js} +1 -1
- package/dist/client/assets/{use-route-default-main-DhH-ylJM.js → use-route-default-main-Bux-DW8_.js} +1 -1
- package/dist/client/assets/{use-secrets-DhnLdwYE.js → use-secrets-9InRr5Wg.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-C_IWeAj_.js → use-section-preview-base-BbXgFtzl.js} +1 -1
- package/dist/client/assets/{use-session-runtime-D2-_gXdx.js → use-session-runtime-CyC7y7Wf.js} +1 -1
- package/dist/client/assets/{use-tags-CNVnuuSd.js → use-tags-B4nQMv-Q.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-D47lmbU-.js → use-task-board-analytics-CVUteVBr.js} +1 -1
- package/dist/client/assets/{use-task-metadata-B64sdo2d.js → use-task-metadata-C-i2MCdn.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-DpqWPi0H.js → use-thread-analytics-CTAY_EQL.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-D0MYu54u.js → use-thread-outputs-B__J7AZP.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D7FnpzkN.js → use-virtual-mcp-CyUsVYwB.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-DS8vuz-1.js +1 -0
- package/dist/client/assets/{useQueries-CD4Yid_4.js → useQueries-DRE-cCNR.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D-EjhUK7.js +1 -0
- package/dist/client/assets/{users-Do75zTfR.js → users-DBkZe3bO.js} +1 -1
- package/dist/client/assets/{utils-88J5Oh55.js → utils-CHGVrATA.js} +1 -1
- package/dist/client/assets/{variant-calendar-B0jDkPh6.js → variant-calendar-BDMygNPj.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-B7JeRFom.js → variant-matcher-override-DefoQYjj.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-CjHK4u9O.js → view-mode-toggle-CSfYGuhk.js} +1 -1
- package/dist/client/assets/{virtual-mcp-CoouNObF.js → virtual-mcp-C_hBI7Rj.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-BzuKrspC.js +0 -1
- package/dist/client/assets/agent-deck-6l4gW9ZI.js +0 -1
- package/dist/client/assets/agent-file-C8zo3tiW.js +0 -1
- package/dist/client/assets/agent-library-file-CfC5Zmdx.js +0 -1
- package/dist/client/assets/agent-settings-CgOSdAi8.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Dr6GEBYT.js +0 -2
- package/dist/client/assets/agent-view-C42r9GCR.js +0 -1
- package/dist/client/assets/api-keys-Dca9QpVw.js +0 -1
- package/dist/client/assets/app-editor-D_WcHCVl.js +0 -1
- package/dist/client/assets/post-editor-CNbJO3DN.js +0 -2
- package/dist/client/assets/project-reports-DRRVhbR-.js +0 -1
- package/dist/client/assets/project-tasks-CP_o8MJT.js +0 -1
- package/dist/client/assets/record-editor-DyB6exB5.js +0 -1
- package/dist/client/assets/reports-Cp_hE3bR.js +0 -1
- package/dist/client/assets/tasks-Bcf0OxwU.js +0 -1
- package/dist/client/assets/thread-analytics-BbeLvC08.js +0 -1
- package/dist/client/assets/useInfiniteQuery-DtiIzck6.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-D5ztjQZ3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ap as ve,bQ as Oe,bR as Me,aq as de,bP as ze,c as U,b as L,j as t,h as Ne,B,r as Z,l as Se,a0 as te,a6 as Ee,D as me,K as ee,d as se,p as ye,am as Ce,eM as Re,Z as Ue,n as Fe,f6 as ue,Y as Le,I as Ve,F as Be,H as qe,G as xe,E as Ge,f as He,ff as Ke,o as Qe,ao as Xe,an as We,t as J}from"./index-DhSkTLGL.js";import{g as Ye}from"./extract-connection-data-B8MpEMZr.js";import{E as _e}from"./empty-state-CxZ0dZ2w.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-Dr6wsDFY.js";import{c as nt,S as it,D as ot}from"./index-DsvZw1eS.js";import{u as we,T as at}from"./use-mcp-auth-status-DmWTzlg5.js";import{a as lt}from"./use-members-aktnQw4R.js";import{A as rt}from"./avatar-DFg4s8mk.js";import{a as Ie,b as ke,u as ct}from"./use-connection-Dd_jV-yJ.js";import{u as Te}from"./use-mcp-client-b7DTGvtL.js";import{u as dt}from"./use-mcp-tools-CmqrJP5L.js";import{a as mt}from"./use-mcp-prompts-B2Ma26mi.js";import{i as ut,a as xt}from"./mcp-oauth-DCiCc1Ys.js";import{I as ae}from"./integration-icon-CWhWFKSI.js";import{s as pt}from"./Plus-Co8GDnQt.js";import{b8 as ft,an as ht,N as gt,bm as jt,k as ne,am as bt}from"./agent-icon-DNkk7_dP.js";import{a as Ae,f as vt,s as Nt}from"./Tool01-CSJpNNvq.js";import{s as re}from"./Trash01-Bh9q8r0u.js";import{b as St,a as yt,c as Ct,S as _t,d as wt}from"./sheet-DHPOBCIH.js";import{F as G,b as H,c as K,d as V,f as Q,e as It,a as kt}from"./form-Dh_ChFcx.js";import{I as W}from"./input-B16pDAaF.js";import{u as Tt,D as At}from"./use-delete-connection-j_pMA3IS.js";import{c as Pt,B as Dt,a as $t,C as Ot}from"./monitoring-stats-row-IHYADWAH.js";import{b as Mt,c as zt,d as Et}from"./chart-Dz7DbxHe.js";import{b as Rt}from"./use-virtual-mcp-D7FnpzkN.js";import{T as ie,a as Ut,c as oe,b as Ft}from"./tabs-BwNG0eCd.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-BC21t2qu.js";import{M as Lt}from"./mcp-app-renderer-DWFpsVLg.js";import{C as Vt}from"./collection-search-yAl_7ba8.js";import{B as Bt}from"./badge-CBUlIbWu.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-BxXffwm8.js";import{i as qt}from"./CheckCircle-rF1SRlKX.js";import{t as Gt}from"./ChevronUp-8z69W8eb.js";import{a as Ht}from"./UserSquare-DguX5tfN.js";import{s as Kt}from"./XClose-DEtOBh9K.js";import{p as Qt,i as Xt}from"./connection-DecG214K.js";import"./metadata-D72DunRR.js";import"./sidebar-CYvFgCRx.js";import"./LayoutLeft-Dig9JdlG.js";import"./use-mobile-DzqR2cHs.js";import"./tooltip-CdMRXeRO.js";import"./index-DxnsQB3q.js";import"./Key01-tM2flTMh.js";import"./auth-rtbjEyyO.js";import"./index-B-X_B0-u.js";import"./index-C3jGUiGY.js";import"./index-B0c-pV5f.js";import"./popover-DxSiDTcL.js";import"./Check-DIS6xK2s.js";import"./SearchMd-SvEyKWwE.js";import"./use-create-virtual-mcp-DmDNtDNL.js";import"./use-navigate-to-agent-D9fIIA21.js";import"./hooks-DHlcNU4W.js";import"./backoff-8mStPHYB.js";import"./task-board-BTFceDsr.js";import"./schema-u3jtmVba.js";import"./thread-intent-DQQX4ez-.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-4BNGMJWQ.js";import"./use-org-auth-client-3bpUx3aw.js";import"./User01-Dh6W_JxD.js";import"./AlertCircle-BdjDX5mC.js";import"./ArrowUp-X767TF31.js";import"./ArrowLeft-Ca7fFz_9.js";import"./ArrowRight-DfmVU-dl.js";import"./XCircle-l7a_k5g_.js";import"./ZoomOut-DLYNtop8.js";import"./Globe04-DZrkUoha.js";import"./Copy01-Cm_m4tgz.js";import"./CreditCard01-Bi5ugsTs.js";import"./DotsVertical-DggqHyjg.js";import"./Download01-Dyb6in04.js";import"./Share07-7GntLJL7.js";import"./Image01-gmtSq_nr.js";import"./Link01-DufQBiKF.js";import"./LinkExternal01-lG9r7Gkl.js";import"./Monitor01-eFZQRlH8.js";import"./Sun-CMsy_g5c.js";import"./Package-CVhtCyRO.js";import"./Palette-C73414wl.js";import"./SearchLg-Br_brFUE.js";import"./Stars01-Liu978-k.js";import"./Upload01-COnIPKVQ.js";import"./Users01-dzGvo-nO.js";import"./X-Cwz8fCAP.js";import"./Zap-COngYniA.js";import"./label-DoUZvMsM.js";import"./alert-dialog-Cq1hg0UR.js";import"./CartesianChart-D-jfHYej.js";import"./AreaChart-D6iwCYdt.js";import"./ErrorBarContext-BTM-SQ-v.js";import"./Sector-CeHvW4BL.js";const Wt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(ft,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ht,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=L();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(pt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Zt,{instance:_,onConfigure:c}),children:t.jsx(Jt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=L(),l=Ee(),o=ns(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Pt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx(Mt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:m,barCategoryGap:"4%",children:[t.jsx(zt,{content:t.jsx(Et,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(as)})]})]})}function as(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ls(s,e){return t.jsx(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ds(s){const e=U.c(22),{connectionId:n}=s,c=L(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ms,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=L(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Rt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=L(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(fs),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Lt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=L();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=L(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ut,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(js):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ft,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function bs(s){return ce(s._meta)}function vs(s){const e=U.c(15),{connection:n,displayTitle:c}=s,a=Ue(),i=c??n.title,l=a?"md":"xl";let o;e[0]!==n.icon||e[1]!==l||e[2]!==i?(o=t.jsx(ae,{icon:n.icon,name:i,size:l,className:"shrink-0"}),e[0]=n.icon,e[1]=l,e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i?(r=a?t.jsx(Fe.Title,{children:i}):t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[4]=a,e[5]=i,e[6]=r):r=e[6];let d;e[7]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[7]=n.description,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==d?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[9]=r,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=t.jsxs("div",{className:"flex items-center classic:gap-4 classic:md:gap-6 classic:py-5 classic:md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0 compact:gap-3 compact:py-4",children:[o,u]}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=L(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Qt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(V,{children:t.jsx(Je,{value:x.value??[],onChange:x.onChange})}),t.jsx(Q,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(qt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 classic:rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity compact:rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Kt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(It,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Cs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=et(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Cs(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function _s(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=st(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=L(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Qe(),m=ke(),{org:p}=te(),x=Tt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=lt(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=nt(O,Yt),v=Xe({resolver:We(Ze),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await xt({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(At,{...x}),t.jsx(St,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(_t,{className:"text-base",children:h?.title??s.title}),t.jsx(wt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(rt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(kt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(V,{children:t.jsx(W,{...f})}),t.jsx(Q,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(V,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(Ns,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{hideTopbar:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=Ye("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await ut({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(F)}finally{S(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Is(){const s=U.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=He(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=ct(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=dt(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map($s):(m?.tools??[]).map(Ds);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=As;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=mt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=Ke(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Ts),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(ks),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(ws,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function ks(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Is,{})})}),s[0]=e):e=s[0],e}function Si(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{Si as default};
|
|
1
|
+
import{ap as ve,bQ as Oe,bR as Me,aq as de,bP as ze,c as U,b as L,j as t,h as Ne,B,r as Z,l as Se,a0 as te,a6 as Ee,D as me,K as ee,d as se,p as ye,am as Ce,eM as Re,Z as Ue,n as Fe,f6 as ue,Y as Le,I as Ve,F as Be,H as qe,G as xe,E as Ge,f as He,ff as Ke,o as Qe,ao as Xe,an as We,t as J}from"./index-cT94sQUH.js";import{g as Ye}from"./extract-connection-data-ak1yxd15.js";import{E as _e}from"./empty-state-YhHJ1PAR.js";import{E as Je,c as Ze,r as et,b as tt,d as st}from"./connection-form-helpers-DFcBYAWG.js";import{c as nt,S as it,D as ot}from"./index-CTQuScgI.js";import{u as we,T as at}from"./use-mcp-auth-status-JThWl3bk.js";import{a as lt}from"./use-members-hKKM8H8F.js";import{A as rt}from"./avatar-B9CWtHB4.js";import{a as Ie,b as ke,u as ct}from"./use-connection-BUnGMpfY.js";import{u as Te}from"./use-mcp-client-GBv4syMd.js";import{u as dt}from"./use-mcp-tools-BZqzi-qU.js";import{a as mt}from"./use-mcp-prompts-CrOqkZmO.js";import{i as ut,a as xt}from"./mcp-oauth-CtDqQIpT.js";import{I as ae}from"./integration-icon-CBv4y2ld.js";import{s as pt}from"./Plus-Do5Wkomw.js";import{b8 as ft,an as ht,N as gt,bm as jt,k as ne,am as bt}from"./agent-icon-CVsOY5Om.js";import{a as Ae,f as vt,s as Nt}from"./Tool01-DK_vv6qf.js";import{s as re}from"./Trash01-Dw6PLr8l.js";import{b as St,a as yt,c as Ct,S as _t,d as wt}from"./sheet-908igmnH.js";import{F as G,b as H,c as K,d as V,f as Q,e as It,a as kt}from"./form-DDtq3Oeg.js";import{I as W}from"./input-CSdHjp7L.js";import{u as Tt,D as At}from"./use-delete-connection-PzbXJAFK.js";import{c as Pt,B as Dt,a as $t,C as Ot}from"./monitoring-stats-row-IkwiQHjH.js";import{b as Mt,c as zt,d as Et}from"./chart-BCxri3_D.js";import{b as Rt}from"./use-virtual-mcp-CyUsVYwB.js";import{T as ie,a as Ut,c as oe,b as Ft}from"./tabs-BcaB_WSA.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{g as ce}from"./types-C2ulVtYx.js";import{M as Lt}from"./mcp-app-renderer-DQd4z-tw.js";import{C as Vt}from"./collection-search-B2Rze4Ue.js";import{B as Bt}from"./badge-DS7xysUQ.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-B3V6AARR.js";import{i as qt}from"./CheckCircle-tvGC17Dy.js";import{t as Gt}from"./ChevronUp-Du4AWZmG.js";import{a as Ht}from"./UserSquare-CHvWRyuq.js";import{s as Kt}from"./XClose-1APsw2yP.js";import{p as Qt,i as Xt}from"./connection-BtvJKuLN.js";import"./metadata-D72DunRR.js";import"./sidebar-BFWjj-3T.js";import"./LayoutLeft-DgiG6wiH.js";import"./use-mobile-Dv7BcXr5.js";import"./tooltip-BGTnGCWW.js";import"./index-CgGEL4tk.js";import"./Key01-CSyDklFV.js";import"./auth-k9t16OOb.js";import"./index-eJ0UMn-u.js";import"./index-4NmZWgdA.js";import"./index-C9PI5TjH.js";import"./popover-DuPXzrgi.js";import"./Check-CGKF06bT.js";import"./SearchMd-B9ModJFt.js";import"./use-create-virtual-mcp-DfoENq1A.js";import"./use-navigate-to-agent-Cp353ZuE.js";import"./hooks-Dpw_cJTM.js";import"./backoff-8mStPHYB.js";import"./task-board-BKlDz2nG.js";import"./schema-BwpPocS5.js";import"./thread-intent-CHlBhQ4g.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-BknN0SVI.js";import"./Eye-CpLoEsen.js";import"./use-org-auth-client-DzE4u5oy.js";import"./User01-Bla6DkK3.js";import"./AlertCircle-B3LJiQhZ.js";import"./ArrowUp-BB5V3348.js";import"./ArrowLeft-DmWma6hW.js";import"./ArrowRight-540iMVH3.js";import"./XCircle-xC8IFHez.js";import"./ZoomOut-DD-ULjJm.js";import"./Globe04-DnURSsdQ.js";import"./Copy01-CYbqJpFZ.js";import"./CreditCard01-CK4yyvJY.js";import"./DotsVertical-BQfY36BV.js";import"./Download01-C8jubU2p.js";import"./Share07-DpckpNEB.js";import"./Image01-DPZCMheY.js";import"./Link01-CYG0Mr8Q.js";import"./LinkExternal01-Div0d_z3.js";import"./Monitor01-BrSZ6zzu.js";import"./Sun-CzonSHrU.js";import"./Package-C5JGfmw5.js";import"./Palette-Bm4HMPv2.js";import"./SearchLg-gOfrWgIs.js";import"./Stars01-B6IfixlN.js";import"./Upload01-BsQDz7U2.js";import"./Users01-fXdkObFe.js";import"./X-CLqvixem.js";import"./Zap-SzxRRv0w.js";import"./label-C6sMx1BY.js";import"./alert-dialog-m7PHs13d.js";import"./CartesianChart-CYHbwjBR.js";import"./AreaChart-C3D5EayI.js";import"./ErrorBarContext-DIzox7VI.js";import"./Sector-83Vf-xGJ.js";const Wt=ve({scopes:ze(de()).describe("List of scopes available"),stateSchema:Oe(de(),Me()).describe("JSON Schema (draft-07) defining the state structure")}),Yt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Wt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=L();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(ft,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ht,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=L();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=i):i=e[2];let l;e[3]!==n.title?(l=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=l):l=e[4];let o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,d=L();if(n.length===0)return null;let u;e[0]!==n.length||e[1]!==d?(u=n.length===1?d("details.connectionInstancesPanel.instance"):d("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=d,e[2]=u):u=e[2];let m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(pt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Zt,{instance:_,onConfigure:c}),children:t.jsx(Jt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ss=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ns(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const is={calls:{label:"Tool calls"},errors:{label:"Errors"}};function os(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=L(),l=Ee(),o=ns(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Pt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=ts(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx(Mt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:m,barCategoryGap:"4%",children:[t.jsx(zt,{content:t.jsx(Et,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(ls)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(as)})]})]})}function as(s){return t.jsxs("li",{className:"flex items-start gap-2 text-xs",children:[t.jsxs("span",{className:"tabular-nums text-destructive font-medium shrink-0",children:[s.count.toLocaleString(),"×"]}),t.jsx("span",{className:"text-muted-foreground truncate",title:s.message,children:s.message})]},s.message)}function ls(s,e){return t.jsx(Ot,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function rs(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function cs(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function ds(s){const e=U.c(22),{connectionId:n}=s,c=L(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium classic:rounded-md compact:rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(cs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ms,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=L(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=Rt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=L(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(fs),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Lt,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(at,{annotations:b.annotations,_meta:b._meta})]}),b.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:b.description})]})]},b.name)})}),e[7]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function fs(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=L();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=L(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(bs),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let X;return e[20]!==T||e[21]!==F?(X=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=X):X=e[22],X}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ut,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ps,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(js):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Ft,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function gs(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function js(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(gt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function bs(s){return ce(s._meta)}function vs(s){const e=U.c(15),{connection:n,displayTitle:c}=s,a=Ue(),i=c??n.title,l=a?"md":"xl";let o;e[0]!==n.icon||e[1]!==l||e[2]!==i?(o=t.jsx(ae,{icon:n.icon,name:i,size:l,className:"shrink-0"}),e[0]=n.icon,e[1]=l,e[2]=i,e[3]=o):o=e[3];let r;e[4]!==a||e[5]!==i?(r=a?t.jsx(Fe.Title,{children:i}):t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:i})}),e[4]=a,e[5]=i,e[6]=r):r=e[6];let d;e[7]!==n.description?(d=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[7]=n.description,e[8]=d):d=e[8];let u;e[9]!==r||e[10]!==d?(u=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,d]}),e[9]=r,e[10]=d,e[11]=u):u=e[11];let m;return e[12]!==o||e[13]!==u?(m=t.jsxs("div",{className:"flex items-center classic:gap-4 classic:md:gap-6 classic:py-5 classic:md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0 compact:gap-3 compact:py-4",children:[o,u]}),e[12]=o,e[13]=u,e[14]=m):m=e[14],m}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=L(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Le(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Qt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsxs(fe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(ne,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(he,{})]})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(q,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(q,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(q,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(G,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(H,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(V,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(q,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.http")]})}),t.jsx(q,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.sse")]})}),t.jsx(q,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-4 h-4"}),i("details.connectionSidebar.websocket")]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(q,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(q,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(Q,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(Q,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(V,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(Q,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(V,{children:t.jsx(Je,{value:x.value??[],onChange:x.onChange})}),t.jsx(Q,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Be,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Bt,{variant:"success",className:"gap-1.5",children:[t.jsx(qt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Gt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(Nt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 classic:rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity compact:rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Kt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(It,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(Q,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Cs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=et(c.envVars);if(Ss(c)){const l=ys(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=Cs(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function _s(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=tt(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=st(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",c=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=L(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Qe(),m=ke(),{org:p}=te(),x=Tt({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=lt(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=nt(O,Yt),v=Xe({resolver:We(Ze),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=_s(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await xt({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const X=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(X.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(At,{...x}),t.jsx(St,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(yt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(_t,{className:"text-base",children:h?.title??s.title}),t.jsx(wt,{className:"text-xs",children:r("details.connection.settingsDescription")}),w&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:r("details.connection.connectedBy")}),t.jsx(rt,{url:w.user?.image??void 0,fallback:w.user?.name??w.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:w.user?.name||w.user?.email})]})]}),t.jsxs(kt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(V,{children:t.jsx(W,{...f})}),t.jsx(Q,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(V,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(Q,{})]})})]}),t.jsx(Ns,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(it,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(ot,{hideTopbar:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(ds,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(es,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=Ye("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await ut({url:X.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(F)}finally{S(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Is(){const s=U.c(52),e=L();let n;s[0]===Symbol.for("react.memo_cache_sentinel")?(n={from:"/$org/settings/connections/$appSlug"},s[0]=n):n=s[0];const c=se(n);let a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=He(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=ct(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=dt(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map($s):(m?.tools??[]).map(Ds);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=As;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=mt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=Ke(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(Ts),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(ks),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(ws,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function ks(s){return{name:s.name,description:s.description,uri:s.uri}}function Ts(s){return{name:s.name,description:s.description}}function As(s){return(s??[]).map(Ps)}function Ps(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ds(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function $s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Os(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(Is,{})})}),s[0]=e):e=s[0],e}function Si(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Os,{}),s[0]=e):e=s[0],e}export{Si as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ap as H,bQ as A,bR as I,aq as o,bP as j,bO as z,c as L,j as u,B as C}from"./index-
|
|
1
|
+
import{ap as H,bQ as A,bR as I,aq as o,bP as j,bO as z,c as L,j as u,B as C}from"./index-cT94sQUH.js";import{I as R}from"./input-CSdHjp7L.js";import{s as W}from"./Plus-Do5Wkomw.js";import{s as q}from"./Trash01-Dw6PLr8l.js";const K=H({key:o().min(1,"Key is required"),value:o()}),M=H({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(R,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(R,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function Q(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function J(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,Q as a,J as b,M as c,Z as d,Y as i,F as p,D as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as V,c as G,b as ne,j as t,B as L,h as ue,l as he,G as ce,F as Re,I as We,H as Xe,E as Ge,Z as qe,a0 as Ne,d as ke,u as Qe,a as Te,Y as Ye,ae as ye,_ as Je,$ as Ze,ao as et,an as tt,n as pe,q as te,o as nt,a6 as st,t as W,K as ot}from"./index-DhSkTLGL.js";import{a as we,g as it,e as ct}from"./extract-connection-data-B8MpEMZr.js";import{C as lt}from"./collection-display-button-CHeHVSja.js";import{S as rt}from"./search-input-BxTX9M-m.js";import{C as at}from"./collection-tabs-_I4H5-8Z.js";import{C as Ce,u as Ae,g as dt}from"./connection-card-D2nj7hv2.js";import{E as ut}from"./empty-state-CxZ0dZ2w.js";import{u as gt,D as mt}from"./use-delete-connection-j_pMA3IS.js";import{u as pt}from"./use-infinite-scroll-CkOuA_lt.js";import{u as Ie}from"./use-mobile-DzqR2cHs.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-Cq1hg0UR.js";import{am as xe,bl as bt,an as _t,b8 as Dt,k as Se}from"./agent-icon-DNkk7_dP.js";import{g as Nt,a as kt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-CHah4AEz.js";import{D as Tt,a as wt,d as At,b as It,e as Pt,f as Mt,g as $t}from"./drawer-CylcVBKD.js";import{F as q,b as Q,c as Y,d as J,f as Z,a as _e}from"./form-Dh_ChFcx.js";import{I as se}from"./input-B16pDAaF.js";import{S as Ot,b as Ft,a as Ut,d as Vt,c as ae}from"./select-BxXffwm8.js";import{T as Lt}from"./textarea-B3g9AiNh.js";import{b as Ve,u as zt}from"./use-connection-Dd_jV-yJ.js";import{m as Et}from"./use-mcp-client-b7DTGvtL.js";import{b as Bt}from"./use-virtual-mcp-D7FnpzkN.js";import{g as Kt}from"./types-BC21t2qu.js";import{s as Le}from"./Plus-Co8GDnQt.js";import{a as Ht}from"./UserSquare-DguX5tfN.js";import{s as ze}from"./XClose-DEtOBh9K.js";import{i as fe,a as De,E as Rt,c as Wt,p as Xt,b as Gt,d as qt}from"./connection-form-helpers-Dr6wsDFY.js";import{a as Qt}from"./authenticate-and-persist-oauth-6OnIpH1X.js";import{I as Yt}from"./integration-icon-CWhWFKSI.js";import{C as Ee}from"./checkbox-B-yppOY9.js";import{i as Jt}from"./DotsVertical-DggqHyjg.js";import{s as Be}from"./Eye-4BNGMJWQ.js";import{s as Ke}from"./Trash01-Bh9q8r0u.js";import"./connection-DecG214K.js";import"./ArrowUp-X767TF31.js";import"./Check-DIS6xK2s.js";import"./tooltip-CdMRXeRO.js";import"./index-DxnsQB3q.js";import"./view-mode-toggle-CjHK4u9O.js";import"./badge-CBUlIbWu.js";import"./SearchMd-SvEyKWwE.js";import"./useInfiniteQuery-DtiIzck6.js";import"./infiniteQueryObserver-SQin_Yvd.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-BdjDX5mC.js";import"./Tool01-CSJpNNvq.js";import"./ArrowLeft-Ca7fFz_9.js";import"./ArrowRight-DfmVU-dl.js";import"./XCircle-l7a_k5g_.js";import"./ZoomOut-DLYNtop8.js";import"./Globe04-DZrkUoha.js";import"./CheckCircle-rF1SRlKX.js";import"./ChevronUp-8z69W8eb.js";import"./Copy01-Cm_m4tgz.js";import"./CreditCard01-Bi5ugsTs.js";import"./Download01-Dyb6in04.js";import"./Share07-7GntLJL7.js";import"./Image01-gmtSq_nr.js";import"./Key01-tM2flTMh.js";import"./LayoutLeft-Dig9JdlG.js";import"./Link01-DufQBiKF.js";import"./LinkExternal01-lG9r7Gkl.js";import"./Monitor01-eFZQRlH8.js";import"./Sun-CMsy_g5c.js";import"./Package-CVhtCyRO.js";import"./Palette-C73414wl.js";import"./SearchLg-Br_brFUE.js";import"./Stars01-Liu978-k.js";import"./Upload01-COnIPKVQ.js";import"./User01-Dh6W_JxD.js";import"./Users01-dzGvo-nO.js";import"./X-Cwz8fCAP.js";import"./Zap-COngYniA.js";import"./label-DoUZvMsM.js";import"./auth-rtbjEyyO.js";import"./mcp-oauth-DCiCc1Ys.js";function Zt(C){const e=`deco-filters-${C}`,[n,d]=V.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{d(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(c){console.error("Failed to save filters:",c)}}]}function en(C){const e=G.c(7),[n,d]=V.useState(C),[s,o]=V.useState(C?"desc":null);let c;e[0]!==s||e[1]!==n?(c=a=>{n!==a?(d(a),o("asc")):s==="asc"?o("desc"):s==="desc"&&(d(void 0),o(null))},e[0]=s,e[1]=n,e[2]=c):c=e[2];const r=c;let m;return e[3]!==r||e[4]!==s||e[5]!==n?(m={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=m):m=e[6],m}function tn(C,e){const n=G.c(12),d=e===void 0?"cards":e,s=Ie(),o=V.useRef(s),c=C?`deco-view-mode-${C}`:"deco-view-mode";let r;n[0]!==d||n[1]!==c?(r=()=>{const h=globalThis.localStorage?.getItem(c);return h==="cards"||h==="table"?h:d},n[0]=d,n[1]=c,n[2]=r):r=n[2];const[m,a]=V.useState(r);let S;n[3]!==c?(S=h=>{a(h),globalThis.localStorage?.setItem(c,h)},n[3]=c,n[4]=S):S=n[4];const u=S;let l,p;n[5]!==s||n[6]!==m?(l=()=>{!o.current&&s&&m==="table"&&a("cards"),o.current=s},p=[s,m],n[5]=s,n[6]=m,n[7]=l,n[8]=p):(l=n[7],p=n[8]),V.useEffect(l,p);let f;return n[9]!==u||n[10]!==m?(f=[m,u],n[9]=u,n[10]=m,n[11]=f):f=n[11],f}function nn(C){const e=G.c(20),{namespace:n,resource:d,defaultSortKey:s,defaultViewMode:o}=C,c=s===void 0?"title":s,r=o===void 0?"table":o,[m,a]=V.useState(""),S=V.useDeferredValue(m),u=`${n}-${d}`,[l,p]=Zt(u),f=`studio-${d}-filter-visible-${n}`;let h;e[0]!==f?(h=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=h):h=e[1];const[x,D]=V.useState(h);let y;e[2]!==f?(y=F=>{D(F),globalThis.localStorage?.setItem(f,String(F))},e[2]=f,e[3]=y):y=e[3];const v=y;let i;e[4]!==x||e[5]!==v?(i=()=>{v(!x)},e[4]=x,e[5]=v,e[6]=i):i=e[6];const b=i,[k,A]=tn(`studio-${d}-${n}`,r),{sortKey:T,sortDirection:M,handleSort:P}=en(c),$=T;let I;return e[7]!==x||e[8]!==l||e[9]!==P||e[10]!==m||e[11]!==S||e[12]!==v||e[13]!==p||e[14]!==A||e[15]!==M||e[16]!==$||e[17]!==b||e[18]!==k?(I={search:m,searchTerm:S,setSearch:a,filters:l,setFilters:p,filterBarVisible:x,setFilterBarVisible:v,toggleFilterBar:b,viewMode:k,setViewMode:A,sortKey:$,sortDirection:M,handleSort:P},e[7]=x,e[8]=l,e[9]=P,e[10]=m,e[11]=S,e[12]=v,e[13]=p,e[14]=A,e[15]=M,e[16]=$,e[17]=b,e[18]=k,e[19]=I):I=e[19],I}function sn(C){const e=G.c(35),{open:n,onOpenChange:d,count:s,onConfirm:o}=C,c=ne(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let m;e[0]!==s||e[1]!==c||e[2]!==r?(m=c(r,{count:s}),e[0]=s,e[1]=c,e[2]=r,e[3]=m):m=e[3];let a;e[4]!==m?(a=t.jsx(ft,{children:m}),e[4]=m,e[5]=a):a=e[5];const S=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==S?(u=c(S),e[6]=c,e[7]=S,e[8]=u):u=e[8];let l;e[9]!==u?(l=t.jsx(ht,{children:u}),e[9]=u,e[10]=l):l=e[10];let p;e[11]!==a||e[12]!==l?(p=t.jsxs(xt,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx(jt,{children:f}),e[16]=f,e[17]=h):h=e[17];const x=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let D;e[18]!==s||e[19]!==c||e[20]!==x?(D=c(x,{count:s}),e[18]=s,e[19]=c,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==o||e[23]!==D?(y=t.jsx(St,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),e[22]=o,e[23]=D,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==h?(v=t.jsxs(yt,{children:[h,y]}),e[25]=y,e[26]=h,e[27]=v):v=e[27];let i;e[28]!==v||e[29]!==p?(i=t.jsxs(Ct,{children:[p,v]}),e[28]=v,e[29]=p,e[30]=i):i=e[30];let b;return e[31]!==d||e[32]!==n||e[33]!==i?(b=t.jsx(vt,{open:n,onOpenChange:d,children:i}),e[31]=d,e[32]=n,e[33]=i,e[34]=b):b=e[34],b}function on(C){const e=G.c(39),{item:n,canManage:d,allConnections:s,connectedAppNames:o,connectingItemId:c,onNavigateConnected:r,onConnect:m}=C,a=ne();let S,u;e[0]!==o||e[1]!==n?(S=we(n)??"",u=o.has(S),e[0]=o,e[1]=n,e[2]=S,e[3]=u):(S=e[2],u=e[3]);const l=u;let p;e[4]!==n._meta?(p=Nt(n._meta),e[4]=n._meta,e[5]=p):p=e[5];const f=p,h=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",x=n.server?.description||n.description||null;let D;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(D=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=D):D=e[8];const y=D;let v;if(e[9]!==s||e[10]!==S){let O;e[12]!==S?(O=H=>H.connection_type!=="VIRTUAL"&&H.app_name===S,e[12]=S,e[13]=O):O=e[13],v=s.filter(O),e[9]=s,e[10]=S,e[11]=v}else v=e[11];const i=v,b=l||d;let k,A;e[14]!==i||e[15]!==l||e[16]!==n||e[17]!==m||e[18]!==r?(k=()=>{if(l){const O=i[0];O&&r(O);return}A()},A=()=>m(n),e[14]=i,e[15]=l,e[16]=n,e[17]=m,e[18]=r,e[19]=k,e[20]=A):(k=e[19],A=e[20]);let T;e[21]!==x||e[22]!==y||e[23]!==h?(T={title:h,description:x,icon:y},e[21]=x,e[22]=y,e[23]=h,e[24]=T):T=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xe,{}),e[25]=M):M=e[25];const P=b?k:void 0;let $;e[26]!==d||e[27]!==c||e[28]!==A||e[29]!==l||e[30]!==n.id||e[31]!==a?($=l?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):d&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 classic:rounded-lg text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),A()},children:c===n.id?t.jsx(ue,{className:"size-3.5"}):a("orgs.catalogItemCard.connect")}),e[26]=d,e[27]=c,e[28]=A,e[29]=l,e[30]=n.id,e[31]=a,e[32]=$):$=e[32];let I;e[33]!==$?(I=t.jsx("div",{className:"flex items-center gap-2",children:$}),e[33]=$,e[34]=I):I=e[34];let F;return e[35]!==T||e[36]!==P||e[37]!==I?(F=t.jsx(Ce,{connection:T,fallbackIcon:M,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=T,e[36]=P,e[37]=I,e[38]=F):F=e[38],F}function cn(C){return C?.length?{appToolName:C.find(n=>!!Kt(n._meta))?.name??null}:null}function He(C){const e=G.c(8),{selectionMode:n,children:d}=C,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let o;e[0]!==s?(o=he("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Re,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:rn,children:t.jsx(Jt,{size:20})})}),e[2]=c):c=e[2];let r;e[3]!==d?(r=t.jsxs(We,{children:[c,t.jsx(Xe,{align:"end",onClick:ln,children:d})]}),e[3]=d,e[4]=r):r=e[4];let m;return e[5]!==o||e[6]!==r?(m=t.jsx("div",{className:o,children:r}),e[5]=o,e[6]=r,e[7]=m):m=e[7],m}function ln(C){return C.stopPropagation()}function rn(C){return C.stopPropagation()}function an(C){const e=G.c(57),{group:n,onOpen:d,selectionMode:s,selectedIds:o,onToggleSelect:c}=C,r=ne();let m;if(e[0]!==n.connections||e[1]!==o){let g;e[3]!==o?(g=w=>o.has(w.id),e[3]=o,e[4]=g):g=e[4],m=n.connections.every(g),e[0]=n.connections,e[1]=o,e[2]=m}else m=e[2];const a=m;let S;if(e[5]!==n.connections||e[6]!==o){let g;e[8]!==o?(g=w=>o.has(w.id),e[8]=o,e[9]=g):g=e[9],S=n.connections.some(g),e[5]=n.connections,e[6]=o,e[7]=S}else S=e[7];const u=S;let l;e[10]!==a||e[11]!==n.connections||e[12]!==c||e[13]!==o?(l=()=>{for(const g of n.connections)a?o.has(g.id)&&c(g.id):o.has(g.id)||c(g.id)},e[10]=a,e[11]=n.connections,e[12]=c,e[13]=o,e[14]=l):l=e[14];const p=l,f=n.title,h=n.icon;let x;e[15]!==n.connections.length||e[16]!==r?(x=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=x):x=e[17];let D;e[18]!==n.icon||e[19]!==n.title||e[20]!==x?(D={title:f,icon:h,description:x},e[18]=n.icon,e[19]=n.title,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==d||e[23]!==s||e[24]!==p?(y=()=>s?p():d(),e[22]=d,e[23]=s,e[24]=p,e[25]=y):y=e[25];const v=s&&a&&"ring-2 ring-primary",i=s&&u&&!a&&"ring-1 ring-primary/50";let b;e[26]!==i||e[27]!==v?(b=he(v,i),e[26]=i,e[27]=v,e[28]=b):b=e[28];const k=s?a?!0:u&&"mixed":void 0;let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(xe,{}),e[29]=A):A=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==p?(T=s?t.jsx(Ee,{checked:a?!0:u?"indeterminate":!1,onCheckedChange:p}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=p,e[36]=T):T=e[36];let M;e[37]!==d?(M=g=>{g.stopPropagation(),d()},e[37]=d,e[38]=M):M=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let $;e[40]!==r?($=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=$):$=e[41];let I;e[42]!==M||e[43]!==$?(I=t.jsxs(ce,{onClick:M,children:[P,$]}),e[42]=M,e[43]=$,e[44]=I):I=e[44];let F;e[45]!==s||e[46]!==I?(F=t.jsx(He,{selectionMode:s,children:I}),e[45]=s,e[46]=I,e[47]=F):F=e[47];let O;e[48]!==T||e[49]!==F?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[T,F]}),e[48]=T,e[49]=F,e[50]=O):O=e[50];let H;return e[51]!==b||e[52]!==k||e[53]!==O||e[54]!==D||e[55]!==y?(H=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:D,onClick:y,className:b,selected:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=b,e[52]=k,e[53]=O,e[54]=D,e[55]=y,e[56]=H):H=e[56],H}function dn(C){const e=G.c(36),{connection:n,isSelected:d,selectionMode:s,canManage:o,canManageAgents:c,onToggleSelect:r,onOpen:m,onToggleStatus:a,onDelete:S}=C,u=ne();let l;e[0]!==d||e[1]!==r||e[2]!==s||e[3]!==u?(l=s?t.jsx(Ee,{checked:d,onCheckedChange:r,onClick:un}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=d,e[1]=r,e[2]=s,e[3]=u,e[4]=l):l=e[4];let p;e[5]!==m?(p=k=>{k.stopPropagation(),m()},e[5]=m,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{size:16}),e[7]=f):f=e[7];let h;e[8]!==u?(h=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=h):h=e[9];let x;e[10]!==p||e[11]!==h?(x=t.jsxs(ce,{onClick:p,children:[f,h]}),e[10]=p,e[11]=h,e[12]=x):x=e[12];let D;e[13]!==o||e[14]!==c||e[15]!==r||e[16]!==u?(D=(o||c)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(bt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=o,e[14]=c,e[15]=r,e[16]=u,e[17]=D):D=e[17];let y;e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==u?(y=o&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("inactive")},children:[t.jsx(_t,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("active")},children:[t.jsx(Dt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=o,e[19]=n,e[20]=a,e[21]=u,e[22]=y):y=e[22];let v;e[23]!==o||e[24]!==S||e[25]!==u?(v=o&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),S()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=o,e[24]=S,e[25]=u,e[26]=v):v=e[26];let i;e[27]!==s||e[28]!==x||e[29]!==D||e[30]!==y||e[31]!==v?(i=t.jsxs(He,{selectionMode:s,children:[x,D,y,v]}),e[27]=s,e[28]=x,e[29]=D,e[30]=y,e[31]=v,e[32]=i):i=e[32];let b;return e[33]!==l||e[34]!==i?(b=t.jsxs("div",{className:"flex items-center gap-1",children:[l,i]}),e[33]=l,e[34]=i,e[35]=b):b=e[35],b}function un(C){return C.stopPropagation()}function gn(C){const e=G.c(29),{count:n,total:d,canManage:s,canManageAgents:o,onSelectAll:c,onDeselectAll:r,onDelete:m,onAddToAgent:a,onToggleStatus:S,onCancel:u}=C,l=ne();if(n===0)return null;let p;e[0]!==n||e[1]!==l?(p=l("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=l,e[2]=p):p=e[2];let f;e[3]!==p?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:p}),e[3]=p,e[4]=f):f=e[4];let h;e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==l||e[9]!==d?(h=n<d?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:l("orgs.connectionSelectionUi.selectAll",{total:d})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:l("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=c,e[8]=l,e[9]=d,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==a||e[13]!==l?(x=o&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Le,{size:13}),l("orgs.connectionSelectionUi.addToAgent")]}),e[11]=o,e[12]=a,e[13]=l,e[14]=x):x=e[14];let D;e[15]!==s||e[16]!==m||e[17]!==S||e[18]!==l?(D=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("active"),children:l("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("inactive"),children:l("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[t.jsx(Ke,{size:13}),l("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=m,e[17]=S,e[18]=l,e[19]=D):D=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ze,{size:13}),e[20]=y):y=e[20];let v;e[21]!==u?(v=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=v):v=e[22];let i;return e[23]!==f||e[24]!==h||e[25]!==x||e[26]!==D||e[27]!==v?(i=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,h,x,D,v]})}),e[23]=f,e[24]=h,e[25]=x,e[26]=D,e[27]=v,e[28]=i):i=e[28],i}function mn(C){const e=G.c(45),{open:n,onOpenChange:d,agents:s,onConfirm:o}=C,c=ne(),[r,m]=V.useState(null);let a;e[0]!==c?(a=c("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=c,e[1]=a):a=e[1];let S;e[2]!==a?(S=t.jsx(Pe,{children:a}),e[2]=a,e[3]=S):S=e[3];let u;e[4]!==c?(u=c("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==u?(l=t.jsx(Me,{children:u}),e[6]=u,e[7]=l):l=e[7];let p;e[8]!==S||e[9]!==l?(p=t.jsxs($e,{children:[S,l]}),e[8]=S,e[9]=l,e[10]=p):p=e[10];let f;e[11]!==s||e[12]!==r||e[13]!==c?(f=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):s.map(P=>t.jsxs("button",{type:"button",onClick:()=>m(P.id),className:he("flex items-center gap-3 w-full classic:rounded-md compact:rounded-lg px-3 py-2 text-left transition-colors",r===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Yt,{icon:P.icon,name:P.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:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=s,e[12]=r,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==f?(h=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:f}),e[15]=f,e[16]=h):h=e[16];let x;e[17]!==d?(x=()=>d(!1),e[17]=d,e[18]=x):x=e[18];let D;e[19]!==c?(D=c("orgs.connectionSelectionUi.cancel"),e[19]=c,e[20]=D):D=e[20];let y;e[21]!==x||e[22]!==D?(y=t.jsx(L,{variant:"outline",onClick:x,children:D}),e[21]=x,e[22]=D,e[23]=y):y=e[23];const v=!r;let i;e[24]!==o||e[25]!==d||e[26]!==r?(i=()=>{r&&(o(r),d(!1),m(null))},e[24]=o,e[25]=d,e[26]=r,e[27]=i):i=e[27];let b;e[28]!==c?(b=c("orgs.connectionSelectionUi.add"),e[28]=c,e[29]=b):b=e[29];let k;e[30]!==v||e[31]!==i||e[32]!==b?(k=t.jsx(L,{disabled:v,onClick:i,children:b}),e[30]=v,e[31]=i,e[32]=b,e[33]=k):k=e[33];let A;e[34]!==y||e[35]!==k?(A=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=A):A=e[36];let T;e[37]!==A||e[38]!==p||e[39]!==h?(T=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[p,h,A]}),e[37]=A,e[38]=p,e[39]=h,e[40]=T):T=e[40];let M;return e[41]!==d||e[42]!==n||e[43]!==T?(M=t.jsx(Ue,{open:n,onOpenChange:d,children:T}),e[41]=d,e[42]=n,e[43]=T,e[44]=M):M=e[44],M}function pn({listState:C,activeTab:e,typeFilter:n,statusFilter:d}){const s=ne(),{org:o}=Ne(),c=nt(),r=ke(),{data:m}=Te.useSession(),a=Ve(),S=zt(C),u=gt(),{granted:l}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[f,h]=V.useState(new Set),x=f.size>0,[D,y]=V.useState(!1),[v,i]=V.useState(!1),[b,k]=V.useState(null),A=Bt(),T=S.filter(_=>!(n!=="ALL"&&_.connection_type!==n||d!=="ALL"&&_.status!==d)),M=dt(T),P=_=>{h(j=>{const E=new Set(j);return E.has(_)?E.delete(_):E.add(_),E})},$=()=>{h(new Set)},I=Ae(C.searchTerm),F=I.items,O=pt(I.loadMore,I.hasMore,I.isLoadingMore),H=new Set(S.filter(_=>_.app_name).map(_=>_.app_name)),g=C.search.length>0,w=e==="all"||g?F.filter(_=>{if(g){const j=we(_);if(j&&H.has(j))return!1}return!0}):[],R=e==="connected"||g?M:[],ee=async _=>{if(!(!o||!m?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const j=ct(_,o.id,m.user.id,{remoteIndex:0}),E=j.connection_type==="STDIO",K=!!j.connection_url,B=E&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!K&&!B){W.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await a.create.mutateAsync(j),{id:ie}=oe,le=await Qt({connectionId:ie,orgId:o.id,orgSlug:o.slug,persistFallback:re=>a.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${o.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),N(),W.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const re=await c.fetchQuery(Et({connectionId:ie,orgId:o.id,orgSlug:o.slug}));me=cn((await re.listTools()).tools)}catch{}const ve=de(oe),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ve}}:null;W.success(s("orgs.connections.connectedSuccessfully"),be?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(be)}}:void 0)}catch(j){W.error(s("orgs.connections.failedToConnect",{error:j instanceof Error?j.message:String(j)}))}finally{k(null)}}},X=st(),N=()=>{c.invalidateQueries({predicate:_=>{const j=_.queryKey;return j[1]===o.id&&j[3]==="collection"&&j[4]==="CONNECTIONS"}})},z=async()=>{y(!1);const _=[...f];te("connections_bulk_delete",{count:_.length});const E=(await Promise.allSettled(_.map(K=>X.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),W.success(s("orgs.connections.deletedConnections",{count:E})),$()},U=async(_,j)=>{try{await a.update.mutateAsync({id:_,data:{status:j}}),N(),W.success(s(j==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{W.error(s("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const j=[...f];te("connections_bulk_status_toggled",{count:j.length,to_status:_});const K=(await Promise.allSettled(j.map(B=>a.update.mutateAsync({id:B,data:{status:_}})))).filter(B=>B.status==="fulfilled").length;N(),W.success(_==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),$()},je=async _=>{const j=A.find(B=>B.id===_);if(!j)return;te("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const E=new Set(j.connections.map(B=>B.connection_id)),K=[...f].filter(B=>!E.has(B)).map(B=>({connection_id:B,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){W.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await X.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...j.connections,...K]}}),c.invalidateQueries({predicate:B=>{const oe=B.queryKey;return oe[1]===o.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),W.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:j.title})),$()}catch{W.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...u}),t.jsx(sn,{open:D,onOpenChange:y,count:f.size,onConfirm:z}),t.jsx(mn,{open:v,onOpenChange:i,agents:A,onConfirm:je}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(g?w.length===0&&T.length===0:e==="all"?w.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:C.search?s("orgs.connections.noConnectionsMatchSearch",{search:C.search}):s(l?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(_=>{if(_.type==="group")return t.jsx(an,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:_.key}})},selectionMode:x,selectedIds:f,onToggleSelect:P},_.key);const j=_.connection,E=f.has(j.id);return t.jsx(Ce,{connection:j,fallbackIcon:t.jsx(xe,{}),onClick:()=>x?P(j.id):r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:x?E:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(dn,{connection:j,isSelected:E,selectionMode:x,canManage:l,canManageAgents:p,onToggleSelect:()=>P(j.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onToggleStatus:K=>U(j.id,K),onDelete:()=>u.requestDelete(j)})},j.id)}),w.map(_=>t.jsx(on,{item:_,canManage:l,allConnections:S,connectedAppNames:H,connectingItemId:b,onNavigateConnected:j=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onConnect:ee},_.id)),(e==="all"||g)&&t.jsx("div",{ref:O,className:"col-span-full h-4"}),(e==="all"||g)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),x&&t.jsx(gn,{count:f.size,total:T.length,canManage:l,canManageAgents:p,onSelectAll:()=>{h(new Set(T.map(_=>_.id)))},onDeselectAll:()=>h(new Set),onDelete:()=>y(!0),onAddToAgent:()=>i(!0),onToggleStatus:ge,onCancel:$})]})}function fn(){const C=qe(),e=ne(),{org:n}=Ne(),d=ke(),s=Qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:c}=Ye(),r=Ie(),{granted:m}=ye("connections:manage"),a=nn({namespace:n.slug,resource:"connections"}),S=Ve(),[u,l]=Je(Ze.connectionsTab(n.slug),g=>s.tab==="all"||s.tab==="connected"?s.tab:g??"all"),[p,f]=V.useState("ALL"),[h,x]=V.useState("ALL"),y=Ae(a.searchTerm).items,v=a.search!==a.searchTerm,i=et({resolver:tt(Wt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),b=i.watch("ui_type"),k=i.watch("connection_url"),A=i.watch("npx_package"),T=fe({uiType:b,connectionUrl:k??"",npxPackage:A??""})??De({uiType:b,connectionUrl:k??"",registryItems:y}),M=m&&s.action==="create",P=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),d({to:"/$org/settings/connections",params:{org:n.slug},search:{action:"create"}})},$=()=>{d({to:"/$org/settings/connections",params:{org:n.slug},search:{}})},I=async g=>{let w,R=null,ee=null,X=null;g.ui_type==="NPX"?(w="STDIO",R="",X=Gt(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(w="STDIO",R="",X=qt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(w=g.ui_type,R=g.connection_url||"",ee=g.connection_token||null);const N=it("conn");te("connection_custom_created",{connection_type:w,ui_type:g.ui_type}),await S.create.mutateAsync({id:N,title:g.title,description:g.description||null,connection_type:w,connection_url:R,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:n.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),i.reset(),d({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:de({app_name:null,connection_url:R,title:g.title,id:N})}})},F=g=>{g||(M&&$(),i.reset())},O=g=>{const w=g.trim();if(!w)return;const R=!!i.formState.dirtyFields.title,ee=!!i.formState.dirtyFields.description,X=!!i.formState.dirtyFields.env_vars,N=U=>{if(U&&(!R&&!i.getValues("title").trim()&&U.title&&i.setValue("title",U.title,{shouldDirty:!1}),!ee&&!(i.getValues("description")??"").trim()&&U.description&&i.setValue("description",U.description,{shouldDirty:!1}),!X&&U.envVarKeys?.length)){const ge=i.getValues("env_vars")??[],je=new Set(ge.map(j=>j.key)),_=U.envVarKeys.filter(j=>!je.has(j));_.length>0&&i.setValue("env_vars",[...ge,..._.map(j=>({key:j,value:""}))],{shouldDirty:!0})}},z=Xt(w);if(z&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",z.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:z.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const U=b==="HTTP"||b==="SSE"||b==="Websocket"?b:"HTTP";i.setValue("ui_type",U,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),N(fe({uiType:U,connectionUrl:w})??De({uiType:U,connectionUrl:w,registryItems:y}));return}b==="NPX"&&N(fe({uiType:"NPX",npxPackage:w}))},H=m?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:C?"sm":"default",variant:C?"default":"outline",onClick:P,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:e("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const g=e("orgs.connections.createConnection"),w=e("orgs.connections.createConnectionDescription"),R=i.formState.isSubmitting?e("orgs.connections.saving"):e("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:i.control,name:"ui_type",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ft,{children:t.jsx(Ut,{})})}),t.jsxs(Vt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),e("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),e("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),b==="NPX"&&t.jsx(q,{control:i.control,name:"npx_package",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("npx_package",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),b==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:i.control,name:"stdio_command",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.command")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"stdio_args",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(b==="NPX"||b==="STDIO")&&t.jsx(q,{control:i.control,name:"env_vars",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Rt,{value:N.value??[],onChange:N.onChange})}),t.jsx(Z,{})]})}),b!=="NPX"&&b!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:i.control,name:"connection_url",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.url")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("connection_url",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"connection_token",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:T?.token?.label??e("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??e("orgs.connections.tokenPlaceholder"),...N,value:N.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:e("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"title",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.name")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.namePlaceholder"),...N})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"description",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Lt,{placeholder:e("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),X=M;return r?t.jsx(Tt,{open:X,onOpenChange:F,children:t.jsxs(wt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(It,{children:g}),t.jsx(Pt,{className:"mt-1",children:w})]}),t.jsx(Mt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":e("orgs.connections.close"),children:t.jsx(ze,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:R})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:F,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:g}),t.jsx(Me,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(Oe,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>F(!1),children:e("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:R})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:C&&H,children:e("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:a.search,onChange:a.setSearch,placeholder:e("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(a.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:e("orgs.connections.sortName")},{id:"description",label:e("orgs.connections.sortDescription")},{id:"connection_type",label:e("orgs.connections.sortType")},{id:"updated_by",label:e("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:e("orgs.connections.sortUpdated")}],filters:[{label:e("orgs.connections.filterType"),value:p,onChange:g=>f(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:e("orgs.connections.filterStatus"),value:h,onChange:g=>x(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"active",label:e("orgs.connections.filterActive")},{id:"inactive",label:e("orgs.connections.filterInactive")},{id:"error",label:e("orgs.connections.filterError")}]}]})]}),!C&&H]}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:e("orgs.connections.tabAll")},{id:"connected",label:e("orgs.connections.tabConnected")}],activeTab:u,onTabChange:g=>{const w=g;w!==u&&te("connections_page_tab_changed",{to_tab:w}),l(w)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:v?.5:1,transition:v?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:v?"none":"auto"},children:t.jsx(pn,{listState:a,activeTab:u,typeFilter:p,statusFilter:h})})})]})})})]})})}function Ls(){const C=G.c(1);let e;return C[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(fn,{})})}),C[0]=e):e=C[0],e}export{Ls as default};
|
|
1
|
+
import{r as V,c as G,b as ne,j as t,B as L,h as ue,l as he,G as ce,F as Re,I as We,H as Xe,E as Ge,Z as qe,a0 as Ne,d as ke,u as Qe,a as Te,Y as Ye,ae as ye,_ as Je,$ as Ze,ao as et,an as tt,n as pe,q as te,o as nt,a6 as st,t as W,K as ot}from"./index-cT94sQUH.js";import{a as we,g as it,e as ct}from"./extract-connection-data-ak1yxd15.js";import{C as lt}from"./collection-display-button-CJrP29Qc.js";import{S as rt}from"./search-input-B12ZEo-u.js";import{C as at}from"./collection-tabs-CrAcGqu0.js";import{C as Ce,u as Ae,g as dt}from"./connection-card-CEFIrJY3.js";import{E as ut}from"./empty-state-YhHJ1PAR.js";import{u as gt,D as mt}from"./use-delete-connection-PzbXJAFK.js";import{u as pt}from"./use-infinite-scroll-DASshMJA.js";import{u as Ie}from"./use-mobile-Dv7BcXr5.js";import{g as de}from"./connection-slug-CITJ0kGN.js";import{A as ft,a as ht,b as xt,c as jt,g as St,d as yt,e as Ct,f as vt}from"./alert-dialog-m7PHs13d.js";import{am as xe,bl as bt,an as _t,b8 as Dt,k as Se}from"./agent-icon-CVsOY5Om.js";import{g as Nt,a as kt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-DiUlVwD1.js";import{D as Tt,a as wt,d as At,b as It,e as Pt,f as Mt,g as $t}from"./drawer-BT08Xqaa.js";import{F as q,b as Q,c as Y,d as J,f as Z,a as _e}from"./form-DDtq3Oeg.js";import{I as se}from"./input-CSdHjp7L.js";import{S as Ot,b as Ft,a as Ut,d as Vt,c as ae}from"./select-B3V6AARR.js";import{T as Lt}from"./textarea-lt2TXyPT.js";import{b as Ve,u as zt}from"./use-connection-BUnGMpfY.js";import{m as Et}from"./use-mcp-client-GBv4syMd.js";import{b as Bt}from"./use-virtual-mcp-CyUsVYwB.js";import{g as Kt}from"./types-C2ulVtYx.js";import{s as Le}from"./Plus-Do5Wkomw.js";import{a as Ht}from"./UserSquare-CHvWRyuq.js";import{s as ze}from"./XClose-1APsw2yP.js";import{i as fe,a as De,E as Rt,c as Wt,p as Xt,b as Gt,d as qt}from"./connection-form-helpers-DFcBYAWG.js";import{a as Qt}from"./authenticate-and-persist-oauth-8HHvB0nM.js";import{I as Yt}from"./integration-icon-CBv4y2ld.js";import{C as Ee}from"./checkbox-DXebLGmO.js";import{i as Jt}from"./DotsVertical-BQfY36BV.js";import{s as Be}from"./Eye-CpLoEsen.js";import{s as Ke}from"./Trash01-Dw6PLr8l.js";import"./connection-BtvJKuLN.js";import"./ArrowUp-BB5V3348.js";import"./Check-CGKF06bT.js";import"./tooltip-BGTnGCWW.js";import"./index-CgGEL4tk.js";import"./view-mode-toggle-CSfYGuhk.js";import"./badge-DS7xysUQ.js";import"./SearchMd-B9ModJFt.js";import"./useInfiniteQuery-DS8vuz-1.js";import"./infiniteQueryObserver-Dj3x0ul-.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-B3LJiQhZ.js";import"./Tool01-DK_vv6qf.js";import"./ArrowLeft-DmWma6hW.js";import"./ArrowRight-540iMVH3.js";import"./XCircle-xC8IFHez.js";import"./ZoomOut-DD-ULjJm.js";import"./Globe04-DnURSsdQ.js";import"./CheckCircle-tvGC17Dy.js";import"./ChevronUp-Du4AWZmG.js";import"./Copy01-CYbqJpFZ.js";import"./CreditCard01-CK4yyvJY.js";import"./Download01-C8jubU2p.js";import"./Share07-DpckpNEB.js";import"./Image01-DPZCMheY.js";import"./Key01-CSyDklFV.js";import"./LayoutLeft-DgiG6wiH.js";import"./Link01-CYG0Mr8Q.js";import"./LinkExternal01-Div0d_z3.js";import"./Monitor01-BrSZ6zzu.js";import"./Sun-CzonSHrU.js";import"./Package-C5JGfmw5.js";import"./Palette-Bm4HMPv2.js";import"./SearchLg-gOfrWgIs.js";import"./Stars01-B6IfixlN.js";import"./Upload01-BsQDz7U2.js";import"./User01-Bla6DkK3.js";import"./Users01-fXdkObFe.js";import"./X-CLqvixem.js";import"./Zap-SzxRRv0w.js";import"./label-C6sMx1BY.js";import"./auth-k9t16OOb.js";import"./mcp-oauth-CtDqQIpT.js";function Zt(C){const e=`deco-filters-${C}`,[n,d]=V.useState(()=>{try{const o=globalThis.localStorage?.getItem(e);if(o)return JSON.parse(o)}catch(o){console.error("Failed to parse stored filters:",o)}return[]});return[n,o=>{d(o);try{globalThis.localStorage?.setItem(e,JSON.stringify(o))}catch(c){console.error("Failed to save filters:",c)}}]}function en(C){const e=G.c(7),[n,d]=V.useState(C),[s,o]=V.useState(C?"desc":null);let c;e[0]!==s||e[1]!==n?(c=a=>{n!==a?(d(a),o("asc")):s==="asc"?o("desc"):s==="desc"&&(d(void 0),o(null))},e[0]=s,e[1]=n,e[2]=c):c=e[2];const r=c;let m;return e[3]!==r||e[4]!==s||e[5]!==n?(m={sortKey:n,sortDirection:s,handleSort:r},e[3]=r,e[4]=s,e[5]=n,e[6]=m):m=e[6],m}function tn(C,e){const n=G.c(12),d=e===void 0?"cards":e,s=Ie(),o=V.useRef(s),c=C?`deco-view-mode-${C}`:"deco-view-mode";let r;n[0]!==d||n[1]!==c?(r=()=>{const h=globalThis.localStorage?.getItem(c);return h==="cards"||h==="table"?h:d},n[0]=d,n[1]=c,n[2]=r):r=n[2];const[m,a]=V.useState(r);let S;n[3]!==c?(S=h=>{a(h),globalThis.localStorage?.setItem(c,h)},n[3]=c,n[4]=S):S=n[4];const u=S;let l,p;n[5]!==s||n[6]!==m?(l=()=>{!o.current&&s&&m==="table"&&a("cards"),o.current=s},p=[s,m],n[5]=s,n[6]=m,n[7]=l,n[8]=p):(l=n[7],p=n[8]),V.useEffect(l,p);let f;return n[9]!==u||n[10]!==m?(f=[m,u],n[9]=u,n[10]=m,n[11]=f):f=n[11],f}function nn(C){const e=G.c(20),{namespace:n,resource:d,defaultSortKey:s,defaultViewMode:o}=C,c=s===void 0?"title":s,r=o===void 0?"table":o,[m,a]=V.useState(""),S=V.useDeferredValue(m),u=`${n}-${d}`,[l,p]=Zt(u),f=`studio-${d}-filter-visible-${n}`;let h;e[0]!==f?(h=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=h):h=e[1];const[x,D]=V.useState(h);let y;e[2]!==f?(y=F=>{D(F),globalThis.localStorage?.setItem(f,String(F))},e[2]=f,e[3]=y):y=e[3];const v=y;let i;e[4]!==x||e[5]!==v?(i=()=>{v(!x)},e[4]=x,e[5]=v,e[6]=i):i=e[6];const b=i,[k,A]=tn(`studio-${d}-${n}`,r),{sortKey:T,sortDirection:M,handleSort:P}=en(c),$=T;let I;return e[7]!==x||e[8]!==l||e[9]!==P||e[10]!==m||e[11]!==S||e[12]!==v||e[13]!==p||e[14]!==A||e[15]!==M||e[16]!==$||e[17]!==b||e[18]!==k?(I={search:m,searchTerm:S,setSearch:a,filters:l,setFilters:p,filterBarVisible:x,setFilterBarVisible:v,toggleFilterBar:b,viewMode:k,setViewMode:A,sortKey:$,sortDirection:M,handleSort:P},e[7]=x,e[8]=l,e[9]=P,e[10]=m,e[11]=S,e[12]=v,e[13]=p,e[14]=A,e[15]=M,e[16]=$,e[17]=b,e[18]=k,e[19]=I):I=e[19],I}function sn(C){const e=G.c(35),{open:n,onOpenChange:d,count:s,onConfirm:o}=C,c=ne(),r=s===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let m;e[0]!==s||e[1]!==c||e[2]!==r?(m=c(r,{count:s}),e[0]=s,e[1]=c,e[2]=r,e[3]=m):m=e[3];let a;e[4]!==m?(a=t.jsx(ft,{children:m}),e[4]=m,e[5]=a):a=e[5];const S=s===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==c||e[7]!==S?(u=c(S),e[6]=c,e[7]=S,e[8]=u):u=e[8];let l;e[9]!==u?(l=t.jsx(ht,{children:u}),e[9]=u,e[10]=l):l=e[10];let p;e[11]!==a||e[12]!==l?(p=t.jsxs(xt,{children:[a,l]}),e[11]=a,e[12]=l,e[13]=p):p=e[13];let f;e[14]!==c?(f=c("orgs.bulkDeleteDialog.cancelButton"),e[14]=c,e[15]=f):f=e[15];let h;e[16]!==f?(h=t.jsx(jt,{children:f}),e[16]=f,e[17]=h):h=e[17];const x=s===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let D;e[18]!==s||e[19]!==c||e[20]!==x?(D=c(x,{count:s}),e[18]=s,e[19]=c,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==o||e[23]!==D?(y=t.jsx(St,{onClick:o,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:D}),e[22]=o,e[23]=D,e[24]=y):y=e[24];let v;e[25]!==y||e[26]!==h?(v=t.jsxs(yt,{children:[h,y]}),e[25]=y,e[26]=h,e[27]=v):v=e[27];let i;e[28]!==v||e[29]!==p?(i=t.jsxs(Ct,{children:[p,v]}),e[28]=v,e[29]=p,e[30]=i):i=e[30];let b;return e[31]!==d||e[32]!==n||e[33]!==i?(b=t.jsx(vt,{open:n,onOpenChange:d,children:i}),e[31]=d,e[32]=n,e[33]=i,e[34]=b):b=e[34],b}function on(C){const e=G.c(39),{item:n,canManage:d,allConnections:s,connectedAppNames:o,connectingItemId:c,onNavigateConnected:r,onConnect:m}=C,a=ne();let S,u;e[0]!==o||e[1]!==n?(S=we(n)??"",u=o.has(S),e[0]=o,e[1]=n,e[2]=S,e[3]=u):(S=e[2],u=e[3]);const l=u;let p;e[4]!==n._meta?(p=Nt(n._meta),e[4]=n._meta,e[5]=p):p=e[5];const f=p,h=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",x=n.server?.description||n.description||null;let D;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(D=n.server?.icons?.[0]?.src||kt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=D):D=e[8];const y=D;let v;if(e[9]!==s||e[10]!==S){let O;e[12]!==S?(O=H=>H.connection_type!=="VIRTUAL"&&H.app_name===S,e[12]=S,e[13]=O):O=e[13],v=s.filter(O),e[9]=s,e[10]=S,e[11]=v}else v=e[11];const i=v,b=l||d;let k,A;e[14]!==i||e[15]!==l||e[16]!==n||e[17]!==m||e[18]!==r?(k=()=>{if(l){const O=i[0];O&&r(O);return}A()},A=()=>m(n),e[14]=i,e[15]=l,e[16]=n,e[17]=m,e[18]=r,e[19]=k,e[20]=A):(k=e[19],A=e[20]);let T;e[21]!==x||e[22]!==y||e[23]!==h?(T={title:h,description:x,icon:y},e[21]=x,e[22]=y,e[23]=h,e[24]=T):T=e[24];let M;e[25]===Symbol.for("react.memo_cache_sentinel")?(M=t.jsx(xe,{}),e[25]=M):M=e[25];const P=b?k:void 0;let $;e[26]!==d||e[27]!==c||e[28]!==A||e[29]!==l||e[30]!==n.id||e[31]!==a?($=l?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):d&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 classic:rounded-lg text-sm font-medium",disabled:c!==null,onClick:O=>{O.stopPropagation(),A()},children:c===n.id?t.jsx(ue,{className:"size-3.5"}):a("orgs.catalogItemCard.connect")}),e[26]=d,e[27]=c,e[28]=A,e[29]=l,e[30]=n.id,e[31]=a,e[32]=$):$=e[32];let I;e[33]!==$?(I=t.jsx("div",{className:"flex items-center gap-2",children:$}),e[33]=$,e[34]=I):I=e[34];let F;return e[35]!==T||e[36]!==P||e[37]!==I?(F=t.jsx(Ce,{connection:T,fallbackIcon:M,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=T,e[36]=P,e[37]=I,e[38]=F):F=e[38],F}function cn(C){return C?.length?{appToolName:C.find(n=>!!Kt(n._meta))?.name??null}:null}function He(C){const e=G.c(8),{selectionMode:n,children:d}=C,s=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let o;e[0]!==s?(o=he("overflow-hidden transition-all duration-150 ease-out",s),e[0]=s,e[1]=o):o=e[1];let c;e[2]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Re,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:rn,children:t.jsx(Jt,{size:20})})}),e[2]=c):c=e[2];let r;e[3]!==d?(r=t.jsxs(We,{children:[c,t.jsx(Xe,{align:"end",onClick:ln,children:d})]}),e[3]=d,e[4]=r):r=e[4];let m;return e[5]!==o||e[6]!==r?(m=t.jsx("div",{className:o,children:r}),e[5]=o,e[6]=r,e[7]=m):m=e[7],m}function ln(C){return C.stopPropagation()}function rn(C){return C.stopPropagation()}function an(C){const e=G.c(57),{group:n,onOpen:d,selectionMode:s,selectedIds:o,onToggleSelect:c}=C,r=ne();let m;if(e[0]!==n.connections||e[1]!==o){let g;e[3]!==o?(g=w=>o.has(w.id),e[3]=o,e[4]=g):g=e[4],m=n.connections.every(g),e[0]=n.connections,e[1]=o,e[2]=m}else m=e[2];const a=m;let S;if(e[5]!==n.connections||e[6]!==o){let g;e[8]!==o?(g=w=>o.has(w.id),e[8]=o,e[9]=g):g=e[9],S=n.connections.some(g),e[5]=n.connections,e[6]=o,e[7]=S}else S=e[7];const u=S;let l;e[10]!==a||e[11]!==n.connections||e[12]!==c||e[13]!==o?(l=()=>{for(const g of n.connections)a?o.has(g.id)&&c(g.id):o.has(g.id)||c(g.id)},e[10]=a,e[11]=n.connections,e[12]=c,e[13]=o,e[14]=l):l=e[14];const p=l,f=n.title,h=n.icon;let x;e[15]!==n.connections.length||e[16]!==r?(x=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=x):x=e[17];let D;e[18]!==n.icon||e[19]!==n.title||e[20]!==x?(D={title:f,icon:h,description:x},e[18]=n.icon,e[19]=n.title,e[20]=x,e[21]=D):D=e[21];let y;e[22]!==d||e[23]!==s||e[24]!==p?(y=()=>s?p():d(),e[22]=d,e[23]=s,e[24]=p,e[25]=y):y=e[25];const v=s&&a&&"ring-2 ring-primary",i=s&&u&&!a&&"ring-1 ring-primary/50";let b;e[26]!==i||e[27]!==v?(b=he(v,i),e[26]=i,e[27]=v,e[28]=b):b=e[28];const k=s?a?!0:u&&"mixed":void 0;let A;e[29]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(xe,{}),e[29]=A):A=e[29];let T;e[30]!==a||e[31]!==n.connections.length||e[32]!==s||e[33]!==u||e[34]!==r||e[35]!==p?(T=s?t.jsx(Ee,{checked:a?!0:u?"indeterminate":!1,onCheckedChange:p}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:r("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=s,e[33]=u,e[34]=r,e[35]=p,e[36]=T):T=e[36];let M;e[37]!==d?(M=g=>{g.stopPropagation(),d()},e[37]=d,e[38]=M):M=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let $;e[40]!==r?($=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=$):$=e[41];let I;e[42]!==M||e[43]!==$?(I=t.jsxs(ce,{onClick:M,children:[P,$]}),e[42]=M,e[43]=$,e[44]=I):I=e[44];let F;e[45]!==s||e[46]!==I?(F=t.jsx(He,{selectionMode:s,children:I}),e[45]=s,e[46]=I,e[47]=F):F=e[47];let O;e[48]!==T||e[49]!==F?(O=t.jsxs("div",{className:"flex items-center gap-1",children:[T,F]}),e[48]=T,e[49]=F,e[50]=O):O=e[50];let H;return e[51]!==b||e[52]!==k||e[53]!==O||e[54]!==D||e[55]!==y?(H=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:D,onClick:y,className:b,selected:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:O})}),e[51]=b,e[52]=k,e[53]=O,e[54]=D,e[55]=y,e[56]=H):H=e[56],H}function dn(C){const e=G.c(36),{connection:n,isSelected:d,selectionMode:s,canManage:o,canManageAgents:c,onToggleSelect:r,onOpen:m,onToggleStatus:a,onDelete:S}=C,u=ne();let l;e[0]!==d||e[1]!==r||e[2]!==s||e[3]!==u?(l=s?t.jsx(Ee,{checked:d,onCheckedChange:r,onClick:un}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=d,e[1]=r,e[2]=s,e[3]=u,e[4]=l):l=e[4];let p;e[5]!==m?(p=k=>{k.stopPropagation(),m()},e[5]=m,e[6]=p):p=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Be,{size:16}),e[7]=f):f=e[7];let h;e[8]!==u?(h=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=h):h=e[9];let x;e[10]!==p||e[11]!==h?(x=t.jsxs(ce,{onClick:p,children:[f,h]}),e[10]=p,e[11]=h,e[12]=x):x=e[12];let D;e[13]!==o||e[14]!==c||e[15]!==r||e[16]!==u?(D=(o||c)&&t.jsxs(ce,{onClick:k=>{k.stopPropagation(),r()},children:[t.jsx(bt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=o,e[14]=c,e[15]=r,e[16]=u,e[17]=D):D=e[17];let y;e[18]!==o||e[19]!==n||e[20]!==a||e[21]!==u?(y=o&&(n.status==="active"?t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("inactive")},children:[t.jsx(_t,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ce,{onClick:k=>{k.stopPropagation(),a("active")},children:[t.jsx(Dt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=o,e[19]=n,e[20]=a,e[21]=u,e[22]=y):y=e[22];let v;e[23]!==o||e[24]!==S||e[25]!==u?(v=o&&t.jsxs(ce,{variant:"destructive",onClick:k=>{k.stopPropagation(),S()},children:[t.jsx(Ke,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=o,e[24]=S,e[25]=u,e[26]=v):v=e[26];let i;e[27]!==s||e[28]!==x||e[29]!==D||e[30]!==y||e[31]!==v?(i=t.jsxs(He,{selectionMode:s,children:[x,D,y,v]}),e[27]=s,e[28]=x,e[29]=D,e[30]=y,e[31]=v,e[32]=i):i=e[32];let b;return e[33]!==l||e[34]!==i?(b=t.jsxs("div",{className:"flex items-center gap-1",children:[l,i]}),e[33]=l,e[34]=i,e[35]=b):b=e[35],b}function un(C){return C.stopPropagation()}function gn(C){const e=G.c(29),{count:n,total:d,canManage:s,canManageAgents:o,onSelectAll:c,onDeselectAll:r,onDelete:m,onAddToAgent:a,onToggleStatus:S,onCancel:u}=C,l=ne();if(n===0)return null;let p;e[0]!==n||e[1]!==l?(p=l("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=l,e[2]=p):p=e[2];let f;e[3]!==p?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:p}),e[3]=p,e[4]=f):f=e[4];let h;e[5]!==n||e[6]!==r||e[7]!==c||e[8]!==l||e[9]!==d?(h=n<d?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:c,children:l("orgs.connectionSelectionUi.selectAll",{total:d})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:l("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=c,e[8]=l,e[9]=d,e[10]=h):h=e[10];let x;e[11]!==o||e[12]!==a||e[13]!==l?(x=o&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(Le,{size:13}),l("orgs.connectionSelectionUi.addToAgent")]}),e[11]=o,e[12]=a,e[13]=l,e[14]=x):x=e[14];let D;e[15]!==s||e[16]!==m||e[17]!==S||e[18]!==l?(D=s&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("active"),children:l("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>S("inactive"),children:l("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:[t.jsx(Ke,{size:13}),l("orgs.connectionSelectionUi.delete")]})]}),e[15]=s,e[16]=m,e[17]=S,e[18]=l,e[19]=D):D=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(ze,{size:13}),e[20]=y):y=e[20];let v;e[21]!==u?(v=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=v):v=e[22];let i;return e[23]!==f||e[24]!==h||e[25]!==x||e[26]!==D||e[27]!==v?(i=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,h,x,D,v]})}),e[23]=f,e[24]=h,e[25]=x,e[26]=D,e[27]=v,e[28]=i):i=e[28],i}function mn(C){const e=G.c(45),{open:n,onOpenChange:d,agents:s,onConfirm:o}=C,c=ne(),[r,m]=V.useState(null);let a;e[0]!==c?(a=c("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=c,e[1]=a):a=e[1];let S;e[2]!==a?(S=t.jsx(Pe,{children:a}),e[2]=a,e[3]=S):S=e[3];let u;e[4]!==c?(u=c("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=c,e[5]=u):u=e[5];let l;e[6]!==u?(l=t.jsx(Me,{children:u}),e[6]=u,e[7]=l):l=e[7];let p;e[8]!==S||e[9]!==l?(p=t.jsxs($e,{children:[S,l]}),e[8]=S,e[9]=l,e[10]=p):p=e[10];let f;e[11]!==s||e[12]!==r||e[13]!==c?(f=s.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:c("orgs.connectionSelectionUi.noAgentsFound")}):s.map(P=>t.jsxs("button",{type:"button",onClick:()=>m(P.id),className:he("flex items-center gap-3 w-full classic:rounded-md compact:rounded-lg px-3 py-2 text-left transition-colors",r===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Yt,{icon:P.icon,name:P.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:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=s,e[12]=r,e[13]=c,e[14]=f):f=e[14];let h;e[15]!==f?(h=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:f}),e[15]=f,e[16]=h):h=e[16];let x;e[17]!==d?(x=()=>d(!1),e[17]=d,e[18]=x):x=e[18];let D;e[19]!==c?(D=c("orgs.connectionSelectionUi.cancel"),e[19]=c,e[20]=D):D=e[20];let y;e[21]!==x||e[22]!==D?(y=t.jsx(L,{variant:"outline",onClick:x,children:D}),e[21]=x,e[22]=D,e[23]=y):y=e[23];const v=!r;let i;e[24]!==o||e[25]!==d||e[26]!==r?(i=()=>{r&&(o(r),d(!1),m(null))},e[24]=o,e[25]=d,e[26]=r,e[27]=i):i=e[27];let b;e[28]!==c?(b=c("orgs.connectionSelectionUi.add"),e[28]=c,e[29]=b):b=e[29];let k;e[30]!==v||e[31]!==i||e[32]!==b?(k=t.jsx(L,{disabled:v,onClick:i,children:b}),e[30]=v,e[31]=i,e[32]=b,e[33]=k):k=e[33];let A;e[34]!==y||e[35]!==k?(A=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=A):A=e[36];let T;e[37]!==A||e[38]!==p||e[39]!==h?(T=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[p,h,A]}),e[37]=A,e[38]=p,e[39]=h,e[40]=T):T=e[40];let M;return e[41]!==d||e[42]!==n||e[43]!==T?(M=t.jsx(Ue,{open:n,onOpenChange:d,children:T}),e[41]=d,e[42]=n,e[43]=T,e[44]=M):M=e[44],M}function pn({listState:C,activeTab:e,typeFilter:n,statusFilter:d}){const s=ne(),{org:o}=Ne(),c=nt(),r=ke(),{data:m}=Te.useSession(),a=Ve(),S=zt(C),u=gt(),{granted:l}=ye("connections:manage"),{granted:p}=ye("agents:manage"),[f,h]=V.useState(new Set),x=f.size>0,[D,y]=V.useState(!1),[v,i]=V.useState(!1),[b,k]=V.useState(null),A=Bt(),T=S.filter(_=>!(n!=="ALL"&&_.connection_type!==n||d!=="ALL"&&_.status!==d)),M=dt(T),P=_=>{h(j=>{const E=new Set(j);return E.has(_)?E.delete(_):E.add(_),E})},$=()=>{h(new Set)},I=Ae(C.searchTerm),F=I.items,O=pt(I.loadMore,I.hasMore,I.isLoadingMore),H=new Set(S.filter(_=>_.app_name).map(_=>_.app_name)),g=C.search.length>0,w=e==="all"||g?F.filter(_=>{if(g){const j=we(_);if(j&&H.has(j))return!1}return!0}):[],R=e==="connected"||g?M:[],ee=async _=>{if(!(!o||!m?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),k(_.id);try{const j=ct(_,o.id,m.user.id,{remoteIndex:0}),E=j.connection_type==="STDIO",K=!!j.connection_url,B=E&&j.connection_headers&&typeof j.connection_headers=="object"&&"command"in j.connection_headers;if(!K&&!B){W.error(s("orgs.connections.cannotConnectNoMethod")),k(null);return}const oe=await a.create.mutateAsync(j),{id:ie}=oe,le=await Qt({connectionId:ie,orgId:o.id,orgSlug:o.slug,persistFallback:re=>a.update.mutateAsync({id:ie,data:{connection_token:re}}).then(()=>{})});if(le.ran&&!le.ok){te("connection_oauth_failed",{connection_id:ie,flow:"connections_page_connect",error:le.error??"no_token"}),W.error(s("orgs.connections.authenticationFailed",{error:le.error??"no token received"}));return}if(le.ran){te("connection_oauth_succeeded",{connection_id:ie,flow:"connections_page_connect"});const re=new URL(`/api/${o.slug}/mcp/${ie}`,window.location.origin);await c.invalidateQueries({queryKey:ot.isMCPAuthenticated(re.href,null)}),N(),W.success(s("orgs.connections.authenticationSuccessful"))}let me=null;try{const re=await c.fetchQuery(Et({connectionId:ie,orgId:o.id,orgSlug:o.slug}));me=cn((await re.listTools()).tools)}catch{}const ve=de(oe),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ve}}:null;W.success(s("orgs.connections.connectedSuccessfully"),be?{action:{label:s("orgs.connections.openConnection"),onClick:()=>r(be)}}:void 0)}catch(j){W.error(s("orgs.connections.failedToConnect",{error:j instanceof Error?j.message:String(j)}))}finally{k(null)}}},X=st(),N=()=>{c.invalidateQueries({predicate:_=>{const j=_.queryKey;return j[1]===o.id&&j[3]==="collection"&&j[4]==="CONNECTIONS"}})},z=async()=>{y(!1);const _=[...f];te("connections_bulk_delete",{count:_.length});const E=(await Promise.allSettled(_.map(K=>X.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;N(),W.success(s("orgs.connections.deletedConnections",{count:E})),$()},U=async(_,j)=>{try{await a.update.mutateAsync({id:_,data:{status:j}}),N(),W.success(s(j==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{W.error(s("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const j=[...f];te("connections_bulk_status_toggled",{count:j.length,to_status:_});const K=(await Promise.allSettled(j.map(B=>a.update.mutateAsync({id:B,data:{status:_}})))).filter(B=>B.status==="fulfilled").length;N(),W.success(_==="active"?s("orgs.connections.enabledConnections",{count:K}):s("orgs.connections.disabledConnections",{count:K})),$()},je=async _=>{const j=A.find(B=>B.id===_);if(!j)return;te("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const E=new Set(j.connections.map(B=>B.connection_id)),K=[...f].filter(B=>!E.has(B)).map(B=>({connection_id:B,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){W.info(s("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await X.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...j.connections,...K]}}),c.invalidateQueries({predicate:B=>{const oe=B.queryKey;return oe[1]===o.id&&oe[3]==="collection"&&oe[4]==="VIRTUAL_MCP"}}),W.success(s("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:j.title})),$()}catch{W.error(s("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(mt,{...u}),t.jsx(sn,{open:D,onOpenChange:y,count:f.size,onConfirm:z}),t.jsx(mn,{open:v,onOpenChange:i,agents:A,onConfirm:je}),I.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(g?w.length===0&&T.length===0:e==="all"?w.length===0:T.length===0)?t.jsx(ut,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:s("orgs.connections.noConnectionsFound"),description:C.search?s("orgs.connections.noConnectionsMatchSearch",{search:C.search}):s(l?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(_=>{if(_.type==="group")return t.jsx(an,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:_.key}})},selectionMode:x,selectedIds:f,onToggleSelect:P},_.key);const j=_.connection,E=f.has(j.id);return t.jsx(Ce,{connection:j,fallbackIcon:t.jsx(xe,{}),onClick:()=>x?P(j.id):r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),className:he(E&&"ring-2 ring-primary bg-primary/5"),selected:x?E:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(dn,{connection:j,isSelected:E,selectionMode:x,canManage:l,canManageAgents:p,onToggleSelect:()=>P(j.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onToggleStatus:K=>U(j.id,K),onDelete:()=>u.requestDelete(j)})},j.id)}),w.map(_=>t.jsx(on,{item:_,canManage:l,allConnections:S,connectedAppNames:H,connectingItemId:b,onNavigateConnected:j=>r({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:de(j)}}),onConnect:ee},_.id)),(e==="all"||g)&&t.jsx("div",{ref:O,className:"col-span-full h-4"}),(e==="all"||g)&&I.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(ue,{className:"size-6 text-muted-foreground"})})]})}),x&&t.jsx(gn,{count:f.size,total:T.length,canManage:l,canManageAgents:p,onSelectAll:()=>{h(new Set(T.map(_=>_.id)))},onDeselectAll:()=>h(new Set),onDelete:()=>y(!0),onAddToAgent:()=>i(!0),onToggleStatus:ge,onCancel:$})]})}function fn(){const C=qe(),e=ne(),{org:n}=Ne(),d=ke(),s=Qe({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:c}=Ye(),r=Ie(),{granted:m}=ye("connections:manage"),a=nn({namespace:n.slug,resource:"connections"}),S=Ve(),[u,l]=Je(Ze.connectionsTab(n.slug),g=>s.tab==="all"||s.tab==="connected"?s.tab:g??"all"),[p,f]=V.useState("ALL"),[h,x]=V.useState("ALL"),y=Ae(a.searchTerm).items,v=a.search!==a.searchTerm,i=et({resolver:tt(Wt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),b=i.watch("ui_type"),k=i.watch("connection_url"),A=i.watch("npx_package"),T=fe({uiType:b,connectionUrl:k??"",npxPackage:A??""})??De({uiType:b,connectionUrl:k??"",registryItems:y}),M=m&&s.action==="create",P=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),d({to:"/$org/settings/connections",params:{org:n.slug},search:{action:"create"}})},$=()=>{d({to:"/$org/settings/connections",params:{org:n.slug},search:{}})},I=async g=>{let w,R=null,ee=null,X=null;g.ui_type==="NPX"?(w="STDIO",R="",X=Gt(g.npx_package||"",g.env_vars||[])):g.ui_type==="STDIO"?(w="STDIO",R="",X=qt(g.stdio_command||"",g.stdio_args||"",g.stdio_cwd,g.env_vars||[])):(w=g.ui_type,R=g.connection_url||"",ee=g.connection_token||null);const N=it("conn");te("connection_custom_created",{connection_type:w,ui_type:g.ui_type}),await S.create.mutateAsync({id:N,title:g.title,description:g.description||null,connection_type:w,connection_url:R,connection_token:ee,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:n.id,icon:g.icon??null,app_name:null,app_id:null,connection_headers:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),$(),i.reset(),d({to:"/$org/settings/connections/$appSlug",params:{org:n.slug,appSlug:de({app_name:null,connection_url:R,title:g.title,id:N})}})},F=g=>{g||(M&&$(),i.reset())},O=g=>{const w=g.trim();if(!w)return;const R=!!i.formState.dirtyFields.title,ee=!!i.formState.dirtyFields.description,X=!!i.formState.dirtyFields.env_vars,N=U=>{if(U&&(!R&&!i.getValues("title").trim()&&U.title&&i.setValue("title",U.title,{shouldDirty:!1}),!ee&&!(i.getValues("description")??"").trim()&&U.description&&i.setValue("description",U.description,{shouldDirty:!1}),!X&&U.envVarKeys?.length)){const ge=i.getValues("env_vars")??[],je=new Set(ge.map(j=>j.key)),_=U.envVarKeys.filter(j=>!je.has(j));_.length>0&&i.setValue("env_vars",[...ge,..._.map(j=>({key:j,value:""}))],{shouldDirty:!0})}},z=Xt(w);if(z&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",z.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),N(fe({uiType:"NPX",npxPackage:z.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const U=b==="HTTP"||b==="SSE"||b==="Websocket"?b:"HTTP";i.setValue("ui_type",U,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),N(fe({uiType:U,connectionUrl:w})??De({uiType:U,connectionUrl:w,registryItems:y}));return}b==="NPX"&&N(fe({uiType:"NPX",npxPackage:w}))},H=m?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:C?"sm":"default",variant:C?"default":"outline",onClick:P,children:[t.jsx(Le,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:e("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const g=e("orgs.connections.createConnection"),w=e("orgs.connections.createConnectionDescription"),R=i.formState.isSubmitting?e("orgs.connections.saving"):e("orgs.connections.createConnection"),ee=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:i.control,name:"ui_type",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.type")}),t.jsxs(Ot,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ft,{children:t.jsx(Ut,{})})}),t.jsxs(Vt,{children:[t.jsx(ae,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ae,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ae,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ae,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),e("orgs.connections.npxPackage")]})}),t.jsx(ae,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ht,{className:"w-4 h-4"}),e("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),b==="NPX"&&t.jsx(q,{control:i.control,name:"npx_package",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("npx_package",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),b==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:i.control,name:"stdio_command",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.command")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"stdio_args",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:e("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(b==="NPX"||b==="STDIO")&&t.jsx(q,{control:i.control,name:"env_vars",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Rt,{value:N.value??[],onChange:N.onChange})}),t.jsx(Z,{})]})}),b!=="NPX"&&b!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:i.control,name:"connection_url",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.url")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const U=z.clipboardData.getData("text");U&&(z.preventDefault(),i.setValue("connection_url",U.trim(),{shouldDirty:!0}),O(U))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"connection_token",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:T?.token?.label??e("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(se,{type:"password",placeholder:T?.token?.placeholder??e("orgs.connections.tokenPlaceholder"),...N,value:N.value??""})}),T?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.token.helperText,T.id==="github"&&t.jsxs(t.Fragment,{children:[" ","·"," ",t.jsx("a",{className:"text-foreground underline underline-offset-4 hover:text-foreground/80",href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noreferrer",children:e("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(q,{control:i.control,name:"title",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.name")}),t.jsx(J,{children:t.jsx(se,{placeholder:e("orgs.connections.namePlaceholder"),...N})}),t.jsx(Z,{})]})}),t.jsx(q,{control:i.control,name:"description",render:({field:N})=>t.jsxs(Q,{children:[t.jsx(Y,{children:e("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Lt,{placeholder:e("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Z,{})]})})]}),X=M;return r?t.jsx(Tt,{open:X,onOpenChange:F,children:t.jsxs(wt,{className:"max-h-[90vh]",children:[t.jsx(At,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(It,{children:g}),t.jsx(Pt,{className:"mt-1",children:w})]}),t.jsx(Mt,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":e("orgs.connections.close"),children:t.jsx(ze,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:ee}),t.jsx($t,{children:t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:R})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:F,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:g}),t.jsx(Me,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(I),children:[t.jsx("div",{className:"py-4",children:ee}),t.jsxs(Oe,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>F(!1),children:e("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:R})]})]})})]})})})(),t.jsx(pe.Content,{children:t.jsx(pe.Container,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(pe.Title,{actions:C&&H,children:e("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(rt,{value:a.search,onChange:a.setSearch,placeholder:e("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:g=>{g.key==="Escape"&&(a.setSearch(""),g.target.blur())}}),t.jsx(lt,{sortKey:a.sortKey,sortDirection:a.sortDirection,onSort:a.handleSort,sortOptions:[{id:"title",label:e("orgs.connections.sortName")},{id:"description",label:e("orgs.connections.sortDescription")},{id:"connection_type",label:e("orgs.connections.sortType")},{id:"updated_by",label:e("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:e("orgs.connections.sortUpdated")}],filters:[{label:e("orgs.connections.filterType"),value:p,onChange:g=>f(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:e("orgs.connections.filterStatus"),value:h,onChange:g=>x(g||"ALL"),options:[{id:"ALL",label:e("orgs.connections.filterAll")},{id:"active",label:e("orgs.connections.filterActive")},{id:"inactive",label:e("orgs.connections.filterInactive")},{id:"error",label:e("orgs.connections.filterError")}]}]})]}),!C&&H]}),t.jsx(at,{placement:"page",tabs:[{id:"all",label:e("orgs.connections.tabAll")},{id:"connected",label:e("orgs.connections.tabConnected")}],activeTab:u,onTabChange:g=>{const w=g;w!==u&&te("connections_page_tab_changed",{to_tab:w}),l(w)}}),t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:v?.5:1,transition:v?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:v?"none":"auto"},children:t.jsx(pn,{listState:a,activeTab:u,typeFilter:p,statusFilter:h})})})]})})})]})})}function Ls(){const C=G.c(1);let e;return C[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ge,{children:t.jsx(V.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ue,{className:"size-8 text-muted-foreground"})}),children:t.jsx(fn,{})})}),C[0]=e):e=C[0],e}export{Ls as default};
|