decocms 4.408.0 → 4.409.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-B4TBXI97.js → AlertCircle-CUfQnpkL.js} +1 -1
- package/dist/client/assets/{AreaChart-BT_BBtMg.js → AreaChart-7MEIU0BG.js} +1 -1
- package/dist/client/assets/{ArrowLeft-Du5HwAty.js → ArrowLeft-Bq3Is2w2.js} +1 -1
- package/dist/client/assets/{ArrowRight-Bk-h8Spa.js → ArrowRight-C6beJSjX.js} +1 -1
- package/dist/client/assets/{ArrowUp-DfYHJg8n.js → ArrowUp-A1GhF0iD.js} +1 -1
- package/dist/client/assets/{CartesianChart-B5akGwBy.js → CartesianChart-CdUZwP8q.js} +1 -1
- package/dist/client/assets/{Check-e9hufNdV.js → Check-xLQDWZBr.js} +1 -1
- package/dist/client/assets/{CheckCircle-Du0Z4Mo4.js → CheckCircle-LQiWK3ly.js} +1 -1
- package/dist/client/assets/{ChevronUp-Dijj6L1D.js → ChevronUp-BcuhULcu.js} +1 -1
- package/dist/client/assets/{Copy01-Rd2DUITb.js → Copy01-BgPUQX69.js} +1 -1
- package/dist/client/assets/{CreditCard01-CuV3PHbW.js → CreditCard01-BDFFS3TM.js} +1 -1
- package/dist/client/assets/{DotsVertical-CUOWG-18.js → DotsVertical-Crrqe0Sf.js} +1 -1
- package/dist/client/assets/{ErrorBarContext-BCo_1Dyd.js → ErrorBarContext-DVQvj4uR.js} +1 -1
- package/dist/client/assets/{Eye-CATcYqq7.js → Eye-DacK_90s.js} +1 -1
- package/dist/client/assets/{Globe04-dvDQwL6D.js → Globe04-WlooJMD7.js} +1 -1
- package/dist/client/assets/{Image01-CK0bgOXc.js → Image01-DKGtjhhW.js} +1 -1
- package/dist/client/assets/{Key01-B2Ks3SjW.js → Key01-D0VXcPV1.js} +1 -1
- package/dist/client/assets/{LayoutLeft-o4EwT_f4.js → LayoutLeft-C1LKOuH_.js} +1 -1
- package/dist/client/assets/{Line-51pigb_T.js → Line-Cza1FZ1Z.js} +1 -1
- package/dist/client/assets/{Link01-t9xcN1_J.js → Link01-Cyt--vTk.js} +1 -1
- package/dist/client/assets/{LinkExternal01-E0yllQfW.js → LinkExternal01-BoAIhl8A.js} +1 -1
- package/dist/client/assets/{Monitor01-2SrwE2A4.js → Monitor01-C_2Yverr.js} +1 -1
- package/dist/client/assets/{Palette-DdJDZNuI.js → Palette-DgXRGI-b.js} +1 -1
- package/dist/client/assets/{Plus-BfQMVZRL.js → Plus-BkrhlTLe.js} +1 -1
- package/dist/client/assets/{SearchMd-BPxAMeCu.js → SearchMd-CHh1gHMI.js} +1 -1
- package/dist/client/assets/{Sector-DomxOOd2.js → Sector-CNEbMEJs.js} +1 -1
- package/dist/client/assets/{Share07-CAPMGK5H.js → Share07-mNsUoEV_.js} +1 -1
- package/dist/client/assets/{ShoppingBag01-Dj-9rxCI.js → ShoppingBag01-BY7I83X2.js} +1 -1
- package/dist/client/assets/{Sun-Dc2rioTm.js → Sun-BAOeeRbd.js} +1 -1
- package/dist/client/assets/{Tool01-DAfFPt6l.js → Tool01-CgjdK2MW.js} +1 -1
- package/dist/client/assets/{Trash01-BpbNxWxU.js → Trash01-C7Kui6BE.js} +1 -1
- package/dist/client/assets/{Upload01-Cu5y084h.js → Upload01-CWSvTA3M.js} +1 -1
- package/dist/client/assets/{User01-DZIaW3qt.js → User01-BOZZP-PT.js} +1 -1
- package/dist/client/assets/{UserSquare-CMMvch3p.js → UserSquare-CB-Meask.js} +1 -1
- package/dist/client/assets/{Users01-B6wD4vfR.js → Users01-Db3s7VUn.js} +1 -1
- package/dist/client/assets/{X-7V7RNG20.js → X-BqFXONHn.js} +1 -1
- package/dist/client/assets/{XClose-CgE_NvFQ.js → XClose-BrqNA97h.js} +1 -1
- package/dist/client/assets/{Zap-BnKV6W7m.js → Zap-CACrXYYE.js} +1 -1
- package/dist/client/assets/{ZoomOut-9vKhCWKn.js → ZoomOut-BHitADvX.js} +1 -1
- package/dist/client/assets/{access-gate-C2DM5elO.js → access-gate-CRPjc1gg.js} +1 -1
- package/dist/client/assets/{add-connection-dialog-CfJFvo0n.js → add-connection-dialog-Dty-YDeE.js} +1 -1
- package/dist/client/assets/{agent-analytics-D3NPULfo.js → agent-analytics-DFB-zeHy.js} +1 -1
- package/dist/client/assets/agent-app-CuJVJvRD.js +1 -0
- package/dist/client/assets/{agent-assets-Csm6M0Fe.js → agent-assets-Dv7NB519.js} +1 -1
- package/dist/client/assets/{agent-automation-LvpxhSzD.js → agent-automation-DTOJTMdg.js} +1 -1
- package/dist/client/assets/{agent-automations-CCXip6X6.js → agent-automations-xB1XOmCd.js} +1 -1
- package/dist/client/assets/{agent-connect-sources-Cx2sX-zQ.js → agent-connect-sources-B0lEtAAR.js} +1 -1
- package/dist/client/assets/agent-deck-DKq_t8op.js +1 -0
- package/dist/client/assets/{agent-e2e-Dd6W8dQn.js → agent-e2e-Dqs6Gtqo.js} +1 -1
- package/dist/client/assets/{agent-experiments-CcAMb-uk.js → agent-experiments-BIT-Gl0x.js} +1 -1
- package/dist/client/assets/{agent-file-1tvyjICj.js → agent-file-DHVX-7CP.js} +1 -1
- package/dist/client/assets/{agent-git-DAcJMVD4.js → agent-git-yNtxyEmU.js} +1 -1
- package/dist/client/assets/{agent-hosting-TSmf3TUW.js → agent-hosting-Cvyl-2cZ.js} +1 -1
- package/dist/client/assets/{agent-icon-CP5XN9a-.js → agent-icon-CI9eQ7xC.js} +1 -1
- package/dist/client/assets/agent-library-file-htu-DEqQ.js +1 -0
- package/dist/client/assets/{agent-monitor-DFJdCDDa.js → agent-monitor-BOCqlZ_a.js} +1 -1
- package/dist/client/assets/agent-overview-y3-JUJ8e.js +1 -0
- package/dist/client/assets/agent-settings-B5_AuG__.js +1 -0
- package/dist/client/assets/{agent-site-editor-DVPUbL6E.js → agent-site-editor-CjWZsw7M.js} +1 -1
- package/dist/client/assets/agent-site-editor-code-DRVKGz4k.js +2 -0
- package/dist/client/assets/{agent-site-editor-content-D16Neg7_.js → agent-site-editor-content-DwKYVVDu.js} +3 -3
- package/dist/client/assets/{agent-site-editor-preview-DsyVdlnU.js → agent-site-editor-preview-Dv21vTA3.js} +3 -3
- package/dist/client/assets/agent-view-CbUcdOC8.js +1 -0
- package/dist/client/assets/{agent-view-guard-B21vN7fV.js → agent-view-guard-BmqMX-cG.js} +1 -1
- package/dist/client/assets/{agents-list-CXO3qqSU.js → agents-list-DUIJv7HT.js} +1 -1
- package/dist/client/assets/{ai-providers-CS-7rqRe.js → ai-providers-CqGz_qPE.js} +1 -1
- package/dist/client/assets/{alert-DA8xSuNw.js → alert-B-eOHTnf.js} +1 -1
- package/dist/client/assets/{alert-dialog-DOZYkVkM.js → alert-dialog-yn_TNVL_.js} +1 -1
- package/dist/client/assets/{analytics-sections-D-vmE_mj.js → analytics-sections-D8A_SNX_.js} +1 -1
- package/dist/client/assets/{api-keys-Dw0ULTM2.js → api-keys-BtUNzEqr.js} +1 -1
- package/dist/client/assets/api-keys-CbiF5AB_.js +1 -0
- package/dist/client/assets/app-editor-BtTioX0z.js +1 -0
- package/dist/client/assets/{asset-utils-KW2eRq0C.js → asset-utils-CfzwjAU_.js} +1 -1
- package/dist/client/assets/{auth-WDJFc9Hm.js → auth-CejvjNNS.js} +1 -1
- package/dist/client/assets/{auth-catchall-DFKT24Uv.js → auth-catchall-Dh5jrKY4.js} +1 -1
- package/dist/client/assets/{auth-entry-D_MUtVLc.js → auth-entry-DSRNCXJZ.js} +1 -1
- package/dist/client/assets/{auth-split-layout-C2beZWug.js → auth-split-layout-D6OEz7uX.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BdWTTo89.js → authenticate-and-persist-oauth-BWJIYJrq.js} +1 -1
- package/dist/client/assets/{automation-list-row-DF4C0izx.js → automation-list-row-D9cPoioR.js} +1 -1
- package/dist/client/assets/{automation-runs-a1jd9j7n.js → automation-runs-CubT-Yu9.js} +1 -1
- package/dist/client/assets/{automations-Cn4R0PwJ.js → automations-B_ybs3dv.js} +1 -1
- package/dist/client/assets/{autosend-BUpRVcwj.js → autosend-C0EKCCh-.js} +1 -1
- package/dist/client/assets/{avatar-JIBRtdC_.js → avatar-cVVoBC-4.js} +1 -1
- package/dist/client/assets/{badge-6y8k_9-5.js → badge-BseQxRHa.js} +1 -1
- package/dist/client/assets/{block-document-CIJVCQ3G.js → block-document-_OPc0Hut.js} +1 -1
- package/dist/client/assets/{blocks-preview-workspace-context-D1BaC02Q.js → blocks-preview-workspace-context-CtRW5LZY.js} +1 -1
- package/dist/client/assets/{buckets-C9rH2WAo.js → buckets-zsVmYRJr.js} +1 -1
- package/dist/client/assets/{build-improve-prompt-doc-uYATas8q.js → build-improve-prompt-doc-JSLgMkGb.js} +1 -1
- package/dist/client/assets/{calendar-C9s_iZ3-.js → calendar-BEiMZO0O.js} +1 -1
- package/dist/client/assets/{capability-load-error-BPW-viM7.js → capability-load-error-C-jStnn5.js} +1 -1
- package/dist/client/assets/{cards-j_YM4uLm.js → cards-BjQmRWiH.js} +1 -1
- package/dist/client/assets/{category-editor-CJshYeZK.js → category-editor-BtE6qR6k.js} +1 -1
- package/dist/client/assets/{chart-BXtamRvp.js → chart-B_nJvNcj.js} +1 -1
- package/dist/client/assets/{chat-context-B6r2nJ6g.js → chat-context-DRR1USgw.js} +1 -1
- package/dist/client/assets/{chat-draft-CerneUSv.js → chat-draft-CoC7naNH.js} +1 -1
- package/dist/client/assets/{checkbox-CjlcA4Zf.js → checkbox-DnfD_ijV.js} +1 -1
- package/dist/client/assets/{choose-editor-CCjCgFix.js → choose-editor-CV-le1nZ.js} +1 -1
- package/dist/client/assets/{claim-phase-copy-Dvvzpbgr.js → claim-phase-copy-Dr4Mzj6c.js} +1 -1
- package/dist/client/assets/{cli-auth-success-Cp9ve11h.js → cli-auth-success-fWOQxybD.js} +1 -1
- package/dist/client/assets/{client-icons-CZY4712U.js → client-icons-DhPCYmdv.js} +1 -1
- package/dist/client/assets/{collapsible-D8RyGf9b.js → collapsible-CwFidR6D.js} +1 -1
- package/dist/client/assets/{collection-detail-ivXkBsms.js → collection-detail-B7jIsWUv.js} +1 -1
- package/dist/client/assets/{collection-display-button-COB8om2q.js → collection-display-button-D1fzsKIi.js} +1 -1
- package/dist/client/assets/{collection-search-Bm4yfKio.js → collection-search-21jPub41.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DR3ABum3.js → collection-table-wrapper-BaPwX68f.js} +1 -1
- package/dist/client/assets/{collection-tabs-CyEDGPVJ.js → collection-tabs-D8JuoGr4.js} +1 -1
- package/dist/client/assets/{combobox--akRwZt5.js → combobox-Dk8jQElk.js} +1 -1
- package/dist/client/assets/{command-BXe_2Y8J.js → command-6H68jmKH.js} +1 -1
- package/dist/client/assets/{companion-mcps-section-bE4HzUrd.js → companion-mcps-section-CBLn4mGY.js} +1 -1
- package/dist/client/assets/config-DpbyQo_3.js +1 -0
- package/dist/client/assets/{connect-CA2SeR7c.js → connect-DkS9sdly.js} +1 -1
- package/dist/client/assets/{connect-layout-D-VHpq78.js → connect-layout-CDnD1K6j.js} +1 -1
- package/dist/client/assets/{connection-C1K_L2Xe.js → connection-C83Fa34C.js} +1 -1
- package/dist/client/assets/{connection-card-C0UBOriU.js → connection-card-BlyIILyc.js} +1 -1
- package/dist/client/assets/{connection-detail-B54gylCL.js → connection-detail-D44x4v7X.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DmenEJQq.js → connection-form-helpers-BiLRaMfL.js} +1 -1
- package/dist/client/assets/{connections-qW3uwEes.js → connections-Beu4_6wK.js} +1 -1
- package/dist/client/assets/{context-D8xt-q96.js → context-BD-C3u_2.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-CfY_Fp3w.js → create-organization-dialog-CuX_f077.js} +1 -1
- package/dist/client/assets/{decopilot-C7BBIc4w.js → decopilot-8QQ-iDRK.js} +1 -1
- package/dist/client/assets/{dialog-B9AmIVi-.js → dialog-NChNDvdJ.js} +1 -1
- package/dist/client/assets/{discover-C2vIznYH.js → discover-3To81zVf.js} +1 -1
- package/dist/client/assets/{domain-settings-CadsJlyS.js → domain-settings-CdFtAvl_.js} +1 -1
- package/dist/client/assets/{download-app-dialog-BngIghKX.js → download-app-dialog-BFAzFsB1.js} +1 -1
- package/dist/client/assets/{drawer-Cmzocoxj.js → drawer-GHZKTfaK.js} +1 -1
- package/dist/client/assets/{editor-B64zb0TF.js → editor-BUd_hBZr.js} +1 -1
- package/dist/client/assets/{empty-state-CnuzaP1O.js → empty-state-BrikbTNA.js} +1 -1
- package/dist/client/assets/{empty-state-Df0p9Roq.js → empty-state-CTc-nAQq.js} +1 -1
- package/dist/client/assets/{extract-connection-data-ZkeqSXbM.js → extract-connection-data-Ci8K9pvL.js} +1 -1
- package/dist/client/assets/{feature-gate-D1_CJv3S.js → feature-gate-DZ4UUG9X.js} +1 -1
- package/dist/client/assets/{feature-paywall-BK6Diems.js → feature-paywall-CBnbb3Ou.js} +1 -1
- package/dist/client/assets/{file-explorer-B5hK7sWB.js → file-explorer-Cc6q961a.js} +1 -1
- package/dist/client/assets/{file-preview-BAf9QLKP.js → file-preview-DUJBzJN2.js} +1 -1
- package/dist/client/assets/{file-share-button-z0zbJCjq.js → file-share-button-BFAtWVxn.js} +1 -1
- package/dist/client/assets/{file-type-icon-ddHjZWG7.js → file-type-icon-Bg1S3Ei1.js} +1 -1
- package/dist/client/assets/{folder-icon-CGbzITGc.js → folder-icon-CxR8-RVw.js} +1 -1
- package/dist/client/assets/{form-CIkzBIkD.js → form--u4B4NJi.js} +1 -1
- package/dist/client/assets/{gateway-client-BfoDyNyS.js → gateway-client-DiYJsqR4.js} +1 -1
- package/dist/client/assets/{general-0uJSAIg1.js → general-DM9JHjeO.js} +1 -1
- package/dist/client/assets/{github-icon-ZHfVS9cH.js → github-icon-BBEFkBwG.js} +1 -1
- package/dist/client/assets/home-CuQ1IW3C.js +1 -0
- package/dist/client/assets/{hooks-DETt4AT1.js → hooks-CV-vS_-T.js} +1 -1
- package/dist/client/assets/{icon-button-B2SkFvD9.js → icon-button-Bec8iaad.js} +1 -1
- package/dist/client/assets/{index-nrrh0CII.js → index-7DoPdPOJ.js} +1 -1
- package/dist/client/assets/{index-DIXFYX3T.js → index-B4QZ541M.js} +1 -1
- package/dist/client/assets/{index-B7X5CqyW.js → index-BXRZsJcB.js} +1 -1
- package/dist/client/assets/{index-DRbZIwZq.js → index-CI8Fg5FQ.js} +1 -1
- package/dist/client/assets/{index-xb9O7QC9.js → index-CxzLOs9-.js} +1 -1
- package/dist/client/assets/{index-BAMGe25h.js → index-D-Zp4RZT.js} +1 -1
- package/dist/client/assets/{index-DNZ8aOGc.js → index-DJondoS3.js} +1 -1
- package/dist/client/assets/{index-SYS1m8f-.js → index-DQycjyPM.js} +1 -1
- package/dist/client/assets/{index-DeHNRxdT.js → index-FYw4S-x6.js} +1 -1
- package/dist/client/assets/{index-CKwDISQd.js → index-RlDlO-Xq.js} +1 -1
- package/dist/client/assets/{index-izHBwn3I.js → index-ZEOg9N-0.js} +2 -2
- package/dist/client/assets/{index-CIQBtrDT.js → index-agB-Lst-.js} +1 -1
- package/dist/client/assets/{index-5-VvRKCO.js → index-hafYo6b5.js} +1 -1
- package/dist/client/assets/{index-redirect-9bNSLe_3.js → index-redirect-DxBLLJF-.js} +1 -1
- package/dist/client/assets/{index-BEGmWtb3.js → index-suG31S3Q.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-DiUuMuMD.js → infiniteQueryObserver-DncsgS0p.js} +1 -1
- package/dist/client/assets/{infra-billing-MS1pmTh3.js → infra-billing-Boedj7dX.js} +1 -1
- package/dist/client/assets/{input-C9yULiWh.js → input-BXP2TM7O.js} +1 -1
- package/dist/client/assets/{input-BLSONHqE.js → input-CQzeigTe.js} +1 -1
- package/dist/client/assets/{input-tXV80IJ3.js → input-DEFAYQBg.js} +1 -1
- package/dist/client/assets/{integration-icon-Vvc8ojiC.js → integration-icon-DIbSFWpy.js} +1 -1
- package/dist/client/assets/{label-BIuQy2__.js → label-B-Bgczac.js} +1 -1
- package/dist/client/assets/{last-preview-page-PW6mp0AD.js → last-preview-page-3Jq4DNX4.js} +1 -1
- package/dist/client/assets/{layout-CGB_h5K-.js → layout-E9djM56z.js} +1 -1
- package/dist/client/assets/{legacy-agents-deep-CUAA26fQ.js → legacy-agents-deep-CiZ-aKCg.js} +1 -1
- package/dist/client/assets/{legacy-main-redirect-BMP2JlQ8.js → legacy-main-redirect-BxtIJnm3.js} +1 -1
- package/dist/client/assets/{library-SSPs2Mk7.js → library-C6Kc6Mch.js} +1 -1
- package/dist/client/assets/{login-CFVOuIMS.js → login-Dv_GcKSK.js} +1 -1
- package/dist/client/assets/{markdown-BNo5hmT4.js → markdown-BG_0k_lo.js} +1 -1
- package/dist/client/assets/{mcp-app-renderer-DC6jfKUS.js → mcp-app-renderer-CBi83l0h.js} +1 -1
- package/dist/client/assets/{mcp-oauth-B-JicvF4.js → mcp-oauth-BwsUk27t.js} +1 -1
- package/dist/client/assets/{members-BPE4uAmB.js → members-C9FaAtX8.js} +1 -1
- package/dist/client/assets/{message-templates-Dbunnp9s.js → message-templates-BGMdrehq.js} +1 -1
- package/dist/client/assets/{mini-report-page-BV-nrHu-.js → mini-report-page-ZBdIaxzG.js} +1 -1
- package/dist/client/assets/{mock-board-BG3v7vPA.js → mock-board-C2sr15lk.js} +4 -4
- package/dist/client/assets/{monaco-editor-BhwzWl9K.js → monaco-editor-KtI0fRSt.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-SjTsJ9Vo.js → monitoring-stats-row-xO2QtbyE.js} +1 -1
- package/dist/client/assets/{multi-select-DsBbPc3L.js → multi-select-C_DYbezu.js} +1 -1
- package/dist/client/assets/{mustache-Dhzc6QWC.js → mustache-CFWS6dkG.js} +1 -1
- package/dist/client/assets/{oauth-callback-C9qvlwPd.js → oauth-callback-DAIEkOi-.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-BLsrFMT9.js → oauth-callback-ai-provider-DBnAKXgj.js} +1 -1
- package/dist/client/assets/{onboarding-DdgObshe.js → onboarding-B_zFw-j_.js} +1 -1
- package/dist/client/assets/{optimistic-project-sidebar-views-BCSGdK6N.js → optimistic-project-sidebar-views-BrJY9Oin.js} +1 -1
- package/dist/client/assets/{org-file-open-context-LEXGiXCZ.js → org-file-open-context-BgftWZUq.js} +1 -1
- package/dist/client/assets/{organization-choice-DWiDrQVs.js → organization-choice-HYpkZ417.js} +1 -1
- package/dist/client/assets/{orgs-CYRhbeGN.js → orgs-D0gMyddZ.js} +1 -1
- package/dist/client/assets/{page-seo-form-Cp5_stqo.js → page-seo-form-xBIbLBok.js} +1 -1
- package/dist/client/assets/{pair-BJZlwx5z.js → pair-Bt1K-1z8.js} +1 -1
- package/dist/client/assets/{plan-ladder-BCVwOSVp.js → plan-ladder-CLwPUekm.js} +1 -1
- package/dist/client/assets/{popover-BiGAM8js.js → popover-BVbs0oEO.js} +1 -1
- package/dist/client/assets/{post-calendar-DKkZ8xsV.js → post-calendar-9OodvYSU.js} +1 -1
- package/dist/client/assets/{post-editor-C-1jCs1B.js → post-editor-Dry2LjOh.js} +1 -1
- package/dist/client/assets/{preview-content-CJyGfLqn.js → preview-content-fu_-YQD3.js} +1 -1
- package/dist/client/assets/{preview-dialog-D4GsgUKO.js → preview-dialog-v_bCl4Me.js} +1 -1
- package/dist/client/assets/{profile-FdAYJLKb.js → profile-Dh7P_rb_.js} +1 -1
- package/dist/client/assets/project-app-view-Chy9fLno.js +1 -0
- package/dist/client/assets/project-feed-CKanWpxx.js +1 -0
- package/dist/client/assets/{project-icon-BfMBNeXz.js → project-icon-BikKPEkD.js} +1 -1
- package/dist/client/assets/project-reports-CxKpKsty.js +1 -0
- package/dist/client/assets/project-tasks-BFNaEkal.js +1 -0
- package/dist/client/assets/{prompts-DDRxwhhq.js → prompts-DgqKLUGg.js} +1 -1
- package/dist/client/assets/record-editor-3waSBefg.js +1 -0
- package/dist/client/assets/{redirect-editor-Cbk1QsyX.js → redirect-editor-BDSBpBoU.js} +1 -1
- package/dist/client/assets/{reports-C7YnJw_5.js → reports-CQKiZQLp.js} +1 -1
- package/dist/client/assets/reports-CvVhaDdL.js +1 -0
- package/dist/client/assets/{reports-onboarding-DhCB4bD9.js → reports-onboarding-C18-sQgL.js} +1 -1
- package/dist/client/assets/reports-tab-BCh3KLP-.js +2 -0
- package/dist/client/assets/{repositories-BDnwrsmL.js → repositories-1ToajNyq.js} +1 -1
- package/dist/client/assets/{repository-import-picker-DHUG6o-B.js → repository-import-picker-BcNMv-1r.js} +1 -1
- package/dist/client/assets/{repository-picker-TE4ZcEAF.js → repository-picker-DiAVlzML.js} +1 -1
- package/dist/client/assets/{require-capability-Hi6Rc10j.js → require-capability-Deu3PBBW.js} +1 -1
- package/dist/client/assets/{required-auth-layout-qs1Hm0B9.js → required-auth-layout-CmM6wfTC.js} +1 -1
- package/dist/client/assets/{reset-password-BHO5OYEQ.js → reset-password-8vGloT63.js} +1 -1
- package/dist/client/assets/{resizable-DvI1E7pk.js → resizable-fOHQB200.js} +1 -1
- package/dist/client/assets/{resolve-tab-icon-nUEsT-q-.js → resolve-tab-icon-BKaGTIX0.js} +1 -1
- package/dist/client/assets/{review-settings-QvrNgLQu.js → review-settings-0OYw8Btd.js} +1 -1
- package/dist/client/assets/{rich-text-link-control-DxPxXWmB.js → rich-text-link-control-CnbUM4hy.js} +1 -1
- package/dist/client/assets/{roles-Cgr78ewd.js → roles-CaL_nMj5.js} +1 -1
- package/dist/client/assets/route-670HLBVr.js +1 -0
- package/dist/client/assets/{route-CawzfcpW.js → route-C89Ibi-U.js} +1 -1
- package/dist/client/assets/{route-BZFTlR2C.js → route-EoxX91hs.js} +1 -1
- package/dist/client/assets/{route-page-header-KSRwTD4y.js → route-page-header-BR3uDdbX.js} +1 -1
- package/dist/client/assets/{runnable-block-editor-CJpnHgrX.js → runnable-block-editor-CSSnSMUj.js} +1 -1
- package/dist/client/assets/{sandbox-lifecycle-context-D0nuKJ_b.js → sandbox-lifecycle-context-ifXPi2sB.js} +1 -1
- package/dist/client/assets/{schema-DNqDLF82.js → schema-BNHw_yaj.js} +1 -1
- package/dist/client/assets/{scroll-area-DQZQeCpt.js → scroll-area-2nNYrI6o.js} +1 -1
- package/dist/client/assets/{search-input-BQOyz7rC.js → search-input-sOf2CkNn.js} +1 -1
- package/dist/client/assets/{search-toggle-B9bFME_G.js → search-toggle-DHKf4hkp.js} +1 -1
- package/dist/client/assets/{secret-picker-BprAET2c.js → secret-picker-HArtpcdA.js} +1 -1
- package/dist/client/assets/{secrets-BrFL2imQ.js → secrets-CRtvxAI3.js} +1 -1
- package/dist/client/assets/{sections-editor-6HKWBNOE.js → sections-editor-Dak8He_5.js} +1 -1
- package/dist/client/assets/{select-BsUP6XU-.js → select-CDb4Y6we.js} +1 -1
- package/dist/client/assets/{select-model-DX5_kOlo.js → select-model-B8r9iW1l.js} +1 -1
- package/dist/client/assets/{seo-editor-DCzXUICs.js → seo-editor-DiL1MO_w.js} +1 -1
- package/dist/client/assets/{separator-gB9bmgZ5.js → separator-DjbMPvYl.js} +1 -1
- package/dist/client/assets/{settings-tab-C6cS3QDh.js → settings-tab-DDCnNeKZ.js} +1 -1
- package/dist/client/assets/{sheet-DTIr0quY.js → sheet-nIqDnTOC.js} +1 -1
- package/dist/client/assets/{shell-layout-BadbomY4.js → shell-layout-DlrnawtV.js} +1 -1
- package/dist/client/assets/{skill-preview-CrxujJbZ.js → skill-preview-B_VPDhQK.js} +1 -1
- package/dist/client/assets/{skills-BjCVlq9E.js → skills-jvTx0zbk.js} +1 -1
- package/dist/client/assets/{sso-H7fs23iU.js → sso-DX4CQ1bL.js} +1 -1
- package/dist/client/assets/{suggestion-Cub6xPAJ.js → suggestion-CUhja5YZ.js} +1 -1
- package/dist/client/assets/{switch-BjEW4lQy.js → switch-t7qZMAr1.js} +1 -1
- package/dist/client/assets/{synced-repos-BOQveWA9.js → synced-repos-CF48wSuR.js} +1 -1
- package/dist/client/assets/{tab-icon-glyph-BvrqhHgJ.js → tab-icon-glyph-C4GTJtUN.js} +1 -1
- package/dist/client/assets/{table-DeAQZdMp.js → table-DnftvMZI.js} +1 -1
- package/dist/client/assets/{tabs-UXACuQIA.js → tabs-qvuPfb43.js} +1 -1
- package/dist/client/assets/{task-board-CFetJZKk.js → task-board-ljGrWoxL.js} +1 -1
- package/dist/client/assets/task-route-BKM4Xpui.js +1 -0
- package/dist/client/assets/{task-status-VgarGQNj.js → task-status-CYNPrsoS.js} +1 -1
- package/dist/client/assets/{taskboard-analytics-057esZ8F.js → taskboard-analytics-B9Ae2NF1.js} +1 -1
- package/dist/client/assets/{tasks-DM161h6Q.js → tasks-CmxeKcJP.js} +1 -1
- package/dist/client/assets/tasks-DMT30e-2.js +1 -0
- package/dist/client/assets/{textarea-tfNNqm-_.js → textarea-HUGiNdEF.js} +1 -1
- package/dist/client/assets/{thread-analytics-D6lYkGRr.js → thread-analytics-BzknO2eq.js} +1 -1
- package/dist/client/assets/{thread-button-CqHz48Ii.js → thread-button-Mi88W5yq.js} +1 -1
- package/dist/client/assets/{thread-intent-EOvgTchU.js → thread-intent-BMPb4FHC.js} +1 -1
- package/dist/client/assets/{thread-route-DwXk0pzt.js → thread-route-B6-rKNY7.js} +1 -1
- package/dist/client/assets/{thread-route-Dg7kv_hv.js → thread-route-aQWXmJRa.js} +1 -1
- package/dist/client/assets/{thread-sheet-body-BN1cpBVG.js → thread-sheet-body-CFGA4vvp.js} +1 -1
- package/dist/client/assets/{toggle-group-DfCcVTyX.js → toggle-group-DA_h_HXU.js} +1 -1
- package/dist/client/assets/{toolbar-icon-button-DOCtjUrJ.js → toolbar-icon-button-GuPkNilC.js} +1 -1
- package/dist/client/assets/{tooltip-DqtfkXwI.js → tooltip-ueF_9wUB.js} +1 -1
- package/dist/client/assets/{track-CWXt8cRU.js → track-DIiSmWcv.js} +1 -1
- package/dist/client/assets/{types-QqaS24ZV.js → types-GBiF4_pn.js} +1 -1
- package/dist/client/assets/{usage-stats-GlPgZezF.js → usage-stats-BANOA0VL.js} +1 -1
- package/dist/client/assets/{use-ai-providers-BGPaB7ua.js → use-ai-providers-Cg5TqweN.js} +1 -1
- package/dist/client/assets/{use-automations-DoGtKsiF.js → use-automations-BN0IdwlA.js} +1 -1
- package/dist/client/assets/{use-autosave-D1L_iXh-.js → use-autosave-C0MZ8y8F.js} +1 -1
- package/dist/client/assets/{use-connect-companion-C9bH45vI.js → use-connect-companion-2ihANcMB.js} +1 -1
- package/dist/client/assets/{use-connection-BsLte2he.js → use-connection-muA7J2aI.js} +1 -1
- package/dist/client/assets/{use-copy-CaOPCxF5.js → use-copy-GNH1dr5B.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BE_pJ71b.js → use-create-virtual-mcp-Bo61Qh3A.js} +1 -1
- package/dist/client/assets/{use-date-fns-locale-Cjw89uE-.js → use-date-fns-locale-rxCEXTtu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CmBQ3Dtm.js → use-debounced-autosave-BO8ZH4BT.js} +1 -1
- package/dist/client/assets/{use-debounced-value-D1fDrXmw.js → use-debounced-value-g5eSlwEs.js} +1 -1
- package/dist/client/assets/{use-deco-credits-BnljnX-n.js → use-deco-credits-dyjA7gE8.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-oRqi_MUt.js → use-decopilot-events-BYxgy68b.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CfXTYsut.js → use-delete-connection-79tyIhdw.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BYSK4yu-.js → use-deployment-admin-JdzK20UW.js} +1 -1
- package/dist/client/assets/{use-entitlements-g5-cEVzp.js → use-entitlements-DN9BNGt3.js} +1 -1
- package/dist/client/assets/{use-fast-preview-draft-url-ByATm-6k.js → use-fast-preview-draft-url-BNJcb2zU.js} +1 -1
- package/dist/client/assets/{use-file-configs-D0LRhOPo.js → use-file-configs-3KTQkP1K.js} +1 -1
- package/dist/client/assets/{use-in-settings-BA5wQFQ2.js → use-in-settings-BjJOlii7.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-EFF__ehg.js → use-infinite-scroll-Cdq_oa9X.js} +1 -1
- package/dist/client/assets/{use-join-requests-Df_QAPcD.js → use-join-requests-B6VYxbNE.js} +1 -1
- package/dist/client/assets/{use-main-panel-tabs-4SKVKtlD.js → use-main-panel-tabs-D5j4jWEV.js} +1 -1
- package/dist/client/assets/{use-mcp-auth-status-r6Fv7Ux6.js → use-mcp-auth-status-DaVamsW3.js} +1 -1
- package/dist/client/assets/{use-mcp-client-CNVDhuvd.js → use-mcp-client-C0x5KHr3.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-Bd28eC02.js → use-mcp-prompts-CuYrjiYF.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-D1dyg5U7.js → use-mcp-tools-DXxLnh-y.js} +1 -1
- package/dist/client/assets/{use-members-CcYULDVF.js → use-members-Biibcmbp.js} +1 -1
- package/dist/client/assets/{use-mobile-Dn4_VWcj.js → use-mobile-C6JHx0PF.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-soNoKU2z.js → use-navigate-to-agent-BRW2ORVP.js} +1 -1
- package/dist/client/assets/use-new-blocks-editor-Bm3T4qU1.js +1 -0
- package/dist/client/assets/{use-open-billing-url-DLsqsUAn.js → use-open-billing-url-Bz9WlBWU.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-BbRXHP84.js → use-org-auth-client-BLaG1Z0T.js} +1 -1
- package/dist/client/assets/{use-org-fs-B9N-OGu5.js → use-org-fs-BXZd9PS4.js} +1 -1
- package/dist/client/assets/{use-org-sso-DcCWDiTW.js → use-org-sso-YRDHHzMK.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CIWlEEfM.js → use-organization-roles-BKmpWJD6.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BWZsG9HZ.js → use-organization-settings-DcPw7cxc.js} +1 -1
- package/dist/client/assets/use-panel-navigate-CKFDS8vd.js +1 -0
- package/dist/client/assets/{use-project-native-view-presence-Bn9lK-SY.js → use-project-native-view-presence-C3ZKCkjq.js} +1 -1
- package/dist/client/assets/{use-project-scope-DIRKMaLK.js → use-project-scope-B8BBVQgr.js} +1 -1
- package/dist/client/assets/{use-releases-DBFdzdKG.js → use-releases-zfLww2wa.js} +1 -1
- package/dist/client/assets/{use-reports-diagnostic-M-tFAPHb.js → use-reports-diagnostic-PwQWFRqX.js} +1 -1
- package/dist/client/assets/{use-route-default-main-BeQVGvWs.js → use-route-default-main-DUSVFY9d.js} +1 -1
- package/dist/client/assets/{use-secrets-BtIO9CRs.js → use-secrets-CiUcs1Ha.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-CgQax-JH.js → use-section-preview-base-BySe2jf2.js} +1 -1
- package/dist/client/assets/{use-session-runtime-CHP3YGA3.js → use-session-runtime-5yIMEZl3.js} +1 -1
- package/dist/client/assets/{use-tags-Dx91jKms.js → use-tags-ChaHfmB_.js} +1 -1
- package/dist/client/assets/{use-task-board-analytics-DO-u1jni.js → use-task-board-analytics-DsHNEkjR.js} +1 -1
- package/dist/client/assets/{use-task-metadata-BxMvdi8M.js → use-task-metadata-48Q23RPw.js} +1 -1
- package/dist/client/assets/{use-thread-analytics-Duxs7POX.js → use-thread-analytics-C25QIJ_I.js} +1 -1
- package/dist/client/assets/{use-thread-outputs-BmNXBkF5.js → use-thread-outputs-BuHSwVqe.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D8Whl5cH.js → use-virtual-mcp-BAw88Bsg.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-WjZflcNE.js +1 -0
- package/dist/client/assets/{useQueries-e2PQJS28.js → useQueries-CK6ScIjP.js} +1 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BNZa-5e9.js +1 -0
- package/dist/client/assets/{users-OvID5j24.js → users-DyeOrBSW.js} +1 -1
- package/dist/client/assets/{utils-Dn4NkWqd.js → utils-BcSQuHiJ.js} +1 -1
- package/dist/client/assets/{variant-calendar-D7VOB7kp.js → variant-calendar-OsMeouUu.js} +1 -1
- package/dist/client/assets/{variant-matcher-override-CVQeLuOR.js → variant-matcher-override-BBGaLET5.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-5kJtAe-y.js → view-mode-toggle-CCaoJjCH.js} +1 -1
- package/dist/client/assets/{virtual-mcp-DWa9T_f2.js → virtual-mcp-DDbXBg25.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +1 -1
- package/dist/server/server.js +1 -1
- package/package.json +1 -1
- package/dist/client/assets/agent-app-CbeamK3b.js +0 -1
- package/dist/client/assets/agent-deck-DtYstLjo.js +0 -1
- package/dist/client/assets/agent-library-file-DQKMT-An.js +0 -1
- package/dist/client/assets/agent-overview-DsLUNfy5.js +0 -1
- package/dist/client/assets/agent-settings-DjUOw7yi.js +0 -1
- package/dist/client/assets/agent-site-editor-code-Btc2xHC2.js +0 -2
- package/dist/client/assets/agent-view-2NBoqN30.js +0 -1
- package/dist/client/assets/api-keys-B_m68tgF.js +0 -1
- package/dist/client/assets/app-editor-BUq8LbjS.js +0 -1
- package/dist/client/assets/home-fbC7tn9p.js +0 -1
- package/dist/client/assets/project-app-view-B9SXqzvV.js +0 -1
- package/dist/client/assets/project-feed-D09MAcoq.js +0 -1
- package/dist/client/assets/project-reports-DwtBmH51.js +0 -1
- package/dist/client/assets/project-tasks-CN6hEoJ8.js +0 -1
- package/dist/client/assets/record-editor-VDQOze8g.js +0 -1
- package/dist/client/assets/reports-tab-Do-8_DzV.js +0 -2
- package/dist/client/assets/reports-wlU1uxEN.js +0 -1
- package/dist/client/assets/route-CTkokDka.js +0 -1
- package/dist/client/assets/task-route-uQ4EUqTW.js +0 -1
- package/dist/client/assets/tasks-B88XVIi1.js +0 -1
- package/dist/client/assets/use-new-blocks-editor-_DNbqg93.js +0 -1
- package/dist/client/assets/use-panel-navigate-BpzTFK7R.js +0 -1
- package/dist/client/assets/useInfiniteQuery-ByafV4ZI.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CflcpPwQ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{an as ve,bN as Oe,bO as Me,ao as de,bM as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a3 as Ee,D as me,K as ee,d as se,p as ye,ak as Ce,eJ as Re,n as Ue,f2 as ue,R as Fe,I as Ve,F as Le,H as Be,G as xe,E as qe,f as Ge,fc as He,o as Ke,am as Xe,al as Qe,t as J}from"./index-izHBwn3I.js";import{g as We}from"./extract-connection-data-ZkeqSXbM.js";import{E as _e}from"./empty-state-Df0p9Roq.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-DmenEJQq.js";import{c as st,S as nt,D as it}from"./index-BEGmWtb3.js";import{u as we,T as ot}from"./use-mcp-auth-status-r6Fv7Ux6.js";import{a as at}from"./use-members-CcYULDVF.js";import{A as lt}from"./avatar-JIBRtdC_.js";import{a as Ie,b as ke,u as rt}from"./use-connection-BsLte2he.js";import{u as Te}from"./use-mcp-client-CNVDhuvd.js";import{u as ct}from"./use-mcp-tools-D1dyg5U7.js";import{a as dt}from"./use-mcp-prompts-Bd28eC02.js";import{i as mt,a as ut}from"./mcp-oauth-B-JicvF4.js";import{I as ae}from"./integration-icon-Vvc8ojiC.js";import{s as xt}from"./Plus-BfQMVZRL.js";import{b2 as pt,ar as ft,bo as ht,l as ne,aq as gt}from"./agent-icon-CP5XN9a-.js";import{a as Ae,f as jt,s as bt}from"./Tool01-DAfFPt6l.js";import{s as re}from"./Trash01-BpbNxWxU.js";import{b as vt,a as Nt,c as St,S as yt,d as Ct}from"./sheet-DTIr0quY.js";import{F as G,b as H,c as K,d as L,f as X,e as _t,a as wt}from"./form-CIkzBIkD.js";import{I as W}from"./input-BLSONHqE.js";import{u as It,D as kt}from"./use-delete-connection-CfXTYsut.js";import{c as Tt,B as At,a as Pt,C as Dt}from"./monitoring-stats-row-SjTsJ9Vo.js";import{b as $t,c as Ot,d as Mt}from"./chart-BXtamRvp.js";import{b as zt}from"./use-virtual-mcp-D8Whl5cH.js";import{T as ie,a as Et,c as oe,b as Rt}from"./tabs-UXACuQIA.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-Dj-9rxCI.js";import{g as ce}from"./types-QqaS24ZV.js";import{M as Ft}from"./mcp-app-renderer-DC6jfKUS.js";import{C as Vt}from"./collection-search-Bm4yfKio.js";import{B as Lt}from"./badge-6y8k_9-5.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-BsUP6XU-.js";import{i as Bt}from"./CheckCircle-Du0Z4Mo4.js";import{t as qt}from"./ChevronUp-Dijj6L1D.js";import{c as Gt}from"./UserSquare-CMMvch3p.js";import{s as Ht}from"./XClose-CgE_NvFQ.js";import{p as Kt,i as Xt}from"./connection-C1K_L2Xe.js";import"./metadata-D72DunRR.js";import"./Key01-B2Ks3SjW.js";import"./auth-WDJFc9Hm.js";import"./index-CKwDISQd.js";import"./index-DNZ8aOGc.js";import"./index-BAMGe25h.js";import"./popover-BiGAM8js.js";import"./tooltip-DqtfkXwI.js";import"./index-xb9O7QC9.js";import"./Check-e9hufNdV.js";import"./SearchMd-BPxAMeCu.js";import"./use-mobile-Dn4_VWcj.js";import"./use-create-virtual-mcp-BE_pJ71b.js";import"./use-navigate-to-agent-soNoKU2z.js";import"./hooks-DETt4AT1.js";import"./backoff-8mStPHYB.js";import"./task-board-CFetJZKk.js";import"./schema-DNqDLF82.js";import"./thread-intent-EOvgTchU.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-B15wwZ1g.js";import"./Eye-CATcYqq7.js";import"./use-org-auth-client-BbRXHP84.js";import"./User01-DZIaW3qt.js";import"./AlertCircle-B4TBXI97.js";import"./ArrowUp-DfYHJg8n.js";import"./ArrowLeft-Du5HwAty.js";import"./ArrowRight-Bk-h8Spa.js";import"./ZoomOut-9vKhCWKn.js";import"./Globe04-dvDQwL6D.js";import"./Copy01-Rd2DUITb.js";import"./CreditCard01-CuV3PHbW.js";import"./DotsVertical-CUOWG-18.js";import"./Share07-CAPMGK5H.js";import"./Image01-CK0bgOXc.js";import"./LayoutLeft-o4EwT_f4.js";import"./Link01-t9xcN1_J.js";import"./LinkExternal01-E0yllQfW.js";import"./Monitor01-2SrwE2A4.js";import"./Sun-Dc2rioTm.js";import"./Palette-DdJDZNuI.js";import"./Upload01-Cu5y084h.js";import"./Users01-B6wD4vfR.js";import"./X-7V7RNG20.js";import"./Zap-BnKV6W7m.js";import"./label-BIuQy2__.js";import"./alert-dialog-DOZYkVkM.js";import"./CartesianChart-B5akGwBy.js";import"./AreaChart-BT_BBtMg.js";import"./ErrorBarContext-BCo_1Dyd.js";import"./Sector-DomxOOd2.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")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Qt}];function Yt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=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),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Jt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=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 o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function Zt(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,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 m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Jt,{instance:_,onConfigure:c}),children:t.jsx(Yt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function es(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(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 ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function is(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=V(),l=Ee(),o=ss(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=es(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx($t,{config:ns,className:"h-16 w-full",children:t.jsxs(At,{data:m,barCategoryGap:"4%",children:[t.jsx(Ot,{content:t.jsx(Mt,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(Pt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(as)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(os)})]})]})}function os(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 as(s,e){return t.jsx(Dt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ls(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){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 cs(s){const e=U.c(22),{connectionId:n}=s,c=V(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ts.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(is,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ds(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function ms(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ds,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function us(s){const e=U.c(13),{connection:n}=s,c=V(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=zt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(ms,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function xs(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=V(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(ps),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(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]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function ps(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function fs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=V(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(js),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let Q;return e[20]!==T||e[21]!==F?(Q=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=Q):Q=e[22],Q}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Et,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(xs,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(gs):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(hs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function hs(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(ht,{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 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: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 js(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(ae,{icon:n.icon,name:a,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx(Ue.Title,{children:a}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=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]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,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 vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=V(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(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(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(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(gt,{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(X,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Le,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(bt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 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(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(_t,{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(X,{})]})})]})}function Ns(s){return s.command==="npx"}function Ss(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(Ns(c)){const l=Ss(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=ys(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Cs(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=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),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function _s({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),m=ke(),{org:p}=te(),x=It({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=at(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=st(O,Wt),v=Xe({resolver:Qe(Je),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=Cs(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await ut({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const Q=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...x}),t.jsx(vt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(Nt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(St,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(yt,{className:"text-base",children:h?.title??s.title}),t.jsx(Ct,{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(wt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(X,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(X,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(cs,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Zt,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=We("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const Q=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await mt({url:Q.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(F)}finally{S(!1)}}}),t.jsx(us,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(fs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ws(){const s=U.c(52),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 a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=Ge(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=rt(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=ct(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map(Ds):(m?.tools??[]).map(Ps);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=Ts;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=dt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=He(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(ks),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(_s,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function ks(s){return{name:s.name,description:s.description}}function Ts(s){return(s??[]).map(As)}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}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(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ws,{})})}),s[0]=e):e=s[0],e}function hi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($s,{}),s[0]=e):e=s[0],e}export{hi as default};
|
|
1
|
+
import{an as ve,bN as Oe,bO as Me,ao as de,bM as ze,c as U,b as V,j as t,h as Ne,B,r as Z,l as Se,X as te,a3 as Ee,D as me,K as ee,d as se,p as ye,ak as Ce,eJ as Re,n as Ue,f2 as ue,R as Fe,I as Ve,F as Le,H as Be,G as xe,E as qe,f as Ge,fc as He,o as Ke,am as Xe,al as Qe,t as J}from"./index-ZEOg9N-0.js";import{g as We}from"./extract-connection-data-Ci8K9pvL.js";import{E as _e}from"./empty-state-CTc-nAQq.js";import{E as Ye,c as Je,r as Ze,b as et,d as tt}from"./connection-form-helpers-BiLRaMfL.js";import{c as st,S as nt,D as it}from"./index-suG31S3Q.js";import{u as we,T as ot}from"./use-mcp-auth-status-DaVamsW3.js";import{a as at}from"./use-members-Biibcmbp.js";import{A as lt}from"./avatar-cVVoBC-4.js";import{a as Ie,b as ke,u as rt}from"./use-connection-muA7J2aI.js";import{u as Te}from"./use-mcp-client-C0x5KHr3.js";import{u as ct}from"./use-mcp-tools-DXxLnh-y.js";import{a as dt}from"./use-mcp-prompts-CuYrjiYF.js";import{i as mt,a as ut}from"./mcp-oauth-BwsUk27t.js";import{I as ae}from"./integration-icon-DIbSFWpy.js";import{s as xt}from"./Plus-BkrhlTLe.js";import{b2 as pt,ar as ft,bo as ht,l as ne,aq as gt}from"./agent-icon-CI9eQ7xC.js";import{a as Ae,f as jt,s as bt}from"./Tool01-CgjdK2MW.js";import{s as re}from"./Trash01-C7Kui6BE.js";import{b as vt,a as Nt,c as St,S as yt,d as Ct}from"./sheet-nIqDnTOC.js";import{F as G,b as H,c as K,d as L,f as X,e as _t,a as wt}from"./form--u4B4NJi.js";import{I as W}from"./input-CQzeigTe.js";import{u as It,D as kt}from"./use-delete-connection-79tyIhdw.js";import{c as Tt,B as At,a as Pt,C as Dt}from"./monitoring-stats-row-xO2QtbyE.js";import{b as $t,c as Ot,d as Mt}from"./chart-B_nJvNcj.js";import{b as zt}from"./use-virtual-mcp-BAw88Bsg.js";import{T as ie,a as Et,c as oe,b as Rt}from"./tabs-qvuPfb43.js";import{g as Pe}from"./connection-slug-CITJ0kGN.js";import{n as Ut}from"./ShoppingBag01-BY7I83X2.js";import{g as ce}from"./types-GBiF4_pn.js";import{M as Ft}from"./mcp-app-renderer-CBi83l0h.js";import{C as Vt}from"./collection-search-21jPub41.js";import{B as Lt}from"./badge-BseQxRHa.js";import{S as pe,b as fe,a as he,d as ge,c as q}from"./select-CDb4Y6we.js";import{i as Bt}from"./CheckCircle-LQiWK3ly.js";import{t as qt}from"./ChevronUp-BcuhULcu.js";import{c as Gt}from"./UserSquare-CB-Meask.js";import{s as Ht}from"./XClose-BrqNA97h.js";import{p as Kt,i as Xt}from"./connection-C83Fa34C.js";import"./metadata-D72DunRR.js";import"./Key01-D0VXcPV1.js";import"./auth-CejvjNNS.js";import"./index-RlDlO-Xq.js";import"./index-DJondoS3.js";import"./index-D-Zp4RZT.js";import"./popover-BVbs0oEO.js";import"./tooltip-ueF_9wUB.js";import"./index-CxzLOs9-.js";import"./Check-xLQDWZBr.js";import"./SearchMd-CHh1gHMI.js";import"./use-mobile-C6JHx0PF.js";import"./use-create-virtual-mcp-Bo61Qh3A.js";import"./use-navigate-to-agent-BRW2ORVP.js";import"./hooks-CV-vS_-T.js";import"./backoff-8mStPHYB.js";import"./task-board-ljGrWoxL.js";import"./schema-BNHw_yaj.js";import"./thread-intent-BMPb4FHC.js";import"./slugify-CEUa2lfQ.js";import"./github-repo-B15wwZ1g.js";import"./Eye-DacK_90s.js";import"./use-org-auth-client-BLaG1Z0T.js";import"./User01-BOZZP-PT.js";import"./AlertCircle-CUfQnpkL.js";import"./ArrowUp-A1GhF0iD.js";import"./ArrowLeft-Bq3Is2w2.js";import"./ArrowRight-C6beJSjX.js";import"./ZoomOut-BHitADvX.js";import"./Globe04-WlooJMD7.js";import"./Copy01-BgPUQX69.js";import"./CreditCard01-BDFFS3TM.js";import"./DotsVertical-Crrqe0Sf.js";import"./Share07-mNsUoEV_.js";import"./Image01-DKGtjhhW.js";import"./LayoutLeft-C1LKOuH_.js";import"./Link01-Cyt--vTk.js";import"./LinkExternal01-BoAIhl8A.js";import"./Monitor01-C_2Yverr.js";import"./Sun-BAOeeRbd.js";import"./Palette-DgXRGI-b.js";import"./Upload01-CWSvTA3M.js";import"./Users01-Db3s7VUn.js";import"./X-BqFXONHn.js";import"./Zap-CACrXYYE.js";import"./label-B-Bgczac.js";import"./alert-dialog-yn_TNVL_.js";import"./CartesianChart-CdUZwP8q.js";import"./AreaChart-7MEIU0BG.js";import"./ErrorBarContext-DVQvj4uR.js";import"./Sector-CNEbMEJs.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")}),Wt=[{name:"MCP_CONFIGURATION",inputSchema:ve({}),outputSchema:Qt}];function Yt(s){const e=U.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=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),m=!(n.connection_type==="VIRTUAL")&&d.supportsOAuth&&!d.isAuthenticated,p=n.status!=="active",x=m||p?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==x?(h=Se("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",x),e[2]=x,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=g):g=e[6];let j;e[7]!==n.title?(j=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let S;e[9]!==n.status||e[10]!==p||e[11]!==m||e[12]!==o?(S=m?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):p?t.jsx("span",{className:"text-xs text-destructive font-medium",children:n.status==="error"?o("details.connectionInstancesPanel.disabledError"):o("details.connectionInstancesPanel.disabled")}):null,e[9]=n.status,e[10]=p,e[11]=m,e[12]=o,e[13]=S):S=e[13];let y;e[14]!==j||e[15]!==S?(y=t.jsxs("div",{className:"flex-1 min-w-0",children:[j,S]}),e[14]=j,e[15]=S,e[16]=y):y=e[16];let C;e[17]!==n||e[18]!==m||e[19]!==a||e[20]!==o?(C=m&&t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:o("details.connectionInstancesPanel.authorize")}),e[17]=n,e[18]=m,e[19]=a,e[20]=o,e[21]=C):C=e[21];let _;e[22]!==n||e[23]!==p||e[24]!==l||e[25]!==o?(_=p?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(pt,{size:13}),o("details.connectionInstancesPanel.enable")]}):t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground",onClick:()=>l(n,"inactive"),title:o("details.connectionInstancesPanel.disable"),"aria-label":o("details.connectionInstancesPanel.disable"),children:t.jsx(ft,{size:13})}),e[22]=n,e[23]=p,e[24]=l,e[25]=o,e[26]=_):_=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let w;e[30]!==o?(w=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=w):w=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let A;e[34]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(Ae,{size:13}),e[34]=A):A=e[34];let O;e[35]!==$||e[36]!==w||e[37]!==M?(O=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:w,"aria-label":M,children:A}),e[35]=$,e[36]=w,e[37]=M,e[38]=O):O=e[38];let k;e[39]!==n||e[40]!==i?(k=()=>i(n),e[39]=n,e[40]=i,e[41]=k):k=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let b;e[44]!==o?(b=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=b):b=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(re,{size:13}),e[46]=E):E=e[46];let z;e[47]!==k||e[48]!==v||e[49]!==b?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:k,title:v,"aria-label":b,children:E}),e[47]=k,e[48]=v,e[49]=b,e[50]=z):z=e[50];let I;e[51]!==O||e[52]!==z||e[53]!==C||e[54]!==_?(I=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[C,_,O,z]}),e[51]=O,e[52]=z,e[53]=C,e[54]=_,e[55]=I):I=e[55];let P;return e[56]!==I||e[57]!==h||e[58]!==g||e[59]!==y?(P=t.jsxs("div",{className:h,children:[g,y,I]}),e[56]=I,e[57]=h,e[58]=g,e[59]=y,e[60]=P):P=e[60],P}function Jt(s){const e=U.c(21),{instance:n,onConfigure:c}=s,a=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 o;e[5]!==n||e[6]!==c?(o=()=>c(n),e[5]=n,e[6]=c,e[7]=o):o=e[7];let r;e[8]!==a?(r=a("details.connectionInstancesPanel.configure"),e[8]=a,e[9]=r):r=e[9];let d;e[10]!==a?(d=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=d):d=e[11];let u;e[12]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx(Ae,{size:13}),e[12]=u):u=e[12];let m;e[13]!==o||e[14]!==r||e[15]!==d?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:o,title:r,"aria-label":d,children:u})}),e[13]=o,e[14]=r,e[15]=d,e[16]=m):m=e[16];let p;return e[17]!==i||e[18]!==l||e[19]!==m?(p=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,m]}),e[17]=i,e[18]=l,e[19]=m,e[20]=p):p=e[20],p}function Zt(s){const e=U.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,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 m;e[3]!==u?(m=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:u}),e[3]=u,e[4]=m):m=e[4];let p;e[5]!==r?(p=r?t.jsx(Ne,{className:"size-[13px]"}):t.jsx(xt,{size:13}),e[5]=r,e[6]=p):p=e[6];let x;e[7]!==d?(x=d("details.connectionInstancesPanel.addInstance"),e[7]=d,e[8]=x):x=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==p||e[12]!==x?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[p,x]}),e[9]=r,e[10]=o,e[11]=p,e[12]=x,e[13]=h):h=e[13];let g;e[14]!==m||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[m,h]}),e[14]=m,e[15]=h,e[16]=g):g=e[16];let j;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let C;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(C=_=>t.jsx(Z.Suspense,{fallback:t.jsx(Jt,{instance:_,onConfigure:c}),children:t.jsx(Yt,{instance:_,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},_.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=C):C=e[27],j=n.map(C),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=j}else j=e[22];let S;e[28]!==j?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:j}),e[28]=j,e[29]=S):S=e[29];let y;return e[30]!==g||e[31]!==S?(y=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=y):y=e[32],y}function es(s,e=3){const n=new Map;for(const c of s){if(!c.isError)continue;const a=(c.errorMessage??"").trim()||"Unknown error";n.set(a,(n.get(a)??0)+1)}return[...n.entries()].map(([c,a])=>({message:c,count:a})).sort((c,a)=>a.count-c.count).slice(0,e)}const ts=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function ss(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 ns={calls:{label:"Tool calls"},errors:{label:"Errors"}};function is(s){const e=U.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=V(),l=Ee(),o=ss(a),{data:r}=me({queryKey:ee.connectionActivity(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}),staleTime:3e5}),{data:d}=me({queryKey:ee.connectionActivityErrors(n,a,c),queryFn:async()=>await l.call("MONITORING_LOGS_LIST",{startDate:o.startDate.toISOString(),endDate:o.endDate.toISOString(),connectionId:n,isError:!0,limit:1,offset:0}),staleTime:3e5}),u=Tt(r?.logs??[],o,void 0,r?.total,d?.total),m=u.data,p=u.totalCalls>0,x=es(r?.logs??[]),h=u.totalCalls>0?Math.round(u.totalErrors/u.totalCalls*100):0;let g;e[0]!==i?(g=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=g):g=e[1];let j;return e[2]!==g?(j=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:g}),e[2]=g,e[3]=j):j=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),j]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),p?t.jsxs("div",{children:[t.jsx($t,{config:ns,className:"h-16 w-full",children:t.jsxs(At,{data:m,barCategoryGap:"4%",children:[t.jsx(Ot,{content:t.jsx(Mt,{labelFormatter:ls}),cursor:{fill:"var(--muted)"}}),t.jsx(Pt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:m.map(as)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:m[m.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:i("details.connectionActivity.noActivityInThisPeriod")})}),x.length>0&&t.jsxs("div",{className:"px-5 py-4 border-t border-border",children:[t.jsxs("p",{className:"text-xs font-medium text-muted-foreground mb-2",children:[i("details.connectionActivity.topErrors"),h>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:h.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:x.map(os)})]})]})}function os(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 as(s,e){return t.jsx(Dt,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function ls(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function rs(){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 cs(s){const e=U.c(22),{connectionId:n}=s,c=V(),[a,i]=Z.useState("14d"),{org:l}=te();let o;e[0]!==c?(o=c("details.connectionActivity.activity"),e[0]=c,e[1]=o):o=e[1];let r;e[2]!==o?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:o})}),e[2]=o,e[3]=r):r=e[3];let d;e[4]!==c?(d=c("details.connectionActivity.timeframe"),e[4]=c,e[5]=d):d=e[5];let u;e[6]!==a?(u=ts.map(j=>t.jsx("button",{type:"button","aria-pressed":a===j.value,onClick:()=>i(j.value),className:Se("px-2.5 py-1 text-xs font-medium rounded-lg transition-colors",a===j.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)),e[6]=a,e[7]=u):u=e[7];let m;e[8]!==d||e[9]!==u?(m=t.jsx("div",{role:"group","aria-label":d,className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:u}),e[8]=d,e[9]=u,e[10]=m):m=e[10];let p;e[11]!==r||e[12]!==m?(p=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,m]}),e[11]=r,e[12]=m,e[13]=p):p=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(rs,{}),e[14]=x):x=e[14];let h;e[15]!==n||e[16]!==l.id||e[17]!==a?(h=t.jsx(Z.Suspense,{fallback:x,children:t.jsx(is,{connectionId:n,orgId:l.id,timeframe:a})}),e[15]=n,e[16]=l.id,e[17]=a,e[18]=h):h=e[18];let g;return e[19]!==p||e[20]!==h?(g=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[p,h]}),e[19]=p,e[20]=h,e[21]=g):g=e[21],g}function ds(s){const e=U.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const m=crypto.randomUUID();a({to:"/$org/projects/$agentId",params:{org:c,agentId:n.id},search:{thread:m}})},e[0]=a,e[1]=c,e[2]=n.id,e[3]=i):i=e[3];let l;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx(ye,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(ae,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:l}),e[5]=n.icon,e[6]=n.title,e[7]=o):o=e[7];let r;e[8]!==n.title?(r=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=r):r=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==i||e[12]!==o||e[13]!==r?(u=t.jsxs("button",{type:"button",onClick:i,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[o,r,d]}),e[11]=i,e[12]=o,e[13]=r,e[14]=u):u=e[14],u}function ms(s){const e=U.c(7),{virtualMcps:n,org:c}=s;let a;if(e[0]!==c||e[1]!==n){let l;e[3]!==c?(l=o=>t.jsx(ds,{virtualMcp:o,org:c},o.id),e[3]=c,e[4]=l):l=e[4],a=n.map(l),e[0]=c,e[1]=n,e[2]=a}else a=e[2];let i;return e[5]!==a?(i=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=i):i=e[6],i}function us(s){const e=U.c(13),{connection:n}=s,c=V(),{org:a}=te();let i;e[0]!==n.id?(i={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=i):i=e[1];const l=zt(i);if(!(l.length>0)){let p;return e[2]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(t.Fragment,{}),e[2]=p):p=e[2],p}let r;e[3]!==c?(r=c("details.connectionAgentsPanel.usedByAgents"),e[3]=c,e[4]=r):r=e[4];let d;e[5]!==r?(d=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:r})}),e[5]=r,e[6]=d):d=e[6];let u;e[7]!==a.slug||e[8]!==l?(u=t.jsx("div",{className:"px-5 py-4",children:t.jsx(ms,{virtualMcps:l,org:a.slug})}),e[7]=a.slug,e[8]=l,e[9]=u):u=e[9];let m;return e[10]!==d||e[11]!==u?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[10]=d,e[11]=u,e[12]=m):m=e[12],m}function xs(s){const e=U.c(35),{tools:n,connectionId:c,org:a}=s,i=V(),l=se(),{org:o}=te();let r;e[0]!==c||e[1]!==o.id||e[2]!==o.slug?(r={connectionId:c,orgId:o.id,orgSlug:o.slug},e[0]=c,e[1]=o.id,e[2]=o.slug,e[3]=r):r=e[3];const d=Te(r),u=Ie(c);let m;e[4]!==u||e[5]!==c?(m=u?Pe(u):c,e[4]=u,e[5]=c,e[6]=m):m=e[6];const p=m,[x,h]=Z.useState("");let g,j,S,y;if(e[7]!==p||e[8]!==d||e[9]!==l||e[10]!==a||e[11]!==x||e[12]!==i||e[13]!==n){const $=(n??[]).filter(ps),w=x.toLowerCase().trim(),M=w?$.filter(b=>b.name.toLowerCase().includes(w)||b.description&&b.description.toLowerCase().includes(w)):$;let A;e[18]!==p||e[19]!==l||e[20]!==a?(A=b=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(b.name)}})},e[18]=p,e[19]=l,e[20]=a,e[21]=A):A=e[21];const O=A;S="flex flex-col h-full overflow-hidden";let k;e[22]!==i?(k=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=k):k=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=b=>{b.key==="Escape"&&(h(""),b.target.blur())},e[24]=v):v=e[24],e[25]!==x||e[26]!==k?(y=t.jsx(Vt,{value:x,onChange:h,placeholder:k,onKeyDown:v}),e[25]=x,e[26]=k,e[27]=y):y=e[27],g="flex-1 overflow-auto p-5",j=M.length===0?t.jsx(_e,{image:null,title:i(x?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(x?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(b=>{const E=ce(b._meta);return t.jsxs(Re,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>O(b),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Ft,{resourceURI:E,toolInfo:{tool:b},displayMode:"inline",minHeight:200,maxHeight:200,client:d})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:b.annotations?.title??b.name}),t.jsx(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]=p,e[8]=d,e[9]=l,e[10]=a,e[11]=x,e[12]=i,e[13]=n,e[14]=g,e[15]=j,e[16]=S,e[17]=y}else g=e[14],j=e[15],S=e[16],y=e[17];let C;e[28]!==g||e[29]!==j?(C=t.jsx("div",{className:g,children:j}),e[28]=g,e[29]=j,e[30]=C):C=e[30];let _;return e[31]!==S||e[32]!==y||e[33]!==C?(_=t.jsxs("div",{className:S,children:[y,C]}),e[31]=S,e[32]=y,e[33]=C,e[34]=_):_=e[34],_}function ps(s){return!!ce(s._meta)}const je=[];function De(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=l=>l.charAt(0).toUpperCase()+l.slice(1),c=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),i=e[e.length-1];return a.length>=2&&i&&c.has(i)?[a.pop(),...a].join(" "):a.join(" ")}function le(s){const e=U.c(5),{label:n}=s,c=V();let a;e[0]!==n||e[1]!==c?(a=c("details.connectionCapabilities.noItemsAvailable",{item:n}),e[0]=n,e[1]=c,e[2]=a):a=e[2];let i;return e[3]!==a?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsx("p",{className:"text-sm text-muted-foreground",children:a})}),e[3]=a,e[4]=i):i=e[4],i}function fs(s){const e=U.c(68),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s,o=c===void 0?je:c,r=a===void 0?je:a,d=V(),u=se(),m=Ie(i??"");let p;e[0]!==m||e[1]!==i?(p=m?Pe(m):i,e[0]=m,e[1]=i,e[2]=p):p=e[2];const x=p;let h;e[3]!==x||e[4]!==i||e[5]!==u||e[6]!==l?(h=function(T){!i||!l||u({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:x,collectionName:"tools",itemId:encodeURIComponent(T)}})},e[3]=x,e[4]=i,e[5]=u,e[6]=l,e[7]=h):h=e[7];const g=h;let j;e[8]!==i||e[9]!==l||e[10]!==n?(j=i&&l&&n.some(js),e[8]=i,e[9]=l,e[10]=n,e[11]=j):j=e[11];const S=j;if(n.length+o.length+r.length===0){let N;e[12]!==d?(N=d("details.connectionCapabilities.capabilities"),e[12]=d,e[13]=N):N=e[13];let T;e[14]!==N?(T=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:N}),e[14]=N,e[15]=T):T=e[15];let D;e[16]!==d?(D=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[16]=d,e[17]=D):D=e[17];let F;e[18]!==D?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:D}),e[18]=D,e[19]=F):F=e[19];let Q;return e[20]!==T||e[21]!==F?(Q=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[T,F]}),e[20]=T,e[21]=F,e[22]=Q):Q=e[22],Q}let C;e[23]!==d||e[24]!==n.length?(C=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[23]=d,e[24]=n.length,e[25]=C):C=e[25];let _;e[26]!==C?(_=t.jsx(ie,{value:"tools",variant:"underline",children:C}),e[26]=C,e[27]=_):_=e[27];let $;e[28]!==S||e[29]!==d?($=S&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[28]=S,e[29]=d,e[30]=$):$=e[30];let w;e[31]!==d?(w=d("details.connectionCapabilities.promptsTab"),e[31]=d,e[32]=w):w=e[32];let M;e[33]!==w?(M=t.jsx(ie,{value:"prompts",variant:"underline",children:w}),e[33]=w,e[34]=M):M=e[34];let A;e[35]!==d?(A=d("details.connectionCapabilities.resourcesTab"),e[35]=d,e[36]=A):A=e[36];let O;e[37]!==A?(O=t.jsx(ie,{value:"resources",variant:"underline",children:A}),e[37]=A,e[38]=O):O=e[38];let k;e[39]!==M||e[40]!==O||e[41]!==_||e[42]!==$?(k=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Et,{variant:"underline",className:"gap-1",children:[_,$,M,O]})}),e[39]=M,e[40]=O,e[41]=_,e[42]=$,e[43]=k):k=e[43];let v;e[44]!==g||e[45]!==n?(v=n.length>0?n.map(N=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>g(N.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(jt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:De(N.name)}),N.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:N.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},N.name)):t.jsx(le,{label:"tools"}),e[44]=g,e[45]=n,e[46]=v):v=e[46];let b;e[47]!==v?(b=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:v})}),e[47]=v,e[48]=b):b=e[48];let E;e[49]!==i||e[50]!==S||e[51]!==l||e[52]!==n?(E=S&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(xs,{tools:n,connectionId:i,org:l})}),e[49]=i,e[50]=S,e[51]=l,e[52]=n,e[53]=E):E=e[53];let z;e[54]!==o?(z=o.length>0?o.map(gs):t.jsx(le,{label:"prompts"}),e[54]=o,e[55]=z):z=e[55];let I;e[56]!==z?(I=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:z})}),e[56]=z,e[57]=I):I=e[57];let P;e[58]!==r?(P=r.length>0?r.map(hs):t.jsx(le,{label:"resources"}),e[58]=r,e[59]=P):P=e[59];let R;e[60]!==P?(R=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:P})}),e[60]=P,e[61]=R):R=e[61];let f;return e[62]!==k||e[63]!==b||e[64]!==E||e[65]!==I||e[66]!==R?(f=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Rt,{defaultValue:"tools",variant:"underline",children:[k,b,E,I,R]})}),e[62]=k,e[63]=b,e[64]=E,e[65]=I,e[66]=R,e[67]=f):f=e[67],f}function hs(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(ht,{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 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: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 js(s){return ce(s._meta)}function bs(s){const e=U.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(ae,{icon:n.icon,name:a,size:"md",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx(Ue.Title,{children:a}),e[3]=a,e[4]=l):l=e[4];let o;e[5]!==n.description?(o=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]=o):o=e[6];let r;e[7]!==l||e[8]!==o?(r=t.jsxs("div",{className:"flex-1 min-w-0",children:[l,o]}),e[7]=l,e[8]=o,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 vs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=V(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Fe(),d=(()=>{if(typeof o!="string"||!o)return!1;try{const x=new URL(o);return x.hostname==="api.githubcopilot.com"&&x.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),u=r||e.connection_type==="STDIO",m=e.connection_type==="VIRTUAL",p=m?Kt(e.connection_url):null;return m?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.type")}),t.jsxs("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:[t.jsx(ye,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),p&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(G,{control:s.control,name:"ui_type",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.connection")}),l!=="NPX"&&l!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(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(W,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:x.value,onValueChange:x.onChange,children:[t.jsx(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(gt,{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(X,{})]})}),l==="NPX"&&t.jsx(G,{control:s.control,name:"npx_package",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(G,{control:s.control,name:"stdio_command",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})}),t.jsx(G,{control:s.control,name:"stdio_args",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(X,{})]})})]}),t.jsx(G,{control:s.control,name:"stdio_cwd",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(W,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),t.jsx(X,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(G,{control:s.control,name:"env_vars",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Ye,{value:x.value??[],onChange:x.onChange})}),t.jsx(X,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(G,{control:s.control,name:"connection_token",render:({field:x})=>t.jsxs(H,{className:"flex flex-col gap-3",children:[t.jsx(K,{className:"text-xs text-muted-foreground font-medium",children:i(d?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ve,{children:[t.jsx(Le,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Lt,{variant:"success",className:"gap-1.5",children:[t.jsx(Bt,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(qt,{size:12})]})})}),t.jsxs(Be,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(bt,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(re,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&x.value===null?t.jsxs("div",{className:"relative group",children:[t.jsx("div",{className:"h-10 px-3 flex items-center rounded-lg border border-border bg-muted/50 text-muted-foreground font-mono text-sm",children:"••••••••••••••••"}),t.jsx("button",{type:"button",onClick:()=>x.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 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(W,{type:"password",placeholder:i(d?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...x,value:x.value||"",className:"h-10 rounded-lg"})}),d&&t.jsxs(_t,{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(X,{})]})})]})}function Ns(s){return s.command==="npx"}function Ss(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ys(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function be(s,e){const n={title:s.title,description:s.description??"",icon:s.icon??null,configuration_state:s.configuration_state??{},configuration_scopes:s.configuration_scopes||[]};if(s.connection_type==="STDIO"&&Xt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(Ns(c)){const l=Ss(c);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const i=ys(c);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:i.command,stdio_args:i.args,stdio_cwd:i.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function Cs(s){let e,n=null,c=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=et(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=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),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...c&&{connection_token:c},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function _s({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=V(),d=se({from:"/$org/settings/connections/$appSlug"}),u=Ke(),m=ke(),{org:p}=te(),x=It({onSuccess:()=>{o.length<=1&&d({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[j,S]=Z.useState(!1),y=we({connectionId:e}),{data:C}=at(),_=C?.data?.members??[],$=h??s,w=_.find(f=>f.userId===$.created_by),A=s?.connection_type==="VIRTUAL"||y.isAuthenticated,O={...s,tools:a},k=st(O,Wt),v=Xe({resolver:Qe(Je),values:be(h??s)}),b=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const N=v.getValues(),T=Cs(N),D=h?.id??e;await m.update.mutateAsync({id:D,data:T}),v.reset(N)},z=()=>{v.reset(be(h??s))},I=async f=>{const N=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:T,tokenInfo:D,error:F}=await ut({connectionId:f,orgSlug:p.slug,...N?{scope:N}:{}});if(F||!T){J.error(r("details.connection.authFailed",{error:F??""}));return}if(D)try{const Y=await fetch(`/api/${p.slug}/connections/${f}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:D.accessToken,refreshToken:D.refreshToken,expiresIn:D.expiresIn,scope:D.scope,clientId:D.clientId,clientSecret:D.clientSecret,tokenEndpoint:D.tokenEndpoint})});if(!Y.ok)console.error("Failed to save OAuth token:",await Y.text()),await m.update.mutateAsync({id:f,data:{connection_token:T}});else try{await m.update.mutateAsync({id:f,data:{}})}catch($e){console.warn("Failed to refresh connection tools after OAuth:",$e)}}catch(Y){console.error("Error saving OAuth token:",Y),await m.update.mutateAsync({id:f,data:{connection_token:T}})}else await m.update.mutateAsync({id:f,data:{connection_token:T}});const Q=new URL(`/api/${p.slug}/mcp/${f}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(Q.href,null)}),await u.invalidateQueries({queryKey:ee.mcpClientPrefix()}),J.success(r("details.connection.authSuccess"))},P=()=>I(s.id),R=async()=>{try{const f=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!f.ok){const T=await f.text();J.error(r("details.connection.failedRemoveOAuth",{error:T}));return}const N=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await u.invalidateQueries({queryKey:ee.isMCPAuthenticated(N.href,null)}),J.success(r("details.connection.oauthRemoved"))}catch(f){console.error("Error removing OAuth token:",f),J.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(kt,{...x}),t.jsx(vt,{open:h!==null,onOpenChange:f=>{f||g(null)},children:t.jsxs(Nt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(St,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(yt,{className:"text-base",children:h?.title??s.title}),t.jsx(Ct,{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(wt,{...v,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(G,{control:v.control,name:"title",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(W,{...f})}),t.jsx(X,{})]})}),t.jsx(G,{control:v.control,name:"description",render:({field:f})=>t.jsxs(H,{children:[t.jsx(K,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(W,{...f,value:f.value||""})}),t.jsx(X,{})]})})]}),t.jsx(vs,{form:v,connection:h??s,hasOAuthToken:y.hasOAuthToken,onReauthenticate:P,onRemoveOAuth:R}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:k,isMCPAuthenticated:A,supportsOAuth:y.supportsOAuth,isServerError:y.isServerError,onAuthenticate:P,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!b||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),b&&t.jsx(B,{variant:"outline",onClick:z,children:r("details.connection.undoButton")}),t.jsxs(B,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const f=h??s;g(null),x.requestDelete(f)},children:[t.jsx(re,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(bs,{connection:s,displayTitle:(()=>{const f=o[0]??s;return f.app_name?f.title.replace(/\s*\(\d+\)\s*$/,""):f.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(cs,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Zt,{instances:o,onConfigure:f=>g(f),onAuthenticate:f=>I(f.id),onDelete:f=>x.requestDelete(f),onToggleStatus:async(f,N)=>{try{await m.update.mutateAsync({id:f.id,data:{status:N}}),J.success(r(N==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{J.error(r("details.connection.failedUpdateConnection"))}},isAdding:j,onAdd:async()=>{S(!0);try{const f=o[0]??s,N=f.title.replace(/\s*\(\d+\)\s*$/,""),T=o.length+1,D=`${N} (${T})`,F=We("conn");await m.create.mutateAsync({id:F,title:D,description:f.description??null,connection_type:f.connection_type,connection_url:f.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:f.created_by,organization_id:f.organization_id,icon:f.icon??null,app_name:f.app_name??null,app_id:f.app_id??null,connection_headers:f.connection_headers??null,oauth_config:null,configuration_state:f.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const Q=new URL(`/api/${p.slug}/mcp/${F}`,window.location.origin),Y=await mt({url:Q.href,token:null,orgId:p.id});Y.supportsOAuth&&!Y.isAuthenticated&&await I(F)}finally{S(!1)}}}),t.jsx(us,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(fs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function ws(){const s=U.c(52),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 a;s[1]===Symbol.for("react.memo_cache_sentinel")?(a={from:"/shell/$org/settings/connections/$appSlug"},s[1]=a):a=s[1];const{appSlug:i,org:l}=Ge(a),{org:o}=te(),r=ke();let d;s[2]!==i?(d={slug:i},s[2]=i,s[3]=d):d=s[3];const u=rt(d),m=u[0]??null,p=m?.id??"",x=p||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==x?(h={connectionId:x,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=x,s[7]=h):h=s[7];const g=Te(h);let j;s[8]!==g?(j={client:g},s[8]=g,s[9]=j):j=s[9];const{data:S}=ct(j);let y;if(s[10]!==m?.tools||s[11]!==p||s[12]!==u||s[13]!==S){const I=S?S.tools.map(Ds):(m?.tools??[]).map(Ps);e:{if(u.length<=1){y=I;break e}const P=new Set,R=[],f=Ts;for(const N of u){const T=N.id===p?I:f(N.tools);for(const D of T)P.has(D.name)||(P.add(D.name),R.push(D))}y=R.length>0?R:I}s[10]=m?.tools,s[11]=p,s[12]=u,s[13]=S,s[14]=y}else y=s[14];const C=y;let _;s[15]!==g?(_={client:g},s[15]=g,s[16]=_):_=s[16];const{data:$}=dt(_);let w;s[17]!==g?(w={client:g},s[17]=g,s[18]=w):w=s[18];const{data:M}=He(w);let A;s[19]!==$?.prompts?(A=$?.prompts??[],s[19]=$?.prompts,s[20]=A):A=s[20];let O;s[21]!==A?(O=A.map(ks),s[21]=A,s[22]=O):O=s[22];const k=O;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let b;s[25]!==v?(b=v.map(Is),s[25]=v,s[26]=b):b=s[26];const E=b;if(!m){let I;s[27]!==e?(I=e("details.connection.notFoundTitle"),s[27]=e,s[28]=I):I=s[28];let P;s[29]!==e?(P=e("details.connection.notFoundDescription"),s[29]=e,s[30]=P):P=s[30];let R;s[31]!==c||s[32]!==l?(R=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=R):R=s[33];let f;s[34]!==e?(f=e("details.connection.backButton"),s[34]=e,s[35]=f):f=s[35];let N;s[36]!==R||s[37]!==f?(N=t.jsx(B,{variant:"outline",onClick:R,children:f}),s[36]=R,s[37]=f,s[38]=N):N=s[38];let T;return s[39]!==I||s[40]!==P||s[41]!==N?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(_e,{title:I,description:P,actions:N})}),s[39]=I,s[40]=P,s[41]=N,s[42]=T):T=s[42],T}let z;return s[43]!==r.update.isPending||s[44]!==C||s[45]!==m||s[46]!==p||s[47]!==l||s[48]!==k||s[49]!==E||s[50]!==u?(z=t.jsx(_s,{org:l,connection:m,connectionId:p,isUpdating:r.update.isPending,tools:C,prompts:k,resources:E,siblings:u}),s[43]=r.update.isPending,s[44]=C,s[45]=m,s[46]=p,s[47]=l,s[48]=k,s[49]=E,s[50]=u,s[51]=z):z=s[51],z}function Is(s){return{name:s.name,description:s.description,uri:s.uri}}function ks(s){return{name:s.name,description:s.description}}function Ts(s){return(s??[]).map(As)}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}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(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Ne,{className:"size-8 text-muted-foreground"})}),children:t.jsx(ws,{})})}),s[0]=e):e=s[0],e}function hi(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx($s,{}),s[0]=e):e=s[0],e}export{hi as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{an as R,bN as A,bO as I,ao as o,bM as j,bL as L,c as z,j as u,B as C}from"./index-
|
|
1
|
+
import{an as R,bN as A,bO as I,ao as o,bM as j,bL as L,c as z,j as u,B as C}from"./index-ZEOg9N-0.js";import{I as H}from"./input-CQzeigTe.js";import{s as W}from"./Plus-BkrhlTLe.js";import{s as q}from"./Trash01-C7Kui6BE.js";const K=R({key:o().min(1,"Key is required"),value:o()}),G=R({title:o().min(1,"Name is required"),description:o().nullable().optional(),icon:o().nullable().optional(),ui_type:L(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:o().optional(),connection_token:o().nullable().optional(),npx_package:o().optional(),stdio_command:o().optional(),stdio_args:o().optional(),stdio_cwd:o().optional(),env_vars:j(K).optional(),configuration_scopes:j(o()).nullable().optional(),configuration_state:A(o(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]}).refine(n=>(n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket")&&n.connection_url?.trim()?o().url().safeParse(n.connection_url.trim()).success:!0,{message:"Enter a valid URL",path:["connection_url"]});function O(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(i=>e.includes(i))||["sk_","rk_","whsec_","pk_live","sk_live"].some(i=>e.startsWith(i))||["_key","_secret","_token","_password","_auth","_pat"].some(i=>e.endsWith(i)))}function X(n){const e=z.c(34),{value:t,onChange:r,keyPlaceholder:a,valuePlaceholder:i,className:v}=n,m=a===void 0?"VARIABLE_NAME":a,h=i===void 0?"value...":i;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>g(s,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:O(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==S?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[w,"Add Environment Variable"]}),e[26]=S,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("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 J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const a={command:n};e.trim()&&(a.args=e.trim().split(/\s+/)),t?.trim()&&(a.cwd=t.trim());const i=V(r);return Object.keys(i).length>0&&(a.envVars=i),a}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as L,c as W,b as te,j as t,B as E,h as de,l as fe,G as ie,F as Re,I as We,H as Xe,E as qe,X as Ne,d as ke,u as Ge,a as Te,R as Qe,ac as ye,U as Je,V as Ye,am as Ze,al as et,n as pe,q as ee,o as tt,a3 as nt,t as R,K as st}from"./index-izHBwn3I.js";import{a as we,g as ot,e as it}from"./extract-connection-data-ZkeqSXbM.js";import{C as ct}from"./collection-display-button-COB8om2q.js";import{S as lt}from"./search-input-BQOyz7rC.js";import{C as rt}from"./collection-tabs-CyEDGPVJ.js";import{C as Ce,u as Ae,g as at}from"./connection-card-C0UBOriU.js";import{E as dt}from"./empty-state-Df0p9Roq.js";import{u as ut,D as gt}from"./use-delete-connection-CfXTYsut.js";import{u as mt}from"./use-infinite-scroll-EFF__ehg.js";import{u as Ie}from"./use-mobile-Dn4_VWcj.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as pt,a as ht,b as ft,c as xt,g as jt,d as St,e as yt,f as Ct}from"./alert-dialog-DOZYkVkM.js";import{aq as xe,bn as vt,ar as bt,b2 as _t,l as Se}from"./agent-icon-CP5XN9a-.js";import{g as Dt,a as Nt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-B9AmIVi-.js";import{D as kt,a as Tt,d as wt,b as At,e as It,f as Pt,g as Mt}from"./drawer-Cmzocoxj.js";import{F as q,b as G,c as Q,d as J,f as Y,a as _e}from"./form-CIkzBIkD.js";import{I as ne}from"./input-BLSONHqE.js";import{S as $t,b as Ot,a as Ft,d as Ut,c as re}from"./select-BsUP6XU-.js";import{T as Vt}from"./textarea-tfNNqm-_.js";import{b as Ve,u as zt}from"./use-connection-BsLte2he.js";import{m as Lt}from"./use-mcp-client-CNVDhuvd.js";import{b as Et}from"./use-virtual-mcp-D8Whl5cH.js";import{g as Bt}from"./types-QqaS24ZV.js";import{s as ze}from"./Plus-BfQMVZRL.js";import{c as Kt}from"./UserSquare-CMMvch3p.js";import{s as Le}from"./XClose-CgE_NvFQ.js";import{i as he,a as De,E as Ht,c as Rt,p as Wt,b as Xt,d as qt}from"./connection-form-helpers-DmenEJQq.js";import{a as Gt}from"./authenticate-and-persist-oauth-BdWTTo89.js";import{I as Qt}from"./integration-icon-Vvc8ojiC.js";import{C as Ee}from"./checkbox-CjlcA4Zf.js";import{i as Jt}from"./DotsVertical-CUOWG-18.js";import{s as Be}from"./Eye-CATcYqq7.js";import{s as Ke}from"./Trash01-BpbNxWxU.js";import"./connection-C1K_L2Xe.js";import"./ArrowUp-DfYHJg8n.js";import"./Check-e9hufNdV.js";import"./tooltip-DqtfkXwI.js";import"./index-xb9O7QC9.js";import"./view-mode-toggle-5kJtAe-y.js";import"./badge-6y8k_9-5.js";import"./SearchMd-BPxAMeCu.js";import"./useInfiniteQuery-ByafV4ZI.js";import"./infiniteQueryObserver-DiUuMuMD.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-B4TBXI97.js";import"./Tool01-DAfFPt6l.js";import"./ArrowLeft-Du5HwAty.js";import"./ArrowRight-Bk-h8Spa.js";import"./ShoppingBag01-Dj-9rxCI.js";import"./ZoomOut-9vKhCWKn.js";import"./Globe04-dvDQwL6D.js";import"./CheckCircle-Du0Z4Mo4.js";import"./ChevronUp-Dijj6L1D.js";import"./Copy01-Rd2DUITb.js";import"./CreditCard01-CuV3PHbW.js";import"./Share07-CAPMGK5H.js";import"./Image01-CK0bgOXc.js";import"./Key01-B2Ks3SjW.js";import"./LayoutLeft-o4EwT_f4.js";import"./Link01-t9xcN1_J.js";import"./LinkExternal01-E0yllQfW.js";import"./Monitor01-2SrwE2A4.js";import"./Sun-Dc2rioTm.js";import"./Palette-DdJDZNuI.js";import"./Upload01-Cu5y084h.js";import"./User01-DZIaW3qt.js";import"./Users01-B6wD4vfR.js";import"./X-7V7RNG20.js";import"./Zap-BnKV6W7m.js";import"./label-BIuQy2__.js";import"./auth-WDJFc9Hm.js";import"./mcp-oauth-B-JicvF4.js";function Yt(s){const e=`deco-filters-${s}`,[n,u]=L.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=>{u(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function Zt(s){const e=W.c(7),[n,u]=L.useState(s),[o,i]=L.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=f=>{n!==f?(u(f),i("asc")):o==="asc"?i("desc"):o==="desc"&&(u(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const a=l;let d;return e[3]!==a||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:a},e[3]=a,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function en(s,e){const n=W.c(12),u=e===void 0?"cards":e,o=Ie(),i=L.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let a;n[0]!==u||n[1]!==l?(a=()=>{const x=globalThis.localStorage?.getItem(l);return x==="cards"||x==="table"?x:u},n[0]=u,n[1]=l,n[2]=a):a=n[2];const[d,f]=L.useState(a);let j;n[3]!==l?(j=x=>{f(x),globalThis.localStorage?.setItem(l,x)},n[3]=l,n[4]=j):j=n[4];const g=j;let r,h;n[5]!==o||n[6]!==d?(r=()=>{!i.current&&o&&d==="table"&&f("cards"),i.current=o},h=[o,d],n[5]=o,n[6]=d,n[7]=r,n[8]=h):(r=n[7],h=n[8]),L.useEffect(r,h);let m;return n[9]!==g||n[10]!==d?(m=[d,g],n[9]=g,n[10]=d,n[11]=m):m=n[11],m}function tn(s){const e=W.c(20),{namespace:n,resource:u,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,a=i===void 0?"table":i,[d,f]=L.useState(""),j=L.useDeferredValue(d),g=`${n}-${u}`,[r,h]=Yt(g),m=`studio-${u}-filter-visible-${n}`;let x;e[0]!==m?(x=()=>globalThis.localStorage?.getItem(m)==="true",e[0]=m,e[1]=x):x=e[1];const[S,v]=L.useState(x);let y;e[2]!==m?(y=O=>{v(O),globalThis.localStorage?.setItem(m,String(O))},e[2]=m,e[3]=y):y=e[3];const c=y;let p;e[4]!==S||e[5]!==c?(p=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=p):p=e[6];const T=p,[k,w]=en(`studio-${u}-${n}`,a),{sortKey:A,sortDirection:$,handleSort:P}=Zt(l),M=A;let I;return e[7]!==S||e[8]!==r||e[9]!==P||e[10]!==d||e[11]!==j||e[12]!==c||e[13]!==h||e[14]!==w||e[15]!==$||e[16]!==M||e[17]!==T||e[18]!==k?(I={search:d,searchTerm:j,setSearch:f,filters:r,setFilters:h,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:T,viewMode:k,setViewMode:w,sortKey:M,sortDirection:$,handleSort:P},e[7]=S,e[8]=r,e[9]=P,e[10]=d,e[11]=j,e[12]=c,e[13]=h,e[14]=w,e[15]=$,e[16]=M,e[17]=T,e[18]=k,e[19]=I):I=e[19],I}function nn(s){const e=W.c(35),{open:n,onOpenChange:u,count:o,onConfirm:i}=s,l=te(),a=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==a?(d=l(a,{count:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx(pt,{children:d}),e[4]=d,e[5]=f):f=e[5];const j=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let g;e[6]!==l||e[7]!==j?(g=l(j),e[6]=l,e[7]=j,e[8]=g):g=e[8];let r;e[9]!==g?(r=t.jsx(ht,{children:g}),e[9]=g,e[10]=r):r=e[10];let h;e[11]!==f||e[12]!==r?(h=t.jsxs(ft,{children:[f,r]}),e[11]=f,e[12]=r,e[13]=h):h=e[13];let m;e[14]!==l?(m=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=m):m=e[15];let x;e[16]!==m?(x=t.jsx(xt,{children:m}),e[16]=m,e[17]=x):x=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==o||e[19]!==l||e[20]!==S?(v=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==i||e[23]!==v?(y=t.jsx(jt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:v}),e[22]=i,e[23]=v,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==x?(c=t.jsxs(St,{children:[x,y]}),e[25]=y,e[26]=x,e[27]=c):c=e[27];let p;e[28]!==c||e[29]!==h?(p=t.jsxs(yt,{children:[h,c]}),e[28]=c,e[29]=h,e[30]=p):p=e[30];let T;return e[31]!==u||e[32]!==n||e[33]!==p?(T=t.jsx(Ct,{open:n,onOpenChange:u,children:p}),e[31]=u,e[32]=n,e[33]=p,e[34]=T):T=e[34],T}function sn(s){const e=W.c(39),{item:n,canManage:u,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:a,onConnect:d}=s,f=te();let j,g;e[0]!==i||e[1]!==n?(j=we(n)??"",g=i.has(j),e[0]=i,e[1]=n,e[2]=j,e[3]=g):(j=e[2],g=e[3]);const r=g;let h;e[4]!==n._meta?(h=Dt(n._meta),e[4]=n._meta,e[5]=h):h=e[5];const m=h,x=m?.friendlyName||m?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let v;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(v=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const y=v;let c;if(e[9]!==o||e[10]!==j){let U;e[12]!==j?(U=b=>b.connection_type!=="VIRTUAL"&&b.app_name===j,e[12]=j,e[13]=U):U=e[13],c=o.filter(U),e[9]=o,e[10]=j,e[11]=c}else c=e[11];const p=c,T=r||u;let k,w;e[14]!==p||e[15]!==r||e[16]!==n||e[17]!==d||e[18]!==a?(k=()=>{if(r){const U=p[0];U&&a(U);return}w()},w=()=>d(n),e[14]=p,e[15]=r,e[16]=n,e[17]=d,e[18]=a,e[19]=k,e[20]=w):(k=e[19],w=e[20]);let A;e[21]!==S||e[22]!==y||e[23]!==x?(A={title:x,description:S,icon:y},e[21]=S,e[22]=y,e[23]=x,e[24]=A):A=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(xe,{}),e[25]=$):$=e[25];const P=T?k:void 0;let M;e[26]!==u||e[27]!==l||e[28]!==w||e[29]!==r||e[30]!==n.id||e[31]!==f?(M=r?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.catalogItemCard.connected")}):u&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:U=>{U.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):f("orgs.catalogItemCard.connect")}),e[26]=u,e[27]=l,e[28]=w,e[29]=r,e[30]=n.id,e[31]=f,e[32]=M):M=e[32];let I;e[33]!==M?(I=t.jsx("div",{className:"flex items-center gap-2",children:M}),e[33]=M,e[34]=I):I=e[34];let O;return e[35]!==A||e[36]!==P||e[37]!==I?(O=t.jsx(Ce,{connection:A,fallbackIcon:$,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=A,e[36]=P,e[37]=I,e[38]=O):O=e[38],O}function on(s){return s?.length?{appToolName:s.find(n=>!!Bt(n._meta))?.name??null}:null}function He(s){const e=W.c(8),{selectionMode:n,children:u}=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=fe("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(Re,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ln,children:t.jsx(Jt,{size:20})})}),e[2]=l):l=e[2];let a;e[3]!==u?(a=t.jsxs(We,{children:[l,t.jsx(Xe,{align:"end",onClick:cn,children:u})]}),e[3]=u,e[4]=a):a=e[4];let d;return e[5]!==i||e[6]!==a?(d=t.jsx("div",{className:i,children:a}),e[5]=i,e[6]=a,e[7]=d):d=e[7],d}function cn(s){return s.stopPropagation()}function ln(s){return s.stopPropagation()}function rn(s){const e=W.c(57),{group:n,onOpen:u,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,a=te();let d;if(e[0]!==n.connections||e[1]!==i){let _;e[3]!==i?(_=V=>i.has(V.id),e[3]=i,e[4]=_):_=e[4],d=n.connections.every(_),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const f=d;let j;if(e[5]!==n.connections||e[6]!==i){let _;e[8]!==i?(_=V=>i.has(V.id),e[8]=i,e[9]=_):_=e[9],j=n.connections.some(_),e[5]=n.connections,e[6]=i,e[7]=j}else j=e[7];const g=j;let r;e[10]!==f||e[11]!==n.connections||e[12]!==l||e[13]!==i?(r=()=>{for(const _ of n.connections)f?i.has(_.id)&&l(_.id):i.has(_.id)||l(_.id)},e[10]=f,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=r):r=e[14];const h=r,m=n.title,x=n.icon;let S;e[15]!==n.connections.length||e[16]!==a?(S=a("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=a,e[17]=S):S=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(v={title:m,icon:x,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==u||e[23]!==o||e[24]!==h?(y=()=>o?h():u(),e[22]=u,e[23]=o,e[24]=h,e[25]=y):y=e[25];const c=o&&f&&"ring-2 ring-primary",p=o&&g&&!f&&"ring-1 ring-primary/50";let T;e[26]!==p||e[27]!==c?(T=fe(c,p),e[26]=p,e[27]=c,e[28]=T):T=e[28];const k=o?f?!0:g&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let A;e[30]!==f||e[31]!==n.connections.length||e[32]!==o||e[33]!==g||e[34]!==a||e[35]!==h?(A=o?t.jsx(Ee,{checked:f?!0:g?"indeterminate":!1,onCheckedChange:h}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=f,e[31]=n.connections.length,e[32]=o,e[33]=g,e[34]=a,e[35]=h,e[36]=A):A=e[36];let $;e[37]!==u?($=_=>{_.stopPropagation(),u()},e[37]=u,e[38]=$):$=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let M;e[40]!==a?(M=a("orgs.connectionSelectionUi.open"),e[40]=a,e[41]=M):M=e[41];let I;e[42]!==$||e[43]!==M?(I=t.jsxs(ie,{onClick:$,children:[P,M]}),e[42]=$,e[43]=M,e[44]=I):I=e[44];let O;e[45]!==o||e[46]!==I?(O=t.jsx(He,{selectionMode:o,children:I}),e[45]=o,e[46]=I,e[47]=O):O=e[47];let U;e[48]!==A||e[49]!==O?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[A,O]}),e[48]=A,e[49]=O,e[50]=U):U=e[50];let b;return e[51]!==T||e[52]!==k||e[53]!==U||e[54]!==v||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:y,className:T,selected:k,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=T,e[52]=k,e[53]=U,e[54]=v,e[55]=y,e[56]=b):b=e[56],b}function an(s){const e=W.c(36),{connection:n,isSelected:u,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:a,onOpen:d,onToggleStatus:f,onDelete:j}=s,g=te();let r;e[0]!==u||e[1]!==a||e[2]!==o||e[3]!==g?(r=o?t.jsx(Ee,{checked:u,onCheckedChange:a,onClick:dn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:g("orgs.connectionSelectionUi.connected")}),e[0]=u,e[1]=a,e[2]=o,e[3]=g,e[4]=r):r=e[4];let h;e[5]!==d?(h=k=>{k.stopPropagation(),d()},e[5]=d,e[6]=h):h=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Be,{size:16}),e[7]=m):m=e[7];let x;e[8]!==g?(x=g("orgs.connectionSelectionUi.open"),e[8]=g,e[9]=x):x=e[9];let S;e[10]!==h||e[11]!==x?(S=t.jsxs(ie,{onClick:h,children:[m,x]}),e[10]=h,e[11]=x,e[12]=S):S=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==a||e[16]!==g?(v=(i||l)&&t.jsxs(ie,{onClick:k=>{k.stopPropagation(),a()},children:[t.jsx(vt,{size:16}),g("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=a,e[16]=g,e[17]=v):v=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==f||e[21]!==g?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:k=>{k.stopPropagation(),f("inactive")},children:[t.jsx(bt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:k=>{k.stopPropagation(),f("active")},children:[t.jsx(_t,{size:16}),g("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=f,e[21]=g,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==j||e[25]!==g?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:k=>{k.stopPropagation(),j()},children:[t.jsx(Ke,{size:16}),g("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=j,e[25]=g,e[26]=c):c=e[26];let p;e[27]!==o||e[28]!==S||e[29]!==v||e[30]!==y||e[31]!==c?(p=t.jsxs(He,{selectionMode:o,children:[S,v,y,c]}),e[27]=o,e[28]=S,e[29]=v,e[30]=y,e[31]=c,e[32]=p):p=e[32];let T;return e[33]!==r||e[34]!==p?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[r,p]}),e[33]=r,e[34]=p,e[35]=T):T=e[35],T}function dn(s){return s.stopPropagation()}function un(s){const e=W.c(29),{count:n,total:u,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:a,onDelete:d,onAddToAgent:f,onToggleStatus:j,onCancel:g}=s,r=te();if(n===0)return null;let h;e[0]!==n||e[1]!==r?(h=r("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=r,e[2]=h):h=e[2];let m;e[3]!==h?(m=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:h}),e[3]=h,e[4]=m):m=e[4];let x;e[5]!==n||e[6]!==a||e[7]!==l||e[8]!==r||e[9]!==u?(x=n<u?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:r("orgs.connectionSelectionUi.selectAll",{total:u})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:r("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=a,e[7]=l,e[8]=r,e[9]=u,e[10]=x):x=e[10];let S;e[11]!==i||e[12]!==f||e[13]!==r?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:[t.jsx(ze,{size:13}),r("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=f,e[13]=r,e[14]=S):S=e[14];let v;e[15]!==o||e[16]!==d||e[17]!==j||e[18]!==r?(v=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>j("active"),children:r("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>j("inactive"),children:r("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Ke,{size:13}),r("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=j,e[18]=r,e[19]=v):v=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]!==g?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:y}),e[21]=g,e[22]=c):c=e[22];let p;return e[23]!==m||e[24]!==x||e[25]!==S||e[26]!==v||e[27]!==c?(p=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:[m,x,S,v,c]})}),e[23]=m,e[24]=x,e[25]=S,e[26]=v,e[27]=c,e[28]=p):p=e[28],p}function gn(s){const e=W.c(45),{open:n,onOpenChange:u,agents:o,onConfirm:i}=s,l=te(),[a,d]=L.useState(null);let f;e[0]!==l?(f=l("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=l,e[1]=f):f=e[1];let j;e[2]!==f?(j=t.jsx(Pe,{children:f}),e[2]=f,e[3]=j):j=e[3];let g;e[4]!==l?(g=l("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=l,e[5]=g):g=e[5];let r;e[6]!==g?(r=t.jsx(Me,{children:g}),e[6]=g,e[7]=r):r=e[7];let h;e[8]!==j||e[9]!==r?(h=t.jsxs($e,{children:[j,r]}),e[8]=j,e[9]=r,e[10]=h):h=e[10];let m;e[11]!==o||e[12]!==a||e[13]!==l?(m=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(P=>t.jsxs("button",{type:"button",onClick:()=>d(P.id),className:fe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",a===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Qt,{icon:P.icon,name:P.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=o,e[12]=a,e[13]=l,e[14]=m):m=e[14];let x;e[15]!==m?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:m}),e[15]=m,e[16]=x):x=e[16];let S;e[17]!==u?(S=()=>u(!1),e[17]=u,e[18]=S):S=e[18];let v;e[19]!==l?(v=l("orgs.connectionSelectionUi.cancel"),e[19]=l,e[20]=v):v=e[20];let y;e[21]!==S||e[22]!==v?(y=t.jsx(E,{variant:"outline",onClick:S,children:v}),e[21]=S,e[22]=v,e[23]=y):y=e[23];const c=!a;let p;e[24]!==i||e[25]!==u||e[26]!==a?(p=()=>{a&&(i(a),u(!1),d(null))},e[24]=i,e[25]=u,e[26]=a,e[27]=p):p=e[27];let T;e[28]!==l?(T=l("orgs.connectionSelectionUi.add"),e[28]=l,e[29]=T):T=e[29];let k;e[30]!==c||e[31]!==p||e[32]!==T?(k=t.jsx(E,{disabled:c,onClick:p,children:T}),e[30]=c,e[31]=p,e[32]=T,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let A;e[37]!==w||e[38]!==h||e[39]!==x?(A=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[h,x,w]}),e[37]=w,e[38]=h,e[39]=x,e[40]=A):A=e[40];let $;return e[41]!==u||e[42]!==n||e[43]!==A?($=t.jsx(Ue,{open:n,onOpenChange:u,children:A}),e[41]=u,e[42]=n,e[43]=A,e[44]=$):$=e[44],$}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:u}){const o=te(),{org:i}=Ne(),l=tt(),a=ke(),{data:d}=Te.useSession(),f=Ve(),j=zt(s),g=ut(),{granted:r}=ye("connections:manage"),{granted:h}=ye("agents:manage"),[m,x]=L.useState(new Set),S=m.size>0,[v,y]=L.useState(!1),[c,p]=L.useState(!1),[T,k]=L.useState(null),w=Et(),A=j.filter(C=>!(n!=="ALL"&&C.connection_type!==n||u!=="ALL"&&C.status!==u)),$=at(A),P=C=>{x(D=>{const B=new Set(D);return B.has(C)?B.delete(C):B.add(C),B})},M=()=>{x(new Set)},I=Ae(s.searchTerm),O=I.items,U=mt(I.loadMore,I.hasMore,I.isLoadingMore),b=new Set(j.filter(C=>C.app_name).map(C=>C.app_name)),_=s.search.length>0,V=e==="all"||_?O.filter(C=>{if(_){const D=we(C);if(D&&b.has(D))return!1}return!0}):[],Z=e==="connected"||_?$:[],X=async C=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:C.id,source:"connections_page"}),k(C.id);try{const D=it(C,i.id,d.user.id,{remoteIndex:0}),B=D.connection_type==="STDIO",H=!!D.connection_url,K=B&&D.connection_headers&&typeof D.connection_headers=="object"&&"command"in D.connection_headers;if(!H&&!K){R.error(o("orgs.connections.cannotConnectNoMethod")),k(null);return}const se=await f.create.mutateAsync(D),{id:oe}=se,ce=await Gt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>f.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:st.isMCPAuthenticated(le.href,null)}),z(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(Lt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=on((await le.listTools()).tools)}catch{}const ve=ae(se),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ve}}:null;R.success(o("orgs.connections.connectedSuccessfully"),be?{action:{label:o("orgs.connections.openConnection"),onClick:()=>a(be)}}:void 0)}catch(D){R.error(o("orgs.connections.failedToConnect",{error:D instanceof Error?D.message:String(D)}))}finally{k(null)}}},N=nt(),z=()=>{l.invalidateQueries({predicate:C=>{const D=C.queryKey;return D[1]===i.id&&D[3]==="collection"&&D[4]==="CONNECTIONS"}})},F=async()=>{y(!1);const C=[...m];ee("connections_bulk_delete",{count:C.length});const B=(await Promise.allSettled(C.map(H=>N.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;z(),R.success(o("orgs.connections.deletedConnections",{count:B})),M()},ue=async(C,D)=>{try{await f.update.mutateAsync({id:C,data:{status:D}}),z(),R.success(o(D==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},je=async C=>{const D=[...m];ee("connections_bulk_status_toggled",{count:D.length,to_status:C});const H=(await Promise.allSettled(D.map(K=>f.update.mutateAsync({id:K,data:{status:C}})))).filter(K=>K.status==="fulfilled").length;z(),R.success(C==="active"?o("orgs.connections.enabledConnections",{count:H}):o("orgs.connections.disabledConnections",{count:H})),M()},ge=async C=>{const D=w.find(K=>K.id===C);if(!D)return;ee("connections_bulk_add_to_agent",{agent_id:C,count:m.size});const B=new Set(D.connections.map(K=>K.connection_id)),H=[...m].filter(K=>!B.has(K)).map(K=>({connection_id:K,selected_tools:null,selected_resources:null,selected_prompts:null}));if(H.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await N.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:C,data:{connections:[...D.connections,...H]}}),l.invalidateQueries({predicate:K=>{const se=K.queryKey;return se[1]===i.id&&se[3]==="collection"&&se[4]==="VIRTUAL_MCP"}}),R.success(o("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:D.title})),M()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...g}),t.jsx(nn,{open:v,onOpenChange:y,count:m.size,onConfirm:F}),t.jsx(gn,{open:c,onOpenChange:p,agents:w,onConfirm:ge}),I.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:(_?V.length===0&&A.length===0:e==="all"?V.length===0:A.length===0)?t.jsx(dt,{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(r?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[Z.map(C=>{if(C.type==="group")return t.jsx(rn,{group:C,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:C.key}})},selectionMode:S,selectedIds:m,onToggleSelect:P},C.key);const D=C.connection,B=m.has(D.id);return t.jsx(Ce,{connection:D,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(D.id):a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),className:fe(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(an,{connection:D,isSelected:B,selectionMode:S,canManage:r,canManageAgents:h,onToggleSelect:()=>P(D.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),onToggleStatus:H=>ue(D.id,H),onDelete:()=>g.requestDelete(D)})},D.id)}),V.map(C=>t.jsx(sn,{item:C,canManage:r,allConnections:j,connectedAppNames:b,connectingItemId:T,onNavigateConnected:D=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),onConnect:X},C.id)),(e==="all"||_)&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||_)&&I.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(un,{count:m.size,total:A.length,canManage:r,canManageAgents:h,onSelectAll:()=>{x(new Set(A.map(C=>C.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>y(!0),onAddToAgent:()=>p(!0),onToggleStatus:je,onCancel:M})]})}function pn(){const s=te(),{org:e}=Ne(),n=ke(),u=Ge({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:i}=Qe(),l=Ie(),{granted:a}=ye("connections:manage"),d=tn({namespace:e.slug,resource:"connections"}),f=Ve(),[j,g]=Je(Ye.connectionsTab(e.slug),b=>u.tab==="all"||u.tab==="connected"?u.tab:b??"all"),[r,h]=L.useState("ALL"),[m,x]=L.useState("ALL"),v=Ae(d.searchTerm).items,y=d.search!==d.searchTerm,c=Ze({resolver:et(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=c.watch("ui_type"),T=c.watch("connection_url"),k=c.watch("npx_package"),w=he({uiType:p,connectionUrl:T??"",npxPackage:k??""})??De({uiType:p,connectionUrl:T??"",registryItems:v}),A=a&&u.action==="create",$=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},P=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},M=async b=>{let _,V=null,Z=null,X=null;b.ui_type==="NPX"?(_="STDIO",V="",X=Xt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(_="STDIO",V="",X=qt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(_=b.ui_type,V=b.connection_url||"",Z=b.connection_token||null);const N=ot("conn");ee("connection_custom_created",{connection_type:_,ui_type:b.ui_type}),await f.create.mutateAsync({id:N,title:b.title,description:b.description||null,connection_type:_,connection_url:V,connection_token:Z,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:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),P(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:V,title:b.title,id:N})}})},I=b=>{b||(A&&P(),c.reset())},O=b=>{const _=b.trim();if(!_)return;const V=!!c.formState.dirtyFields.title,Z=!!c.formState.dirtyFields.description,X=!!c.formState.dirtyFields.env_vars,N=F=>{if(F&&(!V&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!Z&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!X&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(C=>C.key)),ge=F.envVarKeys.filter(C=>!je.has(C));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(C=>({key:C,value:""}))],{shouldDirty:!0})}},z=Wt(_);if(z&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",z.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),N(he({uiType:"NPX",npxPackage:z.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",_,{shouldDirty:!0}),N(he({uiType:F,connectionUrl:_})??De({uiType:F,connectionUrl:_,registryItems:v}));return}p==="NPX"&&N(he({uiType:"NPX",npxPackage:_}))},U=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:$,children:[t.jsx(ze,{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"),_=s("orgs.connections.createConnectionDescription"),V=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),Z=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:c.control,name:"ui_type",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.type")}),t.jsxs($t,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ot,{children:t.jsx(Ft,{})})}),t.jsxs(Ut,{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(Kt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Y,{})]})}),p==="NPX"&&t.jsx(q,{control:c.control,name:"npx_package",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const F=z.clipboardData.getData("text");F&&(z.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),O(F))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Y,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:c.control,name:"stdio_command",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.command")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Y,{})]})}),t.jsx(q,{control:c.control,name:"stdio_args",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Y,{})]})})]}),t.jsx(q,{control:c.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Y,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(q,{control:c.control,name:"env_vars",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Ht,{value:N.value??[],onChange:N.onChange})}),t.jsx(Y,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:c.control,name:"connection_url",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.url")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const F=z.clipboardData.getData("text");F&&(z.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),O(F))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Y,{})]})}),t.jsx(q,{control:c.control,name:"connection_token",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(ne,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...N,value:N.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(Y,{})]})})]}),t.jsx(q,{control:c.control,name:"title",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.name")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.namePlaceholder"),...N})}),t.jsx(Y,{})]})}),t.jsx(q,{control:c.control,name:"description",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Vt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Y,{})]})})]}),X=A;return l?t.jsx(kt,{open:X,onOpenChange:I,children:t.jsxs(Tt,{className:"max-h-[90vh]",children:[t.jsx(wt,{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(At,{children:b}),t.jsx(It,{className:"mt-1",children:_})]}),t.jsx(Pt,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Le,{size:16})})})]})}),t.jsx(_e,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(M),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:Z}),t.jsx(Mt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:I,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:b}),t.jsx(Me,{children:_})]}),t.jsx(_e,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(M),children:[t.jsx("div",{className:"py-4",children:Z}),t.jsxs(Oe,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>I(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),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:U,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(lt,{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(ct,{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:r,onChange:b=>h(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:m,onChange:b=>x(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(rt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:j,onTabChange:b=>{const _=b;_!==j&&ee("connections_page_tab_changed",{to_tab:_}),g(_)}}),t.jsx(L.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(mn,{listState:d,activeTab:j,typeFilter:r,statusFilter:m})})})]})})})]})})}function $s(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(L.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(pn,{})})}),s[0]=e):e=s[0],e}export{$s as default};
|
|
1
|
+
import{r as L,c as W,b as te,j as t,B as E,h as de,l as fe,G as ie,F as Re,I as We,H as Xe,E as qe,X as Ne,d as ke,u as Ge,a as Te,R as Qe,ac as ye,U as Je,V as Ye,am as Ze,al as et,n as pe,q as ee,o as tt,a3 as nt,t as R,K as st}from"./index-ZEOg9N-0.js";import{a as we,g as ot,e as it}from"./extract-connection-data-Ci8K9pvL.js";import{C as ct}from"./collection-display-button-D1fzsKIi.js";import{S as lt}from"./search-input-sOf2CkNn.js";import{C as rt}from"./collection-tabs-D8JuoGr4.js";import{C as Ce,u as Ae,g as at}from"./connection-card-BlyIILyc.js";import{E as dt}from"./empty-state-CTc-nAQq.js";import{u as ut,D as gt}from"./use-delete-connection-79tyIhdw.js";import{u as mt}from"./use-infinite-scroll-Cdq_oa9X.js";import{u as Ie}from"./use-mobile-C6JHx0PF.js";import{g as ae}from"./connection-slug-CITJ0kGN.js";import{A as pt,a as ht,b as ft,c as xt,g as jt,d as St,e as yt,f as Ct}from"./alert-dialog-yn_TNVL_.js";import{aq as xe,bn as vt,ar as bt,b2 as _t,l as Se}from"./agent-icon-CI9eQ7xC.js";import{g as Dt,a as Nt}from"./metadata-D72DunRR.js";import{d as Pe,h as Me,c as $e,e as Oe,b as Fe,D as Ue}from"./dialog-NChNDvdJ.js";import{D as kt,a as Tt,d as wt,b as At,e as It,f as Pt,g as Mt}from"./drawer-GHZKTfaK.js";import{F as q,b as G,c as Q,d as J,f as Y,a as _e}from"./form--u4B4NJi.js";import{I as ne}from"./input-CQzeigTe.js";import{S as $t,b as Ot,a as Ft,d as Ut,c as re}from"./select-CDb4Y6we.js";import{T as Vt}from"./textarea-HUGiNdEF.js";import{b as Ve,u as zt}from"./use-connection-muA7J2aI.js";import{m as Lt}from"./use-mcp-client-C0x5KHr3.js";import{b as Et}from"./use-virtual-mcp-BAw88Bsg.js";import{g as Bt}from"./types-GBiF4_pn.js";import{s as ze}from"./Plus-BkrhlTLe.js";import{c as Kt}from"./UserSquare-CB-Meask.js";import{s as Le}from"./XClose-BrqNA97h.js";import{i as he,a as De,E as Ht,c as Rt,p as Wt,b as Xt,d as qt}from"./connection-form-helpers-BiLRaMfL.js";import{a as Gt}from"./authenticate-and-persist-oauth-BWJIYJrq.js";import{I as Qt}from"./integration-icon-DIbSFWpy.js";import{C as Ee}from"./checkbox-DnfD_ijV.js";import{i as Jt}from"./DotsVertical-Crrqe0Sf.js";import{s as Be}from"./Eye-DacK_90s.js";import{s as Ke}from"./Trash01-C7Kui6BE.js";import"./connection-C83Fa34C.js";import"./ArrowUp-A1GhF0iD.js";import"./Check-xLQDWZBr.js";import"./tooltip-ueF_9wUB.js";import"./index-CxzLOs9-.js";import"./view-mode-toggle-CCaoJjCH.js";import"./badge-BseQxRHa.js";import"./SearchMd-CHh1gHMI.js";import"./useInfiniteQuery-WjZflcNE.js";import"./infiniteQueryObserver-DncsgS0p.js";import"./slugify-CEUa2lfQ.js";import"./AlertCircle-CUfQnpkL.js";import"./Tool01-CgjdK2MW.js";import"./ArrowLeft-Bq3Is2w2.js";import"./ArrowRight-C6beJSjX.js";import"./ShoppingBag01-BY7I83X2.js";import"./ZoomOut-BHitADvX.js";import"./Globe04-WlooJMD7.js";import"./CheckCircle-LQiWK3ly.js";import"./ChevronUp-BcuhULcu.js";import"./Copy01-BgPUQX69.js";import"./CreditCard01-BDFFS3TM.js";import"./Share07-mNsUoEV_.js";import"./Image01-DKGtjhhW.js";import"./Key01-D0VXcPV1.js";import"./LayoutLeft-C1LKOuH_.js";import"./Link01-Cyt--vTk.js";import"./LinkExternal01-BoAIhl8A.js";import"./Monitor01-C_2Yverr.js";import"./Sun-BAOeeRbd.js";import"./Palette-DgXRGI-b.js";import"./Upload01-CWSvTA3M.js";import"./User01-BOZZP-PT.js";import"./Users01-Db3s7VUn.js";import"./X-BqFXONHn.js";import"./Zap-CACrXYYE.js";import"./label-B-Bgczac.js";import"./auth-CejvjNNS.js";import"./mcp-oauth-BwsUk27t.js";function Yt(s){const e=`deco-filters-${s}`,[n,u]=L.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=>{u(i);try{globalThis.localStorage?.setItem(e,JSON.stringify(i))}catch(l){console.error("Failed to save filters:",l)}}]}function Zt(s){const e=W.c(7),[n,u]=L.useState(s),[o,i]=L.useState(s?"desc":null);let l;e[0]!==o||e[1]!==n?(l=f=>{n!==f?(u(f),i("asc")):o==="asc"?i("desc"):o==="desc"&&(u(void 0),i(null))},e[0]=o,e[1]=n,e[2]=l):l=e[2];const a=l;let d;return e[3]!==a||e[4]!==o||e[5]!==n?(d={sortKey:n,sortDirection:o,handleSort:a},e[3]=a,e[4]=o,e[5]=n,e[6]=d):d=e[6],d}function en(s,e){const n=W.c(12),u=e===void 0?"cards":e,o=Ie(),i=L.useRef(o),l=s?`deco-view-mode-${s}`:"deco-view-mode";let a;n[0]!==u||n[1]!==l?(a=()=>{const x=globalThis.localStorage?.getItem(l);return x==="cards"||x==="table"?x:u},n[0]=u,n[1]=l,n[2]=a):a=n[2];const[d,f]=L.useState(a);let j;n[3]!==l?(j=x=>{f(x),globalThis.localStorage?.setItem(l,x)},n[3]=l,n[4]=j):j=n[4];const g=j;let r,h;n[5]!==o||n[6]!==d?(r=()=>{!i.current&&o&&d==="table"&&f("cards"),i.current=o},h=[o,d],n[5]=o,n[6]=d,n[7]=r,n[8]=h):(r=n[7],h=n[8]),L.useEffect(r,h);let m;return n[9]!==g||n[10]!==d?(m=[d,g],n[9]=g,n[10]=d,n[11]=m):m=n[11],m}function tn(s){const e=W.c(20),{namespace:n,resource:u,defaultSortKey:o,defaultViewMode:i}=s,l=o===void 0?"title":o,a=i===void 0?"table":i,[d,f]=L.useState(""),j=L.useDeferredValue(d),g=`${n}-${u}`,[r,h]=Yt(g),m=`studio-${u}-filter-visible-${n}`;let x;e[0]!==m?(x=()=>globalThis.localStorage?.getItem(m)==="true",e[0]=m,e[1]=x):x=e[1];const[S,v]=L.useState(x);let y;e[2]!==m?(y=O=>{v(O),globalThis.localStorage?.setItem(m,String(O))},e[2]=m,e[3]=y):y=e[3];const c=y;let p;e[4]!==S||e[5]!==c?(p=()=>{c(!S)},e[4]=S,e[5]=c,e[6]=p):p=e[6];const T=p,[k,w]=en(`studio-${u}-${n}`,a),{sortKey:A,sortDirection:$,handleSort:P}=Zt(l),M=A;let I;return e[7]!==S||e[8]!==r||e[9]!==P||e[10]!==d||e[11]!==j||e[12]!==c||e[13]!==h||e[14]!==w||e[15]!==$||e[16]!==M||e[17]!==T||e[18]!==k?(I={search:d,searchTerm:j,setSearch:f,filters:r,setFilters:h,filterBarVisible:S,setFilterBarVisible:c,toggleFilterBar:T,viewMode:k,setViewMode:w,sortKey:M,sortDirection:$,handleSort:P},e[7]=S,e[8]=r,e[9]=P,e[10]=d,e[11]=j,e[12]=c,e[13]=h,e[14]=w,e[15]=$,e[16]=M,e[17]=T,e[18]=k,e[19]=I):I=e[19],I}function nn(s){const e=W.c(35),{open:n,onOpenChange:u,count:o,onConfirm:i}=s,l=te(),a=o===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==o||e[1]!==l||e[2]!==a?(d=l(a,{count:o}),e[0]=o,e[1]=l,e[2]=a,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx(pt,{children:d}),e[4]=d,e[5]=f):f=e[5];const j=o===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let g;e[6]!==l||e[7]!==j?(g=l(j),e[6]=l,e[7]=j,e[8]=g):g=e[8];let r;e[9]!==g?(r=t.jsx(ht,{children:g}),e[9]=g,e[10]=r):r=e[10];let h;e[11]!==f||e[12]!==r?(h=t.jsxs(ft,{children:[f,r]}),e[11]=f,e[12]=r,e[13]=h):h=e[13];let m;e[14]!==l?(m=l("orgs.bulkDeleteDialog.cancelButton"),e[14]=l,e[15]=m):m=e[15];let x;e[16]!==m?(x=t.jsx(xt,{children:m}),e[16]=m,e[17]=x):x=e[17];const S=o===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let v;e[18]!==o||e[19]!==l||e[20]!==S?(v=l(S,{count:o}),e[18]=o,e[19]=l,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==i||e[23]!==v?(y=t.jsx(jt,{onClick:i,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:v}),e[22]=i,e[23]=v,e[24]=y):y=e[24];let c;e[25]!==y||e[26]!==x?(c=t.jsxs(St,{children:[x,y]}),e[25]=y,e[26]=x,e[27]=c):c=e[27];let p;e[28]!==c||e[29]!==h?(p=t.jsxs(yt,{children:[h,c]}),e[28]=c,e[29]=h,e[30]=p):p=e[30];let T;return e[31]!==u||e[32]!==n||e[33]!==p?(T=t.jsx(Ct,{open:n,onOpenChange:u,children:p}),e[31]=u,e[32]=n,e[33]=p,e[34]=T):T=e[34],T}function sn(s){const e=W.c(39),{item:n,canManage:u,allConnections:o,connectedAppNames:i,connectingItemId:l,onNavigateConnected:a,onConnect:d}=s,f=te();let j,g;e[0]!==i||e[1]!==n?(j=we(n)??"",g=i.has(j),e[0]=i,e[1]=n,e[2]=j,e[3]=g):(j=e[2],g=e[3]);const r=g;let h;e[4]!==n._meta?(h=Dt(n._meta),e[4]=n._meta,e[5]=h):h=e[5];const m=h,x=m?.friendlyName||m?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",S=n.server?.description||n.description||null;let v;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(v=n.server?.icons?.[0]?.src||Nt(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=v):v=e[8];const y=v;let c;if(e[9]!==o||e[10]!==j){let U;e[12]!==j?(U=b=>b.connection_type!=="VIRTUAL"&&b.app_name===j,e[12]=j,e[13]=U):U=e[13],c=o.filter(U),e[9]=o,e[10]=j,e[11]=c}else c=e[11];const p=c,T=r||u;let k,w;e[14]!==p||e[15]!==r||e[16]!==n||e[17]!==d||e[18]!==a?(k=()=>{if(r){const U=p[0];U&&a(U);return}w()},w=()=>d(n),e[14]=p,e[15]=r,e[16]=n,e[17]=d,e[18]=a,e[19]=k,e[20]=w):(k=e[19],w=e[20]);let A;e[21]!==S||e[22]!==y||e[23]!==x?(A={title:x,description:S,icon:y},e[21]=S,e[22]=y,e[23]=x,e[24]=A):A=e[24];let $;e[25]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(xe,{}),e[25]=$):$=e[25];const P=T?k:void 0;let M;e[26]!==u||e[27]!==l||e[28]!==w||e[29]!==r||e[30]!==n.id||e[31]!==f?(M=r?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.catalogItemCard.connected")}):u&&t.jsx(E,{variant:"outline",size:"sm",className:"h-7 px-3 text-sm font-medium",disabled:l!==null,onClick:U=>{U.stopPropagation(),w()},children:l===n.id?t.jsx(de,{className:"size-3.5"}):f("orgs.catalogItemCard.connect")}),e[26]=u,e[27]=l,e[28]=w,e[29]=r,e[30]=n.id,e[31]=f,e[32]=M):M=e[32];let I;e[33]!==M?(I=t.jsx("div",{className:"flex items-center gap-2",children:M}),e[33]=M,e[34]=I):I=e[34];let O;return e[35]!==A||e[36]!==P||e[37]!==I?(O=t.jsx(Ce,{connection:A,fallbackIcon:$,onClick:P,headerActionsAlwaysVisible:!0,headerActions:I}),e[35]=A,e[36]=P,e[37]=I,e[38]=O):O=e[38],O}function on(s){return s?.length?{appToolName:s.find(n=>!!Bt(n._meta))?.name??null}:null}function He(s){const e=W.c(8),{selectionMode:n,children:u}=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=fe("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(Re,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:ln,children:t.jsx(Jt,{size:20})})}),e[2]=l):l=e[2];let a;e[3]!==u?(a=t.jsxs(We,{children:[l,t.jsx(Xe,{align:"end",onClick:cn,children:u})]}),e[3]=u,e[4]=a):a=e[4];let d;return e[5]!==i||e[6]!==a?(d=t.jsx("div",{className:i,children:a}),e[5]=i,e[6]=a,e[7]=d):d=e[7],d}function cn(s){return s.stopPropagation()}function ln(s){return s.stopPropagation()}function rn(s){const e=W.c(57),{group:n,onOpen:u,selectionMode:o,selectedIds:i,onToggleSelect:l}=s,a=te();let d;if(e[0]!==n.connections||e[1]!==i){let _;e[3]!==i?(_=V=>i.has(V.id),e[3]=i,e[4]=_):_=e[4],d=n.connections.every(_),e[0]=n.connections,e[1]=i,e[2]=d}else d=e[2];const f=d;let j;if(e[5]!==n.connections||e[6]!==i){let _;e[8]!==i?(_=V=>i.has(V.id),e[8]=i,e[9]=_):_=e[9],j=n.connections.some(_),e[5]=n.connections,e[6]=i,e[7]=j}else j=e[7];const g=j;let r;e[10]!==f||e[11]!==n.connections||e[12]!==l||e[13]!==i?(r=()=>{for(const _ of n.connections)f?i.has(_.id)&&l(_.id):i.has(_.id)||l(_.id)},e[10]=f,e[11]=n.connections,e[12]=l,e[13]=i,e[14]=r):r=e[14];const h=r,m=n.title,x=n.icon;let S;e[15]!==n.connections.length||e[16]!==a?(S=a("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=a,e[17]=S):S=e[17];let v;e[18]!==n.icon||e[19]!==n.title||e[20]!==S?(v={title:m,icon:x,description:S},e[18]=n.icon,e[19]=n.title,e[20]=S,e[21]=v):v=e[21];let y;e[22]!==u||e[23]!==o||e[24]!==h?(y=()=>o?h():u(),e[22]=u,e[23]=o,e[24]=h,e[25]=y):y=e[25];const c=o&&f&&"ring-2 ring-primary",p=o&&g&&!f&&"ring-1 ring-primary/50";let T;e[26]!==p||e[27]!==c?(T=fe(c,p),e[26]=p,e[27]=c,e[28]=T):T=e[28];const k=o?f?!0:g&&"mixed":void 0;let w;e[29]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(xe,{}),e[29]=w):w=e[29];let A;e[30]!==f||e[31]!==n.connections.length||e[32]!==o||e[33]!==g||e[34]!==a||e[35]!==h?(A=o?t.jsx(Ee,{checked:f?!0:g?"indeterminate":!1,onCheckedChange:h}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=f,e[31]=n.connections.length,e[32]=o,e[33]=g,e[34]=a,e[35]=h,e[36]=A):A=e[36];let $;e[37]!==u?($=_=>{_.stopPropagation(),u()},e[37]=u,e[38]=$):$=e[38];let P;e[39]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx(Be,{size:16}),e[39]=P):P=e[39];let M;e[40]!==a?(M=a("orgs.connectionSelectionUi.open"),e[40]=a,e[41]=M):M=e[41];let I;e[42]!==$||e[43]!==M?(I=t.jsxs(ie,{onClick:$,children:[P,M]}),e[42]=$,e[43]=M,e[44]=I):I=e[44];let O;e[45]!==o||e[46]!==I?(O=t.jsx(He,{selectionMode:o,children:I}),e[45]=o,e[46]=I,e[47]=O):O=e[47];let U;e[48]!==A||e[49]!==O?(U=t.jsxs("div",{className:"flex items-center gap-1",children:[A,O]}),e[48]=A,e[49]=O,e[50]=U):U=e[50];let b;return e[51]!==T||e[52]!==k||e[53]!==U||e[54]!==v||e[55]!==y?(b=t.jsx(t.Fragment,{children:t.jsx(Ce,{connection:v,onClick:y,className:T,selected:k,fallbackIcon:w,headerActionsAlwaysVisible:!0,headerActions:U})}),e[51]=T,e[52]=k,e[53]=U,e[54]=v,e[55]=y,e[56]=b):b=e[56],b}function an(s){const e=W.c(36),{connection:n,isSelected:u,selectionMode:o,canManage:i,canManageAgents:l,onToggleSelect:a,onOpen:d,onToggleStatus:f,onDelete:j}=s,g=te();let r;e[0]!==u||e[1]!==a||e[2]!==o||e[3]!==g?(r=o?t.jsx(Ee,{checked:u,onCheckedChange:a,onClick:dn}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:g("orgs.connectionSelectionUi.connected")}),e[0]=u,e[1]=a,e[2]=o,e[3]=g,e[4]=r):r=e[4];let h;e[5]!==d?(h=k=>{k.stopPropagation(),d()},e[5]=d,e[6]=h):h=e[6];let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Be,{size:16}),e[7]=m):m=e[7];let x;e[8]!==g?(x=g("orgs.connectionSelectionUi.open"),e[8]=g,e[9]=x):x=e[9];let S;e[10]!==h||e[11]!==x?(S=t.jsxs(ie,{onClick:h,children:[m,x]}),e[10]=h,e[11]=x,e[12]=S):S=e[12];let v;e[13]!==i||e[14]!==l||e[15]!==a||e[16]!==g?(v=(i||l)&&t.jsxs(ie,{onClick:k=>{k.stopPropagation(),a()},children:[t.jsx(vt,{size:16}),g("orgs.connectionSelectionUi.select")]}),e[13]=i,e[14]=l,e[15]=a,e[16]=g,e[17]=v):v=e[17];let y;e[18]!==i||e[19]!==n||e[20]!==f||e[21]!==g?(y=i&&(n.status==="active"?t.jsxs(ie,{onClick:k=>{k.stopPropagation(),f("inactive")},children:[t.jsx(bt,{size:16}),g("orgs.connectionSelectionUi.disable")]}):t.jsxs(ie,{onClick:k=>{k.stopPropagation(),f("active")},children:[t.jsx(_t,{size:16}),g("orgs.connectionSelectionUi.enable")]})),e[18]=i,e[19]=n,e[20]=f,e[21]=g,e[22]=y):y=e[22];let c;e[23]!==i||e[24]!==j||e[25]!==g?(c=i&&t.jsxs(ie,{variant:"destructive",onClick:k=>{k.stopPropagation(),j()},children:[t.jsx(Ke,{size:16}),g("orgs.connectionSelectionUi.delete")]}),e[23]=i,e[24]=j,e[25]=g,e[26]=c):c=e[26];let p;e[27]!==o||e[28]!==S||e[29]!==v||e[30]!==y||e[31]!==c?(p=t.jsxs(He,{selectionMode:o,children:[S,v,y,c]}),e[27]=o,e[28]=S,e[29]=v,e[30]=y,e[31]=c,e[32]=p):p=e[32];let T;return e[33]!==r||e[34]!==p?(T=t.jsxs("div",{className:"flex items-center gap-1",children:[r,p]}),e[33]=r,e[34]=p,e[35]=T):T=e[35],T}function dn(s){return s.stopPropagation()}function un(s){const e=W.c(29),{count:n,total:u,canManage:o,canManageAgents:i,onSelectAll:l,onDeselectAll:a,onDelete:d,onAddToAgent:f,onToggleStatus:j,onCancel:g}=s,r=te();if(n===0)return null;let h;e[0]!==n||e[1]!==r?(h=r("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=r,e[2]=h):h=e[2];let m;e[3]!==h?(m=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:h}),e[3]=h,e[4]=m):m=e[4];let x;e[5]!==n||e[6]!==a||e[7]!==l||e[8]!==r||e[9]!==u?(x=n<u?t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:r("orgs.connectionSelectionUi.selectAll",{total:u})}):t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:r("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=a,e[7]=l,e[8]=r,e[9]=u,e[10]=x):x=e[10];let S;e[11]!==i||e[12]!==f||e[13]!==r?(S=i&&t.jsxs(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:[t.jsx(ze,{size:13}),r("orgs.connectionSelectionUi.addToAgent")]}),e[11]=i,e[12]=f,e[13]=r,e[14]=S):S=e[14];let v;e[15]!==o||e[16]!==d||e[17]!==j||e[18]!==r?(v=o&&t.jsxs(t.Fragment,{children:[t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>j("active"),children:r("orgs.connectionSelectionUi.enable")}),t.jsx(E,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>j("inactive"),children:r("orgs.connectionSelectionUi.disable")}),t.jsxs(E,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Ke,{size:13}),r("orgs.connectionSelectionUi.delete")]})]}),e[15]=o,e[16]=d,e[17]=j,e[18]=r,e[19]=v):v=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]!==g?(c=t.jsx(E,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:g,children:y}),e[21]=g,e[22]=c):c=e[22];let p;return e[23]!==m||e[24]!==x||e[25]!==S||e[26]!==v||e[27]!==c?(p=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:[m,x,S,v,c]})}),e[23]=m,e[24]=x,e[25]=S,e[26]=v,e[27]=c,e[28]=p):p=e[28],p}function gn(s){const e=W.c(45),{open:n,onOpenChange:u,agents:o,onConfirm:i}=s,l=te(),[a,d]=L.useState(null);let f;e[0]!==l?(f=l("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=l,e[1]=f):f=e[1];let j;e[2]!==f?(j=t.jsx(Pe,{children:f}),e[2]=f,e[3]=j):j=e[3];let g;e[4]!==l?(g=l("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=l,e[5]=g):g=e[5];let r;e[6]!==g?(r=t.jsx(Me,{children:g}),e[6]=g,e[7]=r):r=e[7];let h;e[8]!==j||e[9]!==r?(h=t.jsxs($e,{children:[j,r]}),e[8]=j,e[9]=r,e[10]=h):h=e[10];let m;e[11]!==o||e[12]!==a||e[13]!==l?(m=o.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:l("orgs.connectionSelectionUi.noAgentsFound")}):o.map(P=>t.jsxs("button",{type:"button",onClick:()=>d(P.id),className:fe("flex items-center gap-3 w-full rounded-lg px-3 py-2 text-left transition-colors",a===P.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Qt,{icon:P.icon,name:P.title,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",children:P.title}),P.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:P.description})]})]},P.id)),e[11]=o,e[12]=a,e[13]=l,e[14]=m):m=e[14];let x;e[15]!==m?(x=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:m}),e[15]=m,e[16]=x):x=e[16];let S;e[17]!==u?(S=()=>u(!1),e[17]=u,e[18]=S):S=e[18];let v;e[19]!==l?(v=l("orgs.connectionSelectionUi.cancel"),e[19]=l,e[20]=v):v=e[20];let y;e[21]!==S||e[22]!==v?(y=t.jsx(E,{variant:"outline",onClick:S,children:v}),e[21]=S,e[22]=v,e[23]=y):y=e[23];const c=!a;let p;e[24]!==i||e[25]!==u||e[26]!==a?(p=()=>{a&&(i(a),u(!1),d(null))},e[24]=i,e[25]=u,e[26]=a,e[27]=p):p=e[27];let T;e[28]!==l?(T=l("orgs.connectionSelectionUi.add"),e[28]=l,e[29]=T):T=e[29];let k;e[30]!==c||e[31]!==p||e[32]!==T?(k=t.jsx(E,{disabled:c,onClick:p,children:T}),e[30]=c,e[31]=p,e[32]=T,e[33]=k):k=e[33];let w;e[34]!==y||e[35]!==k?(w=t.jsxs(Oe,{children:[y,k]}),e[34]=y,e[35]=k,e[36]=w):w=e[36];let A;e[37]!==w||e[38]!==h||e[39]!==x?(A=t.jsxs(Fe,{className:"sm:max-w-[400px]",children:[h,x,w]}),e[37]=w,e[38]=h,e[39]=x,e[40]=A):A=e[40];let $;return e[41]!==u||e[42]!==n||e[43]!==A?($=t.jsx(Ue,{open:n,onOpenChange:u,children:A}),e[41]=u,e[42]=n,e[43]=A,e[44]=$):$=e[44],$}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:u}){const o=te(),{org:i}=Ne(),l=tt(),a=ke(),{data:d}=Te.useSession(),f=Ve(),j=zt(s),g=ut(),{granted:r}=ye("connections:manage"),{granted:h}=ye("agents:manage"),[m,x]=L.useState(new Set),S=m.size>0,[v,y]=L.useState(!1),[c,p]=L.useState(!1),[T,k]=L.useState(null),w=Et(),A=j.filter(C=>!(n!=="ALL"&&C.connection_type!==n||u!=="ALL"&&C.status!==u)),$=at(A),P=C=>{x(D=>{const B=new Set(D);return B.has(C)?B.delete(C):B.add(C),B})},M=()=>{x(new Set)},I=Ae(s.searchTerm),O=I.items,U=mt(I.loadMore,I.hasMore,I.isLoadingMore),b=new Set(j.filter(C=>C.app_name).map(C=>C.app_name)),_=s.search.length>0,V=e==="all"||_?O.filter(C=>{if(_){const D=we(C);if(D&&b.has(D))return!1}return!0}):[],Z=e==="connected"||_?$:[],X=async C=>{if(!(!i||!d?.user?.id)){ee("connection_add_clicked",{action:"connect_new",registry_item_id:C.id,source:"connections_page"}),k(C.id);try{const D=it(C,i.id,d.user.id,{remoteIndex:0}),B=D.connection_type==="STDIO",H=!!D.connection_url,K=B&&D.connection_headers&&typeof D.connection_headers=="object"&&"command"in D.connection_headers;if(!H&&!K){R.error(o("orgs.connections.cannotConnectNoMethod")),k(null);return}const se=await f.create.mutateAsync(D),{id:oe}=se,ce=await Gt({connectionId:oe,orgId:i.id,orgSlug:i.slug,persistFallback:le=>f.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:st.isMCPAuthenticated(le.href,null)}),z(),R.success(o("orgs.connections.authenticationSuccessful"))}let me=null;try{const le=await l.fetchQuery(Lt({connectionId:oe,orgId:i.id,orgSlug:i.slug}));me=on((await le.listTools()).tools)}catch{}const ve=ae(se),be=me?me.appToolName?{to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:i.slug,appSlug:ve,collectionName:"tools",itemId:encodeURIComponent(me.appToolName)}}:{to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ve}}:null;R.success(o("orgs.connections.connectedSuccessfully"),be?{action:{label:o("orgs.connections.openConnection"),onClick:()=>a(be)}}:void 0)}catch(D){R.error(o("orgs.connections.failedToConnect",{error:D instanceof Error?D.message:String(D)}))}finally{k(null)}}},N=nt(),z=()=>{l.invalidateQueries({predicate:C=>{const D=C.queryKey;return D[1]===i.id&&D[3]==="collection"&&D[4]==="CONNECTIONS"}})},F=async()=>{y(!1);const C=[...m];ee("connections_bulk_delete",{count:C.length});const B=(await Promise.allSettled(C.map(H=>N.call("COLLECTION_CONNECTIONS_DELETE",{id:H,force:!0})))).filter(H=>H.status==="fulfilled").length;z(),R.success(o("orgs.connections.deletedConnections",{count:B})),M()},ue=async(C,D)=>{try{await f.update.mutateAsync({id:C,data:{status:D}}),z(),R.success(o(D==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{R.error(o("orgs.connections.failedToUpdateConnection"))}},je=async C=>{const D=[...m];ee("connections_bulk_status_toggled",{count:D.length,to_status:C});const H=(await Promise.allSettled(D.map(K=>f.update.mutateAsync({id:K,data:{status:C}})))).filter(K=>K.status==="fulfilled").length;z(),R.success(C==="active"?o("orgs.connections.enabledConnections",{count:H}):o("orgs.connections.disabledConnections",{count:H})),M()},ge=async C=>{const D=w.find(K=>K.id===C);if(!D)return;ee("connections_bulk_add_to_agent",{agent_id:C,count:m.size});const B=new Set(D.connections.map(K=>K.connection_id)),H=[...m].filter(K=>!B.has(K)).map(K=>({connection_id:K,selected_tools:null,selected_resources:null,selected_prompts:null}));if(H.length===0){R.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await N.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:C,data:{connections:[...D.connections,...H]}}),l.invalidateQueries({predicate:K=>{const se=K.queryKey;return se[1]===i.id&&se[3]==="collection"&&se[4]==="VIRTUAL_MCP"}}),R.success(o("orgs.connections.addedConnectionsToAgent",{count:H.length,agentTitle:D.title})),M()}catch{R.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(gt,{...g}),t.jsx(nn,{open:v,onOpenChange:y,count:m.size,onConfirm:F}),t.jsx(gn,{open:c,onOpenChange:p,agents:w,onConfirm:ge}),I.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:(_?V.length===0&&A.length===0:e==="all"?V.length===0:A.length===0)?t.jsx(dt,{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(r?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[Z.map(C=>{if(C.type==="group")return t.jsx(rn,{group:C,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:C.key}})},selectionMode:S,selectedIds:m,onToggleSelect:P},C.key);const D=C.connection,B=m.has(D.id);return t.jsx(Ce,{connection:D,fallbackIcon:t.jsx(xe,{}),onClick:()=>S?P(D.id):a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),className:fe(B&&"ring-2 ring-primary bg-primary/5"),selected:S?B:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(an,{connection:D,isSelected:B,selectionMode:S,canManage:r,canManageAgents:h,onToggleSelect:()=>P(D.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),onToggleStatus:H=>ue(D.id,H),onDelete:()=>g.requestDelete(D)})},D.id)}),V.map(C=>t.jsx(sn,{item:C,canManage:r,allConnections:j,connectedAppNames:b,connectingItemId:T,onNavigateConnected:D=>a({to:"/$org/settings/connections/$appSlug",params:{org:i.slug,appSlug:ae(D)}}),onConnect:X},C.id)),(e==="all"||_)&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||_)&&I.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(un,{count:m.size,total:A.length,canManage:r,canManageAgents:h,onSelectAll:()=>{x(new Set(A.map(C=>C.id)))},onDeselectAll:()=>x(new Set),onDelete:()=>y(!0),onAddToAgent:()=>p(!0),onToggleStatus:je,onCancel:M})]})}function pn(){const s=te(),{org:e}=Ne(),n=ke(),u=Ge({strict:!1}),{data:o}=Te.useSession(),{stdioEnabled:i}=Qe(),l=Ie(),{granted:a}=ye("connections:manage"),d=tn({namespace:e.slug,resource:"connections"}),f=Ve(),[j,g]=Je(Ye.connectionsTab(e.slug),b=>u.tab==="all"||u.tab==="connected"?u.tab:b??"all"),[r,h]=L.useState("ALL"),[m,x]=L.useState("ALL"),v=Ae(d.searchTerm).items,y=d.search!==d.searchTerm,c=Ze({resolver:et(Rt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),p=c.watch("ui_type"),T=c.watch("connection_url"),k=c.watch("npx_package"),w=he({uiType:p,connectionUrl:T??"",npxPackage:k??""})??De({uiType:p,connectionUrl:T??"",registryItems:v}),A=a&&u.action==="create",$=()=>{ee("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},P=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},M=async b=>{let _,V=null,Z=null,X=null;b.ui_type==="NPX"?(_="STDIO",V="",X=Xt(b.npx_package||"",b.env_vars||[])):b.ui_type==="STDIO"?(_="STDIO",V="",X=qt(b.stdio_command||"",b.stdio_args||"",b.stdio_cwd,b.env_vars||[])):(_=b.ui_type,V=b.connection_url||"",Z=b.connection_token||null);const N=ot("conn");ee("connection_custom_created",{connection_type:_,ui_type:b.ui_type}),await f.create.mutateAsync({id:N,title:b.title,description:b.description||null,connection_type:_,connection_url:V,connection_token:Z,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:X,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),P(),c.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:ae({app_name:null,connection_url:V,title:b.title,id:N})}})},I=b=>{b||(A&&P(),c.reset())},O=b=>{const _=b.trim();if(!_)return;const V=!!c.formState.dirtyFields.title,Z=!!c.formState.dirtyFields.description,X=!!c.formState.dirtyFields.env_vars,N=F=>{if(F&&(!V&&!c.getValues("title").trim()&&F.title&&c.setValue("title",F.title,{shouldDirty:!1}),!Z&&!(c.getValues("description")??"").trim()&&F.description&&c.setValue("description",F.description,{shouldDirty:!1}),!X&&F.envVarKeys?.length)){const ue=c.getValues("env_vars")??[],je=new Set(ue.map(C=>C.key)),ge=F.envVarKeys.filter(C=>!je.has(C));ge.length>0&&c.setValue("env_vars",[...ue,...ge.map(C=>({key:C,value:""}))],{shouldDirty:!0})}},z=Wt(_);if(z&&i){c.setValue("ui_type","NPX",{shouldDirty:!0}),c.setValue("npx_package",z.packageName,{shouldDirty:!0}),c.setValue("connection_url","",{shouldDirty:!0}),c.setValue("connection_token",null,{shouldDirty:!0}),N(he({uiType:"NPX",npxPackage:z.packageName}));return}if(_.startsWith("http://")||_.startsWith("https://")){const F=p==="HTTP"||p==="SSE"||p==="Websocket"?p:"HTTP";c.setValue("ui_type",F,{shouldDirty:!0}),c.setValue("connection_url",_,{shouldDirty:!0}),N(he({uiType:F,connectionUrl:_})??De({uiType:F,connectionUrl:_,registryItems:v}));return}p==="NPX"&&N(he({uiType:"NPX",npxPackage:_}))},U=a?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(E,{size:"sm",variant:"default",onClick:$,children:[t.jsx(ze,{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"),_=s("orgs.connections.createConnectionDescription"),V=c.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),Z=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(q,{control:c.control,name:"ui_type",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.type")}),t.jsxs($t,{value:N.value,onValueChange:N.onChange,children:[t.jsx(J,{children:t.jsx(Ot,{children:t.jsx(Ft,{})})}),t.jsxs(Ut,{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(Kt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(Y,{})]})}),p==="NPX"&&t.jsx(q,{control:c.control,name:"npx_package",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.npmPackage")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...N,value:N.value??"",onPaste:z=>{const F=z.clipboardData.getData("text");F&&(z.preventDefault(),c.setValue("npx_package",F.trim(),{shouldDirty:!0}),O(F))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Y,{})]})}),p==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(q,{control:c.control,name:"stdio_command",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.command")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.commandPlaceholder"),...N,value:N.value??""})}),t.jsx(Y,{})]})}),t.jsx(q,{control:c.control,name:"stdio_args",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.arguments")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.argumentsPlaceholder"),...N,value:N.value??""})}),t.jsx(Y,{})]})})]}),t.jsx(q,{control:c.control,name:"stdio_cwd",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.workingDirectory")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...N,value:N.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(Y,{})]})})]}),(p==="NPX"||p==="STDIO")&&t.jsx(q,{control:c.control,name:"env_vars",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.environmentVariables")}),t.jsx(J,{children:t.jsx(Ht,{value:N.value??[],onChange:N.onChange})}),t.jsx(Y,{})]})}),p!=="NPX"&&p!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(q,{control:c.control,name:"connection_url",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.url")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.urlPlaceholder"),...N,value:N.value??"",onPaste:z=>{const F=z.clipboardData.getData("text");F&&(z.preventDefault(),c.setValue("connection_url",F.trim(),{shouldDirty:!0}),O(F))},onBlur:z=>{O(z.target.value),N.onBlur()}})}),t.jsx(Y,{})]})}),t.jsx(q,{control:c.control,name:"connection_token",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:w?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(J,{children:t.jsx(ne,{type:"password",placeholder:w?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...N,value:N.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(Y,{})]})})]}),t.jsx(q,{control:c.control,name:"title",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.name")}),t.jsx(J,{children:t.jsx(ne,{placeholder:s("orgs.connections.namePlaceholder"),...N})}),t.jsx(Y,{})]})}),t.jsx(q,{control:c.control,name:"description",render:({field:N})=>t.jsxs(G,{children:[t.jsx(Q,{children:s("orgs.connections.description")}),t.jsx(J,{children:t.jsx(Vt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...N,value:N.value??""})}),t.jsx(Y,{})]})})]}),X=A;return l?t.jsx(kt,{open:X,onOpenChange:I,children:t.jsxs(Tt,{className:"max-h-[90vh]",children:[t.jsx(wt,{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(At,{children:b}),t.jsx(It,{className:"mt-1",children:_})]}),t.jsx(Pt,{asChild:!0,children:t.jsx(E,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Le,{size:16})})})]})}),t.jsx(_e,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(M),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:Z}),t.jsx(Mt,{children:t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ue,{open:X,onOpenChange:I,children:t.jsxs(Fe,{className:"sm:max-w-[525px]",children:[t.jsxs($e,{children:[t.jsx(Pe,{children:b}),t.jsx(Me,{children:_})]}),t.jsx(_e,{...c,children:t.jsxs("form",{onSubmit:c.handleSubmit(M),children:[t.jsx("div",{className:"py-4",children:Z}),t.jsxs(Oe,{children:[t.jsx(E,{type:"button",variant:"outline",onClick:()=>I(!1),children:s("orgs.connections.cancel")}),t.jsx(E,{type:"submit",disabled:c.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),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:U,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(lt,{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(ct,{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:r,onChange:b=>h(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:m,onChange:b=>x(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(rt,{placement:"page",tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:j,onTabChange:b=>{const _=b;_!==j&&ee("connections_page_tab_changed",{to_tab:_}),g(_)}}),t.jsx(L.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(mn,{listState:d,activeTab:j,typeFilter:r,statusFilter:m})})})]})})})]})})}function $s(){const s=W.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(qe,{children:t.jsx(L.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(pn,{})})}),s[0]=e):e=s[0],e}export{$s as default};
|