decocms 2.364.3 → 2.365.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (449) hide show
  1. package/dist/client/assets/{AlertCircle-BNCl7-KE.js → AlertCircle-BUiQNi1g.js} +1 -1
  2. package/dist/client/assets/{ArrowNarrowLeft-DoLG4rPk.js → ArrowNarrowLeft-B-iJgi5p.js} +1 -1
  3. package/dist/client/assets/{ArrowUpRight-dM_balV_.js → ArrowUpRight-Bcc2ZOuq.js} +1 -1
  4. package/dist/client/assets/{Check-CVcAPsxw.js → Check-C6XoKiD0.js} +1 -1
  5. package/dist/client/assets/{CheckCircle-LNun5awz.js → CheckCircle-EJQkwVx_.js} +1 -1
  6. package/dist/client/assets/{ChevronDown-BrQ5SMJr.js → ChevronDown-BG0-uii1.js} +1 -1
  7. package/dist/client/assets/{ChevronRight-Cv88p4ps.js → ChevronRight-lpVCFpWI.js} +1 -1
  8. package/dist/client/assets/{ChevronUp-BEXPurOi.js → ChevronUp-C7MKl1aH.js} +1 -1
  9. package/dist/client/assets/{Container-UyfewUfa.js → Container-CCYhpski.js} +1 -1
  10. package/dist/client/assets/{DotsVertical-SlSMdJkj.js → DotsVertical-DUwrRRrO.js} +1 -1
  11. package/dist/client/assets/{FilterLines-D43-OQwr.js → FilterLines-C2GeuQuW.js} +1 -1
  12. package/dist/client/assets/{HardDrive-9oRtZKUj.js → HardDrive-JbvyX314.js} +1 -1
  13. package/dist/client/assets/{Key01-CR3cW4Ic.js → Key01-CDidhnng.js} +1 -1
  14. package/dist/client/assets/{LayoutLeft-DCkIyObc.js → LayoutLeft-D-a-mZcm.js} +1 -1
  15. package/dist/client/assets/{LinkExternal01-Di-5czt2.js → LinkExternal01-BgvZEm-X.js} +1 -1
  16. package/dist/client/assets/{Lock01-7UEvqN90.js → Lock01-DukFRLhX.js} +1 -1
  17. package/dist/client/assets/{Monitor01-B9n70Cxg.js → Monitor01-BBeIQXwu.js} +1 -1
  18. package/dist/client/assets/{Palette-CM8YcCMA.js → Palette-Cbp9TooA.js} +1 -1
  19. package/dist/client/assets/{Play-D-B65aXH.js → Play-Bu5xn8xm.js} +1 -1
  20. package/dist/client/assets/{Plus-Cy8cBKs0.js → Plus-D8dMVCG8.js} +1 -1
  21. package/dist/client/assets/{RefreshCcw01-DmmbBsed.js → RefreshCcw01-NZxMXXUu.js} +1 -1
  22. package/dist/client/assets/{SearchMd-DBFtSrcv.js → SearchMd-CZrB4Udl.js} +1 -1
  23. package/dist/client/assets/{Settings02-3MysM1BG.js → Settings02-DW-Wnk61.js} +1 -1
  24. package/dist/client/assets/{Shield01-HdcY4mrx.js → Shield01-BF1LUqlj.js} +1 -1
  25. package/dist/client/assets/{Star01-D8HBHDwu.js → Star01-Dsz3MamR.js} +1 -1
  26. package/dist/client/assets/{Stars02-GxNmnBiz.js → Stars02-DU-eReiu.js} +1 -1
  27. package/dist/client/assets/{Sun-CydVR3Ev.js → Sun-CjOl_eIW.js} +1 -1
  28. package/dist/client/assets/{SwitchHorizontal01-BnKnieWk.js → SwitchHorizontal01-DgnU6UpK.js} +1 -1
  29. package/dist/client/assets/{Tool01-A_tsfqwo.js → Tool01-B6glW0Sz.js} +1 -1
  30. package/dist/client/assets/{Trash01-ycnKf74n.js → Trash01-D5iQjfZH.js} +1 -1
  31. package/dist/client/assets/{Upload01-DYToW9Zt.js → Upload01-CRbIaVuw.js} +1 -1
  32. package/dist/client/assets/{User01-C3BOLDRp.js → User01-D-0COLHD.js} +1 -1
  33. package/dist/client/assets/{Users01-hicb3AcK.js → Users01-BXsiu59O.js} +1 -1
  34. package/dist/client/assets/{Users03-ZMVhIoHM.js → Users03-DxI7m72W.js} +1 -1
  35. package/dist/client/assets/{X-DPY2mUo2.js → X-CghOqPiW.js} +1 -1
  36. package/dist/client/assets/{XCircle-B83XL35R.js → XCircle-BAnMq3y8.js} +1 -1
  37. package/dist/client/assets/{XClose-4axhqxBQ.js → XClose-BtlseQCi.js} +1 -1
  38. package/dist/client/assets/{Zap-4q67D7Av.js → Zap-B9Rztg2v.js} +1 -1
  39. package/dist/client/assets/{ZapSquare-CLINFtDR.js → ZapSquare-B5X0r34a.js} +1 -1
  40. package/dist/client/assets/{accordion-DXkONO_m.js → accordion-B48sZGNg.js} +1 -1
  41. package/dist/client/assets/{add-connection-dialog-NHQqvsnL.js → add-connection-dialog-DeWWtS5l.js} +1 -1
  42. package/dist/client/assets/{agent-icon-iDRgsF6L.js → agent-icon-BtPamQTT.js} +1 -1
  43. package/dist/client/assets/{agent-icons-Cwm2SWG5.js → agent-icons-CfjWsNtB.js} +1 -1
  44. package/dist/client/assets/{agents-list-DzlzrVg4.js → agents-list-B0rifguo.js} +1 -1
  45. package/dist/client/assets/{ai-providers-vL31NHHj.js → ai-providers-CjAJVDeU.js} +1 -1
  46. package/dist/client/assets/{alert-DD3DsnPG.js → alert-DHu2hPyK.js} +1 -1
  47. package/dist/client/assets/{alert-dialog-30grTlQF.js → alert-dialog-B9ApqUuI.js} +1 -1
  48. package/dist/client/assets/{auth-catchall-CXal-oGb.js → auth-catchall-magvcZeO.js} +1 -1
  49. package/dist/client/assets/{auth-split-layout-DN4fv3Ih.js → auth-split-layout-DA4q8Bfk.js} +1 -1
  50. package/dist/client/assets/{automation-list-row-BHcl4Ohg.js → automation-list-row-9A_MZJgx.js} +1 -1
  51. package/dist/client/assets/{automations-BqqECuTg.js → automations-DiW8ArAp.js} +1 -1
  52. package/dist/client/assets/{avatar-KlYDn7qS.js → avatar-CC5qXjgF.js} +1 -1
  53. package/dist/client/assets/{badge-DuiHx46w.js → badge-BI7NQRYo.js} +1 -1
  54. package/dist/client/assets/{brand-context-BRwHlDBf.js → brand-context-DV3p99_h.js} +1 -1
  55. package/dist/client/assets/{card-BES0SMqR.js → card-BM5zwIyB.js} +1 -1
  56. package/dist/client/assets/{chat-context-DaCqMkjZ.js → chat-context-C7AI4EyX.js} +1 -1
  57. package/dist/client/assets/{checkbox-CjSQbGdc.js → checkbox-_FPlFvnC.js} +1 -1
  58. package/dist/client/assets/{cli-auth-success-CeBdZNYb.js → cli-auth-success-DxSIo4al.js} +1 -1
  59. package/dist/client/assets/{collection-detail-BMjP1kqy.js → collection-detail-ycc2WFgn.js} +1 -1
  60. package/dist/client/assets/{collection-display-button-D2FlqPoI.js → collection-display-button-CeEGick7.js} +1 -1
  61. package/dist/client/assets/{collection-search-C18GHA2r.js → collection-search-CRj5GlN2.js} +1 -1
  62. package/dist/client/assets/{collection-search-DVpwXfK_.js → collection-search-DvDmML5v.js} +1 -1
  63. package/dist/client/assets/{collection-table-wrapper-BCrn8XHN.js → collection-table-wrapper-CcVgetdF.js} +1 -1
  64. package/dist/client/assets/{collection-tabs-sb0bPFTC.js → collection-tabs-CkTIDC3A.js} +1 -1
  65. package/dist/client/assets/{collections-fkPfVMTg.js → collections-DYNhGJEX.js} +1 -1
  66. package/dist/client/assets/{command-CMqZx43I.js → command-CbYTzmrk.js} +1 -1
  67. package/dist/client/assets/{connect-desktop-dialog-BBezLAIc.js → connect-desktop-dialog-C_jFFd_F.js} +1 -1
  68. package/dist/client/assets/{connection-card-Dmdx8kTx.js → connection-card-BswapS_C.js} +1 -1
  69. package/dist/client/assets/{connection-detail-BO3q4d5o.js → connection-detail-DK4A8YWW.js} +1 -1
  70. package/dist/client/assets/{connection-form-helpers-DKAyPoDI.js → connection-form-helpers-Dn61c3nC.js} +1 -1
  71. package/dist/client/assets/{connections-BGh_njtW.js → connections-DuzgzZyf.js} +1 -1
  72. package/dist/client/assets/{constants-C4WRW-LO.js → constants-V3SVDRSK.js} +1 -1
  73. package/dist/client/assets/{decopilot-sse-pool-Cuj_gJYe.js → decopilot-sse-pool-DbOmfpLW.js} +1 -1
  74. package/dist/client/assets/{dialog-CEusfHMX.js → dialog-bygvGgb9.js} +1 -1
  75. package/dist/client/assets/{domain-settings-y81S8hCO.js → domain-settings-4vKE7ncf.js} +1 -1
  76. package/dist/client/assets/{drawer-T83Srv96.js → drawer-Bjmg0RR1.js} +1 -1
  77. package/dist/client/assets/{dropdown-menu-CT0lW-r3.js → dropdown-menu-CkTzcUR8.js} +1 -1
  78. package/dist/client/assets/{dynamic-plugin-layout-SdaMuY0y.js → dynamic-plugin-layout-D8yyBotc.js} +1 -1
  79. package/dist/client/assets/{empty-state-wvWmfCHy.js → empty-state-DW3JI1nZ.js} +1 -1
  80. package/dist/client/assets/{empty-state-DF748yNH.js → empty-state-Dg_dlwBN.js} +1 -1
  81. package/dist/client/assets/{extract-connection-data-DPlzs4kv.js → extract-connection-data-D3z53YWV.js} +1 -1
  82. package/dist/client/assets/{features-_BHWNmKI.js → features-ChVbD0gB.js} +1 -1
  83. package/dist/client/assets/{file-explorer-DO5wAK7w.js → file-explorer-0CMEQXCR.js} +1 -1
  84. package/dist/client/assets/{files-CjljowlM.js → files-hwxe9QZr.js} +1 -1
  85. package/dist/client/assets/{form-w71mMA8g.js → form-D_08NHUD.js} +1 -1
  86. package/dist/client/assets/{general-C_e5zcVD.js → general-BE7htsNN.js} +1 -1
  87. package/dist/client/assets/{generate-id-7pqGD8tV.js → generate-id-DtDqQvIv.js} +1 -1
  88. package/dist/client/assets/{github-repo-picker-BeChvUwA.js → github-repo-picker-TJIVPHBK.js} +1 -1
  89. package/dist/client/assets/{hooks-4Fwh9Blb.js → hooks-BXgqK-cH.js} +1 -1
  90. package/dist/client/assets/{hover-card-CYskLAbg.js → hover-card-TYrElsp0.js} +1 -1
  91. package/dist/client/assets/{index-LZKnK7-L.js → index-B6XA74F9.js} +1 -1
  92. package/dist/client/assets/{index-CVkezZw-.js → index-B6pGpYG6.js} +1 -1
  93. package/dist/client/assets/{index-Dd-6eUgN.js → index-B8fvR6LT.js} +1 -1
  94. package/dist/client/assets/{index-B8hvScUv.js → index-BtA594Jz.js} +1 -1
  95. package/dist/client/assets/{index-COBzfRZi.js → index-CNE80A83.js} +1 -1
  96. package/dist/client/assets/{index-BxHwWiH7.js → index-CkxTcifU.js} +1 -1
  97. package/dist/client/assets/{index-CYLlX3M9.js → index-D40kOj2v.js} +1 -1
  98. package/dist/client/assets/{index-vxjov_Cc.js → index-DBjlNX3z.js} +1 -1
  99. package/dist/client/assets/{index-gG2GSDDp.js → index-DFLHG9Oe.js} +1 -1
  100. package/dist/client/assets/{index-n2o4du3Y.js → index-DgmKj-EK.js} +1 -1
  101. package/dist/client/assets/{index-B_W9Dr0z.js → index-DiUgXBaI.js} +4 -4
  102. package/dist/client/assets/{index-DfaUClFh.js → index-KugLBWj9.js} +1 -1
  103. package/dist/client/assets/{index-BIUYFQag.js → index-P-hLEHL2.js} +1 -1
  104. package/dist/client/assets/{index-BQhmgiEq.js → index-c9Pbt5D9.js} +2 -2
  105. package/dist/client/assets/{index-BvtnVXmy.js → index-dXxsh3Iz.js} +1 -1
  106. package/dist/client/assets/index-zzGnf4We.js +1 -0
  107. package/dist/client/assets/{infiniteQueryObserver-CbM0kgNm.js → infiniteQueryObserver-CFFNkbfX.js} +1 -1
  108. package/dist/client/assets/{input-DZxKc7J0.js → input-BGaLq3ax.js} +1 -1
  109. package/dist/client/assets/{integration-icon-DewzWl2m.js → integration-icon-8egQk7i2.js} +1 -1
  110. package/dist/client/assets/{label-B1la-fci.js → label-BUt9seyW.js} +1 -1
  111. package/dist/client/assets/{layout-CKEXWCBb.js → layout-BQK7K5Pq.js} +1 -1
  112. package/dist/client/assets/{login-X1PhOapo.js → login-DwjnK22s.js} +1 -1
  113. package/dist/client/assets/{members-BzY4jGpr.js → members-DDG_y2wg.js} +1 -1
  114. package/dist/client/assets/{monaco-editor-UMtzBWTI.js → monaco-editor-6TmJdiGm.js} +1 -1
  115. package/dist/client/assets/{monitoring-stats-row-CYnzq1NO.js → monitoring-stats-row-D5sxIGbz.js} +1 -1
  116. package/dist/client/assets/{oauth-callback-D4lrgj7R.js → oauth-callback-B1F9NMJm.js} +1 -1
  117. package/dist/client/assets/{oauth-callback-ai-provider-CPKDMOtX.js → oauth-callback-ai-provider-DYl02pPg.js} +1 -1
  118. package/dist/client/assets/{onboarding-H8vSkvF8.js → onboarding-D6jujOMz.js} +1 -1
  119. package/dist/client/assets/{org-layout-C7b-Ct9H.js → org-layout-DKyZtL1W.js} +1 -1
  120. package/dist/client/assets/{org-plugin-layout-wOnrH2kj.js → org-plugin-layout-BVq0stpE.js} +1 -1
  121. package/dist/client/assets/{pair-Bfj0tAv6.js → pair-DbOJR5nL.js} +1 -1
  122. package/dist/client/assets/{plugin-empty-state-CwgJ7jY5.js → plugin-empty-state-lHHHsoKY.js} +1 -1
  123. package/dist/client/assets/{plugin-header-Cj7-LT8-.js → plugin-header-DgU6XRJp.js} +1 -1
  124. package/dist/client/assets/{plugin-layout-DLKyTrDc.js → plugin-layout-_zCxsn_M.js} +1 -1
  125. package/dist/client/assets/{popover-mJmOGcvZ.js → popover-BLsl1Wwx.js} +1 -1
  126. package/dist/client/assets/{profile-nye86xbC.js → profile-Ca8D8jB_.js} +1 -1
  127. package/dist/client/assets/{project-app-view-BEJERKGL.js → project-app-view-dfCAAazi.js} +1 -1
  128. package/dist/client/assets/registry-Bg-4_N8V.js +2 -0
  129. package/dist/client/assets/{registry-layout-BjSveN7C.js → registry-layout-C-YkiCiQ.js} +1 -1
  130. package/dist/client/assets/{required-auth-layout-BQrAafe2.js → required-auth-layout-DH-f2CaU.js} +1 -1
  131. package/dist/client/assets/{reset-password-Qhu37IkB.js → reset-password-B9rKZimn.js} +1 -1
  132. package/dist/client/assets/{roles-D5ciZufw.js → roles-8uscquIf.js} +1 -1
  133. package/dist/client/assets/{search-input-BqlqV-_0.js → search-input-DZC3FA9U.js} +1 -1
  134. package/dist/client/assets/{secrets-7Jk6eNEc.js → secrets-Bl71TYuF.js} +1 -1
  135. package/dist/client/assets/{sections-editor-D_2uvu0E.js → sections-editor-CtrNziR9.js} +1 -1
  136. package/dist/client/assets/{select-C-gPp7G9.js → select-btdbQqQB.js} +1 -1
  137. package/dist/client/assets/{settings-layout-Cw-_d_nm.js → settings-layout-Dqdbrajv.js} +1 -1
  138. package/dist/client/assets/{settings-section-DApFkTeu.js → settings-section-B8Od5ijm.js} +1 -1
  139. package/dist/client/assets/{shell-controls-DeJL2a7u.js → shell-controls-Cpc7zjLw.js} +1 -1
  140. package/dist/client/assets/{shell-layout-BOxsGjDb.js → shell-layout-DpoJLGrK.js} +1 -1
  141. package/dist/client/assets/{sidebar-D6d-v_Pc.js → sidebar-D-_ciNlc.js} +1 -1
  142. package/dist/client/assets/{skeleton-RfCTKn6Y.js → skeleton-CCsx--iC.js} +1 -1
  143. package/dist/client/assets/{sortable.esm-BXIgGJxQ.js → sortable.esm-DWCPENgE.js} +1 -1
  144. package/dist/client/assets/{spinner-NqyTThDx.js → spinner-Dbsg4e4M.js} +1 -1
  145. package/dist/client/assets/{sso-BK6CSnRS.js → sso-DKBw_dCD.js} +1 -1
  146. package/dist/client/assets/{store-C5VGH9Ff.js → store-DRHB__wC.js} +1 -1
  147. package/dist/client/assets/store-registry-DnyJL09S.js +2 -0
  148. package/dist/client/assets/{switch-BqVfJaaE.js → switch-BPaF7GST.js} +1 -1
  149. package/dist/client/assets/{table-RmWD5bZv.js → table-TcgYyI5g.js} +1 -1
  150. package/dist/client/assets/{tabs-C84e7ZOt.js → tabs-CArqhjUQ.js} +1 -1
  151. package/dist/client/assets/{task-status-Dl8gKUMi.js → task-status-Cosx-AHw.js} +1 -1
  152. package/dist/client/assets/{textarea-D08XpeH3.js → textarea-CLLp6KTK.js} +1 -1
  153. package/dist/client/assets/{toggle-group-D8XVv0W2.js → toggle-group-CyhRMoao.js} +1 -1
  154. package/dist/client/assets/{toolbar-DcHaxh2N.js → toolbar-BXyHZxUa.js} +1 -1
  155. package/dist/client/assets/{tools-list-rsD1aCdR.js → tools-list-CIfKFLCC.js} +1 -1
  156. package/dist/client/assets/{tooltip-IAEIrTVw.js → tooltip-DuHhGuNb.js} +1 -1
  157. package/dist/client/assets/{types-THJHjNYw.js → types-CKyex3WY.js} +1 -1
  158. package/dist/client/assets/{use-ai-providers-BtEkhdod.js → use-ai-providers-DXY8w1gk.js} +1 -1
  159. package/dist/client/assets/{use-collections-B5chukT1.js → use-collections-DV-Yw7Rl.js} +1 -1
  160. package/dist/client/assets/{use-connection-CqLc2kCT.js → use-connection-DPPCfeow.js} +1 -1
  161. package/dist/client/assets/{use-copy-x4stjSR_.js → use-copy-CObefyk7.js} +1 -1
  162. package/dist/client/assets/{use-create-virtual-mcp-B2e6V1M8.js → use-create-virtual-mcp-ClMf9M2U.js} +1 -1
  163. package/dist/client/assets/{use-create-website-agent-DO3Reh-r.js → use-create-website-agent-D_7O7M84.js} +1 -1
  164. package/dist/client/assets/{use-debounced-autosave-sCbU6V0n.js → use-debounced-autosave-CYLSA65X.js} +1 -1
  165. package/dist/client/assets/{use-delete-connection-CQU3mfvU.js → use-delete-connection-2Y6JpaXB.js} +1 -1
  166. package/dist/client/assets/{use-file-configs-jYMYwC9U.js → use-file-configs-CkJCW_0J.js} +1 -1
  167. package/dist/client/assets/{use-infinite-scroll-CgCif0T0.js → use-infinite-scroll-BIl8Btbp.js} +1 -1
  168. package/dist/client/assets/{use-list-state-D6p_uKvt.js → use-list-state-BCQHlt2C.js} +1 -1
  169. package/dist/client/assets/{use-mcp-prompts-e9YFDYF0.js → use-mcp-prompts-D707fXp5.js} +1 -1
  170. package/dist/client/assets/{use-mcp-tools-BsnzIOtc.js → use-mcp-tools-BpkMOXfX.js} +1 -1
  171. package/dist/client/assets/{use-members-MgBmqs7x.js → use-members-BBMhepEt.js} +1 -1
  172. package/dist/client/assets/{use-navigate-to-agent-BtQa4OwG.js → use-navigate-to-agent-CeGlZmmn.js} +1 -1
  173. package/dist/client/assets/{use-org-auth-client-BXGwtUzc.js → use-org-auth-client-DnKeoeEP.js} +1 -1
  174. package/dist/client/assets/{use-org-sso-JuaVORNY.js → use-org-sso-4uCrf8x0.js} +1 -1
  175. package/dist/client/assets/{use-organization-roles-CbkFJiRw.js → use-organization-roles-B4hkYRiT.js} +1 -1
  176. package/dist/client/assets/{use-organization-settings-DoIv1zqR.js → use-organization-settings-AWz6cpVk.js} +1 -1
  177. package/dist/client/assets/{use-registry-connections-C8o36UIG.js → use-registry-connections-BLF2Iu3j.js} +1 -1
  178. package/dist/client/assets/{use-secrets-BAKSVIhF.js → use-secrets-DE0Aqna8.js} +1 -1
  179. package/dist/client/assets/{use-status-sounds-BvXs5nVW.js → use-status-sounds-SJ0KRIgZ.js} +1 -1
  180. package/dist/client/assets/{use-view-mode-2VzWrKsP.js → use-view-mode-DPdHQRdb.js} +1 -1
  181. package/dist/client/assets/{use-virtual-mcp-DPVntSu2.js → use-virtual-mcp-BzxmTmXo.js} +1 -1
  182. package/dist/client/assets/useInfiniteQuery-B_xNiJ7y.js +1 -0
  183. package/dist/client/assets/{useRouterState-DZLFFWHa.js → useRouterState-DXQ9JAOk.js} +1 -1
  184. package/dist/client/assets/useSuspenseInfiniteQuery-B2fx93nW.js +1 -0
  185. package/dist/client/assets/{user-BIhwSu8_.js → user-BDVV447T.js} +1 -1
  186. package/dist/client/assets/{view-mode-toggle-D1dUZXpK.js → view-mode-toggle-BeU9M-dx.js} +1 -1
  187. package/dist/client/assets/{workflow-CYYTNdIs.js → workflow-6p4Uluo2.js} +1 -1
  188. package/dist/client/assets/workflow-detail-CZNMnpz0.js +1 -0
  189. package/dist/client/index.html +1 -1
  190. package/dist/server/cli.js +1 -1
  191. package/dist/server/node_modules/@opentelemetry/core/build/esm/baggage/utils.js +9 -22
  192. package/dist/server/node_modules/@opentelemetry/core/build/esm/baggage/utils.js.map +1 -1
  193. package/dist/server/node_modules/@opentelemetry/core/build/esm/common/time.d.ts +0 -3
  194. package/dist/server/node_modules/@opentelemetry/core/build/esm/common/time.js +8 -6
  195. package/dist/server/node_modules/@opentelemetry/core/build/esm/common/time.js.map +1 -1
  196. package/dist/server/node_modules/@opentelemetry/core/build/esm/common/types.d.ts +10 -0
  197. package/dist/server/node_modules/@opentelemetry/core/build/esm/common/types.js.map +1 -1
  198. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/globalThis.d.ts +10 -0
  199. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/globalThis.js +35 -0
  200. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/globalThis.js.map +1 -0
  201. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/index.d.ts +2 -5
  202. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js +2 -5
  203. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js.map +1 -1
  204. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/performance.d.ts +5 -0
  205. package/dist/server/node_modules/@opentelemetry/core/build/esm/{common/globalThis.js → platform/browser/performance.js} +2 -5
  206. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/browser/performance.js.map +1 -0
  207. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.d.ts +3 -0
  208. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.js +19 -0
  209. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/globalThis.js.map +1 -0
  210. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/index.d.ts +2 -8
  211. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/index.js +2 -5
  212. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/index.js.map +1 -1
  213. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/performance.d.ts +5 -0
  214. package/dist/server/node_modules/@opentelemetry/core/build/{esnext/common/globalThis.js → esm/platform/node/performance.js} +3 -5
  215. package/dist/server/node_modules/@opentelemetry/core/build/esm/platform/node/performance.js.map +1 -0
  216. package/dist/server/node_modules/@opentelemetry/core/build/esm/utils/callback.d.ts +3 -3
  217. package/dist/server/node_modules/@opentelemetry/core/build/esm/utils/callback.js +5 -5
  218. package/dist/server/node_modules/@opentelemetry/core/build/esm/utils/callback.js.map +1 -1
  219. package/dist/server/node_modules/@opentelemetry/core/build/esm/version.d.ts +1 -1
  220. package/dist/server/node_modules/@opentelemetry/core/build/esm/version.js +1 -1
  221. package/dist/server/node_modules/@opentelemetry/core/build/esm/version.js.map +1 -1
  222. package/dist/server/node_modules/@opentelemetry/core/build/esnext/baggage/utils.js +9 -22
  223. package/dist/server/node_modules/@opentelemetry/core/build/esnext/baggage/utils.js.map +1 -1
  224. package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/time.d.ts +0 -3
  225. package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/time.js +8 -6
  226. package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/time.js.map +1 -1
  227. package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/types.d.ts +10 -0
  228. package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/types.js.map +1 -1
  229. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/globalThis.d.ts +10 -0
  230. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/globalThis.js +35 -0
  231. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/globalThis.js.map +1 -0
  232. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/index.d.ts +2 -5
  233. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/index.js +2 -5
  234. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/index.js.map +1 -1
  235. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/performance.d.ts +5 -0
  236. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/performance.js +17 -0
  237. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/browser/performance.js.map +1 -0
  238. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/globalThis.d.ts +3 -0
  239. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/globalThis.js +19 -0
  240. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/globalThis.js.map +1 -0
  241. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/index.d.ts +2 -8
  242. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/index.js +2 -5
  243. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/index.js.map +1 -1
  244. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/performance.d.ts +5 -0
  245. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/performance.js +18 -0
  246. package/dist/server/node_modules/@opentelemetry/core/build/esnext/platform/node/performance.js.map +1 -0
  247. package/dist/server/node_modules/@opentelemetry/core/build/esnext/utils/callback.d.ts +3 -3
  248. package/dist/server/node_modules/@opentelemetry/core/build/esnext/utils/callback.js +5 -5
  249. package/dist/server/node_modules/@opentelemetry/core/build/esnext/utils/callback.js.map +1 -1
  250. package/dist/server/node_modules/@opentelemetry/core/build/esnext/version.d.ts +1 -1
  251. package/dist/server/node_modules/@opentelemetry/core/build/esnext/version.js +1 -1
  252. package/dist/server/node_modules/@opentelemetry/core/build/esnext/version.js.map +1 -1
  253. package/dist/server/node_modules/@opentelemetry/core/build/src/baggage/utils.js +9 -22
  254. package/dist/server/node_modules/@opentelemetry/core/build/src/baggage/utils.js.map +1 -1
  255. package/dist/server/node_modules/@opentelemetry/core/build/src/common/time.d.ts +0 -3
  256. package/dist/server/node_modules/@opentelemetry/core/build/src/common/time.js +8 -6
  257. package/dist/server/node_modules/@opentelemetry/core/build/src/common/time.js.map +1 -1
  258. package/dist/server/node_modules/@opentelemetry/core/build/src/common/types.d.ts +10 -0
  259. package/dist/server/node_modules/@opentelemetry/core/build/src/common/types.js.map +1 -1
  260. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/globalThis.d.ts +10 -0
  261. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/globalThis.js +38 -0
  262. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/globalThis.js.map +1 -0
  263. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/index.d.ts +2 -5
  264. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/index.js +4 -6
  265. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/index.js.map +1 -1
  266. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/performance.d.ts +5 -0
  267. package/dist/server/node_modules/@opentelemetry/core/build/src/{common/globalThis.js → platform/browser/performance.js} +3 -6
  268. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/browser/performance.js.map +1 -0
  269. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.d.ts +3 -0
  270. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js +22 -0
  271. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js.map +1 -0
  272. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/index.d.ts +2 -8
  273. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/index.js +4 -6
  274. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/index.js.map +1 -1
  275. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/performance.d.ts +5 -0
  276. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/performance.js +21 -0
  277. package/dist/server/node_modules/@opentelemetry/core/build/src/platform/node/performance.js.map +1 -0
  278. package/dist/server/node_modules/@opentelemetry/core/build/src/utils/callback.d.ts +3 -3
  279. package/dist/server/node_modules/@opentelemetry/core/build/src/utils/callback.js +5 -5
  280. package/dist/server/node_modules/@opentelemetry/core/build/src/utils/callback.js.map +1 -1
  281. package/dist/server/node_modules/@opentelemetry/core/build/src/version.d.ts +1 -1
  282. package/dist/server/node_modules/@opentelemetry/core/build/src/version.js +1 -1
  283. package/dist/server/node_modules/@opentelemetry/core/build/src/version.js.map +1 -1
  284. package/dist/server/node_modules/@opentelemetry/core/package.json +4 -5
  285. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js +6 -36
  286. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/generated/root.js.map +1 -1
  287. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js +0 -15
  288. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js.map +1 -1
  289. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js +6 -36
  290. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/generated/root.js.map +1 -1
  291. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js +0 -15
  292. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/esnext/trace/internal.js.map +1 -1
  293. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js +6 -36
  294. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/generated/root.js.map +1 -1
  295. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js +0 -15
  296. package/dist/server/node_modules/@opentelemetry/otlp-transformer/build/src/trace/internal.js.map +1 -1
  297. package/dist/server/node_modules/@opentelemetry/otlp-transformer/package.json +14 -12
  298. package/dist/server/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js +1 -1
  299. package/dist/server/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js.map +1 -1
  300. package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.d.ts +1 -1
  301. package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.js +1 -1
  302. package/dist/server/node_modules/@opentelemetry/resources/build/esm/index.js.map +1 -1
  303. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.d.ts +2 -0
  304. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js +19 -0
  305. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/default-service-name.js.map +1 -0
  306. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.d.ts +2 -0
  307. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.js +17 -0
  308. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/browser/index.js.map +1 -0
  309. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.d.ts +2 -0
  310. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.js +17 -0
  311. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/index.js.map +1 -0
  312. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.d.ts +2 -0
  313. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js +19 -0
  314. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/default-service-name.js.map +1 -0
  315. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/index.d.ts +2 -0
  316. package/dist/server/node_modules/@opentelemetry/resources/build/esm/platform/node/index.js +17 -0
  317. package/dist/server/node_modules/@opentelemetry/{core/build/src/common/globalThis.js.map → resources/build/esm/platform/node/index.js.map} +1 -1
  318. package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.d.ts +1 -0
  319. package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.js +3 -0
  320. package/dist/server/node_modules/@opentelemetry/resources/build/esm/utils.js.map +1 -1
  321. package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.d.ts +1 -1
  322. package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.js +1 -1
  323. package/dist/server/node_modules/@opentelemetry/resources/build/esm/version.js.map +1 -1
  324. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/ResourceImpl.js +1 -1
  325. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/ResourceImpl.js.map +1 -1
  326. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.d.ts +1 -1
  327. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.js +1 -1
  328. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/index.js.map +1 -1
  329. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.d.ts +2 -0
  330. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.js +19 -0
  331. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/default-service-name.js.map +1 -0
  332. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.d.ts +2 -0
  333. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.js +17 -0
  334. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/browser/index.js.map +1 -0
  335. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.d.ts +2 -0
  336. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.js +17 -0
  337. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/index.js.map +1 -0
  338. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.d.ts +2 -0
  339. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.js +19 -0
  340. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/default-service-name.js.map +1 -0
  341. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.d.ts +2 -0
  342. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.js +17 -0
  343. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/platform/node/index.js.map +1 -0
  344. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.d.ts +1 -0
  345. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.js +3 -0
  346. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/utils.js.map +1 -1
  347. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.d.ts +1 -1
  348. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.js +1 -1
  349. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/version.js.map +1 -1
  350. package/dist/server/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js +2 -2
  351. package/dist/server/node_modules/@opentelemetry/resources/build/src/ResourceImpl.js.map +1 -1
  352. package/dist/server/node_modules/@opentelemetry/resources/build/src/index.d.ts +1 -1
  353. package/dist/server/node_modules/@opentelemetry/resources/build/src/index.js +2 -2
  354. package/dist/server/node_modules/@opentelemetry/resources/build/src/index.js.map +1 -1
  355. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.d.ts +2 -0
  356. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.js +23 -0
  357. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/default-service-name.js.map +1 -0
  358. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.d.ts +2 -0
  359. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.js +21 -0
  360. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/browser/index.js.map +1 -0
  361. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.d.ts +2 -0
  362. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.js +21 -0
  363. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/index.js.map +1 -0
  364. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.d.ts +2 -0
  365. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js +23 -0
  366. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js.map +1 -0
  367. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.d.ts +2 -0
  368. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.js +21 -0
  369. package/dist/server/node_modules/@opentelemetry/resources/build/src/platform/node/index.js.map +1 -0
  370. package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.d.ts +1 -0
  371. package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.js +5 -1
  372. package/dist/server/node_modules/@opentelemetry/resources/build/src/utils.js.map +1 -1
  373. package/dist/server/node_modules/@opentelemetry/resources/build/src/version.d.ts +1 -1
  374. package/dist/server/node_modules/@opentelemetry/resources/build/src/version.js +1 -1
  375. package/dist/server/node_modules/@opentelemetry/resources/build/src/version.js.map +1 -1
  376. package/dist/server/node_modules/@opentelemetry/resources/package.json +9 -5
  377. package/dist/server/node_modules/get-east-asian-width/index.d.ts +60 -0
  378. package/dist/server/node_modules/get-east-asian-width/index.js +30 -0
  379. package/dist/server/node_modules/get-east-asian-width/lookup-data.js +18 -0
  380. package/dist/server/node_modules/get-east-asian-width/lookup.js +135 -0
  381. package/dist/server/node_modules/get-east-asian-width/package.json +71 -0
  382. package/dist/server/node_modules/get-east-asian-width/readme.md +65 -0
  383. package/dist/server/node_modules/get-east-asian-width/utilities.js +24 -0
  384. package/dist/server/node_modules/protobufjs/dist/light/protobuf.js +13 -10
  385. package/dist/server/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  386. package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  387. package/dist/server/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  388. package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  389. package/dist/server/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  390. package/dist/server/node_modules/protobufjs/dist/protobuf.js +14 -55
  391. package/dist/server/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  392. package/dist/server/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  393. package/dist/server/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  394. package/dist/server/node_modules/protobufjs/package.json +1 -1
  395. package/dist/server/node_modules/protobufjs/src/message.js +7 -3
  396. package/dist/server/node_modules/protobufjs/src/object.js +3 -6
  397. package/dist/server/node_modules/protobufjs/src/parse.js +1 -45
  398. package/dist/server/node_modules/protobufjs/src/type.js +1 -0
  399. package/dist/server/node_modules/xtend/.jshintrc +30 -0
  400. package/dist/server/node_modules/{postgres-date/license → xtend/LICENSE} +1 -2
  401. package/dist/server/node_modules/xtend/README.md +32 -0
  402. package/dist/server/node_modules/xtend/immutable.js +19 -0
  403. package/dist/server/node_modules/xtend/mutable.js +17 -0
  404. package/dist/server/node_modules/xtend/package.json +55 -0
  405. package/dist/server/node_modules/xtend/test.js +103 -0
  406. package/package.json +1 -1
  407. package/dist/client/assets/index-DOK7_ohT.js +0 -1
  408. package/dist/client/assets/registry-bNkBISAa.js +0 -2
  409. package/dist/client/assets/store-registry-CVqLvY0j.js +0 -2
  410. package/dist/client/assets/useInfiniteQuery-DKkhiiov.js +0 -1
  411. package/dist/client/assets/useSuspenseInfiniteQuery-m9tx-DXA.js +0 -1
  412. package/dist/client/assets/workflow-detail-BI1YgTJB.js +0 -1
  413. package/dist/server/node_modules/@opentelemetry/core/build/esm/common/globalThis.d.ts +0 -5
  414. package/dist/server/node_modules/@opentelemetry/core/build/esm/common/globalThis.js.map +0 -1
  415. package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/globalThis.d.ts +0 -5
  416. package/dist/server/node_modules/@opentelemetry/core/build/esnext/common/globalThis.js.map +0 -1
  417. package/dist/server/node_modules/@opentelemetry/core/build/src/common/globalThis.d.ts +0 -5
  418. package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.d.ts +0 -9
  419. package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.js +0 -38
  420. package/dist/server/node_modules/@opentelemetry/resources/build/esm/default-service-name.js.map +0 -1
  421. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.d.ts +0 -9
  422. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.js +0 -38
  423. package/dist/server/node_modules/@opentelemetry/resources/build/esnext/default-service-name.js.map +0 -1
  424. package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.d.ts +0 -9
  425. package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.js +0 -43
  426. package/dist/server/node_modules/@opentelemetry/resources/build/src/default-service-name.js.map +0 -1
  427. package/dist/server/node_modules/@protobufjs/inquire/LICENSE +0 -26
  428. package/dist/server/node_modules/@protobufjs/inquire/README.md +0 -13
  429. package/dist/server/node_modules/@protobufjs/inquire/index.d.ts +0 -9
  430. package/dist/server/node_modules/@protobufjs/inquire/index.js +0 -37
  431. package/dist/server/node_modules/@protobufjs/inquire/package.json +0 -21
  432. package/dist/server/node_modules/@protobufjs/inquire/tests/data/array.js +0 -1
  433. package/dist/server/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +0 -1
  434. package/dist/server/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +0 -1
  435. package/dist/server/node_modules/@protobufjs/inquire/tests/data/object.js +0 -1
  436. package/dist/server/node_modules/@protobufjs/inquire/tests/index.js +0 -20
  437. package/dist/server/node_modules/ansi-styles/index.d.ts +0 -236
  438. package/dist/server/node_modules/ansi-styles/index.js +0 -223
  439. package/dist/server/node_modules/ansi-styles/package.json +0 -54
  440. package/dist/server/node_modules/ansi-styles/readme.md +0 -173
  441. package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
  442. package/dist/server/node_modules/is-fullwidth-code-point/index.js +0 -12
  443. package/dist/server/node_modules/is-fullwidth-code-point/license +0 -9
  444. package/dist/server/node_modules/is-fullwidth-code-point/package.json +0 -53
  445. package/dist/server/node_modules/is-fullwidth-code-point/readme.md +0 -31
  446. package/dist/server/node_modules/postgres-date/index.js +0 -116
  447. package/dist/server/node_modules/postgres-date/package.json +0 -33
  448. package/dist/server/node_modules/postgres-date/readme.md +0 -49
  449. /package/dist/server/node_modules/{ansi-styles → get-east-asian-width}/license +0 -0
