decocms 2.175.0 → 2.175.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{AlertCircle-5ZbLDi3s.js → AlertCircle-CnfwZdxb.js} +1 -1
- package/dist/client/assets/{AlignLeft-D4ghzTQG.js → AlignLeft-zj1VrWVO.js} +1 -1
- package/dist/client/assets/{ArrowDown-B5WC3D5H.js → ArrowDown-BnnQhLmg.js} +1 -1
- package/dist/client/assets/{ArrowLeft-D0Lalw4x.js → ArrowLeft-C3_bzjZf.js} +1 -1
- package/dist/client/assets/{ArrowUp-tKKJvEkq.js → ArrowUp-BuKX1RSZ.js} +1 -1
- package/dist/client/assets/{Check-CuWDIJeM.js → Check-7kB05ju_.js} +1 -1
- package/dist/client/assets/{CheckCircle-wz1RfkCA.js → CheckCircle-DrGaevdP.js} +1 -1
- package/dist/client/assets/{CheckDone01-UsIketHR.js → CheckDone01-CVJEgdwq.js} +1 -1
- package/dist/client/assets/{CheckVerified02-cu3amtx9.js → CheckVerified02-DmV5dzDn.js} +1 -1
- package/dist/client/assets/{ChevronDown-D0TXudCx.js → ChevronDown-DHeagNGb.js} +1 -1
- package/dist/client/assets/{ChevronLeft-BZsszCLQ.js → ChevronLeft-W2gkpjgL.js} +1 -1
- package/dist/client/assets/{ChevronRight-UJRwW9xN.js → ChevronRight-Blv21S_7.js} +1 -1
- package/dist/client/assets/{ChevronUp-DXMXl76b.js → ChevronUp-J7upZD3-.js} +1 -1
- package/dist/client/assets/{Clock-DKQ7EGj-.js → Clock-9Mm0U0Dg.js} +1 -1
- package/dist/client/assets/{Code01-DZzuHJh9.js → Code01-DDbKsccR.js} +1 -1
- package/dist/client/assets/{Coins01-DWo6Ypxq.js → Coins01-DTz6uYyF.js} +1 -1
- package/dist/client/assets/{Container-YdffBHg3.js → Container-Ci_1Xm4L.js} +1 -1
- package/dist/client/assets/{Copy01-CPHBT83w.js → Copy01-BexEalI-.js} +1 -1
- package/dist/client/assets/{Dataflow03-CUuQJ-m_.js → Dataflow03-CKfLDuKw.js} +1 -1
- package/dist/client/assets/{DotsHorizontal-DUoeCjzn.js → DotsHorizontal-3xIvFzgk.js} +1 -1
- package/dist/client/assets/{DotsVertical-BaBvJOuP.js → DotsVertical-7N_NB6wt.js} +1 -1
- package/dist/client/assets/{Download01-D5-Ilwwi.js → Download01-D-oC1d8d.js} +1 -1
- package/dist/client/assets/{Edit01-Dpq6F4lk.js → Edit01-gYPHsLoC.js} +1 -1
- package/dist/client/assets/{Edit05-h0OeCHXT.js → Edit05-BA2Lz_6R.js} +1 -1
- package/dist/client/assets/{Eye-DDwMVcxZ.js → Eye-Cn6YseXl.js} +1 -1
- package/dist/client/assets/{EyeOff-D8njwIM7.js → EyeOff-L-SLicw9.js} +1 -1
- package/dist/client/assets/{File02-Bc8tH3v5.js → File02-Dx1Iz50W.js} +1 -1
- package/dist/client/assets/{File06-ZV5CfSHG.js → File06-Dqc-K1-5.js} +1 -1
- package/dist/client/assets/{FilterLines-aqS8nu95.js → FilterLines-DCrzLWfV.js} +1 -1
- package/dist/client/assets/{Globe01-BdWDm7Ni.js → Globe01-DW2rHI0i.js} +1 -1
- package/dist/client/assets/{Globe02-Cn3qFriL.js → Globe02-CyGtzZ8k.js} +1 -1
- package/dist/client/assets/{Grid01-Gq7hBl7S.js → Grid01-Dqz--q3o.js} +1 -1
- package/dist/client/assets/{Hash02-CmJ0Y9N4.js → Hash02-pqCZ_ykD.js} +1 -1
- package/dist/client/assets/{Home02-Dz88FEOV.js → Home02-D2W6xjpZ.js} +1 -1
- package/dist/client/assets/{Image01-DBWShOGl.js → Image01-U7ZIAIPc.js} +1 -1
- package/dist/client/assets/{Inbox01-CJphqD3y.js → Inbox01-DpRIO4ZY.js} +1 -1
- package/dist/client/assets/{InfoCircle-uEl5PLW5.js → InfoCircle-CvSmMU6H.js} +1 -1
- package/dist/client/assets/{Key01-IptFTL_3.js → Key01-Dq5b7fdA.js} +1 -1
- package/dist/client/assets/{LayersTwo01-B5fVqAUB.js → LayersTwo01-Li6JqY2K.js} +1 -1
- package/dist/client/assets/{LayoutLeft-B8-msEGR.js → LayoutLeft-BAk65lFq.js} +1 -1
- package/dist/client/assets/{Link01-BpjSsBky.js → Link01-NJWLnzFs.js} +1 -1
- package/dist/client/assets/{LinkExternal01-B21lACin.js → LinkExternal01-B8e_Oa3I.js} +1 -1
- package/dist/client/assets/{List-ySIwqood.js → List-Cc_Ri6eQ.js} +1 -1
- package/dist/client/assets/{Loading01-WTkiPysv.js → Loading01-Cbk1oNZ2.js} +1 -1
- package/dist/client/assets/{Lock01-DqO9uSP7.js → Lock01-dP10fLup.js} +1 -1
- package/dist/client/assets/{Play-D72BHSXn.js → Play-DqxAqUbl.js} +1 -1
- package/dist/client/assets/{Plus-Dto-8y6a.js → Plus-CqWob4tu.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-DckyCUMd.js → RefreshCcw01-B6R5Js1R.js} +1 -1
- package/dist/client/assets/{Save01-C2uk3LpG.js → Save01-BfieBu6m.js} +1 -1
- package/dist/client/assets/{SearchMd-Kap2MdR9.js → SearchMd-DJI6OMcD.js} +1 -1
- package/dist/client/assets/{Settings01-CYUXeHtK.js → Settings01-BWkL3Bf9.js} +1 -1
- package/dist/client/assets/{Shield01-CJ-f24yL.js → Shield01-DMT1motk.js} +1 -1
- package/dist/client/assets/{Terminal-BQ1GlFmm.js → Terminal-zNrinv6B.js} +1 -1
- package/dist/client/assets/Tool01-CUx5BAY-.js +1 -0
- package/dist/client/assets/{Trash01-DkXbOnbi.js → Trash01-C0891dQq.js} +1 -1
- package/dist/client/assets/{Upload01-BasmYIL8.js → Upload01-ngHWsp64.js} +1 -1
- package/dist/client/assets/{Users03-BXwEsNFj.js → Users03-FsZwQwZq.js} +1 -1
- package/dist/client/assets/{X-CNbskBah.js → X-CeRZ6ROs.js} +1 -1
- package/dist/client/assets/XAxis-B4Pxztvn.js +1 -0
- package/dist/client/assets/{XCircle-DvUvQRq1.js → XCircle-X3Ds2fko.js} +1 -1
- package/dist/client/assets/{XClose-B0FgAxIQ.js → XClose-BieEiV6P.js} +1 -1
- package/dist/client/assets/{Zap-BgjTj76q.js → Zap-B-qa654H.js} +1 -1
- package/dist/client/assets/{agent-connections-preview-Bh6ijP_X.js → agent-connections-preview-BXeLz6mJ.js} +1 -1
- package/dist/client/assets/agent-detail-2cFCKx9t.js +2 -0
- package/dist/client/assets/agents-DS-16MLo.js +1 -0
- package/dist/client/assets/ai-providers-logos-Bb5LHAPU.js +1 -0
- package/dist/client/assets/{alert-dialog-DtAWdTyc.js → alert-dialog-DgTufZ_p.js} +3 -3
- package/dist/client/assets/{auth-catchall-5qyXxzaS.js → auth-catchall-zO2o6cw1.js} +1 -1
- package/dist/client/assets/automation-detail-CyiDphKi.js +1 -0
- package/dist/client/assets/automations-CBvKrAy1.js +1 -0
- package/dist/client/assets/{avatar-ChRCLY4k.js → avatar-w6QMWHVj.js} +1 -1
- package/dist/client/assets/{badge-C4uZcq7J.js → badge-B-_hRtCy.js} +1 -1
- package/dist/client/assets/{binder-hd3C3mvD.js → binder-BEJ4wRzw.js} +1 -1
- package/dist/client/assets/{breadcrumb-pLMl4xjy.js → breadcrumb-Dk9kRV2t.js} +1 -1
- package/dist/client/assets/card-BSGld6G2.js +1 -0
- package/dist/client/assets/chart-CEfru1MQ.js +15 -0
- package/dist/client/assets/{checkbox-D2IG7klY.js → checkbox-COsQJsO9.js} +1 -1
- package/dist/client/assets/{collapsible-ttq3VbhQ.js → collapsible-BCGKc4Wz.js} +1 -1
- package/dist/client/assets/{collection-detail-DoRLjPv6.js → collection-detail-BimbOEiL.js} +5 -5
- package/dist/client/assets/collection-display-button-CuyLh-NC.js +1 -0
- package/dist/client/assets/{collection-search-Mtc1qP5K.js → collection-search-aJlY7LHs.js} +1 -1
- package/dist/client/assets/collection-table-wrapper-CcbJTCba.js +1 -0
- package/dist/client/assets/{collection-tabs-CHem1-m4.js → collection-tabs-B2Xeppc1.js} +1 -1
- package/dist/client/assets/{command-DRBqjkmt.js → command-CyHipwcz.js} +1 -1
- package/dist/client/assets/{connect-CRbH1TYm.js → connect-3nC8bK4k.js} +1 -1
- package/dist/client/assets/connection-card-iA_b7WBI.js +1 -0
- package/dist/client/assets/connection-detail-B4CoR-IH.js +1 -0
- package/dist/client/assets/{connection-status-COvhqytZ.js → connection-status-BddpcBJZ.js} +1 -1
- package/dist/client/assets/connections-B-zXLcDP.js +1 -0
- package/dist/client/assets/{constants-B9t4Nuz_.js → constants-CDL9XClm.js} +1 -1
- package/dist/client/assets/constants-DxY-8FrK.js +1 -0
- package/dist/client/assets/{context-CiizXS06.js → context-DDV_uL9a.js} +1 -1
- package/dist/client/assets/{create-organization-dialog-BCMxp6fo.js → create-organization-dialog-CG01zre5.js} +1 -1
- package/dist/client/assets/{create-project-dialog-BvxMRX5X.js → create-project-dialog-5e-piQzY.js} +1 -1
- package/dist/client/assets/{danger-BjSxZinj.js → danger-_ZcnVgTL.js} +1 -1
- package/dist/client/assets/{danger-zone-B2z3wTq9.js → danger-zone-e3foS_su.js} +1 -1
- package/dist/client/assets/{dependencies-BkOdHYmE.js → dependencies-DUviAtSp.js} +1 -1
- package/dist/client/assets/dialog-DxTRqiug.js +1 -0
- package/dist/client/assets/{dropdown-menu-Cp0O2jCN.js → dropdown-menu-CdjuOUR6.js} +1 -1
- package/dist/client/assets/dynamic-plugin-layout-DszdejBu.js +1 -0
- package/dist/client/assets/{editable-task-title-COr46zxY.js → editable-task-title-44X_8A19.js} +1 -1
- package/dist/client/assets/{empty-state-DbRFhzf6.js → empty-state-Bj_isc1T.js} +1 -1
- package/dist/client/assets/{empty-state-SBIKV11G.js → empty-state-v8jdj56V.js} +1 -1
- package/dist/client/assets/env-vars-editor-Bs6jziXp.js +1 -0
- package/dist/client/assets/extract-connection-data-Cyjq-Q5I.js +1 -0
- package/dist/client/assets/{file-browser-B2cQNHIN.js → file-browser-4NMlO2k_.js} +2 -2
- package/dist/client/assets/{form-DPPO-3Tw.js → form-BV3tSlED.js} +1 -1
- package/dist/client/assets/{general-DDQcxBFZ.js → general-LSfgt8-y.js} +1 -1
- package/dist/client/assets/{grid-view-BhmPSvr_.js → grid-view-BD9vYk3H.js} +1 -1
- package/dist/client/assets/home-Ck605SqF.js +1 -0
- package/dist/client/assets/{index-B3fUA0k0.js → index-B70G5L15.js} +1 -1
- package/dist/client/assets/{index-Bmxys2UV.js → index-BE93ZIdg.js} +1 -1
- package/dist/client/assets/{index-DO8fUd54.js → index-BXUNq6d7.js} +4 -4
- package/dist/client/assets/{index-D-NeGwUy.js → index-CZ7yh8sQ.js} +1 -1
- package/dist/client/assets/index-Ci8WAd55.css +1 -0
- package/dist/client/assets/index-Dg_kVhT7.js +1 -0
- package/dist/client/assets/index-DlhaGZnK.js +1 -0
- package/dist/client/assets/{index-COM-PDLy.js → index-L6huQtcJ.js} +1 -1
- package/dist/client/assets/index-rWegviRE.js +1 -0
- package/dist/client/assets/{index-BVSHvvtZ.js → index-uQDoUdMq.js} +1 -1
- package/dist/client/assets/{index-C6XH6ylF.js → index-zJEaoyYS.js} +12 -12
- package/dist/client/assets/{infiniteQueryObserver-x0ce-nmx.js → infiniteQueryObserver-DXFe0xIV.js} +1 -1
- package/dist/client/assets/{input-BM9bdg-F.js → input-BFH8rk50.js} +1 -1
- package/dist/client/assets/integration-icon-D6SJHU0f.js +1 -0
- package/dist/client/assets/{label-CnT8WAQY.js → label-DE7vX487.js} +1 -1
- package/dist/client/assets/{layout-ubFJ5DPd.js → layout-B2GnF_Vp.js} +1 -1
- package/dist/client/assets/layout-B_GGomJW.js +1 -0
- package/dist/client/assets/login-CgzRmuxY.js +1 -0
- package/dist/client/assets/{logo-upload-Bb5Ay7-T.js → logo-upload-Bfzj_LQV.js} +1 -1
- package/dist/client/assets/{markdown-ZobUYaB1.js → markdown-Da-6gcG9.js} +8 -8
- package/dist/client/assets/{mcp-app-renderer-CLfglV2_.js → mcp-app-renderer-CNc9yMN5.js} +2 -2
- package/dist/client/assets/mcp-server-card-s9NGsKpt.js +1 -0
- package/dist/client/assets/mcp-server-detail-fMXGyX4W.js +2 -0
- package/dist/client/assets/members-BvBWfv9e.js +3 -0
- package/dist/client/assets/{monaco-editor-kjafc2y3.js → monaco-editor-VspAvYbk.js} +1 -1
- package/dist/client/assets/monitoring-B1jfqgQN.js +4 -0
- package/dist/client/assets/monitoring-dashboard-edit-Bdujw4Ym.js +1 -0
- package/dist/client/assets/{monitoring-dashboard-view-FD-yc8mV.js → monitoring-dashboard-view-CSfkxnkl.js} +2 -2
- package/dist/client/assets/monitoring-stats-row-Ds_uiyYJ.js +28 -0
- package/dist/client/assets/{oauth-callback-wHI3TkEb.js → oauth-callback-BNPNdlSW.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-DHfWQd6C.js → oauth-callback-ai-provider-CODmoIp9.js} +1 -1
- package/dist/client/assets/org-ai-providers-CQKU4ds_.js +1 -0
- package/dist/client/assets/page-Bbbh0c0Z.js +1 -0
- package/dist/client/assets/page-BfphKBfj.js +1 -0
- package/dist/client/assets/{plugin-empty-state-Bh1khfVy.js → plugin-empty-state-BWhKyfJ8.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-C0KzvXIH.js → plugin-empty-state-Cx_CuKe3.js} +1 -1
- package/dist/client/assets/{plugin-header-DJbwn5SE.js → plugin-header-ET8DV5kQ.js} +1 -1
- package/dist/client/assets/{plugin-header-ydYJ1Vj6.js → plugin-header-ncr8MkbN.js} +1 -1
- package/dist/client/assets/plugins-BdyM0ZUw.js +1 -0
- package/dist/client/assets/{popover-D1WG-emQ.js → popover-BcyJids_.js} +1 -1
- package/dist/client/assets/project-app-view-BdLdOYqG.js +1 -0
- package/dist/client/assets/project-layout-DReK69oR.js +1 -0
- package/dist/client/assets/{project-plugins-BVdloqBu.js → project-plugins-CXWguN_r.js} +1 -1
- package/dist/client/assets/projects-list-CZANuMq5.js +1 -0
- package/dist/client/assets/{registry-layout-B5XpbAHd.js → registry-layout-CqXQ571U.js} +1 -1
- package/dist/client/assets/registry-utils-CaVl1vKg.js +1 -0
- package/dist/client/assets/{reports-layout-Ct8yUpC8.js → reports-layout-CQyNOFqA.js} +1 -1
- package/dist/client/assets/{reset-password-BXrkGw9C.js → reset-password-Bt_v8_59.js} +1 -1
- package/dist/client/assets/{resizable-CqLBllsV.js → resizable-B4X_WbHf.js} +1 -1
- package/dist/client/assets/{save-actions-MbSzUbWU.js → save-actions-Py9YKTe0.js} +1 -1
- package/dist/client/assets/{scroll-area-BcJ1ckdt.js → scroll-area-R7PT492V.js} +1 -1
- package/dist/client/assets/{select-RxUFw6pZ.js → select-B-f7jgVG.js} +1 -1
- package/dist/client/assets/{select-virtual-mcp-DU8qBWLM.js → select-virtual-mcp-YanYQUBn.js} +1 -1
- package/dist/client/assets/sheet-7nFLkS7G.js +1 -0
- package/dist/client/assets/shell-layout-Dp8xiQMR.js +3 -0
- package/dist/client/assets/{sidebar-settings-DICq5I_K.js → sidebar-settings-w0p27D0n.js} +1 -1
- package/dist/client/assets/{skeleton-CU7LuZGk.js → skeleton-CK2-6UkT.js} +1 -1
- package/dist/client/assets/{spinner-CpOteR2a.js → spinner-B1-EIDBS.js} +1 -1
- package/dist/client/assets/{store-invite-D2k0Vn6N.js → store-invite-DVPM6U-x.js} +1 -1
- package/dist/client/assets/{switch-DyxdcdWl.js → switch-4UL4iV3X.js} +1 -1
- package/dist/client/assets/{table-DyNKuHyS.js → table-Bu98B5a-.js} +1 -1
- package/dist/client/assets/{tabs-XMAGaWgq.js → tabs-Cif80TZ4.js} +1 -1
- package/dist/client/assets/{task-status-DJB3YbbO.js → task-status-BWKjAgiX.js} +16 -16
- package/dist/client/assets/{tasks-panel-XTVNkW83.js → tasks-panel-D6Bb-wiS.js} +1 -1
- package/dist/client/assets/tasks-tenjlvFT.js +1 -0
- package/dist/client/assets/{textarea-BLuscN8X.js → textarea-DPLd5P1K.js} +1 -1
- package/dist/client/assets/{time-range-picker-Bd3fku3n.js → time-range-picker-FJd_w9AH.js} +1 -1
- package/dist/client/assets/{toggle-group-BrL6C5fG.js → toggle-group-B4QQy8X1.js} +1 -1
- package/dist/client/assets/tools-list-BgmW-tI4.js +1 -0
- package/dist/client/assets/{tooltip-BLTgyg7W.js → tooltip-BGPUMzDS.js} +1 -1
- package/dist/client/assets/{topbar-portal-_Qqzdv9B.js → topbar-portal-CLOTo-7w.js} +1 -1
- package/dist/client/assets/{types-BPYct9bF.js → types-DZ5M-eMJ.js} +5 -5
- package/dist/client/assets/{use-automations-BeAHZecx.js → use-automations-D7j59hRT.js} +1 -1
- package/dist/client/assets/use-binding-CZ8osTa1.js +1 -0
- package/dist/client/assets/{use-collections-C8rLdQUN.js → use-collections-yY78nnLx.js} +1 -1
- package/dist/client/assets/{use-connection-BNGXvSqD.js → use-connection-lXrlfojY.js} +1 -1
- package/dist/client/assets/{use-copy-DPJ8nWWs.js → use-copy-DZJI58oZ.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-BfS4KaKE.js → use-create-virtual-mcp-DK_WDS9Y.js} +1 -1
- package/dist/client/assets/use-infinite-scroll-C-TK62Eo.js +1 -0
- package/dist/client/assets/{use-install-from-registry-BEC7S-53.js → use-install-from-registry-C24f0cqa.js} +1 -1
- package/dist/client/assets/{use-list-state-DsQajLIu.js → use-list-state-D6LU1koz.js} +1 -1
- package/dist/client/assets/{use-mcp-prompts-D_02f3uO.js → use-mcp-prompts-DT9l3i02.js} +1 -1
- package/dist/client/assets/{use-mcp-resources-BNoK6dDS.js → use-mcp-resources-DhBJVSsg.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-BCCglZve.js → use-mcp-tools-CwVNqTmj.js} +1 -1
- package/dist/client/assets/{use-members-Cqa4gqXV.js → use-members-fpZqw1dy.js} +1 -1
- package/dist/client/assets/{use-mobile-kAkblq0-.js → use-mobile-B0lEbMk3.js} +1 -1
- package/dist/client/assets/{use-project-DNZXkIib.js → use-project-BnRSDoVD.js} +1 -1
- package/dist/client/assets/use-store-discovery-C9fJhQ4Y.js +1 -0
- package/dist/client/assets/{use-view-mode-Bl6DaWwW.js → use-view-mode-0w9n1sJ-.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-DoDJBE5n.js → use-virtual-mcp-CyoGC0aH.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BlrmUHYA.js +1 -0
- package/dist/client/assets/{useMutation-CNVq636e.js → useMutation-CkdHuTyE.js} +1 -1
- package/dist/client/assets/useQuery-Bmc4jnG2.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-DD4jjrsx.js +1 -0
- package/dist/client/assets/{user-6WV0RuBu.js → user-sbKkVV9F.js} +1 -1
- package/dist/client/assets/workflow-CpP3zoVI.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/node_modules/{postgres-bytea/license → pg/LICENSE} +6 -6
- package/dist/server/node_modules/pg/README.md +95 -0
- package/dist/server/node_modules/pg/esm/index.mjs +20 -0
- package/dist/server/node_modules/pg/lib/client.js +743 -0
- package/dist/server/node_modules/pg/lib/connection-parameters.js +171 -0
- package/dist/server/node_modules/pg/lib/connection.js +221 -0
- package/dist/server/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
- package/dist/server/node_modules/pg/lib/crypto/sasl.js +212 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-legacy.js +43 -0
- package/dist/server/node_modules/pg/lib/crypto/utils-webcrypto.js +89 -0
- package/dist/server/node_modules/pg/lib/crypto/utils.js +9 -0
- package/dist/server/node_modules/pg/lib/defaults.js +91 -0
- package/dist/server/node_modules/pg/lib/index.js +73 -0
- package/dist/server/node_modules/pg/lib/native/client.js +323 -0
- package/dist/server/node_modules/pg/lib/native/index.js +2 -0
- package/dist/server/node_modules/pg/lib/native/query.js +165 -0
- package/dist/server/node_modules/pg/lib/query.js +252 -0
- package/dist/server/node_modules/pg/lib/result.js +109 -0
- package/dist/server/node_modules/pg/lib/stream.js +83 -0
- package/dist/server/node_modules/pg/lib/type-overrides.js +35 -0
- package/dist/server/node_modules/pg/lib/utils.js +217 -0
- package/dist/server/node_modules/pg/package.json +76 -0
- package/package.json +1 -1
- package/dist/client/assets/agent-detail-Cda1RjKX.js +0 -2
- package/dist/client/assets/agents-DNXSTqTl.js +0 -1
- package/dist/client/assets/ai-providers-logos-W57Qm-EN.js +0 -1
- package/dist/client/assets/automation-detail-BV87rs7m.js +0 -1
- package/dist/client/assets/automations-Dp0qrLbX.js +0 -1
- package/dist/client/assets/card-B4dTtsmd.js +0 -1
- package/dist/client/assets/chart-Caf0jSbB.js +0 -15
- package/dist/client/assets/collection-display-button-C0A6ba73.js +0 -1
- package/dist/client/assets/collection-tab-CTog7m1d.js +0 -1
- package/dist/client/assets/collection-table-wrapper-Ccujw2gS.js +0 -1
- package/dist/client/assets/connection-card-DXMFAvSL.js +0 -1
- package/dist/client/assets/connection-detail-D-M6vj9q.js +0 -1
- package/dist/client/assets/connections-BZmayWR_.js +0 -1
- package/dist/client/assets/constants-Dr5R1EQY.js +0 -1
- package/dist/client/assets/dialog-CTFHRhvl.js +0 -1
- package/dist/client/assets/dynamic-plugin-layout-CcrlbNZV.js +0 -1
- package/dist/client/assets/env-vars-editor-1feSU4JA.js +0 -1
- package/dist/client/assets/extract-connection-data-adtLKfGW.js +0 -1
- package/dist/client/assets/github-icon-Dp3wHhYE.js +0 -1
- package/dist/client/assets/home-Dxpbp1Bj.js +0 -1
- package/dist/client/assets/icon-picker-BKKuKn6y.js +0 -1
- package/dist/client/assets/index-B1uuY7UL.js +0 -1
- package/dist/client/assets/index-B_m3AdpY.js +0 -1
- package/dist/client/assets/index-BqlWbrG0.js +0 -1
- package/dist/client/assets/index-DmrxmdhV.css +0 -1
- package/dist/client/assets/integration-icon-BrOdBipR.js +0 -1
- package/dist/client/assets/layout-C4PDA52F.js +0 -1
- package/dist/client/assets/login-CTOJXY_r.js +0 -1
- package/dist/client/assets/mcp-server-card-AL30DdJr.js +0 -1
- package/dist/client/assets/mcp-server-detail-CN2kEGgD.js +0 -2
- package/dist/client/assets/members-CpLusvJM.js +0 -3
- package/dist/client/assets/monitoring-BNAsqD0Y.js +0 -31
- package/dist/client/assets/monitoring-dashboard-edit-CtIPN7nQ.js +0 -1
- package/dist/client/assets/org-ai-providers-Cu3Y8hG7.js +0 -1
- package/dist/client/assets/page-BWMoYp-g.js +0 -1
- package/dist/client/assets/page-Ch5Qzmi-.js +0 -1
- package/dist/client/assets/plugins-D5THwapv.js +0 -1
- package/dist/client/assets/project-app-view-D-VHvgqy.js +0 -1
- package/dist/client/assets/project-layout-Cd8cNifU.js +0 -1
- package/dist/client/assets/projects-list-Z8HiWxIk.js +0 -1
- package/dist/client/assets/readme-viewer-MbTGGbgZ.js +0 -1
- package/dist/client/assets/registry-utils-oSXyNc33.js +0 -1
- package/dist/client/assets/shell-layout-0dnPJSNe.js +0 -3
- package/dist/client/assets/tasks-BJvBlQqj.js +0 -1
- package/dist/client/assets/tools-list-BeUwtNiH.js +0 -1
- package/dist/client/assets/use-binding-DSWv53zN.js +0 -1
- package/dist/client/assets/use-llm-IG8InXvX.js +0 -1
- package/dist/client/assets/use-local-storage-C3Bo802w.js +0 -1
- package/dist/client/assets/useInfiniteQuery-BBGNgnIc.js +0 -1
- package/dist/client/assets/useQuery-BeFLqBun.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-CdVyznmA.js +0 -1
- package/dist/client/assets/workflow-DUYpxPLh.js +0 -1
- package/dist/server/node_modules/pg-int8/LICENSE +0 -13
- package/dist/server/node_modules/pg-int8/README.md +0 -16
- package/dist/server/node_modules/pg-int8/index.js +0 -100
- package/dist/server/node_modules/pg-int8/package.json +0 -24
- package/dist/server/node_modules/postgres-array/index.d.ts +0 -4
- package/dist/server/node_modules/postgres-array/index.js +0 -97
- package/dist/server/node_modules/postgres-array/license +0 -21
- package/dist/server/node_modules/postgres-array/package.json +0 -35
- package/dist/server/node_modules/postgres-array/readme.md +0 -43
- package/dist/server/node_modules/postgres-bytea/index.js +0 -33
- package/dist/server/node_modules/postgres-bytea/package.json +0 -34
- package/dist/server/node_modules/postgres-bytea/readme.md +0 -34
- package/dist/server/node_modules/postgres-interval/index.d.ts +0 -20
- package/dist/server/node_modules/postgres-interval/index.js +0 -125
- package/dist/server/node_modules/postgres-interval/license +0 -21
- package/dist/server/node_modules/postgres-interval/package.json +0 -36
- package/dist/server/node_modules/postgres-interval/readme.md +0 -48
- /package/dist/client/assets/{readme-viewer-DWnTz46N.css → mcp-server-detail-DWnTz46N.css} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as O,c as U,z as j,j as s,B as se}from"./index-DO8fUd54.js";import{c as X,a as oe,b as ie,D as le}from"./dropdown-menu-Cp0O2jCN.js";import{n as ne}from"./ArrowDown-B5WC3D5H.js";import{i as re}from"./ArrowUp-tKKJvEkq.js";import{i as Y}from"./Check-CuWDIJeM.js";import{c as ae}from"./Grid01-Gq7hBl7S.js";import{i as ce}from"./List-ySIwqood.js";import{a as de,T as ue,b as fe,c as me}from"./tooltip-BLTgyg7W.js";import{B as xe}from"./badge-C4uZcq7J.js";const Z=({size:l=24,color:e="currentColor",...o})=>O.createElement("svg",{viewBox:"0 0 24 24",width:l,height:l,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...o},O.createElement("path",{d:"M5 21v-7m0-4V3m7 18v-9m0-4V3m7 18v-5m0-4V3M2 14h6m1-6h6m1 8h6"}));Z.displayName="Sliders01";const pe={sm:{button:"size-7",icon:"size-4"},md:{button:"size-9",icon:"size-5"},lg:{button:"size-12",icon:"size-6"}};function he(l){const e=U.c(66),{value:o,onValueChange:x,options:t,size:k,fullWidth:C,className:w}=l,M=k===void 0?"sm":k,p=C===void 0?!1:C,_=O.useRef(null),S=O.useRef(null);let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={left:0,width:0,opacity:0},e[0]=r):r=e[0];const[h,D]=O.useState(r);let N;e[1]===Symbol.for("react.memo_cache_sentinel")?(N=F=>{if(!F.current)return;const{offsetLeft:ee,offsetWidth:te}=F.current;D({left:ee,width:te,opacity:1})},e[1]=N):N=e[1];const z=N;let a;e[2]!==t[0].value||e[3]!==o?(a=()=>{const F=o===t[0].value?_:S;z(F)},e[2]=t[0].value,e[3]=o,e[4]=a):a=e[4];let y;e[5]!==t||e[6]!==o?(y=[o,t],e[5]=t,e[6]=o,e[7]=y):y=e[7],O.useEffect(a,y);const i=pe[M];let c;e[8]!==w?(c=j("relative flex gap-0 bg-muted rounded-lg",w),e[8]=w,e[9]=c):c=e[9];let d;e[10]!==x||e[11]!==t[0].value?(d=()=>x(t[0].value),e[10]=x,e[11]=t[0].value,e[12]=d):d=e[12];const b=p?"flex-1 h-12 px-4":i.button,g=!p&&t[0].label?"px-3":"";let n;e[13]!==g||e[14]!==b?(n=j("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",b,g),e[13]=g,e[14]=b,e[15]=n):n=e[15];const v=o===t[0].value?"text-foreground":"text-muted-foreground";let u;e[16]!==i.icon||e[17]!==v?(u=j("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",i.icon,v),e[16]=i.icon,e[17]=v,e[18]=u):u=e[18];let f;e[19]!==t[0].icon||e[20]!==u?(f=s.jsx("span",{className:u,children:t[0].icon}),e[19]=t[0].icon,e[20]=u,e[21]=f):f=e[21];let m;e[22]!==t[0].label||e[23]!==t[0].value||e[24]!==o?(m=t[0].label&&s.jsx("span",{className:j("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[0].value?"text-foreground":"text-muted-foreground"),children:t[0].label}),e[22]=t[0].label,e[23]=t[0].value,e[24]=o,e[25]=m):m=e[25];let T;e[26]!==n||e[27]!==f||e[28]!==m||e[29]!==d?(T=s.jsxs("button",{ref:_,type:"button",onClick:d,className:n,children:[f,m]}),e[26]=n,e[27]=f,e[28]=m,e[29]=d,e[30]=T):T=e[30];let V;e[31]!==x||e[32]!==t[1].value?(V=()=>x(t[1].value),e[31]=x,e[32]=t[1].value,e[33]=V):V=e[33];const K=p?"flex-1 h-12 px-4":i.button,q=!p&&t[1].label?"px-3":"";let $;e[34]!==K||e[35]!==q?($=j("relative z-10 flex items-center justify-center gap-2 rounded-lg transition-colors [transition-timing-function:var(--ease-out-cubic)] duration-200",K,q),e[34]=K,e[35]=q,e[36]=$):$=e[36];const G=o===t[1].value?"text-foreground":"text-muted-foreground";let B;e[37]!==i.icon||e[38]!==G?(B=j("transition-colors ease-out duration-200 flex items-center justify-center [&>svg]:size-[1em]",i.icon,G),e[37]=i.icon,e[38]=G,e[39]=B):B=e[39];let E;e[40]!==t[1].icon||e[41]!==B?(E=s.jsx("span",{className:B,children:t[1].icon}),e[40]=t[1].icon,e[41]=B,e[42]=E):E=e[42];let R;e[43]!==t[1].label||e[44]!==t[1].value||e[45]!==o?(R=t[1].label&&s.jsx("span",{className:j("text-xs transition-colors ease-out duration-200 whitespace-nowrap",o===t[1].value?"text-foreground":"text-muted-foreground"),children:t[1].label}),e[43]=t[1].label,e[44]=t[1].value,e[45]=o,e[46]=R):R=e[46];let L;e[47]!==V||e[48]!==$||e[49]!==E||e[50]!==R?(L=s.jsxs("button",{ref:S,type:"button",onClick:V,className:$,children:[E,R]}),e[47]=V,e[48]=$,e[49]=E,e[50]=R,e[51]=L):L=e[51];const H=p?"h-12":i.button;let W;e[52]!==H?(W=j("absolute z-0 bg-background rounded-lg border-shadow transition-all [transition-timing-function:var(--ease-out-cubic)] duration-200",H),e[52]=H,e[53]=W):W=e[53];const J=`${h.left}px`,Q=`${h.width}px`;let I;e[54]!==h.opacity||e[55]!==J||e[56]!==Q?(I={left:J,width:Q,opacity:h.opacity},e[54]=h.opacity,e[55]=J,e[56]=Q,e[57]=I):I=e[57];let P;e[58]!==W||e[59]!==I?(P=s.jsx("div",{className:W,style:I}),e[58]=W,e[59]=I,e[60]=P):P=e[60];let A;return e[61]!==T||e[62]!==L||e[63]!==P||e[64]!==c?(A=s.jsxs("div",{className:c,children:[T,L,P]}),e[61]=T,e[62]=L,e[63]=P,e[64]=c,e[65]=A):A=e[65],A}function Se(l){const e=U.c(33),{viewMode:o,onViewModeChange:x,sortKey:t,sortDirection:k,onSort:C,sortOptions:w,filters:M}=l;let p;e[0]!==w?(p=w===void 0?[]:w,e[0]=w,e[1]=p):p=e[1];const _=p;let S;e[2]!==M?(S=M===void 0?[]:M,e[2]=M,e[3]=S):S=e[3];const r=S;let h;e[4]!==r?(h=r.filter(ge),e[4]=r,e[5]=h):h=e[5];const D=h.length;let N;e[6]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(Z,{size:16}),e[6]=N):N=e[6];let z;e[7]!==D?(z=D>0&&s.jsx(xe,{variant:"default",className:"absolute -top-1.5 -right-1.5 h-4 min-w-4 px-1 text-[10px] leading-none",children:D}),e[7]=D,e[8]=z):z=e[8];let a;e[9]!==z?(a=s.jsx(de,{asChild:!0,children:s.jsx(oe,{asChild:!0,children:s.jsxs(se,{variant:"outline",size:"icon",className:"size-7 border border-input relative",children:[N,z]})})}),e[9]=z,e[10]=a):a=e[10];let y;e[11]===Symbol.for("react.memo_cache_sentinel")?(y=s.jsx(ue,{children:"Display & filters"}),e[11]=y):y=e[11];let i;e[12]!==a?(i=s.jsx(fe,{children:s.jsxs(me,{children:[a,y]})}),e[12]=a,e[13]=i):i=e[13];let c;e[14]===Symbol.for("react.memo_cache_sentinel")?(c={value:"table",icon:s.jsx(ce,{})},e[14]=c):c=e[14];let d;e[15]===Symbol.for("react.memo_cache_sentinel")?(d=[c,{value:"cards",icon:s.jsx(ae,{})}],e[15]=d):d=e[15];let b;e[16]!==x||e[17]!==o?(b=s.jsx("div",{className:"p-2 border-b border-border",children:s.jsx(he,{value:o,onValueChange:x,fullWidth:!0,options:d})}),e[16]=x,e[17]=o,e[18]=b):b=e[18];let g;e[19]!==C||e[20]!==k||e[21]!==t||e[22]!==_?(g=_.length>0&&C&&s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:"Sort by"}),_.map(f=>{const m=t===f.id;return s.jsx(X,{onClick:()=>C(f.id),className:j("h-8 px-2 py-0 cursor-pointer",m&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[m&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!m&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:f.label}),m&&k&&(k==="asc"?s.jsx(re,{size:16,className:"text-foreground shrink-0"}):s.jsx(ne,{size:16,className:"text-foreground shrink-0"}))]})},f.id)})]}),e[19]=C,e[20]=k,e[21]=t,e[22]=_,e[23]=g):g=e[23];let n;e[24]!==r?(n=r.map(be),e[24]=r,e[25]=n):n=e[25];let v;e[26]!==b||e[27]!==g||e[28]!==n?(v=s.jsxs(ie,{align:"end",className:"w-[200px] p-0 gap-0",children:[b,g,n]}),e[26]=b,e[27]=g,e[28]=n,e[29]=v):v=e[29];let u;return e[30]!==i||e[31]!==v?(u=s.jsxs(le,{children:[i,v]}),e[30]=i,e[31]=v,e[32]=u):u=e[32],u}function be(l){return s.jsxs("div",{className:"p-1 flex flex-col gap-0.5 border-b border-border last:border-b-0",children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-mono font-normal text-muted-foreground uppercase tracking-wide",children:l.label}),l.options.map(e=>{const o=l.value===e.id;return s.jsx(X,{onClick:()=>l.onChange(e.id),className:j("h-8 px-2 py-0 cursor-pointer",o&&"bg-accent"),children:s.jsxs("div",{className:"flex items-center gap-2 w-full",children:[o&&s.jsx(Y,{size:16,className:"text-foreground shrink-0"}),!o&&s.jsx("div",{className:"w-4 shrink-0"}),s.jsx("span",{className:"text-sm text-foreground flex-1",children:e.label})]})},e.id)})]},l.label)}function ge(l){return l.value!=="ALL"}export{Se as C,he as V};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as Ae,j as t,B as Ie,e as Ye,f as Ze,u as et,r as tt,O as $e,w as st}from"./index-DO8fUd54.js";import{g as Oe}from"./generate-id-Dyweu44Y.js";import{C as Fe}from"./collection-display-button-C0A6ba73.js";import{C as ot}from"./collection-search-Mtc1qP5K.js";import{C as it}from"./card-B4dTtsmd.js";import{I as ke}from"./integration-icon-BrOdBipR.js";import{D as Ke,a as Ue,b as Le,c as k}from"./dropdown-menu-Cp0O2jCN.js";import{a as Be}from"./Copy01-CPHBT83w.js";import{i as Re}from"./DotsVertical-BaBvJOuP.js";import{i as Ve}from"./Edit01-Dpq6F4lk.js";import{s as Ge}from"./Eye-DDwMVcxZ.js";import{s as Je}from"./Trash01-DkXbOnbi.js";import{C as nt}from"./collection-table-wrapper-Ccujw2gS.js";import{E as ze}from"./empty-state-DbRFhzf6.js";import{n as Ee}from"./Inbox01-CJphqD3y.js";import{U as rt}from"./user-6WV0RuBu.js";import{E as lt}from"./empty-state-SBIKV11G.js";import{u as at}from"./use-list-state-DsQajLIu.js";import{B as ct}from"./constants-Dr5R1EQY.js";import{A as dt,h as pt,c as mt,b as ft,d as ut,e as ht,a as xt,f as gt}from"./alert-dialog-DtAWdTyc.js";import{u as jt,e as Ct}from"./use-collections-C8rLdQUN.js";import{u as vt}from"./constants-B9t4Nuz_.js";import{s as bt}from"./Plus-Dto-8y6a.js";import{V as yt}from"./layout-ubFJ5DPd.js";function Nt(n,e){const s=n.properties||{};for(const i in s){const l=s[i];if(l&&l.type==="string"&&(l.format==="url"||l.format==="uri")&&e&&typeof e=="object"&&i in e&&e[i])return e[i]}const r=["image","img","avatar","icon","logo","thumbnail","cover"];for(const i of r)if(e&&typeof e=="object"&&i in e&&typeof e[i]=="string")return e[i]}function wt(n){const e=Ae.c(25),{item:s,schema:r,actions:i}=n;let l;e[0]!==s||e[1]!==r?(l=Nt(r,s),e[0]=s,e[1]=r,e[2]=l):l=e[2];const f=l,p=s&&typeof s=="object"&&"description"in s&&typeof s.description=="string"?s.description:void 0;let j;e[3]!==i?(j=i&&Object.keys(i).length>0,e[3]=i,e[4]=j):j=e[4];const o=j;let m;e[5]!==f||e[6]!==s.title?(m=t.jsx(ke,{icon:f,name:s.title,size:"md",className:"shrink-0 shadow-sm"}),e[5]=f,e[6]=s.title,e[7]=m):m=e[7];let u;e[8]!==s.title?(u=t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:s.title}),e[8]=s.title,e[9]=u):u=e[9];const d=p||"No description";let c;e[10]!==d?(c=t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:d}),e[10]=d,e[11]=c):c=e[11];let C;e[12]!==u||e[13]!==c?(C=t.jsxs("div",{className:"flex flex-col gap-0 flex-1",children:[u,c]}),e[12]=u,e[13]=c,e[14]=C):C=e[14];let y;e[15]!==m||e[16]!==C?(y=t.jsxs("div",{className:"flex flex-col gap-4 p-6 flex-1",children:[m,C]}),e[15]=m,e[16]=C,e[17]=y):y=e[17];let a;e[18]!==i||e[19]!==o||e[20]!==s?(a=o&&t.jsx("div",{className:"absolute top-6 right-6 opacity-0 group-hover:opacity-100 transition-opacity",onClick:At,onMouseDown:_t,children:t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:Dt,children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:St,children:[i.open&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.open?.(s)},children:[t.jsx(Ge,{size:16}),"Open"]}),i.edit&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.edit?.(s)},children:[t.jsx(Ve,{size:16}),"Edit"]}),i.duplicate&&t.jsxs(k,{onClick:h=>{h.stopPropagation(),i.duplicate?.(s)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),i.delete&&t.jsxs(k,{variant:"destructive",onClick:h=>{h.stopPropagation(),i.delete?.(s)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]})}),e[18]=i,e[19]=o,e[20]=s,e[21]=a):a=e[21];let S;return e[22]!==y||e[23]!==a?(S=t.jsxs(it,{className:"cursor-pointer transition-colors h-full flex flex-col group relative",children:[y,a]}),e[22]=y,e[23]=a,e[24]=S):S=e[24],S}function St(n){return n.stopPropagation()}function Dt(n){return n.stopPropagation()}function _t(n){return n.stopPropagation()}function At(n){return n.stopPropagation()}const It=["icon","avatar","logo"],Me=["created_at","created_by","id"];function Pt(n){return Object.keys(n).find(e=>It.includes(e.toLowerCase()))}function We(n,e){return Object.keys(n.properties||{}).filter(s=>["id","created_at","updated_at","created_by","updated_by"].includes(s)?!1:e?e.includes(s):!0).map(s=>({id:s,label:s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," ")}))}function Tt(n){const e=Ae.c(32),{data:s,schema:r,viewMode:i,onViewModeChange:l,search:f,sortKey:p,sortDirection:j,onSort:o,actions:m,onItemClick:u,headerActions:d,emptyState:c,readOnly:C,columns:y,hideToolbar:a,sortableFields:S}=n,h=l===void 0?Mt:l,x=j===void 0?"asc":j,P=o===void 0?Et:o;let v;e[0]!==m?(v=m===void 0?{}:m,e[0]=m,e[1]=v):v=e[1];const D=v,_=u===void 0?zt:u,z=d===void 0?null:d,b=c===void 0?null:c,T=C===void 0?!1:C,N=y===void 0?void 0:y,F=a===void 0?!1:a,w=S===void 0?void 0:S;let E;e[2]!==N||e[3]!==r||e[4]!==w?(E=N?N.filter(Ot).filter(M=>!w||w.includes(M.id)).map($t):We(r,w),e[2]=N,e[3]=r,e[4]=w,e[5]=E):E=e[5];const $=E;let A;e[6]!==z||e[7]!==F||e[8]!==P||e[9]!==h||e[10]!==x||e[11]!==p||e[12]!==$||e[13]!==i?(A=!F&&t.jsx("div",{className:"shrink-0 w-full border-b border-border h-12",children:t.jsxs("div",{className:"flex items-center gap-3 h-12 px-4",children:[t.jsx("div",{className:"flex items-center gap-2 flex-1",children:z}),t.jsx("div",{className:"flex items-center gap-2 shrink-0",children:t.jsx(Fe,{viewMode:i,onViewModeChange:h,sortKey:p,sortDirection:x,onSort:P,sortOptions:$})})]})}),e[6]=z,e[7]=F,e[8]=P,e[9]=h,e[10]=x,e[11]=p,e[12]=$,e[13]=i,e[14]=A):A=e[14];let O;e[15]!==D||e[16]!==N||e[17]!==s||e[18]!==b||e[19]!==_||e[20]!==P||e[21]!==T||e[22]!==r||e[23]!==f||e[24]!==x||e[25]!==p||e[26]!==w||e[27]!==i?(O=i==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:s.length===0?t.jsx("div",{className:"flex items-center justify-center h-full",children:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:f?"Try adjusting your search":"No items to display"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:s.map(M=>t.jsx("div",{onClick:()=>_?.(M),className:"cursor-pointer h-full",children:t.jsx(wt,{item:M,schema:r,readOnly:T,actions:D})},M.id))})}):t.jsx(nt,{columns:Kt(N,r,w,D),data:s,sortKey:p,sortDirection:x,onSort:P,onRowClick:_,emptyState:b||t.jsx(ze,{icon:t.jsx(Ee,{size:36,className:"text-muted-foreground"}),title:"No items found",description:f?"Try adjusting your search":"No items to display"})}),e[15]=D,e[16]=N,e[17]=s,e[18]=b,e[19]=_,e[20]=P,e[21]=T,e[22]=r,e[23]=f,e[24]=x,e[25]=p,e[26]=w,e[27]=i,e[28]=O):O=e[28];let I;return e[29]!==A||e[30]!==O?(I=t.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[A,O]}),e[29]=A,e[30]=O,e[31]=I):I=e[31],I}function $t(n){return{id:n.id,label:typeof n.header=="string"?n.header:n.id}}function Ot(n){return n.sortable!==!1}function zt(){}function Et(){}function Mt(){}function Ft(n){return{id:"actions",header:"",render:e=>t.jsxs(Ke,{children:[t.jsx(Ue,{asChild:!0,children:t.jsx(Ie,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:s=>s.stopPropagation(),children:t.jsx(Re,{size:20})})}),t.jsxs(Le,{align:"end",onClick:s=>s.stopPropagation(),children:[n.open&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.open?.(e)},children:[t.jsx(Ge,{size:16}),"Open"]}),n.edit&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.edit?.(e)},children:[t.jsx(Ve,{size:16}),"Edit"]}),n.duplicate&&t.jsxs(k,{onClick:s=>{s.stopPropagation(),n.duplicate?.(e)},children:[t.jsx(Be,{size:16}),"Duplicate"]}),n.delete&&t.jsxs(k,{variant:"destructive",onClick:s=>{s.stopPropagation(),n.delete?.(e)},children:[t.jsx(Je,{size:16}),"Delete"]})]})]}),cellClassName:"w-[60px]",sortable:!1}}function He(n){const e=n.type;return Array.isArray(e)?e.every(s=>He({type:s})):e==="string"||e==="number"||e==="integer"||e==="boolean"||e==="null"}function kt(n,e){const s=n.properties||{},r=Object.keys(s).filter(o=>{const m=s[o];return m&&He(m)}),i=Pt(s),l=[],f=new Set;i&&r.includes(i)&&(l.push(i),f.add(i));const p=["title","description","updated_at","updated_by"];for(const o of p)r.includes(o)&&!f.has(o)&&(l.push(o),f.add(o));const j=r.filter(o=>!f.has(o)&&!Me.includes(o)).sort((o,m)=>o.localeCompare(m));for(const o of j)l.push(o),f.add(o);for(const o of Me)r.includes(o)&&!f.has(o)&&(l.push(o),f.add(o));return l.map(o=>{const m=s[o],u=e?e.includes(o):!["id"].includes(o);return o===i?{id:o,header:"",render:d=>{const c=d[o];return t.jsx(ke,{icon:c,name:d.title,size:"sm",className:"shrink-0 shadow-sm"})},sortable:!1,cellClassName:"w-16 shrink-0",wrap:!0}:o==="description"?{id:o,header:"Description",render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-[50ch]",children:String(c)})},sortable:u,cellClassName:"max-w-[50ch]"}:o==="created_by"||o==="updated_by"?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx(rt,{id:String(c),size:"xs"}):"—"},sortable:u,cellClassName:"max-w-[250px]"}:m?.format==="date-time"||o.endsWith("_at")?{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c?t.jsx("span",{className:"block truncate max-w-full",children:new Date(c).toLocaleDateString()}):"—"},sortable:u,cellClassName:"max-w-[200px]"}:{id:o,header:o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),render:d=>{const c=d[o];return c==null?"—":t.jsx("span",{className:"block truncate max-w-full",children:String(c)})},sortable:u,cellClassName:"max-w-[200px]"}})}function Kt(n,e,s,r){const i=n||kt(e,s);return i.some(p=>p.id==="actions")?i:Object.keys(r).length>0?[...i,Ft(r)]:i}function ps(n){const e=Ae.c(113),{connectionId:s,org:r,activeCollection:i}=n,l=i.name,f=i.schema??ct,p=i.hasCreateTool,j=i.hasUpdateTool,o=i.hasDeleteTool,m=Ye(),{data:u}=Ze.useSession(),d=u?.user?.id||"unknown",{org:c}=et();let C;e[0]!==s||e[1]!==c.id?(C={connectionId:s,orgId:c.id},e[0]=s,e[1]=c.id,e[2]=C):C=e[2];const y=vt(C),a=jt(s,l,y),S=`${s}-${l}`;let h;e[3]!==r||e[4]!==S?(h={namespace:r,resource:S,defaultSortKey:"updated_at"},e[3]=r,e[4]=S,e[5]=h):h=e[5];const{search:x,searchTerm:P,setSearch:v,viewMode:D,setViewMode:_,sortKey:z,sortDirection:b,handleSort:T}=at(h);let N;e[6]!==P||e[7]!==b||e[8]!==z?(N={searchTerm:P,sortKey:z,sortDirection:b},e[6]=P,e[7]=b,e[8]=z,e[9]=N):N=e[9];const F=Ct(s,l,y,N),w=!p&&!j&&!o;let E;e[10]!==l||e[11]!==s||e[12]!==m||e[13]!==r?(E=g=>{m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:g.id}})},e[10]=l,e[11]=s,e[12]=m,e[13]=r,e[14]=E):E=e[14];const $=E;let A;e[15]!==a.create||e[16]!==d?(A=async g=>{const me=new Date().toISOString();await a.create.mutateAsync({...g,id:Oe("conn"),title:`${g.title} (Copy)`,created_at:me,updated_at:me,created_by:d,updated_by:d})},e[15]=a.create,e[16]=d,e[17]=A):A=e[17];const O=A,[I,M]=tt.useState(null);let oe;e[18]===Symbol.for("react.memo_cache_sentinel")?(oe=g=>{M(g)},e[18]=oe):oe=e[18];const qe=oe;let K;e[19]!==$||e[20]!==j?(K=j&&{edit:$},e[19]=$,e[20]=j,e[21]=K):K=e[21];let U;e[22]!==O||e[23]!==p?(U=p&&{duplicate:O},e[22]=O,e[23]=p,e[24]=U):U=e[24];let L;e[25]!==o?(L=o&&{delete:qe},e[25]=o,e[26]=L):L=e[26];let ie;e[27]!==L||e[28]!==K||e[29]!==U?(ie={...K,...U,...L},e[27]=L,e[28]=K,e[29]=U,e[30]=ie):ie=e[30];const fe=ie;let ne;e[31]!==a.delete||e[32]!==I?(ne=async()=>{I&&(await a.delete.mutateAsync(I.id),M(null))},e[31]=a.delete,e[32]=I,e[33]=ne):ne=e[33];const ue=ne;let re;e[34]!==a.create||e[35]!==l||e[36]!==s||e[37]!==p||e[38]!==m||e[39]!==r||e[40]!==d?(re=async()=>{if(!p){st.error("Create operation is not available for this collection");return}const g=new Date().toISOString(),me={id:Oe("conn"),title:"New Item",description:"A brief description of the item",created_at:g,updated_at:g,created_by:d,updated_by:d};try{const _e=await a.create.mutateAsync(me);m({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:r,project:$e,connectionId:s,collectionName:l,itemId:_e.id}})}catch(_e){console.error("Failed to create item:",_e)}},e[34]=a.create,e[35]=l,e[36]=s,e[37]=p,e[38]=m,e[39]=r,e[40]=d,e[41]=re):re=e[41];const he=re;let le;e[42]!==f?(le=We(f),e[42]=f,e[43]=le):le=e[43];const xe=le,Pe=(F?.length??0)>0,Qe=p&&Pe,Xe=p&&!Pe&&!x;let ae;e[44]!==a.create||e[45]!==he||e[46]!==p?(ae=p?t.jsxs(Ie,{onClick:he,size:"sm",disabled:a.create.isPending,className:"h-7",children:[t.jsx(bt,{className:"mr-2 h-4 w-4"}),a.create.isPending?"Creating...":"Create"]}):null,e[44]=a.create,e[45]=he,e[46]=p,e[47]=ae):ae=e[47];const Te=ae,ge=z;let B;e[48]!==T||e[49]!==_||e[50]!==b||e[51]!==xe||e[52]!==ge||e[53]!==D?(B=t.jsx(Fe,{viewMode:D,onViewModeChange:_,sortKey:ge,sortDirection:b,onSort:T,sortOptions:xe}),e[48]=T,e[49]=_,e[50]=b,e[51]=xe,e[52]=ge,e[53]=D,e[54]=B):B=e[54];const je=Qe&&Te;let R;e[55]!==B||e[56]!==je?(R=t.jsxs(yt,{children:[B,je]}),e[55]=B,e[56]=je,e[57]=R):R=e[57];const Ce=`Search ${l}...`;let V;e[58]!==v?(V=g=>{g.key==="Escape"&&(v(""),g.target.blur())},e[58]=v,e[59]=V):V=e[59];let G;e[60]!==x||e[61]!==v||e[62]!==Ce||e[63]!==V?(G=t.jsx(ot,{value:x,onChange:v,placeholder:Ce,onKeyDown:V}),e[60]=x,e[61]=v,e[62]=Ce,e[63]=V,e[64]=G):G=e[64];let J;e[65]!==F?(J=F??[],e[65]=F,e[66]=J):J=e[66];const ve=z;let W;e[67]!==$?(W=g=>$(g),e[67]=$,e[68]=W):W=e[68];const be="No items found",ye=x?"Try adjusting your search terms":"This collection doesn't have any items yet.",Ne=Xe?Te:void 0;let H;e[69]!==be||e[70]!==ye||e[71]!==Ne?(H=t.jsx(lt,{image:null,title:be,description:ye,actions:Ne}),e[69]=be,e[70]=ye,e[71]=Ne,e[72]=H):H=e[72];let q;e[73]!==T||e[74]!==w||e[75]!==fe||e[76]!==f||e[77]!==x||e[78]!==v||e[79]!==_||e[80]!==b||e[81]!==J||e[82]!==ve||e[83]!==W||e[84]!==H||e[85]!==D?(q=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(Tt,{hideToolbar:!0,data:J,schema:f,viewMode:D,onViewModeChange:_,search:x,onSearchChange:v,sortKey:ve,sortDirection:b,onSort:T,actions:fe,onItemClick:W,readOnly:w,emptyState:H})}),e[73]=T,e[74]=w,e[75]=fe,e[76]=f,e[77]=x,e[78]=v,e[79]=_,e[80]=b,e[81]=J,e[82]=ve,e[83]=W,e[84]=H,e[85]=D,e[86]=q):q=e[86];let Q;e[87]!==G||e[88]!==q?(Q=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[G,q]}),e[87]=G,e[88]=q,e[89]=Q):Q=e[89];const we=!!I;let ce;e[90]===Symbol.for("react.memo_cache_sentinel")?(ce=g=>{g||M(null)},e[90]=ce):ce=e[90];let de;e[91]===Symbol.for("react.memo_cache_sentinel")?(de=t.jsx(mt,{children:"Delete item?"}),e[91]=de):de=e[91];const Se=I?.title;let X;e[92]!==Se?(X=t.jsxs(ft,{children:[de,t.jsxs(ut,{children:['Are you sure you want to delete "',Se,'"? This action cannot be undone.']})]}),e[92]=Se,e[93]=X):X=e[93];let Y;e[94]!==a.delete.isPending?(Y=t.jsx(dt,{disabled:a.delete.isPending,children:"Cancel"}),e[94]=a.delete.isPending,e[95]=Y):Y=e[95];const De=a.delete.isPending?"Deleting...":"Delete";let Z;e[96]!==a.delete.isPending||e[97]!==ue||e[98]!==De?(Z=t.jsx(pt,{onClick:ue,disabled:a.delete.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:De}),e[96]=a.delete.isPending,e[97]=ue,e[98]=De,e[99]=Z):Z=e[99];let ee;e[100]!==Y||e[101]!==Z?(ee=t.jsxs(ht,{children:[Y,Z]}),e[100]=Y,e[101]=Z,e[102]=ee):ee=e[102];let te;e[103]!==X||e[104]!==ee?(te=t.jsxs(xt,{children:[X,ee]}),e[103]=X,e[104]=ee,e[105]=te):te=e[105];let se;e[106]!==we||e[107]!==te?(se=t.jsx(gt,{open:we,onOpenChange:ce,children:te}),e[106]=we,e[107]=te,e[108]=se):se=e[108];let pe;return e[109]!==R||e[110]!==Q||e[111]!==se?(pe=t.jsxs(t.Fragment,{children:[R,Q,se]}),e[109]=R,e[110]=Q,e[111]=se,e[112]=pe):pe=e[112],pe}export{ps as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as k,j as r,z as C}from"./index-DO8fUd54.js";import{T as S,a as R,b as T,c as H,d as L,e as z}from"./table-DyNKuHyS.js";import{n as D}from"./ArrowDown-B5WC3D5H.js";import{i as E}from"./ArrowUp-tKKJvEkq.js";function I(y){const e=k.c(29),{columns:s,data:f,sortKey:u,sortDirection:x,onSort:i,onRowClick:n,rowClassName:c}=y;let p;e[0]!==x?(p=function(t,h){return r.jsx("div",{className:"w-4 flex items-center justify-center",children:h&&x&&(x==="asc"?r.jsx(E,{size:16,className:"text-muted-foreground transition-colors"}):r.jsx(D,{size:16,className:"text-muted-foreground transition-colors"}))})},e[0]=x,e[1]=p):p=e[1];const b=p;let d;e[2]===Symbol.for("react.memo_cache_sentinel")?(d=function(t,h){let N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider";return t===h-1&&(N="px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider w-8"),N},e[2]=d):d=e[2];const a=d;let o;if(e[3]!==s||e[4]!==i||e[5]!==b||e[6]!==u){let l;e[8]!==s.length||e[9]!==i||e[10]!==b||e[11]!==u?(l=(t,h)=>{const N=u===t.id;return r.jsx(S,{className:C(a(h,s.length),"group transition-colors select-none",t.sortable&&"hover:bg-accent cursor-pointer",t.rowClassName,t.cellClassName),onClick:t.sortable&&i?()=>i(t.id):void 0,children:r.jsxs("span",{className:"flex items-center gap-1",children:[t.header,t.sortable&&b(t.id,N)]})},t.id)},e[8]=s.length,e[9]=i,e[10]=b,e[11]=u,e[12]=l):l=e[12],o=s.map(l),e[3]=s,e[4]=i,e[5]=b,e[6]=u,e[7]=o}else o=e[7];let g;e[13]!==o?(g=r.jsx(R,{className:"border-b-0",children:r.jsx(T,{className:"h-9 hover:bg-transparent border-b border-border",children:o})}),e[13]=o,e[14]=g):g=e[14];let j;if(e[15]!==s||e[16]!==f||e[17]!==n||e[18]!==c){let l;e[20]!==s||e[21]!==n||e[22]!==c?(l=(t,h)=>{const N=c?.(t);return r.jsx(T,{"data-row-index":h,className:C("group/data-row transition-colors border-b-0 hover:bg-accent/50",n?"cursor-pointer":"",N),onClick:n?()=>n(t):void 0,children:s.map(m=>r.jsx(H,{className:C("px-5 py-4 h-16 align-middle text-sm text-foreground",m.cellClassName,m.wrap?"whitespace-normal wrap-break-word":""),children:r.jsx("div",{className:C(m.wrap?"w-full":"min-w-0 w-full",!m.wrap&&"truncate overflow-hidden whitespace-nowrap"),children:m.render?m.render(t):m.accessor?m.accessor(t):null})},m.id))},h)},e[20]=s,e[21]=n,e[22]=c,e[23]=l):l=e[23],j=f.map(l),e[15]=s,e[16]=f,e[17]=n,e[18]=c,e[19]=j}else j=e[19];let w;e[24]!==j?(w=r.jsx(L,{children:j}),e[24]=j,e[25]=w):w=e[25];let v;return e[26]!==g||e[27]!==w?(v=r.jsxs(z,{className:"w-full border-collapse",children:[g,w]}),e[26]=g,e[27]=w,e[28]=v):v=e[28],v}function W(y){const e=k.c(12),{columns:s,data:f,isLoading:u,sortKey:x,sortDirection:i,onSort:n,onRowClick:c,emptyState:p}=y;if(u===void 0?!1:u){let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("div",{className:"flex items-center justify-center h-full",children:r.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}),e[0]=a):a=e[0],a}if(f.length===0){let a;e[1]!==p?(a=p||r.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No items found"}),e[1]=p,e[2]=a):a=e[2];let o;return e[3]!==a?(o=r.jsx("div",{className:"flex items-center justify-center h-full",children:a}),e[3]=a,e[4]=o):o=e[4],o}let d;return e[5]!==s||e[6]!==f||e[7]!==c||e[8]!==n||e[9]!==i||e[10]!==x?(d=r.jsx("div",{className:"flex-1 overflow-auto",children:r.jsx(I,{columns:s,data:f,sortKey:x,sortDirection:i,onSort:n,onRowClick:c})}),e[5]=s,e[6]=f,e[7]=c,e[8]=n,e[9]=i,e[10]=x,e[11]=d):d=e[11],d}export{W as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as $,z as N,j as t}from"./index-DO8fUd54.js";import{C as q}from"./card-B4dTtsmd.js";import{I as B}from"./integration-icon-BrOdBipR.js";function K(g){const e=$.c(46),{connection:s,onClick:C,headerActions:b,body:z,footer:k,className:I,size:A,fallbackIcon:w}=g,E=A===void 0?"md":A,i=E==="sm"?"p-4":"p-6",P=E==="sm"?"text-sm":"text-base",R=E==="sm"?"text-xs":"text-sm",S=C&&"hover:bg-muted/50";let l;e[0]!==I||e[1]!==S?(l=N("cursor-pointer transition-colors group overflow-hidden flex flex-col",S,I),e[0]=I,e[1]=S,e[2]=l):l=e[2];let o;e[3]!==i?(o=N("flex flex-col gap-4",i),e[3]=i,e[4]=o):o=e[4];let n;e[5]!==s.icon||e[6]!==s.title||e[7]!==w?(n=t.jsx(B,{icon:s.icon,name:s.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:w}),e[5]=s.icon,e[6]=s.title,e[7]=w,e[8]=n):n=e[8];let c;e[9]!==b?(c=b&&t.jsx("div",{className:N("transition-opacity","opacity-0 group-hover:opacity-100"),onClick:F,children:b}),e[9]=b,e[10]=c):c=e[10];let r;e[11]!==c?(r=t.jsx("div",{className:"relative",children:c}),e[11]=c,e[12]=r):r=e[12];let a;e[13]!==n||e[14]!==r?(a=t.jsxs("div",{className:"flex items-start justify-between",children:[n,r]}),e[13]=n,e[14]=r,e[15]=a):a=e[15];let d;e[16]!==P?(d=N("font-medium text-foreground truncate",P),e[16]=P,e[17]=d):d=e[17];let m;e[18]!==s.title||e[19]!==d?(m=t.jsx("h3",{className:d,children:s.title}),e[18]=s.title,e[19]=d,e[20]=m):m=e[20];let f;e[21]!==R?(f=N("text-muted-foreground line-clamp-2",R),e[21]=R,e[22]=f):f=e[22];const _=s.description||"No description";let x;e[23]!==f||e[24]!==_?(x=t.jsx("p",{className:f,children:_}),e[23]=f,e[24]=_,e[25]=x):x=e[25];let p;e[26]!==m||e[27]!==x?(p=t.jsxs("div",{className:"flex flex-col gap-0",children:[m,x]}),e[26]=m,e[27]=x,e[28]=p):p=e[28];let h;e[29]!==z?(h=z&&t.jsx("div",{children:z}),e[29]=z,e[30]=h):h=e[30];let u;e[31]!==p||e[32]!==h||e[33]!==o||e[34]!==a?(u=t.jsxs("div",{className:o,children:[a,p,h]}),e[31]=p,e[32]=h,e[33]=o,e[34]=a,e[35]=u):u=e[35];let j;e[36]!==k||e[37]!==i?(j=k&&t.jsx("div",{className:"border-t border-border mt-auto",children:t.jsx("div",{className:N("h-14 flex items-center",i),onClick:D,children:k})}),e[36]=k,e[37]=i,e[38]=j):j=e[38];let v;e[39]!==u||e[40]!==j?(v=t.jsxs("div",{className:"flex flex-col flex-1",children:[u,j]}),e[39]=u,e[40]=j,e[41]=v):v=e[41];let y;return e[42]!==C||e[43]!==v||e[44]!==l?(y=t.jsx(q,{className:l,onClick:C,children:v}),e[42]=C,e[43]=v,e[44]=l,e[45]=y):y=e[45],y}function D(g){return g.stopPropagation()}function F(g){return g.stopPropagation()}export{K as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as U,j as t,e as Ne,B as Ue,O as ge,F as it,u as ze,G as gt,c4 as Ge,y as jt,p as bt,r as K,o as at,bG as vt,bH as Nt,n as B,D as Qe,_ as yt,E as ct,g as _t,d as Ct,x as St,q as wt,t as Tt,b as kt,a as Pt,w as ve,K as Je}from"./index-DO8fUd54.js";import{E as Z}from"./empty-state-SBIKV11G.js";import{E as It,r as $t,e as lt}from"./env-vars-editor-1feSU4JA.js";import{g as Be}from"./types-BPYct9bF.js";import{S as At}from"./save-actions-MbSzUbWU.js";import{b as Vt,a as Mt}from"./use-binding-DSWv53zN.js";import{u as Dt,S as Ot}from"./index-C6XH6ylF.js";import{u as Rt,a as dt}from"./use-connection-BNGXvSqD.js";import{u as mt}from"./constants-B9t4Nuz_.js";import{d as Et}from"./use-mcp-tools-BCCglZve.js";import{b as Lt}from"./use-mcp-resources-BNoK6dDS.js";import{a as Ut}from"./use-mcp-prompts-D_02f3uO.js";import{b as Ye,c as Ft,d as zt,e as Bt,B as Ht,a as Kt}from"./breadcrumb-pLMl4xjy.js";import{C as Xt}from"./collection-tabs-CHem1-m4.js";import{i as Oe}from"./Loading01-WTkiPysv.js";import{V as He,a as qt}from"./layout-ubFJ5DPd.js";import{C as Wt}from"./collection-tab-CTog7m1d.js";import{I as Gt}from"./icon-picker-BKKuKn6y.js";import{I as Re}from"./integration-icon-BrOdBipR.js";import{B as Fe}from"./badge-C4uZcq7J.js";import{D as Qt,a as Jt,b as Yt,c as Ze}from"./dropdown-menu-Cp0O2jCN.js";import{F as q,a as Zt,b as W,d as H,f as G,c as Y,e as es}from"./form-DPPO-3Tw.js";import{I as Q}from"./input-BM9bdg-F.js";import{S as et,a as tt,b as st,c as nt,d as X}from"./select-RxUFw6pZ.js";import{i as ut}from"./CheckCircle-wz1RfkCA.js";import{t as ts}from"./ChevronDown-D0TXudCx.js";import{n as ss}from"./Container-YdffBHg3.js";import{s as De}from"./Globe02-Cn3qFriL.js";import{s as ns}from"./RefreshCcw01-DckyCUMd.js";import{i as os}from"./Terminal-BQ1GlFmm.js";import{s as rs}from"./Trash01-DkXbOnbi.js";import{t as Ke}from"./Users03-BXwEsNFj.js";import{s as is}from"./XClose-B0FgAxIQ.js";import{U as as}from"./user-6WV0RuBu.js";import{b as cs,a as ls}from"./use-virtual-mcp-DoDJBE5n.js";import{i as ds}from"./ChevronRight-UJRwW9xN.js";import{s as ms}from"./Plus-Dto-8y6a.js";import{f as us}from"./formatDistanceToNow-Cb2QZZJn.js";import{C as pt}from"./collection-display-button-C0A6ba73.js";import{C as Xe}from"./collection-search-Mtc1qP5K.js";import{C as ft}from"./collection-table-wrapper-Ccujw2gS.js";import{C as qe}from"./card-B4dTtsmd.js";import{R as ps}from"./readme-viewer-MbTGGbgZ.js";import{a as fs,T as xs}from"./tools-list-BeUwtNiH.js";import{M as hs}from"./mcp-app-renderer-CLfglV2_.js";import"./Save01-C2uk3LpG.js";import"./binder-hd3C3mvD.js";import"./File06-ZV5CfSHG.js";import"./Key01-IptFTL_3.js";import"./constants-Dr5R1EQY.js";import"./registry-utils-oSXyNc33.js";import"./extract-connection-data-adtLKfGW.js";import"./github-icon-Dp3wHhYE.js";import"./generate-id-Dyweu44Y.js";import"./use-install-from-registry-BEC7S-53.js";import"./index-Bmxys2UV.js";import"./index-D-NeGwUy.js";import"./ChevronUp-DXMXl76b.js";import"./index-B_m3AdpY.js";import"./select-virtual-mcp-DU8qBWLM.js";import"./popover-D1WG-emQ.js";import"./tooltip-BLTgyg7W.js";import"./index-COM-PDLy.js";import"./Check-CuWDIJeM.js";import"./SearchMd-Kap2MdR9.js";import"./use-create-virtual-mcp-BfS4KaKE.js";import"./use-collections-C8rLdQUN.js";import"./useMutation-CNVq636e.js";import"./useQuery-BeFLqBun.js";import"./index-B1uuY7UL.js";import"./use-local-storage-C3Bo802w.js";import"./Copy01-CPHBT83w.js";import"./DotsVertical-BaBvJOuP.js";import"./Edit01-Dpq6F4lk.js";import"./Eye-DDwMVcxZ.js";import"./empty-state-DbRFhzf6.js";import"./Inbox01-CJphqD3y.js";import"./use-list-state-DsQajLIu.js";import"./use-view-mode-Bl6DaWwW.js";import"./use-mobile-kAkblq0-.js";import"./alert-dialog-DtAWdTyc.js";import"./scroll-area-BcJ1ckdt.js";import"./Edit05-h0OeCHXT.js";import"./Link01-BpjSsBky.js";import"./label-CnT8WAQY.js";import"./avatar-ChRCLY4k.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./ArrowDown-B5WC3D5H.js";import"./ArrowUp-tKKJvEkq.js";import"./Grid01-Gq7hBl7S.js";import"./List-ySIwqood.js";import"./table-DyNKuHyS.js";import"./LayersTwo01-B5fVqAUB.js";function gs(s){const e=U.c(14),{virtualMcp:n,org:o}=s;let i;e[0]!==o||e[1]!==n.id?(i={org:o,project:ge,agentId:n.id},e[0]=o,e[1]=n.id,e[2]=i):i=e[2];let a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(Ke,{size:16}),e[3]=a):a=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(Re,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:a}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let j;e[7]!==n.title?(j=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[7]=n.title,e[8]=j):j=e[8];let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ds,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[9]=f):f=e[9];let m;return e[10]!==i||e[11]!==l||e[12]!==j?(m=t.jsxs(it,{to:"/$org/$project/agents/$agentId",params:i,className:"flex items-center gap-3 p-2 pr-1 rounded-lg hover:bg-muted/50 transition-colors group",children:[l,j,f]}),e[10]=i,e[11]=l,e[12]=j,e[13]=m):m=e[13],m}function ot(s){const e=U.c(20),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:j}=s,f=Ne(),m=ls();let x;e[0]!==m.create||e[1]!==i||e[2]!==a||e[3]!==n||e[4]!==o||e[5]!==f||e[6]!==l?(x=async()=>{const d=await m.create.mutateAsync({title:`${o} Agent`,description:i??null,icon:a??null,status:"active",connections:[{connection_id:n,selected_tools:null,selected_resources:null,selected_prompts:null}]});f({to:"/$org/$project/agents/$agentId",params:{org:l,project:ge,agentId:d.id}})},e[0]=m.create,e[1]=i,e[2]=a,e[3]=n,e[4]=o,e[5]=f,e[6]=l,e[7]=x):x=e[7];const c=x;if(j){let d;e[8]!==m.create.isPending?(d=m.create.isPending?t.jsx(Oe,{size:16,className:"animate-spin"}):t.jsx(ms,{size:16}),e[8]=m.create.isPending,e[9]=d):d=e[9];let u;return e[10]!==m.create.isPending||e[11]!==c||e[12]!==d?(u=t.jsx(Ue,{variant:"ghost",className:"size-6 p-0",onClick:c,disabled:m.create.isPending,children:d}),e[10]=m.create.isPending,e[11]=c,e[12]=d,e[13]=u):u=e[13],u}let r;e[14]!==m.create.isPending?(r=m.create.isPending?t.jsx(Oe,{className:"animate-spin text-muted-foreground"}):t.jsx(Ke,{className:"size-3 text-muted-foreground"}),e[14]=m.create.isPending,e[15]=r):r=e[15];let h;return e[16]!==m.create.isPending||e[17]!==c||e[18]!==r?(h=t.jsxs(Ue,{variant:"outline",size:"sm",onClick:c,disabled:m.create.isPending,children:[r,"Create an agent"]}),e[16]=m.create.isPending,e[17]=c,e[18]=r,e[19]=h):h=e[19],h}function js(s){const e=U.c(26),{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l}=s;let j;e[0]!==n?(j={filters:[{column:"connection_id",value:n}]},e[0]=n,e[1]=j):j=e[1];const f=cs(j);if(!(f.length>0)){let u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Use in your IDE"}),e[2]=u):u=e[2];let b;return e[3]!==i||e[4]!==a||e[5]!==n||e[6]!==o||e[7]!==l?(b=t.jsxs("div",{className:"p-5 flex items-center justify-between gap-3",children:[u,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!1})]}),e[3]=i,e[4]=a,e[5]=n,e[6]=o,e[7]=l,e[8]=b):b=e[8],b}let x;e[9]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx("h4",{className:"text-xs text-muted-foreground font-medium",children:"Agents"}),e[9]=x):x=e[9];let c;e[10]!==i||e[11]!==a||e[12]!==n||e[13]!==o||e[14]!==l?(c=t.jsx("div",{className:"flex flex-col gap-1",children:t.jsxs("div",{className:"flex items-center justify-between",children:[x,t.jsx(ot,{connectionId:n,connectionTitle:o,connectionDescription:i,connectionIcon:a,org:l,hasExistingVirtualMcps:!0})]})}),e[10]=i,e[11]=a,e[12]=n,e[13]=o,e[14]=l,e[15]=c):c=e[15];let r;if(e[16]!==l||e[17]!==f){let u;e[19]!==l?(u=b=>t.jsx(gs,{virtualMcp:b,org:l},b.id),e[19]=l,e[20]=u):u=e[20],r=f.map(u),e[16]=l,e[17]=f,e[18]=r}else r=e[18];let h;e[21]!==r?(h=t.jsx("div",{className:"flex flex-col gap-2",children:r}),e[21]=r,e[22]=h):h=e[22];let d;return e[23]!==c||e[24]!==h?(d=t.jsxs("div",{className:"p-5 flex flex-col gap-3",children:[c,h]}),e[23]=c,e[24]=h,e[25]=d):d=e[25],d}function bs({form:s,connection:e,hasOAuthToken:n,onReauthenticate:o,onRemoveOAuth:i}){const a=Ge({control:s.control,name:"ui_type"}),l=Ge({control:s.control,name:"connection_url"}),{stdioEnabled:j}=jt(),f=(()=>{if(typeof l!="string"||!l)return!1;try{const r=new URL(l);return r.hostname==="api.githubcopilot.com"&&r.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),m=j||e.connection_type==="STDIO",x=e.connection_type==="VIRTUAL",c=x?bt(e.connection_url):null;return x?t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"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(Ke,{className:"w-4 h-4 text-muted-foreground"}),t.jsx("span",{className:"text-sm",children:"Virtual MCP"})]}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"This connection references a Virtual MCP. Tools and resources are aggregated dynamically from the Virtual MCP's underlying connections."})]}),c&&t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Virtual MCP ID"}),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:c})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[t.jsx(q,{control:s.control,name:"ui_type",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),a!=="NPX"&&a!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(H,{children:t.jsxs(tt,{className:"h-10 w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(De,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(st,{})]})}),t.jsxs(nt,{children:[t.jsx(X,{value:"HTTP",children:"HTTP"}),t.jsx(X,{value:"SSE",children:"SSE"}),t.jsx(X,{value:"Websocket",children:"Websocket"}),m&&t.jsxs(t.Fragment,{children:[t.jsx(X,{value:"NPX",children:"NPX Package"}),t.jsx(X,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(q,{control:s.control,name:"connection_url",render:({field:h})=>t.jsx(W,{className:"flex-1 min-w-0",children:t.jsx(H,{children:t.jsx(Q,{placeholder:"https://example.com/mcp",...h,value:h.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(et,{value:r.value,onValueChange:r.onChange,children:[t.jsx(H,{children:t.jsx(tt,{className:"h-10",children:t.jsx(st,{})})}),t.jsxs(nt,{children:[t.jsx(X,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(X,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(X,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(De,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(X,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ss,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(X,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(os,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(G,{})]})}),a==="NPX"&&t.jsx(q,{control:s.control,name:"npx_package",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(H,{children:t.jsx(Q,{placeholder:"@perplexity-ai/mcp-server",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),a==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(q,{control:s.control,name:"stdio_command",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(H,{children:t.jsx(Q,{placeholder:"node, bun, python...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})}),t.jsx(q,{control:s.control,name:"stdio_args",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(H,{children:t.jsx(Q,{placeholder:"arg1 arg2 --flag value",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(G,{})]})})]}),t.jsx(q,{control:s.control,name:"stdio_cwd",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(H,{children:t.jsx(Q,{placeholder:"/path/to/project (optional)",...r,value:r.value||"",className:"h-10 rounded-lg"})}),t.jsx(G,{})]})})]}),(a==="NPX"||a==="STDIO")&&t.jsx(q,{control:s.control,name:"env_vars",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(H,{children:t.jsx(It,{value:r.value??[],onChange:r.onChange})}),t.jsx(G,{})]})}),a!=="NPX"&&a!=="STDIO"&&t.jsx(q,{control:s.control,name:"connection_token",render:({field:r})=>t.jsxs(W,{className:"flex flex-col gap-3",children:[t.jsx(Y,{className:"text-xs text-muted-foreground font-medium",children:f?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Qt,{children:[t.jsx(Jt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Fe,{variant:"success",className:"gap-1.5",children:[t.jsx(ut,{size:12}),"Authenticated via OAuth",t.jsx(ts,{size:12})]})})}),t.jsxs(Yt,{align:"start",children:[t.jsxs(Ze,{onClick:o,children:[t.jsx(ns,{size:16}),"Re-authenticate"]}),t.jsxs(Ze,{variant:"destructive",onClick:i,children:[t.jsx(rs,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&r.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:()=>r.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:"Clear and replace token",children:t.jsx(is,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(H,{children:t.jsx(Q,{type:"password",placeholder:f?"Paste your GitHub PAT":"Enter access token...",...r,value:r.value||"",className:"h-10 rounded-lg"})}),f&&t.jsxs(es,{children:["Create a PAT at"," ",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(G,{})]})})]})}function vs(s){const e=U.c(45),{form:n,connection:o,isMCPAuthenticated:i,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}=s,{org:f}=ze();let m;e[0]!==o.app_name||e[1]!==o.icon||e[2]!==o.title||e[3]!==n.control?(m=o.app_name&&o.icon?t.jsx(Re,{icon:o.icon,name:o.title,size:"lg",className:"shadow-sm"}):t.jsx(gt,{control:n.control,name:"icon",render:k=>{const{field:I}=k;return t.jsx(Gt,{value:I.value,onChange:I.onChange,name:o.title,size:"lg",className:"shadow-sm"})}}),e[0]=o.app_name,e[1]=o.icon,e[2]=o.title,e[3]=n.control,e[4]=m):m=e[4];let x;e[5]!==n.control?(x=t.jsxs("div",{className:"flex flex-col",children:[t.jsx(q,{control:n.control,name:"title",render:ys}),t.jsx(q,{control:n.control,name:"description",render:Ns})]}),e[5]=n.control,e[6]=x):x=e[6];let c;e[7]!==m||e[8]!==x?(c=t.jsxs("div",{className:"flex flex-col gap-4 p-5 border-b border-border",children:[m,x]}),e[7]=m,e[8]=x,e[9]=c):c=e[9];let r;e[10]!==o||e[11]!==n||e[12]!==a||e[13]!==l||e[14]!==j?(r=t.jsx(bs,{form:n,connection:o,hasOAuthToken:a,onReauthenticate:l,onRemoveOAuth:j}),e[10]=o,e[11]=n,e[12]=a,e[13]=l,e[14]=j,e[15]=r):r=e[15];let h;e[16]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Status"}),e[16]=h):h=e[16];let d;e[17]!==i?(d=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[h,i?t.jsxs(Fe,{variant:"success",className:"gap-1.5 bg-success-foreground text-success",children:[t.jsx(ut,{size:12}),"Connected"]}):t.jsx(Fe,{variant:"outline",className:"text-muted-foreground",children:"Not connected"})]}),e[17]=i,e[18]=d):d=e[18];let u;e[19]===Symbol.for("react.memo_cache_sentinel")?(u=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Created by"}),e[19]=u):u=e[19];let b;e[20]!==o.created_by?(b=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[u,t.jsx(as,{id:o.created_by,size:"2xs"})]}),e[20]=o.created_by,e[21]=b):b=e[21];let v;e[22]===Symbol.for("react.memo_cache_sentinel")?(v=t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"Updated"}),e[22]=v):v=e[22];let _;e[23]!==o.updated_at?(_=o.updated_at?us(new Date(o.updated_at),{addSuffix:!0}):"Unknown",e[23]=o.updated_at,e[24]=_):_=e[24];let S;e[25]!==_?(S=t.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[v,t.jsx("span",{className:"text-sm text-foreground",children:_})]}),e[25]=_,e[26]=S):S=e[26];let p;e[27]!==S||e[28]!==d||e[29]!==b?(p=t.jsxs("div",{className:"flex flex-col gap-2 p-5 border-b border-border",children:[d,b,S]}),e[27]=S,e[28]=d,e[29]=b,e[30]=p):p=e[30];let C;e[31]!==o.description||e[32]!==o.icon||e[33]!==o.id||e[34]!==o.title||e[35]!==f.slug?(C=t.jsx(js,{connectionId:o.id,connectionTitle:o.title,connectionDescription:o.description,connectionIcon:o.icon,org:f.slug}),e[31]=o.description,e[32]=o.icon,e[33]=o.id,e[34]=o.title,e[35]=f.slug,e[36]=C):C=e[36];let w;e[37]!==p||e[38]!==C||e[39]!==c||e[40]!==r?(w=t.jsxs("div",{className:"flex flex-col h-full overflow-auto",children:[c,r,p,C]}),e[37]=p,e[38]=C,e[39]=c,e[40]=r,e[41]=w):w=e[41];let g;return e[42]!==n||e[43]!==w?(g=t.jsx(Zt,{...n,children:w}),e[42]=n,e[43]=w,e[44]=g):g=e[44],g}function Ns(s){const{field:e}=s;return t.jsxs(W,{className:"w-full space-y-0",children:[t.jsx(H,{children:t.jsx(Q,{...e,value:e.value||"",className:"h-auto py-0.5 text-base text-muted-foreground leading-6 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Add a description..."})}),t.jsx(G,{})]})}function ys(s){const{field:e}=s;return t.jsxs(W,{className:"flex-1 space-y-0",children:[t.jsx(H,{children:t.jsx(Q,{...e,className:"h-auto py-0.5 text-lg! font-medium leading-7 px-2 -mx-2 border-transparent hover:bg-input/25 focus:border-input bg-transparent transition-all",placeholder:"Connection Name"})}),t.jsx(G,{})]})}function _s(s){const e=U.c(39),{prompts:n,connectionId:o,org:i,onPromptClick:a,showToolbar:l,emptyMessage:j}=s,f=l===void 0?!0:l,m=j===void 0?"This connection doesn't have any prompts yet.":j,x=Ne(),[c,r]=K.useState(""),[h,d]=K.useState("table"),[u,b]=K.useState("name"),[v,_]=K.useState("asc");let S;e[0]!==v||e[1]!==u?(S=T=>{u===T?(_(ks),v==="desc"&&b(void 0)):(b(T),_("asc"))},e[0]=v,e[1]=u,e[2]=S):S=e[2];const p=S;let C;e[3]!==o||e[4]!==x||e[5]!==a||e[6]!==i?(C=T=>{a?a(T):o&&i&&x({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"prompts",itemId:encodeURIComponent(T.name)}})},e[3]=o,e[4]=x,e[5]=a,e[6]=i,e[7]=C):C=e[7];const w=C;let g;if(e[8]!==n||e[9]!==c||e[10]!==v||e[11]!==u){const T=!n||n.length===0?[]:c.trim()?(()=>{const F=c.toLowerCase();return n.filter(z=>z.name.toLowerCase().includes(F)||z.description&&z.description.toLowerCase().includes(F))})():n;g=!u||!v?T:[...T].sort((F,z)=>{const je=F[u]||"",ee=z[u]||"",J=String(je).localeCompare(String(ee));return v==="asc"?J:-J}),e[8]=n,e[9]=c,e[10]=v,e[11]=u,e[12]=g}else g=e[12];const k=g;let I;e[13]===Symbol.for("react.memo_cache_sentinel")?(I=[{id:"name",header:"Name",render:Ts,sortable:!0},{id:"description",header:"Description",render:ws,cellClassName:"flex-1",sortable:!0}],e[13]=I):I=e[13];const V=I;let M;e[14]===Symbol.for("react.memo_cache_sentinel")?(M=V.filter(Ss).map(Cs),e[14]=M):M=e[14];const L=M;let y;e[15]!==p||e[16]!==f||e[17]!==v||e[18]!==u||e[19]!==h?(y=f&&t.jsx(He,{children:t.jsx(pt,{viewMode:h,onViewModeChange:d,sortKey:u,sortDirection:v,onSort:p,sortOptions:L})}),e[15]=p,e[16]=f,e[17]=v,e[18]=u,e[19]=h,e[20]=y):y=e[20];let R;e[21]===Symbol.for("react.memo_cache_sentinel")?(R=T=>{T.key==="Escape"&&(r(""),T.target.blur())},e[21]=R):R=e[21];let D;e[22]!==c?(D=t.jsx(Xe,{value:c,onChange:r,placeholder:"Search prompts...",onKeyDown:R}),e[22]=c,e[23]=D):D=e[23];let N;e[24]!==m||e[25]!==w||e[26]!==p||e[27]!==c||e[28]!==v||e[29]!==u||e[30]!==k||e[31]!==h?(N=h==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:k.map(T=>t.jsx(qe,{className:"cursor-pointer transition-colors",onClick:()=>w(T),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:T.name,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-0",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:T.name}),t.jsx("p",{className:"text-base text-muted-foreground line-clamp-2",children:T.description||"No description"})]})]})},T.name))})}):t.jsx(ft,{columns:V,data:k,isLoading:!1,sortKey:u,sortDirection:v,onSort:p,onRowClick:T=>w(T),emptyState:t.jsx(Z,{image:null,title:c?"No prompts found":"No prompts available",description:c?"Try adjusting your search terms":m})}),e[24]=m,e[25]=w,e[26]=p,e[27]=c,e[28]=v,e[29]=u,e[30]=k,e[31]=h,e[32]=N):N=e[32];let A;e[33]!==D||e[34]!==N?(A=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[D,N]}),e[33]=D,e[34]=N,e[35]=A):A=e[35];let $;return e[36]!==A||e[37]!==y?($=t.jsxs(t.Fragment,{children:[y,A]}),e[36]=A,e[37]=y,e[38]=$):$=e[38],$}function Cs(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Ss(s){return s.sortable}function ws(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Ts(s){return t.jsx("span",{className:"text-sm font-medium font-mono text-foreground",children:s.name})}function ks(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ps(s){const e=U.c(4),{prompts:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx(_s,{prompts:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}function Is(s){const e=U.c(2),{repository:n}=s;let o;return e[0]!==n?(o=t.jsx("div",{className:"flex-1 overflow-y-auto bg-background",children:t.jsx(ps,{repository:n})}),e[0]=n,e[1]=o):o=e[1],o}function $s(s){const e=U.c(36),{resources:n,onResourceClick:o,showToolbar:i,emptyMessage:a}=s,l=i===void 0?!0:i,j=a===void 0?"This connection doesn't have any resources yet.":a,[f,m]=K.useState(""),[x,c]=K.useState("table"),[r,h]=K.useState("name"),[d,u]=K.useState("asc");let b;e[0]!==d||e[1]!==r?(b=N=>{r===N?(u(Es),d==="desc"&&h(void 0)):(h(N),u("asc"))},e[0]=d,e[1]=r,e[2]=b):b=e[2];const v=b;let _;e[3]!==o?(_=N=>{o&&o(N)},e[3]=o,e[4]=_):_=e[4];const S=_;let p;if(e[5]!==n||e[6]!==f||e[7]!==d||e[8]!==r){const N=!n||n.length===0?[]:f.trim()?(()=>{const A=f.toLowerCase();return n.filter($=>$.uri.toLowerCase().includes(A)||$.name&&$.name.toLowerCase().includes(A)||$.description&&$.description.toLowerCase().includes(A))})():n;p=!r||!d?N:[...N].sort((A,$)=>{const T=A[r]||"",F=$[r]||"",z=String(T).localeCompare(String(F));return d==="asc"?z:-z}),e[5]=n,e[6]=f,e[7]=d,e[8]=r,e[9]=p}else p=e[9];const C=p;let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=[{id:"name",header:"Name",render:Rs,sortable:!0},{id:"uri",header:"URI",render:Os,sortable:!0},{id:"description",header:"Description",render:Ds,cellClassName:"flex-1",sortable:!0},{id:"mimeType",header:"Type",render:Ms,sortable:!0}],e[10]=w):w=e[10];const g=w;let k;e[11]===Symbol.for("react.memo_cache_sentinel")?(k=g.filter(Vs).map(As),e[11]=k):k=e[11];const I=k;let V;e[12]!==v||e[13]!==l||e[14]!==d||e[15]!==r||e[16]!==x?(V=l&&t.jsx(He,{children:t.jsx(pt,{viewMode:x,onViewModeChange:c,sortKey:r,sortDirection:d,onSort:v,sortOptions:I})}),e[12]=v,e[13]=l,e[14]=d,e[15]=r,e[16]=x,e[17]=V):V=e[17];let M;e[18]===Symbol.for("react.memo_cache_sentinel")?(M=N=>{N.key==="Escape"&&(m(""),N.target.blur())},e[18]=M):M=e[18];let L;e[19]!==f?(L=t.jsx(Xe,{value:f,onChange:m,placeholder:"Search resources...",onKeyDown:M}),e[19]=f,e[20]=L):L=e[20];let y;e[21]!==j||e[22]!==S||e[23]!==v||e[24]!==f||e[25]!==d||e[26]!==r||e[27]!==C||e[28]!==x?(y=x==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:C.length===0?t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:C.map(N=>t.jsx(qe,{className:"cursor-pointer transition-colors",onClick:()=>S(N),children:t.jsxs("div",{className:"flex flex-col gap-4 p-6",children:[t.jsx(Re,{icon:null,name:N.name||N.uri,size:"md",className:"shrink-0 shadow-sm"}),t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:N.name||N.uri}),t.jsx("p",{className:"text-xs font-mono text-muted-foreground truncate",children:N.uri}),N.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:N.description})]})]})},N.uri))})}):t.jsx(ft,{columns:g,data:C,isLoading:!1,sortKey:r,sortDirection:d,onSort:v,onRowClick:N=>S(N),emptyState:t.jsx(Z,{image:null,title:f?"No resources found":"No resources available",description:f?"Try adjusting your search terms":j})}),e[21]=j,e[22]=S,e[23]=v,e[24]=f,e[25]=d,e[26]=r,e[27]=C,e[28]=x,e[29]=y):y=e[29];let R;e[30]!==L||e[31]!==y?(R=t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[L,y]}),e[30]=L,e[31]=y,e[32]=R):R=e[32];let D;return e[33]!==R||e[34]!==V?(D=t.jsxs(t.Fragment,{children:[V,R]}),e[33]=R,e[34]=V,e[35]=D):D=e[35],D}function As(s){return{id:s.id,label:typeof s.header=="string"?s.header:s.id}}function Vs(s){return s.sortable}function Ms(s){return t.jsx("span",{className:"text-sm text-muted-foreground",children:s.mimeType||"—"})}function Ds(s){return t.jsx("span",{className:"text-sm text-foreground",children:s.description||"—"})}function Os(s){return t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:s.uri})}function Rs(s){return t.jsx("span",{className:"text-sm font-medium text-foreground",children:s.name||s.uri})}function Es(s){return s==="asc"?"desc":s==="desc"?null:"asc"}function Ls(s){const e=U.c(4),{resources:n,connectionId:o,org:i}=s;let a;return e[0]!==o||e[1]!==i||e[2]!==n?(a=t.jsx($s,{resources:n,connectionId:o,org:i}),e[0]=o,e[1]=i,e[2]=n,e[3]=a):a=e[3],a}const Us=at({key:B().min(1,"Key is required"),value:B()}),Fs=at({title:B().min(1,"Name is required"),description:B().nullable().optional(),icon:B().nullable().optional(),ui_type:yt(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:B().optional(),connection_token:B().nullable().optional(),npx_package:B().optional(),stdio_command:B().optional(),stdio_args:B().optional(),stdio_cwd:B().optional(),env_vars:Qe(Us).optional(),configuration_scopes:Qe(B()).nullable().optional(),configuration_state:vt(B(),Nt()).nullable().optional()}).refine(s=>s.ui_type==="NPX"?!!s.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(s=>s.ui_type==="STDIO"?!!s.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(s=>s.ui_type==="HTTP"||s.ui_type==="SSE"||s.ui_type==="Websocket"?!!s.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function zs(s){const e=U.c(5),{tools:n,connectionId:o,org:i,isLoading:a}=s;let l;return e[0]!==o||e[1]!==a||e[2]!==i||e[3]!==n?(l=t.jsx(fs,{tools:n,connectionId:o,org:i,isLoading:a}),e[0]=o,e[1]=a,e[2]=i,e[3]=n,e[4]=l):l=e[4],l}function Bs(s){const e=U.c(27),{tools:n,connectionId:o,org:i}=s,a=Ne(),{org:l}=ze();let j;e[0]!==o||e[1]!==l.id?(j={connectionId:o,orgId:l.id},e[0]=o,e[1]=l.id,e[2]=j):j=e[2];const f=mt(j),[m,x]=K.useState("");let c,r,h,d;if(e[3]!==f||e[4]!==o||e[5]!==a||e[6]!==i||e[7]!==m||e[8]!==n){const v=(n??[]).filter(Hs),_=m.toLowerCase().trim(),S=_?v.filter(g=>g.name.toLowerCase().includes(_)||g.description&&g.description.toLowerCase().includes(_)):v;let p;e[13]!==o||e[14]!==a||e[15]!==i?(p=g=>{a({to:"/$org/$project/mcps/$connectionId/$collectionName/$itemId",params:{org:i,project:ge,connectionId:o,collectionName:"tools",itemId:encodeURIComponent(g.name)}})},e[13]=o,e[14]=a,e[15]=i,e[16]=p):p=e[16];const C=p;h="flex flex-col h-full overflow-hidden";let w;e[17]===Symbol.for("react.memo_cache_sentinel")?(w=g=>{g.key==="Escape"&&(x(""),g.target.blur())},e[17]=w):w=e[17],e[18]!==m?(d=t.jsx(Xe,{value:m,onChange:x,placeholder:"Search apps...",onKeyDown:w}),e[18]=m,e[19]=d):d=e[19],c="flex-1 overflow-auto p-5",r=S.length===0?t.jsx(Z,{image:null,title:m?"No apps found":"No apps available",description:m?"Try adjusting your search terms":"This connection doesn't have any tools with interactive UIs yet."}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(320px,1fr))] gap-4",children:S.map(g=>{const k=Be(g._meta);return t.jsxs(qe,{className:"cursor-pointer transition-colors overflow-hidden",onClick:()=>C(g),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(hs,{resourceURI:k,toolInfo:{tool:g},displayMode:"inline",minHeight:200,maxHeight:200,client:f})}),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:g.name}),t.jsx(xs,{annotations:g.annotations,_meta:g._meta})]}),g.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:g.description})]})]},g.name)})}),e[3]=f,e[4]=o,e[5]=a,e[6]=i,e[7]=m,e[8]=n,e[9]=c,e[10]=r,e[11]=h,e[12]=d}else c=e[9],r=e[10],h=e[11],d=e[12];let u;e[20]!==c||e[21]!==r?(u=t.jsx("div",{className:c,children:r}),e[20]=c,e[21]=r,e[22]=u):u=e[22];let b;return e[23]!==h||e[24]!==d||e[25]!==u?(b=t.jsxs("div",{className:h,children:[d,u]}),e[23]=h,e[24]=d,e[25]=u,e[26]=b):b=e[26],b}function Hs(s){return!!Be(s._meta)}function Ks(s){return s.command==="npx"}function Xs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function qs(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function Ws(s,e){const n={command:"npx",args:["-y",s]},o=lt(e);return Object.keys(o).length>0&&(n.envVars=o),n}function Gs(s,e,n,o){const i={command:s};e.trim()&&(i.args=e.trim().split(/\s+/)),n?.trim()&&(i.cwd=n.trim());const a=lt(o);return Object.keys(a).length>0&&(i.envVars=a),i}function rt(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"&&kt(s.connection_headers)){const o=s.connection_headers,i=$t(o.envVars);if(Ks(o)){const l=Xs(o);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:l,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i}}const a=qs(o);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i}}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 Qs(s){let e,n=null,o=null,i=null;return s.ui_type==="NPX"?(e="STDIO",n="",i=Ws(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",i=Gs(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",o=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...o&&{connection_token:o},...i&&{connection_headers:i},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function Js(s){const e=U.c(116),{connection:n,connectionId:o,org:i,requestedTabId:a,collections:l,onUpdate:j,isUpdating:f,prompts:m,resources:x,tools:c,isLoadingTools:r}=s;let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h={from:"/$org/$project/mcps/$connectionId"},e[0]=h):h=e[0];const d=Ne(h),u=St(),b=dt();let v;e[1]!==o?(v={connectionId:o},e[1]=o,e[2]=v):v=e[2];const _=Dt(v),p=n?.connection_type==="VIRTUAL"||_.isAuthenticated;let C;e[3]!==n?(C={connections:[n],binding:"MCP"},e[3]=n,e[4]=C):C=e[4];const g=Mt(C).length>0,k=n?.metadata?.repository,I=!!k?.url;let V;e[5]===Symbol.for("react.memo_cache_sentinel")?(V=wt(Fs),e[5]=V):V=e[5];let M;e[6]!==n?(M=rt(n),e[6]=n,e[7]=M):M=e[7];let L;e[8]!==M?(L={resolver:V,values:M},e[8]=M,e[9]=L):L=e[9];const y=Tt(L),R=y.formState.isDirty;let D;e[10]!==y||e[11]!==j?(D=async()=>{if(!await y.trigger())return;const E=y.getValues(),he=Qs(E);await j(he),y.reset(E)},e[10]=y,e[11]=j,e[12]=D):D=e[12];const N=D;let A;e[13]!==n||e[14]!==y?(A=()=>{y.reset(rt(n))},e[13]=n,e[14]=y,e[15]=A):A=e[15];const $=A;let T;e[16]!==n.id||e[17]!==b||e[18]!==u?(T=async()=>{const{token:P,tokenInfo:E,error:he}=await Pt({connectionId:n.id});if(he||!P){ve.error(`Authentication failed: ${he}`);return}if(E)try{const Me=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:E.accessToken,refreshToken:E.refreshToken,expiresIn:E.expiresIn,scope:E.scope,clientId:E.clientId,clientSecret:E.clientSecret,tokenEndpoint:E.tokenEndpoint})});if(!Me.ok)console.error("Failed to save OAuth token:",await Me.text()),await b.update.mutateAsync({id:n.id,data:{connection_token:P}});else try{await b.update.mutateAsync({id:n.id,data:{}})}catch(We){console.warn("Failed to refresh connection tools after OAuth:",We)}}catch(Me){console.error("Error saving OAuth token:",Me),await b.update.mutateAsync({id:n.id,data:{connection_token:P}})}else await b.update.mutateAsync({id:n.id,data:{connection_token:P}});const ht=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(ht.href,null)}),ve.success("Authentication successful")},e[16]=n.id,e[17]=b,e[18]=u,e[19]=T):T=e[19];const F=T;let z;e[20]!==n.id||e[21]!==u?(z=async()=>{try{const P=await fetch(`/api/connections/${n.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!P.ok){const he=await P.text();ve.error(`Failed to remove OAuth: ${he}`);return}const E=new URL(`/mcp/${n.id}`,window.location.origin);await u.invalidateQueries({queryKey:Je.isMCPAuthenticated(E.href,null)}),ve.success("OAuth removed. You can now re-authenticate with a different account.")}catch(P){console.error("Error removing OAuth token:",P),ve.error("Failed to remove OAuth")}},e[20]=n.id,e[21]=u,e[22]=z):z=e[22];const je=z,ee=c.length,J=m.length,ye=x.length;let _e;e[23]!==c?(_e=c.filter(en),e[23]=c,e[24]=_e):_e=e[24];const Ce=_e.length,Ee=ee>0||r;let Se;e[25]===Symbol.for("react.memo_cache_sentinel")?(Se={id:"settings",label:"Settings"},e[25]=Se):Se=e[25];let te;e[26]!==r||e[27]!==p||e[28]!==Ee||e[29]!==ee?(te=p&&Ee?[{id:"tools",label:"Tools",count:r?void 0:ee}]:[],e[26]=r,e[27]=p,e[28]=Ee,e[29]=ee,e[30]=te):te=e[30];let se;e[31]!==p||e[32]!==J?(se=p&&J>0?[{id:"prompts",label:"Prompts",count:J}]:[],e[31]=p,e[32]=J,e[33]=se):se=e[33];let ne;e[34]!==p||e[35]!==ye?(ne=p&&ye>0?[{id:"resources",label:"Resources",count:ye}]:[],e[34]=p,e[35]=ye,e[36]=ne):ne=e[36];let oe;e[37]!==p||e[38]!==Ce?(oe=p&&Ce>0?[{id:"ui",label:"UI",count:Ce}]:[],e[37]=p,e[38]=Ce,e[39]=oe):oe=e[39];let we;if(e[40]!==l||e[41]!==I||e[42]!==p||e[43]!==te||e[44]!==se||e[45]!==ne||e[46]!==oe){let P;e[48]!==I?(P=I?[{id:"readme",label:"README"}]:[],e[48]=I,e[49]=P):P=e[49],we=[Se,...te,...se,...ne,...oe,...p?(l||[]).map(Zs):[],...P],e[40]=l,e[41]=I,e[42]=p,e[43]=te,e[44]=se,e[45]=ne,e[46]=oe,e[47]=we}else we=e[47];const be=we,xt=p&&be.some(Ys)?"tools":"settings",O=be.some(P=>P.id===a)?a:xt;let Te;e[50]!==d?(Te=P=>{d({search:E=>({...E,tab:P}),replace:!0})},e[50]=d,e[51]=Te):Te=e[51];const re=Te;let ie;e[52]!==l?(ie=l||[],e[52]=l,e[53]=ie):ie=e[53];let ke;if(e[54]!==O||e[55]!==ie){let P;e[57]!==O?(P=E=>E.name===O,e[57]=O,e[58]=P):P=e[58],ke=ie.find(P),e[54]=O,e[55]=ie,e[56]=ke}else ke=e[56];const Pe=ke;let ae;e[59]!==i?(ae=t.jsx(Ye,{children:t.jsx(zt,{asChild:!0,children:t.jsx(it,{to:"/$org/$project/mcps",params:{org:i,project:ge},children:"Connections"})})}),e[59]=i,e[60]=ae):ae=e[60];let Ie;e[61]===Symbol.for("react.memo_cache_sentinel")?(Ie=t.jsx(Bt,{}),e[61]=Ie):Ie=e[61];let ce;e[62]!==n.title?(ce=t.jsx(Ye,{children:t.jsx(Ft,{children:n.title})}),e[62]=n.title,e[63]=ce):ce=e[63];let $e;e[64]!==ae||e[65]!==ce?($e=t.jsx(Ht,{children:t.jsxs(Kt,{children:[ae,Ie,ce]})}),e[64]=ae,e[65]=ce,e[66]=$e):$e=e[66];const Le=$e;let le;e[67]!==N||e[68]!==$||e[69]!==R||e[70]!==f?(le=t.jsx(He,{children:t.jsx(At,{onSave:N,onUndo:$,isDirty:R,isSaving:f})}),e[67]=N,e[68]=$,e[69]=R,e[70]=f,e[71]=le):le=e[71];let de;e[72]!==_.hasOAuthToken||e[73]!==n||e[74]!==y||e[75]!==F||e[76]!==je||e[77]!==p?(de=t.jsx("div",{className:"w-100 shrink-0 border-r border-border bg-background",children:t.jsx(vs,{form:y,connection:n,isMCPAuthenticated:p,hasOAuthToken:_.hasOAuthToken,onReauthenticate:F,onRemoveOAuth:je})}),e[72]=_.hasOAuthToken,e[73]=n,e[74]=y,e[75]=F,e[76]=je,e[77]=p,e[78]=de):de=e[78];let me;e[79]!==O||e[80]!==re||e[81]!==be?(me=t.jsx("div",{className:"shrink-0 flex items-center gap-4 px-5 py-3 border-b border-border",children:t.jsx(Xt,{tabs:be,activeTab:O,onTabChange:re,className:"flex-1"})}),e[79]=O,e[80]=re,e[81]=be,e[82]=me):me=e[82];let Ae;e[83]===Symbol.for("react.memo_cache_sentinel")?(Ae=t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),e[83]=Ae):Ae=e[83];let ue;e[84]!==Pe||e[85]!==O||e[86]!==_.isServerError||e[87]!==_.supportsOAuth||e[88]!==n||e[89]!==o||e[90]!==y||e[91]!==F||e[92]!==re||e[93]!==g||e[94]!==I||e[95]!==r||e[96]!==p||e[97]!==i||e[98]!==m||e[99]!==k||e[100]!==x||e[101]!==c?(ue=t.jsx(K.Suspense,{fallback:Ae,children:O==="tools"?t.jsx(zs,{tools:c,connectionId:o,org:i,isLoading:r}):O==="ui"?t.jsx(Bs,{tools:c,connectionId:o,org:i}):O==="prompts"?t.jsx(Ps,{prompts:m,connectionId:o,org:i}):O==="resources"?t.jsx(Ls,{resources:x,connectionId:o,org:i}):O==="settings"?t.jsx(Ot,{connection:n,form:y,hasMcpBinding:g,isMCPAuthenticated:p,supportsOAuth:_.supportsOAuth,isServerError:_.isServerError,onAuthenticate:F,onViewReadme:I?()=>re("readme"):void 0}):O==="readme"&&I?t.jsx(Is,{repository:k}):Pe&&p?t.jsx(Wt,{connectionId:o,org:i,activeCollection:Pe},O):t.jsx(Z,{title:"Collection not found",description:"This collection may have been deleted or you may not have access."})}),e[84]=Pe,e[85]=O,e[86]=_.isServerError,e[87]=_.supportsOAuth,e[88]=n,e[89]=o,e[90]=y,e[91]=F,e[92]=re,e[93]=g,e[94]=I,e[95]=r,e[96]=p,e[97]=i,e[98]=m,e[99]=k,e[100]=x,e[101]=c,e[102]=ue):ue=e[102];let pe;e[103]!==O||e[104]!==ue?(pe=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsx(ct,{children:ue},O)}),e[103]=O,e[104]=ue,e[105]=pe):pe=e[105];let fe;e[106]!==me||e[107]!==pe?(fe=t.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:[me,pe]}),e[106]=me,e[107]=pe,e[108]=fe):fe=e[108];let xe;e[109]!==de||e[110]!==fe?(xe=t.jsxs("div",{className:"flex h-full w-full bg-background overflow-hidden",children:[de,fe]}),e[109]=de,e[110]=fe,e[111]=xe):xe=e[111];let Ve;return e[112]!==Le||e[113]!==le||e[114]!==xe?(Ve=t.jsxs(qt,{breadcrumb:Le,children:[le,xe]}),e[112]=Le,e[113]=le,e[114]=xe,e[115]=Ve):Ve=e[115],Ve}function Ys(s){return s.id==="tools"}function Zs(s){return{id:s.name,label:s.displayName}}function en(s){return!!Be(s._meta)}function tn(){const s=U.c(43);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/$project/mcps/$connectionId"},s[0]=e):e=s[0];const n=Ne(e);let o;s[1]===Symbol.for("react.memo_cache_sentinel")?(o={from:"/shell/$org/$project/mcps/$connectionId"},s[1]=o):o=s[1];const{connectionId:i,org:a}=_t(o),{org:l}=ze();let j;s[2]===Symbol.for("react.memo_cache_sentinel")?(j={from:"/shell/$org/$project/mcps/$connectionId"},s[2]=j):j=s[2];const m=Ct(j).tab??"",x=Rt(i),c=dt(),r=Vt(x??void 0);let h;s[3]!==i||s[4]!==l.id?(h={connectionId:i,orgId:l.id},s[3]=i,s[4]=l.id,s[5]=h):h=s[5];const d=mt(h);let u;s[6]!==d?(u={client:d},s[6]=d,s[7]=u):u=s[7];const{data:b}=Ut(u);let v;s[8]!==d?(v={client:d},s[8]=d,s[9]=v):v=s[9];const{data:_}=Lt(v),S=x?.connection_type==="VIRTUAL";let p;s[10]!==d||s[11]!==S?(p={client:d,enabled:S},s[10]=d,s[11]=S,s[12]=p):p=s[12];const{data:C,isLoading:w}=Et(p);let g;s[13]!==b?.prompts?(g=b?.prompts??[],s[13]=b?.prompts,s[14]=g):g=s[14];let k;s[15]!==g?(k=g.map(on),s[15]=g,s[16]=k):k=s[16];const I=k;let V;s[17]!==_?.resources?(V=_?.resources??[],s[17]=_?.resources,s[18]=V):V=s[18];let M;s[19]!==V?(M=V.map(nn),s[19]=V,s[20]=M):M=s[20];const L=M;let y;s[21]!==x?.tools||s[22]!==S||s[23]!==C?.tools?(y=S?(C?.tools??[]).map(sn):x?.tools??[],s[21]=x?.tools,s[22]=S,s[23]=C?.tools,s[24]=y):y=s[24];const R=y;let D;s[25]!==c.update||s[26]!==i?(D=async $=>{await c.update.mutateAsync({id:i,data:$})},s[25]=c.update,s[26]=i,s[27]=D):D=s[27];const N=D;if(!x){let $;return s[28]!==n||s[29]!==a?($=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(Z,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(Ue,{variant:"outline",onClick:()=>n({to:"/$org/$project/mcps",params:{org:a,project:ge}}),children:"Back to connections"})})}),s[28]=n,s[29]=a,s[30]=$):$=s[30],$}let A;return s[31]!==c.update.isPending||s[32]!==r||s[33]!==x||s[34]!==i||s[35]!==N||s[36]!==w||s[37]!==a||s[38]!==I||s[39]!==m||s[40]!==L||s[41]!==R?(A=t.jsx(Js,{org:a,connection:x,connectionId:i,requestedTabId:m,collections:r,onUpdate:N,isUpdating:c.update.isPending,prompts:I,resources:L,tools:R,isLoadingTools:w}),s[31]=c.update.isPending,s[32]=r,s[33]=x,s[34]=i,s[35]=N,s[36]=w,s[37]=a,s[38]=I,s[39]=m,s[40]=L,s[41]=R,s[42]=A):A=s[42],A}function sn(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,annotations:s.annotations,_meta:s._meta}}function nn(s){return{uri:s.uri,name:s.name,description:s.description}}function on(s){return{name:s.name,description:s.description}}function rn(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(ct,{children:t.jsx(K.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(Oe,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),s[0]=e):e=s[0],e}function Wo(){const s=U.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(rn,{}),s[0]=e):e=s[0],e}export{Wo as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as ge,j as t,E as yt,r as H,u as vt,x as Ct,e as Nt,d as bt,f as _t,y as kt,t as wt,q as St,b as Tt,B as O,O as Q,z as oe,w as J,o as ct,D as Dt,n as Y,_ as It}from"./index-DO8fUd54.js";import{g as Pt}from"./generate-id-Dyweu44Y.js";import{C as At}from"./collection-display-button-C0A6ba73.js";import{C as $t}from"./collection-search-Mtc1qP5K.js";import{T as Et,a as Ot,b as we,c as pe,d as zt,e as Lt}from"./table-DyNKuHyS.js";import{C as lt}from"./connection-card-DXMFAvSL.js";import{C as Te,i as Vt}from"./connection-status-COvhqytZ.js";import{E as $e}from"./empty-state-SBIKV11G.js";import{I as Ne}from"./integration-icon-BrOdBipR.js";import{P as ve}from"./index-B1uuY7UL.js";import{U as be}from"./user-6WV0RuBu.js";import{u as Ft}from"./use-binding-DSWv53zN.js";import{u as Bt}from"./use-list-state-DsQajLIu.js";import{f as Ut,e as Mt}from"./registry-utils-oSXyNc33.js";import{f as Oe,a as ze,b as Le,c as Ve,d as Fe,e as Be,A as Ue,h as Me}from"./alert-dialog-DtAWdTyc.js";import{B as Re}from"./badge-C4uZcq7J.js";import{B as Rt,a as Ht,b as Xt,c as Kt}from"./breadcrumb-pLMl4xjy.js";import{C as De}from"./checkbox-D2IG7klY.js";import{D as qe,a as Qe,b as Je,c as Ye,d as Ze,e as at}from"./dialog-CTFHRhvl.js";import{D as He,a as Xe,b as Ke,c as fe}from"./dropdown-menu-Cp0O2jCN.js";import{a as Wt,F as Z,b as ee,c as te,d as ne,f as se}from"./form-DPPO-3Tw.js";import{I as xe}from"./input-BM9bdg-F.js";import{S as Gt,a as qt,b as Qt,c as Jt,d as Ce}from"./select-RxUFw6pZ.js";import{T as Yt}from"./textarea-BLuscN8X.js";import{a as Zt,b as en}from"./use-connection-BNGXvSqD.js";import{u as ot,a as tn}from"./constants-B9t4Nuz_.js";import{b as nn}from"./use-mcp-tools-BCCglZve.js";import{b as sn}from"./use-virtual-mcp-DoDJBE5n.js";import{n as on}from"./ArrowDown-B5WC3D5H.js";import{i as rn}from"./ArrowUp-tKKJvEkq.js";import{t as cn}from"./ChevronDown-D0TXudCx.js";import{n as he}from"./Container-YdffBHg3.js";import{i as We}from"./DotsVertical-BaBvJOuP.js";import{s as Ge}from"./Eye-DDwMVcxZ.js";import{s as Ee}from"./Globe02-Cn3qFriL.js";import{i as ln}from"./Loading01-WTkiPysv.js";import{s as an}from"./Plus-Dto-8y6a.js";import{i as dn}from"./Terminal-BQ1GlFmm.js";import{s as Ie}from"./Trash01-DkXbOnbi.js";import{s as dt}from"./XClose-B0FgAxIQ.js";import{f as _e}from"./format-time-CMKyl-GC.js";import{r as mn,E as un,e as mt}from"./env-vars-editor-1feSU4JA.js";import"./Check-CuWDIJeM.js";import"./Grid01-Gq7hBl7S.js";import"./List-ySIwqood.js";import"./tooltip-BLTgyg7W.js";import"./index-COM-PDLy.js";import"./SearchMd-Kap2MdR9.js";import"./card-B4dTtsmd.js";import"./AlertCircle-5ZbLDi3s.js";import"./CheckCircle-wz1RfkCA.js";import"./use-local-storage-C3Bo802w.js";import"./useQuery-BeFLqBun.js";import"./useMutation-CNVq636e.js";import"./avatar-ChRCLY4k.js";import"./binder-hd3C3mvD.js";import"./use-view-mode-Bl6DaWwW.js";import"./use-mobile-kAkblq0-.js";import"./ChevronRight-UJRwW9xN.js";import"./X-CNbskBah.js";import"./label-CnT8WAQY.js";import"./ChevronUp-DXMXl76b.js";import"./use-collections-C8rLdQUN.js";import"./differenceInSeconds-NQ4PDo0z.js";function it(o){return o.title.trim().replace(/\s+\(\d+\)$/,"")}function pn(o){const e=new Map;for(const l of o){if(l.connection_type==="VIRTUAL")continue;const u=it(l),r=e.get(u);r?r.push(l):e.set(u,[l])}const n=[],c=new Set;for(const l of o){if(l.connection_type==="VIRTUAL")continue;const u=it(l);if(c.has(u))continue;c.add(u);const r=e.get(u),h=r[0];r.length===1?n.push({type:"single",connection:h}):n.push({type:"group",key:u,icon:h.icon,title:h.app_name?h.title.replace(/\s*\(\d+\)\s*$/,""):h.title,connections:r})}return n}function ut(o){const e=new Set,n=[];for(const c of o)c.created_by&&!e.has(c.created_by)&&(e.add(c.created_by),n.push(c.created_by));return n}function xn(o){let e=0,n=0,c=0;for(const l of o)l.connection_type!=="VIRTUAL"&&(l.status==="active"?e++:l.status==="error"?c++:n++);return{active:e,inactive:n,error:c,total:e+n+c}}const hn=ct({key:Y(),value:Y()}),fn=ct({title:Y().min(1,"Name is required"),description:Y().nullable().optional(),icon:Y().nullable().optional(),ui_type:It(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:Y().optional(),connection_token:Y().nullable().optional(),npx_package:Y().optional(),stdio_command:Y().optional(),stdio_args:Y().optional(),stdio_cwd:Y().optional(),env_vars:Dt(hn).optional()}).refine(o=>o.ui_type==="NPX"?!!o.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(o=>o.ui_type==="STDIO"?!!o.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(o=>o.ui_type==="HTTP"||o.ui_type==="SSE"||o.ui_type==="Websocket"?!!o.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function Pe(o){const e=o.trim();if(!e)return"";try{const n=new URL(e),c=n.pathname.length>1?n.pathname.replace(/\/+$/,""):n.pathname;return`${n.origin}${c}`}catch{return e.replace(/\/+$/,"")}}function gn(o){const e=o.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const n=e[0]?.toLowerCase();if(n!=="npx"&&n!=="bunx")return null;const l=e.slice(1).find(u=>!u.startsWith("-"));return l?{packageName:l}:null}function Se(o){const{uiType:e}=o,n=Pe(o.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&n===Pe("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 c=(o.npxPackage??"").trim();return e==="NPX"&&c==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function rt(o){if(o.registryItems.length===0||o.uiType!=="HTTP"&&o.uiType!=="SSE"&&o.uiType!=="Websocket")return null;const e=Pe(o.connectionUrl??"");if(!e)return null;const n=o.registryItems.find(u=>(u.server?.remotes??[]).some(h=>Pe(h.url??"")===e));if(!n)return null;const c=n.title||n.name||n.server?.title||n.server?.name||"",l=n.server?.description||n.description||n.summary||null;return c?{id:"registry",title:c,description:l}:null}function jn(o,e){const n={command:"npx",args:["-y",o]},c=mt(e);return Object.keys(c).length>0&&(n.envVars=c),n}function yn(o,e,n,c){const l={command:o};e.trim()&&(l.args=e.trim().split(/\s+/)),n?.trim()&&(l.cwd=n.trim());const u=mt(c);return Object.keys(u).length>0&&(l.envVars=u),l}function vn(o){return o.command==="npx"}function Cn(o){return o.args?.find(e=>!e.startsWith("-"))??""}function Nn(o){return{command:o.command,args:o.args?.join(" ")??"",cwd:o.cwd??""}}function bn(o,e){switch(e.type){case"edit":return{mode:"editing",connection:e.connection};case"delete":return{mode:"deleting",connection:e.connection};case"force-delete":return{mode:"force-deleting",connection:e.connection,agentNames:e.agentNames};case"close":return{mode:"idle"}}}function _n(o){const e=ge.c(107),{group:n,onNavigate:c,onDelete:l,selectionMode:u,selectedIds:r,onToggleSelect:h}=o,[C,d]=H.useState(!1);let f;if(e[0]!==n.connections||e[1]!==r){let $;e[3]!==r?($=E=>r.has(E.id),e[3]=r,e[4]=$):$=e[4],f=n.connections.every($),e[0]=n.connections,e[1]=r,e[2]=f}else f=e[2];const p=f;let T;if(e[5]!==n.connections||e[6]!==r){let $;e[8]!==r?($=E=>r.has(E.id),e[8]=r,e[9]=$):$=e[9],T=n.connections.some($),e[5]=n.connections,e[6]=r,e[7]=T}else T=e[7];const x=T;let j,y,w,_,N,I,A,z,U,b,k;if(e[10]!==p||e[11]!==n.connections||e[12]!==n.icon||e[13]!==n.title||e[14]!==h||e[15]!==r||e[16]!==u||e[17]!==x){const $=ut(n.connections),E=n.connections.reduce(Tn,n.connections[0]),de=E.updated_at??E.created_at;j=lt;const D=`${n.connections.length} instances`;e[29]!==n.icon||e[30]!==n.title||e[31]!==D?(U={title:n.title,icon:n.icon,description:D},e[29]=n.icon,e[30]=n.title,e[31]=D,e[32]=U):U=e[32],e[33]!==p||e[34]!==n.connections||e[35]!==h||e[36]!==r||e[37]!==u?(b=()=>u?(()=>{for(const R of n.connections)p?r.has(R.id)&&h(R.id):r.has(R.id)||h(R.id)})():d(!0),e[33]=p,e[34]=n.connections,e[35]=h,e[36]=r,e[37]=u,e[38]=b):b=e[38];const le=u&&p&&"ring-2 ring-primary",me=u&&x&&!p&&"ring-1 ring-primary/50";e[39]!==le||e[40]!==me?(k=oe(le,me),e[39]=le,e[40]=me,e[41]=k):k=e[41],e[42]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsx(he,{}),e[42]=y):y=e[42],e[43]!==p||e[44]!==n.connections||e[45]!==h||e[46]!==r||e[47]!==u||e[48]!==x?(w=u?t.jsx(De,{checked:p?!0:x?"indeterminate":!1,onCheckedChange:()=>{for(const R of n.connections)p?r.has(R.id)&&h(R.id):r.has(R.id)||h(R.id)}}):t.jsxs(Re,{variant:"secondary",className:"text-xs tabular-nums",children:["x",n.connections.length]}),e[43]=p,e[44]=n.connections,e[45]=h,e[46]=r,e[47]=u,e[48]=x,e[49]=w):w=e[49];let ue;e[50]!==n.connections?(ue=n.connections.slice(0,6).map(Sn),e[50]=n.connections,e[51]=ue):ue=e[51],e[52]!==ue?(_=t.jsx("div",{className:"flex items-center gap-1",children:ue}),e[52]=ue,e[53]=_):_=e[53],A="flex items-center justify-between text-xs text-muted-foreground w-full min-w-0";const je=$.map(R=>t.jsx(be,{id:R,size:"3xs",avatarOnly:$.length>1},R));e[54]!==je?(z=t.jsx("div",{className:"flex items-center -space-x-1.5",children:je}),e[54]=je,e[55]=z):z=e[55],N="shrink-0 ml-2",I=de?_e(new Date(de)):"—",e[10]=p,e[11]=n.connections,e[12]=n.icon,e[13]=n.title,e[14]=h,e[15]=r,e[16]=u,e[17]=x,e[18]=j,e[19]=y,e[20]=w,e[21]=_,e[22]=N,e[23]=I,e[24]=A,e[25]=z,e[26]=U,e[27]=b,e[28]=k}else j=e[18],y=e[19],w=e[20],_=e[21],N=e[22],I=e[23],A=e[24],z=e[25],U=e[26],b=e[27],k=e[28];let v;e[56]!==N||e[57]!==I?(v=t.jsx("span",{className:N,children:I}),e[56]=N,e[57]=I,e[58]=v):v=e[58];let M;e[59]!==v||e[60]!==A||e[61]!==z?(M=t.jsxs("div",{className:A,children:[z,v]}),e[59]=v,e[60]=A,e[61]=z,e[62]=M):M=e[62];let V;e[63]!==j||e[64]!==y||e[65]!==w||e[66]!==_||e[67]!==M||e[68]!==U||e[69]!==b||e[70]!==k?(V=t.jsx(j,{connection:U,onClick:b,className:k,fallbackIcon:y,headerActions:w,body:_,footer:M}),e[63]=j,e[64]=y,e[65]=w,e[66]=_,e[67]=M,e[68]=U,e[69]=b,e[70]=k,e[71]=V):V=e[71];let X;e[72]===Symbol.for("react.memo_cache_sentinel")?(X=t.jsx(he,{}),e[72]=X):X=e[72];let K;e[73]!==n.icon||e[74]!==n.title?(K=t.jsx(Ne,{icon:n.icon,name:n.title,size:"md",className:"shrink-0 shadow-sm",fallbackIcon:X}),e[73]=n.icon,e[74]=n.title,e[75]=K):K=e[75];let W;e[76]!==n.connections.length?(W=t.jsxs(Re,{variant:"secondary",className:"ml-2 text-xs tabular-nums",children:["x",n.connections.length]}),e[76]=n.connections.length,e[77]=W):W=e[77];let g;e[78]!==n.title||e[79]!==W?(g=t.jsxs(Ye,{children:[n.title,W]}),e[78]=n.title,e[79]=W,e[80]=g):g=e[80];let S;e[81]!==n.connections.length?(S=t.jsxs(Ze,{children:[n.connections.length," installed instances"]}),e[81]=n.connections.length,e[82]=S):S=e[82];let L;e[83]!==g||e[84]!==S?(L=t.jsxs("div",{children:[g,S]}),e[83]=g,e[84]=S,e[85]=L):L=e[85];let ie;e[86]!==K||e[87]!==L?(ie=t.jsx(Je,{className:"px-6 pt-6 pb-4",children:t.jsxs("div",{className:"flex items-center gap-3",children:[K,L]})}),e[86]=K,e[87]=L,e[88]=ie):ie=e[88];let re;if(e[89]!==n.connections||e[90]!==l||e[91]!==c){let $;e[93]!==l||e[94]!==c?($=E=>t.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 hover:bg-muted/30 cursor-pointer transition-colors",onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ne,{icon:E.icon,name:E.title,size:"sm",className:"shrink-0",fallbackIcon:t.jsx(he,{})}),t.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:E.title}),t.jsx(Te,{status:E.status})]}),t.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground shrink-0",children:[t.jsx(be,{id:E.created_by,size:"3xs"}),t.jsx("span",{children:E.created_at?_e(new Date(E.created_at)):"—"})]}),t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 w-7 p-0",onClick:wn,children:t.jsx(We,{size:16})})}),t.jsxs(Ke,{align:"end",onClick:kn,children:[t.jsxs(fe,{onClick:()=>{d(!1),c(E.id)},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:()=>l(E),children:[t.jsx(Ie,{size:16}),"Delete"]})]})]})]},E.id),e[93]=l,e[94]=c,e[95]=$):$=e[95],re=n.connections.map($),e[89]=n.connections,e[90]=l,e[91]=c,e[92]=re}else re=e[92];let ae;e[96]!==re?(ae=t.jsx("div",{className:"divide-y max-h-80 overflow-auto",children:re}),e[96]=re,e[97]=ae):ae=e[97];let ce;e[98]!==ie||e[99]!==ae?(ce=t.jsxs(Qe,{className:"sm:max-w-lg p-0 gap-0",children:[ie,ae]}),e[98]=ie,e[99]=ae,e[100]=ce):ce=e[100];let m;e[101]!==C||e[102]!==ce?(m=t.jsx(qe,{open:C,onOpenChange:d,children:ce}),e[101]=C,e[102]=ce,e[103]=m):m=e[103];let F;return e[104]!==V||e[105]!==m?(F=t.jsxs(t.Fragment,{children:[V,m]}),e[104]=V,e[105]=m,e[106]=F):F=e[106],F}function kn(o){return o.stopPropagation()}function wn(o){return o.stopPropagation()}function Sn(o){return t.jsx(Te,{status:o.status},o.id)}function Tn(o,e){const n=e.updated_at??e.created_at,c=o.updated_at??o.created_at;return n?c?new Date(n)>new Date(c)?e:o:e:o}function Dn(o){const e=ge.c(28),{count:n,total:c,onSelectAll:l,onDeselectAll:u,onDelete:r,onAddToAgent:h,onToggleStatus:C,onCancel:d}=o;if(n===0)return null;let f;e[0]!==n?(f=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=f):f=e[1];let p;e[2]!==n||e[3]!==u||e[4]!==l||e[5]!==c?(p=n<c?t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:l,children:["Select all (",c,")"]}):t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:u,children:"Clear selection"}),e[2]=n,e[3]=u,e[4]=l,e[5]=c,e[6]=p):p=e[6];let T;e[7]===Symbol.for("react.memo_cache_sentinel")?(T=t.jsx(an,{size:13}),e[7]=T):T=e[7];let x;e[8]!==h?(x=t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:h,children:[T,"Add to Agent"]}),e[8]=h,e[9]=x):x=e[9];let j;e[10]!==C?(j=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>C("active"),children:"Enable"}),e[10]=C,e[11]=j):j=e[11];let y;e[12]!==C?(y=t.jsx(O,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>C("inactive"),children:"Disable"}),e[12]=C,e[13]=y):y=e[13];let w;e[14]===Symbol.for("react.memo_cache_sentinel")?(w=t.jsx(Ie,{size:13}),e[14]=w):w=e[14];let _;e[15]!==r?(_=t.jsxs(O,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:r,children:[w,"Delete"]}),e[15]=r,e[16]=_):_=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(dt,{size:13}),e[17]=N):N=e[17];let I;e[18]!==d?(I=t.jsx(O,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:N}),e[18]=d,e[19]=I):I=e[19];let A;return e[20]!==f||e[21]!==I||e[22]!==p||e[23]!==x||e[24]!==j||e[25]!==y||e[26]!==_?(A=t.jsx("div",{className:"fixed bottom-4 left-1/2 z-50 -translate-x-1/2",children:t.jsxs("div",{className:"rounded-xl border border-border bg-background/95 shadow-lg backdrop-blur px-3 py-2 flex items-center gap-2",children:[f,p,x,j,y,_,I]})}),e[20]=f,e[21]=I,e[22]=p,e[23]=x,e[24]=j,e[25]=y,e[26]=_,e[27]=A):A=e[27],A}function In(o){const e=ge.c(25),{open:n,onOpenChange:c,agents:l,onConfirm:u}=o,[r,h]=H.useState(null);let C;e[0]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsxs(Je,{children:[t.jsx(Ye,{children:"Add to Agent"}),t.jsx(Ze,{children:"Select an agent to add the selected connections to."})]}),e[0]=C):C=e[0];let d;e[1]!==l||e[2]!==r?(d=l.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):l.map(N=>t.jsxs("button",{type:"button",onClick:()=>h(N.id),className:oe("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",r===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(Ne,{icon:N.icon,name:N.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:N.title}),N.description&&t.jsx("p",{className:"text-xs text-muted-foreground truncate",children:N.description})]})]},N.id)),e[1]=l,e[2]=r,e[3]=d):d=e[3];let f;e[4]!==d?(f=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:d}),e[4]=d,e[5]=f):f=e[5];let p;e[6]!==c?(p=t.jsx(O,{variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e[6]=c,e[7]=p):p=e[7];const T=!r;let x;e[8]!==u||e[9]!==c||e[10]!==r?(x=()=>{r&&(u(r),c(!1),h(null))},e[8]=u,e[9]=c,e[10]=r,e[11]=x):x=e[11];let j;e[12]!==T||e[13]!==x?(j=t.jsx(O,{disabled:T,onClick:x,children:"Add"}),e[12]=T,e[13]=x,e[14]=j):j=e[14];let y;e[15]!==p||e[16]!==j?(y=t.jsxs(at,{children:[p,j]}),e[15]=p,e[16]=j,e[17]=y):y=e[17];let w;e[18]!==f||e[19]!==y?(w=t.jsxs(Qe,{className:"sm:max-w-[400px]",children:[C,f,y]}),e[18]=f,e[19]=y,e[20]=w):w=e[20];let _;return e[21]!==c||e[22]!==n||e[23]!==w?(_=t.jsx(qe,{open:n,onOpenChange:c,children:w}),e[21]=c,e[22]=n,e[23]=w,e[24]=_):_=e[24],_}function Pn(o){const e=ge.c(20),{open:n,onOpenChange:c,count:l,onConfirm:u}=o,r=l!==1?"s":"";let h;e[0]!==l||e[1]!==r?(h=t.jsxs(Ve,{children:["Delete ",l," connection",r,"?"]}),e[0]=l,e[1]=r,e[2]=h):h=e[2];const C=l!==1?"s":"";let d;e[3]!==C?(d=t.jsxs(Fe,{children:["This will permanently delete the selected connection",C,". This action cannot be undone."]}),e[3]=C,e[4]=d):d=e[4];let f;e[5]!==h||e[6]!==d?(f=t.jsxs(Le,{children:[h,d]}),e[5]=h,e[6]=d,e[7]=f):f=e[7];let p;e[8]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx(Ue,{children:"Cancel"}),e[8]=p):p=e[8];const T=l!==1?"s":"";let x;e[9]!==l||e[10]!==u||e[11]!==T?(x=t.jsxs(Be,{children:[p,t.jsxs(Me,{onClick:u,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",l," connection",T]})]}),e[9]=l,e[10]=u,e[11]=T,e[12]=x):x=e[12];let j;e[13]!==f||e[14]!==x?(j=t.jsxs(ze,{children:[f,x]}),e[13]=f,e[14]=x,e[15]=j):j=e[15];let y;return e[16]!==c||e[17]!==n||e[18]!==j?(y=t.jsx(Oe,{open:n,onOpenChange:c,children:j}),e[16]=c,e[17]=n,e[18]=j,e[19]=y):y=e[19],y}function An(o){const e=ge.c(37),{columns:n,grouped:c,sortKey:l,sortDirection:u,onSort:r,onRowClick:h,selectionMode:C,selectedIds:d,onToggleSelect:f,emptyState:p}=o;let T;e[0]===Symbol.for("react.memo_cache_sentinel")?(T=new Set,e[0]=T):T=e[0];const[x,j]=H.useState(T);let y;e[1]===Symbol.for("react.memo_cache_sentinel")?(y=b=>{j(k=>{const v=new Set(k);return v.has(b)?v.delete(b):v.add(b),v})},e[1]=y):y=e[1];const w=y;if(c.length===0&&p){let b;return e[2]!==p?(b=t.jsx("div",{className:"flex items-center justify-center h-full",children:p}),e[2]=p,e[3]=b):b=e[3],b}const _=n.length;let N;if(e[4]!==_||e[5]!==n||e[6]!==r||e[7]!==u||e[8]!==l){let b;e[10]!==_||e[11]!==r||e[12]!==u||e[13]!==l?(b=(k,v)=>{const M=l===k.id,V=v===_-1;return t.jsx(Et,{className:oe("px-4 py-2 text-left font-mono font-normal text-muted-foreground text-[11px] h-9 uppercase tracking-wider",V&&"w-8","group transition-colors select-none",k.sortable&&"hover:bg-accent cursor-pointer",k.cellClassName),onClick:k.sortable&&r?()=>r(k.id):void 0,children:t.jsxs("span",{className:"flex items-center gap-1",children:[k.header,k.sortable&&t.jsx("span",{className:"w-4 flex items-center justify-center",children:M&&u&&(u==="asc"?t.jsx(rn,{size:16,className:"text-muted-foreground"}):t.jsx(on,{size:16,className:"text-muted-foreground"}))})]})},k.id)},e[10]=_,e[11]=r,e[12]=u,e[13]=l,e[14]=b):b=e[14],N=n.map(b),e[4]=_,e[5]=n,e[6]=r,e[7]=u,e[8]=l,e[9]=N}else N=e[9];let I;e[15]!==N?(I=t.jsx(Ot,{className:"border-b-0",children:t.jsx(we,{className:"h-9 hover:bg-transparent border-b border-border",children:N})}),e[15]=N,e[16]=I):I=e[16];let A;if(e[17]!==n||e[18]!==x||e[19]!==c||e[20]!==h||e[21]!==f||e[22]!==d||e[23]!==C){let b;e[25]!==n||e[26]!==x||e[27]!==h||e[28]!==f||e[29]!==d||e[30]!==C?(b=k=>{if(k.type==="single"){const g=k.connection;return t.jsx(we,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer",C&&d.has(g.id)&&"bg-primary/5"),onClick:()=>h(g),children:n.map(S=>t.jsx(pe,{className:oe("px-5 py-4 h-16 align-middle text-sm text-foreground",S.cellClassName),children:t.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:S.render?S.render(g):null})},S.id))},g.id)}const v=k,M=x.has(v.key),V=v.connections.every(g=>d.has(g.id)),X=v.connections.some(g=>d.has(g.id)),K=ut(v.connections),W=v.connections.reduce(En,v.connections[0]);return t.jsxs(H.Fragment,{children:[t.jsx(we,{className:"border-b-0 hover:bg-accent/50 cursor-pointer transition-colors",onClick:()=>w(v.key),children:n.map(g=>{const S=oe("px-5 py-3 h-14 align-middle text-sm",g.cellClassName);if(g.id==="select")return t.jsx(pe,{className:S,children:t.jsx(De,{checked:V?!0:X?"indeterminate":!1,onCheckedChange:()=>{for(const L of v.connections)V?d.has(L.id)&&f(L.id):d.has(L.id)||f(L.id)},onClick:$n})},g.id);if(g.id==="title")return t.jsx(pe,{className:S,children:t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Ne,{icon:v.icon,name:v.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(he,{})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:v.title}),t.jsxs(Re,{variant:"secondary",className:"text-xs tabular-nums",children:["x",v.connections.length]})]})},g.id);if(g.id==="updated_by")return t.jsx(pe,{className:S,children:t.jsx("div",{className:"flex items-center -space-x-1.5",children:K.map(L=>t.jsx(be,{id:L,size:"3xs",avatarOnly:K.length>1},L))})},g.id);if(g.id==="updated_at"){const L=W.updated_at??W.created_at;return t.jsx(pe,{className:S,children:t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:L?_e(new Date(L)):"—"})},g.id)}return g.id==="actions"?t.jsx(pe,{className:S,children:t.jsx(cn,{size:16,className:oe("text-muted-foreground transition-transform",M&&"rotate-180")})},g.id):t.jsx(pe,{className:S},g.id)})}),M&&v.connections.map(g=>t.jsx(we,{className:oe("group/data-row transition-colors border-b-0 hover:bg-accent/50 cursor-pointer bg-muted/20",C&&d.has(g.id)&&"bg-primary/5"),onClick:()=>h(g),children:n.map(S=>t.jsx(pe,{className:oe("px-5 py-3 h-14 align-middle text-sm text-foreground",S.cellClassName,S.id==="title"&&"pl-12"),children:t.jsx("div",{className:"min-w-0 w-full truncate overflow-hidden whitespace-nowrap",children:S.render?S.render(g):null})},S.id))},g.id))]},v.key)},e[25]=n,e[26]=x,e[27]=h,e[28]=f,e[29]=d,e[30]=C,e[31]=b):b=e[31],A=c.map(b),e[17]=n,e[18]=x,e[19]=c,e[20]=h,e[21]=f,e[22]=d,e[23]=C,e[24]=A}else A=e[24];let z;e[32]!==A?(z=t.jsx(zt,{children:A}),e[32]=A,e[33]=z):z=e[33];let U;return e[34]!==I||e[35]!==z?(U=t.jsx("div",{className:"flex-1 overflow-auto",children:t.jsxs(Lt,{className:"w-full border-collapse",children:[I,z]})}),e[34]=I,e[35]=z,e[36]=U):U=e[36],U}function $n(o){return o.stopPropagation()}function En(o,e){const n=e.updated_at??e.created_at,c=o.updated_at??o.created_at;return n?c?new Date(n)>new Date(c)?e:o:e:o}function On(){const{org:o}=vt(),e=Ct(),n=Nt(),c=bt({strict:!1}),{data:l}=_t.useSession(),{stdioEnabled:u}=kt(),r=Bt({namespace:o.slug,resource:"connections"}),h=Zt(),C=en(r),[d,f]=H.useReducer(bn,{mode:"idle"}),[p,T]=H.useState(!1),[x,j]=H.useState(new Set),[y,w]=H.useState(!1),[_,N]=H.useState(!1),[I,A]=H.useState("ALL"),[z,U]=H.useState("ALL"),b=sn(),k=C.filter(s=>!(s.connection_type==="VIRTUAL"||I!=="ALL"&&s.connection_type!==I||z!=="ALL"&&s.status!==z)),v=xn(C),M=pn(k),V=s=>{j(i=>{const a=new Set(i);return a.has(s)?a.delete(s):a.add(s),a})},X=()=>{T(!1),j(new Set)},K=Ft(C)[0],W=K?.id??"",g=Ut(K?.tools),S=ot({connectionId:W||null,orgId:o.id}),{data:L}=nn({client:S,toolName:g,toolArguments:{limit:200},enabled:!!(W&&g),staleTime:3600*1e3,select:s=>s.structuredContent??s}),ie=Mt(L??[]),re=c.action==="create",ae=()=>{n({to:"/$org/$project/mcps",params:{org:o.slug,project:Q},search:{action:"create"}})},ce=()=>{n({to:"/$org/$project/mcps",params:{org:o.slug,project:Q},search:{}})},m=wt({resolver:St(fn),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),F=m.watch("ui_type"),$=m.watch("connection_url"),E=m.watch("npx_package"),de=Se({uiType:F,connectionUrl:$??"",npxPackage:E??""})??rt({uiType:F,connectionUrl:$??"",registryItems:ie}),D=d.mode==="editing"?d.connection:null;H.useEffect(()=>{if(D){const s=Tt(D.connection_headers)?D.connection_headers:null;if(s&&D.connection_type==="STDIO"){const i=mn(s.envVars);if(vn(s)){const a=Cn(s);m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:a,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:i})}else{const a=Nn(s);m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:a.command,stdio_args:a.args,stdio_cwd:a.cwd,env_vars:i})}}else m.reset({title:D.title,description:D.description,icon:D.icon??null,ui_type:D.connection_type,connection_url:D.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})}else m.reset({title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]})},[D,m]);const le=ot({connectionId:tn,orgId:o.id}),me=()=>{e.invalidateQueries({predicate:s=>{const i=s.queryKey;return i[1]===o.id&&i[3]==="collection"&&i[4]==="CONNECTIONS"}})},ue=async()=>{w(!1);const s=[...x];let i=0;for(const a of s)try{(await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:a,force:!0}})).isError||i++}catch{}me(),J.success(`Deleted ${i} connection${i!==1?"s":""}`),X()},je=async s=>{const i=[...x];let a=0;for(const B of i)try{await h.update.mutateAsync({id:B,data:{status:s}}),a++}catch{}me(),J.success(`${s==="active"?"Enabled":"Disabled"} ${a} connection${a!==1?"s":""}`),X()},R=async s=>{const i=b.find(P=>P.id===s);if(!i||!le)return;const a=new Set(i.connections.map(P=>P.connection_id)),B=[...x].filter(P=>!a.has(P)).map(P=>({connection_id:P,selected_tools:null,selected_resources:null,selected_prompts:null}));if(B.length===0){J.info("All selected connections are already in that agent");return}try{await le.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:s,data:{connections:[...i.connections,...B]}}}),e.invalidateQueries({predicate:P=>{const G=P.queryKey;return G[1]===o.id&&G[3]==="collection"&&G[4]==="VIRTUAL_MCP"}}),J.success(`Added ${B.length} connection${B.length!==1?"s":""} to "${i.title}"`),X()}catch{J.error("Failed to add connections to agent")}},et=s=>{const i=s.content;return Array.isArray(i)&&i[0]?.type==="text"&&typeof i[0].text=="string"?i[0].text:"Unknown error"},pt=async()=>{if(d.mode!=="deleting")return;const s=d.connection;f({type:"close"});try{const i=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s.id}});if(i.isError){const a=et(i),B=a.replace(/^Error:\s*/,"");try{const P=JSON.parse(B);if(P.code==="CONNECTION_IN_USE"&&P.agentNames){f({type:"force-delete",connection:s,agentNames:P.agentNames.map(G=>`"${G}"`).join(", ")});return}}catch{}J.error(`Failed to delete connection: ${a}`);return}me(),J.success("Connection deleted successfully")}catch(i){const a=i instanceof Error?i.message:String(i);J.error(`Failed to delete connection: ${a}`)}},xt=async()=>{if(d.mode!=="force-deleting")return;const s=d.connection.id;f({type:"close"});try{const i=await le.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:s,force:!0}});if(i.isError){J.error(`Failed to delete connection: ${et(i)}`);return}me(),J.success("Connection deleted successfully")}catch(i){const a=i instanceof Error?i.message:String(i);J.error(`Failed to delete connection: ${a}`)}},ht=async s=>{let i,a=null,B=null,P=null;if(s.ui_type==="NPX"?(i="STDIO",a="",P=jn(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(i="STDIO",a="",P=yn(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(i=s.ui_type,a=s.connection_url||"",B=s.connection_token||null),D){await h.update.mutateAsync({id:D.id,data:{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:i,connection_url:a,...B&&{connection_token:B},...P&&{connection_headers:P}}}),f({type:"close"}),m.reset();return}const G=Pt("conn");await h.create.mutateAsync({id:G,title:s.title,description:s.description||null,connection_type:i,connection_url:a,connection_token:B,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:l?.user?.id||"system",organization_id:o.id,icon:s.icon??null,app_name:null,app_id:null,connection_headers:P,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),ce(),m.reset(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:G}})},tt=s=>{s||(re?ce():f({type:"close"}),m.reset())},ke=s=>{const i=s.trim();if(!i)return;const a=!!m.formState.dirtyFields.title,B=!!m.formState.dirtyFields.description,P=!!m.formState.dirtyFields.env_vars,G=q=>{if(q&&(!a&&!m.getValues("title").trim()&&q.title&&m.setValue("title",q.title,{shouldDirty:!1}),!B&&!(m.getValues("description")??"").trim()&&q.description&&m.setValue("description",q.description,{shouldDirty:!1}),!P&&q.envVarKeys?.length)){const nt=m.getValues("env_vars")??[],jt=new Set(nt.map(ye=>ye.key)),st=q.envVarKeys.filter(ye=>!jt.has(ye));st.length>0&&m.setValue("env_vars",[...nt,...st.map(ye=>({key:ye,value:""}))],{shouldDirty:!0})}},Ae=gn(i);if(Ae&&u){m.setValue("ui_type","NPX",{shouldDirty:!0}),m.setValue("npx_package",Ae.packageName,{shouldDirty:!0}),m.setValue("connection_url","",{shouldDirty:!0}),m.setValue("connection_token",null,{shouldDirty:!0}),G(Se({uiType:"NPX",npxPackage:Ae.packageName}));return}if(i.startsWith("http://")||i.startsWith("https://")){const q=F==="HTTP"||F==="SSE"||F==="Websocket"?F:"HTTP";m.setValue("ui_type",q,{shouldDirty:!0}),m.setValue("connection_url",i,{shouldDirty:!0}),G(Se({uiType:q,connectionUrl:i})??rt({uiType:q,connectionUrl:i,registryItems:ie}));return}F==="NPX"&&G(Se({uiType:"NPX",npxPackage:i}))},ft=[...p?[{id:"select",header:"",render:s=>t.jsx(De,{checked:x.has(s.id),onCheckedChange:()=>V(s.id),onClick:i=>i.stopPropagation()}),cellClassName:"w-10 shrink-0"}]:[],{id:"title",header:"Name",render:s=>t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx(Ne,{icon:s.icon,name:s.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:t.jsx(he,{})}),t.jsx("span",{className:"text-sm font-medium text-foreground truncate block",title:s.title,children:s.title})]}),cellClassName:"w-32 min-w-0 shrink-0",sortable:!0},{id:"description",header:"Description",render:s=>t.jsx("span",{className:"text-sm text-muted-foreground truncate block",title:s.description||"",children:s.description||"—"}),cellClassName:"flex-1 min-w-0 max-w-0",wrap:!1,sortable:!0},{id:"connection_type",header:"Type",accessor:s=>t.jsx("span",{className:"text-xs font-medium",children:s.connection_type}),cellClassName:"w-16 shrink-0",sortable:!0},{id:"status",header:"Status",render:s=>t.jsx(Te,{status:s.status}),cellClassName:"w-28 shrink-0",sortable:!1},{id:"updated_by",header:"Updated by",render:s=>t.jsx(be,{id:s.updated_by??s.created_by,size:"3xs"}),cellClassName:"w-32 shrink-0",sortable:!0},{id:"updated_at",header:"Updated",render:s=>t.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:s.updated_at?_e(new Date(s.updated_at)):"—"}),cellClassName:"max-w-24 w-24 shrink-0",sortable:!0},{id:"actions",header:"",render:s=>t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:i=>i.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(Ke,{align:"end",onClick:i=>i.stopPropagation(),children:[t.jsxs(fe,{onClick:i=>{i.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:s.id}})},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:i=>{i.stopPropagation(),f({type:"delete",connection:s})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),cellClassName:"w-12 shrink-0"}],gt=t.jsx("div",{className:"flex items-center gap-2",children:p?t.jsxs(O,{variant:"ghost",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:X,children:[t.jsx(dt,{size:14}),"Cancel"]}):t.jsxs(t.Fragment,{children:[t.jsxs(O,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",onClick:()=>T(!0),children:[t.jsx(Vt,{size:14}),"Select"]}),t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Browse Store"}),t.jsx(O,{onClick:ae,size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",children:"Custom Connection"})]})});return t.jsxs(ve,{children:[t.jsx(qe,{open:re||d.mode==="editing",onOpenChange:tt,children:t.jsxs(Qe,{className:"sm:max-w-[525px]",children:[t.jsxs(Je,{children:[t.jsx(Ye,{children:D?"Edit Connection":"Create Connection"}),t.jsx(Ze,{children:D?"Update the connection details below.":"Create a custom connection in your organization. Fill in the details below."})]}),t.jsx(Wt,{...m,children:t.jsxs("form",{onSubmit:m.handleSubmit(ht),children:[t.jsxs("div",{className:"grid gap-4 py-4",children:[t.jsx(Z,{control:m.control,name:"ui_type",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Type *"}),t.jsxs(Gt,{value:s.value,onValueChange:s.onChange,children:[t.jsx(ne,{children:t.jsx(qt,{children:t.jsx(Qt,{})})}),t.jsxs(Jt,{children:[t.jsx(Ce,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(Ce,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(Ce,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ee,{className:"w-4 h-4"}),"Websocket"]})}),u&&t.jsxs(t.Fragment,{children:[t.jsx(Ce,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(he,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(Ce,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(dn,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(se,{})]})}),F==="NPX"&&t.jsx(t.Fragment,{children:t.jsx(Z,{control:m.control,name:"npx_package",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"NPM Package *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"@perplexity-ai/mcp-server",...s,value:s.value??"",onPaste:i=>{const a=i.clipboardData.getData("text");a&&(i.preventDefault(),m.setValue("npx_package",a.trim(),{shouldDirty:!0}),ke(a))},onBlur:i=>{ke(i.target.value),s.onBlur()}})}),t.jsx(se,{})]})})}),F==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Z,{control:m.control,name:"stdio_command",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Command *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"node, bun, python...",...s,value:s.value??""})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"stdio_args",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Arguments"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"arg1 arg2 --flag value",...s,value:s.value??""})}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:m.control,name:"stdio_cwd",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Working Directory"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"/path/to/project (optional)",...s,value:s.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(se,{})]})})]}),(F==="NPX"||F==="STDIO")&&t.jsx(Z,{control:m.control,name:"env_vars",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Environment Variables"}),t.jsx(ne,{children:t.jsx(un,{value:s.value??[],onChange:s.onChange})}),t.jsx(se,{})]})}),F!=="NPX"&&F!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Z,{control:m.control,name:"connection_url",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"URL *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"https://example.com/mcp",...s,value:s.value??"",onPaste:i=>{const a=i.clipboardData.getData("text");a&&(i.preventDefault(),m.setValue("connection_url",a.trim(),{shouldDirty:!0}),ke(a))},onBlur:i=>{ke(i.target.value),s.onBlur()}})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"connection_token",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:de?.token?.label??"Token (optional)"}),t.jsx(ne,{children:t.jsx(xe,{type:"password",placeholder:de?.token?.placeholder??"Bearer token or API key",...s,value:s.value??""})}),de?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[de.token.helperText,de.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:"Open GitHub PAT settings"})]})]}),t.jsx(se,{})]})})]}),t.jsx(Z,{control:m.control,name:"title",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Name *"}),t.jsx(ne,{children:t.jsx(xe,{placeholder:"My Connection",...s})}),t.jsx(se,{})]})}),t.jsx(Z,{control:m.control,name:"description",render:({field:s})=>t.jsxs(ee,{children:[t.jsx(te,{children:"Description"}),t.jsx(ne,{children:t.jsx(Yt,{placeholder:"A brief description of this connection",rows:3,...s,value:s.value??""})}),t.jsx(se,{})]})})]}),t.jsxs(at,{children:[t.jsx(O,{type:"button",variant:"outline",onClick:()=>tt(!1),children:"Cancel"}),t.jsx(O,{type:"submit",disabled:m.formState.isSubmitting,className:"min-w-40",children:m.formState.isSubmitting?"Saving...":D?"Update Connection":"Create Connection"})]})]})})]})}),t.jsx(Oe,{open:d.mode==="deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(ze,{children:[t.jsxs(Le,{children:[t.jsx(Ve,{children:"Delete Connection?"}),t.jsxs(Fe,{children:["This action cannot be undone. This will permanently delete"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="deleting"&&d.connection.title}),"."]})]}),t.jsxs(Be,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(Me,{onClick:pt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})}),t.jsx(Oe,{open:d.mode==="force-deleting",onOpenChange:s=>!s&&f({type:"close"}),children:t.jsxs(ze,{children:[t.jsxs(Le,{children:[t.jsx(Ve,{children:"Connection Used by Agents"}),t.jsx(Fe,{asChild:!0,children:t.jsxs("div",{children:[t.jsxs("p",{children:["The connection"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.connection.title})," ","is currently used by the following agent(s):"," ",t.jsx("span",{className:"font-medium text-foreground",children:d.mode==="force-deleting"&&d.agentNames}),"."]}),t.jsx("p",{className:"mt-2",children:"Deleting this connection will remove it from those agents, which may impact existing workflows that depend on them."})]})})]}),t.jsxs(Be,{children:[t.jsx(Ue,{children:"Cancel"}),t.jsx(Me,{onClick:xt,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Anyway"})]})]})}),t.jsx(Pn,{open:y,onOpenChange:w,count:x.size,onConfirm:ue}),t.jsx(In,{open:_,onOpenChange:N,agents:b,onConfirm:R}),t.jsxs(ve.Header,{children:[t.jsx(ve.Header.Left,{children:t.jsx(Rt,{children:t.jsx(Ht,{children:t.jsx(Xt,{children:t.jsxs(Kt,{className:"flex items-center gap-2",children:["Connections",t.jsxs("span",{className:"text-xs font-normal text-muted-foreground tabular-nums",children:[v.total," total",v.active>0&&` · ${v.active} active`,v.error>0&&` · ${v.error} errors`]})]})})})})}),t.jsxs(ve.Header.Right,{children:[t.jsx(At,{viewMode:r.viewMode,onViewModeChange:r.setViewMode,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,sortOptions:[{id:"title",label:"Name"},{id:"description",label:"Description"},{id:"connection_type",label:"Type"},{id:"updated_by",label:"Updated by"},{id:"updated_at",label:"Updated"}],filters:[{label:"Type",value:I,onChange:s=>A(s||"ALL"),options:[{id:"ALL",label:"All"},{id:"HTTP",label:"HTTP"},{id:"SSE",label:"SSE"},{id:"Websocket",label:"WebSocket"},{id:"STDIO",label:"STDIO"}]},{label:"Status",value:z,onChange:s=>U(s||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]}]}),gt]})]}),t.jsx("div",{className:"flex items-center gap-3 px-5 pb-0",children:t.jsx("div",{className:"flex-1",children:t.jsx($t,{value:r.search,onChange:r.setSearch,placeholder:"Search for a Connection...",onKeyDown:s=>{s.key==="Escape"&&(r.setSearch(""),s.target.blur())}})})}),t.jsx(ve.Content,{children:r.viewMode==="cards"?t.jsx("div",{className:"flex-1 overflow-auto p-5",children:k.length===0?t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:r.search?`No Connections match "${r.search}"`:"Create a connection to get started.",actions:!r.search&&t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),children:"Browse Store"})}):t.jsx("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:M.map(s=>{if(s.type==="group")return t.jsx(_n,{group:s,onNavigate:a=>n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:a}}),onDelete:a=>f({type:"delete",connection:a}),selectionMode:p,selectedIds:x,onToggleSelect:V},s.key);const i=s.connection;return t.jsxs("div",{className:"relative",children:[p&&t.jsx("div",{className:"absolute top-3 left-3 z-10",children:t.jsx(De,{checked:x.has(i.id),onCheckedChange:()=>V(i.id)})}),t.jsx(lt,{connection:i,fallbackIcon:t.jsx(he,{}),onClick:()=>p?V(i.id):n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:i.id}}),className:oe(p&&x.has(i.id)&&"ring-2 ring-primary"),headerActions:p?void 0:t.jsxs(He,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(O,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:a=>a.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(Ke,{align:"end",onClick:a=>a.stopPropagation(),children:[t.jsxs(fe,{onClick:a=>{a.stopPropagation(),n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:i.id}})},children:[t.jsx(Ge,{size:16}),"Open"]}),t.jsxs(fe,{variant:"destructive",onClick:a=>{a.stopPropagation(),f({type:"delete",connection:i})},children:[t.jsx(Ie,{size:16}),"Delete"]})]})]}),body:t.jsx(Te,{status:i.status}),footer:t.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground w-full min-w-0",children:[t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx(be,{id:i.updated_by??i.created_by,size:"3xs"})}),t.jsx("span",{className:"shrink-0 ml-2",children:i.updated_at?_e(new Date(i.updated_at)):"—"})]})})]},i.id)})})}):t.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:t.jsx("div",{className:"flex-1 overflow-auto min-w-0",children:t.jsx("div",{className:"min-w-[1000px]",children:t.jsx(An,{columns:ft,grouped:M,sortKey:r.sortKey,sortDirection:r.sortDirection,onSort:r.handleSort,onRowClick:s=>p?V(s.id):n({to:"/$org/$project/mcps/$connectionId",params:{org:o.slug,project:Q,connectionId:s.id}}),selectionMode:p,selectedIds:x,onToggleSelect:V,emptyState:r.search?t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:`No Connections match "${r.search}"`}):t.jsx($e,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:400,height:178,"aria-hidden":"true"}),title:"No Connections found",description:"Create a connection to get started.",actions:t.jsx(O,{variant:"outline",onClick:()=>n({to:"/$org/$project/store",params:{org:o.slug,project:Q}}),children:"Browse Store"})})})})})})}),p&&t.jsx(Dn,{count:x.size,total:k.length,onSelectAll:()=>{j(new Set(k.map(s=>s.id)))},onDeselectAll:()=>j(new Set),onDelete:()=>w(!0),onAddToAgent:()=>N(!0),onToggleStatus:je,onCancel:X})]})}function Ks(){const o=ge.c(1);let e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(yt,{children:t.jsx(H.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(ln,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(On,{})})}),o[0]=e):e=o[0],e}export{Ks as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ac as a,ad as t}from"./index-DO8fUd54.js";const e=a(t,{target:"draft-7"});export{e as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as n,j as i,W as g,z as c,X as u,Y as m,Z as x,$ as j,a0 as N,a1 as b,a2 as D}from"./index-DO8fUd54.js";import{i as h}from"./X-CNbskBah.js";function C(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(g,{"data-slot":"dialog",...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(D,{"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(j,{"data-slot":"dialog-portal",...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(N,{"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(b,{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 p;return e[10]!==t||e[11]!==o||e[12]!==d||e[13]!==f?(p=i.jsxs(v,{"data-slot":"dialog-portal",children:[r,i.jsxs(u,{"data-slot":"dialog-content",className:d,...o,children:[t,f]})]}),e[10]=t,e[11]=o,e[12]=d,e[13]=f,e[14]=p):p=e[14],p}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 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("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 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-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(m,{"data-slot":"dialog-title",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("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(x,{"data-slot":"dialog-description",className:a,...s}),e[5]=s,e[6]=a,e[7]=o):o=e[7],o}export{C as D,w as a,T as b,B as c,E as d,R as e,k as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as A,u as W,g as D,f as X,K as Z,j as n,r as $,au as J,B as ee,F as te,bd as ne}from"./index-DO8fUd54.js";import{i as v}from"./Loading01-WTkiPysv.js";import{c as ie}from"./binder-hd3C3mvD.js";import{P as O}from"./topbar-portal-_Qqzdv9B.js";import{u as se}from"./useQuery-BeFLqBun.js";import{b as oe}from"./use-connection-BNGXvSqD.js";import{a as le,u as re,f as ce}from"./constants-B9t4Nuz_.js";import{t as ae}from"./Settings01-CYUXeHtK.js";import{P as E}from"./index-B1uuY7UL.js";import"./use-collections-C8rLdQUN.js";import"./useMutation-CNVq636e.js";import"./use-local-storage-C3Bo802w.js";import"./tooltip-BLTgyg7W.js";import"./index-COM-PDLy.js";function de(t,e){return t?t.filter(m=>ie(m,e)):[]}function R(t){return{id:t.id,title:t.title,icon:t.icon,description:t.description,app_name:t.app_name,app_id:t.app_id,tools:t.tools,metadata:t.metadata}}function me(t){const e=A.c(35),{binding:m,renderHeader:f,renderEmptyState:i}=t,{org:o,project:l}=W();let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={strict:!1},e[0]=a):a=e[0];const{org:r,project:g,pluginId:u}=D(a),Q=oe(),{data:y}=X.useSession();let b;e[1]!==o.id?(b={connectionId:le,orgId:o.id},e[1]=o.id,e[2]=b):b=e[2];const H=re(b);let x;e[3]!==u||e[4]!==l.id?(x=Z.projectPluginConfig(l.id??"",u),e[3]=u,e[4]=l.id,e[5]=x):x=e[5];let p;e[6]!==u||e[7]!==l.id||e[8]!==H?(p=async()=>{const s=await H.callTool({name:"PROJECT_PLUGIN_CONFIG_GET",arguments:{projectId:l.id,pluginId:u}});return s.structuredContent??s},e[6]=u,e[7]=l.id,e[8]=H,e[9]=p):p=e[9];const T=!!l.id&&!!u;let _;e[10]!==x||e[11]!==p||e[12]!==T?(_={queryKey:x,queryFn:p,enabled:T},e[10]=x,e[11]=p,e[12]=T,e[13]=_):_=e[13];const{data:U,isLoading:Y}=se(_),q=de(Q,m),K=U?.config?.connectionId,j=K?q.find(s=>s.id===K):null,P=ce({connectionId:j?.id,orgId:o.id}),w=y?.user?{user:{id:y.user.id,name:y.user.name,email:y.user.email,image:y.user.image}}:null,z={id:o.id,slug:o.slug,name:o.name};if(Y){let s;return e[14]===Symbol.for("react.memo_cache_sentinel")?(s=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),e[14]=s):s=e[14],s}if(q.length===0){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[15]!==i?(c=i(),e[15]=i,e[16]=c):c=e[16];let d;return e[17]!==c?(d=n.jsx("div",{className:"h-full flex flex-col overflow-hidden",children:c}),e[17]=c,e[18]=d):d=e[18],n.jsx(O,{value:s,children:d})}if(!j){const s={connectionId:null,connection:null,toolCaller:null,org:z,session:w};let c;e[19]===Symbol.for("react.memo_cache_sentinel")?(c=n.jsxs("div",{className:"flex flex-col items-center gap-2 text-center max-w-md",children:[n.jsx(ae,{size:48,className:"text-muted-foreground mb-2"}),n.jsx("h2",{className:"text-lg font-semibold",children:"Plugin Not Configured"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"This plugin requires a connection to be configured. Go to project settings to select which integration to use."})]}),e[19]=c):c=e[19];const d=r??o.slug,M=g??l.slug??"";let L;return e[20]!==d||e[21]!==M?(L=n.jsxs("div",{className:"h-full flex flex-col items-center justify-center gap-4 p-8",children:[c,n.jsx(ee,{asChild:!0,children:n.jsx(te,{to:"/$org/$project/settings",params:{org:d,project:M},children:"Go to Project Settings"})})]}),e[20]=d,e[21]=M,e[22]=L):L=e[22],n.jsx(O,{value:s,children:L})}let S;e[23]!==P?(S=(s,c)=>P?P.callTool({name:s,arguments:c}).then(fe):Promise.reject(new Error("MCP client is not available")),e[23]=P,e[24]=S):S=e[24];const V={connectionId:j.id,connection:R(j),toolCaller:S,org:z,session:w},B=E,G=E,k=E,F=f({connections:[R(j)],selectedConnectionId:j.id,onConnectionChange:ue});let h;e[25]!==F||e[26]!==k.Header.Left?(h=n.jsx(k.Header.Left,{children:F}),e[25]=F,e[26]=k.Header.Left,e[27]=h):h=e[27];let C;e[28]!==h||e[29]!==G.Header?(C=n.jsx(G.Header,{children:h}),e[28]=h,e[29]=G.Header,e[30]=C):C=e[30];let N;e[31]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(E.Content,{children:n.jsx($.Suspense,{fallback:n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]}),children:n.jsx(J,{})})}),e[31]=N):N=e[31];let I;return e[32]!==B||e[33]!==C?(I=n.jsxs(B,{children:[C,N]}),e[32]=B,e[33]=C,e[34]=I):I=e[34],n.jsx(O,{value:V,children:I})}function ue(){}function fe(t){return t.structuredContent??t}function Ee(){const t=A.c(12);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e={strict:!1},t[0]=e):e=t[0];const{pluginId:m}=D(e);let f;t[1]!==m?(f=ne.find(r=>r.id===m),t[1]=m,t[2]=f):f=t[2];const i=f;if(i?.renderHeader&&i?.renderEmptyState&&i?.binding){let r;t[3]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[3]=r):r=t[3];let g;return t[4]!==i.binding||t[5]!==i.renderEmptyState||t[6]!==i.renderHeader?(g=n.jsx($.Suspense,{fallback:r,children:n.jsx(me,{binding:i.binding,renderHeader:i.renderHeader,renderEmptyState:i.renderEmptyState})}),t[4]=i.binding,t[5]=i.renderEmptyState,t[6]=i.renderHeader,t[7]=g):g=t[7],g}const o=i?.LayoutComponent;if(!o){let r;return t[8]===Symbol.for("react.memo_cache_sentinel")?(r=n.jsx(J,{}),t[8]=r):r=t[8],r}let l;t[9]===Symbol.for("react.memo_cache_sentinel")?(l=n.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[n.jsx(v,{size:32,className:"animate-spin text-muted-foreground mb-4"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Loading plugin..."})]}),t[9]=l):l=t[9];let a;return t[10]!==o?(a=n.jsx($.Suspense,{fallback:l,children:n.jsx(o,{})}),t[10]=o,t[11]=a):a=t[11],a}export{Ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as V,j as o,B as C}from"./index-DO8fUd54.js";import{I as P}from"./input-BM9bdg-F.js";import{s as A}from"./Plus-Dto-8y6a.js";import{s as R}from"./Trash01-DkXbOnbi.js";function z(i){const e=i.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(l=>e.includes(l))||["sk_","rk_","whsec_","pk_live","sk_live"].some(l=>e.startsWith(l))||["_key","_secret","_token","_password","_auth","_pat"].some(l=>e.endsWith(l)))}function L(i){const e=V.c(34),{value:t,onChange:s,keyPlaceholder:j,valuePlaceholder:l,className:E}=i,h=j===void 0?"VARIABLE_NAME":j,p=l===void 0?"value...":l;let k;e[0]!==s||e[1]!==t?(k=()=>{s([...t,{key:"",value:""}])},e[0]=s,e[1]=t,e[2]=k):k=e[2];const N=k;let y;e[3]!==s||e[4]!==t?(y=n=>{s(t.filter((c,r)=>r!==n))},e[3]=s,e[4]=t,e[5]=y):y=e[5];const m=y;let g;e[6]!==s||e[7]!==t?(g=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:c,value:a.value},s(r))},e[6]=s,e[7]=t,e[8]=g):g=e[8];const _=g;let x;e[9]!==s||e[10]!==t?(x=(n,c)=>{const r=[...t],a=r[n];a&&(r[n]={key:a.key,value:c},s(r))},e[9]=s,e[10]=t,e[11]=x):x=e[11];const v=x;let u;if(e[12]!==_||e[13]!==m||e[14]!==v||e[15]!==h||e[16]!==t||e[17]!==p){let n;e[19]!==_||e[20]!==m||e[21]!==v||e[22]!==h||e[23]!==p?(n=(c,r)=>o.jsxs("div",{className:"flex gap-2 items-center",children:[o.jsx(P,{placeholder:h,value:c.key,onChange:a=>_(r,a.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),o.jsx(P,{type:z(c.key)?"password":"text",placeholder:p,value:c.value,onChange:a=>v(r,a.target.value),className:"h-10 rounded-lg flex-1"}),o.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>m(r),children:o.jsx(R,{size:16})})]},r),e[19]=_,e[20]=m,e[21]=v,e[22]=h,e[23]=p,e[24]=n):n=e[24],u=t.map(n),e[12]=_,e[13]=m,e[14]=v,e[15]=h,e[16]=t,e[17]=p,e[18]=u}else u=e[18];let w;e[25]===Symbol.for("react.memo_cache_sentinel")?(w=o.jsx(A,{size:16,className:"mr-1"}),e[25]=w):w=e[25];let f;e[26]!==N?(f=o.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]=f):f=e[27];let d;e[28]!==u||e[29]!==f?(d=o.jsxs("div",{className:"flex flex-col gap-2",children:[u,f]}),e[28]=u,e[29]=f,e[30]=d):d=e[30];let b;return e[31]!==E||e[32]!==d?(b=o.jsx("div",{className:E,children:d}),e[31]=E,e[32]=d,e[33]=b):b=e[33],b}function T(i){const e={};for(const{key:t,value:s}of i)t.trim()&&(e[t.trim()]=s);return e}function W(i){return i?Object.entries(i).map(([e,t])=>({key:e,value:t})):[]}export{L as E,T as e,W as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./constants-Dr5R1EQY.js";import{g as A}from"./github-icon-Dp3wHhYE.js";import{g as D}from"./registry-utils-oSXyNc33.js";import{g as H}from"./generate-id-Dyweu44Y.js";const E="mcp.mesh";function O(e){if(!e?.url)return"Unknown";try{return new URL(e.url).hostname}catch{return e.url}}function R(e){const r=e?.identifier||e?.name;return r?r.replace(/^@[^/]+\//,"").replace(/[-_]/g," ").replace(/\b\w/g,i=>i.toUpperCase()):"Unknown"}function j(e,r,d,i){const n=e.server,t=e._meta?.[E],f=new Date().toISOString(),b=t?.friendlyName||t?.friendly_name||e.title||n?.title||n?.name||"Unnamed MCP Server",v=n?.description||null,x=n?.icons?.[0]?.src||A(n?.repository)||null,o=t?.oauth_config,I=o&&typeof o.authorizationEndpoint=="string"&&typeof o.tokenEndpoint=="string"&&typeof o.clientId=="string"&&Array.isArray(o.scopes)&&(o.grantType==="authorization_code"||o.grantType==="client_credentials")?o:null,N=t?.configuration_state,P=t?.configuration_scopes,T=n?.repository?{url:n.repository.url,source:n.repository.source,subfolder:n.repository.subfolder}:null,u=n?.packages??[],m=n?.remotes??[],C=i?.packageIndex??0,S=i?.remoteIndex??0,y=u.length>0&&i?.packageIndex!==void 0,a=y?u[C]:null,s=y?null:m[S];let c,l,_=null;if(a){const h=a.identifier||a.name;c="STDIO",l="";const g={};if(a.environmentVariables)for(const k of a.environmentVariables)k.name&&(g[k.name]="");_={command:"npx",args:h?["-y",h]:[],...Object.keys(g).length>0&&{envVars:g}}}else s?(c=D(s.type)||"HTTP",l=s.url||""):(c="HTTP",l="");const w=m.length>1,M=u.length>1;let p="";a&&M?p=` (${R(a)})`:s&&w&&(p=` (${O(s)})`);const U=b+p;return{id:H("conn"),title:U,description:v,icon:x,app_name:t?.appName||n?.name||null,app_id:t?.id||e.id||null,connection_type:c,connection_url:l,connection_token:null,connection_headers:_,oauth_config:I,configuration_state:N??null,configuration_scopes:P??null,metadata:{source:"store",registry_item_id:e.id,verified:t?.verified??!1,scopeName:t?.scopeName??null,toolsCount:t?.tools?.length??0,publishedAt:t?.publishedAt??null,repository:T},created_at:f,updated_at:f,created_by:d,organization_id:r,tools:null,bindings:null,status:"inactive"}}export{E as M,j as e};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function r(t){if(!t)return null;const n=typeof t=="string"?t:t.url;if(!n)return null;const u=n.match(/github\.com[/:]([^/]+)\/([^/]+?)(?:\.git)?\/?$/);return u?{owner:u[1]||"",repo:u[2]||""}:null}function a(t){const n=r(t);if(!n)return null;const u=`https://github.com/${n.owner}.png`;return`https://images.weserv.nl/?url=${encodeURIComponent(u)}&output=webp`}export{r as e,a as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as f,z as y,j as s,f as _,r as C,B as $,bM as O,e as E,x as F,w,y as R,S as D,N as H}from"./index-DO8fUd54.js";import{C as k}from"./card-B4dTtsmd.js";import{A as G}from"./avatar-ChRCLY4k.js";import{i as Q}from"./AlertCircle-5ZbLDi3s.js";import{i as q}from"./Check-CuWDIJeM.js";import{s as B}from"./Plus-Dto-8y6a.js";import{i as M}from"./SearchMd-Kap2MdR9.js";import{s as T}from"./XClose-B0FgAxIQ.js";import{I as U}from"./input-BM9bdg-F.js";import{C as P}from"./create-organization-dialog-BCMxp6fo.js";import"./alert-dialog-DtAWdTyc.js";import"./form-DPPO-3Tw.js";import"./label-CnT8WAQY.js";import"./spinner-CpOteR2a.js";import"./useMutation-CNVq636e.js";function V(t){const e=f.c(10),{children:n,className:l,onNavigate:i,showHoverRing:a}=t,c=a===void 0?!1:a;let o;e[0]!==i?(o=p=>{i&&i(p)},e[0]=i,e[1]=o):o=e[1];const m=o,x=i&&"cursor-pointer",r=c&&"hover:ring-2 hover:ring-primary";let d;e[2]!==l||e[3]!==x||e[4]!==r?(d=y("group transition-all flex flex-col gap-0",x,r,l),e[2]=l,e[3]=x,e[4]=r,e[5]=d):d=e[5];let g;return e[6]!==n||e[7]!==m||e[8]!==d?(g=s.jsx(k,{className:d,onClick:m,children:n}),e[6]=n,e[7]=m,e[8]=d,e[9]=g):g=e[9],g}function X(t){const e=f.c(7),{url:n,fallback:l,shape:i,size:a,objectFit:c,className:o}=t,m=i===void 0?"square":i,x=a===void 0?"lg":a,r=c===void 0?"contain":c;let d;return e[0]!==o||e[1]!==l||e[2]!==r||e[3]!==m||e[4]!==x||e[5]!==n?(d=s.jsx(G,{url:n,fallback:l,shape:m,size:x,objectFit:r,className:o}),e[0]=o,e[1]=l,e[2]=r,e[3]=m,e[4]=x,e[5]=n,e[6]=d):d=e[6],d}function Y(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 flex flex-col gap-4",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function J(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("font-medium truncate",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("p",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function K(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("text-sm text-muted-foreground truncate",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("h3",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function W(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex flex-col gap-[2px]",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function Z(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex justify-between items-start",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function ee(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("p-4 border-t border-border flex justify-between items-center",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function te(t){const e=f.c(5),{children:n,className:l}=t;let i;e[0]!==l?(i=y("flex items-center text-xs text-muted-foreground",l),e[0]=l,e[1]=i):i=e[1];let a;return e[2]!==n||e[3]!==i?(a=s.jsx("div",{className:i,children:n}),e[2]=n,e[3]=i,e[4]=a):a=e[4],a}function se(){const t=f.c(3);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx("div",{className:"flex justify-between items-start",children:s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg animate-pulse"})}),t[0]=e):e=t[0];let n;t[1]===Symbol.for("react.memo_cache_sentinel")?(n=s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[e,s.jsxs("div",{className:"flex flex-col gap-[2px]",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg animate-pulse"}),s.jsx("div",{className:"h-4 w-40 bg-muted rounded-lg animate-pulse"})]})]}),t[1]=n):n=t[1];let l;return t[2]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsxs(k,{className:"group transition-colors flex flex-col",children:[n,s.jsxs("div",{className:"p-4 border-t border-border flex justify-between items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]}),t[2]=l):l=t[2],l}const u=Object.assign(V,{Avatar:X,AvatarSection:Z,Header:Y,Title:J,Subtitle:K,Content:W,Footer:ee,Badge:te,Skeleton:se}),ie={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8"},le={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"},ne={1:"@min-3xl:grid-cols-1",2:"@min-3xl:grid-cols-2",3:"@min-3xl:grid-cols-3",4:"@min-3xl:grid-cols-4",5:"@min-3xl:grid-cols-5",6:"@min-3xl:grid-cols-6",7:"@min-3xl:grid-cols-7",8:"@min-3xl:grid-cols-8"},ae={1:"@min-6xl:grid-cols-1",2:"@min-6xl:grid-cols-2",3:"@min-6xl:grid-cols-3",4:"@min-6xl:grid-cols-4",5:"@min-6xl:grid-cols-5",6:"@min-6xl:grid-cols-6",7:"@min-6xl:grid-cols-7",8:"@min-6xl:grid-cols-8"},re={1:"@min-7xl:grid-cols-1",2:"@min-7xl:grid-cols-2",3:"@min-7xl:grid-cols-3",4:"@min-7xl:grid-cols-4",5:"@min-7xl:grid-cols-5",6:"@min-7xl:grid-cols-6",7:"@min-7xl:grid-cols-7",8:"@min-7xl:grid-cols-8"},oe={1:"@min-8xl:grid-cols-1",2:"@min-8xl:grid-cols-2",3:"@min-8xl:grid-cols-3",4:"@min-8xl:grid-cols-4",5:"@min-8xl:grid-cols-5",6:"@min-8xl:grid-cols-6",7:"@min-8xl:grid-cols-7",8:"@min-8xl:grid-cols-8"};function L(t){const e=f.c(13),{children:n,columns:l,gap:i,className:a}=t;let c;e[0]!==l?(c=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=c):c=e[1];const o=c,x=ie[i===void 0?4:i],r=o.sm&&le[o.sm],d=o.md&&ne[o.md],g=o.lg&&ae[o.lg],p=o.xl&&re[o.xl],v=o["2xl"]&&oe[o["2xl"]];let N;e[2]!==a||e[3]!==x||e[4]!==r||e[5]!==d||e[6]!==g||e[7]!==p||e[8]!==v?(N=y("w-full grid",x,r,d,g,p,v,a),e[2]=a,e[3]=x,e[4]=r,e[5]=d,e[6]=g,e[7]=p,e[8]=v,e[9]=N):N=e[9];const b=N;let h;return e[10]!==n||e[11]!==b?(h=s.jsx("div",{className:b,children:n}),e[10]=n,e[11]=b,e[12]=h):h=e[12],h}function ce(t){const e=f.c(9),{count:n,columns:l,gap:i,className:a}=t,c=n===void 0?8:n;let o;e[0]!==l?(o=l===void 0?{sm:2,md:3,lg:4}:l,e[0]=l,e[1]=o):o=e[1];const m=o,x=i===void 0?4:i;let r;e[2]!==c?(r=Array.from({length:c}).map(de),e[2]=c,e[3]=r):r=e[3];let d;return e[4]!==a||e[5]!==m||e[6]!==x||e[7]!==r?(d=s.jsx(L,{columns:m,gap:x,className:a,children:r}),e[4]=a,e[5]=m,e[6]=x,e[7]=r,e[8]=d):d=e[8],d}function de(t,e){return s.jsxs("div",{className:"bg-card hover:bg-accent transition-colors flex flex-col rounded-lg animate-pulse",children:[s.jsxs("div",{className:"p-4 flex flex-col gap-4",children:[s.jsx("div",{className:"h-12 w-12 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"}),s.jsx("div",{className:"h-4 w-32 bg-muted rounded-lg"})]}),s.jsxs("div",{className:"p-4 border-t border-border flex items-center",children:[s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"}),s.jsx("div",{className:"h-6 w-6 bg-muted rounded-full animate-pulse -ml-2"})]})]},e)}const I=Object.assign(L,{Skeleton:ce});function me({invitation:t}){const[e,n]=C.useState(!1),[l,i]=C.useState(!1),a=F(),c=E(),o=async()=>{n(!0);try{const r=await _.organization.acceptInvitation({invitationId:t.id});if(r.error)w.error(r.error.message),n(!1);else{const d=await _.organization.setActive({organizationId:t.organizationId});d?.data?.slug?(w.success("Invitation accepted!"),c({to:"/$org",params:{org:d.data.slug}})):(w.success("Invitation accepted! Redirecting..."),c({to:"/"}))}}catch{w.error("Failed to accept invitation"),n(!1)}},m=async()=>{i(!0);try{const r=await _.organization.rejectInvitation({invitationId:t.id});r.error?(w.error(r.error.message),i(!1)):(w.success("Invitation rejected"),await a.invalidateQueries(),i(!1))}catch{w.error("Failed to reject invitation"),i(!1)}},x=t.organizationName||t.organizationId;return s.jsxs(u,{className:"border-dashed",children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:"",fallback:x,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsx(u.Subtitle,{children:"You've been invited to join"}),s.jsx(u.Title,{children:x})]})]}),s.jsx(u.Footer,{className:"border-t border-dashed",children:s.jsxs("div",{className:"flex h-3.5 items-center gap-2 w-full",children:[s.jsx($,{onClick:o,disabled:e||l,className:"flex-1",size:"sm",children:e?"Accepting...":s.jsxs(s.Fragment,{children:[s.jsx(q,{size:16}),"Accept"]})}),s.jsx($,{variant:"outline",onClick:m,disabled:e||l,className:"flex-1",size:"sm",children:l?"Declining...":s.jsxs(s.Fragment,{children:[s.jsx(T,{size:16}),"Decline"]})})]})})]})}function xe({query:t}){const e=C.useContext(O),{data:n}=e.hooks.useListUserInvitations(),i=(n??[]).filter(c=>c.status==="pending"&&new Date(c.expiresAt)>new Date),a=t?(()=>{const c=t.toLowerCase();return i.filter(o=>o.organizationName?.toLowerCase().includes(c)||o.organizationId.toLowerCase().includes(c))})():i;return a.length===0?null:s.jsxs("div",{className:"mb-16",children:[s.jsx("h2",{className:"text-lg font-medium pb-2 border-b border-border/50 mb-6 px-2",children:"Invitations"}),s.jsx(I,{columns:{sm:2,md:3,lg:4},children:a.map(c=>s.jsx(me,{invitation:c},c.id))})]})}function ue(t){const e=f.c(14),{query:n}=t,{data:l}=_.useListOrganizations(),i=E();let a;e[0]!==l||e[1]!==n?(a=l?n?(()=>{const r=n.toLowerCase();return l.filter(d=>d.name.toLowerCase().includes(r)||d.slug.toLowerCase().includes(r))})():l:[],e[0]=l,e[1]=n,e[2]=a):a=e[2];const c=a;if(!l||l.length===0){let r;return e[3]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsx("div",{className:"text-sm text-muted-foreground text-center",children:"No organizations yet. Create your first organization to get started."})}),e[3]=r):r=e[3],r}if(c.length===0){let r;return e[4]!==n?(r=s.jsx("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:['No organizations found matching "',n,'".']})}),e[4]=n,e[5]=r):r=e[5],r}let o;e[6]===Symbol.for("react.memo_cache_sentinel")?(o={sm:2,md:3,lg:4},e[6]=o):o=e[6];let m;if(e[7]!==c||e[8]!==i){let r;e[10]!==i?(r=d=>s.jsxs(u,{onNavigate:()=>i({to:"/$org",params:{org:d.slug}}),children:[s.jsxs(u.Header,{children:[s.jsx(u.AvatarSection,{children:s.jsx(u.Avatar,{url:d.logo||"",fallback:d.name,size:"lg",objectFit:"contain"})}),s.jsxs(u.Content,{children:[s.jsxs(u.Subtitle,{children:["@",d.slug]}),s.jsx(u.Title,{children:d.name})]})]}),s.jsx(u.Footer,{children:s.jsxs("div",{className:"flex h-3.5 items-center text-xs text-muted-foreground",children:["Created:"," ",new Date(d.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})]})})]},d.id),e[10]=i,e[11]=r):r=e[11],m=c.map(r),e[7]=c,e[8]=i,e[9]=m}else m=e[9];let x;return e[12]!==m?(x=s.jsx(I,{columns:o,children:m}),e[12]=m,e[13]=x):x=e[13],x}function fe(t){const e=f.c(3),{error:n}=t;let l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=s.jsx(Q,{size:24,className:"text-destructive"}),e[0]=l):l=e[0];let i;return e[1]!==n.message?(i=s.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[400px] gap-4",children:[l,s.jsxs("div",{className:"text-sm text-muted-foreground text-center",children:["Error loading organizations: ",n.message]})]}),e[1]=n.message,e[2]=i):i=e[2],i}function ge(){const t=f.c(27),{error:e,isPending:n}=_.useListOrganizations(),[l,i]=C.useState(""),[a,c]=C.useState(!1),o=C.useDeferredValue(l);if(n){let j;return t[0]===Symbol.for("react.memo_cache_sentinel")?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx("div",{className:"@container",children:s.jsx(I.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}})})}),t[0]=j):j=t[0],j}if(e){let j;return t[1]!==e?(j=s.jsx("div",{className:"max-w-6xl mx-auto p-8",children:s.jsx(fe,{error:e})}),t[1]=e,t[2]=j):j=t[2],j}let m;t[3]!==o?(m=s.jsx(C.Suspense,{fallback:null,children:s.jsx(xe,{query:o})}),t[3]=o,t[4]=m):m=t[4];let x;t[5]===Symbol.for("react.memo_cache_sentinel")?(x=s.jsx("h2",{className:"text-lg font-medium",children:"My organizations"}),t[5]=x):x=t[5];let r;t[6]===Symbol.for("react.memo_cache_sentinel")?(r=s.jsx(M,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),t[6]=r):r=t[6];let d;t[7]===Symbol.for("react.memo_cache_sentinel")?(d=j=>i(j.target.value),t[7]=d):d=t[7];let g;t[8]!==l?(g=s.jsxs("div",{className:"relative",children:[r,s.jsx(U,{className:"pl-8 h-8 w-52 border-none shadow-none focus-visible:ring-0",placeholder:"Search organizations...",value:l,onChange:d})]}),t[8]=l,t[9]=g):g=t[9];let p;t[10]===Symbol.for("react.memo_cache_sentinel")?(p=s.jsxs($,{size:"sm",onClick:()=>c(!0),children:[s.jsx(B,{size:16}),s.jsx("span",{children:"New organization"})]}),t[10]=p):p=t[10];let v;t[11]!==g?(v=s.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-border/50 mb-6 px-2",children:[x,s.jsxs("div",{className:"flex items-center gap-3",children:[g,p]})]}),t[11]=g,t[12]=v):v=t[12];let N;t[13]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(I.Skeleton,{count:8,columns:{sm:2,md:3,lg:4}}),t[13]=N):N=t[13];let b;t[14]!==o?(b=s.jsx(C.Suspense,{fallback:N,children:s.jsx(ue,{query:o})}),t[14]=o,t[15]=b):b=t[15];let h;t[16]!==v||t[17]!==b?(h=s.jsxs("div",{children:[v,b]}),t[16]=v,t[17]=b,t[18]=h):h=t[18];let S;t[19]!==m||t[20]!==h?(S=s.jsxs("div",{className:"@container",children:[m,h]}),t[19]=m,t[20]=h,t[21]=S):S=t[21];let z;t[22]!==a?(z=s.jsx(P,{open:a,onOpenChange:c}),t[22]=a,t[23]=z):z=t[23];let A;return t[24]!==S||t[25]!==z?(A=s.jsxs("div",{className:"max-w-6xl mx-auto p-8",children:[S,z]}),t[24]=S,t[25]=z,t[26]=A):A=t[26],A}function Ee(){const t=f.c(4),e=R(),{data:n,isPending:l}=_.useListOrganizations();if(e.localMode){if(l){let c;return t[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(D,{}),t[0]=c):c=t[0],c}const a=n?.[0];if(a?.slug){const c=`/${a.slug}/org-admin`;let o;return t[1]!==c?(o=s.jsx(H,{to:c,replace:!0}),t[1]=c,t[2]=o):o=t[2],o}}let i;return t[3]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"min-h-full",children:s.jsx(ge,{})}),t[3]=i):i=t[3],i}export{Ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as X,r as F,z as K,j as t,B as T}from"./index-DO8fUd54.js";import{I as Z}from"./input-BM9bdg-F.js";import{P as q,a as G,b as H}from"./popover-D1WG-emQ.js";import{S as J}from"./scroll-area-BcJ1ckdt.js";import{n as Q}from"./Container-YdffBHg3.js";import{i as V}from"./Edit05-h0OeCHXT.js";import{i as W}from"./Link01-BpjSsBky.js";import{s as ee}from"./XClose-B0FgAxIQ.js";const te=0,se=38;function re(){const i=[];for(let e=te;e<=se;e++)i.push(`/icons/capy-${e}.png`);return i}const le={sm:"h-8 w-8",md:"h-12 w-12",lg:"h-16 w-16"},oe=re();function xe(i){const e=X.c(53),{value:r,onChange:o,name:c,size:S,className:I,fallbackIcon:a}=i,m=S===void 0?"lg":S,[s,n]=F.useState(""),[U,w]=F.useState(!1);let A;e[0]!==o?(A=l=>{o(l),w(!1),n("")},e[0]=o,e[1]=A):A=e[1];const $=A;let _;e[2]!==s||e[3]!==o?(_=()=>{const l=s.trim();l&&(o(l),w(!1),n(""))},e[2]=s,e[3]=o,e[4]=_):_=e[4];const f=_;let k;e[5]!==o?(k=()=>{o(null),w(!1),n("")},e[5]=o,e[6]=k):k=e[6];const D=k,L=le[m];let d;e[7]!==I||e[8]!==L?(d=K("relative group rounded-lg border border-border shrink-0 overflow-hidden cursor-pointer",L,I),e[7]=I,e[8]=L,e[9]=d):d=e[9];const M=r??"no-icon";let u;e[10]!==a||e[11]!==c||e[12]!==M||e[13]!==r?(u=t.jsx(ie,{icon:r,name:c,fallbackIcon:a},M),e[10]=a,e[11]=c,e[12]=M,e[13]=r,e[14]=u):u=e[14];let z;e[15]===Symbol.for("react.memo_cache_sentinel")?(z=t.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity",children:t.jsx(V,{size:16,className:"text-white"})}),e[15]=z):z=e[15];let p;e[16]!==d||e[17]!==u?(p=t.jsx(q,{asChild:!0,children:t.jsxs("button",{type:"button",className:d,children:[u,z]})}),e[16]=d,e[17]=u,e[18]=p):p=e[18];let P;e[19]===Symbol.for("react.memo_cache_sentinel")?(P=t.jsx("span",{className:"text-sm font-medium",children:"Choose icon"}),e[19]=P):P=e[19];let h;e[20]!==D||e[21]!==r?(h=r&&t.jsxs(T,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs text-muted-foreground",onClick:D,children:[t.jsx(ee,{size:12}),"Remove"]}),e[20]=D,e[21]=r,e[22]=h):h=e[22];let x;e[23]!==h?(x=t.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[P,h]}),e[23]=h,e[24]=x):x=e[24];let b;e[25]!==$||e[26]!==r?(b=oe.map(l=>t.jsx("button",{type:"button",onClick:()=>$(l),className:K("h-9 w-9 rounded-md overflow-hidden border transition-colors hover:border-primary cursor-pointer",r===l?"border-primary ring-1 ring-primary":"border-transparent"),children:t.jsx("img",{src:l,alt:"",className:"h-full w-full object-cover",loading:"lazy"})},l)),e[25]=$,e[26]=r,e[27]=b):b=e[27];let g;e[28]!==b?(g=t.jsx(J,{className:"h-48",children:t.jsx("div",{className:"grid grid-cols-7 gap-1 p-2",children:b})}),e[28]=b,e[29]=g):g=e[29];let E;e[30]===Symbol.for("react.memo_cache_sentinel")?(E=t.jsx(W,{size:14,className:"text-muted-foreground shrink-0"}),e[30]=E):E=e[30];let R;e[31]===Symbol.for("react.memo_cache_sentinel")?(R=l=>n(l.target.value),e[31]=R):R=e[31];let j;e[32]!==f?(j=l=>{l.key==="Enter"&&(l.preventDefault(),f())},e[32]=f,e[33]=j):j=e[33];let v;e[34]!==s||e[35]!==j?(v=t.jsx(Z,{value:s,onChange:R,placeholder:"Paste image URL...",className:"h-7 text-xs",onKeyDown:j}),e[34]=s,e[35]=j,e[36]=v):v=e[36];let O;e[37]!==s?(O=s.trim(),e[37]=s,e[38]=O):O=e[38];const Y=!O;let y;e[39]!==f||e[40]!==Y?(y=t.jsx(T,{variant:"outline",size:"sm",className:"h-7 px-2 text-xs shrink-0",onClick:f,disabled:Y,children:"Apply"}),e[39]=f,e[40]=Y,e[41]=y):y=e[41];let N;e[42]!==v||e[43]!==y?(N=t.jsxs("div",{className:"flex items-center gap-1.5 p-2 border-t border-border",children:[E,v,y]}),e[42]=v,e[43]=y,e[44]=N):N=e[44];let C;e[45]!==x||e[46]!==g||e[47]!==N?(C=t.jsx(G,{align:"start",className:"w-80 p-0",onOpenAutoFocus:ne,children:t.jsxs("div",{className:"flex flex-col",children:[x,g,N]})}),e[45]=x,e[46]=g,e[47]=N,e[48]=C):C=e[48];let B;return e[49]!==U||e[50]!==p||e[51]!==C?(B=t.jsxs(H,{open:U,onOpenChange:w,children:[p,C]}),e[49]=U,e[50]=p,e[51]=C,e[52]=B):B=e[52],B}function ne(i){return i.preventDefault()}function ie(i){const e=X.c(8),{icon:r,name:o,fallbackIcon:c}=i,[S,I]=F.useState(!1);if(!r||S){let s;e[0]!==c?(s=c??t.jsx(Q,{size:24,className:"text-muted-foreground"}),e[0]=c,e[1]=s):s=e[1];let n;return e[2]!==s?(n=t.jsx("div",{className:"h-full w-full flex items-center justify-center bg-muted/20",children:s}),e[2]=s,e[3]=n):n=e[3],n}let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=()=>I(!0),e[4]=a):a=e[4];let m;return e[5]!==r||e[6]!==o?(m=t.jsx("img",{src:r,alt:o,className:"h-full w-full object-cover",onError:a}),e[5]=r,e[6]=o,e[7]=m):m=e[7],m}export{xe as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as j,c as h,bh as $,z as g,j as r,g as T,at as _,B as w}from"./index-DO8fUd54.js";import{u as S}from"./use-local-storage-C3Bo802w.js";import{a as k,T as O,c as R}from"./tooltip-BLTgyg7W.js";const v=({size:t=24,color:e="currentColor",...l})=>j.createElement("svg",{viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...l},j.createElement("path",{d:"M8 9.5h4M8 13h7m-3 8a9 9 0 1 0-8.342-5.616c.081.2.122.3.14.381a.907.907 0 0 1 .024.219c0 .083-.015.173-.045.353l-.593 3.558c-.062.373-.093.56-.035.694a.5.5 0 0 0 .262.262c.135.058.321.027.694-.035l3.558-.593c.18-.03.27-.045.353-.045.081 0 .14.006.219.024.08.018.18.059.38.14A8.973 8.973 0 0 0 12 21Z"}));v.displayName="MessageTextCircle02";function y(){const t=h.c(4);let e;t[0]===Symbol.for("react.memo_cache_sentinel")?(e=$.decoChatOpen(),t[0]=e):e=t[0];const[l,n]=S(e,E);let s;return t[1]!==l||t[2]!==n?(s=[l,n],t[1]=l,t[2]=n,t[3]=s):s=t[3],s}function E(t){return!!(t??!0)}function b(t,e){const l=j.Children.toArray(t);for(const n of l)if(j.isValidElement(n)&&n.type===e)return n;return null}function P(){const t=h.c(12),[e,l]=y();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={strict:!1},t[0]=n):n=t[0];const{org:s,project:o}=T(n),{location:u}=_();if(u.pathname===`/${s}/${o}`||u.pathname===`/${s}/${o}/`)return null;const d=e&&"bg-accent text-foreground";let i;t[1]!==d?(i=g("h-7 px-2 gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground",d),t[1]=d,t[2]=i):i=t[2];let c;t[3]!==l?(c=()=>l(L),t[3]=l,t[4]=c):c=t[4];let f;t[5]===Symbol.for("react.memo_cache_sentinel")?(f=r.jsx(v,{size:14,className:"text-inherit"}),t[5]=f):f=t[5];let a;t[6]!==i||t[7]!==c?(a=r.jsx(k,{asChild:!0,children:r.jsxs(w,{variant:"ghost",className:i,onClick:c,"aria-label":"Toggle Decopilot",children:[f,"Chat"]})}),t[6]=i,t[7]=c,t[8]=a):a=t[8];let m;t[9]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx(O,{side:"bottom",children:"Toggle Decopilot"}),t[9]=m):m=t[9];let p;return t[10]!==a?(p=r.jsxs(R,{children:[a,m]}),t[10]=a,t[11]=p):p=t[11],p}function L(t){return!t}function H(t){const e=h.c(5),{children:l,className:n}=t;let s;e[0]!==n?(s=g("flex flex-col h-full bg-background overflow-hidden",n),e[0]=n,e[1]=s):s=e[1];let o;return e[2]!==l||e[3]!==s?(o=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=o):o=e[4],o}function B(t){const e=h.c(17),{children:l,className:n,hideSidebarTrigger:s}=t;let o;e[0]!==l?(o=b(l,C),e[0]=l,e[1]=o):o=e[1];const u=o;let x;e[2]!==l?(x=b(l,N),e[2]=l,e[3]=x):x=e[3];const d=x;let i;e[4]!==n?(i=g("shrink-0 w-full border-b border-border/50 h-11 overflow-x-auto","flex items-center justify-between gap-3 pr-2 pl-4 min-w-max",n),e[4]=n,e[5]=i):i=e[5];let c;e[6]!==u?(c=r.jsx("div",{className:"flex items-center gap-1",children:u}),e[6]=u,e[7]=c):c=e[7];let f;e[8]!==s?(f=!s&&r.jsx("div",{className:"flex items-center pl-2 ml-1",children:r.jsx(P,{})}),e[8]=s,e[9]=f):f=e[9];let a;e[10]!==d||e[11]!==f?(a=r.jsxs("div",{className:"flex items-center",children:[d,f]}),e[10]=d,e[11]=f,e[12]=a):a=e[12];let m;return e[13]!==i||e[14]!==c||e[15]!==a?(m=r.jsxs("div",{className:i,children:[c,a]}),e[13]=i,e[14]=c,e[15]=a,e[16]=m):m=e[16],m}function C(t){const e=h.c(5),{children:l,className:n}=t;let s;e[0]!==n?(s=g("flex items-center gap-2 shrink-0 overflow-hidden",n),e[0]=n,e[1]=s):s=e[1];let o;return e[2]!==l||e[3]!==s?(o=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=o):o=e[4],o}function N(t){const e=h.c(5),{children:l,className:n}=t;let s;e[0]!==n?(s=g("flex items-center gap-2 shrink-0 overflow-hidden",n),e[0]=n,e[1]=s):s=e[1];let o;return e[2]!==l||e[3]!==s?(o=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=o):o=e[4],o}function A(t){const e=h.c(5),{children:l,className:n}=t;let s;e[0]!==n?(s=g("flex-1 overflow-auto",n),e[0]=n,e[1]=s):s=e[1];let o;return e[2]!==l||e[3]!==s?(o=r.jsx("div",{className:s,children:l}),e[2]=l,e[3]=s,e[4]=o):o=e[4],o}const G=Object.assign(H,{Header:Object.assign(B,{Left:C,Right:N}),Content:A});export{G as P,y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,av as q,aw as R,W as Ee,$ as ke,a0 as Se,X as xe,ax as j}from"./index-DO8fUd54.js";var de=1,Ie=.9,Ce=.8,Re=.17,Q=.1,Z=.999,Ae=.9999,Me=.99,$e=/[\\\/_+.#"@\[\(\{&]/,De=/[\\\/_+.#"@\[\(\{&]/g,Fe=/[\s-]/,ve=/[\s-]/g;function ee(t,l,r,f,u,c,d){if(c===l.length)return u===t.length?de:Me;var v=`${u},${c}`;if(d[v]!==void 0)return d[v];for(var b=f.charAt(c),i=r.indexOf(b,u),p=0,h,x,E,I;i>=0;)h=ee(t,l,r,f,i+1,c+1,d),h>p&&(i===u?h*=de:$e.test(t.charAt(i-1))?(h*=Ce,E=t.slice(u,i-1).match(De),E&&u>0&&(h*=Math.pow(Z,E.length))):Fe.test(t.charAt(i-1))?(h*=Ie,I=t.slice(u,i-1).match(ve),I&&u>0&&(h*=Math.pow(Z,I.length))):(h*=Re,u>0&&(h*=Math.pow(Z,i-u))),t.charAt(i)!==l.charAt(c)&&(h*=Ae)),(h<Q&&r.charAt(i-1)===f.charAt(c+1)||f.charAt(c+1)===f.charAt(c)&&r.charAt(i-1)!==f.charAt(c))&&(x=ee(t,l,r,f,i+1,c+2,d),x*Q>h&&(h=x*Q)),h>p&&(p=h),i=r.indexOf(b,i+1);return d[v]=p,p}function se(t){return t.toLowerCase().replace(ve," ")}function Ke(t,l,r){return t=r&&r.length>0?`${t+" "+r.join(" ")}`:t,ee(t,l,se(t),se(l),0,0,{})}var V='[cmdk-group=""]',_='[cmdk-group-items=""]',qe='[cmdk-group-heading=""]',me='[cmdk-item=""]',fe=`${me}:not([aria-disabled="true"])`,te="cmdk-item-select",F="data-value",Pe=(t,l,r)=>Ke(t,l,r),pe=n.createContext(void 0),L=()=>n.useContext(pe),he=n.createContext(void 0),re=()=>n.useContext(he),ge=n.createContext(void 0),be=n.forwardRef((t,l)=>{let r=K(()=>{var e,o;return{search:"",value:(o=(e=t.value)!=null?e:t.defaultValue)!=null?o:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),f=K(()=>new Set),u=K(()=>new Map),c=K(()=>new Map),d=K(()=>new Set),v=we(t),{label:b,children:i,value:p,onValueChange:h,filter:x,shouldFilter:E,loop:I,disablePointerSelection:U=!1,vimBindings:A=!0,...O}=t,W=q(),ne=q(),H=q(),M=n.useRef(null),w=Te();$(()=>{if(p!==void 0){let e=p.trim();r.current.value=e,k.emit()}},[p]),$(()=>{w(6,ae)},[]);let k=n.useMemo(()=>({subscribe:e=>(d.current.add(e),()=>d.current.delete(e)),snapshot:()=>r.current,setState:(e,o,s)=>{var a,m,g,S;if(!Object.is(r.current[e],o)){if(r.current[e]=o,e==="search")G(),T(),w(1,X);else if(e==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let y=document.getElementById(H);y?y.focus():(a=document.getElementById(W))==null||a.focus()}if(w(7,()=>{var y;r.current.selectedItemId=(y=D())==null?void 0:y.id,k.emit()}),s||w(5,ae),((m=v.current)==null?void 0:m.value)!==void 0){let y=o??"";(S=(g=v.current).onValueChange)==null||S.call(g,y);return}}k.emit()}},emit:()=>{d.current.forEach(e=>e())}}),[]),N=n.useMemo(()=>({value:(e,o,s)=>{var a;o!==((a=c.current.get(e))==null?void 0:a.value)&&(c.current.set(e,{value:o,keywords:s}),r.current.filtered.items.set(e,le(o,s)),w(2,()=>{T(),k.emit()}))},item:(e,o)=>(f.current.add(e),o&&(u.current.has(o)?u.current.get(o).add(e):u.current.set(o,new Set([e]))),w(3,()=>{G(),T(),r.current.value||X(),k.emit()}),()=>{c.current.delete(e),f.current.delete(e),r.current.filtered.items.delete(e);let s=D();w(4,()=>{G(),s?.getAttribute("id")===e&&X(),k.emit()})}),group:e=>(u.current.has(e)||u.current.set(e,new Set),()=>{c.current.delete(e),u.current.delete(e)}),filter:()=>v.current.shouldFilter,label:b||t["aria-label"],getDisablePointerSelection:()=>v.current.disablePointerSelection,listId:W,inputId:H,labelId:ne,listInnerRef:M}),[]);function le(e,o){var s,a;let m=(a=(s=v.current)==null?void 0:s.filter)!=null?a:Pe;return e?m(e,r.current.search,o):0}function T(){if(!r.current.search||v.current.shouldFilter===!1)return;let e=r.current.filtered.items,o=[];r.current.filtered.groups.forEach(a=>{let m=u.current.get(a),g=0;m.forEach(S=>{let y=e.get(S);g=Math.max(y,g)}),o.push([a,g])});let s=M.current;P().sort((a,m)=>{var g,S;let y=a.getAttribute("id"),B=m.getAttribute("id");return((g=e.get(B))!=null?g:0)-((S=e.get(y))!=null?S:0)}).forEach(a=>{let m=a.closest(_);m?m.appendChild(a.parentElement===m?a:a.closest(`${_} > *`)):s.appendChild(a.parentElement===s?a:a.closest(`${_} > *`))}),o.sort((a,m)=>m[1]-a[1]).forEach(a=>{var m;let g=(m=M.current)==null?void 0:m.querySelector(`${V}[${F}="${encodeURIComponent(a[0])}"]`);g?.parentElement.appendChild(g)})}function X(){let e=P().find(s=>s.getAttribute("aria-disabled")!=="true"),o=e?.getAttribute(F);k.setState("value",o||void 0)}function G(){var e,o,s,a;if(!r.current.search||v.current.shouldFilter===!1){r.current.filtered.count=f.current.size;return}r.current.filtered.groups=new Set;let m=0;for(let g of f.current){let S=(o=(e=c.current.get(g))==null?void 0:e.value)!=null?o:"",y=(a=(s=c.current.get(g))==null?void 0:s.keywords)!=null?a:[],B=le(S,y);r.current.filtered.items.set(g,B),B>0&&m++}for(let[g,S]of u.current)for(let y of S)if(r.current.filtered.items.get(y)>0){r.current.filtered.groups.add(g);break}r.current.filtered.count=m}function ae(){var e,o,s;let a=D();a&&(((e=a.parentElement)==null?void 0:e.firstChild)===a&&((s=(o=a.closest(V))==null?void 0:o.querySelector(qe))==null||s.scrollIntoView({block:"nearest"})),a.scrollIntoView({block:"nearest"}))}function D(){var e;return(e=M.current)==null?void 0:e.querySelector(`${me}[aria-selected="true"]`)}function P(){var e;return Array.from(((e=M.current)==null?void 0:e.querySelectorAll(fe))||[])}function J(e){let o=P()[e];o&&k.setState("value",o.getAttribute(F))}function Y(e){var o;let s=D(),a=P(),m=a.findIndex(S=>S===s),g=a[m+e];(o=v.current)!=null&&o.loop&&(g=m+e<0?a[a.length-1]:m+e===a.length?a[0]:a[m+e]),g&&k.setState("value",g.getAttribute(F))}function ue(e){let o=D(),s=o?.closest(V),a;for(;s&&!a;)s=e>0?He(s,V):Ne(s,V),a=s?.querySelector(fe);a?k.setState("value",a.getAttribute(F)):Y(e)}let ie=()=>J(P().length-1),oe=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?ue(1):Y(1)},ce=e=>{e.preventDefault(),e.metaKey?J(0):e.altKey?ue(-1):Y(-1)};return n.createElement(R.div,{ref:l,tabIndex:-1,...O,"cmdk-root":"",onKeyDown:e=>{var o;(o=O.onKeyDown)==null||o.call(O,e);let s=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||s))switch(e.key){case"n":case"j":{A&&e.ctrlKey&&oe(e);break}case"ArrowDown":{oe(e);break}case"p":case"k":{A&&e.ctrlKey&&ce(e);break}case"ArrowUp":{ce(e);break}case"Home":{e.preventDefault(),J(0);break}case"End":{e.preventDefault(),ie();break}case"Enter":{e.preventDefault();let a=D();if(a){let m=new Event(te);a.dispatchEvent(m)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:Ge},b),z(t,e=>n.createElement(he.Provider,{value:k},n.createElement(pe.Provider,{value:N},e))))}),Ve=n.forwardRef((t,l)=>{var r,f;let u=q(),c=n.useRef(null),d=n.useContext(ge),v=L(),b=we(t),i=(f=(r=b.current)==null?void 0:r.forceMount)!=null?f:d?.forceMount;$(()=>{if(!i)return v.item(u,d?.id)},[i]);let p=ye(u,c,[t.value,t.children,c],t.keywords),h=re(),x=C(w=>w.value&&w.value===p.current),E=C(w=>i||v.filter()===!1?!0:w.search?w.filtered.items.get(u)>0:!0);n.useEffect(()=>{let w=c.current;if(!(!w||t.disabled))return w.addEventListener(te,I),()=>w.removeEventListener(te,I)},[E,t.onSelect,t.disabled]);function I(){var w,k;U(),(k=(w=b.current).onSelect)==null||k.call(w,p.current)}function U(){h.setState("value",p.current,!0)}if(!E)return null;let{disabled:A,value:O,onSelect:W,forceMount:ne,keywords:H,...M}=t;return n.createElement(R.div,{ref:j(c,l),...M,id:u,"cmdk-item":"",role:"option","aria-disabled":!!A,"aria-selected":!!x,"data-disabled":!!A,"data-selected":!!x,onPointerMove:A||v.getDisablePointerSelection()?void 0:U,onClick:A?void 0:I},t.children)}),je=n.forwardRef((t,l)=>{let{heading:r,children:f,forceMount:u,...c}=t,d=q(),v=n.useRef(null),b=n.useRef(null),i=q(),p=L(),h=C(E=>u||p.filter()===!1?!0:E.search?E.filtered.groups.has(d):!0);$(()=>p.group(d),[]),ye(d,v,[t.value,t.heading,b]);let x=n.useMemo(()=>({id:d,forceMount:u}),[u]);return n.createElement(R.div,{ref:j(v,l),...c,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},r&&n.createElement("div",{ref:b,"cmdk-group-heading":"","aria-hidden":!0,id:i},r),z(t,E=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?i:void 0},n.createElement(ge.Provider,{value:x},E))))}),Le=n.forwardRef((t,l)=>{let{alwaysRender:r,...f}=t,u=n.useRef(null),c=C(d=>!d.search);return!r&&!c?null:n.createElement(R.div,{ref:j(u,l),...f,"cmdk-separator":"",role:"separator"})}),Oe=n.forwardRef((t,l)=>{let{onValueChange:r,...f}=t,u=t.value!=null,c=re(),d=C(i=>i.search),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{t.value!=null&&c.setState("search",t.value)},[t.value]),n.createElement(R.input,{ref:l,...f,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":b.listId,"aria-labelledby":b.labelId,"aria-activedescendant":v,id:b.inputId,type:"text",value:u?t.value:d,onChange:i=>{u||c.setState("search",i.target.value),r?.(i.target.value)}})}),Be=n.forwardRef((t,l)=>{let{children:r,label:f="Suggestions",...u}=t,c=n.useRef(null),d=n.useRef(null),v=C(i=>i.selectedItemId),b=L();return n.useEffect(()=>{if(d.current&&c.current){let i=d.current,p=c.current,h,x=new ResizeObserver(()=>{h=requestAnimationFrame(()=>{let E=i.offsetHeight;p.style.setProperty("--cmdk-list-height",E.toFixed(1)+"px")})});return x.observe(i),()=>{cancelAnimationFrame(h),x.unobserve(i)}}},[]),n.createElement(R.div,{ref:j(c,l),...u,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":v,"aria-label":f,id:b.listId},z(t,i=>n.createElement("div",{ref:j(d,b.listInnerRef),"cmdk-list-sizer":""},i)))}),ze=n.forwardRef((t,l)=>{let{open:r,onOpenChange:f,overlayClassName:u,contentClassName:c,container:d,...v}=t;return n.createElement(Ee,{open:r,onOpenChange:f},n.createElement(ke,{container:d},n.createElement(Se,{"cmdk-overlay":"",className:u}),n.createElement(xe,{"aria-label":t.label,"cmdk-dialog":"",className:c},n.createElement(be,{ref:l,...v}))))}),Ue=n.forwardRef((t,l)=>C(r=>r.filtered.count===0)?n.createElement(R.div,{ref:l,...t,"cmdk-empty":"",role:"presentation"}):null),We=n.forwardRef((t,l)=>{let{progress:r,children:f,label:u="Loading...",...c}=t;return n.createElement(R.div,{ref:l,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":u},z(t,d=>n.createElement("div",{"aria-hidden":!0},d)))}),Ye=Object.assign(be,{List:Be,Item:Ve,Input:Oe,Group:je,Separator:Le,Dialog:ze,Empty:Ue,Loading:We});function He(t,l){let r=t.nextElementSibling;for(;r;){if(r.matches(l))return r;r=r.nextElementSibling}}function Ne(t,l){let r=t.previousElementSibling;for(;r;){if(r.matches(l))return r;r=r.previousElementSibling}}function we(t){let l=n.useRef(t);return $(()=>{l.current=t}),l}var $=typeof window>"u"?n.useEffect:n.useLayoutEffect;function K(t){let l=n.useRef();return l.current===void 0&&(l.current=t()),l}function C(t){let l=re(),r=()=>t(l.snapshot());return n.useSyncExternalStore(l.subscribe,r,r)}function ye(t,l,r,f=[]){let u=n.useRef(),c=L();return $(()=>{var d;let v=(()=>{var i;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(i=p.current.textContent)==null?void 0:i.trim():u.current}})(),b=f.map(i=>i.trim());c.value(t,v,b),(d=l.current)==null||d.setAttribute(F,v),u.current=v}),u}var Te=()=>{let[t,l]=n.useState(),r=K(()=>new Map);return $(()=>{r.current.forEach(f=>f()),r.current=new Map},[t]),(f,u)=>{r.current.set(f,u),l({})}};function Xe(t){let l=t.type;return typeof l=="function"?l(t.props):"render"in l?l.render(t.props):t}function z({asChild:t,children:l},r){return t&&n.isValidElement(l)?n.cloneElement(Xe(l),{ref:l.ref},r(l.props.children)):r(l)}var Ge={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};export{Ye as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,ai as A,j as c,a8 as v,av as I,am as L,ap as O,ao as S,ak as M,b7 as D}from"./index-DO8fUd54.js";const B=({size:e=24,color:o="currentColor",...s})=>t.createElement("svg",{viewBox:"0 0 24 24",width:e,height:e,stroke:o,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},t.createElement("path",{d:"M15.631 7.631c-.396-.396-.594-.594-.668-.822a1 1 0 0 1 0-.618c.074-.228.272-.426.668-.822L18.47 2.53a6 6 0 0 0-8.3 6.895c.12.49.179.734.168.888a.849.849 0 0 1-.11.392c-.07.138-.207.274-.48.547L3.5 17.5a2.121 2.121 0 0 0 3 3l6.248-6.248c.273-.273.41-.41.547-.48a.849.849 0 0 1 .392-.11c.154-.011.399.049.888.168a6 6 0 0 0 6.895-8.3l-2.84 2.84c-.396.396-.594.594-.822.668a1 1 0 0 1-.618 0c-.228-.074-.426-.272-.822-.668l-.738-.738Z"}));B.displayName="Tool01";var f="Collapsible",[F,z]=O(f),[G,h]=F(f),w=t.forwardRef((e,o)=>{const{__scopeCollapsible:s,open:r,defaultOpen:n,disabled:l,onOpenChange:i,...C}=e,[p,d]=A({prop:r,defaultProp:n??!1,onChange:i,caller:f});return c.jsx(G,{scope:s,disabled:l,contentId:I(),open:p,onOpenToggle:t.useCallback(()=>d(b=>!b),[d]),children:c.jsx(v.div,{"data-state":x(p),"data-disabled":l?"":void 0,...C,ref:o})})});w.displayName=f;var T="CollapsibleTrigger",j=t.forwardRef((e,o)=>{const{__scopeCollapsible:s,...r}=e,n=h(T,s);return c.jsx(v.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":x(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...r,ref:o,onClick:L(e.onClick,n.onOpenToggle)})});j.displayName=T;var g="CollapsibleContent",k=t.forwardRef((e,o)=>{const{forceMount:s,...r}=e,n=h(g,e.__scopeCollapsible);return c.jsx(S,{present:s||n.open,children:({present:l})=>c.jsx($,{...r,ref:o,present:l})})});k.displayName=g;var $=t.forwardRef((e,o)=>{const{__scopeCollapsible:s,present:r,children:n,...l}=e,i=h(g,s),[C,p]=t.useState(r),d=t.useRef(null),b=M(o,d),R=t.useRef(0),y=R.current,N=t.useRef(0),E=N.current,m=i.open||C,P=t.useRef(m),u=t.useRef(void 0);return t.useEffect(()=>{const a=requestAnimationFrame(()=>P.current=!1);return()=>cancelAnimationFrame(a)},[]),D(()=>{const a=d.current;if(a){u.current=u.current||{transitionDuration:a.style.transitionDuration,animationName:a.style.animationName},a.style.transitionDuration="0s",a.style.animationName="none";const _=a.getBoundingClientRect();R.current=_.height,N.current=_.width,P.current||(a.style.transitionDuration=u.current.transitionDuration,a.style.animationName=u.current.animationName),p(r)}},[i.open,r]),c.jsx(v.div,{"data-state":x(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...l,ref:b,style:{"--radix-collapsible-content-height":y?`${y}px`:void 0,"--radix-collapsible-content-width":E?`${E}px`:void 0,...e.style},children:m&&n})});function x(e){return e?"open":"closed"}var H=w,W=j,Z=k;export{j as C,H as R,W as T,k as a,B as b,Z as c,z as d};
|