decocms 4.263.2 → 4.263.4
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-DL3U1yq7.js → AlertCircle-BTYGLFie.js} +1 -1
- package/dist/client/assets/{AreaChart-DTwkuP_y.js → AreaChart-jerPjG-w.js} +1 -1
- package/dist/client/assets/{ArrowLeft-BDtQVDZJ.js → ArrowLeft-BajYEy7J.js} +1 -1
- package/dist/client/assets/{ArrowUp-DUua93WQ.js → ArrowUp-fnzebitz.js} +1 -1
- package/dist/client/assets/{Check-CFdAuLVR.js → Check-CJxsk2cd.js} +1 -1
- package/dist/client/assets/{CheckCircle-Ccs86bUg.js → CheckCircle-D8lsJrHv.js} +1 -1
- package/dist/client/assets/{ChevronDown-Bh9AZv82.js → ChevronDown-Chn5-yQ3.js} +1 -1
- package/dist/client/assets/{ChevronRight-Bt0Ps5hy.js → ChevronRight-BUEJ-jyA.js} +1 -1
- package/dist/client/assets/{ChevronSelectorVertical-CbP69kXl.js → ChevronSelectorVertical-DuwT0Cdn.js} +1 -1
- package/dist/client/assets/{ChevronUp-CYbM4ZwP.js → ChevronUp-Bis3nYDt.js} +1 -1
- package/dist/client/assets/{Copy01-CKmyRUyl.js → Copy01-oY33F6A4.js} +1 -1
- package/dist/client/assets/{CreditCard01-DXJKk1Wt.js → CreditCard01-BEFAf8Rs.js} +1 -1
- package/dist/client/assets/{DotsVertical-C5qhPHKZ.js → DotsVertical-CmNP1NFD.js} +1 -1
- package/dist/client/assets/{Download01-DZdiDQUS.js → Download01-BOB13r_i.js} +1 -1
- package/dist/client/assets/{Eye-DFHNhYtx.js → Eye-BQM4yrzA.js} +1 -1
- package/dist/client/assets/{FilterLines-C01-F8gV.js → FilterLines-CM6IqjC1.js} +1 -1
- package/dist/client/assets/{Globe01-qBOiIpcJ.js → Globe01-BLkvMUGE.js} +1 -1
- package/dist/client/assets/{Globe04-DyPo8R4R.js → Globe04-CJdUUoxg.js} +1 -1
- package/dist/client/assets/{HardDrive-DMA6WwJi.js → HardDrive-BFDRJjzR.js} +1 -1
- package/dist/client/assets/{Key01-CQ2Pckpa.js → Key01-B5VoA08Z.js} +1 -1
- package/dist/client/assets/{LinkExternal01-CDWxDAhW.js → LinkExternal01-bgUoyTwQ.js} +1 -1
- package/dist/client/assets/{LockUnlocked01-BJDlnHNP.js → LockUnlocked01-o0Eo7MuU.js} +1 -1
- package/dist/client/assets/{LogOut01-DYTwrIyB.js → LogOut01-CKpl9BLq.js} +1 -1
- package/dist/client/assets/{Monitor01-CW9D8oQR.js → Monitor01-BHWFnGlJ.js} +1 -1
- package/dist/client/assets/{Palette-CYMwYnzJ.js → Palette-DAsj4nYm.js} +1 -1
- package/dist/client/assets/{Play-D5VBgg81.js → Play-Ir6C5jzg.js} +1 -1
- package/dist/client/assets/{Plus-DJBOKCXM.js → Plus-CySlFZzQ.js} +1 -1
- package/dist/client/assets/{SearchLg-D05XfMH4.js → SearchLg-BevUi4lQ.js} +1 -1
- package/dist/client/assets/{SearchMd-Bvk6cmtM.js → SearchMd-CUh5hEpd.js} +1 -1
- package/dist/client/assets/{Settings02-BXfVk1mb.js → Settings02-DxEKOFeo.js} +1 -1
- package/dist/client/assets/{Share07-DRhhhSu7.js → Share07-BAxn1THr.js} +1 -1
- package/dist/client/assets/{Shield01--vYJckXn.js → Shield01-Br0XuRfn.js} +1 -1
- package/dist/client/assets/{Stars01-Cfn7XpKF.js → Stars01-DGSNhagZ.js} +1 -1
- package/dist/client/assets/{Stars02-BEZaBHTc.js → Stars02-DNyS1gcT.js} +1 -1
- package/dist/client/assets/{Sun-CxlEqCDi.js → Sun-CSIUl7xv.js} +1 -1
- package/dist/client/assets/{SwitchHorizontal01-BPoIdNhd.js → SwitchHorizontal01-C8-bgNQy.js} +1 -1
- package/dist/client/assets/{Tool01-D15DzDIB.js → Tool01-BjI8gxt5.js} +1 -1
- package/dist/client/assets/{Tool02-DcVuymPV.js → Tool02-Ct3UvI4j.js} +1 -1
- package/dist/client/assets/{Trash01-rd-vb1MA.js → Trash01-lppJr9kF.js} +1 -1
- package/dist/client/assets/{TrendUp01-BBA3UF71.js → TrendUp01-vMMFYqH0.js} +1 -1
- package/dist/client/assets/{Upload01-CURnTiOx.js → Upload01-CePHCnzY.js} +1 -1
- package/dist/client/assets/{User01-CGWss5jM.js → User01-BqNQxSWl.js} +1 -1
- package/dist/client/assets/{UserSquare-DNzPXyDT.js → UserSquare-kfbSM3R7.js} +1 -1
- package/dist/client/assets/{Users01-B043Q3B_.js → Users01-GyxqhIQS.js} +1 -1
- package/dist/client/assets/{Users03-CeFJXyBc.js → Users03-C8z46zgV.js} +1 -1
- package/dist/client/assets/{XCircle-vpb-OIYV.js → XCircle-BMgdweBK.js} +1 -1
- package/dist/client/assets/{XClose-Ca1B07wN.js → XClose-DnnJN04M.js} +1 -1
- package/dist/client/assets/{YAxis-CEmbkD2K.js → YAxis-CFtxNrGp.js} +1 -1
- package/dist/client/assets/{Zap-DoBPpnDg.js → Zap-f9eGztfW.js} +1 -1
- package/dist/client/assets/{ZapSquare-B52zBMI0.js → ZapSquare-Z5gRSAcI.js} +1 -1
- package/dist/client/assets/{access-gate-BT3_V_pA.js → access-gate-CESQMRUh.js} +1 -1
- package/dist/client/assets/{agent-icon-Dt8TTBNR.js → agent-icon-BpKbS82g.js} +1 -1
- package/dist/client/assets/{agents-list-BVmLhzQp.js → agents-list-DisSvTPm.js} +1 -1
- package/dist/client/assets/{ai-providers-nCIA03hu.js → ai-providers-DvMfqbG9.js} +1 -1
- package/dist/client/assets/{alert-CVrfLuO_.js → alert-Cjb2EB7F.js} +1 -1
- package/dist/client/assets/{alert-dialog-COKsRPdB.js → alert-dialog-_waxzl9D.js} +1 -1
- package/dist/client/assets/{api-keys-B2kzULLm.js → api-keys-DMd6myi1.js} +1 -1
- package/dist/client/assets/{app-editor-Bq3jQAI6.js → app-editor-BITYEeNm.js} +1 -1
- package/dist/client/assets/{auth-Dff1xvcy.js → auth-B5QCuHwo.js} +1 -1
- package/dist/client/assets/{auth-catchall-BXu-XwcE.js → auth-catchall-Db5A8udm.js} +1 -1
- package/dist/client/assets/{auth-entry-BjUIXBC9.js → auth-entry-orPtywn8.js} +1 -1
- package/dist/client/assets/{auth-split-layout-DyTFtZvs.js → auth-split-layout-BSXvcLZl.js} +1 -1
- package/dist/client/assets/{authenticate-and-persist-oauth-BpXFlbw1.js → authenticate-and-persist-oauth-CxmxlpAo.js} +1 -1
- package/dist/client/assets/{automation-list-row-BcptvIDe.js → automation-list-row-kxVusV6D.js} +1 -1
- package/dist/client/assets/{automation-runs-l52V2CDe.js → automation-runs-aScQH7yb.js} +1 -1
- package/dist/client/assets/{automations-A1r9cPLm.js → automations-DFz--AKt.js} +1 -1
- package/dist/client/assets/{avatar-CKLVepem.js → avatar-BYLlYMrS.js} +1 -1
- package/dist/client/assets/{badge-B2mtA9Oj.js → badge-DYcNbwP1.js} +1 -1
- package/dist/client/assets/{block-document-CTUlzaXj.js → block-document-8DQ-Aj-N.js} +1 -1
- package/dist/client/assets/{buckets-CqwW0fPK.js → buckets-CsXTuRWK.js} +1 -1
- package/dist/client/assets/{bulk-category-panel-DOf0qDJu.js → bulk-category-panel-0Znxf5_5.js} +1 -1
- package/dist/client/assets/{capability-load-error-Bu1DMqyM.js → capability-load-error-CDe54R-X.js} +1 -1
- package/dist/client/assets/{cards-CnXEidEU.js → cards-DOZsSvdL.js} +1 -1
- package/dist/client/assets/{category-editor-C2Penmxb.js → category-editor-CxuIuX9c.js} +1 -1
- package/dist/client/assets/{chart-mQfq8dm_.js → chart-CoRPyY38.js} +1 -1
- package/dist/client/assets/{chat-context-IctGRlpl.js → chat-context-Cdt5JBGq.js} +1 -1
- package/dist/client/assets/{checkbox-DjvUsSry.js → checkbox-Z9SepXvp.js} +1 -1
- package/dist/client/assets/{choose-editor-D2hlr7Vq.js → choose-editor-CHzYYlGa.js} +1 -1
- package/dist/client/assets/{cli-auth-success-odBhJDfC.js → cli-auth-success-DJY05d2g.js} +1 -1
- package/dist/client/assets/{collection-detail-EdlXGuH5.js → collection-detail-BqqcCOIU.js} +1 -1
- package/dist/client/assets/{collection-display-button-BeWwcB8v.js → collection-display-button-BEoC7J9b.js} +1 -1
- package/dist/client/assets/{collection-search-BcNT9wqV.js → collection-search-BQ3PDw8g.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-DEX-95qA.js → collection-table-wrapper-CTaHHWBu.js} +1 -1
- package/dist/client/assets/{collection-tabs-QBx9fiO8.js → collection-tabs-BHE3DhBM.js} +1 -1
- package/dist/client/assets/{command-Bciip2fK.js → command-Cj_b6QuL.js} +1 -1
- package/dist/client/assets/{commerce-onboarding-BrgV_E6e.js → commerce-onboarding-DwEGH-Pm.js} +1 -1
- package/dist/client/assets/{connect-CJeRXYpO.js → connect-DoOLtkHq.js} +1 -1
- package/dist/client/assets/{connection-CIVlVP4z.js → connection-Bxg7evEC.js} +1 -1
- package/dist/client/assets/{connection-card-DLmi_xFL.js → connection-card-Bwep8BgY.js} +1 -1
- package/dist/client/assets/{connection-detail-DLHrsg7S.js → connection-detail-vMhRTHvc.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-Bd1zJpcE.js → connection-form-helpers-ChTIA9-X.js} +1 -1
- package/dist/client/assets/{connections-CaZTNlzO.js → connections-DABID4YF.js} +1 -1
- package/dist/client/assets/{decopilot-sse-pool-0EWVughz.js → decopilot-sse-pool-CMc1xBx0.js} +1 -1
- package/dist/client/assets/{dialog-BVOhf6JL.js → dialog-K8-1cCDF.js} +1 -1
- package/dist/client/assets/{domain-settings-1pFiPcDs.js → domain-settings-CTNhof1S.js} +1 -1
- package/dist/client/assets/{drawer-ygpURzdE.js → drawer-ClBcSM08.js} +1 -1
- package/dist/client/assets/{dropdown-menu-BpdWhSA7.js → dropdown-menu-C-7wwHBe.js} +1 -1
- package/dist/client/assets/{empty-state-CMCoRH7w.js → empty-state-CSKHHWG6.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BRWpOoZu.js → extract-connection-data-C1XM4jmB.js} +1 -1
- package/dist/client/assets/{file-explorer-DLBtkOjU.js → file-explorer-BCiGm1Z3.js} +1 -1
- package/dist/client/assets/{file-type-icon-DQDAdTqu.js → file-type-icon-BrVi1nrA.js} +1 -1
- package/dist/client/assets/{form-DJoSkHk7.js → form-Cv16yv_N.js} +1 -1
- package/dist/client/assets/{general-CBRT6s1c.js → general-DD84yKYj.js} +1 -1
- package/dist/client/assets/{github-repo-picker-CPPjWOCA.js → github-repo-picker-DEedlZZB.js} +1 -1
- package/dist/client/assets/{hooks-CtnSCLIe.js → hooks-BsA5QClW.js} +1 -1
- package/dist/client/assets/{index-fZpMDfe6.js → index-BAzBxxL9.js} +3 -3
- package/dist/client/assets/{index-Bks1FS3f.js → index-BL55GcNa.js} +1 -1
- package/dist/client/assets/{index-D9nsJyXn.js → index-Bsu_VttZ.js} +43 -43
- package/dist/client/assets/{index-BJiFP4oP.js → index-CiZciEsK.js} +1 -1
- package/dist/client/assets/{index-DTM9lZbn.js → index-D00QDYEH.js} +1 -1
- package/dist/client/assets/{index-xXm-vpSs.js → index-D6BHz3vf.js} +1 -1
- package/dist/client/assets/{index-DZsKkAKU.js → index-DJjhCQSJ.js} +1 -1
- package/dist/client/assets/{index-CVkGlHYs.js → index-DgS45S3b.js} +1 -1
- package/dist/client/assets/{index-AZvP0lkz.js → index-DwV5rndB.js} +1 -1
- package/dist/client/assets/{index-BeW-gOXM.js → index-Rsz-z5IL.js} +1 -1
- package/dist/client/assets/{index-redirect-iRkpwVGO.js → index-redirect-CbiwayST.js} +1 -1
- package/dist/client/assets/{infra-billing-DFpE7R9j.js → infra-billing-DTpLPCfp.js} +1 -1
- package/dist/client/assets/{input-v4c8p5Ob.js → input-CvrE4LEJ.js} +1 -1
- package/dist/client/assets/{integration-icon-DKqG-Mpx.js → integration-icon-BnqPyHmt.js} +1 -1
- package/dist/client/assets/{invite-member-dialog-3-Aihs7O.js → invite-member-dialog-CzYyGuZd.js} +1 -1
- package/dist/client/assets/{label-DOL_dkX5.js → label-CXiyMNnc.js} +1 -1
- package/dist/client/assets/{layout-DHLrZup9.js → layout-CsrmRfJK.js} +1 -1
- package/dist/client/assets/login-BM_k5b-A.js +1 -0
- package/dist/client/assets/{mcp-oauth-MtFdjicX.js → mcp-oauth-BY7cxtZI.js} +1 -1
- package/dist/client/assets/{members-jHzwIadJ.js → members-Bee-glAy.js} +1 -1
- package/dist/client/assets/{monaco-editor-DOnHAZIR.js → monaco-editor-ywPI1t16.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-8XgEvO3D.js → monitoring-stats-row-q0lDnj97.js} +1 -1
- package/dist/client/assets/{multi-select-DxScFuSI.js → multi-select-6289Ji5Q.js} +1 -1
- package/dist/client/assets/{oauth-callback-DTWHq_Fr.js → oauth-callback-BI2EXPp9.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DjoClVq8.js → oauth-callback-ai-provider-CPN_n1pK.js} +1 -1
- package/dist/client/assets/{onboarding-CyYYA_IO.js → onboarding-B1OeoqRD.js} +1 -1
- package/dist/client/assets/{org-layout-DsGm5b87.js → org-layout-CJfUhWa8.js} +1 -1
- package/dist/client/assets/{organization-choice-WY-H2NEY.js → organization-choice-BI4eKBGM.js} +1 -1
- package/dist/client/assets/{orgs-DggiyP30.js → orgs-DA0vFIQ1.js} +1 -1
- package/dist/client/assets/{page-seo-form-BoZrAFLO.js → page-seo-form-jRWN82Bz.js} +1 -1
- package/dist/client/assets/{popover-DSZP75un.js → popover-wGCNVbgm.js} +1 -1
- package/dist/client/assets/{post-calendar-BTuD64kJ.js → post-calendar-pijaG7Tm.js} +1 -1
- package/dist/client/assets/{post-editor-Dwh3Mrlh.js → post-editor-B-3AULjS.js} +1 -1
- package/dist/client/assets/{primitives-aZbwao0Z.js → primitives-Do4YdhnP.js} +1 -1
- package/dist/client/assets/{profile-B_6pDwzu.js → profile-GePno2yS.js} +1 -1
- package/dist/client/assets/{project-app-view-LijoL6le.js → project-app-view-CYxJURVY.js} +1 -1
- package/dist/client/assets/record-editor-CnkB9zNF.js +1 -0
- package/dist/client/assets/{redirect-editor-bt0UR5sd.js → redirect-editor-DJr4emyY.js} +1 -1
- package/dist/client/assets/registry-Br8pQVRC.js +2 -0
- package/dist/client/assets/{registry-layout-Da3tVRcY.js → registry-layout-BB4KsmkV.js} +1 -1
- package/dist/client/assets/{reports-DjBTZdT2.js → reports-DzSMI3MZ.js} +1 -1
- package/dist/client/assets/{require-capability-CF9r_mzF.js → require-capability-Cr0gRW-f.js} +1 -1
- package/dist/client/assets/{required-auth-layout-XqEbPK8M.js → required-auth-layout-ykPgRGg9.js} +1 -1
- package/dist/client/assets/{reset-password-DEL_G7hS.js → reset-password-CWtcCFTs.js} +1 -1
- package/dist/client/assets/{roles-DDOKq874.js → roles-Cy9PVzUY.js} +1 -1
- package/dist/client/assets/{search-input-4SLm_iMt.js → search-input-DzsO4XKy.js} +1 -1
- package/dist/client/assets/{secrets-CJLKcRa3.js → secrets-DlU_ZsyZ.js} +1 -1
- package/dist/client/assets/{sections-editor-CLwG1W2k.js → sections-editor-Cj6XZcig.js} +1 -1
- package/dist/client/assets/{select-D9OtHuoQ.js → select-B2e4NALY.js} +1 -1
- package/dist/client/assets/{select-model-pYcHYqNY.js → select-model-BsIRDtab.js} +1 -1
- package/dist/client/assets/{self-tool-result-C2SaSBOS.js → self-tool-result-BBoUTXvN.js} +1 -1
- package/dist/client/assets/{seo-editor-DGd5xF_D.js → seo-editor-NyY02_7W.js} +1 -1
- package/dist/client/assets/{settings-layout-UMPp-PK8.js → settings-layout-DdXTfyPZ.js} +1 -1
- package/dist/client/assets/{shell-controls-CEjTnZRA.js → shell-controls-DQlWaCbv.js} +1 -1
- package/dist/client/assets/{shell-layout-0_Y9WTC5.js → shell-layout-BH-NXnM4.js} +1 -1
- package/dist/client/assets/{spinner-DnK6LAO-.js → spinner-Bb-1R-dk.js} +1 -1
- package/dist/client/assets/{sprints-DTKQS9tP.js → sprints-C6bMPt1I.js} +1 -1
- package/dist/client/assets/{sso-Bj9k9yp_.js → sso-Dvg67Md-.js} +1 -1
- package/dist/client/assets/{store-DofhpRf4.js → store-DpbTTyvZ.js} +1 -1
- package/dist/client/assets/store-registry-BRvvONYG.js +2 -0
- package/dist/client/assets/{switch-Dd8SWBtK.js → switch-BvYQVlYb.js} +1 -1
- package/dist/client/assets/{synced-repos-0UH9NuJE.js → synced-repos-4t6ZPuYG.js} +1 -1
- package/dist/client/assets/{tab-id-W4sfonX1.js → tab-id-DMd10Dlk.js} +1 -1
- package/dist/client/assets/{table-B28U6WCV.js → table-rERv-Q2u.js} +1 -1
- package/dist/client/assets/{tabs-CNvz9wkq.js → tabs-C3QvtS8u.js} +1 -1
- package/dist/client/assets/{task-key-CTiJU5_h.js → task-key-sEZ4dWP_.js} +1 -1
- package/dist/client/assets/{tasks-BsRXKJkD.js → tasks-Rs06jPVw.js} +1 -1
- package/dist/client/assets/{textarea-BmWik9O5.js → textarea-DZcoj6k2.js} +1 -1
- package/dist/client/assets/{toggle-group-B1ujv-Tj.js → toggle-group-CT-LedBS.js} +1 -1
- package/dist/client/assets/{toolbar-Cos-gS1a.js → toolbar-DDbKD-Ay.js} +1 -1
- package/dist/client/assets/{track-Cth4u5b_.js → track-BoWa7pFa.js} +1 -1
- package/dist/client/assets/{types-Da-6shE5.js → types-CHsUC77L.js} +1 -1
- package/dist/client/assets/{use-ai-providers-bDkOAByr.js → use-ai-providers-vhWA7gSP.js} +1 -1
- package/dist/client/assets/{use-api-keys-Bi2l36nz.js → use-api-keys-CwfibyAQ.js} +1 -1
- package/dist/client/assets/{use-automations-BeKjYp7F.js → use-automations-CqECqdXg.js} +1 -1
- package/dist/client/assets/{use-autosave-ImljMikW.js → use-autosave-CTd3ujOq.js} +1 -1
- package/dist/client/assets/{use-clock-tick-BIn9fxJl.js → use-clock-tick-c_pjCx_y.js} +1 -1
- package/dist/client/assets/{use-commerce-diagnostic-UqRl5JGR.js → use-commerce-diagnostic-BpYk1Ih5.js} +1 -1
- package/dist/client/assets/{use-connection-DJ5BvXkS.js → use-connection-Brp0ROSB.js} +1 -1
- package/dist/client/assets/{use-copy-BHeXFKUG.js → use-copy-JYzS-t0x.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-CTghZh27.js → use-create-virtual-mcp-T4W7BRl2.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-BEoE5zu3.js → use-debounced-autosave-Lcvsez5G.js} +1 -1
- package/dist/client/assets/{use-debounced-value-d2xvAJAf.js → use-debounced-value-CHx-_V6p.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-U00f_DNo.js → use-decopilot-events-EyNfu7Kq.js} +1 -1
- package/dist/client/assets/{use-delete-connection-KttG6pDD.js → use-delete-connection-9tv1jgN0.js} +1 -1
- package/dist/client/assets/{use-deployment-admin-BxGtVq0R.js → use-deployment-admin-BH2VfdtE.js} +1 -1
- package/dist/client/assets/{use-file-configs-ivKLtwVT.js → use-file-configs-EX9fsqJc.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-C3woVgJJ.js → use-infinite-scroll-BwpbIlWm.js} +1 -1
- package/dist/client/assets/{use-join-requests-Ce2D10xE.js → use-join-requests-D3OvgAR4.js} +1 -1
- package/dist/client/assets/{use-mcp-client-BixLZLmc.js → use-mcp-client-DP99b3Me.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-DhYUR3cu.js → use-mcp-tools-CjeO7xTP.js} +1 -1
- package/dist/client/assets/{use-members-DqBCB9wB.js → use-members-Fg8xu9zL.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-COcz3Nee.js → use-navigate-to-agent-B3WHCfCa.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-Bm7ydyvS.js → use-org-auth-client-CbgB99m_.js} +1 -1
- package/dist/client/assets/{use-org-repo-syncs-B_4SIVWY.js → use-org-repo-syncs-mnINiKx8.js} +1 -1
- package/dist/client/assets/{use-org-sso-9a_THghN.js → use-org-sso-JpsBVP_t.js} +1 -1
- package/dist/client/assets/{use-organization-roles-CNEl3NFe.js → use-organization-roles-SDielVSw.js} +1 -1
- package/dist/client/assets/{use-organization-settings-B4nKr0f2.js → use-organization-settings-CjuBssHq.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C7LyRS1M.js → use-registry-connections-DYlN_mpo.js} +1 -1
- package/dist/client/assets/{use-secrets-Chh3ojOY.js → use-secrets-BFX9kjjo.js} +1 -1
- package/dist/client/assets/{use-section-preview-base-Db24sM6t.js → use-section-preview-base-CMJMRXCJ.js} +1 -1
- package/dist/client/assets/{use-status-sounds-DFis4MWx.js → use-status-sounds-YIMtdt9I.js} +1 -1
- package/dist/client/assets/{use-tags-DSiXReOW.js → use-tags-CGvsLsNg.js} +1 -1
- package/dist/client/assets/{use-view-mode-5S7L8whl.js → use-view-mode-DcnCbu_t.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-CxECG99q.js → use-virtual-mcp-Dg7xWNG-.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-oSGVjzuL.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-Cu_rUEsy.js +1 -0
- package/dist/client/assets/{users-DegqgBxw.js → users-H55pONgO.js} +1 -1
- package/dist/client/assets/{variant-calendar-Ca_JbtN7.js → variant-calendar-B3KUJEEH.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-rkJlH4vl.js → view-mode-toggle-CVgUIU1G.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +456 -452
- package/dist/server/migrate.js +113 -109
- package/dist/server/server.js +4 -4
- package/package.json +1 -1
- package/dist/client/assets/login-BAB1aLje.js +0 -1
- package/dist/client/assets/record-editor-BJycqOk0.js +0 -1
- package/dist/client/assets/registry-D7lhOlQc.js +0 -2
- package/dist/client/assets/store-registry-Cuo4Kfxl.js +0 -2
- package/dist/client/assets/useInfiniteQuery-D6nR9UJf.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BfIWoPo8.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ak as be,aq as $e,bL as De,am as me,al as Oe,c as R,b as H,j as t,k as ve,B,r as Z,n as Ne,H as te,av as Me,z as ze,K as ae,d as se,aT as Ee,aV as ue,G as Ue,E as Re,f as Ve,bM as Fe,p as Le,ao as Be,ap as He,b1 as qe,b0 as Ge,a$ as Ke,aZ as Qe,a_ as Xe,t as Y}from"./index-fZpMDfe6.js";import{g as We}from"./extract-connection-data-BRWpOoZu.js";import{E as Se}from"./empty-state-CMCoRH7w.js";import{E as Je,c as Ye,r as Ze,b as et,d as tt}from"./connection-form-helpers-Bd1zJpcE.js";import{c as st,S as nt,V as it}from"./index-AZvP0lkz.js";import{u as ye,T as ot}from"./index-CVkGlHYs.js";import{a as at}from"./use-members-DqBCB9wB.js";import{A as lt}from"./avatar-CKLVepem.js";import{a as Ce,b as _e,u as rt}from"./use-connection-DJ5BvXkS.js";import{u as we}from"./use-mcp-client-BixLZLmc.js";import{a as ct}from"./use-mcp-tools-DhYUR3cu.js";import{b as dt,C as mt,a as ut,c as xt}from"./chart-mQfq8dm_.js";import{i as pt,a as ft}from"./mcp-oauth-MtFdjicX.js";import{I as le}from"./integration-icon-DKqG-Mpx.js";import{s as ht}from"./Plus-DJBOKCXM.js";import{R as gt,S as jt,p as bt,aN as vt,s as ne,aB as Nt}from"./agent-icon-Dt8TTBNR.js";import{a as ke,s as St}from"./Settings02-BXfVk1mb.js";import{s as ce}from"./Trash01-rd-vb1MA.js";import{d as K,a as Q,e as X,b as L,c as W,f as yt,F as Ct}from"./form-DJoSkHk7.js";import{I as J}from"./input-v4c8p5Ob.js";import{u as _t,D as wt}from"./use-delete-connection-KttG6pDD.js";import{c as kt,B as It,a as Tt,C as At}from"./monitoring-stats-row-8XgEvO3D.js";import{u as Pt}from"./use-virtual-mcp-CxECG99q.js";import{i as Ie}from"./ChevronRight-Bt0Ps5hy.js";import{a as Te}from"./Users03-CeFJXyBc.js";import{b as ie,c as $t,T as oe,a as Dt}from"./tabs-CNvz9wkq.js";import{g as Ae}from"./connection-slug-eyAPH6o3.js";import{c as Ot}from"./Tool01-D15DzDIB.js";import{g as de,M as Mt}from"./types-Da-6shE5.js";import{C as zt}from"./collection-search-BcNT9wqV.js";import{B as Et}from"./badge-B2mtA9Oj.js";import{c as Ut,D as Rt,b as Vt,a as xe}from"./dropdown-menu-BpdWhSA7.js";import{S as pe,a as fe,b as he,c as ge,d as G}from"./select-D9OtHuoQ.js";import{i as Ft}from"./CheckCircle-Ccs86bUg.js";import{t as Lt}from"./ChevronDown-Bh9AZv82.js";import{n as Bt}from"./Tool02-DcVuymPV.js";import{s as Ht}from"./XClose-Ca1B07wN.js";import{p as qt,i as Gt}from"./connection-CIVlVP4z.js";import"./metadata-dUsYcpuu.js";import"./constants-_08zpzmT.js";import"./Key01-CQ2Pckpa.js";import"./auth-Dff1xvcy.js";import"./use-registry-connections-C7LyRS1M.js";import"./use-organization-settings-B4nKr0f2.js";import"./index-DTM9lZbn.js";import"./index-BJiFP4oP.js";import"./popover-DSZP75un.js";import"./Check-CFdAuLVR.js";import"./SearchMd-Bvk6cmtM.js";import"./use-create-virtual-mcp-CTghZh27.js";import"./use-navigate-to-agent-COcz3Nee.js";import"./hooks-CtnSCLIe.js";import"./decopilot-sse-pool-0EWVughz.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./session-runtime-wVXsCwcJ.js";import"./Eye-DFHNhYtx.js";import"./use-org-auth-client-Bm7ydyvS.js";import"./User01-CGWss5jM.js";import"./AlertCircle-DL3U1yq7.js";import"./ArrowUp-DUua93WQ.js";import"./ArrowLeft-BDtQVDZJ.js";import"./XCircle-vpb-OIYV.js";import"./TrendUp01-BBA3UF71.js";import"./ZapSquare-B52zBMI0.js";import"./UserSquare-DNzPXyDT.js";import"./ChevronSelectorVertical-CbP69kXl.js";import"./ChevronUp-CYbM4ZwP.js";import"./DotsVertical-C5qhPHKZ.js";import"./Stars02-BEZaBHTc.js";import"./Copy01-CKmyRUyl.js";import"./CreditCard01-DXJKk1Wt.js";import"./Download01-DZdiDQUS.js";import"./FilterLines-C01-F8gV.js";import"./Share07-DRhhhSu7.js";import"./Globe01-qBOiIpcJ.js";import"./Globe04-DyPo8R4R.js";import"./SwitchHorizontal01-BPoIdNhd.js";import"./HardDrive-DMA6WwJi.js";import"./LinkExternal01-CDWxDAhW.js";import"./LockUnlocked01-BJDlnHNP.js";import"./LogOut01-DYTwrIyB.js";import"./Monitor01-CW9D8oQR.js";import"./Sun-CxlEqCDi.js";import"./Palette-CYMwYnzJ.js";import"./Play-D5VBgg81.js";import"./SearchLg-D05XfMH4.js";import"./Shield01--vYJckXn.js";import"./Stars01-Cfn7XpKF.js";import"./Upload01-CURnTiOx.js";import"./Users01-B043Q3B_.js";import"./Zap-DoBPpnDg.js";import"./label-DOL_dkX5.js";import"./alert-dialog-COKsRPdB.js";import"./YAxis-CEmbkD2K.js";import"./AreaChart-DTwkuP_y.js";const Kt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Qt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Kt}];function Xt(s){const e=R.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=H();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{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 N;e[7]!==n.title?(N=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=N):N=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==o?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):f?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]=f,e[11]=d,e[12]=o,e[13]=S):S=e[13];let b;e[14]!==N||e[15]!==S?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[N,S]}),e[14]=N,e[15]=S,e[16]=b):b=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==a||e[20]!==o?(y=d&&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]=d,e[19]=a,e[20]=o,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==o?(P=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(gt,{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(jt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=o,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==o?(_=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=_):_=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let j;e[44]!==o?(j=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==j?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":j,children:E}),e[47]=I,e[48]=v,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==b?(A=t.jsxs("div",{className:h,children:[g,b,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=b,e[60]=A):A=e[60],A}function Wt(s){const e=R.c(21),{instance:n,onConfigure:c}=s,a=H();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{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 m;e[10]!==a?(m=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=m):m=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ke,{size:13}),e[12]=p):p=e[12];let d;e[13]!==o||e[14]!==r||e[15]!==m?(d=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":m,children:p})}),e[13]=o,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Jt(s){const e=R.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,m=H();if(n.length===0)return null;let p;e[0]!==n.length||e[1]!==m?(p=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=p):p=e[2];let d;e[3]!==p?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:p}),e[3]=p,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{size:13,className:"animate-spin"}):t.jsx(ht,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==u?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[f,u]}),e[9]=r,e[10]=o,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let N;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Wt,{instance:P,onConfigure:c}),children:t.jsx(Xt,{instance:P,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},P.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],N=n.map(y),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=N}else N=e[22];let S;e[28]!==N?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:N}),e[28]=N,e[29]=S):S=e[29];let b;return e[30]!==g||e[31]!==S?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=b):b=e[32],b}function Yt(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 Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(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 ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=H(),l=Me(),o=es(a),{data:r}=ze({queryKey:ae.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}),m=kt(r?.logs??[],o),p=m.data,d=m.totalCalls>0,f=Yt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=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:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(dt,{config:ts,className:"h-16 w-full",children:t.jsxs(It,{data:p,barCategoryGap:"4%",children:[t.jsx(mt,{content:t.jsx(ut,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(Tt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.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")})}),f.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"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(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 is(s,e){return t.jsx(At,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.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 ls(s){const e=R.c(19),{connectionId:n}=s,c=H(),[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 m;e[4]!==a?(m=Zt.map(g=>t.jsx("button",{type:"button",onClick:()=>i(g.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===g.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:g.label},g.value)),e[4]=a,e[5]=m):m=e[5];let p;e[6]!==m?(p=t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==p?(d=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,p]}),e[8]=r,e[9]=p,e[10]=d):d=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{}),e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==l.id||e[14]!==a?(u=t.jsx(Z.Suspense,{fallback:f,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:a})}),e[12]=n,e[13]=l.id,e[14]=a,e[15]=u):u=e[15];let h;return e[16]!==d||e[17]!==u?(h=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[16]=d,e[17]=u,e[18]=h):h=e[18],h}function rs(s){const e=R.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},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(Te,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(le,{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 m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let p;return e[11]!==i||e[12]!==o||e[13]!==r?(p=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,m]}),e[11]=i,e[12]=o,e[13]=r,e[14]=p):p=e[14],p}function cs(s){const e=R.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(rs,{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 ds(s){const e=R.c(7),{connection:n}=s,{org:c}=te();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const i=Pt(a);if(!(i.length>0)){let m;return e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(t.Fragment,{}),e[2]=m):m=e[2],m}let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=o):o=e[3];let r;return e[4]!==c.slug||e[5]!==i?(r=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:i,org:c.slug})})]}),e[4]=c.slug,e[5]=i,e[6]=r):r=e[6],r}function ms(s){const e=R.c(35),{tools:n,connectionId:c,org:a}=s,i=H(),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 m=we(r),p=Ce(c);let d;e[4]!==p||e[5]!==c?(d=p?Ae(p):c,e[4]=p,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,N,S,b;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==a?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=a,e[21]=T):T=e[21];const D=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=v):v=e[24],e[25]!==u||e[26]!==I?(b=t.jsx(zt,{value:u,onChange:h,placeholder:I,onKeyDown:v}),e[25]=u,e[26]=I,e[27]=b):b=e[27],g="flex-1 overflow-auto p-5",N=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(Ee,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Mt,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),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:j.annotations?.title??j.name}),t.jsx(ot,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=N,e[16]=S,e[17]=b}else g=e[14],N=e[15],S=e[16],b=e[17];let y;e[28]!==g||e[29]!==N?(y=t.jsx("div",{className:g,children:N}),e[28]=g,e[29]=N,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==b||e[33]!==y?(P=t.jsxs("div",{className:S,children:[b,y]}),e[31]=S,e[32]=b,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(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 re(s){const e=R.c(5),{label:n}=s,c=H();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 xs(s){const e=R.c(72),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s;let o;e[0]!==c?(o=c===void 0?[]:c,e[0]=c,e[1]=o):o=e[1];const r=o;let m;e[2]!==a?(m=a===void 0?[]:a,e[2]=a,e[3]=m):m=e[3];const p=m,d=H(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let N;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(N=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=N):N=e[11];const S=N;let b;e[12]!==i||e[13]!==l||e[14]!==n?(b=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=b):b=e[15];const y=b;if(n.length+r.length+p.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let q;e[20]!==d?(q=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=q):q=e[21];let F;e[22]!==q?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:q}),e[22]=q,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ie,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=M):M=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ie,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let v;e[41]!==I?(v=t.jsx(ie,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=v):v=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==v||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs($t,{variant:"underline",className:"gap-1",children:[_,M,D,v]})}),e[43]=M,e[44]=D,e[45]=v,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>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:()=>S(C.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(Ot,{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:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let x;e[62]!==p?(x=p.length>0?p.map(ps):t.jsx(re,{label:"resources"}),e[62]=p,e[63]=x):x=e[63];let w;e[64]!==x?(w=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:x})}),e[64]=x,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Dt,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(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(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children: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 fs(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(bt,{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:Pe(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 hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(le,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children: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 m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=H(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ue(),m=(()=>{if(typeof o!="string"||!o)return!1;try{const u=new URL(o);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?qt(e.connection_url):null;return d?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(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(K,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{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:u.value,onValueChange:u.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(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),p&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(K,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(Q,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{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(G,{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(G,{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")]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Nt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(K,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(K,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(K,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(K,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(K,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:u.value??[],onChange:u.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(K,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ut,{children:[t.jsx(Rt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Et,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Lt,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(St,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.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:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(yt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(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"&&Gt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(bs(c)){const l=vs(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=Ns(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 Ss(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 ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=H(),m=se({from:"/$org/settings/connections/$appSlug"}),p=Le(),d=_e(),{org:f}=te(),u=_t({onSuccess:()=>{o.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[N,S]=Z.useState(!1),b=ye({connectionId:e}),{data:y}=at(),P=y?.data?.members??[],$=h??s,_=P.find(x=>x.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||b.isAuthenticated,D={...s,tools:a},I=st(D,Qt),v=Be({resolver:He(Ye),values:je(h??s)}),j=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const w=v.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),v.reset(w)},z=()=>{v.reset(je(h??s))},k=async x=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await ft({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:x,data:{connection_token:O}});else try{await d.update.mutateAsync({id:x,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:x,data:{connection_token:O}})}else await d.update.mutateAsync({id:x,data:{connection_token:O}});const q=new URL(`/api/${f.slug}/mcp/${x}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(q.href,null)}),await p.invalidateQueries({queryKey:ae.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const x=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const O=await x.text();Y.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(x){console.error("Error removing OAuth token:",x),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(wt,{...u}),t.jsx(qe,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(Ge,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ke,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Qe,{className:"text-base",children:h?.title??s.title}),t.jsx(Xe,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&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:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(Ct,{...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(K,{control:v.control,name:"title",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...x})}),t.jsx(W,{})]})}),t.jsx(K,{control:v.control,name:"description",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...x,value:x.value||""})}),t.jsx(W,{})]})})]}),t.jsx(js,{form:v,connection:h??s,hasOAuthToken:b.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:b.supportsOAuth,isServerError:b.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&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 x=h??s;g(null),u.requestDelete(x)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const x=o[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.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(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Jt,{instances:o,onConfigure:x=>g(x),onAuthenticate:x=>k(x.id),onDelete:x=>u.requestDelete(x),onToggleStatus:async(x,w)=>{try{await d.update.mutateAsync({id:x.id,data:{status:w}}),Y.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:N,onAdd:async()=>{S(!0);try{const x=o[0]??s,w=x.title.replace(/\s*\(\d+\)\s*$/,""),O=o.length+1,C=`${w} (${O})`,V=We("conn");await d.create.mutateAsync({id:V,title:C,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const q=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await pt({url:q.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.c(52),e=H();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}=Ve(a),{org:o}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const p=rt(m),d=p[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==u?(h={connectionId:u,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let N;s[8]!==g?(N={client:g},s[8]=g,s[9]=N):N=s[9];const{data:S}=ct(N);let b;if(s[10]!==d?.tools||s[11]!==f||s[12]!==p||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(p.length<=1){b=k;break e}const A=new Set,U=[],x=ks;for(const w of p){const O=w.id===f?k:x(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}b=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=p,s[13]=S,s[14]=b}else b=s[14];const y=b;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=xt(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Fe(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let j;s[25]!==v?(j=v.map(_s),s[25]=v,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let x;s[34]!==e?(x=e("details.connection.backButton"),s[34]=e,s[35]=x):x=s[35];let w;s[36]!==U||s[37]!==x?(w=t.jsx(B,{variant:"outline",onClick:U,children:x}),s[36]=U,s[37]=x,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==p?(z=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:p}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=p,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Re,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function Si(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{Si as default};
|
|
1
|
+
import{ak as be,aq as $e,bL as De,am as me,al as Oe,c as R,b as H,j as t,k as ve,B,r as Z,n as Ne,H as te,av as Me,z as ze,K as ae,d as se,aT as Ee,aV as ue,G as Ue,E as Re,f as Ve,bM as Fe,p as Le,ao as Be,ap as He,b1 as qe,b0 as Ge,a$ as Ke,aZ as Qe,a_ as Xe,t as Y}from"./index-BAzBxxL9.js";import{g as We}from"./extract-connection-data-C1XM4jmB.js";import{E as Se}from"./empty-state-CSKHHWG6.js";import{E as Je,c as Ye,r as Ze,b as et,d as tt}from"./connection-form-helpers-ChTIA9-X.js";import{c as st,S as nt,V as it}from"./index-DwV5rndB.js";import{u as ye,T as ot}from"./index-DgS45S3b.js";import{a as at}from"./use-members-Fg8xu9zL.js";import{A as lt}from"./avatar-BYLlYMrS.js";import{a as Ce,b as _e,u as rt}from"./use-connection-Brp0ROSB.js";import{u as we}from"./use-mcp-client-DP99b3Me.js";import{a as ct}from"./use-mcp-tools-CjeO7xTP.js";import{b as dt,C as mt,a as ut,c as xt}from"./chart-CoRPyY38.js";import{i as pt,a as ft}from"./mcp-oauth-BY7cxtZI.js";import{I as le}from"./integration-icon-BnqPyHmt.js";import{s as ht}from"./Plus-CySlFZzQ.js";import{R as gt,S as jt,p as bt,aN as vt,s as ne,aB as Nt}from"./agent-icon-BpKbS82g.js";import{a as ke,s as St}from"./Settings02-DxEKOFeo.js";import{s as ce}from"./Trash01-lppJr9kF.js";import{d as K,a as Q,e as X,b as L,c as W,f as yt,F as Ct}from"./form-Cv16yv_N.js";import{I as J}from"./input-CvrE4LEJ.js";import{u as _t,D as wt}from"./use-delete-connection-9tv1jgN0.js";import{c as kt,B as It,a as Tt,C as At}from"./monitoring-stats-row-q0lDnj97.js";import{u as Pt}from"./use-virtual-mcp-Dg7xWNG-.js";import{i as Ie}from"./ChevronRight-BUEJ-jyA.js";import{a as Te}from"./Users03-C8z46zgV.js";import{b as ie,c as $t,T as oe,a as Dt}from"./tabs-C3QvtS8u.js";import{g as Ae}from"./connection-slug-eyAPH6o3.js";import{c as Ot}from"./Tool01-BjI8gxt5.js";import{g as de,M as Mt}from"./types-CHsUC77L.js";import{C as zt}from"./collection-search-BQ3PDw8g.js";import{B as Et}from"./badge-DYcNbwP1.js";import{c as Ut,D as Rt,b as Vt,a as xe}from"./dropdown-menu-C-7wwHBe.js";import{S as pe,a as fe,b as he,c as ge,d as G}from"./select-B2e4NALY.js";import{i as Ft}from"./CheckCircle-D8lsJrHv.js";import{t as Lt}from"./ChevronDown-Chn5-yQ3.js";import{n as Bt}from"./Tool02-Ct3UvI4j.js";import{s as Ht}from"./XClose-DnnJN04M.js";import{p as qt,i as Gt}from"./connection-Bxg7evEC.js";import"./metadata-dUsYcpuu.js";import"./constants-_08zpzmT.js";import"./Key01-B5VoA08Z.js";import"./auth-B5QCuHwo.js";import"./use-registry-connections-DYlN_mpo.js";import"./use-organization-settings-CjuBssHq.js";import"./index-D00QDYEH.js";import"./index-CiZciEsK.js";import"./popover-wGCNVbgm.js";import"./Check-CJxsk2cd.js";import"./SearchMd-CUh5hEpd.js";import"./use-create-virtual-mcp-T4W7BRl2.js";import"./use-navigate-to-agent-B3WHCfCa.js";import"./hooks-BsA5QClW.js";import"./decopilot-sse-pool-CMc1xBx0.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./session-runtime-wVXsCwcJ.js";import"./Eye-BQM4yrzA.js";import"./use-org-auth-client-CbgB99m_.js";import"./User01-BqNQxSWl.js";import"./AlertCircle-BTYGLFie.js";import"./ArrowUp-fnzebitz.js";import"./ArrowLeft-BajYEy7J.js";import"./XCircle-BMgdweBK.js";import"./TrendUp01-vMMFYqH0.js";import"./ZapSquare-Z5gRSAcI.js";import"./UserSquare-kfbSM3R7.js";import"./ChevronSelectorVertical-DuwT0Cdn.js";import"./ChevronUp-Bis3nYDt.js";import"./DotsVertical-CmNP1NFD.js";import"./Stars02-DNyS1gcT.js";import"./Copy01-oY33F6A4.js";import"./CreditCard01-BEFAf8Rs.js";import"./Download01-BOB13r_i.js";import"./FilterLines-CM6IqjC1.js";import"./Share07-BAxn1THr.js";import"./Globe01-BLkvMUGE.js";import"./Globe04-CJdUUoxg.js";import"./SwitchHorizontal01-C8-bgNQy.js";import"./HardDrive-BFDRJjzR.js";import"./LinkExternal01-bgUoyTwQ.js";import"./LockUnlocked01-o0Eo7MuU.js";import"./LogOut01-CKpl9BLq.js";import"./Monitor01-BHWFnGlJ.js";import"./Sun-CSIUl7xv.js";import"./Palette-DAsj4nYm.js";import"./Play-Ir6C5jzg.js";import"./SearchLg-BevUi4lQ.js";import"./Shield01-Br0XuRfn.js";import"./Stars01-DGSNhagZ.js";import"./Upload01-CePHCnzY.js";import"./Users01-GyxqhIQS.js";import"./Zap-f9eGztfW.js";import"./label-CXiyMNnc.js";import"./alert-dialog-_waxzl9D.js";import"./YAxis-CFtxNrGp.js";import"./AreaChart-jerPjG-w.js";const Kt=be({scopes:Oe(me()).describe("List of scopes available"),stateSchema:$e(me(),De()).describe("JSON Schema (draft-07) defining the state structure")}),Qt=[{name:"MCP_CONFIGURATION",inputSchema:be({}),outputSchema:Kt}];function Xt(s){const e=R.c(61),{instance:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l}=s,o=H();let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const m=ye(r),d=!(n.connection_type==="VIRTUAL")&&m.supportsOAuth&&!m.isAuthenticated,f=n.status!=="active",u=d||f?"border-destructive/50 bg-destructive/5":"border-transparent";let h;e[2]!==u?(h=Ne("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=h):h=e[3];let g;e[4]!==n.icon||e[5]!==n.title?(g=t.jsx(le,{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 N;e[7]!==n.title?(N=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=N):N=e[8];let S;e[9]!==n.status||e[10]!==f||e[11]!==d||e[12]!==o?(S=d?t.jsx("span",{className:"text-xs text-destructive font-medium",children:o("details.connectionInstancesPanel.needsAuthorization")}):f?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]=f,e[11]=d,e[12]=o,e[13]=S):S=e[13];let b;e[14]!==N||e[15]!==S?(b=t.jsxs("div",{className:"flex-1 min-w-0",children:[N,S]}),e[14]=N,e[15]=S,e[16]=b):b=e[16];let y;e[17]!==n||e[18]!==d||e[19]!==a||e[20]!==o?(y=d&&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]=d,e[19]=a,e[20]=o,e[21]=y):y=e[21];let P;e[22]!==n||e[23]!==f||e[24]!==l||e[25]!==o?(P=f?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1.5",onClick:()=>l(n,"active"),children:[t.jsx(gt,{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(jt,{size:13})}),e[22]=n,e[23]=f,e[24]=l,e[25]=o,e[26]=P):P=e[26];let $;e[27]!==n||e[28]!==c?($=()=>c(n),e[27]=n,e[28]=c,e[29]=$):$=e[29];let _;e[30]!==o?(_=o("details.connectionInstancesPanel.configure"),e[30]=o,e[31]=_):_=e[31];let M;e[32]!==o?(M=o("details.connectionInstancesPanel.configure"),e[32]=o,e[33]=M):M=e[33];let T;e[34]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ke,{size:13}),e[34]=T):T=e[34];let D;e[35]!==$||e[36]!==_||e[37]!==M?(D=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:$,title:_,"aria-label":M,children:T}),e[35]=$,e[36]=_,e[37]=M,e[38]=D):D=e[38];let I;e[39]!==n||e[40]!==i?(I=()=>i(n),e[39]=n,e[40]=i,e[41]=I):I=e[41];let v;e[42]!==o?(v=o("details.connectionInstancesPanel.delete"),e[42]=o,e[43]=v):v=e[43];let j;e[44]!==o?(j=o("details.connectionInstancesPanel.delete"),e[44]=o,e[45]=j):j=e[45];let E;e[46]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(ce,{size:13}),e[46]=E):E=e[46];let z;e[47]!==I||e[48]!==v||e[49]!==j?(z=t.jsx(B,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:I,title:v,"aria-label":j,children:E}),e[47]=I,e[48]=v,e[49]=j,e[50]=z):z=e[50];let k;e[51]!==D||e[52]!==z||e[53]!==y||e[54]!==P?(k=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[y,P,D,z]}),e[51]=D,e[52]=z,e[53]=y,e[54]=P,e[55]=k):k=e[55];let A;return e[56]!==k||e[57]!==h||e[58]!==g||e[59]!==b?(A=t.jsxs("div",{className:h,children:[g,b,k]}),e[56]=k,e[57]=h,e[58]=g,e[59]=b,e[60]=A):A=e[60],A}function Wt(s){const e=R.c(21),{instance:n,onConfigure:c}=s,a=H();let i;e[0]!==n.icon||e[1]!==n.title?(i=t.jsx(le,{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 m;e[10]!==a?(m=a("details.connectionInstancesPanel.configure"),e[10]=a,e[11]=m):m=e[11];let p;e[12]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(ke,{size:13}),e[12]=p):p=e[12];let d;e[13]!==o||e[14]!==r||e[15]!==m?(d=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":m,children:p})}),e[13]=o,e[14]=r,e[15]=m,e[16]=d):d=e[16];let f;return e[17]!==i||e[18]!==l||e[19]!==d?(f=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[i,l,d]}),e[17]=i,e[18]=l,e[19]=d,e[20]=f):f=e[20],f}function Jt(s){const e=R.c(33),{instances:n,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l,onAdd:o,isAdding:r}=s,m=H();if(n.length===0)return null;let p;e[0]!==n.length||e[1]!==m?(p=n.length===1?m("details.connectionInstancesPanel.instance"):m("details.connectionInstancesPanel.instances"),e[0]=n.length,e[1]=m,e[2]=p):p=e[2];let d;e[3]!==p?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:p}),e[3]=p,e[4]=d):d=e[4];let f;e[5]!==r?(f=r?t.jsx(ve,{size:13,className:"animate-spin"}):t.jsx(ht,{size:13}),e[5]=r,e[6]=f):f=e[6];let u;e[7]!==m?(u=m("details.connectionInstancesPanel.addInstance"),e[7]=m,e[8]=u):u=e[8];let h;e[9]!==r||e[10]!==o||e[11]!==f||e[12]!==u?(h=t.jsxs(B,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:o,disabled:r,children:[f,u]}),e[9]=r,e[10]=o,e[11]=f,e[12]=u,e[13]=h):h=e[13];let g;e[14]!==d||e[15]!==h?(g=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,h]}),e[14]=d,e[15]=h,e[16]=g):g=e[16];let N;if(e[17]!==n||e[18]!==a||e[19]!==c||e[20]!==i||e[21]!==l){let y;e[23]!==a||e[24]!==c||e[25]!==i||e[26]!==l?(y=P=>t.jsx(Z.Suspense,{fallback:t.jsx(Wt,{instance:P,onConfigure:c}),children:t.jsx(Xt,{instance:P,onConfigure:c,onAuthenticate:a,onDelete:i,onToggleStatus:l})},P.id),e[23]=a,e[24]=c,e[25]=i,e[26]=l,e[27]=y):y=e[27],N=n.map(y),e[17]=n,e[18]=a,e[19]=c,e[20]=i,e[21]=l,e[22]=N}else N=e[22];let S;e[28]!==N?(S=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:N}),e[28]=N,e[29]=S):S=e[29];let b;return e[30]!==g||e[31]!==S?(b=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[g,S]}),e[30]=g,e[31]=S,e[32]=b):b=e[32],b}function Yt(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 Zt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function es(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 ts={calls:{label:"Tool calls"},errors:{label:"Errors"}};function ss(s){const e=R.c(4),{connectionId:n,orgId:c,timeframe:a}=s,i=H(),l=Me(),o=es(a),{data:r}=ze({queryKey:ae.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}),m=kt(r?.logs??[],o),p=m.data,d=m.totalCalls>0,f=Yt(r?.logs??[]),u=m.totalCalls>0?Math.round(m.totalErrors/m.totalCalls*100):0;let h;e[0]!==i?(h=i("details.connectionActivity.toolCalls"),e[0]=i,e[1]=h):h=e[1];let g;return e[2]!==h?(g=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:h}),e[2]=h,e[3]=g):g=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:m.totalCalls.toLocaleString()}),g]}),m.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:m.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.errors")})]}),m.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(m.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:i("details.connectionActivity.avgLatency")})]})]}),d?t.jsxs("div",{children:[t.jsx(dt,{config:ts,className:"h-16 w-full",children:t.jsxs(It,{data:p,barCategoryGap:"4%",children:[t.jsx(mt,{content:t.jsx(ut,{labelFormatter:os}),cursor:{fill:"var(--muted)"}}),t.jsx(Tt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(is)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.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")})}),f.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"),u>0?` · ${i("details.connectionActivity.errorRatePercentage",{errorRate:u.toString()})}`:""]}),t.jsx("ul",{className:"space-y-1.5",children:f.map(ns)})]})]})}function ns(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 is(s,e){return t.jsx(At,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function os(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function as(){const s=R.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 ls(s){const e=R.c(19),{connectionId:n}=s,c=H(),[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 m;e[4]!==a?(m=Zt.map(g=>t.jsx("button",{type:"button",onClick:()=>i(g.value),className:Ne("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",a===g.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:g.label},g.value)),e[4]=a,e[5]=m):m=e[5];let p;e[6]!==m?(p=t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:m}),e[6]=m,e[7]=p):p=e[7];let d;e[8]!==r||e[9]!==p?(d=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,p]}),e[8]=r,e[9]=p,e[10]=d):d=e[10];let f;e[11]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(as,{}),e[11]=f):f=e[11];let u;e[12]!==n||e[13]!==l.id||e[14]!==a?(u=t.jsx(Z.Suspense,{fallback:f,children:t.jsx(ss,{connectionId:n,orgId:l.id,timeframe:a})}),e[12]=n,e[13]=l.id,e[14]=a,e[15]=u):u=e[15];let h;return e[16]!==d||e[17]!==u?(h=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[d,u]}),e[16]=d,e[17]=u,e[18]=h):h=e[18],h}function rs(s){const e=R.c(15),{virtualMcp:n,org:c}=s,a=se();let i;e[0]!==a||e[1]!==c||e[2]!==n.id?(i=()=>{const d=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:c,taskId:d},search:{virtualmcpid:n.id}})},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(Te,{size:16}),e[4]=l):l=e[4];let o;e[5]!==n.icon||e[6]!==n.title?(o=t.jsx(le,{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 m;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(Ie,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=m):m=e[10];let p;return e[11]!==i||e[12]!==o||e[13]!==r?(p=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,m]}),e[11]=i,e[12]=o,e[13]=r,e[14]=p):p=e[14],p}function cs(s){const e=R.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(rs,{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 ds(s){const e=R.c(7),{connection:n}=s,{org:c}=te();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const i=Pt(a);if(!(i.length>0)){let m;return e[2]===Symbol.for("react.memo_cache_sentinel")?(m=t.jsx(t.Fragment,{}),e[2]=m):m=e[2],m}let o;e[3]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=o):o=e[3];let r;return e[4]!==c.slug||e[5]!==i?(r=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[o,t.jsx("div",{className:"px-5 py-4",children:t.jsx(cs,{virtualMcps:i,org:c.slug})})]}),e[4]=c.slug,e[5]=i,e[6]=r):r=e[6],r}function ms(s){const e=R.c(35),{tools:n,connectionId:c,org:a}=s,i=H(),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 m=we(r),p=Ce(c);let d;e[4]!==p||e[5]!==c?(d=p?Ae(p):c,e[4]=p,e[5]=c,e[6]=d):d=e[6];const f=d,[u,h]=Z.useState("");let g,N,S,b;if(e[7]!==f||e[8]!==m||e[9]!==l||e[10]!==a||e[11]!==u||e[12]!==i||e[13]!==n){const $=(n??[]).filter(us),_=u.toLowerCase().trim(),M=_?$.filter(j=>j.name.toLowerCase().includes(_)||j.description&&j.description.toLowerCase().includes(_)):$;let T;e[18]!==f||e[19]!==l||e[20]!==a?(T=j=>{l({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:f,collectionName:"tools",itemId:encodeURIComponent(j.name)}})},e[18]=f,e[19]=l,e[20]=a,e[21]=T):T=e[21];const D=T;S="flex flex-col h-full overflow-hidden";let I;e[22]!==i?(I=i("details.connectionUiTab.searchAppsPlaceholder"),e[22]=i,e[23]=I):I=e[23];let v;e[24]===Symbol.for("react.memo_cache_sentinel")?(v=j=>{j.key==="Escape"&&(h(""),j.target.blur())},e[24]=v):v=e[24],e[25]!==u||e[26]!==I?(b=t.jsx(zt,{value:u,onChange:h,placeholder:I,onKeyDown:v}),e[25]=u,e[26]=I,e[27]=b):b=e[27],g="flex-1 overflow-auto p-5",N=M.length===0?t.jsx(Se,{image:null,title:i(u?"details.connectionUiTab.noAppsFound":"details.connectionUiTab.noAppsAvailable"),description:i(u?"details.connectionUiTab.adjustSearchTerms":"details.connectionUiTab.noInteractiveUis")}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:M.map(j=>{const E=de(j._meta);return t.jsxs(Ee,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>D(j),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(Mt,{resourceURI:E,toolInfo:{tool:j},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),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:j.annotations?.title??j.name}),t.jsx(ot,{annotations:j.annotations,_meta:j._meta})]}),j.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j.description})]})]},j.name)})}),e[7]=f,e[8]=m,e[9]=l,e[10]=a,e[11]=u,e[12]=i,e[13]=n,e[14]=g,e[15]=N,e[16]=S,e[17]=b}else g=e[14],N=e[15],S=e[16],b=e[17];let y;e[28]!==g||e[29]!==N?(y=t.jsx("div",{className:g,children:N}),e[28]=g,e[29]=N,e[30]=y):y=e[30];let P;return e[31]!==S||e[32]!==b||e[33]!==y?(P=t.jsxs("div",{className:S,children:[b,y]}),e[31]=S,e[32]=b,e[33]=y,e[34]=P):P=e[34],P}function us(s){return!!de(s._meta)}function Pe(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 re(s){const e=R.c(5),{label:n}=s,c=H();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 xs(s){const e=R.c(72),{tools:n,prompts:c,resources:a,connectionId:i,org:l}=s;let o;e[0]!==c?(o=c===void 0?[]:c,e[0]=c,e[1]=o):o=e[1];const r=o;let m;e[2]!==a?(m=a===void 0?[]:a,e[2]=a,e[3]=m):m=e[3];const p=m,d=H(),f=se(),u=Ce(i??"");let h;e[4]!==u||e[5]!==i?(h=u?Ae(u):i,e[4]=u,e[5]=i,e[6]=h):h=e[6];const g=h;let N;e[7]!==g||e[8]!==i||e[9]!==f||e[10]!==l?(N=function(V){!i||!l||f({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:l,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(V)}})},e[7]=g,e[8]=i,e[9]=f,e[10]=l,e[11]=N):N=e[11];const S=N;let b;e[12]!==i||e[13]!==l||e[14]!==n?(b=i&&l&&n.some(hs),e[12]=i,e[13]=l,e[14]=n,e[15]=b):b=e[15];const y=b;if(n.length+r.length+p.length===0){let C;e[16]!==d?(C=d("details.connectionCapabilities.capabilities"),e[16]=d,e[17]=C):C=e[17];let V;e[18]!==C?(V=t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:C}),e[18]=C,e[19]=V):V=e[19];let q;e[20]!==d?(q=d("details.connectionCapabilities.noCapabilitiesDiscovered"),e[20]=d,e[21]=q):q=e[21];let F;e[22]!==q?(F=t.jsx("p",{className:"text-sm text-muted-foreground",children:q}),e[22]=q,e[23]=F):F=e[23];let ee;return e[24]!==F||e[25]!==V?(ee=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[V,F]}),e[24]=F,e[25]=V,e[26]=ee):ee=e[26],ee}let $;e[27]!==d||e[28]!==n.length?($=d("details.connectionCapabilities.toolsTab",{count:n.length}),e[27]=d,e[28]=n.length,e[29]=$):$=e[29];let _;e[30]!==$?(_=t.jsx(ie,{value:"tools",variant:"underline",children:$}),e[30]=$,e[31]=_):_=e[31];let M;e[32]!==y||e[33]!==d?(M=y&&t.jsx(ie,{value:"apps",variant:"underline",children:d("details.connectionCapabilities.uiTab")}),e[32]=y,e[33]=d,e[34]=M):M=e[34];let T;e[35]!==d?(T=d("details.connectionCapabilities.promptsTab"),e[35]=d,e[36]=T):T=e[36];let D;e[37]!==T?(D=t.jsx(ie,{value:"prompts",variant:"underline",children:T}),e[37]=T,e[38]=D):D=e[38];let I;e[39]!==d?(I=d("details.connectionCapabilities.resourcesTab"),e[39]=d,e[40]=I):I=e[40];let v;e[41]!==I?(v=t.jsx(ie,{value:"resources",variant:"underline",children:I}),e[41]=I,e[42]=v):v=e[42];let j;e[43]!==M||e[44]!==D||e[45]!==v||e[46]!==_?(j=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs($t,{variant:"underline",className:"gap-1",children:[_,M,D,v]})}),e[43]=M,e[44]=D,e[45]=v,e[46]=_,e[47]=j):j=e[47];let E;e[48]!==S||e[49]!==n?(E=n.length>0?n.map(C=>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:()=>S(C.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(Ot,{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:Pe(C.name)}),C.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:C.description})]}),t.jsx(Ie,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},C.name)):t.jsx(re,{label:"tools"}),e[48]=S,e[49]=n,e[50]=E):E=e[50];let z;e[51]!==E?(z=t.jsx(oe,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:E})}),e[51]=E,e[52]=z):z=e[52];let k;e[53]!==i||e[54]!==y||e[55]!==l||e[56]!==n?(k=y&&t.jsx(oe,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(ms,{tools:n,connectionId:i,org:l})}),e[53]=i,e[54]=y,e[55]=l,e[56]=n,e[57]=k):k=e[57];let A;e[58]!==r?(A=r.length>0?r.map(fs):t.jsx(re,{label:"prompts"}),e[58]=r,e[59]=A):A=e[59];let U;e[60]!==A?(U=t.jsx(oe,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:A})}),e[60]=A,e[61]=U):U=e[61];let x;e[62]!==p?(x=p.length>0?p.map(ps):t.jsx(re,{label:"resources"}),e[62]=p,e[63]=x):x=e[63];let w;e[64]!==x?(w=t.jsx(oe,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:x})}),e[64]=x,e[65]=w):w=e[65];let O;return e[66]!==j||e[67]!==z||e[68]!==k||e[69]!==U||e[70]!==w?(O=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(Dt,{defaultValue:"tools",variant:"underline",children:[j,z,k,U,w]})}),e[66]=j,e[67]=z,e[68]=k,e[69]=U,e[70]=w,e[71]=O):O=e[71],O}function ps(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(vt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children: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 fs(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(bt,{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:Pe(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 hs(s){return de(s._meta)}function gs(s){const e=R.c(13),{connection:n,displayTitle:c}=s,a=c??n.title;let i;e[0]!==n.icon||e[1]!==a?(i=t.jsx(le,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=i):i=e[2];let l;e[3]!==a?(l=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children: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 m;return e[10]!==i||e[11]!==r?(m=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[i,r]}),e[10]=i,e[11]=r,e[12]=m):m=e[12],m}function js({form:s,connection:e,hasOAuthToken:n,onReauthenticate:c,onRemoveOAuth:a}){const i=H(),l=ue({control:s.control,name:"ui_type"}),o=ue({control:s.control,name:"connection_url"}),{stdioEnabled:r}=Ue(),m=(()=>{if(typeof o!="string"||!o)return!1;try{const u=new URL(o);return u.hostname==="api.githubcopilot.com"&&u.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),p=r||e.connection_type==="STDIO",d=e.connection_type==="VIRTUAL",f=d?qt(e.connection_url):null;return d?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(Te,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:i("details.connectionSidebar.virtualMcp")})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.virtualMcpDescription")})]}),f&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.virtualMcpId")}),t.jsx("div",{className:"flex items-center gap-2 h-10 px-3 border border-border rounded-lg bg-muted/50",children:t.jsx("code",{className:"text-sm text-muted-foreground",children:f})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(K,{control:s.control,name:"ui_type",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{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:u.value,onValueChange:u.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(G,{value:"HTTP",children:i("details.connectionSidebar.http")}),t.jsx(G,{value:"SSE",children:i("details.connectionSidebar.sse")}),t.jsx(G,{value:"Websocket",children:i("details.connectionSidebar.websocket")}),p&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:i("details.connectionSidebar.npxPackage")}),t.jsx(G,{value:"STDIO",children:i("details.connectionSidebar.customCommand")})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(K,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(Q,{className:"flex-1 min-w-0",children:t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.urlPlaceholder"),...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(pe,{value:u.value,onValueChange:u.onChange,children:[t.jsx(L,{children:t.jsx(fe,{className:"h-10",children:t.jsx(he,{})})}),t.jsxs(ge,{children:[t.jsx(G,{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(G,{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(G,{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")]})}),p&&t.jsxs(t.Fragment,{children:[t.jsx(G,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Bt,{className:"w-4 h-4"}),i("details.connectionSidebar.npxPackage")]})}),t.jsx(G,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Nt,{className:"w-4 h-4"}),i("details.connectionSidebar.customCommand")]})})]})]})]}),t.jsx(W,{})]})}),l==="NPX"&&t.jsx(K,{control:s.control,name:"npx_package",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.npmPackage")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.npmPackagePlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),l==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(K,{control:s.control,name:"stdio_command",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.command")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.commandPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})}),t.jsx(K,{control:s.control,name:"stdio_args",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.arguments")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.argumentsPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:i("details.connectionSidebar.spaceSeparatedArguments")}),t.jsx(W,{})]})})]}),t.jsx(K,{control:s.control,name:"stdio_cwd",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.workingDirectory")}),t.jsx(L,{children:t.jsx(J,{placeholder:i("details.connectionSidebar.workingDirectoryPlaceholder"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),t.jsx(W,{})]})})]}),(l==="NPX"||l==="STDIO")&&t.jsx(K,{control:s.control,name:"env_vars",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i("details.connectionSidebar.environmentVariables")}),t.jsx(L,{children:t.jsx(Je,{value:u.value??[],onChange:u.onChange})}),t.jsx(W,{})]})}),l!=="NPX"&&l!=="STDIO"&&t.jsx(K,{control:s.control,name:"connection_token",render:({field:u})=>t.jsxs(Q,{className:"flex flex-col gap-3",children:[t.jsx(X,{className:"text-xs text-muted-foreground font-medium",children:i(m?"details.connectionSidebar.githubPersonalAccessToken":"details.connectionSidebar.token")}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ut,{children:[t.jsx(Rt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Et,{variant:"success",className:"gap-1.5",children:[t.jsx(Ft,{size:12}),i("details.connectionSidebar.authenticatedViaOAuth"),t.jsx(Lt,{size:12})]})})}),t.jsxs(Vt,{align:"start",children:[t.jsxs(xe,{onClick:c,children:[t.jsx(St,{size:16}),i("details.connectionSidebar.reauthenticate")]}),t.jsxs(xe,{variant:"destructive",onClick:a,children:[t.jsx(ce,{size:16}),i("details.connectionSidebar.removeOAuth")]})]})]})}):e.connection_token&&u.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:()=>u.onChange(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity",title:i("details.connectionSidebar.clearAndReplaceToken"),"aria-label":i("details.connectionSidebar.clearAndReplaceToken"),children:t.jsx(Ht,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(L,{children:t.jsx(J,{type:"password",placeholder:i(m?"details.connectionSidebar.pasteYourGitHubPat":"details.connectionSidebar.enterAccessToken"),...u,value:u.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(yt,{children:[i("details.connectionSidebar.createAPatAt")," ",t.jsx("a",{href:"https://github.com/settings/personal-access-tokens",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"github.com/settings/personal-access-tokens"})]})]}),t.jsx(W,{})]})})]})}function bs(s){return s.command==="npx"}function vs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function Ns(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function je(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"&&Gt(s.connection_headers)){const c=s.connection_headers,a=Ze(c.envVars);if(bs(c)){const l=vs(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=Ns(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 Ss(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 ys({connection:s,connectionId:e,org:n,isUpdating:c,tools:a,prompts:i,resources:l,siblings:o}){const r=H(),m=se({from:"/$org/settings/connections/$appSlug"}),p=Le(),d=_e(),{org:f}=te(),u=_t({onSuccess:()=>{o.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[h,g]=Z.useState(null),[N,S]=Z.useState(!1),b=ye({connectionId:e}),{data:y}=at(),P=y?.data?.members??[],$=h??s,_=P.find(x=>x.userId===$.created_by),T=s?.connection_type==="VIRTUAL"||b.isAuthenticated,D={...s,tools:a},I=st(D,Qt),v=Be({resolver:He(Ye),values:je(h??s)}),j=v.formState.isDirty,E=async()=>{if(!await v.trigger())return;const w=v.getValues(),O=Ss(w),C=h?.id??e;await d.update.mutateAsync({id:C,data:O}),v.reset(w)},z=()=>{v.reset(je(h??s))},k=async x=>{const w=s.configuration_scopes?.length?s.configuration_scopes.join(" "):void 0,{token:O,tokenInfo:C,error:V}=await ft({connectionId:x,orgSlug:f.slug,...w?{scope:w}:{}});if(V||!O){Y.error(r("details.connection.authFailed",{error:V??""}));return}if(C)try{const F=await fetch(`/api/${f.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:C.accessToken,refreshToken:C.refreshToken,expiresIn:C.expiresIn,scope:C.scope,clientId:C.clientId,clientSecret:C.clientSecret,tokenEndpoint:C.tokenEndpoint})});if(!F.ok)console.error("Failed to save OAuth token:",await F.text()),await d.update.mutateAsync({id:x,data:{connection_token:O}});else try{await d.update.mutateAsync({id:x,data:{}})}catch(ee){console.warn("Failed to refresh connection tools after OAuth:",ee)}}catch(F){console.error("Error saving OAuth token:",F),await d.update.mutateAsync({id:x,data:{connection_token:O}})}else await d.update.mutateAsync({id:x,data:{connection_token:O}});const q=new URL(`/api/${f.slug}/mcp/${x}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(q.href,null)}),await p.invalidateQueries({queryKey:ae.mcpClientPrefix()}),Y.success(r("details.connection.authSuccess"))},A=()=>k(s.id),U=async()=>{try{const x=await fetch(`/api/${f.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const O=await x.text();Y.error(r("details.connection.failedRemoveOAuth",{error:O}));return}const w=new URL(`/api/${f.slug}/mcp/${s.id}`,window.location.origin);await p.invalidateQueries({queryKey:ae.isMCPAuthenticated(w.href,null)}),Y.success(r("details.connection.oauthRemoved"))}catch(x){console.error("Error removing OAuth token:",x),Y.error(r("details.connection.failedRemoveOAuthError"))}};return t.jsxs(t.Fragment,{children:[t.jsx(wt,{...u}),t.jsx(qe,{open:h!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(Ge,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(Ke,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(Qe,{className:"text-base",children:h?.title??s.title}),t.jsx(Xe,{className:"text-xs",children:r("details.connection.settingsDescription")}),_&&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:_.user?.image??void 0,fallback:_.user?.name??_.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:_.user?.name||_.user?.email})]})]}),t.jsxs(Ct,{...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(K,{control:v.control,name:"title",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.nameLabel")}),t.jsx(L,{children:t.jsx(J,{...x})}),t.jsx(W,{})]})}),t.jsx(K,{control:v.control,name:"description",render:({field:x})=>t.jsxs(Q,{children:[t.jsx(X,{children:r("details.connection.descriptionLabel")}),t.jsx(L,{children:t.jsx(J,{...x,value:x.value||""})}),t.jsx(W,{})]})})]}),t.jsx(js,{form:v,connection:h??s,hasOAuthToken:b.hasOAuthToken,onReauthenticate:A,onRemoveOAuth:U}),t.jsx(nt,{connection:h??s,form:v,hasMcpBinding:I,isMCPAuthenticated:T,supportsOAuth:b.supportsOAuth,isServerError:b.isServerError,onAuthenticate:A,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(B,{onClick:E,disabled:!j||c,className:"flex-1",children:r(c?"details.connection.savingButton":"details.connection.saveButton")}),j&&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 x=h??s;g(null),u.requestDelete(x)},children:[t.jsx(ce,{size:15}),r("details.connection.deleteButton")]})]})]},h?.id??s.id)]})}),t.jsx(it,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(gs,{connection:s,displayTitle:(()=>{const x=o[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.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(ls,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(Jt,{instances:o,onConfigure:x=>g(x),onAuthenticate:x=>k(x.id),onDelete:x=>u.requestDelete(x),onToggleStatus:async(x,w)=>{try{await d.update.mutateAsync({id:x.id,data:{status:w}}),Y.success(r(w==="active"?"details.connection.connectionEnabled":"details.connection.connectionDisabled"))}catch{Y.error(r("details.connection.failedUpdateConnection"))}},isAdding:N,onAdd:async()=>{S(!0);try{const x=o[0]??s,w=x.title.replace(/\s*\(\d+\)\s*$/,""),O=o.length+1,C=`${w} (${O})`,V=We("conn");await d.create.mutateAsync({id:V,title:C,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const q=new URL(`/api/${f.slug}/mcp/${V}`,window.location.origin),F=await pt({url:q.href,token:null,orgId:f.id});F.supportsOAuth&&!F.isAuthenticated&&await k(V)}finally{S(!1)}}}),t.jsx(ds,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(xs,{tools:a,prompts:i,resources:l,connectionId:e,org:n})})]})})]})})]})}function Cs(){const s=R.c(52),e=H();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}=Ve(a),{org:o}=te(),r=_e();let m;s[2]!==i?(m={slug:i},s[2]=i,s[3]=m):m=s[3];const p=rt(m),d=p[0]??null,f=d?.id??"",u=f||null;let h;s[4]!==o.id||s[5]!==o.slug||s[6]!==u?(h={connectionId:u,orgId:o.id,orgSlug:o.slug},s[4]=o.id,s[5]=o.slug,s[6]=u,s[7]=h):h=s[7];const g=we(h);let N;s[8]!==g?(N={client:g},s[8]=g,s[9]=N):N=s[9];const{data:S}=ct(N);let b;if(s[10]!==d?.tools||s[11]!==f||s[12]!==p||s[13]!==S){const k=S?S.tools.map(As):(d?.tools??[]).map(Ts);e:{if(p.length<=1){b=k;break e}const A=new Set,U=[],x=ks;for(const w of p){const O=w.id===f?k:x(w.tools);for(const C of O)A.has(C.name)||(A.add(C.name),U.push(C))}b=U.length>0?U:k}s[10]=d?.tools,s[11]=f,s[12]=p,s[13]=S,s[14]=b}else b=s[14];const y=b;let P;s[15]!==g?(P={client:g},s[15]=g,s[16]=P):P=s[16];const{data:$}=xt(P);let _;s[17]!==g?(_={client:g},s[17]=g,s[18]=_):_=s[18];const{data:M}=Fe(_);let T;s[19]!==$?.prompts?(T=$?.prompts??[],s[19]=$?.prompts,s[20]=T):T=s[20];let D;s[21]!==T?(D=T.map(ws),s[21]=T,s[22]=D):D=s[22];const I=D;let v;s[23]!==M?.resources?(v=M?.resources??[],s[23]=M?.resources,s[24]=v):v=s[24];let j;s[25]!==v?(j=v.map(_s),s[25]=v,s[26]=j):j=s[26];const E=j;if(!d){let k;s[27]!==e?(k=e("details.connection.notFoundTitle"),s[27]=e,s[28]=k):k=s[28];let A;s[29]!==e?(A=e("details.connection.notFoundDescription"),s[29]=e,s[30]=A):A=s[30];let U;s[31]!==c||s[32]!==l?(U=()=>c({to:"/$org/settings/connections",params:{org:l}}),s[31]=c,s[32]=l,s[33]=U):U=s[33];let x;s[34]!==e?(x=e("details.connection.backButton"),s[34]=e,s[35]=x):x=s[35];let w;s[36]!==U||s[37]!==x?(w=t.jsx(B,{variant:"outline",onClick:U,children:x}),s[36]=U,s[37]=x,s[38]=w):w=s[38];let O;return s[39]!==k||s[40]!==A||s[41]!==w?(O=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Se,{title:k,description:A,actions:w})}),s[39]=k,s[40]=A,s[41]=w,s[42]=O):O=s[42],O}let z;return s[43]!==r.update.isPending||s[44]!==y||s[45]!==d||s[46]!==f||s[47]!==l||s[48]!==I||s[49]!==E||s[50]!==p?(z=t.jsx(ys,{org:l,connection:d,connectionId:f,isUpdating:r.update.isPending,tools:y,prompts:I,resources:E,siblings:p}),s[43]=r.update.isPending,s[44]=y,s[45]=d,s[46]=f,s[47]=l,s[48]=I,s[49]=E,s[50]=p,s[51]=z):z=s[51],z}function _s(s){return{name:s.name,description:s.description,uri:s.uri}}function ws(s){return{name:s.name,description:s.description}}function ks(s){return(s??[]).map(Is)}function Is(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ts(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function As(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ps(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Re,{children:t.jsx(Z.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(ve,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(Cs,{})})}),s[0]=e):e=s[0],e}function Si(){const s=R.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ps,{}),s[0]=e):e=s[0],e}export{Si as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ak as R,aq as A,bL as I,am as o,al as j,an as L,c as z,j as u,B as C}from"./index-
|
|
1
|
+
import{ak as R,aq as A,bL as I,am as o,al as j,an as L,c as z,j as u,B as C}from"./index-BAzBxxL9.js";import{I as H}from"./input-CvrE4LEJ.js";import{s as W}from"./Plus-CySlFZzQ.js";import{s as q}from"./Trash01-lppJr9kF.js";const K=R({key:o().min(1,"Key is required"),value:o()}),M=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 U(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 N=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,s)=>s!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const y=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:p,value:c.value},r(s))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const g=P;let T;e[9]!==r||e[10]!==t?(T=(l,p)=>{const s=[...t],c=s[l];c&&(s[l]={key:c.key,value:p},r(s))},e[9]=r,e[10]=t,e[11]=T):T=e[11];const k=T;let f;if(e[12]!==g||e[13]!==y||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==h){let l;e[19]!==g||e[20]!==y||e[21]!==k||e[22]!==m||e[23]!==h?(l=(p,s)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(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:U(p.key)?"password":"text",placeholder:h,value:p.value,onChange:c=>k(s,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>y(s),children:u.jsx(q,{size:16})})]},s),e[19]=g,e[20]=y,e[21]=k,e[22]=m,e[23]=h,e[24]=l):l=e[24],f=t.map(l),e[12]=g,e[13]=y,e[14]=k,e[15]=m,e[16]=t,e[17]=h,e[18]=f}else f=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=u.jsx(W,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let d;e[26]!==N?(d=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:N,children:[w,"Add Environment Variable"]}),e[26]=N,e[27]=d):d=e[27];let _;e[28]!==f||e[29]!==d?(_=u.jsxs("div",{className:"flex flex-col gap-2",children:[f,d]}),e[28]=f,e[29]=d,e[30]=_):_=e[30];let E;return e[31]!==v||e[32]!==_?(E=u.jsx("div",{className:v,children:_}),e[31]=v,e[32]=_,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function S(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const a=e.slice(1).find(i=>!i.startsWith("-"));return a?{packageName:a}:null}function Y(n){const{uiType:e}=n,t=S(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===S("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=S(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(i=>(i.server?.remotes??[]).some(m=>S(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",a=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:a}:null}function 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,M as c,Z as d,Y as i,F as p,D as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as B,c as ae,b as de,j as t,B as G,k as pe,q as re,n as je,E as Ye,H as Ne,d as ke,u as Ze,a as Te,G as et,a5 as tt,aR as Ce,R as nt,I as st,ao as ot,ap as it,P as fe,p as ct,av as lt,t as Y,K as rt}from"./index-fZpMDfe6.js";import{a as Ae,b as at,g as dt,e as ut}from"./extract-connection-data-BRWpOoZu.js";import{C as mt}from"./collection-display-button-BeWwcB8v.js";import{S as gt}from"./search-input-4SLm_iMt.js";import{C as pt}from"./collection-tabs-QBx9fiO8.js";import{C as ve,u as ft,a as we,g as ht}from"./connection-card-DLmi_xFL.js";import{E as xt}from"./empty-state-CMCoRH7w.js";import{u as jt,D as yt}from"./use-delete-connection-KttG6pDD.js";import{u as St}from"./use-infinite-scroll-C3woVgJJ.js";import{u as Ct}from"./use-view-mode-5S7L8whl.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Me,g as Oe,e as Fe,a as $e,A as Ue}from"./alert-dialog-COKsRPdB.js";import{n as ye}from"./Tool02-DcVuymPV.js";import{g as vt}from"./metadata-dUsYcpuu.js";import{b as Ve,h as ze,a as Ee,c as Be,d as Ke,e as He}from"./dialog-BVOhf6JL.js";import{D as bt,a as _t,c as Dt,b as Nt,g as kt,e as Tt,f as At}from"./drawer-ygpURzdE.js";import{d as se,a as oe,e as ie,b as ce,c as le,F as _e}from"./form-DJoSkHk7.js";import{I as ue}from"./input-v4c8p5Ob.js";import{S as wt,a as It,b as Pt,c as Lt,d as ge}from"./select-D9OtHuoQ.js";import{T as Mt}from"./textarea-BmWik9O5.js";import{b as Re,u as Ot}from"./use-connection-DJ5BvXkS.js";import{u as Ft}from"./use-virtual-mcp-CxECG99q.js";import{aM as $t,S as Ut,R as Vt,s as Se,aB as zt}from"./agent-icon-Dt8TTBNR.js";import{s as We}from"./Plus-DJBOKCXM.js";import{s as Xe}from"./XClose-Ca1B07wN.js";import{i as he,a as De,E as Et,c as Bt,p as Kt,b as Ht,d as Rt}from"./connection-form-helpers-Bd1zJpcE.js";import{a as Wt}from"./authenticate-and-persist-oauth-BpXFlbw1.js";import{I as Xt}from"./integration-icon-DKqG-Mpx.js";import{C as Ge}from"./checkbox-DjvUsSry.js";import{a as me,D as Gt,c as qt,b as Qt}from"./dropdown-menu-BpdWhSA7.js";import{a as Jt}from"./DotsVertical-C5qhPHKZ.js";import{s as qe}from"./Eye-DFHNhYtx.js";import{s as Qe}from"./Trash01-rd-vb1MA.js";import"./use-mcp-client-BixLZLmc.js";import"./constants-_08zpzmT.js";import"./auth-Dff1xvcy.js";import"./ArrowUp-DUua93WQ.js";import"./Check-CFdAuLVR.js";import"./SwitchHorizontal01-BPoIdNhd.js";import"./view-mode-toggle-rkJlH4vl.js";import"./badge-B2mtA9Oj.js";import"./SearchMd-Bvk6cmtM.js";import"./use-registry-connections-C7LyRS1M.js";import"./use-organization-settings-B4nKr0f2.js";import"./useInfiniteQuery-D6nR9UJf.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./label-DOL_dkX5.js";import"./ChevronDown-Bh9AZv82.js";import"./ChevronUp-CYbM4ZwP.js";import"./AlertCircle-DL3U1yq7.js";import"./Tool01-D15DzDIB.js";import"./ArrowLeft-BDtQVDZJ.js";import"./XCircle-vpb-OIYV.js";import"./TrendUp01-BBA3UF71.js";import"./ZapSquare-B52zBMI0.js";import"./Users03-CeFJXyBc.js";import"./UserSquare-DNzPXyDT.js";import"./CheckCircle-Ccs86bUg.js";import"./ChevronRight-Bt0Ps5hy.js";import"./ChevronSelectorVertical-CbP69kXl.js";import"./Stars02-BEZaBHTc.js";import"./Copy01-CKmyRUyl.js";import"./CreditCard01-DXJKk1Wt.js";import"./Download01-DZdiDQUS.js";import"./Settings02-BXfVk1mb.js";import"./FilterLines-C01-F8gV.js";import"./Share07-DRhhhSu7.js";import"./Globe01-qBOiIpcJ.js";import"./Globe04-DyPo8R4R.js";import"./HardDrive-DMA6WwJi.js";import"./Key01-CQ2Pckpa.js";import"./LinkExternal01-CDWxDAhW.js";import"./LockUnlocked01-BJDlnHNP.js";import"./LogOut01-DYTwrIyB.js";import"./Monitor01-CW9D8oQR.js";import"./Sun-CxlEqCDi.js";import"./Palette-CYMwYnzJ.js";import"./Play-D5VBgg81.js";import"./SearchLg-D05XfMH4.js";import"./Shield01--vYJckXn.js";import"./Stars01-Cfn7XpKF.js";import"./Upload01-CURnTiOx.js";import"./User01-CGWss5jM.js";import"./Users01-B043Q3B_.js";import"./Zap-DoBPpnDg.js";import"./mcp-oauth-MtFdjicX.js";function Yt(s){const e=`deco-filters-${s}`,[n,p]=B.useState(()=>{try{const c=globalThis.localStorage?.getItem(e);if(c)return JSON.parse(c)}catch(c){console.error("Failed to parse stored filters:",c)}return[]});return[n,c=>{p(c);try{globalThis.localStorage?.setItem(e,JSON.stringify(c))}catch(o){console.error("Failed to save filters:",o)}}]}function Zt(s){const e=ae.c(7),[n,p]=B.useState(s),[r,c]=B.useState(s?"desc":null);let o;e[0]!==r||e[1]!==n?(o=a=>{n!==a?(p(a),c("asc")):r==="asc"?c("desc"):r==="desc"&&(p(void 0),c(null))},e[0]=r,e[1]=n,e[2]=o):o=e[2];const l=o;let d;return e[3]!==l||e[4]!==r||e[5]!==n?(d={sortKey:n,sortDirection:r,handleSort:l},e[3]=l,e[4]=r,e[5]=n,e[6]=d):d=e[6],d}function en(s){const e=ae.c(20),{namespace:n,resource:p,defaultSortKey:r,defaultViewMode:c}=s,o=r===void 0?"title":r,l=c===void 0?"table":c,[d,a]=B.useState(""),N=B.useDeferredValue(d),f=`${n}-${p}`,[g,v]=Yt(f),x=`studio-${p}-filter-visible-${n}`;let _;e[0]!==x?(_=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=_):_=e[1];const[u,y]=B.useState(_);let j;e[2]!==x?(j=M=>{y(M),globalThis.localStorage?.setItem(x,String(M))},e[2]=x,e[3]=j):j=e[3];const D=j;let b;e[4]!==u||e[5]!==D?(b=()=>{D(!u)},e[4]=u,e[5]=D,e[6]=b):b=e[6];const k=b,[i,T]=Ct(`studio-${p}-${n}`,l),{sortKey:L,sortDirection:O,handleSort:A}=Zt(o),K=L;let U;return e[7]!==u||e[8]!==g||e[9]!==A||e[10]!==d||e[11]!==N||e[12]!==D||e[13]!==v||e[14]!==T||e[15]!==O||e[16]!==K||e[17]!==k||e[18]!==i?(U={search:d,searchTerm:N,setSearch:a,filters:g,setFilters:v,filterBarVisible:u,setFilterBarVisible:D,toggleFilterBar:k,viewMode:i,setViewMode:T,sortKey:K,sortDirection:O,handleSort:A},e[7]=u,e[8]=g,e[9]=A,e[10]=d,e[11]=N,e[12]=D,e[13]=v,e[14]=T,e[15]=O,e[16]=K,e[17]=k,e[18]=i,e[19]=U):U=e[19],U}function tn(s){const e=ae.c(35),{open:n,onOpenChange:p,count:r,onConfirm:c}=s,o=de(),l=r===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==r||e[1]!==o||e[2]!==l?(d=o(l,{count:r}),e[0]=r,e[1]=o,e[2]=l,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(Ie,{children:d}),e[4]=d,e[5]=a):a=e[5];const N=r===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let f;e[6]!==o||e[7]!==N?(f=o(N),e[6]=o,e[7]=N,e[8]=f):f=e[8];let g;e[9]!==f?(g=t.jsx(Pe,{children:f}),e[9]=f,e[10]=g):g=e[10];let v;e[11]!==a||e[12]!==g?(v=t.jsxs(Le,{children:[a,g]}),e[11]=a,e[12]=g,e[13]=v):v=e[13];let x;e[14]!==o?(x=o("orgs.bulkDeleteDialog.cancelButton"),e[14]=o,e[15]=x):x=e[15];let _;e[16]!==x?(_=t.jsx(Me,{children:x}),e[16]=x,e[17]=_):_=e[17];const u=r===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let y;e[18]!==r||e[19]!==o||e[20]!==u?(y=o(u,{count:r}),e[18]=r,e[19]=o,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==c||e[23]!==y?(j=t.jsx(Oe,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:y}),e[22]=c,e[23]=y,e[24]=j):j=e[24];let D;e[25]!==j||e[26]!==_?(D=t.jsxs(Fe,{children:[_,j]}),e[25]=j,e[26]=_,e[27]=D):D=e[27];let b;e[28]!==D||e[29]!==v?(b=t.jsxs($e,{children:[v,D]}),e[28]=D,e[29]=v,e[30]=b):b=e[30];let k;return e[31]!==p||e[32]!==n||e[33]!==b?(k=t.jsx(Ue,{open:n,onOpenChange:p,children:b}),e[31]=p,e[32]=n,e[33]=b,e[34]=k):k=e[34],k}function nn(s){return s._registryId?.includes("community-registry")===!0}function sn(s){const e=ae.c(82),{item:n,canManage:p,allConnections:r,connectedAppNames:c,connectingItemId:o,onNavigateConnected:l,onConnect:d}=s,a=de(),[N,f]=B.useState(!1),[g,v]=B.useState(null);let x,_;e[0]!==c||e[1]!==n?(x=Ae(n)??"",_=c.has(x),e[0]=c,e[1]=n,e[2]=x,e[3]=_):(x=e[2],_=e[3]);const u=_;let y;e[4]!==n._meta?(y=vt(n._meta),e[4]=n._meta,e[5]=y):y=e[5];const j=y,D=j?.friendlyName||j?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let k;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(k=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=k):k=e[8];const i=k;let T;if(e[9]!==r||e[10]!==x){let J;e[12]!==x?(J=be=>be.connection_type!=="VIRTUAL"&&be.app_name===x,e[12]=x,e[13]=J):J=e[13],T=r.filter(J),e[9]=r,e[10]=x,e[11]=T}else T=e[11];const L=T;let O;e[14]!==n?(O=nn(n),e[14]=n,e[15]=O):O=e[15];const A=O,K=u||p;let U,M;e[16]!==L||e[17]!==A||e[18]!==u||e[19]!==n||e[20]!==d||e[21]!==l?(U=()=>{if(u){const J=L[0];J&&l(J);return}M()},M=()=>{A?(v("connect"),f(!0)):d(n)},e[16]=L,e[17]=A,e[18]=u,e[19]=n,e[20]=d,e[21]=l,e[22]=U,e[23]=M):(U=e[22],M=e[23]);let V;e[24]!==n||e[25]!==d||e[26]!==g?(V=()=>{re("connections_community_warning_confirmed",{registry_item_id:n.id}),f(!1),g==="connect"&&d(n),v(null)},e[24]=n,e[25]=d,e[26]=g,e[27]=V):V=e[27];const q=V;let I;e[28]!==b||e[29]!==i||e[30]!==D?(I={title:D,description:b,icon:i},e[28]=b,e[29]=i,e[30]=D,e[31]=I):I=e[31];let Q;e[32]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ye,{}),e[32]=Q):Q=e[32];const S=K?U:void 0;let w;e[33]!==A||e[34]!==n._sourceIcon?(w=A&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[33]=A,e[34]=n._sourceIcon,e[35]=w):w=e[35];let z;e[36]!==p||e[37]!==o||e[38]!==M||e[39]!==u||e[40]!==n.id||e[41]!==a?(z=u?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):p&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:o!==null,onClick:J=>{J.stopPropagation(),M()},children:o===n.id?t.jsx(pe,{size:14,className:"animate-spin"}):a("orgs.catalogItemCard.connect")}),e[36]=p,e[37]=o,e[38]=M,e[39]=u,e[40]=n.id,e[41]=a,e[42]=z):z=e[42];let R;e[43]!==w||e[44]!==z?(R=t.jsxs("div",{className:"flex items-center gap-2",children:[w,z]}),e[43]=w,e[44]=z,e[45]=R):R=e[45];let H;e[46]!==R||e[47]!==I||e[48]!==S?(H=t.jsx(ve,{connection:I,fallbackIcon:Q,onClick:S,headerActionsAlwaysVisible:!0,headerActions:R}),e[46]=R,e[47]=I,e[48]=S,e[49]=H):H=e[49];let C;e[50]!==a?(C=a("orgs.catalogItemCard.communityMcpServerTitle"),e[50]=a,e[51]=C):C=e[51];let F;e[52]!==C?(F=t.jsx(Ie,{children:C}),e[52]=C,e[53]=F):F=e[53];let P;e[54]!==a?(P=a("orgs.catalogItemCard.communityMcpServerDescription"),e[54]=a,e[55]=P):P=e[55];let Z;e[56]!==P?(Z=t.jsx(Pe,{children:P}),e[56]=P,e[57]=Z):Z=e[57];let te;e[58]!==F||e[59]!==Z?(te=t.jsxs(Le,{children:[F,Z]}),e[58]=F,e[59]=Z,e[60]=te):te=e[60];let ee;e[61]!==a?(ee=a("orgs.catalogItemCard.cancel"),e[61]=a,e[62]=ee):ee=e[62];let m;e[63]!==ee?(m=t.jsx(Me,{children:ee}),e[63]=ee,e[64]=m):m=e[64];let h;e[65]!==a?(h=a("orgs.catalogItemCard.continue"),e[65]=a,e[66]=h):h=e[66];let $;e[67]!==q||e[68]!==h?($=t.jsx(Oe,{onClick:q,children:h}),e[67]=q,e[68]=h,e[69]=$):$=e[69];let W;e[70]!==m||e[71]!==$?(W=t.jsxs(Fe,{children:[m,$]}),e[70]=m,e[71]=$,e[72]=W):W=e[72];let E;e[73]!==te||e[74]!==W?(E=t.jsxs($e,{children:[te,W]}),e[73]=te,e[74]=W,e[75]=E):E=e[75];let X;e[76]!==N||e[77]!==E?(X=t.jsx(Ue,{open:N,onOpenChange:f,children:E}),e[76]=N,e[77]=E,e[78]=X):X=e[78];let ne;return e[79]!==H||e[80]!==X?(ne=t.jsxs(t.Fragment,{children:[H,X]}),e[79]=H,e[80]=X,e[81]=ne):ne=e[81],ne}function Je(s){const e=ae.c(8),{selectionMode:n,children:p}=s,r=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let c;e[0]!==r?(c=je("overflow-hidden transition-all duration-150 ease-out",r),e[0]=r,e[1]=c):c=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Gt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:cn,children:t.jsx(Jt,{size:20})})}),e[2]=o):o=e[2];let l;e[3]!==p?(l=t.jsxs(qt,{children:[o,t.jsx(Qt,{align:"end",onClick:on,children:p})]}),e[3]=p,e[4]=l):l=e[4];let d;return e[5]!==c||e[6]!==l?(d=t.jsx("div",{className:c,children:l}),e[5]=c,e[6]=l,e[7]=d):d=e[7],d}function on(s){return s.stopPropagation()}function cn(s){return s.stopPropagation()}function ln(s){const e=ae.c(57),{group:n,onOpen:p,selectionMode:r,selectedIds:c,onToggleSelect:o}=s,l=de();let d;if(e[0]!==n.connections||e[1]!==c){let I;e[3]!==c?(I=Q=>c.has(Q.id),e[3]=c,e[4]=I):I=e[4],d=n.connections.every(I),e[0]=n.connections,e[1]=c,e[2]=d}else d=e[2];const a=d;let N;if(e[5]!==n.connections||e[6]!==c){let I;e[8]!==c?(I=Q=>c.has(Q.id),e[8]=c,e[9]=I):I=e[9],N=n.connections.some(I),e[5]=n.connections,e[6]=c,e[7]=N}else N=e[7];const f=N;let g;e[10]!==a||e[11]!==n.connections||e[12]!==o||e[13]!==c?(g=()=>{for(const I of n.connections)a?c.has(I.id)&&o(I.id):c.has(I.id)||o(I.id)},e[10]=a,e[11]=n.connections,e[12]=o,e[13]=c,e[14]=g):g=e[14];const v=g,x=n.title,_=n.icon;let u;e[15]!==n.connections.length||e[16]!==l?(u=l("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=l,e[17]=u):u=e[17];let y;e[18]!==n.icon||e[19]!==n.title||e[20]!==u?(y={title:x,icon:_,description:u},e[18]=n.icon,e[19]=n.title,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==p||e[23]!==r||e[24]!==v?(j=()=>r?v():p(),e[22]=p,e[23]=r,e[24]=v,e[25]=j):j=e[25];const D=r&&a&&"ring-2 ring-primary",b=r&&f&&!a&&"ring-1 ring-primary/50";let k;e[26]!==b||e[27]!==D?(k=je(D,b),e[26]=b,e[27]=D,e[28]=k):k=e[28];const i=r?a?!0:f&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ye,{}),e[29]=T):T=e[29];let L;e[30]!==a||e[31]!==n.connections.length||e[32]!==r||e[33]!==f||e[34]!==l||e[35]!==v?(L=r?t.jsx(Ge,{checked:a?!0:f?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:l("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=r,e[33]=f,e[34]=l,e[35]=v,e[36]=L):L=e[36];let O;e[37]!==p?(O=I=>{I.stopPropagation(),p()},e[37]=p,e[38]=O):O=e[38];let A;e[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(qe,{size:16}),e[39]=A):A=e[39];let K;e[40]!==l?(K=l("orgs.connectionSelectionUi.open"),e[40]=l,e[41]=K):K=e[41];let U;e[42]!==O||e[43]!==K?(U=t.jsxs(me,{onClick:O,children:[A,K]}),e[42]=O,e[43]=K,e[44]=U):U=e[44];let M;e[45]!==r||e[46]!==U?(M=t.jsx(Je,{selectionMode:r,children:U}),e[45]=r,e[46]=U,e[47]=M):M=e[47];let V;e[48]!==L||e[49]!==M?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[L,M]}),e[48]=L,e[49]=M,e[50]=V):V=e[50];let q;return e[51]!==k||e[52]!==i||e[53]!==V||e[54]!==y||e[55]!==j?(q=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:y,onClick:j,className:k,selected:i,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=k,e[52]=i,e[53]=V,e[54]=y,e[55]=j,e[56]=q):q=e[56],q}function rn(s){const e=ae.c(36),{connection:n,isSelected:p,selectionMode:r,canManage:c,canManageAgents:o,onToggleSelect:l,onOpen:d,onToggleStatus:a,onDelete:N}=s,f=de();let g;e[0]!==p||e[1]!==l||e[2]!==r||e[3]!==f?(g=r?t.jsx(Ge,{checked:p,onCheckedChange:l,onClick:an}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.connectionSelectionUi.connected")}),e[0]=p,e[1]=l,e[2]=r,e[3]=f,e[4]=g):g=e[4];let v;e[5]!==d?(v=i=>{i.stopPropagation(),d()},e[5]=d,e[6]=v):v=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:16}),e[7]=x):x=e[7];let _;e[8]!==f?(_=f("orgs.connectionSelectionUi.open"),e[8]=f,e[9]=_):_=e[9];let u;e[10]!==v||e[11]!==_?(u=t.jsxs(me,{onClick:v,children:[x,_]}),e[10]=v,e[11]=_,e[12]=u):u=e[12];let y;e[13]!==c||e[14]!==o||e[15]!==l||e[16]!==f?(y=(c||o)&&t.jsxs(me,{onClick:i=>{i.stopPropagation(),l()},children:[t.jsx($t,{size:16}),f("orgs.connectionSelectionUi.select")]}),e[13]=c,e[14]=o,e[15]=l,e[16]=f,e[17]=y):y=e[17];let j;e[18]!==c||e[19]!==n||e[20]!==a||e[21]!==f?(j=c&&(n.status==="active"?t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("inactive")},children:[t.jsx(Ut,{size:16}),f("orgs.connectionSelectionUi.disable")]}):t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("active")},children:[t.jsx(Vt,{size:16}),f("orgs.connectionSelectionUi.enable")]})),e[18]=c,e[19]=n,e[20]=a,e[21]=f,e[22]=j):j=e[22];let D;e[23]!==c||e[24]!==N||e[25]!==f?(D=c&&t.jsxs(me,{variant:"destructive",onClick:i=>{i.stopPropagation(),N()},children:[t.jsx(Qe,{size:16}),f("orgs.connectionSelectionUi.delete")]}),e[23]=c,e[24]=N,e[25]=f,e[26]=D):D=e[26];let b;e[27]!==r||e[28]!==u||e[29]!==y||e[30]!==j||e[31]!==D?(b=t.jsxs(Je,{selectionMode:r,children:[u,y,j,D]}),e[27]=r,e[28]=u,e[29]=y,e[30]=j,e[31]=D,e[32]=b):b=e[32];let k;return e[33]!==g||e[34]!==b?(k=t.jsxs("div",{className:"flex items-center gap-1",children:[g,b]}),e[33]=g,e[34]=b,e[35]=k):k=e[35],k}function an(s){return s.stopPropagation()}function dn(s){const e=ae.c(29),{count:n,total:p,canManage:r,canManageAgents:c,onSelectAll:o,onDeselectAll:l,onDelete:d,onAddToAgent:a,onToggleStatus:N,onCancel:f}=s,g=de();if(n===0)return null;let v;e[0]!==n||e[1]!==g?(v=g("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=g,e[2]=v):v=e[2];let x;e[3]!==v?(x=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:v}),e[3]=v,e[4]=x):x=e[4];let _;e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==g||e[9]!==p?(_=n<p?t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:g("orgs.connectionSelectionUi.selectAll",{total:p})}):t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:g("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=l,e[7]=o,e[8]=g,e[9]=p,e[10]=_):_=e[10];let u;e[11]!==c||e[12]!==a||e[13]!==g?(u=c&&t.jsxs(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(We,{size:13}),g("orgs.connectionSelectionUi.addToAgent")]}),e[11]=c,e[12]=a,e[13]=g,e[14]=u):u=e[14];let y;e[15]!==r||e[16]!==d||e[17]!==N||e[18]!==g?(y=r&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:g("orgs.connectionSelectionUi.enable")}),t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:g("orgs.connectionSelectionUi.disable")}),t.jsxs(G,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Qe,{size:13}),g("orgs.connectionSelectionUi.delete")]})]}),e[15]=r,e[16]=d,e[17]=N,e[18]=g,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Xe,{size:13}),e[20]=j):j=e[20];let D;e[21]!==f?(D=t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:j}),e[21]=f,e[22]=D):D=e[22];let b;return e[23]!==x||e[24]!==_||e[25]!==u||e[26]!==y||e[27]!==D?(b=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:[x,_,u,y,D]})}),e[23]=x,e[24]=_,e[25]=u,e[26]=y,e[27]=D,e[28]=b):b=e[28],b}function un(s){const e=ae.c(45),{open:n,onOpenChange:p,agents:r,onConfirm:c}=s,o=de(),[l,d]=B.useState(null);let a;e[0]!==o?(a=o("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=o,e[1]=a):a=e[1];let N;e[2]!==a?(N=t.jsx(Ve,{children:a}),e[2]=a,e[3]=N):N=e[3];let f;e[4]!==o?(f=o("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=o,e[5]=f):f=e[5];let g;e[6]!==f?(g=t.jsx(ze,{children:f}),e[6]=f,e[7]=g):g=e[7];let v;e[8]!==N||e[9]!==g?(v=t.jsxs(Ee,{children:[N,g]}),e[8]=N,e[9]=g,e[10]=v):v=e[10];let x;e[11]!==r||e[12]!==l||e[13]!==o?(x=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:o("orgs.connectionSelectionUi.noAgentsFound")}):r.map(A=>t.jsxs("button",{type:"button",onClick:()=>d(A.id),className:je("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===A.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Xt,{icon:A.icon,name:A.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:A.title}),A.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description})]})]},A.id)),e[11]=r,e[12]=l,e[13]=o,e[14]=x):x=e[14];let _;e[15]!==x?(_=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:x}),e[15]=x,e[16]=_):_=e[16];let u;e[17]!==p?(u=()=>p(!1),e[17]=p,e[18]=u):u=e[18];let y;e[19]!==o?(y=o("orgs.connectionSelectionUi.cancel"),e[19]=o,e[20]=y):y=e[20];let j;e[21]!==u||e[22]!==y?(j=t.jsx(G,{variant:"outline",onClick:u,children:y}),e[21]=u,e[22]=y,e[23]=j):j=e[23];const D=!l;let b;e[24]!==c||e[25]!==p||e[26]!==l?(b=()=>{l&&(c(l),p(!1),d(null))},e[24]=c,e[25]=p,e[26]=l,e[27]=b):b=e[27];let k;e[28]!==o?(k=o("orgs.connectionSelectionUi.add"),e[28]=o,e[29]=k):k=e[29];let i;e[30]!==D||e[31]!==b||e[32]!==k?(i=t.jsx(G,{disabled:D,onClick:b,children:k}),e[30]=D,e[31]=b,e[32]=k,e[33]=i):i=e[33];let T;e[34]!==j||e[35]!==i?(T=t.jsxs(Be,{children:[j,i]}),e[34]=j,e[35]=i,e[36]=T):T=e[36];let L;e[37]!==T||e[38]!==v||e[39]!==_?(L=t.jsxs(Ke,{className:"sm:max-w-[400px]",children:[v,_,T]}),e[37]=T,e[38]=v,e[39]=_,e[40]=L):L=e[40];let O;return e[41]!==p||e[42]!==n||e[43]!==L?(O=t.jsx(He,{open:n,onOpenChange:p,children:L}),e[41]=p,e[42]=n,e[43]=L,e[44]=O):O=e[44],O}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:r,enabledRegistries:c}){const o=de(),{org:l}=Ne(),d=ct(),a=ke(),{data:N}=Te.useSession(),f=Re(),g=Ot(s),v=jt(),{granted:x}=Ce("connections:manage"),{granted:_}=Ce("agents:manage"),[u,y]=B.useState(new Set),j=u.size>0,[D,b]=B.useState(!1),[k,i]=B.useState(!1),[T,L]=B.useState(null),O=Ft(),A=g.filter(m=>!(n!=="ALL"&&m.connection_type!==n||p!=="ALL"&&m.status!==p)),K=ht(A),U=m=>{y(h=>{const $=new Set(h);return $.has(m)?$.delete(m):$.add(m),$})},M=()=>{y(new Set)},V=we(c,s.searchTerm),q=V.items,I=St(V.loadMore,V.hasMore,V.isLoadingMore),Q=new Set(g.filter(m=>m.app_name).map(m=>m.app_name)),S=r==="ALL"||c.some(m=>m.id===r)?r:"ALL",w=s.search.length>0,z=e==="all"||w?q.filter(m=>{if(S!=="ALL"&&m._registryId!==S)return!1;if(w){const h=Ae(m);if(h&&Q.has(h))return!1}return!0}):[],R=e==="connected"||w?K:[],H=async m=>{if(!(!l||!N?.user?.id)){re("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),L(m.id);try{const h=ut(m,l.id,N.user.id,{remoteIndex:0}),$=h.connection_type==="STDIO",W=!!h.connection_url,E=$&&h.connection_headers&&typeof h.connection_headers=="object"&&"command"in h.connection_headers;if(!W&&!E){Y.error(o("orgs.connections.cannotConnectNoMethod")),L(null);return}const{id:X}=await f.create.mutateAsync(h),ne=await Wt({connectionId:X,orgId:l.id,orgSlug:l.slug,persistFallback:J=>f.update.mutateAsync({id:X,data:{connection_token:J}}).then(()=>{})});if(ne.ran&&!ne.ok){re("connection_oauth_failed",{connection_id:X,flow:"connections_page_connect",error:ne.error??"no_token"}),Y.error(o("orgs.connections.authenticationFailed",{error:ne.error??"no token received"}));return}if(ne.ran){re("connection_oauth_succeeded",{connection_id:X,flow:"connections_page_connect"});const J=new URL(`/api/${l.slug}/mcp/${X}`,window.location.origin);await d.invalidateQueries({queryKey:rt.isMCPAuthenticated(J.href,null)}),F(),Y.success(o("orgs.connections.authenticationSuccessful"))}Y.success(o("orgs.connections.connectedSuccessfully"))}catch(h){Y.error(o("orgs.connections.failedToConnect",{error:h instanceof Error?h.message:String(h)}))}finally{L(null)}}},C=lt(),F=()=>{d.invalidateQueries({predicate:m=>{const h=m.queryKey;return h[1]===l.id&&h[3]==="collection"&&h[4]==="CONNECTIONS"}})},P=async()=>{b(!1);const m=[...u];re("connections_bulk_delete",{count:m.length});let h=0;for(const $ of m)try{await C.call("COLLECTION_CONNECTIONS_DELETE",{id:$,force:!0}),h++}catch{}F(),Y.success(o("orgs.connections.deletedConnections",{count:h})),M()},Z=async(m,h)=>{try{await f.update.mutateAsync({id:m,data:{status:h}}),F(),Y.success(o(h==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{Y.error(o("orgs.connections.failedToUpdateConnection"))}},te=async m=>{const h=[...u];re("connections_bulk_status_toggled",{count:h.length,to_status:m});let $=0;for(const W of h)try{await f.update.mutateAsync({id:W,data:{status:m}}),$++}catch{}F(),Y.success(m==="active"?o("orgs.connections.enabledConnections",{count:$}):o("orgs.connections.disabledConnections",{count:$})),M()},ee=async m=>{const h=O.find(E=>E.id===m);if(!h)return;re("connections_bulk_add_to_agent",{agent_id:m,count:u.size});const $=new Set(h.connections.map(E=>E.connection_id)),W=[...u].filter(E=>!$.has(E)).map(E=>({connection_id:E,selected_tools:null,selected_resources:null,selected_prompts:null}));if(W.length===0){Y.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await C.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...h.connections,...W]}}),d.invalidateQueries({predicate:E=>{const X=E.queryKey;return X[1]===l.id&&X[3]==="collection"&&X[4]==="VIRTUAL_MCP"}}),Y.success(o("orgs.connections.addedConnectionsToAgent",{count:W.length,agentTitle:h.title})),M()}catch{Y.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...v}),t.jsx(tn,{open:D,onOpenChange:b,count:u.size,onConfirm:P}),t.jsx(un,{open:k,onOpenChange:i,agents:O,onConfirm:ee}),V.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(w?z.length===0&&A.length===0:e==="all"?z.length===0:A.length===0)?t.jsx(xt,{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(x?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(m=>{if(m.type==="group")return t.jsx(ln,{group:m,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:m.key}})},selectionMode:j,selectedIds:u,onToggleSelect:U},m.key);const h=m.connection,$=u.has(h.id);return t.jsx(ve,{connection:h,fallbackIcon:t.jsx(ye,{}),onClick:()=>j?U(h.id):a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),className:je($&&"ring-2 ring-primary bg-primary/5"),selected:j?$:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(rn,{connection:h,isSelected:$,selectionMode:j,canManage:x,canManageAgents:_,onToggleSelect:()=>U(h.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onToggleStatus:W=>Z(h.id,W),onDelete:()=>v.requestDelete(h)})},h.id)}),z.map(m=>t.jsx(sn,{item:m,canManage:x,allConnections:g,connectedAppNames:Q,connectingItemId:T,onNavigateConnected:h=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onConnect:H},`catalog-${m._registryId}:${m.id}`)),(e==="all"||w)&&c.length>0&&t.jsx("div",{ref:I,className:"col-span-full h-4"}),(e==="all"||w)&&V.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(pe,{size:24,className:"animate-spin text-muted-foreground"})})]})}),j&&t.jsx(dn,{count:u.size,total:A.length,canManage:x,canManageAgents:_,onSelectAll:()=>{y(new Set(A.map(m=>m.id)))},onDeselectAll:()=>y(new Set),onDelete:()=>b(!0),onAddToAgent:()=>i(!0),onToggleStatus:te,onCancel:M})]})}function gn(){const s=de(),{org:e}=Ne(),n=ke(),p=Ze({strict:!1}),{data:r}=Te.useSession(),{stdioEnabled:c}=et(),o=tt(),{granted:l}=Ce("connections:manage"),d=en({namespace:e.slug,resource:"connections"}),a=Re(),[N,f]=nt(st.connectionsTab(e.slug),S=>p.tab==="all"||p.tab==="connected"?p.tab:S??"all"),[g,v]=B.useState("ALL"),[x,_]=B.useState("ALL"),[u,y]=B.useState("ALL"),j=ft(),b=we(j,d.searchTerm).items,k=d.search!==d.searchTerm,i=ot({resolver:it(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),T=i.watch("ui_type"),L=i.watch("connection_url"),O=i.watch("npx_package"),A=he({uiType:T,connectionUrl:L??"",npxPackage:O??""})??De({uiType:T,connectionUrl:L??"",registryItems:b}),K=l&&p.action==="create",U=()=>{re("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},M=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},V=async S=>{let w,z=null,R=null,H=null;S.ui_type==="NPX"?(w="STDIO",z="",H=Ht(S.npx_package||"",S.env_vars||[])):S.ui_type==="STDIO"?(w="STDIO",z="",H=Rt(S.stdio_command||"",S.stdio_args||"",S.stdio_cwd,S.env_vars||[])):(w=S.ui_type,z=S.connection_url||"",R=S.connection_token||null);const C=dt("conn");re("connection_custom_created",{connection_type:w,ui_type:S.ui_type}),await a.create.mutateAsync({id:C,title:S.title,description:S.description||null,connection_type:w,connection_url:z,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:e.id,icon:S.icon??null,app_name:null,app_id:null,connection_headers:H,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),M(),i.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:xe({app_name:null,connection_url:z,title:S.title,id:C})}})},q=S=>{S||(K&&M(),i.reset())},I=S=>{const w=S.trim();if(!w)return;const z=!!i.formState.dirtyFields.title,R=!!i.formState.dirtyFields.description,H=!!i.formState.dirtyFields.env_vars,C=P=>{if(P&&(!z&&!i.getValues("title").trim()&&P.title&&i.setValue("title",P.title,{shouldDirty:!1}),!R&&!(i.getValues("description")??"").trim()&&P.description&&i.setValue("description",P.description,{shouldDirty:!1}),!H&&P.envVarKeys?.length)){const Z=i.getValues("env_vars")??[],te=new Set(Z.map(m=>m.key)),ee=P.envVarKeys.filter(m=>!te.has(m));ee.length>0&&i.setValue("env_vars",[...Z,...ee.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},F=Kt(w);if(F&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",F.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),C(he({uiType:"NPX",npxPackage:F.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const P=T==="HTTP"||T==="SSE"||T==="Websocket"?T:"HTTP";i.setValue("ui_type",P,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),C(he({uiType:P,connectionUrl:w})??De({uiType:P,connectionUrl:w,registryItems:b}));return}T==="NPX"&&C(he({uiType:"NPX",npxPackage:w}))},Q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(G,{variant:"outline",onClick:U,children:[t.jsx(We,{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(fe,{children:[(()=>{const S=s("orgs.connections.createConnection"),w=s("orgs.connections.createConnectionDescription"),z=i.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(se,{control:i.control,name:"ui_type",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.type")}),t.jsxs(wt,{value:C.value,onValueChange:C.onChange,children:[t.jsx(ce,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(ge,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ge,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ge,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ge,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(ge,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(le,{})]})}),T==="NPX"&&t.jsx(se,{control:i.control,name:"npx_package",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.npmPackage")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("npx_package",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),T==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(se,{control:i.control,name:"stdio_command",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.command")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.commandPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"stdio_args",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.arguments")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.argumentsPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"stdio_cwd",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.workingDirectory")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...C,value:C.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(le,{})]})})]}),(T==="NPX"||T==="STDIO")&&t.jsx(se,{control:i.control,name:"env_vars",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.environmentVariables")}),t.jsx(ce,{children:t.jsx(Et,{value:C.value??[],onChange:C.onChange})}),t.jsx(le,{})]})}),T!=="NPX"&&T!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(se,{control:i.control,name:"connection_url",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.url")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.urlPlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("connection_url",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"connection_token",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(ce,{children:t.jsx(ue,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...C,value:C.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.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(le,{})]})})]}),t.jsx(se,{control:i.control,name:"title",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.name")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.namePlaceholder"),...C})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"description",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.description")}),t.jsx(ce,{children:t.jsx(Mt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...C,value:C.value??""})}),t.jsx(le,{})]})})]}),H=K;return o?t.jsx(bt,{open:H,onOpenChange:q,children:t.jsxs(_t,{className:"max-h-[90vh]",children:[t.jsx(Dt,{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(Nt,{children:S}),t.jsx(kt,{className:"mt-1",children:w})]}),t.jsx(Tt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Xe,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(At,{children:t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(He,{open:H,onOpenChange:q,children:t.jsxs(Ke,{className:"sm:max-w-[525px]",children:[t.jsxs(Ee,{children:[t.jsx(Ve,{children:S}),t.jsx(ze,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Be,{children:[t.jsx(G,{type:"button",variant:"outline",onClick:()=>q(!1),children:s("orgs.connections.cancel")}),t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{children:s("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:S=>{S.key==="Escape"&&(d.setSearch(""),S.target.blur())}}),t.jsx(mt,{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:g,onChange:S=>v(S||"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:x,onChange:S=>_(S||"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")}]},...j.length>1?[{label:s("orgs.connections.filterRegistry"),value:u,onChange:S=>y(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAllRegistries")},...j.map(S=>({id:S.id,label:S.id.includes("community-registry")?s("orgs.connections.communityMcpRegistry"):S.title}))]}]:[]]})]}),Q]}),t.jsx(pt,{tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:N,onTabChange:S=>{const w=S;w!==N&&re("connections_page_tab_changed",{to_tab:w}),f(w)}}),t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:k?.5:1,transition:k?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:k?"none":"auto"},children:t.jsx(mn,{listState:d,activeTab:N,typeFilter:g,statusFilter:x,registryFilter:u,enabledRegistries:j})})})]})})})]})})}function Gs(){const s=ae.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gn,{})})}),s[0]=e):e=s[0],e}export{Gs as default};
|
|
1
|
+
import{r as B,c as ae,b as de,j as t,B as G,k as pe,q as re,n as je,E as Ye,H as Ne,d as ke,u as Ze,a as Te,G as et,a5 as tt,aR as Ce,R as nt,I as st,ao as ot,ap as it,P as fe,p as ct,av as lt,t as Y,K as rt}from"./index-BAzBxxL9.js";import{a as Ae,b as at,g as dt,e as ut}from"./extract-connection-data-C1XM4jmB.js";import{C as mt}from"./collection-display-button-BEoC7J9b.js";import{S as gt}from"./search-input-DzsO4XKy.js";import{C as pt}from"./collection-tabs-BHE3DhBM.js";import{C as ve,u as ft,a as we,g as ht}from"./connection-card-Bwep8BgY.js";import{E as xt}from"./empty-state-CSKHHWG6.js";import{u as jt,D as yt}from"./use-delete-connection-9tv1jgN0.js";import{u as St}from"./use-infinite-scroll-BwpbIlWm.js";import{u as Ct}from"./use-view-mode-DcnCbu_t.js";import{g as xe}from"./connection-slug-eyAPH6o3.js";import{c as Ie,d as Pe,b as Le,f as Me,g as Oe,e as Fe,a as $e,A as Ue}from"./alert-dialog-_waxzl9D.js";import{n as ye}from"./Tool02-Ct3UvI4j.js";import{g as vt}from"./metadata-dUsYcpuu.js";import{b as Ve,h as ze,a as Ee,c as Be,d as Ke,e as He}from"./dialog-K8-1cCDF.js";import{D as bt,a as _t,c as Dt,b as Nt,g as kt,e as Tt,f as At}from"./drawer-ClBcSM08.js";import{d as se,a as oe,e as ie,b as ce,c as le,F as _e}from"./form-Cv16yv_N.js";import{I as ue}from"./input-CvrE4LEJ.js";import{S as wt,a as It,b as Pt,c as Lt,d as ge}from"./select-B2e4NALY.js";import{T as Mt}from"./textarea-DZcoj6k2.js";import{b as Re,u as Ot}from"./use-connection-Brp0ROSB.js";import{u as Ft}from"./use-virtual-mcp-Dg7xWNG-.js";import{aM as $t,S as Ut,R as Vt,s as Se,aB as zt}from"./agent-icon-BpKbS82g.js";import{s as We}from"./Plus-CySlFZzQ.js";import{s as Xe}from"./XClose-DnnJN04M.js";import{i as he,a as De,E as Et,c as Bt,p as Kt,b as Ht,d as Rt}from"./connection-form-helpers-ChTIA9-X.js";import{a as Wt}from"./authenticate-and-persist-oauth-CxmxlpAo.js";import{I as Xt}from"./integration-icon-BnqPyHmt.js";import{C as Ge}from"./checkbox-Z9SepXvp.js";import{a as me,D as Gt,c as qt,b as Qt}from"./dropdown-menu-C-7wwHBe.js";import{a as Jt}from"./DotsVertical-CmNP1NFD.js";import{s as qe}from"./Eye-BQM4yrzA.js";import{s as Qe}from"./Trash01-lppJr9kF.js";import"./use-mcp-client-DP99b3Me.js";import"./constants-_08zpzmT.js";import"./auth-B5QCuHwo.js";import"./ArrowUp-fnzebitz.js";import"./Check-CJxsk2cd.js";import"./SwitchHorizontal01-C8-bgNQy.js";import"./view-mode-toggle-CVgUIU1G.js";import"./badge-DYcNbwP1.js";import"./SearchMd-CUh5hEpd.js";import"./use-registry-connections-DYlN_mpo.js";import"./use-organization-settings-CjuBssHq.js";import"./useInfiniteQuery-oSGVjzuL.js";import"./retry-CErkP7V6.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./label-CXiyMNnc.js";import"./ChevronDown-Chn5-yQ3.js";import"./ChevronUp-Bis3nYDt.js";import"./AlertCircle-BTYGLFie.js";import"./Tool01-BjI8gxt5.js";import"./ArrowLeft-BajYEy7J.js";import"./XCircle-BMgdweBK.js";import"./TrendUp01-vMMFYqH0.js";import"./ZapSquare-Z5gRSAcI.js";import"./Users03-C8z46zgV.js";import"./UserSquare-kfbSM3R7.js";import"./CheckCircle-D8lsJrHv.js";import"./ChevronRight-BUEJ-jyA.js";import"./ChevronSelectorVertical-DuwT0Cdn.js";import"./Stars02-DNyS1gcT.js";import"./Copy01-oY33F6A4.js";import"./CreditCard01-BEFAf8Rs.js";import"./Download01-BOB13r_i.js";import"./Settings02-DxEKOFeo.js";import"./FilterLines-CM6IqjC1.js";import"./Share07-BAxn1THr.js";import"./Globe01-BLkvMUGE.js";import"./Globe04-CJdUUoxg.js";import"./HardDrive-BFDRJjzR.js";import"./Key01-B5VoA08Z.js";import"./LinkExternal01-bgUoyTwQ.js";import"./LockUnlocked01-o0Eo7MuU.js";import"./LogOut01-CKpl9BLq.js";import"./Monitor01-BHWFnGlJ.js";import"./Sun-CSIUl7xv.js";import"./Palette-DAsj4nYm.js";import"./Play-Ir6C5jzg.js";import"./SearchLg-BevUi4lQ.js";import"./Shield01-Br0XuRfn.js";import"./Stars01-DGSNhagZ.js";import"./Upload01-CePHCnzY.js";import"./User01-BqNQxSWl.js";import"./Users01-GyxqhIQS.js";import"./Zap-f9eGztfW.js";import"./mcp-oauth-BY7cxtZI.js";function Yt(s){const e=`deco-filters-${s}`,[n,p]=B.useState(()=>{try{const c=globalThis.localStorage?.getItem(e);if(c)return JSON.parse(c)}catch(c){console.error("Failed to parse stored filters:",c)}return[]});return[n,c=>{p(c);try{globalThis.localStorage?.setItem(e,JSON.stringify(c))}catch(o){console.error("Failed to save filters:",o)}}]}function Zt(s){const e=ae.c(7),[n,p]=B.useState(s),[r,c]=B.useState(s?"desc":null);let o;e[0]!==r||e[1]!==n?(o=a=>{n!==a?(p(a),c("asc")):r==="asc"?c("desc"):r==="desc"&&(p(void 0),c(null))},e[0]=r,e[1]=n,e[2]=o):o=e[2];const l=o;let d;return e[3]!==l||e[4]!==r||e[5]!==n?(d={sortKey:n,sortDirection:r,handleSort:l},e[3]=l,e[4]=r,e[5]=n,e[6]=d):d=e[6],d}function en(s){const e=ae.c(20),{namespace:n,resource:p,defaultSortKey:r,defaultViewMode:c}=s,o=r===void 0?"title":r,l=c===void 0?"table":c,[d,a]=B.useState(""),N=B.useDeferredValue(d),f=`${n}-${p}`,[g,v]=Yt(f),x=`studio-${p}-filter-visible-${n}`;let _;e[0]!==x?(_=()=>globalThis.localStorage?.getItem(x)==="true",e[0]=x,e[1]=_):_=e[1];const[u,y]=B.useState(_);let j;e[2]!==x?(j=M=>{y(M),globalThis.localStorage?.setItem(x,String(M))},e[2]=x,e[3]=j):j=e[3];const D=j;let b;e[4]!==u||e[5]!==D?(b=()=>{D(!u)},e[4]=u,e[5]=D,e[6]=b):b=e[6];const k=b,[i,T]=Ct(`studio-${p}-${n}`,l),{sortKey:L,sortDirection:O,handleSort:A}=Zt(o),K=L;let U;return e[7]!==u||e[8]!==g||e[9]!==A||e[10]!==d||e[11]!==N||e[12]!==D||e[13]!==v||e[14]!==T||e[15]!==O||e[16]!==K||e[17]!==k||e[18]!==i?(U={search:d,searchTerm:N,setSearch:a,filters:g,setFilters:v,filterBarVisible:u,setFilterBarVisible:D,toggleFilterBar:k,viewMode:i,setViewMode:T,sortKey:K,sortDirection:O,handleSort:A},e[7]=u,e[8]=g,e[9]=A,e[10]=d,e[11]=N,e[12]=D,e[13]=v,e[14]=T,e[15]=O,e[16]=K,e[17]=k,e[18]=i,e[19]=U):U=e[19],U}function tn(s){const e=ae.c(35),{open:n,onOpenChange:p,count:r,onConfirm:c}=s,o=de(),l=r===1?"orgs.bulkDeleteDialog.deleteTitleSingular":"orgs.bulkDeleteDialog.deleteTitlePlural";let d;e[0]!==r||e[1]!==o||e[2]!==l?(d=o(l,{count:r}),e[0]=r,e[1]=o,e[2]=l,e[3]=d):d=e[3];let a;e[4]!==d?(a=t.jsx(Ie,{children:d}),e[4]=d,e[5]=a):a=e[5];const N=r===1?"orgs.bulkDeleteDialog.deleteDescriptionSingular":"orgs.bulkDeleteDialog.deleteDescriptionPlural";let f;e[6]!==o||e[7]!==N?(f=o(N),e[6]=o,e[7]=N,e[8]=f):f=e[8];let g;e[9]!==f?(g=t.jsx(Pe,{children:f}),e[9]=f,e[10]=g):g=e[10];let v;e[11]!==a||e[12]!==g?(v=t.jsxs(Le,{children:[a,g]}),e[11]=a,e[12]=g,e[13]=v):v=e[13];let x;e[14]!==o?(x=o("orgs.bulkDeleteDialog.cancelButton"),e[14]=o,e[15]=x):x=e[15];let _;e[16]!==x?(_=t.jsx(Me,{children:x}),e[16]=x,e[17]=_):_=e[17];const u=r===1?"orgs.bulkDeleteDialog.deleteButtonSingular":"orgs.bulkDeleteDialog.deleteButtonPlural";let y;e[18]!==r||e[19]!==o||e[20]!==u?(y=o(u,{count:r}),e[18]=r,e[19]=o,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==c||e[23]!==y?(j=t.jsx(Oe,{onClick:c,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:y}),e[22]=c,e[23]=y,e[24]=j):j=e[24];let D;e[25]!==j||e[26]!==_?(D=t.jsxs(Fe,{children:[_,j]}),e[25]=j,e[26]=_,e[27]=D):D=e[27];let b;e[28]!==D||e[29]!==v?(b=t.jsxs($e,{children:[v,D]}),e[28]=D,e[29]=v,e[30]=b):b=e[30];let k;return e[31]!==p||e[32]!==n||e[33]!==b?(k=t.jsx(Ue,{open:n,onOpenChange:p,children:b}),e[31]=p,e[32]=n,e[33]=b,e[34]=k):k=e[34],k}function nn(s){return s._registryId?.includes("community-registry")===!0}function sn(s){const e=ae.c(82),{item:n,canManage:p,allConnections:r,connectedAppNames:c,connectingItemId:o,onNavigateConnected:l,onConnect:d}=s,a=de(),[N,f]=B.useState(!1),[g,v]=B.useState(null);let x,_;e[0]!==c||e[1]!==n?(x=Ae(n)??"",_=c.has(x),e[0]=c,e[1]=n,e[2]=x,e[3]=_):(x=e[2],_=e[3]);const u=_;let y;e[4]!==n._meta?(y=vt(n._meta),e[4]=n._meta,e[5]=y):y=e[5];const j=y,D=j?.friendlyName||j?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",b=n.server?.description||n.description||null;let k;e[6]!==n.server?.icons?.[0]?.src||e[7]!==n.server?.repository?(k=n.server?.icons?.[0]?.src||at(n.server?.repository)||null,e[6]=n.server?.icons?.[0]?.src,e[7]=n.server?.repository,e[8]=k):k=e[8];const i=k;let T;if(e[9]!==r||e[10]!==x){let J;e[12]!==x?(J=be=>be.connection_type!=="VIRTUAL"&&be.app_name===x,e[12]=x,e[13]=J):J=e[13],T=r.filter(J),e[9]=r,e[10]=x,e[11]=T}else T=e[11];const L=T;let O;e[14]!==n?(O=nn(n),e[14]=n,e[15]=O):O=e[15];const A=O,K=u||p;let U,M;e[16]!==L||e[17]!==A||e[18]!==u||e[19]!==n||e[20]!==d||e[21]!==l?(U=()=>{if(u){const J=L[0];J&&l(J);return}M()},M=()=>{A?(v("connect"),f(!0)):d(n)},e[16]=L,e[17]=A,e[18]=u,e[19]=n,e[20]=d,e[21]=l,e[22]=U,e[23]=M):(U=e[22],M=e[23]);let V;e[24]!==n||e[25]!==d||e[26]!==g?(V=()=>{re("connections_community_warning_confirmed",{registry_item_id:n.id}),f(!1),g==="connect"&&d(n),v(null)},e[24]=n,e[25]=d,e[26]=g,e[27]=V):V=e[27];const q=V;let I;e[28]!==b||e[29]!==i||e[30]!==D?(I={title:D,description:b,icon:i},e[28]=b,e[29]=i,e[30]=D,e[31]=I):I=e[31];let Q;e[32]===Symbol.for("react.memo_cache_sentinel")?(Q=t.jsx(ye,{}),e[32]=Q):Q=e[32];const S=K?U:void 0;let w;e[33]!==A||e[34]!==n._sourceIcon?(w=A&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[33]=A,e[34]=n._sourceIcon,e[35]=w):w=e[35];let z;e[36]!==p||e[37]!==o||e[38]!==M||e[39]!==u||e[40]!==n.id||e[41]!==a?(z=u?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:a("orgs.catalogItemCard.connected")}):p&&t.jsx(G,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:o!==null,onClick:J=>{J.stopPropagation(),M()},children:o===n.id?t.jsx(pe,{size:14,className:"animate-spin"}):a("orgs.catalogItemCard.connect")}),e[36]=p,e[37]=o,e[38]=M,e[39]=u,e[40]=n.id,e[41]=a,e[42]=z):z=e[42];let R;e[43]!==w||e[44]!==z?(R=t.jsxs("div",{className:"flex items-center gap-2",children:[w,z]}),e[43]=w,e[44]=z,e[45]=R):R=e[45];let H;e[46]!==R||e[47]!==I||e[48]!==S?(H=t.jsx(ve,{connection:I,fallbackIcon:Q,onClick:S,headerActionsAlwaysVisible:!0,headerActions:R}),e[46]=R,e[47]=I,e[48]=S,e[49]=H):H=e[49];let C;e[50]!==a?(C=a("orgs.catalogItemCard.communityMcpServerTitle"),e[50]=a,e[51]=C):C=e[51];let F;e[52]!==C?(F=t.jsx(Ie,{children:C}),e[52]=C,e[53]=F):F=e[53];let P;e[54]!==a?(P=a("orgs.catalogItemCard.communityMcpServerDescription"),e[54]=a,e[55]=P):P=e[55];let Z;e[56]!==P?(Z=t.jsx(Pe,{children:P}),e[56]=P,e[57]=Z):Z=e[57];let te;e[58]!==F||e[59]!==Z?(te=t.jsxs(Le,{children:[F,Z]}),e[58]=F,e[59]=Z,e[60]=te):te=e[60];let ee;e[61]!==a?(ee=a("orgs.catalogItemCard.cancel"),e[61]=a,e[62]=ee):ee=e[62];let m;e[63]!==ee?(m=t.jsx(Me,{children:ee}),e[63]=ee,e[64]=m):m=e[64];let h;e[65]!==a?(h=a("orgs.catalogItemCard.continue"),e[65]=a,e[66]=h):h=e[66];let $;e[67]!==q||e[68]!==h?($=t.jsx(Oe,{onClick:q,children:h}),e[67]=q,e[68]=h,e[69]=$):$=e[69];let W;e[70]!==m||e[71]!==$?(W=t.jsxs(Fe,{children:[m,$]}),e[70]=m,e[71]=$,e[72]=W):W=e[72];let E;e[73]!==te||e[74]!==W?(E=t.jsxs($e,{children:[te,W]}),e[73]=te,e[74]=W,e[75]=E):E=e[75];let X;e[76]!==N||e[77]!==E?(X=t.jsx(Ue,{open:N,onOpenChange:f,children:E}),e[76]=N,e[77]=E,e[78]=X):X=e[78];let ne;return e[79]!==H||e[80]!==X?(ne=t.jsxs(t.Fragment,{children:[H,X]}),e[79]=H,e[80]=X,e[81]=ne):ne=e[81],ne}function Je(s){const e=ae.c(8),{selectionMode:n,children:p}=s,r=n?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let c;e[0]!==r?(c=je("overflow-hidden transition-all duration-150 ease-out",r),e[0]=r,e[1]=c):c=e[1];let o;e[2]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(Gt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:cn,children:t.jsx(Jt,{size:20})})}),e[2]=o):o=e[2];let l;e[3]!==p?(l=t.jsxs(qt,{children:[o,t.jsx(Qt,{align:"end",onClick:on,children:p})]}),e[3]=p,e[4]=l):l=e[4];let d;return e[5]!==c||e[6]!==l?(d=t.jsx("div",{className:c,children:l}),e[5]=c,e[6]=l,e[7]=d):d=e[7],d}function on(s){return s.stopPropagation()}function cn(s){return s.stopPropagation()}function ln(s){const e=ae.c(57),{group:n,onOpen:p,selectionMode:r,selectedIds:c,onToggleSelect:o}=s,l=de();let d;if(e[0]!==n.connections||e[1]!==c){let I;e[3]!==c?(I=Q=>c.has(Q.id),e[3]=c,e[4]=I):I=e[4],d=n.connections.every(I),e[0]=n.connections,e[1]=c,e[2]=d}else d=e[2];const a=d;let N;if(e[5]!==n.connections||e[6]!==c){let I;e[8]!==c?(I=Q=>c.has(Q.id),e[8]=c,e[9]=I):I=e[9],N=n.connections.some(I),e[5]=n.connections,e[6]=c,e[7]=N}else N=e[7];const f=N;let g;e[10]!==a||e[11]!==n.connections||e[12]!==o||e[13]!==c?(g=()=>{for(const I of n.connections)a?c.has(I.id)&&o(I.id):c.has(I.id)||o(I.id)},e[10]=a,e[11]=n.connections,e[12]=o,e[13]=c,e[14]=g):g=e[14];const v=g,x=n.title,_=n.icon;let u;e[15]!==n.connections.length||e[16]!==l?(u=l("orgs.connectionSelectionUi.instancesCount",{count:n.connections.length}),e[15]=n.connections.length,e[16]=l,e[17]=u):u=e[17];let y;e[18]!==n.icon||e[19]!==n.title||e[20]!==u?(y={title:x,icon:_,description:u},e[18]=n.icon,e[19]=n.title,e[20]=u,e[21]=y):y=e[21];let j;e[22]!==p||e[23]!==r||e[24]!==v?(j=()=>r?v():p(),e[22]=p,e[23]=r,e[24]=v,e[25]=j):j=e[25];const D=r&&a&&"ring-2 ring-primary",b=r&&f&&!a&&"ring-1 ring-primary/50";let k;e[26]!==b||e[27]!==D?(k=je(D,b),e[26]=b,e[27]=D,e[28]=k):k=e[28];const i=r?a?!0:f&&"mixed":void 0;let T;e[29]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(ye,{}),e[29]=T):T=e[29];let L;e[30]!==a||e[31]!==n.connections.length||e[32]!==r||e[33]!==f||e[34]!==l||e[35]!==v?(L=r?t.jsx(Ge,{checked:a?!0:f?"indeterminate":!1,onCheckedChange:v}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:l("orgs.connectionSelectionUi.connected")}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[30]=a,e[31]=n.connections.length,e[32]=r,e[33]=f,e[34]=l,e[35]=v,e[36]=L):L=e[36];let O;e[37]!==p?(O=I=>{I.stopPropagation(),p()},e[37]=p,e[38]=O):O=e[38];let A;e[39]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(qe,{size:16}),e[39]=A):A=e[39];let K;e[40]!==l?(K=l("orgs.connectionSelectionUi.open"),e[40]=l,e[41]=K):K=e[41];let U;e[42]!==O||e[43]!==K?(U=t.jsxs(me,{onClick:O,children:[A,K]}),e[42]=O,e[43]=K,e[44]=U):U=e[44];let M;e[45]!==r||e[46]!==U?(M=t.jsx(Je,{selectionMode:r,children:U}),e[45]=r,e[46]=U,e[47]=M):M=e[47];let V;e[48]!==L||e[49]!==M?(V=t.jsxs("div",{className:"flex items-center gap-1",children:[L,M]}),e[48]=L,e[49]=M,e[50]=V):V=e[50];let q;return e[51]!==k||e[52]!==i||e[53]!==V||e[54]!==y||e[55]!==j?(q=t.jsx(t.Fragment,{children:t.jsx(ve,{connection:y,onClick:j,className:k,selected:i,fallbackIcon:T,headerActionsAlwaysVisible:!0,headerActions:V})}),e[51]=k,e[52]=i,e[53]=V,e[54]=y,e[55]=j,e[56]=q):q=e[56],q}function rn(s){const e=ae.c(36),{connection:n,isSelected:p,selectionMode:r,canManage:c,canManageAgents:o,onToggleSelect:l,onOpen:d,onToggleStatus:a,onDelete:N}=s,f=de();let g;e[0]!==p||e[1]!==l||e[2]!==r||e[3]!==f?(g=r?t.jsx(Ge,{checked:p,onCheckedChange:l,onClick:an}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:f("orgs.connectionSelectionUi.connected")}),e[0]=p,e[1]=l,e[2]=r,e[3]=f,e[4]=g):g=e[4];let v;e[5]!==d?(v=i=>{i.stopPropagation(),d()},e[5]=d,e[6]=v):v=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:16}),e[7]=x):x=e[7];let _;e[8]!==f?(_=f("orgs.connectionSelectionUi.open"),e[8]=f,e[9]=_):_=e[9];let u;e[10]!==v||e[11]!==_?(u=t.jsxs(me,{onClick:v,children:[x,_]}),e[10]=v,e[11]=_,e[12]=u):u=e[12];let y;e[13]!==c||e[14]!==o||e[15]!==l||e[16]!==f?(y=(c||o)&&t.jsxs(me,{onClick:i=>{i.stopPropagation(),l()},children:[t.jsx($t,{size:16}),f("orgs.connectionSelectionUi.select")]}),e[13]=c,e[14]=o,e[15]=l,e[16]=f,e[17]=y):y=e[17];let j;e[18]!==c||e[19]!==n||e[20]!==a||e[21]!==f?(j=c&&(n.status==="active"?t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("inactive")},children:[t.jsx(Ut,{size:16}),f("orgs.connectionSelectionUi.disable")]}):t.jsxs(me,{onClick:i=>{i.stopPropagation(),a("active")},children:[t.jsx(Vt,{size:16}),f("orgs.connectionSelectionUi.enable")]})),e[18]=c,e[19]=n,e[20]=a,e[21]=f,e[22]=j):j=e[22];let D;e[23]!==c||e[24]!==N||e[25]!==f?(D=c&&t.jsxs(me,{variant:"destructive",onClick:i=>{i.stopPropagation(),N()},children:[t.jsx(Qe,{size:16}),f("orgs.connectionSelectionUi.delete")]}),e[23]=c,e[24]=N,e[25]=f,e[26]=D):D=e[26];let b;e[27]!==r||e[28]!==u||e[29]!==y||e[30]!==j||e[31]!==D?(b=t.jsxs(Je,{selectionMode:r,children:[u,y,j,D]}),e[27]=r,e[28]=u,e[29]=y,e[30]=j,e[31]=D,e[32]=b):b=e[32];let k;return e[33]!==g||e[34]!==b?(k=t.jsxs("div",{className:"flex items-center gap-1",children:[g,b]}),e[33]=g,e[34]=b,e[35]=k):k=e[35],k}function an(s){return s.stopPropagation()}function dn(s){const e=ae.c(29),{count:n,total:p,canManage:r,canManageAgents:c,onSelectAll:o,onDeselectAll:l,onDelete:d,onAddToAgent:a,onToggleStatus:N,onCancel:f}=s,g=de();if(n===0)return null;let v;e[0]!==n||e[1]!==g?(v=g("orgs.connectionSelectionUi.selectedCount",{count:n}),e[0]=n,e[1]=g,e[2]=v):v=e[2];let x;e[3]!==v?(x=t.jsx("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:v}),e[3]=v,e[4]=x):x=e[4];let _;e[5]!==n||e[6]!==l||e[7]!==o||e[8]!==g||e[9]!==p?(_=n<p?t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:g("orgs.connectionSelectionUi.selectAll",{total:p})}):t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:g("orgs.connectionSelectionUi.clearSelection")}),e[5]=n,e[6]=l,e[7]=o,e[8]=g,e[9]=p,e[10]=_):_=e[10];let u;e[11]!==c||e[12]!==a||e[13]!==g?(u=c&&t.jsxs(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:a,children:[t.jsx(We,{size:13}),g("orgs.connectionSelectionUi.addToAgent")]}),e[11]=c,e[12]=a,e[13]=g,e[14]=u):u=e[14];let y;e[15]!==r||e[16]!==d||e[17]!==N||e[18]!==g?(y=r&&t.jsxs(t.Fragment,{children:[t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("active"),children:g("orgs.connectionSelectionUi.enable")}),t.jsx(G,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>N("inactive"),children:g("orgs.connectionSelectionUi.disable")}),t.jsxs(G,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:[t.jsx(Qe,{size:13}),g("orgs.connectionSelectionUi.delete")]})]}),e[15]=r,e[16]=d,e[17]=N,e[18]=g,e[19]=y):y=e[19];let j;e[20]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(Xe,{size:13}),e[20]=j):j=e[20];let D;e[21]!==f?(D=t.jsx(G,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:f,children:j}),e[21]=f,e[22]=D):D=e[22];let b;return e[23]!==x||e[24]!==_||e[25]!==u||e[26]!==y||e[27]!==D?(b=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:[x,_,u,y,D]})}),e[23]=x,e[24]=_,e[25]=u,e[26]=y,e[27]=D,e[28]=b):b=e[28],b}function un(s){const e=ae.c(45),{open:n,onOpenChange:p,agents:r,onConfirm:c}=s,o=de(),[l,d]=B.useState(null);let a;e[0]!==o?(a=o("orgs.connectionSelectionUi.addToAgentTitle"),e[0]=o,e[1]=a):a=e[1];let N;e[2]!==a?(N=t.jsx(Ve,{children:a}),e[2]=a,e[3]=N):N=e[3];let f;e[4]!==o?(f=o("orgs.connectionSelectionUi.addToAgentDescription"),e[4]=o,e[5]=f):f=e[5];let g;e[6]!==f?(g=t.jsx(ze,{children:f}),e[6]=f,e[7]=g):g=e[7];let v;e[8]!==N||e[9]!==g?(v=t.jsxs(Ee,{children:[N,g]}),e[8]=N,e[9]=g,e[10]=v):v=e[10];let x;e[11]!==r||e[12]!==l||e[13]!==o?(x=r.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:o("orgs.connectionSelectionUi.noAgentsFound")}):r.map(A=>t.jsxs("button",{type:"button",onClick:()=>d(A.id),className:je("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",l===A.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Xt,{icon:A.icon,name:A.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:A.title}),A.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:A.description})]})]},A.id)),e[11]=r,e[12]=l,e[13]=o,e[14]=x):x=e[14];let _;e[15]!==x?(_=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:x}),e[15]=x,e[16]=_):_=e[16];let u;e[17]!==p?(u=()=>p(!1),e[17]=p,e[18]=u):u=e[18];let y;e[19]!==o?(y=o("orgs.connectionSelectionUi.cancel"),e[19]=o,e[20]=y):y=e[20];let j;e[21]!==u||e[22]!==y?(j=t.jsx(G,{variant:"outline",onClick:u,children:y}),e[21]=u,e[22]=y,e[23]=j):j=e[23];const D=!l;let b;e[24]!==c||e[25]!==p||e[26]!==l?(b=()=>{l&&(c(l),p(!1),d(null))},e[24]=c,e[25]=p,e[26]=l,e[27]=b):b=e[27];let k;e[28]!==o?(k=o("orgs.connectionSelectionUi.add"),e[28]=o,e[29]=k):k=e[29];let i;e[30]!==D||e[31]!==b||e[32]!==k?(i=t.jsx(G,{disabled:D,onClick:b,children:k}),e[30]=D,e[31]=b,e[32]=k,e[33]=i):i=e[33];let T;e[34]!==j||e[35]!==i?(T=t.jsxs(Be,{children:[j,i]}),e[34]=j,e[35]=i,e[36]=T):T=e[36];let L;e[37]!==T||e[38]!==v||e[39]!==_?(L=t.jsxs(Ke,{className:"sm:max-w-[400px]",children:[v,_,T]}),e[37]=T,e[38]=v,e[39]=_,e[40]=L):L=e[40];let O;return e[41]!==p||e[42]!==n||e[43]!==L?(O=t.jsx(He,{open:n,onOpenChange:p,children:L}),e[41]=p,e[42]=n,e[43]=L,e[44]=O):O=e[44],O}function mn({listState:s,activeTab:e,typeFilter:n,statusFilter:p,registryFilter:r,enabledRegistries:c}){const o=de(),{org:l}=Ne(),d=ct(),a=ke(),{data:N}=Te.useSession(),f=Re(),g=Ot(s),v=jt(),{granted:x}=Ce("connections:manage"),{granted:_}=Ce("agents:manage"),[u,y]=B.useState(new Set),j=u.size>0,[D,b]=B.useState(!1),[k,i]=B.useState(!1),[T,L]=B.useState(null),O=Ft(),A=g.filter(m=>!(n!=="ALL"&&m.connection_type!==n||p!=="ALL"&&m.status!==p)),K=ht(A),U=m=>{y(h=>{const $=new Set(h);return $.has(m)?$.delete(m):$.add(m),$})},M=()=>{y(new Set)},V=we(c,s.searchTerm),q=V.items,I=St(V.loadMore,V.hasMore,V.isLoadingMore),Q=new Set(g.filter(m=>m.app_name).map(m=>m.app_name)),S=r==="ALL"||c.some(m=>m.id===r)?r:"ALL",w=s.search.length>0,z=e==="all"||w?q.filter(m=>{if(S!=="ALL"&&m._registryId!==S)return!1;if(w){const h=Ae(m);if(h&&Q.has(h))return!1}return!0}):[],R=e==="connected"||w?K:[],H=async m=>{if(!(!l||!N?.user?.id)){re("connection_add_clicked",{action:"connect_new",registry_item_id:m.id,source:"connections_page"}),L(m.id);try{const h=ut(m,l.id,N.user.id,{remoteIndex:0}),$=h.connection_type==="STDIO",W=!!h.connection_url,E=$&&h.connection_headers&&typeof h.connection_headers=="object"&&"command"in h.connection_headers;if(!W&&!E){Y.error(o("orgs.connections.cannotConnectNoMethod")),L(null);return}const{id:X}=await f.create.mutateAsync(h),ne=await Wt({connectionId:X,orgId:l.id,orgSlug:l.slug,persistFallback:J=>f.update.mutateAsync({id:X,data:{connection_token:J}}).then(()=>{})});if(ne.ran&&!ne.ok){re("connection_oauth_failed",{connection_id:X,flow:"connections_page_connect",error:ne.error??"no_token"}),Y.error(o("orgs.connections.authenticationFailed",{error:ne.error??"no token received"}));return}if(ne.ran){re("connection_oauth_succeeded",{connection_id:X,flow:"connections_page_connect"});const J=new URL(`/api/${l.slug}/mcp/${X}`,window.location.origin);await d.invalidateQueries({queryKey:rt.isMCPAuthenticated(J.href,null)}),F(),Y.success(o("orgs.connections.authenticationSuccessful"))}Y.success(o("orgs.connections.connectedSuccessfully"))}catch(h){Y.error(o("orgs.connections.failedToConnect",{error:h instanceof Error?h.message:String(h)}))}finally{L(null)}}},C=lt(),F=()=>{d.invalidateQueries({predicate:m=>{const h=m.queryKey;return h[1]===l.id&&h[3]==="collection"&&h[4]==="CONNECTIONS"}})},P=async()=>{b(!1);const m=[...u];re("connections_bulk_delete",{count:m.length});let h=0;for(const $ of m)try{await C.call("COLLECTION_CONNECTIONS_DELETE",{id:$,force:!0}),h++}catch{}F(),Y.success(o("orgs.connections.deletedConnections",{count:h})),M()},Z=async(m,h)=>{try{await f.update.mutateAsync({id:m,data:{status:h}}),F(),Y.success(o(h==="active"?"orgs.connections.connectionEnabled":"orgs.connections.connectionDisabled"))}catch{Y.error(o("orgs.connections.failedToUpdateConnection"))}},te=async m=>{const h=[...u];re("connections_bulk_status_toggled",{count:h.length,to_status:m});let $=0;for(const W of h)try{await f.update.mutateAsync({id:W,data:{status:m}}),$++}catch{}F(),Y.success(m==="active"?o("orgs.connections.enabledConnections",{count:$}):o("orgs.connections.disabledConnections",{count:$})),M()},ee=async m=>{const h=O.find(E=>E.id===m);if(!h)return;re("connections_bulk_add_to_agent",{agent_id:m,count:u.size});const $=new Set(h.connections.map(E=>E.connection_id)),W=[...u].filter(E=>!$.has(E)).map(E=>({connection_id:E,selected_tools:null,selected_resources:null,selected_prompts:null}));if(W.length===0){Y.info(o("orgs.connections.allConnectionsAlreadyInAgent"));return}try{await C.call("COLLECTION_VIRTUAL_MCP_UPDATE",{id:m,data:{connections:[...h.connections,...W]}}),d.invalidateQueries({predicate:E=>{const X=E.queryKey;return X[1]===l.id&&X[3]==="collection"&&X[4]==="VIRTUAL_MCP"}}),Y.success(o("orgs.connections.addedConnectionsToAgent",{count:W.length,agentTitle:h.title})),M()}catch{Y.error(o("orgs.connections.failedToAddConnectionsToAgent"))}};return t.jsxs(t.Fragment,{children:[t.jsx(yt,{...v}),t.jsx(tn,{open:D,onOpenChange:b,count:u.size,onConfirm:P}),t.jsx(un,{open:k,onOpenChange:i,agents:O,onConfirm:ee}),V.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(w?z.length===0&&A.length===0:e==="all"?z.length===0:A.length===0)?t.jsx(xt,{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(x?"orgs.connections.createConnectionToGetStarted":"orgs.connections.askAdminToAddConnection")}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[R.map(m=>{if(m.type==="group")return t.jsx(ln,{group:m,onOpen:()=>{a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:m.key}})},selectionMode:j,selectedIds:u,onToggleSelect:U},m.key);const h=m.connection,$=u.has(h.id);return t.jsx(ve,{connection:h,fallbackIcon:t.jsx(ye,{}),onClick:()=>j?U(h.id):a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),className:je($&&"ring-2 ring-primary bg-primary/5"),selected:j?$:void 0,headerActionsAlwaysVisible:!0,headerActions:t.jsx(rn,{connection:h,isSelected:$,selectionMode:j,canManage:x,canManageAgents:_,onToggleSelect:()=>U(h.id),onOpen:()=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onToggleStatus:W=>Z(h.id,W),onDelete:()=>v.requestDelete(h)})},h.id)}),z.map(m=>t.jsx(sn,{item:m,canManage:x,allConnections:g,connectedAppNames:Q,connectingItemId:T,onNavigateConnected:h=>a({to:"/$org/settings/connections/$appSlug",params:{org:l.slug,appSlug:xe(h)}}),onConnect:H},`catalog-${m._registryId}:${m.id}`)),(e==="all"||w)&&c.length>0&&t.jsx("div",{ref:I,className:"col-span-full h-4"}),(e==="all"||w)&&V.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(pe,{size:24,className:"animate-spin text-muted-foreground"})})]})}),j&&t.jsx(dn,{count:u.size,total:A.length,canManage:x,canManageAgents:_,onSelectAll:()=>{y(new Set(A.map(m=>m.id)))},onDeselectAll:()=>y(new Set),onDelete:()=>b(!0),onAddToAgent:()=>i(!0),onToggleStatus:te,onCancel:M})]})}function gn(){const s=de(),{org:e}=Ne(),n=ke(),p=Ze({strict:!1}),{data:r}=Te.useSession(),{stdioEnabled:c}=et(),o=tt(),{granted:l}=Ce("connections:manage"),d=en({namespace:e.slug,resource:"connections"}),a=Re(),[N,f]=nt(st.connectionsTab(e.slug),S=>p.tab==="all"||p.tab==="connected"?p.tab:S??"all"),[g,v]=B.useState("ALL"),[x,_]=B.useState("ALL"),[u,y]=B.useState("ALL"),j=ft(),b=we(j,d.searchTerm).items,k=d.search!==d.searchTerm,i=ot({resolver:it(Bt),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),T=i.watch("ui_type"),L=i.watch("connection_url"),O=i.watch("npx_package"),A=he({uiType:T,connectionUrl:L??"",npxPackage:O??""})??De({uiType:T,connectionUrl:L??"",registryItems:b}),K=l&&p.action==="create",U=()=>{re("connections_custom_dialog_opened",{source:"connections_page"}),n({to:"/$org/settings/connections",params:{org:e.slug},search:{action:"create"}})},M=()=>{n({to:"/$org/settings/connections",params:{org:e.slug},search:{}})},V=async S=>{let w,z=null,R=null,H=null;S.ui_type==="NPX"?(w="STDIO",z="",H=Ht(S.npx_package||"",S.env_vars||[])):S.ui_type==="STDIO"?(w="STDIO",z="",H=Rt(S.stdio_command||"",S.stdio_args||"",S.stdio_cwd,S.env_vars||[])):(w=S.ui_type,z=S.connection_url||"",R=S.connection_token||null);const C=dt("conn");re("connection_custom_created",{connection_type:w,ui_type:S.ui_type}),await a.create.mutateAsync({id:C,title:S.title,description:S.description||null,connection_type:w,connection_url:z,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:r?.user?.id||"system",organization_id:e.id,icon:S.icon??null,app_name:null,app_id:null,connection_headers:H,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),M(),i.reset(),n({to:"/$org/settings/connections/$appSlug",params:{org:e.slug,appSlug:xe({app_name:null,connection_url:z,title:S.title,id:C})}})},q=S=>{S||(K&&M(),i.reset())},I=S=>{const w=S.trim();if(!w)return;const z=!!i.formState.dirtyFields.title,R=!!i.formState.dirtyFields.description,H=!!i.formState.dirtyFields.env_vars,C=P=>{if(P&&(!z&&!i.getValues("title").trim()&&P.title&&i.setValue("title",P.title,{shouldDirty:!1}),!R&&!(i.getValues("description")??"").trim()&&P.description&&i.setValue("description",P.description,{shouldDirty:!1}),!H&&P.envVarKeys?.length)){const Z=i.getValues("env_vars")??[],te=new Set(Z.map(m=>m.key)),ee=P.envVarKeys.filter(m=>!te.has(m));ee.length>0&&i.setValue("env_vars",[...Z,...ee.map(m=>({key:m,value:""}))],{shouldDirty:!0})}},F=Kt(w);if(F&&c){i.setValue("ui_type","NPX",{shouldDirty:!0}),i.setValue("npx_package",F.packageName,{shouldDirty:!0}),i.setValue("connection_url","",{shouldDirty:!0}),i.setValue("connection_token",null,{shouldDirty:!0}),C(he({uiType:"NPX",npxPackage:F.packageName}));return}if(w.startsWith("http://")||w.startsWith("https://")){const P=T==="HTTP"||T==="SSE"||T==="Websocket"?T:"HTTP";i.setValue("ui_type",P,{shouldDirty:!0}),i.setValue("connection_url",w,{shouldDirty:!0}),C(he({uiType:P,connectionUrl:w})??De({uiType:P,connectionUrl:w,registryItems:b}));return}T==="NPX"&&C(he({uiType:"NPX",npxPackage:w}))},Q=l?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(G,{variant:"outline",onClick:U,children:[t.jsx(We,{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(fe,{children:[(()=>{const S=s("orgs.connections.createConnection"),w=s("orgs.connections.createConnectionDescription"),z=i.formState.isSubmitting?s("orgs.connections.saving"):s("orgs.connections.createConnection"),R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(se,{control:i.control,name:"ui_type",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.type")}),t.jsxs(wt,{value:C.value,onValueChange:C.onChange,children:[t.jsx(ce,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(ge,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(ge,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(ge,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Se,{className:"w-4 h-4"}),"Websocket"]})}),c&&t.jsxs(t.Fragment,{children:[t.jsx(ge,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ye,{className:"w-4 h-4"}),s("orgs.connections.npxPackage")]})}),t.jsx(ge,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(zt,{className:"w-4 h-4"}),s("orgs.connections.customCommand")]})})]})]})]}),t.jsx(le,{})]})}),T==="NPX"&&t.jsx(se,{control:i.control,name:"npx_package",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.npmPackage")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.npmPackagePlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("npx_package",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),T==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(se,{control:i.control,name:"stdio_command",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.command")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.commandPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"stdio_args",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.arguments")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.argumentsPlaceholder"),...C,value:C.value??""})}),t.jsx(le,{})]})})]}),t.jsx(se,{control:i.control,name:"stdio_cwd",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.workingDirectory")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.workingDirectoryPlaceholder"),...C,value:C.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:s("orgs.connections.directoryExecutionNote")}),t.jsx(le,{})]})})]}),(T==="NPX"||T==="STDIO")&&t.jsx(se,{control:i.control,name:"env_vars",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.environmentVariables")}),t.jsx(ce,{children:t.jsx(Et,{value:C.value??[],onChange:C.onChange})}),t.jsx(le,{})]})}),T!=="NPX"&&T!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(se,{control:i.control,name:"connection_url",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.url")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.urlPlaceholder"),...C,value:C.value??"",onPaste:F=>{const P=F.clipboardData.getData("text");P&&(F.preventDefault(),i.setValue("connection_url",P.trim(),{shouldDirty:!0}),I(P))},onBlur:F=>{I(F.target.value),C.onBlur()}})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"connection_token",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:A?.token?.label??s("orgs.connections.tokenOptional")}),t.jsx(ce,{children:t.jsx(ue,{type:"password",placeholder:A?.token?.placeholder??s("orgs.connections.tokenPlaceholder"),...C,value:C.value??""})}),A?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[A.token.helperText,A.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(le,{})]})})]}),t.jsx(se,{control:i.control,name:"title",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.name")}),t.jsx(ce,{children:t.jsx(ue,{placeholder:s("orgs.connections.namePlaceholder"),...C})}),t.jsx(le,{})]})}),t.jsx(se,{control:i.control,name:"description",render:({field:C})=>t.jsxs(oe,{children:[t.jsx(ie,{children:s("orgs.connections.description")}),t.jsx(ce,{children:t.jsx(Mt,{placeholder:s("orgs.connections.descriptionPlaceholder"),rows:3,...C,value:C.value??""})}),t.jsx(le,{})]})})]}),H=K;return o?t.jsx(bt,{open:H,onOpenChange:q,children:t.jsxs(_t,{className:"max-h-[90vh]",children:[t.jsx(Dt,{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(Nt,{children:S}),t.jsx(kt,{className:"mt-1",children:w})]}),t.jsx(Tt,{asChild:!0,children:t.jsx(G,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1","aria-label":s("orgs.connections.close"),children:t.jsx(Xe,{size:16})})})]})}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(At,{children:t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"w-full",children:z})})]})})]})}):t.jsx(He,{open:H,onOpenChange:q,children:t.jsxs(Ke,{className:"sm:max-w-[525px]",children:[t.jsxs(Ee,{children:[t.jsx(Ve,{children:S}),t.jsx(ze,{children:w})]}),t.jsx(_e,{...i,children:t.jsxs("form",{onSubmit:i.handleSubmit(V),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Be,{children:[t.jsx(G,{type:"button",variant:"outline",onClick:()=>q(!1),children:s("orgs.connections.cancel")}),t.jsx(G,{type:"submit",disabled:i.formState.isSubmitting,className:"min-w-40",children:z})]})]})})]})})})(),t.jsx(fe.Content,{children:t.jsx(fe.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(fe.Title,{children:s("orgs.connections.pageTitle")}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{value:d.search,onChange:d.setSearch,placeholder:s("orgs.connections.searchPlaceholder"),className:"w-full md:w-[375px]",onKeyDown:S=>{S.key==="Escape"&&(d.setSearch(""),S.target.blur())}}),t.jsx(mt,{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:g,onChange:S=>v(S||"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:x,onChange:S=>_(S||"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")}]},...j.length>1?[{label:s("orgs.connections.filterRegistry"),value:u,onChange:S=>y(S||"ALL"),options:[{id:"ALL",label:s("orgs.connections.filterAllRegistries")},...j.map(S=>({id:S.id,label:S.id.includes("community-registry")?s("orgs.connections.communityMcpRegistry"):S.title}))]}]:[]]})]}),Q]}),t.jsx(pt,{tabs:[{id:"all",label:s("orgs.connections.tabAll")},{id:"connected",label:s("orgs.connections.tabConnected")}],activeTab:N,onTabChange:S=>{const w=S;w!==N&&re("connections_page_tab_changed",{to_tab:w}),f(w)}}),t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:k?.5:1,transition:k?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:k?"none":"auto"},children:t.jsx(mn,{listState:d,activeTab:N,typeFilter:g,statusFilter:x,registryFilter:u,enabledRegistries:j})})})]})})})]})})}function Gs(){const s=ae.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(B.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(pe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gn,{})})}),s[0]=e):e=s[0],e}export{Gs as default};
|
package/dist/client/assets/{decopilot-sse-pool-0EWVughz.js → decopilot-sse-pool-CMc1xBx0.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./index-
|
|
1
|
+
import"./index-BAzBxxL9.js";import{e as R}from"./backoff-CrEUbyZT.js";const k={STEP:"decopilot.step",FINISH:"decopilot.finish",THREAD_STATUS:"decopilot.thread.status"},w=Object.values(k),Y="super-agent",p=["#9ca3af","#ef4444","#f97316","#f59e0b","#22c55e","#3b82f6","#a855f7","#ec4899"],O=p[0];function x(r){return p[r%p.length]??O}function G(r){return r.createdBy==="system"}const K=["qa","code_review"],N={qa:"QA Agent",code_review:"Code Reviewer"};function j(r,s){return r?.startsWith(`${N[s]}:`)??!1}function I(r){let s=0;for(const l of r)l.action==="status_changed"&&l.data?.to==="in_review"&&(s=Math.max(s,new Date(l.occurredAt).getTime()));return s}function M(r,s){const l=I(r),a=new Map;for(const o of r){if(o.action!=="review_approved"&&o.action!=="review_changes_requested"||new Date(o.occurredAt).getTime()<l)continue;const i=o.data??{};i.reviewer!=="qa"&&i.reviewer!=="code_review"||(o.action==="review_approved"?a.set(i.reviewer,"approved"):a.set(i.reviewer,"changes_requested"))}return a}function F(r,s,l){if(s.length===0)return!1;const a=M(r);return s.every(o=>a.get(o)==="approved")}const S="task-board.item.updated",v="task-board.item.deleted",P=3e4,V=1e3;function B(r){const{buildUrl:s,eventTypes:l,name:a,crossTab:o=!1}=r,i=new Map,d=o&&typeof BroadcastChannel<"u"&&typeof navigator<"u"&&typeof navigator.locks<"u";if(d&&!a)throw new Error("createSSESubscription: `name` is required when crossTab");function f(e,t){e.bootDone=!0;for(const n of e.handlers)try{n(t)}catch{}}function E(e){for(const t of e.reconnectHandlers)try{t()}catch{}}function T(e){const t=new EventSource(s(e.key));e.es=t,t.onopen=()=>{e.reconnectAttempt=0,e.bootDone&&(E(e),e.channel?.postMessage({kind:"reconnect"})),e.bootDone=!0},t.onerror=()=>{e.es===t&&t.readyState===EventSource.CLOSED&&m(e)};const n=u=>{e.channel?.postMessage({kind:"event",type:u.type,data:u.data}),f(e,u)};for(const u of l)t.addEventListener(u,n)}function m(e){if(e.refCount<=0||e.reconnectTimer)return;const t=R(P,V,e.reconnectAttempt,2,0);e.reconnectAttempt++,e.reconnectTimer=setTimeout(()=>{e.reconnectTimer=null,!(e.refCount<=0||!e.isLeader)&&(e.es?.close(),T(e))},t)}function h(e){if(e.refCount<=0){e.releaseLeadership?.(),e.releaseLeadership=null;return}e.isLeader=!0,T(e)}function L(e){if(!d){h(e);return}e.lockAbort=new AbortController,navigator.locks.request(`sse-leader:${a}:${e.key}`,{signal:e.lockAbort.signal},()=>new Promise(t=>{e.releaseLeadership=t,h(e)})).catch(()=>{})}function D(e,t){t.kind==="event"?f(e,new MessageEvent(t.type,{data:t.data})):t.kind==="reconnect"&&E(e)}function g(e){const t=i.get(e);if(t)return t;const n={key:e,refCount:0,handlers:new Set,reconnectHandlers:new Set,bootDone:!1,es:null,isLeader:!1,reconnectAttempt:0,reconnectTimer:null,channel:null,lockAbort:null,releaseLeadership:null};if(i.set(e,n),d){const u=new BroadcastChannel(`sse:${a}:${e}`);u.onmessage=c=>D(n,c.data),n.channel=u}return n}function y(e){e.reconnectTimer&&(clearTimeout(e.reconnectTimer),e.reconnectTimer=null),e.es?.close(),e.es=null,e.releaseLeadership?.(),e.releaseLeadership=null,e.lockAbort?.abort(),e.lockAbort=null,e.channel?.close(),e.channel=null,i.delete(e.key)}return{subscribe(e,t,n){const u=!i.has(e),c=g(e);c.refCount++,c.handlers.add(t),n&&c.reconnectHandlers.add(n),u&&L(c);let _=!1;return()=>{_||(_=!0,c.handlers.delete(t),n&&c.reconnectHandlers.delete(n),c.refCount--,c.refCount<=0&&y(c))}}}}function A(r,s){const l=new Set(s);return{subscribe(a,o,i){const d=f=>{l.has(f.type)&&o(f)};return r.subscribe(a,d,i)}}}const b=[...w,S,v],H=b,W=b,C=B({name:"watch",buildUrl:r=>`/api/${encodeURIComponent(r)}/watch?types=${H.join(",")}`,eventTypes:W,crossTab:!0}),q=A(C,[...w]),J=A(C,[S,v]),Q=q;export{O as D,K as R,Y as S,v as T,F as a,G as b,k as c,Q as d,j as i,x as n,J as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n,j as i,dD as u,n as c,J as m,dE as x,dF as j,dG as N,dH as D,dI as b,aj as h,dJ as p}from"./index-
|
|
1
|
+
import{c as n,j as i,dD as u,n as c,J as m,dE as x,dF as j,dG as N,dH as D,dI as b,aj as h,dJ as p}from"./index-BAzBxxL9.js";function _(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(u,{"data-slot":"dialog",...t}),e[2]=t,e[3]=s):s=e[3],s}function z(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(b,{"data-slot":"dialog-trigger",...t}),e[2]=t,e[3]=s):s=e[3],s}function v(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(N,{"data-slot":"dialog-portal",...t}),e[2]=t,e[3]=s):s=e[3],s}function k(l){const e=n.c(4);let t;e[0]!==l?({...t}=l,e[0]=l,e[1]=t):t=e[1];let s;return e[2]!==t?(s=i.jsx(p,{"data-slot":"dialog-close",...t}),e[2]=t,e[3]=s):s=e[3],s}function y(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/45 backdrop-blur-[0.15px]",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(D,{"data-slot":"dialog-overlay",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function $(l){const e=n.c(6),{className:t}=l;let s;e[0]!==t?(s=c("cursor-pointer ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground","absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2","focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),e[0]=t,e[1]=s):s=e[1];let a,o;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=i.jsx(h,{}),o=i.jsx("span",{className:"sr-only",children:"Close"}),e[2]=a,e[3]=o):(a=e[2],o=e[3]);let r;return e[4]!==s?(r=i.jsxs(p,{className:s,children:[a,o]}),e[4]=s,e[5]=r):r=e[5],r}function w(l){const e=n.c(15);let t,s,a,o;e[0]!==l?({className:s,children:t,closeButtonClassName:a,...o}=l,e[0]=l,e[1]=t,e[2]=s,e[3]=a,e[4]=o):(t=e[1],s=e[2],a=e[3],o=e[4]);let r;e[5]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(y,{}),e[5]=r):r=e[5];let d;e[6]!==s?(d=c("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border p-6 shadow-md duration-200 sm:max-w-lg",s),e[6]=s,e[7]=d):d=e[7];let f;e[8]!==a?(f=i.jsx($,{className:a}),e[8]=a,e[9]=f):f=e[9];let g;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(g=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(m,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=g):g=e[14],g}function T(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col gap-2 text-center sm:text-left",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-header",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function E(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx("div",{"data-slot":"dialog-footer",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function R(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-lg leading-none font-semibold",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(x,{"data-slot":"dialog-title",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}function B(l){const e=n.c(8);let t,s;e[0]!==l?({className:t,...s}=l,e[0]=l,e[1]=t,e[2]=s):(t=e[1],s=e[2]);let a;e[3]!==t?(a=c("text-muted-foreground text-sm",t),e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==s||e[6]!==a?(o=i.jsx(j,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{z as D,T as a,R as b,E as c,w as d,_ as e,y as f,v as g,B as h,k as i};
|