@@ -1 +1 @@
1
- import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,q as $,aL as k,K as D,c as E,j as x}from"./index-BQhmgiEq.js";import{u as K}from"./use-registry-connections-C8o36UIG.js";import{u as Q}from"./use-organization-settings-DoIv1zqR.js";import{S as w,c as q}from"./constants-C4WRW-LO.js";import{u as F}from"./useInfiniteQuery-DKkhiiov.js";import{i as H,f as G}from"./extract-connection-data-DPlzs4kv.js";import{C as U}from"./card-BES0SMqR.js";import{I as V}from"./integration-icon-DewzWl2m.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function L(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:P}=F({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await q({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const b=await C.callTool({name:j,arguments:I}),N=b.structuredContent??b,M=N.nextCursor||N.cursor||void 0,A=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:A,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:P,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const P=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==P||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:P,loadMore:a},t[10]=c,t[11]=P,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return L(s)}function Z(s){return!L(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,P=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==P?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",P,d),e[0]=d,e[1]=P,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let b;e[28]!==m?(b=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=b):b=e[29];let N;e[30]!==I||e[31]!==b?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,b]}),e[30]=I,e[31]=b,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
1
+ import{g as _}from"./connection-slug-eyAPH6o3.js";import{e as R,q as $,aL as k,K as D,c as E,j as x}from"./index-c9Pbt5D9.js";import{u as K}from"./use-registry-connections-BLF2Iu3j.js";import{u as Q}from"./use-organization-settings-AWz6cpVk.js";import{S as w,c as q}from"./constants-V3SVDRSK.js";import{u as F}from"./useInfiniteQuery-B_xNiJ7y.js";import{i as H,f as G}from"./extract-connection-data-D3z53YWV.js";import{C as U}from"./card-BM5zwIyB.js";import{I as V}from"./integration-icon-8egQk7i2.js";function ae(s){const e=new Map;for(const o of s){const l=_(o),r=e.get(l);r?r.push(o):e.set(l,[o])}const t=[],u=new Set;for(const o of s){const l=_(o);if(u.has(l))continue;u.add(l);const r=e.get(l),m=r[0];r.length===1?t.push({type:"single",connection:m}):t.push({type:"group",key:l,icon:m.icon,title:m.app_name?m.title.replace(/\s*\(\d+\)\s*$/,""):m.title,connections:r})}return t}function ce(){const s=R.c(6),e=K(),t=Q(),u=$().project.enabledPlugins??[];let o;if(s[0]!==u||s[1]!==t||s[2]!==e){let l;s[4]!==t?(l=r=>t(r.id),s[4]=t,s[5]=l):l=s[5],o=e.filter(l).map(X),u.includes("private-registry")&&t(w)&&o.push({id:w,title:"Private Registry",icon:null}),s[0]=u,s[1]=t,s[2]=e,s[3]=o}else o=s[3];return o}function X(s){return{id:s.id,title:s.title,icon:s.icon}}const Y=24,S=3;function L(s){return s.id.includes("community-registry")}function z(s){const e=s?.trim();if(e)return{operator:"or",conditions:[{field:["title"],operator:"contains",value:e},{field:["description"],operator:"contains",value:e},{field:["name"],operator:"contains",value:e},{field:["server","title"],operator:"contains",value:e}]}}function T(s,e,t,u,o){const l=s.map(c=>c.id).sort().join(","),r=z(o),{data:m,fetchNextPage:d,hasNextPage:f,isFetchingNextPage:p,isLoading:P}=F({queryKey:D.storeDiscovery(e,`${l}:${o??""}`),queryFn:async({pageParam:c})=>{const n=c??{};return await Promise.all(s.map(async i=>{const y=n[i.id];if(y==="EXHAUSTED")return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]};const j=H(i.id,e);let h;for(let v=0;v<S;v++){let C=null;try{C=await q({connectionId:i.id,orgId:e,orgSlug:t});const I={limit:Y};y&&(I.cursor=y),r&&(I.where=r);const b=await C.callTool({name:j,arguments:I}),N=b.structuredContent??b,M=N.nextCursor||N.cursor||void 0,A=G(N?[N]:[]);return{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:A,nextCursor:M}}catch(I){h=I}finally{await C?.close().catch(()=>{})}}return console.warn(`[useMergedStoreDiscovery] Registry "${i.title}" (${i.id}) failed after ${S} attempts:`,h),{registryId:i.id,registryTitle:i.title,registryIcon:i.icon,items:[]}}))},initialPageParam:{},getNextPageParam:c=>{const n={};let a=!1;for(const i of c)i.registryId&&(i.nextCursor?(n[i.registryId]=i.nextCursor,a=!0):n[i.registryId]="EXHAUSTED");return a?n:void 0},staleTime:3600*1e3,placeholderData:k,retry:!1,enabled:s.length>0}),g=[];if(m?.pages)for(const c of m.pages)for(const n of c)for(const a of n.items)g.push({...a,_sourceName:a._sourceName??n.registryTitle,_sourceIcon:a._sourceIcon??n.registryIcon,_registryId:a._registryId??n.registryId});return{items:g,hasMore:f??!1,isLoadingMore:p,isInitialLoading:P,fetchNextPage:()=>{f&&!p&&d()}}}function ue(s,e){const t=R.c(16),{org:u}=$();let o;t[0]!==s?(o=s.filter(Z),t[0]=s,t[1]=o):o=t[1];const l=o;let r;t[2]!==s?(r=s.filter(W),t[2]=s,t[3]=r):r=t[3];const m=r,d=T(l,u.id,u.slug,!0,e),f=T(m,u.id,u.slug,!0,e);let p;if(t[4]!==f.items||t[5]!==d.items){const y=new Set;p=[];const j=[...d.items,...f.items];for(const h of j){const v=`${h._registryId}:${h.id}`;y.has(v)||(y.add(v),p.push(h))}t[4]=f.items,t[5]=d.items,t[6]=p}else p=t[6];const P=d.isInitialLoading||f.isInitialLoading,g=d.isLoadingMore||f.isLoadingMore,c=d.hasMore||f.hasMore;let n;t[7]!==f||t[8]!==d?(n=()=>{d.hasMore&&d.fetchNextPage(),f.hasMore&&f.fetchNextPage()},t[7]=f,t[8]=d,t[9]=n):n=t[9];const a=n;let i;return t[10]!==c||t[11]!==P||t[12]!==g||t[13]!==p||t[14]!==a?(i={items:p,hasMore:c,isLoadingMore:g,isInitialLoading:P,loadMore:a},t[10]=c,t[11]=P,t[12]=g,t[13]=p,t[14]=a,t[15]=i):i=t[15],i}function W(s){return L(s)}function Z(s){return!L(s)}function fe(s){const e=R.c(37),{connection:t,onClick:u,headerActions:o,headerActionsAlwaysVisible:l,body:r,footer:m,className:d,fallbackIcon:f}=s,p=l===void 0?!1:l,P=u&&"hover:bg-muted/50";let g;e[0]!==d||e[1]!==P?(g=E("cursor-pointer transition-colors group overflow-hidden flex flex-col h-full",P,d),e[0]=d,e[1]=P,e[2]=g):g=e[2];let c;e[3]!==t.icon||e[4]!==t.title||e[5]!==f?(c=x.jsx(V,{icon:t.icon,name:t.title,size:"sm",className:"shrink-0 shadow-sm",fallbackIcon:f}),e[3]=t.icon,e[4]=t.title,e[5]=f,e[6]=c):c=e[6];let n;e[7]!==o||e[8]!==p?(n=o&&x.jsx("div",{className:E("transition-opacity",!p&&"sm:opacity-0 sm:group-hover:opacity-100"),onClick:J,children:o}),e[7]=o,e[8]=p,e[9]=n):n=e[9];let a;e[10]!==n?(a=x.jsx("div",{className:"relative",children:n}),e[10]=n,e[11]=a):a=e[11];let i;e[12]!==c||e[13]!==a?(i=x.jsxs("div",{className:"flex items-start justify-between",children:[c,a]}),e[12]=c,e[13]=a,e[14]=i):i=e[14];let y;e[15]!==t.title?(y=x.jsx("h3",{className:"text-sm font-medium text-foreground truncate",children:t.title}),e[15]=t.title,e[16]=y):y=e[16];const j=t.description||"No description";let h;e[17]!==j?(h=x.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:j}),e[17]=j,e[18]=h):h=e[18];let v;e[19]!==h||e[20]!==y?(v=x.jsxs("div",{className:"flex flex-col gap-1",children:[y,h]}),e[19]=h,e[20]=y,e[21]=v):v=e[21];let C;e[22]!==r?(C=r&&x.jsx("div",{children:r}),e[22]=r,e[23]=C):C=e[23];let I;e[24]!==v||e[25]!==C||e[26]!==i?(I=x.jsxs("div",{className:"flex flex-col gap-3 p-4.5",children:[i,v,C]}),e[24]=v,e[25]=C,e[26]=i,e[27]=I):I=e[27];let b;e[28]!==m?(b=m&&x.jsx("div",{className:"border-t border-border mt-auto",children:x.jsx("div",{className:"h-14 flex items-center p-4.5",onClick:B,children:m})}),e[28]=m,e[29]=b):b=e[29];let N;e[30]!==I||e[31]!==b?(N=x.jsxs("div",{className:"flex flex-col flex-1",children:[I,b]}),e[30]=I,e[31]=b,e[32]=N):N=e[32];let M;return e[33]!==u||e[34]!==N||e[35]!==g?(M=x.jsx(U,{className:g,onClick:u,children:N}),e[33]=u,e[34]=N,e[35]=g,e[36]=M):M=e[36],M}function B(s){return s.stopPropagation()}function J(s){return s.stopPropagation()}export{fe as C,ue as a,ae as g,ce as u};
@@ -1 +1 @@
1
- import{J as ge,ap as Ie,aM as Ae,P as ce,an as De,e as P,j as t,l as je,B as W,r as G,c as ve,q as J,s as $e,K as ne,f as Y,w as de,u as Pe,aN as Oe,E as Me,g as ze,D as Ve,F as Ee,G as Ue,I as Fe,aO as Re,o as Q,H as Le}from"./index-BQhmgiEq.js";import{g as He}from"./generate-id-7pqGD8tV.js";import{E as be}from"./empty-state-wvWmfCHy.js";import{E as Be,c as We,r as qe,b as Ge,d as Xe}from"./connection-form-helpers-DKAyPoDI.js";import{c as Ke,S as Qe}from"./index-CVkezZw-.js";import{u as Ne,T as Je}from"./tools-list-rsD1aCdR.js";import{u as Ye}from"./use-members-MgBmqs7x.js";import{A as Ze}from"./avatar-KlYDn7qS.js";import{a as ye,b as _e,u as et}from"./use-connection-CqLc2kCT.js";import{u as re,S as tt}from"./constants-C4WRW-LO.js";import{c as st}from"./use-mcp-tools-BsnzIOtc.js";import{g as ae,M as nt,a as ot}from"./types-THJHjNYw.js";import{a as it}from"./use-mcp-prompts-e9YFDYF0.js";import{I as oe}from"./integration-icon-DewzWl2m.js";import{s as rt}from"./Plus-Cy8cBKs0.js";import{a as Se}from"./Settings02-3MysM1BG.js";import{s as le}from"./Trash01-ycnKf74n.js";import{e as at,d as lt,p as ct,c as dt,q as mt}from"./sidebar-D6d-v_Pc.js";import{F as R,b as L,c as H,d as V,f as B,e as ut,a as xt}from"./form-w71mMA8g.js";import{I as q}from"./input-DZxKc7J0.js";import{u as pt,D as ft}from"./use-delete-connection-CQU3mfvU.js";import{V as ht}from"./layout-CKEXWCBb.js";import{c as gt,C as jt,B as vt,a as bt,b as Nt,d as yt,e as _t}from"./monitoring-stats-row-CYnzq1NO.js";import{b as St}from"./use-virtual-mcp-DPVntSu2.js";import{i as Ce}from"./ChevronRight-Cv88p4ps.js";import{a as we}from"./Users03-ZMVhIoHM.js";import{T as ee,b as Ct,c as te,a as wt}from"./tabs-C84e7ZOt.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{b as kt}from"./ZapSquare-CLINFtDR.js";import{W as Tt,u as It}from"./agent-icon-iDRgsF6L.js";import{b as At}from"./Tool01-A_tsfqwo.js";import{C as Dt}from"./collection-search-C18GHA2r.js";import{C as $t}from"./card-BES0SMqR.js";import{B as Pt}from"./badge-DuiHx46w.js";import{D as Ot,a as Mt,b as zt,c as me}from"./dropdown-menu-CT0lW-r3.js";import{S as ue,a as xe,b as pe,c as fe,d as F}from"./select-C-gPp7G9.js";import{i as Vt}from"./CheckCircle-LNun5awz.js";import{t as Et}from"./ChevronDown-BrQ5SMJr.js";import{n as Ut}from"./Container-UyfewUfa.js";import{s as se}from"./Star01-D8HBHDwu.js";import{c as Ft}from"./RefreshCcw01-DmmbBsed.js";import{s as Rt}from"./XClose-4axhqxBQ.js";import"./collections-fkPfVMTg.js";import"./Key01-CR3cW4Ic.js";import"./index-BvtnVXmy.js";import"./index-gG2GSDDp.js";import"./extract-connection-data-DPlzs4kv.js";import"./use-registry-connections-C8o36UIG.js";import"./use-organization-settings-DoIv1zqR.js";import"./index-LZKnK7-L.js";import"./popover-mJmOGcvZ.js";import"./tooltip-IAEIrTVw.js";import"./Check-CVcAPsxw.js";import"./SearchMd-DBFtSrcv.js";import"./use-create-virtual-mcp-B2e6V1M8.js";import"./use-navigate-to-agent-BtQa4OwG.js";import"./use-org-auth-client-BXGwtUzc.js";import"./User01-C3BOLDRp.js";import"./use-collections-B5chukT1.js";import"./LayoutLeft-DCkIyObc.js";import"./X-DPY2mUo2.js";import"./label-B1la-fci.js";import"./alert-dialog-30grTlQF.js";import"./index-COBzfRZi.js";import"./AlertCircle-BNCl7-KE.js";import"./Stars02-GxNmnBiz.js";import"./SwitchHorizontal01-BnKnieWk.js";import"./ArrowNarrowLeft-DoLG4rPk.js";import"./XCircle-B83XL35R.js";import"./ArrowUpRight-dM_balV_.js";import"./ChevronUp-BEXPurOi.js";import"./DotsVertical-SlSMdJkj.js";import"./FilterLines-D43-OQwr.js";import"./Palette-CM8YcCMA.js";import"./HardDrive-9oRtZKUj.js";import"./LinkExternal01-Di-5czt2.js";import"./Lock01-7UEvqN90.js";import"./Monitor01-B9n70Cxg.js";import"./Sun-CydVR3Ev.js";import"./Play-D-B65aXH.js";import"./Shield01-HdcY4mrx.js";import"./Upload01-DYToW9Zt.js";import"./Users01-hicb3AcK.js";import"./Zap-4q67D7Av.js";const Lt=ge({scopes:De(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Ht=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Lt}];function Bt(s){const e=P.c(39),{instance:n,onConfigure:i,onAuthenticate:a,onDelete:o}=s;let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const c=Ne(r),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,u=d?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=ve("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let v;e[11]!==f||e[12]!==g?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=v):v=e[13];let b;e[14]!==n||e[15]!==d||e[16]!==a?(b=d&&t.jsx(W,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=a,e[17]=b):b=e[17];let j;e[18]!==n||e[19]!==i?(j=()=>i(n),e[18]=n,e[19]=i,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Se,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let S;e[24]!==n||e[25]!==o?(S=()=>o(n),e[24]=n,e[25]=o,e[26]=S):S=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(le,{size:13}),e[27]=N):N=e[27];let k;e[28]!==S?(k=t.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:S,title:"Delete",children:N}),e[28]=S,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==b?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,w,k]}),e[30]=w,e[31]=k,e[32]=b,e[33]=y):y=e[33];let C;return e[34]!==y||e[35]!==p||e[36]!==l||e[37]!==v?(C=t.jsxs("div",{className:p,children:[l,v,y]}),e[34]=y,e[35]=p,e[36]=l,e[37]=v,e[38]=C):C=e[38],C}function Wt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let a;e[0]!==n.icon||e[1]!==n.title?(a=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=a):a=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let r;e[5]!==n||e[6]!==i?(r=()=>i(n),e[5]=n,e[6]=i,e[7]=r):r=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:13}),e[8]=c):c=e[8];let m;e[9]!==r?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,title:"Configure",children:c})}),e[9]=r,e[10]=m):m=e[10];let d;return e[11]!==a||e[12]!==o||e[13]!==m?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[a,o,m]}),e[11]=a,e[12]=o,e[13]=m,e[14]=d):d=e[14],d}function qt(s){const e=P.c(25),{instances:n,onConfigure:i,onAuthenticate:a,onDelete:o,onAdd:r,isAdding:c}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let d;e[0]!==m?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=d):d=e[1];let u;e[2]!==c?(u=c?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=c,e[3]=u):u=e[3];let p;e[4]!==c||e[5]!==r||e[6]!==u?(p=t.jsxs(W,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:r,disabled:c,children:[u,"Add instance"]}),e[4]=c,e[5]=r,e[6]=u,e[7]=p):p=e[7];let l;e[8]!==d||e[9]!==p?(l=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=l):l=e[10];let f;if(e[11]!==n||e[12]!==a||e[13]!==i||e[14]!==o){let b;e[16]!==a||e[17]!==i||e[18]!==o?(b=j=>t.jsx(G.Suspense,{fallback:t.jsx(Wt,{instance:j,onConfigure:i}),children:t.jsx(Bt,{instance:j,onConfigure:i,onAuthenticate:a,onDelete:o})},j.id),e[16]=a,e[17]=i,e[18]=o,e[19]=b):b=e[19],f=n.map(b),e[11]=n,e[12]=a,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let v;return e[22]!==l||e[23]!==g?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,g]}),e[22]=l,e[23]=g,e[24]=v):v=e[24],v}const Gt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Xt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Qt(s){const e=P.c(4),{connectionId:n,orgId:i,orgSlug:a,timeframe:o}=s;let r;e[0]!==i||e[1]!==a?(r={connectionId:tt,orgId:i,orgSlug:a},e[0]=i,e[1]=a,e[2]=r):r=e[2];const c=re(r),m=Xt(o),{data:d}=$e({queryKey:ne.connectionActivity(n,o,i),queryFn:async()=>{const g=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:m.startDate.toISOString(),endDate:m.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),u=gt(d?.logs??[],m),p=u.data,l=u.totalCalls>0;let f;return e[3]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=f):f=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),f]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),l?t.jsxs("div",{children:[t.jsx(jt,{config:Kt,className:"h-16 w-full",children:t.jsxs(vt,{data:p,barCategoryGap:"4%",children:[t.jsx(bt,{content:t.jsx(Nt,{labelFormatter:Yt}),cursor:{fill:"var(--muted)"}}),t.jsx(yt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Jt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Jt(s,e){return t.jsx(_t,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Yt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Zt(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function es(s){const e=P.c(14),{connectionId:n}=s,[i,a]=G.useState("14d"),{org:o}=J();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=r):r=e[0];let c;e[1]!==i?(c=Gt.map(l=>t.jsx("button",{type:"button",onClick:()=>a(l.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=i,e[2]=c):c=e[2];let m;e[3]!==c?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Zt,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==i?(u=t.jsx(G.Suspense,{fallback:d,children:t.jsx(Qt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=i,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function ts(s){const e=P.c(15),{virtualMcp:n,org:i}=s,a=Y();let o;e[0]!==a||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{size:16}),e[4]=r):r=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==c||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,m,d]}),e[11]=o,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function ss(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let a;if(e[0]!==i||e[1]!==n){let r;e[3]!==i?(r=c=>t.jsx(ts,{virtualMcp:c,org:i},c.id),e[3]=i,e[4]=r):r=e[4],a=n.map(r),e[0]=i,e[1]=n,e[2]=a}else a=e[2];let o;return e[5]!==a?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=o):o=e[6],o}function ns(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const o=St(a);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ss,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function os(s){const e=P.c(31),{tools:n,connectionId:i,org:a}=s,o=Y(),{org:r}=J();let c;e[0]!==i||e[1]!==r.id||e[2]!==r.slug?(c={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=i,e[1]=r.id,e[2]=r.slug,e[3]=c):c=e[3];const m=re(c),d=ye(i);let u;e[4]!==d||e[5]!==i?(u=d?ke(d):i,e[4]=d,e[5]=i,e[6]=u):u=e[6];const p=u,[l,f]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==m||e[9]!==o||e[10]!==a||e[11]!==l||e[12]!==n){const S=(n??[]).filter(is),N=l.toLowerCase().trim(),k=N?S.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):S;let y;e[17]!==p||e[18]!==o||e[19]!==a?(y=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=a,e[20]=y):y=e[20];const C=y;b="flex flex-col h-full overflow-hidden";let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=I):I=e[21],e[22]!==l?(j=t.jsx(Dt,{value:l,onChange:f,placeholder:"Search apps...",onKeyDown:I}),e[22]=l,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=k.length===0?t.jsx(be,{image:null,title:l?"No apps found":"No apps available",description:l?"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:k.map(h=>{const A=ae(h._meta);return t.jsxs($t,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>C(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(nt,{resourceURI:A,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=m,e[9]=o,e[10]=a,e[11]=l,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let _;e[24]!==g||e[25]!==v?(_=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=_):_=e[26];let w;return e[27]!==b||e[28]!==j||e[29]!==_?(w=t.jsxs("div",{className:b,children:[j,_]}),e[27]=b,e[28]=j,e[29]=_,e[30]=w):w=e[30],w}function is(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=r=>r.charAt(0).toUpperCase()+r.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),o=e[e.length-1];return a.length>=2&&o&&i.has(o)?[a.pop(),...a].join(" "):a.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function rs(s){const e=P.c(50),{tools:n,prompts:i,resources:a,connectionId:o,org:r}=s;let c;e[0]!==i?(c=i===void 0?[]:i,e[0]=i,e[1]=c):c=e[1];const m=c;let d;e[2]!==a?(d=a===void 0?[]:a,e[2]=a,e[3]=d):d=e[3];const u=d,p=Y(),l=ye(o??"");let f;e[4]!==l||e[5]!==o?(f=l?ke(l):o,e[4]=l,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==r?(v=function(D){!o||!r||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=r,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==r||e[14]!==n?(j=o&&r&&n.some(cs),e[12]=o,e[13]=r,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+m.length+u.length===0){let x;return e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=x):x=e[16],x}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let N;e[19]!==_?(N=_&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let C;e[23]!==S||e[24]!==N?(C=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ct,{variant:"underline",className:"gap-1",children:[S,N,k,y]})}),e[23]=S,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==b||e[27]!==n?(I=n.length>0?n.map(x=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(x.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(At,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(x.name)}),x.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:x.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},x.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=I):I=e[28];let h;e[29]!==I?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[29]=I,e[30]=h):h=e[30];let A;e[31]!==o||e[32]!==_||e[33]!==r||e[34]!==n?(A=_&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(os,{tools:n,connectionId:o,org:r})}),e[31]=o,e[32]=_,e[33]=r,e[34]=n,e[35]=A):A=e[35];let M;e[36]!==m?(M=m.length>0?m.map(ls):t.jsx(ie,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let T;e[40]!==u?(T=u.length>0?u.map(as):t.jsx(ie,{label:"resources"}),e[40]=u,e[41]=T):T=e[41];let z;e[42]!==T?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:T})}),e[42]=T,e[43]=z):z=e[43];let E;return e[44]!==C||e[45]!==h||e[46]!==A||e[47]!==O||e[48]!==z?(E=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(wt,{defaultValue:"tools",variant:"underline",children:[C,h,A,O,z]})}),e[44]=C,e[45]=h,e[46]=A,e[47]=O,e[48]=z,e[49]=E):E=e[49],E}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Tt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ls(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function cs(s){return ae(s._meta)}function ds(s){const e=P.c(13),{connection:n,displayTitle:i}=s,a=i??n.title;let o;e[0]!==n.icon||e[1]!==a?(o=t.jsx(oe,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=o):o=e[2];let r;e[3]!==a?(r=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let m;e[7]!==r||e[8]!==c?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,c]}),e[7]=r,e[8]=c,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=d):d=e[12],d}function ms({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:a}){const o=de({control:s.control,name:"ui_type"}),r=de({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),m=(()=>{if(typeof r!="string"||!r)return!1;try{const l=new URL(r);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Oe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"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(we,{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."})]}),p&&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:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(R,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsxs(xe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(R,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(L,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(q,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(It,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(R,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(q,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(R,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(q,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(R,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(q,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(R,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(q,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(R,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:l.value??[],onChange:l.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(R,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ot,{children:[t.jsx(Mt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Pt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),"Authenticated via OAuth",t.jsx(Et,{size:12})]})})}),t.jsxs(zt,{align:"start",children:[t.jsxs(me,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:a,children:[t.jsx(le,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.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:()=>l.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(Rt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(q,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(ut,{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(B,{})]})})]})}function us(s){return s.command==="npx"}function xs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ps(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(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"&&Re(s.connection_headers)){const i=s.connection_headers,a=qe(i.envVars);if(us(i)){const r=xs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:r,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const o=ps(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function fs(s){let e,n=null,i=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Ge(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function hs({connection:s,connectionId:e,org:n,isUpdating:i,tools:a,prompts:o,resources:r,siblings:c}){const m=Y({from:"/$org/settings/connections/$appSlug"}),d=Ve(),u=_e(),{org:p}=J(),l=pt({onSuccess:()=>{c.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=G.useState(null),[v,b]=G.useState(!1),j=Ne({connectionId:e}),{data:_}=Ye(),w=_?.data?.members??[],S=f??s,N=w.find(x=>x.userId===S.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,C={...s,tools:a},I=Ke(C,Ht),h=Ee({resolver:Ue(We),values:he(f??s)}),A=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=fs(D),U=f?.id??e;await u.update.mutateAsync({id:U,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},T=async x=>{const{token:D,tokenInfo:$,error:U}=await Le({connectionId:x,orgSlug:p.slug,scope:"offline_access"});if(U||!D){Q.error(`Authentication failed: ${U}`);return}if($)try{const X=await fetch(`/api/${p.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!X.ok)console.error("Failed to save OAuth token:",await X.text()),await u.update.mutateAsync({id:x,data:{connection_token:D}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(X){console.error("Error saving OAuth token:",X),await u.update.mutateAsync({id:x,data:{connection_token:D}})}else await u.update.mutateAsync({id:x,data:{connection_token:D}});const K=new URL(`/api/${p.slug}/mcp/${x}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated(K.href,null)}),await d.invalidateQueries({queryKey:ne.mcpClientPrefix()}),Q.success("Authentication successful")},z=()=>T(s.id),E=async()=>{try{const x=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const $=await x.text();Q.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),Q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),Q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...l}),t.jsx(at,{open:f!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(lt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(dt,{className:"text-base",children:f?.title??s.title}),t.jsx(mt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(xt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(R,{control:h.control,name:"title",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(q,{...x})}),t.jsx(B,{})]})}),t.jsx(R,{control:h.control,name:"description",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(q,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ms,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:E}),t.jsx(Qe,{connection:f??s,form:h,hasMcpBinding:I,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(W,{onClick:M,disabled:!A||i,className:"flex-1",children:i?"Saving…":"Save changes"}),A&&t.jsx(W,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(W,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=f??s;g(null),l.requestDelete(x)},children:[t.jsx(le,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(ht,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ds,{connection:s,displayTitle:(()=>{const x=c[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(es,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:c,onConfigure:x=>g(x),onAuthenticate:x=>T(x.id),onDelete:x=>l.requestDelete(x),isAdding:v,onAdd:async()=>{b(!0);try{const x=c[0]??s,D=x.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,U=`${D} (${$})`,K=He("conn");await u.create.mutateAsync({id:K,title:U,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${K}`,window.location.origin),Z=await Fe({url:X.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await T(K)}finally{b(!1)}}}),t.jsx(ns,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(rs,{tools:a,prompts:o,resources:r,connectionId:e,org:n})})]})})]})})]})}function gs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:a,org:o}=ze(i),{org:r}=J(),c=_e();let m;s[2]!==a?(m={slug:a},s[2]=a,s[3]=m):m=s[3];const d=et(m),u=d[0]??null,p=u?.id??"",l=p||null;let f;s[4]!==r.id||s[5]!==r.slug||s[6]!==l?(f={connectionId:l,orgId:r.id,orgSlug:r.slug},s[4]=r.id,s[5]=r.slug,s[6]=l,s[7]=f):f=s[7];const g=re(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=st(v);let j;if(s[10]!==u?.tools||s[11]!==p||s[12]!==d||s[13]!==b){const T=b?b.tools.map(_s):(u?.tools??[]).map(ys);e:{if(d.length<=1){j=T;break e}const z=new Set,E=[],x=bs;for(const D of d){const $=D.id===p?T:x(D.tools);for(const U of $)z.has(U.name)||(z.add(U.name),E.push(U))}j=E.length>0?E:T}s[10]=u?.tools,s[11]=p,s[12]=d,s[13]=b,s[14]=j}else j=s[14];const _=j;let w;s[15]!==g?(w={client:g},s[15]=g,s[16]=w):w=s[16];const{data:S}=it(w);let N;s[17]!==g?(N={client:g},s[17]=g,s[18]=N):N=s[18];const{data:k}=ot(N);let y;s[19]!==S?.prompts?(y=S?.prompts??[],s[19]=S?.prompts,s[20]=y):y=s[20];let C;s[21]!==y?(C=y.map(vs),s[21]=y,s[22]=C):C=s[22];const I=C;let h;s[23]!==k?.resources?(h=k?.resources??[],s[23]=k?.resources,s[24]=h):h=s[24];let A;s[25]!==h?(A=h.map(js),s[25]=h,s[26]=A):A=s[26];const M=A;if(!u){let T;return s[27]!==n||s[28]!==o?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(W,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=T):T=s[29],T}let O;return s[30]!==c.update.isPending||s[31]!==_||s[32]!==u||s[33]!==p||s[34]!==o||s[35]!==I||s[36]!==M||s[37]!==d?(O=t.jsx(hs,{org:o,connection:u,connectionId:p,isUpdating:c.update.isPending,tools:_,prompts:I,resources:M,siblings:d}),s[30]=c.update.isPending,s[31]=_,s[32]=u,s[33]=p,s[34]=o,s[35]=I,s[36]=M,s[37]=d,s[38]=O):O=s[38],O}function js(s){return{name:s.name,description:s.description,uri:s.uri}}function vs(s){return{name:s.name,description:s.description}}function bs(s){return(s??[]).map(Ns)}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gs,{})})}),s[0]=e):e=s[0],e}function so(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ss,{}),s[0]=e):e=s[0],e}export{so as default};
1
+ import{J as ge,ap as Ie,aM as Ae,P as ce,an as De,e as P,j as t,l as je,B as W,r as G,c as ve,q as J,s as $e,K as ne,f as Y,w as de,u as Pe,aN as Oe,E as Me,g as ze,D as Ve,F as Ee,G as Ue,I as Fe,aO as Re,o as Q,H as Le}from"./index-c9Pbt5D9.js";import{g as He}from"./generate-id-DtDqQvIv.js";import{E as be}from"./empty-state-DW3JI1nZ.js";import{E as Be,c as We,r as qe,b as Ge,d as Xe}from"./connection-form-helpers-Dn61c3nC.js";import{c as Ke,S as Qe}from"./index-B6pGpYG6.js";import{u as Ne,T as Je}from"./tools-list-CIfKFLCC.js";import{u as Ye}from"./use-members-BBMhepEt.js";import{A as Ze}from"./avatar-CC5qXjgF.js";import{a as ye,b as _e,u as et}from"./use-connection-DPPCfeow.js";import{u as re,S as tt}from"./constants-V3SVDRSK.js";import{c as st}from"./use-mcp-tools-BpkMOXfX.js";import{g as ae,M as nt,a as ot}from"./types-CKyex3WY.js";import{a as it}from"./use-mcp-prompts-D707fXp5.js";import{I as oe}from"./integration-icon-8egQk7i2.js";import{s as rt}from"./Plus-D8dMVCG8.js";import{a as Se}from"./Settings02-DW-Wnk61.js";import{s as le}from"./Trash01-D5iQjfZH.js";import{e as at,d as lt,p as ct,c as dt,q as mt}from"./sidebar-D-_ciNlc.js";import{F as R,b as L,c as H,d as V,f as B,e as ut,a as xt}from"./form-D_08NHUD.js";import{I as q}from"./input-BGaLq3ax.js";import{u as pt,D as ft}from"./use-delete-connection-2Y6JpaXB.js";import{V as ht}from"./layout-BQK7K5Pq.js";import{c as gt,C as jt,B as vt,a as bt,b as Nt,d as yt,e as _t}from"./monitoring-stats-row-D5sxIGbz.js";import{b as St}from"./use-virtual-mcp-BzxmTmXo.js";import{i as Ce}from"./ChevronRight-lpVCFpWI.js";import{a as we}from"./Users03-DxI7m72W.js";import{T as ee,b as Ct,c as te,a as wt}from"./tabs-CArqhjUQ.js";import{g as ke}from"./connection-slug-eyAPH6o3.js";import{b as kt}from"./ZapSquare-B5X0r34a.js";import{W as Tt,u as It}from"./agent-icon-BtPamQTT.js";import{b as At}from"./Tool01-B6glW0Sz.js";import{C as Dt}from"./collection-search-DvDmML5v.js";import{C as $t}from"./card-BM5zwIyB.js";import{B as Pt}from"./badge-BI7NQRYo.js";import{D as Ot,a as Mt,b as zt,c as me}from"./dropdown-menu-CkTzcUR8.js";import{S as ue,a as xe,b as pe,c as fe,d as F}from"./select-btdbQqQB.js";import{i as Vt}from"./CheckCircle-EJQkwVx_.js";import{t as Et}from"./ChevronDown-BG0-uii1.js";import{n as Ut}from"./Container-CCYhpski.js";import{s as se}from"./Star01-Dsz3MamR.js";import{c as Ft}from"./RefreshCcw01-NZxMXXUu.js";import{s as Rt}from"./XClose-BtlseQCi.js";import"./collections-DYNhGJEX.js";import"./Key01-CDidhnng.js";import"./index-dXxsh3Iz.js";import"./index-DFLHG9Oe.js";import"./extract-connection-data-D3z53YWV.js";import"./use-registry-connections-BLF2Iu3j.js";import"./use-organization-settings-AWz6cpVk.js";import"./index-B6XA74F9.js";import"./popover-BLsl1Wwx.js";import"./tooltip-DuHhGuNb.js";import"./Check-C6XoKiD0.js";import"./SearchMd-CZrB4Udl.js";import"./use-create-virtual-mcp-ClMf9M2U.js";import"./use-navigate-to-agent-CeGlZmmn.js";import"./use-org-auth-client-DnKeoeEP.js";import"./User01-D-0COLHD.js";import"./use-collections-DV-Yw7Rl.js";import"./LayoutLeft-D-a-mZcm.js";import"./X-CghOqPiW.js";import"./label-BUt9seyW.js";import"./alert-dialog-B9ApqUuI.js";import"./index-CNE80A83.js";import"./AlertCircle-BUiQNi1g.js";import"./Stars02-DU-eReiu.js";import"./SwitchHorizontal01-DgnU6UpK.js";import"./ArrowNarrowLeft-B-iJgi5p.js";import"./XCircle-BAnMq3y8.js";import"./ArrowUpRight-Bcc2ZOuq.js";import"./ChevronUp-C7MKl1aH.js";import"./DotsVertical-DUwrRRrO.js";import"./FilterLines-C2GeuQuW.js";import"./Palette-Cbp9TooA.js";import"./HardDrive-JbvyX314.js";import"./LinkExternal01-BgvZEm-X.js";import"./Lock01-DukFRLhX.js";import"./Monitor01-BBeIQXwu.js";import"./Sun-CjOl_eIW.js";import"./Play-Bu5xn8xm.js";import"./Shield01-BF1LUqlj.js";import"./Upload01-CRbIaVuw.js";import"./Users01-BXsiu59O.js";import"./Zap-B9Rztg2v.js";const Lt=ge({scopes:De(ce()).describe("List of scopes available"),stateSchema:Ie(ce(),Ae()).describe("JSON Schema (draft-07) defining the state structure")}),Ht=[{name:"MCP_CONFIGURATION",inputSchema:ge({}),outputSchema:Lt}];function Bt(s){const e=P.c(39),{instance:n,onConfigure:i,onAuthenticate:a,onDelete:o}=s;let r;e[0]!==n.id?(r={connectionId:n.id},e[0]=n.id,e[1]=r):r=e[1];const c=Ne(r),d=!(n.connection_type==="VIRTUAL")&&c.supportsOAuth&&!c.isAuthenticated,u=d?"border-destructive/50 bg-destructive/5":"border-transparent";let p;e[2]!==u?(p=ve("flex items-center gap-3 rounded-lg border px-4 py-2.5 transition-colors",u),e[2]=u,e[3]=p):p=e[3];let l;e[4]!==n.icon||e[5]!==n.title?(l=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[4]=n.icon,e[5]=n.title,e[6]=l):l=e[6];let f;e[7]!==n.title?(f=t.jsx("p",{className:"text-sm font-medium truncate",children:n.title}),e[7]=n.title,e[8]=f):f=e[8];let g;e[9]!==d?(g=d&&t.jsx("span",{className:"text-xs text-destructive font-medium",children:"Needs authorization"}),e[9]=d,e[10]=g):g=e[10];let v;e[11]!==f||e[12]!==g?(v=t.jsxs("div",{className:"flex-1 min-w-0",children:[f,g]}),e[11]=f,e[12]=g,e[13]=v):v=e[13];let b;e[14]!==n||e[15]!==d||e[16]!==a?(b=d&&t.jsx(W,{variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>a(n),children:"Authorize"}),e[14]=n,e[15]=d,e[16]=a,e[17]=b):b=e[17];let j;e[18]!==n||e[19]!==i?(j=()=>i(n),e[18]=n,e[19]=i,e[20]=j):j=e[20];let _;e[21]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(Se,{size:13}),e[21]=_):_=e[21];let w;e[22]!==j?(w=t.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:j,title:"Configure",children:_}),e[22]=j,e[23]=w):w=e[23];let S;e[24]!==n||e[25]!==o?(S=()=>o(n),e[24]=n,e[25]=o,e[26]=S):S=e[26];let N;e[27]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(le,{size:13}),e[27]=N):N=e[27];let k;e[28]!==S?(k=t.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive",onClick:S,title:"Delete",children:N}),e[28]=S,e[29]=k):k=e[29];let y;e[30]!==w||e[31]!==k||e[32]!==b?(y=t.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[b,w,k]}),e[30]=w,e[31]=k,e[32]=b,e[33]=y):y=e[33];let C;return e[34]!==y||e[35]!==p||e[36]!==l||e[37]!==v?(C=t.jsxs("div",{className:p,children:[l,v,y]}),e[34]=y,e[35]=p,e[36]=l,e[37]=v,e[38]=C):C=e[38],C}function Wt(s){const e=P.c(15),{instance:n,onConfigure:i}=s;let a;e[0]!==n.icon||e[1]!==n.title?(a=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",className:"shrink-0"}),e[0]=n.icon,e[1]=n.title,e[2]=a):a=e[2];let o;e[3]!==n.title?(o=t.jsx("div",{className:"flex-1 min-w-0",children:t.jsx("p",{className:"text-sm font-medium truncate",children:n.title})}),e[3]=n.title,e[4]=o):o=e[4];let r;e[5]!==n||e[6]!==i?(r=()=>i(n),e[5]=n,e[6]=i,e[7]=r):r=e[7];let c;e[8]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx(Se,{size:13}),e[8]=c):c=e[8];let m;e[9]!==r?(m=t.jsx("div",{className:"flex items-center gap-1 shrink-0",children:t.jsx(W,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r,title:"Configure",children:c})}),e[9]=r,e[10]=m):m=e[10];let d;return e[11]!==a||e[12]!==o||e[13]!==m?(d=t.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-transparent px-4 py-2.5 transition-colors",children:[a,o,m]}),e[11]=a,e[12]=o,e[13]=m,e[14]=d):d=e[14],d}function qt(s){const e=P.c(25),{instances:n,onConfigure:i,onAuthenticate:a,onDelete:o,onAdd:r,isAdding:c}=s;if(n.length===0)return null;const m=n.length===1?"Instance":"Instances";let d;e[0]!==m?(d=t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:m}),e[0]=m,e[1]=d):d=e[1];let u;e[2]!==c?(u=c?t.jsx(je,{size:13,className:"animate-spin"}):t.jsx(rt,{size:13}),e[2]=c,e[3]=u):u=e[3];let p;e[4]!==c||e[5]!==r||e[6]!==u?(p=t.jsxs(W,{variant:"default",size:"sm",className:"h-7 gap-1.5 text-xs",onClick:r,disabled:c,children:[u,"Add instance"]}),e[4]=c,e[5]=r,e[6]=u,e[7]=p):p=e[7];let l;e[8]!==d||e[9]!==p?(l=t.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[d,p]}),e[8]=d,e[9]=p,e[10]=l):l=e[10];let f;if(e[11]!==n||e[12]!==a||e[13]!==i||e[14]!==o){let b;e[16]!==a||e[17]!==i||e[18]!==o?(b=j=>t.jsx(G.Suspense,{fallback:t.jsx(Wt,{instance:j,onConfigure:i}),children:t.jsx(Bt,{instance:j,onConfigure:i,onAuthenticate:a,onDelete:o})},j.id),e[16]=a,e[17]=i,e[18]=o,e[19]=b):b=e[19],f=n.map(b),e[11]=n,e[12]=a,e[13]=i,e[14]=o,e[15]=f}else f=e[15];let g;e[20]!==f?(g=t.jsx("div",{className:"p-2 flex flex-col gap-1",children:f}),e[20]=f,e[21]=g):g=e[21];let v;return e[22]!==l||e[23]!==g?(v=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[l,g]}),e[22]=l,e[23]=g,e[24]=v):v=e[24],v}const Gt=[{value:"7d",label:"7d"},{value:"14d",label:"14d"},{value:"30d",label:"30d"}];function Xt(s){const e=new Date,n=new Date(e);return s==="7d"?n.setDate(n.getDate()-7):s==="14d"?n.setDate(n.getDate()-14):n.setDate(n.getDate()-30),{startDate:n,endDate:e}}const Kt={calls:{label:"Tool calls"},errors:{label:"Errors"}};function Qt(s){const e=P.c(4),{connectionId:n,orgId:i,orgSlug:a,timeframe:o}=s;let r;e[0]!==i||e[1]!==a?(r={connectionId:tt,orgId:i,orgSlug:a},e[0]=i,e[1]=a,e[2]=r):r=e[2];const c=re(r),m=Xt(o),{data:d}=$e({queryKey:ne.connectionActivity(n,o,i),queryFn:async()=>{const g=await c.callTool({name:"MONITORING_LOGS_LIST",arguments:{startDate:m.startDate.toISOString(),endDate:m.endDate.toISOString(),connectionId:n,limit:2e3,offset:0}});return g.structuredContent??g},staleTime:3e5}),u=gt(d?.logs??[],m),p=u.data,l=u.totalCalls>0;let f;return e[3]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Tool calls"}),e[3]=f):f=e[3],t.jsxs("div",{children:[t.jsxs("div",{className:"flex gap-6 px-5 pb-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:u.totalCalls.toLocaleString()}),f]}),u.totalErrors>0&&t.jsxs("div",{children:[t.jsx("p",{className:"text-2xl font-semibold text-destructive tabular-nums",children:u.totalErrors.toLocaleString()}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Errors"})]}),u.avgDurationMs>0&&t.jsxs("div",{children:[t.jsxs("p",{className:"text-2xl font-semibold text-foreground tabular-nums",children:[Math.round(u.avgDurationMs),"ms"]}),t.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Avg latency"})]})]}),l?t.jsxs("div",{children:[t.jsx(jt,{config:Kt,className:"h-16 w-full",children:t.jsxs(vt,{data:p,barCategoryGap:"4%",children:[t.jsx(bt,{content:t.jsx(Nt,{labelFormatter:Yt}),cursor:{fill:"var(--muted)"}}),t.jsx(yt,{dataKey:"calls",radius:[2,2,0,0],minPointSize:1,children:p.map(Jt)})]})}),t.jsxs("div",{className:"flex justify-between px-3 mt-1 pb-3",children:[t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[0]?.label}),t.jsx("span",{className:"text-[10px] text-muted-foreground",children:p[p.length-1]?.label})]})]}):t.jsx("div",{className:"h-20 flex items-center justify-center",children:t.jsx("p",{className:"text-sm text-muted-foreground/60",children:"No activity in this period"})})]})}function Jt(s,e){return t.jsx(_t,{fill:s.errorRate>50?"var(--destructive)":"var(--chart-1)",fillOpacity:s.calls===0?.2:s.errorRate>50?.7:.85},`cell-${e}`)}function Yt(s,e){const n=Array.isArray(e)?e[0]:void 0;return n&&typeof n=="object"&&"payload"in n?n.payload?.label??"":""}function Zt(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsxs("div",{children:[t.jsx("div",{className:"flex gap-6 px-5 pb-4",children:t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-7 w-16 rounded-md bg-muted animate-pulse"}),t.jsx("div",{className:"h-3 w-14 rounded bg-muted animate-pulse"})]})}),t.jsx("div",{className:"h-20 w-full rounded-md bg-muted animate-pulse"})]}),s[0]=e):e=s[0],e}function es(s){const e=P.c(14),{connectionId:n}=s,[i,a]=G.useState("14d"),{org:o}=J();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx("div",{children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Activity"})}),e[0]=r):r=e[0];let c;e[1]!==i?(c=Gt.map(l=>t.jsx("button",{type:"button",onClick:()=>a(l.value),className:ve("px-2.5 py-1 text-xs font-medium rounded-md transition-colors",i===l.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:l.label},l.value)),e[1]=i,e[2]=c):c=e[2];let m;e[3]!==c?(m=t.jsxs("div",{className:"px-5 py-4 flex items-center justify-between",children:[r,t.jsx("div",{className:"flex items-center gap-0.5 bg-muted rounded-lg p-0.5",children:c})]}),e[3]=c,e[4]=m):m=e[4];let d;e[5]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Zt,{}),e[5]=d):d=e[5];let u;e[6]!==n||e[7]!==o.id||e[8]!==o.slug||e[9]!==i?(u=t.jsx(G.Suspense,{fallback:d,children:t.jsx(Qt,{connectionId:n,orgId:o.id,orgSlug:o.slug,timeframe:i})}),e[6]=n,e[7]=o.id,e[8]=o.slug,e[9]=i,e[10]=u):u=e[10];let p;return e[11]!==m||e[12]!==u?(p=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[m,u]}),e[11]=m,e[12]=u,e[13]=p):p=e[13],p}function ts(s){const e=P.c(15),{virtualMcp:n,org:i}=s,a=Y();let o;e[0]!==a||e[1]!==i||e[2]!==n.id?(o=()=>{const p=crypto.randomUUID();a({to:"/$org/$taskId",params:{org:i,taskId:p},search:{virtualmcpid:n.id}})},e[0]=a,e[1]=i,e[2]=n.id,e[3]=o):o=e[3];let r;e[4]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(we,{size:16}),e[4]=r):r=e[4];let c;e[5]!==n.icon||e[6]!==n.title?(c=t.jsx(oe,{icon:n.icon,name:n.title,size:"xs",fallbackIcon:r}),e[5]=n.icon,e[6]=n.title,e[7]=c):c=e[7];let m;e[8]!==n.title?(m=t.jsx("span",{className:"flex-1 text-sm font-medium text-foreground truncate",children:n.title}),e[8]=n.title,e[9]=m):m=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(Ce,{size:16,className:"text-muted-foreground group-hover:text-foreground transition-colors shrink-0"}),e[10]=d):d=e[10];let u;return e[11]!==o||e[12]!==c||e[13]!==m?(u=t.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 rounded-lg hover:bg-muted/50 transition-colors group text-left w-full",children:[c,m,d]}),e[11]=o,e[12]=c,e[13]=m,e[14]=u):u=e[14],u}function ss(s){const e=P.c(7),{virtualMcps:n,org:i}=s;let a;if(e[0]!==i||e[1]!==n){let r;e[3]!==i?(r=c=>t.jsx(ts,{virtualMcp:c,org:i},c.id),e[3]=i,e[4]=r):r=e[4],a=n.map(r),e[0]=i,e[1]=n,e[2]=a}else a=e[2];let o;return e[5]!==a?(o=t.jsx("div",{className:"flex flex-col gap-3",children:t.jsx("div",{className:"flex flex-col gap-2",children:a})}),e[5]=a,e[6]=o):o=e[6],o}function ns(s){const e=P.c(7),{connection:n}=s,{org:i}=J();let a;e[0]!==n.id?(a={filters:[{column:"connection_id",value:n.id}]},e[0]=n.id,e[1]=a):a=e[1];const o=St(a);if(!(o.length>0)){let d;return e[2]===Symbol.for("react.memo_cache_sentinel")?(d=t.jsx(t.Fragment,{}),e[2]=d):d=e[2],d}let c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=t.jsx("div",{className:"px-5 py-4 border-b border-border",children:t.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Used by agents"})}),e[3]=c):c=e[3];let m;return e[4]!==i.slug||e[5]!==o?(m=t.jsxs("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:[c,t.jsx("div",{className:"px-5 py-4",children:t.jsx(ss,{virtualMcps:o,org:i.slug})})]}),e[4]=i.slug,e[5]=o,e[6]=m):m=e[6],m}function os(s){const e=P.c(31),{tools:n,connectionId:i,org:a}=s,o=Y(),{org:r}=J();let c;e[0]!==i||e[1]!==r.id||e[2]!==r.slug?(c={connectionId:i,orgId:r.id,orgSlug:r.slug},e[0]=i,e[1]=r.id,e[2]=r.slug,e[3]=c):c=e[3];const m=re(c),d=ye(i);let u;e[4]!==d||e[5]!==i?(u=d?ke(d):i,e[4]=d,e[5]=i,e[6]=u):u=e[6];const p=u,[l,f]=G.useState("");let g,v,b,j;if(e[7]!==p||e[8]!==m||e[9]!==o||e[10]!==a||e[11]!==l||e[12]!==n){const S=(n??[]).filter(is),N=l.toLowerCase().trim(),k=N?S.filter(h=>h.name.toLowerCase().includes(N)||h.description&&h.description.toLowerCase().includes(N)):S;let y;e[17]!==p||e[18]!==o||e[19]!==a?(y=h=>{o({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:a,appSlug:p,collectionName:"tools",itemId:encodeURIComponent(h.name)}})},e[17]=p,e[18]=o,e[19]=a,e[20]=y):y=e[20];const C=y;b="flex flex-col h-full overflow-hidden";let I;e[21]===Symbol.for("react.memo_cache_sentinel")?(I=h=>{h.key==="Escape"&&(f(""),h.target.blur())},e[21]=I):I=e[21],e[22]!==l?(j=t.jsx(Dt,{value:l,onChange:f,placeholder:"Search apps...",onKeyDown:I}),e[22]=l,e[23]=j):j=e[23],g="flex-1 overflow-auto p-5",v=k.length===0?t.jsx(be,{image:null,title:l?"No apps found":"No apps available",description:l?"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:k.map(h=>{const A=ae(h._meta);return t.jsxs($t,{className:"cursor-pointer transition-colors overflow-hidden gap-0",onClick:()=>C(h),children:[t.jsx("div",{className:"h-[200px] overflow-hidden border-b border-border",children:t.jsx(nt,{resourceURI:A,toolInfo:{tool:h},displayMode:"inline",minHeight:200,maxHeight:200,client:m})}),t.jsxs("div",{className:"flex flex-col gap-2 p-4",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("h3",{className:"text-base font-medium text-foreground truncate",children:h.name}),t.jsx(Je,{annotations:h.annotations,_meta:h._meta})]}),h.description&&t.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:h.description})]})]},h.name)})}),e[7]=p,e[8]=m,e[9]=o,e[10]=a,e[11]=l,e[12]=n,e[13]=g,e[14]=v,e[15]=b,e[16]=j}else g=e[13],v=e[14],b=e[15],j=e[16];let _;e[24]!==g||e[25]!==v?(_=t.jsx("div",{className:g,children:v}),e[24]=g,e[25]=v,e[26]=_):_=e[26];let w;return e[27]!==b||e[28]!==j||e[29]!==_?(w=t.jsxs("div",{className:b,children:[j,_]}),e[27]=b,e[28]=j,e[29]=_,e[30]=w):w=e[30],w}function is(s){return!!ae(s._meta)}function Te(s){const e=s.replace(/[._]/g," ").trim().split(/\s+/),n=r=>r.charAt(0).toUpperCase()+r.slice(1),i=new Set(["list","create","get","update","delete","fetch","search","run","trigger","review","send","check"]),a=e.map(n),o=e[e.length-1];return a.length>=2&&o&&i.has(o)?[a.pop(),...a].join(" "):a.join(" ")}function ie(s){const e=P.c(2),{label:n}=s;let i;return e[0]!==n?(i=t.jsx("div",{className:"px-5 py-8 text-center",children:t.jsxs("p",{className:"text-sm text-muted-foreground",children:["No ",n," available."]})}),e[0]=n,e[1]=i):i=e[1],i}function rs(s){const e=P.c(50),{tools:n,prompts:i,resources:a,connectionId:o,org:r}=s;let c;e[0]!==i?(c=i===void 0?[]:i,e[0]=i,e[1]=c):c=e[1];const m=c;let d;e[2]!==a?(d=a===void 0?[]:a,e[2]=a,e[3]=d):d=e[3];const u=d,p=Y(),l=ye(o??"");let f;e[4]!==l||e[5]!==o?(f=l?ke(l):o,e[4]=l,e[5]=o,e[6]=f):f=e[6];const g=f;let v;e[7]!==g||e[8]!==o||e[9]!==p||e[10]!==r?(v=function(D){!o||!r||p({to:"/$org/settings/connections/$appSlug/$collectionName/$itemId",params:{org:r,appSlug:g,collectionName:"tools",itemId:encodeURIComponent(D)}})},e[7]=g,e[8]=o,e[9]=p,e[10]=r,e[11]=v):v=e[11];const b=v;let j;e[12]!==o||e[13]!==r||e[14]!==n?(j=o&&r&&n.some(cs),e[12]=o,e[13]=r,e[14]=n,e[15]=j):j=e[15];const _=j;if(n.length+m.length+u.length===0){let x;return e[16]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"rounded-xl border border-border bg-card p-5",children:[t.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Capabilities"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"No capabilities discovered yet. The connection may still be connecting."})]}),e[16]=x):x=e[16],x}let S;e[17]!==n.length?(S=t.jsxs(ee,{value:"tools",variant:"underline",children:["Tools (",n.length,")"]}),e[17]=n.length,e[18]=S):S=e[18];let N;e[19]!==_?(N=_&&t.jsx(ee,{value:"apps",variant:"underline",children:"UI"}),e[19]=_,e[20]=N):N=e[20];let k,y;e[21]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(ee,{value:"prompts",variant:"underline",children:"Prompts"}),y=t.jsx(ee,{value:"resources",variant:"underline",children:"Resources"}),e[21]=k,e[22]=y):(k=e[21],y=e[22]);let C;e[23]!==S||e[24]!==N?(C=t.jsx("div",{className:"px-5 flex items-center justify-between border-b border-border",children:t.jsxs(Ct,{variant:"underline",className:"gap-1",children:[S,N,k,y]})}),e[23]=S,e[24]=N,e[25]=C):C=e[25];let I;e[26]!==b||e[27]!==n?(I=n.length>0?n.map(x=>t.jsxs("button",{type:"button",className:"w-full flex items-start gap-3 px-5 py-3 text-left hover:bg-muted/40 transition-colors cursor-pointer",onClick:()=>b(x.name),children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(At,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(x.name)}),x.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:x.description})]}),t.jsx(Ce,{size:16,className:"text-muted-foreground shrink-0 mt-0.5"})]},x.name)):t.jsx(ie,{label:"tools"}),e[26]=b,e[27]=n,e[28]=I):I=e[28];let h;e[29]!==I?(h=t.jsx(te,{value:"tools",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:I})}),e[29]=I,e[30]=h):h=e[30];let A;e[31]!==o||e[32]!==_||e[33]!==r||e[34]!==n?(A=_&&t.jsx(te,{value:"apps",className:"h-auto min-h-[200px]",children:t.jsx(os,{tools:n,connectionId:o,org:r})}),e[31]=o,e[32]=_,e[33]=r,e[34]=n,e[35]=A):A=e[35];let M;e[36]!==m?(M=m.length>0?m.map(ls):t.jsx(ie,{label:"prompts"}),e[36]=m,e[37]=M):M=e[37];let O;e[38]!==M?(O=t.jsx(te,{value:"prompts",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:M})}),e[38]=M,e[39]=O):O=e[39];let T;e[40]!==u?(T=u.length>0?u.map(as):t.jsx(ie,{label:"resources"}),e[40]=u,e[41]=T):T=e[41];let z;e[42]!==T?(z=t.jsx(te,{value:"resources",className:"h-auto",children:t.jsx("div",{className:"divide-y divide-border",children:T})}),e[42]=T,e[43]=z):z=e[43];let E;return e[44]!==C||e[45]!==h||e[46]!==A||e[47]!==O||e[48]!==z?(E=t.jsx("div",{className:"rounded-xl border border-border bg-card overflow-hidden",children:t.jsxs(wt,{defaultValue:"tools",variant:"underline",children:[C,h,A,O,z]})}),e[44]=C,e[45]=h,e[46]=A,e[47]=O,e[48]=z,e[49]=E):E=e[49],E}function as(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(Tt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:s.name}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description}),s.uri&&t.jsx("div",{className:"text-xs text-muted-foreground/60 font-mono mt-0.5 truncate",children:s.uri})]})]},s.uri??s.name)}function ls(s){return t.jsxs("div",{className:"flex items-start gap-3 px-5 py-3",children:[t.jsx("div",{className:"mt-0.5 shrink-0 size-7 rounded-md bg-muted flex items-center justify-center",children:t.jsx(kt,{size:13,className:"text-muted-foreground"})}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("div",{className:"text-sm font-medium text-foreground",children:Te(s.name)}),s.description&&t.jsx("div",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed line-clamp-2",children:s.description})]})]},s.name)}function cs(s){return ae(s._meta)}function ds(s){const e=P.c(13),{connection:n,displayTitle:i}=s,a=i??n.title;let o;e[0]!==n.icon||e[1]!==a?(o=t.jsx(oe,{icon:n.icon,name:a,size:"xl",className:"shrink-0"}),e[0]=n.icon,e[1]=a,e[2]=o):o=e[2];let r;e[3]!==a?(r=t.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:t.jsx("h1",{className:"text-lg md:text-xl font-semibold tracking-tight text-foreground leading-none",children:a})}),e[3]=a,e[4]=r):r=e[4];let c;e[5]!==n.description?(c=n.description&&t.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed line-clamp-2",children:n.description}),e[5]=n.description,e[6]=c):c=e[6];let m;e[7]!==r||e[8]!==c?(m=t.jsxs("div",{className:"flex-1 min-w-0",children:[r,c]}),e[7]=r,e[8]=c,e[9]=m):m=e[9];let d;return e[10]!==o||e[11]!==m?(d=t.jsxs("div",{className:"flex items-center gap-4 md:gap-6 py-5 md:py-7 px-4 md:px-8 bg-background border-b border-border shrink-0",children:[o,m]}),e[10]=o,e[11]=m,e[12]=d):d=e[12],d}function ms({form:s,connection:e,hasOAuthToken:n,onReauthenticate:i,onRemoveOAuth:a}){const o=de({control:s.control,name:"ui_type"}),r=de({control:s.control,name:"connection_url"}),{stdioEnabled:c}=Pe(),m=(()=>{if(typeof r!="string"||!r)return!1;try{const l=new URL(r);return l.hostname==="api.githubcopilot.com"&&l.pathname.replace(/\/+$/,"")==="/mcp"}catch{return!1}})(),d=c||e.connection_type==="STDIO",u=e.connection_type==="VIRTUAL",p=u?Oe(e.connection_url):null;return u?t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:"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(we,{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."})]}),p&&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:p})})]})]}):t.jsxs("div",{className:"flex flex-col gap-4",children:[t.jsx(R,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Connection"}),o!=="NPX"&&o!=="STDIO"?t.jsxs("div",{className:"flex items-stretch rounded-lg border border-border overflow-hidden",children:[t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsxs(xe,{className:"h-full! w-auto min-w-[90px] border-0 rounded-none bg-muted/50 focus:ring-0 focus:ring-offset-0",children:[t.jsx(se,{className:"w-4 h-4 text-muted-foreground shrink-0"}),t.jsx(pe,{})]})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:"HTTP"}),t.jsx(F,{value:"SSE",children:"SSE"}),t.jsx(F,{value:"Websocket",children:"Websocket"}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:"NPX Package"}),t.jsx(F,{value:"STDIO",children:"Custom Command"})]})]})]}),t.jsx("div",{className:"w-px bg-border"}),t.jsx(R,{control:s.control,name:"connection_url",render:({field:f})=>t.jsx(L,{className:"flex-1 min-w-0",children:t.jsx(V,{children:t.jsx(q,{placeholder:"https://example.com/mcp",...f,value:f.value??"",className:"h-10 border-0 rounded-none focus-visible:ring-0 focus-visible:ring-offset-0 bg-transparent"})})})})]}):t.jsxs(ue,{value:l.value,onValueChange:l.onChange,children:[t.jsx(V,{children:t.jsx(xe,{className:"h-10",children:t.jsx(pe,{})})}),t.jsxs(fe,{children:[t.jsx(F,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(F,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(F,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(se,{className:"w-4 h-4"}),"Websocket"]})}),d&&t.jsxs(t.Fragment,{children:[t.jsx(F,{value:"NPX",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Ut,{className:"w-4 h-4"}),"NPX Package"]})}),t.jsx(F,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(It,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(B,{})]})}),o==="NPX"&&t.jsx(R,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"NPM Package"}),t.jsx(V,{children:t.jsx(q,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),o==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(R,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Command"}),t.jsx(V,{children:t.jsx(q,{placeholder:"node, bun, python...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})}),t.jsx(R,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Arguments"}),t.jsx(V,{children:t.jsx(q,{placeholder:"arg1 arg2 --flag value",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Space-separated arguments"}),t.jsx(B,{})]})})]}),t.jsx(R,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Working Directory"}),t.jsx(V,{children:t.jsx(q,{placeholder:"/path/to/project (optional)",...l,value:l.value||"",className:"h-10 rounded-lg"})}),t.jsx(B,{})]})})]}),(o==="NPX"||o==="STDIO")&&t.jsx(R,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:"Environment Variables"}),t.jsx(V,{children:t.jsx(Be,{value:l.value??[],onChange:l.onChange})}),t.jsx(B,{})]})}),o!=="NPX"&&o!=="STDIO"&&t.jsx(R,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(L,{className:"flex flex-col gap-3",children:[t.jsx(H,{className:"text-xs text-muted-foreground font-medium",children:m?"GitHub Personal Access Token":"Token"}),n?t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(Ot,{children:[t.jsx(Mt,{asChild:!0,children:t.jsx("button",{type:"button",className:"inline-flex items-center gap-1.5 cursor-pointer",children:t.jsxs(Pt,{variant:"success",className:"gap-1.5",children:[t.jsx(Vt,{size:12}),"Authenticated via OAuth",t.jsx(Et,{size:12})]})})}),t.jsxs(zt,{align:"start",children:[t.jsxs(me,{onClick:i,children:[t.jsx(Ft,{size:16}),"Re-authenticate"]}),t.jsxs(me,{variant:"destructive",onClick:a,children:[t.jsx(le,{size:16}),"Remove OAuth"]})]})]})}):e.connection_token&&l.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:()=>l.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(Rt,{size:14,className:"text-muted-foreground"})})]}):t.jsxs(t.Fragment,{children:[t.jsx(V,{children:t.jsx(q,{type:"password",placeholder:m?"Paste your GitHub PAT":"Enter access token...",...l,value:l.value||"",className:"h-10 rounded-lg"})}),m&&t.jsxs(ut,{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(B,{})]})})]})}function us(s){return s.command==="npx"}function xs(s){return s.args?.find(e=>!e.startsWith("-"))??""}function ps(s){return{command:s.command,args:s.args?.join(" ")??"",cwd:s.cwd??""}}function he(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"&&Re(s.connection_headers)){const i=s.connection_headers,a=qe(i.envVars);if(us(i)){const r=xs(i);return{...n,ui_type:"NPX",connection_url:"",connection_token:null,npx_package:r,stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:a}}const o=ps(i);return{...n,ui_type:"STDIO",connection_url:"",connection_token:null,npx_package:"",stdio_command:o.command,stdio_args:o.args,stdio_cwd:o.cwd,env_vars:a}}return{...n,ui_type:s.connection_type,connection_url:s.connection_url??"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}function fs(s){let e,n=null,i=null,a=null;return s.ui_type==="NPX"?(e="STDIO",n="",a=Ge(s.npx_package||"",s.env_vars||[])):s.ui_type==="STDIO"?(e="STDIO",n="",a=Xe(s.stdio_command||"",s.stdio_args||"",s.stdio_cwd,s.env_vars||[])):(e=s.ui_type,n=s.connection_url||"",i=s.connection_token||null),{title:s.title,description:s.description||null,icon:s.icon??null,connection_type:e,connection_url:n,...i&&{connection_token:i},...a&&{connection_headers:a},configuration_state:s.configuration_state??null,configuration_scopes:s.configuration_scopes??null}}function hs({connection:s,connectionId:e,org:n,isUpdating:i,tools:a,prompts:o,resources:r,siblings:c}){const m=Y({from:"/$org/settings/connections/$appSlug"}),d=Ve(),u=_e(),{org:p}=J(),l=pt({onSuccess:()=>{c.length<=1&&m({to:"/$org/settings/connections",params:{org:n}})}}),[f,g]=G.useState(null),[v,b]=G.useState(!1),j=Ne({connectionId:e}),{data:_}=Ye(),w=_?.data?.members??[],S=f??s,N=w.find(x=>x.userId===S.created_by),y=s?.connection_type==="VIRTUAL"||j.isAuthenticated,C={...s,tools:a},I=Ke(C,Ht),h=Ee({resolver:Ue(We),values:he(f??s)}),A=h.formState.isDirty,M=async()=>{if(!await h.trigger())return;const D=h.getValues(),$=fs(D),U=f?.id??e;await u.update.mutateAsync({id:U,data:$}),h.reset(D)},O=()=>{h.reset(he(f??s))},T=async x=>{const{token:D,tokenInfo:$,error:U}=await Le({connectionId:x,orgSlug:p.slug,scope:"offline_access"});if(U||!D){Q.error(`Authentication failed: ${U}`);return}if($)try{const X=await fetch(`/api/${p.slug}/connections/${x}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:$.accessToken,refreshToken:$.refreshToken,expiresIn:$.expiresIn,scope:$.scope,clientId:$.clientId,clientSecret:$.clientSecret,tokenEndpoint:$.tokenEndpoint})});if(!X.ok)console.error("Failed to save OAuth token:",await X.text()),await u.update.mutateAsync({id:x,data:{connection_token:D}});else try{await u.update.mutateAsync({id:x,data:{}})}catch(Z){console.warn("Failed to refresh connection tools after OAuth:",Z)}}catch(X){console.error("Error saving OAuth token:",X),await u.update.mutateAsync({id:x,data:{connection_token:D}})}else await u.update.mutateAsync({id:x,data:{connection_token:D}});const K=new URL(`/api/${p.slug}/mcp/${x}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated(K.href,null)}),await d.invalidateQueries({queryKey:ne.mcpClientPrefix()}),Q.success("Authentication successful")},z=()=>T(s.id),E=async()=>{try{const x=await fetch(`/api/${p.slug}/connections/${s.id}/oauth-token`,{method:"DELETE",credentials:"include"});if(!x.ok){const $=await x.text();Q.error(`Failed to remove OAuth: ${$}`);return}const D=new URL(`/api/${p.slug}/mcp/${s.id}`,window.location.origin);await d.invalidateQueries({queryKey:ne.isMCPAuthenticated(D.href,null)}),Q.success("OAuth removed. You can now re-authenticate with a different account.")}catch(x){console.error("Error removing OAuth token:",x),Q.error("Failed to remove OAuth")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...l}),t.jsx(at,{open:f!==null,onOpenChange:x=>{x||g(null)},children:t.jsxs(lt,{side:"right",className:"sm:max-w-[520px] p-0 flex flex-col gap-0 overflow-hidden",children:[t.jsxs(ct,{className:"px-4 py-3 md:px-6 md:py-4 border-b border-border shrink-0",children:[t.jsx(dt,{className:"text-base",children:f?.title??s.title}),t.jsx(mt,{className:"text-xs",children:"Update URL, authentication, and other settings"}),N&&t.jsxs("div",{className:"flex items-center gap-1.5 pt-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:"Connected by"}),t.jsx(Ze,{url:N.user?.image??void 0,fallback:N.user?.name??N.user?.email??"?",size:"3xs",shape:"circle"}),t.jsx("span",{className:"text-xs font-medium text-foreground",children:N.user?.name||N.user?.email})]})]}),t.jsxs(xt,{...h,children:[t.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 md:px-6 md:py-5 flex flex-col gap-4 md:gap-6",children:[t.jsxs("div",{className:"flex flex-col gap-3 md:gap-4",children:[t.jsx(R,{control:h.control,name:"title",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Name"}),t.jsx(V,{children:t.jsx(q,{...x})}),t.jsx(B,{})]})}),t.jsx(R,{control:h.control,name:"description",render:({field:x})=>t.jsxs(L,{children:[t.jsx(H,{children:"Description"}),t.jsx(V,{children:t.jsx(q,{...x,value:x.value||""})}),t.jsx(B,{})]})})]}),t.jsx(ms,{form:h,connection:f??s,hasOAuthToken:j.hasOAuthToken,onReauthenticate:z,onRemoveOAuth:E}),t.jsx(Qe,{connection:f??s,form:h,hasMcpBinding:I,isMCPAuthenticated:y,supportsOAuth:j.supportsOAuth,isServerError:j.isServerError,onAuthenticate:z,onViewReadme:void 0})]}),t.jsxs("div",{className:"px-6 py-4 border-t border-border flex gap-2 shrink-0",children:[t.jsx(W,{onClick:M,disabled:!A||i,className:"flex-1",children:i?"Saving…":"Save changes"}),A&&t.jsx(W,{variant:"outline",onClick:O,children:"Undo"}),t.jsxs(W,{variant:"outline",className:"gap-2 text-muted-foreground hover:text-destructive hover:border-destructive",onClick:()=>{const x=f??s;g(null),l.requestDelete(x)},children:[t.jsx(le,{size:15}),"Delete"]})]})]},f?.id??s.id)]})}),t.jsx(ht,{hideHeader:!0,children:t.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[t.jsx(ds,{connection:s,displayTitle:(()=>{const x=c[0]??s;return x.app_name?x.title.replace(/\s*\(\d+\)\s*$/,""):x.title})()}),t.jsx("div",{className:"flex-1 overflow-auto @container",children:t.jsxs("div",{className:"grid grid-cols-1 @3xl:grid-cols-2 gap-5 p-6",children:[t.jsx(es,{connectionId:e}),t.jsxs("div",{className:"flex flex-col gap-5",children:[t.jsx(qt,{instances:c,onConfigure:x=>g(x),onAuthenticate:x=>T(x.id),onDelete:x=>l.requestDelete(x),isAdding:v,onAdd:async()=>{b(!0);try{const x=c[0]??s,D=x.title.replace(/\s*\(\d+\)\s*$/,""),$=c.length+1,U=`${D} (${$})`,K=He("conn");await u.create.mutateAsync({id:K,title:U,description:x.description??null,connection_type:x.connection_type,connection_url:x.connection_url??null,connection_token:null,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:x.created_by,organization_id:x.organization_id,icon:x.icon??null,app_name:x.app_name??null,app_id:x.app_id??null,connection_headers:x.connection_headers??null,oauth_config:null,configuration_state:x.configuration_state??null,metadata:null,tools:null,bindings:null,status:"inactive"});const X=new URL(`/api/${p.slug}/mcp/${K}`,window.location.origin),Z=await Fe({url:X.href,token:null,orgId:p.id});Z.supportsOAuth&&!Z.isAuthenticated&&await T(K)}finally{b(!1)}}}),t.jsx(ns,{connection:s})]}),t.jsx("div",{className:"@3xl:col-span-2",children:t.jsx(rs,{tools:a,prompts:o,resources:r,connectionId:e,org:n})})]})})]})})]})}function gs(){const s=P.c(39);let e;s[0]===Symbol.for("react.memo_cache_sentinel")?(e={from:"/$org/settings/connections/$appSlug"},s[0]=e):e=s[0];const n=Y(e);let i;s[1]===Symbol.for("react.memo_cache_sentinel")?(i={from:"/shell/$org/settings/connections/$appSlug"},s[1]=i):i=s[1];const{appSlug:a,org:o}=ze(i),{org:r}=J(),c=_e();let m;s[2]!==a?(m={slug:a},s[2]=a,s[3]=m):m=s[3];const d=et(m),u=d[0]??null,p=u?.id??"",l=p||null;let f;s[4]!==r.id||s[5]!==r.slug||s[6]!==l?(f={connectionId:l,orgId:r.id,orgSlug:r.slug},s[4]=r.id,s[5]=r.slug,s[6]=l,s[7]=f):f=s[7];const g=re(f);let v;s[8]!==g?(v={client:g},s[8]=g,s[9]=v):v=s[9];const{data:b}=st(v);let j;if(s[10]!==u?.tools||s[11]!==p||s[12]!==d||s[13]!==b){const T=b?b.tools.map(_s):(u?.tools??[]).map(ys);e:{if(d.length<=1){j=T;break e}const z=new Set,E=[],x=bs;for(const D of d){const $=D.id===p?T:x(D.tools);for(const U of $)z.has(U.name)||(z.add(U.name),E.push(U))}j=E.length>0?E:T}s[10]=u?.tools,s[11]=p,s[12]=d,s[13]=b,s[14]=j}else j=s[14];const _=j;let w;s[15]!==g?(w={client:g},s[15]=g,s[16]=w):w=s[16];const{data:S}=it(w);let N;s[17]!==g?(N={client:g},s[17]=g,s[18]=N):N=s[18];const{data:k}=ot(N);let y;s[19]!==S?.prompts?(y=S?.prompts??[],s[19]=S?.prompts,s[20]=y):y=s[20];let C;s[21]!==y?(C=y.map(vs),s[21]=y,s[22]=C):C=s[22];const I=C;let h;s[23]!==k?.resources?(h=k?.resources??[],s[23]=k?.resources,s[24]=h):h=s[24];let A;s[25]!==h?(A=h.map(js),s[25]=h,s[26]=A):A=s[26];const M=A;if(!u){let T;return s[27]!==n||s[28]!==o?(T=t.jsx("div",{className:"flex h-full w-full bg-background",children:t.jsx(be,{title:"Connection not found",description:"This connection may have been deleted or you may not have access.",actions:t.jsx(W,{variant:"outline",onClick:()=>n({to:"/$org/settings/connections",params:{org:o}}),children:"Back to connections"})})}),s[27]=n,s[28]=o,s[29]=T):T=s[29],T}let O;return s[30]!==c.update.isPending||s[31]!==_||s[32]!==u||s[33]!==p||s[34]!==o||s[35]!==I||s[36]!==M||s[37]!==d?(O=t.jsx(hs,{org:o,connection:u,connectionId:p,isUpdating:c.update.isPending,tools:_,prompts:I,resources:M,siblings:d}),s[30]=c.update.isPending,s[31]=_,s[32]=u,s[33]=p,s[34]=o,s[35]=I,s[36]=M,s[37]=d,s[38]=O):O=s[38],O}function js(s){return{name:s.name,description:s.description,uri:s.uri}}function vs(s){return{name:s.name,description:s.description}}function bs(s){return(s??[]).map(Ns)}function Ns(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema??{},outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function ys(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function _s(s){return{name:s.name,description:s.description,inputSchema:s.inputSchema,outputSchema:s.outputSchema,annotations:s.annotations,_meta:s._meta}}function Ss(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Me,{children:t.jsx(G.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:t.jsx(je,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(gs,{})})}),s[0]=e):e=s[0],e}function so(){const s=P.c(1);let e;return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ss,{}),s[0]=e):e=s[0],e}export{so as default};
@@ -1 +1 @@
1
- import{J as R,ap as A,aM as I,P as a,an as j,ao as z,e as L,j as u,B as C}from"./index-BQhmgiEq.js";import{I as H}from"./input-DZxKc7J0.js";import{s as W}from"./Plus-Cy8cBKs0.js";import{s as q}from"./Trash01-ycnKf74n.js";const K=R({key:a().min(1,"Key is required"),value:a()}),G=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
1
+ import{J as R,ap as A,aM as I,P as a,an as j,ao as z,e as L,j as u,B as C}from"./index-c9Pbt5D9.js";import{I as H}from"./input-BGaLq3ax.js";import{s as W}from"./Plus-D8dMVCG8.js";import{s as q}from"./Trash01-D5iQjfZH.js";const K=R({key:a().min(1,"Key is required"),value:a()}),G=R({title:a().min(1,"Name is required"),description:a().nullable().optional(),icon:a().nullable().optional(),ui_type:z(["HTTP","SSE","Websocket","NPX","STDIO"]),connection_url:a().optional(),connection_token:a().nullable().optional(),npx_package:a().optional(),stdio_command:a().optional(),stdio_args:a().optional(),stdio_cwd:a().optional(),env_vars:j(K).optional(),configuration_scopes:j(a()).nullable().optional(),configuration_state:A(a(),I()).nullable().optional()}).refine(n=>n.ui_type==="NPX"?!!n.npx_package?.trim():!0,{message:"NPM package is required",path:["npx_package"]}).refine(n=>n.ui_type==="STDIO"?!!n.stdio_command?.trim():!0,{message:"Command is required",path:["stdio_command"]}).refine(n=>n.ui_type==="HTTP"||n.ui_type==="SSE"||n.ui_type==="Websocket"?!!n.connection_url?.trim():!0,{message:"URL is required",path:["connection_url"]});function $(n){const e=n.toLowerCase();return!!(["secret","password","passwd","credential","private","token","bearer","jwt","refresh","session","api_key","apikey","auth_key","access_key","secret_key","private_key","service_key","encryption_key","signing_key","license_key","auth","oauth","client_secret","app_secret","webhook","signing","signature","database_url","db_url","mongo_uri","redis_url","postgres_url","mysql_url","connection_string","dsn","service_role","anon_key","supabase_key","openai","anthropic","stripe","twilio","sendgrid","resend","firebase","sentry","datadog","newrelic","new_relic","pplx","replicate","pinecone","cohere","hugging","hf_token","gh_token","npm_token","certificate","cert","ssl","tls","encryption","salt","hash","hmac","personal_access","github_pat","gitlab_pat","bitbucket_pat"].some(s=>e.includes(s))||["sk_","rk_","whsec_","pk_live","sk_live"].some(s=>e.startsWith(s))||["_key","_secret","_token","_password","_auth","_pat"].some(s=>e.endsWith(s)))}function X(n){const e=L.c(34),{value:t,onChange:r,keyPlaceholder:o,valuePlaceholder:s,className:v}=n,m=o===void 0?"VARIABLE_NAME":o,_=s===void 0?"value...":s;let b;e[0]!==r||e[1]!==t?(b=()=>{r([...t,{key:"",value:""}])},e[0]=r,e[1]=t,e[2]=b):b=e[2];const S=b;let x;e[3]!==r||e[4]!==t?(x=l=>{r(t.filter((p,i)=>i!==l))},e[3]=r,e[4]=t,e[5]=x):x=e[5];const g=x;let P;e[6]!==r||e[7]!==t?(P=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:p,value:c.value},r(i))},e[6]=r,e[7]=t,e[8]=P):P=e[8];const y=P;let w;e[9]!==r||e[10]!==t?(w=(l,p)=>{const i=[...t],c=i[l];c&&(i[l]={key:c.key,value:p},r(i))},e[9]=r,e[10]=t,e[11]=w):w=e[11];const k=w;let d;if(e[12]!==y||e[13]!==g||e[14]!==k||e[15]!==m||e[16]!==t||e[17]!==_){let l;e[19]!==y||e[20]!==g||e[21]!==k||e[22]!==m||e[23]!==_?(l=(p,i)=>u.jsxs("div",{className:"flex gap-2 items-center",children:[u.jsx(H,{placeholder:m,value:p.key,onChange:c=>y(i,c.target.value),className:"h-10 rounded-lg flex-1 font-mono text-sm"}),u.jsx(H,{type:$(p.key)?"password":"text",placeholder:_,value:p.value,onChange:c=>k(i,c.target.value),className:"h-10 rounded-lg flex-1"}),u.jsx(C,{type:"button",variant:"ghost",size:"icon",className:"h-10 w-10 shrink-0 text-muted-foreground hover:text-destructive",onClick:()=>g(i),children:u.jsx(q,{size:16})})]},i),e[19]=y,e[20]=g,e[21]=k,e[22]=m,e[23]=_,e[24]=l):l=e[24],d=t.map(l),e[12]=y,e[13]=g,e[14]=k,e[15]=m,e[16]=t,e[17]=_,e[18]=d}else d=e[18];let T;e[25]===Symbol.for("react.memo_cache_sentinel")?(T=u.jsx(W,{size:16,className:"mr-1"}),e[25]=T):T=e[25];let f;e[26]!==S?(f=u.jsxs(C,{type:"button",variant:"outline",size:"sm",className:"w-full h-9 text-muted-foreground",onClick:S,children:[T,"Add Environment Variable"]}),e[26]=S,e[27]=f):f=e[27];let h;e[28]!==d||e[29]!==f?(h=u.jsxs("div",{className:"flex flex-col gap-2",children:[d,f]}),e[28]=d,e[29]=f,e[30]=h):h=e[30];let E;return e[31]!==v||e[32]!==h?(E=u.jsx("div",{className:v,children:h}),e[31]=v,e[32]=h,e[33]=E):E=e[33],E}function V(n){const e={};for(const{key:t,value:r}of n)t.trim()&&(e[t.trim()]=r);return e}function D(n){return n?Object.entries(n).map(([e,t])=>({key:e,value:t})):[]}function N(n){const e=n.trim();if(!e)return"";try{const t=new URL(e),r=t.pathname.length>1?t.pathname.replace(/\/+$/,""):t.pathname;return`${t.origin}${r}`}catch{return e.replace(/\/+$/,"")}}function F(n){const e=n.trim().split(/\s+/).filter(Boolean);if(e.length<2)return null;const t=e[0]?.toLowerCase();if(t!=="npx"&&t!=="bunx")return null;const o=e.slice(1).find(s=>!s.startsWith("-"));return o?{packageName:o}:null}function Y(n){const{uiType:e}=n,t=N(n.connectionUrl??"");if((e==="HTTP"||e==="SSE"||e==="Websocket")&&t===N("https://api.githubcopilot.com/mcp/"))return{id:"github",title:"GitHub",description:"GitHub Copilot MCP",token:{label:"GitHub PAT",placeholder:"github_pat_…",helperText:"Paste a GitHub Personal Access Token (PAT)"}};const r=(n.npxPackage??"").trim();return e==="NPX"&&r==="@perplexity-ai/mcp-server"?{id:"perplexity",title:"Perplexity",description:"Perplexity MCP Server",envVarKeys:["PERPLEXITY_API_KEY"]}:null}function J(n){if(n.registryItems.length===0||n.uiType!=="HTTP"&&n.uiType!=="SSE"&&n.uiType!=="Websocket")return null;const e=N(n.connectionUrl??"");if(!e)return null;const t=n.registryItems.find(s=>(s.server?.remotes??[]).some(m=>N(m.url??"")===e));if(!t)return null;const r=t.title||t.name||t.server?.title||t.server?.name||"",o=t.server?.description||t.description||t.summary||null;return r?{id:"registry",title:r,description:o}:null}function Q(n,e){const t={command:"npx",args:["-y",n]},r=V(e);return Object.keys(r).length>0&&(t.envVars=r),t}function Z(n,e,t,r){const o={command:n};e.trim()&&(o.args=e.trim().split(/\s+/)),t?.trim()&&(o.cwd=t.trim());const s=V(r);return Object.keys(s).length>0&&(o.envVars=s),o}export{X as E,J as a,Q as b,G as c,Z as d,Y as i,F as p,D as r};
@@ -1 +1 @@
1
- import{e as ie,j as t,E as Ye,r as W,l as re,q as _e,f as Se,d as Je,b as be,u as Ze,p as et,U as tt,F as nt,G as st,B,t as te,D as ot,c as ce,o as G,I as it,H as lt,K as rt}from"./index-BQhmgiEq.js";import{g as ct}from"./generate-id-7pqGD8tV.js";import{C as at}from"./collection-display-button-D2FlqPoI.js";import{S as dt}from"./search-input-BqlqV-_0.js";import{C as mt}from"./collection-tabs-sb0bPFTC.js";import{u as ut,a as Ne,g as pt,C as fe}from"./connection-card-Dmdx8kTx.js";import{E as ht}from"./empty-state-wvWmfCHy.js";import{I as xt}from"./integration-icon-DewzWl2m.js";import{P as de}from"./index-COBzfRZi.js";import{u as gt,D as ft}from"./use-delete-connection-CQU3mfvU.js";import{u as jt}from"./use-infinite-scroll-CgCif0T0.js";import{u as yt}from"./use-list-state-D6p_uKvt.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-DPlzs4kv.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,f as Te,e as Ie,g as Pe,a as Le,A as Oe}from"./alert-dialog-30grTlQF.js";import{C as $e}from"./checkbox-CjSQbGdc.js";import{b as Ee,a as ze,c as Fe,d as Me,e as Ve,D as Be}from"./dialog-CEusfHMX.js";import{b as _t,a as St,c as bt,D as Nt,d as kt,e as Dt,f as At}from"./drawer-T83Srv96.js";import{u as wt}from"./tooltip-IAEIrTVw.js";import{D as Ue,a as He,b as Re,c as pe}from"./dropdown-menu-CT0lW-r3.js";import{F as Q,b as Y,c as J,d as Z,f as ee,a as Ce}from"./form-w71mMA8g.js";import{I as oe}from"./input-DZxKc7J0.js";import{S as Tt,a as It,b as Pt,c as Lt,d as le}from"./select-C-gPp7G9.js";import{T as Ot}from"./textarea-D08XpeH3.js";import{b as Ke,u as $t}from"./use-connection-CqLc2kCT.js";import{u as Et,S as zt}from"./constants-C4WRW-LO.js";import{b as Ft}from"./use-virtual-mcp-DPVntSu2.js";import{u as Mt,V as Vt}from"./agent-icon-iDRgsF6L.js";import{n as he}from"./Container-UyfewUfa.js";import{i as We}from"./DotsVertical-SlSMdJkj.js";import{s as Xe}from"./RefreshCcw01-DmmbBsed.js";import{s as ge}from"./Star01-D8HBHDwu.js";import{s as qe}from"./Plus-Cy8cBKs0.js";import{s as Ge}from"./Trash01-ycnKf74n.js";import{s as Qe}from"./XClose-4axhqxBQ.js";import{i as me,a as ve,E as Bt,c as Ut,p as Ht,b as Rt,d as Kt}from"./connection-form-helpers-DKAyPoDI.js";import"./collections-fkPfVMTg.js";import"./SwitchHorizontal01-BnKnieWk.js";import"./Check-CVcAPsxw.js";import"./view-mode-toggle-D1dUZXpK.js";import"./badge-DuiHx46w.js";import"./SearchMd-DBFtSrcv.js";import"./use-registry-connections-C8o36UIG.js";import"./use-organization-settings-DoIv1zqR.js";import"./useInfiniteQuery-DKkhiiov.js";import"./infiniteQueryObserver-CbM0kgNm.js";import"./card-BES0SMqR.js";import"./sidebar-D6d-v_Pc.js";import"./LayoutLeft-DCkIyObc.js";import"./X-DPY2mUo2.js";import"./use-view-mode-2VzWrKsP.js";import"./ChevronRight-Cv88p4ps.js";import"./label-B1la-fci.js";import"./ChevronDown-BrQ5SMJr.js";import"./ChevronUp-BEXPurOi.js";import"./use-collections-B5chukT1.js";import"./AlertCircle-BNCl7-KE.js";import"./Tool01-A_tsfqwo.js";import"./Stars02-GxNmnBiz.js";import"./ArrowNarrowLeft-DoLG4rPk.js";import"./XCircle-B83XL35R.js";import"./ArrowUpRight-dM_balV_.js";import"./ZapSquare-CLINFtDR.js";import"./Users03-ZMVhIoHM.js";import"./CheckCircle-LNun5awz.js";import"./FilterLines-D43-OQwr.js";import"./Palette-CM8YcCMA.js";import"./HardDrive-9oRtZKUj.js";import"./Key01-CR3cW4Ic.js";import"./LinkExternal01-Di-5czt2.js";import"./Lock01-7UEvqN90.js";import"./Monitor01-B9n70Cxg.js";import"./Sun-CydVR3Ev.js";import"./Play-D-B65aXH.js";import"./Settings02-3MysM1BG.js";import"./Shield01-HdcY4mrx.js";import"./Upload01-DYToW9Zt.js";import"./User01-C3BOLDRp.js";import"./Users01-hicb3AcK.js";import"./Zap-4q67D7Av.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:g,selectionMode:m,selectedIds:d,onToggleSelect:o}=y;let v;if(e[0]!==n.connections||e[1]!==d){let j;e[3]!==d?(j=U=>d.has(U.id),e[3]=d,e[4]=j):j=e[4],v=n.connections.every(j),e[0]=n.connections,e[1]=d,e[2]=v}else v=e[2];const h=v;let _;if(e[5]!==n.connections||e[6]!==d){let j;e[8]!==d?(j=U=>d.has(U.id),e[8]=d,e[9]=j):j=e[9],_=n.connections.some(j),e[5]=n.connections,e[6]=d,e[7]=_}else _=e[7];const u=_,S=`${n.connections.length} instances`;let x;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(x={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=x):x=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==g||e[17]!==o||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)})():g(),e[14]=h,e[15]=n.connections,e[16]=g,e[17]=o,e[18]=d,e[19]=m,e[20]=a):a=e[20];const p=m&&h&&"ring-2 ring-primary",f=m&&u&&!h&&"ring-1 ring-primary/50";let k;e[21]!==p||e[22]!==f?(k=ce(p,f),e[21]=p,e[22]=f,e[23]=k):k=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(he,{}),e[24]=A):A=e[24];let N;e[25]!==h||e[26]!==n.connections||e[27]!==o||e[28]!==d||e[29]!==m||e[30]!==u?(N=m?t.jsx($e,{checked:h?!0:u?"indeterminate":!1,onCheckedChange:()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=o,e[28]=d,e[29]=m,e[30]=u,e[31]=N):N=e[31];const I=m?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[32]!==I?(s=ce("overflow-hidden transition-all duration-150 ease-out",I),e[32]=I,e[33]=s):s=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(He,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qt,children:t.jsx(We,{size:20})})}),e[34]=D):D=e[34];let M;e[35]!==g?(M=j=>{j.stopPropagation(),g()},e[35]=g,e[36]=M):M=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Xe,{size:16}),e[37]=$):$=e[37];let P;e[38]!==M?(P=t.jsxs(Ue,{children:[D,t.jsx(Re,{align:"end",onClick:Xt,children:t.jsxs(pe,{onClick:M,children:[$,"Open"]})})]}),e[38]=M,e[39]=P):P=e[39];let T;e[40]!==s||e[41]!==P?(T=t.jsx("div",{className:s,children:P}),e[40]=s,e[41]=P,e[42]=T):T=e[42];let z;e[43]!==N||e[44]!==T?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[N,T]}),e[43]=N,e[44]=T,e[45]=z):z=e[45];let F;return e[46]!==z||e[47]!==x||e[48]!==a||e[49]!==k?(F=t.jsx(t.Fragment,{children:t.jsx(fe,{connection:x,onClick:a,className:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:z})}),e[46]=z,e[47]=x,e[48]=a,e[49]=k,e[50]=F):F=e[50],F}function Xt(y){return y.stopPropagation()}function qt(y){return y.stopPropagation()}function Gt(y){const e=ie.c(28),{count:n,total:g,onSelectAll:m,onDeselectAll:d,onDelete:o,onAddToAgent:v,onToggleStatus:h,onCancel:_}=y;if(n===0)return null;let u;e[0]!==n?(u=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=u):u=e[1];let S;e[2]!==n||e[3]!==d||e[4]!==m||e[5]!==g?(S=n<g?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:["Select all (",g,")"]}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:"Clear selection"}),e[2]=n,e[3]=d,e[4]=m,e[5]=g,e[6]=S):S=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:13}),e[7]=x):x=e[7];let a;e[8]!==v?(a=t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:[x,"Add to Agent"]}),e[8]=v,e[9]=a):a=e[9];let p;e[10]!==h?(p=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:"Enable"}),e[10]=h,e[11]=p):p=e[11];let f;e[12]!==h?(f=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:"Disable"}),e[12]=h,e[13]=f):f=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{size:13}),e[14]=k):k=e[14];let A;e[15]!==o?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:[k,"Delete"]}),e[15]=o,e[16]=A):A=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qe,{size:13}),e[17]=N):N=e[17];let I;e[18]!==_?(I=t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:_,children:N}),e[18]=_,e[19]=I):I=e[19];let s;return e[20]!==u||e[21]!==I||e[22]!==S||e[23]!==a||e[24]!==p||e[25]!==f||e[26]!==A?(s=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:[u,S,a,p,f,A,I]})}),e[20]=u,e[21]=I,e[22]=S,e[23]=a,e[24]=p,e[25]=f,e[26]=A,e[27]=s):s=e[27],s}function Qt(y){const e=ie.c(25),{open:n,onOpenChange:g,agents:m,onConfirm:d}=y,[o,v]=W.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(Ve,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let _;e[1]!==m||e[2]!==o?(_=m.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):m.map(N=>t.jsxs("button",{type:"button",onClick:()=>v(N.id),className:ce("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",o===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{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]=m,e[2]=o,e[3]=_):_=e[3];let u;e[4]!==_?(u=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:_}),e[4]=_,e[5]=u):u=e[5];let S;e[6]!==g?(S=t.jsx(B,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e[6]=g,e[7]=S):S=e[7];const x=!o;let a;e[8]!==d||e[9]!==g||e[10]!==o?(a=()=>{o&&(d(o),g(!1),v(null))},e[8]=d,e[9]=g,e[10]=o,e[11]=a):a=e[11];let p;e[12]!==x||e[13]!==a?(p=t.jsx(B,{disabled:x,onClick:a,children:"Add"}),e[12]=x,e[13]=a,e[14]=p):p=e[14];let f;e[15]!==S||e[16]!==p?(f=t.jsxs(Be,{children:[S,p]}),e[15]=S,e[16]=p,e[17]=f):f=e[17];let k;e[18]!==u||e[19]!==f?(k=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,u,f]}),e[18]=u,e[19]=f,e[20]=k):k=e[20];let A;return e[21]!==g||e[22]!==n||e[23]!==k?(A=t.jsx(Ee,{open:n,onOpenChange:g,children:k}),e[21]=g,e[22]=n,e[23]=k,e[24]=A):A=e[24],A}function Yt(y){const e=ie.c(20),{open:n,onOpenChange:g,count:m,onConfirm:d}=y,o=m!==1?"s":"";let v;e[0]!==m||e[1]!==o?(v=t.jsxs(De,{children:["Delete ",m," connection",o,"?"]}),e[0]=m,e[1]=o,e[2]=v):v=e[2];const h=m!==1?"s":"";let _;e[3]!==h?(_=t.jsxs(Ae,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=_):_=e[4];let u;e[5]!==v||e[6]!==_?(u=t.jsxs(we,{children:[v,_]}),e[5]=v,e[6]=_,e[7]=u):u=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{children:"Cancel"}),e[8]=S):S=e[8];const x=m!==1?"s":"";let a;e[9]!==m||e[10]!==d||e[11]!==x?(a=t.jsxs(Ie,{children:[S,t.jsxs(Pe,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",m," connection",x]})]}),e[9]=m,e[10]=d,e[11]=x,e[12]=a):a=e[12];let p;e[13]!==u||e[14]!==a?(p=t.jsxs(Le,{children:[u,a]}),e[13]=u,e[14]=a,e[15]=p):p=e[15];let f;return e[16]!==g||e[17]!==n||e[18]!==p?(f=t.jsx(Oe,{open:n,onOpenChange:g,children:p}),e[16]=g,e[17]=n,e[18]=p,e[19]=f):f=e[19],f}function Jt(y){return y._registryId?.includes("community-registry")===!0}function Zt(y){const e=ie.c(56),{item:n,allConnections:g,connectedAppNames:m,connectingItemId:d,onNavigateConnected:o,onConnect:v}=y,[h,_]=W.useState(!1),[u,S]=W.useState(null);let x,a;e[0]!==m||e[1]!==n?(x=ke(n)??"",a=m.has(x),e[0]=m,e[1]=n,e[2]=x,e[3]=a):(x=e[2],a=e[3]);const p=a,f=n._meta?.["mcp.mesh"],k=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",A=n.server?.description||n.description||null;let N;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(N=n.server?.icons?.[0]?.src||Ct(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=N):N=e[6];const I=N;let s;if(e[7]!==g||e[8]!==x){let b;e[10]!==x?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===x,e[10]=x,e[11]=b):b=e[11],s=g.filter(b),e[7]=g,e[8]=x,e[9]=s}else s=e[9];const D=s;let M;e[12]!==n?(M=Jt(n),e[12]=n,e[13]=M):M=e[13];const $=M;let P,T;e[14]!==D||e[15]!==$||e[16]!==p||e[17]!==n||e[18]!==v||e[19]!==o?(P=()=>{if(p){const b=D[0];b&&o(b);return}T()},T=()=>{$?(S("connect"),_(!0)):v(n)},e[14]=D,e[15]=$,e[16]=p,e[17]=n,e[18]=v,e[19]=o,e[20]=P,e[21]=T):(P=e[20],T=e[21]);let z;e[22]!==n||e[23]!==v||e[24]!==u?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),_(!1),u==="connect"&&v(n),S(null)},e[22]=n,e[23]=v,e[24]=u,e[25]=z):z=e[25];const F=z;let j;e[26]!==A||e[27]!==I||e[28]!==k?(j={title:k,description:A,icon:I},e[26]=A,e[27]=I,e[28]=k,e[29]=j):j=e[29];let U;e[30]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(he,{}),e[30]=U):U=e[30];let H;e[31]!==$||e[32]!==n._sourceIcon?(H=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[31]=$,e[32]=n._sourceIcon,e[33]=H):H=e[33];let X;e[34]!==d||e[35]!==T||e[36]!==p||e[37]!==n.id?(X=p?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:d!==null,onClick:b=>{b.stopPropagation(),T()},children:d===n.id?t.jsx(re,{size:14,className:"animate-spin"}):"Connect"}),e[34]=d,e[35]=T,e[36]=p,e[37]=n.id,e[38]=X):X=e[38];let i;e[39]!==H||e[40]!==X?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[39]=H,e[40]=X,e[41]=i):i=e[41];let C;e[42]!==P||e[43]!==i||e[44]!==j?(C=t.jsx(fe,{connection:j,fallbackIcon:U,onClick:P,headerActionsAlwaysVisible:!0,headerActions:i}),e[42]=P,e[43]=i,e[44]=j,e[45]=C):C=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(we,{children:[t.jsx(De,{children:"Community MCP Server"}),t.jsx(Ae,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[46]=V):V=e[46];let R;e[47]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Te,{children:"Cancel"}),e[47]=R):R=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[R,t.jsx(Pe,{onClick:F,children:"Continue"})]})]}),e[48]=F,e[49]=E):E=e[49];let l;e[50]!==h||e[51]!==E?(l=t.jsx(Oe,{open:h,onOpenChange:_,children:E}),e[50]=h,e[51]=E,e[52]=l):l=e[52];let O;return e[53]!==C||e[54]!==l?(O=t.jsxs(t.Fragment,{children:[C,l]}),e[53]=C,e[54]=l,e[55]=O):O=e[55],O}function en({listState:y,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:m,enabledRegistries:d}){const{org:o}=_e(),v=ot(),h=Se(),{data:_}=be.useSession(),u=Ke(),S=$t(y),x=gt(),[a,p]=W.useState(new Set),f=a.size>0,[k,A]=W.useState(!1),[N,I]=W.useState(!1),[s,D]=W.useState(null),M=Ft(),$=S.filter(r=>!(n!=="ALL"&&r.connection_type!==n||g!=="ALL"&&r.status!==g)),P=pt($),T=r=>{p(c=>{const w=new Set(c);return w.has(r)?w.delete(r):w.add(r),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,U=jt(F.loadMore,F.hasMore,F.isLoadingMore),H=new Set(S.filter(r=>r.app_name).map(r=>r.app_name)),X=m==="ALL"||d.some(r=>r.id===m)?m:"ALL",i=y.search.length>0,C=e==="all"||i?j.filter(r=>{if(X!=="ALL"&&r._registryId!==X)return!1;if(i){const c=ke(r);if(c&&H.has(c))return!1}return!0}):[],V=e==="connected"||i?P:[],R=async r=>{if(!(!o||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),D(r.id);try{const c=vt(r,o.id,_.user.id,{remoteIndex:0}),w=c.connection_type==="STDIO",L=!!c.connection_url,q=w&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!L&&!q){G.error("This MCP Server cannot be connected: no connection method available"),D(null);return}const{id:K}=await u.create.mutateAsync(c),je=new URL(`/api/${o.slug}/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null,orgId:o.id});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,orgSlug:o.slug,scope:"offline_access"});if(xe||!ae){te("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:xe??"no_token"}),G.error(`Authentication failed: ${xe??"no token received"}`);return}else{if(te("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),ne)try{(await fetch(`/api/${o.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ae}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ae}})}else await u.update.mutateAsync({id:K,data:{connection_token:ae}});await v.invalidateQueries({queryKey:rt.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(c){G.error(`Failed to connect: ${c instanceof Error?c.message:String(c)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:o.id,orgSlug:o.slug}),l=()=>{v.invalidateQueries({predicate:r=>{const c=r.queryKey;return c[1]===o.id&&c[3]==="collection"&&c[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const r=[...a];te("connections_bulk_delete",{count:r.length});let c=0;for(const w of r)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||c++}catch{}l(),G.success(`Deleted ${c} connection${c!==1?"s":""}`),z()},b=async r=>{const c=[...a];te("connections_bulk_status_toggled",{count:c.length,to_status:r});let w=0;for(const L of c)try{await u.update.mutateAsync({id:L,data:{status:r}}),w++}catch{}l(),G.success(`${r==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async r=>{const c=M.find(q=>q.id===r);if(!c||!E)return;te("connections_bulk_add_to_agent",{agent_id:r,count:a.size});const w=new Set(c.connections.map(q=>q.connection_id)),L=[...a].filter(q=>!w.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(L.length===0){G.info("All selected connections are already in that agent");return}try{await E.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:r,data:{connections:[...c.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===o.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${c.title}"`),z()}catch{G.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...x}),t.jsx(Yt,{open:k,onOpenChange:A,count:a.size,onConfirm:O}),t.jsx(Qt,{open:N,onOpenChange:I,agents:M,onConfirm:se}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(i?C.length===0&&$.length===0:e==="all"?C.length===0:$.length===0)?t.jsx(ht,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:y.search?`No Connections match "${y.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[V.map(r=>{if(r.type==="group")return t.jsx(Wt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:r.key}})},selectionMode:f,selectedIds:a,onToggleSelect:T},r.key);const c=r.connection,w=a.has(c.id);return t.jsx(fe,{connection:c,fallbackIcon:t.jsx(he,{}),onClick:()=>f?T(c.id):h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}}),className:ce(w&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[f?t.jsx($e,{checked:w,onCheckedChange:()=>T(c.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:ce("overflow-hidden transition-all duration-150 ease-out",f?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ue,{children:[t.jsx(He,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L=>L.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(Re,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(c.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(c)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},c.id)}),C.map(r=>t.jsx(Zt,{item:r,allConnections:S,connectedAppNames:H,connectingItemId:s,onNavigateConnected:c=>h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}}),onConnect:R},`catalog-${r._registryId}:${r.id}`)),(e==="all"||i)&&d.length>0&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||i)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})})]})}),f&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(r=>r.id)))},onDeselectAll:()=>p(new Set),onDelete:()=>A(!0),onAddToAgent:()=>I(!0),onToggleStatus:b,onCancel:z})]})}function tn(){const{org:y}=_e(),e=Se(),n=Je({strict:!1}),{data:g}=be.useSession(),{stdioEnabled:m}=Ze(),d=wt(),o=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,f]=W.useState("ALL"),k=ut(),N=Ne(k,o.searchTerm).items,I=o.search!==o.searchTerm,s=nt({resolver:st(Ut),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=s.watch("ui_type"),M=s.watch("connection_url"),$=s.watch("npx_package"),P=me({uiType:D,connectionUrl:M??"",npxPackage:$??""})??ve({uiType:D,connectionUrl:M??"",registryItems:N}),T=n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:y.slug},search:{action:"create"}})},F=()=>{e({to:"/$org/settings/connections",params:{org:y.slug},search:{}})},j=async i=>{let C,V=null,R=null,E=null;i.ui_type==="NPX"?(C="STDIO",V="",E=Rt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(C=i.ui_type,V=i.connection_url||"",R=i.connection_token||null);const l=ct("conn");te("connection_custom_created",{connection_type:C,ui_type:i.ui_type}),await v.create.mutateAsync({id:l,title:i.title,description:i.description||null,connection_type:C,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:g?.user?.id||"system",organization_id:y.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),F(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:ue({app_name:null,connection_url:V,title:i.title,id:l})}})},U=i=>{i||(T&&F(),s.reset())},H=i=>{const C=i.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,l=b=>{if(b&&(!V&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],r=new Set(se.map(w=>w.key)),c=b.envVarKeys.filter(w=>!r.has(w));c.length>0&&s.setValue("env_vars",[...se,...c.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Ht(C);if(O&&m){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),l(me({uiType:"NPX",npxPackage:O.packageName}));return}if(C.startsWith("http://")||C.startsWith("https://")){const b=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",C,{shouldDirty:!0}),l(me({uiType:b,connectionUrl:C})??ve({uiType:b,connectionUrl:C,registryItems:N}));return}D==="NPX"&&l(me({uiType:"NPX",npxPackage:C}))},X=t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(B,{variant:"outline",onClick:z,children:[t.jsx(qe,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})});return t.jsx(t.Fragment,{children:t.jsxs(de,{children:[(()=>{const i="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Type *"}),t.jsxs(Tt,{value:l.value,onValueChange:l.onChange,children:[t.jsx(Z,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(le,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(le,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(le,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(le,{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(le,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),H(b))},onBlur:O=>{H(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Command *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"node, bun, python...",...l,value:l.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"/path/to/project (optional)",...l,value:l.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:l.value??[],onChange:l.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"URL *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),H(b))},onBlur:O=>{H(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:P?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...l,value:l.value??""})}),P?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.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(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Name *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"My Connection",...l})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Description"}),t.jsx(Z,{children:t.jsx(Ot,{placeholder:"A brief description of this connection",rows:3,...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),E=T;return d?t.jsx(_t,{open:E,onOpenChange:U,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:i}),t.jsx(kt,{className:"mt-1",children:C})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Qe,{size:16})})})]})}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(At,{children:t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:E,onOpenChange:U,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:i}),t.jsx(Ve,{children:C})]}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Be,{children:[t.jsx(B,{type:"button",variant:"outline",onClick:()=>U(!1),children:"Cancel"}),t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(de.Content,{children:t.jsx(de.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(de.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{value:o.search,onChange:o.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(o.setSearch(""),i.target.blur())}}),t.jsx(at,{sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.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:u,onChange:i=>S(i||"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:x,onChange:i=>a(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...k.length>1?[{label:"Registry",value:p,onChange:i=>f(i||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:i=>{const C=i;C!==h&&te("connections_page_tab_changed",{to_tab:C}),_(C)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:I?.5:1,transition:I?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:I?"none":"auto"},children:t.jsx(en,{listState:o,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function Ts(){const y=ie.c(1);let e;return y[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{Ts as default};
1
+ import{e as ie,j as t,E as Ye,r as W,l as re,q as _e,f as Se,d as Je,b as be,u as Ze,p as et,U as tt,F as nt,G as st,B,t as te,D as ot,c as ce,o as G,I as it,H as lt,K as rt}from"./index-c9Pbt5D9.js";import{g as ct}from"./generate-id-DtDqQvIv.js";import{C as at}from"./collection-display-button-CeEGick7.js";import{S as dt}from"./search-input-DZC3FA9U.js";import{C as mt}from"./collection-tabs-CkTIDC3A.js";import{u as ut,a as Ne,g as pt,C as fe}from"./connection-card-BswapS_C.js";import{E as ht}from"./empty-state-DW3JI1nZ.js";import{I as xt}from"./integration-icon-8egQk7i2.js";import{P as de}from"./index-CNE80A83.js";import{u as gt,D as ft}from"./use-delete-connection-2Y6JpaXB.js";import{u as jt}from"./use-infinite-scroll-BIl8Btbp.js";import{u as yt}from"./use-list-state-BCQHlt2C.js";import{g as ke,a as Ct,e as vt}from"./extract-connection-data-D3z53YWV.js";import{g as ue}from"./connection-slug-eyAPH6o3.js";import{c as De,d as Ae,b as we,f as Te,e as Ie,g as Pe,a as Le,A as Oe}from"./alert-dialog-B9ApqUuI.js";import{C as $e}from"./checkbox-_FPlFvnC.js";import{b as Ee,a as ze,c as Fe,d as Me,e as Ve,D as Be}from"./dialog-bygvGgb9.js";import{b as _t,a as St,c as bt,D as Nt,d as kt,e as Dt,f as At}from"./drawer-Bjmg0RR1.js";import{u as wt}from"./tooltip-DuHhGuNb.js";import{D as Ue,a as He,b as Re,c as pe}from"./dropdown-menu-CkTzcUR8.js";import{F as Q,b as Y,c as J,d as Z,f as ee,a as Ce}from"./form-D_08NHUD.js";import{I as oe}from"./input-BGaLq3ax.js";import{S as Tt,a as It,b as Pt,c as Lt,d as le}from"./select-btdbQqQB.js";import{T as Ot}from"./textarea-CLLp6KTK.js";import{b as Ke,u as $t}from"./use-connection-DPPCfeow.js";import{u as Et,S as zt}from"./constants-V3SVDRSK.js";import{b as Ft}from"./use-virtual-mcp-BzxmTmXo.js";import{u as Mt,V as Vt}from"./agent-icon-BtPamQTT.js";import{n as he}from"./Container-CCYhpski.js";import{i as We}from"./DotsVertical-DUwrRRrO.js";import{s as Xe}from"./RefreshCcw01-NZxMXXUu.js";import{s as ge}from"./Star01-Dsz3MamR.js";import{s as qe}from"./Plus-D8dMVCG8.js";import{s as Ge}from"./Trash01-D5iQjfZH.js";import{s as Qe}from"./XClose-BtlseQCi.js";import{i as me,a as ve,E as Bt,c as Ut,p as Ht,b as Rt,d as Kt}from"./connection-form-helpers-Dn61c3nC.js";import"./collections-DYNhGJEX.js";import"./SwitchHorizontal01-DgnU6UpK.js";import"./Check-C6XoKiD0.js";import"./view-mode-toggle-BeU9M-dx.js";import"./badge-BI7NQRYo.js";import"./SearchMd-CZrB4Udl.js";import"./use-registry-connections-BLF2Iu3j.js";import"./use-organization-settings-AWz6cpVk.js";import"./useInfiniteQuery-B_xNiJ7y.js";import"./infiniteQueryObserver-CFFNkbfX.js";import"./card-BM5zwIyB.js";import"./sidebar-D-_ciNlc.js";import"./LayoutLeft-D-a-mZcm.js";import"./X-CghOqPiW.js";import"./use-view-mode-DPdHQRdb.js";import"./ChevronRight-lpVCFpWI.js";import"./label-BUt9seyW.js";import"./ChevronDown-BG0-uii1.js";import"./ChevronUp-C7MKl1aH.js";import"./use-collections-DV-Yw7Rl.js";import"./AlertCircle-BUiQNi1g.js";import"./Tool01-B6glW0Sz.js";import"./Stars02-DU-eReiu.js";import"./ArrowNarrowLeft-B-iJgi5p.js";import"./XCircle-BAnMq3y8.js";import"./ArrowUpRight-Bcc2ZOuq.js";import"./ZapSquare-B5X0r34a.js";import"./Users03-DxI7m72W.js";import"./CheckCircle-EJQkwVx_.js";import"./FilterLines-C2GeuQuW.js";import"./Palette-Cbp9TooA.js";import"./HardDrive-JbvyX314.js";import"./Key01-CDidhnng.js";import"./LinkExternal01-BgvZEm-X.js";import"./Lock01-DukFRLhX.js";import"./Monitor01-BBeIQXwu.js";import"./Sun-CjOl_eIW.js";import"./Play-Bu5xn8xm.js";import"./Settings02-DW-Wnk61.js";import"./Shield01-BF1LUqlj.js";import"./Upload01-CRbIaVuw.js";import"./User01-D-0COLHD.js";import"./Users01-BXsiu59O.js";import"./Zap-B9Rztg2v.js";function Wt(y){const e=ie.c(51),{group:n,onOpen:g,selectionMode:m,selectedIds:d,onToggleSelect:o}=y;let v;if(e[0]!==n.connections||e[1]!==d){let j;e[3]!==d?(j=U=>d.has(U.id),e[3]=d,e[4]=j):j=e[4],v=n.connections.every(j),e[0]=n.connections,e[1]=d,e[2]=v}else v=e[2];const h=v;let _;if(e[5]!==n.connections||e[6]!==d){let j;e[8]!==d?(j=U=>d.has(U.id),e[8]=d,e[9]=j):j=e[9],_=n.connections.some(j),e[5]=n.connections,e[6]=d,e[7]=_}else _=e[7];const u=_,S=`${n.connections.length} instances`;let x;e[10]!==n.icon||e[11]!==n.title||e[12]!==S?(x={title:n.title,icon:n.icon,description:S},e[10]=n.icon,e[11]=n.title,e[12]=S,e[13]=x):x=e[13];let a;e[14]!==h||e[15]!==n.connections||e[16]!==g||e[17]!==o||e[18]!==d||e[19]!==m?(a=()=>m?(()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)})():g(),e[14]=h,e[15]=n.connections,e[16]=g,e[17]=o,e[18]=d,e[19]=m,e[20]=a):a=e[20];const p=m&&h&&"ring-2 ring-primary",f=m&&u&&!h&&"ring-1 ring-primary/50";let k;e[21]!==p||e[22]!==f?(k=ce(p,f),e[21]=p,e[22]=f,e[23]=k):k=e[23];let A;e[24]===Symbol.for("react.memo_cache_sentinel")?(A=t.jsx(he,{}),e[24]=A):A=e[24];let N;e[25]!==h||e[26]!==n.connections||e[27]!==o||e[28]!==d||e[29]!==m||e[30]!==u?(N=m?t.jsx($e,{checked:h?!0:u?"indeterminate":!1,onCheckedChange:()=>{for(const j of n.connections)h?d.has(j.id)&&o(j.id):d.has(j.id)||o(j.id)}}):t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsxs("span",{className:"text-xs text-muted-foreground font-normal tabular-nums",children:["x",n.connections.length]})]}),e[25]=h,e[26]=n.connections,e[27]=o,e[28]=d,e[29]=m,e[30]=u,e[31]=N):N=e[31];const I=m?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100";let s;e[32]!==I?(s=ce("overflow-hidden transition-all duration-150 ease-out",I),e[32]=I,e[33]=s):s=e[33];let D;e[34]===Symbol.for("react.memo_cache_sentinel")?(D=t.jsx(He,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:qt,children:t.jsx(We,{size:20})})}),e[34]=D):D=e[34];let M;e[35]!==g?(M=j=>{j.stopPropagation(),g()},e[35]=g,e[36]=M):M=e[36];let $;e[37]===Symbol.for("react.memo_cache_sentinel")?($=t.jsx(Xe,{size:16}),e[37]=$):$=e[37];let P;e[38]!==M?(P=t.jsxs(Ue,{children:[D,t.jsx(Re,{align:"end",onClick:Xt,children:t.jsxs(pe,{onClick:M,children:[$,"Open"]})})]}),e[38]=M,e[39]=P):P=e[39];let T;e[40]!==s||e[41]!==P?(T=t.jsx("div",{className:s,children:P}),e[40]=s,e[41]=P,e[42]=T):T=e[42];let z;e[43]!==N||e[44]!==T?(z=t.jsxs("div",{className:"flex items-center gap-1",children:[N,T]}),e[43]=N,e[44]=T,e[45]=z):z=e[45];let F;return e[46]!==z||e[47]!==x||e[48]!==a||e[49]!==k?(F=t.jsx(t.Fragment,{children:t.jsx(fe,{connection:x,onClick:a,className:k,fallbackIcon:A,headerActionsAlwaysVisible:!0,headerActions:z})}),e[46]=z,e[47]=x,e[48]=a,e[49]=k,e[50]=F):F=e[50],F}function Xt(y){return y.stopPropagation()}function qt(y){return y.stopPropagation()}function Gt(y){const e=ie.c(28),{count:n,total:g,onSelectAll:m,onDeselectAll:d,onDelete:o,onAddToAgent:v,onToggleStatus:h,onCancel:_}=y;if(n===0)return null;let u;e[0]!==n?(u=t.jsxs("div",{className:"text-xs text-muted-foreground pr-1 tabular-nums",children:[n," selected"]}),e[0]=n,e[1]=u):u=e[1];let S;e[2]!==n||e[3]!==d||e[4]!==m||e[5]!==g?(S=n<g?t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:m,children:["Select all (",g,")"]}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:d,children:"Clear selection"}),e[2]=n,e[3]=d,e[4]=m,e[5]=g,e[6]=S):S=e[6];let x;e[7]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(qe,{size:13}),e[7]=x):x=e[7];let a;e[8]!==v?(a=t.jsxs(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:v,children:[x,"Add to Agent"]}),e[8]=v,e[9]=a):a=e[9];let p;e[10]!==h?(p=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("active"),children:"Enable"}),e[10]=h,e[11]=p):p=e[11];let f;e[12]!==h?(f=t.jsx(B,{variant:"outline",size:"sm",className:"h-7 text-xs px-2",onClick:()=>h("inactive"),children:"Disable"}),e[12]=h,e[13]=f):f=e[13];let k;e[14]===Symbol.for("react.memo_cache_sentinel")?(k=t.jsx(Ge,{size:13}),e[14]=k):k=e[14];let A;e[15]!==o?(A=t.jsxs(B,{variant:"destructive",size:"sm",className:"h-7 text-xs px-2",onClick:o,children:[k,"Delete"]}),e[15]=o,e[16]=A):A=e[16];let N;e[17]===Symbol.for("react.memo_cache_sentinel")?(N=t.jsx(Qe,{size:13}),e[17]=N):N=e[17];let I;e[18]!==_?(I=t.jsx(B,{variant:"ghost",size:"sm",className:"h-7 text-xs px-2",onClick:_,children:N}),e[18]=_,e[19]=I):I=e[19];let s;return e[20]!==u||e[21]!==I||e[22]!==S||e[23]!==a||e[24]!==p||e[25]!==f||e[26]!==A?(s=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:[u,S,a,p,f,A,I]})}),e[20]=u,e[21]=I,e[22]=S,e[23]=a,e[24]=p,e[25]=f,e[26]=A,e[27]=s):s=e[27],s}function Qt(y){const e=ie.c(25),{open:n,onOpenChange:g,agents:m,onConfirm:d}=y,[o,v]=W.useState(null);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=t.jsxs(Fe,{children:[t.jsx(Me,{children:"Add to Agent"}),t.jsx(Ve,{children:"Select an agent to add the selected connections to."})]}),e[0]=h):h=e[0];let _;e[1]!==m||e[2]!==o?(_=m.length===0?t.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No agents found"}):m.map(N=>t.jsxs("button",{type:"button",onClick:()=>v(N.id),className:ce("flex items-center gap-3 w-full rounded-md px-3 py-2 text-left transition-colors",o===N.id?"bg-primary/10 ring-1 ring-primary":"hover:bg-muted/50"),children:[t.jsx(xt,{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]=m,e[2]=o,e[3]=_):_=e[3];let u;e[4]!==_?(u=t.jsx("div",{className:"max-h-60 overflow-auto py-2 space-y-1",children:_}),e[4]=_,e[5]=u):u=e[5];let S;e[6]!==g?(S=t.jsx(B,{variant:"outline",onClick:()=>g(!1),children:"Cancel"}),e[6]=g,e[7]=S):S=e[7];const x=!o;let a;e[8]!==d||e[9]!==g||e[10]!==o?(a=()=>{o&&(d(o),g(!1),v(null))},e[8]=d,e[9]=g,e[10]=o,e[11]=a):a=e[11];let p;e[12]!==x||e[13]!==a?(p=t.jsx(B,{disabled:x,onClick:a,children:"Add"}),e[12]=x,e[13]=a,e[14]=p):p=e[14];let f;e[15]!==S||e[16]!==p?(f=t.jsxs(Be,{children:[S,p]}),e[15]=S,e[16]=p,e[17]=f):f=e[17];let k;e[18]!==u||e[19]!==f?(k=t.jsxs(ze,{className:"sm:max-w-[400px]",children:[h,u,f]}),e[18]=u,e[19]=f,e[20]=k):k=e[20];let A;return e[21]!==g||e[22]!==n||e[23]!==k?(A=t.jsx(Ee,{open:n,onOpenChange:g,children:k}),e[21]=g,e[22]=n,e[23]=k,e[24]=A):A=e[24],A}function Yt(y){const e=ie.c(20),{open:n,onOpenChange:g,count:m,onConfirm:d}=y,o=m!==1?"s":"";let v;e[0]!==m||e[1]!==o?(v=t.jsxs(De,{children:["Delete ",m," connection",o,"?"]}),e[0]=m,e[1]=o,e[2]=v):v=e[2];const h=m!==1?"s":"";let _;e[3]!==h?(_=t.jsxs(Ae,{children:["This will permanently delete the selected connection",h,". This action cannot be undone."]}),e[3]=h,e[4]=_):_=e[4];let u;e[5]!==v||e[6]!==_?(u=t.jsxs(we,{children:[v,_]}),e[5]=v,e[6]=_,e[7]=u):u=e[7];let S;e[8]===Symbol.for("react.memo_cache_sentinel")?(S=t.jsx(Te,{children:"Cancel"}),e[8]=S):S=e[8];const x=m!==1?"s":"";let a;e[9]!==m||e[10]!==d||e[11]!==x?(a=t.jsxs(Ie,{children:[S,t.jsxs(Pe,{onClick:d,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:["Delete ",m," connection",x]})]}),e[9]=m,e[10]=d,e[11]=x,e[12]=a):a=e[12];let p;e[13]!==u||e[14]!==a?(p=t.jsxs(Le,{children:[u,a]}),e[13]=u,e[14]=a,e[15]=p):p=e[15];let f;return e[16]!==g||e[17]!==n||e[18]!==p?(f=t.jsx(Oe,{open:n,onOpenChange:g,children:p}),e[16]=g,e[17]=n,e[18]=p,e[19]=f):f=e[19],f}function Jt(y){return y._registryId?.includes("community-registry")===!0}function Zt(y){const e=ie.c(56),{item:n,allConnections:g,connectedAppNames:m,connectingItemId:d,onNavigateConnected:o,onConnect:v}=y,[h,_]=W.useState(!1),[u,S]=W.useState(null);let x,a;e[0]!==m||e[1]!==n?(x=ke(n)??"",a=m.has(x),e[0]=m,e[1]=n,e[2]=x,e[3]=a):(x=e[2],a=e[3]);const p=a,f=n._meta?.["mcp.mesh"],k=f?.friendlyName||f?.friendly_name||n.server?.title||n.title||n.server?.name||n.name||n.id||"",A=n.server?.description||n.description||null;let N;e[4]!==n.server?.icons?.[0]?.src||e[5]!==n.server?.repository?(N=n.server?.icons?.[0]?.src||Ct(n.server?.repository)||null,e[4]=n.server?.icons?.[0]?.src,e[5]=n.server?.repository,e[6]=N):N=e[6];const I=N;let s;if(e[7]!==g||e[8]!==x){let b;e[10]!==x?(b=se=>se.connection_type!=="VIRTUAL"&&se.app_name===x,e[10]=x,e[11]=b):b=e[11],s=g.filter(b),e[7]=g,e[8]=x,e[9]=s}else s=e[9];const D=s;let M;e[12]!==n?(M=Jt(n),e[12]=n,e[13]=M):M=e[13];const $=M;let P,T;e[14]!==D||e[15]!==$||e[16]!==p||e[17]!==n||e[18]!==v||e[19]!==o?(P=()=>{if(p){const b=D[0];b&&o(b);return}T()},T=()=>{$?(S("connect"),_(!0)):v(n)},e[14]=D,e[15]=$,e[16]=p,e[17]=n,e[18]=v,e[19]=o,e[20]=P,e[21]=T):(P=e[20],T=e[21]);let z;e[22]!==n||e[23]!==v||e[24]!==u?(z=()=>{te("connections_community_warning_confirmed",{registry_item_id:n.id}),_(!1),u==="connect"&&v(n),S(null)},e[22]=n,e[23]=v,e[24]=u,e[25]=z):z=e[25];const F=z;let j;e[26]!==A||e[27]!==I||e[28]!==k?(j={title:k,description:A,icon:I},e[26]=A,e[27]=I,e[28]=k,e[29]=j):j=e[29];let U;e[30]===Symbol.for("react.memo_cache_sentinel")?(U=t.jsx(he,{}),e[30]=U):U=e[30];let H;e[31]!==$||e[32]!==n._sourceIcon?(H=$&&n._sourceIcon&&t.jsx("img",{src:n._sourceIcon,alt:"Community",className:"size-4 rounded-sm object-contain"}),e[31]=$,e[32]=n._sourceIcon,e[33]=H):H=e[33];let X;e[34]!==d||e[35]!==T||e[36]!==p||e[37]!==n.id?(X=p?t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}):t.jsx(B,{variant:"outline",size:"sm",className:"h-7 px-3 rounded-lg text-sm font-medium",disabled:d!==null,onClick:b=>{b.stopPropagation(),T()},children:d===n.id?t.jsx(re,{size:14,className:"animate-spin"}):"Connect"}),e[34]=d,e[35]=T,e[36]=p,e[37]=n.id,e[38]=X):X=e[38];let i;e[39]!==H||e[40]!==X?(i=t.jsxs("div",{className:"flex items-center gap-2",children:[H,X]}),e[39]=H,e[40]=X,e[41]=i):i=e[41];let C;e[42]!==P||e[43]!==i||e[44]!==j?(C=t.jsx(fe,{connection:j,fallbackIcon:U,onClick:P,headerActionsAlwaysVisible:!0,headerActions:i}),e[42]=P,e[43]=i,e[44]=j,e[45]=C):C=e[45];let V;e[46]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsxs(we,{children:[t.jsx(De,{children:"Community MCP Server"}),t.jsx(Ae,{children:"This MCP server is from the Community MCP Registry and is not maintained or verified by Deco. Community servers may have varying levels of quality, security, and reliability. Proceed with caution and review the server details before connecting."})]}),e[46]=V):V=e[46];let R;e[47]===Symbol.for("react.memo_cache_sentinel")?(R=t.jsx(Te,{children:"Cancel"}),e[47]=R):R=e[47];let E;e[48]!==F?(E=t.jsxs(Le,{children:[V,t.jsxs(Ie,{children:[R,t.jsx(Pe,{onClick:F,children:"Continue"})]})]}),e[48]=F,e[49]=E):E=e[49];let l;e[50]!==h||e[51]!==E?(l=t.jsx(Oe,{open:h,onOpenChange:_,children:E}),e[50]=h,e[51]=E,e[52]=l):l=e[52];let O;return e[53]!==C||e[54]!==l?(O=t.jsxs(t.Fragment,{children:[C,l]}),e[53]=C,e[54]=l,e[55]=O):O=e[55],O}function en({listState:y,activeTab:e,typeFilter:n,statusFilter:g,registryFilter:m,enabledRegistries:d}){const{org:o}=_e(),v=ot(),h=Se(),{data:_}=be.useSession(),u=Ke(),S=$t(y),x=gt(),[a,p]=W.useState(new Set),f=a.size>0,[k,A]=W.useState(!1),[N,I]=W.useState(!1),[s,D]=W.useState(null),M=Ft(),$=S.filter(r=>!(n!=="ALL"&&r.connection_type!==n||g!=="ALL"&&r.status!==g)),P=pt($),T=r=>{p(c=>{const w=new Set(c);return w.has(r)?w.delete(r):w.add(r),w})},z=()=>{p(new Set)},F=Ne(d,y.searchTerm),j=F.items,U=jt(F.loadMore,F.hasMore,F.isLoadingMore),H=new Set(S.filter(r=>r.app_name).map(r=>r.app_name)),X=m==="ALL"||d.some(r=>r.id===m)?m:"ALL",i=y.search.length>0,C=e==="all"||i?j.filter(r=>{if(X!=="ALL"&&r._registryId!==X)return!1;if(i){const c=ke(r);if(c&&H.has(c))return!1}return!0}):[],V=e==="connected"||i?P:[],R=async r=>{if(!(!o||!_?.user?.id)){te("connection_add_clicked",{action:"connect_new",registry_item_id:r.id,source:"connections_page"}),D(r.id);try{const c=vt(r,o.id,_.user.id,{remoteIndex:0}),w=c.connection_type==="STDIO",L=!!c.connection_url,q=w&&c.connection_headers&&typeof c.connection_headers=="object"&&"command"in c.connection_headers;if(!L&&!q){G.error("This MCP Server cannot be connected: no connection method available"),D(null);return}const{id:K}=await u.create.mutateAsync(c),je=new URL(`/api/${o.slug}/mcp/${K}`,window.location.origin),ye=await it({url:je.href,token:null,orgId:o.id});if(ye.supportsOAuth&&!ye.isAuthenticated){const{token:ae,tokenInfo:ne,error:xe}=await lt({connectionId:K,orgSlug:o.slug,scope:"offline_access"});if(xe||!ae){te("connection_oauth_failed",{connection_id:K,flow:"connections_page_connect",error:xe??"no_token"}),G.error(`Authentication failed: ${xe??"no token received"}`);return}else{if(te("connection_oauth_succeeded",{connection_id:K,flow:"connections_page_connect"}),ne)try{(await fetch(`/api/${o.slug}/connections/${K}/oauth-token`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({accessToken:ne.accessToken,refreshToken:ne.refreshToken,expiresIn:ne.expiresIn,scope:ne.scope,clientId:ne.clientId,clientSecret:ne.clientSecret,tokenEndpoint:ne.tokenEndpoint})})).ok?await u.update.mutateAsync({id:K,data:{}}):await u.update.mutateAsync({id:K,data:{connection_token:ae}})}catch{await u.update.mutateAsync({id:K,data:{connection_token:ae}})}else await u.update.mutateAsync({id:K,data:{connection_token:ae}});await v.invalidateQueries({queryKey:rt.isMCPAuthenticated(je.href,null)}),G.success("Authentication successful")}}G.success("Connected successfully")}catch(c){G.error(`Failed to connect: ${c instanceof Error?c.message:String(c)}`)}finally{D(null)}}},E=Et({connectionId:zt,orgId:o.id,orgSlug:o.slug}),l=()=>{v.invalidateQueries({predicate:r=>{const c=r.queryKey;return c[1]===o.id&&c[3]==="collection"&&c[4]==="CONNECTIONS"}})},O=async()=>{A(!1);const r=[...a];te("connections_bulk_delete",{count:r.length});let c=0;for(const w of r)try{(await E.callTool({name:"COLLECTION_CONNECTIONS_DELETE",arguments:{id:w,force:!0}})).isError||c++}catch{}l(),G.success(`Deleted ${c} connection${c!==1?"s":""}`),z()},b=async r=>{const c=[...a];te("connections_bulk_status_toggled",{count:c.length,to_status:r});let w=0;for(const L of c)try{await u.update.mutateAsync({id:L,data:{status:r}}),w++}catch{}l(),G.success(`${r==="active"?"Enabled":"Disabled"} ${w} connection${w!==1?"s":""}`),z()},se=async r=>{const c=M.find(q=>q.id===r);if(!c||!E)return;te("connections_bulk_add_to_agent",{agent_id:r,count:a.size});const w=new Set(c.connections.map(q=>q.connection_id)),L=[...a].filter(q=>!w.has(q)).map(q=>({connection_id:q,selected_tools:null,selected_resources:null,selected_prompts:null}));if(L.length===0){G.info("All selected connections are already in that agent");return}try{await E.callTool({name:"COLLECTION_VIRTUAL_MCP_UPDATE",arguments:{id:r,data:{connections:[...c.connections,...L]}}}),v.invalidateQueries({predicate:q=>{const K=q.queryKey;return K[1]===o.id&&K[3]==="collection"&&K[4]==="VIRTUAL_MCP"}}),G.success(`Added ${L.length} connection${L.length!==1?"s":""} to "${c.title}"`),z()}catch{G.error("Failed to add connections to agent")}};return t.jsxs(t.Fragment,{children:[t.jsx(ft,{...x}),t.jsx(Yt,{open:k,onOpenChange:A,count:a.size,onConfirm:O}),t.jsx(Qt,{open:N,onOpenChange:I,agents:M,onConfirm:se}),F.isInitialLoading&&e==="all"?t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}):t.jsx("div",{children:(i?C.length===0&&$.length===0:e==="all"?C.length===0:$.length===0)?t.jsx(ht,{image:t.jsx("img",{src:"/emptystate-mcp.svg",alt:"",width:336,height:320,"aria-hidden":"true"}),title:"No Connections found",description:y.search?`No Connections match "${y.search}"`:"Create a connection to get started."}):t.jsxs("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] gap-4",children:[V.map(r=>{if(r.type==="group")return t.jsx(Wt,{group:r,onOpen:()=>{h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:r.key}})},selectionMode:f,selectedIds:a,onToggleSelect:T},r.key);const c=r.connection,w=a.has(c.id);return t.jsx(fe,{connection:c,fallbackIcon:t.jsx(he,{}),onClick:()=>f?T(c.id):h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}}),className:ce(w&&"ring-2 ring-primary bg-primary/5"),headerActionsAlwaysVisible:!0,headerActions:t.jsxs("div",{className:"flex items-center gap-1",children:[f?t.jsx($e,{checked:w,onCheckedChange:()=>T(c.id),onClick:L=>L.stopPropagation()}):t.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"Connected"}),t.jsx("div",{className:ce("overflow-hidden transition-all duration-150 ease-out",f?"w-8 opacity-100":"w-0 opacity-0 group-hover:w-8 group-hover:opacity-100"),children:t.jsxs(Ue,{children:[t.jsx(He,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:L=>L.stopPropagation(),children:t.jsx(We,{size:20})})}),t.jsxs(Re,{align:"end",onClick:L=>L.stopPropagation(),children:[t.jsxs(pe,{onClick:L=>{L.stopPropagation(),h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}})},children:[t.jsx(Xe,{size:16}),"Open"]}),t.jsxs(pe,{onClick:L=>{L.stopPropagation(),T(c.id)},children:[t.jsx(Vt,{size:16}),"Select"]}),t.jsxs(pe,{variant:"destructive",onClick:L=>{L.stopPropagation(),x.requestDelete(c)},children:[t.jsx(Ge,{size:16}),"Delete"]})]})]})})]})},c.id)}),C.map(r=>t.jsx(Zt,{item:r,allConnections:S,connectedAppNames:H,connectingItemId:s,onNavigateConnected:c=>h({to:"/$org/settings/connections/$appSlug",params:{org:o.slug,appSlug:ue(c)}}),onConnect:R},`catalog-${r._registryId}:${r.id}`)),(e==="all"||i)&&d.length>0&&t.jsx("div",{ref:U,className:"col-span-full h-4"}),(e==="all"||i)&&F.isLoadingMore&&t.jsx("div",{className:"col-span-full flex justify-center py-6",children:t.jsx(re,{size:24,className:"animate-spin text-muted-foreground"})})]})}),f&&t.jsx(Gt,{count:a.size,total:$.length,onSelectAll:()=>{p(new Set($.map(r=>r.id)))},onDeselectAll:()=>p(new Set),onDelete:()=>A(!0),onAddToAgent:()=>I(!0),onToggleStatus:b,onCancel:z})]})}function tn(){const{org:y}=_e(),e=Se(),n=Je({strict:!1}),{data:g}=be.useSession(),{stdioEnabled:m}=Ze(),d=wt(),o=yt({namespace:y.slug,resource:"connections"}),v=Ke(),[h,_]=et(tt.connectionsTab(y.slug),i=>n.tab==="all"||n.tab==="connected"?n.tab:i??"all"),[u,S]=W.useState("ALL"),[x,a]=W.useState("ALL"),[p,f]=W.useState("ALL"),k=ut(),N=Ne(k,o.searchTerm).items,I=o.search!==o.searchTerm,s=nt({resolver:st(Ut),defaultValues:{title:"",description:null,icon:null,ui_type:"HTTP",connection_url:"",connection_token:null,npx_package:"",stdio_command:"",stdio_args:"",stdio_cwd:"",env_vars:[]}}),D=s.watch("ui_type"),M=s.watch("connection_url"),$=s.watch("npx_package"),P=me({uiType:D,connectionUrl:M??"",npxPackage:$??""})??ve({uiType:D,connectionUrl:M??"",registryItems:N}),T=n.action==="create",z=()=>{te("connections_custom_dialog_opened",{source:"connections_page"}),e({to:"/$org/settings/connections",params:{org:y.slug},search:{action:"create"}})},F=()=>{e({to:"/$org/settings/connections",params:{org:y.slug},search:{}})},j=async i=>{let C,V=null,R=null,E=null;i.ui_type==="NPX"?(C="STDIO",V="",E=Rt(i.npx_package||"",i.env_vars||[])):i.ui_type==="STDIO"?(C="STDIO",V="",E=Kt(i.stdio_command||"",i.stdio_args||"",i.stdio_cwd,i.env_vars||[])):(C=i.ui_type,V=i.connection_url||"",R=i.connection_token||null);const l=ct("conn");te("connection_custom_created",{connection_type:C,ui_type:i.ui_type}),await v.create.mutateAsync({id:l,title:i.title,description:i.description||null,connection_type:C,connection_url:V,connection_token:R,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),created_by:g?.user?.id||"system",organization_id:y.id,icon:i.icon??null,app_name:null,app_id:null,connection_headers:E,oauth_config:null,configuration_state:null,metadata:null,tools:null,bindings:null,status:"inactive"}),F(),s.reset(),e({to:"/$org/settings/connections/$appSlug",params:{org:y.slug,appSlug:ue({app_name:null,connection_url:V,title:i.title,id:l})}})},U=i=>{i||(T&&F(),s.reset())},H=i=>{const C=i.trim();if(!C)return;const V=!!s.formState.dirtyFields.title,R=!!s.formState.dirtyFields.description,E=!!s.formState.dirtyFields.env_vars,l=b=>{if(b&&(!V&&!s.getValues("title").trim()&&b.title&&s.setValue("title",b.title,{shouldDirty:!1}),!R&&!(s.getValues("description")??"").trim()&&b.description&&s.setValue("description",b.description,{shouldDirty:!1}),!E&&b.envVarKeys?.length)){const se=s.getValues("env_vars")??[],r=new Set(se.map(w=>w.key)),c=b.envVarKeys.filter(w=>!r.has(w));c.length>0&&s.setValue("env_vars",[...se,...c.map(w=>({key:w,value:""}))],{shouldDirty:!0})}},O=Ht(C);if(O&&m){s.setValue("ui_type","NPX",{shouldDirty:!0}),s.setValue("npx_package",O.packageName,{shouldDirty:!0}),s.setValue("connection_url","",{shouldDirty:!0}),s.setValue("connection_token",null,{shouldDirty:!0}),l(me({uiType:"NPX",npxPackage:O.packageName}));return}if(C.startsWith("http://")||C.startsWith("https://")){const b=D==="HTTP"||D==="SSE"||D==="Websocket"?D:"HTTP";s.setValue("ui_type",b,{shouldDirty:!0}),s.setValue("connection_url",C,{shouldDirty:!0}),l(me({uiType:b,connectionUrl:C})??ve({uiType:b,connectionUrl:C,registryItems:N}));return}D==="NPX"&&l(me({uiType:"NPX",npxPackage:C}))},X=t.jsx("div",{className:"flex items-center gap-2",children:t.jsxs(B,{variant:"outline",onClick:z,children:[t.jsx(qe,{size:14,className:"sm:hidden"}),t.jsx("span",{className:"hidden sm:inline",children:"Custom Connection"})]})});return t.jsx(t.Fragment,{children:t.jsxs(de,{children:[(()=>{const i="Create Connection",C="Create a custom connection in your organization. Fill in the details below.",V=s.formState.isSubmitting?"Saving...":"Create Connection",R=t.jsxs("div",{className:"grid gap-4",children:[t.jsx(Q,{control:s.control,name:"ui_type",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Type *"}),t.jsxs(Tt,{value:l.value,onValueChange:l.onChange,children:[t.jsx(Z,{children:t.jsx(It,{children:t.jsx(Pt,{})})}),t.jsxs(Lt,{children:[t.jsx(le,{value:"HTTP",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"HTTP"]})}),t.jsx(le,{value:"SSE",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"SSE"]})}),t.jsx(le,{value:"Websocket",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(ge,{className:"w-4 h-4"}),"Websocket"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsx(le,{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(le,{value:"STDIO",children:t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx(Mt,{className:"w-4 h-4"}),"Custom Command"]})})]})]})]}),t.jsx(ee,{})]})}),D==="NPX"&&t.jsx(Q,{control:s.control,name:"npx_package",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"NPM Package *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"@perplexity-ai/mcp-server",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("npx_package",b.trim(),{shouldDirty:!0}),H(b))},onBlur:O=>{H(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),D==="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 items-start",children:[t.jsx(Q,{control:s.control,name:"stdio_command",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Command *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"node, bun, python...",...l,value:l.value??""})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"stdio_args",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Arguments"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"arg1 arg2 --flag value",...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"stdio_cwd",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Working Directory"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"/path/to/project (optional)",...l,value:l.value??""})}),t.jsx("p",{className:"text-xs text-muted-foreground",children:"Directory where the command will be executed"}),t.jsx(ee,{})]})})]}),(D==="NPX"||D==="STDIO")&&t.jsx(Q,{control:s.control,name:"env_vars",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Environment Variables"}),t.jsx(Z,{children:t.jsx(Bt,{value:l.value??[],onChange:l.onChange})}),t.jsx(ee,{})]})}),D!=="NPX"&&D!=="STDIO"&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{control:s.control,name:"connection_url",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"URL *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"https://example.com/mcp",...l,value:l.value??"",onPaste:O=>{const b=O.clipboardData.getData("text");b&&(O.preventDefault(),s.setValue("connection_url",b.trim(),{shouldDirty:!0}),H(b))},onBlur:O=>{H(O.target.value),l.onBlur()}})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"connection_token",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:P?.token?.label??"Token (optional)"}),t.jsx(Z,{children:t.jsx(oe,{type:"password",placeholder:P?.token?.placeholder??"Bearer token or API key",...l,value:l.value??""})}),P?.token?.helperText&&t.jsxs("p",{className:"text-xs text-muted-foreground",children:[P.token.helperText,P.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(ee,{})]})})]}),t.jsx(Q,{control:s.control,name:"title",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Name *"}),t.jsx(Z,{children:t.jsx(oe,{placeholder:"My Connection",...l})}),t.jsx(ee,{})]})}),t.jsx(Q,{control:s.control,name:"description",render:({field:l})=>t.jsxs(Y,{children:[t.jsx(J,{children:"Description"}),t.jsx(Z,{children:t.jsx(Ot,{placeholder:"A brief description of this connection",rows:3,...l,value:l.value??""})}),t.jsx(ee,{})]})})]}),E=T;return d?t.jsx(_t,{open:E,onOpenChange:U,children:t.jsxs(St,{className:"max-h-[90vh]",children:[t.jsx(bt,{className:"pb-2",children:t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"flex-1 text-left",children:[t.jsx(Nt,{children:i}),t.jsx(kt,{className:"mt-1",children:C})]}),t.jsx(Dt,{asChild:!0,children:t.jsx(B,{variant:"ghost",size:"icon",className:"shrink-0 -mt-1",children:t.jsx(Qe,{size:16})})})]})}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"overflow-y-auto px-4 pb-4",children:R}),t.jsx(At,{children:t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"w-full",children:V})})]})})]})}):t.jsx(Ee,{open:E,onOpenChange:U,children:t.jsxs(ze,{className:"sm:max-w-[525px]",children:[t.jsxs(Fe,{children:[t.jsx(Me,{children:i}),t.jsx(Ve,{children:C})]}),t.jsx(Ce,{...s,children:t.jsxs("form",{onSubmit:s.handleSubmit(j),children:[t.jsx("div",{className:"py-4",children:R}),t.jsxs(Be,{children:[t.jsx(B,{type:"button",variant:"outline",onClick:()=>U(!1),children:"Cancel"}),t.jsx(B,{type:"submit",disabled:s.formState.isSubmitting,className:"min-w-40",children:V})]})]})})]})})})(),t.jsx(de.Content,{children:t.jsx(de.Body,{children:t.jsxs("div",{className:"flex flex-col gap-6",children:[t.jsx(de.Title,{children:"Connections"}),t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(dt,{value:o.search,onChange:o.setSearch,placeholder:"Search for a connection",className:"w-full md:w-[375px]",onKeyDown:i=>{i.key==="Escape"&&(o.setSearch(""),i.target.blur())}}),t.jsx(at,{sortKey:o.sortKey,sortDirection:o.sortDirection,onSort:o.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:u,onChange:i=>S(i||"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:x,onChange:i=>a(i||"ALL"),options:[{id:"ALL",label:"All"},{id:"active",label:"Active"},{id:"inactive",label:"Inactive"},{id:"error",label:"Error"}]},...k.length>1?[{label:"Registry",value:p,onChange:i=>f(i||"ALL"),options:[{id:"ALL",label:"All registries"},...k.map(i=>({id:i.id,label:i.id.includes("community-registry")?"Community MCP Registry":i.title}))]}]:[]]})]}),X]}),t.jsx(mt,{tabs:[{id:"all",label:"All"},{id:"connected",label:"Connected"}],activeTab:h,onTabChange:i=>{const C=i;C!==h&&te("connections_page_tab_changed",{to_tab:C}),_(C)}}),t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx("div",{style:{opacity:I?.5:1,transition:I?"opacity 0.2s 0.2s linear":"opacity 0s 0s linear",pointerEvents:I?"none":"auto"},children:t.jsx(en,{listState:o,activeTab:h,typeFilter:u,statusFilter:x,registryFilter:p,enabledRegistries:k})})})]})})})]})})}function Ts(){const y=ie.c(1);let e;return y[0]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(Ye,{children:t.jsx(W.Suspense,{fallback:t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(re,{size:32,className:"animate-spin text-muted-foreground"})}),children:t.jsx(tn,{})})}),y[0]=e):e=y[0],e}export{Ts as default};