decocms 4.502.1 → 4.502.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{ActiveShapeUtils-Dpaml8J5.js → ActiveShapeUtils-BmpX0aJ4.js} +1 -1
- package/dist/client/assets/{AlertCircle-CxMEbIvM.js → AlertCircle-BugQG9bV.js} +1 -1
- package/dist/client/assets/{AreaChart-BgtEgMgW.js → AreaChart-C2JGxQiA.js} +1 -1
- package/dist/client/assets/{ArrowLeft-ChZ5XGHH.js → ArrowLeft-BsOtfvqw.js} +1 -1
- package/dist/client/assets/{ArrowUp-BseWcDxZ.js → ArrowUp-BM60-fZY.js} +1 -1
- package/dist/client/assets/{BarChart-IN_s5p-k.js → BarChart-B7UShXEl.js} +1 -1
- package/dist/client/assets/{Building02-BCzHZCeO.js → Building02-DqK4SREZ.js} +1 -1
- package/dist/client/assets/{CategoricalChart-CN6eSF60.js → CategoricalChart-B4irlNQB.js} +1 -1
- package/dist/client/assets/{CheckCircle-BRmDGKsS.js → CheckCircle-DIUFnJQp.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-DXUxjCek.js → ChevronSelectorVertical-CRMiEVEY.js} +1 -1
- package/dist/client/assets/{ChevronUp-B7Vn1Rb2.js → ChevronUp-C9gm2RHA.js} +1 -1
- package/dist/client/assets/{Copy01-BeZeYuYP.js → Copy01-BrqDGrTX.js} +1 -1
- package/dist/client/assets/{CreditCard01-CR3uiUwh.js → CreditCard01-C7MhbtAI.js} +1 -1
- package/dist/client/assets/{DotsVertical-C85_hpnn.js → DotsVertical-DjBJNxxU.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-dTYYBaMt.js → ErrorBarContext-Duc4DanJ.js} +1 -1
- package/dist/client/assets/{Globe04-DTEEsJ26.js → Globe04-Bi1qDXFD.js} +1 -1
- package/dist/client/assets/{Image01-BcbXjZdM.js → Image01-LmX-9DTg.js} +1 -1
- package/dist/client/assets/{Key01-BnDtFdB6.js → Key01-D7fc2of0.js} +1 -1
- package/dist/client/assets/{Link01-CeBVtW9F.js → Link01-UOxGnkqg.js} +1 -1
- package/dist/client/assets/{LinkBroken01-B4m_6hKA.js → LinkBroken01-D4fcNp0y.js} +1 -1
- package/dist/client/assets/{Monitor01-DluZDvx0.js → Monitor01-zCUpqs5C.js} +1 -1
- package/dist/client/assets/{Play-C67yELx6.js → Play-BaMMHzUS.js} +1 -1
- package/dist/client/assets/{Plus-FrFsiUQv.js → Plus-DBwsZRbL.js} +1 -1
- package/dist/client/assets/{SearchMd-CTE_Dij_.js → SearchMd-Cz9CjV4u.js} +1 -1
- package/dist/client/assets/{Sector-DpVhdPl7.js → Sector-DRzP1YgK.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-B47bYriG.js → ShoppingBag01-FE4oAEwY.js} +1 -1
- package/dist/client/assets/{Sun-BADHqp_z.js → Sun-lUDK8Dny.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-B8pZTGji.js → SwitchHorizontal01-BLoNOmQx.js} +1 -1
- package/dist/client/assets/{Tool01-Ceiq1yQg.js → Tool01-BYtrXXg0.js} +1 -1
- package/dist/client/assets/{Trash01-QaBoOmQD.js → Trash01-DmGIq4LE.js} +1 -1
- package/dist/client/assets/{Upload01-CfxF6ZJF.js → Upload01-B1KubIEG.js} +1 -1
- package/dist/client/assets/{User01-DowUGIml.js → User01-DxYW6D1x.js} +1 -1
- package/dist/client/assets/{UserSquare-C1l8QNgE.js → UserSquare-B3hi5v4G.js} +1 -1
- package/dist/client/assets/{Users01-BvAfz3hH.js → Users01-Dg9yGM1q.js} +1 -1
- package/dist/client/assets/{XAxis-DQTb2U_R.js → XAxis-BriqOO10.js} +1 -1
- package/dist/client/assets/{XClose-CDVFbEme.js → XClose-D_NlSxSm.js} +1 -1
- package/dist/client/assets/{ZoomOut-0IXFhA1q.js → ZoomOut-BpMDqvoU.js} +1 -1
- package/dist/client/assets/{access-gate-BietqhCq.js → access-gate-DawpkWaC.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CcwJwiyY.js → add-connection-dialog-lyugU_mj.js} +1 -1
- package/dist/client/assets/{agent-analytics-DbRvj_tI.js → agent-analytics-DEQNBU8x.js} +1 -1
- package/dist/client/assets/agent-app-B_p1zClu.js +1 -0
- package/dist/client/assets/{agent-assets-pN9q_Pkx.js → agent-assets-DpD_FYPJ.js} +1 -1
- package/dist/client/assets/{agent-automation-CvB6C4Vu.js → agent-automation-y8Q_blPP.js} +1 -1
- package/dist/client/assets/{agent-automations-78ZqzNjS.js → agent-automations-G_wOHGxQ.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-374gt80i.js → agent-connect-sources-0w-hFhuF.js} +1 -1
- package/dist/client/assets/agent-deck-Bv4Ea3n5.js +1 -0
- package/dist/client/assets/{agent-e2e-DyeOXWbZ.js → agent-e2e-DDS2OBYo.js} +1 -1
- package/dist/client/assets/{agent-experiments-VXnZmfhk.js → agent-experiments-CDaNVjiN.js} +1 -1
- package/dist/client/assets/{agent-file-B0YjGOwa.js → agent-file-CZwBMDPX.js} +1 -1
- package/dist/client/assets/{agent-hosting-DYfoCiax.js → agent-hosting-CDM9c3HL.js} +1 -1
- package/dist/client/assets/{agent-icon-E5NFjGaq.js → agent-icon-Cwi3uRdu.js} +1 -1
- package/dist/client/assets/agent-library-B8Kx2dH6.js +1 -0
- package/dist/client/assets/agent-library-file-D6BfiqFR.js +1 -0
- package/dist/client/assets/{agent-monitor-CYXJZvch.js → agent-monitor-DgbGzFfm.js} +1 -1
- package/dist/client/assets/{agent-overview-CFP2r65u.js → agent-overview-D7sXtedV.js} +1 -1
- package/dist/client/assets/{agent-releases-BHhSgU59.js → agent-releases-DBGhKiDv.js} +1 -1
- package/dist/client/assets/agent-settings-CYtLsqfY.js +1 -0
- package/dist/client/assets/{agent-site-editor-ByLDMiSm.js → agent-site-editor-CPneBPX9.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-CoA0Y8Pm.js +2 -0
- package/dist/client/assets/agent-site-editor-content-B6s0vW0K.js +1 -0
- package/dist/client/assets/agent-site-editor-preview-Deycj8Hn.js +1 -0
- package/dist/client/assets/agent-view-DKBEZHZf.js +1 -0
- package/dist/client/assets/{agent-view-guard-BVO3LqzS.js → agent-view-guard-B7DCW97m.js} +1 -1
- package/dist/client/assets/{agents-list-Dculqto5.js → agents-list-WKtrnsCY.js} +1 -1
- package/dist/client/assets/{ai-providers-DolR1Us6.js → ai-providers-gwsES712.js} +1 -1
- package/dist/client/assets/{alert-Dm5RN1oD.js → alert-DD0xrZ6s.js} +1 -1
- package/dist/client/assets/{alert-dialog-BY83tkfe.js → alert-dialog-Cww2cCKj.js} +1 -1
- package/dist/client/assets/{analytics-sections-CZp3MeQw.js → analytics-sections-fsDdSYtz.js} +1 -1
- package/dist/client/assets/{api-keys-CldV2ng2.js → api-keys-C4RupExd.js} +1 -1
- package/dist/client/assets/api-keys-DIX6Wq_J.js +1 -0
- package/dist/client/assets/{app-editor-CzTTzdaU.js → app-editor-BunD9Cep.js} +1 -1
- package/dist/client/assets/{asset-utils-DOMqsWw0.js → asset-utils-B7vSk_IG.js} +1 -1
- package/dist/client/assets/{auth-catchall-Dmk_X1_7.js → auth-catchall-DXOnI1Dn.js} +1 -1
- package/dist/client/assets/{auth-3_xtjhZa.js → auth-d1Zn25hw.js} +1 -1
- package/dist/client/assets/{auth-entry-uTh0V7C8.js → auth-entry-QKE13w72.js} +1 -1
- package/dist/client/assets/{auth-split-layout-CqYj_13F.js → auth-split-layout-BOn9jzuY.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-CLn5_4J6.js → authenticate-and-persist-oauth-p8iXxMbw.js} +1 -1
- package/dist/client/assets/{automation-list-row-dzpsPyTv.js → automation-list-row-aeiODfl-.js} +1 -1
- package/dist/client/assets/{automation-runs-CAYarR59.js → automation-runs-gnGbUEYl.js} +1 -1
- package/dist/client/assets/{automations-Dfb3WhG2.js → automations-D6uaxrsR.js} +1 -1
- package/dist/client/assets/{autosend-Dqgiz7-z.js → autosend-DkgNxXhw.js} +1 -1
- package/dist/client/assets/{avatar-D-6InH0Y.js → avatar-Bp-EkB-V.js} +1 -1
- package/dist/client/assets/{badge-sJYWVYje.js → badge-BIePf0xK.js} +1 -1
- package/dist/client/assets/{block-document-CwGtizDj.js → block-document-D9afNZe_.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-JFuqyIhO.js → blocks-preview-workspace-context-CVDMxLIY.js} +1 -1
- package/dist/client/assets/{blocks-tab-states-CUi2qvXH.js → blocks-tab-states-Dgf9O_BB.js} +3 -3
- package/dist/client/assets/{blog-schema-CYGnXeYs.js → blog-schema-D_8LQntk.js} +1 -1
- package/dist/client/assets/{board-analytics-wIsQVPwo.js → board-analytics-QsikkAwD.js} +1 -1
- package/dist/client/assets/{buckets-CnfDBCeG.js → buckets-CELYezv2.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-CtseFH_6.js → build-improve-prompt-doc-d10qBCA_.js} +1 -1
- package/dist/client/assets/{calendar-CkQr_tH3.js → calendar-BnpyhDmY.js} +1 -1
- package/dist/client/assets/{capability-load-error-Dj0p1QAG.js → capability-load-error-D8PnCnVx.js} +1 -1
- package/dist/client/assets/{category-editor-BNcm0eWj.js → category-editor-BosHSdme.js} +1 -1
- package/dist/client/assets/{chart-CArQDy5U.js → chart-Bv9NYntf.js} +1 -1
- package/dist/client/assets/{chat-context-tvcXoBeE.js → chat-context-CKK4nwlA.js} +8 -8
- package/dist/client/assets/{chat-draft-ags4xou8.js → chat-draft-BMAMpVi3.js} +1 -1
- package/dist/client/assets/{checkbox-C6deEGCR.js → checkbox-Dwjm_TLd.js} +1 -1
- package/dist/client/assets/{choose-editor-49fvt7KT.js → choose-editor-CZoejY4P.js} +1 -1
- package/dist/client/assets/{cli-auth-success-CtyD07eG.js → cli-auth-success-B_GTleKO.js} +1 -1
- package/dist/client/assets/{client-icons-BJlX5RmN.js → client-icons-rqhSDiCg.js} +1 -1
- package/dist/client/assets/cms-settings-editor-B950DCbJ.js +1 -0
- package/dist/client/assets/{collapsible-DNW_6aVc.js → collapsible-BEHE2idT.js} +1 -1
- package/dist/client/assets/{collection-detail-D_oRg5uq.js → collection-detail-CEB1twCS.js} +1 -1
- package/dist/client/assets/{collection-display-button-CxD1zfgF.js → collection-display-button-CZETvC3F.js} +1 -1
- package/dist/client/assets/{collection-search-BzGtQCoT.js → collection-search-mDMHjO22.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bdkg1hq0.js → collection-table-wrapper-BTz_B-8u.js} +1 -1
- package/dist/client/assets/{collection-tabs-D-985lbS.js → collection-tabs-C8f6Only.js} +1 -1
- package/dist/client/assets/{column-rules-DTH6MFyL.js → column-rules-CHHzpXer.js} +1 -1
- package/dist/client/assets/{combobox-DH1NtP3D.js → combobox-DsvKNdY8.js} +1 -1
- package/dist/client/assets/{command-CVodN_KO.js → command-D2C8egnH.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-DC91CD_h.js → companion-mcps-section-980W-E9y.js} +1 -1
- package/dist/client/assets/{config-CH426QBK.js → config-Df4GVvvj.js} +1 -1
- package/dist/client/assets/{connect-B4atgjM-.js → connect-BCz-doDt.js} +1 -1
- package/dist/client/assets/{connect-layout-Dn5RIa3-.js → connect-layout-dj6lGUOP.js} +1 -1
- package/dist/client/assets/{connection-BzAtvzSu.js → connection-CXmYeQRu.js} +1 -1
- package/dist/client/assets/{connection-card-CuDjRvQM.js → connection-card-BnbrpDH3.js} +1 -1
- package/dist/client/assets/{connection-detail-LDbDzTcC.js → connection-detail-DgPXb5ec.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DX9VWFYw.js → connection-form-helpers-a4JD1Ns8.js} +1 -1
- package/dist/client/assets/{connections-DPd5fcz3.js → connections-Cywtpg_p.js} +1 -1
- package/dist/client/assets/{content-tab-CWZGoAxh.js → content-tab-DJpFcjvc.js} +3 -3
- package/dist/client/assets/{context-ItK-xs8d.js → context-D3qk5qiN.js} +1 -1
- package/dist/client/assets/{context-menu-DwASq-2m.js → context-menu-BAv_ihvH.js} +1 -1
- package/dist/client/assets/{core.esm-DD7e57Ya.js → core.esm-D0fLNP6n.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-u5RVm6vz.js → create-organization-dialog-Dz2w339w.js} +1 -1
- package/dist/client/assets/{daily-pulse-BrZF3U10.js → daily-pulse-BvFEfYSA.js} +1 -1
- package/dist/client/assets/{discover-BVHoLkk3.js → discover-LQfpS4xG.js} +1 -1
- package/dist/client/assets/{domain-settings-BM7hqiZ5.js → domain-settings-B0WV9_Uz.js} +1 -1
- package/dist/client/assets/{drawer-CkTzw9-A.js → drawer-C7TJoqXz.js} +1 -1
- package/dist/client/assets/{editor-classes-DwfWTmoT.js → editor-classes-B9HFPeRc.js} +1 -1
- package/dist/client/assets/{editor-CsrsRQNL.js → editor-r9_MTJH5.js} +1 -1
- package/dist/client/assets/{empty-state-Ba3qMun8.js → empty-state-ChkfcEnf.js} +1 -1
- package/dist/client/assets/{empty-state-CH6iGvNw.js → empty-state-DXyqmsSi.js} +1 -1
- package/dist/client/assets/{extract-connection-data-B_Afz4nk.js → extract-connection-data-B2gWRdBp.js} +1 -1
- package/dist/client/assets/{feature-gate-W48R3WT6.js → feature-gate-B6qb42zy.js} +1 -1
- package/dist/client/assets/{feature-paywall-D9khkBoZ.js → feature-paywall-DXx7v-jJ.js} +1 -1
- package/dist/client/assets/{file-explorer-DHDq6x-v.js → file-explorer-B67HF6Wo.js} +1 -1
- package/dist/client/assets/{file-preview-D9n-rE_m.js → file-preview-Baou4Z0N.js} +1 -1
- package/dist/client/assets/{file-share-button-CxU4bp8P.js → file-share-button-DtVBXYxU.js} +1 -1
- package/dist/client/assets/{file-type-icon-hT5Dk06T.js → file-type-icon-C2mdy7vI.js} +1 -1
- package/dist/client/assets/flat-project-CqneD8tb.js +1 -0
- package/dist/client/assets/{folder-icon-BgkcWxyT.js → folder-icon-Bqx-rRTJ.js} +1 -1
- package/dist/client/assets/{form-lTigv9Cm.js → form-DDdiF5DN.js} +1 -1
- package/dist/client/assets/{general-BW8ipZ-G.js → general-JuFqcNqn.js} +1 -1
- package/dist/client/assets/{home-BDeiBiYZ.js → home-UcHgTtiG.js} +1 -1
- package/dist/client/assets/{hosted-publish-feedback-Bttd9R-q.js → hosted-publish-feedback-5DTVDnQ-.js} +1 -1
- package/dist/client/assets/{icon-button-AZBqWvLN.js → icon-button-DfjCa6Mk.js} +1 -1
- package/dist/client/assets/{index-dmpY0k1_.js → index-2M41MwRq.js} +1 -1
- package/dist/client/assets/{index-CWGftR7V.js → index-BHzdhQYD.js} +1 -1
- package/dist/client/assets/{index-BrYnrqwa.js → index-BOey0PQ3.js} +1 -1
- package/dist/client/assets/{index-D19vbl6v.js → index-BVXKUS4M.js} +1 -1
- package/dist/client/assets/{index-B-eHj4u4.js → index-BlWeDA0T.js} +2 -2
- package/dist/client/assets/{index-UJRTDiss.js → index-BuXV8w2T.js} +1 -1
- package/dist/client/assets/{index-CSj5qaNn.js → index-CCq4aC_-.js} +3 -3
- package/dist/client/assets/{index-B8E6_dOg.js → index-CYLF_RCH.js} +1 -1
- package/dist/client/assets/{index-BlmkjYB7.js → index-Cb4Qh-54.js} +1 -1
- package/dist/client/assets/{index-kBSJcstK.js → index-D1I5UKBv.js} +1 -1
- package/dist/client/assets/{index-BVC6tsxO.js → index-D5I6z1z8.js} +1 -1
- package/dist/client/assets/{index-Bj0pg4Xb.js → index-DCg7x8H-.js} +1 -1
- package/dist/client/assets/{index-SEQedjDw.js → index-DrHP_BcE.js} +1 -1
- package/dist/client/assets/{index-TqnZfvlo.js → index-LPxqYo8X.js} +1 -1
- package/dist/client/assets/{index-redirect-C2exOEJ6.js → index-redirect-BL8ikpY8.js} +1 -1
- package/dist/client/assets/{index-C5owFjSB.js → index-sLNiMwXT.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-OMlvsWcf.js → infiniteQueryObserver-C9osZa8h.js} +1 -1
- package/dist/client/assets/{infra-billing-uV4T8F6_.js → infra-billing-Cs3idU5N.js} +1 -1
- package/dist/client/assets/{input-0NgdpVnI.js → input-3uLsKqBB.js} +3 -3
- package/dist/client/assets/{input-CyiZQSl-.js → input-BSKhVE-B.js} +1 -1
- package/dist/client/assets/{integration-icon-DKhUl3mk.js → integration-icon-BRfynNZ5.js} +1 -1
- package/dist/client/assets/{jira-icon-B2cXiao2.js → jira-icon-KByV_Mf3.js} +1 -1
- package/dist/client/assets/{label-Hktokb9g.js → label-CCf767lm.js} +1 -1
- package/dist/client/assets/{layout-Nt9MYelU.js → layout-COMw43Ge.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-C25-uw28.js → legacy-agents-deep-bTO0GYdo.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BmR3yjWi.js → legacy-main-redirect-TCc947lk.js} +1 -1
- package/dist/client/assets/library-D9_ShewK.js +1 -0
- package/dist/client/assets/{library-tab-Cw4yhIxO.js → library-tab-BGwlABCU.js} +1 -1
- package/dist/client/assets/{login-CmLP5OaS.js → login-Cs3tkGZ_.js} +1 -1
- package/dist/client/assets/{markdown-nIQQa0PZ.js → markdown-BRIlR7nZ.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DJ3cRpmT.js → mcp-app-renderer-BdWVQtZT.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BFMHXWCx.js → mcp-oauth-CbRV1ySf.js} +1 -1
- package/dist/client/assets/{mcp-oauth-BDYmNGyy.js → mcp-oauth-Wpa3RhmZ.js} +1 -1
- package/dist/client/assets/{members-BSHBMQ7h.js → members-D2nKnBqd.js} +1 -1
- package/dist/client/assets/{memory-D_VsBptg.js → memory-BOidyMfA.js} +1 -1
- package/dist/client/assets/{mini-report-page-6cVsNT3a.js → mini-report-page-Dvm9KZA4.js} +1 -1
- package/dist/client/assets/{mock-board-BW-Sa_Jw.js → mock-board-D7x3oR1J.js} +1 -1
- package/dist/client/assets/{monaco-editor-CETdPqMD.js → monaco-editor-CGec7a_K.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-yTtrPgRB.js → monitoring-stats-row-BBfe42aa.js} +1 -1
- package/dist/client/assets/{multi-select-Bt7N4nxw.js → multi-select-CWeD2kOU.js} +1 -1
- package/dist/client/assets/{mustache-CkmSkLcC.js → mustache-CwHM8aj-.js} +1 -1
- package/dist/client/assets/{new-project-dialog-BiL8l-Gz.js → new-project-dialog-D9WaXvgl.js} +1 -1
- package/dist/client/assets/{oauth-callback-C2OhIdyv.js → oauth-callback-BdiwSco0.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-Dvmle1pb.js → oauth-callback-ai-provider-CgO92uMO.js} +1 -1
- package/dist/client/assets/{onboarding-B4ZAdkmE.js → onboarding-C0FoRXam.js} +1 -1
- package/dist/client/assets/{openai-conversation-B_fu8wmv.js → openai-conversation-DScTerkb.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-Cq91NNiT.js → optimistic-project-sidebar-views--iSxVboR.js} +1 -1
- package/dist/client/assets/{organization-choice-BHS7iEpR.js → organization-choice-BfKg9bh6.js} +1 -1
- package/dist/client/assets/{orgs-C_-EK1k8.js → orgs-DuBdGAZM.js} +1 -1
- package/dist/client/assets/{page-seo-form-hSczGRI6.js → page-seo-form-DobjM56n.js} +1 -1
- package/dist/client/assets/{pair-XFt8jz7C.js → pair-Boroas12.js} +1 -1
- package/dist/client/assets/{plan-ladder-Bcai7E3A.js → plan-ladder-DRlbA6Oe.js} +1 -1
- package/dist/client/assets/{popover-DrRqLOLZ.js → popover-C86-20Mm.js} +1 -1
- package/dist/client/assets/{post-calendar-DKuwQYqY.js → post-calendar-BCVyphrd.js} +1 -1
- package/dist/client/assets/{post-editor-DnuhIR5k.js → post-editor-BcCUjE05.js} +1 -1
- package/dist/client/assets/{preview-content-BmE0C6gq.js → preview-content-Dk4Scdb5.js} +1 -1
- package/dist/client/assets/{preview-dialog-BOiVnRWu.js → preview-dialog-BP2Zt8Py.js} +1 -1
- package/dist/client/assets/{preview-panel-C8DpBZEG.js → preview-panel-BGjEJtqj.js} +1 -1
- package/dist/client/assets/{preview-tab-DbXCdlWL.js → preview-tab-DJ2raYQ6.js} +3 -3
- package/dist/client/assets/{product-picker-dialog-CkF4Q27X.js → product-picker-dialog-g66EoJ_T.js} +1 -1
- package/dist/client/assets/{profile-7yNVObk5.js → profile-BT5VjyCv.js} +1 -1
- package/dist/client/assets/{project-app-view-Bp6LQc2t.js → project-app-view-DmFCm9cm.js} +1 -1
- package/dist/client/assets/{project-feed-DKKNi4Ua.js → project-feed-B4yf-56T.js} +1 -1
- package/dist/client/assets/{project-icon-D9S8dOj2.js → project-icon-CJp8KUWK.js} +1 -1
- package/dist/client/assets/project-reports-D8ocu1pR.js +1 -0
- package/dist/client/assets/project-tasks-DJVmaqrl.js +1 -0
- package/dist/client/assets/{projects-C_HSjbRf.js → projects-7LPBT4kF.js} +1 -1
- package/dist/client/assets/{projects-empty-state-CxJvmt56.js → projects-empty-state-Bwas41PR.js} +1 -1
- package/dist/client/assets/{prompts-CoXqq6oc.js → prompts-BVvVWZvL.js} +1 -1
- package/dist/client/assets/record-editor-DywGKfn_.js +1 -0
- package/dist/client/assets/{redirect-editor-CqykzZQ6.js → redirect-editor-CBUBt5If.js} +1 -1
- package/dist/client/assets/{reports-Bima2O7N.js → reports-BEw3YAN9.js} +1 -1
- package/dist/client/assets/{reports-onboarding-DSmSkO0F.js → reports-onboarding-C2RC2ok9.js} +1 -1
- package/dist/client/assets/{reports-tab-BVzkcFqa.js → reports-tab-cAMVw7Rk.js} +2 -2
- package/dist/client/assets/reports-wAXvk8Rj.js +1 -0
- package/dist/client/assets/{repositories-BQXG-rNE.js → repositories-C9isGzNA.js} +1 -1
- package/dist/client/assets/{repository-binding-CVI26IB4.js → repository-binding-Ds0zXEVH.js} +1 -1
- package/dist/client/assets/{repository-import-picker-Cv7ik8wr.js → repository-import-picker-CJrt2Qyf.js} +1 -1
- package/dist/client/assets/{repository-picker-CaK5oYjG.js → repository-picker-DoUZKYGY.js} +1 -1
- package/dist/client/assets/{require-capability-Bk3o-_ih.js → require-capability-Canamm7b.js} +1 -1
- package/dist/client/assets/{required-auth-layout-BA_CRgc2.js → required-auth-layout-CoQlG-uh.js} +1 -1
- package/dist/client/assets/{reset-password-CJR2Md-H.js → reset-password-BIKAyV8Z.js} +1 -1
- package/dist/client/assets/{resizable-Bvs1DfKq.js → resizable-Bu_8_8YG.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-CPW7joUI.js → resolve-tab-icon-BYZBv0qd.js} +1 -1
- package/dist/client/assets/{review-settings-C79kWvAG.js → review-settings-dkP8FuZW.js} +1 -1
- package/dist/client/assets/{roles-j7FKOAUh.js → roles-B5cvsmrd.js} +1 -1
- package/dist/client/assets/{route-CA_TH__q.js → route-1w9x4x4x.js} +1 -1
- package/dist/client/assets/{route-R5TXvUXW.js → route-BhzRlDpl.js} +1 -1
- package/dist/client/assets/route-y_BiPuKo.js +1 -0
- package/dist/client/assets/{sandbox-lifecycle-context-lyXe9eIS.js → sandbox-lifecycle-context-DHjDdwbp.js} +1 -1
- package/dist/client/assets/{schema-DDS90txY.js → schema-D-34ICTJ.js} +1 -1
- package/dist/client/assets/{schema-CYEVNkkO.js → schema-DO5D2eCO.js} +1 -1
- package/dist/client/assets/{scroll-area-BxjOHUE0.js → scroll-area-BjUjV0Z5.js} +1 -1
- package/dist/client/assets/{search-input-CEGrosU-.js → search-input-BaljBVL8.js} +1 -1
- package/dist/client/assets/{search-toggle-DGnOuR56.js → search-toggle-BagUH5ou.js} +1 -1
- package/dist/client/assets/{secret-ciphertext-DuXF1kfY.js → secret-ciphertext-B8vjXVJK.js} +1 -1
- package/dist/client/assets/{secret-picker-DNAEW5WZ.js → secret-picker-CNgtWTyP.js} +1 -1
- package/dist/client/assets/{secrets-CweiWstI.js → secrets-Bgw4Vhpc.js} +1 -1
- package/dist/client/assets/{sections-editor-zQKRHCN0.js → sections-editor-DrdT1MI7.js} +1 -1
- package/dist/client/assets/{select-Be8KEqhq.js → select-B54nmexC.js} +1 -1
- package/dist/client/assets/{select-model-DSiTAeyQ.js → select-model-BoCP7Le0.js} +1 -1
- package/dist/client/assets/{seo-editor-5bdlykFK.js → seo-editor-CReMwULk.js} +1 -1
- package/dist/client/assets/{separator-C1oZC_Nw.js → separator-BeOkUBr0.js} +1 -1
- package/dist/client/assets/{settings-tab-Dk-4q6cx.js → settings-tab-D75yr9EZ.js} +1 -1
- package/dist/client/assets/{sheet-DcLd8f_T.js → sheet-2W5SODwA.js} +1 -1
- package/dist/client/assets/{shell-layout-jpc-IFbN.js → shell-layout-xMF7zZJW.js} +1 -1
- package/dist/client/assets/site-editor-BpVflMAH.js +1 -0
- package/dist/client/assets/{site-editor-toast-Rw5XomcC.js → site-editor-toast-B6rO5nP0.js} +1 -1
- package/dist/client/assets/{skills-BgH9DrsO.js → skills-C1sp0eJN.js} +1 -1
- package/dist/client/assets/{slider-CpmotJcT.js → slider-BpixRq8v.js} +1 -1
- package/dist/client/assets/{sortable.esm-Ch2zuqy4.js → sortable.esm-B1VIDqmY.js} +1 -1
- package/dist/client/assets/{sso-DhgNSN8N.js → sso-B50YHclH.js} +1 -1
- package/dist/client/assets/{suggestion-D6gjcmHp.js → suggestion-DjstHMLc.js} +1 -1
- package/dist/client/assets/{switch-CkX0BpKj.js → switch-ZvhKKFCY.js} +1 -1
- package/dist/client/assets/{symbol-BfV3FsI2.js → symbol-CRqLTukg.js} +1 -1
- package/dist/client/assets/{synced-repos-BPr9w1RO.js → synced-repos-D0e12nej.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-CeaHu6-c.js → tab-icon-glyph-By9Irlxn.js} +1 -1
- package/dist/client/assets/{table-CM8IdXDA.js → table-iG31aWmE.js} +1 -1
- package/dist/client/assets/{tabs-Mabj7P4A.js → tabs-CtKgNHMr.js} +1 -1
- package/dist/client/assets/{task-board-BDqVuMua.js → task-board-C00mxWAh.js} +1 -1
- package/dist/client/assets/{task-route-HyrcQpIh.js → task-route-BCPomVVQ.js} +1 -1
- package/dist/client/assets/{task-status-BTchb5mm.js → task-status-BDiexprl.js} +1 -1
- package/dist/client/assets/taskboard-analytics-dOoDSrcB.js +1 -0
- package/dist/client/assets/{tasks-N_JbBzrQ.js → tasks-AIRARaPK.js} +1 -1
- package/dist/client/assets/tasks-D17PyrkT.js +1 -0
- package/dist/client/assets/{textarea-Cu_mwrDc.js → textarea-BLu1V32o.js} +1 -1
- package/dist/client/assets/{thread-analytics-B6KhxNmJ.js → thread-analytics-BMKFoeky.js} +1 -1
- package/dist/client/assets/{thread-intent-2PQ2tJ8y.js → thread-intent-9GHukD-s.js} +1 -1
- package/dist/client/assets/{thread-route-C5byRWcJ.js → thread-route-B1NXGQXt.js} +1 -1
- package/dist/client/assets/{thread-route-BiZeKn-m.js → thread-route-CW7xmu6G.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BUt_0YWK.js → thread-sheet-body-rJHE2tap.js} +1 -1
- package/dist/client/assets/{time-range-picker-Bf0ZJ2P5.js → time-range-picker-CNeKIOXx.js} +1 -1
- package/dist/client/assets/{toggle-group-BRDgtYtL.js → toggle-group-BLxmrLuD.js} +1 -1
- package/dist/client/assets/{tool-namespace-XBvXTguD.js → tool-namespace-Cu-DNTic.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-CysTSWyH.js → toolbar-icon-button-670IDOJM.js} +1 -1
- package/dist/client/assets/{tooltip-Wg5TOkgk.js → tooltip-B6W7NpVz.js} +1 -1
- package/dist/client/assets/{tooltipContext-BSZQ5pEw.js → tooltipContext-BWgKo-Vc.js} +1 -1
- package/dist/client/assets/{track-DDuUL9Xr.js → track-j7cOVNc5.js} +1 -1
- package/dist/client/assets/{types-C9g69UXw.js → types-C4NGZqb0.js} +1 -1
- package/dist/client/assets/{url-slug-CWeO_dvk.js → url-slug-CCgQongS.js} +1 -1
- package/dist/client/assets/{usage-stats-0IIA6wpa.js → usage-stats-2c6yVTyC.js} +1 -1
- package/dist/client/assets/{use-ai-providers-CrjK99NZ.js → use-ai-providers-BWqKJRmf.js} +1 -1
- package/dist/client/assets/{use-app-takeover-BEzSlm3S.js → use-app-takeover-DUugSHjQ.js} +1 -1
- package/dist/client/assets/{use-automations-AJoQb6lP.js → use-automations-DOCjbfCs.js} +1 -1
- package/dist/client/assets/{use-autosave-C7ouSmgc.js → use-autosave-BpEFoeBr.js} +1 -1
- package/dist/client/assets/{use-chat-navigation-BVwgk2mi.js → use-chat-navigation-CmNsxQBq.js} +1 -1
- package/dist/client/assets/{use-clock-tick-B6NhSBfs.js → use-clock-tick-B2MqiplU.js} +1 -1
- package/dist/client/assets/{use-connect-companion-WJiOGzbb.js → use-connect-companion-DCgJdQ-W.js} +1 -1
- package/dist/client/assets/{use-connection-D8Z-oNDI.js → use-connection-BDpvwZcn.js} +1 -1
- package/dist/client/assets/{use-copy-KuwVRxCe.js → use-copy-_ycKA-XN.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-RCA64tHb.js → use-create-virtual-mcp-CXKmymqn.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-CeeB1a5i.js → use-date-fns-locale-fMKfOMsB.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CU9q8XT5.js → use-debounced-autosave-B9xt5l_2.js} +1 -1
- package/dist/client/assets/{use-debounced-value-B43T9Zwm.js → use-debounced-value-ByyoTH63.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BqmDR-Hh.js → use-deco-credits-CT_j_qxS.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-DrGKqtmd.js → use-decopilot-events-Bd-4vex6.js} +1 -1
- package/dist/client/assets/{use-delete-connection-dDlynrtq.js → use-delete-connection-DJ4nDOEg.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-XCC0klqS.js → use-deployment-admin-BoLt0KCx.js} +1 -1
- package/dist/client/assets/{use-ensure-project-folder-DzlO-RZu.js → use-ensure-project-folder-Dd1Qlz-V.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-CWuWJF_Z.js → use-fast-preview-draft-url-DZRNnF9t.js} +1 -1
- package/dist/client/assets/{use-file-configs-bBTy3-MH.js → use-file-configs-DgLGloNq.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-Bx08szbZ.js → use-infinite-scroll-F7T2FF-S.js} +1 -1
- package/dist/client/assets/{use-join-requests-9S6TcS4c.js → use-join-requests-DqXVwXAp.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-DYzUw0ny.js → use-main-panel-tabs-CAJkn_vg.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-x7_sjlLt.js → use-mcp-auth-status-2eKyky0r.js} +1 -1
- package/dist/client/assets/{use-mcp-client-fHTUkiQr.js → use-mcp-client-B333X4fs.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-BPRabyYT.js → use-mcp-prompts-P2KMjN9W.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D4mzKQtZ.js → use-mcp-tools-56vayh3K.js} +1 -1
- package/dist/client/assets/{use-members-CKWy7WEt.js → use-members-DfdZqgw8.js} +1 -1
- package/dist/client/assets/{use-mobile-BZpAUwUb.js → use-mobile-hkvDmO1w.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-CsnmgB4q.js → use-navigate-to-agent-Dzg43OKn.js} +1 -1
- package/dist/client/assets/{use-open-billing-url-DJ2g56mK.js → use-open-billing-url-DJYL8W0U.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-g30TuQtQ.js → use-org-auth-client-DROvF2zH.js} +1 -1
- package/dist/client/assets/{use-org-fs-zGIV3ymG.js → use-org-fs-D6VAaLCr.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-DJQrhGC0.js → use-org-repo-syncs-DlDJxigu.js} +1 -1
- package/dist/client/assets/{use-org-sso-BrvNWA5X.js → use-org-sso-CH28wOEA.js} +1 -1
- package/dist/client/assets/{use-organization-roles-BJUlrG6W.js → use-organization-roles-BQ-3VnZ-.js} +1 -1
- package/dist/client/assets/{use-organization-settings-PcDKDabM.js → use-organization-settings-DxTssZLI.js} +1 -1
- package/dist/client/assets/{use-panel-navigate-CtG66pHN.js → use-panel-navigate-C2cHRlDL.js} +1 -1
- package/dist/client/assets/{use-project-native-view-presence-BK8YOIZ_.js → use-project-native-view-presence-bO2szMt1.js} +1 -1
- package/dist/client/assets/{use-project-scope-BIaj1klw.js → use-project-scope-BROCSZWk.js} +1 -1
- package/dist/client/assets/{use-recent-apps-CdBePM46.js → use-recent-apps-DhLr7_TT.js} +1 -1
- package/dist/client/assets/{use-releases-DiKuK1Mb.js → use-releases-D6ba4LWy.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-DtOFbpHG.js → use-reports-diagnostic-BYrSJ1-D.js} +1 -1
- package/dist/client/assets/{use-secrets-D1EjKfHx.js → use-secrets-znuJNv0F.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-BN73lsUn.js → use-section-preview-base-CDeugTlj.js} +1 -1
- package/dist/client/assets/{use-tags-DDnWaRyr.js → use-tags-frFveynu.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-V9Yyqptm.js → use-task-board-analytics-BLvo5Ioy.js} +1 -1
- package/dist/client/assets/{use-task-board-events-DqUxpNCB.js → use-task-board-events-BNCUuZ7v.js} +1 -1
- package/dist/client/assets/{use-task-board-item-prs-DPUdXNI8.js → use-task-board-item-prs-C03gSLLs.js} +1 -1
- package/dist/client/assets/{use-task-board-items-DfmdtmUR.js → use-task-board-items-gTQZEpDz.js} +1 -1
- package/dist/client/assets/{use-task-metadata-SrtBAv_N.js → use-task-metadata-D3ZyQdu3.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-BqRwNmrL.js → use-thread-analytics-pc4Cx2fq.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-2RD7K4aK.js → use-thread-outputs-BwFYAN97.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-Z8R3F4Sd.js +1 -0
- package/dist/client/assets/{useQueries-CMBL6J0M.js → useQueries-6AB3hL0G.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CccYtrDO.js +1 -0
- package/dist/client/assets/{users-RLZYAcjM.js → users-DsZm3Nkx.js} +1 -1
- package/dist/client/assets/{utils-Bah7tk6F.js → utils-D-T02kS4.js} +1 -1
- package/dist/client/assets/{variant-calendar-BZG4h9lN.js → variant-calendar-DoUmbH6Q.js} +1 -1
- package/dist/client/assets/{variant-draft-pointer-DT29gOvh.js → variant-draft-pointer-CGTqYMj8.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-yaAep4gO.js → view-mode-toggle-BM2WBWnv.js} +1 -1
- package/dist/client/assets/{virtual-mcp-D15uuHwT.js → virtual-mcp-CM_cNcV_.js} +1 -1
- package/dist/client/assets/{watch-sse-pool-L6MF8kFC.js → watch-sse-pool-C1f9T3Cq.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/server.js +90 -90
- package/package.json +1 -1
- package/dist/client/assets/agent-app-Cfg8VckH.js +0 -1
- package/dist/client/assets/agent-deck-BQQbY7E3.js +0 -1
- package/dist/client/assets/agent-library-BylK2zbQ.js +0 -1
- package/dist/client/assets/agent-library-file-UJX_CJPE.js +0 -1
- package/dist/client/assets/agent-settings-CAn29x6c.js +0 -1
- package/dist/client/assets/agent-site-editor-code-BpIt4X2L.js +0 -2
- package/dist/client/assets/agent-site-editor-content-CvTjIocG.js +0 -1
- package/dist/client/assets/agent-site-editor-preview--T44KtQU.js +0 -1
- package/dist/client/assets/agent-view-DR2yinn0.js +0 -1
- package/dist/client/assets/api-keys-VLrtxsCT.js +0 -1
- package/dist/client/assets/cms-settings-editor-uacj7_T7.js +0 -1
- package/dist/client/assets/flat-project-ip4875AZ.js +0 -1
- package/dist/client/assets/library-Dlw_lQxg.js +0 -1
- package/dist/client/assets/project-reports-_eyjOX3a.js +0 -1
- package/dist/client/assets/project-tasks-CfNO6dF5.js +0 -1
- package/dist/client/assets/record-editor-BObs3Wz8.js +0 -1
- package/dist/client/assets/reports-CnLAzSP2.js +0 -1
- package/dist/client/assets/route-Bn0LVuA1.js +0 -1
- package/dist/client/assets/site-editor-CDgaCne6.js +0 -1
- package/dist/client/assets/taskboard-analytics-DVcpMrVf.js +0 -1
- package/dist/client/assets/tasks-DfBffVse.js +0 -1
- package/dist/client/assets/useInfiniteQuery-B6mFaUqW.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CPzW-hST.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aF as ve,cY as Oe,cW as Me,aG as de,bW as ze,c as U,b as V,j as t,h as Ne,B,r as X,l as Se,a2 as te,a9 as Ee,R as me,K as ee,d as se,x as ye,au as _e,eU as Re,b1 as Ue,n as Fe,fF as ue,a1 as Ve,I as J,X as Le,T as Be,V as qe,U as xe,H as Ge,f as He,fO as Ke,o as We,aE as Xe,aD as Qe,t as Y}from"./index-B-eHj4u4.js";import{g as Ye}from"./extract-connection-data-B_Afz4nk.js";import{E as Ce}from"./empty-state-Ba3qMun8.js";import{E as Je,r as Ze,b as et,c as tt}from"./connection-form-helpers-DX9VWFYw.js";import{c as st,S as nt,D as it}from"./index-kBSJcstK.js";import{u as we,T as ot}from"./use-mcp-auth-status-x7_sjlLt.js";import{a as at}from"./use-members-CKWy7WEt.js";import{A as lt}from"./avatar-D-6InH0Y.js";import{a as rt}from"./mcp-oauth-BDYmNGyy.js";import{I as ae}from"./integration-icon-DKhUl3mk.js";import{s as ct}from"./Plus-FrFsiUQv.js";import{bh as dt,aC as mt,ay as ut,q as ne}from"./agent-icon-E5NFjGaq.js";import{a as ke,e as xt,s as pt}from"./Tool01-Ceiq1yQg.js";import{s as re}from"./Trash01-QaBoOmQD.js";import{b as ft,a as ht,c as gt,S as jt,d as bt}from"./sheet-DcLd8f_T.js";import{F as G,b as H,c as K,d as L,f as W,e as vt,a as Nt}from"./form-lTigv9Cm.js";import{a as Ie,b as Te,u as St}from"./use-connection-D8Z-oNDI.js";import{u as Ae}from"./use-mcp-client-fHTUkiQr.js";import{u as yt}from"./use-mcp-tools-D4mzKQtZ.js";import{a as _t}from"./use-mcp-prompts-BPRabyYT.js";import{i as Ct}from"./mcp-oauth-BFMHXWCx.js";import{u as wt,D as kt}from"./use-delete-connection-dDlynrtq.js";import{c as It}from"./monitoring-stats-row-yTtrPgRB.js";import{d as Tt,C as At,a as Pt}from"./chart-CArQDy5U.js";import{B as Dt,a as $t}from"./BarChart-IN_s5p-k.js";import{C as Ot}from"./tooltipContext-BSZQ5pEw.js";import{b as Mt}from"./repository-binding-CVI26IB4.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-Mabj7P4A.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Rt}from"./ShoppingBag01-B47bYriG.js";import{g as ce}from"./types-C9g69UXw.js";import{M as Ut}from"./mcp-app-renderer-DJ3cRpmT.js";import{C as Ft}from"./collection-search-BzGtQCoT.js";import{B as Vt}from"./badge-sJYWVYje.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-Be8KEqhq.js";import{i as Lt}from"./CheckCircle-BRmDGKsS.js";import{t as Bt}from"./ChevronUp-B7Vn1Rb2.js";import{n as qt}from"./LinkBroken01-B4m_6hKA.js";import{c as Gt}from"./UserSquare-C1l8QNgE.js";import{s as Ht}from"./XClose-CDVFbEme.js";import{p as Kt,i as Wt}from"./connection-BzAtvzSu.js";import{c as Xt}from"./schema-DDS90txY.js";import"./metadata-D72DunRR.js";import"./Key01-BnDtFdB6.js";import"./auth-3_xtjhZa.js";import"./index-BrYnrqwa.js";import"./index-UJRTDiss.js";import"./index-BdQq_4o_.js";import"./index-CWGftR7V.js";import"./popover-DrRqLOLZ.js";import"./tooltip-Wg5TOkgk.js";import"./index-SEQedjDw.js";import"./SearchMd-CTE_Dij_.js";import"./use-mobile-BZpAUwUb.js";import"./use-create-virtual-mcp-RCA64tHb.js";import"./use-navigate-to-agent-CsnmgB4q.js";import"./thread-intent-2PQ2tJ8y.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-L6MF8kFC.js";import"./task-board-BDqVuMua.js";import"./schema-CYEVNkkO.js";import"./slugify-CEUa2lfQ.js";import"./Image01-BcbXjZdM.js";import"./use-org-auth-client-g30TuQtQ.js";import"./User01-DowUGIml.js";import"./AlertCircle-CxMEbIvM.js";import"./ArrowUp-BseWcDxZ.js";import"./ArrowLeft-ChZ5XGHH.js";import"./ZoomOut-0IXFhA1q.js";import"./Building02-BCzHZCeO.js";import"./ChevronSelectorVertical-DXUxjCek.js";import"./Copy01-BeZeYuYP.js";import"./CreditCard01-CR3uiUwh.js";import"./DotsVertical-C85_hpnn.js";import"./Globe04-DTEEsJ26.js";import"./SwitchHorizontal01-B8pZTGji.js";import"./Link01-CeBVtW9F.js";import"./Monitor01-DluZDvx0.js";import"./Sun-BADHqp_z.js";import"./Play-C67yELx6.js";import"./Upload01-CfxF6ZJF.js";import"./Users01-BvAfz3hH.js";import"./label-Hktokb9g.js";import"./alert-dialog-BY83tkfe.js";import"./AreaChart-BgtEgMgW.js";import"./CategoricalChart-CN6eSF60.js";import"./XAxis-DQTb2U_R.js";import"./symbol-BfV3FsI2.js";import"./ActiveShapeUtils-Dpaml8J5.js";import"./Sector-DpVhdPl7.js";import"./ErrorBarContext-dTYYBaMt.js";import"./url-slug-CWeO_dvk.js";const Qt=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:Qt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=V();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,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 N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(re,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==b?(E=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:z}),e[47]=T,e[48]=S,e[49]=b,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=V();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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=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:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,d=V();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 x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(ct,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(X.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.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:o}=s,i=V(),l=Ee(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=It(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=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")})]})]}),f?t.jsxs("div",{children:[t.jsx(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:x,barCategoryGap:"4%",children:[t.jsx(At,{content:t.jsx(Pt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.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:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.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")})}),m.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:m.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=V(),[o,i]=X.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,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]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=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]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(X.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,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 a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=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(_e,{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]!==a||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:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=V(),{org:o}=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=Mt(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}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]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=V(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=X.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const z=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(X.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Ut,{resourceURI:z,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(ot,{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]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}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"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=V(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,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 N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let F;e[18]!==I?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=F):F=e[19];let Q;return e[20]!==k||e[21]!==F?(Q=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,F]}),e[20]=k,e[21]=F,e[22]=Q):Q=e[22],Q}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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(v.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(xt,{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(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=N&&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]=N,e[51]=l,e[52]=n,e[53]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,b,z,M,R]})}),e[62]=T,e[63]=b,e[64]=z,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}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(ut,{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(Rt,{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(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Fe.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ve(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(e.connection_url):null;return x?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")})]}),f&&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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:m})=>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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{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(L,{children:t.jsx(J,{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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{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(qt,{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(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:m})=>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(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),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:m})=>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(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>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(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>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(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:m})=>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(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:m})=>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(Le,{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(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(pt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(vt,{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(W,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(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"&&Wt(s.connection_headers)){const c=s.connection_headers,o=Ze(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:o}}const i=_s(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:o}}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 Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=tt(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&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=We(),x=Te(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=X.useState(null),[j,N]=X.useState(!1),_=we({connectionId:e}),{data:y}=at(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=st(P,Yt),S=Xe({resolver:Qe(Xt),values:be(h??s)}),b=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},E=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:F}=await rt({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(F||!k){Y.error(r("details.connection.authFailed",{error:F??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const Q=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...m}),t.jsx(ft,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{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(lt,{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(Nt,{...S,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:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(W,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(W,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,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:z,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:E,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,F=Ye("conn");await x.create.mutateAsync({id:F,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const Q=new URL(`/api/${f.slug}/mcp/${F}`,window.location.origin),Z=await Ct({url:Q.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),e=V();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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=He(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=St(d),[x,f]=X.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=yt(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Ke($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let z;s[16]!==b?(z=b.map(Is),s[16]=b,s[17]=z):z=s[17];const E=z;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,s[41]=u,s[42]=M):M=s[42],M}function Is(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(X.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(ks,{})})}),s[0]=e):e=s[0],e}function Ni(){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{Ni as default};
|
|
1
|
+
import{aF as ve,cY as Oe,cW as Me,aG as de,bW as ze,c as U,b as V,j as t,h as Ne,B,r as X,l as Se,a2 as te,a9 as Ee,R as me,K as ee,d as se,x as ye,au as _e,eU as Re,b1 as Ue,n as Fe,fF as ue,a1 as Ve,I as J,X as Le,T as Be,V as qe,U as xe,H as Ge,f as He,fO as Ke,o as We,aE as Xe,aD as Qe,t as Y}from"./index-BlWeDA0T.js";import{g as Ye}from"./extract-connection-data-B2gWRdBp.js";import{E as Ce}from"./empty-state-ChkfcEnf.js";import{E as Je,r as Ze,b as et,c as tt}from"./connection-form-helpers-a4JD1Ns8.js";import{c as st,S as nt,D as it}from"./index-D1I5UKBv.js";import{u as we,T as ot}from"./use-mcp-auth-status-2eKyky0r.js";import{a as at}from"./use-members-DfdZqgw8.js";import{A as lt}from"./avatar-Bp-EkB-V.js";import{a as rt}from"./mcp-oauth-Wpa3RhmZ.js";import{I as ae}from"./integration-icon-BRfynNZ5.js";import{s as ct}from"./Plus-DBwsZRbL.js";import{bh as dt,aC as mt,ay as ut,q as ne}from"./agent-icon-Cwi3uRdu.js";import{a as ke,e as xt,s as pt}from"./Tool01-BYtrXXg0.js";import{s as re}from"./Trash01-DmGIq4LE.js";import{b as ft,a as ht,c as gt,S as jt,d as bt}from"./sheet-2W5SODwA.js";import{F as G,b as H,c as K,d as L,f as W,e as vt,a as Nt}from"./form-DDdiF5DN.js";import{a as Ie,b as Te,u as St}from"./use-connection-BDpvwZcn.js";import{u as Ae}from"./use-mcp-client-B333X4fs.js";import{u as yt}from"./use-mcp-tools-56vayh3K.js";import{a as _t}from"./use-mcp-prompts-P2KMjN9W.js";import{i as Ct}from"./mcp-oauth-CbRV1ySf.js";import{u as wt,D as kt}from"./use-delete-connection-DJ4nDOEg.js";import{c as It}from"./monitoring-stats-row-BBfe42aa.js";import{d as Tt,C as At,a as Pt}from"./chart-Bv9NYntf.js";import{B as Dt,a as $t}from"./BarChart-B7UShXEl.js";import{C as Ot}from"./tooltipContext-BWgKo-Vc.js";import{b as Mt}from"./repository-binding-Ds0zXEVH.js";import{T as ie,a as zt,c as oe,b as Et}from"./tabs-CtKgNHMr.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Rt}from"./ShoppingBag01-FE4oAEwY.js";import{g as ce}from"./types-C4NGZqb0.js";import{M as Ut}from"./mcp-app-renderer-BdWVQtZT.js";import{C as Ft}from"./collection-search-mDMHjO22.js";import{B as Vt}from"./badge-BIePf0xK.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-B54nmexC.js";import{i as Lt}from"./CheckCircle-DIUFnJQp.js";import{t as Bt}from"./ChevronUp-C9gm2RHA.js";import{n as qt}from"./LinkBroken01-D4fcNp0y.js";import{c as Gt}from"./UserSquare-B3hi5v4G.js";import{s as Ht}from"./XClose-D_NlSxSm.js";import{p as Kt,i as Wt}from"./connection-CXmYeQRu.js";import{c as Xt}from"./schema-D-34ICTJ.js";import"./metadata-D72DunRR.js";import"./Key01-D7fc2of0.js";import"./auth-d1Zn25hw.js";import"./index-BOey0PQ3.js";import"./index-BuXV8w2T.js";import"./index-BdQq_4o_.js";import"./index-BHzdhQYD.js";import"./popover-C86-20Mm.js";import"./tooltip-B6W7NpVz.js";import"./index-DrHP_BcE.js";import"./SearchMd-Cz9CjV4u.js";import"./use-mobile-hkvDmO1w.js";import"./use-create-virtual-mcp-CXKmymqn.js";import"./use-navigate-to-agent-Dzg43OKn.js";import"./thread-intent-9GHukD-s.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-C1f9T3Cq.js";import"./task-board-C00mxWAh.js";import"./schema-DO5D2eCO.js";import"./slugify-CEUa2lfQ.js";import"./Image01-LmX-9DTg.js";import"./use-org-auth-client-DROvF2zH.js";import"./User01-DxYW6D1x.js";import"./AlertCircle-BugQG9bV.js";import"./ArrowUp-BM60-fZY.js";import"./ArrowLeft-BsOtfvqw.js";import"./ZoomOut-BpMDqvoU.js";import"./Building02-DqK4SREZ.js";import"./ChevronSelectorVertical-CRMiEVEY.js";import"./Copy01-BrqDGrTX.js";import"./CreditCard01-C7MhbtAI.js";import"./DotsVertical-DjBJNxxU.js";import"./Globe04-Bi1qDXFD.js";import"./SwitchHorizontal01-BLoNOmQx.js";import"./Link01-UOxGnkqg.js";import"./Monitor01-zCUpqs5C.js";import"./Sun-lUDK8Dny.js";import"./Play-BaMMHzUS.js";import"./Upload01-B1KubIEG.js";import"./Users01-Dg9yGM1q.js";import"./label-CCf767lm.js";import"./alert-dialog-Cww2cCKj.js";import"./AreaChart-C2JGxQiA.js";import"./CategoricalChart-B4irlNQB.js";import"./XAxis-BriqOO10.js";import"./symbol-CRqLTukg.js";import"./ActiveShapeUtils-BmpX0aJ4.js";import"./Sector-DRzP1YgK.js";import"./ErrorBarContext-Duc4DanJ.js";import"./url-slug-CCgQongS.js";const Qt=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:Qt}];function Jt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l}=s,a=V();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const d=we(r),x=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,f=n.status!=="active",m=x||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==m?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",m),e[2]=m,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 N;e[9]!==n.status||e[10]!==f||e[11]!==x||e[12]!==a?(N=x?t.jsx("span",{className:"text-xs text-destructive font-medium",children:a("details.connectionInstancesPanel.needsAuthorization")}):f?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?a("details.connectionInstancesPanel.disabledError"):a("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=f,e[11]=x,e[12]=a,e[13]=N):N=e[13];let _;e[14]!==j||e[15]!==N?(_=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,N]}),e[14]=j,e[15]=N,e[16]=_):_=e[16];let y;e[17]!==n||e[18]!==x||e[19]!==o||e[20]!==a?(y=x&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>o(n),children:a("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=x,e[19]=o,e[20]=a,e[21]=y):y=e[21];let C;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==a?(C=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(dt,{size:13}),a("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:a("details.connectionInstancesPanel.disable"),"aria-label":a("details.connectionInstancesPanel.disable"),children:t.jsx(mt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=a,e[26]=C):C=e[26];let D;e[27]!==n||e[28]!==c?(D=()=>c(n),e[27]=n,e[28]=c,e[29]=D):D=e[29];let w;e[30]!==a?(w=a("details.connectionInstancesPanel.configure"),e[30]=a,e[31]=w):w=e[31];let $;e[32]!==a?($=a("details.connectionInstancesPanel.configure"),e[32]=a,e[33]=$):$=e[33];let O;e[34]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(ke,{size:13}),e[34]=O):O=e[34];let P;e[35]!==D||e[36]!==w||e[37]!==$?(P=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D,title:w,"aria-label":$,children:O}),e[35]=D,e[36]=w,e[37]=$,e[38]=P):P=e[38];let T;e[39]!==n||e[40]!==i?(T=()=>i(n),e[39]=n,e[40]=i,e[41]=T):T=e[41];let S;e[42]!==a?(S=a("details.connectionInstancesPanel.delete"),e[42]=a,e[43]=S):S=e[43];let b;e[44]!==a?(b=a("details.connectionInstancesPanel.delete"),e[44]=a,e[45]=b):b=e[45];let z;e[46]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx(re,{size:13}),e[46]=z):z=e[46];let E;e[47]!==T||e[48]!==S||e[49]!==b?(E=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:T,title:S,"aria-label":b,children:z}),e[47]=T,e[48]=S,e[49]=b,e[50]=E):E=e[50];let M;e[51]!==P||e[52]!==E||e[53]!==y||e[54]!==C?(M=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,C,P,E]}),e[51]=P,e[52]=E,e[53]=y,e[54]=C,e[55]=M):M=e[55];let A;return e[56]!==M||e[57]!==h||e[58]!==g||e[59]!==_?(A=t.jsxs("div",{className:h,children:[g,_,M]}),e[56]=M,e[57]=h,e[58]=g,e[59]=_,e[60]=A):A=e[60],A}function Zt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,o=V();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 a;e[5]!==n||e[6]!==c?(a=()=>c(n),e[5]=n,e[6]=c,e[7]=a):a=e[7];let r;e[8]!==o?(r=o("details.connectionInstancesPanel.configure"),e[8]=o,e[9]=r):r=e[9];let d;e[10]!==o?(d=o("details.connectionInstancesPanel.configure"),e[10]=o,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(ke,{size:13}),e[12]=u):u=e[12];let x;e[13]!==a||e[14]!==r||e[15]!==d?(x=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:a,title:r,"aria-label":d,children:u})}),e[13]=a,e[14]=r,e[15]=d,e[16]=x):x=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==x?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,x]}),e[17]=i,e[18]=l,e[19]=x,e[20]=f):f=e[20],f}function es(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l,onAdd:a,isAdding:r}=s,d=V();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 x;e[3]!==u?(x=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=x):x=e[4];let f;e[5]!==r?(f=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(ct,{size:13}),e[5]=r,e[6]=f):f=e[6];let m;e[7]!==d?(m=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=m):m=e[8];let h;e[9]!==r||e[10]!==a||e[11]!==f||e[12]!==m?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:a,disabled:r,children:[f,m]}),e[9]=r,e[10]=a,e[11]=f,e[12]=m,e[13]=h):h=e[13];let g;e[14]!==x||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[x,h]}),e[14]=x,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==o||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==o||e[24]!==c||e[25]!==i||e[26]!==l?(y=C=>t.jsx(X.Suspense,{fallback:t.jsx(Zt,{instance:C,onConfigure:c}),children:t.jsx(Jt,{instance:C,onConfigure:c,onAuthenticate:o,onDelete:i,onToggleStatus:l})},C.id),e[23]=o,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],j=n.map(y),e[17]=n,e[18]=o,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let N;e[28]!==j?(N=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=N):N=e[29];let _;return e[30]!==g||e[31]!==N?(_=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,N]}),e[30]=g,e[31]=N,e[32]=_):_=e[32],_}function ts(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const o=(c.errorMessage??"").trim()||"Unknown error";n.set(o,(n.get(o)??0)+1)}return[...n.entries()].map(([c,o])=>({message:c,count:o})).sort((c,o)=>o.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:o}=s,i=V(),l=Ee(),a=ns(o),{data:r}=me({queryKey:ee.connectionActivity(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,o,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:a.startDate.toISOString(),endDate:a.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=It(r?.logs??[],a,void 0,r?.total,d?.total),x=u.data,f=u.totalCalls>0,m=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")})]})]}),f?t.jsxs("div",{children:[t.jsx(Tt,{config:is,className:"h-16 w-full",children:t.jsxs(Dt,{data:x,barCategoryGap:"4%",children:[t.jsx(At,{content:t.jsx(Pt,{labelFormatter:rs}),cursor:{fill:"var(--muted)"}}),t.jsx($t,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:x.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:x[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:x[x.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")})}),m.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:m.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=V(),[o,i]=X.useState("14d"),{org:l}=te();let a;e[0]!==c?(a=c("details.connectionActivity.activity"),e[0]=c,e[1]=a):a=e[1];let r;e[2]!==a?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:a})}),e[2]=a,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]!==o?(u=ss.map(j=>t.jsx("button",{type:"button","aria-pressed":o===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",o===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=o,e[7]=u):u=e[7];let x;e[8]!==d||e[9]!==u?(x=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]=x):x=e[10];let f;e[11]!==r||e[12]!==x?(f=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,x]}),e[11]=r,e[12]=x,e[13]=f):f=e[13];let m;e[14]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(cs,{}),e[14]=m):m=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==o?(h=t.jsx(X.Suspense,{fallback:m,children:t.jsx(os,{connectionId:n,orgId:l.id,timeframe:o})}),e[15]=n,e[16]=l.id,e[17]=o,e[18]=h):h=e[18];let g;return e[19]!==f||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[f,h]}),e[19]=f,e[20]=h,e[21]=g):g=e[21],g}function ms(s){const e=U.c(15),{virtualMcp:n,org:c}=s,o=se();let i;e[0]!==o||e[1]!==c||e[2]!==n.id?(i=()=>{const x=crypto.randomUUID();o({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:x}})},e[0]=o,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 a;e[5]!==n.icon||e[6]!==n.title?(a=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=a):a=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(_e,{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]!==a||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:[a,r,d]}),e[11]=i,e[12]=a,e[13]=r,e[14]=u):u=e[14],u}function us(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let o;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=a=>t.jsx(ms,{virtualMcp:a,org:c},a.id),e[3]=c,e[4]=l):l=e[4],o=n.map(l),e[0]=c,e[1]=n,e[2]=o}else o=e[2];let i;return e[5]!==o?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:o})}),e[5]=o,e[6]=i):i=e[6],i}function xs(s){const e=U.c(13),{connection:n}=s,c=V(),{org:o}=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=Mt(i);if(!(l.length>0)){let f;return e[2]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(t.Fragment,{}),e[2]=f):f=e[2],f}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]!==o.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(us,{virtualMcps:l,org:o.slug})}),e[7]=o.slug,e[8]=l,e[9]=u):u=e[9];let x;return e[10]!==d||e[11]!==u?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=x):x=e[12],x}function ps(s){const e=U.c(35),{tools:n,connectionId:c,org:o}=s,i=V(),l=se(),{org:a}=te();let r;e[0]!==c||e[1]!==a.id||e[2]!==a.slug?(r={connectionId:c,orgId:a.id,orgSlug:a.slug},e[0]=c,e[1]=a.id,e[2]=a.slug,e[3]=r):r=e[3];const d=Ae(r),u=Ie(c);let x;e[4]!==u||e[5]!==c?(x=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=x):x=e[6];const f=x,[m,h]=X.useState("");let g,j,N,_;if(e[7]!==f||e[8]!==d||e[9]!==l||e[10]!==o||e[11]!==m||e[12]!==i||e[13]!==n){const D=(n??[]).filter(fs),w=m.toLowerCase().trim(),$=w?D.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):D;let O;e[18]!==f||e[19]!==l||e[20]!==o?(O=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:o,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=f,e[19]=l,e[20]=o,e[21]=O):O=e[21];const P=O;N="flex flex-col h-full overflow-hidden";let T;e[22]!==i?(T=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=T):T=e[23];let S;e[24]===Symbol.for("react.memo_cache_sentinel")?(S=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=S):S=e[24],e[25]!==m||e[26]!==T?(_=t.jsx(Ft,{value:m,onChange:h,placeholder:T,onKeyDown:S}),e[25]=m,e[26]=T,e[27]=_):_=e[27],g="flex-1 overflow-auto p-5",j=$.length===0?t.jsx(Ce,{image:null,title:i(m?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(m?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:$.map(b=>{const z=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>P(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(X.Suspense,{fallback:t.jsx(Ue,{className:"h-full w-full"}),children:t.jsx(Ut,{resourceURI:z,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(ot,{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]=f,e[8]=d,e[9]=l,e[10]=o,e[11]=m,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=N,e[17]=_}else g=e[14],j=e[15],N=e[16],_=e[17];let y;e[28]!==g||e[29]!==j?(y=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=y):y=e[30];let C;return e[31]!==N||e[32]!==_||e[33]!==y?(C=t.jsxs("div",{className:N,children:[_,y]}),e[31]=N,e[32]=_,e[33]=y,e[34]=C):C=e[34],C}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"]),o=e.map(n),i=e[e.length-1];return o.length>=2&&i&&c.has(i)?[o.pop(),...o].join(" "):o.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let o;e[0]!==n||e[1]!==c?(o=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=o):o=e[2];let i;return e[3]!==o?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:o})}),e[3]=o,e[4]=i):i=e[4],i}function hs(s){const e=U.c(68),{tools:n,prompts:c,resources:o,connectionId:i,org:l}=s,a=c===void 0?je:c,r=o===void 0?je:o,d=V(),u=se(),x=Ie(i??"");let f;e[0]!==x||e[1]!==i?(f=x?Pe(x):i,e[0]=x,e[1]=i,e[2]=f):f=e[2];const m=f;let h;e[3]!==m||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(k){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:m,collectionName:"tools",itemId:encodeURIComponent(k)}})},e[3]=m,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 N=j;if(n.length+a.length+r.length===0){let v;e[12]!==d?(v=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=v):v=e[13];let k;e[14]!==v?(k=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:v}),e[14]=v,e[15]=k):k=e[15];let I;e[16]!==d?(I=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=I):I=e[17];let F;e[18]!==I?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:I}),e[18]=I,e[19]=F):F=e[19];let Q;return e[20]!==k||e[21]!==F?(Q=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[k,F]}),e[20]=k,e[21]=F,e[22]=Q):Q=e[22],Q}let y;e[23]!==d||e[24]!==n.length?(y=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=y):y=e[25];let C;e[26]!==y?(C=t.jsx(ie,{value:"tools",variant:"underline",children:y}),e[26]=y,e[27]=C):C=e[27];let D;e[28]!==N||e[29]!==d?(D=N&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=N,e[29]=d,e[30]=D):D=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let $;e[33]!==w?($=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=$):$=e[34];let O;e[35]!==d?(O=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=O):O=e[36];let P;e[37]!==O?(P=t.jsx(ie,{value:"resources",variant:"underline",children:O}),e[37]=O,e[38]=P):P=e[38];let T;e[39]!==$||e[40]!==P||e[41]!==C||e[42]!==D?(T=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(zt,{variant:"underline",className:"gap-1",children:[C,D,$,P]})}),e[39]=$,e[40]=P,e[41]=C,e[42]=D,e[43]=T):T=e[43];let S;e[44]!==g||e[45]!==n?(S=n.length>0?n.map(v=>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(v.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(xt,{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(v.name)}),v.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:v.description})]}),t.jsx(_e,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},v.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=S):S=e[46];let b;e[47]!==S?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:S})}),e[47]=S,e[48]=b):b=e[48];let z;e[49]!==i||e[50]!==N||e[51]!==l||e[52]!==n?(z=N&&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]=N,e[51]=l,e[52]=n,e[53]=z):z=e[53];let E;e[54]!==a?(E=a.length>0?a.map(js):t.jsx(le,{label:"prompts"}),e[54]=a,e[55]=E):E=e[55];let M;e[56]!==E?(M=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[56]=E,e[57]=M):M=e[57];let A;e[58]!==r?(A=r.length>0?r.map(gs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=A):A=e[59];let R;e[60]!==A?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=R):R=e[61];let p;return e[62]!==T||e[63]!==b||e[64]!==z||e[65]!==M||e[66]!==R?(p=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Et,{defaultValue:"tools",variant:"underline",children:[T,b,z,M,R]})}),e[62]=T,e[63]=b,e[64]=z,e[65]=M,e[66]=R,e[67]=p):p=e[67],p}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(ut,{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(Rt,{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(13),{connection:n,displayTitle:c}=s,o=c??n.title;let i;e[0]!==n.icon||e[1]!==o?(i=t.jsx(ae,{icon:n.icon,name:o,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=o,e[2]=i):i=e[2];let l;e[3]!==o?(l=t.jsx(Fe.Title,{children:o}),e[3]=o,e[4]=l):l=e[4];let a;e[5]!==n.description?(a=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=a):a=e[6];let r;e[7]!==l||e[8]!==a?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,a]}),e[7]=l,e[8]=a,e[9]=r):r=e[9];let d;return e[10]!==i||e[11]!==r?(d=t.jsxs("div",{className:"flex items-center px-4 md:px-8 bg-background border-b border-border shrink-0 gap-3 py-4",children:[i,r]}),e[10]=i,e[11]=r,e[12]=d):d=e[12],d}function Ns({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:o}){const i=V(),l=ue({control:s.control,name:"ui_type"}),a=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ve(),d=(()=>{if(typeof a!="string"||!a)return!1;try{const m=new URL(a);return m.hostname==="api.githubcopilot.com"&&m.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",f=x?Kt(e.connection_url):null;return x?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")})]}),f&&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:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:m})=>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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{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(L,{children:t.jsx(J,{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:m.value,onValueChange:m.onChange,children:[t.jsx(L,{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(qt,{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(Gt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:m})=>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(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),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:m})=>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(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:m})=>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(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:m})=>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(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:m})=>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(L,{children:t.jsx(Je,{value:m.value??[],onChange:m.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:m})=>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(Le,{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(Vt,{variant:"success",className:"gap-1.5",children:[t.jsx(Lt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Bt,{size:12})]})})}),t.jsxs(qe,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(pt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:o,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&m.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:()=>m.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity rounded-lg",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...m,value:m.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(vt,{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(W,{})]})})]})}function Ss(s){return s.command==="npx"}function ys(s){return s.args?.find(e=>!e.startsWith("-"))??""}function _s(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"&&Wt(s.connection_headers)){const c=s.connection_headers,o=Ze(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:o}}const i=_s(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:o}}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 Cs(s){let e,n=null,c=!1,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=tt(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&&s.connection_token!==void 0,o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function ws({connection:s,connectionId:e,org:n,isUpdating:c,tools:o,prompts:i,resources:l,siblings:a}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=We(),x=Te(),{org:f}=te(),m=wt({onSuccess:()=>{a.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=X.useState(null),[j,N]=X.useState(!1),_=we({connectionId:e}),{data:y}=at(),C=y?.data?.members??[],D=h??s,w=C.find(p=>p.userId===D.created_by),O=s?.connection_type==="VIRTUAL"||_.isAuthenticated,P={...s,tools:o},T=st(P,Yt),S=Xe({resolver:Qe(Xt),values:be(h??s)}),b=S.formState.isDirty,z=async()=>{if(!await S.trigger())return;const v=S.getValues(),k=Cs(v),I=h?.id??e;await x.update.mutateAsync({id:I,data:k}),S.reset(v)},E=()=>{S.reset(be(h??s))},M=async p=>{const v=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:k,tokenInfo:I,error:F}=await rt({connectionId:p,orgSlug:f.slug,...v?{scope:v}:{}});if(F||!k){Y.error(r("details.connection.authFailed",{error:F??""}));return}if(I)try{const Z=await fetch(`/api/${f.slug}/connections/${p}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:I.accessToken,refreshToken:I.refreshToken,expiresIn:I.expiresIn,scope:I.scope,clientId:I.clientId,clientSecret:I.clientSecret,tokenEndpoint:I.tokenEndpoint})});if(!Z.ok)console.error("Failed to save OAuth token:",await Z.text()),await x.update.mutateAsync({id:p,data:{connection_token:k}});else try{await x.update.mutateAsync({id:p,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Z){console.error("Error saving OAuth token:",Z),await x.update.mutateAsync({id:p,data:{connection_token:k}})}else await x.update.mutateAsync({id:p,data:{connection_token:k}});const Q=new URL(`/api/${f.slug}/mcp/${p}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>M(s.id),R=async()=>{try{const p=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!p.ok){const k=await p.text();Y.error(r("details.connection.failedRemoveOAuth",{error:k}));return}const v=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(v.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(p){console.error("Error removing OAuth token:",p),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...m}),t.jsx(ft,{open:h!==null,onOpenChange:p=>{p||g(null)},children:t.jsxs(ht,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(gt,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(jt,{className:"text-base",children:h?.title??s.title}),t.jsx(bt,{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(lt,{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(Nt,{...S,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:S.control,name:"title",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...p})}),t.jsx(W,{})]})}),t.jsx(G,{control:S.control,name:"description",render:({field:p})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...p,value:p.value||""})}),t.jsx(W,{})]})})]}),t.jsx(Ns,{form:S,connection:h??s,hasOAuthToken:_.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:S,hasMcpBinding:T,isMCPAuthenticated:O,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:A,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:z,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:E,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const p=h??s;g(null),m.requestDelete(p)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(vs,{connection:s,displayTitle:(()=>{const p=a[0]??s;return p.app_name?p.title.replace(/\s*\(\d+\)\s*$/,""):p.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:a,onConfigure:p=>g(p),onAuthenticate:p=>M(p.id),onDelete:p=>m.requestDelete(p),onToggleStatus:async(p,v)=>{try{await x.update.mutateAsync({id:p.id,data:{status:v}}),Y.success(r(v==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{N(!0);try{const p=a[0]??s,v=p.title.replace(/\s*\(\d+\)\s*$/,""),k=a.length+1,I=`${v} (${k})`,F=Ye("conn");await x.create.mutateAsync({id:F,title:I,description:p.description??null,connection_type:p.connection_type,connection_url:p.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:p.created_by,organization_id:p.organization_id,icon:p.icon??null,app_name:p.app_name??null,app_id:p.app_id??null,connection_headers:p.connection_headers??null,oauth_config:null,configuration_state:p.configuration_state??null,metadata:null,tools:null,bindings:null});const Q=new URL(`/api/${f.slug}/mcp/${F}`,window.location.origin),Z=await Ct({url:Q.href,token:null,orgId:f.id});Z.supportsOAuth&&!Z.isAuthenticated&&await M(F)}catch(p){console.error("Failed to add connection instance:",p),Y.error(r("details.connection.failedAddInstance"))}finally{N(!1)}}}),t.jsx(xs,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(hs,{tools:o,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ks(){const s=U.c(43),e=V();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 o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/settings/connections/$appSlug"},s[1]=o):o=s[1];const{appSlug:i,org:l}=He(o),{org:a}=te(),r=Te();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=St(d),[x,f]=X.useState(null),m=u.find(A=>A.id===x)??u[0]??null;m&&m.id!==x&&f(m.id);const h=m?.id??"",g=Ae({connectionId:h||null,orgId:a.id,orgSlug:a.slug});let j;s[4]!==g?(j={client:g},s[4]=g,s[5]=j):j=s[5];const{data:N}=yt(j),_=N?N.tools.map($s):(m?.tools??[]).map(Ds);let y;e:{if(u.length<=1){y=_;break e}const A=new Set,R=[],p=As;for(const v of u){const k=v.id===h?_:p(v.tools);for(const I of k)A.has(I.name)||(A.add(I.name),R.push(I))}y=R.length>0?R:_}const C=y;let D;s[6]!==g?(D={client:g},s[6]=g,s[7]=D):D=s[7];const{data:w}=_t(D);let $;s[8]!==g?($={client:g},s[8]=g,s[9]=$):$=s[9];const{data:O}=Ke($);let P;s[10]!==w?.prompts?(P=w?.prompts??[],s[10]=w?.prompts,s[11]=P):P=s[11];let T;s[12]!==P?(T=P.map(Ts),s[12]=P,s[13]=T):T=s[13];const S=T;let b;s[14]!==O?.resources?(b=O?.resources??[],s[14]=O?.resources,s[15]=b):b=s[15];let z;s[16]!==b?(z=b.map(Is),s[16]=b,s[17]=z):z=s[17];const E=z;if(!m){let A;s[18]!==e?(A=e("details.connection.notFoundTitle"),s[18]=e,s[19]=A):A=s[19];let R;s[20]!==e?(R=e("details.connection.notFoundDescription"),s[20]=e,s[21]=R):R=s[21];let p;s[22]!==c||s[23]!==l?(p=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[22]=c,s[23]=l,s[24]=p):p=s[24];let v;s[25]!==e?(v=e("details.connection.backButton"),s[25]=e,s[26]=v):v=s[26];let k;s[27]!==p||s[28]!==v?(k=t.jsx(B,{variant:"outline",onClick:p,children:v}),s[27]=p,s[28]=v,s[29]=k):k=s[29];let I;return s[30]!==A||s[31]!==R||s[32]!==k?(I=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Ce,{title:A,description:R,actions:k})}),s[30]=A,s[31]=R,s[32]=k,s[33]=I):I=s[33],I}let M;return s[34]!==r.update.isPending||s[35]!==C||s[36]!==m||s[37]!==h||s[38]!==l||s[39]!==S||s[40]!==E||s[41]!==u?(M=t.jsx(ws,{org:l,connection:m,connectionId:h,isUpdating:r.update.isPending,tools:C,prompts:S,resources:E,siblings:u}),s[34]=r.update.isPending,s[35]=C,s[36]=m,s[37]=h,s[38]=l,s[39]=S,s[40]=E,s[41]=u,s[42]=M):M=s[42],M}function Is(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(X.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(ks,{})})}),s[0]=e):e=s[0],e}function Ni(){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{Ni as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as A,j as c,I as T,B as N}from"./index-
|
|
1
|
+
import{c as A,j as c,I as T,B as N}from"./index-BlWeDA0T.js";import{s as H}from"./Plus-DBwsZRbL.js";import{s as S}from"./Trash01-DmGIq4LE.js";function V(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(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function $(n){const e=A.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:k}=n,p=o===void 0?"VARIABLE_NAME":o,h=s===void 0?"value...":s;let _;e[0]!==r||e[1]!==t?(_=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=_):_=e[2];const C=_;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((u,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const v=x;let b;e[6]!==r||e[7]!==t?(b=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:u,value:a.value},r(i))},e[6]=r,e[7]=t,e[8]=b):b=e[8];const y=b;let P;e[9]!==r||e[10]!==t?(P=(l,u)=>{const i=[...t],a=i[l];a&&(i[l]={key:a.key,value:u},r(i))},e[9]=r,e[10]=t,e[11]=P):P=e[11];const g=P;let f;if(e[12]!==y||e[13]!==v||e[14]!==g||e[15]!==p||e[16]!==t||e[17]!==h){let l;e[19]!==y||e[20]!==v||e[21]!==g||e[22]!==p||e[23]!==h?(l=(u,i)=>c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(T,{placeholder:p,value:u.key,onChange:a=>y(i,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),c.jsx(T,{type:V(u.key)?"password":"text",placeholder:h,value:u.value,onChange:a=>g(i,a.target.value),className:"h-10 rounded-lg flex-1"}),c.jsx(N,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>v(i),children:c.jsx(S,{size:16})})]},i),e[19]=y,e[20]=v,e[21]=g,e[22]=p,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=y,e[13]=v,e[14]=g,e[15]=p,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=c.jsx(H,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==C?(d=c.jsxs(N,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:C,children:[w,"Add Environment Variable"]}),e[26]=C,e[27]=d):d=e[27];let m;e[28]!==f||e[29]!==d?(m=c.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=m):m=e[30];let E;return e[31]!==k||e[32]!==m?(E=c.jsx("div",{className:k,children:m}),e[31]=k,e[32]=m,e[33]=E):E=e[33],E}function R(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function K(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function j(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 W(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 o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function B(n){const{uiType:e}=n,t=j(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===j("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 G(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=j(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(p=>j(p.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function U(n,e){const t={command:"npx",args:["-y",n]},r=R(e);return Object.keys(r).length>0&&(t.envVars=r),t}function M(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=R(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{$ as E,G as a,U as b,M as c,B as i,W as p,K as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as z,c as W,b as te,j as t,B as L,h as de,l as he,U as ie,v as ke,aM as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as qe,H as Ge,a2 as Me,d as $e,u as Qe,a as Oe,a1 as Je,am as ye,at as Ye,av as Ze,aE as et,aD as tt,n as pe,I as se,y as ee,o as nt,a9 as st,t as R,b8 as ot,K as it}from"./index-B-eHj4u4.js";import{a as Fe,g as ct,e as lt}from"./extract-connection-data-B_Afz4nk.js";import{C as rt}from"./collection-display-button-CxD1zfgF.js";import{S as at}from"./search-input-CEGrosU-.js";import{C as dt}from"./collection-tabs-D-985lbS.js";import{C as Ce,u as Ue,g as ut}from"./connection-card-CuDjRvQM.js";import{E as gt}from"./empty-state-Ba3qMun8.js";import{u as mt,D as pt}from"./use-delete-connection-dDlynrtq.js";import{u as ft}from"./use-infinite-scroll-Bx08szbZ.js";import{u as Ve}from"./use-mobile-BZpAUwUb.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as xt,b as jt,c as St,g as yt,d as Ct,e as vt,f as bt}from"./alert-dialog-BY83tkfe.js";import{n as xe}from"./LinkBroken01-B4m_6hKA.js";import{g as _t,a as Nt}from"./metadata-D72DunRR.js";import{D as Dt,a as kt,d as Tt,b as wt,e as At,f as It,g as Pt}from"./drawer-CkTzw9-A.js";import{F as G,b as Q,c as J,d as Y,f as Z,a as Ne}from"./form-lTigv9Cm.js";import{S as Mt,b as $t,a as Ot,d as Ft,c as re}from"./select-Be8KEqhq.js";import{T as Ut}from"./textarea-Cu_mwrDc.js";import{b as ze,u as Vt}from"./use-connection-D8Z-oNDI.js";import{m as zt}from"./use-mcp-client-fHTUkiQr.js";import{b as Et}from"./repository-binding-CVI26IB4.js";import{g as Lt}from"./types-C9g69UXw.js";import{A as Bt,bE as Kt,aC as Ht,bh as Rt,q as Se}from"./agent-icon-E5NFjGaq.js";import{s as Ee}from"./Plus-FrFsiUQv.js";import{c as Wt}from"./UserSquare-C1l8QNgE.js";import{s as Le}from"./XClose-CDVFbEme.js";import{s as Xt}from"./use-project-scope-BIaj1klw.js";import{c as qt}from"./schema-DDS90txY.js";import{i as fe,a as De,E as Gt,p as Qt,b as Jt,c as Yt}from"./connection-form-helpers-DX9VWFYw.js";import{a as Zt}from"./authenticate-and-persist-oauth-CLn5_4J6.js";import{I as en}from"./integration-icon-DKhUl3mk.js";import{C as Be}from"./checkbox-C6deEGCR.js";import{i as tn}from"./DotsVertical-C85_hpnn.js";import{s as Ke}from"./Image01-BcbXjZdM.js";import{s as He}from"./Trash01-QaBoOmQD.js";import"./connection-BzAtvzSu.js";import"./url-slug-CWeO_dvk.js";import"./ArrowUp-BseWcDxZ.js";import"./SwitchHorizontal01-B8pZTGji.js";import"./tooltip-Wg5TOkgk.js";import"./index-SEQedjDw.js";import"./view-mode-toggle-yaAep4gO.js";import"./badge-sJYWVYje.js";import"./SearchMd-CTE_Dij_.js";import"./useInfiniteQuery-B6mFaUqW.js";import"./infiniteQueryObserver-OMlvsWcf.js";import"./slugify-CEUa2lfQ.js";import"./label-Hktokb9g.js";import"./index-BdQq_4o_.js";import"./ChevronUp-B7Vn1Rb2.js";import"./auth-3_xtjhZa.js";import"./AlertCircle-CxMEbIvM.js";import"./Tool01-Ceiq1yQg.js";import"./ArrowLeft-ChZ5XGHH.js";import"./ShoppingBag01-B47bYriG.js";import"./ZoomOut-0IXFhA1q.js";import"./Building02-BCzHZCeO.js";import"./CheckCircle-BRmDGKsS.js";import"./ChevronSelectorVertical-DXUxjCek.js";import"./Copy01-BeZeYuYP.js";import"./CreditCard01-CR3uiUwh.js";import"./Globe04-DTEEsJ26.js";import"./Key01-BnDtFdB6.js";import"./Link01-CeBVtW9F.js";import"./Monitor01-DluZDvx0.js";import"./Sun-BADHqp_z.js";import"./Play-C67yELx6.js";import"./Upload01-CfxF6ZJF.js";import"./User01-DowUGIml.js";import"./Users01-BvAfz3hH.js";import"./mcp-oauth-BDYmNGyy.js";import"./mcp-oauth-BFMHXWCx.js";function nn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(s){const e=W.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function on(s,e){const n=W.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=j=>{p(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,x;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},x=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=x):(a=n[7],x=n[8]),z.useEffect(a,x);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function cn(s){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,x]=nn(u),f=`studio-${g}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let h;e[4]!==S||e[5]!==c?(h=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=h):h=e[6];const A=h,[T,w]=on(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==x||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:x,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=x,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function ln(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=te(),r=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==r?(d=l(r,{count:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=d):d=e[3];let p;e[4]!==d?(p=t.jsx(ht,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(xt,{children:u}),e[9]=u,e[10]=a):a=e[10];let x;e[11]!==p||e[12]!==a?(x=t.jsxs(jt,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=x):x=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(St,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==o||e[19]!==l||e[20]!==S?(C=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(yt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(Ct,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==x?(h=t.jsxs(vt,{children:[x,c]}),e[28]=c,e[29]=x,e[30]=h):h=e[30];let A;return e[31]!==g||e[32]!==n||e[33]!==h?(A=t.jsx(bt,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=A):A=e[34],A}function rn(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=te();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let x;e[4]!==n._meta?(x=_t(n._meta),e[4]=n._meta,e[5]=x):x=e[5];const f=x,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==o||e[10]!==m){let V;e[12]!==m?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===m,e[12]=m,e[13]=V):V=e[13],c=o.filter(V),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,A=a||g;let T,w;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=h[0];V&&r(V);return}w()},w=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function an(s){return s?.length?{appToolName:s.find(n=>!!Lt(n._meta))?.name??null}:null}const dn=3;function un(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function gn(s){const e=W.c(21),{projects:n}=s,g=te();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let o,i,l;if(e[4]!==n){const u=n.slice(0,dn);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(mn),e[4]=n,e[5]=o,e[6]=i,e[7]=l}else o=e[5],i=e[6],l=e[7];let r;e[8]!==o||e[9]!==i?(r=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function mn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Bt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=W.c(8),{selectionMode:n,children:g}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=he("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fn,children:t.jsx(tn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(Xe,{children:[l,t.jsx(qe,{align:"end",onClick:pn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function pn(s){return s.stopPropagation()}function fn(s){return s.stopPropagation()}function hn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],m=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)p?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const x=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==g||e[23]!==o||e[24]!==x?(y=()=>o?x():g(),e[22]=g,e[23]=o,e[24]=x,e[25]=y):y=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let A;e[26]!==h||e[27]!==c?(A=he(c,h),e[26]=h,e[27]=c,e[28]=A):A=e[28];const T=o?p?!0:u&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==x?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:x}):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]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=r,e[35]=x,e[36]=M):M=e[36];let I;e[37]!==g?(I=N=>{N.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==o||e[46]!==D?($=t.jsx(Re,{selectionMode:o,children:D}),e[45]=o,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function xn(s){const e=W.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=s,u=te();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:jn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=o,e[3]=u,e[4]=a):a=e[4];let x;e[5]!==d?(x=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=x):x=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==u?(j=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=j):j=e[9];let S;e[10]!==x||e[11]!==j?(S=t.jsxs(ie,{onClick:x,children:[f,j]}),e[10]=x,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(C=(i||l)&&t.jsxs(ie,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Kt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==o||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[S,C,y,c]}),e[27]=o,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=h):h=e[32];let A;return e[33]!==a||e[34]!==h?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=A):A=e[35],A}function jn(s){return s.stopPropagation()}function Sn(s){const e=W.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,a=te();if(n===0)return null;let x;e[0]!==n||e[1]!==a?(x=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=x):x=e[2];let f;e[3]!==x?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:x}),e[3]=x,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(j=n<g?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==p||e[13]!==a?(S=i&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Ee,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(C=o&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=m,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Le,{size:13}),e[20]=y):y=e[20];let c;e[21]!==u?(c=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(h=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,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=h):h=e[28],h}function yn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=te(),[r,d]=z.useState(null);let p;e[0]!==g?(p=D=>{D||d(null),g(D)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(ke,{children:u}),e[4]=u,e[5]=a):a=e[5];let x;e[6]!==l?(x=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=x):x=e[7];let f;e[8]!==x?(f=t.jsx(Te,{children:x}),e[8]=x,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(we,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==o||e[14]!==r||e[15]!==l?(S=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(en,{icon:D.icon,name:D.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:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==m?(y=()=>m(!1),e[19]=m,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==y?(h=t.jsx(L,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=h):h=e[25];const A=!r;let T;e[26]!==m||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(L,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(Ae,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function Cn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=te(),{org:i}=Me(),l=nt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=Vt(s),u=mt(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,h]=z.useState(!1),[A,T]=z.useState(null),w=Et(),M=un(Xt(w)),I=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),O=ut(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ue(s.searchTerm),V=$.items,b=ft($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),U=s.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Fe(_);if(v&&N.has(v))return!1}return!0}):[],q=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=lt(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",K=!!v.connection_url,H=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const ve=await p.create.mutateAsync(v),{id:oe}=ve,ce=await Zt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:it.isMCPAuthenticated(le.href,null)}),F(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(zt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=an((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(o("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},E=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ue=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>E.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;F(),R.success(o("orgs.connections.deletedConnections",{count:B})),D()},je=async(_,v)=>{try{await p.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(o(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const K=(await Promise.allSettled(v.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;F(),R.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),D()},ne=async _=>{const v=w.find(H=>H.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await E.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...K]}}),ot(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:v.title})),D()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(pt,{...u}),t.jsx(ln,{open:C,onOpenChange:y,count:f.size,onConfirm:ue}),t.jsx(yn,{open:c,onOpenChange:h,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[q.map(_=>{if(_.type==="group")return t.jsx(hn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(Ce,{connection:v,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(gn,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(xn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:x,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onToggleStatus:K=>je(v.id,K),onDelete:()=>u.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(rn,{item:_,canManage:a,allConnections:m,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(Sn,{count:f.size,total:I.length,canManage:a,canManageAgents:x,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>h(!0),onToggleStatus:ge,onCancel:D})]})}function vn(){const s=te(),{org:e}=Me(),n=$e(),g=Qe({strict:!1}),{data:o}=Oe.useSession(),{stdioEnabled:i}=Je(),l=Ve(),{granted:r}=ye("connections:manage"),d=cn({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=Ye(Ze.connectionsTab(e.slug),b=>g.tab==="all"||g.tab==="connected"?g.tab:b??"all"),[a,x]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ue(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=fe({uiType:h,connectionUrl:A??"",npxPackage:T??""})??De({uiType:h,connectionUrl:A??"",registryItems:C}),M=r&&g.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,q=null;b.ui_type==="NPX"?(N="STDIO",U="",q=Jt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",q=Yt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=ct("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await p.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:q,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,q=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!q&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(ne=>ne.key)),ge=F.envVarKeys.filter(ne=>!je.has(ne));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},E=Qt(N);if(E&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",E.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(fe({uiType:"NPX",npxPackage:E.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(fe({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}h==="NPX"&&k(fe({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Ee,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const b=s("orgs.connections.createConnection"),N=s("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(G,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs(Mt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Ft,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="NPX"&&t.jsx(G,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:E=>{const F=E.clipboardData.getData("text");F&&(E.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:E=>{$(E.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(G,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(G,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(G,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Gt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(G,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:E=>{const F=E.clipboardData.getData("text");F&&(E.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:E=>{$(E.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(G,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:c.control,name:"title",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(G,{control:c.control,name:"description",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ut,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),q=M;return l?t.jsx(Dt,{open:q,onOpenChange:D,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Tt,{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(wt,{children:b}),t.jsx(At,{className:"mt-1",children:N})]}),t.jsx(It,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Le,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Pt,{children:t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Pe,{open:q,onOpenChange:D,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:b}),t.jsx(Te,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Ae,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>D(!1),children:s("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),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:V,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(at,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(rt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:a,onChange:b=>x(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:f,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]}]})]})}),t.jsx(dt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:b=>{const N=b;N!==m&&ee("connections_page_tab_changed",{to_tab:N}),u(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(Cn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Ls(){const s=W.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",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),s[0]=e):e=s[0],e}export{Ls as default};
|
|
1
|
+
import{r as z,c as W,b as te,j as t,B as L,h as de,l as he,U as ie,v as ke,aM as Te,s as we,w as Ae,q as Ie,D as Pe,T as We,X as Xe,V as qe,H as Ge,a2 as Me,d as $e,u as Qe,a as Oe,a1 as Je,am as ye,at as Ye,av as Ze,aE as et,aD as tt,n as pe,I as se,y as ee,o as nt,a9 as st,t as R,b8 as ot,K as it}from"./index-BlWeDA0T.js";import{a as Fe,g as ct,e as lt}from"./extract-connection-data-B2gWRdBp.js";import{C as rt}from"./collection-display-button-CZETvC3F.js";import{S as at}from"./search-input-BaljBVL8.js";import{C as dt}from"./collection-tabs-C8f6Only.js";import{C as Ce,u as Ue,g as ut}from"./connection-card-BnbrpDH3.js";import{E as gt}from"./empty-state-ChkfcEnf.js";import{u as mt,D as pt}from"./use-delete-connection-DJ4nDOEg.js";import{u as ft}from"./use-infinite-scroll-F7T2FF-S.js";import{u as Ve}from"./use-mobile-hkvDmO1w.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as ht,a as xt,b as jt,c as St,g as yt,d as Ct,e as vt,f as bt}from"./alert-dialog-Cww2cCKj.js";import{n as xe}from"./LinkBroken01-D4fcNp0y.js";import{g as _t,a as Nt}from"./metadata-D72DunRR.js";import{D as Dt,a as kt,d as Tt,b as wt,e as At,f as It,g as Pt}from"./drawer-C7TJoqXz.js";import{F as G,b as Q,c as J,d as Y,f as Z,a as Ne}from"./form-DDdiF5DN.js";import{S as Mt,b as $t,a as Ot,d as Ft,c as re}from"./select-B54nmexC.js";import{T as Ut}from"./textarea-BLu1V32o.js";import{b as ze,u as Vt}from"./use-connection-BDpvwZcn.js";import{m as zt}from"./use-mcp-client-B333X4fs.js";import{b as Et}from"./repository-binding-Ds0zXEVH.js";import{g as Lt}from"./types-C4NGZqb0.js";import{A as Bt,bE as Kt,aC as Ht,bh as Rt,q as Se}from"./agent-icon-Cwi3uRdu.js";import{s as Ee}from"./Plus-DBwsZRbL.js";import{c as Wt}from"./UserSquare-B3hi5v4G.js";import{s as Le}from"./XClose-D_NlSxSm.js";import{s as Xt}from"./use-project-scope-BROCSZWk.js";import{c as qt}from"./schema-D-34ICTJ.js";import{i as fe,a as De,E as Gt,p as Qt,b as Jt,c as Yt}from"./connection-form-helpers-a4JD1Ns8.js";import{a as Zt}from"./authenticate-and-persist-oauth-p8iXxMbw.js";import{I as en}from"./integration-icon-BRfynNZ5.js";import{C as Be}from"./checkbox-Dwjm_TLd.js";import{i as tn}from"./DotsVertical-DjBJNxxU.js";import{s as Ke}from"./Image01-LmX-9DTg.js";import{s as He}from"./Trash01-DmGIq4LE.js";import"./connection-CXmYeQRu.js";import"./url-slug-CCgQongS.js";import"./ArrowUp-BM60-fZY.js";import"./SwitchHorizontal01-BLoNOmQx.js";import"./tooltip-B6W7NpVz.js";import"./index-DrHP_BcE.js";import"./view-mode-toggle-BM2WBWnv.js";import"./badge-BIePf0xK.js";import"./SearchMd-Cz9CjV4u.js";import"./useInfiniteQuery-Z8R3F4Sd.js";import"./infiniteQueryObserver-C9osZa8h.js";import"./slugify-CEUa2lfQ.js";import"./label-CCf767lm.js";import"./index-BdQq_4o_.js";import"./ChevronUp-C9gm2RHA.js";import"./auth-d1Zn25hw.js";import"./AlertCircle-BugQG9bV.js";import"./Tool01-BYtrXXg0.js";import"./ArrowLeft-BsOtfvqw.js";import"./ShoppingBag01-FE4oAEwY.js";import"./ZoomOut-BpMDqvoU.js";import"./Building02-DqK4SREZ.js";import"./CheckCircle-DIUFnJQp.js";import"./ChevronSelectorVertical-CRMiEVEY.js";import"./Copy01-BrqDGrTX.js";import"./CreditCard01-C7MhbtAI.js";import"./Globe04-Bi1qDXFD.js";import"./Key01-D7fc2of0.js";import"./Link01-UOxGnkqg.js";import"./Monitor01-zCUpqs5C.js";import"./Sun-lUDK8Dny.js";import"./Play-BaMMHzUS.js";import"./Upload01-B1KubIEG.js";import"./User01-DxYW6D1x.js";import"./Users01-Dg9yGM1q.js";import"./mcp-oauth-Wpa3RhmZ.js";import"./mcp-oauth-CbRV1ySf.js";function nn(s){const e=`deco-filters-${s}`,[n,g]=z.useState(()=>{try{const i=globalThis.localStorage?.getItem(e);if(i)return JSON.parse(i)}catch(i){console.error("Failed to parse stored filters:",i)}return[]});return[n,i=>{g(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function sn(s){const e=W.c(7),[n,g]=z.useState(s),[o,i]=z.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=p=>{n!==p?(g(p),i("asc")):o==="asc"?i("desc"):o==="desc"&&(g(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const r=l;let d;return e[3]!==r||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:r},e[3]=r,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function on(s,e){const n=W.c(12),g=e===void 0?"cards":e,o=Ve(),i=z.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let r;n[0]!==g||n[1]!==l?(r=()=>{const j=globalThis.localStorage?.getItem(l);return j==="cards"||j==="table"?j:g},n[0]=g,n[1]=l,n[2]=r):r=n[2];const[d,p]=z.useState(r);let m;n[3]!==l?(m=j=>{p(j),globalThis.localStorage?.setItem(l,j)},n[3]=l,n[4]=m):m=n[4];const u=m;let a,x;n[5]!==o||n[6]!==d?(a=()=>{!i.current&&o&&d==="table"&&p("cards"),i.current=o},x=[o,d],n[5]=o,n[6]=d,n[7]=a,n[8]=x):(a=n[7],x=n[8]),z.useEffect(a,x);let f;return n[9]!==u||n[10]!==d?(f=[d,u],n[9]=u,n[10]=d,n[11]=f):f=n[11],f}function cn(s){const e=W.c(20),{namespace:n,resource:g,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,r=i===void 0?"table":i,[d,p]=z.useState(""),m=z.useDeferredValue(d),u=`${n}-${g}`,[a,x]=nn(u),f=`studio-${g}-filter-visible-${n}`;let j;e[0]!==f?(j=()=>globalThis.localStorage?.getItem(f)==="true",e[0]=f,e[1]=j):j=e[1];const[S,C]=z.useState(j);let y;e[2]!==f?(y=$=>{C($),globalThis.localStorage?.setItem(f,String($))},e[2]=f,e[3]=y):y=e[3];const c=y;let h;e[4]!==S||e[5]!==c?(h=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=h):h=e[6];const A=h,[T,w]=on(`studio-${g}-${n}`,r),{sortKey:M,sortDirection:I,handleSort:O}=sn(l),P=M;let D;return e[7]!==S||e[8]!==a||e[9]!==O||e[10]!==d||e[11]!==m||e[12]!==c||e[13]!==x||e[14]!==w||e[15]!==I||e[16]!==P||e[17]!==A||e[18]!==T?(D={search:d,searchTerm:m,setSearch:p,filters:a,setFilters:x,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:A,viewMode:T,setViewMode:w,sortKey:P,sortDirection:I,handleSort:O},e[7]=S,e[8]=a,e[9]=O,e[10]=d,e[11]=m,e[12]=c,e[13]=x,e[14]=w,e[15]=I,e[16]=P,e[17]=A,e[18]=T,e[19]=D):D=e[19],D}function ln(s){const e=W.c(35),{open:n,onOpenChange:g,count:o,onConfirm:i}=s,l=te(),r=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==r?(d=l(r,{count:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=d):d=e[3];let p;e[4]!==d?(p=t.jsx(ht,{children:d}),e[4]=d,e[5]=p):p=e[5];const m=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let u;e[6]!==l||e[7]!==m?(u=l(m),e[6]=l,e[7]=m,e[8]=u):u=e[8];let a;e[9]!==u?(a=t.jsx(xt,{children:u}),e[9]=u,e[10]=a):a=e[10];let x;e[11]!==p||e[12]!==a?(x=t.jsxs(jt,{children:[p,a]}),e[11]=p,e[12]=a,e[13]=x):x=e[13];let f;e[14]!==l?(f=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=f):f=e[15];let j;e[16]!==f?(j=t.jsx(St,{children:f}),e[16]=f,e[17]=j):j=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let C;e[18]!==o||e[19]!==l||e[20]!==S?(C=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==i||e[23]!==C?(y=t.jsx(yt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:C}),e[22]=i,e[23]=C,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==j?(c=t.jsxs(Ct,{children:[j,y]}),e[25]=y,e[26]=j,e[27]=c):c=e[27];let h;e[28]!==c||e[29]!==x?(h=t.jsxs(vt,{children:[x,c]}),e[28]=c,e[29]=x,e[30]=h):h=e[30];let A;return e[31]!==g||e[32]!==n||e[33]!==h?(A=t.jsx(bt,{open:n,onOpenChange:g,children:h}),e[31]=g,e[32]=n,e[33]=h,e[34]=A):A=e[34],A}function rn(s){const e=W.c(39),{item:n,canManage:g,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:r,onConnect:d}=s,p=te();let m,u;e[0]!==i||e[1]!==n?(m=Fe(n)??"",u=i.has(m),e[0]=i,e[1]=n,e[2]=m,e[3]=u):(m=e[2],u=e[3]);const a=u;let x;e[4]!==n._meta?(x=_t(n._meta),e[4]=n._meta,e[5]=x):x=e[5];const f=x,j=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let C;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(C=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=C):C=e[8];const y=C;let c;if(e[9]!==o||e[10]!==m){let V;e[12]!==m?(V=b=>b.connection_type!=="VIRTUAL"&&b.app_name===m,e[12]=m,e[13]=V):V=e[13],c=o.filter(V),e[9]=o,e[10]=m,e[11]=c}else c=e[11];const h=c,A=a||g;let T,w;e[14]!==h||e[15]!==a||e[16]!==n||e[17]!==d||e[18]!==r?(T=()=>{if(a){const V=h[0];V&&r(V);return}w()},w=()=>d(n),e[14]=h,e[15]=a,e[16]=n,e[17]=d,e[18]=r,e[19]=T,e[20]=w):(T=e[19],w=e[20]);let M;e[21]!==S||e[22]!==y||e[23]!==j?(M={title:j,description:S,icon:y},e[21]=S,e[22]=y,e[23]=j,e[24]=M):M=e[24];let I;e[25]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(xe,{}),e[25]=I):I=e[25];const O=A?T:void 0;let P;e[26]!==g||e[27]!==l||e[28]!==w||e[29]!==a||e[30]!==n.id||e[31]!==p?(P=a?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:p("orgs.catalogItemCard.connected")}):g&&t.jsx(L,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:V=>{V.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):p("orgs.catalogItemCard.connect")}),e[26]=g,e[27]=l,e[28]=w,e[29]=a,e[30]=n.id,e[31]=p,e[32]=P):P=e[32];let D;e[33]!==P?(D=t.jsx("div",{className:"flex items-center gap-2",children:P}),e[33]=P,e[34]=D):D=e[34];let $;return e[35]!==M||e[36]!==O||e[37]!==D?($=t.jsx(Ce,{connection:M,fallbackIcon:I,onClick:O,headerActionsAlwaysVisible:!0,headerActions:D}),e[35]=M,e[36]=O,e[37]=D,e[38]=$):$=e[38],$}function an(s){return s?.length?{appToolName:s.find(n=>!!Lt(n._meta))?.name??null}:null}const dn=3;function un(s){const e=new Map;for(const n of s)for(const g of n.connections??[]){const o=e.get(g.connection_id)??[];o.push(n),e.set(g.connection_id,o)}return e}function gn(s){const e=W.c(21),{projects:n}=s,g=te();if(n.length===0){let u;e[0]!==g?(u=g("projects.connections.orgWide"),e[0]=g,e[1]=u):u=e[1];let a;return e[2]!==u?(a=t.jsx("span",{className:"text-xs text-muted-foreground",children:u}),e[2]=u,e[3]=a):a=e[3],a}let o,i,l;if(e[4]!==n){const u=n.slice(0,dn);l="flex min-w-0 items-center gap-2",o="flex shrink-0 -space-x-1.5",i=u.map(mn),e[4]=n,e[5]=o,e[6]=i,e[7]=l}else o=e[5],i=e[6],l=e[7];let r;e[8]!==o||e[9]!==i?(r=t.jsx("div",{className:o,children:i}),e[8]=o,e[9]=i,e[10]=r):r=e[10];let d;e[11]!==n[0]?.title||e[12]!==n.length||e[13]!==g?(d=n.length===1?n[0]?.title:g("projects.connections.usedBy",{count:n.length}),e[11]=n[0]?.title,e[12]=n.length,e[13]=g,e[14]=d):d=e[14];let p;e[15]!==d?(p=t.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d}),e[15]=d,e[16]=p):p=e[16];let m;return e[17]!==l||e[18]!==r||e[19]!==p?(m=t.jsxs("div",{className:l,children:[r,p]}),e[17]=l,e[18]=r,e[19]=p,e[20]=m):m=e[20],m}function mn(s){return t.jsx("span",{className:"rounded-md ring-2 ring-card",title:s.title,children:t.jsx(Bt,{icon:s.icon,name:s.title,size:"xs"})},s.id)}function Re(s){const e=W.c(8),{selectionMode:n,children:g}=s,o=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let i;e[0]!==o?(i=he("overflow-hidden transition-all duration-150 ease-out",o),e[0]=o,e[1]=i):i=e[1];let l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(We,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:fn,children:t.jsx(tn,{size:20})})}),e[2]=l):l=e[2];let r;e[3]!==g?(r=t.jsxs(Xe,{children:[l,t.jsx(qe,{align:"end",onClick:pn,children:g})]}),e[3]=g,e[4]=r):r=e[4];let d;return e[5]!==i||e[6]!==r?(d=t.jsx("div",{className:i,children:r}),e[5]=i,e[6]=r,e[7]=d):d=e[7],d}function pn(s){return s.stopPropagation()}function fn(s){return s.stopPropagation()}function hn(s){const e=W.c(57),{group:n,onOpen:g,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,r=te();let d;if(e[0]!==n.connections||e[1]!==i){let N;e[3]!==i?(N=U=>i.has(U.id),e[3]=i,e[4]=N):N=e[4],d=n.connections.every(N),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const p=d;let m;if(e[5]!==n.connections||e[6]!==i){let N;e[8]!==i?(N=U=>i.has(U.id),e[8]=i,e[9]=N):N=e[9],m=n.connections.some(N),e[5]=n.connections,e[6]=i,e[7]=m}else m=e[7];const u=m;let a;e[10]!==p||e[11]!==n.connections||e[12]!==l||e[13]!==i?(a=()=>{for(const N of n.connections)p?i.has(N.id)&&l(N.id):i.has(N.id)||l(N.id)},e[10]=p,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=a):a=e[14];const x=a,f=n.title,j=n.icon;let S;e[15]!==n.connections.length||e[16]!==r?(S=r("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=r,e[17]=S):S=e[17];let C;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(C={title:f,icon:j,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=C):C=e[21];let y;e[22]!==g||e[23]!==o||e[24]!==x?(y=()=>o?x():g(),e[22]=g,e[23]=o,e[24]=x,e[25]=y):y=e[25];const c=o&&p&&"ring-2 ring-primary",h=o&&u&&!p&&"ring-1 ring-primary/50";let A;e[26]!==h||e[27]!==c?(A=he(c,h),e[26]=h,e[27]=c,e[28]=A):A=e[28];const T=o?p?!0:u&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let M;e[30]!==p||e[31]!==n.connections.length||e[32]!==o||e[33]!==u||e[34]!==r||e[35]!==x?(M=o?t.jsx(Be,{checked:p?!0:u?"indeterminate":!1,onCheckedChange:x}):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]=p,e[31]=n.connections.length,e[32]=o,e[33]=u,e[34]=r,e[35]=x,e[36]=M):M=e[36];let I;e[37]!==g?(I=N=>{N.stopPropagation(),g()},e[37]=g,e[38]=I):I=e[38];let O;e[39]===Symbol.for("react.memo_cache_sentinel")?(O=t.jsx(Ke,{size:16}),e[39]=O):O=e[39];let P;e[40]!==r?(P=r("orgs.connectionSelectionUi.open"),e[40]=r,e[41]=P):P=e[41];let D;e[42]!==I||e[43]!==P?(D=t.jsxs(ie,{onClick:I,children:[O,P]}),e[42]=I,e[43]=P,e[44]=D):D=e[44];let $;e[45]!==o||e[46]!==D?($=t.jsx(Re,{selectionMode:o,children:D}),e[45]=o,e[46]=D,e[47]=$):$=e[47];let V;e[48]!==M||e[49]!==$?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[M,$]}),e[48]=M,e[49]=$,e[50]=V):V=e[50];let b;return e[51]!==A||e[52]!==T||e[53]!==V||e[54]!==C||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:C,onClick:y,className:A,selected:T,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=A,e[52]=T,e[53]=V,e[54]=C,e[55]=y,e[56]=b):b=e[56],b}function xn(s){const e=W.c(36),{connection:n,isSelected:g,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:r,onOpen:d,onToggleStatus:p,onDelete:m}=s,u=te();let a;e[0]!==g||e[1]!==r||e[2]!==o||e[3]!==u?(a=o?t.jsx(Be,{checked:g,onCheckedChange:r,onClick:jn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:u("orgs.connectionSelectionUi.connected")}),e[0]=g,e[1]=r,e[2]=o,e[3]=u,e[4]=a):a=e[4];let x;e[5]!==d?(x=T=>{T.stopPropagation(),d()},e[5]=d,e[6]=x):x=e[6];let f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(Ke,{size:16}),e[7]=f):f=e[7];let j;e[8]!==u?(j=u("orgs.connectionSelectionUi.open"),e[8]=u,e[9]=j):j=e[9];let S;e[10]!==x||e[11]!==j?(S=t.jsxs(ie,{onClick:x,children:[f,j]}),e[10]=x,e[11]=j,e[12]=S):S=e[12];let C;e[13]!==i||e[14]!==l||e[15]!==r||e[16]!==u?(C=(i||l)&&t.jsxs(ie,{onClick:T=>{T.stopPropagation(),r()},children:[t.jsx(Kt,{size:16}),u("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=r,e[16]=u,e[17]=C):C=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==p||e[21]!==u?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("inactive")},children:[t.jsx(Ht,{size:16}),u("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:T=>{T.stopPropagation(),p("active")},children:[t.jsx(Rt,{size:16}),u("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=p,e[21]=u,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==m||e[25]!==u?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:T=>{T.stopPropagation(),m()},children:[t.jsx(He,{size:16}),u("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=m,e[25]=u,e[26]=c):c=e[26];let h;e[27]!==o||e[28]!==S||e[29]!==C||e[30]!==y||e[31]!==c?(h=t.jsxs(Re,{selectionMode:o,children:[S,C,y,c]}),e[27]=o,e[28]=S,e[29]=C,e[30]=y,e[31]=c,e[32]=h):h=e[32];let A;return e[33]!==a||e[34]!==h?(A=t.jsxs("div",{className:"flex items-center gap-1",children:[a,h]}),e[33]=a,e[34]=h,e[35]=A):A=e[35],A}function jn(s){return s.stopPropagation()}function Sn(s){const e=W.c(29),{count:n,total:g,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:r,onDelete:d,onAddToAgent:p,onToggleStatus:m,onCancel:u}=s,a=te();if(n===0)return null;let x;e[0]!==n||e[1]!==a?(x=a("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=a,e[2]=x):x=e[2];let f;e[3]!==x?(f=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:x}),e[3]=x,e[4]=f):f=e[4];let j;e[5]!==n||e[6]!==r||e[7]!==l||e[8]!==a||e[9]!==g?(j=n<g?t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:a("orgs.connectionSelectionUi.selectAll",{total:g})}):t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:a("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=r,e[7]=l,e[8]=a,e[9]=g,e[10]=j):j=e[10];let S;e[11]!==i||e[12]!==p||e[13]!==a?(S=i&&t.jsxs(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:p,children:[t.jsx(Ee,{size:13}),a("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=p,e[13]=a,e[14]=S):S=e[14];let C;e[15]!==o||e[16]!==d||e[17]!==m||e[18]!==a?(C=o&&t.jsxs(t.Fragment,{children:[t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("active"),children:a("orgs.connectionSelectionUi.enable")}),t.jsx(L,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>m("inactive"),children:a("orgs.connectionSelectionUi.disable")}),t.jsxs(L,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(He,{size:13}),a("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=m,e[18]=a,e[19]=C):C=e[19];let y;e[20]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(Le,{size:13}),e[20]=y):y=e[20];let c;e[21]!==u?(c=t.jsx(L,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:y}),e[21]=u,e[22]=c):c=e[22];let h;return e[23]!==f||e[24]!==j||e[25]!==S||e[26]!==C||e[27]!==c?(h=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,j,S,C,c]})}),e[23]=f,e[24]=j,e[25]=S,e[26]=C,e[27]=c,e[28]=h):h=e[28],h}function yn(s){const e=W.c(47),{open:n,onOpenChange:g,agents:o,onConfirm:i}=s,l=te(),[r,d]=z.useState(null);let p;e[0]!==g?(p=D=>{D||d(null),g(D)},e[0]=g,e[1]=p):p=e[1];const m=p;let u;e[2]!==l?(u=l("orgs.connectionSelectionUi.addToAgentTitle"),e[2]=l,e[3]=u):u=e[3];let a;e[4]!==u?(a=t.jsx(ke,{children:u}),e[4]=u,e[5]=a):a=e[5];let x;e[6]!==l?(x=l("orgs.connectionSelectionUi.addToAgentDescription"),e[6]=l,e[7]=x):x=e[7];let f;e[8]!==x?(f=t.jsx(Te,{children:x}),e[8]=x,e[9]=f):f=e[9];let j;e[10]!==a||e[11]!==f?(j=t.jsxs(we,{children:[a,f]}),e[10]=a,e[11]=f,e[12]=j):j=e[12];let S;e[13]!==o||e[14]!==r||e[15]!==l?(S=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(D=>t.jsxs("button",{type:"button",onClick:()=>d(D.id),className:he("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",r===D.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(en,{icon:D.icon,name:D.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:D.title}),D.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:D.description})]})]},D.id)),e[13]=o,e[14]=r,e[15]=l,e[16]=S):S=e[16];let C;e[17]!==S?(C=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:S}),e[17]=S,e[18]=C):C=e[18];let y;e[19]!==m?(y=()=>m(!1),e[19]=m,e[20]=y):y=e[20];let c;e[21]!==l?(c=l("orgs.connectionSelectionUi.cancel"),e[21]=l,e[22]=c):c=e[22];let h;e[23]!==c||e[24]!==y?(h=t.jsx(L,{variant:"outline",onClick:y,children:c}),e[23]=c,e[24]=y,e[25]=h):h=e[25];const A=!r;let T;e[26]!==m||e[27]!==i||e[28]!==r?(T=()=>{r&&(i(r),m(!1))},e[26]=m,e[27]=i,e[28]=r,e[29]=T):T=e[29];let w;e[30]!==l?(w=l("orgs.connectionSelectionUi.add"),e[30]=l,e[31]=w):w=e[31];let M;e[32]!==A||e[33]!==T||e[34]!==w?(M=t.jsx(L,{disabled:A,onClick:T,children:w}),e[32]=A,e[33]=T,e[34]=w,e[35]=M):M=e[35];let I;e[36]!==h||e[37]!==M?(I=t.jsxs(Ae,{children:[h,M]}),e[36]=h,e[37]=M,e[38]=I):I=e[38];let O;e[39]!==I||e[40]!==j||e[41]!==C?(O=t.jsxs(Ie,{className:"sm:max-w-[400px]",children:[j,C,I]}),e[39]=I,e[40]=j,e[41]=C,e[42]=O):O=e[42];let P;return e[43]!==m||e[44]!==n||e[45]!==O?(P=t.jsx(Pe,{open:n,onOpenChange:m,children:O}),e[43]=m,e[44]=n,e[45]=O,e[46]=P):P=e[46],P}function Cn({listState:s,activeTab:e,typeFilter:n,statusFilter:g}){const o=te(),{org:i}=Me(),l=nt(),r=$e(),{data:d}=Oe.useSession(),p=ze(),m=Vt(s),u=mt(),{granted:a}=ye("connections:manage"),{granted:x}=ye("agents:manage"),[f,j]=z.useState(new Set),S=f.size>0,[C,y]=z.useState(!1),[c,h]=z.useState(!1),[A,T]=z.useState(null),w=Et(),M=un(Xt(w)),I=m.filter(_=>!(n!=="ALL"&&_.connection_type!==n||g!=="ALL"&&_.status!==g)),O=ut(I),P=_=>{j(v=>{const B=new Set(v);return B.has(_)?B.delete(_):B.add(_),B})},D=()=>{j(new Set)},$=Ue(s.searchTerm),V=$.items,b=ft($.loadMore,$.hasMore,$.isLoadingMore),N=new Set(m.filter(_=>_.app_name).map(_=>_.app_name)),U=s.search.length>0,X=e==="all"||U?V.filter(_=>{if(U){const v=Fe(_);if(v&&N.has(v))return!1}return!0}):[],q=e==="connected"||U?O:[],k=async _=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:_.id,source:"connections_page"}),T(_.id);try{const v=lt(_,i.id,d.user.id,{remoteIndex:0}),B=v.connection_type==="STDIO",K=!!v.connection_url,H=B&&v.connection_headers&&typeof v.connection_headers=="object"&&"command"in v.connection_headers;if(!K&&!H){R.error(o("orgs.connections.cannotConnectNoMethod")),T(null);return}const ve=await p.create.mutateAsync(v),{id:oe}=ve,ce=await Zt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>p.update.mutateAsync({id:oe,data:{connection_token:le}}).then(()=>{})});if(ce.ran&&!ce.ok){ee("connection_oauth_failed",{connection_id:oe,flow:"connections_page_connect",error:ce.error??"no_token"}),R.error(o("orgs.connections.authenticationFailed",{error:ce.error??"no token received"}));return}if(ce.ran){ee("connection_oauth_succeeded",{connection_id:oe,flow:"connections_page_connect"});const le=new URL(`/api/${i.slug}/mcp/${oe}`,window.location.origin);await l.invalidateQueries({queryKey:it.isMCPAuthenticated(le.href,null)}),F(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(zt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=an((await le.listTools()).tools)}catch{}const be=ae(ve),_e=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:be,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:be}}:null;R.success(o("orgs.connections.connectedSuccessfully"),_e?{action:{label:o("orgs.connections.openConnection"),onClick:()=>r(_e)}}:void 0)}catch(v){R.error(o("orgs.connections.failedToConnect",{error:v instanceof Error?v.message:String(v)}))}finally{T(null)}}},E=st(),F=()=>{l.invalidateQueries({predicate:_=>{const v=_.queryKey;return v[1]===i.id&&v[3]==="collection"&&v[4]==="CONNECTIONS"}})},ue=async()=>{y(!1);const _=[...f];ee("connections_bulk_delete",{count:_.length});const B=(await Promise.allSettled(_.map(K=>E.call("COLLECTION_CONNECTIONS_DELETE",{id:K,force:!0})))).filter(K=>K.status==="fulfilled").length;F(),R.success(o("orgs.connections.deletedConnections",{count:B})),D()},je=async(_,v)=>{try{await p.update.mutateAsync({id:_,data:{status:v}}),F(),R.success(o(v==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},ge=async _=>{const v=[...f];ee("connections_bulk_status_toggled",{count:v.length,to_status:_});const K=(await Promise.allSettled(v.map(H=>p.update.mutateAsync({id:H,data:{status:_}})))).filter(H=>H.status==="fulfilled").length;F(),R.success(_==="active"?o("orgs.connections.enabledConnections",{count:K}):o("orgs.connections.disabledConnections",{count:K})),D()},ne=async _=>{const v=w.find(H=>H.id===_);if(!v)return;ee("connections_bulk_add_to_agent",{agent_id:_,count:f.size});const B=new Set(v.connections.map(H=>H.connection_id)),K=[...f].filter(H=>!B.has(H)).map(H=>({connection_id:H,selected_tools:null,selected_resources:null,selected_prompts:null}));if(K.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await E.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:_,data:{connections:[...v.connections,...K]}}),ot(l,i.id),R.success(o("orgs.connections.addedConnectionsToAgent",{count:K.length,agentTitle:v.title})),D()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(pt,{...u}),t.jsx(ln,{open:C,onOpenChange:y,count:f.size,onConfirm:ue}),t.jsx(yn,{open:c,onOpenChange:h,agents:w,onConfirm:ne}),$.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}):t.jsx("div",{children:(U?X.length===0&&I.length===0:e==="all"?X.length===0:I.length===0)?t.jsx(gt,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:o("orgs.connections.noConnectionsFound"),description:s.search?o("orgs.connections.noConnectionsMatchSearch",{search:s.search}):o(a?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[q.map(_=>{if(_.type==="group")return t.jsx(hn,{group:_,onOpen:()=>{r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:_.key}})},selectionMode:S,selectedIds:f,onToggleSelect:P},_.key);const v=_.connection,B=f.has(v.id);return t.jsx(Ce,{connection:v,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(v.id):r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),className:he(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,footer:t.jsx(gn,{projects:M.get(v.id)??[]}),headerActionsAlwaysVisible:!0,headerActions:t.jsx(xn,{connection:v,isSelected:B,selectionMode:S,canManage:a,canManageAgents:x,onToggleSelect:()=>P(v.id),onOpen:()=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onToggleStatus:K=>je(v.id,K),onDelete:()=>u.requestDelete(v)})},v.id)}),X.map(_=>t.jsx(rn,{item:_,canManage:a,allConnections:m,connectedAppNames:N,connectingItemId:A,onNavigateConnected:v=>r({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(v)}}),onConnect:k},_.id)),(e==="all"||U)&&t.jsx("div",{ref:b,className:"col-span-full h-4"}),(e==="all"||U)&&$.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(de,{className:"size-6 text-muted-foreground"})})]})}),S&&t.jsx(Sn,{count:f.size,total:I.length,canManage:a,canManageAgents:x,onSelectAll:()=>{j(new Set(I.map(_=>_.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>y(!0),onAddToAgent:()=>h(!0),onToggleStatus:ge,onCancel:D})]})}function vn(){const s=te(),{org:e}=Me(),n=$e(),g=Qe({strict:!1}),{data:o}=Oe.useSession(),{stdioEnabled:i}=Je(),l=Ve(),{granted:r}=ye("connections:manage"),d=cn({namespace:e.slug,resource:"connections"}),p=ze(),[m,u]=Ye(Ze.connectionsTab(e.slug),b=>g.tab==="all"||g.tab==="connected"?g.tab:b??"all"),[a,x]=z.useState("ALL"),[f,j]=z.useState("ALL"),C=Ue(d.searchTerm).items,y=d.search!==d.searchTerm,c=et({resolver:tt(qt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),h=c.watch("ui_type"),A=c.watch("connection_url"),T=c.watch("npx_package"),w=fe({uiType:h,connectionUrl:A??"",npxPackage:T??""})??De({uiType:h,connectionUrl:A??"",registryItems:C}),M=r&&g.action==="create",I=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},O=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},P=async b=>{let N,U=null,X=null,q=null;b.ui_type==="NPX"?(N="STDIO",U="",q=Jt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(N="STDIO",U="",q=Yt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(N=b.ui_type,U=b.connection_url||"",X=b.connection_token||null);const k=ct("conn");ee("connection_custom_created",{connection_type:N,ui_type:b.ui_type}),await p.create.mutateAsync({id:k,title:b.title,description:b.description||null,connection_type:N,connection_url:U,connection_token:X,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:o?.user?.id||"system",organization_id:e.id,icon:b.icon??null,app_name:null,app_id:null,connection_headers:q,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null}),O(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:U,title:b.title,id:k})}})},D=b=>{b||(M&&O(),c.reset())},$=b=>{const N=b.trim();if(!N)return;const U=!!c.formState.dirtyFields.title,X=!!c.formState.dirtyFields.description,q=!!c.formState.dirtyFields.env_vars,k=F=>{if(F&&(!U&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!X&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!q&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(ne=>ne.key)),ge=F.envVarKeys.filter(ne=>!je.has(ne));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(ne=>({key:ne,value:""}))],{shouldDirty:!0})}},E=Qt(N);if(E&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",E.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),k(fe({uiType:"NPX",npxPackage:E.packageName}));return}if(N.startsWith("http://")||N.startsWith("https://")){const F=h==="HTTP"||h==="SSE"||h==="Websocket"?h:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",N,{shouldDirty:!0}),k(fe({uiType:F,connectionUrl:N})??De({uiType:F,connectionUrl:N,registryItems:C}));return}h==="NPX"&&k(fe({uiType:"NPX",npxPackage:N}))},V=r?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(L,{size:"sm",variant:"default",onClick:I,children:[t.jsx(Ee,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:s("orgs.connections.customConnection")})]})}):null;return t.jsx(t.Fragment,{children:t.jsxs(pe,{children:[(()=>{const b=s("orgs.connections.createConnection"),N=s("orgs.connections.createConnectionDescription"),U=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),X=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(G,{control:c.control,name:"ui_type",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.type")}),t.jsxs(Mt,{value:k.value,onValueChange:k.onChange,children:[t.jsx(Y,{children:t.jsx($t,{children:t.jsx(Ot,{})})}),t.jsxs(Ft,{children:[t.jsx(re,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(re,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(re,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),i&&t.jsxs(t.Fragment,{children:[t.jsx(re,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(xe,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(re,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Wt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Z,{})]})}),h==="NPX"&&t.jsx(G,{control:c.control,name:"npx_package",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.npmPackage")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...k,value:k.value??"",onPaste:E=>{const F=E.clipboardData.getData("text");F&&(E.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),$(F))},onBlur:E=>{$(E.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),h==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(G,{control:c.control,name:"stdio_command",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.command")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.commandPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})}),t.jsx(G,{control:c.control,name:"stdio_args",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.arguments")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.argumentsPlaceholder"),...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:c.control,name:"stdio_cwd",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.workingDirectory")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...k,value:k.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Z,{})]})})]}),(h==="NPX"||h==="STDIO")&&t.jsx(G,{control:c.control,name:"env_vars",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.environmentVariables")}),t.jsx(Y,{children:t.jsx(Gt,{value:k.value??[],onChange:k.onChange})}),t.jsx(Z,{})]})}),h!=="NPX"&&h!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(G,{control:c.control,name:"connection_url",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.url")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.urlPlaceholder"),...k,value:k.value??"",onPaste:E=>{const F=E.clipboardData.getData("text");F&&(E.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),$(F))},onBlur:E=>{$(E.target.value),k.onBlur()}})}),t.jsx(Z,{})]})}),t.jsx(G,{control:c.control,name:"connection_token",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(Y,{children:t.jsx(se,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...k,value:k.value??""})}),w?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.token.helperText,w.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:s("orgs.connections.openGitHubPatSettings")})]})]}),t.jsx(Z,{})]})})]}),t.jsx(G,{control:c.control,name:"title",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.name")}),t.jsx(Y,{children:t.jsx(se,{placeholder:s("orgs.connections.namePlaceholder"),...k})}),t.jsx(Z,{})]})}),t.jsx(G,{control:c.control,name:"description",render:({field:k})=>t.jsxs(Q,{children:[t.jsx(J,{children:s("orgs.connections.description")}),t.jsx(Y,{children:t.jsx(Ut,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...k,value:k.value??""})}),t.jsx(Z,{})]})})]}),q=M;return l?t.jsx(Dt,{open:q,onOpenChange:D,children:t.jsxs(kt,{className:"max-h-[90vh]",children:[t.jsx(Tt,{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(wt,{children:b}),t.jsx(At,{className:"mt-1",children:N})]}),t.jsx(It,{asChild:!0,children:t.jsx(L,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Le,{size:16})})})]})}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:X}),t.jsx(Pt,{children:t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:U})})]})})]})}):t.jsx(Pe,{open:q,onOpenChange:D,children:t.jsxs(Ie,{className:"sm:max-w-[525px]",children:[t.jsxs(we,{children:[t.jsx(ke,{children:b}),t.jsx(Te,{children:N})]}),t.jsx(Ne,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(P),children:[t.jsx("div",{className:"py-4",children:X}),t.jsxs(Ae,{children:[t.jsx(L,{type:"button",variant:"outline",onClick:()=>D(!1),children:s("orgs.connections.cancel")}),t.jsx(L,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:U})]})]})})]})})})(),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:V,children:s("orgs.connections.pageTitle")}),t.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(at,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:b=>{b.key==="Escape"&&(d.setSearch(""),b.target.blur())}}),t.jsx(rt,{sortKey:d.sortKey,sortDirection:d.sortDirection,onSort:d.handleSort,sortOptions:[{id:"title",label:s("orgs.connections.sortName")},{id:"description",label:s("orgs.connections.sortDescription")},{id:"connection_type",label:s("orgs.connections.sortType")},{id:"updated_by",label:s("orgs.connections.sortUpdatedBy")},{id:"updated_at",label:s("orgs.connections.sortUpdated")}],filters:[{label:s("orgs.connections.filterType"),value:a,onChange:b=>x(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:s("orgs.connections.filterStatus"),value:f,onChange:b=>j(b||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAll")},{id:"active",label:s("orgs.connections.filterActive")},{id:"inactive",label:s("orgs.connections.filterInactive")},{id:"error",label:s("orgs.connections.filterError")}]}]})]})}),t.jsx(dt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:m,onTabChange:b=>{const N=b;N!==m&&ee("connections_page_tab_changed",{to_tab:N}),u(N)}}),t.jsx(z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:y?.5:1,transition:y?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:y?"none":"auto"},children:t.jsx(Cn,{listState:d,activeTab:m,typeFilter:a,statusFilter:f})})})]})})})]})})}function Ls(){const s=W.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",children:t.jsx(de,{className:"size-8 text-muted-foreground"})}),children:t.jsx(vn,{})})}),s[0]=e):e=s[0],e}export{Ls as default};
|